From svnnotify ¡÷ sourceforge.jp Mon Dec 1 08:59:49 2008 From: svnnotify ¡÷ sourceforge.jp (svnnotify ¡÷ sourceforge.jp) Date: Mon, 01 Dec 2008 08:59:49 +0900 Subject: [pal-cvs 3744] [1479] updated styles, added translation. Message-ID: <1228089589.891970.22121.nullmailer@users.sourceforge.jp> Revision: 1479 http://svn.sourceforge.jp/view?root=pal&view=rev&rev=1479 Author: shinsuke Date: 2008-12-01 08:59:49 +0900 (Mon, 01 Dec 2008) Log Message: ----------- updated styles, added translation. Modified Paths: -------------- board/trunk/src/main/resources/application.properties board/trunk/src/main/resources/application_ja.properties board/trunk/src/main/webapp/WEB-INF/view/category/edit/edit.jsp board/trunk/src/main/webapp/WEB-INF/view/config/index.jsp board/trunk/src/main/webapp/WEB-INF/view/message/admin/confirm.jsp board/trunk/src/main/webapp/WEB-INF/view/message/admin/edit.jsp board/trunk/src/main/webapp/WEB-INF/view/message/admin/index.jsp board/trunk/src/main/webapp/WEB-INF/view/message/view/confirm.jsp board/trunk/src/main/webapp/WEB-INF/view/message/view/edit.jsp board/trunk/src/main/webapp/WEB-INF/view/message/view/index.jsp -------------- next part -------------- Modified: board/trunk/src/main/resources/application.properties =================================================================== --- board/trunk/src/main/resources/application.properties 2008-11-29 23:07:54 UTC (rev 1478) +++ board/trunk/src/main/resources/application.properties 2008-11-30 23:59:49 UTC (rev 1479) @@ -137,3 +137,20 @@ labels.role_prefix=Role: labels.group_prefix=Group: + +labels.content=Content +labels.displayName=Display Name +labels.endTimeForTime=End Time +labels.memo=Memo +labels.messageAttachmentSize=Attachment Size +labels.messageMaxLength=Max Length of Message +labels.name=Name +labels.replyContent=Content +labels.replyDisplayName=Display Name +labels.replyMaxLength=Max Length of Reply +labels.startTimeForTime=Start Time +labels.title=Title +labels.accessType=Access Type +labels.categoryId=Category Id +labels.messageEditableOnPublic=Is Editable On Public +labels.status=Status Modified: board/trunk/src/main/resources/application_ja.properties =================================================================== --- board/trunk/src/main/resources/application_ja.properties 2008-11-29 23:07:54 UTC (rev 1478) +++ board/trunk/src/main/resources/application_ja.properties 2008-11-30 23:59:49 UTC (rev 1479) @@ -125,3 +125,20 @@ labels.role_prefix=\u30ed\u30fc\u30eb: labels.group_prefix=\u30b0\u30eb\u30fc\u30d7: + +labels.content=\u30b3\u30f3\u30c6\u30f3\u30c8 +labels.displayName=\u8868\u793a\u540d +labels.endTimeForTime=\u7d42\u4e86\u6642\u523b +labels.memo=\u30e1\u30e2 +labels.messageAttachmentSize=\u6dfb\u4ed8\u30b5\u30a4\u30ba +labels.messageMaxLength=\u30e1\u30c3\u30bb\u30fc\u30b8\u306e\u6700\u5927\u6587\u5b57\u6570 +labels.name=\u540d\u524d +labels.replyContent=\u30b3\u30f3\u30c6\u30f3\u30c4 +labels.replyDisplayName=\u8868\u793a\u540d +labels.replyMaxLength=\u8fd4\u4fe1\u30b3\u30e1\u30f3\u30c8\u306e\u6700\u5927\u6587\u5b57\u6570 +labels.startTimeForTime=\u958b\u59cb\u6642\u523b +labels.title=\u30bf\u30a4\u30c8\u30eb +labels.accessType=\u30a2\u30af\u30bb\u30b9\u30bf\u30a4\u30d7 +labels.categoryId=\u30ab\u30c6\u30b4\u30ea ID +labels.messageEditableOnPublic=\u516c\u958b\u72b6\u614b\u3067\u7de8\u96c6\u53ef\u80fd +labels.status=\u72b6\u614b Modified: board/trunk/src/main/webapp/WEB-INF/view/category/edit/edit.jsp =================================================================== --- board/trunk/src/main/webapp/WEB-INF/view/category/edit/edit.jsp 2008-11-29 23:07:54 UTC (rev 1478) +++ board/trunk/src/main/webapp/WEB-INF/view/category/edit/edit.jsp 2008-11-30 23:59:49 UTC (rev 1479) @@ -31,7 +31,7 @@ - + Modified: board/trunk/src/main/webapp/WEB-INF/view/config/index.jsp =================================================================== --- board/trunk/src/main/webapp/WEB-INF/view/config/index.jsp 2008-11-29 23:07:54 UTC (rev 1478) +++ board/trunk/src/main/webapp/WEB-INF/view/config/index.jsp 2008-11-30 23:59:49 UTC (rev 1479) @@ -29,11 +29,11 @@ Åê¹Æµ­»ö¤ÎºÇÂçʸ»ú¿ô - + ÊÖ¿®¤ÎºÇÂçʸ»ú¿ô - + Åê¹Æ¸å¤ÎÊÔ½¸ Modified: board/trunk/src/main/webapp/WEB-INF/view/message/admin/confirm.jsp =================================================================== --- board/trunk/src/main/webapp/WEB-INF/view/message/admin/confirm.jsp 2008-11-29 23:07:54 UTC (rev 1478) +++ board/trunk/src/main/webapp/WEB-INF/view/message/admin/confirm.jsp 2008-11-30 23:59:49 UTC (rev 1479) @@ -46,12 +46,12 @@ -
+
- + @@ -128,7 +128,7 @@
${f:h(displayName)}
-
+
@@ -151,17 +151,17 @@ -
+
- - + + - + @@ -173,13 +173,13 @@
-
+
- +
- + Modified: board/trunk/src/main/webapp/WEB-INF/view/message/admin/edit.jsp =================================================================== --- board/trunk/src/main/webapp/WEB-INF/view/message/admin/edit.jsp 2008-11-29 23:07:54 UTC (rev 1478) +++ board/trunk/src/main/webapp/WEB-INF/view/message/admin/edit.jsp 2008-11-30 23:59:49 UTC (rev 1479) @@ -52,15 +52,15 @@ - + - + - + @@ -141,7 +141,7 @@ - + Modified: board/trunk/src/main/webapp/WEB-INF/view/message/admin/index.jsp =================================================================== --- board/trunk/src/main/webapp/WEB-INF/view/message/admin/index.jsp 2008-11-29 23:07:54 UTC (rev 1478) +++ board/trunk/src/main/webapp/WEB-INF/view/message/admin/index.jsp 2008-11-30 23:59:49 UTC (rev 1479) @@ -42,7 +42,7 @@
:${f:h(r.displayName)}${f:h(r.displayName)}
${f:br(f:nbsp(f:h(r.content)))}
:
-
+
Modified: board/trunk/src/main/webapp/WEB-INF/view/message/view/confirm.jsp =================================================================== --- board/trunk/src/main/webapp/WEB-INF/view/message/view/confirm.jsp 2008-11-29 23:07:54 UTC (rev 1478) +++ board/trunk/src/main/webapp/WEB-INF/view/message/view/confirm.jsp 2008-11-30 23:59:49 UTC (rev 1479) @@ -46,12 +46,12 @@ -
+
- + @@ -128,7 +128,7 @@
${f:h(displayName)}
-
+
@@ -151,17 +151,17 @@ -
+
- - + + - + @@ -173,13 +173,13 @@
-
+
- +
- + Modified: board/trunk/src/main/webapp/WEB-INF/view/message/view/edit.jsp =================================================================== --- board/trunk/src/main/webapp/WEB-INF/view/message/view/edit.jsp 2008-11-29 23:07:54 UTC (rev 1478) +++ board/trunk/src/main/webapp/WEB-INF/view/message/view/edit.jsp 2008-11-30 23:59:49 UTC (rev 1479) @@ -52,15 +52,15 @@ - + - + - + @@ -141,7 +141,7 @@ - + Modified: board/trunk/src/main/webapp/WEB-INF/view/message/view/index.jsp =================================================================== --- board/trunk/src/main/webapp/WEB-INF/view/message/view/index.jsp 2008-11-29 23:07:54 UTC (rev 1478) +++ board/trunk/src/main/webapp/WEB-INF/view/message/view/index.jsp 2008-11-30 23:59:49 UTC (rev 1479) @@ -42,7 +42,7 @@
:${f:h(r.displayName)}${f:h(r.displayName)}
${f:br(f:nbsp(f:h(r.content)))}
:
-
+
From svnnotify ¡÷ sourceforge.jp Mon Dec 1 09:26:45 2008 From: svnnotify ¡÷ sourceforge.jp (svnnotify ¡÷ sourceforge.jp) Date: Mon, 01 Dec 2008 09:26:45 +0900 Subject: [pal-cvs 3745] [1480] updated style. Message-ID: <1228091205.428404.20021.nullmailer@users.sourceforge.jp> Revision: 1480 http://svn.sourceforge.jp/view?root=pal&view=rev&rev=1480 Author: shinsuke Date: 2008-12-01 09:26:45 +0900 (Mon, 01 Dec 2008) Log Message: ----------- updated style. Modified Paths: -------------- addresslist/trunk/src/main/resources/application.properties addresslist/trunk/src/main/resources/application_ja.properties addresslist/trunk/src/main/webapp/WEB-INF/view/admin/company/edit.jsp addresslist/trunk/src/main/webapp/WEB-INF/view/admin/person/confirm.jsp addresslist/trunk/src/main/webapp/WEB-INF/view/admin/person/edit.jsp addresslist/trunk/src/main/webapp/WEB-INF/view/admin/person/index.jsp addresslist/trunk/src/main/webapp/WEB-INF/view/config/index.jsp addresslist/trunk/src/main/webapp/WEB-INF/view/user/company/edit.jsp addresslist/trunk/src/main/webapp/WEB-INF/view/user/person/confirm.jsp addresslist/trunk/src/main/webapp/WEB-INF/view/user/person/edit.jsp addresslist/trunk/src/main/webapp/WEB-INF/view/user/person/index.jsp -------------- next part -------------- Modified: addresslist/trunk/src/main/resources/application.properties =================================================================== --- addresslist/trunk/src/main/resources/application.properties 2008-11-30 23:59:49 UTC (rev 1479) +++ addresslist/trunk/src/main/resources/application.properties 2008-12-01 00:26:45 UTC (rev 1480) @@ -108,16 +108,16 @@ labels.j_title=Job Title labels.contact=Contact -labels.tel_h=Telephone (Home) -labels.tel_mh=Cell Phone (Home) -labels.mail_hp=Email (Home PC) -labels.mail_hm=Email (Home Mobile) -labels.fax_h=FAX (Home) -labels.tel_b=Telephone (Business) -labels.tel_mb=Cell Phone (Business) -labels.mail_bp=Email (Business PC) -labels.mail_bm=Email (Business Mobile) -labels.fax_b=FAX (Business) +labels.tel_h=Telephone +labels.tel_mh=Cell Phone +labels.mail_hp=Email (PC) +labels.mail_hm=Email (Mobile) +labels.fax_h=FAX +labels.tel_b=Telephone +labels.tel_mb=Cell Phone +labels.mail_bp=Email (PC) +labels.mail_bm=Email (Mobile) +labels.fax_b=FAX labels.home=Home labels.c_o_company=Confirmation of Company @@ -136,3 +136,7 @@ labels.createdBy=Created By +labels.home_contact=Home +labels.business_contact=Business + +labels.givenName=Given Name Modified: addresslist/trunk/src/main/resources/application_ja.properties =================================================================== --- addresslist/trunk/src/main/resources/application_ja.properties 2008-11-30 23:59:49 UTC (rev 1479) +++ addresslist/trunk/src/main/resources/application_ja.properties 2008-12-01 00:26:45 UTC (rev 1480) @@ -101,16 +101,16 @@ labels.j_title=\u5f79\u8077 labels.contact=\u9023\u7d61\u5148 -labels.tel_h=\u96fb\u8a71\u756a\u53f7 (\u500b\u4eba\u7528\u81ea\u5b85) -labels.tel_mh=\u96fb\u8a71\u756a\u53f7 (\u500b\u4eba\u7528\u643a\u5e2f\u96fb\u8a71) -labels.mail_hp=\u30e1\u30fc\u30eb\u30a2\u30c9\u30ec\u30b9 (\u500b\u4eba\u7528 PC) -labels.mail_hm=\u30e1\u30fc\u30eb\u30a2\u30c9\u30ec\u30b9 (\u500b\u4eba\u7528\u643a\u5e2f\u96fb\u8a71) -labels.fax_h=FAX (\u500b\u4eba\u7528) -labels.tel_b=\u96fb\u8a71\u756a\u53f7 (\u4f1a\u793e) -labels.tel_mb=\u96fb\u8a71\u756a\u53f7 (\u4f1a\u793e\u7528\u643a\u5e2f\u96fb\u8a71) -labels.mail_bp=\u30e1\u30fc\u30eb\u30a2\u30c9\u30ec\u30b9 (\u4f1a\u793e\u7528 PC) -labels.mail_bm=\u30e1\u30fc\u30eb\u30a2\u30c9\u30ec\u30b9 (\u4f1a\u793e\u7528\u643a\u5e2f\u96fb\u8a71) -labels.fax_b=FAX (\u4f1a\u793e) +labels.tel_h=\u96fb\u8a71\u756a\u53f7 (\u81ea\u5b85) +labels.tel_mh=\u96fb\u8a71\u756a\u53f7 (\u643a\u5e2f) +labels.mail_hp=\u30e1\u30fc\u30eb\u30a2\u30c9\u30ec\u30b9 (PC) +labels.mail_hm=\u30e1\u30fc\u30eb\u30a2\u30c9\u30ec\u30b9 (\u643a\u5e2f) +labels.fax_h=FAX +labels.tel_b=\u96fb\u8a71\u756a\u53f7 +labels.tel_mb=\u96fb\u8a71\u756a\u53f7 (\u643a\u5e2f) +labels.mail_bp=\u30e1\u30fc\u30eb\u30a2\u30c9\u30ec\u30b9 (PC) +labels.mail_bm=\u30e1\u30fc\u30eb\u30a2\u30c9\u30ec\u30b9 (\u643a\u5e2f) +labels.fax_b=FAX labels.home=\u81ea\u5b85 labels.c_o_company=\u4f1a\u793e\u60c5\u5831\u306e\u78ba\u8a8d @@ -128,3 +128,9 @@ labels.configuration=\u8a2d\u5b9a labels.createdBy=\u767b\u9332\u8005 + +labels.home_contact=\u81ea\u5b85\u7528 +labels.business_contact=\u4f1a\u793e\u7528 + +labels.givenName=\u59d3\u540d + Modified: addresslist/trunk/src/main/webapp/WEB-INF/view/admin/company/edit.jsp =================================================================== --- addresslist/trunk/src/main/webapp/WEB-INF/view/admin/company/edit.jsp 2008-11-30 23:59:49 UTC (rev 1479) +++ addresslist/trunk/src/main/webapp/WEB-INF/view/admin/company/edit.jsp 2008-12-01 00:26:45 UTC (rev 1480) @@ -46,55 +46,55 @@ - + - + - + - + - + - + - + - + - + - + - + - + - + Modified: addresslist/trunk/src/main/webapp/WEB-INF/view/admin/person/confirm.jsp =================================================================== --- addresslist/trunk/src/main/webapp/WEB-INF/view/admin/person/confirm.jsp 2008-11-30 23:59:49 UTC (rev 1479) +++ addresslist/trunk/src/main/webapp/WEB-INF/view/admin/person/confirm.jsp 2008-12-01 00:26:45 UTC (rev 1480) @@ -45,7 +45,7 @@ - + @@ -101,6 +101,7 @@ - + - + - + - +
+ @@ -122,9 +123,14 @@ + +
${f:h(homeFax)}
+ + + - - + + Modified: addresslist/trunk/src/main/webapp/WEB-INF/view/admin/person/edit.jsp =================================================================== --- addresslist/trunk/src/main/webapp/WEB-INF/view/admin/person/edit.jsp 2008-11-30 23:59:49 UTC (rev 1479) +++ addresslist/trunk/src/main/webapp/WEB-INF/view/admin/person/edit.jsp 2008-12-01 00:26:45 UTC (rev 1480) @@ -51,39 +51,39 @@ - + - + - + - + - + - + - + - + - + @@ -102,46 +102,52 @@ - + - + - + - + - +
${f:h(businessTelephone)}${f:h(businessTelephone)}
+ - + - + - + - + - + + +
+ + + - - + + - + - + - + - +
@@ -154,23 +160,23 @@
@@ -194,19 +200,19 @@
Modified: addresslist/trunk/src/main/webapp/WEB-INF/view/admin/person/index.jsp =================================================================== --- addresslist/trunk/src/main/webapp/WEB-INF/view/admin/person/index.jsp 2008-11-30 23:59:49 UTC (rev 1479) +++ addresslist/trunk/src/main/webapp/WEB-INF/view/admin/person/index.jsp 2008-12-01 00:26:45 UTC (rev 1480) @@ -43,7 +43,7 @@ - + Modified: addresslist/trunk/src/main/webapp/WEB-INF/view/config/index.jsp =================================================================== --- addresslist/trunk/src/main/webapp/WEB-INF/view/config/index.jsp 2008-11-30 23:59:49 UTC (rev 1479) +++ addresslist/trunk/src/main/webapp/WEB-INF/view/config/index.jsp 2008-12-01 00:26:45 UTC (rev 1480) @@ -29,7 +29,7 @@ - + Modified: addresslist/trunk/src/main/webapp/WEB-INF/view/user/company/edit.jsp =================================================================== --- addresslist/trunk/src/main/webapp/WEB-INF/view/user/company/edit.jsp 2008-11-30 23:59:49 UTC (rev 1479) +++ addresslist/trunk/src/main/webapp/WEB-INF/view/user/company/edit.jsp 2008-12-01 00:26:45 UTC (rev 1480) @@ -46,55 +46,55 @@ - + - + - + - + - + - + - + - + - + - + - + - + - + Modified: addresslist/trunk/src/main/webapp/WEB-INF/view/user/person/confirm.jsp =================================================================== --- addresslist/trunk/src/main/webapp/WEB-INF/view/user/person/confirm.jsp 2008-11-30 23:59:49 UTC (rev 1479) +++ addresslist/trunk/src/main/webapp/WEB-INF/view/user/person/confirm.jsp 2008-12-01 00:26:45 UTC (rev 1480) @@ -45,7 +45,7 @@ - + + + + + + + Modified: userinfo/trunk/src/main/webapp/WEB-INF/view/userInfo/edit.jsp =================================================================== --- userinfo/trunk/src/main/webapp/WEB-INF/view/userInfo/edit.jsp 2008-12-31 06:06:45 UTC (rev 1648) +++ userinfo/trunk/src/main/webapp/WEB-INF/view/userInfo/edit.jsp 2008-12-31 12:49:08 UTC (rev 1649) @@ -52,7 +52,17 @@ + + + + + + + + + + From svnnotify ¡÷ sourceforge.jp Wed Dec 31 21:51:23 2008 From: svnnotify ¡÷ sourceforge.jp (svnnotify ¡÷ sourceforge.jp) Date: Wed, 31 Dec 2008 21:51:23 +0900 Subject: [pal-cvs 3915] [1650] updated eclipse file, and added a password update. Message-ID: <1230727883.538707.991.nullmailer@users.sourceforge.jp> Revision: 1650 http://svn.sourceforge.jp/view?root=pal&view=rev&rev=1650 Author: shinsuke Date: 2008-12-31 21:51:23 +0900 (Wed, 31 Dec 2008) Log Message: ----------- updated eclipse file, and added a password update. Modified Paths: -------------- userinfo/plugins/userinfo-palportal-plugin/trunk/.classpath userinfo/plugins/userinfo-palportal-plugin/trunk/src/main/java/jp/sf/pal/userinfo/plugin/impl/PortalPluginImpl.java -------------- next part -------------- Modified: userinfo/plugins/userinfo-palportal-plugin/trunk/.classpath =================================================================== --- userinfo/plugins/userinfo-palportal-plugin/trunk/.classpath 2008-12-31 12:49:08 UTC (rev 1649) +++ userinfo/plugins/userinfo-palportal-plugin/trunk/.classpath 2008-12-31 12:51:23 UTC (rev 1650) @@ -43,5 +43,5 @@ - + \ No newline at end of file Modified: userinfo/plugins/userinfo-palportal-plugin/trunk/src/main/java/jp/sf/pal/userinfo/plugin/impl/PortalPluginImpl.java =================================================================== --- userinfo/plugins/userinfo-palportal-plugin/trunk/src/main/java/jp/sf/pal/userinfo/plugin/impl/PortalPluginImpl.java 2008-12-31 12:49:08 UTC (rev 1649) +++ userinfo/plugins/userinfo-palportal-plugin/trunk/src/main/java/jp/sf/pal/userinfo/plugin/impl/PortalPluginImpl.java 2008-12-31 12:51:23 UTC (rev 1650) @@ -152,6 +152,13 @@ } try { + // update password + if (!StringUtils.isEmpty(userInfo.getPassword())) { + getUserManager().setPassword(userInfo.getUserId(), null, + userInfo.getPassword()); + } + + // update attribute User user = userManager.getUser(userInfo.getUserId()); Preferences prefs = user.getUserAttributes(); for (Map.Entry entry : userInfo @@ -159,7 +166,7 @@ prefs.put(entry.getKey(), entry.getValue()); } - // Set role + // update role RoleManager roleManager = getRoleManager(); for (Iterator itr = roleManager.getRolesForUser( userInfo.getUserId()).iterator(); itr.hasNext();) { @@ -174,7 +181,7 @@ } } - // Set group + // update group GroupManager groupManager = getGroupManager(); for (Iterator itr = groupManager.getGroupsForUser( userInfo.getUserId()).iterator(); itr.hasNext();) {
@@ -107,6 +107,7 @@ - + - + - + - +
+ @@ -128,9 +129,14 @@ + +
${f:h(homeFax)}
+ + + - - + + Modified: addresslist/trunk/src/main/webapp/WEB-INF/view/user/person/edit.jsp =================================================================== --- addresslist/trunk/src/main/webapp/WEB-INF/view/user/person/edit.jsp 2008-11-30 23:59:49 UTC (rev 1479) +++ addresslist/trunk/src/main/webapp/WEB-INF/view/user/person/edit.jsp 2008-12-01 00:26:45 UTC (rev 1480) @@ -51,39 +51,39 @@ - + - + - + - + - + - + - + - + - + @@ -102,46 +102,52 @@ - + - + - + - + - +
${f:h(businessTelephone)}${f:h(businessTelephone)}
+ - + - + - + - + - + + +
+ + + - - + + - + - + - + - +
@@ -154,23 +160,23 @@
@@ -194,19 +200,19 @@
Modified: addresslist/trunk/src/main/webapp/WEB-INF/view/user/person/index.jsp =================================================================== --- addresslist/trunk/src/main/webapp/WEB-INF/view/user/person/index.jsp 2008-11-30 23:59:49 UTC (rev 1479) +++ addresslist/trunk/src/main/webapp/WEB-INF/view/user/person/index.jsp 2008-12-01 00:26:45 UTC (rev 1480) @@ -43,7 +43,7 @@ - + From svnnotify ¡÷ sourceforge.jp Mon Dec 1 09:48:54 2008 From: svnnotify ¡÷ sourceforge.jp (svnnotify ¡÷ sourceforge.jp) Date: Mon, 01 Dec 2008 09:48:54 +0900 Subject: [pal-cvs 3746] [1481] updated styles. Message-ID: <1228092534.481470.10332.nullmailer@users.sourceforge.jp> Revision: 1481 http://svn.sourceforge.jp/view?root=pal&view=rev&rev=1481 Author: shinsuke Date: 2008-12-01 09:48:54 +0900 (Mon, 01 Dec 2008) Log Message: ----------- updated styles. Modified Paths: -------------- bookmark/trunk/src/main/java/jp/sf/pal/bookmark/form/admin/LinkForm.java bookmark/trunk/src/main/resources/application.properties bookmark/trunk/src/main/resources/application_ja.properties bookmark/trunk/src/main/webapp/WEB-INF/view/admin/category/edit.jsp bookmark/trunk/src/main/webapp/WEB-INF/view/admin/link/edit.jsp bookmark/trunk/src/main/webapp/WEB-INF/view/user/category/edit.jsp bookmark/trunk/src/main/webapp/WEB-INF/view/user/link/confirm.jsp bookmark/trunk/src/main/webapp/WEB-INF/view/user/link/edit.jsp bookmark/trunk/src/main/webapp/WEB-INF/view/user/link/index.jsp -------------- next part -------------- Modified: bookmark/trunk/src/main/java/jp/sf/pal/bookmark/form/admin/LinkForm.java =================================================================== --- bookmark/trunk/src/main/java/jp/sf/pal/bookmark/form/admin/LinkForm.java 2008-12-01 00:26:45 UTC (rev 1480) +++ bookmark/trunk/src/main/java/jp/sf/pal/bookmark/form/admin/LinkForm.java 2008-12-01 00:48:54 UTC (rev 1481) @@ -27,10 +27,13 @@ @Maxbytelength(maxbytelength = 200) public String memo; + @Required(target = "confirm,create,update,delete") public String url; + @Required(target = "confirm,create,update,delete") public String type; + @Required(target = "confirm,create,update,delete") @IntegerType public String sortOrder; Modified: bookmark/trunk/src/main/resources/application.properties =================================================================== --- bookmark/trunk/src/main/resources/application.properties 2008-12-01 00:26:45 UTC (rev 1480) +++ bookmark/trunk/src/main/resources/application.properties 2008-12-01 00:48:54 UTC (rev 1481) @@ -51,7 +51,7 @@ labels.category_list=Category List labels.action=Action labels.category_info=Category Infomation -labels.category_name=Category Name +labels.category_name=Name labels.order=Sort Order labels.move_up=Up labels.move_down=Down @@ -88,3 +88,8 @@ errors.could_not_find_link_for_moving_down=Could not find the link information for moving it down. labels.default=Default + +labels.categoryId=Category ID +labels.sortOrder=Sort Order +labels.url=URL + Modified: bookmark/trunk/src/main/resources/application_ja.properties =================================================================== --- bookmark/trunk/src/main/resources/application_ja.properties 2008-12-01 00:26:45 UTC (rev 1480) +++ bookmark/trunk/src/main/resources/application_ja.properties 2008-12-01 00:48:54 UTC (rev 1481) @@ -45,7 +45,7 @@ labels.category_list=\u30ab\u30c6\u30b4\u30ea\u4e00\u89a7 labels.action=\u30a2\u30af\u30b7\u30e7\u30f3 labels.category_info=\u30ab\u30c6\u30b4\u30ea\u60c5\u5831 -labels.category_name=\u30ab\u30c6\u30b4\u30ea\u540d +labels.category_name=\u540d\u524d labels.order=\u9806\u756a labels.move_up=\u4e0a\u3078 labels.move_down=\u4e0b\u3078 @@ -82,3 +82,7 @@ errors.could_not_find_link_for_moving_down=\u4e0b\u306b\u79fb\u52d5\u3059\u308b\u30ea\u30f3\u30af\u304c\u898b\u3064\u304b\u308a\u307e\u305b\u3093\u3002 labels.default=\u30c7\u30d5\u30a9\u30eb\u30c8 + +labels.categoryId=\u30ab\u30c6\u30b4\u30ea ID +labels.sortOrder=\u9806\u756a +labels.url=URL Modified: bookmark/trunk/src/main/webapp/WEB-INF/view/admin/category/edit.jsp =================================================================== --- bookmark/trunk/src/main/webapp/WEB-INF/view/admin/category/edit.jsp 2008-12-01 00:26:45 UTC (rev 1480) +++ bookmark/trunk/src/main/webapp/WEB-INF/view/admin/category/edit.jsp 2008-12-01 00:48:54 UTC (rev 1481) @@ -31,15 +31,15 @@ - + - + - + Modified: bookmark/trunk/src/main/webapp/WEB-INF/view/admin/link/edit.jsp =================================================================== --- bookmark/trunk/src/main/webapp/WEB-INF/view/admin/link/edit.jsp 2008-12-01 00:26:45 UTC (rev 1480) +++ bookmark/trunk/src/main/webapp/WEB-INF/view/admin/link/edit.jsp 2008-12-01 00:48:54 UTC (rev 1481) @@ -33,15 +33,15 @@ - + - + - + Modified: bookmark/trunk/src/main/webapp/WEB-INF/view/user/category/edit.jsp =================================================================== --- bookmark/trunk/src/main/webapp/WEB-INF/view/user/category/edit.jsp 2008-12-01 00:26:45 UTC (rev 1480) +++ bookmark/trunk/src/main/webapp/WEB-INF/view/user/category/edit.jsp 2008-12-01 00:48:54 UTC (rev 1481) @@ -31,11 +31,11 @@ - + - + Modified: bookmark/trunk/src/main/webapp/WEB-INF/view/user/link/confirm.jsp =================================================================== --- bookmark/trunk/src/main/webapp/WEB-INF/view/user/link/confirm.jsp 2008-12-01 00:26:45 UTC (rev 1480) +++ bookmark/trunk/src/main/webapp/WEB-INF/view/user/link/confirm.jsp 2008-12-01 00:48:54 UTC (rev 1481) @@ -33,7 +33,7 @@
    -
  • ${f:h(c.name)}
  • +
  • ?${f:h(c.name)}
  • ${f:h(c.name)}
  • Modified: bookmark/trunk/src/main/webapp/WEB-INF/view/user/link/edit.jsp =================================================================== --- bookmark/trunk/src/main/webapp/WEB-INF/view/user/link/edit.jsp 2008-12-01 00:26:45 UTC (rev 1480) +++ bookmark/trunk/src/main/webapp/WEB-INF/view/user/link/edit.jsp 2008-12-01 00:48:54 UTC (rev 1481) @@ -33,7 +33,7 @@
      -
    • ${f:h(c.name)}
    • +
    • ?${f:h(c.name)}
    • ${f:h(c.name)}
    • @@ -58,15 +58,15 @@
- + - + - + Modified: bookmark/trunk/src/main/webapp/WEB-INF/view/user/link/index.jsp =================================================================== --- bookmark/trunk/src/main/webapp/WEB-INF/view/user/link/index.jsp 2008-12-01 00:26:45 UTC (rev 1480) +++ bookmark/trunk/src/main/webapp/WEB-INF/view/user/link/index.jsp 2008-12-01 00:48:54 UTC (rev 1481) @@ -33,7 +33,7 @@
    -
  • ${f:h(c.name)}
  • +
  • ?${f:h(c.name)}
  • ${f:h(c.name)}
  • From svnnotify ¡÷ sourceforge.jp Mon Dec 1 10:00:55 2008 From: svnnotify ¡÷ sourceforge.jp (svnnotify ¡÷ sourceforge.jp) Date: Mon, 01 Dec 2008 10:00:55 +0900 Subject: [pal-cvs 3747] [1482] updated style and translation. Message-ID: <1228093255.443301.22787.nullmailer@users.sourceforge.jp> Revision: 1482 http://svn.sourceforge.jp/view?root=pal&view=rev&rev=1482 Author: shinsuke Date: 2008-12-01 10:00:55 +0900 (Mon, 01 Dec 2008) Log Message: ----------- updated style and translation. Modified Paths: -------------- notepad/trunk/src/main/resources/application.properties notepad/trunk/src/main/resources/application_ja.properties notepad/trunk/src/main/webapp/WEB-INF/view/admin/category/confirm.jsp notepad/trunk/src/main/webapp/WEB-INF/view/admin/category/edit.jsp notepad/trunk/src/main/webapp/WEB-INF/view/admin/notepad/confirm.jsp notepad/trunk/src/main/webapp/WEB-INF/view/admin/notepad/edit.jsp notepad/trunk/src/main/webapp/WEB-INF/view/user/category/confirm.jsp notepad/trunk/src/main/webapp/WEB-INF/view/user/category/edit.jsp notepad/trunk/src/main/webapp/WEB-INF/view/user/notepad/confirm.jsp notepad/trunk/src/main/webapp/WEB-INF/view/user/notepad/edit.jsp notepad/trunk/src/main/webapp/WEB-INF/view/user/notepad/index.jsp -------------- next part -------------- Modified: notepad/trunk/src/main/resources/application.properties =================================================================== --- notepad/trunk/src/main/resources/application.properties 2008-12-01 00:48:54 UTC (rev 1481) +++ notepad/trunk/src/main/resources/application.properties 2008-12-01 01:00:55 UTC (rev 1482) @@ -97,3 +97,10 @@ labels.createdBy=Created By labels.default_category=Default labels.shared=Shared +labels.access_type=Access Type + +labels.categoryId=Category ID +labels.content=Content +labels.sortOrder=Sort Order +labels.title=Title + Modified: notepad/trunk/src/main/resources/application_ja.properties =================================================================== --- notepad/trunk/src/main/resources/application_ja.properties 2008-12-01 00:48:54 UTC (rev 1481) +++ notepad/trunk/src/main/resources/application_ja.properties 2008-12-01 01:00:55 UTC (rev 1482) @@ -90,4 +90,10 @@ labels.createdBy=\u4f5c\u6210\u8005 labels.default_category=\u30c7\u30d5\u30a9\u30eb\u30c8 -labels.shared=\u5171\u6709 \ No newline at end of file +labels.shared=\u5171\u6709 +labels.access_type=\u30a2\u30af\u30bb\u30b9\u30bf\u30a4\u30d7 + +labels.categoryId=\u30ab\u30c6\u30b4\u30ea ID +labels.content=\u5185\u5bb9 +labels.sortOrder=\u9806\u756a +labels.title=\u30bf\u30a4\u30c8\u30eb Modified: notepad/trunk/src/main/webapp/WEB-INF/view/admin/category/confirm.jsp =================================================================== --- notepad/trunk/src/main/webapp/WEB-INF/view/admin/category/confirm.jsp 2008-12-01 00:48:54 UTC (rev 1481) +++ notepad/trunk/src/main/webapp/WEB-INF/view/admin/category/confirm.jsp 2008-12-01 01:00:55 UTC (rev 1482) @@ -30,14 +30,14 @@
- + - + - - + + - + - + - + - + Modified: notepad/trunk/src/main/webapp/WEB-INF/view/admin/notepad/edit.jsp =================================================================== --- notepad/trunk/src/main/webapp/WEB-INF/view/admin/notepad/edit.jsp 2008-12-01 00:48:54 UTC (rev 1481) +++ notepad/trunk/src/main/webapp/WEB-INF/view/admin/notepad/edit.jsp 2008-12-01 01:00:55 UTC (rev 1482) @@ -32,12 +32,12 @@ - - + + - - + + Modified: notepad/trunk/src/main/webapp/WEB-INF/view/user/category/confirm.jsp =================================================================== --- notepad/trunk/src/main/webapp/WEB-INF/view/user/category/confirm.jsp 2008-12-01 00:48:54 UTC (rev 1481) +++ notepad/trunk/src/main/webapp/WEB-INF/view/user/category/confirm.jsp 2008-12-01 01:00:55 UTC (rev 1482) @@ -30,11 +30,11 @@ - + - + - - + + - + - + - + Modified: notepad/trunk/src/main/webapp/WEB-INF/view/user/notepad/edit.jsp =================================================================== --- notepad/trunk/src/main/webapp/WEB-INF/view/user/notepad/edit.jsp 2008-12-01 00:48:54 UTC (rev 1481) +++ notepad/trunk/src/main/webapp/WEB-INF/view/user/notepad/edit.jsp 2008-12-01 01:00:55 UTC (rev 1482) @@ -33,7 +33,7 @@
    -
  • ${f:h(c.name)}
  • +
  • ?${f:h(c.name)}
  • ${f:h(c.name)}
  • @@ -55,12 +55,12 @@
- - + + - - + + Modified: notepad/trunk/src/main/webapp/WEB-INF/view/user/notepad/index.jsp =================================================================== --- notepad/trunk/src/main/webapp/WEB-INF/view/user/notepad/index.jsp 2008-12-01 00:48:54 UTC (rev 1481) +++ notepad/trunk/src/main/webapp/WEB-INF/view/user/notepad/index.jsp 2008-12-01 01:00:55 UTC (rev 1482) @@ -33,7 +33,7 @@
    -
  • ${f:h(c.name)}
  • +
  • ?${f:h(c.name)}
  • ${f:h(c.name)}
  • From svnnotify ¡÷ sourceforge.jp Mon Dec 1 10:28:12 2008 From: svnnotify ¡÷ sourceforge.jp (svnnotify ¡÷ sourceforge.jp) Date: Mon, 01 Dec 2008 10:28:12 +0900 Subject: [pal-cvs 3748] [1483] updated style and translation. Message-ID: <1228094892.810464.18543.nullmailer@users.sourceforge.jp> Revision: 1483 http://svn.sourceforge.jp/view?root=pal&view=rev&rev=1483 Author: shinsuke Date: 2008-12-01 10:28:12 +0900 (Mon, 01 Dec 2008) Log Message: ----------- updated style and translation. Modified Paths: -------------- scheduler/trunk/src/main/resources/application.properties scheduler/trunk/src/main/resources/application_ja.properties scheduler/trunk/src/main/webapp/WEB-INF/view/admin/facility/facility/edit.jsp scheduler/trunk/src/main/webapp/WEB-INF/view/admin/facility/facilityGroup/edit.jsp scheduler/trunk/src/main/webapp/WEB-INF/view/admin/schedule/onetimeSchedule/edit.jsp scheduler/trunk/src/main/webapp/WEB-INF/view/admin/schedule/repeatSchedule/edit.jsp scheduler/trunk/src/main/webapp/WEB-INF/view/user/facility/onetimeSchedule/edit.jsp scheduler/trunk/src/main/webapp/WEB-INF/view/user/facility/repeatSchedule/edit.jsp scheduler/trunk/src/main/webapp/WEB-INF/view/user/schedule/onetimeSchedule/edit.jsp scheduler/trunk/src/main/webapp/WEB-INF/view/user/schedule/repeatSchedule/edit.jsp -------------- next part -------------- Modified: scheduler/trunk/src/main/resources/application.properties =================================================================== --- scheduler/trunk/src/main/resources/application.properties 2008-12-01 01:00:55 UTC (rev 1482) +++ scheduler/trunk/src/main/resources/application.properties 2008-12-01 01:28:12 UTC (rev 1483) @@ -132,7 +132,7 @@ labels.ok=OK labels.id=ID -labels.title=Title +labels.title=What labels.user_list=User List labels.selected_user_list=Selected User List @@ -185,4 +185,34 @@ labels.week_group=Week(Group) labels.group_week=Group(Week) -labels.change=Change \ No newline at end of file +labels.change=Change + +labels.content=Content +labels.endDate=End Date +labels.endTime=End Time +labels.location=Location +labels.startDate=Start Date +labels.startTime=Start Time +labels.addedFacilities=Added Facilities +labels.addedUsers=Added Users +labels.endDateD=End Date +labels.endDateM=End Date +labels.endDateY=End Date +labels.endTimeH=End Time +labels.endTimeM=End Time +labels.facilityGroupId=Facility Group ID +labels.groupAvailable=Available Groups +labels.groupId=Group Id +labels.removedFacilities=Removed Facilities +labels.removedUsers=Removed Users +labels.roleAvailable=Available Roles +labels.secret=Privacy +labels.selectedFacilities=Selected Facilities +labels.selectedUsers=Selected Users +labels.startDateD=Start Date +labels.startDateM=Start Date +labels.startDateY=Start Date +labels.startTimeH=Start Time +labels.startTimeM=Start Time +labels.type=Type +labels.userGroup=User Group Modified: scheduler/trunk/src/main/resources/application_ja.properties =================================================================== --- scheduler/trunk/src/main/resources/application_ja.properties 2008-12-01 01:00:55 UTC (rev 1482) +++ scheduler/trunk/src/main/resources/application_ja.properties 2008-12-01 01:28:12 UTC (rev 1483) @@ -124,7 +124,7 @@ labels.ok=\u4e86\u89e3 labels.id=ID -labels.title=\u30bf\u30a4\u30c8\u30eb +labels.title=\u6982\u8981 labels.user_list=\u30e6\u30fc\u30b6\u30fc\u30ea\u30b9\u30c8 labels.selected_user_list=\u9078\u629e\u3055\u308c\u305f\u30e6\u30fc\u30b6\u30fc\u306e\u30ea\u30b9\u30c8 @@ -177,4 +177,34 @@ labels.week_group=\u9031(\u30b0\u30eb\u30fc\u30d7) labels.group_week=\u30b0\u30eb\u30fc\u30d7(\u9031) -labels.change=\u5909\u66f4 \ No newline at end of file +labels.change=\u5909\u66f4 + +labels.content=\u5185\u5bb9 +labels.endDate=\u7d42\u4e86\u65e5 +labels.endTime=\u7d42\u4e86\u6642\u523b +labels.location=\u5834\u6240 +labels.startDate=\u958b\u59cb\u65e5 +labels.startTime=\u958b\u59cb\u6642\u523b +labels.addedFacilities=\u8ffd\u52a0\u3055\u308c\u305f\u65bd\u8a2d +labels.addedUsers=\u8ffd\u52a0\u3055\u308c\u305f\u30e6\u30fc\u30b6\u30fc +labels.endDateD=\u7d42\u4e86\u65e5 +labels.endDateM=\u7d42\u4e86\u65e5 +labels.endDateY=\u7d42\u4e86\u65e5 +labels.endTimeH=\u7d42\u4e86\u6642\u523b +labels.endTimeM=\u7d42\u4e86\u6642\u523b +labels.facilityGroupId=\u65bd\u8a2d\u30b0\u30eb\u30fc\u30d7 ID +labels.groupAvailable=\u5229\u7528\u53ef\u80fd\u30b0\u30eb\u30fc\u30d7 +labels.groupId=\u30b0\u30eb\u30fc\u30d7 ID +labels.removedFacilities=\u524a\u9664\u3055\u308c\u305f\u65bd\u8a2d +labels.removedUsers=\u524a\u9664\u3055\u308c\u305f\u30e6\u30fc\u30b6\u30fc +labels.roleAvailable=\u5229\u7528\u53ef\u80fd\u306a\u30ed\u30fc\u30eb +labels.secret=\u30d7\u30e9\u30a4\u30d0\u30b7\u30fc +labels.selectedFacilities=\u9078\u629e\u3055\u308c\u305f\u65bd\u8a2d +labels.selectedUsers=\u9078\u629e\u3055\u308c\u305f\u30e6\u30fc\u30b6\u30fc +labels.startDateD=\u958b\u59cb\u65e5 +labels.startDateM=\u958b\u59cb\u65e5 +labels.startDateY=\u958b\u59cb\u65e5 +labels.startTimeH=\u958b\u59cb\u6642\u523b +labels.startTimeM=\u958b\u59cb\u6642\u523b +labels.type=\u30bf\u30a4\u30d7 +labels.userGroup=\u30e6\u30fc\u30b6\u30fc\u30b0\u30eb\u30fc\u30d7 Modified: scheduler/trunk/src/main/webapp/WEB-INF/view/admin/facility/facility/edit.jsp =================================================================== --- scheduler/trunk/src/main/webapp/WEB-INF/view/admin/facility/facility/edit.jsp 2008-12-01 01:00:55 UTC (rev 1482) +++ scheduler/trunk/src/main/webapp/WEB-INF/view/admin/facility/facility/edit.jsp 2008-12-01 01:28:12 UTC (rev 1483) @@ -45,7 +45,7 @@
- + Modified: scheduler/trunk/src/main/webapp/WEB-INF/view/admin/facility/facilityGroup/edit.jsp =================================================================== --- scheduler/trunk/src/main/webapp/WEB-INF/view/admin/facility/facilityGroup/edit.jsp 2008-12-01 01:00:55 UTC (rev 1482) +++ scheduler/trunk/src/main/webapp/WEB-INF/view/admin/facility/facilityGroup/edit.jsp 2008-12-01 01:28:12 UTC (rev 1483) @@ -45,7 +45,7 @@ - + Modified: scheduler/trunk/src/main/webapp/WEB-INF/view/admin/schedule/onetimeSchedule/edit.jsp =================================================================== --- scheduler/trunk/src/main/webapp/WEB-INF/view/admin/schedule/onetimeSchedule/edit.jsp 2008-12-01 01:00:55 UTC (rev 1482) +++ scheduler/trunk/src/main/webapp/WEB-INF/view/admin/schedule/onetimeSchedule/edit.jsp 2008-12-01 01:28:12 UTC (rev 1483) @@ -45,11 +45,11 @@ - + - + @@ -68,7 +68,7 @@ - + Modified: scheduler/trunk/src/main/webapp/WEB-INF/view/admin/schedule/repeatSchedule/edit.jsp =================================================================== --- scheduler/trunk/src/main/webapp/WEB-INF/view/admin/schedule/repeatSchedule/edit.jsp 2008-12-01 01:00:55 UTC (rev 1482) +++ scheduler/trunk/src/main/webapp/WEB-INF/view/admin/schedule/repeatSchedule/edit.jsp 2008-12-01 01:28:12 UTC (rev 1483) @@ -45,11 +45,11 @@ - + - + @@ -82,7 +82,7 @@ - + Modified: scheduler/trunk/src/main/webapp/WEB-INF/view/user/facility/onetimeSchedule/edit.jsp =================================================================== --- scheduler/trunk/src/main/webapp/WEB-INF/view/user/facility/onetimeSchedule/edit.jsp 2008-12-01 01:00:55 UTC (rev 1482) +++ scheduler/trunk/src/main/webapp/WEB-INF/view/user/facility/onetimeSchedule/edit.jsp 2008-12-01 01:28:12 UTC (rev 1483) @@ -54,11 +54,11 @@ - + - + @@ -143,7 +143,7 @@ - + Modified: scheduler/trunk/src/main/webapp/WEB-INF/view/user/facility/repeatSchedule/edit.jsp =================================================================== --- scheduler/trunk/src/main/webapp/WEB-INF/view/user/facility/repeatSchedule/edit.jsp 2008-12-01 01:00:55 UTC (rev 1482) +++ scheduler/trunk/src/main/webapp/WEB-INF/view/user/facility/repeatSchedule/edit.jsp 2008-12-01 01:28:12 UTC (rev 1483) @@ -54,11 +54,11 @@ - + - + @@ -160,7 +160,7 @@ - + Modified: scheduler/trunk/src/main/webapp/WEB-INF/view/user/schedule/onetimeSchedule/edit.jsp =================================================================== --- scheduler/trunk/src/main/webapp/WEB-INF/view/user/schedule/onetimeSchedule/edit.jsp 2008-12-01 01:00:55 UTC (rev 1482) +++ scheduler/trunk/src/main/webapp/WEB-INF/view/user/schedule/onetimeSchedule/edit.jsp 2008-12-01 01:28:12 UTC (rev 1483) @@ -53,11 +53,11 @@ - + - + @@ -142,7 +142,7 @@ - + Modified: scheduler/trunk/src/main/webapp/WEB-INF/view/user/schedule/repeatSchedule/edit.jsp =================================================================== --- scheduler/trunk/src/main/webapp/WEB-INF/view/user/schedule/repeatSchedule/edit.jsp 2008-12-01 01:00:55 UTC (rev 1482) +++ scheduler/trunk/src/main/webapp/WEB-INF/view/user/schedule/repeatSchedule/edit.jsp 2008-12-01 01:28:12 UTC (rev 1483) @@ -53,11 +53,11 @@ - + - + @@ -159,7 +159,7 @@ - + From svnnotify ¡÷ sourceforge.jp Mon Dec 1 10:45:47 2008 From: svnnotify ¡÷ sourceforge.jp (svnnotify ¡÷ sourceforge.jp) Date: Mon, 01 Dec 2008 10:45:47 +0900 Subject: [pal-cvs 3749] [1484] updated style and translation. Message-ID: <1228095947.532071.4731.nullmailer@users.sourceforge.jp> Revision: 1484 http://svn.sourceforge.jp/view?root=pal&view=rev&rev=1484 Author: shinsuke Date: 2008-12-01 10:45:47 +0900 (Mon, 01 Dec 2008) Log Message: ----------- updated style and translation. Modified Paths: -------------- timecard/trunk/src/main/resources/application.properties timecard/trunk/src/main/resources/application_ja.properties timecard/trunk/src/main/webapp/WEB-INF/view/admin/employee/confirm.jsp timecard/trunk/src/main/webapp/WEB-INF/view/admin/employee/edit.jsp timecard/trunk/src/main/webapp/WEB-INF/view/admin/timecard/confirm.jsp timecard/trunk/src/main/webapp/WEB-INF/view/admin/timecard/edit.jsp timecard/trunk/src/main/webapp/WEB-INF/view/config/index.jsp timecard/trunk/src/main/webapp/WEB-INF/view/employee/confirm.jsp timecard/trunk/src/main/webapp/WEB-INF/view/employee/edit.jsp timecard/trunk/src/main/webapp/WEB-INF/view/manager/employee/edit.jsp timecard/trunk/src/main/webapp/WEB-INF/view/manager/timecard/confirm.jsp timecard/trunk/src/main/webapp/WEB-INF/view/manager/timecard/edit.jsp -------------- next part -------------- Modified: timecard/trunk/src/main/resources/application.properties =================================================================== --- timecard/trunk/src/main/resources/application.properties 2008-12-01 01:28:12 UTC (rev 1483) +++ timecard/trunk/src/main/resources/application.properties 2008-12-01 01:45:47 UTC (rev 1484) @@ -170,3 +170,23 @@ # 0: year, 1: month display.yearmonth_format={0}/{1} +labels.amEndTime=End Time (AM) +labels.amStartTime=Start Time (AM) +labels.defaultManager=Default Manager +labels.displayedMinutes=Selectable Minutes +labels.manager=Manager +labels.paidHolidays=Paid Holidays +labels.pmEndTime=End Time (PM) +labels.pmStartTime=Start Time (PM) +labels.username=Username +labels.breakTimeHr=Break Time +labels.breakTimeMin=Break Time +labels.endTimeHr=End Time +labels.endTimeMin=End Time +labels.isAvailable=Available +labels.otjTimeHr=OTJ Time +labels.otjTimeMin=OTJ Time +labels.startTimeHr=Start Time +labels.startTimeMin=Start Time +labels.workingType=Working Type + Modified: timecard/trunk/src/main/resources/application_ja.properties =================================================================== --- timecard/trunk/src/main/resources/application_ja.properties 2008-12-01 01:28:12 UTC (rev 1483) +++ timecard/trunk/src/main/resources/application_ja.properties 2008-12-01 01:45:47 UTC (rev 1484) @@ -163,3 +163,23 @@ # 0: year, 1: month display.yearmonth_format={0}\u5e74{1}\u6708 +labels.amEndTime=\u7d42\u4e86\u6642\u9593 (AM) +labels.amStartTime=\u958b\u59cb\u6642\u9593 (AM) +labels.defaultManager=\u30c7\u30d5\u30a9\u30eb\u30c8\u30de\u30cd\u30fc\u30b8\u30e3\u30fc +labels.displayedMinutes=\u9078\u629e\u53ef\u80fd\u306a\u5206 +labels.manager=\u30de\u30cd\u30fc\u30b8\u30e3\u30fc +labels.paidHolidays=\u6709\u7d66\u4f11\u6687\u65e5\u6570 +labels.pmEndTime=\u7d42\u4e86\u6642\u9593 (PM) +labels.pmStartTime=\u958b\u59cb\u6642\u9593 (PM) +labels.username=\u30e6\u30fc\u30b6\u30fc\u540d +labels.breakTimeHr=\u4f11\u61a9\u6642\u9593 +labels.breakTimeMin=\u4f11\u61a9\u6642\u9593 +labels.endTimeHr=\u7d42\u4e86\u6642\u9593 +labels.endTimeMin=\u7d42\u4e86\u6642\u9593 +labels.isAvailable=\u6709\u52b9 +labels.otjTimeHr=\u52e4\u52d9\u5916\u6642\u9593 +labels.otjTimeMin=\u52e4\u52d9\u5916\u6642\u9593 +labels.startTimeHr=\u958b\u59cb\u6642\u9593 +labels.startTimeMin=\u958b\u59cb\u6642\u9593 +labels.workingType=\u52e4\u52d9\u72b6\u614b + Modified: timecard/trunk/src/main/webapp/WEB-INF/view/admin/employee/confirm.jsp =================================================================== --- timecard/trunk/src/main/webapp/WEB-INF/view/admin/employee/confirm.jsp 2008-12-01 01:28:12 UTC (rev 1483) +++ timecard/trunk/src/main/webapp/WEB-INF/view/admin/employee/confirm.jsp 2008-12-01 01:45:47 UTC (rev 1484) @@ -41,7 +41,7 @@ - + Modified: timecard/trunk/src/main/webapp/WEB-INF/view/admin/employee/edit.jsp =================================================================== --- timecard/trunk/src/main/webapp/WEB-INF/view/admin/employee/edit.jsp 2008-12-01 01:28:12 UTC (rev 1483) +++ timecard/trunk/src/main/webapp/WEB-INF/view/admin/employee/edit.jsp 2008-12-01 01:45:47 UTC (rev 1484) @@ -33,11 +33,11 @@ - + - + Modified: timecard/trunk/src/main/webapp/WEB-INF/view/admin/timecard/confirm.jsp =================================================================== --- timecard/trunk/src/main/webapp/WEB-INF/view/admin/timecard/confirm.jsp 2008-12-01 01:28:12 UTC (rev 1483) +++ timecard/trunk/src/main/webapp/WEB-INF/view/admin/timecard/confirm.jsp 2008-12-01 01:45:47 UTC (rev 1484) @@ -31,13 +31,22 @@ +
${f:h(name)}
${f:h(sortOrder)}
Modified: notepad/trunk/src/main/webapp/WEB-INF/view/admin/category/edit.jsp =================================================================== --- notepad/trunk/src/main/webapp/WEB-INF/view/admin/category/edit.jsp 2008-12-01 00:48:54 UTC (rev 1481) +++ notepad/trunk/src/main/webapp/WEB-INF/view/admin/category/edit.jsp 2008-12-01 01:00:55 UTC (rev 1482) @@ -30,15 +30,15 @@
Modified: notepad/trunk/src/main/webapp/WEB-INF/view/admin/notepad/confirm.jsp =================================================================== --- notepad/trunk/src/main/webapp/WEB-INF/view/admin/notepad/confirm.jsp 2008-12-01 00:48:54 UTC (rev 1481) +++ notepad/trunk/src/main/webapp/WEB-INF/view/admin/notepad/confirm.jsp 2008-12-01 01:00:55 UTC (rev 1482) @@ -32,11 +32,11 @@
${f:h(title)}
${f:br(f:nbsp(f:h(content)))}
${f:h(name)}
Modified: notepad/trunk/src/main/webapp/WEB-INF/view/user/category/edit.jsp =================================================================== --- notepad/trunk/src/main/webapp/WEB-INF/view/user/category/edit.jsp 2008-12-01 00:48:54 UTC (rev 1481) +++ notepad/trunk/src/main/webapp/WEB-INF/view/user/category/edit.jsp 2008-12-01 01:00:55 UTC (rev 1482) @@ -30,11 +30,11 @@
Modified: notepad/trunk/src/main/webapp/WEB-INF/view/user/notepad/confirm.jsp =================================================================== --- notepad/trunk/src/main/webapp/WEB-INF/view/user/notepad/confirm.jsp 2008-12-01 00:48:54 UTC (rev 1481) +++ notepad/trunk/src/main/webapp/WEB-INF/view/user/notepad/confirm.jsp 2008-12-01 01:00:55 UTC (rev 1482) @@ -33,7 +33,7 @@
    -
  • ${f:h(c.name)}
  • +
  • ?${f:h(c.name)}
  • ${f:h(c.name)}
  • @@ -55,11 +55,11 @@
${f:h(title)}
${f:br(f:nbsp(f:h(content)))}
${f:h(paidHolidays)}${f:h(paidHolidays)}
- + Modified: timecard/trunk/src/main/webapp/WEB-INF/view/admin/timecard/edit.jsp =================================================================== --- timecard/trunk/src/main/webapp/WEB-INF/view/admin/timecard/edit.jsp 2008-12-01 01:28:12 UTC (rev 1483) +++ timecard/trunk/src/main/webapp/WEB-INF/view/admin/timecard/edit.jsp 2008-12-01 01:45:47 UTC (rev 1484) @@ -30,6 +30,7 @@ +
${f:h(month)}/${f:h(date)}${f:h(month)}/${f:h(date)} + + + + + + + +
@@ -157,7 +158,7 @@ - + Modified: timecard/trunk/src/main/webapp/WEB-INF/view/config/index.jsp =================================================================== --- timecard/trunk/src/main/webapp/WEB-INF/view/config/index.jsp 2008-12-01 01:28:12 UTC (rev 1483) +++ timecard/trunk/src/main/webapp/WEB-INF/view/config/index.jsp 2008-12-01 01:45:47 UTC (rev 1484) @@ -45,7 +45,7 @@ - + @@ -55,7 +55,7 @@ - + Modified: timecard/trunk/src/main/webapp/WEB-INF/view/employee/confirm.jsp =================================================================== --- timecard/trunk/src/main/webapp/WEB-INF/view/employee/confirm.jsp 2008-12-01 01:28:12 UTC (rev 1483) +++ timecard/trunk/src/main/webapp/WEB-INF/view/employee/confirm.jsp 2008-12-01 01:45:47 UTC (rev 1484) @@ -31,6 +31,7 @@ +
Modified: timecard/trunk/src/main/webapp/WEB-INF/view/employee/edit.jsp =================================================================== --- timecard/trunk/src/main/webapp/WEB-INF/view/employee/edit.jsp 2008-12-01 01:28:12 UTC (rev 1483) +++ timecard/trunk/src/main/webapp/WEB-INF/view/employee/edit.jsp 2008-12-01 01:45:47 UTC (rev 1484) @@ -30,6 +30,7 @@ +
@@ -147,7 +148,7 @@ - + Modified: timecard/trunk/src/main/webapp/WEB-INF/view/manager/employee/edit.jsp =================================================================== --- timecard/trunk/src/main/webapp/WEB-INF/view/manager/employee/edit.jsp 2008-12-01 01:28:12 UTC (rev 1483) +++ timecard/trunk/src/main/webapp/WEB-INF/view/manager/employee/edit.jsp 2008-12-01 01:45:47 UTC (rev 1484) @@ -33,15 +33,15 @@ - + - + - + Modified: timecard/trunk/src/main/webapp/WEB-INF/view/manager/timecard/confirm.jsp =================================================================== --- timecard/trunk/src/main/webapp/WEB-INF/view/manager/timecard/confirm.jsp 2008-12-01 01:28:12 UTC (rev 1483) +++ timecard/trunk/src/main/webapp/WEB-INF/view/manager/timecard/confirm.jsp 2008-12-01 01:45:47 UTC (rev 1484) @@ -31,13 +31,22 @@ +
- + Modified: timecard/trunk/src/main/webapp/WEB-INF/view/manager/timecard/edit.jsp =================================================================== --- timecard/trunk/src/main/webapp/WEB-INF/view/manager/timecard/edit.jsp 2008-12-01 01:28:12 UTC (rev 1483) +++ timecard/trunk/src/main/webapp/WEB-INF/view/manager/timecard/edit.jsp 2008-12-01 01:45:47 UTC (rev 1484) @@ -30,6 +30,7 @@ +
${f:h(month)}/${f:h(date)}${f:h(month)}/${f:h(date)} + + + + + + + +
@@ -156,7 +157,7 @@ - + From svnnotify ¡÷ sourceforge.jp Mon Dec 1 11:11:45 2008 From: svnnotify ¡÷ sourceforge.jp (svnnotify ¡÷ sourceforge.jp) Date: Mon, 01 Dec 2008 11:11:45 +0900 Subject: [pal-cvs 3750] [1485] updated style and translation. Message-ID: <1228097505.824839.2380.nullmailer@users.sourceforge.jp> Revision: 1485 http://svn.sourceforge.jp/view?root=pal&view=rev&rev=1485 Author: shinsuke Date: 2008-12-01 11:11:45 +0900 (Mon, 01 Dec 2008) Log Message: ----------- updated style and translation. Modified Paths: -------------- userinfo/trunk/src/main/resources/application.properties userinfo/trunk/src/main/resources/application_ja.properties userinfo/trunk/src/main/webapp/WEB-INF/view/groupInfo/edit.jsp userinfo/trunk/src/main/webapp/WEB-INF/view/roleInfo/edit.jsp userinfo/trunk/src/main/webapp/WEB-INF/view/userInfo/edit.jsp -------------- next part -------------- Modified: userinfo/trunk/src/main/resources/application.properties =================================================================== --- userinfo/trunk/src/main/resources/application.properties 2008-12-01 01:45:47 UTC (rev 1484) +++ userinfo/trunk/src/main/resources/application.properties 2008-12-01 02:11:45 UTC (rev 1485) @@ -7,9 +7,9 @@ # 0: Given name, 1: Family name, 2: Middle Name display.name={0} {2} {1} -# 0: Given name, 1: Family name, 2: Middle Name, 3: Given name(Reading), 4: Family name(Reading) +# 0: Given name, 1: Family name, 2: Middle Name, 3: Given name(Phonetic), 4: Family name(Phonetic) long.display.name={0} {2} {1} -# 0: Given name(Reading), 1: Family name(Reading), 2: Middle Name +# 0: Given name(Phonetic), 1: Family name(Phonetic), 2: Middle Name phonetic.display.name={0} {2} {1} errors.invalid={0} is invalid. @@ -97,9 +97,9 @@ labels.user_id=User ID labels.name=Name labels.given_name=Given Name -labels.given_name_desc=Given Name (Reading) +labels.given_name_desc=Given Name (Phonetic) labels.family_name=Family Name -labels.family_name_desc=Family Name (Reading) +labels.family_name_desc=Family Name (Phonetic) labels.middle_name=Middle Name labels.none=None labels.gender=Gender @@ -136,3 +136,22 @@ labels.locale=Language +labels.birthDate=Birth Date +labels.familyName=Family Name +labels.familyNameDesc=Family Name (Phonetic) +labels.givenName=Given Name +labels.givenNameDesc=Given Name (Phonetic) +labels.groupId=Group ID +labels.middleName=Middle Name +labels.roleId=Role ID +labels.telephone=Telephone +labels.userId=User ID +labels.addedGroups=Added Groups +labels.addedRoles=Added Roles +labels.groupAvailable=Available Groups +labels.removedGroups=Removed Groups +labels.removedRoles=Removed Roles +labels.roleAvailable=Available Roles +labels.selectedGroups=Selected Groups +labels.selectedRoles=Selected Roles + Modified: userinfo/trunk/src/main/resources/application_ja.properties =================================================================== --- userinfo/trunk/src/main/resources/application_ja.properties 2008-12-01 01:45:47 UTC (rev 1484) +++ userinfo/trunk/src/main/resources/application_ja.properties 2008-12-01 02:11:45 UTC (rev 1485) @@ -128,3 +128,22 @@ labels.remove_groups=<< \u524a\u9664 labels.locale=\u8a00\u8a9e + +labels.birthDate=\u8a95\u751f\u65e5 +labels.familyName=\u59d3 +labels.familyNameDesc=\u59d3 (\u3088\u307f) +labels.givenName=\u540d +labels.givenNameDesc=\u540d (\u3088\u307f) +labels.groupId=\u30b0\u30eb\u30fc\u30d7 ID +labels.middleName=\u30df\u30c9\u30eb\u30cd\u30fc\u30e0 +labels.roleId=\u30ed\u30fc\u30eb ID +labels.telephone=\u96fb\u8a71\u756a\u53f7 +labels.userId=\u30e6\u30fc\u30b6\u30fc ID +labels.addedGroups=\u8ffd\u52a0\u3055\u308c\u305f\u30b0\u30eb\u30fc\u30d7 +labels.addedRoles=\u8ffd\u52a0\u3055\u308c\u305f\u30ed\u30fc\u30eb +labels.groupAvailable=\u6709\u52b9\u306a\u30b0\u30eb\u30fc\u30d7 +labels.removedGroups=\u524a\u9664\u3055\u308c\u305f\u30b0\u30eb\u30fc\u30d7 +labels.removedRoles=\u524a\u9664\u3055\u308c\u305f\u30ed\u30fc\u30eb +labels.roleAvailable=\u6709\u52b9\u306a\u30ed\u30fc\u30eb +labels.selectedGroups=\u9078\u629e\u3055\u308c\u305f\u30b0\u30eb\u30fc\u30d7 +labels.selectedRoles=\u9078\u629e\u3055\u308c\u305f\u30ed\u30fc\u30eb Modified: userinfo/trunk/src/main/webapp/WEB-INF/view/groupInfo/edit.jsp =================================================================== --- userinfo/trunk/src/main/webapp/WEB-INF/view/groupInfo/edit.jsp 2008-12-01 01:45:47 UTC (rev 1484) +++ userinfo/trunk/src/main/webapp/WEB-INF/view/groupInfo/edit.jsp 2008-12-01 02:11:45 UTC (rev 1485) @@ -48,27 +48,27 @@ - + - + - + - + - + - + Modified: userinfo/trunk/src/main/webapp/WEB-INF/view/roleInfo/edit.jsp =================================================================== --- userinfo/trunk/src/main/webapp/WEB-INF/view/roleInfo/edit.jsp 2008-12-01 01:45:47 UTC (rev 1484) +++ userinfo/trunk/src/main/webapp/WEB-INF/view/roleInfo/edit.jsp 2008-12-01 02:11:45 UTC (rev 1485) @@ -48,27 +48,27 @@ - + - + - + - + - + - + Modified: userinfo/trunk/src/main/webapp/WEB-INF/view/userInfo/edit.jsp =================================================================== --- userinfo/trunk/src/main/webapp/WEB-INF/view/userInfo/edit.jsp 2008-12-01 01:45:47 UTC (rev 1484) +++ userinfo/trunk/src/main/webapp/WEB-INF/view/userInfo/edit.jsp 2008-12-01 02:11:45 UTC (rev 1485) @@ -50,31 +50,31 @@ - + - + - + - + - + - + - + @@ -88,19 +88,19 @@ - + - + - + - + From svnnotify ¡÷ sourceforge.jp Mon Dec 1 11:23:57 2008 From: svnnotify ¡÷ sourceforge.jp (svnnotify ¡÷ sourceforge.jp) Date: Mon, 01 Dec 2008 11:23:57 +0900 Subject: [pal-cvs 3751] [1486] i18ned and updated translation. Message-ID: <1228098237.166524.13751.nullmailer@users.sourceforge.jp> Revision: 1486 http://svn.sourceforge.jp/view?root=pal&view=rev&rev=1486 Author: shinsuke Date: 2008-12-01 11:23:57 +0900 (Mon, 01 Dec 2008) Log Message: ----------- i18ned and updated translation. Modified Paths: -------------- board/trunk/src/main/resources/application.properties board/trunk/src/main/resources/application_ja.properties board/trunk/src/main/webapp/WEB-INF/view/config/index.jsp -------------- next part -------------- Modified: board/trunk/src/main/resources/application.properties =================================================================== --- board/trunk/src/main/resources/application.properties 2008-12-01 02:11:45 UTC (rev 1485) +++ board/trunk/src/main/resources/application.properties 2008-12-01 02:23:57 UTC (rev 1486) @@ -7,9 +7,9 @@ # 0: Given name, 1: Family name, 2: Middle Name display.name={0} {2} {1} -# 0: Given name, 1: Family name, 2: Middle Name, 3: Given name(Reading), 4: Family name(Reading) +# 0: Given name, 1: Family name, 2: Middle Name, 3: Given name(Phonetic), 4: Family name(Phonetic) long.display.name={0} {2} {1} -# 0: Given name(Reading), 1: Family name(Reading), 2: Middle Name +# 0: Given name(Phonetic), 1: Family name(Phonetic), 2: Middle Name phonetic.display.name={0} {2} {1} errors.invalid={0} is invalid. @@ -154,3 +154,8 @@ labels.categoryId=Category Id labels.messageEditableOnPublic=Is Editable On Public labels.status=Status + +labels.config_info=Configuration Info +labels.editable=Editable +labels.not_editable=Not Editable +labels.byte=byte Modified: board/trunk/src/main/resources/application_ja.properties =================================================================== --- board/trunk/src/main/resources/application_ja.properties 2008-12-01 02:11:45 UTC (rev 1485) +++ board/trunk/src/main/resources/application_ja.properties 2008-12-01 02:23:57 UTC (rev 1486) @@ -1,8 +1,8 @@ # 0: Given name, 1: Family name, 2: Middle Name display.name={1} {0} -# 0: Given name, 1: Family name, 2: Middle Name, 3: Given name(Reading), 4: Family name(Reading) +# 0: Given name, 1: Family name, 2: Middle Name, 3: Given name(Phonetic), 4: Family name(Phonetic) long.display.name={1} {0} ({4} {3}) -# 0: Given name(Reading), 1: Family name(Reading), 2: Middle Name +# 0: Given name(Phonetic), 1: Family name(Phonetic), 2: Middle Name phonetic.display.name={1} {0} errors.invalid={0} \u306b\u306f\u6b63\u3057\u3044\u5f62\u5f0f\u306e\u30c7\u30fc\u30bf\u3092\u5165\u529b\u3057\u3066\u304f\u3060\u3055\u3044\u3002 @@ -78,6 +78,7 @@ labels.display_name2=\u5dee\u51fa\u4eba labels.update_time=\u66f4\u65b0\u65e5\u6642 +success.update_config=\u8a2d\u5b9a\u60c5\u5831\u3092\u66f4\u65b0\u3057\u307e\u3057\u305f\u3002 success.create_category=\u30ab\u30c6\u30b4\u30ea\u60c5\u5831\u3092\u4f5c\u6210\u3057\u307e\u3057\u305f\u3002 success.update_category=\u30ab\u30c6\u30b4\u30ea\u60c5\u5831\u3092\u66f4\u65b0\u3057\u307e\u3057\u305f\u3002 success.delete_category=\u30ab\u30c6\u30b4\u30ea\u60c5\u5831\u3092\u524a\u9664\u3057\u307e\u3057\u305f\u3002 @@ -94,6 +95,7 @@ success.create_message_attachment=\u8a18\u4e8b\u306b\u30d5\u30a1\u30a4\u30eb\u3092\u6dfb\u4ed8\u3057\u307e\u3057\u305f\u3002 success.delete_message_attachment=\u6dfb\u4ed8\u30d5\u30a1\u30a4\u30eb\u3092\u524a\u9664\u3057\u307e\u3057\u305f\u3002 +errors.failed_to_update_config=\u8a2d\u5b9a\u60c5\u5831\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_category=\u30ab\u30c6\u30b4\u30ea\u60c5\u5831\u306e\u4f5c\u6210\u306b\u5931\u6557\u3057\u307e\u3057\u305f\u3002 errors.failed_to_update_category=\u30ab\u30c6\u30b4\u30ea\u60c5\u5831\u306e\u66f4\u65b0\u306b\u5931\u6557\u3057\u307e\u3057\u305f\u3002 @@ -130,15 +132,20 @@ labels.displayName=\u8868\u793a\u540d labels.endTimeForTime=\u7d42\u4e86\u6642\u523b labels.memo=\u30e1\u30e2 -labels.messageAttachmentSize=\u6dfb\u4ed8\u30b5\u30a4\u30ba -labels.messageMaxLength=\u30e1\u30c3\u30bb\u30fc\u30b8\u306e\u6700\u5927\u6587\u5b57\u6570 +labels.messageAttachmentSize=\u6dfb\u4ed8\u30d5\u30a1\u30a4\u30eb\u306e\u6700\u5927\u30b5\u30a4\u30ba +labels.messageMaxLength=\u6295\u7a3f\u8a18\u4e8b\u306e\u6700\u5927\u6587\u5b57\u6570 labels.name=\u540d\u524d labels.replyContent=\u30b3\u30f3\u30c6\u30f3\u30c4 labels.replyDisplayName=\u8868\u793a\u540d -labels.replyMaxLength=\u8fd4\u4fe1\u30b3\u30e1\u30f3\u30c8\u306e\u6700\u5927\u6587\u5b57\u6570 +labels.replyMaxLength=\u8fd4\u4fe1\u306e\u6700\u5927\u6587\u5b57\u6570 labels.startTimeForTime=\u958b\u59cb\u6642\u523b labels.title=\u30bf\u30a4\u30c8\u30eb labels.accessType=\u30a2\u30af\u30bb\u30b9\u30bf\u30a4\u30d7 labels.categoryId=\u30ab\u30c6\u30b4\u30ea ID -labels.messageEditableOnPublic=\u516c\u958b\u72b6\u614b\u3067\u7de8\u96c6\u53ef\u80fd +labels.messageEditableOnPublic=\u6295\u7a3f\u5f8c\u306e\u7de8\u96c6 labels.status=\u72b6\u614b + +labels.config_info=\u8a2d\u5b9a\u60c5\u5831 +labels.editable=\u7de8\u96c6\u53ef +labels.not_editable=\u7de8\u96c6\u4e0d\u53ef +labels.byte=\u30d0\u30a4\u30c8 Modified: board/trunk/src/main/webapp/WEB-INF/view/config/index.jsp =================================================================== --- board/trunk/src/main/webapp/WEB-INF/view/config/index.jsp 2008-12-01 02:11:45 UTC (rev 1485) +++ board/trunk/src/main/webapp/WEB-INF/view/config/index.jsp 2008-12-01 02:23:57 UTC (rev 1486) @@ -25,34 +25,34 @@
- + - + - + - + - - + + From svnnotify ¡÷ sourceforge.jp Mon Dec 1 17:10:58 2008 From: svnnotify ¡÷ sourceforge.jp (svnnotify ¡÷ sourceforge.jp) Date: Mon, 01 Dec 2008 17:10:58 +0900 Subject: [pal-cvs 3752] [1487] added css, updated style, reviewed access control. Message-ID: <1228119058.213165.31375.nullmailer@users.sourceforge.jp> Revision: 1487 http://svn.sourceforge.jp/view?root=pal&view=rev&rev=1487 Author: shinsuke Date: 2008-12-01 17:10:57 +0900 (Mon, 01 Dec 2008) Log Message: ----------- added css, updated style, reviewed access control. Modified Paths: -------------- todolist/trunk/src/main/java/jp/sf/pal/todolist/action/admin/CategoryAction.java todolist/trunk/src/main/java/jp/sf/pal/todolist/action/user/TodoAction.java todolist/trunk/src/main/java/jp/sf/pal/todolist/db/exentity/UserInfo.java todolist/trunk/src/main/java/jp/sf/pal/todolist/service/CategoryService.java todolist/trunk/src/main/java/jp/sf/pal/todolist/service/TodoService.java todolist/trunk/src/main/resources/application.properties todolist/trunk/src/main/resources/application_ja.properties todolist/trunk/src/main/resources/jp/sf/pal/todolist/resources/TodoListEditor_ja.properties todolist/trunk/src/main/webapp/WEB-INF/view/admin/category/confirm.jsp todolist/trunk/src/main/webapp/WEB-INF/view/admin/category/edit.jsp todolist/trunk/src/main/webapp/WEB-INF/view/admin/category/error.jsp todolist/trunk/src/main/webapp/WEB-INF/view/admin/category/index.jsp todolist/trunk/src/main/webapp/WEB-INF/view/admin/todo/confirm.jsp todolist/trunk/src/main/webapp/WEB-INF/view/admin/todo/edit.jsp todolist/trunk/src/main/webapp/WEB-INF/view/admin/todo/error.jsp todolist/trunk/src/main/webapp/WEB-INF/view/admin/todo/index.jsp todolist/trunk/src/main/webapp/WEB-INF/view/admin/userInfo/error.jsp todolist/trunk/src/main/webapp/WEB-INF/view/admin/userInfo/index.jsp todolist/trunk/src/main/webapp/WEB-INF/view/common/common.jsp todolist/trunk/src/main/webapp/WEB-INF/view/config/index.jsp todolist/trunk/src/main/webapp/WEB-INF/view/user/category/confirm.jsp todolist/trunk/src/main/webapp/WEB-INF/view/user/category/edit.jsp todolist/trunk/src/main/webapp/WEB-INF/view/user/category/error.jsp todolist/trunk/src/main/webapp/WEB-INF/view/user/category/index.jsp todolist/trunk/src/main/webapp/WEB-INF/view/user/todo/confirm.jsp todolist/trunk/src/main/webapp/WEB-INF/view/user/todo/edit.jsp todolist/trunk/src/main/webapp/WEB-INF/view/user/todo/error.jsp todolist/trunk/src/main/webapp/WEB-INF/view/user/todo/index.jsp todolist/trunk/src/main/webapp/WEB-INF/view/user/userInfo/error.jsp todolist/trunk/src/main/webapp/WEB-INF/view/user/userInfo/index.jsp Added Paths: ----------- todolist/trunk/src/main/webapp/css/ todolist/trunk/src/main/webapp/css/pal-extension.css -------------- next part -------------- Modified: todolist/trunk/src/main/java/jp/sf/pal/todolist/action/admin/CategoryAction.java =================================================================== --- todolist/trunk/src/main/java/jp/sf/pal/todolist/action/admin/CategoryAction.java 2008-12-01 02:23:57 UTC (rev 1486) +++ todolist/trunk/src/main/java/jp/sf/pal/todolist/action/admin/CategoryAction.java 2008-12-01 08:10:57 UTC (rev 1487) @@ -272,7 +272,6 @@ } else { String userId = request.getRemoteUser(); todoCategory = new TodoCategory(); - todoCategory.setUserId(userId); todoCategory.setUpdatedBy(userId); todoCategory.setCreatedBy(userId); } Modified: todolist/trunk/src/main/java/jp/sf/pal/todolist/action/user/TodoAction.java =================================================================== --- todolist/trunk/src/main/java/jp/sf/pal/todolist/action/user/TodoAction.java 2008-12-01 02:23:57 UTC (rev 1486) +++ todolist/trunk/src/main/java/jp/sf/pal/todolist/action/user/TodoAction.java 2008-12-01 08:10:57 UTC (rev 1487) @@ -458,6 +458,10 @@ return categoryService.getTodoCategoryList(userId); } + public String getUserId() { + return ToDoListUtil.getUserId(request); + } + /** * @return the request */ Modified: todolist/trunk/src/main/java/jp/sf/pal/todolist/db/exentity/UserInfo.java =================================================================== --- todolist/trunk/src/main/java/jp/sf/pal/todolist/db/exentity/UserInfo.java 2008-12-01 02:23:57 UTC (rev 1486) +++ todolist/trunk/src/main/java/jp/sf/pal/todolist/db/exentity/UserInfo.java 2008-12-01 08:10:57 UTC (rev 1487) @@ -1,5 +1,7 @@ package jp.sf.pal.todolist.db.exentity; +import org.apache.commons.lang.StringUtils; + /** * The entity of USER_INFO. *

@@ -14,4 +16,32 @@ /** Serial version UID. (Default) */ private static final long serialVersionUID = 1L; + + public String getNameArg0() { + if (StringUtils.isEmpty(getGivenName()) + && StringUtils.isEmpty(getFamilyName())) { + return getUserId(); + } + return getGivenName() != null ? getGivenName() : ""; + } + + public String getNameArg1() { + return getFamilyName() != null ? getFamilyName() : ""; + } + + public String getNameArg2() { + if (StringUtils.isEmpty(getGivenName()) + && StringUtils.isEmpty(getFamilyName())) { + return ""; + } + return getMiddleName() != null ? getMiddleName() : ""; + } + + public String getNameArg3() { + return getGivenNameDesc() != null ? getGivenNameDesc() : ""; + } + + public String getNameArg4() { + return getFamilyNameDesc() != null ? getFamilyNameDesc() : ""; + } } Modified: todolist/trunk/src/main/java/jp/sf/pal/todolist/service/CategoryService.java =================================================================== --- todolist/trunk/src/main/java/jp/sf/pal/todolist/service/CategoryService.java 2008-12-01 02:23:57 UTC (rev 1486) +++ todolist/trunk/src/main/java/jp/sf/pal/todolist/service/CategoryService.java 2008-12-01 08:10:57 UTC (rev 1487) @@ -28,6 +28,8 @@ private transient UserInfoBhv userInfoBhv; + private TodoService todoService; + private void initUserInfo(String userId) { UserInfoCB cb = new UserInfoCB(); cb.query().setUserId_Equal(userId); @@ -56,6 +58,7 @@ cb.fetchPage(categoryPager.getCurrentPageNumber()); // setup + cb.setupSelect_UserInfo(); cb.query().setDeletedBy_IsNull(); if (userId != null) { @@ -124,6 +127,8 @@ } public void disable(Long id, String name) { + todoService.removeCategoryId(id); + // not delete TodoCategoryCB cb = new TodoCategoryCB(); @@ -162,4 +167,12 @@ this.userInfoBhv = userInfoBhv; } + public TodoService getTodoService() { + return todoService; + } + + public void setTodoService(TodoService todoService) { + this.todoService = todoService; + } + } Modified: todolist/trunk/src/main/java/jp/sf/pal/todolist/service/TodoService.java =================================================================== --- todolist/trunk/src/main/java/jp/sf/pal/todolist/service/TodoService.java 2008-12-01 02:23:57 UTC (rev 1486) +++ todolist/trunk/src/main/java/jp/sf/pal/todolist/service/TodoService.java 2008-12-01 08:10:57 UTC (rev 1487) @@ -62,7 +62,8 @@ cb.fetchPage(todoPager.getCurrentPageNumber()); // setup - cb.setupSelect_Todo().withUserInfo(); + cb.setupSelect_Todo().withUserInfo(); // TODO use specify* + cb.setupSelect_UserInfo(); // TODO use specify* cb.query().setDeletedBy_IsNull(); if (userId != null) { @@ -224,6 +225,19 @@ } public void disable(Long id, String name) { + Timestamp now = new Timestamp(new Date().getTime()); + + // todomapping + TodoMappingCB cb2 = new TodoMappingCB(); + cb2.query().setDeletedBy_IsNull(); + cb2.query().setTodoId_Equal(id); + + TodoMapping todoMapping = new TodoMapping(); + todoMapping.setDeletedBy(name); + todoMapping.setDeletedTime(now); + + todoMappingBhv.queryUpdate(todoMapping, cb2); + // not delete TodoCB cb = new TodoCB(); @@ -233,18 +247,9 @@ // TODO throw an exception todo.setDeletedBy(name); - todo.setDeletedTime(new Timestamp(new Date().getTime())); + todo.setDeletedTime(now); todoBhv.update(todo); - // todomapping - TodoMappingCB cb2 = new TodoMappingCB(); - cb2.query().setDeletedBy_IsNull(); - cb2.query().setTodoId_Equal(id); - for (TodoMapping todoMapping : todoMappingBhv.selectList(cb2)) { - todoMapping.setDeletedBy(name); - todoMapping.setDeletedTime(new Timestamp(new Date().getTime())); - todoMappingBhv.update(todoMapping); - } } public void disableMapping(Long id, String name) { @@ -276,6 +281,16 @@ } } + public void removeCategoryId(Long categoryId) { + TodoMappingCB cb = new TodoMappingCB(); + cb.query().setCategoryId_Equal(categoryId); + + TodoMapping todoMapping = new TodoMapping(); + todoMapping.setCategoryId(null); + + todoMappingBhv.queryUpdate(todoMapping, cb); + } + public PagerDxo getPagerDxo() { return pagerDxo; } Modified: todolist/trunk/src/main/resources/application.properties =================================================================== --- todolist/trunk/src/main/resources/application.properties 2008-12-01 02:23:57 UTC (rev 1486) +++ todolist/trunk/src/main/resources/application.properties 2008-12-01 08:10:57 UTC (rev 1487) @@ -5,6 +5,13 @@ msg.header=

    msg.footer=
+# 0: Given name, 1: Family name, 2: Middle Name +display.name={0} {2} {1} +# 0: Given name, 1: Family name, 2: Middle Name, 3: Given name(Phonetic), 4: Family name(Phonetic) +long.display.name={0} {2} {1} +# 0: Given name(Phonetic), 1: Family name(Phonetic), 2: Middle Name +phonetic.display.name={0} {2} {1} + 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. @@ -56,58 +63,74 @@ errors.failed_to_delete_todo_mapping=Failed to remove the user. errors.user_already_exists_in_task=The user already exists in this task. -label.tab.category=Category -label.tab.tasks=Tasks -label.name=Name -label.back=Back -label.owner=Owners -label.prev=Prev -label.next=Next -label.basic=Basic -label.description=Description -label.priority=Priority -label.status=Status -label.working=Working -label.completed=Completed -label.start_date=Start Date -label.end_date=End Date -label.personal=Personal -label.category_id=Category ID -label.assigned=Assigned -label.title=Title -label.remove=Remove -label.created_by=Created By -label.due_date=Due Date -label.edit=Edit -label.user_id=User ID -label.email=Email -label.add=Add -label.category=Category -label.configuration=Configuration -label.guest_user_name=Guest User Name -label.add_user_to_this_task=Add User to This Task -label.all=ALL -label.memo=memo +labels.tab.category=Category +labels.tab.tasks=Tasks +labels.name=Name +labels.back=Back +labels.owner=Owners +labels.prev=Prev +labels.next=Next +labels.basic=Basic +labels.description=Description +labels.priority=Priority +labels.status=Status +labels.working=Working +labels.completed=Completed +labels.start_date=Start Date +labels.end_date=End Date +labels.personal=Personal +labels.category_id=Category ID +labels.assigned=Assigned +labels.title=Title +labels.remove=Remove +labels.created_by=Created By +labels.due_date=Due Date +labels.edit=Edit +labels.user_id=User ID +labels.email=Email +labels.add=Add +labels.category=Category +labels.configuration=Configuration +labels.guest_user_name=Guest User Name +labels.add_user_to_this_task=Add User to This Task +labels.all=ALL +labels.memo=Memo -label.blocker=Blocker -label.critical=Critical -label.major=Major -label.minor=Minor -label.trivial=Trivial +labels.blocker=Blocker +labels.critical=Critical +labels.major=Major +labels.minor=Minor +labels.trivial=Trivial -label.input.create=Create -label.input.delete=Delete -label.input.confirm=Confirm -label.input.back=Back -label.input.update=Update -label.input.edit=Edit -label.input.remove=Remove -label.input.remove_from_me=Remove this task from me +labels.input.create=Create +labels.input.delete=Delete +labels.input.confirm=Confirm +labels.input.back=Back +labels.input.update=Update +labels.input.edit=Edit +labels.input.remove=Remove +labels.input.remove_from_me=Remove this task from me -label.category.confirm.category_info=Confirmation of Category Info -label.category.edit.category_info=Edit Category Info -label.category.index.category=Create New Category -label.todo.confirm.task_info=Confirmation of Task Info -label.todo.edit.task_info=Edit Task Info -label.todo.index.create_new_task=Create New Task -label.userinfo.index.back_to_task_detail=Back to Task Detail \ No newline at end of file +labels.category.confirm.category_info=Confirmation of Category Info +labels.category.edit.category_info=Edit Category Info +labels.category.index.category=Create New Category +labels.todo.confirm.task_info=Confirmation of Task Info +labels.todo.edit.task_info=Edit Task Info +labels.todo.index.create_new_task=Create New Task +labels.userinfo.index.back_to_task_detail=Back to Task Detail + +labels.categoryId=Category ID +labels.descriptionForTodo=Description +labels.guestName=Guest Name +labels.nameForTodo=Name +labels.endDateDate=Due Date (Date) +labels.endDateMonth=Due Date (Month) +labels.endDateYear=Due Date (Year) +labels.priorityForTodo=Priority +labels.startDateDate=Start Date (Date) +labels.startDateMonth=Start Date (Month) +labels.startDateYear=Start Date (Year) + +labels.delete=Delete +labels.new_category=Create Category +labels.userId=User ID Modified: todolist/trunk/src/main/resources/application_ja.properties =================================================================== --- todolist/trunk/src/main/resources/application_ja.properties 2008-12-01 02:23:57 UTC (rev 1486) +++ todolist/trunk/src/main/resources/application_ja.properties 2008-12-01 08:10:57 UTC (rev 1487) @@ -1,3 +1,10 @@ +# 0: Given name, 1: Family name, 2: Middle Name +display.name={1} {0} +# 0: Given name, 1: Family name, 2: Middle Name, 3: Given name(Phonetic), 4: Family name(Phonetic) +long.display.name={1} {0} ({4} {3}) +# 0: Given name(Phonetic), 1: Family name(Phonetic), 2: Middle Name +phonetic.display.name={1} {0} + errors.invalid={0} \u306f\u7121\u52b9\u3067\u3059\u3002 errors.maxlength={0} \u3092 {1} \u6587\u5b57\u3088\u308a\u591a\u304f\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u305b\u3093\u3002 errors.minlength={0} \u3092 {1} \u6587\u5b57\u3088\u308a\u5c11\u306a\u304f\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u305b\u3093\u3002 @@ -49,58 +56,75 @@ errors.failed_to_delete_todo_mapping=\u30e6\u30fc\u30b6\u306e\u524a\u9664\u306b\u5931\u6557\u3057\u307e\u3057\u305f\u3002 errors.user_already_exists_in_task=\u305d\u306e\u30e6\u30fc\u30b6\u306f\u3059\u3067\u306b\u3053\u306e\u30bf\u30b9\u30af\u306b\u5b58\u5728\u3057\u307e\u3059\u3002 -label.tab.category=\u30ab\u30c6\u30b4\u30ea -label.tab.tasks=\u30bf\u30b9\u30af -label.name=\u540d\u524d -label.back=\u623b\u308b -label.owner=\u30aa\u30fc\u30ca\u30fc -label.prev=\u524d\u3078 -label.next=\u6b21\u3078 -label.basic=\u57fa\u672c -label.description=\u8aac\u660e -label.priority=\u512a\u5148\u5ea6 -label.status=\u72b6\u614b -label.working=\u4f5c\u696d\u4e2d -label.completed=\u7d42\u4e86 -label.start_date=\u958b\u59cb\u65e5 -label.end_date=\u7d42\u4e86\u65e5 -label.personal=\u500b\u4eba -label.category_id=\u30ab\u30c6\u30b4\u30eaID -label.assigned=\u5272\u308a\u5f53\u3066 -label.title=\u30bf\u30a4\u30c8\u30eb -label.remove=\u524a\u9664 -label.created_by=\u4f5c\u6210\u8005 -label.due_date=\u671f\u65e5 -label.edit=\u7de8\u96c6 -label.user_id=\u30e6\u30fc\u30b6ID -label.email=E\u30e1\u30fc\u30eb -label.add=\u8ffd\u52a0 -label.category=\u30ab\u30c6\u30b4\u30ea -label.configuration=\u8a2d\u5b9a -label.guest_user_name=\u30b2\u30b9\u30c8\u30e6\u30fc\u30b6\u540d -label.add_user_to_this_task=\u30e6\u30fc\u30b6\u3092\u3053\u306e\u30bf\u30b9\u30af\u306b\u8ffd\u52a0 -label.all=\u3059\u3079\u3066 -label.memo=\u30e1\u30e2 +labels.tab.category=\u30ab\u30c6\u30b4\u30ea +labels.tab.tasks=\u30bf\u30b9\u30af +labels.name=\u540d\u524d +labels.back=\u623b\u308b +labels.owner=\u6240\u6709\u8005 +labels.prev=\u524d\u3078 +labels.next=\u6b21\u3078 +labels.basic=\u57fa\u672c +labels.description=\u8aac\u660e +labels.priority=\u512a\u5148\u5ea6 +labels.status=\u72b6\u614b +labels.working=\u4f5c\u696d\u4e2d +labels.completed=\u7d42\u4e86 +labels.start_date=\u958b\u59cb\u65e5 +labels.end_date=\u7d42\u4e86\u65e5 +labels.personal=\u500b\u4eba +labels.category_id=\u30ab\u30c6\u30b4\u30eaID +labels.assigned=\u5272\u308a\u5f53\u3066 +labels.title=\u30bf\u30a4\u30c8\u30eb +labels.remove=\u524a\u9664 +labels.created_by=\u4f5c\u6210\u8005 +labels.due_date=\u671f\u65e5 +labels.edit=\u7de8\u96c6 +labels.user_id=\u30e6\u30fc\u30b6ID +labels.email=E\u30e1\u30fc\u30eb +labels.add=\u8ffd\u52a0 +labels.category=\u30ab\u30c6\u30b4\u30ea +labels.configuration=\u8a2d\u5b9a +labels.guest_user_name=\u30b2\u30b9\u30c8\u30e6\u30fc\u30b6\u540d +labels.add_user_to_this_task=\u30e6\u30fc\u30b6\u3092\u3053\u306e\u30bf\u30b9\u30af\u306b\u8ffd\u52a0 +labels.all=\u3059\u3079\u3066 +labels.memo=\u30e1\u30e2 -label.blocker=\u6700\u512a\u5148 -label.critical=\u512a\u5148 -label.major=\u666e\u901a -label.minor=\u4f4e\u3044 -label.trivial=\u6700\u3082\u4f4e\u3044 +labels.blocker=\u6700\u512a\u5148 +labels.critical=\u512a\u5148 +labels.major=\u666e\u901a +labels.minor=\u4f4e\u3044 +labels.trivial=\u6700\u3082\u4f4e\u3044 -label.input.create=\u4f5c\u6210 -label.input.delete=\u524a\u9664 -label.input.confirm=\u78ba\u8a8d -label.input.back=\u623b\u308b -label.input.update=\u66f4\u65b0 -label.input.edit=\u7de8\u96c6 -label.input.remove=\u79fb\u52d5 -label.input.remove_from_me=\u3053\u306e\u30bf\u30b9\u30af\u3092\u79fb\u52d5\u3059\u308b +labels.input.create=\u4f5c\u6210 +labels.input.delete=\u524a\u9664 +labels.input.confirm=\u78ba\u8a8d +labels.input.back=\u623b\u308b +labels.input.update=\u66f4\u65b0 +labels.input.edit=\u7de8\u96c6 +labels.input.remove=\u524a\u9664 +labels.input.remove_from_me=\u81ea\u5206\u3092\u30bf\u30b9\u30af\u304b\u3089\u524a\u9664 -label.category.confirm.category_info=\u30ab\u30c6\u30b4\u30ea\u60c5\u5831\u306e\u78ba\u5b9a -label.category.edit.category_info=\u30ab\u30c6\u30b4\u30ea\u60c5\u5831\u306e\u7de8\u96c6 -label.category.index.category=\u65b0\u3057\u3044\u30ab\u30c6\u30b4\u30ea\u306e\u4f5c\u6210 -label.todo.confirm.task_info=\u30bf\u30b9\u30af\u306e\u78ba\u5b9a -label.todo.edit.task_info=\u30bf\u30b9\u30af\u306e\u7de8\u96c6 -label.todo.index.create_new_task=\u30bf\u30b9\u30af\u306e\u4f5c\u6210 -label.userinfo.index.back_to_task_detail=\u30bf\u30b9\u30af\u306e\u8a73\u7d30\u3078\u623b\u308b \ No newline at end of file +labels.category.confirm.category_info=\u30ab\u30c6\u30b4\u30ea\u60c5\u5831\u306e\u78ba\u5b9a +labels.category.edit.category_info=\u30ab\u30c6\u30b4\u30ea\u60c5\u5831\u306e\u7de8\u96c6 +labels.category.index.category=\u65b0\u3057\u3044\u30ab\u30c6\u30b4\u30ea\u306e\u4f5c\u6210 +labels.todo.confirm.task_info=\u30bf\u30b9\u30af\u306e\u78ba\u5b9a +labels.todo.edit.task_info=\u30bf\u30b9\u30af\u306e\u7de8\u96c6 +labels.todo.index.create_new_task=\u30bf\u30b9\u30af\u306e\u4f5c\u6210 +labels.userinfo.index.back_to_task_detail=\u30bf\u30b9\u30af\u306e\u8a73\u7d30\u3078\u623b\u308b + +labels.categoryId=\u30ab\u30c6\u30b4\u30ea ID +labels.descriptionForTodo=\u8aac\u660e +labels.guestName=\u30b2\u30b9\u30c8\u540d +labels.nameForTodo=\u540d\u524d +labels.endDateDate=\u671f\u65e5(\u65e5) +labels.endDateMonth=\u671f\u65e5(\u6708) +labels.endDateYear=\u671f\u65e5(\u5e74) +labels.priorityForTodo=Priority +labels.startDateDate=\u958b\u59cb\u65e5(\u65e5) +labels.startDateMonth=\u958b\u59cb\u65e5(\u6708) +labels.startDateYear=\u958b\u59cb\u65e5(\u5e74) + +labels.delete=\u524a\u9664 +labels.new_category=\u30ab\u30c6\u30b4\u30ea\u306e\u4f5c\u6210 +labels.userId=\u30e6\u30fc\u30b6\u30fc ID + Modified: todolist/trunk/src/main/resources/jp/sf/pal/todolist/resources/TodoListEditor_ja.properties =================================================================== --- todolist/trunk/src/main/resources/jp/sf/pal/todolist/resources/TodoListEditor_ja.properties 2008-12-01 02:23:57 UTC (rev 1486) +++ todolist/trunk/src/main/resources/jp/sf/pal/todolist/resources/TodoListEditor_ja.properties 2008-12-01 08:10:57 UTC (rev 1487) @@ -1,4 +1,4 @@ # portlet info -javax.portlet.title=ToDo\u30ea\u30b9\u30c8\u30a8\u30c7\u30a3\u30bf -javax.portlet.short-title=ToDo\u30ea\u30b9\u30c8\u30a8\u30c7\u30a3\u30bf -javax.portlet.keywords=ToDo\u30ea\u30b9\u30c8,\u30a8\u30c7\u30a3\u30bf,\u7de8\u96c6 \ No newline at end of file +javax.portlet.title=ToDo\u30ea\u30b9\u30c8 +javax.portlet.short-title=ToDo\u30ea\u30b9\u30c8 +javax.portlet.keywords=ToDo\u30ea\u30b9\u30c8,\u7de8\u96c6 \ No newline at end of file Modified: todolist/trunk/src/main/webapp/WEB-INF/view/admin/category/confirm.jsp =================================================================== --- todolist/trunk/src/main/webapp/WEB-INF/view/admin/category/confirm.jsp 2008-12-01 02:23:57 UTC (rev 1486) +++ todolist/trunk/src/main/webapp/WEB-INF/view/admin/category/confirm.jsp 2008-12-01 08:10:57 UTC (rev 1487) @@ -5,14 +5,30 @@ -
+ +
  • -
  • +
  • -
  • +
  • +
@@ -25,32 +41,36 @@
ÀßÄê¾ðÊó
Åê¹Æµ­»ö¤ÎºÇÂçʸ»ú¿ô
ÊÖ¿®¤ÎºÇÂçʸ»ú¿ô
Åê¹Æ¸å¤ÎÊÔ½¸ -ÊÔ½¸²Ä -ÊÔ½¸ÉÔ²Ä + +
źÉÕ¥Õ¥¡¥¤¥ë¤ÎºÇÂ祵¥¤¥º ¥Ð¥¤¥È
- +"/>
- + - + + + + + Modified: todolist/trunk/src/main/webapp/WEB-INF/view/admin/category/edit.jsp =================================================================== --- todolist/trunk/src/main/webapp/WEB-INF/view/admin/category/edit.jsp 2008-12-01 02:23:57 UTC (rev 1486) +++ todolist/trunk/src/main/webapp/WEB-INF/view/admin/category/edit.jsp 2008-12-01 08:10:57 UTC (rev 1487) @@ -5,14 +5,30 @@ -
+ +
  • -
  • +
  • -
  • +
  • +
@@ -25,18 +41,22 @@
${f:h(name)}
${f:h(userId)}
- "/> - "/> + "/> + "/> - "/> - "/> + "/> + "/> - "/> - "/> + "/> + "/> - "/> - "/> - "/> + "/> + "/> + "/>
- + - - + + + + + + Modified: todolist/trunk/src/main/webapp/WEB-INF/view/admin/category/error.jsp =================================================================== --- todolist/trunk/src/main/webapp/WEB-INF/view/admin/category/error.jsp 2008-12-01 02:23:57 UTC (rev 1486) +++ todolist/trunk/src/main/webapp/WEB-INF/view/admin/category/error.jsp 2008-12-01 08:10:57 UTC (rev 1487) @@ -4,14 +4,30 @@ -
+ +
  • -
  • +
  • -
  • +
  • +
@@ -19,7 +35,7 @@
- +
Modified: todolist/trunk/src/main/webapp/WEB-INF/view/admin/category/index.jsp =================================================================== --- todolist/trunk/src/main/webapp/WEB-INF/view/admin/category/index.jsp 2008-12-01 02:23:57 UTC (rev 1486) +++ todolist/trunk/src/main/webapp/WEB-INF/view/admin/category/index.jsp 2008-12-01 08:10:57 UTC (rev 1487) @@ -5,14 +5,30 @@ -
+ +
  • -
  • +
  • -
  • +
  • +
@@ -22,13 +38,13 @@
- +
- "/> - "/> + "/> + "/>
- - + + @@ -36,10 +52,10 @@ - + @@ -49,7 +65,7 @@
- + @@ -66,7 +82,7 @@ - +
Modified: todolist/trunk/src/main/webapp/WEB-INF/view/admin/todo/confirm.jsp =================================================================== --- todolist/trunk/src/main/webapp/WEB-INF/view/admin/todo/confirm.jsp 2008-12-01 02:23:57 UTC (rev 1486) +++ todolist/trunk/src/main/webapp/WEB-INF/view/admin/todo/confirm.jsp 2008-12-01 08:10:57 UTC (rev 1487) @@ -5,14 +5,29 @@ -
+ +
  • -
  • +
  • -
  • +
@@ -26,7 +41,7 @@
 
${f:h(c.name)}${f:h(c.userIdFromUserInfo)} - Edit - Delete + +
- + @@ -34,35 +49,35 @@
- - + + - + - + - + - + - + - + + + + + Modified: userinfo/trunk/src/main/webapp/WEB-INF/view/userInfo/edit.jsp =================================================================== --- userinfo/trunk/src/main/webapp/WEB-INF/view/userInfo/edit.jsp 2008-12-26 22:11:31 UTC (rev 1622) +++ userinfo/trunk/src/main/webapp/WEB-INF/view/userInfo/edit.jsp 2008-12-27 22:02:56 UTC (rev 1623) @@ -113,6 +113,16 @@ + + + + Modified: userinfo/trunk/src/main/webapp/WEB-INF/view/userInfo/grouplist.jsp =================================================================== --- userinfo/trunk/src/main/webapp/WEB-INF/view/userInfo/grouplist.jsp 2008-12-26 22:11:31 UTC (rev 1622) +++ userinfo/trunk/src/main/webapp/WEB-INF/view/userInfo/grouplist.jsp 2008-12-27 22:02:56 UTC (rev 1623) @@ -60,6 +60,7 @@ + ${f:u(u.roleId)} Modified: userinfo/trunk/src/main/webapp/WEB-INF/view/userInfo/index.jsp =================================================================== --- userinfo/trunk/src/main/webapp/WEB-INF/view/userInfo/index.jsp 2008-12-26 22:11:31 UTC (rev 1622) +++ userinfo/trunk/src/main/webapp/WEB-INF/view/userInfo/index.jsp 2008-12-27 22:02:56 UTC (rev 1623) @@ -42,6 +42,27 @@
+
+ +
${f:h(nameForTodo)}${f:h(nameForTodo)}
${f:br(f:nbsp(f:h(descriptionForTodo)))}
- - - - - + + + + +
- - + +
${f:h(y)} @@ -85,7 +100,7 @@
${f:h(y)} @@ -112,24 +127,24 @@
- + - - + - + @@ -138,20 +153,20 @@ - + --> + + +
${f:h(categoryId)}
- - + + +
${f:br(f:nbsp(f:h(memo)))}
- - + + - + @@ -166,26 +181,25 @@ Modified: todolist/trunk/src/main/webapp/WEB-INF/view/admin/todo/edit.jsp =================================================================== --- todolist/trunk/src/main/webapp/WEB-INF/view/admin/todo/edit.jsp 2008-12-01 02:23:57 UTC (rev 1486) +++ todolist/trunk/src/main/webapp/WEB-INF/view/admin/todo/edit.jsp 2008-12-01 08:10:57 UTC (rev 1487) @@ -5,14 +5,30 @@ -
+ +
  • -
  • +
  • -
  • +
  • +
@@ -26,43 +42,43 @@
${f:h(t.userIdFromUserInfo)} -g - + +
- "/> - "/> + "/> + "/> - "/> - "/> + "/> + "/> - "/> - "/> + "/> + "/> - "/> - "/> - "/> - "/> + "/> + "/> + "/> - "/> - "/> + "/> + "/>
- + - + + + + + Added: timecard/trunk/src/main/webapp/WEB-INF/view/employee/errorDownload.jsp =================================================================== --- timecard/trunk/src/main/webapp/WEB-INF/view/employee/errorDownload.jsp (rev 0) +++ timecard/trunk/src/main/webapp/WEB-INF/view/employee/errorDownload.jsp 2008-12-23 01:07:01 UTC (rev 1619) @@ -0,0 +1,26 @@ +<%@page pageEncoding="UTF-8" %> + + + + + + +
+ +
+ + Property changes on: timecard/trunk/src/main/webapp/WEB-INF/view/employee/errorDownload.jsp ___________________________________________________________________ Name: svn:eol-style + native Modified: timecard/trunk/src/main/webapp/WEB-INF/view/employee/index.jsp =================================================================== --- timecard/trunk/src/main/webapp/WEB-INF/view/employee/index.jsp 2008-12-20 13:39:54 UTC (rev 1618) +++ timecard/trunk/src/main/webapp/WEB-INF/view/employee/index.jsp 2008-12-23 01:07:01 UTC (rev 1619) @@ -60,6 +60,11 @@ --> + + +
- - + + - - + + - + - + - + - + - + - + @@ -174,8 +193,8 @@ Modified: todolist/trunk/src/main/webapp/WEB-INF/view/admin/todo/error.jsp =================================================================== --- todolist/trunk/src/main/webapp/WEB-INF/view/admin/todo/error.jsp 2008-12-01 02:23:57 UTC (rev 1486) +++ todolist/trunk/src/main/webapp/WEB-INF/view/admin/todo/error.jsp 2008-12-01 08:10:57 UTC (rev 1487) @@ -4,14 +4,30 @@ -
+ +
  • -
  • +
  • -
  • +
  • +
@@ -19,7 +35,7 @@
- +
Modified: todolist/trunk/src/main/webapp/WEB-INF/view/admin/todo/index.jsp =================================================================== --- todolist/trunk/src/main/webapp/WEB-INF/view/admin/todo/index.jsp 2008-12-01 02:23:57 UTC (rev 1486) +++ todolist/trunk/src/main/webapp/WEB-INF/view/admin/todo/index.jsp 2008-12-01 08:10:57 UTC (rev 1487) @@ -5,14 +5,30 @@ -
+ +
  • -
  • +
  • -
  • +
  • +
@@ -22,16 +38,16 @@
- +
- - - - - + + + + +
- - + +
@@ -87,7 +103,7 @@
@@ -117,55 +133,58 @@
- - + + - - + - - + +
+ - - + +
- - - + + + - + - +
  
${f:h(t.userIdFromUserInfo)} - - + + + +   +
- +
- "/> - "/> + "/> + "/>
- - - - - + + + + + @@ -39,22 +55,22 @@ - - + + --> + + +
 
- - - - - + + + + + ${f:h(t.todo.name)}${f:h(t.userIdFromUserInfo)}${f:h(t.todo.createdByFromUserInfo)} - + + +
  • -
  • +
  • -
  • +
  • +
@@ -19,7 +35,7 @@
- +
Modified: todolist/trunk/src/main/webapp/WEB-INF/view/admin/userInfo/index.jsp =================================================================== --- todolist/trunk/src/main/webapp/WEB-INF/view/admin/userInfo/index.jsp 2008-12-01 02:23:57 UTC (rev 1486) +++ todolist/trunk/src/main/webapp/WEB-INF/view/admin/userInfo/index.jsp 2008-12-01 08:10:57 UTC (rev 1487) @@ -5,14 +5,30 @@ -
+ +
  • -
  • +
  • -
  • +
  • +
@@ -22,14 +38,14 @@
- +
- - - + + + @@ -37,10 +53,10 @@ - + @@ -50,7 +66,7 @@
- + @@ -67,7 +83,7 @@ - +
Modified: todolist/trunk/src/main/webapp/WEB-INF/view/common/common.jsp =================================================================== --- todolist/trunk/src/main/webapp/WEB-INF/view/common/common.jsp 2008-12-01 02:23:57 UTC (rev 1486) +++ todolist/trunk/src/main/webapp/WEB-INF/view/common/common.jsp 2008-12-01 08:10:57 UTC (rev 1487) @@ -4,6 +4,5 @@ <%@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="f" uri="http://sastruts.seasar.org/functions"%> <%@taglib prefix="s" uri="http://sastruts.seasar.org/portlet"%> Modified: todolist/trunk/src/main/webapp/WEB-INF/view/config/index.jsp =================================================================== --- todolist/trunk/src/main/webapp/WEB-INF/view/config/index.jsp 2008-12-01 02:23:57 UTC (rev 1486) +++ todolist/trunk/src/main/webapp/WEB-INF/view/config/index.jsp 2008-12-01 08:10:57 UTC (rev 1487) @@ -5,22 +5,37 @@ -
+ +
 
${f:h(u.userId)}${f:h(u.familyName)} ${f:h(u.givenName)} ${f:h(u.email)} - +
- + - - + + Modified: todolist/trunk/src/main/webapp/WEB-INF/view/user/category/confirm.jsp =================================================================== --- todolist/trunk/src/main/webapp/WEB-INF/view/user/category/confirm.jsp 2008-12-01 02:23:57 UTC (rev 1486) +++ todolist/trunk/src/main/webapp/WEB-INF/view/user/category/confirm.jsp 2008-12-01 08:10:57 UTC (rev 1487) @@ -5,14 +5,30 @@ -
+ +
  • -
  • +
  • -
  • +
  • +
@@ -25,10 +41,10 @@
-"/> +"/>
- + - + @@ -36,21 +52,21 @@ Modified: todolist/trunk/src/main/webapp/WEB-INF/view/user/category/edit.jsp =================================================================== --- todolist/trunk/src/main/webapp/WEB-INF/view/user/category/edit.jsp 2008-12-01 02:23:57 UTC (rev 1486) +++ todolist/trunk/src/main/webapp/WEB-INF/view/user/category/edit.jsp 2008-12-01 08:10:57 UTC (rev 1487) @@ -5,14 +5,30 @@ -
+ +
  • -
  • +
  • -
  • +
  • +
@@ -25,18 +41,18 @@
${f:h(name)}
- "/> - "/> + "/> + "/> - "/> - "/> + "/> + "/> - "/> - "/> + "/> + "/> - "/> - "/> - "/> + "/> + "/> + "/>
- + - - + + Modified: todolist/trunk/src/main/webapp/WEB-INF/view/user/category/error.jsp =================================================================== --- todolist/trunk/src/main/webapp/WEB-INF/view/user/category/error.jsp 2008-12-01 02:23:57 UTC (rev 1486) +++ todolist/trunk/src/main/webapp/WEB-INF/view/user/category/error.jsp 2008-12-01 08:10:57 UTC (rev 1487) @@ -4,14 +4,30 @@ -
+ +
  • -
  • +
  • -
  • +
  • +
@@ -19,7 +35,7 @@
- +
Modified: todolist/trunk/src/main/webapp/WEB-INF/view/user/category/index.jsp =================================================================== --- todolist/trunk/src/main/webapp/WEB-INF/view/user/category/index.jsp 2008-12-01 02:23:57 UTC (rev 1486) +++ todolist/trunk/src/main/webapp/WEB-INF/view/user/category/index.jsp 2008-12-01 08:10:57 UTC (rev 1487) @@ -5,14 +5,30 @@ -
+ +
  • -
  • +
  • -
  • +
  • +
@@ -22,12 +38,12 @@
- +
- "/> - "/> + "/> + "/>
- + @@ -36,8 +52,8 @@ @@ -47,7 +63,7 @@
- + @@ -64,7 +80,7 @@ - +
Modified: todolist/trunk/src/main/webapp/WEB-INF/view/user/todo/confirm.jsp =================================================================== --- todolist/trunk/src/main/webapp/WEB-INF/view/user/todo/confirm.jsp 2008-12-01 02:23:57 UTC (rev 1486) +++ todolist/trunk/src/main/webapp/WEB-INF/view/user/todo/confirm.jsp 2008-12-01 08:10:57 UTC (rev 1487) @@ -5,14 +5,30 @@ -
+ +
  • -
  • +
  • -
  • +
  • +
@@ -26,43 +42,43 @@
 
${f:h(c.name)} - Edit - Delete + +
- + - +
- - + + - + - + - + - + - + - +
${f:h(nameForTodo)}${f:h(nameForTodo)}
${f:br(f:nbsp(f:h(descriptionForTodo)))}
- - - - - + + + + +
- - + +
${f:h(y)} @@ -85,7 +101,7 @@
${f:h(y)} @@ -112,12 +128,12 @@
- + - - + - + @@ -144,20 +160,20 @@ - + - + From svnnotify ¡÷ sourceforge.jp Tue Dec 9 10:59:37 2008 From: svnnotify ¡÷ sourceforge.jp (svnnotify ¡÷ sourceforge.jp) Date: Tue, 09 Dec 2008 10:59:37 +0900 Subject: [pal-cvs 3802] [1537] excluded selected users. Message-ID: <1228787977.090674.18937.nullmailer@users.sourceforge.jp> Revision: 1537 http://svn.sourceforge.jp/view?root=pal&view=rev&rev=1537 Author: shinsuke Date: 2008-12-09 10:59:36 +0900 (Tue, 09 Dec 2008) Log Message: ----------- excluded selected users. Modified Paths: -------------- todolist/trunk/src/main/java/jp/sf/pal/todolist/action/admin/UserInfoAction.java todolist/trunk/src/main/java/jp/sf/pal/todolist/action/user/TodoAction.java todolist/trunk/src/main/java/jp/sf/pal/todolist/action/user/UserInfoAction.java todolist/trunk/src/main/java/jp/sf/pal/todolist/pager/UserInfoPager.java todolist/trunk/src/main/java/jp/sf/pal/todolist/service/TodoService.java todolist/trunk/src/main/java/jp/sf/pal/todolist/service/UserInfoService.java -------------- next part -------------- Modified: todolist/trunk/src/main/java/jp/sf/pal/todolist/action/admin/UserInfoAction.java =================================================================== --- todolist/trunk/src/main/java/jp/sf/pal/todolist/action/admin/UserInfoAction.java 2008-12-09 01:08:11 UTC (rev 1536) +++ todolist/trunk/src/main/java/jp/sf/pal/todolist/action/admin/UserInfoAction.java 2008-12-09 01:59:36 UTC (rev 1537) @@ -49,6 +49,9 @@ private transient HttpServletRequest request; protected String displayList() { + // set excluded userIds + userInfoPager.setExcludedUserIdList(todoService.getUserIdList(Long + .parseLong(userInfoForm.todoId))); // page navi userInfoItems = userInfoService.getUserInfoList(userInfoPager); @@ -150,9 +153,6 @@ private void loadListPageParameters() { } - private void loadDetailsPageParameters() { - } - /** * @return the request */ Modified: todolist/trunk/src/main/java/jp/sf/pal/todolist/action/user/TodoAction.java =================================================================== --- todolist/trunk/src/main/java/jp/sf/pal/todolist/action/user/TodoAction.java 2008-12-09 01:08:11 UTC (rev 1536) +++ todolist/trunk/src/main/java/jp/sf/pal/todolist/action/user/TodoAction.java 2008-12-09 01:59:36 UTC (rev 1537) @@ -479,7 +479,7 @@ todo.setTodoMappingList(todoMappingList); } todoDxo.convertFromFormToTodo(todoForm, todo); - + if (todoForm.getStartDateForTodo() == null) { todo.setStartDate(null); } Modified: todolist/trunk/src/main/java/jp/sf/pal/todolist/action/user/UserInfoAction.java =================================================================== --- todolist/trunk/src/main/java/jp/sf/pal/todolist/action/user/UserInfoAction.java 2008-12-09 01:08:11 UTC (rev 1536) +++ todolist/trunk/src/main/java/jp/sf/pal/todolist/action/user/UserInfoAction.java 2008-12-09 01:59:36 UTC (rev 1537) @@ -50,6 +50,9 @@ private transient HttpServletRequest request; protected String displayList() { + // set excluded userIds + userInfoPager.setExcludedUserIdList(todoService.getUserIdList(Long + .parseLong(userInfoForm.todoId))); // page navi userInfoItems = userInfoService.getUserInfoList(userInfoPager); @@ -151,9 +154,6 @@ private void loadListPageParameters() { } - private void loadDetailsPageParameters() { - } - /** * @return the request */ Modified: todolist/trunk/src/main/java/jp/sf/pal/todolist/pager/UserInfoPager.java =================================================================== --- todolist/trunk/src/main/java/jp/sf/pal/todolist/pager/UserInfoPager.java 2008-12-09 01:08:11 UTC (rev 1536) +++ todolist/trunk/src/main/java/jp/sf/pal/todolist/pager/UserInfoPager.java 2008-12-09 01:59:36 UTC (rev 1537) @@ -1,11 +1,15 @@ package jp.sf.pal.todolist.pager; +import java.util.List; + import jp.sf.pal.todolist.common.pager.DefaultPager; public class UserInfoPager extends DefaultPager { private static final long serialVersionUID = -1518841728377756219L; + private List excludedUserIdList; + public UserInfoPager() { } @@ -18,4 +22,12 @@ return 50; } + public List getExcludedUserIdList() { + return excludedUserIdList; + } + + public void setExcludedUserIdList(List excludedUserIdList) { + this.excludedUserIdList = excludedUserIdList; + } + } Modified: todolist/trunk/src/main/java/jp/sf/pal/todolist/service/TodoService.java =================================================================== --- todolist/trunk/src/main/java/jp/sf/pal/todolist/service/TodoService.java 2008-12-09 01:08:11 UTC (rev 1536) +++ todolist/trunk/src/main/java/jp/sf/pal/todolist/service/TodoService.java 2008-12-09 01:59:36 UTC (rev 1537) @@ -2,6 +2,7 @@ import java.io.Serializable; import java.sql.Timestamp; +import java.util.ArrayList; import java.util.Date; import java.util.List; @@ -291,6 +292,18 @@ todoMappingBhv.queryUpdate(todoMapping, cb); } + public List getUserIdList(Long todoId) { + TodoMappingCB cb = new TodoMappingCB(); + cb.specify().columnUserId(); + cb.query().setTodoId_Equal(todoId); + List todoMappingList = todoMappingBhv.selectList(cb); + List userIdList = new ArrayList(); + for (TodoMapping todoMapping : todoMappingList) { + userIdList.add(todoMapping.getUserId()); + } + return userIdList; + } + public PagerDxo getPagerDxo() { return pagerDxo; } Modified: todolist/trunk/src/main/java/jp/sf/pal/todolist/service/UserInfoService.java =================================================================== --- todolist/trunk/src/main/java/jp/sf/pal/todolist/service/UserInfoService.java 2008-12-09 01:08:11 UTC (rev 1536) +++ todolist/trunk/src/main/java/jp/sf/pal/todolist/service/UserInfoService.java 2008-12-09 01:59:36 UTC (rev 1537) @@ -33,6 +33,11 @@ // setup cb.query().setDeletedBy_IsNull(); + if (userInfoPager.getExcludedUserIdList() != null + && !userInfoPager.getExcludedUserIdList().isEmpty()) { + cb.query().setUserId_NotInScope( + userInfoPager.getExcludedUserIdList()); + } cb.query().addOrderBy_UserId_Asc(); From svnnotify ¡÷ sourceforge.jp Tue Dec 9 10:59:54 2008 From: svnnotify ¡÷ sourceforge.jp (svnnotify ¡÷ sourceforge.jp) Date: Tue, 09 Dec 2008 10:59:54 +0900 Subject: [pal-cvs 3803] [1538] updated translation. Message-ID: <1228787994.092017.19083.nullmailer@users.sourceforge.jp> Revision: 1538 http://svn.sourceforge.jp/view?root=pal&view=rev&rev=1538 Author: shinsuke Date: 2008-12-09 10:59:54 +0900 (Tue, 09 Dec 2008) Log Message: ----------- updated translation. Modified Paths: -------------- todolist/trunk/src/main/resources/application_ja.properties -------------- next part -------------- Modified: todolist/trunk/src/main/resources/application_ja.properties =================================================================== --- todolist/trunk/src/main/resources/application_ja.properties 2008-12-09 01:59:36 UTC (rev 1537) +++ todolist/trunk/src/main/resources/application_ja.properties 2008-12-09 01:59:54 UTC (rev 1538) @@ -75,7 +75,7 @@ labels.end_date=\u671f\u65e5 labels.personal=\u500b\u4eba labels.category_id=\u30ab\u30c6\u30b4\u30eaID -labels.assigned=\u5272\u308a\u5f53\u3066 +labels.assigned=\u767b\u9332\u5148 labels.title=\u30bf\u30a4\u30c8\u30eb labels.remove=\u524a\u9664 labels.created_by=\u4f5c\u6210\u8005 From svnnotify ¡÷ sourceforge.jp Tue Dec 9 11:15:20 2008 From: svnnotify ¡÷ sourceforge.jp (svnnotify ¡÷ sourceforge.jp) Date: Tue, 09 Dec 2008 11:15:20 +0900 Subject: [pal-cvs 3804] [1539] added not_started status. Message-ID: <1228788920.893125.9838.nullmailer@users.sourceforge.jp> Revision: 1539 http://svn.sourceforge.jp/view?root=pal&view=rev&rev=1539 Author: shinsuke Date: 2008-12-09 11:15:20 +0900 (Tue, 09 Dec 2008) Log Message: ----------- added not_started status. Modified Paths: -------------- todolist/trunk/src/main/java/jp/sf/pal/todolist/ToDoListConstants.java todolist/trunk/src/main/java/jp/sf/pal/todolist/action/admin/UserInfoAction.java todolist/trunk/src/main/java/jp/sf/pal/todolist/action/user/UserInfoAction.java todolist/trunk/src/main/java/jp/sf/pal/todolist/db/exentity/TodoMapping.java todolist/trunk/src/main/java/jp/sf/pal/todolist/service/TodoService.java todolist/trunk/src/main/resources/application.properties todolist/trunk/src/main/resources/application_ja.properties todolist/trunk/src/main/webapp/WEB-INF/view/admin/todo/confirm.jsp todolist/trunk/src/main/webapp/WEB-INF/view/admin/todo/edit.jsp todolist/trunk/src/main/webapp/WEB-INF/view/user/todo/confirm.jsp todolist/trunk/src/main/webapp/WEB-INF/view/user/todo/edit.jsp -------------- next part -------------- Modified: todolist/trunk/src/main/java/jp/sf/pal/todolist/ToDoListConstants.java =================================================================== --- todolist/trunk/src/main/java/jp/sf/pal/todolist/ToDoListConstants.java 2008-12-09 01:59:54 UTC (rev 1538) +++ todolist/trunk/src/main/java/jp/sf/pal/todolist/ToDoListConstants.java 2008-12-09 02:15:20 UTC (rev 1539) @@ -2,6 +2,8 @@ public class ToDoListConstants { + public static final int NOT_STARTED = 0; + public static final int WORKING = 1; public static final int COMPLETED = 10; Modified: todolist/trunk/src/main/java/jp/sf/pal/todolist/action/admin/UserInfoAction.java =================================================================== --- todolist/trunk/src/main/java/jp/sf/pal/todolist/action/admin/UserInfoAction.java 2008-12-09 01:59:54 UTC (rev 1538) +++ todolist/trunk/src/main/java/jp/sf/pal/todolist/action/admin/UserInfoAction.java 2008-12-09 02:15:20 UTC (rev 1539) @@ -131,7 +131,7 @@ String userId = request.getRemoteUser(); TodoMapping todoMapping = new TodoMapping(); - todoMapping.setStatus(ToDoListConstants.WORKING); + todoMapping.setStatus(ToDoListConstants.NOT_STARTED); todoMapping.setTodoId(id); todoMapping.setUserId(userInfo.getUserId()); todoMapping.setCreatedBy(userId); Modified: todolist/trunk/src/main/java/jp/sf/pal/todolist/action/user/UserInfoAction.java =================================================================== --- todolist/trunk/src/main/java/jp/sf/pal/todolist/action/user/UserInfoAction.java 2008-12-09 01:59:54 UTC (rev 1538) +++ todolist/trunk/src/main/java/jp/sf/pal/todolist/action/user/UserInfoAction.java 2008-12-09 02:15:20 UTC (rev 1539) @@ -132,7 +132,7 @@ String userId = ToDoListUtil.getUserId(request); TodoMapping todoMapping = new TodoMapping(); - todoMapping.setStatus(ToDoListConstants.WORKING); + todoMapping.setStatus(ToDoListConstants.NOT_STARTED); todoMapping.setTodoId(id); todoMapping.setUserId(userInfo.getUserId()); todoMapping.setCreatedBy(userId); Modified: todolist/trunk/src/main/java/jp/sf/pal/todolist/db/exentity/TodoMapping.java =================================================================== --- todolist/trunk/src/main/java/jp/sf/pal/todolist/db/exentity/TodoMapping.java 2008-12-09 01:59:54 UTC (rev 1538) +++ todolist/trunk/src/main/java/jp/sf/pal/todolist/db/exentity/TodoMapping.java 2008-12-09 02:15:20 UTC (rev 1539) @@ -26,7 +26,7 @@ public TodoMapping(String userId) { super(); setUserId(userId); - setStatus(ToDoListConstants.WORKING); + setStatus(ToDoListConstants.NOT_STARTED); } public String getUserIdFromUserInfo() { Modified: todolist/trunk/src/main/java/jp/sf/pal/todolist/service/TodoService.java =================================================================== --- todolist/trunk/src/main/java/jp/sf/pal/todolist/service/TodoService.java 2008-12-09 01:59:54 UTC (rev 1538) +++ todolist/trunk/src/main/java/jp/sf/pal/todolist/service/TodoService.java 2008-12-09 02:15:20 UTC (rev 1539) @@ -211,12 +211,12 @@ cb2.query().setTodoId_Equal(todoMapping.getTodoId()); boolean finished = true; for (TodoMapping tm : todoMappingBhv.selectList(cb2)) { - if (ToDoListConstants.WORKING == tm.getStatus()) { + if (ToDoListConstants.COMPLETED != tm.getStatus()) { finished = false; } } - if (finished && todo.getStatus() == ToDoListConstants.WORKING) { + if (finished && todo.getStatus() != ToDoListConstants.COMPLETED) { todo.setStatus(ToDoListConstants.COMPLETED); todoBhv.update(todo); } else if (!finished && todo.getStatus() == ToDoListConstants.COMPLETED) { Modified: todolist/trunk/src/main/resources/application.properties =================================================================== --- todolist/trunk/src/main/resources/application.properties 2008-12-09 01:59:54 UTC (rev 1538) +++ todolist/trunk/src/main/resources/application.properties 2008-12-09 02:15:20 UTC (rev 1539) @@ -136,3 +136,6 @@ labels.delete=Delete labels.new_category=Create Category labels.userId=User ID + +labels.not_started=Not Started + Modified: todolist/trunk/src/main/resources/application_ja.properties =================================================================== --- todolist/trunk/src/main/resources/application_ja.properties 2008-12-09 01:59:54 UTC (rev 1538) +++ todolist/trunk/src/main/resources/application_ja.properties 2008-12-09 02:15:20 UTC (rev 1539) @@ -130,3 +130,4 @@ labels.new_category=\u30ab\u30c6\u30b4\u30ea\u306e\u4f5c\u6210 labels.userId=\u30e6\u30fc\u30b6\u30fc ID +labels.not_started=\u672a\u958b\u59cb Modified: todolist/trunk/src/main/webapp/WEB-INF/view/admin/todo/confirm.jsp =================================================================== --- todolist/trunk/src/main/webapp/WEB-INF/view/admin/todo/confirm.jsp 2008-12-09 01:59:54 UTC (rev 1538) +++ todolist/trunk/src/main/webapp/WEB-INF/view/admin/todo/confirm.jsp 2008-12-09 02:15:20 UTC (rev 1539) @@ -71,6 +71,7 @@ Modified: todolist/trunk/src/main/webapp/WEB-INF/view/admin/todo/edit.jsp =================================================================== --- todolist/trunk/src/main/webapp/WEB-INF/view/admin/todo/edit.jsp 2008-12-09 01:59:54 UTC (rev 1538) +++ todolist/trunk/src/main/webapp/WEB-INF/view/admin/todo/edit.jsp 2008-12-09 02:15:20 UTC (rev 1539) @@ -72,6 +72,7 @@ Modified: todolist/trunk/src/main/webapp/WEB-INF/view/user/todo/confirm.jsp =================================================================== --- todolist/trunk/src/main/webapp/WEB-INF/view/user/todo/confirm.jsp 2008-12-09 01:59:54 UTC (rev 1538) +++ todolist/trunk/src/main/webapp/WEB-INF/view/user/todo/confirm.jsp 2008-12-09 02:15:20 UTC (rev 1539) @@ -72,6 +72,7 @@ Modified: todolist/trunk/src/main/webapp/WEB-INF/view/user/todo/edit.jsp =================================================================== --- todolist/trunk/src/main/webapp/WEB-INF/view/user/todo/edit.jsp 2008-12-09 01:59:54 UTC (rev 1538) +++ todolist/trunk/src/main/webapp/WEB-INF/view/user/todo/edit.jsp 2008-12-09 02:15:20 UTC (rev 1539) @@ -72,6 +72,7 @@ From svnnotify ¡÷ sourceforge.jp Tue Dec 9 11:26:37 2008 From: svnnotify ¡÷ sourceforge.jp (svnnotify ¡÷ sourceforge.jp) Date: Tue, 09 Dec 2008 11:26:37 +0900 Subject: [pal-cvs 3805] [1540] display company info in a confirmation page. Message-ID: <1228789598.002705.19953.nullmailer@users.sourceforge.jp> Revision: 1540 http://svn.sourceforge.jp/view?root=pal&view=rev&rev=1540 Author: shinsuke Date: 2008-12-09 11:26:37 +0900 (Tue, 09 Dec 2008) Log Message: ----------- display company info in a confirmation page. Modified Paths: -------------- addresslist/trunk/src/main/java/jp/sf/pal/addresslist/action/admin/PersonAction.java addresslist/trunk/src/main/java/jp/sf/pal/addresslist/action/user/PersonAction.java -------------- next part -------------- Modified: addresslist/trunk/src/main/java/jp/sf/pal/addresslist/action/admin/PersonAction.java =================================================================== --- addresslist/trunk/src/main/java/jp/sf/pal/addresslist/action/admin/PersonAction.java 2008-12-09 02:15:20 UTC (rev 1539) +++ addresslist/trunk/src/main/java/jp/sf/pal/addresslist/action/admin/PersonAction.java 2008-12-09 02:26:37 UTC (rev 1540) @@ -305,7 +305,7 @@ private void loadDetailsPageParameters() { if (!StringUtils.isEmpty(personForm.companyId) && company == null) { Long companyId = Long.parseLong(personForm.companyId); - company = companyService.getCompany(companyId, null, false); + company = companyService.getCompany(companyId, null, true); } if (!StringUtils.isEmpty(personForm.userId) && userInfo == null) { userInfo = userInfoService.getUserInfo(personForm.userId); Modified: addresslist/trunk/src/main/java/jp/sf/pal/addresslist/action/user/PersonAction.java =================================================================== --- addresslist/trunk/src/main/java/jp/sf/pal/addresslist/action/user/PersonAction.java 2008-12-09 02:15:20 UTC (rev 1539) +++ addresslist/trunk/src/main/java/jp/sf/pal/addresslist/action/user/PersonAction.java 2008-12-09 02:26:37 UTC (rev 1540) @@ -308,7 +308,7 @@ if (!StringUtils.isEmpty(personForm.companyId) && company == null) { String userId = AddressListUtil.getUserId(request); Long companyId = Long.parseLong(personForm.companyId); - company = companyService.getCompany(companyId, userId, false); + company = companyService.getCompany(companyId, userId, true); } if (!StringUtils.isEmpty(personForm.userId) && userInfo == null) { userInfo = userInfoService.getUserInfo(personForm.userId); From svnnotify ¡÷ sourceforge.jp Tue Dec 9 12:53:14 2008 From: svnnotify ¡÷ sourceforge.jp (svnnotify ¡÷ sourceforge.jp) Date: Tue, 09 Dec 2008 12:53:14 +0900 Subject: [pal-cvs 3806] [1541] 1.0-PR1 Message-ID: <1228794794.060901.4529.nullmailer@users.sourceforge.jp> Revision: 1541 http://svn.sourceforge.jp/view?root=pal&view=rev&rev=1541 Author: shinsuke Date: 2008-12-09 12:53:13 +0900 (Tue, 09 Dec 2008) Log Message: ----------- 1.0-PR1 Modified Paths: -------------- addresslist/trunk/pom.xml -------------- next part -------------- Modified: addresslist/trunk/pom.xml =================================================================== --- addresslist/trunk/pom.xml 2008-12-09 02:26:37 UTC (rev 1540) +++ addresslist/trunk/pom.xml 2008-12-09 03:53:13 UTC (rev 1541) @@ -3,7 +3,7 @@ 4.0.0jp.sf.paladdresslist - 1.0-SNAPSHOT + 1.0-PR1warAddress List From svnnotify ¡÷ sourceforge.jp Tue Dec 9 13:00:07 2008 From: svnnotify ¡÷ sourceforge.jp (svnnotify ¡÷ sourceforge.jp) Date: Tue, 09 Dec 2008 13:00:07 +0900 Subject: [pal-cvs 3807] [1542] created branches. Message-ID: <1228795207.791317.11408.nullmailer@users.sourceforge.jp> Revision: 1542 http://svn.sourceforge.jp/view?root=pal&view=rev&rev=1542 Author: shinsuke Date: 2008-12-09 13:00:07 +0900 (Tue, 09 Dec 2008) Log Message: ----------- created branches. Added Paths: ----------- addresslist/branches/ -------------- next part -------------- From svnnotify ¡÷ sourceforge.jp Tue Dec 9 13:00:20 2008 From: svnnotify ¡÷ sourceforge.jp (svnnotify ¡÷ sourceforge.jp) Date: Tue, 09 Dec 2008 13:00:20 +0900 Subject: [pal-cvs 3808] [1543] 1.0-PR1 Message-ID: <1228795220.255622.11668.nullmailer@users.sourceforge.jp> Revision: 1543 http://svn.sourceforge.jp/view?root=pal&view=rev&rev=1543 Author: shinsuke Date: 2008-12-09 13:00:20 +0900 (Tue, 09 Dec 2008) Log Message: ----------- 1.0-PR1 Added Paths: ----------- addresslist/branches/addresslist-1.0-PR1/ -------------- next part -------------- Copied: addresslist/branches/addresslist-1.0-PR1 (from rev 1542, addresslist/trunk) From svnnotify ¡÷ sourceforge.jp Tue Dec 9 13:01:48 2008 From: svnnotify ¡÷ sourceforge.jp (svnnotify ¡÷ sourceforge.jp) Date: Tue, 09 Dec 2008 13:01:48 +0900 Subject: [pal-cvs 3809] [1544] 1.0-PR1 Message-ID: <1228795308.372994.12377.nullmailer@users.sourceforge.jp> Revision: 1544 http://svn.sourceforge.jp/view?root=pal&view=rev&rev=1544 Author: shinsuke Date: 2008-12-09 13:01:48 +0900 (Tue, 09 Dec 2008) Log Message: ----------- 1.0-PR1 Modified Paths: -------------- board/trunk/pom.xml -------------- next part -------------- Modified: board/trunk/pom.xml =================================================================== --- board/trunk/pom.xml 2008-12-09 04:00:20 UTC (rev 1543) +++ board/trunk/pom.xml 2008-12-09 04:01:48 UTC (rev 1544) @@ -3,7 +3,7 @@ 4.0.0 jp.sf.pal board - 1.0-SNAPSHOT + 1.0-PR1 war Message Board From svnnotify ¡÷ sourceforge.jp Tue Dec 9 13:02:13 2008 From: svnnotify ¡÷ sourceforge.jp (svnnotify ¡÷ sourceforge.jp) Date: Tue, 09 Dec 2008 13:02:13 +0900 Subject: [pal-cvs 3810] [1545] created branches Message-ID: <1228795333.702416.13567.nullmailer@users.sourceforge.jp> Revision: 1545 http://svn.sourceforge.jp/view?root=pal&view=rev&rev=1545 Author: shinsuke Date: 2008-12-09 13:02:13 +0900 (Tue, 09 Dec 2008) Log Message: ----------- created branches Added Paths: ----------- board/branches/ -------------- next part -------------- From svnnotify ¡÷ sourceforge.jp Tue Dec 9 13:03:13 2008 From: svnnotify ¡÷ sourceforge.jp (svnnotify ¡÷ sourceforge.jp) Date: Tue, 09 Dec 2008 13:03:13 +0900 Subject: [pal-cvs 3811] [1546] 1.0-PR1 Message-ID: <1228795393.506028.14675.nullmailer@users.sourceforge.jp> Revision: 1546 http://svn.sourceforge.jp/view?root=pal&view=rev&rev=1546 Author: shinsuke Date: 2008-12-09 13:03:13 +0900 (Tue, 09 Dec 2008) Log Message: ----------- 1.0-PR1 Added Paths: ----------- board/branches/board-1.0-PR1/ -------------- next part -------------- Copied: board/branches/board-1.0-PR1 (from rev 1545, board/trunk) From svnnotify ¡÷ sourceforge.jp Tue Dec 9 13:03:42 2008 From: svnnotify ¡÷ sourceforge.jp (svnnotify ¡÷ sourceforge.jp) Date: Tue, 09 Dec 2008 13:03:42 +0900 Subject: [pal-cvs 3812] [1547] 1.0-PR2-SNAPSHOT Message-ID: <1228795422.139404.14861.nullmailer@users.sourceforge.jp> Revision: 1547 http://svn.sourceforge.jp/view?root=pal&view=rev&rev=1547 Author: shinsuke Date: 2008-12-09 13:03:41 +0900 (Tue, 09 Dec 2008) Log Message: ----------- 1.0-PR2-SNAPSHOT Modified Paths: -------------- board/trunk/pom.xml -------------- next part -------------- Modified: board/trunk/pom.xml =================================================================== --- board/trunk/pom.xml 2008-12-09 04:03:13 UTC (rev 1546) +++ board/trunk/pom.xml 2008-12-09 04:03:41 UTC (rev 1547) @@ -3,7 +3,7 @@ 4.0.0 jp.sf.pal board - 1.0-PR1 + 1.0-PR2-SNAPSHOT war Message Board From svnnotify ¡÷ sourceforge.jp Tue Dec 9 13:03:51 2008 From: svnnotify ¡÷ sourceforge.jp (svnnotify ¡÷ sourceforge.jp) Date: Tue, 09 Dec 2008 13:03:51 +0900 Subject: [pal-cvs 3813] [1548] 1.0-PR2-SNAPSHOT Message-ID: <1228795431.099077.14921.nullmailer@users.sourceforge.jp> Revision: 1548 http://svn.sourceforge.jp/view?root=pal&view=rev&rev=1548 Author: shinsuke Date: 2008-12-09 13:03:50 +0900 (Tue, 09 Dec 2008) Log Message: ----------- 1.0-PR2-SNAPSHOT Modified Paths: -------------- addresslist/trunk/pom.xml -------------- next part -------------- Modified: addresslist/trunk/pom.xml =================================================================== --- addresslist/trunk/pom.xml 2008-12-09 04:03:41 UTC (rev 1547) +++ addresslist/trunk/pom.xml 2008-12-09 04:03:50 UTC (rev 1548) @@ -3,7 +3,7 @@ 4.0.0 jp.sf.pal addresslist - 1.0-PR1 + 1.0-PR2-SNAPSHOT war Address List From svnnotify ¡÷ sourceforge.jp Tue Dec 9 13:04:22 2008 From: svnnotify ¡÷ sourceforge.jp (svnnotify ¡÷ sourceforge.jp) Date: Tue, 09 Dec 2008 13:04:22 +0900 Subject: [pal-cvs 3814] [1549] 1.0-PR1 Message-ID: <1228795462.172092.16011.nullmailer@users.sourceforge.jp> Revision: 1549 http://svn.sourceforge.jp/view?root=pal&view=rev&rev=1549 Author: shinsuke Date: 2008-12-09 13:04:22 +0900 (Tue, 09 Dec 2008) Log Message: ----------- 1.0-PR1 Modified Paths: -------------- chat/trunk/pom.xml -------------- next part -------------- Modified: chat/trunk/pom.xml =================================================================== --- chat/trunk/pom.xml 2008-12-09 04:03:50 UTC (rev 1548) +++ chat/trunk/pom.xml 2008-12-09 04:04:22 UTC (rev 1549) @@ -3,7 +3,7 @@ 4.0.0 jp.sf.pal.chat chat - 0.0.1 + 1.0-PR1 war chat From svnnotify ¡÷ sourceforge.jp Tue Dec 9 13:05:30 2008 From: svnnotify ¡÷ sourceforge.jp (svnnotify ¡÷ sourceforge.jp) Date: Tue, 09 Dec 2008 13:05:30 +0900 Subject: [pal-cvs 3815] [1550] created branches. Message-ID: <1228795530.239775.16376.nullmailer@users.sourceforge.jp> Revision: 1550 http://svn.sourceforge.jp/view?root=pal&view=rev&rev=1550 Author: shinsuke Date: 2008-12-09 13:05:30 +0900 (Tue, 09 Dec 2008) Log Message: ----------- created branches. Added Paths: ----------- chat/branches/ -------------- next part -------------- From svnnotify ¡÷ sourceforge.jp Tue Dec 9 13:05:40 2008 From: svnnotify ¡÷ sourceforge.jp (svnnotify ¡÷ sourceforge.jp) Date: Tue, 09 Dec 2008 13:05:40 +0900 Subject: [pal-cvs 3816] [1551] 1.0-PR1 Message-ID: <1228795540.710972.16533.nullmailer@users.sourceforge.jp> Revision: 1551 http://svn.sourceforge.jp/view?root=pal&view=rev&rev=1551 Author: shinsuke Date: 2008-12-09 13:05:40 +0900 (Tue, 09 Dec 2008) Log Message: ----------- 1.0-PR1 Added Paths: ----------- chat/branches/chat-1.0-PR1/ -------------- next part -------------- Copied: chat/branches/chat-1.0-PR1 (from rev 1550, chat/trunk) From svnnotify ¡÷ sourceforge.jp Tue Dec 9 13:05:53 2008 From: svnnotify ¡÷ sourceforge.jp (svnnotify ¡÷ sourceforge.jp) Date: Tue, 09 Dec 2008 13:05:53 +0900 Subject: [pal-cvs 3817] [1552] 1.0-PR2-SNAPSHOT Message-ID: <1228795553.907046.16705.nullmailer@users.sourceforge.jp> Revision: 1552 http://svn.sourceforge.jp/view?root=pal&view=rev&rev=1552 Author: shinsuke Date: 2008-12-09 13:05:53 +0900 (Tue, 09 Dec 2008) Log Message: ----------- 1.0-PR2-SNAPSHOT Modified Paths: -------------- chat/trunk/pom.xml -------------- next part -------------- Modified: chat/trunk/pom.xml =================================================================== --- chat/trunk/pom.xml 2008-12-09 04:05:40 UTC (rev 1551) +++ chat/trunk/pom.xml 2008-12-09 04:05:53 UTC (rev 1552) @@ -3,7 +3,7 @@ 4.0.0 jp.sf.pal.chat chat - 1.0-PR1 + 1.0-PR2-SNAPSHOT war chat From svnnotify ¡÷ sourceforge.jp Tue Dec 9 13:06:26 2008 From: svnnotify ¡÷ sourceforge.jp (svnnotify ¡÷ sourceforge.jp) Date: Tue, 09 Dec 2008 13:06:26 +0900 Subject: [pal-cvs 3818] [1553] 1.0-PR1 Message-ID: <1228795586.180777.17961.nullmailer@users.sourceforge.jp> Revision: 1553 http://svn.sourceforge.jp/view?root=pal&view=rev&rev=1553 Author: shinsuke Date: 2008-12-09 13:06:26 +0900 (Tue, 09 Dec 2008) Log Message: ----------- 1.0-PR1 Modified Paths: -------------- bookmark/trunk/pom.xml -------------- next part -------------- Modified: bookmark/trunk/pom.xml =================================================================== --- bookmark/trunk/pom.xml 2008-12-09 04:05:53 UTC (rev 1552) +++ bookmark/trunk/pom.xml 2008-12-09 04:06:26 UTC (rev 1553) @@ -3,7 +3,7 @@ 4.0.0 jp.sf.pal bookmark - 1.0-SNAPSHOT + 1.0-PR1 war Bookmark From svnnotify ¡÷ sourceforge.jp Tue Dec 9 13:07:14 2008 From: svnnotify ¡÷ sourceforge.jp (svnnotify ¡÷ sourceforge.jp) Date: Tue, 09 Dec 2008 13:07:14 +0900 Subject: [pal-cvs 3819] [1554] created branches. Message-ID: <1228795634.222591.18530.nullmailer@users.sourceforge.jp> Revision: 1554 http://svn.sourceforge.jp/view?root=pal&view=rev&rev=1554 Author: shinsuke Date: 2008-12-09 13:07:14 +0900 (Tue, 09 Dec 2008) Log Message: ----------- created branches. Added Paths: ----------- bookmark/branches/ -------------- next part -------------- From svnnotify ¡÷ sourceforge.jp Tue Dec 9 13:07:25 2008 From: svnnotify ¡÷ sourceforge.jp (svnnotify ¡÷ sourceforge.jp) Date: Tue, 09 Dec 2008 13:07:25 +0900 Subject: [pal-cvs 3820] [1555] 1.0-PR1 Message-ID: <1228795645.685249.18645.nullmailer@users.sourceforge.jp> Revision: 1555 http://svn.sourceforge.jp/view?root=pal&view=rev&rev=1555 Author: shinsuke Date: 2008-12-09 13:07:25 +0900 (Tue, 09 Dec 2008) Log Message: ----------- 1.0-PR1 Added Paths: ----------- bookmark/branches/bookmark-1.0-PR1/ -------------- next part -------------- Copied: bookmark/branches/bookmark-1.0-PR1 (from rev 1554, bookmark/trunk) From svnnotify ¡÷ sourceforge.jp Tue Dec 9 13:07:59 2008 From: svnnotify ¡÷ sourceforge.jp (svnnotify ¡÷ sourceforge.jp) Date: Tue, 09 Dec 2008 13:07:59 +0900 Subject: [pal-cvs 3821] [1556] 1.0-PR2-SNAPSHOT Message-ID: <1228795679.831210.18913.nullmailer@users.sourceforge.jp> Revision: 1556 http://svn.sourceforge.jp/view?root=pal&view=rev&rev=1556 Author: shinsuke Date: 2008-12-09 13:07:59 +0900 (Tue, 09 Dec 2008) Log Message: ----------- 1.0-PR2-SNAPSHOT Modified Paths: -------------- bookmark/trunk/pom.xml -------------- next part -------------- Modified: bookmark/trunk/pom.xml =================================================================== --- bookmark/trunk/pom.xml 2008-12-09 04:07:25 UTC (rev 1555) +++ bookmark/trunk/pom.xml 2008-12-09 04:07:59 UTC (rev 1556) @@ -3,7 +3,7 @@ 4.0.0 jp.sf.pal bookmark - 1.0-PR1 + 1.0-PR2-SNAPSHOT war Bookmark From svnnotify ¡÷ sourceforge.jp Tue Dec 9 13:10:22 2008 From: svnnotify ¡÷ sourceforge.jp (svnnotify ¡÷ sourceforge.jp) Date: Tue, 09 Dec 2008 13:10:22 +0900 Subject: [pal-cvs 3822] [1557] 1.0.1 Message-ID: <1228795822.501653.22592.nullmailer@users.sourceforge.jp> Revision: 1557 http://svn.sourceforge.jp/view?root=pal&view=rev&rev=1557 Author: shinsuke Date: 2008-12-09 13:10:22 +0900 (Tue, 09 Dec 2008) Log Message: ----------- 1.0.1 Modified Paths: -------------- googlegadgets/trunk/pom.xml -------------- next part -------------- Modified: googlegadgets/trunk/pom.xml =================================================================== --- googlegadgets/trunk/pom.xml 2008-12-09 04:07:59 UTC (rev 1556) +++ googlegadgets/trunk/pom.xml 2008-12-09 04:10:22 UTC (rev 1557) @@ -3,7 +3,7 @@ 4.0.0 jp.sf.pal googlegadgets - 1.0 + 1.0.1 war Google Gadgets Portlet From svnnotify ¡÷ sourceforge.jp Tue Dec 9 13:11:08 2008 From: svnnotify ¡÷ sourceforge.jp (svnnotify ¡÷ sourceforge.jp) Date: Tue, 09 Dec 2008 13:11:08 +0900 Subject: [pal-cvs 3823] [1558] 1.0.1 Message-ID: <1228795868.661218.22837.nullmailer@users.sourceforge.jp> Revision: 1558 http://svn.sourceforge.jp/view?root=pal&view=rev&rev=1558 Author: shinsuke Date: 2008-12-09 13:11:08 +0900 (Tue, 09 Dec 2008) Log Message: ----------- 1.0.1 Added Paths: ----------- googlegadgets/branches/googlegadgets-1.0.1/ -------------- next part -------------- Copied: googlegadgets/branches/googlegadgets-1.0.1 (from rev 1557, googlegadgets/trunk) From svnnotify ¡÷ sourceforge.jp Tue Dec 9 13:11:57 2008 From: svnnotify ¡÷ sourceforge.jp (svnnotify ¡÷ sourceforge.jp) Date: Tue, 09 Dec 2008 13:11:57 +0900 Subject: [pal-cvs 3824] [1559] 1.1-SNAPSHOT Message-ID: <1228795917.544087.23161.nullmailer@users.sourceforge.jp> Revision: 1559 http://svn.sourceforge.jp/view?root=pal&view=rev&rev=1559 Author: shinsuke Date: 2008-12-09 13:11:57 +0900 (Tue, 09 Dec 2008) Log Message: ----------- 1.1-SNAPSHOT Modified Paths: -------------- googlegadgets/trunk/pom.xml -------------- next part -------------- Modified: googlegadgets/trunk/pom.xml =================================================================== --- googlegadgets/trunk/pom.xml 2008-12-09 04:11:08 UTC (rev 1558) +++ googlegadgets/trunk/pom.xml 2008-12-09 04:11:57 UTC (rev 1559) @@ -3,7 +3,7 @@ 4.0.0 jp.sf.pal googlegadgets - 1.0.1 + 1.1-SNAPSHOT war Google Gadgets Portlet From svnnotify ¡÷ sourceforge.jp Tue Dec 9 13:24:27 2008 From: svnnotify ¡÷ sourceforge.jp (svnnotify ¡÷ sourceforge.jp) Date: Tue, 09 Dec 2008 13:24:27 +0900 Subject: [pal-cvs 3825] [1560] 1.0.1 Message-ID: <1228796667.074477.8430.nullmailer@users.sourceforge.jp> Revision: 1560 http://svn.sourceforge.jp/view?root=pal&view=rev&rev=1560 Author: shinsuke Date: 2008-12-09 13:24:26 +0900 (Tue, 09 Dec 2008) Log Message: ----------- 1.0.1 Modified Paths: -------------- netvibes-widgets/trunk/pom.xml -------------- next part -------------- Modified: netvibes-widgets/trunk/pom.xml =================================================================== --- netvibes-widgets/trunk/pom.xml 2008-12-09 04:11:57 UTC (rev 1559) +++ netvibes-widgets/trunk/pom.xml 2008-12-09 04:24:26 UTC (rev 1560) @@ -3,7 +3,7 @@ 4.0.0 jp.sf.pal netvibes-widgets - 1.0 + 1.0.1 war Netvibes Widget Portlet From svnnotify ¡÷ sourceforge.jp Tue Dec 9 13:25:01 2008 From: svnnotify ¡÷ sourceforge.jp (svnnotify ¡÷ sourceforge.jp) Date: Tue, 09 Dec 2008 13:25:01 +0900 Subject: [pal-cvs 3826] [1561] 1.0.1 Message-ID: <1228796701.125785.8675.nullmailer@users.sourceforge.jp> Revision: 1561 http://svn.sourceforge.jp/view?root=pal&view=rev&rev=1561 Author: shinsuke Date: 2008-12-09 13:25:01 +0900 (Tue, 09 Dec 2008) Log Message: ----------- 1.0.1 Added Paths: ----------- netvibes-widgets/branches/netvibes-widgets-1.0.1/ -------------- next part -------------- Copied: netvibes-widgets/branches/netvibes-widgets-1.0.1 (from rev 1560, netvibes-widgets/trunk) From svnnotify ¡÷ sourceforge.jp Tue Dec 9 13:25:45 2008 From: svnnotify ¡÷ sourceforge.jp (svnnotify ¡÷ sourceforge.jp) Date: Tue, 09 Dec 2008 13:25:45 +0900 Subject: [pal-cvs 3827] [1562] 1.1-SNAPSHOT Message-ID: <1228796745.112792.9013.nullmailer@users.sourceforge.jp> Revision: 1562 http://svn.sourceforge.jp/view?root=pal&view=rev&rev=1562 Author: shinsuke Date: 2008-12-09 13:25:45 +0900 (Tue, 09 Dec 2008) Log Message: ----------- 1.1-SNAPSHOT Modified Paths: -------------- netvibes-widgets/trunk/pom.xml -------------- next part -------------- Modified: netvibes-widgets/trunk/pom.xml =================================================================== --- netvibes-widgets/trunk/pom.xml 2008-12-09 04:25:01 UTC (rev 1561) +++ netvibes-widgets/trunk/pom.xml 2008-12-09 04:25:45 UTC (rev 1562) @@ -3,7 +3,7 @@ 4.0.0 jp.sf.pal netvibes-widgets - 1.0.1 + 1.1-SNAPSHOT war Netvibes Widget Portlet From svnnotify ¡÷ sourceforge.jp Tue Dec 9 13:26:26 2008 From: svnnotify ¡÷ sourceforge.jp (svnnotify ¡÷ sourceforge.jp) Date: Tue, 09 Dec 2008 13:26:26 +0900 Subject: [pal-cvs 3828] [1563] 1.0-PR1 Message-ID: <1228796786.083529.10157.nullmailer@users.sourceforge.jp> Revision: 1563 http://svn.sourceforge.jp/view?root=pal&view=rev&rev=1563 Author: shinsuke Date: 2008-12-09 13:26:25 +0900 (Tue, 09 Dec 2008) Log Message: ----------- 1.0-PR1 Modified Paths: -------------- notepad/trunk/pom.xml -------------- next part -------------- Modified: notepad/trunk/pom.xml =================================================================== --- notepad/trunk/pom.xml 2008-12-09 04:25:45 UTC (rev 1562) +++ notepad/trunk/pom.xml 2008-12-09 04:26:25 UTC (rev 1563) @@ -3,7 +3,7 @@ 4.0.0 jp.sf.pal notepad - 1.0-SNAPSHOT + 1.0-PR1 war Notepad From svnnotify ¡÷ sourceforge.jp Tue Dec 9 13:26:48 2008 From: svnnotify ¡÷ sourceforge.jp (svnnotify ¡÷ sourceforge.jp) Date: Tue, 09 Dec 2008 13:26:48 +0900 Subject: [pal-cvs 3829] [1564] created branches. Message-ID: <1228796808.302927.10359.nullmailer@users.sourceforge.jp> Revision: 1564 http://svn.sourceforge.jp/view?root=pal&view=rev&rev=1564 Author: shinsuke Date: 2008-12-09 13:26:48 +0900 (Tue, 09 Dec 2008) Log Message: ----------- created branches. Added Paths: ----------- notepad/branches/ -------------- next part -------------- From svnnotify ¡÷ sourceforge.jp Tue Dec 9 13:27:03 2008 From: svnnotify ¡÷ sourceforge.jp (svnnotify ¡÷ sourceforge.jp) Date: Tue, 09 Dec 2008 13:27:03 +0900 Subject: [pal-cvs 3830] [1565] 1.0-PR1 Message-ID: <1228796823.280938.10477.nullmailer@users.sourceforge.jp> Revision: 1565 http://svn.sourceforge.jp/view?root=pal&view=rev&rev=1565 Author: shinsuke Date: 2008-12-09 13:27:03 +0900 (Tue, 09 Dec 2008) Log Message: ----------- 1.0-PR1 Added Paths: ----------- notepad/branches/notepad-1.0-PR1/ -------------- next part -------------- Copied: notepad/branches/notepad-1.0-PR1 (from rev 1564, notepad/trunk) From svnnotify ¡÷ sourceforge.jp Tue Dec 9 13:27:32 2008 From: svnnotify ¡÷ sourceforge.jp (svnnotify ¡÷ sourceforge.jp) Date: Tue, 09 Dec 2008 13:27:32 +0900 Subject: [pal-cvs 3831] [1566] 1.0-PR2-SNAPSHOT Message-ID: <1228796852.146335.10745.nullmailer@users.sourceforge.jp> Revision: 1566 http://svn.sourceforge.jp/view?root=pal&view=rev&rev=1566 Author: shinsuke Date: 2008-12-09 13:27:32 +0900 (Tue, 09 Dec 2008) Log Message: ----------- 1.0-PR2-SNAPSHOT Modified Paths: -------------- notepad/trunk/pom.xml -------------- next part -------------- Modified: notepad/trunk/pom.xml =================================================================== --- notepad/trunk/pom.xml 2008-12-09 04:27:03 UTC (rev 1565) +++ notepad/trunk/pom.xml 2008-12-09 04:27:32 UTC (rev 1566) @@ -3,7 +3,7 @@ 4.0.0 jp.sf.pal notepad - 1.0-PR1 + 1.0-PR2-SNAPSHOT war Notepad From svnnotify ¡÷ sourceforge.jp Tue Dec 9 13:28:06 2008 From: svnnotify ¡÷ sourceforge.jp (svnnotify ¡÷ sourceforge.jp) Date: Tue, 09 Dec 2008 13:28:06 +0900 Subject: [pal-cvs 3832] [1567] 1.0-PR1 Message-ID: <1228796886.418133.11907.nullmailer@users.sourceforge.jp> Revision: 1567 http://svn.sourceforge.jp/view?root=pal&view=rev&rev=1567 Author: shinsuke Date: 2008-12-09 13:28:06 +0900 (Tue, 09 Dec 2008) Log Message: ----------- 1.0-PR1 Modified Paths: -------------- scheduler/trunk/pom.xml -------------- next part -------------- Modified: scheduler/trunk/pom.xml =================================================================== --- scheduler/trunk/pom.xml 2008-12-09 04:27:32 UTC (rev 1566) +++ scheduler/trunk/pom.xml 2008-12-09 04:28:06 UTC (rev 1567) @@ -3,7 +3,7 @@ 4.0.0 jp.sf.pal scheduler - 1.0-SNAPSHOT + 1.0-PR1 war Scheduler From svnnotify ¡÷ sourceforge.jp Tue Dec 9 13:28:29 2008 From: svnnotify ¡÷ sourceforge.jp (svnnotify ¡÷ sourceforge.jp) Date: Tue, 09 Dec 2008 13:28:29 +0900 Subject: [pal-cvs 3833] [1568] created branches. Message-ID: <1228796909.481005.12806.nullmailer@users.sourceforge.jp> Revision: 1568 http://svn.sourceforge.jp/view?root=pal&view=rev&rev=1568 Author: shinsuke Date: 2008-12-09 13:28:29 +0900 (Tue, 09 Dec 2008) Log Message: ----------- created branches. Added Paths: ----------- scheduler/branches/ -------------- next part -------------- From svnnotify ¡÷ sourceforge.jp Tue Dec 9 13:28:39 2008 From: svnnotify ¡÷ sourceforge.jp (svnnotify ¡÷ sourceforge.jp) Date: Tue, 09 Dec 2008 13:28:39 +0900 Subject: [pal-cvs 3834] [1569] 1.0-PR1 Message-ID: <1228796919.200346.12934.nullmailer@users.sourceforge.jp> Revision: 1569 http://svn.sourceforge.jp/view?root=pal&view=rev&rev=1569 Author: shinsuke Date: 2008-12-09 13:28:39 +0900 (Tue, 09 Dec 2008) Log Message: ----------- 1.0-PR1 Added Paths: ----------- scheduler/branches/scheduler-1.0-PR1/ -------------- next part -------------- Copied: scheduler/branches/scheduler-1.0-PR1 (from rev 1568, scheduler/trunk) From svnnotify ¡÷ sourceforge.jp Tue Dec 9 13:29:35 2008 From: svnnotify ¡÷ sourceforge.jp (svnnotify ¡÷ sourceforge.jp) Date: Tue, 09 Dec 2008 13:29:35 +0900 Subject: [pal-cvs 3835] [1570] 1.0-PR2-SNAPSHOT Message-ID: <1228796975.880627.13434.nullmailer@users.sourceforge.jp> Revision: 1570 http://svn.sourceforge.jp/view?root=pal&view=rev&rev=1570 Author: shinsuke Date: 2008-12-09 13:29:35 +0900 (Tue, 09 Dec 2008) Log Message: ----------- 1.0-PR2-SNAPSHOT Modified Paths: -------------- scheduler/trunk/pom.xml -------------- next part -------------- Modified: scheduler/trunk/pom.xml =================================================================== --- scheduler/trunk/pom.xml 2008-12-09 04:28:39 UTC (rev 1569) +++ scheduler/trunk/pom.xml 2008-12-09 04:29:35 UTC (rev 1570) @@ -3,7 +3,7 @@ 4.0.0 jp.sf.pal scheduler - 1.0-PR1 + 1.0-PR2-SNAPSHOT war Scheduler From svnnotify ¡÷ sourceforge.jp Tue Dec 9 13:30:14 2008 From: svnnotify ¡÷ sourceforge.jp (svnnotify ¡÷ sourceforge.jp) Date: Tue, 09 Dec 2008 13:30:14 +0900 Subject: [pal-cvs 3836] [1571] clear float. Message-ID: <1228797014.045750.14673.nullmailer@users.sourceforge.jp> Revision: 1571 http://svn.sourceforge.jp/view?root=pal&view=rev&rev=1571 Author: shinsuke Date: 2008-12-09 13:30:13 +0900 (Tue, 09 Dec 2008) Log Message: ----------- clear float. Modified Paths: -------------- timecard/trunk/src/main/webapp/WEB-INF/view/admin/timecard/index.jsp timecard/trunk/src/main/webapp/WEB-INF/view/employee/index.jsp timecard/trunk/src/main/webapp/WEB-INF/view/manager/timecard/index.jsp -------------- next part -------------- Modified: timecard/trunk/src/main/webapp/WEB-INF/view/admin/timecard/index.jsp =================================================================== --- timecard/trunk/src/main/webapp/WEB-INF/view/admin/timecard/index.jsp 2008-12-09 04:29:35 UTC (rev 1570) +++ timecard/trunk/src/main/webapp/WEB-INF/view/admin/timecard/index.jsp 2008-12-09 04:30:13 UTC (rev 1571) @@ -188,6 +188,7 @@
${f:h(c.name)} @@ -127,15 +143,15 @@
- - + + +
${f:br(f:nbsp(f:h(memo)))}
- - + + - + @@ -172,26 +188,26 @@ Modified: todolist/trunk/src/main/webapp/WEB-INF/view/user/todo/edit.jsp =================================================================== --- todolist/trunk/src/main/webapp/WEB-INF/view/user/todo/edit.jsp 2008-12-01 02:23:57 UTC (rev 1486) +++ todolist/trunk/src/main/webapp/WEB-INF/view/user/todo/edit.jsp 2008-12-01 08:10:57 UTC (rev 1487) @@ -5,14 +5,30 @@ -
+ +
  • -
  • +
  • -
  • +
  • +
@@ -26,43 +42,43 @@
${f:h(t.userIdFromUserInfo)} - - + +
- "/> - "/> + "/> + "/> - "/> - "/> + "/> + "/> - "/> - "/> + "/> + "/> - "/> - "/> - "/> - "/> + "/> + "/> + "/> + "/> - "/> - "/> + "/> + "/>
- + - + - + From svnnotify ¡÷ sourceforge.jp Tue Dec 2 14:51:41 2008 From: svnnotify ¡÷ sourceforge.jp (svnnotify ¡÷ sourceforge.jp) Date: Tue, 02 Dec 2008 14:51:41 +0900 Subject: [pal-cvs 3759] [1494] added notification feature. Message-ID: <1228197101.363858.30871.nullmailer@users.sourceforge.jp> Revision: 1494 http://svn.sourceforge.jp/view?root=pal&view=rev&rev=1494 Author: shinsuke Date: 2008-12-02 14:51:41 +0900 (Tue, 02 Dec 2008) Log Message: ----------- added notification feature. Modified Paths: -------------- timecard/trunk/.classpath timecard/trunk/pom.xml timecard/trunk/src/main/java/jp/sf/pal/timecard/TimecardConstants.java timecard/trunk/src/main/java/jp/sf/pal/timecard/action/EmployeeAction.java timecard/trunk/src/main/java/jp/sf/pal/timecard/service/ReportService.java timecard/trunk/src/main/resources/application.properties timecard/trunk/src/main/resources/application_ja.properties Added Paths: ----------- timecard/trunk/src/main/java/jp/sf/pal/timecard/common/util/LocaleUtil.java timecard/trunk/src/main/java/jp/sf/pal/timecard/common/util/NotificationUtil.java timecard/trunk/src/main/java/jp/sf/pal/timecard/common/util/VelocityUtil.java timecard/trunk/src/main/webapp/WEB-INF/template/ timecard/trunk/src/main/webapp/WEB-INF/template/daily-report-request.vm timecard/trunk/src/main/webapp/WEB-INF/template/ja/ timecard/trunk/src/main/webapp/WEB-INF/template/ja/daily-report-request.vm timecard/trunk/src/main/webapp/WEB-INF/template/ja/monthly-report-request.vm timecard/trunk/src/main/webapp/WEB-INF/template/monthly-report-request.vm -------------- next part -------------- Modified: timecard/trunk/.classpath =================================================================== --- timecard/trunk/.classpath 2008-12-02 03:38:50 UTC (rev 1493) +++ timecard/trunk/.classpath 2008-12-02 05:51:41 UTC (rev 1494) @@ -43,4 +43,7 @@ + + + Modified: timecard/trunk/pom.xml =================================================================== --- timecard/trunk/pom.xml 2008-12-02 03:38:50 UTC (rev 1493) +++ timecard/trunk/pom.xml 2008-12-02 05:51:41 UTC (rev 1494) @@ -65,6 +65,12 @@ The Seasar Foundation Maven2 Repository http://maven.seasar.org/maven2 + + maven-repository.dev.java.net + java.net Maven2 Repository + https://maven-repository.dev.java.net/nonav/repository/ + legacy + @@ -193,6 +199,22 @@ s2-dao-tiger 1.0.48 + + + org.apache.velocity + velocity + 1.5 + + + javax.mail + mail + 1.4.1 + + + javax.activation + activation + 1.1.1 + Modified: timecard/trunk/src/main/java/jp/sf/pal/timecard/TimecardConstants.java =================================================================== --- timecard/trunk/src/main/java/jp/sf/pal/timecard/TimecardConstants.java 2008-12-02 03:38:50 UTC (rev 1493) +++ timecard/trunk/src/main/java/jp/sf/pal/timecard/TimecardConstants.java 2008-12-02 05:51:41 UTC (rev 1494) @@ -99,4 +99,10 @@ public static final String TIME_HOLIDAYS = "time.holidays"; public static final String DEFAULT_MANAGER = "default.manager"; + + public static final String SYSTEM_EMAIL = "system.email"; + + public static final String DAILY_REPORT_REQUEST_NOTIFICATION_NAME = "daily-report-request.vm"; + + public static final String MONTHLY_REPORT_REQUEST_NOTIFICATION_NAME = "monthly-report-request.vm"; } Modified: timecard/trunk/src/main/java/jp/sf/pal/timecard/action/EmployeeAction.java =================================================================== --- timecard/trunk/src/main/java/jp/sf/pal/timecard/action/EmployeeAction.java 2008-12-02 03:38:50 UTC (rev 1493) +++ timecard/trunk/src/main/java/jp/sf/pal/timecard/action/EmployeeAction.java 2008-12-02 05:51:41 UTC (rev 1494) @@ -5,12 +5,14 @@ import java.util.Date; import java.util.List; +import javax.servlet.ServletContext; import javax.servlet.http.HttpServletRequest; import jp.sf.pal.timecard.TimecardConstants; import jp.sf.pal.timecard.common.util.ConfigUtil; import jp.sf.pal.timecard.common.util.DateUtil; import jp.sf.pal.timecard.common.util.SAStrutsUtil; +import jp.sf.pal.timecard.common.util.VelocityUtil; import jp.sf.pal.timecard.db.exentity.DailyReport; import jp.sf.pal.timecard.db.exentity.MonthlyReport; import jp.sf.pal.timecard.dxo.DailyReportDxo; @@ -52,6 +54,8 @@ private transient HttpServletRequest request; + private transient ServletContext servletContext; + protected String displayList() { String username = request.getRemoteUser(); @@ -84,6 +88,13 @@ @Execute(validator = false, input = "error.jsp") public String index() { ConfigUtil.init(request); + try { + VelocityUtil.init(servletContext); + } catch (Exception e) { + log.error(e.getMessage(), e); + throw new ActionMessagesException("errors.failed_to_init_velocity", + e); + } return displayList(); } @@ -331,7 +342,7 @@ try { Long monthlyReportId = Long.parseLong(employeeForm.monthlyReportId); MonthlyReport monthlyReport = reportService - .getMonthlyReport(monthlyReportId); + .getMonthlyReportWithUserInfo(monthlyReportId); monthlyReport.setUpdatedBy(request.getRemoteUser()); reportService.fix(monthlyReport, employeeForm.autoFill); SAStrutsUtil.addMessage(request, "success.update_daily_report"); @@ -474,4 +485,12 @@ return minuteItems; } + public ServletContext getServletContext() { + return servletContext; + } + + public void setServletContext(ServletContext servletContext) { + this.servletContext = servletContext; + } + } Added: timecard/trunk/src/main/java/jp/sf/pal/timecard/common/util/LocaleUtil.java =================================================================== --- timecard/trunk/src/main/java/jp/sf/pal/timecard/common/util/LocaleUtil.java (rev 0) +++ timecard/trunk/src/main/java/jp/sf/pal/timecard/common/util/LocaleUtil.java 2008-12-02 05:51:41 UTC (rev 1494) @@ -0,0 +1,22 @@ +package jp.sf.pal.timecard.common.util; + +import java.util.Locale; + +import org.apache.commons.lang.StringUtils; + +public class LocaleUtil { + public static Locale parse(String localeName) { + if (StringUtils.isEmpty(localeName)) { + return null; + } + + String[] localeNames = localeName.split("_"); + if (localeNames.length > 2) { + return new Locale(localeNames[0], localeNames[1], localeNames[2]); + } else if (localeNames.length == 2) { + return new Locale(localeNames[0], localeNames[1]); + } else { + return new Locale(localeNames[0]); + } + } +} Property changes on: timecard/trunk/src/main/java/jp/sf/pal/timecard/common/util/LocaleUtil.java ___________________________________________________________________ Name: svn:eol-style + native Added: timecard/trunk/src/main/java/jp/sf/pal/timecard/common/util/NotificationUtil.java =================================================================== --- timecard/trunk/src/main/java/jp/sf/pal/timecard/common/util/NotificationUtil.java (rev 0) +++ timecard/trunk/src/main/java/jp/sf/pal/timecard/common/util/NotificationUtil.java 2008-12-02 05:51:41 UTC (rev 1494) @@ -0,0 +1,125 @@ +package jp.sf.pal.timecard.common.util; + +import java.io.StringWriter; +import java.util.ArrayList; +import java.util.Date; +import java.util.List; +import java.util.Locale; +import java.util.Map; +import java.util.Properties; + +import javax.mail.Message; +import javax.mail.Session; +import javax.mail.Transport; +import javax.mail.internet.InternetAddress; +import javax.mail.internet.MimeMessage; + +import org.apache.velocity.Template; +import org.apache.velocity.VelocityContext; +import org.seasar.struts.exception.ActionMessagesException; + +public class NotificationUtil { + + public static final String TEMPLATE_ENCODING = "notification.template.encoding"; + + public static final String SMTP_HOST = "notification.smtp.host"; + + public static final String SUBJECT_ENCODING = "notification.subject.encoding"; + + public static final String BODY_ENCODING = "notification.body.encoding"; + + private static String[] getTemplates(String templateName, Locale locale) { + List templateList = new ArrayList(); + if (locale != null) { + if (locale.getCountry() != null) { + templateList.add("/" + locale.getLanguage() + "/" + + locale.getCountry() + "/" + templateName); + } + templateList.add("/" + locale.getLanguage() + "/" + templateName); + } + templateList.add("/" + templateName); + return templateList.toArray(new String[] {}); + } + + public static void send(String templateName, Locale locale, + String fromEmail, String toEmail, Map paramMap) { + + // set velocity context + VelocityContext context = new VelocityContext(); + for (Map.Entry entry : paramMap.entrySet()) { + context.put(entry.getKey(), entry.getValue()); + } + + StringWriter sw = new StringWriter(); + + // TODO i18n: encoding + Template template = null; + for (String templatePath : getTemplates(templateName, locale)) { + try { + template = VelocityUtil.getTemplate(templatePath, ConfigUtil + .getString(TEMPLATE_ENCODING, "UTF-8")); + } catch (Exception e) { + // nothing + } + if (template != null) { + break; + } + } + + if (template == null) { + throw new ActionMessagesException( + "errors.could_not_find_notification_template", + new Object[] { templateName, locale }); + } + try { + template.merge(context, sw); + } catch (Exception e) { + throw new ActionMessagesException( + "errors.could_not_create_notification_content", e); + } + + String content = sw.toString(); + if (content == null) { + throw new ActionMessagesException( + "errors.empty_notification_content"); + } + + int index = content.indexOf("\n"); + String subject = null; + String body = null; + if (index != -1) { + subject = content.substring(0, index); + body = content.substring(index); + } else { + // TODO should throw exception? + subject = content; + body = content; + } + + try { + Properties props = System.getProperties(); + // set smtp server + props.put("mail.smtp.host", ConfigUtil.getString(SMTP_HOST, + "localhost")); + Session session = Session.getDefaultInstance(props, null); + MimeMessage mimeMessage = new MimeMessage(session); + mimeMessage.setFrom(new InternetAddress(fromEmail)); + mimeMessage.setRecipients(Message.RecipientType.TO, toEmail); + // TODO i18n: encoding + mimeMessage.setSubject(subject, ConfigUtil.getString( + SUBJECT_ENCODING, "UTF-8")); + // TODO i18n: encoding + mimeMessage.setText(body, ConfigUtil.getString(BODY_ENCODING, + "UTF-8")); + mimeMessage.setHeader("Content-Type", "text/plain"); + mimeMessage.setSentDate(new Date()); + + Transport.send(mimeMessage); + } catch (Exception e) { + throw new ActionMessagesException( + "errors.failed_to_send_notification", new Object[] { + fromEmail, toEmail }, e); + } + + } +} Property changes on: timecard/trunk/src/main/java/jp/sf/pal/timecard/common/util/NotificationUtil.java ___________________________________________________________________ Name: svn:eol-style + native Added: timecard/trunk/src/main/java/jp/sf/pal/timecard/common/util/VelocityUtil.java =================================================================== --- timecard/trunk/src/main/java/jp/sf/pal/timecard/common/util/VelocityUtil.java (rev 0) +++ timecard/trunk/src/main/java/jp/sf/pal/timecard/common/util/VelocityUtil.java 2008-12-02 05:51:41 UTC (rev 1494) @@ -0,0 +1,246 @@ +package jp.sf.pal.timecard.common.util; + +import java.io.IOException; +import java.io.Reader; +import java.io.Writer; +import java.util.Properties; + +import javax.servlet.ServletContext; + +import org.apache.commons.collections.ExtendedProperties; +import org.apache.velocity.Template; +import org.apache.velocity.app.VelocityEngine; +import org.apache.velocity.context.Context; +import org.apache.velocity.exception.MethodInvocationException; +import org.apache.velocity.exception.ParseErrorException; +import org.apache.velocity.exception.ResourceNotFoundException; +import org.apache.velocity.runtime.log.Log; + +public class VelocityUtil { + private static final String DEFAULT_TEMPLATE_PATH = "/WEB-INF/template/"; + + private static VelocityEngine velocityEngine; + + public static void init(ServletContext servletContext) throws Exception { + if (velocityEngine == null) { + velocityEngine = new VelocityEngine(); + + Properties props = new Properties(); + props.setProperty("resource.loader", "FILE"); + props + .setProperty("FILE.resource.loader.class", + "org.apache.velocity.runtime.resource.loader.FileResourceLoader"); + props.setProperty("FILE.resource.loader.cache", "true"); + props.setProperty("FILE.resource.loader.modificationCheckInterval", + "60"); + // TODO move to config file? + props.setProperty("FILE.resource.loader.path", servletContext + .getRealPath(DEFAULT_TEMPLATE_PATH)); + velocityEngine.init(props); + } + } + + /** + * @param key + * @param value + * @see org.apache.velocity.app.VelocityEngine#addProperty(java.lang.String, + * java.lang.Object) + */ + public static void addProperty(String key, Object value) { + velocityEngine.addProperty(key, value); + } + + /** + * @param key + * @see org.apache.velocity.app.VelocityEngine#clearProperty(java.lang.String) + */ + public static void clearProperty(String key) { + velocityEngine.clearProperty(key); + } + + /** + * @param arg0 + * @param arg1 + * @param arg2 + * @param arg3 + * @return + * @throws ParseErrorException + * @throws MethodInvocationException + * @throws ResourceNotFoundException + * @throws IOException + * @see org.apache.velocity.app.VelocityEngine#evaluate(org.apache.velocity.context.Context, + * java.io.Writer, java.lang.String, java.io.Reader) + */ + public static boolean evaluate(Context arg0, Writer arg1, String arg2, + Reader arg3) throws ParseErrorException, MethodInvocationException, + ResourceNotFoundException, IOException { + return velocityEngine.evaluate(arg0, arg1, arg2, arg3); + } + + /** + * @param context + * @param out + * @param logTag + * @param instring + * @return + * @throws ParseErrorException + * @throws MethodInvocationException + * @throws ResourceNotFoundException + * @throws IOException + * @see org.apache.velocity.app.VelocityEngine#evaluate(org.apache.velocity.context.Context, + * java.io.Writer, java.lang.String, java.lang.String) + */ + public static boolean evaluate(Context context, Writer out, String logTag, + String instring) throws ParseErrorException, + MethodInvocationException, ResourceNotFoundException, IOException { + return velocityEngine.evaluate(context, out, logTag, instring); + } + + /** + * @param key + * @return + * @see org.apache.velocity.app.VelocityEngine#getApplicationAttribute(java.lang.Object) + */ + public static Object getApplicationAttribute(Object key) { + return velocityEngine.getApplicationAttribute(key); + } + + /** + * @return + * @see org.apache.velocity.app.VelocityEngine#getLog() + */ + public static Log getLog() { + return velocityEngine.getLog(); + } + + /** + * @param key + * @return + * @see org.apache.velocity.app.VelocityEngine#getProperty(java.lang.String) + */ + public static Object getProperty(String key) { + return velocityEngine.getProperty(key); + } + + /** + * @param name + * @param encoding + * @return + * @throws ResourceNotFoundException + * @throws ParseErrorException + * @throws Exception + * @see org.apache.velocity.app.VelocityEngine#getTemplate(java.lang.String, + * java.lang.String) + */ + public static Template getTemplate(String name, String encoding) + throws ResourceNotFoundException, ParseErrorException, Exception { + return velocityEngine.getTemplate(name, encoding); + } + + /** + * @param name + * @return + * @throws ResourceNotFoundException + * @throws ParseErrorException + * @throws Exception + * @see org.apache.velocity.app.VelocityEngine#getTemplate(java.lang.String) + */ + public static Template getTemplate(String name) + throws ResourceNotFoundException, ParseErrorException, Exception { + return velocityEngine.getTemplate(name); + } + + /** + * @param arg0 + * @param arg1 + * @param arg2 + * @param arg3 + * @param arg4 + * @return + * @throws Exception + * @see org.apache.velocity.app.VelocityEngine#invokeVelocimacro(java.lang.String, + * java.lang.String, java.lang.String[], + * org.apache.velocity.context.Context, java.io.Writer) + */ + public static boolean invokeVelocimacro(String arg0, String arg1, + String[] arg2, Context arg3, Writer arg4) throws Exception { + return velocityEngine.invokeVelocimacro(arg0, arg1, arg2, arg3, arg4); + } + + /** + * @param templateName + * @param context + * @param writer + * @return + * @throws ResourceNotFoundException + * @throws ParseErrorException + * @throws MethodInvocationException + * @throws Exception + * @see org.apache.velocity.app.VelocityEngine#mergeTemplate(java.lang.String, + * org.apache.velocity.context.Context, java.io.Writer) + */ + public static boolean mergeTemplate(String templateName, Context context, + Writer writer) throws ResourceNotFoundException, + ParseErrorException, MethodInvocationException, Exception { + return velocityEngine.mergeTemplate(templateName, context, writer); + } + + /** + * @param templateName + * @param encoding + * @param context + * @param writer + * @return + * @throws ResourceNotFoundException + * @throws ParseErrorException + * @throws MethodInvocationException + * @throws Exception + * @see org.apache.velocity.app.VelocityEngine#mergeTemplate(java.lang.String, + * java.lang.String, org.apache.velocity.context.Context, + * java.io.Writer) + */ + public static boolean mergeTemplate(String templateName, String encoding, + Context context, Writer writer) throws ResourceNotFoundException, + ParseErrorException, MethodInvocationException, Exception { + return velocityEngine.mergeTemplate(templateName, encoding, context, + writer); + } + + /** + * @param resourceName + * @return + * @see org.apache.velocity.app.VelocityEngine#resourceExists(java.lang.String) + */ + public static boolean resourceExists(String resourceName) { + return velocityEngine.resourceExists(resourceName); + } + + /** + * @param key + * @param value + * @see org.apache.velocity.app.VelocityEngine#setApplicationAttribute(java.lang.Object, + * java.lang.Object) + */ + public static void setApplicationAttribute(Object key, Object value) { + velocityEngine.setApplicationAttribute(key, value); + } + + /** + * @param configuration + * @see org.apache.velocity.app.VelocityEngine#setExtendedProperties(org.apache.commons.collections.ExtendedProperties) + */ + public static void setExtendedProperties(ExtendedProperties configuration) { + velocityEngine.setExtendedProperties(configuration); + } + + /** + * @param key + * @param value + * @see org.apache.velocity.app.VelocityEngine#setProperty(java.lang.String, + * java.lang.Object) + */ + public static void setProperty(String key, Object value) { + velocityEngine.setProperty(key, value); + } + +} Property changes on: timecard/trunk/src/main/java/jp/sf/pal/timecard/common/util/VelocityUtil.java ___________________________________________________________________ Name: svn:eol-style + native Modified: timecard/trunk/src/main/java/jp/sf/pal/timecard/service/ReportService.java =================================================================== --- timecard/trunk/src/main/java/jp/sf/pal/timecard/service/ReportService.java 2008-12-02 03:38:50 UTC (rev 1493) +++ timecard/trunk/src/main/java/jp/sf/pal/timecard/service/ReportService.java 2008-12-02 05:51:41 UTC (rev 1494) @@ -6,11 +6,14 @@ import java.util.Date; import java.util.HashMap; import java.util.List; +import java.util.Locale; import java.util.Map; import jp.sf.pal.timecard.TimecardConstants; import jp.sf.pal.timecard.common.util.ConfigUtil; import jp.sf.pal.timecard.common.util.DateUtil; +import jp.sf.pal.timecard.common.util.LocaleUtil; +import jp.sf.pal.timecard.common.util.NotificationUtil; import jp.sf.pal.timecard.db.cbean.DailyReportCB; import jp.sf.pal.timecard.db.cbean.EmployeeCB; import jp.sf.pal.timecard.db.cbean.MonthlyReportCB; @@ -293,6 +296,34 @@ // update monthly report calculateMontlyReport(dailyReport.getMonthlyReportId()); + + if (dailyReport.getStatus() == TimecardConstants.REPORT_STATUS_REQUEST) { + // notification + MonthlyReportCB cb = new MonthlyReportCB(); + cb.setupSelect_Employee().withUserInfoByUsername(); + cb.setupSelect_Employee().withUserInfoByManager(); + cb.query().setId_Equal(dailyReport.getMonthlyReportId()); + MonthlyReport monthlyReport = monthlyReportBhv.selectEntity(cb); + UserInfo employee = monthlyReport.getEmployee() + .getUserInfoByUsername(); + UserInfo manager = monthlyReport.getEmployee() + .getUserInfoByManager(); + if (manager != null && manager.getEmail() != null) { + String toEmail = manager.getEmail(); + String fromEmail = ConfigUtil.getString( + TimecardConstants.SYSTEM_EMAIL, toEmail); + Locale locale = LocaleUtil.parse(manager.getLocale()); + Map paramMap = new HashMap(); + paramMap.put("monthlyReport", monthlyReport); + paramMap.put("dailyReport", dailyReport); + paramMap.put("employee", employee); + paramMap.put("manager", manager); + NotificationUtil + .send( + TimecardConstants.DAILY_REPORT_REQUEST_NOTIFICATION_NAME, + locale, fromEmail, toEmail, paramMap); + } + } } public List getMonthlyWokringReport( @@ -514,6 +545,19 @@ } + public MonthlyReport getMonthlyReportWithUserInfo(Long id) { + MonthlyReportCB cb = new MonthlyReportCB(); + + // setup + cb.setupSelect_Employee().withUserInfoByManager(); + cb.setupSelect_Employee().withUserInfoByUsername(); + + cb.query().setId_Equal(id); + + return monthlyReportBhv.selectEntity(cb); + + } + public void store(MonthlyReport monthlyReport) { Timestamp now = new Timestamp(new Date().getTime()); monthlyReport.setUpdatedTime(now); @@ -617,6 +661,23 @@ } calculateMontlyReport(monthlyReport.getId()); + + // notification + UserInfo employee = monthlyReport.getEmployee().getUserInfoByUsername(); + UserInfo manager = monthlyReport.getEmployee().getUserInfoByManager(); + if (manager != null && manager.getEmail() != null) { + String toEmail = manager.getEmail(); + String fromEmail = ConfigUtil.getString( + TimecardConstants.SYSTEM_EMAIL, toEmail); + Locale locale = LocaleUtil.parse(manager.getLocale()); + Map paramMap = new HashMap(); + paramMap.put("monthlyReport", monthlyReport); + paramMap.put("employee", employee); + paramMap.put("manager", manager); + NotificationUtil.send( + TimecardConstants.MONTHLY_REPORT_REQUEST_NOTIFICATION_NAME, + locale, fromEmail, toEmail, paramMap); + } } public EmployeeBhv getEmployeeBhv() { Modified: timecard/trunk/src/main/resources/application.properties =================================================================== --- timecard/trunk/src/main/resources/application.properties 2008-12-02 03:38:50 UTC (rev 1493) +++ timecard/trunk/src/main/resources/application.properties 2008-12-02 05:51:41 UTC (rev 1494) @@ -54,6 +54,12 @@ errors.invalid_username= Invalid username. errors.failed_to_update_monthly_report=Failed to update the monthly report information. +errors.failed_to_init_velocity=Failed to initialize a notification. +errors.could_not_find_notification_template=Could not find a notification template({0}) at {1}. +errors.empty_notification_content=The notification content is empty. +errors.could_not_create_notification_content=Could not create a notification content. +errors.failed_to_send_notification=Failed to send a notification from {0} to {1}. + labels.detail=Detail labels.create=Create labels.update=Update Modified: timecard/trunk/src/main/resources/application_ja.properties =================================================================== --- timecard/trunk/src/main/resources/application_ja.properties 2008-12-02 03:38:50 UTC (rev 1493) +++ timecard/trunk/src/main/resources/application_ja.properties 2008-12-02 05:51:41 UTC (rev 1494) @@ -47,6 +47,12 @@ errors.invalid_username= \u7121\u52b9\u306a\u30e6\u30fc\u30b6\u30fc\u540d\u3067\u3059 errors.failed_to_update_monthly_report=\u6708\u5831\u306e\u66f4\u65b0\u306b\u5931\u6557\u3057\u307e\u3057\u305f\u3002 +errors.failed_to_init_velocity=\u901a\u77e5\u6a5f\u80fd\u306e\u521d\u671f\u5316\u306b\u5931\u6557\u3057\u307e\u3057\u305f\u3002 +errors.could_not_find_notification_template={1} \u3067\u901a\u77e5\u30c6\u30f3\u30d7\u30ec\u30fc\u30c8({0}) \u304c\u898b\u3064\u304b\u308a\u307e\u305b\u3093\u3002 +errors.empty_notification_content=\u901a\u77e5\u5185\u5bb9\u304c\u7a7a\u3067\u3059\u3002 +errors.could_not_create_notification_content=\u901a\u4fe1\u5185\u5bb9\u3092\u4f5c\u6210\u3067\u304d\u307e\u305b\u3093\u3067\u3057\u305f\u3002 +errors.failed_to_send_notification={0} \u304b\u3089 {1} \u3078\u901a\u77e5\u3092\u9001\u4fe1\u3067\u304d\u307e\u305b\u3093\u3067\u3057\u305f\u3002 + labels.detail=\u8a73\u7d30 labels.create=\u4f5c\u6210 labels.update=\u66f4\u65b0 Added: timecard/trunk/src/main/webapp/WEB-INF/template/daily-report-request.vm =================================================================== --- timecard/trunk/src/main/webapp/WEB-INF/template/daily-report-request.vm (rev 0) +++ timecard/trunk/src/main/webapp/WEB-INF/template/daily-report-request.vm 2008-12-02 05:51:41 UTC (rev 1494) @@ -0,0 +1,31 @@ +TIMECARD: Report Request from ${employee.nameArg0} ${employee.nameArg1} +${employee.nameArg0} ${employee.nameArg1} requests below: + + Date: ${monthlyReport.year}/${monthlyReport.month}/${dailyReport.date} + Content: ## +#if(${dailyReport.workingType} == 1)Working#end## +#if(${dailyReport.workingType} == 2)Working on holiday#end## +#if(${dailyReport.workingType} == 3)Working on holiday(AM)#end## +#if(${dailyReport.workingType} == 4)Working on holiday(PM)#end## +#if(${dailyReport.workingType} == 200)Holiday#end## +#if(${dailyReport.workingType} == 100)Day off#end## +#if(${dailyReport.workingType} == 101)AM off#end## +#if(${dailyReport.workingType} == 102)PM off#end## +#if(${dailyReport.workingType} == 20)Paid holiday#end## +#if(${dailyReport.workingType} == 21)Paid holiday(AM)#end## +#if(${dailyReport.workingType} == 22)Paid holiday(PM)#end## +#if(${dailyReport.workingType} == 30)Bereavement leave#end## +#if(${dailyReport.workingType} == 31)Bereavement leave(AM)#end## +#if(${dailyReport.workingType} == 32)Bereavement leave(PM)#end## +#if(${dailyReport.workingType} == 40)Sick leave#end## +#if(${dailyReport.workingType} == 41)Sick leave(AM)#end## +#if(${dailyReport.workingType} == 42)Sick leave(PM)#end## +#if(${dailyReport.workingType} == 110)Substitute holiday#end## +#if(${dailyReport.workingType} == 111)Substitute holiday(AM)#end## +#if(${dailyReport.workingType} == 112)Substitute holiday(PM)#end## + + +Please check and approve the request. + +Timecard System + Added: timecard/trunk/src/main/webapp/WEB-INF/template/ja/daily-report-request.vm =================================================================== --- timecard/trunk/src/main/webapp/WEB-INF/template/ja/daily-report-request.vm (rev 0) +++ timecard/trunk/src/main/webapp/WEB-INF/template/ja/daily-report-request.vm 2008-12-02 05:51:41 UTC (rev 1494) @@ -0,0 +1,31 @@ +[¶ÐÂÕ] ${employee.nameArg1} ${employee.nameArg0} ¤µ¤ó¤«¤é¤Î¿½ÀÁ +${employee.nameArg1} ${employee.nameArg0} ¤µ¤ó¤¬°Ê²¼¤Î¿½ÀÁ¤ò¤·¤Þ¤·¤¿¡£ + + ÆüÉÕ: ${monthlyReport.year}/${monthlyReport.month}/${dailyReport.date} + ÆâÍÆ: ## +#if(${dailyReport.workingType} == 1)¶Ð̳#end## +#if(${dailyReport.workingType} == 2)µÙÆü¶Ð̳#end## +#if(${dailyReport.workingType} == 3)µÙÆü¶Ð̳(¸áÁ°)#end## +#if(${dailyReport.workingType} == 4)µÙÆü¶Ð̳(¸á¸å)#end## +#if(${dailyReport.workingType} == 200)µÙÆü#end## +#if(${dailyReport.workingType} == 100)µÙ²Ë#end## +#if(${dailyReport.workingType} == 101)µÙ²Ë(¸áÁ°)#end## +#if(${dailyReport.workingType} == 102)µÙ²Ë(¸á¸å)#end## +#if(${dailyReport.workingType} == 20)Í­µëµÙ²Ë#end## +#if(${dailyReport.workingType} == 21)Í­µëµÙ²Ë(¸áÁ°)#end## +#if(${dailyReport.workingType} == 22)Í­µëµÙ²Ë(¸á¸å)#end## +#if(${dailyReport.workingType} == 30)·ÄĤµÙ²Ë#end## +#if(${dailyReport.workingType} == 31)·ÄĤµÙ²Ë(¸áÁ°)#end## +#if(${dailyReport.workingType} == 32)·ÄĤµÙ²Ë(¸á¸å)#end## +#if(${dailyReport.workingType} == 40)»ä½ýɵٲË#end## +#if(${dailyReport.workingType} == 41)»ä½ýɵٲË(¸áÁ°)#end## +#if(${dailyReport.workingType} == 42)»ä½ýɵٲË(¸á¸å)#end## +#if(${dailyReport.workingType} == 110)ÂåµÙ#end## +#if(${dailyReport.workingType} == 111)ÂåµÙ(¸áÁ°)#end## +#if(${dailyReport.workingType} == 112)ÂåµÙ(¸á¸å)#end## + + +¿½ÀÁÆâÍƤò³Îǧ¡¦¾µÇ§¤ò¤·¤Æ¤¯¤À¤µ¤¤¡£ + +¶ÐÂÕ¥·¥¹¥Æ¥à + Added: timecard/trunk/src/main/webapp/WEB-INF/template/ja/monthly-report-request.vm =================================================================== --- timecard/trunk/src/main/webapp/WEB-INF/template/ja/monthly-report-request.vm (rev 0) +++ timecard/trunk/src/main/webapp/WEB-INF/template/ja/monthly-report-request.vm 2008-12-02 05:51:41 UTC (rev 1494) @@ -0,0 +1,9 @@ +[¶ÐÂÕ] ${employee.nameArg1} ${employee.nameArg0} ¤µ¤ó¤«¤é¤Î·î¼¡³ÎÄê +${employee.nameArg1} ${employee.nameArg0} ¤µ¤ó¤¬°Ê²¼¤Î·î¼¡³ÎÄê¤ò¤·¤Þ¤·¤¿¡£ + + ÆüÉÕ: ${monthlyReport.year}/${monthlyReport.month} + +ÆâÍƤò³Îǧ¡¦¾µÇ§¤ò¤·¤Æ¤¯¤À¤µ¤¤¡£ + +¶ÐÂÕ¥·¥¹¥Æ¥à + Added: timecard/trunk/src/main/webapp/WEB-INF/template/monthly-report-request.vm =================================================================== --- timecard/trunk/src/main/webapp/WEB-INF/template/monthly-report-request.vm (rev 0) +++ timecard/trunk/src/main/webapp/WEB-INF/template/monthly-report-request.vm 2008-12-02 05:51:41 UTC (rev 1494) @@ -0,0 +1,9 @@ +TIMECARD: Monthly Report Request from ${employee.nameArg0} ${employee.nameArg1} +${employee.nameArg0} ${employee.nameArg1} sent the following Monthly Report. + + Date: ${monthlyReport.year}/${monthlyReport.month} + +Please check and approve the request. + +Timecard System + From svnnotify ¡÷ sourceforge.jp Tue Dec 2 15:40:55 2008 From: svnnotify ¡÷ sourceforge.jp (svnnotify ¡÷ sourceforge.jp) Date: Tue, 02 Dec 2008 15:40:55 +0900 Subject: [pal-cvs 3760] [1495] set default values, updated translation. Message-ID: <1228200055.760390.18637.nullmailer@users.sourceforge.jp> Revision: 1495 http://svn.sourceforge.jp/view?root=pal&view=rev&rev=1495 Author: shinsuke Date: 2008-12-02 15:40:55 +0900 (Tue, 02 Dec 2008) Log Message: ----------- set default values, updated translation. Modified Paths: -------------- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/form/user/facility/OnetimeScheduleForm.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/form/user/facility/RepeatScheduleForm.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/form/user/schedule/OnetimeScheduleForm.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/form/user/schedule/RepeatScheduleForm.java scheduler/trunk/src/main/resources/application_ja.properties scheduler/trunk/src/main/webapp/WEB-INF/view/user/facility/calendar/facilityweek.jsp -------------- next part -------------- Modified: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/form/user/facility/OnetimeScheduleForm.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/form/user/facility/OnetimeScheduleForm.java 2008-12-02 05:51:41 UTC (rev 1494) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/form/user/facility/OnetimeScheduleForm.java 2008-12-02 06:40:55 UTC (rev 1495) @@ -138,30 +138,39 @@ id = null; title = null; location = null; - Calendar today = CalendarUtil.getToday(); - String year = String.valueOf(CalendarUtil.getYear(today)); - int m = CalendarUtil.getMonth(today) + 1; - String month; - if (m < 10) { - month = "0" + String.valueOf(m); + if (year == null || month == null || date == null) { + Calendar today = CalendarUtil.getToday(); + String tYear = String.valueOf(CalendarUtil.getYear(today)); + int m = CalendarUtil.getMonth(today) + 1; + String tMonth; + if (m < 10) { + tMonth = "0" + String.valueOf(m); + } else { + tMonth = String.valueOf(m); + } + int d = CalendarUtil.getDate(today); + String tDate; + if (d < 10) { + tDate = "0" + String.valueOf(d); + } else { + tDate = String.valueOf(d); + } + startDateY = tYear; + startDateM = tMonth; + startDateD = tDate; + endDateY = tYear; + endDateM = tMonth; + endDateD = tDate; } else { - month = String.valueOf(m); + startDateY = year; + startDateM = month.length() == 1 ? "0" + month : month; + startDateD = date.length() == 1 ? "0" + date : date; + endDateY = year; + endDateM = month.length() == 1 ? "0" + month : month; + endDateD = date.length() == 1 ? "0" + date : date; } - int d = CalendarUtil.getDate(today); - String date; - if (d < 10) { - date = "0" + String.valueOf(d); - } else { - date = String.valueOf(d); - } - startDateY = year; - startDateM = month; - startDateD = date; startTimeH = null; startTimeM = null; - endDateY = year; - endDateM = month; - endDateD = date; endTimeH = null; endTimeM = null; createdTime = null; Modified: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/form/user/facility/RepeatScheduleForm.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/form/user/facility/RepeatScheduleForm.java 2008-12-02 05:51:41 UTC (rev 1494) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/form/user/facility/RepeatScheduleForm.java 2008-12-02 06:40:55 UTC (rev 1495) @@ -138,22 +138,31 @@ id = null; title = null; location = null; - Calendar today = CalendarUtil.getToday(); - String year = String.valueOf(CalendarUtil.getYear(today)); - int m = CalendarUtil.getMonth(today) + 1; - String month; - if (m < 10) { - month = "0" + String.valueOf(m); + if (year == null || month == null || date == null) { + Calendar today = CalendarUtil.getToday(); + String tYear = String.valueOf(CalendarUtil.getYear(today)); + int m = CalendarUtil.getMonth(today) + 1; + String tMonth; + if (m < 10) { + tMonth = "0" + String.valueOf(m); + } else { + tMonth = String.valueOf(m); + } + int d = CalendarUtil.getDate(today); + String tDate; + if (d < 10) { + tDate = "0" + String.valueOf(d); + } else { + tDate = String.valueOf(d); + } + startDateY = tYear; + startDateM = tMonth; + startDateD = tDate; } else { - month = String.valueOf(m); + startDateY = year; + startDateM = month.length() == 1 ? "0" + month : month; + startDateD = date.length() == 1 ? "0" + date : date; } - int d = CalendarUtil.getDate(today); - String date; - if (d < 10) { - date = "0" + String.valueOf(d); - } else { - date = String.valueOf(d); - } startDateY = year; startDateM = month; startDateD = date; Modified: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/form/user/schedule/OnetimeScheduleForm.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/form/user/schedule/OnetimeScheduleForm.java 2008-12-02 05:51:41 UTC (rev 1494) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/form/user/schedule/OnetimeScheduleForm.java 2008-12-02 06:40:55 UTC (rev 1495) @@ -135,30 +135,39 @@ id = null; title = null; location = null; - Calendar today = CalendarUtil.getToday(); - String year = String.valueOf(CalendarUtil.getYear(today)); - int m = CalendarUtil.getMonth(today) + 1; - String month; - if (m < 10) { - month = "0" + String.valueOf(m); + if (year == null || month == null || date == null) { + Calendar today = CalendarUtil.getToday(); + String tYear = String.valueOf(CalendarUtil.getYear(today)); + int m = CalendarUtil.getMonth(today) + 1; + String tMonth; + if (m < 10) { + tMonth = "0" + String.valueOf(m); + } else { + tMonth = String.valueOf(m); + } + int d = CalendarUtil.getDate(today); + String tDate; + if (d < 10) { + tDate = "0" + String.valueOf(d); + } else { + tDate = String.valueOf(d); + } + startDateY = tYear; + startDateM = tMonth; + startDateD = tDate; + endDateY = tYear; + endDateM = tMonth; + endDateD = tDate; } else { - month = String.valueOf(m); + startDateY = year; + startDateM = month.length() == 1 ? "0" + month : month; + startDateD = date.length() == 1 ? "0" + date : date; + endDateY = year; + endDateM = month.length() == 1 ? "0" + month : month; + endDateD = date.length() == 1 ? "0" + date : date; } - int d = CalendarUtil.getDate(today); - String date; - if (d < 10) { - date = "0" + String.valueOf(d); - } else { - date = String.valueOf(d); - } - startDateY = year; - startDateM = month; - startDateD = date; startTimeH = null; startTimeM = null; - endDateY = year; - endDateM = month; - endDateD = date; endTimeH = null; endTimeM = null; createdTime = null; Modified: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/form/user/schedule/RepeatScheduleForm.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/form/user/schedule/RepeatScheduleForm.java 2008-12-02 05:51:41 UTC (rev 1494) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/form/user/schedule/RepeatScheduleForm.java 2008-12-02 06:40:55 UTC (rev 1495) @@ -135,25 +135,31 @@ id = null; title = null; location = null; - Calendar today = CalendarUtil.getToday(); - String year = String.valueOf(CalendarUtil.getYear(today)); - int m = CalendarUtil.getMonth(today) + 1; - String month; - if (m < 10) { - month = "0" + String.valueOf(m); + if (year == null || month == null || date == null) { + Calendar today = CalendarUtil.getToday(); + String tYear = String.valueOf(CalendarUtil.getYear(today)); + int m = CalendarUtil.getMonth(today) + 1; + String tMonth; + if (m < 10) { + tMonth = "0" + String.valueOf(m); + } else { + tMonth = String.valueOf(m); + } + int d = CalendarUtil.getDate(today); + String tDate; + if (d < 10) { + tDate = "0" + String.valueOf(d); + } else { + tDate = String.valueOf(d); + } + startDateY = tYear; + startDateM = tMonth; + startDateD = tDate; } else { - month = String.valueOf(m); + startDateY = year; + startDateM = month.length() == 1 ? "0" + month : month; + startDateD = date.length() == 1 ? "0" + date : date; } - int d = CalendarUtil.getDate(today); - String date; - if (d < 10) { - date = "0" + String.valueOf(d); - } else { - date = String.valueOf(d); - } - startDateY = year; - startDateM = month; - startDateD = date; startTimeH = null; startTimeM = null; endDateY = null; Modified: scheduler/trunk/src/main/resources/application_ja.properties =================================================================== --- scheduler/trunk/src/main/resources/application_ja.properties 2008-12-02 05:51:41 UTC (rev 1494) +++ scheduler/trunk/src/main/resources/application_ja.properties 2008-12-02 06:40:55 UTC (rev 1495) @@ -142,7 +142,7 @@ labels.day=\u65e5 labels.week=\u9031 labels.month=\u6708 -labels.today=\u672c\u65e5 +labels.today=\u4eca\u65e5 labels.sun=\u65e5 labels.mon=\u6708 labels.tue=\u706b @@ -155,13 +155,13 @@ labels.events=\u30a4\u30d9\u30f3\u30c8 labels.all_day=\u7d42\u65e5 -labels.sun2=\u65e5\u66dc -labels.mon2=\u6708\u66dc -labels.tue2=\u706b\u66dc -labels.wed2=\u6c34\u66dc -labels.thu2=\u6728\u66dc -labels.fri2=\u91d1\u66dc -labels.sat2=\u571f\u66dc +labels.sun2=\u65e5\u66dc\u65e5 +labels.mon2=\u6708\u66dc\u65e5 +labels.tue2=\u706b\u66dc\u65e5 +labels.wed2=\u6c34\u66dc\u65e5 +labels.thu2=\u6728\u66dc\u65e5 +labels.fri2=\u91d1\u66dc\u65e5 +labels.sat2=\u571f\u66dc\u65e5 labels.facility=\u65bd\u8a2d labels.facility_groups=\u65bd\u8a2d\u30b0\u30eb\u30fc\u30d7 Modified: scheduler/trunk/src/main/webapp/WEB-INF/view/user/facility/calendar/facilityweek.jsp =================================================================== --- scheduler/trunk/src/main/webapp/WEB-INF/view/user/facility/calendar/facilityweek.jsp 2008-12-02 05:51:41 UTC (rev 1494) +++ scheduler/trunk/src/main/webapp/WEB-INF/view/user/facility/calendar/facilityweek.jsp 2008-12-02 06:40:55 UTC (rev 1495) @@ -46,7 +46,7 @@
< -Today + >
- - + + - - + + - + - + - + - + - + - + @@ -181,8 +200,8 @@ Modified: todolist/trunk/src/main/webapp/WEB-INF/view/user/todo/error.jsp =================================================================== --- todolist/trunk/src/main/webapp/WEB-INF/view/user/todo/error.jsp 2008-12-01 02:23:57 UTC (rev 1486) +++ todolist/trunk/src/main/webapp/WEB-INF/view/user/todo/error.jsp 2008-12-01 08:10:57 UTC (rev 1487) @@ -4,14 +4,30 @@ -
+ +
  • -
  • +
  • -
  • +
  • +
@@ -19,7 +35,7 @@
- +
Modified: todolist/trunk/src/main/webapp/WEB-INF/view/user/todo/index.jsp =================================================================== --- todolist/trunk/src/main/webapp/WEB-INF/view/user/todo/index.jsp 2008-12-01 02:23:57 UTC (rev 1486) +++ todolist/trunk/src/main/webapp/WEB-INF/view/user/todo/index.jsp 2008-12-01 08:10:57 UTC (rev 1487) @@ -5,14 +5,30 @@ -
+ +
  • -
  • +
  • -
  • +
  • +
@@ -24,14 +40,14 @@
- - - - - + + + + +
- - + +
@@ -87,7 +103,7 @@
@@ -117,12 +133,12 @@
- + - - + - - + +
@@ -133,46 +149,49 @@
+ - - + +
- - - + + + - + - +
  
${f:h(t.userIdFromUserInfo)} - - + + + +   +
- +
- "/> - "/> + "/> + "/>
- + - + Modified: timecard/trunk/src/main/webapp/WEB-INF/view/manager/employee/confirm.jsp =================================================================== --- timecard/trunk/src/main/webapp/WEB-INF/view/manager/employee/confirm.jsp 2008-12-01 14:26:07 UTC (rev 1492) +++ timecard/trunk/src/main/webapp/WEB-INF/view/manager/employee/confirm.jsp 2008-12-02 03:38:50 UTC (rev 1493) @@ -40,10 +40,6 @@ - - - - - - - - - - - - + + + + - + - + @@ -74,10 +74,12 @@ +
    -
  • +
  • ${f:h(c.name)}
  • @@ -44,15 +60,15 @@
    - +
    - - - - + + + + @@ -60,21 +76,21 @@ - + - + Modified: timecard/trunk/src/main/webapp/WEB-INF/view/employee/index.jsp =================================================================== --- timecard/trunk/src/main/webapp/WEB-INF/view/employee/index.jsp 2008-12-01 14:26:07 UTC (rev 1492) +++ timecard/trunk/src/main/webapp/WEB-INF/view/employee/index.jsp 2008-12-02 03:38:50 UTC (rev 1493) @@ -27,20 +27,20 @@ - - - - + + + + - + - + @@ -54,10 +54,12 @@ +
     
    - - - - - + + + + + ${f:h(t.todo.name)}${f:h(t.todo.createdByFromUserInfo)} - + + +
    • -
    • +
    • -
    • +
    • +
    @@ -19,7 +35,7 @@
    - +
    Modified: todolist/trunk/src/main/webapp/WEB-INF/view/user/userInfo/index.jsp =================================================================== --- todolist/trunk/src/main/webapp/WEB-INF/view/user/userInfo/index.jsp 2008-12-01 02:23:57 UTC (rev 1486) +++ todolist/trunk/src/main/webapp/WEB-INF/view/user/userInfo/index.jsp 2008-12-01 08:10:57 UTC (rev 1487) @@ -5,14 +5,30 @@ -
    + +
    • -
    • +
    • -
    • +
    • +
    @@ -22,14 +38,14 @@
    - +
    - - - + + + @@ -37,10 +53,10 @@ - + @@ -50,7 +66,7 @@
    - + @@ -67,7 +83,7 @@ - +
    Added: todolist/trunk/src/main/webapp/css/pal-extension.css =================================================================== --- todolist/trunk/src/main/webapp/css/pal-extension.css (rev 0) +++ todolist/trunk/src/main/webapp/css/pal-extension.css 2008-12-01 08:10:57 UTC (rev 1487) @@ -0,0 +1,216 @@ +/* +Copyright 2008 Portal Application Laboratory Project + +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. +*/ + +/* ---------------- */ +/* Form Table */ +/* ---------------- */ +.todolist-portlet .form-table table { +border-top: 1px solid #cccccc; +border-left: 1px solid #cccccc; +border-collapse:collapse; +} + +.todolist-portlet .form-table caption { +border-top: 1px solid #cccccc; +border-left: 1px solid #cccccc; +border-right: 1px solid #cccccc; +background-color: #e8e8e8; +padding:5px; +margin:0; +font-weight: bold; +font-size:11pt; +color:#003366; +} + +.todolist-portlet .form-table thead { +margin:0; +padding:0; +} + +.todolist-portlet .form-table tbody { +margin:0; +padding:0; +} + +.todolist-portlet .form-table tfoot { +margin:0; +padding:0; +} + +.todolist-portlet .form-table th { +border-right: 1px solid #cccccc; +border-bottom: 1px solid #cccccc; +padding: 5px; +text-align: center; +background-color: #eeeeee; +empty-cells: show; +} + +.todolist-portlet .form-table td { +border-right: 1px solid #cccccc; +border-bottom: 1px solid #cccccc; +padding:3px; +empty-cells: show; +} + +.todolist-portlet .form-table tfoot tr td { +padding:10px; +text-align: center; +empty-cells: show; +} + +/* ---------------- */ +/* List Table */ +/* ---------------- */ +.todolist-portlet .list-table table { +border-top: 1px solid #cccccc; +border-left: 1px solid #cccccc; +border-collapse:collapse; +} + +.todolist-portlet .list-table caption { +border-top: 1px solid #cccccc; +border-left: 1px solid #cccccc; +border-right: 1px solid #cccccc; +background-color: #e8e8e8; +padding:5px; +margin:0; +font-weight: bold; +font-size:11pt; +color:#003366; +} + +.todolist-portlet .list-table thead { +margin:0; +padding:0; +} + +.todolist-portlet .list-table tbody { +margin:0; +padding:0; +} + +.todolist-portlet .list-table tfoot { +margin:0; +padding:0; +} + +.todolist-portlet .list-table .row1 { +background-color: #ffffff; +} + +.todolist-portlet .list-table .row2 { +background-color: #fffff8; +} + +.todolist-portlet .list-table th { +border-right: 1px solid #cccccc; +border-bottom: 1px solid #cccccc; +padding: 5px; +text-align: center; +background-color: #eeeeee; +empty-cells: show; +} + +.todolist-portlet .list-table td { +border-right: 1px solid #cccccc; +border-bottom: 1px solid #cccccc; +padding:3px; +empty-cells: show; +} + + +/* ---------------- */ +/* Tab */ +/* ---------------- */ +.todolist-portlet .tab-nav div { +height:25px; +line-height:23px; +margin:0; +padding:0; +width:100%; +} + +.todolist-portlet .tab-nav ul { +margin:0; +padding:0; +width:100%; +} + +.todolist-portlet .tab-nav ul li { +float:left; +height:25px; +line-height:23px; +list-style-image:none; +list-style-position:outside; +list-style-type:none; +} + +.todolist-portlet .tab-nav ul li a:visited { +color:#0000EE; +} + +.todolist-portlet .tab-nav ul li.first { +border-bottom:1px solid #A9A9A9; +width:10px; +} + +.todolist-portlet .tab-nav ul li.last-spacer { +border-bottom:1px solid #A9A9A9; +width:5px; +margin-right:-5px; +} + +.todolist-portlet .tab-nav ul li.last { +border-bottom:1px solid #A9A9A9; +float:none; +padding-right:10px; +text-align:right; +} + +.todolist-portlet .tab-nav ul li.selected { +border-color:#A9A9A9 #A9A9A9 #FFFFFF; +border-style:solid; +border-width:1px; +display:block; +margin:-1px; +_margin-top: 0px; +} + +.todolist-portlet .tab-nav ul li.selected span { +display:inline; +padding:0 10px; +white-space:pre; +} + +.todolist-portlet .tab-nav ul li.selectable { +background-color:#DCDCDC; +border:1px solid #A9A9A9; +display:block; +height:24px; +} + +.todolist-portlet .tab-nav ul li.selectable { +display:inline; +padding:0 10px; +white-space:pre; +} + +.todolist-portlet .tab-nav ul li.spacer { +border-bottom:1px solid #A9A9A9; +width:5px; +} + Property changes on: todolist/trunk/src/main/webapp/css/pal-extension.css ___________________________________________________________________ Name: svn:eol-style + native From svnnotify ¡÷ sourceforge.jp Mon Dec 1 17:47:01 2008 From: svnnotify ¡÷ sourceforge.jp (svnnotify ¡÷ sourceforge.jp) Date: Mon, 01 Dec 2008 17:47:01 +0900 Subject: [pal-cvs 3753] [1488] updated ui. Message-ID: <1228121221.576170.31710.nullmailer@users.sourceforge.jp> Revision: 1488 http://svn.sourceforge.jp/view?root=pal&view=rev&rev=1488 Author: shinsuke Date: 2008-12-01 17:47:01 +0900 (Mon, 01 Dec 2008) Log Message: ----------- updated ui. Modified Paths: -------------- bookmark/trunk/src/main/resources/application.properties bookmark/trunk/src/main/resources/application_ja.properties bookmark/trunk/src/main/webapp/WEB-INF/view/admin/category/confirm.jsp bookmark/trunk/src/main/webapp/WEB-INF/view/admin/category/edit.jsp bookmark/trunk/src/main/webapp/WEB-INF/view/admin/category/error.jsp bookmark/trunk/src/main/webapp/WEB-INF/view/admin/category/index.jsp bookmark/trunk/src/main/webapp/WEB-INF/view/admin/link/confirm.jsp bookmark/trunk/src/main/webapp/WEB-INF/view/admin/link/edit.jsp bookmark/trunk/src/main/webapp/WEB-INF/view/admin/link/error.jsp bookmark/trunk/src/main/webapp/WEB-INF/view/admin/link/index.jsp bookmark/trunk/src/main/webapp/WEB-INF/view/user/category/confirm.jsp bookmark/trunk/src/main/webapp/WEB-INF/view/user/category/edit.jsp bookmark/trunk/src/main/webapp/WEB-INF/view/user/category/error.jsp bookmark/trunk/src/main/webapp/WEB-INF/view/user/category/index.jsp bookmark/trunk/src/main/webapp/WEB-INF/view/user/link/confirm.jsp bookmark/trunk/src/main/webapp/WEB-INF/view/user/link/edit.jsp bookmark/trunk/src/main/webapp/WEB-INF/view/user/link/error.jsp bookmark/trunk/src/main/webapp/WEB-INF/view/user/link/index.jsp -------------- next part -------------- Modified: bookmark/trunk/src/main/resources/application.properties =================================================================== --- bookmark/trunk/src/main/resources/application.properties 2008-12-01 08:10:57 UTC (rev 1487) +++ bookmark/trunk/src/main/resources/application.properties 2008-12-01 08:47:01 UTC (rev 1488) @@ -93,3 +93,5 @@ labels.sortOrder=Sort Order labels.url=URL +labels.tab_link=Link +labels.tab_category=Category Modified: bookmark/trunk/src/main/resources/application_ja.properties =================================================================== --- bookmark/trunk/src/main/resources/application_ja.properties 2008-12-01 08:10:57 UTC (rev 1487) +++ bookmark/trunk/src/main/resources/application_ja.properties 2008-12-01 08:47:01 UTC (rev 1488) @@ -86,3 +86,6 @@ labels.categoryId=\u30ab\u30c6\u30b4\u30ea ID labels.sortOrder=\u9806\u756a labels.url=URL + +labels.tab_link=\u30ea\u30f3\u30af +labels.tab_category=\u30ab\u30c6\u30b4\u30ea Modified: bookmark/trunk/src/main/webapp/WEB-INF/view/admin/category/confirm.jsp =================================================================== --- bookmark/trunk/src/main/webapp/WEB-INF/view/admin/category/confirm.jsp 2008-12-01 08:10:57 UTC (rev 1487) +++ bookmark/trunk/src/main/webapp/WEB-INF/view/admin/category/confirm.jsp 2008-12-01 08:47:01 UTC (rev 1488) @@ -21,8 +21,21 @@ // -->
    + +
    +
      +
    • +
    • +
    • +
    • +
    • +
    • +
    +
    + +
    -
    +
    Modified: bookmark/trunk/src/main/webapp/WEB-INF/view/admin/category/edit.jsp =================================================================== --- bookmark/trunk/src/main/webapp/WEB-INF/view/admin/category/edit.jsp 2008-12-01 08:10:57 UTC (rev 1487) +++ bookmark/trunk/src/main/webapp/WEB-INF/view/admin/category/edit.jsp 2008-12-01 08:47:01 UTC (rev 1488) @@ -21,8 +21,21 @@ // -->
    + +
    +
      +
    • +
    • +
    • +
    • +
    • +
    • +
    +
    + +
    -
    +
    Modified: bookmark/trunk/src/main/webapp/WEB-INF/view/admin/category/error.jsp =================================================================== --- bookmark/trunk/src/main/webapp/WEB-INF/view/admin/category/error.jsp 2008-12-01 08:10:57 UTC (rev 1487) +++ bookmark/trunk/src/main/webapp/WEB-INF/view/admin/category/error.jsp 2008-12-01 08:47:01 UTC (rev 1488) @@ -20,6 +20,19 @@ // -->
    + +
    +
      +
    • +
    • +
    • +
    • +
    • +
    • +
    +
    + +
    Modified: bookmark/trunk/src/main/webapp/WEB-INF/view/admin/category/index.jsp =================================================================== --- bookmark/trunk/src/main/webapp/WEB-INF/view/admin/category/index.jsp 2008-12-01 08:10:57 UTC (rev 1487) +++ bookmark/trunk/src/main/webapp/WEB-INF/view/admin/category/index.jsp 2008-12-01 08:47:01 UTC (rev 1488) @@ -21,12 +21,23 @@ // -->
    + +
    +
      +
    • +
    • +
    • +
    • +
    • +
    • +
    +
    + +
    -
    +
    -| -
     
    ${f:h(u.userId)}${f:h(u.familyName)} ${f:h(u.givenName)} ${f:h(u.email)} - +
    Modified: bookmark/trunk/src/main/webapp/WEB-INF/view/admin/link/confirm.jsp =================================================================== --- bookmark/trunk/src/main/webapp/WEB-INF/view/admin/link/confirm.jsp 2008-12-01 08:10:57 UTC (rev 1487) +++ bookmark/trunk/src/main/webapp/WEB-INF/view/admin/link/confirm.jsp 2008-12-01 08:47:01 UTC (rev 1488) @@ -21,9 +21,22 @@ // -->
    + +
    +
      +
    • +
    • +
    • +
    • +
    • +
    • +
    +
    + +
    -
    +
    Modified: bookmark/trunk/src/main/webapp/WEB-INF/view/admin/link/edit.jsp =================================================================== --- bookmark/trunk/src/main/webapp/WEB-INF/view/admin/link/edit.jsp 2008-12-01 08:10:57 UTC (rev 1487) +++ bookmark/trunk/src/main/webapp/WEB-INF/view/admin/link/edit.jsp 2008-12-01 08:47:01 UTC (rev 1488) @@ -21,9 +21,22 @@ // -->
    + +
    +
      +
    • +
    • +
    • +
    • +
    • +
    • +
    +
    + +
    -
    +
    Modified: bookmark/trunk/src/main/webapp/WEB-INF/view/admin/link/error.jsp =================================================================== --- bookmark/trunk/src/main/webapp/WEB-INF/view/admin/link/error.jsp 2008-12-01 08:10:57 UTC (rev 1487) +++ bookmark/trunk/src/main/webapp/WEB-INF/view/admin/link/error.jsp 2008-12-01 08:47:01 UTC (rev 1488) @@ -20,6 +20,19 @@ // -->
    + +
    +
      +
    • +
    • +
    • +
    • +
    • +
    • +
    +
    + +
    Modified: bookmark/trunk/src/main/webapp/WEB-INF/view/admin/link/index.jsp =================================================================== --- bookmark/trunk/src/main/webapp/WEB-INF/view/admin/link/index.jsp 2008-12-01 08:10:57 UTC (rev 1487) +++ bookmark/trunk/src/main/webapp/WEB-INF/view/admin/link/index.jsp 2008-12-01 08:47:01 UTC (rev 1488) @@ -21,13 +21,24 @@ // -->
    + +
    +
      +
    • +
    • +
    • +
    • +
    • +
    • +
    +
    + +
    -
    +
    -| -
    Modified: bookmark/trunk/src/main/webapp/WEB-INF/view/user/category/confirm.jsp =================================================================== --- bookmark/trunk/src/main/webapp/WEB-INF/view/user/category/confirm.jsp 2008-12-01 08:10:57 UTC (rev 1487) +++ bookmark/trunk/src/main/webapp/WEB-INF/view/user/category/confirm.jsp 2008-12-01 08:47:01 UTC (rev 1488) @@ -21,8 +21,21 @@ // -->
    + +
    +
      +
    • +
    • +
    • +
    • +
    • +
    • +
    +
    + +
    -
    +
    Modified: bookmark/trunk/src/main/webapp/WEB-INF/view/user/category/edit.jsp =================================================================== --- bookmark/trunk/src/main/webapp/WEB-INF/view/user/category/edit.jsp 2008-12-01 08:10:57 UTC (rev 1487) +++ bookmark/trunk/src/main/webapp/WEB-INF/view/user/category/edit.jsp 2008-12-01 08:47:01 UTC (rev 1488) @@ -21,8 +21,21 @@ // -->
    + +
    +
      +
    • +
    • +
    • +
    • +
    • +
    • +
    +
    + +
    -
    +
    Modified: bookmark/trunk/src/main/webapp/WEB-INF/view/user/category/error.jsp =================================================================== --- bookmark/trunk/src/main/webapp/WEB-INF/view/user/category/error.jsp 2008-12-01 08:10:57 UTC (rev 1487) +++ bookmark/trunk/src/main/webapp/WEB-INF/view/user/category/error.jsp 2008-12-01 08:47:01 UTC (rev 1488) @@ -20,6 +20,19 @@ // -->
    + +
    +
      +
    • +
    • +
    • +
    • +
    • +
    • +
    +
    + +
    Modified: bookmark/trunk/src/main/webapp/WEB-INF/view/user/category/index.jsp =================================================================== --- bookmark/trunk/src/main/webapp/WEB-INF/view/user/category/index.jsp 2008-12-01 08:10:57 UTC (rev 1487) +++ bookmark/trunk/src/main/webapp/WEB-INF/view/user/category/index.jsp 2008-12-01 08:47:01 UTC (rev 1488) @@ -21,12 +21,23 @@ // -->
    + +
    +
      +
    • +
    • +
    • +
    • +
    • +
    • +
    +
    + +
    -
    +
    -| -
    Modified: bookmark/trunk/src/main/webapp/WEB-INF/view/user/link/confirm.jsp =================================================================== --- bookmark/trunk/src/main/webapp/WEB-INF/view/user/link/confirm.jsp 2008-12-01 08:10:57 UTC (rev 1487) +++ bookmark/trunk/src/main/webapp/WEB-INF/view/user/link/confirm.jsp 2008-12-01 08:47:01 UTC (rev 1488) @@ -21,8 +21,21 @@ // -->
    + +
    +
      +
    • +
    • +
    • +
    • +
    • +
    • +
    +
    + +
    -
    +
    @@ -46,7 +59,7 @@
    -
    +
    Modified: bookmark/trunk/src/main/webapp/WEB-INF/view/user/link/edit.jsp =================================================================== --- bookmark/trunk/src/main/webapp/WEB-INF/view/user/link/edit.jsp 2008-12-01 08:10:57 UTC (rev 1487) +++ bookmark/trunk/src/main/webapp/WEB-INF/view/user/link/edit.jsp 2008-12-01 08:47:01 UTC (rev 1488) @@ -21,8 +21,21 @@ // -->
    + +
    +
      +
    • +
    • +
    • +
    • +
    • +
    • +
    +
    + +
    -
    +
    @@ -46,7 +59,7 @@
    -
    +
    Modified: bookmark/trunk/src/main/webapp/WEB-INF/view/user/link/error.jsp =================================================================== --- bookmark/trunk/src/main/webapp/WEB-INF/view/user/link/error.jsp 2008-12-01 08:10:57 UTC (rev 1487) +++ bookmark/trunk/src/main/webapp/WEB-INF/view/user/link/error.jsp 2008-12-01 08:47:01 UTC (rev 1488) @@ -20,6 +20,19 @@ // -->
    + +
    +
      +
    • +
    • +
    • +
    • +
    • +
    • +
    +
    + +
    Modified: bookmark/trunk/src/main/webapp/WEB-INF/view/user/link/index.jsp =================================================================== --- bookmark/trunk/src/main/webapp/WEB-INF/view/user/link/index.jsp 2008-12-01 08:10:57 UTC (rev 1487) +++ bookmark/trunk/src/main/webapp/WEB-INF/view/user/link/index.jsp 2008-12-01 08:47:01 UTC (rev 1488) @@ -21,8 +21,21 @@ // -->
    + +
    +
      +
    • +
    • +
    • +
    • +
    • +
    • +
    +
    + +
    -
    +
    @@ -46,11 +59,9 @@
    -
    +
    -| -
    From svnnotify ¡÷ sourceforge.jp Mon Dec 1 18:18:23 2008 From: svnnotify ¡÷ sourceforge.jp (svnnotify ¡÷ sourceforge.jp) Date: Mon, 01 Dec 2008 18:18:23 +0900 Subject: [pal-cvs 3754] [1489] updated ui and fixed permission problem. Message-ID: <1228123103.203677.29099.nullmailer@users.sourceforge.jp> Revision: 1489 http://svn.sourceforge.jp/view?root=pal&view=rev&rev=1489 Author: shinsuke Date: 2008-12-01 18:18:22 +0900 (Mon, 01 Dec 2008) Log Message: ----------- updated ui and fixed permission problem. Modified Paths: -------------- notepad/trunk/src/main/java/jp/sf/pal/notepad/action/user/NotepadAction.java notepad/trunk/src/main/resources/application.properties notepad/trunk/src/main/resources/application_ja.properties notepad/trunk/src/main/webapp/WEB-INF/view/admin/category/confirm.jsp notepad/trunk/src/main/webapp/WEB-INF/view/admin/category/edit.jsp notepad/trunk/src/main/webapp/WEB-INF/view/admin/category/error.jsp notepad/trunk/src/main/webapp/WEB-INF/view/admin/category/index.jsp notepad/trunk/src/main/webapp/WEB-INF/view/admin/notepad/confirm.jsp notepad/trunk/src/main/webapp/WEB-INF/view/admin/notepad/edit.jsp notepad/trunk/src/main/webapp/WEB-INF/view/admin/notepad/error.jsp notepad/trunk/src/main/webapp/WEB-INF/view/admin/notepad/index.jsp notepad/trunk/src/main/webapp/WEB-INF/view/user/category/confirm.jsp notepad/trunk/src/main/webapp/WEB-INF/view/user/category/edit.jsp notepad/trunk/src/main/webapp/WEB-INF/view/user/category/error.jsp notepad/trunk/src/main/webapp/WEB-INF/view/user/category/index.jsp notepad/trunk/src/main/webapp/WEB-INF/view/user/notepad/confirm.jsp notepad/trunk/src/main/webapp/WEB-INF/view/user/notepad/edit.jsp notepad/trunk/src/main/webapp/WEB-INF/view/user/notepad/error.jsp notepad/trunk/src/main/webapp/WEB-INF/view/user/notepad/index.jsp -------------- next part -------------- Modified: notepad/trunk/src/main/java/jp/sf/pal/notepad/action/user/NotepadAction.java =================================================================== --- notepad/trunk/src/main/java/jp/sf/pal/notepad/action/user/NotepadAction.java 2008-12-01 08:47:01 UTC (rev 1488) +++ notepad/trunk/src/main/java/jp/sf/pal/notepad/action/user/NotepadAction.java 2008-12-01 09:18:22 UTC (rev 1489) @@ -306,6 +306,7 @@ String type = notepadForm.type; if (type != null) { if (NotepadConstants.PRIVATE_CATEGORY.equals(type) + || NotepadConstants.PUBLIC_CATEGORY.equals(type) || NotepadConstants.DEFAULT_CATEGORY.equals(type)) { String userId = request.getRemoteUser(); if (userId != null && userId.equals(notepadForm.createdBy)) { @@ -318,6 +319,10 @@ return false; } + public String getUserId() { + return request.getRemoteUser(); + } + /** * @return the request */ Modified: notepad/trunk/src/main/resources/application.properties =================================================================== --- notepad/trunk/src/main/resources/application.properties 2008-12-01 08:47:01 UTC (rev 1488) +++ notepad/trunk/src/main/resources/application.properties 2008-12-01 09:18:22 UTC (rev 1489) @@ -104,3 +104,6 @@ labels.sortOrder=Sort Order labels.title=Title +labels.tab_notepad=Notepad +labels.tab_category=Category + Modified: notepad/trunk/src/main/resources/application_ja.properties =================================================================== --- notepad/trunk/src/main/resources/application_ja.properties 2008-12-01 08:47:01 UTC (rev 1488) +++ notepad/trunk/src/main/resources/application_ja.properties 2008-12-01 09:18:22 UTC (rev 1489) @@ -97,3 +97,6 @@ labels.content=\u5185\u5bb9 labels.sortOrder=\u9806\u756a labels.title=\u30bf\u30a4\u30c8\u30eb + +labels.tab_notepad=\u30e1\u30e2 +labels.tab_category=\u30ab\u30c6\u30b4\u30ea Modified: notepad/trunk/src/main/webapp/WEB-INF/view/admin/category/confirm.jsp =================================================================== --- notepad/trunk/src/main/webapp/WEB-INF/view/admin/category/confirm.jsp 2008-12-01 08:47:01 UTC (rev 1488) +++ notepad/trunk/src/main/webapp/WEB-INF/view/admin/category/confirm.jsp 2008-12-01 09:18:22 UTC (rev 1489) @@ -21,8 +21,21 @@ // -->
    + +
    +
      +
    • +
    • +
    • +
    • +
    • +
    • +
    +
    + +
    -
    +
    Modified: notepad/trunk/src/main/webapp/WEB-INF/view/admin/category/edit.jsp =================================================================== --- notepad/trunk/src/main/webapp/WEB-INF/view/admin/category/edit.jsp 2008-12-01 08:47:01 UTC (rev 1488) +++ notepad/trunk/src/main/webapp/WEB-INF/view/admin/category/edit.jsp 2008-12-01 09:18:22 UTC (rev 1489) @@ -21,8 +21,21 @@ // -->
    + +
    +
      +
    • +
    • +
    • +
    • +
    • +
    • +
    +
    + +
    -
    +
    Modified: notepad/trunk/src/main/webapp/WEB-INF/view/admin/category/error.jsp =================================================================== --- notepad/trunk/src/main/webapp/WEB-INF/view/admin/category/error.jsp 2008-12-01 08:47:01 UTC (rev 1488) +++ notepad/trunk/src/main/webapp/WEB-INF/view/admin/category/error.jsp 2008-12-01 09:18:22 UTC (rev 1489) @@ -20,6 +20,19 @@ // -->
    + +
    +
      +
    • +
    • +
    • +
    • +
    • +
    • +
    +
    + +
    Modified: notepad/trunk/src/main/webapp/WEB-INF/view/admin/category/index.jsp =================================================================== --- notepad/trunk/src/main/webapp/WEB-INF/view/admin/category/index.jsp 2008-12-01 08:47:01 UTC (rev 1488) +++ notepad/trunk/src/main/webapp/WEB-INF/view/admin/category/index.jsp 2008-12-01 09:18:22 UTC (rev 1489) @@ -21,12 +21,23 @@ // -->
    + +
    +
      +
    • +
    • +
    • +
    • +
    • +
    • +
    +
    + +
    -
    +
    -| -
    Modified: notepad/trunk/src/main/webapp/WEB-INF/view/admin/notepad/confirm.jsp =================================================================== --- notepad/trunk/src/main/webapp/WEB-INF/view/admin/notepad/confirm.jsp 2008-12-01 08:47:01 UTC (rev 1488) +++ notepad/trunk/src/main/webapp/WEB-INF/view/admin/notepad/confirm.jsp 2008-12-01 09:18:22 UTC (rev 1489) @@ -21,9 +21,22 @@ // -->
    + +
    +
      +
    • +
    • +
    • +
    • +
    • +
    • +
    +
    + +
    -
    +
    Modified: notepad/trunk/src/main/webapp/WEB-INF/view/admin/notepad/edit.jsp =================================================================== --- notepad/trunk/src/main/webapp/WEB-INF/view/admin/notepad/edit.jsp 2008-12-01 08:47:01 UTC (rev 1488) +++ notepad/trunk/src/main/webapp/WEB-INF/view/admin/notepad/edit.jsp 2008-12-01 09:18:22 UTC (rev 1489) @@ -21,9 +21,22 @@ // -->
    + +
    +
      +
    • +
    • +
    • +
    • +
    • +
    • +
    +
    + +
    -
    +
    Modified: notepad/trunk/src/main/webapp/WEB-INF/view/admin/notepad/error.jsp =================================================================== --- notepad/trunk/src/main/webapp/WEB-INF/view/admin/notepad/error.jsp 2008-12-01 08:47:01 UTC (rev 1488) +++ notepad/trunk/src/main/webapp/WEB-INF/view/admin/notepad/error.jsp 2008-12-01 09:18:22 UTC (rev 1489) @@ -20,6 +20,19 @@ // -->
    + +
    +
      +
    • +
    • +
    • +
    • +
    • +
    • +
    +
    + +
    Modified: notepad/trunk/src/main/webapp/WEB-INF/view/admin/notepad/index.jsp =================================================================== --- notepad/trunk/src/main/webapp/WEB-INF/view/admin/notepad/index.jsp 2008-12-01 08:47:01 UTC (rev 1488) +++ notepad/trunk/src/main/webapp/WEB-INF/view/admin/notepad/index.jsp 2008-12-01 09:18:22 UTC (rev 1489) @@ -21,13 +21,24 @@ // -->
    + +
    +
      +
    • +
    • +
    • +
    • +
    • +
    • +
    +
    + +
    -
    +
    -| -
    Modified: notepad/trunk/src/main/webapp/WEB-INF/view/user/category/confirm.jsp =================================================================== --- notepad/trunk/src/main/webapp/WEB-INF/view/user/category/confirm.jsp 2008-12-01 08:47:01 UTC (rev 1488) +++ notepad/trunk/src/main/webapp/WEB-INF/view/user/category/confirm.jsp 2008-12-01 09:18:22 UTC (rev 1489) @@ -21,8 +21,21 @@ // -->
    + +
    +
      +
    • +
    • +
    • +
    • +
    • +
    • +
    +
    + +
    -
    +
    Modified: notepad/trunk/src/main/webapp/WEB-INF/view/user/category/edit.jsp =================================================================== --- notepad/trunk/src/main/webapp/WEB-INF/view/user/category/edit.jsp 2008-12-01 08:47:01 UTC (rev 1488) +++ notepad/trunk/src/main/webapp/WEB-INF/view/user/category/edit.jsp 2008-12-01 09:18:22 UTC (rev 1489) @@ -21,8 +21,21 @@ // -->
    + +
    +
      +
    • +
    • +
    • +
    • +
    • +
    • +
    +
    + +
    -
    +
    Modified: notepad/trunk/src/main/webapp/WEB-INF/view/user/category/error.jsp =================================================================== --- notepad/trunk/src/main/webapp/WEB-INF/view/user/category/error.jsp 2008-12-01 08:47:01 UTC (rev 1488) +++ notepad/trunk/src/main/webapp/WEB-INF/view/user/category/error.jsp 2008-12-01 09:18:22 UTC (rev 1489) @@ -20,6 +20,19 @@ // -->
    + +
    +
      +
    • +
    • +
    • +
    • +
    • +
    • +
    +
    + +
    Modified: notepad/trunk/src/main/webapp/WEB-INF/view/user/category/index.jsp =================================================================== --- notepad/trunk/src/main/webapp/WEB-INF/view/user/category/index.jsp 2008-12-01 08:47:01 UTC (rev 1488) +++ notepad/trunk/src/main/webapp/WEB-INF/view/user/category/index.jsp 2008-12-01 09:18:22 UTC (rev 1489) @@ -21,12 +21,23 @@ // -->
    + +
    +
      +
    • +
    • +
    • +
    • +
    • +
    • +
    +
    + +
    -
    +
    -| -
    Modified: notepad/trunk/src/main/webapp/WEB-INF/view/user/notepad/confirm.jsp =================================================================== --- notepad/trunk/src/main/webapp/WEB-INF/view/user/notepad/confirm.jsp 2008-12-01 08:47:01 UTC (rev 1488) +++ notepad/trunk/src/main/webapp/WEB-INF/view/user/notepad/confirm.jsp 2008-12-01 09:18:22 UTC (rev 1489) @@ -21,8 +21,21 @@ // -->
    + +
    +
      +
    • +
    • +
    • +
    • +
    • +
    • +
    +
    + +
    -
    +
    @@ -46,7 +59,7 @@
    -
    +
    Modified: notepad/trunk/src/main/webapp/WEB-INF/view/user/notepad/edit.jsp =================================================================== --- notepad/trunk/src/main/webapp/WEB-INF/view/user/notepad/edit.jsp 2008-12-01 08:47:01 UTC (rev 1488) +++ notepad/trunk/src/main/webapp/WEB-INF/view/user/notepad/edit.jsp 2008-12-01 09:18:22 UTC (rev 1489) @@ -21,8 +21,21 @@ // -->
    + +
    +
      +
    • +
    • +
    • +
    • +
    • +
    • +
    +
    + +
    -
    +
    @@ -46,7 +59,7 @@
    -
    +
    Modified: notepad/trunk/src/main/webapp/WEB-INF/view/user/notepad/error.jsp =================================================================== --- notepad/trunk/src/main/webapp/WEB-INF/view/user/notepad/error.jsp 2008-12-01 08:47:01 UTC (rev 1488) +++ notepad/trunk/src/main/webapp/WEB-INF/view/user/notepad/error.jsp 2008-12-01 09:18:22 UTC (rev 1489) @@ -20,6 +20,19 @@ // -->
    + +
    +
      +
    • +
    • +
    • +
    • +
    • +
    • +
    +
    + +
    Modified: notepad/trunk/src/main/webapp/WEB-INF/view/user/notepad/index.jsp =================================================================== --- notepad/trunk/src/main/webapp/WEB-INF/view/user/notepad/index.jsp 2008-12-01 08:47:01 UTC (rev 1488) +++ notepad/trunk/src/main/webapp/WEB-INF/view/user/notepad/index.jsp 2008-12-01 09:18:22 UTC (rev 1489) @@ -21,8 +21,21 @@ // -->
    + +
    +
      +
    • +
    • +
    • +
    • +
    • +
    • +
    +
    + +
    -
    +
    @@ -46,11 +59,9 @@
    -
    +
    -| -
    @@ -67,7 +78,7 @@ From svnnotify ¡÷ sourceforge.jp Mon Dec 1 23:12:15 2008 From: svnnotify ¡÷ sourceforge.jp (svnnotify ¡÷ sourceforge.jp) Date: Mon, 01 Dec 2008 23:12:15 +0900 Subject: [pal-cvs 3755] [1490] fixed bug and set empty string. Message-ID: <1228140735.715090.6962.nullmailer@users.sourceforge.jp> Revision: 1490 http://svn.sourceforge.jp/view?root=pal&view=rev&rev=1490 Author: shinsuke Date: 2008-12-01 23:12:15 +0900 (Mon, 01 Dec 2008) Log Message: ----------- fixed bug and set empty string. Modified Paths: -------------- timecard/trunk/src/main/java/jp/sf/pal/timecard/action/EmployeeAction.java timecard/trunk/src/main/java/jp/sf/pal/timecard/action/admin/TimecardAction.java timecard/trunk/src/main/java/jp/sf/pal/timecard/service/ReportService.java -------------- next part -------------- Modified: timecard/trunk/src/main/java/jp/sf/pal/timecard/action/EmployeeAction.java =================================================================== --- timecard/trunk/src/main/java/jp/sf/pal/timecard/action/EmployeeAction.java 2008-12-01 09:18:22 UTC (rev 1489) +++ timecard/trunk/src/main/java/jp/sf/pal/timecard/action/EmployeeAction.java 2008-12-01 14:12:15 UTC (rev 1490) @@ -182,6 +182,31 @@ public String confirm() { employeeForm.status = String .valueOf(TimecardConstants.REPORT_STATUS_EDITING); + + if (StringUtils.isEmpty(employeeForm.startTimeHr) + || StringUtils.isEmpty(employeeForm.startTimeMin)) { + employeeForm.startTimeHr = ""; + employeeForm.startTimeMin = ""; + } + + if (StringUtils.isEmpty(employeeForm.endTimeHr) + || StringUtils.isEmpty(employeeForm.endTimeMin)) { + employeeForm.endTimeHr = ""; + employeeForm.endTimeMin = ""; + } + + if (StringUtils.isEmpty(employeeForm.breakTimeHr) + || StringUtils.isEmpty(employeeForm.breakTimeMin)) { + employeeForm.breakTimeHr = ""; + employeeForm.breakTimeMin = ""; + } + + if (StringUtils.isEmpty(employeeForm.otjTimeHr) + || StringUtils.isEmpty(employeeForm.otjTimeMin)) { + employeeForm.otjTimeHr = ""; + employeeForm.otjTimeMin = ""; + } + return "confirm.jsp"; } @@ -189,6 +214,31 @@ public String sendrequest() { employeeForm.status = String .valueOf(TimecardConstants.REPORT_STATUS_REQUEST); + + if (StringUtils.isEmpty(employeeForm.startTimeHr) + || StringUtils.isEmpty(employeeForm.startTimeMin)) { + employeeForm.startTimeHr = ""; + employeeForm.startTimeMin = ""; + } + + if (StringUtils.isEmpty(employeeForm.endTimeHr) + || StringUtils.isEmpty(employeeForm.endTimeMin)) { + employeeForm.endTimeHr = ""; + employeeForm.endTimeMin = ""; + } + + if (StringUtils.isEmpty(employeeForm.breakTimeHr) + || StringUtils.isEmpty(employeeForm.breakTimeMin)) { + employeeForm.breakTimeHr = ""; + employeeForm.breakTimeMin = ""; + } + + if (StringUtils.isEmpty(employeeForm.otjTimeHr) + || StringUtils.isEmpty(employeeForm.otjTimeMin)) { + employeeForm.otjTimeHr = ""; + employeeForm.otjTimeMin = ""; + } + return "confirm.jsp"; } Modified: timecard/trunk/src/main/java/jp/sf/pal/timecard/action/admin/TimecardAction.java =================================================================== --- timecard/trunk/src/main/java/jp/sf/pal/timecard/action/admin/TimecardAction.java 2008-12-01 09:18:22 UTC (rev 1489) +++ timecard/trunk/src/main/java/jp/sf/pal/timecard/action/admin/TimecardAction.java 2008-12-01 14:12:15 UTC (rev 1490) @@ -17,6 +17,7 @@ import jp.sf.pal.timecard.form.admin.TimecardForm; import jp.sf.pal.timecard.service.ReportService; +import org.apache.commons.lang.StringUtils; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.seasar.struts.annotation.ActionForm; @@ -174,12 +175,36 @@ @Execute(validator = true, input = "edit.jsp") public String confirm() { + if (StringUtils.isEmpty(timecardForm.startTimeHr) + || StringUtils.isEmpty(timecardForm.startTimeMin)) { + timecardForm.startTimeHr = ""; + timecardForm.startTimeMin = ""; + } + + if (StringUtils.isEmpty(timecardForm.endTimeHr) + || StringUtils.isEmpty(timecardForm.endTimeMin)) { + timecardForm.endTimeHr = ""; + timecardForm.endTimeMin = ""; + } + + if (StringUtils.isEmpty(timecardForm.breakTimeHr) + || StringUtils.isEmpty(timecardForm.breakTimeMin)) { + timecardForm.breakTimeHr = ""; + timecardForm.breakTimeMin = ""; + } + + if (StringUtils.isEmpty(timecardForm.otjTimeHr) + || StringUtils.isEmpty(timecardForm.otjTimeMin)) { + timecardForm.otjTimeHr = ""; + timecardForm.otjTimeMin = ""; + } + return "confirm.jsp"; } // @Execute(validator = false, input = "error.jsp") // public String deletepage() { - // employeeForm.mode = TimecardConstants.DELETE_MODE; + // timecardForm.mode = TimecardConstants.DELETE_MODE; // // // update edit page // loadDetailsPageParameters(); @@ -234,7 +259,7 @@ // @Execute(validator = false, input = "error.jsp") // public String delete() { // try { - // reportService.disable(Long.parseLong(employeeForm.id), request + // reportService.disable(Long.parseLong(timecardForm.id), request // .getRemoteUser()); // TimecardUtil.addMessage(request, "success.delete_daily_report"); // Modified: timecard/trunk/src/main/java/jp/sf/pal/timecard/service/ReportService.java =================================================================== --- timecard/trunk/src/main/java/jp/sf/pal/timecard/service/ReportService.java 2008-12-01 09:18:22 UTC (rev 1489) +++ timecard/trunk/src/main/java/jp/sf/pal/timecard/service/ReportService.java 2008-12-01 14:12:15 UTC (rev 1490) @@ -182,7 +182,8 @@ for (DailyReport dailyReport : dailyReportList) { if (dailyReport.getStartTime() == null && dailyReport.getEndTime() == null - && dailyReport.getBreakTime() == null) { + && dailyReport.getBreakTime() == null + && dailyReport.getWorkingType() == TimecardConstants.WORKING_TYPE_WORK) { // check holiday if (dailyReport.getDayOfWeek() != 0 && dailyReport.getDayOfWeek() != 6 From svnnotify ¡÷ sourceforge.jp Mon Dec 1 23:25:20 2008 From: svnnotify ¡÷ sourceforge.jp (svnnotify ¡÷ sourceforge.jp) Date: Mon, 01 Dec 2008 23:25:20 +0900 Subject: [pal-cvs 3756] [1491] set a wrong value to holidays. Message-ID: <1228141520.354261.17312.nullmailer@users.sourceforge.jp> Revision: 1491 http://svn.sourceforge.jp/view?root=pal&view=rev&rev=1491 Author: shinsuke Date: 2008-12-01 23:25:20 +0900 (Mon, 01 Dec 2008) Log Message: ----------- set a wrong value to holidays. Modified Paths: -------------- timecard/trunk/src/main/java/jp/sf/pal/timecard/action/ConfigAction.java -------------- next part -------------- Modified: timecard/trunk/src/main/java/jp/sf/pal/timecard/action/ConfigAction.java =================================================================== --- timecard/trunk/src/main/java/jp/sf/pal/timecard/action/ConfigAction.java 2008-12-01 14:12:15 UTC (rev 1490) +++ timecard/trunk/src/main/java/jp/sf/pal/timecard/action/ConfigAction.java 2008-12-01 14:25:20 UTC (rev 1491) @@ -40,7 +40,7 @@ TimecardConstants.TIME_LABEL_MINUTES, "00\n15\n30\n45"); configForm.holidays = ConfigUtil.getString( TimecardConstants.TIME_HOLIDAYS, ""); - configForm.holidays = ConfigUtil.getString( + configForm.defaultManager = ConfigUtil.getString( TimecardConstants.DEFAULT_MANAGER, "admin"); return "index.jsp"; } From svnnotify ¡÷ sourceforge.jp Mon Dec 1 23:26:07 2008 From: svnnotify ¡÷ sourceforge.jp (svnnotify ¡÷ sourceforge.jp) Date: Mon, 01 Dec 2008 23:26:07 +0900 Subject: [pal-cvs 3757] [1492] skipped update sql. Message-ID: <1228141567.139975.18338.nullmailer@users.sourceforge.jp> Revision: 1492 http://svn.sourceforge.jp/view?root=pal&view=rev&rev=1492 Author: shinsuke Date: 2008-12-01 23:26:07 +0900 (Mon, 01 Dec 2008) Log Message: ----------- skipped update sql. Modified Paths: -------------- timecard/trunk/src/main/java/jp/sf/pal/timecard/service/ReportService.java -------------- next part -------------- Modified: timecard/trunk/src/main/java/jp/sf/pal/timecard/service/ReportService.java =================================================================== --- timecard/trunk/src/main/java/jp/sf/pal/timecard/service/ReportService.java 2008-12-01 14:25:20 UTC (rev 1491) +++ timecard/trunk/src/main/java/jp/sf/pal/timecard/service/ReportService.java 2008-12-01 14:26:07 UTC (rev 1492) @@ -189,17 +189,28 @@ && dailyReport.getDayOfWeek() != 6 && !TimecardUtil.checkHoliday(year, month, dailyReport .getDate())) { - dailyReport - .setDateType(TimecardConstants.DATE_TYPE_WORKING); - dailyReport - .setWorkingType(TimecardConstants.WORKING_TYPE_WORK); + if (TimecardConstants.DATE_TYPE_WORKING != dailyReport + .getDateType() + || TimecardConstants.WORKING_TYPE_WORK != dailyReport + .getWorkingType()) { + dailyReport + .setDateType(TimecardConstants.DATE_TYPE_WORKING); + dailyReport + .setWorkingType(TimecardConstants.WORKING_TYPE_WORK); + dailyReportBhv.update(dailyReport); + } } else { - dailyReport - .setDateType(TimecardConstants.DATE_TYPE_HOLIDAY); - dailyReport - .setWorkingType(TimecardConstants.WORKING_TYPE_HOLIDAY); + if (TimecardConstants.DATE_TYPE_HOLIDAY != dailyReport + .getDateType() + || TimecardConstants.WORKING_TYPE_HOLIDAY != dailyReport + .getWorkingType()) { + dailyReport + .setDateType(TimecardConstants.DATE_TYPE_HOLIDAY); + dailyReport + .setWorkingType(TimecardConstants.WORKING_TYPE_HOLIDAY); + dailyReportBhv.update(dailyReport); + } } - dailyReportBhv.update(dailyReport); } } monthlyReport.setDailyReportList(dailyReportList); From svnnotify ¡÷ sourceforge.jp Tue Dec 2 12:38:51 2008 From: svnnotify ¡÷ sourceforge.jp (svnnotify ¡÷ sourceforge.jp) Date: Tue, 02 Dec 2008 12:38:51 +0900 Subject: [pal-cvs 3758] [1493] refactoring.. Message-ID: <1228189131.196067.27988.nullmailer@users.sourceforge.jp> Revision: 1493 http://svn.sourceforge.jp/view?root=pal&view=rev&rev=1493 Author: shinsuke Date: 2008-12-02 12:38:50 +0900 (Tue, 02 Dec 2008) Log Message: ----------- refactoring.. improved reporting. Modified Paths: -------------- timecard/trunk/src/main/config/erd/timecard.erd timecard/trunk/src/main/config/sql/timecard.ddl timecard/trunk/src/main/java/jp/sf/pal/timecard/TimecardConstants.java timecard/trunk/src/main/java/jp/sf/pal/timecard/action/EmployeeAction.java timecard/trunk/src/main/java/jp/sf/pal/timecard/action/admin/TimecardAction.java timecard/trunk/src/main/java/jp/sf/pal/timecard/action/manager/TimecardAction.java timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/dbmeta/DBMetaInstanceHandler.java timecard/trunk/src/main/java/jp/sf/pal/timecard/db/bsbhv/BsEmployeeBhv.java timecard/trunk/src/main/java/jp/sf/pal/timecard/db/bsbhv/BsMonthlyReportBhv.java timecard/trunk/src/main/java/jp/sf/pal/timecard/db/bsentity/BsEmployee.java timecard/trunk/src/main/java/jp/sf/pal/timecard/db/bsentity/BsMonthlyReport.java timecard/trunk/src/main/java/jp/sf/pal/timecard/db/bsentity/dbmeta/EmployeeDbm.java timecard/trunk/src/main/java/jp/sf/pal/timecard/db/bsentity/dbmeta/MonthlyReportDbm.java timecard/trunk/src/main/java/jp/sf/pal/timecard/db/cbean/bs/BsEmployeeCB.java timecard/trunk/src/main/java/jp/sf/pal/timecard/db/cbean/bs/BsMonthlyReportCB.java timecard/trunk/src/main/java/jp/sf/pal/timecard/db/cbean/cq/bs/AbstractBsEmployeeCQ.java timecard/trunk/src/main/java/jp/sf/pal/timecard/db/cbean/cq/bs/AbstractBsMonthlyReportCQ.java timecard/trunk/src/main/java/jp/sf/pal/timecard/db/cbean/cq/bs/BsEmployeeCQ.java timecard/trunk/src/main/java/jp/sf/pal/timecard/db/cbean/cq/bs/BsMonthlyReportCQ.java timecard/trunk/src/main/java/jp/sf/pal/timecard/db/cbean/cq/ciq/EmployeeCIQ.java timecard/trunk/src/main/java/jp/sf/pal/timecard/db/cbean/cq/ciq/MonthlyReportCIQ.java timecard/trunk/src/main/java/jp/sf/pal/timecard/db/exentity/MonthlyReport.java timecard/trunk/src/main/java/jp/sf/pal/timecard/dxo/EmployeeDxo.java timecard/trunk/src/main/java/jp/sf/pal/timecard/form/admin/EmployeeForm.java timecard/trunk/src/main/java/jp/sf/pal/timecard/form/manager/EmployeeForm.java timecard/trunk/src/main/java/jp/sf/pal/timecard/service/ReportService.java timecard/trunk/src/main/resources/application.properties timecard/trunk/src/main/resources/application_ja.properties timecard/trunk/src/main/resources/dbflute.dicon timecard/trunk/src/main/webapp/WEB-INF/db/timecard.1.log.db timecard/trunk/src/main/webapp/WEB-INF/db/timecard.data.db timecard/trunk/src/main/webapp/WEB-INF/db/timecard.index.db timecard/trunk/src/main/webapp/WEB-INF/view/admin/employee/confirm.jsp timecard/trunk/src/main/webapp/WEB-INF/view/admin/employee/edit.jsp timecard/trunk/src/main/webapp/WEB-INF/view/admin/timecard/index.jsp timecard/trunk/src/main/webapp/WEB-INF/view/employee/index.jsp timecard/trunk/src/main/webapp/WEB-INF/view/manager/employee/confirm.jsp timecard/trunk/src/main/webapp/WEB-INF/view/manager/employee/edit.jsp timecard/trunk/src/main/webapp/WEB-INF/view/manager/timecard/index.jsp Added Paths: ----------- timecard/trunk/src/main/config/sql/timecard.dml timecard/trunk/src/main/java/jp/sf/pal/timecard/db/bsbhv/BsMonthlyWorkingReportBhv.java timecard/trunk/src/main/java/jp/sf/pal/timecard/db/bsbhv/BsWorkingTypeBhv.java timecard/trunk/src/main/java/jp/sf/pal/timecard/db/bsdao/BsMonthlyWorkingReportDao.java timecard/trunk/src/main/java/jp/sf/pal/timecard/db/bsdao/BsWorkingTypeDao.java timecard/trunk/src/main/java/jp/sf/pal/timecard/db/bsentity/BsMonthlyWorkingReport.java timecard/trunk/src/main/java/jp/sf/pal/timecard/db/bsentity/BsWorkingType.java timecard/trunk/src/main/java/jp/sf/pal/timecard/db/bsentity/dbmeta/MonthlyWorkingReportDbm.java timecard/trunk/src/main/java/jp/sf/pal/timecard/db/bsentity/dbmeta/WorkingTypeDbm.java timecard/trunk/src/main/java/jp/sf/pal/timecard/db/cbean/MonthlyWorkingReportCB.java timecard/trunk/src/main/java/jp/sf/pal/timecard/db/cbean/WorkingTypeCB.java timecard/trunk/src/main/java/jp/sf/pal/timecard/db/cbean/bs/BsMonthlyWorkingReportCB.java timecard/trunk/src/main/java/jp/sf/pal/timecard/db/cbean/bs/BsWorkingTypeCB.java timecard/trunk/src/main/java/jp/sf/pal/timecard/db/cbean/cq/MonthlyWorkingReportCQ.java timecard/trunk/src/main/java/jp/sf/pal/timecard/db/cbean/cq/WorkingTypeCQ.java timecard/trunk/src/main/java/jp/sf/pal/timecard/db/cbean/cq/bs/AbstractBsMonthlyWorkingReportCQ.java timecard/trunk/src/main/java/jp/sf/pal/timecard/db/cbean/cq/bs/AbstractBsWorkingTypeCQ.java timecard/trunk/src/main/java/jp/sf/pal/timecard/db/cbean/cq/bs/BsMonthlyWorkingReportCQ.java timecard/trunk/src/main/java/jp/sf/pal/timecard/db/cbean/cq/bs/BsWorkingTypeCQ.java timecard/trunk/src/main/java/jp/sf/pal/timecard/db/cbean/cq/ciq/MonthlyWorkingReportCIQ.java timecard/trunk/src/main/java/jp/sf/pal/timecard/db/cbean/cq/ciq/WorkingTypeCIQ.java timecard/trunk/src/main/java/jp/sf/pal/timecard/db/cbean/nss/MonthlyWorkingReportNss.java timecard/trunk/src/main/java/jp/sf/pal/timecard/db/cbean/nss/WorkingTypeNss.java timecard/trunk/src/main/java/jp/sf/pal/timecard/db/exbhv/MonthlyWorkingReportBhv.java timecard/trunk/src/main/java/jp/sf/pal/timecard/db/exbhv/WorkingTypeBhv.java timecard/trunk/src/main/java/jp/sf/pal/timecard/db/exdao/MonthlyWorkingReportDao.java timecard/trunk/src/main/java/jp/sf/pal/timecard/db/exdao/WorkingTypeDao.java timecard/trunk/src/main/java/jp/sf/pal/timecard/db/exentity/MonthlyWorkingReport.java timecard/trunk/src/main/java/jp/sf/pal/timecard/db/exentity/WorkingType.java -------------- next part -------------- Modified: timecard/trunk/src/main/config/erd/timecard.erd =================================================================== --- timecard/trunk/src/main/config/erd/timecard.erd 2008-12-01 14:26:07 UTC (rev 1492) +++ timecard/trunk/src/main/config/erd/timecard.erd 2008-12-02 03:38:50 UTC (rev 1493) @@ -68,8 +68,8 @@ 1 - working_days - Working Days + std_working_days + Standard Working Days DOUBLE Real @@ -84,39 +84,6 @@ 0 - std_working_days - Standard Working Days - - 10 - true - false - - false - 0 - - - holidays - Holidays - - 10 - true - false - - false - 0 - - - paid_holidays - Paid Holidays - - 10 - true - false - - false - 0 - - working_time Working Time @@ -135,7 +102,7 @@ std_working_time Standard Working Time - + 20 true false @@ -162,7 +129,7 @@ mnt_over_time Midnight Overtime Hours - + 20 true false @@ -216,7 +183,7 @@ updated_time Updated Time - + 10 true false @@ -227,7 +194,7 @@ updated_by Updated By - + 255 true false @@ -238,7 +205,7 @@ deleted_time Deleted Time - + 10 false false @@ -249,7 +216,7 @@ deleted_by Deleted By - + 255 false false @@ -271,7 +238,7 @@ - 293 + 319 484 -1 -1 @@ -297,7 +264,7 @@ true - + @@ -337,17 +304,6 @@ - paid_holidays - Paid Holidays - - 200 - true - false - - false - 0 - - is_available Is available @@ -393,7 +349,7 @@ updated_time Updated Time - + 10 true false @@ -404,7 +360,7 @@ updated_by Updated by - + 255 true false @@ -415,7 +371,7 @@ deleted_time Deleted Time - + 10 false false @@ -426,7 +382,7 @@ deleted_by Deleted by - + 255 false false @@ -448,8 +404,8 @@ - 305 - 966 + 331 + 909 -1 -1 @@ -755,8 +711,8 @@ - 289 - 1296 + 315 + 1220 -1 -1 @@ -923,8 +879,8 @@ - 40 - 1816 + 66 + 1740 -1 -1 @@ -992,8 +948,8 @@ - 44 - 966 + 70 + 909 -1 -1 @@ -1225,8 +1181,8 @@ - 568 - 1816 + 594 + 1740 -1 -1 @@ -1289,8 +1245,8 @@ - 576 - 966 + 602 + 909 -1 -1 @@ -1591,7 +1547,7 @@ working_time Working Time - + 20 false false @@ -1614,7 +1570,7 @@ created_time Created Time - + 10 true false @@ -1625,7 +1581,7 @@ created_by Created_by - + 255 true false @@ -1636,7 +1592,7 @@ updated_time Updated Time - + 10 true false @@ -1647,7 +1603,7 @@ updated_by Updated by - + 255 true false @@ -1674,7 +1630,7 @@ - 280 + 331 40 -1 -1 @@ -1704,6 +1660,308 @@ + + FK_from_monthly_working_report_to_monthly_report + + + + + monthly_report_id + Monthly Report ID + + BIGINT + Integer + true + -5 + + 20 + true + false + + false + + + + + + + + monthly_working_report + Monthly Working Report + + + + id + ID + + 20 + true + true + + true + + + + value + Value + + DOUBLE + Real + false + 8 + + 10 + true + false + + false + + + + + working_type_id + Working Type ID + + INTEGER + Integer + false + 4 + + 10 + true + false + + false + + + + + + 40 + 40 + -1 + -1 + + + + FK_from_monthly_working_report_to_working_type + + + + id + ID + + 20 + true + true + + true + + + + + + + + + + working_type + Working Type + + + + + name + Name + + VARCHAR + String + true + 12 + + 100 + true + false + + false + + + + value + Value + + 10 + true + false + + false + + + + type + Type + + VARCHAR + String + true + 12 + + 10 + true + false + + false + + + + parent_id + Parent ID + + 10 + false + false + + false + 1 + + + created_time + Created Time + + 10 + true + false + + false + + + + created_by + Created By + + 255 + true + false + + false + + + + updated_time + Updated Time + + 10 + true + false + + false + + + + updated_by + Updated By + + 255 + true + false + + false + + + + deleted_time + Deleted Time + + 10 + false + false + + false + + + + deleted_by + Deleted By + + 255 + false + false + + false + + + + versionNo + Version No. + + INTEGER + Integer + false + 4 + + 10 + true + false + + false + 0 + + + + + 51 + 484 + -1 + -1 + + + + + + + + + 2 + + + + + + + + + + 2 + + + + + + + + + + + + + 2 + + + + + + + + + + + 2 + + + + + + @@ -1722,6 +1980,8 @@ + + hsqldb Modified: timecard/trunk/src/main/config/sql/timecard.ddl =================================================================== --- timecard/trunk/src/main/config/sql/timecard.ddl 2008-12-01 14:26:07 UTC (rev 1492) +++ timecard/trunk/src/main/config/sql/timecard.ddl 2008-12-02 03:38:50 UTC (rev 1493) @@ -1,3 +1,5 @@ +DROP TABLE monthly_working_report; +DROP TABLE working_type; DROP TABLE role_mapping; DROP TABLE group_mapping; DROP TABLE daily_report; @@ -82,7 +84,6 @@ id INTEGER NOT NULL IDENTITY PRIMARY KEY, username VARCHAR(255) NOT NULL, manager VARCHAR(255) NOT NULL, - paid_holidays DOUBLE DEFAULT 0 NOT NULL, is_available VARCHAR(1) DEFAULT 'T' NOT NULL, created_time TIMESTAMP NOT NULL, created_by VARCHAR(255) NOT NULL, @@ -103,10 +104,7 @@ year INTEGER NOT NULL, month INTEGER NOT NULL, status INTEGER DEFAULT 1 NOT NULL, - working_days DOUBLE DEFAULT 0 NOT NULL, std_working_days DOUBLE DEFAULT 0 NOT NULL, - holidays DOUBLE DEFAULT 0 NOT NULL, - paid_holidays DOUBLE DEFAULT 0 NOT NULL, working_time BIGINT(20) DEFAULT 0 NOT NULL, std_working_time BIGINT(20) DEFAULT 0 NOT NULL, over_time BIGINT(20) DEFAULT 0 NOT NULL, @@ -169,3 +167,33 @@ FOREIGN KEY (role_id) REFERENCES role_info (role_id) ); +/********************************** +Table Name: Working Type +**********************************/ +CREATE TABLE working_type( + id INTEGER NOT NULL IDENTITY PRIMARY KEY, + name VARCHAR(100) NOT NULL, + value INTEGER NOT NULL, + type VARCHAR(10) NOT NULL, + parent_id INTEGER DEFAULT 1, + 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 DEFAULT 0 NOT NULL +); + +/********************************** +Table Name: Monthly Working Report +**********************************/ +CREATE TABLE monthly_working_report( + id BIGINT(20) NOT NULL IDENTITY PRIMARY KEY, + value DOUBLE NOT NULL, + monthly_report_id BIGINT(20) NOT NULL, + working_type_id INTEGER NOT NULL, + FOREIGN KEY (working_type_id) REFERENCES working_type (id), + FOREIGN KEY (monthly_report_id) REFERENCES monthly_report (id) +); + Added: timecard/trunk/src/main/config/sql/timecard.dml =================================================================== --- timecard/trunk/src/main/config/sql/timecard.dml (rev 0) +++ timecard/trunk/src/main/config/sql/timecard.dml 2008-12-02 03:38:50 UTC (rev 1493) @@ -0,0 +1,21 @@ +insert into WORKING_TYPE (ID, NAME, VALUE, TYPE, PARENT_ID, CREATED_TIME, CREATED_BY, UPDATED_TIME, UPDATED_BY, VERSIONNO) values (1, 'Work', 1, 'WORK', NULL, '2008-10-06 16:17:41', 'admin', '2008-10-06 16:17:41', 'admin', 0); +insert into WORKING_TYPE (ID, NAME, VALUE, TYPE, PARENT_ID, CREATED_TIME, CREATED_BY, UPDATED_TIME, UPDATED_BY, VERSIONNO) values (2, 'WorkOnHoliday', 2, 'WORK', NULL, '2008-10-06 16:17:41', 'admin', '2008-10-06 16:17:41', 'admin', 0); +insert into WORKING_TYPE (ID, NAME, VALUE, TYPE, PARENT_ID, CREATED_TIME, CREATED_BY, UPDATED_TIME, UPDATED_BY, VERSIONNO) values (3, 'WorkOnHolidayAm', 3, 'WORK_AM', 2, '2008-10-06 16:17:41', 'admin', '2008-10-06 16:17:41', 'admin', 0); +insert into WORKING_TYPE (ID, NAME, VALUE, TYPE, PARENT_ID, CREATED_TIME, CREATED_BY, UPDATED_TIME, UPDATED_BY, VERSIONNO) values (4, 'WorkOnHolidayPm', 4, 'WORK_PM', 2, '2008-10-06 16:17:41', 'admin', '2008-10-06 16:17:41', 'admin', 0); +insert into WORKING_TYPE (ID, NAME, VALUE, TYPE, PARENT_ID, CREATED_TIME, CREATED_BY, UPDATED_TIME, UPDATED_BY, VERSIONNO) values (5, 'Holiday', 200, 'OFF', NULL, '2008-10-06 16:17:41', 'admin', '2008-10-06 16:17:41', 'admin', 0); +insert into WORKING_TYPE (ID, NAME, VALUE, TYPE, PARENT_ID, CREATED_TIME, CREATED_BY, UPDATED_TIME, UPDATED_BY, VERSIONNO) values (6, 'DayOffWithPay', 20, 'PAIDOFF',NULL, '2008-10-06 16:17:41', 'admin', '2008-10-06 16:17:41', 'admin', 0); +insert into WORKING_TYPE (ID, NAME, VALUE, TYPE, PARENT_ID, CREATED_TIME, CREATED_BY, UPDATED_TIME, UPDATED_BY, VERSIONNO) values (7, 'AmOffWithPay', 21, 'PAIDOFF_AM', 6, '2008-10-06 16:17:41', 'admin', '2008-10-06 16:17:41', 'admin', 0); +insert into WORKING_TYPE (ID, NAME, VALUE, TYPE, PARENT_ID, CREATED_TIME, CREATED_BY, UPDATED_TIME, UPDATED_BY, VERSIONNO) values (8, 'PmOffWithPay', 22, 'PAIDOFF_PM', 6, '2008-10-06 16:17:41', 'admin', '2008-10-06 16:17:41', 'admin', 0); +insert into WORKING_TYPE (ID, NAME, VALUE, TYPE, PARENT_ID, CREATED_TIME, CREATED_BY, UPDATED_TIME, UPDATED_BY, VERSIONNO) values (9, 'BereavementLeave', 30, 'PAIDOFF', NULL, '2008-10-06 16:17:41', 'admin', '2008-10-06 16:17:41', 'admin', 0); +insert into WORKING_TYPE (ID, NAME, VALUE, TYPE, PARENT_ID, CREATED_TIME, CREATED_BY, UPDATED_TIME, UPDATED_BY, VERSIONNO) values (10, 'BereavementLeaveAm', 31, 'PAIDOFF_AM', 9, '2008-10-06 16:17:41', 'admin', '2008-10-06 16:17:41', 'admin', 0); +insert into WORKING_TYPE (ID, NAME, VALUE, TYPE, PARENT_ID, CREATED_TIME, CREATED_BY, UPDATED_TIME, UPDATED_BY, VERSIONNO) values (11, 'BereavementLeavePm', 32, 'PAIDOFF_PM', 9, '2008-10-06 16:17:41', 'admin', '2008-10-06 16:17:41', 'admin', 0); +insert into WORKING_TYPE (ID, NAME, VALUE, TYPE, PARENT_ID, CREATED_TIME, CREATED_BY, UPDATED_TIME, UPDATED_BY, VERSIONNO) values (12, 'SickLeave', 40, 'PAIDOFF', NULL, '2008-10-06 16:17:41', 'admin', '2008-10-06 16:17:41', 'admin', 0); +insert into WORKING_TYPE (ID, NAME, VALUE, TYPE, PARENT_ID, CREATED_TIME, CREATED_BY, UPDATED_TIME, UPDATED_BY, VERSIONNO) values (13, 'SickLeaveAm', 41, 'PAIDOFF_AM', 12, '2008-10-06 16:17:41', 'admin', '2008-10-06 16:17:41', 'admin', 0); +insert into WORKING_TYPE (ID, NAME, VALUE, TYPE, PARENT_ID, CREATED_TIME, CREATED_BY, UPDATED_TIME, UPDATED_BY, VERSIONNO) values (14, 'SickLeavePm', 42, 'PAIDOFF_PM', 12, '2008-10-06 16:17:41', 'admin', '2008-10-06 16:17:41', 'admin', 0); +insert into WORKING_TYPE (ID, NAME, VALUE, TYPE, PARENT_ID, CREATED_TIME, CREATED_BY, UPDATED_TIME, UPDATED_BY, VERSIONNO) values (15, 'DayOff', 100, 'OFF', NULL, '2008-10-06 16:17:41', 'admin', '2008-10-06 16:17:41', 'admin', 0); +insert into WORKING_TYPE (ID, NAME, VALUE, TYPE, PARENT_ID, CREATED_TIME, CREATED_BY, UPDATED_TIME, UPDATED_BY, VERSIONNO) values (16, 'AmOff', 101, 'OFF_AM', 15, '2008-10-06 16:17:41', 'admin', '2008-10-06 16:17:41', 'admin', 0); +insert into WORKING_TYPE (ID, NAME, VALUE, TYPE, PARENT_ID, CREATED_TIME, CREATED_BY, UPDATED_TIME, UPDATED_BY, VERSIONNO) values (17, 'PmOff', 102, 'OFF_PM', 15, '2008-10-06 16:17:41', 'admin', '2008-10-06 16:17:41', 'admin', 0); +insert into WORKING_TYPE (ID, NAME, VALUE, TYPE, PARENT_ID, CREATED_TIME, CREATED_BY, UPDATED_TIME, UPDATED_BY, VERSIONNO) values (18, 'SubstituteHoliday', 110, 'OFF', NULL, '2008-10-06 16:17:41', 'admin', '2008-10-06 16:17:41', 'admin', 0); +insert into WORKING_TYPE (ID, NAME, VALUE, TYPE, PARENT_ID, CREATED_TIME, CREATED_BY, UPDATED_TIME, UPDATED_BY, VERSIONNO) values (19, 'SubstituteHolidayAm', 111, 'OFF_AM', 18, '2008-10-06 16:17:41', 'admin', '2008-10-06 16:17:41', 'admin', 0); +insert into WORKING_TYPE (ID, NAME, VALUE, TYPE, PARENT_ID, CREATED_TIME, CREATED_BY, UPDATED_TIME, UPDATED_BY, VERSIONNO) values (20, 'SubstituteHolidayPm', 112, 'OFF_PM', 18, '2008-10-06 16:17:41', 'admin', '2008-10-06 16:17:41', 'admin', 0); + Modified: timecard/trunk/src/main/java/jp/sf/pal/timecard/TimecardConstants.java =================================================================== --- timecard/trunk/src/main/java/jp/sf/pal/timecard/TimecardConstants.java 2008-12-01 14:26:07 UTC (rev 1492) +++ timecard/trunk/src/main/java/jp/sf/pal/timecard/TimecardConstants.java 2008-12-02 03:38:50 UTC (rev 1493) @@ -30,44 +30,62 @@ public static final int WORKING_TYPE_WORK = 1; - public static final int WORKING_TYPE_WORK_ON_HOLIDAY = 2; - - public static final int WORKING_TYPE_AM_WORK_ON_HOLIDAY = 3; - - public static final int WORKING_TYPE_PM_WORK_ON_HOLIDAY = 4; - + // public static final int WORKING_TYPE_WORK_ON_HOLIDAY = 2; + // + // public static final int WORKING_TYPE_AM_WORK_ON_HOLIDAY = 3; + // + // public static final int WORKING_TYPE_PM_WORK_ON_HOLIDAY = 4; + // public static final int WORKING_TYPE_HOLIDAY = 200; - public static final int WORKING_TYPE_DAY_OFF_WITH_PAY = 20; + // public static final int WORKING_TYPE_DAY_OFF_WITH_PAY = 20; + // + // public static final int WORKING_TYPE_AM_OFF_WITH_PAY = 21; + // + // public static final int WORKING_TYPE_PM_OFF_WITH_PAY = 22; + // + // public static final int WORKING_TYPE_BEREAVEMENT_LEAVE = 30; + // + // public static final int WORKING_TYPE_BEREAVEMENT_LEAVE_AM = 31; + // + // public static final int WORKING_TYPE_BEREAVEMENT_LEAVE_PM = 32; + // + // public static final int WORKING_TYPE_SICK_LEAVE = 40; + // + // public static final int WORKING_TYPE_SICK_LEAVE_AM = 41; + // + // public static final int WORKING_TYPE_SICK_LEAVE_PM = 42; + // + // public static final int WORKING_TYPE_DAY_OFF = 100; + // + // public static final int WORKING_TYPE_AM_OFF = 101; + // + // public static final int WORKING_TYPE_PM_OFF = 102; + // + // public static final int WORKING_TYPE_SUBSTITUTE_HOLIDAY = 110; + // + // public static final int WORKING_TYPE_SUBSTITUTE_HOLIDAY_AM = 111; + // + // public static final int WORKING_TYPE_SUBSTITUTE_HOLIDAY_PM = 112; - public static final int WORKING_TYPE_AM_OFF_WITH_PAY = 21; + public static final String WT_WORK = "WORK"; - public static final int WORKING_TYPE_PM_OFF_WITH_PAY = 22; + public static final String WT_WORK_AM = "WORK_AM"; - public static final int WORKING_TYPE_BEREAVEMENT_LEAVE = 30; + public static final String WT_WORK_PM = "WORK_PM"; - public static final int WORKING_TYPE_BEREAVEMENT_LEAVE_AM = 31; + public static final String WT_OFF = "OFF"; - public static final int WORKING_TYPE_BEREAVEMENT_LEAVE_PM = 32; + public static final String WT_OFF_AM = "OFF_AM"; - public static final int WORKING_TYPE_SICK_LEAVE = 40; + public static final String WT_OFF_PM = "OFF_PM"; - public static final int WORKING_TYPE_SICK_LEAVE_AM = 41; + public static final String WT_PAIDOFF = "PAIDOFF"; - public static final int WORKING_TYPE_SICK_LEAVE_PM = 42; + public static final String WT_PAIDOFF_AM = "PAIDOFF_AM"; - public static final int WORKING_TYPE_DAY_OFF = 100; + public static final String WT_PAIDOFF_PM = "PAIDOFF_PM"; - public static final int WORKING_TYPE_AM_OFF = 101; - - public static final int WORKING_TYPE_PM_OFF = 102; - - public static final int WORKING_TYPE_SUBSTITUTE_HOLIDAY = 110; - - public static final int WORKING_TYPE_SUBSTITUTE_HOLIDAY_AM = 111; - - public static final int WORKING_TYPE_SUBSTITUTE_HOLIDAY_PM = 112; - public static final String TIME_AM_START = "time.am.start"; public static final String TIME_AM_END = "time.am.end"; Modified: timecard/trunk/src/main/java/jp/sf/pal/timecard/action/EmployeeAction.java =================================================================== --- timecard/trunk/src/main/java/jp/sf/pal/timecard/action/EmployeeAction.java 2008-12-01 14:26:07 UTC (rev 1492) +++ timecard/trunk/src/main/java/jp/sf/pal/timecard/action/EmployeeAction.java 2008-12-02 03:38:50 UTC (rev 1493) @@ -6,7 +6,6 @@ import java.util.List; import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpSession; import jp.sf.pal.timecard.TimecardConstants; import jp.sf.pal.timecard.common.util.ConfigUtil; @@ -32,12 +31,6 @@ private static final Log log = LogFactory.getLog(EmployeeAction.class); - private static final String TIME_HOUR_ITEMS = "TimeHourItems"; - - private static final String MINUTE_ITEMS = "MinuteItems"; - - private static final String HOUR_ITEMS = "HourItems"; - // for list public MonthlyReport monthlyReport; @@ -195,18 +188,27 @@ employeeForm.endTimeMin = ""; } - if (StringUtils.isEmpty(employeeForm.breakTimeHr) - || StringUtils.isEmpty(employeeForm.breakTimeMin)) { + if (StringUtils.isEmpty(employeeForm.startTimeHr) + && StringUtils.isEmpty(employeeForm.startTimeMin) + && StringUtils.isEmpty(employeeForm.endTimeHr) + && StringUtils.isEmpty(employeeForm.endTimeMin)) { employeeForm.breakTimeHr = ""; employeeForm.breakTimeMin = ""; - } - - if (StringUtils.isEmpty(employeeForm.otjTimeHr) - || StringUtils.isEmpty(employeeForm.otjTimeMin)) { employeeForm.otjTimeHr = ""; employeeForm.otjTimeMin = ""; + } else { + if (StringUtils.isEmpty(employeeForm.breakTimeHr) + || StringUtils.isEmpty(employeeForm.breakTimeMin)) { + employeeForm.breakTimeHr = ""; + employeeForm.breakTimeMin = ""; + } + + if (StringUtils.isEmpty(employeeForm.otjTimeHr) + || StringUtils.isEmpty(employeeForm.otjTimeMin)) { + employeeForm.otjTimeHr = ""; + employeeForm.otjTimeMin = ""; + } } - return "confirm.jsp"; } @@ -227,16 +229,26 @@ employeeForm.endTimeMin = ""; } - if (StringUtils.isEmpty(employeeForm.breakTimeHr) - || StringUtils.isEmpty(employeeForm.breakTimeMin)) { + if (StringUtils.isEmpty(employeeForm.startTimeHr) + && StringUtils.isEmpty(employeeForm.startTimeMin) + && StringUtils.isEmpty(employeeForm.endTimeHr) + && StringUtils.isEmpty(employeeForm.endTimeMin)) { employeeForm.breakTimeHr = ""; employeeForm.breakTimeMin = ""; - } - - if (StringUtils.isEmpty(employeeForm.otjTimeHr) - || StringUtils.isEmpty(employeeForm.otjTimeMin)) { employeeForm.otjTimeHr = ""; employeeForm.otjTimeMin = ""; + } else { + if (StringUtils.isEmpty(employeeForm.breakTimeHr) + || StringUtils.isEmpty(employeeForm.breakTimeMin)) { + employeeForm.breakTimeHr = ""; + employeeForm.breakTimeMin = ""; + } + + if (StringUtils.isEmpty(employeeForm.otjTimeHr) + || StringUtils.isEmpty(employeeForm.otjTimeMin)) { + employeeForm.otjTimeHr = ""; + employeeForm.otjTimeMin = ""; + } } return "confirm.jsp"; @@ -370,57 +382,11 @@ } private void loadListPageParameters() { - HttpSession session = request.getSession(); - session.removeAttribute(TIME_HOUR_ITEMS); - session.removeAttribute(HOUR_ITEMS); - session.removeAttribute(MINUTE_ITEMS); } private void loadDetailsPageParameters() { - HttpSession session = request.getSession(); - List timeHourItems = new ArrayList(); - for (int i = 0; i < 24; i++) { - if (i < 10) { - timeHourItems.add("0" + i); - } else { - timeHourItems.add(String.valueOf(i)); - } - } - session.setAttribute(TIME_HOUR_ITEMS, timeHourItems); - - List hourItems = new ArrayList(); - for (int i = 0; i < 24; i++) { - if (i < 10) { - hourItems.add("0" + i); - } else { - hourItems.add(String.valueOf(i)); - } - } - session.setAttribute(HOUR_ITEMS, hourItems); - - List minuteItems = new ArrayList(); - String value = ConfigUtil.getString( - TimecardConstants.TIME_LABEL_MINUTES, ""); - if (!StringUtils.isEmpty(value)) { - String[] values = value.split("\r\n"); - for (int i = 0; i < values.length; i++) { - if (!StringUtils.isEmpty(values[i])) { - minuteItems.add(values[i]); - } - } - } else { - for (int i = 0; i < 60; i++) { - if (i < 10) { - minuteItems.add("0" + i); - } else { - minuteItems.add(String.valueOf(i)); - } - } - } - session.setAttribute(MINUTE_ITEMS, minuteItems); - } /** @@ -462,16 +428,50 @@ } public List getTimeHourItems() { - return (List) request.getSession() - .getAttribute(TIME_HOUR_ITEMS); + List timeHourItems = new ArrayList(); + for (int i = 0; i < 24; i++) { + if (i < 10) { + timeHourItems.add("0" + i); + } else { + timeHourItems.add(String.valueOf(i)); + } + } + return timeHourItems; } public List getHourItems() { - return (List) request.getSession().getAttribute(HOUR_ITEMS); + List hourItems = new ArrayList(); + for (int i = 0; i < 24; i++) { + if (i < 10) { + hourItems.add("0" + i); + } else { + hourItems.add(String.valueOf(i)); + } + } + return hourItems; } public List getMinuteItems() { - return (List) request.getSession().getAttribute(MINUTE_ITEMS); + List minuteItems = new ArrayList(); + String value = ConfigUtil.getString( + TimecardConstants.TIME_LABEL_MINUTES, ""); + if (!StringUtils.isEmpty(value)) { + String[] values = value.split("\r\n"); + for (int i = 0; i < values.length; i++) { + if (!StringUtils.isEmpty(values[i])) { + minuteItems.add(values[i]); + } + } + } else { + for (int i = 0; i < 60; i++) { + if (i < 10) { + minuteItems.add("0" + i); + } else { + minuteItems.add(String.valueOf(i)); + } + } + } + return minuteItems; } } Modified: timecard/trunk/src/main/java/jp/sf/pal/timecard/action/admin/TimecardAction.java =================================================================== --- timecard/trunk/src/main/java/jp/sf/pal/timecard/action/admin/TimecardAction.java 2008-12-01 14:26:07 UTC (rev 1492) +++ timecard/trunk/src/main/java/jp/sf/pal/timecard/action/admin/TimecardAction.java 2008-12-02 03:38:50 UTC (rev 1493) @@ -6,7 +6,6 @@ import java.util.List; import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpSession; import jp.sf.pal.timecard.TimecardConstants; import jp.sf.pal.timecard.common.util.DateUtil; @@ -30,12 +29,6 @@ private static final Log log = LogFactory.getLog(TimecardAction.class); - private static final String TIME_HOUR_ITEMS = "TimeHourItems"; - - private static final String MINUTE_ITEMS = "MinuteItems"; - - private static final String HOUR_ITEMS = "HourItems"; - // for list public MonthlyReport monthlyReport; @@ -187,16 +180,26 @@ timecardForm.endTimeMin = ""; } - if (StringUtils.isEmpty(timecardForm.breakTimeHr) - || StringUtils.isEmpty(timecardForm.breakTimeMin)) { + if (StringUtils.isEmpty(timecardForm.startTimeHr) + && StringUtils.isEmpty(timecardForm.startTimeMin) + && StringUtils.isEmpty(timecardForm.endTimeHr) + && StringUtils.isEmpty(timecardForm.endTimeMin)) { timecardForm.breakTimeHr = ""; timecardForm.breakTimeMin = ""; - } - - if (StringUtils.isEmpty(timecardForm.otjTimeHr) - || StringUtils.isEmpty(timecardForm.otjTimeMin)) { timecardForm.otjTimeHr = ""; timecardForm.otjTimeMin = ""; + } else { + if (StringUtils.isEmpty(timecardForm.breakTimeHr) + || StringUtils.isEmpty(timecardForm.breakTimeMin)) { + timecardForm.breakTimeHr = ""; + timecardForm.breakTimeMin = ""; + } + + if (StringUtils.isEmpty(timecardForm.otjTimeHr) + || StringUtils.isEmpty(timecardForm.otjTimeMin)) { + timecardForm.otjTimeHr = ""; + timecardForm.otjTimeMin = ""; + } } return "confirm.jsp"; @@ -328,46 +331,11 @@ } private void loadListPageParameters() { - HttpSession session = request.getSession(); - session.removeAttribute(TIME_HOUR_ITEMS); - session.removeAttribute(HOUR_ITEMS); - session.removeAttribute(MINUTE_ITEMS); } private void loadDetailsPageParameters() { - HttpSession session = request.getSession(); - List timeHourItems = new ArrayList(); - for (int i = 0; i < 24; i++) { - if (i < 10) { - timeHourItems.add("0" + i); - } else { - timeHourItems.add(String.valueOf(i)); - } - } - session.setAttribute(TIME_HOUR_ITEMS, timeHourItems); - - List hourItems = new ArrayList(); - for (int i = 0; i < 24; i++) { - if (i < 10) { - hourItems.add("0" + i); - } else { - hourItems.add(String.valueOf(i)); - } - } - session.setAttribute(HOUR_ITEMS, hourItems); - - List minuteItems = new ArrayList(); - for (int i = 0; i < 60; i++) { - if (i < 10) { - minuteItems.add("0" + i); - } else { - minuteItems.add(String.valueOf(i)); - } - } - session.setAttribute(MINUTE_ITEMS, minuteItems); - } /** @@ -401,16 +369,39 @@ } public List getTimeHourItems() { - return (List) request.getSession() - .getAttribute(TIME_HOUR_ITEMS); + List timeHourItems = new ArrayList(); + for (int i = 0; i < 24; i++) { + if (i < 10) { + timeHourItems.add("0" + i); + } else { + timeHourItems.add(String.valueOf(i)); + } + } + return timeHourItems; } public List getHourItems() { - return (List) request.getSession().getAttribute(HOUR_ITEMS); + List hourItems = new ArrayList(); + for (int i = 0; i < 24; i++) { + if (i < 10) { + hourItems.add("0" + i); + } else { + hourItems.add(String.valueOf(i)); + } + } + return hourItems; } public List getMinuteItems() { - return (List) request.getSession().getAttribute(MINUTE_ITEMS); + List minuteItems = new ArrayList(); + for (int i = 0; i < 60; i++) { + if (i < 10) { + minuteItems.add("0" + i); + } else { + minuteItems.add(String.valueOf(i)); + } + } + return minuteItems; } public TimecardForm getTimecardForm() { Modified: timecard/trunk/src/main/java/jp/sf/pal/timecard/action/manager/TimecardAction.java =================================================================== --- timecard/trunk/src/main/java/jp/sf/pal/timecard/action/manager/TimecardAction.java 2008-12-01 14:26:07 UTC (rev 1492) +++ timecard/trunk/src/main/java/jp/sf/pal/timecard/action/manager/TimecardAction.java 2008-12-02 03:38:50 UTC (rev 1493) @@ -6,7 +6,6 @@ import java.util.List; import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpSession; import jp.sf.pal.timecard.TimecardConstants; import jp.sf.pal.timecard.common.util.DateUtil; @@ -29,12 +28,6 @@ private static final Log log = LogFactory.getLog(TimecardAction.class); - private static final String TIME_HOUR_ITEMS = "TimeHourItems"; - - private static final String MINUTE_ITEMS = "MinuteItems"; - - private static final String HOUR_ITEMS = "HourItems"; - // for list public MonthlyReport monthlyReport; @@ -327,46 +320,11 @@ } private void loadListPageParameters() { - HttpSession session = request.getSession(); - session.removeAttribute(TIME_HOUR_ITEMS); - session.removeAttribute(HOUR_ITEMS); - session.removeAttribute(MINUTE_ITEMS); } private void loadDetailsPageParameters() { - HttpSession session = request.getSession(); - List timeHourItems = new ArrayList(); - for (int i = 0; i < 24; i++) { - if (i < 10) { - timeHourItems.add("0" + i); - } else { - timeHourItems.add(String.valueOf(i)); - } - } - session.setAttribute(TIME_HOUR_ITEMS, timeHourItems); - - List hourItems = new ArrayList(); - for (int i = 0; i < 24; i++) { - if (i < 10) { - hourItems.add("0" + i); - } else { - hourItems.add(String.valueOf(i)); - } - } - session.setAttribute(HOUR_ITEMS, hourItems); - - List minuteItems = new ArrayList(); - for (int i = 0; i < 60; i++) { - if (i < 10) { - minuteItems.add("0" + i); - } else { - minuteItems.add(String.valueOf(i)); - } - } - session.setAttribute(MINUTE_ITEMS, minuteItems); - } /** @@ -400,16 +358,39 @@ } public List getTimeHourItems() { - return (List) request.getSession() - .getAttribute(TIME_HOUR_ITEMS); + List timeHourItems = new ArrayList(); + for (int i = 0; i < 24; i++) { + if (i < 10) { + timeHourItems.add("0" + i); + } else { + timeHourItems.add(String.valueOf(i)); + } + } + return timeHourItems; } public List getHourItems() { - return (List) request.getSession().getAttribute(HOUR_ITEMS); + List hourItems = new ArrayList(); + for (int i = 0; i < 24; i++) { + if (i < 10) { + hourItems.add("0" + i); + } else { + hourItems.add(String.valueOf(i)); + } + } + return hourItems; } public List getMinuteItems() { - return (List) request.getSession().getAttribute(MINUTE_ITEMS); + List minuteItems = new ArrayList(); + for (int i = 0; i < 60; i++) { + if (i < 10) { + minuteItems.add("0" + i); + } else { + minuteItems.add(String.valueOf(i)); + } + } + return minuteItems; } public TimecardForm getTimecardForm() { Modified: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/dbmeta/DBMetaInstanceHandler.java =================================================================== --- timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/dbmeta/DBMetaInstanceHandler.java 2008-12-01 14:26:07 UTC (rev 1492) +++ timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/dbmeta/DBMetaInstanceHandler.java 2008-12-02 03:38:50 UTC (rev 1493) @@ -37,12 +37,17 @@ "jp.sf.pal.timecard.db.bsentity.dbmeta.GroupMappingDbm"); tmpMap.put("MONTHLY_REPORT", "jp.sf.pal.timecard.db.bsentity.dbmeta.MonthlyReportDbm"); + tmpMap + .put("MONTHLY_WORKING_REPORT", + "jp.sf.pal.timecard.db.bsentity.dbmeta.MonthlyWorkingReportDbm"); tmpMap.put("ROLE_INFO", "jp.sf.pal.timecard.db.bsentity.dbmeta.RoleInfoDbm"); tmpMap.put("ROLE_MAPPING", "jp.sf.pal.timecard.db.bsentity.dbmeta.RoleMappingDbm"); tmpMap.put("USER_INFO", "jp.sf.pal.timecard.db.bsentity.dbmeta.UserInfoDbm"); + tmpMap.put("WORKING_TYPE", + "jp.sf.pal.timecard.db.bsentity.dbmeta.WorkingTypeDbm"); _tableDbNameClassNameMap = Collections.unmodifiableMap(tmpMap); } @@ -57,9 +62,12 @@ tmpMap.put("GROUP_INFO".toLowerCase(), "groupInfo"); tmpMap.put("GROUP_MAPPING".toLowerCase(), "groupMapping"); tmpMap.put("MONTHLY_REPORT".toLowerCase(), "monthlyReport"); + tmpMap.put("MONTHLY_WORKING_REPORT".toLowerCase(), + "monthlyWorkingReport"); tmpMap.put("ROLE_INFO".toLowerCase(), "roleInfo"); tmpMap.put("ROLE_MAPPING".toLowerCase(), "roleMapping"); tmpMap.put("USER_INFO".toLowerCase(), "userInfo"); + tmpMap.put("WORKING_TYPE".toLowerCase(), "workingType"); _tableDbNamePropertyNameKeyToLowerMap = Collections .unmodifiableMap(tmpMap); @@ -75,9 +83,12 @@ tmpMap.put("groupInfo".toLowerCase(), "GROUP_INFO"); tmpMap.put("groupMapping".toLowerCase(), "GROUP_MAPPING"); tmpMap.put("monthlyReport".toLowerCase(), "MONTHLY_REPORT"); + tmpMap.put("monthlyWorkingReport".toLowerCase(), + "MONTHLY_WORKING_REPORT"); tmpMap.put("roleInfo".toLowerCase(), "ROLE_INFO"); tmpMap.put("roleMapping".toLowerCase(), "ROLE_MAPPING"); tmpMap.put("userInfo".toLowerCase(), "USER_INFO"); + tmpMap.put("workingType".toLowerCase(), "WORKING_TYPE"); _tablePropertyNameDbNameKeyToLowerMap = Collections .unmodifiableMap(tmpMap); Modified: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/bsbhv/BsEmployeeBhv.java =================================================================== --- timecard/trunk/src/main/java/jp/sf/pal/timecard/db/bsbhv/BsEmployeeBhv.java 2008-12-01 14:26:07 UTC (rev 1492) +++ timecard/trunk/src/main/java/jp/sf/pal/timecard/db/bsbhv/BsEmployeeBhv.java 2008-12-02 03:38:50 UTC (rev 1493) @@ -33,7 +33,7 @@ * ID * * [column] - * ID, USERNAME, MANAGER, PAID_HOLIDAYS, IS_AVAILABLE, CREATED_TIME, CREATED_BY, UPDATED_TIME, UPDATED_BY, DELETED_TIME, DELETED_BY, VERSIONNO + * ID, USERNAME, MANAGER, IS_AVAILABLE, CREATED_TIME, CREATED_BY, UPDATED_TIME, UPDATED_BY, DELETED_TIME, DELETED_BY, VERSIONNO * * [sequence] * Modified: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/bsbhv/BsMonthlyReportBhv.java =================================================================== --- timecard/trunk/src/main/java/jp/sf/pal/timecard/db/bsbhv/BsMonthlyReportBhv.java 2008-12-01 14:26:07 UTC (rev 1492) +++ timecard/trunk/src/main/java/jp/sf/pal/timecard/db/bsbhv/BsMonthlyReportBhv.java 2008-12-02 03:38:50 UTC (rev 1493) @@ -19,11 +19,14 @@ import jp.sf.pal.timecard.db.bsentity.dbmeta.MonthlyReportDbm; import jp.sf.pal.timecard.db.cbean.DailyReportCB; import jp.sf.pal.timecard.db.cbean.MonthlyReportCB; +import jp.sf.pal.timecard.db.cbean.MonthlyWorkingReportCB; import jp.sf.pal.timecard.db.exbhv.DailyReportBhv; +import jp.sf.pal.timecard.db.exbhv.MonthlyWorkingReportBhv; import jp.sf.pal.timecard.db.exdao.MonthlyReportDao; import jp.sf.pal.timecard.db.exentity.DailyReport; import jp.sf.pal.timecard.db.exentity.Employee; import jp.sf.pal.timecard.db.exentity.MonthlyReport; +import jp.sf.pal.timecard.db.exentity.MonthlyWorkingReport; /** * The behavior of MONTHLY_REPORT. @@ -33,7 +36,7 @@ * ID * * [column] - * ID, YEAR, MONTH, STATUS, WORKING_DAYS, STD_WORKING_DAYS, HOLIDAYS, PAID_HOLIDAYS, WORKING_TIME, STD_WORKING_TIME, OVER_TIME, MNT_OVER_TIME, EMPLOYEE_ID, CREATED_TIME, CREATED_BY, UPDATED_TIME, UPDATED_BY, DELETED_TIME, DELETED_BY, VERSIONNO + * ID, YEAR, MONTH, STATUS, STD_WORKING_DAYS, WORKING_TIME, STD_WORKING_TIME, OVER_TIME, MNT_OVER_TIME, EMPLOYEE_ID, CREATED_TIME, CREATED_BY, UPDATED_TIME, UPDATED_BY, DELETED_TIME, DELETED_BY, VERSIONNO * * [sequence] * @@ -48,13 +51,13 @@ * EMPLOYEE * * [referrer-table] - * DAILY_REPORT + * DAILY_REPORT, MONTHLY_WORKING_REPORT * * [foreign-property] * employee * * [referrer-property] - * dailyReportList + * dailyReportList, monthlyWorkingReportList * * * @author DBFlute(AutoGenerator) @@ -379,6 +382,105 @@ }); } + /** + * Load referrer of monthlyWorkingReportList with the setupper for + * condition-bean of referrer.
    About internal policy, the value of + * primary key(and others too) is treated as case-insensitive.
    The + * condition-bean that the setupper provides have settings before you touch + * it. It is as follows: + * + *
    +     * cb.query().setMonthlyReportId_InScope(pkList);
    +     * cb.query().addOrderBy_MonthlyReportId_Asc();
    +     * 
    + * + * @param monthlyReportList The entity list of monthlyReport. (NotNull) + * @param conditionBeanSetupper The instance of referrer condition-bean + * setupper for registering referrer condition. (NotNull) + */ + public void loadMonthlyWorkingReportList( + List monthlyReportList, + ConditionBeanSetupper conditionBeanSetupper) { + assertObjectNotNull("monthlyReportList", + monthlyReportList); + assertObjectNotNull("conditionBeanSetupper", + conditionBeanSetupper); + if (monthlyReportList.isEmpty()) { + return; + } + loadMonthlyWorkingReportList( + monthlyReportList, + new LoadReferrerOption( + conditionBeanSetupper)); + } + + /** + * {Refer to overload method that has an argument of condition-bean + * setupper.} + * + * @param monthlyReportList The entity list of monthlyReport. (NotNull) + * @param loadReferrerOption The option of load-referrer. (NotNull) + */ + public void loadMonthlyWorkingReportList( + List monthlyReportList, + LoadReferrerOption loadReferrerOption) { + assertObjectNotNull("monthlyReportList", + monthlyReportList); + assertObjectNotNull( + "loadReferrerOption", + loadReferrerOption); + if (monthlyReportList.isEmpty()) { + return; + } + final MonthlyWorkingReportBhv referrerBhv = xgetBSFLR().select( + MonthlyWorkingReportBhv.class); + helpLoadReferrerInternally( + monthlyReportList, + loadReferrerOption, + new InternalLoadReferrerCallback() { + public Long callbackBase_getPrimaryKeyValue( + MonthlyReport entity) { + return entity.getId(); + } + + public void callbackBase_setReferrerList( + MonthlyReport entity, + List referrerList) { + entity.setMonthlyWorkingReportList(referrerList); + } + + public MonthlyWorkingReportCB callbackReferrer_newMyConditionBean() { + return referrerBhv.newMyConditionBean(); + } + + public void callbackReferrer_queryForeignKeyInScope( + MonthlyWorkingReportCB cb, List pkList) { + cb.query().setMonthlyReportId_InScope(pkList); + } + + public void callbackReferrer_queryAddOrderByForeignKeyAsc( + MonthlyWorkingReportCB cb) { + cb.query().addOrderBy_MonthlyReportId_Asc(); + } + + public List callbackReferrer_selectList( + MonthlyWorkingReportCB cb) { + return referrerBhv.selectList(cb); + } + + public Long callbackReferrer_getForeignKeyValue( + MonthlyWorkingReport entity) { + return entity.getMonthlyReportId(); + } + + public void callbackReferrer_setForeignEntity( + MonthlyWorkingReport referrerEntity, + MonthlyReport baseEntity) { + referrerEntity.setMonthlyReport(baseEntity); + } + }); + } + //========================================================================== // ========= // Pullout Foreign Added: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/bsbhv/BsMonthlyWorkingReportBhv.java =================================================================== --- timecard/trunk/src/main/java/jp/sf/pal/timecard/db/bsbhv/BsMonthlyWorkingReportBhv.java (rev 0) +++ timecard/trunk/src/main/java/jp/sf/pal/timecard/db/bsbhv/BsMonthlyWorkingReportBhv.java 2008-12-02 03:38:50 UTC (rev 1493) @@ -0,0 +1,620 @@ +package jp.sf.pal.timecard.db.bsbhv; + +import java.util.List; + +import jp.sf.pal.timecard.db.allcommon.DaoReadable; +import jp.sf.pal.timecard.db.allcommon.DaoWritable; +import jp.sf.pal.timecard.db.allcommon.Entity; +import jp.sf.pal.timecard.db.allcommon.bhv.setup.ValueLabelSetupper; +import jp.sf.pal.timecard.db.allcommon.cbean.ConditionBean; +import jp.sf.pal.timecard.db.allcommon.cbean.ListResultBean; +import jp.sf.pal.timecard.db.allcommon.cbean.PagingBean; +import jp.sf.pal.timecard.db.allcommon.cbean.PagingHandler; +import jp.sf.pal.timecard.db.allcommon.cbean.PagingInvoker; +import jp.sf.pal.timecard.db.allcommon.cbean.PagingResultBean; +import jp.sf.pal.timecard.db.allcommon.cbean.ResultBeanBuilder; +import jp.sf.pal.timecard.db.allcommon.dbmeta.DBMeta; +import jp.sf.pal.timecard.db.bsentity.dbmeta.MonthlyWorkingReportDbm; +import jp.sf.pal.timecard.db.cbean.MonthlyWorkingReportCB; +import jp.sf.pal.timecard.db.exdao.MonthlyWorkingReportDao; +import jp.sf.pal.timecard.db.exentity.MonthlyReport; +import jp.sf.pal.timecard.db.exentity.MonthlyWorkingReport; +import jp.sf.pal.timecard.db.exentity.WorkingType; + +/** + * The behavior of MONTHLY_WORKING_REPORT. + * + *
    + * [primary-key]
    + *     ID
    + * 
    + * [column]
    + *     ID, VALUE, MONTHLY_REPORT_ID, WORKING_TYPE_ID
    + * 
    + * [sequence]
    + *     
    + * 
    + * [identity]
    + *     ID
    + * 
    + * [version-no]
    + *     
    + * 
    + * [foreign-table]
    + *     MONTHLY_REPORT, WORKING_TYPE
    + * 
    + * [referrer-table]
    + *     
    + * 
    + * [foreign-property]
    + *     monthlyReport, workingType
    + * 
    + * [referrer-property]
    + * 
    + * 
    + * + * @author DBFlute(AutoGenerator) + */ +public abstract class BsMonthlyWorkingReportBhv extends + jp.sf.pal.timecard.db.allcommon.bhv.AbstractBehaviorWritable { + + //========================================================================== + // ========= + // Definition + // ========== + /* df:BehaviorQueryPathBegin */ + /* df:BehaviorQueryPathEnd */ + + //========================================================================== + // ========= + // Attribute + // ========= + protected MonthlyWorkingReportDao _dao; + + //========================================================================== + // ========= + // Table name + // ========== + /** @return The name on database of table. (NotNull) */ + public String getTableDbName() { + return "MONTHLY_WORKING_REPORT"; + } + + //========================================================================== + // ========= + // DBMeta + // ====== + /** @return The meta data of the database. (NotNull) */ + public DBMeta getDBMeta() { + return MonthlyWorkingReportDbm.getInstance(); + } + + /** @return The meta data of the database as my table type. (NotNull) */ + public MonthlyWorkingReportDbm getMyDBMeta() { + return MonthlyWorkingReportDbm.getInstance(); + } + + //========================================================================== + // ========= + // Dao Accessor + // ============ + public MonthlyWorkingReportDao getMyDao() { + return _dao; + } + + public void setMyDao(MonthlyWorkingReportDao dao) { + assertObjectNotNull("dao", dao); + _dao = dao; + } + + public DaoReadable getDaoReadable() { + return getMyDao(); + } + + public DaoWritable getDaoWritable() { + return getMyDao(); + } + + //========================================================================== + // ========= + // New Instance + // ============ + public Entity newEntity() { + return newMyEntity(); + } + + public ConditionBean newConditionBean() { + return newMyConditionBean(); + } + + public MonthlyWorkingReport newMyEntity() { + return new MonthlyWorkingReport(); + } + + public MonthlyWorkingReportCB newMyConditionBean() { + return new MonthlyWorkingReportCB(); + } + + //========================================================================== + // ========= + // Count Select + // ============ + /** + * Select the count of the condition-bean. {IgnorePagingCondition} + * + * @param cb The condition-bean of MonthlyWorkingReport. (NotNull) + * @return The selected count. + */ + public int selectCount(MonthlyWorkingReportCB cb) { + assertConditionBeanNotNull(cb); + return delegateSelectCount(cb); + } + + //========================================================================== + // ========= + // Entity Select + // ============= + /** + * Select the entity by the condition-bean. + * + * @param cb The condition-bean of MonthlyWorkingReport. (NotNull) + * @return The selected entity. (Nullalble) + * @exception jp.sf.pal.timecard.db.allcommon.exception.EntityDuplicatedException + * When the entity has been duplicated. + */ + public MonthlyWorkingReport selectEntity(final MonthlyWorkingReportCB cb) { + return helpSelectEntityInternally( + cb, + new InternalSelectEntityCallback() { + public List callbackSelectList( + MonthlyWorkingReportCB cb) { + return selectList(cb); + } + }); + } + + /** + * Select the entity by the condition-bean with deleted check. + * + * @param cb The condition-bean of MonthlyWorkingReport. (NotNull) + * @return The selected entity. (NotNull) + * @exception jp.sf.pal.timecard.db.allcommon.exception.EntityAlreadyDeletedException + * When the entity has already been deleted. + * @exception jp.sf.pal.timecard.db.allcommon.exception.EntityDuplicatedException + * When the entity has been duplicated. + */ + public MonthlyWorkingReport selectEntityWithDeletedCheck( + final MonthlyWorkingReportCB cb) { + return helpSelectEntityWithDeletedCheckInternally( + cb, + new InternalSelectEntityWithDeletedCheckCallback() { + public List callbackSelectList( + MonthlyWorkingReportCB 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.timecard.db.allcommon.exception.EntityAlreadyDeletedException + * When the entity has already been deleted. + * @exception + * jp.sf.pal.timecard.db.allcommon.exception.EntityDuplicatedException When + * the entity has been duplicated. + */ + public MonthlyWorkingReport selectByPKValueWithDeletedCheck(Long id) { + MonthlyWorkingReport entity = new MonthlyWorkingReport(); + entity.setId(id); + final MonthlyWorkingReportCB cb = newMyConditionBean(); + cb.acceptPrimaryKeyMapString(getDBMeta().extractPrimaryKeyMapString( + entity)); + return selectEntityWithDeletedCheck(cb); + } + + //========================================================================== + // ========= + // List Select + // =========== + /** + * Select the list as result bean. + * + * @param cb The condition-bean of MonthlyWorkingReport. (NotNull) + * @return The result bean of selected list. (NotNull) + */ + public ListResultBean selectList( + MonthlyWorkingReportCB cb) { + assertConditionBeanNotNull(cb); + return new ResultBeanBuilder(getTableDbName()) + .buildListResultBean(cb, delegateSelectList(cb)); + } + + //========================================================================== + // ========= + // Page Select + // =========== + /** + * Select the page as result bean. + * + * @param cb The condition-bean of MonthlyWorkingReport. (NotNull) + * @return The result bean of selected page. (NotNull) + */ + public PagingResultBean selectPage( + final MonthlyWorkingReportCB cb) { + assertConditionBeanNotNull(cb); + final PagingInvoker invoker = new PagingInvoker( + getTableDbName()); + final PagingHandler handler = new PagingHandler() { + public PagingBean getPagingBean() { + return cb; + } + + public int count() { + return selectCount(cb); + } + + public List paging() { + return selectList(cb); + } + }; + return invoker.invokePaging(handler); + } + + //========================================================================== + // ========= + // Various Select + // ============== + /** + * Select the list of value-label. + * + * @param cb The condition-bean of MonthlyWorkingReport. (NotNull) + * @param valueLabelSetupper The setupper of value-label. (NotNull) + * @return The list of value-label. (NotNull) + */ + public List> selectValueLabelList( + MonthlyWorkingReportCB cb, + ValueLabelSetupper valueLabelSetupper) { + return createValueLabelList(selectList(cb), valueLabelSetupper); + } + + //========================================================================== + // ========= + // Load Referrer + // ============= + + //========================================================================== + // ========= + // Pullout Foreign + // =============== + /** + * Pull out the list of foreign table 'MonthlyReport'. + * + * @param monthlyWorkingReportList The list of monthlyWorkingReport. + * (NotNull) + * @return The list of foreign table. (NotNull) + */ + public List pulloutMonthlyReport( + List monthlyWorkingReportList) { + return helpPulloutInternally( + monthlyWorkingReportList, + new InternalPulloutCallback() { + public MonthlyReport callbackGetForeignEntity( + MonthlyWorkingReport entity) { + return entity.getMonthlyReport(); + } + }); + } + + /** + * Pull out the list of foreign table 'WorkingType'. + * + * @param monthlyWorkingReportList The list of monthlyWorkingReport. + * (NotNull) + * @return The list of foreign table. (NotNull) + */ + public List pulloutWorkingType( + List monthlyWorkingReportList) { + return helpPulloutInternally( + monthlyWorkingReportList, + new InternalPulloutCallback() { + public WorkingType callbackGetForeignEntity( + MonthlyWorkingReport entity) { + return entity.getWorkingType(); + } + }); + } + + //========================================================================== + // ========= + // Entity Update + // ============= + /** + * Insert the entity. + * + * @param monthlyWorkingReport The entity of insert target. (NotNull) + * @exception jp.sf.pal.timecard.db.allcommon.exception.EntityAlreadyExistsException + * When the entity already exists. (Unique Constraint + * Violation) + */ + public void insert(MonthlyWorkingReport monthlyWorkingReport) { + assertEntityNotNull(monthlyWorkingReport); + delegateInsert(monthlyWorkingReport); + } + + @Override + protected void doCreate(Entity monthlyWorkingReport) { + insert((MonthlyWorkingReport) monthlyWorkingReport); + } + + /** + * Update the entity modified-only. {UpdateCountZeroException, + * ConcurrencyControl} + * + * @param monthlyWorkingReport The entity of update target. (NotNull) + * {PrimaryKeyRequired, ConcurrencyColumnRequired} + * @exception jp.sf.pal.timecard.db.allcommon.exception.EntityAlreadyDeletedException + * When the entity has already been deleted. + * @exception jp.sf.pal.timecard.db.allcommon.exception.EntityDuplicatedException + * When the entity has been duplicated. + * @exception jp.sf.pal.timecard.db.allcommon.exception.EntityAlreadyExistsException + * When the entity already exists. (Unique Constraint + * Violation) + */ + public void update(final MonthlyWorkingReport monthlyWorkingReport) { + helpUpdateInternally(monthlyWorkingReport, + new InternalUpdateCallback() { + public int callbackDelegateUpdate( + MonthlyWorkingReport entity) { + return delegateUpdate(entity); + } + }); + } + + @Override + protected void doModify(Entity entity) { + update((MonthlyWorkingReport) entity); + } + + @Override + protected void doModifyNonstrict(Entity entity) { + update((MonthlyWorkingReport) entity); + } + + /** + * Insert or update the entity modified-only. {ConcurrencyControl(when + * update)} + * + * @param monthlyWorkingReport The entity of insert or update target. + * (NotNull) + * @exception jp.sf.pal.timecard.db.allcommon.exception.EntityAlreadyDeletedException + * When the entity has already been deleted. + * @exception jp.sf.pal.timecard.db.allcommon.exception.EntityDuplicatedException + * When the entity has been duplicated. + * @exception jp.sf.pal.timecard.db.allcommon.exception.EntityAlreadyExistsException + * When the entity already exists. (Unique Constraint + * Violation) + */ + public void insertOrUpdate(final MonthlyWorkingReport monthlyWorkingReport) { + helpInsertOrUpdateInternally( + monthlyWorkingReport, + new InternalInsertOrUpdateCallback() { + public void callbackInsert(MonthlyWorkingReport entity) { + insert(entity); + } + + public void callbackUpdate(MonthlyWorkingReport entity) { + update(entity); + } + + public MonthlyWorkingReportCB callbackNewMyConditionBean() { + return newMyConditionBean(); + } + + public int callbackSelectCount(MonthlyWorkingReportCB cb) { + return selectCount(cb); + } + }); + } + + @Override + protected void doCreateOrUpdate(Entity monthlyWorkingReport) { + insertOrUpdate((MonthlyWorkingReport) monthlyWorkingReport); + } + + @Override + protected void doCreateOrUpdateNonstrict(Entity entity) { + insertOrUpdate((MonthlyWorkingReport) entity); + } + + /** + * Delete the entity. {UpdateCountZeroException, ConcurrencyControl} + * + * @param monthlyWorkingReport The entity of delete target. (NotNull) + * {PrimaryKeyRequired, ConcurrencyColumnRequired} + * @exception jp.sf.pal.timecard.db.allcommon.exception.EntityAlreadyDeletedException + * When the entity has already been deleted. + * @exception jp.sf.pal.timecard.db.allcommon.exception.EntityDuplicatedException + * When the entity has been duplicated. + */ + public void delete(MonthlyWorkingReport monthlyWorkingReport) { + helpDeleteInternally(monthlyWorkingReport, + new InternalDeleteCallback() { + public int callbackDelegateDelete( + MonthlyWorkingReport entity) { + return delegateDelete(entity); + } + }); + } + + @Override + protected void doRemove(Entity monthlyWorkingReport) { + delete((MonthlyWorkingReport) monthlyWorkingReport); + } + + //========================================================================== + // ========= + // Batch Update + // ============ + /** + * Batch insert the list. This method use 'Batch Update' of + * java.sql.PreparedStatement. + * + * @param monthlyWorkingReportList The list of the entity. (NotNull) + * @return The array of inserted count. + */ + public int[] batchInsert(List monthlyWorkingReportList) { + assertObjectNotNull("monthlyWorkingReportList", + monthlyWorkingReportList); + return delegateInsertList(monthlyWorkingReportList); + } + + /** + * Batch update the list. All columns are update target. {NOT modified only} + *
    This method use 'Batch Update' of java.sql.PreparedStatement. + * + * @param monthlyWorkingReportList The list of the entity. (NotNull) + * @return The array of updated count. + * @exception jp.sf.pal.timecard.db.allcommon.exception.EntityAlreadyDeletedException + * When the entity has already been deleted. + */ + public int[] batchUpdate(List monthlyWorkingReportList) { + assertObjectNotNull("monthlyWorkingReportList", + monthlyWorkingReportList); + return delegateUpdateList(monthlyWorkingReportList); + } + + /** + * Batch delete the list.
    This method use 'Batch Update' of + * java.sql.PreparedStatement. + * + * @param monthlyWorkingReportList The list of the entity. (NotNull) + * @return The array of deleted count. + * @exception jp.sf.pal.timecard.db.allcommon.exception.EntityAlreadyDeletedException + * When the entity has already been deleted. + */ + public int[] batchDelete(List monthlyWorkingReportList) { + assertObjectNotNull("monthlyWorkingReportList", + monthlyWorkingReportList); + return delegateDeleteList(monthlyWorkingReportList); + } + + //========================================================================== + // ========= + // Query Update + // ============ + /** + * Query update the several entities. {NoConcurrencyControl} + * + * @param monthlyWorkingReport Entity. (NotNull) {PrimaryKeyNotRequired} + * @param cb Condition-bean. (NotNull) + * @return The updated count. + */ + public int queryUpdate(MonthlyWorkingReport monthlyWorkingReport, + MonthlyWorkingReportCB cb) { + assertObjectNotNull("monthlyWorkingReport", monthlyWorkingReport); + assertConditionBeanNotNull(cb); + setupCommonColumnOfUpdateIfNeeds(monthlyWorkingReport); + filterEntityOfUpdate(monthlyWorkingReport); + assertEntityOfUpdate(monthlyWorkingReport); + return getMyDao().updateByQuery(cb, monthlyWorkingReport); + } + + /** + * Query delete the several entities. {NoConcurrencyControl} + * + * @param cb Condition-bean. (NotNull) + * @return The deleted count. + */ + public int queryDelete(MonthlyWorkingReportCB cb) { + assertConditionBeanNotNull(cb); + return getMyDao().deleteByQuery(cb); + } + + //========================================================================== + // ========= + // Various Update + // ============== + + //========================================================================== + // ========= + // Delegate Method + // =============== + // ----------------------------------------------------- + // Select + // ------ + protected int delegateSelectCount(MonthlyWorkingReportCB cb) { + assertConditionBeanNotNull(cb); + return getMyDao().selectCount(cb); + } + + protected List delegateSelectList( + MonthlyWorkingReportCB cb) { + assertConditionBeanNotNull(cb); + return getMyDao().selectList(cb); + } + + // ----------------------------------------------------- + // Update + // ------ + protected int delegateInsert(MonthlyWorkingReport e) { + if (!processBeforeInsert(e)) { + return 1; + } + return getMyDao().insert(e); + } + + protected int delegateUpdate(MonthlyWorkingReport e) { + if (!processBeforeUpdate(e)) { + return 1; + } + return getMyDao().updateModifiedOnly(e); + } + + protected int delegateDelete(MonthlyWorkingReport e) { + if (!processBeforeDelete(e)) { + return 1; + } + return getMyDao().delete(e); + } + + protected int[] delegateInsertList(List ls) { + assertObjectNotNull("monthlyWorkingReportList", ls); + return getMyDao().insertList(helpFilterBeforeInsertInternally(ls)); + } + + protected int[] delegateUpdateList(List ls) { + assertObjectNotNull("monthlyWorkingReportList", ls); + return getMyDao().updateList(helpFilterBeforeUpdateInternally(ls)); + } + + protected int[] delegateDeleteList(List ls) { + assertObjectNotNull("monthlyWorkingReportList", 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 MonthlyWorkingReport downcast(Entity entity) { + return helpDowncastInternally(entity, MonthlyWorkingReport.class); + } +} Property changes on: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/bsbhv/BsMonthlyWorkingReportBhv.java ___________________________________________________________________ Name: svn:eol-style + native Added: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/bsbhv/BsWorkingTypeBhv.java =================================================================== --- timecard/trunk/src/main/java/jp/sf/pal/timecard/db/bsbhv/BsWorkingTypeBhv.java (rev 0) +++ timecard/trunk/src/main/java/jp/sf/pal/timecard/db/bsbhv/BsWorkingTypeBhv.java 2008-12-02 03:38:50 UTC (rev 1493) @@ -0,0 +1,814 @@ +package jp.sf.pal.timecard.db.bsbhv; + +import java.util.List; + +import jp.sf.pal.timecard.db.allcommon.DaoReadable; +import jp.sf.pal.timecard.db.allcommon.DaoWritable; +import jp.sf.pal.timecard.db.allcommon.Entity; +import jp.sf.pal.timecard.db.allcommon.bhv.load.LoadReferrerOption; +import jp.sf.pal.timecard.db.allcommon.bhv.setup.ConditionBeanSetupper; +import jp.sf.pal.timecard.db.allcommon.bhv.setup.ValueLabelSetupper; +import jp.sf.pal.timecard.db.allcommon.cbean.ConditionBean; +import jp.sf.pal.timecard.db.allcommon.cbean.ListResultBean; +import jp.sf.pal.timecard.db.allcommon.cbean.PagingBean; +import jp.sf.pal.timecard.db.allcommon.cbean.PagingHandler; +import jp.sf.pal.timecard.db.allcommon.cbean.PagingInvoker; +import jp.sf.pal.timecard.db.allcommon.cbean.PagingResultBean; +import jp.sf.pal.timecard.db.allcommon.cbean.ResultBeanBuilder; +import jp.sf.pal.timecard.db.allcommon.dbmeta.DBMeta; +import jp.sf.pal.timecard.db.bsentity.dbmeta.WorkingTypeDbm; +import jp.sf.pal.timecard.db.cbean.MonthlyWorkingReportCB; +import jp.sf.pal.timecard.db.cbean.WorkingTypeCB; +import jp.sf.pal.timecard.db.exbhv.MonthlyWorkingReportBhv; +import jp.sf.pal.timecard.db.exdao.WorkingTypeDao; +import jp.sf.pal.timecard.db.exentity.MonthlyWorkingReport; +import jp.sf.pal.timecard.db.exentity.WorkingType; + +/** + * The behavior of WORKING_TYPE. + * + *
    + * [primary-key]
    + *     ID
    + * 
    + * [column]
    + *     ID, NAME, VALUE, TYPE, PARENT_ID, CREATED_TIME, CREATED_BY, UPDATED_TIME, UPDATED_BY, DELETED_TIME, DELETED_BY, VERSIONNO
    + * 
    + * [sequence]
    + *     
    + * 
    + * [identity]
    + *     ID
    + * 
    + * [version-no]
    + *     VERSIONNO
    + * 
    + * [foreign-table]
    + *     
    + * 
    + * [referrer-table]
    + *     MONTHLY_WORKING_REPORT
    + * 
    + * [foreign-property]
    + *     
    + * 
    + * [referrer-property]
    + *     monthlyWorkingReportList
    + * 
    + * + * @author DBFlute(AutoGenerator) + */ +public abstract class BsWorkingTypeBhv extends + jp.sf.pal.timecard.db.allcommon.bhv.AbstractBehaviorWritable { + + //========================================================================== + // ========= + // Definition + // ========== + /* df:BehaviorQueryPathBegin */ + /* df:BehaviorQueryPathEnd */ + + //========================================================================== + // ========= + // Attribute + // ========= + protected WorkingTypeDao _dao; + + //========================================================================== + // ========= + // Table name + // ========== + /** @return The name on database of table. (NotNull) */ + public String getTableDbName() { + return "WORKING_TYPE"; + } + + //========================================================================== + // ========= + // DBMeta + // ====== + /** @return The meta data of the database. (NotNull) */ + public DBMeta getDBMeta() { + return WorkingTypeDbm.getInstance(); + } + + /** @return The meta data of the database as my table type. (NotNull) */ + public WorkingTypeDbm getMyDBMeta() { + return WorkingTypeDbm.getInstance(); + } + + //========================================================================== + // ========= + // Dao Accessor + // ============ + public WorkingTypeDao getMyDao() { + return _dao; + } + + public void setMyDao(WorkingTypeDao dao) { + assertObjectNotNull("dao", dao); + _dao = dao; + } + + public DaoReadable getDaoReadable() { + return getMyDao(); + } + + public DaoWritable getDaoWritable() { + return getMyDao(); + } + + //========================================================================== + // ========= + // New Instance + // ============ + public Entity newEntity() { + return newMyEntity(); + } + + public ConditionBean newConditionBean() { + return newMyConditionBean(); + } + + public WorkingType newMyEntity() { + return new WorkingType(); + } + + public WorkingTypeCB newMyConditionBean() { + return new WorkingTypeCB(); + } + + //========================================================================== + // ========= + // Count Select + // ============ + /** + * Select the count of the condition-bean. {IgnorePagingCondition} + * + * @param cb The condition-bean of WorkingType. (NotNull) + * @return The selected count. + */ + public int selectCount(WorkingTypeCB cb) { + assertConditionBeanNotNull(cb); + return delegateSelectCount(cb); + } + + //========================================================================== + // ========= + // Entity Select + // ============= + /** + * Select the entity by the condition-bean. + * + * @param cb The condition-bean of WorkingType. (NotNull) + * @return The selected entity. (Nullalble) + * @exception jp.sf.pal.timecard.db.allcommon.exception.EntityDuplicatedException + * When the entity has been duplicated. + */ + public WorkingType selectEntity(final WorkingTypeCB cb) { + return helpSelectEntityInternally(cb, + new InternalSelectEntityCallback() { + public List callbackSelectList(WorkingTypeCB cb) { + return selectList(cb); + } + }); + } + + /** + * Select the entity by the condition-bean with deleted check. + * + * @param cb The condition-bean of WorkingType. (NotNull) + * @return The selected entity. (NotNull) + * @exception jp.sf.pal.timecard.db.allcommon.exception.EntityAlreadyDeletedException + * When the entity has already been deleted. + * @exception jp.sf.pal.timecard.db.allcommon.exception.EntityDuplicatedException + * When the entity has been duplicated. + */ + public WorkingType selectEntityWithDeletedCheck(final WorkingTypeCB cb) { + return helpSelectEntityWithDeletedCheckInternally( + cb, + new InternalSelectEntityWithDeletedCheckCallback() { + public List callbackSelectList(WorkingTypeCB 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.timecard.db.allcommon.exception.EntityAlreadyDeletedException + * When the entity has already been deleted. + * @exception + * jp.sf.pal.timecard.db.allcommon.exception.EntityDuplicatedException When + * the entity has been duplicated. + */ + public WorkingType selectByPKValueWithDeletedCheck(Integer id) { + WorkingType entity = new WorkingType(); + entity.setId(id); + final WorkingTypeCB cb = newMyConditionBean(); + cb.acceptPrimaryKeyMapString(getDBMeta().extractPrimaryKeyMapString( + entity)); + return selectEntityWithDeletedCheck(cb); + } + + //========================================================================== + // ========= + // List Select + // =========== + /** + * Select the list as result bean. + * + * @param cb The condition-bean of WorkingType. (NotNull) + * @return The result bean of selected list. (NotNull) + */ + public ListResultBean selectList(WorkingTypeCB cb) { + assertConditionBeanNotNull(cb); + return new ResultBeanBuilder(getTableDbName()) + .buildListResultBean(cb, delegateSelectList(cb)); + } + + //========================================================================== + // ========= + // Page Select + // =========== + /** + * Select the page as result bean. + * + * @param cb The condition-bean of WorkingType. (NotNull) + * @return The result bean of selected page. (NotNull) + */ + public PagingResultBean selectPage(final WorkingTypeCB cb) { + assertConditionBeanNotNull(cb); + final PagingInvoker invoker = new PagingInvoker( + getTableDbName()); + final PagingHandler handler = new PagingHandler() { + public PagingBean getPagingBean() { + return cb; + } + + public int count() { + return selectCount(cb); + } + + public List paging() { + return selectList(cb); + } + }; + return invoker.invokePaging(handler); + } + + //========================================================================== + // ========= + // Various Select + // ============== + /** + * Select the list of value-label. + * + * @param cb The condition-bean of WorkingType. (NotNull) + * @param valueLabelSetupper The setupper of value-label. (NotNull) + * @return The list of value-label. (NotNull) + */ + public List> selectValueLabelList( + WorkingTypeCB cb, ValueLabelSetupper valueLabelSetupper) { + return createValueLabelList(selectList(cb), valueLabelSetupper); + } + + //========================================================================== + // ========= + // Load Referrer + // ============= + /** + * Load referrer of monthlyWorkingReportList with the setupper for + * condition-bean of referrer.
    About internal policy, the value of + * primary key(and others too) is treated as case-insensitive.
    The + * condition-bean that the setupper provides have settings before you touch + * it. It is as follows: + * + *
    +     * cb.query().setWorkingTypeId_InScope(pkList);
    +     * cb.query().addOrderBy_WorkingTypeId_Asc();
    +     * 
    + * + * @param workingTypeList The entity list of workingType. (NotNull) + * @param conditionBeanSetupper The instance of referrer condition-bean + * setupper for registering referrer condition. (NotNull) + */ + public void loadMonthlyWorkingReportList(List workingTypeList, + ConditionBeanSetupper conditionBeanSetupper) { + assertObjectNotNull("workingTypeList", workingTypeList); + assertObjectNotNull("conditionBeanSetupper", + conditionBeanSetupper); + if (workingTypeList.isEmpty()) { + return; + } + loadMonthlyWorkingReportList( + workingTypeList, + new LoadReferrerOption( + conditionBeanSetupper)); + } + + /** + * {Refer to overload method that has an argument of condition-bean + * setupper.} + * + * @param workingTypeList The entity list of workingType. (NotNull) + * @param loadReferrerOption The option of load-referrer. (NotNull) + */ + public void loadMonthlyWorkingReportList( + List workingTypeList, + LoadReferrerOption loadReferrerOption) { + assertObjectNotNull("workingTypeList", workingTypeList); + assertObjectNotNull( + "loadReferrerOption", + loadReferrerOption); + if (workingTypeList.isEmpty()) { + return; + } + final MonthlyWorkingReportBhv referrerBhv = xgetBSFLR().select( + MonthlyWorkingReportBhv.class); + helpLoadReferrerInternally( + workingTypeList, + loadReferrerOption, + new InternalLoadReferrerCallback() { + public Integer callbackBase_getPrimaryKeyValue( + WorkingType entity) { + return entity.getId(); + } + + public void callbackBase_setReferrerList( + WorkingType entity, + List referrerList) { + entity.setMonthlyWorkingReportList(referrerList); + } + + public MonthlyWorkingReportCB callbackReferrer_newMyConditionBean() { + return referrerBhv.newMyConditionBean(); + } + + public void callbackReferrer_queryForeignKeyInScope( + MonthlyWorkingReportCB cb, List pkList) { + cb.query().setWorkingTypeId_InScope(pkList); + } + + public void callbackReferrer_queryAddOrderByForeignKeyAsc( + MonthlyWorkingReportCB cb) { + cb.query().addOrderBy_WorkingTypeId_Asc(); + } + + public List callbackReferrer_selectList( + MonthlyWorkingReportCB cb) { + return referrerBhv.selectList(cb); + } + + public Integer callbackReferrer_getForeignKeyValue( + MonthlyWorkingReport entity) { + return entity.getWorkingTypeId(); + } + + public void callbackReferrer_setForeignEntity( + MonthlyWorkingReport referrerEntity, + WorkingType baseEntity) { + referrerEntity.setWorkingType(baseEntity); + } + }); + } + + //========================================================================== + // ========= + // Pullout Foreign + // =============== + + //========================================================================== + // ========= + // Entity Update + // ============= + /** + * Insert the entity. + * + * @param workingType The entity of insert target. (NotNull) + * @exception jp.sf.pal.timecard.db.allcommon.exception.EntityAlreadyExistsException + * When the entity already exists. (Unique Constraint + * Violation) + */ + public void insert(WorkingType workingType) { + assertEntityNotNull(workingType); + delegateInsert(workingType); + } + + @Override + protected void doCreate(Entity workingType) { + insert((WorkingType) workingType); + } + + /** + * Update the entity modified-only. {UpdateCountZeroException, + * ConcurrencyControl} + * + * @param workingType The entity of update target. (NotNull) + * {PrimaryKeyRequired, ConcurrencyColumnRequired} + * @exception jp.sf.pal.timecard.db.allcommon.exception.EntityAlreadyUpdatedException + * When the entity has already been updated. + * @exception jp.sf.pal.timecard.db.allcommon.exception.EntityDuplicatedException + * When the entity has been duplicated. + * @exception jp.sf.pal.timecard.db.allcommon.exception.EntityAlreadyExistsException + * When the entity already exists. (Unique Constraint + * Violation) + */ + public void update(final WorkingType workingType) { + helpUpdateInternally(workingType, + new InternalUpdateCallback() { + public int callbackDelegateUpdate(WorkingType entity) { + return delegateUpdate(entity); + } + }); + } + + @Override + protected void doModify(Entity entity) { + update((WorkingType) entity); + } + + /** + * Update the entity non-strictly modified-only. {UpdateCountZeroException, + * NonConcurrencyControl} + * + * @param workingType The entity of update target. (NotNull) + * {PrimaryKeyRequired} + * @exception jp.sf.pal.timecard.db.allcommon.exception.EntityAlreadyDeletedException + * When the entity has already been deleted. + * @exception jp.sf.pal.timecard.db.allcommon.exception.EntityDuplicatedException + * When the entity has been duplicated. + * @exception jp.sf.pal.timecard.db.allcommon.exception.EntityAlreadyExistsException + * When the entity already exists. (Unique Constraint + * Violation) + */ + public void updateNonstrict(final WorkingType workingType) { + helpUpdateNonstrictInternally(workingType, + new InternalUpdateNonstrictCallback() { + public int callbackDelegateUpdateNonstrict( + WorkingType entity) { + return delegateUpdateNonstrict(entity); + } + }); + } + + @Override + protected void doModifyNonstrict(Entity entity) { + updateNonstrict((WorkingType) entity); + } + + /** + * Insert or update the entity modified-only. {ConcurrencyControl(when + * update)} + * + * @param workingType The entity of insert or update target. (NotNull) + * @exception jp.sf.pal.timecard.db.allcommon.exception.EntityAlreadyUpdatedException + * When the entity has already been updated. + * @exception jp.sf.pal.timecard.db.allcommon.exception.EntityDuplicatedException + * When the entity has been duplicated. + * @exception jp.sf.pal.timecard.db.allcommon.exception.EntityAlreadyExistsException + * When the entity already exists. (Unique Constraint + * Violation) + */ + public void insertOrUpdate(final WorkingType workingType) { + helpInsertOrUpdateInternally( + workingType, + new InternalInsertOrUpdateCallback() { + public void callbackInsert(WorkingType entity) { + insert(entity); + } + + public void callbackUpdate(WorkingType entity) { + update(entity); + } + + public WorkingTypeCB callbackNewMyConditionBean() { + return newMyConditionBean(); + } + + public int callbackSelectCount(WorkingTypeCB cb) { + return selectCount(cb); + } + }); + } + + @Override + protected void doCreateOrUpdate(Entity workingType) { + insertOrUpdate((WorkingType) workingType); + } + + /** + * Insert or update the entity non-strictly modified-only. + * {NonConcurrencyControl(when update)} + * + * @param workingType The entity of insert or update target. (NotNull) + * @exception jp.sf.pal.timecard.db.allcommon.exception.EntityAlreadyDeletedException + * When the entity has already been deleted. + * @exception jp.sf.pal.timecard.db.allcommon.exception.EntityDuplicatedException + * When the entity has been duplicated. + * @exception jp.sf.pal.timecard.db.allcommon.exception.EntityAlreadyExistsException + * When the entity already exists. (Unique Constraint + * Violation) + */ + public void insertOrUpdateNonstrict(WorkingType workingType) { + helpInsertOrUpdateInternally(workingType, + new InternalInsertOrUpdateNonstrictCallback() { + public void callbackInsert(WorkingType entity) { + insert(entity); + } + + public void callbackUpdateNonstrict(WorkingType entity) { + updateNonstrict(entity); + } + }); + } + + @Override + protected void doCreateOrUpdateNonstrict(Entity entity) { + insertOrUpdateNonstrict((WorkingType) entity); + } + + /** + * Delete the entity. {UpdateCountZeroException, ConcurrencyControl} + * + * @param workingType The entity of delete target. (NotNull) + * {PrimaryKeyRequired, ConcurrencyColumnRequired} + * @exception jp.sf.pal.timecard.db.allcommon.exception.EntityAlreadyUpdatedException + * When the entity has already been updated. + * @exception jp.sf.pal.timecard.db.allcommon.exception.EntityDuplicatedException + * When the entity has been duplicated. + */ + public void delete(WorkingType workingType) { + helpDeleteInternally(workingType, + new InternalDeleteCallback() { + public int callbackDelegateDelete(WorkingType entity) { + return delegateDelete(entity); + } + }); + } + + @Override + protected void doRemove(Entity workingType) { + delete((WorkingType) workingType); + } + + /** + * Delete the entity non-strictly. {UpdateCountZeroException, + * NonConcurrencyControl} + * + * @param workingType Entity. (NotNull) {PrimaryKeyRequired} + * @exception jp.sf.pal.timecard.db.allcommon.exception.EntityAlreadyDeletedException + * When the entity has already been deleted. + * @exception jp.sf.pal.timecard.db.allcommon.exception.EntityDuplicatedException + * When the entity has been duplicated. + */ + public void deleteNonstrict(WorkingType workingType) { + helpDeleteNonstrictInternally(workingType, + new InternalDeleteNonstrictCallback() { + public int callbackDelegateDeleteNonstrict( + WorkingType entity) { + return delegateDeleteNonstrict(entity); + } + }); + } + + /** + * Delete the entity non-strictly ignoring deleted. + * {UpdateCountZeroException, NonConcurrencyControl} + * + * @param workingType Entity. (NotNull) {PrimaryKeyRequired} + * @exception jp.sf.pal.timecard.db.allcommon.exception.EntityDuplicatedException + * When the entity has been duplicated. + */ + public void deleteNonstrictIgnoreDeleted(WorkingType workingType) { + helpDeleteNonstrictIgnoreDeletedInternally( + workingType, + new InternalDeleteNonstrictIgnoreDeletedCallback() { + public int callbackDelegateDeleteNonstrict( + WorkingType entity) { + return delegateDeleteNonstrict(entity); + } + }); + } + + //========================================================================== + // ========= + // Batch Update + // ============ + /** + * Batch insert the list. This method use 'Batch Update' of + * java.sql.PreparedStatement. + * + * @param workingTypeList The list of the entity. (NotNull) + * @return The array of inserted count. + */ + public int[] batchInsert(List workingTypeList) { + assertObjectNotNull("workingTypeList", workingTypeList); + return delegateInsertList(workingTypeList); + } + + /** + * Batch update the list. All columns are update target. {NOT modified only} + *
    This method use 'Batch Update' of java.sql.PreparedStatement. + * + * @param workingTypeList The list of the entity. (NotNull) + * @return The array of updated count. + * @exception jp.sf.pal.timecard.db.allcommon.exception.BatchEntityAlreadyUpdatedException + * When the entity has already been updated. This exception + * extends ${glEntityAlreadyUpdateException}. + */ + public int[] batchUpdate(List workingTypeList) { + assertObjectNotNull("workingTypeList", workingTypeList); + return delegateUpdateList(workingTypeList); + } + + /** + * Batch update the list non-strictly. All columns are update target. {NOT + * modified only}
    This method use 'Batch Update' of + * java.sql.PreparedStatement. + * + * @param workingTypeList The list of the entity. (NotNull) + * @return The array of updated count. + * @exception jp.sf.pal.timecard.db.allcommon.exception.EntityAlreadyDeletedException + * When the entity has already been deleted. + */ + public int[] batchUpdateNonstrict(List workingTypeList) { + assertObjectNotNull("workingTypeList", workingTypeList); + return delegateUpdateListNonstrict(workingTypeList); + } + + /** + * Batch delete the list.
    This method use 'Batch Update' of + * java.sql.PreparedStatement. + * + * @param workingTypeList The list of the entity. (NotNull) + * @return The array of deleted count. + * @exception jp.sf.pal.timecard.db.allcommon.exception.BatchEntityAlreadyUpdatedException + * When the entity has already been updated. This exception + * extends ${glEntityAlreadyUpdateException}. + */ + public int[] batchDelete(List workingTypeList) { + assertObjectNotNull("workingTypeList", workingTypeList); + return delegateDeleteList(workingTypeList); + } + + /** + * Batch delete the list non-strictly.
    This method use 'Batch Update' + * of java.sql.PreparedStatement. + * + * @param workingTypeList The list of the entity. (NotNull) + * @return The array of deleted count. + * @exception jp.sf.pal.timecard.db.allcommon.exception.EntityAlreadyDeletedException + * When the entity has already been deleted. + */ + public int[] batchDeleteNonstrict(List workingTypeList) { + assertObjectNotNull("workingTypeList", workingTypeList); + return delegateDeleteListNonstrict(workingTypeList); + } + + //========================================================================== + // ========= + // Query Update + // ============ + /** + * Query update the several entities. {NoConcurrencyControl} + * + * @param workingType Entity. (NotNull) {PrimaryKeyNotRequired} + * @param cb Condition-bean. (NotNull) + * @return The updated count. + */ + public int queryUpdate(WorkingType workingType, WorkingTypeCB cb) { + assertObjectNotNull("workingType", workingType); + assertConditionBeanNotNull(cb); + setupCommonColumnOfUpdateIfNeeds(workingType); + filterEntityOfUpdate(workingType); + assertEntityOfUpdate(workingType); + return getMyDao().updateByQuery(cb, workingType); + } + + /** + * Query delete the several entities. {NoConcurrencyControl} + * + * @param cb Condition-bean. (NotNull) + * @return The deleted count. + */ + public int queryDelete(WorkingTypeCB cb) { + assertConditionBeanNotNull(cb); + return getMyDao().deleteByQuery(cb); + } + + //========================================================================== + // ========= + // Various Update + // ============== + + //========================================================================== + // ========= + // Delegate Method + // =============== + // ----------------------------------------------------- + // Select + // ------ + protected int delegateSelectCount(WorkingTypeCB cb) { + assertConditionBeanNotNull(cb); + return getMyDao().selectCount(cb); + } + + protected List delegateSelectList(WorkingTypeCB cb) { + assertConditionBeanNotNull(cb); + return getMyDao().selectList(cb); + } + + // ----------------------------------------------------- + // Update + // ------ + protected int delegateInsert(WorkingType e) { + if (!processBeforeInsert(e)) { + return 1; + } + return getMyDao().insert(e); + } + + protected int delegateUpdate(WorkingType e) { + if (!processBeforeUpdate(e)) { + return 1; + } + return getMyDao().updateModifiedOnly(e); + } + + protected int delegateUpdateNonstrict(WorkingType e) { + if (!processBeforeUpdate(e)) { + return 1; + } + return getMyDao().updateNonstrictModifiedOnly(e); + } + + protected int delegateDelete(WorkingType e) { + if (!processBeforeDelete(e)) { + return 1; + } + return getMyDao().delete(e); + } + + protected int delegateDeleteNonstrict(WorkingType e) { + if (!processBeforeDelete(e)) { + return 1; + } + return getMyDao().deleteNonstrict(e); + } + + protected int[] delegateInsertList(List ls) { + assertObjectNotNull("workingTypeList", ls); + return getMyDao().insertList(helpFilterBeforeInsertInternally(ls)); + } + + protected int[] delegateUpdateList(List ls) { + assertObjectNotNull("workingTypeList", ls); + return getMyDao().updateList(helpFilterBeforeUpdateInternally(ls)); + } + + protected int[] delegateUpdateListNonstrict(List ls) { + assertObjectNotNull("workingTypeList", ls); + return getMyDao().updateListNonstrict( + helpFilterBeforeUpdateInternally(ls)); + } + + protected int[] delegateDeleteList(List ls) { + assertObjectNotNull("workingTypeList", ls); + return getMyDao().deleteList(helpFilterBeforeDeleteInternally(ls)); + } + + protected int[] delegateDeleteListNonstrict(List ls) { + assertObjectNotNull("workingTypeList", 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 WorkingType downcast(Entity entity) { + return helpDowncastInternally(entity, WorkingType.class); + } +} Property changes on: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/bsbhv/BsWorkingTypeBhv.java ___________________________________________________________________ Name: svn:eol-style + native Added: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/bsdao/BsMonthlyWorkingReportDao.java =================================================================== --- timecard/trunk/src/main/java/jp/sf/pal/timecard/db/bsdao/BsMonthlyWorkingReportDao.java (rev 0) +++ timecard/trunk/src/main/java/jp/sf/pal/timecard/db/bsdao/BsMonthlyWorkingReportDao.java 2008-12-02 03:38:50 UTC (rev 1493) @@ -0,0 +1,37 @@ +package jp.sf.pal.timecard.db.bsdao; + +import java.util.List; + +import jp.sf.pal.timecard.db.cbean.MonthlyWorkingReportCB; +import jp.sf.pal.timecard.db.exentity.MonthlyWorkingReport; + +/** + * The DAO interface of MONTHLY_WORKING_REPORT. + * + * @author DBFlute(AutoGenerator) + */ +public interface BsMonthlyWorkingReportDao extends + jp.sf.pal.timecard.db.allcommon.DaoWritable { + + public Class BEAN = MonthlyWorkingReport.class; // For S2Dao + + public int selectCount(MonthlyWorkingReportCB cb); + + public List selectList(MonthlyWorkingReportCB cb); + + int insert(MonthlyWorkingReport entity); + + int updateModifiedOnly(MonthlyWorkingReport entity); + + int delete(MonthlyWorkingReport entity); + + int[] insertList(List entityList); + + int[] updateList(List entityList); + + int updateByQuery(MonthlyWorkingReportCB cb, MonthlyWorkingReport entity); + + int[] deleteList(List entityList); + + int deleteByQuery(MonthlyWorkingReportCB cb); +} Property changes on: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/bsdao/BsMonthlyWorkingReportDao.java ___________________________________________________________________ Name: svn:eol-style + native Added: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/bsdao/BsWorkingTypeDao.java =================================================================== --- timecard/trunk/src/main/java/jp/sf/pal/timecard/db/bsdao/BsWorkingTypeDao.java (rev 0) +++ timecard/trunk/src/main/java/jp/sf/pal/timecard/db/bsdao/BsWorkingTypeDao.java 2008-12-02 03:38:50 UTC (rev 1493) @@ -0,0 +1,45 @@ +package jp.sf.pal.timecard.db.bsdao; + +import java.util.List; + +import jp.sf.pal.timecard.db.cbean.WorkingTypeCB; +import jp.sf.pal.timecard.db.exentity.WorkingType; + +/** + * The DAO interface of WORKING_TYPE. + * + * @author DBFlute(AutoGenerator) + */ +public interface BsWorkingTypeDao extends + jp.sf.pal.timecard.db.allcommon.DaoWritable { + + public Class BEAN = WorkingType.class; // For S2Dao + + public int selectCount(WorkingTypeCB cb); + + public List selectList(WorkingTypeCB cb); + + int insert(WorkingType entity); + + int updateModifiedOnly(WorkingType entity); + + int updateNonstrictModifiedOnly(WorkingType entity); + + int delete(WorkingType entity); + + int deleteNonstrict(WorkingType entity); + + int[] insertList(List entityList); + + int[] updateList(List entityList); + + int[] updateListNonstrict(List entityList); + + int updateByQuery(WorkingTypeCB cb, WorkingType entity); + + int[] deleteList(List entityList); + + int[] deleteListNonstrict(List entityList); + + int deleteByQuery(WorkingTypeCB cb); +} Property changes on: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/bsdao/BsWorkingTypeDao.java ___________________________________________________________________ Name: svn:eol-style + native Modified: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/bsentity/BsEmployee.java =================================================================== --- timecard/trunk/src/main/java/jp/sf/pal/timecard/db/bsentity/BsEmployee.java 2008-12-01 14:26:07 UTC (rev 1492) +++ timecard/trunk/src/main/java/jp/sf/pal/timecard/db/bsentity/BsEmployee.java 2008-12-02 03:38:50 UTC (rev 1493) @@ -18,7 +18,7 @@ * ID * * [column] - * ID, USERNAME, MANAGER, PAID_HOLIDAYS, IS_AVAILABLE, CREATED_TIME, CREATED_BY, UPDATED_TIME, UPDATED_BY, DELETED_TIME, DELETED_BY, VERSIONNO + * ID, USERNAME, MANAGER, IS_AVAILABLE, CREATED_TIME, CREATED_BY, UPDATED_TIME, UPDATED_BY, DELETED_TIME, DELETED_BY, VERSIONNO * * [sequence] * @@ -79,9 +79,6 @@ /** MANAGER: {NotNull : VARCHAR(255) : FK to USER_INFO} */ protected String _manager; - /** PAID_HOLIDAYS: {NotNull : DOUBLE : Default=[0]} */ - protected java.math.BigDecimal _paidHolidays; - /** IS_AVAILABLE: {NotNull : VARCHAR(1) : Default=[T]} */ protected String _isAvailable; @@ -332,7 +329,6 @@ sb.append(delimiter).append(getId()); sb.append(delimiter).append(getUsername()); sb.append(delimiter).append(getManager()); - sb.append(delimiter).append(getPaidHolidays()); sb.append(delimiter).append(getIsAvailable()); sb.append(delimiter).append(getCreatedTime()); sb.append(delimiter).append(getCreatedBy()); @@ -425,28 +421,6 @@ this._manager = manager; } - /** The column annotation for S2Dao. {NotNull : DOUBLE : Default=[0]} */ - public static final String paidHolidays_COLUMN = "PAID_HOLIDAYS"; - - /** - * PAID_HOLIDAYS: {NotNull : DOUBLE : Default=[0]}
    - * - * @return The value of the column 'PAID_HOLIDAYS'. (Nullable) - */ - public java.math.BigDecimal getPaidHolidays() { - return _paidHolidays; - } - - /** - * PAID_HOLIDAYS: {NotNull : DOUBLE : Default=[0]}
    - * - * @param paidHolidays The value of the column 'PAID_HOLIDAYS'. (Nullable) - */ - public void setPaidHolidays(java.math.BigDecimal paidHolidays) { - _modifiedProperties.addPropertyName("paidHolidays"); - this._paidHolidays = paidHolidays; - } - /** The column annotation for S2Dao. {NotNull : VARCHAR(1) : Default=[T]} */ public static final String isAvailable_COLUMN = "IS_AVAILABLE"; Modified: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/bsentity/BsMonthlyReport.java =================================================================== --- timecard/trunk/src/main/java/jp/sf/pal/timecard/db/bsentity/BsMonthlyReport.java 2008-12-01 14:26:07 UTC (rev 1492) +++ timecard/trunk/src/main/java/jp/sf/pal/timecard/db/bsentity/BsMonthlyReport.java 2008-12-02 03:38:50 UTC (rev 1493) @@ -9,6 +9,7 @@ import jp.sf.pal.timecard.db.allcommon.dbmeta.DBMetaInstanceHandler; import jp.sf.pal.timecard.db.exentity.DailyReport; import jp.sf.pal.timecard.db.exentity.Employee; +import jp.sf.pal.timecard.db.exentity.MonthlyWorkingReport; /** * The entity of MONTHLY_REPORT that the type is TABLE.
    @@ -18,7 +19,7 @@ * ID * * [column] - * ID, YEAR, MONTH, STATUS, WORKING_DAYS, STD_WORKING_DAYS, HOLIDAYS, PAID_HOLIDAYS, WORKING_TIME, STD_WORKING_TIME, OVER_TIME, MNT_OVER_TIME, EMPLOYEE_ID, CREATED_TIME, CREATED_BY, UPDATED_TIME, UPDATED_BY, DELETED_TIME, DELETED_BY, VERSIONNO + * ID, YEAR, MONTH, STATUS, STD_WORKING_DAYS, WORKING_TIME, STD_WORKING_TIME, OVER_TIME, MNT_OVER_TIME, EMPLOYEE_ID, CREATED_TIME, CREATED_BY, UPDATED_TIME, UPDATED_BY, DELETED_TIME, DELETED_BY, VERSIONNO * * [sequence] * @@ -33,13 +34,13 @@ * EMPLOYEE * * [referrer-table] - * DAILY_REPORT + * DAILY_REPORT, MONTHLY_WORKING_REPORT * * [foreign-property] * employee * * [referrer-property] - * dailyReportList + * dailyReportList, monthlyWorkingReportList * * * @author DBFlute(AutoGenerator) @@ -82,18 +83,9 @@ /** STATUS: {NotNull : INTEGER : Default=[1]} */ protected Integer _status; - /** WORKING_DAYS: {NotNull : DOUBLE : Default=[0]} */ - protected java.math.BigDecimal _workingDays; - /** STD_WORKING_DAYS: {NotNull : DOUBLE : Default=[0]} */ protected java.math.BigDecimal _stdWorkingDays; - /** HOLIDAYS: {NotNull : DOUBLE : Default=[0]} */ - protected java.math.BigDecimal _holidays; - - /** PAID_HOLIDAYS: {NotNull : DOUBLE : Default=[0]} */ - protected java.math.BigDecimal _paidHolidays; - /** WORKING_TIME: {NotNull : BIGINT : Default=[0]} */ protected Long _workingTime; @@ -243,6 +235,38 @@ _childrenDailyReportList = dailyReportList; } + // /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + // Referrer Property = [monthlyWorkingReportList] + // * * * * * * * * */ + /** MONTHLY_WORKING_REPORT as 'monthlyWorkingReportList'. */ + protected List _childrenMonthlyWorkingReportList; + + /** + * MONTHLY_WORKING_REPORT as 'monthlyWorkingReportList'. {without lazy-load} + *
    + * + * @return The entity list of referrer property 'monthlyWorkingReportList'. + * (NotNull: If it's not loaded yet, initializes the list instance + * of referrer as empty and returns it.) + */ + public List getMonthlyWorkingReportList() { + if (_childrenMonthlyWorkingReportList == null) { + _childrenMonthlyWorkingReportList = new ArrayList(); + } + return _childrenMonthlyWorkingReportList; + } + + /** + * MONTHLY_WORKING_REPORT as 'monthlyWorkingReportList'. + * + * @param monthlyWorkingReportList The entity list of referrer property + * 'monthlyWorkingReportList'. (Nullable) + */ + public void setMonthlyWorkingReportList( + List monthlyWorkingReportList) { + _childrenMonthlyWorkingReportList = monthlyWorkingReportList; + } + //========================================================================== // ========= // Determination @@ -325,10 +349,7 @@ sb.append(delimiter).append(getYear()); sb.append(delimiter).append(getMonth()); sb.append(delimiter).append(getStatus()); - sb.append(delimiter).append(getWorkingDays()); sb.append(delimiter).append(getStdWorkingDays()); - sb.append(delimiter).append(getHolidays()); - sb.append(delimiter).append(getPaidHolidays()); sb.append(delimiter).append(getWorkingTime()); sb.append(delimiter).append(getStdWorkingTime()); sb.append(delimiter).append(getOverTime()); @@ -442,28 +463,6 @@ } /** The column annotation for S2Dao. {NotNull : DOUBLE : Default=[0]} */ - public static final String workingDays_COLUMN = "WORKING_DAYS"; - - /** - * WORKING_DAYS: {NotNull : DOUBLE : Default=[0]}
    - * - * @return The value of the column 'WORKING_DAYS'. (Nullable) - */ - public java.math.BigDecimal getWorkingDays() { - return _workingDays; - } - - /** - * WORKING_DAYS: {NotNull : DOUBLE : Default=[0]}
    - * - * @param workingDays The value of the column 'WORKING_DAYS'. (Nullable) - */ - public void setWorkingDays(java.math.BigDecimal workingDays) { - _modifiedProperties.addPropertyName("workingDays"); - this._workingDays = workingDays; - } - - /** The column annotation for S2Dao. {NotNull : DOUBLE : Default=[0]} */ public static final String stdWorkingDays_COLUMN = "STD_WORKING_DAYS"; /** @@ -486,50 +485,6 @@ this._stdWorkingDays = stdWorkingDays; } - /** The column annotation for S2Dao. {NotNull : DOUBLE : Default=[0]} */ - public static final String holidays_COLUMN = "HOLIDAYS"; - - /** - * HOLIDAYS: {NotNull : DOUBLE : Default=[0]}
    - * - * @return The value of the column 'HOLIDAYS'. (Nullable) - */ - public java.math.BigDecimal getHolidays() { - return _holidays; - } - - /** - * HOLIDAYS: {NotNull : DOUBLE : Default=[0]}
    - * - * @param holidays The value of the column 'HOLIDAYS'. (Nullable) - */ - public void setHolidays(java.math.BigDecimal holidays) { - _modifiedProperties.addPropertyName("holidays"); - this._holidays = holidays; - } - - /** The column annotation for S2Dao. {NotNull : DOUBLE : Default=[0]} */ - public static final String paidHolidays_COLUMN = "PAID_HOLIDAYS"; - - /** - * PAID_HOLIDAYS: {NotNull : DOUBLE : Default=[0]}
    - * - * @return The value of the column 'PAID_HOLIDAYS'. (Nullable) - */ - public java.math.BigDecimal getPaidHolidays() { - return _paidHolidays; - } - - /** - * PAID_HOLIDAYS: {NotNull : DOUBLE : Default=[0]}
    - * - * @param paidHolidays The value of the column 'PAID_HOLIDAYS'. (Nullable) - */ - public void setPaidHolidays(java.math.BigDecimal paidHolidays) { - _modifiedProperties.addPropertyName("paidHolidays"); - this._paidHolidays = paidHolidays; - } - /** The column annotation for S2Dao. {NotNull : BIGINT : Default=[0]} */ public static final String workingTime_COLUMN = "WORKING_TIME"; Added: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/bsentity/BsMonthlyWorkingReport.java =================================================================== --- timecard/trunk/src/main/java/jp/sf/pal/timecard/db/bsentity/BsMonthlyWorkingReport.java (rev 0) +++ timecard/trunk/src/main/java/jp/sf/pal/timecard/db/bsentity/BsMonthlyWorkingReport.java 2008-12-02 03:38:50 UTC (rev 1493) @@ -0,0 +1,386 @@ +package jp.sf.pal.timecard.db.bsentity; + +import java.util.Set; + +import jp.sf.pal.timecard.db.allcommon.Entity; +import jp.sf.pal.timecard.db.allcommon.dbmeta.DBMeta; +import jp.sf.pal.timecard.db.allcommon.dbmeta.DBMetaInstanceHandler; +import jp.sf.pal.timecard.db.exentity.MonthlyReport; +import jp.sf.pal.timecard.db.exentity.WorkingType; + +/** + * The entity of MONTHLY_WORKING_REPORT that the type is TABLE.
    + * + *
    + * [primary-key]
    + *     ID
    + * 
    + * [column]
    + *     ID, VALUE, MONTHLY_REPORT_ID, WORKING_TYPE_ID
    + * 
    + * [sequence]
    + *     
    + * 
    + * [identity]
    + *     ID
    + * 
    + * [version-no]
    + *     
    + * 
    + * [foreign-table]
    + *     MONTHLY_REPORT, WORKING_TYPE
    + * 
    + * [referrer-table]
    + *     
    + * 
    + * [foreign-property]
    + *     monthlyReport, workingType
    + * 
    + * [referrer-property]
    + * 
    + * 
    + * + * @author DBFlute(AutoGenerator) + */ + ¡÷ SuppressWarnings("unchecked") +public abstract class BsMonthlyWorkingReport implements Entity, + java.io.Serializable { + + //========================================================================== + // ========= + // Definition + // ========== + /** Serial version UID. (Default) */ + private static final long serialVersionUID = 1L; + + /** TABLE-Annotation for S2Dao. The value is MONTHLY_WORKING_REPORT. */ + public static final String TABLE = "MONTHLY_WORKING_REPORT"; + + /** ID-Annotation */ + public static final String id_ID = "identity"; + + //========================================================================== + // ========= + // Attribute + // ========= + // ----------------------------------------------------- + // Column + // ------ + /** ID: {PK : ID : NotNull : BIGINT} */ + protected Long _id; + + /** VALUE: {NotNull : DOUBLE} */ + protected java.math.BigDecimal _value; + + /** MONTHLY_REPORT_ID: {NotNull : BIGINT : FK to MONTHLY_REPORT} */ + protected Long _monthlyReportId; + + /** WORKING_TYPE_ID: {NotNull : INTEGER : FK to WORKING_TYPE} */ + protected Integer _workingTypeId; + + // ----------------------------------------------------- + // Internal + // -------- + /** The attribute of entity modified properties. (for S2Dao) */ + protected EntityModifiedProperties _modifiedProperties = newEntityModifiedProperties(); + + //========================================================================== + // ========= + // Constructor + // =========== + public BsMonthlyWorkingReport() { + } + + //========================================================================== + // ========= + // Table Name + // ========== + public String getTableDbName() { + return "MONTHLY_WORKING_REPORT"; + } + + public String getTablePropertyName() {// as JavaBeansRule + return "monthlyWorkingReport"; + } + + //========================================================================== + // ========= + // DBMeta + // ====== + public DBMeta getDBMeta() { + return DBMetaInstanceHandler.findDBMeta(getTableDbName()); + } + + //========================================================================== + // ========= + // Classification Classifying + // ========================== + //========================================================================== + // ========= + // Classification Determination + // ============================ + //========================================================================== + // ========= + // Classification Name/Alias + // ========================= + //========================================================================== + // ========= + // Foreign Property + // ================ + // /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + // Foreign Property = [monthlyReport] + // * * * * * * * * */ + public static final int monthlyReport_RELNO = 0; + + public static final String monthlyReport_RELKEYS = "MONTHLY_REPORT_ID:ID"; + + /** MONTHLY_REPORT as 'monthlyReport'. */ + protected MonthlyReport _parentMonthlyReport; + + /** + * MONTHLY_REPORT as 'monthlyReport'. {without lazy-load} + * + * @return The entity of foreign property 'monthlyReport'. (Nullable: If the + * foreign key does not have 'NotNull' constraint, please check + * null.) + */ + public MonthlyReport getMonthlyReport() { + return _parentMonthlyReport; + } + + /** + * MONTHLY_REPORT as 'monthlyReport'. + * + * @param monthlyReport The entity of foreign property 'monthlyReport'. + * (Nullable) + */ + public void setMonthlyReport(MonthlyReport monthlyReport) { + _parentMonthlyReport = monthlyReport; + } + + // /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + // Foreign Property = [workingType] + // * * * * * * * * */ + public static final int workingType_RELNO = 1; + + public static final String workingType_RELKEYS = "WORKING_TYPE_ID:ID"; + + /** WORKING_TYPE as 'workingType'. */ + protected WorkingType _parentWorkingType; + + /** + * WORKING_TYPE as 'workingType'. {without lazy-load} + * + * @return The entity of foreign property 'workingType'. (Nullable: If the + * foreign key does not have 'NotNull' constraint, please check + * null.) + */ + public WorkingType getWorkingType() { + return _parentWorkingType; + } + + /** + * WORKING_TYPE as 'workingType'. + * + * @param workingType The entity of foreign property 'workingType'. + * (Nullable) + */ + public void setWorkingType(WorkingType workingType) { + _parentWorkingType = workingType; + } + + //========================================================================== + // ========= + // Referrer Property + // ================= + + //========================================================================== + // ========= + // Determination + // ============= + public boolean hasPrimaryKeyValue() { + if (_id == null) { + return false; + } + return true; + } + + //========================================================================== + // ========= + // Modified Properties + // =================== + public Set 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 BsMonthlyWorkingReport)) { + return false; + } + BsMonthlyWorkingReport otherEntity = (BsMonthlyWorkingReport) 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(getValue()); + sb.append(delimiter).append(getMonthlyReportId()); + sb.append(delimiter).append(getWorkingTypeId()); + 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}
    + * + * @return The value of the column 'ID'. (Nullable) + */ + public Long getId() { + return _id; + } + + /** + * ID: {PK : ID : NotNull : BIGINT}
    + * + * @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 : DOUBLE} */ + public static final String value_COLUMN = "VALUE"; + + /** + * VALUE: {NotNull : DOUBLE}
    + * + * @return The value of the column 'VALUE'. (Nullable) + */ + public java.math.BigDecimal getValue() { + return _value; + } + + /** + * VALUE: {NotNull : DOUBLE}
    + * + * @param value The value of the column 'VALUE'. (Nullable) + */ + public void setValue(java.math.BigDecimal value) { + _modifiedProperties.addPropertyName("value"); + this._value = value; + } + + /** + * The column annotation for S2Dao. {NotNull : BIGINT : FK to + * MONTHLY_REPORT} + */ + public static final String monthlyReportId_COLUMN = "MONTHLY_REPORT_ID"; + + /** + * MONTHLY_REPORT_ID: {NotNull : BIGINT : FK to MONTHLY_REPORT}
    + * + * @return The value of the column 'MONTHLY_REPORT_ID'. (Nullable) + */ + public Long getMonthlyReportId() { + return _monthlyReportId; + } + + /** + * MONTHLY_REPORT_ID: {NotNull : BIGINT : FK to MONTHLY_REPORT}
    + * + * @param monthlyReportId The value of the column 'MONTHLY_REPORT_ID'. + * (Nullable) + */ + public void setMonthlyReportId(Long monthlyReportId) { + _modifiedProperties.addPropertyName("monthlyReportId"); + this._monthlyReportId = monthlyReportId; + } + + /** + * The column annotation for S2Dao. {NotNull : INTEGER : FK to WORKING_TYPE} + */ + public static final String workingTypeId_COLUMN = "WORKING_TYPE_ID"; + + /** + * WORKING_TYPE_ID: {NotNull : INTEGER : FK to WORKING_TYPE}
    + * + * @return The value of the column 'WORKING_TYPE_ID'. (Nullable) + */ + public Integer getWorkingTypeId() { + return _workingTypeId; + } + + /** + * WORKING_TYPE_ID: {NotNull : INTEGER : FK to WORKING_TYPE}
    + * + * @param workingTypeId The value of the column 'WORKING_TYPE_ID'. + * (Nullable) + */ + public void setWorkingTypeId(Integer workingTypeId) { + _modifiedProperties.addPropertyName("workingTypeId"); + this._workingTypeId = workingTypeId; + } + +} Property changes on: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/bsentity/BsMonthlyWorkingReport.java ___________________________________________________________________ Name: svn:eol-style + native Added: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/bsentity/BsWorkingType.java =================================================================== --- timecard/trunk/src/main/java/jp/sf/pal/timecard/db/bsentity/BsWorkingType.java (rev 0) +++ timecard/trunk/src/main/java/jp/sf/pal/timecard/db/bsentity/BsWorkingType.java 2008-12-02 03:38:50 UTC (rev 1493) @@ -0,0 +1,559 @@ +package jp.sf.pal.timecard.db.bsentity; + +import java.util.ArrayList; +import java.util.List; +import java.util.Set; + +import jp.sf.pal.timecard.db.allcommon.Entity; +import jp.sf.pal.timecard.db.allcommon.dbmeta.DBMeta; +import jp.sf.pal.timecard.db.allcommon.dbmeta.DBMetaInstanceHandler; +import jp.sf.pal.timecard.db.exentity.MonthlyWorkingReport; + +/** + * The entity of WORKING_TYPE that the type is TABLE.
    + * + *
    + * [primary-key]
    + *     ID
    + * 
    + * [column]
    + *     ID, NAME, VALUE, TYPE, PARENT_ID, CREATED_TIME, CREATED_BY, UPDATED_TIME, UPDATED_BY, DELETED_TIME, DELETED_BY, VERSIONNO
    + * 
    + * [sequence]
    + *     
    + * 
    + * [identity]
    + *     ID
    + * 
    + * [version-no]
    + *     VERSIONNO
    + * 
    + * [foreign-table]
    + *     
    + * 
    + * [referrer-table]
    + *     MONTHLY_WORKING_REPORT
    + * 
    + * [foreign-property]
    + *     
    + * 
    + * [referrer-property]
    + *     monthlyWorkingReportList
    + * 
    + * + * @author DBFlute(AutoGenerator) + */ + ¡÷ SuppressWarnings("unchecked") +public abstract class BsWorkingType implements Entity, java.io.Serializable { + + //========================================================================== + // ========= + // Definition + // ========== + /** Serial version UID. (Default) */ + private static final long serialVersionUID = 1L; + + /** TABLE-Annotation for S2Dao. The value is WORKING_TYPE. */ + public static final String TABLE = "WORKING_TYPE"; + + /** 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 : INTEGER} */ + protected Integer _id; + + /** NAME: {NotNull : VARCHAR(100)} */ + protected String _name; + + /** VALUE: {NotNull : INTEGER} */ + protected Integer _value; + + /** TYPE: {NotNull : VARCHAR(10)} */ + protected String _type; + + /** PARENT_ID: {INTEGER : Default=[1]} */ + protected Integer _parentId; + + /** 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 : Default=[0]} */ + protected Integer _versionno; + + // ----------------------------------------------------- + // Internal + // -------- + /** The attribute of entity modified properties. (for S2Dao) */ + protected EntityModifiedProperties _modifiedProperties = newEntityModifiedProperties(); + + //========================================================================== + // ========= + // Constructor + // =========== + public BsWorkingType() { + } + + //========================================================================== + // ========= + // Table Name + // ========== + public String getTableDbName() { + return "WORKING_TYPE"; + } + + public String getTablePropertyName() {// as JavaBeansRule + return "workingType"; + } + + //========================================================================== + // ========= + // DBMeta + // ====== + public DBMeta getDBMeta() { + return DBMetaInstanceHandler.findDBMeta(getTableDbName()); + } + + //========================================================================== + // ========= + // Classification Classifying + // ========================== + //========================================================================== + // ========= + // Classification Determination + // ============================ + //========================================================================== + // ========= + // Classification Name/Alias + // ========================= + //========================================================================== + // ========= + // Foreign Property + // ================ + //========================================================================== + // ========= + // Referrer Property + // ================= + // /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + // Referrer Property = [monthlyWorkingReportList] + // * * * * * * * * */ + /** MONTHLY_WORKING_REPORT as 'monthlyWorkingReportList'. */ + protected List _childrenMonthlyWorkingReportList; + + /** + * MONTHLY_WORKING_REPORT as 'monthlyWorkingReportList'. {without lazy-load} + *
    + * + * @return The entity list of referrer property 'monthlyWorkingReportList'. + * (NotNull: If it's not loaded yet, initializes the list instance + * of referrer as empty and returns it.) + */ + public List getMonthlyWorkingReportList() { + if (_childrenMonthlyWorkingReportList == null) { + _childrenMonthlyWorkingReportList = new ArrayList(); + } + return _childrenMonthlyWorkingReportList; + } + + /** + * MONTHLY_WORKING_REPORT as 'monthlyWorkingReportList'. + * + * @param monthlyWorkingReportList The entity list of referrer property + * 'monthlyWorkingReportList'. (Nullable) + */ + public void setMonthlyWorkingReportList( + List monthlyWorkingReportList) { + _childrenMonthlyWorkingReportList = monthlyWorkingReportList; + } + + //========================================================================== + // ========= + // Determination + // ============= + public boolean hasPrimaryKeyValue() { + if (_id == null) { + return false; + } + return true; + } + + //========================================================================== + // ========= + // Modified Properties + // =================== + public Set 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 BsWorkingType)) { + return false; + } + BsWorkingType otherEntity = (BsWorkingType) 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(getName()); + sb.append(delimiter).append(getValue()); + sb.append(delimiter).append(getType()); + sb.append(delimiter).append(getParentId()); + 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 : INTEGER} */ + public static final String id_COLUMN = "ID"; + + /** + * ID: {PK : ID : NotNull : INTEGER}
    + * + * @return The value of the column 'ID'. (Nullable) + */ + public Integer getId() { + return _id; + } + + /** + * ID: {PK : ID : NotNull : INTEGER}
    + * + * @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(100)} */ + public static final String name_COLUMN = "NAME"; + + /** + * NAME: {NotNull : VARCHAR(100)}
    + * + * @return The value of the column 'NAME'. (Nullable) + */ + public String getName() { + return _name; + } + + /** + * NAME: {NotNull : VARCHAR(100)}
    + * + * @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. {NotNull : INTEGER} */ + public static final String value_COLUMN = "VALUE"; + + /** + * VALUE: {NotNull : INTEGER}
    + * + * @return The value of the column 'VALUE'. (Nullable) + */ + public Integer getValue() { + return _value; + } + + /** + * VALUE: {NotNull : INTEGER}
    + * + * @param value The value of the column 'VALUE'. (Nullable) + */ + public void setValue(Integer value) { + _modifiedProperties.addPropertyName("value"); + this._value = value; + } + + /** The column annotation for S2Dao. {NotNull : VARCHAR(10)} */ + public static final String type_COLUMN = "TYPE"; + + /** + * TYPE: {NotNull : VARCHAR(10)}
    + * + * @return The value of the column 'TYPE'. (Nullable) + */ + public String getType() { + return _type; + } + + /** + * TYPE: {NotNull : VARCHAR(10)}
    + * + * @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. {INTEGER : Default=[1]} */ + public static final String parentId_COLUMN = "PARENT_ID"; + + /** + * PARENT_ID: {INTEGER : Default=[1]}
    + * + * @return The value of the column 'PARENT_ID'. (Nullable) + */ + public Integer getParentId() { + return _parentId; + } + + /** + * PARENT_ID: {INTEGER : Default=[1]}
    + * + * @param parentId The value of the column 'PARENT_ID'. (Nullable) + */ + public void setParentId(Integer parentId) { + _modifiedProperties.addPropertyName("parentId"); + this._parentId = parentId; + } + + /** The column annotation for S2Dao. {NotNull : TIMESTAMP} */ + public static final String createdTime_COLUMN = "CREATED_TIME"; + + /** + * CREATED_TIME: {NotNull : TIMESTAMP}
    + * + * @return The value of the column 'CREATED_TIME'. (Nullable) + */ + public java.sql.Timestamp getCreatedTime() { + return _createdTime; + } + + /** + * CREATED_TIME: {NotNull : TIMESTAMP}
    + * + * @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)}
    + * + * @return The value of the column 'CREATED_BY'. (Nullable) + */ + public String getCreatedBy() { + return _createdBy; + } + + /** + * CREATED_BY: {NotNull : VARCHAR(255)}
    + * + * @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}
    + * + * @return The value of the column 'UPDATED_TIME'. (Nullable) + */ + public java.sql.Timestamp getUpdatedTime() { + return _updatedTime; + } + + /** + * UPDATED_TIME: {NotNull : TIMESTAMP}
    + * + * @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)}
    + * + * @return The value of the column 'UPDATED_BY'. (Nullable) + */ + public String getUpdatedBy() { + return _updatedBy; + } + + /** + * UPDATED_BY: {NotNull : VARCHAR(255)}
    + * + * @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}
    + * + * @return The value of the column 'DELETED_TIME'. (Nullable) + */ + public java.sql.Timestamp getDeletedTime() { + return _deletedTime; + } + + /** + * DELETED_TIME: {TIMESTAMP}
    + * + * @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)}
    + * + * @return The value of the column 'DELETED_BY'. (Nullable) + */ + public String getDeletedBy() { + return _deletedBy; + } + + /** + * DELETED_BY: {VARCHAR(255)}
    + * + * @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 : Default=[0]} */ + public static final String versionno_COLUMN = "VERSIONNO"; + + /** + * VERSIONNO: {NotNull : INTEGER : Default=[0]}
    + * + * @return The value of the column 'VERSIONNO'. (Nullable) + */ + public Integer getVersionno() { + return _versionno; + } + + /** + * VERSIONNO: {NotNull : INTEGER : Default=[0]}
    + * + * @param versionno The value of the column 'VERSIONNO'. (Nullable) + */ + public void setVersionno(Integer versionno) { + _modifiedProperties.addPropertyName("versionno"); + this._versionno = versionno; + } + +} Property changes on: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/bsentity/BsWorkingType.java ___________________________________________________________________ Name: svn:eol-style + native Modified: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/bsentity/dbmeta/EmployeeDbm.java =================================================================== --- timecard/trunk/src/main/java/jp/sf/pal/timecard/db/bsentity/dbmeta/EmployeeDbm.java 2008-12-01 14:26:07 UTC (rev 1492) +++ timecard/trunk/src/main/java/jp/sf/pal/timecard/db/bsentity/dbmeta/EmployeeDbm.java 2008-12-02 03:38:50 UTC (rev 1493) @@ -57,9 +57,6 @@ protected ColumnInfo _columnManager = cci("MANAGER", "manager", String.class, false, 255, 0); - protected ColumnInfo _columnPaidHolidays = cci("PAID_HOLIDAYS", - "paidHolidays", java.math.BigDecimal.class, false, null, null); - protected ColumnInfo _columnIsAvailable = cci("IS_AVAILABLE", "isAvailable", String.class, false, 1, 0); @@ -96,10 +93,6 @@ return _columnManager; } - public ColumnInfo columnPaidHolidays() { - return _columnPaidHolidays; - } - public ColumnInfo columnIsAvailable() { return _columnIsAvailable; } @@ -347,7 +340,6 @@ setupEps(_epsMap, new EpsId(), columnId()); setupEps(_epsMap, new EpsUsername(), columnUsername()); setupEps(_epsMap, new EpsManager(), columnManager()); - setupEps(_epsMap, new EpsPaidHolidays(), columnPaidHolidays()); setupEps(_epsMap, new EpsIsAvailable(), columnIsAvailable()); setupEps(_epsMap, new EpsCreatedTime(), columnCreatedTime()); setupEps(_epsMap, new EpsCreatedBy(), columnCreatedBy()); @@ -385,12 +377,6 @@ } } - public static class EpsPaidHolidays implements Eps { - public void setup(Employee e, Object v) { - e.setPaidHolidays((java.math.BigDecimal) v); - } - } - public static class EpsIsAvailable implements Eps { public void setup(Employee e, Object v) { e.setIsAvailable((String) v); Modified: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/bsentity/dbmeta/MonthlyReportDbm.java =================================================================== --- timecard/trunk/src/main/java/jp/sf/pal/timecard/db/bsentity/dbmeta/MonthlyReportDbm.java 2008-12-01 14:26:07 UTC (rev 1492) +++ timecard/trunk/src/main/java/jp/sf/pal/timecard/db/bsentity/dbmeta/MonthlyReportDbm.java 2008-12-02 03:38:50 UTC (rev 1493) @@ -60,18 +60,9 @@ protected ColumnInfo _columnStatus = cci("STATUS", "status", Integer.class, false, null, null); - protected ColumnInfo _columnWorkingDays = cci("WORKING_DAYS", - "workingDays", java.math.BigDecimal.class, false, null, null); - protected ColumnInfo _columnStdWorkingDays = cci("STD_WORKING_DAYS", "stdWorkingDays", java.math.BigDecimal.class, false, null, null); - protected ColumnInfo _columnHolidays = cci("HOLIDAYS", "holidays", - java.math.BigDecimal.class, false, null, null); - - protected ColumnInfo _columnPaidHolidays = cci("PAID_HOLIDAYS", - "paidHolidays", java.math.BigDecimal.class, false, null, null); - protected ColumnInfo _columnWorkingTime = cci("WORKING_TIME", "workingTime", Long.class, false, null, null); @@ -124,22 +115,10 @@ return _columnStatus; } - public ColumnInfo columnWorkingDays() { - return _columnWorkingDays; - } - public ColumnInfo columnStdWorkingDays() { return _columnStdWorkingDays; } - public ColumnInfo columnHolidays() { - return _columnHolidays; - } - - public ColumnInfo columnPaidHolidays() { - return _columnPaidHolidays; - } - public ColumnInfo columnWorkingTime() { return _columnWorkingTime; } @@ -304,6 +283,13 @@ false); } + public ReferrerInfo referrerMonthlyWorkingReportList() { + Map map = newLinkedHashMap(columnId(), + MonthlyWorkingReportDbm.getInstance().columnMonthlyReportId()); + return cri("monthlyWorkingReportList", this, MonthlyWorkingReportDbm + .getInstance(), map, false); + } + //========================================================================== // ========= // Various Info @@ -396,10 +382,7 @@ setupEps(_epsMap, new EpsYear(), columnYear()); setupEps(_epsMap, new EpsMonth(), columnMonth()); setupEps(_epsMap, new EpsStatus(), columnStatus()); - setupEps(_epsMap, new EpsWorkingDays(), columnWorkingDays()); setupEps(_epsMap, new EpsStdWorkingDays(), columnStdWorkingDays()); - setupEps(_epsMap, new EpsHolidays(), columnHolidays()); - setupEps(_epsMap, new EpsPaidHolidays(), columnPaidHolidays()); setupEps(_epsMap, new EpsWorkingTime(), columnWorkingTime()); setupEps(_epsMap, new EpsStdWorkingTime(), columnStdWorkingTime()); setupEps(_epsMap, new EpsOverTime(), columnOverTime()); @@ -447,30 +430,12 @@ } } - public static class EpsWorkingDays implements Eps { - public void setup(MonthlyReport e, Object v) { - e.setWorkingDays((java.math.BigDecimal) v); - } - } - public static class EpsStdWorkingDays implements Eps { public void setup(MonthlyReport e, Object v) { e.setStdWorkingDays((java.math.BigDecimal) v); } } - public static class EpsHolidays implements Eps { - public void setup(MonthlyReport e, Object v) { - e.setHolidays((java.math.BigDecimal) v); - } - } - - public static class EpsPaidHolidays implements Eps { - public void setup(MonthlyReport e, Object v) { - e.setPaidHolidays((java.math.BigDecimal) v); - } - } - public static class EpsWorkingTime implements Eps { public void setup(MonthlyReport e, Object v) { e.setWorkingTime((Long) v); Added: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/bsentity/dbmeta/MonthlyWorkingReportDbm.java =================================================================== --- timecard/trunk/src/main/java/jp/sf/pal/timecard/db/bsentity/dbmeta/MonthlyWorkingReportDbm.java (rev 0) +++ timecard/trunk/src/main/java/jp/sf/pal/timecard/db/bsentity/dbmeta/MonthlyWorkingReportDbm.java 2008-12-02 03:38:50 UTC (rev 1493) @@ -0,0 +1,319 @@ +package jp.sf.pal.timecard.db.bsentity.dbmeta; + +import java.util.List; +import java.util.Map; + +import jp.sf.pal.timecard.db.allcommon.Entity; +import jp.sf.pal.timecard.db.allcommon.dbmeta.AbstractDBMeta; +import jp.sf.pal.timecard.db.allcommon.dbmeta.info.ColumnInfo; +import jp.sf.pal.timecard.db.allcommon.dbmeta.info.ForeignInfo; +import jp.sf.pal.timecard.db.allcommon.dbmeta.info.UniqueInfo; +import jp.sf.pal.timecard.db.exentity.MonthlyWorkingReport; + +/** + * The DB meta of MONTHLY_WORKING_REPORT. (Singleton) + * + * @author DBFlute(AutoGenerator) + */ + ¡÷ SuppressWarnings("unchecked") +public class MonthlyWorkingReportDbm extends AbstractDBMeta { + + private static final MonthlyWorkingReportDbm _instance = new MonthlyWorkingReportDbm(); + + private MonthlyWorkingReportDbm() { + } + + public static MonthlyWorkingReportDbm getInstance() { + return _instance; + } + + //========================================================================== + // ========= + // Table Info + // ========== + public String getTableDbName() { + return "MONTHLY_WORKING_REPORT"; + } + + public String getTablePropertyName() { + return "monthlyWorkingReport"; + } + + public String getTableSqlName() { + return "MONTHLY_WORKING_REPORT"; + } + + //========================================================================== + // ========= + // Column Info + // =========== + protected ColumnInfo _columnId = cci("ID", "id", Long.class, true, null, + null); + + protected ColumnInfo _columnValue = cci("VALUE", "value", + java.math.BigDecimal.class, false, null, null); + + protected ColumnInfo _columnMonthlyReportId = cci("MONTHLY_REPORT_ID", + "monthlyReportId", Long.class, false, null, null); + + protected ColumnInfo _columnWorkingTypeId = cci("WORKING_TYPE_ID", + "workingTypeId", Integer.class, false, null, null); + + public ColumnInfo columnId() { + return _columnId; + } + + public ColumnInfo columnValue() { + return _columnValue; + } + + public ColumnInfo columnMonthlyReportId() { + return _columnMonthlyReportId; + } + + public ColumnInfo columnWorkingTypeId() { + return _columnWorkingTypeId; + } + + { + initializeColumnInfoList(); + } + + //========================================================================== + // ========= + // Name Map + // ======== + public Map getDbNamePropertyNameKeyToLowerMap() { + return createDbNamePropertyNameKeyToLowerMap(); + } + + public Map getPropertyNameDbNameKeyToLowerMap() { + return createPropertyNameDbNameKeyToLowerMap(); + } + + protected static Map _dbNamePropertyNameKeyToLowerMap; + + protected Map createDbNamePropertyNameKeyToLowerMap() { + if (_dbNamePropertyNameKeyToLowerMap == null) { + _dbNamePropertyNameKeyToLowerMap = setupKeyToLowerMap(true); + } + return _dbNamePropertyNameKeyToLowerMap; + } + + protected static Map _propertyNameDbNameKeyToLowerMap; + + protected Map createPropertyNameDbNameKeyToLowerMap() { + if (_propertyNameDbNameKeyToLowerMap == null) { + _propertyNameDbNameKeyToLowerMap = setupKeyToLowerMap(false); + } + return _propertyNameDbNameKeyToLowerMap; + } + + //========================================================================== + // ========= + // Type Name + // ========= + public String getEntityTypeName() { + return "jp.sf.pal.timecard.db.exentity.MonthlyWorkingReport"; + } + + public String getConditionBeanTypeName() { + return "jp.sf.pal.timecard.db.cbean.bs.MonthlyWorkingReportCB"; + } + + public String getDaoTypeName() { + return "jp.sf.pal.timecard.db.exdao.MonthlyWorkingReportDao"; + } + + public String getBehaviorTypeName() { + return "jp.sf.pal.timecard.db.exbhv.MonthlyWorkingReportBhv"; + } + + //========================================================================== + // ========= + // Object Type + // =========== + public Class getEntityType() { + return MonthlyWorkingReport.class; + } + + //========================================================================== + // ========= + // Object Instance + // =============== + public Entity newEntity() { + return newMyEntity(); + } + + public MonthlyWorkingReport newMyEntity() { + return new MonthlyWorkingReport(); + } + + //========================================================================== + // ========= + // 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 foreignMonthlyReport() { + Map map = newLinkedHashMap( + columnMonthlyReportId(), MonthlyReportDbm.getInstance() + .columnId()); + return cfi("monthlyReport", this, MonthlyReportDbm.getInstance(), map, + 0, false); + } + + public ForeignInfo foreignWorkingType() { + Map map = newLinkedHashMap( + columnWorkingTypeId(), WorkingTypeDbm.getInstance().columnId()); + return cfi("workingType", this, WorkingTypeDbm.getInstance(), map, 1, + false); + } + + // ----------------------------------------------------- + // Referrer Property + // ----------------- + + //========================================================================== + // ========= + // Various Info + // ============ + + //========================================================================== + // ========= + // Entity Handling + // =============== + // ----------------------------------------------------- + // Accept + // ------ + public void acceptPrimaryKeyMap(Entity entity, + Map primaryKeyMap) { + doAcceptPrimaryKeyMap((MonthlyWorkingReport) entity, primaryKeyMap, + _epsMap); + } + + public void acceptPrimaryKeyMapString(Entity entity, + String primaryKeyMapString) { + MapStringUtil.acceptPrimaryKeyMapString(primaryKeyMapString, entity); + } + + public void acceptColumnValueMap(Entity entity, + Map columnValueMap) { + doAcceptColumnValueMap((MonthlyWorkingReport) 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 convertToColumnValueList(Entity entity) { + return newArrayList(convertToColumnValueMap(entity).values()); + } + + public Map convertToColumnValueMap(Entity entity) { + return doConvertToColumnValueMap(entity); + } + + public List convertToColumnStringValueList(Entity entity) { + return newArrayList(convertToColumnStringValueMap(entity).values()); + } + + public Map convertToColumnStringValueMap(Entity entity) { + return doConvertToColumnStringValueMap(entity); + } + + //========================================================================== + // ========= + // Entity Property Setup + // ===================== + // It's very INTERNAL! + protected Map> _epsMap = newHashMap(); + { + setupEps(_epsMap, new EpsId(), columnId()); + setupEps(_epsMap, new EpsValue(), columnValue()); + setupEps(_epsMap, new EpsMonthlyReportId(), columnMonthlyReportId()); + setupEps(_epsMap, new EpsWorkingTypeId(), columnWorkingTypeId()); + } + + public boolean hasEntityPropertySetupper(String propertyName) { + return _epsMap.containsKey(propertyName); + } + + public void setupEntityProperty(String propertyName, Object entity, + Object value) { + findEps(_epsMap, propertyName).setup((MonthlyWorkingReport) entity, + value); + } + + public static class EpsId implements Eps { + public void setup(MonthlyWorkingReport e, Object v) { + e.setId((Long) v); + } + } + + public static class EpsValue implements Eps { + public void setup(MonthlyWorkingReport e, Object v) { + e.setValue((java.math.BigDecimal) v); + } + } + + public static class EpsMonthlyReportId implements Eps { + public void setup(MonthlyWorkingReport e, Object v) { + e.setMonthlyReportId((Long) v); + } + } + + public static class EpsWorkingTypeId implements Eps { + public void setup(MonthlyWorkingReport e, Object v) { + e.setWorkingTypeId((Integer) v); + } + } +} Property changes on: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/bsentity/dbmeta/MonthlyWorkingReportDbm.java ___________________________________________________________________ Name: svn:eol-style + native Added: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/bsentity/dbmeta/WorkingTypeDbm.java =================================================================== --- timecard/trunk/src/main/java/jp/sf/pal/timecard/db/bsentity/dbmeta/WorkingTypeDbm.java (rev 0) +++ timecard/trunk/src/main/java/jp/sf/pal/timecard/db/bsentity/dbmeta/WorkingTypeDbm.java 2008-12-02 03:38:50 UTC (rev 1493) @@ -0,0 +1,427 @@ +package jp.sf.pal.timecard.db.bsentity.dbmeta; + +import java.util.List; +import java.util.Map; + +import jp.sf.pal.timecard.db.allcommon.Entity; +import jp.sf.pal.timecard.db.allcommon.dbmeta.AbstractDBMeta; +import jp.sf.pal.timecard.db.allcommon.dbmeta.info.ColumnInfo; +import jp.sf.pal.timecard.db.allcommon.dbmeta.info.ReferrerInfo; +import jp.sf.pal.timecard.db.allcommon.dbmeta.info.UniqueInfo; +import jp.sf.pal.timecard.db.exentity.WorkingType; + +/** + * The DB meta of WORKING_TYPE. (Singleton) + * + * @author DBFlute(AutoGenerator) + */ + ¡÷ SuppressWarnings("unchecked") +public class WorkingTypeDbm extends AbstractDBMeta { + + private static final WorkingTypeDbm _instance = new WorkingTypeDbm(); + + private WorkingTypeDbm() { + } + + public static WorkingTypeDbm getInstance() { + return _instance; + } + + //========================================================================== + // ========= + // Table Info + // ========== + public String getTableDbName() { + return "WORKING_TYPE"; + } + + public String getTablePropertyName() { + return "workingType"; + } + + public String getTableSqlName() { + return "WORKING_TYPE"; + } + + //========================================================================== + // ========= + // Column Info + // =========== + protected ColumnInfo _columnId = cci("ID", "id", Integer.class, true, null, + null); + + protected ColumnInfo _columnName = cci("NAME", "name", String.class, false, + 100, 0); + + protected ColumnInfo _columnValue = cci("VALUE", "value", Integer.class, + false, null, null); + + protected ColumnInfo _columnType = cci("TYPE", "type", String.class, false, + 10, 0); + + protected ColumnInfo _columnParentId = cci("PARENT_ID", "parentId", + Integer.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 columnName() { + return _columnName; + } + + public ColumnInfo columnValue() { + return _columnValue; + } + + public ColumnInfo columnType() { + return _columnType; + } + + public ColumnInfo columnParentId() { + return _columnParentId; + } + + 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 getDbNamePropertyNameKeyToLowerMap() { + return createDbNamePropertyNameKeyToLowerMap(); + } + + public Map getPropertyNameDbNameKeyToLowerMap() { + return createPropertyNameDbNameKeyToLowerMap(); + } + + protected static Map _dbNamePropertyNameKeyToLowerMap; + + protected Map createDbNamePropertyNameKeyToLowerMap() { + if (_dbNamePropertyNameKeyToLowerMap == null) { + _dbNamePropertyNameKeyToLowerMap = setupKeyToLowerMap(true); + } + return _dbNamePropertyNameKeyToLowerMap; + } + + protected static Map _propertyNameDbNameKeyToLowerMap; + + protected Map createPropertyNameDbNameKeyToLowerMap() { + if (_propertyNameDbNameKeyToLowerMap == null) { + _propertyNameDbNameKeyToLowerMap = setupKeyToLowerMap(false); + } + return _propertyNameDbNameKeyToLowerMap; + } + + //========================================================================== + // ========= + // Type Name + // ========= + public String getEntityTypeName() { + return "jp.sf.pal.timecard.db.exentity.WorkingType"; + } + + public String getConditionBeanTypeName() { + return "jp.sf.pal.timecard.db.cbean.bs.WorkingTypeCB"; + } + + public String getDaoTypeName() { + return "jp.sf.pal.timecard.db.exdao.WorkingTypeDao"; + } + + public String getBehaviorTypeName() { + return "jp.sf.pal.timecard.db.exbhv.WorkingTypeBhv"; + } + + //========================================================================== + // ========= + // Object Type + // =========== + public Class getEntityType() { + return WorkingType.class; + } + + //========================================================================== + // ========= + // Object Instance + // =============== + public Entity newEntity() { + return newMyEntity(); + } + + public WorkingType newMyEntity() { + return new WorkingType(); + } + + //========================================================================== + // ========= + // Unique Info + // =========== + // ----------------------------------------------------- + // Primary Element + // --------------- + public UniqueInfo getPrimaryUniqueInfo() { + return createPrimaryUniqueInfo(columnId()); + } + + public boolean hasPrimaryKey() { + return true; + } + + public boolean hasTwoOrMorePrimaryKeys() { + return false; + } + + //========================================================================== + // ========= + // Relation Info + // ============= + // ----------------------------------------------------- + // Foreign Property + // ---------------- + + // ----------------------------------------------------- + // Referrer Property + // ----------------- + public ReferrerInfo referrerMonthlyWorkingReportList() { + Map map = newLinkedHashMap(columnId(), + MonthlyWorkingReportDbm.getInstance().columnWorkingTypeId()); + return cri("monthlyWorkingReportList", this, MonthlyWorkingReportDbm + .getInstance(), map, false); + } + + //========================================================================== + // ========= + // Various Info + // ============ + public boolean hasVersionNo() { + return true; + } + + public ColumnInfo getVersionNoColumnInfo() { + return _columnVersionno; + } + + //========================================================================== + // ========= + // Entity Handling + // =============== + // ----------------------------------------------------- + // Accept + // ------ + public void acceptPrimaryKeyMap(Entity entity, + Map primaryKeyMap) { + doAcceptPrimaryKeyMap((WorkingType) entity, primaryKeyMap, _epsMap); + } + + public void acceptPrimaryKeyMapString(Entity entity, + String primaryKeyMapString) { + MapStringUtil.acceptPrimaryKeyMapString(primaryKeyMapString, entity); + } + + public void acceptColumnValueMap(Entity entity, + Map columnValueMap) { + doAcceptColumnValueMap((WorkingType) 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 convertToColumnValueList(Entity entity) { + return newArrayList(convertToColumnValueMap(entity).values()); + } + + public Map convertToColumnValueMap(Entity entity) { + return doConvertToColumnValueMap(entity); + } + + public List convertToColumnStringValueList(Entity entity) { + return newArrayList(convertToColumnStringValueMap(entity).values()); + } + + public Map convertToColumnStringValueMap(Entity entity) { + return doConvertToColumnStringValueMap(entity); + } + + //========================================================================== + // ========= + // Entity Property Setup + // ===================== + // It's very INTERNAL! + protected Map> _epsMap = newHashMap(); + { + setupEps(_epsMap, new EpsId(), columnId()); + setupEps(_epsMap, new EpsName(), columnName()); + setupEps(_epsMap, new EpsValue(), columnValue()); + setupEps(_epsMap, new EpsType(), columnType()); + setupEps(_epsMap, new EpsParentId(), columnParentId()); + 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((WorkingType) entity, value); + } + + public static class EpsId implements Eps { + public void setup(WorkingType e, Object v) { + e.setId((Integer) v); + } + } + + public static class EpsName implements Eps { + public void setup(WorkingType e, Object v) { + e.setName((String) v); + } + } + + public static class EpsValue implements Eps { + public void setup(WorkingType e, Object v) { + e.setValue((Integer) v); + } + } + + public static class EpsType implements Eps { + public void setup(WorkingType e, Object v) { + e.setType((String) v); + } + } + + public static class EpsParentId implements Eps { + public void setup(WorkingType e, Object v) { + e.setParentId((Integer) v); + } + } + + public static class EpsCreatedTime implements Eps { + public void setup(WorkingType e, Object v) { + e.setCreatedTime((java.sql.Timestamp) v); + } + } + + public static class EpsCreatedBy implements Eps { + public void setup(WorkingType e, Object v) { + e.setCreatedBy((String) v); + } + } + + public static class EpsUpdatedTime implements Eps { + public void setup(WorkingType e, Object v) { + e.setUpdatedTime((java.sql.Timestamp) v); + } + } + + public static class EpsUpdatedBy implements Eps { + public void setup(WorkingType e, Object v) { + e.setUpdatedBy((String) v); + } + } + + public static class EpsDeletedTime implements Eps { + public void setup(WorkingType e, Object v) { + e.setDeletedTime((java.sql.Timestamp) v); + } + } + + public static class EpsDeletedBy implements Eps { + public void setup(WorkingType e, Object v) { + e.setDeletedBy((String) v); + } + } + + public static class EpsVersionno implements Eps { + public void setup(WorkingType e, Object v) { + e.setVersionno((Integer) v); + } + } +} Property changes on: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/bsentity/dbmeta/WorkingTypeDbm.java ___________________________________________________________________ Name: svn:eol-style + native Added: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/cbean/MonthlyWorkingReportCB.java =================================================================== --- timecard/trunk/src/main/java/jp/sf/pal/timecard/db/cbean/MonthlyWorkingReportCB.java (rev 0) +++ timecard/trunk/src/main/java/jp/sf/pal/timecard/db/cbean/MonthlyWorkingReportCB.java 2008-12-02 03:38:50 UTC (rev 1493) @@ -0,0 +1,15 @@ +package jp.sf.pal.timecard.db.cbean; + +/** + * The condition-bean of MONTHLY_WORKING_REPORT. + *

    + * You can implement your original methods here. This class is NOT overrided + * when re-generating. + *

    + * + * @author DBFlute(AutoGenerator) + */ + ¡÷ SuppressWarnings("unchecked") +public class MonthlyWorkingReportCB extends + jp.sf.pal.timecard.db.cbean.bs.BsMonthlyWorkingReportCB { +} Property changes on: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/cbean/MonthlyWorkingReportCB.java ___________________________________________________________________ Name: svn:eol-style + native Added: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/cbean/WorkingTypeCB.java =================================================================== --- timecard/trunk/src/main/java/jp/sf/pal/timecard/db/cbean/WorkingTypeCB.java (rev 0) +++ timecard/trunk/src/main/java/jp/sf/pal/timecard/db/cbean/WorkingTypeCB.java 2008-12-02 03:38:50 UTC (rev 1493) @@ -0,0 +1,15 @@ +package jp.sf.pal.timecard.db.cbean; + +/** + * The condition-bean of WORKING_TYPE. + *

    + * You can implement your original methods here. This class is NOT overrided + * when re-generating. + *

    + * + * @author DBFlute(AutoGenerator) + */ + ¡÷ SuppressWarnings("unchecked") +public class WorkingTypeCB extends + jp.sf.pal.timecard.db.cbean.bs.BsWorkingTypeCB { +} Property changes on: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/cbean/WorkingTypeCB.java ___________________________________________________________________ Name: svn:eol-style + native Modified: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/cbean/bs/BsEmployeeCB.java =================================================================== --- timecard/trunk/src/main/java/jp/sf/pal/timecard/db/cbean/bs/BsEmployeeCB.java 2008-12-01 14:26:07 UTC (rev 1492) +++ timecard/trunk/src/main/java/jp/sf/pal/timecard/db/cbean/bs/BsEmployeeCB.java 2008-12-02 03:38:50 UTC (rev 1493) @@ -257,10 +257,6 @@ doColumn("MANAGER"); } - public void columnPaidHolidays() { - doColumn("PAID_HOLIDAYS"); - } - public void columnIsAvailable() { doColumn("IS_AVAILABLE"); } Modified: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/cbean/bs/BsMonthlyReportCB.java =================================================================== --- timecard/trunk/src/main/java/jp/sf/pal/timecard/db/cbean/bs/BsMonthlyReportCB.java 2008-12-01 14:26:07 UTC (rev 1492) +++ timecard/trunk/src/main/java/jp/sf/pal/timecard/db/cbean/bs/BsMonthlyReportCB.java 2008-12-02 03:38:50 UTC (rev 1493) @@ -10,6 +10,7 @@ import jp.sf.pal.timecard.db.cbean.DailyReportCB; import jp.sf.pal.timecard.db.cbean.EmployeeCB; import jp.sf.pal.timecard.db.cbean.MonthlyReportCB; +import jp.sf.pal.timecard.db.cbean.MonthlyWorkingReportCB; import jp.sf.pal.timecard.db.cbean.cq.EmployeeCQ; import jp.sf.pal.timecard.db.cbean.cq.MonthlyReportCQ; import jp.sf.pal.timecard.db.cbean.nss.EmployeeNss; @@ -236,22 +237,10 @@ doColumn("STATUS"); } - public void columnWorkingDays() { - doColumn("WORKING_DAYS"); - } - public void columnStdWorkingDays() { doColumn("STD_WORKING_DAYS"); } - public void columnHolidays() { - doColumn("HOLIDAYS"); - } - - public void columnPaidHolidays() { - doColumn("PAID_HOLIDAYS"); - } - public void columnWorkingTime() { doColumn("WORKING_TIME"); } @@ -342,6 +331,19 @@ } }); } + + public RAFunction derivedMonthlyWorkingReportList() { + return new RAFunction( + _baseCB, _myQyCall.qy(), + new RAQSetupper() { + public void setup(String function, + SubQuery subQuery, + MonthlyReportCQ cq, String aliasName) { + cq.xderiveMonthlyWorkingReportList(function, + subQuery, aliasName); + } + }); + } } // Very Internal (for Suppressing Warn about 'Not Use Import') Added: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/cbean/bs/BsMonthlyWorkingReportCB.java =================================================================== --- timecard/trunk/src/main/java/jp/sf/pal/timecard/db/cbean/bs/BsMonthlyWorkingReportCB.java (rev 0) +++ timecard/trunk/src/main/java/jp/sf/pal/timecard/db/cbean/bs/BsMonthlyWorkingReportCB.java 2008-12-02 03:38:50 UTC (rev 1493) @@ -0,0 +1,332 @@ +package jp.sf.pal.timecard.db.cbean.bs; + +import java.util.Map; + +import jp.sf.pal.timecard.db.allcommon.cbean.AbstractConditionBean; +import jp.sf.pal.timecard.db.allcommon.cbean.ConditionBean; +import jp.sf.pal.timecard.db.allcommon.cbean.ConditionQuery; +import jp.sf.pal.timecard.db.allcommon.cbean.SubQuery; +import jp.sf.pal.timecard.db.allcommon.cbean.UnionQuery; +import jp.sf.pal.timecard.db.cbean.MonthlyReportCB; +import jp.sf.pal.timecard.db.cbean.MonthlyWorkingReportCB; +import jp.sf.pal.timecard.db.cbean.WorkingTypeCB; +import jp.sf.pal.timecard.db.cbean.cq.MonthlyReportCQ; +import jp.sf.pal.timecard.db.cbean.cq.MonthlyWorkingReportCQ; +import jp.sf.pal.timecard.db.cbean.cq.WorkingTypeCQ; +import jp.sf.pal.timecard.db.cbean.nss.MonthlyReportNss; +import jp.sf.pal.timecard.db.cbean.nss.WorkingTypeNss; + +/** + * The base condition-bean of MONTHLY_WORKING_REPORT. + * + * @author DBFlute(AutoGenerator) + */ + ¡÷ SuppressWarnings("unchecked") +public class BsMonthlyWorkingReportCB extends AbstractConditionBean { + + //========================================================================== + // ========= + // Attribute + // ========= + protected MonthlyWorkingReportCQ _conditionQuery; + + //========================================================================== + // ========= + // Table Name + // ========== + public String getTableDbName() { + return "MONTHLY_WORKING_REPORT"; + } + + public String getTableSqlName() { + return "MONTHLY_WORKING_REPORT"; + } + + //========================================================================== + // ========= + // PrimaryKey Map + // ============== + public void acceptPrimaryKeyMap(Map 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 MonthlyWorkingReportCQ query() { + return getConditionQuery(); + } + + public MonthlyWorkingReportCQ getConditionQuery() { + if (_conditionQuery == null) { + _conditionQuery = new MonthlyWorkingReportCQ(null, getSqlClause(), + getSqlClause().getLocalTableAliasName(), 0); + } + return _conditionQuery; + } + + public ConditionQuery getConditionQueryAsInterface() { + return getConditionQuery(); + } + + //========================================================================== + // ========= + // Union + // ===== + /** + * Set up 'union'. + * + *
    +     * cb.query().union(new UnionQuery<MonthlyWorkingReportCB>() {
    +     *     public void query(MonthlyWorkingReportCB unionCB) {
    +     *         unionCB.query().setXxx...
    +     *     }
    +     * });
    +     * 
    + * + * @param unionQuery The query of 'union'. (NotNull) + */ + public void union(UnionQuery unionQuery) { + final MonthlyWorkingReportCB cb = new MonthlyWorkingReportCB(); + cb.xsetupForUnion(); + unionQuery.query(cb); + final MonthlyWorkingReportCQ cq = cb.query(); + query().xsetUnionQuery(cq); + } + + /** + * Set up 'union all'. + * + *
    +     * cb.query().unionAll(new UnionQuery<MonthlyWorkingReportCB>() {
    +     *     public void query(MonthlyWorkingReportCB unionCB) {
    +     *         unionCB.query().setXxx...
    +     *     }
    +     * });
    +     * 
    + * + * @param unionQuery The query of 'union'. (NotNull) + */ + public void unionAll(UnionQuery unionQuery) { + final MonthlyWorkingReportCB cb = new MonthlyWorkingReportCB(); + cb.xsetupForUnion(); + unionQuery.query(cb); + final MonthlyWorkingReportCQ cq = cb.query(); + query().xsetUnionAllQuery(cq); + } + + /** + * @param unionQuery The query of 'union'. (NotNull) + * @deprecated Sorry! Please use union(UnionQuery + * unionQuery). + */ + public void union(MonthlyWorkingReportCQ unionQuery) { + query().xsetUnionQuery(unionQuery); + } + + /** + * @param unionQuery The query of 'union'. (NotNull) + * @deprecated Sorry! Please use unionAll(UnionQuery + * unionQuery). + */ + public void unionAll(MonthlyWorkingReportCQ unionQuery) { + query().xsetUnionAllQuery(unionQuery); + } + + public boolean hasUnionQueryOrUnionAllQuery() { + return query().hasUnionQueryOrUnionAllQuery(); + } + + //========================================================================== + // ========= + // Setup Select + // ============ + + protected MonthlyReportNss _nssMonthlyReport; + + public MonthlyReportNss getNssMonthlyReport() { + if (_nssMonthlyReport == null) { + _nssMonthlyReport = new MonthlyReportNss(null); + } + return _nssMonthlyReport; + } + + public MonthlyReportNss setupSelect_MonthlyReport() { + doSetupSelect(new SsCall() { + public ConditionQuery qf() { + return query().queryMonthlyReport(); + } + }); + if (_nssMonthlyReport == null || !_nssMonthlyReport.hasConditionQuery()) { + _nssMonthlyReport = new MonthlyReportNss(query() + .queryMonthlyReport()); + } + return _nssMonthlyReport; + } + + protected WorkingTypeNss _nssWorkingType; + + public WorkingTypeNss getNssWorkingType() { + if (_nssWorkingType == null) { + _nssWorkingType = new WorkingTypeNss(null); + } + return _nssWorkingType; + } + + public WorkingTypeNss setupSelect_WorkingType() { + doSetupSelect(new SsCall() { + public ConditionQuery qf() { + return query().queryWorkingType(); + } + }); + if (_nssWorkingType == null || !_nssWorkingType.hasConditionQuery()) { + _nssWorkingType = new WorkingTypeNss(query().queryWorkingType()); + } + return _nssWorkingType; + } + + // [DBFlute-0.7.4] + //========================================================================== + // ========= + // Specify + // ======= + protected Specification _specification; + + public Specification specify() { + if (_specification == null) { + _specification = new Specification(this, + new SpQyCall() { + public boolean has() { + return true; + } + + public MonthlyWorkingReportCQ qy() { + return query(); + } + }, _forDeriveReferrer); + } + return _specification; + } + + public static class Specification extends + AbstractSpecification { + protected SpQyCall _myQyCall; + + protected MonthlyReportCB.Specification _monthlyReport; + + protected WorkingTypeCB.Specification _workingType; + + public Specification(ConditionBean baseCB, + SpQyCall qyCall, + boolean forDeriveReferrer) { + super(baseCB, qyCall, forDeriveReferrer); + _myQyCall = qyCall; + } + + public void columnId() { + doColumn("ID"); + } + + public void columnValue() { + doColumn("VALUE"); + } + + public void columnMonthlyReportId() { + doColumn("MONTHLY_REPORT_ID"); + } + + public void columnWorkingTypeId() { + doColumn("WORKING_TYPE_ID"); + } + + protected void doSpecifyRequiredColumn() { + columnId();// PK + if (_myQyCall.qy().hasConditionQueryMonthlyReport()) { + columnMonthlyReportId();// FK + } + if (_myQyCall.qy().hasConditionQueryWorkingType()) { + columnWorkingTypeId();// FK + } + } + + protected String getTableDbName() { + return "MONTHLY_WORKING_REPORT"; + } + + public MonthlyReportCB.Specification specifyMonthlyReport() { + assertForeign("monthlyReport"); + if (_monthlyReport == null) { + _monthlyReport = new MonthlyReportCB.Specification(_baseCB, + new SpQyCall() { + public boolean has() { + return _myQyCall.has() + && _myQyCall + .qy() + .hasConditionQueryMonthlyReport(); + } + + public MonthlyReportCQ qy() { + return _myQyCall.qy().queryMonthlyReport(); + } + }, _forDeriveReferrer); + } + return _monthlyReport; + } + + public WorkingTypeCB.Specification specifyWorkingType() { + assertForeign("workingType"); + if (_workingType == null) { + _workingType = new WorkingTypeCB.Specification(_baseCB, + new SpQyCall() { + public boolean has() { + return _myQyCall.has() + && _myQyCall.qy() + .hasConditionQueryWorkingType(); + } + + public WorkingTypeCQ qy() { + return _myQyCall.qy().queryWorkingType(); + } + }, _forDeriveReferrer); + } + return _workingType; + } + } + + // Very Internal (for Suppressing Warn about 'Not Use Import') + protected String getConditionBeanClassNameInternally() { + return MonthlyWorkingReportCB.class.getName(); + } + + protected String getConditionQueryClassNameInternally() { + return MonthlyWorkingReportCQ.class.getName(); + } + + protected String getSubQueryClassNameInternally() { + return SubQuery.class.getName(); + } +} Property changes on: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/cbean/bs/BsMonthlyWorkingReportCB.java ___________________________________________________________________ Name: svn:eol-style + native Added: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/cbean/bs/BsWorkingTypeCB.java =================================================================== --- timecard/trunk/src/main/java/jp/sf/pal/timecard/db/cbean/bs/BsWorkingTypeCB.java (rev 0) +++ timecard/trunk/src/main/java/jp/sf/pal/timecard/db/cbean/bs/BsWorkingTypeCB.java 2008-12-02 03:38:50 UTC (rev 1493) @@ -0,0 +1,279 @@ +package jp.sf.pal.timecard.db.cbean.bs; + +import java.util.Map; + +import jp.sf.pal.timecard.db.allcommon.cbean.AbstractConditionBean; +import jp.sf.pal.timecard.db.allcommon.cbean.ConditionBean; +import jp.sf.pal.timecard.db.allcommon.cbean.ConditionQuery; +import jp.sf.pal.timecard.db.allcommon.cbean.SubQuery; +import jp.sf.pal.timecard.db.allcommon.cbean.UnionQuery; +import jp.sf.pal.timecard.db.cbean.MonthlyWorkingReportCB; +import jp.sf.pal.timecard.db.cbean.WorkingTypeCB; +import jp.sf.pal.timecard.db.cbean.cq.WorkingTypeCQ; + +/** + * The base condition-bean of WORKING_TYPE. + * + * @author DBFlute(AutoGenerator) + */ + ¡÷ SuppressWarnings("unchecked") +public class BsWorkingTypeCB extends AbstractConditionBean { + + //========================================================================== + // ========= + // Attribute + // ========= + protected WorkingTypeCQ _conditionQuery; + + //========================================================================== + // ========= + // Table Name + // ========== + public String getTableDbName() { + return "WORKING_TYPE"; + } + + public String getTableSqlName() { + return "WORKING_TYPE"; + } + + //========================================================================== + // ========= + // PrimaryKey Map + // ============== + public void acceptPrimaryKeyMap(Map 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 WorkingTypeCQ query() { + return getConditionQuery(); + } + + public WorkingTypeCQ getConditionQuery() { + if (_conditionQuery == null) { + _conditionQuery = new WorkingTypeCQ(null, getSqlClause(), + getSqlClause().getLocalTableAliasName(), 0); + } + return _conditionQuery; + } + + public ConditionQuery getConditionQueryAsInterface() { + return getConditionQuery(); + } + + //========================================================================== + // ========= + // Union + // ===== + /** + * Set up 'union'. + * + *
    +     * cb.query().union(new UnionQuery<WorkingTypeCB>() {
    +     *     public void query(WorkingTypeCB unionCB) {
    +     *         unionCB.query().setXxx...
    +     *     }
    +     * });
    +     * 
    + * + * @param unionQuery The query of 'union'. (NotNull) + */ + public void union(UnionQuery unionQuery) { + final WorkingTypeCB cb = new WorkingTypeCB(); + cb.xsetupForUnion(); + unionQuery.query(cb); + final WorkingTypeCQ cq = cb.query(); + query().xsetUnionQuery(cq); + } + + /** + * Set up 'union all'. + * + *
    +     * cb.query().unionAll(new UnionQuery<WorkingTypeCB>() {
    +     *     public void query(WorkingTypeCB unionCB) {
    +     *         unionCB.query().setXxx...
    +     *     }
    +     * });
    +     * 
    + * + * @param unionQuery The query of 'union'. (NotNull) + */ + public void unionAll(UnionQuery unionQuery) { + final WorkingTypeCB cb = new WorkingTypeCB(); + cb.xsetupForUnion(); + unionQuery.query(cb); + final WorkingTypeCQ cq = cb.query(); + query().xsetUnionAllQuery(cq); + } + + /** + * @param unionQuery The query of 'union'. (NotNull) + * @deprecated Sorry! Please use union(UnionQuery + * unionQuery). + */ + public void union(WorkingTypeCQ unionQuery) { + query().xsetUnionQuery(unionQuery); + } + + /** + * @param unionQuery The query of 'union'. (NotNull) + * @deprecated Sorry! Please use unionAll(UnionQuery + * unionQuery). + */ + public void unionAll(WorkingTypeCQ 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() { + public boolean has() { + return true; + } + + public WorkingTypeCQ qy() { + return query(); + } + }, _forDeriveReferrer); + } + return _specification; + } + + public static class Specification extends + AbstractSpecification { + protected SpQyCall _myQyCall; + + public Specification(ConditionBean baseCB, + SpQyCall qyCall, boolean forDeriveReferrer) { + super(baseCB, qyCall, forDeriveReferrer); + _myQyCall = qyCall; + } + + public void columnId() { + doColumn("ID"); + } + + public void columnName() { + doColumn("NAME"); + } + + public void columnValue() { + doColumn("VALUE"); + } + + public void columnType() { + doColumn("TYPE"); + } + + public void columnParentId() { + doColumn("PARENT_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() { + columnId();// PK + } + + protected String getTableDbName() { + return "WORKING_TYPE"; + } + + public RAFunction derivedMonthlyWorkingReportList() { + return new RAFunction( + _baseCB, _myQyCall.qy(), + new RAQSetupper() { + public void setup(String function, + SubQuery subQuery, + WorkingTypeCQ cq, String aliasName) { + cq.xderiveMonthlyWorkingReportList(function, + subQuery, aliasName); + } + }); + } + } + + // Very Internal (for Suppressing Warn about 'Not Use Import') + protected String getConditionBeanClassNameInternally() { + return WorkingTypeCB.class.getName(); + } + + protected String getConditionQueryClassNameInternally() { + return WorkingTypeCQ.class.getName(); + } + + protected String getSubQueryClassNameInternally() { + return SubQuery.class.getName(); + } +} Property changes on: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/cbean/bs/BsWorkingTypeCB.java ___________________________________________________________________ Name: svn:eol-style + native Added: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/cbean/cq/MonthlyWorkingReportCQ.java =================================================================== --- timecard/trunk/src/main/java/jp/sf/pal/timecard/db/cbean/cq/MonthlyWorkingReportCQ.java (rev 0) +++ timecard/trunk/src/main/java/jp/sf/pal/timecard/db/cbean/cq/MonthlyWorkingReportCQ.java 2008-12-02 03:38:50 UTC (rev 1493) @@ -0,0 +1,45 @@ +package jp.sf.pal.timecard.db.cbean.cq; + +import jp.sf.pal.timecard.db.allcommon.cbean.ConditionQuery; +import jp.sf.pal.timecard.db.allcommon.cbean.sqlclause.SqlClause; +import jp.sf.pal.timecard.db.cbean.cq.bs.BsMonthlyWorkingReportCQ; + +/** + * The condition-query of MONTHLY_WORKING_REPORT. + *

    + * You can implement your original methods here. This class is NOT overrided + * when re-generating. + *

    + * + * @author DBFlute(AutoGenerator) + */ + ¡÷ SuppressWarnings("unchecked") +public class MonthlyWorkingReportCQ extends BsMonthlyWorkingReportCQ { + + //========================================================================== + // ========= + // 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 MonthlyWorkingReportCQ(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: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/cbean/cq/MonthlyWorkingReportCQ.java ___________________________________________________________________ Name: svn:eol-style + native Added: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/cbean/cq/WorkingTypeCQ.java =================================================================== --- timecard/trunk/src/main/java/jp/sf/pal/timecard/db/cbean/cq/WorkingTypeCQ.java (rev 0) +++ timecard/trunk/src/main/java/jp/sf/pal/timecard/db/cbean/cq/WorkingTypeCQ.java 2008-12-02 03:38:50 UTC (rev 1493) @@ -0,0 +1,45 @@ +package jp.sf.pal.timecard.db.cbean.cq; + +import jp.sf.pal.timecard.db.allcommon.cbean.ConditionQuery; +import jp.sf.pal.timecard.db.allcommon.cbean.sqlclause.SqlClause; +import jp.sf.pal.timecard.db.cbean.cq.bs.BsWorkingTypeCQ; + +/** + * The condition-query of WORKING_TYPE. + *

    + * You can implement your original methods here. This class is NOT overrided + * when re-generating. + *

    + * + * @author DBFlute(AutoGenerator) + */ + ¡÷ SuppressWarnings("unchecked") +public class WorkingTypeCQ extends BsWorkingTypeCQ { + + //========================================================================== + // ========= + // 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 WorkingTypeCQ(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: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/cbean/cq/WorkingTypeCQ.java ___________________________________________________________________ Name: svn:eol-style + native Modified: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/cbean/cq/bs/AbstractBsEmployeeCQ.java =================================================================== --- timecard/trunk/src/main/java/jp/sf/pal/timecard/db/cbean/cq/bs/AbstractBsEmployeeCQ.java 2008-12-01 14:26:07 UTC (rev 1492) +++ timecard/trunk/src/main/java/jp/sf/pal/timecard/db/cbean/cq/bs/AbstractBsEmployeeCQ.java 2008-12-02 03:38:50 UTC (rev 1493) @@ -573,95 +573,6 @@ abstract protected ConditionValue getCValueManager(); /** - * Equal(=). And NullIgnored, OnceRegistered. {NotNull : DOUBLE : - * Default=[0]} - * - * @param paidHolidays The value of paidHolidays as equal. - */ - public void setPaidHolidays_Equal(java.math.BigDecimal paidHolidays) { - regPaidHolidays(CK_EQ, paidHolidays); - } - - /** - * NotEqual(!=). And NullIgnored, OnceRegistered. - * - * @param paidHolidays The value of paidHolidays as notEqual. - */ - public void setPaidHolidays_NotEqual(java.math.BigDecimal paidHolidays) { - regPaidHolidays(CK_NE, paidHolidays); - } - - /** - * GreaterThan(>). And NullIgnored, OnceRegistered. - * - * @param paidHolidays The value of paidHolidays as greaterThan. - */ - public void setPaidHolidays_GreaterThan(java.math.BigDecimal paidHolidays) { - regPaidHolidays(CK_GT, paidHolidays); - } - - /** - * LessThan(<). And NullIgnored, OnceRegistered. - * - * @param paidHolidays The value of paidHolidays as lessThan. - */ - public void setPaidHolidays_LessThan(java.math.BigDecimal paidHolidays) { - regPaidHolidays(CK_LT, paidHolidays); - } - - /** - * GreaterEqual(>=). And NullIgnored, OnceRegistered. - * - * @param paidHolidays The value of paidHolidays as greaterEqual. - */ - public void setPaidHolidays_GreaterEqual(java.math.BigDecimal paidHolidays) { - regPaidHolidays(CK_GE, paidHolidays); - } - - /** - * LessEqual(<=). And NullIgnored, OnceRegistered. - * - * @param paidHolidays The value of paidHolidays as lessEqual. - */ - public void setPaidHolidays_LessEqual(java.math.BigDecimal paidHolidays) { - regPaidHolidays(CK_LE, paidHolidays); - } - - /** - * InScope(in (1, 2)). And NullIgnored, NullElementIgnored, - * SeveralRegistered. - * - * @param paidHolidaysList The collection of paidHolidays as inScope. - */ - public void setPaidHolidays_InScope( - Collection paidHolidaysList) { - regPaidHolidays(CK_INS, cTL(paidHolidaysList)); - } - - /** - * NotInScope(not in (1, 2)). And NullIgnored, NullElementIgnored, - * SeveralRegistered. - * - * @param paidHolidaysList The collection of paidHolidays as notInScope. - */ - public void setPaidHolidays_NotInScope( - Collection paidHolidaysList) { - regPaidHolidays(CK_NINS, cTL(paidHolidaysList)); - } - - protected void regPaidHolidays(ConditionKey key, Object value) { - registerQuery(key, value, getCValuePaidHolidays(), "PAID_HOLIDAYS", - "PaidHolidays", "paidHolidays"); - } - - protected void registerInlinePaidHolidays(ConditionKey key, Object value) { - registerInlineQuery(key, value, getCValuePaidHolidays(), - "PAID_HOLIDAYS", "PaidHolidays", "paidHolidays"); - } - - abstract protected ConditionValue getCValuePaidHolidays(); - - /** * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {NotNull : VARCHAR(1) : * Default=[T]} * Modified: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/cbean/cq/bs/AbstractBsMonthlyReportCQ.java =================================================================== --- timecard/trunk/src/main/java/jp/sf/pal/timecard/db/cbean/cq/bs/AbstractBsMonthlyReportCQ.java 2008-12-01 14:26:07 UTC (rev 1492) +++ timecard/trunk/src/main/java/jp/sf/pal/timecard/db/cbean/cq/bs/AbstractBsMonthlyReportCQ.java 2008-12-02 03:38:50 UTC (rev 1493) @@ -11,9 +11,11 @@ import jp.sf.pal.timecard.db.cbean.DailyReportCB; import jp.sf.pal.timecard.db.cbean.EmployeeCB; import jp.sf.pal.timecard.db.cbean.MonthlyReportCB; +import jp.sf.pal.timecard.db.cbean.MonthlyWorkingReportCB; import jp.sf.pal.timecard.db.cbean.cq.DailyReportCQ; import jp.sf.pal.timecard.db.cbean.cq.EmployeeCQ; import jp.sf.pal.timecard.db.cbean.cq.MonthlyReportCQ; +import jp.sf.pal.timecard.db.cbean.cq.MonthlyWorkingReportCQ; /** * The abstract condition-query of MONTHLY_REPORT. @@ -153,6 +155,37 @@ abstract public String keepId_InScopeSubQuery_DailyReportList( DailyReportCQ subQuery); + /** + * @param monthlyWorkingReportCBquery Query. + * @deprecated Please use inScopeMonthlyWorkingReportList(subQuery) method. + */ + public void setId_InScopeSubQuery_MonthlyWorkingReportList( + MonthlyWorkingReportCQ monthlyWorkingReportCBquery) { + String subQueryPropertyName = keepId_InScopeSubQuery_MonthlyWorkingReportList(monthlyWorkingReportCBquery);// for + // saving + // query + // - + // value + // . + registerInScopeSubQuery(monthlyWorkingReportCBquery, "ID", + "MONTHLY_REPORT_ID", subQueryPropertyName); + } + + public void inScopeMonthlyWorkingReportList( + SubQuery subQuery) { + assertObjectNotNull("subQuery", subQuery); + MonthlyWorkingReportCB cb = new MonthlyWorkingReportCB(); + cb.xsetupForInScopeSubQuery(); + subQuery.query(cb); + String subQueryPropertyName = keepId_InScopeSubQuery_MonthlyWorkingReportList(cb + .query());// for saving query-value. + registerInScopeSubQuery(cb.query(), "ID", "MONTHLY_REPORT_ID", + subQueryPropertyName); + } + + abstract public String keepId_InScopeSubQuery_MonthlyWorkingReportList( + MonthlyWorkingReportCQ subQuery); + public void notInScopeDailyReportList(SubQuery subQuery) { assertObjectNotNull("subQuery", subQuery); DailyReportCB cb = new DailyReportCB(); @@ -167,6 +200,21 @@ abstract public String keepId_NotInScopeSubQuery_DailyReportList( DailyReportCQ subQuery); + public void notInScopeMonthlyWorkingReportList( + SubQuery subQuery) { + assertObjectNotNull("subQuery", subQuery); + MonthlyWorkingReportCB cb = new MonthlyWorkingReportCB(); + cb.xsetupForInScopeSubQuery(); + subQuery.query(cb); + String subQueryPropertyName = keepId_NotInScopeSubQuery_MonthlyWorkingReportList(cb + .query());// for saving query-value. + registerNotInScopeSubQuery(cb.query(), "ID", "MONTHLY_REPORT_ID", + subQueryPropertyName); + } + + abstract public String keepId_NotInScopeSubQuery_MonthlyWorkingReportList( + MonthlyWorkingReportCQ subQuery); + /** * @param dailyReportCBquery Query. * @deprecated Please use existsDailyReportList(subQuery) method. @@ -205,6 +253,45 @@ DailyReportCQ subQuery); /** + * @param monthlyWorkingReportCBquery Query. + * @deprecated Please use existsMonthlyWorkingReportList(subQuery) method. + */ + public void setId_ExistsSubQuery_MonthlyWorkingReportList( + MonthlyWorkingReportCQ monthlyWorkingReportCBquery) { + String subQueryPropertyName = keepId_ExistsSubQuery_MonthlyWorkingReportList(monthlyWorkingReportCBquery);// for + // saving + // query + // - + // value + // . + registerExistsSubQuery(monthlyWorkingReportCBquery, "ID", + "MONTHLY_REPORT_ID", subQueryPropertyName); + } + + /** + * Set up 'exists' sub-query. {exists (select MONTHLY_REPORT_ID from + * MONTHLY_WORKING_REPORT where ...)} + * + * @param subQuery The sub-query of + * Id_ExistsSubQuery_MonthlyWorkingReportList for 'exists'. + * (NotNull) + */ + public void existsMonthlyWorkingReportList( + SubQuery subQuery) { + assertObjectNotNull("subQuery", subQuery); + MonthlyWorkingReportCB cb = new MonthlyWorkingReportCB(); + cb.xsetupForExistsSubQuery(); + subQuery.query(cb); + String subQueryPropertyName = keepId_ExistsSubQuery_MonthlyWorkingReportList(cb + .query());// for saving query-value. + registerExistsSubQuery(cb.query(), "ID", "MONTHLY_REPORT_ID", + subQueryPropertyName); + } + + abstract public String keepId_ExistsSubQuery_MonthlyWorkingReportList( + MonthlyWorkingReportCQ subQuery); + + /** * Set up 'not exists' sub-query. {not exists (select MONTHLY_REPORT_ID from * DAILY_REPORT where ...)} * @@ -225,6 +312,29 @@ abstract public String keepId_NotExistsSubQuery_DailyReportList( DailyReportCQ subQuery); + /** + * Set up 'not exists' sub-query. {not exists (select MONTHLY_REPORT_ID from + * MONTHLY_WORKING_REPORT where ...)} + * + * @param subQuery The sub-query of + * Id_NotExistsSubQuery_MonthlyWorkingReportList for 'not + * exists'. (NotNull) + */ + public void notExistsMonthlyWorkingReportList( + SubQuery subQuery) { + assertObjectNotNull("subQuery", subQuery); + MonthlyWorkingReportCB cb = new MonthlyWorkingReportCB(); + cb.xsetupForExistsSubQuery(); + subQuery.query(cb); + String subQueryPropertyName = keepId_NotExistsSubQuery_MonthlyWorkingReportList(cb + .query());// for saving query-value. + registerNotExistsSubQuery(cb.query(), "ID", "MONTHLY_REPORT_ID", + subQueryPropertyName); + } + + abstract public String keepId_NotExistsSubQuery_MonthlyWorkingReportList( + MonthlyWorkingReportCQ subQuery); + public void xderiveDailyReportList(String function, SubQuery subQuery, String aliasName) { assertObjectNotNull("subQuery", subQuery); @@ -240,6 +350,21 @@ abstract public String keepId_DeriveSubQuery_DailyReportList( DailyReportCQ subQuery); + public void xderiveMonthlyWorkingReportList(String function, + SubQuery subQuery, String aliasName) { + assertObjectNotNull("subQuery", subQuery); + MonthlyWorkingReportCB cb = new MonthlyWorkingReportCB(); + cb.xsetupForDeriveReferrer(); + subQuery.query(cb); + String subQueryPropertyName = keepId_DeriveSubQuery_MonthlyWorkingReportList(cb + .query());// for saving query-value. + registerDeriveSubQuery(function, cb.query(), "ID", "MONTHLY_REPORT_ID", + subQueryPropertyName, aliasName); + } + + abstract public String keepId_DeriveSubQuery_MonthlyWorkingReportList( + MonthlyWorkingReportCQ subQuery); + /** * IsNull(is null). And OnceRegistered. */ @@ -524,95 +649,6 @@ * Equal(=). And NullIgnored, OnceRegistered. {NotNull : DOUBLE : * Default=[0]} * - * @param workingDays The value of workingDays as equal. - */ - public void setWorkingDays_Equal(java.math.BigDecimal workingDays) { - regWorkingDays(CK_EQ, workingDays); - } - - /** - * NotEqual(!=). And NullIgnored, OnceRegistered. - * - * @param workingDays The value of workingDays as notEqual. - */ - public void setWorkingDays_NotEqual(java.math.BigDecimal workingDays) { - regWorkingDays(CK_NE, workingDays); - } - - /** - * GreaterThan(>). And NullIgnored, OnceRegistered. - * - * @param workingDays The value of workingDays as greaterThan. - */ - public void setWorkingDays_GreaterThan(java.math.BigDecimal workingDays) { - regWorkingDays(CK_GT, workingDays); - } - - /** - * LessThan(<). And NullIgnored, OnceRegistered. - * - * @param workingDays The value of workingDays as lessThan. - */ - public void setWorkingDays_LessThan(java.math.BigDecimal workingDays) { - regWorkingDays(CK_LT, workingDays); - } - - /** - * GreaterEqual(>=). And NullIgnored, OnceRegistered. - * - * @param workingDays The value of workingDays as greaterEqual. - */ - public void setWorkingDays_GreaterEqual(java.math.BigDecimal workingDays) { - regWorkingDays(CK_GE, workingDays); - } - - /** - * LessEqual(<=). And NullIgnored, OnceRegistered. - * - * @param workingDays The value of workingDays as lessEqual. - */ - public void setWorkingDays_LessEqual(java.math.BigDecimal workingDays) { - regWorkingDays(CK_LE, workingDays); - } - - /** - * InScope(in (1, 2)). And NullIgnored, NullElementIgnored, - * SeveralRegistered. - * - * @param workingDaysList The collection of workingDays as inScope. - */ - public void setWorkingDays_InScope( - Collection workingDaysList) { - regWorkingDays(CK_INS, cTL(workingDaysList)); - } - - /** - * NotInScope(not in (1, 2)). And NullIgnored, NullElementIgnored, - * SeveralRegistered. - * - * @param workingDaysList The collection of workingDays as notInScope. - */ - public void setWorkingDays_NotInScope( - Collection workingDaysList) { - regWorkingDays(CK_NINS, cTL(workingDaysList)); - } - - protected void regWorkingDays(ConditionKey key, Object value) { - registerQuery(key, value, getCValueWorkingDays(), "WORKING_DAYS", - "WorkingDays", "workingDays"); - } - - protected void registerInlineWorkingDays(ConditionKey key, Object value) { - registerInlineQuery(key, value, getCValueWorkingDays(), "WORKING_DAYS", - "WorkingDays", "workingDays"); - } - - abstract protected ConditionValue getCValueWorkingDays(); - - /** - * Equal(=). And NullIgnored, OnceRegistered. {NotNull : DOUBLE : - * Default=[0]} - * * @param stdWorkingDays The value of stdWorkingDays as equal. */ public void setStdWorkingDays_Equal(java.math.BigDecimal stdWorkingDays) { @@ -701,184 +737,6 @@ abstract protected ConditionValue getCValueStdWorkingDays(); /** - * Equal(=). And NullIgnored, OnceRegistered. {NotNull : DOUBLE : - * Default=[0]} - * - * @param holidays The value of holidays as equal. - */ - public void setHolidays_Equal(java.math.BigDecimal holidays) { - regHolidays(CK_EQ, holidays); - } - - /** - * NotEqual(!=). And NullIgnored, OnceRegistered. - * - * @param holidays The value of holidays as notEqual. - */ - public void setHolidays_NotEqual(java.math.BigDecimal holidays) { - regHolidays(CK_NE, holidays); - } - - /** - * GreaterThan(>). And NullIgnored, OnceRegistered. - * - * @param holidays The value of holidays as greaterThan. - */ - public void setHolidays_GreaterThan(java.math.BigDecimal holidays) { - regHolidays(CK_GT, holidays); - } - - /** - * LessThan(<). And NullIgnored, OnceRegistered. - * - * @param holidays The value of holidays as lessThan. - */ - public void setHolidays_LessThan(java.math.BigDecimal holidays) { - regHolidays(CK_LT, holidays); - } - - /** - * GreaterEqual(>=). And NullIgnored, OnceRegistered. - * - * @param holidays The value of holidays as greaterEqual. - */ - public void setHolidays_GreaterEqual(java.math.BigDecimal holidays) { - regHolidays(CK_GE, holidays); - } - - /** - * LessEqual(<=). And NullIgnored, OnceRegistered. - * - * @param holidays The value of holidays as lessEqual. - */ - public void setHolidays_LessEqual(java.math.BigDecimal holidays) { - regHolidays(CK_LE, holidays); - } - - /** - * InScope(in (1, 2)). And NullIgnored, NullElementIgnored, - * SeveralRegistered. - * - * @param holidaysList The collection of holidays as inScope. - */ - public void setHolidays_InScope( - Collection holidaysList) { - regHolidays(CK_INS, cTL(holidaysList)); - } - - /** - * NotInScope(not in (1, 2)). And NullIgnored, NullElementIgnored, - * SeveralRegistered. - * - * @param holidaysList The collection of holidays as notInScope. - */ - public void setHolidays_NotInScope( - Collection holidaysList) { - regHolidays(CK_NINS, cTL(holidaysList)); - } - - protected void regHolidays(ConditionKey key, Object value) { - registerQuery(key, value, getCValueHolidays(), "HOLIDAYS", "Holidays", - "holidays"); - } - - protected void registerInlineHolidays(ConditionKey key, Object value) { - registerInlineQuery(key, value, getCValueHolidays(), "HOLIDAYS", - "Holidays", "holidays"); - } - - abstract protected ConditionValue getCValueHolidays(); - - /** - * Equal(=). And NullIgnored, OnceRegistered. {NotNull : DOUBLE : - * Default=[0]} - * - * @param paidHolidays The value of paidHolidays as equal. - */ - public void setPaidHolidays_Equal(java.math.BigDecimal paidHolidays) { - regPaidHolidays(CK_EQ, paidHolidays); - } - - /** - * NotEqual(!=). And NullIgnored, OnceRegistered. - * - * @param paidHolidays The value of paidHolidays as notEqual. - */ - public void setPaidHolidays_NotEqual(java.math.BigDecimal paidHolidays) { - regPaidHolidays(CK_NE, paidHolidays); - } - - /** - * GreaterThan(>). And NullIgnored, OnceRegistered. - * - * @param paidHolidays The value of paidHolidays as greaterThan. - */ - public void setPaidHolidays_GreaterThan(java.math.BigDecimal paidHolidays) { - regPaidHolidays(CK_GT, paidHolidays); - } - - /** - * LessThan(<). And NullIgnored, OnceRegistered. - * - * @param paidHolidays The value of paidHolidays as lessThan. - */ - public void setPaidHolidays_LessThan(java.math.BigDecimal paidHolidays) { - regPaidHolidays(CK_LT, paidHolidays); - } - - /** - * GreaterEqual(>=). And NullIgnored, OnceRegistered. - * - * @param paidHolidays The value of paidHolidays as greaterEqual. - */ - public void setPaidHolidays_GreaterEqual(java.math.BigDecimal paidHolidays) { - regPaidHolidays(CK_GE, paidHolidays); - } - - /** - * LessEqual(<=). And NullIgnored, OnceRegistered. - * - * @param paidHolidays The value of paidHolidays as lessEqual. - */ - public void setPaidHolidays_LessEqual(java.math.BigDecimal paidHolidays) { - regPaidHolidays(CK_LE, paidHolidays); - } - - /** - * InScope(in (1, 2)). And NullIgnored, NullElementIgnored, - * SeveralRegistered. - * - * @param paidHolidaysList The collection of paidHolidays as inScope. - */ - public void setPaidHolidays_InScope( - Collection paidHolidaysList) { - regPaidHolidays(CK_INS, cTL(paidHolidaysList)); - } - - /** - * NotInScope(not in (1, 2)). And NullIgnored, NullElementIgnored, - * SeveralRegistered. - * - * @param paidHolidaysList The collection of paidHolidays as notInScope. - */ - public void setPaidHolidays_NotInScope( - Collection paidHolidaysList) { - regPaidHolidays(CK_NINS, cTL(paidHolidaysList)); - } - - protected void regPaidHolidays(ConditionKey key, Object value) { - registerQuery(key, value, getCValuePaidHolidays(), "PAID_HOLIDAYS", - "PaidHolidays", "paidHolidays"); - } - - protected void registerInlinePaidHolidays(ConditionKey key, Object value) { - registerInlineQuery(key, value, getCValuePaidHolidays(), - "PAID_HOLIDAYS", "PaidHolidays", "paidHolidays"); - } - - abstract protected ConditionValue getCValuePaidHolidays(); - - /** * Equal(=). And NullIgnored, OnceRegistered. {NotNull : BIGINT : * Default=[0]} * Added: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/cbean/cq/bs/AbstractBsMonthlyWorkingReportCQ.java =================================================================== --- timecard/trunk/src/main/java/jp/sf/pal/timecard/db/cbean/cq/bs/AbstractBsMonthlyWorkingReportCQ.java (rev 0) +++ timecard/trunk/src/main/java/jp/sf/pal/timecard/db/cbean/cq/bs/AbstractBsMonthlyWorkingReportCQ.java 2008-12-02 03:38:50 UTC (rev 1493) @@ -0,0 +1,481 @@ +package jp.sf.pal.timecard.db.cbean.cq.bs; + +import java.util.Collection; + +import jp.sf.pal.timecard.db.allcommon.cbean.AbstractConditionQuery; +import jp.sf.pal.timecard.db.allcommon.cbean.ConditionQuery; +import jp.sf.pal.timecard.db.allcommon.cbean.SubQuery; +import jp.sf.pal.timecard.db.allcommon.cbean.ckey.ConditionKey; +import jp.sf.pal.timecard.db.allcommon.cbean.cvalue.ConditionValue; +import jp.sf.pal.timecard.db.allcommon.cbean.sqlclause.SqlClause; +import jp.sf.pal.timecard.db.cbean.MonthlyReportCB; +import jp.sf.pal.timecard.db.cbean.MonthlyWorkingReportCB; +import jp.sf.pal.timecard.db.cbean.WorkingTypeCB; +import jp.sf.pal.timecard.db.cbean.cq.MonthlyReportCQ; +import jp.sf.pal.timecard.db.cbean.cq.MonthlyWorkingReportCQ; +import jp.sf.pal.timecard.db.cbean.cq.WorkingTypeCQ; + +/** + * The abstract condition-query of MONTHLY_WORKING_REPORT. + * + * @author DBFlute(AutoGenerator) + */ + ¡÷ SuppressWarnings("unchecked") +public abstract class AbstractBsMonthlyWorkingReportCQ extends + AbstractConditionQuery { + + //========================================================================== + // ========= + // Constructor + // =========== + public AbstractBsMonthlyWorkingReportCQ(ConditionQuery childQuery, + SqlClause sqlClause, String aliasName, int nestLevel) { + super(childQuery, sqlClause, aliasName, nestLevel); + } + + //========================================================================== + // ========= + // Table Name + // ========== + public String getTableDbName() { + return "MONTHLY_WORKING_REPORT"; + } + + public String getTableSqlName() { + return "MONTHLY_WORKING_REPORT"; + } + + //========================================================================== + // ========= + // 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 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 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 : DOUBLE} + * + * @param value The value of value as equal. + */ + public void setValue_Equal(java.math.BigDecimal value) { + regValue(CK_EQ, value); + } + + /** + * NotEqual(!=). And NullIgnored, OnceRegistered. + * + * @param value The value of value as notEqual. + */ + public void setValue_NotEqual(java.math.BigDecimal value) { + regValue(CK_NE, value); + } + + /** + * GreaterThan(>). And NullIgnored, OnceRegistered. + * + * @param value The value of value as greaterThan. + */ + public void setValue_GreaterThan(java.math.BigDecimal value) { + regValue(CK_GT, value); + } + + /** + * LessThan(<). And NullIgnored, OnceRegistered. + * + * @param value The value of value as lessThan. + */ + public void setValue_LessThan(java.math.BigDecimal value) { + regValue(CK_LT, value); + } + + /** + * GreaterEqual(>=). And NullIgnored, OnceRegistered. + * + * @param value The value of value as greaterEqual. + */ + public void setValue_GreaterEqual(java.math.BigDecimal value) { + regValue(CK_GE, value); + } + + /** + * LessEqual(<=). And NullIgnored, OnceRegistered. + * + * @param value The value of value as lessEqual. + */ + public void setValue_LessEqual(java.math.BigDecimal value) { + regValue(CK_LE, value); + } + + /** + * InScope(in (1, 2)). And NullIgnored, NullElementIgnored, + * SeveralRegistered. + * + * @param valueList The collection of value as inScope. + */ + public void setValue_InScope(Collection valueList) { + regValue(CK_INS, cTL(valueList)); + } + + /** + * NotInScope(not in (1, 2)). And NullIgnored, NullElementIgnored, + * SeveralRegistered. + * + * @param valueList The collection of value as notInScope. + */ + public void setValue_NotInScope(Collection valueList) { + regValue(CK_NINS, cTL(valueList)); + } + + protected void regValue(ConditionKey key, Object value) { + registerQuery(key, value, getCValueValue(), "VALUE", "Value", "value"); + } + + protected void registerInlineValue(ConditionKey key, Object value) { + registerInlineQuery(key, value, getCValueValue(), "VALUE", "Value", + "value"); + } + + abstract protected ConditionValue getCValueValue(); + + /** + * Equal(=). And NullIgnored, OnceRegistered. {NotNull : BIGINT : FK to + * MONTHLY_REPORT} + * + * @param monthlyReportId The value of monthlyReportId as equal. + */ + public void setMonthlyReportId_Equal(Long monthlyReportId) { + regMonthlyReportId(CK_EQ, monthlyReportId); + } + + /** + * NotEqual(!=). And NullIgnored, OnceRegistered. + * + * @param monthlyReportId The value of monthlyReportId as notEqual. + */ + public void setMonthlyReportId_NotEqual(Long monthlyReportId) { + regMonthlyReportId(CK_NE, monthlyReportId); + } + + /** + * GreaterThan(>). And NullIgnored, OnceRegistered. + * + * @param monthlyReportId The value of monthlyReportId as greaterThan. + */ + public void setMonthlyReportId_GreaterThan(Long monthlyReportId) { + regMonthlyReportId(CK_GT, monthlyReportId); + } + + /** + * LessThan(<). And NullIgnored, OnceRegistered. + * + * @param monthlyReportId The value of monthlyReportId as lessThan. + */ + public void setMonthlyReportId_LessThan(Long monthlyReportId) { + regMonthlyReportId(CK_LT, monthlyReportId); + } + + /** + * GreaterEqual(>=). And NullIgnored, OnceRegistered. + * + * @param monthlyReportId The value of monthlyReportId as greaterEqual. + */ + public void setMonthlyReportId_GreaterEqual(Long monthlyReportId) { + regMonthlyReportId(CK_GE, monthlyReportId); + } + + /** + * LessEqual(<=). And NullIgnored, OnceRegistered. + * + * @param monthlyReportId The value of monthlyReportId as lessEqual. + */ + public void setMonthlyReportId_LessEqual(Long monthlyReportId) { + regMonthlyReportId(CK_LE, monthlyReportId); + } + + /** + * InScope(in (1, 2)). And NullIgnored, NullElementIgnored, + * SeveralRegistered. + * + * @param monthlyReportIdList The collection of monthlyReportId as inScope. + */ + public void setMonthlyReportId_InScope(Collection monthlyReportIdList) { + regMonthlyReportId(CK_INS, cTL(monthlyReportIdList)); + } + + /** + * NotInScope(not in (1, 2)). And NullIgnored, NullElementIgnored, + * SeveralRegistered. + * + * @param monthlyReportIdList The collection of monthlyReportId as + * notInScope. + */ + public void setMonthlyReportId_NotInScope( + Collection monthlyReportIdList) { + regMonthlyReportId(CK_NINS, cTL(monthlyReportIdList)); + } + + /** + * @param monthlyReportCBquery Query. + * @deprecated Please use inScopeMonthlyReport(subQuery) method. + */ + public void setMonthlyReportId_InScopeSubQuery_MonthlyReport( + MonthlyReportCQ monthlyReportCBquery) { + String subQueryPropertyName = keepMonthlyReportId_InScopeSubQuery_MonthlyReport(monthlyReportCBquery);// for + // saving + // query + // - + // value + // . + registerInScopeSubQuery(monthlyReportCBquery, "MONTHLY_REPORT_ID", + "ID", subQueryPropertyName); + } + + public void inScopeMonthlyReport(SubQuery subQuery) { + assertObjectNotNull("subQuery", subQuery); + MonthlyReportCB cb = new MonthlyReportCB(); + cb.xsetupForInScopeSubQuery(); + subQuery.query(cb); + String subQueryPropertyName = keepMonthlyReportId_InScopeSubQuery_MonthlyReport(cb + .query());// for saving query-value. + registerInScopeSubQuery(cb.query(), "MONTHLY_REPORT_ID", "ID", + subQueryPropertyName); + } + + abstract public String keepMonthlyReportId_InScopeSubQuery_MonthlyReport( + MonthlyReportCQ subQuery); + + protected void regMonthlyReportId(ConditionKey key, Object value) { + registerQuery(key, value, getCValueMonthlyReportId(), + "MONTHLY_REPORT_ID", "MonthlyReportId", "monthlyReportId"); + } + + protected void registerInlineMonthlyReportId(ConditionKey key, Object value) { + registerInlineQuery(key, value, getCValueMonthlyReportId(), + "MONTHLY_REPORT_ID", "MonthlyReportId", "monthlyReportId"); + } + + abstract protected ConditionValue getCValueMonthlyReportId(); + + /** + * Equal(=). And NullIgnored, OnceRegistered. {NotNull : INTEGER : FK to + * WORKING_TYPE} + * + * @param workingTypeId The value of workingTypeId as equal. + */ + public void setWorkingTypeId_Equal(Integer workingTypeId) { + regWorkingTypeId(CK_EQ, workingTypeId); + } + + /** + * NotEqual(!=). And NullIgnored, OnceRegistered. + * + * @param workingTypeId The value of workingTypeId as notEqual. + */ + public void setWorkingTypeId_NotEqual(Integer workingTypeId) { + regWorkingTypeId(CK_NE, workingTypeId); + } + + /** + * GreaterThan(>). And NullIgnored, OnceRegistered. + * + * @param workingTypeId The value of workingTypeId as greaterThan. + */ + public void setWorkingTypeId_GreaterThan(Integer workingTypeId) { + regWorkingTypeId(CK_GT, workingTypeId); + } + + /** + * LessThan(<). And NullIgnored, OnceRegistered. + * + * @param workingTypeId The value of workingTypeId as lessThan. + */ + public void setWorkingTypeId_LessThan(Integer workingTypeId) { + regWorkingTypeId(CK_LT, workingTypeId); + } + + /** + * GreaterEqual(>=). And NullIgnored, OnceRegistered. + * + * @param workingTypeId The value of workingTypeId as greaterEqual. + */ + public void setWorkingTypeId_GreaterEqual(Integer workingTypeId) { + regWorkingTypeId(CK_GE, workingTypeId); + } + + /** + * LessEqual(<=). And NullIgnored, OnceRegistered. + * + * @param workingTypeId The value of workingTypeId as lessEqual. + */ + public void setWorkingTypeId_LessEqual(Integer workingTypeId) { + regWorkingTypeId(CK_LE, workingTypeId); + } + + /** + * InScope(in (1, 2)). And NullIgnored, NullElementIgnored, + * SeveralRegistered. + * + * @param workingTypeIdList The collection of workingTypeId as inScope. + */ + public void setWorkingTypeId_InScope(Collection workingTypeIdList) { + regWorkingTypeId(CK_INS, cTL(workingTypeIdList)); + } + + /** + * NotInScope(not in (1, 2)). And NullIgnored, NullElementIgnored, + * SeveralRegistered. + * + * @param workingTypeIdList The collection of workingTypeId as notInScope. + */ + public void setWorkingTypeId_NotInScope( + Collection workingTypeIdList) { + regWorkingTypeId(CK_NINS, cTL(workingTypeIdList)); + } + + /** + * @param workingTypeCBquery Query. + * @deprecated Please use inScopeWorkingType(subQuery) method. + */ + public void setWorkingTypeId_InScopeSubQuery_WorkingType( + WorkingTypeCQ workingTypeCBquery) { + String subQueryPropertyName = keepWorkingTypeId_InScopeSubQuery_WorkingType(workingTypeCBquery);// for + // saving + // query + // - + // value + // . + registerInScopeSubQuery(workingTypeCBquery, "WORKING_TYPE_ID", "ID", + subQueryPropertyName); + } + + public void inScopeWorkingType(SubQuery subQuery) { + assertObjectNotNull("subQuery", subQuery); + WorkingTypeCB cb = new WorkingTypeCB(); + cb.xsetupForInScopeSubQuery(); + subQuery.query(cb); + String subQueryPropertyName = keepWorkingTypeId_InScopeSubQuery_WorkingType(cb + .query());// for saving query-value. + registerInScopeSubQuery(cb.query(), "WORKING_TYPE_ID", "ID", + subQueryPropertyName); + } + + abstract public String keepWorkingTypeId_InScopeSubQuery_WorkingType( + WorkingTypeCQ subQuery); + + protected void regWorkingTypeId(ConditionKey key, Object value) { + registerQuery(key, value, getCValueWorkingTypeId(), "WORKING_TYPE_ID", + "WorkingTypeId", "workingTypeId"); + } + + protected void registerInlineWorkingTypeId(ConditionKey key, Object value) { + registerInlineQuery(key, value, getCValueWorkingTypeId(), + "WORKING_TYPE_ID", "WorkingTypeId", "workingTypeId"); + } + + abstract protected ConditionValue getCValueWorkingTypeId(); + + // Very Internal (for Suppressing Warn about 'Not Use Import') + protected String getConditionBeanClassNameInternally() { + return MonthlyWorkingReportCB.class.getName(); + } + + protected String getConditionQueryClassNameInternally() { + return MonthlyWorkingReportCQ.class.getName(); + } +} Property changes on: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/cbean/cq/bs/AbstractBsMonthlyWorkingReportCQ.java ___________________________________________________________________ Name: svn:eol-style + native Added: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/cbean/cq/bs/AbstractBsWorkingTypeCQ.java =================================================================== --- timecard/trunk/src/main/java/jp/sf/pal/timecard/db/cbean/cq/bs/AbstractBsWorkingTypeCQ.java (rev 0) +++ timecard/trunk/src/main/java/jp/sf/pal/timecard/db/cbean/cq/bs/AbstractBsWorkingTypeCQ.java 2008-12-02 03:38:50 UTC (rev 1493) @@ -0,0 +1,1490 @@ +package jp.sf.pal.timecard.db.cbean.cq.bs; + +import java.util.Collection; + +import jp.sf.pal.timecard.db.allcommon.cbean.AbstractConditionQuery; +import jp.sf.pal.timecard.db.allcommon.cbean.ConditionQuery; +import jp.sf.pal.timecard.db.allcommon.cbean.SubQuery; +import jp.sf.pal.timecard.db.allcommon.cbean.ckey.ConditionKey; +import jp.sf.pal.timecard.db.allcommon.cbean.cvalue.ConditionValue; +import jp.sf.pal.timecard.db.allcommon.cbean.sqlclause.SqlClause; +import jp.sf.pal.timecard.db.cbean.MonthlyWorkingReportCB; +import jp.sf.pal.timecard.db.cbean.WorkingTypeCB; +import jp.sf.pal.timecard.db.cbean.cq.MonthlyWorkingReportCQ; +import jp.sf.pal.timecard.db.cbean.cq.WorkingTypeCQ; + +/** + * The abstract condition-query of WORKING_TYPE. + * + * @author DBFlute(AutoGenerator) + */ + ¡÷ SuppressWarnings("unchecked") +public abstract class AbstractBsWorkingTypeCQ extends AbstractConditionQuery { + + //========================================================================== + // ========= + // Constructor + // =========== + public AbstractBsWorkingTypeCQ(ConditionQuery childQuery, + SqlClause sqlClause, String aliasName, int nestLevel) { + super(childQuery, sqlClause, aliasName, nestLevel); + } + + //========================================================================== + // ========= + // Table Name + // ========== + public String getTableDbName() { + return "WORKING_TYPE"; + } + + public String getTableSqlName() { + return "WORKING_TYPE"; + } + + //========================================================================== + // ========= + // 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 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 idList) { + regId(CK_NINS, cTL(idList)); + } + + /** + * @param monthlyWorkingReportCBquery Query. + * @deprecated Please use inScopeMonthlyWorkingReportList(subQuery) method. + */ + public void setId_InScopeSubQuery_MonthlyWorkingReportList( + MonthlyWorkingReportCQ monthlyWorkingReportCBquery) { + String subQueryPropertyName = keepId_InScopeSubQuery_MonthlyWorkingReportList(monthlyWorkingReportCBquery);// for + // saving + // query + // - + // value + // . + registerInScopeSubQuery(monthlyWorkingReportCBquery, "ID", + "WORKING_TYPE_ID", subQueryPropertyName); + } + + public void inScopeMonthlyWorkingReportList( + SubQuery subQuery) { + assertObjectNotNull("subQuery", subQuery); + MonthlyWorkingReportCB cb = new MonthlyWorkingReportCB(); + cb.xsetupForInScopeSubQuery(); + subQuery.query(cb); + String subQueryPropertyName = keepId_InScopeSubQuery_MonthlyWorkingReportList(cb + .query());// for saving query-value. + registerInScopeSubQuery(cb.query(), "ID", "WORKING_TYPE_ID", + subQueryPropertyName); + } + + abstract public String keepId_InScopeSubQuery_MonthlyWorkingReportList( + MonthlyWorkingReportCQ subQuery); + + public void notInScopeMonthlyWorkingReportList( + SubQuery subQuery) { + assertObjectNotNull("subQuery", subQuery); + MonthlyWorkingReportCB cb = new MonthlyWorkingReportCB(); + cb.xsetupForInScopeSubQuery(); + subQuery.query(cb); + String subQueryPropertyName = keepId_NotInScopeSubQuery_MonthlyWorkingReportList(cb + .query());// for saving query-value. + registerNotInScopeSubQuery(cb.query(), "ID", "WORKING_TYPE_ID", + subQueryPropertyName); + } + + abstract public String keepId_NotInScopeSubQuery_MonthlyWorkingReportList( + MonthlyWorkingReportCQ subQuery); + + /** + * @param monthlyWorkingReportCBquery Query. + * @deprecated Please use existsMonthlyWorkingReportList(subQuery) method. + */ + public void setId_ExistsSubQuery_MonthlyWorkingReportList( + MonthlyWorkingReportCQ monthlyWorkingReportCBquery) { + String subQueryPropertyName = keepId_ExistsSubQuery_MonthlyWorkingReportList(monthlyWorkingReportCBquery);// for + // saving + // query + // - + // value + // . + registerExistsSubQuery(monthlyWorkingReportCBquery, "ID", + "WORKING_TYPE_ID", subQueryPropertyName); + } + + /** + * Set up 'exists' sub-query. {exists (select WORKING_TYPE_ID from + * MONTHLY_WORKING_REPORT where ...)} + * + * @param subQuery The sub-query of + * Id_ExistsSubQuery_MonthlyWorkingReportList for 'exists'. + * (NotNull) + */ + public void existsMonthlyWorkingReportList( + SubQuery subQuery) { + assertObjectNotNull("subQuery", subQuery); + MonthlyWorkingReportCB cb = new MonthlyWorkingReportCB(); + cb.xsetupForExistsSubQuery(); + subQuery.query(cb); + String subQueryPropertyName = keepId_ExistsSubQuery_MonthlyWorkingReportList(cb + .query());// for saving query-value. + registerExistsSubQuery(cb.query(), "ID", "WORKING_TYPE_ID", + subQueryPropertyName); + } + + abstract public String keepId_ExistsSubQuery_MonthlyWorkingReportList( + MonthlyWorkingReportCQ subQuery); + + /** + * Set up 'not exists' sub-query. {not exists (select WORKING_TYPE_ID from + * MONTHLY_WORKING_REPORT where ...)} + * + * @param subQuery The sub-query of + * Id_NotExistsSubQuery_MonthlyWorkingReportList for 'not + * exists'. (NotNull) + */ + public void notExistsMonthlyWorkingReportList( + SubQuery subQuery) { + assertObjectNotNull("subQuery", subQuery); + MonthlyWorkingReportCB cb = new MonthlyWorkingReportCB(); + cb.xsetupForExistsSubQuery(); + subQuery.query(cb); + String subQueryPropertyName = keepId_NotExistsSubQuery_MonthlyWorkingReportList(cb + .query());// for saving query-value. + registerNotExistsSubQuery(cb.query(), "ID", "WORKING_TYPE_ID", + subQueryPropertyName); + } + + abstract public String keepId_NotExistsSubQuery_MonthlyWorkingReportList( + MonthlyWorkingReportCQ subQuery); + + public void xderiveMonthlyWorkingReportList(String function, + SubQuery subQuery, String aliasName) { + assertObjectNotNull("subQuery", subQuery); + MonthlyWorkingReportCB cb = new MonthlyWorkingReportCB(); + cb.xsetupForDeriveReferrer(); + subQuery.query(cb); + String subQueryPropertyName = keepId_DeriveSubQuery_MonthlyWorkingReportList(cb + .query());// for saving query-value. + registerDeriveSubQuery(function, cb.query(), "ID", "WORKING_TYPE_ID", + subQueryPropertyName, aliasName); + } + + abstract public String keepId_DeriveSubQuery_MonthlyWorkingReportList( + MonthlyWorkingReportCQ 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 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.timecard.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + registerLikeSearchQuery(CK_LS, fRES(name), getCValueName(), "NAME", + "Name", "name", likeSearchOption); + } + + /** + * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NullOrEmptyElementIgnored, SeveralRegistered. + * + * @param nameList The collection of name as inScope. + */ + public void setName_InScope(Collection 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.timecard.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 nameList) { + regName(CK_NINS, cTL(nameList)); + } + + 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 NullIgnored, OnceRegistered. {NotNull : INTEGER} + * + * @param value The value of value as equal. + */ + public void setValue_Equal(Integer value) { + regValue(CK_EQ, value); + } + + /** + * NotEqual(!=). And NullIgnored, OnceRegistered. + * + * @param value The value of value as notEqual. + */ + public void setValue_NotEqual(Integer value) { + regValue(CK_NE, value); + } + + /** + * GreaterThan(>). And NullIgnored, OnceRegistered. + * + * @param value The value of value as greaterThan. + */ + public void setValue_GreaterThan(Integer value) { + regValue(CK_GT, value); + } + + /** + * LessThan(<). And NullIgnored, OnceRegistered. + * + * @param value The value of value as lessThan. + */ + public void setValue_LessThan(Integer value) { + regValue(CK_LT, value); + } + + /** + * GreaterEqual(>=). And NullIgnored, OnceRegistered. + * + * @param value The value of value as greaterEqual. + */ + public void setValue_GreaterEqual(Integer value) { + regValue(CK_GE, value); + } + + /** + * LessEqual(<=). And NullIgnored, OnceRegistered. + * + * @param value The value of value as lessEqual. + */ + public void setValue_LessEqual(Integer value) { + regValue(CK_LE, value); + } + + /** + * InScope(in (1, 2)). And NullIgnored, NullElementIgnored, + * SeveralRegistered. + * + * @param valueList The collection of value as inScope. + */ + public void setValue_InScope(Collection valueList) { + regValue(CK_INS, cTL(valueList)); + } + + /** + * NotInScope(not in (1, 2)). And NullIgnored, NullElementIgnored, + * SeveralRegistered. + * + * @param valueList The collection of value as notInScope. + */ + public void setValue_NotInScope(Collection valueList) { + regValue(CK_NINS, cTL(valueList)); + } + + protected void regValue(ConditionKey key, Object value) { + registerQuery(key, value, getCValueValue(), "VALUE", "Value", "value"); + } + + protected void registerInlineValue(ConditionKey key, Object value) { + registerInlineQuery(key, value, getCValueValue(), "VALUE", "Value", + "value"); + } + + abstract protected ConditionValue getCValueValue(); + + /** + * 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.timecard.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + registerLikeSearchQuery(CK_LS, fRES(type), getCValueType(), "TYPE", + "Type", "type", likeSearchOption); + } + + /** + * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NullOrEmptyElementIgnored, SeveralRegistered. + * + * @param typeList The collection of type as inScope. + */ + public void setType_InScope(Collection 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.timecard.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 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. {INTEGER : Default=[1]} + * + * @param parentId The value of parentId as equal. + */ + public void setParentId_Equal(Integer parentId) { + regParentId(CK_EQ, parentId); + } + + /** + * NotEqual(!=). And NullIgnored, OnceRegistered. + * + * @param parentId The value of parentId as notEqual. + */ + public void setParentId_NotEqual(Integer parentId) { + regParentId(CK_NE, parentId); + } + + /** + * GreaterThan(>). And NullIgnored, OnceRegistered. + * + * @param parentId The value of parentId as greaterThan. + */ + public void setParentId_GreaterThan(Integer parentId) { + regParentId(CK_GT, parentId); + } + + /** + * LessThan(<). And NullIgnored, OnceRegistered. + * + * @param parentId The value of parentId as lessThan. + */ + public void setParentId_LessThan(Integer parentId) { + regParentId(CK_LT, parentId); + } + + /** + * GreaterEqual(>=). And NullIgnored, OnceRegistered. + * + * @param parentId The value of parentId as greaterEqual. + */ + public void setParentId_GreaterEqual(Integer parentId) { + regParentId(CK_GE, parentId); + } + + /** + * LessEqual(<=). And NullIgnored, OnceRegistered. + * + * @param parentId The value of parentId as lessEqual. + */ + public void setParentId_LessEqual(Integer parentId) { + regParentId(CK_LE, parentId); + } + + /** + * InScope(in (1, 2)). And NullIgnored, NullElementIgnored, + * SeveralRegistered. + * + * @param parentIdList The collection of parentId as inScope. + */ + public void setParentId_InScope(Collection parentIdList) { + regParentId(CK_INS, cTL(parentIdList)); + } + + /** + * NotInScope(not in (1, 2)). And NullIgnored, NullElementIgnored, + * SeveralRegistered. + * + * @param parentIdList The collection of parentId as notInScope. + */ + public void setParentId_NotInScope(Collection parentIdList) { + regParentId(CK_NINS, cTL(parentIdList)); + } + + /** + * IsNull(is null). And OnceRegistered. + */ + public void setParentId_IsNull() { + regParentId(CK_ISN, DUMMY_OBJECT); + } + + /** + * IsNotNull(is not null). And OnceRegistered. + */ + public void setParentId_IsNotNull() { + regParentId(CK_ISNN, DUMMY_OBJECT); + } + + protected void regParentId(ConditionKey key, Object value) { + registerQuery(key, value, getCValueParentId(), "PARENT_ID", "ParentId", + "parentId"); + } + + protected void registerInlineParentId(ConditionKey key, Object value) { + registerInlineQuery(key, value, getCValueParentId(), "PARENT_ID", + "ParentId", "parentId"); + } + + abstract protected ConditionValue getCValueParentId(); + + /** + * 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.timecard.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.timecard.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.timecard.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + registerLikeSearchQuery(CK_LS, fRES(createdBy), getCValueCreatedBy(), + "CREATED_BY", "CreatedBy", "createdBy", likeSearchOption); + } + + /** + * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NullOrEmptyElementIgnored, SeveralRegistered. + * + * @param createdByList The collection of createdBy as inScope. + */ + public void setCreatedBy_InScope(Collection 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.timecard.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 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.timecard.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.timecard.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.timecard.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + registerLikeSearchQuery(CK_LS, fRES(updatedBy), getCValueUpdatedBy(), + "UPDATED_BY", "UpdatedBy", "updatedBy", likeSearchOption); + } + + /** + * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NullOrEmptyElementIgnored, SeveralRegistered. + * + * @param updatedByList The collection of updatedBy as inScope. + */ + public void setUpdatedBy_InScope(Collection 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.timecard.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 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.timecard.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.timecard.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.timecard.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + registerLikeSearchQuery(CK_LS, fRES(deletedBy), getCValueDeletedBy(), + "DELETED_BY", "DeletedBy", "deletedBy", likeSearchOption); + } + + /** + * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NullOrEmptyElementIgnored, SeveralRegistered. + * + * @param deletedByList The collection of deletedBy as inScope. + */ + public void setDeletedBy_InScope(Collection 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.timecard.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 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 : + * Default=[0]} + * + * @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 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 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 WorkingTypeCB.class.getName(); + } + + protected String getConditionQueryClassNameInternally() { + return WorkingTypeCQ.class.getName(); + } +} Property changes on: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/cbean/cq/bs/AbstractBsWorkingTypeCQ.java ___________________________________________________________________ Name: svn:eol-style + native Modified: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/cbean/cq/bs/BsEmployeeCQ.java =================================================================== --- timecard/trunk/src/main/java/jp/sf/pal/timecard/db/cbean/cq/bs/BsEmployeeCQ.java 2008-12-01 14:26:07 UTC (rev 1492) +++ timecard/trunk/src/main/java/jp/sf/pal/timecard/db/cbean/cq/bs/BsEmployeeCQ.java 2008-12-02 03:38:50 UTC (rev 1493) @@ -261,29 +261,6 @@ return this; } - protected ConditionValue _paidHolidays; - - public ConditionValue getPaidHolidays() { - if (_paidHolidays == null) { - _paidHolidays = new ConditionValue(); - } - return _paidHolidays; - } - - protected ConditionValue getCValuePaidHolidays() { - return getPaidHolidays(); - } - - public BsEmployeeCQ addOrderBy_PaidHolidays_Asc() { - regOBA("PAID_HOLIDAYS"); - return this; - } - - public BsEmployeeCQ addOrderBy_PaidHolidays_Desc() { - regOBD("PAID_HOLIDAYS"); - return this; - } - protected ConditionValue _isAvailable; public ConditionValue getIsAvailable() { Modified: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/cbean/cq/bs/BsMonthlyReportCQ.java =================================================================== --- timecard/trunk/src/main/java/jp/sf/pal/timecard/db/cbean/cq/bs/BsMonthlyReportCQ.java 2008-12-01 14:26:07 UTC (rev 1492) +++ timecard/trunk/src/main/java/jp/sf/pal/timecard/db/cbean/cq/bs/BsMonthlyReportCQ.java 2008-12-02 03:38:50 UTC (rev 1493) @@ -8,6 +8,7 @@ import jp.sf.pal.timecard.db.cbean.cq.DailyReportCQ; import jp.sf.pal.timecard.db.cbean.cq.EmployeeCQ; import jp.sf.pal.timecard.db.cbean.cq.MonthlyReportCQ; +import jp.sf.pal.timecard.db.cbean.cq.MonthlyWorkingReportCQ; import jp.sf.pal.timecard.db.cbean.cq.ciq.MonthlyReportCIQ; /** @@ -102,6 +103,23 @@ return "id_InScopeSubQuery_DailyReportList." + key; } + protected Map _id_InScopeSubQuery_MonthlyWorkingReportListMap; + + public Map getId_InScopeSubQuery_MonthlyWorkingReportList() { + return _id_InScopeSubQuery_MonthlyWorkingReportListMap; + } + + public String keepId_InScopeSubQuery_MonthlyWorkingReportList( + MonthlyWorkingReportCQ subQuery) { + if (_id_InScopeSubQuery_MonthlyWorkingReportListMap == null) { + _id_InScopeSubQuery_MonthlyWorkingReportListMap = newLinkedHashMap(); + } + String key = "subQueryMapKey" + + (_id_InScopeSubQuery_MonthlyWorkingReportListMap.size() + 1); + _id_InScopeSubQuery_MonthlyWorkingReportListMap.put(key, subQuery); + return "id_InScopeSubQuery_MonthlyWorkingReportList." + key; + } + protected Map _id_NotInScopeSubQuery_DailyReportListMap; public Map getId_NotInScopeSubQuery_DailyReportList() { @@ -119,6 +137,23 @@ return "id_NotInScopeSubQuery_DailyReportList." + key; } + protected Map _id_NotInScopeSubQuery_MonthlyWorkingReportListMap; + + public Map getId_NotInScopeSubQuery_MonthlyWorkingReportList() { + return _id_NotInScopeSubQuery_MonthlyWorkingReportListMap; + } + + public String keepId_NotInScopeSubQuery_MonthlyWorkingReportList( + MonthlyWorkingReportCQ subQuery) { + if (_id_NotInScopeSubQuery_MonthlyWorkingReportListMap == null) { + _id_NotInScopeSubQuery_MonthlyWorkingReportListMap = newLinkedHashMap(); + } + String key = "subQueryMapKey" + + (_id_NotInScopeSubQuery_MonthlyWorkingReportListMap.size() + 1); + _id_NotInScopeSubQuery_MonthlyWorkingReportListMap.put(key, subQuery); + return "id_NotInScopeSubQuery_MonthlyWorkingReportList." + key; + } + protected Map _id_ExistsSubQuery_DailyReportListMap; public Map getId_ExistsSubQuery_DailyReportList() { @@ -135,6 +170,23 @@ return "id_ExistsSubQuery_DailyReportList." + key; } + protected Map _id_ExistsSubQuery_MonthlyWorkingReportListMap; + + public Map getId_ExistsSubQuery_MonthlyWorkingReportList() { + return _id_ExistsSubQuery_MonthlyWorkingReportListMap; + } + + public String keepId_ExistsSubQuery_MonthlyWorkingReportList( + MonthlyWorkingReportCQ subQuery) { + if (_id_ExistsSubQuery_MonthlyWorkingReportListMap == null) { + _id_ExistsSubQuery_MonthlyWorkingReportListMap = newLinkedHashMap(); + } + String key = "subQueryMapKey" + + (_id_ExistsSubQuery_MonthlyWorkingReportListMap.size() + 1); + _id_ExistsSubQuery_MonthlyWorkingReportListMap.put(key, subQuery); + return "id_ExistsSubQuery_MonthlyWorkingReportList." + key; + } + protected Map _id_NotExistsSubQuery_DailyReportListMap; public Map getId_NotExistsSubQuery_DailyReportList() { @@ -152,6 +204,23 @@ return "id_NotExistsSubQuery_DailyReportList." + key; } + protected Map _id_NotExistsSubQuery_MonthlyWorkingReportListMap; + + public Map getId_NotExistsSubQuery_MonthlyWorkingReportList() { + return _id_NotExistsSubQuery_MonthlyWorkingReportListMap; + } + + public String keepId_NotExistsSubQuery_MonthlyWorkingReportList( + MonthlyWorkingReportCQ subQuery) { + if (_id_NotExistsSubQuery_MonthlyWorkingReportListMap == null) { + _id_NotExistsSubQuery_MonthlyWorkingReportListMap = newLinkedHashMap(); + } + String key = "subQueryMapKey" + + (_id_NotExistsSubQuery_MonthlyWorkingReportListMap.size() + 1); + _id_NotExistsSubQuery_MonthlyWorkingReportListMap.put(key, subQuery); + return "id_NotExistsSubQuery_MonthlyWorkingReportList." + key; + } + protected Map _id_DeriveSubQuery_DailyReportListMap; public Map getId_DeriveSubQuery_DailyReportList() { @@ -168,6 +237,23 @@ return "id_DeriveSubQuery_DailyReportList." + key; } + protected Map _id_DeriveSubQuery_MonthlyWorkingReportListMap; + + public Map getId_DeriveSubQuery_MonthlyWorkingReportList() { + return _id_DeriveSubQuery_MonthlyWorkingReportListMap; + } + + public String keepId_DeriveSubQuery_MonthlyWorkingReportList( + MonthlyWorkingReportCQ subQuery) { + if (_id_DeriveSubQuery_MonthlyWorkingReportListMap == null) { + _id_DeriveSubQuery_MonthlyWorkingReportListMap = newLinkedHashMap(); + } + String key = "subQueryMapKey" + + (_id_DeriveSubQuery_MonthlyWorkingReportListMap.size() + 1); + _id_DeriveSubQuery_MonthlyWorkingReportListMap.put(key, subQuery); + return "id_DeriveSubQuery_MonthlyWorkingReportList." + key; + } + public BsMonthlyReportCQ addOrderBy_Id_Asc() { regOBA("ID"); return this; @@ -247,29 +333,6 @@ return this; } - protected ConditionValue _workingDays; - - public ConditionValue getWorkingDays() { - if (_workingDays == null) { - _workingDays = new ConditionValue(); - } - return _workingDays; - } - - protected ConditionValue getCValueWorkingDays() { - return getWorkingDays(); - } - - public BsMonthlyReportCQ addOrderBy_WorkingDays_Asc() { - regOBA("WORKING_DAYS"); - return this; - } - - public BsMonthlyReportCQ addOrderBy_WorkingDays_Desc() { - regOBD("WORKING_DAYS"); - return this; - } - protected ConditionValue _stdWorkingDays; public ConditionValue getStdWorkingDays() { @@ -293,52 +356,6 @@ return this; } - protected ConditionValue _holidays; - - public ConditionValue getHolidays() { - if (_holidays == null) { - _holidays = new ConditionValue(); - } - return _holidays; - } - - protected ConditionValue getCValueHolidays() { - return getHolidays(); - } - - public BsMonthlyReportCQ addOrderBy_Holidays_Asc() { - regOBA("HOLIDAYS"); - return this; - } - - public BsMonthlyReportCQ addOrderBy_Holidays_Desc() { - regOBD("HOLIDAYS"); - return this; - } - - protected ConditionValue _paidHolidays; - - public ConditionValue getPaidHolidays() { - if (_paidHolidays == null) { - _paidHolidays = new ConditionValue(); - } - return _paidHolidays; - } - - protected ConditionValue getCValuePaidHolidays() { - return getPaidHolidays(); - } - - public BsMonthlyReportCQ addOrderBy_PaidHolidays_Asc() { - regOBA("PAID_HOLIDAYS"); - return this; - } - - public BsMonthlyReportCQ addOrderBy_PaidHolidays_Desc() { - regOBD("PAID_HOLIDAYS"); - return this; - } - protected ConditionValue _workingTime; public ConditionValue getWorkingTime() { Added: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/cbean/cq/bs/BsMonthlyWorkingReportCQ.java =================================================================== --- timecard/trunk/src/main/java/jp/sf/pal/timecard/db/cbean/cq/bs/BsMonthlyWorkingReportCQ.java (rev 0) +++ timecard/trunk/src/main/java/jp/sf/pal/timecard/db/cbean/cq/bs/BsMonthlyWorkingReportCQ.java 2008-12-02 03:38:50 UTC (rev 1493) @@ -0,0 +1,322 @@ +package jp.sf.pal.timecard.db.cbean.cq.bs; + +import java.util.Map; + +import jp.sf.pal.timecard.db.allcommon.cbean.ConditionQuery; +import jp.sf.pal.timecard.db.allcommon.cbean.cvalue.ConditionValue; +import jp.sf.pal.timecard.db.allcommon.cbean.sqlclause.SqlClause; +import jp.sf.pal.timecard.db.cbean.cq.MonthlyReportCQ; +import jp.sf.pal.timecard.db.cbean.cq.MonthlyWorkingReportCQ; +import jp.sf.pal.timecard.db.cbean.cq.WorkingTypeCQ; +import jp.sf.pal.timecard.db.cbean.cq.ciq.MonthlyWorkingReportCIQ; + +/** + * The base condition-query of MONTHLY_WORKING_REPORT. + * + * @author DBFlute(AutoGenerator) + */ + ¡÷ SuppressWarnings("unchecked") +public class BsMonthlyWorkingReportCQ extends AbstractBsMonthlyWorkingReportCQ { + + //========================================================================== + // ========= + // Attribute + // ========= + protected MonthlyWorkingReportCIQ _inlineQuery; + + //========================================================================== + // ========= + // Constructor + // =========== + public BsMonthlyWorkingReportCQ(ConditionQuery childQuery, + SqlClause sqlClause, String aliasName, int nestLevel) { + super(childQuery, sqlClause, aliasName, nestLevel); + } + + //========================================================================== + // ========= + // Inline + // ====== + /** + * Prepare inline query.
    {select ... from ... left outer join (select + * * from MONTHLY_WORKING_REPORT) where abc = [abc] ...} + * + * @return Inline query. (NotNull) + */ + public MonthlyWorkingReportCIQ inline() { + if (_inlineQuery == null) { + _inlineQuery = new MonthlyWorkingReportCIQ(getChildQuery(), + getSqlClause(), getAliasName(), getNestLevel(), this); + } + _inlineQuery.xsetOnClauseInline(false); + return _inlineQuery; + } + + /** + * Prepare on-clause query.
    {select ... from ... left outer join + * MONTHLY_WORKING_REPORT on ... and abc = [abc] ...} + * + * @return On-clause query. (NotNull) + */ + public MonthlyWorkingReportCIQ on() { + if (isBaseQuery(this)) { + throw new UnsupportedOperationException( + "Unsupported onClause of Base Table!"); + } + MonthlyWorkingReportCIQ 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 BsMonthlyWorkingReportCQ addOrderBy_Id_Asc() { + regOBA("ID"); + return this; + } + + public BsMonthlyWorkingReportCQ addOrderBy_Id_Desc() { + regOBD("ID"); + return this; + } + + protected ConditionValue _value; + + public ConditionValue getValue() { + if (_value == null) { + _value = new ConditionValue(); + } + return _value; + } + + protected ConditionValue getCValueValue() { + return getValue(); + } + + public BsMonthlyWorkingReportCQ addOrderBy_Value_Asc() { + regOBA("VALUE"); + return this; + } + + public BsMonthlyWorkingReportCQ addOrderBy_Value_Desc() { + regOBD("VALUE"); + return this; + } + + protected ConditionValue _monthlyReportId; + + public ConditionValue getMonthlyReportId() { + if (_monthlyReportId == null) { + _monthlyReportId = new ConditionValue(); + } + return _monthlyReportId; + } + + protected ConditionValue getCValueMonthlyReportId() { + return getMonthlyReportId(); + } + + protected Map _monthlyReportId_InScopeSubQuery_MonthlyReportMap; + + public Map getMonthlyReportId_InScopeSubQuery_MonthlyReport() { + return _monthlyReportId_InScopeSubQuery_MonthlyReportMap; + } + + public String keepMonthlyReportId_InScopeSubQuery_MonthlyReport( + MonthlyReportCQ subQuery) { + if (_monthlyReportId_InScopeSubQuery_MonthlyReportMap == null) { + _monthlyReportId_InScopeSubQuery_MonthlyReportMap = newLinkedHashMap(); + } + String key = "subQueryMapKey" + + (_monthlyReportId_InScopeSubQuery_MonthlyReportMap.size() + 1); + _monthlyReportId_InScopeSubQuery_MonthlyReportMap.put(key, subQuery); + return "monthlyReportId_InScopeSubQuery_MonthlyReport." + key; + } + + public BsMonthlyWorkingReportCQ addOrderBy_MonthlyReportId_Asc() { + regOBA("MONTHLY_REPORT_ID"); + return this; + } + + public BsMonthlyWorkingReportCQ addOrderBy_MonthlyReportId_Desc() { + regOBD("MONTHLY_REPORT_ID"); + return this; + } + + protected ConditionValue _workingTypeId; + + public ConditionValue getWorkingTypeId() { + if (_workingTypeId == null) { + _workingTypeId = new ConditionValue(); + } + return _workingTypeId; + } + + protected ConditionValue getCValueWorkingTypeId() { + return getWorkingTypeId(); + } + + protected Map _workingTypeId_InScopeSubQuery_WorkingTypeMap; + + public Map getWorkingTypeId_InScopeSubQuery_WorkingType() { + return _workingTypeId_InScopeSubQuery_WorkingTypeMap; + } + + public String keepWorkingTypeId_InScopeSubQuery_WorkingType( + WorkingTypeCQ subQuery) { + if (_workingTypeId_InScopeSubQuery_WorkingTypeMap == null) { + _workingTypeId_InScopeSubQuery_WorkingTypeMap = newLinkedHashMap(); + } + String key = "subQueryMapKey" + + (_workingTypeId_InScopeSubQuery_WorkingTypeMap.size() + 1); + _workingTypeId_InScopeSubQuery_WorkingTypeMap.put(key, subQuery); + return "workingTypeId_InScopeSubQuery_WorkingType." + key; + } + + public BsMonthlyWorkingReportCQ addOrderBy_WorkingTypeId_Asc() { + regOBA("WORKING_TYPE_ID"); + return this; + } + + public BsMonthlyWorkingReportCQ addOrderBy_WorkingTypeId_Desc() { + regOBD("WORKING_TYPE_ID"); + return this; + } + + //========================================================================== + // ========= + // Specified Derived OrderBy + // ========================= + public BsMonthlyWorkingReportCQ addSpecifiedDerivedOrderBy_Asc( + String aliasName) { + registerSpecifiedDerivedOrderBy_Asc(aliasName); + return this; + } + + public BsMonthlyWorkingReportCQ addSpecifiedDerivedOrderBy_Desc( + String aliasName) { + registerSpecifiedDerivedOrderBy_Desc(aliasName); + return this; + } + + //========================================================================== + // ========= + // Union Query + // =========== + protected void reflectRelationOnUnionQuery(ConditionQuery baseQueryAsSuper, + ConditionQuery unionQueryAsSuper) { + MonthlyWorkingReportCQ baseQuery = (MonthlyWorkingReportCQ) baseQueryAsSuper; + MonthlyWorkingReportCQ unionQuery = (MonthlyWorkingReportCQ) unionQueryAsSuper; + if (baseQuery.hasConditionQueryMonthlyReport()) { + unionQuery.queryMonthlyReport().reflectRelationOnUnionQuery( + baseQuery.queryMonthlyReport(), + unionQuery.queryMonthlyReport()); + } + if (baseQuery.hasConditionQueryWorkingType()) { + unionQuery.queryWorkingType() + .reflectRelationOnUnionQuery(baseQuery.queryWorkingType(), + unionQuery.queryWorkingType()); + } + } + + //========================================================================== + // ========= + // Foreign Query + // ============= + + public MonthlyReportCQ queryMonthlyReport() { + return getConditionQueryMonthlyReport(); + } + + protected MonthlyReportCQ _conditionQueryMonthlyReport; + + public MonthlyReportCQ getConditionQueryMonthlyReport() { + if (_conditionQueryMonthlyReport == null) { + _conditionQueryMonthlyReport = createQueryMonthlyReport(); + setupOuterJoin_MonthlyReport(); + } + return _conditionQueryMonthlyReport; + } + + protected void setupOuterJoin_MonthlyReport() { + Map joinOnMap = newLinkedHashMap(); + joinOnMap.put(getRealColumnName("MONTHLY_REPORT_ID"), + getConditionQueryMonthlyReport().getRealColumnName("ID")); + registerOuterJoin(getConditionQueryMonthlyReport(), joinOnMap); + } + + protected MonthlyReportCQ createQueryMonthlyReport() { + String nrp = resolveNextRelationPath("MONTHLY_WORKING_REPORT", + "monthlyReport"); + String jan = resolveJoinAliasName(nrp, getNextNestLevel()); + MonthlyReportCQ cq = new MonthlyReportCQ(this, getSqlClause(), jan, + getNextNestLevel()); + cq.xsetForeignPropertyName("monthlyReport"); + cq.xsetRelationPath(nrp); + return cq; + } + + public boolean hasConditionQueryMonthlyReport() { + return _conditionQueryMonthlyReport != null; + } + + public WorkingTypeCQ queryWorkingType() { + return getConditionQueryWorkingType(); + } + + protected WorkingTypeCQ _conditionQueryWorkingType; + + public WorkingTypeCQ getConditionQueryWorkingType() { + if (_conditionQueryWorkingType == null) { + _conditionQueryWorkingType = createQueryWorkingType(); + setupOuterJoin_WorkingType(); + } + return _conditionQueryWorkingType; + } + + protected void setupOuterJoin_WorkingType() { + Map joinOnMap = newLinkedHashMap(); + joinOnMap.put(getRealColumnName("WORKING_TYPE_ID"), + getConditionQueryWorkingType().getRealColumnName("ID")); + registerOuterJoin(getConditionQueryWorkingType(), joinOnMap); + } + + protected WorkingTypeCQ createQueryWorkingType() { + String nrp = resolveNextRelationPath("MONTHLY_WORKING_REPORT", + "workingType"); + String jan = resolveJoinAliasName(nrp, getNextNestLevel()); + WorkingTypeCQ cq = new WorkingTypeCQ(this, getSqlClause(), jan, + getNextNestLevel()); + cq.xsetForeignPropertyName("workingType"); + cq.xsetRelationPath(nrp); + return cq; + } + + public boolean hasConditionQueryWorkingType() { + return _conditionQueryWorkingType != null; + } + + protected String getConditionQueryClassNameInternally() { + return MonthlyWorkingReportCQ.class.getName(); + } + + protected String getMapClassNameInternally() { + return Map.class.getName(); + } +} Property changes on: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/cbean/cq/bs/BsMonthlyWorkingReportCQ.java ___________________________________________________________________ Name: svn:eol-style + native Added: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/cbean/cq/bs/BsWorkingTypeCQ.java =================================================================== --- timecard/trunk/src/main/java/jp/sf/pal/timecard/db/cbean/cq/bs/BsWorkingTypeCQ.java (rev 0) +++ timecard/trunk/src/main/java/jp/sf/pal/timecard/db/cbean/cq/bs/BsWorkingTypeCQ.java 2008-12-02 03:38:50 UTC (rev 1493) @@ -0,0 +1,470 @@ +package jp.sf.pal.timecard.db.cbean.cq.bs; + +import java.util.Map; + +import jp.sf.pal.timecard.db.allcommon.cbean.ConditionQuery; +import jp.sf.pal.timecard.db.allcommon.cbean.cvalue.ConditionValue; +import jp.sf.pal.timecard.db.allcommon.cbean.sqlclause.SqlClause; +import jp.sf.pal.timecard.db.cbean.cq.MonthlyWorkingReportCQ; +import jp.sf.pal.timecard.db.cbean.cq.WorkingTypeCQ; +import jp.sf.pal.timecard.db.cbean.cq.ciq.WorkingTypeCIQ; + +/** + * The base condition-query of WORKING_TYPE. + * + * @author DBFlute(AutoGenerator) + */ + ¡÷ SuppressWarnings("unchecked") +public class BsWorkingTypeCQ extends AbstractBsWorkingTypeCQ { + + //========================================================================== + // ========= + // Attribute + // ========= + protected WorkingTypeCIQ _inlineQuery; + + //========================================================================== + // ========= + // Constructor + // =========== + public BsWorkingTypeCQ(ConditionQuery childQuery, SqlClause sqlClause, + String aliasName, int nestLevel) { + super(childQuery, sqlClause, aliasName, nestLevel); + } + + //========================================================================== + // ========= + // Inline + // ====== + /** + * Prepare inline query.
    {select ... from ... left outer join (select + * * from WORKING_TYPE) where abc = [abc] ...} + * + * @return Inline query. (NotNull) + */ + public WorkingTypeCIQ inline() { + if (_inlineQuery == null) { + _inlineQuery = new WorkingTypeCIQ(getChildQuery(), getSqlClause(), + getAliasName(), getNestLevel(), this); + } + _inlineQuery.xsetOnClauseInline(false); + return _inlineQuery; + } + + /** + * Prepare on-clause query.
    {select ... from ... left outer join + * WORKING_TYPE on ... and abc = [abc] ...} + * + * @return On-clause query. (NotNull) + */ + public WorkingTypeCIQ on() { + if (isBaseQuery(this)) { + throw new UnsupportedOperationException( + "Unsupported onClause of Base Table!"); + } + WorkingTypeCIQ 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 _id_InScopeSubQuery_MonthlyWorkingReportListMap; + + public Map getId_InScopeSubQuery_MonthlyWorkingReportList() { + return _id_InScopeSubQuery_MonthlyWorkingReportListMap; + } + + public String keepId_InScopeSubQuery_MonthlyWorkingReportList( + MonthlyWorkingReportCQ subQuery) { + if (_id_InScopeSubQuery_MonthlyWorkingReportListMap == null) { + _id_InScopeSubQuery_MonthlyWorkingReportListMap = newLinkedHashMap(); + } + String key = "subQueryMapKey" + + (_id_InScopeSubQuery_MonthlyWorkingReportListMap.size() + 1); + _id_InScopeSubQuery_MonthlyWorkingReportListMap.put(key, subQuery); + return "id_InScopeSubQuery_MonthlyWorkingReportList." + key; + } + + protected Map _id_NotInScopeSubQuery_MonthlyWorkingReportListMap; + + public Map getId_NotInScopeSubQuery_MonthlyWorkingReportList() { + return _id_NotInScopeSubQuery_MonthlyWorkingReportListMap; + } + + public String keepId_NotInScopeSubQuery_MonthlyWorkingReportList( + MonthlyWorkingReportCQ subQuery) { + if (_id_NotInScopeSubQuery_MonthlyWorkingReportListMap == null) { + _id_NotInScopeSubQuery_MonthlyWorkingReportListMap = newLinkedHashMap(); + } + String key = "subQueryMapKey" + + (_id_NotInScopeSubQuery_MonthlyWorkingReportListMap.size() + 1); + _id_NotInScopeSubQuery_MonthlyWorkingReportListMap.put(key, subQuery); + return "id_NotInScopeSubQuery_MonthlyWorkingReportList." + key; + } + + protected Map _id_ExistsSubQuery_MonthlyWorkingReportListMap; + + public Map getId_ExistsSubQuery_MonthlyWorkingReportList() { + return _id_ExistsSubQuery_MonthlyWorkingReportListMap; + } + + public String keepId_ExistsSubQuery_MonthlyWorkingReportList( + MonthlyWorkingReportCQ subQuery) { + if (_id_ExistsSubQuery_MonthlyWorkingReportListMap == null) { + _id_ExistsSubQuery_MonthlyWorkingReportListMap = newLinkedHashMap(); + } + String key = "subQueryMapKey" + + (_id_ExistsSubQuery_MonthlyWorkingReportListMap.size() + 1); + _id_ExistsSubQuery_MonthlyWorkingReportListMap.put(key, subQuery); + return "id_ExistsSubQuery_MonthlyWorkingReportList." + key; + } + + protected Map _id_NotExistsSubQuery_MonthlyWorkingReportListMap; + + public Map getId_NotExistsSubQuery_MonthlyWorkingReportList() { + return _id_NotExistsSubQuery_MonthlyWorkingReportListMap; + } + + public String keepId_NotExistsSubQuery_MonthlyWorkingReportList( + MonthlyWorkingReportCQ subQuery) { + if (_id_NotExistsSubQuery_MonthlyWorkingReportListMap == null) { + _id_NotExistsSubQuery_MonthlyWorkingReportListMap = newLinkedHashMap(); + } + String key = "subQueryMapKey" + + (_id_NotExistsSubQuery_MonthlyWorkingReportListMap.size() + 1); + _id_NotExistsSubQuery_MonthlyWorkingReportListMap.put(key, subQuery); + return "id_NotExistsSubQuery_MonthlyWorkingReportList." + key; + } + + protected Map _id_DeriveSubQuery_MonthlyWorkingReportListMap; + + public Map getId_DeriveSubQuery_MonthlyWorkingReportList() { + return _id_DeriveSubQuery_MonthlyWorkingReportListMap; + } + + public String keepId_DeriveSubQuery_MonthlyWorkingReportList( + MonthlyWorkingReportCQ subQuery) { + if (_id_DeriveSubQuery_MonthlyWorkingReportListMap == null) { + _id_DeriveSubQuery_MonthlyWorkingReportListMap = newLinkedHashMap(); + } + String key = "subQueryMapKey" + + (_id_DeriveSubQuery_MonthlyWorkingReportListMap.size() + 1); + _id_DeriveSubQuery_MonthlyWorkingReportListMap.put(key, subQuery); + return "id_DeriveSubQuery_MonthlyWorkingReportList." + key; + } + + public BsWorkingTypeCQ addOrderBy_Id_Asc() { + regOBA("ID"); + return this; + } + + public BsWorkingTypeCQ addOrderBy_Id_Desc() { + regOBD("ID"); + return this; + } + + protected ConditionValue _name; + + public ConditionValue getName() { + if (_name == null) { + _name = new ConditionValue(); + } + return _name; + } + + protected ConditionValue getCValueName() { + return getName(); + } + + public BsWorkingTypeCQ addOrderBy_Name_Asc() { + regOBA("NAME"); + return this; + } + + public BsWorkingTypeCQ addOrderBy_Name_Desc() { + regOBD("NAME"); + return this; + } + + protected ConditionValue _value; + + public ConditionValue getValue() { + if (_value == null) { + _value = new ConditionValue(); + } + return _value; + } + + protected ConditionValue getCValueValue() { + return getValue(); + } + + public BsWorkingTypeCQ addOrderBy_Value_Asc() { + regOBA("VALUE"); + return this; + } + + public BsWorkingTypeCQ addOrderBy_Value_Desc() { + regOBD("VALUE"); + return this; + } + + protected ConditionValue _type; + + public ConditionValue getType() { + if (_type == null) { + _type = new ConditionValue(); + } + return _type; + } + + protected ConditionValue getCValueType() { + return getType(); + } + + public BsWorkingTypeCQ addOrderBy_Type_Asc() { + regOBA("TYPE"); + return this; + } + + public BsWorkingTypeCQ addOrderBy_Type_Desc() { + regOBD("TYPE"); + return this; + } + + protected ConditionValue _parentId; + + public ConditionValue getParentId() { + if (_parentId == null) { + _parentId = new ConditionValue(); + } + return _parentId; + } + + protected ConditionValue getCValueParentId() { + return getParentId(); + } + + public BsWorkingTypeCQ addOrderBy_ParentId_Asc() { + regOBA("PARENT_ID"); + return this; + } + + public BsWorkingTypeCQ addOrderBy_ParentId_Desc() { + regOBD("PARENT_ID"); + return this; + } + + protected ConditionValue _createdTime; + + public ConditionValue getCreatedTime() { + if (_createdTime == null) { + _createdTime = new ConditionValue(); + } + return _createdTime; + } + + protected ConditionValue getCValueCreatedTime() { + return getCreatedTime(); + } + + public BsWorkingTypeCQ addOrderBy_CreatedTime_Asc() { + regOBA("CREATED_TIME"); + return this; + } + + public BsWorkingTypeCQ 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 BsWorkingTypeCQ addOrderBy_CreatedBy_Asc() { + regOBA("CREATED_BY"); + return this; + } + + public BsWorkingTypeCQ 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 BsWorkingTypeCQ addOrderBy_UpdatedTime_Asc() { + regOBA("UPDATED_TIME"); + return this; + } + + public BsWorkingTypeCQ 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 BsWorkingTypeCQ addOrderBy_UpdatedBy_Asc() { + regOBA("UPDATED_BY"); + return this; + } + + public BsWorkingTypeCQ 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 BsWorkingTypeCQ addOrderBy_DeletedTime_Asc() { + regOBA("DELETED_TIME"); + return this; + } + + public BsWorkingTypeCQ 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 BsWorkingTypeCQ addOrderBy_DeletedBy_Asc() { + regOBA("DELETED_BY"); + return this; + } + + public BsWorkingTypeCQ 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 BsWorkingTypeCQ addOrderBy_Versionno_Asc() { + regOBA("VERSIONNO"); + return this; + } + + public BsWorkingTypeCQ addOrderBy_Versionno_Desc() { + regOBD("VERSIONNO"); + return this; + } + + //========================================================================== + // ========= + // Specified Derived OrderBy + // ========================= + public BsWorkingTypeCQ addSpecifiedDerivedOrderBy_Asc(String aliasName) { + registerSpecifiedDerivedOrderBy_Asc(aliasName); + return this; + } + + public BsWorkingTypeCQ addSpecifiedDerivedOrderBy_Desc(String aliasName) { + registerSpecifiedDerivedOrderBy_Desc(aliasName); + return this; + } + + //========================================================================== + // ========= + // Union Query + // =========== + protected void reflectRelationOnUnionQuery(ConditionQuery baseQueryAsSuper, + ConditionQuery unionQueryAsSuper) { + } + + //========================================================================== + // ========= + // Foreign Query + // ============= + + protected String getConditionQueryClassNameInternally() { + return WorkingTypeCQ.class.getName(); + } + + protected String getMapClassNameInternally() { + return Map.class.getName(); + } +} Property changes on: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/cbean/cq/bs/BsWorkingTypeCQ.java ___________________________________________________________________ Name: svn:eol-style + native Modified: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/cbean/cq/ciq/EmployeeCIQ.java =================================================================== --- timecard/trunk/src/main/java/jp/sf/pal/timecard/db/cbean/cq/ciq/EmployeeCIQ.java 2008-12-01 14:26:07 UTC (rev 1492) +++ timecard/trunk/src/main/java/jp/sf/pal/timecard/db/cbean/cq/ciq/EmployeeCIQ.java 2008-12-02 03:38:50 UTC (rev 1493) @@ -142,10 +142,6 @@ return _myCQ.keepManager_InScopeSubQuery_UserInfoByManager(subQuery); } - protected ConditionValue getCValuePaidHolidays() { - return _myCQ.getPaidHolidays(); - } - protected ConditionValue getCValueIsAvailable() { return _myCQ.getIsAvailable(); } Modified: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/cbean/cq/ciq/MonthlyReportCIQ.java =================================================================== --- timecard/trunk/src/main/java/jp/sf/pal/timecard/db/cbean/cq/ciq/MonthlyReportCIQ.java 2008-12-01 14:26:07 UTC (rev 1492) +++ timecard/trunk/src/main/java/jp/sf/pal/timecard/db/cbean/cq/ciq/MonthlyReportCIQ.java 2008-12-02 03:38:50 UTC (rev 1493) @@ -8,6 +8,7 @@ import jp.sf.pal.timecard.db.cbean.cq.DailyReportCQ; import jp.sf.pal.timecard.db.cbean.cq.EmployeeCQ; import jp.sf.pal.timecard.db.cbean.cq.MonthlyReportCQ; +import jp.sf.pal.timecard.db.cbean.cq.MonthlyWorkingReportCQ; import jp.sf.pal.timecard.db.cbean.cq.bs.AbstractBsMonthlyReportCQ; import jp.sf.pal.timecard.db.cbean.cq.bs.BsMonthlyReportCQ; @@ -100,27 +101,56 @@ return _myCQ.keepId_InScopeSubQuery_DailyReportList(subQuery); } + public String keepId_InScopeSubQuery_MonthlyWorkingReportList( + MonthlyWorkingReportCQ subQuery) { + return _myCQ.keepId_InScopeSubQuery_MonthlyWorkingReportList(subQuery); + } + public String keepId_NotInScopeSubQuery_DailyReportList( DailyReportCQ subQuery) { return _myCQ.keepId_NotInScopeSubQuery_DailyReportList(subQuery); } + public String keepId_NotInScopeSubQuery_MonthlyWorkingReportList( + MonthlyWorkingReportCQ subQuery) { + return _myCQ + .keepId_NotInScopeSubQuery_MonthlyWorkingReportList(subQuery); + } + public String keepId_ExistsSubQuery_DailyReportList(DailyReportCQ subQuery) { throw new UnsupportedOperationException( "ExistsSubQuery at inline() is unsupported! Sorry!"); } + public String keepId_ExistsSubQuery_MonthlyWorkingReportList( + MonthlyWorkingReportCQ subQuery) { + throw new UnsupportedOperationException( + "ExistsSubQuery at inline() is unsupported! Sorry!"); + } + public String keepId_NotExistsSubQuery_DailyReportList( DailyReportCQ subQuery) { throw new UnsupportedOperationException( "NotExistsSubQuery at inline() is unsupported! Sorry!"); } + public String keepId_NotExistsSubQuery_MonthlyWorkingReportList( + MonthlyWorkingReportCQ subQuery) { + throw new UnsupportedOperationException( + "NotExistsSubQuery at inline() is unsupported! Sorry!"); + } + public String keepId_DeriveSubQuery_DailyReportList(DailyReportCQ subQuery) { throw new UnsupportedOperationException( "DeriveSubQuery at inline() is unsupported! Sorry!"); } + public String keepId_DeriveSubQuery_MonthlyWorkingReportList( + MonthlyWorkingReportCQ subQuery) { + throw new UnsupportedOperationException( + "DeriveSubQuery at inline() is unsupported! Sorry!"); + } + protected ConditionValue getCValueYear() { return _myCQ.getYear(); } @@ -133,22 +163,10 @@ return _myCQ.getStatus(); } - protected ConditionValue getCValueWorkingDays() { - return _myCQ.getWorkingDays(); - } - protected ConditionValue getCValueStdWorkingDays() { return _myCQ.getStdWorkingDays(); } - protected ConditionValue getCValueHolidays() { - return _myCQ.getHolidays(); - } - - protected ConditionValue getCValuePaidHolidays() { - return _myCQ.getPaidHolidays(); - } - protected ConditionValue getCValueWorkingTime() { return _myCQ.getWorkingTime(); } Added: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/cbean/cq/ciq/MonthlyWorkingReportCIQ.java =================================================================== --- timecard/trunk/src/main/java/jp/sf/pal/timecard/db/cbean/cq/ciq/MonthlyWorkingReportCIQ.java (rev 0) +++ timecard/trunk/src/main/java/jp/sf/pal/timecard/db/cbean/cq/ciq/MonthlyWorkingReportCIQ.java 2008-12-02 03:38:50 UTC (rev 1493) @@ -0,0 +1,126 @@ +package jp.sf.pal.timecard.db.cbean.cq.ciq; + +import jp.sf.pal.timecard.db.allcommon.cbean.ConditionQuery; +import jp.sf.pal.timecard.db.allcommon.cbean.ckey.ConditionKey; +import jp.sf.pal.timecard.db.allcommon.cbean.coption.ConditionOption; +import jp.sf.pal.timecard.db.allcommon.cbean.cvalue.ConditionValue; +import jp.sf.pal.timecard.db.allcommon.cbean.sqlclause.SqlClause; +import jp.sf.pal.timecard.db.cbean.cq.MonthlyReportCQ; +import jp.sf.pal.timecard.db.cbean.cq.MonthlyWorkingReportCQ; +import jp.sf.pal.timecard.db.cbean.cq.WorkingTypeCQ; +import jp.sf.pal.timecard.db.cbean.cq.bs.AbstractBsMonthlyWorkingReportCQ; +import jp.sf.pal.timecard.db.cbean.cq.bs.BsMonthlyWorkingReportCQ; + +/** + * The condition-inline-query of MONTHLY_WORKING_REPORT. + * + * @author DBFlute(AutoGenerator) + */ + ¡÷ SuppressWarnings("unchecked") +public class MonthlyWorkingReportCIQ extends AbstractBsMonthlyWorkingReportCQ { + + //========================================================================== + // ========= + // Attribute + // ========= + protected BsMonthlyWorkingReportCQ _myCQ; + + //========================================================================== + // ========= + // Constructor + // =========== + public MonthlyWorkingReportCIQ(ConditionQuery childQuery, + SqlClause sqlClause, String aliasName, int nestLevel, + BsMonthlyWorkingReportCQ 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 getCValueValue() { + return _myCQ.getValue(); + } + + protected ConditionValue getCValueMonthlyReportId() { + return _myCQ.getMonthlyReportId(); + } + + public String keepMonthlyReportId_InScopeSubQuery_MonthlyReport( + MonthlyReportCQ subQuery) { + return _myCQ + .keepMonthlyReportId_InScopeSubQuery_MonthlyReport(subQuery); + } + + protected ConditionValue getCValueWorkingTypeId() { + return _myCQ.getWorkingTypeId(); + } + + public String keepWorkingTypeId_InScopeSubQuery_WorkingType( + WorkingTypeCQ subQuery) { + return _myCQ.keepWorkingTypeId_InScopeSubQuery_WorkingType(subQuery); + } + + protected String getConditionQueryClassNameInternally() { + return MonthlyWorkingReportCQ.class.getName(); + } +} Property changes on: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/cbean/cq/ciq/MonthlyWorkingReportCIQ.java ___________________________________________________________________ Name: svn:eol-style + native Added: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/cbean/cq/ciq/WorkingTypeCIQ.java =================================================================== --- timecard/trunk/src/main/java/jp/sf/pal/timecard/db/cbean/cq/ciq/WorkingTypeCIQ.java (rev 0) +++ timecard/trunk/src/main/java/jp/sf/pal/timecard/db/cbean/cq/ciq/WorkingTypeCIQ.java 2008-12-02 03:38:50 UTC (rev 1493) @@ -0,0 +1,174 @@ +package jp.sf.pal.timecard.db.cbean.cq.ciq; + +import jp.sf.pal.timecard.db.allcommon.cbean.ConditionQuery; +import jp.sf.pal.timecard.db.allcommon.cbean.ckey.ConditionKey; +import jp.sf.pal.timecard.db.allcommon.cbean.coption.ConditionOption; +import jp.sf.pal.timecard.db.allcommon.cbean.cvalue.ConditionValue; +import jp.sf.pal.timecard.db.allcommon.cbean.sqlclause.SqlClause; +import jp.sf.pal.timecard.db.cbean.cq.MonthlyWorkingReportCQ; +import jp.sf.pal.timecard.db.cbean.cq.WorkingTypeCQ; +import jp.sf.pal.timecard.db.cbean.cq.bs.AbstractBsWorkingTypeCQ; +import jp.sf.pal.timecard.db.cbean.cq.bs.BsWorkingTypeCQ; + +/** + * The condition-inline-query of WORKING_TYPE. + * + * @author DBFlute(AutoGenerator) + */ + ¡÷ SuppressWarnings("unchecked") +public class WorkingTypeCIQ extends AbstractBsWorkingTypeCQ { + + //========================================================================== + // ========= + // Attribute + // ========= + protected BsWorkingTypeCQ _myCQ; + + //========================================================================== + // ========= + // Constructor + // =========== + public WorkingTypeCIQ(ConditionQuery childQuery, SqlClause sqlClause, + String aliasName, int nestLevel, BsWorkingTypeCQ 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_MonthlyWorkingReportList( + MonthlyWorkingReportCQ subQuery) { + return _myCQ.keepId_InScopeSubQuery_MonthlyWorkingReportList(subQuery); + } + + public String keepId_NotInScopeSubQuery_MonthlyWorkingReportList( + MonthlyWorkingReportCQ subQuery) { + return _myCQ + .keepId_NotInScopeSubQuery_MonthlyWorkingReportList(subQuery); + } + + public String keepId_ExistsSubQuery_MonthlyWorkingReportList( + MonthlyWorkingReportCQ subQuery) { + throw new UnsupportedOperationException( + "ExistsSubQuery at inline() is unsupported! Sorry!"); + } + + public String keepId_NotExistsSubQuery_MonthlyWorkingReportList( + MonthlyWorkingReportCQ subQuery) { + throw new UnsupportedOperationException( + "NotExistsSubQuery at inline() is unsupported! Sorry!"); + } + + public String keepId_DeriveSubQuery_MonthlyWorkingReportList( + MonthlyWorkingReportCQ subQuery) { + throw new UnsupportedOperationException( + "DeriveSubQuery at inline() is unsupported! Sorry!"); + } + + protected ConditionValue getCValueName() { + return _myCQ.getName(); + } + + protected ConditionValue getCValueValue() { + return _myCQ.getValue(); + } + + protected ConditionValue getCValueType() { + return _myCQ.getType(); + } + + protected ConditionValue getCValueParentId() { + return _myCQ.getParentId(); + } + + 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 WorkingTypeCQ.class.getName(); + } +} Property changes on: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/cbean/cq/ciq/WorkingTypeCIQ.java ___________________________________________________________________ Name: svn:eol-style + native Added: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/cbean/nss/MonthlyWorkingReportNss.java =================================================================== --- timecard/trunk/src/main/java/jp/sf/pal/timecard/db/cbean/nss/MonthlyWorkingReportNss.java (rev 0) +++ timecard/trunk/src/main/java/jp/sf/pal/timecard/db/cbean/nss/MonthlyWorkingReportNss.java 2008-12-02 03:38:50 UTC (rev 1493) @@ -0,0 +1,50 @@ +package jp.sf.pal.timecard.db.cbean.nss; + +import jp.sf.pal.timecard.db.allcommon.cbean.ConditionQuery; +import jp.sf.pal.timecard.db.cbean.cq.MonthlyWorkingReportCQ; + +/** + * The nest-select-setupper of MONTHLY_WORKING_REPORT. + * + * @author DBFlute(AutoGenerator) + */ + ¡÷ SuppressWarnings("unchecked") +public class MonthlyWorkingReportNss { + + protected MonthlyWorkingReportCQ _query; + + public MonthlyWorkingReportNss(MonthlyWorkingReportCQ query) { + _query = query; + } + + public boolean hasConditionQuery() { + return _query != null; + } + + //========================================================================== + // ========= + // With Nested Foreign Table + // ========================= + public MonthlyReportNss withMonthlyReport() { + _query.doNss(new MonthlyWorkingReportCQ.NssCall() { + public ConditionQuery qf() { + return _query.queryMonthlyReport(); + } + }); + return new MonthlyReportNss(_query.queryMonthlyReport()); + } + + public WorkingTypeNss withWorkingType() { + _query.doNss(new MonthlyWorkingReportCQ.NssCall() { + public ConditionQuery qf() { + return _query.queryWorkingType(); + } + }); + return new WorkingTypeNss(_query.queryWorkingType()); + } + + //========================================================================== + // ========= + // With Nested Referrer Table + // ========================== +} Property changes on: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/cbean/nss/MonthlyWorkingReportNss.java ___________________________________________________________________ Name: svn:eol-style + native Added: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/cbean/nss/WorkingTypeNss.java =================================================================== --- timecard/trunk/src/main/java/jp/sf/pal/timecard/db/cbean/nss/WorkingTypeNss.java (rev 0) +++ timecard/trunk/src/main/java/jp/sf/pal/timecard/db/cbean/nss/WorkingTypeNss.java 2008-12-02 03:38:50 UTC (rev 1493) @@ -0,0 +1,32 @@ +package jp.sf.pal.timecard.db.cbean.nss; + +import jp.sf.pal.timecard.db.cbean.cq.WorkingTypeCQ; + +/** + * The nest-select-setupper of WORKING_TYPE. + * + * @author DBFlute(AutoGenerator) + */ + ¡÷ SuppressWarnings("unchecked") +public class WorkingTypeNss { + + protected WorkingTypeCQ _query; + + public WorkingTypeNss(WorkingTypeCQ query) { + _query = query; + } + + public boolean hasConditionQuery() { + return _query != null; + } + + //========================================================================== + // ========= + // With Nested Foreign Table + // ========================= + + //========================================================================== + // ========= + // With Nested Referrer Table + // ========================== +} Property changes on: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/cbean/nss/WorkingTypeNss.java ___________________________________________________________________ Name: svn:eol-style + native Added: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/exbhv/MonthlyWorkingReportBhv.java =================================================================== --- timecard/trunk/src/main/java/jp/sf/pal/timecard/db/exbhv/MonthlyWorkingReportBhv.java (rev 0) +++ timecard/trunk/src/main/java/jp/sf/pal/timecard/db/exbhv/MonthlyWorkingReportBhv.java 2008-12-02 03:38:50 UTC (rev 1493) @@ -0,0 +1,15 @@ +package jp.sf.pal.timecard.db.exbhv; + +/** + * The behavior of MONTHLY_WORKING_REPORT. + *

    + * You can implement your original methods here. This class is NOT overrided + * when re-generating. + *

    + * + * @author DBFlute(AutoGenerator) + */ + ¡÷ SuppressWarnings("unchecked") +public class MonthlyWorkingReportBhv extends + jp.sf.pal.timecard.db.bsbhv.BsMonthlyWorkingReportBhv { +} Property changes on: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/exbhv/MonthlyWorkingReportBhv.java ___________________________________________________________________ Name: svn:eol-style + native Added: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/exbhv/WorkingTypeBhv.java =================================================================== --- timecard/trunk/src/main/java/jp/sf/pal/timecard/db/exbhv/WorkingTypeBhv.java (rev 0) +++ timecard/trunk/src/main/java/jp/sf/pal/timecard/db/exbhv/WorkingTypeBhv.java 2008-12-02 03:38:50 UTC (rev 1493) @@ -0,0 +1,15 @@ +package jp.sf.pal.timecard.db.exbhv; + +/** + * The behavior of WORKING_TYPE. + *

    + * You can implement your original methods here. This class is NOT overrided + * when re-generating. + *

    + * + * @author DBFlute(AutoGenerator) + */ + ¡÷ SuppressWarnings("unchecked") +public class WorkingTypeBhv extends + jp.sf.pal.timecard.db.bsbhv.BsWorkingTypeBhv { +} Property changes on: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/exbhv/WorkingTypeBhv.java ___________________________________________________________________ Name: svn:eol-style + native Added: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/exdao/MonthlyWorkingReportDao.java =================================================================== --- timecard/trunk/src/main/java/jp/sf/pal/timecard/db/exdao/MonthlyWorkingReportDao.java (rev 0) +++ timecard/trunk/src/main/java/jp/sf/pal/timecard/db/exdao/MonthlyWorkingReportDao.java 2008-12-02 03:38:50 UTC (rev 1493) @@ -0,0 +1,15 @@ +package jp.sf.pal.timecard.db.exdao; + +/** + * The dao interface of MONTHLY_WORKING_REPORT.
    + *

    + * You can implement your original methods here. This class is NOT overrided + * when re-generating. + *

    + * + * @author DBFlute(AutoGenerator) + */ + ¡÷ SuppressWarnings("unchecked") +public interface MonthlyWorkingReportDao extends + jp.sf.pal.timecard.db.bsdao.BsMonthlyWorkingReportDao { +} Property changes on: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/exdao/MonthlyWorkingReportDao.java ___________________________________________________________________ Name: svn:eol-style + native Added: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/exdao/WorkingTypeDao.java =================================================================== --- timecard/trunk/src/main/java/jp/sf/pal/timecard/db/exdao/WorkingTypeDao.java (rev 0) +++ timecard/trunk/src/main/java/jp/sf/pal/timecard/db/exdao/WorkingTypeDao.java 2008-12-02 03:38:50 UTC (rev 1493) @@ -0,0 +1,15 @@ +package jp.sf.pal.timecard.db.exdao; + +/** + * The dao interface of WORKING_TYPE.
    + *

    + * You can implement your original methods here. This class is NOT overrided + * when re-generating. + *

    + * + * @author DBFlute(AutoGenerator) + */ + ¡÷ SuppressWarnings("unchecked") +public interface WorkingTypeDao extends + jp.sf.pal.timecard.db.bsdao.BsWorkingTypeDao { +} Property changes on: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/exdao/WorkingTypeDao.java ___________________________________________________________________ Name: svn:eol-style + native Modified: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/exentity/MonthlyReport.java =================================================================== --- timecard/trunk/src/main/java/jp/sf/pal/timecard/db/exentity/MonthlyReport.java 2008-12-01 14:26:07 UTC (rev 1492) +++ timecard/trunk/src/main/java/jp/sf/pal/timecard/db/exentity/MonthlyReport.java 2008-12-02 03:38:50 UTC (rev 1493) @@ -1,5 +1,7 @@ package jp.sf.pal.timecard.db.exentity; +import java.util.Map; + import jp.sf.pal.timecard.util.TimecardUtil; /** @@ -18,6 +20,8 @@ /** Serial version UID. (Default) */ private static final long serialVersionUID = 1L; + private Map workingReportMap; + public String getFormattedWorkingTime() { if (getWorkingTime() != null) { return TimecardUtil.getHours(getWorkingTime()) + ":" @@ -49,4 +53,14 @@ } return null; } + + public Map getWorkingReportMap() { + return workingReportMap; + } + + public void setWorkingReportMap( + Map workingReportMap) { + this.workingReportMap = workingReportMap; + } + } Added: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/exentity/MonthlyWorkingReport.java =================================================================== --- timecard/trunk/src/main/java/jp/sf/pal/timecard/db/exentity/MonthlyWorkingReport.java (rev 0) +++ timecard/trunk/src/main/java/jp/sf/pal/timecard/db/exentity/MonthlyWorkingReport.java 2008-12-02 03:38:50 UTC (rev 1493) @@ -0,0 +1,28 @@ +package jp.sf.pal.timecard.db.exentity; + +/** + * The entity of MONTHLY_WORKING_REPORT. + *

    + * You can implement your original methods here. This class is NOT overrided + * when re-generating. + *

    + * + * @author DBFlute(AutoGenerator) + */ + ¡÷ SuppressWarnings("unchecked") +public class MonthlyWorkingReport extends + jp.sf.pal.timecard.db.bsentity.BsMonthlyWorkingReport { + + /** Serial version UID. (Default) */ + private static final long serialVersionUID = 1L; + + private boolean update = false; + + public boolean isUpdate() { + return update; + } + + public void setUpdate(boolean update) { + this.update = update; + } +} Property changes on: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/exentity/MonthlyWorkingReport.java ___________________________________________________________________ Name: svn:eol-style + native Added: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/exentity/WorkingType.java =================================================================== --- timecard/trunk/src/main/java/jp/sf/pal/timecard/db/exentity/WorkingType.java (rev 0) +++ timecard/trunk/src/main/java/jp/sf/pal/timecard/db/exentity/WorkingType.java 2008-12-02 03:38:50 UTC (rev 1493) @@ -0,0 +1,17 @@ +package jp.sf.pal.timecard.db.exentity; + +/** + * The entity of WORKING_TYPE. + *

    + * You can implement your original methods here. This class is NOT overrided + * when re-generating. + *

    + * + * @author DBFlute(AutoGenerator) + */ + ¡÷ SuppressWarnings("unchecked") +public class WorkingType extends jp.sf.pal.timecard.db.bsentity.BsWorkingType { + + /** Serial version UID. (Default) */ + private static final long serialVersionUID = 1L; +} Property changes on: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/exentity/WorkingType.java ___________________________________________________________________ Name: svn:eol-style + native Modified: timecard/trunk/src/main/java/jp/sf/pal/timecard/dxo/EmployeeDxo.java =================================================================== --- timecard/trunk/src/main/java/jp/sf/pal/timecard/dxo/EmployeeDxo.java 2008-12-01 14:26:07 UTC (rev 1492) +++ timecard/trunk/src/main/java/jp/sf/pal/timecard/dxo/EmployeeDxo.java 2008-12-02 03:38:50 UTC (rev 1493) @@ -18,7 +18,6 @@ @ConversionRule("id : id" // + ", username : username" // + ", manager : manager" // - + ", paidHolidays : paidHolidays" // + ", isAvailable : isAvailable" // + ", createdTime : createdTime" // + ", createdBy : createdBy" // @@ -35,7 +34,6 @@ @ConversionRule(// "username : username" // + ", manager : manager" // - + ", paidHolidays : paidHolidays" // + ", isAvailable : isAvailable" // // + ", createdTime : createdTime" // // + ", createdBy : createdBy" // @@ -53,7 +51,6 @@ @ConversionRule("id : id" // + ", username : username" // + ", manager : manager" // - + ", paidHolidays : paidHolidays" // + ", isAvailable : isAvailable" // + ", createdTime : createdTime" // + ", createdBy : createdBy" // @@ -71,7 +68,6 @@ @ConversionRule(// "username : username" // + ", manager : manager" // - + ", paidHolidays : paidHolidays" // + ", isAvailable : isAvailable" // // + ", createdTime : createdTime" // // + ", createdBy : createdBy" // Modified: timecard/trunk/src/main/java/jp/sf/pal/timecard/form/admin/EmployeeForm.java =================================================================== --- timecard/trunk/src/main/java/jp/sf/pal/timecard/form/admin/EmployeeForm.java 2008-12-01 14:26:07 UTC (rev 1492) +++ timecard/trunk/src/main/java/jp/sf/pal/timecard/form/admin/EmployeeForm.java 2008-12-02 03:38:50 UTC (rev 1493) @@ -6,7 +6,6 @@ import jp.sf.pal.timecard.common.form.PagingResultForm; import org.seasar.struts.annotation.DateType; -import org.seasar.struts.annotation.DoubleType; import org.seasar.struts.annotation.IntegerType; import org.seasar.struts.annotation.Maxbytelength; import org.seasar.struts.annotation.Required; @@ -29,9 +28,6 @@ @Maxbytelength(maxbytelength = 255) public String manager; - @DoubleType - public String paidHolidays; - @Required(target = "confirm,create,update,delete") @Maxbytelength(maxbytelength = 1) public String isAvailable; @@ -62,7 +58,6 @@ id = null; username = null; manager = null; - paidHolidays = null; isAvailable = null; createdTime = null; createdBy = null; Modified: timecard/trunk/src/main/java/jp/sf/pal/timecard/form/manager/EmployeeForm.java =================================================================== --- timecard/trunk/src/main/java/jp/sf/pal/timecard/form/manager/EmployeeForm.java 2008-12-01 14:26:07 UTC (rev 1492) +++ timecard/trunk/src/main/java/jp/sf/pal/timecard/form/manager/EmployeeForm.java 2008-12-02 03:38:50 UTC (rev 1493) @@ -6,7 +6,6 @@ import jp.sf.pal.timecard.common.form.PagingResultForm; import org.seasar.struts.annotation.DateType; -import org.seasar.struts.annotation.DoubleType; import org.seasar.struts.annotation.IntegerType; import org.seasar.struts.annotation.Maxbytelength; import org.seasar.struts.annotation.Required; @@ -29,9 +28,6 @@ @Maxbytelength(maxbytelength = 255) public String manager; - @DoubleType - public String paidHolidays; - @Required(target = "confirm,create,update,delete") @Maxbytelength(maxbytelength = 1) public String isAvailable; @@ -62,7 +58,6 @@ id = null; username = null; manager = null; - paidHolidays = null; isAvailable = null; createdTime = null; createdBy = null; Modified: timecard/trunk/src/main/java/jp/sf/pal/timecard/service/ReportService.java =================================================================== --- timecard/trunk/src/main/java/jp/sf/pal/timecard/service/ReportService.java 2008-12-01 14:26:07 UTC (rev 1492) +++ timecard/trunk/src/main/java/jp/sf/pal/timecard/service/ReportService.java 2008-12-02 03:38:50 UTC (rev 1493) @@ -4,7 +4,9 @@ import java.math.BigDecimal; import java.sql.Timestamp; import java.util.Date; +import java.util.HashMap; import java.util.List; +import java.util.Map; import jp.sf.pal.timecard.TimecardConstants; import jp.sf.pal.timecard.common.util.ConfigUtil; @@ -12,17 +14,25 @@ import jp.sf.pal.timecard.db.cbean.DailyReportCB; import jp.sf.pal.timecard.db.cbean.EmployeeCB; import jp.sf.pal.timecard.db.cbean.MonthlyReportCB; +import jp.sf.pal.timecard.db.cbean.MonthlyWorkingReportCB; import jp.sf.pal.timecard.db.cbean.UserInfoCB; +import jp.sf.pal.timecard.db.cbean.WorkingTypeCB; import jp.sf.pal.timecard.db.exbhv.DailyReportBhv; import jp.sf.pal.timecard.db.exbhv.EmployeeBhv; import jp.sf.pal.timecard.db.exbhv.MonthlyReportBhv; +import jp.sf.pal.timecard.db.exbhv.MonthlyWorkingReportBhv; import jp.sf.pal.timecard.db.exbhv.UserInfoBhv; +import jp.sf.pal.timecard.db.exbhv.WorkingTypeBhv; import jp.sf.pal.timecard.db.exentity.DailyReport; import jp.sf.pal.timecard.db.exentity.Employee; import jp.sf.pal.timecard.db.exentity.MonthlyReport; +import jp.sf.pal.timecard.db.exentity.MonthlyWorkingReport; import jp.sf.pal.timecard.db.exentity.UserInfo; +import jp.sf.pal.timecard.db.exentity.WorkingType; import jp.sf.pal.timecard.util.TimecardUtil; +import org.apache.commons.lang.StringUtils; + public class ReportService implements Serializable { private static final long serialVersionUID = 1L; @@ -35,6 +45,10 @@ private transient UserInfoBhv userInfoBhv; + private transient WorkingTypeBhv workingTypeBhv; + + private transient MonthlyWorkingReportBhv monthlyWorkingReportBhv; + private UserInfo initUserInfo(String userId) { UserInfoCB cb = new UserInfoCB(); cb.query().setUserId_Equal(userId); @@ -65,6 +79,7 @@ cb.query().setMonth_Equal(month); cb.query().setDeletedBy_IsNull(); cb.query().queryEmployee().setUsername_Equal(username); + cb.query().queryEmployee().setDeletedBy_IsNull(); MonthlyReport monthlyReport = monthlyReportBhv.selectEntity(cb); if (monthlyReport == null) { @@ -84,7 +99,6 @@ employee = new Employee(); employee.setUsername(username); employee.setManager(manager); // TODO - employee.setPaidHolidays(BigDecimal.valueOf(0)); employee.setCreatedBy(username); employee.setCreatedTime(now); employee.setUpdatedBy(username); @@ -107,10 +121,7 @@ monthlyReport.setUpdatedTime(now); monthlyReportBhv.insert(monthlyReport); - BigDecimal workingDays = BigDecimal.valueOf(0); BigDecimal stdWorkingDays = BigDecimal.valueOf(0); - BigDecimal holidays = BigDecimal.valueOf(0); - BigDecimal paidHolidays = BigDecimal.valueOf(0); long workingTime = 0; long stdWorkingTime = 0; long overTime = 0; @@ -158,16 +169,14 @@ } } - monthlyReport.setWorkingDays(workingDays); monthlyReport.setStdWorkingDays(stdWorkingDays); - monthlyReport.setHolidays(holidays); - monthlyReport.setPaidHolidays(paidHolidays); monthlyReport.setWorkingTime(workingTime); monthlyReport.setStdWorkingTime(stdWorkingTime); monthlyReport.setOverTime(overTime); monthlyReport.setMntOverTime(mntOverTime); monthlyReportBhv.update(monthlyReport); + initMonthlyWorkingReport(monthlyReport.getId()); } DailyReportCB cb2 = new DailyReportCB(); @@ -215,9 +224,47 @@ } monthlyReport.setDailyReportList(dailyReportList); + monthlyReport + .setWorkingReportMap(getMonthlyWorkingReportMapByName(monthlyReport + .getId())); + return monthlyReport; } + protected void initMonthlyWorkingReport(Long monthlyReportId) { + List workingTypeList = getReportedWorkingTypeList(); + for (WorkingType workingType : workingTypeList) { + MonthlyWorkingReport monthlyWorkingReport = new MonthlyWorkingReport(); + monthlyWorkingReport.setMonthlyReportId(monthlyReportId); + monthlyWorkingReport.setWorkingTypeId(workingType.getId()); + monthlyWorkingReport.setValue(BigDecimal.valueOf(0)); + monthlyWorkingReportBhv.insert(monthlyWorkingReport); + } + } + + public List getReportedWorkingTypeList() { + WorkingTypeCB cb = new WorkingTypeCB(); + cb.query().setDeletedBy_IsNull(); + cb.query().setParentId_IsNull(); + cb.query().addOrderBy_Id_Asc();// TODO + return workingTypeBhv.selectList(cb); + } + + public List getWorkingTypeList() { + WorkingTypeCB cb = new WorkingTypeCB(); + cb.query().setDeletedBy_IsNull(); + cb.query().addOrderBy_Id_Asc();// TODO + return workingTypeBhv.selectList(cb); + } + + public Map getWorkingTypeMap() { + Map workingTypeMap = new HashMap(); + for (WorkingType workingType : getWorkingTypeList()) { + workingTypeMap.put(workingType.getValue(), workingType); + } + return workingTypeMap; + } + public DailyReport getDailyReport(Long id) { DailyReportCB cb = new DailyReportCB(); @@ -248,6 +295,36 @@ calculateMontlyReport(dailyReport.getMonthlyReportId()); } + public List getMonthlyWokringReport( + Long monthlyReportId) { + MonthlyWorkingReportCB cb = new MonthlyWorkingReportCB(); + cb.setupSelect_WorkingType(); + cb.query().setMonthlyReportId_Equal(monthlyReportId); + cb.query().addOrderBy_Id_Asc();// TODO + return monthlyWorkingReportBhv.selectList(cb); + } + + protected Map getMonthlyWorkingReportMap( + Long monthlyReportId) { + Map mwrMap = new HashMap(); + for (MonthlyWorkingReport mwr : getMonthlyWokringReport(monthlyReportId)) { + mwrMap.put(mwr.getWorkingType().getId(), mwr); + } + return mwrMap; + } + + protected Map getMonthlyWorkingReportMapByName( + Long monthlyReportId) { + Map mwrMap = new HashMap(); + for (MonthlyWorkingReport mwr : getMonthlyWokringReport(monthlyReportId)) { + String name = mwr.getWorkingType().getName(); + if (!StringUtils.isEmpty(name)) { + mwrMap.put(name, mwr); + } + } + return mwrMap; + } + private void calculateMontlyReport(Long monthlyReportId) { MonthlyReportCB cb = new MonthlyReportCB(); cb.query().setId_Equal(monthlyReportId); @@ -262,10 +339,7 @@ cb2.query().addOrderBy_Date_Asc(); List dailyReportList = dailyReportBhv.selectList(cb2); - BigDecimal workingDays = BigDecimal.valueOf(0); BigDecimal stdWorkingDays = BigDecimal.valueOf(0); - BigDecimal holidays = BigDecimal.valueOf(0); - BigDecimal paidHolidays = BigDecimal.valueOf(0); long workingTime = 0; long stdWorkingTime = 0; long overTime = 0; @@ -273,6 +347,13 @@ boolean editing = false; + Map workingTypeMap = getWorkingTypeMap(); + Map monthlyWorkingReportMap = getMonthlyWorkingReportMap(monthlyReportId); + for (MonthlyWorkingReport monthlyWorkingReport : monthlyWorkingReportMap + .values()) { + monthlyWorkingReport.setValue(BigDecimal.valueOf(0)); + } + for (DailyReport dailyReport : dailyReportList) { if (dailyReport.getStatus() == TimecardConstants.REPORT_STATUS_EDITING) { @@ -286,81 +367,114 @@ stdWorkingTime += TimecardUtil.getStdWorkingTimeByDay(); } - if (dailyReport.getWorkingTime() != null) { - int workingType = dailyReport.getWorkingType(); + WorkingType workingType = workingTypeMap.get(dailyReport + .getWorkingType()); - if (workingType == TimecardConstants.WORKING_TYPE_WORK) { - workingDays = BigDecimal - .valueOf(workingDays.doubleValue() + 1.0); + double wdays = 0.0; + double hdays = 1.0; + + String value = workingType != null ? workingType.getType() : ""; + + if (TimecardConstants.WT_WORK.equals(value)) { + wdays = 1.0; + hdays = 0.0; + if (dailyReport.getWorkingTime() != null) { workingTime += dailyReport.getWorkingTime(); } - - if (workingType == TimecardConstants.WORKING_TYPE_WORK_ON_HOLIDAY) { - workingDays = BigDecimal - .valueOf(workingDays.doubleValue() + 1.0); + } else if (TimecardConstants.WT_WORK_AM.equals(value)) { + wdays = 1.0; // TODO or 0.5? + hdays = 0.5; + if (dailyReport.getWorkingTime() != null) { workingTime += dailyReport.getWorkingTime(); } - - if (workingType == TimecardConstants.WORKING_TYPE_AM_WORK_ON_HOLIDAY) { - workingDays = BigDecimal - .valueOf(workingDays.doubleValue() + 0.5); + } else if (TimecardConstants.WT_WORK_PM.equals(value)) { + wdays = 1.0; // TODO or 0.5? + hdays = 0.5; + if (dailyReport.getWorkingTime() != null) { workingTime += dailyReport.getWorkingTime(); } - - if (workingType == TimecardConstants.WORKING_TYPE_PM_WORK_ON_HOLIDAY) { - workingDays = BigDecimal - .valueOf(workingDays.doubleValue() + 0.5); + } else + // paid holiday + if (TimecardConstants.WT_PAIDOFF.equals(value)) { + // all day + wdays = 0.0; + hdays = 1.0; + workingTime += TimecardUtil.getStdWorkingTimeByDay(); + } else if (TimecardConstants.WT_PAIDOFF_AM.equals(value)) { + // am off + wdays = 1.0; // TODO or 0.5? + hdays = 0.5; + workingTime += TimecardUtil.getStdWorkingTimeByAM(); + if (dailyReport.getWorkingTime() != null) { workingTime += dailyReport.getWorkingTime(); } + } else if (TimecardConstants.WT_PAIDOFF_PM.equals(value)) { + // pm off + wdays = 1.0; // TODO or 0.5? + hdays = 0.5; + workingTime += TimecardUtil.getStdWorkingTimeByPM(); + if (dailyReport.getWorkingTime() != null) { + workingTime += dailyReport.getWorkingTime(); + } + } else + // no paid holiday + if (TimecardConstants.WT_OFF.equals(value)) { + // all day + wdays = 0.0; + hdays = 1.0; + } else if (TimecardConstants.WT_OFF_AM.equals(value)) { + // am off + wdays = 1.0; // TODO or 0.5? + hdays = 0.5; + if (dailyReport.getWorkingTime() != null) { + workingTime += dailyReport.getWorkingTime(); + } + } else if (TimecardConstants.WT_OFF_PM.equals(value)) { + // pm off + wdays = 1.0; // TODO or 0.5? + hdays = 0.5; + if (dailyReport.getWorkingTime() != null) { + workingTime += dailyReport.getWorkingTime(); + } + } - // paid holiday - if (workingType >= 10 && workingType < 100) { - if (workingType % 10 == 0) { - // all day - paidHolidays = BigDecimal.valueOf(paidHolidays - .doubleValue() + 1.0); - workingTime += TimecardUtil.getStdWorkingTimeByDay(); - } else if (workingType % 10 == 1) { - // am off - workingDays = BigDecimal.valueOf(workingDays - .doubleValue() + 0.5); - paidHolidays = BigDecimal.valueOf(paidHolidays - .doubleValue() + 0.5); - workingTime += TimecardUtil.getStdWorkingTimeByAM(); - workingTime += dailyReport.getWorkingTime(); - } else if (workingType % 10 == 2) { - // pm off - workingDays = BigDecimal.valueOf(workingDays - .doubleValue() + 0.5); - paidHolidays = BigDecimal.valueOf(paidHolidays - .doubleValue() + 0.5); - workingTime += TimecardUtil.getStdWorkingTimeByPM(); - workingTime += dailyReport.getWorkingTime(); - } + if (TimecardConstants.WORKING_TYPE_WORK != dailyReport + .getWorkingType()) { + Integer wtId = workingType.getParentId() != null ? workingType + .getParentId() : workingType.getId(); + MonthlyWorkingReport report = monthlyWorkingReportMap.get(wtId); + if (report == null) { + report = new MonthlyWorkingReport(); + report.setMonthlyReportId(monthlyReportId); + report.setValue(BigDecimal.valueOf(0)); + report.setWorkingTypeId(wtId); + monthlyWorkingReportMap.put(wtId, report); } + report.setValue(BigDecimal.valueOf(report.getValue() + .doubleValue() + + hdays)); + report.setUpdate(true); + } - // no paid holiday - if (workingType >= 100 && workingType < 200) { - if (workingType % 10 == 0) { - // all day - holidays = BigDecimal - .valueOf(holidays.doubleValue() + 1.0); - } else if (workingType % 10 == 1) { - // am off - workingDays = BigDecimal.valueOf(workingDays - .doubleValue() + 0.5); - holidays = BigDecimal - .valueOf(holidays.doubleValue() + 0.5); - workingTime += dailyReport.getWorkingTime(); - } else if (workingType % 10 == 2) { - // pm off - workingDays = BigDecimal.valueOf(workingDays - .doubleValue() + 0.5); - holidays = BigDecimal - .valueOf(holidays.doubleValue() + 0.5); - workingTime += dailyReport.getWorkingTime(); - } + if (dailyReport.getWorkingTime() != null) { + Integer wtId = workingTypeMap + .get(TimecardConstants.WORKING_TYPE_WORK) != null ? workingTypeMap + .get(TimecardConstants.WORKING_TYPE_WORK).getId() + : TimecardConstants.WORKING_TYPE_WORK; + // working days + MonthlyWorkingReport workingDaysReport = monthlyWorkingReportMap + .get(wtId); + if (workingDaysReport == null) { + workingDaysReport = new MonthlyWorkingReport(); + workingDaysReport.setMonthlyReportId(monthlyReportId); + workingDaysReport.setValue(BigDecimal.valueOf(0)); + workingDaysReport.setWorkingTypeId(wtId); + monthlyWorkingReportMap.put(wtId, workingDaysReport); } + workingDaysReport.setValue(BigDecimal.valueOf(workingDaysReport + .getValue().doubleValue() + + wdays)); + workingDaysReport.setUpdate(true); } } @@ -374,15 +488,19 @@ overTime = 0; } - monthlyReport.setWorkingDays(workingDays); monthlyReport.setStdWorkingDays(stdWorkingDays); - monthlyReport.setHolidays(holidays); - monthlyReport.setPaidHolidays(paidHolidays); monthlyReport.setWorkingTime(workingTime); monthlyReport.setStdWorkingTime(stdWorkingTime); monthlyReport.setOverTime(overTime); monthlyReport.setMntOverTime(mntOverTime); monthlyReportBhv.update(monthlyReport); + + for (MonthlyWorkingReport monthlyWorkingReport : monthlyWorkingReportMap + .values()) { + if (monthlyWorkingReport.isUpdate()) { + monthlyWorkingReportBhv.insertOrUpdate(monthlyWorkingReport); + } + } } public MonthlyReport getMonthlyReport(Long id) { @@ -435,6 +553,7 @@ dailyReport.setUpdatedBy(monthlyReport.getUpdatedBy()); dailyReportBhv.update(dailyReport); } + } } @@ -448,6 +567,7 @@ cb.query().setMonthlyReportId_Equal(monthlyReport.getId()); cb.query().addOrderBy_Date_Asc(); List dailyReportList = dailyReportBhv.selectList(cb); + Map workingTypeMap = getWorkingTypeMap(); for (DailyReport dailyReport : dailyReportList) { if (dailyReport.getStatus() == TimecardConstants.REPORT_STATUS_EDITING) { dailyReport.setStatus(TimecardConstants.REPORT_STATUS_REQUEST); @@ -456,48 +576,38 @@ dailyReport.setUpdatedBy(monthlyReport.getUpdatedBy()); if (autoFill) { - int workingType = dailyReport.getWorkingType(); + WorkingType workingType = workingTypeMap.get(dailyReport + .getWorkingType()); + String value = workingType != null ? workingType.getType() : ""; - if (workingType == TimecardConstants.WORKING_TYPE_WORK) { + if (TimecardConstants.WT_WORK.equals(value)) { TimecardUtil.updateWorkingTime(dailyReport); - } - - if (workingType == TimecardConstants.WORKING_TYPE_WORK_ON_HOLIDAY) { - TimecardUtil.updateWorkingTime(dailyReport); - } - - if (workingType == TimecardConstants.WORKING_TYPE_AM_WORK_ON_HOLIDAY) { + } else if (TimecardConstants.WT_WORK_AM.equals(value)) { TimecardUtil.updateAMWorkingTime(dailyReport); - } - - if (workingType == TimecardConstants.WORKING_TYPE_PM_WORK_ON_HOLIDAY) { + } else if (TimecardConstants.WT_WORK_PM.equals(value)) { TimecardUtil.updatePMWorkingTime(dailyReport); - } - + } else if (TimecardConstants.WT_WORK.equals(value)) { + TimecardUtil.updateWorkingTime(dailyReport); + } else // paid holiday - if (workingType >= 10 && workingType < 100) { - if (workingType % 10 == 0) { - TimecardUtil.updateWorkingTime(dailyReport); - } else if (workingType % 10 == 1) { - // am off - TimecardUtil.updatePMWorkingTime(dailyReport); - } else if (workingType % 10 == 2) { - // pm off - TimecardUtil.updateAMWorkingTime(dailyReport); - } - } - + if (TimecardConstants.WT_PAIDOFF.equals(value)) { + TimecardUtil.updateWorkingTime(dailyReport); + } else if (TimecardConstants.WT_PAIDOFF_AM.equals(value)) { + // am off + TimecardUtil.updatePMWorkingTime(dailyReport); + } else if (TimecardConstants.WT_PAIDOFF_AM.equals(value)) { + // pm off + TimecardUtil.updateAMWorkingTime(dailyReport); + } else // no paid holiday - if (workingType >= 100 && workingType < 200) { - if (workingType % 10 == 0) { - TimecardUtil.updateWorkingTime(dailyReport); - } else if (workingType % 10 == 1) { - // am off - TimecardUtil.updatePMWorkingTime(dailyReport); - } else if (workingType % 10 == 2) { - // pm off - TimecardUtil.updateAMWorkingTime(dailyReport); - } + if (TimecardConstants.WT_OFF.equals(value)) { + // TimecardUtil.updateWorkingTime(dailyReport); + } else if (TimecardConstants.WT_OFF_AM.equals(value)) { + // am off + TimecardUtil.updatePMWorkingTime(dailyReport); + } else if (TimecardConstants.WT_OFF_AM.equals(value)) { + // pm off + TimecardUtil.updateAMWorkingTime(dailyReport); } } @@ -541,18 +651,21 @@ this.userInfoBhv = userInfoBhv; } - // public void disable(Long dailyReportId, String name) { - // // not delete - // DailyReportCB cb = new DailyReportCB(); - // - // cb.query().setId_Equal(dailyReportId); - // DailyReport dailyReport = dailyReportBhv.selectEntity(cb); - // - // // TODO throw an exception - // - // dailyReport.setDeletedBy(name); - // dailyReport.setDeletedTime(new Timestamp(new Date().getTime())); - // dailyReportBhv.update(dailyReport); - // } + public WorkingTypeBhv getWorkingTypeBhv() { + return workingTypeBhv; + } + public void setWorkingTypeBhv(WorkingTypeBhv workingTypeBhv) { + this.workingTypeBhv = workingTypeBhv; + } + + public MonthlyWorkingReportBhv getMonthlyWorkingReportBhv() { + return monthlyWorkingReportBhv; + } + + public void setMonthlyWorkingReportBhv( + MonthlyWorkingReportBhv monthlyWorkingReportBhv) { + this.monthlyWorkingReportBhv = monthlyWorkingReportBhv; + } + } Modified: timecard/trunk/src/main/resources/application.properties =================================================================== --- timecard/trunk/src/main/resources/application.properties 2008-12-01 14:26:07 UTC (rev 1492) +++ timecard/trunk/src/main/resources/application.properties 2008-12-02 03:38:50 UTC (rev 1493) @@ -88,21 +88,21 @@ labels.ws3=Working on holiday(AM) labels.ws4=Working on holiday(PM) labels.ws200=Holiday -labels.ws100=Vacation -labels.ws101=Vacation(AM) -labels.ws102=Vacation(PM) +labels.ws100=Day off +labels.ws101=AM off +labels.ws102=PM off labels.ws20=Paid holiday labels.ws21=Paid holiday(AM) labels.ws22=Paid holiday(PM) -labels.ws30=Congratulation or condolence -labels.ws31=Congratulation or condolence(AM) -labels.ws32=Congratulation or condolence(PM) -labels.ws40=Vacation at private sickness -labels.ws41=Vacation at private sickness(AM) -labels.ws42=Vacation at private sickness(PM) -labels.ws110=Compensatory holiday -labels.ws111=Compensatory holiday(AM) -labels.ws112=Compensatory holiday(PM) +labels.ws30=Bereavement leave +labels.ws31=Bereavement leave(AM) +labels.ws32=Bereavement leave(PM) +labels.ws40=Sick leave +labels.ws41=Sick leave(AM) +labels.ws42=Sick leave(PM) +labels.ws110=Substitute holiday +labels.ws111=Substitute holiday(AM) +labels.ws112=Substitute holiday(PM) labels.start_time=Start time labels.end_time=End time @@ -149,7 +149,7 @@ labels.s_start_time=Start labels.s_end_time=End labels.s_break_time=Break -labels.s_otj_time=OTJ +labels.s_working_time=Time labels.reason=Reason labels.s_working_status=Status Modified: timecard/trunk/src/main/resources/application_ja.properties =================================================================== --- timecard/trunk/src/main/resources/application_ja.properties 2008-12-01 14:26:07 UTC (rev 1492) +++ timecard/trunk/src/main/resources/application_ja.properties 2008-12-02 03:38:50 UTC (rev 1493) @@ -143,6 +143,7 @@ labels.s_end_time=\u9000\u793e labels.s_break_time=\u4f11\u61a9 labels.s_otj_time=\u52e4\u52d9\u5916 +labels.s_working_time=\u52e4\u52d9 labels.reason=\u5185\u5bb9 labels.s_working_status=\u72b6\u6cc1 Modified: timecard/trunk/src/main/resources/dbflute.dicon =================================================================== --- timecard/trunk/src/main/resources/dbflute.dicon 2008-12-01 14:26:07 UTC (rev 1492) +++ timecard/trunk/src/main/resources/dbflute.dicon 2008-12-02 03:38:50 UTC (rev 1493) @@ -72,6 +72,12 @@ + + + dbflute.interceptor + + + dbflute.interceptor @@ -90,4 +96,10 @@ + + + dbflute.interceptor + + + Modified: timecard/trunk/src/main/webapp/WEB-INF/db/timecard.1.log.db =================================================================== (Binary files differ) Modified: timecard/trunk/src/main/webapp/WEB-INF/db/timecard.data.db =================================================================== (Binary files differ) Modified: timecard/trunk/src/main/webapp/WEB-INF/db/timecard.index.db =================================================================== (Binary files differ) Modified: timecard/trunk/src/main/webapp/WEB-INF/view/admin/employee/confirm.jsp =================================================================== --- timecard/trunk/src/main/webapp/WEB-INF/view/admin/employee/confirm.jsp 2008-12-01 14:26:07 UTC (rev 1492) +++ timecard/trunk/src/main/webapp/WEB-INF/view/admin/employee/confirm.jsp 2008-12-02 03:38:50 UTC (rev 1493) @@ -40,10 +40,6 @@
    - - - - - - - - - - - - + + + + - + - + @@ -74,10 +74,12 @@ +
    ${f:h(l.title)} - +
    @@ -85,14 +96,14 @@
    -   +  
    - + -   +  
    ${f:h(manager)}
    ${f:h(paidHolidays)}
    Modified: timecard/trunk/src/main/webapp/WEB-INF/view/admin/employee/edit.jsp =================================================================== --- timecard/trunk/src/main/webapp/WEB-INF/view/admin/employee/edit.jsp 2008-12-01 14:26:07 UTC (rev 1492) +++ timecard/trunk/src/main/webapp/WEB-INF/view/admin/employee/edit.jsp 2008-12-02 03:38:50 UTC (rev 1493) @@ -40,10 +40,6 @@
    Modified: timecard/trunk/src/main/webapp/WEB-INF/view/admin/timecard/index.jsp =================================================================== --- timecard/trunk/src/main/webapp/WEB-INF/view/admin/timecard/index.jsp 2008-12-01 14:26:07 UTC (rev 1492) +++ timecard/trunk/src/main/webapp/WEB-INF/view/admin/timecard/index.jsp 2008-12-02 03:38:50 UTC (rev 1493) @@ -47,20 +47,20 @@
    ${monthlyReport.workingDays}
    ${monthlyReport.stdWorkingDays}
    ${monthlyReport.workingReportMap.Work.value}
    ${monthlyReport.holidays} ${monthlyReport.workingReportMap.DayOff.value}
    ${monthlyReport.paidHolidays} ${monthlyReport.workingReportMap.DayOffWithPay.value}
    ${monthlyReport.formattedOverTime}
    @@ -130,7 +132,7 @@
     
    ${monthlyReport.workingDays}
    ${monthlyReport.stdWorkingDays}
    ${monthlyReport.workingReportMap.Work.value}
    ${monthlyReport.holidays} ${monthlyReport.workingReportMap.DayOff.value}
    ${monthlyReport.paidHolidays} ${monthlyReport.workingReportMap.DayOffWithPay.value}
    ${monthlyReport.formattedOverTime}
    @@ -113,7 +115,7 @@
 ${f:h(manager)}
${f:h(paidHolidays)}
Modified: timecard/trunk/src/main/webapp/WEB-INF/view/manager/employee/edit.jsp =================================================================== --- timecard/trunk/src/main/webapp/WEB-INF/view/manager/employee/edit.jsp 2008-12-01 14:26:07 UTC (rev 1492) +++ timecard/trunk/src/main/webapp/WEB-INF/view/manager/employee/edit.jsp 2008-12-02 03:38:50 UTC (rev 1493) @@ -40,10 +40,6 @@
Modified: timecard/trunk/src/main/webapp/WEB-INF/view/manager/timecard/index.jsp =================================================================== --- timecard/trunk/src/main/webapp/WEB-INF/view/manager/timecard/index.jsp 2008-12-01 14:26:07 UTC (rev 1492) +++ timecard/trunk/src/main/webapp/WEB-INF/view/manager/timecard/index.jsp 2008-12-02 03:38:50 UTC (rev 1493) @@ -47,20 +47,20 @@
${monthlyReport.workingDays}
${monthlyReport.stdWorkingDays}
${monthlyReport.workingReportMap.Work.value}
${monthlyReport.holidays} ${monthlyReport.workingReportMap.DayOff.value}
${monthlyReport.paidHolidays} ${monthlyReport.workingReportMap.DayOffWithPay.value}
${monthlyReport.formattedOverTime}
@@ -133,7 +135,7 @@
 
From svnnotify ¡÷ sourceforge.jp Tue Dec 2 16:54:24 2008 From: svnnotify ¡÷ sourceforge.jp (svnnotify ¡÷ sourceforge.jp) Date: Tue, 02 Dec 2008 16:54:24 +0900 Subject: [pal-cvs 3761] [1496] updated db. Message-ID: <1228204464.476333.2402.nullmailer@users.sourceforge.jp> Revision: 1496 http://svn.sourceforge.jp/view?root=pal&view=rev&rev=1496 Author: shinsuke Date: 2008-12-02 16:54:24 +0900 (Tue, 02 Dec 2008) Log Message: ----------- updated db. Modified Paths: -------------- userinfo/trunk/src/main/config/sql/others/timecard.ddl userinfo/trunk/src/main/webapp/WEB-INF/db/userinfo.1.log.db userinfo/trunk/src/main/webapp/WEB-INF/db/userinfo.data.db userinfo/trunk/src/main/webapp/WEB-INF/db/userinfo.index.db Added Paths: ----------- userinfo/trunk/src/main/config/sql/others/timecard.dml -------------- next part -------------- Modified: userinfo/trunk/src/main/config/sql/others/timecard.ddl =================================================================== --- userinfo/trunk/src/main/config/sql/others/timecard.ddl 2008-12-02 06:40:55 UTC (rev 1495) +++ userinfo/trunk/src/main/config/sql/others/timecard.ddl 2008-12-02 07:54:24 UTC (rev 1496) @@ -1,4 +1,3 @@ - /********************************** Table Name: Employee **********************************/ @@ -6,7 +5,6 @@ id INTEGER NOT NULL IDENTITY PRIMARY KEY, username VARCHAR(255) NOT NULL, manager VARCHAR(255) NOT NULL, - paid_holidays DOUBLE DEFAULT 0 NOT NULL, is_available VARCHAR(1) DEFAULT 'T' NOT NULL, created_time TIMESTAMP NOT NULL, created_by VARCHAR(255) NOT NULL, @@ -27,10 +25,7 @@ year INTEGER NOT NULL, month INTEGER NOT NULL, status INTEGER DEFAULT 1 NOT NULL, - working_days DOUBLE DEFAULT 0 NOT NULL, std_working_days DOUBLE DEFAULT 0 NOT NULL, - holidays DOUBLE DEFAULT 0 NOT NULL, - paid_holidays DOUBLE DEFAULT 0 NOT NULL, working_time BIGINT(20) DEFAULT 0 NOT NULL, std_working_time BIGINT(20) DEFAULT 0 NOT NULL, over_time BIGINT(20) DEFAULT 0 NOT NULL, @@ -71,4 +66,33 @@ FOREIGN KEY (monthly_report_id) REFERENCES monthly_report (id) ); +/********************************** +Table Name: Working Type +**********************************/ +CREATE TABLE working_type( + id INTEGER NOT NULL IDENTITY PRIMARY KEY, + name VARCHAR(100) NOT NULL, + value INTEGER NOT NULL, + type VARCHAR(10) NOT NULL, + parent_id INTEGER DEFAULT 1, + 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 DEFAULT 0 NOT NULL +); +/********************************** +Table Name: Monthly Working Report +**********************************/ +CREATE TABLE monthly_working_report( + id BIGINT(20) NOT NULL IDENTITY PRIMARY KEY, + value DOUBLE NOT NULL, + monthly_report_id BIGINT(20) NOT NULL, + working_type_id INTEGER NOT NULL, + FOREIGN KEY (working_type_id) REFERENCES working_type (id), + FOREIGN KEY (monthly_report_id) REFERENCES monthly_report (id) +); + Added: userinfo/trunk/src/main/config/sql/others/timecard.dml =================================================================== --- userinfo/trunk/src/main/config/sql/others/timecard.dml (rev 0) +++ userinfo/trunk/src/main/config/sql/others/timecard.dml 2008-12-02 07:54:24 UTC (rev 1496) @@ -0,0 +1,21 @@ +insert into WORKING_TYPE (ID, NAME, VALUE, TYPE, PARENT_ID, CREATED_TIME, CREATED_BY, UPDATED_TIME, UPDATED_BY, VERSIONNO) values (1, 'Work', 1, 'WORK', NULL, '2008-10-06 16:17:41', 'admin', '2008-10-06 16:17:41', 'admin', 0); +insert into WORKING_TYPE (ID, NAME, VALUE, TYPE, PARENT_ID, CREATED_TIME, CREATED_BY, UPDATED_TIME, UPDATED_BY, VERSIONNO) values (2, 'WorkOnHoliday', 2, 'WORK', NULL, '2008-10-06 16:17:41', 'admin', '2008-10-06 16:17:41', 'admin', 0); +insert into WORKING_TYPE (ID, NAME, VALUE, TYPE, PARENT_ID, CREATED_TIME, CREATED_BY, UPDATED_TIME, UPDATED_BY, VERSIONNO) values (3, 'WorkOnHolidayAm', 3, 'WORK_AM', 2, '2008-10-06 16:17:41', 'admin', '2008-10-06 16:17:41', 'admin', 0); +insert into WORKING_TYPE (ID, NAME, VALUE, TYPE, PARENT_ID, CREATED_TIME, CREATED_BY, UPDATED_TIME, UPDATED_BY, VERSIONNO) values (4, 'WorkOnHolidayPm', 4, 'WORK_PM', 2, '2008-10-06 16:17:41', 'admin', '2008-10-06 16:17:41', 'admin', 0); +insert into WORKING_TYPE (ID, NAME, VALUE, TYPE, PARENT_ID, CREATED_TIME, CREATED_BY, UPDATED_TIME, UPDATED_BY, VERSIONNO) values (5, 'Holiday', 200, 'OFF', NULL, '2008-10-06 16:17:41', 'admin', '2008-10-06 16:17:41', 'admin', 0); +insert into WORKING_TYPE (ID, NAME, VALUE, TYPE, PARENT_ID, CREATED_TIME, CREATED_BY, UPDATED_TIME, UPDATED_BY, VERSIONNO) values (6, 'DayOffWithPay', 20, 'PAIDOFF',NULL, '2008-10-06 16:17:41', 'admin', '2008-10-06 16:17:41', 'admin', 0); +insert into WORKING_TYPE (ID, NAME, VALUE, TYPE, PARENT_ID, CREATED_TIME, CREATED_BY, UPDATED_TIME, UPDATED_BY, VERSIONNO) values (7, 'AmOffWithPay', 21, 'PAIDOFF_AM', 6, '2008-10-06 16:17:41', 'admin', '2008-10-06 16:17:41', 'admin', 0); +insert into WORKING_TYPE (ID, NAME, VALUE, TYPE, PARENT_ID, CREATED_TIME, CREATED_BY, UPDATED_TIME, UPDATED_BY, VERSIONNO) values (8, 'PmOffWithPay', 22, 'PAIDOFF_PM', 6, '2008-10-06 16:17:41', 'admin', '2008-10-06 16:17:41', 'admin', 0); +insert into WORKING_TYPE (ID, NAME, VALUE, TYPE, PARENT_ID, CREATED_TIME, CREATED_BY, UPDATED_TIME, UPDATED_BY, VERSIONNO) values (9, 'BereavementLeave', 30, 'PAIDOFF', NULL, '2008-10-06 16:17:41', 'admin', '2008-10-06 16:17:41', 'admin', 0); +insert into WORKING_TYPE (ID, NAME, VALUE, TYPE, PARENT_ID, CREATED_TIME, CREATED_BY, UPDATED_TIME, UPDATED_BY, VERSIONNO) values (10, 'BereavementLeaveAm', 31, 'PAIDOFF_AM', 9, '2008-10-06 16:17:41', 'admin', '2008-10-06 16:17:41', 'admin', 0); +insert into WORKING_TYPE (ID, NAME, VALUE, TYPE, PARENT_ID, CREATED_TIME, CREATED_BY, UPDATED_TIME, UPDATED_BY, VERSIONNO) values (11, 'BereavementLeavePm', 32, 'PAIDOFF_PM', 9, '2008-10-06 16:17:41', 'admin', '2008-10-06 16:17:41', 'admin', 0); +insert into WORKING_TYPE (ID, NAME, VALUE, TYPE, PARENT_ID, CREATED_TIME, CREATED_BY, UPDATED_TIME, UPDATED_BY, VERSIONNO) values (12, 'SickLeave', 40, 'PAIDOFF', NULL, '2008-10-06 16:17:41', 'admin', '2008-10-06 16:17:41', 'admin', 0); +insert into WORKING_TYPE (ID, NAME, VALUE, TYPE, PARENT_ID, CREATED_TIME, CREATED_BY, UPDATED_TIME, UPDATED_BY, VERSIONNO) values (13, 'SickLeaveAm', 41, 'PAIDOFF_AM', 12, '2008-10-06 16:17:41', 'admin', '2008-10-06 16:17:41', 'admin', 0); +insert into WORKING_TYPE (ID, NAME, VALUE, TYPE, PARENT_ID, CREATED_TIME, CREATED_BY, UPDATED_TIME, UPDATED_BY, VERSIONNO) values (14, 'SickLeavePm', 42, 'PAIDOFF_PM', 12, '2008-10-06 16:17:41', 'admin', '2008-10-06 16:17:41', 'admin', 0); +insert into WORKING_TYPE (ID, NAME, VALUE, TYPE, PARENT_ID, CREATED_TIME, CREATED_BY, UPDATED_TIME, UPDATED_BY, VERSIONNO) values (15, 'DayOff', 100, 'OFF', NULL, '2008-10-06 16:17:41', 'admin', '2008-10-06 16:17:41', 'admin', 0); +insert into WORKING_TYPE (ID, NAME, VALUE, TYPE, PARENT_ID, CREATED_TIME, CREATED_BY, UPDATED_TIME, UPDATED_BY, VERSIONNO) values (16, 'AmOff', 101, 'OFF_AM', 15, '2008-10-06 16:17:41', 'admin', '2008-10-06 16:17:41', 'admin', 0); +insert into WORKING_TYPE (ID, NAME, VALUE, TYPE, PARENT_ID, CREATED_TIME, CREATED_BY, UPDATED_TIME, UPDATED_BY, VERSIONNO) values (17, 'PmOff', 102, 'OFF_PM', 15, '2008-10-06 16:17:41', 'admin', '2008-10-06 16:17:41', 'admin', 0); +insert into WORKING_TYPE (ID, NAME, VALUE, TYPE, PARENT_ID, CREATED_TIME, CREATED_BY, UPDATED_TIME, UPDATED_BY, VERSIONNO) values (18, 'SubstituteHoliday', 110, 'OFF', NULL, '2008-10-06 16:17:41', 'admin', '2008-10-06 16:17:41', 'admin', 0); +insert into WORKING_TYPE (ID, NAME, VALUE, TYPE, PARENT_ID, CREATED_TIME, CREATED_BY, UPDATED_TIME, UPDATED_BY, VERSIONNO) values (19, 'SubstituteHolidayAm', 111, 'OFF_AM', 18, '2008-10-06 16:17:41', 'admin', '2008-10-06 16:17:41', 'admin', 0); +insert into WORKING_TYPE (ID, NAME, VALUE, TYPE, PARENT_ID, CREATED_TIME, CREATED_BY, UPDATED_TIME, UPDATED_BY, VERSIONNO) values (20, 'SubstituteHolidayPm', 112, 'OFF_PM', 18, '2008-10-06 16:17:41', 'admin', '2008-10-06 16:17:41', 'admin', 0); + Modified: userinfo/trunk/src/main/webapp/WEB-INF/db/userinfo.1.log.db =================================================================== (Binary files differ) Modified: userinfo/trunk/src/main/webapp/WEB-INF/db/userinfo.data.db =================================================================== (Binary files differ) Modified: userinfo/trunk/src/main/webapp/WEB-INF/db/userinfo.index.db =================================================================== (Binary files differ) From svnnotify ¡÷ sourceforge.jp Tue Dec 2 16:54:47 2008 From: svnnotify ¡÷ sourceforge.jp (svnnotify ¡÷ sourceforge.jp) Date: Tue, 02 Dec 2008 16:54:47 +0900 Subject: [pal-cvs 3762] [1497] minor fixes. Message-ID: <1228204487.124002.2557.nullmailer@users.sourceforge.jp> Revision: 1497 http://svn.sourceforge.jp/view?root=pal&view=rev&rev=1497 Author: shinsuke Date: 2008-12-02 16:54:47 +0900 (Tue, 02 Dec 2008) Log Message: ----------- minor fixes. Modified Paths: -------------- userinfo/trunk/src/main/resources/application_ja.properties -------------- next part -------------- Modified: userinfo/trunk/src/main/resources/application_ja.properties =================================================================== --- userinfo/trunk/src/main/resources/application_ja.properties 2008-12-02 07:54:24 UTC (rev 1496) +++ userinfo/trunk/src/main/resources/application_ja.properties 2008-12-02 07:54:47 UTC (rev 1497) @@ -1,8 +1,8 @@ # 0: Given name, 1: Family name, 2: Middle Name display.name={1} {0} -# 0: Given name, 1: Family name, 2: Middle Name, 3: Given name(Reading), 4: Family name(Reading) +# 0: Given name, 1: Family name, 2: Middle Name, 3: Given name(Phonetic), 4: Family name(Phonetic) long.display.name={1} {0} ({4} {3}) -# 0: Given name(Reading), 1: Family name(Reading), 2: Middle Name +# 0: Given name(Phonetic), 1: Family name(Phonetic), 2: Middle Name phonetic.display.name={1} {0} errors.invalid={0} \u306b\u306f\u6b63\u3057\u3044\u5f62\u5f0f\u306e\u30c7\u30fc\u30bf\u3092\u5165\u529b\u3057\u3066\u304f\u3060\u3055\u3044\u3002 From svnnotify ¡÷ sourceforge.jp Wed Dec 3 10:45:40 2008 From: svnnotify ¡÷ sourceforge.jp (svnnotify ¡÷ sourceforge.jp) Date: Wed, 03 Dec 2008 10:45:40 +0900 Subject: [pal-cvs 3763] [1498] added japanese message to scheduler portlet Message-ID: <1228268740.844617.26155.nullmailer@users.sourceforge.jp> Revision: 1498 http://svn.sourceforge.jp/view?root=pal&view=rev&rev=1498 Author: sone Date: 2008-12-03 10:45:40 +0900 (Wed, 03 Dec 2008) Log Message: ----------- added japanese message to scheduler portlet Modified Paths: -------------- scheduler/trunk/src/main/webapp/WEB-INF/view/user/schedule/onetimeSchedule/userlist.jsp -------------- next part -------------- Modified: scheduler/trunk/src/main/webapp/WEB-INF/view/user/schedule/onetimeSchedule/userlist.jsp =================================================================== --- scheduler/trunk/src/main/webapp/WEB-INF/view/user/schedule/onetimeSchedule/userlist.jsp 2008-12-02 07:54:47 UTC (rev 1497) +++ scheduler/trunk/src/main/webapp/WEB-INF/view/user/schedule/onetimeSchedule/userlist.jsp 2008-12-03 01:45:40 UTC (rev 1498) @@ -65,7 +65,7 @@
- + @@ -105,8 +105,8 @@
User Group
- - + >>"/> +"/>
From svnnotify ¡÷ sourceforge.jp Wed Dec 3 16:05:51 2008 From: svnnotify ¡÷ sourceforge.jp (svnnotify ¡÷ sourceforge.jp) Date: Wed, 03 Dec 2008 16:05:51 +0900 Subject: [pal-cvs 3764] [1499] escaped html tags and stopped showing sortOrder Message-ID: <1228287951.404391.14679.nullmailer@users.sourceforge.jp> Revision: 1499 http://svn.sourceforge.jp/view?root=pal&view=rev&rev=1499 Author: sone Date: 2008-12-03 16:05:51 +0900 (Wed, 03 Dec 2008) Log Message: ----------- escaped html tags and stopped showing sortOrder Modified Paths: -------------- bookmark/trunk/src/main/webapp/WEB-INF/view/admin/category/index.jsp bookmark/trunk/src/main/webapp/WEB-INF/view/admin/link/index.jsp bookmark/trunk/src/main/webapp/WEB-INF/view/user/category/index.jsp bookmark/trunk/src/main/webapp/WEB-INF/view/user/link/index.jsp -------------- next part -------------- Modified: bookmark/trunk/src/main/webapp/WEB-INF/view/admin/category/index.jsp =================================================================== --- bookmark/trunk/src/main/webapp/WEB-INF/view/admin/category/index.jsp 2008-12-03 01:45:40 UTC (rev 1498) +++ bookmark/trunk/src/main/webapp/WEB-INF/view/admin/category/index.jsp 2008-12-03 07:05:51 UTC (rev 1499) @@ -51,7 +51,7 @@ - + - + - + ","
${f:h(c.id)}${f:h(c.name)}(${c.sortOrder})${f:h(c.name)} ${f:h(c.createdBy)} Modified: bookmark/trunk/src/main/webapp/WEB-INF/view/admin/link/index.jsp =================================================================== --- bookmark/trunk/src/main/webapp/WEB-INF/view/admin/link/index.jsp 2008-12-03 01:45:40 UTC (rev 1498) +++ bookmark/trunk/src/main/webapp/WEB-INF/view/admin/link/index.jsp 2008-12-03 07:05:51 UTC (rev 1499) @@ -51,7 +51,7 @@
${f:h(l.name)}${f:h(l.name)} ${f:h(l.createdBy)} Modified: bookmark/trunk/src/main/webapp/WEB-INF/view/user/category/index.jsp =================================================================== --- bookmark/trunk/src/main/webapp/WEB-INF/view/user/category/index.jsp 2008-12-03 01:45:40 UTC (rev 1498) +++ bookmark/trunk/src/main/webapp/WEB-INF/view/user/category/index.jsp 2008-12-03 07:05:51 UTC (rev 1499) @@ -49,7 +49,7 @@
${f:h(c.name)}(${c.sortOrder})${f:h(c.name)} Modified: bookmark/trunk/src/main/webapp/WEB-INF/view/user/link/index.jsp =================================================================== --- bookmark/trunk/src/main/webapp/WEB-INF/view/user/link/index.jsp 2008-12-03 01:45:40 UTC (rev 1498) +++ bookmark/trunk/src/main/webapp/WEB-INF/view/user/link/index.jsp 2008-12-03 07:05:51 UTC (rev 1499) @@ -74,7 +74,7 @@ - + ","
${f:h(l.name)}${f:h(l.name)} From svnnotify ¡÷ sourceforge.jp Wed Dec 3 17:09:58 2008 From: svnnotify ¡÷ sourceforge.jp (svnnotify ¡÷ sourceforge.jp) Date: Wed, 03 Dec 2008 17:09:58 +0900 Subject: [pal-cvs 3765] [1500] i18ned board Message-ID: <1228291798.380269.13768.nullmailer@users.sourceforge.jp> Revision: 1500 http://svn.sourceforge.jp/view?root=pal&view=rev&rev=1500 Author: sone Date: 2008-12-03 17:09:58 +0900 (Wed, 03 Dec 2008) Log Message: ----------- i18ned board Modified Paths: -------------- board/trunk/src/main/resources/application.properties board/trunk/src/main/resources/application_ja.properties board/trunk/src/main/webapp/WEB-INF/view/message/admin/index.jsp board/trunk/src/main/webapp/WEB-INF/view/message/view/index.jsp -------------- next part -------------- Modified: board/trunk/src/main/resources/application.properties =================================================================== --- board/trunk/src/main/resources/application.properties 2008-12-03 07:05:51 UTC (rev 1499) +++ board/trunk/src/main/resources/application.properties 2008-12-03 08:09:58 UTC (rev 1500) @@ -159,3 +159,6 @@ labels.editable=Editable labels.not_editable=Not Editable labels.byte=byte + +labels.filter=filter: +labels.search=search \ No newline at end of file Modified: board/trunk/src/main/resources/application_ja.properties =================================================================== --- board/trunk/src/main/resources/application_ja.properties 2008-12-03 07:05:51 UTC (rev 1499) +++ board/trunk/src/main/resources/application_ja.properties 2008-12-03 08:09:58 UTC (rev 1500) @@ -149,3 +149,6 @@ labels.editable=\u7de8\u96c6\u53ef labels.not_editable=\u7de8\u96c6\u4e0d\u53ef labels.byte=\u30d0\u30a4\u30c8 + +labels.filter=\u30d5\u30a3\u30eb\u30bf: +labels.search=\u691c\u7d22 \ No newline at end of file Modified: board/trunk/src/main/webapp/WEB-INF/view/message/admin/index.jsp =================================================================== --- board/trunk/src/main/webapp/WEB-INF/view/message/admin/index.jsp 2008-12-03 07:05:51 UTC (rev 1499) +++ board/trunk/src/main/webapp/WEB-INF/view/message/admin/index.jsp 2008-12-03 08:09:58 UTC (rev 1500) @@ -64,7 +64,7 @@ -
¥Õ¥£¥ë¥¿:
+
"/>
Modified: board/trunk/src/main/webapp/WEB-INF/view/message/view/index.jsp =================================================================== --- board/trunk/src/main/webapp/WEB-INF/view/message/view/index.jsp 2008-12-03 07:05:51 UTC (rev 1499) +++ board/trunk/src/main/webapp/WEB-INF/view/message/view/index.jsp 2008-12-03 08:09:58 UTC (rev 1500) @@ -66,7 +66,7 @@ -
¥Õ¥£¥ë¥¿:
+
"/>
From svnnotify ¡÷ sourceforge.jp Wed Dec 3 17:26:18 2008 From: svnnotify ¡÷ sourceforge.jp (svnnotify ¡÷ sourceforge.jp) Date: Wed, 03 Dec 2008 17:26:18 +0900 Subject: [pal-cvs 3766] [1501] i18ned timecard Message-ID: <1228292778.989658.32645.nullmailer@users.sourceforge.jp> Revision: 1501 http://svn.sourceforge.jp/view?root=pal&view=rev&rev=1501 Author: sone Date: 2008-12-03 17:26:18 +0900 (Wed, 03 Dec 2008) Log Message: ----------- i18ned timecard Modified Paths: -------------- timecard/trunk/src/main/webapp/WEB-INF/view/admin/timecard/edit.jsp timecard/trunk/src/main/webapp/WEB-INF/view/employee/edit.jsp timecard/trunk/src/main/webapp/WEB-INF/view/manager/timecard/edit.jsp -------------- next part -------------- Modified: timecard/trunk/src/main/webapp/WEB-INF/view/admin/timecard/edit.jsp =================================================================== --- timecard/trunk/src/main/webapp/WEB-INF/view/admin/timecard/edit.jsp 2008-12-03 08:09:58 UTC (rev 1500) +++ timecard/trunk/src/main/webapp/WEB-INF/view/admin/timecard/edit.jsp 2008-12-03 08:26:18 UTC (rev 1501) @@ -36,7 +36,7 @@ - + - + - + ","
ÆüÉÕ ${f:h(month)}/${f:h(date)} Modified: timecard/trunk/src/main/webapp/WEB-INF/view/employee/edit.jsp =================================================================== --- timecard/trunk/src/main/webapp/WEB-INF/view/employee/edit.jsp 2008-12-03 08:09:58 UTC (rev 1500) +++ timecard/trunk/src/main/webapp/WEB-INF/view/employee/edit.jsp 2008-12-03 08:26:18 UTC (rev 1501) @@ -36,7 +36,7 @@
ÆüÉÕ ${f:h(month)}/${f:h(date)} Modified: timecard/trunk/src/main/webapp/WEB-INF/view/manager/timecard/edit.jsp =================================================================== --- timecard/trunk/src/main/webapp/WEB-INF/view/manager/timecard/edit.jsp 2008-12-03 08:09:58 UTC (rev 1500) +++ timecard/trunk/src/main/webapp/WEB-INF/view/manager/timecard/edit.jsp 2008-12-03 08:26:18 UTC (rev 1501) @@ -36,7 +36,7 @@
ÆüÉÕ ${f:h(month)}/${f:h(date)} From svnnotify ¡÷ sourceforge.jp Thu Dec 4 07:25:47 2008 From: svnnotify ¡÷ sourceforge.jp (svnnotify ¡÷ sourceforge.jp) Date: Thu, 04 Dec 2008 07:25:47 +0900 Subject: [pal-cvs 3767] [1502] added properties files for en. Message-ID: <1228343147.167583.16906.nullmailer@users.sourceforge.jp> Revision: 1502 http://svn.sourceforge.jp/view?root=pal&view=rev&rev=1502 Author: shinsuke Date: 2008-12-04 07:25:46 +0900 (Thu, 04 Dec 2008) Log Message: ----------- added properties files for en. Added Paths: ----------- addresslist/trunk/src/main/resources/jp/sf/pal/addresslist/resources/AddressListConfig_en.properties addresslist/trunk/src/main/resources/jp/sf/pal/addresslist/resources/AddressListEditor_en.properties addresslist/trunk/src/main/resources/jp/sf/pal/addresslist/resources/AddressListManager_en.properties -------------- next part -------------- Added: addresslist/trunk/src/main/resources/jp/sf/pal/addresslist/resources/AddressListConfig_en.properties =================================================================== --- addresslist/trunk/src/main/resources/jp/sf/pal/addresslist/resources/AddressListConfig_en.properties (rev 0) +++ addresslist/trunk/src/main/resources/jp/sf/pal/addresslist/resources/AddressListConfig_en.properties 2008-12-03 22:25:46 UTC (rev 1502) @@ -0,0 +1,4 @@ +# portlet info +javax.portlet.title=Address List Config +javax.portlet.short-title=Config +javax.portlet.keywords=Address List,Config,Groupware Property changes on: addresslist/trunk/src/main/resources/jp/sf/pal/addresslist/resources/AddressListConfig_en.properties ___________________________________________________________________ Name: svn:eol-style + native Added: addresslist/trunk/src/main/resources/jp/sf/pal/addresslist/resources/AddressListEditor_en.properties =================================================================== --- addresslist/trunk/src/main/resources/jp/sf/pal/addresslist/resources/AddressListEditor_en.properties (rev 0) +++ addresslist/trunk/src/main/resources/jp/sf/pal/addresslist/resources/AddressListEditor_en.properties 2008-12-03 22:25:46 UTC (rev 1502) @@ -0,0 +1,4 @@ +# portlet info +javax.portlet.title=Address List +javax.portlet.short-title=Address List +javax.portlet.keywords=Address List,Groupware Property changes on: addresslist/trunk/src/main/resources/jp/sf/pal/addresslist/resources/AddressListEditor_en.properties ___________________________________________________________________ Name: svn:eol-style + native Added: addresslist/trunk/src/main/resources/jp/sf/pal/addresslist/resources/AddressListManager_en.properties =================================================================== --- addresslist/trunk/src/main/resources/jp/sf/pal/addresslist/resources/AddressListManager_en.properties (rev 0) +++ addresslist/trunk/src/main/resources/jp/sf/pal/addresslist/resources/AddressListManager_en.properties 2008-12-03 22:25:46 UTC (rev 1502) @@ -0,0 +1,4 @@ +# portlet info +javax.portlet.title=Address List Manager +javax.portlet.short-title=Manager +javax.portlet.keywords=Address List,Management,Groupware Property changes on: addresslist/trunk/src/main/resources/jp/sf/pal/addresslist/resources/AddressListManager_en.properties ___________________________________________________________________ Name: svn:eol-style + native From svnnotify ¡÷ sourceforge.jp Thu Dec 4 07:28:41 2008 From: svnnotify ¡÷ sourceforge.jp (svnnotify ¡÷ sourceforge.jp) Date: Thu, 04 Dec 2008 07:28:41 +0900 Subject: [pal-cvs 3768] [1503] added properties files for en. Message-ID: <1228343321.928475.20504.nullmailer@users.sourceforge.jp> Revision: 1503 http://svn.sourceforge.jp/view?root=pal&view=rev&rev=1503 Author: shinsuke Date: 2008-12-04 07:28:41 +0900 (Thu, 04 Dec 2008) Log Message: ----------- added properties files for en. Added Paths: ----------- board/trunk/src/main/resources/jp/sf/pal/board/resources/BoardConfig_en.properties board/trunk/src/main/resources/jp/sf/pal/board/resources/CategoryEdit_en.properties board/trunk/src/main/resources/jp/sf/pal/board/resources/MessageEditor_en.properties board/trunk/src/main/resources/jp/sf/pal/board/resources/MessageManager_en.properties -------------- next part -------------- Added: board/trunk/src/main/resources/jp/sf/pal/board/resources/BoardConfig_en.properties =================================================================== --- board/trunk/src/main/resources/jp/sf/pal/board/resources/BoardConfig_en.properties (rev 0) +++ board/trunk/src/main/resources/jp/sf/pal/board/resources/BoardConfig_en.properties 2008-12-03 22:28:41 UTC (rev 1503) @@ -0,0 +1,4 @@ +# portlet info +javax.portlet.title=Message Board Config +javax.portlet.short-title=Config +javax.portlet.keywords=Message Board,Config,Groupware Property changes on: board/trunk/src/main/resources/jp/sf/pal/board/resources/BoardConfig_en.properties ___________________________________________________________________ Name: svn:eol-style + native Added: board/trunk/src/main/resources/jp/sf/pal/board/resources/CategoryEdit_en.properties =================================================================== --- board/trunk/src/main/resources/jp/sf/pal/board/resources/CategoryEdit_en.properties (rev 0) +++ board/trunk/src/main/resources/jp/sf/pal/board/resources/CategoryEdit_en.properties 2008-12-03 22:28:41 UTC (rev 1503) @@ -0,0 +1,4 @@ +# portlet info +javax.portlet.title=Category Editor +javax.portlet.short-title=Editor +javax.portlet.keywords=Message Board,Management,Groupware Property changes on: board/trunk/src/main/resources/jp/sf/pal/board/resources/CategoryEdit_en.properties ___________________________________________________________________ Name: svn:eol-style + native Added: board/trunk/src/main/resources/jp/sf/pal/board/resources/MessageEditor_en.properties =================================================================== --- board/trunk/src/main/resources/jp/sf/pal/board/resources/MessageEditor_en.properties (rev 0) +++ board/trunk/src/main/resources/jp/sf/pal/board/resources/MessageEditor_en.properties 2008-12-03 22:28:41 UTC (rev 1503) @@ -0,0 +1,4 @@ +# portlet info +javax.portlet.title=Message Board +javax.portlet.short-title=Message Board +javax.portlet.keywords=Message Board,Groupware Property changes on: board/trunk/src/main/resources/jp/sf/pal/board/resources/MessageEditor_en.properties ___________________________________________________________________ Name: svn:eol-style + native Added: board/trunk/src/main/resources/jp/sf/pal/board/resources/MessageManager_en.properties =================================================================== --- board/trunk/src/main/resources/jp/sf/pal/board/resources/MessageManager_en.properties (rev 0) +++ board/trunk/src/main/resources/jp/sf/pal/board/resources/MessageManager_en.properties 2008-12-03 22:28:41 UTC (rev 1503) @@ -0,0 +1,4 @@ +# portlet info +javax.portlet.title=Message Board Manager +javax.portlet.short-title=Manager +javax.portlet.keywords=Message Board,Management,Groupware Property changes on: board/trunk/src/main/resources/jp/sf/pal/board/resources/MessageManager_en.properties ___________________________________________________________________ Name: svn:eol-style + native From svnnotify ¡÷ sourceforge.jp Thu Dec 4 07:30:07 2008 From: svnnotify ¡÷ sourceforge.jp (svnnotify ¡÷ sourceforge.jp) Date: Thu, 04 Dec 2008 07:30:07 +0900 Subject: [pal-cvs 3769] [1504] added properties files for en. Message-ID: <1228343407.094915.21976.nullmailer@users.sourceforge.jp> Revision: 1504 http://svn.sourceforge.jp/view?root=pal&view=rev&rev=1504 Author: shinsuke Date: 2008-12-04 07:30:06 +0900 (Thu, 04 Dec 2008) Log Message: ----------- added properties files for en. Added Paths: ----------- bookmark/trunk/src/main/resources/jp/sf/pal/bookmark/resources/BookmarkEditor_en.properties bookmark/trunk/src/main/resources/jp/sf/pal/bookmark/resources/BookmarkManager_en.properties -------------- next part -------------- Added: bookmark/trunk/src/main/resources/jp/sf/pal/bookmark/resources/BookmarkEditor_en.properties =================================================================== --- bookmark/trunk/src/main/resources/jp/sf/pal/bookmark/resources/BookmarkEditor_en.properties (rev 0) +++ bookmark/trunk/src/main/resources/jp/sf/pal/bookmark/resources/BookmarkEditor_en.properties 2008-12-03 22:30:06 UTC (rev 1504) @@ -0,0 +1,5 @@ +# portlet info +javax.portlet.title=Bookmark +javax.portlet.short-title=Bookmark +javax.portlet.keywords=Bookmark,Groupware + Property changes on: bookmark/trunk/src/main/resources/jp/sf/pal/bookmark/resources/BookmarkEditor_en.properties ___________________________________________________________________ Name: svn:eol-style + native Added: bookmark/trunk/src/main/resources/jp/sf/pal/bookmark/resources/BookmarkManager_en.properties =================================================================== --- bookmark/trunk/src/main/resources/jp/sf/pal/bookmark/resources/BookmarkManager_en.properties (rev 0) +++ bookmark/trunk/src/main/resources/jp/sf/pal/bookmark/resources/BookmarkManager_en.properties 2008-12-03 22:30:06 UTC (rev 1504) @@ -0,0 +1,5 @@ +# portlet info +javax.portlet.title=Bookmark Manager +javax.portlet.short-title=Manager +javax.portlet.keywords=Bookmark,Management,Groupware + Property changes on: bookmark/trunk/src/main/resources/jp/sf/pal/bookmark/resources/BookmarkManager_en.properties ___________________________________________________________________ Name: svn:eol-style + native From svnnotify ¡÷ sourceforge.jp Thu Dec 4 07:31:06 2008 From: svnnotify ¡÷ sourceforge.jp (svnnotify ¡÷ sourceforge.jp) Date: Thu, 04 Dec 2008 07:31:06 +0900 Subject: [pal-cvs 3770] [1505] added properties files for en. Message-ID: <1228343466.346255.22368.nullmailer@users.sourceforge.jp> Revision: 1505 http://svn.sourceforge.jp/view?root=pal&view=rev&rev=1505 Author: shinsuke Date: 2008-12-04 07:31:06 +0900 (Thu, 04 Dec 2008) Log Message: ----------- added properties files for en. Added Paths: ----------- chat/trunk/src/main/resources/jp/sf/pal/chat/resources/Chat_en.properties -------------- next part -------------- Added: chat/trunk/src/main/resources/jp/sf/pal/chat/resources/Chat_en.properties =================================================================== --- chat/trunk/src/main/resources/jp/sf/pal/chat/resources/Chat_en.properties (rev 0) +++ chat/trunk/src/main/resources/jp/sf/pal/chat/resources/Chat_en.properties 2008-12-03 22:31:06 UTC (rev 1505) @@ -0,0 +1,5 @@ +# portlet info +javax.portlet.title=Chat +javax.portlet.short-title=Chat +javax.portlet.keywords=Chat,Groupware + Property changes on: chat/trunk/src/main/resources/jp/sf/pal/chat/resources/Chat_en.properties ___________________________________________________________________ Name: svn:eol-style + native From svnnotify ¡÷ sourceforge.jp Thu Dec 4 07:32:25 2008 From: svnnotify ¡÷ sourceforge.jp (svnnotify ¡÷ sourceforge.jp) Date: Thu, 04 Dec 2008 07:32:25 +0900 Subject: [pal-cvs 3771] [1506] added properties files for en. Message-ID: <1228343545.863164.23886.nullmailer@users.sourceforge.jp> Revision: 1506 http://svn.sourceforge.jp/view?root=pal&view=rev&rev=1506 Author: shinsuke Date: 2008-12-04 07:32:25 +0900 (Thu, 04 Dec 2008) Log Message: ----------- added properties files for en. Added Paths: ----------- notepad/trunk/src/main/resources/jp/sf/pal/notepad/resources/NotepadEditor_en.properties notepad/trunk/src/main/resources/jp/sf/pal/notepad/resources/NotepadManager_en.properties -------------- next part -------------- Added: notepad/trunk/src/main/resources/jp/sf/pal/notepad/resources/NotepadEditor_en.properties =================================================================== --- notepad/trunk/src/main/resources/jp/sf/pal/notepad/resources/NotepadEditor_en.properties (rev 0) +++ notepad/trunk/src/main/resources/jp/sf/pal/notepad/resources/NotepadEditor_en.properties 2008-12-03 22:32:25 UTC (rev 1506) @@ -0,0 +1,4 @@ +# portlet info +javax.portlet.title=Notepad +javax.portlet.short-title=Notepad +javax.portlet.keywords=Notepad,Groupware Property changes on: notepad/trunk/src/main/resources/jp/sf/pal/notepad/resources/NotepadEditor_en.properties ___________________________________________________________________ Name: svn:eol-style + native Added: notepad/trunk/src/main/resources/jp/sf/pal/notepad/resources/NotepadManager_en.properties =================================================================== --- notepad/trunk/src/main/resources/jp/sf/pal/notepad/resources/NotepadManager_en.properties (rev 0) +++ notepad/trunk/src/main/resources/jp/sf/pal/notepad/resources/NotepadManager_en.properties 2008-12-03 22:32:25 UTC (rev 1506) @@ -0,0 +1,4 @@ +# portlet info +javax.portlet.title=Notepad Manager +javax.portlet.short-title=Manager +javax.portlet.keywords=Notepad,Management,Groupware Property changes on: notepad/trunk/src/main/resources/jp/sf/pal/notepad/resources/NotepadManager_en.properties ___________________________________________________________________ Name: svn:eol-style + native From svnnotify ¡÷ sourceforge.jp Thu Dec 4 07:35:37 2008 From: svnnotify ¡÷ sourceforge.jp (svnnotify ¡÷ sourceforge.jp) Date: Thu, 04 Dec 2008 07:35:37 +0900 Subject: [pal-cvs 3772] [1507] added properties files for en. Message-ID: <1228343737.700003.26683.nullmailer@users.sourceforge.jp> Revision: 1507 http://svn.sourceforge.jp/view?root=pal&view=rev&rev=1507 Author: shinsuke Date: 2008-12-04 07:35:37 +0900 (Thu, 04 Dec 2008) Log Message: ----------- added properties files for en. Added Paths: ----------- scheduler/trunk/src/main/resources/jp/sf/pal/scheduler/resources/Facilities_en.properties scheduler/trunk/src/main/resources/jp/sf/pal/scheduler/resources/FacilityManager_en.properties scheduler/trunk/src/main/resources/jp/sf/pal/scheduler/resources/SchedulerManager_en.properties scheduler/trunk/src/main/resources/jp/sf/pal/scheduler/resources/Scheduler_en.properties -------------- next part -------------- Added: scheduler/trunk/src/main/resources/jp/sf/pal/scheduler/resources/Facilities_en.properties =================================================================== --- scheduler/trunk/src/main/resources/jp/sf/pal/scheduler/resources/Facilities_en.properties (rev 0) +++ scheduler/trunk/src/main/resources/jp/sf/pal/scheduler/resources/Facilities_en.properties 2008-12-03 22:35:37 UTC (rev 1507) @@ -0,0 +1,5 @@ +# portlet info +javax.portlet.title=Facilities +javax.portlet.short-title=Facilities +javax.portlet.keywords=Facilities,Groupware + Property changes on: scheduler/trunk/src/main/resources/jp/sf/pal/scheduler/resources/Facilities_en.properties ___________________________________________________________________ Name: svn:eol-style + native Added: scheduler/trunk/src/main/resources/jp/sf/pal/scheduler/resources/FacilityManager_en.properties =================================================================== --- scheduler/trunk/src/main/resources/jp/sf/pal/scheduler/resources/FacilityManager_en.properties (rev 0) +++ scheduler/trunk/src/main/resources/jp/sf/pal/scheduler/resources/FacilityManager_en.properties 2008-12-03 22:35:37 UTC (rev 1507) @@ -0,0 +1,5 @@ +# portlet info +javax.portlet.title=Facilities Manager +javax.portlet.short-title=Manager +javax.portlet.keywords=Facilities,Management,Groupware + Property changes on: scheduler/trunk/src/main/resources/jp/sf/pal/scheduler/resources/FacilityManager_en.properties ___________________________________________________________________ Name: svn:eol-style + native Added: scheduler/trunk/src/main/resources/jp/sf/pal/scheduler/resources/SchedulerManager_en.properties =================================================================== --- scheduler/trunk/src/main/resources/jp/sf/pal/scheduler/resources/SchedulerManager_en.properties (rev 0) +++ scheduler/trunk/src/main/resources/jp/sf/pal/scheduler/resources/SchedulerManager_en.properties 2008-12-03 22:35:37 UTC (rev 1507) @@ -0,0 +1,5 @@ +# portlet info +javax.portlet.title=Schedule Manager +javax.portlet.short-title=Manager +javax.portlet.keywords=Schedule,Management,Groupware + Property changes on: scheduler/trunk/src/main/resources/jp/sf/pal/scheduler/resources/SchedulerManager_en.properties ___________________________________________________________________ Name: svn:eol-style + native Added: scheduler/trunk/src/main/resources/jp/sf/pal/scheduler/resources/Scheduler_en.properties =================================================================== --- scheduler/trunk/src/main/resources/jp/sf/pal/scheduler/resources/Scheduler_en.properties (rev 0) +++ scheduler/trunk/src/main/resources/jp/sf/pal/scheduler/resources/Scheduler_en.properties 2008-12-03 22:35:37 UTC (rev 1507) @@ -0,0 +1,5 @@ +# portlet info +javax.portlet.title=Schedule +javax.portlet.short-title=Schedule +javax.portlet.keywords=Schedule,Groupware + Property changes on: scheduler/trunk/src/main/resources/jp/sf/pal/scheduler/resources/Scheduler_en.properties ___________________________________________________________________ Name: svn:eol-style + native From svnnotify ¡÷ sourceforge.jp Thu Dec 4 07:37:34 2008 From: svnnotify ¡÷ sourceforge.jp (svnnotify ¡÷ sourceforge.jp) Date: Thu, 04 Dec 2008 07:37:34 +0900 Subject: [pal-cvs 3773] [1508] added properties files for en. Message-ID: <1228343854.657005.28186.nullmailer@users.sourceforge.jp> Revision: 1508 http://svn.sourceforge.jp/view?root=pal&view=rev&rev=1508 Author: shinsuke Date: 2008-12-04 07:37:34 +0900 (Thu, 04 Dec 2008) Log Message: ----------- added properties files for en. Added Paths: ----------- timecard/trunk/src/main/resources/jp/sf/pal/timecard/resources/TimecardAdmin_en.properties timecard/trunk/src/main/resources/jp/sf/pal/timecard/resources/TimecardConfig_en.properties timecard/trunk/src/main/resources/jp/sf/pal/timecard/resources/TimecardEditor_en.properties timecard/trunk/src/main/resources/jp/sf/pal/timecard/resources/TimecardManager_en.properties -------------- next part -------------- Added: timecard/trunk/src/main/resources/jp/sf/pal/timecard/resources/TimecardAdmin_en.properties =================================================================== --- timecard/trunk/src/main/resources/jp/sf/pal/timecard/resources/TimecardAdmin_en.properties (rev 0) +++ timecard/trunk/src/main/resources/jp/sf/pal/timecard/resources/TimecardAdmin_en.properties 2008-12-03 22:37:34 UTC (rev 1508) @@ -0,0 +1,4 @@ +# portlet info +javax.portlet.title=Timecard Manager +javax.portlet.short-title=Timecard Manager +javax.portlet.keywords=Timecard,Management,Groupware Property changes on: timecard/trunk/src/main/resources/jp/sf/pal/timecard/resources/TimecardAdmin_en.properties ___________________________________________________________________ Name: svn:eol-style + native Added: timecard/trunk/src/main/resources/jp/sf/pal/timecard/resources/TimecardConfig_en.properties =================================================================== --- timecard/trunk/src/main/resources/jp/sf/pal/timecard/resources/TimecardConfig_en.properties (rev 0) +++ timecard/trunk/src/main/resources/jp/sf/pal/timecard/resources/TimecardConfig_en.properties 2008-12-03 22:37:34 UTC (rev 1508) @@ -0,0 +1,4 @@ +# portlet info +javax.portlet.title=Timecard Config +javax.portlet.short-title=Config +javax.portlet.keywords=Timecard,Config,Groupware Property changes on: timecard/trunk/src/main/resources/jp/sf/pal/timecard/resources/TimecardConfig_en.properties ___________________________________________________________________ Name: svn:eol-style + native Added: timecard/trunk/src/main/resources/jp/sf/pal/timecard/resources/TimecardEditor_en.properties =================================================================== --- timecard/trunk/src/main/resources/jp/sf/pal/timecard/resources/TimecardEditor_en.properties (rev 0) +++ timecard/trunk/src/main/resources/jp/sf/pal/timecard/resources/TimecardEditor_en.properties 2008-12-03 22:37:34 UTC (rev 1508) @@ -0,0 +1,4 @@ +# portlet info +javax.portlet.title=Timecard +javax.portlet.short-title=Timecard +javax.portlet.keywords=Timecard,Groupware Property changes on: timecard/trunk/src/main/resources/jp/sf/pal/timecard/resources/TimecardEditor_en.properties ___________________________________________________________________ Name: svn:eol-style + native Added: timecard/trunk/src/main/resources/jp/sf/pal/timecard/resources/TimecardManager_en.properties =================================================================== --- timecard/trunk/src/main/resources/jp/sf/pal/timecard/resources/TimecardManager_en.properties (rev 0) +++ timecard/trunk/src/main/resources/jp/sf/pal/timecard/resources/TimecardManager_en.properties 2008-12-03 22:37:34 UTC (rev 1508) @@ -0,0 +1,4 @@ +# portlet info +javax.portlet.title=Timecard Management +javax.portlet.short-title=Timecard +javax.portlet.keywords=Timecard,Groupware Property changes on: timecard/trunk/src/main/resources/jp/sf/pal/timecard/resources/TimecardManager_en.properties ___________________________________________________________________ Name: svn:eol-style + native From svnnotify ¡÷ sourceforge.jp Thu Dec 4 07:38:50 2008 From: svnnotify ¡÷ sourceforge.jp (svnnotify ¡÷ sourceforge.jp) Date: Thu, 04 Dec 2008 07:38:50 +0900 Subject: [pal-cvs 3774] [1509] added properties files for en. Message-ID: <1228343930.344025.30127.nullmailer@users.sourceforge.jp> Revision: 1509 http://svn.sourceforge.jp/view?root=pal&view=rev&rev=1509 Author: shinsuke Date: 2008-12-04 07:38:50 +0900 (Thu, 04 Dec 2008) Log Message: ----------- added properties files for en. Added Paths: ----------- todolist/trunk/src/main/resources/jp/sf/pal/todolist/resources/TodoListConfiguration_en.properties todolist/trunk/src/main/resources/jp/sf/pal/todolist/resources/TodoListEditor_en.properties todolist/trunk/src/main/resources/jp/sf/pal/todolist/resources/TodoListManager_en.properties -------------- next part -------------- Added: todolist/trunk/src/main/resources/jp/sf/pal/todolist/resources/TodoListConfiguration_en.properties =================================================================== --- todolist/trunk/src/main/resources/jp/sf/pal/todolist/resources/TodoListConfiguration_en.properties (rev 0) +++ todolist/trunk/src/main/resources/jp/sf/pal/todolist/resources/TodoListConfiguration_en.properties 2008-12-03 22:38:50 UTC (rev 1509) @@ -0,0 +1,4 @@ +# portlet info +javax.portlet.title=ToDo List Config +javax.portlet.short-title=Config +javax.portlet.keywords=ToDo,Config,Groupware Property changes on: todolist/trunk/src/main/resources/jp/sf/pal/todolist/resources/TodoListConfiguration_en.properties ___________________________________________________________________ Name: svn:eol-style + native Added: todolist/trunk/src/main/resources/jp/sf/pal/todolist/resources/TodoListEditor_en.properties =================================================================== --- todolist/trunk/src/main/resources/jp/sf/pal/todolist/resources/TodoListEditor_en.properties (rev 0) +++ todolist/trunk/src/main/resources/jp/sf/pal/todolist/resources/TodoListEditor_en.properties 2008-12-03 22:38:50 UTC (rev 1509) @@ -0,0 +1,4 @@ +# portlet info +javax.portlet.title=ToDo List +javax.portlet.short-title=ToDo +javax.portlet.keywords=ToDo,Groupware Property changes on: todolist/trunk/src/main/resources/jp/sf/pal/todolist/resources/TodoListEditor_en.properties ___________________________________________________________________ Name: svn:eol-style + native Added: todolist/trunk/src/main/resources/jp/sf/pal/todolist/resources/TodoListManager_en.properties =================================================================== --- todolist/trunk/src/main/resources/jp/sf/pal/todolist/resources/TodoListManager_en.properties (rev 0) +++ todolist/trunk/src/main/resources/jp/sf/pal/todolist/resources/TodoListManager_en.properties 2008-12-03 22:38:50 UTC (rev 1509) @@ -0,0 +1,4 @@ +# portlet info +javax.portlet.title=ToDo List Manager +javax.portlet.short-title=Manager +javax.portlet.keywords=ToDo,Management,Groupware Property changes on: todolist/trunk/src/main/resources/jp/sf/pal/todolist/resources/TodoListManager_en.properties ___________________________________________________________________ Name: svn:eol-style + native From svnnotify ¡÷ sourceforge.jp Thu Dec 4 07:39:51 2008 From: svnnotify ¡÷ sourceforge.jp (svnnotify ¡÷ sourceforge.jp) Date: Thu, 04 Dec 2008 07:39:51 +0900 Subject: [pal-cvs 3775] [1510] added properties files for en. Message-ID: <1228343991.469843.30541.nullmailer@users.sourceforge.jp> Revision: 1510 http://svn.sourceforge.jp/view?root=pal&view=rev&rev=1510 Author: shinsuke Date: 2008-12-04 07:39:51 +0900 (Thu, 04 Dec 2008) Log Message: ----------- added properties files for en. Added Paths: ----------- userinfo/trunk/src/main/resources/jp/sf/pal/userinfo/resources/UserInfoConfig_en.properties userinfo/trunk/src/main/resources/jp/sf/pal/userinfo/resources/UserInfoManager_en.properties -------------- next part -------------- Added: userinfo/trunk/src/main/resources/jp/sf/pal/userinfo/resources/UserInfoConfig_en.properties =================================================================== --- userinfo/trunk/src/main/resources/jp/sf/pal/userinfo/resources/UserInfoConfig_en.properties (rev 0) +++ userinfo/trunk/src/main/resources/jp/sf/pal/userinfo/resources/UserInfoConfig_en.properties 2008-12-03 22:39:51 UTC (rev 1510) @@ -0,0 +1,5 @@ +# portlet info +javax.portlet.title=User Info Config +javax.portlet.short-title=User Info +javax.portlet.keywords=User Info,Config,Groupware + Property changes on: userinfo/trunk/src/main/resources/jp/sf/pal/userinfo/resources/UserInfoConfig_en.properties ___________________________________________________________________ Name: svn:eol-style + native Added: userinfo/trunk/src/main/resources/jp/sf/pal/userinfo/resources/UserInfoManager_en.properties =================================================================== --- userinfo/trunk/src/main/resources/jp/sf/pal/userinfo/resources/UserInfoManager_en.properties (rev 0) +++ userinfo/trunk/src/main/resources/jp/sf/pal/userinfo/resources/UserInfoManager_en.properties 2008-12-03 22:39:51 UTC (rev 1510) @@ -0,0 +1,5 @@ +# portlet info +javax.portlet.title=User Info Manager +javax.portlet.short-title=Manager +javax.portlet.keywords=User Info,Management,Groupware + Property changes on: userinfo/trunk/src/main/resources/jp/sf/pal/userinfo/resources/UserInfoManager_en.properties ___________________________________________________________________ Name: svn:eol-style + native From svnnotify ¡÷ sourceforge.jp Thu Dec 4 07:41:49 2008 From: svnnotify ¡÷ sourceforge.jp (svnnotify ¡÷ sourceforge.jp) Date: Thu, 04 Dec 2008 07:41:49 +0900 Subject: [pal-cvs 3776] [1511] added properties files for en. Message-ID: <1228344109.364016.32736.nullmailer@users.sourceforge.jp> Revision: 1511 http://svn.sourceforge.jp/view?root=pal&view=rev&rev=1511 Author: shinsuke Date: 2008-12-04 07:41:49 +0900 (Thu, 04 Dec 2008) Log Message: ----------- added properties files for en. Added Paths: ----------- vfs-portlets/trunk/src/main/resources/jp/sf/pal/vfs/resources/VFSDefaultConfig_en.properties vfs-portlets/trunk/src/main/resources/jp/sf/pal/vfs/resources/VFSDefaultExplorer_en.properties vfs-portlets/trunk/src/main/resources/jp/sf/pal/vfs/resources/VFSPersonalFolderConfig_en.properties vfs-portlets/trunk/src/main/resources/jp/sf/pal/vfs/resources/VFSPersonalFolderExplorer_en.properties -------------- next part -------------- Added: vfs-portlets/trunk/src/main/resources/jp/sf/pal/vfs/resources/VFSDefaultConfig_en.properties =================================================================== --- vfs-portlets/trunk/src/main/resources/jp/sf/pal/vfs/resources/VFSDefaultConfig_en.properties (rev 0) +++ vfs-portlets/trunk/src/main/resources/jp/sf/pal/vfs/resources/VFSDefaultConfig_en.properties 2008-12-03 22:41:49 UTC (rev 1511) @@ -0,0 +1,5 @@ +# portlet info +javax.portlet.title=VFS Config +javax.portlet.short-title=Config +javax.portlet.keywords=VFS,Config + Property changes on: vfs-portlets/trunk/src/main/resources/jp/sf/pal/vfs/resources/VFSDefaultConfig_en.properties ___________________________________________________________________ Name: svn:eol-style + native Added: vfs-portlets/trunk/src/main/resources/jp/sf/pal/vfs/resources/VFSDefaultExplorer_en.properties =================================================================== --- vfs-portlets/trunk/src/main/resources/jp/sf/pal/vfs/resources/VFSDefaultExplorer_en.properties (rev 0) +++ vfs-portlets/trunk/src/main/resources/jp/sf/pal/vfs/resources/VFSDefaultExplorer_en.properties 2008-12-03 22:41:49 UTC (rev 1511) @@ -0,0 +1,5 @@ +# portlet info +javax.portlet.title=VFS Explorer +javax.portlet.short-title=VFS +javax.portlet.keywords=VFS + Property changes on: vfs-portlets/trunk/src/main/resources/jp/sf/pal/vfs/resources/VFSDefaultExplorer_en.properties ___________________________________________________________________ Name: svn:eol-style + native Added: vfs-portlets/trunk/src/main/resources/jp/sf/pal/vfs/resources/VFSPersonalFolderConfig_en.properties =================================================================== --- vfs-portlets/trunk/src/main/resources/jp/sf/pal/vfs/resources/VFSPersonalFolderConfig_en.properties (rev 0) +++ vfs-portlets/trunk/src/main/resources/jp/sf/pal/vfs/resources/VFSPersonalFolderConfig_en.properties 2008-12-03 22:41:49 UTC (rev 1511) @@ -0,0 +1,5 @@ +# portlet info +javax.portlet.title=Personal Folder Config +javax.portlet.short-title=Config +javax.portlet.keywords=VFS,Personal Folder,Config + Property changes on: vfs-portlets/trunk/src/main/resources/jp/sf/pal/vfs/resources/VFSPersonalFolderConfig_en.properties ___________________________________________________________________ Name: svn:eol-style + native Added: vfs-portlets/trunk/src/main/resources/jp/sf/pal/vfs/resources/VFSPersonalFolderExplorer_en.properties =================================================================== --- vfs-portlets/trunk/src/main/resources/jp/sf/pal/vfs/resources/VFSPersonalFolderExplorer_en.properties (rev 0) +++ vfs-portlets/trunk/src/main/resources/jp/sf/pal/vfs/resources/VFSPersonalFolderExplorer_en.properties 2008-12-03 22:41:49 UTC (rev 1511) @@ -0,0 +1,5 @@ +# portlet info +javax.portlet.title=Personal Folder +javax.portlet.short-title=Personal Folder +javax.portlet.keywords=VFS,Personal Folder + Property changes on: vfs-portlets/trunk/src/main/resources/jp/sf/pal/vfs/resources/VFSPersonalFolderExplorer_en.properties ___________________________________________________________________ Name: svn:eol-style + native From svnnotify ¡÷ sourceforge.jp Thu Dec 4 09:09:53 2008 From: svnnotify ¡÷ sourceforge.jp (svnnotify ¡÷ sourceforge.jp) Date: Thu, 04 Dec 2008 09:09:53 +0900 Subject: [pal-cvs 3777] [1512] a selected item is displayed as bold. Message-ID: <1228349393.662870.29768.nullmailer@users.sourceforge.jp> Revision: 1512 http://svn.sourceforge.jp/view?root=pal&view=rev&rev=1512 Author: shinsuke Date: 2008-12-04 09:09:53 +0900 (Thu, 04 Dec 2008) Log Message: ----------- a selected item is displayed as bold. Modified Paths: -------------- todolist/trunk/src/main/webapp/WEB-INF/view/user/todo/index.jsp -------------- next part -------------- Modified: todolist/trunk/src/main/webapp/WEB-INF/view/user/todo/index.jsp =================================================================== --- todolist/trunk/src/main/webapp/WEB-INF/view/user/todo/index.jsp 2008-12-03 22:41:49 UTC (rev 1511) +++ todolist/trunk/src/main/webapp/WEB-INF/view/user/todo/index.jsp 2008-12-04 00:09:53 UTC (rev 1512) @@ -40,16 +40,18 @@ - + - From svnnotify ¡÷ sourceforge.jp Thu Dec 4 09:44:57 2008 From: svnnotify ¡÷ sourceforge.jp (svnnotify ¡÷ sourceforge.jp) Date: Thu, 04 Dec 2008 09:44:57 +0900 Subject: [pal-cvs 3778] [1513] not displayed secret events. Message-ID: <1228351497.605948.3033.nullmailer@users.sourceforge.jp> Revision: 1513 http://svn.sourceforge.jp/view?root=pal&view=rev&rev=1513 Author: shinsuke Date: 2008-12-04 09:44:57 +0900 (Thu, 04 Dec 2008) Log Message: ----------- not displayed secret events. Modified Paths: -------------- scheduler/trunk/src/main/webapp/WEB-INF/view/user/schedule/calendar/groupweek.jsp -------------- next part -------------- Modified: scheduler/trunk/src/main/webapp/WEB-INF/view/user/schedule/calendar/groupweek.jsp =================================================================== --- scheduler/trunk/src/main/webapp/WEB-INF/view/user/schedule/calendar/groupweek.jsp 2008-12-04 00:09:53 UTC (rev 1512) +++ scheduler/trunk/src/main/webapp/WEB-INF/view/user/schedule/calendar/groupweek.jsp 2008-12-04 00:44:57 UTC (rev 1513) @@ -111,12 +111,12 @@ - - + - + - + - + Modified: vfs-portlets/trunk/src/main/webapp/WEB-INF/view/list/index.jsp =================================================================== --- vfs-portlets/trunk/src/main/webapp/WEB-INF/view/list/index.jsp 2008-12-04 05:15:03 UTC (rev 1518) +++ vfs-portlets/trunk/src/main/webapp/WEB-INF/view/list/index.jsp 2008-12-04 05:23:37 UTC (rev 1519) @@ -64,7 +64,7 @@ Modified: vfs-portlets/trunk/src/main/webapp/WEB-INF/view/newfolder/confirm.jsp =================================================================== --- vfs-portlets/trunk/src/main/webapp/WEB-INF/view/newfolder/confirm.jsp 2008-12-04 05:15:03 UTC (rev 1518) +++ vfs-portlets/trunk/src/main/webapp/WEB-INF/view/newfolder/confirm.jsp 2008-12-04 05:23:37 UTC (rev 1519) @@ -28,10 +28,12 @@
-
    -
  • +
+
    +
  • ?
  • +
  • -
  • ${f:h(c.name)}
  • +
  • ?${f:h(c.name)}
  • +
  • ${f:h(c.name)}
+
    -
  • ${event.time}
    - - +
  • ${event.time}
    + + ${event.title} ${event.title} From svnnotify ¡÷ sourceforge.jp Thu Dec 4 10:15:28 2008 From: svnnotify ¡÷ sourceforge.jp (svnnotify ¡÷ sourceforge.jp) Date: Thu, 04 Dec 2008 10:15:28 +0900 Subject: [pal-cvs 3779] [1514] set a default value to a minute. Message-ID: <1228353328.529732.1788.nullmailer@users.sourceforge.jp> Revision: 1514 http://svn.sourceforge.jp/view?root=pal&view=rev&rev=1514 Author: shinsuke Date: 2008-12-04 10:15:28 +0900 (Thu, 04 Dec 2008) Log Message: ----------- set a default value to a minute. Modified Paths: -------------- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/action/user/facility/OnetimeScheduleAction.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/action/user/facility/RepeatScheduleAction.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/action/user/schedule/OnetimeScheduleAction.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/action/user/schedule/RepeatScheduleAction.java -------------- next part -------------- Modified: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/action/user/facility/OnetimeScheduleAction.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/action/user/facility/OnetimeScheduleAction.java 2008-12-04 00:44:57 UTC (rev 1513) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/action/user/facility/OnetimeScheduleAction.java 2008-12-04 01:15:28 UTC (rev 1514) @@ -27,6 +27,7 @@ import jp.sf.pal.scheduler.service.UserInfoService; import jp.sf.pal.scheduler.util.SchedulerUtil; +import org.apache.commons.lang.StringUtils; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.seasar.struts.annotation.ActionForm; @@ -216,6 +217,19 @@ throw new ActionMessagesException("errors.invalid_end_date"); } editable = true; + + // set minutes + if (!StringUtils.isEmpty(onetimeScheduleForm.startTimeH) + && StringUtils.isEmpty(onetimeScheduleForm.startTimeM)) { + onetimeScheduleForm.startTimeM = "00"; + } + + // set minutes + if (!StringUtils.isEmpty(onetimeScheduleForm.endTimeH) + && StringUtils.isEmpty(onetimeScheduleForm.endTimeM)) { + onetimeScheduleForm.endTimeM = "00"; + } + return "confirm.jsp"; } Modified: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/action/user/facility/RepeatScheduleAction.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/action/user/facility/RepeatScheduleAction.java 2008-12-04 00:44:57 UTC (rev 1513) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/action/user/facility/RepeatScheduleAction.java 2008-12-04 01:15:28 UTC (rev 1514) @@ -27,6 +27,7 @@ import jp.sf.pal.scheduler.service.UserInfoService; import jp.sf.pal.scheduler.util.SchedulerUtil; +import org.apache.commons.lang.StringUtils; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.seasar.struts.annotation.ActionForm; @@ -214,6 +215,19 @@ throw new ActionMessagesException("errors.invalid_end_date"); } editable = true; + + // set minutes + if (!StringUtils.isEmpty(repeatScheduleForm.startTimeH) + && StringUtils.isEmpty(repeatScheduleForm.startTimeM)) { + repeatScheduleForm.startTimeM = "00"; + } + + // set minutes + if (!StringUtils.isEmpty(repeatScheduleForm.endTimeH) + && StringUtils.isEmpty(repeatScheduleForm.endTimeM)) { + repeatScheduleForm.endTimeM = "00"; + } + return "confirm.jsp"; } Modified: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/action/user/schedule/OnetimeScheduleAction.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/action/user/schedule/OnetimeScheduleAction.java 2008-12-04 00:44:57 UTC (rev 1513) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/action/user/schedule/OnetimeScheduleAction.java 2008-12-04 01:15:28 UTC (rev 1514) @@ -27,6 +27,7 @@ import jp.sf.pal.scheduler.service.UserInfoService; import jp.sf.pal.scheduler.util.SchedulerUtil; +import org.apache.commons.lang.StringUtils; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.seasar.struts.annotation.ActionForm; @@ -210,6 +211,19 @@ throw new ActionMessagesException("errors.invalid_end_date"); } editable = true; + + // set minutes + if (!StringUtils.isEmpty(onetimeScheduleForm.startTimeH) + && StringUtils.isEmpty(onetimeScheduleForm.startTimeM)) { + onetimeScheduleForm.startTimeM = "00"; + } + + // set minutes + if (!StringUtils.isEmpty(onetimeScheduleForm.endTimeH) + && StringUtils.isEmpty(onetimeScheduleForm.endTimeM)) { + onetimeScheduleForm.endTimeM = "00"; + } + return "confirm.jsp"; } Modified: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/action/user/schedule/RepeatScheduleAction.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/action/user/schedule/RepeatScheduleAction.java 2008-12-04 00:44:57 UTC (rev 1513) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/action/user/schedule/RepeatScheduleAction.java 2008-12-04 01:15:28 UTC (rev 1514) @@ -27,6 +27,7 @@ import jp.sf.pal.scheduler.service.UserInfoService; import jp.sf.pal.scheduler.util.SchedulerUtil; +import org.apache.commons.lang.StringUtils; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.seasar.struts.annotation.ActionForm; @@ -208,6 +209,19 @@ throw new ActionMessagesException("errors.invalid_end_date"); } editable = true; + + // set minutes + if (!StringUtils.isEmpty(repeatScheduleForm.startTimeH) + && StringUtils.isEmpty(repeatScheduleForm.startTimeM)) { + repeatScheduleForm.startTimeM = "00"; + } + + // set minutes + if (!StringUtils.isEmpty(repeatScheduleForm.endTimeH) + && StringUtils.isEmpty(repeatScheduleForm.endTimeM)) { + repeatScheduleForm.endTimeM = "00"; + } + return "confirm.jsp"; } From svnnotify ¡÷ sourceforge.jp Thu Dec 4 11:12:08 2008 From: svnnotify ¡÷ sourceforge.jp (svnnotify ¡÷ sourceforge.jp) Date: Thu, 04 Dec 2008 11:12:08 +0900 Subject: [pal-cvs 3780] [1515] set a default value to a minute. Message-ID: <1228356728.965603.27862.nullmailer@users.sourceforge.jp> Revision: 1515 http://svn.sourceforge.jp/view?root=pal&view=rev&rev=1515 Author: shinsuke Date: 2008-12-04 11:12:08 +0900 (Thu, 04 Dec 2008) Log Message: ----------- set a default value to a minute. Modified Paths: -------------- timecard/trunk/src/main/java/jp/sf/pal/timecard/action/EmployeeAction.java timecard/trunk/src/main/java/jp/sf/pal/timecard/action/admin/TimecardAction.java -------------- next part -------------- Modified: timecard/trunk/src/main/java/jp/sf/pal/timecard/action/EmployeeAction.java =================================================================== --- timecard/trunk/src/main/java/jp/sf/pal/timecard/action/EmployeeAction.java 2008-12-04 01:15:28 UTC (rev 1514) +++ timecard/trunk/src/main/java/jp/sf/pal/timecard/action/EmployeeAction.java 2008-12-04 02:12:08 UTC (rev 1515) @@ -187,6 +187,30 @@ employeeForm.status = String .valueOf(TimecardConstants.REPORT_STATUS_EDITING); + // set minutes + if (!StringUtils.isEmpty(employeeForm.startTimeHr) + && StringUtils.isEmpty(employeeForm.startTimeMin)) { + employeeForm.startTimeMin = "00"; + } + + // set minutes + if (!StringUtils.isEmpty(employeeForm.endTimeHr) + && StringUtils.isEmpty(employeeForm.endTimeMin)) { + employeeForm.endTimeMin = "00"; + } + + // set minutes + if (!StringUtils.isEmpty(employeeForm.otjTimeHr) + && StringUtils.isEmpty(employeeForm.otjTimeMin)) { + employeeForm.otjTimeMin = "00"; + } + + // set minutes + if (!StringUtils.isEmpty(employeeForm.breakTimeHr) + && StringUtils.isEmpty(employeeForm.breakTimeMin)) { + employeeForm.breakTimeMin = "00"; + } + if (StringUtils.isEmpty(employeeForm.startTimeHr) || StringUtils.isEmpty(employeeForm.startTimeMin)) { employeeForm.startTimeHr = ""; @@ -220,6 +244,7 @@ employeeForm.otjTimeMin = ""; } } + return "confirm.jsp"; } @@ -228,6 +253,30 @@ employeeForm.status = String .valueOf(TimecardConstants.REPORT_STATUS_REQUEST); + // set minutes + if (!StringUtils.isEmpty(employeeForm.startTimeHr) + && StringUtils.isEmpty(employeeForm.startTimeMin)) { + employeeForm.startTimeMin = "00"; + } + + // set minutes + if (!StringUtils.isEmpty(employeeForm.endTimeHr) + && StringUtils.isEmpty(employeeForm.endTimeMin)) { + employeeForm.endTimeMin = "00"; + } + + // set minutes + if (!StringUtils.isEmpty(employeeForm.otjTimeHr) + && StringUtils.isEmpty(employeeForm.otjTimeMin)) { + employeeForm.otjTimeMin = "00"; + } + + // set minutes + if (!StringUtils.isEmpty(employeeForm.breakTimeHr) + && StringUtils.isEmpty(employeeForm.breakTimeMin)) { + employeeForm.breakTimeMin = "00"; + } + if (StringUtils.isEmpty(employeeForm.startTimeHr) || StringUtils.isEmpty(employeeForm.startTimeMin)) { employeeForm.startTimeHr = ""; Modified: timecard/trunk/src/main/java/jp/sf/pal/timecard/action/admin/TimecardAction.java =================================================================== --- timecard/trunk/src/main/java/jp/sf/pal/timecard/action/admin/TimecardAction.java 2008-12-04 01:15:28 UTC (rev 1514) +++ timecard/trunk/src/main/java/jp/sf/pal/timecard/action/admin/TimecardAction.java 2008-12-04 02:12:08 UTC (rev 1515) @@ -168,6 +168,30 @@ @Execute(validator = true, input = "edit.jsp") public String confirm() { + // set minutes + if (!StringUtils.isEmpty(timecardForm.startTimeHr) + && StringUtils.isEmpty(timecardForm.startTimeMin)) { + timecardForm.startTimeMin = "00"; + } + + // set minutes + if (!StringUtils.isEmpty(timecardForm.endTimeHr) + && StringUtils.isEmpty(timecardForm.endTimeMin)) { + timecardForm.endTimeMin = "00"; + } + + // set minutes + if (!StringUtils.isEmpty(timecardForm.otjTimeHr) + && StringUtils.isEmpty(timecardForm.otjTimeMin)) { + timecardForm.otjTimeMin = "00"; + } + + // set minutes + if (!StringUtils.isEmpty(timecardForm.breakTimeHr) + && StringUtils.isEmpty(timecardForm.breakTimeMin)) { + timecardForm.breakTimeMin = "00"; + } + if (StringUtils.isEmpty(timecardForm.startTimeHr) || StringUtils.isEmpty(timecardForm.startTimeMin)) { timecardForm.startTimeHr = ""; From svnnotify ¡÷ sourceforge.jp Thu Dec 4 11:30:06 2008 From: svnnotify ¡÷ sourceforge.jp (svnnotify ¡÷ sourceforge.jp) Date: Thu, 04 Dec 2008 11:30:06 +0900 Subject: [pal-cvs 3781] [1516] validate start and end time. Message-ID: <1228357806.547523.19930.nullmailer@users.sourceforge.jp> Revision: 1516 http://svn.sourceforge.jp/view?root=pal&view=rev&rev=1516 Author: shinsuke Date: 2008-12-04 11:30:06 +0900 (Thu, 04 Dec 2008) Log Message: ----------- validate start and end time. Modified Paths: -------------- timecard/trunk/src/main/java/jp/sf/pal/timecard/action/EmployeeAction.java timecard/trunk/src/main/java/jp/sf/pal/timecard/action/admin/TimecardAction.java timecard/trunk/src/main/resources/application.properties timecard/trunk/src/main/resources/application_ja.properties -------------- next part -------------- Modified: timecard/trunk/src/main/java/jp/sf/pal/timecard/action/EmployeeAction.java =================================================================== --- timecard/trunk/src/main/java/jp/sf/pal/timecard/action/EmployeeAction.java 2008-12-04 02:12:08 UTC (rev 1515) +++ timecard/trunk/src/main/java/jp/sf/pal/timecard/action/EmployeeAction.java 2008-12-04 02:30:06 UTC (rev 1516) @@ -245,6 +245,23 @@ } } + // check start and end time + if (!StringUtils.isEmpty(employeeForm.startTimeHr) + && !StringUtils.isEmpty(employeeForm.startTimeMin) + && !StringUtils.isEmpty(employeeForm.endTimeMin) + && !StringUtils.isEmpty(employeeForm.endTimeHr)) { + long startTime = DateUtil.get(70, 0, 1, + Integer.parseInt(employeeForm.startTimeHr), + Integer.parseInt(employeeForm.startTimeMin)).getTime(); + long endTime = DateUtil.get(70, 0, 1, + Integer.parseInt(employeeForm.endTimeHr), + Integer.parseInt(employeeForm.endTimeMin)).getTime(); + if (startTime > endTime) { + throw new ActionMessagesException( + "errors.end_time_must_be_after_start_time"); + } + } + return "confirm.jsp"; } @@ -311,6 +328,22 @@ } } + // check start and end time + if (!StringUtils.isEmpty(employeeForm.startTimeHr) + && !StringUtils.isEmpty(employeeForm.startTimeMin) + && !StringUtils.isEmpty(employeeForm.endTimeMin) + && !StringUtils.isEmpty(employeeForm.endTimeHr)) { + long startTime = DateUtil.get(70, 0, 1, + Integer.parseInt(employeeForm.startTimeHr), + Integer.parseInt(employeeForm.startTimeMin)).getTime(); + long endTime = DateUtil.get(70, 0, 1, + Integer.parseInt(employeeForm.endTimeHr), + Integer.parseInt(employeeForm.endTimeMin)).getTime(); + if (startTime > endTime) { + throw new ActionMessagesException( + "errors.end_time_must_be_after_start_time"); + } + } return "confirm.jsp"; } @@ -349,6 +382,23 @@ @Execute(validator = true, input = "edit.jsp") public String update() { + // check start and end time + if (!StringUtils.isEmpty(employeeForm.startTimeHr) + && !StringUtils.isEmpty(employeeForm.startTimeMin) + && !StringUtils.isEmpty(employeeForm.endTimeMin) + && !StringUtils.isEmpty(employeeForm.endTimeHr)) { + long startTime = DateUtil.get(70, 0, 1, + Integer.parseInt(employeeForm.startTimeHr), + Integer.parseInt(employeeForm.startTimeMin)).getTime(); + long endTime = DateUtil.get(70, 0, 1, + Integer.parseInt(employeeForm.endTimeHr), + Integer.parseInt(employeeForm.endTimeMin)).getTime(); + if (startTime > endTime) { + throw new ActionMessagesException( + "errors.end_time_must_be_after_start_time"); + } + } + try { DailyReport dailyReport = createDailyReport(); reportService.store(dailyReport); Modified: timecard/trunk/src/main/java/jp/sf/pal/timecard/action/admin/TimecardAction.java =================================================================== --- timecard/trunk/src/main/java/jp/sf/pal/timecard/action/admin/TimecardAction.java 2008-12-04 02:12:08 UTC (rev 1515) +++ timecard/trunk/src/main/java/jp/sf/pal/timecard/action/admin/TimecardAction.java 2008-12-04 02:30:06 UTC (rev 1516) @@ -226,6 +226,23 @@ } } + // check start and end time + if (!StringUtils.isEmpty(timecardForm.startTimeHr) + && !StringUtils.isEmpty(timecardForm.startTimeMin) + && !StringUtils.isEmpty(timecardForm.endTimeMin) + && !StringUtils.isEmpty(timecardForm.endTimeHr)) { + long startTime = DateUtil.get(70, 0, 1, + Integer.parseInt(timecardForm.startTimeHr), + Integer.parseInt(timecardForm.startTimeMin)).getTime(); + long endTime = DateUtil.get(70, 0, 1, + Integer.parseInt(timecardForm.endTimeHr), + Integer.parseInt(timecardForm.endTimeMin)).getTime(); + if (startTime > endTime) { + throw new ActionMessagesException( + "errors.end_time_must_be_after_start_time"); + } + } + return "confirm.jsp"; } @@ -264,6 +281,23 @@ @Execute(validator = true, input = "edit.jsp") public String update() { + // check start and end time + if (!StringUtils.isEmpty(timecardForm.startTimeHr) + && !StringUtils.isEmpty(timecardForm.startTimeMin) + && !StringUtils.isEmpty(timecardForm.endTimeMin) + && !StringUtils.isEmpty(timecardForm.endTimeHr)) { + long startTime = DateUtil.get(70, 0, 1, + Integer.parseInt(timecardForm.startTimeHr), + Integer.parseInt(timecardForm.startTimeMin)).getTime(); + long endTime = DateUtil.get(70, 0, 1, + Integer.parseInt(timecardForm.endTimeHr), + Integer.parseInt(timecardForm.endTimeMin)).getTime(); + if (startTime > endTime) { + throw new ActionMessagesException( + "errors.end_time_must_be_after_start_time"); + } + } + try { DailyReport dailyReport = createDailyReport(); reportService.store(dailyReport); Modified: timecard/trunk/src/main/resources/application.properties =================================================================== --- timecard/trunk/src/main/resources/application.properties 2008-12-04 02:12:08 UTC (rev 1515) +++ timecard/trunk/src/main/resources/application.properties 2008-12-04 02:30:06 UTC (rev 1516) @@ -60,6 +60,8 @@ errors.could_not_create_notification_content=Could not create a notification content. errors.failed_to_send_notification=Failed to send a notification from {0} to {1}. +errors.end_time_must_be_after_start_time=End time must be after Start time. + labels.detail=Detail labels.create=Create labels.update=Update Modified: timecard/trunk/src/main/resources/application_ja.properties =================================================================== --- timecard/trunk/src/main/resources/application_ja.properties 2008-12-04 02:12:08 UTC (rev 1515) +++ timecard/trunk/src/main/resources/application_ja.properties 2008-12-04 02:30:06 UTC (rev 1516) @@ -53,6 +53,8 @@ errors.could_not_create_notification_content=\u901a\u4fe1\u5185\u5bb9\u3092\u4f5c\u6210\u3067\u304d\u307e\u305b\u3093\u3067\u3057\u305f\u3002 errors.failed_to_send_notification={0} \u304b\u3089 {1} \u3078\u901a\u77e5\u3092\u9001\u4fe1\u3067\u304d\u307e\u305b\u3093\u3067\u3057\u305f\u3002 +errors.end_time_must_be_after_start_time=\u7d42\u4e86\u6642\u9593\u306f\u958b\u59cb\u6642\u9593\u4ee5\u964d\u306b\u3057\u3066\u304f\u3060\u3055\u3044\u3002 + labels.detail=\u8a73\u7d30 labels.create=\u4f5c\u6210 labels.update=\u66f4\u65b0 From svnnotify ¡÷ sourceforge.jp Thu Dec 4 13:00:15 2008 From: svnnotify ¡÷ sourceforge.jp (svnnotify ¡÷ sourceforge.jp) Date: Thu, 04 Dec 2008 13:00:15 +0900 Subject: [pal-cvs 3782] [1517] check start and end date. Message-ID: <1228363215.987082.18748.nullmailer@users.sourceforge.jp> Revision: 1517 http://svn.sourceforge.jp/view?root=pal&view=rev&rev=1517 Author: shinsuke Date: 2008-12-04 13:00:15 +0900 (Thu, 04 Dec 2008) Log Message: ----------- check start and end date. Modified Paths: -------------- todolist/trunk/src/main/java/jp/sf/pal/todolist/action/admin/TodoAction.java todolist/trunk/src/main/java/jp/sf/pal/todolist/action/user/TodoAction.java todolist/trunk/src/main/resources/application.properties todolist/trunk/src/main/resources/application_ja.properties -------------- next part -------------- Modified: todolist/trunk/src/main/java/jp/sf/pal/todolist/action/admin/TodoAction.java =================================================================== --- todolist/trunk/src/main/java/jp/sf/pal/todolist/action/admin/TodoAction.java 2008-12-04 02:30:06 UTC (rev 1516) +++ todolist/trunk/src/main/java/jp/sf/pal/todolist/action/admin/TodoAction.java 2008-12-04 04:00:15 UTC (rev 1517) @@ -182,6 +182,32 @@ @Execute(validator = true, input = "edit.jsp") public String confirm() { + + // check date + if (!StringUtils.isEmpty(todoForm.startDateYear) + && !StringUtils.isEmpty(todoForm.startDateMonth) + && !StringUtils.isEmpty(todoForm.startDateDate) + && !StringUtils.isEmpty(todoForm.endDateYear) + && !StringUtils.isEmpty(todoForm.endDateMonth) + && !StringUtils.isEmpty(todoForm.endDateDate)) { + Date startDate = DateUtil.get(Integer + .parseInt(todoForm.startDateYear) - 1900, Integer + .parseInt(todoForm.startDateMonth) - 1, Integer + .parseInt(todoForm.startDateDate)); + Date endDate = DateUtil.get( + Integer.parseInt(todoForm.endDateYear) - 1900, Integer + .parseInt(todoForm.endDateMonth) - 1, Integer + .parseInt(todoForm.endDateDate)); + if (startDate.getTime() > endDate.getTime()) { + if (!StringUtils.isEmpty(todoForm.idForTodo)) { + todoMappingItems = todoService.getTodoMappingList(Long + .parseLong(todoForm.idForTodo), null); + } + throw new ActionMessagesException( + "errors.end_time_must_be_after_start_time"); + } + } + return "confirm.jsp"; } @@ -241,6 +267,31 @@ @Execute(validator = true, input = "edit.jsp") public String create() { + // check date + if (!StringUtils.isEmpty(todoForm.startDateYear) + && !StringUtils.isEmpty(todoForm.startDateMonth) + && !StringUtils.isEmpty(todoForm.startDateDate) + && !StringUtils.isEmpty(todoForm.endDateYear) + && !StringUtils.isEmpty(todoForm.endDateMonth) + && !StringUtils.isEmpty(todoForm.endDateDate)) { + Date startDate = DateUtil.get(Integer + .parseInt(todoForm.startDateYear) - 1900, Integer + .parseInt(todoForm.startDateMonth) - 1, Integer + .parseInt(todoForm.startDateDate)); + Date endDate = DateUtil.get( + Integer.parseInt(todoForm.endDateYear) - 1900, Integer + .parseInt(todoForm.endDateMonth) - 1, Integer + .parseInt(todoForm.endDateDate)); + if (startDate.getTime() > endDate.getTime()) { + if (!StringUtils.isEmpty(todoForm.idForTodo)) { + todoMappingItems = todoService.getTodoMappingList(Long + .parseLong(todoForm.idForTodo), null); + } + throw new ActionMessagesException( + "errors.end_time_must_be_after_start_time"); + } + } + try { Todo todo = createTodo(); todoService.store(todo); @@ -261,6 +312,31 @@ @Execute(validator = true, input = "edit.jsp") public String update() { + // check date + if (!StringUtils.isEmpty(todoForm.startDateYear) + && !StringUtils.isEmpty(todoForm.startDateMonth) + && !StringUtils.isEmpty(todoForm.startDateDate) + && !StringUtils.isEmpty(todoForm.endDateYear) + && !StringUtils.isEmpty(todoForm.endDateMonth) + && !StringUtils.isEmpty(todoForm.endDateDate)) { + Date startDate = DateUtil.get(Integer + .parseInt(todoForm.startDateYear) - 1900, Integer + .parseInt(todoForm.startDateMonth) - 1, Integer + .parseInt(todoForm.startDateDate)); + Date endDate = DateUtil.get( + Integer.parseInt(todoForm.endDateYear) - 1900, Integer + .parseInt(todoForm.endDateMonth) - 1, Integer + .parseInt(todoForm.endDateDate)); + if (startDate.getTime() > endDate.getTime()) { + if (!StringUtils.isEmpty(todoForm.idForTodo)) { + todoMappingItems = todoService.getTodoMappingList(Long + .parseLong(todoForm.idForTodo), null); + } + throw new ActionMessagesException( + "errors.end_time_must_be_after_start_time"); + } + } + try { Todo todo = createTodo(); todoService.store(todo); @@ -399,6 +475,13 @@ } todoDxo.convertFromFormToTodo(todoForm, todo); + if (todoForm.getStartDateForTodo() == null) { + todo.setStartDate(null); + } + if (todoForm.getEndDateForTodo() == null) { + todo.setEndDate(null); + } + return todo; } Modified: todolist/trunk/src/main/java/jp/sf/pal/todolist/action/user/TodoAction.java =================================================================== --- todolist/trunk/src/main/java/jp/sf/pal/todolist/action/user/TodoAction.java 2008-12-04 02:30:06 UTC (rev 1516) +++ todolist/trunk/src/main/java/jp/sf/pal/todolist/action/user/TodoAction.java 2008-12-04 04:00:15 UTC (rev 1517) @@ -184,6 +184,32 @@ @Execute(validator = true, input = "edit.jsp") public String confirm() { + + // check date + if (!StringUtils.isEmpty(todoForm.startDateYear) + && !StringUtils.isEmpty(todoForm.startDateMonth) + && !StringUtils.isEmpty(todoForm.startDateDate) + && !StringUtils.isEmpty(todoForm.endDateYear) + && !StringUtils.isEmpty(todoForm.endDateMonth) + && !StringUtils.isEmpty(todoForm.endDateDate)) { + Date startDate = DateUtil.get(Integer + .parseInt(todoForm.startDateYear) - 1900, Integer + .parseInt(todoForm.startDateMonth) - 1, Integer + .parseInt(todoForm.startDateDate)); + Date endDate = DateUtil.get( + Integer.parseInt(todoForm.endDateYear) - 1900, Integer + .parseInt(todoForm.endDateMonth) - 1, Integer + .parseInt(todoForm.endDateDate)); + if (startDate.getTime() > endDate.getTime()) { + if (!StringUtils.isEmpty(todoForm.idForTodo)) { + todoMappingItems = todoService.getTodoMappingList(Long + .parseLong(todoForm.idForTodo), null); + } + throw new ActionMessagesException( + "errors.end_time_must_be_after_start_time"); + } + } + return "confirm.jsp"; } @@ -243,6 +269,31 @@ @Execute(validator = true, input = "edit.jsp") public String create() { + // check date + if (!StringUtils.isEmpty(todoForm.startDateYear) + && !StringUtils.isEmpty(todoForm.startDateMonth) + && !StringUtils.isEmpty(todoForm.startDateDate) + && !StringUtils.isEmpty(todoForm.endDateYear) + && !StringUtils.isEmpty(todoForm.endDateMonth) + && !StringUtils.isEmpty(todoForm.endDateDate)) { + Date startDate = DateUtil.get(Integer + .parseInt(todoForm.startDateYear) - 1900, Integer + .parseInt(todoForm.startDateMonth) - 1, Integer + .parseInt(todoForm.startDateDate)); + Date endDate = DateUtil.get( + Integer.parseInt(todoForm.endDateYear) - 1900, Integer + .parseInt(todoForm.endDateMonth) - 1, Integer + .parseInt(todoForm.endDateDate)); + if (startDate.getTime() > endDate.getTime()) { + if (!StringUtils.isEmpty(todoForm.idForTodo)) { + todoMappingItems = todoService.getTodoMappingList(Long + .parseLong(todoForm.idForTodo), null); + } + throw new ActionMessagesException( + "errors.end_time_must_be_after_start_time"); + } + } + try { Todo todo = createTodo(); todoService.store(todo); @@ -263,6 +314,31 @@ @Execute(validator = true, input = "edit.jsp") public String update() { + // check date + if (!StringUtils.isEmpty(todoForm.startDateYear) + && !StringUtils.isEmpty(todoForm.startDateMonth) + && !StringUtils.isEmpty(todoForm.startDateDate) + && !StringUtils.isEmpty(todoForm.endDateYear) + && !StringUtils.isEmpty(todoForm.endDateMonth) + && !StringUtils.isEmpty(todoForm.endDateDate)) { + Date startDate = DateUtil.get(Integer + .parseInt(todoForm.startDateYear) - 1900, Integer + .parseInt(todoForm.startDateMonth) - 1, Integer + .parseInt(todoForm.startDateDate)); + Date endDate = DateUtil.get( + Integer.parseInt(todoForm.endDateYear) - 1900, Integer + .parseInt(todoForm.endDateMonth) - 1, Integer + .parseInt(todoForm.endDateDate)); + if (startDate.getTime() > endDate.getTime()) { + if (!StringUtils.isEmpty(todoForm.idForTodo)) { + todoMappingItems = todoService.getTodoMappingList(Long + .parseLong(todoForm.idForTodo), null); + } + throw new ActionMessagesException( + "errors.end_time_must_be_after_start_time"); + } + } + try { Todo todo = createTodo(); todoService.store(todo); @@ -403,6 +479,13 @@ todo.setTodoMappingList(todoMappingList); } todoDxo.convertFromFormToTodo(todoForm, todo); + + if (todoForm.getStartDateForTodo() == null) { + todo.setStartDate(null); + } + if (todoForm.getEndDateForTodo() == null) { + todo.setEndDate(null); + } return todo; } Modified: todolist/trunk/src/main/resources/application.properties =================================================================== --- todolist/trunk/src/main/resources/application.properties 2008-12-04 02:30:06 UTC (rev 1516) +++ todolist/trunk/src/main/resources/application.properties 2008-12-04 04:00:15 UTC (rev 1517) @@ -63,6 +63,8 @@ errors.failed_to_delete_todo_mapping=Failed to remove the user. errors.user_already_exists_in_task=The user already exists in this task. +errors.end_time_must_be_after_start_time=Due date must be after Start date. + labels.tab.category=Category labels.tab.tasks=Tasks labels.name=Name @@ -77,7 +79,7 @@ labels.working=Working labels.completed=Completed labels.start_date=Start Date -labels.end_date=End Date +labels.end_date=Due Date labels.personal=Personal labels.category_id=Category ID labels.assigned=Assigned Modified: todolist/trunk/src/main/resources/application_ja.properties =================================================================== --- todolist/trunk/src/main/resources/application_ja.properties 2008-12-04 02:30:06 UTC (rev 1516) +++ todolist/trunk/src/main/resources/application_ja.properties 2008-12-04 04:00:15 UTC (rev 1517) @@ -56,6 +56,8 @@ errors.failed_to_delete_todo_mapping=\u30e6\u30fc\u30b6\u306e\u524a\u9664\u306b\u5931\u6557\u3057\u307e\u3057\u305f\u3002 errors.user_already_exists_in_task=\u305d\u306e\u30e6\u30fc\u30b6\u306f\u3059\u3067\u306b\u3053\u306e\u30bf\u30b9\u30af\u306b\u5b58\u5728\u3057\u307e\u3059\u3002 +errors.end_time_must_be_after_start_time=\u671f\u9650\u306f\u958b\u59cb\u65e5\u4ee5\u964d\u306b\u3057\u3066\u304f\u3060\u3055\u3044\u3002 + labels.tab.category=\u30ab\u30c6\u30b4\u30ea labels.tab.tasks=\u30bf\u30b9\u30af labels.name=\u540d\u524d @@ -70,7 +72,7 @@ labels.working=\u4f5c\u696d\u4e2d labels.completed=\u7d42\u4e86 labels.start_date=\u958b\u59cb\u65e5 -labels.end_date=\u7d42\u4e86\u65e5 +labels.end_date=\u671f\u65e5 labels.personal=\u500b\u4eba labels.category_id=\u30ab\u30c6\u30b4\u30eaID labels.assigned=\u5272\u308a\u5f53\u3066 From svnnotify ¡÷ sourceforge.jp Thu Dec 4 14:15:04 2008 From: svnnotify ¡÷ sourceforge.jp (svnnotify ¡÷ sourceforge.jp) Date: Thu, 04 Dec 2008 14:15:04 +0900 Subject: [pal-cvs 3783] [1518] validate folder name. Message-ID: <1228367704.285035.32451.nullmailer@users.sourceforge.jp> Revision: 1518 http://svn.sourceforge.jp/view?root=pal&view=rev&rev=1518 Author: shinsuke Date: 2008-12-04 14:15:03 +0900 (Thu, 04 Dec 2008) Log Message: ----------- validate folder name. Modified Paths: -------------- vfs-portlets/trunk/src/main/java/jp/sf/pal/vfs/action/NewfolderAction.java vfs-portlets/trunk/src/main/java/jp/sf/pal/vfs/form/NewfolderForm.java vfs-portlets/trunk/src/main/resources/application.properties vfs-portlets/trunk/src/main/resources/application_ja.properties -------------- next part -------------- Modified: vfs-portlets/trunk/src/main/java/jp/sf/pal/vfs/action/NewfolderAction.java =================================================================== --- vfs-portlets/trunk/src/main/java/jp/sf/pal/vfs/action/NewfolderAction.java 2008-12-04 04:00:15 UTC (rev 1517) +++ vfs-portlets/trunk/src/main/java/jp/sf/pal/vfs/action/NewfolderAction.java 2008-12-04 05:15:03 UTC (rev 1518) @@ -48,11 +48,20 @@ @Execute(validator = true, input = "edit.jsp") public String confirm() { + if (newfolderForm.name.indexOf("/") >= 0 + || newfolderForm.name.indexOf("\\") >= 0) { + throw new ActionMessagesException("errors.cannot_use_file_sepa"); + } return "confirm.jsp"; } @Execute(validator = true, input = "edit.jsp") public String create() { + if (newfolderForm.name.indexOf("/") >= 0 + || newfolderForm.name.indexOf("\\") >= 0) { + throw new ActionMessagesException("errors.cannot_use_file_sepa"); + } + String scope = VFSUtil.getScope(request); if (!VFSUtil.checkPath(scope, newfolderForm.uri, createPathParamMap())) { Modified: vfs-portlets/trunk/src/main/java/jp/sf/pal/vfs/form/NewfolderForm.java =================================================================== --- vfs-portlets/trunk/src/main/java/jp/sf/pal/vfs/form/NewfolderForm.java 2008-12-04 04:00:15 UTC (rev 1517) +++ vfs-portlets/trunk/src/main/java/jp/sf/pal/vfs/form/NewfolderForm.java 2008-12-04 05:15:03 UTC (rev 1518) @@ -5,6 +5,7 @@ import jp.sf.pal.vfs.VFSException; import jp.sf.pal.vfs.util.VFSUtil; +import org.seasar.struts.annotation.Maxbytelength; import org.seasar.struts.annotation.Required; public class NewfolderForm implements Serializable { @@ -15,6 +16,7 @@ public String uri; @Required + @Maxbytelength(maxbytelength = 255) public String name; public void initialize() { Modified: vfs-portlets/trunk/src/main/resources/application.properties =================================================================== --- vfs-portlets/trunk/src/main/resources/application.properties 2008-12-04 04:00:15 UTC (rev 1517) +++ vfs-portlets/trunk/src/main/resources/application.properties 2008-12-04 05:15:03 UTC (rev 1518) @@ -37,6 +37,8 @@ errors.failed_to_delete_file=Failed to delete the file. errors.unknow_object={0} is an unknown object. +errors.cannot_use_file_sepa=Cannot use '/' or '\\'. + success.update_config=Updated configuration. success.create_folder=Created a new folder. success.upload_file=Upload the file. Modified: vfs-portlets/trunk/src/main/resources/application_ja.properties =================================================================== --- vfs-portlets/trunk/src/main/resources/application_ja.properties 2008-12-04 04:00:15 UTC (rev 1517) +++ vfs-portlets/trunk/src/main/resources/application_ja.properties 2008-12-04 05:15:03 UTC (rev 1518) @@ -30,6 +30,8 @@ errors.failed_to_delete_file=\u30d5\u30a1\u30a4\u30eb\u306e\u524a\u9664\u306b\u5931\u6557\u3057\u307e\u3057\u305f\u3002 errors.unknow_object={0} \u306f\u672a\u77e5\u306e\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u3067\u3059\u3002 +errors.cannot_use_file_sepa=\u300c/\u300d\u307e\u305f\u306f\u300c\\\u300d\u306f\u5229\u7528\u3067\u304d\u307e\u305b\u3093\u3002 + success.update_config=\u8a2d\u5b9a\u3092\u66f4\u65b0\u3057\u307e\u3057\u305f\u3002 success.create_folder=\u65b0\u898f\u30d5\u30a9\u30eb\u30c0\u3092\u4f5c\u6210\u3057\u307e\u3057\u305f\u3002 success.upload_file=\u30d5\u30a1\u30a4\u30eb\u3092\u30a2\u30c3\u30d7\u30ed\u30fc\u30c9\u3057\u307e\u3057\u305f\u3002 From svnnotify ¡÷ sourceforge.jp Thu Dec 4 14:23:37 2008 From: svnnotify ¡÷ sourceforge.jp (svnnotify ¡÷ sourceforge.jp) Date: Thu, 04 Dec 2008 14:23:37 +0900 Subject: [pal-cvs 3784] [1519] hide path, updated ui, updated translation. Message-ID: <1228368217.104788.18996.nullmailer@users.sourceforge.jp> Revision: 1519 http://svn.sourceforge.jp/view?root=pal&view=rev&rev=1519 Author: shinsuke Date: 2008-12-04 14:23:37 +0900 (Thu, 04 Dec 2008) Log Message: ----------- hide path, updated ui, updated translation. Modified Paths: -------------- vfs-portlets/trunk/src/main/resources/application.properties vfs-portlets/trunk/src/main/resources/application_ja.properties vfs-portlets/trunk/src/main/webapp/WEB-INF/view/config/index.jsp vfs-portlets/trunk/src/main/webapp/WEB-INF/view/list/index.jsp vfs-portlets/trunk/src/main/webapp/WEB-INF/view/newfolder/confirm.jsp vfs-portlets/trunk/src/main/webapp/WEB-INF/view/newfolder/edit.jsp vfs-portlets/trunk/src/main/webapp/WEB-INF/view/upload/edit.jsp -------------- next part -------------- Modified: vfs-portlets/trunk/src/main/resources/application.properties =================================================================== --- vfs-portlets/trunk/src/main/resources/application.properties 2008-12-04 05:15:03 UTC (rev 1518) +++ vfs-portlets/trunk/src/main/resources/application.properties 2008-12-04 05:23:37 UTC (rev 1519) @@ -79,4 +79,6 @@ labels.create_folder=Create Folder labels.target_path=Target Path labels.uploaded_file=Uploaded File -labels.upload=Upload \ No newline at end of file +labels.upload=Upload + +labels.go_to_parent=.. (Go to Parent Folder) Modified: vfs-portlets/trunk/src/main/resources/application_ja.properties =================================================================== --- vfs-portlets/trunk/src/main/resources/application_ja.properties 2008-12-04 05:15:03 UTC (rev 1518) +++ vfs-portlets/trunk/src/main/resources/application_ja.properties 2008-12-04 05:23:37 UTC (rev 1519) @@ -72,4 +72,6 @@ labels.create_folder=\u30d5\u30a9\u30eb\u30c0\u306e\u4f5c\u6210 labels.target_path=\u5bfe\u8c61\u306e\u30d1\u30b9 labels.uploaded_file=\u5bfe\u8c61\u306e\u30d5\u30a1\u30a4\u30eb -labels.upload=\u30a2\u30c3\u30d7\u30ed\u30fc\u30c9 \ No newline at end of file +labels.upload=\u30a2\u30c3\u30d7\u30ed\u30fc\u30c9 + +labels.go_to_parent=.. (\u89aa\u30d5\u30a9\u30eb\u30c0\u3078\u79fb\u52d5) Modified: vfs-portlets/trunk/src/main/webapp/WEB-INF/view/config/index.jsp =================================================================== --- vfs-portlets/trunk/src/main/webapp/WEB-INF/view/config/index.jsp 2008-12-04 05:15:03 UTC (rev 1518) +++ vfs-portlets/trunk/src/main/webapp/WEB-INF/view/config/index.jsp 2008-12-04 05:23:37 UTC (rev 1519) @@ -40,19 +40,19 @@
- .. +
+ + Modified: vfs-portlets/trunk/src/main/webapp/WEB-INF/view/newfolder/edit.jsp =================================================================== --- vfs-portlets/trunk/src/main/webapp/WEB-INF/view/newfolder/edit.jsp 2008-12-04 05:15:03 UTC (rev 1518) +++ vfs-portlets/trunk/src/main/webapp/WEB-INF/view/newfolder/edit.jsp 2008-12-04 05:23:37 UTC (rev 1519) @@ -35,13 +35,15 @@
${f:h(uri)}
${f:h(name)}
+ + - + Modified: vfs-portlets/trunk/src/main/webapp/WEB-INF/view/upload/edit.jsp =================================================================== --- vfs-portlets/trunk/src/main/webapp/WEB-INF/view/upload/edit.jsp 2008-12-04 05:15:03 UTC (rev 1518) +++ vfs-portlets/trunk/src/main/webapp/WEB-INF/view/upload/edit.jsp 2008-12-04 05:23:37 UTC (rev 1519) @@ -35,10 +35,12 @@
${f:h(uri)}
+ + From svnnotify ¡÷ sourceforge.jp Thu Dec 4 14:44:25 2008 From: svnnotify ¡÷ sourceforge.jp (svnnotify ¡÷ sourceforge.jp) Date: Thu, 04 Dec 2008 14:44:25 +0900 Subject: [pal-cvs 3785] [1520] removedsrc/main/resources/log4j.properties Message-ID: <1228369465.955792.20052.nullmailer@users.sourceforge.jp> Revision: 1520 http://svn.sourceforge.jp/view?root=pal&view=rev&rev=1520 Author: shinsuke Date: 2008-12-04 14:44:25 +0900 (Thu, 04 Dec 2008) Log Message: ----------- removedsrc/main/resources/log4j.properties Modified Paths: -------------- bookmark/trunk/src/main/resources/env.txt bookmark/trunk/src/main/resources/jdbc.dicon bookmark/trunk/src/main/webapp/WEB-INF/web.xml Removed Paths: ------------- bookmark/trunk/src/main/resources/log4j.properties -------------- next part -------------- Modified: bookmark/trunk/src/main/resources/env.txt =================================================================== --- bookmark/trunk/src/main/resources/env.txt 2008-12-04 05:23:37 UTC (rev 1519) +++ bookmark/trunk/src/main/resources/env.txt 2008-12-04 05:44:25 UTC (rev 1520) @@ -1 +1 @@ -product +ct Modified: bookmark/trunk/src/main/resources/jdbc.dicon =================================================================== --- bookmark/trunk/src/main/resources/jdbc.dicon 2008-12-04 05:23:37 UTC (rev 1519) +++ bookmark/trunk/src/main/resources/jdbc.dicon 2008-12-04 05:44:25 UTC (rev 1520) @@ -40,7 +40,7 @@ "org.h2.Driver" - "jdbc:h2:file:" + container.getComponent(@java.lang.Class ¡÷ forName("javax.servlet.ServletContext")).getRealPath("/WEB-INF/db/bookmark") + "jdbc:h2:tcp://localhost:9092/userinfo" "sa" Deleted: bookmark/trunk/src/main/resources/log4j.properties =================================================================== --- bookmark/trunk/src/main/resources/log4j.properties 2008-12-04 05:23:37 UTC (rev 1519) +++ bookmark/trunk/src/main/resources/log4j.properties 2008-12-04 05:44:25 UTC (rev 1520) @@ -1,9 +0,0 @@ -log4j.rootCategory=DEBUG, bookmark - -log4j.appender.bookmark=org.apache.log4j.RollingFileAppender -log4j.appender.bookmark.MaxFileSize=100MB -log4j.appender.bookmark.MaxBackupIndex=5 -log4j.appender.bookmark.File=/tmp/bookmark.out -log4j.appender.bookmark.Append=false -log4j.appender.bookmark.layout=org.apache.log4j.PatternLayout -log4j.appender.bookmark.layout.ConversionPattern=%d{yyyy.MM.dd,HH:mm:ss,SSS},%F:%L,%p,%m%n Modified: bookmark/trunk/src/main/webapp/WEB-INF/web.xml =================================================================== --- bookmark/trunk/src/main/webapp/WEB-INF/web.xml 2008-12-04 05:23:37 UTC (rev 1519) +++ bookmark/trunk/src/main/webapp/WEB-INF/web.xml 2008-12-04 05:44:25 UTC (rev 1520) @@ -118,7 +118,7 @@ org.seasar.framework.container.servlet.S2ContainerServlet2 - MVC Servlet for Jetspeed Portlet Applications Jetspeed Container @@ -130,7 +130,7 @@ 0 - END: J2 --> + action *.do @@ -139,24 +139,24 @@ s2container /s2container - JetspeedContainer /container/* - END: J2 --> + index.html index.htm index.jsp - http://java.sun.com/portlet /WEB-INF/tld/portlet.tld - END: J2 --> + *.jsp false From svnnotify ¡÷ sourceforge.jp Thu Dec 4 14:48:00 2008 From: svnnotify ¡÷ sourceforge.jp (svnnotify ¡÷ sourceforge.jp) Date: Thu, 04 Dec 2008 14:48:00 +0900 Subject: [pal-cvs 3786] [1521] reverted.. Message-ID: <1228369680.166743.25992.nullmailer@users.sourceforge.jp> Revision: 1521 http://svn.sourceforge.jp/view?root=pal&view=rev&rev=1521 Author: shinsuke Date: 2008-12-04 14:48:00 +0900 (Thu, 04 Dec 2008) Log Message: ----------- reverted.. Modified Paths: -------------- bookmark/trunk/src/main/resources/env.txt bookmark/trunk/src/main/resources/jdbc.dicon bookmark/trunk/src/main/webapp/WEB-INF/web.xml -------------- next part -------------- Modified: bookmark/trunk/src/main/resources/env.txt =================================================================== --- bookmark/trunk/src/main/resources/env.txt 2008-12-04 05:44:25 UTC (rev 1520) +++ bookmark/trunk/src/main/resources/env.txt 2008-12-04 05:48:00 UTC (rev 1521) @@ -1 +1 @@ -ct +product Modified: bookmark/trunk/src/main/resources/jdbc.dicon =================================================================== --- bookmark/trunk/src/main/resources/jdbc.dicon 2008-12-04 05:44:25 UTC (rev 1520) +++ bookmark/trunk/src/main/resources/jdbc.dicon 2008-12-04 05:48:00 UTC (rev 1521) @@ -40,7 +40,7 @@ "org.h2.Driver" - "jdbc:h2:tcp://localhost:9092/userinfo" + "jdbc:h2:file:" + container.getComponent(@java.lang.Class ¡÷ forName("javax.servlet.ServletContext")).getRealPath("/WEB-INF/db/bookmark") "sa" Modified: bookmark/trunk/src/main/webapp/WEB-INF/web.xml =================================================================== --- bookmark/trunk/src/main/webapp/WEB-INF/web.xml 2008-12-04 05:44:25 UTC (rev 1520) +++ bookmark/trunk/src/main/webapp/WEB-INF/web.xml 2008-12-04 05:48:00 UTC (rev 1521) @@ -118,7 +118,7 @@ org.seasar.framework.container.servlet.S2ContainerServlet 2 - + + END: J2 --> action *.do @@ -139,24 +139,24 @@ s2container /s2container - + + END: J2 --> index.html index.htm index.jsp - + + END: J2 --> *.jsp false From svnnotify ¡÷ sourceforge.jp Thu Dec 4 17:25:20 2008 From: svnnotify ¡÷ sourceforge.jp (svnnotify ¡÷ sourceforge.jp) Date: Thu, 04 Dec 2008 17:25:20 +0900 Subject: [pal-cvs 3787] [1522] supported windows path. Message-ID: <1228379120.015049.21094.nullmailer@users.sourceforge.jp> Revision: 1522 http://svn.sourceforge.jp/view?root=pal&view=rev&rev=1522 Author: shinsuke Date: 2008-12-04 17:25:19 +0900 (Thu, 04 Dec 2008) Log Message: ----------- supported windows path. Modified Paths: -------------- vfs-portlets/trunk/src/main/java/jp/sf/pal/vfs/util/VFSUtil.java -------------- next part -------------- Modified: vfs-portlets/trunk/src/main/java/jp/sf/pal/vfs/util/VFSUtil.java =================================================================== --- vfs-portlets/trunk/src/main/java/jp/sf/pal/vfs/util/VFSUtil.java 2008-12-04 05:48:00 UTC (rev 1521) +++ vfs-portlets/trunk/src/main/java/jp/sf/pal/vfs/util/VFSUtil.java 2008-12-04 08:25:19 UTC (rev 1522) @@ -212,6 +212,10 @@ if (uri.length() > 1 && uri.endsWith("/")) { uri = uri.substring(0, uri.length() - 1); } + // if a path for windows + if (!uri.startsWith("/")) { + uri = uri + "/"; + } return uriPrefix + uri; } @@ -227,7 +231,11 @@ } if (uri.length() > 1) { - uri = uri.substring(0, uri.lastIndexOf("/")); + int lastIndex = uri.lastIndexOf("/"); + if (lastIndex < 0) { + return null; + } + uri = uri.substring(0, lastIndex); if (uri.length() > 1 && uri.endsWith("/")) { uri = uri.substring(0, uri.length() - 1); } From svnnotify ¡÷ sourceforge.jp Thu Dec 4 17:59:59 2008 From: svnnotify ¡÷ sourceforge.jp (svnnotify ¡÷ sourceforge.jp) Date: Thu, 04 Dec 2008 17:59:59 +0900 Subject: [pal-cvs 3788] [1523] close io stream, added isShowPath method. Message-ID: <1228381199.791071.444.nullmailer@users.sourceforge.jp> Revision: 1523 http://svn.sourceforge.jp/view?root=pal&view=rev&rev=1523 Author: shinsuke Date: 2008-12-04 17:59:59 +0900 (Thu, 04 Dec 2008) Log Message: ----------- close io stream, added isShowPath method. Modified Paths: -------------- vfs-portlets/trunk/src/main/java/jp/sf/pal/vfs/action/NewfolderAction.java vfs-portlets/trunk/src/main/java/jp/sf/pal/vfs/action/UploadAction.java -------------- next part -------------- Modified: vfs-portlets/trunk/src/main/java/jp/sf/pal/vfs/action/NewfolderAction.java =================================================================== --- vfs-portlets/trunk/src/main/java/jp/sf/pal/vfs/action/NewfolderAction.java 2008-12-04 08:25:19 UTC (rev 1522) +++ vfs-portlets/trunk/src/main/java/jp/sf/pal/vfs/action/NewfolderAction.java 2008-12-04 08:59:59 UTC (rev 1523) @@ -7,6 +7,7 @@ import javax.servlet.http.HttpServletRequest; import jp.sf.pal.vfs.VFSConstants; +import jp.sf.pal.vfs.common.util.ConfigUtil; import jp.sf.pal.vfs.common.util.SAStrutsUtil; import jp.sf.pal.vfs.form.NewfolderForm; import jp.sf.pal.vfs.util.VFSUtil; @@ -114,6 +115,11 @@ return map; } + public boolean isShowPath() { + return ConfigUtil.getBoolean(VFSUtil.getScope(request) + "." + + VFSConstants.SHOW_PATH); + } + public NewfolderForm getNewfolderForm() { return newfolderForm; } Modified: vfs-portlets/trunk/src/main/java/jp/sf/pal/vfs/action/UploadAction.java =================================================================== --- vfs-portlets/trunk/src/main/java/jp/sf/pal/vfs/action/UploadAction.java 2008-12-04 08:25:19 UTC (rev 1522) +++ vfs-portlets/trunk/src/main/java/jp/sf/pal/vfs/action/UploadAction.java 2008-12-04 08:59:59 UTC (rev 1523) @@ -1,5 +1,8 @@ package jp.sf.pal.vfs.action; +import java.io.IOException; +import java.io.InputStream; +import java.io.OutputStream; import java.io.Serializable; import java.util.HashMap; import java.util.Map; @@ -7,6 +10,7 @@ import javax.servlet.http.HttpServletRequest; import jp.sf.pal.vfs.VFSConstants; +import jp.sf.pal.vfs.common.util.ConfigUtil; import jp.sf.pal.vfs.common.util.SAStrutsUtil; import jp.sf.pal.vfs.form.UploadForm; import jp.sf.pal.vfs.util.VFSUtil; @@ -59,13 +63,15 @@ throw new ActionMessagesException("errors.access_denied"); } + // For Windows + String filename = uploadForm.uploadedFile.getFileName(); + if (log.isDebugEnabled()) { + log.debug("filename=" + filename); + } + + InputStream in = null; + OutputStream out = null; try { - // For Windows - String filename = uploadForm.uploadedFile.getFileName(); - if (log.isDebugEnabled()) { - log.debug("filename=" + filename); - } - FileSystemManager fsManager = VFSUtil.getFileSystemManager(); FileObject newFileObject = fsManager.resolveFile(uploadForm.uri + "/" + filename); @@ -77,8 +83,9 @@ // TODO should catch exception to check if it's created newFileObject.createFile(); newFileObject.getContent().close(); - VFSUtil.drain(uploadForm.uploadedFile.getInputStream(), - newFileObject.getContent().getOutputStream()); + in = uploadForm.uploadedFile.getInputStream(); + out = newFileObject.getContent().getOutputStream(); + VFSUtil.drain(in, out); // I18N SAStrutsUtil.addMessage(request, "success.upload_file"); @@ -88,6 +95,19 @@ // TODO I18N log.error("Failed to upload the file.", e); throw new ActionMessagesException("errors.failed_to_upload_file"); + } finally { + if (in != null) { + try { + in.close(); + } catch (IOException e) { + } + } + if (out != null) { + try { + out.close(); + } catch (IOException e) { + } + } } } @@ -105,6 +125,11 @@ return map; } + public boolean isShowPath() { + return ConfigUtil.getBoolean(VFSUtil.getScope(request) + "." + + VFSConstants.SHOW_PATH); + } + public UploadForm getUploadForm() { return uploadForm; } From svnnotify ¡÷ sourceforge.jp Sat Dec 6 09:08:15 2008 From: svnnotify ¡÷ sourceforge.jp (svnnotify ¡÷ sourceforge.jp) Date: Sat, 06 Dec 2008 09:08:15 +0900 Subject: [pal-cvs 3789] [1524] added css and js. Message-ID: <1228522095.658278.23648.nullmailer@users.sourceforge.jp> Revision: 1524 http://svn.sourceforge.jp/view?root=pal&view=rev&rev=1524 Author: shinsuke Date: 2008-12-06 09:08:15 +0900 (Sat, 06 Dec 2008) Log Message: ----------- added css and js. Added Paths: ----------- chat/trunk/src/main/webapp/css/ chat/trunk/src/main/webapp/css/pal-extension.css chat/trunk/src/main/webapp/js/ chat/trunk/src/main/webapp/js/jquery-1.2.6.min.js -------------- next part -------------- Added: chat/trunk/src/main/webapp/css/pal-extension.css =================================================================== --- chat/trunk/src/main/webapp/css/pal-extension.css (rev 0) +++ chat/trunk/src/main/webapp/css/pal-extension.css 2008-12-06 00:08:15 UTC (rev 1524) @@ -0,0 +1,216 @@ +/* +Copyright 2008 Portal Application Laboratory Project + +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. +*/ + +/* ---------------- */ +/* Form Table */ +/* ---------------- */ +.chat-portlet .form-table table { +border-top: 1px solid #cccccc; +border-left: 1px solid #cccccc; +border-collapse:collapse; +} + +.chat-portlet .form-table caption { +border-top: 1px solid #cccccc; +border-left: 1px solid #cccccc; +border-right: 1px solid #cccccc; +background-color: #e8e8e8; +padding:5px; +margin:0; +font-weight: bold; +font-size:11pt; +color:#003366; +} + +.chat-portlet .form-table thead { +margin:0; +padding:0; +} + +.chat-portlet .form-table tbody { +margin:0; +padding:0; +} + +.chat-portlet .form-table tfoot { +margin:0; +padding:0; +} + +.chat-portlet .form-table th { +border-right: 1px solid #cccccc; +border-bottom: 1px solid #cccccc; +padding: 5px; +text-align: center; +background-color: #eeeeee; +empty-cells: show; +} + +.chat-portlet .form-table td { +border-right: 1px solid #cccccc; +border-bottom: 1px solid #cccccc; +padding:3px; +empty-cells: show; +} + +.chat-portlet .form-table tfoot tr td { +padding:10px; +text-align: center; +empty-cells: show; +} + +/* ---------------- */ +/* List Table */ +/* ---------------- */ +.chat-portlet .list-table table { +border-top: 1px solid #cccccc; +border-left: 1px solid #cccccc; +border-collapse:collapse; +} + +.chat-portlet .list-table caption { +border-top: 1px solid #cccccc; +border-left: 1px solid #cccccc; +border-right: 1px solid #cccccc; +background-color: #e8e8e8; +padding:5px; +margin:0; +font-weight: bold; +font-size:11pt; +color:#003366; +} + +.chat-portlet .list-table thead { +margin:0; +padding:0; +} + +.chat-portlet .list-table tbody { +margin:0; +padding:0; +} + +.chat-portlet .list-table tfoot { +margin:0; +padding:0; +} + +.chat-portlet .list-table .row1 { +background-color: #ffffff; +} + +.chat-portlet .list-table .row2 { +background-color: #fffff8; +} + +.chat-portlet .list-table th { +border-right: 1px solid #cccccc; +border-bottom: 1px solid #cccccc; +padding: 5px; +text-align: center; +background-color: #eeeeee; +empty-cells: show; +} + +.chat-portlet .list-table td { +border-right: 1px solid #cccccc; +border-bottom: 1px solid #cccccc; +padding:3px; +empty-cells: show; +} + + +/* ---------------- */ +/* Tab */ +/* ---------------- */ +.chat-portlet .tab-nav div { +height:25px; +line-height:23px; +margin:0; +padding:0; +width:100%; +} + +.chat-portlet .tab-nav ul { +margin:0; +padding:0; +width:100%; +} + +.chat-portlet .tab-nav ul li { +float:left; +height:25px; +line-height:23px; +list-style-image:none; +list-style-position:outside; +list-style-type:none; +} + +.chat-portlet .tab-nav ul li a:visited { +color:#0000EE; +} + +.chat-portlet .tab-nav ul li.first { +border-bottom:1px solid #A9A9A9; +width:10px; +} + +.chat-portlet .tab-nav ul li.last-spacer { +border-bottom:1px solid #A9A9A9; +width:5px; +margin-right:-5px; +} + +.chat-portlet .tab-nav ul li.last { +border-bottom:1px solid #A9A9A9; +float:none; +padding-right:10px; +text-align:right; +} + +.chat-portlet .tab-nav ul li.selected { +border-color:#A9A9A9 #A9A9A9 #FFFFFF; +border-style:solid; +border-width:1px; +display:block; +margin:-1px; +_margin-top: 0px; +} + +.chat-portlet .tab-nav ul li.selected span { +display:inline; +padding:0 10px; +white-space:pre; +} + +.chat-portlet .tab-nav ul li.selectable { +background-color:#DCDCDC; +border:1px solid #A9A9A9; +display:block; +height:24px; +} + +.chat-portlet .tab-nav ul li.selectable { +display:inline; +padding:0 10px; +white-space:pre; +} + +.chat-portlet .tab-nav ul li.spacer { +border-bottom:1px solid #A9A9A9; +width:5px; +} + Property changes on: chat/trunk/src/main/webapp/css/pal-extension.css ___________________________________________________________________ Name: svn:eol-style + native Added: chat/trunk/src/main/webapp/js/jquery-1.2.6.min.js =================================================================== --- chat/trunk/src/main/webapp/js/jquery-1.2.6.min.js (rev 0) +++ chat/trunk/src/main/webapp/js/jquery-1.2.6.min.js 2008-12-06 00:08:15 UTC (rev 1524) @@ -0,0 +1,32 @@ +/* + * jQuery 1.2.6 - New Wave Javascript + * + * Copyright (c) 2008 John Resig (jquery.com) + * Dual licensed under the MIT (MIT-LICENSE.txt) + * and GPL (GPL-LICENSE.txt) licenses. + * + * $Date: 2008-05-24 14:22:17 -0400 (Sat, 24 May 2008) $ + * $Rev: 5685 $ + */ +(function(){var _jQuery=window.jQuery,_$=window.$;var jQuery=window.jQuery=window.$=function(selector,context){return new jQuery.fn.init(selector,context);};var quickExpr=/^[^<]*(<(.|\s)+>)[^>]*$|^#(\w+)$/,isSimple=/^.[^:#\[\.]*$/,undefined;jQuery.fn=jQuery.prototype={init:function(selector,context){selector=selector||document;if(selector.nodeType){this[0]=selector;this.length=1;return this;}if(typeof selector=="string"){var match=quickExpr.exec(selector);if(match&&(match[1]||!context)){if(match[1])selector=jQuery.clean([match[1]],context);else{var elem=document.getElementById(match[3]);if(elem){if(elem.id!=match[3])return jQuery().find(selector);return jQuery(elem);}selector=[];}}else +return jQuery(context).find(selector);}else if(jQuery.isFunction(selector))return jQuery(document)[jQuery.fn.ready?"ready":"load"](selector);return this.setArray(jQuery.makeArray(selector));},jquery:"1.2.6",size:function(){return this.length;},length:0,get:function(num){return num==undefined?jQuery.makeArray(this):this[num];},pushStack:function(elems){var ret=jQuery(elems);ret.prevObject=this;return ret;},setArray:function(elems){this.length=0;Array.prototype.push.apply(this,elems);return this;},each:function(callback,args){return jQuery.each(this,callback,args);},index:function(elem){var ret=-1;return jQuery.inArray(elem&&elem.jquery?elem[0]:elem,this);},attr:function(name,value,type){var options=name;if(name.constructor==String)if(value===undefined)return this[0]&&jQuery[type||"attr"](this[0],name);else{options={};options[name]=value;}return this.each(function(i){for(name in options)jQuery.attr(type?this.style:this,name,jQuery.prop(this,options[name],type,i,name));});},css:function(key,value){if((key=='width'||key=='height')&&parseFloat(value)<0)value=undefined;return this.attr(key,value,"curCSS");},text:function(text){if(typeof text!="object"&&text!=null)return this.empty().append((this[0]&&this[0].ownerDocument||document).createTextNode(text));var ret="";jQuery.each(text||this,function(){jQuery.each(this.childNodes,function(){if(this.nodeType!=8)ret+=this.nodeType!=1?this.nodeValue:jQuery.fn.text([this]);});});return ret;},wrapAll:function(html){if(this[0])jQuery(html,this[0].ownerDocument).clone().insertBefore(this[0]).map(function(){var elem=this;while(elem.firstChild)elem=elem.firstChild;return elem;}).append(this);return this;},wrapInner:function(html){return this.each(function(){jQuery(this).contents().wrapAll(html);});},wrap:function(html){return this.each(function(){jQuery(this).wrapAll(html);});},append:function(){return this.domManip(arguments,true,false,function(elem){if(this.nodeType==1)this.appendChild(elem);});},prepend:function(){return this.domManip(arguments,true,true,function(elem){if(this.nodeType==1)this.insertBefore(elem,this.firstChild);});},before:function(){return this.domManip(arguments,false,false,function(elem){this.parentNode.insertBefore(elem,this);});},after:function(){return this.domManip(arguments,false,true,function(elem){this.parentNode.insertBefore(elem,this.nextSibling);});},end:function(){return this.prevObject||jQuery([]);},find:function(selector){var elems=jQuery.map(this,function(elem){return jQuery.find(selector,elem);});return this.pushStack(/[^+>] [^+>]/.test(selector)||selector.indexOf("..")>-1?jQuery.unique(elems):elems);},clone:function(events){var ret=this.map(function(){if(jQuery.browser.msie&&!jQuery.isXMLDoc(this)){var clone=this.cloneNode(true),container=document.createElement("div");container.appendChild(clone);return jQuery.clean([container.innerHTML])[0];}else +return this.cloneNode(true);});var clone=ret.find("*").andSelf().each(function(){if(this[expando]!=undefined)this[expando]=null;});if(events===true)this.find("*").andSelf().each(function(i){if(this.nodeType==3)return;var events=jQuery.data(this,"events");for(var type in events)for(var handler in events[type])jQuery.event.add(clone[i],type,events[type][handler],events[type][handler].data);});return ret;},filter:function(selector){return this.pushStack(jQuery.isFunction(selector)&&jQuery.grep(this,function(elem,i){return selector.call(elem,i);})||jQuery.multiFilter(selector,this));},not:function(selector){if(selector.constructor==String)if(isSimple.test(selector))return this.pushStack(jQuery.multiFilter(selector,this,true));else +selector=jQuery.multiFilter(selector,this);var isArrayLike=selector.length&&selector[selector.length-1]!==undefined&&!selector.nodeType;return this.filter(function(){return isArrayLike?jQuery.inArray(this,selector)<0:this!=selector;});},add:function(selector){return this.pushStack(jQuery.unique(jQuery.merge(this.get(),typeof selector=='string'?jQuery(selector):jQuery.makeArray(selector))));},is:function(selector){return!!selector&&jQuery.multiFilter(selector,this).length>0;},hasClass:function(selector){return this.is("."+selector);},val:function(value){if(value==undefined){if(this.length){var elem=this[0];if(jQuery.nodeName(elem,"select")){var index=elem.selectedIndex,values=[],options=elem.options,one=elem.type=="select-one";if(index<0)return null;for(var i=one?index:0,max=one?index+1:options.length;i=0||jQuery.inArray(this.name,value)>=0);else if(jQuery.nodeName(this,"select")){var values=jQuery.makeArray(value);jQuery("option",this).each(function(){this.selected=(jQuery.inArray(this.value,values)>=0||jQuery.inArray(this.text,values)>=0);});if(!values.length)this.selectedIndex=-1;}else +this.value=value;});},html:function(value){return value==undefined?(this[0]?this[0].innerHTML:null):this.empty().append(value);},replaceWith:function(value){return this.after(value).remove();},eq:function(i){return this.slice(i,i+1);},slice:function(){return this.pushStack(Array.prototype.slice.apply(this,arguments));},map:function(callback){return this.pushStack(jQuery.map(this,function(elem,i){return callback.call(elem,i,elem);}));},andSelf:function(){return this.add(this.prevObject);},data:function(key,value){var parts=key.split(".");parts[1]=parts[1]?"."+parts[1]:"";if(value===undefined){var data=this.triggerHandler("getData"+parts[1]+"!",[parts[0]]);if(data===undefined&&this.length)data=jQuery.data(this[0],key);return data===undefined&&parts[1]?this.data(parts[0]):data;}else +return this.trigger("setData"+parts[1]+"!",[parts[0],value]).each(function(){jQuery.data(this,key,value);});},removeData:function(key){return this.each(function(){jQuery.removeData(this,key);});},domManip:function(args,table,reverse,callback){var clone=this.length>1,elems;return this.each(function(){if(!elems){elems=jQuery.clean(args,this.ownerDocument);if(reverse)elems.reverse();}var obj=this;if(table&&jQuery.nodeName(this,"table")&&jQuery.nodeName(elems[0],"tr"))obj=this.getElementsByTagName("tbody")[0]||this.appendChild(this.ownerDocument.createElement("tbody"));var scripts=jQuery([]);jQuery.each(elems,function(){var elem=clone?jQuery(this).clone(true)[0]:this;if(jQuery.nodeName(elem,"script"))scripts=scripts.add(elem);else{if(elem.nodeType==1)scripts=scripts.add(jQuery("script",elem).remove());callback.call(obj,elem);}});scripts.each(evalScript);});}};jQuery.fn.init.prototype=jQuery.fn;function evalScript(i,elem){if(elem.src)jQuery.ajax({url:elem.src,async:false,dataType:"script"});else +jQuery.globalEval(elem.text||elem.textContent||elem.innerHTML||"");if(elem.parentNode)elem.parentNode.removeChild(elem);}function now(){return+new Date;}jQuery.extend=jQuery.fn.extend=function(){var target=arguments[0]||{},i=1,length=arguments.length,deep=false,options;if(target.constructor==Boolean){deep=target;target=arguments[1]||{};i=2;}if(typeof target!="object"&&typeof target!="function")target={};if(length==i){target=this;--i;}for(;i-1;}},swap:function(elem,options,callback){var old={};for(var name in options){old[name]=elem.style[name];elem.style[name]=options[name];}callback.call(elem);for(var name in options)elem.style[name]=old[name];},css:function(elem,name,force){if(name=="width"||name=="height"){var val,props={position:"absolute",visibility:"hidden",display:"block"},which=name=="width"?["Left","Right"]:["Top","Bottom"];function getWH(){val=name=="width"?elem.offsetWidth:elem.offsetHeight;var padding=0,border=0;jQuery.each(which,function(){padding+=parseFloat(jQuery.curCSS(elem,"padding"+this,true))||0;border+=parseFloat(jQuery.curCSS(elem,"border"+this+"Width",true))||0;});val-=Math.round(padding+border);}if(jQuery(elem).is(":visible"))getWH();else +jQuery.swap(elem,props,getWH);return Math.max(0,val);}return jQuery.curCSS(elem,name,force);},curCSS:function(elem,name,force){var ret,style=elem.style;function color(elem){if(!jQuery.browser.safari)return false;var ret=defaultView.getComputedStyle(elem,null);return!ret||ret.getPropertyValue("color")=="";}if(name=="opacity"&&jQuery.browser.msie){ret=jQuery.attr(style,"opacity");return ret==""?"1":ret;}if(jQuery.browser.opera&&name=="display"){var save=style.outline;style.outline="0 solid black";style.outline=save;}if(name.match(/float/i))name=styleFloat;if(!force&&style&&style[name])ret=style[name];else if(defaultView.getComputedStyle){if(name.match(/float/i))name="float";name=name.replace(/([A-Z])/g,"-$1").toLowerCase();var computedStyle=defaultView.getComputedStyle(elem,null);if(computedStyle&&!color(elem))ret=computedStyle.getPropertyValue(name);else{var swap=[],stack=[],a=elem,i=0;for(;a&&color(a);a=a.parentNode)stack.unshift(a);for(;i]*?)\/>/g,function(all,front,tag){return tag.match(/^(abbr|br|col|img|input|link|meta|param|hr|area|embed)$/i)?all:front+">";});var tags=jQuery.trim(elem).toLowerCase(),div=context.createElement("div");var wrap=!tags.indexOf("",""]||!tags.indexOf("",""]||tags.match(/^<(thead|tbody|tfoot|colg|cap)/)&&[1,"
${f:h(uri)}
","
"]||!tags.indexOf("
"]||(!tags.indexOf("
"]||!tags.indexOf("
"]||jQuery.browser.msie&&[1,"div
","
"]||[0,"",""];div.innerHTML=wrap[1]+elem+wrap[2];while(wrap[0]--)div=div.lastChild;if(jQuery.browser.msie){var tbody=!tags.indexOf(""&&tags.indexOf("=0;--j)if(jQuery.nodeName(tbody[j],"tbody")&&!tbody[j].childNodes.length)tbody[j].parentNode.removeChild(tbody[j]);if(/^\s/.test(elem))div.insertBefore(context.createTextNode(elem.match(/^\s*/)[0]),div.firstChild);}elem=jQuery.makeArray(div.childNodes);}if(elem.length===0&&(!jQuery.nodeName(elem,"form")&&!jQuery.nodeName(elem,"select")))return;if(elem[0]==undefined||jQuery.nodeName(elem,"form")||elem.options)ret.push(elem);else +ret=jQuery.merge(ret,elem);});return ret;},attr:function(elem,name,value){if(!elem||elem.nodeType==3||elem.nodeType==8)return undefined;var notxml=!jQuery.isXMLDoc(elem),set=value!==undefined,msie=jQuery.browser.msie;name=notxml&&jQuery.props[name]||name;if(elem.tagName){var special=/href|src|style/.test(name);if(name=="selected"&&jQuery.browser.safari)elem.parentNode.selectedIndex;if(name in elem&¬xml&&!special){if(set){if(name=="type"&&jQuery.nodeName(elem,"input")&&elem.parentNode)throw"type property can't be changed";elem[name]=value;}if(jQuery.nodeName(elem,"form")&&elem.getAttributeNode(name))return elem.getAttributeNode(name).nodeValue;return elem[name];}if(msie&¬xml&&name=="style")return jQuery.attr(elem.style,"cssText",value);if(set)elem.setAttribute(name,""+value);var attr=msie&¬xml&&special?elem.getAttribute(name,2):elem.getAttribute(name);return attr===null?undefined:attr;}if(msie&&name=="opacity"){if(set){elem.zoom=1;elem.filter=(elem.filter||"").replace(/alpha\([^)]*\)/,"")+(parseInt(value)+''=="NaN"?"":"alpha(opacity="+value*100+")");}return elem.filter&&elem.filter.indexOf("opacity=")>=0?(parseFloat(elem.filter.match(/opacity=([^)]*)/)[1])/100)+'':"";}name=name.replace(/-([a-z])/ig,function(all,letter){return letter.toUpperCase();});if(set)elem[name]=value;return elem[name];},trim:function(text){return(text||"").replace(/^\s+|\s+$/g,"");},makeArray:function(array){var ret=[];if(array!=null){var i=array.length;if(i==null||array.split||array.setInterval||array.call)ret[0]=array;else +while(i)ret[--i]=array[i];}return ret;},inArray:function(elem,array){for(var i=0,length=array.length;i*",this).remove();while(this.firstChild)this.removeChild(this.firstChild);}},function(name,fn){jQuery.fn[name]=function(){return this.each(fn,arguments);};});jQuery.each(["Height","Width"],function(i,name){var type=name.toLowerCase();jQuery.fn[type]=function(size){return this[0]==window?jQuery.browser.opera&&document.body["client"+name]||jQuery.browser.safari&&window["inner"+name]||document.compatMode=="CSS1Compat"&&document.documentElement["client"+name]||document.body["client"+name]:this[0]==document?Math.max(Math.max(document.body["scroll"+name],document.documentElement["scroll"+name]),Math.max(document.body["offset"+name],document.documentElement["offset"+name])):size==undefined?(this.length?jQuery.css(this[0],type):null):this.css(type,size.constructor==String?size:size+"px");};});function num(elem,prop){return elem[0]&&parseInt(jQuery.curCSS(elem[0],prop,true),10)||0;}var chars=jQuery.browser.safari&&parseInt(jQuery.browser.version)<417?"(?:[\\w*_-]|\\\\.)":"(?:[\\w\u0128-\uFFFF*_-]|\\\\.)",quickChild=new RegExp("^>\\s*("+chars+"+)"),quickID=new RegExp("^("+chars+"+)(#)("+chars+"+)"),quickClass=new RegExp("^([#.]?)("+chars+"*)");jQuery.extend({expr:{"":function(a,i,m){return m[2]=="*"||jQuery.nodeName(a,m[2]);},"#":function(a,i,m){return a.getAttribute("id")==m[2];},":":{lt:function(a,i,m){return im[3]-0;},nth:function(a,i,m){return m[3]-0==i;},eq:function(a,i,m){return m[3]-0==i;},first:function(a,i){return i==0;},last:function(a,i,m,r){return i==r.length-1;},even:function(a,i){return i%2==0;},odd:function(a,i){return i%2;},"first-child":function(a){return a.parentNode.getElementsByTagName("*")[0]==a;},"last-child":function(a){return jQuery.nth(a.parentNode.lastChild,1,"previousSibling")==a;},"only-child":function(a){return!jQuery.nth(a.parentNode.lastChild,2,"previousSibling");},parent:function(a){return a.firstChild;},empty:function(a){return!a.firstChild;},contains:function(a,i,m){return(a.textContent||a.innerText||jQuery(a).text()||"").indexOf(m[3])>=0;},visible:function(a){return"hidden"!=a.type&&jQuery.css(a,"display")!="none"&&jQuery.css(a,"visibility")!="hidden";},hidden:function(a){return"hidden"==a.type||jQuery.css(a,"display")=="none"||jQuery.css(a,"visibility")=="hidden";},enabled:function(a){return!a.disabled;},disabled:function(a){return a.disabled;},checked:function(a){return a.checked;},selected:function(a){return a.selected||jQuery.attr(a,"selected");},text:function(a){return"text"==a.type;},radio:function(a){return"radio"==a.type;},checkbox:function(a){return"checkbox"==a.type;},file:function(a){return"file"==a.type;},password:function(a){return"password"==a.type;},submit:function(a){return"submit"==a.type;},image:function(a){return"image"==a.type;},reset:function(a){return"reset"==a.type;},button:function(a){return"button"==a.type||jQuery.nodeName(a,"button");},input:function(a){return/input|select|textarea|button/i.test(a.nodeName);},has:function(a,i,m){return jQuery.find(m[3],a).length;},header:function(a){return/h\d/i.test(a.nodeName);},animated:function(a){return jQuery.grep(jQuery.timers,function(fn){return a==fn.elem;}).length;}}},parse:[/^(\[) *@?([\w-]+) *([!*$^~=]*) *('?"?)(.*?)\4 *\]/,/^(:)([\w-]+)\("?'?(.*?(\(.*?\))?[^(]*?)"?'?\)/,new RegExp("^([:.#]*)("+chars+"+)")],multiFilter:function(expr,elems,not){var old,cur=[];while(expr&&expr!=old){old=expr;var f=jQuery.filter(expr,elems,not);expr=f.t.replace(/^\s*,\s*/,"");cur=not?elems=f.r:jQuery.merge(cur,f.r);}return cur;},find:function(t,context){if(typeof t!="string")return[t];if(context&&context.nodeType!=1&&context.nodeType!=9)return[];context=context||document;var ret=[context],done=[],last,nodeName;while(t&&last!=t){var r=[];last=t;t=jQuery.trim(t);var foundToken=false,re=quickChild,m=re.exec(t);if(m){nodeName=m[1].toUpperCase();for(var i=0;ret[i];i++)for(var c=ret[i].firstChild;c;c=c.nextSibling)if(c.nodeType==1&&(nodeName=="*"||c.nodeName.toUpperCase()==nodeName))r.push(c);ret=r;t=t.replace(re,"");if(t.indexOf(" ")==0)continue;foundToken=true;}else{re=/^([>+~])\s*(\w*)/i;if((m=re.exec(t))!=null){r=[];var merge={};nodeName=m[2].toUpperCase();m=m[1];for(var j=0,rl=ret.length;j=0;if(!not&&pass||not&&!pass)tmp.push(r[i]);}return tmp;},filter:function(t,r,not){var last;while(t&&t!=last){last=t;var p=jQuery.parse,m;for(var i=0;p[i];i++){m=p[i].exec(t);if(m){t=t.substring(m[0].length);m[2]=m[2].replace(/\\/g,"");break;}}if(!m)break;if(m[1]==":"&&m[2]=="not")r=isSimple.test(m[3])?jQuery.filter(m[3],r,true).r:jQuery(r).not(m[3]);else if(m[1]==".")r=jQuery.classFilter(r,m[2],not);else if(m[1]=="["){var tmp=[],type=m[3];for(var i=0,rl=r.length;i=0)^not)tmp.push(a);}r=tmp;}else if(m[1]==":"&&m[2]=="nth-child"){var merge={},tmp=[],test=/(-?)(\d*)n((?:\+|-)?\d*)/.exec(m[3]=="even"&&"2n"||m[3]=="odd"&&"2n+1"||!/\D/.test(m[3])&&"0n+"+m[3]||m[3]),first=(test[1]+(test[2]||1))-0,last=test[3]-0;for(var i=0,rl=r.length;i=0)add=true;if(add^not)tmp.push(node);}r=tmp;}else{var fn=jQuery.expr[m[1]];if(typeof fn=="object")fn=fn[m[2]];if(typeof fn=="string")fn=eval("false||function(a,i){return "+fn+";}");r=jQuery.grep(r,function(elem,i){return fn(elem,i,m,r);},not);}}return{r:r,t:t};},dir:function(elem,dir){var matched=[],cur=elem[dir];while(cur&&cur!=document){if(cur.nodeType==1)matched.push(cur);cur=cur[dir];}return matched;},nth:function(cur,result,dir,elem){result=result||1;var num=0;for(;cur;cur=cur[dir])if(cur.nodeType==1&&++num==result)break;return cur;},sibling:function(n,elem){var r=[];for(;n;n=n.nextSibling){if(n.nodeType==1&&n!=elem)r.push(n);}return r;}});jQuery.event={add:function(elem,types,handler,data){if(elem.nodeType==3||elem.nodeType==8)return;if(jQuery.browser.msie&&elem.setInterval)elem=window;if(!handler.guid)handler.guid=this.guid++;if(data!=undefined){var fn=handler;handler=this.proxy(fn,function(){return fn.apply(this,arguments);});handler.data=data;}var events=jQuery.data(elem,"events")||jQuery.data(elem,"events",{}),handle=jQuery.data(elem,"handle")||jQuery.data(elem,"handle",function(){if(typeof jQuery!="undefined"&&!jQuery.event.triggered)return jQuery.event.handle.apply(arguments.callee.elem,arguments);});handle.elem=elem;jQuery.each(types.split(/\s+/),function(index,type){var parts=type.split(".");type=parts[0];handler.type=parts[1];var handlers=events[type];if(!handlers){handlers=events[type]={};if(!jQuery.event.special[type]||jQuery.event.special[type].setup.call(elem)===false){if(elem.addEventListener)elem.addEventListener(type,handle,false);else if(elem.attachEvent)elem.attachEvent("on"+type,handle);}}handlers[handler.guid]=handler;jQuery.event.global[type]=true;});elem=null;},guid:1,global:{},remove:function(elem,types,handler){if(elem.nodeType==3||elem.nodeType==8)return;var events=jQuery.data(elem,"events"),ret,index;if(events){if(types==undefined||(typeof types=="string"&&types.charAt(0)=="."))for(var type in events)this.remove(elem,type+(types||""));else{if(types.type){handler=types.handler;types=types.type;}jQuery.each(types.split(/\s+/),function(index,type){var parts=type.split(".");type=parts[0];if(events[type]){if(handler)delete events[type][handler.guid];else +for(handler in events[type])if(!parts[1]||events[type][handler].type==parts[1])delete events[type][handler];for(ret in events[type])break;if(!ret){if(!jQuery.event.special[type]||jQuery.event.special[type].teardown.call(elem)===false){if(elem.removeEventListener)elem.removeEventListener(type,jQuery.data(elem,"handle"),false);else if(elem.detachEvent)elem.detachEvent("on"+type,jQuery.data(elem,"handle"));}ret=null;delete events[type];}}});}for(ret in events)break;if(!ret){var handle=jQuery.data(elem,"handle");if(handle)handle.elem=null;jQuery.removeData(elem,"events");jQuery.removeData(elem,"handle");}}},trigger:function(type,data,elem,donative,extra){data=jQuery.makeArray(data);if(type.indexOf("!")>=0){type=type.slice(0,-1);var exclusive=true;}if(!elem){if(this.global[type])jQuery("*").add([window,document]).trigger(type,data);}else{if(elem.nodeType==3||elem.nodeType==8)return undefined;var val,ret,fn=jQuery.isFunction(elem[type]||null),event=!data[0]||!data[0].preventDefault;if(event){data.unshift({type:type,target:elem,preventDefault:function(){},stopPropagation:function(){},timeStamp:now()});data[0][expando]=true;}data[0].type=type;if(exclusive)data[0].exclusive=true;var handle=jQuery.data(elem,"handle");if(handle)val=handle.apply(elem,data);if((!fn||(jQuery.nodeName(elem,'a')&&type=="click"))&&elem["on"+type]&&elem["on"+type].apply(elem,data)===false)val=false;if(event)data.shift();if(extra&&jQuery.isFunction(extra)){ret=extra.apply(elem,val==null?data:data.concat(val));if(ret!==undefined)val=ret;}if(fn&&donative!==false&&val!==false&&!(jQuery.nodeName(elem,'a')&&type=="click")){this.triggered=true;try{elem[type]();}catch(e){}}this.triggered=false;}return val;},handle:function(event){var val,ret,namespace,all,handlers;event=arguments[0]=jQuery.event.fix(event||window.event);namespace=event.type.split(".");event.type=namespace[0];namespace=namespace[1];all=!namespace&&!event.exclusive;handlers=(jQuery.data(this,"events")||{})[event.type];for(var j in handlers){var handler=handlers[j];if(all||handler.type==namespace){event.handler=handler;event.data=handler.data;ret=handler.apply(this,arguments);if(val!==false)val=ret;if(ret===false){event.preventDefault();event.stopPropagation();}}}return val;},fix:function(event){if(event[expando]==true)return event;var originalEvent=event;event={originalEvent:originalEvent};var props="altKey attrChange attrName bubbles button cancelable charCode clientX clientY ctrlKey currentTarget data detail eventPhase fromElement handler keyCode metaKey newValue originalTarget pageX pageY prevValue relatedNode relatedTarget screenX screenY shiftKey srcElement target timeStamp toElement type view wheelDelta which".split(" ");for(var i=props.length;i;i--)event[props[i]]=originalEvent[props[i]];event[expando]=true;event.preventDefault=function(){if(originalEvent.preventDefault)originalEvent.preventDefault();originalEvent.returnValue=false;};event.stopPropagation=function(){if(originalEvent.stopPropagation)originalEvent.stopPropagation();originalEvent.cancelBubble=true;};event.timeStamp=event.timeStamp||now();if(!event.target)event.target=event.srcElement||document;if(event.target.nodeType==3)event.target=event.target.parentNode;if(!event.relatedTarget&&event.fromElement)event.relatedTarget=event.fromElement==event.target?event.toElement:event.fromElement;if(event.pageX==null&&event.clientX!=null){var doc=document.documentElement,body=document.body;event.pageX=event.clientX+(doc&&doc.scrollLeft||body&&body.scrollLeft||0)-(doc.clientLeft||0);event.pageY=event.clientY+(doc&&doc.scrollTop||body&&body.scrollTop||0)-(doc.clientTop||0);}if(!event.which&&((event.charCode||event.charCode===0)?event.charCode:event.keyCode))event.which=event.charCode||event.keyCode;if(!event.metaKey&&event.ctrlKey)event.metaKey=event.ctrlKey;if(!event.which&&event.button)event.which=(event.button&1?1:(event.button&2?3:(event.button&4?2:0)));return event;},proxy:function(fn,proxy){proxy.guid=fn.guid=fn.guid||proxy.guid||this.guid++;return proxy;},special:{ready:{setup:function(){bindReady();return;},teardown:function(){return;}},mouseenter:{setup:function(){if(jQuery.browser.msie)return false;jQuery(this).bind("mouseover",jQuery.event.special.mouseenter.handler);return true;},teardown:function(){if(jQuery.browser.msie)return false;jQuery(this).unbind("mouseover",jQuery.event.special.mouseenter.handler);return true;},handler:function(event){if(withinElement(event,this))return true;event.type="mouseenter";return jQuery.event.handle.apply(this,arguments);}},mouseleave:{setup:function(){if(jQuery.browser.msie)return false;jQuery(this).bind("mouseout",jQuery.event.special.mouseleave.handler);return true;},teardown:function(){if(jQuery.browser.msie)return false;jQuery(this).unbind("mouseout",jQuery.event.special.mouseleave.handler);return true;},handler:function(event){if(withinElement(event,this))return true;event.type="mouseleave";return jQuery.event.handle.apply(this,arguments);}}}};jQuery.fn.extend({bind:function(type,data,fn){return type=="unload"?this.one(type,data,fn):this.each(function(){jQuery.event.add(this,type,fn||data,fn&&data);});},one:function(type,data,fn){var one=jQuery.event.proxy(fn||data,function(event){jQuery(this).unbind(event,one);return(fn||data).apply(this,arguments);});return this.each(function(){jQuery.event.add(this,type,one,fn&&data);});},unbind:function(type,fn){return this.each(function(){jQuery.event.remove(this,type,fn);});},trigger:function(type,data,fn){return this.each(function(){jQuery.event.trigger(type,data,this,true,fn);});},triggerHandler:function(type,data,fn){return this[0]&&jQuery.event.trigger(type,data,this[0],false,fn);},toggle:function(fn){var args=arguments,i=1;while(i=0){var selector=url.slice(off,url.length);url=url.slice(0,off);}callback=callback||function(){};var type="GET";if(params)if(jQuery.isFunction(params)){callback=params;params=null;}else{params=jQuery.param(params);type="POST";}var self=this;jQuery.ajax({url:url,type:type,dataType:"html",data:params,complete:function(res,status){if(status=="success"||status=="notmodified")self.html(selector?jQuery("
").append(res.responseText.replace(//g,"")).find(selector):res.responseText);self.each(callback,[res.responseText,status,res]);}});return this;},serialize:function(){return jQuery.param(this.serializeArray());},serializeArray:function(){return this.map(function(){return jQuery.nodeName(this,"form")?jQuery.makeArray(this.elements):this;}).filter(function(){return this.name&&!this.disabled&&(this.checked||/select|textarea/i.test(this.nodeName)||/text|hidden|password/i.test(this.type));}).map(function(i,elem){var val=jQuery(this).val();return val==null?null:val.constructor==Array?jQuery.map(val,function(val,i){return{name:elem.name,value:val};}):{name:elem.name,value:val};}).get();}});jQuery.each("ajaxStart,ajaxStop,ajaxComplete,ajaxError,ajaxSuccess,ajaxSend".split(","),function(i,o){jQuery.fn[o]=function(f){return this.bind(o,f);};});var jsc=now();jQuery.extend({get:function(url,data,callback,type){if(jQuery.isFunction(data)){callback=data;data=null;}return jQuery.ajax({type:"GET",url:url,data:data,success:callback,dataType:type});},getScript:function(url,callback){return jQuery.get(url,null,callback,"script");},getJSON:function(url,data,callback){return jQuery.get(url,data,callback,"json");},post:function(url,data,callback,type){if(jQuery.isFunction(data)){callback=data;data={};}return jQuery.ajax({type:"POST",url:url,data:data,success:callback,dataType:type});},ajaxSetup:function(settings){jQuery.extend(jQuery.ajaxSettings,settings);},ajaxSettings:{url:location.href,global:true,type:"GET",timeout:0,contentType:"application/x-www-form-urlencoded",processData:true,async:true,data:null,username:null,password:null,accepts:{xml:"application/xml, text/xml",html:"text/html",script:"text/javascript, application/javascript",json:"application/json, text/javascript",text:"text/plain",_default:"*/*"}},lastModified:{},ajax:function(s){s=jQuery.extend(true,s,jQuery.extend(true,{},jQuery.ajaxSettings,s));var jsonp,jsre=/=\?(&|$)/g,status,data,type=s.type.toUpperCase();if(s.data&&s.processData&&typeof s.data!="string")s.data=jQuery.param(s.data);if(s.dataType=="jsonp"){if(type=="GET"){if(!s.url.match(jsre))s.url+=(s.url.match(/\?/)?"&":"?")+(s.jsonp||"callback")+"=?";}else if(!s.data||!s.data.match(jsre))s.data=(s.data?s.data+"&":"")+(s.jsonp||"callback")+"=?";s.dataType="json";}if(s.dataType=="json"&&(s.data&&s.data.match(jsre)||s.url.match(jsre))){jsonp="jsonp"+jsc++;if(s.data)s.data=(s.data+"").replace(jsre,"="+jsonp+"$1");s.url=s.url.replace(jsre,"="+jsonp+"$1");s.dataType="script";window[jsonp]=function(tmp){data=tmp;success();complete();window[jsonp]=undefined;try{delete window[jsonp];}catch(e){}if(head)head.removeChild(script);};}if(s.dataType=="script"&&s.cache==null)s.cache=false;if(s.cache===false&&type=="GET"){var ts=now();var ret=s.url.replace(/(\?|&)_=.*?(&|$)/,"$1_="+ts+"$2");s.url=ret+((ret==s.url)?(s.url.match(/\?/)?"&":"?")+"_="+ts:"");}if(s.data&&type=="GET"){s.url+=(s.url.match(/\?/)?"&":"?")+s.data;s.data=null;}if(s.global&&!jQuery.active++)jQuery.event.trigger("ajaxStart");var remote=/^(?:\w+:)?\/\/([^\/?#]+)/;if(s.dataType=="script"&&type=="GET"&&remote.test(s.url)&&remote.exec(s.url)[1]!=location.host){var head=document.getElementsByTagName("head")[0];var script=document.createElement("script");script.src=s.url;if(s.scriptCharset)script.charset=s.scriptCharset;if(!jsonp){var done=false;script.onload=script.onreadystatechange=function(){if(!done&&(!this.readyState||this.readyState=="loaded"||this.readyState=="complete")){done=true;success();complete();head.removeChild(script);}};}head.appendChild(script);return undefined;}var requestDone=false;var xhr=window.ActiveXObject?new ActiveXObject("Microsoft.XMLHTTP"):new XMLHttpRequest();if(s.username)xhr.open(type,s.url,s.async,s.username,s.password);else +xhr.open(type,s.url,s.async);try{if(s.data)xhr.setRequestHeader("Content-Type",s.contentType);if(s.ifModified)xhr.setRequestHeader("If-Modified-Since",jQuery.lastModified[s.url]||"Thu, 01 Jan 1970 00:00:00 GMT");xhr.setRequestHeader("X-Requested-With","XMLHttpRequest");xhr.setRequestHeader("Accept",s.dataType&&s.accepts[s.dataType]?s.accepts[s.dataType]+", */*":s.accepts._default);}catch(e){}if(s.beforeSend&&s.beforeSend(xhr,s)===false){s.global&&jQuery.active--;xhr.abort();return false;}if(s.global)jQuery.event.trigger("ajaxSend",[xhr,s]);var onreadystatechange=function(isTimeout){if(!requestDone&&xhr&&(xhr.readyState==4||isTimeout=="timeout")){requestDone=true;if(ival){clearInterval(ival);ival=null;}status=isTimeout=="timeout"&&"timeout"||!jQuery.httpSuccess(xhr)&&"error"||s.ifModified&&jQuery.httpNotModified(xhr,s.url)&&"notmodified"||"success";if(status=="success"){try{data=jQuery.httpData(xhr,s.dataType,s.dataFilter);}catch(e){status="parsererror";}}if(status=="success"){var modRes;try{modRes=xhr.getResponseHeader("Last-Modified");}catch(e){}if(s.ifModified&&modRes)jQuery.lastModified[s.url]=modRes;if(!jsonp)success();}else +jQuery.handleError(s,xhr,status);complete();if(s.async)xhr=null;}};if(s.async){var ival=setInterval(onreadystatechange,13);if(s.timeout>0)setTimeout(function(){if(xhr){xhr.abort();if(!requestDone)onreadystatechange("timeout");}},s.timeout);}try{xhr.send(s.data);}catch(e){jQuery.handleError(s,xhr,null,e);}if(!s.async)onreadystatechange();function success(){if(s.success)s.success(data,status);if(s.global)jQuery.event.trigger("ajaxSuccess",[xhr,s]);}function complete(){if(s.complete)s.complete(xhr,status);if(s.global)jQuery.event.trigger("ajaxComplete",[xhr,s]);if(s.global&&!--jQuery.active)jQuery.event.trigger("ajaxStop");}return xhr;},handleError:function(s,xhr,status,e){if(s.error)s.error(xhr,status,e);if(s.global)jQuery.event.trigger("ajaxError",[xhr,s,e]);},active:0,httpSuccess:function(xhr){try{return!xhr.status&&location.protocol=="file:"||(xhr.status>=200&&xhr.status<300)||xhr.status==304||xhr.status==1223||jQuery.browser.safari&&xhr.status==undefined;}catch(e){}return false;},httpNotModified:function(xhr,url){try{var xhrRes=xhr.getResponseHeader("Last-Modified");return xhr.status==304||xhrRes==jQuery.lastModified[url]||jQuery.browser.safari&&xhr.status==undefined;}catch(e){}return false;},httpData:function(xhr,type,filter){var ct=xhr.getResponseHeader("content-type"),xml=type=="xml"||!type&&ct&&ct.indexOf("xml")>=0,data=xml?xhr.responseXML:xhr.responseText;if(xml&&data.documentElement.tagName=="parsererror")throw"parsererror";if(filter)data=filter(data,type);if(type=="script")jQuery.globalEval(data);if(type=="json")data=eval("("+data+")");return data;},param:function(a){var s=[];if(a.constructor==Array||a.jquery)jQuery.each(a,function(){s.push(encodeURIComponent(this.name)+"="+encodeURIComponent(this.value));});else +for(var j in a)if(a[j]&&a[j].constructor==Array)jQuery.each(a[j],function(){s.push(encodeURIComponent(j)+"="+encodeURIComponent(this));});else +s.push(encodeURIComponent(j)+"="+encodeURIComponent(jQuery.isFunction(a[j])?a[j]():a[j]));return s.join("&").replace(/%20/g,"+");}});jQuery.fn.extend({show:function(speed,callback){return speed?this.animate({height:"show",width:"show",opacity:"show"},speed,callback):this.filter(":hidden").each(function(){this.style.display=this.oldblock||"";if(jQuery.css(this,"display")=="none"){var elem=jQuery("<"+this.tagName+" />").appendTo("body");this.style.display=elem.css("display");if(this.style.display=="none")this.style.display="block";elem.remove();}}).end();},hide:function(speed,callback){return speed?this.animate({height:"hide",width:"hide",opacity:"hide"},speed,callback):this.filter(":visible").each(function(){this.oldblock=this.oldblock||jQuery.css(this,"display");this.style.display="none";}).end();},_toggle:jQuery.fn.toggle,toggle:function(fn,fn2){return jQuery.isFunction(fn)&&jQuery.isFunction(fn2)?this._toggle.apply(this,arguments):fn?this.animate({height:"toggle",width:"toggle",opacity:"toggle"},fn,fn2):this.each(function(){jQuery(this)[jQuery(this).is(":hidden")?"show":"hide"]();});},slideDown:function(speed,callback){return this.animate({height:"show"},speed,callback);},slideUp:function(speed,callback){return this.animate({height:"hide"},speed,callback);},slideToggle:function(speed,callback){return this.animate({height:"toggle"},speed,callback);},fadeIn:function(speed,callback){return this.animate({opacity:"show"},speed,callback);},fadeOut:function(speed,callback){return this.animate({opacity:"hide"},speed,callback);},fadeTo:function(speed,to,callback){return this.animate({opacity:to},speed,callback);},animate:function(prop,speed,easing,callback){var optall=jQuery.speed(speed,easing,callback);return this[optall.queue===false?"each":"queue"](function(){if(this.nodeType!=1)return false;var opt=jQuery.extend({},optall),p,hidden=jQuery(this).is(":hidden"),self=this;for(p in prop){if(prop[p]=="hide"&&hidden||prop[p]=="show"&&!hidden)return opt.complete.call(this);if(p=="height"||p=="width"){opt.display=jQuery.css(this,"display");opt.overflow=this.style.overflow;}}if(opt.overflow!=null)this.style.overflow="hidden";opt.curAnim=jQuery.extend({},prop);jQuery.each(prop,function(name,val){var e=new jQuery.fx(self,opt,name);if(/toggle|show|hide/.test(val))e[val=="toggle"?hidden?"show":"hide":val](prop);else{var parts=val.toString().match(/^([+-]=)?([\d+-.]+)(.*)$/),start=e.cur(true)||0;if(parts){var end=parseFloat(parts[2]),unit=parts[3]||"px";if(unit!="px"){self.style[name]=(end||1)+unit;start=((end||1)/e.cur(true))*start;self.style[name]=start+unit;}if(parts[1])end=((parts[1]=="-="?-1:1)*end)+start;e.custom(start,end,unit);}else +e.custom(start,val,"");}});return true;});},queue:function(type,fn){if(jQuery.isFunction(type)||(type&&type.constructor==Array)){fn=type;type="fx";}if(!type||(typeof type=="string"&&!fn))return queue(this[0],type);return this.each(function(){if(fn.constructor==Array)queue(this,type,fn);else{queue(this,type).push(fn);if(queue(this,type).length==1)fn.call(this);}});},stop:function(clearQueue,gotoEnd){var timers=jQuery.timers;if(clearQueue)this.queue([]);this.each(function(){for(var i=timers.length-1;i>=0;i--)if(timers[i].elem==this){if(gotoEnd)timers[i](true);timers.splice(i,1);}});if(!gotoEnd)this.dequeue();return this;}});var queue=function(elem,type,array){if(elem){type=type||"fx";var q=jQuery.data(elem,type+"queue");if(!q||array)q=jQuery.data(elem,type+"queue",jQuery.makeArray(array));}return q;};jQuery.fn.dequeue=function(type){type=type||"fx";return this.each(function(){var q=queue(this,type);q.shift();if(q.length)q[0].call(this);});};jQuery.extend({speed:function(speed,easing,fn){var opt=speed&&speed.constructor==Object?speed:{complete:fn||!fn&&easing||jQuery.isFunction(speed)&&speed,duration:speed,easing:fn&&easing||easing&&easing.constructor!=Function&&easing};opt.duration=(opt.duration&&opt.duration.constructor==Number?opt.duration:jQuery.fx.speeds[opt.duration])||jQuery.fx.speeds.def;opt.old=opt.complete;opt.complete=function(){if(opt.queue!==false)jQuery(this).dequeue();if(jQuery.isFunction(opt.old))opt.old.call(this);};return opt;},easing:{linear:function(p,n,firstNum,diff){return firstNum+diff*p;},swing:function(p,n,firstNum,diff){return((-Math.cos(p*Math.PI)/2)+0.5)*diff+firstNum;}},timers:[],timerId:null,fx:function(elem,options,prop){this.options=options;this.elem=elem;this.prop=prop;if(!options.orig)options.orig={};}});jQuery.fx.prototype={update:function(){if(this.options.step)this.options.step.call(this.elem,this.now,this);(jQuery.fx.step[this.prop]||jQuery.fx.step._default)(this);if(this.prop=="height"||this.prop=="width")this.elem.style.display="block";},cur:function(force){if(this.elem[this.prop]!=null&&this.elem.style[this.prop]==null)return this.elem[this.prop];var r=parseFloat(jQuery.css(this.elem,this.prop,force));return r&&r>-10000?r:parseFloat(jQuery.curCSS(this.elem,this.prop))||0;},custom:function(from,to,unit){this.startTime=now();this.start=from;this.end=to;this.unit=unit||this.unit||"px";this.now=this.start;this.pos=this.state=0;this.update();var self=this;function t(gotoEnd){return self.step(gotoEnd);}t.elem=this.elem;jQuery.timers.push(t);if(jQuery.timerId==null){jQuery.timerId=setInterval(function(){var timers=jQuery.timers;for(var i=0;ithis.options.duration+this.startTime){this.now=this.end;this.pos=this.state=1;this.update();this.options.curAnim[this.prop]=true;var done=true;for(var i in this.options.curAnim)if(this.options.curAnim[i]!==true)done=false;if(done){if(this.options.display!=null){this.elem.style.overflow=this.options.overflow;this.elem.style.display=this.options.display;if(jQuery.css(this.elem,"display")=="none")this.elem.style.display="block";}if(this.options.hide)this.elem.style.display="none";if(this.options.hide||this.options.show)for(var p in this.options.curAnim)jQuery.attr(this.elem.style,p,this.options.orig[p]);}if(done)this.options.complete.call(this.elem);return false;}else{var n=t-this.startTime;this.state=n/this.options.duration;this.pos=jQuery.easing[this.options.easing||(jQuery.easing.swing?"swing":"linear")](this.state,n,0,1,this.options.duration);this.now=this.start+((this.end-this.start)*this.pos);this.update();}return true;}};jQuery.extend(jQuery.fx,{speeds:{slow:600,fast:200,def:400},step:{scrollLeft:function(fx){fx.elem.scrollLeft=fx.now;},scrollTop:function(fx){fx.elem.scrollTop=fx.now;},opacity:function(fx){jQuery.attr(fx.elem.style,"opacity",fx.now);},_default:function(fx){fx.elem.style[fx.prop]=fx.now+fx.unit;}}});jQuery.fn.offset=function(){var left=0,top=0,elem=this[0],results;if(elem)with(jQuery.browser){var parent=elem.parentNode,offsetChild=elem,offsetParent=elem.offsetParent,doc=elem.ownerDocument,safari2=safari&&parseInt(version)<522&&!/adobeair/i.test(userAgent),css=jQuery.curCSS,fixed=css(elem,"position")=="fixed";if(elem.getBoundingClientRect){var box=elem.getBoundingClientRect();add(box.left+Math.max(doc.documentElement.scrollLeft,doc.body.scrollLeft),box.top+Math.max(doc.documentElement.scrollTop,doc.body.scrollTop));add(-doc.documentElement.clientLeft,-doc.documentElement.clientTop);}else{add(elem.offsetLeft,elem.offsetTop);while(offsetParent){add(offsetParent.offsetLeft,offsetParent.offsetTop);if(mozilla&&!/^t(able|d|h)$/i.test(offsetParent.tagName)||safari&&!safari2)border(offsetParent);if(!fixed&&css(offsetParent,"position")=="fixed")fixed=true;offsetChild=/^body$/i.test(offsetParent.tagName)?offsetChild:offsetParent;offsetParent=offsetParent.offsetParent;}while(parent&&parent.tagName&&!/^body|html$/i.test(parent.tagName)){if(!/^inline|table.*$/i.test(css(parent,"display")))add(-parent.scrollLeft,-parent.scrollTop);if(mozilla&&css(parent,"overflow")!="visible")border(parent);parent=parent.parentNode;}if((safari2&&(fixed||css(offsetChild,"position")=="absolute"))||(mozilla&&css(offsetChild,"position")!="absolute"))add(-doc.body.offsetLeft,-doc.body.offsetTop);if(fixed)add(Math.max(doc.documentElement.scrollLeft,doc.body.scrollLeft),Math.max(doc.documentElement.scrollTop,doc.body.scrollTop));}results={top:top,left:left};}function border(elem){add(jQuery.curCSS(elem,"borderLeftWidth",true),jQuery.curCSS(elem,"borderTopWidth",true));}function add(l,t){left+=parseInt(l,10)||0;top+=parseInt(t,10)||0;}return results;};jQuery.fn.extend({position:function(){var left=0,top=0,results;if(this[0]){var offsetParent=this.offsetParent(),offset=this.offset(),parentOffset=/^body|html$/i.test(offsetParent[0].tagName)?{top:0,left:0}:offsetParent.offset();offset.top-=num(this,'marginTop');offset.left-=num(this,'marginLeft');parentOffset.top+=num(offsetParent,'borderTopWidth');parentOffset.left+=num(offsetParent,'borderLeftWidth');results={top:offset.top-parentOffset.top,left:offset.left-parentOffset.left};}return results;},offsetParent:function(){var offsetParent=this[0].offsetParent;while(offsetParent&&(!/^body|html$/i.test(offsetParent.tagName)&&jQuery.css(offsetParent,'position')=='static'))offsetParent=offsetParent.offsetParent;return jQuery(offsetParent);}});jQuery.each(['Left','Top'],function(i,name){var method='scroll'+name;jQuery.fn[method]=function(val){if(!this[0])return;return val!=undefined?this.each(function(){this==window||this==document?window.scrollTo(!i?val:jQuery(window).scrollLeft(),i?val:jQuery(window).scrollTop()):this[method]=val;}):this[0]==window||this[0]==document?self[i?'pageYOffset':'pageXOffset']||jQuery.boxModel&&document.documentElement[method]||document.body[method]:this[0][method];};});jQuery.each(["Height","Width"],function(i,name){var tl=i?"Left":"Top",br=i?"Right":"Bottom";jQuery.fn["inner"+name]=function(){return this[name.toLowerCase()]()+num(this,"padding"+tl)+num(this,"padding"+br);};jQuery.fn["outer"+name]=function(margin){return this["inner"+name]()+num(this,"border"+tl+"Width")+num(this,"border"+br+"Width")+(margin?num(this,"margin"+tl)+num(this,"margin"+br):0);};});})(); \ No newline at end of file Property changes on: chat/trunk/src/main/webapp/js/jquery-1.2.6.min.js ___________________________________________________________________ Name: svn:eol-style + native From svnnotify ¡÷ sourceforge.jp Mon Dec 8 18:31:00 2008 From: svnnotify ¡÷ sourceforge.jp (svnnotify ¡÷ sourceforge.jp) Date: Mon, 08 Dec 2008 18:31:00 +0900 Subject: [pal-cvs 3790] [1525] updated jquery code. Message-ID: <1228728660.471134.26821.nullmailer@users.sourceforge.jp> Revision: 1525 http://svn.sourceforge.jp/view?root=pal&view=rev&rev=1525 Author: shinsuke Date: 2008-12-08 18:31:00 +0900 (Mon, 08 Dec 2008) Log Message: ----------- updated jquery code. Modified Paths: -------------- chat/trunk/src/main/webapp/WEB-INF/view/chat/index.jsp chat/trunk/src/main/webapp/js/jquery-1.2.6.min.js -------------- next part -------------- Modified: chat/trunk/src/main/webapp/WEB-INF/view/chat/index.jsp =================================================================== --- chat/trunk/src/main/webapp/WEB-INF/view/chat/index.jsp 2008-12-06 00:08:15 UTC (rev 1524) +++ chat/trunk/src/main/webapp/WEB-INF/view/chat/index.jsp 2008-12-08 09:31:00 UTC (rev 1525) @@ -10,15 +10,9 @@ + - +
+
+
+ + + + + + + + + + + + + + +
+ + + + +
+"/> +
+
+
+
+ + Property changes on: chat/trunk/src/main/webapp/WEB-INF/view/config/index.jsp ___________________________________________________________________ Name: svn:eol-style + native Modified: chat/trunk/src/main/webapp/js/jquery-1.2.6.min.js =================================================================== --- chat/trunk/src/main/webapp/js/jquery-1.2.6.min.js 2008-12-08 09:31:00 UTC (rev 1525) +++ chat/trunk/src/main/webapp/js/jquery-1.2.6.min.js 2008-12-08 13:15:04 UTC (rev 1526) @@ -8,7 +8,7 @@ * $Date: 2008-05-24 14:22:17 -0400 (Sat, 24 May 2008) $ * $Rev: 5685 $ */ -(function(){if(typeof(jQuery) == "undefined"){var _jQuery=window.jQuery,_$=window.$;var jQuery=window.jQuery=window.$=function(selector,context){return new jQuery.fn.init(selector,context);};var quickExpr=/^[^<]*(<(.|\s)+>)[^>]*$|^#(\w+)$/,isSimple=/^.[^:#\[\.]*$/,undefined;jQuery.fn=jQuery.prototype={init:function(selector,context){selector=selector||document;if(selector.nodeType){this[0]=selector;this.length=1;return this;}if(typeof selector=="string"){var match=quickExpr.exec(selector);if(match&&(match[1]||!context)){if(match[1])selector=jQuery.clean([match[1]],context);else{var elem=document.getElementById(match[3]);if(elem){if(elem.id!=match[3])return jQuery().find(selector);return jQuery(elem);}selector=[];}}else +(function(){var _jQuery=window.jQuery,_$=window.$;var jQuery=window.jQuery=window.$=function(selector,context){return new jQuery.fn.init(selector,context);};var quickExpr=/^[^<]*(<(.|\s)+>)[^>]*$|^#(\w+)$/,isSimple=/^.[^:#\[\.]*$/,undefined;jQuery.fn=jQuery.prototype={init:function(selector,context){selector=selector||document;if(selector.nodeType){this[0]=selector;this.length=1;return this;}if(typeof selector=="string"){var match=quickExpr.exec(selector);if(match&&(match[1]||!context)){if(match[1])selector=jQuery.clean([match[1]],context);else{var elem=document.getElementById(match[3]);if(elem){if(elem.id!=match[3])return jQuery().find(selector);return jQuery(elem);}selector=[];}}else return jQuery(context).find(selector);}else if(jQuery.isFunction(selector))return jQuery(document)[jQuery.fn.ready?"ready":"load"](selector);return this.setArray(jQuery.makeArray(selector));},jquery:"1.2.6",size:function(){return this.length;},length:0,get:function(num){return num==undefined?jQuery.makeArray(this):this[num];},pushStack:function(elems){var ret=jQuery(elems);ret.prevObject=this;return ret;},setArray:function(elems){this.length=0;Array.prototype.push.apply(this,elems);return this;},each:function(callback,args){return jQuery.each(this,callback,args);},index:function(elem){var ret=-1;return jQuery.inArray(elem&&elem.jquery?elem[0]:elem,this);},attr:function(name,value,type){var options=name;if(name.constructor==String)if(value===undefined)return this[0]&&jQuery[type||"attr"](this[0],name);else{options={};options[name]=value;}return this.each(function(i){for(name in options)jQuery.attr(type?this.style:this,name,jQuery.prop(this,options[name],type,i,name));});},css:function(key,value){if((key=='width'||key=='height')&&parseFloat(value)<0)value=undefined;return this.attr(key,value,"curCSS");},text:function(text){if(typeof text!="object"&&text!=null)return this.empty().append((this[0]&&this[0].ownerDocument||document).createTextNode(text));var ret="";jQuery.each(text||this,function(){jQuery.each(this.childNodes,function(){if(this.nodeType!=8)ret+=this.nodeType!=1?this.nodeValue:jQuery.fn.text([this]);});});return ret;},wrapAll:function(html){if(this[0])jQuery(html,this[0].ownerDocument).clone().insertBefore(this[0]).map(function(){var elem=this;while(elem.firstChild)elem=elem.firstChild;return elem;}).append(this);return this;},wrapInner:function(html){return this.each(function(){jQuery(this).contents().wrapAll(html);});},wrap:function(html){return this.each(function(){jQuery(this).wrapAll(html);});},append:function(){return this.domManip(arguments,true,false,function(elem){if(this.nodeType==1)this.appendChild(elem);});},prepend:function(){return this.domManip(arguments,true,true,function(elem){if(this.nodeType==1)this.insertBefore(elem,this.firstChild);});},before:function(){return this.domManip(arguments,false,false,function(elem){this.parentNode.insertBefore(elem,this);});},after:function(){return this.domManip(arguments,false,true,function(elem){this.parentNode.insertBefore(elem,this.nextSibling);});},end:function(){return this.prevObject||jQuery([]);},find:function(selector){var elems=jQuery.map(this,function(elem){return jQuery.find(selector,elem);});return this.pushStack(/[^+>] [^+>]/.test(selector)||selector.indexOf("..")>-1?jQuery.unique(elems):elems);},clone:function(events){var ret=this.map(function(){if(jQuery.browser.msie&&!jQuery.isXMLDoc(this)){var clone=this.cloneNode(true),container=document.createElement("div");container.appendChild(clone);return jQuery.clean([container.innerHTML])[0];}else return this.cloneNode(true);});var clone=ret.find("*").andSelf().each(function(){if(this[expando]!=undefined)this[expando]=null;});if(events===true)this.find("*").andSelf().each(function(i){if(this.nodeType==3)return;var events=jQuery.data(this,"events");for(var type in events)for(var handler in events[type])jQuery.event.add(clone[i],type,events[type][handler],events[type][handler].data);});return ret;},filter:function(selector){return this.pushStack(jQuery.isFunction(selector)&&jQuery.grep(this,function(elem,i){return selector.call(elem,i);})||jQuery.multiFilter(selector,this));},not:function(selector){if(selector.constructor==String)if(isSimple.test(selector))return this.pushStack(jQuery.multiFilter(selector,this,true));else selector=jQuery.multiFilter(selector,this);var isArrayLike=selector.length&&selector[selector.length-1]!==undefined&&!selector.nodeType;return this.filter(function(){return isArrayLike?jQuery.inArray(this,selector)<0:this!=selector;});},add:function(selector){return this.pushStack(jQuery.unique(jQuery.merge(this.get(),typeof selector=='string'?jQuery(selector):jQuery.makeArray(selector))));},is:function(selector){return!!selector&&jQuery.multiFilter(selector,this).length>0;},hasClass:function(selector){return this.is("."+selector);},val:function(value){if(value==undefined){if(this.length){var elem=this[0];if(jQuery.nodeName(elem,"select")){var index=elem.selectedIndex,values=[],options=elem.options,one=elem.type=="select-one";if(index<0)return null;for(var i=one?index:0,max=one?index+1:options.length;i0)setTimeout(function(){if(xhr){xhr.abort();if(!requestDone)onreadystatechange("timeout");}},s.timeout);}try{xhr.send(s.data);}catch(e){jQuery.handleError(s,xhr,null,e);}if(!s.async)onreadystatechange();function success(){if(s.success)s.success(data,status);if(s.global)jQuery.event.trigger("ajaxSuccess",[xhr,s]);}function complete(){if(s.complete)s.complete(xhr,status);if(s.global)jQuery.event.trigger("ajaxComplete",[xhr,s]);if(s.global&&!--jQuery.active)jQuery.event.trigger("ajaxStop");}return xhr;},handleError:function(s,xhr,status,e){if(s.error)s.error(xhr,status,e);if(s.global)jQuery.event.trigger("ajaxError",[xhr,s,e]);},active:0,httpSuccess:function(xhr){try{return!xhr.status&&location.protocol=="file:"||(xhr.status>=200&&xhr.status<300)||xhr.status==304||xhr.status==1223||jQuery.browser.safari&&xhr.status==undefined;}catch(e){}return false;},httpNotModified:function(xhr,url){try{var xhrRes=xhr.getResponseHeader("Last-Modified");return xhr.status==304||xhrRes==jQuery.lastModified[url]||jQuery.browser.safari&&xhr.status==undefined;}catch(e){}return false;},httpData:function(xhr,type,filter){var ct=xhr.getResponseHeader("content-type"),xml=type=="xml"||!type&&ct&&ct.indexOf("xml")>=0,data=xml?xhr.responseXML:xhr.responseText;if(xml&&data.documentElement.tagName=="parsererror")throw"parsererror";if(filter)data=filter(data,type);if(type=="script")jQuery.globalEval(data);if(type=="json")data=eval("("+data+")");return data;},param:function(a){var s=[];if(a.constructor==Array||a.jquery)jQuery.each(a,function(){s.push(encodeURIComponent(this.name)+"="+encodeURIComponent(this.value));});else for(var j in a)if(a[j]&&a[j].constructor==Array)jQuery.each(a[j],function(){s.push(encodeURIComponent(j)+"="+encodeURIComponent(this));});else s.push(encodeURIComponent(j)+"="+encodeURIComponent(jQuery.isFunction(a[j])?a[j]():a[j]));return s.join("&").replace(/%20/g,"+");}});jQuery.fn.extend({show:function(speed,callback){return speed?this.animate({height:"show",width:"show",opacity:"show"},speed,callback):this.filter(":hidden").each(function(){this.style.display=this.oldblock||"";if(jQuery.css(this,"display")=="none"){var elem=jQuery("<"+this.tagName+" />").appendTo("body");this.style.display=elem.css("display");if(this.style.display=="none")this.style.display="block";elem.remove();}}).end();},hide:function(speed,callback){return speed?this.animate({height:"hide",width:"hide",opacity:"hide"},speed,callback):this.filter(":visible").each(function(){this.oldblock=this.oldblock||jQuery.css(this,"display");this.style.display="none";}).end();},_toggle:jQuery.fn.toggle,toggle:function(fn,fn2){return jQuery.isFunction(fn)&&jQuery.isFunction(fn2)?this._toggle.apply(this,arguments):fn?this.animate({height:"toggle",width:"toggle",opacity:"toggle"},fn,fn2):this.each(function(){jQuery(this)[jQuery(this).is(":hidden")?"show":"hide"]();});},slideDown:function(speed,callback){return this.animate({height:"show"},speed,callback);},slideUp:function(speed,callback){return this.animate({height:"hide"},speed,callback);},slideToggle:function(speed,callback){return this.animate({height:"toggle"},speed,callback);},fadeIn:function(speed,callback){return this.animate({opacity:"show"},speed,callback);},fadeOut:function(speed,callback){return this.animate({opacity:"hide"},speed,callback);},fadeTo:function(speed,to,callback){return this.animate({opacity:to},speed,callback);},animate:function(prop,speed,easing,callback){var optall=jQuery.speed(speed,easing,callback);return this[optall.queue===false?"each":"queue"](function(){if(this.nodeType!=1)return false;var opt=jQuery.extend({},optall),p,hidden=jQuery(this).is(":hidden"),self=this;for(p in prop){if(prop[p]=="hide"&&hidden||prop[p]=="show"&&!hidden)return opt.complete.call(this);if(p=="height"||p=="width"){opt.display=jQuery.css(this,"display");opt.overflow=this.style.overflow;}}if(opt.overflow!=null)this.style.overflow="hidden";opt.curAnim=jQuery.extend({},prop);jQuery.each(prop,function(name,val){var e=new jQuery.fx(self,opt,name);if(/toggle|show|hide/.test(val))e[val=="toggle"?hidden?"show":"hide":val](prop);else{var parts=val.toString().match(/^([+-]=)?([\d+-.]+)(.*)$/),start=e.cur(true)||0;if(parts){var end=parseFloat(parts[2]),unit=parts[3]||"px";if(unit!="px"){self.style[name]=(end||1)+unit;start=((end||1)/e.cur(true))*start;self.style[name]=start+unit;}if(parts[1])end=((parts[1]=="-="?-1:1)*end)+start;e.custom(start,end,unit);}else -e.custom(start,val,"");}});return true;});},queue:function(type,fn){if(jQuery.isFunction(type)||(type&&type.constructor==Array)){fn=type;type="fx";}if(!type||(typeof type=="string"&&!fn))return queue(this[0],type);return this.each(function(){if(fn.constructor==Array)queue(this,type,fn);else{queue(this,type).push(fn);if(queue(this,type).length==1)fn.call(this);}});},stop:function(clearQueue,gotoEnd){var timers=jQuery.timers;if(clearQueue)this.queue([]);this.each(function(){for(var i=timers.length-1;i>=0;i--)if(timers[i].elem==this){if(gotoEnd)timers[i](true);timers.splice(i,1);}});if(!gotoEnd)this.dequeue();return this;}});var queue=function(elem,type,array){if(elem){type=type||"fx";var q=jQuery.data(elem,type+"queue");if(!q||array)q=jQuery.data(elem,type+"queue",jQuery.makeArray(array));}return q;};jQuery.fn.dequeue=function(type){type=type||"fx";return this.each(function(){var q=queue(this,type);q.shift();if(q.length)q[0].call(this);});};jQuery.extend({speed:function(speed,easing,fn){var opt=speed&&speed.constructor==Object?speed:{complete:fn||!fn&&easing||jQuery.isFunction(speed)&&speed,duration:speed,easing:fn&&easing||easing&&easing.constructor!=Function&&easing};opt.duration=(opt.duration&&opt.duration.constructor==Number?opt.duration:jQuery.fx.speeds[opt.duration])||jQuery.fx.speeds.def;opt.old=opt.complete;opt.complete=function(){if(opt.queue!==false)jQuery(this).dequeue();if(jQuery.isFunction(opt.old))opt.old.call(this);};return opt;},easing:{linear:function(p,n,firstNum,diff){return firstNum+diff*p;},swing:function(p,n,firstNum,diff){return((-Math.cos(p*Math.PI)/2)+0.5)*diff+firstNum;}},timers:[],timerId:null,fx:function(elem,options,prop){this.options=options;this.elem=elem;this.prop=prop;if(!options.orig)options.orig={};}});jQuery.fx.prototype={update:function(){if(this.options.step)this.options.step.call(this.elem,this.now,this);(jQuery.fx.step[this.prop]||jQuery.fx.step._default)(this);if(this.prop=="height"||this.prop=="width")this.elem.style.display="block";},cur:function(force){if(this.elem[this.prop]!=null&&this.elem.style[this.prop]==null)return this.elem[this.prop];var r=parseFloat(jQuery.css(this.elem,this.prop,force));return r&&r>-10000?r:parseFloat(jQuery.curCSS(this.elem,this.prop))||0;},custom:function(from,to,unit){this.startTime=now();this.start=from;this.end=to;this.unit=unit||this.unit||"px";this.now=this.start;this.pos=this.state=0;this.update();var self=this;function t(gotoEnd){return self.step(gotoEnd);}t.elem=this.elem;jQuery.timers.push(t);if(jQuery.timerId==null){jQuery.timerId=setInterval(function(){var timers=jQuery.timers;for(var i=0;ithis.options.duration+this.startTime){this.now=this.end;this.pos=this.state=1;this.update();this.options.curAnim[this.prop]=true;var done=true;for(var i in this.options.curAnim)if(this.options.curAnim[i]!==true)done=false;if(done){if(this.options.display!=null){this.elem.style.overflow=this.options.overflow;this.elem.style.display=this.options.display;if(jQuery.css(this.elem,"display")=="none")this.elem.style.display="block";}if(this.options.hide)this.elem.style.display="none";if(this.options.hide||this.options.show)for(var p in this.options.curAnim)jQuery.attr(this.elem.style,p,this.options.orig[p]);}if(done)this.options.complete.call(this.elem);return false;}else{var n=t-this.startTime;this.state=n/this.options.duration;this.pos=jQuery.easing[this.options.easing||(jQuery.easing.swing?"swing":"linear")](this.state,n,0,1,this.options.duration);this.now=this.start+((this.end-this.start)*this.pos);this.update();}return true;}};jQuery.extend(jQuery.fx,{speeds:{slow:600,fast:200,def:400},step:{scrollLeft:function(fx){fx.elem.scrollLeft=fx.now;},scrollTop:function(fx){fx.elem.scrollTop=fx.now;},opacity:function(fx){jQuery.attr(fx.elem.style,"opacity",fx.now);},_default:function(fx){fx.elem.style[fx.prop]=fx.now+fx.unit;}}});jQuery.fn.offset=function(){var left=0,top=0,elem=this[0],results;if(elem)with(jQuery.browser){var parent=elem.parentNode,offsetChild=elem,offsetParent=elem.offsetParent,doc=elem.ownerDocument,safari2=safari&&parseInt(version)<522&&!/adobeair/i.test(userAgent),css=jQuery.curCSS,fixed=css(elem,"position")=="fixed";if(elem.getBoundingClientRect){var box=elem.getBoundingClientRect();add(box.left+Math.max(doc.documentElement.scrollLeft,doc.body.scrollLeft),box.top+Math.max(doc.documentElement.scrollTop,doc.body.scrollTop));add(-doc.documentElement.clientLeft,-doc.documentElement.clientTop);}else{add(elem.offsetLeft,elem.offsetTop);while(offsetParent){add(offsetParent.offsetLeft,offsetParent.offsetTop);if(mozilla&&!/^t(able|d|h)$/i.test(offsetParent.tagName)||safari&&!safari2)border(offsetParent);if(!fixed&&css(offsetParent,"position")=="fixed")fixed=true;offsetChild=/^body$/i.test(offsetParent.tagName)?offsetChild:offsetParent;offsetParent=offsetParent.offsetParent;}while(parent&&parent.tagName&&!/^body|html$/i.test(parent.tagName)){if(!/^inline|table.*$/i.test(css(parent,"display")))add(-parent.scrollLeft,-parent.scrollTop);if(mozilla&&css(parent,"overflow")!="visible")border(parent);parent=parent.parentNode;}if((safari2&&(fixed||css(offsetChild,"position")=="absolute"))||(mozilla&&css(offsetChild,"position")!="absolute"))add(-doc.body.offsetLeft,-doc.body.offsetTop);if(fixed)add(Math.max(doc.documentElement.scrollLeft,doc.body.scrollLeft),Math.max(doc.documentElement.scrollTop,doc.body.scrollTop));}results={top:top,left:left};}function border(elem){add(jQuery.curCSS(elem,"borderLeftWidth",true),jQuery.curCSS(elem,"borderTopWidth",true));}function add(l,t){left+=parseInt(l,10)||0;top+=parseInt(t,10)||0;}return results;};jQuery.fn.extend({position:function(){var left=0,top=0,results;if(this[0]){var offsetParent=this.offsetParent(),offset=this.offset(),parentOffset=/^body|html$/i.test(offsetParent[0].tagName)?{top:0,left:0}:offsetParent.offset();offset.top-=num(this,'marginTop');offset.left-=num(this,'marginLeft');parentOffset.top+=num(offsetParent,'borderTopWidth');parentOffset.left+=num(offsetParent,'borderLeftWidth');results={top:offset.top-parentOffset.top,left:offset.left-parentOffset.left};}return results;},offsetParent:function(){var offsetParent=this[0].offsetParent;while(offsetParent&&(!/^body|html$/i.test(offsetParent.tagName)&&jQuery.css(offsetParent,'position')=='static'))offsetParent=offsetParent.offsetParent;return jQuery(offsetParent);}});jQuery.each(['Left','Top'],function(i,name){var method='scroll'+name;jQuery.fn[method]=function(val){if(!this[0])return;return val!=undefined?this.each(function(){this==window||this==document?window.scrollTo(!i?val:jQuery(window).scrollLeft(),i?val:jQuery(window).scrollTop()):this[method]=val;}):this[0]==window||this[0]==document?self[i?'pageYOffset':'pageXOffset']||jQuery.boxModel&&document.documentElement[method]||document.body[method]:this[0][method];};});jQuery.each(["Height","Width"],function(i,name){var tl=i?"Left":"Top",br=i?"Right":"Bottom";jQuery.fn["inner"+name]=function(){return this[name.toLowerCase()]()+num(this,"padding"+tl)+num(this,"padding"+br);};jQuery.fn["outer"+name]=function(margin){return this["inner"+name]()+num(this,"border"+tl+"Width")+num(this,"border"+br+"Width")+(margin?num(this,"margin"+tl)+num(this,"margin"+br):0);};});}})(); +e.custom(start,val,"");}});return true;});},queue:function(type,fn){if(jQuery.isFunction(type)||(type&&type.constructor==Array)){fn=type;type="fx";}if(!type||(typeof type=="string"&&!fn))return queue(this[0],type);return this.each(function(){if(fn.constructor==Array)queue(this,type,fn);else{queue(this,type).push(fn);if(queue(this,type).length==1)fn.call(this);}});},stop:function(clearQueue,gotoEnd){var timers=jQuery.timers;if(clearQueue)this.queue([]);this.each(function(){for(var i=timers.length-1;i>=0;i--)if(timers[i].elem==this){if(gotoEnd)timers[i](true);timers.splice(i,1);}});if(!gotoEnd)this.dequeue();return this;}});var queue=function(elem,type,array){if(elem){type=type||"fx";var q=jQuery.data(elem,type+"queue");if(!q||array)q=jQuery.data(elem,type+"queue",jQuery.makeArray(array));}return q;};jQuery.fn.dequeue=function(type){type=type||"fx";return this.each(function(){var q=queue(this,type);q.shift();if(q.length)q[0].call(this);});};jQuery.extend({speed:function(speed,easing,fn){var opt=speed&&speed.constructor==Object?speed:{complete:fn||!fn&&easing||jQuery.isFunction(speed)&&speed,duration:speed,easing:fn&&easing||easing&&easing.constructor!=Function&&easing};opt.duration=(opt.duration&&opt.duration.constructor==Number?opt.duration:jQuery.fx.speeds[opt.duration])||jQuery.fx.speeds.def;opt.old=opt.complete;opt.complete=function(){if(opt.queue!==false)jQuery(this).dequeue();if(jQuery.isFunction(opt.old))opt.old.call(this);};return opt;},easing:{linear:function(p,n,firstNum,diff){return firstNum+diff*p;},swing:function(p,n,firstNum,diff){return((-Math.cos(p*Math.PI)/2)+0.5)*diff+firstNum;}},timers:[],timerId:null,fx:function(elem,options,prop){this.options=options;this.elem=elem;this.prop=prop;if(!options.orig)options.orig={};}});jQuery.fx.prototype={update:function(){if(this.options.step)this.options.step.call(this.elem,this.now,this);(jQuery.fx.step[this.prop]||jQuery.fx.step._default)(this);if(this.prop=="height"||this.prop=="width")this.elem.style.display="block";},cur:function(force){if(this.elem[this.prop]!=null&&this.elem.style[this.prop]==null)return this.elem[this.prop];var r=parseFloat(jQuery.css(this.elem,this.prop,force));return r&&r>-10000?r:parseFloat(jQuery.curCSS(this.elem,this.prop))||0;},custom:function(from,to,unit){this.startTime=now();this.start=from;this.end=to;this.unit=unit||this.unit||"px";this.now=this.start;this.pos=this.state=0;this.update();var self=this;function t(gotoEnd){return self.step(gotoEnd);}t.elem=this.elem;jQuery.timers.push(t);if(jQuery.timerId==null){jQuery.timerId=setInterval(function(){var timers=jQuery.timers;for(var i=0;ithis.options.duration+this.startTime){this.now=this.end;this.pos=this.state=1;this.update();this.options.curAnim[this.prop]=true;var done=true;for(var i in this.options.curAnim)if(this.options.curAnim[i]!==true)done=false;if(done){if(this.options.display!=null){this.elem.style.overflow=this.options.overflow;this.elem.style.display=this.options.display;if(jQuery.css(this.elem,"display")=="none")this.elem.style.display="block";}if(this.options.hide)this.elem.style.display="none";if(this.options.hide||this.options.show)for(var p in this.options.curAnim)jQuery.attr(this.elem.style,p,this.options.orig[p]);}if(done)this.options.complete.call(this.elem);return false;}else{var n=t-this.startTime;this.state=n/this.options.duration;this.pos=jQuery.easing[this.options.easing||(jQuery.easing.swing?"swing":"linear")](this.state,n,0,1,this.options.duration);this.now=this.start+((this.end-this.start)*this.pos);this.update();}return true;}};jQuery.extend(jQuery.fx,{speeds:{slow:600,fast:200,def:400},step:{scrollLeft:function(fx){fx.elem.scrollLeft=fx.now;},scrollTop:function(fx){fx.elem.scrollTop=fx.now;},opacity:function(fx){jQuery.attr(fx.elem.style,"opacity",fx.now);},_default:function(fx){fx.elem.style[fx.prop]=fx.now+fx.unit;}}});jQuery.fn.offset=function(){var left=0,top=0,elem=this[0],results;if(elem)with(jQuery.browser){var parent=elem.parentNode,offsetChild=elem,offsetParent=elem.offsetParent,doc=elem.ownerDocument,safari2=safari&&parseInt(version)<522&&!/adobeair/i.test(userAgent),css=jQuery.curCSS,fixed=css(elem,"position")=="fixed";if(elem.getBoundingClientRect){var box=elem.getBoundingClientRect();add(box.left+Math.max(doc.documentElement.scrollLeft,doc.body.scrollLeft),box.top+Math.max(doc.documentElement.scrollTop,doc.body.scrollTop));add(-doc.documentElement.clientLeft,-doc.documentElement.clientTop);}else{add(elem.offsetLeft,elem.offsetTop);while(offsetParent){add(offsetParent.offsetLeft,offsetParent.offsetTop);if(mozilla&&!/^t(able|d|h)$/i.test(offsetParent.tagName)||safari&&!safari2)border(offsetParent);if(!fixed&&css(offsetParent,"position")=="fixed")fixed=true;offsetChild=/^body$/i.test(offsetParent.tagName)?offsetChild:offsetParent;offsetParent=offsetParent.offsetParent;}while(parent&&parent.tagName&&!/^body|html$/i.test(parent.tagName)){if(!/^inline|table.*$/i.test(css(parent,"display")))add(-parent.scrollLeft,-parent.scrollTop);if(mozilla&&css(parent,"overflow")!="visible")border(parent);parent=parent.parentNode;}if((safari2&&(fixed||css(offsetChild,"position")=="absolute"))||(mozilla&&css(offsetChild,"position")!="absolute"))add(-doc.body.offsetLeft,-doc.body.offsetTop);if(fixed)add(Math.max(doc.documentElement.scrollLeft,doc.body.scrollLeft),Math.max(doc.documentElement.scrollTop,doc.body.scrollTop));}results={top:top,left:left};}function border(elem){add(jQuery.curCSS(elem,"borderLeftWidth",true),jQuery.curCSS(elem,"borderTopWidth",true));}function add(l,t){left+=parseInt(l,10)||0;top+=parseInt(t,10)||0;}return results;};jQuery.fn.extend({position:function(){var left=0,top=0,results;if(this[0]){var offsetParent=this.offsetParent(),offset=this.offset(),parentOffset=/^body|html$/i.test(offsetParent[0].tagName)?{top:0,left:0}:offsetParent.offset();offset.top-=num(this,'marginTop');offset.left-=num(this,'marginLeft');parentOffset.top+=num(offsetParent,'borderTopWidth');parentOffset.left+=num(offsetParent,'borderLeftWidth');results={top:offset.top-parentOffset.top,left:offset.left-parentOffset.left};}return results;},offsetParent:function(){var offsetParent=this[0].offsetParent;while(offsetParent&&(!/^body|html$/i.test(offsetParent.tagName)&&jQuery.css(offsetParent,'position')=='static'))offsetParent=offsetParent.offsetParent;return jQuery(offsetParent);}});jQuery.each(['Left','Top'],function(i,name){var method='scroll'+name;jQuery.fn[method]=function(val){if(!this[0])return;return val!=undefined?this.each(function(){this==window||this==document?window.scrollTo(!i?val:jQuery(window).scrollLeft(),i?val:jQuery(window).scrollTop()):this[method]=val;}):this[0]==window||this[0]==document?self[i?'pageYOffset':'pageXOffset']||jQuery.boxModel&&document.documentElement[method]||document.body[method]:this[0][method];};});jQuery.each(["Height","Width"],function(i,name){var tl=i?"Left":"Top",br=i?"Right":"Bottom";jQuery.fn["inner"+name]=function(){return this[name.toLowerCase()]()+num(this,"padding"+tl)+num(this,"padding"+br);};jQuery.fn["outer"+name]=function(margin){return this["inner"+name]()+num(this,"border"+tl+"Width")+num(this,"border"+br+"Width")+(margin?num(this,"margin"+tl)+num(this,"margin"+br):0);};});})(); \ No newline at end of file From svnnotify ¡÷ sourceforge.jp Tue Dec 9 07:14:25 2008 From: svnnotify ¡÷ sourceforge.jp (svnnotify ¡÷ sourceforge.jp) Date: Tue, 09 Dec 2008 07:14:25 +0900 Subject: [pal-cvs 3792] [1527] clear float. Message-ID: <1228774465.069392.17623.nullmailer@users.sourceforge.jp> Revision: 1527 http://svn.sourceforge.jp/view?root=pal&view=rev&rev=1527 Author: shinsuke Date: 2008-12-09 07:14:24 +0900 (Tue, 09 Dec 2008) Log Message: ----------- clear float. Modified Paths: -------------- board/trunk/src/main/webapp/WEB-INF/view/message/admin/confirm.jsp board/trunk/src/main/webapp/WEB-INF/view/message/admin/edit.jsp board/trunk/src/main/webapp/WEB-INF/view/message/admin/index.jsp board/trunk/src/main/webapp/WEB-INF/view/message/view/confirm.jsp board/trunk/src/main/webapp/WEB-INF/view/message/view/edit.jsp board/trunk/src/main/webapp/WEB-INF/view/message/view/index.jsp -------------- next part -------------- Modified: board/trunk/src/main/webapp/WEB-INF/view/message/admin/confirm.jsp =================================================================== --- board/trunk/src/main/webapp/WEB-INF/view/message/admin/confirm.jsp 2008-12-08 13:15:04 UTC (rev 1526) +++ board/trunk/src/main/webapp/WEB-INF/view/message/admin/confirm.jsp 2008-12-08 22:14:24 UTC (rev 1527) @@ -201,6 +201,7 @@
+
Modified: board/trunk/src/main/webapp/WEB-INF/view/message/admin/edit.jsp =================================================================== --- board/trunk/src/main/webapp/WEB-INF/view/message/admin/edit.jsp 2008-12-08 13:15:04 UTC (rev 1526) +++ board/trunk/src/main/webapp/WEB-INF/view/message/admin/edit.jsp 2008-12-08 22:14:24 UTC (rev 1527) @@ -155,6 +155,7 @@ +
Modified: board/trunk/src/main/webapp/WEB-INF/view/message/admin/index.jsp =================================================================== --- board/trunk/src/main/webapp/WEB-INF/view/message/admin/index.jsp 2008-12-08 13:15:04 UTC (rev 1526) +++ board/trunk/src/main/webapp/WEB-INF/view/message/admin/index.jsp 2008-12-08 22:14:24 UTC (rev 1527) @@ -116,6 +116,7 @@ +
Modified: board/trunk/src/main/webapp/WEB-INF/view/message/view/confirm.jsp =================================================================== --- board/trunk/src/main/webapp/WEB-INF/view/message/view/confirm.jsp 2008-12-08 13:15:04 UTC (rev 1526) +++ board/trunk/src/main/webapp/WEB-INF/view/message/view/confirm.jsp 2008-12-08 22:14:24 UTC (rev 1527) @@ -201,6 +201,7 @@ +
Modified: board/trunk/src/main/webapp/WEB-INF/view/message/view/edit.jsp =================================================================== --- board/trunk/src/main/webapp/WEB-INF/view/message/view/edit.jsp 2008-12-08 13:15:04 UTC (rev 1526) +++ board/trunk/src/main/webapp/WEB-INF/view/message/view/edit.jsp 2008-12-08 22:14:24 UTC (rev 1527) @@ -155,6 +155,7 @@ +
Modified: board/trunk/src/main/webapp/WEB-INF/view/message/view/index.jsp =================================================================== --- board/trunk/src/main/webapp/WEB-INF/view/message/view/index.jsp 2008-12-08 13:15:04 UTC (rev 1526) +++ board/trunk/src/main/webapp/WEB-INF/view/message/view/index.jsp 2008-12-08 22:14:24 UTC (rev 1527) @@ -118,6 +118,7 @@ +
From svnnotify ¡÷ sourceforge.jp Tue Dec 9 07:14:56 2008 From: svnnotify ¡÷ sourceforge.jp (svnnotify ¡÷ sourceforge.jp) Date: Tue, 09 Dec 2008 07:14:56 +0900 Subject: [pal-cvs 3793] [1528] clear float. Message-ID: <1228774496.407484.17801.nullmailer@users.sourceforge.jp> Revision: 1528 http://svn.sourceforge.jp/view?root=pal&view=rev&rev=1528 Author: shinsuke Date: 2008-12-09 07:14:56 +0900 (Tue, 09 Dec 2008) Log Message: ----------- clear float. Modified Paths: -------------- bookmark/trunk/src/main/webapp/WEB-INF/view/user/link/confirm.jsp bookmark/trunk/src/main/webapp/WEB-INF/view/user/link/edit.jsp bookmark/trunk/src/main/webapp/WEB-INF/view/user/link/index.jsp -------------- next part -------------- Modified: bookmark/trunk/src/main/webapp/WEB-INF/view/user/link/confirm.jsp =================================================================== --- bookmark/trunk/src/main/webapp/WEB-INF/view/user/link/confirm.jsp 2008-12-08 22:14:24 UTC (rev 1527) +++ bookmark/trunk/src/main/webapp/WEB-INF/view/user/link/confirm.jsp 2008-12-08 22:14:56 UTC (rev 1528) @@ -128,6 +128,7 @@ +
Modified: bookmark/trunk/src/main/webapp/WEB-INF/view/user/link/edit.jsp =================================================================== --- bookmark/trunk/src/main/webapp/WEB-INF/view/user/link/edit.jsp 2008-12-08 22:14:24 UTC (rev 1527) +++ bookmark/trunk/src/main/webapp/WEB-INF/view/user/link/edit.jsp 2008-12-08 22:14:56 UTC (rev 1528) @@ -113,6 +113,7 @@ +
Modified: bookmark/trunk/src/main/webapp/WEB-INF/view/user/link/index.jsp =================================================================== --- bookmark/trunk/src/main/webapp/WEB-INF/view/user/link/index.jsp 2008-12-08 22:14:24 UTC (rev 1527) +++ bookmark/trunk/src/main/webapp/WEB-INF/view/user/link/index.jsp 2008-12-08 22:14:56 UTC (rev 1528) @@ -132,6 +132,7 @@ +
From svnnotify ¡÷ sourceforge.jp Tue Dec 9 07:15:16 2008 From: svnnotify ¡÷ sourceforge.jp (svnnotify ¡÷ sourceforge.jp) Date: Tue, 09 Dec 2008 07:15:16 +0900 Subject: [pal-cvs 3794] [1529] clear float. Message-ID: <1228774516.005660.18014.nullmailer@users.sourceforge.jp> Revision: 1529 http://svn.sourceforge.jp/view?root=pal&view=rev&rev=1529 Author: shinsuke Date: 2008-12-09 07:15:15 +0900 (Tue, 09 Dec 2008) Log Message: ----------- clear float. Modified Paths: -------------- notepad/trunk/src/main/webapp/WEB-INF/view/user/notepad/confirm.jsp notepad/trunk/src/main/webapp/WEB-INF/view/user/notepad/edit.jsp notepad/trunk/src/main/webapp/WEB-INF/view/user/notepad/index.jsp -------------- next part -------------- Modified: notepad/trunk/src/main/webapp/WEB-INF/view/user/notepad/confirm.jsp =================================================================== --- notepad/trunk/src/main/webapp/WEB-INF/view/user/notepad/confirm.jsp 2008-12-08 22:14:56 UTC (rev 1528) +++ notepad/trunk/src/main/webapp/WEB-INF/view/user/notepad/confirm.jsp 2008-12-08 22:15:15 UTC (rev 1529) @@ -114,6 +114,7 @@ +
Modified: notepad/trunk/src/main/webapp/WEB-INF/view/user/notepad/edit.jsp =================================================================== --- notepad/trunk/src/main/webapp/WEB-INF/view/user/notepad/edit.jsp 2008-12-08 22:14:56 UTC (rev 1528) +++ notepad/trunk/src/main/webapp/WEB-INF/view/user/notepad/edit.jsp 2008-12-08 22:15:15 UTC (rev 1529) @@ -98,6 +98,7 @@ +
Modified: notepad/trunk/src/main/webapp/WEB-INF/view/user/notepad/index.jsp =================================================================== --- notepad/trunk/src/main/webapp/WEB-INF/view/user/notepad/index.jsp 2008-12-08 22:14:56 UTC (rev 1528) +++ notepad/trunk/src/main/webapp/WEB-INF/view/user/notepad/index.jsp 2008-12-08 22:15:15 UTC (rev 1529) @@ -140,6 +140,7 @@ +
From svnnotify ¡÷ sourceforge.jp Tue Dec 9 07:15:36 2008 From: svnnotify ¡÷ sourceforge.jp (svnnotify ¡÷ sourceforge.jp) Date: Tue, 09 Dec 2008 07:15:36 +0900 Subject: [pal-cvs 3795] [1530] clear float. Message-ID: <1228774536.967237.18122.nullmailer@users.sourceforge.jp> Revision: 1530 http://svn.sourceforge.jp/view?root=pal&view=rev&rev=1530 Author: shinsuke Date: 2008-12-09 07:15:36 +0900 (Tue, 09 Dec 2008) Log Message: ----------- clear float. Modified Paths: -------------- userinfo/trunk/src/main/webapp/WEB-INF/view/userInfo/grouplist.jsp userinfo/trunk/src/main/webapp/WEB-INF/view/userInfo/rolelist.jsp -------------- next part -------------- Modified: userinfo/trunk/src/main/webapp/WEB-INF/view/userInfo/grouplist.jsp =================================================================== --- userinfo/trunk/src/main/webapp/WEB-INF/view/userInfo/grouplist.jsp 2008-12-08 22:15:15 UTC (rev 1529) +++ userinfo/trunk/src/main/webapp/WEB-INF/view/userInfo/grouplist.jsp 2008-12-08 22:15:36 UTC (rev 1530) @@ -125,7 +125,7 @@ - +
Modified: userinfo/trunk/src/main/webapp/WEB-INF/view/userInfo/rolelist.jsp =================================================================== --- userinfo/trunk/src/main/webapp/WEB-INF/view/userInfo/rolelist.jsp 2008-12-08 22:15:15 UTC (rev 1529) +++ userinfo/trunk/src/main/webapp/WEB-INF/view/userInfo/rolelist.jsp 2008-12-08 22:15:36 UTC (rev 1530) @@ -125,7 +125,7 @@ - +
From svnnotify ¡÷ sourceforge.jp Tue Dec 9 08:39:55 2008 From: svnnotify ¡÷ sourceforge.jp (svnnotify ¡÷ sourceforge.jp) Date: Tue, 09 Dec 2008 08:39:55 +0900 Subject: [pal-cvs 3796] [1531] clear float. Message-ID: <1228779595.396810.26425.nullmailer@users.sourceforge.jp> Revision: 1531 http://svn.sourceforge.jp/view?root=pal&view=rev&rev=1531 Author: shinsuke Date: 2008-12-09 08:39:55 +0900 (Tue, 09 Dec 2008) Log Message: ----------- clear float. Modified Paths: -------------- scheduler/trunk/src/main/webapp/WEB-INF/view/admin/schedule/onetimeSchedule/facilitylist.jsp scheduler/trunk/src/main/webapp/WEB-INF/view/admin/schedule/onetimeSchedule/userlist.jsp scheduler/trunk/src/main/webapp/WEB-INF/view/admin/schedule/repeatSchedule/facilitylist.jsp scheduler/trunk/src/main/webapp/WEB-INF/view/admin/schedule/repeatSchedule/userlist.jsp scheduler/trunk/src/main/webapp/WEB-INF/view/user/facility/onetimeSchedule/facilitylist.jsp scheduler/trunk/src/main/webapp/WEB-INF/view/user/facility/onetimeSchedule/userlist.jsp scheduler/trunk/src/main/webapp/WEB-INF/view/user/facility/repeatSchedule/facilitylist.jsp scheduler/trunk/src/main/webapp/WEB-INF/view/user/facility/repeatSchedule/userlist.jsp scheduler/trunk/src/main/webapp/WEB-INF/view/user/schedule/onetimeSchedule/facilitylist.jsp scheduler/trunk/src/main/webapp/WEB-INF/view/user/schedule/onetimeSchedule/userlist.jsp scheduler/trunk/src/main/webapp/WEB-INF/view/user/schedule/repeatSchedule/facilitylist.jsp scheduler/trunk/src/main/webapp/WEB-INF/view/user/schedule/repeatSchedule/userlist.jsp -------------- next part -------------- Modified: scheduler/trunk/src/main/webapp/WEB-INF/view/admin/schedule/onetimeSchedule/facilitylist.jsp =================================================================== --- scheduler/trunk/src/main/webapp/WEB-INF/view/admin/schedule/onetimeSchedule/facilitylist.jsp 2008-12-08 22:15:36 UTC (rev 1530) +++ scheduler/trunk/src/main/webapp/WEB-INF/view/admin/schedule/onetimeSchedule/facilitylist.jsp 2008-12-08 23:39:55 UTC (rev 1531) @@ -113,7 +113,7 @@ - +
Modified: scheduler/trunk/src/main/webapp/WEB-INF/view/admin/schedule/onetimeSchedule/userlist.jsp =================================================================== --- scheduler/trunk/src/main/webapp/WEB-INF/view/admin/schedule/onetimeSchedule/userlist.jsp 2008-12-08 22:15:36 UTC (rev 1530) +++ scheduler/trunk/src/main/webapp/WEB-INF/view/admin/schedule/onetimeSchedule/userlist.jsp 2008-12-08 23:39:55 UTC (rev 1531) @@ -113,7 +113,7 @@ - +
Modified: scheduler/trunk/src/main/webapp/WEB-INF/view/admin/schedule/repeatSchedule/facilitylist.jsp =================================================================== --- scheduler/trunk/src/main/webapp/WEB-INF/view/admin/schedule/repeatSchedule/facilitylist.jsp 2008-12-08 22:15:36 UTC (rev 1530) +++ scheduler/trunk/src/main/webapp/WEB-INF/view/admin/schedule/repeatSchedule/facilitylist.jsp 2008-12-08 23:39:55 UTC (rev 1531) @@ -113,7 +113,7 @@ - +
Modified: scheduler/trunk/src/main/webapp/WEB-INF/view/admin/schedule/repeatSchedule/userlist.jsp =================================================================== --- scheduler/trunk/src/main/webapp/WEB-INF/view/admin/schedule/repeatSchedule/userlist.jsp 2008-12-08 22:15:36 UTC (rev 1530) +++ scheduler/trunk/src/main/webapp/WEB-INF/view/admin/schedule/repeatSchedule/userlist.jsp 2008-12-08 23:39:55 UTC (rev 1531) @@ -114,7 +114,7 @@ - +
Modified: scheduler/trunk/src/main/webapp/WEB-INF/view/user/facility/onetimeSchedule/facilitylist.jsp =================================================================== --- scheduler/trunk/src/main/webapp/WEB-INF/view/user/facility/onetimeSchedule/facilitylist.jsp 2008-12-08 22:15:36 UTC (rev 1530) +++ scheduler/trunk/src/main/webapp/WEB-INF/view/user/facility/onetimeSchedule/facilitylist.jsp 2008-12-08 23:39:55 UTC (rev 1531) @@ -144,7 +144,7 @@ - +
Modified: scheduler/trunk/src/main/webapp/WEB-INF/view/user/facility/onetimeSchedule/userlist.jsp =================================================================== --- scheduler/trunk/src/main/webapp/WEB-INF/view/user/facility/onetimeSchedule/userlist.jsp 2008-12-08 22:15:36 UTC (rev 1530) +++ scheduler/trunk/src/main/webapp/WEB-INF/view/user/facility/onetimeSchedule/userlist.jsp 2008-12-08 23:39:55 UTC (rev 1531) @@ -144,7 +144,7 @@ - +
Modified: scheduler/trunk/src/main/webapp/WEB-INF/view/user/facility/repeatSchedule/facilitylist.jsp =================================================================== --- scheduler/trunk/src/main/webapp/WEB-INF/view/user/facility/repeatSchedule/facilitylist.jsp 2008-12-08 22:15:36 UTC (rev 1530) +++ scheduler/trunk/src/main/webapp/WEB-INF/view/user/facility/repeatSchedule/facilitylist.jsp 2008-12-08 23:39:55 UTC (rev 1531) @@ -144,7 +144,7 @@ - +
Modified: scheduler/trunk/src/main/webapp/WEB-INF/view/user/facility/repeatSchedule/userlist.jsp =================================================================== --- scheduler/trunk/src/main/webapp/WEB-INF/view/user/facility/repeatSchedule/userlist.jsp 2008-12-08 22:15:36 UTC (rev 1530) +++ scheduler/trunk/src/main/webapp/WEB-INF/view/user/facility/repeatSchedule/userlist.jsp 2008-12-08 23:39:55 UTC (rev 1531) @@ -145,7 +145,7 @@ - +
Modified: scheduler/trunk/src/main/webapp/WEB-INF/view/user/schedule/onetimeSchedule/facilitylist.jsp =================================================================== --- scheduler/trunk/src/main/webapp/WEB-INF/view/user/schedule/onetimeSchedule/facilitylist.jsp 2008-12-08 22:15:36 UTC (rev 1530) +++ scheduler/trunk/src/main/webapp/WEB-INF/view/user/schedule/onetimeSchedule/facilitylist.jsp 2008-12-08 23:39:55 UTC (rev 1531) @@ -143,7 +143,7 @@ - +
Modified: scheduler/trunk/src/main/webapp/WEB-INF/view/user/schedule/onetimeSchedule/userlist.jsp =================================================================== --- scheduler/trunk/src/main/webapp/WEB-INF/view/user/schedule/onetimeSchedule/userlist.jsp 2008-12-08 22:15:36 UTC (rev 1530) +++ scheduler/trunk/src/main/webapp/WEB-INF/view/user/schedule/onetimeSchedule/userlist.jsp 2008-12-08 23:39:55 UTC (rev 1531) @@ -143,7 +143,7 @@ - +
Modified: scheduler/trunk/src/main/webapp/WEB-INF/view/user/schedule/repeatSchedule/facilitylist.jsp =================================================================== --- scheduler/trunk/src/main/webapp/WEB-INF/view/user/schedule/repeatSchedule/facilitylist.jsp 2008-12-08 22:15:36 UTC (rev 1530) +++ scheduler/trunk/src/main/webapp/WEB-INF/view/user/schedule/repeatSchedule/facilitylist.jsp 2008-12-08 23:39:55 UTC (rev 1531) @@ -143,7 +143,7 @@ - +
Modified: scheduler/trunk/src/main/webapp/WEB-INF/view/user/schedule/repeatSchedule/userlist.jsp =================================================================== --- scheduler/trunk/src/main/webapp/WEB-INF/view/user/schedule/repeatSchedule/userlist.jsp 2008-12-08 22:15:36 UTC (rev 1530) +++ scheduler/trunk/src/main/webapp/WEB-INF/view/user/schedule/repeatSchedule/userlist.jsp 2008-12-08 23:39:55 UTC (rev 1531) @@ -144,7 +144,7 @@ - +
From svnnotify ¡÷ sourceforge.jp Tue Dec 9 09:39:56 2008 From: svnnotify ¡÷ sourceforge.jp (svnnotify ¡÷ sourceforge.jp) Date: Tue, 09 Dec 2008 09:39:56 +0900 Subject: [pal-cvs 3797] [1532] accepted css files. Message-ID: <1228783196.483456.16352.nullmailer@users.sourceforge.jp> Revision: 1532 http://svn.sourceforge.jp/view?root=pal&view=rev&rev=1532 Author: shinsuke Date: 2008-12-09 09:39:56 +0900 (Tue, 09 Dec 2008) Log Message: ----------- accepted css files. Modified Paths: -------------- board/trunk/src/main/webapp/WEB-INF/web.xml -------------- next part -------------- Modified: board/trunk/src/main/webapp/WEB-INF/web.xml =================================================================== --- board/trunk/src/main/webapp/WEB-INF/web.xml 2008-12-08 23:39:55 UTC (rev 1531) +++ board/trunk/src/main/webapp/WEB-INF/web.xml 2008-12-09 00:39:56 UTC (rev 1532) @@ -65,7 +65,7 @@ jp.sf.pal.board.common.filter.SecurityConstraintFilter acceptUrlPaths - /message/view/download/.* + /message/view/download/.*,/css/.* From svnnotify ¡÷ sourceforge.jp Tue Dec 9 09:54:05 2008 From: svnnotify ¡÷ sourceforge.jp (svnnotify ¡÷ sourceforge.jp) Date: Tue, 09 Dec 2008 09:54:05 +0900 Subject: [pal-cvs 3798] [1533] changed title because liferay uses it at menus.. Message-ID: <1228784045.181060.29336.nullmailer@users.sourceforge.jp> Revision: 1533 http://svn.sourceforge.jp/view?root=pal&view=rev&rev=1533 Author: shinsuke Date: 2008-12-09 09:54:05 +0900 (Tue, 09 Dec 2008) Log Message: ----------- changed title because liferay uses it at menus.. Modified Paths: -------------- board/trunk/src/main/resources/jp/sf/pal/board/resources/CategoryEdit_en.properties board/trunk/src/main/resources/jp/sf/pal/board/resources/CategoryEdit_ja.properties -------------- next part -------------- Modified: board/trunk/src/main/resources/jp/sf/pal/board/resources/CategoryEdit_en.properties =================================================================== --- board/trunk/src/main/resources/jp/sf/pal/board/resources/CategoryEdit_en.properties 2008-12-09 00:39:56 UTC (rev 1532) +++ board/trunk/src/main/resources/jp/sf/pal/board/resources/CategoryEdit_en.properties 2008-12-09 00:54:05 UTC (rev 1533) @@ -1,4 +1,4 @@ # portlet info -javax.portlet.title=Category Editor +javax.portlet.title=Board Category Editor javax.portlet.short-title=Editor javax.portlet.keywords=Message Board,Management,Groupware Modified: board/trunk/src/main/resources/jp/sf/pal/board/resources/CategoryEdit_ja.properties =================================================================== --- board/trunk/src/main/resources/jp/sf/pal/board/resources/CategoryEdit_ja.properties 2008-12-09 00:39:56 UTC (rev 1532) +++ board/trunk/src/main/resources/jp/sf/pal/board/resources/CategoryEdit_ja.properties 2008-12-09 00:54:05 UTC (rev 1533) @@ -1,4 +1,4 @@ # portlet info -javax.portlet.title=\u30ab\u30c6\u30b4\u30ea\u7ba1\u7406 +javax.portlet.title=\u63b2\u793a\u677f\u30ab\u30c6\u30b4\u30ea\u7ba1\u7406 javax.portlet.short-title=\u30ab\u30c6\u30b4\u30ea\u7ba1\u7406 javax.portlet.keywords=\u7ba1\u7406 From svnnotify ¡÷ sourceforge.jp Tue Dec 9 09:54:26 2008 From: svnnotify ¡÷ sourceforge.jp (svnnotify ¡÷ sourceforge.jp) Date: Tue, 09 Dec 2008 09:54:26 +0900 Subject: [pal-cvs 3799] [1534] updated translation. Message-ID: <1228784066.154349.29441.nullmailer@users.sourceforge.jp> Revision: 1534 http://svn.sourceforge.jp/view?root=pal&view=rev&rev=1534 Author: shinsuke Date: 2008-12-09 09:54:25 +0900 (Tue, 09 Dec 2008) Log Message: ----------- updated translation. Modified Paths: -------------- board/trunk/src/main/resources/application_ja.properties -------------- next part -------------- Modified: board/trunk/src/main/resources/application_ja.properties =================================================================== --- board/trunk/src/main/resources/application_ja.properties 2008-12-09 00:54:05 UTC (rev 1533) +++ board/trunk/src/main/resources/application_ja.properties 2008-12-09 00:54:25 UTC (rev 1534) @@ -128,7 +128,7 @@ labels.role_prefix=\u30ed\u30fc\u30eb: labels.group_prefix=\u30b0\u30eb\u30fc\u30d7: -labels.content=\u30b3\u30f3\u30c6\u30f3\u30c8 +labels.content=\u5185\u5bb9 labels.displayName=\u8868\u793a\u540d labels.endTimeForTime=\u7d42\u4e86\u6642\u523b labels.memo=\u30e1\u30e2 From svnnotify ¡÷ sourceforge.jp Tue Dec 9 10:07:51 2008 From: svnnotify ¡÷ sourceforge.jp (svnnotify ¡÷ sourceforge.jp) Date: Tue, 09 Dec 2008 10:07:51 +0900 Subject: [pal-cvs 3800] [1535] set a default minutes. Message-ID: <1228784871.049676.7278.nullmailer@users.sourceforge.jp> Revision: 1535 http://svn.sourceforge.jp/view?root=pal&view=rev&rev=1535 Author: shinsuke Date: 2008-12-09 10:07:50 +0900 (Tue, 09 Dec 2008) Log Message: ----------- set a default minutes. Modified Paths: -------------- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/form/user/facility/OnetimeScheduleForm.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/form/user/facility/RepeatScheduleForm.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/form/user/schedule/OnetimeScheduleForm.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/form/user/schedule/RepeatScheduleForm.java -------------- next part -------------- Modified: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/form/user/facility/OnetimeScheduleForm.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/form/user/facility/OnetimeScheduleForm.java 2008-12-09 00:54:25 UTC (rev 1534) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/form/user/facility/OnetimeScheduleForm.java 2008-12-09 01:07:50 UTC (rev 1535) @@ -257,6 +257,11 @@ } public String getStartTime() { + if (!StringUtils.isEmpty(startTimeH) && StringUtils.isEmpty(startTimeM)) { + // set default minutes + startTimeM = "00"; + } + if (!StringUtils.isEmpty(startTimeH) && !StringUtils.isEmpty(startTimeM)) { StringBuilder buf = new StringBuilder(startTimeH); @@ -281,6 +286,11 @@ } public String getEndTime() { + if (!StringUtils.isEmpty(endTimeH) && StringUtils.isEmpty(endTimeM)) { + // set default minutes + endTimeM = "00"; + } + if (!StringUtils.isEmpty(endTimeH) && !StringUtils.isEmpty(endTimeM)) { StringBuilder buf = new StringBuilder(endTimeH); buf.append(":"); Modified: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/form/user/facility/RepeatScheduleForm.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/form/user/facility/RepeatScheduleForm.java 2008-12-09 00:54:25 UTC (rev 1534) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/form/user/facility/RepeatScheduleForm.java 2008-12-09 01:07:50 UTC (rev 1535) @@ -258,6 +258,11 @@ } public String getStartTime() { + if (!StringUtils.isEmpty(startTimeH) && StringUtils.isEmpty(startTimeM)) { + // set default minutes + startTimeM = "00"; + } + if (!StringUtils.isEmpty(startTimeH) && !StringUtils.isEmpty(startTimeM)) { StringBuilder buf = new StringBuilder(startTimeH); @@ -282,6 +287,11 @@ } public String getEndTime() { + if (!StringUtils.isEmpty(endTimeH) && StringUtils.isEmpty(endTimeM)) { + // set default minutes + endTimeM = "00"; + } + if (!StringUtils.isEmpty(endTimeH) && !StringUtils.isEmpty(endTimeM)) { StringBuilder buf = new StringBuilder(endTimeH); buf.append(":"); Modified: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/form/user/schedule/OnetimeScheduleForm.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/form/user/schedule/OnetimeScheduleForm.java 2008-12-09 00:54:25 UTC (rev 1534) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/form/user/schedule/OnetimeScheduleForm.java 2008-12-09 01:07:50 UTC (rev 1535) @@ -254,6 +254,11 @@ } public String getStartTime() { + if (!StringUtils.isEmpty(startTimeH) && StringUtils.isEmpty(startTimeM)) { + // set default minutes + startTimeM = "00"; + } + if (!StringUtils.isEmpty(startTimeH) && !StringUtils.isEmpty(startTimeM)) { StringBuilder buf = new StringBuilder(startTimeH); @@ -278,6 +283,11 @@ } public String getEndTime() { + if (!StringUtils.isEmpty(endTimeH) && StringUtils.isEmpty(endTimeM)) { + // set default minutes + endTimeM = "00"; + } + if (!StringUtils.isEmpty(endTimeH) && !StringUtils.isEmpty(endTimeM)) { StringBuilder buf = new StringBuilder(endTimeH); buf.append(":"); Modified: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/form/user/schedule/RepeatScheduleForm.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/form/user/schedule/RepeatScheduleForm.java 2008-12-09 00:54:25 UTC (rev 1534) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/form/user/schedule/RepeatScheduleForm.java 2008-12-09 01:07:50 UTC (rev 1535) @@ -252,6 +252,11 @@ } public String getStartTime() { + if (!StringUtils.isEmpty(startTimeH) && StringUtils.isEmpty(startTimeM)) { + // set default minutes + startTimeM = "00"; + } + if (!StringUtils.isEmpty(startTimeH) && !StringUtils.isEmpty(startTimeM)) { StringBuilder buf = new StringBuilder(startTimeH); @@ -276,6 +281,11 @@ } public String getEndTime() { + if (!StringUtils.isEmpty(endTimeH) && StringUtils.isEmpty(endTimeM)) { + // set default minutes + endTimeM = "00"; + } + if (!StringUtils.isEmpty(endTimeH) && !StringUtils.isEmpty(endTimeM)) { StringBuilder buf = new StringBuilder(endTimeH); buf.append(":"); From svnnotify ¡÷ sourceforge.jp Tue Dec 9 10:08:11 2008 From: svnnotify ¡÷ sourceforge.jp (svnnotify ¡÷ sourceforge.jp) Date: Tue, 09 Dec 2008 10:08:11 +0900 Subject: [pal-cvs 3801] [1536] added width. Message-ID: <1228784891.815184.8895.nullmailer@users.sourceforge.jp> Revision: 1536 http://svn.sourceforge.jp/view?root=pal&view=rev&rev=1536 Author: shinsuke Date: 2008-12-09 10:08:11 +0900 (Tue, 09 Dec 2008) Log Message: ----------- added width. Modified Paths: -------------- scheduler/trunk/src/main/webapp/WEB-INF/view/admin/facility/facility/edit.jsp -------------- next part -------------- Modified: scheduler/trunk/src/main/webapp/WEB-INF/view/admin/facility/facility/edit.jsp =================================================================== --- scheduler/trunk/src/main/webapp/WEB-INF/view/admin/facility/facility/edit.jsp 2008-12-09 01:07:50 UTC (rev 1535) +++ scheduler/trunk/src/main/webapp/WEB-INF/view/admin/facility/facility/edit.jsp 2008-12-09 01:08:11 UTC (rev 1536) @@ -59,7 +59,7 @@
+ @@ -138,6 +139,7 @@
+ @@ -165,6 +167,7 @@
+
+ @@ -145,6 +146,7 @@ + @@ -172,6 +174,7 @@
+
+ @@ -145,6 +146,7 @@
+ @@ -172,6 +174,7 @@
+
+ @@ -152,6 +153,7 @@ + @@ -179,6 +181,7 @@
+
+
Modified: timecard/trunk/src/main/webapp/WEB-INF/view/employee/index.jsp =================================================================== --- timecard/trunk/src/main/webapp/WEB-INF/view/employee/index.jsp 2008-12-09 04:29:35 UTC (rev 1570) +++ timecard/trunk/src/main/webapp/WEB-INF/view/employee/index.jsp 2008-12-09 04:30:13 UTC (rev 1571) @@ -175,6 +175,7 @@
+
Modified: timecard/trunk/src/main/webapp/WEB-INF/view/manager/timecard/index.jsp =================================================================== --- timecard/trunk/src/main/webapp/WEB-INF/view/manager/timecard/index.jsp 2008-12-09 04:29:35 UTC (rev 1570) +++ timecard/trunk/src/main/webapp/WEB-INF/view/manager/timecard/index.jsp 2008-12-09 04:30:13 UTC (rev 1571) @@ -198,6 +198,7 @@
+
From svnnotify ¡÷ sourceforge.jp Tue Dec 9 13:30:29 2008 From: svnnotify ¡÷ sourceforge.jp (svnnotify ¡÷ sourceforge.jp) Date: Tue, 09 Dec 2008 13:30:29 +0900 Subject: [pal-cvs 3837] [1572] 1.0-PR1 Message-ID: <1228797029.502597.14767.nullmailer@users.sourceforge.jp> Revision: 1572 http://svn.sourceforge.jp/view?root=pal&view=rev&rev=1572 Author: shinsuke Date: 2008-12-09 13:30:29 +0900 (Tue, 09 Dec 2008) Log Message: ----------- 1.0-PR1 Modified Paths: -------------- timecard/trunk/pom.xml -------------- next part -------------- Modified: timecard/trunk/pom.xml =================================================================== --- timecard/trunk/pom.xml 2008-12-09 04:30:13 UTC (rev 1571) +++ timecard/trunk/pom.xml 2008-12-09 04:30:29 UTC (rev 1572) @@ -3,7 +3,7 @@ 4.0.0 jp.sf.pal timecard - 1.0-SNAPSHOT + 1.0-PR1 war Timecard From svnnotify ¡÷ sourceforge.jp Tue Dec 9 13:30:50 2008 From: svnnotify ¡÷ sourceforge.jp (svnnotify ¡÷ sourceforge.jp) Date: Tue, 09 Dec 2008 13:30:50 +0900 Subject: [pal-cvs 3838] [1573] created branches. Message-ID: <1228797050.468844.14897.nullmailer@users.sourceforge.jp> Revision: 1573 http://svn.sourceforge.jp/view?root=pal&view=rev&rev=1573 Author: shinsuke Date: 2008-12-09 13:30:50 +0900 (Tue, 09 Dec 2008) Log Message: ----------- created branches. Added Paths: ----------- timecard/branches/ -------------- next part -------------- From svnnotify ¡÷ sourceforge.jp Tue Dec 9 13:31:08 2008 From: svnnotify ¡÷ sourceforge.jp (svnnotify ¡÷ sourceforge.jp) Date: Tue, 09 Dec 2008 13:31:08 +0900 Subject: [pal-cvs 3839] [1574] 1.0-PR1 Message-ID: <1228797068.670467.15031.nullmailer@users.sourceforge.jp> Revision: 1574 http://svn.sourceforge.jp/view?root=pal&view=rev&rev=1574 Author: shinsuke Date: 2008-12-09 13:31:08 +0900 (Tue, 09 Dec 2008) Log Message: ----------- 1.0-PR1 Added Paths: ----------- timecard/branches/timecard-1.0-PR1/ -------------- next part -------------- Copied: timecard/branches/timecard-1.0-PR1 (from rev 1573, timecard/trunk) From svnnotify ¡÷ sourceforge.jp Tue Dec 9 13:31:19 2008 From: svnnotify ¡÷ sourceforge.jp (svnnotify ¡÷ sourceforge.jp) Date: Tue, 09 Dec 2008 13:31:19 +0900 Subject: [pal-cvs 3840] [1575] 1.0-PR2-SNAPSHOT Message-ID: <1228797079.238143.15112.nullmailer@users.sourceforge.jp> Revision: 1575 http://svn.sourceforge.jp/view?root=pal&view=rev&rev=1575 Author: shinsuke Date: 2008-12-09 13:31:19 +0900 (Tue, 09 Dec 2008) Log Message: ----------- 1.0-PR2-SNAPSHOT Modified Paths: -------------- timecard/trunk/pom.xml -------------- next part -------------- Modified: timecard/trunk/pom.xml =================================================================== --- timecard/trunk/pom.xml 2008-12-09 04:31:08 UTC (rev 1574) +++ timecard/trunk/pom.xml 2008-12-09 04:31:19 UTC (rev 1575) @@ -3,7 +3,7 @@ 4.0.0 jp.sf.pal timecard - 1.0-PR1 + 1.0-PR2-SNAPSHOT war Timecard From svnnotify ¡÷ sourceforge.jp Tue Dec 9 13:31:40 2008 From: svnnotify ¡÷ sourceforge.jp (svnnotify ¡÷ sourceforge.jp) Date: Tue, 09 Dec 2008 13:31:40 +0900 Subject: [pal-cvs 3841] [1576] 1.0-PR1 Message-ID: <1228797100.935928.15334.nullmailer@users.sourceforge.jp> Revision: 1576 http://svn.sourceforge.jp/view?root=pal&view=rev&rev=1576 Author: shinsuke Date: 2008-12-09 13:31:40 +0900 (Tue, 09 Dec 2008) Log Message: ----------- 1.0-PR1 Modified Paths: -------------- todolist/trunk/pom.xml -------------- next part -------------- Modified: todolist/trunk/pom.xml =================================================================== --- todolist/trunk/pom.xml 2008-12-09 04:31:19 UTC (rev 1575) +++ todolist/trunk/pom.xml 2008-12-09 04:31:40 UTC (rev 1576) @@ -3,7 +3,7 @@ 4.0.0 jp.sf.pal todolist - 1.0-SNAPSHOT + 1.0-PR1 war ToDo List From svnnotify ¡÷ sourceforge.jp Tue Dec 9 13:32:18 2008 From: svnnotify ¡÷ sourceforge.jp (svnnotify ¡÷ sourceforge.jp) Date: Tue, 09 Dec 2008 13:32:18 +0900 Subject: [pal-cvs 3842] [1577] created todolist Message-ID: <1228797138.032022.16408.nullmailer@users.sourceforge.jp> Revision: 1577 http://svn.sourceforge.jp/view?root=pal&view=rev&rev=1577 Author: shinsuke Date: 2008-12-09 13:32:17 +0900 (Tue, 09 Dec 2008) Log Message: ----------- created todolist Added Paths: ----------- todolist/branches/ -------------- next part -------------- From svnnotify ¡÷ sourceforge.jp Tue Dec 9 13:32:32 2008 From: svnnotify ¡÷ sourceforge.jp (svnnotify ¡÷ sourceforge.jp) Date: Tue, 09 Dec 2008 13:32:32 +0900 Subject: [pal-cvs 3843] [1578] 1.0-PR1 Message-ID: <1228797152.922664.16496.nullmailer@users.sourceforge.jp> Revision: 1578 http://svn.sourceforge.jp/view?root=pal&view=rev&rev=1578 Author: shinsuke Date: 2008-12-09 13:32:32 +0900 (Tue, 09 Dec 2008) Log Message: ----------- 1.0-PR1 Added Paths: ----------- todolist/branches/todolist-1.0-PR1/ -------------- next part -------------- Copied: todolist/branches/todolist-1.0-PR1 (from rev 1577, todolist/trunk) From svnnotify ¡÷ sourceforge.jp Tue Dec 9 13:32:45 2008 From: svnnotify ¡÷ sourceforge.jp (svnnotify ¡÷ sourceforge.jp) Date: Tue, 09 Dec 2008 13:32:45 +0900 Subject: [pal-cvs 3844] [1579] 1.0-PR2-SNAPSHOT Message-ID: <1228797165.376098.16593.nullmailer@users.sourceforge.jp> Revision: 1579 http://svn.sourceforge.jp/view?root=pal&view=rev&rev=1579 Author: shinsuke Date: 2008-12-09 13:32:45 +0900 (Tue, 09 Dec 2008) Log Message: ----------- 1.0-PR2-SNAPSHOT Modified Paths: -------------- todolist/trunk/pom.xml -------------- next part -------------- Modified: todolist/trunk/pom.xml =================================================================== --- todolist/trunk/pom.xml 2008-12-09 04:32:32 UTC (rev 1578) +++ todolist/trunk/pom.xml 2008-12-09 04:32:45 UTC (rev 1579) @@ -3,7 +3,7 @@ 4.0.0 jp.sf.pal todolist - 1.0-PR1 + 1.0-PR2-SNAPSHOT war ToDo List From svnnotify ¡÷ sourceforge.jp Tue Dec 9 13:33:14 2008 From: svnnotify ¡÷ sourceforge.jp (svnnotify ¡÷ sourceforge.jp) Date: Tue, 09 Dec 2008 13:33:14 +0900 Subject: [pal-cvs 3845] [1580] 1.0-PR1 Message-ID: <1228797194.956971.17446.nullmailer@users.sourceforge.jp> Revision: 1580 http://svn.sourceforge.jp/view?root=pal&view=rev&rev=1580 Author: shinsuke Date: 2008-12-09 13:33:14 +0900 (Tue, 09 Dec 2008) Log Message: ----------- 1.0-PR1 Modified Paths: -------------- userinfo/trunk/pom.xml -------------- next part -------------- Modified: userinfo/trunk/pom.xml =================================================================== --- userinfo/trunk/pom.xml 2008-12-09 04:32:45 UTC (rev 1579) +++ userinfo/trunk/pom.xml 2008-12-09 04:33:14 UTC (rev 1580) @@ -3,7 +3,7 @@ 4.0.0 jp.sf.pal userinfo - 1.0-SNAPSHOT + 1.0-PR1 war User Info From svnnotify ¡÷ sourceforge.jp Tue Dec 9 13:33:31 2008 From: svnnotify ¡÷ sourceforge.jp (svnnotify ¡÷ sourceforge.jp) Date: Tue, 09 Dec 2008 13:33:31 +0900 Subject: [pal-cvs 3846] [1581] created branches. Message-ID: <1228797211.164857.19141.nullmailer@users.sourceforge.jp> Revision: 1581 http://svn.sourceforge.jp/view?root=pal&view=rev&rev=1581 Author: shinsuke Date: 2008-12-09 13:33:30 +0900 (Tue, 09 Dec 2008) Log Message: ----------- created branches. Added Paths: ----------- userinfo/branches/ -------------- next part -------------- From svnnotify ¡÷ sourceforge.jp Tue Dec 9 13:33:38 2008 From: svnnotify ¡÷ sourceforge.jp (svnnotify ¡÷ sourceforge.jp) Date: Tue, 09 Dec 2008 13:33:38 +0900 Subject: [pal-cvs 3847] [1582] 1.0-PR1 Message-ID: <1228797218.843632.20693.nullmailer@users.sourceforge.jp> Revision: 1582 http://svn.sourceforge.jp/view?root=pal&view=rev&rev=1582 Author: shinsuke Date: 2008-12-09 13:33:38 +0900 (Tue, 09 Dec 2008) Log Message: ----------- 1.0-PR1 Added Paths: ----------- userinfo/branches/userinfo-1.0-PR1/ -------------- next part -------------- Copied: userinfo/branches/userinfo-1.0-PR1 (from rev 1581, userinfo/trunk) From svnnotify ¡÷ sourceforge.jp Tue Dec 9 13:33:53 2008 From: svnnotify ¡÷ sourceforge.jp (svnnotify ¡÷ sourceforge.jp) Date: Tue, 09 Dec 2008 13:33:53 +0900 Subject: [pal-cvs 3848] [1583] 1.0-PR2-SNAPSHOT Message-ID: <1228797233.792053.21708.nullmailer@users.sourceforge.jp> Revision: 1583 http://svn.sourceforge.jp/view?root=pal&view=rev&rev=1583 Author: shinsuke Date: 2008-12-09 13:33:53 +0900 (Tue, 09 Dec 2008) Log Message: ----------- 1.0-PR2-SNAPSHOT Modified Paths: -------------- userinfo/trunk/pom.xml -------------- next part -------------- Modified: userinfo/trunk/pom.xml =================================================================== --- userinfo/trunk/pom.xml 2008-12-09 04:33:38 UTC (rev 1582) +++ userinfo/trunk/pom.xml 2008-12-09 04:33:53 UTC (rev 1583) @@ -3,7 +3,7 @@ 4.0.0 jp.sf.pal userinfo - 1.0-PR1 + 1.0-PR2-SNAPSHOT war User Info From svnnotify ¡÷ sourceforge.jp Tue Dec 9 13:34:24 2008 From: svnnotify ¡÷ sourceforge.jp (svnnotify ¡÷ sourceforge.jp) Date: Tue, 09 Dec 2008 13:34:24 +0900 Subject: [pal-cvs 3849] [1584] 2.0 Message-ID: <1228797264.820292.22735.nullmailer@users.sourceforge.jp> Revision: 1584 http://svn.sourceforge.jp/view?root=pal&view=rev&rev=1584 Author: shinsuke Date: 2008-12-09 13:34:24 +0900 (Tue, 09 Dec 2008) Log Message: ----------- 2.0 Modified Paths: -------------- vfs-portlets/trunk/pom.xml -------------- next part -------------- Modified: vfs-portlets/trunk/pom.xml =================================================================== --- vfs-portlets/trunk/pom.xml 2008-12-09 04:33:53 UTC (rev 1583) +++ vfs-portlets/trunk/pom.xml 2008-12-09 04:34:24 UTC (rev 1584) @@ -3,7 +3,7 @@ 4.0.0 jp.sf.pal vfs-portlets - 2.0-SNAPSHOT + 2.0 war VFS Portlet From svnnotify ¡÷ sourceforge.jp Tue Dec 9 13:37:40 2008 From: svnnotify ¡÷ sourceforge.jp (svnnotify ¡÷ sourceforge.jp) Date: Tue, 09 Dec 2008 13:37:40 +0900 Subject: [pal-cvs 3850] [1585] 2.0 Message-ID: <1228797460.977082.24974.nullmailer@users.sourceforge.jp> Revision: 1585 http://svn.sourceforge.jp/view?root=pal&view=rev&rev=1585 Author: shinsuke Date: 2008-12-09 13:37:40 +0900 (Tue, 09 Dec 2008) Log Message: ----------- 2.0 Added Paths: ----------- vfs-portlets/tags/vfs-portlets-2.0/ -------------- next part -------------- Copied: vfs-portlets/tags/vfs-portlets-2.0 (from rev 1584, vfs-portlets/trunk) From svnnotify ¡÷ sourceforge.jp Tue Dec 9 13:39:10 2008 From: svnnotify ¡÷ sourceforge.jp (svnnotify ¡÷ sourceforge.jp) Date: Tue, 09 Dec 2008 13:39:10 +0900 Subject: [pal-cvs 3851] [1586] renamed to tags. Message-ID: <1228797550.248572.26952.nullmailer@users.sourceforge.jp> Revision: 1586 http://svn.sourceforge.jp/view?root=pal&view=rev&rev=1586 Author: shinsuke Date: 2008-12-09 13:39:10 +0900 (Tue, 09 Dec 2008) Log Message: ----------- renamed to tags. Added Paths: ----------- addresslist/tags/ Removed Paths: ------------- addresslist/branches/ -------------- next part -------------- Copied: addresslist/tags (from rev 1585, addresslist/branches) From svnnotify ¡÷ sourceforge.jp Tue Dec 9 13:40:19 2008 From: svnnotify ¡÷ sourceforge.jp (svnnotify ¡÷ sourceforge.jp) Date: Tue, 09 Dec 2008 13:40:19 +0900 Subject: [pal-cvs 3852] [1587] renamed to tags. Message-ID: <1228797619.901592.28267.nullmailer@users.sourceforge.jp> Revision: 1587 http://svn.sourceforge.jp/view?root=pal&view=rev&rev=1587 Author: shinsuke Date: 2008-12-09 13:40:19 +0900 (Tue, 09 Dec 2008) Log Message: ----------- renamed to tags. Added Paths: ----------- board/tags/ Removed Paths: ------------- board/branches/ -------------- next part -------------- Copied: board/tags (from rev 1586, board/branches) From svnnotify ¡÷ sourceforge.jp Tue Dec 9 13:40:50 2008 From: svnnotify ¡÷ sourceforge.jp (svnnotify ¡÷ sourceforge.jp) Date: Tue, 09 Dec 2008 13:40:50 +0900 Subject: [pal-cvs 3853] [1588] renamed to tags. Message-ID: <1228797650.338762.28455.nullmailer@users.sourceforge.jp> Revision: 1588 http://svn.sourceforge.jp/view?root=pal&view=rev&rev=1588 Author: shinsuke Date: 2008-12-09 13:40:50 +0900 (Tue, 09 Dec 2008) Log Message: ----------- renamed to tags. Added Paths: ----------- bookmark/tags/ Removed Paths: ------------- bookmark/branches/ -------------- next part -------------- Copied: bookmark/tags (from rev 1587, bookmark/branches) From svnnotify ¡÷ sourceforge.jp Tue Dec 9 13:41:18 2008 From: svnnotify ¡÷ sourceforge.jp (svnnotify ¡÷ sourceforge.jp) Date: Tue, 09 Dec 2008 13:41:18 +0900 Subject: [pal-cvs 3854] [1589] renamed to tags. Message-ID: <1228797678.019892.28764.nullmailer@users.sourceforge.jp> Revision: 1589 http://svn.sourceforge.jp/view?root=pal&view=rev&rev=1589 Author: shinsuke Date: 2008-12-09 13:41:17 +0900 (Tue, 09 Dec 2008) Log Message: ----------- renamed to tags. Added Paths: ----------- chat/tags/ Removed Paths: ------------- chat/branches/ -------------- next part -------------- Copied: chat/tags (from rev 1588, chat/branches) From svnnotify ¡÷ sourceforge.jp Tue Dec 9 13:42:16 2008 From: svnnotify ¡÷ sourceforge.jp (svnnotify ¡÷ sourceforge.jp) Date: Tue, 09 Dec 2008 13:42:16 +0900 Subject: [pal-cvs 3855] [1590] renamed to tags. Message-ID: <1228797736.970968.29992.nullmailer@users.sourceforge.jp> Revision: 1590 http://svn.sourceforge.jp/view?root=pal&view=rev&rev=1590 Author: shinsuke Date: 2008-12-09 13:42:16 +0900 (Tue, 09 Dec 2008) Log Message: ----------- renamed to tags. Added Paths: ----------- notepad/tags/ Removed Paths: ------------- notepad/branches/ -------------- next part -------------- Copied: notepad/tags (from rev 1589, notepad/branches) From svnnotify ¡÷ sourceforge.jp Tue Dec 9 13:42:40 2008 From: svnnotify ¡÷ sourceforge.jp (svnnotify ¡÷ sourceforge.jp) Date: Tue, 09 Dec 2008 13:42:40 +0900 Subject: [pal-cvs 3856] [1591] renamed to tags. Message-ID: <1228797760.603762.30330.nullmailer@users.sourceforge.jp> Revision: 1591 http://svn.sourceforge.jp/view?root=pal&view=rev&rev=1591 Author: shinsuke Date: 2008-12-09 13:42:40 +0900 (Tue, 09 Dec 2008) Log Message: ----------- renamed to tags. Added Paths: ----------- scheduler/tags/ Removed Paths: ------------- scheduler/branches/ -------------- next part -------------- Copied: scheduler/tags (from rev 1590, scheduler/branches) From svnnotify ¡÷ sourceforge.jp Tue Dec 9 13:43:02 2008 From: svnnotify ¡÷ sourceforge.jp (svnnotify ¡÷ sourceforge.jp) Date: Tue, 09 Dec 2008 13:43:02 +0900 Subject: [pal-cvs 3857] [1592] renamed to tags. Message-ID: <1228797782.988713.30520.nullmailer@users.sourceforge.jp> Revision: 1592 http://svn.sourceforge.jp/view?root=pal&view=rev&rev=1592 Author: shinsuke Date: 2008-12-09 13:43:02 +0900 (Tue, 09 Dec 2008) Log Message: ----------- renamed to tags. Added Paths: ----------- timecard/tags/ Removed Paths: ------------- timecard/branches/ -------------- next part -------------- Copied: timecard/tags (from rev 1591, timecard/branches) From svnnotify ¡÷ sourceforge.jp Tue Dec 9 13:43:24 2008 From: svnnotify ¡÷ sourceforge.jp (svnnotify ¡÷ sourceforge.jp) Date: Tue, 09 Dec 2008 13:43:24 +0900 Subject: [pal-cvs 3858] [1593] renamed to tags. Message-ID: <1228797804.415908.31296.nullmailer@users.sourceforge.jp> Revision: 1593 http://svn.sourceforge.jp/view?root=pal&view=rev&rev=1593 Author: shinsuke Date: 2008-12-09 13:43:24 +0900 (Tue, 09 Dec 2008) Log Message: ----------- renamed to tags. Added Paths: ----------- todolist/tags/ Removed Paths: ------------- todolist/branches/ -------------- next part -------------- Copied: todolist/tags (from rev 1592, todolist/branches) From svnnotify ¡÷ sourceforge.jp Tue Dec 9 13:43:42 2008 From: svnnotify ¡÷ sourceforge.jp (svnnotify ¡÷ sourceforge.jp) Date: Tue, 09 Dec 2008 13:43:42 +0900 Subject: [pal-cvs 3859] [1594] renamed to tags. Message-ID: <1228797822.676404.31413.nullmailer@users.sourceforge.jp> Revision: 1594 http://svn.sourceforge.jp/view?root=pal&view=rev&rev=1594 Author: shinsuke Date: 2008-12-09 13:43:42 +0900 (Tue, 09 Dec 2008) Log Message: ----------- renamed to tags. Added Paths: ----------- userinfo/tags/ Removed Paths: ------------- userinfo/branches/ -------------- next part -------------- Copied: userinfo/tags (from rev 1593, userinfo/branches) From svnnotify ¡÷ sourceforge.jp Tue Dec 9 13:48:18 2008 From: svnnotify ¡÷ sourceforge.jp (svnnotify ¡÷ sourceforge.jp) Date: Tue, 09 Dec 2008 13:48:18 +0900 Subject: [pal-cvs 3860] [1595] created tags. Message-ID: <1228798098.423475.5322.nullmailer@users.sourceforge.jp> Revision: 1595 http://svn.sourceforge.jp/view?root=pal&view=rev&rev=1595 Author: shinsuke Date: 2008-12-09 13:48:18 +0900 (Tue, 09 Dec 2008) Log Message: ----------- created tags. Added Paths: ----------- netvibes-widgets/tags/ -------------- next part -------------- From svnnotify ¡÷ sourceforge.jp Tue Dec 9 13:49:05 2008 From: svnnotify ¡÷ sourceforge.jp (svnnotify ¡÷ sourceforge.jp) Date: Tue, 09 Dec 2008 13:49:05 +0900 Subject: [pal-cvs 3861] [1596] moved to tags. Message-ID: <1228798145.620887.5616.nullmailer@users.sourceforge.jp> Revision: 1596 http://svn.sourceforge.jp/view?root=pal&view=rev&rev=1596 Author: shinsuke Date: 2008-12-09 13:49:05 +0900 (Tue, 09 Dec 2008) Log Message: ----------- moved to tags. Added Paths: ----------- netvibes-widgets/tags/netvibes-widgets-1.0.1/ Removed Paths: ------------- netvibes-widgets/branches/netvibes-widgets-1.0.1/ -------------- next part -------------- Copied: netvibes-widgets/tags/netvibes-widgets-1.0.1 (from rev 1595, netvibes-widgets/branches/netvibes-widgets-1.0.1) From svnnotify ¡÷ sourceforge.jp Tue Dec 9 13:49:58 2008 From: svnnotify ¡÷ sourceforge.jp (svnnotify ¡÷ sourceforge.jp) Date: Tue, 09 Dec 2008 13:49:58 +0900 Subject: [pal-cvs 3862] [1597] created tags. Message-ID: <1228798198.307655.5915.nullmailer@users.sourceforge.jp> Revision: 1597 http://svn.sourceforge.jp/view?root=pal&view=rev&rev=1597 Author: shinsuke Date: 2008-12-09 13:49:58 +0900 (Tue, 09 Dec 2008) Log Message: ----------- created tags. Added Paths: ----------- googlegadgets/tags/ -------------- next part -------------- From svnnotify ¡÷ sourceforge.jp Tue Dec 9 13:50:34 2008 From: svnnotify ¡÷ sourceforge.jp (svnnotify ¡÷ sourceforge.jp) Date: Tue, 09 Dec 2008 13:50:34 +0900 Subject: [pal-cvs 3863] [1598] moved to tags. Message-ID: <1228798234.877254.7799.nullmailer@users.sourceforge.jp> Revision: 1598 http://svn.sourceforge.jp/view?root=pal&view=rev&rev=1598 Author: shinsuke Date: 2008-12-09 13:50:34 +0900 (Tue, 09 Dec 2008) Log Message: ----------- moved to tags. Added Paths: ----------- googlegadgets/tags/googlegadgets-1.0.1/ Removed Paths: ------------- googlegadgets/branches/googlegadgets-1.0.1/ -------------- next part -------------- Copied: googlegadgets/tags/googlegadgets-1.0.1 (from rev 1597, googlegadgets/branches/googlegadgets-1.0.1) From svnnotify ¡÷ sourceforge.jp Wed Dec 10 13:45:08 2008 From: svnnotify ¡÷ sourceforge.jp (svnnotify ¡÷ sourceforge.jp) Date: Wed, 10 Dec 2008 13:45:08 +0900 Subject: [pal-cvs 3864] [1599] patch 'r721906: fix remove listener cache bug' Message-ID: <1228884308.690304.26751.nullmailer@users.sourceforge.jp> Revision: 1599 http://svn.sourceforge.jp/view?root=pal&view=rev&rev=1599 Author: sone Date: 2008-12-10 13:45:08 +0900 (Wed, 10 Dec 2008) Log Message: ----------- patch 'r721906: fix remove listener cache bug' Modified Paths: -------------- pal-portal/branches/pal-portal-1.x/portal/jetspeed-2/components/cm/src/java/org/apache/jetspeed/cache/impl/EhCacheImpl.java pal-portal/branches/pal-portal-1.x/portal/jetspeed-2/components/file-cache/src/java/org/apache/jetspeed/cache/file/FileCache.java pal-portal/branches/pal-portal-1.x/portal/jetspeed-2/components/page-manager/src/java/org/apache/jetspeed/page/AbstractPageManager.java pal-portal/branches/pal-portal-1.x/portal/jetspeed-2/components/page-manager/src/java/org/apache/jetspeed/page/document/psml/CastorFileSystemDocumentHandler.java pal-portal/branches/pal-portal-1.x/portal/jetspeed-2/components/page-manager/src/java/org/apache/jetspeed/page/document/psml/DocumentHandlerFactoryImpl.java pal-portal/branches/pal-portal-1.x/portal/jetspeed-2/components/page-manager/src/java/org/apache/jetspeed/page/document/psml/FileSystemFolderHandler.java pal-portal/branches/pal-portal-1.x/portal/jetspeed-2/components/page-manager/src/java/org/apache/jetspeed/page/impl/DatabasePageManager.java pal-portal/branches/pal-portal-1.x/portal/jetspeed-2/components/page-manager/src/java/org/apache/jetspeed/page/psml/CastorXmlPageManager.java pal-portal/branches/pal-portal-1.x/portal/jetspeed-2/components/page-manager/src/test/org/apache/jetspeed/page/PageManagerTestShared.java pal-portal/branches/pal-portal-1.x/portal/jetspeed-2/components/page-manager/src/test/org/apache/jetspeed/page/TestCastorXmlPageManager.java pal-portal/branches/pal-portal-1.x/portal/jetspeed-2/components/page-manager/src/test/org/apache/jetspeed/page/TestCreateUserHomePagesFromRoles.java pal-portal/branches/pal-portal-1.x/portal/jetspeed-2/components/page-manager/src/test/org/apache/jetspeed/page/TestSecureCastorXmlPageManager.java pal-portal/branches/pal-portal-1.x/portal/jetspeed-2/components/page-manager/src/test/org/apache/jetspeed/page/document/psml/TestCastorFileSystemDocumentHandler.java pal-portal/branches/pal-portal-1.x/portal/jetspeed-2/jetspeed-api/src/java/org/apache/jetspeed/page/PageManager.java pal-portal/branches/pal-portal-1.x/portal/jetspeed-2/jetspeed-api/src/java/org/apache/jetspeed/page/document/DocumentHandler.java pal-portal/branches/pal-portal-1.x/portal/jetspeed-2/jetspeed-api/src/java/org/apache/jetspeed/page/document/DocumentHandlerFactory.java pal-portal/branches/pal-portal-1.x/portal/jetspeed-2/jetspeed-api/src/java/org/apache/jetspeed/page/document/FolderHandler.java -------------- next part -------------- Modified: pal-portal/branches/pal-portal-1.x/portal/jetspeed-2/components/cm/src/java/org/apache/jetspeed/cache/impl/EhCacheImpl.java =================================================================== --- pal-portal/branches/pal-portal-1.x/portal/jetspeed-2/components/cm/src/java/org/apache/jetspeed/cache/impl/EhCacheImpl.java 2008-12-09 04:50:34 UTC (rev 1598) +++ pal-portal/branches/pal-portal-1.x/portal/jetspeed-2/components/cm/src/java/org/apache/jetspeed/cache/impl/EhCacheImpl.java 2008-12-10 04:45:08 UTC (rev 1599) @@ -168,6 +168,7 @@ } }; + this.cacheEventListenersMap.put(listener, cacheEventListener); ehcache.getCacheEventNotificationService().registerListener( cacheEventListener); } @@ -176,7 +177,7 @@ boolean local) { CacheEventListener cacheEventListener = this.cacheEventListenersMap - .get(listener); + .remove(listener); if (cacheEventListener != null) ehcache.getCacheEventNotificationService().unregisterListener( Modified: pal-portal/branches/pal-portal-1.x/portal/jetspeed-2/components/file-cache/src/java/org/apache/jetspeed/cache/file/FileCache.java =================================================================== --- pal-portal/branches/pal-portal-1.x/portal/jetspeed-2/components/file-cache/src/java/org/apache/jetspeed/cache/file/FileCache.java 2008-12-09 04:50:34 UTC (rev 1598) +++ pal-portal/branches/pal-portal-1.x/portal/jetspeed-2/components/file-cache/src/java/org/apache/jetspeed/cache/file/FileCache.java 2008-12-10 04:45:08 UTC (rev 1599) @@ -20,7 +20,9 @@ import java.io.File; import java.io.FileNotFoundException; import java.util.Date; +import java.util.Hashtable; import java.util.List; +import java.util.Map; import jp.sf.pal.portal.logging.Log; import jp.sf.pal.portal.logging.LogFactory; @@ -48,6 +50,8 @@ private JetspeedCache cache = null; + private Map listeners = new Hashtable(); + private final static Log log = LogFactory.getLog(FileCache.class); /** @@ -231,10 +235,26 @@ } }; + listeners.put(listener, cacheEventListener); this.cache.addEventListener(cacheEventListener, true); } /** + * Remove a File Cache Event Listener + * + * @param listener the event listener + */ + public void removeListener(final FileCacheEventListener listener) + { + JetspeedCacheEventListener cacheEventListener = listeners + .remove(listener); + if (cacheEventListener != null) + { + this.cache.removeEventListener(cacheEventListener, true); + } + } + + /** * Start the file Scanner running at the current scan rate. * */ Modified: pal-portal/branches/pal-portal-1.x/portal/jetspeed-2/components/page-manager/src/java/org/apache/jetspeed/page/AbstractPageManager.java =================================================================== --- pal-portal/branches/pal-portal-1.x/portal/jetspeed-2/components/page-manager/src/java/org/apache/jetspeed/page/AbstractPageManager.java 2008-12-09 04:50:34 UTC (rev 1598) +++ pal-portal/branches/pal-portal-1.x/portal/jetspeed-2/components/page-manager/src/java/org/apache/jetspeed/page/AbstractPageManager.java 2008-12-10 04:45:08 UTC (rev 1599) @@ -873,6 +873,14 @@ // nothing to reset by default } + /* (non-Javadoc) + * @see org.apache.jetspeed.page.PageManager#shutdown() + */ + public void shutdown() + { + // nothing to shutdown by default + } + /** * notifyNewNode - notify page manager event listeners of new node event * Modified: pal-portal/branches/pal-portal-1.x/portal/jetspeed-2/components/page-manager/src/java/org/apache/jetspeed/page/document/psml/CastorFileSystemDocumentHandler.java =================================================================== --- pal-portal/branches/pal-portal-1.x/portal/jetspeed-2/components/page-manager/src/java/org/apache/jetspeed/page/document/psml/CastorFileSystemDocumentHandler.java 2008-12-09 04:50:34 UTC (rev 1598) +++ pal-portal/branches/pal-portal-1.x/portal/jetspeed-2/components/page-manager/src/java/org/apache/jetspeed/page/document/psml/CastorFileSystemDocumentHandler.java 2008-12-10 04:45:08 UTC (rev 1599) @@ -934,4 +934,13 @@ this.handlerFactory = factory; } + /* (non-Javadoc) + * @see org.apache.jetspeed.page.document.DocumentHandler#shutdown() + */ + public void shutdown() + { + // disconnect cache listener + fileCache.removeListener(this); + } + } Modified: pal-portal/branches/pal-portal-1.x/portal/jetspeed-2/components/page-manager/src/java/org/apache/jetspeed/page/document/psml/DocumentHandlerFactoryImpl.java =================================================================== --- pal-portal/branches/pal-portal-1.x/portal/jetspeed-2/components/page-manager/src/java/org/apache/jetspeed/page/document/psml/DocumentHandlerFactoryImpl.java 2008-12-09 04:50:34 UTC (rev 1598) +++ pal-portal/branches/pal-portal-1.x/portal/jetspeed-2/components/page-manager/src/java/org/apache/jetspeed/page/document/psml/DocumentHandlerFactoryImpl.java 2008-12-10 04:45:08 UTC (rev 1599) @@ -205,4 +205,17 @@ { constraintsEnabled = enabled; } + + /* (non-Javadoc) + * @see org.apache.jetspeed.page.document.DocumentHandlerFactory#shutdown() + */ + public void shutdown() + { + // propagate to handlers + Iterator handlersIter = handlers.values().iterator(); + while (handlersIter.hasNext()) + { + ((DocumentHandler) handlersIter.next()).shutdown(); + } + } } Modified: pal-portal/branches/pal-portal-1.x/portal/jetspeed-2/components/page-manager/src/java/org/apache/jetspeed/page/document/psml/FileSystemFolderHandler.java =================================================================== --- pal-portal/branches/pal-portal-1.x/portal/jetspeed-2/components/page-manager/src/java/org/apache/jetspeed/page/document/psml/FileSystemFolderHandler.java 2008-12-09 04:50:34 UTC (rev 1598) +++ pal-portal/branches/pal-portal-1.x/portal/jetspeed-2/components/page-manager/src/java/org/apache/jetspeed/page/document/psml/FileSystemFolderHandler.java 2008-12-10 04:45:08 UTC (rev 1599) @@ -701,6 +701,15 @@ } } + /* (non-Javadoc) + * @see org.apache.jetspeed.page.document.FolderHandler#shutdown() + */ + public void shutdown() + { + // disconnect cache listener + fileCache.removeListener(this); + } + /** *

* addToCache Modified: pal-portal/branches/pal-portal-1.x/portal/jetspeed-2/components/page-manager/src/java/org/apache/jetspeed/page/impl/DatabasePageManager.java =================================================================== --- pal-portal/branches/pal-portal-1.x/portal/jetspeed-2/components/page-manager/src/java/org/apache/jetspeed/page/impl/DatabasePageManager.java 2008-12-09 04:50:34 UTC (rev 1598) +++ pal-portal/branches/pal-portal-1.x/portal/jetspeed-2/components/page-manager/src/java/org/apache/jetspeed/page/impl/DatabasePageManager.java 2008-12-10 04:45:08 UTC (rev 1599) @@ -544,6 +544,15 @@ DatabasePageManagerCache.cacheClear(); } + /* (non-Javadoc) + * @see org.apache.jetspeed.page.PageManager#shutdown() + */ + public void shutdown() + { + // delegate + delegator.shutdown(); + } + /* * (non-Javadoc) * Modified: pal-portal/branches/pal-portal-1.x/portal/jetspeed-2/components/page-manager/src/java/org/apache/jetspeed/page/psml/CastorXmlPageManager.java =================================================================== --- pal-portal/branches/pal-portal-1.x/portal/jetspeed-2/components/page-manager/src/java/org/apache/jetspeed/page/psml/CastorXmlPageManager.java 2008-12-09 04:50:34 UTC (rev 1598) +++ pal-portal/branches/pal-portal-1.x/portal/jetspeed-2/components/page-manager/src/java/org/apache/jetspeed/page/psml/CastorXmlPageManager.java 2008-12-10 04:45:08 UTC (rev 1599) @@ -1026,6 +1026,20 @@ fileCache.evictAll(); } + /* (non-Javadoc) + * @see org.apache.jetspeed.page.PageManager#shutdown() + */ + public void shutdown() + { + // propagate to super + super.shutdown(); + // disconnect cache listener + fileCache.removeListener(this); + // propagate to handlers + handlerFactory.shutdown(); + folderHandler.shutdown(); + } + /** *

* getNodeFolder - get folder implementation associated with specifed path Modified: pal-portal/branches/pal-portal-1.x/portal/jetspeed-2/components/page-manager/src/test/org/apache/jetspeed/page/PageManagerTestShared.java =================================================================== --- pal-portal/branches/pal-portal-1.x/portal/jetspeed-2/components/page-manager/src/test/org/apache/jetspeed/page/PageManagerTestShared.java 2008-12-09 04:50:34 UTC (rev 1598) +++ pal-portal/branches/pal-portal-1.x/portal/jetspeed-2/components/page-manager/src/test/org/apache/jetspeed/page/PageManagerTestShared.java 2008-12-10 04:45:08 UTC (rev 1599) @@ -95,14 +95,16 @@ * @param constraintsEnabled * @return page manager instance */ - static CastorXmlPageManager makeCastorXMLPageManager( + static CastorXmlPageManager makeCastorXMLPageManager(String baseDir, String pagesDirName, boolean permissionsEnabled, boolean constraintsEnabled) throws Exception { Map extensionsToXslt = new HashMap(); - extensionsToXslt.put("psml", "resources/stripIds.xslt"); + extensionsToXslt.put("psml", baseDir + + "src/main/resources/stripIds.xslt"); - File pagesDirFile = new File("target/testdata/" + pagesDirName); + File pagesDirFile = new File(baseDir + "target/testdata/" + + pagesDirName); DirectoryXMLTransform dirHelper = new DirectoryXMLTransform( pagesDirFile, extensionsToXslt); @@ -116,21 +118,23 @@ && !pathname.getName().endsWith("~"); } }; - dirHelper.copyFrom(new File("testdata/" + pagesDirName), - noCVSorSVNorBackups); + dirHelper.copyFrom(new File(baseDir + "src/test/testdata/" + + pagesDirName), noCVSorSVNorBackups); + // copy documents under webapp/pages folder and strip fragment Ids - File webappDestDirFile = new File("target/testdata/" + pagesDirName - + "/webapp-no-ids"); + File webappDestDirFile = new File(baseDir + "target/testdata/" + + pagesDirName + "/webapp-no-ids"); dirHelper.setBaseDirectory(webappDestDirFile); - File webappPagesDirFile = new File("../../src/webapp/WEB-INF/pages"); + File webappPagesDirFile = new File(baseDir + + "src/test/testdata/pages"); dirHelper.copyFromAndTransform(webappPagesDirFile, noCVSorSVNorBackups); // copy documents under webapp/pages folder without transforming // them - webappDestDirFile = new File("target/testdata/" + pagesDirName - + "/webapp-ids"); + webappDestDirFile = new File(baseDir + "target/testdata/" + + pagesDirName + "/webapp-ids"); dirHelper.setBaseDirectory(webappDestDirFile); dirHelper.copyFrom(webappPagesDirFile, noCVSorSVNorBackups); @@ -139,28 +143,28 @@ DocumentHandler psmlHandler = new CastorFileSystemDocumentHandler( "/JETSPEED-INF/castor/page-mapping.xml", - Page.DOCUMENT_TYPE, PageImpl.class, "target/testdata/" - + pagesDirName, cache); + Page.DOCUMENT_TYPE, PageImpl.class, baseDir + + "target/testdata/" + pagesDirName, cache); DocumentHandler linkHandler = new CastorFileSystemDocumentHandler( "/JETSPEED-INF/castor/page-mapping.xml", - Link.DOCUMENT_TYPE, LinkImpl.class, "target/testdata/" - + pagesDirName, cache); + Link.DOCUMENT_TYPE, LinkImpl.class, baseDir + + "target/testdata/" + pagesDirName, cache); DocumentHandler folderMetaDataHandler = new CastorFileSystemDocumentHandler( "/JETSPEED-INF/castor/page-mapping.xml", FolderMetaDataImpl.DOCUMENT_TYPE, FolderMetaDataImpl.class, - "target/testdata/" + pagesDirName, cache); + baseDir + "target/testdata/" + pagesDirName, cache); DocumentHandler pageSecurityHandler = new CastorFileSystemDocumentHandler( "/JETSPEED-INF/castor/page-mapping.xml", - PageSecurityImpl.DOCUMENT_TYPE, PageSecurity.class, - "target/testdata/" + pagesDirName, cache); + PageSecurityImpl.DOCUMENT_TYPE, PageSecurity.class, baseDir + + "target/testdata/" + pagesDirName, cache); DocumentHandlerFactory handlerFactory = new DocumentHandlerFactoryImpl(); handlerFactory.registerDocumentHandler(psmlHandler); handlerFactory.registerDocumentHandler(linkHandler); handlerFactory.registerDocumentHandler(folderMetaDataHandler); handlerFactory.registerDocumentHandler(pageSecurityHandler); - FolderHandler folderHandler = new FileSystemFolderHandler( - "target/testdata/" + pagesDirName, handlerFactory, cache); + FolderHandler folderHandler = new FileSystemFolderHandler(baseDir + + "target/testdata/" + pagesDirName, handlerFactory, cache); return new CastorXmlPageManager(idGen, handlerFactory, folderHandler, cache, permissionsEnabled, @@ -168,6 +172,20 @@ } /** + * shutdownCastorXmlPageManager + * + * shutdown page manager and free cache between test invocations + */ + static void shutdownCastorXMLPageManager( + CastorXmlPageManager pageManager) + { + // reset to clear cache + pageManager.reset(); + // shutdown page manager and handlers + pageManager.shutdown(); + } + + /** * makeListFromCSV * * Create List of String values from CSV String for Modified: pal-portal/branches/pal-portal-1.x/portal/jetspeed-2/components/page-manager/src/test/org/apache/jetspeed/page/TestCastorXmlPageManager.java =================================================================== --- pal-portal/branches/pal-portal-1.x/portal/jetspeed-2/components/page-manager/src/test/org/apache/jetspeed/page/TestCastorXmlPageManager.java 2008-12-09 04:50:34 UTC (rev 1598) +++ pal-portal/branches/pal-portal-1.x/portal/jetspeed-2/components/page-manager/src/test/org/apache/jetspeed/page/TestCastorXmlPageManager.java 2008-12-10 04:45:08 UTC (rev 1599) @@ -25,7 +25,6 @@ import java.util.Map; import junit.framework.Test; -import junit.framework.TestCase; import junit.framework.TestSuite; import org.apache.commons.collections.CollectionUtils; @@ -47,6 +46,7 @@ import org.apache.jetspeed.om.preference.FragmentPreference; import org.apache.jetspeed.page.document.DocumentNotFoundException; import org.apache.jetspeed.page.psml.CastorXmlPageManager; +import org.apache.jetspeed.test.JetspeedTestCase; /** * TestCastorXmlPageManager @@ -56,7 +56,7 @@ * @version $Id: TestCastorXmlPageManager.java 553584 2007-07-05 18:09:45Z * taylor $ */ -public class TestCastorXmlPageManager extends TestCase implements +public class TestCastorXmlPageManager extends JetspeedTestCase implements PageManagerTestShared { @@ -84,7 +84,8 @@ protected void setUp() throws Exception { super.setUp(); - pageManager = Shared.makeCastorXMLPageManager("pages", false, false); + pageManager = Shared.makeCastorXMLPageManager(getBaseDir(), "pages", + false, false); } /** @@ -98,6 +99,7 @@ protected void tearDown() throws Exception { super.tearDown(); + Shared.shutdownCastorXMLPageManager(pageManager); } /** Modified: pal-portal/branches/pal-portal-1.x/portal/jetspeed-2/components/page-manager/src/test/org/apache/jetspeed/page/TestCreateUserHomePagesFromRoles.java =================================================================== --- pal-portal/branches/pal-portal-1.x/portal/jetspeed-2/components/page-manager/src/test/org/apache/jetspeed/page/TestCreateUserHomePagesFromRoles.java 2008-12-09 04:50:34 UTC (rev 1598) +++ pal-portal/branches/pal-portal-1.x/portal/jetspeed-2/components/page-manager/src/test/org/apache/jetspeed/page/TestCreateUserHomePagesFromRoles.java 2008-12-10 04:45:08 UTC (rev 1599) @@ -23,13 +23,13 @@ import javax.security.auth.Subject; import junit.framework.Test; -import junit.framework.TestCase; import junit.framework.TestSuite; import org.apache.jetspeed.om.folder.Folder; import org.apache.jetspeed.page.psml.CastorXmlPageManager; import org.apache.jetspeed.security.impl.RolePrincipalImpl; import org.apache.jetspeed.security.impl.UserPrincipalImpl; +import org.apache.jetspeed.test.JetspeedTestCase; /** * TestSecureCastorXmlPageManager @@ -37,8 +37,8 @@ * @author Randy Watler * @version $Id$ */ -public class TestCreateUserHomePagesFromRoles extends TestCase implements - PageManagerTestShared +public class TestCreateUserHomePagesFromRoles extends JetspeedTestCase + implements PageManagerTestShared { protected CastorXmlPageManager pageManager; @@ -51,8 +51,8 @@ protected void setUp() throws Exception { super.setUp(); - pageManager = Shared.makeCastorXMLPageManager("secure-pages", false, - true); + pageManager = Shared.makeCastorXMLPageManager(getBaseDir(), "pages", + false, false); } /** @@ -66,6 +66,7 @@ protected void tearDown() throws Exception { super.tearDown(); + Shared.shutdownCastorXMLPageManager(pageManager); } /** @@ -131,8 +132,8 @@ public void testCreateUserHomePagesFromRoles() throws Exception { - PageManager pageManager = Shared.makeCastorXMLPageManager("pages", - false, false); + PageManager pageManager = Shared.makeCastorXMLPageManager(getBaseDir(), + "pages", false, false); assertTrue("folder1 failed to create", pageManager .folderExists(FOLDER1)); Modified: pal-portal/branches/pal-portal-1.x/portal/jetspeed-2/components/page-manager/src/test/org/apache/jetspeed/page/TestSecureCastorXmlPageManager.java =================================================================== --- pal-portal/branches/pal-portal-1.x/portal/jetspeed-2/components/page-manager/src/test/org/apache/jetspeed/page/TestSecureCastorXmlPageManager.java 2008-12-09 04:50:34 UTC (rev 1598) +++ pal-portal/branches/pal-portal-1.x/portal/jetspeed-2/components/page-manager/src/test/org/apache/jetspeed/page/TestSecureCastorXmlPageManager.java 2008-12-10 04:45:08 UTC (rev 1599) @@ -17,10 +17,10 @@ package org.apache.jetspeed.page; import junit.framework.Test; -import junit.framework.TestCase; import junit.framework.TestSuite; import org.apache.jetspeed.page.psml.CastorXmlPageManager; +import org.apache.jetspeed.test.JetspeedTestCase; /** * TestSecureCastorXmlPageManager @@ -28,7 +28,7 @@ * @author Randy Watler * @version $Id$ */ -public class TestSecureCastorXmlPageManager extends TestCase implements +public class TestSecureCastorXmlPageManager extends JetspeedTestCase implements PageManagerTestShared { @@ -42,21 +42,19 @@ protected void setUp() throws Exception { super.setUp(); - pageManager = Shared.makeCastorXMLPageManager("secure-pages", false, - true); + pageManager = Shared.makeCastorXMLPageManager(getBaseDir(), + "secure-pages", false, true); } - /** - *

- * tearDown - *

+ /* + * (non-Javadoc) * - * @see junit.framework.TestCase#tearDown() - * @throws java.lang.Exception + * @see junit.framework.TestCase#tearDown */ protected void tearDown() throws Exception { super.tearDown(); + Shared.shutdownCastorXMLPageManager(pageManager); } /** Modified: pal-portal/branches/pal-portal-1.x/portal/jetspeed-2/components/page-manager/src/test/org/apache/jetspeed/page/document/psml/TestCastorFileSystemDocumentHandler.java =================================================================== --- pal-portal/branches/pal-portal-1.x/portal/jetspeed-2/components/page-manager/src/test/org/apache/jetspeed/page/document/psml/TestCastorFileSystemDocumentHandler.java 2008-12-09 04:50:34 UTC (rev 1598) +++ pal-portal/branches/pal-portal-1.x/portal/jetspeed-2/components/page-manager/src/test/org/apache/jetspeed/page/document/psml/TestCastorFileSystemDocumentHandler.java 2008-12-10 04:45:08 UTC (rev 1599) @@ -22,13 +22,15 @@ import java.util.Map; import junit.framework.Test; -import junit.framework.TestCase; import junit.framework.TestSuite; +import net.sf.ehcache.CacheManager; import org.apache.jetspeed.cache.file.FileCache; +import org.apache.jetspeed.cache.impl.EhCacheImpl; import org.apache.jetspeed.om.folder.psml.FolderMetaDataImpl; import org.apache.jetspeed.om.page.Document; import org.apache.jetspeed.page.document.DocumentHandlerFactory; +import org.apache.jetspeed.test.JetspeedTestCase; /** *

@@ -42,9 +44,11 @@ * @version $Id$ * */ -public class TestCastorFileSystemDocumentHandler extends TestCase +public class TestCastorFileSystemDocumentHandler extends JetspeedTestCase { + protected FileCache cache; + protected CastorFileSystemDocumentHandler folderMetaDataDocumentHandler; /* @@ -56,6 +60,9 @@ { super.setUp(); + cache = new FileCache(new EhCacheImpl(CacheManager.getInstance() + .getEhcache("pageFileCache")), 10); + folderMetaDataDocumentHandler = new CastorFileSystemDocumentHandler( "/JETSPEED-INF/castor/page-mapping.xml", "folder.metadata", FolderMetaDataImpl.class, "testdata/pages", new FileCache(null)); @@ -67,17 +74,17 @@ folderMetaDataDocumentHandler.setHandlerFactory(handlerFactory); } - /** - *

- * tearDown - *

+ /* + * (non-Javadoc) * - * @see junit.framework.TestCase#tearDown() - * @throws java.lang.Exception + * @see junit.framework.TestCase#tearDown */ protected void tearDown() throws Exception { super.tearDown(); + + cache.evictAll(); + folderMetaDataDocumentHandler.shutdown(); } /** Modified: pal-portal/branches/pal-portal-1.x/portal/jetspeed-2/jetspeed-api/src/java/org/apache/jetspeed/page/PageManager.java =================================================================== --- pal-portal/branches/pal-portal-1.x/portal/jetspeed-2/jetspeed-api/src/java/org/apache/jetspeed/page/PageManager.java 2008-12-09 04:50:34 UTC (rev 1598) +++ pal-portal/branches/pal-portal-1.x/portal/jetspeed-2/jetspeed-api/src/java/org/apache/jetspeed/page/PageManager.java 2008-12-10 04:45:08 UTC (rev 1599) @@ -600,6 +600,12 @@ public void reset(); /** + * shutdown - gracefully shutdown page manager and disconnect + * from other singleton components, (e.g. shared caches) + */ + public void shutdown(); + + /** * Copy the source page creating and returning a new copy of the page with * the same portlet and fragment collection as the source All fragments are * created with new fragment ids Modified: pal-portal/branches/pal-portal-1.x/portal/jetspeed-2/jetspeed-api/src/java/org/apache/jetspeed/page/document/DocumentHandler.java =================================================================== --- pal-portal/branches/pal-portal-1.x/portal/jetspeed-2/jetspeed-api/src/java/org/apache/jetspeed/page/document/DocumentHandler.java 2008-12-09 04:50:34 UTC (rev 1598) +++ pal-portal/branches/pal-portal-1.x/portal/jetspeed-2/jetspeed-api/src/java/org/apache/jetspeed/page/document/DocumentHandler.java 2008-12-10 04:45:08 UTC (rev 1599) @@ -50,4 +50,10 @@ DocumentHandlerFactory getHandlerFactory(); void setHandlerFactory(DocumentHandlerFactory factory); + + /** + * shutdown - gracefully shutdown handler and disconnect + * from other singleton components, (e.g. shared caches) + */ + public void shutdown(); } Modified: pal-portal/branches/pal-portal-1.x/portal/jetspeed-2/jetspeed-api/src/java/org/apache/jetspeed/page/document/DocumentHandlerFactory.java =================================================================== --- pal-portal/branches/pal-portal-1.x/portal/jetspeed-2/jetspeed-api/src/java/org/apache/jetspeed/page/document/DocumentHandlerFactory.java 2008-12-09 04:50:34 UTC (rev 1598) +++ pal-portal/branches/pal-portal-1.x/portal/jetspeed-2/jetspeed-api/src/java/org/apache/jetspeed/page/document/DocumentHandlerFactory.java 2008-12-10 04:45:08 UTC (rev 1599) @@ -111,4 +111,10 @@ * indicator */ void setPermissionsEnabled(boolean enabled); + + /** + shutdown - gracefully shutdown handlers and disconnect + * from other singleton components, (e.g. shared caches) + */ + public void shutdown(); } Modified: pal-portal/branches/pal-portal-1.x/portal/jetspeed-2/jetspeed-api/src/java/org/apache/jetspeed/page/document/FolderHandler.java =================================================================== --- pal-portal/branches/pal-portal-1.x/portal/jetspeed-2/jetspeed-api/src/java/org/apache/jetspeed/page/document/FolderHandler.java 2008-12-09 04:50:34 UTC (rev 1598) +++ pal-portal/branches/pal-portal-1.x/portal/jetspeed-2/jetspeed-api/src/java/org/apache/jetspeed/page/document/FolderHandler.java 2008-12-10 04:45:08 UTC (rev 1599) @@ -201,4 +201,10 @@ */ boolean isFolder(String path); + /** + * shutdown - gracefully shutdown handler and disconnect + * from other singleton components, (e.g. shared caches) + */ + public void shutdown(); + } From svnnotify ¡÷ sourceforge.jp Wed Dec 10 13:48:52 2008 From: svnnotify ¡÷ sourceforge.jp (svnnotify ¡÷ sourceforge.jp) Date: Wed, 10 Dec 2008 13:48:52 +0900 Subject: [pal-cvs 3865] [1600] added JetspeedTestCase.java for patch 'r721906: fix remove listener cache bug' Message-ID: <1228884532.221882.29982.nullmailer@users.sourceforge.jp> Revision: 1600 http://svn.sourceforge.jp/view?root=pal&view=rev&rev=1600 Author: sone Date: 2008-12-10 13:48:52 +0900 (Wed, 10 Dec 2008) Log Message: ----------- added JetspeedTestCase.java for patch 'r721906: fix remove listener cache bug' Added Paths: ----------- pal-portal/branches/pal-portal-1.x/portal/jetspeed-2/commons/src/java/org/apache/jetspeed/test/ pal-portal/branches/pal-portal-1.x/portal/jetspeed-2/commons/src/java/org/apache/jetspeed/test/JetspeedTestCase.java -------------- next part -------------- Added: pal-portal/branches/pal-portal-1.x/portal/jetspeed-2/commons/src/java/org/apache/jetspeed/test/JetspeedTestCase.java =================================================================== --- pal-portal/branches/pal-portal-1.x/portal/jetspeed-2/commons/src/java/org/apache/jetspeed/test/JetspeedTestCase.java (rev 0) +++ pal-portal/branches/pal-portal-1.x/portal/jetspeed-2/commons/src/java/org/apache/jetspeed/test/JetspeedTestCase.java 2008-12-10 04:48:52 UTC (rev 1600) @@ -0,0 +1,79 @@ +/* + * 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 org.apache.jetspeed.test; + +import java.util.Enumeration; + +import junit.framework.Test; +import junit.framework.TestCase; +import junit.framework.TestSuite; + +/** + * @version $Id: JetspeedTestCase.java 643126 2008-03-31 20:19:00Z ate $ + * + */ +public class JetspeedTestCase extends TestCase +{ + public static TestSuite createFixturedTestSuite(Class testClass, String firstTest, String lastTest) + { + // All methods starting with "test" will automatically be executed in the test suite. + TestSuite tmp = new TestSuite(testClass); + Enumeration e = tmp.tests(); + TestSuite ts = new TestSuite(); + if (firstTest != null) + { + // add lirst test to be executed + ts.addTest(ts.createTest(testClass, firstTest)); + } + while (e.hasMoreElements()) + { + ts.addTest((Test)e.nextElement()); + } + if (lastTest != null) + { + // add lirst test to be executed + ts.addTest(ts.createTest(testClass, lastTest)); + } + return ts; + } + + private String baseDir; + + public JetspeedTestCase() + { + super(); + } + + public JetspeedTestCase(String name) + { + super(name); + } + + public String getBaseDir() + { + if (baseDir == null) + { + baseDir = System.getProperty("basedir"); + if (baseDir == null || baseDir.length() == 0) + { + baseDir = "."; + } + baseDir += "/"; + } + return baseDir; + } +} From svnnotify ¡÷ sourceforge.jp Wed Dec 10 14:31:22 2008 From: svnnotify ¡÷ sourceforge.jp (svnnotify ¡÷ sourceforge.jp) Date: Wed, 10 Dec 2008 14:31:22 +0900 Subject: [pal-cvs 3866] [1601] patch 'r704859: Using \ characters will corrupt the path when used as (Spring expanded) variables' Message-ID: <1228887082.347504.1089.nullmailer@users.sourceforge.jp> Revision: 1601 http://svn.sourceforge.jp/view?root=pal&view=rev&rev=1601 Author: sone Date: 2008-12-10 14:31:22 +0900 (Wed, 10 Dec 2008) Log Message: ----------- patch 'r704859: Using \ characters will corrupt the path when used as (Spring expanded) variables' Modified Paths: -------------- pal-portal/branches/pal-portal-1.x/portal/jetspeed-2/components/cm/src/java/org/apache/jetspeed/components/SpringComponentManager.java -------------- next part -------------- Modified: pal-portal/branches/pal-portal-1.x/portal/jetspeed-2/components/cm/src/java/org/apache/jetspeed/components/SpringComponentManager.java =================================================================== --- pal-portal/branches/pal-portal-1.x/portal/jetspeed-2/components/cm/src/java/org/apache/jetspeed/components/SpringComponentManager.java 2008-12-10 04:48:52 UTC (rev 1600) +++ pal-portal/branches/pal-portal-1.x/portal/jetspeed-2/components/cm/src/java/org/apache/jetspeed/components/SpringComponentManager.java 2008-12-10 05:31:22 UTC (rev 1601) @@ -63,6 +63,10 @@ public SpringComponentManager(String[] bootConfigs, String[] appConfigs, ServletContext servletContext, String appRoot) { + // Using \ characters will corrupt the path when used as (Spring expanded) variables + // making sure default (Java) path separators are used which somehow always work, even on Windows platform. + appRoot = appRoot.replace('\\', '/'); + File appRootDir = new File(appRoot); System.setProperty(JetspeedEngineConstants.APPLICATION_ROOT_KEY, appRootDir.getAbsolutePath()); @@ -105,6 +109,10 @@ public SpringComponentManager(String[] bootConfigs, String[] appConfigs, String appRoot) { + // Using \ characters will corrupt the path when used as (Spring expanded) variables + // making sure default (Java) path separators are used which somehow always work, even on Windows platform. + appRoot = appRoot.replace('\\', '/'); + PropertyPlaceholderConfigurer ppc = new PropertyPlaceholderConfigurer(); Properties p = new Properties(); // p.setProperty(APPLICATION_ROOT_KEY,appRootDir.getAbsolutePath()); From svnnotify ¡÷ sourceforge.jp Wed Dec 10 18:08:38 2008 From: svnnotify ¡÷ sourceforge.jp (svnnotify ¡÷ sourceforge.jp) Date: Wed, 10 Dec 2008 18:08:38 +0900 Subject: [pal-cvs 3867] [1602] updated groupware guide Message-ID: <1228900118.936778.8051.nullmailer@users.sourceforge.jp> Revision: 1602 http://svn.sourceforge.jp/view?root=pal&view=rev&rev=1602 Author: sone Date: 2008-12-10 18:08:38 +0900 (Wed, 10 Dec 2008) Log Message: ----------- updated groupware guide Modified Paths: -------------- pal-portal/docs/ja/groupware-guide/trunk/src/tex/groupware-guide.tex Added Paths: ----------- pal-portal/docs/ja/groupware-guide/trunk/src/images/chat_1.png pal-portal/docs/ja/groupware-guide/trunk/src/images/notepad_1.png pal-portal/docs/ja/groupware-guide/trunk/src/tex/intro.tex pal-portal/docs/ja/groupware-guide/trunk/src/tex/portlet/ pal-portal/docs/ja/groupware-guide/trunk/src/tex/portlet/addresslist.tex pal-portal/docs/ja/groupware-guide/trunk/src/tex/portlet/board.tex pal-portal/docs/ja/groupware-guide/trunk/src/tex/portlet/bookmark.tex pal-portal/docs/ja/groupware-guide/trunk/src/tex/portlet/chat.tex pal-portal/docs/ja/groupware-guide/trunk/src/tex/portlet/googlegadgets.tex pal-portal/docs/ja/groupware-guide/trunk/src/tex/portlet/netvibes-widgets.tex pal-portal/docs/ja/groupware-guide/trunk/src/tex/portlet/notepad.tex pal-portal/docs/ja/groupware-guide/trunk/src/tex/portlet/scheduler.tex pal-portal/docs/ja/groupware-guide/trunk/src/tex/portlet/timecard.tex pal-portal/docs/ja/groupware-guide/trunk/src/tex/portlet/todolist.tex pal-portal/docs/ja/groupware-guide/trunk/src/tex/portlet/userinfo.tex pal-portal/docs/ja/groupware-guide/trunk/src/tex/portlet/vfs-portlets.tex -------------- next part -------------- Added: pal-portal/docs/ja/groupware-guide/trunk/src/images/chat_1.png =================================================================== (Binary files differ) Property changes on: pal-portal/docs/ja/groupware-guide/trunk/src/images/chat_1.png ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: pal-portal/docs/ja/groupware-guide/trunk/src/images/notepad_1.png =================================================================== (Binary files differ) Property changes on: pal-portal/docs/ja/groupware-guide/trunk/src/images/notepad_1.png ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Modified: pal-portal/docs/ja/groupware-guide/trunk/src/tex/groupware-guide.tex =================================================================== --- pal-portal/docs/ja/groupware-guide/trunk/src/tex/groupware-guide.tex 2008-12-10 05:31:22 UTC (rev 1601) +++ pal-portal/docs/ja/groupware-guide/trunk/src/tex/groupware-guide.tex 2008-12-10 09:08:38 UTC (rev 1602) @@ -7,480 +7,30 @@ \begin{document} \maketitle -\chapter{¤Ï¤¸¤á¤Ë} -\section{¤³¤Î¥É¥­¥å¥á¥ó¥È¤Ë¤Ä¤¤¤Æ} +% Ìܼ¡ +\pagenumbering{roman} +\tableofcontents +\clearpage -\subsection{ÂоÝÆɼÔ} -¤³¤Î¥É¥­¥å¥á¥ó¥È¤Ï¡¢PAL¥Ý¡¼¥¿¥ë¤Î¥¤¥ó¥¹¥È¡¼¥ëºî¶È¤ª¤è¤Ó¥¢¥ó¥¤¥ó¥¹¥È¡¼¥ëºî¶È¤òôÅö¤¹¤ë¥æ¡¼¥¶¡¼¤òÂоݤˤ·¤Æ¤¤¤Þ¤¹¡£ +% ËÜʸ +\setcounter{page}{1} +\pagenumbering{arabic} -\subsection{¤ªÆɤߤˤʤëÁ°¤Ë} -¤³¤Î¥É¥­¥å¥á¥ó¥È¤Ç¤Ï¡¢PAL¥Ý¡¼¥¿¥ë¤Î¥¤¥ó¥¹¥È¡¼¥ëÊýË¡¤ò¼¨¤·¤Æ¤¤¤Þ¤¹¡£¥³¥ó¥Ô¥å¡¼¥¿Áàºî¤Î´ðÁÃŪ¤ÊÃ챤¬É¬Íפˤʤê¤Þ¤¹¡£ +% ¤Ï¤¸¤á¤Ë +\input{./intro.tex} -\subsection{¥ª¥ó¥é¥¤¥ó¤Ç¤Î¥¢¥¯¥»¥¹} -¥À¥¦¥ó¥í¡¼¥É¡¢ÀìÌçŪ¥µ¡¼¥Ó¥¹¡¢¥µ¥Ý¡¼¥È¡¢¤½¤Î¾¤Î³«È¯¼Ô¾ðÊó¤Ë¤Ä¤¤¤Æ¤Ï¡¢¼¡¤Ë¥¢¥¯¥»¥¹¤·¤Æ¤¯¤À¤µ¤¤¡£ +% ³Æ¥Ý¡¼¥È¥ì¥Ã¥È¤Î¥É¥­¥å¥á¥ó¥È +\input{./portlet/board.tex} +\input{./portlet/bookmark.tex} +\input{./portlet/vfs-portlets.tex} +\input{./portlet/addresslist.tex} +\input{./portlet/chat.tex} +\input{./portlet/todolist.tex} +\input{./portlet/notepad.tex} +\input{./portlet/timecard.tex} +\input{./portlet/scheduler.tex} +\input{./portlet/userinfo.tex} +%\input{./portlet/googlegadgets.tex} +%\input{./portlet/netvibes-widgets.tex} -\subsection{µ»½ÑŪ¤Ê¥µ¥Ý¡¼¥È¤ÎÏ¢ÍíÀè} -ËÜÀ½Éʤ˴ؤ¹¤ëµ»½ÑŪ¼ÁÌä¤Ç¡¢¥É¥­¥å¥á¥ó¥ÈÆâ¤Ë²ò·èºö¤¬ÆÀ¤é¤ì¤Ê¤¤¾ì¹ç¤Ï¡¢¼¡¤Ë¥¢¥¯¥»¥¹¤·¤Æ¤¯¤À¤µ¤¤¡£ - -\subsection{´ØÏ¢¥µ¡¼¥É¥Ñ¡¼¥Æ¥£¡¼ Web ¥µ¥¤¥È¤Î»²¾È} -Portal Application Laboratory¥×¥í¥¸¥§¥¯¥È¤Ç¤Ï¡¢¤³¤Î¥É¥­¥å¥á¥ó¥È¤Ëµ­ºÜ¤µ¤ì¤Æ¤¤¤ë¥µ¡¼¥É¥Ñ¡¼¥Æ¥£¡¼¤Î Web ¥µ¥¤¥È¤ÎÍ­¸úÀ­¤Ë¤Ä¤¤¤Æ¤ÏÀÕǤ¤ò»ý¤Á¤Þ¤»¤ó¡£ -Portal Application Laboratory¥×¥í¥¸¥§¥¯¥È¤Ï¤½¤Î¤è¤¦¤Ê¥µ¥¤¥È¤ä¥ê¥½¡¼¥¹¤òÄ̤¸¤Æ¡¢ÍøÍѲÄǽ¤Ê¥³¥ó¥Æ¥ó¥Ä¡¢¹­¹ð¡¢À½ÉÊ¡¢¥µ¡¼¥Ó¥¹¡¢¤½¤Î¾¤Î¥É¥­¥å¥á¥ó¥È¤Ê¤É¤Ë¤Ä¤¤¤Æ¡¢Êݾڡ¢ÀÕǤ¡¢µÁ̳¤òÉ餤¤Þ¤»¤ó¡£ -Portal Application Laboratory¥×¥í¥¸¥§¥¯¥È¤Ï¤½¤Î¤è¤¦¤Ê¥µ¥¤¥È¤ä¥ê¥½¡¼¥¹¤ÈÄ̤¸¤Æ¡¢ÍøÍѲÄǽ¤Ê¥³¥ó¥Æ¥ó¥Ä¡¢¹­¹ð¡¢À½ÉÊ¡¢¥µ¡¼¥Ó¥¹¡¢¤½¤Î¾¤Î¥É¥­¥å¥á¥ó¥È¤Ê¤É¤ò¡¢»ÈÍѤޤ¿¤Ï¿®ÍѤ·¤¿¤ê¡¢¤½¤ì¤Ë´ØÏ¢¤·¤ÆȯÀ¸¤Þ¤¿¤Ï¿½¤·Î©¤Æ¤é¤ì¤¿¡¢°ìÀڤλ½ý¤ä»³²¤ËÂФ·¤Æ¤ÏÀÕǤ¤Þ¤¿¤ÏµÁ̳¤òÉ餤¤Þ¤»¤ó¡£ - -\subsection{¥³¥á¥ó¥È¤ª¤è¤ÓÄó°Æ¤ÎÁ÷ÉÕÊýË¡} -Portal Application Laboratory¥×¥í¥¸¥§¥¯¥È¤Ï¡¢¤³¤Î¥É¥­¥å¥á¥ó¥È¤Î²þÁ±¤ËÅؤá¤Æ¤ª¤ê¡¢ÆɼԤ«¤é¤Î¥³¥á¥ó¥È¤ª¤è¤ÓÄó°Æ¤Ê¤É¤ò´¿·Þ¤·¤Æ¤¤¤Þ¤¹¡£ - - -\chapter{¥æ¡¼¥¶¡¼¾ðÊó} -\section{¤Ï¤¸¤á¤Ë} -¤³¤Î¥Ý¡¼¥È¥ì¥Ã¥È¤Ï¡¢¥°¥ë¡¼¥×¥¦¥§¥¢Á´ÂΤΥ桼¥¶¡¼¾ðÊó¤òµ­Ï¿¤¹¤ë¤¿¤á¤Î¥Ý¡¼¥È¥ì¥Ã¥È¤Ç¤¹¡£ - -\chapter{·Ç¼¨ÈÄ} -\section{¤Ï¤¸¤á¤Ë} -¤³¤Î¥Ý¡¼¥È¥ì¥Ã¥È¤Ï¡¢¥Ý¡¼¥¿¥ë¾å¤Ç»ÈÍѤǤ­¤ë·Ç¼¨ÈĤǤ¹¡£°Ê²¼¤Î¤è¤¦¤Êµ¡Ç½¤òÈ÷¤¨¤Æ¤¤¤Þ¤¹¡£ -\begin{itemize} -\item µ­»ö¤Î¥«¥Æ¥´¥êʬ¤±¤È¡¢¥«¥Æ¥´¥êÊ̤˥¢¥¯¥»¥¹¸¢¤òÀßÄꤹ¤ëµ¡Ç½ -\item Ǥ°Õ¤Î¥Õ¥¡¥¤¥ë¤òźÉÕ¤¹¤ëµ¡Ç½ -\item ʸ»ú¿ô¤äźÉդǤ­¤ë¥Õ¥¡¥¤¥ë¤Î¥µ¥¤¥º¤òÀ©¸Â¤¹¤ëµ¡Ç½ -\end{itemize} - -\section{»È¤¤Êý} -¤³¤Î¥Ý¡¼¥È¥ì¥Ã¥È¤Î»È¤¤Êý¤Ï°Ê²¼¤ÎÄ̤ê¤Ç¤¹¡£ - -\subsection{·Ç¼¨ÈĤò»ÈÍѤ¹¤ë} -¤³¤³¤Ç¤Ï¡¢°ìÈ̥桼¥¶¡¼¤È¤·¤Æµ­»ö¤òÅê¹Æ¤¹¤ëÊýË¡¤È¥Õ¥¡¥¤¥ë¤òźÉÕ¤¹¤ëÊýË¡¤òÀâÌÀ¤·¤Þ¤¹¡£ -¤Þ¤º¡¢¤³¤Î¥Ý¡¼¥È¥ì¥Ã¥È(Message Viewer)¤òÇÛÈ÷¤·¤Æ¤¯¤À¤µ¤¤¡£ -¤¹¤ë¤È¡¢¤³¤Î¤è¤¦¤Ê²èÌ̤¬É½¼¨¤µ¤ì¤Þ¤¹¡£ - -\begin{figure}[ht] -\begin{center} -\includegraphics{./images/PAL0004.eps} -\caption{Message Viewer ¥Ý¡¼¥È¥ì¥Ã¥È¤Îµ­»ö°ìÍ÷²èÌÌɽ¼¨} -\label{fig:PAL0004} -\end{center} -\end{figure} - -\subsubsection{µ­»ö¤òÅê¹Æ¤¹¤ë} -µ­»ö¤òÅê¹Æ¤¹¤ë¤Ë¤Ï¡¢¡Ö¿·µ¬ºîÀ®¡×¤ò¥¯¥ê¥Ã¥¯¤·¤Þ¤¹¡£ -µ­»ö¤òÅê¹Æ¤¹¤ëºÝ¤Ë¤Ï¡¢°Ê²¼¤Î¹àÌܤ¬»ØÄê¤Ç¤­¤Þ¤¹¡£ - -\begin{figure}[ht] -\begin{center} -\includegraphics{./images/PAL0001.eps} -\caption{Message Viewer ¥Ý¡¼¥È¥ì¥Ã¥È¤Îµ­»öÅê¹Æ²èÌÌɽ¼¨} -\label{fig:PAL0001} -\end{center} -\end{figure} - -\begin{itemize} -\item º¹½Ð¿Í̾ : º¹½Ð¿Í¤Î̾Á°¤òÆþÎϤ·¤Þ¤¹¡£(¥Ç¥Õ¥©¥ë¥È¤Ç¤Ï¥æ¡¼¥¶¡¼Ì¾¤¬ÆþÎϤµ¤ì¤Æ¤¤¤Þ¤¹) -\item ɸÂê : ɸÂê¤òÆþÎϤ·¤Þ¤¹¡£ -\item ËÜʸ : ËÜʸ¤òÆþÎϤ·¤Þ¤¹¡£Board Configuration ¥Ý¡¼¥È¥ì¥Ã¥È¤Ç»ØÄꤷ¤¿ºÇÂçʸ»ú¿ô¤Þ¤ÇÆþÎϤǤ­¤Þ¤¹¡£ -\item ¸ø³«³«»ÏÆü»þ : ¤³¤Îµ­»ö¤Îɽ¼¨¤ò³«»Ï¤¹¤ëÆü»þ¤ò»ØÄꤷ¤Þ¤¹¡£ -\item ¸ø³«½ªÎ»Æü»þ : ¤³¤Îµ­»ö¤Îɽ¼¨¤ò½ªÎ»¤¹¤ëÆü»þ¤ò»ØÄꤷ¤Þ¤¹¡£ -\item ¤³¤Îµ­»ö¾å¤ÇµÄÏÀ¤¹¤ë : ¤³¤Îµ­»ö¤Ø¤ÎÊÖ¿®¤òǧ¤á¤ë¤«Èݤ«¤òÀßÄꤷ¤Þ¤¹¡£ -\item ¸ø³« : ¤³¤Îµ­»ö¤ò¸ø³«¤¹¤ë¤«°ì»þÊݸµ­»ö¤Ë¤¹¤ë¤«¤òÀßÄꤷ¤Þ¤¹¡£¸ø³«¤·¤¿¾ì¹ç¡¢Â¾¤Î¥æ¡¼¥¶¡¼¤¬±ÜÍ÷¤¹¤ë¤³¤È¤Î¤Ç¤­¤ëµ­»ö¤Ë¤Ê¤ê¤Þ¤¹¤¬¡¢Board Configuration ¥Ý¡¼¥È¥ì¥Ã¥È¤Ç¤ÎÀßÄê¤Ë¤è¤Ã¤Æ¤Ï¸ø³«¸å¤ÎÊÔ½¸¤Ï¤Ç¤­¤Ê¤¤¾ì¹ç¤â¤¢¤ê¤Þ¤¹¡£°ì»þÊݸµ­»ö¤Î¾ì¹ç¤Ï¼«Ê¬¤Î¤ß±ÜÍ÷¤Ç¤­¤Þ¤¹¡£ -\end{itemize} - -¤Ê¤ª¡¢µ­»ö¤òÅê¹Æ¤¹¤ë¤Þ¤Ç¤Ï¥Õ¥¡¥¤¥ë¤ÎźÉդϹԤ¦¤³¤È¤¬¤Ç¤­¤Þ¤»¤ó¡£ - -\subsubsection{µ­»ö¤ËÂФ·¤ÆÊÖ¿®¤¹¤ë} -µ­»ö¤ÎɸÂê¤ò¥¯¥ê¥Ã¥¯¤·¡¢µ­»ö¤òɽ¼¨¤µ¤»¤Æ¤¯¤À¤µ¤¤¡£ - -\begin{figure}[ht] -\begin{center} -\includegraphics{./images/PAL0006.eps} -\caption{Message Viewer ¥Ý¡¼¥È¥ì¥Ã¥È¤Îµ­»ö¾ÜºÙ²èÌÌɽ¼¨ : ¥³¥á¥ó¥È¤ÎÅê¹Æ} -\label{fig:PAL0006} -\end{center} -\end{figure} - -µ­»ö¤ÎËÜʸÅù¤Î²¼¤ËÊÖ¿®¤Î½ñ¤­¹þ¤ßÍ󤬤¢¤ê¤Þ¤¹¡£¤³¤³¤ÇÊÖ¿®¤ò½ñ¤­¹þ¤à¤³¤È¤¬¤Ç¤­¤Þ¤¹¡£ - -\begin{itemize} -\item º¹½Ð¿Í̾ : º¹½Ð¿Í¤Î̾Á°¤òÆþÎϤ·¤Þ¤¹¡£(¥Ç¥Õ¥©¥ë¥È¤Ç¤Ï¥æ¡¼¥¶¡¼Ì¾¤¬ÆþÎϤµ¤ì¤Æ¤¤¤Þ¤¹) -\item ËÜʸ : ËÜʸ¤òÆþÎϤ·¤Þ¤¹¡£Board Configuration ¥Ý¡¼¥È¥ì¥Ã¥È¤Ç»ØÄꤷ¤¿ºÇÂçʸ»ú¿ô¤Þ¤ÇÆþÎϤǤ­¤Þ¤¹¡£ -\end{itemize} - -¤Ê¤ª¡¢¿Æµ­»ö¤ÎÅê¹Æ¼Ô¤Ï¡¢µ­»ö¤Ø¤Î¥³¥á¥ó¥È¤òºï½ü¤¹¤ë¤³¤È¤¬¤Ç¤­¤Þ¤¹¡£ - -\subsubsection{¥Õ¥¡¥¤¥ë¤òźÉÕ¤¹¤ë} -¤³¤Î¥Ý¡¼¥È¥ì¥Ã¥È¤Ç¤Ïµ­»ö¤Î¿·µ¬Åê¹Æ»þ¤Ë¥Õ¥¡¥¤¥ë¤òźÉÕ¤¹¤ë¤³¤È¤Ï¤Ç¤­¤Þ¤»¤ó¡£ -¤¤¤Ã¤¿¤ó°ì»þÊݸµ­»ö¤È¤·¤ÆÅê¹Æ¤·¤¿¸å¤Ëµ­»ö¤òÊÔ½¸¤·¡¢¤½¤ÎºÝ¤ËźÉÕ¥Õ¥¡¥¤¥ë¤òÁ÷¿®¤¹¤ë¤³¤È¤¬É¬ÍפǤ¹¡£ - -\begin{figure}[ht] -\begin{center} -\includegraphics{./images/PAL0007.eps} -\caption{Message Viewer ¥Ý¡¼¥È¥ì¥Ã¥È¤Îµ­»öÊÔ½¸²èÌÌɽ¼¨} -\label{fig:PAL0007} -\end{center} -\end{figure} - -µ­»ö¤òÊÔ½¸¤¹¤ëºÝ¤Ë¡¢¥Õ¥¡¥¤¥ë¤òźÉդǤ­¤Þ¤¹¡£ÅºÉÕ¥Õ¥¡¥¤¥ë¤ò»ØÄꤹ¤ë¤È¶¦¤Ë¡¢ÅºÉÕ¤¹¤ë¥Õ¥¡¥¤¥ë¤ËÂФ·¤Æ¥³¥á¥ó¥È¤òÉÕ¤±¤ë¤³¤È¤¬¤Ç¤­¤Þ¤¹¡£ - -\subsection{·Ç¼¨ÈĤò´ÉÍý¤¹¤ë} -¤³¤³¤Ç¤Ï¡¢´ÉÍý¼Ô¤È¤·¤Æ¡¢µ­»ö¤òÄɲá¦ÊÔ½¸¡¦ºï½ü¤¹¤ëÊýË¡¤äµ­»ö¤ò¥«¥Æ¥´¥êʬ¤±¤¹¤ë¤¿¤á¤Î¥«¥Æ¥´¥ê¤ÎÄɲäÎÊýË¡¡¢¥«¥Æ¥´¥ê¤Î¥¢¥¯¥»¥¹¸¢¤ÎÀßÄêÊýË¡¤òÀâÌÀ¤·¤Þ¤¹¡£ - -\subsubsection{µ­»ö¤ÎÄɲá¦ÊÔ½¸¡¦ºï½ü} -admin ¥í¡¼¥ë¤Î¥æ¡¼¥¶¤Î¤ß¤¬»ÈÍѲÄǽ¤Ê Message Admin ¥Ý¡¼¥È¥ì¥Ã¥È¤ò»ÈÍѤ·¤Þ¤¹¡£ -¤³¤Î¥Ý¡¼¥È¥ì¥Ã¥È¤Ç¤Ï¡¢Ä̾ï¤ÈƱÍͤ˵­»ö¤ò±ÜÍ÷¡¦ÊÔ½¸¡¦ºï½ü¤Ç¤­¤Þ¤¹¤¬¡¢°ìÈ̤Υ桼¥¶¤¬Åê¹Æ¤·¤¿µ­»ö¤ËÂФ·¤Æ¤âÊÔ½¸¡¦ºï½ü¤ò¹Ô¤¦¤³¤È¤¬²Äǽ¤Ç¤¹¡£ - -\subsubsection{¥«¥Æ¥´¥ê¤ÎÄɲá¦ÊÔ½¸¡¦ºï½ü} -admin ¥í¡¼¥ë¤Î¥æ¡¼¥¶¤Î¤ß¤¬»ÈÍѲÄǽ¤Ê Category Editor ¥Ý¡¼¥È¥ì¥Ã¥È¤ò»ÈÍѤ·¤Þ¤¹¡£ - -\begin{figure}[ht] -\begin{center} -\includegraphics{./images/PAL0009.eps} -\caption{Category Editor ¥Ý¡¼¥È¥ì¥Ã¥È¤Î¥«¥Æ¥´¥êÊÔ½¸²èÌÌɽ¼¨} -\label{fig:PAL0009} -\end{center} -\end{figure} - -¤³¤Î¥Ý¡¼¥È¥ì¥Ã¥È¤Ç¡Ö¿·µ¬ºîÀ®¡×¤ò¥¯¥ê¥Ã¥¯¤¹¤ë¤È¡¢¥«¥Æ¥´¥ê¤òºîÀ®¤¹¤ë¤³¤È¤¬¤Ç¤­¤Þ¤¹¡£ - -\begin{figure}[ht] -\begin{center} -\includegraphics{./images/PAL0010.eps} -\caption{Category Editor ¥Ý¡¼¥È¥ì¥Ã¥È¤Î¥«¥Æ¥´¥êºîÀ®²èÌÌɽ¼¨} -\label{fig:PAL0010} -\end{center} -\end{figure} - -¤Ê¤ª¡¢¥«¥Æ¥´¥ê¤ÎºîÀ®¤ËɬÍפʾðÊó¤Ï¥«¥Æ¥´¥ê̾¤Î¤ß¤Ç¤¹¡£ - -\subsubsection{¥¢¥¯¥»¥¹¸¢¤ÎÀßÄê} -TBD - -\subsubsection{ʸ»ú¿ô¤äźÉդǤ­¤ë¥Õ¥¡¥¤¥ë¤Î¥µ¥¤¥º¤òÀ©¸Â¤¹¤ë} -admin ¥í¡¼¥ë¤Î¥æ¡¼¥¶¤Î¤ß¤¬»ÈÍѲÄǽ¤Ê Board Configuration ¥Ý¡¼¥È¥ì¥Ã¥È¤ò»ÈÍѤ·¤Þ¤¹¡£ - -\begin{figure}[ht] -\begin{center} -\includegraphics{./images/PAL0014.eps} -\caption{Board Configuration ¥Ý¡¼¥È¥ì¥Ã¥È¤Î²èÌÌɽ¼¨} -\label{fig:PAL0014} -\end{center} -\end{figure} - -¤³¤Î¥Ý¡¼¥È¥ì¥Ã¥È¤Ç¤Ï°Ê²¼¤Î¹àÌܤ¬»ØÄê¤Ç¤­¤Þ¤¹¡£ - -\begin{itemize} -\item Åê¹Æµ­»ö¤ÎºÇÂçʸ»ú¿ô : µ­»ö¤òÅê¹Æ¤¹¤ëºÝ¤ÎºÇÂç¤Îʸ»ú¿ô¤ò»ØÄꤷ¤Þ¤¹¡£(Á´³Ñ¡¢È¾³Ñ¤Ë¤³¤À¤ï¤é¤ºÊ¸»ú¿ôñ°Ì¤Ç¤Î»ØÄê¤È¤Ê¤ê¤Þ¤¹) -\item ÊÖ¿®¤ÎºÇÂçʸ»ú¿ô : ÊÖ¿®¤¹¤ëºÝ¤ÎºÇÂç¤Îʸ»ú¿ô¤ò»ØÄꤷ¤Þ¤¹¡£(Á´³Ñ¡¢È¾³Ñ¤Ë¤³¤À¤ï¤é¤ºÊ¸»ú¿ôñ°Ì¤Ç¤Î»ØÄê¤È¤Ê¤ê¤Þ¤¹) -\item Åê¹Æ¸å¤ÎÊÔ½¸ : Åê¹Æ¸å¤ËºÆÅÙÊÔ½¸¤òǧ¤á¤ë¤«Èݤ«¤òÀßÄê¤Ç¤­¤Þ¤¹¡£ -\item źÉÕ¥Õ¥¡¥¤¥ë¤ÎºÇÂ祵¥¤¥º : źÉÕ¥Õ¥¡¥¤¥ë¤ÎºÇÂ祵¥¤¥º¤ò¥Ð¥¤¥Èñ°Ì¤Ç»ØÄê¤Ç¤­¤Þ¤¹¡£ -\end{itemize} - -\chapter{¥Ö¥Ã¥¯¥Þ¡¼¥¯} -\section{¤Ï¤¸¤á¤Ë} -¤³¤Î¥Ý¡¼¥È¥ì¥Ã¥È¤Ï¸Ä¿ÍÍѤª¤è¤Ó¶¦Í­¥Ö¥Ã¥¯¥Þ¡¼¥¯¤ò´ÉÍý¤¹¤ë¥Ý¡¼¥È¥ì¥Ã¥È¤Ç¤¹¡£ -ºîÀ®¤·¤¿¥«¥Æ¥´¥ê¤ä¥Ö¥Ã¥¯¥Þ¡¼¥¯¤ÏÅÐÏ¿¼Ô°Ê³°¤¬»ÈÍѤ¹¤ë¤³¤È¤Ï¤Ç¤­¤Þ¤»¤ó¤¬¡¢¶¦Í­¤Î¥«¥Æ¥´¥ê¤Ë¥Ö¥Ã¥¯¥Þ¡¼¥¯¤òÅÐÏ¿¤·¤¿¾ì¹ç¡¢ÅÐÏ¿¼Ô°Ê³°¤âÍøÍѤǤ­¤ë¶¦Í­¤Î¥Ö¥Ã¥¯¥Þ¡¼¥¯¤È¤·¤Æ»ÈÍѤ¹¤ë¤³¤È¤¬¤Ç¤­¤Þ¤¹¡£ - -\section{»È¤¤Êý} - -¤³¤Î¥Ý¡¼¥È¥ì¥Ã¥È¤Î»È¤¤Êý¤Ï°Ê²¼¤ÎÄ̤ê¤Ç¤¹¡£ - -\subsection{¥Ö¥Ã¥¯¥Þ¡¼¥¯¤ò»ÈÍѤ¹¤ë} -¤³¤³¤Ç¤Ï¡¢°ìÈ̥桼¥¶¡¼¤È¤·¤Æ¤³¤Î¥Ý¡¼¥È¥ì¥Ã¥È¤ò»ÈÍѤ¹¤ëÊýË¡¤òÀâÌÀ¤·¤Þ¤¹¡£ -¤Þ¤º¡¢¤³¤Î¥Ý¡¼¥È¥ì¥Ã¥È(Bookmark Viewer)¤òÇÛÈ÷¤·¤Æ¤¯¤À¤µ¤¤¡£ -¤¹¤ë¤È¡¢¤³¤Î¤è¤¦¤Ê²èÌ̤¬É½¼¨¤µ¤ì¤Þ¤¹¡£ - -\begin{figure}[ht] -\begin{center} -\includegraphics{./images/PAL0026.eps} -\caption{Bookmark Viewer ¥Ý¡¼¥È¥ì¥Ã¥È¤Î¥Ö¥Ã¥¯¥Þ¡¼¥¯°ìÍ÷²èÌÌɽ¼¨} -\label{fig:PAL0026} -\end{center} -\end{figure} - -\subsubsection{¥Ö¥Ã¥¯¥Þ¡¼¥¯¤òºîÀ®¤¹¤ë} - -\begin{figure}[ht] -\begin{center} -\includegraphics{./images/PAL0028.eps} -\caption{Bookmark Viewer ¥Ý¡¼¥È¥ì¥Ã¥È¤Î¥Ö¥Ã¥¯¥Þ¡¼¥¯ÅÐÏ¿²èÌÌɽ¼¨} -\label{fig:PAL0028} -\end{center} -\end{figure} - -¡Ö¥ê¥ó¥¯ºîÀ®¡×¤ò¥¯¥ê¥Ã¥¯¤¹¤ë¤È¡¢¥Ö¥Ã¥¯¥Þ¡¼¥¯ºîÀ®²èÌ̤¬É½¼¨¤µ¤ì¤Þ¤¹¡£ -¥Ö¥Ã¥¯¥Þ¡¼¥¯ºîÀ®»þ¤Ë¤Ï¡¢°Ê²¼¤Î¹àÌܤòÆþÎϤǤ­¤Þ¤¹¡£ - -\begin{itemize} -\item ̾Á° : ¥Ö¥Ã¥¯¥Þ¡¼¥¯¤Ëɽ¼¨¤µ¤ì¤ë̾Á°¤òÆþÎϤ·¤Þ¤¹¡£ -\item URL : ³«¤­¤¿¤¤¥µ¥¤¥È¤ÎURL¤òµ­½Ò¤·¤Þ¤¹¡£ -\item ¥á¥â : ¥á¥â¤òµ­½Ò¤·¤Þ¤¹¡£ -\item ¥«¥Æ¥´¥ê : ¥«¥Æ¥´¥ê¤òÁªÂò¤·¤Þ¤¹¡£¥Ç¥Õ¥©¥ë¥È¤Ç¤Ï̤ʬÎà¤Ë¤Ê¤Ã¤Æ¤¤¤Þ¤¹¤¬¡¢¥«¥Æ¥´¥ê¤òºîÀ®¤·¤ÆÅÐÏ¿¤¹¤ë¤³¤È¤â¤Ç¤­¤Þ¤¹¡£ -\item ¼ïÎà : ¿·¤·¤¤¥¦¥¤¥ó¥É¥¦¤Þ¤¿¤Ï¥¿¥Ö¤Ç³«¤¯¡Ê¥Ö¥é¥¦¥¶¤Ë¤è¤Ã¤Æ°Û¤Ê¤ê¤Þ¤¹¡Ë¤«¡¢Æ±¤¸¥¦¥¤¥ó¥É¥¦¤Ç³«¤¯¤«ÁªÂò¤·¤Þ¤¹¡£ -\end{itemize} - -¤Á¤Ê¤ß¤Ë¡¢³Æ¥Ö¥é¥¦¥¶¤Ç¡Ö¿·¤·¤¤¥¦¥¤¥ó¥É¥¦¤Þ¤¿¤Ï¥¿¥Ö¤Ç³«¤¯¡×¾ì¹ç¤ÎÆ°ºî¤Ï°Ê²¼¤ÎÄ̤ê¤Ç¤¹¡£ -\begin{itemize} -\item Microsoft Internet Explorer 6 : ¿·¤·¤¤¥¦¥¤¥ó¥É¥¦¤Ç³«¤­¤Þ¤¹¡£ -\item Microsoft Internet Explorer 7 : ¿·¤·¤¤¥¦¥¤¥ó¥É¥¦¤Ç³«¤­¤Þ¤¹¡£ -\item Mozilla Firefox 3 : ¿·¤·¤¤¥¿¥Ö¤Ç³«¤­¤Þ¤¹¡£ -\item Google Chrome : ¿·¤·¤¤¥¿¥Ö¤Ç³«¤­¤Þ¤¹¡£ -\item Apple Safari : ¿·¤·¤¤¥¦¥¤¥ó¥É¥¦¤Ç³«¤­¤Þ¤¹¡£ -\end{itemize} - -¤³¤Î¥Ö¥Ã¥¯¥Þ¡¼¥¯¤Ï´ÉÍý¼Ô¤ò½ü¤­¡¢ºîÀ®¤·¤¿ËܿͤΤߤ¬ÍøÍѤǤ­¤Þ¤¹¡£ - -\subsubsection{¥Ö¥Ã¥¯¥Þ¡¼¥¯¤ò³«¤¯} -¥Ö¥Ã¥¯¥Þ¡¼¥¯¤Î¹àÌÜ̾¤ò¥¯¥ê¥Ã¥¯¤¹¤ë¤È¡¢ºîÀ®»þ¤ËÀßÄꤷ¤¿Ä̤ê¤Ë¥¦¥¤¥ó¥É¥¦¤¬³«¤­¤Þ¤¹¡£ - -\subsubsection{¥«¥Æ¥´¥ê¤òºîÀ®¤¹¤ë} -½é´üɽ¼¨²èÌ̤ˤơ֥«¥Æ¥´¥ê°ìÍ÷¡×¤ò¥¯¥ê¥Ã¥¯¤¹¤ë¤È¡¢¥«¥Æ¥´¥ê°ìÍ÷²èÌ̤¬É½¼¨¤µ¤ì¤Þ¤¹¡£ - -\begin{figure}[ht] -\begin{center} -\includegraphics{./images/PAL0029.eps} -\caption{Bookmark Viewer ¥Ý¡¼¥È¥ì¥Ã¥È¤Î¥«¥Æ¥´¥ê°ìÍ÷²èÌÌɽ¼¨} -\label{fig:PAL0029} -\end{center} -\end{figure} - -¤³¤³¤Ç¡¢¡Ö¥«¥Æ¥´¥êºîÀ®¡×¤ò¥¯¥ê¥Ã¥¯¤¹¤ë¤È¥«¥Æ¥´¥ê¤òºîÀ®¤¹¤ë¤³¤È¤¬¤Ç¤­¤Þ¤¹¡£ -¤³¤³¤Ç¤Ï´ÉÍý¼Ô¤È¤·¤Æ¡¢¤³¤Î¥Ý¡¼¥È¥ì¥Ã¥È¤ò´ÉÍý¤¹¤ëÊýË¡¤òÀâÌÀ¤·¤Þ¤¹¡£ -admin ¥í¡¼¥ë¤Î¥æ¡¼¥¶¤Î¾ì¹ç¡¢´ÉÍýÍѤΥݡ¼¥È¥ì¥Ã¥È(Bookmark Manager)¤òÇÛÈ÷¤¹¤ë¤³¤È¤¬¤Ç¤­¤Þ¤¹¡£ - -\begin{figure}[ht] -\begin{center} -\includegraphics{./images/PAL0021.eps} -\caption{Bookmark Manager ¥Ý¡¼¥È¥ì¥Ã¥È¤Î¥Ö¥Ã¥¯¥Þ¡¼¥¯´ÉÍý²èÌÌɽ¼¨} -\label{fig:PAL0021} -\end{center} -\end{figure} - -¤³¤Î¥Ý¡¼¥È¥ì¥Ã¥È¤ÈÄ̾ï¤Î¥Ý¡¼¥È¥ì¥Ã¥È¤Ï°Ê²¼¤ÎÅÀ¤Ç°Û¤Ê¤ê¤Þ¤¹¡£ -\begin{itemize} -\item ¤¹¤Ù¤Æ¤Î¥æ¡¼¥¶¡¼¤ÎºîÀ®¤·¤¿¥Ö¥Ã¥¯¥Þ¡¼¥¯¤ä¥«¥Æ¥´¥ê¤ò±ÜÍ÷¡¦ÊÔ½¸¡¦ºï½ü¤Ç¤­¤ëÅÀ -\item ¥«¥Æ¥´¥ê¤Ø¤ÎÅÐÏ¿¤Î¾ì¹ç¡¢ID ¤òÆþÎϤ¹¤ëɬÍפ¬¤¢¤ëÅÀ(̤ʬÎ५¥Æ¥´¥ê¤Î ID ¤Ï 1 ¤Ë¤Ê¤ê¤Þ¤¹) -\item ¶¦Í­¥«¥Æ¥´¥ê¤Ë¥Ö¥Ã¥¯¥Þ¡¼¥¯¤òÅÐÏ¿¤Ç¤­¤ëÅÀ(¶¦Í­¥«¥Æ¥´¥ê¤Î ID ¤Ï 2 ¤Ë¤Ê¤ê¤Þ¤¹) -\item ¥Ö¥Ã¥¯¥Þ¡¼¥¯¤Îɽ¼¨½ç¤ò¿ô»ú¤ÇÀßÄꤹ¤ëÅÀ(¿ô»ú¤Î¾®¤µ¤¤¤â¤Î¤¬¾å¤Ëɽ¼¨¤µ¤ì¤Þ¤¹) -\end{itemize} - -\begin{figure}[ht] -\begin{center} -\includegraphics{./images/PAL0030.eps} -\caption{Bookmark Viewer ¥Ý¡¼¥È¥ì¥Ã¥È¤Î¥«¥Æ¥´¥êÅÐÏ¿²èÌÌɽ¼¨} -\label{fig:PAL0030} -\end{center} -\end{figure} - -¥«¥Æ¥´¥êºîÀ®»þ¤Ë¤Ï¡¢°Ê²¼¤Î¹àÌܤòÆþÎϤǤ­¤Þ¤¹¡£ -\begin{itemize} -\item ¥«¥Æ¥´¥ê̾ : ¥«¥Æ¥´¥ê¤Î̾Á°¤òÆþÎϤ·¤Þ¤¹¡£ -\item ¥á¥â : ¥á¥â¤òµ­½Ò¤·¤Þ¤¹¡£ -\end{itemize} - -¤³¤Î¥«¥Æ¥´¥ê¤Ï¡¢´ÉÍý¼Ô¤ò½ü¤­¡¢ºîÀ®¤·¤¿ËܿͤΤߤ¬ÍøÍѤǤ­¤Þ¤¹¡£ - -\subsection{¥Ö¥Ã¥¯¥Þ¡¼¥¯¤È¥«¥Æ¥´¥ê¤ò´ÉÍý¤¹¤ë} -\begin{figure}[ht] -\begin{center} -\includegraphics{./images/PAL0022.eps} -\caption{Bookmark Manager ¥Ý¡¼¥È¥ì¥Ã¥È¤Î¥Ö¥Ã¥¯¥Þ¡¼¥¯ÊÔ½¸²èÌÌɽ¼¨} -\label{fig:PAL0022} -\end{center} -\end{figure} - -\begin{figure}[ht] -\begin{center} -\includegraphics{./images/PAL0024.eps} -\caption{Bookmark Manager ¥Ý¡¼¥È¥ì¥Ã¥È¤Î¥«¥Æ¥´¥ê´ÉÍý²èÌÌɽ¼¨} -\label{fig:PAL0024} -\end{center} -\end{figure} - -\begin{figure}[ht] -\begin{center} -\includegraphics{./images/PAL0025.eps} -\caption{Bookmark Manager ¥Ý¡¼¥È¥ì¥Ã¥È¤Î¥«¥Æ¥´¥êÊÔ½¸²èÌÌɽ¼¨} -\label{fig:PAL0025} -\end{center} -\end{figure} - -\chapter{VFS} -\section{¤Ï¤¸¤á¤Ë} -¤³¤Î¥Ý¡¼¥È¥ì¥Ã¥È¤Ï¡¢¥Ý¡¼¥¿¥ë¥µ¡¼¥Ð¤Î¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤Ë¥¢¥¯¥»¥¹¤¹¤ë¥Ý¡¼¥È¥ì¥Ã¥È¤Ç¤¹¡£ -¤³¤Î¥Ý¡¼¥È¥ì¥Ã¥È¤Ë¤ÏÁ´°÷¤ÇƱ¤¸ÀßÄê¤òÍøÍѤ¹¤ë¤â¤Î(VFS Explorer)¤È¸Ä¿ÍÍÑ¥Õ¥©¥ë¥À¤Ë¥¢¥¯¥»¥¹¤¹¤ë¤â¤Î(VFS Personal Folder Explorer)¤¬¤¢¤ê¡¢¤½¤ì¤¾¤ì¤òÍøÍѤ·¤Æ°Ê²¼¤Î¤è¤¦¤Ê¤³¤È¤ò¹Ô¤¦¤³¤È¤¬¤Ç¤­¤Þ¤¹¡£ - -\begin{itemize} -\item ¥Ý¡¼¥¿¥ë¥µ¡¼¥Ð¤Î¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤Ø¤Î¥Õ¥¡¥¤¥ë¤Î¥¢¥Ã¥×¥í¡¼¥É -\item ¥Ý¡¼¥¿¥ë¥µ¡¼¥Ð¤Î¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤Ø¤Î¥Õ¥©¥ë¥À¤ÎºîÀ® -\item ¥Ý¡¼¥¿¥ë¥µ¡¼¥Ð¤Î¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤«¤é¤Î¥Õ¥¡¥¤¥ë¤Î¥À¥¦¥ó¥í¡¼¥É¡¢ºï½ü -\item ¥Ý¡¼¥¿¥ë¥µ¡¼¥Ð¤Î¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤«¤é¤Î¥Õ¥©¥ë¥À¤Îºï½ü -\end{itemize} - -\section{»È¤¤Êý} -¤³¤Î¥Ý¡¼¥È¥ì¥Ã¥È¤Î»È¤¤Êý¤Ï°Ê²¼¤ÎÄ̤ê¤Ç¤¹¡£ - -\subsection{VFS¥Ý¡¼¥È¥ì¥Ã¥È¤òÀßÄꤹ¤ë} -¤³¤³¤Ç¤Ï´ÉÍý¼Ô¤È¤·¤Æ¡¢¤³¤Î¥Ý¡¼¥È¥ì¥Ã¥È¤òÀßÄꤹ¤ëÊýË¡¤òÀâÌÀ¤·¤Þ¤¹¡£ -\begin{figure}[ht] -\begin{center} -\includegraphics{./images/PAL0020.eps} -\caption{VFS Configulator ¥Ý¡¼¥È¥ì¥Ã¥È¤Î²èÌÌɽ¼¨} -\label{fig:PAL0020} -\end{center} -\end{figure} -¤³¤Î¥Ý¡¼¥È¥ì¥Ã¥È¤ÏÇÛÈ÷¤·¤¿Ä¾¸å¤Ç¤Ï»ÈÍѤǤ­¤Ê¤¤¾õÂ֤ˤʤäƤ¤¤ë¤¿¤á¡¢ÀßÄê¤ò¹Ô¤¦É¬Íפ¬¤¢¤ê¤Þ¤¹¡£ -´ÉÍý¤Ï¡¢admin ¥í¡¼¥ë¤Î¥æ¡¼¥¶¤Î¤ß¤¬»ÈÍѲÄǽ¤Ê VFS Configulator ¥Ý¡¼¥È¥ì¥Ã¥È(VFS Explorer ÍÑ)¡¢¤Þ¤¿¤Ï Personal Folder Configulator ¥Ý¡¼¥È¥ì¥Ã¥È(VFS Personal Folder Explorer ÍÑ)¤«¤éÀßÄê¤ò¹Ô¤¦¤³¤È¤¬¤Ç¤­¤Þ¤¹¡£ -ÀßÄê¹àÌܤϰʲ¼¤ÎÄ̤ê¤Ç¤¹¡£ ¤Ê¤ª¡¢URI¤Î»ØÄê¹àÌܤǡ¢¡Ö\verb|__USERNAME__|¡×¤È¤¤¤¦ÊÑ¿ô¤ò»ÈÍѤ·¤¿¾ì¹ç¡¢¥æ¡¼¥¶¡¼Ì¾¤òÊÑ¿ô¤È¤·¤ÆÍøÍѤ¹¤ë¤³¤È¤¬¤Ç¤­¤Þ¤¹¡£ -\begin{itemize} -\item »ÈÍÑ : ¤³¤Î¥Ý¡¼¥È¥ì¥Ã¥È¤Î»ÈÍѤòµö²Ä¤¹¤ë¤«Èݤ«¤ÎÀßÄê¤ò¹Ô¤¦¤³¤È¤¬¤Ç¤­¤Þ¤¹¡£¤³¤³¤òµö²Ä¤·¤Ê¤¤¾ì¹ç¡¢¤¹¤Ù¤Æ¤Îµ¡Ç½¤ò»ÈÍѤ¹¤ë¤³¤È¤Ï¤Ç¤­¤Þ¤»¤ó¡£ -\item ɸ½à¤ÎURI : ½é´ü¤Ëɽ¼¨¤µ¤ì¤ë¥Ñ¥¹¤ò»ØÄꤷ¤Þ¤¹¡£ -\item ¥ë¡¼¥ÈURI : ¥ë¡¼¥È¥Õ¥©¥ë¥À¤È¤·¤Æɽ¼¨¤µ¤ì¤ë¥Ñ¥¹¤ò»ØÄꤷ¤Þ¤¹¡£¤³¤ì¤è¤ê¾å°Ì¤Î¥Ñ¥¹¤Ø¤Î¥¢¥¯¥»¥¹¤Ï¤Ç¤­¤Ê¤¯¤Ê¤ê¤Þ¤¹¡£ -\item µö²Ä¤¹¤ë¥Ñ¥¹ : ¤³¤Î¥Ý¡¼¥È¥ì¥Ã¥È¤Ç¤Î±ÜÍ÷¤òµö²Ä¤¹¤ë¥Ñ¥¹¤ò»ØÄꤷ¤Þ¤¹¡£ -\item ¶Ø»ß¤¹¤ë¥Ñ¥¹ : ¤³¤Î¥Ý¡¼¥È¥ì¥Ã¥È¤Ç¤Î±ÜÍ÷¤ò¶Ø»ß¤¹¤ë¥Ñ¥¹¤ò»ØÄꤷ¤Þ¤¹¡£ -\item ¥Ñ¥¹¤Îɽ¼¨ : ¡Öµö²Ä¤¹¤ë¡×¤òÁªÂò¤·¤¿¾ì¹ç¡¢¥Õ¥©¥ë¥À¤ä¥Õ¥¡¥¤¥ë¤Î¥ê¥¹¥È¤Î¾åÉô¤Ë¥Ñ¥¹¤¬É½¼¨¤µ¤ì¤Þ¤¹¡£ -\item ¥Õ¥©¥ë¥À¤ÎºîÀ® : ¡Öµö²Ä¤¹¤ë¡×¤òÁªÂò¤·¤¿¾ì¹ç¡¢¥Õ¥©¥ë¥À¤òºîÀ®¤¹¤ë¤³¤È¤¬¤Ç¤­¤Þ¤¹¡£ -\item ¥¢¥Ã¥×¥í¡¼¥É : ¡Öµö²Ä¤¹¤ë¡×¤òÁªÂò¤·¤¿¾ì¹ç¡¢¥Õ¥¡¥¤¥ë¤ò¥¢¥Ã¥×¥í¡¼¥É¤¹¤ë¤³¤È¤¬¤Ç¤­¤Þ¤¹¡£ -\end{itemize} - -\subsubsection{Windows¤Ç¤ÎÆÃÍ­¤ÊÀßÄê} -Windows¤Ç¤Ï¥Ñ¥¹¤Î»ØÄê¤ò¡Öfile:///c:Y\hspace{-.75em}=/......¡×¤Î¤è¤¦¤Ë¡¢³Æ¥É¥é¥¤¥Ö¤Î¥ë¡¼¥È¥Õ¥©¥ë¥À¤Î¤ß¡Öx:Y\hspace{-.75em}=¡×¤Î·Á¤ÇÆþÎϤ·¡¢¸å¤Ï/¤Ç¥Ñ¥¹¤ò¶èÀÚ¤ëɬÍפ¬¤¢¤ê¤Þ¤¹¡£ - -¤Ê¤ª¡¢¸½»þÅÀ¤Ç¤Ï¶õÇò¤ò´Þ¤à¥Ñ¥¹¤ò»ÈÍѤ¹¤ë¤È¥Õ¥¡¥¤¥ë¤Î¥¢¥Ã¥×¥í¡¼¥É¤¬Àµ¾ï¤Ë¹Ô¤ï¤ì¤Ê¤¤¾ì¹ç¤¬¤¢¤ê¤Þ¤¹¤¬¡¢¤³¤Î¤è¤¦¤Ê¾ì¹ç¤Ï¤¤¤ï¤æ¤ë 8.3 ·Á¼°¤Îû¤¤¥Õ¥¡¥¤¥ë¡¦¥Õ¥©¥ë¥À̾¤ò»ÈÍѤ¹¤ë¤ÈÌäÂê¤ò²óÈò¤¹¤ë¤³¤È¤¬¤Ç¤­¤Þ¤¹¡£ - -\subsection{VFS¥Ý¡¼¥È¥ì¥Ã¥È¤ò»È¤¦} -¤³¤³¤Ç¤Ï¡¢°ìÈ̥桼¥¶¡¼¤È¤·¤Æ¤³¤Î¥Ý¡¼¥È¥ì¥Ã¥È¤ò»ÈÍѤ¹¤ëÊýË¡¤òÀâÌÀ¤·¤Þ¤¹¡£ -¤³¤Î¥Ý¡¼¥È¥ì¥Ã¥È¤òÇÛÈ÷¤¹¤ë¤È¡¢¡Öɸ½à¤ÎURI¡×¤Ç»ØÄꤵ¤ì¤¿¥Ñ¥¹¤¬É½¼¨¤µ¤ì¤Þ¤¹¡£ -¥µ¥¤¥º¤¬É½¼¨¤µ¤ì¤Æ¤¤¤ë¤â¤Î¤¬¥Õ¥¡¥¤¥ë¡¢¥µ¥¤¥º¤Îɽ¼¨¤µ¤ì¤Æ¤¤¤Ê¤¤¤â¤Î¤¬¥Õ¥©¥ë¥À¤Ç¤¹¡£ -¤Ê¤ª¡¢OS¾å¤Ç¥Õ¥¡¥¤¥ë¤òÁàºî¤¹¤ë¸¢¸Â¤Ï¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¥µ¡¼¥Ð¤ò¼Â¹Ô¤¹¤ë¥æ¡¼¥¶¡¼¤Î¤â¤Î¤Ë¤Ê¤ê¤Þ¤¹¡£ - -\begin{figure}[ht] -\begin{center} -\includegraphics{./images/PAL0015.eps} -\caption{VFS Explorer ¥Ý¡¼¥È¥ì¥Ã¥È¤Î²èÌÌɽ¼¨} -\label{fig:PAL0015} -\end{center} -\end{figure} - -\subsubsection{¥Õ¥©¥ë¥À¤ò°ÜÆ°¤¹¤ë} -¥Õ¥©¥ë¥À¤Î¾ì¹ç¡¢¥Õ¥©¥ë¥À̾¤ò¥¯¥ê¥Ã¥¯¤¹¤ë¤È¡¢¤½¤Î¥Õ¥©¥ë¥À¤Ë°ÜÆ°¤¹¤ë¤³¤È¤¬¤Ç¤­¤Þ¤¹¡£ -¾å°Ì¥Õ¥©¥ë¥À¤Ø°ÜÆ°¤¹¤ë¾ì¹ç¤Ï¡¢¡Ö..¡×¤ò¥¯¥ê¥Ã¥¯¤·¤Þ¤¹¡£ - -\subsubsection{¥Õ¥¡¥¤¥ë¤ò¥À¥¦¥ó¥í¡¼¥É¤¹¤ë} -¥Õ¥¡¥¤¥ë¤Î¾ì¹ç¡¢¥Õ¥¡¥¤¥ë¤ò¥¯¥ê¥Ã¥¯¤¹¤ë¤È¤½¤Î¥Õ¥¡¥¤¥ë¤òɽ¼¨¡¢¤â¤·¤¯¤Ï¥À¥¦¥ó¥í¡¼¥É¤¹¤ë¤³¤È¤¬¤Ç¤­¤Þ¤¹¡£ -¡Ê±¦¥¯¥ê¥Ã¥¯¤Ç¥À¥¦¥ó¥í¡¼¥É¤¹¤ë¤³¤È¤â²Äǽ¤Ç¤¹¡Ë -¤Ê¤ª¡¢¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤Î¼ïÎà¤È¤½¤Îʸ»ú¥³¡¼¥É¤Ë¤è¤Ã¤Æ¤Ïʸ»ú²½¤±¤ËÃí°Õ¤¹¤ëɬÍפ¬¤¢¤ê¤Þ¤¹¡£ - -\subsubsection{¥Õ¥¡¥¤¥ë¤ä¥Õ¥©¥ë¥À¤òºï½ü¤¹¤ë} -¡Öºï½ü¡×¤ò¥¯¥ê¥Ã¥¯¤¹¤ë¤È¡¢¥Õ¥¡¥¤¥ë¤Þ¤¿¤Ï¥Õ¥©¥ë¥À¤òºï½ü¤¹¤ë¤³¤È¤¬¤Ç¤­¤Þ¤¹¡£ -¤Ê¤ª¡¢¥Õ¥©¥ë¥À¤òºï½ü¤·¤¿¾ì¹ç¡¢¤½¤ÎÃæ¤Ë´Þ¤Þ¤ì¤ë¥Õ¥¡¥¤¥ë¤âºï½ü¤µ¤ì¤Þ¤¹¡£ - -\subsubsection{¥Õ¥©¥ë¥À¤òºîÀ®¤¹¤ë} -\begin{figure}[ht] -\begin{center} -\includegraphics{./images/PAL0017.eps} -\caption{VFS Explorer ¥Õ¥©¥ë¥ÀºîÀ®²èÌÌ} -\label{fig:PAL0017} -\end{center} -\end{figure} -¡Ö¥Õ¥©¥ë¥À¤ÎºîÀ®¡×¤ò¥¯¥ê¥Ã¥¯¤¹¤ë¤È¡¢¥Õ¥©¥ë¥À¤ÎºîÀ®²èÌ̤¬É½¼¨¤µ¤ì¤Þ¤¹¡£ -¤³¤³¤Ç¤Ï¡¢¡Ö¥Õ¥©¥ë¥À̾¡×¤òÆþÎϤ¹¤ë¤È¡¢¤½¤Î̾Á°¤Î¥Õ¥©¥ë¥À¤ò¡ÖÂоݤΥѥ¹¡×¤Ëɽ¼¨¤µ¤ì¤Æ¤¤¤ë¥Ñ¥¹¤Î²¼¤ËºîÀ®¤¹¤ë¤³¤È¤¬¤Ç¤­¤Þ¤¹¡£ - -\subsubsection{¥Õ¥¡¥¤¥ë¤ò¥¢¥Ã¥×¥í¡¼¥É¤¹¤ë} -\begin{figure}[ht] -\begin{center} -\includegraphics{./images/PAL0019.eps} -\caption{VFS Explorer ¥¢¥Ã¥×¥í¡¼¥É²èÌÌ} -\label{fig:PAL0019} -\end{center} -\end{figure} -¡Ö¥¢¥Ã¥×¥í¡¼¥É¡×¤ò¥¯¥ê¥Ã¥¯¤¹¤ë¤È¡¢¥Õ¥¡¥¤¥ë¤Î¥¢¥Ã¥×¥í¡¼¥É²èÌ̤¬É½¼¨¤µ¤ì¤Þ¤¹¡£ -¤³¤³¤Ç¤Ï¡¢¡Ö»²¾È...¡×¥Ü¥¿¥ó¤ò²¡¤·¤Æ¥Õ¥¡¥¤¥ë¤òÁªÂò¤¹¤ë¤È¡¢¤½¤Î̾Á°¤Î¥Õ¥¡¥¤¥ë¤ò¡ÖÂоݤΥѥ¹¡×¤Ëɽ¼¨¤µ¤ì¤Æ¤¤¤ë¥Ñ¥¹¤Î²¼¤Ë¥¢¥Ã¥×¥í¡¼¥É¤¹¤ë¤³¤È¤¬¤Ç¤­¤Þ¤¹¡£¤Ê¤ª¡¢°ìÅ٤˥¢¥Ã¥×¥í¡¼¥É¤Ç¤­¤ë¥Õ¥¡¥¤¥ë¤Ï 1 ¸Ä¤Î¤ß¤Ç¤¹¡£ - -\chapter{¥¢¥É¥ì¥¹Ä¢} -\section{¤Ï¤¸¤á¤Ë} -¤³¤Î¥Ý¡¼¥È¥ì¥Ã¥È¤Ï¡¢¸Ä¿Í¾ðÊó¤È²ñ¼Ò¾ðÊó¤ò·ë¤Ó¤Ä¤±¤Æµ­Ï¿¤¹¤ë¤³¤È¤¬¤Ç¤­¤ë½»½êÏ¿¥Ý¡¼¥È¥ì¥Ã¥È¤Ç¤¹¡£ -¥¿¥Ö¤Ë¤è¤ê¡¢¸Ä¿Í¾ðÊó²èÌ̤Ȳñ¼Ò¾ðÊó²èÌ̤òÀÚ¤êÂؤ¨¤Æɽ¼¨¤µ¤»¤ë¤³¤È¤¬¤Ç¤­¤Þ¤¹¡£ -¡Ö¸Ä¿Í¡×¥¿¥Ö¤ò¥¯¥ê¥Ã¥¯¤·¤¿¾ì¹ç¤Ï¸Ä¿Í¾ðÊó²èÌ̤¬¡¢¡Ö²ñ¼Ò¡×¥¿¥Ö¤ò¥¯¥ê¥Ã¥¯¤·¤¿¾ì¹ç¤Ï²ñ¼Ò¾ðÊó²èÌ̤¬É½¼¨¤µ¤ì¤Þ¤¹¡£ - -\subsection{²ñ¼Ò¾ðÊó¤ÎÅÐÏ¿} -²ñ¼Ò¾ðÊó¤òÅÐÏ¿¤¹¤ë¤Ë¤Ï¡¢¡Ö¿·µ¬ÅÐÏ¿¡×¤ò¥¯¥ê¥Ã¥¯¤·¤Þ¤¹¡£ -²ñ¼Ò¾ðÊó¤òÅÐÏ¿¤¹¤ëºÝ¤Ë¤Ï¡¢°Ê²¼¤Î¹àÌܤòµ­Æþ¤Ç¤­¤Þ¤¹¡£ - -\begin{itemize} -\item ̾Á° -\item ̾Á° (¾ÜºÙ) -\item Éô½ð -\item ͹ÊØÈÖ¹æ -\item ÅÔÆ»Éܸ© -\item »Ô¶è·´ -\item Į¼̾ -\item ·úʪ̾¤Ê¤É -\item ÅÅÏÃÈÖ¹æ 1 -\item ÅÅÏÃÈÖ¹æ 2 -\item FaxÈÖ¹æ 1 -\item FaxÈÖ¹æ 2 -\item URL -\item ¸ø³«ÀßÄê : ¤³¤Î²ñ¼Ò¾ðÊó¤ò¸ø³«¤¹¤ë¤«¤·¤Ê¤¤¤«¤òÀßÄê¤Ç¤­¤Þ¤¹¡£ -\end{itemize} - -\subsection{¸Ä¿Í¾ðÊó¤ÎÅÐÏ¿} -¸Ä¿Í¾ðÊó¤òÅÐÏ¿¤¹¤ë¤Ë¤Ï¡¢¡Ö¿·µ¬ÅÐÏ¿¡×¤ò¥¯¥ê¥Ã¥¯¤·¤Þ¤¹¡£ -¸Ä¿Í¾ðÊó¤òÅÐÏ¿¤¹¤ëºÝ¤Ë¤Ï¡¢°Ê²¼¤Î¹àÌܤòµ­Æþ¤Ç¤­¤Þ¤¹¡£ - -\subsubsection{¸Ä¿Í} -¸Ä¿Í¤Î̾Á°¤Ë¤«¤«¤ï¤ë¾ðÊó¤òÆþÎϤ·¤Þ¤¹¡£°Ê²¼¤Î¤è¤¦¤Ê¹àÌܤ¬¤¢¤ê¤Þ¤¹¡£ - -\begin{itemize} -\item À« -\item À« (¾ÜºÙ) -\item ̾ -\item ̾ (¾ÜºÙ) -\item ¥ß¥É¥ë¥Í¡¼¥à -\item ·É¾Î (Á°) -\item ·É¾Î (¸å) -\item ¥Ë¥Ã¥¯¥Í¡¼¥à -\item Ìò¿¦ -\item ¸ø³«ÀßÄê -\end{itemize} - -\subsubsection{Ï¢ÍíÀè} -Ï¢ÍíÀè¤Ë¤«¤«¤ï¤ë¾ðÊó¤òÆþÎϤ·¤Þ¤¹¡£°Ê²¼¤Î¤è¤¦¤Ê¹àÌܤ¬¤¢¤ê¤Þ¤¹¡£ - -\begin{itemize} -\item ÅÅÏÃÈÖ¹æ (¸Ä¿ÍÍѼ«Âð) -\item ÅÅÏÃÈÖ¹æ (¸Ä¿ÍÍÑ·ÈÂÓÅÅÏÃ) -\item ¥á¡¼¥ë¥¢¥É¥ì¥¹ (¸Ä¿ÍÍÑ PC) -\item ¥á¡¼¥ë¥¢¥É¥ì¥¹ (¸Ä¿ÍÍÑ·ÈÂÓÅÅÏÃ) -\item FAX (¸Ä¿ÍÍÑ) -\item ÅÅÏÃÈÖ¹æ (²ñ¼Ò) -\item ÅÅÏÃÈÖ¹æ (²ñ¼ÒÍÑ·ÈÂÓÅÅÏÃ) -\item ¥á¡¼¥ë¥¢¥É¥ì¥¹ (²ñ¼ÒÍÑ PC) -\item ¥á¡¼¥ë¥¢¥É¥ì¥¹ (²ñ¼ÒÍÑ·ÈÂÓÅÅÏÃ) -\item FAX (²ñ¼Ò) -\end{itemize} - -\subsubsection{¼«Âð} -¼«Âð¤Î½»½ê¤òÅÐÏ¿¤Ç¤­¤Þ¤¹¡£ - -\begin{itemize} -\item ͹ÊØÈÖ¹æ -\item ÅÔÆ»Éܸ© -\item »Ô¶è·´ -\item Į¼̾ -\item ·úʪ̾¤Ê¤É -\end{itemize} - -\subsubsection{²ñ¼Ò} -Àè¤ËÅÐÏ¿¤·¤¿²ñ¼Ò¾ðÊó¤È´ØÏ¢ÉÕ¤±¤ë¤³¤È¤¬²Äǽ¤Ç¤¹¡£ -¤Ê¤ª¡¢²ñ¼Ò¾ðÊó¤È´ØÏ¢ÉÕ¤±¤Ê¤¤¤³¤È¤â¤Ç¤­¤Þ¤¹¡£ - -²ñ¼Ò¾ðÊó¤òÅÐÏ¿¤·¤Æ¤¤¤Ê¤¤¾ì¹ç¤Ï¡¢¡Ö¤Ê¤·¡×¡Ê²ñ¼Ò¾ðÊó¤È´ØÏ¢ÉÕ¤±¤Ê¤¤¡Ë¤Î¤ßÁªÂò²Äǽ¤Ç¤¹¡£ - -\subsubsection{¥«¥¹¥¿¥à} -¼«Í³¤Ë»È¤¨¤ë¹àÌܤǤ¹¡£ - -\begin{itemize} -\item ¥«¥¹¥¿¥à 1 -\item ¥«¥¹¥¿¥à 2 -\item ¥«¥¹¥¿¥à 3 -\item ¥«¥¹¥¿¥à 4 -\end{itemize} - \end{document} - Added: pal-portal/docs/ja/groupware-guide/trunk/src/tex/intro.tex =================================================================== --- pal-portal/docs/ja/groupware-guide/trunk/src/tex/intro.tex (rev 0) +++ pal-portal/docs/ja/groupware-guide/trunk/src/tex/intro.tex 2008-12-10 09:08:38 UTC (rev 1602) @@ -0,0 +1,31 @@ +\chapter{¤Ï¤¸¤á¤Ë} +\section{¤³¤Î¥É¥­¥å¥á¥ó¥È¤Ë¤Ä¤¤¤Æ} + +\subsection{ÂоÝÆɼÔ} +¤³¤Î¥É¥­¥å¥á¥ó¥È¤Ï¡¢N2 Collabo ¤ò»ÈÍѤ¹¤ë¥æ¡¼¥¶¡¼¤òÂоݤˤ·¤Æ¤¤¤Þ¤¹¡£ + +\subsection{¤ªÆɤߤˤʤëÁ°¤Ë} +¤³¤Î¥É¥­¥å¥á¥ó¥È¤Ç¤Ï¡¢N2 Collabo ¤Î»ÈÍÑÊýË¡¤ò¼¨¤·¤Æ¤¤¤Þ¤¹¡£ + +\subsection{¥ª¥ó¥é¥¤¥ó¤Ç¤Î¥¢¥¯¥»¥¹} +¥À¥¦¥ó¥í¡¼¥É¡¢ÀìÌçŪ¥µ¡¼¥Ó¥¹¡¢¥µ¥Ý¡¼¥È¡¢¤½¤Î¾¤Î³«È¯¼Ô¾ðÊó¤Ë¤Ä¤¤¤Æ¤Ï¡¢¼¡¤Ë¥¢¥¯¥»¥¹¤·¤Æ¤¯¤À¤µ¤¤¡£ + +\begin{itemize} +\item ¥×¥í¥¸¥§¥¯¥È¥µ¥¤¥È:http://pal.sourceforge.jp/ +\end{itemize} + +\subsection{µ»½ÑŪ¤Ê¥µ¥Ý¡¼¥È¤ÎÏ¢ÍíÀè} +ËÜÀ½Éʤ˴ؤ¹¤ëµ»½ÑŪ¼ÁÌä¤Ç¡¢¥É¥­¥å¥á¥ó¥ÈÆâ¤Ë²ò·èºö¤¬ÆÀ¤é¤ì¤Ê¤¤¾ì¹ç¤Ï¡¢¼¡¤Ë¥¢¥¯¥»¥¹¤·¤Æ¤¯¤À¤µ¤¤¡£ + +\begin{itemize} +\item ¸ø³«¥Õ¥©¡¼¥é¥à:http://sourceforge.jp/forum/?group\_id=1972 +\item ¥á¡¼¥ê¥ó¥°¥ê¥¹¥È:http://sourceforge.jp/mail/?group\_id=1972 +\end{itemize} + +\subsection{´ØÏ¢¥µ¡¼¥É¥Ñ¡¼¥Æ¥£¡¼ Web ¥µ¥¤¥È¤Î»²¾È} +Portal Application Laboratory¥×¥í¥¸¥§¥¯¥È¤Ç¤Ï¡¢¤³¤Î¥É¥­¥å¥á¥ó¥È¤Ëµ­ºÜ¤µ¤ì¤Æ¤¤¤ë¥µ¡¼¥É¥Ñ¡¼¥Æ¥£¡¼¤Î Web ¥µ¥¤¥È¤ÎÍ­¸úÀ­¤Ë¤Ä¤¤¤Æ¤ÏÀÕǤ¤ò»ý¤Á¤Þ¤»¤ó¡£ +Portal Application Laboratory¥×¥í¥¸¥§¥¯¥È¤Ï¤½¤Î¤è¤¦¤Ê¥µ¥¤¥È¤ä¥ê¥½¡¼¥¹¤òÄ̤¸¤Æ¡¢ÍøÍѲÄǽ¤Ê¥³¥ó¥Æ¥ó¥Ä¡¢¹­¹ð¡¢À½ÉÊ¡¢¥µ¡¼¥Ó¥¹¡¢¤½¤Î¾¤Î¥É¥­¥å¥á¥ó¥È¤Ê¤É¤Ë¤Ä¤¤¤Æ¡¢Êݾڡ¢ÀÕǤ¡¢µÁ̳¤òÉ餤¤Þ¤»¤ó¡£ +Portal Application Laboratory¥×¥í¥¸¥§¥¯¥È¤Ï¤½¤Î¤è¤¦¤Ê¥µ¥¤¥È¤ä¥ê¥½¡¼¥¹¤ÈÄ̤¸¤Æ¡¢ÍøÍѲÄǽ¤Ê¥³¥ó¥Æ¥ó¥Ä¡¢¹­¹ð¡¢À½ÉÊ¡¢¥µ¡¼¥Ó¥¹¡¢¤½¤Î¾¤Î¥É¥­¥å¥á¥ó¥È¤Ê¤É¤ò¡¢»ÈÍѤޤ¿¤Ï¿®ÍѤ·¤¿¤ê¡¢¤½¤ì¤Ë´ØÏ¢¤·¤ÆȯÀ¸¤Þ¤¿¤Ï¿½¤·Î©¤Æ¤é¤ì¤¿¡¢°ìÀڤλ½ý¤ä»³²¤ËÂФ·¤Æ¤ÏÀÕǤ¤Þ¤¿¤ÏµÁ̳¤òÉ餤¤Þ¤»¤ó¡£ + +\subsection{¥³¥á¥ó¥È¤ª¤è¤ÓÄó°Æ¤ÎÁ÷ÉÕÊýË¡} +Portal Application Laboratory¥×¥í¥¸¥§¥¯¥È¤Ï¡¢¤³¤Î¥É¥­¥å¥á¥ó¥È¤Î²þÁ±¤ËÅؤá¤Æ¤ª¤ê¡¢ÆɼԤ«¤é¤Î¥³¥á¥ó¥È¤ª¤è¤ÓÄó°Æ¤Ê¤É¤ò´¿·Þ¤·¤Æ¤¤¤Þ¤¹¡£ Added: pal-portal/docs/ja/groupware-guide/trunk/src/tex/portlet/addresslist.tex =================================================================== --- pal-portal/docs/ja/groupware-guide/trunk/src/tex/portlet/addresslist.tex (rev 0) +++ pal-portal/docs/ja/groupware-guide/trunk/src/tex/portlet/addresslist.tex 2008-12-10 09:08:38 UTC (rev 1602) @@ -0,0 +1,90 @@ +\chapter{¥¢¥É¥ì¥¹Ä¢} +%\section{¤Ï¤¸¤á¤Ë} + +¤³¤Î¥Ý¡¼¥È¥ì¥Ã¥È¤Ï¡¢¸Ä¿Í¾ðÊó¤È²ñ¼Ò¾ðÊó¤ò·ë¤Ó¤Ä¤±¤Æµ­Ï¿¤¹¤ë¤³¤È¤¬¤Ç¤­¤ë½»½êÏ¿¥Ý¡¼¥È¥ì¥Ã¥È¤Ç¤¹¡£ +¥¿¥Ö¤Ë¤è¤ê¡¢¸Ä¿Í¾ðÊó²èÌ̤Ȳñ¼Ò¾ðÊó²èÌ̤òÀÚ¤êÂؤ¨¤Æɽ¼¨¤µ¤»¤ë¤³¤È¤¬¤Ç¤­¤Þ¤¹¡£ +¡Ö¸Ä¿Í¡×¥¿¥Ö¤ò¥¯¥ê¥Ã¥¯¤·¤¿¾ì¹ç¤Ï¸Ä¿Í¾ðÊó²èÌ̤¬¡¢¡Ö²ñ¼Ò¡×¥¿¥Ö¤ò¥¯¥ê¥Ã¥¯¤·¤¿¾ì¹ç¤Ï²ñ¼Ò¾ðÊó²èÌ̤¬É½¼¨¤µ¤ì¤Þ¤¹¡£ + +\section{²ñ¼Ò¾ðÊó¤ÎÅÐÏ¿} +²ñ¼Ò¾ðÊó¤òÅÐÏ¿¤¹¤ë¤Ë¤Ï¡¢¡Ö¿·µ¬ÅÐÏ¿¡×¤ò¥¯¥ê¥Ã¥¯¤·¤Þ¤¹¡£ +²ñ¼Ò¾ðÊó¤òÅÐÏ¿¤¹¤ëºÝ¤Ë¤Ï¡¢°Ê²¼¤Î¹àÌܤòµ­Æþ¤Ç¤­¤Þ¤¹¡£ + +\begin{itemize} +\item ̾Á° +\item ̾Á° (¾ÜºÙ) +\item Éô½ð +\item ͹ÊØÈÖ¹æ +\item ÅÔÆ»Éܸ© +\item »Ô¶è·´ +\item Į¼̾ +\item ·úʪ̾¤Ê¤É +\item ÅÅÏÃÈÖ¹æ 1 +\item ÅÅÏÃÈÖ¹æ 2 +\item FaxÈÖ¹æ 1 +\item FaxÈÖ¹æ 2 +\item URL +\item ¸ø³«ÀßÄê : ¤³¤Î²ñ¼Ò¾ðÊó¤ò¸ø³«¤¹¤ë¤«¤·¤Ê¤¤¤«¤òÀßÄê¤Ç¤­¤Þ¤¹¡£ +\end{itemize} + +\section{¸Ä¿Í¾ðÊó¤ÎÅÐÏ¿} +¸Ä¿Í¾ðÊó¤òÅÐÏ¿¤¹¤ë¤Ë¤Ï¡¢¡Ö¿·µ¬ÅÐÏ¿¡×¤ò¥¯¥ê¥Ã¥¯¤·¤Þ¤¹¡£ +¸Ä¿Í¾ðÊó¤òÅÐÏ¿¤¹¤ëºÝ¤Ë¤Ï¡¢°Ê²¼¤Î¹àÌܤòµ­Æþ¤Ç¤­¤Þ¤¹¡£ + +\subsection{¸Ä¿Í} +¸Ä¿Í¤Î̾Á°¤Ë¤«¤«¤ï¤ë¾ðÊó¤òÆþÎϤ·¤Þ¤¹¡£°Ê²¼¤Î¤è¤¦¤Ê¹àÌܤ¬¤¢¤ê¤Þ¤¹¡£ + +\begin{itemize} +\item À« +\item À« (¾ÜºÙ) +\item ̾ +\item ̾ (¾ÜºÙ) +\item ¥ß¥É¥ë¥Í¡¼¥à +\item ·É¾Î (Á°) +\item ·É¾Î (¸å) +\item ¥Ë¥Ã¥¯¥Í¡¼¥à +\item Ìò¿¦ +\item ¸ø³«ÀßÄê +\end{itemize} + +\subsection{Ï¢ÍíÀè} +Ï¢ÍíÀè¤Ë¤«¤«¤ï¤ë¾ðÊó¤òÆþÎϤ·¤Þ¤¹¡£°Ê²¼¤Î¤è¤¦¤Ê¹àÌܤ¬¤¢¤ê¤Þ¤¹¡£ + +\begin{itemize} +\item ÅÅÏÃÈÖ¹æ (¸Ä¿ÍÍѼ«Âð) +\item ÅÅÏÃÈÖ¹æ (¸Ä¿ÍÍÑ·ÈÂÓÅÅÏÃ) +\item ¥á¡¼¥ë¥¢¥É¥ì¥¹ (¸Ä¿ÍÍÑ PC) +\item ¥á¡¼¥ë¥¢¥É¥ì¥¹ (¸Ä¿ÍÍÑ·ÈÂÓÅÅÏÃ) +\item FAX (¸Ä¿ÍÍÑ) +\item ÅÅÏÃÈÖ¹æ (²ñ¼Ò) +\item ÅÅÏÃÈÖ¹æ (²ñ¼ÒÍÑ·ÈÂÓÅÅÏÃ) +\item ¥á¡¼¥ë¥¢¥É¥ì¥¹ (²ñ¼ÒÍÑ PC) +\item ¥á¡¼¥ë¥¢¥É¥ì¥¹ (²ñ¼ÒÍÑ·ÈÂÓÅÅÏÃ) +\item FAX (²ñ¼Ò) +\end{itemize} + +\subsection{¼«Âð} +¼«Âð¤Î½»½ê¤òÅÐÏ¿¤Ç¤­¤Þ¤¹¡£ + +\begin{itemize} +\item ͹ÊØÈÖ¹æ +\item ÅÔÆ»Éܸ© +\item »Ô¶è·´ +\item Į¼̾ +\item ·úʪ̾¤Ê¤É +\end{itemize} + +\subsubsection{²ñ¼Ò} +Àè¤ËÅÐÏ¿¤·¤¿²ñ¼Ò¾ðÊó¤È´ØÏ¢ÉÕ¤±¤ë¤³¤È¤¬²Äǽ¤Ç¤¹¡£ +¤Ê¤ª¡¢²ñ¼Ò¾ðÊó¤È´ØÏ¢ÉÕ¤±¤Ê¤¤¤³¤È¤â¤Ç¤­¤Þ¤¹¡£ + +²ñ¼Ò¾ðÊó¤òÅÐÏ¿¤·¤Æ¤¤¤Ê¤¤¾ì¹ç¤Ï¡¢¡Ö¤Ê¤·¡×¡Ê²ñ¼Ò¾ðÊó¤È´ØÏ¢ÉÕ¤±¤Ê¤¤¡Ë¤Î¤ßÁªÂò²Äǽ¤Ç¤¹¡£ + +\subsection{¥«¥¹¥¿¥à} +¼«Í³¤Ë»È¤¨¤ë¹àÌܤǤ¹¡£ + +\begin{itemize} +\item ¥«¥¹¥¿¥à 1 +\item ¥«¥¹¥¿¥à 2 +\item ¥«¥¹¥¿¥à 3 +\item ¥«¥¹¥¿¥à 4 +\end{itemize} Added: pal-portal/docs/ja/groupware-guide/trunk/src/tex/portlet/board.tex =================================================================== --- pal-portal/docs/ja/groupware-guide/trunk/src/tex/portlet/board.tex (rev 0) +++ pal-portal/docs/ja/groupware-guide/trunk/src/tex/portlet/board.tex 2008-12-10 09:08:38 UTC (rev 1602) @@ -0,0 +1,136 @@ +\chapter{·Ç¼¨ÈÄ} +%\section{¤Ï¤¸¤á¤Ë} +¤³¤Î¥Ý¡¼¥È¥ì¥Ã¥È¤Ï¡¢¥Ý¡¼¥¿¥ë¾å¤Ç»ÈÍѤǤ­¤ë·Ç¼¨ÈĤǤ¹¡£°Ê²¼¤Î¤è¤¦¤Êµ¡Ç½¤òÈ÷¤¨¤Æ¤¤¤Þ¤¹¡£ +\begin{itemize} +\item µ­»ö¤Î¥«¥Æ¥´¥êʬ¤±¤È¡¢¥«¥Æ¥´¥êÊ̤˥¢¥¯¥»¥¹¸¢¤òÀßÄꤹ¤ëµ¡Ç½ +\item Ǥ°Õ¤Î¥Õ¥¡¥¤¥ë¤òźÉÕ¤¹¤ëµ¡Ç½ +\item ʸ»ú¿ô¤äźÉդǤ­¤ë¥Õ¥¡¥¤¥ë¤Î¥µ¥¤¥º¤òÀ©¸Â¤¹¤ëµ¡Ç½ +\end{itemize} + +\section{»È¤¤Êý} +¤³¤Î¥Ý¡¼¥È¥ì¥Ã¥È¤Î»È¤¤Êý¤Ï°Ê²¼¤ÎÄ̤ê¤Ç¤¹¡£ + +\subsection{·Ç¼¨ÈĤò»ÈÍѤ¹¤ë} +¤³¤³¤Ç¤Ï¡¢°ìÈ̥桼¥¶¡¼¤È¤·¤Æµ­»ö¤òÅê¹Æ¤¹¤ëÊýË¡¤È¥Õ¥¡¥¤¥ë¤òźÉÕ¤¹¤ëÊýË¡¤òÀâÌÀ¤·¤Þ¤¹¡£ +¤Þ¤º¡¢¤³¤Î¥Ý¡¼¥È¥ì¥Ã¥È(Message Viewer)¤òÇÛÈ÷¤·¤Æ¤¯¤À¤µ¤¤¡£ +¤¹¤ë¤È¡¢¤³¤Î¤è¤¦¤Ê²èÌ̤¬É½¼¨¤µ¤ì¤Þ¤¹¡£ + +\begin{figure}[ht] +\begin{center} +\includegraphics[width=120mm]{./images/PAL0004.eps} +\caption{Message Viewer ¥Ý¡¼¥È¥ì¥Ã¥È¤Îµ­»ö°ìÍ÷²èÌÌɽ¼¨} +\label{fig:PAL0004} +\end{center} +\end{figure} + +\subsubsection{µ­»ö¤òÅê¹Æ¤¹¤ë} +µ­»ö¤òÅê¹Æ¤¹¤ë¤Ë¤Ï¡¢¡Ö¿·µ¬ºîÀ®¡×¤ò¥¯¥ê¥Ã¥¯¤·¤Þ¤¹¡£ +µ­»ö¤òÅê¹Æ¤¹¤ëºÝ¤Ë¤Ï¡¢°Ê²¼¤Î¹àÌܤ¬»ØÄê¤Ç¤­¤Þ¤¹¡£ + +\begin{figure}[ht] +\begin{center} +\includegraphics[width=120mm]{./images/PAL0001.eps} +\caption{Message Viewer ¥Ý¡¼¥È¥ì¥Ã¥È¤Îµ­»öÅê¹Æ²èÌÌɽ¼¨} +\label{fig:PAL0001} +\end{center} +\end{figure} + +\begin{itemize} +\item º¹½Ð¿Í̾ : º¹½Ð¿Í¤Î̾Á°¤òÆþÎϤ·¤Þ¤¹¡£(¥Ç¥Õ¥©¥ë¥È¤Ç¤Ï¥æ¡¼¥¶¡¼Ì¾¤¬ÆþÎϤµ¤ì¤Æ¤¤¤Þ¤¹) +\item ɸÂê : ɸÂê¤òÆþÎϤ·¤Þ¤¹¡£ +\item ËÜʸ : ËÜʸ¤òÆþÎϤ·¤Þ¤¹¡£Board Configuration ¥Ý¡¼¥È¥ì¥Ã¥È¤Ç»ØÄꤷ¤¿ºÇÂçʸ»ú¿ô¤Þ¤ÇÆþÎϤǤ­¤Þ¤¹¡£ +\item ¸ø³«³«»ÏÆü»þ : ¤³¤Îµ­»ö¤Îɽ¼¨¤ò³«»Ï¤¹¤ëÆü»þ¤ò»ØÄꤷ¤Þ¤¹¡£ +\item ¸ø³«½ªÎ»Æü»þ : ¤³¤Îµ­»ö¤Îɽ¼¨¤ò½ªÎ»¤¹¤ëÆü»þ¤ò»ØÄꤷ¤Þ¤¹¡£ +\item ¤³¤Îµ­»ö¾å¤ÇµÄÏÀ¤¹¤ë : ¤³¤Îµ­»ö¤Ø¤ÎÊÖ¿®¤òǧ¤á¤ë¤«Èݤ«¤òÀßÄꤷ¤Þ¤¹¡£ +\item ¸ø³« : ¤³¤Îµ­»ö¤ò¸ø³«¤¹¤ë¤«°ì»þÊݸµ­»ö¤Ë¤¹¤ë¤«¤òÀßÄꤷ¤Þ¤¹¡£¸ø³«¤·¤¿¾ì¹ç¡¢Â¾¤Î¥æ¡¼¥¶¡¼¤¬±ÜÍ÷¤¹¤ë¤³¤È¤Î¤Ç¤­¤ëµ­»ö¤Ë¤Ê¤ê¤Þ¤¹¤¬¡¢Board Configuration ¥Ý¡¼¥È¥ì¥Ã¥È¤Ç¤ÎÀßÄê¤Ë¤è¤Ã¤Æ¤Ï¸ø³«¸å¤ÎÊÔ½¸¤Ï¤Ç¤­¤Ê¤¤¾ì¹ç¤â¤¢¤ê¤Þ¤¹¡£°ì»þÊݸµ­»ö¤Î¾ì¹ç¤Ï¼«Ê¬¤Î¤ß±ÜÍ÷¤Ç¤­¤Þ¤¹¡£ +\end{itemize} + +¤Ê¤ª¡¢µ­»ö¤òÅê¹Æ¤¹¤ë¤Þ¤Ç¤Ï¥Õ¥¡¥¤¥ë¤ÎźÉդϹԤ¦¤³¤È¤¬¤Ç¤­¤Þ¤»¤ó¡£ + +\subsubsection{µ­»ö¤ËÂФ·¤ÆÊÖ¿®¤¹¤ë} +µ­»ö¤ÎɸÂê¤ò¥¯¥ê¥Ã¥¯¤·¡¢µ­»ö¤òɽ¼¨¤µ¤»¤Æ¤¯¤À¤µ¤¤¡£ + +\begin{figure}[ht] +\begin{center} +\includegraphics[width=120mm]{./images/PAL0006.eps} +\caption{Message Viewer ¥Ý¡¼¥È¥ì¥Ã¥È¤Îµ­»ö¾ÜºÙ²èÌÌɽ¼¨ : ¥³¥á¥ó¥È¤ÎÅê¹Æ} +\label{fig:PAL0006} +\end{center} +\end{figure} + +µ­»ö¤ÎËÜʸÅù¤Î²¼¤ËÊÖ¿®¤Î½ñ¤­¹þ¤ßÍ󤬤¢¤ê¤Þ¤¹¡£¤³¤³¤ÇÊÖ¿®¤ò½ñ¤­¹þ¤à¤³¤È¤¬¤Ç¤­¤Þ¤¹¡£ + +\begin{itemize} +\item º¹½Ð¿Í̾ : º¹½Ð¿Í¤Î̾Á°¤òÆþÎϤ·¤Þ¤¹¡£(¥Ç¥Õ¥©¥ë¥È¤Ç¤Ï¥æ¡¼¥¶¡¼Ì¾¤¬ÆþÎϤµ¤ì¤Æ¤¤¤Þ¤¹) +\item ËÜʸ : ËÜʸ¤òÆþÎϤ·¤Þ¤¹¡£Board Configuration ¥Ý¡¼¥È¥ì¥Ã¥È¤Ç»ØÄꤷ¤¿ºÇÂçʸ»ú¿ô¤Þ¤ÇÆþÎϤǤ­¤Þ¤¹¡£ +\end{itemize} + +¤Ê¤ª¡¢¿Æµ­»ö¤ÎÅê¹Æ¼Ô¤Ï¡¢µ­»ö¤Ø¤Î¥³¥á¥ó¥È¤òºï½ü¤¹¤ë¤³¤È¤¬¤Ç¤­¤Þ¤¹¡£ + +\subsubsection{¥Õ¥¡¥¤¥ë¤òźÉÕ¤¹¤ë} +¤³¤Î¥Ý¡¼¥È¥ì¥Ã¥È¤Ç¤Ïµ­»ö¤Î¿·µ¬Åê¹Æ»þ¤Ë¥Õ¥¡¥¤¥ë¤òźÉÕ¤¹¤ë¤³¤È¤Ï¤Ç¤­¤Þ¤»¤ó¡£ +¤¤¤Ã¤¿¤ó°ì»þÊݸµ­»ö¤È¤·¤ÆÅê¹Æ¤·¤¿¸å¤Ëµ­»ö¤òÊÔ½¸¤·¡¢¤½¤ÎºÝ¤ËźÉÕ¥Õ¥¡¥¤¥ë¤òÁ÷¿®¤¹¤ë¤³¤È¤¬É¬ÍפǤ¹¡£ + +\begin{figure}[ht] +\begin{center} +\includegraphics[width=120mm]{./images/PAL0007.eps} +\caption{Message Viewer ¥Ý¡¼¥È¥ì¥Ã¥È¤Îµ­»öÊÔ½¸²èÌÌɽ¼¨} +\label{fig:PAL0007} +\end{center} +\end{figure} + +µ­»ö¤òÊÔ½¸¤¹¤ëºÝ¤Ë¡¢¥Õ¥¡¥¤¥ë¤òźÉդǤ­¤Þ¤¹¡£ÅºÉÕ¥Õ¥¡¥¤¥ë¤ò»ØÄꤹ¤ë¤È¶¦¤Ë¡¢ÅºÉÕ¤¹¤ë¥Õ¥¡¥¤¥ë¤ËÂФ·¤Æ¥³¥á¥ó¥È¤òÉÕ¤±¤ë¤³¤È¤¬¤Ç¤­¤Þ¤¹¡£ + +\subsection{·Ç¼¨ÈĤò´ÉÍý¤¹¤ë} +¤³¤³¤Ç¤Ï¡¢´ÉÍý¼Ô¤È¤·¤Æ¡¢µ­»ö¤òÄɲá¦ÊÔ½¸¡¦ºï½ü¤¹¤ëÊýË¡¤äµ­»ö¤ò¥«¥Æ¥´¥êʬ¤±¤¹¤ë¤¿¤á¤Î¥«¥Æ¥´¥ê¤ÎÄɲäÎÊýË¡¡¢¥«¥Æ¥´¥ê¤Î¥¢¥¯¥»¥¹¸¢¤ÎÀßÄêÊýË¡¤òÀâÌÀ¤·¤Þ¤¹¡£ + +\subsubsection{µ­»ö¤ÎÄɲá¦ÊÔ½¸¡¦ºï½ü} +admin ¥í¡¼¥ë¤Î¥æ¡¼¥¶¤Î¤ß¤¬»ÈÍѲÄǽ¤Ê Message Admin ¥Ý¡¼¥È¥ì¥Ã¥È¤ò»ÈÍѤ·¤Þ¤¹¡£ +¤³¤Î¥Ý¡¼¥È¥ì¥Ã¥È¤Ç¤Ï¡¢Ä̾ï¤ÈƱÍͤ˵­»ö¤ò±ÜÍ÷¡¦ÊÔ½¸¡¦ºï½ü¤Ç¤­¤Þ¤¹¤¬¡¢°ìÈ̤Υ桼¥¶¤¬Åê¹Æ¤·¤¿µ­»ö¤ËÂФ·¤Æ¤âÊÔ½¸¡¦ºï½ü¤ò¹Ô¤¦¤³¤È¤¬²Äǽ¤Ç¤¹¡£ + +\subsubsection{¥«¥Æ¥´¥ê¤ÎÄɲá¦ÊÔ½¸¡¦ºï½ü} +admin ¥í¡¼¥ë¤Î¥æ¡¼¥¶¤Î¤ß¤¬»ÈÍѲÄǽ¤Ê Category Editor ¥Ý¡¼¥È¥ì¥Ã¥È¤ò»ÈÍѤ·¤Þ¤¹¡£ + +\begin{figure}[ht] +\begin{center} +\includegraphics[width=120mm]{./images/PAL0009.eps} +\caption{Category Editor ¥Ý¡¼¥È¥ì¥Ã¥È¤Î¥«¥Æ¥´¥êÊÔ½¸²èÌÌɽ¼¨} +\label{fig:PAL0009} +\end{center} +\end{figure} + +¤³¤Î¥Ý¡¼¥È¥ì¥Ã¥È¤Ç¡Ö¿·µ¬ºîÀ®¡×¤ò¥¯¥ê¥Ã¥¯¤¹¤ë¤È¡¢¥«¥Æ¥´¥ê¤òºîÀ®¤¹¤ë¤³¤È¤¬¤Ç¤­¤Þ¤¹¡£ + +\begin{figure}[ht] +\begin{center} +\includegraphics[width=120mm]{./images/PAL0010.eps} +\caption{Category Editor ¥Ý¡¼¥È¥ì¥Ã¥È¤Î¥«¥Æ¥´¥êºîÀ®²èÌÌɽ¼¨} +\label{fig:PAL0010} +\end{center} +\end{figure} + +¤Ê¤ª¡¢¥«¥Æ¥´¥ê¤ÎºîÀ®¤ËɬÍפʾðÊó¤Ï¥«¥Æ¥´¥ê̾¤Î¤ß¤Ç¤¹¡£ + +\subsubsection{¥¢¥¯¥»¥¹¸¢¤ÎÀßÄê} +TBD + +\subsubsection{ʸ»ú¿ô¤äźÉդǤ­¤ë¥Õ¥¡¥¤¥ë¤Î¥µ¥¤¥º¤òÀ©¸Â¤¹¤ë} +admin ¥í¡¼¥ë¤Î¥æ¡¼¥¶¤Î¤ß¤¬»ÈÍѲÄǽ¤Ê Board Configuration ¥Ý¡¼¥È¥ì¥Ã¥È¤ò»ÈÍѤ·¤Þ¤¹¡£ + +\begin{figure}[ht] +\begin{center} +\includegraphics[width=80mm]{./images/PAL0014.eps} +\caption{Board Configuration ¥Ý¡¼¥È¥ì¥Ã¥È¤Î²èÌÌɽ¼¨} +\label{fig:PAL0014} +\end{center} +\end{figure} + +¤³¤Î¥Ý¡¼¥È¥ì¥Ã¥È¤Ç¤Ï°Ê²¼¤Î¹àÌܤ¬»ØÄê¤Ç¤­¤Þ¤¹¡£ + +\begin{itemize} +\item Åê¹Æµ­»ö¤ÎºÇÂçʸ»ú¿ô : µ­»ö¤òÅê¹Æ¤¹¤ëºÝ¤ÎºÇÂç¤Îʸ»ú¿ô¤ò»ØÄꤷ¤Þ¤¹¡£(Á´³Ñ¡¢È¾³Ñ¤Ë¤³¤À¤ï¤é¤ºÊ¸»ú¿ôñ°Ì¤Ç¤Î»ØÄê¤È¤Ê¤ê¤Þ¤¹) +\item ÊÖ¿®¤ÎºÇÂçʸ»ú¿ô : ÊÖ¿®¤¹¤ëºÝ¤ÎºÇÂç¤Îʸ»ú¿ô¤ò»ØÄꤷ¤Þ¤¹¡£(Á´³Ñ¡¢È¾³Ñ¤Ë¤³¤À¤ï¤é¤ºÊ¸»ú¿ôñ°Ì¤Ç¤Î»ØÄê¤È¤Ê¤ê¤Þ¤¹) +\item Åê¹Æ¸å¤ÎÊÔ½¸ : Åê¹Æ¸å¤ËºÆÅÙÊÔ½¸¤òǧ¤á¤ë¤«Èݤ«¤òÀßÄê¤Ç¤­¤Þ¤¹¡£ +\item źÉÕ¥Õ¥¡¥¤¥ë¤ÎºÇÂ祵¥¤¥º : źÉÕ¥Õ¥¡¥¤¥ë¤ÎºÇÂ祵¥¤¥º¤ò¥Ð¥¤¥Èñ°Ì¤Ç»ØÄê¤Ç¤­¤Þ¤¹¡£ +\end{itemize} + Added: pal-portal/docs/ja/groupware-guide/trunk/src/tex/portlet/bookmark.tex =================================================================== --- pal-portal/docs/ja/groupware-guide/trunk/src/tex/portlet/bookmark.tex (rev 0) +++ pal-portal/docs/ja/groupware-guide/trunk/src/tex/portlet/bookmark.tex 2008-12-10 09:08:38 UTC (rev 1602) @@ -0,0 +1,128 @@ +\chapter{¥Ö¥Ã¥¯¥Þ¡¼¥¯} +%\section{¤Ï¤¸¤á¤Ë} +¤³¤Î¥Ý¡¼¥È¥ì¥Ã¥È¤Ï¸Ä¿ÍÍѤª¤è¤Ó¶¦Í­¥Ö¥Ã¥¯¥Þ¡¼¥¯¤ò´ÉÍý¤¹¤ë¥Ý¡¼¥È¥ì¥Ã¥È¤Ç¤¹¡£ +ºîÀ®¤·¤¿¥«¥Æ¥´¥ê¤ä¥Ö¥Ã¥¯¥Þ¡¼¥¯¤ÏÅÐÏ¿¼Ô°Ê³°¤¬»ÈÍѤ¹¤ë¤³¤È¤Ï¤Ç¤­¤Þ¤»¤ó¤¬¡¢¶¦Í­¤Î¥«¥Æ¥´¥ê¤Ë¥Ö¥Ã¥¯¥Þ¡¼¥¯¤òÅÐÏ¿¤·¤¿¾ì¹ç¡¢ÅÐÏ¿¼Ô°Ê³°¤âÍøÍѤǤ­¤ë¶¦Í­¤Î¥Ö¥Ã¥¯¥Þ¡¼¥¯¤È¤·¤Æ»ÈÍѤ¹¤ë¤³¤È¤¬¤Ç¤­¤Þ¤¹¡£ + +\section{»È¤¤Êý} + +¤³¤Î¥Ý¡¼¥È¥ì¥Ã¥È¤Î»È¤¤Êý¤Ï°Ê²¼¤ÎÄ̤ê¤Ç¤¹¡£ + +\subsection{¥Ö¥Ã¥¯¥Þ¡¼¥¯¤ò»ÈÍѤ¹¤ë} +¤³¤³¤Ç¤Ï¡¢°ìÈ̥桼¥¶¡¼¤È¤·¤Æ¤³¤Î¥Ý¡¼¥È¥ì¥Ã¥È¤ò»ÈÍѤ¹¤ëÊýË¡¤òÀâÌÀ¤·¤Þ¤¹¡£ +¤Þ¤º¡¢¤³¤Î¥Ý¡¼¥È¥ì¥Ã¥È(Bookmark Viewer)¤òÇÛÈ÷¤·¤Æ¤¯¤À¤µ¤¤¡£ +¤¹¤ë¤È¡¢¤³¤Î¤è¤¦¤Ê²èÌ̤¬É½¼¨¤µ¤ì¤Þ¤¹¡£ + +\begin{figure}[ht] +\begin{center} +\includegraphics[width=120mm]{./images/PAL0026.eps} +\caption{Bookmark Viewer ¥Ý¡¼¥È¥ì¥Ã¥È¤Î¥Ö¥Ã¥¯¥Þ¡¼¥¯°ìÍ÷²èÌÌɽ¼¨} +\label{fig:PAL0026} +\end{center} +\end{figure} + +\subsubsection{¥Ö¥Ã¥¯¥Þ¡¼¥¯¤òºîÀ®¤¹¤ë} + +\begin{figure}[ht] +\begin{center} +\includegraphics[width=120mm]{./images/PAL0028.eps} +\caption{Bookmark Viewer ¥Ý¡¼¥È¥ì¥Ã¥È¤Î¥Ö¥Ã¥¯¥Þ¡¼¥¯ÅÐÏ¿²èÌÌɽ¼¨} +\label{fig:PAL0028} +\end{center} +\end{figure} + +¡Ö¥ê¥ó¥¯ºîÀ®¡×¤ò¥¯¥ê¥Ã¥¯¤¹¤ë¤È¡¢¥Ö¥Ã¥¯¥Þ¡¼¥¯ºîÀ®²èÌ̤¬É½¼¨¤µ¤ì¤Þ¤¹¡£ +¥Ö¥Ã¥¯¥Þ¡¼¥¯ºîÀ®»þ¤Ë¤Ï¡¢°Ê²¼¤Î¹àÌܤòÆþÎϤǤ­¤Þ¤¹¡£ + +\begin{itemize} +\item ̾Á° : ¥Ö¥Ã¥¯¥Þ¡¼¥¯¤Ëɽ¼¨¤µ¤ì¤ë̾Á°¤òÆþÎϤ·¤Þ¤¹¡£ +\item URL : ³«¤­¤¿¤¤¥µ¥¤¥È¤ÎURL¤òµ­½Ò¤·¤Þ¤¹¡£ +\item ¥á¥â : ¥á¥â¤òµ­½Ò¤·¤Þ¤¹¡£ +\item ¥«¥Æ¥´¥ê : ¥«¥Æ¥´¥ê¤òÁªÂò¤·¤Þ¤¹¡£¥Ç¥Õ¥©¥ë¥È¤Ç¤Ï̤ʬÎà¤Ë¤Ê¤Ã¤Æ¤¤¤Þ¤¹¤¬¡¢¥«¥Æ¥´¥ê¤òºîÀ®¤·¤ÆÅÐÏ¿¤¹¤ë¤³¤È¤â¤Ç¤­¤Þ¤¹¡£ +\item ¼ïÎà : ¿·¤·¤¤¥¦¥¤¥ó¥É¥¦¤Þ¤¿¤Ï¥¿¥Ö¤Ç³«¤¯¡Ê¥Ö¥é¥¦¥¶¤Ë¤è¤Ã¤Æ°Û¤Ê¤ê¤Þ¤¹¡Ë¤«¡¢Æ±¤¸¥¦¥¤¥ó¥É¥¦¤Ç³«¤¯¤«ÁªÂò¤·¤Þ¤¹¡£ +\end{itemize} + +¤Á¤Ê¤ß¤Ë¡¢³Æ¥Ö¥é¥¦¥¶¤Ç¡Ö¿·¤·¤¤¥¦¥¤¥ó¥É¥¦¤Þ¤¿¤Ï¥¿¥Ö¤Ç³«¤¯¡×¾ì¹ç¤ÎÆ°ºî¤Ï°Ê²¼¤ÎÄ̤ê¤Ç¤¹¡£ +\begin{itemize} +\item Microsoft Internet Explorer 6 : ¿·¤·¤¤¥¦¥¤¥ó¥É¥¦¤Ç³«¤­¤Þ¤¹¡£ +\item Microsoft Internet Explorer 7 : ¿·¤·¤¤¥¦¥¤¥ó¥É¥¦¤Ç³«¤­¤Þ¤¹¡£ +\item Mozilla Firefox 3 : ¿·¤·¤¤¥¿¥Ö¤Ç³«¤­¤Þ¤¹¡£ +\item Google Chrome : ¿·¤·¤¤¥¿¥Ö¤Ç³«¤­¤Þ¤¹¡£ +\item Apple Safari : ¿·¤·¤¤¥¦¥¤¥ó¥É¥¦¤Ç³«¤­¤Þ¤¹¡£ +\end{itemize} + +¤³¤Î¥Ö¥Ã¥¯¥Þ¡¼¥¯¤Ï´ÉÍý¼Ô¤ò½ü¤­¡¢ºîÀ®¤·¤¿ËܿͤΤߤ¬ÍøÍѤǤ­¤Þ¤¹¡£ + +\subsubsection{¥Ö¥Ã¥¯¥Þ¡¼¥¯¤ò³«¤¯} +¥Ö¥Ã¥¯¥Þ¡¼¥¯¤Î¹àÌÜ̾¤ò¥¯¥ê¥Ã¥¯¤¹¤ë¤È¡¢ºîÀ®»þ¤ËÀßÄꤷ¤¿Ä̤ê¤Ë¥¦¥¤¥ó¥É¥¦¤¬³«¤­¤Þ¤¹¡£ + +\subsubsection{¥«¥Æ¥´¥ê¤òºîÀ®¤¹¤ë} +½é´üɽ¼¨²èÌ̤ˤơ֥«¥Æ¥´¥ê°ìÍ÷¡×¤ò¥¯¥ê¥Ã¥¯¤¹¤ë¤È¡¢¥«¥Æ¥´¥ê°ìÍ÷²èÌ̤¬É½¼¨¤µ¤ì¤Þ¤¹¡£ + +\begin{figure}[ht] +\begin{center} +\includegraphics[width=120mm]{./images/PAL0029.eps} +\caption{Bookmark Viewer ¥Ý¡¼¥È¥ì¥Ã¥È¤Î¥«¥Æ¥´¥ê°ìÍ÷²èÌÌɽ¼¨} +\label{fig:PAL0029} +\end{center} +\end{figure} + +¤³¤³¤Ç¡¢¡Ö¥«¥Æ¥´¥êºîÀ®¡×¤ò¥¯¥ê¥Ã¥¯¤¹¤ë¤È¥«¥Æ¥´¥ê¤òºîÀ®¤¹¤ë¤³¤È¤¬¤Ç¤­¤Þ¤¹¡£ +¤³¤³¤Ç¤Ï´ÉÍý¼Ô¤È¤·¤Æ¡¢¤³¤Î¥Ý¡¼¥È¥ì¥Ã¥È¤ò´ÉÍý¤¹¤ëÊýË¡¤òÀâÌÀ¤·¤Þ¤¹¡£ +admin ¥í¡¼¥ë¤Î¥æ¡¼¥¶¤Î¾ì¹ç¡¢´ÉÍýÍѤΥݡ¼¥È¥ì¥Ã¥È(Bookmark Manager)¤òÇÛÈ÷¤¹¤ë¤³¤È¤¬¤Ç¤­¤Þ¤¹¡£ + +\begin{figure}[ht] +\begin{center} +\includegraphics[width=120mm]{./images/PAL0021.eps} +\caption{Bookmark Manager ¥Ý¡¼¥È¥ì¥Ã¥È¤Î¥Ö¥Ã¥¯¥Þ¡¼¥¯´ÉÍý²èÌÌɽ¼¨} +\label{fig:PAL0021} +\end{center} +\end{figure} + +¤³¤Î¥Ý¡¼¥È¥ì¥Ã¥È¤ÈÄ̾ï¤Î¥Ý¡¼¥È¥ì¥Ã¥È¤Ï°Ê²¼¤ÎÅÀ¤Ç°Û¤Ê¤ê¤Þ¤¹¡£ +\begin{itemize} +\item ¤¹¤Ù¤Æ¤Î¥æ¡¼¥¶¡¼¤ÎºîÀ®¤·¤¿¥Ö¥Ã¥¯¥Þ¡¼¥¯¤ä¥«¥Æ¥´¥ê¤ò±ÜÍ÷¡¦ÊÔ½¸¡¦ºï½ü¤Ç¤­¤ëÅÀ +\item ¥«¥Æ¥´¥ê¤Ø¤ÎÅÐÏ¿¤Î¾ì¹ç¡¢ID ¤òÆþÎϤ¹¤ëɬÍפ¬¤¢¤ëÅÀ(̤ʬÎ५¥Æ¥´¥ê¤Î ID ¤Ï 1 ¤Ë¤Ê¤ê¤Þ¤¹) +\item ¶¦Í­¥«¥Æ¥´¥ê¤Ë¥Ö¥Ã¥¯¥Þ¡¼¥¯¤òÅÐÏ¿¤Ç¤­¤ëÅÀ(¶¦Í­¥«¥Æ¥´¥ê¤Î ID ¤Ï 2 ¤Ë¤Ê¤ê¤Þ¤¹) +\item ¥Ö¥Ã¥¯¥Þ¡¼¥¯¤Îɽ¼¨½ç¤ò¿ô»ú¤ÇÀßÄꤹ¤ëÅÀ(¿ô»ú¤Î¾®¤µ¤¤¤â¤Î¤¬¾å¤Ëɽ¼¨¤µ¤ì¤Þ¤¹) +\end{itemize} + +\begin{figure}[ht] +\begin{center} +\includegraphics[width=120mm]{./images/PAL0030.eps} +\caption{Bookmark Viewer ¥Ý¡¼¥È¥ì¥Ã¥È¤Î¥«¥Æ¥´¥êÅÐÏ¿²èÌÌɽ¼¨} +\label{fig:PAL0030} +\end{center} +\end{figure} + +¥«¥Æ¥´¥êºîÀ®»þ¤Ë¤Ï¡¢°Ê²¼¤Î¹àÌܤòÆþÎϤǤ­¤Þ¤¹¡£ +\begin{itemize} +\item ¥«¥Æ¥´¥ê̾ : ¥«¥Æ¥´¥ê¤Î̾Á°¤òÆþÎϤ·¤Þ¤¹¡£ +\item ¥á¥â : ¥á¥â¤òµ­½Ò¤·¤Þ¤¹¡£ +\end{itemize} + +¤³¤Î¥«¥Æ¥´¥ê¤Ï¡¢´ÉÍý¼Ô¤ò½ü¤­¡¢ºîÀ®¤·¤¿ËܿͤΤߤ¬ÍøÍѤǤ­¤Þ¤¹¡£ + +\subsection{¥Ö¥Ã¥¯¥Þ¡¼¥¯¤È¥«¥Æ¥´¥ê¤ò´ÉÍý¤¹¤ë} +\begin{figure}[ht] +\begin{center} +\includegraphics[width=120mm]{./images/PAL0022.eps} +\caption{Bookmark Manager ¥Ý¡¼¥È¥ì¥Ã¥È¤Î¥Ö¥Ã¥¯¥Þ¡¼¥¯ÊÔ½¸²èÌÌɽ¼¨} +\label{fig:PAL0022} +\end{center} +\end{figure} + +\begin{figure}[ht] +\begin{center} +\includegraphics[width=120mm]{./images/PAL0024.eps} +\caption{Bookmark Manager ¥Ý¡¼¥È¥ì¥Ã¥È¤Î¥«¥Æ¥´¥ê´ÉÍý²èÌÌɽ¼¨} +\label{fig:PAL0024} +\end{center} +\end{figure} + +\begin{figure}[ht] +\begin{center} +\includegraphics[width=120mm]{./images/PAL0025.eps} +\caption{Bookmark Manager ¥Ý¡¼¥È¥ì¥Ã¥È¤Î¥«¥Æ¥´¥êÊÔ½¸²èÌÌɽ¼¨} +\label{fig:PAL0025} +\end{center} +\end{figure} Added: pal-portal/docs/ja/groupware-guide/trunk/src/tex/portlet/chat.tex =================================================================== --- pal-portal/docs/ja/groupware-guide/trunk/src/tex/portlet/chat.tex (rev 0) +++ pal-portal/docs/ja/groupware-guide/trunk/src/tex/portlet/chat.tex 2008-12-10 09:08:38 UTC (rev 1602) @@ -0,0 +1,26 @@ +\chapter{¥Á¥ã¥Ã¥È} + +%\section{¤Ï¤¸¤á¤Ë} + +¤³¤Î¥Ý¡¼¥È¥ì¥Ã¥È¤Ï¡¢¥Ý¡¼¥¿¥ë¾å¤Ç¾¤Î¥æ¡¼¥¶¤È¥Á¥ã¥Ã¥È¤ò¤¹¤ë¤¿¤á¤Î¥Ý¡¼¥È¥ì¥Ã¥È¤Ç¤¹¡£ + +\section{»È¤¤Êý} + +\subsection*{ȯ¸À¤¹¤ë} + +ȯ¸À¤·¤¿¤¤ÆâÍƤòµ­Æþ¤·¡¢Á÷¿®¥Ü¥¿¥ó¤ò¥¯¥ê¥Ã¥¯¤·¤Æ²¼¤µ¤¤¡£ + +\subsection*{¹¹¿·¤¹¤ë} + +¥Á¥ã¥Ã¥È¤ÎÆâÍƤϡ¢°ìÄê»þ´Ö¤´¤È¤Ë¼«Æ°¤Ç¹¹¿·¤µ¤ì¤Þ¤¹¡£ +ɽ¼¨¤µ¤ì¤ë·ï¿ô¤Ï10·ï¤Ç¤¹¡£ + +¼êÆ°¤Ç¹¹¿·¤ò¤·¤¿¤¤¾ì¹ç¤Ï¡¢Æɤ߹þ¤ß¥Ü¥¿¥ó¤ò¥¯¥ê¥Ã¥¯¤·¤Æ¤¯¤À¤µ¤¤¡£ + +\begin{figure}[ht] + \begin{center} + \includegraphics[width=120mm]{./images/chat_1.eps} + \caption{¥Á¥ã¥Ã¥È²èÌÌ} + \label{fig:chat} + \end{center} +\end{figure} Added: pal-portal/docs/ja/groupware-guide/trunk/src/tex/portlet/googlegadgets.tex =================================================================== Added: pal-portal/docs/ja/groupware-guide/trunk/src/tex/portlet/netvibes-widgets.tex =================================================================== Added: pal-portal/docs/ja/groupware-guide/trunk/src/tex/portlet/notepad.tex =================================================================== --- pal-portal/docs/ja/groupware-guide/trunk/src/tex/portlet/notepad.tex (rev 0) +++ pal-portal/docs/ja/groupware-guide/trunk/src/tex/portlet/notepad.tex 2008-12-10 09:08:38 UTC (rev 1602) @@ -0,0 +1,50 @@ +\chapter{¥á¥âÄ¢} + +¤³¤Î¥Ý¡¼¥È¥ì¥Ã¥È¤Ï¡¢¥á¥âÄ¢µ¡Ç½¤ò»È¤¦¤¿¤á¤Î¥Ý¡¼¥È¥ì¥Ã¥È¤Ç¤¹¡£ +¼«Ê¬ÀìÍѤΥá¥â¡¢¸ø³«ÍѤΥá¥â¡¢¶¦Í­ÍѤΥá¥â¤òºîÀ®¤¹¤ë¤³¤È¤¬¤Ç¤­¤Þ¤¹¡£ + +\section{»È¤¤Êý} + +\subsection{¥á¥â¤ò¤ß¤ë} + +¥«¥Æ¥´¥ê¤òÁªÂò¤·Ì¾Á°¤ò¥¯¥ê¥Ã¥¯¤¹¤ë¤³¤È¤Ç¡¢¥á¥â¤ò¸«¤ë¤³¤È¤¬¤Ç¤­¤Þ¤¹¡£ + +\subsection{¥á¥â¤òºî¤ë} + +\subsection{¥á¥â¤òÊÔ½¸¤¹¤ë} + +\subsection{¥á¥â¤òºï½ü¤¹¤ë} + +\section{¥«¥Æ¥´¥ê¤Ë¤Ä¤¤¤Æ} + +¥á¥â¤òʬÎह¤ë¤¿¤á¤Ë¡¢¥«¥Æ¥´¥ê¤òºîÀ®¤¹¤ë¤³¤È¤¬¤Ç¤­¤Þ¤¹¡£ + +\begin{figure}[ht] + \begin{center} + \includegraphics[width=120mm]{./images/notepad_1.eps} + \caption{¥«¥Æ¥´¥êºîÀ®²èÌÌ} + \label{fig:create_category} + \end{center} +\end{figure} + + +¥«¥Æ¥´¥ê¤´¤È¤Ë¥¢¥¯¥»¥¹¥¿¥¤¥×¤òÀßÄꤷ¡¢¸ø³«ÈϰϤòÀßÄꤹ¤ë¤³¤È¤¬¤Ç¤­¤Þ¤¹¡£ +¥¢¥¯¥»¥¹¥¿¥¤¥×¤Ë¤Ï¡¢¸Ä¿ÍÍÑ¡¦¸ø³«¡¦¶¦Í­¤¬Â¸ºß¤·¡¢É½\ref{fig:accesstype}¤Î¤è¤¦¤Ë¤Ê¤Ã¤Æ¤¤¤Þ¤¹¡£ + +\begin{table}[ht] + \begin{center} + \caption{¥¢¥¯¥»¥¹¥¿¥¤¥×} + \label{fig:accesstype} + \begin{tabular}{|l|c|c|c|} + \hline + & ¥æ¡¼¥¶¼«¿È¤Ë¤è¤ëÊÔ½¸ & ¾¤Î¥æ¡¼¥¶¤Ø¤Î¸ø³« & ¾¤Î¥æ¡¼¥¶¤Ë¤è¤ëÊÔ½¸\\ + \hline + ¸Ä¿ÍÍÑ & ¡û & ¡ß & ¡ß \\ + \hline + ¸ø³« & ¡û & ¡û & ¡ß \\ + \hline + ¶¦Í­ & ¡û & ¡û & ¡û \\ + \hline + \end{tabular} + \end{center} +\end{table} Added: pal-portal/docs/ja/groupware-guide/trunk/src/tex/portlet/scheduler.tex =================================================================== --- pal-portal/docs/ja/groupware-guide/trunk/src/tex/portlet/scheduler.tex (rev 0) +++ pal-portal/docs/ja/groupware-guide/trunk/src/tex/portlet/scheduler.tex 2008-12-10 09:08:38 UTC (rev 1602) @@ -0,0 +1,5 @@ +\chapter{¥¹¥±¥¸¥å¡¼¥é¡¼¡¦»ÜÀß´ÉÍý} + +¤³¤Î¥Ý¡¼¥È¥ì¥Ã¥È¤Ï¡¢¥¹¥±¥¸¥å¡¼¥ë´ÉÍý¡¦»ÜÀß´ÉÍý¤ò¹Ô¤¦¤¿¤á¤Î¥Ý¡¼¥È¥ì¥Ã¥È¤Ç¤¹¡£ + +\section{»È¤¤Êý} \ No newline at end of file Added: pal-portal/docs/ja/groupware-guide/trunk/src/tex/portlet/timecard.tex =================================================================== --- pal-portal/docs/ja/groupware-guide/trunk/src/tex/portlet/timecard.tex (rev 0) +++ pal-portal/docs/ja/groupware-guide/trunk/src/tex/portlet/timecard.tex 2008-12-10 09:08:38 UTC (rev 1602) @@ -0,0 +1,6 @@ +\chapter{¶ÐÂÕ´ÉÍý} + +¤³¤Î¥Ý¡¼¥È¥ì¥Ã¥È¤Ï¡¢¶ÐÂÕ´ÉÍý¤ò¹Ô¤¦¤¿¤á¤Î¥Ý¡¼¥È¥ì¥Ã¥È¤Ç¤¹¡£ + +\section{»È¤¤Êý} + Added: pal-portal/docs/ja/groupware-guide/trunk/src/tex/portlet/todolist.tex =================================================================== --- pal-portal/docs/ja/groupware-guide/trunk/src/tex/portlet/todolist.tex (rev 0) +++ pal-portal/docs/ja/groupware-guide/trunk/src/tex/portlet/todolist.tex 2008-12-10 09:08:38 UTC (rev 1602) @@ -0,0 +1,6 @@ +\chapter{ToDo¥ê¥¹¥È} + +¤³¤Î¥Ý¡¼¥È¥ì¥Ã¥È¤Ï¡¢ToDo¥ê¥¹¥È¤òºîÀ®¡¦´ÉÍý¤¹¤ë¤¿¤á¤Î¥Ý¡¼¥È¥ì¥Ã¥È¤Ç¤¹¡£ +¥«¥Æ¥´¥ê¤Ë¤è¤ëʬÎà¤ä¥¿¥¹¥¯¤ò¾Ã²½¤¹¤Ù¤­¿Í¤Î³ä¤êÅö¤Æ¤Ê¤É¤¬¤Ç¤­¤Þ¤¹¡£ + +\section{»È¤¤Êý} \ No newline at end of file Added: pal-portal/docs/ja/groupware-guide/trunk/src/tex/portlet/userinfo.tex =================================================================== --- pal-portal/docs/ja/groupware-guide/trunk/src/tex/portlet/userinfo.tex (rev 0) +++ pal-portal/docs/ja/groupware-guide/trunk/src/tex/portlet/userinfo.tex 2008-12-10 09:08:38 UTC (rev 1602) @@ -0,0 +1,3 @@ +\chapter{¥æ¡¼¥¶¡¼¾ðÊó} +%\section{¤Ï¤¸¤á¤Ë} +¤³¤Î¥Ý¡¼¥È¥ì¥Ã¥È¤Ï¡¢¥°¥ë¡¼¥×¥¦¥§¥¢Á´ÂΤΥ桼¥¶¡¼¾ðÊó¤òµ­Ï¿¤¹¤ë¤¿¤á¤Î¥Ý¡¼¥È¥ì¥Ã¥È¤Ç¤¹¡£ Added: pal-portal/docs/ja/groupware-guide/trunk/src/tex/portlet/vfs-portlets.tex =================================================================== --- pal-portal/docs/ja/groupware-guide/trunk/src/tex/portlet/vfs-portlets.tex (rev 0) +++ pal-portal/docs/ja/groupware-guide/trunk/src/tex/portlet/vfs-portlets.tex 2008-12-10 09:08:38 UTC (rev 1602) @@ -0,0 +1,91 @@ +\chapter{VFS} +%\section{¤Ï¤¸¤á¤Ë} +¤³¤Î¥Ý¡¼¥È¥ì¥Ã¥È¤Ï¡¢¥Ý¡¼¥¿¥ë¥µ¡¼¥Ð¤Î¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤Ë¥¢¥¯¥»¥¹¤¹¤ë¥Ý¡¼¥È¥ì¥Ã¥È¤Ç¤¹¡£ +¤³¤Î¥Ý¡¼¥È¥ì¥Ã¥È¤Ë¤ÏÁ´°÷¤ÇƱ¤¸ÀßÄê¤òÍøÍѤ¹¤ë¤â¤Î(VFS Explorer)¤È¸Ä¿ÍÍÑ¥Õ¥©¥ë¥À¤Ë¥¢¥¯¥»¥¹¤¹¤ë¤â¤Î(VFS Personal Folder Explorer)¤¬¤¢¤ê¡¢¤½¤ì¤¾¤ì¤òÍøÍѤ·¤Æ°Ê²¼¤Î¤è¤¦¤Ê¤³¤È¤ò¹Ô¤¦¤³¤È¤¬¤Ç¤­¤Þ¤¹¡£ + +\begin{itemize} +\item ¥Ý¡¼¥¿¥ë¥µ¡¼¥Ð¤Î¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤Ø¤Î¥Õ¥¡¥¤¥ë¤Î¥¢¥Ã¥×¥í¡¼¥É +\item ¥Ý¡¼¥¿¥ë¥µ¡¼¥Ð¤Î¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤Ø¤Î¥Õ¥©¥ë¥À¤ÎºîÀ® +\item ¥Ý¡¼¥¿¥ë¥µ¡¼¥Ð¤Î¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤«¤é¤Î¥Õ¥¡¥¤¥ë¤Î¥À¥¦¥ó¥í¡¼¥É¡¢ºï½ü +\item ¥Ý¡¼¥¿¥ë¥µ¡¼¥Ð¤Î¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤«¤é¤Î¥Õ¥©¥ë¥À¤Îºï½ü +\end{itemize} + +\section{»È¤¤Êý} +¤³¤Î¥Ý¡¼¥È¥ì¥Ã¥È¤Î»È¤¤Êý¤Ï°Ê²¼¤ÎÄ̤ê¤Ç¤¹¡£ + +\subsection{VFS¥Ý¡¼¥È¥ì¥Ã¥È¤òÀßÄꤹ¤ë} +¤³¤³¤Ç¤Ï´ÉÍý¼Ô¤È¤·¤Æ¡¢¤³¤Î¥Ý¡¼¥È¥ì¥Ã¥È¤òÀßÄꤹ¤ëÊýË¡¤òÀâÌÀ¤·¤Þ¤¹¡£ +\begin{figure}[ht] + \begin{center} + \includegraphics[width=80mm]{./images/PAL0020.eps} + \caption{VFS Configulator ¥Ý¡¼¥È¥ì¥Ã¥È¤Î²èÌÌɽ¼¨} + \label{fig:PAL0020} + \end{center} +\end{figure} +¤³¤Î¥Ý¡¼¥È¥ì¥Ã¥È¤ÏÇÛÈ÷¤·¤¿Ä¾¸å¤Ç¤Ï»ÈÍѤǤ­¤Ê¤¤¾õÂ֤ˤʤäƤ¤¤ë¤¿¤á¡¢ÀßÄê¤ò¹Ô¤¦É¬Íפ¬¤¢¤ê¤Þ¤¹¡£ +´ÉÍý¤Ï¡¢admin ¥í¡¼¥ë¤Î¥æ¡¼¥¶¤Î¤ß¤¬»ÈÍѲÄǽ¤Ê VFS Configulator ¥Ý¡¼¥È¥ì¥Ã¥È(VFS Explorer ÍÑ)¡¢¤Þ¤¿¤Ï Personal Folder Configulator ¥Ý¡¼¥È¥ì¥Ã¥È(VFS Personal Folder Explorer ÍÑ)¤«¤éÀßÄê¤ò¹Ô¤¦¤³¤È¤¬¤Ç¤­¤Þ¤¹¡£ +ÀßÄê¹àÌܤϰʲ¼¤ÎÄ̤ê¤Ç¤¹¡£ ¤Ê¤ª¡¢URI¤Î»ØÄê¹àÌܤǡ¢¡Ö\verb|__USERNAME__|¡×¤È¤¤¤¦ÊÑ¿ô¤ò»ÈÍѤ·¤¿¾ì¹ç¡¢¥æ¡¼¥¶¡¼Ì¾¤òÊÑ¿ô¤È¤·¤ÆÍøÍѤ¹¤ë¤³¤È¤¬¤Ç¤­¤Þ¤¹¡£ +\begin{itemize} +\item »ÈÍÑ : ¤³¤Î¥Ý¡¼¥È¥ì¥Ã¥È¤Î»ÈÍѤòµö²Ä¤¹¤ë¤«Èݤ«¤ÎÀßÄê¤ò¹Ô¤¦¤³¤È¤¬¤Ç¤­¤Þ¤¹¡£¤³¤³¤òµö²Ä¤·¤Ê¤¤¾ì¹ç¡¢¤¹¤Ù¤Æ¤Îµ¡Ç½¤ò»ÈÍѤ¹¤ë¤³¤È¤Ï¤Ç¤­¤Þ¤»¤ó¡£ +\item ɸ½à¤ÎURI : ½é´ü¤Ëɽ¼¨¤µ¤ì¤ë¥Ñ¥¹¤ò»ØÄꤷ¤Þ¤¹¡£ +\item ¥ë¡¼¥ÈURI : ¥ë¡¼¥È¥Õ¥©¥ë¥À¤È¤·¤Æɽ¼¨¤µ¤ì¤ë¥Ñ¥¹¤ò»ØÄꤷ¤Þ¤¹¡£¤³¤ì¤è¤ê¾å°Ì¤Î¥Ñ¥¹¤Ø¤Î¥¢¥¯¥»¥¹¤Ï¤Ç¤­¤Ê¤¯¤Ê¤ê¤Þ¤¹¡£ +\item µö²Ä¤¹¤ë¥Ñ¥¹ : ¤³¤Î¥Ý¡¼¥È¥ì¥Ã¥È¤Ç¤Î±ÜÍ÷¤òµö²Ä¤¹¤ë¥Ñ¥¹¤ò»ØÄꤷ¤Þ¤¹¡£ +\item ¶Ø»ß¤¹¤ë¥Ñ¥¹ : ¤³¤Î¥Ý¡¼¥È¥ì¥Ã¥È¤Ç¤Î±ÜÍ÷¤ò¶Ø»ß¤¹¤ë¥Ñ¥¹¤ò»ØÄꤷ¤Þ¤¹¡£ +\item ¥Ñ¥¹¤Îɽ¼¨ : ¡Öµö²Ä¤¹¤ë¡×¤òÁªÂò¤·¤¿¾ì¹ç¡¢¥Õ¥©¥ë¥À¤ä¥Õ¥¡¥¤¥ë¤Î¥ê¥¹¥È¤Î¾åÉô¤Ë¥Ñ¥¹¤¬É½¼¨¤µ¤ì¤Þ¤¹¡£ +\item ¥Õ¥©¥ë¥À¤ÎºîÀ® : ¡Öµö²Ä¤¹¤ë¡×¤òÁªÂò¤·¤¿¾ì¹ç¡¢¥Õ¥©¥ë¥À¤òºîÀ®¤¹¤ë¤³¤È¤¬¤Ç¤­¤Þ¤¹¡£ +\item ¥¢¥Ã¥×¥í¡¼¥É : ¡Öµö²Ä¤¹¤ë¡×¤òÁªÂò¤·¤¿¾ì¹ç¡¢¥Õ¥¡¥¤¥ë¤ò¥¢¥Ã¥×¥í¡¼¥É¤¹¤ë¤³¤È¤¬¤Ç¤­¤Þ¤¹¡£ +\end{itemize} + +\subsubsection{Windows¤Ç¤ÎÆÃÍ­¤ÊÀßÄê} +Windows¤Ç¤Ï¥Ñ¥¹¤Î»ØÄê¤ò¡Öfile:///c:Y\hspace{-.75em}=/......¡×¤Î¤è¤¦¤Ë¡¢³Æ¥É¥é¥¤¥Ö¤Î¥ë¡¼¥È¥Õ¥©¥ë¥À¤Î¤ß¡Öx:Y\hspace{-.75em}=¡×¤Î·Á¤ÇÆþÎϤ·¡¢¸å¤Ï/¤Ç¥Ñ¥¹¤ò¶èÀÚ¤ëɬÍפ¬¤¢¤ê¤Þ¤¹¡£ + +¤Ê¤ª¡¢¸½»þÅÀ¤Ç¤Ï¶õÇò¤ò´Þ¤à¥Ñ¥¹¤ò»ÈÍѤ¹¤ë¤È¥Õ¥¡¥¤¥ë¤Î¥¢¥Ã¥×¥í¡¼¥É¤¬Àµ¾ï¤Ë¹Ô¤ï¤ì¤Ê¤¤¾ì¹ç¤¬¤¢¤ê¤Þ¤¹¤¬¡¢¤³¤Î¤è¤¦¤Ê¾ì¹ç¤Ï¤¤¤ï¤æ¤ë 8.3 ·Á¼°¤Îû¤¤¥Õ¥¡¥¤¥ë¡¦¥Õ¥©¥ë¥À̾¤ò»ÈÍѤ¹¤ë¤ÈÌäÂê¤ò²óÈò¤¹¤ë¤³¤È¤¬¤Ç¤­¤Þ¤¹¡£ + +\subsection{VFS¥Ý¡¼¥È¥ì¥Ã¥È¤ò»È¤¦} +¤³¤³¤Ç¤Ï¡¢°ìÈ̥桼¥¶¡¼¤È¤·¤Æ¤³¤Î¥Ý¡¼¥È¥ì¥Ã¥È¤ò»ÈÍѤ¹¤ëÊýË¡¤òÀâÌÀ¤·¤Þ¤¹¡£ +¤³¤Î¥Ý¡¼¥È¥ì¥Ã¥È¤òÇÛÈ÷¤¹¤ë¤È¡¢¡Öɸ½à¤ÎURI¡×¤Ç»ØÄꤵ¤ì¤¿¥Ñ¥¹¤¬É½¼¨¤µ¤ì¤Þ¤¹¡£ +¥µ¥¤¥º¤¬É½¼¨¤µ¤ì¤Æ¤¤¤ë¤â¤Î¤¬¥Õ¥¡¥¤¥ë¡¢¥µ¥¤¥º¤Îɽ¼¨¤µ¤ì¤Æ¤¤¤Ê¤¤¤â¤Î¤¬¥Õ¥©¥ë¥À¤Ç¤¹¡£ +¤Ê¤ª¡¢OS¾å¤Ç¥Õ¥¡¥¤¥ë¤òÁàºî¤¹¤ë¸¢¸Â¤Ï¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¥µ¡¼¥Ð¤ò¼Â¹Ô¤¹¤ë¥æ¡¼¥¶¡¼¤Î¤â¤Î¤Ë¤Ê¤ê¤Þ¤¹¡£ + +\begin{figure}[ht] + \begin{center} + \includegraphics[width=80mm]{./images/PAL0015.eps} + \caption{VFS Explorer ¥Ý¡¼¥È¥ì¥Ã¥È¤Î²èÌÌɽ¼¨} + \label{fig:PAL0015} + \end{center} +\end{figure} + +\subsubsection{¥Õ¥©¥ë¥À¤ò°ÜÆ°¤¹¤ë} +¥Õ¥©¥ë¥À¤Î¾ì¹ç¡¢¥Õ¥©¥ë¥À̾¤ò¥¯¥ê¥Ã¥¯¤¹¤ë¤È¡¢¤½¤Î¥Õ¥©¥ë¥À¤Ë°ÜÆ°¤¹¤ë¤³¤È¤¬¤Ç¤­¤Þ¤¹¡£ +¾å°Ì¥Õ¥©¥ë¥À¤Ø°ÜÆ°¤¹¤ë¾ì¹ç¤Ï¡¢¡Ö..¡×¤ò¥¯¥ê¥Ã¥¯¤·¤Þ¤¹¡£ + +\subsubsection{¥Õ¥¡¥¤¥ë¤ò¥À¥¦¥ó¥í¡¼¥É¤¹¤ë} +¥Õ¥¡¥¤¥ë¤Î¾ì¹ç¡¢¥Õ¥¡¥¤¥ë¤ò¥¯¥ê¥Ã¥¯¤¹¤ë¤È¤½¤Î¥Õ¥¡¥¤¥ë¤òɽ¼¨¡¢¤â¤·¤¯¤Ï¥À¥¦¥ó¥í¡¼¥É¤¹¤ë¤³¤È¤¬¤Ç¤­¤Þ¤¹¡£ +¡Ê±¦¥¯¥ê¥Ã¥¯¤Ç¥À¥¦¥ó¥í¡¼¥É¤¹¤ë¤³¤È¤â²Äǽ¤Ç¤¹¡Ë +¤Ê¤ª¡¢¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤Î¼ïÎà¤È¤½¤Îʸ»ú¥³¡¼¥É¤Ë¤è¤Ã¤Æ¤Ïʸ»ú²½¤±¤ËÃí°Õ¤¹¤ëɬÍפ¬¤¢¤ê¤Þ¤¹¡£ + +\subsubsection{¥Õ¥¡¥¤¥ë¤ä¥Õ¥©¥ë¥À¤òºï½ü¤¹¤ë} +¡Öºï½ü¡×¤ò¥¯¥ê¥Ã¥¯¤¹¤ë¤È¡¢¥Õ¥¡¥¤¥ë¤Þ¤¿¤Ï¥Õ¥©¥ë¥À¤òºï½ü¤¹¤ë¤³¤È¤¬¤Ç¤­¤Þ¤¹¡£ +¤Ê¤ª¡¢¥Õ¥©¥ë¥À¤òºï½ü¤·¤¿¾ì¹ç¡¢¤½¤ÎÃæ¤Ë´Þ¤Þ¤ì¤ë¥Õ¥¡¥¤¥ë¤âºï½ü¤µ¤ì¤Þ¤¹¡£ + +\subsubsection{¥Õ¥©¥ë¥À¤òºîÀ®¤¹¤ë} +\begin{figure}[ht] + \begin{center} + \includegraphics[width=120mm]{./images/PAL0017.eps} + \caption{VFS Explorer ¥Õ¥©¥ë¥ÀºîÀ®²èÌÌ} + \label{fig:PAL0017} + \end{center} +\end{figure} +¡Ö¥Õ¥©¥ë¥À¤ÎºîÀ®¡×¤ò¥¯¥ê¥Ã¥¯¤¹¤ë¤È¡¢¥Õ¥©¥ë¥À¤ÎºîÀ®²èÌ̤¬É½¼¨¤µ¤ì¤Þ¤¹¡£ +¤³¤³¤Ç¤Ï¡¢¡Ö¥Õ¥©¥ë¥À̾¡×¤òÆþÎϤ¹¤ë¤È¡¢¤½¤Î̾Á°¤Î¥Õ¥©¥ë¥À¤ò¡ÖÂоݤΥѥ¹¡×¤Ëɽ¼¨¤µ¤ì¤Æ¤¤¤ë¥Ñ¥¹¤Î²¼¤ËºîÀ®¤¹¤ë¤³¤È¤¬¤Ç¤­¤Þ¤¹¡£ + +\subsubsection{¥Õ¥¡¥¤¥ë¤ò¥¢¥Ã¥×¥í¡¼¥É¤¹¤ë} +\begin{figure}[ht] + \begin{center} + \includegraphics[width=120mm]{./images/PAL0019.eps} + \caption{VFS Explorer ¥¢¥Ã¥×¥í¡¼¥É²èÌÌ} + \label{fig:PAL0019} + \end{center} +\end{figure} +¡Ö¥¢¥Ã¥×¥í¡¼¥É¡×¤ò¥¯¥ê¥Ã¥¯¤¹¤ë¤È¡¢¥Õ¥¡¥¤¥ë¤Î¥¢¥Ã¥×¥í¡¼¥É²èÌ̤¬É½¼¨¤µ¤ì¤Þ¤¹¡£ +¤³¤³¤Ç¤Ï¡¢¡Ö»²¾È...¡×¥Ü¥¿¥ó¤ò²¡¤·¤Æ¥Õ¥¡¥¤¥ë¤òÁªÂò¤¹¤ë¤È¡¢¤½¤Î̾Á°¤Î¥Õ¥¡¥¤¥ë¤ò¡ÖÂоݤΥѥ¹¡×¤Ëɽ¼¨¤µ¤ì¤Æ¤¤¤ë¥Ñ¥¹¤Î²¼¤Ë¥¢¥Ã¥×¥í¡¼¥É¤¹¤ë¤³¤È¤¬¤Ç¤­¤Þ¤¹¡£¤Ê¤ª¡¢°ìÅ٤˥¢¥Ã¥×¥í¡¼¥É¤Ç¤­¤ë¥Õ¥¡¥¤¥ë¤Ï 1 ¸Ä¤Î¤ß¤Ç¤¹¡£ From svnnotify ¡÷ sourceforge.jp Wed Dec 10 18:48:55 2008 From: svnnotify ¡÷ sourceforge.jp (svnnotify ¡÷ sourceforge.jp) Date: Wed, 10 Dec 2008 18:48:55 +0900 Subject: [pal-cvs 3868] [1603] fixed config file for importing psml to db. Message-ID: <1228902535.440668.12675.nullmailer@users.sourceforge.jp> Revision: 1603 http://svn.sourceforge.jp/view?root=pal&view=rev&rev=1603 Author: shinsuke Date: 2008-12-10 18:48:55 +0900 (Wed, 10 Dec 2008) Log Message: ----------- fixed config file for importing psml to db. Modified Paths: -------------- pal-portal/branches/pal-portal-1.x/installer/etc/database/import/assembly/import-page-manager.xml -------------- next part -------------- Modified: pal-portal/branches/pal-portal-1.x/installer/etc/database/import/assembly/import-page-manager.xml =================================================================== --- pal-portal/branches/pal-portal-1.x/installer/etc/database/import/assembly/import-page-manager.xml 2008-12-10 09:08:38 UTC (rev 1602) +++ pal-portal/branches/pal-portal-1.x/installer/etc/database/import/assembly/import-page-manager.xml 2008-12-10 09:48:55 UTC (rev 1603) @@ -18,6 +18,26 @@ --> + + + + + + + + + + + + + + + + + - + - 10 + - + - 100 + 10 From svnnotify ¡÷ sourceforge.jp Wed Dec 10 22:13:33 2008 From: svnnotify ¡÷ sourceforge.jp (svnnotify ¡÷ sourceforge.jp) Date: Wed, 10 Dec 2008 22:13:33 +0900 Subject: [pal-cvs 3869] [1604] updated velocity. Message-ID: <1228914813.125045.31752.nullmailer@users.sourceforge.jp> Revision: 1604 http://svn.sourceforge.jp/view?root=pal&view=rev&rev=1604 Author: shinsuke Date: 2008-12-10 22:13:32 +0900 (Wed, 10 Dec 2008) Log Message: ----------- updated velocity. Modified Paths: -------------- pal-portal/branches/pal-portal-1.x/portal/jetspeed-2/core-build.xml pal-portal/branches/pal-portal-1.x/portal/jetspeed-2/jetspeed-components.xml -------------- next part -------------- Modified: pal-portal/branches/pal-portal-1.x/portal/jetspeed-2/core-build.xml =================================================================== --- pal-portal/branches/pal-portal-1.x/portal/jetspeed-2/core-build.xml 2008-12-10 09:48:55 UTC (rev 1603) +++ pal-portal/branches/pal-portal-1.x/portal/jetspeed-2/core-build.xml 2008-12-10 13:13:32 UTC (rev 1604) @@ -144,7 +144,7 @@ commons-lang - 2.1 + 2.4 true Modified: pal-portal/branches/pal-portal-1.x/portal/jetspeed-2/jetspeed-components.xml =================================================================== --- pal-portal/branches/pal-portal-1.x/portal/jetspeed-2/jetspeed-components.xml 2008-12-10 09:48:55 UTC (rev 1603) +++ pal-portal/branches/pal-portal-1.x/portal/jetspeed-2/jetspeed-components.xml 2008-12-10 13:13:32 UTC (rev 1604) @@ -266,7 +266,7 @@ velocity - 1.5 + 1.6 true From svnnotify ¡÷ sourceforge.jp Fri Dec 12 20:52:17 2008 From: svnnotify ¡÷ sourceforge.jp (svnnotify ¡÷ sourceforge.jp) Date: Fri, 12 Dec 2008 20:52:17 +0900 Subject: [pal-cvs 3870] [1605] upgraded for tomcat 5.5.27. Message-ID: <1229082737.583444.14037.nullmailer@users.sourceforge.jp> Revision: 1605 http://svn.sourceforge.jp/view?root=pal&view=rev&rev=1605 Author: shinsuke Date: 2008-12-12 20:52:17 +0900 (Fri, 12 Dec 2008) Log Message: ----------- upgraded for tomcat 5.5.27. if you want to use 5.5.23 or below, change useContextClassLoader to false. Modified Paths: -------------- pal-portal/branches/pal-portal-1.x/build.properties pal-portal/branches/pal-portal-1.x/portal/jetspeed-2/etc/conf/tomcat/jetspeed-tomcat-5.5.xml -------------- next part -------------- Modified: pal-portal/branches/pal-portal-1.x/build.properties =================================================================== --- pal-portal/branches/pal-portal-1.x/build.properties 2008-12-10 13:13:32 UTC (rev 1604) +++ pal-portal/branches/pal-portal-1.x/build.properties 2008-12-12 11:52:17 UTC (rev 1605) @@ -28,11 +28,9 @@ installer.portlets.dir=${installer.target.dir}/portlets dist.name.prefix=PALPortal dist.version=${portal.version} -#dist.tomcat.version=5.5.25 -dist.tomcat.version=5.5.23 +dist.tomcat.version=5.5.27 dist.tomcat.base.file=${installer.target.dir}/apache-tomcat-${dist.tomcat.version}.zip -#dist.tomcat.base.url=http://ftp.riken.jp/net/apache/tomcat/tomcat-5/v${dist.tomcat.version}/bin/apache-tomcat-${dist.tomcat.version}.zip -dist.tomcat.base.url=http://archive.apache.org/dist/tomcat/tomcat-5/v5.5.23/bin/apache-tomcat-5.5.23.zip +dist.tomcat.base.url=http://ftp.riken.jp/net/apache/tomcat/tomcat-5/v${dist.tomcat.version}/bin/apache-tomcat-${dist.tomcat.version}.zip dist.server.home=${dist.portal.dir} dist.server.shared=${dist.server.home}/shared/lib dist.server.war.dir=${dist.server.home}/webapps/ Modified: pal-portal/branches/pal-portal-1.x/portal/jetspeed-2/etc/conf/tomcat/jetspeed-tomcat-5.5.xml =================================================================== --- pal-portal/branches/pal-portal-1.x/portal/jetspeed-2/etc/conf/tomcat/jetspeed-tomcat-5.5.xml 2008-12-10 13:13:32 UTC (rev 1604) +++ pal-portal/branches/pal-portal-1.x/portal/jetspeed-2/etc/conf/tomcat/jetspeed-tomcat-5.5.xml 2008-12-12 11:52:17 UTC (rev 1605) @@ -21,7 +21,7 @@ appName="Jetspeed" userClassNames="org.apache.jetspeed.security.impl.UserPrincipalImpl" roleClassNames="org.apache.jetspeed.security.impl.RolePrincipalImpl" - useContextClassLoader="false" + useContextClassLoader="true" debug="0"/> From svnnotify ¡÷ sourceforge.jp Fri Dec 12 22:46:19 2008 From: svnnotify ¡÷ sourceforge.jp (svnnotify ¡÷ sourceforge.jp) Date: Fri, 12 Dec 2008 22:46:19 +0900 Subject: [pal-cvs 3871] [1606] upgraded for 5.5.27. Message-ID: <1229089579.077820.15126.nullmailer@users.sourceforge.jp> Revision: 1606 http://svn.sourceforge.jp/view?root=pal&view=rev&rev=1606 Author: shinsuke Date: 2008-12-12 22:46:18 +0900 (Fri, 12 Dec 2008) Log Message: ----------- upgraded for 5.5.27. Modified Paths: -------------- pal-portal/branches/pal-portal-1.x/installer/etc/ant-installer/antinstall-config.xml pal-portal/branches/pal-portal-1.x/installer/etc/ant-installer/resources/LanguagePack.properties pal-portal/branches/pal-portal-1.x/installer/etc/ant-installer/resources/LanguagePack_ja.properties -------------- next part -------------- Modified: pal-portal/branches/pal-portal-1.x/installer/etc/ant-installer/antinstall-config.xml =================================================================== --- pal-portal/branches/pal-portal-1.x/installer/etc/ant-installer/antinstall-config.xml 2008-12-12 11:52:17 UTC (rev 1605) +++ pal-portal/branches/pal-portal-1.x/installer/etc/ant-installer/antinstall-config.xml 2008-12-12 13:46:18 UTC (rev 1606) @@ -44,7 +44,7 @@ - + Modified: pal-portal/branches/pal-portal-1.x/installer/etc/ant-installer/resources/LanguagePack.properties =================================================================== --- pal-portal/branches/pal-portal-1.x/installer/etc/ant-installer/resources/LanguagePack.properties 2008-12-12 11:52:17 UTC (rev 1605) +++ pal-portal/branches/pal-portal-1.x/installer/etc/ant-installer/resources/LanguagePack.properties 2008-12-12 13:46:18 UTC (rev 1606) @@ -32,7 +32,7 @@ ## Text from Page:requiredComponents page.requiredComponents.displayText = Components Selection comment.13.displayText = @PORTAL_NAME@ -install.tomcat.displayText = Tomcat 5.5.23 +install.tomcat.displayText = Tomcat 5.5.27 install.portal.displayText = @PORTAL_NAME@ install.tomcat.config.displayText = @PORTAL_NAME@ Configration for Tomcat mailServerConfiguration.displayText = Mail Server Configuration Modified: pal-portal/branches/pal-portal-1.x/installer/etc/ant-installer/resources/LanguagePack_ja.properties =================================================================== --- pal-portal/branches/pal-portal-1.x/installer/etc/ant-installer/resources/LanguagePack_ja.properties 2008-12-12 11:52:17 UTC (rev 1605) +++ pal-portal/branches/pal-portal-1.x/installer/etc/ant-installer/resources/LanguagePack_ja.properties 2008-12-12 13:46:18 UTC (rev 1606) @@ -32,7 +32,7 @@ ## Text from Page:requiredComponents page.requiredComponents.displayText = \u30b3\u30f3\u30dd\u30fc\u30cd\u30f3\u30c8\u306e\u9078\u629e comment.13.displayText = @PORTAL_NAME@ -install.tomcat.displayText = Tomcat 5.5.23 +install.tomcat.displayText = Tomcat 5.5.27 install.portal.displayText = @PORTAL_NAME@ install.tomcat.config.displayText = Tomcat \u7528 @PORTAL_NAME@ \u8a2d\u5b9a mailServerConfiguration.displayText = \u30e1\u30fc\u30eb\u30b5\u30fc\u30d0\u8a2d\u5b9a From svnnotify ¡÷ sourceforge.jp Fri Dec 12 23:14:15 2008 From: svnnotify ¡÷ sourceforge.jp (svnnotify ¡÷ sourceforge.jp) Date: Fri, 12 Dec 2008 23:14:15 +0900 Subject: [pal-cvs 3872] [1607] use setenv files. Message-ID: <1229091255.921216.8142.nullmailer@users.sourceforge.jp> Revision: 1607 http://svn.sourceforge.jp/view?root=pal&view=rev&rev=1607 Author: shinsuke Date: 2008-12-12 23:14:15 +0900 (Fri, 12 Dec 2008) Log Message: ----------- use setenv files. Added Paths: ----------- pal-portal/branches/pal-portal-1.x/installer/etc/tomcat/bin/setenv.bat pal-portal/branches/pal-portal-1.x/installer/etc/tomcat/bin/setenv.sh Removed Paths: ------------- pal-portal/branches/pal-portal-1.x/installer/etc/tomcat/bin/catalina.bat pal-portal/branches/pal-portal-1.x/installer/etc/tomcat/bin/catalina.sh -------------- next part -------------- Deleted: pal-portal/branches/pal-portal-1.x/installer/etc/tomcat/bin/catalina.bat =================================================================== --- pal-portal/branches/pal-portal-1.x/installer/etc/tomcat/bin/catalina.bat 2008-12-12 13:46:18 UTC (rev 1606) +++ pal-portal/branches/pal-portal-1.x/installer/etc/tomcat/bin/catalina.bat 2008-12-12 14:14:15 UTC (rev 1607) @@ -1,208 +0,0 @@ - ¡÷ echo off -if "%OS%" == "Windows_NT" setlocal -rem --------------------------------------------------------------------------- -rem Start/Stop Script for the CATALINA Server -rem -rem Environment Variable Prequisites -rem -rem CATALINA_HOME May point at your Catalina "build" directory. -rem -rem CATALINA_BASE (Optional) Base directory for resolving dynamic portions -rem of a Catalina installation. If not present, resolves to -rem the same directory that CATALINA_HOME points to. -rem -rem CATALINA_OPTS (Optional) Java runtime options used when the "start", -rem "stop", or "run" command is executed. -rem -rem CATALINA_TMPDIR (Optional) Directory path location of temporary directory -rem the JVM should use (java.io.tmpdir). Defaults to -rem %CATALINA_BASE%\temp. -rem -rem JAVA_HOME Must point at your Java Development Kit installation. -rem Required to run the with the "debug" argument. -rem -rem JRE_HOME Must point at your Java Development Kit installation. -rem Defaults to JAVA_HOME if empty. -rem -rem JAVA_OPTS (Optional) Java runtime options used when the "start", -rem "stop", or "run" command is executed. -rem -rem JSSE_HOME (Optional) May point at your Java Secure Sockets Extension -rem (JSSE) installation, whose JAR files will be added to the -rem system class path used to start Tomcat. -rem -rem JPDA_TRANSPORT (Optional) JPDA transport used when the "jpda start" -rem command is executed. The default is "dt_shmem". -rem -rem JPDA_ADDRESS (Optional) Java runtime options used when the "jpda start" -rem command is executed. The default is "jdbconn". -rem -rem $Id: catalina.bat,v 1.2 2007/03/10 23:18:48 shinsuke Exp $ -rem --------------------------------------------------------------------------- - -set JAVA_OPTS=%JAVA_OPTS% -Xmx256m -Xms256m -XX:PermSize=256m -XX:MaxPermSize=256m -Djava.awt.headless=true - -rem Guess CATALINA_HOME if not defined -set CURRENT_DIR=%cd% -if not "%CATALINA_HOME%" == "" goto gotHome -set CATALINA_HOME=%CURRENT_DIR% -if exist "%CATALINA_HOME%\bin\catalina.bat" goto okHome -cd .. -set CATALINA_HOME=%cd% -cd %CURRENT_DIR% -:gotHome -if exist "%CATALINA_HOME%\bin\catalina.bat" goto okHome -echo The CATALINA_HOME environment variable is not defined correctly -echo This environment variable is needed to run this program -goto end -:okHome - -rem Get standard environment variables -if exist "%CATALINA_HOME%\bin\setenv.bat" call "%CATALINA_HOME%\bin\setenv.bat" - -rem Get standard Java environment variables -if exist "%CATALINA_HOME%\bin\setclasspath.bat" goto okSetclasspath -echo Cannot find %CATALINA_HOME%\bin\setclasspath.bat -echo This file is needed to run this program -goto end -:okSetclasspath -set BASEDIR=%CATALINA_HOME% -call "%CATALINA_HOME%\bin\setclasspath.bat" %1 -if errorlevel 1 goto end - -rem Add on extra jar files to CLASSPATH -if "%JSSE_HOME%" == "" goto noJsse -set CLASSPATH=%CLASSPATH%;%JSSE_HOME%\lib\jcert.jar;%JSSE_HOME%\lib\jnet.jar;%JSSE_HOME%\lib\jsse.jar -:noJsse -set CLASSPATH=%CLASSPATH%;%CATALINA_HOME%\bin\bootstrap.jar - -if not "%CATALINA_BASE%" == "" goto gotBase -set CATALINA_BASE=%CATALINA_HOME% -:gotBase - -if not "%CATALINA_TMPDIR%" == "" goto gotTmpdir -set CATALINA_TMPDIR=%CATALINA_BASE%\temp -:gotTmpdir - -if not exist "%CATALINA_HOME%\bin\tomcat-juli.jar" goto noJuli -set JAVA_OPTS=%JAVA_OPTS% -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager -Djava.util.logging.config.file="%CATALINA_BASE%\conf\logging.properties" -:noJuli - -rem ----- Execute The Requested Command --------------------------------------- - -echo Using CATALINA_BASE: %CATALINA_BASE% -echo Using CATALINA_HOME: %CATALINA_HOME% -echo Using CATALINA_TMPDIR: %CATALINA_TMPDIR% -if ""%1"" == ""debug"" goto use_jdk -echo Using JRE_HOME: %JRE_HOME% -goto java_dir_displayed -:use_jdk -echo Using JAVA_HOME: %JAVA_HOME% -:java_dir_displayed - -set _EXECJAVA=%_RUNJAVA% -set MAINCLASS=org.apache.catalina.startup.Bootstrap -set ACTION=start -set SECURITY_POLICY_FILE= -set DEBUG_OPTS= -set JPDA= - -if not ""%1"" == ""jpda"" goto noJpda -set JPDA=jpda -if not "%JPDA_TRANSPORT%" == "" goto gotJpdaTransport -set JPDA_TRANSPORT=dt_shmem -:gotJpdaTransport -if not "%JPDA_ADDRESS%" == "" goto gotJpdaAddress -set JPDA_ADDRESS=jdbconn -:gotJpdaAddress -shift -:noJpda - -if ""%1"" == ""debug"" goto doDebug -if ""%1"" == ""run"" goto doRun -if ""%1"" == ""start"" goto doStart -if ""%1"" == ""stop"" goto doStop -if ""%1"" == ""version"" goto doVersion - -echo Usage: catalina ( commands ... ) -echo commands: -echo debug Start Catalina in a debugger -echo debug -security Debug Catalina with a security manager -echo jpda start Start Catalina under JPDA debugger -echo run Start Catalina in the current window -echo run -security Start in the current window with security manager -echo start Start Catalina in a separate window -echo start -security Start in a separate window with security manager -echo stop Stop Catalina -echo version What version of tomcat are you running? -goto end - -:doDebug -shift -set _EXECJAVA=%_RUNJDB% -set DEBUG_OPTS=-sourcepath "%CATALINA_HOME%\..\..\jakarta-tomcat-catalina\catalina\src\share" -if not ""%1"" == ""-security"" goto execCmd -shift -echo Using Security Manager -set SECURITY_POLICY_FILE=%CATALINA_BASE%\conf\catalina.policy -goto execCmd - -:doRun -shift -if not ""%1"" == ""-security"" goto execCmd -shift -echo Using Security Manager -set SECURITY_POLICY_FILE=%CATALINA_BASE%\conf\catalina.policy -goto execCmd - -:doStart -shift -if not "%OS%" == "Windows_NT" goto noTitle -set _EXECJAVA=start "Tomcat" %_RUNJAVA% -goto gotTitle -:noTitle -set _EXECJAVA=start %_RUNJAVA% -:gotTitle -if not ""%1"" == ""-security"" goto execCmd -shift -echo Using Security Manager -set SECURITY_POLICY_FILE=%CATALINA_BASE%\conf\catalina.policy -goto execCmd - -:doStop -shift -set ACTION=stop -goto execCmd - -:doVersion -%_EXECJAVA% -classpath "%CATALINA_HOME%\server\lib\catalina.jar" org.apache.catalina.util.ServerInfo -goto end - - -:execCmd -rem Get remaining unshifted command line arguments and save them in the -set CMD_LINE_ARGS= -:setArgs -if ""%1""=="""" goto doneSetArgs -set CMD_LINE_ARGS=%CMD_LINE_ARGS% %1 -shift -goto setArgs -:doneSetArgs - -rem Execute Java with the applicable properties -if not "%JPDA%" == "" goto doJpda -if not "%SECURITY_POLICY_FILE%" == "" goto doSecurity -%_EXECJAVA% %JAVA_OPTS% %CATALINA_OPTS% %DEBUG_OPTS% -Djava.endorsed.dirs="%JAVA_ENDORSED_DIRS%" -classpath "%CLASSPATH%" -Dcatalina.base="%CATALINA_BASE%" -Dcatalina.home="%CATALINA_HOME%" -Djava.io.tmpdir="%CATALINA_TMPDIR%" %MAINCLASS% %CMD_LINE_ARGS% %ACTION% -goto end -:doSecurity -%_EXECJAVA% %JAVA_OPTS% %CATALINA_OPTS% %DEBUG_OPTS% -Djava.endorsed.dirs="%JAVA_ENDORSED_DIRS%" -classpath "%CLASSPATH%" -Djava.security.manager -Djava.security.policy=="%SECURITY_POLICY_FILE%" -Dcatalina.base="%CATALINA_BASE%" -Dcatalina.home="%CATALINA_HOME%" -Djava.io.tmpdir="%CATALINA_TMPDIR%" %MAINCLASS% %CMD_LINE_ARGS% %ACTION% -goto end -:doJpda -if not "%SECURITY_POLICY_FILE%" == "" goto doSecurityJpda -%_EXECJAVA% %JAVA_OPTS% %CATALINA_OPTS% -Xdebug -Xrunjdwp:transport=%JPDA_TRANSPORT%,address=%JPDA_ADDRESS%,server=y,suspend=n %DEBUG_OPTS% -Djava.endorsed.dirs="%JAVA_ENDORSED_DIRS%" -classpath "%CLASSPATH%" -Dcatalina.base="%CATALINA_BASE%" -Dcatalina.home="%CATALINA_HOME%" -Djava.io.tmpdir="%CATALINA_TMPDIR%" %MAINCLASS% %CMD_LINE_ARGS% %ACTION% -goto end -:doSecurityJpda -%_EXECJAVA% %JAVA_OPTS% %CATALINA_OPTS% -Xdebug -Xrunjdwp:transport=%JPDA_TRANSPORT%,address=%JPDA_ADDRESS%,server=y,suspend=n %DEBUG_OPTS% -Djava.endorsed.dirs="%JAVA_ENDORSED_DIRS%" -classpath "%CLASSPATH%" -Djava.security.manager -Djava.security.policy=="%SECURITY_POLICY_FILE%" -Dcatalina.base="%CATALINA_BASE%" -Dcatalina.home="%CATALINA_HOME%" -Djava.io.tmpdir="%CATALINA_TMPDIR%" %MAINCLASS% %CMD_LINE_ARGS% %ACTION% -goto end - -:end Deleted: pal-portal/branches/pal-portal-1.x/installer/etc/tomcat/bin/catalina.sh =================================================================== --- pal-portal/branches/pal-portal-1.x/installer/etc/tomcat/bin/catalina.sh 2008-12-12 13:46:18 UTC (rev 1606) +++ pal-portal/branches/pal-portal-1.x/installer/etc/tomcat/bin/catalina.sh 2008-12-12 14:14:15 UTC (rev 1607) @@ -1,325 +0,0 @@ -#!/bin/sh -# ----------------------------------------------------------------------------- -# Start/Stop Script for the CATALINA Server -# -# Environment Variable Prequisites -# -# CATALINA_HOME May point at your Catalina "build" directory. -# -# CATALINA_BASE (Optional) Base directory for resolving dynamic portions -# of a Catalina installation. If not present, resolves to -# the same directory that CATALINA_HOME points to. -# -# CATALINA_OPTS (Optional) Java runtime options used when the "start", -# "stop", or "run" command is executed. -# -# CATALINA_TMPDIR (Optional) Directory path location of temporary directory -# the JVM should use (java.io.tmpdir). Defaults to -# $CATALINA_BASE/temp. -# -# JAVA_HOME Must point at your Java Development Kit installation. -# Required to run the with the "debug" or "javac" argument. -# -# JRE_HOME Must point at your Java Development Kit installation. -# Defaults to JAVA_HOME if empty. -# -# JAVA_OPTS (Optional) Java runtime options used when the "start", -# "stop", or "run" command is executed. -# -# JPDA_TRANSPORT (Optional) JPDA transport used when the "jpda start" -# command is executed. The default is "dt_socket". -# -# JPDA_ADDRESS (Optional) Java runtime options used when the "jpda start" -# command is executed. The default is 8000. -# -# JSSE_HOME (Optional) May point at your Java Secure Sockets Extension -# (JSSE) installation, whose JAR files will be added to the -# system class path used to start Tomcat. -# -# CATALINA_PID (Optional) Path of the file which should contains the pid -# of catalina startup java process, when start (fork) is used -# -# $Id: catalina.sh,v 1.2 2007/03/10 23:18:48 shinsuke Exp $ -# ----------------------------------------------------------------------------- - -JAVA_OPTS="$JAVA_OPTS -Xmx256m -Xms256m -XX:PermSize=256m -XX:MaxPermSize=256m -Djava.awt.headless=true" - -# OS specific support. $var _must_ be set to either true or false. -cygwin=false -os400=false -darwin=false -case "`uname`" in -CYGWIN*) cygwin=true;; -OS400*) os400=true;; -Darwin*) darwin=true;; -esac - -# resolve links - $0 may be a softlink -PRG="$0" - -while [ -h "$PRG" ]; do - ls=`ls -ld "$PRG"` - link=`expr "$ls" : '.*-> \(.*\)$'` - if expr "$link" : '/.*' > /dev/null; then - PRG="$link" - else - PRG=`dirname "$PRG"`/"$link" - fi -done - -# Get standard environment variables -PRGDIR=`dirname "$PRG"` - -# Only set CATALINA_HOME if not already set -[ -z "$CATALINA_HOME" ] && CATALINA_HOME=`cd "$PRGDIR/.." ; pwd` - -if [ -r "$CATALINA_HOME"/bin/setenv.sh ]; then - . "$CATALINA_HOME"/bin/setenv.sh -fi - -# For Cygwin, ensure paths are in UNIX format before anything is touched -if $cygwin; then - [ -n "$JAVA_HOME" ] && JAVA_HOME=`cygpath --unix "$JAVA_HOME"` - [ -n "$JRE_HOME" ] && JRE_HOME=`cygpath --unix "$JRE_HOME"` - [ -n "$CATALINA_HOME" ] && CATALINA_HOME=`cygpath --unix "$CATALINA_HOME"` - [ -n "$CATALINA_BASE" ] && CATALINA_BASE=`cygpath --unix "$CATALINA_BASE"` - [ -n "$CLASSPATH" ] && CLASSPATH=`cygpath --path --unix "$CLASSPATH"` - [ -n "$JSSE_HOME" ] && JSSE_HOME=`cygpath --absolute --unix "$JSSE_HOME"` -fi - -# For OS400 -if $os400; then - # Set job priority to standard for interactive (interactive - 6) by using - # the interactive priority - 6, the helper threads that respond to requests - # will be running at the same priority as interactive jobs. - COMMAND='chgjob job('$JOBNAME') runpty(6)' - system $COMMAND - - # Enable multi threading - export QIBM_MULTI_THREADED=Y -fi - -# Get standard Java environment variables -if $os400; then - # -r will Only work on the os400 if the files are: - # 1. owned by the user - # 2. owned by the PRIMARY group of the user - # this will not work if the user belongs in secondary groups - BASEDIR="$CATALINA_HOME" - . "$CATALINA_HOME"/bin/setclasspath.sh -else - if [ -r "$CATALINA_HOME"/bin/setclasspath.sh ]; then - BASEDIR="$CATALINA_HOME" - . "$CATALINA_HOME"/bin/setclasspath.sh - else - echo "Cannot find $CATALINA_HOME/bin/setclasspath.sh" - echo "This file is needed to run this program" - exit 1 - fi -fi - -# Add on extra jar files to CLASSPATH -if [ -n "$JSSE_HOME" ]; then - CLASSPATH="$CLASSPATH":"$JSSE_HOME"/lib/jcert.jar:"$JSSE_HOME"/lib/jnet.jar:"$JSSE_HOME"/lib/jsse.jar -fi -CLASSPATH="$CLASSPATH":"$CATALINA_HOME"/bin/bootstrap.jar:"$CATALINA_HOME"/bin/commons-logging-api.jar - -if [ -z "$CATALINA_BASE" ] ; then - CATALINA_BASE="$CATALINA_HOME" -fi - -if [ -z "$CATALINA_TMPDIR" ] ; then - # Define the java.io.tmpdir to use for Catalina - CATALINA_TMPDIR="$CATALINA_BASE"/temp -fi - -# Bugzilla 37848: When no TTY is available, don't output to console -have_tty=0 -if [ "`tty`" != "not a tty" ]; then - have_tty=1 -fi - -# For Cygwin, switch paths to Windows format before running java -if $cygwin; then - JAVA_HOME=`cygpath --absolute --windows "$JAVA_HOME"` - JRE_HOME=`cygpath --absolute --windows "$JRE_HOME"` - CATALINA_HOME=`cygpath --absolute --windows "$CATALINA_HOME"` - CATALINA_BASE=`cygpath --absolute --windows "$CATALINA_BASE"` - CATALINA_TMPDIR=`cygpath --absolute --windows "$CATALINA_TMPDIR"` - CLASSPATH=`cygpath --path --windows "$CLASSPATH"` - [ -n "$JSSE_HOME" ] && JSSE_HOME=`cygpath --absolute --windows "$JSSE_HOME"` - JAVA_ENDORSED_DIRS=`cygpath --path --windows "$JAVA_ENDORSED_DIRS"` -fi - -# Set juli LogManager if it is present -if [ -r "$CATALINA_HOME"/bin/tomcat-juli.jar ]; then - JAVA_OPTS="$JAVA_OPTS "-Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager" "-Djava.util.logging.config.file="$CATALINA_BASE/conf/logging.properties" -fi - -# ----- Execute The Requested Command ----------------------------------------- - -# Bugzilla 37848: only output this if we have a TTY -if [ $have_tty -eq 1 ]; then - echo "Using CATALINA_BASE: $CATALINA_BASE" - echo "Using CATALINA_HOME: $CATALINA_HOME" - echo "Using CATALINA_TMPDIR: $CATALINA_TMPDIR" - if [ "$1" = "debug" -o "$1" = "javac" ] ; then - echo "Using JAVA_HOME: $JAVA_HOME" - else - echo "Using JRE_HOME: $JRE_HOME" - fi -fi - -if [ "$1" = "jpda" ] ; then - if [ -z "$JPDA_TRANSPORT" ]; then - JPDA_TRANSPORT="dt_socket" - fi - if [ -z "$JPDA_ADDRESS" ]; then - JPDA_ADDRESS="8000" - fi - if [ -z "$JPDA_OPTS" ]; then - JPDA_OPTS="-Xdebug -Xrunjdwp:transport=$JPDA_TRANSPORT,address=$JPDA_ADDRESS,server=y,suspend=n" - fi - CATALINA_OPTS="$CATALINA_OPTS $JPDA_OPTS" - shift -fi - -if [ "$1" = "debug" ] ; then - if $os400; then - echo "Debug command not available on OS400" - exit 1 - else - shift - if [ "$1" = "-security" ] ; then - echo "Using Security Manager" - shift - exec "$_RUNJDB" $JAVA_OPTS $CATALINA_OPTS \ - -Djava.endorsed.dirs="$JAVA_ENDORSED_DIRS" -classpath "$CLASSPATH" \ - -sourcepath "$CATALINA_HOME"/../../jakarta-tomcat-catalina/catalina/src/share \ - -Djava.security.manager \ - -Djava.security.policy=="$CATALINA_BASE"/conf/catalina.policy \ - -Dcatalina.base="$CATALINA_BASE" \ - -Dcatalina.home="$CATALINA_HOME" \ - -Djava.io.tmpdir="$CATALINA_TMPDIR" \ - org.apache.catalina.startup.Bootstrap "$@" start - else - exec "$_RUNJDB" $JAVA_OPTS $CATALINA_OPTS \ - -Djava.endorsed.dirs="$JAVA_ENDORSED_DIRS" -classpath "$CLASSPATH" \ - -sourcepath "$CATALINA_HOME"/../../jakarta-tomcat-catalina/catalina/src/share \ - -Dcatalina.base="$CATALINA_BASE" \ - -Dcatalina.home="$CATALINA_HOME" \ - -Djava.io.tmpdir="$CATALINA_TMPDIR" \ - org.apache.catalina.startup.Bootstrap "$@" start - fi - fi - -elif [ "$1" = "run" ]; then - - shift - if [ "$1" = "-security" ] ; then - echo "Using Security Manager" - shift - exec "$_RUNJAVA" $JAVA_OPTS $CATALINA_OPTS \ - -Djava.endorsed.dirs="$JAVA_ENDORSED_DIRS" -classpath "$CLASSPATH" \ - -Djava.security.manager \ - -Djava.security.policy=="$CATALINA_BASE"/conf/catalina.policy \ - -Dcatalina.base="$CATALINA_BASE" \ - -Dcatalina.home="$CATALINA_HOME" \ - -Djava.io.tmpdir="$CATALINA_TMPDIR" \ - org.apache.catalina.startup.Bootstrap "$@" start - else - exec "$_RUNJAVA" $JAVA_OPTS $CATALINA_OPTS \ - -Djava.endorsed.dirs="$JAVA_ENDORSED_DIRS" -classpath "$CLASSPATH" \ - -Dcatalina.base="$CATALINA_BASE" \ - -Dcatalina.home="$CATALINA_HOME" \ - -Djava.io.tmpdir="$CATALINA_TMPDIR" \ - org.apache.catalina.startup.Bootstrap "$@" start - fi - -elif [ "$1" = "start" ] ; then - - shift - touch "$CATALINA_BASE"/logs/catalina.out - if [ "$1" = "-security" ] ; then - echo "Using Security Manager" - shift - "$_RUNJAVA" $JAVA_OPTS $CATALINA_OPTS \ - -Djava.endorsed.dirs="$JAVA_ENDORSED_DIRS" -classpath "$CLASSPATH" \ - -Djava.security.manager \ - -Djava.security.policy=="$CATALINA_BASE"/conf/catalina.policy \ - -Dcatalina.base="$CATALINA_BASE" \ - -Dcatalina.home="$CATALINA_HOME" \ - -Djava.io.tmpdir="$CATALINA_TMPDIR" \ - org.apache.catalina.startup.Bootstrap "$@" start \ - >> "$CATALINA_BASE"/logs/catalina.out 2>&1 & - - if [ ! -z "$CATALINA_PID" ]; then - echo $! > $CATALINA_PID - fi - else - "$_RUNJAVA" $JAVA_OPTS $CATALINA_OPTS \ - -Djava.endorsed.dirs="$JAVA_ENDORSED_DIRS" -classpath "$CLASSPATH" \ - -Dcatalina.base="$CATALINA_BASE" \ - -Dcatalina.home="$CATALINA_HOME" \ - -Djava.io.tmpdir="$CATALINA_TMPDIR" \ - org.apache.catalina.startup.Bootstrap "$@" start \ - >> "$CATALINA_BASE"/logs/catalina.out 2>&1 & - - if [ ! -z "$CATALINA_PID" ]; then - echo $! > $CATALINA_PID - fi - fi - -elif [ "$1" = "stop" ] ; then - - shift - FORCE=0 - if [ "$1" = "-force" ]; then - shift - FORCE=1 - fi - - "$_RUNJAVA" $JAVA_OPTS $CATALINA_OPTS \ - -Djava.endorsed.dirs="$JAVA_ENDORSED_DIRS" -classpath "$CLASSPATH" \ - -Dcatalina.base="$CATALINA_BASE" \ - -Dcatalina.home="$CATALINA_HOME" \ - -Djava.io.tmpdir="$CATALINA_TMPDIR" \ - org.apache.catalina.startup.Bootstrap "$@" stop - - if [ $FORCE -eq 1 ]; then - if [ ! -z "$CATALINA_PID" ]; then - echo "Killing: `cat $CATALINA_PID`" - kill -9 `cat $CATALINA_PID` - else - echo "Kill failed: \$CATALINA_PID not set" - fi - fi - -elif [ "$1" = "version" ] ; then - - "$_RUNJAVA" \ - -classpath "$CATALINA_HOME/server/lib/catalina.jar" \ - org.apache.catalina.util.ServerInfo - -else - - echo "Usage: catalina.sh ( commands ... )" - echo "commands:" - if $os400; then - echo " debug Start Catalina in a debugger (not available on OS400)" - echo " debug -security Debug Catalina with a security manager (not available on OS400)" - else - echo " debug Start Catalina in a debugger" - echo " debug -security Debug Catalina with a security manager" - fi - echo " jpda start Start Catalina under JPDA debugger" - echo " run Start Catalina in the current window" - echo " run -security Start in the current window with security manager" - echo " start Start Catalina in a separate window" - echo " start -security Start in a separate window with security manager" - echo " stop Stop Catalina" - echo " stop -force Stop Catalina (followed by kill -KILL)" - echo " version What version of tomcat are you running?" - exit 1 - -fi Copied: pal-portal/branches/pal-portal-1.x/installer/etc/tomcat/bin/setenv.bat (from rev 1602, pal-portal/branches/pal-portal-1.x/installer/etc/tomcat/bin/catalina.bat) =================================================================== --- pal-portal/branches/pal-portal-1.x/installer/etc/tomcat/bin/setenv.bat (rev 0) +++ pal-portal/branches/pal-portal-1.x/installer/etc/tomcat/bin/setenv.bat 2008-12-12 14:14:15 UTC (rev 1607) @@ -0,0 +1 @@ +set JAVA_OPTS=%JAVA_OPTS% -Xmx512m -Xms128m -XX:PermSize=128m -XX:MaxPermSize=256m -Djava.awt.headless=true Copied: pal-portal/branches/pal-portal-1.x/installer/etc/tomcat/bin/setenv.sh (from rev 1602, pal-portal/branches/pal-portal-1.x/installer/etc/tomcat/bin/catalina.sh) =================================================================== --- pal-portal/branches/pal-portal-1.x/installer/etc/tomcat/bin/setenv.sh (rev 0) +++ pal-portal/branches/pal-portal-1.x/installer/etc/tomcat/bin/setenv.sh 2008-12-12 14:14:15 UTC (rev 1607) @@ -0,0 +1 @@ +JAVA_OPTS="$JAVA_OPTS -Xmx512m -Xms256m -XX:PermSize=128m -XX:MaxPermSize=256m -Djava.awt.headless=true" From svnnotify ¡÷ sourceforge.jp Sun Dec 14 07:36:23 2008 From: svnnotify ¡÷ sourceforge.jp (svnnotify ¡÷ sourceforge.jp) Date: Sun, 14 Dec 2008 07:36:23 +0900 Subject: [pal-cvs 3873] [1608] removed. Message-ID: <1229207783.973036.18705.nullmailer@users.sourceforge.jp> Revision: 1608 http://svn.sourceforge.jp/view?root=pal&view=rev&rev=1608 Author: shinsuke Date: 2008-12-14 07:36:23 +0900 (Sun, 14 Dec 2008) Log Message: ----------- removed. Removed Paths: ------------- pal-wcm/trunk/src/main/webapp/WEB-INF/lib/ -------------- next part -------------- From svnnotify ¡÷ sourceforge.jp Mon Dec 15 22:43:27 2008 From: svnnotify ¡÷ sourceforge.jp (svnnotify ¡÷ sourceforge.jp) Date: Mon, 15 Dec 2008 22:43:27 +0900 Subject: [pal-cvs 3874] [1609] added files for mysql. Message-ID: <1229348607.486658.2031.nullmailer@users.sourceforge.jp> Revision: 1609 http://svn.sourceforge.jp/view?root=pal&view=rev&rev=1609 Author: shinsuke Date: 2008-12-15 22:43:27 +0900 (Mon, 15 Dec 2008) Log Message: ----------- added files for mysql. Added Paths: ----------- userinfo/trunk/src/main/config/erd/mysql/ userinfo/trunk/src/main/config/erd/mysql/userinfo.erd userinfo/trunk/src/main/config/sql/mysql/ userinfo/trunk/src/main/config/sql/mysql/drop.sql userinfo/trunk/src/main/config/sql/mysql/others/ userinfo/trunk/src/main/config/sql/mysql/others/0-userinfo.dml userinfo/trunk/src/main/config/sql/mysql/others/addresslist.ddl userinfo/trunk/src/main/config/sql/mysql/others/board.ddl userinfo/trunk/src/main/config/sql/mysql/others/board.dml userinfo/trunk/src/main/config/sql/mysql/others/bookmark.ddl userinfo/trunk/src/main/config/sql/mysql/others/bookmark.dml userinfo/trunk/src/main/config/sql/mysql/others/notepad.ddl userinfo/trunk/src/main/config/sql/mysql/others/notepad.dml userinfo/trunk/src/main/config/sql/mysql/others/scheduler.ddl userinfo/trunk/src/main/config/sql/mysql/others/timecard.ddl userinfo/trunk/src/main/config/sql/mysql/others/timecard.dml userinfo/trunk/src/main/config/sql/mysql/others/todolist.ddl userinfo/trunk/src/main/config/sql/mysql/userinfo.ddl -------------- next part -------------- Added: userinfo/trunk/src/main/config/erd/mysql/userinfo.erd =================================================================== --- userinfo/trunk/src/main/config/erd/mysql/userinfo.erd (rev 0) +++ userinfo/trunk/src/main/config/erd/mysql/userinfo.erd 2008-12-15 13:43:27 UTC (rev 1609) @@ -0,0 +1,941 @@ + + + + + + + user_info + User Information + + + + user_id + User ID + + VARCHAR + String + true + 12 + + 255 + true + true + + false + + + + given_name + Given Name + + VARCHAR + String + true + 12 + + 100 + false + false + + false + + + + family_name + Family Name + + 100 + false + false + + false + + + + middle_name + Middle Name + + 50 + false + false + + false + + + + given_name_desc + Given Name Descritpion + + 100 + false + false + + false + + + + family_name_desc + Family Name Description + + 100 + false + false + + false + + + + nickname + Nickname + + VARCHAR + String + true + 12 + + 100 + false + false + + false + + + + gender + Gender + + 1 + false + false + + false + + + + birth_date + Birth Date + + DATE + Date + false + 91 + + 10 + false + false + + false + + + + email + Email + + 255 + false + false + + false + + + + url + URL + + 255 + false + false + + false + + + + telephone + Telephone + + VARCHAR + String + true + 12 + + 40 + false + false + + false + + + + locale + Locale + + VARCHAR + String + true + 12 + + 5 + false + false + + false + + + + role_id + Default Role ID + + 255 + false + false + + false + + + + group_id + Default Group ID + + 255 + false + false + + false + + + + created_time + Created Time + + TIMESTAMP + Datetime + false + 93 + + 10 + true + false + + false + + + + created_by + Created By + + 255 + true + false + + false + + + + updated_time + Updated Time + + 10 + true + false + + false + + + + updated_by + Updated By + + 255 + true + false + + false + + + + deleted_time + Deleted Time + + 10 + false + false + + false + + + + deleted_by + Deleted By + + 255 + false + false + + false + + + + versionNo + Version No. + + INTEGER + Integer + false + 4 + + 10 + true + false + + false + + + + + + 185 + 199 + -1 + -1 + + + + FK_from_user_to_group + + + + group_id + Group ID + + 255 + true + true + + false + + + + + + + + + + group_info + Group Information + + + + + name + Name + + 100 + false + false + + false + + + + description + Description + + 255 + false + false + + false + + + + email + Email + + 255 + false + false + + false + + + + url + URL + + 255 + false + false + + false + + + + telephone + Telephone + + 40 + false + false + + false + + + + created_time + Created Time + + 10 + true + false + + false + + + + created_by + Created By + + 255 + true + false + + false + + + + updated_time + Updated Time + + 10 + true + false + + false + + + + updated_by + Updated By + + 255 + true + false + + false + + + + deleted_time + Deleted Time + + 10 + false + false + + false + + + + deleted_by + Deleted By + + 255 + false + false + + false + + + + versionNo + Version No. + + 10 + true + false + + false + + + + + + 40 + 719 + -1 + -1 + + + + + + FK_from_mapping_to_group + + + + + group_id + Group ID + + VARCHAR + String + true + 12 + + 255 + true + false + + false + + + + + + + + group_mapping + Group Mapping + + + + id + ID + + INTEGER + Integer + false + 4 + + 10 + true + true + + true + + + + user_id + User ID + + 255 + true + false + + false + + + + + + + 44 + 40 + -1 + -1 + + + + FK_from_mapping_to_user + + + + + + + + + + + + 2 + + + + + + + + + + + + + 2 + + + + + + + + + + + 2 + + + + + + + + + + + 2 + + + + + + + + + + 2 + + + + + + + + FK_from_user_to_role + + + + role_id + Role ID + + 255 + true + true + + false + + + + + + + + + + role_info + Role Information + + + + + name + Name + + 100 + false + false + + false + + + + description + Description + + 255 + false + false + + false + + + + email + Email + + 255 + false + false + + false + + + + url + URL + + 255 + false + false + + false + + + + telephone + Telephone + + 40 + false + false + + false + + + + created_time + Created Time + + 10 + true + false + + false + + + + created_by + Created By + + 255 + true + false + + false + + + + updated_time + Updated Time + + 10 + true + false + + false + + + + updated_by + Updated By + + 255 + true + false + + false + + + + deleted_time + Deleted Time + + 10 + false + false + + false + + + + deleted_by + Deleted By + + 255 + false + false + + false + + + + versionNo + Version No. + + 10 + true + false + + false + + + + + + 364 + 719 + -1 + -1 + + + + + + FK_from_mapping_to_role + + + + + role_id + Role ID + + 255 + true + false + + false + + + + + + + + role_mapping + Role Mapping + + + + id + ID + + INT + Integer + false + 4 + + 10 + true + true + + true + + + + user_id + User ID + + 255 + true + false + + false + + + + + + + 372 + 40 + -1 + -1 + + + + FK_from_mapping_to_user + + + + + + + + + + + + 2 + + + + + + + + + + + + + 2 + + + + + + + + + + + 2 + + + + + + + + + + + 2 + + + + + + + + + + 2 + + + + + + + + + + + + + + + 2 + + + + + + + + + + + + + MySQL + false + + sun.jdbc.odbc.JdbcOdbc + + + + + + false + + + + 2 + + + + + + \ No newline at end of file Added: userinfo/trunk/src/main/config/sql/mysql/drop.sql =================================================================== --- userinfo/trunk/src/main/config/sql/mysql/drop.sql (rev 0) +++ userinfo/trunk/src/main/config/sql/mysql/drop.sql 2008-12-15 13:43:27 UTC (rev 1609) @@ -0,0 +1,37 @@ +DROP TABLE postal; +DROP TABLE contact; +DROP TABLE custom; +DROP TABLE person; +DROP TABLE company; +DROP TABLE message_content; +DROP TABLE message_attachment; +DROP TABLE reply; +DROP TABLE category_access; +DROP TABLE message; +DROP TABLE attachment; +DROP TABLE category; +DROP TABLE bookmark_link; +DROP TABLE bookmark_category; +DROP TABLE notepad_content; +DROP TABLE notepad; +DROP TABLE notepad_category; +DROP TABLE facility_schedule_mapping; +DROP TABLE facility_content; +DROP TABLE facility; +DROP TABLE facility_group; +DROP TABLE event_schedule_content; +DROP TABLE event_schedule_mapping; +DROP TABLE event_schedule; +DROP TABLE monthly_working_report; +DROP TABLE working_type; +DROP TABLE daily_report; +DROP TABLE monthly_report; +DROP TABLE employee; +DROP TABLE todo_mapping; +DROP TABLE todo_category; +DROP TABLE todo; +DROP TABLE role_mapping; +DROP TABLE group_mapping; +DROP TABLE user_info; +DROP TABLE role_info; +DROP TABLE group_info; Added: userinfo/trunk/src/main/config/sql/mysql/others/0-userinfo.dml =================================================================== --- userinfo/trunk/src/main/config/sql/mysql/others/0-userinfo.dml (rev 0) +++ userinfo/trunk/src/main/config/sql/mysql/others/0-userinfo.dml 2008-12-15 13:43:27 UTC (rev 1609) @@ -0,0 +1,2 @@ +insert into user_info (user_id, created_time, created_by, updated_time, updated_by, versionno) values ('admin', '2008-10-15 17:17:37', 'admin', '2008-10-15 17:17:37', 'admin', 0); + Added: userinfo/trunk/src/main/config/sql/mysql/others/addresslist.ddl =================================================================== --- userinfo/trunk/src/main/config/sql/mysql/others/addresslist.ddl (rev 0) +++ userinfo/trunk/src/main/config/sql/mysql/others/addresslist.ddl 2008-12-15 13:43:27 UTC (rev 1609) @@ -0,0 +1,95 @@ +/********************************** +Table Name: Company +**********************************/ +CREATE TABLE company( + id BIGINT(19) NOT NULL PRIMARY KEY AUTO_INCREMENT, + user_id VARCHAR(255), + name VARCHAR(200), + name_desc VARCHAR(200), + department VARCHAR(200), + building VARCHAR(200), + street VARCHAR(200), + city VARCHAR(100), + state VARCHAR(100), + postal_code VARCHAR(30), + country VARCHAR(200), + telephone1 VARCHAR(40), + telephone2 VARCHAR(40), + fax1 VARCHAR(40), + fax2 VARCHAR(40), + url VARCHAR(255), + is_public VARCHAR(1) DEFAULT 'T', + 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 DEFAULT 1, + FOREIGN KEY (user_id) REFERENCES user_info (user_id) +); + +/********************************** +Table Name: Person +**********************************/ +CREATE TABLE person( + id BIGINT(19) NOT NULL PRIMARY KEY AUTO_INCREMENT, + user_id VARCHAR(255), + given_name VARCHAR(100), + given_name_desc VARCHAR(100), + family_name VARCHAR(100), + family_name_desc VARCHAR(100), + middle_name VARCHAR(50), + name_prefix VARCHAR(30), + name_suffix VARCHAR(30), + nickname VARCHAR(100), + job_title VARCHAR(50), + is_public VARCHAR(1) DEFAULT 'T', + company_id BIGINT(19), + 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 DEFAULT 1, + FOREIGN KEY (company_id) REFERENCES company (id), + FOREIGN KEY (user_id) REFERENCES user_info (user_id) +); + +/********************************** +Table Name: Custom +**********************************/ +CREATE TABLE custom( + id BIGINT(19) NOT NULL PRIMARY KEY AUTO_INCREMENT, + person_id BIGINT(19) NOT NULL, + value VARCHAR(255), + sort_order INTEGER NOT NULL, + FOREIGN KEY (person_id) REFERENCES person (id) +); + +/********************************** +Table Name: Contact +**********************************/ +CREATE TABLE contact( + id BIGINT(19) NOT NULL PRIMARY KEY AUTO_INCREMENT, + person_id BIGINT(19) NOT NULL, + name VARCHAR(20) NOT NULL, + value VARCHAR(255), + FOREIGN KEY (person_id) REFERENCES person (id) +); + +/********************************** +Table Name: Postal +**********************************/ +CREATE TABLE postal( + person_id BIGINT(19) NOT NULL PRIMARY KEY, + building VARCHAR(200), + street VARCHAR(200), + city VARCHAR(100), + state VARCHAR(100), + postal_code VARCHAR(30), + country VARCHAR(100), + FOREIGN KEY (person_id) REFERENCES person (id) +); + Added: userinfo/trunk/src/main/config/sql/mysql/others/board.ddl =================================================================== --- userinfo/trunk/src/main/config/sql/mysql/others/board.ddl (rev 0) +++ userinfo/trunk/src/main/config/sql/mysql/others/board.ddl 2008-12-15 13:43:27 UTC (rev 1609) @@ -0,0 +1,115 @@ +/********************************** +Table Name: Category +**********************************/ +CREATE TABLE category( + id INTEGER NOT NULL PRIMARY KEY AUTO_INCREMENT, + name VARCHAR(100) NOT NULL, + sort_order INTEGER NOT NULL DEFAULT 0, + 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 DEFAULT 0 +); + +/********************************** +Table Name: Attachment +**********************************/ +CREATE TABLE attachment( + id BIGINT(20) NOT NULL PRIMARY KEY AUTO_INCREMENT, + data MEDIUMBLOB NOT NULL, + name VARCHAR(255), + size INTEGER, + content_type VARCHAR(40), + created_time TIMESTAMP NOT NULL, + created_by VARCHAR(255) NOT NULL +); + +/********************************** +Table Name: Message +**********************************/ +CREATE TABLE message( + id BIGINT(20) NOT NULL PRIMARY KEY AUTO_INCREMENT, + display_name VARCHAR(100) NOT NULL, + title VARCHAR(200) NOT NULL, + status VARCHAR(1) NOT NULL DEFAULT 'E', + start_time DATETIME, + end_time DATETIME, + has_reply VARCHAR(1) NOT NULL DEFAULT 'T', + category_id INTEGER NOT NULL DEFAULT 0, + 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 DEFAULT 0, + FOREIGN KEY (category_id) REFERENCES category (id) +); + +/********************************** +Table Name: Category Access +**********************************/ +CREATE TABLE category_access( + id BIGINT(20) NOT NULL PRIMARY KEY AUTO_INCREMENT, + name VARCHAR(255) NOT NULL, + access_type INTEGER NOT NULL, + category_id INTEGER NOT NULL, + created_time TIMESTAMP NOT NULL, + created_by VARCHAR(255) NOT NULL, + updated_time TIMESTAMP NOT NULL, + updated_by VARCHAR(255) NOT NULL, + versionNo INT NOT NULL DEFAULT 0, + FOREIGN KEY (category_id) REFERENCES category (id) +); + +/********************************** +Table Name: Reply +**********************************/ +CREATE TABLE reply( + id BIGINT(20) NOT NULL PRIMARY KEY AUTO_INCREMENT, + display_name VARCHAR(100) NOT NULL, + content VARCHAR(4000), + message_id BIGINT(20) NOT NULL, + created_time TIMESTAMP NOT NULL, + created_by VARCHAR(255) NOT NULL, + deleted_time TIMESTAMP, + deleted_by VARCHAR(255), + FOREIGN KEY (message_id) REFERENCES message (id) +); + +/********************************** +Table Name: Message Attachment +**********************************/ +CREATE TABLE message_attachment( + id BIGINT(20) NOT NULL PRIMARY KEY AUTO_INCREMENT, + memo VARCHAR(100), + versionable VARCHAR(1) NOT NULL DEFAULT 'F', + message_id BIGINT(20) NOT NULL, + attachment_id BIGINT(20) 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 DEFAULT 0, + FOREIGN KEY (message_id) REFERENCES message (id), + FOREIGN KEY (attachment_id) REFERENCES attachment (id) +); + +/********************************** +Table Name: Message Content +**********************************/ +CREATE TABLE message_content( + message_id BIGINT(20) NOT NULL PRIMARY KEY, + content VARCHAR(4000), + FOREIGN KEY (message_id) REFERENCES message (id) +); + +CREATE INDEX IDX_title_for_message ON message (title); + +CREATE INDEX IDX_content_for_message_content ON message_content (content); + Added: userinfo/trunk/src/main/config/sql/mysql/others/board.dml =================================================================== --- userinfo/trunk/src/main/config/sql/mysql/others/board.dml (rev 0) +++ userinfo/trunk/src/main/config/sql/mysql/others/board.dml 2008-12-15 13:43:27 UTC (rev 1609) @@ -0,0 +1,4 @@ +insert into category (id, name, created_time, created_by, sort_order, updated_time, updated_by, versionno) values (1, 'TOP', '2008-10-06 16:17:41', 'admin', 1, '2008-10-06 16:17:41', 'admin', 0); +insert into category_access (id, name, created_time, created_by, updated_time, updated_by, versionno, access_type, category_id) values (1, 'role::user', '2008-10-06 16:17:41', 'admin', '2008-10-06 16:17:41', 'admin', 0, 4, 1); + + Added: userinfo/trunk/src/main/config/sql/mysql/others/bookmark.ddl =================================================================== --- userinfo/trunk/src/main/config/sql/mysql/others/bookmark.ddl (rev 0) +++ userinfo/trunk/src/main/config/sql/mysql/others/bookmark.ddl 2008-12-15 13:43:27 UTC (rev 1609) @@ -0,0 +1,48 @@ +/********************************** +Table Name: Bookmark Category +**********************************/ +CREATE TABLE bookmark_category( + id INTEGER NOT NULL PRIMARY KEY AUTO_INCREMENT, + name VARCHAR(100) NOT NULL, + memo VARCHAR(200), + type VARCHAR(1) NOT NULL DEFAULT 'P', + sort_order INTEGER NOT NULL DEFAULT 0, + 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 DEFAULT 0, + FOREIGN KEY (created_by) REFERENCES user_info (user_id), + FOREIGN KEY (updated_by) REFERENCES user_info (user_id) +); + +/********************************** +Table Name: Bookmark Link +**********************************/ +CREATE TABLE bookmark_link( + id BIGINT(20) NOT NULL PRIMARY KEY AUTO_INCREMENT, + name VARCHAR(100) NOT NULL, + memo VARCHAR(200), + url VARCHAR(255) NOT NULL DEFAULT 'E', + type VARCHAR(1) NOT NULL, + sort_order INTEGER NOT NULL DEFAULT 0, + category_id INTEGER DEFAULT 0, + 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 DEFAULT 0, + FOREIGN KEY (category_id) REFERENCES bookmark_category (id), + FOREIGN KEY (created_by) REFERENCES user_info (user_id), + FOREIGN KEY (updated_by) REFERENCES user_info (user_id) +); + + +CREATE INDEX IDX_created_by_for_bookmark_category ON bookmark_category (created_by); + +CREATE INDEX IDX_created_by_and_category_id_for_link ON bookmark_link (created_by, category_id); + Added: userinfo/trunk/src/main/config/sql/mysql/others/bookmark.dml =================================================================== --- userinfo/trunk/src/main/config/sql/mysql/others/bookmark.dml (rev 0) +++ userinfo/trunk/src/main/config/sql/mysql/others/bookmark.dml 2008-12-15 13:43:27 UTC (rev 1609) @@ -0,0 +1,2 @@ +insert into bookmark_category (id, name, created_time, created_by, sort_order, updated_time, updated_by, versionno, memo, type) values (1, '(Unclassified)', '2008-10-15 17:17:37', 'admin', 1, '2008-10-15 17:17:37', 'admin', 0, '', 'P'); +insert into bookmark_category (id, name, created_time, created_by, sort_order, updated_time, updated_by, versionno, memo, type) values (2, '(Shared)', '2008-10-15 17:17:37', 'admin', 1, '2008-10-15 17:17:37', 'admin', 0, '', 'P'); Added: userinfo/trunk/src/main/config/sql/mysql/others/notepad.ddl =================================================================== --- userinfo/trunk/src/main/config/sql/mysql/others/notepad.ddl (rev 0) +++ userinfo/trunk/src/main/config/sql/mysql/others/notepad.ddl 2008-12-15 13:43:27 UTC (rev 1609) @@ -0,0 +1,53 @@ +/********************************** +Table Name: Notepad Category +**********************************/ +CREATE TABLE notepad_category( + id INTEGER NOT NULL PRIMARY KEY AUTO_INCREMENT, + name VARCHAR(100) NOT NULL, + type VARCHAR(1) NOT NULL DEFAULT 'P', + sort_order INTEGER NOT NULL DEFAULT 0, + 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 DEFAULT 0, + FOREIGN KEY (created_by) REFERENCES user_info (user_id), + FOREIGN KEY (updated_by) REFERENCES user_info (user_id) +); + +/********************************** +Table Name: Notepad +**********************************/ +CREATE TABLE notepad( + id BIGINT(20) NOT NULL PRIMARY KEY AUTO_INCREMENT, + title VARCHAR(100) NOT NULL, + sort_order INTEGER NOT NULL DEFAULT 0, + category_id INTEGER DEFAULT 0, + 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 DEFAULT 0, + FOREIGN KEY (category_id) REFERENCES notepad_category (id), + FOREIGN KEY (created_by) REFERENCES user_info (user_id), + FOREIGN KEY (updated_by) REFERENCES user_info (user_id) +); + +/********************************** +Table Name: Notepad Content +**********************************/ +CREATE TABLE notepad_content( + id BIGINT(20) NOT NULL PRIMARY KEY, + content VARCHAR(4000), + FOREIGN KEY (id) REFERENCES notepad (id) +); + + +CREATE INDEX IDX_created_by_for_notepad_category ON notepad_category (created_by); + +CREATE INDEX IDX_created_by_and_category_id_for_notepad ON notepad (created_by, category_id); + Added: userinfo/trunk/src/main/config/sql/mysql/others/notepad.dml =================================================================== --- userinfo/trunk/src/main/config/sql/mysql/others/notepad.dml (rev 0) +++ userinfo/trunk/src/main/config/sql/mysql/others/notepad.dml 2008-12-15 13:43:27 UTC (rev 1609) @@ -0,0 +1,2 @@ +insert into notepad_category (id, name, created_time, created_by, sort_order, updated_time, updated_by, versionno, type) values (1, '(Unclassified)', '2008-10-15 17:17:37', 'admin', 1, '2008-10-15 17:17:37', 'admin', 0, 'P'); +insert into notepad_category (id, name, created_time, created_by, sort_order, updated_time, updated_by, versionno, type) values (2, '(Shared)', '2008-10-15 17:17:37', 'admin', 1, '2008-10-15 17:17:37', 'admin', 0, 'P'); Added: userinfo/trunk/src/main/config/sql/mysql/others/scheduler.ddl =================================================================== --- userinfo/trunk/src/main/config/sql/mysql/others/scheduler.ddl (rev 0) +++ userinfo/trunk/src/main/config/sql/mysql/others/scheduler.ddl 2008-12-15 13:43:27 UTC (rev 1609) @@ -0,0 +1,96 @@ +/********************************** +Table Name: Event Schedule +**********************************/ +CREATE TABLE event_schedule( + id BIGINT(20) NOT NULL PRIMARY KEY AUTO_INCREMENT, + title VARCHAR(100) NOT NULL, + location VARCHAR(100), + start_date DATE NOT NULL, + start_time TIME, + end_date DATE, + end_time TIME, + secret VARCHAR(1) NOT NULL DEFAULT 'F', + 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: Event Schedule Mapping +**********************************/ +CREATE TABLE event_schedule_mapping( + id BIGINT(20) NOT NULL PRIMARY KEY AUTO_INCREMENT, + 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 event_schedule (id) +); + +/********************************** +Table Name: Event Schedule Content +**********************************/ +CREATE TABLE event_schedule_content( + id BIGINT(20) NOT NULL PRIMARY KEY, + content VARCHAR(1000), + FOREIGN KEY (id) REFERENCES event_schedule (id) +); + +/********************************** +Table Name: Facility Group +**********************************/ +CREATE TABLE facility_group( + id INTEGER NOT NULL PRIMARY KEY AUTO_INCREMENT, + name VARCHAR(100) NOT NULL, + sort_order INTEGER NOT NULL DEFAULT 1, + 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 DEFAULT 0 +); + +/********************************** +Table Name: Facility +**********************************/ +CREATE TABLE facility( + id INTEGER NOT NULL PRIMARY KEY AUTO_INCREMENT, + name VARCHAR(100) NOT NULL, + sort_order INTEGER NOT NULL DEFAULT 1, + group_id INTEGER 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 DEFAULT 0, + FOREIGN KEY (group_id) REFERENCES facility_group (id) +); + +/********************************** +Table Name: Facility Content +**********************************/ +CREATE TABLE facility_content( + id INTEGER NOT NULL PRIMARY KEY, + content VARCHAR(1000), + FOREIGN KEY (id) REFERENCES facility (id) +); + +/********************************** +Table Name: Facility Schedule Mapping +**********************************/ +CREATE TABLE facility_schedule_mapping( + id BIGINT(20) NOT NULL PRIMARY KEY AUTO_INCREMENT, + schedule_id BIGINT(20) NOT NULL, + facility_id INTEGER NOT NULL, + FOREIGN KEY (schedule_id) REFERENCES event_schedule (id), + FOREIGN KEY (facility_id) REFERENCES facility (id) +); + Added: userinfo/trunk/src/main/config/sql/mysql/others/timecard.ddl =================================================================== --- userinfo/trunk/src/main/config/sql/mysql/others/timecard.ddl (rev 0) +++ userinfo/trunk/src/main/config/sql/mysql/others/timecard.ddl 2008-12-15 13:43:27 UTC (rev 1609) @@ -0,0 +1,98 @@ +/********************************** +Table Name: Employee +**********************************/ +CREATE TABLE employee( + id INTEGER NOT NULL PRIMARY KEY AUTO_INCREMENT, + username VARCHAR(255) NOT NULL, + manager VARCHAR(255) NOT NULL, + is_available VARCHAR(1) NOT NULL DEFAULT 'T', + 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 DEFAULT 0, + FOREIGN KEY (username) REFERENCES user_info (user_id), + FOREIGN KEY (manager) REFERENCES user_info (user_id) +); + +/********************************** +Table Name: Monthly Report +**********************************/ +CREATE TABLE monthly_report( + id BIGINT(20) NOT NULL PRIMARY KEY AUTO_INCREMENT, + year INTEGER NOT NULL, + month INTEGER NOT NULL, + status INTEGER NOT NULL DEFAULT 1, + std_working_days DOUBLE NOT NULL DEFAULT 0, + working_time BIGINT(20) NOT NULL DEFAULT 0, + std_working_time BIGINT(20) NOT NULL DEFAULT 0, + over_time BIGINT(20) NOT NULL DEFAULT 0, + mnt_over_time BIGINT(20) NOT NULL DEFAULT 0, + employee_id INTEGER 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 DEFAULT 0, + FOREIGN KEY (employee_id) REFERENCES employee (id) +); + +/********************************** +Table Name: Daily Report +**********************************/ +CREATE TABLE daily_report( + id BIGINT(20) NOT NULL PRIMARY KEY AUTO_INCREMENT, + date INTEGER NOT NULL, + day_of_week INTEGER NOT NULL, + date_type INTEGER NOT NULL, + working_type INTEGER NOT NULL DEFAULT 1, + status INTEGER NOT NULL DEFAULT 1, + start_time TIME, + end_time TIME, + break_time TIME, + otj_time TIME, + working_time BIGINT(20), + memo VARCHAR(200), + monthly_report_id BIGINT(20) NOT NULL DEFAULT 0, + created_time TIMESTAMP NOT NULL, + created_by VARCHAR(255) NOT NULL, + updated_time TIMESTAMP NOT NULL, + updated_by VARCHAR(255) NOT NULL, + versionNo INTEGER NOT NULL DEFAULT 0, + FOREIGN KEY (monthly_report_id) REFERENCES monthly_report (id) +); + +/********************************** +Table Name: Working Type +**********************************/ +CREATE TABLE working_type( + id INTEGER NOT NULL PRIMARY KEY AUTO_INCREMENT, + name VARCHAR(100) NOT NULL, + value INTEGER NOT NULL, + type VARCHAR(10) NOT NULL, + parent_id INTEGER DEFAULT 1, + 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 DEFAULT 0 +); + +/********************************** +Table Name: Monthly Working Report +**********************************/ +CREATE TABLE monthly_working_report( + id BIGINT(20) NOT NULL PRIMARY KEY AUTO_INCREMENT, + value DOUBLE NOT NULL, + monthly_report_id BIGINT(20) NOT NULL, + working_type_id INTEGER NOT NULL, + FOREIGN KEY (working_type_id) REFERENCES working_type (id), + FOREIGN KEY (monthly_report_id) REFERENCES monthly_report (id) +); + Added: userinfo/trunk/src/main/config/sql/mysql/others/timecard.dml =================================================================== --- userinfo/trunk/src/main/config/sql/mysql/others/timecard.dml (rev 0) +++ userinfo/trunk/src/main/config/sql/mysql/others/timecard.dml 2008-12-15 13:43:27 UTC (rev 1609) @@ -0,0 +1,21 @@ +insert into working_type (id, name, value, type, parent_id, created_time, created_by, updated_time, updated_by, versionno) values (1, 'Work', 1, 'WORK', NULL, '2008-10-06 16:17:41', 'admin', '2008-10-06 16:17:41', 'admin', 0); +insert into working_type (id, name, value, type, parent_id, created_time, created_by, updated_time, updated_by, versionno) values (2, 'WorkOnHoliday', 2, 'WORK', NULL, '2008-10-06 16:17:41', 'admin', '2008-10-06 16:17:41', 'admin', 0); +insert into working_type (id, name, value, type, parent_id, created_time, created_by, updated_time, updated_by, versionno) values (3, 'WorkOnHolidayAm', 3, 'WORK_AM', 2, '2008-10-06 16:17:41', 'admin', '2008-10-06 16:17:41', 'admin', 0); +insert into working_type (id, name, value, type, parent_id, created_time, created_by, updated_time, updated_by, versionno) values (4, 'WorkOnHolidayPm', 4, 'WORK_PM', 2, '2008-10-06 16:17:41', 'admin', '2008-10-06 16:17:41', 'admin', 0); +insert into working_type (id, name, value, type, parent_id, created_time, created_by, updated_time, updated_by, versionno) values (5, 'Holiday', 200, 'OFF', NULL, '2008-10-06 16:17:41', 'admin', '2008-10-06 16:17:41', 'admin', 0); +insert into working_type (id, name, value, type, parent_id, created_time, created_by, updated_time, updated_by, versionno) values (6, 'DayOffWithPay', 20, 'PAIDOFF',NULL, '2008-10-06 16:17:41', 'admin', '2008-10-06 16:17:41', 'admin', 0); +insert into working_type (id, name, value, type, parent_id, created_time, created_by, updated_time, updated_by, versionno) values (7, 'AmOffWithPay', 21, 'PAIDOFF_AM', 6, '2008-10-06 16:17:41', 'admin', '2008-10-06 16:17:41', 'admin', 0); +insert into working_type (id, name, value, type, parent_id, created_time, created_by, updated_time, updated_by, versionno) values (8, 'PmOffWithPay', 22, 'PAIDOFF_PM', 6, '2008-10-06 16:17:41', 'admin', '2008-10-06 16:17:41', 'admin', 0); +insert into working_type (id, name, value, type, parent_id, created_time, created_by, updated_time, updated_by, versionno) values (9, 'BereavementLeave', 30, 'PAIDOFF', NULL, '2008-10-06 16:17:41', 'admin', '2008-10-06 16:17:41', 'admin', 0); +insert into working_type (id, name, value, type, parent_id, created_time, created_by, updated_time, updated_by, versionno) values (10, 'BereavementLeaveAm', 31, 'PAIDOFF_AM', 9, '2008-10-06 16:17:41', 'admin', '2008-10-06 16:17:41', 'admin', 0); +insert into working_type (id, name, value, type, parent_id, created_time, created_by, updated_time, updated_by, versionno) values (11, 'BereavementLeavePm', 32, 'PAIDOFF_PM', 9, '2008-10-06 16:17:41', 'admin', '2008-10-06 16:17:41', 'admin', 0); +insert into working_type (id, name, value, type, parent_id, created_time, created_by, updated_time, updated_by, versionno) values (12, 'SickLeave', 40, 'PAIDOFF', NULL, '2008-10-06 16:17:41', 'admin', '2008-10-06 16:17:41', 'admin', 0); +insert into working_type (id, name, value, type, parent_id, created_time, created_by, updated_time, updated_by, versionno) values (13, 'SickLeaveAm', 41, 'PAIDOFF_AM', 12, '2008-10-06 16:17:41', 'admin', '2008-10-06 16:17:41', 'admin', 0); +insert into working_type (id, name, value, type, parent_id, created_time, created_by, updated_time, updated_by, versionno) values (14, 'SickLeavePm', 42, 'PAIDOFF_PM', 12, '2008-10-06 16:17:41', 'admin', '2008-10-06 16:17:41', 'admin', 0); +insert into working_type (id, name, value, type, parent_id, created_time, created_by, updated_time, updated_by, versionno) values (15, 'DayOff', 100, 'OFF', NULL, '2008-10-06 16:17:41', 'admin', '2008-10-06 16:17:41', 'admin', 0); +insert into working_type (id, name, value, type, parent_id, created_time, created_by, updated_time, updated_by, versionno) values (16, 'AmOff', 101, 'OFF_AM', 15, '2008-10-06 16:17:41', 'admin', '2008-10-06 16:17:41', 'admin', 0); +insert into working_type (id, name, value, type, parent_id, created_time, created_by, updated_time, updated_by, versionno) values (17, 'PmOff', 102, 'OFF_PM', 15, '2008-10-06 16:17:41', 'admin', '2008-10-06 16:17:41', 'admin', 0); +insert into working_type (id, name, value, type, parent_id, created_time, created_by, updated_time, updated_by, versionno) values (18, 'SubstituteHoliday', 110, 'OFF', NULL, '2008-10-06 16:17:41', 'admin', '2008-10-06 16:17:41', 'admin', 0); +insert into working_type (id, name, value, type, parent_id, created_time, created_by, updated_time, updated_by, versionno) values (19, 'SubstituteHolidayAm', 111, 'OFF_AM', 18, '2008-10-06 16:17:41', 'admin', '2008-10-06 16:17:41', 'admin', 0); +insert into working_type (id, name, value, type, parent_id, created_time, created_by, updated_time, updated_by, versionno) values (20, 'SubstituteHolidayPm', 112, 'OFF_PM', 18, '2008-10-06 16:17:41', 'admin', '2008-10-06 16:17:41', 'admin', 0); + Added: userinfo/trunk/src/main/config/sql/mysql/others/todolist.ddl =================================================================== --- userinfo/trunk/src/main/config/sql/mysql/others/todolist.ddl (rev 0) +++ userinfo/trunk/src/main/config/sql/mysql/others/todolist.ddl 2008-12-15 13:43:27 UTC (rev 1609) @@ -0,0 +1,60 @@ +/********************************** +Table Name: ToDo +**********************************/ +CREATE TABLE todo( + id BIGINT(20) NOT NULL PRIMARY KEY AUTO_INCREMENT, + name VARCHAR(100) NOT NULL, + description VARCHAR(200), + priority INTEGER NOT NULL, + status INTEGER NOT NULL, + start_date TIMESTAMP, + end_date TIMESTAMP, + 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 (created_by) REFERENCES user_info (user_id) +); + +/********************************** +Table Name: ToDo Category +**********************************/ +CREATE TABLE todo_category( + id BIGINT(20) NOT NULL PRIMARY KEY AUTO_INCREMENT, + name VARCHAR(100) NOT NULL, + sort_order INTEGER NOT NULL DEFAULT 1, + user_id VARCHAR(255) 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), + FOREIGN KEY (user_id) REFERENCES user_info (user_id) +); + +/********************************** +Table Name: ToDo Mapping +**********************************/ +CREATE TABLE todo_mapping( + id BIGINT(20) NOT NULL PRIMARY KEY AUTO_INCREMENT, + status INT NOT NULL, + memo VARCHAR(255), + todo_id BIGINT(20) NOT NULL, + user_id VARCHAR(255) NOT NULL, + category_id BIGINT(20), + 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 (user_id) REFERENCES user_info (user_id), + FOREIGN KEY (todo_id) REFERENCES todo (id), + FOREIGN KEY (category_id) REFERENCES todo_category (id) +); + Added: userinfo/trunk/src/main/config/sql/mysql/userinfo.ddl =================================================================== --- userinfo/trunk/src/main/config/sql/mysql/userinfo.ddl (rev 0) +++ userinfo/trunk/src/main/config/sql/mysql/userinfo.ddl 2008-12-15 13:43:27 UTC (rev 1609) @@ -0,0 +1,96 @@ +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), + locale VARCHAR(5), + 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 PRIMARY KEY AUTO_INCREMENT, + 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 PRIMARY KEY AUTO_INCREMENT, + 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) +); + From svnnotify ¡÷ sourceforge.jp Mon Dec 15 22:44:43 2008 From: svnnotify ¡÷ sourceforge.jp (svnnotify ¡÷ sourceforge.jp) Date: Mon, 15 Dec 2008 22:44:43 +0900 Subject: [pal-cvs 3875] [1610] added files for mysql. Message-ID: <1229348683.100873.3364.nullmailer@users.sourceforge.jp> Revision: 1610 http://svn.sourceforge.jp/view?root=pal&view=rev&rev=1610 Author: shinsuke Date: 2008-12-15 22:44:43 +0900 (Mon, 15 Dec 2008) Log Message: ----------- added files for mysql. Added Paths: ----------- addresslist/trunk/src/main/config/erd/mysql/ addresslist/trunk/src/main/config/erd/mysql/addresslist.erd addresslist/trunk/src/main/config/sql/mysql/ addresslist/trunk/src/main/config/sql/mysql/addresslist.ddl -------------- next part -------------- Added: addresslist/trunk/src/main/config/erd/mysql/addresslist.erd =================================================================== --- addresslist/trunk/src/main/config/erd/mysql/addresslist.erd (rev 0) +++ addresslist/trunk/src/main/config/erd/mysql/addresslist.erd 2008-12-15 13:44:43 UTC (rev 1610) @@ -0,0 +1,1923 @@ + + + + + + + user_info + User Information + + + + user_id + User ID + + VARCHAR + String + true + 12 + + 255 + true + true + + false + + + + given_name + Given Name + + VARCHAR + String + true + 12 + + 100 + false + false + + false + + + + family_name + Family Name + + 100 + false + false + + false + + + + middle_name + Middle Name + + 50 + false + false + + false + + + + given_name_desc + Given Name Descritpion + + 100 + false + false + + false + + + + family_name_desc + Family Name Description + + 100 + false + false + + false + + + + nickname + Nickname + + VARCHAR + String + true + 12 + + 100 + false + false + + false + + + + gender + Gender + + 1 + false + false + + false + + + + birth_date + Birth Date + + DATE + Date + false + 91 + + 10 + false + false + + false + + + + email + Email + + 255 + false + false + + false + + + + url + URL + + 255 + false + false + + false + + + + telephone + Telephone + + VARCHAR + String + true + 12 + + 40 + false + false + + false + + + + locale + Locale + + VARCHAR + String + true + 12 + + 5 + false + false + + false + + + + role_id + Default Role ID + + 255 + false + false + + false + + + + group_id + Default Group ID + + 255 + false + false + + false + + + + created_time + Created Time + + TIMESTAMP + Datetime + false + 93 + + 10 + true + false + + false + + + + created_by + Created By + + 255 + true + false + + false + + + + updated_time + Updated Time + + 10 + true + false + + false + + + + updated_by + Updated By + + 255 + true + false + + false + + + + deleted_time + Deleted Time + + 10 + false + false + + false + + + + deleted_by + Deleted By + + 255 + false + false + + false + + + + versionNo + Version No. + + INTEGER + Integer + false + 4 + + 10 + true + false + + false + + + + + + 407 + 1315 + -1 + -1 + + + + FK_from_user_to_group + + + + group_id + Group ID + + 255 + true + true + + false + + + + + + + + + + group_info + Group Information + + + + + name + Name + + 100 + false + false + + false + + + + description + Description + + 255 + false + false + + false + + + + email + Email + + 255 + false + false + + false + + + + url + URL + + 255 + false + false + + false + + + + telephone + Telephone + + 40 + false + false + + false + + + + created_time + Created Time + + 10 + true + false + + false + + + + created_by + Created By + + 255 + true + false + + false + + + + updated_time + Updated Time + + 10 + true + false + + false + + + + updated_by + Updated By + + 255 + true + false + + false + + + + deleted_time + Deleted Time + + 10 + false + false + + false + + + + deleted_by + Deleted By + + 255 + false + false + + false + + + + versionNo + Version No. + + 10 + true + false + + false + + + + + + 40 + 1835 + -1 + -1 + + + + + + FK_from_mapping_to_group + + + + + group_id + Group ID + + VARCHAR + String + true + 12 + + 255 + true + false + + false + + + + + + + + group_mapping + Group Mapping + + + + id + ID + + INTEGER + Integer + false + 4 + + 10 + true + true + + true + + + + user_id + User ID + + 255 + true + false + + false + + + + + + + 44 + 757 + -1 + -1 + + + + FK_from_mapping_to_user + + + + + + + + + + + + 2 + + + + + + + + + + + + + 2 + + + + + + + + + + + 2 + + + + + + + + + + + 2 + + + + + + + + + + 2 + + + + + + + + FK_from_user_to_role + + + + role_id + Role ID + + 255 + true + true + + false + + + + + + + + + + role_info + Role Information + + + + + name + Name + + 100 + false + false + + false + + + + description + Description + + 255 + false + false + + false + + + + email + Email + + 255 + false + false + + false + + + + url + URL + + 255 + false + false + + false + + + + telephone + Telephone + + 40 + false + false + + false + + + + created_time + Created Time + + 10 + true + false + + false + + + + created_by + Created By + + 255 + true + false + + false + + + + updated_time + Updated Time + + 10 + true + false + + false + + + + updated_by + Updated By + + 255 + true + false + + false + + + + deleted_time + Deleted Time + + 10 + false + false + + false + + + + deleted_by + Deleted By + + 255 + false + false + + false + + + + versionNo + Version No. + + 10 + true + false + + false + + + + + + 586 + 1835 + -1 + -1 + + + + + + FK_from_mapping_to_role + + + + + role_id + Role ID + + 255 + true + false + + false + + + + + + + + role_mapping + Role Mapping + + + + id + ID + + INT + Integer + false + 4 + + 10 + true + true + + true + + + + user_id + User ID + + 255 + true + false + + false + + + + + + + 594 + 757 + -1 + -1 + + + + FK_from_mapping_to_user + + + + + + + + + + + + 2 + + + + + + + + + + + + + 2 + + + + + + + + + + + 2 + + + + + + + + + + + 2 + + + + + + + + + + 2 + + + + + + + + + + + + FK_from_person_user_to_user + + + + + user_id + User ID + + VARCHAR + String + true + 12 + + 255 + false + false + + false + + + + + + + + person + Person + + + + id + ID + + BIGINT + Integer + true + -5 + + 19 + true + true + + true + + + + + given_name + Given Name + + 100 + false + false + + false + + + + given_name_desc + Given Name Description + + VARCHAR + String + true + 12 + + 100 + false + false + + false + + + + family_name + Family Name + + 100 + false + false + + false + + + + family_name_desc + Family Name Description + + 100 + false + false + + false + + + + middle_name + Middle Name + + 50 + false + false + + false + + + + name_prefix + Name Prefix + + 30 + false + false + + false + + + + name_suffix + Name Suffix + + 30 + false + false + + false + + + + nickname + Nickname + + 100 + false + false + + false + + + + job_title + Job Title + + 50 + false + false + + false + + + + is_public + Is Public? + + VARCHAR + String + true + 12 + + 1 + false + false + + false + 'T' + + + company_id + company_id + + BIGINT + Integer + true + -5 + + 19 + false + false + + false + + + + created_time + Created Time + + TIMESTAMP + Datetime + false + 93 + + 10 + true + false + + false + + + + created_by + Created By + + 255 + true + false + + false + + + + updated_time + Updated Time + + TIMESTAMP + Datetime + false + 93 + + 23 + true + false + + false + + + + updated_by + Updated by + + 255 + true + false + + false + + + + deleted_time + Deleted Time + + 23 + false + false + + false + + + + deleted_by + Deleted By + + 255 + false + false + + false + + + + versionNo + Version No + + INTEGER + Integer + false + 4 + + 10 + true + false + + false + 1 + + + + + 432 + 275 + -1 + -1 + + + + FK_from_person_to_company + + + + id + ID + + 19 + true + true + + true + + + + + + + + + + company + Company + + + + + user_id + User ID + + 255 + false + false + + false + + + + name + Name + + 200 + false + false + + false + + + + name_desc + Name Description + + 200 + false + false + + false + + + + department + Department + + 200 + false + false + + false + + + + building + Blg. + + 200 + false + false + + false + + + + street + Street + + 200 + false + false + + false + + + + city + City + + 100 + false + false + + false + + + + state + State + + 100 + false + false + + false + + + + postal_code + Postal Code + + 30 + false + false + + false + + + + country + Country + + 200 + false + false + + false + + + + telephone1 + Telephone 1 + + 40 + false + false + + false + + + + telephone2 + Telephone 2 + + 40 + false + false + + false + + + + fax1 + FAX 1 + + 40 + false + false + + false + + + + fax2 + FAX 2 + + 40 + false + false + + false + + + + url + URL + + 255 + false + false + + false + + + + is_public + Is Public? + + 1 + false + false + + false + 'T' + + + created_time + Created Time + + 10 + true + false + + false + + + + created_by + Created By + + 255 + true + false + + false + + + + updated_time + Updated Time + + 23 + true + false + + false + + + + updated_by + Updated by + + 255 + true + false + + false + + + + deleted_time + Deleted Time + + 23 + false + false + + false + + + + deleted_by + Deleted By + + 255 + false + false + + false + + + + versionNo + Version No. + + INTEGER + Integer + false + 4 + + 10 + true + false + + false + 1 + + + + + 305 + 757 + -1 + -1 + + + + FK_from_company_user_to_user + + + + + + + + + + + + 2 + + + + + + + + + + + + + + 2 + + + + + + + + + + 2 + + + + + + + + + + + FK_from_custom_to_person + + + + + person_id + Person ID + + BIGINT + Integer + true + -5 + + 19 + true + false + + false + + + + + + + + custom + Custom + + + + id + ID + + 19 + true + true + + true + + + + + value + Value + + VARCHAR + String + true + 12 + + 255 + false + false + + false + + + + sort_order + Sort Order + + INTEGER + Integer + false + 4 + + 255 + true + false + + false + + + + + + 181 + 40 + -1 + -1 + + + + + + + + + 2 + + + + + + + + + + + 2 + + + + + + + + FK_from_contact_to_person + + + + + person_id + Person ID + + 19 + true + false + + false + + + + + + + + contact + Contact + + + + id + ID + + 19 + true + true + + true + + + + + name + Name + + VARCHAR + String + true + 12 + + 20 + true + false + + false + + + + value + Value + + 255 + false + false + + false + + + + + + 449 + 40 + -1 + -1 + + + + + + + + + 2 + + + + + + + + + + + 2 + + + + + + + + FK_from_postal_to_person + + + + + person_id + Person ID + + 19 + true + true + + false + + + + + + + + postal + Postal + + + + + building + Blg. + + 200 + false + false + + false + + + + street + Street + + 200 + false + false + + false + + + + city + City + + 100 + false + false + + false + + + + state + State + + 100 + false + false + + false + + + + postal_code + Postal Code + + 30 + false + false + + false + + + + country + Country + + 100 + false + false + + false + + + + + + 717 + 40 + -1 + -1 + + + + + + + + + 2 + + + + + + + + + + + 2 + + + + + + + + + + + 2 + + + + + + + + + + + 2 + + + + + + + + + + + + 2 + + + + + + + + + + + + + + + + + + MySQL + false + + sun.jdbc.odbc.JdbcOdbc + + + + + + false + + + + 2 + + + + + + \ No newline at end of file Added: addresslist/trunk/src/main/config/sql/mysql/addresslist.ddl =================================================================== --- addresslist/trunk/src/main/config/sql/mysql/addresslist.ddl (rev 0) +++ addresslist/trunk/src/main/config/sql/mysql/addresslist.ddl 2008-12-15 13:44:43 UTC (rev 1610) @@ -0,0 +1,196 @@ +DROP TABLE postal; +DROP TABLE contact; +DROP TABLE custom; +DROP TABLE person; +DROP TABLE company; +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), + locale VARCHAR(5), + 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 PRIMARY KEY AUTO_INCREMENT, + 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 PRIMARY KEY AUTO_INCREMENT, + 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: Company +**********************************/ +CREATE TABLE company( + id BIGINT(19) NOT NULL PRIMARY KEY AUTO_INCREMENT, + user_id VARCHAR(255), + name VARCHAR(200), + name_desc VARCHAR(200), + department VARCHAR(200), + building VARCHAR(200), + street VARCHAR(200), + city VARCHAR(100), + state VARCHAR(100), + postal_code VARCHAR(30), + country VARCHAR(200), + telephone1 VARCHAR(40), + telephone2 VARCHAR(40), + fax1 VARCHAR(40), + fax2 VARCHAR(40), + url VARCHAR(255), + is_public VARCHAR(1) DEFAULT 'T', + 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 DEFAULT 1, + FOREIGN KEY (user_id) REFERENCES user_info (user_id) +); + +/********************************** +Table Name: Person +**********************************/ +CREATE TABLE person( + id BIGINT(19) NOT NULL PRIMARY KEY AUTO_INCREMENT, + user_id VARCHAR(255), + given_name VARCHAR(100), + given_name_desc VARCHAR(100), + family_name VARCHAR(100), + family_name_desc VARCHAR(100), + middle_name VARCHAR(50), + name_prefix VARCHAR(30), + name_suffix VARCHAR(30), + nickname VARCHAR(100), + job_title VARCHAR(50), + is_public VARCHAR(1) DEFAULT 'T', + company_id BIGINT(19), + 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 DEFAULT 1, + FOREIGN KEY (company_id) REFERENCES company (id), + FOREIGN KEY (user_id) REFERENCES user_info (user_id) +); + +/********************************** +Table Name: Custom +**********************************/ +CREATE TABLE custom( + id BIGINT(19) NOT NULL PRIMARY KEY AUTO_INCREMENT, + person_id BIGINT(19) NOT NULL, + value VARCHAR(255), + sort_order INTEGER NOT NULL, + FOREIGN KEY (person_id) REFERENCES person (id) +); + +/********************************** +Table Name: Contact +**********************************/ +CREATE TABLE contact( + id BIGINT(19) NOT NULL PRIMARY KEY AUTO_INCREMENT, + person_id BIGINT(19) NOT NULL, + name VARCHAR(20) NOT NULL, + value VARCHAR(255), + FOREIGN KEY (person_id) REFERENCES person (id) +); + +/********************************** +Table Name: Postal +**********************************/ +CREATE TABLE postal( + person_id BIGINT(19) NOT NULL PRIMARY KEY, + building VARCHAR(200), + street VARCHAR(200), + city VARCHAR(100), + state VARCHAR(100), + postal_code VARCHAR(30), + country VARCHAR(100), + FOREIGN KEY (person_id) REFERENCES person (id) +); + From svnnotify ¡÷ sourceforge.jp Mon Dec 15 22:45:46 2008 From: svnnotify ¡÷ sourceforge.jp (svnnotify ¡÷ sourceforge.jp) Date: Mon, 15 Dec 2008 22:45:46 +0900 Subject: [pal-cvs 3876] [1611] added files for mysql. Message-ID: <1229348746.931238.4056.nullmailer@users.sourceforge.jp> Revision: 1611 http://svn.sourceforge.jp/view?root=pal&view=rev&rev=1611 Author: shinsuke Date: 2008-12-15 22:45:46 +0900 (Mon, 15 Dec 2008) Log Message: ----------- added files for mysql. Added Paths: ----------- board/trunk/src/main/config/erd/mysql/ board/trunk/src/main/config/erd/mysql/board.erd board/trunk/src/main/config/sql/mysql/ board/trunk/src/main/config/sql/mysql/board.ddl -------------- next part -------------- Added: board/trunk/src/main/config/erd/mysql/board.erd =================================================================== --- board/trunk/src/main/config/erd/mysql/board.erd (rev 0) +++ board/trunk/src/main/config/erd/mysql/board.erd 2008-12-15 13:45:46 UTC (rev 1611) @@ -0,0 +1,2087 @@ + + + + + + + category + Category + + + + id + ID + + INTEGER + Integer + false + 4 + + 19 + true + true + + true + + + + name + Name + + VARCHAR + String + true + 12 + + 100 + true + false + + false + + + + sort_order + Sort Order + + INTEGER + Integer + false + 4 + + 10 + true + false + + false + 0 + + + created_time + Created Time + + TIMESTAMP + Datetime + false + 93 + + 10 + true + false + + false + + + + created_by + Created_by + + VARCHAR + String + true + 12 + + 255 + true + false + + false + + + + updated_time + Updated Time + + 10 + true + false + + false + + + + updated_by + Updated by + + 255 + true + false + + false + + + + deleted_time + Deleted Time + + 10 + false + false + + false + + + + deleted_by + Deleted by + + 255 + false + false + + false + + + + versionNo + Version No + + INTEGER + Integer + false + 4 + + 10 + true + false + + false + 0 + + + + + 452 + 890 + -1 + -1 + + + + + FK_from_category_access_to_category + + + + + category_id + Category ID + + 10 + true + false + + false + + + + + + + + category_access + Category Access + + + + id + ID + + BIGINT + Integer + true + -5 + + 20 + true + true + + true + + + + name + Role Name + + VARCHAR + String + true + 12 + + 255 + true + false + + false + + + + access_type + Access Typ + + 10 + true + false + + false + + + + + created_time + Created Time + + TIMESTAMP + Datetime + false + 93 + + 10 + true + false + + false + + + + created_by + Created by + + VARCHAR + String + true + 12 + + 255 + true + false + + false + + + + updated_time + Updated Time + + 10 + true + false + + false + + + + updated_by + Updated by + + 255 + true + false + + false + + + + versionNo + Version No. + + INT + Integer + false + 4 + + 10 + true + false + + false + 0 + + + + + 305 + 370 + -1 + -1 + + + + + + + + + 2 + + + + + + + + + + + 2 + + + + + + + + FK_from_message_to_category + + + + + category_id + Category ID + + 1 + true + false + + false + 0 + + + + + + + message + Message + + + + id + ID + + BIGINT + Integer + true + -5 + + 20 + true + true + + true + + + + display_name + Display User Name + + VARCHAR + String + true + 12 + + 100 + true + false + + false + + + + title + Title + + 200 + true + false + + false + + + + status + Status + + 1 + true + false + + false + 'E' + + + start_time + Start Time + + DATETIME + Datetime + false + 93 + + 10 + false + false + + false + + + + end_time + End Time + + 10 + false + false + + false + + + + has_reply + Has Reply? + + 1 + true + false + + false + 'T' + + + + created_time + Created Time + + TIMESTAMP + Datetime + false + 93 + + 23 + true + false + + false + + + + created_by + Created by + + 255 + true + false + + false + + + + updated_time + Updated Time + + 23 + true + false + + false + + + + updated_by + Updated by + + 255 + true + false + + false + + + + deleted_time + Deleted Time + + 10 + false + false + + false + + + + deleted_by + Deleted by + + 255 + false + false + + false + + + + versionNo + Version No. + + INTEGER + Integer + false + 4 + + 1 + true + false + + false + 0 + + + + + IDX_title_for_message + + INDEX + + + title + + + + + 586 + 370 + -1 + -1 + + + + + + + FK_from_reply_to_message + + + + + message_id + Message ID + + BIGINT + Integer + true + -5 + + 20 + true + false + + false + + + + + + + + reply + Reply + + + + id + ID + + 20 + true + true + + true + + + + display_name + Display User Name + + 100 + true + false + + false + + + + content + Content + + 4000 + false + false + + false + + + + + created_time + Created Time + + TIMESTAMP + Datetime + false + 93 + + 10 + true + false + + false + + + + created_by + Created by + + 255 + true + false + + false + + + + deleted_time + Deleted Time + + 10 + false + false + + false + + + + deleted_by + Deleted by + + 255 + false + false + + false + + + + + + 516 + 40 + -1 + -1 + + + + + + + + + 2 + + + + + + + + + + + 2 + + + + + + + + FK_from_message_attachment_to_message + + + + + message_id + Message ID + + 20 + true + false + + false + + + + + + + + message_attachment + Message Attachment + + + + id + ID + + 20 + true + true + + true + + + + memo + Memo + + 100 + false + false + + false + + + + versionable + Versionable + + 1 + true + false + + false + 'F' + + + + attachment_id + Attachment ID + + 20 + true + false + + false + + + + created_time + Created Time + + 10 + true + false + + false + + + + created_by + Created by + + 255 + true + false + + false + + + + updated_time + Updated Time + + 10 + true + false + + false + + + + updated_by + Updated by + + 255 + true + false + + false + + + + deleted_time + Deleted Time + + 10 + false + false + + false + + + + deleted_by + Deleted by + + 255 + false + false + + false + + + + versionNo + Version No. + + 10 + true + false + + false + 0 + + + + + 219 + 40 + -1 + -1 + + + + + FK_from_message_attachment_to_attachment + + + + id + ID + + 20 + true + true + + true + + + + + + + + + + attachment + Attachment + + + + + data + Data + + OTHER + Etc + false + 1111 + + + true + false + + false + + + + name + Name + + VARCHAR + String + true + 12 + + 255 + false + false + + false + + + + size + Size + + 10 + false + false + + false + + + + content_type + Content Type + + 40 + false + false + + false + + + + created_time + Created Time + + 10 + true + false + + false + + + + created_by + Created by + + 255 + true + false + + false + + + + + + 40 + 370 + -1 + -1 + + + + + + + + + 2 + + + + + + + + + + 2 + + + + + + + + + + + + 2 + + + + + + + + + + + 2 + + + + + + + + FK_from_message_content_to_message + + + + + message_id + Message ID + + BIGINT + Integer + true + -5 + + 20 + true + true + + false + + + + + + + + message_content + Message Content + + + + + content + Content + + VARCHAR + String + true + 12 + + 4000 + false + false + + false + + + + + + IDX_content_for_message_content + + INDEX + + + content + + + + + 807 + 40 + -1 + -1 + + + + + + + + + 2 + + + + + + + + + + + 2 + + + + + + + + + + + 2 + + + + + + + + + + + 2 + + + + + + + + + + + 2 + + + + + + + + + + + + + + + + user_info + User Information + + + + user_id + User ID + + VARCHAR + String + true + 12 + + 255 + true + true + + false + + + + given_name + Given Name + + VARCHAR + String + true + 12 + + 100 + false + false + + false + + + + family_name + Family Name + + 100 + false + false + + false + + + + middle_name + Middle Name + + 50 + false + false + + false + + + + given_name_desc + Given Name Descritpion + + 100 + false + false + + false + + + + family_name_desc + Family Name Description + + 100 + false + false + + false + + + + nickname + Nickname + + VARCHAR + String + true + 12 + + 100 + false + false + + false + + + + gender + Gender + + 1 + false + false + + false + + + + birth_date + Birth Date + + DATE + Date + false + 91 + + 10 + false + false + + false + + + + email + Email + + 255 + false + false + + false + + + + url + URL + + 255 + false + false + + false + + + + telephone + Telephone + + VARCHAR + String + true + 12 + + 40 + false + false + + false + + + + locale + Locale + + VARCHAR + String + true + 12 + + 5 + false + false + + false + + + + role_id + Default Role ID + + 255 + false + false + + false + + + + group_id + Default Group ID + + 255 + false + false + + false + + + + created_time + Created Time + + TIMESTAMP + Datetime + false + 93 + + 10 + true + false + + false + + + + created_by + Created By + + 255 + true + false + + false + + + + updated_time + Updated Time + + 10 + true + false + + false + + + + updated_by + Updated By + + 255 + true + false + + false + + + + deleted_time + Deleted Time + + 10 + false + false + + false + + + + deleted_by + Deleted By + + 255 + false + false + + false + + + + versionNo + Version No. + + INTEGER + Integer + false + 4 + + 10 + true + false + + false + + + + + + 1239 + 370 + -1 + -1 + + + + FK_from_user_to_group + + + + group_id + Group ID + + 255 + true + true + + false + + + + + + + + + + group_info + Group Information + + + + + name + Name + + 100 + false + false + + false + + + + description + Description + + 255 + false + false + + false + + + + email + Email + + 255 + false + false + + false + + + + url + URL + + 255 + false + false + + false + + + + telephone + Telephone + + 40 + false + false + + false + + + + created_time + Created Time + + 10 + true + false + + false + + + + created_by + Created By + + 255 + true + false + + false + + + + updated_time + Updated Time + + 10 + true + false + + false + + + + updated_by + Updated By + + 255 + true + false + + false + + + + deleted_time + Deleted Time + + 10 + false + false + + false + + + + deleted_by + Deleted By + + 255 + false + false + + false + + + + versionNo + Version No. + + 10 + true + false + + false + + + + + + 1094 + 890 + -1 + -1 + + + + + FK_from_mapping_to_group + + + + + group_id + Group ID + + VARCHAR + String + true + 12 + + 255 + true + false + + false + + + + + + + + group_mapping + Group Mapping + + + + id + ID + + INTEGER + Integer + false + 4 + + 10 + true + true + + true + + + + user_id + User ID + + 255 + true + false + + false + + + + + + + 1098 + 40 + -1 + -1 + + + + FK_from_mapping_to_user + + + + + + + + + + + + 2 + + + + + + + + + + + + + 2 + + + + + + + + + + + 2 + + + + + + + + + + + + 2 + + + + + + + + + + 2 + + + + + + + + FK_from_user_to_role + + + + role_id + Role ID + + 255 + true + true + + false + + + + + + + + + + role_info + Role Information + + + + + name + Name + + 100 + false + false + + false + + + + description + Description + + 255 + false + false + + false + + + + email + Email + + 255 + false + false + + false + + + + url + URL + + 255 + false + false + + false + + + + telephone + Telephone + + 40 + false + false + + false + + + + created_time + Created Time + + 10 + true + false + + false + + + + created_by + Created By + + 255 + true + false + + false + + + + updated_time + Updated Time + + 10 + true + false + + false + + + + updated_by + Updated By + + 255 + true + false + + false + + + + deleted_time + Deleted Time + + 10 + false + false + + false + + + + deleted_by + Deleted By + + 255 + false + false + + false + + + + versionNo + Version No. + + 10 + true + false + + false + + + + + + 1418 + 890 + -1 + -1 + + + + + FK_from_mapping_to_role + + + + + role_id + Role ID + + 255 + true + false + + false + + + + + + + + role_mapping + Role Mapping + + + + id + ID + + INT + Integer + false + 4 + + 10 + true + true + + true + + + + user_id + User ID + + 255 + true + false + + false + + + + + + + 1426 + 40 + -1 + -1 + + + + FK_from_mapping_to_user + + + + + + + + + + + + 2 + + + + + + + + + + + + + 2 + + + + + + + + + + + 2 + + + + + + + + + + + + 2 + + + + + + + + + + 2 + + + + + + + + + + + + + + + 2 + + + + + + + + + + + + + MySQL + false + + sun.jdbc.odbc.JdbcOdbc + + + + + + false + + + + 2 + + + + + + \ No newline at end of file Added: board/trunk/src/main/config/sql/mysql/board.ddl =================================================================== --- board/trunk/src/main/config/sql/mysql/board.ddl (rev 0) +++ board/trunk/src/main/config/sql/mysql/board.ddl 2008-12-15 13:45:46 UTC (rev 1611) @@ -0,0 +1,219 @@ +DROP TABLE role_mapping; +DROP TABLE group_mapping; +DROP TABLE user_info; +DROP TABLE role_info; +DROP TABLE group_info; +DROP TABLE message_content; +DROP TABLE message_attachment; +DROP TABLE reply; +DROP TABLE category_access; +DROP TABLE message; +DROP TABLE attachment; +DROP TABLE category; + +/********************************** +Table Name: Category +**********************************/ +CREATE TABLE category( + id INTEGER NOT NULL PRIMARY KEY AUTO_INCREMENT, + name VARCHAR(100) NOT NULL, + sort_order INTEGER NOT NULL DEFAULT 0, + 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 DEFAULT 0 +); + +/********************************** +Table Name: Attachment +**********************************/ +CREATE TABLE attachment( + id BIGINT(20) NOT NULL PRIMARY KEY AUTO_INCREMENT, + data MEDIUMBLOB NOT NULL, + name VARCHAR(255), + size INTEGER, + content_type VARCHAR(40), + created_time TIMESTAMP NOT NULL, + created_by VARCHAR(255) NOT NULL +); + +/********************************** +Table Name: Message +**********************************/ +CREATE TABLE message( + id BIGINT(20) NOT NULL PRIMARY KEY AUTO_INCREMENT, + display_name VARCHAR(100) NOT NULL, + title VARCHAR(200) NOT NULL, + status VARCHAR(1) NOT NULL DEFAULT 'E', + start_time DATETIME, + end_time DATETIME, + has_reply VARCHAR(1) NOT NULL DEFAULT 'T', + category_id INTEGER NOT NULL DEFAULT 0, + 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 DEFAULT 0, + FOREIGN KEY (category_id) REFERENCES category (id) +); + +/********************************** +Table Name: Category Access +**********************************/ +CREATE TABLE category_access( + id BIGINT(20) NOT NULL PRIMARY KEY AUTO_INCREMENT, + name VARCHAR(255) NOT NULL, + access_type INTEGER NOT NULL, + category_id INTEGER NOT NULL, + created_time TIMESTAMP NOT NULL, + created_by VARCHAR(255) NOT NULL, + updated_time TIMESTAMP NOT NULL, + updated_by VARCHAR(255) NOT NULL, + versionNo INT NOT NULL DEFAULT 0, + FOREIGN KEY (category_id) REFERENCES category (id) +); + +/********************************** +Table Name: Reply +**********************************/ +CREATE TABLE reply( + id BIGINT(20) NOT NULL PRIMARY KEY AUTO_INCREMENT, + display_name VARCHAR(100) NOT NULL, + content VARCHAR(4000), + message_id BIGINT(20) NOT NULL, + created_time TIMESTAMP NOT NULL, + created_by VARCHAR(255) NOT NULL, + deleted_time TIMESTAMP, + deleted_by VARCHAR(255), + FOREIGN KEY (message_id) REFERENCES message (id) +); + +/********************************** +Table Name: Message Attachment +**********************************/ +CREATE TABLE message_attachment( + id BIGINT(20) NOT NULL PRIMARY KEY AUTO_INCREMENT, + memo VARCHAR(100), + versionable VARCHAR(1) NOT NULL DEFAULT 'F', + message_id BIGINT(20) NOT NULL, + attachment_id BIGINT(20) 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 DEFAULT 0, + FOREIGN KEY (message_id) REFERENCES message (id), + FOREIGN KEY (attachment_id) REFERENCES attachment (id) +); + +/********************************** +Table Name: Message Content +**********************************/ +CREATE TABLE message_content( + message_id BIGINT(20) NOT NULL PRIMARY KEY, + content VARCHAR(4000), + FOREIGN KEY (message_id) REFERENCES message (id) +); + +/********************************** +Table Name: Group Information +**********************************/ +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), + locale VARCHAR(5), + 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 PRIMARY KEY AUTO_INCREMENT, + 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 PRIMARY KEY AUTO_INCREMENT, + 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) +); + + +CREATE INDEX IDX_title_for_message ON message (title); + +CREATE INDEX IDX_content_for_message_content ON message_content (content); + From svnnotify ¡÷ sourceforge.jp Mon Dec 15 22:46:34 2008 From: svnnotify ¡÷ sourceforge.jp (svnnotify ¡÷ sourceforge.jp) Date: Mon, 15 Dec 2008 22:46:34 +0900 Subject: [pal-cvs 3877] [1612] added files for mysql. Message-ID: <1229348794.579182.5319.nullmailer@users.sourceforge.jp> Revision: 1612 http://svn.sourceforge.jp/view?root=pal&view=rev&rev=1612 Author: shinsuke Date: 2008-12-15 22:46:34 +0900 (Mon, 15 Dec 2008) Log Message: ----------- added files for mysql. Added Paths: ----------- bookmark/trunk/src/main/config/erd/mysql/ bookmark/trunk/src/main/config/erd/mysql/bookmark.erd bookmark/trunk/src/main/config/sql/mysql/ bookmark/trunk/src/main/config/sql/mysql/bookmark.ddl -------------- next part -------------- Added: bookmark/trunk/src/main/config/erd/mysql/bookmark.erd =================================================================== --- bookmark/trunk/src/main/config/erd/mysql/bookmark.erd (rev 0) +++ bookmark/trunk/src/main/config/erd/mysql/bookmark.erd 2008-12-15 13:46:34 UTC (rev 1612) @@ -0,0 +1,1468 @@ + + + + + + + user_info + User Information + + + + user_id + User ID + + VARCHAR + String + true + 12 + + 255 + true + true + + false + + + + given_name + Given Name + + VARCHAR + String + true + 12 + + 100 + false + false + + false + + + + family_name + Family Name + + 100 + false + false + + false + + + + middle_name + Middle Name + + 50 + false + false + + false + + + + given_name_desc + Given Name Descritpion + + 100 + false + false + + false + + + + family_name_desc + Family Name Description + + 100 + false + false + + false + + + + nickname + Nickname + + VARCHAR + String + true + 12 + + 100 + false + false + + false + + + + gender + Gender + + 1 + false + false + + false + + + + birth_date + Birth Date + + DATE + Date + false + 91 + + 10 + false + false + + false + + + + email + Email + + 255 + false + false + + false + + + + url + URL + + 255 + false + false + + false + + + + telephone + Telephone + + VARCHAR + String + true + 12 + + 40 + false + false + + false + + + + locale + Locale + + VARCHAR + String + true + 12 + + 5 + false + false + + false + + + + role_id + Default Role ID + + 255 + false + false + + false + + + + group_id + Default Group ID + + 255 + false + false + + false + + + + created_time + Created Time + + TIMESTAMP + Datetime + false + 93 + + 10 + true + false + + false + + + + created_by + Created By + + 255 + true + false + + false + + + + updated_time + Updated Time + + 10 + true + false + + false + + + + updated_by + Updated By + + 255 + true + false + + false + + + + deleted_time + Deleted Time + + 10 + false + false + + false + + + + deleted_by + Deleted By + + 255 + false + false + + false + + + + versionNo + Version No. + + INTEGER + Integer + false + 4 + + 10 + true + false + + false + + + + + + 441 + 738 + -1 + -1 + + + + FK_from_user_to_group + + + + group_id + Group ID + + 255 + true + true + + false + + + + + + + + + + group_info + Group Information + + + + + name + Name + + 100 + false + false + + false + + + + description + Description + + 255 + false + false + + false + + + + email + Email + + 255 + false + false + + false + + + + url + URL + + 255 + false + false + + false + + + + telephone + Telephone + + 40 + false + false + + false + + + + created_time + Created Time + + 10 + true + false + + false + + + + created_by + Created By + + 255 + true + false + + false + + + + updated_time + Updated Time + + 10 + true + false + + false + + + + updated_by + Updated By + + 255 + true + false + + false + + + + deleted_time + Deleted Time + + 10 + false + false + + false + + + + deleted_by + Deleted By + + 255 + false + false + + false + + + + versionNo + Version No. + + 10 + true + false + + false + + + + + + 40 + 1258 + -1 + -1 + + + + + + FK_from_mapping_to_group + + + + + group_id + Group ID + + VARCHAR + String + true + 12 + + 255 + true + false + + false + + + + + + + + group_mapping + Group Mapping + + + + id + ID + + INTEGER + Integer + false + 4 + + 10 + true + true + + true + + + + user_id + User ID + + 255 + true + false + + false + + + + + + + 44 + 408 + -1 + -1 + + + + FK_from_mapping_to_user + + + + + + + + + + + + 2 + + + + + + + + + + + + + 2 + + + + + + + + + + + 2 + + + + + + + + + + + 2 + + + + + + + + + + 2 + + + + + + + + FK_from_user_to_role + + + + role_id + Role ID + + 255 + true + true + + false + + + + + + + + + + role_info + Role Information + + + + + name + Name + + 100 + false + false + + false + + + + description + Description + + 255 + false + false + + false + + + + email + Email + + 255 + false + false + + false + + + + url + URL + + 255 + false + false + + false + + + + telephone + Telephone + + 40 + false + false + + false + + + + created_time + Created Time + + 10 + true + false + + false + + + + created_by + Created By + + 255 + true + false + + false + + + + updated_time + Updated Time + + 10 + true + false + + false + + + + updated_by + Updated By + + 255 + true + false + + false + + + + deleted_time + Deleted Time + + 10 + false + false + + false + + + + deleted_by + Deleted By + + 255 + false + false + + false + + + + versionNo + Version No. + + 10 + true + false + + false + + + + + + 620 + 1258 + -1 + -1 + + + + + + FK_from_mapping_to_role + + + + + role_id + Role ID + + 255 + true + false + + false + + + + + + + + role_mapping + Role Mapping + + + + id + ID + + INT + Integer + false + 4 + + 10 + true + true + + true + + + + user_id + User ID + + 255 + true + false + + false + + + + + + + 628 + 408 + -1 + -1 + + + + FK_from_mapping_to_user + + + + + + + + + + + + 2 + + + + + + + + + + + + + 2 + + + + + + + + + + + 2 + + + + + + + + + + + 2 + + + + + + + + + + 2 + + + + + + + + + + + + FK_from_link_create_to_user + + + + + created_by + Created by + + VARCHAR + String + true + 12 + + 255 + true + false + + false + + + + + + + + bookmark_link + Bookmark Link + + + + id + ID + + BIGINT + Integer + true + -5 + + 20 + true + true + + true + + + + name + Name + + VARCHAR + String + true + 12 + + 100 + true + false + + false + + + + memo + Memo + + 200 + false + false + + false + + + + url + URL + + 255 + true + false + + false + 'E' + + + type + Type + + 1 + true + false + + false + + + + sort_order + Sort Order + + INTEGER + Integer + false + 4 + + 10 + true + false + + false + 0 + + + category_id + Category ID + + 1 + false + false + + false + 0 + + + created_time + Created Time + + TIMESTAMP + Datetime + false + 93 + + 23 + true + false + + false + + + + + updated_time + Updated Time + + 23 + true + false + + false + + + + updated_by + Updated by + + 255 + true + false + + false + + + + deleted_time + Deleted Time + + 10 + false + false + + false + + + + deleted_by + Deleted by + + 255 + false + false + + false + + + + versionNo + Version No. + + INTEGER + Integer + false + 4 + + 1 + true + false + + false + 0 + + + + + IDX_created_by_and_category_id_for_link + + INDEX + + + created_by + category_id + + + + + 456 + 40 + -1 + -1 + + + + FK_from_link_to_category + + + + id + ID + + INTEGER + Integer + false + 4 + + 19 + true + true + + true + + + + + + + + + + bookmark_category + Bookmark Category + + + + + name + Name + + 100 + true + false + + false + + + + memo + Memo + + 200 + false + false + + false + + + + type + Type + + VARCHAR + String + true + 12 + + 1 + true + false + + false + 'P' + + + sort_order + Sort Order + + INTEGER + Integer + false + 4 + + 10 + true + false + + false + 0 + + + created_time + Created Time + + TIMESTAMP + Datetime + false + 93 + + 10 + true + false + + false + + + + created_by + Created_by + + VARCHAR + String + true + 12 + + 255 + true + false + + false + + + + updated_time + Updated Time + + 10 + true + false + + false + + + + updated_by + Updated by + + 255 + true + false + + false + + + + deleted_time + Deleted Time + + 10 + false + false + + false + + + + deleted_by + Deleted by + + 255 + false + false + + false + + + + versionNo + Version No + + INTEGER + Integer + false + 4 + + 10 + true + false + + false + 0 + + + + + IDX_created_by_for_bookmark_category + + + created_by + + + + + 305 + 408 + -1 + -1 + + + + FK_from_bookmark_category_create_to_user + + + + + + + + + + + + 2 + + + + + + + + FK_from_bookmark_category_update_to_user + + + + + + + + + + + + 2 + + + + + + + + + + + + + + 2 + + + + + + + + + + 2 + + + + + + + + + FK_from_link_update_to_user + + + + + + + + + + + + 2 + + + + + + + + + + + + 2 + + + + + + + + + + + 2 + + + + + + + + + + + + + + 2 + + + + + + + + + + + + + + + MySQL + false + + sun.jdbc.odbc.JdbcOdbc + + + + + + false + + + + 2 + + + + + + \ No newline at end of file Added: bookmark/trunk/src/main/config/sql/mysql/bookmark.ddl =================================================================== --- bookmark/trunk/src/main/config/sql/mysql/bookmark.ddl (rev 0) +++ bookmark/trunk/src/main/config/sql/mysql/bookmark.ddl 2008-12-15 13:46:34 UTC (rev 1612) @@ -0,0 +1,146 @@ +DROP TABLE bookmark_link; +DROP TABLE bookmark_category; +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), + locale VARCHAR(5), + 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 PRIMARY KEY AUTO_INCREMENT, + 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 PRIMARY KEY AUTO_INCREMENT, + 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: Bookmark Category +**********************************/ +CREATE TABLE bookmark_category( + id INTEGER NOT NULL PRIMARY KEY AUTO_INCREMENT, + name VARCHAR(100) NOT NULL, + memo VARCHAR(200), + type VARCHAR(1) NOT NULL DEFAULT 'P', + sort_order INTEGER NOT NULL DEFAULT 0, + 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 DEFAULT 0, + FOREIGN KEY (created_by) REFERENCES user_info (user_id), + FOREIGN KEY (updated_by) REFERENCES user_info (user_id) +); + +/********************************** +Table Name: Bookmark Link +**********************************/ +CREATE TABLE bookmark_link( + id BIGINT(20) NOT NULL PRIMARY KEY AUTO_INCREMENT, + name VARCHAR(100) NOT NULL, + memo VARCHAR(200), + url VARCHAR(255) NOT NULL DEFAULT 'E', + type VARCHAR(1) NOT NULL, + sort_order INTEGER NOT NULL DEFAULT 0, + category_id INTEGER DEFAULT 0, + 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 DEFAULT 0, + FOREIGN KEY (category_id) REFERENCES bookmark_category (id), + FOREIGN KEY (created_by) REFERENCES user_info (user_id), + FOREIGN KEY (updated_by) REFERENCES user_info (user_id) +); + + +CREATE INDEX IDX_created_by_for_bookmark_category ON bookmark_category (created_by); + +CREATE INDEX IDX_created_by_and_category_id_for_link ON bookmark_link (created_by, category_id); + From svnnotify ¡÷ sourceforge.jp Mon Dec 15 22:47:26 2008 From: svnnotify ¡÷ sourceforge.jp (svnnotify ¡÷ sourceforge.jp) Date: Mon, 15 Dec 2008 22:47:26 +0900 Subject: [pal-cvs 3878] [1613] added files for mysql. Message-ID: <1229348846.168511.6414.nullmailer@users.sourceforge.jp> Revision: 1613 http://svn.sourceforge.jp/view?root=pal&view=rev&rev=1613 Author: shinsuke Date: 2008-12-15 22:47:26 +0900 (Mon, 15 Dec 2008) Log Message: ----------- added files for mysql. Added Paths: ----------- notepad/trunk/src/main/config/erd/mysql/ notepad/trunk/src/main/config/erd/mysql/notepad.erd notepad/trunk/src/main/config/sql/mysql/ notepad/trunk/src/main/config/sql/mysql/notepad.ddl -------------- next part -------------- Added: notepad/trunk/src/main/config/erd/mysql/notepad.erd =================================================================== --- notepad/trunk/src/main/config/erd/mysql/notepad.erd (rev 0) +++ notepad/trunk/src/main/config/erd/mysql/notepad.erd 2008-12-15 13:47:26 UTC (rev 1613) @@ -0,0 +1,1501 @@ + + + + + + + user_info + User Information + + + + user_id + User ID + + VARCHAR + String + true + 12 + + 255 + true + true + + false + + + + given_name + Given Name + + VARCHAR + String + true + 12 + + 100 + false + false + + false + + + + family_name + Family Name + + 100 + false + false + + false + + + + middle_name + Middle Name + + 50 + false + false + + false + + + + given_name_desc + Given Name Descritpion + + 100 + false + false + + false + + + + family_name_desc + Family Name Description + + 100 + false + false + + false + + + + nickname + Nickname + + VARCHAR + String + true + 12 + + 100 + false + false + + false + + + + gender + Gender + + 1 + false + false + + false + + + + birth_date + Birth Date + + DATE + Date + false + 91 + + 10 + false + false + + false + + + + email + Email + + 255 + false + false + + false + + + + url + URL + + 255 + false + false + + false + + + + telephone + Telephone + + VARCHAR + String + true + 12 + + 40 + false + false + + false + + + + locale + Locale + + VARCHAR + String + true + 12 + + 5 + false + false + + false + + + + role_id + Default Role ID + + 255 + false + false + + false + + + + group_id + Default Group ID + + 255 + false + false + + false + + + + created_time + Created Time + + TIMESTAMP + Datetime + false + 93 + + 10 + true + false + + false + + + + created_by + Created By + + 255 + true + false + + false + + + + updated_time + Updated Time + + 10 + true + false + + false + + + + updated_by + Updated By + + 255 + true + false + + false + + + + deleted_time + Deleted Time + + 10 + false + false + + false + + + + deleted_by + Deleted By + + 255 + false + false + + false + + + + versionNo + Version No. + + INTEGER + Integer + false + 4 + + 10 + true + false + + false + + + + + + 441 + 802 + -1 + -1 + + + + FK_from_user_to_group + + + + group_id + Group ID + + 255 + true + true + + false + + + + + + + + + + group_info + Group Information + + + + + name + Name + + 100 + false + false + + false + + + + description + Description + + 255 + false + false + + false + + + + email + Email + + 255 + false + false + + false + + + + url + URL + + 255 + false + false + + false + + + + telephone + Telephone + + 40 + false + false + + false + + + + created_time + Created Time + + 10 + true + false + + false + + + + created_by + Created By + + 255 + true + false + + false + + + + updated_time + Updated Time + + 10 + true + false + + false + + + + updated_by + Updated By + + 255 + true + false + + false + + + + deleted_time + Deleted Time + + 10 + false + false + + false + + + + deleted_by + Deleted By + + 255 + false + false + + false + + + + versionNo + Version No. + + 10 + true + false + + false + + + + + + 40 + 1322 + -1 + -1 + + + + + + FK_from_mapping_to_group + + + + + group_id + Group ID + + VARCHAR + String + true + 12 + + 255 + true + false + + false + + + + + + + + group_mapping + Group Mapping + + + + id + ID + + INTEGER + Integer + false + 4 + + 10 + true + true + + true + + + + user_id + User ID + + 255 + true + false + + false + + + + + + + 44 + 491 + -1 + -1 + + + + FK_from_mapping_to_user + + + + + + + + + + + + 2 + + + + + + + + + + + + + 2 + + + + + + + + + + + 2 + + + + + + + + + + + 2 + + + + + + + + + + 2 + + + + + + + + FK_from_user_to_role + + + + role_id + Role ID + + 255 + true + true + + false + + + + + + + + + + role_info + Role Information + + + + + name + Name + + 100 + false + false + + false + + + + description + Description + + 255 + false + false + + false + + + + email + Email + + 255 + false + false + + false + + + + url + URL + + 255 + false + false + + false + + + + telephone + Telephone + + 40 + false + false + + false + + + + created_time + Created Time + + 10 + true + false + + false + + + + created_by + Created By + + 255 + true + false + + false + + + + updated_time + Updated Time + + 10 + true + false + + false + + + + updated_by + Updated By + + 255 + true + false + + false + + + + deleted_time + Deleted Time + + 10 + false + false + + false + + + + deleted_by + Deleted By + + 255 + false + false + + false + + + + versionNo + Version No. + + 10 + true + false + + false + + + + + + 620 + 1322 + -1 + -1 + + + + + + FK_from_mapping_to_role + + + + + role_id + Role ID + + 255 + true + false + + false + + + + + + + + role_mapping + Role Mapping + + + + id + ID + + INT + Integer + false + 4 + + 10 + true + true + + true + + + + user_id + User ID + + 255 + true + false + + false + + + + + + + 628 + 491 + -1 + -1 + + + + FK_from_mapping_to_user + + + + + + + + + + + + 2 + + + + + + + + + + + + + 2 + + + + + + + + + + + 2 + + + + + + + + + + + 2 + + + + + + + + + + 2 + + + + + + + + + + + + FK_from_notepad_createdby_to_user + + + + + created_by + Created by + + VARCHAR + String + true + 12 + + 255 + true + false + + false + + + + + + + + notepad + Notepad + + + + id + ID + + BIGINT + Integer + true + -5 + + 20 + true + true + + true + + + + title + Title + + VARCHAR + String + true + 12 + + 100 + true + false + + false + + + + sort_order + Sort Order + + INTEGER + Integer + false + 4 + + 10 + true + false + + false + 0 + + + category_id + Category ID + + 1 + false + false + + false + 0 + + + created_time + Created Time + + TIMESTAMP + Datetime + false + 93 + + 23 + true + false + + false + + + + + updated_time + Updated Time + + 23 + true + false + + false + + + + updated_by + Updated by + + 255 + true + false + + false + + + + deleted_time + Deleted Time + + 10 + false + false + + false + + + + deleted_by + Deleted by + + 255 + false + false + + false + + + + versionNo + Version No. + + INTEGER + Integer + false + 4 + + 1 + true + false + + false + 0 + + + + + IDX_created_by_and_category_id_for_notepad + + INDEX + + + created_by + category_id + + + + + 456 + 180 + -1 + -1 + + + + FK_from_notepad_to_category + + + + id + ID + + INTEGER + Integer + false + 4 + + 19 + true + true + + true + + + + + + + + + + notepad_category + Notepad Category + + + + + name + Name + + 100 + true + false + + false + + + + type + Type + + VARCHAR + String + true + 12 + + 1 + true + false + + false + 'P' + + + sort_order + Sort Order + + INTEGER + Integer + false + 4 + + 10 + true + false + + false + 0 + + + created_time + Created Time + + TIMESTAMP + Datetime + false + 93 + + 10 + true + false + + false + + + + created_by + Created_by + + VARCHAR + String + true + 12 + + 255 + true + false + + false + + + + updated_time + Updated Time + + 10 + true + false + + false + + + + updated_by + Updated by + + 255 + true + false + + false + + + + deleted_time + Deleted Time + + 10 + false + false + + false + + + + deleted_by + Deleted by + + 255 + false + false + + false + + + + versionNo + Version No + + INTEGER + Integer + false + 4 + + 10 + true + false + + false + 0 + + + + + IDX_created_by_for_notepad_category + + + created_by + + + + + 305 + 491 + -1 + -1 + + + + FK_from_notepad_category_createdby_to_user + + + + + + + + + + + + 2 + + + + + + + + FK_from_notepad_category_updatedby_to_user + + + + + + + + + + + + 2 + + + + + + + + + + + + + + 2 + + + + + + + + + + 2 + + + + + + + + + FK_from_notepad_updatedby_to_user + + + + + + + + + + + + 2 + + + + + + + + + + FK_from_notepad_content_to_user + + + + + id + ID + + BIGINT + Integer + true + -5 + + 20 + true + true + + false + + + + + + + + notepad_content + Notepad Content + + + + + content + Content + + 4000 + false + false + + false + + + + + + 478 + 40 + -1 + -1 + + + + + + + + + 2 + + + + + + + + + + + 2 + + + + + + + + + + + 2 + + + + + + + + + + + 2 + + + + + + + + + + + + + + 2 + + + + + + + + + + + + + + + + MySQL + false + + sun.jdbc.odbc.JdbcOdbc + + + + + + false + + + + 2 + + + + + + \ No newline at end of file Added: notepad/trunk/src/main/config/sql/mysql/notepad.ddl =================================================================== --- notepad/trunk/src/main/config/sql/mysql/notepad.ddl (rev 0) +++ notepad/trunk/src/main/config/sql/mysql/notepad.ddl 2008-12-15 13:47:26 UTC (rev 1613) @@ -0,0 +1,152 @@ +DROP TABLE notepad_content; +DROP TABLE notepad; +DROP TABLE notepad_category; +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), + locale VARCHAR(5), + 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 PRIMARY KEY AUTO_INCREMENT, + 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 PRIMARY KEY AUTO_INCREMENT, + 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: Notepad Category +**********************************/ +CREATE TABLE notepad_category( + id INTEGER NOT NULL PRIMARY KEY AUTO_INCREMENT, + name VARCHAR(100) NOT NULL, + type VARCHAR(1) NOT NULL DEFAULT 'P', + sort_order INTEGER NOT NULL DEFAULT 0, + 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 DEFAULT 0, + FOREIGN KEY (created_by) REFERENCES user_info (user_id), + FOREIGN KEY (updated_by) REFERENCES user_info (user_id) +); + +/********************************** +Table Name: Notepad +**********************************/ +CREATE TABLE notepad( + id BIGINT(20) NOT NULL PRIMARY KEY AUTO_INCREMENT, + title VARCHAR(100) NOT NULL, + sort_order INTEGER NOT NULL DEFAULT 0, + category_id INTEGER DEFAULT 0, + 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 DEFAULT 0, + FOREIGN KEY (category_id) REFERENCES notepad_category (id), + FOREIGN KEY (created_by) REFERENCES user_info (user_id), + FOREIGN KEY (updated_by) REFERENCES user_info (user_id) +); + +/********************************** +Table Name: Notepad Content +**********************************/ +CREATE TABLE notepad_content( + id BIGINT(20) NOT NULL PRIMARY KEY, + content VARCHAR(4000), + FOREIGN KEY (id) REFERENCES notepad (id) +); + + +CREATE INDEX IDX_created_by_for_notepad_category ON notepad_category (created_by); + +CREATE INDEX IDX_created_by_and_category_id_for_notepad ON notepad (created_by, category_id); + From svnnotify ¡÷ sourceforge.jp Mon Dec 15 22:48:00 2008 From: svnnotify ¡÷ sourceforge.jp (svnnotify ¡÷ sourceforge.jp) Date: Mon, 15 Dec 2008 22:48:00 +0900 Subject: [pal-cvs 3879] [1614] added files for mysql. Message-ID: <1229348880.852239.7134.nullmailer@users.sourceforge.jp> Revision: 1614 http://svn.sourceforge.jp/view?root=pal&view=rev&rev=1614 Author: shinsuke Date: 2008-12-15 22:48:00 +0900 (Mon, 15 Dec 2008) Log Message: ----------- added files for mysql. Added Paths: ----------- scheduler/trunk/src/main/config/erd/mysql/ scheduler/trunk/src/main/config/erd/mysql/scheduler.erd scheduler/trunk/src/main/config/sql/mysql/ scheduler/trunk/src/main/config/sql/mysql/scheduler.ddl -------------- next part -------------- Added: scheduler/trunk/src/main/config/erd/mysql/scheduler.erd =================================================================== --- scheduler/trunk/src/main/config/erd/mysql/scheduler.erd (rev 0) +++ scheduler/trunk/src/main/config/erd/mysql/scheduler.erd 2008-12-15 13:48:00 UTC (rev 1614) @@ -0,0 +1,1867 @@ + + + + + + + user_info + User Information + + + + user_id + User ID + + VARCHAR + String + true + 12 + + 255 + true + true + + false + + + + given_name + Given Name + + VARCHAR + String + true + 12 + + 100 + false + false + + false + + + + family_name + Family Name + + 100 + false + false + + false + + + + middle_name + Middle Name + + 50 + false + false + + false + + + + given_name_desc + Given Name Descritpion + + 100 + false + false + + false + + + + family_name_desc + Family Name Description + + 100 + false + false + + false + + + + nickname + Nickname + + VARCHAR + String + true + 12 + + 100 + false + false + + false + + + + gender + Gender + + 1 + false + false + + false + + + + birth_date + Birth Date + + DATE + Date + false + 91 + + 10 + false + false + + false + + + + email + Email + + 255 + false + false + + false + + + + url + URL + + 255 + false + false + + false + + + + telephone + Telephone + + VARCHAR + String + true + 12 + + 40 + false + false + + false + + + + locale + Locale + + VARCHAR + String + true + 12 + + 5 + false + false + + false + + + + role_id + Default Role ID + + 255 + false + false + + false + + + + group_id + Default Group ID + + 255 + false + false + + false + + + + created_time + Created Time + + TIMESTAMP + Datetime + false + 93 + + 10 + true + false + + false + + + + created_by + Created By + + 255 + true + false + + false + + + + updated_time + Updated Time + + 10 + true + false + + false + + + + updated_by + Updated By + + 255 + true + false + + false + + + + deleted_time + Deleted Time + + 10 + false + false + + false + + + + deleted_by + Deleted By + + 255 + false + false + + false + + + + versionNo + Version No. + + INTEGER + Integer + false + 4 + + 10 + true + false + + false + + + + + + 185 + 199 + -1 + -1 + + + + FK_from_user_to_group + + + + group_id + Group ID + + 255 + true + true + + false + + + + + + + + + + group_info + Group Information + + + + + name + Name + + 100 + false + false + + false + + + + description + Description + + 255 + false + false + + false + + + + email + Email + + 255 + false + false + + false + + + + url + URL + + 255 + false + false + + false + + + + telephone + Telephone + + 40 + false + false + + false + + + + created_time + Created Time + + 10 + true + false + + false + + + + created_by + Created By + + 255 + true + false + + false + + + + updated_time + Updated Time + + 10 + true + false + + false + + + + updated_by + Updated By + + 255 + true + false + + false + + + + deleted_time + Deleted Time + + 10 + false + false + + false + + + + deleted_by + Deleted By + + 255 + false + false + + false + + + + versionNo + Version No. + + 10 + true + false + + false + + + + + + 40 + 719 + -1 + -1 + + + + + + FK_from_mapping_to_group + + + + + group_id + Group ID + + VARCHAR + String + true + 12 + + 255 + true + false + + false + + + + + + + + group_mapping + Group Mapping + + + + id + ID + + INTEGER + Integer + false + 4 + + 10 + true + true + + true + + + + user_id + User ID + + 255 + true + false + + false + + + + + + + 44 + 40 + -1 + -1 + + + + FK_from_mapping_to_user + + + + + + + + + + + + 2 + + + + + + + + + + + + + 2 + + + + + + + + + + + 2 + + + + + + + + + + + 2 + + + + + + + + + + 2 + + + + + + + + FK_from_user_to_role + + + + role_id + Role ID + + 255 + true + true + + false + + + + + + + + + + role_info + Role Information + + + + + name + Name + + 100 + false + false + + false + + + + description + Description + + 255 + false + false + + false + + + + email + Email + + 255 + false + false + + false + + + + url + URL + + 255 + false + false + + false + + + + telephone + Telephone + + 40 + false + false + + false + + + + created_time + Created Time + + 10 + true + false + + false + + + + created_by + Created By + + 255 + true + false + + false + + + + updated_time + Updated Time + + 10 + true + false + + false + + + + updated_by + Updated By + + 255 + true + false + + false + + + + deleted_time + Deleted Time + + 10 + false + false + + false + + + + deleted_by + Deleted By + + 255 + false + false + + false + + + + versionNo + Version No. + + 10 + true + false + + false + + + + + + 364 + 719 + -1 + -1 + + + + + + FK_from_mapping_to_role + + + + + role_id + Role ID + + 255 + true + false + + false + + + + + + + + role_mapping + Role Mapping + + + + id + ID + + INT + Integer + false + 4 + + 10 + true + true + + true + + + + user_id + User ID + + 255 + true + false + + false + + + + + + + 305 + 40 + -1 + -1 + + + + FK_from_mapping_to_user + + + + + + + + + + + + 2 + + + + + + + + + + + + + 2 + + + + + + + + + + + 2 + + + + + + + + + + + 2 + + + + + + + + + + 2 + + + + + + + + + + + + FK_from_schedule_mapping_to_user + + + + + user_id + User ID + + VARCHAR + String + true + 12 + + 255 + true + false + + false + + + + + + + + event_schedule_mapping + Event Schedule Mapping + + + + id + ID + + BIGINT + Integer + true + -5 + + 20 + true + true + + true + + + + schedule_id + Schedule ID + + 20 + true + false + + false + + + + + + + 557 + 40 + -1 + -1 + + + + + FK_from_routine_schedule_mapping_to_schedule + + + + id + ID + + BIGINT + Integer + true + -5 + + 20 + true + true + + true + + + + + + + + + + event_schedule + Event Schedule + + + + + title + Title + + 100 + true + false + + false + + + + location + Location + + 100 + false + false + + false + + + + start_date + Start Date + + DATE + Date + false + 91 + + 10 + true + false + + false + + + + start_time + Start Time + + TIME + Time + false + 92 + + 10 + false + false + + false + + + + end_date + End Date + + 10 + false + false + + false + + + + end_time + End Time + + 10 + false + false + + false + + + + secret + Secret + + VARCHAR + String + true + 12 + + 1 + true + false + + false + 'F' + + + type + Type + + 10 + true + false + + false + + + + created_time + Created Time + + TIMESTAMP + Datetime + false + 93 + + 10 + true + false + + false + + + + created_by + Created By + + 255 + true + false + + false + + + + updated_time + Updated Time + + 10 + true + false + + false + + + + updated_by + Updated By + + 255 + true + false + + false + + + + deleted_time + Deleted Time + + 10 + false + false + + false + + + + deleted_by + Deleted By + + 255 + false + false + + false + + + + versionNo + Version No. + + INTEGER + Integer + false + 4 + + 10 + true + false + + false + + + + + + 1091 + 199 + -1 + -1 + + + + + + FK_from_content_to_schedule + + + + + id + ID + + 20 + true + true + + false + + + + + + + + event_schedule_content + Event Schedule Content + + + + + content + Content + + 1000 + false + false + + false + + + + + + 1332 + 40 + -1 + -1 + + + + + + + + + 2 + + + + + + + + + + + 2 + + + + + + + + FK_from_facility_mapping_to_schedule + + + + + schedule_id + Schedule ID + + BIGINT + Integer + true + -5 + + 20 + true + false + + false + + + + + + + + facility_schedule_mapping + Facility Schedule Mapping + + + + id + ID + + 20 + true + true + + true + + + + + facility_id + Facility ID + + INTEGER + Integer + false + 4 + + 255 + true + false + + false + + + + + + 1076 + 40 + -1 + -1 + + + + + FK_from_facility_mapping_to_facility + + + + id + ID + + INTEGER + Integer + false + 4 + + 20 + true + true + + true + + + + + + + + + + facility + Facility + + + + + name + Name + + VARCHAR + String + true + 12 + + 100 + true + false + + false + + + + sort_order + Sort Order + + INTEGER + Integer + false + 4 + + 100 + true + false + + false + 1 + + + group_id + Group ID + + 10 + true + false + + false + + + + created_time + Created Time + + 10 + true + false + + false + + + + created_by + Created By + + 255 + true + false + + false + + + + updated_time + Updated Time + + 10 + true + false + + false + + + + updated_by + Updated By + + 255 + true + false + + false + + + + deleted_time + Deleted Time + + 10 + false + false + + false + + + + deleted_by + Deleted By + + 255 + false + false + + false + + + + versionNo + Version No. + + 10 + true + false + + false + 0 + + + + + 823 + 199 + -1 + -1 + + + + FK_from_facility_to_group + + + + id + ID + + 20 + true + true + + true + + + + + + + + + + facility_group + Facility Group + + + + + name + Name + + 100 + true + false + + false + + + + sort_order + Sort Order + + 100 + true + false + + false + 1 + + + created_time + Created Time + + 10 + true + false + + false + + + + created_by + Created By + + 255 + true + false + + false + + + + updated_time + Updated Time + + 10 + true + false + + false + + + + updated_by + Updated By + + 255 + true + false + + false + + + + deleted_time + Deleted Time + + 10 + false + false + + false + + + + deleted_by + Deleted By + + 255 + false + false + + false + + + + versionNo + Version No. + + 10 + true + false + + false + 0 + + + + + 823 + 719 + -1 + -1 + + + + + + + + + 2 + + + + + + + + + + 2 + + + + + + + + + + FK_from_content_to_facility + + + + + id + ID + + 10 + true + true + + false + + + + + + + + facility_content + Facility Content + + + + + content + Content + + 1000 + false + false + + false + + + + + + 839 + 40 + -1 + -1 + + + + + + + + + 2 + + + + + + + + + + + 2 + + + + + + + + + + + + 2 + + + + + + + + + + 2 + + + + + + + + + + + + 2 + + + + + + + + + + + 2 + + + + + + + + + + + 2 + + + + + + + + + + 2 + + + + + + + + + + + + 2 + + + + + + + + + + + 2 + + + + + + + + + + + 2 + + + + + + + + + + + + + + + + + + + + MySQL + false + + sun.jdbc.odbc.JdbcOdbc + + + + + + false + + + + 2 + + + + + + \ No newline at end of file Added: scheduler/trunk/src/main/config/sql/mysql/scheduler.ddl =================================================================== --- scheduler/trunk/src/main/config/sql/mysql/scheduler.ddl (rev 0) +++ scheduler/trunk/src/main/config/sql/mysql/scheduler.ddl 2008-12-15 13:48:00 UTC (rev 1614) @@ -0,0 +1,199 @@ +DROP TABLE facility_schedule_mapping; +DROP TABLE facility_content; +DROP TABLE facility; +DROP TABLE facility_group; +DROP TABLE event_schedule_content; +DROP TABLE event_schedule_mapping; +DROP TABLE event_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), + locale VARCHAR(5), + 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 PRIMARY KEY AUTO_INCREMENT, + 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 PRIMARY KEY AUTO_INCREMENT, + 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: Event Schedule +**********************************/ +CREATE TABLE event_schedule( + id BIGINT(20) NOT NULL PRIMARY KEY AUTO_INCREMENT, + title VARCHAR(100) NOT NULL, + location VARCHAR(100), + start_date DATE NOT NULL, + start_time TIME, + end_date DATE, + end_time TIME, + secret VARCHAR(1) NOT NULL DEFAULT 'F', + 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: Event Schedule Mapping +**********************************/ +CREATE TABLE event_schedule_mapping( + id BIGINT(20) NOT NULL PRIMARY KEY AUTO_INCREMENT, + 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 event_schedule (id) +); + +/********************************** +Table Name: Event Schedule Content +**********************************/ +CREATE TABLE event_schedule_content( + id BIGINT(20) NOT NULL PRIMARY KEY, + content VARCHAR(1000), + FOREIGN KEY (id) REFERENCES event_schedule (id) +); + +/********************************** +Table Name: Facility Group +**********************************/ +CREATE TABLE facility_group( + id INTEGER NOT NULL PRIMARY KEY AUTO_INCREMENT, + name VARCHAR(100) NOT NULL, + sort_order INTEGER NOT NULL DEFAULT 1, + 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 DEFAULT 0 +); + +/********************************** +Table Name: Facility +**********************************/ +CREATE TABLE facility( + id INTEGER NOT NULL PRIMARY KEY AUTO_INCREMENT, + name VARCHAR(100) NOT NULL, + sort_order INTEGER NOT NULL DEFAULT 1, + group_id INTEGER 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 DEFAULT 0, + FOREIGN KEY (group_id) REFERENCES facility_group (id) +); + +/********************************** +Table Name: Facility Content +**********************************/ +CREATE TABLE facility_content( + id INTEGER NOT NULL PRIMARY KEY, + content VARCHAR(1000), + FOREIGN KEY (id) REFERENCES facility (id) +); + +/********************************** +Table Name: Facility Schedule Mapping +**********************************/ +CREATE TABLE facility_schedule_mapping( + id BIGINT(20) NOT NULL PRIMARY KEY AUTO_INCREMENT, + schedule_id BIGINT(20) NOT NULL, + facility_id INTEGER NOT NULL, + FOREIGN KEY (schedule_id) REFERENCES event_schedule (id), + FOREIGN KEY (facility_id) REFERENCES facility (id) +); + From svnnotify ¡÷ sourceforge.jp Mon Dec 15 22:48:37 2008 From: svnnotify ¡÷ sourceforge.jp (svnnotify ¡÷ sourceforge.jp) Date: Mon, 15 Dec 2008 22:48:37 +0900 Subject: [pal-cvs 3880] [1615] added files for mysql. Message-ID: <1229348917.817871.8234.nullmailer@users.sourceforge.jp> Revision: 1615 http://svn.sourceforge.jp/view?root=pal&view=rev&rev=1615 Author: shinsuke Date: 2008-12-15 22:48:37 +0900 (Mon, 15 Dec 2008) Log Message: ----------- added files for mysql. Modified Paths: -------------- timecard/trunk/src/main/config/erd/mysql/timecard.erd timecard/trunk/src/main/config/sql/mysql/timecard.ddl -------------- next part -------------- Modified: timecard/trunk/src/main/config/erd/mysql/timecard.erd =================================================================== --- timecard/trunk/src/main/config/erd/mysql/timecard.erd 2008-12-15 13:48:00 UTC (rev 1614) +++ timecard/trunk/src/main/config/erd/mysql/timecard.erd 2008-12-15 13:48:37 UTC (rev 1615) @@ -68,8 +68,8 @@ 1 - working_days - Working Days + std_working_days + Standard Working Days DOUBLE Real @@ -84,39 +84,6 @@ 0 - std_working_days - Standard Working Days - - 10 - true - false - - false - 0 - - - holidays - Holidays - - 10 - true - false - - false - 0 - - - paid_holidays - Paid Holidays - - 10 - true - false - - false - 0 - - working_time Working Time @@ -135,7 +102,7 @@ std_working_time Standard Working Time - + 20 true false @@ -162,7 +129,7 @@ mnt_over_time Midnight Overtime Hours - + 20 true false @@ -216,7 +183,7 @@ updated_time Updated Time - + 10 true false @@ -227,7 +194,7 @@ updated_by Updated By - + 255 true false @@ -238,7 +205,7 @@ deleted_time Deleted Time - + 10 false false @@ -249,7 +216,7 @@ deleted_by Deleted By - + 255 false false @@ -271,8 +238,8 @@ - 48 - 465 + 319 + 484 -1 -1 @@ -297,7 +264,7 @@ true - + @@ -337,17 +304,6 @@ - paid_holidays - Paid Holidays - - 200 - true - false - - false - 0 - - is_available Is available @@ -393,7 +349,7 @@ updated_time Updated Time - + 10 true false @@ -404,7 +360,7 @@ updated_by Updated by - + 255 true false @@ -415,7 +371,7 @@ deleted_time Deleted Time - + 10 false false @@ -426,7 +382,7 @@ deleted_by Deleted by - + 255 false false @@ -448,8 +404,8 @@ - 500 - 537 + 331 + 909 -1 -1 @@ -547,6 +503,49 @@ + nickname + Nickname + + VARCHAR + String + true + 12 + + 100 + false + false + + false + + + + gender + Gender + + 1 + false + false + + false + + + + birth_date + Birth Date + + DATE + Date + false + 91 + + 10 + false + false + + false + + + email Email @@ -585,6 +584,22 @@ + locale + Locale + + VARCHAR + String + true + 12 + + 5 + false + false + + false + + + role_id Default Role ID @@ -636,7 +651,7 @@ updated_time Updated Time - + 10 true false @@ -658,7 +673,7 @@ deleted_time Deleted Time - + 10 false false @@ -696,8 +711,8 @@ - 507 - 106 + 315 + 1220 -1 -1 @@ -717,7 +732,7 @@ false - + @@ -787,7 +802,7 @@ created_time Created Time - + 10 true false @@ -809,7 +824,7 @@ updated_time Updated Time - + 10 true false @@ -831,7 +846,7 @@ deleted_time Deleted Time - + 10 false false @@ -853,7 +868,7 @@ versionNo Version No. - + 10 true false @@ -864,14 +879,125 @@ - 854 - 79 + 66 + 1740 -1 -1 + + FK_from_mapping_to_group + + + + + group_id + Group ID + + VARCHAR + String + true + 12 + + 255 + true + false + + false + + + + + + + + group_mapping + Group Mapping + + + + id + ID + + INTEGER + Integer + false + 4 + + 10 + true + true + + true + + + + user_id + User ID + + 255 + true + false + + false + + + + + + + 70 + 909 + -1 + -1 + + + + FK_from_mapping_to_user + + + + + + + + + + + + 2 + + + + + + + + + + + + + 2 + + + + + + + + + + + 2 + + + + + + @@ -908,7 +1034,7 @@ false - + @@ -978,7 +1104,7 @@ created_time Created Time - + 10 true false @@ -1000,7 +1126,7 @@ updated_time Updated Time - + 10 true false @@ -1022,7 +1148,7 @@ deleted_time Deleted Time - + 10 false false @@ -1044,7 +1170,7 @@ versionNo Version No. - + 10 true false @@ -1055,14 +1181,120 @@ - 851 - 449 + 594 + 1740 -1 -1 + + FK_from_mapping_to_role + + + + + role_id + Role ID + + 255 + true + false + + false + + + + + + + + role_mapping + Role Mapping + + + + id + ID + + INT + Integer + false + 4 + + 10 + true + true + + true + + + + user_id + User ID + + 255 + true + false + + false + + + + + + + 602 + 909 + -1 + -1 + + + + FK_from_mapping_to_user + + + + + + + + + + + + 2 + + + + + + + + + + + + + 2 + + + + + + + + + + + 2 + + + + + + @@ -1107,6 +1339,8 @@ + + @@ -1313,7 +1547,7 @@ working_time Working Time - + 20 false false @@ -1336,7 +1570,7 @@ created_time Created Time - + 10 true false @@ -1347,7 +1581,7 @@ created_by Created_by - + 255 true false @@ -1358,7 +1592,7 @@ updated_time Updated Time - + 10 true false @@ -1369,7 +1603,7 @@ updated_by Updated by - + 255 true false @@ -1396,12 +1630,314 @@ + 331 + 40 + -1 + -1 + + + + + + + + + 2 + + + + + + + + + + + 2 + + + + + + + + FK_from_monthly_working_report_to_monthly_report + + + + + monthly_report_id + Monthly Report ID + + BIGINT + Integer + true + -5 + + 20 + true + false + + false + + + + + + + + monthly_working_report + Monthly Working Report + + + + id + ID + + 20 + true + true + + true + + + + value + Value + + DOUBLE + Real + false + 8 + + 10 + true + false + + false + + + + + working_type_id + Working Type ID + + INTEGER + Integer + false + 4 + + 10 + true + false + + false + + + + + 40 40 -1 -1 + + FK_from_monthly_working_report_to_working_type + + + + id + ID + + 20 + true + true + + true + + + + + + + + + + working_type + Working Type + + + + + name + Name + + VARCHAR + String + true + 12 + + 100 + true + false + + false + + + + value + Value + + 10 + true + false + + false + + + + type + Type + + VARCHAR + String + true + 12 + + 10 + true + false + + false + + + + parent_id + Parent ID + + 10 + false + false + + false + 1 + + + created_time + Created Time + + 10 + true + false + + false + + + + created_by + Created By + + 255 + true + false + + false + + + + updated_time + Updated Time + + 10 + true + false + + false + + + + updated_by + Updated By + + 255 + true + false + + false + + + + deleted_time + Deleted Time + + 10 + false + false + + false + + + + deleted_by + Deleted By + + 255 + false + false + + false + + + + versionNo + Version No. + + INTEGER + Integer + false + 4 + + 10 + true + false + + false + 0 + + + + + 51 + 484 + -1 + -1 + + + + + + + + + 2 + + + + + + + + + + 2 + + + + + + @@ -1442,6 +1978,10 @@ + + + + MySQL Modified: timecard/trunk/src/main/config/sql/mysql/timecard.ddl =================================================================== --- timecard/trunk/src/main/config/sql/mysql/timecard.ddl 2008-12-15 13:48:00 UTC (rev 1614) +++ timecard/trunk/src/main/config/sql/mysql/timecard.ddl 2008-12-15 13:48:37 UTC (rev 1615) @@ -1,3 +1,7 @@ +DROP TABLE monthly_working_report; +DROP TABLE working_type; +DROP TABLE role_mapping; +DROP TABLE group_mapping; DROP TABLE daily_report; DROP TABLE monthly_report; DROP TABLE employee; @@ -53,9 +57,13 @@ 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), + locale VARCHAR(5), role_id VARCHAR(255), group_id VARCHAR(255), created_time TIMESTAMP NOT NULL, @@ -76,7 +84,6 @@ id INTEGER NOT NULL PRIMARY KEY AUTO_INCREMENT, username VARCHAR(255) NOT NULL, manager VARCHAR(255) NOT NULL, - paid_holidays DOUBLE NOT NULL DEFAULT 0, is_available VARCHAR(1) NOT NULL DEFAULT 'T', created_time TIMESTAMP NOT NULL, created_by VARCHAR(255) NOT NULL, @@ -97,10 +104,7 @@ year INTEGER NOT NULL, month INTEGER NOT NULL, status INTEGER NOT NULL DEFAULT 1, - working_days DOUBLE NOT NULL DEFAULT 0, std_working_days DOUBLE NOT NULL DEFAULT 0, - holidays DOUBLE NOT NULL DEFAULT 0, - paid_holidays DOUBLE NOT NULL DEFAULT 0, working_time BIGINT(20) NOT NULL DEFAULT 0, std_working_time BIGINT(20) NOT NULL DEFAULT 0, over_time BIGINT(20) NOT NULL DEFAULT 0, @@ -141,3 +145,55 @@ FOREIGN KEY (monthly_report_id) REFERENCES monthly_report (id) ); +/********************************** +Table Name: Group Mapping +**********************************/ +CREATE TABLE group_mapping( + id INTEGER NOT NULL PRIMARY KEY AUTO_INCREMENT, + 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 PRIMARY KEY AUTO_INCREMENT, + 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: Working Type +**********************************/ +CREATE TABLE working_type( + id INTEGER NOT NULL PRIMARY KEY AUTO_INCREMENT, + name VARCHAR(100) NOT NULL, + value INTEGER NOT NULL, + type VARCHAR(10) NOT NULL, + parent_id INTEGER DEFAULT 1, + 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 DEFAULT 0 +); + +/********************************** +Table Name: Monthly Working Report +**********************************/ +CREATE TABLE monthly_working_report( + id BIGINT(20) NOT NULL PRIMARY KEY AUTO_INCREMENT, + value DOUBLE NOT NULL, + monthly_report_id BIGINT(20) NOT NULL, + working_type_id INTEGER NOT NULL, + FOREIGN KEY (working_type_id) REFERENCES working_type (id), + FOREIGN KEY (monthly_report_id) REFERENCES monthly_report (id) +); + From svnnotify ¡÷ sourceforge.jp Mon Dec 15 22:49:10 2008 From: svnnotify ¡÷ sourceforge.jp (svnnotify ¡÷ sourceforge.jp) Date: Mon, 15 Dec 2008 22:49:10 +0900 Subject: [pal-cvs 3881] [1616] added files for mysql. Message-ID: <1229348950.362660.8452.nullmailer@users.sourceforge.jp> Revision: 1616 http://svn.sourceforge.jp/view?root=pal&view=rev&rev=1616 Author: shinsuke Date: 2008-12-15 22:49:10 +0900 (Mon, 15 Dec 2008) Log Message: ----------- added files for mysql. Added Paths: ----------- todolist/trunk/src/main/config/erd/mysql/ todolist/trunk/src/main/config/erd/mysql/todolist.erd todolist/trunk/src/main/config/sql/mysql/ todolist/trunk/src/main/config/sql/mysql/todolist.ddl -------------- next part -------------- Added: todolist/trunk/src/main/config/erd/mysql/todolist.erd =================================================================== --- todolist/trunk/src/main/config/erd/mysql/todolist.erd (rev 0) +++ todolist/trunk/src/main/config/erd/mysql/todolist.erd 2008-12-15 13:49:10 UTC (rev 1616) @@ -0,0 +1,1574 @@ + + + + + + + user_info + User Information + + + + user_id + User ID + + VARCHAR + String + true + 12 + + 255 + true + true + + false + + + + given_name + Given Name + + VARCHAR + String + true + 12 + + 100 + false + false + + false + + + + family_name + Family Name + + 100 + false + false + + false + + + + middle_name + Middle Name + + 50 + false + false + + false + + + + given_name_desc + Given Name Descritpion + + 100 + false + false + + false + + + + family_name_desc + Family Name Description + + 100 + false + false + + false + + + + nickname + Nickname + + VARCHAR + String + true + 12 + + 100 + false + false + + false + + + + gender + Gender + + 1 + false + false + + false + + + + birth_date + Birth Date + + DATE + Date + false + 91 + + 10 + false + false + + false + + + + email + Email + + 255 + false + false + + false + + + + url + URL + + 255 + false + false + + false + + + + telephone + Telephone + + VARCHAR + String + true + 12 + + 40 + false + false + + false + + + + locale + Locale + + VARCHAR + String + true + 12 + + 5 + false + false + + false + + + + role_id + Default Role ID + + 255 + false + false + + false + + + + group_id + Default Group ID + + 255 + false + false + + false + + + + created_time + Created Time + + TIMESTAMP + Datetime + false + 93 + + 10 + true + false + + false + + + + created_by + Created By + + 255 + true + false + + false + + + + updated_time + Updated Time + + 10 + true + false + + false + + + + updated_by + Updated By + + 255 + true + false + + false + + + + deleted_time + Deleted Time + + 10 + false + false + + false + + + + deleted_by + Deleted By + + 255 + false + false + + false + + + + versionNo + Version No. + + INTEGER + Integer + false + 4 + + 10 + true + false + + false + + + + + + 566 + 757 + -1 + -1 + + + + FK_from_user_to_group + + + + group_id + Group ID + + 255 + true + true + + false + + + + + + + + + + group_info + Group Information + + + + + name + Name + + 100 + false + false + + false + + + + description + Description + + 255 + false + false + + false + + + + email + Email + + 255 + false + false + + false + + + + url + URL + + 255 + false + false + + false + + + + telephone + Telephone + + 40 + false + false + + false + + + + created_time + Created Time + + 10 + true + false + + false + + + + created_by + Created By + + 255 + true + false + + false + + + + updated_time + Updated Time + + 10 + true + false + + false + + + + updated_by + Updated By + + 255 + true + false + + false + + + + deleted_time + Deleted Time + + 10 + false + false + + false + + + + deleted_by + Deleted By + + 255 + false + false + + false + + + + versionNo + Version No. + + 10 + true + false + + false + + + + + + 40 + 1277 + -1 + -1 + + + + + + FK_from_mapping_to_group + + + + + group_id + Group ID + + VARCHAR + String + true + 12 + + 255 + true + false + + false + + + + + + + + group_mapping + Group Mapping + + + + id + ID + + INTEGER + Integer + false + 4 + + 10 + true + true + + true + + + + user_id + User ID + + 255 + true + false + + false + + + + + + + 44 + 389 + -1 + -1 + + + + FK_from_mapping_to_user + + + + + + + + + + + + 2 + + + + + + + + + + + + + 2 + + + + + + + + + + + 2 + + + + + + + + + + + 2 + + + + + + + + + + 2 + + + + + + + + FK_from_user_to_role + + + + role_id + Role ID + + 255 + true + true + + false + + + + + + + + + + role_info + Role Information + + + + + name + Name + + 100 + false + false + + false + + + + description + Description + + 255 + false + false + + false + + + + email + Email + + 255 + false + false + + false + + + + url + URL + + 255 + false + false + + false + + + + telephone + Telephone + + 40 + false + false + + false + + + + created_time + Created Time + + 10 + true + false + + false + + + + created_by + Created By + + 255 + true + false + + false + + + + updated_time + Updated Time + + 10 + true + false + + false + + + + updated_by + Updated By + + 255 + true + false + + false + + + + deleted_time + Deleted Time + + 10 + false + false + + false + + + + deleted_by + Deleted By + + 255 + false + false + + false + + + + versionNo + Version No. + + 10 + true + false + + false + + + + + + 864 + 1277 + -1 + -1 + + + + + + FK_from_mapping_to_role + + + + + role_id + Role ID + + 255 + true + false + + false + + + + + + + + role_mapping + Role Mapping + + + + id + ID + + INT + Integer + false + 4 + + 10 + true + true + + true + + + + user_id + User ID + + 255 + true + false + + false + + + + + + + 872 + 389 + -1 + -1 + + + + FK_from_mapping_to_user + + + + + + + + + + + + 2 + + + + + + + + + + + + + 2 + + + + + + + + + + + 2 + + + + + + + + + + + 2 + + + + + + + + + + 2 + + + + + + + + + + + + FK_from_mapping_to_user + + + + + user_id + User ID + + VARCHAR + String + true + 12 + + 255 + true + false + + false + + + + + + + + todo_mapping + ToDo Mapping + + + + id + ID + + BIGINT + Integer + true + -5 + + 20 + true + true + + true + + + + status + Status + + INT + Integer + false + 4 + + 10 + true + false + + false + + + + memo + Memo + + 255 + false + false + + false + + + + todo_id + ToDo ID + + 20 + true + false + + false + + + + + category_id + Category ID + + 20 + false + false + + false + + + + created_time + Created Time + + TIMESTAMP + Datetime + false + 93 + + 10 + true + false + + false + + + + created_by + Created By + + 255 + true + false + + false + + + + updated_time + Updated Time + + 10 + true + false + + false + + + + updated_by + Updated By + + 255 + true + false + + false + + + + deleted_time + Deleted Time + + 10 + false + false + + false + + + + deleted_by + Deleted By + + 255 + false + false + + false + + + + versionNo + Version No. + + INTEGER + Integer + false + 4 + + 10 + true + false + + false + + + + + + 580 + 40 + -1 + -1 + + + + + FK_from_mapping_to_todo + + + + id + ID + + 20 + true + true + + true + + + + + + + + + + todo + ToDo + + + + + name + Name + + 100 + true + false + + false + + + + description + Description + + 200 + false + false + + false + + + + priority + Priority + + 50 + true + false + + false + + + + status + Status + + 100 + true + false + + false + + + + start_date + Start Date + + 100 + false + false + + false + + + + end_date + End Date + + 255 + false + false + + false + + + + created_time + Created Time + + 10 + true + false + + false + + + + created_by + Created By + + 255 + true + false + + false + + + + updated_time + Updated Time + + 10 + true + false + + false + + + + updated_by + Updated By + + 255 + true + false + + false + + + + deleted_time + Deleted Time + + 10 + false + false + + false + + + + deleted_by + Deleted By + + 255 + false + false + + false + + + + versionNo + Version No. + + 10 + true + false + + false + + + + + + 305 + 389 + -1 + -1 + + + + FK_from_todo_to_user + + + + + + + + + + + + 2 + + + + + + + + + + + + + + 2 + + + + + + + + + + 2 + + + + + + + + FK_from_mapping_to_category + + + + id + ID + + BIGINT + Integer + true + -5 + + 20 + true + true + + true + + + + + + + + + + todo_category + ToDo Category + + + + + name + Name + + 100 + true + false + + false + + + + sort_order + Sort Order + + INTEGER + Integer + false + 4 + + 10 + true + false + + false + 1 + + + user_id + User ID + + 255 + true + false + + false + + + + created_time + Created Time + + 10 + true + false + + false + + + + created_by + Created By + + 255 + true + false + + false + + + + updated_time + Updated Time + + 10 + true + false + + false + + + + updated_by + Updated By + + 255 + true + false + + false + + + + deleted_time + Deleted Time + + 10 + false + false + + false + + + + deleted_by + Deleted By + + 255 + false + false + + false + + + + + + 583 + 389 + -1 + -1 + + + + FK_from_category_to_user + + + + + + + + + + + + 2 + + + + + + + + + + + + + + 2 + + + + + + + + + + 2 + + + + + + + + + + + + 2 + + + + + + + + + + + 2 + + + + + + + + + + + + + 2 + + + + + + + + + + + + + + + + MySQL + false + + sun.jdbc.odbc.JdbcOdbc + + + + + + false + + + + 2 + + + + + + \ No newline at end of file Added: todolist/trunk/src/main/config/sql/mysql/todolist.ddl =================================================================== --- todolist/trunk/src/main/config/sql/mysql/todolist.ddl (rev 0) +++ todolist/trunk/src/main/config/sql/mysql/todolist.ddl 2008-12-15 13:49:10 UTC (rev 1616) @@ -0,0 +1,159 @@ +DROP TABLE todo_mapping; +DROP TABLE todo_category; +DROP TABLE todo; +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), + locale VARCHAR(5), + 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 PRIMARY KEY AUTO_INCREMENT, + 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 PRIMARY KEY AUTO_INCREMENT, + 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: ToDo +**********************************/ +CREATE TABLE todo( + id BIGINT(20) NOT NULL PRIMARY KEY AUTO_INCREMENT, + name VARCHAR(100) NOT NULL, + description VARCHAR(200), + priority INTEGER NOT NULL, + status INTEGER NOT NULL, + start_date TIMESTAMP, + end_date TIMESTAMP, + 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 (created_by) REFERENCES user_info (user_id) +); + +/********************************** +Table Name: ToDo Category +**********************************/ +CREATE TABLE todo_category( + id BIGINT(20) NOT NULL PRIMARY KEY AUTO_INCREMENT, + name VARCHAR(100) NOT NULL, + sort_order INTEGER NOT NULL DEFAULT 1, + user_id VARCHAR(255) 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), + FOREIGN KEY (user_id) REFERENCES user_info (user_id) +); + +/********************************** +Table Name: ToDo Mapping +**********************************/ +CREATE TABLE todo_mapping( + id BIGINT(20) NOT NULL PRIMARY KEY AUTO_INCREMENT, + status INT NOT NULL, + memo VARCHAR(255), + todo_id BIGINT(20) NOT NULL, + user_id VARCHAR(255) NOT NULL, + category_id BIGINT(20), + 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 (user_id) REFERENCES user_info (user_id), + FOREIGN KEY (todo_id) REFERENCES todo (id), + FOREIGN KEY (category_id) REFERENCES todo_category (id) +); + From svnnotify ¡÷ sourceforge.jp Tue Dec 16 06:34:40 2008 From: svnnotify ¡÷ sourceforge.jp (svnnotify ¡÷ sourceforge.jp) Date: Tue, 16 Dec 2008 06:34:40 +0900 Subject: [pal-cvs 3882] [1617] clean up jars, modified ui, clear multiple values. Message-ID: <1229376880.723863.22997.nullmailer@users.sourceforge.jp> Revision: 1617 http://svn.sourceforge.jp/view?root=pal&view=rev&rev=1617 Author: shinsuke Date: 2008-12-16 06:34:40 +0900 (Tue, 16 Dec 2008) Log Message: ----------- clean up jars, modified ui, clear multiple values. Modified Paths: -------------- pal-wcm/trunk/.classpath pal-wcm/trunk/pom.xml pal-wcm/trunk/src/main/java/jp/sf/pal/wcm/action/EditorAction.java pal-wcm/trunk/src/main/java/jp/sf/pal/wcm/service/ContentService.java pal-wcm/trunk/src/main/java/jp/sf/pal/wcm/servlet/FileconnectorServlet.java pal-wcm/trunk/src/main/java/jp/sf/pal/wcm/servlet/FileviewServlet.java pal-wcm/trunk/src/main/webapp/WEB-INF/view/editor/prefs.jsp Added Paths: ----------- pal-wcm/trunk/src/main/java/jp/sf/pal/wcm/util/DownloadUtil.java pal-wcm/trunk/src/main/java/jp/sf/pal/wcm/util/StreamUtil.java -------------- next part -------------- Modified: pal-wcm/trunk/.classpath =================================================================== --- pal-wcm/trunk/.classpath 2008-12-15 13:49:10 UTC (rev 1616) +++ pal-wcm/trunk/.classpath 2008-12-15 21:34:40 UTC (rev 1617) @@ -4,7 +4,6 @@ - @@ -24,19 +23,21 @@ - + - + - - - - + + + + + - + + Modified: pal-wcm/trunk/pom.xml =================================================================== --- pal-wcm/trunk/pom.xml 2008-12-15 13:49:10 UTC (rev 1616) +++ pal-wcm/trunk/pom.xml 2008-12-15 21:34:40 UTC (rev 1617) @@ -98,11 +98,6 @@ - jp.sf.pal - common-utils - 0.2 - - portlet-api portlet-api 1.0 @@ -152,7 +147,6 @@ log4j log4j 1.2.13 - jar javax.mail @@ -165,12 +159,6 @@ jetspeed-api 2.1.3 provided - - - junit - junit - - javax.servlet @@ -182,21 +170,7 @@ org.seasar.sastruts sa-struts-portlet - 1.0.0-rc2 - - - org.easymock - easymock - - - commons-logging - commons-logging - - - junit - junit - - + 1.0.0-rc4 org.apache.geronimo.specs @@ -218,6 +192,38 @@ geronimo-jta_1.1_spec 1.0 + + + + antlr + antlr + 2.7.7 + provided + + + junit + junit + 3.8.2 + test + + + org.easymock + easymock + 2.2 + test + + + xalan + xalan + 2.5.1 + provided + + + xml-apis + xml-apis + 2.0.2 + provided + Modified: pal-wcm/trunk/src/main/java/jp/sf/pal/wcm/action/EditorAction.java =================================================================== --- pal-wcm/trunk/src/main/java/jp/sf/pal/wcm/action/EditorAction.java 2008-12-15 13:49:10 UTC (rev 1616) +++ pal-wcm/trunk/src/main/java/jp/sf/pal/wcm/action/EditorAction.java 2008-12-15 21:34:40 UTC (rev 1617) @@ -17,6 +17,8 @@ import java.io.Serializable; import java.util.ArrayList; +import java.util.Collections; +import java.util.Comparator; import java.util.List; import java.util.Locale; @@ -64,7 +66,7 @@ private ContentService contentService; - private HttpServletRequest request; + private transient HttpServletRequest request; private String getReceivedPath() { PortletRequest portletRequest = (PortletRequest) request @@ -323,6 +325,19 @@ locales[i].toString() }; localeList.add(tmp); } + Collections.sort(localeList, new Comparator() { + public int compare(String[] tc1, String[] tc2) { + String tc1Name = tc1[1]; + String tc2Name = tc2[1]; + if (tc1Name.compareTo(tc2Name) < 0) { + return -1; + } else if (tc1Name.compareTo(tc2Name) > 0) { + return 1; + } + return 0; + } + }); + } try { localeItems = contentService.getLocaleList( Modified: pal-wcm/trunk/src/main/java/jp/sf/pal/wcm/service/ContentService.java =================================================================== --- pal-wcm/trunk/src/main/java/jp/sf/pal/wcm/service/ContentService.java 2008-12-15 13:49:10 UTC (rev 1616) +++ pal-wcm/trunk/src/main/java/jp/sf/pal/wcm/service/ContentService.java 2008-12-15 21:34:40 UTC (rev 1617) @@ -50,6 +50,8 @@ */ public class ContentService implements Serializable { + private static final long serialVersionUID = -4039452318407162712L; + private transient HttpServletRequest request; private transient PageManager pageManager = null; @@ -252,7 +254,8 @@ fp.setValueList(list); fragment.getPreferences().add(fp); } else { - fp.getValueList().set(0, StringEscapeUtils.escapeXml(value)); + fp.getValueList().clear(); + fp.getValueList().add(StringEscapeUtils.escapeXml(value)); } } Modified: pal-wcm/trunk/src/main/java/jp/sf/pal/wcm/servlet/FileconnectorServlet.java =================================================================== --- pal-wcm/trunk/src/main/java/jp/sf/pal/wcm/servlet/FileconnectorServlet.java 2008-12-15 13:49:10 UTC (rev 1616) +++ pal-wcm/trunk/src/main/java/jp/sf/pal/wcm/servlet/FileconnectorServlet.java 2008-12-15 21:34:40 UTC (rev 1617) @@ -78,7 +78,8 @@ doCreateFolder(req, resp); } else { resp.sendError(HttpServletResponse.SC_BAD_REQUEST, - "Unknown action command. The command is " + command + "."); + "Unknown action command. The command is " + + StringEscapeUtils.escapeHtml(command) + "."); return; } resp.getWriter().flush(); Modified: pal-wcm/trunk/src/main/java/jp/sf/pal/wcm/servlet/FileviewServlet.java =================================================================== --- pal-wcm/trunk/src/main/java/jp/sf/pal/wcm/servlet/FileviewServlet.java 2008-12-15 13:49:10 UTC (rev 1616) +++ pal-wcm/trunk/src/main/java/jp/sf/pal/wcm/servlet/FileviewServlet.java 2008-12-15 21:34:40 UTC (rev 1617) @@ -26,10 +26,11 @@ import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; -import jp.sf.pal.common.util.DownloadUtil; import jp.sf.pal.wcm.WcmConstants; +import jp.sf.pal.wcm.util.DownloadUtil; import jp.sf.pal.wcm.util.PALWcmUtil; +import org.apache.commons.lang.StringEscapeUtils; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; @@ -74,8 +75,9 @@ } if (!namespaceList.contains(namespace)) { resp.sendError(HttpServletResponse.SC_FORBIDDEN, - "you do not have a proper permission: " + name + "(" + - namespace + ")"); + "you do not have a proper permission: " + + StringEscapeUtils.escapeHtml(name) + "(" + + StringEscapeUtils.escapeHtml(namespace) + ")"); return; } Added: pal-wcm/trunk/src/main/java/jp/sf/pal/wcm/util/DownloadUtil.java =================================================================== --- pal-wcm/trunk/src/main/java/jp/sf/pal/wcm/util/DownloadUtil.java (rev 0) +++ pal-wcm/trunk/src/main/java/jp/sf/pal/wcm/util/DownloadUtil.java 2008-12-15 21:34:40 UTC (rev 1617) @@ -0,0 +1,107 @@ +/* + * Copyright 2005-2006 Portal Application Laboratory project. + * + * 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.wcm.util; + +import java.io.IOException; +import java.io.InputStream; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; + +import javax.mail.internet.MimeUtility; +import javax.portlet.PortletContext; +import javax.servlet.ServletContext; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; + +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; + +/** + * @author shinsuke + * + */ +public class DownloadUtil { + + /** + * Logger for this class + */ + private static final Log log = LogFactory.getLog(DownloadUtil.class); + + public static final String OCTET_STREAM = "application/octet-stream"; + + public static void setContentType(HttpServletRequest request, + HttpServletResponse response, String contentType) { + response.setContentType(contentType); + } + + public static void setFilename(HttpServletRequest request, + HttpServletResponse response, String filename) { + if (isMSIE(request)) { + // for MSIE + try { + filename = URLEncoder.encode(filename, "UTF-8"); + } catch (UnsupportedEncodingException e) { + log.error("Unsupported Encoding.", e); + } + } else { + // for Others + try { + filename = MimeUtility.encodeWord(filename, "UTF-8", "B"); + } catch (UnsupportedEncodingException e) { + log.error("Unsupported Encoding.", e); + } + } + response.setHeader("Content-Disposition", "inline; filename=\"" + + filename + "\""); + } + + public static boolean isMSIE(HttpServletRequest request) { + String agent = request.getHeader("user-agent"); + if (log.isDebugEnabled()) { + log.debug("isMSIE() - agent=" + agent); + } + if (agent.indexOf("MSIE") > 0) { + return true; + } + return false; + } + + public static void writeResponse(HttpServletRequest request, + HttpServletResponse response, String contentType, String filename, + InputStream in) throws IOException { + setContentType(request, response, contentType); + setFilename(request, response, filename); + writeResponse(request, response, in); + } + + public static void writeResponse(HttpServletRequest request, + HttpServletResponse response, InputStream in) throws IOException { + StreamUtil.drain(in, response.getOutputStream()); + response.getOutputStream().flush(); + } + + public static String getMimeType(Object context, String filename) { + if (context instanceof ServletContext) { + ServletContext servletContext = (ServletContext) context; + return servletContext.getMimeType(filename); + } else if (context instanceof PortletContext) { + PortletContext portletContext = (PortletContext) context; + return portletContext.getMimeType(filename); + } + return null; + } + +} Property changes on: pal-wcm/trunk/src/main/java/jp/sf/pal/wcm/util/DownloadUtil.java ___________________________________________________________________ Name: svn:eol-style + native Added: pal-wcm/trunk/src/main/java/jp/sf/pal/wcm/util/StreamUtil.java =================================================================== --- pal-wcm/trunk/src/main/java/jp/sf/pal/wcm/util/StreamUtil.java (rev 0) +++ pal-wcm/trunk/src/main/java/jp/sf/pal/wcm/util/StreamUtil.java 2008-12-15 21:34:40 UTC (rev 1617) @@ -0,0 +1,44 @@ +/* + * Copyright 2005-2006 Portal Application Laboratory project. + * + * 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.wcm.util; + +import java.io.IOException; +import java.io.InputStream; +import java.io.OutputStream; + +/** + * @author shinsuke + * + */ +public class StreamUtil { + private static final int BLOCK_SIZE = 4096; + + public static void drain(InputStream r, OutputStream w) throws IOException { + byte[] bytes = new byte[BLOCK_SIZE]; + try { + int length = r.read(bytes); + while (length != -1) { + if (length != 0) { + w.write(bytes, 0, length); + } + length = r.read(bytes); + } + } finally { + bytes = null; + } + + } +} Property changes on: pal-wcm/trunk/src/main/java/jp/sf/pal/wcm/util/StreamUtil.java ___________________________________________________________________ Name: svn:eol-style + native Modified: pal-wcm/trunk/src/main/webapp/WEB-INF/view/editor/prefs.jsp =================================================================== --- pal-wcm/trunk/src/main/webapp/WEB-INF/view/editor/prefs.jsp 2008-12-15 13:49:10 UTC (rev 1616) +++ pal-wcm/trunk/src/main/webapp/WEB-INF/view/editor/prefs.jsp 2008-12-15 21:34:40 UTC (rev 1617) @@ -29,7 +29,7 @@

- + ${l[0]}(${l[1]}) @@ -45,7 +45,7 @@

- + ${f:h(l)} From svnnotify ¡÷ sourceforge.jp Sat Dec 20 22:39:54 2008 From: svnnotify ¡÷ sourceforge.jp (svnnotify ¡÷ sourceforge.jp) Date: Sat, 20 Dec 2008 22:39:54 +0900 Subject: [pal-cvs 3883] [1618] fixed mt issue. Message-ID: <1229780394.843417.7932.nullmailer@users.sourceforge.jp> Revision: 1618 http://svn.sourceforge.jp/view?root=pal&view=rev&rev=1618 Author: shinsuke Date: 2008-12-20 22:39:54 +0900 (Sat, 20 Dec 2008) Log Message: ----------- fixed mt issue. Modified Paths: -------------- pal-portal/branches/pal-portal-1.x/portal/jetspeed-2/components/portal/src/java/org/apache/jetspeed/aggregator/impl/RenderingJobImpl.java pal-portal/branches/pal-portal-1.x/portal/jetspeed-2/components/portal/src/java/org/apache/jetspeed/engine/servlet/ServletRequestImpl.java pal-portal/branches/pal-portal-1.x/portal/jetspeed-2/jetspeed-api/src/java/org/apache/jetspeed/PortalReservedParameters.java -------------- next part -------------- Modified: pal-portal/branches/pal-portal-1.x/portal/jetspeed-2/components/portal/src/java/org/apache/jetspeed/aggregator/impl/RenderingJobImpl.java =================================================================== --- pal-portal/branches/pal-portal-1.x/portal/jetspeed-2/components/portal/src/java/org/apache/jetspeed/aggregator/impl/RenderingJobImpl.java 2008-12-15 21:34:40 UTC (rev 1617) +++ pal-portal/branches/pal-portal-1.x/portal/jetspeed-2/components/portal/src/java/org/apache/jetspeed/aggregator/impl/RenderingJobImpl.java 2008-12-20 13:39:54 UTC (rev 1618) @@ -20,6 +20,7 @@ import java.util.Arrays; import java.util.Collection; import java.util.Collections; +import java.util.Enumeration; import java.util.HashMap; import java.util.Iterator; import java.util.Map; @@ -100,6 +101,8 @@ protected long timeout; + protected Map requestAttributes; + public RenderingJobImpl(PortletContainer container, PortletRenderer renderer, PortletDefinition portletDefinition, PortletContent portletContent, ContentFragment fragment, @@ -124,6 +127,17 @@ .setFragment(fragment); this.expirationCache = expirationCache; this.contentIsCached = contentIsCached; + + this.requestAttributes = new HashMap(); + ServletRequest servletRequest = ((HttpServletRequestWrapper) ((HttpServletRequestWrapper) this.request) + .getRequest()).getRequest(); + Enumeration attrNames = servletRequest.getAttributeNames(); + while (attrNames.hasMoreElements()) + { + String key = (String) attrNames.nextElement(); + requestAttributes.put(key, servletRequest.getAttribute(key)); + } + } public RenderingJobImpl(PortletContainer container, @@ -281,25 +295,29 @@ if (isParallelMode) { - ServletRequest servletRequest = ((HttpServletRequestWrapper) ((HttpServletRequestWrapper) this.request) - .getRequest()).getRequest(); - - synchronized (servletRequest) + for (Map.Entry entry : requestAttributes + .entrySet()) { - this.request.setAttribute( - PortalReservedParameters.FRAGMENT_ATTRIBUTE, - fragment); - this.request.setAttribute( - PortalReservedParameters.PAGE_ATTRIBUTE, - requestContext.getPage()); - this.request.setAttribute( - PortalReservedParameters.REQUEST_CONTEXT_ATTRIBUTE, - requestContext); - this.request.setAttribute( - PortalReservedParameters.REQUEST_CONTEXT_OBJECTS, - requestContext.getObjects()); - // this.request.setAttribute(PortalReservedParameters.CONTENT_DISPATCHER_ATTRIBUTE,dispatcher); + CurrentWorkerContext.setAttribute(entry.getKey(), entry + .getValue()); } + + CurrentWorkerContext.setAttribute( + PortalReservedParameters.UPDATED_ATTRIBUTES, + new HashMap()); + + this.request.setAttribute( + PortalReservedParameters.FRAGMENT_ATTRIBUTE, fragment); + this.request.setAttribute( + PortalReservedParameters.PAGE_ATTRIBUTE, requestContext + .getPage()); + this.request.setAttribute( + PortalReservedParameters.REQUEST_CONTEXT_ATTRIBUTE, + requestContext); + this.request.setAttribute( + PortalReservedParameters.REQUEST_CONTEXT_OBJECTS, + requestContext.getObjects()); + // this.request.setAttribute(PortalReservedParameters.CONTENT_DISPATCHER_ATTRIBUTE,dispatcher); } else { @@ -319,6 +337,36 @@ container.renderPortlet(this.window, this.request, this.response); this.response.flushBuffer(); + if (isParallelMode) + { + // flush attributes + ServletRequest servletRequest = ((HttpServletRequestWrapper) ((HttpServletRequestWrapper) this.request) + .getRequest()).getRequest(); + + synchronized (servletRequest) + { + Map attrs = (Map) this.request + .getAttribute(PortalReservedParameters.UPDATED_ATTRIBUTES); + if (attrs != null) + { + for (Map.Entry entry : attrs.entrySet()) + { + if (PortalReservedParameters.NULL_ATTRIBUTE + .equals(entry.getValue())) + { + // remove + servletRequest.removeAttribute(entry.getKey()); + } + else + { + // add + servletRequest.setAttribute(entry.getKey(), + entry.getValue()); + } + } + } + } + } } catch (Throwable t) { Modified: pal-portal/branches/pal-portal-1.x/portal/jetspeed-2/components/portal/src/java/org/apache/jetspeed/engine/servlet/ServletRequestImpl.java =================================================================== --- pal-portal/branches/pal-portal-1.x/portal/jetspeed-2/components/portal/src/java/org/apache/jetspeed/engine/servlet/ServletRequestImpl.java 2008-12-15 21:34:40 UTC (rev 1617) +++ pal-portal/branches/pal-portal-1.x/portal/jetspeed-2/components/portal/src/java/org/apache/jetspeed/engine/servlet/ServletRequestImpl.java 2008-12-20 13:39:54 UTC (rev 1618) @@ -464,8 +464,6 @@ */ public Enumeration getAttributeNames() { - Enumeration attrNames = super.getAttributeNames(); - // In parallel mode, adjust attributes by the values of the current // thread @@ -477,20 +475,8 @@ { HashMap adjustedAttrMap = new HashMap(); - // first, add all attributes of original request. - - while (attrNames.hasMoreElements()) - { - String key = (String) attrNames.nextElement(); - adjustedAttrMap.put(key, super.getAttribute(key)); - } - - // second, add or override all attributes by the current worker - // context. - Enumeration cwAttrNames = CurrentWorkerContext .getAttributeNames(); - while (cwAttrNames.hasMoreElements()) { String key = (String) cwAttrNames.nextElement(); @@ -501,10 +487,12 @@ cachedAttributes = Collections.unmodifiableMap(adjustedAttrMap); } - attrNames = Collections.enumeration(cachedAttributes.keySet()); + return Collections.enumeration(cachedAttributes.keySet()); } - - return attrNames; + else + { + return super.getAttributeNames(); + } } /** @@ -715,9 +703,33 @@ CurrentWorkerContext.setAttribute(name, value); } - if (name.startsWith("org.apache.jetspeed")) + if (name + .startsWith(PortalReservedParameters.ORG_APACHE_JETSPEED_PREFIX)) { - setAttributeInternal(name, value); + Map updatedAttributes = (Map) CurrentWorkerContext + .getAttribute(PortalReservedParameters.UPDATED_ATTRIBUTES); + String encodedKey = nameSpaceMapper.encode(portletWindow + .getId(), name); + + // title + if (name + .startsWith(PortalReservedParameters.OVERRIDE_PORTLET_TITLE_ATTR)) + { + encodedKey = name; + } + + if (value == null) + { + // remove + updatedAttributes.put(encodedKey, + PortalReservedParameters.NULL_ATTRIBUTE); + } + else + { + // add + updatedAttributes.put(encodedKey, value); + } + } } else @@ -731,16 +743,17 @@ { // This allows us to make jetpseed objects avaiable to portlets // This makes the portlet non-portable but is a must admin portlets - if (name.startsWith("org.apache.jetspeed")) + if (name + .startsWith(PortalReservedParameters.ORG_APACHE_JETSPEED_PREFIX)) { + String encodedKey = nameSpaceMapper.encode(portletWindow.getId(), + name); if (value == null) { - this.removeAttribute(name); + this.removeAttribute(encodedKey); } else { - String encodedKey = nameSpaceMapper.encode(portletWindow - .getId(), name); this._getHttpServletRequest().setAttribute(encodedKey, value); } } @@ -770,13 +783,32 @@ CurrentWorkerContext.removeAttribute(name); - if (name.startsWith("org.apache.jetspeed")) + if (name + .startsWith(PortalReservedParameters.ORG_APACHE_JETSPEED_PREFIX)) { - super.removeAttribute(name); + Map updatedAttributes = (Map) CurrentWorkerContext + .getAttribute(PortalReservedParameters.UPDATED_ATTRIBUTES); + String encodedKey = nameSpaceMapper.encode(portletWindow + .getId(), name); + // title + if (name + .startsWith(PortalReservedParameters.OVERRIDE_PORTLET_TITLE_ATTR)) + { + encodedKey = name; + } + updatedAttributes.put(encodedKey, + PortalReservedParameters.NULL_ATTRIBUTE); } } else { + if (name + .startsWith(PortalReservedParameters.ORG_APACHE_JETSPEED_PREFIX)) + { + String encodedKey = nameSpaceMapper.encode(portletWindow + .getId(), name); + super.removeAttribute(encodedKey); + } // remove attribute from request. super.removeAttribute(name); } @@ -953,4 +985,5 @@ super.setCharacterEncoding(arg0); } } + } Modified: pal-portal/branches/pal-portal-1.x/portal/jetspeed-2/jetspeed-api/src/java/org/apache/jetspeed/PortalReservedParameters.java =================================================================== --- pal-portal/branches/pal-portal-1.x/portal/jetspeed-2/jetspeed-api/src/java/org/apache/jetspeed/PortalReservedParameters.java 2008-12-15 21:34:40 UTC (rev 1617) +++ pal-portal/branches/pal-portal-1.x/portal/jetspeed-2/jetspeed-api/src/java/org/apache/jetspeed/PortalReservedParameters.java 2008-12-20 13:39:54 UTC (rev 1618) @@ -206,4 +206,10 @@ * directly, similar as an ActionURL but as a direct Portlet Render request. */ public static final String PORTLET_RESOURCE_URL_REQUEST_PARAMETER = "org.apache.jetspeed.portlet.resource.url"; + + public static final String UPDATED_ATTRIBUTES = "org.apache.jetspeed.UpdatedAttributes"; + + public static final String NULL_ATTRIBUTE = "org.apache.jetspeed.NULL"; + + public static final String ORG_APACHE_JETSPEED_PREFIX = "org.apache.jetspeed"; } From svnnotify ¡÷ sourceforge.jp Tue Dec 23 10:07:02 2008 From: svnnotify ¡÷ sourceforge.jp (svnnotify ¡÷ sourceforge.jp) Date: Tue, 23 Dec 2008 10:07:02 +0900 Subject: [pal-cvs 3884] [1619] supported csv download, and minor fixes. Message-ID: <1229994422.339119.24317.nullmailer@users.sourceforge.jp> Revision: 1619 http://svn.sourceforge.jp/view?root=pal&view=rev&rev=1619 Author: shinsuke Date: 2008-12-23 10:07:01 +0900 (Tue, 23 Dec 2008) Log Message: ----------- supported csv download, and minor fixes. Modified Paths: -------------- timecard/trunk/src/main/java/jp/sf/pal/timecard/TimecardConstants.java timecard/trunk/src/main/java/jp/sf/pal/timecard/action/ConfigAction.java timecard/trunk/src/main/java/jp/sf/pal/timecard/action/EmployeeAction.java timecard/trunk/src/main/java/jp/sf/pal/timecard/action/admin/TimecardAction.java timecard/trunk/src/main/java/jp/sf/pal/timecard/action/manager/TimecardAction.java timecard/trunk/src/main/java/jp/sf/pal/timecard/form/config/ConfigForm.java timecard/trunk/src/main/java/jp/sf/pal/timecard/form/employee/EmployeeForm.java timecard/trunk/src/main/java/jp/sf/pal/timecard/util/TimecardUtil.java timecard/trunk/src/main/resources/application.properties timecard/trunk/src/main/resources/application_ja.properties timecard/trunk/src/main/webapp/WEB-INF/view/admin/timecard/index.jsp timecard/trunk/src/main/webapp/WEB-INF/view/config/index.jsp timecard/trunk/src/main/webapp/WEB-INF/view/employee/index.jsp timecard/trunk/src/main/webapp/WEB-INF/view/manager/timecard/index.jsp Added Paths: ----------- timecard/trunk/src/main/webapp/WEB-INF/view/employee/errorDownload.jsp -------------- next part -------------- Modified: timecard/trunk/src/main/java/jp/sf/pal/timecard/TimecardConstants.java =================================================================== --- timecard/trunk/src/main/java/jp/sf/pal/timecard/TimecardConstants.java 2008-12-20 13:39:54 UTC (rev 1618) +++ timecard/trunk/src/main/java/jp/sf/pal/timecard/TimecardConstants.java 2008-12-23 01:07:01 UTC (rev 1619) @@ -102,7 +102,12 @@ public static final String SYSTEM_EMAIL = "system.email"; + public static final String CSV_ENCODING = "encoding.csv"; + public static final String DAILY_REPORT_REQUEST_NOTIFICATION_NAME = "daily-report-request.vm"; public static final String MONTHLY_REPORT_REQUEST_NOTIFICATION_NAME = "monthly-report-request.vm"; + + public static final String DOWNLOAD_USER_ID = "downloadUserId"; + } Modified: timecard/trunk/src/main/java/jp/sf/pal/timecard/action/ConfigAction.java =================================================================== --- timecard/trunk/src/main/java/jp/sf/pal/timecard/action/ConfigAction.java 2008-12-20 13:39:54 UTC (rev 1618) +++ timecard/trunk/src/main/java/jp/sf/pal/timecard/action/ConfigAction.java 2008-12-23 01:07:01 UTC (rev 1619) @@ -42,6 +42,8 @@ TimecardConstants.TIME_HOLIDAYS, ""); configForm.defaultManager = ConfigUtil.getString( TimecardConstants.DEFAULT_MANAGER, "admin"); + configForm.csvEncoding = ConfigUtil.getString( + TimecardConstants.CSV_ENCODING, "UTF-8"); return "index.jsp"; } @@ -68,6 +70,8 @@ configForm.holidays); ConfigUtil.setProperty(TimecardConstants.DEFAULT_MANAGER, configForm.defaultManager); + ConfigUtil.setProperty(TimecardConstants.CSV_ENCODING, + configForm.csvEncoding); try { ConfigUtil.save(); SAStrutsUtil.addMessage(request, "success.update_config"); Modified: timecard/trunk/src/main/java/jp/sf/pal/timecard/action/EmployeeAction.java =================================================================== --- timecard/trunk/src/main/java/jp/sf/pal/timecard/action/EmployeeAction.java 2008-12-20 13:39:54 UTC (rev 1618) +++ timecard/trunk/src/main/java/jp/sf/pal/timecard/action/EmployeeAction.java 2008-12-23 01:07:01 UTC (rev 1619) @@ -1,6 +1,7 @@ package jp.sf.pal.timecard.action; import java.io.Serializable; +import java.io.UnsupportedEncodingException; import java.util.ArrayList; import java.util.Date; import java.util.List; @@ -18,6 +19,7 @@ import jp.sf.pal.timecard.dxo.DailyReportDxo; import jp.sf.pal.timecard.form.employee.EmployeeForm; import jp.sf.pal.timecard.service.ReportService; +import jp.sf.pal.timecard.util.ReportUtil; import jp.sf.pal.timecard.util.TimecardUtil; import org.apache.commons.lang.StringUtils; @@ -57,7 +59,7 @@ private transient ServletContext servletContext; protected String displayList() { - String username = request.getRemoteUser(); + employeeForm.userId = request.getRemoteUser(); int year; int month; @@ -79,12 +81,63 @@ employeeForm.month = String.valueOf(month); } - monthlyReport = reportService.getMonthlyReport(username, year, month); + monthlyReport = reportService.getMonthlyReport(employeeForm.userId, + year, month); employeeForm.monthlyReportId = monthlyReport.getId().toString(); + TimecardUtil.setDownloadUserId(request, employeeForm.userId); + return "index.jsp"; } + @Execute(validator = true, input = "errorDownload.jsp", urlPattern = "downloadCsv/{userId}/{year}/{month}") + public String downloadCsv() { + ConfigUtil.init(request); + + String sessionUserId = TimecardUtil.getDownloadUserId(request); + if (!employeeForm.userId.equals(sessionUserId)) { + throw new ActionMessagesException( + "errors.invalid_state_retry_download_csv"); + } + + int year; + int month; + if (employeeForm.year == null || employeeForm.month == null) { + Date now = new Date(); + year = DateUtil.getYear(now) + 1900; + month = DateUtil.getMonth(now) + 1; + employeeForm.year = String.valueOf(year); + employeeForm.month = String.valueOf(month); + } else { + year = Integer.parseInt(employeeForm.year); + month = Integer.parseInt(employeeForm.month); + + // check date + Date tDate = DateUtil.get(year - 1900, month - 1, 1); + year = DateUtil.getYear(tDate) + 1900; + month = DateUtil.getMonth(tDate) + 1; + employeeForm.year = String.valueOf(year); + employeeForm.month = String.valueOf(month); + } + + monthlyReport = reportService.getMonthlyReport(employeeForm.userId, + year, month); + + String reportContent = ReportUtil.getCsvReport(monthlyReport, request + .getLocale()); + byte[] bytes; + try { + bytes = reportContent.getBytes(ConfigUtil.getString( + TimecardConstants.CSV_ENCODING, "UTF-8")); + } catch (UnsupportedEncodingException e) { + bytes = reportContent.getBytes(); + } + ReportUtil.downloadCsv(employeeForm.userId + "_" + year + month + + ".csv", bytes); + + return null; + } + @Execute(validator = false, input = "error.jsp") public String index() { ConfigUtil.init(request); Modified: timecard/trunk/src/main/java/jp/sf/pal/timecard/action/admin/TimecardAction.java =================================================================== --- timecard/trunk/src/main/java/jp/sf/pal/timecard/action/admin/TimecardAction.java 2008-12-20 13:39:54 UTC (rev 1618) +++ timecard/trunk/src/main/java/jp/sf/pal/timecard/action/admin/TimecardAction.java 2008-12-23 01:07:01 UTC (rev 1619) @@ -1,6 +1,7 @@ package jp.sf.pal.timecard.action.admin; import java.io.Serializable; +import java.io.UnsupportedEncodingException; import java.util.ArrayList; import java.util.Date; import java.util.List; @@ -8,6 +9,7 @@ import javax.servlet.http.HttpServletRequest; import jp.sf.pal.timecard.TimecardConstants; +import jp.sf.pal.timecard.common.util.ConfigUtil; import jp.sf.pal.timecard.common.util.DateUtil; import jp.sf.pal.timecard.common.util.SAStrutsUtil; import jp.sf.pal.timecard.db.exentity.DailyReport; @@ -15,6 +17,8 @@ import jp.sf.pal.timecard.dxo.DailyReportDxo; import jp.sf.pal.timecard.form.admin.TimecardForm; import jp.sf.pal.timecard.service.ReportService; +import jp.sf.pal.timecard.util.ReportUtil; +import jp.sf.pal.timecard.util.TimecardUtil; import org.apache.commons.lang.StringUtils; import org.apache.commons.logging.Log; @@ -81,9 +85,62 @@ timecardForm.monthlyReportId = monthlyReport.getId().toString(); timecardForm.status = monthlyReport.getStatus().toString(); + TimecardUtil.setDownloadUserId(request, timecardForm.username); + return "index.jsp"; } + @Execute(validator = true, input = "errorDownload.jsp", urlPattern = "downloadCsv/{username}/{year}/{month}") + public String downloadCsv() { + ConfigUtil.init(request); + + if (timecardForm.username == null) { + throw new ActionMessagesException("errors.invalid_username"); + } + String sessionUserId = TimecardUtil.getDownloadUserId(request); + if (!timecardForm.username.equals(sessionUserId)) { + throw new ActionMessagesException( + "errors.invalid_state_retry_download_csv"); + } + + int year; + int month; + if (timecardForm.year == null || timecardForm.month == null) { + Date now = new Date(); + year = DateUtil.getYear(now) + 1900; + month = DateUtil.getMonth(now) + 1; + timecardForm.year = String.valueOf(year); + timecardForm.month = String.valueOf(month); + } else { + year = Integer.parseInt(timecardForm.year); + month = Integer.parseInt(timecardForm.month); + + // check date + Date tDate = DateUtil.get(year - 1900, month - 1, 1); + year = DateUtil.getYear(tDate) + 1900; + month = DateUtil.getMonth(tDate) + 1; + timecardForm.year = String.valueOf(year); + timecardForm.month = String.valueOf(month); + } + + monthlyReport = reportService.getMonthlyReport(timecardForm.username, + year, month); + + String reportContent = ReportUtil.getCsvReport(monthlyReport, request + .getLocale()); + byte[] bytes; + try { + bytes = reportContent.getBytes(ConfigUtil.getString( + TimecardConstants.CSV_ENCODING, "UTF-8")); + } catch (UnsupportedEncodingException e) { + bytes = reportContent.getBytes(); + } + ReportUtil.downloadCsv(timecardForm.username + "_" + year + month + + ".csv", bytes); + + return null; + } + @Execute(validator = false, input = "error.jsp", urlPattern = "index/{username}") public String index() { return displayList(); Modified: timecard/trunk/src/main/java/jp/sf/pal/timecard/action/manager/TimecardAction.java =================================================================== --- timecard/trunk/src/main/java/jp/sf/pal/timecard/action/manager/TimecardAction.java 2008-12-20 13:39:54 UTC (rev 1618) +++ timecard/trunk/src/main/java/jp/sf/pal/timecard/action/manager/TimecardAction.java 2008-12-23 01:07:01 UTC (rev 1619) @@ -1,6 +1,7 @@ package jp.sf.pal.timecard.action.manager; import java.io.Serializable; +import java.io.UnsupportedEncodingException; import java.util.ArrayList; import java.util.Date; import java.util.List; @@ -8,6 +9,7 @@ import javax.servlet.http.HttpServletRequest; import jp.sf.pal.timecard.TimecardConstants; +import jp.sf.pal.timecard.common.util.ConfigUtil; import jp.sf.pal.timecard.common.util.DateUtil; import jp.sf.pal.timecard.common.util.SAStrutsUtil; import jp.sf.pal.timecard.db.exentity.DailyReport; @@ -15,6 +17,8 @@ import jp.sf.pal.timecard.dxo.DailyReportDxo; import jp.sf.pal.timecard.form.manager.TimecardForm; import jp.sf.pal.timecard.service.ReportService; +import jp.sf.pal.timecard.util.ReportUtil; +import jp.sf.pal.timecard.util.TimecardUtil; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; @@ -80,9 +84,62 @@ timecardForm.monthlyReportId = monthlyReport.getId().toString(); timecardForm.status = monthlyReport.getStatus().toString(); + TimecardUtil.setDownloadUserId(request, timecardForm.username); + return "index.jsp"; } + @Execute(validator = true, input = "errorDownload.jsp", urlPattern = "downloadCsv/{username}/{year}/{month}") + public String downloadCsv() { + ConfigUtil.init(request); + + if (timecardForm.username == null) { + throw new ActionMessagesException("errors.invalid_username"); + } + String sessionUserId = TimecardUtil.getDownloadUserId(request); + if (!timecardForm.username.equals(sessionUserId)) { + throw new ActionMessagesException( + "errors.invalid_state_retry_download_csv"); + } + + int year; + int month; + if (timecardForm.year == null || timecardForm.month == null) { + Date now = new Date(); + year = DateUtil.getYear(now) + 1900; + month = DateUtil.getMonth(now) + 1; + timecardForm.year = String.valueOf(year); + timecardForm.month = String.valueOf(month); + } else { + year = Integer.parseInt(timecardForm.year); + month = Integer.parseInt(timecardForm.month); + + // check date + Date tDate = DateUtil.get(year - 1900, month - 1, 1); + year = DateUtil.getYear(tDate) + 1900; + month = DateUtil.getMonth(tDate) + 1; + timecardForm.year = String.valueOf(year); + timecardForm.month = String.valueOf(month); + } + + monthlyReport = reportService.getMonthlyReport(timecardForm.username, + year, month); + + String reportContent = ReportUtil.getCsvReport(monthlyReport, request + .getLocale()); + byte[] bytes; + try { + bytes = reportContent.getBytes(ConfigUtil.getString( + TimecardConstants.CSV_ENCODING, "UTF-8")); + } catch (UnsupportedEncodingException e) { + bytes = reportContent.getBytes(); + } + ReportUtil.downloadCsv(timecardForm.username + "_" + year + month + + ".csv", bytes); + + return null; + } + @Execute(validator = false, input = "error.jsp", urlPattern = "index/{username}") public String index() { return displayList(); Modified: timecard/trunk/src/main/java/jp/sf/pal/timecard/form/config/ConfigForm.java =================================================================== --- timecard/trunk/src/main/java/jp/sf/pal/timecard/form/config/ConfigForm.java 2008-12-20 13:39:54 UTC (rev 1618) +++ timecard/trunk/src/main/java/jp/sf/pal/timecard/form/config/ConfigForm.java 2008-12-23 01:07:01 UTC (rev 1619) @@ -33,4 +33,7 @@ @Required(target = "update") public String defaultManager; + + @Required(target = "update") + public String csvEncoding; } Modified: timecard/trunk/src/main/java/jp/sf/pal/timecard/form/employee/EmployeeForm.java =================================================================== --- timecard/trunk/src/main/java/jp/sf/pal/timecard/form/employee/EmployeeForm.java 2008-12-20 13:39:54 UTC (rev 1618) +++ timecard/trunk/src/main/java/jp/sf/pal/timecard/form/employee/EmployeeForm.java 2008-12-23 01:07:01 UTC (rev 1619) @@ -21,10 +21,11 @@ @IntegerType public int mode; + @Required(target = "downloadCsv") @IntegerType public String year; - @Required(target = "nextmonth,prevmonth") + @Required(target = "nextmonth,prevmonth,downloadCsv") @IntegerType public String month; @@ -95,6 +96,9 @@ @Required(target = "fixmonthlyreport") public boolean autoFill; + @Required(target = "downloadCsv") + public String userId; + public void initialize() { mode = TimecardConstants.LIST_MODE; id = null; Modified: timecard/trunk/src/main/java/jp/sf/pal/timecard/util/TimecardUtil.java =================================================================== --- timecard/trunk/src/main/java/jp/sf/pal/timecard/util/TimecardUtil.java 2008-12-20 13:39:54 UTC (rev 1618) +++ timecard/trunk/src/main/java/jp/sf/pal/timecard/util/TimecardUtil.java 2008-12-23 01:07:01 UTC (rev 1619) @@ -5,14 +5,33 @@ import java.util.Date; import java.util.TimeZone; +import javax.portlet.PortletSession; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpSession; + import jp.sf.pal.timecard.TimecardConstants; import jp.sf.pal.timecard.common.util.ConfigUtil; import jp.sf.pal.timecard.common.util.DateUtil; +import jp.sf.pal.timecard.common.util.SAStrutsUtil; import jp.sf.pal.timecard.db.exentity.DailyReport; import org.apache.commons.lang.StringUtils; public class TimecardUtil { + + public static void setDownloadUserId(HttpServletRequest request, + String userId) { + PortletSession portletSession = SAStrutsUtil.getPortletSession(request); + portletSession.setAttribute(TimecardConstants.DOWNLOAD_USER_ID, userId, + PortletSession.APPLICATION_SCOPE); + } + + public static String getDownloadUserId(HttpServletRequest request) { + HttpSession session = request.getSession(); + return (String) session + .getAttribute(TimecardConstants.DOWNLOAD_USER_ID); + } + public static String getHours(long time) { Date d = new Date(time); Calendar cal = Calendar.getInstance(TimeZone.getTimeZone("UTC")); Modified: timecard/trunk/src/main/resources/application.properties =================================================================== --- timecard/trunk/src/main/resources/application.properties 2008-12-20 13:39:54 UTC (rev 1618) +++ timecard/trunk/src/main/resources/application.properties 2008-12-23 01:07:01 UTC (rev 1619) @@ -62,6 +62,8 @@ errors.end_time_must_be_after_start_time=End time must be after Start time. +errors.invalid_state_retry_download_csv=Invalid state. Please retry it after reload a page. + labels.detail=Detail labels.create=Create labels.update=Update @@ -115,7 +117,7 @@ labels.start_time=Start time labels.end_time=End time labels.break_time=Break time -labels.otj_time=OTJ time +labels.otj_time=Off-duty time labels.editing=Editing now labels.request=Request labels.recognized=Approved @@ -157,6 +159,7 @@ labels.s_start_time=Start labels.s_end_time=End labels.s_break_time=Break +labels.s_otj_time=Off-duty labels.s_working_time=Time labels.reason=Reason labels.s_working_status=Status @@ -192,9 +195,12 @@ labels.endTimeHr=End Time labels.endTimeMin=End Time labels.isAvailable=Available -labels.otjTimeHr=OTJ Time -labels.otjTimeMin=OTJ Time +labels.otjTimeHr=Off-duty Time +labels.otjTimeMin=Off-duty Time labels.startTimeHr=Start Time labels.startTimeMin=Start Time labels.workingType=Working Type +labels.download_csv=Download CSV +labels.csv_encoding=Encoding for CSV + Modified: timecard/trunk/src/main/resources/application_ja.properties =================================================================== --- timecard/trunk/src/main/resources/application_ja.properties 2008-12-20 13:39:54 UTC (rev 1618) +++ timecard/trunk/src/main/resources/application_ja.properties 2008-12-23 01:07:01 UTC (rev 1619) @@ -55,6 +55,8 @@ errors.end_time_must_be_after_start_time=\u7d42\u4e86\u6642\u9593\u306f\u958b\u59cb\u6642\u9593\u4ee5\u964d\u306b\u3057\u3066\u304f\u3060\u3055\u3044\u3002 +errors.invalid_state_retry_download_csv=\u72b6\u614b\u304c\u6b63\u3057\u304f\u3042\u308a\u307e\u305b\u3093\u3002\u30da\u30fc\u30b8\u3092\u30ea\u30ed\u30fc\u30c9\u5f8c\u3001\u518d\u5ea6\u8a66\u3057\u3066\u304f\u3060\u3055\u3044\u3002 + labels.detail=\u8a73\u7d30 labels.create=\u4f5c\u6210 labels.update=\u66f4\u65b0 @@ -192,3 +194,5 @@ labels.startTimeMin=\u958b\u59cb\u6642\u9593 labels.workingType=\u52e4\u52d9\u72b6\u614b +labels.download_csv=CSV \u3067\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9 +labels.csv_encoding=CSV \u306e\u30a8\u30f3\u30b3\u30fc\u30c7\u30a3\u30f3\u30b0 Modified: timecard/trunk/src/main/webapp/WEB-INF/view/admin/timecard/index.jsp =================================================================== --- timecard/trunk/src/main/webapp/WEB-INF/view/admin/timecard/index.jsp 2008-12-20 13:39:54 UTC (rev 1618) +++ timecard/trunk/src/main/webapp/WEB-INF/view/admin/timecard/index.jsp 2008-12-23 01:07:01 UTC (rev 1619) @@ -80,6 +80,11 @@
${monthlyReport.formattedMntOverTime}
+ +
Modified: timecard/trunk/src/main/webapp/WEB-INF/view/config/index.jsp =================================================================== --- timecard/trunk/src/main/webapp/WEB-INF/view/config/index.jsp 2008-12-20 13:39:54 UTC (rev 1618) +++ timecard/trunk/src/main/webapp/WEB-INF/view/config/index.jsp 2008-12-23 01:07:01 UTC (rev 1619) @@ -57,6 +57,10 @@
${monthlyReport.formattedMntOverTime}
+ +
Modified: timecard/trunk/src/main/webapp/WEB-INF/view/manager/timecard/index.jsp =================================================================== --- timecard/trunk/src/main/webapp/WEB-INF/view/manager/timecard/index.jsp 2008-12-20 13:39:54 UTC (rev 1618) +++ timecard/trunk/src/main/webapp/WEB-INF/view/manager/timecard/index.jsp 2008-12-23 01:07:01 UTC (rev 1619) @@ -80,6 +80,11 @@
${monthlyReport.formattedMntOverTime}
+ +
From svnnotify ¡÷ sourceforge.jp Tue Dec 23 11:59:53 2008 From: svnnotify ¡÷ sourceforge.jp (svnnotify ¡÷ sourceforge.jp) Date: Tue, 23 Dec 2008 11:59:53 +0900 Subject: [pal-cvs 3885] [1620] supported csv download, and minor fixes. Message-ID: <1230001193.009306.3462.nullmailer@users.sourceforge.jp> Revision: 1620 http://svn.sourceforge.jp/view?root=pal&view=rev&rev=1620 Author: shinsuke Date: 2008-12-23 11:59:52 +0900 (Tue, 23 Dec 2008) Log Message: ----------- supported csv download, and minor fixes. Added Paths: ----------- timecard/trunk/src/main/java/jp/sf/pal/timecard/util/ReportUtil.java -------------- next part -------------- Added: timecard/trunk/src/main/java/jp/sf/pal/timecard/util/ReportUtil.java =================================================================== --- timecard/trunk/src/main/java/jp/sf/pal/timecard/util/ReportUtil.java (rev 0) +++ timecard/trunk/src/main/java/jp/sf/pal/timecard/util/ReportUtil.java 2008-12-23 02:59:52 UTC (rev 1620) @@ -0,0 +1,141 @@ +package jp.sf.pal.timecard.util; + +import java.io.IOException; +import java.io.OutputStream; +import java.util.Locale; +import java.util.ResourceBundle; + +import javax.servlet.http.HttpServletResponse; + +import jp.sf.pal.timecard.db.exentity.DailyReport; +import jp.sf.pal.timecard.db.exentity.MonthlyReport; + +import org.seasar.framework.exception.IORuntimeException; +import org.seasar.struts.util.ResponseUtil; + +public class ReportUtil { + public static void downloadCsv(String fileName, byte[] data) { + HttpServletResponse response = ResponseUtil.getResponse(); + try { + response.setContentType("application/x-csv"); + response.setHeader("Content-disposition", "attachment; filename=\"" + + fileName + "\""); + OutputStream out = response.getOutputStream(); + try { + out.write(data); + } finally { + out.close(); + } + } catch (IOException e) { + throw new IORuntimeException(e); + } + } + + public static String getCsvReport(MonthlyReport monthlyReport, Locale locale) { + ResourceBundle resourceBundle = ResourceBundle.getBundle("application", + locale); + + String year = monthlyReport.getYear().toString(); + String month = monthlyReport.getMonth().toString(); + if (month.length() == 1) { + month = "0" + month; + } + StringBuilder sb = new StringBuilder(); + sb.append(resourceBundle.getString("labels.date")); + sb.append(","); + sb.append(resourceBundle.getString("labels.s_start_time")); + sb.append(","); + sb.append(resourceBundle.getString("labels.s_end_time")); + sb.append(","); + sb.append(resourceBundle.getString("labels.s_break_time")); + sb.append(","); + sb.append(resourceBundle.getString("labels.s_otj_time")); + sb.append(","); + sb.append(resourceBundle.getString("labels.s_working_time")); + sb.append(","); + sb.append(resourceBundle.getString("labels.s_working_status")); + sb.append(","); + sb.append(resourceBundle.getString("labels.reason")); + sb.append(","); + sb.append("\r\n"); + for (DailyReport dailyReport : monthlyReport.getDailyReportList()) { + sb.append(year + "/" + month + "/" + + dailyReport.getDate().toString()); + sb.append(","); + sb.append(convertEmptyIfNull(dailyReport.getFormattedStartTime())); + sb.append(","); + sb.append(convertEmptyIfNull(dailyReport.getFormattedEndTime())); + sb.append(","); + sb.append(convertEmptyIfNull(dailyReport.getFormattedBreakTime())); + sb.append(","); + sb.append(convertEmptyIfNull(dailyReport.getFormattedOtjTime())); + sb.append(","); + sb + .append(convertEmptyIfNull(dailyReport + .getFormattedWorkingTime())); + sb.append(","); + sb.append(getWorkTypeLabel(resourceBundle, dailyReport + .getWorkingType())); + sb.append(","); + sb.append("\"" + + convertEmptyIfNull(dailyReport.getMemo()).replaceAll( + "\"", "\"\"") + "\""); + sb.append("\r\n"); + } + return sb.toString(); + } + + private static String convertEmptyIfNull(String value) { + if (value != null) { + return value; + } + return ""; + } + + private static String getWorkTypeLabel(ResourceBundle resourceBundle, + int workingType) { + if (workingType == 1) { + return resourceBundle.getString("labels.ws1"); + } else if (workingType == 2) { + return resourceBundle.getString("labels.ws2"); + } else if (workingType == 3) { + return resourceBundle.getString("labels.ws3"); + } else if (workingType == 4) { + return resourceBundle.getString("labels.ws4"); + } else if (workingType == 200) { + return resourceBundle.getString("labels.ws200"); + } else if (workingType == 100) { + return resourceBundle.getString("labels.ws100"); + } else if (workingType == 101) { + return resourceBundle.getString("labels.ws101"); + } else if (workingType == 102) { + return resourceBundle.getString("labels.ws102"); + } else if (workingType == 20) { + return resourceBundle.getString("labels.ws20"); + } else if (workingType == 21) { + return resourceBundle.getString("labels.ws21"); + } else if (workingType == 22) { + return resourceBundle.getString("labels.ws22"); + } else if (workingType == 30) { + return resourceBundle.getString("labels.ws30"); + } else if (workingType == 31) { + return resourceBundle.getString("labels.ws31"); + } else if (workingType == 32) { + return resourceBundle.getString("labels.ws32"); + } else if (workingType == 40) { + return resourceBundle.getString("labels.ws40"); + } else if (workingType == 41) { + return resourceBundle.getString("labels.ws41"); + } else if (workingType == 42) { + return resourceBundle.getString("labels.ws42"); + } else if (workingType == 110) { + return resourceBundle.getString("labels.ws110"); + } else if (workingType == 111) { + return resourceBundle.getString("labels.ws111"); + } else if (workingType == 112) { + return resourceBundle.getString("labels.ws112"); + } + return ""; + + } +} Property changes on: timecard/trunk/src/main/java/jp/sf/pal/timecard/util/ReportUtil.java ___________________________________________________________________ Name: svn:eol-style + native From svnnotify ¡÷ sourceforge.jp Sat Dec 27 07:10:41 2008 From: svnnotify ¡÷ sourceforge.jp (svnnotify ¡÷ sourceforge.jp) Date: Sat, 27 Dec 2008 07:10:41 +0900 Subject: [pal-cvs 3886] [1621] fixed deadlock problem. Message-ID: <1230329441.086216.16536.nullmailer@users.sourceforge.jp> Revision: 1621 http://svn.sourceforge.jp/view?root=pal&view=rev&rev=1621 Author: shinsuke Date: 2008-12-27 07:10:40 +0900 (Sat, 27 Dec 2008) Log Message: ----------- fixed deadlock problem. Modified Paths: -------------- pal-portal/branches/pal-portal-1.x/portal/jetspeed-2/components/page-manager/src/java/org/apache/jetspeed/om/page/ContentFragmentImpl.java pal-portal/branches/pal-portal-1.x/portal/jetspeed-2/components/page-manager/src/java/org/apache/jetspeed/om/page/resources/ContentFragmentResources.properties pal-portal/branches/pal-portal-1.x/portal/jetspeed-2/components/page-manager/src/java/org/apache/jetspeed/om/page/resources/ContentFragmentResources_en.properties pal-portal/branches/pal-portal-1.x/portal/jetspeed-2/components/page-manager/src/java/org/apache/jetspeed/om/page/resources/ContentFragmentResources_ja.properties pal-portal/branches/pal-portal-1.x/portal/jetspeed-2/components/portal/src/java/org/apache/jetspeed/aggregator/impl/WorkerMonitorImpl.java pal-portal/branches/pal-portal-1.x/portal/jetspeed-2/src/webapp/WEB-INF/assembly/aggregation.xml -------------- next part -------------- Modified: pal-portal/branches/pal-portal-1.x/portal/jetspeed-2/components/page-manager/src/java/org/apache/jetspeed/om/page/ContentFragmentImpl.java =================================================================== --- pal-portal/branches/pal-portal-1.x/portal/jetspeed-2/components/page-manager/src/java/org/apache/jetspeed/om/page/ContentFragmentImpl.java 2008-12-23 02:59:52 UTC (rev 1620) +++ pal-portal/branches/pal-portal-1.x/portal/jetspeed-2/components/page-manager/src/java/org/apache/jetspeed/om/page/ContentFragmentImpl.java 2008-12-26 22:10:40 UTC (rev 1621) @@ -159,7 +159,11 @@ {getId()}; log.log("1100004", args); // REPLACED } - portletContent.wait(); + while (overridenContent != null + && !portletContent.isComplete()) + { + portletContent.wait(1000); + } return portletContent.getContent(); } catch (InterruptedException e) Modified: pal-portal/branches/pal-portal-1.x/portal/jetspeed-2/components/page-manager/src/java/org/apache/jetspeed/om/page/resources/ContentFragmentResources.properties =================================================================== --- pal-portal/branches/pal-portal-1.x/portal/jetspeed-2/components/page-manager/src/java/org/apache/jetspeed/om/page/resources/ContentFragmentResources.properties 2008-12-23 02:59:52 UTC (rev 1620) +++ pal-portal/branches/pal-portal-1.x/portal/jetspeed-2/components/page-manager/src/java/org/apache/jetspeed/om/page/resources/ContentFragmentResources.properties 2008-12-26 22:10:40 UTC (rev 1621) @@ -2,3 +2,4 @@ could.not.access.portlet=Sorry, but we were unable access the requested content. Please contact to a site administrator. out.of.service=The content is not responding and has been taken out of service. access.denied=Access denied. +could.not.access.content.because.of.timeout=Coult not access this content because of a timeout. Please try again later. Modified: pal-portal/branches/pal-portal-1.x/portal/jetspeed-2/components/page-manager/src/java/org/apache/jetspeed/om/page/resources/ContentFragmentResources_en.properties =================================================================== --- pal-portal/branches/pal-portal-1.x/portal/jetspeed-2/components/page-manager/src/java/org/apache/jetspeed/om/page/resources/ContentFragmentResources_en.properties 2008-12-23 02:59:52 UTC (rev 1620) +++ pal-portal/branches/pal-portal-1.x/portal/jetspeed-2/components/page-manager/src/java/org/apache/jetspeed/om/page/resources/ContentFragmentResources_en.properties 2008-12-26 22:10:40 UTC (rev 1621) @@ -2,3 +2,4 @@ could.not.access.portlet=Sorry, but we were unable access the requested content. Please contact to a site administrator. out.of.service=The content is not responding and has been taken out of service. access.denied=Access denied. +could.not.access.content.because.of.timeout=Coult not access this content because of a timeout. Please try again later. Modified: pal-portal/branches/pal-portal-1.x/portal/jetspeed-2/components/page-manager/src/java/org/apache/jetspeed/om/page/resources/ContentFragmentResources_ja.properties =================================================================== --- pal-portal/branches/pal-portal-1.x/portal/jetspeed-2/components/page-manager/src/java/org/apache/jetspeed/om/page/resources/ContentFragmentResources_ja.properties 2008-12-23 02:59:52 UTC (rev 1620) +++ pal-portal/branches/pal-portal-1.x/portal/jetspeed-2/components/page-manager/src/java/org/apache/jetspeed/om/page/resources/ContentFragmentResources_ja.properties 2008-12-26 22:10:40 UTC (rev 1621) @@ -2,3 +2,4 @@ could.not.access.portlet=\u3053\u306e\u30b3\u30f3\u30c6\u30f3\u30c4\u306b\u30a2\u30af\u30bb\u30b9\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u305b\u3093\u3067\u3057\u305f\u3002\u30b5\u30a4\u30c8\u7ba1\u7406\u8005\u306b\u304a\u554f\u3044\u5408\u308f\u305b\u304f\u3060\u3055\u3044\u3002 out.of.service=\u3053\u306e\u30b3\u30f3\u30c6\u30f3\u30c4\u306f\u30b5\u30fc\u30d3\u30b9\u505c\u6b62\u4e2d\u3067\u3059\u3002 access.denied=\u3053\u306e\u30b3\u30f3\u30c6\u30f3\u30c4\u306b\u30a2\u30af\u30bb\u30b9\u3059\u308b\u3053\u3068\u306f\u3067\u304d\u307e\u305b\u3093\u3002 +could.not.access.content.because.of.timeout=\u30bf\u30a4\u30e0\u30a2\u30a6\u30c8\u306b\u3088\u308a\u3001\u3053\u306e\u30b3\u30f3\u30c6\u30f3\u30c4\u3078\u30a2\u30af\u30bb\u30b9\u3067\u304d\u307e\u305b\u3093\u3067\u3057\u305f\u3002\u5f8c\u3067\u518d\u5ea6\u304a\u8a66\u3057\u304f\u3060\u3055\u3044\u3002 Modified: pal-portal/branches/pal-portal-1.x/portal/jetspeed-2/components/portal/src/java/org/apache/jetspeed/aggregator/impl/WorkerMonitorImpl.java =================================================================== --- pal-portal/branches/pal-portal-1.x/portal/jetspeed-2/components/portal/src/java/org/apache/jetspeed/aggregator/impl/WorkerMonitorImpl.java 2008-12-23 02:59:52 UTC (rev 1620) +++ pal-portal/branches/pal-portal-1.x/portal/jetspeed-2/components/portal/src/java/org/apache/jetspeed/aggregator/impl/WorkerMonitorImpl.java 2008-12-26 22:10:40 UTC (rev 1621) @@ -229,6 +229,7 @@ { try { + long now = System.currentTimeMillis(); for (Iterator iter = renderingJobs.iterator(); iter.hasNext();) { RenderingJob job = (RenderingJob) iter.next(); @@ -238,7 +239,28 @@ { if (!portletContent.isComplete()) { - portletContent.wait(); + if (job.getTimeout() == 0) + { + portletContent.wait(); + } + else + { + long remainingTime = job.getTimeout() + - (System.currentTimeMillis() - now); + if (remainingTime <= 0) + { + remainingTime = 1L; + } + portletContent.wait(remainingTime); + if (!portletContent.isComplete()) + { + // Timeout + job + .getFragment() + .overrideRenderedContent( + "could.not.access.content.because.of.timeout"); + } + } } } } @@ -423,27 +445,28 @@ { try { - //if (log.isWarnEnabled()) - //{ - PortletWindow window = job.getWindow(); - ObjectID windowId = (null != window ? window.getId() : null); - //log - // .warn("Portlet Rendering job to be interrupted by timeout (" - // + job.getTimeout() + "ms): " + windowId); - Object[] args = new Object[] - {job.getTimeout(), windowId}; - log.log("1200028", args); // REPLACED - //} - PortletContent content = job.getPortletContent(); synchronized (content) { if (!content.isComplete()) { + //if (log.isWarnEnabled()) + //{ + PortletWindow window = job.getWindow(); + ObjectID windowId = (null != window ? window.getId() + : null); + //log + // .warn("Portlet Rendering job to be interrupted by timeout (" + // + job.getTimeout() + "ms): " + windowId); + Object[] args = new Object[] + {job.getTimeout(), windowId}; + log.log("1200028", args); // REPLACED + //} + worker.interrupt(); // TODO Findbugs - content.wait(); + content.wait(job.getTimeout()); } } Modified: pal-portal/branches/pal-portal-1.x/portal/jetspeed-2/src/webapp/WEB-INF/assembly/aggregation.xml =================================================================== --- pal-portal/branches/pal-portal-1.x/portal/jetspeed-2/src/webapp/WEB-INF/assembly/aggregation.xml 2008-12-23 02:59:52 UTC (rev 1620) +++ pal-portal/branches/pal-portal-1.x/portal/jetspeed-2/src/webapp/WEB-INF/assembly/aggregation.xml 2008-12-26 22:10:40 UTC (rev 1621) @@ -26,7 +26,7 @@ Zero means no portlet timeout option by default. --> - 5000 + 30000 From svnnotify ¡÷ sourceforge.jp Sat Dec 27 07:11:32 2008 From: svnnotify ¡÷ sourceforge.jp (svnnotify ¡÷ sourceforge.jp) Date: Sat, 27 Dec 2008 07:11:32 +0900 Subject: [pal-cvs 3887] [1622] code format. Message-ID: <1230329492.067274.16830.nullmailer@users.sourceforge.jp> Revision: 1622 http://svn.sourceforge.jp/view?root=pal&view=rev&rev=1622 Author: shinsuke Date: 2008-12-27 07:11:31 +0900 (Sat, 27 Dec 2008) Log Message: ----------- code format. Modified Paths: -------------- pal-portal/branches/pal-portal-1.x/portal/jetspeed-2/commons/src/java/org/apache/jetspeed/test/JetspeedTestCase.java pal-portal/branches/pal-portal-1.x/portal/jetspeed-2/components/portal/src/java/org/apache/jetspeed/healthcheck/validators/DataSourcesValidationBean.java pal-portal/branches/pal-portal-1.x/portal/jetspeed-2/components/portal/src/java/org/apache/jetspeed/healthcheck/validators/HealthCheckValidator.java pal-portal/branches/pal-portal-1.x/portal/jetspeed-2/components/portal/src/java/org/apache/jetspeed/healthcheck/validators/HealthCheckValidatorResult.java pal-portal/branches/pal-portal-1.x/portal/jetspeed-2/components/portal/src/java/org/apache/jetspeed/security/impl/shibboleth/ShibbolethConfiguration.java pal-portal/branches/pal-portal-1.x/portal/jetspeed-2/components/portal/src/java/org/apache/jetspeed/security/impl/shibboleth/ShibbolethPortalFilter.java pal-portal/branches/pal-portal-1.x/portal/jetspeed-2/components/portal/src/java/org/apache/jetspeed/tools/pamanager/PortletApplicationManager.java pal-portal/branches/pal-portal-1.x/portal/jetspeed-2/components/portal/src/java/org/apache/jetspeed/util/MimeType.java pal-portal/branches/pal-portal-1.x/portal/jetspeed-2/components/portal/src/java/org/apache/jetspeed/util/descriptor/PortletApplicationDescriptor.java pal-portal/branches/pal-portal-1.x/portal/jetspeed-2/components/registry/src/java/org/apache/jetspeed/om/portlet/impl/PortletDefinitionImpl.java pal-portal/branches/pal-portal-1.x/portal/jetspeed-2/components/registry/src/test/org/apache/jetspeed/components/portletentity/TestPortletEntityDAO.java pal-portal/branches/pal-portal-1.x/portal/jetspeed-2/jetspeed-api/src/java/org/apache/jetspeed/security/GroupManager.java pal-portal/branches/pal-portal-1.x/portal/jetspeed-2/jetspeed-api/src/java/org/apache/jetspeed/security/RoleManager.java -------------- next part -------------- Modified: pal-portal/branches/pal-portal-1.x/portal/jetspeed-2/commons/src/java/org/apache/jetspeed/test/JetspeedTestCase.java =================================================================== --- pal-portal/branches/pal-portal-1.x/portal/jetspeed-2/commons/src/java/org/apache/jetspeed/test/JetspeedTestCase.java 2008-12-26 22:10:40 UTC (rev 1621) +++ pal-portal/branches/pal-portal-1.x/portal/jetspeed-2/commons/src/java/org/apache/jetspeed/test/JetspeedTestCase.java 2008-12-26 22:11:31 UTC (rev 1622) @@ -28,7 +28,9 @@ */ public class JetspeedTestCase extends TestCase { - public static TestSuite createFixturedTestSuite(Class testClass, String firstTest, String lastTest) + + public static TestSuite createFixturedTestSuite(Class testClass, + String firstTest, String lastTest) { // All methods starting with "test" will automatically be executed in the test suite. TestSuite tmp = new TestSuite(testClass); @@ -41,7 +43,7 @@ } while (e.hasMoreElements()) { - ts.addTest((Test)e.nextElement()); + ts.addTest((Test) e.nextElement()); } if (lastTest != null) { @@ -52,7 +54,7 @@ } private String baseDir; - + public JetspeedTestCase() { super(); @@ -62,7 +64,7 @@ { super(name); } - + public String getBaseDir() { if (baseDir == null) Modified: pal-portal/branches/pal-portal-1.x/portal/jetspeed-2/components/portal/src/java/org/apache/jetspeed/healthcheck/validators/DataSourcesValidationBean.java =================================================================== --- pal-portal/branches/pal-portal-1.x/portal/jetspeed-2/components/portal/src/java/org/apache/jetspeed/healthcheck/validators/DataSourcesValidationBean.java 2008-12-26 22:10:40 UTC (rev 1621) +++ pal-portal/branches/pal-portal-1.x/portal/jetspeed-2/components/portal/src/java/org/apache/jetspeed/healthcheck/validators/DataSourcesValidationBean.java 2008-12-26 22:11:31 UTC (rev 1622) @@ -26,10 +26,12 @@ */ public class DataSourcesValidationBean { + /** * The SQL query. */ private String validationQuery; + /** * List of datasources. */ Modified: pal-portal/branches/pal-portal-1.x/portal/jetspeed-2/components/portal/src/java/org/apache/jetspeed/healthcheck/validators/HealthCheckValidator.java =================================================================== --- pal-portal/branches/pal-portal-1.x/portal/jetspeed-2/components/portal/src/java/org/apache/jetspeed/healthcheck/validators/HealthCheckValidator.java 2008-12-26 22:10:40 UTC (rev 1621) +++ pal-portal/branches/pal-portal-1.x/portal/jetspeed-2/components/portal/src/java/org/apache/jetspeed/healthcheck/validators/HealthCheckValidator.java 2008-12-26 22:11:31 UTC (rev 1622) @@ -26,8 +26,9 @@ */ public interface HealthCheckValidator { + static final String LINE_SEPARATOR = System.getProperty("line.separator"); - + /** * This method performs the validation and returns the status of the execution * Modified: pal-portal/branches/pal-portal-1.x/portal/jetspeed-2/components/portal/src/java/org/apache/jetspeed/healthcheck/validators/HealthCheckValidatorResult.java =================================================================== --- pal-portal/branches/pal-portal-1.x/portal/jetspeed-2/components/portal/src/java/org/apache/jetspeed/healthcheck/validators/HealthCheckValidatorResult.java 2008-12-26 22:10:40 UTC (rev 1621) +++ pal-portal/branches/pal-portal-1.x/portal/jetspeed-2/components/portal/src/java/org/apache/jetspeed/healthcheck/validators/HealthCheckValidatorResult.java 2008-12-26 22:11:31 UTC (rev 1622) @@ -24,6 +24,7 @@ */ public class HealthCheckValidatorResult { + /** * Validator constant which indicates a successful validation */ @@ -50,7 +51,8 @@ this.resultMessage = ""; } - public HealthCheckValidatorResult(int healthCheckResult, String resultMessage) + public HealthCheckValidatorResult(int healthCheckResult, + String resultMessage) { this.healthCheckResult = healthCheckResult; this.resultMessage = resultMessage; Modified: pal-portal/branches/pal-portal-1.x/portal/jetspeed-2/components/portal/src/java/org/apache/jetspeed/security/impl/shibboleth/ShibbolethConfiguration.java =================================================================== --- pal-portal/branches/pal-portal-1.x/portal/jetspeed-2/components/portal/src/java/org/apache/jetspeed/security/impl/shibboleth/ShibbolethConfiguration.java 2008-12-26 22:10:40 UTC (rev 1621) +++ pal-portal/branches/pal-portal-1.x/portal/jetspeed-2/components/portal/src/java/org/apache/jetspeed/security/impl/shibboleth/ShibbolethConfiguration.java 2008-12-26 22:11:31 UTC (rev 1622) @@ -21,20 +21,24 @@ import org.apache.jetspeed.administration.PortalConfiguration; import org.apache.jetspeed.administration.PortalConfigurationConstants; - public class ShibbolethConfiguration { + public static final String USERNAME = "username"; - + private Map headerMapping; + private boolean authenticate; + private String guestUser; - - public ShibbolethConfiguration(Map headerMapping, boolean authenticate, PortalConfiguration config) + + public ShibbolethConfiguration(Map headerMapping, + boolean authenticate, PortalConfiguration config) { this.headerMapping = headerMapping; this.authenticate = authenticate; - this.guestUser = config.getString(PortalConfigurationConstants.USERS_DEFAULT_GUEST); + this.guestUser = config + .getString(PortalConfigurationConstants.USERS_DEFAULT_GUEST); } public boolean isAuthenticate() @@ -42,17 +46,14 @@ return authenticate; } - public Map getHeaderMapping() { return headerMapping; } - public String getGuestUser() { return guestUser; } - - + } Modified: pal-portal/branches/pal-portal-1.x/portal/jetspeed-2/components/portal/src/java/org/apache/jetspeed/security/impl/shibboleth/ShibbolethPortalFilter.java =================================================================== --- pal-portal/branches/pal-portal-1.x/portal/jetspeed-2/components/portal/src/java/org/apache/jetspeed/security/impl/shibboleth/ShibbolethPortalFilter.java 2008-12-26 22:10:40 UTC (rev 1621) +++ pal-portal/branches/pal-portal-1.x/portal/jetspeed-2/components/portal/src/java/org/apache/jetspeed/security/impl/shibboleth/ShibbolethPortalFilter.java 2008-12-26 22:11:31 UTC (rev 1622) @@ -47,40 +47,48 @@ public class ShibbolethPortalFilter implements Filter { + protected String userNameHeader; + protected Object sem = new Object(); - + public void init(FilterConfig filterConfig) throws ServletException { } - public void doFilter(ServletRequest sRequest, - ServletResponse sResponse, FilterChain filterChain) - throws IOException, ServletException + public void doFilter(ServletRequest sRequest, ServletResponse sResponse, + FilterChain filterChain) throws IOException, ServletException { if (sRequest instanceof HttpServletRequest) { - HttpServletRequest request = (HttpServletRequest)sRequest; + HttpServletRequest request = (HttpServletRequest) sRequest; if (userNameHeader == null) { synchronized (sem) { - ShibbolethConfiguration config = (ShibbolethConfiguration)Jetspeed.getComponentManager().getComponent("org.apache.jetspeed.security.shibboleth.ShibbolethConfiguration"); - userNameHeader = config.getHeaderMapping().get(ShibbolethConfiguration.USERNAME); + ShibbolethConfiguration config = (ShibbolethConfiguration) Jetspeed + .getComponentManager() + .getComponent( + "org.apache.jetspeed.security.shibboleth.ShibbolethConfiguration"); + userNameHeader = config.getHeaderMapping().get( + ShibbolethConfiguration.USERNAME); } } - String username = request.getHeader(userNameHeader); + String username = request.getHeader(userNameHeader); if (username != null) { - Subject subject = (Subject)request.getSession().getAttribute(PortalReservedParameters.SESSION_KEY_SUBJECT); + Subject subject = (Subject) request.getSession().getAttribute( + PortalReservedParameters.SESSION_KEY_SUBJECT); if (subject != null) { - Principal principal = SecurityHelper.getPrincipal(subject, UserPrincipal.class); + Principal principal = SecurityHelper.getPrincipal(subject, + UserPrincipal.class); if (principal != null) { if (principal.getName().equals(username)) { - sRequest = wrapperRequest(request, subject, principal); + sRequest = wrapperRequest(request, subject, + principal); if (filterChain != null) { filterChain.doFilter(sRequest, sResponse); @@ -89,9 +97,16 @@ } } } - UserManager userManager = (UserManager)Jetspeed.getComponentManager().getComponent("org.apache.jetspeed.security.UserManager"); - AuditActivity audit = (AuditActivity)Jetspeed.getComponentManager().getComponent("org.apache.jetspeed.audit.AuditActivity"); - ShibbolethConfiguration config = (ShibbolethConfiguration)Jetspeed.getComponentManager().getComponent("org.apache.jetspeed.security.shibboleth.ShibbolethConfiguration"); + UserManager userManager = (UserManager) Jetspeed + .getComponentManager().getComponent( + "org.apache.jetspeed.security.UserManager"); + AuditActivity audit = (AuditActivity) Jetspeed + .getComponentManager().getComponent( + "org.apache.jetspeed.audit.AuditActivity"); + ShibbolethConfiguration config = (ShibbolethConfiguration) Jetspeed + .getComponentManager() + .getComponent( + "org.apache.jetspeed.security.shibboleth.ShibbolethConfiguration"); boolean success = false; if (config.isAuthenticate()) { @@ -112,13 +127,17 @@ catch (SecurityException sex) { success = false; - } + } } if (success) { - audit.logUserActivity(username, request.getRemoteAddr(), AuditActivity.AUTHENTICATION_SUCCESS, "ShibbolethFilter"); - PortalAuthenticationConfiguration authenticationConfiguration = (PortalAuthenticationConfiguration) - Jetspeed.getComponentManager().getComponent("org.apache.jetspeed.administration.PortalAuthenticationConfiguration"); + audit.logUserActivity(username, request.getRemoteAddr(), + AuditActivity.AUTHENTICATION_SUCCESS, + "ShibbolethFilter"); + PortalAuthenticationConfiguration authenticationConfiguration = (PortalAuthenticationConfiguration) Jetspeed + .getComponentManager() + .getComponent( + "org.apache.jetspeed.administration.PortalAuthenticationConfiguration"); if (authenticationConfiguration.isCreateNewSessionOnLogin()) { request.getSession().invalidate(); @@ -128,62 +147,81 @@ { // load the user principals (roles, groups, credentials) User user = userManager.getUser(username); - if ( user != null ) + if (user != null) { subject = user.getSubject(); } } catch (SecurityException sex) { - } + } if (subject == null) { Set principals = new PrincipalsSet(); - UserSubjectPrincipalImpl userPrincipal = new UserSubjectPrincipalImpl(username); + UserSubjectPrincipalImpl userPrincipal = new UserSubjectPrincipalImpl( + username); principals.add(userPrincipal); - subject = new Subject(true, principals, new HashSet(), new HashSet()); + subject = new Subject(true, principals, new HashSet(), + new HashSet()); userPrincipal.setSubject(subject); } - Principal principal = SecurityHelper.getPrincipal(subject, UserPrincipal.class); + Principal principal = SecurityHelper.getPrincipal(subject, + UserPrincipal.class); sRequest = wrapperRequest(request, subject, principal); - request.getSession().removeAttribute(LoginConstants.ERRORCODE); + request.getSession().removeAttribute( + LoginConstants.ERRORCODE); HttpSession session = request.getSession(true); - session.setAttribute(PortalReservedParameters.SESSION_KEY_SUBJECT, subject); + session.setAttribute( + PortalReservedParameters.SESSION_KEY_SUBJECT, + subject); } else { - audit.logUserActivity(username, request.getRemoteAddr(), AuditActivity.AUTHENTICATION_FAILURE, "ShibbolethFilter"); - request.getSession().setAttribute(LoginConstants.ERRORCODE, LoginConstants.ERROR_INVALID_PASSWORD); + audit.logUserActivity(username, request.getRemoteAddr(), + AuditActivity.AUTHENTICATION_FAILURE, + "ShibbolethFilter"); + request.getSession().setAttribute(LoginConstants.ERRORCODE, + LoginConstants.ERROR_INVALID_PASSWORD); } } else { - Subject subject = (Subject)request.getSession().getAttribute(PortalReservedParameters.SESSION_KEY_SUBJECT); + Subject subject = (Subject) request.getSession().getAttribute( + PortalReservedParameters.SESSION_KEY_SUBJECT); if (subject != null) { - Principal principal = SecurityHelper.getPrincipal(subject, UserPrincipal.class); - ShibbolethConfiguration config = (ShibbolethConfiguration)Jetspeed.getComponentManager().getComponent("org.apache.jetspeed.security.shibboleth.ShibbolethConfiguration"); - if (principal != null && principal.getName().equals(config.getGuestUser())) - { + Principal principal = SecurityHelper.getPrincipal(subject, + UserPrincipal.class); + ShibbolethConfiguration config = (ShibbolethConfiguration) Jetspeed + .getComponentManager() + .getComponent( + "org.apache.jetspeed.security.shibboleth.ShibbolethConfiguration"); + if (principal != null + && principal.getName() + .equals(config.getGuestUser())) + { } else { sRequest = wrapperRequest(request, subject, principal); } - } - } - sRequest.setAttribute(PortalReservedParameters.PORTAL_FILTER_ATTRIBUTE, "true"); + } + } + sRequest.setAttribute( + PortalReservedParameters.PORTAL_FILTER_ATTRIBUTE, "true"); } - + if (filterChain != null) { filterChain.doFilter(sRequest, sResponse); } } - - private ServletRequest wrapperRequest(HttpServletRequest request, Subject subject, Principal principal) + + private ServletRequest wrapperRequest(HttpServletRequest request, + Subject subject, Principal principal) { - PortalRequestWrapper wrapper = new PortalRequestWrapper(request, subject, principal); + PortalRequestWrapper wrapper = new PortalRequestWrapper(request, + subject, principal); return wrapper; } Modified: pal-portal/branches/pal-portal-1.x/portal/jetspeed-2/components/portal/src/java/org/apache/jetspeed/tools/pamanager/PortletApplicationManager.java =================================================================== --- pal-portal/branches/pal-portal-1.x/portal/jetspeed-2/components/portal/src/java/org/apache/jetspeed/tools/pamanager/PortletApplicationManager.java 2008-12-26 22:10:40 UTC (rev 1621) +++ pal-portal/branches/pal-portal-1.x/portal/jetspeed-2/components/portal/src/java/org/apache/jetspeed/tools/pamanager/PortletApplicationManager.java 2008-12-26 22:11:31 UTC (rev 1622) @@ -665,7 +665,8 @@ log.log("1200240", args); // REPLACED } //throw new RegistryException(msg); - throw new RegistryException(log.getString("1200240", args)); + throw new RegistryException(log.getString("1200240", + args)); } } @@ -1025,7 +1026,8 @@ {entity.getId()}; log.log("1200260", args, e); // REPLACED //throw new RegistryException(msg, e); - throw new RegistryException(log.getString("1200260", args), e); + throw new RegistryException(log.getString("1200260", + args), e); } } Modified: pal-portal/branches/pal-portal-1.x/portal/jetspeed-2/components/portal/src/java/org/apache/jetspeed/util/MimeType.java =================================================================== --- pal-portal/branches/pal-portal-1.x/portal/jetspeed-2/components/portal/src/java/org/apache/jetspeed/util/MimeType.java 2008-12-26 22:10:40 UTC (rev 1621) +++ pal-portal/branches/pal-portal-1.x/portal/jetspeed-2/components/portal/src/java/org/apache/jetspeed/util/MimeType.java 2008-12-26 22:11:31 UTC (rev 1622) @@ -32,12 +32,9 @@ */ public class MimeType { + // FIXME + public static final MimeType HTML = new MimeType("text/html", "UTF-8"); - public static final MimeType HTML = new MimeType("text/html", "UTF-8"); // FIXME - // : - - // test - public static final MimeType XHTML = new MimeType("text/xhtml"); public static final MimeType WML = new MimeType("text/vnd.wap.wml"); Modified: pal-portal/branches/pal-portal-1.x/portal/jetspeed-2/components/portal/src/java/org/apache/jetspeed/util/descriptor/PortletApplicationDescriptor.java =================================================================== --- pal-portal/branches/pal-portal-1.x/portal/jetspeed-2/components/portal/src/java/org/apache/jetspeed/util/descriptor/PortletApplicationDescriptor.java 2008-12-26 22:10:40 UTC (rev 1621) +++ pal-portal/branches/pal-portal-1.x/portal/jetspeed-2/components/portal/src/java/org/apache/jetspeed/util/descriptor/PortletApplicationDescriptor.java 2008-12-26 22:11:31 UTC (rev 1622) @@ -336,8 +336,8 @@ {roleName, portlet.getName()}; log.log("1200286", args); // REPLACED //throw new PortletApplicationException(errorMsg); - throw new PortletApplicationException(log - .getString("1200286", args)); + throw new PortletApplicationException(log.getString( + "1200286", args)); } } } Modified: pal-portal/branches/pal-portal-1.x/portal/jetspeed-2/components/registry/src/java/org/apache/jetspeed/om/portlet/impl/PortletDefinitionImpl.java =================================================================== --- pal-portal/branches/pal-portal-1.x/portal/jetspeed-2/components/registry/src/java/org/apache/jetspeed/om/portlet/impl/PortletDefinitionImpl.java 2008-12-26 22:10:40 UTC (rev 1621) +++ pal-portal/branches/pal-portal-1.x/portal/jetspeed-2/components/registry/src/java/org/apache/jetspeed/om/portlet/impl/PortletDefinitionImpl.java 2008-12-26 22:11:31 UTC (rev 1622) @@ -433,32 +433,32 @@ * public void addUserAttribute(UserAttribute userAttribute) { * this.userAttributeSet.add(userAttribute); } *//** - * @see org.apache.jetspeed.om.common.portlet.PortletDefinitionComposite#setUserAttributeSet(java.util.Collection) - */ + * @see org.apache.jetspeed.om.common.portlet.PortletDefinitionComposite#setUserAttributeSet(java.util.Collection) + */ /* * public void setUserAttributeSet(Collection userAttributeSet) { * this.userAttributeSet = userAttributeSet; } *//** - * @see org.apache.jetspeed.om.common.portlet.PortletDefinitionComposite#getUserAttributeSet() - */ + * @see org.apache.jetspeed.om.common.portlet.PortletDefinitionComposite#getUserAttributeSet() + */ /* * public Collection getUserAttributeSet() { return this.userAttributeSet; } *//** - * @see org.apache.jetspeed.om.common.portlet.PortletDefinitionComposite#addUserAttributeRef(org.apache.jetspeed.om.common.UserAttributeRef) - */ + * @see org.apache.jetspeed.om.common.portlet.PortletDefinitionComposite#addUserAttributeRef(org.apache.jetspeed.om.common.UserAttributeRef) + */ /* * public void addUserAttributeRef(UserAttributeRef userAttributeRef) { * System.out.println("_______IN addUserAttributeRef"); * this.userAttributeRefSet.add(userAttributeRef); } *//** - * @see org.apache.jetspeed.om.common.portlet.PortletDefinitionComposite#setUserAttributeSet(java.util.Collection) - */ + * @see org.apache.jetspeed.om.common.portlet.PortletDefinitionComposite#setUserAttributeSet(java.util.Collection) + */ /* * public void setUserAttributeRefSet(Collection userAttributeRefSet) { * this.userAttributeRefSet = userAttributeRefSet; } *//** - * @see org.apache.jetspeed.om.common.portlet.PortletDefinitionComposite#getUserAttributeRefSet() - */ + * @see org.apache.jetspeed.om.common.portlet.PortletDefinitionComposite#getUserAttributeRefSet() + */ /* * public Collection getUserAttributeRefSet() { return * this.userAttributeRefSet; } Modified: pal-portal/branches/pal-portal-1.x/portal/jetspeed-2/components/registry/src/test/org/apache/jetspeed/components/portletentity/TestPortletEntityDAO.java =================================================================== --- pal-portal/branches/pal-portal-1.x/portal/jetspeed-2/components/registry/src/test/org/apache/jetspeed/components/portletentity/TestPortletEntityDAO.java 2008-12-26 22:10:40 UTC (rev 1621) +++ pal-portal/branches/pal-portal-1.x/portal/jetspeed-2/components/registry/src/test/org/apache/jetspeed/components/portletentity/TestPortletEntityDAO.java 2008-12-26 22:11:31 UTC (rev 1622) @@ -91,13 +91,7 @@ .getPortletApplication(TEST_APP); assertNotNull("Portlet Application", pa); System.out.println("pa = " + pa.getId()); - PortletDefinitionList portlets = pa.getPortletDefinitionList(); // .get( - // JetspeedObjectID - // . - // createFromString - // ( - // TEST_PORTLET - // )); + PortletDefinitionList portlets = pa.getPortletDefinitionList(); Iterator pi = portlets.iterator(); PortletDefinitionComposite pd = null; while (pi.hasNext()) Modified: pal-portal/branches/pal-portal-1.x/portal/jetspeed-2/jetspeed-api/src/java/org/apache/jetspeed/security/GroupManager.java =================================================================== --- pal-portal/branches/pal-portal-1.x/portal/jetspeed-2/jetspeed-api/src/java/org/apache/jetspeed/security/GroupManager.java 2008-12-26 22:10:40 UTC (rev 1621) +++ pal-portal/branches/pal-portal-1.x/portal/jetspeed-2/jetspeed-api/src/java/org/apache/jetspeed/security/GroupManager.java 2008-12-26 22:11:31 UTC (rev 1622) @@ -18,6 +18,7 @@ import java.util.Collection; import java.util.Iterator; +import java.util.prefs.Preferences; /** *

Modified: pal-portal/branches/pal-portal-1.x/portal/jetspeed-2/jetspeed-api/src/java/org/apache/jetspeed/security/RoleManager.java =================================================================== --- pal-portal/branches/pal-portal-1.x/portal/jetspeed-2/jetspeed-api/src/java/org/apache/jetspeed/security/RoleManager.java 2008-12-26 22:10:40 UTC (rev 1621) +++ pal-portal/branches/pal-portal-1.x/portal/jetspeed-2/jetspeed-api/src/java/org/apache/jetspeed/security/RoleManager.java 2008-12-26 22:11:31 UTC (rev 1622) @@ -16,8 +16,9 @@ */ package org.apache.jetspeed.security; +import java.util.Collection; import java.util.Iterator; -import java.util.Collection; +import java.util.prefs.Preferences; /** *

From svnnotify ¡÷ sourceforge.jp Sun Dec 28 07:02:57 2008 From: svnnotify ¡÷ sourceforge.jp (svnnotify ¡÷ sourceforge.jp) Date: Sun, 28 Dec 2008 07:02:57 +0900 Subject: [pal-cvs 3888] [1623] added status column to userinfo table. Message-ID: <1230415377.062947.523.nullmailer@users.sourceforge.jp> Revision: 1623 http://svn.sourceforge.jp/view?root=pal&view=rev&rev=1623 Author: shinsuke Date: 2008-12-28 07:02:56 +0900 (Sun, 28 Dec 2008) Log Message: ----------- added status column to userinfo table. replaced with dbflute 0.8.7. Modified Paths: -------------- userinfo/trunk/dbflute/_project.bat userinfo/trunk/dbflute/_project.sh userinfo/trunk/dbflute/build-userinfo.properties userinfo/trunk/mydbflute/README.txt userinfo/trunk/src/main/config/erd/userinfo.erd userinfo/trunk/src/main/config/sql/others/0-userinfo.dml userinfo/trunk/src/main/config/sql/userinfo.ddl userinfo/trunk/src/main/java/jp/sf/pal/userinfo/UserInfoConstants.java userinfo/trunk/src/main/java/jp/sf/pal/userinfo/action/UserInfoAction.java userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/BehaviorSelector.java userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/CacheBehaviorSelector.java userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/DBFluteConfig.java userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/EntityDefinedCommonColumn.java userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/bhv/AbstractBehaviorReadable.java userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/bhv/AbstractBehaviorWritable.java userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/bhv/BehaviorReadable.java userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/bhv/BehaviorWritable.java userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/cbean/AbstractConditionBean.java userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/cbean/AbstractConditionQuery.java userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/cbean/ConditionBean.java userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/cbean/ConditionBeanContext.java userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/cbean/ConditionQuery.java userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/cbean/ckey/ConditionKey.java userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/cbean/coption/FromToOption.java userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/cbean/coption/LikeSearchOption.java userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/cbean/cvalue/ConditionValue.java userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/cbean/outsidesql/OutsideSqlContext.java userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/cbean/outsidesql/OutsideSqlOption.java userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/cbean/outsidesql/executor/OutsideSqlBasicExecutor.java userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/cbean/outsidesql/executor/OutsideSqlCursorExecutor.java userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/cbean/outsidesql/executor/OutsideSqlEntityExecutor.java userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/cbean/outsidesql/executor/OutsideSqlPagingExecutor.java userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/cbean/sqlclause/AbstractSqlClause.java userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/cbean/sqlclause/SqlClause.java userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/cbean/sqlclause/SqlClauseOracle.java userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/dbmeta/AbstractDBMeta.java userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/dbmeta/DBMeta.java userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/dbmeta/DBMetaInstanceHandler.java userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/dbmeta/hierarchy/HierarchyArranger.java userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/dbmeta/hierarchy/HierarchyRequest.java userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/dbmeta/hierarchy/HierarchyRequestElement.java userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/dbmeta/hierarchy/HierarchySourceColumn.java userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/dbmeta/hierarchy/HierarchySourceIterator.java userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/dbmeta/hierarchy/HierarchySourceRow.java userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/dbmeta/info/ColumnInfo.java userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/dbmeta/info/RelationInfo.java userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/helper/MapStringBuilderImpl.java userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/s2dao/FetchNarrowingResultSetWrapper.java userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/s2dao/internal/rshandler/InternalAbstractDtoMetaDataResultSetHandler.java userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/s2dao/internal/sqlcommand/InternalAbstractAutoStaticCommand.java userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/s2dao/internal/sqlcommand/InternalAbstractBatchAutoStaticCommand.java userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/s2dao/internal/sqlcommand/InternalAbstractDynamicCommand.java userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/s2dao/internal/sqlcommand/InternalAbstractSqlCommand.java userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/s2dao/internal/sqlcommand/InternalDeleteAutoStaticCommand.java userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/s2dao/internal/sqlcommand/InternalDeleteBatchAutoStaticCommand.java userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/s2dao/internal/sqlcommand/InternalDeleteQueryAutoDynamicCommand.java userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/s2dao/internal/sqlcommand/InternalInsertAutoDynamicCommand.java userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/s2dao/internal/sqlcommand/InternalInsertBatchAutoStaticCommand.java userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/s2dao/internal/sqlcommand/InternalProcedureCommand.java userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/s2dao/internal/sqlcommand/InternalUpdateAutoDynamicCommand.java userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/s2dao/internal/sqlcommand/InternalUpdateBatchAutoStaticCommand.java userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/s2dao/internal/sqlcommand/InternalUpdateDynamicCommand.java userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/s2dao/internal/sqlcommand/InternalUpdateQueryAutoDynamicCommand.java userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/s2dao/internal/sqlhandler/InternalAbstractAutoHandler.java userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/s2dao/internal/sqlhandler/InternalAbstractBatchAutoHandler.java userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/s2dao/internal/sqlhandler/InternalBasicHandler.java userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/s2dao/internal/sqlhandler/InternalBasicSelectHandler.java userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/s2dao/internal/sqlhandler/InternalBasicUpdateHandler.java userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/s2dao/internal/sqlhandler/InternalInsertAutoHandler.java userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/s2dao/internal/sqlhandler/InternalInsertBatchAutoHandler.java userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/s2dao/internal/sqlhandler/InternalProcedureHandler.java userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/s2dao/internal/sqlhandler/InternalUpdateAutoHandler.java userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/s2dao/internal/sqlparser/InternalSqlParser.java userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/s2dao/internal/various/InternalProcedureMetaDataFactory.java userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/util/SimpleAssertUtil.java userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/util/SimpleStringUtil.java userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/util/SimpleSystemUtil.java userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/bsbhv/BsGroupInfoBhv.java userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/bsbhv/BsGroupMappingBhv.java userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/bsbhv/BsRoleInfoBhv.java userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/bsbhv/BsRoleMappingBhv.java userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/bsbhv/BsUserInfoBhv.java userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/bsentity/BsGroupInfo.java userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/bsentity/BsGroupMapping.java userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/bsentity/BsRoleInfo.java userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/bsentity/BsRoleMapping.java userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/bsentity/BsUserInfo.java userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/bsentity/dbmeta/GroupInfoDbm.java userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/bsentity/dbmeta/GroupMappingDbm.java userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/bsentity/dbmeta/RoleInfoDbm.java userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/bsentity/dbmeta/RoleMappingDbm.java userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/bsentity/dbmeta/UserInfoDbm.java userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/cbean/bs/BsGroupInfoCB.java userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/cbean/bs/BsGroupMappingCB.java userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/cbean/bs/BsRoleInfoCB.java userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/cbean/bs/BsRoleMappingCB.java userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/cbean/bs/BsUserInfoCB.java userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/cbean/cq/bs/AbstractBsGroupInfoCQ.java userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/cbean/cq/bs/AbstractBsGroupMappingCQ.java userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/cbean/cq/bs/AbstractBsRoleInfoCQ.java userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/cbean/cq/bs/AbstractBsRoleMappingCQ.java userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/cbean/cq/bs/AbstractBsUserInfoCQ.java userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/cbean/cq/bs/BsGroupInfoCQ.java userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/cbean/cq/bs/BsGroupMappingCQ.java userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/cbean/cq/bs/BsRoleInfoCQ.java userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/cbean/cq/bs/BsRoleMappingCQ.java userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/cbean/cq/bs/BsUserInfoCQ.java userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/cbean/cq/ciq/GroupInfoCIQ.java userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/cbean/cq/ciq/GroupMappingCIQ.java userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/cbean/cq/ciq/RoleInfoCIQ.java userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/cbean/cq/ciq/RoleMappingCIQ.java userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/cbean/cq/ciq/UserInfoCIQ.java userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/cbean/nss/GroupInfoNss.java userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/cbean/nss/GroupMappingNss.java userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/cbean/nss/RoleInfoNss.java userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/cbean/nss/RoleMappingNss.java userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/cbean/nss/UserInfoNss.java userinfo/trunk/src/main/java/jp/sf/pal/userinfo/dxo/UserInfoDxo.java userinfo/trunk/src/main/java/jp/sf/pal/userinfo/form/UserInfoForm.java userinfo/trunk/src/main/java/jp/sf/pal/userinfo/pager/UserInfoPager.java userinfo/trunk/src/main/java/jp/sf/pal/userinfo/service/UserInfoService.java userinfo/trunk/src/main/resources/application.properties userinfo/trunk/src/main/resources/application_ja.properties userinfo/trunk/src/main/resources/dbflute.dicon userinfo/trunk/src/main/webapp/WEB-INF/db/userinfo.1.log.db userinfo/trunk/src/main/webapp/WEB-INF/db/userinfo.data.db userinfo/trunk/src/main/webapp/WEB-INF/view/userInfo/confirm.jsp userinfo/trunk/src/main/webapp/WEB-INF/view/userInfo/edit.jsp userinfo/trunk/src/main/webapp/WEB-INF/view/userInfo/grouplist.jsp userinfo/trunk/src/main/webapp/WEB-INF/view/userInfo/index.jsp userinfo/trunk/src/main/webapp/WEB-INF/view/userInfo/rolelist.jsp Added Paths: ----------- userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/CommonColumnAutoSetupper.java userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/CommonColumnBasicAutoSetupper.java userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/DBDef.java userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/bhv/core/ userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/bhv/core/BehaviorCommand.java userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/bhv/core/BehaviorCommandComponentSetup.java userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/bhv/core/BehaviorCommandInvoker.java userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/bhv/core/BehaviorInitializer.java userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/bhv/core/SqlExecution.java userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/bhv/core/SqlExecutionCreator.java userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/bhv/core/command/ userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/bhv/core/command/AbstractBehaviorCommand.java userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/bhv/core/command/AbstractEntityCommand.java userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/bhv/core/command/AbstractListEntityCommand.java userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/bhv/core/command/AbstractOutsideSqlCommand.java userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/bhv/core/command/AbstractOutsideSqlSelectCommand.java userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/bhv/core/command/AbstractSelectCBCommand.java userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/bhv/core/command/BatchDeleteEntityCommand.java userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/bhv/core/command/BatchDeleteNonstrictEntityCommand.java userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/bhv/core/command/BatchInsertEntityCommand.java userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/bhv/core/command/BatchUpdateEntityCommand.java userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/bhv/core/command/BatchUpdateNonstrictEntityCommand.java userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/bhv/core/command/DeleteEntityCommand.java userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/bhv/core/command/DeleteNonstrictEntityCommand.java userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/bhv/core/command/InsertEntityCommand.java userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/bhv/core/command/OutsideSqlCallCommand.java userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/bhv/core/command/OutsideSqlExecuteCommand.java userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/bhv/core/command/OutsideSqlSelectCursorCommand.java userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/bhv/core/command/OutsideSqlSelectListCommand.java userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/bhv/core/command/QueryDeleteCBCommand.java userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/bhv/core/command/QueryUpdateEntityCBCommand.java userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/bhv/core/command/SelectCountCBCommand.java userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/bhv/core/command/SelectListCBCommand.java userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/bhv/core/command/SelectNextValCommand.java userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/bhv/core/command/SelectScalarCBCommand.java userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/bhv/core/command/UpdateEntityCommand.java userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/bhv/core/command/UpdateNonstrictEntityCommand.java userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/bhv/core/execution/ userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/bhv/core/execution/BasicSelectExecution.java userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/bhv/core/execution/OutsideSqlSelectExecution.java userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/bhv/core/execution/SelectCBExecution.java userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/cbean/ScalarQuery.java userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/cbean/ckey/ConditionKeyNotLikeSearch.java userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/helper/StringKeyMap.java userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/helper/StringSet.java userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/s2dao/BeanMetaDataFactoryExtension.java userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/s2dao/PropertyTypeFactoryBuilderExtension.java userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/s2dao/SqlLogRegistryLatestSqlProvider.java userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/s2dao/internal/various/InternalIdentifierAbstractGenerator.java userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/s2dao/internal/various/InternalIdentifierAssignedGenerator.java userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/s2dao/internal/various/InternalIdentifierGeneratorFactory.java userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/s2dao/internal/various/InternalIdentifierIdentityGenerator.java userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/s2dao/internal/various/InternalIdentifierSequenceGenerator.java userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/s2dao/internal/various/InternalStatementFactory.java userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/util/SimpleResourceUtil.java userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/util/SimpleTypeUtil.java Removed Paths: ------------- userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/BFinder.java userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/CacheDaoSelector.java userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/DaoReadable.java userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/DaoSelector.java userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/DaoWritable.java userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/GenMetaData.java userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/annotation/OutsideSql.java userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/cbean/SimpleOrderByBean.java userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/cbean/outsidesql/OutsideSqlDao.java userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/s2dao/FetchNarrowingResultSetFactory.java userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/s2dao/S2BeanMetaDataFactoryImpl.java userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/s2dao/S2DaoInterceptor.java userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/s2dao/S2DaoLatestSqlProvider.java userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/s2dao/S2DaoMetaDataExtension.java userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/s2dao/S2DaoMetaDataFactoryImpl.java userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/s2dao/S2DaoPropertyTypeFactoryBuilderExtension.java userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/s2dao/S2DaoSelectDynamicCommand.java userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/bsdao/BsGroupInfoDao.java userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/bsdao/BsGroupMappingDao.java userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/bsdao/BsRoleInfoDao.java userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/bsdao/BsRoleMappingDao.java userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/bsdao/BsUserInfoDao.java userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/exdao/GroupInfoDao.java userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/exdao/GroupMappingDao.java userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/exdao/RoleInfoDao.java userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/exdao/RoleMappingDao.java userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/exdao/UserInfoDao.java -------------- next part -------------- Modified: userinfo/trunk/dbflute/_project.bat =================================================================== --- userinfo/trunk/dbflute/_project.bat 2008-12-26 22:11:31 UTC (rev 1622) +++ userinfo/trunk/dbflute/_project.bat 2008-12-27 22:02:56 UTC (rev 1623) @@ -2,4 +2,4 @@ set MY_PROJECT_NAME=userinfo -set DBFLUTE_HOME=..\mydbflute\dbflute-0.8.2 +set DBFLUTE_HOME=..\mydbflute\dbflute-0.8.7 Modified: userinfo/trunk/dbflute/_project.sh =================================================================== --- userinfo/trunk/dbflute/_project.sh 2008-12-26 22:11:31 UTC (rev 1622) +++ userinfo/trunk/dbflute/_project.sh 2008-12-27 22:02:56 UTC (rev 1623) @@ -2,4 +2,4 @@ export MY_PROJECT_NAME=userinfo -export DBFLUTE_HOME=../mydbflute/dbflute-0.8.2 +export DBFLUTE_HOME=../mydbflute/dbflute-0.8.7 Modified: userinfo/trunk/dbflute/build-userinfo.properties =================================================================== --- userinfo/trunk/dbflute/build-userinfo.properties 2008-12-26 22:11:31 UTC (rev 1622) +++ userinfo/trunk/dbflute/build-userinfo.properties 2008-12-27 22:02:56 UTC (rev 1623) @@ -157,5 +157,5 @@ torque.additionalForeignKeyMap = map:{ \ } -#torque.isDeleteOldTableClass = true +torque.isDeleteOldTableClass = true Modified: userinfo/trunk/mydbflute/README.txt =================================================================== --- userinfo/trunk/mydbflute/README.txt 2008-12-26 22:11:31 UTC (rev 1622) +++ userinfo/trunk/mydbflute/README.txt 2008-12-27 22:02:56 UTC (rev 1623) @@ -1,3 +1,3 @@ -$ mkdir dbflute-0.8.2 -$ cd dbflute-0.8.2 -$ unzip ../dbflute-0.8.2.zip +$ mkdir dbflute-0.8.7 +$ cd dbflute-0.8.7 +$ unzip ../dbflute-0.8.7.zip Modified: userinfo/trunk/src/main/config/erd/userinfo.erd =================================================================== --- userinfo/trunk/src/main/config/erd/userinfo.erd 2008-12-26 22:11:31 UTC (rev 1622) +++ userinfo/trunk/src/main/config/erd/userinfo.erd 2008-12-27 22:02:56 UTC (rev 1623) @@ -204,6 +204,22 @@ + status + Status + + VARCHAR + String + true + 12 + + 1 + false + false + + false + + + created_time Created Time @@ -233,7 +249,7 @@ updated_time Updated Time - + 10 true false @@ -255,7 +271,7 @@ deleted_time Deleted Time - + 10 false false @@ -292,6 +308,11 @@ + + 255 + 255 + 206 + 185 199 @@ -384,7 +405,7 @@ created_time Created Time - + 10 true false @@ -406,7 +427,7 @@ updated_time Updated Time - + 10 true false @@ -428,7 +449,7 @@ deleted_time Deleted Time - + 10 false false @@ -450,7 +471,7 @@ versionNo Version No. - + 10 true false @@ -460,6 +481,11 @@ + + 255 + 255 + 206 + 40 719 @@ -529,6 +555,11 @@ + + 255 + 255 + 206 + 44 40 @@ -686,7 +717,7 @@ created_time Created Time - + 10 true false @@ -708,7 +739,7 @@ updated_time Updated Time - + 10 true false @@ -730,7 +761,7 @@ deleted_time Deleted Time - + 10 false false @@ -752,7 +783,7 @@ versionNo Version No. - + 10 true false @@ -762,6 +793,11 @@ + + 255 + 255 + 206 + 364 719 @@ -826,6 +862,11 @@ + + 255 + 255 + 206 + 372 40 Modified: userinfo/trunk/src/main/config/sql/others/0-userinfo.dml =================================================================== --- userinfo/trunk/src/main/config/sql/others/0-userinfo.dml 2008-12-26 22:11:31 UTC (rev 1622) +++ userinfo/trunk/src/main/config/sql/others/0-userinfo.dml 2008-12-27 22:02:56 UTC (rev 1623) @@ -1,2 +1,2 @@ -insert into user_info (USER_ID, CREATED_TIME, CREATED_BY, UPDATED_TIME, UPDATED_BY, VERSIONNO) values ('admin', '2008-10-15 17:17:37', 'admin', '2008-10-15 17:17:37', 'admin', 0); +insert into user_info (USER_ID, CREATED_TIME, CREATED_BY, UPDATED_TIME, UPDATED_BY, VERSIONNO, STATUS) values ('admin', '2008-10-15 17:17:37', 'admin', '2008-10-15 17:17:37', 'admin', 0, 'A'); Modified: userinfo/trunk/src/main/config/sql/userinfo.ddl =================================================================== --- userinfo/trunk/src/main/config/sql/userinfo.ddl 2008-12-26 22:11:31 UTC (rev 1622) +++ userinfo/trunk/src/main/config/sql/userinfo.ddl 2008-12-27 22:02:56 UTC (rev 1623) @@ -4,9 +4,9 @@ DROP TABLE role_info; DROP TABLE group_info; -/********************************** -Table Name: Group Information -**********************************/ +/**********************************/ +/* Table Name: Group Information */ +/**********************************/ CREATE TABLE group_info( group_id VARCHAR(255) NOT NULL PRIMARY KEY, name VARCHAR(100), @@ -23,9 +23,9 @@ versionNo INTEGER NOT NULL ); -/********************************** -Table Name: Role Information -**********************************/ +/**********************************/ +/* Table Name: Role Information */ +/**********************************/ CREATE TABLE role_info( role_id VARCHAR(255) NOT NULL PRIMARY KEY, name VARCHAR(100), @@ -42,9 +42,9 @@ versionNo INTEGER NOT NULL ); -/********************************** -Table Name: User Information -**********************************/ +/**********************************/ +/* Table Name: User Information */ +/**********************************/ CREATE TABLE user_info( user_id VARCHAR(255) NOT NULL PRIMARY KEY, given_name VARCHAR(100), @@ -61,6 +61,7 @@ locale VARCHAR(5), role_id VARCHAR(255), group_id VARCHAR(255), + status VARCHAR(1), created_time TIMESTAMP NOT NULL, created_by VARCHAR(255) NOT NULL, updated_time TIMESTAMP NOT NULL, @@ -72,9 +73,9 @@ FOREIGN KEY (role_id) REFERENCES role_info (role_id) ); -/********************************** -Table Name: Group Mapping -**********************************/ +/**********************************/ +/* Table Name: Group Mapping */ +/**********************************/ CREATE TABLE group_mapping( id INTEGER NOT NULL IDENTITY PRIMARY KEY, user_id VARCHAR(255) NOT NULL, @@ -83,9 +84,9 @@ FOREIGN KEY (group_id) REFERENCES group_info (group_id) ); -/********************************** -Table Name: Role Mapping -**********************************/ +/**********************************/ +/* Table Name: Role Mapping */ +/**********************************/ CREATE TABLE role_mapping( id INT NOT NULL IDENTITY PRIMARY KEY, user_id VARCHAR(255) NOT NULL, Modified: userinfo/trunk/src/main/java/jp/sf/pal/userinfo/UserInfoConstants.java =================================================================== --- userinfo/trunk/src/main/java/jp/sf/pal/userinfo/UserInfoConstants.java 2008-12-26 22:11:31 UTC (rev 1622) +++ userinfo/trunk/src/main/java/jp/sf/pal/userinfo/UserInfoConstants.java 2008-12-27 22:02:56 UTC (rev 1623) @@ -6,4 +6,10 @@ public static final String GROUP_AVAILABLE = "features.group"; + public static final String USER_ACTIVE = "A"; + + public static final String USER_LOCKED = "L"; + + public static final String USER_DISABLED = "D"; + } Modified: userinfo/trunk/src/main/java/jp/sf/pal/userinfo/action/UserInfoAction.java =================================================================== --- userinfo/trunk/src/main/java/jp/sf/pal/userinfo/action/UserInfoAction.java 2008-12-26 22:11:31 UTC (rev 1622) +++ userinfo/trunk/src/main/java/jp/sf/pal/userinfo/action/UserInfoAction.java 2008-12-27 22:02:56 UTC (rev 1623) @@ -64,7 +64,7 @@ userInfoItems = userInfoService.getUserInfoList(userInfoPager); // restore from pager - // userInfoForm.userInfoname = userInfoPager.getUserInfoname(); + userInfoForm.statusForSearch = userInfoPager.getStatus(); return "index.jsp"; } @@ -86,6 +86,7 @@ @Execute(validator = false, input = "error.jsp") public String search() { // userInfoPager.setUserInfoname(userInfoForm.userInfoname); + userInfoPager.setStatus(userInfoForm.statusForSearch); return displayList(); } Deleted: userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/BFinder.java =================================================================== --- userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/BFinder.java 2008-12-26 22:11:31 UTC (rev 1622) +++ userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/BFinder.java 2008-12-27 22:02:56 UTC (rev 1623) @@ -1,110 +0,0 @@ -package jp.sf.pal.userinfo.db.allcommon; - -import jp.sf.pal.userinfo.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 find( - Class behaviorType) { - assertObjectNotNull("behaviorType", behaviorType); - if (!org.seasar.framework.container.factory.SingletonS2ContainerFactory - .hasContainer()) { - synchronized (BFinder.class) { - if (!org.seasar.framework.container.factory.SingletonS2ContainerFactory - .hasContainer()) { - final String configFile = _dbfluteDiconName; - if (org.seasar.framework.util.ResourceUtil - .isExist(configFile)) { - org.seasar.framework.container.factory.SingletonS2ContainerFactory - .setConfigPath(configFile); - org.seasar.framework.container.factory.SingletonS2ContainerFactory - .init(); - } else { - String msg = "S2Container is not initialized! Confirm your initializer and your dicon files."; - throw new IllegalStateException(msg); - } - } - } - } - final org.seasar.framework.container.S2Container container = org.seasar.framework.container.factory.SingletonS2ContainerFactory - .getContainer(); - final BEHAVIOR_TYPE behavior = (BEHAVIOR_TYPE) container - .getComponent(behaviorType); - return behavior; - } - - //========================================================================== - // ========= - // Accessor - // ======== - public static void setDBFluteDiconName(String dbfluteDiconName) { - _dbfluteDiconName = dbfluteDiconName; - } - - //========================================================================== - // ========= - // General Helper - // ============== - /** - * Assert that the object is not null. - * - * @param variableName Variable name. (NotNull) - * @param value Value. (NotNull) - * @exception IllegalArgumentException - */ - protected static void assertObjectNotNull(String variableName, Object value) { - if (variableName == null) { - String msg = "The value should not be null: variableName=" - + variableName + " value=" + value; - throw new IllegalArgumentException(msg); - } - if (value == null) { - String msg = "The value should not be null: variableName=" - + variableName; - throw new IllegalArgumentException(msg); - } - } - - // ---------------------------------------------------------------- - // Assert String - // ------------- - /** - * Assert that the entity is not null and not trimmed empty. - * - * @param variableName Variable name. (NotNull) - * @param value Value. (NotNull) - */ - protected void assertStringNotNullAndNotTrimmedEmpty(String variableName, - String value) { - assertObjectNotNull("variableName", variableName); - assertObjectNotNull("value", value); - if (value.trim().length() == 0) { - String msg = "The value should not be empty: variableName=" - + variableName + " value=" + value; - throw new IllegalArgumentException(msg); - } - } -} Modified: userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/BehaviorSelector.java =================================================================== --- userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/BehaviorSelector.java 2008-12-26 22:11:31 UTC (rev 1622) +++ userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/BehaviorSelector.java 2008-12-27 22:02:56 UTC (rev 1623) @@ -10,8 +10,7 @@ public interface BehaviorSelector { /** - * Initialize condition-bean meta data.
If you call this, Hot Deploy - * of OutsideSql becomes Cool! + * Initialize condition-bean meta data.
*/ public void initializeConditionBeanMetaData(); Modified: userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/CacheBehaviorSelector.java =================================================================== --- userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/CacheBehaviorSelector.java 2008-12-26 22:11:31 UTC (rev 1622) +++ userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/CacheBehaviorSelector.java 2008-12-27 22:02:56 UTC (rev 1623) @@ -1,8 +1,8 @@ package jp.sf.pal.userinfo.db.allcommon; import java.util.Collection; -import java.util.LinkedHashMap; import java.util.Map; +import java.util.concurrent.ConcurrentHashMap; import jp.sf.pal.userinfo.db.allcommon.bhv.BehaviorReadable; import jp.sf.pal.userinfo.db.allcommon.dbmeta.DBMeta; @@ -31,15 +31,14 @@ // Attribute // ========= /** The cache of behavior. (It's the generic hell!) */ - protected Map, BehaviorReadable> _behaviorCache = new LinkedHashMap, BehaviorReadable>(); + protected Map, BehaviorReadable> _behaviorCache = new ConcurrentHashMap, BehaviorReadable>(); //========================================================================== // ========= // Initialize // ========== /** - * Initialize condition-bean meta data.
If you call this, Hot Deploy - * of OutsideSql becomes Cool! + * Initialize condition-bean meta data.
*/ public void initializeConditionBeanMetaData() { final Map dbmetaMap = DBMetaInstanceHandler @@ -53,8 +52,7 @@ } for (DBMeta dbmeta : dbmetas) { final BehaviorReadable bhv = byName(dbmeta.getTableDbName()); - final DaoReadable dao = bhv.getDaoReadable(); - dao.initializeDaoMetaData("selectList"); + bhv.warmUpCommand(); } if (_log.isInfoEnabled()) { long after = System.currentTimeMillis(); Deleted: userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/CacheDaoSelector.java =================================================================== --- userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/CacheDaoSelector.java 2008-12-26 22:11:31 UTC (rev 1622) +++ userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/CacheDaoSelector.java 2008-12-27 22:02:56 UTC (rev 1623) @@ -1,66 +0,0 @@ -package jp.sf.pal.userinfo.db.allcommon; - -import jp.sf.pal.userinfo.db.allcommon.dbmeta.DBMeta; -import jp.sf.pal.userinfo.db.allcommon.dbmeta.DBMetaInstanceHandler; - -/** - * The implementation of DAO-selector. - * - *

- * 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.
- * 
- * - * @author DBFlute(AutoGenerator) - */ - ¡÷ SuppressWarnings("unchecked") -public class CacheDaoSelector extends CacheAbstractSelector implements - DaoSelector { - - //========================================================================== - // ========= - // Selector - // ======== - /** - * Select DAO. - * - * @param The type of DAO. - * @param daoType DAO type. (NotNull) - * @return DAO. (NotNull) - */ - public DAO select(Class 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 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 daoType; - try { - daoType = (Class) Class.forName(daoTypeName); - } catch (ClassNotFoundException e) { - throw new RuntimeException("The class does not exist: " - + daoTypeName, e); - } - return daoType; - } -} Added: userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/CommonColumnAutoSetupper.java =================================================================== --- userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/CommonColumnAutoSetupper.java (rev 0) +++ userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/CommonColumnAutoSetupper.java 2008-12-27 22:02:56 UTC (rev 1623) @@ -0,0 +1,25 @@ +package jp.sf.pal.userinfo.db.allcommon; + +/** + * The auto set-upper of common column. + * + * @author DBFlute(AutoGenerator) + */ +public interface CommonColumnAutoSetupper { + + /** + * Handle common columns of insert if it needs. + * + * @param targetEntity Target entity that the type is entity interface. + * (NotNull) + */ + public void handleCommonColumnOfInsertIfNeeds(Entity targetEntity); + + /** + * Handle common columns of update if it needs. + * + * @param targetEntity Target entity that the type is entity interface. + * (NotNull) + */ + public void handleCommonColumnOfUpdateIfNeeds(Entity targetEntity); +} Property changes on: userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/CommonColumnAutoSetupper.java ___________________________________________________________________ Name: svn:eol-style + native Added: userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/CommonColumnBasicAutoSetupper.java =================================================================== --- userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/CommonColumnBasicAutoSetupper.java (rev 0) +++ userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/CommonColumnBasicAutoSetupper.java 2008-12-27 22:02:56 UTC (rev 1623) @@ -0,0 +1,31 @@ +package jp.sf.pal.userinfo.db.allcommon; + +/** + * The basic implementation of the auto set-upper of common column. + * + * @author DBFlute(AutoGenerator) + */ +public class CommonColumnBasicAutoSetupper implements CommonColumnAutoSetupper { + + //========================================================================== + // =========== + // Set up + // ====== + /** + * Handle common columns of insert if it needs. + * + * @param targetEntity Target entity that the type is entity interface. + * (NotNull) + */ + public void handleCommonColumnOfInsertIfNeeds(Entity targetEntity) { + } + + /** + * Handle common columns of update if it needs. + * + * @param targetEntity Target entity that the type is entity interface. + * (NotNull) + */ + public void handleCommonColumnOfUpdateIfNeeds(Entity targetEntity) { + } +} Property changes on: userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/CommonColumnBasicAutoSetupper.java ___________________________________________________________________ Name: svn:eol-style + native Added: userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/DBDef.java =================================================================== --- userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/DBDef.java (rev 0) +++ userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/DBDef.java 2008-12-27 22:02:56 UTC (rev 1623) @@ -0,0 +1,179 @@ +package jp.sf.pal.userinfo.db.allcommon; + +import java.util.Collections; +import java.util.HashMap; +import java.util.Iterator; +import java.util.Map; +import java.util.Set; + +/** + * The definition of database. + * + * @author DBFlute(AutoGenerator) + */ +public enum DBDef { + + //========================================================================== + // ========= + // ENUM + // ==== + MySQL("mysql", null), PostgreSQL("postgresql", "postgre"), Oracle("oracle", + null), DB2("db2", null), SQLServer("sqlserver", "mssql"), FireBird( + "firebird", null), H2("h2", null), Derby("derby", null), MSAccess( + "msaccess", null), Unknown("unknown", null); + + //========================================================================== + // ========= + // Static Reference + // ================ + // ----------------------------------------------------- + // Code Value + // ---------- + private static final Map _codeValueMap = new HashMap(); + static { + for (DBDef value : values()) { + _codeValueMap.put(value.code().toLowerCase(), value); + } + } + + private static final Map _codeAliasValueMap = new HashMap(); + static { + for (DBDef value : values()) { + if (value.codeAlias() != null) { + _codeAliasValueMap.put(value.codeAlias().toLowerCase(), value); + } + } + } + + /** + * @param code The code of the DB. (Nullable: If the code is null, it + * returns null) + * @return The instance that has the code. (Nullable) + */ + public static DBDef codeOf(String code) { + if (code == null) { + return null; + } + final String lowerCaseCode = code.toLowerCase(); + DBDef def = _codeValueMap.get(lowerCaseCode); + if (def == null) { + def = _codeAliasValueMap.get(lowerCaseCode); + } + return def; + } + + // ----------------------------------------------------- + // Driver Hint + // ----------- + private static final Map _driverHintMap; + static { + final Map tmpMap = new HashMap(); + tmpMap.put("mysql", MySQL); + tmpMap.put("postgresql", PostgreSQL); + tmpMap.put("oracle", Oracle); + tmpMap.put("db2", DB2); + tmpMap.put("sqlserver", SQLServer); + tmpMap.put("firebird", FireBird); + tmpMap.put("org.h2", H2); + tmpMap.put("org.apache.derby", Derby); + _driverHintMap = Collections.unmodifiableMap(tmpMap); + } + + public static DBDef byDriverClassName(String driverClassName) { + final Set keySet = _driverHintMap.keySet(); + for (final Iterator ite = keySet.iterator(); ite.hasNext();) { + final String driverHint = ite.next(); + if (driverClassName.indexOf(driverHint) >= 0) { + final DBDef dbdef = _driverHintMap.get(driverHint); + if (dbdef != null) { + return dbdef; + } + } + } + return null; + } + + //========================================================================== + // ========= + // Current Definition + // ================== + /** The current definition of database. (NotNull, Default 'Unknown') */ + private static DBDef _currentDef; + static { + _currentDef = codeOf("H2"); + if (_currentDef == null) { + _currentDef = Unknown; + } + } + + /** + * @return The current definition of database. (NotNull) + */ + public static DBDef getCurrentDef() { + return _currentDef; + } + + /** + * @param currentDef The current definition of database. (NotNull) + */ + public static void setCurrentDef(DBDef currentDef) { + if (currentDef == null) { + String msg = "The argument 'currentDef' should not be null at DBDef.setCurrentDef()"; + throw new IllegalArgumentException(msg); + } + _currentDef = currentDef; + } + + /** + * @param dbdef The definition of database. (NotNull) + * @return Is the definition of database current? + */ + public static boolean isCurrentDef(DBDef dbdef) { + if (dbdef == null) { + String msg = "The argument 'dbdef' should not be null at DBDef.isCurrentDef()"; + throw new IllegalArgumentException(msg); + } + return _currentDef != null ? _currentDef.equals(dbdef) : false; + } + + //========================================================================== + // ========= + // Attribute + // ========= + /** The code of the DB. (NotNull) */ + private String _code; + + /** The code alias of the DB. (Nullable) */ + private String _codeAlias; + + //========================================================================== + // ========= + // Constructor + // =========== + /** + * @param code The code of the DB. (NotNull) + * @param codeAlias The code alias of the DB. (Nullable) + */ + private DBDef(String code, String codeAlias) { + _code = code; + _codeAlias = codeAlias; + } + + //========================================================================== + // ========= + // Accessor + // ======== + /** + * @return The code of the DB. (NotNull) + */ + public String code() { + return _code; + } + + /** + * @return The code alias of the DB. (Nullable) + */ + private String codeAlias() { + return _codeAlias; + } +} Property changes on: userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/DBDef.java ___________________________________________________________________ Name: svn:eol-style + native Modified: userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/DBFluteConfig.java =================================================================== --- userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/DBFluteConfig.java 2008-12-26 22:11:31 UTC (rev 1622) +++ userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/DBFluteConfig.java 2008-12-27 22:02:56 UTC (rev 1623) @@ -24,10 +24,6 @@ // ========= protected StatementConfig _defaultStatementConfig; - protected boolean _conditionBeanFormatSql = true;// This is for - - // compatibility! - protected boolean _queryLogLevelInfo; protected boolean _executeStatusLogLevelInfo; @@ -36,10 +32,6 @@ protected UniqueConstraintDeterminator _uniqueConstraintDeterminator; - protected boolean _sqlExceptionOldStyleHandling = false;// This is for - - // compatibility! - protected String _logDateFormat; protected String _logTimestampFormat; @@ -92,27 +84,6 @@ //========================================================================== // ========= - // ConditionBean Format Sql - // ======================== - public boolean isConditionBeanFormatSql() { - return _conditionBeanFormatSql; - } - - /** - * @param conditionBeanFormatSql The value of the config. - * @deprecated This is for compatibility! - */ - public void setConditionBeanFormatSql(boolean conditionBeanFormatSql) { - assertNotLocked(); - if (_log.isInfoEnabled()) { - _log.info("...Setting conditionBeanFormatSql: " - + conditionBeanFormatSql); - } - _conditionBeanFormatSql = conditionBeanFormatSql; - } - - //========================================================================== - // ========= // Query Log Level Info // ==================== public boolean isQueryLogLevelInfo() { @@ -184,31 +155,8 @@ public boolean isUniqueConstraintException(Throwable t); } - // [DBFlute-0.7.7] //========================================================================== // ========= - // SQL Exception Old Style - // ======================= - public boolean isSqlExceptionOldStyleHandling() { - return _sqlExceptionOldStyleHandling; - } - - /** - * @param sqlExceptionOldStyleHandling The value of the config. - * @deprecated This is for compatibility! - */ - public void setSqlExceptionOldStyleHandling( - boolean sqlExceptionOldStyleHandling) { - assertNotLocked(); - if (_log.isInfoEnabled()) { - _log.info("...Setting sqlExceptionOldStyleHandling: " - + sqlExceptionOldStyleHandling); - } - _sqlExceptionOldStyleHandling = sqlExceptionOldStyleHandling; - } - - //========================================================================== - // ========= // Log Format // ========== public String getLogDateFormat() { @@ -303,7 +251,6 @@ // ============ public void clear() { // the only properties that update OK while executing _defaultStatementConfig = null; - _conditionBeanFormatSql = true; // as default _queryLogLevelInfo = false; _executeStatusLogLevelInfo = false; _useSqlLogRegistry = false; Deleted: userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/DaoReadable.java =================================================================== --- userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/DaoReadable.java 2008-12-26 22:11:31 UTC (rev 1622) +++ userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/DaoReadable.java 2008-12-27 22:02:56 UTC (rev 1623) @@ -1,11 +0,0 @@ -package jp.sf.pal.userinfo.db.allcommon; - -/** - * The interface of dao-readable. - * - * @author DBFlute(AutoGenerator) - */ -public interface DaoReadable { - public void initializeDaoMetaData(String methodName);// Very Internal - // Method! -} Deleted: userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/DaoSelector.java =================================================================== --- userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/DaoSelector.java 2008-12-26 22:11:31 UTC (rev 1622) +++ userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/DaoSelector.java 2008-12-27 22:02:56 UTC (rev 1623) @@ -1,26 +0,0 @@ -package jp.sf.pal.userinfo.db.allcommon; - -/** - * The interface of DAO-selector. - * - * @author DBFlute(AutoGenerator) - */ -public interface DaoSelector { - - /** - * Select DAO. - * - * @param The type of DAO. - * @param daoType DAO type. (NotNull) - * @return Dao. (NotNull) - */ - public DAO select(Class daoType); - - /** - * Select DAO-readable by name. - * - * @param tableFlexibleName Table flexible name. (NotNull) - * @return DAO-readable. (NotNull) - */ - public DaoReadable byName(String tableFlexibleName); -} Deleted: userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/DaoWritable.java =================================================================== --- userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/DaoWritable.java 2008-12-26 22:11:31 UTC (rev 1622) +++ userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/DaoWritable.java 2008-12-27 22:02:56 UTC (rev 1623) @@ -1,70 +0,0 @@ -package jp.sf.pal.userinfo.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 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 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 entityList); -} Modified: userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/EntityDefinedCommonColumn.java =================================================================== --- userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/EntityDefinedCommonColumn.java 2008-12-26 22:11:31 UTC (rev 1622) +++ userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/EntityDefinedCommonColumn.java 2008-12-27 22:02:56 UTC (rev 1623) @@ -8,6 +8,12 @@ public interface EntityDefinedCommonColumn extends Entity { /** + * Enable common column auto set up. {for after disable because the default + * is enabled} + */ + public void enableCommonColumnAutoSetup(); + + /** * Disable common column auto set up. */ public void disableCommonColumnAutoSetup(); Deleted: userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/GenMetaData.java =================================================================== --- userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/GenMetaData.java 2008-12-26 22:11:31 UTC (rev 1622) +++ userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/GenMetaData.java 2008-12-27 22:02:56 UTC (rev 1623) @@ -1,258 +0,0 @@ -package jp.sf.pal.userinfo.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.userinfo.db.allcommon"; - } - - /** - * Get the property-value of baseBehaviorPackage. - * - * @return The property-value. - */ - public String getBaseBehaviorPackage() { - return "jp.sf.pal.userinfo.db.bsbhv"; - } - - /** - * Get the property-value of baseDaoPackage. - * - * @return The property-value. - */ - public String getBaseDaoPackage() { - return "jp.sf.pal.userinfo.db.bsdao"; - } - - /** - * Get the property-value of baseEntityPackage. - * - * @return The property-value. - */ - public String getBaseEntityPackage() { - return "jp.sf.pal.userinfo.db.bsentity"; - } - - /** - * Get the property-value of conditionBeanPackage. - * - * @return The property-value. - */ - public String getConditionBeanPackage() { - return "jp.sf.pal.userinfo.db.cbean"; - } - - /** - * Get the property-value of extendedDaoPackage. - * - * @return The property-value. - */ - public String getExtendedDaoPackage() { - return "jp.sf.pal.userinfo.db.exdao"; - } - - /** - * Get the property-value of extendedBehaviorPackage. - * - * @return The property-value. - */ - public String getExtendedBehaviorPackage() { - return "jp.sf.pal.userinfo.db.exbhv"; - } - - /** - * Get the property-value of extendedEntityPackage. - * - * @return The property-value. - */ - public String getExtendedEntityPackage() { - return "jp.sf.pal.userinfo.db.exentity"; - } - - //========================================================================== - // ========= - // Optimistic Lock - // =============== - /** - * Get the property-value of updateDateFieldName. - * - * @return The property-value. - */ - public String getUpdateDateFieldName() { - return ""; - } - - /** - * Get the property-value of versionNoFieldName. - * - * @return The property-value. - */ - public String getVersionNoFieldName() { - return ""; - } - - //========================================================================== - // ========= - // Extract - // ======= - /** - * Get the value of 'extractAcceptStartBrace'. - * - * @return The property-value. (NotNull) - */ - public String getExtractAcceptStartBrace() { - return "@{"; - } - - /** - * Get the value of 'extractAcceptEndBrace'. - * - * @return The property-value. (NotNull) - */ - public String getExtractAcceptEndBrace() { - return "@}"; - } - - /** - * Get the value of 'extractAcceptDelimiter'. - * - * @return The property-value. (NotNull) - */ - public String getExtractAcceptDelimiter() { - return "@;"; - } - - /** - * Get the value of 'extractAcceptEqual'. - * - * @return The property-value. (NotNull) - */ - public String getExtractAcceptEqual() { - return "@="; - } -} Deleted: userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/annotation/OutsideSql.java =================================================================== --- userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/annotation/OutsideSql.java 2008-12-26 22:11:31 UTC (rev 1622) +++ userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/annotation/OutsideSql.java 2008-12-27 22:02:56 UTC (rev 1623) @@ -1,18 +0,0 @@ -package jp.sf.pal.userinfo.db.allcommon.annotation; - -import java.lang.annotation.ElementType; -import java.lang.annotation.Inherited; -import java.lang.annotation.Retention; -import java.lang.annotation.RetentionPolicy; -import java.lang.annotation.Target; - - ¡÷ Inherited - ¡÷ Retention(RetentionPolicy.RUNTIME) - ¡÷ Target(ElementType.METHOD) -public @interface OutsideSql { - boolean dynamicBinding() default false; - - boolean offsetByCursor() default false; - - boolean limitByCursor() default false; -} Modified: userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/bhv/AbstractBehaviorReadable.java =================================================================== --- userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/bhv/AbstractBehaviorReadable.java 2008-12-26 22:11:31 UTC (rev 1622) +++ userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/bhv/AbstractBehaviorReadable.java 2008-12-27 22:02:56 UTC (rev 1623) @@ -11,10 +11,16 @@ import java.util.Set; import jp.sf.pal.userinfo.db.allcommon.BehaviorSelector; -import jp.sf.pal.userinfo.db.allcommon.DaoSelector; import jp.sf.pal.userinfo.db.allcommon.Entity; import jp.sf.pal.userinfo.db.allcommon.bhv.batch.TokenFileOutputOption; import jp.sf.pal.userinfo.db.allcommon.bhv.batch.TokenFileOutputResult; +import jp.sf.pal.userinfo.db.allcommon.bhv.core.BehaviorCommand; +import jp.sf.pal.userinfo.db.allcommon.bhv.core.BehaviorCommandInvoker; +import jp.sf.pal.userinfo.db.allcommon.bhv.core.command.AbstractBehaviorCommand; +import jp.sf.pal.userinfo.db.allcommon.bhv.core.command.SelectCountCBCommand; +import jp.sf.pal.userinfo.db.allcommon.bhv.core.command.SelectListCBCommand; +import jp.sf.pal.userinfo.db.allcommon.bhv.core.command.SelectNextValCommand; +import jp.sf.pal.userinfo.db.allcommon.bhv.core.command.SelectScalarCBCommand; import jp.sf.pal.userinfo.db.allcommon.bhv.load.LoadReferrerOption; import jp.sf.pal.userinfo.db.allcommon.bhv.setup.ValueLabelBox; import jp.sf.pal.userinfo.db.allcommon.bhv.setup.ValueLabelSetupper; @@ -25,8 +31,9 @@ import jp.sf.pal.userinfo.db.allcommon.cbean.PagingHandler; import jp.sf.pal.userinfo.db.allcommon.cbean.PagingInvoker; import jp.sf.pal.userinfo.db.allcommon.cbean.PagingResultBean; -import jp.sf.pal.userinfo.db.allcommon.cbean.outsidesql.OutsideSqlDao; +import jp.sf.pal.userinfo.db.allcommon.cbean.ScalarQuery; import jp.sf.pal.userinfo.db.allcommon.cbean.outsidesql.executor.OutsideSqlBasicExecutor; +import jp.sf.pal.userinfo.db.allcommon.cbean.sqlclause.SqlClause; import jp.sf.pal.userinfo.db.allcommon.dbmeta.info.ColumnInfo; import jp.sf.pal.userinfo.db.allcommon.helper.token.file.FileMakingHeaderInfo; import jp.sf.pal.userinfo.db.allcommon.helper.token.file.FileMakingOption; @@ -35,11 +42,10 @@ import jp.sf.pal.userinfo.db.allcommon.util.SimpleSystemUtil; /** - * The abstract class of behavior-readable. + * The abstract class of readable behavior. * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public abstract class AbstractBehaviorReadable implements BehaviorReadable { //========================================================================== @@ -50,13 +56,13 @@ * Behavior-selector instance. It's basically referred at loadReferrer. * (Required for loadReferrer) */ - protected BehaviorSelector _behaviorSelector; + protected BehaviorCommandInvoker _behaviorCommandInvoker; /** - * Dao-selector instance. It's basically referred at loadReferrer. (Required - * for OutsideSql) + * Behavior-selector instance. It's basically referred at loadReferrer. + * (Required for loadReferrer) */ - protected DaoSelector _daoSelector; + protected BehaviorSelector _behaviorSelector; //========================================================================== // =========== @@ -83,7 +89,7 @@ * @return Read count. (NotNull) */ public int readCount(ConditionBean cb) { - assertConditionBeanNotNull(cb); + assertCBNotNull(cb); return callReadCount(cb); } @@ -100,7 +106,7 @@ * When the entity has been duplicated. */ public Entity readEntity(ConditionBean cb) { - assertConditionBeanNotNull(cb); + assertCBNotNull(cb); final List ls = readList(cb); if (ls.isEmpty()) { return null; @@ -120,7 +126,7 @@ * When the entity has been duplicated. */ public Entity readEntityWithDeletedCheck(ConditionBean cb) { - assertConditionBeanNotNull(cb); + assertCBNotNull(cb); final List ls = readList(cb); assertEntityNotDeleted(ls, cb); assertEntitySelectedAsOne(ls, cb); @@ -133,7 +139,7 @@ // =========================== protected ENTITY helpSelectEntityInternally( CB cb, InternalSelectEntityCallback callback) { - assertConditionBeanNotNull(cb); + assertCBNotNull(cb); cb.checkSafetyResult(1); List ls = null; try { @@ -156,7 +162,7 @@ protected ENTITY helpSelectEntityWithDeletedCheckInternally( CB cb, InternalSelectEntityWithDeletedCheckCallback callback) { - assertConditionBeanNotNull(cb); + assertCBNotNull(cb); cb.checkSafetyResult(1); List ls = null; try { @@ -175,7 +181,7 @@ } //========================================================================== - // =========== + // ========= // List Read // ========= /** @@ -186,7 +192,7 @@ * list. (NotNull) */ public ListResultBean readList(ConditionBean cb) { - assertConditionBeanNotNull(cb); + assertCBNotNull(cb); return new jp.sf.pal.userinfo.db.allcommon.cbean.ResultBeanBuilder( getTableDbName()).buildListResultBean(cb, callReadList(cb)); } @@ -198,7 +204,7 @@ * @return Read page. (NotNull) */ public PagingResultBean readPage(final ConditionBean cb) { - assertConditionBeanNotNull(cb); + assertCBNotNull(cb); final PagingInvoker invoker = new PagingInvoker( getTableDbName()); final PagingHandler handler = new PagingHandler() { @@ -225,8 +231,7 @@ * @exception jp.sf.pal.userinfo.db.allcommon.exception.EntityAlreadyDeletedException * When the entity has already been deleted. */ - protected void assertEntityNotDeleted( - jp.sf.pal.userinfo.db.allcommon.Entity entity, Object searchKey4Log) { + protected void assertEntityNotDeleted(Entity entity, Object searchKey4Log) { if (entity == null) { throwEntityAlreadyDeletedException(searchKey4Log); } @@ -239,7 +244,8 @@ * @param searchKey4Log Search-key for Logging. (NotNull) * @exception jp.sf.pal.userinfo.db.allcommon.exception.EntityAlreadyDeletedException */ - protected void assertEntityNotDeleted(List ls, Object searchKey4Log) { + protected void assertEntityNotDeleted(List ls, + Object searchKey4Log) { if (ls == null || ls.isEmpty()) { throwEntityAlreadyDeletedException(searchKey4Log); } @@ -253,7 +259,8 @@ * @exception jp.sf.pal.userinfo.db.allcommon.exception.EntityAlreadyDeletedException * @exception jp.sf.pal.userinfo.db.allcommon.exception.EntityDuplicatedException */ - protected void assertEntitySelectedAsOne(List ls, Object searchKey4Log) { + protected void assertEntitySelectedAsOne(List ls, + Object searchKey4Log) { if (ls == null || ls.isEmpty()) { throwEntityAlreadyDeletedException(searchKey4Log); } @@ -274,49 +281,254 @@ //========================================================================== // ========= - // Various Select - // ============== - public OutsideSqlBasicExecutor outsideSql() { - assertDaoSelectorNotNull("outsideSql"); - final OutsideSqlDao outsideSqlDao = _daoSelector - .select(OutsideSqlDao.class); - return new OutsideSqlBasicExecutor(outsideSqlDao, getTableDbName()); - } + // Scalar Select + // ============= + /** + * The scalar function.
This is not static class because this uses + * the method 'invoke(BehaviorCommand)' + * + * @param The type of condition-bean. + * @param The type of result. + */ + public class SLFunction { // SL: ScaLar - private void assertDaoSelectorNotNull(String methodName) { - if (_daoSelector == null) { + /** The condition-bean for scalar select. (NotNull) */ + protected CB _conditionBean; + + /** The condition-bean for scalar select. (NotNull) */ + protected Class _resultType; + + /** + * @param conditionBean The condition-bean initialized only for scalar + * select. (NotNull) + * @param resultType The type os result. (NotNull) + */ + public SLFunction(CB conditionBean, Class resultType) { + _conditionBean = conditionBean; + _resultType = resultType; + } + + /** + * Select the maximum value.
+ * + *
+         * memberBhv.scalarSelect(Date.class).max(new ScalarQuery(MemberCB cb) {
+         *     cb.specify().columnMemberBirthday(); // the required specification of target column
+         *     cb.query().setMemberStatusCode_Equal_Formalized(); // query as you like it
+         * });
+         * 
+ * + * @param scalarQuery The query for scalar. (NotNull) + * @return The maximum value. (Nullable) + */ + public RESULT max(ScalarQuery scalarQuery) { + assertObjectNotNull("scalarQuery", scalarQuery); + return exec(scalarQuery, SqlClause.SelectClauseType.MAX); + } + + /** + * Select the minimum value.
+ * + *
+         * memberBhv.scalarSelect(Date.class).min(new ScalarQuery(MemberCB cb) {
+         *     cb.specify().columnMemberBirthday(); // the required specification of target column
+         *     cb.query().setMemberStatusCode_Equal_Formalized(); // query as you like it
+         * });
+         * 
+ * + * @param scalarQuery The query for scalar. (NotNull) + * @return The minimum value. (Nullable) + */ + public RESULT min(ScalarQuery scalarQuery) { + assertObjectNotNull("scalarQuery", scalarQuery); + return exec(scalarQuery, SqlClause.SelectClauseType.MIN); + } + + /** + * Select the summary value.
+ * + *
+         * purchaseBhv.scalarSelect(Integer.class).sum(new ScalarQuery(PurchaseCB cb) {
+         *     cb.specify().columnPurchaseCount(); // the required specification of target column
+         *     cb.query().setPurchaseDatetime_GreaterEqual(date); // query as you like it
+         * });
+         * 
+ * + * @param scalarQuery The query for scalar. (NotNull) + * @return The summary value. (Nullable) + */ + public RESULT sum(ScalarQuery scalarQuery) { + assertObjectNotNull("scalarQuery", scalarQuery); + return exec(scalarQuery, SqlClause.SelectClauseType.SUM); + } + + /** + * Select the average value.
+ * + *
+         * purchaseBhv.scalarSelect(Integer.class).avg(new ScalarQuery(PurchaseCB cb) {
+         *     cb.specify().columnPurchaseCount(); // the required specification of target column
+         *     cb.query().setPurchaseDatetime_GreaterEqual(date); // query as you like it
+         * });
+         * 
+ * + * @param scalarQuery The query for scalar. (NotNull) + * @return The average value. (Nullable) + */ + public RESULT avg(ScalarQuery scalarQuery) { + assertObjectNotNull("scalarQuery", scalarQuery); + return exec(scalarQuery, SqlClause.SelectClauseType.AVG); + } + + protected RESULT exec(ScalarQuery scalarQuery, + SqlClause.SelectClauseType selectClauseType) { + assertObjectNotNull("scalarQuery", scalarQuery); + assertObjectNotNull("selectClauseType", selectClauseType); + assertObjectNotNull("conditionBean", _conditionBean); + assertObjectNotNull("resultType", _resultType); + scalarQuery.query(_conditionBean); + assertScalarSelectRequiredSpecifyColumn(); + return invoke(createSelectScalarCBCommand(_conditionBean, + _resultType, selectClauseType)); + } + + protected void assertScalarSelectRequiredSpecifyColumn() { + final String columnName = _conditionBean.getSqlClause() + .getSpecifiedColumnNameAsOne(); + if (columnName == null) { + throwScalarSelectInvalidColumnSpecificationException(); + } + } + + protected void throwScalarSelectInvalidColumnSpecificationException() { String msg = "Look! Read the message below." + getLineSeparator(); msg = msg + "/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *" + getLineSeparator(); - msg = msg - + "Not found the selector of dao as behavior's attributed!" + msg = msg + "The specified column for scalar select was Invalid!" + getLineSeparator(); msg = msg + getLineSeparator(); msg = msg + "[Advice]" + getLineSeparator(); msg = msg - + "Please confirm the definition of the selector at your 'dbflute.dicon'." + + " You should call specify().column[TargetColumn]() only once." + getLineSeparator(); - msg = msg + "It is precondition that '" + methodName - + "()' needs the selector instance." + getLineSeparator(); - msg = msg + getLineSeparator(); - msg = msg + "[Your Behavior's Attributes]" + getLineSeparator(); - msg = msg + " _behaviorSelector : " + _behaviorSelector + msg = msg + " For example:" + getLineSeparator(); + msg = msg + " " + getLineSeparator(); + msg = msg + " [Wrong]" + getLineSeparator(); + msg = msg + " /- - - - - - - - - - - - - - - - - - - - " + getLineSeparator(); - msg = msg + " _daoSelector : " + _daoSelector + msg = msg + + " memberBhv.scalarSelect(Date.class).max(new ScalarQuery() {" + getLineSeparator(); - msg = msg + "* * * * * * * * * */" + getLineSeparator(); - throw new IllegalStateException(msg); + msg = msg + " public void query(MemberCB cb) {" + + getLineSeparator(); + msg = msg + " // *No! It's empty!" + getLineSeparator(); + msg = msg + " }" + getLineSeparator(); + msg = msg + " });" + getLineSeparator(); + msg = msg + " - - - - - - - - - -/" + getLineSeparator(); + msg = msg + " " + getLineSeparator(); + msg = msg + " [Wrong]" + getLineSeparator(); + msg = msg + " /- - - - - - - - - - - - - - - - - - - - " + + getLineSeparator(); + msg = msg + + " memberBhv.scalarSelect(Date.class).max(new ScalarQuery() {" + + getLineSeparator(); + msg = msg + " public void query(MemberCB cb) {" + + getLineSeparator(); + msg = msg + " cb.specify().columnMemberBirthday();" + + getLineSeparator(); + msg = msg + + " cb.specify().columnRegisterDatetime(); // *No! It's duplicated!" + + getLineSeparator(); + msg = msg + " }" + getLineSeparator(); + msg = msg + " });" + getLineSeparator(); + msg = msg + " - - - - - - - - - -/" + getLineSeparator(); + msg = msg + " " + getLineSeparator(); + msg = msg + " [Good!]" + getLineSeparator(); + msg = msg + " /- - - - - - - - - - - - - - - - - - - - " + + getLineSeparator(); + msg = msg + + " memberBhv.scalarSelect(Date.class).max(new ScalarQuery() {" + + getLineSeparator(); + msg = msg + " public void query(MemberCB cb) {" + + getLineSeparator(); + msg = msg + + " cb.specify().columnMemberBirthday(); // *Point!" + + getLineSeparator(); + msg = msg + " }" + getLineSeparator(); + msg = msg + " });" + getLineSeparator(); + msg = msg + " - - - - - - - - - -/" + getLineSeparator(); + msg = msg + getLineSeparator(); + msg = msg + "[ConditionBean Type]" + getLineSeparator() + + _conditionBean.getClass().getName() + getLineSeparator(); + msg = msg + getLineSeparator(); + msg = msg + "[Result Type]" + getLineSeparator() + + _resultType.getName() + getLineSeparator(); + msg = msg + "* * * * * * * * * */"; + throw new ScalarSelectInvalidColumnSpecificationException(msg); } } + public static class ScalarSelectInvalidColumnSpecificationException extends + RuntimeException { + private static final long serialVersionUID = 1L; + + public ScalarSelectInvalidColumnSpecificationException(String msg) { + super(msg); + } + } + + //========================================================================== + // ========= + // OutsideSql + // ========== /** - * Create value-label list. + * Get the basic executor of outside-SQL.
The invoker of behavior + * command should be not null when you call this method. * + *
+     * You can use the methods for outside-SQL are as follows:
+     * {Basic}
+     *   o selectList()
+     *   o execute()
+     *   o call()
+     * 
+     * {Entity}
+     *   o entityHandling().selectEntity()
+     *   o entityHandling().selectEntityWithDeletedCheck()
+     * 
+     * {Cursor}
+     *   o cursorHandling().selectCursor()
+     * 
+     * {Paging}
+     *   o autoPaging().selectList()
+     *   o autoPaging().selectPage()
+     *   o manualPaging().selectList()
+     *   o manualPaging().selectPage()
+     * 
+     * {Option -- Dynamic}
+     *   o dynamicBinding().selectList()
+     * 
+ * + * @return The basic executor of outside-SQL. (NotNull) + */ + public OutsideSqlBasicExecutor outsideSql() { + assertBehaviorCommandInvoker("outsideSql"); + return new OutsideSqlBasicExecutor(_behaviorCommandInvoker, + getTableDbName()); + } + + //========================================================================== + // ========= + // Various Select + // ============== + /** + * Create the list of value-label. + * * @param The type of entity. * @param entityList The list of entity. (NotNull) - * @param valueLabelSetupper Value-label-setupper. (NotNull) - * @return Value-label list. (NotNull) + * @param valueLabelSetupper The setupper of value-label. (NotNull) + * @return The list of value-label. (NotNull) */ public List> createValueLabelList( List entityList, @@ -362,10 +574,10 @@ } } - protected Object helpConvertingSequenceObject(Class resultClass, + protected Object helpConvertingSequenceObject(Class resultClass, Object sequenceObject) { try { - final Constructor constructor = resultClass + final Constructor constructor = resultClass .getConstructor(new Class[] { String.class }); return constructor.newInstance(new Object[] { sequenceObject .toString() }); @@ -534,6 +746,7 @@ * @param value The value of primary key. (Nullable) * @return The value of primary key. (Nullable) */ + @SuppressWarnings("unchecked") protected PK toLowerCasePrimaryKeyIfString(PK value) { return (PK) toLowerCaseIfString(value); } @@ -580,22 +793,22 @@ + "/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *" + getLineSeparator(); msg = msg - + "Not found the selector of behavior as behavior's attributed!" + + "Not found the selector of behavior as behavior's attribute!" + getLineSeparator(); msg = msg + getLineSeparator(); msg = msg + "[Advice]" + getLineSeparator(); msg = msg - + "Please confirm the definition of the selector at your 'dbflute.dicon'." + + "Please confirm the definition of the selector at your component configuration of DBFlute." + getLineSeparator(); msg = msg + "It is precondition that '" + methodName + "()' needs the selector instance." + getLineSeparator(); msg = msg + getLineSeparator(); msg = msg + "[Your Behavior's Attributes]" + getLineSeparator(); - msg = msg + " _behaviorSelector : " + _behaviorSelector + msg = msg + " _behaviorCommandInvoker : " + + _behaviorCommandInvoker + getLineSeparator(); + msg = msg + " _behaviorSelector : " + _behaviorSelector + getLineSeparator(); - msg = msg + " _daoSelector : " + _daoSelector - + getLineSeparator(); - msg = msg + "* * * * * * * * * */" + getLineSeparator(); + msg = msg + "* * * * * * * * * */"; throw new IllegalStateException(msg); } } @@ -648,14 +861,14 @@ public TokenFileOutputResult outputTokenFile(ConditionBean cb, String filename, TokenFileOutputOption tokenFileOutputOption) throws java.io.FileNotFoundException, java.io.IOException { - assertConditionBeanNotNull(cb); + assertCBNotNull(cb); assertStringNotNullAndNotTrimmedEmpty("filename", filename); assertObjectNotNull("tokenFileOutputOption", tokenFileOutputOption); final List ls = readList(cb); List> rowList = new ArrayList>(); - for (java.util.Iterator ite = ls.iterator(); ite.hasNext();) { - final Entity entity = (Entity) ite.next(); + for (java.util.Iterator ite = ls.iterator(); ite.hasNext();) { + final Entity entity = ite.next(); final List valueList = getDBMeta() .convertToColumnStringValueList(entity); rowList.add(valueList); @@ -665,9 +878,9 @@ .getFileMakingOption(); final FileMakingHeaderInfo fileMakingHeaderInfo = new FileMakingHeaderInfo(); final List columnDbNameList = new ArrayList(); - for (final java.util.Iterator ite = getDBMeta().getColumnInfoList() - .iterator(); ite.hasNext();) { - final ColumnInfo columnInfo = (ColumnInfo) ite.next(); + for (final java.util.Iterator ite = getDBMeta() + .getColumnInfoList().iterator(); ite.hasNext();) { + final ColumnInfo columnInfo = ite.next(); columnDbNameList.add(columnInfo.getColumnDbName()); } fileMakingHeaderInfo.setColumnNameList(columnDbNameList); @@ -690,7 +903,7 @@ * @return All count. */ protected int callGetCountAll() { - return readCount(newConditionBean()); + return callReadCount(newConditionBean()); } /** @@ -699,7 +912,7 @@ * @return All list. (NotNull) */ protected List callGetListAll() { - return readList(newConditionBean()); + return callReadList(newConditionBean()); } /** @@ -710,14 +923,12 @@ * @return Read count. (NotNull) */ protected int callReadCount(ConditionBean cb) { - assertConditionBeanNotNull(cb); - final Class[] types = new Class[] { cb.getClass() }; - final java.lang.reflect.Method mtd = getMethod(getDaoReadable() - .getClass(), "selectCount", types); - final Object result = invoke(mtd, getDaoReadable(), new Object[] { cb }); - return ((Integer) result).intValue(); + assertCBNotNull(cb); + return doCallReadCount(cb); } + protected abstract int doCallReadCount(ConditionBean cb); + /** * The implementation. * @@ -727,42 +938,110 @@ * (NotNull) */ protected List 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) result; + assertCBNotNull(cb); + return doCallReadList(cb); } - private Method getMethod(Class clazz, String methodName, Class[] argTypes) { - try { - return clazz.getMethod(methodName, argTypes); - } catch (NoSuchMethodException ex) { - String msg = "class=" + clazz + " method=" + methodName + "-" - + java.util.Arrays.asList(argTypes); - throw new RuntimeException(msg, ex); + protected abstract List doCallReadList(ConditionBean cb); + + //========================================================================== + // ========= + // Behavior Command + // ================ + public void warmUpCommand() { + { + SelectCountCBCommand cmd = createSelectCountCBCommand(newConditionBean()); + cmd.setInitializeOnly(true); + invoke(cmd); } + { + SelectListCBCommand cmd = createSelectListCBCommand( + newConditionBean(), getDBMeta().getEntityType()); + cmd.setInitializeOnly(true); + invoke(cmd); + } } - private Object invoke(Method method, Object target, Object[] args) { - try { - return method.invoke(target, args); - } catch (java.lang.reflect.InvocationTargetException ex) { - Throwable t = ex.getCause(); - if (t instanceof RuntimeException) { - throw (RuntimeException) t; - } - if (t instanceof Error) { - throw (Error) t; - } - String msg = "target=" + target + " method=" + method + "-" - + java.util.Arrays.asList(args); - throw new RuntimeException(msg, ex); - } catch (IllegalAccessException ex) { - String msg = "target=" + target + " method=" + method + "-" - + java.util.Arrays.asList(args); - throw new RuntimeException(msg, ex); + protected SelectCountCBCommand createSelectCountCBCommand(ConditionBean cb) { + assertBehaviorCommandInvoker("createSelectCountCBCommand"); + final SelectCountCBCommand command = xsetupSelectCommand(new SelectCountCBCommand()); + command.setConditionBeanType(cb.getClass()); + command.setConditionBean(cb); + return command; + } + + protected SelectListCBCommand createSelectListCBCommand( + ConditionBean cb, Class entityType) { + assertBehaviorCommandInvoker("createSelectListCBCommand"); + final SelectListCBCommand command = xsetupSelectCommand(new SelectListCBCommand()); + command.setConditionBeanType(cb.getClass()); + command.setConditionBean(cb); + command.setEntityType(entityType); + return command; + } + + protected SelectNextValCommand createSelectNextValCommand( + Class resultType) { + assertBehaviorCommandInvoker("createSelectNextValCommand"); + final SelectNextValCommand command = xsetupSelectCommand(new SelectNextValCommand()); + command.setResultType(resultType); + return command; + } + + protected SelectScalarCBCommand createSelectScalarCBCommand( + ConditionBean cb, Class resultType, + SqlClause.SelectClauseType selectClauseType) { + assertBehaviorCommandInvoker("createSelectScalarCBCommand"); + final SelectScalarCBCommand command = xsetupSelectCommand(new SelectScalarCBCommand()); + command.setConditionBeanType(cb.getClass()); + command.setConditionBean(cb); + command.setResultType(resultType); + command.setSelectClauseType(selectClauseType); + return command; + } + + private > COMMAND xsetupSelectCommand( + COMMAND command) { + command.setTableDbName(getTableDbName()); + _behaviorCommandInvoker.injectComponentProperty(command); + return command; + } + + /** + * Invoke the command of behavior. + * + * @param The type of result. + * @param behaviorCommand The command of behavior. (NotNull) + * @return The instance of result. (Nullable) + */ + protected RESULT invoke(BehaviorCommand behaviorCommand) { + return _behaviorCommandInvoker.invoke(behaviorCommand); + } + + protected void assertBehaviorCommandInvoker(String methodName) { + if (_behaviorCommandInvoker == null) { + String msg = "Look! Read the message below." + getLineSeparator(); + msg = msg + + "/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *" + + getLineSeparator(); + msg = msg + + "Not found the invoker of behavior command as behavior's attributed!" + + getLineSeparator(); + msg = msg + getLineSeparator(); + msg = msg + "[Advice]" + getLineSeparator(); + msg = msg + + "Please confirm the definition of the invoker at your 'dbflute.dicon'." + + getLineSeparator(); + msg = msg + "It is precondition that '" + methodName + + "()' needs the invoker instance." + getLineSeparator(); + msg = msg + getLineSeparator(); + msg = msg + "[Your Behavior's Attributes]" + getLineSeparator(); + msg = msg + " _behaviorCommandInvoker : " + + _behaviorCommandInvoker + getLineSeparator(); + msg = msg + " _behaviorSelector : " + _behaviorSelector + + getLineSeparator(); + msg = msg + "* * * * * * * * * */"; + throw new IllegalStateException(msg); } } @@ -800,6 +1079,7 @@ return SimpleSystemUtil.getLineSeparator(); } + @SuppressWarnings("unchecked") protected ENTITY helpDowncastInternally( Entity entity, Class clazz) { assertObjectNotNull("entity", entity); @@ -850,8 +1130,16 @@ * * @param cb Condition-bean. (NotNull) */ - protected void assertConditionBeanNotNull( - jp.sf.pal.userinfo.db.allcommon.cbean.ConditionBean cb) { + protected void assertConditionBeanNotNull(ConditionBean cb) { + assertCBNotNull(cb); + } + + /** + * Assert that the condition-bean is not null. + * + * @param cb Condition-bean. (NotNull) + */ + protected void assertCBNotNull(ConditionBean cb) { assertObjectNotNull("cb", cb); } @@ -896,7 +1184,7 @@ * * @param ls List. (NotNull) */ - protected void assertListNotNullAndEmpty(List ls) { + protected void assertListNotNullAndEmpty(List ls) { assertObjectNotNull("ls", ls); if (!ls.isEmpty()) { String msg = "The list should be empty: ls=" + ls.toString(); @@ -909,7 +1197,7 @@ * * @param ls List. (NotNull) */ - protected void assertListNotNullAndNotEmpty(List ls) { + protected void assertListNotNullAndNotEmpty(List ls) { assertObjectNotNull("ls", ls); if (ls.isEmpty()) { String msg = "The list should not be empty: ls=" + ls.toString(); @@ -922,7 +1210,7 @@ * * @param ls List. (NotNull) */ - protected void assertListNotNullAndHasOnlyOne(List ls) { + protected void assertListNotNullAndHasOnlyOne(List ls) { assertObjectNotNull("ls", ls); if (ls.size() != 1) { String msg = "The list should contain only one object: ls=" @@ -936,38 +1224,39 @@ // Accessor // ======== /** - * Get the selector of behavior. + * Get the invoker of behavior command. * - * @return The select of behavior. (Nullable: But normally NotNull) + * @return The invoker of behavior command. (Nullable: But normally NotNull) */ - protected BehaviorSelector getBehaviorSelector() { - return _behaviorSelector; + protected BehaviorCommandInvoker getBehaviorCommandInvoker() { + return _behaviorCommandInvoker; } /** - * Set the selector of behavior. + * Set the invoker of behavior command. * - * @param behaviorSelector The selector of behavior. (NotNull) + * @param behaviorCommandInvoker The invoker of behavior command. (NotNull) */ - public void setBehaviorSelector(BehaviorSelector behaviorSelector) { - this._behaviorSelector = behaviorSelector; + public void setBehaviorCommandInvoker( + BehaviorCommandInvoker behaviorCommandInvoker) { + this._behaviorCommandInvoker = behaviorCommandInvoker; } /** - * Get the selector of DAO. + * Get the selector of behavior. * - * @return The select of DAO. (Nullable: But normally NotNull) + * @return The select of behavior. (Nullable: But normally NotNull) */ - protected DaoSelector getDaoSelector() { - return _daoSelector; + protected BehaviorSelector getBehaviorSelector() { + return _behaviorSelector; } /** - * Set the selector of DAO. + * Set the selector of behavior. * - * @param daoSelector The selector of DAO. (NotNull) + * @param behaviorSelector The selector of behavior. (NotNull) */ - public void setDaoSelector(DaoSelector daoSelector) { - _daoSelector = daoSelector; + public void setBehaviorSelector(BehaviorSelector behaviorSelector) { + this._behaviorSelector = behaviorSelector; } } Modified: userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/bhv/AbstractBehaviorWritable.java =================================================================== --- userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/bhv/AbstractBehaviorWritable.java 2008-12-26 22:11:31 UTC (rev 1622) +++ userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/bhv/AbstractBehaviorWritable.java 2008-12-27 22:02:56 UTC (rev 1623) @@ -4,10 +4,25 @@ import java.util.Iterator; import java.util.List; +import jp.sf.pal.userinfo.db.allcommon.CommonColumnAutoSetupper; import jp.sf.pal.userinfo.db.allcommon.Entity; import jp.sf.pal.userinfo.db.allcommon.bhv.batch.TokenFileReflectionFailure; import jp.sf.pal.userinfo.db.allcommon.bhv.batch.TokenFileReflectionOption; import jp.sf.pal.userinfo.db.allcommon.bhv.batch.TokenFileReflectionResult; +import jp.sf.pal.userinfo.db.allcommon.bhv.core.command.AbstractEntityCommand; +import jp.sf.pal.userinfo.db.allcommon.bhv.core.command.AbstractListEntityCommand; +import jp.sf.pal.userinfo.db.allcommon.bhv.core.command.BatchDeleteEntityCommand; +import jp.sf.pal.userinfo.db.allcommon.bhv.core.command.BatchDeleteNonstrictEntityCommand; +import jp.sf.pal.userinfo.db.allcommon.bhv.core.command.BatchInsertEntityCommand; +import jp.sf.pal.userinfo.db.allcommon.bhv.core.command.BatchUpdateEntityCommand; +import jp.sf.pal.userinfo.db.allcommon.bhv.core.command.BatchUpdateNonstrictEntityCommand; +import jp.sf.pal.userinfo.db.allcommon.bhv.core.command.DeleteEntityCommand; +import jp.sf.pal.userinfo.db.allcommon.bhv.core.command.DeleteNonstrictEntityCommand; +import jp.sf.pal.userinfo.db.allcommon.bhv.core.command.InsertEntityCommand; +import jp.sf.pal.userinfo.db.allcommon.bhv.core.command.QueryDeleteCBCommand; +import jp.sf.pal.userinfo.db.allcommon.bhv.core.command.QueryUpdateEntityCBCommand; +import jp.sf.pal.userinfo.db.allcommon.bhv.core.command.UpdateEntityCommand; +import jp.sf.pal.userinfo.db.allcommon.bhv.core.command.UpdateNonstrictEntityCommand; import jp.sf.pal.userinfo.db.allcommon.cbean.ConditionBean; import jp.sf.pal.userinfo.db.allcommon.dbmeta.DBMeta; import jp.sf.pal.userinfo.db.allcommon.helper.MapStringBuilder; @@ -20,7 +35,7 @@ import jp.sf.pal.userinfo.db.allcommon.helper.token.file.impl.FileTokenImpl; /** - * The abstract class of behavior-writable. + * The abstract class of writable behavior. * * @author DBFlute(AutoGenerator) */ @@ -29,6 +44,31 @@ //========================================================================== // ========= + // Definition + // ========== + /** Map-string map-mark. */ + private static final String MAP_STRING_MAP_MARK = "map:"; + + /** Map-string start-brace. */ + private static final String MAP_STRING_START_BRACE = "@{"; + + /** Map-string end-brace. */ + private static final String MAP_STRING_END_BRACE = "@}"; + + /** Map-string delimiter. */ + private static final String MAP_STRING_DELIMITER = "@;"; + + /** Map-string equal. */ + private static final String MAP_STRING_EQUAL = "@="; + + //========================================================================== + // =========== + // Attribute + // ========= + protected CommonColumnAutoSetupper _commonColumnAutoSetupper; + + //========================================================================== + // ========= // Entity Update // ============= // ----------------------------------------------------- @@ -357,7 +397,7 @@ * @param entityList Entity list. (NotNull and NotEmpty) * @return The array of created count. */ - public int[] lumpCreate(java.util.List entityList) { + public int[] lumpCreate(List entityList) { assertListNotNullAndNotEmpty(entityList); return callCreateList(entityList); } @@ -370,7 +410,7 @@ * @exception jp.sf.pal.userinfo.db.allcommon.exception.EntityAlreadyUpdatedException * If s2dao's version is over 1.0.47 (contains 1.0.47). */ - public int[] lumpModify(java.util.List entityList) { + public int[] lumpModify(List entityList) { assertListNotNullAndNotEmpty(entityList); return callModifyList(entityList); } @@ -383,7 +423,7 @@ * @exception jp.sf.pal.userinfo.db.allcommon.exception.EntityAlreadyUpdatedException * If s2dao's version is over 1.0.47 (contains 1.0.47). */ - public int[] lumpRemove(java.util.List entityList) { + public int[] lumpRemove(List entityList) { assertListNotNullAndNotEmpty(entityList); return callRemoveList(entityList); } @@ -611,9 +651,11 @@ if (!processBeforeInsert(entity)) { return 1;/* as Normal End */ } - return getDaoWritable().create(entity); + return doCallCreate(entity); } + protected abstract int doCallCreate(Entity entity); + /** * Process before insert. * @@ -645,9 +687,11 @@ if (!processBeforeUpdate(entity)) { return 1;/* as Normal End */ } - return getDaoWritable().modifyModifiedOnly(entity); + return doCallModify(entity); } + protected abstract int doCallModify(Entity entity); + /** * Process before update. * @@ -678,9 +722,11 @@ if (!processBeforeDelete(entity)) { return 1;/* as Normal End */ } - return getDaoWritable().remove(entity); + return doCallRemove(entity); } + protected abstract int doCallRemove(Entity entity); + /** * Process before delete. * @@ -729,8 +775,38 @@ * (NotNull) */ protected void setupCommonColumnOfInsertIfNeeds(Entity targetEntity) { + final CommonColumnAutoSetupper setupper = getCommonColumnAutoSetupper(); + assertCommonColumnAutoSetupperNotNull(); + setupper.handleCommonColumnOfInsertIfNeeds(targetEntity); } + private void assertCommonColumnAutoSetupperNotNull() { + if (_commonColumnAutoSetupper == null) { + String msg = "Look! Read the message below." + getLineSeparator(); + msg = msg + + "/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *" + + getLineSeparator(); + msg = msg + + "Not found the auto set-upper of common column as behavior's attribute!" + + getLineSeparator(); + msg = msg + getLineSeparator(); + msg = msg + "[Advice]" + getLineSeparator(); + msg = msg + + "Please confirm the definition of the set-upper at your component configuration of DBFlute." + + getLineSeparator(); + msg = msg + getLineSeparator(); + msg = msg + "[Your Behavior's Attributes]" + getLineSeparator(); + msg = msg + " _behaviorCommandInvoker : " + + _behaviorCommandInvoker + getLineSeparator(); + msg = msg + " _behaviorSelector : " + _behaviorSelector + + getLineSeparator(); + msg = msg + " _commonColumnAutoSetupper : " + + _commonColumnAutoSetupper + getLineSeparator(); + msg = msg + "* * * * * * * * * */"; + throw new IllegalStateException(msg); + } + } + /** * Filter the entity of insert. * @@ -778,6 +854,9 @@ * (NotNull) */ protected void setupCommonColumnOfUpdateIfNeeds(Entity targetEntity) { + final CommonColumnAutoSetupper setupper = getCommonColumnAutoSetupper(); + assertCommonColumnAutoSetupperNotNull(); + setupper.handleCommonColumnOfUpdateIfNeeds(targetEntity); } /** @@ -843,12 +922,14 @@ * (NotNull) * @return Inserted count. */ - public int[] callCreateList(java.util.List entityList) { + public int[] callCreateList(List entityList) { assertObjectNotNull("entityList", entityList); helpFilterBeforeInsertInternally(entityList); - return getDaoWritable().createList(entityList); + return doCreateList(entityList); } + protected abstract int[] doCreateList(List entityList); + /** * The implementation. * @@ -856,12 +937,14 @@ * (NotNull) * @return Updated count. */ - public int[] callModifyList(java.util.List entityList) { + public int[] callModifyList(List entityList) { assertObjectNotNull("entityList", entityList); helpFilterBeforeUpdateInternally(entityList); - return getDaoWritable().modifyList(entityList); + return doModifyList(entityList); } + protected abstract int[] doModifyList(List entityList); + /** * The implementation. * @@ -869,12 +952,14 @@ * (NotNull) * @return Deleted count. */ - public int[] callRemoveList(java.util.List entityList) { + public int[] callRemoveList(List entityList) { assertObjectNotNull("entityList", entityList); helpFilterBeforeDeleteInternally(entityList); - return getDaoWritable().removeList(entityList); + return doRemoveList(entityList); } + protected abstract int[] doRemoveList(List entityList); + protected void assertEntityHasVersionNoValue(Entity entity) { if (!getDBMeta().hasVersionNo()) { return; @@ -994,4 +1079,148 @@ } return filteredList; } + + //========================================================================== + // ========= + // Behavior Command + // ================ + protected InsertEntityCommand createInsertEntityCommand(Entity entity) { + assertBehaviorCommandInvoker("createInsertEntityCommand"); + return xsetupEntityCommand(new InsertEntityCommand(), entity); + } + + protected UpdateEntityCommand createUpdateEntityCommand(Entity entity) { + assertBehaviorCommandInvoker("createUpdateEntityCommand"); + return xsetupEntityCommand(new UpdateEntityCommand(), entity); + } + + protected UpdateNonstrictEntityCommand createUpdateNonstrictEntityCommand( + Entity entity) { + assertBehaviorCommandInvoker("createUpdateNonstrictEntityCommand"); + return xsetupEntityCommand(new UpdateNonstrictEntityCommand(), entity); + } + + protected DeleteEntityCommand createDeleteEntityCommand(Entity entity) { + assertBehaviorCommandInvoker("createDeleteEntityCommand"); + return xsetupEntityCommand(new DeleteEntityCommand(), entity); + } + + protected DeleteNonstrictEntityCommand createDeleteNonstrictEntityCommand( + Entity entity) { + assertBehaviorCommandInvoker("createDeleteNonstrictEntityCommand"); + return xsetupEntityCommand(new DeleteNonstrictEntityCommand(), entity); + } + + private COMMAND xsetupEntityCommand( + COMMAND command, Entity entity) { + command.setTableDbName(getTableDbName()); + _behaviorCommandInvoker.injectComponentProperty(command); + command.setEntityType(entity.getClass()); + command.setEntity(entity); + return command; + } + + protected BatchInsertEntityCommand createBatchInsertEntityCommand( + List entityList) { + assertBehaviorCommandInvoker("createBatchInsertEntityCommand"); + return xsetupListEntityCommand(new BatchInsertEntityCommand(), + entityList); + } + + protected BatchUpdateEntityCommand createBatchUpdateEntityCommand( + List entityList) { + assertBehaviorCommandInvoker("createBatchUpdateEntityCommand"); + return xsetupListEntityCommand(new BatchUpdateEntityCommand(), + entityList); + } + + protected BatchUpdateNonstrictEntityCommand createBatchUpdateNonstrictEntityCommand( + List entityList) { + assertBehaviorCommandInvoker("createBatchUpdateNonstrictEntityCommand"); + return xsetupListEntityCommand(new BatchUpdateNonstrictEntityCommand(), + entityList); + } + + protected BatchDeleteEntityCommand createBatchDeleteEntityCommand( + List entityList) { + assertBehaviorCommandInvoker("createBatchDeleteEntityCommand"); + return xsetupListEntityCommand(new BatchDeleteEntityCommand(), + entityList); + } + + protected BatchDeleteNonstrictEntityCommand createBatchDeleteNonstrictEntityCommand( + List entityList) { + assertBehaviorCommandInvoker("createBatchDeleteNonstrictEntityCommand"); + return xsetupListEntityCommand(new BatchDeleteNonstrictEntityCommand(), + entityList); + } + + /** + * @param The type of behavior command for list entity. + * @param command The command of behavior. (NotNull) + * @param entityList The list of entity. (NotNull, NotEmpty) + * @return The command of behavior. (NotNull) + */ + private COMMAND xsetupListEntityCommand( + COMMAND command, List entityList) { + if (entityList.isEmpty()) { + String msg = "The argument 'entityList' should not be empty: " + + entityList; + throw new IllegalStateException(msg); + } + command.setTableDbName(getTableDbName()); + _behaviorCommandInvoker.injectComponentProperty(command); + command.setEntityType(entityList.get(0).getClass()); // *The list should + // not be empty! + command.setEntityList(entityList); + return command; + } + + protected QueryDeleteCBCommand createQueryDeleteCBCommand(ConditionBean cb) { + assertBehaviorCommandInvoker("createQueryDeleteCBCommand"); + final QueryDeleteCBCommand cmd = new QueryDeleteCBCommand(); + cmd.setTableDbName(getTableDbName()); + _behaviorCommandInvoker.injectComponentProperty(cmd); + cmd.setConditionBeanType(cb.getClass()); + cmd.setConditionBean(cb); + return cmd; + } + + protected QueryUpdateEntityCBCommand createQueryUpdateEntityCBCommand( + Entity entity, ConditionBean cb) { + assertBehaviorCommandInvoker("createQueryUpdateEntityCBCommand"); + final QueryUpdateEntityCBCommand cmd = new QueryUpdateEntityCBCommand(); + cmd.setTableDbName(getTableDbName()); + _behaviorCommandInvoker.injectComponentProperty(cmd); + cmd.setConditionBeanType(cb.getClass()); + cmd.setConditionBean(cb); + cmd.setEntityType(entity.getClass()); + cmd.setEntity(entity); + return cmd; + } + + //========================================================================== + // ========= + // Accessor + // ======== + /** + * Get the auto set-upper of common column. + * + * @return The auto set-upper of common column. (Nullable: But normally + * NotNull) + */ + protected CommonColumnAutoSetupper getCommonColumnAutoSetupper() { + return _commonColumnAutoSetupper; + } + + /** + * Set the auto set-upper of common column. + * + * @param commonColumnAutoSetupper The auto set-upper of common column. + * (NotNull) + */ + public void setCommonColumnAutoSetupper( + CommonColumnAutoSetupper commonColumnAutoSetupper) { + this._commonColumnAutoSetupper = commonColumnAutoSetupper; + } } Modified: userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/bhv/BehaviorReadable.java =================================================================== --- userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/bhv/BehaviorReadable.java 2008-12-26 22:11:31 UTC (rev 1622) +++ userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/bhv/BehaviorReadable.java 2008-12-27 22:02:56 UTC (rev 1623) @@ -1,6 +1,5 @@ package jp.sf.pal.userinfo.db.allcommon.bhv; -import jp.sf.pal.userinfo.db.allcommon.DaoReadable; import jp.sf.pal.userinfo.db.allcommon.Entity; import jp.sf.pal.userinfo.db.allcommon.cbean.ConditionBean; import jp.sf.pal.userinfo.db.allcommon.cbean.ListResultBean; @@ -16,34 +15,12 @@ //========================================================================== // ========= - // Definition - // ========== - /** Map-string map-mark. */ - public static final String MAP_STRING_MAP_MARK = "map:"; - - /** Map-string list-mark. */ - public static final String MAP_STRING_LIST_MARK = "list:"; - - /** Map-string start-brace. */ - public static final String MAP_STRING_START_BRACE = "@{"; - - /** Map-string end-brace. */ - public static final String MAP_STRING_END_BRACE = "@}"; - - /** Map-string delimiter. */ - public static final String MAP_STRING_DELIMITER = "@;"; - - /** Map-string equal. */ - public static final String MAP_STRING_EQUAL = "@="; - - //========================================================================== - // ========= // Table name // ========== /** - * Get table db-name. + * Get table DB name. * - * @return Table db-name. (NotNull) + * @return Table DB name. (NotNull) */ public String getTableDbName(); @@ -52,25 +29,14 @@ // DBMeta // ====== /** - * Get dbmeta. + * Get the instance of DBMeta. * - * @return DBMeta. (NotNull) + * @return The instance of DBMeta. (NotNull) */ public DBMeta getDBMeta(); //========================================================================== // ========= - // Dao Accessor - // ============ - /** - * Get dao-readable. - * - * @return Dao-readable. (NotNull) - */ - public DaoReadable getDaoReadable(); - - //========================================================================== - // ========= // New Instance // ============ /** @@ -173,4 +139,13 @@ * @return The value of sequence. (NotNull) */ public java.math.BigDecimal readNextVal(); + + //========================================================================== + // ========= + // Warm Up + // ======= + /** + * Warm up the command of behavior. + */ + public void warmUpCommand(); } Modified: userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/bhv/BehaviorWritable.java =================================================================== --- userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/bhv/BehaviorWritable.java 2008-12-26 22:11:31 UTC (rev 1622) +++ userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/bhv/BehaviorWritable.java 2008-12-27 22:02:56 UTC (rev 1623) @@ -1,6 +1,7 @@ package jp.sf.pal.userinfo.db.allcommon.bhv; -import jp.sf.pal.userinfo.db.allcommon.DaoWritable; +import java.util.List; + import jp.sf.pal.userinfo.db.allcommon.Entity; /** @@ -10,13 +11,6 @@ */ public interface BehaviorWritable extends BehaviorReadable { - /** - * Get dao-writable. - * - * @return Dao-writable. (NotNull) - */ - public DaoWritable getDaoWritable(); - //========================================================================== // =========== // Basic Entity Update @@ -116,15 +110,15 @@ /** * Lump create the list. * - * @param entityList Entity-list. (NotNull and NotEmpty) + * @param entityList The list of entity. (NotNull and NotEmpty) * @return The array of created count. */ - public int[] lumpCreate(java.util.List entityList); + public int[] lumpCreate(List entityList); /** - * Lump Modify the list. + * Lump modify the list. * - * @param entityList Entity-list. (NotNull and NotEmpty) + * @param entityList The list of entity. (NotNull and NotEmpty) * @return Modified count. * @exception jp.sf.pal.userinfo.db.allcommon.exception.EntityAlreadyUpdatedException * When the entity has already been updated. And Only when @@ -132,12 +126,12 @@ * @exception jp.sf.pal.userinfo.db.allcommon.exception.EntityDuplicatedException * When the entity has been duplicated. */ - public int[] lumpModify(java.util.List entityList); + public int[] lumpModify(List entityList); /** * Lump remove the list. * - * @param entityList Entity-list. (NotNull and NotEmpty) + * @param entityList The list of entity. (NotNull and NotEmpty) * @return Removed count. * @exception jp.sf.pal.userinfo.db.allcommon.exception.EntityAlreadyUpdatedException * When the entity has already been updated. And Only when @@ -145,5 +139,5 @@ * @exception jp.sf.pal.userinfo.db.allcommon.exception.EntityDuplicatedException * When the entity has been duplicated. */ - public int[] lumpRemove(java.util.List entityList); + public int[] lumpRemove(List entityList); } Added: userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/bhv/core/BehaviorCommand.java =================================================================== --- userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/bhv/core/BehaviorCommand.java (rev 0) +++ userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/bhv/core/BehaviorCommand.java 2008-12-27 22:02:56 UTC (rev 1623) @@ -0,0 +1,71 @@ +package jp.sf.pal.userinfo.db.allcommon.bhv.core; + +import jp.sf.pal.userinfo.db.allcommon.cbean.ConditionBean; +import jp.sf.pal.userinfo.db.allcommon.cbean.outsidesql.OutsideSqlOption; + +/** + * @author DBFlute(AutoGenerator) + * @param The type of result. + */ +public interface BehaviorCommand { + + //========================================================================== + // ========= + // Basic Information + // ================= + public String getTableDbName(); + + public String getCommandName(); + + /** + * Get the return type of command. This type is not related to generic type + * because this is for conversion and check only. + * + * @return The return type of command. (NotNull) + */ + public Class getCommandReturnType(); + + public boolean isInitializeOnly(); + + //========================================================================== + // ========= + // Detail Information + // ================== + public boolean isConditionBean(); + + public boolean isOutsideSql(); + + public boolean isProcedure(); + + public boolean isSelect(); + + public boolean isSelectCount(); + + //========================================================================== + // ========= + // Process Callback + // ================ + public void beforeGettingSqlExecution(); + + public void afterExecuting(); + + //========================================================================== + // ========= + // SqlExecution Handling + // ===================== + public String buildSqlExecutionKey(); + + public SqlExecutionCreator createSqlExecutionCreator(); + + public Object[] getSqlExecutionArgument(); + + //========================================================================== + // ========= + // Argument Information + // ==================== + public ConditionBean getConditionBean(); + + public String getOutsideSqlPath(); + + public OutsideSqlOption getOutsideSqlOption(); +} Property changes on: userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/bhv/core/BehaviorCommand.java ___________________________________________________________________ Name: svn:eol-style + native Added: userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/bhv/core/BehaviorCommandComponentSetup.java =================================================================== --- userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/bhv/core/BehaviorCommandComponentSetup.java (rev 0) +++ userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/bhv/core/BehaviorCommandComponentSetup.java 2008-12-27 22:02:56 UTC (rev 1623) @@ -0,0 +1,23 @@ +package jp.sf.pal.userinfo.db.allcommon.bhv.core; + +import javax.sql.DataSource; + +import org.seasar.dao.BeanMetaDataFactory; +import org.seasar.dao.ValueTypeFactory; +import org.seasar.extension.jdbc.StatementFactory; + +/** + * @author DBFlute(AutoGenerator) + */ +public interface BehaviorCommandComponentSetup { + + public void setDataSource(DataSource dataSource); + + public void setStatementFactory(StatementFactory statementFactory); + + public void setBeanMetaDataFactory(BeanMetaDataFactory beanMetaDataFactory); + + public void setValueTypeFactory(ValueTypeFactory valueTypeFactory); + + public void setSqlFileEncoding(String sqlFileEncoding); +} Property changes on: userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/bhv/core/BehaviorCommandComponentSetup.java ___________________________________________________________________ Name: svn:eol-style + native Added: userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/bhv/core/BehaviorCommandInvoker.java =================================================================== --- userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/bhv/core/BehaviorCommandInvoker.java (rev 0) +++ userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/bhv/core/BehaviorCommandInvoker.java 2008-12-27 22:02:56 UTC (rev 1623) @@ -0,0 +1,842 @@ +package jp.sf.pal.userinfo.db.allcommon.bhv.core; + +import java.util.Arrays; +import java.util.List; +import java.util.Map; +import java.util.concurrent.ConcurrentHashMap; + +import javax.sql.DataSource; + +import jp.sf.pal.userinfo.db.allcommon.DBFluteConfig; +import jp.sf.pal.userinfo.db.allcommon.Entity; +import jp.sf.pal.userinfo.db.allcommon.InternalMapContext; +import jp.sf.pal.userinfo.db.allcommon.XLog; +import jp.sf.pal.userinfo.db.allcommon.cbean.ConditionBeanContext; +import jp.sf.pal.userinfo.db.allcommon.cbean.FetchNarrowingBeanContext; +import jp.sf.pal.userinfo.db.allcommon.cbean.outsidesql.OutsideSqlContext; +import jp.sf.pal.userinfo.db.allcommon.dbmeta.DBMeta; +import jp.sf.pal.userinfo.db.allcommon.dbmeta.DBMetaInstanceHandler; +import jp.sf.pal.userinfo.db.allcommon.helper.stacktrace.InvokeNameExtractingResource; +import jp.sf.pal.userinfo.db.allcommon.helper.stacktrace.InvokeNameResult; +import jp.sf.pal.userinfo.db.allcommon.helper.stacktrace.impl.InvokeNameExtractorImpl; +import jp.sf.pal.userinfo.db.allcommon.jdbc.StatementConfig; +import jp.sf.pal.userinfo.db.allcommon.s2dao.internal.various.InternalStatementFactory; +import jp.sf.pal.userinfo.db.allcommon.util.SimpleSystemUtil; +import jp.sf.pal.userinfo.db.allcommon.util.SimpleTypeUtil; +import jp.sf.pal.userinfo.db.allcommon.util.TraceViewUtil; + +import org.seasar.dao.BeanMetaDataFactory; +import org.seasar.dao.ValueTypeFactory; +import org.seasar.extension.jdbc.StatementFactory; +import org.seasar.framework.util.Disposable; +import org.seasar.framework.util.DisposableUtil; + +/** + * The invoker of behavior command. + * + *
+ * public interface methods are as follows:
+ * 
+ *   o injectComponentProperty(BehaviorCommandComponentSetup behaviorCommand);
+ *   o invoke(BehaviorCommand behaviorCommand);
+ *   o isDisposable();
+ *   o isExecutionCacheEmpty();
+ * 
+ * + * @author DBFlute(AutoGenerator) + */ +public class BehaviorCommandInvoker implements Disposable { + + //========================================================================== + // ========= + // Attribute + // ========= + // ----------------------------------------------------- + // Injection Target + // ---------------- + protected DataSource _dataSource; + + protected BeanMetaDataFactory _beanMetaDataFactory; + + protected ValueTypeFactory _valueTypeFactory; + + // ----------------------------------------------------- + // Fixed Property + // -------------- + protected final StatementFactory _statementFactory = createStatememtFactory(); + + protected final Map _executionMap = new ConcurrentHashMap(); + + // ----------------------------------------------------- + // Dispose Status + // -------------- + protected boolean disposable; + + //========================================================================== + // ========= + // Constructor + // =========== + public BehaviorCommandInvoker() { + } + + //========================================================================== + // ========= + // Command Set up + // ============== + /** + * Inject the properties of component to the command of behavior. {Public + * Interface} + * + * @param behaviorCommand The command of behavior. (NotNull) + */ + public void injectComponentProperty( + BehaviorCommandComponentSetup behaviorCommand) { + behaviorCommand.setDataSource(_dataSource); + behaviorCommand.setStatementFactory(_statementFactory); + behaviorCommand.setBeanMetaDataFactory(_beanMetaDataFactory); + behaviorCommand.setValueTypeFactory(_valueTypeFactory); + behaviorCommand.setSqlFileEncoding(getSqlFileEncoding()); + } + + protected String getSqlFileEncoding() { + return "UTF-8"; // This value is set when generating. + } + + //========================================================================== + // ========= + // Command Invoke + // ============== + /** + * Invoke the command of behavior. {Public Interface} This method is an + * entry point! + * + * @param The type of result. + * @param behaviorCommand The command of behavior. (NotNull) + * @return The result object. (Nullable) + */ + public RESULT invoke(BehaviorCommand behaviorCommand) { + clearContext(); + try { + return doInvoke(behaviorCommand); + } finally { + clearContext(); + } + } + + /** + * @param The type of result. + * @param behaviorCommand The command of behavior. (NotNull) + * @return The result object. (Nullable) + */ + protected RESULT doInvoke(BehaviorCommand behaviorCommand) { + // - - - - - - - - - - - - - + // Initialize SQL Execution + // - - - - - - - - - - - - - + if (behaviorCommand.isInitializeOnly()) { + initializeSqlExecution(behaviorCommand); + return null; // The end! (Initialize Only) + } + behaviorCommand.beforeGettingSqlExecution(); + + SqlExecution execution = null; + try { + final String key = behaviorCommand.buildSqlExecutionKey(); + execution = getSqlExecution(key); + if (execution == null) { + long beforeCmd = 0; + if (isLogEnabled()) { + beforeCmd = System.currentTimeMillis(); + } + SqlExecutionCreator creator = behaviorCommand + .createSqlExecutionCreator(); + execution = getSqlExecution(key, creator); + if (isLogEnabled()) { + final long afterCmd = System.currentTimeMillis(); + if (beforeCmd != afterCmd) { + logSqlExecution(behaviorCommand, execution, beforeCmd, + afterCmd); + } + } + } + } finally { + if (isLogEnabled()) { + logInvocation(behaviorCommand); + } + } + + long before = 0; + if (isLogEnabled()) { + before = System.currentTimeMillis(); + } + + Object ret = null; + try { + final Object[] args = behaviorCommand.getSqlExecutionArgument(); + ret = executeSql(execution, args); + } finally { + behaviorCommand.afterExecuting(); + } + final Class retType = behaviorCommand.getCommandReturnType(); + assertRetType(retType, ret); + + if (isLogEnabled()) { + final long after = System.currentTimeMillis(); + logReturn(behaviorCommand, retType, ret, before, after); + } + + // - - - - - - - - - - + // Convert and Return! + // - - - - - - - - - - + if (retType.isPrimitive()) { + ret = convertPrimitiveWrapper(retType, ret); + } else if (Number.class.isAssignableFrom(retType)) { + ret = convertNumber(retType, ret); + } + @SuppressWarnings("unchecked") + final RESULT result = (RESULT) ret; + return result; + } + + //========================================================================== + // ========= + // SQL Execution + // ============= + protected void initializeSqlExecution( + BehaviorCommand behaviorCommand) { + final String key = behaviorCommand.buildSqlExecutionKey(); + SqlExecutionCreator creator = behaviorCommand + .createSqlExecutionCreator(); + getSqlExecution(key, creator); + } + + protected SqlExecution getSqlExecution(String key) { + return _executionMap.get(key); + } + + /** + * @param key The key of SQL execution. (NotNull) + * @param executionCreator The creator of SQL execution. (NotNull) + * @return The SQL execution that may be created then. (NotNull) + */ + protected SqlExecution getSqlExecution(String key, + SqlExecutionCreator executionCreator) { + SqlExecution execution = getSqlExecution(key); + if (execution == null) { + synchronized (_executionMap) { + execution = getSqlExecution(key); + if (execution == null) { + if (isLogEnabled()) { + log("...Initializing sqlExecution for the key '" + key + + "'"); + } + _executionMap.put(key, executionCreator + .createSqlExecution()); + } else { + if (isLogEnabled()) { + log("...Getting sqlExecution as cache because the previous thread have already initilized."); + } + } + } + execution = getSqlExecution(key); + if (execution == null) { + String msg = "sqlExecutionCreator.createSqlCommand() should not return null:"; + msg = msg + " sqlExecutionCreator=" + executionCreator + + " key=" + key; + throw new IllegalStateException(msg); + } + if (!disposable) { + synchronized (this) { + if (!disposable) { + toBeDisposable(); + } + } + } + } + return execution; + } + + protected Object executeSql(SqlExecution execution, Object[] args) { + return execution.execute(args); + } + + //========================================================================== + // ========= + // Log SqlCommand + // ============== + protected void logSqlExecution( + BehaviorCommand behaviorCommand, SqlExecution execution, + long beforeCmd, long afterCmd) { + log("SqlExecution Initialization Cost: [" + + TraceViewUtil.convertToPerformanceView(afterCmd - beforeCmd) + + "]"); + } + + //========================================================================== + // ========= + // Log Invocation + // ============== + protected void logInvocation( + BehaviorCommand behaviorCommand) { + final StackTraceElement[] stackTrace = new Exception().getStackTrace(); + final InvokeNameResult behaviorResult = extractBehaviorInvokeName(stackTrace); + filterBehaviorResult(behaviorCommand, behaviorResult); + + final String invokeClassName; + final String invokeMethodName; + if (!behaviorResult.isEmptyResult()) { + invokeClassName = behaviorResult.getSimpleClassName(); + invokeMethodName = behaviorResult.getMethodName(); + } else { + invokeClassName = behaviorCommand.getTableDbName(); + invokeMethodName = behaviorCommand.getCommandName(); + } + final String expWithoutKakko = buildInvocationExpressionWithoutKakko( + behaviorCommand, invokeClassName, invokeMethodName); + + // Save behavior invoke name for error message. + putObjectToMapContext("df:BehaviorInvokeName", expWithoutKakko + "()"); + + final String equalBorder = buildFitBorder("", "=", expWithoutKakko, + false); + final String callerExpression = expWithoutKakko + "()"; + + log("/=====================================================" + + equalBorder + "=="); + log(" " + + callerExpression); + log(" " + + equalBorder + "=/"); + + logPath(behaviorCommand, stackTrace, behaviorResult); + + if (behaviorCommand.isOutsideSql() && !behaviorCommand.isProcedure()) { + final OutsideSqlContext outsideSqlContext = getOutsideSqlContext(); + if (outsideSqlContext != null) { + log("path: " + behaviorCommand.getOutsideSqlPath()); + log("option: " + behaviorCommand.getOutsideSqlOption()); + } + } + } + + protected void filterBehaviorResult( + BehaviorCommand behaviorCommand, + InvokeNameResult behaviorResult) { + final String simpleClassName = behaviorResult.getSimpleClassName(); + if (simpleClassName == null) { + return; + } + if (simpleClassName.contains("Behavior") + && simpleClassName.endsWith("$SLFunction")) { + final String behaviorClassName = findBehaviorClassNameFromDBMeta(behaviorCommand + .getTableDbName()); + behaviorResult.setSimpleClassName(behaviorClassName); + behaviorResult.setMethodName("scalarSelect()." + + behaviorResult.getMethodName()); + } + } + + protected void logPath(BehaviorCommand behaviorCommand, + StackTraceElement[] stackTrace, InvokeNameResult behaviorResult) { + final int bhvNextIndex = behaviorResult.getNextStartIndex(); + final InvokeNameResult clientResult = extractClientInvokeName( + stackTrace, bhvNextIndex); + final int clientFirstIndex = clientResult.getFoundFirstIndex(); + final InvokeNameResult byPassResult = extractByPassInvokeName( + stackTrace, bhvNextIndex, clientFirstIndex - bhvNextIndex); + + final String clientInvokeName = clientResult.getInvokeName(); + final String byPassInvokeName = byPassResult.getInvokeName(); + final String behaviorInvokeName = behaviorResult.getInvokeName(); + if (clientInvokeName.trim().length() == 0 + && byPassInvokeName.trim().length() == 0) { + return; + } + + // Save client invoke name for error message. + if (!clientResult.isEmptyResult()) { + putObjectToMapContext("df:ClientInvokeName", clientInvokeName); + } + // Save by-pass invoke name for error message. + if (!byPassResult.isEmptyResult()) { + putObjectToMapContext("df:ByPassInvokeName", byPassInvokeName); + } + + log(clientInvokeName + byPassInvokeName + behaviorInvokeName + "..."); + } + + protected String buildInvocationExpressionWithoutKakko( + BehaviorCommand behaviorCommand, String invokeClassName, + String invokeMethodName) { + if (invokeClassName.contains("OutsideSql") + && invokeClassName.endsWith("Executor")) { // OutsideSql + // Executor Handling + try { + final String originalName = invokeClassName; + if (behaviorCommand.isOutsideSql()) { + final OutsideSqlContext outsideSqlContext = getOutsideSqlContext(); + final String tableDbName = outsideSqlContext + .getTableDbName(); + final String behaviorClassName = findBehaviorClassNameFromDBMeta(tableDbName); + invokeClassName = behaviorClassName + ".outsideSql()"; + if (originalName.endsWith("OutsideSqlEntityExecutor")) { + invokeClassName = invokeClassName + ".entityHandling()"; + } else if (originalName + .endsWith("OutsideSqlPagingExecutor")) { + if (outsideSqlContext.isAutoPagingLogging()) { + invokeClassName = invokeClassName + ".autoPaging()"; + } else { + invokeClassName = invokeClassName + + ".manualPaging()"; + } + } else if (originalName + .endsWith("OutsideSqlCursorExecutor")) { + invokeClassName = invokeClassName + ".cursorHandling()"; + } + } else { + invokeClassName = "OutsideSql"; + } + } catch (RuntimeException ignored) { + log("Ignored exception occurred: msg=" + ignored.getMessage()); + } + } + String callerExpressionWithoutKakko = invokeClassName + "." + + invokeMethodName; + if ("selectPage".equals(invokeMethodName)) { // Special Handling! + boolean resultTypeInteger = false; + if (behaviorCommand.isOutsideSql()) { + final OutsideSqlContext outsideSqlContext = getOutsideSqlContext(); + final Object resultTypeSpecification = outsideSqlContext + .getResultTypeSpecification(); + if (resultTypeSpecification != null + && resultTypeSpecification instanceof Class) { + final Class resultType = (Class) resultTypeSpecification; + if (Integer.class.isAssignableFrom(resultType)) { + resultTypeInteger = true; + } + } + } + if (resultTypeInteger || behaviorCommand.isSelectCount()) { + callerExpressionWithoutKakko = callerExpressionWithoutKakko + + "():count"; + } else { + callerExpressionWithoutKakko = callerExpressionWithoutKakko + + "():paging"; + } + } + return callerExpressionWithoutKakko; + } + + protected String buildFitBorder(String prefix, String element, + String lengthTargetString, boolean space) { + final int length = space ? lengthTargetString.length() / 2 + : lengthTargetString.length(); + final StringBuffer sb = new StringBuffer(); + sb.append(prefix); + for (int i = 0; i < length; i++) { + sb.append(element); + if (space) { + sb.append(" "); + } + } + if (space) { + sb.append(element); + } + return sb.toString(); + } + + protected InvokeNameResult extractClientInvokeName( + StackTraceElement[] stackTrace, final int startIndex) { + final List 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 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 suffixList = Arrays.asList(new String[] { "Bhv", + "BehaviorReadable", "BehaviorWritable", "PagingInvoker" }); + final List keywordList = Arrays.asList(new String[] { "Bhv$", + "BehaviorReadable$", "BehaviorWritable$" }); + final List ousideSql1List = Arrays + .asList(new String[] { "OutsideSql" }); + final List ousideSql2List = Arrays + .asList(new String[] { "Executor" }); + final List 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 suffixList) { + for (String suffix : suffixList) { + if (className.endsWith(suffix)) { + return true; + } + } + return false; + } + + protected boolean isClassNameContains(String className, + List keywordList) { + for (String keyword : keywordList) { + if (className.contains(keyword)) { + return true; + } + } + return false; + } + + /** + * @param resource the call-back resource for invoke-name-extracting. + * (NotNull) + * @param stackTrace Stack log. (NotNull) + * @return The result of invoke name. (NotNull: If not found, returns empty + * string.) + */ + protected InvokeNameResult extractInvokeName( + InvokeNameExtractingResource resource, + StackTraceElement[] stackTrace) { + final InvokeNameExtractorImpl extractor = new InvokeNameExtractorImpl(); + extractor.setStackTrace(stackTrace); + return extractor.extractInvokeName(resource); + } + + /** + * @param simpleClassName The simple class name. (NotNull) + * @return The simple class name removed the base prefix. (NotNull) + */ + protected String removeBasePrefixFromSimpleClassName(String simpleClassName) { + if (!simpleClassName.startsWith("Bs")) { + return simpleClassName; + } + final int prefixLength = "Bs".length(); + if (!Character.isUpperCase(simpleClassName.substring(prefixLength) + .charAt(0))) { + return simpleClassName; + } + if (simpleClassName.length() <= prefixLength) { + return simpleClassName; + } + return "" + simpleClassName.substring(prefixLength); + } + + protected String findBehaviorClassNameFromDBMeta(String tableDbName) { + final DBMeta dbmeta = DBMetaInstanceHandler.findDBMeta(tableDbName); + final String behaviorTypeName = dbmeta.getBehaviorTypeName(); + final String behaviorClassName = behaviorTypeName + .substring(behaviorTypeName.lastIndexOf(".") + ".".length()); + return removeBasePrefixFromSimpleClassName(behaviorClassName); + } + + //========================================================================== + // ========= + // Log Return + // ========== + protected void logReturn(BehaviorCommand behaviorCommand, + Class retType, Object ret, long before, long after) { + try { + final String daoResultPrefix = "===========/ [" + + TraceViewUtil.convertToPerformanceView(after - before) + + " - "; + if (List.class.isAssignableFrom(retType)) { + if (ret == null) { + log(daoResultPrefix + "Selected list: null]"); + } else { + final List ls = (java.util.List) ret; + if (ls.isEmpty()) { + log(daoResultPrefix + "Selected list: 0]"); + } else if (ls.size() == 1 && ls.get(0) instanceof Number) { + log(daoResultPrefix + "Selected count: " + ls.get(0) + + "]"); + } else { + log(daoResultPrefix + "Selected list: " + ls.size() + + " first=" + ls.get(0) + "]"); + } + } + } else if (Entity.class.isAssignableFrom(retType)) { + if (ret == null) { + log(daoResultPrefix + "Selected entity: null" + "]"); + } else { + final Entity entity = (Entity) ret; + log(daoResultPrefix + "Selected entity: " + entity + "]"); + } + } else if (Entity.class.isAssignableFrom(retType)) { + if (ret == null) { + log(daoResultPrefix + "Selected entity: null" + "]"); + } else { + final Entity entity = (Entity) ret; + log(daoResultPrefix + "Selected entity: " + entity + "]"); + } + } else if (int[].class.isAssignableFrom(retType)) { + if (ret == null) { + log(daoResultPrefix + "Selected entity: null" + "]"); + } else { + final int[] resultArray = (int[]) ret; + if (resultArray.length == 0) { + log(daoResultPrefix + "All updated count: 0]"); + } else { + final StringBuilder sb = new StringBuilder(); + boolean resultExpressionScope = true; + int resultCount = 0; + int loopCount = 0; + for (int element : resultArray) { + resultCount = resultCount + element; + if (resultExpressionScope) { + if (loopCount <= 10) { + if (sb.length() == 0) { + sb.append(element); + } else { + sb.append(",").append(element); + } + } else { + sb.append(",").append("..."); + resultExpressionScope = false; + } + } + ++loopCount; + } + sb.insert(0, "{").append("}"); + log(daoResultPrefix + "All updated count: " + + resultCount + " result=" + sb + "]"); + } + } + } else { + if (behaviorCommand.isSelectCount()) { + log(daoResultPrefix + "Selected count: " + ret + "]"); + } else { + log(daoResultPrefix + "Result: " + ret + "]"); + } + } + log(" "); + } catch (RuntimeException e) { + String msg = "Result object debug threw the exception: behaviorCommand="; + msg = msg + behaviorCommand + " retType=" + retType; + msg = msg + " ret=" + ret; + throw e; + } + } + + //========================================================================== + // ========= + // Context Helper + // ============== + protected OutsideSqlContext getOutsideSqlContext() { + if (!OutsideSqlContext.isExistOutsideSqlContextOnThread()) { + return null; + } + return OutsideSqlContext.getOutsideSqlContextOnThread(); + } + + protected void putObjectToMapContext(String key, Object value) { + InternalMapContext.setObject(key, value); + } + + protected void clearContext() { + if (OutsideSqlContext.isExistOutsideSqlContextOnThread()) { + OutsideSqlContext.clearOutsideSqlContextOnThread(); + } + if (FetchNarrowingBeanContext.isExistFetchNarrowingBeanOnThread()) { + // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + // - - - - - - - - - - - - - - - + // Because there is possible that fetch narrowing has been ignored + // for manualPaging of outsideSql. + // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + // - - - - - - - - - - - - - - - + FetchNarrowingBeanContext.getFetchNarrowingBeanOnThread() + .restoreIgnoredFetchNarrowing(); + + FetchNarrowingBeanContext.clearFetchNarrowingBeanOnThread(); + } + if (ConditionBeanContext.isExistConditionBeanOnThread()) { + ConditionBeanContext.clearConditionBeanOnThread(); + } + if (InternalMapContext.isExistInternalMapContextOnThread()) { + InternalMapContext.clearInternalMapContextOnThread(); + } + } + + //========================================================================== + // ========= + // Execute Status Log + // ================== + protected void log(String msg) { + XLog.log(msg); + } + + protected boolean isLogEnabled() { + return XLog.isLogEnabled(); + } + + protected StatementFactory createStatememtFactory() { + final StatementConfig defaultStatementConfig = DBFluteConfig + .getInstance().getDefaultStatementConfig(); + final boolean internalDebug = DBFluteConfig.getInstance() + .isInternalDebug(); + InternalStatementFactory factory = new InternalStatementFactory(); + factory.setDefaultStatementConfig(defaultStatementConfig); + factory.setInternalDebug(internalDebug); + return factory; + } + + //========================================================================== + // ========= + // Dispose + // ======= + public void toBeDisposable() { + DisposableUtil.add(this); + disposable = true; + } + + public void dispose() { + _executionMap.clear(); + disposable = false; + } + + public boolean isDisposable() { + return disposable; + } + + public boolean isExecutionCacheEmpty() { + return _executionMap.isEmpty(); + } + + //========================================================================== + // ========= + // Convert Helper + // ============== + protected Object convertPrimitiveWrapper(Class retType, Object ret) { + return SimpleTypeUtil.toWrapper(retType, ret); + } + + protected Object convertNumber(Class retType, Object ret) { + return SimpleTypeUtil.toNumber(retType, ret); + } + + //========================================================================== + // ========= + // Assert Helper + // ============= + protected void assertRetType(Class retType, Object ret) { + if (List.class.isAssignableFrom(retType)) { + if (ret != null && !(ret instanceof List)) { + String msg = "The retType is difference from actual return: "; + msg = msg + "retType=" + retType + " ret.getClass()=" + + ret.getClass() + " ref=" + ret; + throw new IllegalStateException(msg); + } + } else if (Entity.class.isAssignableFrom(retType)) { + if (ret != null && !(ret instanceof Entity)) { + String msg = "The retType is difference from actual return: "; + msg = msg + "retType=" + retType + " ret.getClass()=" + + ret.getClass() + " ref=" + ret; + throw new IllegalStateException(msg); + } + } + } + + //========================================================================== + // ========= + // General Helper + // ============== + protected String getLineSeparator() { + return SimpleSystemUtil.getLineSeparator(); + } + + //========================================================================== + // ========= + // Accessor + // ======== + public void setDataSource(DataSource dataSource) { + _dataSource = dataSource; + } + + public void setBeanMetaDataFactory(BeanMetaDataFactory beanMetaDataFactory) { + _beanMetaDataFactory = beanMetaDataFactory; + } + + public void setValueTypeFactory(ValueTypeFactory valueTypeFactory) { + _valueTypeFactory = valueTypeFactory; + } +} Property changes on: userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/bhv/core/BehaviorCommandInvoker.java ___________________________________________________________________ Name: svn:eol-style + native Added: userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/bhv/core/BehaviorInitializer.java =================================================================== --- userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/bhv/core/BehaviorInitializer.java (rev 0) +++ userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/bhv/core/BehaviorInitializer.java 2008-12-27 22:02:56 UTC (rev 1623) @@ -0,0 +1,173 @@ +package jp.sf.pal.userinfo.db.allcommon.bhv.core; + +import java.util.Collections; +import java.util.Map; +import java.util.concurrent.ConcurrentHashMap; + +import javax.sql.XADataSource; + +import jp.sf.pal.userinfo.db.allcommon.DBDef; +import jp.sf.pal.userinfo.db.allcommon.DBFluteConfig; +import jp.sf.pal.userinfo.db.allcommon.cbean.ConditionBeanContext; +import jp.sf.pal.userinfo.db.allcommon.dbmeta.DBMetaInstanceHandler; +import jp.sf.pal.userinfo.db.allcommon.s2dao.internal.sqllog.InternalSqlLogRegistry; +import jp.sf.pal.userinfo.db.allcommon.util.SimpleSystemUtil; + +import org.seasar.extension.dbcp.impl.XADataSourceImpl; + +/** + * @author DBFlute(AutoGenerator) + */ +public class BehaviorInitializer { + + //========================================================================== + // ========= + // Definition + // ========== + /** Log-instance. */ + private static final org.apache.commons.logging.Log _log = org.apache.commons.logging.LogFactory + .getLog(BehaviorInitializer.class); + + // ----------------------------------------------------- + // For DBMeta + // ---------- + /** + * The map of table DB name and class name for the handler of DB meta + * instance. + */ + protected static final Map _tableDbNameClassNameMap; + static { + final Map tmpMap = newConcurrentHashMap(); + tmpMap.put("GROUP_INFO", + "jp.sf.pal.userinfo.db.bsentity.dbmeta.GroupInfoDbm"); + tmpMap.put("GROUP_MAPPING", + "jp.sf.pal.userinfo.db.bsentity.dbmeta.GroupMappingDbm"); + tmpMap.put("ROLE_INFO", + "jp.sf.pal.userinfo.db.bsentity.dbmeta.RoleInfoDbm"); + tmpMap.put("ROLE_MAPPING", + "jp.sf.pal.userinfo.db.bsentity.dbmeta.RoleMappingDbm"); + tmpMap.put("USER_INFO", + "jp.sf.pal.userinfo.db.bsentity.dbmeta.UserInfoDbm"); + _tableDbNameClassNameMap = Collections.unmodifiableMap(tmpMap); + } + + protected static ConcurrentHashMap newConcurrentHashMap() { + return new ConcurrentHashMap(); + } + + //========================================================================== + // ========= + // Constructor + // =========== + /** + * Constructor. And initialize various components related behavior. + * + * @param xaDataSource The data source of XA. (Nullable) + */ + public BehaviorInitializer(XADataSource xaDataSource) { + _log + .info("/* * * * * * * * * * * * * * * * * * * * * * * * * * * * {DBFlute}"); + initializeDBMetaResource(); + handleSqlLogRegistry(); + loadCoolClasses(); + if (xaDataSource != null) { + showInformation(xaDataSource); + setupDBDefByDriverClassName(xaDataSource); + } + DBFluteConfig.getInstance().lock(); + _log.info("* * * * */"); + } + + //========================================================================== + // ========= + // DBMeta + // ====== + protected void initializeDBMetaResource() { + DBMetaInstanceHandler.setupDBMetaResource(_tableDbNameClassNameMap); + } + + //========================================================================== + // ========= + // Cool Classes + // ============ + protected void loadCoolClasses() { // for S2Container basically + ConditionBeanContext.loadCoolClasses(); // Against the ClassLoader + // Headache! + } + + //========================================================================== + // ========= + // Information + // =========== + protected void showInformation(XADataSource xaDataSource) { + if (xaDataSource != null && xaDataSource instanceof XADataSourceImpl) { + final StringBuilder sb = new StringBuilder(); + final XADataSourceImpl xaDataSourceImpl = (XADataSourceImpl) xaDataSource; + final String driverClassName = xaDataSourceImpl + .getDriverClassName(); + final String url = xaDataSourceImpl.getURL(); + final String user = xaDataSourceImpl.getUser(); + sb.append(" [XADataSource]:").append(getLineSeparator()); + sb.append(" driver = " + driverClassName).append( + getLineSeparator()); + sb.append(" url = " + url).append(getLineSeparator()); + sb.append(" user = " + user); + _log.info("{Injection Information}" + getLineSeparator() + sb); + } + } + + //========================================================================== + // ========= + // Database Product Name + // ===================== + protected void setupDBDefByDriverClassName(XADataSource xaDataSource) { + if (xaDataSource != null && xaDataSource instanceof XADataSourceImpl) { + final XADataSourceImpl xaDataSourceImpl = (XADataSourceImpl) xaDataSource; + final String driverClassName = xaDataSourceImpl + .getDriverClassName(); + final DBDef dbdef = DBDef.byDriverClassName(driverClassName); + if (dbdef != null) { + DBDef.setCurrentDef(dbdef); + return; + } + } + } + + //========================================================================== + // ========= + // SQL Log Registry + // ================ + protected void handleSqlLogRegistry() { + if (DBFluteConfig.getInstance().isUseSqlLogRegistry()) { + final StringBuilder sb = new StringBuilder(); + sb.append("{SqlLog Information}").append(getLineSeparator()); + sb.append(" [SqlLogRegistry]").append(getLineSeparator()); + if (InternalSqlLogRegistry.setupSqlLogRegistry()) { + sb + .append( + " ...Setting up SqlLogRegistry(org.seasar.extension.jdbc)!") + .append(getLineSeparator()); + sb + .append(" Because the property 'useSqlLogRegistry' of the config of DBFlute is true."); + } else { + sb + .append(" SqlLogRegistry(org.seasar.extension.jdbc) is not supported at the version!"); + } + _log.info(sb); + } else { + final Object sqlLogRegistry = InternalSqlLogRegistry + .findContainerSqlLogRegistry(); + if (sqlLogRegistry != null) { + InternalSqlLogRegistry.closeRegistration(); + } + } + } + + //========================================================================== + // ========= + // General Helper + // ============== + protected String getLineSeparator() { + return SimpleSystemUtil.getLineSeparator(); + } +} Property changes on: userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/bhv/core/BehaviorInitializer.java ___________________________________________________________________ Name: svn:eol-style + native Added: userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/bhv/core/SqlExecution.java =================================================================== --- userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/bhv/core/SqlExecution.java (rev 0) +++ userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/bhv/core/SqlExecution.java 2008-12-27 22:02:56 UTC (rev 1623) @@ -0,0 +1,9 @@ +package jp.sf.pal.userinfo.db.allcommon.bhv.core; + +/** + * @author DBFlute(AutoGenerator) + */ +public interface SqlExecution { + + public Object execute(Object[] args); +} Property changes on: userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/bhv/core/SqlExecution.java ___________________________________________________________________ Name: svn:eol-style + native Added: userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/bhv/core/SqlExecutionCreator.java =================================================================== --- userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/bhv/core/SqlExecutionCreator.java (rev 0) +++ userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/bhv/core/SqlExecutionCreator.java 2008-12-27 22:02:56 UTC (rev 1623) @@ -0,0 +1,9 @@ +package jp.sf.pal.userinfo.db.allcommon.bhv.core; + +/** + * @author DBFlute(AutoGenerator) + */ +public interface SqlExecutionCreator { + + SqlExecution createSqlExecution(); +} Property changes on: userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/bhv/core/SqlExecutionCreator.java ___________________________________________________________________ Name: svn:eol-style + native Added: userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/bhv/core/command/AbstractBehaviorCommand.java =================================================================== --- userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/bhv/core/command/AbstractBehaviorCommand.java (rev 0) +++ userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/bhv/core/command/AbstractBehaviorCommand.java 2008-12-27 22:02:56 UTC (rev 1623) @@ -0,0 +1,261 @@ +package jp.sf.pal.userinfo.db.allcommon.bhv.core.command; + +import java.sql.ResultSet; +import java.sql.SQLException; +import java.util.ArrayList; +import java.util.List; + +import javax.sql.DataSource; + +import jp.sf.pal.userinfo.db.allcommon.DBDef; +import jp.sf.pal.userinfo.db.allcommon.bhv.core.BehaviorCommand; +import jp.sf.pal.userinfo.db.allcommon.bhv.core.BehaviorCommandComponentSetup; +import jp.sf.pal.userinfo.db.allcommon.s2dao.internal.rshandler.InternalBeanListMetaDataResultSetHandler; +import jp.sf.pal.userinfo.db.allcommon.s2dao.internal.sqlcommand.InternalUpdateDynamicCommand; +import jp.sf.pal.userinfo.db.allcommon.s2dao.internal.various.InternalRelationRowCreator; +import jp.sf.pal.userinfo.db.allcommon.s2dao.internal.various.InternalRowCreator; + +import org.seasar.dao.BeanMetaData; +import org.seasar.dao.BeanMetaDataFactory; +import org.seasar.dao.ValueTypeFactory; +import org.seasar.extension.jdbc.ResultSetHandler; +import org.seasar.extension.jdbc.StatementFactory; +import org.seasar.extension.jdbc.ValueType; +import org.seasar.extension.jdbc.types.ValueTypes; + +/** + * @author DBFlute(AutoGenerator) + * @param The type of result. + */ +public abstract class AbstractBehaviorCommand implements + BehaviorCommand, BehaviorCommandComponentSetup { + + //========================================================================== + // ========= + // Attribute + // ========= + // ----------------------------------------------------- + // Basic Information + // ----------------- + /** The table DB name. (Required) */ + protected String _tableDbName; + + /** Is it initialize only? (Choice) */ + protected boolean _initializeOnly; + + // ----------------------------------------------------- + // Injection Component + // ------------------- + protected DataSource _dataSource; + + protected StatementFactory _statementFactory; + + protected BeanMetaDataFactory _beanMetaDataFactory; + + protected ValueTypeFactory _valueTypeFactory; + + protected String _sqlFileEncoding; + + //========================================================================== + // ========= + // Factory + // ======= + // ----------------------------------------------------- + // UpdateDynamicCommnd + // ------------------- + protected InternalUpdateDynamicCommand createUpdateDynamicCommand( + String[] argNames, Class[] argTypes, String sql) { + final InternalUpdateDynamicCommand cmd = new InternalUpdateDynamicCommand( + _dataSource, _statementFactory); + cmd.setArgNames(argNames); + cmd.setArgTypes(argTypes); + if (sql != null) { + cmd.setSql(sql); + } + return cmd; + } + + // ----------------------------------------------------- + // ResultSetHandler + // ---------------- + protected ResultSetHandler createBeanListMetaDataResultSetHandler( + BeanMetaData bmd) { + final InternalRowCreator rowCreator = createInternalRowCreator(bmd); + final InternalRelationRowCreator relationRowCreator = createInternalRelationRowCreator(bmd); + return new InternalBeanListMetaDataResultSetHandler(bmd, rowCreator, + relationRowCreator); + } + + protected ResultSetHandler createObjectResultSetHandler(Class objectType) { + final ValueType valueType = ValueTypes.getValueType(objectType); + return new InternalObjectResultSetHandler(valueType); + } + + protected ResultSetHandler createObjectListResultSetHandler( + Class objectType) { + final ValueType valueType = ValueTypes.getValueType(objectType); + return createObjectListResultSetHandler(valueType); + } + + protected ResultSetHandler createObjectListResultSetHandler( + ValueType valueType) { + return new InternalObjectListResultSetHandler(valueType); + } + + protected static class InternalObjectResultSetHandler implements + ResultSetHandler { + private ValueType valueType; + + public InternalObjectResultSetHandler(ValueType valueType) { + this.valueType = valueType; + } + + public Object handle(ResultSet rs) throws SQLException { + while (rs.next()) { + return valueType.getValue(rs, 1); + } + return null; + } + } + + protected static class InternalObjectListResultSetHandler implements + ResultSetHandler { + private ValueType valueType; + + public InternalObjectListResultSetHandler(ValueType valueType) { + this.valueType = valueType; + } + + public Object handle(ResultSet rs) throws SQLException { + final List ret = new ArrayList(); + while (rs.next()) { + ret.add(valueType.getValue(rs, 1)); + } + return ret; + } + } + + protected static class InternalNullResultSetHandler implements + ResultSetHandler { + public Object handle(ResultSet rs) throws SQLException { + return null; + } + } + + protected InternalRowCreator createInternalRowCreator(BeanMetaData bmd) { + final Class clazz = bmd != null ? bmd.getBeanClass() : null; + return InternalRowCreator.createInternalRowCreator(clazz); + } + + protected InternalRelationRowCreator createInternalRelationRowCreator( + BeanMetaData bmd) { + return new InternalRelationRowCreator(); // Not yet implemented about + // performance tuning! + } + + //========================================================================== + // ========= + // Assist Helper + // ============= + protected String buildDbmsSuffix() { + final String productName = DBDef.getCurrentDef().code(); + return (productName != null ? "_" + productName.toLowerCase() : ""); + } + + //========================================================================== + // ========= + // Assert Helper + // ============= + protected void assertBasicProperty(String methodName) { + if (_tableDbName == null) { + throw new IllegalStateException(buildAssertMessage("_tableDbName", + methodName)); + } + } + + protected void assertComponentProperty(String methodName) { + if (_dataSource == null) { + throw new IllegalStateException(buildAssertMessage("_dataSource", + methodName)); + } + if (_statementFactory == null) { + throw new IllegalStateException(buildAssertMessage( + "_statementFactory", methodName)); + } + if (_beanMetaDataFactory == null) { + throw new IllegalStateException(buildAssertMessage( + "_beanMetaDataFactory", methodName)); + } + if (_valueTypeFactory == null) { + throw new IllegalStateException(buildAssertMessage( + "_valueTypeFactory", methodName)); + } + if (_sqlFileEncoding == null) { + throw new IllegalStateException(buildAssertMessage( + "_sqlFileEncoding", methodName)); + } + } + + protected String buildAssertMessage(String propertyName, String methodName) { + propertyName = propertyName.startsWith("_") ? propertyName + .substring("_".length()) : propertyName; + String msg = "The property '" + propertyName + "' should not be null"; + msg = msg + " when you call " + methodName + "()."; + throw new IllegalStateException(msg); + } + + //========================================================================== + // ========= + // Basic Override + // ============== + @Override + public String toString() { + return getClass().getSimpleName() + ":{" + buildSqlExecutionKey() + "}"; + } + + //========================================================================== + // ========= + // Accessor + // ======== + // ----------------------------------------------------- + // Basic Information + // ----------------- + public String getTableDbName() { + return _tableDbName; + } + + public void setTableDbName(String tableDbName) { + _tableDbName = tableDbName; + } + + public void setInitializeOnly(boolean initializeOnly) { + _initializeOnly = initializeOnly; + } + + public boolean isInitializeOnly() { + return _initializeOnly; + } + + // ----------------------------------------------------- + // Injection Component + // ------------------- + public void setDataSource(DataSource dataSource) { + _dataSource = dataSource; + } + + public void setStatementFactory(StatementFactory statementFactory) { + _statementFactory = statementFactory; + } + + public void setBeanMetaDataFactory(BeanMetaDataFactory beanMetaDataFactory) { + _beanMetaDataFactory = beanMetaDataFactory; + } + + public void setValueTypeFactory(ValueTypeFactory valueTypeFactory) { + _valueTypeFactory = valueTypeFactory; + } + + public void setSqlFileEncoding(String sqlFileEncoding) { + _sqlFileEncoding = sqlFileEncoding; + } +} Property changes on: userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/bhv/core/command/AbstractBehaviorCommand.java ___________________________________________________________________ Name: svn:eol-style + native Added: userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/bhv/core/command/AbstractEntityCommand.java =================================================================== --- userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/bhv/core/command/AbstractEntityCommand.java (rev 0) +++ userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/bhv/core/command/AbstractEntityCommand.java 2008-12-27 22:02:56 UTC (rev 1623) @@ -0,0 +1,182 @@ +package jp.sf.pal.userinfo.db.allcommon.bhv.core.command; + +import java.util.ArrayList; +import java.util.List; + +import jp.sf.pal.userinfo.db.allcommon.Entity; +import jp.sf.pal.userinfo.db.allcommon.cbean.ConditionBean; +import jp.sf.pal.userinfo.db.allcommon.cbean.outsidesql.OutsideSqlOption; +import jp.sf.pal.userinfo.db.allcommon.dbmeta.DBMeta; + +import org.seasar.dao.BeanMetaData; +import org.seasar.extension.jdbc.PropertyType; + +/** + * @author DBFlute(AutoGenerator) + */ +public abstract class AbstractEntityCommand extends + AbstractBehaviorCommand { + + //========================================================================== + // ========= + // Attribute + // ========= + /** The type of entity. (Required) */ + protected Class _entityType; + + /** The instance of condition-bean. (Required) */ + protected Entity _entity; + + //========================================================================== + // ========= + // Basic Information + // ================= + public Class getCommandReturnType() { + return Integer.class; + } + + //========================================================================== + // ========= + // Detail Information + // ================== + public boolean isConditionBean() { + return false; + } + + public boolean isOutsideSql() { + return false; + } + + public boolean isProcedure() { + return false; + } + + public boolean isSelect() { + return false; + } + + public boolean isSelectCount() { + return false; + } + + //========================================================================== + // ========= + // Factory + // ======= + // ----------------------------------------------------- + // BeanMetaData + // ------------ + protected BeanMetaData createBeanMetaData() { + return _beanMetaDataFactory.createBeanMetaData(_entityType); + } + + //========================================================================== + // ========= + // Process Callback + // ================ + public void beforeGettingSqlExecution() { + } + + public void afterExecuting() { + } + + //========================================================================== + // ========= + // SqlExecution Handling + // ===================== + public String buildSqlExecutionKey() { + assertStatus("buildSqlExecutionKey"); + return _tableDbName + ":" + getCommandName() + "(" + + _entityType.getSimpleName() + ")"; + } + + public Object[] getSqlExecutionArgument() { + assertStatus("getSqlExecutionArgument"); + return new Object[] { _entity }; + } + + //========================================================================== + // ========= + // Argument Information + // ==================== + public ConditionBean getConditionBean() { + return null; + } + + public String getOutsideSqlPath() { + return null; + } + + public OutsideSqlOption getOutsideSqlOption() { + return null; + } + + //========================================================================== + // ========= + // Assist Helper + // ============= + protected DBMeta findDBMeta() { + // /- - - - - - - - - - - - - - - - - - - - - - - - - - - - + // Cannot use the handler of DBMeta instance + // because the customize-entity is contained to find here. + // - - - - - - - - - -/ + // DBMetaInstanceHandler.findDBMeta(_tableDbName); + + final Class beanType = _entityType; + if (beanType == null) { + return null; + } + if (!Entity.class.isAssignableFrom(beanType)) { + return null; + } + final Entity entity; + try { + entity = (Entity) beanType.newInstance(); + } catch (InstantiationException e) { + throw new IllegalStateException(e); + } catch (IllegalAccessException e) { + throw new IllegalStateException(e); + } + return entity.getDBMeta(); + } + + protected String[] getPersistentPropertyNames(BeanMetaData bmd) { + final List nameList = new ArrayList(); + for (int i = 0; i < bmd.getPropertyTypeSize(); ++i) { + final PropertyType pt = bmd.getPropertyType(i); + if (pt.isPersistent()) { + nameList.add(pt.getPropertyName()); + } + } + return nameList.toArray(new String[nameList.size()]); + } + + //========================================================================== + // ========= + // Assert Helper + // ============= + protected void assertStatus(String methodName) { + assertBasicProperty(methodName); + assertComponentProperty(methodName); + if (_entityType == null) { + throw new IllegalStateException(buildAssertMessage("_entityType", + methodName)); + } + if (_entity == null) { + throw new IllegalStateException(buildAssertMessage("_entity", + methodName)); + } + } + + //========================================================================== + // ========= + // Accessor + // ======== + public void setEntityType(Class entityType) { + _entityType = entityType; + } + + public void setEntity(Entity entity) { + _entity = entity; + } +} Property changes on: userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/bhv/core/command/AbstractEntityCommand.java ___________________________________________________________________ Name: svn:eol-style + native Added: userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/bhv/core/command/AbstractListEntityCommand.java =================================================================== --- userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/bhv/core/command/AbstractListEntityCommand.java (rev 0) +++ userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/bhv/core/command/AbstractListEntityCommand.java 2008-12-27 22:02:56 UTC (rev 1623) @@ -0,0 +1,182 @@ +package jp.sf.pal.userinfo.db.allcommon.bhv.core.command; + +import java.util.ArrayList; +import java.util.List; + +import jp.sf.pal.userinfo.db.allcommon.Entity; +import jp.sf.pal.userinfo.db.allcommon.cbean.ConditionBean; +import jp.sf.pal.userinfo.db.allcommon.cbean.outsidesql.OutsideSqlOption; +import jp.sf.pal.userinfo.db.allcommon.dbmeta.DBMeta; + +import org.seasar.dao.BeanMetaData; +import org.seasar.extension.jdbc.PropertyType; + +/** + * @author DBFlute(AutoGenerator) + */ +public abstract class AbstractListEntityCommand extends + AbstractBehaviorCommand { + + //========================================================================== + // ========= + // Attribute + // ========= + /** The type of entity. (Required) */ + protected Class _entityType; + + /** The instance of condition-bean. (Required) */ + protected List _entityList; + + //========================================================================== + // ========= + // Basic Information + // ================= + public Class getCommandReturnType() { + return int[].class; + } + + //========================================================================== + // ========= + // Detail Information + // ================== + public boolean isConditionBean() { + return false; + } + + public boolean isOutsideSql() { + return false; + } + + public boolean isProcedure() { + return false; + } + + public boolean isSelect() { + return false; + } + + public boolean isSelectCount() { + return false; + } + + //========================================================================== + // ========= + // Factory + // ======= + // ----------------------------------------------------- + // BeanMetaData + // ------------ + protected BeanMetaData createBeanMetaData() { + return _beanMetaDataFactory.createBeanMetaData(_entityType); + } + + //========================================================================== + // ========= + // Process Callback + // ================ + public void beforeGettingSqlExecution() { + } + + public void afterExecuting() { + } + + //========================================================================== + // ========= + // SqlExecution Handling + // ===================== + public String buildSqlExecutionKey() { + assertStatus("buildSqlExecutionKey"); + return _tableDbName + ":" + getCommandName() + "(List<" + + _entityType.getSimpleName() + ">)"; + } + + public Object[] getSqlExecutionArgument() { + assertStatus("getSqlExecutionArgument"); + return new Object[] { _entityList }; + } + + //========================================================================== + // ========= + // Argument Information + // ==================== + public ConditionBean getConditionBean() { + return null; + } + + public String getOutsideSqlPath() { + return null; + } + + public OutsideSqlOption getOutsideSqlOption() { + return null; + } + + //========================================================================== + // ========= + // Assist Helper + // ============= + protected DBMeta findDBMeta() { + // /- - - - - - - - - - - - - - - - - - - - - - - - - - - - + // Cannot use the handler of DBMeta instance + // because the customize-entity is contained to find here. + // - - - - - - - - - -/ + // DBMetaInstanceHandler.findDBMeta(_tableDbName); + + final Class beanType = _entityType; + if (beanType == null) { + return null; + } + if (!Entity.class.isAssignableFrom(beanType)) { + return null; + } + final Entity entity; + try { + entity = (Entity) beanType.newInstance(); + } catch (InstantiationException e) { + throw new IllegalStateException(e); + } catch (IllegalAccessException e) { + throw new IllegalStateException(e); + } + return entity.getDBMeta(); + } + + protected String[] getPersistentPropertyNames(BeanMetaData bmd) { + final List nameList = new ArrayList(); + for (int i = 0; i < bmd.getPropertyTypeSize(); ++i) { + final PropertyType pt = bmd.getPropertyType(i); + if (pt.isPersistent()) { + nameList.add(pt.getPropertyName()); + } + } + return nameList.toArray(new String[nameList.size()]); + } + + //========================================================================== + // ========= + // Assert Helper + // ============= + protected void assertStatus(String methodName) { + assertBasicProperty(methodName); + assertComponentProperty(methodName); + if (_entityType == null) { + throw new IllegalStateException(buildAssertMessage("_entityType", + methodName)); + } + if (_entityList == null) { + throw new IllegalStateException(buildAssertMessage("_entityList", + methodName)); + } + } + + //========================================================================== + // ========= + // Accessor + // ======== + public void setEntityType(Class entityType) { + _entityType = entityType; + } + + public void setEntityList(List entityList) { + _entityList = entityList; + } +} Property changes on: userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/bhv/core/command/AbstractListEntityCommand.java ___________________________________________________________________ Name: svn:eol-style + native Added: userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/bhv/core/command/AbstractOutsideSqlCommand.java =================================================================== --- userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/bhv/core/command/AbstractOutsideSqlCommand.java (rev 0) +++ userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/bhv/core/command/AbstractOutsideSqlCommand.java 2008-12-27 22:02:56 UTC (rev 1623) @@ -0,0 +1,93 @@ +package jp.sf.pal.userinfo.db.allcommon.bhv.core.command; + +import jp.sf.pal.userinfo.db.allcommon.cbean.ConditionBean; +import jp.sf.pal.userinfo.db.allcommon.cbean.outsidesql.OutsideSqlOption; + +/** + * @author DBFlute(AutoGenerator) + * @param The type of result. + */ +public abstract class AbstractOutsideSqlCommand extends + AbstractBehaviorCommand { + + //========================================================================== + // ========= + // Attribute + // ========= + // ----------------------------------------------------- + // Basic Information + // ----------------- + /** The path of outside-SQL. (Required) */ + protected String _outsideSqlPath; + + /** The parameter-bean. (Required to set, but Nullable) */ + protected Object _parameterBean; + + /** The option of outside-SQL. (Required) */ + protected OutsideSqlOption _outsideSqlOption; + + //========================================================================== + // ========= + // Detail Information + // ================== + public boolean isConditionBean() { + return false; // When the command is for outside-SQL, it always be + // false. + } + + public boolean isOutsideSql() { + return true; + } + + public boolean isSelectCount() { + return false; // When the command is for outside-SQL, it always be + // false. + } + + //========================================================================== + // ========= + // Argument Information + // ==================== + public ConditionBean getConditionBean() { + return null; + } + + public String getOutsideSqlPath() { + return _outsideSqlPath; + } + + public OutsideSqlOption getOutsideSqlOption() { + return _outsideSqlOption; + } + + //========================================================================== + // ========= + // Assert Helper + // ============= + protected void assertOutsideSqlBasic(String methodName) { + if (_outsideSqlPath == null) { + throw new IllegalStateException(buildAssertMessage( + "_outsideSqlPath", methodName)); + } + if (_outsideSqlOption == null) { + throw new IllegalStateException(buildAssertMessage( + "_outsideSqlOption", methodName)); + } + } + + //========================================================================== + // ========= + // Accessor + // ======== + public void setOutsideSqlPath(String outsideSqlPath) { + _outsideSqlPath = outsideSqlPath; + } + + public void setParameterBean(Object parameterBean) { + _parameterBean = parameterBean; + } + + public void setOutsideSqlOption(OutsideSqlOption outsideSqlOption) { + _outsideSqlOption = outsideSqlOption; + } +} Property changes on: userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/bhv/core/command/AbstractOutsideSqlCommand.java ___________________________________________________________________ Name: svn:eol-style + native Added: userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/bhv/core/command/AbstractOutsideSqlSelectCommand.java =================================================================== --- userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/bhv/core/command/AbstractOutsideSqlSelectCommand.java (rev 0) +++ userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/bhv/core/command/AbstractOutsideSqlSelectCommand.java 2008-12-27 22:02:56 UTC (rev 1623) @@ -0,0 +1,175 @@ +package jp.sf.pal.userinfo.db.allcommon.bhv.core.command; + +import jp.sf.pal.userinfo.db.allcommon.bhv.core.SqlExecution; +import jp.sf.pal.userinfo.db.allcommon.bhv.core.SqlExecutionCreator; +import jp.sf.pal.userinfo.db.allcommon.bhv.core.execution.OutsideSqlSelectExecution; +import jp.sf.pal.userinfo.db.allcommon.cbean.FetchNarrowingBean; +import jp.sf.pal.userinfo.db.allcommon.cbean.FetchNarrowingBeanContext; +import jp.sf.pal.userinfo.db.allcommon.cbean.outsidesql.OutsideSqlContext; +import jp.sf.pal.userinfo.db.allcommon.cbean.outsidesql.OutsideSqlOption; + +import org.seasar.extension.jdbc.ResultSetHandler; + +/** + * The abstract command for OutsideSql.selectSomething(). + * + * @author DBFlute(AutoGenerator) + * @param The type of result. + */ +public abstract class AbstractOutsideSqlSelectCommand extends + AbstractOutsideSqlCommand { + + //========================================================================== + // ========= + // Detail Information + // ================== + public boolean isProcedure() { + return false; + } + + public boolean isSelect() { + return true; + } + + //========================================================================== + // ========= + // Process Callback + // ================ + public void beforeGettingSqlExecution() { + assertStatus("beforeGettingSqlExecution"); + final String path = _outsideSqlPath; + final Object pmb = _parameterBean; + final OutsideSqlOption option = _outsideSqlOption; + final Object resultTypeSpecification = getResultTypeSpecification(); + final boolean autoPagingLogging = (option.isAutoPaging() || option + .isSourcePagingRequestTypeAuto()); + final OutsideSqlContext outsideSqlContext = new OutsideSqlContext(); + outsideSqlContext.setOutsideSqlPath(path); + outsideSqlContext.setParameterBean(pmb); + outsideSqlContext.setResultTypeSpecification(resultTypeSpecification); + outsideSqlContext.setMethodName(getCommandName()); + outsideSqlContext.setStatementConfig(option.getStatementConfig()); + outsideSqlContext.setTableDbName(option.getTableDbName()); + outsideSqlContext.setDynamicBinding(option.isDynamicBinding()); + outsideSqlContext.setOffsetByCursorForcedly(option.isAutoPaging()); + outsideSqlContext.setLimitByCursorForcedly(option.isAutoPaging()); + outsideSqlContext.setAutoPagingLogging(autoPagingLogging); // for + // logging + outsideSqlContext.setupBehaviorQueryPathIfNeeds(); + OutsideSqlContext.setOutsideSqlContextOnThread(outsideSqlContext); + + // Set up fetchNarrowingBean. + setupOutsideSqlFetchNarrowingBean(pmb, option); + } + + protected void setupOutsideSqlFetchNarrowingBean(Object pmb, + OutsideSqlOption option) { + if (pmb == null + || !FetchNarrowingBeanContext.isTheTypeFetchNarrowingBean(pmb + .getClass())) { + return; + } + final FetchNarrowingBean fetchNarrowingBean = (FetchNarrowingBean) pmb; + if (option.isManualPaging()) { + fetchNarrowingBean.ignoreFetchNarrowing(); + } + FetchNarrowingBeanContext + .setFetchNarrowingBeanOnThread(fetchNarrowingBean); + } + + public void afterExecuting() { + } + + //========================================================================== + // ========= + // SqlExecution Handling + // ===================== + public String buildSqlExecutionKey() { + assertStatus("buildSqlExecutionKey"); + return generateSpecifiedOutsideSqlUniqueKey(); + } + + protected String generateSpecifiedOutsideSqlUniqueKey() { + final String methodName = getCommandName(); + final String path = _outsideSqlPath; + final Object pmb = _parameterBean; + final OutsideSqlOption option = _outsideSqlOption; + final Object resultTypeSpecification = getResultTypeSpecification(); + return OutsideSqlContext.generateSpecifiedOutsideSqlUniqueKey( + methodName, path, pmb, option, resultTypeSpecification); + } + + public SqlExecutionCreator createSqlExecutionCreator() { + assertStatus("createSqlExecutionCreator"); + return new SqlExecutionCreator() { + public SqlExecution createSqlExecution() { + final OutsideSqlContext outsideSqlContext = OutsideSqlContext + .getOutsideSqlContextOnThread(); + return createOutsideSqlSelectExecution(outsideSqlContext); + } + }; + } + + protected SqlExecution createOutsideSqlSelectExecution( + OutsideSqlContext outsideSqlContext) { + // - - - - - - - - - - - - - - - - - - - - - - - + // The attribute of Specified-OutsideSqlContext. + // - - - - - - - - - - - - - - - - - - - - - - - + final String suffix = buildDbmsSuffix(); + final String sql = outsideSqlContext.readFilteredOutsideSql( + _sqlFileEncoding, suffix); + final Object pmb = outsideSqlContext.getParameterBean(); + + // - - - - - - - - - - - - - - - + // The attribute of SqlCommand. + // - - - - - - - - - - - - - - - + final String[] argNames = (pmb != null ? new String[] { "pmb" } + : new String[] {}); + final Class[] argTypes = (pmb != null ? new Class[] { pmb + .getClass() } : new Class[] {}); + + // - - - - - - - - - - - - - + // Create ResultSetHandler. + // - - - - - - - - - - - - - + final ResultSetHandler handler = createOutsideSqlSelectResultSetHandler(); + + // - - - - - - - - - - - + // Create SqlExecution. + // - - - - - - - - - - - + return createOutsideSqlSelectExecution(handler, argNames, argTypes, sql); + } + + protected OutsideSqlSelectExecution createOutsideSqlSelectExecution( + ResultSetHandler handler, String[] argNames, Class[] argTypes, + String sql) { + final OutsideSqlSelectExecution cmd = new OutsideSqlSelectExecution( + _dataSource, _statementFactory, handler); + cmd.setArgNames(argNames); + cmd.setArgTypes(argTypes); + cmd.setSql(sql); + return cmd; + } + + public Object[] getSqlExecutionArgument() { + assertStatus("getSqlExecutionArgument"); + return new Object[] { _parameterBean }; + } + + //========================================================================== + // ========= + // Extension Point + // =============== + protected abstract ResultSetHandler createOutsideSqlSelectResultSetHandler(); + + protected abstract Object getResultTypeSpecification(); + + //========================================================================== + // ========= + // Assert Helper + // ============= + protected void assertStatus(String methodName) { + assertBasicProperty(methodName); + assertComponentProperty(methodName); + assertOutsideSqlBasic(methodName); + } +} Property changes on: userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/bhv/core/command/AbstractOutsideSqlSelectCommand.java ___________________________________________________________________ Name: svn:eol-style + native Added: userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/bhv/core/command/AbstractSelectCBCommand.java =================================================================== --- userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/bhv/core/command/AbstractSelectCBCommand.java (rev 0) +++ userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/bhv/core/command/AbstractSelectCBCommand.java 2008-12-27 22:02:56 UTC (rev 1623) @@ -0,0 +1,122 @@ +package jp.sf.pal.userinfo.db.allcommon.bhv.core.command; + +import jp.sf.pal.userinfo.db.allcommon.bhv.core.SqlExecution; +import jp.sf.pal.userinfo.db.allcommon.bhv.core.execution.SelectCBExecution; +import jp.sf.pal.userinfo.db.allcommon.cbean.ConditionBean; +import jp.sf.pal.userinfo.db.allcommon.cbean.outsidesql.OutsideSqlOption; + +import org.seasar.extension.jdbc.ResultSetHandler; + +/** + * @author DBFlute(AutoGenerator) + * @param The type of result. + */ +public abstract class AbstractSelectCBCommand extends + AbstractBehaviorCommand { + + //========================================================================== + // ========= + // Attribute + // ========= + /** The type of condition-bean. (Derived from conditionBean) */ + protected Class _conditionBeanType; + + /** The instance of condition-bean. (Required) */ + protected ConditionBean _conditionBean; + + //========================================================================== + // ========= + // Detail Information + // ================== + public boolean isConditionBean() { + return true; + } + + public boolean isOutsideSql() { + return false; + } + + public boolean isProcedure() { + return false; + } + + public boolean isSelect() { + return true; + } + + //========================================================================== + // ========= + // SqlExecution Handling + // ===================== + public String buildSqlExecutionKey() { + assertStatus("buildSqlExecutionKey"); + return _tableDbName + ":" + getCommandName() + "(" + + _conditionBeanType.getSimpleName() + ")"; + } + + protected SqlExecution createSelectCBExecution( + Class cbType, ResultSetHandler handler) { + return createSelectCBExecution(handler, new String[] { "dto" }, + new Class[] { cbType }); + } + + protected SelectCBExecution createSelectCBExecution( + ResultSetHandler handler, String[] argNames, Class[] argTypes) { + final SelectCBExecution cmd = new SelectCBExecution(_dataSource, + _statementFactory, handler); + cmd.setArgNames(argNames); + cmd.setArgTypes(argTypes); + return cmd; + } + + public Object[] getSqlExecutionArgument() { + assertStatus("getSqlExecutionArgument"); + return new Object[] { _conditionBean }; + } + + //========================================================================== + // ========= + // Argument Information + // ==================== + public ConditionBean getConditionBean() { + return _conditionBean; + } + + public String getOutsideSqlPath() { + return null; + } + + public OutsideSqlOption getOutsideSqlOption() { + return null; + } + + //========================================================================== + // ========= + // Assert Helper + // ============= + protected void assertStatus(String methodName) { + assertBasicProperty(methodName); + assertComponentProperty(methodName); + if (_conditionBeanType == null) { + throw new IllegalStateException(buildAssertMessage( + "_conditionBeanType", methodName)); + } + if (_conditionBean == null) { + throw new IllegalStateException(buildAssertMessage( + "_conditionBean", methodName)); + } + } + + //========================================================================== + // ========= + // Accessor + // ======== + public void setConditionBeanType( + Class conditionBeanType) { + _conditionBeanType = conditionBeanType; + } + + public void setConditionBean(ConditionBean conditionBean) { + _conditionBean = conditionBean; + } +} Property changes on: userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/bhv/core/command/AbstractSelectCBCommand.java ___________________________________________________________________ Name: svn:eol-style + native Added: userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/bhv/core/command/BatchDeleteEntityCommand.java =================================================================== --- userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/bhv/core/command/BatchDeleteEntityCommand.java (rev 0) +++ userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/bhv/core/command/BatchDeleteEntityCommand.java 2008-12-27 22:02:56 UTC (rev 1623) @@ -0,0 +1,51 @@ +package jp.sf.pal.userinfo.db.allcommon.bhv.core.command; + +import jp.sf.pal.userinfo.db.allcommon.bhv.core.SqlExecution; +import jp.sf.pal.userinfo.db.allcommon.bhv.core.SqlExecutionCreator; +import jp.sf.pal.userinfo.db.allcommon.s2dao.internal.sqlcommand.InternalDeleteBatchAutoStaticCommand; + +import org.seasar.dao.BeanMetaData; + +/** + * @author DBFlute(AutoGenerator) + */ +public class BatchDeleteEntityCommand extends AbstractListEntityCommand { + + //========================================================================== + // ========= + // Basic Information + // ================= + public String getCommandName() { + return "batchDelete"; + } + + //========================================================================== + // ========= + // SqlExecution Handling + // ===================== + public SqlExecutionCreator createSqlExecutionCreator() { + assertStatus("createSqlExecutionCreator"); + return new SqlExecutionCreator() { + public SqlExecution createSqlExecution() { + final BeanMetaData bmd = createBeanMetaData(); + return createBatchDeleteEntitySqlExecution(bmd); + } + }; + } + + protected SqlExecution createBatchDeleteEntitySqlExecution(BeanMetaData bmd) { + final String[] propertyNames = getPersistentPropertyNames(bmd); + return createDeleteBatchAutoStaticCommand(bmd, propertyNames); + } + + protected InternalDeleteBatchAutoStaticCommand createDeleteBatchAutoStaticCommand( + BeanMetaData bmd, String[] propertyNames) { + boolean opt = isOptimisticLockHandling(); + return new InternalDeleteBatchAutoStaticCommand(_dataSource, + _statementFactory, bmd, propertyNames, opt); + } + + protected boolean isOptimisticLockHandling() { + return true; + } +} Property changes on: userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/bhv/core/command/BatchDeleteEntityCommand.java ___________________________________________________________________ Name: svn:eol-style + native Added: userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/bhv/core/command/BatchDeleteNonstrictEntityCommand.java =================================================================== --- userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/bhv/core/command/BatchDeleteNonstrictEntityCommand.java (rev 0) +++ userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/bhv/core/command/BatchDeleteNonstrictEntityCommand.java 2008-12-27 22:02:56 UTC (rev 1623) @@ -0,0 +1,25 @@ +package jp.sf.pal.userinfo.db.allcommon.bhv.core.command; + +/** + * @author DBFlute(AutoGenerator) + */ +public class BatchDeleteNonstrictEntityCommand extends BatchDeleteEntityCommand { + + //========================================================================== + // ========= + // Basic Information + // ================= + @Override + public String getCommandName() { + return "batchDeleteNonstrict"; + } + + //========================================================================== + // ========= + // SqlExecution Handling + // ===================== + @Override + protected boolean isOptimisticLockHandling() { + return false; + } +} Property changes on: userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/bhv/core/command/BatchDeleteNonstrictEntityCommand.java ___________________________________________________________________ Name: svn:eol-style + native Added: userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/bhv/core/command/BatchInsertEntityCommand.java =================================================================== --- userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/bhv/core/command/BatchInsertEntityCommand.java (rev 0) +++ userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/bhv/core/command/BatchInsertEntityCommand.java 2008-12-27 22:02:56 UTC (rev 1623) @@ -0,0 +1,46 @@ +package jp.sf.pal.userinfo.db.allcommon.bhv.core.command; + +import jp.sf.pal.userinfo.db.allcommon.bhv.core.SqlExecution; +import jp.sf.pal.userinfo.db.allcommon.bhv.core.SqlExecutionCreator; +import jp.sf.pal.userinfo.db.allcommon.s2dao.internal.sqlcommand.InternalInsertBatchAutoStaticCommand; + +import org.seasar.dao.BeanMetaData; + +/** + * @author DBFlute(AutoGenerator) + */ +public class BatchInsertEntityCommand extends AbstractListEntityCommand { + + //========================================================================== + // ========= + // Basic Information + // ================= + public String getCommandName() { + return "batchInsert"; + } + + //========================================================================== + // ========= + // SqlExecution Handling + // ===================== + public SqlExecutionCreator createSqlExecutionCreator() { + assertStatus("createSqlExecutionCreator"); + return new SqlExecutionCreator() { + public SqlExecution createSqlExecution() { + final BeanMetaData bmd = createBeanMetaData(); + return createBatchInsertEntitySqlExecution(bmd); + } + }; + } + + protected SqlExecution createBatchInsertEntitySqlExecution(BeanMetaData bmd) { + final String[] propertyNames = getPersistentPropertyNames(bmd); + return createInsertBatchAutoStaticCommand(bmd, propertyNames); + } + + protected InternalInsertBatchAutoStaticCommand createInsertBatchAutoStaticCommand( + BeanMetaData bmd, String[] propertyNames) { + return new InternalInsertBatchAutoStaticCommand(_dataSource, + _statementFactory, bmd, propertyNames); + } +} Property changes on: userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/bhv/core/command/BatchInsertEntityCommand.java ___________________________________________________________________ Name: svn:eol-style + native Added: userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/bhv/core/command/BatchUpdateEntityCommand.java =================================================================== --- userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/bhv/core/command/BatchUpdateEntityCommand.java (rev 0) +++ userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/bhv/core/command/BatchUpdateEntityCommand.java 2008-12-27 22:02:56 UTC (rev 1623) @@ -0,0 +1,51 @@ +package jp.sf.pal.userinfo.db.allcommon.bhv.core.command; + +import jp.sf.pal.userinfo.db.allcommon.bhv.core.SqlExecution; +import jp.sf.pal.userinfo.db.allcommon.bhv.core.SqlExecutionCreator; +import jp.sf.pal.userinfo.db.allcommon.s2dao.internal.sqlcommand.InternalUpdateBatchAutoStaticCommand; + +import org.seasar.dao.BeanMetaData; + +/** + * @author DBFlute(AutoGenerator) + */ +public class BatchUpdateEntityCommand extends AbstractListEntityCommand { + + //========================================================================== + // ========= + // Basic Information + // ================= + public String getCommandName() { + return "batchUpdate"; + } + + //========================================================================== + // ========= + // SqlExecution Handling + // ===================== + public SqlExecutionCreator createSqlExecutionCreator() { + assertStatus("createSqlExecutionCreator"); + return new SqlExecutionCreator() { + public SqlExecution createSqlExecution() { + final BeanMetaData bmd = createBeanMetaData(); + return createBatchUpdateEntitySqlExecution(bmd); + } + }; + } + + protected SqlExecution createBatchUpdateEntitySqlExecution(BeanMetaData bmd) { + final String[] propertyNames = getPersistentPropertyNames(bmd); + return createUpdateBatchAutoStaticCommand(bmd, propertyNames); + } + + protected InternalUpdateBatchAutoStaticCommand createUpdateBatchAutoStaticCommand( + BeanMetaData bmd, String[] propertyNames) { + boolean opt = isOptimisticLockHandling(); + return new InternalUpdateBatchAutoStaticCommand(_dataSource, + _statementFactory, bmd, propertyNames, opt, opt); + } + + protected boolean isOptimisticLockHandling() { + return true; + } +} Property changes on: userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/bhv/core/command/BatchUpdateEntityCommand.java ___________________________________________________________________ Name: svn:eol-style + native Added: userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/bhv/core/command/BatchUpdateNonstrictEntityCommand.java =================================================================== --- userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/bhv/core/command/BatchUpdateNonstrictEntityCommand.java (rev 0) +++ userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/bhv/core/command/BatchUpdateNonstrictEntityCommand.java 2008-12-27 22:02:56 UTC (rev 1623) @@ -0,0 +1,25 @@ +package jp.sf.pal.userinfo.db.allcommon.bhv.core.command; + +/** + * @author DBFlute(AutoGenerator) + */ +public class BatchUpdateNonstrictEntityCommand extends BatchUpdateEntityCommand { + + //========================================================================== + // ========= + // Basic Information + // ================= + @Override + public String getCommandName() { + return "batchUpdateNonstrict"; + } + + //========================================================================== + // ========= + // SqlExecution Handling + // ===================== + @Override + protected boolean isOptimisticLockHandling() { + return false; + } +} Property changes on: userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/bhv/core/command/BatchUpdateNonstrictEntityCommand.java ___________________________________________________________________ Name: svn:eol-style + native Added: userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/bhv/core/command/DeleteEntityCommand.java =================================================================== --- userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/bhv/core/command/DeleteEntityCommand.java (rev 0) +++ userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/bhv/core/command/DeleteEntityCommand.java 2008-12-27 22:02:56 UTC (rev 1623) @@ -0,0 +1,51 @@ +package jp.sf.pal.userinfo.db.allcommon.bhv.core.command; + +import jp.sf.pal.userinfo.db.allcommon.bhv.core.SqlExecution; +import jp.sf.pal.userinfo.db.allcommon.bhv.core.SqlExecutionCreator; +import jp.sf.pal.userinfo.db.allcommon.s2dao.internal.sqlcommand.InternalDeleteAutoStaticCommand; + +import org.seasar.dao.BeanMetaData; + +/** + * @author DBFlute(AutoGenerator) + */ +public class DeleteEntityCommand extends AbstractEntityCommand { + + //========================================================================== + // ========= + // Basic Information + // ================= + public String getCommandName() { + return "delete"; + } + + //========================================================================== + // ========= + // SqlExecution Handling + // ===================== + public SqlExecutionCreator createSqlExecutionCreator() { + assertStatus("createSqlExecutionCreator"); + return new SqlExecutionCreator() { + public SqlExecution createSqlExecution() { + final BeanMetaData bmd = createBeanMetaData(); + return createDeleteEntitySqlExecution(bmd); + } + }; + } + + protected SqlExecution createDeleteEntitySqlExecution(BeanMetaData bmd) { + final String[] propertyNames = getPersistentPropertyNames(bmd); + return createDeleteAutoStaticCommand(bmd, propertyNames); + } + + protected InternalDeleteAutoStaticCommand createDeleteAutoStaticCommand( + BeanMetaData bmd, String[] propertyNames) { + return new InternalDeleteAutoStaticCommand(_dataSource, + _statementFactory, bmd, propertyNames, + isOptimisticLockHandling()); + } + + protected boolean isOptimisticLockHandling() { + return true; + } +} Property changes on: userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/bhv/core/command/DeleteEntityCommand.java ___________________________________________________________________ Name: svn:eol-style + native Added: userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/bhv/core/command/DeleteNonstrictEntityCommand.java =================================================================== --- userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/bhv/core/command/DeleteNonstrictEntityCommand.java (rev 0) +++ userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/bhv/core/command/DeleteNonstrictEntityCommand.java 2008-12-27 22:02:56 UTC (rev 1623) @@ -0,0 +1,25 @@ +package jp.sf.pal.userinfo.db.allcommon.bhv.core.command; + +/** + * @author DBFlute(AutoGenerator) + */ +public class DeleteNonstrictEntityCommand extends DeleteEntityCommand { + + //========================================================================== + // ========= + // Basic Information + // ================= + @Override + public String getCommandName() { + return "deleteNonstrict"; + } + + //========================================================================== + // ========= + // SqlExecution Handling + // ===================== + @Override + protected boolean isOptimisticLockHandling() { + return false; + } +} Property changes on: userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/bhv/core/command/DeleteNonstrictEntityCommand.java ___________________________________________________________________ Name: svn:eol-style + native Added: userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/bhv/core/command/InsertEntityCommand.java =================================================================== --- userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/bhv/core/command/InsertEntityCommand.java (rev 0) +++ userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/bhv/core/command/InsertEntityCommand.java 2008-12-27 22:02:56 UTC (rev 1623) @@ -0,0 +1,86 @@ +package jp.sf.pal.userinfo.db.allcommon.bhv.core.command; + +import java.util.List; + +import jp.sf.pal.userinfo.db.allcommon.bhv.core.SqlExecution; +import jp.sf.pal.userinfo.db.allcommon.bhv.core.SqlExecutionCreator; +import jp.sf.pal.userinfo.db.allcommon.dbmeta.DBMeta; +import jp.sf.pal.userinfo.db.allcommon.dbmeta.info.ColumnInfo; +import jp.sf.pal.userinfo.db.allcommon.s2dao.internal.sqlcommand.InternalInsertAutoDynamicCommand; + +import org.seasar.dao.BeanMetaData; + +/** + * @author DBFlute(AutoGenerator) + */ +public class InsertEntityCommand extends AbstractEntityCommand { + + //========================================================================== + // ========= + // Basic Information + // ================= + public String getCommandName() { + return "insert"; + } + + //========================================================================== + // ========= + // SqlExecution Handling + // ===================== + public SqlExecutionCreator createSqlExecutionCreator() { + assertStatus("createSqlExecutionCreator"); + return new SqlExecutionCreator() { + public SqlExecution createSqlExecution() { + final BeanMetaData bmd = createBeanMetaData(); + return createInsertEntitySqlExecution(bmd); + } + }; + } + + protected SqlExecution createInsertEntitySqlExecution(BeanMetaData bmd) { + final SqlExecution nonPrimaryKeySqlExecution = createNonPrimaryInsertSqlExecution(bmd); + if (nonPrimaryKeySqlExecution != null) { + return nonPrimaryKeySqlExecution; + } + final String[] propertyNames = getPersistentPropertyNames(bmd); + return createInsertAutoDynamicCommand(bmd, propertyNames); + } + + protected InternalInsertAutoDynamicCommand createInsertAutoDynamicCommand( + BeanMetaData bmd, String[] propertyNames) { + final InternalInsertAutoDynamicCommand cmd = new InternalInsertAutoDynamicCommand(); + cmd.setBeanMetaData(bmd); + cmd.setDataSource(_dataSource); + cmd.setPropertyNames(propertyNames); + cmd.setStatementFactory(_statementFactory); + return cmd; + } + + /** + * @param bmd The meta data of bean. (NotNull) + * @return Whether the method is target. (For example if it has primary key, + * returns false.) + */ + protected SqlExecution createNonPrimaryInsertSqlExecution(BeanMetaData bmd) { + final DBMeta dbmeta = findDBMeta(); + if (dbmeta.hasPrimaryKey()) { + return null; + } + final List columnInfoList = dbmeta.getColumnInfoList(); + final StringBuilder columnDefSb = new StringBuilder(); + for (jp.sf.pal.userinfo.db.allcommon.dbmeta.info.ColumnInfo columnInfo : columnInfoList) { + columnDefSb.append(", ").append(columnInfo.getColumnDbName()); + } + columnDefSb.delete(0, ", ".length()).insert(0, "(").append(")"); + final StringBuilder columnValuesSb = new StringBuilder(); + for (jp.sf.pal.userinfo.db.allcommon.dbmeta.info.ColumnInfo columnInfo : columnInfoList) { + columnValuesSb.append(", /*dto.").append( + columnInfo.getPropertyName()).append("*/null"); + } + columnValuesSb.delete(0, ", ".length()).insert(0, "(").append(")"); + final String sql = "insert into " + dbmeta.getTableSqlName() + + columnDefSb + " values" + columnValuesSb; + return createUpdateDynamicCommand(new String[] { "dto" }, + new Class[] { _entityType }, sql); + } +} Property changes on: userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/bhv/core/command/InsertEntityCommand.java ___________________________________________________________________ Name: svn:eol-style + native Added: userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/bhv/core/command/OutsideSqlCallCommand.java =================================================================== --- userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/bhv/core/command/OutsideSqlCallCommand.java (rev 0) +++ userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/bhv/core/command/OutsideSqlCallCommand.java 2008-12-27 22:02:56 UTC (rev 1623) @@ -0,0 +1,152 @@ +package jp.sf.pal.userinfo.db.allcommon.bhv.core.command; + +import jp.sf.pal.userinfo.db.allcommon.bhv.core.SqlExecution; +import jp.sf.pal.userinfo.db.allcommon.bhv.core.SqlExecutionCreator; +import jp.sf.pal.userinfo.db.allcommon.cbean.outsidesql.OutsideSqlContext; +import jp.sf.pal.userinfo.db.allcommon.cbean.outsidesql.OutsideSqlOption; +import jp.sf.pal.userinfo.db.allcommon.s2dao.internal.sqlcommand.InternalProcedureCommand; +import jp.sf.pal.userinfo.db.allcommon.s2dao.internal.various.InternalProcedureMetaData; +import jp.sf.pal.userinfo.db.allcommon.s2dao.internal.various.InternalProcedureMetaDataFactory; + +import org.seasar.extension.jdbc.ResultSetHandler; + +/** + * The behavior command for OutsideSql.execute(). + * + * @author DBFlute(AutoGenerator) + */ +public class OutsideSqlCallCommand extends AbstractOutsideSqlCommand { + + //========================================================================== + // ========= + // Basic Information + // ================= + public String getCommandName() { + return "call"; + } + + public Class getCommandReturnType() { + return void.class; + } + + //========================================================================== + // ========= + // Detail Information + // ================== + public boolean isProcedure() { + return true; + } + + public boolean isSelect() { + return false; + } + + //========================================================================== + // ========= + // Process Callback + // ================ + public void beforeGettingSqlExecution() { + assertStatus("beforeGettingSqlExecution"); + final String path = _outsideSqlPath; + final Object pmb = _parameterBean; + final OutsideSqlOption option = _outsideSqlOption; + final OutsideSqlContext outsideSqlContext = new OutsideSqlContext(); + outsideSqlContext.setDynamicBinding(option.isDynamicBinding()); + outsideSqlContext.setOffsetByCursorForcedly(option.isAutoPaging()); + outsideSqlContext.setLimitByCursorForcedly(option.isAutoPaging()); + outsideSqlContext.setOutsideSqlPath(path); + outsideSqlContext.setParameterBean(pmb); + outsideSqlContext.setMethodName(getCommandName()); + outsideSqlContext.setStatementConfig(option.getStatementConfig()); + outsideSqlContext.setTableDbName(option.getTableDbName()); + outsideSqlContext.setupBehaviorQueryPathIfNeeds(); + OutsideSqlContext.setOutsideSqlContextOnThread(outsideSqlContext); + } + + public void afterExecuting() { + } + + //========================================================================== + // ========= + // SqlExecution Handling + // ===================== + public String buildSqlExecutionKey() { + assertStatus("buildSqlExecutionKey"); + return generateSpecifiedOutsideSqlUniqueKey(); + } + + protected String generateSpecifiedOutsideSqlUniqueKey() { + final String methodName = getCommandName(); + final String path = _outsideSqlPath; + final Object pmb = _parameterBean; + final OutsideSqlOption option = _outsideSqlOption; + return OutsideSqlContext.generateSpecifiedOutsideSqlUniqueKey( + methodName, path, pmb, option, null); + } + + public SqlExecutionCreator createSqlExecutionCreator() { + assertStatus("createSqlExecutionCreator"); + return new SqlExecutionCreator() { + public SqlExecution createSqlExecution() { + final OutsideSqlContext outsideSqlContext = OutsideSqlContext + .getOutsideSqlContextOnThread(); + return createOutsideSqlCallCommand(outsideSqlContext); + } + }; + } + + protected SqlExecution createOutsideSqlCallCommand( + OutsideSqlContext outsideSqlContext) { + // - - - - - - - - - - - - - - - - - - - - - - - + // The attribute of Specified-OutsideSqlContext. + // - - - - - - - - - - - - - - - - - - - - - - - + final Object pmb = outsideSqlContext.getParameterBean(); + final String procedureName = outsideSqlContext.getOutsideSqlPath(); + + // - - - - - - - - - - - - - - - + // The attribute of SqlCommand. + // - - - - - - - - - - - - - - - + final InternalProcedureMetaDataFactory factory = createProcedureMetaDataFactory(); + factory.setValueTypeFactory(_valueTypeFactory); + final Class pmbType = (pmb != null ? pmb.getClass() : null); + final InternalProcedureMetaData metaData = factory + .createProcedureMetaData(procedureName, pmbType); + return createProcedureCommand(metaData); + } + + protected InternalProcedureMetaDataFactory createProcedureMetaDataFactory() { + return new InternalProcedureMetaDataFactory(); + } + + protected InternalProcedureCommand createProcedureCommand( + InternalProcedureMetaData metaData) { + // Because a procedure command does not use result set handler. + final ResultSetHandler resultSetHandler = new InternalNullResultSetHandler(); + return new InternalProcedureCommand(_dataSource, resultSetHandler, + _statementFactory, metaData); + } + + // /- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + // - - + // InternalProcedureCommand switches argument so this is unnecessary + // actually! + // - - - - - - - - - -/ + public Object[] getSqlExecutionArgument() { + return new Object[] { _parameterBean }; + } + + //========================================================================== + // ========= + // Assert Helper + // ============= + protected void assertStatus(String methodName) { + assertBasicProperty(methodName); + assertComponentProperty(methodName); + assertOutsideSqlBasic(methodName); + if (_parameterBean == null) { + String msg = "The property 'parameterBean' should not be null"; + msg = msg + " when you call " + methodName + "()."; + throw new IllegalStateException(msg); + } + } +} Property changes on: userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/bhv/core/command/OutsideSqlCallCommand.java ___________________________________________________________________ Name: svn:eol-style + native Added: userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/bhv/core/command/OutsideSqlExecuteCommand.java =================================================================== --- userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/bhv/core/command/OutsideSqlExecuteCommand.java (rev 0) +++ userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/bhv/core/command/OutsideSqlExecuteCommand.java 2008-12-27 22:02:56 UTC (rev 1623) @@ -0,0 +1,128 @@ +package jp.sf.pal.userinfo.db.allcommon.bhv.core.command; + +import jp.sf.pal.userinfo.db.allcommon.bhv.core.SqlExecution; +import jp.sf.pal.userinfo.db.allcommon.bhv.core.SqlExecutionCreator; +import jp.sf.pal.userinfo.db.allcommon.cbean.outsidesql.OutsideSqlContext; +import jp.sf.pal.userinfo.db.allcommon.cbean.outsidesql.OutsideSqlOption; + +/** + * The behavior command for OutsideSql.execute(). + * + * @author DBFlute(AutoGenerator) + */ +public class OutsideSqlExecuteCommand extends + AbstractOutsideSqlCommand { + + //========================================================================== + // ========= + // Basic Information + // ================= + public String getCommandName() { + return "execute"; + } + + public Class getCommandReturnType() { + return Integer.class; + } + + //========================================================================== + // ========= + // Detail Information + // ================== + public boolean isProcedure() { + return false; + } + + public boolean isSelect() { + return false; + } + + //========================================================================== + // ========= + // Process Callback + // ================ + public void beforeGettingSqlExecution() { + assertStatus("beforeGettingSqlExecution"); + final String path = _outsideSqlPath; + final Object pmb = _parameterBean; + final OutsideSqlOption option = _outsideSqlOption; + final OutsideSqlContext outsideSqlContext = new OutsideSqlContext(); + outsideSqlContext.setDynamicBinding(option.isDynamicBinding()); + outsideSqlContext.setOffsetByCursorForcedly(option.isAutoPaging()); + outsideSqlContext.setLimitByCursorForcedly(option.isAutoPaging()); + outsideSqlContext.setOutsideSqlPath(path); + outsideSqlContext.setParameterBean(pmb); + outsideSqlContext.setMethodName(getCommandName()); + outsideSqlContext.setStatementConfig(option.getStatementConfig()); + outsideSqlContext.setTableDbName(option.getTableDbName()); + outsideSqlContext.setupBehaviorQueryPathIfNeeds(); + OutsideSqlContext.setOutsideSqlContextOnThread(outsideSqlContext); + } + + public void afterExecuting() { + } + + //========================================================================== + // ========= + // SqlExecution Handling + // ===================== + public String buildSqlExecutionKey() { + assertStatus("buildSqlExecutionKey"); + return generateSpecifiedOutsideSqlUniqueKey(); + } + + protected String generateSpecifiedOutsideSqlUniqueKey() { + final String methodName = getCommandName(); + final String path = _outsideSqlPath; + final Object pmb = _parameterBean; + final OutsideSqlOption option = _outsideSqlOption; + return OutsideSqlContext.generateSpecifiedOutsideSqlUniqueKey( + methodName, path, pmb, option, null); + } + + public SqlExecutionCreator createSqlExecutionCreator() { + assertStatus("createSqlExecutionCreator"); + return new SqlExecutionCreator() { + public SqlExecution createSqlExecution() { + final OutsideSqlContext outsideSqlContext = OutsideSqlContext + .getOutsideSqlContextOnThread(); + return createOutsideSqlExecuteExecution(outsideSqlContext); + } + }; + } + + protected SqlExecution createOutsideSqlExecuteExecution( + OutsideSqlContext outsideSqlContext) { + // - - - - - - - - - - - - - - - - - - - - - - - + // The attribute of Specified-OutsideSqlContext. + // - - - - - - - - - - - - - - - - - - - - - - - + final String suffix = buildDbmsSuffix(); + final String sql = outsideSqlContext.readFilteredOutsideSql( + _sqlFileEncoding, suffix); + final Object pmb = outsideSqlContext.getParameterBean(); + + // - - - - - - - - - - - - - - - + // The attribute of SqlCommand. + // - - - - - - - - - - - - - - - + final String[] argNames = (pmb != null ? new String[] { "pmb" } + : new String[] {}); + final Class[] argTypes = (pmb != null ? new Class[] { pmb + .getClass() } : new Class[] {}); + + return createUpdateDynamicCommand(argNames, argTypes, sql); + } + + public Object[] getSqlExecutionArgument() { + return new Object[] { _parameterBean }; + } + + //========================================================================== + // ========= + // Assert Helper + // ============= + protected void assertStatus(String methodName) { + assertBasicProperty(methodName); + assertComponentProperty(methodName); + assertOutsideSqlBasic(methodName); + } +} Property changes on: userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/bhv/core/command/OutsideSqlExecuteCommand.java ___________________________________________________________________ Name: svn:eol-style + native Added: userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/bhv/core/command/OutsideSqlSelectCursorCommand.java =================================================================== --- userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/bhv/core/command/OutsideSqlSelectCursorCommand.java (rev 0) +++ userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/bhv/core/command/OutsideSqlSelectCursorCommand.java 2008-12-27 22:02:56 UTC (rev 1623) @@ -0,0 +1,77 @@ +package jp.sf.pal.userinfo.db.allcommon.bhv.core.command; + +import java.sql.ResultSet; +import java.sql.SQLException; + +import jp.sf.pal.userinfo.db.allcommon.jdbc.CursorHandler; + +import org.seasar.extension.jdbc.ResultSetHandler; + +/** + * The behavior command for OutsideSql.selectList(). + * + * @author DBFlute(AutoGenerator) + */ +public class OutsideSqlSelectCursorCommand extends + AbstractOutsideSqlSelectCommand { + + //========================================================================== + // ========= + // Attribute + // ========= + /** The handler of cursor. (Required) */ + protected CursorHandler _cursorHandler; + + //========================================================================== + // ========= + // Basic Information + // ================= + public String getCommandName() { + return "selectCursor"; + } + + public Class getCommandReturnType() { + return Object.class; + } + + //========================================================================== + // ========= + // Extension Point + // =============== + @Override + protected ResultSetHandler createOutsideSqlSelectResultSetHandler() { + return new ResultSetHandler() { + public Object handle(ResultSet rs) throws SQLException { + return _cursorHandler.handle(rs); + } + }; + } + + @Override + protected Object getResultTypeSpecification() { + return _cursorHandler; + } + + //========================================================================== + // ========= + // Assert Helper + // ============= + @Override + protected void assertStatus(String methodName) { + assertBasicProperty(methodName); + assertComponentProperty(methodName); + assertOutsideSqlBasic(methodName); + if (_cursorHandler == null) { + throw new IllegalStateException(buildAssertMessage( + "_cursorHandler", methodName)); + } + } + + //========================================================================== + // ========= + // Accessor + // ======== + public void setCursorHandler(CursorHandler cursorHandler) { + _cursorHandler = cursorHandler; + } +} Property changes on: userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/bhv/core/command/OutsideSqlSelectCursorCommand.java ___________________________________________________________________ Name: svn:eol-style + native Added: userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/bhv/core/command/OutsideSqlSelectListCommand.java =================================================================== --- userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/bhv/core/command/OutsideSqlSelectListCommand.java (rev 0) +++ userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/bhv/core/command/OutsideSqlSelectListCommand.java 2008-12-27 22:02:56 UTC (rev 1623) @@ -0,0 +1,96 @@ +package jp.sf.pal.userinfo.db.allcommon.bhv.core.command; + +import java.util.List; + +import org.seasar.dao.BeanMetaData; +import org.seasar.extension.jdbc.ResultSetHandler; +import org.seasar.extension.jdbc.ValueType; +import org.seasar.extension.jdbc.types.ValueTypes; + +/** + * The behavior command for OutsideSql.selectList(). + * + * @author DBFlute(AutoGenerator) + * @param The type of entity. + */ +public class OutsideSqlSelectListCommand extends + AbstractOutsideSqlSelectCommand> { + + //========================================================================== + // ========= + // Attribute + // ========= + /** The type of entity. (Required) */ + protected Class _entityType; + + //========================================================================== + // ========= + // Basic Information + // ================= + public String getCommandName() { + return "selectList"; + } + + public Class getCommandReturnType() { + return List.class; + } + + //========================================================================== + // ========= + // Factory + // ======= + // ----------------------------------------------------- + // BeanMetaData + // ------------ + protected BeanMetaData createBeanMetaData() { + assertEntityType("createBeanMetaData"); + return _beanMetaDataFactory.createBeanMetaData(_entityType); + } + + // ----------------------------------------------------- + // ResultSetHandler + // ---------------- + protected ResultSetHandler createOutsideSqlBeanListResultSetHandler( + BeanMetaData bmd) { + final ValueType valueType = ValueTypes.getValueType(_entityType); + if (valueType == null || !valueType.equals(ValueTypes.OBJECT)) { + return createObjectListResultSetHandler(valueType); + } + return createBeanListMetaDataResultSetHandler(bmd); + } + + //========================================================================== + // ========= + // Extension Point + // =============== + @Override + protected ResultSetHandler createOutsideSqlSelectResultSetHandler() { + final BeanMetaData bmd = createBeanMetaData(); + final ResultSetHandler handler = createOutsideSqlBeanListResultSetHandler(bmd); + return handler; + } + + @Override + protected Object getResultTypeSpecification() { + return _entityType; + } + + //========================================================================== + // ========= + // Assert Helper + // ============= + protected void assertEntityType(String methodName) { + if (_entityType == null) { + throw new IllegalStateException(buildAssertMessage("_entityType", + methodName)); + } + } + + //========================================================================== + // ========= + // Accessor + // ======== + public void setEntityType(Class entityType) { + _entityType = entityType; + } +} Property changes on: userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/bhv/core/command/OutsideSqlSelectListCommand.java ___________________________________________________________________ Name: svn:eol-style + native Added: userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/bhv/core/command/QueryDeleteCBCommand.java =================================================================== --- userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/bhv/core/command/QueryDeleteCBCommand.java (rev 0) +++ userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/bhv/core/command/QueryDeleteCBCommand.java 2008-12-27 22:02:56 UTC (rev 1623) @@ -0,0 +1,151 @@ +package jp.sf.pal.userinfo.db.allcommon.bhv.core.command; + +import jp.sf.pal.userinfo.db.allcommon.bhv.core.SqlExecution; +import jp.sf.pal.userinfo.db.allcommon.bhv.core.SqlExecutionCreator; +import jp.sf.pal.userinfo.db.allcommon.cbean.ConditionBean; +import jp.sf.pal.userinfo.db.allcommon.cbean.ConditionBeanContext; +import jp.sf.pal.userinfo.db.allcommon.cbean.FetchNarrowingBeanContext; +import jp.sf.pal.userinfo.db.allcommon.cbean.outsidesql.OutsideSqlOption; +import jp.sf.pal.userinfo.db.allcommon.s2dao.internal.sqlcommand.InternalDeleteQueryAutoDynamicCommand; + +/** + * @author DBFlute(AutoGenerator) + */ +public class QueryDeleteCBCommand extends AbstractBehaviorCommand { + + //========================================================================== + // ========= + // Attribute + // ========= + /** The type of condition-bean. (Derived from conditionBean) */ + protected Class _conditionBeanType; + + /** The instance of condition-bean. (Required) */ + protected ConditionBean _conditionBean; + + //========================================================================== + // ========= + // Basic Information + // ================= + public String getCommandName() { + return "queryDelete"; + } + + public Class getCommandReturnType() { + return int.class; + } + + //========================================================================== + // ========= + // Detail Information + // ================== + public boolean isConditionBean() { + return true; + } + + public boolean isOutsideSql() { + return false; + } + + public boolean isProcedure() { + return false; + } + + public boolean isSelect() { + return false; + } + + public boolean isSelectCount() { + return false; + } + + //========================================================================== + // ========= + // Process Callback + // ================ + public void beforeGettingSqlExecution() { + assertStatus("beforeGettingSqlExecution"); + final ConditionBean cb = _conditionBean; + FetchNarrowingBeanContext.setFetchNarrowingBeanOnThread(cb); + ConditionBeanContext.setConditionBeanOnThread(cb); + } + + public void afterExecuting() { + } + + //========================================================================== + // ========= + // SqlExecution Handling + // ===================== + public String buildSqlExecutionKey() { + assertStatus("buildSqlExecutionKey"); + return _tableDbName + ":" + getCommandName() + "(" + + _conditionBeanType.getSimpleName() + ")"; + } + + public SqlExecutionCreator createSqlExecutionCreator() { + assertStatus("createSqlExecutionCreator"); + return new SqlExecutionCreator() { + public SqlExecution createSqlExecution() { + return createQueryDeleteCBExecution(_conditionBeanType); + } + }; + } + + protected SqlExecution createQueryDeleteCBExecution( + Class cbType) { + return new InternalDeleteQueryAutoDynamicCommand(_dataSource, + _statementFactory); + } + + public Object[] getSqlExecutionArgument() { + assertStatus("getSqlExecutionArgument"); + return new Object[] { _conditionBean }; + } + + //========================================================================== + // ========= + // Argument Information + // ==================== + public ConditionBean getConditionBean() { + return _conditionBean; + } + + public String getOutsideSqlPath() { + return null; + } + + public OutsideSqlOption getOutsideSqlOption() { + return null; + } + + //========================================================================== + // ========= + // Assert Helper + // ============= + protected void assertStatus(String methodName) { + assertBasicProperty(methodName); + assertComponentProperty(methodName); + if (_conditionBeanType == null) { + throw new IllegalStateException(buildAssertMessage( + "_conditionBeanType", methodName)); + } + if (_conditionBean == null) { + throw new IllegalStateException(buildAssertMessage( + "_conditionBean", methodName)); + } + } + + //========================================================================== + // ========= + // Accessor + // ======== + public void setConditionBeanType( + Class conditionBeanType) { + _conditionBeanType = conditionBeanType; + } + + public void setConditionBean(ConditionBean conditionBean) { + _conditionBean = conditionBean; + } +} Property changes on: userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/bhv/core/command/QueryDeleteCBCommand.java ___________________________________________________________________ Name: svn:eol-style + native Added: userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/bhv/core/command/QueryUpdateEntityCBCommand.java =================================================================== --- userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/bhv/core/command/QueryUpdateEntityCBCommand.java (rev 0) +++ userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/bhv/core/command/QueryUpdateEntityCBCommand.java 2008-12-27 22:02:56 UTC (rev 1623) @@ -0,0 +1,140 @@ +package jp.sf.pal.userinfo.db.allcommon.bhv.core.command; + +import jp.sf.pal.userinfo.db.allcommon.bhv.core.SqlExecution; +import jp.sf.pal.userinfo.db.allcommon.bhv.core.SqlExecutionCreator; +import jp.sf.pal.userinfo.db.allcommon.cbean.ConditionBean; +import jp.sf.pal.userinfo.db.allcommon.cbean.ConditionBeanContext; +import jp.sf.pal.userinfo.db.allcommon.cbean.FetchNarrowingBeanContext; +import jp.sf.pal.userinfo.db.allcommon.cbean.outsidesql.OutsideSqlOption; +import jp.sf.pal.userinfo.db.allcommon.s2dao.internal.sqlcommand.InternalUpdateQueryAutoDynamicCommand; + +/** + * @author DBFlute(AutoGenerator) + */ +public class QueryUpdateEntityCBCommand extends AbstractEntityCommand { + + //========================================================================== + // ========= + // Attribute + // ========= + /** The type of condition-bean. (Derived from conditionBean) */ + protected Class _conditionBeanType; + + /** The instance of condition-bean. (Required) */ + protected ConditionBean _conditionBean; + + //========================================================================== + // ========= + // Basic Information + // ================= + public String getCommandName() { + return "queryUpdate"; + } + + //========================================================================== + // ========= + // Detail Information + // ================== + @Override + public boolean isConditionBean() { + return true; + } + + //========================================================================== + // ========= + // Process Callback + // ================ + @Override + public void beforeGettingSqlExecution() { + assertStatus("beforeGettingSqlExecution"); + final ConditionBean cb = _conditionBean; + FetchNarrowingBeanContext.setFetchNarrowingBeanOnThread(cb); + ConditionBeanContext.setConditionBeanOnThread(cb); + } + + //========================================================================== + // ========= + // SqlExecution Handling + // ===================== + public String buildSqlExecutionKey() { + assertStatus("buildSqlExecutionKey"); + return _tableDbName + ":" + getCommandName() + "(" + + _entityType.getSimpleName() + ", " + + _conditionBeanType.getSimpleName() + ")"; + } + + public SqlExecutionCreator createSqlExecutionCreator() { + assertStatus("createSqlExecutionCreator"); + return new SqlExecutionCreator() { + public SqlExecution createSqlExecution() { + return createQueryUpdateEntityCBExecution(_conditionBeanType); + } + }; + } + + protected SqlExecution createQueryUpdateEntityCBExecution( + Class cbType) { + return new InternalUpdateQueryAutoDynamicCommand(_dataSource, + _statementFactory); + } + + public Object[] getSqlExecutionArgument() { + assertStatus("getSqlExecutionArgument"); + return new Object[] { _conditionBean, _entity }; + } + + //========================================================================== + // ========= + // Argument Information + // ==================== + public ConditionBean getConditionBean() { + return _conditionBean; + } + + public String getOutsideSqlPath() { + return null; + } + + public OutsideSqlOption getOutsideSqlOption() { + return null; + } + + //========================================================================== + // ========= + // Assert Helper + // ============= + @Override + protected void assertStatus(String methodName) { + assertBasicProperty(methodName); + assertComponentProperty(methodName); + if (_entityType == null) { + throw new IllegalStateException(buildAssertMessage("_entityType", + methodName)); + } + if (_entity == null) { + throw new IllegalStateException(buildAssertMessage("_entity", + methodName)); + } + if (_conditionBeanType == null) { + throw new IllegalStateException(buildAssertMessage( + "_conditionBeanType", methodName)); + } + if (_conditionBean == null) { + throw new IllegalStateException(buildAssertMessage( + "_conditionBean", methodName)); + } + } + + //========================================================================== + // ========= + // Accessor + // ======== + public void setConditionBeanType( + Class conditionBeanType) { + _conditionBeanType = conditionBeanType; + } + + public void setConditionBean(ConditionBean conditionBean) { + _conditionBean = conditionBean; + } +} Property changes on: userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/bhv/core/command/QueryUpdateEntityCBCommand.java ___________________________________________________________________ Name: svn:eol-style + native Added: userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/bhv/core/command/SelectCountCBCommand.java =================================================================== --- userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/bhv/core/command/SelectCountCBCommand.java (rev 0) +++ userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/bhv/core/command/SelectCountCBCommand.java 2008-12-27 22:02:56 UTC (rev 1623) @@ -0,0 +1,65 @@ +package jp.sf.pal.userinfo.db.allcommon.bhv.core.command; + +import jp.sf.pal.userinfo.db.allcommon.bhv.core.SqlExecution; +import jp.sf.pal.userinfo.db.allcommon.bhv.core.SqlExecutionCreator; +import jp.sf.pal.userinfo.db.allcommon.cbean.ConditionBean; +import jp.sf.pal.userinfo.db.allcommon.cbean.ConditionBeanContext; + +import org.seasar.extension.jdbc.ResultSetHandler; + +/** + * @author DBFlute(AutoGenerator) + */ +public class SelectCountCBCommand extends AbstractSelectCBCommand { + + //========================================================================== + // ========= + // Basic Information + // ================= + public String getCommandName() { + return "selectCount"; + } + + public Class getCommandReturnType() { + return Integer.class; + } + + //========================================================================== + // ========= + // Process Callback + // ================ + public void beforeGettingSqlExecution() { + assertStatus("beforeGettingSqlExecution"); + final ConditionBean cb = _conditionBean; + cb.xsetupSelectCountIgnoreFetchScope(); // *Point! + ConditionBeanContext.setConditionBeanOnThread(cb); + } + + public void afterExecuting() { + assertStatus("afterExecuting"); + final ConditionBean cb = _conditionBean; + cb.xafterCareSelectCountIgnoreFetchScope(); + } + + //========================================================================== + // ========= + // Detail Information + // ================== + public boolean isSelectCount() { + return true; + } + + //========================================================================== + // ========= + // SqlExecution Handling + // ===================== + public SqlExecutionCreator createSqlExecutionCreator() { + assertStatus("createSqlExecutionCreator"); + return new SqlExecutionCreator() { + public SqlExecution createSqlExecution() { + ResultSetHandler handler = createObjectResultSetHandler(getCommandReturnType()); + return createSelectCBExecution(_conditionBeanType, handler); + } + }; + } +} Property changes on: userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/bhv/core/command/SelectCountCBCommand.java ___________________________________________________________________ Name: svn:eol-style + native Added: userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/bhv/core/command/SelectListCBCommand.java =================================================================== --- userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/bhv/core/command/SelectListCBCommand.java (rev 0) +++ userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/bhv/core/command/SelectListCBCommand.java 2008-12-27 22:02:56 UTC (rev 1623) @@ -0,0 +1,103 @@ +package jp.sf.pal.userinfo.db.allcommon.bhv.core.command; + +import java.util.List; + +import jp.sf.pal.userinfo.db.allcommon.Entity; +import jp.sf.pal.userinfo.db.allcommon.bhv.core.SqlExecution; +import jp.sf.pal.userinfo.db.allcommon.bhv.core.SqlExecutionCreator; +import jp.sf.pal.userinfo.db.allcommon.cbean.ConditionBean; +import jp.sf.pal.userinfo.db.allcommon.cbean.ConditionBeanContext; +import jp.sf.pal.userinfo.db.allcommon.cbean.FetchNarrowingBeanContext; + +import org.seasar.dao.BeanMetaData; +import org.seasar.extension.jdbc.ResultSetHandler; + +/** + * @author DBFlute(AutoGenerator) + * @param The type of entity. + */ +public class SelectListCBCommand extends + AbstractSelectCBCommand> { + + //========================================================================== + // ========= + // Attribute + // ========= + /** The type of entity. (Required) */ + protected Class _entityType; + + //========================================================================== + // ========= + // Basic Information + // ================= + public String getCommandName() { + return "selectList"; + } + + public Class getCommandReturnType() { + return List.class; + } + + //========================================================================== + // ========= + // Detail Information + // ================== + public boolean isSelectCount() { + return false; + } + + //========================================================================== + // ========= + // Process Callback + // ================ + public void beforeGettingSqlExecution() { + assertStatus("beforeGettingSqlExecution"); + final ConditionBean cb = _conditionBean; + FetchNarrowingBeanContext.setFetchNarrowingBeanOnThread(cb); + ConditionBeanContext.setConditionBeanOnThread(cb); + } + + public void afterExecuting() { + assertStatus("afterExecuting"); + } + + //========================================================================== + // ========= + // SqlExecution Handling + // ===================== + public SqlExecutionCreator createSqlExecutionCreator() { + assertStatus("createSqlExecutionCreator"); + return new SqlExecutionCreator() { + public SqlExecution createSqlExecution() { + BeanMetaData bmd = createBeanMetaData(); + ResultSetHandler handler = createBeanListMetaDataResultSetHandler(bmd); + return createSelectCBExecution(_conditionBeanType, handler); + } + }; + } + + protected BeanMetaData createBeanMetaData() { + return _beanMetaDataFactory.createBeanMetaData(_entityType); + } + + //========================================================================== + // ========= + // Assert Helper + // ============= + @Override + protected void assertStatus(String methodName) { + super.assertStatus(methodName); + if (_entityType == null) { + throw new IllegalStateException(buildAssertMessage("_entityType", + methodName)); + } + } + + //========================================================================== + // ========= + // Accessor + // ======== + public void setEntityType(Class entityType) { + _entityType = entityType; + } +} Property changes on: userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/bhv/core/command/SelectListCBCommand.java ___________________________________________________________________ Name: svn:eol-style + native Added: userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/bhv/core/command/SelectNextValCommand.java =================================================================== --- userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/bhv/core/command/SelectNextValCommand.java (rev 0) +++ userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/bhv/core/command/SelectNextValCommand.java 2008-12-27 22:02:56 UTC (rev 1623) @@ -0,0 +1,162 @@ +package jp.sf.pal.userinfo.db.allcommon.bhv.core.command; + +import jp.sf.pal.userinfo.db.allcommon.bhv.core.SqlExecution; +import jp.sf.pal.userinfo.db.allcommon.bhv.core.SqlExecutionCreator; +import jp.sf.pal.userinfo.db.allcommon.bhv.core.execution.BasicSelectExecution; +import jp.sf.pal.userinfo.db.allcommon.cbean.ConditionBean; +import jp.sf.pal.userinfo.db.allcommon.cbean.outsidesql.OutsideSqlOption; +import jp.sf.pal.userinfo.db.allcommon.dbmeta.DBMeta; +import jp.sf.pal.userinfo.db.allcommon.dbmeta.DBMetaInstanceHandler; + +import org.seasar.extension.jdbc.ResultSetHandler; + +/** + * @author DBFlute(AutoGenerator) + * @param The type of result. + */ +public class SelectNextValCommand extends + AbstractBehaviorCommand { + + //========================================================================== + // ========= + // Attribute + // ========= + /** The type of result. (NotNull) */ + protected Class _resultType; + + //========================================================================== + // ========= + // Basic Information + // ================= + public String getCommandName() { + return "selectNextVal"; + } + + public Class getCommandReturnType() { + return _resultType; + } + + //========================================================================== + // ========= + // Detail Information + // ================== + public boolean isConditionBean() { + return false; + } + + public boolean isOutsideSql() { + return false; + } + + public boolean isProcedure() { + return false; + } + + public boolean isSelect() { + return true; + } + + public boolean isSelectCount() { + return false; + } + + //========================================================================== + // ========= + // Process Callback + // ================ + public void beforeGettingSqlExecution() { + } + + public void afterExecuting() { + } + + //========================================================================== + // ========= + // SqlExecution Handling + // ===================== + public String buildSqlExecutionKey() { + assertStatus("buildSqlExecutionKey"); + return _tableDbName + ":" + getCommandName() + "()"; + } + + public SqlExecutionCreator createSqlExecutionCreator() { + assertStatus("createSqlExecutionCreator"); + return new SqlExecutionCreator() { + public SqlExecution createSqlExecution() { + ResultSetHandler handler = createObjectResultSetHandler(_resultType); + return createSelectNextValExecution(handler); + } + }; + } + + protected SqlExecution createSelectNextValExecution(ResultSetHandler handler) { + final DBMeta dbmeta = findDBMeta(); + if (!dbmeta.hasSequence()) { + String msg = "If the method 'selectNextVal()' exists, DBMeta.hasSequence() should return true:"; + msg = msg + " dbmeta.hasSequence()=" + dbmeta.hasSequence(); + throw new IllegalStateException(msg); + } + final String nextValSql = dbmeta.getSequenceNextValSql(); + if (nextValSql == null) { + String msg = "If the method 'selectNextVal()' exists, DBMeta.getSequenceNextValSql() should not return null:"; + msg = msg + " dbmeta.getSequenceNextValSql()=" + + dbmeta.getSequenceNextValSql(); + throw new IllegalStateException(msg); + } + return createBasicSelectExecution(handler, new String[] {}, + new Class[] {}, nextValSql); + } + + protected BasicSelectExecution createBasicSelectExecution( + ResultSetHandler handler, String[] argNames, Class[] argTypes, + String sql) { + final BasicSelectExecution cmd = new BasicSelectExecution(_dataSource, + _statementFactory, handler); + cmd.setArgNames(argNames); + cmd.setArgTypes(argTypes); + cmd.setSql(sql); + return cmd; + } + + protected DBMeta findDBMeta() { + return DBMetaInstanceHandler.findDBMeta(_tableDbName); + } + + public Object[] getSqlExecutionArgument() { + assertStatus("getSqlExecutionArgument"); + return new Object[] {}; + } + + //========================================================================== + // ========= + // Argument Information + // ==================== + public ConditionBean getConditionBean() { + return null; + } + + public String getOutsideSqlPath() { + return null; + } + + public OutsideSqlOption getOutsideSqlOption() { + return null; + } + + //========================================================================== + // ========= + // Assert Helper + // ============= + protected void assertStatus(String methodName) { + assertBasicProperty(methodName); + assertComponentProperty(methodName); + } + + //========================================================================== + // ========= + // Accessor + // ======== + public void setResultType(Class resultType) { + _resultType = resultType; + } +} Property changes on: userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/bhv/core/command/SelectNextValCommand.java ___________________________________________________________________ Name: svn:eol-style + native Added: userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/bhv/core/command/SelectScalarCBCommand.java =================================================================== --- userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/bhv/core/command/SelectScalarCBCommand.java (rev 0) +++ userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/bhv/core/command/SelectScalarCBCommand.java 2008-12-27 22:02:56 UTC (rev 1623) @@ -0,0 +1,112 @@ +package jp.sf.pal.userinfo.db.allcommon.bhv.core.command; + +import jp.sf.pal.userinfo.db.allcommon.bhv.core.SqlExecution; +import jp.sf.pal.userinfo.db.allcommon.bhv.core.SqlExecutionCreator; +import jp.sf.pal.userinfo.db.allcommon.cbean.ConditionBean; +import jp.sf.pal.userinfo.db.allcommon.cbean.ConditionBeanContext; +import jp.sf.pal.userinfo.db.allcommon.cbean.sqlclause.SqlClause; + +import org.seasar.extension.jdbc.ResultSetHandler; + +/** + * @author DBFlute(AutoGenerator) + * @param The type of result. + */ +public class SelectScalarCBCommand extends + AbstractSelectCBCommand { + + //========================================================================== + // ========= + // Attribute + // ========= + /** The type of result. (NotNull) */ + protected Class _resultType; + + /** The type of select clause. (NotNull) */ + protected SqlClause.SelectClauseType _selectClauseType; + + //========================================================================== + // ========= + // Basic Information + // ================= + public String getCommandName() { + assertStatus("getCommandName"); + final String resultTypeName = _resultType.getSimpleName(); + final String scalarMethodName = _selectClauseType.toString() + .toLowerCase(); + return "scalarSelect(" + resultTypeName + ")." + scalarMethodName; + } + + public Class getCommandReturnType() { + assertStatus("getCommandReturnType"); + return _resultType; + } + + //========================================================================== + // ========= + // Detail Information + // ================== + public boolean isSelectCount() { + return false; + } + + //========================================================================== + // ========= + // Process Callback + // ================ + public void beforeGettingSqlExecution() { + assertStatus("beforeGettingSqlExecution"); + final ConditionBean cb = _conditionBean; + ConditionBeanContext.setConditionBeanOnThread(cb); + cb.getSqlClause().classifySelectClauseType(_selectClauseType); //*Point! + } + + public void afterExecuting() { + assertStatus("afterExecuting"); + final ConditionBean cb = _conditionBean; + cb.getSqlClause().rollbackSelectClauseType(); + } + + //========================================================================== + // ========= + // SqlExecution Handling + // ===================== + public SqlExecutionCreator createSqlExecutionCreator() { + assertStatus("createSqlExecutionCreator"); + return new SqlExecutionCreator() { + public SqlExecution createSqlExecution() { + ResultSetHandler handler = createObjectResultSetHandler(getCommandReturnType()); + return createSelectCBExecution(_conditionBeanType, handler); + } + }; + } + + //========================================================================== + // ========= + // Assert Helper + // ============= + @Override + protected void assertStatus(String methodName) { + super.assertStatus(methodName); + if (_resultType == null) { + throw new IllegalStateException(buildAssertMessage("_resultType", + methodName)); + } + if (_selectClauseType == null) { + throw new IllegalStateException(buildAssertMessage( + "_selectClauseType", methodName)); + } + } + + //========================================================================== + // ========= + // Accessor + // ======== + public void setResultType(Class resultType) { + _resultType = resultType; + } + + public void setSelectClauseType(SqlClause.SelectClauseType selectClauseType) { + _selectClauseType = selectClauseType; + } +} Property changes on: userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/bhv/core/command/SelectScalarCBCommand.java ___________________________________________________________________ Name: svn:eol-style + native Added: userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/bhv/core/command/UpdateEntityCommand.java =================================================================== --- userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/bhv/core/command/UpdateEntityCommand.java (rev 0) +++ userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/bhv/core/command/UpdateEntityCommand.java 2008-12-27 22:02:56 UTC (rev 1623) @@ -0,0 +1,55 @@ +package jp.sf.pal.userinfo.db.allcommon.bhv.core.command; + +import jp.sf.pal.userinfo.db.allcommon.bhv.core.SqlExecution; +import jp.sf.pal.userinfo.db.allcommon.bhv.core.SqlExecutionCreator; +import jp.sf.pal.userinfo.db.allcommon.s2dao.internal.sqlcommand.InternalUpdateModifiedOnlyCommand; + +import org.seasar.dao.BeanMetaData; + +/** + * @author DBFlute(AutoGenerator) + */ +public class UpdateEntityCommand extends AbstractEntityCommand { + + //========================================================================== + // ========= + // Basic Information + // ================= + public String getCommandName() { + return "update"; + } + + //========================================================================== + // ========= + // SqlExecution Handling + // ===================== + public SqlExecutionCreator createSqlExecutionCreator() { + assertStatus("createSqlExecutionCreator"); + return new SqlExecutionCreator() { + public SqlExecution createSqlExecution() { + final BeanMetaData bmd = createBeanMetaData(); + return createUpdateEntitySqlExecution(bmd); + } + }; + } + + protected SqlExecution createUpdateEntitySqlExecution(BeanMetaData bmd) { + final String[] propertyNames = getPersistentPropertyNames(bmd); + return createUpdateModifiedOnlyCommand(bmd, propertyNames); + } + + protected InternalUpdateModifiedOnlyCommand createUpdateModifiedOnlyCommand( + BeanMetaData bmd, String[] propertyNames) { + final InternalUpdateModifiedOnlyCommand cmd = new InternalUpdateModifiedOnlyCommand( + _dataSource, _statementFactory); + cmd.setBeanMetaData(bmd);// Extension Point! + cmd.setPropertyNames(propertyNames); + cmd.setOptimisticLockHandling(isOptimisticLockHandling()); + cmd.setVersionNoAutoIncrementOnMemory(isOptimisticLockHandling()); + return cmd; + } + + protected boolean isOptimisticLockHandling() { + return true; + } +} Property changes on: userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/bhv/core/command/UpdateEntityCommand.java ___________________________________________________________________ Name: svn:eol-style + native Added: userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/bhv/core/command/UpdateNonstrictEntityCommand.java =================================================================== --- userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/bhv/core/command/UpdateNonstrictEntityCommand.java (rev 0) +++ userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/bhv/core/command/UpdateNonstrictEntityCommand.java 2008-12-27 22:02:56 UTC (rev 1623) @@ -0,0 +1,25 @@ +package jp.sf.pal.userinfo.db.allcommon.bhv.core.command; + +/** + * @author DBFlute(AutoGenerator) + */ +public class UpdateNonstrictEntityCommand extends UpdateEntityCommand { + + //========================================================================== + // ========= + // Basic Information + // ================= + @Override + public String getCommandName() { + return "updateNonstrict"; + } + + //========================================================================== + // ========= + // SqlExecution Handling + // ===================== + @Override + protected boolean isOptimisticLockHandling() { + return false; + } +} Property changes on: userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/bhv/core/command/UpdateNonstrictEntityCommand.java ___________________________________________________________________ Name: svn:eol-style + native Added: userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/bhv/core/execution/BasicSelectExecution.java =================================================================== --- userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/bhv/core/execution/BasicSelectExecution.java (rev 0) +++ userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/bhv/core/execution/BasicSelectExecution.java 2008-12-27 22:02:56 UTC (rev 1623) @@ -0,0 +1,77 @@ +package jp.sf.pal.userinfo.db.allcommon.bhv.core.execution; + +import javax.sql.DataSource; + +import jp.sf.pal.userinfo.db.allcommon.s2dao.internal.sqlcommand.InternalAbstractDynamicCommand; +import jp.sf.pal.userinfo.db.allcommon.s2dao.internal.sqlhandler.InternalBasicSelectHandler; + +import org.seasar.dao.CommandContext; +import org.seasar.extension.jdbc.ResultSetHandler; +import org.seasar.extension.jdbc.StatementFactory; + +/** + * @author DBFlute(AutoGenerator) + */ +public class BasicSelectExecution extends InternalAbstractDynamicCommand { + + //========================================================================== + // ========= + // Attribute + // ========= + /** The handler of resultSet. */ + protected ResultSetHandler resultSetHandler; + + //========================================================================== + // ========= + // Constructor + // =========== + /** + * Constructor. + * + * @param dataSource Data source. + * @param statementFactory The factory of statement. + * @param resultSetHandler The handler of resultSet. + */ + public BasicSelectExecution(DataSource dataSource, + StatementFactory statementFactory, ResultSetHandler resultSetHandler) { + super(dataSource, statementFactory); + this.resultSetHandler = resultSetHandler; + } + + //========================================================================== + // ========= + // Execute + // ======= + /** + * @param args The array of argument. (Nullable) + * @return The object of execution result. (Nullable) + */ + public Object execute(Object[] args) { + final CommandContext ctx = apply(args); + final InternalBasicSelectHandler selectHandler = createBasicSelectHandler( + ctx.getSql(), this.resultSetHandler); + final Object[] bindVariableArray = ctx.getBindVariables(); + selectHandler.setLoggingMessageSqlArgs(bindVariableArray); + return selectHandler.execute(bindVariableArray, ctx + .getBindVariableTypes()); + } + + //========================================================================== + // ========= + // Select Handler + // ============== + protected InternalBasicSelectHandler createBasicSelectHandler( + String realSql, ResultSetHandler rsh) { + return new InternalBasicSelectHandler(getDataSource(), realSql, rsh, + getStatementFactory()); + } + + //========================================================================== + // ========= + // Parser Option + // ============= + @Override + protected boolean isBlockNullParameter() { + return true; // Because the SQL is select. + } +} Property changes on: userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/bhv/core/execution/BasicSelectExecution.java ___________________________________________________________________ Name: svn:eol-style + native Added: userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/bhv/core/execution/OutsideSqlSelectExecution.java =================================================================== --- userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/bhv/core/execution/OutsideSqlSelectExecution.java (rev 0) +++ userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/bhv/core/execution/OutsideSqlSelectExecution.java 2008-12-27 22:02:56 UTC (rev 1623) @@ -0,0 +1,225 @@ +package jp.sf.pal.userinfo.db.allcommon.bhv.core.execution; + +import java.util.ArrayList; +import java.util.List; + +import javax.sql.DataSource; + +import jp.sf.pal.userinfo.db.allcommon.cbean.outsidesql.OutsideSqlContext; +import jp.sf.pal.userinfo.db.allcommon.s2dao.internal.sqlcommand.InternalAbstractDynamicCommand; +import jp.sf.pal.userinfo.db.allcommon.s2dao.internal.sqlhandler.InternalBasicSelectHandler; +import jp.sf.pal.userinfo.db.allcommon.util.SimpleStringUtil; +import jp.sf.pal.userinfo.db.allcommon.util.SimpleSystemUtil; + +import org.seasar.dao.CommandContext; +import org.seasar.extension.jdbc.ResultSetHandler; +import org.seasar.extension.jdbc.StatementFactory; +import org.seasar.framework.beans.BeanDesc; +import org.seasar.framework.beans.PropertyDesc; +import org.seasar.framework.beans.factory.BeanDescFactory; + +/** + * @author DBFlute(AutoGenerator) + */ +public class OutsideSqlSelectExecution extends InternalAbstractDynamicCommand { + + //========================================================================== + // ========= + // Attribute + // ========= + /** The handler of resultSet. */ + protected ResultSetHandler resultSetHandler; + + //========================================================================== + // ========= + // Constructor + // =========== + /** + * Constructor. + * + * @param dataSource Data source. + * @param statementFactory The factory of statement. + * @param resultSetHandler The handler of resultSet. + */ + public OutsideSqlSelectExecution(DataSource dataSource, + StatementFactory statementFactory, ResultSetHandler resultSetHandler) { + super(dataSource, statementFactory); + this.resultSetHandler = resultSetHandler; + } + + //========================================================================== + // ========= + // Execute + // ======= + /** + * @param args The array of argument. (NotNull, The first element should be + * the instance of Pmb) + * @return The object of execution result. (Nullable) + */ + public Object execute(Object[] args) { + final OutsideSqlContext outsideSqlContext = OutsideSqlContext + .getOutsideSqlContextOnThread(); + if (outsideSqlContext.isDynamicBinding()) { + return executeOutsideSqlAsDynamic(args, outsideSqlContext); + } else { + return executeOutsideSqlAsStatic(args, outsideSqlContext); + } + } + + // ----------------------------------------------------- + // OutsideSql Execute + // ------------------ + /** + * Execute outside-SQL as Dynamic. + * + * @param args The array of argument. (NotNull, The first element should be + * the instance of Pmb) + * @param outsideSqlContext The context of outside-SQL. (NotNull) + * @return Result. (Nullable) + */ + protected Object executeOutsideSqlAsDynamic(Object[] args, + OutsideSqlContext outsideSqlContext) { + final Object firstArg = args[0]; + String staticSql = getSql(); + if (firstArg != null) { + final BeanDesc beanDesc = BeanDescFactory.getBeanDesc(firstArg + .getClass()); + + // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + // - - - - - - - + // Resolve embedded comment for parsing bind variable comment in + // embedded comment. + // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + // - - - - - - - + for (int i = 0; i < beanDesc.getPropertyDescSize(); i++) { + final PropertyDesc propertyDesc = beanDesc.getPropertyDesc(i); + final Class propertyType = propertyDesc.getPropertyType(); + if (!propertyType.equals(String.class)) { + continue; + } + final String outsideSqlPiece = (String) propertyDesc + .getValue(firstArg); + if (outsideSqlPiece == null) { + continue; + } + final String embeddedComment = "/*$pmb." + + propertyDesc.getPropertyName() + "*/"; + staticSql = replaceString(staticSql, embeddedComment, + outsideSqlPiece); + } + } + + final OutsideSqlSelectExecution outsideSqlCommand = createDynamicSqlFactory(); + outsideSqlCommand.setArgNames(getArgNames()); + outsideSqlCommand.setArgTypes(getArgTypes()); + outsideSqlCommand.setSql(staticSql); + + final CommandContext ctx = outsideSqlCommand.apply(args); + final List bindVariableList = new ArrayList(); + final List> bindVariableTypeList = new ArrayList>(); + addBindVariableInfo(ctx, bindVariableList, bindVariableTypeList); + final InternalBasicSelectHandler selectHandler = createBasicSelectHandler( + ctx.getSql(), this.resultSetHandler); + final Object[] bindVariableArray = bindVariableList.toArray(); + selectHandler.setLoggingMessageSqlArgs(bindVariableArray); + return selectHandler.execute(bindVariableArray, + toClassArray(bindVariableTypeList)); + } + + /** + * Execute outside-SQL as static. + * + * @param args The array of argument. (NotNull, The first element should be + * the instance of Pmb) + * @param outsideSqlContext The context of outside-SQL. (NotNull) + * @return Result. (Nullable) + */ + protected Object executeOutsideSqlAsStatic(Object[] args, + OutsideSqlContext outsideSqlContext) { + final CommandContext ctx = apply(args); + final InternalBasicSelectHandler selectHandler = createBasicSelectHandler( + ctx.getSql(), this.resultSetHandler); + final Object[] bindVariableArray = ctx.getBindVariables(); + selectHandler.setLoggingMessageSqlArgs(bindVariableArray); + return selectHandler.execute(bindVariableArray, ctx + .getBindVariableTypes()); + } + + //========================================================================== + // ========= + // Dynamic SQL Factory + // =================== + protected OutsideSqlSelectExecution createDynamicSqlFactory() { + return new OutsideSqlSelectExecution(getDataSource(), + getStatementFactory(), resultSetHandler); + } + + //========================================================================== + // ========= + // Select Handler + // ============== + protected InternalBasicSelectHandler createBasicSelectHandler( + String realSql, ResultSetHandler rsh) { + return new InternalBasicSelectHandler(getDataSource(), realSql, rsh, + getStatementFactory()); + } + + //========================================================================== + // ========= + // Parser Option + // ============= + @Override + protected boolean isBlockNullParameter() { + return true; // Because the SQL is select. + } + + //========================================================================== + // ========= + // Setup Helper + // ============ + protected Class[] toClassArray(List> 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 bindVariableList, List> bindVariableTypeList) { + final Object[] bindVariables = ctx.getBindVariables(); + addBindVariableList(bindVariableList, bindVariables); + final Class[] bindVariableTypes = ctx.getBindVariableTypes(); + addBindVariableTypeList(bindVariableTypeList, bindVariableTypes); + } + + protected void addBindVariableList(List bindVariableList, + Object[] bindVariables) { + for (int i = 0; i < bindVariables.length; i++) { + bindVariableList.add(bindVariables[i]); + } + } + + protected void addBindVariableTypeList(List> bindVariableTypeList, + Class[] bindVariableTypes) { + for (int i = 0; i < bindVariableTypes.length; i++) { + bindVariableTypeList.add(bindVariableTypes[i]); + } + } + + //========================================================================== + // ========= + // General Helper + // ============== + protected final String replaceString(String text, String fromText, + String toText) { + return SimpleStringUtil.replace(text, fromText, toText); + } + + protected String getLineSeparator() { + return SimpleSystemUtil.getLineSeparator(); + } +} Property changes on: userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/bhv/core/execution/OutsideSqlSelectExecution.java ___________________________________________________________________ Name: svn:eol-style + native Added: userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/bhv/core/execution/SelectCBExecution.java =================================================================== --- userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/bhv/core/execution/SelectCBExecution.java (rev 0) +++ userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/bhv/core/execution/SelectCBExecution.java 2008-12-27 22:02:56 UTC (rev 1623) @@ -0,0 +1,168 @@ +package jp.sf.pal.userinfo.db.allcommon.bhv.core.execution; + +import java.util.ArrayList; +import java.util.List; + +import javax.sql.DataSource; + +import jp.sf.pal.userinfo.db.allcommon.cbean.ConditionBean; +import jp.sf.pal.userinfo.db.allcommon.cbean.ConditionBeanContext; +import jp.sf.pal.userinfo.db.allcommon.s2dao.internal.sqlcommand.InternalAbstractDynamicCommand; +import jp.sf.pal.userinfo.db.allcommon.s2dao.internal.sqlhandler.InternalBasicSelectHandler; +import jp.sf.pal.userinfo.db.allcommon.util.SimpleStringUtil; +import jp.sf.pal.userinfo.db.allcommon.util.SimpleSystemUtil; + +import org.seasar.dao.CommandContext; +import org.seasar.extension.jdbc.ResultSetHandler; +import org.seasar.extension.jdbc.StatementFactory; + +/** + * @author DBFlute(AutoGenerator) + */ +public class SelectCBExecution extends InternalAbstractDynamicCommand { + + //========================================================================== + // ========= + // Attribute + // ========= + /** The handler of resultSet. */ + protected ResultSetHandler resultSetHandler; + + //========================================================================== + // ========= + // Constructor + // =========== + /** + * Constructor. + * + * @param dataSource Data source. + * @param statementFactory The factory of statement. + * @param resultSetHandler The handler of resultSet. + */ + public SelectCBExecution(DataSource dataSource, + StatementFactory statementFactory, ResultSetHandler resultSetHandler) { + super(dataSource, statementFactory); + this.resultSetHandler = resultSetHandler; + } + + //========================================================================== + // ========= + // Execute + // ======= + /** + * @param args The array of argument. (NotNull, The first element should be + * the instance of CB) + * @return The object of execution result. (Nullable) + */ + public Object execute(Object[] args) { + final List bindVariableList = new ArrayList(); + final List> bindVariableTypeList = new ArrayList>(); + + final String finalClause = setupRealClause(args, bindVariableList, + bindVariableTypeList); + final InternalBasicSelectHandler selectHandler = createBasicSelectHandler( + finalClause, this.resultSetHandler); + final Object[] bindVariableArray = bindVariableList.toArray(); + selectHandler.setLoggingMessageSqlArgs(bindVariableArray); + return selectHandler.execute(bindVariableArray, + toClassArray(bindVariableTypeList)); + } + + // ----------------------------------------------------- + // Setup Clause + // ------------ + protected String setupRealClause(Object[] args, + List bindVariableList, List> bindVariableTypeList) { + final ConditionBean cb = ConditionBeanContext + .getConditionBeanOnThread(); + final String realClause; + { + final SelectCBExecution dynamicSqlFactory = createDynamicSqlFactory(); + dynamicSqlFactory.setArgNames(getArgNames()); + dynamicSqlFactory.setArgTypes(getArgTypes()); + dynamicSqlFactory.setSql(cb.getSqlClause().getClause()); + final CommandContext ctx = dynamicSqlFactory.apply(args); + realClause = ctx.getSql(); + addBindVariableInfo(ctx, bindVariableList, bindVariableTypeList); + } + return realClause; + } + + //========================================================================== + // ========= + // Dynamic SQL Factory + // =================== + protected SelectCBExecution createDynamicSqlFactory() { + return new SelectCBExecution(getDataSource(), getStatementFactory(), + resultSetHandler); + } + + //========================================================================== + // ========= + // Select Handler + // ============== + protected InternalBasicSelectHandler createBasicSelectHandler( + String realSql, ResultSetHandler rsh) { + return new InternalBasicSelectHandler(getDataSource(), realSql, rsh, + getStatementFactory()); + } + + //========================================================================== + // ========= + // Parser Option + // ============= + @Override + protected boolean isBlockNullParameter() { + return true; // Because the SQL is select. + } + + //========================================================================== + // ========= + // Setup Helper + // ============ + protected Class[] toClassArray(List> 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 bindVariableList, List> bindVariableTypeList) { + final Object[] bindVariables = ctx.getBindVariables(); + addBindVariableList(bindVariableList, bindVariables); + final Class[] bindVariableTypes = ctx.getBindVariableTypes(); + addBindVariableTypeList(bindVariableTypeList, bindVariableTypes); + } + + protected void addBindVariableList(List bindVariableList, + Object[] bindVariables) { + for (int i = 0; i < bindVariables.length; i++) { + bindVariableList.add(bindVariables[i]); + } + } + + protected void addBindVariableTypeList(List> bindVariableTypeList, + Class[] bindVariableTypes) { + for (int i = 0; i < bindVariableTypes.length; i++) { + bindVariableTypeList.add(bindVariableTypes[i]); + } + } + + //========================================================================== + // ========= + // General Helper + // ============== + protected final String replaceString(String text, String fromText, + String toText) { + return SimpleStringUtil.replace(text, fromText, toText); + } + + protected String getLineSeparator() { + return SimpleSystemUtil.getLineSeparator(); + } +} Property changes on: userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/bhv/core/execution/SelectCBExecution.java ___________________________________________________________________ Name: svn:eol-style + native Modified: userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/cbean/AbstractConditionBean.java =================================================================== --- userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/cbean/AbstractConditionBean.java 2008-12-26 22:11:31 UTC (rev 1622) +++ userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/cbean/AbstractConditionBean.java 2008-12-27 22:02:56 UTC (rev 1623) @@ -24,6 +24,28 @@ public abstract class AbstractConditionBean implements ConditionBean { //========================================================================== + // =========== + // Definition + // ========== + /** Map-string map-mark. */ + private static final String MAP_STRING_MAP_MARK = "map:"; + + /** Map-string list-mark. */ + private static final String MAP_STRING_LIST_MARK = "list:"; + + /** Map-string start-brace. */ + private static final String MAP_STRING_START_BRACE = "@{"; + + /** Map-string end-brace. */ + private static final String MAP_STRING_END_BRACE = "@}"; + + /** Map-string delimiter. */ + private static final String MAP_STRING_DELIMITER = "@;"; + + /** Map-string equal. */ + private static final String MAP_STRING_EQUAL = "@="; + + //========================================================================== // ========= // Attribute // ========= @@ -41,8 +63,12 @@ // [DBFlute-0.7.4] @jflute -- At the future, I'll implement some check // logics by these purpose types. - protected boolean _forDeriveReferrer; + protected boolean _forDerivedReferrer; + protected boolean _forScalarSelect; + + protected boolean _forScalarSubQuery; + protected boolean _forUnion; protected boolean _forExistsSubQuery; @@ -73,27 +99,6 @@ //========================================================================== // ========= - // ConditionQuery - // ============== - /** - * Get condition query as interface. At the future, change public to - * protected. - * - * @return Instance of query as interface. (NotNull) - */ - abstract public ConditionQuery getConditionQueryAsInterface(); - - /** - * The implementation. - * - * @return The conditionQuery of the local table as interface. (NotNull) - */ - public ConditionQuery localCQ() { - return getConditionQueryAsInterface(); - } - - //========================================================================== - // ========= // Accept PrimaryKey // ================= /** @@ -498,42 +503,6 @@ //========================================================================== // ========= - // Limit Select - // ============ - /** Is limit-select PK only? */ - protected boolean _isLimitSelectPKOnly; - - /** - * Is limit-select PK only? - * - * @return Determination. - */ - public boolean isLimitSelect_PKOnly() { - return _isLimitSelectPKOnly; - } - - /** - * Limit select PK only. - * - * @return this. (NotNull) - */ - public ConditionBean limitSelect_PKOnly() { - _isLimitSelectPKOnly = true; - return this; - } - - /** - * Limit select off. - * - * @return this. (NotNull) - */ - public ConditionBean limitSelect_Off() { - _isLimitSelectPKOnly = false; - return this; - } - - //========================================================================== - // ========= // Lock Setting // ============ /** @@ -559,11 +528,8 @@ public ConditionBean xsetupSelectCountIgnoreFetchScope() { _isSelectCountIgnoreFetchScope = true; - // If the query uses union query, it needs included-select-column. - if (!hasUnionQueryOrUnionAllQuery()) { - getSqlClause().ignoreIncludedSelectColumn(); - } - + getSqlClause().classifySelectClauseType( + SqlClause.SelectClauseType.COUNT); getSqlClause().ignoreOrderBy(); getSqlClause().ignoreFetchScope(); return this; @@ -578,11 +544,7 @@ public ConditionBean xafterCareSelectCountIgnoreFetchScope() { _isSelectCountIgnoreFetchScope = false; - // If the query uses union query, it needs included-select-column. - if (!hasUnionQueryOrUnionAllQuery()) { - getSqlClause().makeIncludedSelectColumnEffective(); - } - + getSqlClause().rollbackSelectClauseType(); getSqlClause().makeOrderByEffective(); getSqlClause().makeFetchScopeEffective(); return this; @@ -613,20 +575,29 @@ protected CQ _query; - protected boolean _forDeriveReferrer; + protected boolean _forDerivedReferrer; - protected boolean alreadySpecifyRequiredColumn; + protected boolean _forScalarSelect; + protected boolean _forScalarSubQuery; + + protected boolean _alreadySpecifyRequiredColumn; + /** * @param baseCB The condition-bean of base level. (NotNull) - * @param qyCall The callback for condition-query. (NotNull) - * @param forDeriveReferrer Is this for derive referrer? + * @param qyCall The call-back for condition-query. (NotNull) + * @param forDerivedReferrer Is this for derive referrer? + * @param forScalarSelect Is this for scalar select? + * @param forScalarSubQuery Is this for scalar sub-query? */ protected AbstractSpecification(ConditionBean baseCB, - SpQyCall qyCall, boolean forDeriveReferrer) { + SpQyCall qyCall, boolean forDerivedReferrer, + boolean forScalarSelect, boolean forScalarSubQuery) { _baseCB = baseCB; _qyCall = qyCall; - _forDeriveReferrer = forDeriveReferrer; + _forDerivedReferrer = forDerivedReferrer; + _forScalarSelect = forScalarSelect; + _forScalarSubQuery = forScalarSubQuery; } protected void doColumn(String columnName) { @@ -634,8 +605,8 @@ if (_query == null) { _query = _qyCall.qy(); } - if (!_forDeriveReferrer && !alreadySpecifyRequiredColumn) { - alreadySpecifyRequiredColumn = true; + if (isRequiredColumnSpecificationEnabled()) { + _alreadySpecifyRequiredColumn = true; doSpecifyRequiredColumn(); } String relationPath = _query.getRelationPath() != null ? _query @@ -652,6 +623,11 @@ columnName); } + protected boolean isRequiredColumnSpecificationEnabled() { + return !_forDerivedReferrer && !_forScalarSelect + && !_forScalarSubQuery && !_alreadySpecifyRequiredColumn; + } + protected void assertColumn(String columnName) { if (_query == null && !_qyCall.has()) { throwSpecifyColumnNotSetupSelectColumnException(columnName); @@ -659,9 +635,15 @@ } protected void assertForeign(String foreignPropertyName) { - if (_forDeriveReferrer) { - throwDeriveReferrerInvalidForeignSpecificationException(foreignPropertyName); + if (_forDerivedReferrer) { + throwDerivedReferrerInvalidForeignSpecificationException(foreignPropertyName); } + if (_forScalarSelect) { + throwScalarSelectInvalidForeignSpecificationException(foreignPropertyName); + } + if (_forScalarSubQuery) { + throwScalarSubQueryInvalidForeignSpecificationException(foreignPropertyName); + } } protected abstract void doSpecifyRequiredColumn(); @@ -714,19 +696,19 @@ throw new SpecifyColumnNotSetupSelectColumnException(msg); } - protected void throwDeriveReferrerInvalidForeignSpecificationException( + protected void throwDerivedReferrerInvalidForeignSpecificationException( String foreignPropertyName) { String msg = "Look! Read the message below." + getLineSeparator(); msg = msg + "/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *" + getLineSeparator(); msg = msg - + "You specified a foreign table column in spite of derive-sub-query!" + + "You specified a foreign table column in spite of derived-referrer!" + getLineSeparator(); msg = msg + getLineSeparator(); msg = msg + "[Advice]" + getLineSeparator(); msg = msg - + "You should specified a local table column at condition-bean for derive-sub-query." + + "You should specified a local table column at condition-bean for derived-referrer." + getLineSeparator(); msg = msg + " For example:" + getLineSeparator(); msg = msg + " " + getLineSeparator(); @@ -736,7 +718,7 @@ msg = msg + " MemberCB cb = new MemberCB();" + getLineSeparator(); msg = msg - + " cb.specify().derivePurchaseList().max(new SubQuery() {" + + " cb.specify().derivedPurchaseList().max(new SubQuery() {" + getLineSeparator(); msg = msg + " public void query(PurchaseCB subCB) {" + getLineSeparator(); @@ -754,7 +736,7 @@ msg = msg + " MemberCB cb = new MemberCB();" + getLineSeparator(); msg = msg - + " cb.specify().derivePurchaseList().max(new SubQuery() {" + + " cb.specify().derivedPurchaseList().max(new SubQuery() {" + getLineSeparator(); msg = msg + " public void query(PurchaseCB subCB) {" + getLineSeparator(); @@ -769,9 +751,117 @@ msg = msg + "[Specified Foreign Property]" + getLineSeparator() + foreignPropertyName + getLineSeparator(); msg = msg + "* * * * * * * * * */"; - throw new DeriveReferrerInvalidForeignSpecificationException(msg); + throw new DerivedReferrerInvalidForeignSpecificationException(msg); } + protected void throwScalarSelectInvalidForeignSpecificationException( + String foreignPropertyName) { + String msg = "Look! Read the message below." + getLineSeparator(); + msg = msg + + "/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *" + + getLineSeparator(); + msg = msg + + "You specified a foreign table column in spite of scalar select!" + + getLineSeparator(); + msg = msg + getLineSeparator(); + msg = msg + "[Advice]" + getLineSeparator(); + msg = msg + + "You should specified a local table column at condition-bean for scalar select." + + getLineSeparator(); + msg = msg + " For example:" + getLineSeparator(); + msg = msg + " " + getLineSeparator(); + msg = msg + " [Wrong]" + getLineSeparator(); + msg = msg + " /- - - - - - - - - - - - - - - - - - - - " + + getLineSeparator(); + msg = msg + + " memberBhv.scalarSelect(Integer.class).max(new ScalarSelect() {" + + getLineSeparator(); + msg = msg + " public void query(MemberCB cb) {" + + getLineSeparator(); + msg = msg + + " cb.specify().specifyMemberStatus().columnDisplayOrder(); // *No!" + + getLineSeparator(); + msg = msg + " }" + getLineSeparator(); + msg = msg + " });" + getLineSeparator(); + msg = msg + " - - - - - - - - - -/" + getLineSeparator(); + msg = msg + " " + getLineSeparator(); + msg = msg + " [Good!]" + getLineSeparator(); + msg = msg + " /- - - - - - - - - - - - - - - - - - - - " + + getLineSeparator(); + msg = msg + + " memberBhv.scalarSelect(Date.class).max(new ScalarSelect() {" + + getLineSeparator(); + msg = msg + " public void query(MemberCB cb) {" + + getLineSeparator(); + msg = msg + + " cb.specify().columnMemberBirthday(); // *Point!" + + getLineSeparator(); + msg = msg + " }" + getLineSeparator(); + msg = msg + " });" + getLineSeparator(); + msg = msg + " - - - - - - - - - -/" + getLineSeparator(); + msg = msg + getLineSeparator(); + msg = msg + "[Specified Foreign Property]" + getLineSeparator() + + foreignPropertyName + getLineSeparator(); + msg = msg + "* * * * * * * * * */"; + throw new ScalarSelectInvalidForeignSpecificationException(msg); + } + + protected void throwScalarSubQueryInvalidForeignSpecificationException( + String foreignPropertyName) { + String msg = "Look! Read the message below." + getLineSeparator(); + msg = msg + + "/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *" + + getLineSeparator(); + msg = msg + + "You specified a foreign table column in spite of derived-query!" + + getLineSeparator(); + msg = msg + getLineSeparator(); + msg = msg + "[Advice]" + getLineSeparator(); + msg = msg + + "You should specified a local table column at condition-bean for derived-query." + + getLineSeparator(); + msg = msg + " For example:" + getLineSeparator(); + msg = msg + " " + getLineSeparator(); + msg = msg + " [Wrong]" + getLineSeparator(); + msg = msg + " /- - - - - - - - - - - - - - - - - - - - " + + getLineSeparator(); + msg = msg + " MemberCB cb = new MemberCB();" + + getLineSeparator(); + msg = msg + + " cb.query().scalar_Equal().max(new SubQuery() {" + + getLineSeparator(); + msg = msg + " public void query(MemberCB subCB) {" + + getLineSeparator(); + msg = msg + + " subCB.specify().specifyMemberStatusName().columnDisplayOrder(); // *No!" + + getLineSeparator(); + msg = msg + " }" + getLineSeparator(); + msg = msg + " });" + getLineSeparator(); + msg = msg + " - - - - - - - - - -/" + getLineSeparator(); + msg = msg + " " + getLineSeparator(); + msg = msg + " [Good!]" + getLineSeparator(); + msg = msg + " /- - - - - - - - - - - - - - - - - - - - " + + getLineSeparator(); + msg = msg + " MemberCB cb = new MemberCB();" + + getLineSeparator(); + msg = msg + + " cb.query().scalar_Equal().max(new SubQuery() {" + + getLineSeparator(); + msg = msg + " public void query(MemberCB subCB) {" + + getLineSeparator(); + msg = msg + + " subCB.specify().columnMemberBirthday();// *Point!" + + getLineSeparator(); + msg = msg + " }" + getLineSeparator(); + msg = msg + " });" + getLineSeparator(); + msg = msg + " - - - - - - - - - -/" + getLineSeparator(); + msg = msg + getLineSeparator(); + msg = msg + "[Specified Foreign Property]" + getLineSeparator() + + foreignPropertyName + getLineSeparator(); + msg = msg + "* * * * * * * * * */"; + throw new ScalarSubQueryInvalidForeignSpecificationException(msg); + } + protected String getLineSeparator() { return SimpleSystemUtil.getLineSeparator(); } @@ -792,15 +882,33 @@ } } - public static class DeriveReferrerInvalidForeignSpecificationException + public static class DerivedReferrerInvalidForeignSpecificationException extends RuntimeException { private static final long serialVersionUID = 1L; - public DeriveReferrerInvalidForeignSpecificationException(String msg) { + public DerivedReferrerInvalidForeignSpecificationException(String msg) { super(msg); } } + public static class ScalarSubQueryInvalidForeignSpecificationException + extends RuntimeException { + private static final long serialVersionUID = 1L; + + public ScalarSubQueryInvalidForeignSpecificationException(String msg) { + super(msg); + } + } + + public static class ScalarSelectInvalidForeignSpecificationException extends + RuntimeException { + private static final long serialVersionUID = 1L; + + public ScalarSelectInvalidForeignSpecificationException(String msg) { + super(msg); + } + } + public static class RAFunction { protected ConditionBean _baseCB; @@ -815,6 +923,18 @@ _querySetupper = querySetupper; } + public void count(SubQuery subQuery, String aliasName) { + assertAliasName(aliasName); + _querySetupper.setup("count", subQuery, _localCQ, aliasName.trim()); + } + + public void countDistinct(SubQuery subQuery, + String aliasName) { + assertAliasName(aliasName); + _querySetupper.setup("count(distinct", subQuery, _localCQ, + aliasName.trim()); + } + public void max(SubQuery subQuery, String aliasName) { assertAliasName(aliasName); _querySetupper.setup("max", subQuery, _localCQ, aliasName.trim()); @@ -835,14 +955,9 @@ _querySetupper.setup("avg", subQuery, _localCQ, aliasName.trim()); } - public void count(SubQuery subQuery, String aliasName) { - assertAliasName(aliasName); - _querySetupper.setup("count", subQuery, _localCQ, aliasName.trim()); - } - protected void assertAliasName(String aliasName) { if (aliasName == null || aliasName.trim().length() == 0) { - throwDeriveReferrerInvalidAliasNameException(); + throwDerivedReferrerInvalidAliasNameException(); } DBMeta dbmeta = DBMetaInstanceHandler.findDBMeta(_baseCB .getTableDbName()); @@ -860,17 +975,17 @@ } } if (!existsSetterMethod) { - throwDeriveReferrerEntityPropertyNotFoundException(aliasName, + throwDerivedReferrerEntityPropertyNotFoundException(aliasName, dbmeta.getEntityType()); } } - protected void throwDeriveReferrerInvalidAliasNameException() { + protected void throwDerivedReferrerInvalidAliasNameException() { String msg = "Look! Read the message below." + getLineSeparator(); msg = msg + "/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *" + getLineSeparator(); - msg = msg + "The alias name for derive-referrer was Invalid!" + msg = msg + "The alias name for derived-referrer was Invalid!" + getLineSeparator(); msg = msg + getLineSeparator(); msg = msg + "[Advice]" + getLineSeparator(); @@ -915,17 +1030,17 @@ msg = msg + "[Local Table]" + getLineSeparator() + _localCQ.getTableDbName() + getLineSeparator(); msg = msg + "* * * * * * * * * */"; - throw new DeriveReferrerInvalidAliasNameException(msg); + throw new DerivedReferrerInvalidAliasNameException(msg); } - protected void throwDeriveReferrerEntityPropertyNotFoundException( + protected void throwDerivedReferrerEntityPropertyNotFoundException( String aliasName, Class entityType) { String msg = "Look! Read the message below." + getLineSeparator(); msg = msg + "/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *" + getLineSeparator(); msg = msg - + "A property for derive-referrer was Not Found in the entity!" + + "A property for derived-referrer was Not Found in the entity!" + getLineSeparator(); msg = msg + getLineSeparator(); msg = msg + "[Advice]" + getLineSeparator(); @@ -981,7 +1096,7 @@ msg = msg + "[Target Entity]" + getLineSeparator() + entityType + getLineSeparator(); msg = msg + "* * * * * * * * * */"; - throw new DeriveReferrerEntityPropertyNotFoundException(msg); + throw new DerivedReferrerEntityPropertyNotFoundException(msg); } protected String replaceString(String text, String fromText, @@ -999,20 +1114,20 @@ LOCAL_CQ cq, String aliasName); } - public static class DeriveReferrerInvalidAliasNameException extends + public static class DerivedReferrerInvalidAliasNameException extends RuntimeException { private static final long serialVersionUID = 1L; - public DeriveReferrerInvalidAliasNameException(String msg) { + public DerivedReferrerInvalidAliasNameException(String msg) { super(msg); } } - public static class DeriveReferrerEntityPropertyNotFoundException extends + public static class DerivedReferrerEntityPropertyNotFoundException extends RuntimeException { private static final long serialVersionUID = 1L; - public DeriveReferrerEntityPropertyNotFoundException(String msg) { + public DerivedReferrerEntityPropertyNotFoundException(String msg) { super(msg); } } @@ -1042,7 +1157,6 @@ protected void doSetupSelect(SsCall callback) { String foreignPropertyName = callback.qf().getForeignPropertyName(); assertSetupSelectBeforeUnion(foreignPropertyName); - limitSelect_Off(); String foreignTableAliasName = callback.qf().getRealAliasName(); String localRelationPath = localCQ().getRelationPath(); getSqlClause().registerSelectedSelectColumn(foreignTableAliasName, @@ -1164,19 +1278,27 @@ // ========= // Purpose Type // ============ - public void xsetupForDeriveReferrer() { - _forDeriveReferrer = true; + public void xsetupForDerivedReferrer() { // Very Internal + _forDerivedReferrer = true; } - public void xsetupForUnion() { + public void xsetupForScalarSelect() { // Very Internal + _forScalarSelect = true; + } + + public void xsetupForScalarSubQuery() { // Very Internal + _forScalarSubQuery = true; + } + + public void xsetupForUnion() { // Very Internal _forUnion = true; } - public void xsetupForExistsSubQuery() { + public void xsetupForExistsSubQuery() { // Very Internal _forExistsSubQuery = true; } - public void xsetupForInScopeSubQuery() { + public void xsetupForInScopeSubQuery() { // Very Internal _forInScopeSubQuery = true; } Modified: userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/cbean/AbstractConditionQuery.java =================================================================== --- userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/cbean/AbstractConditionQuery.java 2008-12-26 22:11:31 UTC (rev 1622) +++ userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/cbean/AbstractConditionQuery.java 2008-12-27 22:02:56 UTC (rev 1623) @@ -48,12 +48,14 @@ protected static final ConditionKey CK_PS = ConditionKey.CK_PREFIX_SEARCH; - protected static final ConditionKey CK_LS = ConditionKey.CK_LIKE_SEARCH; - protected static final ConditionKey CK_INS = ConditionKey.CK_IN_SCOPE; protected static final ConditionKey CK_NINS = ConditionKey.CK_NOT_IN_SCOPE; + protected static final ConditionKey CK_LS = ConditionKey.CK_LIKE_SEARCH; + + protected static final ConditionKey CK_NLS = ConditionKey.CK_NOT_LIKE_SEARCH; + protected static final ConditionKey CK_ISN = ConditionKey.CK_IS_NULL; protected static final ConditionKey CK_ISNN = ConditionKey.CK_IS_NOT_NULL; @@ -351,15 +353,7 @@ String msg = "The argument[unionQuery] should not be null."; throw new IllegalArgumentException(msg); } - reflectRelationOnUnionQuery(this, unionQuery);// Reflect Relation! - getSqlClause().copyIncludedSelectColumn(unionQuery.getSqlClause());// Reflect - // IncludedSelectColumn - // ! - if (getSqlClause().isFormatClauseEffective()) { - unionQuery.getSqlClause().makeFormatClauseEffective();// Reflect - // FormatClause - // ! - } + reflectRelationOnUnionQuery(this, unionQuery); // Reflect Relation! String key = (unionAll ? "unionAllQuery" : "unionQuery") + unionQueryMap.size(); unionQueryMap.put(key, unionQuery); @@ -416,22 +410,6 @@ // Register // ======== // ----------------------------------------------------- - // Include-As-Mine - // --------------- - /** - * Register included-select-column. - * - * @param aliasName Alias name. This should not contain comma. (NotNull) - * @param realColumnName Real column name. This should not contain comma. - * (NotNull) - * @deprecated Unsupported! - */ - protected void registerIncludedSelectColumn(String aliasName, - String realColumnName) { - throw new UnsupportedOperationException(); - } - - // ----------------------------------------------------- // Query // ----- protected void registerQuery(ConditionKey key, Object value, @@ -488,6 +466,13 @@ // ----------------------------------------------------- // LikeSearch Query // ---------------- + protected void regLSQ(ConditionKey key, String value, + ConditionValue cvalue, String colName, String capPropName, + String uncapPropName, LikeSearchOption option) { + registerLikeSearchQuery(key, value, cvalue, colName, capPropName, + uncapPropName, option); + } + @SuppressWarnings("deprecation") protected void registerLikeSearchQuery(ConditionKey key, String value, ConditionValue cvalue, String colName, String capPropName, @@ -700,25 +685,20 @@ assertObjectNotNull("InScopeSubQyery(" + columnName + ")", subQuery); inScopeOption = inScopeOption != null ? inScopeOption + " " : ""; String realColumnName = getInScopeSubQueryRealColumnName(columnName); + xincrementLocalSubQueryLevelIfNeeds(subQuery); String subQueryClause = getInScopeSubQuerySql(subQuery, relatedColumnName, propertyName); - String clause = null; - if (getSqlClause().isFormatClauseEffective()) { - String ln = getLineSeparator(); - int subQueryLevel = subQuery.getSubQueryLevel(); - String subQueryIdentity = propertyName + "[" + subQueryLevel + "]"; - String beginMark = getSqlClause().resolveSubQueryBeginMark( - subQueryIdentity) - + ln; - String endMark = getSqlClause().resolveSubQueryEndMark( - subQueryIdentity); - String endIndent = " "; - clause = realColumnName + " " + inScopeOption + "in (" + beginMark - + subQueryClause + ln + endIndent + ")" + endMark; - } else { - clause = realColumnName + " " + inScopeOption + "in (" - + subQueryClause + ")"; - } + String ln = getLineSeparator(); + int subQueryLevel = subQuery.getSubQueryLevel(); + String subQueryIdentity = propertyName + "[" + subQueryLevel + "]"; + String beginMark = getSqlClause().resolveSubQueryBeginMark( + subQueryIdentity) + + ln; + String endMark = getSqlClause() + .resolveSubQueryEndMark(subQueryIdentity); + String endIndent = " "; + String clause = realColumnName + " " + inScopeOption + "in (" + + beginMark + subQueryClause + ln + endIndent + ")" + endMark; registerWhereClause(clause); } @@ -728,22 +708,11 @@ protected String getInScopeSubQuerySql(ConditionQuery subQuery, String relatedColumnName, String propertyName) { - String selectClause = "select " - + getSqlClause().getLocalTableAliasName() + "." + String tableAliasName = getSqlClause().getLocalTableAliasName(); + String selectClause = "select " + tableAliasName + "." + relatedColumnName; - String fromWhereClause = subQuery.getSqlClause() - .getClauseFromWhereWithUnionTemplate(); - fromWhereClause = replaceString(fromWhereClause, ".conditionQuery.", - "." + getLocationBase(propertyName) + ".");// Very Important! - - // Replace template marks. These are very important! - fromWhereClause = replaceString(fromWhereClause, getSqlClause() - .getUnionSelectClauseMark(), selectClause); - fromWhereClause = replaceString(fromWhereClause, getSqlClause() - .getUnionWhereClauseMark(), ""); - fromWhereClause = replaceString(fromWhereClause, getSqlClause() - .getUnionWhereFirstConditionMark(), ""); - + String fromWhereClause = buildPlainSubQueryFromWhereClause(subQuery, + relatedColumnName, propertyName, selectClause, tableAliasName); return selectClause + " " + fromWhereClause; } @@ -769,24 +738,20 @@ assertObjectNotNull("ExistsSubQyery(" + columnName + ")", subQuery); existsOption = existsOption != null ? existsOption + " " : ""; String realColumnName = getExistsSubQueryRealColumnName(columnName); + xincrementLocalSubQueryLevelIfNeeds(subQuery); String subQueryClause = getExistsSubQuerySql(subQuery, realColumnName, relatedColumnName, propertyName); - String clause = null; - if (getSqlClause().isFormatClauseEffective()) { - String ln = getLineSeparator(); - int subQueryLevel = subQuery.getSubQueryLevel(); - String subQueryIdentity = propertyName + "[" + subQueryLevel + "]"; - String beginMark = getSqlClause().resolveSubQueryBeginMark( - subQueryIdentity) - + ln; - String endMark = getSqlClause().resolveSubQueryEndMark( - subQueryIdentity); - String endIndent = " "; - clause = existsOption + "exists (" + beginMark + subQueryClause - + ln + endIndent + ")" + endMark; - } else { - clause = existsOption + "exists (" + subQueryClause + ")"; - } + String ln = getLineSeparator(); + int subQueryLevel = subQuery.getSubQueryLevel(); + String subQueryIdentity = propertyName + "[" + subQueryLevel + "]"; + String beginMark = getSqlClause().resolveSubQueryBeginMark( + subQueryIdentity) + + ln; + String endMark = getSqlClause() + .resolveSubQueryEndMark(subQueryIdentity); + String endIndent = " "; + String clause = existsOption + "exists (" + beginMark + subQueryClause + + ln + endIndent + ")" + endMark; registerWhereClause(clause); } @@ -801,134 +766,116 @@ protected String getExistsSubQuerySql(ConditionQuery subQuery, String realColumnName, String relatedColumnName, String propertyName) { int subQueryLevel = subQuery.getSubQueryLevel(); - if (_subQueryLevel <= subQueryLevel) { - _subQueryLevel = subQueryLevel + 1; - } String tableAliasName = "dfsublocal_" + subQueryLevel; String selectClause = "select " + tableAliasName + "." + relatedColumnName; - String fromWhereClause = subQuery.getSqlClause() - .getClauseFromWhereWithWhereUnionTemplate(); - fromWhereClause = replaceString(fromWhereClause, "dflocal", - tableAliasName);// Very Important! - fromWhereClause = replaceString(fromWhereClause, ".conditionQuery.", - "." + getLocationBase(propertyName) + ".");// Very Important! - - String joinCondition = tableAliasName + "." + relatedColumnName + " = " - + realColumnName; - String firstConditionAfter = " and "; - if (getSqlClause().isFormatClauseEffective()) { - firstConditionAfter = getLineSeparator() + " and "; - } - - // Replace template marks. These are very important! - fromWhereClause = replaceString(fromWhereClause, getSqlClause() - .getWhereClauseMark(), "where " + joinCondition); - fromWhereClause = replaceString(fromWhereClause, getSqlClause() - .getWhereFirstConditionMark(), joinCondition - + firstConditionAfter); - fromWhereClause = replaceString(fromWhereClause, getSqlClause() - .getUnionSelectClauseMark(), selectClause); - fromWhereClause = replaceString(fromWhereClause, getSqlClause() - .getUnionWhereClauseMark(), "where " + joinCondition); - fromWhereClause = replaceString(fromWhereClause, getSqlClause() - .getUnionWhereFirstConditionMark(), joinCondition - + firstConditionAfter); - + String fromWhereClause = buildCorrelationSubQueryFromWhereClause( + subQuery, relatedColumnName, propertyName, selectClause, + tableAliasName, realColumnName); return selectClause + " " + fromWhereClause; } // [DBFlute-0.7.4] // ----------------------------------------------------- - // DeriveSubQuery - // -------------- - protected void registerDeriveSubQuery(String function, + // DerivedReferrerSubQuery + // ----------------------- + protected void registerDerivedReferrerSubQuery(String function, ConditionQuery subQuery, String columnName, String relatedColumnName, String propertyName, String aliasName) { - assertObjectNotNull("DeriveSubQuery(" + columnName + ")", subQuery); - final String realColumnName = getDeriveSubQueryRealColumnName(columnName); - final String subQueryClause = getDeriveSubQuerySql(function, subQuery, - realColumnName, relatedColumnName, propertyName, aliasName); - final String clause; - if (getSqlClause().isFormatClauseEffective()) { - final String ln = getLineSeparator(); - final int subQueryLevel = subQuery.getSubQueryLevel(); - final String subQueryIdentity = propertyName + "[" + subQueryLevel - + "]"; - final String beginMark = getSqlClause().resolveSubQueryBeginMark( - subQueryIdentity) - + ln; - final String endMark = getSqlClause().resolveSubQueryEndMark( - subQueryIdentity); - final String endIndent = " "; - clause = "(" + beginMark + subQueryClause + ln + endIndent - + ") as " + aliasName + endMark; - } else { - clause = "(" + subQueryClause + ") as " + aliasName; - } + assertObjectNotNull("DerivedReferrerSubQuery(function)", function); + assertObjectNotNull("DerivedReferrerSubQuery(" + columnName + ")", + subQuery); + String realColumnName = getDerivedReferrerSubQueryRealColumnName(columnName); + xincrementLocalSubQueryLevelIfNeeds(subQuery); + String subQueryClause = getDerivedReferrerSubQuerySql(function, + subQuery, realColumnName, relatedColumnName, propertyName, + aliasName); + String ln = getLineSeparator(); + int subQueryLevel = subQuery.getSubQueryLevel(); + String subQueryIdentity = propertyName + "[" + subQueryLevel + "]"; + String beginMark = getSqlClause().resolveSubQueryBeginMark( + subQueryIdentity) + + ln; + String endMark = getSqlClause() + .resolveSubQueryEndMark(subQueryIdentity); + String endIndent = " "; + String clause = "(" + beginMark + subQueryClause + ln + endIndent + + ") " + aliasName + endMark; getSqlClause().specifyDeriveSubQuery(aliasName, clause); } - protected String getDeriveSubQueryRealColumnName(String columnName) { + protected String getDerivedReferrerSubQueryRealColumnName(String columnName) { return getRealColumnName(columnName); } - protected String getDeriveSubQuerySql(String function, + protected String getDerivedReferrerSubQuerySql(String function, ConditionQuery subQuery, String realColumnName, String relatedColumnName, String propertyName, String aliasName) { - final int subQueryLevel = subQuery.getSubQueryLevel(); - if (_subQueryLevel <= subQueryLevel) { - _subQueryLevel = subQueryLevel + 1; - } - final String tableAliasName = "dfsublocal_" + subQueryLevel; - final String deriveColumnName = subQuery.getSqlClause() + int subQueryLevel = subQuery.getSubQueryLevel(); + String tableAliasName = "dfsublocal_" + subQueryLevel; + String deriveColumnName = subQuery.getSqlClause() .getSpecifiedColumnNameAsOne(); if (deriveColumnName == null || deriveColumnName.trim().length() == 0) { - throwDeriveReferrerInvalidColumnSpecificationException(function, + throwDerivedReferrerInvalidColumnSpecificationException(function, aliasName); } - assertDeriveReferrerColumnType(function, subQuery, deriveColumnName); - subQuery.getSqlClause().clearSpecifiedSelectColumn(); - final String selectClause = "select " + function + "(" + tableAliasName - + "." + deriveColumnName + ")"; - String fromWhereClause = subQuery.getSqlClause() - .getClauseFromWhereWithWhereUnionTemplate(); - fromWhereClause = replaceString(fromWhereClause, "dflocal", - tableAliasName);// Very Important! - fromWhereClause = replaceString(fromWhereClause, ".conditionQuery.", - "." + getLocationBase(propertyName) + ".");// Very Important! - - final String joinCondition = tableAliasName + "." + relatedColumnName - + " = " + realColumnName; - String firstConditionAfter = " and "; - if (getSqlClause().isFormatClauseEffective()) { - firstConditionAfter = getLineSeparator() + " and "; + assertDerivedReferrerColumnType(function, subQuery, deriveColumnName); + subQuery.getSqlClause().clearSpecifiedSelectColumn(); // specified + // columns + // disappear at + // this timing + String connect = xbuildFunctionConnector(function); + if (subQuery.getSqlClause().hasUnionQuery()) { + String ln = getLineSeparator(); + String subQueryIdentity = propertyName + "[" + subQueryLevel + + ":subquerymain]"; + String beginMark = getSqlClause().resolveSubQueryBeginMark( + subQueryIdentity) + + ln; + String endMark = getSqlClause().resolveSubQueryEndMark( + subQueryIdentity); + DBMeta dbmeta = DBMetaInstanceHandler.findDBMeta(subQuery + .getTableDbName()); + if (!dbmeta.hasPrimaryKey() || dbmeta.hasTwoOrMorePrimaryKeys()) { + String msg = "The derived-referrer is unsupported when no primary key or two-or-more primary keys:"; + msg = msg + " table=" + subQuery.getTableDbName(); + throw new UnsupportedOperationException(msg); + } + String primaryKeyName = dbmeta.getPrimaryUniqueInfo() + .getFirstColumn().getColumnDbName(); + String selectClause = "select " + tableAliasName + "." + + primaryKeyName + ", " + tableAliasName + "." + + relatedColumnName + ", " + tableAliasName + "." + + deriveColumnName; + String fromWhereClause = buildPlainSubQueryFromWhereClause( + subQuery, relatedColumnName, propertyName, selectClause, + tableAliasName); + String mainSql = selectClause + " " + fromWhereClause; + String joinCondition = "dfsubquerymain." + relatedColumnName + + " = " + realColumnName; + return "select " + function + connect + "dfsubquerymain." + + deriveColumnName + ")" + ln + " from (" + beginMark + + mainSql + ln + " ) dfsubquerymain" + endMark + ln + + " where " + joinCondition; + } else { + String selectClause = "select " + function + connect + + tableAliasName + "." + deriveColumnName + ")"; + String fromWhereClause = buildCorrelationSubQueryFromWhereClause( + subQuery, relatedColumnName, propertyName, selectClause, + tableAliasName, realColumnName); + return selectClause + " " + fromWhereClause; } - - // Replace template marks. These are very important! - fromWhereClause = replaceString(fromWhereClause, getSqlClause() - .getWhereClauseMark(), "where " + joinCondition); - fromWhereClause = replaceString(fromWhereClause, getSqlClause() - .getWhereFirstConditionMark(), joinCondition - + firstConditionAfter); - fromWhereClause = replaceString(fromWhereClause, getSqlClause() - .getUnionSelectClauseMark(), selectClause); - fromWhereClause = replaceString(fromWhereClause, getSqlClause() - .getUnionWhereClauseMark(), "where " + joinCondition); - fromWhereClause = replaceString(fromWhereClause, getSqlClause() - .getUnionWhereFirstConditionMark(), joinCondition - + firstConditionAfter); - - return selectClause + " " + fromWhereClause; } - protected void throwDeriveReferrerInvalidColumnSpecificationException( + protected void throwDerivedReferrerInvalidColumnSpecificationException( String function, String aliasName) { + String method = xconvertFunctionToMethod(function); String msg = "Look! Read the message below." + getLineSeparator(); msg = msg + "/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *" + getLineSeparator(); - msg = msg + "The specified the column for derive-referrer was Invalid!" + msg = msg + + "The specified the column for derived-referrer was Invalid!" + getLineSeparator(); msg = msg + getLineSeparator(); msg = msg + "[Advice]" + getLineSeparator(); @@ -941,7 +888,7 @@ msg = msg + " /- - - - - - - - - - - - - - - - - - - - " + getLineSeparator(); msg = msg + " MemberCB cb = new MemberCB();" + getLineSeparator(); - msg = msg + " cb.specify().derivePurchaseList()." + function + msg = msg + " cb.specify().derivePurchaseList()." + method + "(new SubQuery() {" + getLineSeparator(); msg = msg + " public void query(PurchaseCB subCB) {" + getLineSeparator(); @@ -955,7 +902,7 @@ msg = msg + " /- - - - - - - - - - - - - - - - - - - - " + getLineSeparator(); msg = msg + " MemberCB cb = new MemberCB();" + getLineSeparator(); - msg = msg + " cb.specify().derivePurchaseList()." + function + msg = msg + " cb.specify().derivePurchaseList()." + method + "(new SubQuery() {" + getLineSeparator(); msg = msg + " public void query(PurchaseCB subCB) {" + getLineSeparator(); @@ -973,7 +920,7 @@ msg = msg + " /- - - - - - - - - - - - - - - - - - - - " + getLineSeparator(); msg = msg + " MemberCB cb = new MemberCB();" + getLineSeparator(); - msg = msg + " cb.specify().derivePurchaseList()." + function + msg = msg + " cb.specify().derivePurchaseList()." + method + "(new SubQuery() {" + getLineSeparator(); msg = msg + " public void query(PurchaseCB subCB) {" + getLineSeparator(); @@ -988,19 +935,19 @@ msg = msg + "[Alias Name]" + getLineSeparator() + aliasName + getLineSeparator(); msg = msg + "* * * * * * * * * */"; - throw new DeriveReferrerInvalidColumnSpecificationException(msg); + throw new DerivedReferrerInvalidColumnSpecificationException(msg); } - public static class DeriveReferrerInvalidColumnSpecificationException + public static class DerivedReferrerInvalidColumnSpecificationException extends RuntimeException { private static final long serialVersionUID = 1L; - public DeriveReferrerInvalidColumnSpecificationException(String msg) { + public DerivedReferrerInvalidColumnSpecificationException(String msg) { super(msg); } } - protected void assertDeriveReferrerColumnType(String function, + protected void assertDerivedReferrerColumnType(String function, ConditionQuery subQuery, String deriveColumnName) { final DBMeta dbmeta = DBMetaInstanceHandler.findDBMeta(subQuery .getTableDbName()); @@ -1009,13 +956,13 @@ if ("sum".equalsIgnoreCase(function) || "avg".equalsIgnoreCase(function)) { if (!Number.class.isAssignableFrom(deriveColumnType)) { - throwDeriveReferrerUnmatchedColumnTypeException(function, + throwDerivedReferrerUnmatchedColumnTypeException(function, deriveColumnName, deriveColumnType); } } } - protected void throwDeriveReferrerUnmatchedColumnTypeException( + protected void throwDerivedReferrerUnmatchedColumnTypeException( String function, String deriveColumnName, Class deriveColumnType) { String msg = "Look! Read the message below." + getLineSeparator(); msg = msg @@ -1040,19 +987,366 @@ msg = msg + "[Derive Column]" + getLineSeparator() + deriveColumnName + "(" + deriveColumnType.getName() + ")" + getLineSeparator(); msg = msg + "* * * * * * * * * */"; - throw new DeriveReferrerUnmatchedColumnTypeException(msg); + throw new DerivedReferrerUnmatchedColumnTypeException(msg); } - public static class DeriveReferrerUnmatchedColumnTypeException extends + public static class DerivedReferrerUnmatchedColumnTypeException extends RuntimeException { private static final long serialVersionUID = 1L; - public DeriveReferrerUnmatchedColumnTypeException(String msg) { + public DerivedReferrerUnmatchedColumnTypeException(String msg) { super(msg); } } + // [DBFlute-0.8.8] // ----------------------------------------------------- + // ScalarSubQuery + // -------------- + protected void registerScalarSubQuery(String function, + ConditionQuery subQuery, String propertyName, String operand) { + assertObjectNotNull("ScalarSubQuery(" + propertyName + ")", subQuery); + + // Get the specified column before it disappears at sub-query making. + String deriveRealColumnName; + { + String deriveColumnName = subQuery.getSqlClause() + .getSpecifiedColumnNameAsOne(); + if (deriveColumnName == null + || deriveColumnName.trim().length() == 0) { + throwScalarSubQueryInvalidColumnSpecificationException(function); + } + deriveRealColumnName = getScalarSubQueryRealColumnName(deriveColumnName); + } + + xincrementLocalSubQueryLevelIfNeeds(subQuery); + String subQueryClause = getScalarSubQuerySql(function, subQuery, + propertyName); + String ln = getLineSeparator(); + int subQueryLevel = subQuery.getSubQueryLevel(); + String subQueryIdentity = propertyName + "[" + subQueryLevel + "]"; + String beginMark = getSqlClause().resolveSubQueryBeginMark( + subQueryIdentity) + + ln; + String endMark = getSqlClause() + .resolveSubQueryEndMark(subQueryIdentity); + String endIndent = " "; + String clause = deriveRealColumnName + " " + operand + " (" + beginMark + + subQueryClause + ln + endIndent + ") " + endMark; + registerWhereClause(clause); + } + + protected String getScalarSubQueryRealColumnName(String columnName) { + return getRealColumnName(columnName); + } + + protected String getScalarSubQuerySql(String function, + ConditionQuery subQuery, String propertyName) { + int subQueryLevel = subQuery.getSubQueryLevel(); + String tableAliasName = "dfsublocal_" + subQueryLevel; + String deriveColumnName = subQuery.getSqlClause() + .getSpecifiedColumnNameAsOne(); + if (deriveColumnName == null || deriveColumnName.trim().length() == 0) { + throwScalarSubQueryInvalidColumnSpecificationException(function); + } + assertScalarSubQueryColumnType(function, subQuery, deriveColumnName); + subQuery.getSqlClause().clearSpecifiedSelectColumn(); // specified + // columns + // disappear at + // this timing + DBMeta dbmeta = DBMetaInstanceHandler.findDBMeta(subQuery + .getTableDbName()); + if (!dbmeta.hasPrimaryKey() || dbmeta.hasTwoOrMorePrimaryKeys()) { + String msg = "The scalar-sub-query is unsupported when no primary key or two-or-more primary keys:"; + msg = msg + " table=" + subQuery.getTableDbName(); + throw new UnsupportedOperationException(msg); + } + String primaryKeyName = dbmeta.getPrimaryUniqueInfo().getFirstColumn() + .getColumnDbName(); + if (subQuery.getSqlClause().hasUnionQuery()) { + String ln = getLineSeparator(); + String subQueryIdentity = propertyName + "[" + subQueryLevel + + ":subquerymain]"; + String beginMark = getSqlClause().resolveSubQueryBeginMark( + subQueryIdentity) + + ln; + String endMark = getSqlClause().resolveSubQueryEndMark( + subQueryIdentity); + String selectClause = "select " + tableAliasName + "." + + primaryKeyName + ", " + tableAliasName + "." + + deriveColumnName; + String fromWhereClause = buildPlainSubQueryFromWhereClause( + subQuery, primaryKeyName, propertyName, selectClause, + tableAliasName); + String mainSql = selectClause + " " + fromWhereClause; + return "select " + function + "(dfsubquerymain." + deriveColumnName + + ")" + ln + " from (" + beginMark + mainSql + ln + + " ) dfsubquerymain" + endMark; + } else { + String selectClause = "select " + function + "(" + tableAliasName + + "." + deriveColumnName + ")"; + String fromWhereClause = buildPlainSubQueryFromWhereClause( + subQuery, primaryKeyName, propertyName, selectClause, + tableAliasName); + return selectClause + " " + fromWhereClause; + } + } + + protected void throwScalarSubQueryInvalidColumnSpecificationException( + String function) { + String msg = "Look! Read the message below." + getLineSeparator(); + msg = msg + + "/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *" + + getLineSeparator(); + msg = msg + + "The specified the column for derived-referrer was Invalid!" + + getLineSeparator(); + msg = msg + getLineSeparator(); + msg = msg + "[Advice]" + getLineSeparator(); + msg = msg + + " You should call specify().column[TargetColumn]() only once." + + getLineSeparator(); + msg = msg + " For example:" + getLineSeparator(); + msg = msg + " " + getLineSeparator(); + msg = msg + " [Wrong]" + getLineSeparator(); + msg = msg + " /- - - - - - - - - - - - - - - - - - - - " + + getLineSeparator(); + msg = msg + " MemberCB cb = new MemberCB();" + getLineSeparator(); + msg = msg + " cb.query().scalar_Equal()." + function + + "(new SubQuery() {" + getLineSeparator(); + msg = msg + " public void query(MemberCB subCB) {" + + getLineSeparator(); + msg = msg + " // *No! It's empty!" + getLineSeparator(); + msg = msg + " }" + getLineSeparator(); + msg = msg + " });" + getLineSeparator(); + msg = msg + " - - - - - - - - - -/" + getLineSeparator(); + msg = msg + " " + getLineSeparator(); + msg = msg + " [Wrong]" + getLineSeparator(); + msg = msg + " /- - - - - - - - - - - - - - - - - - - - " + + getLineSeparator(); + msg = msg + " MemberCB cb = new MemberCB();" + getLineSeparator(); + msg = msg + " cb.query().scalar_Equal()." + function + + "(new SubQuery() {" + getLineSeparator(); + msg = msg + " public void query(MemberCB subCB) {" + + getLineSeparator(); + msg = msg + " subCB.specify().columnMemberBirthday();" + + getLineSeparator(); + msg = msg + + " subCB.specify().columnMemberName(); // *No! It's duplicated!" + + getLineSeparator(); + msg = msg + " }" + getLineSeparator(); + msg = msg + " });" + getLineSeparator(); + msg = msg + " - - - - - - - - - -/" + getLineSeparator(); + msg = msg + " " + getLineSeparator(); + msg = msg + " [Good!]" + getLineSeparator(); + msg = msg + " /- - - - - - - - - - - - - - - - - - - - " + + getLineSeparator(); + msg = msg + " MemberCB cb = new MemberCB();" + getLineSeparator(); + msg = msg + " cb.query().scalar_Equal()." + function + + "(new SubQuery() {" + getLineSeparator(); + msg = msg + " public void query(MemberCB subCB) {" + + getLineSeparator(); + msg = msg + + " subCB.specify().columnPurchaseDatetime(); // *Point!" + + getLineSeparator(); + msg = msg + " }" + getLineSeparator(); + msg = msg + " });" + getLineSeparator(); + msg = msg + " - - - - - - - - - -/" + getLineSeparator(); + msg = msg + "* * * * * * * * * */"; + throw new ScalarSubQueryInvalidColumnSpecificationException(msg); + } + + public static class ScalarSubQueryInvalidColumnSpecificationException + extends RuntimeException { + private static final long serialVersionUID = 1L; + + public ScalarSubQueryInvalidColumnSpecificationException(String msg) { + super(msg); + } + } + + protected void assertScalarSubQueryColumnType(String function, + ConditionQuery subQuery, String deriveColumnName) { + final DBMeta dbmeta = DBMetaInstanceHandler.findDBMeta(subQuery + .getTableDbName()); + final Class deriveColumnType = dbmeta.findColumnInfo( + deriveColumnName).getPropertyType(); + if ("sum".equalsIgnoreCase(function) + || "avg".equalsIgnoreCase(function)) { + if (!Number.class.isAssignableFrom(deriveColumnType)) { + throwScalarSubQueryUnmatchedColumnTypeException(function, + deriveColumnName, deriveColumnType); + } + } + } + + protected void throwScalarSubQueryUnmatchedColumnTypeException( + String function, String deriveColumnName, Class deriveColumnType) { + String msg = "Look! Read the message below." + getLineSeparator(); + msg = msg + + "/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *" + + getLineSeparator(); + msg = msg + + "The type of the specified the column unmatched with the function!" + + getLineSeparator(); + msg = msg + getLineSeparator(); + msg = msg + "[Advice]" + getLineSeparator(); + msg = msg + "You should confirm the list as follow:" + + getLineSeparator(); + msg = msg + " max() : String, Number, Date" + getLineSeparator(); + msg = msg + " min() : String, Number, Date" + getLineSeparator(); + msg = msg + " sum() : Number" + getLineSeparator(); + msg = msg + " avg() : Number" + getLineSeparator(); + msg = msg + getLineSeparator(); + msg = msg + "[Function]" + getLineSeparator() + function + + getLineSeparator(); + msg = msg + getLineSeparator(); + msg = msg + "[Derive Column]" + getLineSeparator() + deriveColumnName + + "(" + deriveColumnType.getName() + ")" + getLineSeparator(); + msg = msg + "* * * * * * * * * */"; + throw new ScalarSubQueryUnmatchedColumnTypeException(msg); + } + + public static class ScalarSubQueryUnmatchedColumnTypeException extends + RuntimeException { + private static final long serialVersionUID = 1L; + + public ScalarSubQueryUnmatchedColumnTypeException(String msg) { + super(msg); + } + } + + public static class SSQFunction { + protected SSQSetupper _setupper; + + public SSQFunction(SSQSetupper setupper) { + _setupper = setupper; + } + + public void max(SubQuery subQuery) { + _setupper.setup("max", subQuery); + } + + public void min(SubQuery subQuery) { + _setupper.setup("min", subQuery); + } + + public void sum(SubQuery subQuery) { + _setupper.setup("sum", subQuery); + } + + public void avg(SubQuery subQuery) { + _setupper.setup("avg", subQuery); + } + } + + protected static interface SSQSetupper { + public void setup(String function, SubQuery subQuery); + } + + // ----------------------------------------------------- + // SubQuery Common + // --------------- + protected String buildPlainSubQueryFromWhereClause(ConditionQuery subQuery, + String relatedColumnName, String propertyName, String selectClause, + String tableAliasName) { + String fromWhereClause = subQuery.getSqlClause() + .getClauseFromWhereWithUnionTemplate(); + + // Replace the alias names for local table with alias name of sub-query + // unique. + // However when it's inScope this replacement is unnecessary so comment + // out here. + // (Override base alias name at sub-query on SQL) + // So if the argument 'tableAliasName' is not null, replace it. + if (tableAliasName != null) { + fromWhereClause = replaceString(fromWhereClause, "dflocal", + tableAliasName); + } + + // Resolve the location path for the condition-query of sub-query. + fromWhereClause = replaceString(fromWhereClause, ".conditionQuery.", + "." + getLocationBase(propertyName) + "."); + + // Replace template marks. These are very important! + fromWhereClause = replaceString(fromWhereClause, getSqlClause() + .getUnionSelectClauseMark(), selectClause); + fromWhereClause = replaceString(fromWhereClause, getSqlClause() + .getUnionWhereClauseMark(), ""); + fromWhereClause = replaceString(fromWhereClause, getSqlClause() + .getUnionWhereFirstConditionMark(), ""); + return fromWhereClause; + } + + protected String buildCorrelationSubQueryFromWhereClause( + ConditionQuery subQuery, String relatedColumnName, + String propertyName, String selectClause, String tableAliasName, + String realColumnName) { + String fromWhereClause = subQuery.getSqlClause() + .getClauseFromWhereWithWhereUnionTemplate(); + + // Replace the alias names for local table with alias name of sub-query + // unique. + fromWhereClause = replaceString(fromWhereClause, "dflocal", + tableAliasName); + + // Resolve the location path for the condition-query of sub-query. + fromWhereClause = replaceString(fromWhereClause, ".conditionQuery.", + "." + getLocationBase(propertyName) + "."); + + String joinCondition = tableAliasName + "." + relatedColumnName + " = " + + realColumnName; + String firstConditionAfter = getLineSeparator() + " and "; + + // Replace template marks. These are very important! + fromWhereClause = replaceString(fromWhereClause, getSqlClause() + .getWhereClauseMark(), "where " + joinCondition); + fromWhereClause = replaceString(fromWhereClause, getSqlClause() + .getWhereFirstConditionMark(), joinCondition + + firstConditionAfter); + fromWhereClause = replaceString(fromWhereClause, getSqlClause() + .getUnionSelectClauseMark(), selectClause); + fromWhereClause = replaceString(fromWhereClause, getSqlClause() + .getUnionWhereClauseMark(), "where " + joinCondition); + fromWhereClause = replaceString(fromWhereClause, getSqlClause() + .getUnionWhereFirstConditionMark(), joinCondition + + firstConditionAfter); + return fromWhereClause; + } + + protected void xincrementLocalSubQueryLevelIfNeeds(ConditionQuery subQuery) { // Very + // Internal + int subQueryLevel = subQuery.getSubQueryLevel(); + if (_subQueryLevel <= subQueryLevel) { + _subQueryLevel = subQueryLevel + 1; + } + } + + protected String xbuildFunctionConnector(String function) { + if (function != null && function.endsWith("(distinct")) { // For example + // 'count(distinct' + return " "; + } else { + return "("; + } + } + + protected String xconvertFunctionToMethod(String function) { + if (function != null && function.contains("(")) { // For example + // 'count(distinct' + int index = function.indexOf("("); + String front = function.substring(0, index); + if (function.length() > front.length() + "(".length()) { + String rear = function.substring(index + "(".length()); + function = front + initCap(rear); + } else { + function = front; + } + } + return function; + } + + // ----------------------------------------------------- // Where Clause // ------------ protected void setupConditionValueAndRegisterWhereClause(ConditionKey key, @@ -1276,14 +1570,16 @@ // ========= // Fixed Condition // =============== - protected String prepareFixedCondition(String fixedCondition, - String localAliasName, String foreignAliasName) { + protected String ppFxCd(String fixedCondition, String localAliasName, + String foreignAliasName) { // prepareFixedCondition fixedCondition = replaceString(fixedCondition, "$$alias$$", foreignAliasName); fixedCondition = replaceString(fixedCondition, "$$foreignAlias$$", foreignAliasName); fixedCondition = replaceString(fixedCondition, "$$localAlias$$", localAliasName); + fixedCondition = replaceString(fixedCondition, "$$locationBase$$.", + "dto." + getLocationBase()); return fixedCondition; } @@ -1515,7 +1811,7 @@ return newList; } - public void doNss(NssCall callback) {// Very Internal + public void doNss(NssCall callback) { // Very Internal String foreignPropertyName = callback.qf().getForeignPropertyName(); String foreignTableAliasName = callback.qf().getRealAliasName(); getSqlClause().registerSelectedSelectColumn(foreignTableAliasName, @@ -1524,7 +1820,7 @@ callback.qf().getRelationPath(), foreignPropertyName); } - public static interface NssCall {// Very Internal + public static interface NssCall { // Very Internal public ConditionQuery qf(); } Modified: userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/cbean/ConditionBean.java =================================================================== --- userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/cbean/ConditionBean.java 2008-12-26 22:11:31 UTC (rev 1622) +++ userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/cbean/ConditionBean.java 2008-12-27 22:02:56 UTC (rev 1623) @@ -1,5 +1,7 @@ package jp.sf.pal.userinfo.db.allcommon.cbean; +import java.util.Map; + import jp.sf.pal.userinfo.db.allcommon.cbean.sqlclause.SqlClause; import jp.sf.pal.userinfo.db.allcommon.jdbc.StatementConfig; @@ -11,28 +13,6 @@ public interface ConditionBean extends PagingBean { //========================================================================== - // =========== - // Definition - // ========== - /** Map-string map-mark. */ - public static final String MAP_STRING_MAP_MARK = "map:"; - - /** Map-string list-mark. */ - public static final String MAP_STRING_LIST_MARK = "list:"; - - /** Map-string start-brace. */ - public static final String MAP_STRING_START_BRACE = "@{"; - - /** Map-string end-brace. */ - public static final String MAP_STRING_END_BRACE = "@}"; - - /** Map-string delimiter. */ - public static final String MAP_STRING_DELIMITER = "@;"; - - /** Map-string equal. */ - public static final String MAP_STRING_EQUAL = "@="; - - //========================================================================== // ========= // Table Name // ========== @@ -70,8 +50,7 @@ * * @param primaryKeyMap Primary-key map. (NotNull and NotEmpty) */ - public void acceptPrimaryKeyMap( - java.util.Map primaryKeyMap); + public void acceptPrimaryKeyMap(Map primaryKeyMap); /** * Accept primary-key map-string. Delimiter is at-mark and semicolon. @@ -105,14 +84,6 @@ // Query // ===== /** - * Get condition-query as interface. - * - * @return Instance of query as interface. (NotNull) - * @deprecated - */ - public ConditionQuery getConditionQueryAsInterface(); - - /** * Get the conditionQuery of the local table as interface. * * @return The conditionQuery of the local table as interface. (NotNull) @@ -131,32 +102,6 @@ public boolean hasUnionQueryOrUnionAllQuery(); //========================================================================== - // ========= - // Limit Select - // ============ - /** - * Limit select PK only. This is OLD style. You can do the same thing by - * specify(). - * - * @return this. (NotNull) - */ - public ConditionBean limitSelect_PKOnly(); - - /** - * Limit select off. - * - * @return this. (NotNull) - */ - public ConditionBean limitSelect_Off(); - - /** - * Is limit-select PK only? - * - * @return Determination. - */ - public boolean isLimitSelect_PKOnly(); - - //========================================================================== // =========== // Lock Setting // ============ Modified: userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/cbean/ConditionBeanContext.java =================================================================== --- userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/cbean/ConditionBeanContext.java 2008-12-26 22:11:31 UTC (rev 1622) +++ userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/cbean/ConditionBeanContext.java 2008-12-27 22:02:56 UTC (rev 1623) @@ -1,10 +1,6 @@ package jp.sf.pal.userinfo.db.allcommon.cbean; -import java.util.Collections; -import java.util.LinkedHashMap; -import java.util.Map; - -import jp.sf.pal.userinfo.db.allcommon.DBFluteConfig; +import jp.sf.pal.userinfo.db.allcommon.DBDef; import jp.sf.pal.userinfo.db.allcommon.cbean.sqlclause.SqlClause; import jp.sf.pal.userinfo.db.allcommon.cbean.sqlclause.SqlClauseDb2; import jp.sf.pal.userinfo.db.allcommon.cbean.sqlclause.SqlClauseDerby; @@ -78,11 +74,35 @@ //========================================================================== // ========= - // Initialize against the ClassLoader Headache - // =========================================== + // Type Determination + // ================== + /** + * Is the argument condition-bean? + * + * @param dtoInstance DTO instance. + * @return Determination. + */ + public static boolean isTheArgumentConditionBean(final Object dtoInstance) { + return dtoInstance instanceof ConditionBean; + } + + /** + * Is the type condition-bean? + * + * @param dtoClass DtoClass. + * @return Determination. + */ + public static boolean isTheTypeConditionBean(final Class dtoClass) { + return ConditionBean.class.isAssignableFrom(dtoClass); + } + + //========================================================================== + // ========= + // Cool Classes + // ============ @SuppressWarnings("unused") - public static void initialize() { - boolean debugEnabled = _log.isDebugEnabled(); + public static void loadCoolClasses() { + boolean debugEnabled = false; // If you watch the log, set this true. // Against the ClassLoader Headache! final StringBuilder sb = new StringBuilder(); { @@ -119,120 +139,6 @@ //========================================================================== // ========= - // Type Determination - // ================== - /** - * Is the argument condition-bean? - * - * @param dtoInstance DTO instance. - * @return Determination. - */ - public static boolean isTheArgumentConditionBean(final Object dtoInstance) { - if (dtoInstance instanceof ConditionBean) { - return true; - } else { - return false; - } - } - - /** - * Is the type condition-bean? - * - * @param dtoClass DtoClass. - * @return Determination. - */ - public static boolean isTheTypeConditionBean(final Class dtoClass) { - if (ConditionBean.class.isAssignableFrom(dtoClass)) { - return true; - } else { - return false; - } - } - - //========================================================================== - // ========= - // Product Name - // ============ - public static final String DB_NAME_DERBY = "derby"; - - public static final String DB_NAME_H2 = "h2"; - - public static final String DB_NAME_ORACLE = "oracle"; - - public static final String DB_NAME_MYSQL = "mysql"; - - public static final String DB_NAME_POSTGRESQL = "postgresql"; - - public static final String DB_NAME_FIREBIRD = "firebird"; - - public static final String DB_NAME_MSSQL = "mssql"; - - public static final String DB_NAME_SYBASE = "sybase"; - - public static final String DB_NAME_DB2 = "db2"; - - protected static final Map _driverHintDatabaseProductNameMap; - static { - final Map tmpMap = Collections - .synchronizedMap(new LinkedHashMap()); - 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 keySet = _driverHintDatabaseProductNameMap - .keySet(); - for (final java.util.Iterator ite = keySet.iterator(); ite - .hasNext();) { - final String driverHint = (String) ite.next(); - if (driverClassName.indexOf(driverHint) >= 0) { - final String databaseProductName = (String) _driverHintDatabaseProductNameMap - .get(driverHint); - setDatabaseProductName(databaseProductName); - return true; - } - } - return false; - } - - /** The database product name. */ - private static String _databaseProductName; - - /** - * Get database product name. - * - * @return Database product name. - */ - public static String getDatabaseProductName() { - return _databaseProductName; - } - - /** - * Set database product name. - * - * @param name Database product name. (NotNull) - */ - public static void setDatabaseProductName(String name) { - if (_databaseProductName != null) { - String msg = "Already set up: current=" + _databaseProductName - + " your=" + name; - throw new IllegalStateException(msg); - } - _databaseProductName = name; - } - - //========================================================================== - // ========= // SqlClause Creator // ================= /** @@ -244,9 +150,6 @@ public static SqlClause createSqlClause(ConditionBean cb) { final String tableSqlName = cb.getTableSqlName(); final SqlClause sqlClause = createSqlClause(tableSqlName); - if (DBFluteConfig.getInstance().isConditionBeanFormatSql()) { - sqlClause.makeFormatClauseEffective(); - } return sqlClause; } @@ -257,27 +160,22 @@ * @return SQL-clause. (NotNull) */ public static SqlClause createSqlClause(String tableDbName) { - final String databaseProductName = getDatabaseProductName(); - if (databaseProductName == null) { - return new SqlClauseH2(tableDbName); - } - final String name = databaseProductName.toLowerCase(); - if (name.equalsIgnoreCase(DB_NAME_DERBY)) { - return new SqlClauseDerby(tableDbName); - } else if (name.equalsIgnoreCase(DB_NAME_H2)) { - return new SqlClauseH2(tableDbName); - } else if (name.equalsIgnoreCase(DB_NAME_ORACLE)) { - return new SqlClauseOracle(tableDbName); - } else if (name.equalsIgnoreCase(DB_NAME_FIREBIRD)) { - return new SqlClauseFirebird(tableDbName); - } else if (name.equalsIgnoreCase(DB_NAME_MYSQL)) { + if (DBDef.isCurrentDef(DBDef.MySQL)) { return new SqlClauseMySql(tableDbName); - } else if (name.equalsIgnoreCase(DB_NAME_POSTGRESQL)) { + } else if (DBDef.isCurrentDef(DBDef.PostgreSQL)) { return new SqlClausePostgreSql(tableDbName); - } else if (name.equalsIgnoreCase(DB_NAME_MSSQL)) { - return new SqlClauseSqlServer(tableDbName); - } else if (name.equalsIgnoreCase(DB_NAME_DB2)) { + } else if (DBDef.isCurrentDef(DBDef.Oracle)) { + return new SqlClauseOracle(tableDbName); + } else if (DBDef.isCurrentDef(DBDef.DB2)) { return new SqlClauseDb2(tableDbName); + } else if (DBDef.isCurrentDef(DBDef.SQLServer)) { + return new SqlClauseSqlServer(tableDbName); + } else if (DBDef.isCurrentDef(DBDef.FireBird)) { + return new SqlClauseFirebird(tableDbName); + } else if (DBDef.isCurrentDef(DBDef.H2)) { + return new SqlClauseH2(tableDbName); + } else if (DBDef.isCurrentDef(DBDef.Derby)) { + return new SqlClauseDerby(tableDbName); } else { return new SqlClauseH2(tableDbName); } @@ -362,12 +260,7 @@ // Display SQL // =========== public static String convertConditionBean2DisplaySql(ConditionBean cb) { - final String twoWaySql; - if (cb.isLimitSelect_PKOnly()) { - twoWaySql = cb.getSqlClause().getClausePKOnly(); - } else { - twoWaySql = cb.getSqlClause().getClause(); - } + final String twoWaySql = cb.getSqlClause().getClause(); return InternalSqlParser.convertTwoWaySql2DisplaySql(twoWaySql, cb); } @@ -390,31 +283,8 @@ errorCode); } - // [DBFlute-0.7.8] //========================================================================== // ========= - // Database Type - // ============= - /** - * Is the database Oracle? - * - * @return Is the database Oracle? - */ - public static boolean isOracle() { - return createSqlClause("dummy") instanceof SqlClauseOracle; - } - - /** - * Is the database PostgreSQL? - * - * @return Is the database PostgreSQL? - */ - public static boolean isPostgreSql() { - return createSqlClause("dummy") instanceof SqlClausePostgreSql; - } - - //========================================================================== - // ========= // Helper // ====== /** Modified: userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/cbean/ConditionQuery.java =================================================================== --- userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/cbean/ConditionQuery.java 2008-12-26 22:11:31 UTC (rev 1622) +++ userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/cbean/ConditionQuery.java 2008-12-27 22:02:56 UTC (rev 1623) @@ -8,7 +8,6 @@ * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public interface ConditionQuery { //========================================================================== Added: userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/cbean/ScalarQuery.java =================================================================== --- userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/cbean/ScalarQuery.java (rev 0) +++ userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/cbean/ScalarQuery.java 2008-12-27 22:02:56 UTC (rev 1623) @@ -0,0 +1,5 @@ +package jp.sf.pal.userinfo.db.allcommon.cbean; + +public interface ScalarQuery { + public void query(CB cb); +} Property changes on: userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/cbean/ScalarQuery.java ___________________________________________________________________ Name: svn:eol-style + native Deleted: userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/cbean/SimpleOrderByBean.java =================================================================== --- userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/cbean/SimpleOrderByBean.java 2008-12-26 22:11:31 UTC (rev 1622) +++ userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/cbean/SimpleOrderByBean.java 2008-12-27 22:02:56 UTC (rev 1623) @@ -1,165 +0,0 @@ -package jp.sf.pal.userinfo.db.allcommon.cbean; - -import jp.sf.pal.userinfo.db.allcommon.cbean.sqlclause.OrderByClause; -import jp.sf.pal.userinfo.db.allcommon.cbean.sqlclause.SqlClause; - -/** - * @deprecated - */ -public class SimpleOrderByBean implements OrderByBean { - - //========================================================================== - // ========= - // Attribute - // ========= - /** SQL clause instance. */ - protected final SqlClause _sqlClause; - { - _sqlClause = ConditionBeanContext.createSqlClause("Dummy"); - } - - //========================================================================== - // ========= - // Constructor - // =========== - /** - * Constructor. - */ - public SimpleOrderByBean() { - } - - //========================================================================== - // ========= - // SqlClause - // ========= - /** - * Get sql-clause. - * - * @return Sql clause. (NotNull) - */ - protected SqlClause getSqlClause() { - return _sqlClause; - } - - //========================================================================== - // ========= - // Select Resource - // =============== - /** - * Check safety result. - * - * @param safetyMaxResultSize Safety max result size. (If zero or minus, - * ignore checking) - */ - public void checkSafetyResult(int safetyMaxResultSize) { - throw new UnsupportedOperationException(); - } - - //========================================================================== - // ========= - // OrderBy - // ======= - /** - * The implementation. - * - * @return Sql component of order-by clause. (NotNull) - */ - public OrderByClause getSqlComponentOfOrderByClause() { - return getSqlClause().getSqlComponentOfOrderByClause(); - } - - /** - * The implementation. - * - * @return Order-by clause. (NotNull) - */ - public String getOrderByClause() { - return getSqlClause().getOrderByClause(); - } - - /** - * The implementation. - * - * @return this. (NotNull) - */ - public OrderByBean clearOrderBy() { - getSqlClause().clearOrderBy(); - return this; - } - - /** - * The implementation. - * - * @return this. (NotNull) - */ - public OrderByBean ignoreOrderBy() { - getSqlClause().ignoreOrderBy(); - return this; - } - - /** - * The implementation. - * - * @return this. (NotNull) - */ - public OrderByBean makeOrderByEffective() { - getSqlClause().makeOrderByEffective(); - return this; - } - - /** - * Register order-by-asc. - * - * @param orderByProperty Order-by-property. - * 'aliasName.columnName/aliasName.columnName/...' (NotNull) - * @return this. (NotNull) - * @deprecated - */ - public OrderByBean registerOrderByAsc(String orderByProperty) { - getSqlClause().registerOrderBy(orderByProperty, orderByProperty, true); - return this; - } - - /** - * Register order-by-desc. - * - * @param orderByProperty Order-by-property. - * 'aliasName.columnName/aliasName.columnName/...' (NotNull) - * @return this. (NotNull) - * @deprecated - */ - public OrderByBean registerOrderByDesc(String orderByProperty) { - getSqlClause().registerOrderBy(orderByProperty, orderByProperty, false); - return this; - } - - /** - * Reverse order-by or Override order-by asc. - * - * @param orderByProperty Order-by-property. - * 'aliasName.columnName/aliasName.columnName/...' (NotNull) - * @return this. (NotNull) - * @deprecated - */ - public OrderByBean reverseOrderBy_Or_OverrideOrderByAsc( - String orderByProperty) { - getSqlClause().reverseOrderBy_Or_OverrideOrderBy(orderByProperty, - orderByProperty, true); - return this; - } - - /** - * Reverse order-by or Override order-by desc. - * - * @param orderByProperty Order-by-property. - * 'aliasName.columnName/aliasName.columnName/...' (NotNull) - * @return this. (NotNull) - * @deprecated - */ - public OrderByBean reverseOrderBy_Or_OverrideOrderByDesc( - String orderByProperty) { - getSqlClause().reverseOrderBy_Or_OverrideOrderBy(orderByProperty, - orderByProperty, false); - return this; - } -} Modified: userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/cbean/ckey/ConditionKey.java =================================================================== --- userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/cbean/ckey/ConditionKey.java 2008-12-26 22:11:31 UTC (rev 1622) +++ userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/cbean/ckey/ConditionKey.java 2008-12-27 22:02:56 UTC (rev 1623) @@ -12,6 +12,10 @@ */ public abstract class ConditionKey { + //========================================================================== + // ========= + // Definition + // ========== /** Mark of replaced value. */ public static final String MARK_OF_REPLACED_VALUE = "ReplacedValue"; @@ -36,15 +40,18 @@ /** The condition key of prefixSearch. */ public static final ConditionKey CK_PREFIX_SEARCH = new ConditionKeyPrefixSearch(); - /** The condition key of likeSearch. */ - public static final ConditionKey CK_LIKE_SEARCH = new ConditionKeyLikeSearch(); - /** The condition key of inScope. */ public static final ConditionKey CK_IN_SCOPE = new ConditionKeyInScope(); /** The condition key of notInScope. */ public static final ConditionKey CK_NOT_IN_SCOPE = new ConditionKeyNotInScope(); + /** The condition key of likeSearch. */ + public static final ConditionKey CK_LIKE_SEARCH = new ConditionKeyLikeSearch(); + + /** The condition key of notLikeSearch. */ + public static final ConditionKey CK_NOT_LIKE_SEARCH = new ConditionKeyNotLikeSearch(); + /** The condition key of isNull. */ public static final ConditionKey CK_IS_NULL = new ConditionKeyIsNull(); @@ -54,31 +61,21 @@ /** Dummy-object for IsNull and IsNotNull and so on... */ protected static final Object DUMMY_OBJECT = new Object(); + //========================================================================== + // ========= + // Attribute + // ========= /** Condition-key. */ protected String _conditionKey; /** Operand. */ protected String _operand; + //========================================================================== + // ========= + // Validation + // ========== /** - * Get condition-key. - * - * @return Condition-key. - */ - public String getConditionKey() { - return _conditionKey; - } - - /** - * Get operand. - * - * @return Operand. - */ - public String getOperand() { - return _operand; - } - - /** * Is valid registration? * * @param conditionValue Condition value. (NotNull) @@ -89,6 +86,10 @@ abstract public boolean isValidRegistration(ConditionValue conditionValue, Object value, String callerName); + //========================================================================== + // ========= + // Where Clause + // ============ /** * Add where clause. * @@ -149,6 +150,10 @@ abstract protected void doAddWhereClause(List conditionList, String columnName, ConditionValue value, ConditionOption option); + //========================================================================== + // ========= + // Condition Value + // =============== /** * Setup condition value. * @@ -210,6 +215,10 @@ ConditionValue conditionValue, Object value, String location, ConditionOption option); + //========================================================================== + // ========= + // Bind Clause + // =========== /** * Build bind clause. (for s2dao) * @@ -269,6 +278,10 @@ return "%"; } + //========================================================================== + // ========= + // Basic Override + // ============== /** * The override. Returns hash-code of this condition-key string. * @@ -304,4 +317,26 @@ return "ConditionKey: " + getConditionKey() + " " + getOperand() + " wild-card=[" + getWildCard() + "]"; } + + //========================================================================== + // ========= + // Accessor + // ======== + /** + * Get condition-key. + * + * @return Condition-key. + */ + public String getConditionKey() { + return _conditionKey; + } + + /** + * Get operand. + * + * @return Operand. + */ + public String getOperand() { + return _operand; + } } Added: userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/cbean/ckey/ConditionKeyNotLikeSearch.java =================================================================== --- userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/cbean/ckey/ConditionKeyNotLikeSearch.java (rev 0) +++ userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/cbean/ckey/ConditionKeyNotLikeSearch.java 2008-12-27 22:02:56 UTC (rev 1623) @@ -0,0 +1,104 @@ +package jp.sf.pal.userinfo.db.allcommon.cbean.ckey; + +import java.util.List; + +import jp.sf.pal.userinfo.db.allcommon.cbean.coption.ConditionOption; +import jp.sf.pal.userinfo.db.allcommon.cbean.coption.LikeSearchOption; +import jp.sf.pal.userinfo.db.allcommon.cbean.cvalue.ConditionValue; + +/** + * The condition-key of notLikeSearch. + * + * @author DBFlute(AutoGenerator) + */ +public class ConditionKeyNotLikeSearch extends ConditionKey { + + /** + * Constructor. + */ + protected ConditionKeyNotLikeSearch() { + _conditionKey = "notLikeSearch"; + _operand = "not like"; + } + + /** + * Is valid registration? + * + * @param conditionValue Condition value. (NotNull) + * @param value Value. (NotNull) + * @param callerName Caller name. (NotNull) + * @return Determination. + */ + public boolean isValidRegistration(ConditionValue conditionValue, + Object value, String callerName) { + if (value == null) { + return false; + } + return true; + } + + /** + * This method implements super#doAddWhereClause(). + * + * @param conditionList Condition list. (NotNull) + * @param columnName Column name. (NotNull) + * @param value Condition value. (NotNull) + */ + protected void doAddWhereClause(List 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 conditionList, + String columnName, ConditionValue value, ConditionOption option) { + if (option == null) { + String msg = "The argument[option] should not be null: columnName=" + + columnName + " value=" + value; + throw new IllegalArgumentException(msg); + } + if (!(option instanceof LikeSearchOption)) { + String msg = "The argument[option] should be LikeSearchOption: columnName=" + + columnName + " value=" + value; + throw new IllegalArgumentException(msg); + } + final LikeSearchOption myOption = (LikeSearchOption) option; + conditionList.add(buildBindClauseWithRearOption(columnName, value + .getNotLikeSearchLocation(), myOption.getRearOption())); + } + + /** + * This method implements super#doSetupConditionValue(). + * + * @param conditionValue Condition value. (NotNull) + * @param value Value. (NotNull) + * @param location Location. (NotNull) + */ + protected void doSetupConditionValue(ConditionValue conditionValue, + Object value, String location) { + throw new UnsupportedOperationException( + "doSetupConditionValue without condition-option is unsupported!!!"); + } + + /** + * This method implements super#doSetupConditionValue(). + * + * @param conditionValue Condition value. (NotNull) + * @param value Value. (NotNull) + * @param location Location. (NotNull) + * @param option Condition option. (NotNull) + */ + protected void doSetupConditionValue(ConditionValue conditionValue, + Object value, String location, ConditionOption option) { + conditionValue.setNotLikeSearch((String) value, + (LikeSearchOption) option).setNotLikeSearchLocation(location); + } +} Property changes on: userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/cbean/ckey/ConditionKeyNotLikeSearch.java ___________________________________________________________________ Name: svn:eol-style + native Modified: userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/cbean/coption/FromToOption.java =================================================================== --- userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/cbean/coption/FromToOption.java 2008-12-26 22:11:31 UTC (rev 1622) +++ userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/cbean/coption/FromToOption.java 2008-12-27 22:02:56 UTC (rev 1623) @@ -1,5 +1,10 @@ package jp.sf.pal.userinfo.db.allcommon.cbean.coption; +import java.util.Calendar; +import java.util.Date; + +import jp.sf.pal.userinfo.db.allcommon.cbean.ckey.ConditionKey; + /** * The option of from-to. * @@ -85,60 +90,84 @@ // ========= // Internal Main // ============= - public java.util.Date filterFromDate(java.util.Date fromDate) { + /** + * Filter the date as From. It requires this method is called before + * getFromDateConditionKey(). + * + * @param fromDate The date as From. (Nullable: If the value is null, it + * returns null) + * @return The filtered date as From. (Nullable) + */ + public Date filterFromDate(Date fromDate) { if (fromDate == null) { return null; } if (_compareAsDate) { - final java.util.Calendar cal = java.util.Calendar.getInstance(); + final Calendar cal = Calendar.getInstance(); cal.setTimeInMillis(fromDate.getTime()); clearCalendarHourMinuteSecondMilli(cal); - final java.util.Date cloneDate = (java.util.Date) fromDate.clone(); + final Date cloneDate = (Date) fromDate.clone(); cloneDate.setTime(cal.getTimeInMillis()); return cloneDate; } return fromDate; } - public java.util.Date filterToDate(java.util.Date toDate) { + /** + * Filter the date as To. It requires this method is called before + * getToDateConditionKey(). + * + * @param toDate The date as To. (Nullable: If the value is null, it returns + * null) + * @return The filtered date as To. (Nullable) + */ + public Date filterToDate(Date toDate) { if (toDate == null) { return null; } if (_compareAsDate) { - final java.util.Calendar cal = java.util.Calendar.getInstance(); + final Calendar cal = Calendar.getInstance(); cal.setTimeInMillis(toDate.getTime()); clearCalendarHourMinuteSecondMilli(cal); addCalendarNextDay(cal);// Key Point! - final java.util.Date cloneDate = (java.util.Date) toDate.clone(); + final Date cloneDate = (Date) toDate.clone(); cloneDate.setTime(cal.getTimeInMillis()); return cloneDate; } return toDate; } - public jp.sf.pal.userinfo.db.allcommon.cbean.ckey.ConditionKey getFromDateConditionKey() { + /** + * Get the condition-key of the from-date. It requires this method is called + * after filterFromDate(). + * + * @return The condition-key of the from-date. (NotNull) + */ + public ConditionKey getFromDateConditionKey() { if (_compareAsDate) { - return jp.sf.pal.userinfo.db.allcommon.cbean.ckey.ConditionKey.CK_GREATER_EQUAL; + return ConditionKey.CK_GREATER_EQUAL; } if (_fromDateGreaterThan) { - return jp.sf.pal.userinfo.db.allcommon.cbean.ckey.ConditionKey.CK_GREATER_THAN;// Default - // ! + return ConditionKey.CK_GREATER_THAN;// Default! } else { - return jp.sf.pal.userinfo.db.allcommon.cbean.ckey.ConditionKey.CK_GREATER_EQUAL;// Default - // ! + return ConditionKey.CK_GREATER_EQUAL;// Default! } } - public jp.sf.pal.userinfo.db.allcommon.cbean.ckey.ConditionKey getToDateConditionKey() { + /** + * Get the condition-key of the to-date. It requires this method is called + * after filterToDate(). + * + * @return The condition-key of the to-date. (NotNull) + */ + public ConditionKey getToDateConditionKey() { if (_compareAsDate) { - return jp.sf.pal.userinfo.db.allcommon.cbean.ckey.ConditionKey.CK_LESS_THAN; + return ConditionKey.CK_LESS_THAN; } if (_toDateLessThan) { - return jp.sf.pal.userinfo.db.allcommon.cbean.ckey.ConditionKey.CK_LESS_THAN;// Default - // ! + return ConditionKey.CK_LESS_THAN;// Default! } else { - return jp.sf.pal.userinfo.db.allcommon.cbean.ckey.ConditionKey.CK_LESS_EQUAL;// Default - // ! + return ConditionKey.CK_LESS_EQUAL;// Default! } } @@ -146,15 +175,15 @@ // ========= // Calendar Helper // =============== - protected void addCalendarNextDay(java.util.Calendar cal) { - cal.add(java.util.Calendar.DAY_OF_MONTH, 1); + protected void addCalendarNextDay(Calendar cal) { + cal.add(Calendar.DAY_OF_MONTH, 1); } - protected void clearCalendarHourMinuteSecondMilli(java.util.Calendar cal) { - cal.clear(java.util.Calendar.MILLISECOND); - cal.clear(java.util.Calendar.SECOND); - cal.clear(java.util.Calendar.MINUTE); - cal.set(java.util.Calendar.HOUR_OF_DAY, cal - .getActualMinimum(java.util.Calendar.HOUR_OF_DAY)); + protected void clearCalendarHourMinuteSecondMilli(Calendar cal) { + cal.clear(Calendar.MILLISECOND); + cal.clear(Calendar.SECOND); + cal.clear(Calendar.MINUTE); + cal.set(Calendar.HOUR_OF_DAY, cal + .getActualMinimum(Calendar.HOUR_OF_DAY)); } } Modified: userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/cbean/coption/LikeSearchOption.java =================================================================== --- userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/cbean/coption/LikeSearchOption.java 2008-12-26 22:11:31 UTC (rev 1622) +++ userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/cbean/coption/LikeSearchOption.java 2008-12-27 22:02:56 UTC (rev 1623) @@ -4,6 +4,7 @@ import java.util.Iterator; import java.util.List; +import jp.sf.pal.userinfo.db.allcommon.DBDef; import jp.sf.pal.userinfo.db.allcommon.cbean.coption.parts.local.JapaneseOptionPartsAgent; /** @@ -230,6 +231,10 @@ String tmp = replace(value, _escape, _escape + _escape); tmp = replace(tmp, "%", _escape + "%"); tmp = replace(tmp, "_", _escape + "_"); + if (DBDef.isCurrentDef(DBDef.Oracle)) { + tmp = replace(tmp, "\uff05", _escape + "\uff05"); + tmp = replace(tmp, "\uff3f", _escape + "\uff3f"); + } value = tmp; } final String wildCard = "%"; Modified: userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/cbean/cvalue/ConditionValue.java =================================================================== --- userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/cbean/cvalue/ConditionValue.java 2008-12-26 22:11:31 UTC (rev 1622) +++ userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/cbean/cvalue/ConditionValue.java 2008-12-27 22:02:56 UTC (rev 1623) @@ -6,9 +6,10 @@ import jp.sf.pal.userinfo.db.allcommon.cbean.coption.InScopeOption; import jp.sf.pal.userinfo.db.allcommon.cbean.coption.LikeSearchOption; +import jp.sf.pal.userinfo.db.allcommon.util.SimpleTypeUtil; /** - * Condition value. + * Condition-value. * * @author DBFlute(AutoGenerator) */ @@ -578,110 +579,9 @@ //========================================================================== // ========= - // Like Search - // =========== - /** Value of likeSearch. */ - protected List _likeSearch; - - /** Value of likeSearch for spare. */ - protected List _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(); - _likeSearch4Spare = new ArrayList(); - } - if (_likeSearch.isEmpty() && !_likeSearch4Spare.isEmpty()) { - for (int index = 0; index < _likeSearch4Spare.size(); index++) { - _likeSearch.add(_likeSearch4Spare.get(index)); - } - } - LikeSearchValue likeSearchValue = new LikeSearchValue(value, option); - _likeSearch.add(likeSearchValue); - _likeSearch4Spare.add(likeSearchValue); - return this; - } - - /** Location of likeSearch. */ - protected String _likeSearchLocation; - - /** - * Get the location of likeSearch. - * - * @return The location of likeSearch. (Nullable) - */ - public String getLikeSearchLocation() { - return _likeSearchLocation; - } - - /** - * Set the location of likeSearch. - * - * @param location The location of likeSearch. (Nullable) - * @return this. (NotNull) - */ - public ConditionValue setLikeSearchLocation(String location) { - _likeSearchLocation = location; - return this; - } - - protected static class LikeSearchValue { - protected String _value; - - protected LikeSearchOption _option; - - public LikeSearchValue(String value, LikeSearchOption option) { - _value = value; - _option = option; - } - - public String getValue() { - return _value; - } - - public LikeSearchOption getOption() { - return _option; - } - - public String generateRealValue() { - if (_option == null) { - return _value; - } - return _option.generateRealValue(_value); - } - } - - //========================================================================== - // ========= // In Scope // ======== - /** Value of inScope. */ + /** The value of inScope. */ protected List _inScope; protected InScopeOption _inScopeOption; @@ -774,7 +674,7 @@ // ========= // Not In Scope // ============ - /** Value of notInScope. */ + /** The value of notInScope. */ protected List _notInScope; /** @@ -852,6 +752,207 @@ //========================================================================== // ========= + // Like Search + // =========== + /** The value of likeSearch. */ + protected List _likeSearch; + + /** The value of likeSearch for spare. */ + protected List _likeSearch4Spare; + + /** + * Get the value of likeSearch. + * + * @return The value of likeSearch. (Nullable) + */ + public String getLikeSearch() { + if (_likeSearch == null) { + return null; + } + if (_likeSearch.isEmpty() && !_likeSearch4Spare.isEmpty()) { + for (int index = 0; index < _likeSearch4Spare.size(); index++) { + _likeSearch.add(_likeSearch4Spare.get(index)); + } + } + final LikeSearchValue likeSearchValue = _likeSearch.remove(0); + return (String) filterValue(likeSearchValue.generateRealValue()); + } + + /** + * Set the value of likeSearch. + * + * @param value The value of likeSearch. (Nullable) + * @param option The option of likeSearch. (Nullable) + * @return this. (NotNull) + */ + public ConditionValue setLikeSearch(String value, LikeSearchOption option) { + if (_likeSearch == null) { + _likeSearch = new ArrayList(); + _likeSearch4Spare = new ArrayList(); + } + if (_likeSearch.isEmpty() && !_likeSearch4Spare.isEmpty()) { + for (int index = 0; index < _likeSearch4Spare.size(); index++) { + _likeSearch.add(_likeSearch4Spare.get(index)); + } + } + LikeSearchValue likeSearchValue = new LikeSearchValue(value, option); + _likeSearch.add(likeSearchValue); + _likeSearch4Spare.add(likeSearchValue); + return this; + } + + /** Location of likeSearch. */ + protected String _likeSearchLocation; + + /** + * Get the location of likeSearch. + * + * @return The location of likeSearch. (Nullable) + */ + public String getLikeSearchLocation() { + return _likeSearchLocation; + } + + /** + * Set the location of likeSearch. + * + * @param location The location of likeSearch. (Nullable) + * @return this. (NotNull) + */ + public ConditionValue setLikeSearchLocation(String location) { + _likeSearchLocation = location; + return this; + } + + protected static class LikeSearchValue { + protected String _value; + + protected LikeSearchOption _option; + + public LikeSearchValue(String value, LikeSearchOption option) { + _value = value; + _option = option; + } + + public String getValue() { + return _value; + } + + public LikeSearchOption getOption() { + return _option; + } + + public String generateRealValue() { + if (_option == null) { + return _value; + } + return _option.generateRealValue(_value); + } + } + + //========================================================================== + // ========= + // Not Like Search + // =============== + /** The value of notLikeSearch. */ + protected List _notLikeSearch; + + /** The value of notLikeSearch for spare. */ + protected List _notLikeSearch4Spare; + + /** + * Get the value of notLikeSearch. + * + * @return The value of notLikeSearch. (Nullable) + */ + public String getNotLikeSearch() { + if (_notLikeSearch == null) { + return null; + } + if (_notLikeSearch.isEmpty() && !_notLikeSearch4Spare.isEmpty()) { + for (int index = 0; index < _notLikeSearch4Spare.size(); index++) { + _notLikeSearch.add(_notLikeSearch4Spare.get(index)); + } + } + final NotLikeSearchValue notLikeSearchValue = _notLikeSearch.remove(0); + return (String) filterValue(notLikeSearchValue.generateRealValue()); + } + + /** + * Set the value of notLikeSearch. + * + * @param value The value of notLikeSearch. (Nullable) + * @param option The option of notLikeSearch. (Nullable) + * @return this. (NotNull) + */ + public ConditionValue setNotLikeSearch(String value, LikeSearchOption option) { + if (_notLikeSearch == null) { + _notLikeSearch = new ArrayList(); + _notLikeSearch4Spare = new ArrayList(); + } + if (_notLikeSearch.isEmpty() && !_notLikeSearch4Spare.isEmpty()) { + for (int index = 0; index < _notLikeSearch4Spare.size(); index++) { + _notLikeSearch.add(_notLikeSearch4Spare.get(index)); + } + } + NotLikeSearchValue notLikeSearchValue = new NotLikeSearchValue(value, + option); + _notLikeSearch.add(notLikeSearchValue); + _notLikeSearch4Spare.add(notLikeSearchValue); + return this; + } + + /** Location of notLikeSearch. */ + protected String _notLikeSearchLocation; + + /** + * Get the location of notLikeSearch. + * + * @return The location of notLikeSearch. (Nullable) + */ + public String getNotLikeSearchLocation() { + return _notLikeSearchLocation; + } + + /** + * Set the location of notLikeSearch. + * + * @param location The location of notLikeSearch. (Nullable) + * @return this. (NotNull) + */ + public ConditionValue setNotLikeSearchLocation(String location) { + _notLikeSearchLocation = location; + return this; + } + + protected static class NotLikeSearchValue { + protected String _value; + + protected LikeSearchOption _option; + + public NotLikeSearchValue(String value, LikeSearchOption option) { + _value = value; + _option = option; + } + + public String getValue() { + return _value; + } + + public LikeSearchOption getOption() { + return _option; + } + + public String generateRealValue() { + if (_option == null) { + return _value; + } + return _option.generateRealValue(_value); + } + } + + //========================================================================== + // ========= // Is Null // ======= /** Value of isNull. */ @@ -976,8 +1077,8 @@ * Filter value. If the value is instance of java.util.Date or * java.util.Calendar, returns value as java.sql.Date. * - * @param value Value. (Nullable) - * @return Filtered value. (Nullable) + * @param value The value. (Nullable) + * @return The filtered value. (Nullable) */ protected Object filterValue(Object value) { if (value == null) { @@ -991,18 +1092,18 @@ } if (value instanceof java.util.Date || value instanceof java.util.Calendar) { - return SqlDateConversionUtil.toDate(value); + return SimpleTypeUtil.toSqlDate(value); } else { return value; } } /** - * Filter value. If the value is instance of java.util.Date or + * Filter the list of value. If the value is instance of java.util.Date or * java.util.Calendar, returns value as java.sql.Date. * - * @param valueList Value-list. (Nullable) - * @return Filtered value-list. (Nullable) + * @param valueList The list of value. (Nullable) + * @return The filtered list of value. (Nullable) */ protected List filterValue(List valueList) { if (valueList == null || valueList.isEmpty()) { @@ -1015,204 +1116,4 @@ } return resultList; } - - protected static class SqlDateConversionUtil { - - private SqlDateConversionUtil() { - } - - public static java.sql.Date toDate(Object o) { - return toDate(o, null); - } - - public static java.sql.Date toDate(Object o, String pattern) { - if (o instanceof java.sql.Date) { - return (java.sql.Date) o; - } - java.util.Date date = DateConversionUtil.toDate(o, pattern); - if (date != null) { - return new java.sql.Date(date.getTime()); - } - return null; - } - } - - protected static class DateConversionUtil { - - private DateConversionUtil() { - } - - public static java.util.Date toDate(Object o) { - return toDate(o, null); - } - - public static java.util.Date toDate(Object o, String pattern) { - if (o == null) { - return null; - } else if (o instanceof String) { - return toDate((String) o, pattern); - } else if (o instanceof java.util.Date) { - return (java.util.Date) o; - } else if (o instanceof java.util.Calendar) { - return ((java.util.Calendar) o).getTime(); - } else { - return toDate(o.toString(), pattern); - } - } - - public static java.util.Date toDate(String s, String pattern) { - return toDate(s, pattern, java.util.Locale.getDefault()); - } - - public static java.util.Date toDate(String s, String pattern, - java.util.Locale locale) { - java.text.SimpleDateFormat sdf = getDateFormat(s, pattern, locale); - try { - return sdf.parse(s); - } catch (java.text.ParseException ex) { - throw new RuntimeException(ex); - } - } - - public static java.text.SimpleDateFormat getDateFormat(String s, - String pattern, java.util.Locale locale) { - if (pattern != null) { - return new java.text.SimpleDateFormat(pattern); - } - return getDateFormat(s, locale); - } - - public static java.text.SimpleDateFormat getDateFormat(String s, - java.util.Locale locale) { - String pattern = getPattern(locale); - String shortPattern = removeDelimiter(pattern); - String delimitor = findDelimiter(s); - if (delimitor == null) { - if (s.length() == shortPattern.length()) { - return new java.text.SimpleDateFormat(shortPattern); - } - if (s.length() == shortPattern.length() + 2) { - return new java.text.SimpleDateFormat(InternalStringUtil - .replace(shortPattern, "yy", "yyyy")); - } - } else { - String[] array = InternalStringUtil.split(s, delimitor); - for (int i = 0; i < array.length; ++i) { - if (array[i].length() == 4) { - pattern = InternalStringUtil.replace(pattern, "yy", - "yyyy"); - break; - } - } - return new java.text.SimpleDateFormat(pattern); - } - return new java.text.SimpleDateFormat(); - } - - public static java.text.SimpleDateFormat getDateFormat( - java.util.Locale locale) { - return new java.text.SimpleDateFormat(getPattern(locale)); - } - - public static java.text.SimpleDateFormat getY4DateFormat( - java.util.Locale locale) { - return new java.text.SimpleDateFormat(getY4Pattern(locale)); - } - - public static String getY4Pattern(java.util.Locale locale) { - String pattern = getPattern(locale); - if (pattern.indexOf("yyyy") < 0) { - pattern = InternalStringUtil.replace(pattern, "yy", "yyyy"); - } - return pattern; - } - - public static String getPattern(java.util.Locale locale) { - java.text.SimpleDateFormat df = (java.text.SimpleDateFormat) java.text.DateFormat - .getDateInstance(java.text.DateFormat.SHORT, locale); - String pattern = df.toPattern(); - int index = pattern.indexOf(' '); - if (index > 0) { - pattern = pattern.substring(0, index); - } - if (pattern.indexOf("MM") < 0) { - pattern = InternalStringUtil.replace(pattern, "M", "MM"); - } - if (pattern.indexOf("dd") < 0) { - pattern = InternalStringUtil.replace(pattern, "d", "dd"); - } - return pattern; - } - - public static String findDelimiter(String value) { - for (int i = 0; i < value.length(); ++i) { - char c = value.charAt(i); - if (Character.isDigit(c)) { - continue; - } - return Character.toString(c); - } - return null; - } - - public static String removeDelimiter(String pattern) { - StringBuffer buf = new StringBuffer(); - for (int i = 0; i < pattern.length(); ++i) { - char c = pattern.charAt(i); - if (c == 'y' || c == 'M' || c == 'd') { - buf.append(c); - } - } - return buf.toString(); - } - } - - protected static class InternalStringUtil { - public static final String[] EMPTY_STRINGS = new String[0]; - - private InternalStringUtil() { - } - - public static final boolean isEmpty(String text) { - return text == null || text.length() == 0; - } - - public static final String replace(String text, String fromText, - String toText) { - if (text == null || fromText == null || toText == null) { - return null; - } - StringBuffer buf = new StringBuffer(100); - int pos = 0; - int pos2 = 0; - while (true) { - pos = text.indexOf(fromText, pos2); - if (pos == 0) { - buf.append(toText); - pos2 = fromText.length(); - } else if (pos > 0) { - buf.append(text.substring(pos2, pos)); - buf.append(toText); - pos2 = pos + fromText.length(); - } else { - buf.append(text.substring(pos2)); - break; - } - } - return buf.toString(); - } - - public static String[] split(String str, String delim) { - if (str == null) { - return EMPTY_STRINGS; - } - List list = new java.util.ArrayList(); - java.util.StringTokenizer st = new java.util.StringTokenizer(str, - delim); - while (st.hasMoreElements()) { - list.add(st.nextToken()); - } - return (String[]) list.toArray(new String[list.size()]); - } - } } Modified: userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/cbean/outsidesql/OutsideSqlContext.java =================================================================== --- userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/cbean/outsidesql/OutsideSqlContext.java 2008-12-26 22:11:31 UTC (rev 1622) +++ userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/cbean/outsidesql/OutsideSqlContext.java 2008-12-27 22:02:56 UTC (rev 1623) @@ -1,17 +1,21 @@ package jp.sf.pal.userinfo.db.allcommon.cbean.outsidesql; +import java.io.BufferedReader; +import java.io.IOException; +import java.io.InputStream; +import java.io.InputStreamReader; +import java.io.Reader; + import jp.sf.pal.userinfo.db.allcommon.DBFluteConfig; import jp.sf.pal.userinfo.db.allcommon.dbmeta.DBMeta; import jp.sf.pal.userinfo.db.allcommon.dbmeta.DBMetaInstanceHandler; import jp.sf.pal.userinfo.db.allcommon.jdbc.StatementConfig; +import jp.sf.pal.userinfo.db.allcommon.util.SimpleResourceUtil; import jp.sf.pal.userinfo.db.allcommon.util.SimpleStringUtil; import jp.sf.pal.userinfo.db.allcommon.util.SimpleSystemUtil; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; -import org.seasar.framework.util.InputStreamReaderUtil; -import org.seasar.framework.util.ReaderUtil; -import org.seasar.framework.util.ResourceUtil; /** * The context of outside-SQL. @@ -33,7 +37,7 @@ /** * Get outside-SQL context on thread. * - * @return Outside-SQL context. (Nullable) + * @return The context of outside-SQL. (Nullable) */ public static OutsideSqlContext getOutsideSqlContextOnThread() { return (OutsideSqlContext) _threadLocal.get(); @@ -42,7 +46,7 @@ /** * Set outside-SQL context on thread. * - * @param outsideSqlContext Outside-SQL context. (NotNull) + * @param outsideSqlContext The context of outside-SQL. (NotNull) */ public static void setOutsideSqlContextOnThread( OutsideSqlContext outsideSqlContext) { @@ -54,7 +58,7 @@ } /** - * Is existing outside-SQL context on thread? + * Is existing the context of outside-SQL on thread? * * @return Determination. */ @@ -63,7 +67,7 @@ } /** - * Clear outside-SQL context on thread. + * Clear the context of outside-SQL on thread. */ public static void clearOutsideSqlContextOnThread() { _threadLocal.set(null); @@ -77,12 +81,20 @@ String methodName, String path, Object pmb, OutsideSqlOption option, Object resultTypeSpecification) { final String pmbKey = (pmb != null ? pmb.getClass().getName() : "null"); - final String resultKey = (resultTypeSpecification != null ? ":" - + resultTypeSpecification : "null"); + final String resultKey; + if (resultTypeSpecification != null) { + if (resultTypeSpecification instanceof Class) { + resultKey = ((Class) resultTypeSpecification).getName(); + } else { + resultKey = resultTypeSpecification.toString(); + } + } else { + resultKey = "null"; + } final String tableDbName = option.getTableDbName(); final String generatedUniqueKey = option.generateUniqueKey(); - return methodName + "():" + tableDbName + ":" + path + ":" + pmbKey - + ":" + generatedUniqueKey + resultKey; + return tableDbName + ":" + methodName + "():" + path + ":" + pmbKey + + ":" + generatedUniqueKey + ":" + resultKey; } //========================================================================== @@ -116,18 +128,9 @@ // Attribute // ========= // ----------------------------------------------------- - // Common of OutsideSql - // -------------------- - protected boolean _dynamicBinding; - - protected boolean _offsetByCursorForcedly; - - protected boolean _limitByCursorForcedly; - - // ----------------------------------------------------- - // Specified OutsideSql - // -------------------- - /** The path of outside-sql. (The mark of Specified-OutsideSql) */ + // Basic + // ----- + /** The path of outside-SQL. (The mark of specified outside-SQL) */ protected String _outsideSqlPath; protected Object _parameterBean; @@ -136,12 +139,23 @@ protected String _methodName; - /** The config of statement. (Nullable) */ + /** The configuration of statement. (Nullable) */ protected StatementConfig _statementConfig; /** The DB name of table for using behavior-SQL-path. (Nullable) */ protected String _tableDbName; + // ----------------------------------------------------- + // Option + // ------ + protected boolean _dynamicBinding; + + protected boolean _offsetByCursorForcedly; + + protected boolean _limitByCursorForcedly; + + protected boolean _autoPagingLogging; // for logging + //========================================================================== // ========= // Read SQL @@ -200,7 +214,7 @@ } /** - * Read outside-sql path. Required attribute is 'outsideSqlPath'. + * Read outside-SQL path. Required attribute is 'outsideSqlPath'. * * @param sqlFileEncoding The encoding of SQL file. (NotNull) * @param dbmsSuffix The suffix of DBMS. (NotNull) @@ -214,6 +228,13 @@ String sql; if (isExistResource(dbmsPath)) { sql = readText(dbmsPath, sqlFileEncoding); + } else if ("_postgresql".equals(dbmsSuffix) + && isExistResource("_postgre")) { + sql = readText("_postgre", sqlFileEncoding); // Patch for name + // difference + } else if ("_sqlserver".equals(dbmsSuffix) && isExistResource("_mssql")) { + sql = readText("_mssql", sqlFileEncoding); // Patch for name + // difference } else if (isExistResource(standardPath)) { sql = readText(standardPath, sqlFileEncoding); } else { @@ -324,16 +345,46 @@ // General Helper // ============== protected boolean isExistResource(String path) { - return ResourceUtil.isExist(path); + return SimpleResourceUtil.isExist(path); } protected String readText(final String path, String sqlFileEncoding) { - final java.io.InputStream is = ResourceUtil.getResourceAsStream(path); - final java.io.Reader reader = InputStreamReaderUtil.create(is, - sqlFileEncoding); - return ReaderUtil.readText(reader); + final InputStream ins = SimpleResourceUtil.getResourceStream(path); + final Reader reader = createInputStreamReader(ins, sqlFileEncoding); + return readText(reader); } + protected Reader createInputStreamReader(InputStream ins, String encoding) { + try { + return new InputStreamReader(ins, encoding); + } catch (IOException e) { + String msg = "Failed to create the reader of the input stream:"; + msg = msg + " ins=" + ins + " encoding=" + encoding; + throw new IllegalStateException(msg, e); + } + } + + public String readText(Reader reader) { + final BufferedReader bfreader = new BufferedReader(reader); + final StringBuilder out = new StringBuilder(100); + try { + try { + final char[] buf = new char[8192]; + int n; + while ((n = bfreader.read(buf)) >= 0) { + out.append(buf, 0, n); + } + } finally { + bfreader.close(); + } + } catch (IOException e) { + String msg = "Failed to read the input stream:"; + msg = msg + " bfreader=" + bfreader + " reader=" + reader; + throw new IllegalStateException(msg, e); + } + return out.toString(); + } + protected static String replaceString(String text, String fromText, String toText) { return SimpleStringUtil.replace(text, fromText, toText); @@ -348,35 +399,8 @@ // Accessor // ======== // ----------------------------------------------------- - // Common of OutsideSql - // -------------------- - public boolean isDynamicBinding() { - return _dynamicBinding; - } - - public void setDynamicBinding(boolean dynamicBinding) { - this._dynamicBinding = dynamicBinding; - } - - public boolean isOffsetByCursorForcedly() { - return _offsetByCursorForcedly; - } - - public void setOffsetByCursorForcedly(boolean offsetByCursorForcedly) { - this._offsetByCursorForcedly = offsetByCursorForcedly; - } - - public boolean isLimitByCursorForcedly() { - return _limitByCursorForcedly; - } - - public void setLimitByCursorForcedly(boolean limitByCursorForcedly) { - this._limitByCursorForcedly = limitByCursorForcedly; - } - - // ----------------------------------------------------- - // Specified OutsideSql - // -------------------- + // Basic + // ----- public String getOutsideSqlPath() { return _outsideSqlPath; } @@ -424,4 +448,39 @@ public void setTableDbName(String tableDbName) { this._tableDbName = tableDbName; } + + // ----------------------------------------------------- + // Option + // ------ + public boolean isDynamicBinding() { + return _dynamicBinding; + } + + public void setDynamicBinding(boolean dynamicBinding) { + this._dynamicBinding = dynamicBinding; + } + + public boolean isOffsetByCursorForcedly() { + return _offsetByCursorForcedly; + } + + public void setOffsetByCursorForcedly(boolean offsetByCursorForcedly) { + this._offsetByCursorForcedly = offsetByCursorForcedly; + } + + public boolean isLimitByCursorForcedly() { + return _limitByCursorForcedly; + } + + public void setLimitByCursorForcedly(boolean limitByCursorForcedly) { + this._limitByCursorForcedly = limitByCursorForcedly; + } + + public boolean isAutoPagingLogging() { // for logging + return _autoPagingLogging; + } + + public void setAutoPagingLogging(boolean autoPagingLogging) { // for logging + this._autoPagingLogging = autoPagingLogging; + } } Deleted: userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/cbean/outsidesql/OutsideSqlDao.java =================================================================== --- userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/cbean/outsidesql/OutsideSqlDao.java 2008-12-26 22:11:31 UTC (rev 1622) +++ userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/cbean/outsidesql/OutsideSqlDao.java 2008-12-27 22:02:56 UTC (rev 1623) @@ -1,37 +0,0 @@ -package jp.sf.pal.userinfo.db.allcommon.cbean.outsidesql; - -import java.util.List; - -import jp.sf.pal.userinfo.db.allcommon.DaoReadable; -import jp.sf.pal.userinfo.db.allcommon.jdbc.CursorHandler; - -/** - * The dao of outside-sql. - * - * @author DBFlute(AutoGenerator) - */ -public interface OutsideSqlDao extends DaoReadable { - - //========================================================================== - // ========= - // Select - // ====== - List selectList(String path, Object pmb, - OutsideSqlOption option, Class entityType); - - Object selectCursor(String path, Object pmb, - OutsideSqlOption option, CursorHandler handler); - - //========================================================================== - // ========= - // Execute - // ======= - int execute(String path, Object pmb, OutsideSqlOption option); - - // [DBFlute-0.7.5] - //========================================================================== - // ========= - // Call - // ==== - void call(String path, Object pmb, OutsideSqlOption option); -} Modified: userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/cbean/outsidesql/OutsideSqlOption.java =================================================================== --- userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/cbean/outsidesql/OutsideSqlOption.java 2008-12-26 22:11:31 UTC (rev 1622) +++ userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/cbean/outsidesql/OutsideSqlOption.java 2008-12-27 22:02:56 UTC (rev 1623) @@ -16,6 +16,7 @@ // ----------------------------------------------------- // Option // ------ + /** The request type of paging. */ protected String _pagingRequestType = "non"; protected boolean _dynamicBinding; @@ -23,6 +24,8 @@ /** The configuration of statement. (Nullable) */ protected StatementConfig _statementConfig; + protected String _sourcePagingRequestType = "non"; + // ----------------------------------------------------- // Information // ----------- @@ -59,6 +62,7 @@ // ==== public OutsideSqlOption copyOptionWithoutPaging() { final OutsideSqlOption copyOption = new OutsideSqlOption(); + copyOption.setPagingSourceRequestType(_pagingRequestType); if (isDynamicBinding()) { copyOption.dynamicBinding(); } @@ -103,6 +107,15 @@ _statementConfig = statementConfig; } + protected void setPagingSourceRequestType(String sourcePagingRequestType) { // Very + // Internal + _sourcePagingRequestType = sourcePagingRequestType; + } + + public boolean isSourcePagingRequestTypeAuto() { // Very Internal + return "auto".equals(_sourcePagingRequestType); + } + // ----------------------------------------------------- // Information // ----------- Modified: userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/cbean/outsidesql/executor/OutsideSqlBasicExecutor.java =================================================================== --- userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/cbean/outsidesql/executor/OutsideSqlBasicExecutor.java 2008-12-26 22:11:31 UTC (rev 1622) +++ userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/cbean/outsidesql/executor/OutsideSqlBasicExecutor.java 2008-12-27 22:02:56 UTC (rev 1623) @@ -2,15 +2,20 @@ import java.util.List; +import jp.sf.pal.userinfo.db.allcommon.bhv.core.BehaviorCommand; +import jp.sf.pal.userinfo.db.allcommon.bhv.core.BehaviorCommandInvoker; +import jp.sf.pal.userinfo.db.allcommon.bhv.core.command.AbstractOutsideSqlCommand; +import jp.sf.pal.userinfo.db.allcommon.bhv.core.command.OutsideSqlCallCommand; +import jp.sf.pal.userinfo.db.allcommon.bhv.core.command.OutsideSqlExecuteCommand; +import jp.sf.pal.userinfo.db.allcommon.bhv.core.command.OutsideSqlSelectListCommand; import jp.sf.pal.userinfo.db.allcommon.cbean.ListResultBean; import jp.sf.pal.userinfo.db.allcommon.cbean.ResultBeanBuilder; -import jp.sf.pal.userinfo.db.allcommon.cbean.outsidesql.OutsideSqlDao; import jp.sf.pal.userinfo.db.allcommon.cbean.outsidesql.OutsideSqlOption; import jp.sf.pal.userinfo.db.allcommon.cbean.outsidesql.ProcedurePmb; import jp.sf.pal.userinfo.db.allcommon.jdbc.StatementConfig; /** - * The executor of outside-sql.
+ * The executor of outside-SQL.
* *
  * {Basic}
@@ -33,7 +38,6 @@
  * 
  * {Option -- Dynamic}
  *   o dynamicBinding().selectList()
- * 
  * 
* * @author DBFlute(AutoGenerator) @@ -44,8 +48,8 @@ // ========= // Attribute // ========= - /** The DAO of outside-sql. (NotNull) */ - protected final OutsideSqlDao _outsideSqlDao; + /** The invoker of behavior command. (NotNull) */ + protected final BehaviorCommandInvoker _behaviorCommandInvoker; /** Table DB name. (NotNull) */ protected final String _tableDbName; @@ -60,9 +64,9 @@ // ========= // Constructor // =========== - public OutsideSqlBasicExecutor(OutsideSqlDao outsideSqlDao, - String tableDbName) { - this._outsideSqlDao = outsideSqlDao; + public OutsideSqlBasicExecutor( + BehaviorCommandInvoker behaviorCommandInvoker, String tableDbName) { + this._behaviorCommandInvoker = behaviorCommandInvoker; this._tableDbName = tableDbName; } @@ -80,12 +84,12 @@ * @param entityType The element type of entity. (NotNull) * @return The result bean of selected list. (NotNull) * @exception jp.sf.pal.userinfo.db.allcommon.exception.OutsideSqlNotFoundException - * When the outside-sql is not found. + * When the outside-SQL is not found. */ public ListResultBean selectList(String path, Object pmb, Class entityType) { - List resultList = _outsideSqlDao.selectList(path, pmb, - createOutsideSqlOption(), entityType); + List resultList = invoke(createSelectListCommand(path, pmb, + entityType)); return new ResultBeanBuilder(_tableDbName) .buildListResultBean(resultList); } @@ -102,10 +106,10 @@ * object. (Nullable) * @return The count of execution. * @exception jp.sf.pal.userinfo.db.allcommon.exception.OutsideSqlNotFoundException - * When the outside-sql is not found. + * When the outside-SQL is not found. */ public int execute(String path, Object pmb) { - return _outsideSqlDao.execute(path, pmb, createOutsideSqlOption()); + return invoke(createExecuteCommand(path, pmb)); } // [DBFlute-0.7.5] @@ -123,12 +127,53 @@ throw new IllegalArgumentException( "The argument of call() 'pmb' should not be null!"); } - _outsideSqlDao.call(pmb.getProcedureName(), pmb, - createOutsideSqlOption()); + invoke(createCallCommand(pmb.getProcedureName(), pmb)); } //========================================================================== // ========= + // Behavior Command + // ================ + protected BehaviorCommand> createSelectListCommand( + String path, Object pmb, Class entityType) { + final OutsideSqlSelectListCommand cmd = xsetupCommand( + new OutsideSqlSelectListCommand(), path, pmb); + cmd.setEntityType(entityType); + return cmd; + } + + protected BehaviorCommand createExecuteCommand(String path, + Object pmb) { + return xsetupCommand(new OutsideSqlExecuteCommand(), path, pmb); + } + + protected BehaviorCommand createCallCommand(String path, Object pmb) { + return xsetupCommand(new OutsideSqlCallCommand(), path, pmb); + } + + private > COMMAND xsetupCommand( + COMMAND command, String path, Object pmb) { + command.setTableDbName(_tableDbName); + _behaviorCommandInvoker.injectComponentProperty(command); + command.setOutsideSqlPath(path); + command.setParameterBean(pmb); + command.setOutsideSqlOption(createOutsideSqlOption()); + return command; + } + + /** + * Invoke the command of behavior. + * + * @param The type of result. + * @param behaviorCommand The command of behavior. (NotNull) + * @return The instance of result. (Nullable) + */ + protected RESULT invoke(BehaviorCommand behaviorCommand) { + return _behaviorCommandInvoker.invoke(behaviorCommand); + } + + //========================================================================== + // ========= // Option // ====== // ----------------------------------------------------- @@ -144,11 +189,11 @@ * # * * - * @return The cursor executor of outside-sql. (NotNull) + * @return The cursor executor of outside-SQL. (NotNull) */ public OutsideSqlCursorExecutor cursorHandling() { - return new OutsideSqlCursorExecutor(_outsideSqlDao, - createOutsideSqlOption()); + return new OutsideSqlCursorExecutor(_behaviorCommandInvoker, + createOutsideSqlOption(), _tableDbName); } /** @@ -161,11 +206,11 @@ * # * * - * @return The cursor executor of outside-sql. (NotNull) + * @return The cursor executor of outside-SQL. (NotNull) */ public OutsideSqlEntityExecutor entityHandling() { - return new OutsideSqlEntityExecutor(_outsideSqlDao, - createOutsideSqlOption()); + return new OutsideSqlEntityExecutor(_behaviorCommandInvoker, + createOutsideSqlOption(), _tableDbName); } // ----------------------------------------------------- @@ -191,7 +236,7 @@ public OutsideSqlPagingExecutor autoPaging() { final OutsideSqlOption option = createOutsideSqlOption(); option.autoPaging(); - return new OutsideSqlPagingExecutor(_outsideSqlDao, option, + return new OutsideSqlPagingExecutor(_behaviorCommandInvoker, option, _tableDbName); } @@ -215,7 +260,7 @@ public OutsideSqlPagingExecutor manualPaging() { final OutsideSqlOption option = createOutsideSqlOption(); option.manualPaging(); - return new OutsideSqlPagingExecutor(_outsideSqlDao, option, + return new OutsideSqlPagingExecutor(_behaviorCommandInvoker, option, _tableDbName); } Modified: userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/cbean/outsidesql/executor/OutsideSqlCursorExecutor.java =================================================================== --- userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/cbean/outsidesql/executor/OutsideSqlCursorExecutor.java 2008-12-26 22:11:31 UTC (rev 1622) +++ userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/cbean/outsidesql/executor/OutsideSqlCursorExecutor.java 2008-12-27 22:02:56 UTC (rev 1623) @@ -1,12 +1,14 @@ package jp.sf.pal.userinfo.db.allcommon.cbean.outsidesql.executor; -import jp.sf.pal.userinfo.db.allcommon.cbean.outsidesql.OutsideSqlDao; +import jp.sf.pal.userinfo.db.allcommon.bhv.core.BehaviorCommand; +import jp.sf.pal.userinfo.db.allcommon.bhv.core.BehaviorCommandInvoker; +import jp.sf.pal.userinfo.db.allcommon.bhv.core.command.OutsideSqlSelectCursorCommand; import jp.sf.pal.userinfo.db.allcommon.cbean.outsidesql.OutsideSqlOption; import jp.sf.pal.userinfo.db.allcommon.jdbc.CursorHandler; import jp.sf.pal.userinfo.db.allcommon.jdbc.StatementConfig; /** - * The cursor executor of outside-sql. + * The cursor executor of outside-SQL. * * @param The type of parameter-bean. * @author DBFlute(AutoGenerator) @@ -17,18 +19,25 @@ // ========= // Attribute // ========= - protected final OutsideSqlDao _outsideSqlDao; + /** The invoker of behavior command. (NotNull) */ + protected final BehaviorCommandInvoker _behaviorCommandInvoker; + /** The option of outside-SQL. (NotNull) */ protected final OutsideSqlOption _outsideSqlOption; + /** The DB name of table. (NotNull) */ + protected final String _tableDbName; + //========================================================================== // ========= // Constructor // =========== - public OutsideSqlCursorExecutor(OutsideSqlDao outsideSqlDao, - OutsideSqlOption outsideSqlOption) { - this._outsideSqlDao = outsideSqlDao; + public OutsideSqlCursorExecutor( + BehaviorCommandInvoker behaviorCommandInvoker, + OutsideSqlOption outsideSqlOption, String tableDbName) { + this._behaviorCommandInvoker = behaviorCommandInvoker; this._outsideSqlOption = outsideSqlOption; + this._tableDbName = tableDbName; } //========================================================================== @@ -44,14 +53,46 @@ * @param handler The handler of cursor. (NotNull) * @return The result object that the cursor handler returns. (Nullable) * @exception jp.sf.pal.userinfo.db.allcommon.exception.OutsideSqlNotFoundException - * When the outside-sql is not found. + * When the outside-SQL is not found. */ public Object selectCursor(String path, PARAMETER_BEAN pmb, CursorHandler handler) { - return _outsideSqlDao.selectCursor(path, pmb, _outsideSqlOption, + return invoke(createSelectCursorCommand(path, pmb, handler)); + } + + //========================================================================== + // ========= + // Behavior Command + // ================ + protected BehaviorCommand createSelectCursorCommand(String path, + PARAMETER_BEAN pmb, CursorHandler handler) { + return xsetupCommand(new OutsideSqlSelectCursorCommand(), path, pmb, handler); } + private OutsideSqlSelectCursorCommand xsetupCommand( + OutsideSqlSelectCursorCommand command, String path, + PARAMETER_BEAN pmb, CursorHandler handler) { + command.setTableDbName(_tableDbName); + _behaviorCommandInvoker.injectComponentProperty(command); + command.setOutsideSqlPath(path); + command.setParameterBean(pmb); + command.setOutsideSqlOption(_outsideSqlOption); + command.setCursorHandler(handler); + return command; + } + + /** + * Invoke the command of behavior. + * + * @param The type of result. + * @param behaviorCommand The command of behavior. (NotNull) + * @return The instance of result. (Nullable) + */ + protected RESULT invoke(BehaviorCommand behaviorCommand) { + return _behaviorCommandInvoker.invoke(behaviorCommand); + } + //========================================================================== // ========= // Option Modified: userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/cbean/outsidesql/executor/OutsideSqlEntityExecutor.java =================================================================== --- userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/cbean/outsidesql/executor/OutsideSqlEntityExecutor.java 2008-12-26 22:11:31 UTC (rev 1622) +++ userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/cbean/outsidesql/executor/OutsideSqlEntityExecutor.java 2008-12-27 22:02:56 UTC (rev 1623) @@ -2,14 +2,16 @@ import java.util.List; +import jp.sf.pal.userinfo.db.allcommon.bhv.core.BehaviorCommand; +import jp.sf.pal.userinfo.db.allcommon.bhv.core.BehaviorCommandInvoker; +import jp.sf.pal.userinfo.db.allcommon.bhv.core.command.OutsideSqlSelectListCommand; import jp.sf.pal.userinfo.db.allcommon.cbean.ConditionBeanContext; -import jp.sf.pal.userinfo.db.allcommon.cbean.outsidesql.OutsideSqlDao; import jp.sf.pal.userinfo.db.allcommon.cbean.outsidesql.OutsideSqlOption; import jp.sf.pal.userinfo.db.allcommon.jdbc.StatementConfig; import jp.sf.pal.userinfo.db.allcommon.util.SimpleSystemUtil; /** - * The cursor executor of outside-sql. + * The cursor executor of outside-SQL. * * @param The type of parameter-bean. * @author DBFlute(AutoGenerator) @@ -20,18 +22,25 @@ // ========= // Attribute // ========= - protected final OutsideSqlDao _outsideSqlDao; + /** The invoker of behavior command. (NotNull) */ + protected final BehaviorCommandInvoker _behaviorCommandInvoker; + /** The option of outside-SQL. (NotNull) */ protected final OutsideSqlOption _outsideSqlOption; + /** The DB name of table. (NotNull) */ + protected final String _tableDbName; + //========================================================================== // ========= // Constructor // =========== - public OutsideSqlEntityExecutor(OutsideSqlDao outsideSqlDao, - OutsideSqlOption outsideSqlOption) { - this._outsideSqlDao = outsideSqlDao; + public OutsideSqlEntityExecutor( + BehaviorCommandInvoker behaviorCommandInvoker, + OutsideSqlOption outsideSqlOption, String tableDbName) { + this._behaviorCommandInvoker = behaviorCommandInvoker; this._outsideSqlOption = outsideSqlOption; + this._tableDbName = tableDbName; } //========================================================================== @@ -48,14 +57,14 @@ * @param entityType The type of entity. (NotNull) * @return The selected entity. (Nullable) * @exception jp.sf.pal.userinfo.db.allcommon.exception.OutsideSqlNotFoundException - * When the outside-sql is not found. + * When the outside-SQL is not found. * @exception jp.sf.pal.userinfo.db.allcommon.exception.EntityDuplicatedException * When the entity is duplicated. */ public ENTITY selectEntity(String path, PARAMETER_BEAN pmb, Class entityType) { - final List ls = _outsideSqlDao.selectList(path, pmb, - _outsideSqlOption, entityType); + final List ls = invoke(createSelectListCommand(path, pmb, + entityType)); if (ls.isEmpty()) { return null; } @@ -76,7 +85,7 @@ * @param entityType The type of entity. (NotNull) * @return The selected entity. (Nullable) * @exception jp.sf.pal.userinfo.db.allcommon.exception.OutsideSqlNotFoundException - * When the outside-sql is not found. + * When the outside-SQL is not found. * @exception jp.sf.pal.userinfo.db.allcommon.exception.EntityAlreadyDeletedException * When the entity has already been deleted(not found). * @exception jp.sf.pal.userinfo.db.allcommon.exception.EntityDuplicatedException @@ -84,8 +93,8 @@ */ public ENTITY selectEntityWithDeletedCheck(String path, PARAMETER_BEAN pmb, Class entityType) { - final List ls = _outsideSqlDao.selectList(path, pmb, - _outsideSqlOption, entityType); + final List ls = invoke(createSelectListCommand(path, pmb, + entityType)); if (ls == null || ls.isEmpty()) { throwEntityAlreadyDeletedException(buildSearch4LogString(path, pmb, entityType)); @@ -127,6 +136,39 @@ //========================================================================== // ========= + // Behavior Command + // ================ + protected BehaviorCommand> createSelectListCommand( + String path, PARAMETER_BEAN pmb, Class entityType) { + return xsetupCommand(new OutsideSqlSelectListCommand(), path, + pmb, entityType); + } + + private OutsideSqlSelectListCommand xsetupCommand( + OutsideSqlSelectListCommand command, String path, + PARAMETER_BEAN pmb, Class entityType) { + command.setTableDbName(_tableDbName); + _behaviorCommandInvoker.injectComponentProperty(command); + command.setOutsideSqlPath(path); + command.setParameterBean(pmb); + command.setOutsideSqlOption(_outsideSqlOption); + command.setEntityType(entityType); + return command; + } + + /** + * Invoke the command of behavior. + * + * @param The type of result. + * @param behaviorCommand The command of behavior. (NotNull) + * @return The instance of result. (Nullable) + */ + protected RESULT invoke(BehaviorCommand behaviorCommand) { + return _behaviorCommandInvoker.invoke(behaviorCommand); + } + + //========================================================================== + // ========= // Option // ====== public OutsideSqlEntityExecutor configure( Modified: userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/cbean/outsidesql/executor/OutsideSqlPagingExecutor.java =================================================================== --- userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/cbean/outsidesql/executor/OutsideSqlPagingExecutor.java 2008-12-26 22:11:31 UTC (rev 1622) +++ userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/cbean/outsidesql/executor/OutsideSqlPagingExecutor.java 2008-12-27 22:02:56 UTC (rev 1623) @@ -3,18 +3,20 @@ import java.util.List; import jp.sf.pal.userinfo.db.allcommon.DBFluteConfig; +import jp.sf.pal.userinfo.db.allcommon.bhv.core.BehaviorCommand; +import jp.sf.pal.userinfo.db.allcommon.bhv.core.BehaviorCommandInvoker; +import jp.sf.pal.userinfo.db.allcommon.bhv.core.command.OutsideSqlSelectListCommand; import jp.sf.pal.userinfo.db.allcommon.cbean.ListResultBean; import jp.sf.pal.userinfo.db.allcommon.cbean.PagingBean; import jp.sf.pal.userinfo.db.allcommon.cbean.PagingHandler; import jp.sf.pal.userinfo.db.allcommon.cbean.PagingInvoker; import jp.sf.pal.userinfo.db.allcommon.cbean.PagingResultBean; import jp.sf.pal.userinfo.db.allcommon.cbean.ResultBeanBuilder; -import jp.sf.pal.userinfo.db.allcommon.cbean.outsidesql.OutsideSqlDao; import jp.sf.pal.userinfo.db.allcommon.cbean.outsidesql.OutsideSqlOption; import jp.sf.pal.userinfo.db.allcommon.jdbc.StatementConfig; /** - * The paging executor of outsideSql. + * The paging executor of outside-SQL. * * @author DBFlute(AutoGenerator) */ @@ -24,10 +26,10 @@ // ========= // Attribute // ========= - /** The DAO of outsideSql. (NotNull) */ - protected final OutsideSqlDao _outsideSqlDao; + /** The invoker of behavior command. (NotNull) */ + protected final BehaviorCommandInvoker _behaviorCommandInvoker; - /** The option of outsideSql. (NotNull) */ + /** The option of outside-SQL. (NotNull) */ protected final OutsideSqlOption _outsideSqlOption; /** The DB name of table. (NotNull) */ @@ -37,9 +39,10 @@ // ========= // Constructor // =========== - public OutsideSqlPagingExecutor(OutsideSqlDao outsideSqlDao, + public OutsideSqlPagingExecutor( + BehaviorCommandInvoker behaviorCommandInvoker, OutsideSqlOption outsideSqlOption, String tableDbName) { - this._outsideSqlDao = outsideSqlDao; + this._behaviorCommandInvoker = behaviorCommandInvoker; this._outsideSqlOption = outsideSqlOption; this._tableDbName = tableDbName; } @@ -81,13 +84,13 @@ * @param entityType The type of result entity. (NotNull) * @return The result bean of paged list. (NotNull) * @exception com.example.dbflute.basic.dbflute.allcommon.exception.OutsideSqlNotFoundException - * When the outside-sql is not found. + * When the outside-SQL is not found. */ public ListResultBean selectList(String path, PagingBean pmb, Class entityType) { setupScrollableCursorIfNeeds(); - List resultList = _outsideSqlDao.selectList(path, pmb, - _outsideSqlOption, entityType); + List resultList = invoke(createSelectListCommand(path, pmb, + entityType)); return new ResultBeanBuilder(_tableDbName) .buildListResultBean(resultList); } @@ -141,7 +144,7 @@ * # -- ELSE select count(*) * # /[*]END[*]/ * # ... - * o It's S2Dao's restriction...Sorry + * o It's restriction...Sorry * * * @param The type of entity. @@ -150,14 +153,11 @@ * @param entityType The type of result entity. (NotNull) * @return The result bean of paging. (NotNull) * @exception jp.sf.pal.userinfo.db.allcommon.exception.OutsideSqlNotFoundException - * When the outside-sql is not found. + * When the outside-SQL is not found. */ public PagingResultBean selectPage(final String path, final PagingBean pmb, final Class entityType) { - final OutsideSqlOption countOption = _outsideSqlOption - .copyOptionWithoutPaging(); - final OutsideSqlEntityExecutor countExecutor = new OutsideSqlEntityExecutor( - _outsideSqlDao, countOption); + final OutsideSqlEntityExecutor countExecutor = createCountExecutor(); final PagingHandler handler = new PagingHandler() { public PagingBean getPagingBean() { return pmb; @@ -182,6 +182,13 @@ return invoker.invokePaging(handler); } + protected OutsideSqlEntityExecutor createCountExecutor() { + final OutsideSqlOption countOption = _outsideSqlOption + .copyOptionWithoutPaging(); + return new OutsideSqlEntityExecutor( + _behaviorCommandInvoker, countOption, _tableDbName); + } + protected void setupScrollableCursorIfNeeds() { if (!_outsideSqlOption.isAutoPaging()) { return; @@ -207,6 +214,39 @@ //========================================================================== // ========= + // Behavior Command + // ================ + protected BehaviorCommand> createSelectListCommand( + String path, Object pmb, Class entityType) { + return xsetupCommand(new OutsideSqlSelectListCommand(), path, + pmb, entityType); + } + + private OutsideSqlSelectListCommand xsetupCommand( + OutsideSqlSelectListCommand command, String path, + Object pmb, Class entityType) { + command.setTableDbName(_tableDbName); + _behaviorCommandInvoker.injectComponentProperty(command); + command.setOutsideSqlPath(path); + command.setParameterBean(pmb); + command.setOutsideSqlOption(_outsideSqlOption); + command.setEntityType(entityType); + return command; + } + + /** + * Invoke the command of behavior. + * + * @param The type of result. + * @param behaviorCommand The command of behavior. (NotNull) + * @return The instance of result. (Nullable) + */ + protected RESULT invoke(BehaviorCommand behaviorCommand) { + return _behaviorCommandInvoker.invoke(behaviorCommand); + } + + //========================================================================== + // ========= // Option // ====== public OutsideSqlPagingExecutor configure(StatementConfig statementConfig) { Modified: userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/cbean/sqlclause/AbstractSqlClause.java =================================================================== --- userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/cbean/sqlclause/AbstractSqlClause.java 2008-12-26 22:11:31 UTC (rev 1622) +++ userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/cbean/sqlclause/AbstractSqlClause.java 2008-12-27 22:02:56 UTC (rev 1623) @@ -17,23 +17,23 @@ import jp.sf.pal.userinfo.db.allcommon.dbmeta.DBMetaInstanceHandler; import jp.sf.pal.userinfo.db.allcommon.dbmeta.info.ColumnInfo; import jp.sf.pal.userinfo.db.allcommon.dbmeta.info.ForeignInfo; -import jp.sf.pal.userinfo.db.allcommon.dbmeta.info.UniqueInfo; import jp.sf.pal.userinfo.db.allcommon.util.SimpleAssertUtil; import jp.sf.pal.userinfo.db.allcommon.util.SimpleStringUtil; import jp.sf.pal.userinfo.db.allcommon.util.SimpleSystemUtil; /** - * The abstract class of SqlClause. + * The abstract class of SQL clause. * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public abstract class AbstractSqlClause implements SqlClause { //========================================================================== // ========= // Definition // ========== + protected static final SelectClauseType DEFAULT_SELECT_CLAUSE_TYPE = SelectClauseType.COLUMNS; + protected static final String SELECT_HINT = "/*$dto.selectHint*/"; //========================================================================== @@ -43,12 +43,16 @@ // ----------------------------------------------------- // Basic // ----- - /** Target table name. */ + /** The name of table. */ protected final String _tableName; // ----------------------------------------------------- // Clause Resource // --------------- + // /- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + // - + // The resources that are not often used to are lazy-loaded for performance. + // - - - - - - - - - -/ /** * Selected select column map. map:{tableAliasName : map:{columnName : * selectColumnInfo}} @@ -57,48 +61,48 @@ /** * Specified select column map. map:{ tableAliasName = map:{ columnName : - * null } } + * null } } (Nullable: This is lazy-loaded) */ - protected Map> _specifiedSelectColumnMap;// [ + protected Map> _specifiedSelectColumnMap; // [ // DBFlute // - - // 0.7.4 - // ] + // 0.7 + // .4] - /** Specified derive sub-query map. */ - protected Map _specifiedDeriveSubQueryMap;// [DBFlute-0.7.4] + /** Specified derive sub-query map. (Nullable: This is lazy-loaded) */ + protected Map _specifiedDeriveSubQueryMap; //[DBFlute-0.7.4] - /** Included select column map. */ - protected Map _includedSelectColumnMap = new LinkedHashMap(); - /** * The map of real column and alias of select clause. map:{realColumnName : * aliasName} */ - protected Map _selectClauseRealColumnAliasMap = new HashMap();// Without + protected Map _selectClauseRealColumnAliasMap = new HashMap(); // Without // linked // ! + /** The type of select clause. (NotNull) */ + protected SelectClauseType _selectClauseType = DEFAULT_SELECT_CLAUSE_TYPE; + + /** The previous type of select clause. (Nullable: The default is null) */ + protected SelectClauseType _previousSelectClauseType; + /** Outer join map. */ protected Map _outerJoinMap = new LinkedHashMap(); - /** Where list. */ + /** The list of where clause. */ protected List _whereList = new ArrayList(); /** Inline where list for BaseTable. */ protected List _baseTableInlineWhereList = new ArrayList(); - /** Order-by clause. */ + /** The clause of order-by. (NotNull) */ protected final OrderByClause _orderByClause = new OrderByClause(); - /** Union clause list. */ - protected List _unionQueryInfoList = new ArrayList(); + /** The list of union clause. (Nullable: This is lazy-loaded) */ + protected List _unionQueryInfoList; - /** Is included-select-column effective? Default value is false. */ - protected boolean _isIncludedSelectColumnEffective = false; - /** Is order-by effective? Default value is false. */ protected boolean _isOrderByEffective = false; @@ -138,7 +142,7 @@ // ----------------------------------------------------- // Optional Info // ------------- - protected boolean _formatClause; + protected boolean _formatClause = true; //========================================================================== // ========= @@ -163,28 +167,20 @@ StringBuilder sb = new StringBuilder(512); sb.append(getSelectClause()); sb.append(" "); - sb.append(buildClauseWithoutMainSelect(false)); + sb.append(buildClauseWithoutMainSelect()); String sql = sb.toString(); - return filterSubQueryIndent(sql); + sql = filterUnionCountOrScalar(sql); + sql = filterSubQueryIndent(sql); + return sql; } - public String getClausePKOnly() { + protected String buildClauseWithoutMainSelect() { StringBuilder sb = new StringBuilder(512); - sb.append(getSelectClausePKOnly()); - sb.append(" "); - sb.append(buildClauseWithoutMainSelect(true)); - String sql = sb.toString(); - return filterSubQueryIndent(sql); - } - - protected String buildClauseWithoutMainSelect(boolean pkonly) { - StringBuilder sb = new StringBuilder(512); sb.append(getFromClause()); sb.append(getFromHint()); sb.append(" "); sb.append(getWhereClause()); - String unionClause = buildUnionClause(pkonly ? getSelectClausePKOnly() - : getSelectClause()); + String unionClause = buildUnionClause(getSelectClause()); // Delete template mark! (At the future this will be unnecessary.) unionClause = replaceString(unionClause, getUnionWhereClauseMark(), "");// Required @@ -225,29 +221,45 @@ protected String buildUnionClause(String selectClause) { StringBuilder sb = new StringBuilder(); - for (final Iterator ite = _unionQueryInfoList - .iterator(); ite.hasNext();) { - final UnionQueryInfo unionQueryInfo = (UnionQueryInfo) ite.next(); - final String unionQueryClause = unionQueryInfo - .getUnionQueryClause(); - final boolean unionAll = unionQueryInfo.isUnionAll(); - if (isFormatClauseEffective()) { + if (hasUnionQuery()) { + for (Iterator ite = _unionQueryInfoList.iterator(); ite + .hasNext();) { + UnionQueryInfo unionQueryInfo = (UnionQueryInfo) ite.next(); + String unionQueryClause = unionQueryInfo.getUnionQueryClause(); + boolean unionAll = unionQueryInfo.isUnionAll(); sb.append(getLineSeparator()); - } - sb.append(unionAll ? " union all " : " union "); - if (isFormatClauseEffective()) { + sb.append(unionAll ? " union all " : " union "); sb.append(getLineSeparator()); + sb.append(selectClause).append(" ").append(unionQueryClause); } - sb.append(selectClause).append(" ").append(unionQueryClause); } return sb.toString(); } + protected String filterUnionCountOrScalar(String sql) { + if (!isSelectClauseTypeCountOrScalar() || !hasUnionQuery()) { + return sql; + } + String selectClause = buildSelectClauseCountOrScalar("dfmain"); + String ln = getLineSeparator(); + String beginMark = resolveSubQueryBeginMark("dfmain") + ln; + String endMark = resolveSubQueryEndMark("dfmain"); + return selectClause + ln + " from (" + beginMark + sql + ln + + " ) dfmain" + endMark; + } + //========================================================================== // ========= // Clause Parts // ============ public String getSelectClause() { + // [DBFlute-0.8.6] + if (isSelectClauseTypeCountOrScalar() && !hasUnionQuery()) { + return buildSelectClauseCountOrScalar("dflocal"); + } + // /- - - - - - - - - - - - - - - - - - - - - - - - + // The type of select clause is COLUMNS since here. + // - - - - - - - - - -/ StringBuilder sb = new StringBuilder(); DBMeta dbmeta = DBMetaInstanceHandler.findDBMeta(_tableName); List columnInfoList = dbmeta.getColumnInfoList(); @@ -265,7 +277,19 @@ // [DBFlute-0.7.4] if (existsSpecifiedLocal && !localSpecifiedMap.containsKey(columnName)) { - continue; + if (isSelectClauseTypeCountOrScalar() && hasUnionQuery()) { + // Here it must be with union query. + // So the primary Key is target for saving unique. + // But if it does not have primary keys, all column is + // target. + if (dbmeta.hasPrimaryKey()) { + if (!columnInfo.isPrimary()) { + continue; + } + } + } else { + continue; + } } if (sb.length() > 0) { @@ -307,10 +331,6 @@ selectColumnInfo.getColumnAliasName()); } } - if (_isIncludedSelectColumnEffective - && !_includedSelectColumnMap.isEmpty()) { - sb.append(getIncludedSelectColumnClause()); - } // [DBFlute-0.7.4] if (_specifiedDeriveSubQueryMap != null @@ -318,9 +338,7 @@ Collection deriveSubQuerySet = _specifiedDeriveSubQueryMap .values(); for (String deriveSubQuery : deriveSubQuerySet) { - if (isFormatClauseEffective()) { - sb.append(getLineSeparator()).append(" "); - } + sb.append(getLineSeparator()).append(" "); sb.append(", ").append(deriveSubQuery); } } @@ -328,67 +346,83 @@ return sb.toString(); } - public String getSelectClausePKOnly() { - StringBuilder sb = new StringBuilder(); - DBMeta dbmeta = DBMetaInstanceHandler.findDBMeta(_tableName); - UniqueInfo uniqueInfo = dbmeta.getPrimaryUniqueInfo(); - List columnInfoList = uniqueInfo.getUniqueColumnList(); - for (ColumnInfo columnInfo : columnInfoList) { - String columnName = columnInfo.getColumnDbName(); - if (sb.length() > 0) { - sb.append(", "); - } else { - sb.append("select").append(SELECT_HINT).append(" "); - } - String realColumnName = getLocalTableAliasName() + "." + columnName; - sb.append(realColumnName).append(" as ").append(columnName); - _selectClauseRealColumnAliasMap.put(realColumnName, columnName); + protected boolean isSelectClauseTypeCountOrScalar() { + if (_selectClauseType.equals(SelectClauseType.COUNT)) { + return true; + } else if (_selectClauseType.equals(SelectClauseType.MAX)) { + return true; + } else if (_selectClauseType.equals(SelectClauseType.MIN)) { + return true; + } else if (_selectClauseType.equals(SelectClauseType.SUM)) { + return true; + } else if (_selectClauseType.equals(SelectClauseType.AVG)) { + return true; } - if (_isIncludedSelectColumnEffective - && !_includedSelectColumnMap.isEmpty()) { - sb.append(getIncludedSelectColumnClause()); - } + return false; + } - // [DBFlute-0.7.4] - if (_specifiedDeriveSubQueryMap != null - && !_specifiedDeriveSubQueryMap.isEmpty()) { - Collection deriveSubQuerySet = _specifiedDeriveSubQueryMap - .values(); - for (String deriveSubQuery : deriveSubQuerySet) { - if (isFormatClauseEffective()) { - sb.append(getLineSeparator()).append(" "); - } - sb.append(", ").append(deriveSubQuery); - } + protected String buildSelectClauseCountOrScalar(String aliasName) { + if (_selectClauseType.equals(SelectClauseType.COUNT)) { + return buildSelectClauseCount(); + } else if (_selectClauseType.equals(SelectClauseType.MAX)) { + return buildSelectClauseMax(aliasName); + } else if (_selectClauseType.equals(SelectClauseType.MIN)) { + return buildSelectClauseMin(aliasName); + } else if (_selectClauseType.equals(SelectClauseType.SUM)) { + return buildSelectClauseSum(aliasName); + } else if (_selectClauseType.equals(SelectClauseType.AVG)) { + return buildSelectClauseAvg(aliasName); } + String msg = "The type of select clause is not for scalar:"; + msg = msg + " type=" + _selectClauseType; + throw new IllegalStateException(msg); + } - return sb.toString(); + protected String buildSelectClauseCount() { + return "select count(*)"; } - public String getSelectHint() { - return createSelectHint(); + protected String buildSelectClauseMax(String aliasName) { + String columnName = getSpecifiedColumnNameAsOne(); + assertScalarSelectSpecifiedColumnOnlyOne(columnName); + return "select max(" + aliasName + "." + columnName + ")"; } - public String getIncludedSelectColumnClause() { - StringBuilder sb = new StringBuilder(); - int count = 0; - for (Iterator ite = _includedSelectColumnMap.keySet() - .iterator(); ite.hasNext(); count++) { - String aliasName = ite.next(); - String realColumnName = (String) _includedSelectColumnMap - .get(aliasName); - sb.append(", ").append(realColumnName).append(" as ").append( - aliasName); - _selectClauseRealColumnAliasMap.put(realColumnName, aliasName); + protected String buildSelectClauseMin(String aliasName) { + String columnName = getSpecifiedColumnNameAsOne(); + assertScalarSelectSpecifiedColumnOnlyOne(columnName); + return "select min(" + aliasName + "." + columnName + ")"; + } + + protected String buildSelectClauseSum(String aliasName) { + String columnName = getSpecifiedColumnNameAsOne(); + assertScalarSelectSpecifiedColumnOnlyOne(columnName); + return "select sum(" + aliasName + "." + columnName + ")"; + } + + protected String buildSelectClauseAvg(String aliasName) { + String columnName = getSpecifiedColumnNameAsOne(); + assertScalarSelectSpecifiedColumnOnlyOne(columnName); + return "select avg(" + aliasName + "." + columnName + ")"; + } + + protected void assertScalarSelectSpecifiedColumnOnlyOne(String columnName) { + if (columnName != null) { + return; } - return sb.toString(); + String msg = "The specified column exists one"; + msg = msg + " when the type of select clause is for scalar:"; + msg = msg + " specifiedSelectColumnMap=" + _specifiedSelectColumnMap; + throw new IllegalStateException(msg); } + public String getSelectHint() { + return createSelectHint(); + } + public String getFromClause() { StringBuilder sb = new StringBuilder(); - if (isFormatClauseEffective()) { - sb.append(getLineSeparator()).append(" "); - } + sb.append(getLineSeparator()).append(" "); sb.append("from "); if (_baseTableInlineWhereList.isEmpty()) { sb.append(_tableName).append(" dflocal"); @@ -417,9 +451,7 @@ Map joinOnMap = joinInfo.getJoinOnMap(); assertJoinOnMapNotEmpty(joinOnMap, aliasName); - if (isFormatClauseEffective()) { - sb.append(getLineSeparator()).append(" "); - } + sb.append(getLineSeparator()).append(" "); sb.append(" left outer join "); if (inlineWhereClauseList.isEmpty()) { sb.append(joinTableName); @@ -489,16 +521,12 @@ String clauseElement = (String) ite.next(); clauseElement = filterWhereClauseSimply(clauseElement); if (count == 0) { - if (isFormatClauseEffective()) { - sb.append(getLineSeparator()).append(" "); - } + sb.append(getLineSeparator()).append(" "); sb.append("where ").append( template ? getWhereFirstConditionMark() : "").append( clauseElement); } else { - if (isFormatClauseEffective()) { - sb.append(getLineSeparator()).append(" "); - } + sb.append(getLineSeparator()).append(" "); sb.append(" and ").append(clauseElement); } } @@ -510,7 +538,7 @@ public String getOrderByClause() { String orderByClause = null; - if (!_unionQueryInfoList.isEmpty()) { + if (hasUnionQuery()) { if (_selectClauseRealColumnAliasMap == null || _selectClauseRealColumnAliasMap.isEmpty()) { String msg = "The selectClauseColumnAliasMap should not be null or empty when union query exists: " @@ -522,8 +550,7 @@ } else { orderByClause = _orderByClause.getOrderByClause(); } - if (isFormatClauseEffective() && orderByClause != null - && orderByClause.trim().length() > 0) { + if (orderByClause != null && orderByClause.trim().length() > 0) { return getLineSeparator() + " " + orderByClause; } else { return orderByClause; @@ -532,8 +559,7 @@ public String getSqlSuffix() { String sqlSuffix = createSqlSuffix(); - if (isFormatClauseEffective() && sqlSuffix != null - && sqlSuffix.trim().length() > 0) { + if (sqlSuffix != null && sqlSuffix.trim().length() > 0) { return getLineSeparator() + sqlSuffix; } else { return sqlSuffix; @@ -542,20 +568,6 @@ //========================================================================== // ========= - // Copy Parts - // ========== - public void copyIncludedSelectColumn(SqlClause sqlClause) { - Set keySet = _includedSelectColumnMap.keySet(); - for (Iterator ite = keySet.iterator(); ite.hasNext();) { - String aliasName = ite.next(); - String realColumnName = (String) _includedSelectColumnMap - .get(aliasName); - sqlClause.registerIncludedSelectColumn(aliasName, realColumnName); - } - } - - //========================================================================== - // ========= // SelectedSelectColumn // ==================== /** @@ -644,26 +656,6 @@ //========================================================================== // ========= - // IncludedSelectColumn - // ==================== - public void ignoreIncludedSelectColumn() { - _isIncludedSelectColumnEffective = false; - } - - public void makeIncludedSelectColumnEffective() { - if (!_includedSelectColumnMap.isEmpty()) { - _isIncludedSelectColumnEffective = true; - } - } - - public void registerIncludedSelectColumn(String aliasName, - String realColumnName) { - _isIncludedSelectColumnEffective = true; - _includedSelectColumnMap.put(aliasName, realColumnName); - } - - //========================================================================== - // ========= // OuterJoin // ========= public void registerOuterJoin(String joinTableName, String aliasName, @@ -1079,12 +1071,23 @@ public void registerUnionQuery(String unionQueryClause, boolean unionAll) { assertStringNotNullAndNotTrimmedEmpty("unionQueryClause", unionQueryClause); - final UnionQueryInfo unionQueryInfo = new UnionQueryInfo(); + UnionQueryInfo unionQueryInfo = new UnionQueryInfo(); unionQueryInfo.setUnionQueryClause(unionQueryClause); unionQueryInfo.setUnionAll(unionAll); + addUnionQueryInfo(unionQueryInfo); + } + + protected void addUnionQueryInfo(UnionQueryInfo unionQueryInfo) { + if (_unionQueryInfoList == null) { + _unionQueryInfoList = new ArrayList(); + } _unionQueryInfoList.add(unionQueryInfo); } + public boolean hasUnionQuery() { + return _unionQueryInfoList != null && !_unionQueryInfoList.isEmpty(); + } + protected static class UnionQueryInfo { protected String _unionQueryClause; @@ -1425,18 +1428,6 @@ //========================================================================== // ========= - // Format Clause - // ============= - public boolean isFormatClauseEffective() { - return _formatClause; - } - - public void makeFormatClauseEffective() { - _formatClause = true; - } - - //========================================================================== - // ========= // Sub Query Indent // ================ public String resolveSubQueryBeginMark(String subQueryIdentity) { @@ -1462,13 +1453,11 @@ } public String filterSubQueryIndent(String sql) { - return isFormatClauseEffective() ? filterSubQueryIndent(sql, "") : sql; + return filterSubQueryIndent(sql, "", sql); } - protected String filterSubQueryIndent(String sql, String preIndent) { - if (!isFormatClauseEffective()) { - return sql; - } + protected String filterSubQueryIndent(String sql, String preIndent, + String originalSql) { final String lineSeparator = getLineSeparator(); if (!sql.contains(getSubQueryBeginMarkPrefix())) { return sql; @@ -1509,7 +1498,8 @@ // - - - - - - - - // In begin to end // - - - - - - - - - if (line.contains(endMarkPrefix + subQueryIdentity)) {// The end + if (line.contains(endMarkPrefix + subQueryIdentity)) { // The + // end final int markIndex = line.indexOf(endMarkPrefix); final int terminalIndex = line.indexOf(identityTerminal); if (terminalIndex < 0) { @@ -1521,7 +1511,7 @@ + line.substring(terminalIndex + terminalLength); subSb.append(clause).append(getLineSeparator()); final String currentSql = filterSubQueryIndent(subSb - .toString(), preIndent + indent); + .toString(), preIndent + indent, originalSql); mainSb.append(currentSql); throughBegin = false; throughBeginFirst = false; @@ -1544,10 +1534,11 @@ + getLineSeparator(); msg = msg + subQueryIdentity + getLineSeparator(); msg = msg + getLineSeparator() + "[Before Filter]" - + getLineSeparator(); - msg = msg + sql + getLineSeparator(); + + getLineSeparator() + sql; msg = msg + getLineSeparator() + "[After Filter]" + getLineSeparator() + filteredSql; + msg = msg + getLineSeparator() + "[Original SQL]" + + getLineSeparator() + originalSql; throw new SubQueryIndentFailureException(msg); } if (filteredSql.contains(beginMarkPrefix)) { @@ -1556,10 +1547,11 @@ + getLineSeparator(); msg = msg + subQueryIdentity + getLineSeparator(); msg = msg + getLineSeparator() + "[Before Filter]" - + getLineSeparator(); - msg = msg + sql + getLineSeparator(); + + getLineSeparator() + sql; msg = msg + getLineSeparator() + "[After Filter]" + getLineSeparator() + filteredSql; + msg = msg + getLineSeparator() + "[Original SQL]" + + getLineSeparator() + originalSql; throw new SubQueryIndentFailureException(msg); } return filteredSql; @@ -1592,7 +1584,7 @@ } if (!_specifiedSelectColumnMap.containsKey(tableAliasName)) { _specifiedSelectColumnMap.put(tableAliasName, - new HashMap()); + new LinkedHashMap()); } Map elementMap = _specifiedSelectColumnMap .get(tableAliasName); @@ -1666,10 +1658,7 @@ getUnionWhereFirstConditionMark(), ""); final StringBuilder sb = new StringBuilder(); - String ln = ""; - if (isFormatClauseEffective()) { - ln = getLineSeparator(); - } + String ln = getLineSeparator(); sb.append("update ").append(_tableName).append(ln); int index = 0; // It is guaranteed that the map has one or more elements. @@ -1728,10 +1717,7 @@ final String subQuery = filterSubQueryIndent(selectClause + " " + fromWhereClause); final StringBuilder sb = new StringBuilder(); - String ln = ""; - if (isFormatClauseEffective()) { - ln = getLineSeparator(); - } + String ln = getLineSeparator(); sb.append("delete from ").append(_tableName).append(ln); sb.append(" where ").append(primaryKeyName); sb.append(" in (").append(ln).append(subQuery).append(ln).append( @@ -1760,6 +1746,29 @@ return false; } + // [DBFlute-0.8.6] + //========================================================================== + // ========= + // Select Clause Type + // ================== + public void classifySelectClauseType(SelectClauseType selectClauseType) { + changeSelectClauseType(selectClauseType); + } + + protected void changeSelectClauseType(SelectClauseType selectClauseType) { + savePreviousSelectClauseType(); + _selectClauseType = selectClauseType; + } + + protected void savePreviousSelectClauseType() { + _previousSelectClauseType = _selectClauseType; + } + + public void rollbackSelectClauseType() { + _selectClauseType = _previousSelectClauseType != null ? _previousSelectClauseType + : DEFAULT_SELECT_CLAUSE_TYPE; + } + // [DBFlute-0.7.5] //========================================================================== // ========= Modified: userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/cbean/sqlclause/SqlClause.java =================================================================== --- userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/cbean/sqlclause/SqlClause.java 2008-12-26 22:11:31 UTC (rev 1622) +++ userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/cbean/sqlclause/SqlClause.java 2008-12-27 22:02:56 UTC (rev 1623) @@ -7,7 +7,7 @@ import jp.sf.pal.userinfo.db.allcommon.cbean.cvalue.ConditionValue; /** - * The interface of SQL-clause. + * The interface of SQL clause. * * @author DBFlute(AutoGenerator) */ @@ -35,21 +35,6 @@ */ public String getClause(); - /** - * Get clause of all parts as PK-only. - * - *
-     * # 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
-     * 
- * - * @return The clause of all parts as PK-Only. (NotNull) - */ - public String getClausePKOnly(); - // ----------------------------------------------------- // Fragment Clause // --------------- @@ -92,14 +77,6 @@ public String getSelectClause(); /** - * Get The clause of 'select' as PK-only. This is an internal method. - * - * @return The clause of select PK-only. {[select ...] from table...} - * (NotNull) - */ - public String getSelectClausePKOnly(); - - /** * Get the hint of 'select'. This is an internal method. * * @return The hint of 'select'. {select [select-hint] * from table...} @@ -108,14 +85,6 @@ public String getSelectHint(); /** - * Get the clause of included-select-column. This is an internal method. - * - * @return The clause of included-select-column. {select ... , - * [included-select-column clause] from table...} (NotNull) - */ - public String getIncludedSelectColumnClause(); - - /** * Get the clause of 'from'. This is an internal method. * * @return The clause of 'from'. (NotNull) @@ -162,17 +131,6 @@ //========================================================================== // ========= - // Copy Parts - // ========== - /** - * Copy included-select-column. - * - * @param sqlClause SQL-clause. (NotNull) - */ - public void copyIncludedSelectColumn(SqlClause sqlClause); - - //========================================================================== - // ========= // SelectedSelectColumn // ==================== /** @@ -189,30 +147,6 @@ //========================================================================== // ========= - // IncludedSelectColumn - // ==================== - /** - * Ignore included-select-column. - */ - public void ignoreIncludedSelectColumn(); - - /** - * Make included-select-column effective. - */ - public void makeIncludedSelectColumnEffective(); - - /** - * Register included-select-column. - * - * @param aliasName The alias name of the included-select-column. (NotNull) - * @param realColumnName The real column name of the included-select-column. - * (NotNull) - */ - public void registerIncludedSelectColumn(String aliasName, - String realColumnName); - - //========================================================================== - // ========= // OuterJoin // ========= /** @@ -340,6 +274,8 @@ // ===== public void registerUnionQuery(String unionClause, boolean unionAll); + public boolean hasUnionQuery(); + //========================================================================== // ========= // FetchScope @@ -561,14 +497,6 @@ //========================================================================== // ========= - // Format Clause - // ============= - public boolean isFormatClauseEffective(); - - public void makeFormatClauseEffective(); - - //========================================================================== - // ========= // Sub Query Indent // ================ public String resolveSubQueryBeginMark(String subQueryIdentity); @@ -588,8 +516,17 @@ public boolean hasSpecifiedDeriveSubQuery(String aliasName); + /** + * Get the name of only one specified column. + * + * @return The name of only one specified column. (Nullable: If it's not + * found or duplicated, it returns null) + */ public String getSpecifiedColumnNameAsOne(); + /** + * Clear specified select columns. + */ public void clearSpecifiedSelectColumn(); // [DBFlute-0.7.5] @@ -621,4 +558,29 @@ */ public boolean isUniqueConstraintException(String sqlState, Integer errorCode); + + // [DBFlute-0.8.6] + //========================================================================== + // ========= + // Select Clause Type + // ================== + /** + * Classify the type of select clause into specified type. + * + * @param selectClauseType The type of select clause. (NotNull) + */ + public void classifySelectClauseType(SelectClauseType selectClauseType); + + /** + * Roll-back the type of select clause into previous one. If it has no + * change, classify its type into default type. + */ + public void rollbackSelectClauseType(); + + /** + * The type of select clause. + */ + public static enum SelectClauseType { + COLUMNS, COUNT, MAX, MIN, SUM, AVG + } } Modified: userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/cbean/sqlclause/SqlClauseOracle.java =================================================================== --- userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/cbean/sqlclause/SqlClauseOracle.java 2008-12-26 22:11:31 UTC (rev 1622) +++ userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/cbean/sqlclause/SqlClauseOracle.java 2008-12-27 22:02:56 UTC (rev 1623) @@ -71,12 +71,7 @@ if (!isFetchStartIndexSupported() && !isFetchSizeSupported()) { return; } - String ln = null; - if (isFormatClauseEffective()) { - ln = getLineSeparator(); - } else { - ln = ""; - } + String ln = getLineSeparator(); _fetchScopeSelectHint = " * from (select base.*, rownum as rn from (" + ln + "select"; _fetchScopeSqlSuffix = ""; Modified: userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/dbmeta/AbstractDBMeta.java =================================================================== --- userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/dbmeta/AbstractDBMeta.java 2008-12-26 22:11:31 UTC (rev 1622) +++ userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/dbmeta/AbstractDBMeta.java 2008-12-27 22:02:56 UTC (rev 1623) @@ -5,12 +5,11 @@ import java.util.Collection; import java.util.Collections; import java.util.HashMap; -import java.util.HashSet; import java.util.Iterator; import java.util.LinkedHashMap; import java.util.List; import java.util.Map; -import java.util.Set; +import java.util.concurrent.ConcurrentHashMap; import jp.sf.pal.userinfo.db.allcommon.Entity; import jp.sf.pal.userinfo.db.allcommon.dbmeta.info.ColumnInfo; @@ -22,6 +21,7 @@ import jp.sf.pal.userinfo.db.allcommon.helper.MapListStringImpl; import jp.sf.pal.userinfo.db.allcommon.helper.MapStringBuilder; import jp.sf.pal.userinfo.db.allcommon.helper.MapStringBuilderImpl; +import jp.sf.pal.userinfo.db.allcommon.helper.StringKeyMap; import jp.sf.pal.userinfo.db.allcommon.util.SimpleAssertUtil; import jp.sf.pal.userinfo.db.allcommon.util.SimpleStringUtil; import jp.sf.pal.userinfo.db.allcommon.util.SimpleSystemUtil; @@ -31,68 +31,113 @@ * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public abstract class AbstractDBMeta implements DBMeta { //========================================================================== // ========= + // Definition + // ========== + protected static final Object DUMMY_VALUE = new Object(); + + //========================================================================== + // ========= // Attribute // ========= - protected List _columnInfoList; + // ----------------------------------------------------- + // Information Resource + // -------------------- + // Initialized at its getter. + private StringKeyMap _tableDbNameFlexibleMap; + private StringKeyMap _tablePropertyNameFlexibleMap; + + private List _columnInfoList; + + private StringKeyMap _columnInfoFlexibleMap; + + // Initialized at hasMethod(). + private Map _methodNameMap = newConcurrentHashMap(); + //========================================================================== // ========= + // Table Info + // ========== + /** + * Get the flexible map of table DB name. + * + * @return The flexible map of table DB name. (NotNull, NotEmpty) + */ + protected Map getTableDbNameFlexibleMap() { + if (_tableDbNameFlexibleMap != null) { + return _tableDbNameFlexibleMap; + } + synchronized (this) { + if (_tableDbNameFlexibleMap != null) { + return _tableDbNameFlexibleMap; + } + _tableDbNameFlexibleMap = StringKeyMap.createAsFlexibleConcurrent(); + _tableDbNameFlexibleMap.put(getTableDbName(), getTableDbName()); + return _tableDbNameFlexibleMap; + } + } + + /** + * Get the flexible map of table property name. + * + * @return The flexible map of table property name. (NotNull, NotEmpty) + */ + protected Map getTablePropertyNameFlexibleMap() { + if (_tablePropertyNameFlexibleMap != null) { + return _tablePropertyNameFlexibleMap; + } + synchronized (this) { + if (_tablePropertyNameFlexibleMap != null) { + return _tablePropertyNameFlexibleMap; + } + _tablePropertyNameFlexibleMap = StringKeyMap + .createAsFlexibleConcurrent(); + _tablePropertyNameFlexibleMap.put(getTableDbName(), + getTablePropertyName()); + return _tableDbNameFlexibleMap; + } + } + + //========================================================================== + // ========= // Column Info // =========== /** * The implementation. * - * @param columnFlexibleName The flexible name of the column. (NotNull) + * @param columnFlexibleName The flexible name(IgnoreCase, IgnoreUnderscore) + * of the column. (NotNull, NotEmpty) * @return Determination. */ public boolean hasColumn(String columnFlexibleName) { - if (!hasFlexibleName(columnFlexibleName)) { - return false; - } - final String propertyName = findPropertyName(columnFlexibleName); - return hasMethod("column" + initCap(propertyName)); + assertStringNotNullAndNotTrimmedEmpty("columnFlexibleName", + columnFlexibleName); + return getColumnInfoFlexibleMap().containsKey(columnFlexibleName); } /** * The implementation. * - * @param columnFlexibleName The flexible name of the column. (NotNull and - * NotEmpty) + * @param columnFlexibleName The flexible name(IgnoreCase, IgnoreUnderscore) + * of the column. (NotNull, NotEmpty) * @return The information of the column. (NotNull) */ public ColumnInfo findColumnInfo(String columnFlexibleName) { assertStringNotNullAndNotTrimmedEmpty("columnFlexibleName", columnFlexibleName); - if (!hasColumn(columnFlexibleName)) { + final ColumnInfo columnInfo = getColumnInfoFlexibleMap().get( + columnFlexibleName); + if (columnInfo == null) { String msg = "Not found column by columnFlexibleName: " + columnFlexibleName; msg = msg + " tableName=" + getTableDbName(); throw new IllegalArgumentException(msg); } - String methodName = "column" - + initCap(findPropertyName(columnFlexibleName)); - Method method = null; - try { - method = this.getClass().getMethod(methodName, new Class[] {}); - } catch (NoSuchMethodException e) { - String msg = "Not found column by columnFlexibleName: " - + columnFlexibleName; - msg = msg + " tableName=" + getTableDbName() + " methodName=" - + methodName; - throw new RuntimeException(msg, e); - } - try { - return (ColumnInfo) method.invoke(this, new Object[] {}); - } catch (IllegalAccessException e) { - throw new RuntimeException(e); - } catch (java.lang.reflect.InvocationTargetException e) { - throw new RuntimeException(e.getCause()); - } + return columnInfo; } protected ColumnInfo cci(String columnDbName, String propertyName, @@ -114,7 +159,7 @@ /** * The implementation. * - * @return The list of columns. (NotNull and NotEmpty) + * @return The list of columns. (NotNull, NotEmpty) */ public List getColumnInfoList() { if (_columnInfoList != null) { @@ -144,79 +189,118 @@ } } - protected void initializeColumnInfoList() { - getColumnInfoList();// Ignore return value because of initialization - // only! + /** + * Get the flexible map of column information. + * + * @return The flexible map of column information. (NotNull, NotEmpty) + */ + protected Map getColumnInfoFlexibleMap() { + if (_columnInfoFlexibleMap != null) { + return _columnInfoFlexibleMap; + } + final List columnInfoList = getColumnInfoList(); + synchronized (this) { + if (_columnInfoFlexibleMap != null) { + return _columnInfoFlexibleMap; + } + _columnInfoFlexibleMap = StringKeyMap.createAsFlexibleConcurrent(); + for (ColumnInfo columnInfo : columnInfoList) { + _columnInfoFlexibleMap.put(columnInfo.getColumnDbName(), + columnInfo); + } + return _columnInfoFlexibleMap; + } } //========================================================================== - // =========== + // ========= + // Resource Initialization + // ======================= + protected void initializeInformationResource() { // for instance initializer + // of subclass. + // Initialize the flexible map of table DB name. + getTableDbNameFlexibleMap(); + + // Initialize the flexible map of table property name. + getTablePropertyNameFlexibleMap(); + + // Initialize the list of column information. + getColumnInfoList(); + + // Initialize the flexible map of column information. + getColumnInfoFlexibleMap(); + + // Initialize the map of (public)method name. + hasMethod("dummy"); + } + + //========================================================================== + // ========= // Name Handling // ============= /** * The implementation. * - * @param flexibleName Flexible-name(IgnoreCase). (NotNull and NotEmpty) + * @param flexibleName The flexible name(IgnoreCase, IgnoreUnderscore). + * (NotNull, NotEmpty) * @return Determination. */ public boolean hasFlexibleName(String flexibleName) { - final String key = flexibleName.toLowerCase(); - if (getDbNamePropertyNameKeyToLowerMap().containsKey(key)) { - return true; - } - if (getPropertyNameDbNameKeyToLowerMap().containsKey(key)) { - return true; - } - return false; + assertStringNotNullAndNotTrimmedEmpty("flexibleName", flexibleName); + + // It uses column before table because column is used much more than + // table. + // This is the same consideration at other methods. + return getColumnInfoFlexibleMap().containsKey(flexibleName) + || getTableDbNameFlexibleMap().containsKey(flexibleName); } /** * The implementation. * - * @param flexibleName Flexible-name(IgnoreCase). (NotNull and NotEmpty) - * @return DB name. (NotNull and NotEmpty) + * @param flexibleName The flexible name(IgnoreCase, IgnoreUnderscore). + * (NotNull, NotEmpty) + * @return DB name. (NotNull, NotEmpty) */ public String findDbName(String flexibleName) { - final String key = flexibleName.toLowerCase(); - if (getPropertyNameDbNameKeyToLowerMap().containsKey(key)) { - return (String) getPropertyNameDbNameKeyToLowerMap().get(key); + assertStringNotNullAndNotTrimmedEmpty("flexibleName", flexibleName); + final ColumnInfo columnInfoMap = getColumnInfoFlexibleMap().get( + flexibleName); + if (columnInfoMap != null) { + return columnInfoMap.getColumnDbName(); } - if (getDbNamePropertyNameKeyToLowerMap().containsKey(key)) { - final String dbNameKeyToLower = ((String) getDbNamePropertyNameKeyToLowerMap() - .get(key)).toLowerCase(); - if (getPropertyNameDbNameKeyToLowerMap().containsKey( - dbNameKeyToLower)) { - return (String) getPropertyNameDbNameKeyToLowerMap().get( - dbNameKeyToLower); - } + final String tableDbName = getTableDbNameFlexibleMap() + .get(flexibleName); + if (tableDbName != null) { + return tableDbName; } - String msg = "Not found object by the flexible name: flexibleName=" + String msg = "Not found DB name by the flexible name: flexibleName=" + flexibleName; - throw new IllegalStateException(msg); + throw new IllegalArgumentException(msg); } /** * The implementation. * - * @param flexibleName Flexible-name(IgnoreCase). (NotNull and NotEmpty) - * @return DB name. (NotNull and NotEmpty) + * @param flexibleName The flexible name(IgnoreCase, IgnoreUnderscore). + * (NotNull, NotEmpty) + * @return DB name. (NotNull, NotEmpty) */ public String findPropertyName(String flexibleName) { - final String key = flexibleName.toLowerCase(); - if (getDbNamePropertyNameKeyToLowerMap().containsKey(key)) { - return (String) getDbNamePropertyNameKeyToLowerMap().get(key); + assertStringNotNullAndNotTrimmedEmpty("flexibleName", flexibleName); + final ColumnInfo columnInfoMap = getColumnInfoFlexibleMap().get( + flexibleName); + if (columnInfoMap != null) { + return columnInfoMap.getPropertyName(); } - if (getPropertyNameDbNameKeyToLowerMap().containsKey(key)) { - final String dbNameToLower = ((String) getPropertyNameDbNameKeyToLowerMap() - .get(key)).toLowerCase(); - if (getDbNamePropertyNameKeyToLowerMap().containsKey(dbNameToLower)) { - return (String) getDbNamePropertyNameKeyToLowerMap().get( - dbNameToLower); - } + final String tablePropertyName = getTablePropertyNameFlexibleMap().get( + flexibleName); + if (tablePropertyName != null) { + return tablePropertyName; } - String msg = "Not found object by the flexible name: flexibleName=" + String msg = "Not found property name by the flexible name: flexibleName=" + flexibleName; - throw new IllegalStateException(msg); + throw new IllegalArgumentException(msg); } //========================================================================== @@ -735,10 +819,8 @@ protected void registerEntityPropertySetupper( String columnName, String propertyName, Eps setupper, Map> entityPropertySetupperMap) { + // Only column name is registered because the map must be flexible map. entityPropertySetupperMap.put(columnName, setupper); - entityPropertySetupperMap.put(propertyName, setupper); - entityPropertySetupperMap.put(columnName.toLowerCase(), setupper); - entityPropertySetupperMap.put(propertyName.toLowerCase(), setupper); } protected Eps findEps( @@ -945,6 +1027,7 @@ /** * This class is for Internal. Don't use this! */ + @SuppressWarnings("unchecked") protected static class MapStringValueAnalyzer { protected java.util.Map _valueMap; @@ -1072,6 +1155,7 @@ // ========= // Assist Helper // ============= + @SuppressWarnings("unchecked") protected ENTITY downcast(Entity entity) { checkDowncast(entity); return (ENTITY) entity; @@ -1118,10 +1202,10 @@ protected Map setupKeyToLowerMap(boolean dbNameKey) { final Map map; if (dbNameKey) { - map = newLinkedHashMap(getTableDbName().toLowerCase(), + map = newConcurrentHashMap(getTableDbName().toLowerCase(), getTablePropertyName()); } else { - map = newLinkedHashMap(getTablePropertyName().toLowerCase(), + map = newConcurrentHashMap(getTablePropertyName().toLowerCase(), getTableDbName()); } Method[] methods = this.getClass().getMethods(); @@ -1178,6 +1262,17 @@ return new HashMap(); } + protected ConcurrentHashMap newConcurrentHashMap() { + return new ConcurrentHashMap(); + } + + protected ConcurrentHashMap newConcurrentHashMap( + KEY key, VALUE value) { + ConcurrentHashMap map = newConcurrentHashMap(); + map.put(key, value); + return map; + } + protected LinkedHashMap newLinkedHashMap() { return new LinkedHashMap(); } @@ -1201,23 +1296,26 @@ // ----------------------------------------------------- // Reflection Handling // ------------------- - private Set _cachedMethodNames = new HashSet(); // for - - // performance - + /** + * Does it have the method? + * + * @param methodName The name of method. (NotNull, NotEmpty, + * PublicMethodOnly) + * @return Determination. + */ protected boolean hasMethod(String methodName) { assertStringNotNullAndNotTrimmedEmpty("methodName", methodName); - if (_cachedMethodNames.isEmpty()) { - synchronized (_cachedMethodNames) { - if (_cachedMethodNames.isEmpty()) { + if (_methodNameMap.isEmpty()) { + synchronized (_methodNameMap) { + if (_methodNameMap.isEmpty()) { final Method[] methods = this.getClass().getMethods(); for (Method method : methods) { - _cachedMethodNames.add(method.getName()); + _methodNameMap.put(method.getName(), DUMMY_VALUE); } } } } - return _cachedMethodNames.contains(methodName); + return _methodNameMap.containsKey(methodName); } // ----------------------------------------------------- Modified: userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/dbmeta/DBMeta.java =================================================================== --- userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/dbmeta/DBMeta.java 2008-12-26 22:11:31 UTC (rev 1622) +++ userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/dbmeta/DBMeta.java 2008-12-27 22:02:56 UTC (rev 1623) @@ -17,23 +17,22 @@ * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public interface DBMeta { //========================================================================== // ========= // Definition // ========== - /** Map-string map-mark. */ + /** Map-string map mark. */ public static final String MAP_STRING_MAP_MARK = "map:"; - /** Map-string list-mark. */ + /** Map-string list mark. */ public static final String MAP_STRING_LIST_MARK = "list:"; - /** Map-string start-brace. */ + /** Map-string start brace. */ public static final String MAP_STRING_START_BRACE = "@{"; - /** Map-string end-brace. */ + /** Map-string end brace. */ public static final String MAP_STRING_END_BRACE = "@}"; /** Map-string delimiter. */ @@ -47,23 +46,23 @@ // Table Info // ========== /** - * Get table db-name. + * Get table DB name. * - * @return Table db-name. (NotNull) + * @return Table DB name. (NotNull) */ public String getTableDbName(); /** - * Get table property-name(JavaBeansRule). + * Get table property name(JavaBeansRule). * - * @return Table property-name(JavaBeansRule). (NotNull) + * @return Table property name(JavaBeansRule). (NotNull) */ public String getTablePropertyName(); /** - * Get table SQL-name. + * Get table SQL name. * - * @return Table SQL-name. (NotNull) + * @return Table SQL name. (NotNull) */ public String getTableSqlName(); @@ -80,10 +79,10 @@ public boolean hasFlexibleName(String flexibleName); /** - * Find db name by flexible name. {Target objects are TABLE and COLUMN} + * Find DB name by flexible name. {Target objects are TABLE and COLUMN} * * @param flexibleName The flexible name. (NotNull and NotEmpty) - * @return Db name. (NotNull and NotEmpty) + * @return The DB name of anything. (NotNull and NotEmpty) */ public String findDbName(String flexibleName); @@ -92,60 +91,40 @@ * TABLE and COLUMN} * * @param flexibleName The flexible name. (NotNull and NotEmpty) - * @return Db name. (NotNull and NotEmpty) + * @return The DB name of anything. (NotNull and NotEmpty) */ public String findPropertyName(String flexibleName); //========================================================================== // ========= - // Name Map - // ======== - /** - * Get the key-to-lower map of DB name(lower) and property name. - * - * @return The key-to-lower map of DB name(lower) and property name. - * (NotNull) - */ - public Map 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 getPropertyNameDbNameKeyToLowerMap(); - - //========================================================================== - // ========= // Type Name // ========= /** - * Get the type-name of entity. + * Get the type name of entity. * - * @return The type-name of entity. (NotNull) + * @return The type name of entity. (NotNull) */ public String getEntityTypeName(); /** - * Get the type-name of condition-bean. + * Get the type name of condition-bean. * - * @return The type-name of condition-bean. (Nullable: If the condition-bean + * @return The type name of condition-bean. (Nullable: If the condition-bean * does not exist) */ public String getConditionBeanTypeName(); /** - * Get the type-name of dao. + * Get the type name of DAO. * - * @return The type-name of dao. (Nullable: If the dao does not exist) + * @return The type name of DAO. (Nullable: If the DAO does not exist) */ public String getDaoTypeName(); /** - * Get the type-name of behavior. + * Get the type name of behavior. * - * @return The type-name of behavior. (Nullable: If the behavior does not + * @return The type name of behavior. (Nullable: If the behavior does not * exist) */ public String getBehaviorTypeName(); Modified: userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/dbmeta/DBMetaInstanceHandler.java =================================================================== --- userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/dbmeta/DBMetaInstanceHandler.java 2008-12-26 22:11:31 UTC (rev 1622) +++ userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/dbmeta/DBMetaInstanceHandler.java 2008-12-27 22:02:56 UTC (rev 1623) @@ -1,90 +1,85 @@ package jp.sf.pal.userinfo.db.allcommon.dbmeta; -import java.util.Collections; -import java.util.LinkedHashMap; +import java.lang.reflect.Method; import java.util.Map; import java.util.Set; +import java.util.concurrent.ConcurrentHashMap; +import jp.sf.pal.userinfo.db.allcommon.helper.StringKeyMap; import jp.sf.pal.userinfo.db.allcommon.util.SimpleAssertUtil; /** - * DBMeta instance handler. + * The instance handler of DB meta. * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public class DBMetaInstanceHandler { //========================================================================== // ========= // Definition // ========== + /** Log-instance. */ + private static final org.apache.commons.logging.Log _log = org.apache.commons.logging.LogFactory + .getLog(DBMetaInstanceHandler.class); + + //========================================================================== + // ========= + // Resource Map + // ============ /** Table DB-name instance map. */ - protected static final Map _tableDbNameInstanceMap = new LinkedHashMap(); + protected static final Map _tableDbNameInstanceMap = newConcurrentHashMap(); - /** The map of table DB-name and class name. */ - protected static final Map _tableDbNameClassNameMap; - static { - Map tmpMap = new LinkedHashMap(); + /** The map of table DB name and class name. This is for initialization. */ + protected static final Map _tableDbNameClassNameMap = newConcurrentHashMap(); - tmpMap.put("GROUP_INFO", - "jp.sf.pal.userinfo.db.bsentity.dbmeta.GroupInfoDbm"); - tmpMap.put("GROUP_MAPPING", - "jp.sf.pal.userinfo.db.bsentity.dbmeta.GroupMappingDbm"); - tmpMap.put("ROLE_INFO", - "jp.sf.pal.userinfo.db.bsentity.dbmeta.RoleInfoDbm"); - tmpMap.put("ROLE_MAPPING", - "jp.sf.pal.userinfo.db.bsentity.dbmeta.RoleMappingDbm"); - tmpMap.put("USER_INFO", - "jp.sf.pal.userinfo.db.bsentity.dbmeta.UserInfoDbm"); + /** The flexible map of table DB name. This is for conversion at finding. */ + protected static final Map _tableDbNameFlexibleMap = StringKeyMap + .createAsFlexibleConcurrent(); - _tableDbNameClassNameMap = Collections.unmodifiableMap(tmpMap); - } + /** The count of setting up resources of DB meta for internal information. */ + protected static int setupCount = 0; - /** The key-to-lower map of DB-name and property-name for table. */ - protected static final Map _tableDbNamePropertyNameKeyToLowerMap; - static { - Map tmpMap = new LinkedHashMap(); - - 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("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 _tablePropertyNameDbNameKeyToLowerMap; - static { - Map tmpMap = new LinkedHashMap(); - - 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("userInfo".toLowerCase(), "USER_INFO"); - - _tablePropertyNameDbNameKeyToLowerMap = Collections - .unmodifiableMap(tmpMap); - } - - protected static DBMeta getDBMeta(String className) { - try { - Class clazz = Class.forName(className); - java.lang.reflect.Method methoz = clazz.getMethod("getInstance", - (Class[]) null); - Object result = methoz.invoke(null, (Object[]) null); - return (DBMeta) result; - } catch (Exception e) { - throw new RuntimeException(e); + /** + * Set up the resource of DBMeta. Lock this class. + * + * @param tableDbNameClassNameMap The map of table DB name and class name. + * (NotNull) + */ + public static synchronized void setupDBMetaResource( + Map tableDbNameClassNameMap) { + if (tableDbNameClassNameMap == null) { + String msg = "The argument 'tableDbNameClassNameMap' should not be null"; + msg = msg + " at DBMetaInstanceHandler.setupDBMetaResource()"; + throw new IllegalArgumentException(msg); } + if (tableDbNameClassNameMap.isEmpty()) { + String msg = "The argument 'tableDbNameClassNameMap' should not be empty"; + msg = msg + " at DBMetaInstanceHandler.setupDBMetaResource()"; + throw new IllegalArgumentException(msg); + } + final String firstMsg = "...Setting up resources of DB meta"; + final int tableCount = tableDbNameClassNameMap.size(); + if (setupCount == 0) { + _log.info(firstMsg + ": tables=" + tableCount); // basically here + } else { + _log.info(firstMsg + " AGAIN(" + (setupCount + 1) + + " times): tables=" + tableCount); + } + _tableDbNameInstanceMap.clear(); + _tableDbNameClassNameMap.clear(); + _tableDbNameFlexibleMap.clear(); + final Set tableDbNameSet = tableDbNameClassNameMap.keySet(); + for (String tableDbName : tableDbNameSet) { + final String className = tableDbNameClassNameMap.get(tableDbName); + _tableDbNameClassNameMap.put(tableDbName, className); + _tableDbNameFlexibleMap.put(tableDbName, tableDbName); + } + ++setupCount; } /** - * @return The initialized map that contains all instances of dbmeta. + * @return The initialized map that contains all instances of DB meta. * (NotNull & NotEmpty) */ public static Map getDBMetaMap() { @@ -117,45 +112,31 @@ // Main Method // =========== /** - * Find dbmeta by table flexible-name. + * Find DB meta by table flexible name. * *
-     * If the table name is 'ORDER_DETAIL', you can find the dbmeta by ...(as follows)
+     * If the table name is 'ORDER_DETAIL', you can find the DB meta by ...(as follows)
      *     'ORDER_DETAIL', 'ORDer_DeTAiL', 'order_detail'
      *     , 'OrderDetail', 'orderdetail', 'oRderDetaIl'
      * 
* - * @param tableFlexibleName Table flexible-name. (NotNull) - * @return The instance of dbmeta. (NotNull) - * @exception DBMetaNotFoundException When the dbmeta is not found. + * @param tableFlexibleName The flexible name of table. (NotNull) + * @return The instance of DB meta. (NotNull) + * @exception DBMetaNotFoundException When the DB meta is not found. */ public static DBMeta findDBMeta(String tableFlexibleName) { assertStringNotNullAndNotTrimmedEmpty("tableFlexibleName", tableFlexibleName); - if (_tableDbNameInstanceMap.containsKey(tableFlexibleName)) { - return byTableDbName(tableFlexibleName); - } - String toLowerKey = tableFlexibleName.toLowerCase(); - if (_tableDbNamePropertyNameKeyToLowerMap.containsKey(toLowerKey)) { - String propertyName = (String) _tableDbNamePropertyNameKeyToLowerMap - .get(toLowerKey); - String dbName = (String) _tablePropertyNameDbNameKeyToLowerMap - .get(propertyName.toLowerCase()); - return byTableDbName(dbName); - } - if (_tablePropertyNameDbNameKeyToLowerMap.containsKey(toLowerKey)) { - String dbName = (String) _tablePropertyNameDbNameKeyToLowerMap - .get(toLowerKey); - return byTableDbName(dbName); - } final int dotLastIndex = tableFlexibleName.lastIndexOf("."); if (dotLastIndex >= 0) { - try { - return findDBMeta(tableFlexibleName.substring(dotLastIndex + 1)); - } catch (DBMetaNotFoundException e) { - // Nothing - } + tableFlexibleName = tableFlexibleName.substring(dotLastIndex + + ".".length()); } + final String tableDbName = _tableDbNameFlexibleMap + .get(tableFlexibleName); + if (tableDbName != null) { + return byTableDbName(tableDbName); + } String msg = "The instance map returned null by the key: key=" + tableFlexibleName + " instanceMap=" + _tableDbNameInstanceMap; throw new DBMetaNotFoundException(msg); @@ -179,8 +160,9 @@ assertStringNotNullAndNotTrimmedEmpty("tableDbName", tableDbName); DBMeta instance = getCachedDBMeta(tableDbName); if (instance == null) { - String msg = "The instance map returned null by the key: key=" - + tableDbName + " instanceMap=" + _tableDbNameInstanceMap; + String msg = "The instance map returned null by the key:"; + msg = msg + " key=" + tableDbName + " instanceMap=" + + _tableDbNameInstanceMap; throw new DBMetaNotFoundException(msg); } return instance; @@ -202,10 +184,25 @@ return _tableDbNameInstanceMap.get(tableName); } + protected static DBMeta getDBMeta(String className) { + try { + Class clazz = Class.forName(className); + Method methoz = clazz.getMethod("getInstance", (Class[]) null); + Object result = methoz.invoke(null, (Object[]) null); + return (DBMeta) result; + } catch (Exception e) { + throw new RuntimeException(e); + } + } + //========================================================================== // ========= // General Helper // ============== + protected static ConcurrentHashMap newConcurrentHashMap() { + return new ConcurrentHashMap(); + } + // ----------------------------------------------------- // Assert Object // ------------- Modified: userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/dbmeta/hierarchy/HierarchyArranger.java =================================================================== --- userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/dbmeta/hierarchy/HierarchyArranger.java 2008-12-26 22:11:31 UTC (rev 1622) +++ userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/dbmeta/hierarchy/HierarchyArranger.java 2008-12-27 22:02:56 UTC (rev 1623) @@ -222,7 +222,6 @@ * @author DBFlute(AutoGenerator) * @param The type of local entity extends Entity */ - ¡÷ SuppressWarnings("unchecked") public class HierarchyArranger { //========================================================================== @@ -457,9 +456,9 @@ List referrerList = extractReferrerList(localEntity, referrerInfo); if (referrerList == null) { - String msg = "The referrer list should not be null: localEntity=" - + localEntity + " referrerInfo=" + referrerInfo; - throw new IllegalStateException(msg); + // Initialize the list of referrer and inject it. + referrerList = new ArrayList(); + injectReferrerList(localEntity, referrerInfo, referrerList); } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -765,8 +764,8 @@ return capPropReferrerName; } - private java.lang.reflect.Method findMethod(Class clazz, String methodName, - Class[] argTypes) { + private java.lang.reflect.Method findMethod(Class clazz, + String methodName, Class[] argTypes) { try { return clazz.getMethod(methodName, argTypes); } catch (NoSuchMethodException ex) { @@ -852,10 +851,10 @@ return sb.toString(); } - private String createTypeViewFromTypeArray(Class[] array) { + private String createTypeViewFromTypeArray(Class[] array) { final StringBuffer sb = new StringBuffer(); for (int i = 0; i < array.length; i++) { - final Class type = array[i]; + final Class type = array[i]; if (sb.length() == 0) { sb.append(type.getSimpleName()); } else { Modified: userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/dbmeta/hierarchy/HierarchyRequest.java =================================================================== --- userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/dbmeta/hierarchy/HierarchyRequest.java 2008-12-26 22:11:31 UTC (rev 1622) +++ userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/dbmeta/hierarchy/HierarchyRequest.java 2008-12-27 22:02:56 UTC (rev 1623) @@ -16,7 +16,6 @@ * @author DBFlute(AutoGenerator) * @param The type of local entity. */ - ¡÷ SuppressWarnings("unchecked") public class HierarchyRequest { //========================================================================== Modified: userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/dbmeta/hierarchy/HierarchyRequestElement.java =================================================================== --- userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/dbmeta/hierarchy/HierarchyRequestElement.java 2008-12-26 22:11:31 UTC (rev 1622) +++ userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/dbmeta/hierarchy/HierarchyRequestElement.java 2008-12-27 22:02:56 UTC (rev 1623) @@ -9,7 +9,6 @@ /** * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public class HierarchyRequestElement { //========================================================================== Modified: userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/dbmeta/hierarchy/HierarchySourceColumn.java =================================================================== --- userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/dbmeta/hierarchy/HierarchySourceColumn.java 2008-12-26 22:11:31 UTC (rev 1622) +++ userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/dbmeta/hierarchy/HierarchySourceColumn.java 2008-12-27 22:02:56 UTC (rev 1623) @@ -3,7 +3,6 @@ /** * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public interface HierarchySourceColumn { public String getColumnName(); Modified: userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/dbmeta/hierarchy/HierarchySourceIterator.java =================================================================== --- userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/dbmeta/hierarchy/HierarchySourceIterator.java 2008-12-26 22:11:31 UTC (rev 1622) +++ userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/dbmeta/hierarchy/HierarchySourceIterator.java 2008-12-27 22:02:56 UTC (rev 1623) @@ -3,7 +3,6 @@ /** * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public interface HierarchySourceIterator { public boolean hasNext(); Modified: userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/dbmeta/hierarchy/HierarchySourceRow.java =================================================================== --- userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/dbmeta/hierarchy/HierarchySourceRow.java 2008-12-26 22:11:31 UTC (rev 1622) +++ userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/dbmeta/hierarchy/HierarchySourceRow.java 2008-12-27 22:02:56 UTC (rev 1623) @@ -3,7 +3,6 @@ /** * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public interface HierarchySourceRow { public Object extractColumnValue(HierarchySourceColumn columnInfo); Modified: userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/dbmeta/info/ColumnInfo.java =================================================================== --- userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/dbmeta/info/ColumnInfo.java 2008-12-26 22:11:31 UTC (rev 1622) +++ userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/dbmeta/info/ColumnInfo.java 2008-12-27 22:02:56 UTC (rev 1623) @@ -8,7 +8,6 @@ * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public class ColumnInfo { //========================================================================== Modified: userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/dbmeta/info/RelationInfo.java =================================================================== --- userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/dbmeta/info/RelationInfo.java 2008-12-26 22:11:31 UTC (rev 1622) +++ userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/dbmeta/info/RelationInfo.java 2008-12-27 22:02:56 UTC (rev 1623) @@ -1,13 +1,14 @@ package jp.sf.pal.userinfo.db.allcommon.dbmeta.info; +import java.util.Map; + import jp.sf.pal.userinfo.db.allcommon.dbmeta.DBMeta; /** - * The class of referer information. + * The class of referrer information. * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public interface RelationInfo { public String getRelationPropertyName(); @@ -16,7 +17,7 @@ public DBMeta getTargetDBMeta(); - public java.util.Map getLocalTargetColumnInfoMap(); + public Map getLocalTargetColumnInfoMap(); public boolean isOneToOne(); Modified: userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/helper/MapStringBuilderImpl.java =================================================================== --- userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/helper/MapStringBuilderImpl.java 2008-12-26 22:11:31 UTC (rev 1622) +++ userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/helper/MapStringBuilderImpl.java 2008-12-27 22:02:56 UTC (rev 1623) @@ -1,17 +1,20 @@ package jp.sf.pal.userinfo.db.allcommon.helper; +import java.util.Arrays; +import java.util.List; + import jp.sf.pal.userinfo.db.allcommon.helper.token.line.LineToken; import jp.sf.pal.userinfo.db.allcommon.helper.token.line.LineTokenizingOption; import jp.sf.pal.userinfo.db.allcommon.helper.token.line.impl.LineTokenImpl; /** - * The implementation of map-string-builder. + * The implementation of map-string builder. * * @author DBFlute(AutoGenerator) */ public class MapStringBuilderImpl implements MapStringBuilder { - protected java.util.List _columnNameList; + protected List _columnNameList; protected String _msMapMark; @@ -26,10 +29,10 @@ protected boolean _trimDoubleQuotation; public void setColumnNames(String[] columnNames) { - _columnNameList = java.util.Arrays.asList(columnNames); + _columnNameList = Arrays.asList(columnNames); } - public void setColumnNameList(java.util.List columnNameList) { + public void setColumnNameList(List columnNameList) { _columnNameList = columnNameList; } @@ -83,7 +86,7 @@ return sb.toString(); } - public String buildFromList(java.util.List valueList) { + public String buildFromList(List valueList) { if (valueList == null) { String msg = "The argument[valueList] should not be null."; throw new IllegalArgumentException(msg); @@ -103,7 +106,7 @@ return sb.toString(); } - protected java.util.List tokenize(String value, String delimiter) { + protected List tokenize(String value, String delimiter) { final LineToken lineToken = new LineTokenImpl(); final LineTokenizingOption lineTokenizingOption = new LineTokenizingOption(); lineTokenizingOption.setDelimiter(delimiter); @@ -144,8 +147,8 @@ } } - protected void assertColumnValueList(java.util.List columnNameList, - java.util.List valueList) { + protected void assertColumnValueList(List columnNameList, + List valueList) { if (columnNameList.size() != valueList.size()) { String msg = "The length of columnNameList and valueList are difference. (" + columnNameList.size() + ", " + valueList.size() + ")"; Added: userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/helper/StringKeyMap.java =================================================================== --- userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/helper/StringKeyMap.java (rev 0) +++ userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/helper/StringKeyMap.java 2008-12-27 22:02:56 UTC (rev 1623) @@ -0,0 +1,201 @@ +package jp.sf.pal.userinfo.db.allcommon.helper; + +import java.util.Collection; +import java.util.HashMap; +import java.util.Map; +import java.util.Set; +import java.util.concurrent.ConcurrentHashMap; + +/** + * @author DBFlute(AutoGenerator) + * @param The type of value. + */ +public class StringKeyMap implements Map { + + //========================================================================== + // ========= + // Attribute + // ========= + protected final Map _internalMap; + + protected boolean _removeUnderscore; + + //========================================================================== + // ========= + // Constructor + // =========== + protected StringKeyMap(boolean removeUnderscore, boolean concurrent) { + _removeUnderscore = removeUnderscore; + if (concurrent) { + _internalMap = newConcurrentHashMap(); + } else { + _internalMap = newHashMap(); + } + } + + public static StringKeyMap createAsFlexible() { + return new StringKeyMap(true, false); + } + + public static StringKeyMap createAsFlexibleConcurrent() { + return new StringKeyMap(true, true); + } + + public static StringKeyMap createAsCaseInsensitive() { + return new StringKeyMap(false, false); + } + + public static StringKeyMap createAsCaseInsensitiveConcurrent() { + return new StringKeyMap(false, true); + } + + //========================================================================== + // ========= + // Map Emulator + // ============ + // ----------------------------------------------------- + // Key Related + // ----------- + public VALUE get(Object key) { + final String stringKey = convertStringKey(key); + if (stringKey != null) { + return _internalMap.get(stringKey); + } + return null; + } + + public VALUE put(String key, VALUE value) { + final String stringKey = convertStringKey(key); + if (stringKey != null) { + return _internalMap.put(stringKey, value); + } + return null; + } + + public VALUE remove(Object key) { + final String stringKey = convertStringKey(key); + if (stringKey != null) { + return _internalMap.remove(stringKey); + } + return null; + } + + public final void putAll(Map map) { + final Set keySet = map.keySet(); + for (String key : keySet) { + put(key, map.get(key)); + } + } + + public boolean containsKey(Object key) { + return get(key) != null; + } + + // ----------------------------------------------------- + // Delegate + // -------- + public void clear() { + _internalMap.clear(); + } + + public int size() { + return _internalMap.size(); + } + + public boolean isEmpty() { + return _internalMap.isEmpty(); + } + + public Set keySet() { + return _internalMap.keySet(); + } + + public Collection values() { + return _internalMap.values(); + } + + public boolean containsValue(Object obj) { + return _internalMap.containsValue(obj); + } + + public Set> entrySet() { + return _internalMap.entrySet(); + } + + //========================================================================== + // ========= + // Key Converter + // ============= + protected String convertStringKey(Object key) { + if (!(key instanceof String)) { + return null; + } + return toLowerCase(removeUnderscore((String) key)); + } + + protected String removeUnderscore(String value) { + if (_removeUnderscore) { + return replace(value, "_", ""); + } + return value; + } + + protected String toLowerCase(String value) { + return value.toLowerCase(); + } + + //========================================================================== + // ========= + // General Helper + // ============== + protected static String replace(String text, String fromText, String toText) { + if (text == null || fromText == null || toText == null) { + return null; + } + StringBuilder sb = new StringBuilder(100); + int pos = 0; + int pos2 = 0; + while (true) { + pos = text.indexOf(fromText, pos2); + if (pos == 0) { + sb.append(toText); + pos2 = fromText.length(); + } else if (pos > 0) { + sb.append(text.substring(pos2, pos)); + sb.append(toText); + pos2 = pos + fromText.length(); + } else { + sb.append(text.substring(pos2)); + break; + } + } + return sb.toString(); + } + + protected static ConcurrentHashMap newConcurrentHashMap() { + return new ConcurrentHashMap(); + } + + protected static HashMap newHashMap() { + return new HashMap(); + } + + //========================================================================== + // ========= + // Basic Override + // ============== + @Override + public boolean equals(Object obj) { + return _internalMap.equals(obj); + } + + @Override + public int hashCode() { + return _internalMap.hashCode(); + } + + @Override + public String toString() { + return _internalMap.toString(); + } +} \ No newline at end of file Property changes on: userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/helper/StringKeyMap.java ___________________________________________________________________ Name: svn:eol-style + native Added: userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/helper/StringSet.java =================================================================== --- userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/helper/StringSet.java (rev 0) +++ userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/helper/StringSet.java 2008-12-27 22:02:56 UTC (rev 1623) @@ -0,0 +1,233 @@ +package jp.sf.pal.userinfo.db.allcommon.helper; + +import java.util.Collection; +import java.util.HashMap; +import java.util.Iterator; +import java.util.Map; +import java.util.Set; +import java.util.concurrent.ConcurrentHashMap; + +/** + * @author DBFlute(AutoGenerator) + */ +public class StringSet implements Set { + + //========================================================================== + // ========= + // Definition + // ========== + protected static final Object DUMMY_VALUE = new Object(); + + //========================================================================== + // ========= + // Attribute + // ========= + protected final Map _internalMap; + + protected boolean _removeUnderscore; + + //========================================================================== + // ========= + // Constructor + // =========== + protected StringSet(boolean removeUnderscore, boolean concurrent) { + _removeUnderscore = removeUnderscore; + if (concurrent) { + _internalMap = newConcurrentHashMap(); + } else { + _internalMap = newHashMap(); + } + } + + public static StringSet createAsFlexible() { + return new StringSet(true, false); + } + + public static StringSet createAsFlexibleConcurrent() { + return new StringSet(true, true); + } + + public static StringSet createAsCaseInsensitive() { + return new StringSet(false, false); + } + + public static StringSet createAsCaseInsensitiveConcurrent() { + return new StringSet(false, true); + } + + //========================================================================== + // ========= + // Map Emulator + // ============ + // ----------------------------------------------------- + // Key Related + // ----------- + public boolean add(String value) { + final String stringValue = convertStringKey(value); + if (stringValue != null) { + return _internalMap.put(stringValue, DUMMY_VALUE) != null; + } + return false; + } + + public boolean remove(Object value) { + final String stringValue = convertStringKey(value); + if (stringValue != null) { + return _internalMap.remove(stringValue) != null; + } + return false; + } + + public boolean contains(Object value) { + final String stringValue = convertStringKey(value); + if (stringValue != null) { + return _internalMap.containsKey(stringValue); + } + return false; + } + + // ----------------------------------------------------- + // Delegate + // -------- + public void clear() { + _internalMap.clear(); + } + + public int size() { + return _internalMap.size(); + } + + public boolean isEmpty() { + return _internalMap.isEmpty(); + } + + public boolean addAll(Collection c) { + boolean success = false; + for (String s : c) { + if (add(s)) { + success = true; + } + } + return success; + } + + public boolean removeAll(Collection c) { + boolean success = false; + for (Object s : c) { + if (remove(s)) { + success = true; + } + } + return success; + } + + public boolean containsAll(Collection c) { + for (Object s : c) { + if (contains(s)) { + return true; + } + } + return false; + } + + public Iterator iterator() { + return _internalMap.keySet().iterator(); + } + + public boolean retainAll(Collection c) { + boolean success = false; + for (Object s : c) { + if (!contains(s)) { + if (remove(s)) { + success = true; + } + } + } + return success; + } + + public Object[] toArray() { + return _internalMap.keySet().toArray(); + } + + public T[] toArray(T[] a) { + return _internalMap.keySet().toArray(a); + } + + //========================================================================== + // ========= + // Key Converter + // ============= + protected String convertStringKey(Object value) { + if (!(value instanceof String)) { + return null; + } + return toLowerCase(removeUnderscore((String) value)); + } + + protected String removeUnderscore(String value) { + if (_removeUnderscore) { + return replace(value, "_", ""); + } + return value; + } + + protected String toLowerCase(String value) { + return value.toLowerCase(); + } + + //========================================================================== + // ========= + // General Helper + // ============== + protected static String replace(String text, String fromText, String toText) { + if (text == null || fromText == null || toText == null) { + return null; + } + StringBuilder sb = new StringBuilder(100); + int pos = 0; + int pos2 = 0; + while (true) { + pos = text.indexOf(fromText, pos2); + if (pos == 0) { + sb.append(toText); + pos2 = fromText.length(); + } else if (pos > 0) { + sb.append(text.substring(pos2, pos)); + sb.append(toText); + pos2 = pos + fromText.length(); + } else { + sb.append(text.substring(pos2)); + break; + } + } + return sb.toString(); + } + + protected static ConcurrentHashMap newConcurrentHashMap() { + return new ConcurrentHashMap(); + } + + protected static HashMap newHashMap() { + return new HashMap(); + } + + //========================================================================== + // ========= + // Basic Override + // ============== + @Override + public boolean equals(Object obj) { + return _internalMap.keySet().equals(obj); + } + + @Override + public int hashCode() { + return _internalMap.keySet().hashCode(); + } + + @Override + public String toString() { + return _internalMap.keySet().toString(); + } +} \ No newline at end of file Property changes on: userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/helper/StringSet.java ___________________________________________________________________ Name: svn:eol-style + native Added: userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/s2dao/BeanMetaDataFactoryExtension.java =================================================================== --- userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/s2dao/BeanMetaDataFactoryExtension.java (rev 0) +++ userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/s2dao/BeanMetaDataFactoryExtension.java 2008-12-27 22:02:56 UTC (rev 1623) @@ -0,0 +1,213 @@ +package jp.sf.pal.userinfo.db.allcommon.s2dao; + +import java.sql.DatabaseMetaData; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.concurrent.ConcurrentHashMap; + +import jp.sf.pal.userinfo.db.allcommon.Entity; +import jp.sf.pal.userinfo.db.allcommon.s2dao.internal.various.InternalIdentifierGeneratorFactory; + +import org.seasar.dao.BeanMetaData; +import org.seasar.dao.IdentifierGenerator; +import org.seasar.dao.impl.BeanMetaDataFactoryImpl; +import org.seasar.dao.impl.BeanMetaDataImpl; +import org.seasar.extension.jdbc.PropertyType; +import org.seasar.framework.beans.PropertyDesc; + +/** + * BeanMetaDataFactoryImpl for DBFlute. + * + * @author DBFlute(AutoGenerator) + */ + ¡÷ SuppressWarnings("unchecked") +public class BeanMetaDataFactoryExtension extends BeanMetaDataFactoryImpl { + + //========================================================================== + // ========= + // Attribute + // ========= + /** The map of bean meta data for cache. */ + protected Map, BeanMetaData> _metaMap = newConcurrentHashMap(); + + //========================================================================== + // ========= + // Override for Cache + // ================== + @Override + public BeanMetaData createBeanMetaData(Class beanClass) { + final BeanMetaData cachedMeta = findCachedMeta(beanClass); + if (cachedMeta != null) { + return cachedMeta; + } else { + return super.createBeanMetaData(beanClass); + } + } + + @Override + public BeanMetaData createBeanMetaData(Class beanClass, + int relationNestLevel) { + final BeanMetaData cachedMeta = findCachedMeta(beanClass); + if (cachedMeta != null) { + return cachedMeta; + } else { + return super.createBeanMetaData(beanClass, relationNestLevel); + } + } + + @Override + public BeanMetaData createBeanMetaData(DatabaseMetaData dbMetaData, + Class beanClass, int relationNestLevel) { + final BeanMetaData cachedMeta = findOrCreateCachedMetaIfNeeds( + dbMetaData, beanClass, relationNestLevel); + if (cachedMeta != null) { + return cachedMeta; + } else { + return super.createBeanMetaData(dbMetaData, beanClass, + relationNestLevel); + } + } + + protected BeanMetaData findCachedMeta(Class beanClass) { + if (isDBFluteEntity(beanClass)) { + final BeanMetaData cachedMeta = getMetaFromCache(beanClass); + if (cachedMeta != null) { + return cachedMeta; + } + } + return null; + } + + protected BeanMetaData findOrCreateCachedMetaIfNeeds( + DatabaseMetaData dbMetaData, Class beanClass, int relationNestLevel) { + if (isDBFluteEntity(beanClass)) { + final BeanMetaData cachedMeta = getMetaFromCache(beanClass); + if (cachedMeta != null) { + return cachedMeta; + } else { + return super.createBeanMetaData(dbMetaData, beanClass, 0); + } + } + return null; + } + + //========================================================================== + // ========= + // BeanMetaData Creation + // ===================== + @Override + protected BeanMetaDataImpl createBeanMetaDataImpl() { + // /= = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = + // = = + // for ConditionBean and insert() and update() and delete() and so on... + // = = = = = = = = = =/ + return new BeanMetaDataImpl() { + protected List _internalIdentifierGeneratorList = new ArrayList(); + + protected Map _internalIdentifierGeneratorsByPropertyName = newConcurrentHashMap(); + + // /= = = = = = = + // for cache + // = = = = =/ + @Override + public void initialize() { // for Cache + final Class myBeanClass = getBeanClass(); + if (isDBFluteEntity(myBeanClass)) { + final BeanMetaData cachedMeta = getMetaFromCache(myBeanClass); + if (cachedMeta == null) { + _metaMap.put(myBeanClass, this); + } + } + super.initialize(); + } + + // /= = = = = = = + // for insert() + // = = = = =/ + // The attributes 'identifierGenerators' and + // 'identifierGeneratorsByPropertyName' + // of super class are unused. It prepares original atributes here. + @Override + protected void setupIdentifierGenerator(PropertyType propertyType) { + final PropertyDesc pd = propertyType.getPropertyDesc(); + final String propertyName = propertyType.getPropertyName(); + final String idType = beanAnnotationReader.getId(pd, getDbms()); + final IdentifierGenerator generator = createInternalIdentifierGenerator( + propertyType, idType); + _internalIdentifierGeneratorList.add(generator); + _internalIdentifierGeneratorsByPropertyName.put(propertyName, + generator); + } + + protected IdentifierGenerator createInternalIdentifierGenerator( + PropertyType propertyType, String idType) { + return InternalIdentifierGeneratorFactory + .createIdentifierGenerator(propertyType, getDbms(), + idType); + } + + @Override + public IdentifierGenerator getIdentifierGenerator(int index) { + return _internalIdentifierGeneratorList.get(index); + } + + @Override + public int getIdentifierGeneratorSize() { + return _internalIdentifierGeneratorList.size(); + } + + @Override + public IdentifierGenerator getIdentifierGenerator( + String propertyName) { + return _internalIdentifierGeneratorsByPropertyName + .get(propertyName); + } + }; + } + + // /= = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = + // Other extension points about BeanMetaDataImpl is as follows: + // + // S2DaoMetaDataExtension.createNonConcurrencyBmdFactory() + // --> for NonConcurrency (updateNonstrict() and deleteNonstrict() and so + // on...) + // + // S2DaoMetaDataExtension.createOutsideSqlCustomizeBeanMetaDataFactory() + // --> for OutsideSql but it overrides nothing. + // = = = = = = = = = =/ + + //========================================================================== + // ========= + // Relation Next Level + // =================== + /** + * Get the limit nest level of relation. + * + * @return The limit nest level of relation. + */ + @Override + protected int getLimitRelationNestLevel() { + return 2; // for Compatible to old version DBFlute + } + + //========================================================================== + // ========= + // General Helper + // ============== + protected ConcurrentHashMap newConcurrentHashMap() { + return new ConcurrentHashMap(); + } + + //========================================================================== + // ========= + // Assist Helper + // ============= + protected boolean isDBFluteEntity(Class beanClass) { + return Entity.class.isAssignableFrom(beanClass); + } + + protected BeanMetaData getMetaFromCache(Class beanClass) { + return _metaMap.get(beanClass); + } +} \ No newline at end of file Property changes on: userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/s2dao/BeanMetaDataFactoryExtension.java ___________________________________________________________________ Name: svn:eol-style + native Deleted: userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/s2dao/FetchNarrowingResultSetFactory.java =================================================================== --- userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/s2dao/FetchNarrowingResultSetFactory.java 2008-12-26 22:11:31 UTC (rev 1622) +++ userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/s2dao/FetchNarrowingResultSetFactory.java 2008-12-27 22:02:56 UTC (rev 1623) @@ -1,125 +0,0 @@ -package jp.sf.pal.userinfo.db.allcommon.s2dao; - -import java.sql.PreparedStatement; -import java.sql.ResultSet; -import java.sql.SQLException; -import java.sql.Statement; - -import jp.sf.pal.userinfo.db.allcommon.s2dao.internal.sqlhandler.InternalBasicHandler.SQLExceptionHandler; - -import org.seasar.extension.jdbc.ResultSetFactory; - -/** - * This is unused in DBFlute so this is very NORMAL result-set-factory for - * S2Dao. - * - * @author DBFlute(AutoGenerator) - */ -public class FetchNarrowingResultSetFactory implements ResultSetFactory { - - //========================================================================== - // ========= - // Constructor - // =========== - /** - * Constructor. - */ - public FetchNarrowingResultSetFactory() { - } - - //========================================================================== - // ========= - // Main - // ==== - /** - * Get result set. - * - * @param statement Statement. (NotNull) - * @return Result set for procedure executing of s2dao. (NotNull) - */ - public ResultSet getResultSet(Statement statement) { // Unused in DBFlute - return doGetResultSet(statement); - } - - /** - * Create result set. - * - * @param ps Prepared statement. (NotNull) - * @return Result set. (NotNull) - */ - public ResultSet createResultSet(PreparedStatement ps) { // Unused in - // DBFlute - return executeQuery(ps); - - // *Move to InternalBasicSelectHandler - // if (!FetchNarrowingBeanContext.isExistFetchNarrowingBeanOnThread()) { - // return resultSet; - // } - // final FetchNarrowingBean cb = - // FetchNarrowingBeanContext.getFetchNarrowingBeanOnThread(); - // if (!isUseFetchNarrowingResultSetWrapper(cb)) { - // return resultSet; - // } - // final FetchNarrowingResultSetWrapper wrapper; - // if (OutsideSqlContext.isExistOutsideSqlContextOnThread()) { - // final OutsideSqlContext outsideSqlContext = - // OutsideSqlContext.getOutsideSqlContextOnThread(); - // wrapper = new FetchNarrowingResultSetWrapper(resultSet, cb, - // outsideSqlContext.isOffsetByCursorForcedly(), - // outsideSqlContext.isLimitByCursorForcedly()); - // } else { - // wrapper = new FetchNarrowingResultSetWrapper(resultSet, cb, false, - // false); - // } - // return wrapper; - } - - // protected boolean isUseFetchNarrowingResultSetWrapper(FetchNarrowingBean - // cb) { - // if (cb.getSafetyMaxResultSize() > 0) { - // return true; - // } - // if (!cb.isFetchNarrowingEffective()) { - // return false;// It is not necessary to control. - // } - // if (OutsideSqlContext.isExistOutsideSqlContextOnThread()) { - // final OutsideSqlContext outsideSqlContext = - // OutsideSqlContext.getOutsideSqlContextOnThread(); - // if (outsideSqlContext.isOffsetByCursorForcedly() || - // outsideSqlContext.isLimitByCursorForcedly()) { - // return true; - // } - // } - // if (cb.isFetchNarrowingSkipStartIndexEffective() || - // cb.isFetchNarrowingLoopCountEffective()) { - // return true; - // } - // return false; - // } - - //========================================================================== - // ========= - // JDBC Delegator - // ============== - protected ResultSet doGetResultSet(Statement statement) { - try { - return statement.getResultSet(); - } catch (SQLException e) { - handleSQLException(e, statement); - return null;// Unreachable! - } - } - - protected ResultSet executeQuery(PreparedStatement ps) { - try { - return ps.executeQuery(); - } catch (SQLException e) { - handleSQLException(e, ps); - return null;// Unreachable! - } - } - - protected void handleSQLException(SQLException e, Statement statement) { - new SQLExceptionHandler().handleSQLException(e, statement); - } -} Modified: userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/s2dao/FetchNarrowingResultSetWrapper.java =================================================================== --- userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/s2dao/FetchNarrowingResultSetWrapper.java 2008-12-26 22:11:31 UTC (rev 1622) +++ userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/s2dao/FetchNarrowingResultSetWrapper.java 2008-12-27 22:02:56 UTC (rev 1623) @@ -4,6 +4,7 @@ import java.sql.SQLException; import java.sql.Statement; +import jp.sf.pal.userinfo.db.allcommon.DBDef; import jp.sf.pal.userinfo.db.allcommon.cbean.FetchNarrowingBean; import jp.sf.pal.userinfo.db.allcommon.s2dao.internal.sqlhandler.InternalBasicHandler.SQLExceptionHandler; @@ -41,6 +42,9 @@ /** Does it skip to cursor end? */ protected boolean _skipToCursorEnd; + /** Is the database DB2? */ + protected final boolean _db2 = DBDef.isCurrentDef(DBDef.DB2); + //========================================================================== // ========= // Constructor @@ -71,7 +75,7 @@ // Skip // ==== /** - * Skip to start-index. + * Skip to the point at start index. */ protected void skip() { if (!isAvailableSkipRecord()) { @@ -125,12 +129,15 @@ // Next // ==== /** - * Next. + * Move to the next record. * * @return Does the result set have next record? * @throws SQLException */ public boolean next() throws SQLException { + if (_db2 && _skipToCursorEnd) { // [DBFLUTE-243] + return false; + } final boolean hasNext = super.next(); ++_requestCounter; if (!isAvailableLimitLoopCount()) { Added: userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/s2dao/PropertyTypeFactoryBuilderExtension.java =================================================================== --- userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/s2dao/PropertyTypeFactoryBuilderExtension.java (rev 0) +++ userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/s2dao/PropertyTypeFactoryBuilderExtension.java 2008-12-27 22:02:56 UTC (rev 1623) @@ -0,0 +1,215 @@ +package jp.sf.pal.userinfo.db.allcommon.s2dao; + +import java.sql.DatabaseMetaData; +import java.util.ArrayList; +import java.util.List; + +import jp.sf.pal.userinfo.db.allcommon.Entity; +import jp.sf.pal.userinfo.db.allcommon.dbmeta.DBMeta; + +import org.seasar.dao.BeanAnnotationReader; +import org.seasar.dao.ColumnNaming; +import org.seasar.dao.Dbms; +import org.seasar.dao.PropertyTypeFactory; +import org.seasar.dao.PropertyTypeFactoryBuilder; +import org.seasar.dao.ValueTypeFactory; +import org.seasar.dao.impl.AbstractPropertyTypeFactory; +import org.seasar.extension.jdbc.PropertyType; +import org.seasar.framework.beans.BeanDesc; +import org.seasar.framework.beans.PropertyDesc; + +/** + * The factory builder of property type for S2Dao. {Since S2Dao-1.0.47} + * + * @author DBFlute(AutoGenerator) + */ + ¡÷ SuppressWarnings("unchecked") +public class PropertyTypeFactoryBuilderExtension implements + PropertyTypeFactoryBuilder { + + //========================================================================== + // ========= + // Attribute + // ========= + protected ValueTypeFactory valueTypeFactory; + + protected ColumnNaming columnNaming; + + //========================================================================== + // ========= + // Build + // ===== + public PropertyTypeFactory build(Class beanClass, + BeanAnnotationReader beanAnnotationReader) { + return new FastPropertyTypeFactoryExtension(beanClass, + beanAnnotationReader, valueTypeFactory, columnNaming); + } + + public PropertyTypeFactory build(Class beanClass, + BeanAnnotationReader beanAnnotationReader, Dbms dbms, + DatabaseMetaData databaseMetaData) { + return new FastPropertyTypeFactoryExtension(beanClass, + beanAnnotationReader, valueTypeFactory, columnNaming, dbms); + } + + //========================================================================== + // ========= + // Extension Class + // =============== + protected static class FastPropertyTypeFactoryExtension extends + AbstractPropertyTypeFactory { + + protected DBMeta _dbmeta; + + protected String[] _noPersisteneProps; + + public FastPropertyTypeFactoryExtension(Class beanClass, + BeanAnnotationReader beanAnnotationReader, + ValueTypeFactory valueTypeFactory, ColumnNaming columnNaming) { + super(beanClass, beanAnnotationReader, valueTypeFactory, + columnNaming); + initializeResources(); + } + + public FastPropertyTypeFactoryExtension(Class beanClass, + BeanAnnotationReader beanAnnotationReader, + ValueTypeFactory valueTypeFactory, ColumnNaming columnNaming, + Dbms dbms) { + super(beanClass, beanAnnotationReader, valueTypeFactory, + columnNaming, dbms); + initializeResources(); + } + + protected void initializeResources() { + if (isEntity()) { + _dbmeta = findDBMeta(); + } + _noPersisteneProps = beanAnnotationReader.getNoPersisteneProps(); + } + + protected boolean isEntity() { + return Entity.class.isAssignableFrom(beanClass); + } + + protected boolean hasDBMeta() { + return _dbmeta != null; + } + + protected DBMeta findDBMeta() { + try { + final Entity entity = (Entity) beanClass.newInstance(); + return entity.getDBMeta(); + } catch (Exception e) { + String msg = "beanClass.newInstance() threw the exception: beanClass=" + + beanClass; + throw new RuntimeException(msg, e); + } + } + + public PropertyType[] createBeanPropertyTypes(String tableName) { + final List list = new ArrayList(); + 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: userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/s2dao/PropertyTypeFactoryBuilderExtension.java ___________________________________________________________________ Name: svn:eol-style + native Deleted: userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/s2dao/S2BeanMetaDataFactoryImpl.java =================================================================== --- userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/s2dao/S2BeanMetaDataFactoryImpl.java 2008-12-26 22:11:31 UTC (rev 1622) +++ userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/s2dao/S2BeanMetaDataFactoryImpl.java 2008-12-27 22:02:56 UTC (rev 1623) @@ -1,116 +0,0 @@ -package jp.sf.pal.userinfo.db.allcommon.s2dao; - -import java.sql.DatabaseMetaData; -import java.util.Collections; -import java.util.HashMap; -import java.util.Map; - -import jp.sf.pal.userinfo.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, BeanMetaData> _metaMap = Collections - .synchronizedMap(new HashMap, BeanMetaData>()); - - @Override - public BeanMetaData createBeanMetaData(Class beanClass) { - final BeanMetaData cachedMeta = findCachedMeta(beanClass); - if (cachedMeta != null) { - return cachedMeta; - } else { - return super.createBeanMetaData(beanClass); - } - } - - @Override - public BeanMetaData createBeanMetaData(Class beanClass, - int relationNestLevel) { - final BeanMetaData cachedMeta = findCachedMeta(beanClass); - if (cachedMeta != null) { - return cachedMeta; - } else { - return super.createBeanMetaData(beanClass, relationNestLevel); - } - } - - @Override - public BeanMetaData createBeanMetaData(DatabaseMetaData dbMetaData, - Class beanClass, int relationNestLevel) { - final BeanMetaData cachedMeta = findOrCreateCachedMetaIfNeeds( - dbMetaData, beanClass, relationNestLevel); - if (cachedMeta != null) { - return cachedMeta; - } else { - return super.createBeanMetaData(dbMetaData, beanClass, - relationNestLevel); - } - } - - protected BeanMetaData findCachedMeta(Class beanClass) { - if (isDBFluteEntity(beanClass)) { - final BeanMetaData cachedMeta = getMetaFromCache(beanClass); - if (cachedMeta != null) { - return cachedMeta; - } - } - return null; - } - - protected BeanMetaData findOrCreateCachedMetaIfNeeds( - DatabaseMetaData dbMetaData, Class beanClass, int relationNestLevel) { - if (isDBFluteEntity(beanClass)) { - final BeanMetaData cachedMeta = getMetaFromCache(beanClass); - if (cachedMeta != null) { - return cachedMeta; - } else { - return super.createBeanMetaData(dbMetaData, beanClass, 0); - } - } - return null; - } - - @Override - protected BeanMetaDataImpl createBeanMetaDataImpl() { - return new BeanMetaDataImpl() { - @Override - public void initialize() { - final Class myBeanClass = getBeanClass(); - if (isDBFluteEntity(myBeanClass)) { - final BeanMetaData cachedMeta = getMetaFromCache(myBeanClass); - if (cachedMeta == null) { - _metaMap.put(myBeanClass, this); - } - } - super.initialize(); - } - }; - } - - protected boolean isDBFluteEntity(Class beanClass) { - return Entity.class.isAssignableFrom(beanClass); - } - - protected BeanMetaData getMetaFromCache(Class beanClass) { - return _metaMap.get(beanClass); - } - - /** - * Get the limit nest level of relation. - * - * @return The limit nest level of relation. - */ - @Override - protected int getLimitRelationNestLevel() { - return 2;// for Compatible to old version DBFlute - } -} \ No newline at end of file Deleted: userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/s2dao/S2DaoInterceptor.java =================================================================== --- userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/s2dao/S2DaoInterceptor.java 2008-12-26 22:11:31 UTC (rev 1622) +++ userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/s2dao/S2DaoInterceptor.java 2008-12-27 22:02:56 UTC (rev 1623) @@ -1,1027 +0,0 @@ -package jp.sf.pal.userinfo.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.userinfo.db.allcommon.Entity; -import jp.sf.pal.userinfo.db.allcommon.InternalMapContext; -import jp.sf.pal.userinfo.db.allcommon.XLog; -import jp.sf.pal.userinfo.db.allcommon.cbean.ConditionBean; -import jp.sf.pal.userinfo.db.allcommon.cbean.ConditionBeanContext; -import jp.sf.pal.userinfo.db.allcommon.cbean.FetchNarrowingBean; -import jp.sf.pal.userinfo.db.allcommon.cbean.FetchNarrowingBeanContext; -import jp.sf.pal.userinfo.db.allcommon.cbean.outsidesql.OutsideSqlContext; -import jp.sf.pal.userinfo.db.allcommon.cbean.outsidesql.OutsideSqlDao; -import jp.sf.pal.userinfo.db.allcommon.cbean.outsidesql.OutsideSqlOption; -import jp.sf.pal.userinfo.db.allcommon.dbmeta.DBMeta; -import jp.sf.pal.userinfo.db.allcommon.dbmeta.DBMetaInstanceHandler; -import jp.sf.pal.userinfo.db.allcommon.exception.EntityAlreadyUpdatedException; -import jp.sf.pal.userinfo.db.allcommon.helper.stacktrace.InvokeNameExtractingResource; -import jp.sf.pal.userinfo.db.allcommon.helper.stacktrace.InvokeNameResult; -import jp.sf.pal.userinfo.db.allcommon.helper.stacktrace.impl.InvokeNameExtractorImpl; -import jp.sf.pal.userinfo.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 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 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 suffixList = Arrays.asList(new String[] { "Bhv", - "BehaviorReadable", "BehaviorWritable", "PagingInvoker" }); - final List keywordList = Arrays.asList(new String[] { "Bhv$", - "BehaviorReadable$", "BehaviorWritable$" }); - final List ousideSql1List = Arrays - .asList(new String[] { "OutsideSql" }); - final List ousideSql2List = Arrays - .asList(new String[] { "Executor" }); - final List 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 suffixList) { - for (String suffix : suffixList) { - if (className.endsWith(suffix)) { - return true; - } - } - return false; - } - - protected boolean isClassNameContains(String className, - List 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 outsideSqlType = jp.sf.pal.userinfo.db.allcommon.annotation.OutsideSql.class; - final jp.sf.pal.userinfo.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. - *

- * If this method is condition bean select target, make dynamic SQL. Else - * nothing. - * - * @param invocation Method invocation. (NotNull) - * @return ConditionBean. (Nullable) - */ - protected ConditionBean preprocessConditionBean(MethodInvocation invocation) { - final OutsideSqlContext outsideSqlContext = getOutsideSqlContext(); - if (outsideSqlContext != null) { - return null; // Because it has already finished setting up - // fetchNarrowingBean for outsideSql here. - } - - final ConditionBean cb; - { - final Object[] args = invocation.getArguments(); - if (args == null || args.length == 0) { - return null; - } - final Object arg0 = args[0]; - if (arg0 == null) { - return null; - } - if (!ConditionBeanContext.isTheTypeConditionBean(arg0.getClass())) {// The - // argument - // is - // not - // condition - // - - // bean - // ... - if (FetchNarrowingBeanContext.isTheTypeFetchNarrowingBean(arg0 - .getClass()) - && !isSelectCountIgnoreFetchScopeMethod(invocation)) { - // Fetch-narrowing-bean and Not select count! - FetchNarrowingBeanContext - .setFetchNarrowingBeanOnThread((FetchNarrowingBean) arg0); - } - return null; - } - cb = (ConditionBean) arg0; - } - - if (isSelectCountIgnoreFetchScopeMethod(invocation)) { - cb.xsetupSelectCountIgnoreFetchScope(); - } else { - FetchNarrowingBeanContext.setFetchNarrowingBeanOnThread(cb); - } - - ConditionBeanContext.setConditionBeanOnThread(cb); - return cb; - } - - /** - * Post-process condition-bean. - * - * @param invocation Method invocation. (NotNull) - * @param cb Condition-bean. (Nullable) - */ - protected void postprocessConditionBean(MethodInvocation invocation, - ConditionBean cb) { - if (cb == null) { - return; - } - if (isSelectCountIgnoreFetchScopeMethod(invocation)) { - cb.xafterCareSelectCountIgnoreFetchScope(); - } - } - - // ----------------------------------------------------- - // Clear Thread Local - // ------------------ - protected void clearThreadLocal() { - if (OutsideSqlContext.isExistOutsideSqlContextOnThread()) { - OutsideSqlContext.clearOutsideSqlContextOnThread(); - } - if (FetchNarrowingBeanContext.isExistFetchNarrowingBeanOnThread()) { - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - // Because there is possible that fetch narrowing has been ignored - // for manualPaging of outsideSql. - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - FetchNarrowingBeanContext.getFetchNarrowingBeanOnThread() - .restoreIgnoredFetchNarrowing(); - - FetchNarrowingBeanContext.clearFetchNarrowingBeanOnThread(); - } - if (ConditionBeanContext.isExistConditionBeanOnThread()) { - ConditionBeanContext.clearConditionBeanOnThread(); - } - if (InternalMapContext.isExistInternalMapContextOnThread()) { - InternalMapContext.clearInternalMapContextOnThread(); - } - } - - //========================================================================== - // ========= - // Context Helper - // ============== - protected OutsideSqlContext getOutsideSqlContext() { - if (!OutsideSqlContext.isExistOutsideSqlContextOnThread()) { - return null; - } - return OutsideSqlContext.getOutsideSqlContextOnThread(); - } - - protected boolean isSpecifiedOutsideSql() { - final OutsideSqlContext outsideSqlContext = getOutsideSqlContext(); - return outsideSqlContext != null - && outsideSqlContext.isSpecifiedOutsideSql(); - } - - protected void putObjectToMapContext(String key, Object value) { - InternalMapContext.setObject(key, value); - } - - //========================================================================== - // ========= - // Determination - // ============= - /** - * Is select count ignore-fetch-scope method? - * - * @param invocation Method invocation. (NotNull) - * @return Determination. - */ - protected boolean isSelectCountIgnoreFetchScopeMethod( - MethodInvocation invocation) { - final String name = invocation.getMethod().getName(); - return name.startsWith("readCount") || name.startsWith("selectCount"); - } - - //========================================================================== - // ========= - // General Helper - // ============== - /** - * Is the method abstract? - * - * @param method Method. (NotNull) - * @return Determination. (NotNull) - */ - public boolean isAbstract(Method method) { - final int mod = method.getModifiers(); - return Modifier.isAbstract(mod); - } - - /** - * Get the value of line separator. - * - * @return The value of line separator. (NotNull) - */ - protected String getLineSeparator() { - return System.getProperty("line.separator"); - } -} \ No newline at end of file Deleted: userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/s2dao/S2DaoLatestSqlProvider.java =================================================================== --- userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/s2dao/S2DaoLatestSqlProvider.java 2008-12-26 22:11:31 UTC (rev 1622) +++ userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/s2dao/S2DaoLatestSqlProvider.java 2008-12-27 22:02:56 UTC (rev 1623) @@ -1,20 +0,0 @@ -package jp.sf.pal.userinfo.db.allcommon.s2dao; - -import jp.sf.pal.userinfo.db.allcommon.jdbc.LatestSqlProvider; -import jp.sf.pal.userinfo.db.allcommon.s2dao.internal.sqllog.InternalSqlLogRegistry; - -/** - * The provider of latest SQL as S2Dao. This instance should be singleton. - * - * @author DBFlute(AutoGenerator) - */ -public class S2DaoLatestSqlProvider implements LatestSqlProvider { - - public String getDisplaySql() { - return InternalSqlLogRegistry.peekCompleteSql(); - } - - public void clearSqlCache() { - InternalSqlLogRegistry.clearSqlLogRegistry(); - } -} Deleted: userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/s2dao/S2DaoMetaDataExtension.java =================================================================== --- userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/s2dao/S2DaoMetaDataExtension.java 2008-12-26 22:11:31 UTC (rev 1622) +++ userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/s2dao/S2DaoMetaDataExtension.java 2008-12-27 22:02:56 UTC (rev 1623) @@ -1,1460 +0,0 @@ -package jp.sf.pal.userinfo.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.userinfo.db.allcommon.BehaviorSelector; -import jp.sf.pal.userinfo.db.allcommon.Entity; -import jp.sf.pal.userinfo.db.allcommon.annotation.OutsideSql; -import jp.sf.pal.userinfo.db.allcommon.cbean.ConditionBean; -import jp.sf.pal.userinfo.db.allcommon.cbean.ConditionBeanContext; -import jp.sf.pal.userinfo.db.allcommon.cbean.outsidesql.OutsideSqlContext; -import jp.sf.pal.userinfo.db.allcommon.dbmeta.DBMeta; -import jp.sf.pal.userinfo.db.allcommon.exception.BatchEntityAlreadyUpdatedException; -import jp.sf.pal.userinfo.db.allcommon.exception.EntityAlreadyDeletedException; -import jp.sf.pal.userinfo.db.allcommon.exception.EntityDuplicatedException; -import jp.sf.pal.userinfo.db.allcommon.jdbc.CursorHandler; -import jp.sf.pal.userinfo.db.allcommon.s2dao.internal.rshandler.InternalBeanArrayMetaDataResultSetHandler; -import jp.sf.pal.userinfo.db.allcommon.s2dao.internal.rshandler.InternalBeanListMetaDataResultSetHandler; -import jp.sf.pal.userinfo.db.allcommon.s2dao.internal.sqlcommand.InternalDeleteAutoStaticCommand; -import jp.sf.pal.userinfo.db.allcommon.s2dao.internal.sqlcommand.InternalDeleteBatchAutoStaticCommand; -import jp.sf.pal.userinfo.db.allcommon.s2dao.internal.sqlcommand.InternalDeleteQueryAutoDynamicCommand; -import jp.sf.pal.userinfo.db.allcommon.s2dao.internal.sqlcommand.InternalInsertAutoDynamicCommand; -import jp.sf.pal.userinfo.db.allcommon.s2dao.internal.sqlcommand.InternalInsertBatchAutoStaticCommand; -import jp.sf.pal.userinfo.db.allcommon.s2dao.internal.sqlcommand.InternalProcedureCommand; -import jp.sf.pal.userinfo.db.allcommon.s2dao.internal.sqlcommand.InternalUpdateAutoDynamicCommand; -import jp.sf.pal.userinfo.db.allcommon.s2dao.internal.sqlcommand.InternalUpdateBatchAutoStaticCommand; -import jp.sf.pal.userinfo.db.allcommon.s2dao.internal.sqlcommand.InternalUpdateDynamicCommand; -import jp.sf.pal.userinfo.db.allcommon.s2dao.internal.sqlcommand.InternalUpdateModifiedOnlyCommand; -import jp.sf.pal.userinfo.db.allcommon.s2dao.internal.sqlcommand.InternalUpdateQueryAutoDynamicCommand; -import jp.sf.pal.userinfo.db.allcommon.s2dao.internal.sqlhandler.InternalDeleteBatchAutoHandler; -import jp.sf.pal.userinfo.db.allcommon.s2dao.internal.sqlhandler.InternalUpdateBatchAutoHandler; -import jp.sf.pal.userinfo.db.allcommon.s2dao.internal.sqlhandler.InternalBasicHandler.SQLExceptionHandler; -import jp.sf.pal.userinfo.db.allcommon.s2dao.internal.various.InternalProcedureMetaData; -import jp.sf.pal.userinfo.db.allcommon.s2dao.internal.various.InternalProcedureMetaDataFactory; -import jp.sf.pal.userinfo.db.allcommon.s2dao.internal.various.InternalRelationRowCreator; -import jp.sf.pal.userinfo.db.allcommon.s2dao.internal.various.InternalRowCreator; -import jp.sf.pal.userinfo.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 ret = new ArrayList(); - while (rs.next()) { - ret.add(valueType.getValue(rs, 1)); - } - return ret; - } - } - - protected BeanMetaData createSpecifiedOutsideSqlCursorBeanMetaData( - Method method) { - return createOutsideSqlCustomizeBeanMetaDataFactory() - .createBeanMetaData(getOutsideSqlDefaultBeanClass(method)); - } - - protected ResultSetHandler createSpecifiedOutsideSqlCursorResultSetHandler( - BeanMetaData specifiedBeanMetaData) { - return new org.seasar.extension.jdbc.impl.ObjectResultSetHandler();// This - // is - // dummy - // for - // cursor - // handling - // ! - } - - // - - - - - - - - - - - - - // Execute - // - - - - - protected void setupSpecifiedOutsideSqlExecuteCommand(String sqlCommandKey, - Method method, OutsideSqlContext outsideSqlContext) { - // - - - - - - - - - - - - - - - - - - - - - - - - // The attribute of Specified-OutsideSqlContext. - // - - - - - - - - - - - - - - - - - - - - - - - - final String sql = outsideSqlContext.readFilteredOutsideSql( - getSqlFileEncoding(), dbms.getSuffix()); - final Object pmb = outsideSqlContext.getParameterBean(); - - // - - - - - - - - - - - - - - - - // The attribute of SqlCommand. - // - - - - - - - - - - - - - - - - final String[] argNames = (pmb != null ? new String[] { "pmb" } - : new String[] {}); - final Class[] argTypes = (pmb != null ? new Class[] { pmb - .getClass() } : new Class[] {}); - - final InternalUpdateDynamicCommand cmd = new InternalUpdateDynamicCommand( - dataSource, statementFactory) { - @Override - public Object execute(Object[] args) { - if (args.length != 3) { - String msg = "Internal Error! OutsideSqlDao.execute() should have 3 arguements: args.length=" - + args.length; - throw new IllegalStateException(msg); - } - Object arg = args[1]; - return super.execute(new Object[] { arg }); - } - }; - - // It is unnecessary for DBFlute! - // cmd.setNotSingleRowUpdatedExceptionClass( - // getNotSingleRowUpdatedExceptionClass(method)); - - registerSqlCommand(sqlCommandKey, method, sql, argNames, argTypes, cmd); - } - - // - - - - - - - - - - - - - // Call Procedure - // - - - - - - - - protected void setupSpecifiedOutsideSqlCallCommand(String sqlCommandKey, - Method method, OutsideSqlContext outsideSqlContext) { - // - - - - - - - - - - - - - - - - - - - - - - - - // The attribute of Specified-OutsideSqlContext. - // - - - - - - - - - - - - - - - - - - - - - - - - final Object pmb = outsideSqlContext.getParameterBean(); - final String procedureName = outsideSqlContext.getOutsideSqlPath(); - - // - - - - - - - - - - - - - - - - // The attribute of SqlCommand. - // - - - - - - - - - - - - - - - - final InternalProcedureMetaDataFactory factory = createInternalProcedureMetaDataFactory(); - factory.setValueTypeFactory(valueTypeFactory); - final Class pmbType = pmb != null ? pmb.getClass() : null; - final InternalProcedureMetaData metaData = factory - .createProcedureMetaData(procedureName, pmbType); - final InternalProcedureCommand cmd = createInternalProcedureCommand( - method, metaData); - putSqlCommand(sqlCommandKey, cmd); - } - - protected InternalProcedureMetaDataFactory createInternalProcedureMetaDataFactory() { - return new InternalProcedureMetaDataFactory(); - } - - protected InternalProcedureCommand createInternalProcedureCommand( - Method method, InternalProcedureMetaData metaData) { - final ResultSetHandler resultSetHandler = createResultSetHandler(method); - return new InternalProcedureCommand(dataSource, resultSetHandler, - statementFactory, metaData); - } - - // ----------------------------------------------------- - // Common of OutsideSql - // -------------------- - protected BeanMetaDataFactory createOutsideSqlCustomizeBeanMetaDataFactory() { - final S2BeanMetaDataFactoryImpl originalBmdFactory = new S2BeanMetaDataFactoryImpl() { - protected BeanMetaDataImpl createBeanMetaDataImpl() { - return newOutsideSqlCustomizeBeanMetaDataImpl(); - } - }; - originalBmdFactory - .setAnnotationReaderFactory(this.annotationReaderFactory); - originalBmdFactory - .setPropertyTypeFactoryBuilder(createOutsideSqlPropertyTypeFactoryBuilder()); - originalBmdFactory - .setRelationPropertyTypeFactoryBuilder(this.relationPropertyTypeFactoryBuilder); - originalBmdFactory.setTableNaming(this.tableNaming); - originalBmdFactory.setDataSource(this.dataSource); - originalBmdFactory.setDaoNamingConvention(this.daoNamingConvention); - originalBmdFactory.setBeanEnhancer(this.beanEnhancer); - return originalBmdFactory; - } - - protected BeanMetaDataImpl newOutsideSqlCustomizeBeanMetaDataImpl() { - return new OutsideSqlCustomizeBeanMetaDataImpl(); - } - - protected static class OutsideSqlCustomizeBeanMetaDataImpl extends - BeanMetaDataImpl { - // Though nothing to override, it uses original class just in case. - } - - protected S2DaoPropertyTypeFactoryBuilderExtension createOutsideSqlPropertyTypeFactoryBuilder() { - final S2DaoPropertyTypeFactoryBuilderExtension impl = new S2DaoPropertyTypeFactoryBuilderExtension(); - if (columnNaming == null) { - String msg = "Internal Error! The columnNaming should not be null! {Failed to Injection!}"; - throw new IllegalStateException(msg); - } - impl.setColumnNaming(columnNaming); - impl.setValueTypeFactory(valueTypeFactory); - return impl; - } - - protected Class getOutsideSqlDefaultBeanClass(Method method) { - final Class retType = method.getReturnType(); - if (java.util.List.class.isAssignableFrom(retType)) { - final Class elementType = InternalMethodUtil - .getElementTypeOfListFromReturnMethod(method); - if (elementType != null) { - return elementType; - } else { - return getBeanClass(); - } - } else if (retType.isArray()) { - return retType.getComponentType(); - } else if (retType.isPrimitive() - || !ValueTypes.getValueType(retType).equals(ValueTypes.OBJECT)) { - return getBeanClass(); - } else { - return retType; - } - } - - protected void registerSqlCommand(String sqlCommandKey, Method method, - String sql, String[] argNames, Class[] argTypes, - BeanMetaData myBeanMetaData) { - registerSqlCommand(sqlCommandKey, method, sql, argNames, argTypes, - createResultSetHandler(myBeanMetaData, method)); - } - - protected void registerSqlCommand(String sqlCommandKey, Method method, - String sql, String[] argNames, Class[] argTypes, - ResultSetHandler myResultSetHandler) { - final S2DaoSelectDynamicCommand cmd = createCustomizeSelectDynamicCommand(myResultSetHandler); - registerSqlCommand(sqlCommandKey, method, sql, argNames, argTypes, cmd); - } - - protected void registerSqlCommand(String sqlCommandKey, Method method, - String sql, String[] argNames, Class[] argTypes, - S2DaoSelectDynamicCommand cmd) { - cmd.setSql(sql); - cmd.setArgNames(argNames); - cmd.setArgTypes(argTypes); - this.sqlCommands.put(sqlCommandKey, cmd); - } - - protected void registerSqlCommand(String sqlCommandKey, Method method, - String sql, String[] argNames, Class[] argTypes, - InternalUpdateDynamicCommand cmd) { - cmd.setSql(sql); - cmd.setArgNames(argNames); - cmd.setArgTypes(argTypes); - this.sqlCommands.put(sqlCommandKey, cmd); - } - - //========================================================================== - // ========= - // Common Handlnig - // =============== - @Override - protected void putSqlCommand(String methodName, SqlCommand cmd) { - sqlCommands.put(methodName, cmd); - } - - protected boolean isCheckSingleRowUpdate(Method method) { - return checkSingleRowUpdateForAll - & daoAnnotationReader.isCheckSingleRowUpdate(method); - } - - //========================================================================== - // ========= - // Customize SelectDynamicCommand Creation - // ======================================= - /** - * Create the customize select dynamic command that is for all select SQL on - * DBFlute. - * - * @param handler The handler of result set. (NotNull) - * @return The customize select dynamic command. (NotNull) - */ - protected S2DaoSelectDynamicCommand createCustomizeSelectDynamicCommand( - ResultSetHandler handler) { - return new S2DaoSelectDynamicCommand(dataSource, statementFactory, - handler); - } - - //========================================================================== - // ========= - // ResultSetHandler Override - // ========================= - @Override - protected ResultSetHandler createResultSetHandler(Method method) { - return this.resultSetHandlerFactory.getResultSetHandler( - daoAnnotationReader, beanMetaData, method); - } - - protected ResultSetHandler createResultSetHandler( - BeanMetaData specifiedBeanMetaData, Method method) {// For specified - // BeanMetaData - return this.resultSetHandlerFactory.getResultSetHandler( - daoAnnotationReader, specifiedBeanMetaData, method); - } - - //========================================================================== - // ========= - // JDBC Delegator - // ============== - protected Connection getConnection() { - if (dataSource == null) { - throw new IllegalStateException( - "The dataSource should not be null!"); - } - try { - return dataSource.getConnection(); - } catch (SQLException e) { - handleSQLException(e, null); - return null;// Unreachable! - } - } - - protected DatabaseMetaData getMetaData(Connection conn) { - try { - return conn.getMetaData(); - } catch (SQLException e) { - handleSQLException(e, null); - return null;// Unreachable! - } - } - - protected String getDatabaseProductName(DatabaseMetaData dbMetaData) { - try { - return dbMetaData.getDatabaseProductName(); - } catch (SQLException e) { - handleSQLException(e, null); - return null;// Unreachable! - } - } - - protected void close(Connection conn) { - if (conn == null) { - return; - } - try { - conn.close(); - } catch (SQLException e) { - handleSQLException(e, null); - } - } - - //========================================================================== - // ========= - // Exception Handlnig - // ================== - protected void handleSQLException(SQLException e, Statement statement) { - new SQLExceptionHandler().handleSQLException(e, statement); - } - - //========================================================================== - // ========= - // ResultSetHandlerFactoryImpl Extension - // ===================================== - public static class ResultSetHandlerFactoryExtension extends - ResultSetHandlerFactoryImpl { - public ResultSetHandlerFactoryExtension() { - super(); - } - - @Override - protected RowCreator createRowCreator() { // [DAO-118] (2007/08/25) - return createInternalRowCreator(null); - } - - @Override - protected RelationRowCreator createRelationRowCreator() { - return createInternalRelationRowCreator(null); - } - - @Override - protected ResultSetHandler createBeanListMetaDataResultSetHandler( - BeanMetaData bmd) { // DBFlute Target - final InternalRowCreator rowCreator = createInternalRowCreator(bmd); - final InternalRelationRowCreator relationRowCreator = createInternalRelationRowCreator(bmd); - return new InternalBeanListMetaDataResultSetHandler(bmd, - rowCreator, relationRowCreator); - } - - @Override - protected ResultSetHandler createBeanArrayMetaDataResultSetHandler( - BeanMetaData bmd) { // DBFlute Target - final InternalRowCreator rowCreator = createInternalRowCreator(bmd); - final InternalRelationRowCreator relationRowCreator = createInternalRelationRowCreator(bmd); - return new InternalBeanArrayMetaDataResultSetHandler(bmd, - rowCreator, relationRowCreator); - } - - protected InternalRowCreator createInternalRowCreator(BeanMetaData bmd) { - final Class clazz = bmd != null ? bmd.getBeanClass() : null; - return InternalRowCreator.createInternalRowCreator(clazz); - } - - protected InternalRelationRowCreator createInternalRelationRowCreator( - BeanMetaData bmd) { - return new InternalRelationRowCreator(); // Not yet implemented - // about performance - // tuning! - } - } - - //========================================================================== - // ========= - // Vert Internal - // ============= - protected static class InternalMethodUtil { - public static Class getElementTypeOfListFromReturnMethod(Method method) { - return InternalReflectionUtil - .getElementTypeOfListFromReturnType(method); - } - } - - protected static class InternalReflectionUtil { - public static Class getElementTypeOfList(final Type parameterizedList) { - if (!(parameterizedList instanceof ParameterizedType)) { - return null; - } - final ParameterizedType parameterizedType = ParameterizedType.class - .cast(parameterizedList); - final Type rawType = parameterizedType.getRawType(); - if (!(rawType instanceof Class)) { - return null; - } - final Class rawClass = Class.class.cast(rawType); - if (!rawClass.isAssignableFrom(List.class)) { - return null; - } - final Type[] actualTypeArgument = parameterizedType - .getActualTypeArguments(); - if (actualTypeArgument == null || actualTypeArgument.length != 1) { - return null; - } - if (!(actualTypeArgument[0] instanceof Class)) { - return null; - } - return Class.class.cast(actualTypeArgument[0]); - } - - public static Class getElementTypeOfListFromParameterType( - final Method method, final int parameterPosition) { - final Type[] pmbTypes = method.getGenericParameterTypes(); - return getElementTypeOfList(pmbTypes[parameterPosition]); - } - - public static Class getElementTypeOfListFromReturnType( - final Method method) { - return getElementTypeOfList(method.getGenericReturnType()); - } - } - - //========================================================================== - // ========= - // Assist Helper - // ============= - protected DBMeta findDBMeta() { - final Class beanType = getBeanClass(); - if (beanType == null) { - return null; - } - if (!Entity.class.isAssignableFrom(beanType)) { - return null; - } - final Entity entity; - try { - entity = (Entity) beanType.newInstance(); - } catch (InstantiationException e) { - throw new IllegalStateException(e); - } catch (IllegalAccessException e) { - throw new IllegalStateException(e); - } - return entity.getDBMeta(); - } - - //========================================================================== - // ========= - // General Helper - // ============== - protected String getLineSeparator() { - return SimpleSystemUtil.getLineSeparator(); - } - - //========================================================================== - // ========= - // Accessor - // ======== - // ----------------------------------------------------- - // Sql File Encoding - // ----------------- - public String getSqlFileEncoding() { - return sqlFileEncoding; - } - - // ----------------------------------------------------- - // Bean Enhancer - // ------------- - public BeanEnhancer getBeanEnhancer() { - return beanEnhancer; - } - - public void setBeanEnhancer(final BeanEnhancer beanEnhancer) { - this.beanEnhancer = beanEnhancer; - } - - // ----------------------------------------------------- - // Annotation Reader Factory - // ------------------------- - public void setAnnotationReaderFactory( - org.seasar.dao.AnnotationReaderFactory annotationReaderFactory) { - this.annotationReaderFactory = annotationReaderFactory; - } - - // ----------------------------------------------------- - // Version After 1.0.47 - // -------------------- - public ColumnNaming getColumnNaming() { - return columnNaming; - } - - public void setColumnNaming(final ColumnNaming columnNaming) { - this.columnNaming = columnNaming; - } - - public PropertyTypeFactoryBuilder getPropertyTypeFactoryBuilder() { - return propertyTypeFactoryBuilder; - } - - public void setPropertyTypeFactoryBuilder( - final PropertyTypeFactoryBuilder propertyTypeFactoryBuilder) { - this.propertyTypeFactoryBuilder = propertyTypeFactoryBuilder; - } - - public RelationPropertyTypeFactoryBuilder getRelationPropertyTypeFactoryBuilder() { - return relationPropertyTypeFactoryBuilder; - } - - public void setRelationPropertyTypeFactoryBuilder( - final RelationPropertyTypeFactoryBuilder relationPropertyTypeFactoryBuilder) { - this.relationPropertyTypeFactoryBuilder = relationPropertyTypeFactoryBuilder; - } - - public TableNaming getTableNaming() { - return tableNaming; - } - - public void setTableNaming(final TableNaming tableNaming) { - this.tableNaming = tableNaming; - } - - // ----------------------------------------------------- - // DBFlute Extension - // ----------------- - public BehaviorSelector getBehaviorSelector() { - return _behaviorSelector; - } - - public void setBehaviorSelector(final BehaviorSelector behaviorSelector) { - this._behaviorSelector = behaviorSelector; - } - - public boolean isInternalDebug() { - return _internalDebug; - } - - public void setInternalDebug(final boolean internalDebug) { - this._internalDebug = internalDebug; - } -} Deleted: userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/s2dao/S2DaoMetaDataFactoryImpl.java =================================================================== --- userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/s2dao/S2DaoMetaDataFactoryImpl.java 2008-12-26 22:11:31 UTC (rev 1622) +++ userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/s2dao/S2DaoMetaDataFactoryImpl.java 2008-12-27 22:02:56 UTC (rev 1623) @@ -1,655 +0,0 @@ -package jp.sf.pal.userinfo.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.userinfo.db.allcommon.DBFluteConfig; -import jp.sf.pal.userinfo.db.allcommon.cbean.ConditionBean; -import jp.sf.pal.userinfo.db.allcommon.cbean.ConditionBeanContext; -import jp.sf.pal.userinfo.db.allcommon.cbean.outsidesql.OutsideSqlContext; -import jp.sf.pal.userinfo.db.allcommon.jdbc.StatementConfig; -import jp.sf.pal.userinfo.db.allcommon.s2dao.internal.sqlhandler.InternalBasicHandler.SQLExceptionHandler; -import jp.sf.pal.userinfo.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 daoMetaDataCache = new HashMap(); - - protected boolean initialized; - - protected boolean useDaoClassForLog; - - protected String sqlFileEncoding; - - protected BeanEnhancer beanEnhancer; - - // ----------------------------------------------------- - // Version After 1.0.47 - // -------------------- - /** The naming of column. {After S2Dao-1.0.47} */ - protected ColumnNaming columnNaming; - - /** The builder of property type factory. {After S2Dao-1.0.47} */ - protected PropertyTypeFactoryBuilder propertyTypeFactoryBuilder; - - /** The builder of relation property type factory. {After S2Dao-1.0.47} */ - protected RelationPropertyTypeFactoryBuilder relationPropertyTypeFactoryBuilder; - - /** The builder of table naming. {After S2Dao-1.0.47} */ - protected TableNaming tableNaming; - - // ----------------------------------------------------- - // DBFlute Extension - // ----------------- - /** The lock monitor of DAO meta data initialization. */ - protected Object _daoMetaDataInitializationLockMonitor = new Object(); - - //========================================================================== - // ========= - // Constructor - // =========== - public S2DaoMetaDataFactoryImpl(DataSource dataSource, - AnnotationReaderFactory annotationReaderFactory, - XADataSource xaDataSource) { - this.dataSource = dataSource; - this.annotationReaderFactory = annotationReaderFactory; - - _log - .info("/* * * * * * * * * * * * * * * * * * * * * * * * * * * * {DBFlute}"); - showInformation(dataSource, xaDataSource); - - // Stop the LinkageError! - ConditionBeanContext.initialize(); - - initializeDatabaseProductNameOfContext(xaDataSource); - - handleSqlLogRegistry(); - - DBFluteConfig.getInstance().lock(); - _log.info("* * * * */"); - } - - protected void showInformation(javax.sql.DataSource dataSource, - javax.sql.XADataSource xaDataSource) { - final StringBuilder sb = new StringBuilder(); - if (xaDataSource != null - && xaDataSource instanceof org.seasar.extension.dbcp.impl.XADataSourceImpl) { - final org.seasar.extension.dbcp.impl.XADataSourceImpl xaDataSourceImpl = (org.seasar.extension.dbcp.impl.XADataSourceImpl) xaDataSource; - final String driverClassName = xaDataSourceImpl - .getDriverClassName(); - final String url = xaDataSourceImpl.getURL(); - final String user = xaDataSourceImpl.getUser(); - sb.append(" [XADataSource]:").append(getLineSeparator()); - sb.append(" driver = " + driverClassName).append( - getLineSeparator()); - sb.append(" url = " + url).append(getLineSeparator()); - sb.append(" user = " + user); - } - _log.info("{Injection Information}" + getLineSeparator() + sb); - } - - protected void handleSqlLogRegistry() { - final StringBuilder sb = new StringBuilder(); - sb.append("{SqlLog Information}").append(getLineSeparator()); - sb.append(" [SqlLogRegistry]").append(getLineSeparator()); - if (DBFluteConfig.getInstance().isUseSqlLogRegistry()) { - if (InternalSqlLogRegistry.setupSqlLogRegistry()) { - sb - .append( - " ...Setting up SqlLogRegistry(org.seasar.extension.jdbc)!") - .append(getLineSeparator()); - sb - .append(" Because the property 'useSqlLogRegistry' of the config of DBFlute is true."); - } else { - sb - .append(" SqlLogRegistry(org.seasar.extension.jdbc) is not supported at the version!"); - } - } else { - final Object sqlLogRegistry = InternalSqlLogRegistry - .findContainerSqlLogRegistry(); - if (sqlLogRegistry != null) { - InternalSqlLogRegistry.closeRegistration(); - sb - .append( - " SqlLogRegistry(org.seasar.extension.jdbc) is close! It's default for DBFlute.") - .append(getLineSeparator()); - sb - .append(" If you want to use this, set SqlLogRegistry to SqlLogRegistryLocator at yourself."); - } else { - sb - .append(" SqlLogRegistry(org.seasar.extension.jdbc) is not available!"); - } - } - _log.info(sb); - } - - // ----------------------------------------------------- - // Database Product Name - // --------------------- - protected void initializeDatabaseProductNameOfContext( - javax.sql.XADataSource xaDataSource) { - if (getDatabaseProductNameFromContext() != null) { - return; - } - - // From JDBC Driver! - if (xaDataSource != null - && xaDataSource instanceof org.seasar.extension.dbcp.impl.XADataSourceImpl) { - final org.seasar.extension.dbcp.impl.XADataSourceImpl xaDataSourceImpl = (org.seasar.extension.dbcp.impl.XADataSourceImpl) xaDataSource; - final String driverClassName = xaDataSourceImpl - .getDriverClassName(); - if (driverClassName != null) { - if (setupDatabaseProductNameByDriverClassName(driverClassName)) { - _log - .info("...Initializing database product name from driverClassName: " - + getDatabaseProductNameFromContext()); - return; - } - } - } - - _log.info("...Initializing database product name as default: H2"); - setDatabaseProductNameToContext("H2"); - } - - protected String getDatabaseProductNameFromContext() { - return ConditionBeanContext.getDatabaseProductName(); - } - - protected void setDatabaseProductNameToContext(String name) { - ConditionBeanContext.setDatabaseProductName(name); - } - - protected boolean setupDatabaseProductNameByDriverClassName( - String driverClassName) { - return ConditionBeanContext - .setupDatabaseProductNameByDriverClassName(driverClassName); - } - - //========================================================================== - // ========= - // Implementation - // ============== - @SuppressWarnings("unchecked") - public DaoMetaData getDaoMetaData(final Class daoClass) { - if (!initialized) { - DisposableUtil.add(this); - initialized = true; - } - final String key = daoClass.getName(); - - // [A] - DaoMetaData dmd = getSynchronizedDaoMetaDataCache(key); - - // [B] - if (dmd != null) { - return dmd; - } - - // [C] - synchronized (_daoMetaDataInitializationLockMonitor) {// One Thread Only - // Entered - // [D] - dmd = getSynchronizedDaoMetaDataCache(key); - // [E] - if (dmd != null) { - // The second thread that stops at [C] can find - // because the first thread have already initialized. - if (_log.isDebugEnabled()) { - _log - .debug("...Getting daoMetaData as cache because the previous thread have already initilized."); - } - return dmd; - } - // [F] - if (_log.isDebugEnabled()) { - _log.debug("...Creating daoMetaData for " - + daoClass.getSimpleName() + "."); - } - final DaoMetaData dmdi = createDaoMetaData(daoClass); - putSynchronizedDaoMetaDataCache(key, dmdi); - } - // [G] - dmd = getSynchronizedDaoMetaDataCache(key); - if (dmd != null) { - return dmd; - } - String msg = "The cache should have data meta data here: key=" + key - + " cache=" + daoMetaDataCache; - throw new IllegalStateException(msg); - } - - @SuppressWarnings("unchecked") - protected void putSynchronizedDaoMetaDataCache(String key, DaoMetaData dmd) { - synchronized (daoMetaDataCache) { - daoMetaDataCache.put(key, dmd); - } - } - - protected DaoMetaData getSynchronizedDaoMetaDataCache(String key) { - DaoMetaData dmd = null; - synchronized (daoMetaDataCache) { - dmd = (DaoMetaData) daoMetaDataCache.get(key); - } - return dmd; - } - - //========================================================================== - // ========= - // DataMetaData Creation - // ===================== - protected DaoMetaData createDaoMetaData(final Class daoClass) { - final BeanDesc daoBeanDesc = BeanDescFactory.getBeanDesc(daoClass); - final DaoAnnotationReader daoAnnotationReader = annotationReaderFactory - .createDaoAnnotationReader(daoBeanDesc); - - final DaoMetaDataImpl daoMetaData = createDaoMetaDataExtension(); - daoMetaData.setDaoClass(daoClass); - daoMetaData.setDataSource(dataSource); - daoMetaData.setStatementFactory(createCustomizeStatememtFactory()); - daoMetaData.setResultSetFactory(createCustomizeResultSetFactory()); - daoMetaData.setValueTypeFactory(valueTypeFactory); - daoMetaData.setBeanMetaDataFactory(getBeanMetaDataFactory()); - daoMetaData.setDaoNamingConvention(getDaoNamingConvention()); - daoMetaData.setUseDaoClassForLog(useDaoClassForLog); - daoMetaData.setDaoAnnotationReader(daoAnnotationReader); - daoMetaData.setProcedureMetaDataFactory(procedureMetaDataFactory); - daoMetaData.setDtoMetaDataFactory(dtoMetaDataFactory); - daoMetaData.setResultSetHandlerFactory(resultSetHandlerFactory); - if (sqlFileEncoding != null) { - daoMetaData.setSqlFileEncoding(sqlFileEncoding); - } - if (pagingSqlRewriter != null) { - daoMetaData.setPagingSQLRewriter(pagingSqlRewriter); - } - daoMetaData.initialize(); - return daoMetaData; - } - - protected S2DaoMetaDataExtension createDaoMetaDataExtension() { - final S2DaoMetaDataExtension dmdExtension = newDaoMetaDataExtension(); - dmdExtension.setBeanEnhancer(beanEnhancer); - dmdExtension.setAnnotationReaderFactory(this.annotationReaderFactory); - dmdExtension.setColumnNaming(this.columnNaming); - dmdExtension - .setPropertyTypeFactoryBuilder(this.propertyTypeFactoryBuilder); - dmdExtension - .setRelationPropertyTypeFactoryBuilder(this.relationPropertyTypeFactoryBuilder); - dmdExtension.setTableNaming(tableNaming); - dmdExtension.setInternalDebug(DBFluteConfig.getInstance() - .isInternalDebug()); - return dmdExtension; - } - - protected S2DaoMetaDataExtension newDaoMetaDataExtension() { - return new S2DaoMetaDataExtension(); - } - - //========================================================================== - // ========= - // Result Set Factory - // ================== - /** - * Create the customize result set factory that is for all SQL on DBFlute. - * - * @return The customize statement factory. (NotNull) - */ - protected ResultSetFactory createCustomizeResultSetFactory() { - return new FetchNarrowingResultSetFactory(); - } - - //========================================================================== - // ========= - // Statement Factory - // ================= - /** - * Create the customize statement factory that is for all SQL on DBFlute. - * - * @return The customize statement factory. (NotNull) - */ - protected StatementFactory createCustomizeStatememtFactory() { - final StatementConfig defaultStatementConfig = DBFluteConfig - .getInstance().getDefaultStatementConfig(); - final boolean internalDebug = DBFluteConfig.getInstance() - .isInternalDebug(); - return new StatementFactory() { - public PreparedStatement createPreparedStatement(Connection con, - String sql) { - try { - final StatementConfig config = findStatementConfigOnThread(); - ; - final int resultSetType; - if (config != null && config.hasResultSetType()) { - resultSetType = config.getResultSetType(); - } else if (defaultStatementConfig != null - && defaultStatementConfig.hasResultSetType()) { - resultSetType = defaultStatementConfig - .getResultSetType(); - } else { - resultSetType = java.sql.ResultSet.TYPE_FORWARD_ONLY; - } - final int resultSetConcurrency = java.sql.ResultSet.CONCUR_READ_ONLY; - if (internalDebug) { - _log.debug("...Creating prepareStatement(sql, " - + resultSetType + ", " + resultSetConcurrency - + ")"); - } - final PreparedStatement ps = con.prepareStatement(sql, - resultSetType, resultSetConcurrency); - if (config != null && config.hasStatementOptions()) { - if (internalDebug) { - _log - .debug("...Setting statement config as request: " - + config); - } - reflectStatementOptions(config, ps); - } else { - reflectDefaultOptionsToStatementIfNeeds(ps); - } - return ps; - } catch (SQLException e) { - handleSQLException(e, null); - return null;// Unreachable! - } - } - - public CallableStatement createCallableStatement(Connection conn, - String sql) { - return prepareCall(conn, sql); - } - - protected StatementConfig findStatementConfigOnThread() { - final StatementConfig config; - if (ConditionBeanContext.isExistConditionBeanOnThread()) { - final ConditionBean cb = ConditionBeanContext - .getConditionBeanOnThread(); - config = cb.getStatementConfig(); - } else if (OutsideSqlContext.isExistOutsideSqlContextOnThread()) { - final OutsideSqlContext context = OutsideSqlContext - .getOutsideSqlContextOnThread(); - config = context.getStatementConfig(); - } else { - config = null; - } - return config; - } - - protected void reflectDefaultOptionsToStatementIfNeeds( - PreparedStatement ps) { - if (defaultStatementConfig != null - && defaultStatementConfig.hasStatementOptions()) { - if (internalDebug) { - _log.debug("...Setting statement config as default: " - + defaultStatementConfig); - } - reflectStatementOptions(defaultStatementConfig, ps); - return; - } - } - - protected void reflectStatementOptions(StatementConfig config, - PreparedStatement ps) { - try { - if (config.hasQueryTimeout()) { - ps.setQueryTimeout(config.getQueryTimeout()); - } - if (config.hasFetchSize()) { - ps.setFetchSize(config.getFetchSize()); - } - if (config.hasMaxRows()) { - ps.setMaxRows(config.getMaxRows()); - } - } catch (SQLException e) { - handleSQLException(e, ps); - } - } - - protected CallableStatement prepareCall(Connection conn, String sql) { - try { - return conn.prepareCall(sql); - } catch (SQLException e) { - handleSQLException(e, null); - return null;// Unreachable! - } - } - - protected void handleSQLException(SQLException e, - Statement statement) { - new SQLExceptionHandler().handleSQLException(e, statement); - } - }; - } - - //========================================================================== - // ========= - // Dispose - // ======= - public synchronized void dispose() { - daoMetaDataCache.clear(); - initialized = false; - } - - //========================================================================== - // ========= - // Helper - // ====== - /** - * Get the value of line separator. - * - * @return The value of line separator. (NotNull) - */ - protected static String getLineSeparator() { - return System.getProperty("line.separator"); - } - - //========================================================================== - // ========= - // Accessor - // ======== - // ----------------------------------------------------- - // Factory Basic - // ------------- - public void setValueTypeFactory(final ValueTypeFactory valueTypeFactory) { - this.valueTypeFactory = valueTypeFactory; - } - - protected BeanMetaDataFactory getBeanMetaDataFactory() { - return beanMetaDataFactory; - } - - public void setBeanMetaDataFactory( - final BeanMetaDataFactory beanMetaDataFactory) { - this.beanMetaDataFactory = beanMetaDataFactory; - } - - public DaoNamingConvention getDaoNamingConvention() { - return daoNamingConvention; - } - - public void setDaoNamingConvention( - final DaoNamingConvention daoNamingConvention) { - this.daoNamingConvention = daoNamingConvention; - } - - public void setAnnotationReaderFactory( - final AnnotationReaderFactory annotationReaderFactory) { - this.annotationReaderFactory = annotationReaderFactory; - } - - public void setDataSource(final DataSource dataSource) { - this.dataSource = dataSource; - } - - public void setUseDaoClassForLog(final boolean userDaoClassForLog) { - useDaoClassForLog = userDaoClassForLog; - } - - public void setResultSetHandlerFactory( - final ResultSetHandlerFactory resultSetHandlerFactory) { - this.resultSetHandlerFactory = resultSetHandlerFactory; - } - - public void setDtoMetaDataFactory( - final DtoMetaDataFactory dtoMetaDataFactory) { - this.dtoMetaDataFactory = dtoMetaDataFactory; - } - - public void setProcedureMetaDataFactory( - ProcedureMetaDataFactory procedureMetaDataFactory) { - this.procedureMetaDataFactory = procedureMetaDataFactory; - } - - public void setPagingSQLRewriter(final PagingSqlRewriter pagingSqlRewriter) { - this.pagingSqlRewriter = pagingSqlRewriter; - } - - public String getSqlFileEncoding() { - return sqlFileEncoding; - } - - public void setSqlFileEncoding(final String encoding) { - sqlFileEncoding = encoding; - } - - public BeanEnhancer getBeanEnhancer() { - return beanEnhancer; - } - - public void setBeanEnhancer(final BeanEnhancer beanEnhancer) { - this.beanEnhancer = beanEnhancer; - } - - // ----------------------------------------------------- - // Version After 1.0.47 - // -------------------- - public ColumnNaming getColumnNaming() { - return columnNaming; - } - - public void setColumnNaming(final ColumnNaming columnNaming) { - this.columnNaming = columnNaming; - } - - public PropertyTypeFactoryBuilder getPropertyTypeFactoryBuilder() { - return propertyTypeFactoryBuilder; - } - - public void setPropertyTypeFactoryBuilder( - final PropertyTypeFactoryBuilder propertyTypeFactoryBuilder) { - this.propertyTypeFactoryBuilder = propertyTypeFactoryBuilder; - } - - public RelationPropertyTypeFactoryBuilder getRelationPropertyTypeFactoryBuilder() { - return relationPropertyTypeFactoryBuilder; - } - - public void setRelationPropertyTypeFactoryBuilder( - final RelationPropertyTypeFactoryBuilder relationPropertyTypeFactoryBuilder) { - this.relationPropertyTypeFactoryBuilder = relationPropertyTypeFactoryBuilder; - } - - public TableNaming getTableNaming() { - return tableNaming; - } - - public void setTableNaming(final TableNaming tableNaming) { - this.tableNaming = tableNaming; - } -} \ No newline at end of file Deleted: userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/s2dao/S2DaoPropertyTypeFactoryBuilderExtension.java =================================================================== --- userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/s2dao/S2DaoPropertyTypeFactoryBuilderExtension.java 2008-12-26 22:11:31 UTC (rev 1622) +++ userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/s2dao/S2DaoPropertyTypeFactoryBuilderExtension.java 2008-12-27 22:02:56 UTC (rev 1623) @@ -1,215 +0,0 @@ -package jp.sf.pal.userinfo.db.allcommon.s2dao; - -import java.sql.DatabaseMetaData; -import java.util.ArrayList; -import java.util.List; - -import jp.sf.pal.userinfo.db.allcommon.Entity; -import jp.sf.pal.userinfo.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 list = new ArrayList(); - final BeanDesc beanDesc = getBeanDesc(); - for (int i = 0; i < beanDesc.getPropertyDescSize(); ++i) { - final PropertyDesc pd = beanDesc.getPropertyDesc(i); - - // Read-only property is unnecessary! - if (!pd.hasWriteMethod()) { - continue; - } - - // Relation property is unnecessary! - if (isRelation(pd)) { - continue; - } - - final PropertyType pt = createPropertyType(pd); - pt.setPrimaryKey(isPrimaryKey(pd)); - pt.setPersistent(isPersistent(pt)); - list.add(pt); - } - return list.toArray(new PropertyType[list.size()]); - } - - @Override - protected boolean isRelation(PropertyDesc propertyDesc) { - final String propertyName = propertyDesc.getPropertyName(); - if (hasDBMeta() - && (_dbmeta.hasForeign(propertyName) || _dbmeta - .hasReferrer(propertyName))) { - return true; - } - return hasRelationNoAnnotation(propertyDesc); - } - - protected boolean hasRelationNoAnnotation(PropertyDesc propertyDesc) { - return beanAnnotationReader.hasRelationNo(propertyDesc); - } - - @Override - protected boolean isPrimaryKey(PropertyDesc propertyDesc) { - final String propertyName = propertyDesc.getPropertyName(); - if (hasDBMeta() && _dbmeta.hasPrimaryKey() - && _dbmeta.hasColumn(propertyName)) { - if (_dbmeta.findColumnInfo(propertyName).isPrimary()) { - return true; - } - } - return hasIdAnnotation(propertyDesc); - } - - protected boolean hasIdAnnotation(PropertyDesc propertyDesc) { - final Dbms dbms = getDbms(); - return beanAnnotationReader.getId(propertyDesc, dbms) != null; - } - - @Override - protected boolean isPersistent(PropertyType propertyType) { - final String propertyName = propertyType.getPropertyName(); - final PropertyDesc propertyDesc = propertyType.getPropertyDesc(); - if ((hasDBMeta() && _dbmeta.hasColumn(propertyName)) - || hasColumnAnnotation(propertyDesc)) { - if (!isElementOfNoPersistentProps(propertyDesc)) { - return true; - } - } - return false; - } - - protected boolean hasColumnAnnotation(PropertyDesc propertyDesc) { - return beanAnnotationReader.getColumnAnnotation(propertyDesc) != null; - } - - protected boolean isElementOfNoPersistentProps(PropertyDesc propertyDesc) { - final String propertyName = propertyDesc.getPropertyName(); - final String[] props = _noPersisteneProps; - if (props != null && props.length >= 0) { - for (int i = 0; i < props.length; ++i) { - if (props[i].equals(propertyName)) { - return true; - } - } - } - return false; - } - } - - //========================================================================== - // ========= - // Accessor - // ======== - public ValueTypeFactory getValueTypeFactory() { - return valueTypeFactory; - } - - public void setValueTypeFactory(ValueTypeFactory valueTypeFactory) { - this.valueTypeFactory = valueTypeFactory; - } - - public ColumnNaming getColumnNaming() { - return columnNaming; - } - - public void setColumnNaming(ColumnNaming columnNaming) { - this.columnNaming = columnNaming; - } -} Deleted: userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/s2dao/S2DaoSelectDynamicCommand.java =================================================================== --- userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/s2dao/S2DaoSelectDynamicCommand.java 2008-12-26 22:11:31 UTC (rev 1622) +++ userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/s2dao/S2DaoSelectDynamicCommand.java 2008-12-27 22:02:56 UTC (rev 1623) @@ -1,491 +0,0 @@ -package jp.sf.pal.userinfo.db.allcommon.s2dao; - -import java.util.ArrayList; -import java.util.List; - -import javax.sql.DataSource; - -import jp.sf.pal.userinfo.db.allcommon.cbean.ConditionBean; -import jp.sf.pal.userinfo.db.allcommon.cbean.ConditionBeanContext; -import jp.sf.pal.userinfo.db.allcommon.cbean.outsidesql.OutsideSqlContext; -import jp.sf.pal.userinfo.db.allcommon.s2dao.internal.sqlcommand.InternalAbstractDynamicCommand; -import jp.sf.pal.userinfo.db.allcommon.s2dao.internal.sqlhandler.InternalBasicSelectHandler; -import jp.sf.pal.userinfo.db.allcommon.util.SimpleStringUtil; -import jp.sf.pal.userinfo.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 bindVariableList = new ArrayList(4); - final List bindVariableTypeList = new ArrayList(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 bindVariableList = new java.util.ArrayList(); - final java.util.List bindVariableTypeList = new java.util.ArrayList(); - 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.userinfo.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.userinfo.db.allcommon.jdbc.CursorHandler) { - final jp.sf.pal.userinfo.db.allcommon.jdbc.CursorHandler cursorHandler = (jp.sf.pal.userinfo.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 bindVariableList, List 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 bindVariableList, List 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 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 bindVariableList, List bindVariableTypeList) { - final Object[] bindVariables = ctx.getBindVariables(); - addBindVariableList(bindVariableList, bindVariables); - final Class[] bindVariableTypes = ctx.getBindVariableTypes(); - addBindVariableTypeList(bindVariableTypeList, bindVariableTypes); - } - - protected void addBindVariableList(List bindVariableList, - Object[] bindVariables) { - for (int i = 0; i < bindVariables.length; i++) { - bindVariableList.add(bindVariables[i]); - } - } - - protected void addBindVariableTypeList(List bindVariableTypeList, - Class[] bindVariableTypes) { - for (int i = 0; i < bindVariableTypes.length; i++) { - bindVariableTypeList.add(bindVariableTypes[i]); - } - } - - //========================================================================== - // ========= - // General Helper - // ============== - protected final String replaceString(String text, String fromText, - String toText) { - return SimpleStringUtil.replace(text, fromText, toText); - } - - protected String getLineSeparator() { - return SimpleSystemUtil.getLineSeparator(); - } -} \ No newline at end of file Added: userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/s2dao/SqlLogRegistryLatestSqlProvider.java =================================================================== --- userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/s2dao/SqlLogRegistryLatestSqlProvider.java (rev 0) +++ userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/s2dao/SqlLogRegistryLatestSqlProvider.java 2008-12-27 22:02:56 UTC (rev 1623) @@ -0,0 +1,21 @@ +package jp.sf.pal.userinfo.db.allcommon.s2dao; + +import jp.sf.pal.userinfo.db.allcommon.jdbc.LatestSqlProvider; +import jp.sf.pal.userinfo.db.allcommon.s2dao.internal.sqllog.InternalSqlLogRegistry; + +/** + * The provider of latest SQL using SqlLogRegistry. This instance should be + * singleton. + * + * @author DBFlute(AutoGenerator) + */ +public class SqlLogRegistryLatestSqlProvider implements LatestSqlProvider { + + public String getDisplaySql() { + return InternalSqlLogRegistry.peekCompleteSql(); + } + + public void clearSqlCache() { + InternalSqlLogRegistry.clearSqlLogRegistry(); + } +} Property changes on: userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/s2dao/SqlLogRegistryLatestSqlProvider.java ___________________________________________________________________ Name: svn:eol-style + native Modified: userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/s2dao/internal/rshandler/InternalAbstractDtoMetaDataResultSetHandler.java =================================================================== --- userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/s2dao/internal/rshandler/InternalAbstractDtoMetaDataResultSetHandler.java 2008-12-26 22:11:31 UTC (rev 1622) +++ userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/s2dao/internal/rshandler/InternalAbstractDtoMetaDataResultSetHandler.java 2008-12-27 22:02:56 UTC (rev 1623) @@ -6,10 +6,11 @@ import java.util.Map; import java.util.Set; +import jp.sf.pal.userinfo.db.allcommon.helper.StringSet; + import org.seasar.dao.DtoMetaData; import org.seasar.dao.RowCreator; import org.seasar.extension.jdbc.ResultSetHandler; -import org.seasar.framework.util.CaseInsensitiveSet; /** * @author DBFlute(AutoGenerator) @@ -67,10 +68,10 @@ return rowCreator.createRow(rs, propertyCache, beanClass); } - protected Set createColumnNames(final ResultSetMetaData rsmd) + protected Set createColumnNames(final ResultSetMetaData rsmd) throws SQLException { final int count = rsmd.getColumnCount(); - final Set columnNames = new CaseInsensitiveSet(); + final Set columnNames = StringSet.createAsCaseInsensitive(); for (int i = 0; i < count; ++i) { final String columnName = rsmd.getColumnLabel(i + 1); final int pos = columnName.lastIndexOf('.'); // [DAO-41] Modified: userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/s2dao/internal/sqlcommand/InternalAbstractAutoStaticCommand.java =================================================================== --- userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/s2dao/internal/sqlcommand/InternalAbstractAutoStaticCommand.java 2008-12-26 22:11:31 UTC (rev 1622) +++ userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/s2dao/internal/sqlcommand/InternalAbstractAutoStaticCommand.java 2008-12-27 22:02:56 UTC (rev 1623) @@ -10,7 +10,6 @@ import org.seasar.dao.BeanMetaData; import org.seasar.dao.IdentifierGenerator; -import org.seasar.dao.NotSingleRowUpdatedRuntimeException; import org.seasar.dao.PrimaryKeyNotFoundRuntimeException; import org.seasar.extension.jdbc.PropertyType; import org.seasar.extension.jdbc.StatementFactory; @@ -24,19 +23,13 @@ //========================================================================== // ========= - // Definition - // ========== - protected static final boolean DEFAULT_VERSION_NO_AUTO_INCREMENT_ON_MEMORY = true; - - //========================================================================== - // ========= // Attribute // ========= private PropertyType[] propertyTypes; - private boolean checkSingleRowUpdate = true; + protected boolean optimisticLockHandling; - protected boolean versionNoAutoIncrementOnMemory = DEFAULT_VERSION_NO_AUTO_INCREMENT_ON_MEMORY; + protected boolean versionNoAutoIncrementOnMemory; //========================================================================== // ========= @@ -44,15 +37,10 @@ // =========== public InternalAbstractAutoStaticCommand(DataSource dataSource, StatementFactory statementFactory, BeanMetaData beanMetaData, - String[] propertyNames) { - this(dataSource, statementFactory, beanMetaData, propertyNames, - DEFAULT_VERSION_NO_AUTO_INCREMENT_ON_MEMORY); - } - - public InternalAbstractAutoStaticCommand(DataSource dataSource, - StatementFactory statementFactory, BeanMetaData beanMetaData, - String[] propertyNames, boolean versionNoAutoIncrementOnMemory) { + String[] propertyNames, boolean optimisticLockHandling, + boolean versionNoAutoIncrementOnMemory) { super(dataSource, statementFactory, beanMetaData); + this.optimisticLockHandling = optimisticLockHandling; this.versionNoAutoIncrementOnMemory = versionNoAutoIncrementOnMemory; setupPropertyTypes(propertyNames); setupSql(); @@ -62,26 +50,19 @@ // ========= // Execute // ======= - public Object execute(Object[] args) { + public Object execute(Object[] args) { // NOT for Batch. Batch should + // override. InternalAbstractAutoHandler handler = createAutoHandler(); + handler.setOptimisticLockHandling(optimisticLockHandling); + handler + .setVersionNoAutoIncrementOnMemory(versionNoAutoIncrementOnMemory); handler.setSql(getSql()); handler.setLoggingMessageSqlArgs(args); int rows = handler.execute(args); - if (isCheckSingleRowUpdate() && rows != 1) { - throw createNotSingleRowUpdatedRuntimeException(args[0], rows); - } return new Integer(rows); } - public boolean isCheckSingleRowUpdate() { - return checkSingleRowUpdate; - } - - public void setCheckSingleRowUpdate(boolean checkSingleRowUpdate) { - this.checkSingleRowUpdate = checkSingleRowUpdate; - } - - protected NotSingleRowUpdatedRuntimeException createNotSingleRowUpdatedRuntimeException( + protected EntityAlreadyUpdatedException createEntityAlreadyUpdatedException( Object bean, int rows) { return new EntityAlreadyUpdatedException(bean, rows); } @@ -194,7 +175,7 @@ protected void setupDeleteSql() { checkPrimaryKey(); - StringBuilder sb = new StringBuilder(100); + final StringBuilder sb = new StringBuilder(100); sb.append("delete from "); sb.append(getBeanMetaData().getTableName()); setupUpdateWhere(sb); @@ -215,11 +196,11 @@ sb.append(bmd.getPrimaryKey(i)).append(" = ? and "); } sb.setLength(sb.length() - 5); - if (bmd.hasVersionNoPropertyType()) { + if (optimisticLockHandling && bmd.hasVersionNoPropertyType()) { PropertyType pt = bmd.getVersionNoPropertyType(); sb.append(" and ").append(pt.getColumnName()).append(" = ?"); } - if (bmd.hasTimestampPropertyType()) { + if (optimisticLockHandling && bmd.hasTimestampPropertyType()) { PropertyType pt = bmd.getTimestampPropertyType(); sb.append(" and ").append(pt.getColumnName()).append(" = ?"); } Modified: userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/s2dao/internal/sqlcommand/InternalAbstractBatchAutoStaticCommand.java =================================================================== --- userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/s2dao/internal/sqlcommand/InternalAbstractBatchAutoStaticCommand.java 2008-12-26 22:11:31 UTC (rev 1622) +++ userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/s2dao/internal/sqlcommand/InternalAbstractBatchAutoStaticCommand.java 2008-12-27 22:02:56 UTC (rev 1623) @@ -15,49 +15,30 @@ //========================================================================== // ========= - // Attribute - // ========= - protected final boolean returningRows; - - //========================================================================== - // ========= // Constructor // =========== public InternalAbstractBatchAutoStaticCommand(DataSource dataSource, StatementFactory statementFactory, BeanMetaData beanMetaData, - String[] propertyNames, boolean returningRows) { - this(dataSource, statementFactory, beanMetaData, propertyNames, - returningRows, DEFAULT_VERSION_NO_AUTO_INCREMENT_ON_MEMORY); - } - - public InternalAbstractBatchAutoStaticCommand(DataSource dataSource, - StatementFactory statementFactory, BeanMetaData beanMetaData, - String[] propertyNames, boolean returningRows, + String[] propertyNames, boolean optimisticLockHandling, boolean versionNoAutoIncrementOnMemory) { super(dataSource, statementFactory, beanMetaData, propertyNames, - versionNoAutoIncrementOnMemory); - this.returningRows = returningRows; + optimisticLockHandling, versionNoAutoIncrementOnMemory); } //========================================================================== // ========= // Execute // ======= + @Override public Object execute(Object[] args) { final InternalAbstractBatchAutoHandler handler = createBatchAutoHandler(); - - // It is unnecessary! - // injectDaoClass(handler); - + handler.setOptimisticLockHandling(optimisticLockHandling); + handler + .setVersionNoAutoIncrementOnMemory(versionNoAutoIncrementOnMemory); handler.setSql(getSql()); // The logging message SQL of procedure is unnecessary. // handler.setLoggingMessageSqlArgs(args); - if (this.returningRows) { - return handler.executeBatch(args); - } else { - final int updatedRows = handler.execute(args); - return new Integer(updatedRows); - } + return handler.executeBatch(args); } protected abstract InternalAbstractBatchAutoHandler createBatchAutoHandler(); Modified: userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/s2dao/internal/sqlcommand/InternalAbstractDynamicCommand.java =================================================================== --- userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/s2dao/internal/sqlcommand/InternalAbstractDynamicCommand.java 2008-12-26 22:11:31 UTC (rev 1622) +++ userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/s2dao/internal/sqlcommand/InternalAbstractDynamicCommand.java 2008-12-27 22:02:56 UTC (rev 1623) @@ -44,10 +44,15 @@ } protected InternalSqlParser createInternalSqlParser(String sql) { - return new InternalSqlParser(sql); + return new InternalSqlParser(sql, isBlockNullParameter()); } - public CommandContext apply(Object[] args) {// It is necessary to be public! + protected boolean isBlockNullParameter() { // Extension Point! + return false; + } + + public CommandContext apply(Object[] args) { // It is necessary to be + // public! final CommandContext ctx = createCommandContext(args); rootNode.accept(ctx); return ctx; Modified: userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/s2dao/internal/sqlcommand/InternalAbstractSqlCommand.java =================================================================== --- userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/s2dao/internal/sqlcommand/InternalAbstractSqlCommand.java 2008-12-26 22:11:31 UTC (rev 1622) +++ userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/s2dao/internal/sqlcommand/InternalAbstractSqlCommand.java 2008-12-27 22:02:56 UTC (rev 1623) @@ -2,13 +2,16 @@ import javax.sql.DataSource; +import jp.sf.pal.userinfo.db.allcommon.bhv.core.SqlExecution; + import org.seasar.dao.SqlCommand; import org.seasar.extension.jdbc.StatementFactory; /** * @author DBFlute(AutoGenerator) */ -public abstract class InternalAbstractSqlCommand implements SqlCommand { +public abstract class InternalAbstractSqlCommand implements SqlCommand, + SqlExecution { //========================================================================== // ========= Modified: userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/s2dao/internal/sqlcommand/InternalDeleteAutoStaticCommand.java =================================================================== --- userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/s2dao/internal/sqlcommand/InternalDeleteAutoStaticCommand.java 2008-12-26 22:11:31 UTC (rev 1622) +++ userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/s2dao/internal/sqlcommand/InternalDeleteAutoStaticCommand.java 2008-12-27 22:02:56 UTC (rev 1623) @@ -20,8 +20,9 @@ // =========== public InternalDeleteAutoStaticCommand(DataSource dataSource, StatementFactory statementFactory, BeanMetaData beanMetaData, - String[] propertyNames) { - super(dataSource, statementFactory, beanMetaData, propertyNames); + String[] propertyNames, boolean optimisticLockHandling) { + super(dataSource, statementFactory, beanMetaData, propertyNames, + optimisticLockHandling, false); } //========================================================================== Modified: userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/s2dao/internal/sqlcommand/InternalDeleteBatchAutoStaticCommand.java =================================================================== --- userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/s2dao/internal/sqlcommand/InternalDeleteBatchAutoStaticCommand.java 2008-12-26 22:11:31 UTC (rev 1622) +++ userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/s2dao/internal/sqlcommand/InternalDeleteBatchAutoStaticCommand.java 2008-12-27 22:02:56 UTC (rev 1623) @@ -21,9 +21,9 @@ // =========== public InternalDeleteBatchAutoStaticCommand(DataSource dataSource, StatementFactory statementFactory, BeanMetaData beanMetaData, - String[] propertyNames, boolean returningRows) { + String[] propertyNames, boolean optimisticLockHandling) { super(dataSource, statementFactory, beanMetaData, propertyNames, - returningRows); + optimisticLockHandling, false); } //========================================================================== Modified: userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/s2dao/internal/sqlcommand/InternalDeleteQueryAutoDynamicCommand.java =================================================================== --- userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/s2dao/internal/sqlcommand/InternalDeleteQueryAutoDynamicCommand.java 2008-12-26 22:11:31 UTC (rev 1622) +++ userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/s2dao/internal/sqlcommand/InternalDeleteQueryAutoDynamicCommand.java 2008-12-27 22:02:56 UTC (rev 1623) @@ -2,6 +2,7 @@ import javax.sql.DataSource; +import jp.sf.pal.userinfo.db.allcommon.bhv.core.SqlExecution; import jp.sf.pal.userinfo.db.allcommon.cbean.ConditionBean; import jp.sf.pal.userinfo.db.allcommon.s2dao.internal.sqlhandler.InternalCommandContextHandler; import jp.sf.pal.userinfo.db.allcommon.s2dao.internal.sqlparser.InternalCommandContextCreator; @@ -16,7 +17,8 @@ /** * @author DBFlute(AutoGenerator) */ -public class InternalDeleteQueryAutoDynamicCommand implements SqlCommand { +public class InternalDeleteQueryAutoDynamicCommand implements SqlCommand, + SqlExecution { //========================================================================== // ========= @@ -83,7 +85,7 @@ String[] argNames, Class[] argTypes, Object[] args) { CommandContext context; { - InternalSqlParser parser = new InternalSqlParser(twoWaySql); + InternalSqlParser parser = new InternalSqlParser(twoWaySql, true); Node node = parser.parse(); InternalCommandContextCreator creator = new InternalCommandContextCreator( argNames, argTypes); Modified: userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/s2dao/internal/sqlcommand/InternalInsertAutoDynamicCommand.java =================================================================== --- userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/s2dao/internal/sqlcommand/InternalInsertAutoDynamicCommand.java 2008-12-26 22:11:31 UTC (rev 1622) +++ userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/s2dao/internal/sqlcommand/InternalInsertAutoDynamicCommand.java 2008-12-27 22:02:56 UTC (rev 1623) @@ -5,11 +5,11 @@ import javax.sql.DataSource; +import jp.sf.pal.userinfo.db.allcommon.bhv.core.SqlExecution; import jp.sf.pal.userinfo.db.allcommon.s2dao.internal.sqlhandler.InternalInsertAutoHandler; import org.seasar.dao.BeanMetaData; import org.seasar.dao.IdentifierGenerator; -import org.seasar.dao.NotSingleRowUpdatedRuntimeException; import org.seasar.dao.SqlCommand; import org.seasar.extension.jdbc.PropertyType; import org.seasar.extension.jdbc.StatementFactory; @@ -18,7 +18,8 @@ /** * @author DBFlute(AutoGenerator) */ -public class InternalInsertAutoDynamicCommand implements SqlCommand { +public class InternalInsertAutoDynamicCommand implements SqlCommand, + SqlExecution { //========================================================================== // ========= @@ -32,8 +33,6 @@ protected String[] propertyNames; - protected boolean checkSingleRowUpdate = true; - //========================================================================== // ========= // Constructor @@ -56,9 +55,6 @@ handler.setSql(sql); handler.setLoggingMessageSqlArgs(args); final int rows = handler.execute(args); - if (isCheckSingleRowUpdate() && rows != 1) { - throw new NotSingleRowUpdatedRuntimeException(args[0], rows); - } return new Integer(rows); } @@ -161,12 +157,4 @@ public void setPropertyNames(String[] propertyNames) { this.propertyNames = propertyNames; } - - public boolean isCheckSingleRowUpdate() { - return checkSingleRowUpdate; - } - - public void setCheckSingleRowUpdate(boolean checkSingleRowUpdate) { - this.checkSingleRowUpdate = checkSingleRowUpdate; - } } Modified: userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/s2dao/internal/sqlcommand/InternalInsertBatchAutoStaticCommand.java =================================================================== --- userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/s2dao/internal/sqlcommand/InternalInsertBatchAutoStaticCommand.java 2008-12-26 22:11:31 UTC (rev 1622) +++ userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/s2dao/internal/sqlcommand/InternalInsertBatchAutoStaticCommand.java 2008-12-27 22:02:56 UTC (rev 1623) @@ -21,9 +21,9 @@ // =========== public InternalInsertBatchAutoStaticCommand(DataSource dataSource, StatementFactory statementFactory, BeanMetaData beanMetaData, - String[] propertyNames, boolean returningRows) { - super(dataSource, statementFactory, beanMetaData, propertyNames, - returningRows); + String[] propertyNames) { + super(dataSource, statementFactory, beanMetaData, propertyNames, false, + false); } //========================================================================== Modified: userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/s2dao/internal/sqlcommand/InternalProcedureCommand.java =================================================================== --- userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/s2dao/internal/sqlcommand/InternalProcedureCommand.java 2008-12-26 22:11:31 UTC (rev 1622) +++ userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/s2dao/internal/sqlcommand/InternalProcedureCommand.java 2008-12-27 22:02:56 UTC (rev 1623) @@ -2,6 +2,7 @@ import javax.sql.DataSource; +import jp.sf.pal.userinfo.db.allcommon.bhv.core.SqlExecution; import jp.sf.pal.userinfo.db.allcommon.cbean.outsidesql.OutsideSqlContext; import jp.sf.pal.userinfo.db.allcommon.s2dao.internal.sqlhandler.InternalProcedureHandler; import jp.sf.pal.userinfo.db.allcommon.s2dao.internal.various.InternalProcedureMetaData; @@ -13,7 +14,7 @@ /** * @author DBFlute(AutoGenerator) */ -public class InternalProcedureCommand implements SqlCommand { +public class InternalProcedureCommand implements SqlCommand, SqlExecution { //========================================================================== // ========= Modified: userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/s2dao/internal/sqlcommand/InternalUpdateAutoDynamicCommand.java =================================================================== --- userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/s2dao/internal/sqlcommand/InternalUpdateAutoDynamicCommand.java 2008-12-26 22:11:31 UTC (rev 1622) +++ userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/s2dao/internal/sqlcommand/InternalUpdateAutoDynamicCommand.java 2008-12-27 22:02:56 UTC (rev 1623) @@ -5,29 +5,27 @@ import javax.sql.DataSource; +import jp.sf.pal.userinfo.db.allcommon.XLog; import jp.sf.pal.userinfo.db.allcommon.s2dao.internal.sqlhandler.InternalUpdateAutoHandler; import org.seasar.dao.BeanMetaData; import org.seasar.dao.NoUpdatePropertyTypeRuntimeException; -import org.seasar.dao.impl.AbstractSqlCommand; import org.seasar.extension.jdbc.PropertyType; import org.seasar.extension.jdbc.StatementFactory; /** * @author DBFlute(AutoGenerator) */ -public class InternalUpdateAutoDynamicCommand extends AbstractSqlCommand { +public class InternalUpdateAutoDynamicCommand extends + InternalAbstractSqlCommand { //========================================================================== // ========= // Definition // ========== - /** Log instance. */ - private static final org.apache.commons.logging.Log _log = org.apache.commons.logging.LogFactory - .getLog(InternalUpdateAutoDynamicCommand.class); + /** The result for no update as normal execution. */ + private static final Integer NO_UPDATE = new Integer(1); - private static final Integer NO_UPDATE = new Integer(0); - //========================================================================== // ========= // Attribute @@ -36,9 +34,9 @@ private String[] propertyNames; - private boolean checkSingleRowUpdate = true; + private boolean optimisticLockHandling; - private boolean versionNoAutoIncrementOnMemory = true; + private boolean versionNoAutoIncrementOnMemory; //========================================================================== // ========= @@ -59,8 +57,8 @@ final PropertyType[] propertyTypes = createUpdatePropertyTypes(bmd, bean, getPropertyNames()); if (propertyTypes.length == 0) { - if (_log.isDebugEnabled()) { - _log.debug(createNoUpdateLogMessage(bean, bmd)); + if (isLogEnabled()) { + log(createNoUpdateLogMessage(bean, bmd)); } return NO_UPDATE; } @@ -83,10 +81,10 @@ BeanMetaData bmd, PropertyType[] propertyTypes) { InternalUpdateAutoHandler handler = new InternalUpdateAutoHandler( getDataSource(), getStatementFactory(), bmd, propertyTypes); + handler.setOptimisticLockHandling(optimisticLockHandling); //[DBFlute-0.8 + // .0] handler .setVersionNoAutoIncrementOnMemory(versionNoAutoIncrementOnMemory); - handler.setCheckSingleRowUpdate(isCheckSingleRowUpdate()); //[DBFlute-0.8 - // .0] return handler; } @@ -182,17 +180,33 @@ sb.append(bmd.getPrimaryKey(i)).append(" = ? and "); } sb.setLength(sb.length() - 5); - if (bmd.hasVersionNoPropertyType()) { + if (optimisticLockHandling && bmd.hasVersionNoPropertyType()) { PropertyType pt = bmd.getVersionNoPropertyType(); sb.append(" and ").append(pt.getColumnName()).append(" = ?"); } - if (bmd.hasTimestampPropertyType()) { + if (optimisticLockHandling && bmd.hasTimestampPropertyType()) { PropertyType pt = bmd.getTimestampPropertyType(); sb.append(" and ").append(pt.getColumnName()).append(" = ?"); } return sb.toString(); } + //========================================================================== + // ========= + // Execute Status Log + // ================== + protected void log(String msg) { + XLog.log(msg); + } + + protected boolean isLogEnabled() { + return XLog.isLogEnabled(); + } + + //========================================================================== + // ========= + // Accessor + // ======== protected boolean isVersionNoAutoIncrementOnMemory() { return versionNoAutoIncrementOnMemory; } @@ -223,11 +237,7 @@ this.propertyNames = propertyNames; } - public boolean isCheckSingleRowUpdate() { - return checkSingleRowUpdate; + public void setOptimisticLockHandling(boolean optimisticLockHandling) { + this.optimisticLockHandling = optimisticLockHandling; } - - public void setCheckSingleRowUpdate(boolean resultCheck) { - this.checkSingleRowUpdate = resultCheck; - } } Modified: userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/s2dao/internal/sqlcommand/InternalUpdateBatchAutoStaticCommand.java =================================================================== --- userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/s2dao/internal/sqlcommand/InternalUpdateBatchAutoStaticCommand.java 2008-12-26 22:11:31 UTC (rev 1622) +++ userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/s2dao/internal/sqlcommand/InternalUpdateBatchAutoStaticCommand.java 2008-12-27 22:02:56 UTC (rev 1623) @@ -21,10 +21,10 @@ // =========== public InternalUpdateBatchAutoStaticCommand(DataSource dataSource, StatementFactory statementFactory, BeanMetaData beanMetaData, - String[] propertyNames, boolean returningRows, + String[] propertyNames, boolean optimisticLockHandling, boolean versionNoAutoIncrementOnMemory) { super(dataSource, statementFactory, beanMetaData, propertyNames, - returningRows, versionNoAutoIncrementOnMemory); + optimisticLockHandling, versionNoAutoIncrementOnMemory); } //========================================================================== Modified: userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/s2dao/internal/sqlcommand/InternalUpdateDynamicCommand.java =================================================================== --- userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/s2dao/internal/sqlcommand/InternalUpdateDynamicCommand.java 2008-12-26 22:11:31 UTC (rev 1622) +++ userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/s2dao/internal/sqlcommand/InternalUpdateDynamicCommand.java 2008-12-27 22:02:56 UTC (rev 1623) @@ -28,11 +28,16 @@ // ======= public Object execute(Object args[]) { final CommandContext ctx = apply(args); - final InternalBasicUpdateHandler updateHandler = new InternalBasicUpdateHandler( - getDataSource(), ctx.getSql(), getStatementFactory()); - Object[] bindVariables = ctx.getBindVariables(); + final InternalBasicUpdateHandler updateHandler = createBasicUpdateHandler(ctx); + final Object[] bindVariables = ctx.getBindVariables(); updateHandler.setLoggingMessageSqlArgs(bindVariables); return new Integer(updateHandler.execute(bindVariables, ctx .getBindVariableTypes())); } + + protected InternalBasicUpdateHandler createBasicUpdateHandler( + CommandContext ctx) { + return new InternalBasicUpdateHandler(getDataSource(), ctx.getSql(), + getStatementFactory()); + } } Modified: userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/s2dao/internal/sqlcommand/InternalUpdateQueryAutoDynamicCommand.java =================================================================== --- userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/s2dao/internal/sqlcommand/InternalUpdateQueryAutoDynamicCommand.java 2008-12-26 22:11:31 UTC (rev 1622) +++ userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/s2dao/internal/sqlcommand/InternalUpdateQueryAutoDynamicCommand.java 2008-12-27 22:02:56 UTC (rev 1623) @@ -10,6 +10,7 @@ import javax.sql.DataSource; import jp.sf.pal.userinfo.db.allcommon.Entity; +import jp.sf.pal.userinfo.db.allcommon.bhv.core.SqlExecution; import jp.sf.pal.userinfo.db.allcommon.cbean.ConditionBean; import jp.sf.pal.userinfo.db.allcommon.dbmeta.DBMeta; import jp.sf.pal.userinfo.db.allcommon.dbmeta.DBMetaInstanceHandler; @@ -27,7 +28,8 @@ /** * @author DBFlute(AutoGenerator) */ -public class InternalUpdateQueryAutoDynamicCommand implements SqlCommand { +public class InternalUpdateQueryAutoDynamicCommand implements SqlCommand, + SqlExecution { //========================================================================== // ========= @@ -209,7 +211,7 @@ String[] argNames, Class[] argTypes, Object[] args) { CommandContext context; { - InternalSqlParser parser = new InternalSqlParser(twoWaySql); + InternalSqlParser parser = new InternalSqlParser(twoWaySql, true); Node node = parser.parse(); InternalCommandContextCreator creator = new InternalCommandContextCreator( argNames, argTypes); Modified: userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/s2dao/internal/sqlhandler/InternalAbstractAutoHandler.java =================================================================== --- userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/s2dao/internal/sqlhandler/InternalAbstractAutoHandler.java 2008-12-26 22:11:31 UTC (rev 1622) +++ userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/s2dao/internal/sqlhandler/InternalAbstractAutoHandler.java 2008-12-27 22:02:56 UTC (rev 1623) @@ -10,12 +10,14 @@ import javax.sql.DataSource; +import jp.sf.pal.userinfo.db.allcommon.exception.EntityAlreadyUpdatedException; +import jp.sf.pal.userinfo.db.allcommon.util.SimpleTypeUtil; + import org.seasar.dao.BeanMetaData; import org.seasar.extension.jdbc.PropertyType; import org.seasar.extension.jdbc.StatementFactory; import org.seasar.extension.jdbc.ValueType; import org.seasar.framework.beans.PropertyDesc; -import org.seasar.framework.util.IntegerConversionUtil; /** * @author DBFlute(AutoGenerator) @@ -38,8 +40,10 @@ protected PropertyType[] propertyTypes; - protected boolean versionNoAutoIncrementOnMemory = true; + protected boolean optimisticLockHandling; + protected boolean versionNoAutoIncrementOnMemory; + //========================================================================== // ========= // Constructor @@ -52,6 +56,10 @@ this.propertyTypes = propertyTypes; } + //========================================================================== + // ========= + // Execute + // ======= public int execute(Object[] args) { Connection connection = getConnection(); try { @@ -77,6 +85,9 @@ } finally { close(ps); } + if (optimisticLockHandling && ret != 1) { + throw createEntityAlreadyUpdatedException(bean, ret); + } postUpdateBean(bean, ret); return ret; } @@ -96,12 +107,25 @@ } } + protected EntityAlreadyUpdatedException createEntityAlreadyUpdatedException( + Object bean, int rows) { + return new EntityAlreadyUpdatedException(bean, rows); + } + + //========================================================================== + // ========= + // Pre/Post Bean + // ============= protected void preUpdateBean(Object bean) { } protected void postUpdateBean(Object bean, int ret) { } + //========================================================================== + // ========= + // Bind Setupper + // ============= protected abstract void setupBindVariables(Object bean); protected void setupInsertBindVariables(Object bean) { @@ -149,7 +173,7 @@ if (value == null) { continue;// because of 'VERSION_NO = VERSION_NO + 1' } - int intValue = IntegerConversionUtil.toPrimitiveInt(value) + 1; + int intValue = SimpleTypeUtil.toPrimitiveInt(value) + 1; setVersionNo(new Integer(intValue)); varList.add(getVersionNo()); } else { @@ -182,13 +206,13 @@ varList.add(pd.getValue(bean)); varValueTypeList.add(pt.getValueType()); } - if (bmd.hasVersionNoPropertyType()) { + if (optimisticLockHandling && bmd.hasVersionNoPropertyType()) { PropertyType pt = bmd.getVersionNoPropertyType(); PropertyDesc pd = pt.getPropertyDesc(); varList.add(pd.getValue(bean)); varValueTypeList.add(pt.getValueType()); } - if (bmd.hasTimestampPropertyType()) { + if (optimisticLockHandling && bmd.hasTimestampPropertyType()) { PropertyType pt = bmd.getTimestampPropertyType(); PropertyDesc pd = pt.getPropertyDesc(); varList.add(pd.getValue(bean)); @@ -260,6 +284,14 @@ this.propertyTypes = propertyTypes; } + public boolean isOptimisticLockHandling() { + return optimisticLockHandling; + } + + public void setOptimisticLockHandling(boolean optimisticLockHandling) { + this.optimisticLockHandling = optimisticLockHandling; + } + protected boolean isVersionNoAutoIncrementOnMemory() { return versionNoAutoIncrementOnMemory; } Modified: userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/s2dao/internal/sqlhandler/InternalAbstractBatchAutoHandler.java =================================================================== --- userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/s2dao/internal/sqlhandler/InternalAbstractBatchAutoHandler.java 2008-12-26 22:11:31 UTC (rev 1622) +++ userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/s2dao/internal/sqlhandler/InternalAbstractBatchAutoHandler.java 2008-12-27 22:02:56 UTC (rev 1623) @@ -9,6 +9,11 @@ import javax.sql.DataSource; +import jp.sf.pal.userinfo.db.allcommon.DBDef; +import jp.sf.pal.userinfo.db.allcommon.exception.BatchEntityAlreadyUpdatedException; +import jp.sf.pal.userinfo.db.allcommon.exception.EntityAlreadyDeletedException; +import jp.sf.pal.userinfo.db.allcommon.exception.EntityDuplicatedException; + import org.seasar.dao.BeanMetaData; import org.seasar.extension.jdbc.PropertyType; import org.seasar.extension.jdbc.StatementFactory; @@ -41,6 +46,39 @@ // ========= // Execute // ======= + public int execute(Object[] args) { + List list = null; + if (args[0] instanceof Object[]) { + list = Arrays.asList((Object[]) args[0]); + } else if (args[0] instanceof List) { + list = (List) args[0]; + } + if (list == null) { + throw new IllegalArgumentException("args[0]"); + } + int[] ret = execute(list); + int updatedRow = 0; + for (int i = 0; i < ret.length; i++) { + if (ret[i] > 0) { + updatedRow += ret[i]; + } + } + return updatedRow; + } + + public int[] executeBatch(Object[] args) { + List list = null; + if (args[0] instanceof Object[]) { + list = Arrays.asList((Object[]) args[0]); + } else if (args[0] instanceof List) { + list = (List) args[0]; + } + if (list == null) { + throw new IllegalArgumentException("args[0]"); + } + return execute(list); + } + public int[] execute(List list, Class[] argTypes) { return execute(list); } @@ -63,7 +101,9 @@ final Object bean = (Object) iter.next(); prepareBatchElement(ps, bean); } - return executeBatch(ps, list); + final int[] result = executeBatch(ps, list); + handleBatchUpdateResultWithOptimisticLock(ps, list, result); + return result; } finally { close(ps); } @@ -74,46 +114,100 @@ // postBatchUpdateBean(...); } - public int execute(Object[] args) { - List list = null; - if (args[0] instanceof Object[]) { - list = Arrays.asList((Object[]) args[0]); - } else if (args[0] instanceof List) { - list = (List) args[0]; + protected void prepareBatchElement(PreparedStatement ps, Object bean) { + setupBindVariables(bean); + logSql(getBindVariables(), getArgTypes(getBindVariables())); + bindArgs(ps, getBindVariables(), getBindVariableValueTypes()); + addBatch(ps); + } + + //========================================================================== + // ========= + // Optimistic Lock + // =============== + protected void handleBatchUpdateResultWithOptimisticLock( + PreparedStatement ps, List list, int[] result) { + if (DBDef.isCurrentDef(DBDef.Oracle)) { + final int updateCount; + try { + updateCount = ps.getUpdateCount(); + } catch (SQLException e) { + handleSQLException(e, ps); + return; // Unreachable! + } + handleBatchUpdateResultWithOptimisticLockByUpdateCount(list, + updateCount); + } else { + handleBatchUpdateResultWithOptimisticLockByResult(list, result); } - if (list == null) { - throw new IllegalArgumentException("args[0]"); + } + + protected void handleBatchUpdateResultWithOptimisticLockByUpdateCount( + List list, int updateCount) { + if (list.isEmpty()) { + return;// for Safety! } - int[] ret = execute(list); - int updatedRow = 0; - for (int i = 0; i < ret.length; i++) { - if (ret[i] > 0) { - updatedRow += ret[i]; + if (updateCount < 0) { + return;// for Safety! + } + final int entityCount = list.size(); + if (updateCount < entityCount) { + if (isOptimisticLockHandling()) { + throw new BatchEntityAlreadyUpdatedException(list.get(0), 0, + updateCount); + } else { + String msg = "The entity have already deleted:"; + msg = msg + " updateCount=" + updateCount; + msg = msg + " entityCount=" + entityCount; + msg = msg + " allEntities=" + list; + throw new EntityAlreadyDeletedException(msg); } } - return updatedRow; } - public int[] executeBatch(Object[] args) { - List list = null; - if (args[0] instanceof Object[]) { - list = Arrays.asList((Object[]) args[0]); - } else if (args[0] instanceof List) { - list = (List) args[0]; + protected void handleBatchUpdateResultWithOptimisticLockByResult( + List list, int[] result) { + if (list.isEmpty()) { + return;// for Safety! } - if (list == null) { - throw new IllegalArgumentException("args[0]"); + final int[] updatedCountArray = result; + final int entityCount = list.size(); + int index = 0; + boolean alreadyUpdated = false; + for (int oneUpdateCount : updatedCountArray) { + if (entityCount <= index) { + break;// for Safety! + } + if (oneUpdateCount == 0) { + alreadyUpdated = true; + break; + } else if (oneUpdateCount > 1) { + String msg = "The entity updated two or more records in batch update:"; + msg = msg + " entity=" + list.get(index); + msg = msg + " updatedCount=" + oneUpdateCount; + msg = msg + " allEntities=" + list; + throw new EntityDuplicatedException(msg); + } + ++index; } - return execute(list); + if (alreadyUpdated) { + int updateCount = 0; + for (int oneUpdateCount : updatedCountArray) { + updateCount = updateCount + oneUpdateCount; + } + if (isOptimisticLockHandling()) { + throw new BatchEntityAlreadyUpdatedException(list.get(index), + 0, updateCount); + } else { + String msg = "The entity have already deleted:"; + msg = msg + " entity=" + list.get(index); + msg = msg + " updateCount=" + updateCount; + msg = msg + " allEntities=" + list; + throw new EntityAlreadyDeletedException(msg); + } + } } - protected void prepareBatchElement(PreparedStatement ps, Object bean) { - setupBindVariables(bean); - logSql(getBindVariables(), getArgTypes(getBindVariables())); - bindArgs(ps, getBindVariables(), getBindVariableValueTypes()); - addBatch(ps); - } - //========================================================================== // ========= // JDBC Delegator Modified: userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/s2dao/internal/sqlhandler/InternalBasicHandler.java =================================================================== --- userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/s2dao/internal/sqlhandler/InternalBasicHandler.java 2008-12-26 22:11:31 UTC (rev 1622) +++ userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/s2dao/internal/sqlhandler/InternalBasicHandler.java 2008-12-27 22:02:56 UTC (rev 1623) @@ -9,6 +9,7 @@ import javax.sql.DataSource; import jp.sf.pal.userinfo.db.allcommon.CallbackContext; +import jp.sf.pal.userinfo.db.allcommon.DBDef; import jp.sf.pal.userinfo.db.allcommon.DBFluteConfig; import jp.sf.pal.userinfo.db.allcommon.InternalMapContext; import jp.sf.pal.userinfo.db.allcommon.QLog; @@ -25,7 +26,6 @@ import org.seasar.extension.jdbc.StatementFactory; import org.seasar.extension.jdbc.ValueType; import org.seasar.extension.jdbc.types.ValueTypes; -import org.seasar.framework.exception.SQLRuntimeException; /** * @author DBFlute(AutoGenerator) @@ -73,7 +73,7 @@ return; } for (int i = 0; i < args.length; ++i) { - ValueType valueType = getValueType(argTypes[i]); + final ValueType valueType = findValueType(args[i], argTypes[i]); try { valueType.bindValue(ps, i + 1, args[i]); } catch (SQLException e) { @@ -82,6 +82,19 @@ } } + protected ValueType findValueType(Object arg, Class argType) { + ValueType valueType = ValueTypes.getValueType(arg); + if (valueType != null) { + return valueType; + } + valueType = ValueTypes.getValueType(argType); + if (valueType != null) { + return valueType; + } + String msg = "Unknown type¡§argType=" + argType + " args=" + arg; + throw new IllegalStateException(msg); + } + protected Class[] getArgTypes(Object[] args) { if (args == null) { return null; @@ -151,10 +164,6 @@ return InternalBindVariableUtil.getBindVariableText(bindVariable); } - protected ValueType getValueType(Class clazz) { - return ValueTypes.getValueType(clazz); - } - //========================================================================== // ========= // Exception Handler @@ -194,9 +203,6 @@ public void handleSQLException(SQLException e, Statement statement, boolean uniqueConstraintValid, String completeSql) { - if (isSqlExceptionOldStyleHandling()) { - throw new SQLRuntimeException(e); - } if (uniqueConstraintValid && isUniqueConstraintException(e)) { throwEntityAlreadyExistsException(e, statement, completeSql); } @@ -217,10 +223,6 @@ .getUniqueConstraintDeterminator(); } - protected boolean isSqlExceptionOldStyleHandling() { - return DBFluteConfig.getInstance().isSqlExceptionOldStyleHandling(); - } - protected void throwEntityAlreadyExistsException(SQLException e, Statement statement, String completeSql) { String msg = "Look! Read the message below." + getLineSeparator(); @@ -560,7 +562,7 @@ // ========= // Assist Helper // ============= - // It needs this method if the target database doest not support line + // It needs this method if the target database does not support line // comment. protected String removeLineComment(final String sql) { // With removing CR! if (sql == null || sql.trim().length() == 0) { @@ -578,7 +580,8 @@ } sb.append(line).append("\n"); } - return sb.toString(); + final String filteredSql = sb.toString(); + return filteredSql.substring(0, filteredSql.lastIndexOf("\n")); } //========================================================================== @@ -606,9 +609,17 @@ } public void setSql(String sql) { + if (isRemoveLineCommentFromSql()) { + sql = removeLineComment(sql); + } this.sql = sql; } + protected boolean isRemoveLineCommentFromSql() { + // Because the MS-Access does not support line comments. + return DBDef.isCurrentDef(DBDef.MSAccess); + } + public StatementFactory getStatementFactory() { return statementFactory; } Modified: userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/s2dao/internal/sqlhandler/InternalBasicSelectHandler.java =================================================================== --- userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/s2dao/internal/sqlhandler/InternalBasicSelectHandler.java 2008-12-26 22:11:31 UTC (rev 1622) +++ userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/s2dao/internal/sqlhandler/InternalBasicSelectHandler.java 2008-12-27 22:02:56 UTC (rev 1623) @@ -45,8 +45,7 @@ return execute(args, getArgTypes(args)); } - @SuppressWarnings("unchecked") - public Object execute(Object[] args, Class[] argTypes) { + public Object execute(Object[] args, Class[] argTypes) { Connection conn = getConnection(); try { return execute(conn, args, argTypes); @@ -55,8 +54,7 @@ } } - @SuppressWarnings("unchecked") - public Object execute(Connection conn, Object[] args, Class[] argTypes) { + public Object execute(Connection conn, Object[] args, Class[] argTypes) { logSql(args, argTypes); PreparedStatement ps = null; try { Modified: userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/s2dao/internal/sqlhandler/InternalBasicUpdateHandler.java =================================================================== --- userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/s2dao/internal/sqlhandler/InternalBasicUpdateHandler.java 2008-12-26 22:11:31 UTC (rev 1622) +++ userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/s2dao/internal/sqlhandler/InternalBasicUpdateHandler.java 2008-12-27 22:02:56 UTC (rev 1623) @@ -29,8 +29,7 @@ return execute(args, getArgTypes(args)); } - @SuppressWarnings("unchecked") - public int execute(Object[] args, Class[] argTypes) { + public int execute(Object[] args, Class[] argTypes) { Connection connection = getConnection(); try { return execute(connection, args, argTypes); @@ -39,8 +38,7 @@ } } - @SuppressWarnings("unchecked") - public int execute(Connection connection, Object[] args, Class[] argTypes) { + public int execute(Connection connection, Object[] args, Class[] argTypes) { logSql(args, argTypes); PreparedStatement ps = prepareStatement(connection); try { Modified: userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/s2dao/internal/sqlhandler/InternalInsertAutoHandler.java =================================================================== --- userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/s2dao/internal/sqlhandler/InternalInsertAutoHandler.java 2008-12-26 22:11:31 UTC (rev 1622) +++ userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/s2dao/internal/sqlhandler/InternalInsertAutoHandler.java 2008-12-27 22:02:56 UTC (rev 1623) @@ -20,6 +20,7 @@ StatementFactory statementFactory, BeanMetaData beanMetaData, PropertyType[] propertyTypes) { super(dataSource, statementFactory, beanMetaData, propertyTypes); + setOptimisticLockHandling(false); } //========================================================================== Modified: userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/s2dao/internal/sqlhandler/InternalInsertBatchAutoHandler.java =================================================================== --- userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/s2dao/internal/sqlhandler/InternalInsertBatchAutoHandler.java 2008-12-26 22:11:31 UTC (rev 1622) +++ userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/s2dao/internal/sqlhandler/InternalInsertBatchAutoHandler.java 2008-12-27 22:02:56 UTC (rev 1623) @@ -19,8 +19,8 @@ public InternalInsertBatchAutoHandler(DataSource dataSource, StatementFactory statementFactory, BeanMetaData beanMetaData, PropertyType[] propertyTypes) { - super(dataSource, statementFactory, beanMetaData, propertyTypes); + setOptimisticLockHandling(false); } //========================================================================== Modified: userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/s2dao/internal/sqlhandler/InternalProcedureHandler.java =================================================================== --- userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/s2dao/internal/sqlhandler/InternalProcedureHandler.java 2008-12-26 22:11:31 UTC (rev 1622) +++ userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/s2dao/internal/sqlhandler/InternalProcedureHandler.java 2008-12-27 22:02:56 UTC (rev 1623) @@ -12,6 +12,7 @@ import javax.sql.DataSource; +import jp.sf.pal.userinfo.db.allcommon.helper.StringKeyMap; import jp.sf.pal.userinfo.db.allcommon.s2dao.internal.various.InternalProcedureMetaData; import jp.sf.pal.userinfo.db.allcommon.s2dao.internal.various.InternalProcedureParameterType; @@ -21,7 +22,6 @@ import org.seasar.extension.jdbc.ValueType; import org.seasar.extension.jdbc.impl.PropertyTypeImpl; import org.seasar.extension.jdbc.types.ValueTypes; -import org.seasar.framework.util.CaseInsensitiveMap; /** * @author DBFlute(AutoGenerator) @@ -220,10 +220,9 @@ protected static abstract class InternalAbstractMapResultSetHandler implements ResultSetHandler { - @SuppressWarnings("unchecked") protected Map createRow(ResultSet rs, PropertyType[] propertyTypes) throws SQLException { - Map row = new CaseInsensitiveMap(); + Map row = StringKeyMap.createAsFlexible(); for (int i = 0; i < propertyTypes.length; ++i) { Object value = propertyTypes[i].getValueType().getValue(rs, i + 1); Modified: userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/s2dao/internal/sqlhandler/InternalUpdateAutoHandler.java =================================================================== --- userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/s2dao/internal/sqlhandler/InternalUpdateAutoHandler.java 2008-12-26 22:11:31 UTC (rev 1622) +++ userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/s2dao/internal/sqlhandler/InternalUpdateAutoHandler.java 2008-12-27 22:02:56 UTC (rev 1623) @@ -2,8 +2,6 @@ import javax.sql.DataSource; -import jp.sf.pal.userinfo.db.allcommon.exception.EntityAlreadyUpdatedException; - import org.seasar.dao.BeanMetaData; import org.seasar.extension.jdbc.PropertyType; import org.seasar.extension.jdbc.StatementFactory; @@ -17,12 +15,6 @@ // ========= // Constructor // =========== - private boolean checkSingleRowUpdate = true; - - //========================================================================== - // ========= - // Constructor - // =========== public InternalUpdateAutoHandler(DataSource dataSource, StatementFactory statementFactory, BeanMetaData beanMetaData, PropertyType[] propertyTypes) { @@ -41,27 +33,7 @@ @Override protected void postUpdateBean(Object bean, int ret) { - if (isCheckSingleRowUpdate() && ret < 1) { - throw createEntityAlreadyUpdatedException(bean, ret); - } updateVersionNoIfNeed(bean); updateTimestampIfNeed(bean); } - - protected EntityAlreadyUpdatedException createEntityAlreadyUpdatedException( - Object bean, int rows) { - return new EntityAlreadyUpdatedException(bean, rows); - } - - //========================================================================== - // ========= - // Accessor - // ======== - public boolean isCheckSingleRowUpdate() { - return checkSingleRowUpdate; - } - - public void setCheckSingleRowUpdate(boolean resultCheck) { - this.checkSingleRowUpdate = resultCheck; - } } Modified: userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/s2dao/internal/sqlparser/InternalSqlParser.java =================================================================== --- userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/s2dao/internal/sqlparser/InternalSqlParser.java 2008-12-26 22:11:31 UTC (rev 1622) +++ userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/s2dao/internal/sqlparser/InternalSqlParser.java 2008-12-27 22:02:56 UTC (rev 1623) @@ -45,22 +45,25 @@ // ========= // Attribute // ========= + protected String specifiedSql; + + protected boolean blockNullParameter; + protected InternalSqlTokenizer tokenizer; protected Stack nodeStack = new Stack(); - protected String specifiedSql;// Extension! - //========================================================================== // ========= // Constructor // =========== - public InternalSqlParser(String sql) { + public InternalSqlParser(String sql, boolean blockNullParameter) { sql = sql.trim(); if (sql.endsWith(";")) { sql = sql.substring(0, sql.length() - 1); } - specifiedSql = sql;// Extension! + specifiedSql = sql; + this.blockNullParameter = blockNullParameter; tokenizer = new InternalSqlTokenizer(sql); } @@ -303,12 +306,14 @@ protected AbstractNode createBindVariableNode(String expr, String testValue) {// Extension // ! - return new InternalBindVariableNode(expr, testValue, specifiedSql); + return new InternalBindVariableNode(expr, testValue, specifiedSql, + blockNullParameter); } protected AbstractNode createEmbeddedValueNode(String expr, String testValue) {// Extension // ! - return new InternalEmbeddedValueNode(expr, testValue, specifiedSql); + return new InternalEmbeddedValueNode(expr, testValue, specifiedSql, + blockNullParameter); } protected ContainerNode createIfNode(String expr) {// Extension! @@ -344,12 +349,15 @@ protected String _specifiedSql; + protected boolean _blockNullParameter; + public InternalBindVariableNode(String expression, String testValue, - String specifiedSql) { + String specifiedSql, boolean blockNullParameter) { this._expression = expression; this._testValue = testValue; this._names = InternalStringUtil.split(expression, "."); this._specifiedSql = specifiedSql; + this._blockNullParameter = blockNullParameter; } public void accept(CommandContext ctx) { @@ -360,7 +368,7 @@ valueAndType.setTargetType(clazz); setupValueAndType(valueAndType); - if (valueAndType.getTargetValue() == null) { + if (_blockNullParameter && valueAndType.getTargetValue() == null) { throwBindOrEmbeddedParameterNullValueException(valueAndType); } if (!isInScope()) { @@ -462,12 +470,15 @@ protected String _specifiedSql; + protected boolean _blockNullParameter; + public InternalEmbeddedValueNode(String expression, String testValue, - String specifiedSql) { + String specifiedSql, boolean blockNullParameter) { this._expression = expression; this._testValue = testValue; this._names = InternalStringUtil.split(expression, "."); this._specifiedSql = specifiedSql; + this._blockNullParameter = blockNullParameter; } public void accept(CommandContext ctx) { @@ -478,7 +489,7 @@ valueAndType.setTargetType(clazz); setupValueAndType(valueAndType); - if (valueAndType.getTargetValue() == null) { + if (_blockNullParameter && valueAndType.getTargetValue() == null) { throwBindOrEmbeddedParameterNullValueException(valueAndType); } if (!isInScope()) { @@ -1276,7 +1287,8 @@ String[] argNames, Class[] argTypes, Object[] args) { final CommandContext context; { - final InternalSqlParser parser = new InternalSqlParser(twoWaySql); + final InternalSqlParser parser = new InternalSqlParser(twoWaySql, + false); final Node node = parser.parse(); final InternalCommandContextCreator creator = new InternalCommandContextCreator( argNames, argTypes); Added: userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/s2dao/internal/various/InternalIdentifierAbstractGenerator.java =================================================================== --- userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/s2dao/internal/various/InternalIdentifierAbstractGenerator.java (rev 0) +++ userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/s2dao/internal/various/InternalIdentifierAbstractGenerator.java 2008-12-27 22:02:56 UTC (rev 1623) @@ -0,0 +1,146 @@ +package jp.sf.pal.userinfo.db.allcommon.s2dao.internal.various; + +import java.sql.CallableStatement; +import java.sql.Connection; +import java.sql.PreparedStatement; +import java.sql.ResultSet; +import java.sql.SQLException; +import java.sql.Statement; + +import javax.sql.DataSource; + +import jp.sf.pal.userinfo.db.allcommon.s2dao.internal.sqlhandler.InternalBasicSelectHandler; +import jp.sf.pal.userinfo.db.allcommon.s2dao.internal.sqlhandler.InternalBasicHandler.SQLExceptionHandler; + +import org.seasar.dao.Dbms; +import org.seasar.dao.IdentifierGenerator; +import org.seasar.extension.jdbc.PropertyType; +import org.seasar.extension.jdbc.ResultSetHandler; +import org.seasar.extension.jdbc.StatementFactory; +import org.seasar.extension.jdbc.ValueType; +import org.seasar.framework.beans.PropertyDesc; + +/** + * @author DBFlute(AutoGenerator) + */ +public abstract class InternalIdentifierAbstractGenerator implements + IdentifierGenerator { + + //========================================================================== + // ========= + // Attribute + // ========= + protected PropertyType propertyType; + + protected Dbms dbms; + + protected ResultSetHandler resultSetHandler; + + //========================================================================== + // ========= + // Constructor + // =========== + public InternalIdentifierAbstractGenerator(PropertyType propertyType, + Dbms dbms) { + this.propertyType = propertyType; + this.dbms = dbms; + resultSetHandler = new InternalIdentifierResultSetHandler(propertyType + .getValueType()); + } + + //========================================================================== + // ========= + // Assist Helper + // ============= + protected Object executeSql(DataSource ds, String sql, Object[] args) { + InternalBasicSelectHandler selectHandler = createSelectHandler(ds, sql); + if (args != null) { + selectHandler.setLoggingMessageSqlArgs(args); + } + return selectHandler.execute(args); + } + + protected InternalBasicSelectHandler createSelectHandler(DataSource ds, + String sql) { + // Use original statement factory for identifier generator. + return new InternalBasicSelectHandler(ds, sql, resultSetHandler, + createStatementFactory(ds, sql)); + } + + protected StatementFactory createStatementFactory(DataSource ds, String sql) { + return new InternalIdentifierGeneratorStatementFactory(); + } + + protected void reflectIdentifier(Object bean, Object value) { + if (propertyType == null) { + String msg = "The arguement[propertyType] should not be null: value=" + + value; + throw new IllegalArgumentException(msg); + } + PropertyDesc pd = propertyType.getPropertyDesc(); + pd.setValue(bean, value); + } + + //========================================================================== + // ========= + // Result Set Handler + // ================== + protected static class InternalIdentifierResultSetHandler implements + ResultSetHandler { + private ValueType valueType; + + public InternalIdentifierResultSetHandler(ValueType valueType) { + this.valueType = valueType; + } + + public Object handle(ResultSet rs) throws SQLException { + if (rs.next()) { + return valueType.getValue(rs, 1); + } + return null; + } + } + + //========================================================================== + // ========= + // Statement Factory + // ================= + protected static class InternalIdentifierGeneratorStatementFactory + implements StatementFactory { + public PreparedStatement createPreparedStatement(Connection conn, + String sql) { + try { + return conn.prepareStatement(sql); + } catch (SQLException e) { + handleSQLException(e, null); + return null; // Unreachable! + } + } + + public CallableStatement createCallableStatement(Connection conn, + String sql) { + try { + return conn.prepareCall(sql); + } catch (SQLException e) { + handleSQLException(e, null); + return null; // Unreachable! + } + } + + protected void handleSQLException(SQLException e, Statement statement) { + new SQLExceptionHandler().handleSQLException(e, statement); + } + } + + //========================================================================== + // ========= + // Accessor + // ======== + public String getPropertyName() { + return propertyType.getPropertyName(); + } + + public Dbms getDbms() { + return dbms; + } +} Property changes on: userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/s2dao/internal/various/InternalIdentifierAbstractGenerator.java ___________________________________________________________________ Name: svn:eol-style + native Added: userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/s2dao/internal/various/InternalIdentifierAssignedGenerator.java =================================================================== --- userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/s2dao/internal/various/InternalIdentifierAssignedGenerator.java (rev 0) +++ userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/s2dao/internal/various/InternalIdentifierAssignedGenerator.java 2008-12-27 22:02:56 UTC (rev 1623) @@ -0,0 +1,33 @@ +package jp.sf.pal.userinfo.db.allcommon.s2dao.internal.various; + +import javax.sql.DataSource; + +import org.seasar.dao.Dbms; +import org.seasar.extension.jdbc.PropertyType; + +/** + * @author DBFlute(AutoGenerator) + */ +public class InternalIdentifierAssignedGenerator extends + InternalIdentifierAbstractGenerator { + + //========================================================================== + // ========= + // Constructor + // =========== + public InternalIdentifierAssignedGenerator(PropertyType propertyType, + Dbms dbms) { + super(propertyType, dbms); + } + + //========================================================================== + // ========= + // Implementation + // ============== + public void setIdentifier(Object bean, DataSource ds) { + } + + public boolean isSelfGenerate() { + return true; + } +} Property changes on: userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/s2dao/internal/various/InternalIdentifierAssignedGenerator.java ___________________________________________________________________ Name: svn:eol-style + native Added: userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/s2dao/internal/various/InternalIdentifierGeneratorFactory.java =================================================================== --- userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/s2dao/internal/various/InternalIdentifierGeneratorFactory.java (rev 0) +++ userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/s2dao/internal/various/InternalIdentifierGeneratorFactory.java 2008-12-27 22:02:56 UTC (rev 1623) @@ -0,0 +1,105 @@ +package jp.sf.pal.userinfo.db.allcommon.s2dao.internal.various; + +import java.lang.reflect.Constructor; +import java.util.HashMap; +import java.util.Map; + +import jp.sf.pal.userinfo.db.allcommon.util.SimpleStringUtil; + +import org.seasar.dao.Dbms; +import org.seasar.dao.IdentifierGenerator; +import org.seasar.extension.jdbc.PropertyType; +import org.seasar.framework.beans.BeanDesc; +import org.seasar.framework.beans.PropertyDesc; +import org.seasar.framework.beans.factory.BeanDescFactory; +import org.seasar.framework.util.ClassUtil; +import org.seasar.framework.util.ConstructorUtil; + +/** + * @author DBFlute(AutoGenerator) + */ +public class InternalIdentifierGeneratorFactory { + + //========================================================================== + // ========= + // Attribute + // ========= + private static Map> generatorClasses = new HashMap>(); + + static { + addIdentifierGeneratorClass("assigned", + InternalIdentifierAssignedGenerator.class); + addIdentifierGeneratorClass("identity", + InternalIdentifierIdentityGenerator.class); + addIdentifierGeneratorClass("sequence", + InternalIdentifierSequenceGenerator.class); + } + + //========================================================================== + // ========= + // Constructor + // =========== + private InternalIdentifierGeneratorFactory() { + } + + //========================================================================== + // ========= + // Identifier Generator + // ==================== + public static void addIdentifierGeneratorClass(String name, Class clazz) { + generatorClasses.put(name, clazz); + } + + public static IdentifierGenerator createIdentifierGenerator( + PropertyType propertyType, Dbms dbms) { + return createIdentifierGenerator(propertyType, dbms, null); + } + + public static IdentifierGenerator createIdentifierGenerator( + PropertyType propertyType, Dbms dbms, String annotation) { + if (propertyType == null) { + String msg = "The argument[propertyType] should not be null: dbms=" + + dbms + " annotation=" + annotation; + throw new IllegalArgumentException(msg); + } + if (dbms == null) { + String msg = "The argument[dbms] should not be null: propertyType=" + + propertyType + " annotation=" + annotation; + throw new IllegalArgumentException(msg); + } + if (annotation == null) { + return new InternalIdentifierAssignedGenerator(propertyType, dbms); + } + String[] array = SimpleStringUtil.split(annotation, "=, "); + Class clazz = getGeneratorClass(array[0]); + IdentifierGenerator generator = createIdentifierGenerator(clazz, + propertyType, dbms); + for (int i = 1; i < array.length; i += 2) { + setProperty(generator, array[i].trim(), array[i + 1].trim()); + } + return generator; + } + + protected static Class getGeneratorClass(String name) { + Class clazz = generatorClasses.get(name); + if (clazz != null) { + return clazz; + } + return ClassUtil.forName(name); + } + + protected static IdentifierGenerator createIdentifierGenerator( + Class clazz, PropertyType propertyType, Dbms dbms) { + Constructor constructor = ClassUtil.getConstructor(clazz, + new Class[] { PropertyType.class, Dbms.class }); + return (IdentifierGenerator) ConstructorUtil.newInstance(constructor, + new Object[] { propertyType, dbms }); + } + + protected static void setProperty(IdentifierGenerator generator, + String propertyName, String value) { + BeanDesc beanDesc = BeanDescFactory.getBeanDesc(generator.getClass()); + PropertyDesc pd = beanDesc.getPropertyDesc(propertyName); + pd.setValue(generator, value); + } +} Property changes on: userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/s2dao/internal/various/InternalIdentifierGeneratorFactory.java ___________________________________________________________________ Name: svn:eol-style + native Added: userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/s2dao/internal/various/InternalIdentifierIdentityGenerator.java =================================================================== --- userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/s2dao/internal/various/InternalIdentifierIdentityGenerator.java (rev 0) +++ userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/s2dao/internal/various/InternalIdentifierIdentityGenerator.java 2008-12-27 22:02:56 UTC (rev 1623) @@ -0,0 +1,35 @@ +package jp.sf.pal.userinfo.db.allcommon.s2dao.internal.various; + +import javax.sql.DataSource; + +import org.seasar.dao.Dbms; +import org.seasar.extension.jdbc.PropertyType; + +/** + * @author DBFlute(AutoGenerator) + */ +public class InternalIdentifierIdentityGenerator extends + InternalIdentifierAbstractGenerator { + + //========================================================================== + // ========= + // Constructor + // =========== + public InternalIdentifierIdentityGenerator(PropertyType propertyType, + Dbms dbms) { + super(propertyType, dbms); + } + + //========================================================================== + // ========= + // Implementation + // ============== + public void setIdentifier(Object bean, DataSource ds) { + Object value = executeSql(ds, getDbms().getIdentitySelectString(), null); + reflectIdentifier(bean, value); + } + + public boolean isSelfGenerate() { + return false; + } +} Property changes on: userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/s2dao/internal/various/InternalIdentifierIdentityGenerator.java ___________________________________________________________________ Name: svn:eol-style + native Added: userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/s2dao/internal/various/InternalIdentifierSequenceGenerator.java =================================================================== --- userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/s2dao/internal/various/InternalIdentifierSequenceGenerator.java (rev 0) +++ userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/s2dao/internal/various/InternalIdentifierSequenceGenerator.java 2008-12-27 22:02:56 UTC (rev 1623) @@ -0,0 +1,116 @@ +package jp.sf.pal.userinfo.db.allcommon.s2dao.internal.various; + +import java.util.HashMap; + +import javax.sql.DataSource; + +import jp.sf.pal.userinfo.db.allcommon.util.SimpleTypeUtil; + +import org.seasar.dao.Dbms; +import org.seasar.extension.jdbc.PropertyType; + +/** + * @author DBFlute(AutoGenerator) + */ +public class InternalIdentifierSequenceGenerator extends + InternalIdentifierAbstractGenerator { + + // - - - - - - - - - - + // [Unused on DBFlute] + // - - - - - - - - - - + + //========================================================================== + // ========= + // Attribute + // ========= + private String sequenceName; + + private long allocationSize = 0; + + private HashMap idContextMap = new HashMap(); + + //========================================================================== + // ========= + // Constructor + // =========== + public InternalIdentifierSequenceGenerator(PropertyType propertyType, + Dbms dbms) { + super(propertyType, dbms); + } + + //========================================================================== + // ========= + // Implementation + // ============== + public void setIdentifier(Object bean, DataSource ds) { + reflectIdentifier(bean, getNextValue(ds)); + } + + public boolean isSelfGenerate() { + return getDbms().isSelfGenerate(); + } + + //========================================================================== + // ========= + // Next Value + // ========== + protected Object getNextValue(DataSource ds) { + if (allocationSize > 0) { + long value = getIdContext(ds).getNextValue(ds); + return new Long(value); + } + return getNewInitialValue(ds); + } + + protected Object getNewInitialValue(DataSource ds) { + return executeSql(ds, getDbms().getSequenceNextValString(sequenceName), + null); + } + + protected IdContext getIdContext(DataSource ds) { + synchronized (idContextMap) { + IdContext context = idContextMap.get(ds); + if (context == null) { + context = new IdContext(); + idContextMap.put(ds, context); + } + return context; + } + } + + public class IdContext { + protected long initialValue; + + protected long allocated = Long.MAX_VALUE; + + public synchronized long getNextValue(DataSource ds) { + if (allocated < allocationSize) { + return initialValue + allocated++; + } + initialValue = SimpleTypeUtil + .toPrimitiveLong(getNewInitialValue(ds)); + allocated = 1; + return initialValue; + } + } + + //========================================================================== + // ========= + // Accessor + // ======== + public String getSequenceName() { + return sequenceName; + } + + public void setSequenceName(String sequenceName) { + this.sequenceName = sequenceName; + } + + public long getAllocationSize() { + return allocationSize; + } + + public void setAllocationSize(long allocationSize) { + this.allocationSize = allocationSize; + } +} Property changes on: userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/s2dao/internal/various/InternalIdentifierSequenceGenerator.java ___________________________________________________________________ Name: svn:eol-style + native Modified: userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/s2dao/internal/various/InternalProcedureMetaDataFactory.java =================================================================== --- userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/s2dao/internal/various/InternalProcedureMetaDataFactory.java 2008-12-26 22:11:31 UTC (rev 1622) +++ userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/s2dao/internal/various/InternalProcedureMetaDataFactory.java 2008-12-27 22:02:56 UTC (rev 1623) @@ -7,7 +7,7 @@ import java.util.Map; import java.util.Stack; -import jp.sf.pal.userinfo.db.allcommon.cbean.ConditionBeanContext; +import jp.sf.pal.userinfo.db.allcommon.DBDef; import org.seasar.dao.ValueTypeFactory; import org.seasar.dao.util.TypeUtil; @@ -146,9 +146,9 @@ } final Class type = field.getType(); if (List.class.isAssignableFrom(type)) {// is for out parameter cursor. - if (ConditionBeanContext.isOracle()) { + if (DBDef.isCurrentDef(DBDef.Oracle)) { return ValueTypes.ORACLE_RESULT_SET; - } else if (ConditionBeanContext.isPostgreSql()) { + } else if (DBDef.isCurrentDef(DBDef.PostgreSQL)) { return ValueTypes.POSTGRE_RESULT_SET; } else { return ValueTypes.SERIALIZABLE_BYTE_ARRAY; Added: userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/s2dao/internal/various/InternalStatementFactory.java =================================================================== --- userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/s2dao/internal/various/InternalStatementFactory.java (rev 0) +++ userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/s2dao/internal/various/InternalStatementFactory.java 2008-12-27 22:02:56 UTC (rev 1623) @@ -0,0 +1,158 @@ +package jp.sf.pal.userinfo.db.allcommon.s2dao.internal.various; + +import java.sql.CallableStatement; +import java.sql.Connection; +import java.sql.PreparedStatement; +import java.sql.SQLException; +import java.sql.Statement; + +import jp.sf.pal.userinfo.db.allcommon.cbean.ConditionBean; +import jp.sf.pal.userinfo.db.allcommon.cbean.ConditionBeanContext; +import jp.sf.pal.userinfo.db.allcommon.cbean.outsidesql.OutsideSqlContext; +import jp.sf.pal.userinfo.db.allcommon.jdbc.StatementConfig; +import jp.sf.pal.userinfo.db.allcommon.s2dao.internal.sqlhandler.InternalBasicHandler.SQLExceptionHandler; + +import org.seasar.extension.jdbc.StatementFactory; + +/** + * @author DBFlute(AutoGenerator) + */ +public class InternalStatementFactory implements StatementFactory { + + //========================================================================== + // ========= + // Definition + // ========== + /** Log-instance. */ + private static final org.apache.commons.logging.Log _log = org.apache.commons.logging.LogFactory + .getLog(InternalStatementFactory.class); + + //========================================================================== + // ========= + // Attribute + // ========= + protected StatementConfig defaultStatementConfig; + + protected boolean internalDebug; + + //========================================================================== + // ========= + // Constructor + // =========== + public InternalStatementFactory() { + } + + //========================================================================== + // ========= + // Implementation + // ============== + public PreparedStatement createPreparedStatement(Connection conn, String sql) { + try { + final StatementConfig config = findStatementConfigOnThread(); + ; + final int resultSetType; + if (config != null && config.hasResultSetType()) { + resultSetType = config.getResultSetType(); + } else if (defaultStatementConfig != null + && defaultStatementConfig.hasResultSetType()) { + resultSetType = defaultStatementConfig.getResultSetType(); + } else { + resultSetType = java.sql.ResultSet.TYPE_FORWARD_ONLY; + } + final int resultSetConcurrency = java.sql.ResultSet.CONCUR_READ_ONLY; + if (internalDebug) { + _log.debug("...Creating prepareStatement(sql, " + resultSetType + + ", " + resultSetConcurrency + ")"); + } + final PreparedStatement ps = conn.prepareStatement(sql, + resultSetType, resultSetConcurrency); + if (config != null && config.hasStatementOptions()) { + if (internalDebug) { + _log.debug("...Setting statement config as request: " + + config); + } + reflectStatementOptions(config, ps); + } else { + reflectDefaultOptionsToStatementIfNeeds(ps); + } + return ps; + } catch (SQLException e) { + handleSQLException(e, null); + return null;// Unreachable! + } + } + + public CallableStatement createCallableStatement(Connection conn, String sql) { + return prepareCall(conn, sql); + } + + protected StatementConfig findStatementConfigOnThread() { + final StatementConfig config; + if (ConditionBeanContext.isExistConditionBeanOnThread()) { + final ConditionBean cb = ConditionBeanContext + .getConditionBeanOnThread(); + config = cb.getStatementConfig(); + } else if (OutsideSqlContext.isExistOutsideSqlContextOnThread()) { + final OutsideSqlContext context = OutsideSqlContext + .getOutsideSqlContextOnThread(); + config = context.getStatementConfig(); + } else { + config = null; + } + return config; + } + + protected void reflectDefaultOptionsToStatementIfNeeds(PreparedStatement ps) { + if (defaultStatementConfig != null + && defaultStatementConfig.hasStatementOptions()) { + if (internalDebug) { + _log.debug("...Setting statement config as default: " + + defaultStatementConfig); + } + reflectStatementOptions(defaultStatementConfig, ps); + return; + } + } + + protected void reflectStatementOptions(StatementConfig config, + PreparedStatement ps) { + try { + if (config.hasQueryTimeout()) { + ps.setQueryTimeout(config.getQueryTimeout()); + } + if (config.hasFetchSize()) { + ps.setFetchSize(config.getFetchSize()); + } + if (config.hasMaxRows()) { + ps.setMaxRows(config.getMaxRows()); + } + } catch (SQLException e) { + handleSQLException(e, ps); + } + } + + protected CallableStatement prepareCall(Connection conn, String sql) { + try { + return conn.prepareCall(sql); + } catch (SQLException e) { + handleSQLException(e, null); + return null;// Unreachable! + } + } + + protected void handleSQLException(SQLException e, Statement statement) { + new SQLExceptionHandler().handleSQLException(e, statement); + } + + //========================================================================== + // ========= + // Accessor + // ======== + public void setDefaultStatementConfig(StatementConfig defaultStatementConfig) { + this.defaultStatementConfig = defaultStatementConfig; + } + + public void setInternalDebug(boolean internalDebug) { + this.internalDebug = internalDebug; + } +} Property changes on: userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/s2dao/internal/various/InternalStatementFactory.java ___________________________________________________________________ Name: svn:eol-style + native Modified: userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/util/SimpleAssertUtil.java =================================================================== --- userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/util/SimpleAssertUtil.java 2008-12-26 22:11:31 UTC (rev 1622) +++ userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/util/SimpleAssertUtil.java 2008-12-27 22:02:56 UTC (rev 1623) @@ -7,11 +7,8 @@ //========================================================================== // ========= - // Assert + // Object // ====== - // ----------------------------------------------------- - // Assert Object - // ------------- /** * Assert that the object is not null. * @@ -32,9 +29,10 @@ } } - // ----------------------------------------------------- - // Assert String - // ------------- + //========================================================================== + // ========= + // String + // ====== /** * Assert that the entity is not null and not trimmed empty. * Added: userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/util/SimpleResourceUtil.java =================================================================== --- userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/util/SimpleResourceUtil.java (rev 0) +++ userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/util/SimpleResourceUtil.java 2008-12-27 22:02:56 UTC (rev 1623) @@ -0,0 +1,117 @@ +package jp.sf.pal.userinfo.db.allcommon.util; + +import java.io.IOException; +import java.io.InputStream; +import java.net.URL; +import java.net.URLConnection; + +/** + * @author DBFlute(AutoGenerator) + */ +public class SimpleResourceUtil { + + //========================================================================== + // ========= + // Resource Path + // ============= + public static String getResourcePath(String path, String extension) { + if (extension == null) { + return path; + } + extension = "." + extension; + if (path.endsWith(extension)) { + return path; + } + return path.replace('.', '/') + extension; + } + + public static String getResourcePath(Class clazz) { + return clazz.getName().replace('.', '/') + ".class"; + } + + //========================================================================== + // ========= + // Resource URL + // ============ + public static URL getResourceUrl(String path) { + return getResourceUrl(path, null); + } + + public static URL getResourceUrl(String path, String extension) { + return getResourceUrl(path, extension, Thread.currentThread() + .getContextClassLoader()); + } + + public static URL getResourceUrl(String path, String extension, + ClassLoader loader) { + if (path == null || loader == null) { + return null; + } + path = getResourcePath(path, extension); + return loader.getResource(path); + } + + //========================================================================== + // ========= + // Resource Stream + // =============== + public static InputStream getResourceStream(String path) { + return getResourceStream(path, null); + } + + public static InputStream getResourceStream(String path, String extension) { + final URL url = getResourceUrl(path, extension); + return url != null ? openStream(url) : null; + } + + //========================================================================== + // ========= + // Resource Existence + // ================== + public static boolean isExist(String path) { + return getResourceUrl(path) != null; + } + + //========================================================================== + // ========= + // Assist Helper + // ============= + protected static ClassLoader getClassLoader() { + return Thread.currentThread().getContextClassLoader(); + } + + protected static InputStream openStream(URL url) { + try { + URLConnection connection = url.openConnection(); + connection.setUseCaches(false); + return connection.getInputStream(); + } catch (IOException e) { + String msg = "Failed to open the stream: url=" + url; + throw new IllegalStateException(msg, e); + } + } + + //========================================================================== + // ========= + // Assert Helper + // ============= + /** + * Assert that the object is not null. + * + * @param variableName Variable name. (NotNull) + * @param value Value. (NotNull) + * @exception IllegalArgumentException + */ + protected static void assertObjectNotNull(String variableName, Object value) { + if (variableName == null) { + String msg = "The value should not be null: variableName=" + + variableName + " value=" + value; + throw new IllegalArgumentException(msg); + } + if (value == null) { + String msg = "The value should not be null: variableName=" + + variableName; + throw new IllegalArgumentException(msg); + } + } +} Property changes on: userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/util/SimpleResourceUtil.java ___________________________________________________________________ Name: svn:eol-style + native Modified: userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/util/SimpleStringUtil.java =================================================================== --- userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/util/SimpleStringUtil.java 2008-12-26 22:11:31 UTC (rev 1622) +++ userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/util/SimpleStringUtil.java 2008-12-27 22:02:56 UTC (rev 1623) @@ -1,14 +1,20 @@ package jp.sf.pal.userinfo.db.allcommon.util; +import java.util.ArrayList; +import java.util.List; +import java.util.StringTokenizer; + /** * @author DBFlute(AutoGenerator) */ public class SimpleStringUtil { + protected static final String[] EMPTY_STRINGS = new String[0]; + //========================================================================== // ========= - // String - // ====== + // Replace + // ======= public static String replace(String text, String fromText, String toText) { if (text == null || fromText == null || toText == null) { return null; @@ -32,6 +38,26 @@ } while (true); } + //========================================================================== + // ========= + // Split + // ===== + public static String[] split(final String str, final String delimiter) { + if (str == null || str.trim().length() == 0) { + return EMPTY_STRINGS; + } + final List list = new ArrayList(); + final StringTokenizer st = new StringTokenizer(str, delimiter); + while (st.hasMoreElements()) { + list.add(st.nextToken()); + } + return (String[]) list.toArray(new String[list.size()]); + } + + //========================================================================== + // ========= + // Initial Convert + // =============== public static String initCap(String str) { assertObjectNotNull("str", str); return str.substring(0, 1).toUpperCase() + str.substring(1); @@ -42,9 +68,10 @@ return str.substring(0, 1).toLowerCase() + str.substring(1); } - // ----------------------------------------------------- - // Assert Object - // ------------- + //========================================================================== + // ========= + // Assert Helper + // ============= /** * Assert that the object is not null. * Modified: userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/util/SimpleSystemUtil.java =================================================================== --- userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/util/SimpleSystemUtil.java 2008-12-26 22:11:31 UTC (rev 1622) +++ userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/util/SimpleSystemUtil.java 2008-12-27 22:02:56 UTC (rev 1623) @@ -7,8 +7,8 @@ //========================================================================== // ========= - // System - // ====== + // Line Separator + // ============== public static String getLineSeparator() { // /- - - - - - - - - - - - - - - - - - - - - - // Because 'CR + LF' caused many trouble! Added: userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/util/SimpleTypeUtil.java =================================================================== --- userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/util/SimpleTypeUtil.java (rev 0) +++ userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/util/SimpleTypeUtil.java 2008-12-27 22:02:56 UTC (rev 1623) @@ -0,0 +1,692 @@ +package jp.sf.pal.userinfo.db.allcommon.util; + +import java.math.BigDecimal; +import java.math.BigInteger; +import java.text.DateFormat; +import java.text.DecimalFormatSymbols; +import java.text.ParseException; +import java.text.SimpleDateFormat; +import java.util.ArrayList; +import java.util.Calendar; +import java.util.Date; +import java.util.List; +import java.util.Locale; +import java.util.Map; +import java.util.StringTokenizer; +import java.util.concurrent.ConcurrentHashMap; + +/** + * {Refers to S2Container's utility and Extends it} + * + * @author DBFlute(AutoGenerator) + */ +public class SimpleTypeUtil { + + //========================================================================== + // ========= + // Convert To + // ========== + // ----------------------------------------------------- + // Boolean + // ------- + public static Boolean toBoolean(Object o) { + if (o == null) { + return null; + } else if (o instanceof Boolean) { + return (Boolean) o; + } else if (o instanceof Number) { + int num = ((Number) o).intValue(); + return Boolean.valueOf(num != 0); + } else if (o instanceof String) { + String s = (String) o; + if ("true".equalsIgnoreCase(s)) { + return Boolean.TRUE; + } else if ("false".equalsIgnoreCase(s)) { + return Boolean.FALSE; + } else if (s.equals("0")) { + return Boolean.FALSE; + } else { + return Boolean.TRUE; + } + } else { + return Boolean.TRUE; + } + } + + // ----------------------------------------------------- + // Integer + // ------- + public static Integer toInteger(Object o) { + return toInteger(o, null); + } + + public static Integer toInteger(Object o, String pattern) { + if (o == null) { + return null; + } else if (o instanceof Integer) { + return (Integer) o; + } else if (o instanceof Number) { + return new Integer(((Number) o).intValue()); + } else if (o instanceof String) { + return toInteger((String) o); + } else if (o instanceof java.util.Date) { + if (pattern != null) { + return new Integer(new SimpleDateFormat(pattern).format(o)); + } + return new Integer((int) ((java.util.Date) o).getTime()); + } else if (o instanceof Boolean) { + return ((Boolean) o).booleanValue() ? new Integer(1) : new Integer( + 0); + } else { + return toInteger(o.toString()); + } + } + + protected static Integer toInteger(String s) { + if (s == null || s.trim().length() == 0) { + return null; + } + return new Integer(normalize(s)); + } + + public static int toPrimitiveInt(Object o) { + return toPrimitiveInt(o, null); + } + + public static int toPrimitiveInt(Object o, String pattern) { + if (o == null) { + return 0; + } else if (o instanceof Number) { + return ((Number) o).intValue(); + } else if (o instanceof String) { + return toPrimitiveInt((String) o); + } else if (o instanceof java.util.Date) { + if (pattern != null) { + return Integer + .parseInt(new SimpleDateFormat(pattern).format(o)); + } + return (int) ((java.util.Date) o).getTime(); + } else if (o instanceof Boolean) { + return ((Boolean) o).booleanValue() ? 1 : 0; + } else { + return toPrimitiveInt(o.toString()); + } + } + + protected static int toPrimitiveInt(String s) { + if (s == null || s.trim().length() == 0) { + return 0; + } + return Integer.parseInt(normalize(s)); + } + + // ----------------------------------------------------- + // BigDecimal + // ---------- + public static BigDecimal toBigDecimal(Object o) { + return toBigDecimal(o, null); + } + + public static BigDecimal toBigDecimal(Object o, String pattern) { + if (o == null) { + return null; + } else if (o instanceof BigDecimal) { + return (BigDecimal) o; + } else if (o instanceof java.util.Date) { + if (pattern != null) { + return new BigDecimal(new SimpleDateFormat(pattern).format(o)); + } + return new BigDecimal(Long.toString(((java.util.Date) o).getTime())); + } else if (o instanceof String) { + String s = (String) o; + if (s == null || s.trim().length() == 0) { + return null; + } + return new BigDecimal(new BigDecimal(s).toPlainString()); + } else { + return new BigDecimal(new BigDecimal(o.toString()).toPlainString()); + } + } + + // ----------------------------------------------------- + // Double + // ------ + public static Double toDouble(Object o) { + return toDouble(o, null); + } + + public static Double toDouble(Object o, String pattern) { + if (o == null) { + return null; + } else if (o instanceof Double) { + return (Double) o; + } else if (o instanceof Number) { + return new Double(((Number) o).doubleValue()); + } else if (o instanceof String) { + return toDouble((String) o); + } else if (o instanceof java.util.Date) { + if (pattern != null) { + return new Double(new SimpleDateFormat(pattern).format(o)); + } + return new Double(((java.util.Date) o).getTime()); + } else { + return toDouble(o.toString()); + } + } + + protected static Double toDouble(String s) { + if (s == null || s.trim().length() == 0) { + return null; + } + return new Double(normalize(s)); + } + + // ----------------------------------------------------- + // Long + // ---- + public static Long toLong(Object o) { + return toLong(o, null); + } + + public static Long toLong(Object o, String pattern) { + if (o == null) { + return null; + } else if (o instanceof Long) { + return (Long) o; + } else if (o instanceof Number) { + return new Long(((Number) o).longValue()); + } else if (o instanceof String) { + return toLong((String) o); + } else if (o instanceof java.util.Date) { + if (pattern != null) { + return new Long(new SimpleDateFormat(pattern).format(o)); + } + return new Long(((java.util.Date) o).getTime()); + } else if (o instanceof Boolean) { + return ((Boolean) o).booleanValue() ? new Long(1) : new Long(0); + } else { + return toLong(o.toString()); + } + } + + protected static Long toLong(String s) { + if (s == null || s.trim().length() == 0) { + return null; + } + return new Long(normalize(s)); + } + + public static long toPrimitiveLong(Object o) { + return toPrimitiveLong(o, null); + } + + public static long toPrimitiveLong(Object o, String pattern) { + if (o == null) { + return 0; + } else if (o instanceof Number) { + return ((Number) o).longValue(); + } else if (o instanceof String) { + return toPrimitiveLong((String) o); + } else if (o instanceof java.util.Date) { + if (pattern != null) { + return Long.parseLong(new SimpleDateFormat(pattern).format(o)); + } + return ((java.util.Date) o).getTime(); + } else if (o instanceof Boolean) { + return ((Boolean) o).booleanValue() ? 1 : 0; + } else { + return toPrimitiveLong(o.toString()); + } + } + + protected static long toPrimitiveLong(String s) { + if (s == null || s.trim().length() == 0) { + return 0; + } + return Long.parseLong(normalize(s)); + } + + // ----------------------------------------------------- + // Float + // ----- + public static Float toFloat(Object o) { + return toFloat(o, null); + } + + public static Float toFloat(Object o, String pattern) { + if (o == null) { + return null; + } else if (o instanceof Float) { + return (Float) o; + } else if (o instanceof Number) { + return new Float(((Number) o).floatValue()); + } else if (o instanceof String) { + return toFloat((String) o); + } else if (o instanceof java.util.Date) { + if (pattern != null) { + return new Float(new SimpleDateFormat(pattern).format(o)); + } + return new Float(((java.util.Date) o).getTime()); + } else { + return toFloat(o.toString()); + } + } + + protected static Float toFloat(String s) { + if (s == null || s.trim().length() == 0) { + return null; + } + return new Float(normalize(s)); + } + + // ----------------------------------------------------- + // Short + // ----- + public static Short toShort(Object o) { + return toShort(o, null); + } + + public static Short toShort(Object o, String pattern) { + if (o == null) { + return null; + } else if (o instanceof Short) { + return (Short) o; + } else if (o instanceof Number) { + return new Short(((Number) o).shortValue()); + } else if (o instanceof String) { + return toShort((String) o); + } else if (o instanceof java.util.Date) { + if (pattern != null) { + return new Short(new SimpleDateFormat(pattern).format(o)); + } + return new Short((short) ((java.util.Date) o).getTime()); + } else if (o instanceof Boolean) { + return ((Boolean) o).booleanValue() ? new Short((short) 1) + : new Short((short) 0); + } else { + return toShort(o.toString()); + } + } + + protected static Short toShort(String s) { + if (s == null || s.trim().length() == 0) { + return null; + } + return new Short(normalize(s)); + } + + // ----------------------------------------------------- + // BigInteger + // ---------- + public static BigInteger toBigInteger(Object o) { + return toBigInteger(o, null); + } + + public static BigInteger toBigInteger(Object o, String pattern) { + if (o == null) { + return null; + } else if (o instanceof BigInteger) { + return (BigInteger) o; + } else { + Long l = toLong(o, pattern); + if (l == null) { + return null; + } + return BigInteger.valueOf(l.longValue()); + } + } + + // ----------------------------------------------------- + // Byte + // ---- + public static Byte toByte(Object o) { + return toByte(o, null); + } + + public static Byte toByte(Object o, String pattern) { + if (o == null) { + return null; + } else if (o instanceof Byte) { + return (Byte) o; + } else if (o instanceof Number) { + return new Byte(((Number) o).byteValue()); + } else if (o instanceof String) { + return toByte((String) o); + } else if (o instanceof java.util.Date) { + if (pattern != null) { + return new Byte(new SimpleDateFormat(pattern).format(o)); + } + return new Byte((byte) ((java.util.Date) o).getTime()); + } else if (o instanceof Boolean) { + return ((Boolean) o).booleanValue() ? new Byte((byte) 1) + : new Byte((byte) 0); + } else { + return toByte(o.toString()); + } + } + + protected static Byte toByte(String s) { + if (s == null || s.trim().length() == 0) { + return null; + } + return new Byte(normalize(s)); + } + + // ----------------------------------------------------- + // Date + // ---- + public static Date toDate(Object o) { + return toDate(o, null); + } + + public static Date toDate(Object o, String pattern) { + if (o == null) { + return null; + } else if (o instanceof String) { + return toDate((String) o, pattern); + } else if (o instanceof Date) { + return (Date) o; + } else if (o instanceof Calendar) { + return ((Calendar) o).getTime(); + } else { + return toDate(o.toString(), pattern); + } + } + + protected static Date toDate(String s, String pattern) { + return toDate(s, pattern, Locale.getDefault()); + } + + protected static Date toDate(String s, String pattern, Locale locale) { + if (s == null || s.trim().length() == 0) { + return null; + } + SimpleDateFormat sdf = getDateFormat(s, pattern, locale); + try { + return sdf.parse(s); + } catch (ParseException e) { + String msg = "Failed to parse the string to date: "; + msg = msg + " string=" + s + " format=" + sdf + " locale=" + locale; + throw new IllegalStateException(msg, e); + } + } + + public static java.sql.Date toSqlDate(Object o) { + return toSqlDate(o, null); + } + + public static java.sql.Date toSqlDate(Object o, String pattern) { + if (o instanceof java.sql.Date) { + return (java.sql.Date) o; + } + java.util.Date date = toDate(o, pattern); + if (date != null) { + return new java.sql.Date(date.getTime()); + } + return null; + } + + // ----------------------------------------------------- + // Number + // ------ + public static Object toNumber(Class type, Object o) { + if (type == Integer.class) { + return toInteger(o); + } else if (type == BigDecimal.class) { + return toBigDecimal(o); + } else if (type == Double.class) { + return toDouble(o); + } else if (type == Long.class) { + return toLong(o); + } else if (type == Float.class) { + return toFloat(o); + } else if (type == Short.class) { + return toShort(o); + } else if (type == BigInteger.class) { + return toBigInteger(o); + } else if (type == Byte.class) { + return toByte(o); + } + return o; + } + + // ----------------------------------------------------- + // Wrapper + // ------- + public static Object toWrapper(Class type, Object o) { + if (type == int.class) { + Integer i = toInteger(o); + if (i != null) { + return i; + } + return new Integer(0); + } else if (type == double.class) { + Double d = toDouble(o); + if (d != null) { + return d; + } + return new Double(0); + } else if (type == long.class) { + Long l = toLong(o); + if (l != null) { + return l; + } + return new Long(0); + } else if (type == float.class) { + Float f = toFloat(o); + if (f != null) { + return f; + } + return new Float(0); + } else if (type == short.class) { + Short s = toShort(o); + if (s != null) { + return s; + } + return new Short((short) 0); + } else if (type == boolean.class) { + Boolean b = toBoolean(o); + if (b != null) { + return b; + } + return Boolean.FALSE; + } else if (type == byte.class) { + Byte b = toByte(o); + if (b != null) { + return b; + } + return new Byte((byte) 0); + } + return o; + } + + //========================================================================== + // ========= + // Normalize + // ========= + protected static String normalize(String s) { + return normalize(s, Locale.getDefault()); + } + + protected static String normalize(String s, Locale locale) { + if (s == null) { + return null; + } + DecimalFormatSymbols symbols = getDecimalFormatSymbols(locale); + char decimalSep = symbols.getDecimalSeparator(); + char groupingSep = symbols.getGroupingSeparator(); + StringBuilder sb = new StringBuilder(20); + for (int i = 0; i < s.length(); ++i) { + char c = s.charAt(i); + if (c == groupingSep) { + continue; + } else if (c == decimalSep) { + c = '.'; + } + sb.append(c); + } + return sb.toString(); + } + + //========================================================================== + // ========= + // Assist Helper + // ============= + + // ----------------------------------------------------- + // DateFormat + // ---------- + protected static SimpleDateFormat getDateFormat(String s, String pattern, + Locale locale) { + if (pattern != null) { + return new SimpleDateFormat(pattern); + } + return getDateFormat(s, locale); + } + + protected static SimpleDateFormat getDateFormat(String s, Locale locale) { + String pattern = getDateFormatPattern(locale); + String shortPattern = removeDateDelimiter(pattern); + String delimitor = findDateDelimiter(s); + if (delimitor == null) { + if (s.length() == shortPattern.length()) { + return new SimpleDateFormat(shortPattern); + } + if (s.length() == shortPattern.length() + 2) { + return new SimpleDateFormat(replace(shortPattern, "yy", "yyyy")); + } + } else { + String[] array = split(s, delimitor); + for (int i = 0; i < array.length; ++i) { + if (array[i].length() == 4) { + pattern = replace(pattern, "yy", "yyyy"); + break; + } + } + return new SimpleDateFormat(pattern); + } + return new SimpleDateFormat(); + } + + protected static String getDateFormatPattern(Locale locale) { + SimpleDateFormat df = (SimpleDateFormat) DateFormat.getDateInstance( + DateFormat.SHORT, locale); + String pattern = df.toPattern(); + int index = pattern.indexOf(' '); + if (index > 0) { + pattern = pattern.substring(0, index); + } + if (pattern.indexOf("MM") < 0) { + pattern = replace(pattern, "M", "MM"); + } + if (pattern.indexOf("dd") < 0) { + pattern = replace(pattern, "d", "dd"); + } + return pattern; + } + + protected static String removeDateDelimiter(String pattern) { + StringBuilder sb = new StringBuilder(); + for (int i = 0; i < pattern.length(); ++i) { + char c = pattern.charAt(i); + if (c == 'y' || c == 'M' || c == 'd') { + sb.append(c); + } + } + return sb.toString(); + } + + protected static String findDateDelimiter(String value) { + for (int i = 0; i < value.length(); ++i) { + char c = value.charAt(i); + if (Character.isDigit(c)) { + continue; + } + return Character.toString(c); + } + return null; + } + + // ----------------------------------------------------- + // DecimalFormatSymbols + // -------------------- + protected static Map symbolsCache = new ConcurrentHashMap(); + + protected static DecimalFormatSymbols getDecimalFormatSymbols() { + return getDecimalFormatSymbols(Locale.getDefault()); + } + + protected static DecimalFormatSymbols getDecimalFormatSymbols(Locale locale) { + DecimalFormatSymbols symbols = (DecimalFormatSymbols) symbolsCache + .get(locale); + if (symbols == null) { + symbols = new DecimalFormatSymbols(locale); + symbolsCache.put(locale, symbols); + } + return symbols; + } + + // ----------------------------------------------------- + // String + // ------ + protected static String replace(String text, String fromText, String toText) { + if (text == null || fromText == null || toText == null) { + return null; + } + StringBuilder sb = new StringBuilder(); + int pos = 0; + int pos2 = 0; + do { + pos = text.indexOf(fromText, pos2); + if (pos == 0) { + sb.append(toText); + pos2 = fromText.length(); + } else if (pos > 0) { + sb.append(text.substring(pos2, pos)); + sb.append(toText); + pos2 = pos + fromText.length(); + } else { + sb.append(text.substring(pos2)); + return sb.toString(); + } + } while (true); + } + + protected static final String[] EMPTY_STRINGS = new String[0]; + + protected static String[] split(final String str, final String delimiter) { + if (str == null || str.trim().length() == 0) { + return EMPTY_STRINGS; + } + final List list = new ArrayList(); + final StringTokenizer st = new StringTokenizer(str, delimiter); + while (st.hasMoreElements()) { + list.add(st.nextToken()); + } + return (String[]) list.toArray(new String[list.size()]); + } + + //========================================================================== + // ========= + // Assert Helper + // ============= + /** + * Assert that the object is not null. + * + * @param variableName Variable name. (NotNull) + * @param value Value. (NotNull) + * @exception IllegalArgumentException + */ + protected static void assertObjectNotNull(String variableName, Object value) { + if (variableName == null) { + String msg = "The value should not be null: variableName=" + + variableName + " value=" + value; + throw new IllegalArgumentException(msg); + } + if (value == null) { + String msg = "The value should not be null: variableName=" + + variableName; + throw new IllegalArgumentException(msg); + } + } +} Property changes on: userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/allcommon/util/SimpleTypeUtil.java ___________________________________________________________________ Name: svn:eol-style + native Modified: userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/bsbhv/BsGroupInfoBhv.java =================================================================== --- userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/bsbhv/BsGroupInfoBhv.java 2008-12-26 22:11:31 UTC (rev 1622) +++ userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/bsbhv/BsGroupInfoBhv.java 2008-12-27 22:02:56 UTC (rev 1623) @@ -1,9 +1,8 @@ package jp.sf.pal.userinfo.db.bsbhv; import java.util.List; +import java.util.Map; -import jp.sf.pal.userinfo.db.allcommon.DaoReadable; -import jp.sf.pal.userinfo.db.allcommon.DaoWritable; import jp.sf.pal.userinfo.db.allcommon.Entity; import jp.sf.pal.userinfo.db.allcommon.bhv.load.LoadReferrerOption; import jp.sf.pal.userinfo.db.allcommon.bhv.setup.ConditionBeanSetupper; @@ -22,13 +21,12 @@ import jp.sf.pal.userinfo.db.cbean.UserInfoCB; import jp.sf.pal.userinfo.db.exbhv.GroupMappingBhv; import jp.sf.pal.userinfo.db.exbhv.UserInfoBhv; -import jp.sf.pal.userinfo.db.exdao.GroupInfoDao; import jp.sf.pal.userinfo.db.exentity.GroupInfo; import jp.sf.pal.userinfo.db.exentity.GroupMapping; import jp.sf.pal.userinfo.db.exentity.UserInfo; /** - * The behavior of GROUP_INFO. + * The behavior of GROUP_INFO that the type is TABLE.
* *
  * [primary-key]
@@ -73,12 +71,6 @@
 
     //==========================================================================
     // =========
-    // Attribute
-    // =========
-    protected GroupInfoDao _dao;
-
-    //==========================================================================
-    // =========
     // Table name
     // ==========
     /** @return The name on database of table. (NotNull) */
@@ -90,39 +82,18 @@
     // =========
     // DBMeta
     // ======
-    /** @return The meta data of the database. (NotNull) */
+    /** @return The instance of DBMeta. (NotNull) */
     public DBMeta getDBMeta() {
         return GroupInfoDbm.getInstance();
     }
 
-    /** @return The meta data of the database as my table type. (NotNull) */
+    /** @return The instance of DBMeta as my table type. (NotNull) */
     public GroupInfoDbm getMyDBMeta() {
         return GroupInfoDbm.getInstance();
     }
 
     //==========================================================================
     // =========
-    // Dao Accessor
-    // ============
-    public GroupInfoDao getMyDao() {
-        return _dao;
-    }
-
-    public void setMyDao(GroupInfoDao dao) {
-        assertObjectNotNull("dao", dao);
-        _dao = dao;
-    }
-
-    public DaoReadable getDaoReadable() {
-        return getMyDao();
-    }
-
-    public DaoWritable getDaoWritable() {
-        return getMyDao();
-    }
-
-    //==========================================================================
-    // =========
     // New Instance
     // ============
     public Entity newEntity() {
@@ -152,7 +123,7 @@
      * @return The selected count.
      */
     public int selectCount(GroupInfoCB cb) {
-        assertConditionBeanNotNull(cb);
+        assertCBNotNull(cb);
         return delegateSelectCount(cb);
     }
 
@@ -229,7 +200,7 @@
      * @return The result bean of selected list. (NotNull)
      */
     public ListResultBean selectList(GroupInfoCB cb) {
-        assertConditionBeanNotNull(cb);
+        assertCBNotNull(cb);
         return new ResultBeanBuilder(getTableDbName())
                 .buildListResultBean(cb, delegateSelectList(cb));
     }
@@ -245,7 +216,7 @@
      * @return The result bean of selected page. (NotNull)
      */
     public PagingResultBean selectPage(final GroupInfoCB cb) {
-        assertConditionBeanNotNull(cb);
+        assertCBNotNull(cb);
         final PagingInvoker invoker = new PagingInvoker(
                 getTableDbName());
         final PagingHandler handler = new PagingHandler() {
@@ -266,6 +237,32 @@
 
     //==========================================================================
     // =========
+    // Scalar Select
+    // =============
+    /**
+     * Select the scalar value derived by a function. 
Call a function + * method after this method called like as follows: + * + *
+     * groupInfoBhv.scalarSelect(Date.class).max(new ScalarQuery(GroupInfoCB cb) {
+     *     cb.specify().columnXxxDatetime(); // the required specification of target column
+     *     cb.query().setXxxName_PrefixSearch("S"); // query as you like it
+     * });
+     * 
+ * + * @param The type of result. + * @param resultType The type of result. (NotNull) + * @return The scalar value derived by a function. (Nullable) + */ + public SLFunction scalarSelect( + Class resultType) { + GroupInfoCB cb = newMyConditionBean(); + cb.xsetupForScalarSelect(); + return new SLFunction(cb, resultType); + } + + //========================================================================== + // ========= // Various Select // ============== /** @@ -275,8 +272,8 @@ * @param valueLabelSetupper The setupper of value-label. (NotNull) * @return The list of value-label. (NotNull) */ - public List> selectValueLabelList( - GroupInfoCB cb, ValueLabelSetupper valueLabelSetupper) { + public List> selectValueLabelList(GroupInfoCB cb, + ValueLabelSetupper valueLabelSetupper) { return createValueLabelList(selectList(cb), valueLabelSetupper); } @@ -467,8 +464,8 @@ //========================================================================== // ========= - // Pullout Foreign - // =============== + // Pull out Foreign + // ================ //========================================================================== // ========= @@ -766,11 +763,11 @@ */ public int queryUpdate(GroupInfo groupInfo, GroupInfoCB cb) { assertObjectNotNull("groupInfo", groupInfo); - assertConditionBeanNotNull(cb); + assertCBNotNull(cb); setupCommonColumnOfUpdateIfNeeds(groupInfo); filterEntityOfUpdate(groupInfo); assertEntityOfUpdate(groupInfo); - return getMyDao().updateByQuery(cb, groupInfo); + return invoke(createQueryUpdateEntityCBCommand(groupInfo, cb)); } /** @@ -780,8 +777,8 @@ * @return The deleted count. */ public int queryDelete(GroupInfoCB cb) { - assertConditionBeanNotNull(cb); - return getMyDao().deleteByQuery(cb); + assertCBNotNull(cb); + return invoke(createQueryDeleteCBCommand(cb)); } //========================================================================== @@ -793,19 +790,27 @@ // ========= // Delegate Method // =============== + // [Behavior Command] // ----------------------------------------------------- // Select // ------ protected int delegateSelectCount(GroupInfoCB cb) { - assertConditionBeanNotNull(cb); - return getMyDao().selectCount(cb); + return invoke(createSelectCountCBCommand(cb)); } + protected int doCallReadCount(ConditionBean cb) { + return delegateSelectCount((GroupInfoCB) cb); + } + protected List delegateSelectList(GroupInfoCB cb) { - assertConditionBeanNotNull(cb); - return getMyDao().selectList(cb); + return invoke(createSelectListCBCommand(cb, GroupInfo.class)); } + @SuppressWarnings("unchecked") + protected List doCallReadList(ConditionBean cb) { + return (List) delegateSelectList((GroupInfoCB) cb); + } + // ----------------------------------------------------- // Update // ------ @@ -813,62 +818,97 @@ if (!processBeforeInsert(e)) { return 1; } - return getMyDao().insert(e); + return invoke(createInsertEntityCommand(e)); } + protected int doCallCreate(Entity entity) { + return delegateInsert(downcast(entity)); + } + protected int delegateUpdate(GroupInfo e) { if (!processBeforeUpdate(e)) { return 1; } - return getMyDao().updateModifiedOnly(e); + return invoke(createUpdateEntityCommand(e)); } + protected int doCallModify(Entity entity) { + return delegateUpdate(downcast(entity)); + } + protected int delegateUpdateNonstrict(GroupInfo e) { if (!processBeforeUpdate(e)) { return 1; } - return getMyDao().updateNonstrictModifiedOnly(e); + return invoke(createUpdateNonstrictEntityCommand(e)); } protected int delegateDelete(GroupInfo e) { if (!processBeforeDelete(e)) { return 1; } - return getMyDao().delete(e); + return invoke(createDeleteEntityCommand(e)); } + protected int doCallRemove(Entity entity) { + return delegateDelete(downcast(entity)); + } + protected int delegateDeleteNonstrict(GroupInfo e) { if (!processBeforeDelete(e)) { return 1; } - return getMyDao().deleteNonstrict(e); + return invoke(createDeleteNonstrictEntityCommand(e)); } protected int[] delegateInsertList(List ls) { - assertObjectNotNull("groupInfoList", ls); - return getMyDao().insertList(helpFilterBeforeInsertInternally(ls)); + if (ls.isEmpty()) { + return new int[] {}; + } + return invoke(createBatchInsertEntityCommand(helpFilterBeforeInsertInternally(ls))); } + @SuppressWarnings("unchecked") + protected int[] doCreateList(List ls) { + return delegateInsertList((List) ls); + } + protected int[] delegateUpdateList(List ls) { - assertObjectNotNull("groupInfoList", ls); - return getMyDao().updateList(helpFilterBeforeUpdateInternally(ls)); + if (ls.isEmpty()) { + return new int[] {}; + } + return invoke(createBatchUpdateEntityCommand(helpFilterBeforeUpdateInternally(ls))); } + @SuppressWarnings("unchecked") + protected int[] doModifyList(List ls) { + return delegateUpdateList((List) ls); + } + protected int[] delegateUpdateListNonstrict(List ls) { - assertObjectNotNull("groupInfoList", ls); - return getMyDao().updateListNonstrict( - helpFilterBeforeUpdateInternally(ls)); + if (ls.isEmpty()) { + return new int[] {}; + } + return invoke(createBatchUpdateNonstrictEntityCommand(helpFilterBeforeUpdateInternally(ls))); } protected int[] delegateDeleteList(List ls) { - assertObjectNotNull("groupInfoList", ls); - return getMyDao().deleteList(helpFilterBeforeDeleteInternally(ls)); + if (ls.isEmpty()) { + return new int[] {}; + } + return invoke(createBatchDeleteEntityCommand(helpFilterBeforeDeleteInternally(ls))); } + @SuppressWarnings("unchecked") + protected int[] doRemoveList(List ls) { + return delegateDeleteList((List) ls); + } + protected int[] delegateDeleteListNonstrict(List ls) { - assertObjectNotNull("groupInfoList", ls); - return getMyDao().deleteListNonstrict( - helpFilterBeforeDeleteInternally(ls)); + if (ls.isEmpty()) { + return new int[] {}; + } + return invoke(createBatchDeleteNonstrictEntityCommand(helpFilterBeforeDeleteInternally(ls))); } //========================================================================== Modified: userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/bsbhv/BsGroupMappingBhv.java =================================================================== --- userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/bsbhv/BsGroupMappingBhv.java 2008-12-26 22:11:31 UTC (rev 1622) +++ userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/bsbhv/BsGroupMappingBhv.java 2008-12-27 22:02:56 UTC (rev 1623) @@ -1,9 +1,8 @@ package jp.sf.pal.userinfo.db.bsbhv; import java.util.List; +import java.util.Map; -import jp.sf.pal.userinfo.db.allcommon.DaoReadable; -import jp.sf.pal.userinfo.db.allcommon.DaoWritable; import jp.sf.pal.userinfo.db.allcommon.Entity; import jp.sf.pal.userinfo.db.allcommon.bhv.setup.ValueLabelSetupper; import jp.sf.pal.userinfo.db.allcommon.cbean.ConditionBean; @@ -16,13 +15,12 @@ import jp.sf.pal.userinfo.db.allcommon.dbmeta.DBMeta; import jp.sf.pal.userinfo.db.bsentity.dbmeta.GroupMappingDbm; import jp.sf.pal.userinfo.db.cbean.GroupMappingCB; -import jp.sf.pal.userinfo.db.exdao.GroupMappingDao; import jp.sf.pal.userinfo.db.exentity.GroupInfo; import jp.sf.pal.userinfo.db.exentity.GroupMapping; import jp.sf.pal.userinfo.db.exentity.UserInfo; /** - * The behavior of GROUP_MAPPING. + * The behavior of GROUP_MAPPING that the type is TABLE.
* *
  * [primary-key]
@@ -67,12 +65,6 @@
 
     //==========================================================================
     // =========
-    // Attribute
-    // =========
-    protected GroupMappingDao _dao;
-
-    //==========================================================================
-    // =========
     // Table name
     // ==========
     /** @return The name on database of table. (NotNull) */
@@ -84,39 +76,18 @@
     // =========
     // DBMeta
     // ======
-    /** @return The meta data of the database. (NotNull) */
+    /** @return The instance of DBMeta. (NotNull) */
     public DBMeta getDBMeta() {
         return GroupMappingDbm.getInstance();
     }
 
-    /** @return The meta data of the database as my table type. (NotNull) */
+    /** @return The instance of DBMeta as my table type. (NotNull) */
     public GroupMappingDbm getMyDBMeta() {
         return GroupMappingDbm.getInstance();
     }
 
     //==========================================================================
     // =========
-    // Dao Accessor
-    // ============
-    public GroupMappingDao getMyDao() {
-        return _dao;
-    }
-
-    public void setMyDao(GroupMappingDao dao) {
-        assertObjectNotNull("dao", dao);
-        _dao = dao;
-    }
-
-    public DaoReadable getDaoReadable() {
-        return getMyDao();
-    }
-
-    public DaoWritable getDaoWritable() {
-        return getMyDao();
-    }
-
-    //==========================================================================
-    // =========
     // New Instance
     // ============
     public Entity newEntity() {
@@ -146,7 +117,7 @@
      * @return The selected count.
      */
     public int selectCount(GroupMappingCB cb) {
-        assertConditionBeanNotNull(cb);
+        assertCBNotNull(cb);
         return delegateSelectCount(cb);
     }
 
@@ -226,7 +197,7 @@
      * @return The result bean of selected list. (NotNull)
      */
     public ListResultBean selectList(GroupMappingCB cb) {
-        assertConditionBeanNotNull(cb);
+        assertCBNotNull(cb);
         return new ResultBeanBuilder(getTableDbName())
                 .buildListResultBean(cb, delegateSelectList(cb));
     }
@@ -242,7 +213,7 @@
      * @return The result bean of selected page. (NotNull)
      */
     public PagingResultBean selectPage(final GroupMappingCB cb) {
-        assertConditionBeanNotNull(cb);
+        assertCBNotNull(cb);
         final PagingInvoker invoker = new PagingInvoker(
                 getTableDbName());
         final PagingHandler handler = new PagingHandler() {
@@ -263,6 +234,32 @@
 
     //==========================================================================
     // =========
+    // Scalar Select
+    // =============
+    /**
+     * Select the scalar value derived by a function. 
Call a function + * method after this method called like as follows: + * + *
+     * groupMappingBhv.scalarSelect(Date.class).max(new ScalarQuery(GroupMappingCB cb) {
+     *     cb.specify().columnXxxDatetime(); // the required specification of target column
+     *     cb.query().setXxxName_PrefixSearch("S"); // query as you like it
+     * });
+     * 
+ * + * @param The type of result. + * @param resultType The type of result. (NotNull) + * @return The scalar value derived by a function. (Nullable) + */ + public SLFunction scalarSelect( + Class resultType) { + GroupMappingCB cb = newMyConditionBean(); + cb.xsetupForScalarSelect(); + return new SLFunction(cb, resultType); + } + + //========================================================================== + // ========= // Various Select // ============== /** @@ -272,8 +269,7 @@ * @param valueLabelSetupper The setupper of value-label. (NotNull) * @return The list of value-label. (NotNull) */ - public List> selectValueLabelList( - GroupMappingCB cb, + public List> selectValueLabelList(GroupMappingCB cb, ValueLabelSetupper valueLabelSetupper) { return createValueLabelList(selectList(cb), valueLabelSetupper); } @@ -285,8 +281,8 @@ //========================================================================== // ========= - // Pullout Foreign - // =============== + // Pull out Foreign + // ================ /** * Pull out the list of foreign table 'GroupInfo'. * @@ -499,11 +495,11 @@ */ public int queryUpdate(GroupMapping groupMapping, GroupMappingCB cb) { assertObjectNotNull("groupMapping", groupMapping); - assertConditionBeanNotNull(cb); + assertCBNotNull(cb); setupCommonColumnOfUpdateIfNeeds(groupMapping); filterEntityOfUpdate(groupMapping); assertEntityOfUpdate(groupMapping); - return getMyDao().updateByQuery(cb, groupMapping); + return invoke(createQueryUpdateEntityCBCommand(groupMapping, cb)); } /** @@ -513,8 +509,8 @@ * @return The deleted count. */ public int queryDelete(GroupMappingCB cb) { - assertConditionBeanNotNull(cb); - return getMyDao().deleteByQuery(cb); + assertCBNotNull(cb); + return invoke(createQueryDeleteCBCommand(cb)); } //========================================================================== @@ -526,19 +522,27 @@ // ========= // Delegate Method // =============== + // [Behavior Command] // ----------------------------------------------------- // Select // ------ protected int delegateSelectCount(GroupMappingCB cb) { - assertConditionBeanNotNull(cb); - return getMyDao().selectCount(cb); + return invoke(createSelectCountCBCommand(cb)); } + protected int doCallReadCount(ConditionBean cb) { + return delegateSelectCount((GroupMappingCB) cb); + } + protected List delegateSelectList(GroupMappingCB cb) { - assertConditionBeanNotNull(cb); - return getMyDao().selectList(cb); + return invoke(createSelectListCBCommand(cb, GroupMapping.class)); } + @SuppressWarnings("unchecked") + protected List doCallReadList(ConditionBean cb) { + return (List) delegateSelectList((GroupMappingCB) cb); + } + // ----------------------------------------------------- // Update // ------ @@ -546,38 +550,71 @@ if (!processBeforeInsert(e)) { return 1; } - return getMyDao().insert(e); + return invoke(createInsertEntityCommand(e)); } + protected int doCallCreate(Entity entity) { + return delegateInsert(downcast(entity)); + } + protected int delegateUpdate(GroupMapping e) { if (!processBeforeUpdate(e)) { return 1; } - return getMyDao().updateModifiedOnly(e); + return invoke(createUpdateEntityCommand(e)); } + protected int doCallModify(Entity entity) { + return delegateUpdate(downcast(entity)); + } + protected int delegateDelete(GroupMapping e) { if (!processBeforeDelete(e)) { return 1; } - return getMyDao().delete(e); + return invoke(createDeleteEntityCommand(e)); } + protected int doCallRemove(Entity entity) { + return delegateDelete(downcast(entity)); + } + protected int[] delegateInsertList(List ls) { - assertObjectNotNull("groupMappingList", ls); - return getMyDao().insertList(helpFilterBeforeInsertInternally(ls)); + if (ls.isEmpty()) { + return new int[] {}; + } + return invoke(createBatchInsertEntityCommand(helpFilterBeforeInsertInternally(ls))); } + @SuppressWarnings("unchecked") + protected int[] doCreateList(List ls) { + return delegateInsertList((List) ls); + } + protected int[] delegateUpdateList(List ls) { - assertObjectNotNull("groupMappingList", ls); - return getMyDao().updateList(helpFilterBeforeUpdateInternally(ls)); + if (ls.isEmpty()) { + return new int[] {}; + } + return invoke(createBatchUpdateEntityCommand(helpFilterBeforeUpdateInternally(ls))); } + @SuppressWarnings("unchecked") + protected int[] doModifyList(List ls) { + return delegateUpdateList((List) ls); + } + protected int[] delegateDeleteList(List ls) { - assertObjectNotNull("groupMappingList", ls); - return getMyDao().deleteList(helpFilterBeforeDeleteInternally(ls)); + if (ls.isEmpty()) { + return new int[] {}; + } + return invoke(createBatchDeleteEntityCommand(helpFilterBeforeDeleteInternally(ls))); } + @SuppressWarnings("unchecked") + protected int[] doRemoveList(List ls) { + return delegateDeleteList((List) ls); + } + //========================================================================== // ========= // Optimistic Lock Info Modified: userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/bsbhv/BsRoleInfoBhv.java =================================================================== --- userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/bsbhv/BsRoleInfoBhv.java 2008-12-26 22:11:31 UTC (rev 1622) +++ userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/bsbhv/BsRoleInfoBhv.java 2008-12-27 22:02:56 UTC (rev 1623) @@ -1,9 +1,8 @@ package jp.sf.pal.userinfo.db.bsbhv; import java.util.List; +import java.util.Map; -import jp.sf.pal.userinfo.db.allcommon.DaoReadable; -import jp.sf.pal.userinfo.db.allcommon.DaoWritable; import jp.sf.pal.userinfo.db.allcommon.Entity; import jp.sf.pal.userinfo.db.allcommon.bhv.load.LoadReferrerOption; import jp.sf.pal.userinfo.db.allcommon.bhv.setup.ConditionBeanSetupper; @@ -22,13 +21,12 @@ import jp.sf.pal.userinfo.db.cbean.UserInfoCB; import jp.sf.pal.userinfo.db.exbhv.RoleMappingBhv; import jp.sf.pal.userinfo.db.exbhv.UserInfoBhv; -import jp.sf.pal.userinfo.db.exdao.RoleInfoDao; import jp.sf.pal.userinfo.db.exentity.RoleInfo; import jp.sf.pal.userinfo.db.exentity.RoleMapping; import jp.sf.pal.userinfo.db.exentity.UserInfo; /** - * The behavior of ROLE_INFO. + * The behavior of ROLE_INFO that the type is TABLE.
* *
  * [primary-key]
@@ -73,12 +71,6 @@
 
     //==========================================================================
     // =========
-    // Attribute
-    // =========
-    protected RoleInfoDao _dao;
-
-    //==========================================================================
-    // =========
     // Table name
     // ==========
     /** @return The name on database of table. (NotNull) */
@@ -90,39 +82,18 @@
     // =========
     // DBMeta
     // ======
-    /** @return The meta data of the database. (NotNull) */
+    /** @return The instance of DBMeta. (NotNull) */
     public DBMeta getDBMeta() {
         return RoleInfoDbm.getInstance();
     }
 
-    /** @return The meta data of the database as my table type. (NotNull) */
+    /** @return The instance of DBMeta as my table type. (NotNull) */
     public RoleInfoDbm getMyDBMeta() {
         return RoleInfoDbm.getInstance();
     }
 
     //==========================================================================
     // =========
-    // Dao Accessor
-    // ============
-    public RoleInfoDao getMyDao() {
-        return _dao;
-    }
-
-    public void setMyDao(RoleInfoDao dao) {
-        assertObjectNotNull("dao", dao);
-        _dao = dao;
-    }
-
-    public DaoReadable getDaoReadable() {
-        return getMyDao();
-    }
-
-    public DaoWritable getDaoWritable() {
-        return getMyDao();
-    }
-
-    //==========================================================================
-    // =========
     // New Instance
     // ============
     public Entity newEntity() {
@@ -152,7 +123,7 @@
      * @return The selected count.
      */
     public int selectCount(RoleInfoCB cb) {
-        assertConditionBeanNotNull(cb);
+        assertCBNotNull(cb);
         return delegateSelectCount(cb);
     }
 
@@ -229,7 +200,7 @@
      * @return The result bean of selected list. (NotNull)
      */
     public ListResultBean selectList(RoleInfoCB cb) {
-        assertConditionBeanNotNull(cb);
+        assertCBNotNull(cb);
         return new ResultBeanBuilder(getTableDbName())
                 .buildListResultBean(cb, delegateSelectList(cb));
     }
@@ -245,7 +216,7 @@
      * @return The result bean of selected page. (NotNull)
      */
     public PagingResultBean selectPage(final RoleInfoCB cb) {
-        assertConditionBeanNotNull(cb);
+        assertCBNotNull(cb);
         final PagingInvoker invoker = new PagingInvoker(
                 getTableDbName());
         final PagingHandler handler = new PagingHandler() {
@@ -266,6 +237,32 @@
 
     //==========================================================================
     // =========
+    // Scalar Select
+    // =============
+    /**
+     * Select the scalar value derived by a function. 
Call a function + * method after this method called like as follows: + * + *
+     * roleInfoBhv.scalarSelect(Date.class).max(new ScalarQuery(RoleInfoCB cb) {
+     *     cb.specify().columnXxxDatetime(); // the required specification of target column
+     *     cb.query().setXxxName_PrefixSearch("S"); // query as you like it
+     * });
+     * 
+ * + * @param The type of result. + * @param resultType The type of result. (NotNull) + * @return The scalar value derived by a function. (Nullable) + */ + public SLFunction scalarSelect( + Class resultType) { + RoleInfoCB cb = newMyConditionBean(); + cb.xsetupForScalarSelect(); + return new SLFunction(cb, resultType); + } + + //========================================================================== + // ========= // Various Select // ============== /** @@ -275,8 +272,8 @@ * @param valueLabelSetupper The setupper of value-label. (NotNull) * @return The list of value-label. (NotNull) */ - public List> selectValueLabelList( - RoleInfoCB cb, ValueLabelSetupper valueLabelSetupper) { + public List> selectValueLabelList(RoleInfoCB cb, + ValueLabelSetupper valueLabelSetupper) { return createValueLabelList(selectList(cb), valueLabelSetupper); } @@ -467,8 +464,8 @@ //========================================================================== // ========= - // Pullout Foreign - // =============== + // Pull out Foreign + // ================ //========================================================================== // ========= @@ -764,11 +761,11 @@ */ public int queryUpdate(RoleInfo roleInfo, RoleInfoCB cb) { assertObjectNotNull("roleInfo", roleInfo); - assertConditionBeanNotNull(cb); + assertCBNotNull(cb); setupCommonColumnOfUpdateIfNeeds(roleInfo); filterEntityOfUpdate(roleInfo); assertEntityOfUpdate(roleInfo); - return getMyDao().updateByQuery(cb, roleInfo); + return invoke(createQueryUpdateEntityCBCommand(roleInfo, cb)); } /** @@ -778,8 +775,8 @@ * @return The deleted count. */ public int queryDelete(RoleInfoCB cb) { - assertConditionBeanNotNull(cb); - return getMyDao().deleteByQuery(cb); + assertCBNotNull(cb); + return invoke(createQueryDeleteCBCommand(cb)); } //========================================================================== @@ -791,19 +788,27 @@ // ========= // Delegate Method // =============== + // [Behavior Command] // ----------------------------------------------------- // Select // ------ protected int delegateSelectCount(RoleInfoCB cb) { - assertConditionBeanNotNull(cb); - return getMyDao().selectCount(cb); + return invoke(createSelectCountCBCommand(cb)); } + protected int doCallReadCount(ConditionBean cb) { + return delegateSelectCount((RoleInfoCB) cb); + } + protected List delegateSelectList(RoleInfoCB cb) { - assertConditionBeanNotNull(cb); - return getMyDao().selectList(cb); + return invoke(createSelectListCBCommand(cb, RoleInfo.class)); } + @SuppressWarnings("unchecked") + protected List doCallReadList(ConditionBean cb) { + return (List) delegateSelectList((RoleInfoCB) cb); + } + // ----------------------------------------------------- // Update // ------ @@ -811,62 +816,97 @@ if (!processBeforeInsert(e)) { return 1; } - return getMyDao().insert(e); + return invoke(createInsertEntityCommand(e)); } + protected int doCallCreate(Entity entity) { + return delegateInsert(downcast(entity)); + } + protected int delegateUpdate(RoleInfo e) { if (!processBeforeUpdate(e)) { return 1; } - return getMyDao().updateModifiedOnly(e); + return invoke(createUpdateEntityCommand(e)); } + protected int doCallModify(Entity entity) { + return delegateUpdate(downcast(entity)); + } + protected int delegateUpdateNonstrict(RoleInfo e) { if (!processBeforeUpdate(e)) { return 1; } - return getMyDao().updateNonstrictModifiedOnly(e); + return invoke(createUpdateNonstrictEntityCommand(e)); } protected int delegateDelete(RoleInfo e) { if (!processBeforeDelete(e)) { return 1; } - return getMyDao().delete(e); + return invoke(createDeleteEntityCommand(e)); } + protected int doCallRemove(Entity entity) { + return delegateDelete(downcast(entity)); + } + protected int delegateDeleteNonstrict(RoleInfo e) { if (!processBeforeDelete(e)) { return 1; } - return getMyDao().deleteNonstrict(e); + return invoke(createDeleteNonstrictEntityCommand(e)); } protected int[] delegateInsertList(List ls) { - assertObjectNotNull("roleInfoList", ls); - return getMyDao().insertList(helpFilterBeforeInsertInternally(ls)); + if (ls.isEmpty()) { + return new int[] {}; + } + return invoke(createBatchInsertEntityCommand(helpFilterBeforeInsertInternally(ls))); } + @SuppressWarnings("unchecked") + protected int[] doCreateList(List ls) { + return delegateInsertList((List) ls); + } + protected int[] delegateUpdateList(List ls) { - assertObjectNotNull("roleInfoList", ls); - return getMyDao().updateList(helpFilterBeforeUpdateInternally(ls)); + if (ls.isEmpty()) { + return new int[] {}; + } + return invoke(createBatchUpdateEntityCommand(helpFilterBeforeUpdateInternally(ls))); } + @SuppressWarnings("unchecked") + protected int[] doModifyList(List ls) { + return delegateUpdateList((List) ls); + } + protected int[] delegateUpdateListNonstrict(List ls) { - assertObjectNotNull("roleInfoList", ls); - return getMyDao().updateListNonstrict( - helpFilterBeforeUpdateInternally(ls)); + if (ls.isEmpty()) { + return new int[] {}; + } + return invoke(createBatchUpdateNonstrictEntityCommand(helpFilterBeforeUpdateInternally(ls))); } protected int[] delegateDeleteList(List ls) { - assertObjectNotNull("roleInfoList", ls); - return getMyDao().deleteList(helpFilterBeforeDeleteInternally(ls)); + if (ls.isEmpty()) { + return new int[] {}; + } + return invoke(createBatchDeleteEntityCommand(helpFilterBeforeDeleteInternally(ls))); } + @SuppressWarnings("unchecked") + protected int[] doRemoveList(List ls) { + return delegateDeleteList((List) ls); + } + protected int[] delegateDeleteListNonstrict(List ls) { - assertObjectNotNull("roleInfoList", ls); - return getMyDao().deleteListNonstrict( - helpFilterBeforeDeleteInternally(ls)); + if (ls.isEmpty()) { + return new int[] {}; + } + return invoke(createBatchDeleteNonstrictEntityCommand(helpFilterBeforeDeleteInternally(ls))); } //========================================================================== Modified: userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/bsbhv/BsRoleMappingBhv.java =================================================================== --- userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/bsbhv/BsRoleMappingBhv.java 2008-12-26 22:11:31 UTC (rev 1622) +++ userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/bsbhv/BsRoleMappingBhv.java 2008-12-27 22:02:56 UTC (rev 1623) @@ -1,9 +1,8 @@ package jp.sf.pal.userinfo.db.bsbhv; import java.util.List; +import java.util.Map; -import jp.sf.pal.userinfo.db.allcommon.DaoReadable; -import jp.sf.pal.userinfo.db.allcommon.DaoWritable; import jp.sf.pal.userinfo.db.allcommon.Entity; import jp.sf.pal.userinfo.db.allcommon.bhv.setup.ValueLabelSetupper; import jp.sf.pal.userinfo.db.allcommon.cbean.ConditionBean; @@ -16,13 +15,12 @@ import jp.sf.pal.userinfo.db.allcommon.dbmeta.DBMeta; import jp.sf.pal.userinfo.db.bsentity.dbmeta.RoleMappingDbm; import jp.sf.pal.userinfo.db.cbean.RoleMappingCB; -import jp.sf.pal.userinfo.db.exdao.RoleMappingDao; import jp.sf.pal.userinfo.db.exentity.RoleInfo; import jp.sf.pal.userinfo.db.exentity.RoleMapping; import jp.sf.pal.userinfo.db.exentity.UserInfo; /** - * The behavior of ROLE_MAPPING. + * The behavior of ROLE_MAPPING that the type is TABLE.
* *
  * [primary-key]
@@ -67,12 +65,6 @@
 
     //==========================================================================
     // =========
-    // Attribute
-    // =========
-    protected RoleMappingDao _dao;
-
-    //==========================================================================
-    // =========
     // Table name
     // ==========
     /** @return The name on database of table. (NotNull) */
@@ -84,39 +76,18 @@
     // =========
     // DBMeta
     // ======
-    /** @return The meta data of the database. (NotNull) */
+    /** @return The instance of DBMeta. (NotNull) */
     public DBMeta getDBMeta() {
         return RoleMappingDbm.getInstance();
     }
 
-    /** @return The meta data of the database as my table type. (NotNull) */
+    /** @return The instance of DBMeta as my table type. (NotNull) */
     public RoleMappingDbm getMyDBMeta() {
         return RoleMappingDbm.getInstance();
     }
 
     //==========================================================================
     // =========
-    // Dao Accessor
-    // ============
-    public RoleMappingDao getMyDao() {
-        return _dao;
-    }
-
-    public void setMyDao(RoleMappingDao dao) {
-        assertObjectNotNull("dao", dao);
-        _dao = dao;
-    }
-
-    public DaoReadable getDaoReadable() {
-        return getMyDao();
-    }
-
-    public DaoWritable getDaoWritable() {
-        return getMyDao();
-    }
-
-    //==========================================================================
-    // =========
     // New Instance
     // ============
     public Entity newEntity() {
@@ -146,7 +117,7 @@
      * @return The selected count.
      */
     public int selectCount(RoleMappingCB cb) {
-        assertConditionBeanNotNull(cb);
+        assertCBNotNull(cb);
         return delegateSelectCount(cb);
     }
 
@@ -223,7 +194,7 @@
      * @return The result bean of selected list. (NotNull)
      */
     public ListResultBean selectList(RoleMappingCB cb) {
-        assertConditionBeanNotNull(cb);
+        assertCBNotNull(cb);
         return new ResultBeanBuilder(getTableDbName())
                 .buildListResultBean(cb, delegateSelectList(cb));
     }
@@ -239,7 +210,7 @@
      * @return The result bean of selected page. (NotNull)
      */
     public PagingResultBean selectPage(final RoleMappingCB cb) {
-        assertConditionBeanNotNull(cb);
+        assertCBNotNull(cb);
         final PagingInvoker invoker = new PagingInvoker(
                 getTableDbName());
         final PagingHandler handler = new PagingHandler() {
@@ -260,6 +231,32 @@
 
     //==========================================================================
     // =========
+    // Scalar Select
+    // =============
+    /**
+     * Select the scalar value derived by a function. 
Call a function + * method after this method called like as follows: + * + *
+     * roleMappingBhv.scalarSelect(Date.class).max(new ScalarQuery(RoleMappingCB cb) {
+     *     cb.specify().columnXxxDatetime(); // the required specification of target column
+     *     cb.query().setXxxName_PrefixSearch("S"); // query as you like it
+     * });
+     * 
+ * + * @param The type of result. + * @param resultType The type of result. (NotNull) + * @return The scalar value derived by a function. (Nullable) + */ + public SLFunction scalarSelect( + Class resultType) { + RoleMappingCB cb = newMyConditionBean(); + cb.xsetupForScalarSelect(); + return new SLFunction(cb, resultType); + } + + //========================================================================== + // ========= // Various Select // ============== /** @@ -269,8 +266,8 @@ * @param valueLabelSetupper The setupper of value-label. (NotNull) * @return The list of value-label. (NotNull) */ - public List> selectValueLabelList( - RoleMappingCB cb, ValueLabelSetupper valueLabelSetupper) { + public List> selectValueLabelList(RoleMappingCB cb, + ValueLabelSetupper valueLabelSetupper) { return createValueLabelList(selectList(cb), valueLabelSetupper); } @@ -281,8 +278,8 @@ //========================================================================== // ========= - // Pullout Foreign - // =============== + // Pull out Foreign + // ================ /** * Pull out the list of foreign table 'RoleInfo'. * @@ -494,11 +491,11 @@ */ public int queryUpdate(RoleMapping roleMapping, RoleMappingCB cb) { assertObjectNotNull("roleMapping", roleMapping); - assertConditionBeanNotNull(cb); + assertCBNotNull(cb); setupCommonColumnOfUpdateIfNeeds(roleMapping); filterEntityOfUpdate(roleMapping); assertEntityOfUpdate(roleMapping); - return getMyDao().updateByQuery(cb, roleMapping); + return invoke(createQueryUpdateEntityCBCommand(roleMapping, cb)); } /** @@ -508,8 +505,8 @@ * @return The deleted count. */ public int queryDelete(RoleMappingCB cb) { - assertConditionBeanNotNull(cb); - return getMyDao().deleteByQuery(cb); + assertCBNotNull(cb); + return invoke(createQueryDeleteCBCommand(cb)); } //========================================================================== @@ -521,19 +518,27 @@ // ========= // Delegate Method // =============== + // [Behavior Command] // ----------------------------------------------------- // Select // ------ protected int delegateSelectCount(RoleMappingCB cb) { - assertConditionBeanNotNull(cb); - return getMyDao().selectCount(cb); + return invoke(createSelectCountCBCommand(cb)); } + protected int doCallReadCount(ConditionBean cb) { + return delegateSelectCount((RoleMappingCB) cb); + } + protected List delegateSelectList(RoleMappingCB cb) { - assertConditionBeanNotNull(cb); - return getMyDao().selectList(cb); + return invoke(createSelectListCBCommand(cb, RoleMapping.class)); } + @SuppressWarnings("unchecked") + protected List doCallReadList(ConditionBean cb) { + return (List) delegateSelectList((RoleMappingCB) cb); + } + // ----------------------------------------------------- // Update // ------ @@ -541,38 +546,71 @@ if (!processBeforeInsert(e)) { return 1; } - return getMyDao().insert(e); + return invoke(createInsertEntityCommand(e)); } + protected int doCallCreate(Entity entity) { + return delegateInsert(downcast(entity)); + } + protected int delegateUpdate(RoleMapping e) { if (!processBeforeUpdate(e)) { return 1; } - return getMyDao().updateModifiedOnly(e); + return invoke(createUpdateEntityCommand(e)); } + protected int doCallModify(Entity entity) { + return delegateUpdate(downcast(entity)); + } + protected int delegateDelete(RoleMapping e) { if (!processBeforeDelete(e)) { return 1; } - return getMyDao().delete(e); + return invoke(createDeleteEntityCommand(e)); } + protected int doCallRemove(Entity entity) { + return delegateDelete(downcast(entity)); + } + protected int[] delegateInsertList(List ls) { - assertObjectNotNull("roleMappingList", ls); - return getMyDao().insertList(helpFilterBeforeInsertInternally(ls)); + if (ls.isEmpty()) { + return new int[] {}; + } + return invoke(createBatchInsertEntityCommand(helpFilterBeforeInsertInternally(ls))); } + @SuppressWarnings("unchecked") + protected int[] doCreateList(List ls) { + return delegateInsertList((List) ls); + } + protected int[] delegateUpdateList(List ls) { - assertObjectNotNull("roleMappingList", ls); - return getMyDao().updateList(helpFilterBeforeUpdateInternally(ls)); + if (ls.isEmpty()) { + return new int[] {}; + } + return invoke(createBatchUpdateEntityCommand(helpFilterBeforeUpdateInternally(ls))); } + @SuppressWarnings("unchecked") + protected int[] doModifyList(List ls) { + return delegateUpdateList((List) ls); + } + protected int[] delegateDeleteList(List ls) { - assertObjectNotNull("roleMappingList", ls); - return getMyDao().deleteList(helpFilterBeforeDeleteInternally(ls)); + if (ls.isEmpty()) { + return new int[] {}; + } + return invoke(createBatchDeleteEntityCommand(helpFilterBeforeDeleteInternally(ls))); } + @SuppressWarnings("unchecked") + protected int[] doRemoveList(List ls) { + return delegateDeleteList((List) ls); + } + //========================================================================== // ========= // Optimistic Lock Info Modified: userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/bsbhv/BsUserInfoBhv.java =================================================================== --- userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/bsbhv/BsUserInfoBhv.java 2008-12-26 22:11:31 UTC (rev 1622) +++ userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/bsbhv/BsUserInfoBhv.java 2008-12-27 22:02:56 UTC (rev 1623) @@ -1,9 +1,8 @@ package jp.sf.pal.userinfo.db.bsbhv; import java.util.List; +import java.util.Map; -import jp.sf.pal.userinfo.db.allcommon.DaoReadable; -import jp.sf.pal.userinfo.db.allcommon.DaoWritable; import jp.sf.pal.userinfo.db.allcommon.Entity; import jp.sf.pal.userinfo.db.allcommon.bhv.load.LoadReferrerOption; import jp.sf.pal.userinfo.db.allcommon.bhv.setup.ConditionBeanSetupper; @@ -22,7 +21,6 @@ import jp.sf.pal.userinfo.db.cbean.UserInfoCB; import jp.sf.pal.userinfo.db.exbhv.GroupMappingBhv; import jp.sf.pal.userinfo.db.exbhv.RoleMappingBhv; -import jp.sf.pal.userinfo.db.exdao.UserInfoDao; import jp.sf.pal.userinfo.db.exentity.GroupInfo; import jp.sf.pal.userinfo.db.exentity.GroupMapping; import jp.sf.pal.userinfo.db.exentity.RoleInfo; @@ -30,14 +28,14 @@ import jp.sf.pal.userinfo.db.exentity.UserInfo; /** - * The behavior of USER_INFO. + * The behavior of USER_INFO that the type is TABLE.
* *
  * [primary-key]
  *     USER_ID
  * 
  * [column]
- *     USER_ID, GIVEN_NAME, FAMILY_NAME, MIDDLE_NAME, GIVEN_NAME_DESC, FAMILY_NAME_DESC, NICKNAME, GENDER, BIRTH_DATE, EMAIL, URL, TELEPHONE, LOCALE, ROLE_ID, GROUP_ID, CREATED_TIME, CREATED_BY, UPDATED_TIME, UPDATED_BY, DELETED_TIME, DELETED_BY, VERSIONNO
+ *     USER_ID, GIVEN_NAME, FAMILY_NAME, MIDDLE_NAME, GIVEN_NAME_DESC, FAMILY_NAME_DESC, NICKNAME, GENDER, BIRTH_DATE, EMAIL, URL, TELEPHONE, LOCALE, ROLE_ID, GROUP_ID, STATUS, CREATED_TIME, CREATED_BY, UPDATED_TIME, UPDATED_BY, DELETED_TIME, DELETED_BY, VERSIONNO
  * 
  * [sequence]
  *     
@@ -75,12 +73,6 @@
 
     //==========================================================================
     // =========
-    // Attribute
-    // =========
-    protected UserInfoDao _dao;
-
-    //==========================================================================
-    // =========
     // Table name
     // ==========
     /** @return The name on database of table. (NotNull) */
@@ -92,39 +84,18 @@
     // =========
     // DBMeta
     // ======
-    /** @return The meta data of the database. (NotNull) */
+    /** @return The instance of DBMeta. (NotNull) */
     public DBMeta getDBMeta() {
         return UserInfoDbm.getInstance();
     }
 
-    /** @return The meta data of the database as my table type. (NotNull) */
+    /** @return The instance of DBMeta as my table type. (NotNull) */
     public UserInfoDbm getMyDBMeta() {
         return UserInfoDbm.getInstance();
     }
 
     //==========================================================================
     // =========
-    // Dao Accessor
-    // ============
-    public UserInfoDao getMyDao() {
-        return _dao;
-    }
-
-    public void setMyDao(UserInfoDao dao) {
-        assertObjectNotNull("dao", dao);
-        _dao = dao;
-    }
-
-    public DaoReadable getDaoReadable() {
-        return getMyDao();
-    }
-
-    public DaoWritable getDaoWritable() {
-        return getMyDao();
-    }
-
-    //==========================================================================
-    // =========
     // New Instance
     // ============
     public Entity newEntity() {
@@ -154,7 +125,7 @@
      * @return The selected count.
      */
     public int selectCount(UserInfoCB cb) {
-        assertConditionBeanNotNull(cb);
+        assertCBNotNull(cb);
         return delegateSelectCount(cb);
     }
 
@@ -231,7 +202,7 @@
      * @return The result bean of selected list. (NotNull)
      */
     public ListResultBean selectList(UserInfoCB cb) {
-        assertConditionBeanNotNull(cb);
+        assertCBNotNull(cb);
         return new ResultBeanBuilder(getTableDbName())
                 .buildListResultBean(cb, delegateSelectList(cb));
     }
@@ -247,7 +218,7 @@
      * @return The result bean of selected page. (NotNull)
      */
     public PagingResultBean selectPage(final UserInfoCB cb) {
-        assertConditionBeanNotNull(cb);
+        assertCBNotNull(cb);
         final PagingInvoker invoker = new PagingInvoker(
                 getTableDbName());
         final PagingHandler handler = new PagingHandler() {
@@ -268,6 +239,32 @@
 
     //==========================================================================
     // =========
+    // Scalar Select
+    // =============
+    /**
+     * Select the scalar value derived by a function. 
Call a function + * method after this method called like as follows: + * + *
+     * userInfoBhv.scalarSelect(Date.class).max(new ScalarQuery(UserInfoCB cb) {
+     *     cb.specify().columnXxxDatetime(); // the required specification of target column
+     *     cb.query().setXxxName_PrefixSearch("S"); // query as you like it
+     * });
+     * 
+ * + * @param The type of result. + * @param resultType The type of result. (NotNull) + * @return The scalar value derived by a function. (Nullable) + */ + public SLFunction scalarSelect( + Class resultType) { + UserInfoCB cb = newMyConditionBean(); + cb.xsetupForScalarSelect(); + return new SLFunction(cb, resultType); + } + + //========================================================================== + // ========= // Various Select // ============== /** @@ -277,8 +274,8 @@ * @param valueLabelSetupper The setupper of value-label. (NotNull) * @return The list of value-label. (NotNull) */ - public List> selectValueLabelList( - UserInfoCB cb, ValueLabelSetupper valueLabelSetupper) { + public List> selectValueLabelList(UserInfoCB cb, + ValueLabelSetupper valueLabelSetupper) { return createValueLabelList(selectList(cb), valueLabelSetupper); } @@ -470,8 +467,8 @@ //========================================================================== // ========= - // Pullout Foreign - // =============== + // Pull out Foreign + // ================ /** * Pull out the list of foreign table 'GroupInfo'. * @@ -796,11 +793,11 @@ */ public int queryUpdate(UserInfo userInfo, UserInfoCB cb) { assertObjectNotNull("userInfo", userInfo); - assertConditionBeanNotNull(cb); + assertCBNotNull(cb); setupCommonColumnOfUpdateIfNeeds(userInfo); filterEntityOfUpdate(userInfo); assertEntityOfUpdate(userInfo); - return getMyDao().updateByQuery(cb, userInfo); + return invoke(createQueryUpdateEntityCBCommand(userInfo, cb)); } /** @@ -810,8 +807,8 @@ * @return The deleted count. */ public int queryDelete(UserInfoCB cb) { - assertConditionBeanNotNull(cb); - return getMyDao().deleteByQuery(cb); + assertCBNotNull(cb); + return invoke(createQueryDeleteCBCommand(cb)); } //========================================================================== @@ -823,19 +820,27 @@ // ========= // Delegate Method // =============== + // [Behavior Command] // ----------------------------------------------------- // Select // ------ protected int delegateSelectCount(UserInfoCB cb) { - assertConditionBeanNotNull(cb); - return getMyDao().selectCount(cb); + return invoke(createSelectCountCBCommand(cb)); } + protected int doCallReadCount(ConditionBean cb) { + return delegateSelectCount((UserInfoCB) cb); + } + protected List delegateSelectList(UserInfoCB cb) { - assertConditionBeanNotNull(cb); - return getMyDao().selectList(cb); + return invoke(createSelectListCBCommand(cb, UserInfo.class)); } + @SuppressWarnings("unchecked") + protected List doCallReadList(ConditionBean cb) { + return (List) delegateSelectList((UserInfoCB) cb); + } + // ----------------------------------------------------- // Update // ------ @@ -843,62 +848,97 @@ if (!processBeforeInsert(e)) { return 1; } - return getMyDao().insert(e); + return invoke(createInsertEntityCommand(e)); } + protected int doCallCreate(Entity entity) { + return delegateInsert(downcast(entity)); + } + protected int delegateUpdate(UserInfo e) { if (!processBeforeUpdate(e)) { return 1; } - return getMyDao().updateModifiedOnly(e); + return invoke(createUpdateEntityCommand(e)); } + protected int doCallModify(Entity entity) { + return delegateUpdate(downcast(entity)); + } + protected int delegateUpdateNonstrict(UserInfo e) { if (!processBeforeUpdate(e)) { return 1; } - return getMyDao().updateNonstrictModifiedOnly(e); + return invoke(createUpdateNonstrictEntityCommand(e)); } protected int delegateDelete(UserInfo e) { if (!processBeforeDelete(e)) { return 1; } - return getMyDao().delete(e); + return invoke(createDeleteEntityCommand(e)); } + protected int doCallRemove(Entity entity) { + return delegateDelete(downcast(entity)); + } + protected int delegateDeleteNonstrict(UserInfo e) { if (!processBeforeDelete(e)) { return 1; } - return getMyDao().deleteNonstrict(e); + return invoke(createDeleteNonstrictEntityCommand(e)); } protected int[] delegateInsertList(List ls) { - assertObjectNotNull("userInfoList", ls); - return getMyDao().insertList(helpFilterBeforeInsertInternally(ls)); + if (ls.isEmpty()) { + return new int[] {}; + } + return invoke(createBatchInsertEntityCommand(helpFilterBeforeInsertInternally(ls))); } + @SuppressWarnings("unchecked") + protected int[] doCreateList(List ls) { + return delegateInsertList((List) ls); + } + protected int[] delegateUpdateList(List ls) { - assertObjectNotNull("userInfoList", ls); - return getMyDao().updateList(helpFilterBeforeUpdateInternally(ls)); + if (ls.isEmpty()) { + return new int[] {}; + } + return invoke(createBatchUpdateEntityCommand(helpFilterBeforeUpdateInternally(ls))); } + @SuppressWarnings("unchecked") + protected int[] doModifyList(List ls) { + return delegateUpdateList((List) ls); + } + protected int[] delegateUpdateListNonstrict(List ls) { - assertObjectNotNull("userInfoList", ls); - return getMyDao().updateListNonstrict( - helpFilterBeforeUpdateInternally(ls)); + if (ls.isEmpty()) { + return new int[] {}; + } + return invoke(createBatchUpdateNonstrictEntityCommand(helpFilterBeforeUpdateInternally(ls))); } protected int[] delegateDeleteList(List ls) { - assertObjectNotNull("userInfoList", ls); - return getMyDao().deleteList(helpFilterBeforeDeleteInternally(ls)); + if (ls.isEmpty()) { + return new int[] {}; + } + return invoke(createBatchDeleteEntityCommand(helpFilterBeforeDeleteInternally(ls))); } + @SuppressWarnings("unchecked") + protected int[] doRemoveList(List ls) { + return delegateDeleteList((List) ls); + } + protected int[] delegateDeleteListNonstrict(List ls) { - assertObjectNotNull("userInfoList", ls); - return getMyDao().deleteListNonstrict( - helpFilterBeforeDeleteInternally(ls)); + if (ls.isEmpty()) { + return new int[] {}; + } + return invoke(createBatchDeleteNonstrictEntityCommand(helpFilterBeforeDeleteInternally(ls))); } //========================================================================== Deleted: userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/bsdao/BsGroupInfoDao.java =================================================================== --- userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/bsdao/BsGroupInfoDao.java 2008-12-26 22:11:31 UTC (rev 1622) +++ userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/bsdao/BsGroupInfoDao.java 2008-12-27 22:02:56 UTC (rev 1623) @@ -1,45 +0,0 @@ -package jp.sf.pal.userinfo.db.bsdao; - -import java.util.List; - -import jp.sf.pal.userinfo.db.cbean.GroupInfoCB; -import jp.sf.pal.userinfo.db.exentity.GroupInfo; - -/** - * The DAO interface of GROUP_INFO. - * - * @author DBFlute(AutoGenerator) - */ -public interface BsGroupInfoDao extends - jp.sf.pal.userinfo.db.allcommon.DaoWritable { - - public Class BEAN = GroupInfo.class; // For S2Dao - - public int selectCount(GroupInfoCB cb); - - public List 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 entityList); - - int[] updateList(List entityList); - - int[] updateListNonstrict(List entityList); - - int updateByQuery(GroupInfoCB cb, GroupInfo entity); - - int[] deleteList(List entityList); - - int[] deleteListNonstrict(List entityList); - - int deleteByQuery(GroupInfoCB cb); -} Deleted: userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/bsdao/BsGroupMappingDao.java =================================================================== --- userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/bsdao/BsGroupMappingDao.java 2008-12-26 22:11:31 UTC (rev 1622) +++ userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/bsdao/BsGroupMappingDao.java 2008-12-27 22:02:56 UTC (rev 1623) @@ -1,37 +0,0 @@ -package jp.sf.pal.userinfo.db.bsdao; - -import java.util.List; - -import jp.sf.pal.userinfo.db.cbean.GroupMappingCB; -import jp.sf.pal.userinfo.db.exentity.GroupMapping; - -/** - * The DAO interface of GROUP_MAPPING. - * - * @author DBFlute(AutoGenerator) - */ -public interface BsGroupMappingDao extends - jp.sf.pal.userinfo.db.allcommon.DaoWritable { - - public Class BEAN = GroupMapping.class; // For S2Dao - - public int selectCount(GroupMappingCB cb); - - public List selectList(GroupMappingCB cb); - - int insert(GroupMapping entity); - - int updateModifiedOnly(GroupMapping entity); - - int delete(GroupMapping entity); - - int[] insertList(List entityList); - - int[] updateList(List entityList); - - int updateByQuery(GroupMappingCB cb, GroupMapping entity); - - int[] deleteList(List entityList); - - int deleteByQuery(GroupMappingCB cb); -} Deleted: userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/bsdao/BsRoleInfoDao.java =================================================================== --- userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/bsdao/BsRoleInfoDao.java 2008-12-26 22:11:31 UTC (rev 1622) +++ userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/bsdao/BsRoleInfoDao.java 2008-12-27 22:02:56 UTC (rev 1623) @@ -1,45 +0,0 @@ -package jp.sf.pal.userinfo.db.bsdao; - -import java.util.List; - -import jp.sf.pal.userinfo.db.cbean.RoleInfoCB; -import jp.sf.pal.userinfo.db.exentity.RoleInfo; - -/** - * The DAO interface of ROLE_INFO. - * - * @author DBFlute(AutoGenerator) - */ -public interface BsRoleInfoDao extends - jp.sf.pal.userinfo.db.allcommon.DaoWritable { - - public Class BEAN = RoleInfo.class; // For S2Dao - - public int selectCount(RoleInfoCB cb); - - public List 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 entityList); - - int[] updateList(List entityList); - - int[] updateListNonstrict(List entityList); - - int updateByQuery(RoleInfoCB cb, RoleInfo entity); - - int[] deleteList(List entityList); - - int[] deleteListNonstrict(List entityList); - - int deleteByQuery(RoleInfoCB cb); -} Deleted: userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/bsdao/BsRoleMappingDao.java =================================================================== --- userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/bsdao/BsRoleMappingDao.java 2008-12-26 22:11:31 UTC (rev 1622) +++ userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/bsdao/BsRoleMappingDao.java 2008-12-27 22:02:56 UTC (rev 1623) @@ -1,37 +0,0 @@ -package jp.sf.pal.userinfo.db.bsdao; - -import java.util.List; - -import jp.sf.pal.userinfo.db.cbean.RoleMappingCB; -import jp.sf.pal.userinfo.db.exentity.RoleMapping; - -/** - * The DAO interface of ROLE_MAPPING. - * - * @author DBFlute(AutoGenerator) - */ -public interface BsRoleMappingDao extends - jp.sf.pal.userinfo.db.allcommon.DaoWritable { - - public Class BEAN = RoleMapping.class; // For S2Dao - - public int selectCount(RoleMappingCB cb); - - public List selectList(RoleMappingCB cb); - - int insert(RoleMapping entity); - - int updateModifiedOnly(RoleMapping entity); - - int delete(RoleMapping entity); - - int[] insertList(List entityList); - - int[] updateList(List entityList); - - int updateByQuery(RoleMappingCB cb, RoleMapping entity); - - int[] deleteList(List entityList); - - int deleteByQuery(RoleMappingCB cb); -} Deleted: userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/bsdao/BsUserInfoDao.java =================================================================== --- userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/bsdao/BsUserInfoDao.java 2008-12-26 22:11:31 UTC (rev 1622) +++ userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/bsdao/BsUserInfoDao.java 2008-12-27 22:02:56 UTC (rev 1623) @@ -1,45 +0,0 @@ -package jp.sf.pal.userinfo.db.bsdao; - -import java.util.List; - -import jp.sf.pal.userinfo.db.cbean.UserInfoCB; -import jp.sf.pal.userinfo.db.exentity.UserInfo; - -/** - * The DAO interface of USER_INFO. - * - * @author DBFlute(AutoGenerator) - */ -public interface BsUserInfoDao extends - jp.sf.pal.userinfo.db.allcommon.DaoWritable { - - public Class BEAN = UserInfo.class; // For S2Dao - - public int selectCount(UserInfoCB cb); - - public List 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 entityList); - - int[] updateList(List entityList); - - int[] updateListNonstrict(List entityList); - - int updateByQuery(UserInfoCB cb, UserInfo entity); - - int[] deleteList(List entityList); - - int[] deleteListNonstrict(List entityList); - - int deleteByQuery(UserInfoCB cb); -} Modified: userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/bsentity/BsGroupInfo.java =================================================================== --- userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/bsentity/BsGroupInfo.java 2008-12-26 22:11:31 UTC (rev 1622) +++ userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/bsentity/BsGroupInfo.java 2008-12-27 22:02:56 UTC (rev 1623) @@ -44,7 +44,6 @@ * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public abstract class BsGroupInfo implements Entity, java.io.Serializable { //========================================================================== Modified: userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/bsentity/BsGroupMapping.java =================================================================== --- userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/bsentity/BsGroupMapping.java 2008-12-26 22:11:31 UTC (rev 1622) +++ userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/bsentity/BsGroupMapping.java 2008-12-27 22:02:56 UTC (rev 1623) @@ -42,7 +42,6 @@ * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public abstract class BsGroupMapping implements Entity, java.io.Serializable { //========================================================================== Modified: userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/bsentity/BsRoleInfo.java =================================================================== --- userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/bsentity/BsRoleInfo.java 2008-12-26 22:11:31 UTC (rev 1622) +++ userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/bsentity/BsRoleInfo.java 2008-12-27 22:02:56 UTC (rev 1623) @@ -44,7 +44,6 @@ * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public abstract class BsRoleInfo implements Entity, java.io.Serializable { //========================================================================== Modified: userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/bsentity/BsRoleMapping.java =================================================================== --- userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/bsentity/BsRoleMapping.java 2008-12-26 22:11:31 UTC (rev 1622) +++ userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/bsentity/BsRoleMapping.java 2008-12-27 22:02:56 UTC (rev 1623) @@ -42,7 +42,6 @@ * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public abstract class BsRoleMapping implements Entity, java.io.Serializable { //========================================================================== Modified: userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/bsentity/BsUserInfo.java =================================================================== --- userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/bsentity/BsUserInfo.java 2008-12-26 22:11:31 UTC (rev 1622) +++ userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/bsentity/BsUserInfo.java 2008-12-27 22:02:56 UTC (rev 1623) @@ -20,7 +20,7 @@ * USER_ID * * [column] - * USER_ID, GIVEN_NAME, FAMILY_NAME, MIDDLE_NAME, GIVEN_NAME_DESC, FAMILY_NAME_DESC, NICKNAME, GENDER, BIRTH_DATE, EMAIL, URL, TELEPHONE, LOCALE, ROLE_ID, GROUP_ID, CREATED_TIME, CREATED_BY, UPDATED_TIME, UPDATED_BY, DELETED_TIME, DELETED_BY, VERSIONNO + * USER_ID, GIVEN_NAME, FAMILY_NAME, MIDDLE_NAME, GIVEN_NAME_DESC, FAMILY_NAME_DESC, NICKNAME, GENDER, BIRTH_DATE, EMAIL, URL, TELEPHONE, LOCALE, ROLE_ID, GROUP_ID, STATUS, CREATED_TIME, CREATED_BY, UPDATED_TIME, UPDATED_BY, DELETED_TIME, DELETED_BY, VERSIONNO * * [sequence] * @@ -46,7 +46,6 @@ * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public abstract class BsUserInfo implements Entity, java.io.Serializable { //========================================================================== @@ -114,6 +113,9 @@ /** GROUP_ID: {VARCHAR(255) : FK to GROUP_INFO} */ protected String _groupId; + /** STATUS: {VARCHAR(1)} */ + protected String _status; + /** CREATED_TIME: {NotNull : TIMESTAMP} */ protected java.sql.Timestamp _createdTime; @@ -401,6 +403,7 @@ sb.append(delimiter).append(getLocale()); sb.append(delimiter).append(getRoleId()); sb.append(delimiter).append(getGroupId()); + sb.append(delimiter).append(getStatus()); sb.append(delimiter).append(getCreatedTime()); sb.append(delimiter).append(getCreatedBy()); sb.append(delimiter).append(getUpdatedTime()); @@ -752,6 +755,28 @@ this._groupId = groupId; } + /** The column annotation for S2Dao. {VARCHAR(1)} */ + public static final String status_COLUMN = "STATUS"; + + /** + * STATUS: {VARCHAR(1)}
+ * + * @return The value of the column 'STATUS'. (Nullable) + */ + public String getStatus() { + return _status; + } + + /** + * STATUS: {VARCHAR(1)}
+ * + * @param status The value of the column 'STATUS'. (Nullable) + */ + public void setStatus(String status) { + _modifiedProperties.addPropertyName("status"); + this._status = status; + } + /** The column annotation for S2Dao. {NotNull : TIMESTAMP} */ public static final String createdTime_COLUMN = "CREATED_TIME"; Modified: userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/bsentity/dbmeta/GroupInfoDbm.java =================================================================== --- userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/bsentity/dbmeta/GroupInfoDbm.java 2008-12-26 22:11:31 UTC (rev 1622) +++ userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/bsentity/dbmeta/GroupInfoDbm.java 2008-12-27 22:02:56 UTC (rev 1623) @@ -8,6 +8,7 @@ import jp.sf.pal.userinfo.db.allcommon.dbmeta.info.ColumnInfo; import jp.sf.pal.userinfo.db.allcommon.dbmeta.info.ReferrerInfo; import jp.sf.pal.userinfo.db.allcommon.dbmeta.info.UniqueInfo; +import jp.sf.pal.userinfo.db.allcommon.helper.StringKeyMap; import jp.sf.pal.userinfo.db.exentity.GroupInfo; /** @@ -15,7 +16,6 @@ * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public class GroupInfoDbm extends AbstractDBMeta { private static final GroupInfoDbm _instance = new GroupInfoDbm(); @@ -138,40 +138,14 @@ return _columnVersionno; } - { - initializeColumnInfoList(); - } - //========================================================================== // ========= - // Name Map - // ======== - public Map getDbNamePropertyNameKeyToLowerMap() { - return createDbNamePropertyNameKeyToLowerMap(); + // Resource Initialization + // ======================= + { + initializeInformationResource(); } - public Map getPropertyNameDbNameKeyToLowerMap() { - return createPropertyNameDbNameKeyToLowerMap(); - } - - protected static Map _dbNamePropertyNameKeyToLowerMap; - - protected Map createDbNamePropertyNameKeyToLowerMap() { - if (_dbNamePropertyNameKeyToLowerMap == null) { - _dbNamePropertyNameKeyToLowerMap = setupKeyToLowerMap(true); - } - return _dbNamePropertyNameKeyToLowerMap; - } - - protected static Map _propertyNameDbNameKeyToLowerMap; - - protected Map createPropertyNameDbNameKeyToLowerMap() { - if (_propertyNameDbNameKeyToLowerMap == null) { - _propertyNameDbNameKeyToLowerMap = setupKeyToLowerMap(false); - } - return _propertyNameDbNameKeyToLowerMap; - } - //========================================================================== // ========= // Type Name @@ -341,7 +315,8 @@ // Entity Property Setup // ===================== // It's very INTERNAL! - protected Map> _epsMap = newHashMap(); + protected Map> _epsMap = StringKeyMap + .createAsFlexibleConcurrent(); { setupEps(_epsMap, new EpsGroupId(), columnGroupId()); setupEps(_epsMap, new EpsName(), columnName()); Modified: userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/bsentity/dbmeta/GroupMappingDbm.java =================================================================== --- userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/bsentity/dbmeta/GroupMappingDbm.java 2008-12-26 22:11:31 UTC (rev 1622) +++ userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/bsentity/dbmeta/GroupMappingDbm.java 2008-12-27 22:02:56 UTC (rev 1623) @@ -8,6 +8,7 @@ import jp.sf.pal.userinfo.db.allcommon.dbmeta.info.ColumnInfo; import jp.sf.pal.userinfo.db.allcommon.dbmeta.info.ForeignInfo; import jp.sf.pal.userinfo.db.allcommon.dbmeta.info.UniqueInfo; +import jp.sf.pal.userinfo.db.allcommon.helper.StringKeyMap; import jp.sf.pal.userinfo.db.exentity.GroupMapping; /** @@ -15,7 +16,6 @@ * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public class GroupMappingDbm extends AbstractDBMeta { private static final GroupMappingDbm _instance = new GroupMappingDbm(); @@ -68,40 +68,14 @@ return _columnGroupId; } - { - initializeColumnInfoList(); - } - //========================================================================== // ========= - // Name Map - // ======== - public Map getDbNamePropertyNameKeyToLowerMap() { - return createDbNamePropertyNameKeyToLowerMap(); + // Resource Initialization + // ======================= + { + initializeInformationResource(); } - public Map getPropertyNameDbNameKeyToLowerMap() { - return createPropertyNameDbNameKeyToLowerMap(); - } - - protected static Map _dbNamePropertyNameKeyToLowerMap; - - protected Map createDbNamePropertyNameKeyToLowerMap() { - if (_dbNamePropertyNameKeyToLowerMap == null) { - _dbNamePropertyNameKeyToLowerMap = setupKeyToLowerMap(true); - } - return _dbNamePropertyNameKeyToLowerMap; - } - - protected static Map _propertyNameDbNameKeyToLowerMap; - - protected Map createPropertyNameDbNameKeyToLowerMap() { - if (_propertyNameDbNameKeyToLowerMap == null) { - _propertyNameDbNameKeyToLowerMap = setupKeyToLowerMap(false); - } - return _propertyNameDbNameKeyToLowerMap; - } - //========================================================================== // ========= // Type Name @@ -263,7 +237,8 @@ // Entity Property Setup // ===================== // It's very INTERNAL! - protected Map> _epsMap = newHashMap(); + protected Map> _epsMap = StringKeyMap + .createAsFlexibleConcurrent(); { setupEps(_epsMap, new EpsId(), columnId()); setupEps(_epsMap, new EpsUserId(), columnUserId()); Modified: userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/bsentity/dbmeta/RoleInfoDbm.java =================================================================== --- userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/bsentity/dbmeta/RoleInfoDbm.java 2008-12-26 22:11:31 UTC (rev 1622) +++ userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/bsentity/dbmeta/RoleInfoDbm.java 2008-12-27 22:02:56 UTC (rev 1623) @@ -8,6 +8,7 @@ import jp.sf.pal.userinfo.db.allcommon.dbmeta.info.ColumnInfo; import jp.sf.pal.userinfo.db.allcommon.dbmeta.info.ReferrerInfo; import jp.sf.pal.userinfo.db.allcommon.dbmeta.info.UniqueInfo; +import jp.sf.pal.userinfo.db.allcommon.helper.StringKeyMap; import jp.sf.pal.userinfo.db.exentity.RoleInfo; /** @@ -15,7 +16,6 @@ * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public class RoleInfoDbm extends AbstractDBMeta { private static final RoleInfoDbm _instance = new RoleInfoDbm(); @@ -138,40 +138,14 @@ return _columnVersionno; } - { - initializeColumnInfoList(); - } - //========================================================================== // ========= - // Name Map - // ======== - public Map getDbNamePropertyNameKeyToLowerMap() { - return createDbNamePropertyNameKeyToLowerMap(); + // Resource Initialization + // ======================= + { + initializeInformationResource(); } - public Map getPropertyNameDbNameKeyToLowerMap() { - return createPropertyNameDbNameKeyToLowerMap(); - } - - protected static Map _dbNamePropertyNameKeyToLowerMap; - - protected Map createDbNamePropertyNameKeyToLowerMap() { - if (_dbNamePropertyNameKeyToLowerMap == null) { - _dbNamePropertyNameKeyToLowerMap = setupKeyToLowerMap(true); - } - return _dbNamePropertyNameKeyToLowerMap; - } - - protected static Map _propertyNameDbNameKeyToLowerMap; - - protected Map createPropertyNameDbNameKeyToLowerMap() { - if (_propertyNameDbNameKeyToLowerMap == null) { - _propertyNameDbNameKeyToLowerMap = setupKeyToLowerMap(false); - } - return _propertyNameDbNameKeyToLowerMap; - } - //========================================================================== // ========= // Type Name @@ -341,7 +315,8 @@ // Entity Property Setup // ===================== // It's very INTERNAL! - protected Map> _epsMap = newHashMap(); + protected Map> _epsMap = StringKeyMap + .createAsFlexibleConcurrent(); { setupEps(_epsMap, new EpsRoleId(), columnRoleId()); setupEps(_epsMap, new EpsName(), columnName()); Modified: userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/bsentity/dbmeta/RoleMappingDbm.java =================================================================== --- userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/bsentity/dbmeta/RoleMappingDbm.java 2008-12-26 22:11:31 UTC (rev 1622) +++ userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/bsentity/dbmeta/RoleMappingDbm.java 2008-12-27 22:02:56 UTC (rev 1623) @@ -8,6 +8,7 @@ import jp.sf.pal.userinfo.db.allcommon.dbmeta.info.ColumnInfo; import jp.sf.pal.userinfo.db.allcommon.dbmeta.info.ForeignInfo; import jp.sf.pal.userinfo.db.allcommon.dbmeta.info.UniqueInfo; +import jp.sf.pal.userinfo.db.allcommon.helper.StringKeyMap; import jp.sf.pal.userinfo.db.exentity.RoleMapping; /** @@ -15,7 +16,6 @@ * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public class RoleMappingDbm extends AbstractDBMeta { private static final RoleMappingDbm _instance = new RoleMappingDbm(); @@ -68,40 +68,14 @@ return _columnRoleId; } - { - initializeColumnInfoList(); - } - //========================================================================== // ========= - // Name Map - // ======== - public Map getDbNamePropertyNameKeyToLowerMap() { - return createDbNamePropertyNameKeyToLowerMap(); + // Resource Initialization + // ======================= + { + initializeInformationResource(); } - public Map getPropertyNameDbNameKeyToLowerMap() { - return createPropertyNameDbNameKeyToLowerMap(); - } - - protected static Map _dbNamePropertyNameKeyToLowerMap; - - protected Map createDbNamePropertyNameKeyToLowerMap() { - if (_dbNamePropertyNameKeyToLowerMap == null) { - _dbNamePropertyNameKeyToLowerMap = setupKeyToLowerMap(true); - } - return _dbNamePropertyNameKeyToLowerMap; - } - - protected static Map _propertyNameDbNameKeyToLowerMap; - - protected Map createPropertyNameDbNameKeyToLowerMap() { - if (_propertyNameDbNameKeyToLowerMap == null) { - _propertyNameDbNameKeyToLowerMap = setupKeyToLowerMap(false); - } - return _propertyNameDbNameKeyToLowerMap; - } - //========================================================================== // ========= // Type Name @@ -263,7 +237,8 @@ // Entity Property Setup // ===================== // It's very INTERNAL! - protected Map> _epsMap = newHashMap(); + protected Map> _epsMap = StringKeyMap + .createAsFlexibleConcurrent(); { setupEps(_epsMap, new EpsId(), columnId()); setupEps(_epsMap, new EpsUserId(), columnUserId()); Modified: userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/bsentity/dbmeta/UserInfoDbm.java =================================================================== --- userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/bsentity/dbmeta/UserInfoDbm.java 2008-12-26 22:11:31 UTC (rev 1622) +++ userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/bsentity/dbmeta/UserInfoDbm.java 2008-12-27 22:02:56 UTC (rev 1623) @@ -9,6 +9,7 @@ import jp.sf.pal.userinfo.db.allcommon.dbmeta.info.ForeignInfo; import jp.sf.pal.userinfo.db.allcommon.dbmeta.info.ReferrerInfo; import jp.sf.pal.userinfo.db.allcommon.dbmeta.info.UniqueInfo; +import jp.sf.pal.userinfo.db.allcommon.helper.StringKeyMap; import jp.sf.pal.userinfo.db.exentity.UserInfo; /** @@ -16,7 +17,6 @@ * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public class UserInfoDbm extends AbstractDBMeta { private static final UserInfoDbm _instance = new UserInfoDbm(); @@ -93,6 +93,9 @@ protected ColumnInfo _columnGroupId = cci("GROUP_ID", "groupId", String.class, false, 255, 0); + protected ColumnInfo _columnStatus = cci("STATUS", "status", String.class, + false, 1, 0); + protected ColumnInfo _columnCreatedTime = cci("CREATED_TIME", "createdTime", java.sql.Timestamp.class, false, null, null); @@ -174,6 +177,10 @@ return _columnGroupId; } + public ColumnInfo columnStatus() { + return _columnStatus; + } + public ColumnInfo columnCreatedTime() { return _columnCreatedTime; } @@ -202,40 +209,14 @@ return _columnVersionno; } - { - initializeColumnInfoList(); - } - //========================================================================== // ========= - // Name Map - // ======== - public Map getDbNamePropertyNameKeyToLowerMap() { - return createDbNamePropertyNameKeyToLowerMap(); + // Resource Initialization + // ======================= + { + initializeInformationResource(); } - public Map getPropertyNameDbNameKeyToLowerMap() { - return createPropertyNameDbNameKeyToLowerMap(); - } - - protected static Map _dbNamePropertyNameKeyToLowerMap; - - protected Map createDbNamePropertyNameKeyToLowerMap() { - if (_dbNamePropertyNameKeyToLowerMap == null) { - _dbNamePropertyNameKeyToLowerMap = setupKeyToLowerMap(true); - } - return _dbNamePropertyNameKeyToLowerMap; - } - - protected static Map _propertyNameDbNameKeyToLowerMap; - - protected Map createPropertyNameDbNameKeyToLowerMap() { - if (_propertyNameDbNameKeyToLowerMap == null) { - _propertyNameDbNameKeyToLowerMap = setupKeyToLowerMap(false); - } - return _propertyNameDbNameKeyToLowerMap; - } - //========================================================================== // ========= // Type Name @@ -417,7 +398,8 @@ // Entity Property Setup // ===================== // It's very INTERNAL! - protected Map> _epsMap = newHashMap(); + protected Map> _epsMap = StringKeyMap + .createAsFlexibleConcurrent(); { setupEps(_epsMap, new EpsUserId(), columnUserId()); setupEps(_epsMap, new EpsGivenName(), columnGivenName()); @@ -434,6 +416,7 @@ setupEps(_epsMap, new EpsLocale(), columnLocale()); setupEps(_epsMap, new EpsRoleId(), columnRoleId()); setupEps(_epsMap, new EpsGroupId(), columnGroupId()); + setupEps(_epsMap, new EpsStatus(), columnStatus()); setupEps(_epsMap, new EpsCreatedTime(), columnCreatedTime()); setupEps(_epsMap, new EpsCreatedBy(), columnCreatedBy()); setupEps(_epsMap, new EpsUpdatedTime(), columnUpdatedTime()); @@ -542,6 +525,12 @@ } } + public static class EpsStatus implements Eps { + public void setup(UserInfo e, Object v) { + e.setStatus((String) v); + } + } + public static class EpsCreatedTime implements Eps { public void setup(UserInfo e, Object v) { e.setCreatedTime((java.sql.Timestamp) v); Modified: userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/cbean/bs/BsGroupInfoCB.java =================================================================== --- userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/cbean/bs/BsGroupInfoCB.java 2008-12-26 22:11:31 UTC (rev 1622) +++ userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/cbean/bs/BsGroupInfoCB.java 2008-12-27 22:02:56 UTC (rev 1623) @@ -17,7 +17,6 @@ * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public class BsGroupInfoCB extends AbstractConditionBean { //========================================================================== @@ -86,7 +85,12 @@ return _conditionQuery; } - public ConditionQuery getConditionQueryAsInterface() { + /** + * The implementation. + * + * @return The conditionQuery of the local table as interface. (NotNull) + */ + public ConditionQuery localCQ() { return getConditionQuery(); } @@ -136,23 +140,6 @@ query().xsetUnionAllQuery(cq); } - /** - * @param unionQuery The query of 'union'. (NotNull) - * @deprecated Sorry! Please use union(UnionQuery unionQuery). - */ - public void union(GroupInfoCQ unionQuery) { - query().xsetUnionQuery(unionQuery); - } - - /** - * @param unionQuery The query of 'union'. (NotNull) - * @deprecated Sorry! Please use unionAll(UnionQuery - * unionQuery). - */ - public void unionAll(GroupInfoCQ unionQuery) { - query().xsetUnionAllQuery(unionQuery); - } - public boolean hasUnionQueryOrUnionAllQuery() { return query().hasUnionQueryOrUnionAllQuery(); } @@ -180,7 +167,8 @@ public GroupInfoCQ qy() { return query(); } - }, _forDeriveReferrer); + }, _forDerivedReferrer, _forScalarSelect, + _forScalarSubQuery); } return _specification; } @@ -190,8 +178,10 @@ protected SpQyCall _myQyCall; public Specification(ConditionBean baseCB, - SpQyCall qyCall, boolean forDeriveReferrer) { - super(baseCB, qyCall, forDeriveReferrer); + SpQyCall qyCall, boolean forDeriveReferrer, + boolean forScalarSelect, boolean forScalarSubQuery) { + super(baseCB, qyCall, forDeriveReferrer, forScalarSelect, + forScalarSubQuery); _myQyCall = qyCall; } Modified: userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/cbean/bs/BsGroupMappingCB.java =================================================================== --- userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/cbean/bs/BsGroupMappingCB.java 2008-12-26 22:11:31 UTC (rev 1622) +++ userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/cbean/bs/BsGroupMappingCB.java 2008-12-27 22:02:56 UTC (rev 1623) @@ -21,7 +21,6 @@ * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public class BsGroupMappingCB extends AbstractConditionBean { //========================================================================== @@ -89,7 +88,12 @@ return _conditionQuery; } - public ConditionQuery getConditionQueryAsInterface() { + /** + * The implementation. + * + * @return The conditionQuery of the local table as interface. (NotNull) + */ + public ConditionQuery localCQ() { return getConditionQuery(); } @@ -139,24 +143,6 @@ query().xsetUnionAllQuery(cq); } - /** - * @param unionQuery The query of 'union'. (NotNull) - * @deprecated Sorry! Please use union(UnionQuery - * unionQuery). - */ - public void union(GroupMappingCQ unionQuery) { - query().xsetUnionQuery(unionQuery); - } - - /** - * @param unionQuery The query of 'union'. (NotNull) - * @deprecated Sorry! Please use unionAll(UnionQuery - * unionQuery). - */ - public void unionAll(GroupMappingCQ unionQuery) { - query().xsetUnionAllQuery(unionQuery); - } - public boolean hasUnionQueryOrUnionAllQuery() { return query().hasUnionQueryOrUnionAllQuery(); } @@ -165,7 +151,6 @@ // ========= // Setup Select // ============ - protected GroupInfoNss _nssGroupInfo; public GroupInfoNss getNssGroupInfo() { @@ -226,7 +211,8 @@ public GroupMappingCQ qy() { return query(); } - }, _forDeriveReferrer); + }, _forDerivedReferrer, _forScalarSelect, + _forScalarSubQuery); } return _specification; } @@ -240,8 +226,10 @@ protected UserInfoCB.Specification _userInfo; public Specification(ConditionBean baseCB, - SpQyCall qyCall, boolean forDeriveReferrer) { - super(baseCB, qyCall, forDeriveReferrer); + SpQyCall qyCall, boolean forDeriveReferrer, + boolean forScalarSelect, boolean forScalarSubQuery) { + super(baseCB, qyCall, forDeriveReferrer, forScalarSelect, + forScalarSubQuery); _myQyCall = qyCall; } @@ -285,7 +273,8 @@ public GroupInfoCQ qy() { return _myQyCall.qy().queryGroupInfo(); } - }, _forDeriveReferrer); + }, _forDerivedReferrer, _forScalarSelect, + _forScalarSubQuery); } return _groupInfo; } @@ -304,7 +293,8 @@ public UserInfoCQ qy() { return _myQyCall.qy().queryUserInfo(); } - }, _forDeriveReferrer); + }, _forDerivedReferrer, _forScalarSelect, + _forScalarSubQuery); } return _userInfo; } Modified: userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/cbean/bs/BsRoleInfoCB.java =================================================================== --- userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/cbean/bs/BsRoleInfoCB.java 2008-12-26 22:11:31 UTC (rev 1622) +++ userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/cbean/bs/BsRoleInfoCB.java 2008-12-27 22:02:56 UTC (rev 1623) @@ -17,7 +17,6 @@ * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public class BsRoleInfoCB extends AbstractConditionBean { //========================================================================== @@ -86,7 +85,12 @@ return _conditionQuery; } - public ConditionQuery getConditionQueryAsInterface() { + /** + * The implementation. + * + * @return The conditionQuery of the local table as interface. (NotNull) + */ + public ConditionQuery localCQ() { return getConditionQuery(); } @@ -136,23 +140,6 @@ query().xsetUnionAllQuery(cq); } - /** - * @param unionQuery The query of 'union'. (NotNull) - * @deprecated Sorry! Please use union(UnionQuery unionQuery). - */ - public void union(RoleInfoCQ unionQuery) { - query().xsetUnionQuery(unionQuery); - } - - /** - * @param unionQuery The query of 'union'. (NotNull) - * @deprecated Sorry! Please use unionAll(UnionQuery - * unionQuery). - */ - public void unionAll(RoleInfoCQ unionQuery) { - query().xsetUnionAllQuery(unionQuery); - } - public boolean hasUnionQueryOrUnionAllQuery() { return query().hasUnionQueryOrUnionAllQuery(); } @@ -180,7 +167,8 @@ public RoleInfoCQ qy() { return query(); } - }, _forDeriveReferrer); + }, _forDerivedReferrer, _forScalarSelect, + _forScalarSubQuery); } return _specification; } @@ -189,8 +177,10 @@ protected SpQyCall _myQyCall; public Specification(ConditionBean baseCB, SpQyCall qyCall, - boolean forDeriveReferrer) { - super(baseCB, qyCall, forDeriveReferrer); + boolean forDeriveReferrer, boolean forScalarSelect, + boolean forScalarSubQuery) { + super(baseCB, qyCall, forDeriveReferrer, forScalarSelect, + forScalarSubQuery); _myQyCall = qyCall; } Modified: userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/cbean/bs/BsRoleMappingCB.java =================================================================== --- userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/cbean/bs/BsRoleMappingCB.java 2008-12-26 22:11:31 UTC (rev 1622) +++ userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/cbean/bs/BsRoleMappingCB.java 2008-12-27 22:02:56 UTC (rev 1623) @@ -21,7 +21,6 @@ * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public class BsRoleMappingCB extends AbstractConditionBean { //========================================================================== @@ -89,7 +88,12 @@ return _conditionQuery; } - public ConditionQuery getConditionQueryAsInterface() { + /** + * The implementation. + * + * @return The conditionQuery of the local table as interface. (NotNull) + */ + public ConditionQuery localCQ() { return getConditionQuery(); } @@ -139,24 +143,6 @@ query().xsetUnionAllQuery(cq); } - /** - * @param unionQuery The query of 'union'. (NotNull) - * @deprecated Sorry! Please use union(UnionQuery - * unionQuery). - */ - public void union(RoleMappingCQ unionQuery) { - query().xsetUnionQuery(unionQuery); - } - - /** - * @param unionQuery The query of 'union'. (NotNull) - * @deprecated Sorry! Please use unionAll(UnionQuery - * unionQuery). - */ - public void unionAll(RoleMappingCQ unionQuery) { - query().xsetUnionAllQuery(unionQuery); - } - public boolean hasUnionQueryOrUnionAllQuery() { return query().hasUnionQueryOrUnionAllQuery(); } @@ -165,7 +151,6 @@ // ========= // Setup Select // ============ - protected RoleInfoNss _nssRoleInfo; public RoleInfoNss getNssRoleInfo() { @@ -226,7 +211,8 @@ public RoleMappingCQ qy() { return query(); } - }, _forDeriveReferrer); + }, _forDerivedReferrer, _forScalarSelect, + _forScalarSubQuery); } return _specification; } @@ -240,8 +226,10 @@ protected UserInfoCB.Specification _userInfo; public Specification(ConditionBean baseCB, - SpQyCall qyCall, boolean forDeriveReferrer) { - super(baseCB, qyCall, forDeriveReferrer); + SpQyCall qyCall, boolean forDeriveReferrer, + boolean forScalarSelect, boolean forScalarSubQuery) { + super(baseCB, qyCall, forDeriveReferrer, forScalarSelect, + forScalarSubQuery); _myQyCall = qyCall; } @@ -285,7 +273,8 @@ public RoleInfoCQ qy() { return _myQyCall.qy().queryRoleInfo(); } - }, _forDeriveReferrer); + }, _forDerivedReferrer, _forScalarSelect, + _forScalarSubQuery); } return _roleInfo; } @@ -304,7 +293,8 @@ public UserInfoCQ qy() { return _myQyCall.qy().queryUserInfo(); } - }, _forDeriveReferrer); + }, _forDerivedReferrer, _forScalarSelect, + _forScalarSubQuery); } return _userInfo; } Modified: userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/cbean/bs/BsUserInfoCB.java =================================================================== --- userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/cbean/bs/BsUserInfoCB.java 2008-12-26 22:11:31 UTC (rev 1622) +++ userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/cbean/bs/BsUserInfoCB.java 2008-12-27 22:02:56 UTC (rev 1623) @@ -23,7 +23,6 @@ * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public class BsUserInfoCB extends AbstractConditionBean { //========================================================================== @@ -92,7 +91,12 @@ return _conditionQuery; } - public ConditionQuery getConditionQueryAsInterface() { + /** + * The implementation. + * + * @return The conditionQuery of the local table as interface. (NotNull) + */ + public ConditionQuery localCQ() { return getConditionQuery(); } @@ -142,23 +146,6 @@ query().xsetUnionAllQuery(cq); } - /** - * @param unionQuery The query of 'union'. (NotNull) - * @deprecated Sorry! Please use union(UnionQuery unionQuery). - */ - public void union(UserInfoCQ unionQuery) { - query().xsetUnionQuery(unionQuery); - } - - /** - * @param unionQuery The query of 'union'. (NotNull) - * @deprecated Sorry! Please use unionAll(UnionQuery - * unionQuery). - */ - public void unionAll(UserInfoCQ unionQuery) { - query().xsetUnionAllQuery(unionQuery); - } - public boolean hasUnionQueryOrUnionAllQuery() { return query().hasUnionQueryOrUnionAllQuery(); } @@ -167,7 +154,6 @@ // ========= // Setup Select // ============ - protected GroupInfoNss _nssGroupInfo; public GroupInfoNss getNssGroupInfo() { @@ -228,7 +214,8 @@ public UserInfoCQ qy() { return query(); } - }, _forDeriveReferrer); + }, _forDerivedReferrer, _forScalarSelect, + _forScalarSubQuery); } return _specification; } @@ -241,8 +228,10 @@ protected RoleInfoCB.Specification _roleInfo; public Specification(ConditionBean baseCB, SpQyCall qyCall, - boolean forDeriveReferrer) { - super(baseCB, qyCall, forDeriveReferrer); + boolean forDeriveReferrer, boolean forScalarSelect, + boolean forScalarSubQuery) { + super(baseCB, qyCall, forDeriveReferrer, forScalarSelect, + forScalarSubQuery); _myQyCall = qyCall; } @@ -306,6 +295,10 @@ doColumn("GROUP_ID"); } + public void columnStatus() { + doColumn("STATUS"); + } + public void columnCreatedTime() { doColumn("CREATED_TIME"); } @@ -362,7 +355,8 @@ public GroupInfoCQ qy() { return _myQyCall.qy().queryGroupInfo(); } - }, _forDeriveReferrer); + }, _forDerivedReferrer, _forScalarSelect, + _forScalarSubQuery); } return _groupInfo; } @@ -381,7 +375,8 @@ public RoleInfoCQ qy() { return _myQyCall.qy().queryRoleInfo(); } - }, _forDeriveReferrer); + }, _forDerivedReferrer, _forScalarSelect, + _forScalarSubQuery); } return _roleInfo; } Modified: userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/cbean/cq/bs/AbstractBsGroupInfoCQ.java =================================================================== --- userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/cbean/cq/bs/AbstractBsGroupInfoCQ.java 2008-12-26 22:11:31 UTC (rev 1622) +++ userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/cbean/cq/bs/AbstractBsGroupInfoCQ.java 2008-12-27 22:02:56 UTC (rev 1623) @@ -20,7 +20,6 @@ * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public abstract class AbstractBsGroupInfoCQ extends AbstractConditionQuery { //========================================================================== @@ -50,7 +49,7 @@ // ===== /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {PK : NotNull : + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {PK : NotNull : * VARCHAR(255)} * * @param groupId The value of groupId as equal. @@ -60,7 +59,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param groupId The value of groupId as notEqual. */ @@ -69,7 +68,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param groupId The value of groupId as greaterThan. */ @@ -78,7 +77,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param groupId The value of groupId as lessThan. */ @@ -87,7 +86,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param groupId The value of groupId as greaterEqual. */ @@ -96,7 +95,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param groupId The value of groupId as lessEqual. */ @@ -105,7 +104,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param groupId The value of groupId as prefixSearch. */ @@ -114,20 +113,6 @@ } /** - * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, - * SeveralRegistered. - * - * @param groupId The value of groupId as likeSearch. - * @param likeSearchOption The option of like-search. (NotNull) - */ - public void setGroupId_LikeSearch( - String groupId, - jp.sf.pal.userinfo.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { - registerLikeSearchQuery(CK_LS, fRES(groupId), getCValueGroupId(), - "GROUP_ID", "GroupId", "groupId", likeSearchOption); - } - - /** * InScope(in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * @@ -138,43 +123,41 @@ } /** - * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * - * @param groupId The collection of groupId as inScope. - * @param inScopeOption The option of in-scope. (NotNull) + * @param groupIdList The collection of groupId as notInScope. */ - public void setGroupId_InScope( - String groupId, - jp.sf.pal.userinfo.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(groupId), getCValueGroupId(), - "GROUP_ID", "GroupId", "groupId", inScopeOption); + public void setGroupId_NotInScope(Collection groupIdList) { + regGroupId(CK_NINS, cTL(groupIdList)); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param groupIdList The collection of groupId as notInScope. + * @param groupId The value of groupId as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) */ - public void setGroupId_NotInScope(Collection groupIdList) { - regGroupId(CK_NINS, cTL(groupIdList)); + public void setGroupId_LikeSearch( + String groupId, + jp.sf.pal.userinfo.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(groupId), getCValueGroupId(), "GROUP_ID", "GroupId", + "groupId", likeSearchOption); } /** - * @param groupMappingCBquery Query. - * @deprecated Please use inScopeGroupMappingList(subQuery) method. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param groupId The value of groupId as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setGroupId_InScopeSubQuery_GroupMappingList( - GroupMappingCQ groupMappingCBquery) { - String subQueryPropertyName = keepGroupId_InScopeSubQuery_GroupMappingList(groupMappingCBquery);// for - // saving - // query - // - - // value - // . - registerInScopeSubQuery(groupMappingCBquery, "GROUP_ID", "GROUP_ID", - subQueryPropertyName); + public void setGroupId_NotLikeSearch( + String groupId, + jp.sf.pal.userinfo.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(groupId), getCValueGroupId(), "GROUP_ID", + "GroupId", "groupId", likeSearchOption); } public void inScopeGroupMappingList(SubQuery subQuery) { @@ -183,42 +166,26 @@ cb.xsetupForInScopeSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepGroupId_InScopeSubQuery_GroupMappingList(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerInScopeSubQuery(cb.query(), "GROUP_ID", "GROUP_ID", subQueryPropertyName); } - abstract public String keepGroupId_InScopeSubQuery_GroupMappingList( + public abstract String keepGroupId_InScopeSubQuery_GroupMappingList( GroupMappingCQ subQuery); - /** - * @param userInfoCBquery Query. - * @deprecated Please use inScopeUserInfoList(subQuery) method. - */ - public void setGroupId_InScopeSubQuery_UserInfoList( - UserInfoCQ userInfoCBquery) { - String subQueryPropertyName = keepGroupId_InScopeSubQuery_UserInfoList(userInfoCBquery);// for - // saving - // query - // - - // value - // . - registerInScopeSubQuery(userInfoCBquery, "GROUP_ID", "GROUP_ID", - subQueryPropertyName); - } - public void inScopeUserInfoList(SubQuery subQuery) { assertObjectNotNull("subQuery", subQuery); UserInfoCB cb = new UserInfoCB(); cb.xsetupForInScopeSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepGroupId_InScopeSubQuery_UserInfoList(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerInScopeSubQuery(cb.query(), "GROUP_ID", "GROUP_ID", subQueryPropertyName); } - abstract public String keepGroupId_InScopeSubQuery_UserInfoList( + public abstract String keepGroupId_InScopeSubQuery_UserInfoList( UserInfoCQ subQuery); public void notInScopeGroupMappingList(SubQuery subQuery) { @@ -227,12 +194,12 @@ cb.xsetupForInScopeSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepGroupId_NotInScopeSubQuery_GroupMappingList(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerNotInScopeSubQuery(cb.query(), "GROUP_ID", "GROUP_ID", subQueryPropertyName); } - abstract public String keepGroupId_NotInScopeSubQuery_GroupMappingList( + public abstract String keepGroupId_NotInScopeSubQuery_GroupMappingList( GroupMappingCQ subQuery); public void notInScopeUserInfoList(SubQuery subQuery) { @@ -241,31 +208,15 @@ cb.xsetupForInScopeSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepGroupId_NotInScopeSubQuery_UserInfoList(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerNotInScopeSubQuery(cb.query(), "GROUP_ID", "GROUP_ID", subQueryPropertyName); } - abstract public String keepGroupId_NotInScopeSubQuery_UserInfoList( + public abstract String keepGroupId_NotInScopeSubQuery_UserInfoList( UserInfoCQ subQuery); /** - * @param groupMappingCBquery Query. - * @deprecated Please use existsGroupMappingList(subQuery) method. - */ - public void setGroupId_ExistsSubQuery_GroupMappingList( - GroupMappingCQ groupMappingCBquery) { - String subQueryPropertyName = keepGroupId_ExistsSubQuery_GroupMappingList(groupMappingCBquery);// for - // saving - // query - // - - // value - // . - registerExistsSubQuery(groupMappingCBquery, "GROUP_ID", "GROUP_ID", - subQueryPropertyName); - } - - /** * Set up 'exists' sub-query. {exists (select GROUP_ID from GROUP_MAPPING * where ...)} * @@ -278,31 +229,15 @@ cb.xsetupForExistsSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepGroupId_ExistsSubQuery_GroupMappingList(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerExistsSubQuery(cb.query(), "GROUP_ID", "GROUP_ID", subQueryPropertyName); } - abstract public String keepGroupId_ExistsSubQuery_GroupMappingList( + public abstract String keepGroupId_ExistsSubQuery_GroupMappingList( GroupMappingCQ subQuery); /** - * @param userInfoCBquery Query. - * @deprecated Please use existsUserInfoList(subQuery) method. - */ - public void setGroupId_ExistsSubQuery_UserInfoList( - UserInfoCQ userInfoCBquery) { - String subQueryPropertyName = keepGroupId_ExistsSubQuery_UserInfoList(userInfoCBquery);// for - // saving - // query - // - - // value - // . - registerExistsSubQuery(userInfoCBquery, "GROUP_ID", "GROUP_ID", - subQueryPropertyName); - } - - /** * Set up 'exists' sub-query. {exists (select GROUP_ID from USER_INFO where * ...)} * @@ -315,12 +250,12 @@ cb.xsetupForExistsSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepGroupId_ExistsSubQuery_UserInfoList(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerExistsSubQuery(cb.query(), "GROUP_ID", "GROUP_ID", subQueryPropertyName); } - abstract public String keepGroupId_ExistsSubQuery_UserInfoList( + public abstract String keepGroupId_ExistsSubQuery_UserInfoList( UserInfoCQ subQuery); /** @@ -337,12 +272,12 @@ cb.xsetupForExistsSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepGroupId_NotExistsSubQuery_GroupMappingList(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerNotExistsSubQuery(cb.query(), "GROUP_ID", "GROUP_ID", subQueryPropertyName); } - abstract public String keepGroupId_NotExistsSubQuery_GroupMappingList( + public abstract String keepGroupId_NotExistsSubQuery_GroupMappingList( GroupMappingCQ subQuery); /** @@ -358,53 +293,53 @@ cb.xsetupForExistsSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepGroupId_NotExistsSubQuery_UserInfoList(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerNotExistsSubQuery(cb.query(), "GROUP_ID", "GROUP_ID", subQueryPropertyName); } - abstract public String keepGroupId_NotExistsSubQuery_UserInfoList( + public abstract String keepGroupId_NotExistsSubQuery_UserInfoList( UserInfoCQ subQuery); public void xderiveGroupMappingList(String function, SubQuery subQuery, String aliasName) { assertObjectNotNull("subQuery", subQuery); GroupMappingCB cb = new GroupMappingCB(); - cb.xsetupForDeriveReferrer(); + cb.xsetupForDerivedReferrer(); subQuery.query(cb); - String subQueryPropertyName = keepGroupId_DeriveSubQuery_GroupMappingList(cb - .query());// for saving query-value. - registerDeriveSubQuery(function, cb.query(), "GROUP_ID", "GROUP_ID", - subQueryPropertyName, aliasName); + String subQueryPropertyName = keepGroupId_DerivedReferrer_GroupMappingList(cb + .query()); // for saving query-value. + registerDerivedReferrerSubQuery(function, cb.query(), "GROUP_ID", + "GROUP_ID", subQueryPropertyName, aliasName); } - abstract public String keepGroupId_DeriveSubQuery_GroupMappingList( + public abstract String keepGroupId_DerivedReferrer_GroupMappingList( GroupMappingCQ subQuery); public void xderiveUserInfoList(String function, SubQuery subQuery, String aliasName) { assertObjectNotNull("subQuery", subQuery); UserInfoCB cb = new UserInfoCB(); - cb.xsetupForDeriveReferrer(); + cb.xsetupForDerivedReferrer(); subQuery.query(cb); - String subQueryPropertyName = keepGroupId_DeriveSubQuery_UserInfoList(cb - .query());// for saving query-value. - registerDeriveSubQuery(function, cb.query(), "GROUP_ID", "GROUP_ID", - subQueryPropertyName, aliasName); + String subQueryPropertyName = keepGroupId_DerivedReferrer_UserInfoList(cb + .query()); // for saving query-value. + registerDerivedReferrerSubQuery(function, cb.query(), "GROUP_ID", + "GROUP_ID", subQueryPropertyName, aliasName); } - abstract public String keepGroupId_DeriveSubQuery_UserInfoList( + public abstract String keepGroupId_DerivedReferrer_UserInfoList( UserInfoCQ subQuery); /** - * IsNull(is null). And OnceRegistered. + * IsNull(is null). And OnlyOnceRegistered. */ public void setGroupId_IsNull() { regGroupId(CK_ISN, DUMMY_OBJECT); } /** - * IsNotNull(is not null). And OnceRegistered. + * IsNotNull(is not null). And OnlyOnceRegistered. */ public void setGroupId_IsNotNull() { regGroupId(CK_ISNN, DUMMY_OBJECT); @@ -423,7 +358,7 @@ abstract protected ConditionValue getCValueGroupId(); /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {VARCHAR(100)} + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {VARCHAR(100)} * * @param name The value of name as equal. */ @@ -432,7 +367,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param name The value of name as notEqual. */ @@ -441,7 +376,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param name The value of name as greaterThan. */ @@ -450,7 +385,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param name The value of name as lessThan. */ @@ -459,7 +394,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param name The value of name as greaterEqual. */ @@ -468,7 +403,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param name The value of name as lessEqual. */ @@ -477,7 +412,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param name The value of name as prefixSearch. */ @@ -486,20 +421,6 @@ } /** - * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, - * SeveralRegistered. - * - * @param name The value of name as likeSearch. - * @param likeSearchOption The option of like-search. (NotNull) - */ - public void setName_LikeSearch( - String name, - jp.sf.pal.userinfo.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { - registerLikeSearchQuery(CK_LS, fRES(name), getCValueName(), "NAME", - "Name", "name", likeSearchOption); - } - - /** * InScope(in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * @@ -510,38 +431,52 @@ } /** - * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * - * @param name The collection of name as inScope. - * @param inScopeOption The option of in-scope. (NotNull) + * @param nameList The collection of name as notInScope. */ - public void setName_InScope( + public void setName_NotInScope(Collection nameList) { + regName(CK_NINS, cTL(nameList)); + } + + /** + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param name The value of name as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) + */ + public void setName_LikeSearch( String name, - jp.sf.pal.userinfo.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(name), getCValueName(), "NAME", - "Name", "name", inScopeOption); + jp.sf.pal.userinfo.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(name), getCValueName(), "NAME", "Name", "name", + likeSearchOption); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param nameList The collection of name as notInScope. + * @param name The value of name as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setName_NotInScope(Collection nameList) { - regName(CK_NINS, cTL(nameList)); + public void setName_NotLikeSearch( + String name, + jp.sf.pal.userinfo.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(name), getCValueName(), "NAME", "Name", "name", + likeSearchOption); } /** - * IsNull(is null). And OnceRegistered. + * IsNull(is null). And OnlyOnceRegistered. */ public void setName_IsNull() { regName(CK_ISN, DUMMY_OBJECT); } /** - * IsNotNull(is not null). And OnceRegistered. + * IsNotNull(is not null). And OnlyOnceRegistered. */ public void setName_IsNotNull() { regName(CK_ISNN, DUMMY_OBJECT); @@ -558,7 +493,7 @@ abstract protected ConditionValue getCValueName(); /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {VARCHAR(255)} + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {VARCHAR(255)} * * @param description The value of description as equal. */ @@ -567,7 +502,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param description The value of description as notEqual. */ @@ -576,7 +511,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param description The value of description as greaterThan. */ @@ -585,7 +520,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param description The value of description as lessThan. */ @@ -594,7 +529,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param description The value of description as greaterEqual. */ @@ -603,7 +538,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param description The value of description as lessEqual. */ @@ -612,7 +547,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param description The value of description as prefixSearch. */ @@ -621,21 +556,6 @@ } /** - * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, - * SeveralRegistered. - * - * @param description The value of description as likeSearch. - * @param likeSearchOption The option of like-search. (NotNull) - */ - public void setDescription_LikeSearch( - String description, - jp.sf.pal.userinfo.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { - registerLikeSearchQuery(CK_LS, fRES(description), - getCValueDescription(), "DESCRIPTION", "Description", - "description", likeSearchOption); - } - - /** * InScope(in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * @@ -646,38 +566,52 @@ } /** - * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * - * @param description The collection of description as inScope. - * @param inScopeOption The option of in-scope. (NotNull) + * @param descriptionList The collection of description as notInScope. */ - public void setDescription_InScope( + public void setDescription_NotInScope(Collection descriptionList) { + regDescription(CK_NINS, cTL(descriptionList)); + } + + /** + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param description The value of description as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) + */ + public void setDescription_LikeSearch( String description, - jp.sf.pal.userinfo.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(description), getCValueDescription(), - "DESCRIPTION", "Description", "description", inScopeOption); + jp.sf.pal.userinfo.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(description), getCValueDescription(), "DESCRIPTION", + "Description", "description", likeSearchOption); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param descriptionList The collection of description as notInScope. + * @param description The value of description as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setDescription_NotInScope(Collection descriptionList) { - regDescription(CK_NINS, cTL(descriptionList)); + public void setDescription_NotLikeSearch( + String description, + jp.sf.pal.userinfo.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(description), getCValueDescription(), + "DESCRIPTION", "Description", "description", likeSearchOption); } /** - * IsNull(is null). And OnceRegistered. + * IsNull(is null). And OnlyOnceRegistered. */ public void setDescription_IsNull() { regDescription(CK_ISN, DUMMY_OBJECT); } /** - * IsNotNull(is not null). And OnceRegistered. + * IsNotNull(is not null). And OnlyOnceRegistered. */ public void setDescription_IsNotNull() { regDescription(CK_ISNN, DUMMY_OBJECT); @@ -696,7 +630,7 @@ abstract protected ConditionValue getCValueDescription(); /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {VARCHAR(255)} + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {VARCHAR(255)} * * @param email The value of email as equal. */ @@ -705,7 +639,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param email The value of email as notEqual. */ @@ -714,7 +648,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param email The value of email as greaterThan. */ @@ -723,7 +657,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param email The value of email as lessThan. */ @@ -732,7 +666,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param email The value of email as greaterEqual. */ @@ -741,7 +675,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param email The value of email as lessEqual. */ @@ -750,7 +684,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param email The value of email as prefixSearch. */ @@ -759,20 +693,6 @@ } /** - * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, - * SeveralRegistered. - * - * @param email The value of email as likeSearch. - * @param likeSearchOption The option of like-search. (NotNull) - */ - public void setEmail_LikeSearch( - String email, - jp.sf.pal.userinfo.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { - registerLikeSearchQuery(CK_LS, fRES(email), getCValueEmail(), "EMAIL", - "Email", "email", likeSearchOption); - } - - /** * InScope(in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * @@ -783,38 +703,52 @@ } /** - * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * - * @param email The collection of email as inScope. - * @param inScopeOption The option of in-scope. (NotNull) + * @param emailList The collection of email as notInScope. */ - public void setEmail_InScope( + public void setEmail_NotInScope(Collection emailList) { + regEmail(CK_NINS, cTL(emailList)); + } + + /** + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param email The value of email as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) + */ + public void setEmail_LikeSearch( String email, - jp.sf.pal.userinfo.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(email), getCValueEmail(), "EMAIL", - "Email", "email", inScopeOption); + jp.sf.pal.userinfo.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(email), getCValueEmail(), "EMAIL", "Email", "email", + likeSearchOption); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param emailList The collection of email as notInScope. + * @param email The value of email as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setEmail_NotInScope(Collection emailList) { - regEmail(CK_NINS, cTL(emailList)); + public void setEmail_NotLikeSearch( + String email, + jp.sf.pal.userinfo.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(email), getCValueEmail(), "EMAIL", "Email", + "email", likeSearchOption); } /** - * IsNull(is null). And OnceRegistered. + * IsNull(is null). And OnlyOnceRegistered. */ public void setEmail_IsNull() { regEmail(CK_ISN, DUMMY_OBJECT); } /** - * IsNotNull(is not null). And OnceRegistered. + * IsNotNull(is not null). And OnlyOnceRegistered. */ public void setEmail_IsNotNull() { regEmail(CK_ISNN, DUMMY_OBJECT); @@ -832,7 +766,7 @@ abstract protected ConditionValue getCValueEmail(); /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {VARCHAR(255)} + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {VARCHAR(255)} * * @param url The value of url as equal. */ @@ -841,7 +775,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param url The value of url as notEqual. */ @@ -850,7 +784,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param url The value of url as greaterThan. */ @@ -859,7 +793,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param url The value of url as lessThan. */ @@ -868,7 +802,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param url The value of url as greaterEqual. */ @@ -877,7 +811,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param url The value of url as lessEqual. */ @@ -886,7 +820,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param url The value of url as prefixSearch. */ @@ -895,20 +829,6 @@ } /** - * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, - * SeveralRegistered. - * - * @param url The value of url as likeSearch. - * @param likeSearchOption The option of like-search. (NotNull) - */ - public void setUrl_LikeSearch( - String url, - jp.sf.pal.userinfo.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { - registerLikeSearchQuery(CK_LS, fRES(url), getCValueUrl(), "URL", "Url", - "url", likeSearchOption); - } - - /** * InScope(in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * @@ -919,38 +839,52 @@ } /** - * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * - * @param url The collection of url as inScope. - * @param inScopeOption The option of in-scope. (NotNull) + * @param urlList The collection of url as notInScope. */ - public void setUrl_InScope( + public void setUrl_NotInScope(Collection urlList) { + regUrl(CK_NINS, cTL(urlList)); + } + + /** + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param url The value of url as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) + */ + public void setUrl_LikeSearch( String url, - jp.sf.pal.userinfo.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(url), getCValueUrl(), "URL", "Url", - "url", inScopeOption); + jp.sf.pal.userinfo.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(url), getCValueUrl(), "URL", "Url", "url", + likeSearchOption); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param urlList The collection of url as notInScope. + * @param url The value of url as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setUrl_NotInScope(Collection urlList) { - regUrl(CK_NINS, cTL(urlList)); + public void setUrl_NotLikeSearch( + String url, + jp.sf.pal.userinfo.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(url), getCValueUrl(), "URL", "Url", "url", + likeSearchOption); } /** - * IsNull(is null). And OnceRegistered. + * IsNull(is null). And OnlyOnceRegistered. */ public void setUrl_IsNull() { regUrl(CK_ISN, DUMMY_OBJECT); } /** - * IsNotNull(is not null). And OnceRegistered. + * IsNotNull(is not null). And OnlyOnceRegistered. */ public void setUrl_IsNotNull() { regUrl(CK_ISNN, DUMMY_OBJECT); @@ -967,7 +901,7 @@ abstract protected ConditionValue getCValueUrl(); /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {VARCHAR(40)} + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {VARCHAR(40)} * * @param telephone The value of telephone as equal. */ @@ -976,7 +910,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param telephone The value of telephone as notEqual. */ @@ -985,7 +919,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param telephone The value of telephone as greaterThan. */ @@ -994,7 +928,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param telephone The value of telephone as lessThan. */ @@ -1003,7 +937,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param telephone The value of telephone as greaterEqual. */ @@ -1012,7 +946,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param telephone The value of telephone as lessEqual. */ @@ -1021,7 +955,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param telephone The value of telephone as prefixSearch. */ @@ -1030,20 +964,6 @@ } /** - * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, - * SeveralRegistered. - * - * @param telephone The value of telephone as likeSearch. - * @param likeSearchOption The option of like-search. (NotNull) - */ - public void setTelephone_LikeSearch( - String telephone, - jp.sf.pal.userinfo.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { - registerLikeSearchQuery(CK_LS, fRES(telephone), getCValueTelephone(), - "TELEPHONE", "Telephone", "telephone", likeSearchOption); - } - - /** * InScope(in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * @@ -1054,38 +974,52 @@ } /** - * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * - * @param telephone The collection of telephone as inScope. - * @param inScopeOption The option of in-scope. (NotNull) + * @param telephoneList The collection of telephone as notInScope. */ - public void setTelephone_InScope( + public void setTelephone_NotInScope(Collection telephoneList) { + regTelephone(CK_NINS, cTL(telephoneList)); + } + + /** + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param telephone The value of telephone as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) + */ + public void setTelephone_LikeSearch( String telephone, - jp.sf.pal.userinfo.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(telephone), getCValueTelephone(), - "TELEPHONE", "Telephone", "telephone", inScopeOption); + jp.sf.pal.userinfo.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(telephone), getCValueTelephone(), "TELEPHONE", + "Telephone", "telephone", likeSearchOption); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param telephoneList The collection of telephone as notInScope. + * @param telephone The value of telephone as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setTelephone_NotInScope(Collection telephoneList) { - regTelephone(CK_NINS, cTL(telephoneList)); + public void setTelephone_NotLikeSearch( + String telephone, + jp.sf.pal.userinfo.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(telephone), getCValueTelephone(), "TELEPHONE", + "Telephone", "telephone", likeSearchOption); } /** - * IsNull(is null). And OnceRegistered. + * IsNull(is null). And OnlyOnceRegistered. */ public void setTelephone_IsNull() { regTelephone(CK_ISN, DUMMY_OBJECT); } /** - * IsNotNull(is not null). And OnceRegistered. + * IsNotNull(is not null). And OnlyOnceRegistered. */ public void setTelephone_IsNotNull() { regTelephone(CK_ISNN, DUMMY_OBJECT); @@ -1104,7 +1038,7 @@ abstract protected ConditionValue getCValueTelephone(); /** - * Equal(=). And NullIgnored, OnceRegistered. {NotNull : TIMESTAMP} + * Equal(=). And NullIgnored, OnlyOnceRegistered. {NotNull : TIMESTAMP} * * @param createdTime The value of createdTime as equal. */ @@ -1113,7 +1047,7 @@ } /** - * NotEqual(!=). And NullIgnored, OnceRegistered. + * NotEqual(!=). And NullIgnored, OnlyOnceRegistered. * * @param createdTime The value of createdTime as notEqual. */ @@ -1122,7 +1056,7 @@ } /** - * GreaterThan(>). And NullIgnored, OnceRegistered. + * GreaterThan(>). And NullIgnored, OnlyOnceRegistered. * * @param createdTime The value of createdTime as greaterThan. */ @@ -1131,7 +1065,7 @@ } /** - * LessThan(>). And NullIgnored, OnceRegistered. + * LessThan(>). And NullIgnored, OnlyOnceRegistered. * * @param createdTime The value of createdTime as lessThan. */ @@ -1140,7 +1074,7 @@ } /** - * GreaterEqual(>). And NullIgnored, OnceRegistered. + * GreaterEqual(>). And NullIgnored, OnlyOnceRegistered. * * @param createdTime The value of createdTime as greaterEqual. */ @@ -1149,7 +1083,7 @@ } /** - * LessEqual(>). And NullIgnored, OnceRegistered. + * LessEqual(>). And NullIgnored, OnlyOnceRegistered. * * @param createdTime The value of createdTime as lessEqual. */ @@ -1159,7 +1093,7 @@ /** * FromTo($fromDate <= COLUMN_NAME <= $toDate). And NullIgnored, - * OnceRegistered. {NotNull : TIMESTAMP} + * OnlyOnceRegistered. {NotNull : TIMESTAMP} * * @param fromDate The from-date of createdTime. (Nullable) * @param toDate The to-date of createdTime. (Nullable) @@ -1177,7 +1111,7 @@ /** * FromTo($fromDate <= COLUMN_NAME < $toDate + 1). And NullIgnored, - * OnceRegistered. {NotNull : TIMESTAMP} + * OnlyOnceRegistered. {NotNull : TIMESTAMP} * * @param fromDate The from-date of createdTime. (Nullable) * @param toDate The to-date of createdTime. (Nullable) @@ -1203,7 +1137,7 @@ abstract protected ConditionValue getCValueCreatedTime(); /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {NotNull : + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {NotNull : * VARCHAR(255)} * * @param createdBy The value of createdBy as equal. @@ -1213,7 +1147,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param createdBy The value of createdBy as notEqual. */ @@ -1222,7 +1156,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param createdBy The value of createdBy as greaterThan. */ @@ -1231,7 +1165,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param createdBy The value of createdBy as lessThan. */ @@ -1240,7 +1174,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param createdBy The value of createdBy as greaterEqual. */ @@ -1249,7 +1183,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param createdBy The value of createdBy as lessEqual. */ @@ -1258,7 +1192,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param createdBy The value of createdBy as prefixSearch. */ @@ -1267,20 +1201,6 @@ } /** - * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, - * SeveralRegistered. - * - * @param createdBy The value of createdBy as likeSearch. - * @param likeSearchOption The option of like-search. (NotNull) - */ - public void setCreatedBy_LikeSearch( - String createdBy, - jp.sf.pal.userinfo.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { - registerLikeSearchQuery(CK_LS, fRES(createdBy), getCValueCreatedBy(), - "CREATED_BY", "CreatedBy", "createdBy", likeSearchOption); - } - - /** * InScope(in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * @@ -1291,27 +1211,41 @@ } /** - * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * - * @param createdBy The collection of createdBy as inScope. - * @param inScopeOption The option of in-scope. (NotNull) + * @param createdByList The collection of createdBy as notInScope. */ - public void setCreatedBy_InScope( + public void setCreatedBy_NotInScope(Collection createdByList) { + regCreatedBy(CK_NINS, cTL(createdByList)); + } + + /** + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param createdBy The value of createdBy as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) + */ + public void setCreatedBy_LikeSearch( String createdBy, - jp.sf.pal.userinfo.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(createdBy), getCValueCreatedBy(), - "CREATED_BY", "CreatedBy", "createdBy", inScopeOption); + jp.sf.pal.userinfo.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(createdBy), getCValueCreatedBy(), "CREATED_BY", + "CreatedBy", "createdBy", likeSearchOption); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param createdByList The collection of createdBy as notInScope. + * @param createdBy The value of createdBy as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setCreatedBy_NotInScope(Collection createdByList) { - regCreatedBy(CK_NINS, cTL(createdByList)); + public void setCreatedBy_NotLikeSearch( + String createdBy, + jp.sf.pal.userinfo.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(createdBy), getCValueCreatedBy(), "CREATED_BY", + "CreatedBy", "createdBy", likeSearchOption); } protected void regCreatedBy(ConditionKey key, Object value) { @@ -1327,7 +1261,7 @@ abstract protected ConditionValue getCValueCreatedBy(); /** - * Equal(=). And NullIgnored, OnceRegistered. {NotNull : TIMESTAMP} + * Equal(=). And NullIgnored, OnlyOnceRegistered. {NotNull : TIMESTAMP} * * @param updatedTime The value of updatedTime as equal. */ @@ -1336,7 +1270,7 @@ } /** - * NotEqual(!=). And NullIgnored, OnceRegistered. + * NotEqual(!=). And NullIgnored, OnlyOnceRegistered. * * @param updatedTime The value of updatedTime as notEqual. */ @@ -1345,7 +1279,7 @@ } /** - * GreaterThan(>). And NullIgnored, OnceRegistered. + * GreaterThan(>). And NullIgnored, OnlyOnceRegistered. * * @param updatedTime The value of updatedTime as greaterThan. */ @@ -1354,7 +1288,7 @@ } /** - * LessThan(>). And NullIgnored, OnceRegistered. + * LessThan(>). And NullIgnored, OnlyOnceRegistered. * * @param updatedTime The value of updatedTime as lessThan. */ @@ -1363,7 +1297,7 @@ } /** - * GreaterEqual(>). And NullIgnored, OnceRegistered. + * GreaterEqual(>). And NullIgnored, OnlyOnceRegistered. * * @param updatedTime The value of updatedTime as greaterEqual. */ @@ -1372,7 +1306,7 @@ } /** - * LessEqual(>). And NullIgnored, OnceRegistered. + * LessEqual(>). And NullIgnored, OnlyOnceRegistered. * * @param updatedTime The value of updatedTime as lessEqual. */ @@ -1382,7 +1316,7 @@ /** * FromTo($fromDate <= COLUMN_NAME <= $toDate). And NullIgnored, - * OnceRegistered. {NotNull : TIMESTAMP} + * OnlyOnceRegistered. {NotNull : TIMESTAMP} * * @param fromDate The from-date of updatedTime. (Nullable) * @param toDate The to-date of updatedTime. (Nullable) @@ -1400,7 +1334,7 @@ /** * FromTo($fromDate <= COLUMN_NAME < $toDate + 1). And NullIgnored, - * OnceRegistered. {NotNull : TIMESTAMP} + * OnlyOnceRegistered. {NotNull : TIMESTAMP} * * @param fromDate The from-date of updatedTime. (Nullable) * @param toDate The to-date of updatedTime. (Nullable) @@ -1426,7 +1360,7 @@ abstract protected ConditionValue getCValueUpdatedTime(); /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {NotNull : + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {NotNull : * VARCHAR(255)} * * @param updatedBy The value of updatedBy as equal. @@ -1436,7 +1370,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param updatedBy The value of updatedBy as notEqual. */ @@ -1445,7 +1379,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param updatedBy The value of updatedBy as greaterThan. */ @@ -1454,7 +1388,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param updatedBy The value of updatedBy as lessThan. */ @@ -1463,7 +1397,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param updatedBy The value of updatedBy as greaterEqual. */ @@ -1472,7 +1406,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param updatedBy The value of updatedBy as lessEqual. */ @@ -1481,7 +1415,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param updatedBy The value of updatedBy as prefixSearch. */ @@ -1490,20 +1424,6 @@ } /** - * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, - * SeveralRegistered. - * - * @param updatedBy The value of updatedBy as likeSearch. - * @param likeSearchOption The option of like-search. (NotNull) - */ - public void setUpdatedBy_LikeSearch( - String updatedBy, - jp.sf.pal.userinfo.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { - registerLikeSearchQuery(CK_LS, fRES(updatedBy), getCValueUpdatedBy(), - "UPDATED_BY", "UpdatedBy", "updatedBy", likeSearchOption); - } - - /** * InScope(in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * @@ -1514,27 +1434,41 @@ } /** - * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * - * @param updatedBy The collection of updatedBy as inScope. - * @param inScopeOption The option of in-scope. (NotNull) + * @param updatedByList The collection of updatedBy as notInScope. */ - public void setUpdatedBy_InScope( + public void setUpdatedBy_NotInScope(Collection updatedByList) { + regUpdatedBy(CK_NINS, cTL(updatedByList)); + } + + /** + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param updatedBy The value of updatedBy as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) + */ + public void setUpdatedBy_LikeSearch( String updatedBy, - jp.sf.pal.userinfo.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(updatedBy), getCValueUpdatedBy(), - "UPDATED_BY", "UpdatedBy", "updatedBy", inScopeOption); + jp.sf.pal.userinfo.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(updatedBy), getCValueUpdatedBy(), "UPDATED_BY", + "UpdatedBy", "updatedBy", likeSearchOption); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param updatedByList The collection of updatedBy as notInScope. + * @param updatedBy The value of updatedBy as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setUpdatedBy_NotInScope(Collection updatedByList) { - regUpdatedBy(CK_NINS, cTL(updatedByList)); + public void setUpdatedBy_NotLikeSearch( + String updatedBy, + jp.sf.pal.userinfo.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(updatedBy), getCValueUpdatedBy(), "UPDATED_BY", + "UpdatedBy", "updatedBy", likeSearchOption); } protected void regUpdatedBy(ConditionKey key, Object value) { @@ -1550,7 +1484,7 @@ abstract protected ConditionValue getCValueUpdatedBy(); /** - * Equal(=). And NullIgnored, OnceRegistered. {TIMESTAMP} + * Equal(=). And NullIgnored, OnlyOnceRegistered. {TIMESTAMP} * * @param deletedTime The value of deletedTime as equal. */ @@ -1559,7 +1493,7 @@ } /** - * NotEqual(!=). And NullIgnored, OnceRegistered. + * NotEqual(!=). And NullIgnored, OnlyOnceRegistered. * * @param deletedTime The value of deletedTime as notEqual. */ @@ -1568,7 +1502,7 @@ } /** - * GreaterThan(>). And NullIgnored, OnceRegistered. + * GreaterThan(>). And NullIgnored, OnlyOnceRegistered. * * @param deletedTime The value of deletedTime as greaterThan. */ @@ -1577,7 +1511,7 @@ } /** - * LessThan(>). And NullIgnored, OnceRegistered. + * LessThan(>). And NullIgnored, OnlyOnceRegistered. * * @param deletedTime The value of deletedTime as lessThan. */ @@ -1586,7 +1520,7 @@ } /** - * GreaterEqual(>). And NullIgnored, OnceRegistered. + * GreaterEqual(>). And NullIgnored, OnlyOnceRegistered. * * @param deletedTime The value of deletedTime as greaterEqual. */ @@ -1595,7 +1529,7 @@ } /** - * LessEqual(>). And NullIgnored, OnceRegistered. + * LessEqual(>). And NullIgnored, OnlyOnceRegistered. * * @param deletedTime The value of deletedTime as lessEqual. */ @@ -1605,7 +1539,7 @@ /** * FromTo($fromDate <= COLUMN_NAME <= $toDate). And NullIgnored, - * OnceRegistered. {TIMESTAMP} + * OnlyOnceRegistered. {TIMESTAMP} * * @param fromDate The from-date of deletedTime. (Nullable) * @param toDate The to-date of deletedTime. (Nullable) @@ -1623,7 +1557,7 @@ /** * FromTo($fromDate <= COLUMN_NAME < $toDate + 1). And NullIgnored, - * OnceRegistered. {TIMESTAMP} + * OnlyOnceRegistered. {TIMESTAMP} * * @param fromDate The from-date of deletedTime. (Nullable) * @param toDate The to-date of deletedTime. (Nullable) @@ -1637,14 +1571,14 @@ } /** - * IsNull(is null). And OnceRegistered. + * IsNull(is null). And OnlyOnceRegistered. */ public void setDeletedTime_IsNull() { regDeletedTime(CK_ISN, DUMMY_OBJECT); } /** - * IsNotNull(is not null). And OnceRegistered. + * IsNotNull(is not null). And OnlyOnceRegistered. */ public void setDeletedTime_IsNotNull() { regDeletedTime(CK_ISNN, DUMMY_OBJECT); @@ -1663,7 +1597,7 @@ abstract protected ConditionValue getCValueDeletedTime(); /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {VARCHAR(255)} + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {VARCHAR(255)} * * @param deletedBy The value of deletedBy as equal. */ @@ -1672,7 +1606,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param deletedBy The value of deletedBy as notEqual. */ @@ -1681,7 +1615,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param deletedBy The value of deletedBy as greaterThan. */ @@ -1690,7 +1624,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param deletedBy The value of deletedBy as lessThan. */ @@ -1699,7 +1633,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param deletedBy The value of deletedBy as greaterEqual. */ @@ -1708,7 +1642,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param deletedBy The value of deletedBy as lessEqual. */ @@ -1717,7 +1651,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param deletedBy The value of deletedBy as prefixSearch. */ @@ -1726,20 +1660,6 @@ } /** - * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, - * SeveralRegistered. - * - * @param deletedBy The value of deletedBy as likeSearch. - * @param likeSearchOption The option of like-search. (NotNull) - */ - public void setDeletedBy_LikeSearch( - String deletedBy, - jp.sf.pal.userinfo.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { - registerLikeSearchQuery(CK_LS, fRES(deletedBy), getCValueDeletedBy(), - "DELETED_BY", "DeletedBy", "deletedBy", likeSearchOption); - } - - /** * InScope(in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * @@ -1750,38 +1670,52 @@ } /** - * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * - * @param deletedBy The collection of deletedBy as inScope. - * @param inScopeOption The option of in-scope. (NotNull) + * @param deletedByList The collection of deletedBy as notInScope. */ - public void setDeletedBy_InScope( + public void setDeletedBy_NotInScope(Collection deletedByList) { + regDeletedBy(CK_NINS, cTL(deletedByList)); + } + + /** + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param deletedBy The value of deletedBy as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) + */ + public void setDeletedBy_LikeSearch( String deletedBy, - jp.sf.pal.userinfo.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(deletedBy), getCValueDeletedBy(), - "DELETED_BY", "DeletedBy", "deletedBy", inScopeOption); + jp.sf.pal.userinfo.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(deletedBy), getCValueDeletedBy(), "DELETED_BY", + "DeletedBy", "deletedBy", likeSearchOption); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param deletedByList The collection of deletedBy as notInScope. + * @param deletedBy The value of deletedBy as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setDeletedBy_NotInScope(Collection deletedByList) { - regDeletedBy(CK_NINS, cTL(deletedByList)); + public void setDeletedBy_NotLikeSearch( + String deletedBy, + jp.sf.pal.userinfo.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(deletedBy), getCValueDeletedBy(), "DELETED_BY", + "DeletedBy", "deletedBy", likeSearchOption); } /** - * IsNull(is null). And OnceRegistered. + * IsNull(is null). And OnlyOnceRegistered. */ public void setDeletedBy_IsNull() { regDeletedBy(CK_ISN, DUMMY_OBJECT); } /** - * IsNotNull(is not null). And OnceRegistered. + * IsNotNull(is not null). And OnlyOnceRegistered. */ public void setDeletedBy_IsNotNull() { regDeletedBy(CK_ISNN, DUMMY_OBJECT); @@ -1800,7 +1734,7 @@ abstract protected ConditionValue getCValueDeletedBy(); /** - * Equal(=). And NullIgnored, OnceRegistered. {NotNull : INTEGER} + * Equal(=). And NullIgnored, OnlyOnceRegistered. {NotNull : INTEGER} * * @param versionno The value of versionno as equal. */ @@ -1809,7 +1743,7 @@ } /** - * NotEqual(!=). And NullIgnored, OnceRegistered. + * NotEqual(!=). And NullIgnored, OnlyOnceRegistered. * * @param versionno The value of versionno as notEqual. */ @@ -1818,7 +1752,7 @@ } /** - * GreaterThan(>). And NullIgnored, OnceRegistered. + * GreaterThan(>). And NullIgnored, OnlyOnceRegistered. * * @param versionno The value of versionno as greaterThan. */ @@ -1827,7 +1761,7 @@ } /** - * LessThan(<). And NullIgnored, OnceRegistered. + * LessThan(<). And NullIgnored, OnlyOnceRegistered. * * @param versionno The value of versionno as lessThan. */ @@ -1836,7 +1770,7 @@ } /** - * GreaterEqual(>=). And NullIgnored, OnceRegistered. + * GreaterEqual(>=). And NullIgnored, OnlyOnceRegistered. * * @param versionno The value of versionno as greaterEqual. */ @@ -1845,7 +1779,7 @@ } /** - * LessEqual(<=). And NullIgnored, OnceRegistered. + * LessEqual(<=). And NullIgnored, OnlyOnceRegistered. * * @param versionno The value of versionno as lessEqual. */ @@ -1885,6 +1819,50 @@ abstract protected ConditionValue getCValueVersionno(); + public SSQFunction scalar_Equal() { + return xcreateSSQFunction("="); + } + + public SSQFunction scalar_GreaterEqual() { + return xcreateSSQFunction(">="); + } + + public SSQFunction scalar_GreaterThan() { + return xcreateSSQFunction(">"); + } + + public SSQFunction scalar_LessEqual() { + return xcreateSSQFunction("<="); + } + + public SSQFunction scalar_LessThan() { + return xcreateSSQFunction("<"); + } + + protected SSQFunction xcreateSSQFunction(final String operand) { + return new SSQFunction(new SSQSetupper() { + public void setup(String function, SubQuery subQuery) { + xscalarSubQuery(function, subQuery, operand); + } + }); + } + + protected void xscalarSubQuery(String function, + SubQuery subQuery, String operand) { + assertObjectNotNull("subQuery", subQuery); + GroupInfoCB cb = new GroupInfoCB(); + cb.xsetupForScalarSubQuery(); + subQuery.query(cb); + String subQueryPropertyName = keepScalarSubQuery(cb.query()); // for + // saving + // query + // -value. + registerScalarSubQuery(function, cb.query(), subQueryPropertyName, + operand); + } + + public abstract String keepScalarSubQuery(GroupInfoCQ subQuery); + // Very Internal (for Suppressing Warn about 'Not Use Import') protected String getConditionBeanClassNameInternally() { return GroupInfoCB.class.getName(); Modified: userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/cbean/cq/bs/AbstractBsGroupMappingCQ.java =================================================================== --- userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/cbean/cq/bs/AbstractBsGroupMappingCQ.java 2008-12-26 22:11:31 UTC (rev 1622) +++ userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/cbean/cq/bs/AbstractBsGroupMappingCQ.java 2008-12-27 22:02:56 UTC (rev 1623) @@ -11,16 +11,13 @@ import jp.sf.pal.userinfo.db.cbean.GroupInfoCB; import jp.sf.pal.userinfo.db.cbean.GroupMappingCB; import jp.sf.pal.userinfo.db.cbean.UserInfoCB; -import jp.sf.pal.userinfo.db.cbean.cq.GroupInfoCQ; import jp.sf.pal.userinfo.db.cbean.cq.GroupMappingCQ; -import jp.sf.pal.userinfo.db.cbean.cq.UserInfoCQ; /** * The abstract condition-query of GROUP_MAPPING. * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public abstract class AbstractBsGroupMappingCQ extends AbstractConditionQuery { //========================================================================== @@ -50,7 +47,8 @@ // ===== /** - * Equal(=). And NullIgnored, OnceRegistered. {PK : ID : NotNull : INTEGER} + * Equal(=). And NullIgnored, OnlyOnceRegistered. {PK : ID : NotNull : + * INTEGER} * * @param id The value of id as equal. */ @@ -59,7 +57,7 @@ } /** - * NotEqual(!=). And NullIgnored, OnceRegistered. + * NotEqual(!=). And NullIgnored, OnlyOnceRegistered. * * @param id The value of id as notEqual. */ @@ -68,7 +66,7 @@ } /** - * GreaterThan(>). And NullIgnored, OnceRegistered. + * GreaterThan(>). And NullIgnored, OnlyOnceRegistered. * * @param id The value of id as greaterThan. */ @@ -77,7 +75,7 @@ } /** - * LessThan(<). And NullIgnored, OnceRegistered. + * LessThan(<). And NullIgnored, OnlyOnceRegistered. * * @param id The value of id as lessThan. */ @@ -86,7 +84,7 @@ } /** - * GreaterEqual(>=). And NullIgnored, OnceRegistered. + * GreaterEqual(>=). And NullIgnored, OnlyOnceRegistered. * * @param id The value of id as greaterEqual. */ @@ -95,7 +93,7 @@ } /** - * LessEqual(<=). And NullIgnored, OnceRegistered. + * LessEqual(<=). And NullIgnored, OnlyOnceRegistered. * * @param id The value of id as lessEqual. */ @@ -124,14 +122,14 @@ } /** - * IsNull(is null). And OnceRegistered. + * IsNull(is null). And OnlyOnceRegistered. */ public void setId_IsNull() { regId(CK_ISN, DUMMY_OBJECT); } /** - * IsNotNull(is not null). And OnceRegistered. + * IsNotNull(is not null). And OnlyOnceRegistered. */ public void setId_IsNotNull() { regId(CK_ISNN, DUMMY_OBJECT); @@ -148,8 +146,8 @@ abstract protected ConditionValue getCValueId(); /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {NotNull : VARCHAR(255) - * : FK to USER_INFO} + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {NotNull : + * VARCHAR(255) : FK to USER_INFO} * * @param userId The value of userId as equal. */ @@ -158,7 +156,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param userId The value of userId as notEqual. */ @@ -167,7 +165,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param userId The value of userId as greaterThan. */ @@ -176,7 +174,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param userId The value of userId as lessThan. */ @@ -185,7 +183,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param userId The value of userId as greaterEqual. */ @@ -194,7 +192,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param userId The value of userId as lessEqual. */ @@ -203,7 +201,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param userId The value of userId as prefixSearch. */ @@ -212,20 +210,6 @@ } /** - * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, - * SeveralRegistered. - * - * @param userId The value of userId as likeSearch. - * @param likeSearchOption The option of like-search. (NotNull) - */ - public void setUserId_LikeSearch( - String userId, - jp.sf.pal.userinfo.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { - registerLikeSearchQuery(CK_LS, fRES(userId), getCValueUserId(), - "USER_ID", "UserId", "userId", likeSearchOption); - } - - /** * InScope(in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * @@ -236,42 +220,41 @@ } /** - * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * - * @param userId The collection of userId as inScope. - * @param inScopeOption The option of in-scope. (NotNull) + * @param userIdList The collection of userId as notInScope. */ - public void setUserId_InScope( - String userId, - jp.sf.pal.userinfo.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(userId), getCValueUserId(), - "USER_ID", "UserId", "userId", inScopeOption); + public void setUserId_NotInScope(Collection userIdList) { + regUserId(CK_NINS, cTL(userIdList)); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param userIdList The collection of userId as notInScope. + * @param userId The value of userId as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) */ - public void setUserId_NotInScope(Collection userIdList) { - regUserId(CK_NINS, cTL(userIdList)); + public void setUserId_LikeSearch( + String userId, + jp.sf.pal.userinfo.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(userId), getCValueUserId(), "USER_ID", "UserId", + "userId", likeSearchOption); } /** - * @param userInfoCBquery Query. - * @deprecated Please use inScopeUserInfo(subQuery) method. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param userId The value of userId as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setUserId_InScopeSubQuery_UserInfo(UserInfoCQ userInfoCBquery) { - String subQueryPropertyName = keepUserId_InScopeSubQuery_UserInfo(userInfoCBquery);// for - // saving - // query - // - - // value - // . - registerInScopeSubQuery(userInfoCBquery, "USER_ID", "USER_ID", - subQueryPropertyName); + public void setUserId_NotLikeSearch( + String userId, + jp.sf.pal.userinfo.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(userId), getCValueUserId(), "USER_ID", "UserId", + "userId", likeSearchOption); } public void inScopeUserInfo(SubQuery subQuery) { @@ -280,12 +263,12 @@ cb.xsetupForInScopeSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepUserId_InScopeSubQuery_UserInfo(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerInScopeSubQuery(cb.query(), "USER_ID", "USER_ID", subQueryPropertyName); } - abstract public String keepUserId_InScopeSubQuery_UserInfo( + public abstract String keepUserId_InScopeSubQuery_UserInfo( jp.sf.pal.userinfo.db.cbean.cq.UserInfoCQ subQuery); protected void regUserId(ConditionKey key, Object value) { @@ -301,8 +284,8 @@ abstract protected ConditionValue getCValueUserId(); /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {NotNull : VARCHAR(255) - * : FK to GROUP_INFO} + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {NotNull : + * VARCHAR(255) : FK to GROUP_INFO} * * @param groupId The value of groupId as equal. */ @@ -311,7 +294,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param groupId The value of groupId as notEqual. */ @@ -320,7 +303,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param groupId The value of groupId as greaterThan. */ @@ -329,7 +312,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param groupId The value of groupId as lessThan. */ @@ -338,7 +321,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param groupId The value of groupId as greaterEqual. */ @@ -347,7 +330,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param groupId The value of groupId as lessEqual. */ @@ -356,7 +339,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param groupId The value of groupId as prefixSearch. */ @@ -365,20 +348,6 @@ } /** - * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, - * SeveralRegistered. - * - * @param groupId The value of groupId as likeSearch. - * @param likeSearchOption The option of like-search. (NotNull) - */ - public void setGroupId_LikeSearch( - String groupId, - jp.sf.pal.userinfo.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { - registerLikeSearchQuery(CK_LS, fRES(groupId), getCValueGroupId(), - "GROUP_ID", "GroupId", "groupId", likeSearchOption); - } - - /** * InScope(in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * @@ -389,43 +358,41 @@ } /** - * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * - * @param groupId The collection of groupId as inScope. - * @param inScopeOption The option of in-scope. (NotNull) + * @param groupIdList The collection of groupId as notInScope. */ - public void setGroupId_InScope( - String groupId, - jp.sf.pal.userinfo.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(groupId), getCValueGroupId(), - "GROUP_ID", "GroupId", "groupId", inScopeOption); + public void setGroupId_NotInScope(Collection groupIdList) { + regGroupId(CK_NINS, cTL(groupIdList)); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param groupIdList The collection of groupId as notInScope. + * @param groupId The value of groupId as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) */ - public void setGroupId_NotInScope(Collection groupIdList) { - regGroupId(CK_NINS, cTL(groupIdList)); + public void setGroupId_LikeSearch( + String groupId, + jp.sf.pal.userinfo.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(groupId), getCValueGroupId(), "GROUP_ID", "GroupId", + "groupId", likeSearchOption); } /** - * @param groupInfoCBquery Query. - * @deprecated Please use inScopeGroupInfo(subQuery) method. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param groupId The value of groupId as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setGroupId_InScopeSubQuery_GroupInfo( - GroupInfoCQ groupInfoCBquery) { - String subQueryPropertyName = keepGroupId_InScopeSubQuery_GroupInfo(groupInfoCBquery);// for - // saving - // query - // - - // value - // . - registerInScopeSubQuery(groupInfoCBquery, "GROUP_ID", "GROUP_ID", - subQueryPropertyName); + public void setGroupId_NotLikeSearch( + String groupId, + jp.sf.pal.userinfo.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(groupId), getCValueGroupId(), "GROUP_ID", + "GroupId", "groupId", likeSearchOption); } public void inScopeGroupInfo(SubQuery subQuery) { @@ -434,12 +401,12 @@ cb.xsetupForInScopeSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepGroupId_InScopeSubQuery_GroupInfo(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerInScopeSubQuery(cb.query(), "GROUP_ID", "GROUP_ID", subQueryPropertyName); } - abstract public String keepGroupId_InScopeSubQuery_GroupInfo( + public abstract String keepGroupId_InScopeSubQuery_GroupInfo( jp.sf.pal.userinfo.db.cbean.cq.GroupInfoCQ subQuery); protected void regGroupId(ConditionKey key, Object value) { @@ -454,6 +421,53 @@ abstract protected ConditionValue getCValueGroupId(); + public SSQFunction scalar_Equal() { + return xcreateSSQFunction("="); + } + + public SSQFunction scalar_GreaterEqual() { + return xcreateSSQFunction(">="); + } + + public SSQFunction scalar_GreaterThan() { + return xcreateSSQFunction(">"); + } + + public SSQFunction scalar_LessEqual() { + return xcreateSSQFunction("<="); + } + + public SSQFunction scalar_LessThan() { + return xcreateSSQFunction("<"); + } + + protected SSQFunction xcreateSSQFunction( + final String operand) { + return new SSQFunction( + new SSQSetupper() { + public void setup(String function, + SubQuery subQuery) { + xscalarSubQuery(function, subQuery, operand); + } + }); + } + + protected void xscalarSubQuery(String function, + SubQuery subQuery, String operand) { + assertObjectNotNull("subQuery", subQuery); + GroupMappingCB cb = new GroupMappingCB(); + cb.xsetupForScalarSubQuery(); + subQuery.query(cb); + String subQueryPropertyName = keepScalarSubQuery(cb.query()); // for + // saving + // query + // -value. + registerScalarSubQuery(function, cb.query(), subQueryPropertyName, + operand); + } + + public abstract String keepScalarSubQuery(GroupMappingCQ subQuery); + // Very Internal (for Suppressing Warn about 'Not Use Import') protected String getConditionBeanClassNameInternally() { return GroupMappingCB.class.getName(); Modified: userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/cbean/cq/bs/AbstractBsRoleInfoCQ.java =================================================================== --- userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/cbean/cq/bs/AbstractBsRoleInfoCQ.java 2008-12-26 22:11:31 UTC (rev 1622) +++ userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/cbean/cq/bs/AbstractBsRoleInfoCQ.java 2008-12-27 22:02:56 UTC (rev 1623) @@ -20,7 +20,6 @@ * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public abstract class AbstractBsRoleInfoCQ extends AbstractConditionQuery { //========================================================================== @@ -50,7 +49,7 @@ // ===== /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {PK : NotNull : + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {PK : NotNull : * VARCHAR(255)} * * @param roleId The value of roleId as equal. @@ -60,7 +59,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param roleId The value of roleId as notEqual. */ @@ -69,7 +68,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param roleId The value of roleId as greaterThan. */ @@ -78,7 +77,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param roleId The value of roleId as lessThan. */ @@ -87,7 +86,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param roleId The value of roleId as greaterEqual. */ @@ -96,7 +95,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param roleId The value of roleId as lessEqual. */ @@ -105,7 +104,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param roleId The value of roleId as prefixSearch. */ @@ -114,20 +113,6 @@ } /** - * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, - * SeveralRegistered. - * - * @param roleId The value of roleId as likeSearch. - * @param likeSearchOption The option of like-search. (NotNull) - */ - public void setRoleId_LikeSearch( - String roleId, - jp.sf.pal.userinfo.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { - registerLikeSearchQuery(CK_LS, fRES(roleId), getCValueRoleId(), - "ROLE_ID", "RoleId", "roleId", likeSearchOption); - } - - /** * InScope(in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * @@ -138,43 +123,41 @@ } /** - * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * - * @param roleId The collection of roleId as inScope. - * @param inScopeOption The option of in-scope. (NotNull) + * @param roleIdList The collection of roleId as notInScope. */ - public void setRoleId_InScope( - String roleId, - jp.sf.pal.userinfo.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(roleId), getCValueRoleId(), - "ROLE_ID", "RoleId", "roleId", inScopeOption); + public void setRoleId_NotInScope(Collection roleIdList) { + regRoleId(CK_NINS, cTL(roleIdList)); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param roleIdList The collection of roleId as notInScope. + * @param roleId The value of roleId as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) */ - public void setRoleId_NotInScope(Collection roleIdList) { - regRoleId(CK_NINS, cTL(roleIdList)); + public void setRoleId_LikeSearch( + String roleId, + jp.sf.pal.userinfo.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(roleId), getCValueRoleId(), "ROLE_ID", "RoleId", + "roleId", likeSearchOption); } /** - * @param roleMappingCBquery Query. - * @deprecated Please use inScopeRoleMappingList(subQuery) method. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param roleId The value of roleId as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setRoleId_InScopeSubQuery_RoleMappingList( - RoleMappingCQ roleMappingCBquery) { - String subQueryPropertyName = keepRoleId_InScopeSubQuery_RoleMappingList(roleMappingCBquery);// for - // saving - // query - // - - // value - // . - registerInScopeSubQuery(roleMappingCBquery, "ROLE_ID", "ROLE_ID", - subQueryPropertyName); + public void setRoleId_NotLikeSearch( + String roleId, + jp.sf.pal.userinfo.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(roleId), getCValueRoleId(), "ROLE_ID", "RoleId", + "roleId", likeSearchOption); } public void inScopeRoleMappingList(SubQuery subQuery) { @@ -183,42 +166,26 @@ cb.xsetupForInScopeSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepRoleId_InScopeSubQuery_RoleMappingList(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerInScopeSubQuery(cb.query(), "ROLE_ID", "ROLE_ID", subQueryPropertyName); } - abstract public String keepRoleId_InScopeSubQuery_RoleMappingList( + public abstract String keepRoleId_InScopeSubQuery_RoleMappingList( RoleMappingCQ subQuery); - /** - * @param userInfoCBquery Query. - * @deprecated Please use inScopeUserInfoList(subQuery) method. - */ - public void setRoleId_InScopeSubQuery_UserInfoList( - UserInfoCQ userInfoCBquery) { - String subQueryPropertyName = keepRoleId_InScopeSubQuery_UserInfoList(userInfoCBquery);// for - // saving - // query - // - - // value - // . - registerInScopeSubQuery(userInfoCBquery, "ROLE_ID", "ROLE_ID", - subQueryPropertyName); - } - public void inScopeUserInfoList(SubQuery subQuery) { assertObjectNotNull("subQuery", subQuery); UserInfoCB cb = new UserInfoCB(); cb.xsetupForInScopeSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepRoleId_InScopeSubQuery_UserInfoList(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerInScopeSubQuery(cb.query(), "ROLE_ID", "ROLE_ID", subQueryPropertyName); } - abstract public String keepRoleId_InScopeSubQuery_UserInfoList( + public abstract String keepRoleId_InScopeSubQuery_UserInfoList( UserInfoCQ subQuery); public void notInScopeRoleMappingList(SubQuery subQuery) { @@ -227,12 +194,12 @@ cb.xsetupForInScopeSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepRoleId_NotInScopeSubQuery_RoleMappingList(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerNotInScopeSubQuery(cb.query(), "ROLE_ID", "ROLE_ID", subQueryPropertyName); } - abstract public String keepRoleId_NotInScopeSubQuery_RoleMappingList( + public abstract String keepRoleId_NotInScopeSubQuery_RoleMappingList( RoleMappingCQ subQuery); public void notInScopeUserInfoList(SubQuery subQuery) { @@ -241,31 +208,15 @@ cb.xsetupForInScopeSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepRoleId_NotInScopeSubQuery_UserInfoList(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerNotInScopeSubQuery(cb.query(), "ROLE_ID", "ROLE_ID", subQueryPropertyName); } - abstract public String keepRoleId_NotInScopeSubQuery_UserInfoList( + public abstract String keepRoleId_NotInScopeSubQuery_UserInfoList( UserInfoCQ subQuery); /** - * @param roleMappingCBquery Query. - * @deprecated Please use existsRoleMappingList(subQuery) method. - */ - public void setRoleId_ExistsSubQuery_RoleMappingList( - RoleMappingCQ roleMappingCBquery) { - String subQueryPropertyName = keepRoleId_ExistsSubQuery_RoleMappingList(roleMappingCBquery);// for - // saving - // query - // - - // value - // . - registerExistsSubQuery(roleMappingCBquery, "ROLE_ID", "ROLE_ID", - subQueryPropertyName); - } - - /** * Set up 'exists' sub-query. {exists (select ROLE_ID from ROLE_MAPPING * where ...)} * @@ -278,30 +229,15 @@ cb.xsetupForExistsSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepRoleId_ExistsSubQuery_RoleMappingList(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerExistsSubQuery(cb.query(), "ROLE_ID", "ROLE_ID", subQueryPropertyName); } - abstract public String keepRoleId_ExistsSubQuery_RoleMappingList( + public abstract String keepRoleId_ExistsSubQuery_RoleMappingList( RoleMappingCQ subQuery); /** - * @param userInfoCBquery Query. - * @deprecated Please use existsUserInfoList(subQuery) method. - */ - public void setRoleId_ExistsSubQuery_UserInfoList(UserInfoCQ userInfoCBquery) { - String subQueryPropertyName = keepRoleId_ExistsSubQuery_UserInfoList(userInfoCBquery);// for - // saving - // query - // - - // value - // . - registerExistsSubQuery(userInfoCBquery, "ROLE_ID", "ROLE_ID", - subQueryPropertyName); - } - - /** * Set up 'exists' sub-query. {exists (select ROLE_ID from USER_INFO where * ...)} * @@ -314,12 +250,12 @@ cb.xsetupForExistsSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepRoleId_ExistsSubQuery_UserInfoList(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerExistsSubQuery(cb.query(), "ROLE_ID", "ROLE_ID", subQueryPropertyName); } - abstract public String keepRoleId_ExistsSubQuery_UserInfoList( + public abstract String keepRoleId_ExistsSubQuery_UserInfoList( UserInfoCQ subQuery); /** @@ -335,12 +271,12 @@ cb.xsetupForExistsSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepRoleId_NotExistsSubQuery_RoleMappingList(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerNotExistsSubQuery(cb.query(), "ROLE_ID", "ROLE_ID", subQueryPropertyName); } - abstract public String keepRoleId_NotExistsSubQuery_RoleMappingList( + public abstract String keepRoleId_NotExistsSubQuery_RoleMappingList( RoleMappingCQ subQuery); /** @@ -356,53 +292,53 @@ cb.xsetupForExistsSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepRoleId_NotExistsSubQuery_UserInfoList(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerNotExistsSubQuery(cb.query(), "ROLE_ID", "ROLE_ID", subQueryPropertyName); } - abstract public String keepRoleId_NotExistsSubQuery_UserInfoList( + public abstract String keepRoleId_NotExistsSubQuery_UserInfoList( UserInfoCQ subQuery); public void xderiveRoleMappingList(String function, SubQuery subQuery, String aliasName) { assertObjectNotNull("subQuery", subQuery); RoleMappingCB cb = new RoleMappingCB(); - cb.xsetupForDeriveReferrer(); + cb.xsetupForDerivedReferrer(); subQuery.query(cb); - String subQueryPropertyName = keepRoleId_DeriveSubQuery_RoleMappingList(cb - .query());// for saving query-value. - registerDeriveSubQuery(function, cb.query(), "ROLE_ID", "ROLE_ID", - subQueryPropertyName, aliasName); + String subQueryPropertyName = keepRoleId_DerivedReferrer_RoleMappingList(cb + .query()); // for saving query-value. + registerDerivedReferrerSubQuery(function, cb.query(), "ROLE_ID", + "ROLE_ID", subQueryPropertyName, aliasName); } - abstract public String keepRoleId_DeriveSubQuery_RoleMappingList( + public abstract String keepRoleId_DerivedReferrer_RoleMappingList( RoleMappingCQ subQuery); public void xderiveUserInfoList(String function, SubQuery subQuery, String aliasName) { assertObjectNotNull("subQuery", subQuery); UserInfoCB cb = new UserInfoCB(); - cb.xsetupForDeriveReferrer(); + cb.xsetupForDerivedReferrer(); subQuery.query(cb); - String subQueryPropertyName = keepRoleId_DeriveSubQuery_UserInfoList(cb - .query());// for saving query-value. - registerDeriveSubQuery(function, cb.query(), "ROLE_ID", "ROLE_ID", - subQueryPropertyName, aliasName); + String subQueryPropertyName = keepRoleId_DerivedReferrer_UserInfoList(cb + .query()); // for saving query-value. + registerDerivedReferrerSubQuery(function, cb.query(), "ROLE_ID", + "ROLE_ID", subQueryPropertyName, aliasName); } - abstract public String keepRoleId_DeriveSubQuery_UserInfoList( + public abstract String keepRoleId_DerivedReferrer_UserInfoList( UserInfoCQ subQuery); /** - * IsNull(is null). And OnceRegistered. + * IsNull(is null). And OnlyOnceRegistered. */ public void setRoleId_IsNull() { regRoleId(CK_ISN, DUMMY_OBJECT); } /** - * IsNotNull(is not null). And OnceRegistered. + * IsNotNull(is not null). And OnlyOnceRegistered. */ public void setRoleId_IsNotNull() { regRoleId(CK_ISNN, DUMMY_OBJECT); @@ -421,7 +357,7 @@ abstract protected ConditionValue getCValueRoleId(); /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {VARCHAR(100)} + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {VARCHAR(100)} * * @param name The value of name as equal. */ @@ -430,7 +366,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param name The value of name as notEqual. */ @@ -439,7 +375,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param name The value of name as greaterThan. */ @@ -448,7 +384,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param name The value of name as lessThan. */ @@ -457,7 +393,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param name The value of name as greaterEqual. */ @@ -466,7 +402,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param name The value of name as lessEqual. */ @@ -475,7 +411,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param name The value of name as prefixSearch. */ @@ -484,20 +420,6 @@ } /** - * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, - * SeveralRegistered. - * - * @param name The value of name as likeSearch. - * @param likeSearchOption The option of like-search. (NotNull) - */ - public void setName_LikeSearch( - String name, - jp.sf.pal.userinfo.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { - registerLikeSearchQuery(CK_LS, fRES(name), getCValueName(), "NAME", - "Name", "name", likeSearchOption); - } - - /** * InScope(in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * @@ -508,38 +430,52 @@ } /** - * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * - * @param name The collection of name as inScope. - * @param inScopeOption The option of in-scope. (NotNull) + * @param nameList The collection of name as notInScope. */ - public void setName_InScope( + public void setName_NotInScope(Collection nameList) { + regName(CK_NINS, cTL(nameList)); + } + + /** + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param name The value of name as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) + */ + public void setName_LikeSearch( String name, - jp.sf.pal.userinfo.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(name), getCValueName(), "NAME", - "Name", "name", inScopeOption); + jp.sf.pal.userinfo.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(name), getCValueName(), "NAME", "Name", "name", + likeSearchOption); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param nameList The collection of name as notInScope. + * @param name The value of name as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setName_NotInScope(Collection nameList) { - regName(CK_NINS, cTL(nameList)); + public void setName_NotLikeSearch( + String name, + jp.sf.pal.userinfo.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(name), getCValueName(), "NAME", "Name", "name", + likeSearchOption); } /** - * IsNull(is null). And OnceRegistered. + * IsNull(is null). And OnlyOnceRegistered. */ public void setName_IsNull() { regName(CK_ISN, DUMMY_OBJECT); } /** - * IsNotNull(is not null). And OnceRegistered. + * IsNotNull(is not null). And OnlyOnceRegistered. */ public void setName_IsNotNull() { regName(CK_ISNN, DUMMY_OBJECT); @@ -556,7 +492,7 @@ abstract protected ConditionValue getCValueName(); /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {VARCHAR(255)} + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {VARCHAR(255)} * * @param description The value of description as equal. */ @@ -565,7 +501,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param description The value of description as notEqual. */ @@ -574,7 +510,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param description The value of description as greaterThan. */ @@ -583,7 +519,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param description The value of description as lessThan. */ @@ -592,7 +528,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param description The value of description as greaterEqual. */ @@ -601,7 +537,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param description The value of description as lessEqual. */ @@ -610,7 +546,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param description The value of description as prefixSearch. */ @@ -619,21 +555,6 @@ } /** - * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, - * SeveralRegistered. - * - * @param description The value of description as likeSearch. - * @param likeSearchOption The option of like-search. (NotNull) - */ - public void setDescription_LikeSearch( - String description, - jp.sf.pal.userinfo.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { - registerLikeSearchQuery(CK_LS, fRES(description), - getCValueDescription(), "DESCRIPTION", "Description", - "description", likeSearchOption); - } - - /** * InScope(in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * @@ -644,38 +565,52 @@ } /** - * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * - * @param description The collection of description as inScope. - * @param inScopeOption The option of in-scope. (NotNull) + * @param descriptionList The collection of description as notInScope. */ - public void setDescription_InScope( + public void setDescription_NotInScope(Collection descriptionList) { + regDescription(CK_NINS, cTL(descriptionList)); + } + + /** + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param description The value of description as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) + */ + public void setDescription_LikeSearch( String description, - jp.sf.pal.userinfo.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(description), getCValueDescription(), - "DESCRIPTION", "Description", "description", inScopeOption); + jp.sf.pal.userinfo.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(description), getCValueDescription(), "DESCRIPTION", + "Description", "description", likeSearchOption); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param descriptionList The collection of description as notInScope. + * @param description The value of description as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setDescription_NotInScope(Collection descriptionList) { - regDescription(CK_NINS, cTL(descriptionList)); + public void setDescription_NotLikeSearch( + String description, + jp.sf.pal.userinfo.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(description), getCValueDescription(), + "DESCRIPTION", "Description", "description", likeSearchOption); } /** - * IsNull(is null). And OnceRegistered. + * IsNull(is null). And OnlyOnceRegistered. */ public void setDescription_IsNull() { regDescription(CK_ISN, DUMMY_OBJECT); } /** - * IsNotNull(is not null). And OnceRegistered. + * IsNotNull(is not null). And OnlyOnceRegistered. */ public void setDescription_IsNotNull() { regDescription(CK_ISNN, DUMMY_OBJECT); @@ -694,7 +629,7 @@ abstract protected ConditionValue getCValueDescription(); /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {VARCHAR(255)} + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {VARCHAR(255)} * * @param email The value of email as equal. */ @@ -703,7 +638,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param email The value of email as notEqual. */ @@ -712,7 +647,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param email The value of email as greaterThan. */ @@ -721,7 +656,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param email The value of email as lessThan. */ @@ -730,7 +665,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param email The value of email as greaterEqual. */ @@ -739,7 +674,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param email The value of email as lessEqual. */ @@ -748,7 +683,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param email The value of email as prefixSearch. */ @@ -757,20 +692,6 @@ } /** - * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, - * SeveralRegistered. - * - * @param email The value of email as likeSearch. - * @param likeSearchOption The option of like-search. (NotNull) - */ - public void setEmail_LikeSearch( - String email, - jp.sf.pal.userinfo.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { - registerLikeSearchQuery(CK_LS, fRES(email), getCValueEmail(), "EMAIL", - "Email", "email", likeSearchOption); - } - - /** * InScope(in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * @@ -781,38 +702,52 @@ } /** - * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * - * @param email The collection of email as inScope. - * @param inScopeOption The option of in-scope. (NotNull) + * @param emailList The collection of email as notInScope. */ - public void setEmail_InScope( + public void setEmail_NotInScope(Collection emailList) { + regEmail(CK_NINS, cTL(emailList)); + } + + /** + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param email The value of email as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) + */ + public void setEmail_LikeSearch( String email, - jp.sf.pal.userinfo.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(email), getCValueEmail(), "EMAIL", - "Email", "email", inScopeOption); + jp.sf.pal.userinfo.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(email), getCValueEmail(), "EMAIL", "Email", "email", + likeSearchOption); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param emailList The collection of email as notInScope. + * @param email The value of email as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setEmail_NotInScope(Collection emailList) { - regEmail(CK_NINS, cTL(emailList)); + public void setEmail_NotLikeSearch( + String email, + jp.sf.pal.userinfo.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(email), getCValueEmail(), "EMAIL", "Email", + "email", likeSearchOption); } /** - * IsNull(is null). And OnceRegistered. + * IsNull(is null). And OnlyOnceRegistered. */ public void setEmail_IsNull() { regEmail(CK_ISN, DUMMY_OBJECT); } /** - * IsNotNull(is not null). And OnceRegistered. + * IsNotNull(is not null). And OnlyOnceRegistered. */ public void setEmail_IsNotNull() { regEmail(CK_ISNN, DUMMY_OBJECT); @@ -830,7 +765,7 @@ abstract protected ConditionValue getCValueEmail(); /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {VARCHAR(255)} + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {VARCHAR(255)} * * @param url The value of url as equal. */ @@ -839,7 +774,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param url The value of url as notEqual. */ @@ -848,7 +783,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param url The value of url as greaterThan. */ @@ -857,7 +792,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param url The value of url as lessThan. */ @@ -866,7 +801,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param url The value of url as greaterEqual. */ @@ -875,7 +810,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param url The value of url as lessEqual. */ @@ -884,7 +819,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param url The value of url as prefixSearch. */ @@ -893,20 +828,6 @@ } /** - * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, - * SeveralRegistered. - * - * @param url The value of url as likeSearch. - * @param likeSearchOption The option of like-search. (NotNull) - */ - public void setUrl_LikeSearch( - String url, - jp.sf.pal.userinfo.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { - registerLikeSearchQuery(CK_LS, fRES(url), getCValueUrl(), "URL", "Url", - "url", likeSearchOption); - } - - /** * InScope(in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * @@ -917,38 +838,52 @@ } /** - * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * - * @param url The collection of url as inScope. - * @param inScopeOption The option of in-scope. (NotNull) + * @param urlList The collection of url as notInScope. */ - public void setUrl_InScope( + public void setUrl_NotInScope(Collection urlList) { + regUrl(CK_NINS, cTL(urlList)); + } + + /** + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param url The value of url as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) + */ + public void setUrl_LikeSearch( String url, - jp.sf.pal.userinfo.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(url), getCValueUrl(), "URL", "Url", - "url", inScopeOption); + jp.sf.pal.userinfo.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(url), getCValueUrl(), "URL", "Url", "url", + likeSearchOption); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param urlList The collection of url as notInScope. + * @param url The value of url as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setUrl_NotInScope(Collection urlList) { - regUrl(CK_NINS, cTL(urlList)); + public void setUrl_NotLikeSearch( + String url, + jp.sf.pal.userinfo.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(url), getCValueUrl(), "URL", "Url", "url", + likeSearchOption); } /** - * IsNull(is null). And OnceRegistered. + * IsNull(is null). And OnlyOnceRegistered. */ public void setUrl_IsNull() { regUrl(CK_ISN, DUMMY_OBJECT); } /** - * IsNotNull(is not null). And OnceRegistered. + * IsNotNull(is not null). And OnlyOnceRegistered. */ public void setUrl_IsNotNull() { regUrl(CK_ISNN, DUMMY_OBJECT); @@ -965,7 +900,7 @@ abstract protected ConditionValue getCValueUrl(); /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {VARCHAR(40)} + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {VARCHAR(40)} * * @param telephone The value of telephone as equal. */ @@ -974,7 +909,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param telephone The value of telephone as notEqual. */ @@ -983,7 +918,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param telephone The value of telephone as greaterThan. */ @@ -992,7 +927,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param telephone The value of telephone as lessThan. */ @@ -1001,7 +936,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param telephone The value of telephone as greaterEqual. */ @@ -1010,7 +945,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param telephone The value of telephone as lessEqual. */ @@ -1019,7 +954,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param telephone The value of telephone as prefixSearch. */ @@ -1028,20 +963,6 @@ } /** - * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, - * SeveralRegistered. - * - * @param telephone The value of telephone as likeSearch. - * @param likeSearchOption The option of like-search. (NotNull) - */ - public void setTelephone_LikeSearch( - String telephone, - jp.sf.pal.userinfo.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { - registerLikeSearchQuery(CK_LS, fRES(telephone), getCValueTelephone(), - "TELEPHONE", "Telephone", "telephone", likeSearchOption); - } - - /** * InScope(in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * @@ -1052,38 +973,52 @@ } /** - * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * - * @param telephone The collection of telephone as inScope. - * @param inScopeOption The option of in-scope. (NotNull) + * @param telephoneList The collection of telephone as notInScope. */ - public void setTelephone_InScope( + public void setTelephone_NotInScope(Collection telephoneList) { + regTelephone(CK_NINS, cTL(telephoneList)); + } + + /** + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param telephone The value of telephone as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) + */ + public void setTelephone_LikeSearch( String telephone, - jp.sf.pal.userinfo.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(telephone), getCValueTelephone(), - "TELEPHONE", "Telephone", "telephone", inScopeOption); + jp.sf.pal.userinfo.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(telephone), getCValueTelephone(), "TELEPHONE", + "Telephone", "telephone", likeSearchOption); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param telephoneList The collection of telephone as notInScope. + * @param telephone The value of telephone as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setTelephone_NotInScope(Collection telephoneList) { - regTelephone(CK_NINS, cTL(telephoneList)); + public void setTelephone_NotLikeSearch( + String telephone, + jp.sf.pal.userinfo.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(telephone), getCValueTelephone(), "TELEPHONE", + "Telephone", "telephone", likeSearchOption); } /** - * IsNull(is null). And OnceRegistered. + * IsNull(is null). And OnlyOnceRegistered. */ public void setTelephone_IsNull() { regTelephone(CK_ISN, DUMMY_OBJECT); } /** - * IsNotNull(is not null). And OnceRegistered. + * IsNotNull(is not null). And OnlyOnceRegistered. */ public void setTelephone_IsNotNull() { regTelephone(CK_ISNN, DUMMY_OBJECT); @@ -1102,7 +1037,7 @@ abstract protected ConditionValue getCValueTelephone(); /** - * Equal(=). And NullIgnored, OnceRegistered. {NotNull : TIMESTAMP} + * Equal(=). And NullIgnored, OnlyOnceRegistered. {NotNull : TIMESTAMP} * * @param createdTime The value of createdTime as equal. */ @@ -1111,7 +1046,7 @@ } /** - * NotEqual(!=). And NullIgnored, OnceRegistered. + * NotEqual(!=). And NullIgnored, OnlyOnceRegistered. * * @param createdTime The value of createdTime as notEqual. */ @@ -1120,7 +1055,7 @@ } /** - * GreaterThan(>). And NullIgnored, OnceRegistered. + * GreaterThan(>). And NullIgnored, OnlyOnceRegistered. * * @param createdTime The value of createdTime as greaterThan. */ @@ -1129,7 +1064,7 @@ } /** - * LessThan(>). And NullIgnored, OnceRegistered. + * LessThan(>). And NullIgnored, OnlyOnceRegistered. * * @param createdTime The value of createdTime as lessThan. */ @@ -1138,7 +1073,7 @@ } /** - * GreaterEqual(>). And NullIgnored, OnceRegistered. + * GreaterEqual(>). And NullIgnored, OnlyOnceRegistered. * * @param createdTime The value of createdTime as greaterEqual. */ @@ -1147,7 +1082,7 @@ } /** - * LessEqual(>). And NullIgnored, OnceRegistered. + * LessEqual(>). And NullIgnored, OnlyOnceRegistered. * * @param createdTime The value of createdTime as lessEqual. */ @@ -1157,7 +1092,7 @@ /** * FromTo($fromDate <= COLUMN_NAME <= $toDate). And NullIgnored, - * OnceRegistered. {NotNull : TIMESTAMP} + * OnlyOnceRegistered. {NotNull : TIMESTAMP} * * @param fromDate The from-date of createdTime. (Nullable) * @param toDate The to-date of createdTime. (Nullable) @@ -1175,7 +1110,7 @@ /** * FromTo($fromDate <= COLUMN_NAME < $toDate + 1). And NullIgnored, - * OnceRegistered. {NotNull : TIMESTAMP} + * OnlyOnceRegistered. {NotNull : TIMESTAMP} * * @param fromDate The from-date of createdTime. (Nullable) * @param toDate The to-date of createdTime. (Nullable) @@ -1201,7 +1136,7 @@ abstract protected ConditionValue getCValueCreatedTime(); /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {NotNull : + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {NotNull : * VARCHAR(255)} * * @param createdBy The value of createdBy as equal. @@ -1211,7 +1146,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param createdBy The value of createdBy as notEqual. */ @@ -1220,7 +1155,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param createdBy The value of createdBy as greaterThan. */ @@ -1229,7 +1164,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param createdBy The value of createdBy as lessThan. */ @@ -1238,7 +1173,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param createdBy The value of createdBy as greaterEqual. */ @@ -1247,7 +1182,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param createdBy The value of createdBy as lessEqual. */ @@ -1256,7 +1191,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param createdBy The value of createdBy as prefixSearch. */ @@ -1265,20 +1200,6 @@ } /** - * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, - * SeveralRegistered. - * - * @param createdBy The value of createdBy as likeSearch. - * @param likeSearchOption The option of like-search. (NotNull) - */ - public void setCreatedBy_LikeSearch( - String createdBy, - jp.sf.pal.userinfo.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { - registerLikeSearchQuery(CK_LS, fRES(createdBy), getCValueCreatedBy(), - "CREATED_BY", "CreatedBy", "createdBy", likeSearchOption); - } - - /** * InScope(in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * @@ -1289,27 +1210,41 @@ } /** - * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * - * @param createdBy The collection of createdBy as inScope. - * @param inScopeOption The option of in-scope. (NotNull) + * @param createdByList The collection of createdBy as notInScope. */ - public void setCreatedBy_InScope( + public void setCreatedBy_NotInScope(Collection createdByList) { + regCreatedBy(CK_NINS, cTL(createdByList)); + } + + /** + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param createdBy The value of createdBy as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) + */ + public void setCreatedBy_LikeSearch( String createdBy, - jp.sf.pal.userinfo.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(createdBy), getCValueCreatedBy(), - "CREATED_BY", "CreatedBy", "createdBy", inScopeOption); + jp.sf.pal.userinfo.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(createdBy), getCValueCreatedBy(), "CREATED_BY", + "CreatedBy", "createdBy", likeSearchOption); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param createdByList The collection of createdBy as notInScope. + * @param createdBy The value of createdBy as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setCreatedBy_NotInScope(Collection createdByList) { - regCreatedBy(CK_NINS, cTL(createdByList)); + public void setCreatedBy_NotLikeSearch( + String createdBy, + jp.sf.pal.userinfo.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(createdBy), getCValueCreatedBy(), "CREATED_BY", + "CreatedBy", "createdBy", likeSearchOption); } protected void regCreatedBy(ConditionKey key, Object value) { @@ -1325,7 +1260,7 @@ abstract protected ConditionValue getCValueCreatedBy(); /** - * Equal(=). And NullIgnored, OnceRegistered. {NotNull : TIMESTAMP} + * Equal(=). And NullIgnored, OnlyOnceRegistered. {NotNull : TIMESTAMP} * * @param updatedTime The value of updatedTime as equal. */ @@ -1334,7 +1269,7 @@ } /** - * NotEqual(!=). And NullIgnored, OnceRegistered. + * NotEqual(!=). And NullIgnored, OnlyOnceRegistered. * * @param updatedTime The value of updatedTime as notEqual. */ @@ -1343,7 +1278,7 @@ } /** - * GreaterThan(>). And NullIgnored, OnceRegistered. + * GreaterThan(>). And NullIgnored, OnlyOnceRegistered. * * @param updatedTime The value of updatedTime as greaterThan. */ @@ -1352,7 +1287,7 @@ } /** - * LessThan(>). And NullIgnored, OnceRegistered. + * LessThan(>). And NullIgnored, OnlyOnceRegistered. * * @param updatedTime The value of updatedTime as lessThan. */ @@ -1361,7 +1296,7 @@ } /** - * GreaterEqual(>). And NullIgnored, OnceRegistered. + * GreaterEqual(>). And NullIgnored, OnlyOnceRegistered. * * @param updatedTime The value of updatedTime as greaterEqual. */ @@ -1370,7 +1305,7 @@ } /** - * LessEqual(>). And NullIgnored, OnceRegistered. + * LessEqual(>). And NullIgnored, OnlyOnceRegistered. * * @param updatedTime The value of updatedTime as lessEqual. */ @@ -1380,7 +1315,7 @@ /** * FromTo($fromDate <= COLUMN_NAME <= $toDate). And NullIgnored, - * OnceRegistered. {NotNull : TIMESTAMP} + * OnlyOnceRegistered. {NotNull : TIMESTAMP} * * @param fromDate The from-date of updatedTime. (Nullable) * @param toDate The to-date of updatedTime. (Nullable) @@ -1398,7 +1333,7 @@ /** * FromTo($fromDate <= COLUMN_NAME < $toDate + 1). And NullIgnored, - * OnceRegistered. {NotNull : TIMESTAMP} + * OnlyOnceRegistered. {NotNull : TIMESTAMP} * * @param fromDate The from-date of updatedTime. (Nullable) * @param toDate The to-date of updatedTime. (Nullable) @@ -1424,7 +1359,7 @@ abstract protected ConditionValue getCValueUpdatedTime(); /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {NotNull : + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {NotNull : * VARCHAR(255)} * * @param updatedBy The value of updatedBy as equal. @@ -1434,7 +1369,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param updatedBy The value of updatedBy as notEqual. */ @@ -1443,7 +1378,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param updatedBy The value of updatedBy as greaterThan. */ @@ -1452,7 +1387,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param updatedBy The value of updatedBy as lessThan. */ @@ -1461,7 +1396,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param updatedBy The value of updatedBy as greaterEqual. */ @@ -1470,7 +1405,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param updatedBy The value of updatedBy as lessEqual. */ @@ -1479,7 +1414,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param updatedBy The value of updatedBy as prefixSearch. */ @@ -1488,20 +1423,6 @@ } /** - * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, - * SeveralRegistered. - * - * @param updatedBy The value of updatedBy as likeSearch. - * @param likeSearchOption The option of like-search. (NotNull) - */ - public void setUpdatedBy_LikeSearch( - String updatedBy, - jp.sf.pal.userinfo.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { - registerLikeSearchQuery(CK_LS, fRES(updatedBy), getCValueUpdatedBy(), - "UPDATED_BY", "UpdatedBy", "updatedBy", likeSearchOption); - } - - /** * InScope(in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * @@ -1512,27 +1433,41 @@ } /** - * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * - * @param updatedBy The collection of updatedBy as inScope. - * @param inScopeOption The option of in-scope. (NotNull) + * @param updatedByList The collection of updatedBy as notInScope. */ - public void setUpdatedBy_InScope( + public void setUpdatedBy_NotInScope(Collection updatedByList) { + regUpdatedBy(CK_NINS, cTL(updatedByList)); + } + + /** + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param updatedBy The value of updatedBy as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) + */ + public void setUpdatedBy_LikeSearch( String updatedBy, - jp.sf.pal.userinfo.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(updatedBy), getCValueUpdatedBy(), - "UPDATED_BY", "UpdatedBy", "updatedBy", inScopeOption); + jp.sf.pal.userinfo.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(updatedBy), getCValueUpdatedBy(), "UPDATED_BY", + "UpdatedBy", "updatedBy", likeSearchOption); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param updatedByList The collection of updatedBy as notInScope. + * @param updatedBy The value of updatedBy as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setUpdatedBy_NotInScope(Collection updatedByList) { - regUpdatedBy(CK_NINS, cTL(updatedByList)); + public void setUpdatedBy_NotLikeSearch( + String updatedBy, + jp.sf.pal.userinfo.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(updatedBy), getCValueUpdatedBy(), "UPDATED_BY", + "UpdatedBy", "updatedBy", likeSearchOption); } protected void regUpdatedBy(ConditionKey key, Object value) { @@ -1548,7 +1483,7 @@ abstract protected ConditionValue getCValueUpdatedBy(); /** - * Equal(=). And NullIgnored, OnceRegistered. {TIMESTAMP} + * Equal(=). And NullIgnored, OnlyOnceRegistered. {TIMESTAMP} * * @param deletedTime The value of deletedTime as equal. */ @@ -1557,7 +1492,7 @@ } /** - * NotEqual(!=). And NullIgnored, OnceRegistered. + * NotEqual(!=). And NullIgnored, OnlyOnceRegistered. * * @param deletedTime The value of deletedTime as notEqual. */ @@ -1566,7 +1501,7 @@ } /** - * GreaterThan(>). And NullIgnored, OnceRegistered. + * GreaterThan(>). And NullIgnored, OnlyOnceRegistered. * * @param deletedTime The value of deletedTime as greaterThan. */ @@ -1575,7 +1510,7 @@ } /** - * LessThan(>). And NullIgnored, OnceRegistered. + * LessThan(>). And NullIgnored, OnlyOnceRegistered. * * @param deletedTime The value of deletedTime as lessThan. */ @@ -1584,7 +1519,7 @@ } /** - * GreaterEqual(>). And NullIgnored, OnceRegistered. + * GreaterEqual(>). And NullIgnored, OnlyOnceRegistered. * * @param deletedTime The value of deletedTime as greaterEqual. */ @@ -1593,7 +1528,7 @@ } /** - * LessEqual(>). And NullIgnored, OnceRegistered. + * LessEqual(>). And NullIgnored, OnlyOnceRegistered. * * @param deletedTime The value of deletedTime as lessEqual. */ @@ -1603,7 +1538,7 @@ /** * FromTo($fromDate <= COLUMN_NAME <= $toDate). And NullIgnored, - * OnceRegistered. {TIMESTAMP} + * OnlyOnceRegistered. {TIMESTAMP} * * @param fromDate The from-date of deletedTime. (Nullable) * @param toDate The to-date of deletedTime. (Nullable) @@ -1621,7 +1556,7 @@ /** * FromTo($fromDate <= COLUMN_NAME < $toDate + 1). And NullIgnored, - * OnceRegistered. {TIMESTAMP} + * OnlyOnceRegistered. {TIMESTAMP} * * @param fromDate The from-date of deletedTime. (Nullable) * @param toDate The to-date of deletedTime. (Nullable) @@ -1635,14 +1570,14 @@ } /** - * IsNull(is null). And OnceRegistered. + * IsNull(is null). And OnlyOnceRegistered. */ public void setDeletedTime_IsNull() { regDeletedTime(CK_ISN, DUMMY_OBJECT); } /** - * IsNotNull(is not null). And OnceRegistered. + * IsNotNull(is not null). And OnlyOnceRegistered. */ public void setDeletedTime_IsNotNull() { regDeletedTime(CK_ISNN, DUMMY_OBJECT); @@ -1661,7 +1596,7 @@ abstract protected ConditionValue getCValueDeletedTime(); /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {VARCHAR(255)} + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {VARCHAR(255)} * * @param deletedBy The value of deletedBy as equal. */ @@ -1670,7 +1605,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param deletedBy The value of deletedBy as notEqual. */ @@ -1679,7 +1614,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param deletedBy The value of deletedBy as greaterThan. */ @@ -1688,7 +1623,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param deletedBy The value of deletedBy as lessThan. */ @@ -1697,7 +1632,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param deletedBy The value of deletedBy as greaterEqual. */ @@ -1706,7 +1641,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param deletedBy The value of deletedBy as lessEqual. */ @@ -1715,7 +1650,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param deletedBy The value of deletedBy as prefixSearch. */ @@ -1724,20 +1659,6 @@ } /** - * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, - * SeveralRegistered. - * - * @param deletedBy The value of deletedBy as likeSearch. - * @param likeSearchOption The option of like-search. (NotNull) - */ - public void setDeletedBy_LikeSearch( - String deletedBy, - jp.sf.pal.userinfo.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { - registerLikeSearchQuery(CK_LS, fRES(deletedBy), getCValueDeletedBy(), - "DELETED_BY", "DeletedBy", "deletedBy", likeSearchOption); - } - - /** * InScope(in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * @@ -1748,38 +1669,52 @@ } /** - * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * - * @param deletedBy The collection of deletedBy as inScope. - * @param inScopeOption The option of in-scope. (NotNull) + * @param deletedByList The collection of deletedBy as notInScope. */ - public void setDeletedBy_InScope( + public void setDeletedBy_NotInScope(Collection deletedByList) { + regDeletedBy(CK_NINS, cTL(deletedByList)); + } + + /** + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param deletedBy The value of deletedBy as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) + */ + public void setDeletedBy_LikeSearch( String deletedBy, - jp.sf.pal.userinfo.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(deletedBy), getCValueDeletedBy(), - "DELETED_BY", "DeletedBy", "deletedBy", inScopeOption); + jp.sf.pal.userinfo.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(deletedBy), getCValueDeletedBy(), "DELETED_BY", + "DeletedBy", "deletedBy", likeSearchOption); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param deletedByList The collection of deletedBy as notInScope. + * @param deletedBy The value of deletedBy as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setDeletedBy_NotInScope(Collection deletedByList) { - regDeletedBy(CK_NINS, cTL(deletedByList)); + public void setDeletedBy_NotLikeSearch( + String deletedBy, + jp.sf.pal.userinfo.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(deletedBy), getCValueDeletedBy(), "DELETED_BY", + "DeletedBy", "deletedBy", likeSearchOption); } /** - * IsNull(is null). And OnceRegistered. + * IsNull(is null). And OnlyOnceRegistered. */ public void setDeletedBy_IsNull() { regDeletedBy(CK_ISN, DUMMY_OBJECT); } /** - * IsNotNull(is not null). And OnceRegistered. + * IsNotNull(is not null). And OnlyOnceRegistered. */ public void setDeletedBy_IsNotNull() { regDeletedBy(CK_ISNN, DUMMY_OBJECT); @@ -1798,7 +1733,7 @@ abstract protected ConditionValue getCValueDeletedBy(); /** - * Equal(=). And NullIgnored, OnceRegistered. {NotNull : INTEGER} + * Equal(=). And NullIgnored, OnlyOnceRegistered. {NotNull : INTEGER} * * @param versionno The value of versionno as equal. */ @@ -1807,7 +1742,7 @@ } /** - * NotEqual(!=). And NullIgnored, OnceRegistered. + * NotEqual(!=). And NullIgnored, OnlyOnceRegistered. * * @param versionno The value of versionno as notEqual. */ @@ -1816,7 +1751,7 @@ } /** - * GreaterThan(>). And NullIgnored, OnceRegistered. + * GreaterThan(>). And NullIgnored, OnlyOnceRegistered. * * @param versionno The value of versionno as greaterThan. */ @@ -1825,7 +1760,7 @@ } /** - * LessThan(<). And NullIgnored, OnceRegistered. + * LessThan(<). And NullIgnored, OnlyOnceRegistered. * * @param versionno The value of versionno as lessThan. */ @@ -1834,7 +1769,7 @@ } /** - * GreaterEqual(>=). And NullIgnored, OnceRegistered. + * GreaterEqual(>=). And NullIgnored, OnlyOnceRegistered. * * @param versionno The value of versionno as greaterEqual. */ @@ -1843,7 +1778,7 @@ } /** - * LessEqual(<=). And NullIgnored, OnceRegistered. + * LessEqual(<=). And NullIgnored, OnlyOnceRegistered. * * @param versionno The value of versionno as lessEqual. */ @@ -1883,6 +1818,50 @@ abstract protected ConditionValue getCValueVersionno(); + public SSQFunction scalar_Equal() { + return xcreateSSQFunction("="); + } + + public SSQFunction scalar_GreaterEqual() { + return xcreateSSQFunction(">="); + } + + public SSQFunction scalar_GreaterThan() { + return xcreateSSQFunction(">"); + } + + public SSQFunction scalar_LessEqual() { + return xcreateSSQFunction("<="); + } + + public SSQFunction scalar_LessThan() { + return xcreateSSQFunction("<"); + } + + protected SSQFunction xcreateSSQFunction(final String operand) { + return new SSQFunction(new SSQSetupper() { + public void setup(String function, SubQuery subQuery) { + xscalarSubQuery(function, subQuery, operand); + } + }); + } + + protected void xscalarSubQuery(String function, + SubQuery subQuery, String operand) { + assertObjectNotNull("subQuery", subQuery); + RoleInfoCB cb = new RoleInfoCB(); + cb.xsetupForScalarSubQuery(); + subQuery.query(cb); + String subQueryPropertyName = keepScalarSubQuery(cb.query()); // for + // saving + // query + // -value. + registerScalarSubQuery(function, cb.query(), subQueryPropertyName, + operand); + } + + public abstract String keepScalarSubQuery(RoleInfoCQ subQuery); + // Very Internal (for Suppressing Warn about 'Not Use Import') protected String getConditionBeanClassNameInternally() { return RoleInfoCB.class.getName(); Modified: userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/cbean/cq/bs/AbstractBsRoleMappingCQ.java =================================================================== --- userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/cbean/cq/bs/AbstractBsRoleMappingCQ.java 2008-12-26 22:11:31 UTC (rev 1622) +++ userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/cbean/cq/bs/AbstractBsRoleMappingCQ.java 2008-12-27 22:02:56 UTC (rev 1623) @@ -11,16 +11,13 @@ import jp.sf.pal.userinfo.db.cbean.RoleInfoCB; import jp.sf.pal.userinfo.db.cbean.RoleMappingCB; import jp.sf.pal.userinfo.db.cbean.UserInfoCB; -import jp.sf.pal.userinfo.db.cbean.cq.RoleInfoCQ; import jp.sf.pal.userinfo.db.cbean.cq.RoleMappingCQ; -import jp.sf.pal.userinfo.db.cbean.cq.UserInfoCQ; /** * The abstract condition-query of ROLE_MAPPING. * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public abstract class AbstractBsRoleMappingCQ extends AbstractConditionQuery { //========================================================================== @@ -50,7 +47,8 @@ // ===== /** - * Equal(=). And NullIgnored, OnceRegistered. {PK : ID : NotNull : INTEGER} + * Equal(=). And NullIgnored, OnlyOnceRegistered. {PK : ID : NotNull : + * INTEGER} * * @param id The value of id as equal. */ @@ -59,7 +57,7 @@ } /** - * NotEqual(!=). And NullIgnored, OnceRegistered. + * NotEqual(!=). And NullIgnored, OnlyOnceRegistered. * * @param id The value of id as notEqual. */ @@ -68,7 +66,7 @@ } /** - * GreaterThan(>). And NullIgnored, OnceRegistered. + * GreaterThan(>). And NullIgnored, OnlyOnceRegistered. * * @param id The value of id as greaterThan. */ @@ -77,7 +75,7 @@ } /** - * LessThan(<). And NullIgnored, OnceRegistered. + * LessThan(<). And NullIgnored, OnlyOnceRegistered. * * @param id The value of id as lessThan. */ @@ -86,7 +84,7 @@ } /** - * GreaterEqual(>=). And NullIgnored, OnceRegistered. + * GreaterEqual(>=). And NullIgnored, OnlyOnceRegistered. * * @param id The value of id as greaterEqual. */ @@ -95,7 +93,7 @@ } /** - * LessEqual(<=). And NullIgnored, OnceRegistered. + * LessEqual(<=). And NullIgnored, OnlyOnceRegistered. * * @param id The value of id as lessEqual. */ @@ -124,14 +122,14 @@ } /** - * IsNull(is null). And OnceRegistered. + * IsNull(is null). And OnlyOnceRegistered. */ public void setId_IsNull() { regId(CK_ISN, DUMMY_OBJECT); } /** - * IsNotNull(is not null). And OnceRegistered. + * IsNotNull(is not null). And OnlyOnceRegistered. */ public void setId_IsNotNull() { regId(CK_ISNN, DUMMY_OBJECT); @@ -148,8 +146,8 @@ abstract protected ConditionValue getCValueId(); /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {NotNull : VARCHAR(255) - * : FK to USER_INFO} + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {NotNull : + * VARCHAR(255) : FK to USER_INFO} * * @param userId The value of userId as equal. */ @@ -158,7 +156,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param userId The value of userId as notEqual. */ @@ -167,7 +165,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param userId The value of userId as greaterThan. */ @@ -176,7 +174,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param userId The value of userId as lessThan. */ @@ -185,7 +183,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param userId The value of userId as greaterEqual. */ @@ -194,7 +192,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param userId The value of userId as lessEqual. */ @@ -203,7 +201,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param userId The value of userId as prefixSearch. */ @@ -212,20 +210,6 @@ } /** - * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, - * SeveralRegistered. - * - * @param userId The value of userId as likeSearch. - * @param likeSearchOption The option of like-search. (NotNull) - */ - public void setUserId_LikeSearch( - String userId, - jp.sf.pal.userinfo.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { - registerLikeSearchQuery(CK_LS, fRES(userId), getCValueUserId(), - "USER_ID", "UserId", "userId", likeSearchOption); - } - - /** * InScope(in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * @@ -236,42 +220,41 @@ } /** - * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * - * @param userId The collection of userId as inScope. - * @param inScopeOption The option of in-scope. (NotNull) + * @param userIdList The collection of userId as notInScope. */ - public void setUserId_InScope( - String userId, - jp.sf.pal.userinfo.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(userId), getCValueUserId(), - "USER_ID", "UserId", "userId", inScopeOption); + public void setUserId_NotInScope(Collection userIdList) { + regUserId(CK_NINS, cTL(userIdList)); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param userIdList The collection of userId as notInScope. + * @param userId The value of userId as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) */ - public void setUserId_NotInScope(Collection userIdList) { - regUserId(CK_NINS, cTL(userIdList)); + public void setUserId_LikeSearch( + String userId, + jp.sf.pal.userinfo.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(userId), getCValueUserId(), "USER_ID", "UserId", + "userId", likeSearchOption); } /** - * @param userInfoCBquery Query. - * @deprecated Please use inScopeUserInfo(subQuery) method. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param userId The value of userId as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setUserId_InScopeSubQuery_UserInfo(UserInfoCQ userInfoCBquery) { - String subQueryPropertyName = keepUserId_InScopeSubQuery_UserInfo(userInfoCBquery);// for - // saving - // query - // - - // value - // . - registerInScopeSubQuery(userInfoCBquery, "USER_ID", "USER_ID", - subQueryPropertyName); + public void setUserId_NotLikeSearch( + String userId, + jp.sf.pal.userinfo.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(userId), getCValueUserId(), "USER_ID", "UserId", + "userId", likeSearchOption); } public void inScopeUserInfo(SubQuery subQuery) { @@ -280,12 +263,12 @@ cb.xsetupForInScopeSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepUserId_InScopeSubQuery_UserInfo(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerInScopeSubQuery(cb.query(), "USER_ID", "USER_ID", subQueryPropertyName); } - abstract public String keepUserId_InScopeSubQuery_UserInfo( + public abstract String keepUserId_InScopeSubQuery_UserInfo( jp.sf.pal.userinfo.db.cbean.cq.UserInfoCQ subQuery); protected void regUserId(ConditionKey key, Object value) { @@ -301,8 +284,8 @@ abstract protected ConditionValue getCValueUserId(); /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {NotNull : VARCHAR(255) - * : FK to ROLE_INFO} + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {NotNull : + * VARCHAR(255) : FK to ROLE_INFO} * * @param roleId The value of roleId as equal. */ @@ -311,7 +294,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param roleId The value of roleId as notEqual. */ @@ -320,7 +303,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param roleId The value of roleId as greaterThan. */ @@ -329,7 +312,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param roleId The value of roleId as lessThan. */ @@ -338,7 +321,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param roleId The value of roleId as greaterEqual. */ @@ -347,7 +330,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param roleId The value of roleId as lessEqual. */ @@ -356,7 +339,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param roleId The value of roleId as prefixSearch. */ @@ -365,20 +348,6 @@ } /** - * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, - * SeveralRegistered. - * - * @param roleId The value of roleId as likeSearch. - * @param likeSearchOption The option of like-search. (NotNull) - */ - public void setRoleId_LikeSearch( - String roleId, - jp.sf.pal.userinfo.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { - registerLikeSearchQuery(CK_LS, fRES(roleId), getCValueRoleId(), - "ROLE_ID", "RoleId", "roleId", likeSearchOption); - } - - /** * InScope(in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * @@ -389,42 +358,41 @@ } /** - * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * - * @param roleId The collection of roleId as inScope. - * @param inScopeOption The option of in-scope. (NotNull) + * @param roleIdList The collection of roleId as notInScope. */ - public void setRoleId_InScope( - String roleId, - jp.sf.pal.userinfo.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(roleId), getCValueRoleId(), - "ROLE_ID", "RoleId", "roleId", inScopeOption); + public void setRoleId_NotInScope(Collection roleIdList) { + regRoleId(CK_NINS, cTL(roleIdList)); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param roleIdList The collection of roleId as notInScope. + * @param roleId The value of roleId as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) */ - public void setRoleId_NotInScope(Collection roleIdList) { - regRoleId(CK_NINS, cTL(roleIdList)); + public void setRoleId_LikeSearch( + String roleId, + jp.sf.pal.userinfo.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(roleId), getCValueRoleId(), "ROLE_ID", "RoleId", + "roleId", likeSearchOption); } /** - * @param roleInfoCBquery Query. - * @deprecated Please use inScopeRoleInfo(subQuery) method. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param roleId The value of roleId as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setRoleId_InScopeSubQuery_RoleInfo(RoleInfoCQ roleInfoCBquery) { - String subQueryPropertyName = keepRoleId_InScopeSubQuery_RoleInfo(roleInfoCBquery);// for - // saving - // query - // - - // value - // . - registerInScopeSubQuery(roleInfoCBquery, "ROLE_ID", "ROLE_ID", - subQueryPropertyName); + public void setRoleId_NotLikeSearch( + String roleId, + jp.sf.pal.userinfo.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(roleId), getCValueRoleId(), "ROLE_ID", "RoleId", + "roleId", likeSearchOption); } public void inScopeRoleInfo(SubQuery subQuery) { @@ -433,12 +401,12 @@ cb.xsetupForInScopeSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepRoleId_InScopeSubQuery_RoleInfo(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerInScopeSubQuery(cb.query(), "ROLE_ID", "ROLE_ID", subQueryPropertyName); } - abstract public String keepRoleId_InScopeSubQuery_RoleInfo( + public abstract String keepRoleId_InScopeSubQuery_RoleInfo( jp.sf.pal.userinfo.db.cbean.cq.RoleInfoCQ subQuery); protected void regRoleId(ConditionKey key, Object value) { @@ -453,6 +421,50 @@ abstract protected ConditionValue getCValueRoleId(); + public SSQFunction scalar_Equal() { + return xcreateSSQFunction("="); + } + + public SSQFunction scalar_GreaterEqual() { + return xcreateSSQFunction(">="); + } + + public SSQFunction scalar_GreaterThan() { + return xcreateSSQFunction(">"); + } + + public SSQFunction scalar_LessEqual() { + return xcreateSSQFunction("<="); + } + + public SSQFunction scalar_LessThan() { + return xcreateSSQFunction("<"); + } + + protected SSQFunction xcreateSSQFunction(final String operand) { + return new SSQFunction(new SSQSetupper() { + public void setup(String function, SubQuery subQuery) { + xscalarSubQuery(function, subQuery, operand); + } + }); + } + + protected void xscalarSubQuery(String function, + SubQuery subQuery, String operand) { + assertObjectNotNull("subQuery", subQuery); + RoleMappingCB cb = new RoleMappingCB(); + cb.xsetupForScalarSubQuery(); + subQuery.query(cb); + String subQueryPropertyName = keepScalarSubQuery(cb.query()); // for + // saving + // query + // -value. + registerScalarSubQuery(function, cb.query(), subQueryPropertyName, + operand); + } + + public abstract String keepScalarSubQuery(RoleMappingCQ subQuery); + // Very Internal (for Suppressing Warn about 'Not Use Import') protected String getConditionBeanClassNameInternally() { return RoleMappingCB.class.getName(); Modified: userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/cbean/cq/bs/AbstractBsUserInfoCQ.java =================================================================== --- userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/cbean/cq/bs/AbstractBsUserInfoCQ.java 2008-12-26 22:11:31 UTC (rev 1622) +++ userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/cbean/cq/bs/AbstractBsUserInfoCQ.java 2008-12-27 22:02:56 UTC (rev 1623) @@ -13,9 +13,7 @@ import jp.sf.pal.userinfo.db.cbean.RoleInfoCB; import jp.sf.pal.userinfo.db.cbean.RoleMappingCB; import jp.sf.pal.userinfo.db.cbean.UserInfoCB; -import jp.sf.pal.userinfo.db.cbean.cq.GroupInfoCQ; import jp.sf.pal.userinfo.db.cbean.cq.GroupMappingCQ; -import jp.sf.pal.userinfo.db.cbean.cq.RoleInfoCQ; import jp.sf.pal.userinfo.db.cbean.cq.RoleMappingCQ; import jp.sf.pal.userinfo.db.cbean.cq.UserInfoCQ; @@ -24,7 +22,6 @@ * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public abstract class AbstractBsUserInfoCQ extends AbstractConditionQuery { //========================================================================== @@ -54,7 +51,7 @@ // ===== /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {PK : NotNull : + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {PK : NotNull : * VARCHAR(255)} * * @param userId The value of userId as equal. @@ -64,7 +61,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param userId The value of userId as notEqual. */ @@ -73,7 +70,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param userId The value of userId as greaterThan. */ @@ -82,7 +79,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param userId The value of userId as lessThan. */ @@ -91,7 +88,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param userId The value of userId as greaterEqual. */ @@ -100,7 +97,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param userId The value of userId as lessEqual. */ @@ -109,7 +106,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param userId The value of userId as prefixSearch. */ @@ -118,20 +115,6 @@ } /** - * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, - * SeveralRegistered. - * - * @param userId The value of userId as likeSearch. - * @param likeSearchOption The option of like-search. (NotNull) - */ - public void setUserId_LikeSearch( - String userId, - jp.sf.pal.userinfo.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { - registerLikeSearchQuery(CK_LS, fRES(userId), getCValueUserId(), - "USER_ID", "UserId", "userId", likeSearchOption); - } - - /** * InScope(in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * @@ -142,43 +125,41 @@ } /** - * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * - * @param userId The collection of userId as inScope. - * @param inScopeOption The option of in-scope. (NotNull) + * @param userIdList The collection of userId as notInScope. */ - public void setUserId_InScope( - String userId, - jp.sf.pal.userinfo.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(userId), getCValueUserId(), - "USER_ID", "UserId", "userId", inScopeOption); + public void setUserId_NotInScope(Collection userIdList) { + regUserId(CK_NINS, cTL(userIdList)); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param userIdList The collection of userId as notInScope. + * @param userId The value of userId as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) */ - public void setUserId_NotInScope(Collection userIdList) { - regUserId(CK_NINS, cTL(userIdList)); + public void setUserId_LikeSearch( + String userId, + jp.sf.pal.userinfo.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(userId), getCValueUserId(), "USER_ID", "UserId", + "userId", likeSearchOption); } /** - * @param groupMappingCBquery Query. - * @deprecated Please use inScopeGroupMappingList(subQuery) method. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param userId The value of userId as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setUserId_InScopeSubQuery_GroupMappingList( - GroupMappingCQ groupMappingCBquery) { - String subQueryPropertyName = keepUserId_InScopeSubQuery_GroupMappingList(groupMappingCBquery);// for - // saving - // query - // - - // value - // . - registerInScopeSubQuery(groupMappingCBquery, "USER_ID", "USER_ID", - subQueryPropertyName); + public void setUserId_NotLikeSearch( + String userId, + jp.sf.pal.userinfo.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(userId), getCValueUserId(), "USER_ID", "UserId", + "userId", likeSearchOption); } public void inScopeGroupMappingList(SubQuery subQuery) { @@ -187,42 +168,26 @@ cb.xsetupForInScopeSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepUserId_InScopeSubQuery_GroupMappingList(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerInScopeSubQuery(cb.query(), "USER_ID", "USER_ID", subQueryPropertyName); } - abstract public String keepUserId_InScopeSubQuery_GroupMappingList( + public abstract String keepUserId_InScopeSubQuery_GroupMappingList( GroupMappingCQ subQuery); - /** - * @param roleMappingCBquery Query. - * @deprecated Please use inScopeRoleMappingList(subQuery) method. - */ - public void setUserId_InScopeSubQuery_RoleMappingList( - RoleMappingCQ roleMappingCBquery) { - String subQueryPropertyName = keepUserId_InScopeSubQuery_RoleMappingList(roleMappingCBquery);// for - // saving - // query - // - - // value - // . - registerInScopeSubQuery(roleMappingCBquery, "USER_ID", "USER_ID", - subQueryPropertyName); - } - public void inScopeRoleMappingList(SubQuery subQuery) { assertObjectNotNull("subQuery", subQuery); RoleMappingCB cb = new RoleMappingCB(); cb.xsetupForInScopeSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepUserId_InScopeSubQuery_RoleMappingList(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerInScopeSubQuery(cb.query(), "USER_ID", "USER_ID", subQueryPropertyName); } - abstract public String keepUserId_InScopeSubQuery_RoleMappingList( + public abstract String keepUserId_InScopeSubQuery_RoleMappingList( RoleMappingCQ subQuery); public void notInScopeGroupMappingList(SubQuery subQuery) { @@ -231,12 +196,12 @@ cb.xsetupForInScopeSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepUserId_NotInScopeSubQuery_GroupMappingList(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerNotInScopeSubQuery(cb.query(), "USER_ID", "USER_ID", subQueryPropertyName); } - abstract public String keepUserId_NotInScopeSubQuery_GroupMappingList( + public abstract String keepUserId_NotInScopeSubQuery_GroupMappingList( GroupMappingCQ subQuery); public void notInScopeRoleMappingList(SubQuery subQuery) { @@ -245,31 +210,15 @@ cb.xsetupForInScopeSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepUserId_NotInScopeSubQuery_RoleMappingList(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerNotInScopeSubQuery(cb.query(), "USER_ID", "USER_ID", subQueryPropertyName); } - abstract public String keepUserId_NotInScopeSubQuery_RoleMappingList( + public abstract String keepUserId_NotInScopeSubQuery_RoleMappingList( RoleMappingCQ subQuery); /** - * @param groupMappingCBquery Query. - * @deprecated Please use existsGroupMappingList(subQuery) method. - */ - public void setUserId_ExistsSubQuery_GroupMappingList( - GroupMappingCQ groupMappingCBquery) { - String subQueryPropertyName = keepUserId_ExistsSubQuery_GroupMappingList(groupMappingCBquery);// for - // saving - // query - // - - // value - // . - registerExistsSubQuery(groupMappingCBquery, "USER_ID", "USER_ID", - subQueryPropertyName); - } - - /** * Set up 'exists' sub-query. {exists (select USER_ID from GROUP_MAPPING * where ...)} * @@ -282,31 +231,15 @@ cb.xsetupForExistsSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepUserId_ExistsSubQuery_GroupMappingList(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerExistsSubQuery(cb.query(), "USER_ID", "USER_ID", subQueryPropertyName); } - abstract public String keepUserId_ExistsSubQuery_GroupMappingList( + public abstract String keepUserId_ExistsSubQuery_GroupMappingList( GroupMappingCQ subQuery); /** - * @param roleMappingCBquery Query. - * @deprecated Please use existsRoleMappingList(subQuery) method. - */ - public void setUserId_ExistsSubQuery_RoleMappingList( - RoleMappingCQ roleMappingCBquery) { - String subQueryPropertyName = keepUserId_ExistsSubQuery_RoleMappingList(roleMappingCBquery);// for - // saving - // query - // - - // value - // . - registerExistsSubQuery(roleMappingCBquery, "USER_ID", "USER_ID", - subQueryPropertyName); - } - - /** * Set up 'exists' sub-query. {exists (select USER_ID from ROLE_MAPPING * where ...)} * @@ -319,12 +252,12 @@ cb.xsetupForExistsSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepUserId_ExistsSubQuery_RoleMappingList(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerExistsSubQuery(cb.query(), "USER_ID", "USER_ID", subQueryPropertyName); } - abstract public String keepUserId_ExistsSubQuery_RoleMappingList( + public abstract String keepUserId_ExistsSubQuery_RoleMappingList( RoleMappingCQ subQuery); /** @@ -341,12 +274,12 @@ cb.xsetupForExistsSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepUserId_NotExistsSubQuery_GroupMappingList(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerNotExistsSubQuery(cb.query(), "USER_ID", "USER_ID", subQueryPropertyName); } - abstract public String keepUserId_NotExistsSubQuery_GroupMappingList( + public abstract String keepUserId_NotExistsSubQuery_GroupMappingList( GroupMappingCQ subQuery); /** @@ -362,53 +295,53 @@ cb.xsetupForExistsSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepUserId_NotExistsSubQuery_RoleMappingList(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerNotExistsSubQuery(cb.query(), "USER_ID", "USER_ID", subQueryPropertyName); } - abstract public String keepUserId_NotExistsSubQuery_RoleMappingList( + public abstract String keepUserId_NotExistsSubQuery_RoleMappingList( RoleMappingCQ subQuery); public void xderiveGroupMappingList(String function, SubQuery subQuery, String aliasName) { assertObjectNotNull("subQuery", subQuery); GroupMappingCB cb = new GroupMappingCB(); - cb.xsetupForDeriveReferrer(); + cb.xsetupForDerivedReferrer(); subQuery.query(cb); - String subQueryPropertyName = keepUserId_DeriveSubQuery_GroupMappingList(cb - .query());// for saving query-value. - registerDeriveSubQuery(function, cb.query(), "USER_ID", "USER_ID", - subQueryPropertyName, aliasName); + String subQueryPropertyName = keepUserId_DerivedReferrer_GroupMappingList(cb + .query()); // for saving query-value. + registerDerivedReferrerSubQuery(function, cb.query(), "USER_ID", + "USER_ID", subQueryPropertyName, aliasName); } - abstract public String keepUserId_DeriveSubQuery_GroupMappingList( + public abstract String keepUserId_DerivedReferrer_GroupMappingList( GroupMappingCQ subQuery); public void xderiveRoleMappingList(String function, SubQuery subQuery, String aliasName) { assertObjectNotNull("subQuery", subQuery); RoleMappingCB cb = new RoleMappingCB(); - cb.xsetupForDeriveReferrer(); + cb.xsetupForDerivedReferrer(); subQuery.query(cb); - String subQueryPropertyName = keepUserId_DeriveSubQuery_RoleMappingList(cb - .query());// for saving query-value. - registerDeriveSubQuery(function, cb.query(), "USER_ID", "USER_ID", - subQueryPropertyName, aliasName); + String subQueryPropertyName = keepUserId_DerivedReferrer_RoleMappingList(cb + .query()); // for saving query-value. + registerDerivedReferrerSubQuery(function, cb.query(), "USER_ID", + "USER_ID", subQueryPropertyName, aliasName); } - abstract public String keepUserId_DeriveSubQuery_RoleMappingList( + public abstract String keepUserId_DerivedReferrer_RoleMappingList( RoleMappingCQ subQuery); /** - * IsNull(is null). And OnceRegistered. + * IsNull(is null). And OnlyOnceRegistered. */ public void setUserId_IsNull() { regUserId(CK_ISN, DUMMY_OBJECT); } /** - * IsNotNull(is not null). And OnceRegistered. + * IsNotNull(is not null). And OnlyOnceRegistered. */ public void setUserId_IsNotNull() { regUserId(CK_ISNN, DUMMY_OBJECT); @@ -427,7 +360,7 @@ abstract protected ConditionValue getCValueUserId(); /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {VARCHAR(100)} + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {VARCHAR(100)} * * @param givenName The value of givenName as equal. */ @@ -436,7 +369,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param givenName The value of givenName as notEqual. */ @@ -445,7 +378,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param givenName The value of givenName as greaterThan. */ @@ -454,7 +387,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param givenName The value of givenName as lessThan. */ @@ -463,7 +396,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param givenName The value of givenName as greaterEqual. */ @@ -472,7 +405,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param givenName The value of givenName as lessEqual. */ @@ -481,7 +414,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param givenName The value of givenName as prefixSearch. */ @@ -490,20 +423,6 @@ } /** - * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, - * SeveralRegistered. - * - * @param givenName The value of givenName as likeSearch. - * @param likeSearchOption The option of like-search. (NotNull) - */ - public void setGivenName_LikeSearch( - String givenName, - jp.sf.pal.userinfo.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { - registerLikeSearchQuery(CK_LS, fRES(givenName), getCValueGivenName(), - "GIVEN_NAME", "GivenName", "givenName", likeSearchOption); - } - - /** * InScope(in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * @@ -514,38 +433,52 @@ } /** - * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * - * @param givenName The collection of givenName as inScope. - * @param inScopeOption The option of in-scope. (NotNull) + * @param givenNameList The collection of givenName as notInScope. */ - public void setGivenName_InScope( + public void setGivenName_NotInScope(Collection givenNameList) { + regGivenName(CK_NINS, cTL(givenNameList)); + } + + /** + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param givenName The value of givenName as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) + */ + public void setGivenName_LikeSearch( String givenName, - jp.sf.pal.userinfo.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(givenName), getCValueGivenName(), - "GIVEN_NAME", "GivenName", "givenName", inScopeOption); + jp.sf.pal.userinfo.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(givenName), getCValueGivenName(), "GIVEN_NAME", + "GivenName", "givenName", likeSearchOption); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param givenNameList The collection of givenName as notInScope. + * @param givenName The value of givenName as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setGivenName_NotInScope(Collection givenNameList) { - regGivenName(CK_NINS, cTL(givenNameList)); + public void setGivenName_NotLikeSearch( + String givenName, + jp.sf.pal.userinfo.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(givenName), getCValueGivenName(), "GIVEN_NAME", + "GivenName", "givenName", likeSearchOption); } /** - * IsNull(is null). And OnceRegistered. + * IsNull(is null). And OnlyOnceRegistered. */ public void setGivenName_IsNull() { regGivenName(CK_ISN, DUMMY_OBJECT); } /** - * IsNotNull(is not null). And OnceRegistered. + * IsNotNull(is not null). And OnlyOnceRegistered. */ public void setGivenName_IsNotNull() { regGivenName(CK_ISNN, DUMMY_OBJECT); @@ -564,7 +497,7 @@ abstract protected ConditionValue getCValueGivenName(); /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {VARCHAR(100)} + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {VARCHAR(100)} * * @param familyName The value of familyName as equal. */ @@ -573,7 +506,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param familyName The value of familyName as notEqual. */ @@ -582,7 +515,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param familyName The value of familyName as greaterThan. */ @@ -591,7 +524,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param familyName The value of familyName as lessThan. */ @@ -600,7 +533,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param familyName The value of familyName as greaterEqual. */ @@ -609,7 +542,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param familyName The value of familyName as lessEqual. */ @@ -618,7 +551,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param familyName The value of familyName as prefixSearch. */ @@ -627,20 +560,6 @@ } /** - * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, - * SeveralRegistered. - * - * @param familyName The value of familyName as likeSearch. - * @param likeSearchOption The option of like-search. (NotNull) - */ - public void setFamilyName_LikeSearch( - String familyName, - jp.sf.pal.userinfo.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { - registerLikeSearchQuery(CK_LS, fRES(familyName), getCValueFamilyName(), - "FAMILY_NAME", "FamilyName", "familyName", likeSearchOption); - } - - /** * InScope(in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * @@ -651,38 +570,52 @@ } /** - * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * - * @param familyName The collection of familyName as inScope. - * @param inScopeOption The option of in-scope. (NotNull) + * @param familyNameList The collection of familyName as notInScope. */ - public void setFamilyName_InScope( + public void setFamilyName_NotInScope(Collection familyNameList) { + regFamilyName(CK_NINS, cTL(familyNameList)); + } + + /** + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param familyName The value of familyName as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) + */ + public void setFamilyName_LikeSearch( String familyName, - jp.sf.pal.userinfo.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(familyName), getCValueFamilyName(), - "FAMILY_NAME", "FamilyName", "familyName", inScopeOption); + jp.sf.pal.userinfo.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(familyName), getCValueFamilyName(), "FAMILY_NAME", + "FamilyName", "familyName", likeSearchOption); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param familyNameList The collection of familyName as notInScope. + * @param familyName The value of familyName as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setFamilyName_NotInScope(Collection familyNameList) { - regFamilyName(CK_NINS, cTL(familyNameList)); + public void setFamilyName_NotLikeSearch( + String familyName, + jp.sf.pal.userinfo.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(familyName), getCValueFamilyName(), "FAMILY_NAME", + "FamilyName", "familyName", likeSearchOption); } /** - * IsNull(is null). And OnceRegistered. + * IsNull(is null). And OnlyOnceRegistered. */ public void setFamilyName_IsNull() { regFamilyName(CK_ISN, DUMMY_OBJECT); } /** - * IsNotNull(is not null). And OnceRegistered. + * IsNotNull(is not null). And OnlyOnceRegistered. */ public void setFamilyName_IsNotNull() { regFamilyName(CK_ISNN, DUMMY_OBJECT); @@ -701,7 +634,7 @@ abstract protected ConditionValue getCValueFamilyName(); /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {VARCHAR(50)} + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {VARCHAR(50)} * * @param middleName The value of middleName as equal. */ @@ -710,7 +643,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param middleName The value of middleName as notEqual. */ @@ -719,7 +652,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param middleName The value of middleName as greaterThan. */ @@ -728,7 +661,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param middleName The value of middleName as lessThan. */ @@ -737,7 +670,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param middleName The value of middleName as greaterEqual. */ @@ -746,7 +679,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param middleName The value of middleName as lessEqual. */ @@ -755,7 +688,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param middleName The value of middleName as prefixSearch. */ @@ -764,20 +697,6 @@ } /** - * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, - * SeveralRegistered. - * - * @param middleName The value of middleName as likeSearch. - * @param likeSearchOption The option of like-search. (NotNull) - */ - public void setMiddleName_LikeSearch( - String middleName, - jp.sf.pal.userinfo.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { - registerLikeSearchQuery(CK_LS, fRES(middleName), getCValueMiddleName(), - "MIDDLE_NAME", "MiddleName", "middleName", likeSearchOption); - } - - /** * InScope(in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * @@ -788,38 +707,52 @@ } /** - * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * - * @param middleName The collection of middleName as inScope. - * @param inScopeOption The option of in-scope. (NotNull) + * @param middleNameList The collection of middleName as notInScope. */ - public void setMiddleName_InScope( + public void setMiddleName_NotInScope(Collection middleNameList) { + regMiddleName(CK_NINS, cTL(middleNameList)); + } + + /** + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param middleName The value of middleName as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) + */ + public void setMiddleName_LikeSearch( String middleName, - jp.sf.pal.userinfo.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(middleName), getCValueMiddleName(), - "MIDDLE_NAME", "MiddleName", "middleName", inScopeOption); + jp.sf.pal.userinfo.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(middleName), getCValueMiddleName(), "MIDDLE_NAME", + "MiddleName", "middleName", likeSearchOption); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param middleNameList The collection of middleName as notInScope. + * @param middleName The value of middleName as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setMiddleName_NotInScope(Collection middleNameList) { - regMiddleName(CK_NINS, cTL(middleNameList)); + public void setMiddleName_NotLikeSearch( + String middleName, + jp.sf.pal.userinfo.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(middleName), getCValueMiddleName(), "MIDDLE_NAME", + "MiddleName", "middleName", likeSearchOption); } /** - * IsNull(is null). And OnceRegistered. + * IsNull(is null). And OnlyOnceRegistered. */ public void setMiddleName_IsNull() { regMiddleName(CK_ISN, DUMMY_OBJECT); } /** - * IsNotNull(is not null). And OnceRegistered. + * IsNotNull(is not null). And OnlyOnceRegistered. */ public void setMiddleName_IsNotNull() { regMiddleName(CK_ISNN, DUMMY_OBJECT); @@ -838,7 +771,7 @@ abstract protected ConditionValue getCValueMiddleName(); /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {VARCHAR(100)} + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {VARCHAR(100)} * * @param givenNameDesc The value of givenNameDesc as equal. */ @@ -847,7 +780,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param givenNameDesc The value of givenNameDesc as notEqual. */ @@ -856,7 +789,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param givenNameDesc The value of givenNameDesc as greaterThan. */ @@ -865,7 +798,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param givenNameDesc The value of givenNameDesc as lessThan. */ @@ -874,7 +807,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param givenNameDesc The value of givenNameDesc as greaterEqual. */ @@ -883,7 +816,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param givenNameDesc The value of givenNameDesc as lessEqual. */ @@ -892,7 +825,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param givenNameDesc The value of givenNameDesc as prefixSearch. */ @@ -901,21 +834,6 @@ } /** - * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, - * SeveralRegistered. - * - * @param givenNameDesc The value of givenNameDesc as likeSearch. - * @param likeSearchOption The option of like-search. (NotNull) - */ - public void setGivenNameDesc_LikeSearch( - String givenNameDesc, - jp.sf.pal.userinfo.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { - registerLikeSearchQuery(CK_LS, fRES(givenNameDesc), - getCValueGivenNameDesc(), "GIVEN_NAME_DESC", "GivenNameDesc", - "givenNameDesc", likeSearchOption); - } - - /** * InScope(in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * @@ -926,39 +844,54 @@ } /** - * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * - * @param givenNameDesc The collection of givenNameDesc as inScope. - * @param inScopeOption The option of in-scope. (NotNull) + * @param givenNameDescList The collection of givenNameDesc as notInScope. */ - public void setGivenNameDesc_InScope( + public void setGivenNameDesc_NotInScope(Collection givenNameDescList) { + regGivenNameDesc(CK_NINS, cTL(givenNameDescList)); + } + + /** + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param givenNameDesc The value of givenNameDesc as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) + */ + public void setGivenNameDesc_LikeSearch( String givenNameDesc, - jp.sf.pal.userinfo.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(givenNameDesc), - getCValueGivenNameDesc(), "GIVEN_NAME_DESC", "GivenNameDesc", - "givenNameDesc", inScopeOption); + jp.sf.pal.userinfo.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(givenNameDesc), getCValueGivenNameDesc(), + "GIVEN_NAME_DESC", "GivenNameDesc", "givenNameDesc", + likeSearchOption); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param givenNameDescList The collection of givenNameDesc as notInScope. + * @param givenNameDesc The value of givenNameDesc as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setGivenNameDesc_NotInScope(Collection givenNameDescList) { - regGivenNameDesc(CK_NINS, cTL(givenNameDescList)); + public void setGivenNameDesc_NotLikeSearch( + String givenNameDesc, + jp.sf.pal.userinfo.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(givenNameDesc), getCValueGivenNameDesc(), + "GIVEN_NAME_DESC", "GivenNameDesc", "givenNameDesc", + likeSearchOption); } /** - * IsNull(is null). And OnceRegistered. + * IsNull(is null). And OnlyOnceRegistered. */ public void setGivenNameDesc_IsNull() { regGivenNameDesc(CK_ISN, DUMMY_OBJECT); } /** - * IsNotNull(is not null). And OnceRegistered. + * IsNotNull(is not null). And OnlyOnceRegistered. */ public void setGivenNameDesc_IsNotNull() { regGivenNameDesc(CK_ISNN, DUMMY_OBJECT); @@ -977,7 +910,7 @@ abstract protected ConditionValue getCValueGivenNameDesc(); /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {VARCHAR(100)} + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {VARCHAR(100)} * * @param familyNameDesc The value of familyNameDesc as equal. */ @@ -986,7 +919,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param familyNameDesc The value of familyNameDesc as notEqual. */ @@ -995,7 +928,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param familyNameDesc The value of familyNameDesc as greaterThan. */ @@ -1004,7 +937,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param familyNameDesc The value of familyNameDesc as lessThan. */ @@ -1013,7 +946,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param familyNameDesc The value of familyNameDesc as greaterEqual. */ @@ -1022,7 +955,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param familyNameDesc The value of familyNameDesc as lessEqual. */ @@ -1031,7 +964,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param familyNameDesc The value of familyNameDesc as prefixSearch. */ @@ -1040,21 +973,6 @@ } /** - * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, - * SeveralRegistered. - * - * @param familyNameDesc The value of familyNameDesc as likeSearch. - * @param likeSearchOption The option of like-search. (NotNull) - */ - public void setFamilyNameDesc_LikeSearch( - String familyNameDesc, - jp.sf.pal.userinfo.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { - registerLikeSearchQuery(CK_LS, fRES(familyNameDesc), - getCValueFamilyNameDesc(), "FAMILY_NAME_DESC", - "FamilyNameDesc", "familyNameDesc", likeSearchOption); - } - - /** * InScope(in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * @@ -1065,40 +983,55 @@ } /** - * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * - * @param familyNameDesc The collection of familyNameDesc as inScope. - * @param inScopeOption The option of in-scope. (NotNull) + * @param familyNameDescList The collection of familyNameDesc as notInScope. */ - public void setFamilyNameDesc_InScope( + public void setFamilyNameDesc_NotInScope( + Collection familyNameDescList) { + regFamilyNameDesc(CK_NINS, cTL(familyNameDescList)); + } + + /** + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param familyNameDesc The value of familyNameDesc as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) + */ + public void setFamilyNameDesc_LikeSearch( String familyNameDesc, - jp.sf.pal.userinfo.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(familyNameDesc), - getCValueFamilyNameDesc(), "FAMILY_NAME_DESC", - "FamilyNameDesc", "familyNameDesc", inScopeOption); + jp.sf.pal.userinfo.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(familyNameDesc), getCValueFamilyNameDesc(), + "FAMILY_NAME_DESC", "FamilyNameDesc", "familyNameDesc", + likeSearchOption); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param familyNameDescList The collection of familyNameDesc as notInScope. + * @param familyNameDesc The value of familyNameDesc as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setFamilyNameDesc_NotInScope( - Collection familyNameDescList) { - regFamilyNameDesc(CK_NINS, cTL(familyNameDescList)); + public void setFamilyNameDesc_NotLikeSearch( + String familyNameDesc, + jp.sf.pal.userinfo.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(familyNameDesc), getCValueFamilyNameDesc(), + "FAMILY_NAME_DESC", "FamilyNameDesc", "familyNameDesc", + likeSearchOption); } /** - * IsNull(is null). And OnceRegistered. + * IsNull(is null). And OnlyOnceRegistered. */ public void setFamilyNameDesc_IsNull() { regFamilyNameDesc(CK_ISN, DUMMY_OBJECT); } /** - * IsNotNull(is not null). And OnceRegistered. + * IsNotNull(is not null). And OnlyOnceRegistered. */ public void setFamilyNameDesc_IsNotNull() { regFamilyNameDesc(CK_ISNN, DUMMY_OBJECT); @@ -1117,7 +1050,7 @@ abstract protected ConditionValue getCValueFamilyNameDesc(); /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {VARCHAR(100)} + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {VARCHAR(100)} * * @param nickname The value of nickname as equal. */ @@ -1126,7 +1059,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param nickname The value of nickname as notEqual. */ @@ -1135,7 +1068,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param nickname The value of nickname as greaterThan. */ @@ -1144,7 +1077,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param nickname The value of nickname as lessThan. */ @@ -1153,7 +1086,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param nickname The value of nickname as greaterEqual. */ @@ -1162,7 +1095,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param nickname The value of nickname as lessEqual. */ @@ -1171,7 +1104,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param nickname The value of nickname as prefixSearch. */ @@ -1180,20 +1113,6 @@ } /** - * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, - * SeveralRegistered. - * - * @param nickname The value of nickname as likeSearch. - * @param likeSearchOption The option of like-search. (NotNull) - */ - public void setNickname_LikeSearch( - String nickname, - jp.sf.pal.userinfo.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { - registerLikeSearchQuery(CK_LS, fRES(nickname), getCValueNickname(), - "NICKNAME", "Nickname", "nickname", likeSearchOption); - } - - /** * InScope(in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * @@ -1204,38 +1123,52 @@ } /** - * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * - * @param nickname The collection of nickname as inScope. - * @param inScopeOption The option of in-scope. (NotNull) + * @param nicknameList The collection of nickname as notInScope. */ - public void setNickname_InScope( + public void setNickname_NotInScope(Collection nicknameList) { + regNickname(CK_NINS, cTL(nicknameList)); + } + + /** + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param nickname The value of nickname as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) + */ + public void setNickname_LikeSearch( String nickname, - jp.sf.pal.userinfo.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(nickname), getCValueNickname(), - "NICKNAME", "Nickname", "nickname", inScopeOption); + jp.sf.pal.userinfo.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(nickname), getCValueNickname(), "NICKNAME", + "Nickname", "nickname", likeSearchOption); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param nicknameList The collection of nickname as notInScope. + * @param nickname The value of nickname as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setNickname_NotInScope(Collection nicknameList) { - regNickname(CK_NINS, cTL(nicknameList)); + public void setNickname_NotLikeSearch( + String nickname, + jp.sf.pal.userinfo.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(nickname), getCValueNickname(), "NICKNAME", + "Nickname", "nickname", likeSearchOption); } /** - * IsNull(is null). And OnceRegistered. + * IsNull(is null). And OnlyOnceRegistered. */ public void setNickname_IsNull() { regNickname(CK_ISN, DUMMY_OBJECT); } /** - * IsNotNull(is not null). And OnceRegistered. + * IsNotNull(is not null). And OnlyOnceRegistered. */ public void setNickname_IsNotNull() { regNickname(CK_ISNN, DUMMY_OBJECT); @@ -1254,7 +1187,7 @@ abstract protected ConditionValue getCValueNickname(); /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {VARCHAR(1)} + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {VARCHAR(1)} * * @param gender The value of gender as equal. */ @@ -1263,7 +1196,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param gender The value of gender as notEqual. */ @@ -1272,7 +1205,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param gender The value of gender as greaterThan. */ @@ -1281,7 +1214,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param gender The value of gender as lessThan. */ @@ -1290,7 +1223,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param gender The value of gender as greaterEqual. */ @@ -1299,7 +1232,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param gender The value of gender as lessEqual. */ @@ -1308,7 +1241,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param gender The value of gender as prefixSearch. */ @@ -1317,20 +1250,6 @@ } /** - * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, - * SeveralRegistered. - * - * @param gender The value of gender as likeSearch. - * @param likeSearchOption The option of like-search. (NotNull) - */ - public void setGender_LikeSearch( - String gender, - jp.sf.pal.userinfo.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { - registerLikeSearchQuery(CK_LS, fRES(gender), getCValueGender(), - "GENDER", "Gender", "gender", likeSearchOption); - } - - /** * InScope(in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * @@ -1341,38 +1260,52 @@ } /** - * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * - * @param gender The collection of gender as inScope. - * @param inScopeOption The option of in-scope. (NotNull) + * @param genderList The collection of gender as notInScope. */ - public void setGender_InScope( + public void setGender_NotInScope(Collection genderList) { + regGender(CK_NINS, cTL(genderList)); + } + + /** + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param gender The value of gender as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) + */ + public void setGender_LikeSearch( String gender, - jp.sf.pal.userinfo.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(gender), getCValueGender(), "GENDER", - "Gender", "gender", inScopeOption); + jp.sf.pal.userinfo.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(gender), getCValueGender(), "GENDER", "Gender", + "gender", likeSearchOption); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param genderList The collection of gender as notInScope. + * @param gender The value of gender as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setGender_NotInScope(Collection genderList) { - regGender(CK_NINS, cTL(genderList)); + public void setGender_NotLikeSearch( + String gender, + jp.sf.pal.userinfo.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(gender), getCValueGender(), "GENDER", "Gender", + "gender", likeSearchOption); } /** - * IsNull(is null). And OnceRegistered. + * IsNull(is null). And OnlyOnceRegistered. */ public void setGender_IsNull() { regGender(CK_ISN, DUMMY_OBJECT); } /** - * IsNotNull(is not null). And OnceRegistered. + * IsNotNull(is not null). And OnlyOnceRegistered. */ public void setGender_IsNotNull() { regGender(CK_ISNN, DUMMY_OBJECT); @@ -1391,7 +1324,7 @@ abstract protected ConditionValue getCValueGender(); /** - * Equal(=). And NullIgnored, OnceRegistered. {DATE} + * Equal(=). And NullIgnored, OnlyOnceRegistered. {DATE} * * @param birthDate The value of birthDate as equal. */ @@ -1400,7 +1333,7 @@ } /** - * NotEqual(!=). And NullIgnored, OnceRegistered. + * NotEqual(!=). And NullIgnored, OnlyOnceRegistered. * * @param birthDate The value of birthDate as notEqual. */ @@ -1409,7 +1342,7 @@ } /** - * GreaterThan(>). And NullIgnored, OnceRegistered. + * GreaterThan(>). And NullIgnored, OnlyOnceRegistered. * * @param birthDate The value of birthDate as greaterThan. */ @@ -1418,7 +1351,7 @@ } /** - * LessThan(>). And NullIgnored, OnceRegistered. + * LessThan(>). And NullIgnored, OnlyOnceRegistered. * * @param birthDate The value of birthDate as lessThan. */ @@ -1427,7 +1360,7 @@ } /** - * GreaterEqual(>). And NullIgnored, OnceRegistered. + * GreaterEqual(>). And NullIgnored, OnlyOnceRegistered. * * @param birthDate The value of birthDate as greaterEqual. */ @@ -1436,7 +1369,7 @@ } /** - * LessEqual(>). And NullIgnored, OnceRegistered. + * LessEqual(>). And NullIgnored, OnlyOnceRegistered. * * @param birthDate The value of birthDate as lessEqual. */ @@ -1446,7 +1379,7 @@ /** * FromTo($fromDate <= COLUMN_NAME <= $toDate). And NullIgnored, - * OnceRegistered. {DATE} + * OnlyOnceRegistered. {DATE} * * @param fromDate The from-date of birthDate. (Nullable) * @param toDate The to-date of birthDate. (Nullable) @@ -1462,7 +1395,7 @@ /** * FromTo($fromDate <= COLUMN_NAME < $toDate + 1). And NullIgnored, - * OnceRegistered. {DATE} + * OnlyOnceRegistered. {DATE} * * @param fromDate The from-date of birthDate. (Nullable) * @param toDate The to-date of birthDate. (Nullable) @@ -1476,14 +1409,14 @@ } /** - * IsNull(is null). And OnceRegistered. + * IsNull(is null). And OnlyOnceRegistered. */ public void setBirthDate_IsNull() { regBirthDate(CK_ISN, DUMMY_OBJECT); } /** - * IsNotNull(is not null). And OnceRegistered. + * IsNotNull(is not null). And OnlyOnceRegistered. */ public void setBirthDate_IsNotNull() { regBirthDate(CK_ISNN, DUMMY_OBJECT); @@ -1502,7 +1435,7 @@ abstract protected ConditionValue getCValueBirthDate(); /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {VARCHAR(255)} + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {VARCHAR(255)} * * @param email The value of email as equal. */ @@ -1511,7 +1444,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param email The value of email as notEqual. */ @@ -1520,7 +1453,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param email The value of email as greaterThan. */ @@ -1529,7 +1462,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param email The value of email as lessThan. */ @@ -1538,7 +1471,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param email The value of email as greaterEqual. */ @@ -1547,7 +1480,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param email The value of email as lessEqual. */ @@ -1556,7 +1489,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param email The value of email as prefixSearch. */ @@ -1565,20 +1498,6 @@ } /** - * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, - * SeveralRegistered. - * - * @param email The value of email as likeSearch. - * @param likeSearchOption The option of like-search. (NotNull) - */ - public void setEmail_LikeSearch( - String email, - jp.sf.pal.userinfo.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { - registerLikeSearchQuery(CK_LS, fRES(email), getCValueEmail(), "EMAIL", - "Email", "email", likeSearchOption); - } - - /** * InScope(in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * @@ -1589,38 +1508,52 @@ } /** - * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * - * @param email The collection of email as inScope. - * @param inScopeOption The option of in-scope. (NotNull) + * @param emailList The collection of email as notInScope. */ - public void setEmail_InScope( + public void setEmail_NotInScope(Collection emailList) { + regEmail(CK_NINS, cTL(emailList)); + } + + /** + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param email The value of email as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) + */ + public void setEmail_LikeSearch( String email, - jp.sf.pal.userinfo.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(email), getCValueEmail(), "EMAIL", - "Email", "email", inScopeOption); + jp.sf.pal.userinfo.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(email), getCValueEmail(), "EMAIL", "Email", "email", + likeSearchOption); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param emailList The collection of email as notInScope. + * @param email The value of email as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setEmail_NotInScope(Collection emailList) { - regEmail(CK_NINS, cTL(emailList)); + public void setEmail_NotLikeSearch( + String email, + jp.sf.pal.userinfo.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(email), getCValueEmail(), "EMAIL", "Email", + "email", likeSearchOption); } /** - * IsNull(is null). And OnceRegistered. + * IsNull(is null). And OnlyOnceRegistered. */ public void setEmail_IsNull() { regEmail(CK_ISN, DUMMY_OBJECT); } /** - * IsNotNull(is not null). And OnceRegistered. + * IsNotNull(is not null). And OnlyOnceRegistered. */ public void setEmail_IsNotNull() { regEmail(CK_ISNN, DUMMY_OBJECT); @@ -1638,7 +1571,7 @@ abstract protected ConditionValue getCValueEmail(); /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {VARCHAR(255)} + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {VARCHAR(255)} * * @param url The value of url as equal. */ @@ -1647,7 +1580,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param url The value of url as notEqual. */ @@ -1656,7 +1589,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param url The value of url as greaterThan. */ @@ -1665,7 +1598,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param url The value of url as lessThan. */ @@ -1674,7 +1607,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param url The value of url as greaterEqual. */ @@ -1683,7 +1616,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param url The value of url as lessEqual. */ @@ -1692,7 +1625,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param url The value of url as prefixSearch. */ @@ -1701,20 +1634,6 @@ } /** - * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, - * SeveralRegistered. - * - * @param url The value of url as likeSearch. - * @param likeSearchOption The option of like-search. (NotNull) - */ - public void setUrl_LikeSearch( - String url, - jp.sf.pal.userinfo.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { - registerLikeSearchQuery(CK_LS, fRES(url), getCValueUrl(), "URL", "Url", - "url", likeSearchOption); - } - - /** * InScope(in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * @@ -1725,38 +1644,52 @@ } /** - * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * - * @param url The collection of url as inScope. - * @param inScopeOption The option of in-scope. (NotNull) + * @param urlList The collection of url as notInScope. */ - public void setUrl_InScope( + public void setUrl_NotInScope(Collection urlList) { + regUrl(CK_NINS, cTL(urlList)); + } + + /** + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param url The value of url as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) + */ + public void setUrl_LikeSearch( String url, - jp.sf.pal.userinfo.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(url), getCValueUrl(), "URL", "Url", - "url", inScopeOption); + jp.sf.pal.userinfo.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(url), getCValueUrl(), "URL", "Url", "url", + likeSearchOption); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param urlList The collection of url as notInScope. + * @param url The value of url as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setUrl_NotInScope(Collection urlList) { - regUrl(CK_NINS, cTL(urlList)); + public void setUrl_NotLikeSearch( + String url, + jp.sf.pal.userinfo.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(url), getCValueUrl(), "URL", "Url", "url", + likeSearchOption); } /** - * IsNull(is null). And OnceRegistered. + * IsNull(is null). And OnlyOnceRegistered. */ public void setUrl_IsNull() { regUrl(CK_ISN, DUMMY_OBJECT); } /** - * IsNotNull(is not null). And OnceRegistered. + * IsNotNull(is not null). And OnlyOnceRegistered. */ public void setUrl_IsNotNull() { regUrl(CK_ISNN, DUMMY_OBJECT); @@ -1773,7 +1706,7 @@ abstract protected ConditionValue getCValueUrl(); /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {VARCHAR(40)} + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {VARCHAR(40)} * * @param telephone The value of telephone as equal. */ @@ -1782,7 +1715,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param telephone The value of telephone as notEqual. */ @@ -1791,7 +1724,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param telephone The value of telephone as greaterThan. */ @@ -1800,7 +1733,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param telephone The value of telephone as lessThan. */ @@ -1809,7 +1742,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param telephone The value of telephone as greaterEqual. */ @@ -1818,7 +1751,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param telephone The value of telephone as lessEqual. */ @@ -1827,7 +1760,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param telephone The value of telephone as prefixSearch. */ @@ -1836,20 +1769,6 @@ } /** - * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, - * SeveralRegistered. - * - * @param telephone The value of telephone as likeSearch. - * @param likeSearchOption The option of like-search. (NotNull) - */ - public void setTelephone_LikeSearch( - String telephone, - jp.sf.pal.userinfo.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { - registerLikeSearchQuery(CK_LS, fRES(telephone), getCValueTelephone(), - "TELEPHONE", "Telephone", "telephone", likeSearchOption); - } - - /** * InScope(in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * @@ -1860,38 +1779,52 @@ } /** - * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * - * @param telephone The collection of telephone as inScope. - * @param inScopeOption The option of in-scope. (NotNull) + * @param telephoneList The collection of telephone as notInScope. */ - public void setTelephone_InScope( + public void setTelephone_NotInScope(Collection telephoneList) { + regTelephone(CK_NINS, cTL(telephoneList)); + } + + /** + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param telephone The value of telephone as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) + */ + public void setTelephone_LikeSearch( String telephone, - jp.sf.pal.userinfo.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(telephone), getCValueTelephone(), - "TELEPHONE", "Telephone", "telephone", inScopeOption); + jp.sf.pal.userinfo.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(telephone), getCValueTelephone(), "TELEPHONE", + "Telephone", "telephone", likeSearchOption); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param telephoneList The collection of telephone as notInScope. + * @param telephone The value of telephone as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setTelephone_NotInScope(Collection telephoneList) { - regTelephone(CK_NINS, cTL(telephoneList)); + public void setTelephone_NotLikeSearch( + String telephone, + jp.sf.pal.userinfo.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(telephone), getCValueTelephone(), "TELEPHONE", + "Telephone", "telephone", likeSearchOption); } /** - * IsNull(is null). And OnceRegistered. + * IsNull(is null). And OnlyOnceRegistered. */ public void setTelephone_IsNull() { regTelephone(CK_ISN, DUMMY_OBJECT); } /** - * IsNotNull(is not null). And OnceRegistered. + * IsNotNull(is not null). And OnlyOnceRegistered. */ public void setTelephone_IsNotNull() { regTelephone(CK_ISNN, DUMMY_OBJECT); @@ -1910,7 +1843,7 @@ abstract protected ConditionValue getCValueTelephone(); /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {VARCHAR(5)} + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {VARCHAR(5)} * * @param locale The value of locale as equal. */ @@ -1919,7 +1852,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param locale The value of locale as notEqual. */ @@ -1928,7 +1861,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param locale The value of locale as greaterThan. */ @@ -1937,7 +1870,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param locale The value of locale as lessThan. */ @@ -1946,7 +1879,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param locale The value of locale as greaterEqual. */ @@ -1955,7 +1888,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param locale The value of locale as lessEqual. */ @@ -1964,7 +1897,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param locale The value of locale as prefixSearch. */ @@ -1973,20 +1906,6 @@ } /** - * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, - * SeveralRegistered. - * - * @param locale The value of locale as likeSearch. - * @param likeSearchOption The option of like-search. (NotNull) - */ - public void setLocale_LikeSearch( - String locale, - jp.sf.pal.userinfo.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { - registerLikeSearchQuery(CK_LS, fRES(locale), getCValueLocale(), - "LOCALE", "Locale", "locale", likeSearchOption); - } - - /** * InScope(in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * @@ -1997,38 +1916,52 @@ } /** - * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * - * @param locale The collection of locale as inScope. - * @param inScopeOption The option of in-scope. (NotNull) + * @param localeList The collection of locale as notInScope. */ - public void setLocale_InScope( + public void setLocale_NotInScope(Collection localeList) { + regLocale(CK_NINS, cTL(localeList)); + } + + /** + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param locale The value of locale as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) + */ + public void setLocale_LikeSearch( String locale, - jp.sf.pal.userinfo.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(locale), getCValueLocale(), "LOCALE", - "Locale", "locale", inScopeOption); + jp.sf.pal.userinfo.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(locale), getCValueLocale(), "LOCALE", "Locale", + "locale", likeSearchOption); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param localeList The collection of locale as notInScope. + * @param locale The value of locale as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setLocale_NotInScope(Collection localeList) { - regLocale(CK_NINS, cTL(localeList)); + public void setLocale_NotLikeSearch( + String locale, + jp.sf.pal.userinfo.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(locale), getCValueLocale(), "LOCALE", "Locale", + "locale", likeSearchOption); } /** - * IsNull(is null). And OnceRegistered. + * IsNull(is null). And OnlyOnceRegistered. */ public void setLocale_IsNull() { regLocale(CK_ISN, DUMMY_OBJECT); } /** - * IsNotNull(is not null). And OnceRegistered. + * IsNotNull(is not null). And OnlyOnceRegistered. */ public void setLocale_IsNotNull() { regLocale(CK_ISNN, DUMMY_OBJECT); @@ -2047,8 +1980,8 @@ abstract protected ConditionValue getCValueLocale(); /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {VARCHAR(255) : FK to - * ROLE_INFO} + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {VARCHAR(255) : FK + * to ROLE_INFO} * * @param roleId The value of roleId as equal. */ @@ -2057,7 +1990,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param roleId The value of roleId as notEqual. */ @@ -2066,7 +1999,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param roleId The value of roleId as greaterThan. */ @@ -2075,7 +2008,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param roleId The value of roleId as lessThan. */ @@ -2084,7 +2017,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param roleId The value of roleId as greaterEqual. */ @@ -2093,7 +2026,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param roleId The value of roleId as lessEqual. */ @@ -2102,7 +2035,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param roleId The value of roleId as prefixSearch. */ @@ -2111,20 +2044,6 @@ } /** - * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, - * SeveralRegistered. - * - * @param roleId The value of roleId as likeSearch. - * @param likeSearchOption The option of like-search. (NotNull) - */ - public void setRoleId_LikeSearch( - String roleId, - jp.sf.pal.userinfo.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. * @@ -2135,42 +2054,41 @@ } /** - * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * - * @param roleId The collection of roleId as inScope. - * @param inScopeOption The option of in-scope. (NotNull) + * @param roleIdList The collection of roleId as notInScope. */ - public void setRoleId_InScope( - String roleId, - jp.sf.pal.userinfo.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(roleId), getCValueRoleId(), - "ROLE_ID", "RoleId", "roleId", inScopeOption); + public void setRoleId_NotInScope(Collection roleIdList) { + regRoleId(CK_NINS, cTL(roleIdList)); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param roleIdList The collection of roleId as notInScope. + * @param roleId The value of roleId as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) */ - public void setRoleId_NotInScope(Collection roleIdList) { - regRoleId(CK_NINS, cTL(roleIdList)); + public void setRoleId_LikeSearch( + String roleId, + jp.sf.pal.userinfo.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(roleId), getCValueRoleId(), "ROLE_ID", "RoleId", + "roleId", likeSearchOption); } /** - * @param roleInfoCBquery Query. - * @deprecated Please use inScopeRoleInfo(subQuery) method. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param roleId The value of roleId as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setRoleId_InScopeSubQuery_RoleInfo(RoleInfoCQ roleInfoCBquery) { - String subQueryPropertyName = keepRoleId_InScopeSubQuery_RoleInfo(roleInfoCBquery);// for - // saving - // query - // - - // value - // . - registerInScopeSubQuery(roleInfoCBquery, "ROLE_ID", "ROLE_ID", - subQueryPropertyName); + public void setRoleId_NotLikeSearch( + String roleId, + jp.sf.pal.userinfo.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(roleId), getCValueRoleId(), "ROLE_ID", "RoleId", + "roleId", likeSearchOption); } public void inScopeRoleInfo(SubQuery subQuery) { @@ -2179,23 +2097,23 @@ cb.xsetupForInScopeSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepRoleId_InScopeSubQuery_RoleInfo(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerInScopeSubQuery(cb.query(), "ROLE_ID", "ROLE_ID", subQueryPropertyName); } - abstract public String keepRoleId_InScopeSubQuery_RoleInfo( + public abstract String keepRoleId_InScopeSubQuery_RoleInfo( jp.sf.pal.userinfo.db.cbean.cq.RoleInfoCQ subQuery); /** - * IsNull(is null). And OnceRegistered. + * IsNull(is null). And OnlyOnceRegistered. */ public void setRoleId_IsNull() { regRoleId(CK_ISN, DUMMY_OBJECT); } /** - * IsNotNull(is not null). And OnceRegistered. + * IsNotNull(is not null). And OnlyOnceRegistered. */ public void setRoleId_IsNotNull() { regRoleId(CK_ISNN, DUMMY_OBJECT); @@ -2214,8 +2132,8 @@ abstract protected ConditionValue getCValueRoleId(); /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {VARCHAR(255) : FK to - * GROUP_INFO} + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {VARCHAR(255) : FK + * to GROUP_INFO} * * @param groupId The value of groupId as equal. */ @@ -2224,7 +2142,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param groupId The value of groupId as notEqual. */ @@ -2233,7 +2151,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param groupId The value of groupId as greaterThan. */ @@ -2242,7 +2160,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param groupId The value of groupId as lessThan. */ @@ -2251,7 +2169,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param groupId The value of groupId as greaterEqual. */ @@ -2260,7 +2178,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param groupId The value of groupId as lessEqual. */ @@ -2269,7 +2187,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param groupId The value of groupId as prefixSearch. */ @@ -2278,20 +2196,6 @@ } /** - * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, - * SeveralRegistered. - * - * @param groupId The value of groupId as likeSearch. - * @param likeSearchOption The option of like-search. (NotNull) - */ - public void setGroupId_LikeSearch( - String groupId, - jp.sf.pal.userinfo.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. * @@ -2302,43 +2206,41 @@ } /** - * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * - * @param groupId The collection of groupId as inScope. - * @param inScopeOption The option of in-scope. (NotNull) + * @param groupIdList The collection of groupId as notInScope. */ - public void setGroupId_InScope( - String groupId, - jp.sf.pal.userinfo.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(groupId), getCValueGroupId(), - "GROUP_ID", "GroupId", "groupId", inScopeOption); + public void setGroupId_NotInScope(Collection groupIdList) { + regGroupId(CK_NINS, cTL(groupIdList)); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param groupIdList The collection of groupId as notInScope. + * @param groupId The value of groupId as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) */ - public void setGroupId_NotInScope(Collection groupIdList) { - regGroupId(CK_NINS, cTL(groupIdList)); + public void setGroupId_LikeSearch( + String groupId, + jp.sf.pal.userinfo.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(groupId), getCValueGroupId(), "GROUP_ID", "GroupId", + "groupId", likeSearchOption); } /** - * @param groupInfoCBquery Query. - * @deprecated Please use inScopeGroupInfo(subQuery) method. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param groupId The value of groupId as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setGroupId_InScopeSubQuery_GroupInfo( - GroupInfoCQ groupInfoCBquery) { - String subQueryPropertyName = keepGroupId_InScopeSubQuery_GroupInfo(groupInfoCBquery);// for - // saving - // query - // - - // value - // . - registerInScopeSubQuery(groupInfoCBquery, "GROUP_ID", "GROUP_ID", - subQueryPropertyName); + public void setGroupId_NotLikeSearch( + String groupId, + jp.sf.pal.userinfo.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(groupId), getCValueGroupId(), "GROUP_ID", + "GroupId", "groupId", likeSearchOption); } public void inScopeGroupInfo(SubQuery subQuery) { @@ -2347,23 +2249,23 @@ cb.xsetupForInScopeSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepGroupId_InScopeSubQuery_GroupInfo(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerInScopeSubQuery(cb.query(), "GROUP_ID", "GROUP_ID", subQueryPropertyName); } - abstract public String keepGroupId_InScopeSubQuery_GroupInfo( + public abstract String keepGroupId_InScopeSubQuery_GroupInfo( jp.sf.pal.userinfo.db.cbean.cq.GroupInfoCQ subQuery); /** - * IsNull(is null). And OnceRegistered. + * IsNull(is null). And OnlyOnceRegistered. */ public void setGroupId_IsNull() { regGroupId(CK_ISN, DUMMY_OBJECT); } /** - * IsNotNull(is not null). And OnceRegistered. + * IsNotNull(is not null). And OnlyOnceRegistered. */ public void setGroupId_IsNotNull() { regGroupId(CK_ISNN, DUMMY_OBJECT); @@ -2382,8 +2284,145 @@ abstract protected ConditionValue getCValueGroupId(); /** - * Equal(=). And NullIgnored, OnceRegistered. {NotNull : TIMESTAMP} + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {VARCHAR(1)} * + * @param status The value of status as equal. + */ + public void setStatus_Equal(String status) { + regStatus(CK_EQ, fRES(status)); + } + + /** + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. + * + * @param status The value of status as notEqual. + */ + public void setStatus_NotEqual(String status) { + regStatus(CK_NE, fRES(status)); + } + + /** + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. + * + * @param status The value of status as greaterThan. + */ + public void setStatus_GreaterThan(String status) { + regStatus(CK_GT, fRES(status)); + } + + /** + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. + * + * @param status The value of status as lessThan. + */ + public void setStatus_LessThan(String status) { + regStatus(CK_LT, fRES(status)); + } + + /** + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. + * + * @param status The value of status as greaterEqual. + */ + public void setStatus_GreaterEqual(String status) { + regStatus(CK_GE, fRES(status)); + } + + /** + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. + * + * @param status The value of status as lessEqual. + */ + public void setStatus_LessEqual(String status) { + regStatus(CK_LE, fRES(status)); + } + + /** + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. + * + * @param status The value of status as prefixSearch. + */ + public void setStatus_PrefixSearch(String status) { + regStatus(CK_PS, fRES(status)); + } + + /** + * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NullOrEmptyElementIgnored, SeveralRegistered. + * + * @param statusList The collection of status as inScope. + */ + public void setStatus_InScope(Collection statusList) { + regStatus(CK_INS, cTL(statusList)); + } + + /** + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, + * NullOrEmptyElementIgnored, SeveralRegistered. + * + * @param statusList The collection of status as notInScope. + */ + public void setStatus_NotInScope(Collection statusList) { + regStatus(CK_NINS, cTL(statusList)); + } + + /** + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param status The value of status as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) + */ + public void setStatus_LikeSearch( + String status, + jp.sf.pal.userinfo.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(status), getCValueStatus(), "STATUS", "Status", + "status", likeSearchOption); + } + + /** + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param status The value of status as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) + */ + public void setStatus_NotLikeSearch( + String status, + jp.sf.pal.userinfo.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(status), getCValueStatus(), "STATUS", "Status", + "status", likeSearchOption); + } + + /** + * IsNull(is null). And OnlyOnceRegistered. + */ + public void setStatus_IsNull() { + regStatus(CK_ISN, DUMMY_OBJECT); + } + + /** + * IsNotNull(is not null). And OnlyOnceRegistered. + */ + public void setStatus_IsNotNull() { + regStatus(CK_ISNN, DUMMY_OBJECT); + } + + protected void regStatus(ConditionKey key, Object value) { + registerQuery(key, value, getCValueStatus(), "STATUS", "Status", + "status"); + } + + protected void registerInlineStatus(ConditionKey key, Object value) { + registerInlineQuery(key, value, getCValueStatus(), "STATUS", "Status", + "status"); + } + + abstract protected ConditionValue getCValueStatus(); + + /** + * Equal(=). And NullIgnored, OnlyOnceRegistered. {NotNull : TIMESTAMP} + * * @param createdTime The value of createdTime as equal. */ public void setCreatedTime_Equal(java.sql.Timestamp createdTime) { @@ -2391,7 +2430,7 @@ } /** - * NotEqual(!=). And NullIgnored, OnceRegistered. + * NotEqual(!=). And NullIgnored, OnlyOnceRegistered. * * @param createdTime The value of createdTime as notEqual. */ @@ -2400,7 +2439,7 @@ } /** - * GreaterThan(>). And NullIgnored, OnceRegistered. + * GreaterThan(>). And NullIgnored, OnlyOnceRegistered. * * @param createdTime The value of createdTime as greaterThan. */ @@ -2409,7 +2448,7 @@ } /** - * LessThan(>). And NullIgnored, OnceRegistered. + * LessThan(>). And NullIgnored, OnlyOnceRegistered. * * @param createdTime The value of createdTime as lessThan. */ @@ -2418,7 +2457,7 @@ } /** - * GreaterEqual(>). And NullIgnored, OnceRegistered. + * GreaterEqual(>). And NullIgnored, OnlyOnceRegistered. * * @param createdTime The value of createdTime as greaterEqual. */ @@ -2427,7 +2466,7 @@ } /** - * LessEqual(>). And NullIgnored, OnceRegistered. + * LessEqual(>). And NullIgnored, OnlyOnceRegistered. * * @param createdTime The value of createdTime as lessEqual. */ @@ -2437,7 +2476,7 @@ /** * FromTo($fromDate <= COLUMN_NAME <= $toDate). And NullIgnored, - * OnceRegistered. {NotNull : TIMESTAMP} + * OnlyOnceRegistered. {NotNull : TIMESTAMP} * * @param fromDate The from-date of createdTime. (Nullable) * @param toDate The to-date of createdTime. (Nullable) @@ -2455,7 +2494,7 @@ /** * FromTo($fromDate <= COLUMN_NAME < $toDate + 1). And NullIgnored, - * OnceRegistered. {NotNull : TIMESTAMP} + * OnlyOnceRegistered. {NotNull : TIMESTAMP} * * @param fromDate The from-date of createdTime. (Nullable) * @param toDate The to-date of createdTime. (Nullable) @@ -2481,7 +2520,7 @@ abstract protected ConditionValue getCValueCreatedTime(); /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {NotNull : + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {NotNull : * VARCHAR(255)} * * @param createdBy The value of createdBy as equal. @@ -2491,7 +2530,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param createdBy The value of createdBy as notEqual. */ @@ -2500,7 +2539,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param createdBy The value of createdBy as greaterThan. */ @@ -2509,7 +2548,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param createdBy The value of createdBy as lessThan. */ @@ -2518,7 +2557,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param createdBy The value of createdBy as greaterEqual. */ @@ -2527,7 +2566,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param createdBy The value of createdBy as lessEqual. */ @@ -2536,7 +2575,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param createdBy The value of createdBy as prefixSearch. */ @@ -2545,20 +2584,6 @@ } /** - * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, - * SeveralRegistered. - * - * @param createdBy The value of createdBy as likeSearch. - * @param likeSearchOption The option of like-search. (NotNull) - */ - public void setCreatedBy_LikeSearch( - String createdBy, - jp.sf.pal.userinfo.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. * @@ -2569,27 +2594,41 @@ } /** - * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * - * @param createdBy The collection of createdBy as inScope. - * @param inScopeOption The option of in-scope. (NotNull) + * @param createdByList The collection of createdBy as notInScope. */ - public void setCreatedBy_InScope( + public void setCreatedBy_NotInScope(Collection createdByList) { + regCreatedBy(CK_NINS, cTL(createdByList)); + } + + /** + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param createdBy The value of createdBy as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) + */ + public void setCreatedBy_LikeSearch( String createdBy, - jp.sf.pal.userinfo.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(createdBy), getCValueCreatedBy(), - "CREATED_BY", "CreatedBy", "createdBy", inScopeOption); + jp.sf.pal.userinfo.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(createdBy), getCValueCreatedBy(), "CREATED_BY", + "CreatedBy", "createdBy", likeSearchOption); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param createdByList The collection of createdBy as notInScope. + * @param createdBy The value of createdBy as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setCreatedBy_NotInScope(Collection createdByList) { - regCreatedBy(CK_NINS, cTL(createdByList)); + public void setCreatedBy_NotLikeSearch( + String createdBy, + jp.sf.pal.userinfo.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(createdBy), getCValueCreatedBy(), "CREATED_BY", + "CreatedBy", "createdBy", likeSearchOption); } protected void regCreatedBy(ConditionKey key, Object value) { @@ -2605,7 +2644,7 @@ abstract protected ConditionValue getCValueCreatedBy(); /** - * Equal(=). And NullIgnored, OnceRegistered. {NotNull : TIMESTAMP} + * Equal(=). And NullIgnored, OnlyOnceRegistered. {NotNull : TIMESTAMP} * * @param updatedTime The value of updatedTime as equal. */ @@ -2614,7 +2653,7 @@ } /** - * NotEqual(!=). And NullIgnored, OnceRegistered. + * NotEqual(!=). And NullIgnored, OnlyOnceRegistered. * * @param updatedTime The value of updatedTime as notEqual. */ @@ -2623,7 +2662,7 @@ } /** - * GreaterThan(>). And NullIgnored, OnceRegistered. + * GreaterThan(>). And NullIgnored, OnlyOnceRegistered. * * @param updatedTime The value of updatedTime as greaterThan. */ @@ -2632,7 +2671,7 @@ } /** - * LessThan(>). And NullIgnored, OnceRegistered. + * LessThan(>). And NullIgnored, OnlyOnceRegistered. * * @param updatedTime The value of updatedTime as lessThan. */ @@ -2641,7 +2680,7 @@ } /** - * GreaterEqual(>). And NullIgnored, OnceRegistered. + * GreaterEqual(>). And NullIgnored, OnlyOnceRegistered. * * @param updatedTime The value of updatedTime as greaterEqual. */ @@ -2650,7 +2689,7 @@ } /** - * LessEqual(>). And NullIgnored, OnceRegistered. + * LessEqual(>). And NullIgnored, OnlyOnceRegistered. * * @param updatedTime The value of updatedTime as lessEqual. */ @@ -2660,7 +2699,7 @@ /** * FromTo($fromDate <= COLUMN_NAME <= $toDate). And NullIgnored, - * OnceRegistered. {NotNull : TIMESTAMP} + * OnlyOnceRegistered. {NotNull : TIMESTAMP} * * @param fromDate The from-date of updatedTime. (Nullable) * @param toDate The to-date of updatedTime. (Nullable) @@ -2678,7 +2717,7 @@ /** * FromTo($fromDate <= COLUMN_NAME < $toDate + 1). And NullIgnored, - * OnceRegistered. {NotNull : TIMESTAMP} + * OnlyOnceRegistered. {NotNull : TIMESTAMP} * * @param fromDate The from-date of updatedTime. (Nullable) * @param toDate The to-date of updatedTime. (Nullable) @@ -2704,7 +2743,7 @@ abstract protected ConditionValue getCValueUpdatedTime(); /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {NotNull : + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {NotNull : * VARCHAR(255)} * * @param updatedBy The value of updatedBy as equal. @@ -2714,7 +2753,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param updatedBy The value of updatedBy as notEqual. */ @@ -2723,7 +2762,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param updatedBy The value of updatedBy as greaterThan. */ @@ -2732,7 +2771,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param updatedBy The value of updatedBy as lessThan. */ @@ -2741,7 +2780,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param updatedBy The value of updatedBy as greaterEqual. */ @@ -2750,7 +2789,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param updatedBy The value of updatedBy as lessEqual. */ @@ -2759,7 +2798,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param updatedBy The value of updatedBy as prefixSearch. */ @@ -2768,20 +2807,6 @@ } /** - * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, - * SeveralRegistered. - * - * @param updatedBy The value of updatedBy as likeSearch. - * @param likeSearchOption The option of like-search. (NotNull) - */ - public void setUpdatedBy_LikeSearch( - String updatedBy, - jp.sf.pal.userinfo.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. * @@ -2792,27 +2817,41 @@ } /** - * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * - * @param updatedBy The collection of updatedBy as inScope. - * @param inScopeOption The option of in-scope. (NotNull) + * @param updatedByList The collection of updatedBy as notInScope. */ - public void setUpdatedBy_InScope( + public void setUpdatedBy_NotInScope(Collection updatedByList) { + regUpdatedBy(CK_NINS, cTL(updatedByList)); + } + + /** + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param updatedBy The value of updatedBy as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) + */ + public void setUpdatedBy_LikeSearch( String updatedBy, - jp.sf.pal.userinfo.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(updatedBy), getCValueUpdatedBy(), - "UPDATED_BY", "UpdatedBy", "updatedBy", inScopeOption); + jp.sf.pal.userinfo.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(updatedBy), getCValueUpdatedBy(), "UPDATED_BY", + "UpdatedBy", "updatedBy", likeSearchOption); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param updatedByList The collection of updatedBy as notInScope. + * @param updatedBy The value of updatedBy as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setUpdatedBy_NotInScope(Collection updatedByList) { - regUpdatedBy(CK_NINS, cTL(updatedByList)); + public void setUpdatedBy_NotLikeSearch( + String updatedBy, + jp.sf.pal.userinfo.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(updatedBy), getCValueUpdatedBy(), "UPDATED_BY", + "UpdatedBy", "updatedBy", likeSearchOption); } protected void regUpdatedBy(ConditionKey key, Object value) { @@ -2828,7 +2867,7 @@ abstract protected ConditionValue getCValueUpdatedBy(); /** - * Equal(=). And NullIgnored, OnceRegistered. {TIMESTAMP} + * Equal(=). And NullIgnored, OnlyOnceRegistered. {TIMESTAMP} * * @param deletedTime The value of deletedTime as equal. */ @@ -2837,7 +2876,7 @@ } /** - * NotEqual(!=). And NullIgnored, OnceRegistered. + * NotEqual(!=). And NullIgnored, OnlyOnceRegistered. * * @param deletedTime The value of deletedTime as notEqual. */ @@ -2846,7 +2885,7 @@ } /** - * GreaterThan(>). And NullIgnored, OnceRegistered. + * GreaterThan(>). And NullIgnored, OnlyOnceRegistered. * * @param deletedTime The value of deletedTime as greaterThan. */ @@ -2855,7 +2894,7 @@ } /** - * LessThan(>). And NullIgnored, OnceRegistered. + * LessThan(>). And NullIgnored, OnlyOnceRegistered. * * @param deletedTime The value of deletedTime as lessThan. */ @@ -2864,7 +2903,7 @@ } /** - * GreaterEqual(>). And NullIgnored, OnceRegistered. + * GreaterEqual(>). And NullIgnored, OnlyOnceRegistered. * * @param deletedTime The value of deletedTime as greaterEqual. */ @@ -2873,7 +2912,7 @@ } /** - * LessEqual(>). And NullIgnored, OnceRegistered. + * LessEqual(>). And NullIgnored, OnlyOnceRegistered. * * @param deletedTime The value of deletedTime as lessEqual. */ @@ -2883,7 +2922,7 @@ /** * FromTo($fromDate <= COLUMN_NAME <= $toDate). And NullIgnored, - * OnceRegistered. {TIMESTAMP} + * OnlyOnceRegistered. {TIMESTAMP} * * @param fromDate The from-date of deletedTime. (Nullable) * @param toDate The to-date of deletedTime. (Nullable) @@ -2901,7 +2940,7 @@ /** * FromTo($fromDate <= COLUMN_NAME < $toDate + 1). And NullIgnored, - * OnceRegistered. {TIMESTAMP} + * OnlyOnceRegistered. {TIMESTAMP} * * @param fromDate The from-date of deletedTime. (Nullable) * @param toDate The to-date of deletedTime. (Nullable) @@ -2915,14 +2954,14 @@ } /** - * IsNull(is null). And OnceRegistered. + * IsNull(is null). And OnlyOnceRegistered. */ public void setDeletedTime_IsNull() { regDeletedTime(CK_ISN, DUMMY_OBJECT); } /** - * IsNotNull(is not null). And OnceRegistered. + * IsNotNull(is not null). And OnlyOnceRegistered. */ public void setDeletedTime_IsNotNull() { regDeletedTime(CK_ISNN, DUMMY_OBJECT); @@ -2941,7 +2980,7 @@ abstract protected ConditionValue getCValueDeletedTime(); /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {VARCHAR(255)} + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {VARCHAR(255)} * * @param deletedBy The value of deletedBy as equal. */ @@ -2950,7 +2989,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param deletedBy The value of deletedBy as notEqual. */ @@ -2959,7 +2998,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param deletedBy The value of deletedBy as greaterThan. */ @@ -2968,7 +3007,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param deletedBy The value of deletedBy as lessThan. */ @@ -2977,7 +3016,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param deletedBy The value of deletedBy as greaterEqual. */ @@ -2986,7 +3025,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param deletedBy The value of deletedBy as lessEqual. */ @@ -2995,7 +3034,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param deletedBy The value of deletedBy as prefixSearch. */ @@ -3004,20 +3043,6 @@ } /** - * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, - * SeveralRegistered. - * - * @param deletedBy The value of deletedBy as likeSearch. - * @param likeSearchOption The option of like-search. (NotNull) - */ - public void setDeletedBy_LikeSearch( - String deletedBy, - jp.sf.pal.userinfo.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. * @@ -3028,38 +3053,52 @@ } /** - * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * - * @param deletedBy The collection of deletedBy as inScope. - * @param inScopeOption The option of in-scope. (NotNull) + * @param deletedByList The collection of deletedBy as notInScope. */ - public void setDeletedBy_InScope( + public void setDeletedBy_NotInScope(Collection deletedByList) { + regDeletedBy(CK_NINS, cTL(deletedByList)); + } + + /** + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param deletedBy The value of deletedBy as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) + */ + public void setDeletedBy_LikeSearch( String deletedBy, - jp.sf.pal.userinfo.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(deletedBy), getCValueDeletedBy(), - "DELETED_BY", "DeletedBy", "deletedBy", inScopeOption); + jp.sf.pal.userinfo.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(deletedBy), getCValueDeletedBy(), "DELETED_BY", + "DeletedBy", "deletedBy", likeSearchOption); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param deletedByList The collection of deletedBy as notInScope. + * @param deletedBy The value of deletedBy as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setDeletedBy_NotInScope(Collection deletedByList) { - regDeletedBy(CK_NINS, cTL(deletedByList)); + public void setDeletedBy_NotLikeSearch( + String deletedBy, + jp.sf.pal.userinfo.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(deletedBy), getCValueDeletedBy(), "DELETED_BY", + "DeletedBy", "deletedBy", likeSearchOption); } /** - * IsNull(is null). And OnceRegistered. + * IsNull(is null). And OnlyOnceRegistered. */ public void setDeletedBy_IsNull() { regDeletedBy(CK_ISN, DUMMY_OBJECT); } /** - * IsNotNull(is not null). And OnceRegistered. + * IsNotNull(is not null). And OnlyOnceRegistered. */ public void setDeletedBy_IsNotNull() { regDeletedBy(CK_ISNN, DUMMY_OBJECT); @@ -3078,7 +3117,7 @@ abstract protected ConditionValue getCValueDeletedBy(); /** - * Equal(=). And NullIgnored, OnceRegistered. {NotNull : INTEGER} + * Equal(=). And NullIgnored, OnlyOnceRegistered. {NotNull : INTEGER} * * @param versionno The value of versionno as equal. */ @@ -3087,7 +3126,7 @@ } /** - * NotEqual(!=). And NullIgnored, OnceRegistered. + * NotEqual(!=). And NullIgnored, OnlyOnceRegistered. * * @param versionno The value of versionno as notEqual. */ @@ -3096,7 +3135,7 @@ } /** - * GreaterThan(>). And NullIgnored, OnceRegistered. + * GreaterThan(>). And NullIgnored, OnlyOnceRegistered. * * @param versionno The value of versionno as greaterThan. */ @@ -3105,7 +3144,7 @@ } /** - * LessThan(<). And NullIgnored, OnceRegistered. + * LessThan(<). And NullIgnored, OnlyOnceRegistered. * * @param versionno The value of versionno as lessThan. */ @@ -3114,7 +3153,7 @@ } /** - * GreaterEqual(>=). And NullIgnored, OnceRegistered. + * GreaterEqual(>=). And NullIgnored, OnlyOnceRegistered. * * @param versionno The value of versionno as greaterEqual. */ @@ -3123,7 +3162,7 @@ } /** - * LessEqual(<=). And NullIgnored, OnceRegistered. + * LessEqual(<=). And NullIgnored, OnlyOnceRegistered. * * @param versionno The value of versionno as lessEqual. */ @@ -3163,6 +3202,50 @@ abstract protected ConditionValue getCValueVersionno(); + public SSQFunction scalar_Equal() { + return xcreateSSQFunction("="); + } + + public SSQFunction scalar_GreaterEqual() { + return xcreateSSQFunction(">="); + } + + public SSQFunction scalar_GreaterThan() { + return xcreateSSQFunction(">"); + } + + public SSQFunction scalar_LessEqual() { + return xcreateSSQFunction("<="); + } + + public SSQFunction scalar_LessThan() { + return xcreateSSQFunction("<"); + } + + protected SSQFunction xcreateSSQFunction(final String operand) { + return new SSQFunction(new SSQSetupper() { + public void setup(String function, SubQuery subQuery) { + xscalarSubQuery(function, subQuery, operand); + } + }); + } + + protected void xscalarSubQuery(String function, + SubQuery subQuery, String operand) { + assertObjectNotNull("subQuery", subQuery); + UserInfoCB cb = new UserInfoCB(); + cb.xsetupForScalarSubQuery(); + subQuery.query(cb); + String subQueryPropertyName = keepScalarSubQuery(cb.query()); // for + // saving + // query + // -value. + registerScalarSubQuery(function, cb.query(), subQueryPropertyName, + operand); + } + + public abstract String keepScalarSubQuery(UserInfoCQ subQuery); + // Very Internal (for Suppressing Warn about 'Not Use Import') protected String getConditionBeanClassNameInternally() { return UserInfoCB.class.getName(); Modified: userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/cbean/cq/bs/BsGroupInfoCQ.java =================================================================== --- userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/cbean/cq/bs/BsGroupInfoCQ.java 2008-12-26 22:11:31 UTC (rev 1622) +++ userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/cbean/cq/bs/BsGroupInfoCQ.java 2008-12-27 22:02:56 UTC (rev 1623) @@ -5,6 +5,7 @@ import jp.sf.pal.userinfo.db.allcommon.cbean.ConditionQuery; import jp.sf.pal.userinfo.db.allcommon.cbean.cvalue.ConditionValue; import jp.sf.pal.userinfo.db.allcommon.cbean.sqlclause.SqlClause; +import jp.sf.pal.userinfo.db.cbean.GroupInfoCB; import jp.sf.pal.userinfo.db.cbean.cq.GroupInfoCQ; import jp.sf.pal.userinfo.db.cbean.cq.GroupMappingCQ; import jp.sf.pal.userinfo.db.cbean.cq.UserInfoCQ; @@ -15,7 +16,6 @@ * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public class BsGroupInfoCQ extends AbstractBsGroupInfoCQ { //========================================================================== @@ -61,7 +61,7 @@ public GroupInfoCIQ on() { if (isBaseQuery(this)) { throw new UnsupportedOperationException( - "Unsupported onClause of Base Table!"); + "Unsupported on-clause for local table!"); } GroupInfoCIQ inlineQuery = inline(); inlineQuery.xsetOnClauseInline(true); @@ -219,37 +219,37 @@ return "groupId_NotExistsSubQuery_UserInfoList." + key; } - protected Map _groupId_DeriveSubQuery_GroupMappingListMap; + protected Map _groupId_DerivedReferrer_GroupMappingListMap; - public Map getGroupId_DeriveSubQuery_GroupMappingList() { - return _groupId_DeriveSubQuery_GroupMappingListMap; + public Map getGroupId_DerivedReferrer_GroupMappingList() { + return _groupId_DerivedReferrer_GroupMappingListMap; } - public String keepGroupId_DeriveSubQuery_GroupMappingList( + public String keepGroupId_DerivedReferrer_GroupMappingList( GroupMappingCQ subQuery) { - if (_groupId_DeriveSubQuery_GroupMappingListMap == null) { - _groupId_DeriveSubQuery_GroupMappingListMap = newLinkedHashMap(); + if (_groupId_DerivedReferrer_GroupMappingListMap == null) { + _groupId_DerivedReferrer_GroupMappingListMap = newLinkedHashMap(); } String key = "subQueryMapKey" - + (_groupId_DeriveSubQuery_GroupMappingListMap.size() + 1); - _groupId_DeriveSubQuery_GroupMappingListMap.put(key, subQuery); - return "groupId_DeriveSubQuery_GroupMappingList." + key; + + (_groupId_DerivedReferrer_GroupMappingListMap.size() + 1); + _groupId_DerivedReferrer_GroupMappingListMap.put(key, subQuery); + return "groupId_DerivedReferrer_GroupMappingList." + key; } - protected Map _groupId_DeriveSubQuery_UserInfoListMap; + protected Map _groupId_DerivedReferrer_UserInfoListMap; - public Map getGroupId_DeriveSubQuery_UserInfoList() { - return _groupId_DeriveSubQuery_UserInfoListMap; + public Map getGroupId_DerivedReferrer_UserInfoList() { + return _groupId_DerivedReferrer_UserInfoListMap; } - public String keepGroupId_DeriveSubQuery_UserInfoList(UserInfoCQ subQuery) { - if (_groupId_DeriveSubQuery_UserInfoListMap == null) { - _groupId_DeriveSubQuery_UserInfoListMap = newLinkedHashMap(); + public String keepGroupId_DerivedReferrer_UserInfoList(UserInfoCQ subQuery) { + if (_groupId_DerivedReferrer_UserInfoListMap == null) { + _groupId_DerivedReferrer_UserInfoListMap = newLinkedHashMap(); } String key = "subQueryMapKey" - + (_groupId_DeriveSubQuery_UserInfoListMap.size() + 1); - _groupId_DeriveSubQuery_UserInfoListMap.put(key, subQuery); - return "groupId_DeriveSubQuery_UserInfoList." + key; + + (_groupId_DerivedReferrer_UserInfoListMap.size() + 1); + _groupId_DerivedReferrer_UserInfoListMap.put(key, subQuery); + return "groupId_DerivedReferrer_UserInfoList." + key; } public BsGroupInfoCQ addOrderBy_GroupId_Asc() { @@ -564,7 +564,30 @@ // ========= // Foreign Query // ============= + //========================================================================== + // ========= + // Derived Query + // ============= + protected Map _scalarSubQueryMap; + public Map getScalarSubQuery() { + return _scalarSubQueryMap; + } + + public String keepScalarSubQuery(GroupInfoCQ subQuery) { + if (_scalarSubQueryMap == null) { + _scalarSubQueryMap = newLinkedHashMap(); + } + String key = "subQueryMapKey" + (_scalarSubQueryMap.size() + 1); + _scalarSubQueryMap.put(key, subQuery); + return "scalarSubQuery." + key; + } + + // Very Internal (for Suppressing Warn about 'Not Use Import') + protected String getConditionBeanClassNameInternally() { + return GroupInfoCB.class.getName(); + } + protected String getConditionQueryClassNameInternally() { return GroupInfoCQ.class.getName(); } Modified: userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/cbean/cq/bs/BsGroupMappingCQ.java =================================================================== --- userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/cbean/cq/bs/BsGroupMappingCQ.java 2008-12-26 22:11:31 UTC (rev 1622) +++ userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/cbean/cq/bs/BsGroupMappingCQ.java 2008-12-27 22:02:56 UTC (rev 1623) @@ -5,6 +5,7 @@ import jp.sf.pal.userinfo.db.allcommon.cbean.ConditionQuery; import jp.sf.pal.userinfo.db.allcommon.cbean.cvalue.ConditionValue; import jp.sf.pal.userinfo.db.allcommon.cbean.sqlclause.SqlClause; +import jp.sf.pal.userinfo.db.cbean.GroupMappingCB; import jp.sf.pal.userinfo.db.cbean.cq.GroupInfoCQ; import jp.sf.pal.userinfo.db.cbean.cq.GroupMappingCQ; import jp.sf.pal.userinfo.db.cbean.cq.UserInfoCQ; @@ -15,7 +16,6 @@ * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public class BsGroupMappingCQ extends AbstractBsGroupMappingCQ { //========================================================================== @@ -61,7 +61,7 @@ public GroupMappingCIQ on() { if (isBaseQuery(this)) { throw new UnsupportedOperationException( - "Unsupported onClause of Base Table!"); + "Unsupported on-clause for local table!"); } GroupMappingCIQ inlineQuery = inline(); inlineQuery.xsetOnClauseInline(true); @@ -210,7 +210,6 @@ // ========= // Foreign Query // ============= - public GroupInfoCQ queryGroupInfo() { return getConditionQueryGroupInfo(); } @@ -219,20 +218,13 @@ public GroupInfoCQ getConditionQueryGroupInfo() { if (_conditionQueryGroupInfo == null) { - _conditionQueryGroupInfo = createQueryGroupInfo(); - setupOuterJoin_GroupInfo(); + _conditionQueryGroupInfo = xcreateQueryGroupInfo(); + xsetupOuterJoinGroupInfo(); } return _conditionQueryGroupInfo; } - protected void setupOuterJoin_GroupInfo() { - Map joinOnMap = newLinkedHashMap(); - joinOnMap.put(getRealColumnName("GROUP_ID"), - getConditionQueryGroupInfo().getRealColumnName("GROUP_ID")); - registerOuterJoin(getConditionQueryGroupInfo(), joinOnMap); - } - - protected GroupInfoCQ createQueryGroupInfo() { + protected GroupInfoCQ xcreateQueryGroupInfo() { String nrp = resolveNextRelationPath("GROUP_MAPPING", "groupInfo"); String jan = resolveJoinAliasName(nrp, getNextNestLevel()); GroupInfoCQ cq = new GroupInfoCQ(this, getSqlClause(), jan, @@ -242,6 +234,14 @@ return cq; } + protected void xsetupOuterJoinGroupInfo() { + GroupInfoCQ cq = getConditionQueryGroupInfo(); + Map joinOnMap = newLinkedHashMap(); + joinOnMap.put(getRealColumnName("GROUP_ID"), cq + .getRealColumnName("GROUP_ID")); + registerOuterJoin(cq, joinOnMap); + } + public boolean hasConditionQueryGroupInfo() { return _conditionQueryGroupInfo != null; } @@ -254,20 +254,13 @@ public UserInfoCQ getConditionQueryUserInfo() { if (_conditionQueryUserInfo == null) { - _conditionQueryUserInfo = createQueryUserInfo(); - setupOuterJoin_UserInfo(); + _conditionQueryUserInfo = xcreateQueryUserInfo(); + xsetupOuterJoinUserInfo(); } return _conditionQueryUserInfo; } - protected void setupOuterJoin_UserInfo() { - Map joinOnMap = newLinkedHashMap(); - joinOnMap.put(getRealColumnName("USER_ID"), getConditionQueryUserInfo() - .getRealColumnName("USER_ID")); - registerOuterJoin(getConditionQueryUserInfo(), joinOnMap); - } - - protected UserInfoCQ createQueryUserInfo() { + protected UserInfoCQ xcreateQueryUserInfo() { String nrp = resolveNextRelationPath("GROUP_MAPPING", "userInfo"); String jan = resolveJoinAliasName(nrp, getNextNestLevel()); UserInfoCQ cq = new UserInfoCQ(this, getSqlClause(), jan, @@ -277,10 +270,42 @@ return cq; } + protected void xsetupOuterJoinUserInfo() { + UserInfoCQ cq = getConditionQueryUserInfo(); + Map joinOnMap = newLinkedHashMap(); + joinOnMap.put(getRealColumnName("USER_ID"), cq + .getRealColumnName("USER_ID")); + registerOuterJoin(cq, joinOnMap); + } + public boolean hasConditionQueryUserInfo() { return _conditionQueryUserInfo != null; } + //========================================================================== + // ========= + // Derived Query + // ============= + protected Map _scalarSubQueryMap; + + public Map getScalarSubQuery() { + return _scalarSubQueryMap; + } + + public String keepScalarSubQuery(GroupMappingCQ subQuery) { + if (_scalarSubQueryMap == null) { + _scalarSubQueryMap = newLinkedHashMap(); + } + String key = "subQueryMapKey" + (_scalarSubQueryMap.size() + 1); + _scalarSubQueryMap.put(key, subQuery); + return "scalarSubQuery." + key; + } + + // Very Internal (for Suppressing Warn about 'Not Use Import') + protected String getConditionBeanClassNameInternally() { + return GroupMappingCB.class.getName(); + } + protected String getConditionQueryClassNameInternally() { return GroupMappingCQ.class.getName(); } Modified: userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/cbean/cq/bs/BsRoleInfoCQ.java =================================================================== --- userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/cbean/cq/bs/BsRoleInfoCQ.java 2008-12-26 22:11:31 UTC (rev 1622) +++ userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/cbean/cq/bs/BsRoleInfoCQ.java 2008-12-27 22:02:56 UTC (rev 1623) @@ -5,6 +5,7 @@ import jp.sf.pal.userinfo.db.allcommon.cbean.ConditionQuery; import jp.sf.pal.userinfo.db.allcommon.cbean.cvalue.ConditionValue; import jp.sf.pal.userinfo.db.allcommon.cbean.sqlclause.SqlClause; +import jp.sf.pal.userinfo.db.cbean.RoleInfoCB; import jp.sf.pal.userinfo.db.cbean.cq.RoleInfoCQ; import jp.sf.pal.userinfo.db.cbean.cq.RoleMappingCQ; import jp.sf.pal.userinfo.db.cbean.cq.UserInfoCQ; @@ -15,7 +16,6 @@ * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public class BsRoleInfoCQ extends AbstractBsRoleInfoCQ { //========================================================================== @@ -61,7 +61,7 @@ public RoleInfoCIQ on() { if (isBaseQuery(this)) { throw new UnsupportedOperationException( - "Unsupported onClause of Base Table!"); + "Unsupported on-clause for local table!"); } RoleInfoCIQ inlineQuery = inline(); inlineQuery.xsetOnClauseInline(true); @@ -218,37 +218,37 @@ return "roleId_NotExistsSubQuery_UserInfoList." + key; } - protected Map _roleId_DeriveSubQuery_RoleMappingListMap; + protected Map _roleId_DerivedReferrer_RoleMappingListMap; - public Map getRoleId_DeriveSubQuery_RoleMappingList() { - return _roleId_DeriveSubQuery_RoleMappingListMap; + public Map getRoleId_DerivedReferrer_RoleMappingList() { + return _roleId_DerivedReferrer_RoleMappingListMap; } - public String keepRoleId_DeriveSubQuery_RoleMappingList( + public String keepRoleId_DerivedReferrer_RoleMappingList( RoleMappingCQ subQuery) { - if (_roleId_DeriveSubQuery_RoleMappingListMap == null) { - _roleId_DeriveSubQuery_RoleMappingListMap = newLinkedHashMap(); + if (_roleId_DerivedReferrer_RoleMappingListMap == null) { + _roleId_DerivedReferrer_RoleMappingListMap = newLinkedHashMap(); } String key = "subQueryMapKey" - + (_roleId_DeriveSubQuery_RoleMappingListMap.size() + 1); - _roleId_DeriveSubQuery_RoleMappingListMap.put(key, subQuery); - return "roleId_DeriveSubQuery_RoleMappingList." + key; + + (_roleId_DerivedReferrer_RoleMappingListMap.size() + 1); + _roleId_DerivedReferrer_RoleMappingListMap.put(key, subQuery); + return "roleId_DerivedReferrer_RoleMappingList." + key; } - protected Map _roleId_DeriveSubQuery_UserInfoListMap; + protected Map _roleId_DerivedReferrer_UserInfoListMap; - public Map getRoleId_DeriveSubQuery_UserInfoList() { - return _roleId_DeriveSubQuery_UserInfoListMap; + public Map getRoleId_DerivedReferrer_UserInfoList() { + return _roleId_DerivedReferrer_UserInfoListMap; } - public String keepRoleId_DeriveSubQuery_UserInfoList(UserInfoCQ subQuery) { - if (_roleId_DeriveSubQuery_UserInfoListMap == null) { - _roleId_DeriveSubQuery_UserInfoListMap = newLinkedHashMap(); + public String keepRoleId_DerivedReferrer_UserInfoList(UserInfoCQ subQuery) { + if (_roleId_DerivedReferrer_UserInfoListMap == null) { + _roleId_DerivedReferrer_UserInfoListMap = newLinkedHashMap(); } String key = "subQueryMapKey" - + (_roleId_DeriveSubQuery_UserInfoListMap.size() + 1); - _roleId_DeriveSubQuery_UserInfoListMap.put(key, subQuery); - return "roleId_DeriveSubQuery_UserInfoList." + key; + + (_roleId_DerivedReferrer_UserInfoListMap.size() + 1); + _roleId_DerivedReferrer_UserInfoListMap.put(key, subQuery); + return "roleId_DerivedReferrer_UserInfoList." + key; } public BsRoleInfoCQ addOrderBy_RoleId_Asc() { @@ -563,7 +563,30 @@ // ========= // Foreign Query // ============= + //========================================================================== + // ========= + // Derived Query + // ============= + protected Map _scalarSubQueryMap; + public Map getScalarSubQuery() { + return _scalarSubQueryMap; + } + + public String keepScalarSubQuery(RoleInfoCQ subQuery) { + if (_scalarSubQueryMap == null) { + _scalarSubQueryMap = newLinkedHashMap(); + } + String key = "subQueryMapKey" + (_scalarSubQueryMap.size() + 1); + _scalarSubQueryMap.put(key, subQuery); + return "scalarSubQuery." + key; + } + + // Very Internal (for Suppressing Warn about 'Not Use Import') + protected String getConditionBeanClassNameInternally() { + return RoleInfoCB.class.getName(); + } + protected String getConditionQueryClassNameInternally() { return RoleInfoCQ.class.getName(); } Modified: userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/cbean/cq/bs/BsRoleMappingCQ.java =================================================================== --- userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/cbean/cq/bs/BsRoleMappingCQ.java 2008-12-26 22:11:31 UTC (rev 1622) +++ userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/cbean/cq/bs/BsRoleMappingCQ.java 2008-12-27 22:02:56 UTC (rev 1623) @@ -5,6 +5,7 @@ import jp.sf.pal.userinfo.db.allcommon.cbean.ConditionQuery; import jp.sf.pal.userinfo.db.allcommon.cbean.cvalue.ConditionValue; import jp.sf.pal.userinfo.db.allcommon.cbean.sqlclause.SqlClause; +import jp.sf.pal.userinfo.db.cbean.RoleMappingCB; import jp.sf.pal.userinfo.db.cbean.cq.RoleInfoCQ; import jp.sf.pal.userinfo.db.cbean.cq.RoleMappingCQ; import jp.sf.pal.userinfo.db.cbean.cq.UserInfoCQ; @@ -15,7 +16,6 @@ * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public class BsRoleMappingCQ extends AbstractBsRoleMappingCQ { //========================================================================== @@ -61,7 +61,7 @@ public RoleMappingCIQ on() { if (isBaseQuery(this)) { throw new UnsupportedOperationException( - "Unsupported onClause of Base Table!"); + "Unsupported on-clause for local table!"); } RoleMappingCIQ inlineQuery = inline(); inlineQuery.xsetOnClauseInline(true); @@ -210,7 +210,6 @@ // ========= // Foreign Query // ============= - public RoleInfoCQ queryRoleInfo() { return getConditionQueryRoleInfo(); } @@ -219,20 +218,13 @@ public RoleInfoCQ getConditionQueryRoleInfo() { if (_conditionQueryRoleInfo == null) { - _conditionQueryRoleInfo = createQueryRoleInfo(); - setupOuterJoin_RoleInfo(); + _conditionQueryRoleInfo = xcreateQueryRoleInfo(); + xsetupOuterJoinRoleInfo(); } return _conditionQueryRoleInfo; } - protected void setupOuterJoin_RoleInfo() { - Map joinOnMap = newLinkedHashMap(); - joinOnMap.put(getRealColumnName("ROLE_ID"), getConditionQueryRoleInfo() - .getRealColumnName("ROLE_ID")); - registerOuterJoin(getConditionQueryRoleInfo(), joinOnMap); - } - - protected RoleInfoCQ createQueryRoleInfo() { + protected RoleInfoCQ xcreateQueryRoleInfo() { String nrp = resolveNextRelationPath("ROLE_MAPPING", "roleInfo"); String jan = resolveJoinAliasName(nrp, getNextNestLevel()); RoleInfoCQ cq = new RoleInfoCQ(this, getSqlClause(), jan, @@ -242,6 +234,14 @@ return cq; } + protected void xsetupOuterJoinRoleInfo() { + RoleInfoCQ cq = getConditionQueryRoleInfo(); + Map joinOnMap = newLinkedHashMap(); + joinOnMap.put(getRealColumnName("ROLE_ID"), cq + .getRealColumnName("ROLE_ID")); + registerOuterJoin(cq, joinOnMap); + } + public boolean hasConditionQueryRoleInfo() { return _conditionQueryRoleInfo != null; } @@ -254,20 +254,13 @@ public UserInfoCQ getConditionQueryUserInfo() { if (_conditionQueryUserInfo == null) { - _conditionQueryUserInfo = createQueryUserInfo(); - setupOuterJoin_UserInfo(); + _conditionQueryUserInfo = xcreateQueryUserInfo(); + xsetupOuterJoinUserInfo(); } return _conditionQueryUserInfo; } - protected void setupOuterJoin_UserInfo() { - Map joinOnMap = newLinkedHashMap(); - joinOnMap.put(getRealColumnName("USER_ID"), getConditionQueryUserInfo() - .getRealColumnName("USER_ID")); - registerOuterJoin(getConditionQueryUserInfo(), joinOnMap); - } - - protected UserInfoCQ createQueryUserInfo() { + protected UserInfoCQ xcreateQueryUserInfo() { String nrp = resolveNextRelationPath("ROLE_MAPPING", "userInfo"); String jan = resolveJoinAliasName(nrp, getNextNestLevel()); UserInfoCQ cq = new UserInfoCQ(this, getSqlClause(), jan, @@ -277,10 +270,42 @@ return cq; } + protected void xsetupOuterJoinUserInfo() { + UserInfoCQ cq = getConditionQueryUserInfo(); + Map joinOnMap = newLinkedHashMap(); + joinOnMap.put(getRealColumnName("USER_ID"), cq + .getRealColumnName("USER_ID")); + registerOuterJoin(cq, joinOnMap); + } + public boolean hasConditionQueryUserInfo() { return _conditionQueryUserInfo != null; } + //========================================================================== + // ========= + // Derived Query + // ============= + protected Map _scalarSubQueryMap; + + public Map getScalarSubQuery() { + return _scalarSubQueryMap; + } + + public String keepScalarSubQuery(RoleMappingCQ subQuery) { + if (_scalarSubQueryMap == null) { + _scalarSubQueryMap = newLinkedHashMap(); + } + String key = "subQueryMapKey" + (_scalarSubQueryMap.size() + 1); + _scalarSubQueryMap.put(key, subQuery); + return "scalarSubQuery." + key; + } + + // Very Internal (for Suppressing Warn about 'Not Use Import') + protected String getConditionBeanClassNameInternally() { + return RoleMappingCB.class.getName(); + } + protected String getConditionQueryClassNameInternally() { return RoleMappingCQ.class.getName(); } Modified: userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/cbean/cq/bs/BsUserInfoCQ.java =================================================================== --- userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/cbean/cq/bs/BsUserInfoCQ.java 2008-12-26 22:11:31 UTC (rev 1622) +++ userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/cbean/cq/bs/BsUserInfoCQ.java 2008-12-27 22:02:56 UTC (rev 1623) @@ -5,6 +5,7 @@ import jp.sf.pal.userinfo.db.allcommon.cbean.ConditionQuery; import jp.sf.pal.userinfo.db.allcommon.cbean.cvalue.ConditionValue; import jp.sf.pal.userinfo.db.allcommon.cbean.sqlclause.SqlClause; +import jp.sf.pal.userinfo.db.cbean.UserInfoCB; import jp.sf.pal.userinfo.db.cbean.cq.GroupInfoCQ; import jp.sf.pal.userinfo.db.cbean.cq.GroupMappingCQ; import jp.sf.pal.userinfo.db.cbean.cq.RoleInfoCQ; @@ -17,7 +18,6 @@ * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public class BsUserInfoCQ extends AbstractBsUserInfoCQ { //========================================================================== @@ -63,7 +63,7 @@ public UserInfoCIQ on() { if (isBaseQuery(this)) { throw new UnsupportedOperationException( - "Unsupported onClause of Base Table!"); + "Unsupported on-clause for local table!"); } UserInfoCIQ inlineQuery = inline(); inlineQuery.xsetOnClauseInline(true); @@ -224,38 +224,38 @@ return "userId_NotExistsSubQuery_RoleMappingList." + key; } - protected Map _userId_DeriveSubQuery_GroupMappingListMap; + protected Map _userId_DerivedReferrer_GroupMappingListMap; - public Map getUserId_DeriveSubQuery_GroupMappingList() { - return _userId_DeriveSubQuery_GroupMappingListMap; + public Map getUserId_DerivedReferrer_GroupMappingList() { + return _userId_DerivedReferrer_GroupMappingListMap; } - public String keepUserId_DeriveSubQuery_GroupMappingList( + public String keepUserId_DerivedReferrer_GroupMappingList( GroupMappingCQ subQuery) { - if (_userId_DeriveSubQuery_GroupMappingListMap == null) { - _userId_DeriveSubQuery_GroupMappingListMap = newLinkedHashMap(); + if (_userId_DerivedReferrer_GroupMappingListMap == null) { + _userId_DerivedReferrer_GroupMappingListMap = newLinkedHashMap(); } String key = "subQueryMapKey" - + (_userId_DeriveSubQuery_GroupMappingListMap.size() + 1); - _userId_DeriveSubQuery_GroupMappingListMap.put(key, subQuery); - return "userId_DeriveSubQuery_GroupMappingList." + key; + + (_userId_DerivedReferrer_GroupMappingListMap.size() + 1); + _userId_DerivedReferrer_GroupMappingListMap.put(key, subQuery); + return "userId_DerivedReferrer_GroupMappingList." + key; } - protected Map _userId_DeriveSubQuery_RoleMappingListMap; + protected Map _userId_DerivedReferrer_RoleMappingListMap; - public Map getUserId_DeriveSubQuery_RoleMappingList() { - return _userId_DeriveSubQuery_RoleMappingListMap; + public Map getUserId_DerivedReferrer_RoleMappingList() { + return _userId_DerivedReferrer_RoleMappingListMap; } - public String keepUserId_DeriveSubQuery_RoleMappingList( + public String keepUserId_DerivedReferrer_RoleMappingList( RoleMappingCQ subQuery) { - if (_userId_DeriveSubQuery_RoleMappingListMap == null) { - _userId_DeriveSubQuery_RoleMappingListMap = newLinkedHashMap(); + if (_userId_DerivedReferrer_RoleMappingListMap == null) { + _userId_DerivedReferrer_RoleMappingListMap = newLinkedHashMap(); } String key = "subQueryMapKey" - + (_userId_DeriveSubQuery_RoleMappingListMap.size() + 1); - _userId_DeriveSubQuery_RoleMappingListMap.put(key, subQuery); - return "userId_DeriveSubQuery_RoleMappingList." + key; + + (_userId_DerivedReferrer_RoleMappingListMap.size() + 1); + _userId_DerivedReferrer_RoleMappingListMap.put(key, subQuery); + return "userId_DerivedReferrer_RoleMappingList." + key; } public BsUserInfoCQ addOrderBy_UserId_Asc() { @@ -622,6 +622,29 @@ return this; } + protected ConditionValue _status; + + public ConditionValue getStatus() { + if (_status == null) { + _status = new ConditionValue(); + } + return _status; + } + + protected ConditionValue getCValueStatus() { + return getStatus(); + } + + public BsUserInfoCQ addOrderBy_Status_Asc() { + regOBA("STATUS"); + return this; + } + + public BsUserInfoCQ addOrderBy_Status_Desc() { + regOBD("STATUS"); + return this; + } + protected ConditionValue _createdTime; public ConditionValue getCreatedTime() { @@ -819,7 +842,6 @@ // ========= // Foreign Query // ============= - public GroupInfoCQ queryGroupInfo() { return getConditionQueryGroupInfo(); } @@ -828,20 +850,13 @@ public GroupInfoCQ getConditionQueryGroupInfo() { if (_conditionQueryGroupInfo == null) { - _conditionQueryGroupInfo = createQueryGroupInfo(); - setupOuterJoin_GroupInfo(); + _conditionQueryGroupInfo = xcreateQueryGroupInfo(); + xsetupOuterJoinGroupInfo(); } return _conditionQueryGroupInfo; } - protected void setupOuterJoin_GroupInfo() { - Map joinOnMap = newLinkedHashMap(); - joinOnMap.put(getRealColumnName("GROUP_ID"), - getConditionQueryGroupInfo().getRealColumnName("GROUP_ID")); - registerOuterJoin(getConditionQueryGroupInfo(), joinOnMap); - } - - protected GroupInfoCQ createQueryGroupInfo() { + protected GroupInfoCQ xcreateQueryGroupInfo() { String nrp = resolveNextRelationPath("USER_INFO", "groupInfo"); String jan = resolveJoinAliasName(nrp, getNextNestLevel()); GroupInfoCQ cq = new GroupInfoCQ(this, getSqlClause(), jan, @@ -851,6 +866,14 @@ return cq; } + protected void xsetupOuterJoinGroupInfo() { + GroupInfoCQ cq = getConditionQueryGroupInfo(); + Map joinOnMap = newLinkedHashMap(); + joinOnMap.put(getRealColumnName("GROUP_ID"), cq + .getRealColumnName("GROUP_ID")); + registerOuterJoin(cq, joinOnMap); + } + public boolean hasConditionQueryGroupInfo() { return _conditionQueryGroupInfo != null; } @@ -863,20 +886,13 @@ public RoleInfoCQ getConditionQueryRoleInfo() { if (_conditionQueryRoleInfo == null) { - _conditionQueryRoleInfo = createQueryRoleInfo(); - setupOuterJoin_RoleInfo(); + _conditionQueryRoleInfo = xcreateQueryRoleInfo(); + xsetupOuterJoinRoleInfo(); } return _conditionQueryRoleInfo; } - protected void setupOuterJoin_RoleInfo() { - Map joinOnMap = newLinkedHashMap(); - joinOnMap.put(getRealColumnName("ROLE_ID"), getConditionQueryRoleInfo() - .getRealColumnName("ROLE_ID")); - registerOuterJoin(getConditionQueryRoleInfo(), joinOnMap); - } - - protected RoleInfoCQ createQueryRoleInfo() { + protected RoleInfoCQ xcreateQueryRoleInfo() { String nrp = resolveNextRelationPath("USER_INFO", "roleInfo"); String jan = resolveJoinAliasName(nrp, getNextNestLevel()); RoleInfoCQ cq = new RoleInfoCQ(this, getSqlClause(), jan, @@ -886,10 +902,42 @@ return cq; } + protected void xsetupOuterJoinRoleInfo() { + RoleInfoCQ cq = getConditionQueryRoleInfo(); + Map joinOnMap = newLinkedHashMap(); + joinOnMap.put(getRealColumnName("ROLE_ID"), cq + .getRealColumnName("ROLE_ID")); + registerOuterJoin(cq, joinOnMap); + } + public boolean hasConditionQueryRoleInfo() { return _conditionQueryRoleInfo != null; } + //========================================================================== + // ========= + // Derived Query + // ============= + protected Map _scalarSubQueryMap; + + public Map getScalarSubQuery() { + return _scalarSubQueryMap; + } + + public String keepScalarSubQuery(UserInfoCQ subQuery) { + if (_scalarSubQueryMap == null) { + _scalarSubQueryMap = newLinkedHashMap(); + } + String key = "subQueryMapKey" + (_scalarSubQueryMap.size() + 1); + _scalarSubQueryMap.put(key, subQuery); + return "scalarSubQuery." + key; + } + + // Very Internal (for Suppressing Warn about 'Not Use Import') + protected String getConditionBeanClassNameInternally() { + return UserInfoCB.class.getName(); + } + protected String getConditionQueryClassNameInternally() { return UserInfoCQ.class.getName(); } Modified: userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/cbean/cq/ciq/GroupInfoCIQ.java =================================================================== --- userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/cbean/cq/ciq/GroupInfoCIQ.java 2008-12-26 22:11:31 UTC (rev 1622) +++ userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/cbean/cq/ciq/GroupInfoCIQ.java 2008-12-27 22:02:56 UTC (rev 1623) @@ -5,6 +5,7 @@ import jp.sf.pal.userinfo.db.allcommon.cbean.coption.ConditionOption; import jp.sf.pal.userinfo.db.allcommon.cbean.cvalue.ConditionValue; import jp.sf.pal.userinfo.db.allcommon.cbean.sqlclause.SqlClause; +import jp.sf.pal.userinfo.db.cbean.GroupInfoCB; import jp.sf.pal.userinfo.db.cbean.cq.GroupInfoCQ; import jp.sf.pal.userinfo.db.cbean.cq.GroupMappingCQ; import jp.sf.pal.userinfo.db.cbean.cq.UserInfoCQ; @@ -16,7 +17,6 @@ * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public class GroupInfoCIQ extends AbstractBsGroupInfoCQ { //========================================================================== @@ -137,15 +137,15 @@ "NotExistsSubQuery at inline() is unsupported! Sorry!"); } - public String keepGroupId_DeriveSubQuery_GroupMappingList( + public String keepGroupId_DerivedReferrer_GroupMappingList( GroupMappingCQ subQuery) { throw new UnsupportedOperationException( - "DeriveSubQuery at inline() is unsupported! Sorry!"); + "DerivedReferrer at inline() is unsupported! Sorry!"); } - public String keepGroupId_DeriveSubQuery_UserInfoList(UserInfoCQ subQuery) { + public String keepGroupId_DerivedReferrer_UserInfoList(UserInfoCQ subQuery) { throw new UnsupportedOperationException( - "DeriveSubQuery at inline() is unsupported! Sorry!"); + "DerivedReferrer at inline() is unsupported! Sorry!"); } protected ConditionValue getCValueName() { @@ -196,6 +196,20 @@ return _myCQ.getVersionno(); } + //========================================================================== + // ========= + // Derived Query + // ============= + public String keepScalarSubQuery(GroupInfoCQ subQuery) { + throw new UnsupportedOperationException( + "ScalarSubQuery at inline() is unsupported! Sorry!"); + } + + // Very Internal (for Suppressing Warn about 'Not Use Import') + protected String getConditionBeanClassNameInternally() { + return GroupInfoCB.class.getName(); + } + protected String getConditionQueryClassNameInternally() { return GroupInfoCQ.class.getName(); } Modified: userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/cbean/cq/ciq/GroupMappingCIQ.java =================================================================== --- userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/cbean/cq/ciq/GroupMappingCIQ.java 2008-12-26 22:11:31 UTC (rev 1622) +++ userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/cbean/cq/ciq/GroupMappingCIQ.java 2008-12-27 22:02:56 UTC (rev 1623) @@ -5,6 +5,7 @@ import jp.sf.pal.userinfo.db.allcommon.cbean.coption.ConditionOption; import jp.sf.pal.userinfo.db.allcommon.cbean.cvalue.ConditionValue; import jp.sf.pal.userinfo.db.allcommon.cbean.sqlclause.SqlClause; +import jp.sf.pal.userinfo.db.cbean.GroupMappingCB; import jp.sf.pal.userinfo.db.cbean.cq.GroupInfoCQ; import jp.sf.pal.userinfo.db.cbean.cq.GroupMappingCQ; import jp.sf.pal.userinfo.db.cbean.cq.UserInfoCQ; @@ -16,7 +17,6 @@ * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public class GroupMappingCIQ extends AbstractBsGroupMappingCQ { //========================================================================== @@ -112,6 +112,20 @@ return _myCQ.keepGroupId_InScopeSubQuery_GroupInfo(subQuery); } + //========================================================================== + // ========= + // Derived Query + // ============= + public String keepScalarSubQuery(GroupMappingCQ subQuery) { + throw new UnsupportedOperationException( + "ScalarSubQuery at inline() is unsupported! Sorry!"); + } + + // Very Internal (for Suppressing Warn about 'Not Use Import') + protected String getConditionBeanClassNameInternally() { + return GroupMappingCB.class.getName(); + } + protected String getConditionQueryClassNameInternally() { return GroupMappingCQ.class.getName(); } Modified: userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/cbean/cq/ciq/RoleInfoCIQ.java =================================================================== --- userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/cbean/cq/ciq/RoleInfoCIQ.java 2008-12-26 22:11:31 UTC (rev 1622) +++ userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/cbean/cq/ciq/RoleInfoCIQ.java 2008-12-27 22:02:56 UTC (rev 1623) @@ -5,6 +5,7 @@ import jp.sf.pal.userinfo.db.allcommon.cbean.coption.ConditionOption; import jp.sf.pal.userinfo.db.allcommon.cbean.cvalue.ConditionValue; import jp.sf.pal.userinfo.db.allcommon.cbean.sqlclause.SqlClause; +import jp.sf.pal.userinfo.db.cbean.RoleInfoCB; import jp.sf.pal.userinfo.db.cbean.cq.RoleInfoCQ; import jp.sf.pal.userinfo.db.cbean.cq.RoleMappingCQ; import jp.sf.pal.userinfo.db.cbean.cq.UserInfoCQ; @@ -16,7 +17,6 @@ * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public class RoleInfoCIQ extends AbstractBsRoleInfoCQ { //========================================================================== @@ -136,15 +136,15 @@ "NotExistsSubQuery at inline() is unsupported! Sorry!"); } - public String keepRoleId_DeriveSubQuery_RoleMappingList( + public String keepRoleId_DerivedReferrer_RoleMappingList( RoleMappingCQ subQuery) { throw new UnsupportedOperationException( - "DeriveSubQuery at inline() is unsupported! Sorry!"); + "DerivedReferrer at inline() is unsupported! Sorry!"); } - public String keepRoleId_DeriveSubQuery_UserInfoList(UserInfoCQ subQuery) { + public String keepRoleId_DerivedReferrer_UserInfoList(UserInfoCQ subQuery) { throw new UnsupportedOperationException( - "DeriveSubQuery at inline() is unsupported! Sorry!"); + "DerivedReferrer at inline() is unsupported! Sorry!"); } protected ConditionValue getCValueName() { @@ -195,6 +195,20 @@ return _myCQ.getVersionno(); } + //========================================================================== + // ========= + // Derived Query + // ============= + public String keepScalarSubQuery(RoleInfoCQ subQuery) { + throw new UnsupportedOperationException( + "ScalarSubQuery at inline() is unsupported! Sorry!"); + } + + // Very Internal (for Suppressing Warn about 'Not Use Import') + protected String getConditionBeanClassNameInternally() { + return RoleInfoCB.class.getName(); + } + protected String getConditionQueryClassNameInternally() { return RoleInfoCQ.class.getName(); } Modified: userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/cbean/cq/ciq/RoleMappingCIQ.java =================================================================== --- userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/cbean/cq/ciq/RoleMappingCIQ.java 2008-12-26 22:11:31 UTC (rev 1622) +++ userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/cbean/cq/ciq/RoleMappingCIQ.java 2008-12-27 22:02:56 UTC (rev 1623) @@ -5,6 +5,7 @@ import jp.sf.pal.userinfo.db.allcommon.cbean.coption.ConditionOption; import jp.sf.pal.userinfo.db.allcommon.cbean.cvalue.ConditionValue; import jp.sf.pal.userinfo.db.allcommon.cbean.sqlclause.SqlClause; +import jp.sf.pal.userinfo.db.cbean.RoleMappingCB; import jp.sf.pal.userinfo.db.cbean.cq.RoleInfoCQ; import jp.sf.pal.userinfo.db.cbean.cq.RoleMappingCQ; import jp.sf.pal.userinfo.db.cbean.cq.UserInfoCQ; @@ -16,7 +17,6 @@ * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public class RoleMappingCIQ extends AbstractBsRoleMappingCQ { //========================================================================== @@ -112,6 +112,20 @@ return _myCQ.keepRoleId_InScopeSubQuery_RoleInfo(subQuery); } + //========================================================================== + // ========= + // Derived Query + // ============= + public String keepScalarSubQuery(RoleMappingCQ subQuery) { + throw new UnsupportedOperationException( + "ScalarSubQuery at inline() is unsupported! Sorry!"); + } + + // Very Internal (for Suppressing Warn about 'Not Use Import') + protected String getConditionBeanClassNameInternally() { + return RoleMappingCB.class.getName(); + } + protected String getConditionQueryClassNameInternally() { return RoleMappingCQ.class.getName(); } Modified: userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/cbean/cq/ciq/UserInfoCIQ.java =================================================================== --- userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/cbean/cq/ciq/UserInfoCIQ.java 2008-12-26 22:11:31 UTC (rev 1622) +++ userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/cbean/cq/ciq/UserInfoCIQ.java 2008-12-27 22:02:56 UTC (rev 1623) @@ -5,6 +5,7 @@ import jp.sf.pal.userinfo.db.allcommon.cbean.coption.ConditionOption; import jp.sf.pal.userinfo.db.allcommon.cbean.cvalue.ConditionValue; import jp.sf.pal.userinfo.db.allcommon.cbean.sqlclause.SqlClause; +import jp.sf.pal.userinfo.db.cbean.UserInfoCB; import jp.sf.pal.userinfo.db.cbean.cq.GroupInfoCQ; import jp.sf.pal.userinfo.db.cbean.cq.GroupMappingCQ; import jp.sf.pal.userinfo.db.cbean.cq.RoleInfoCQ; @@ -18,7 +19,6 @@ * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public class UserInfoCIQ extends AbstractBsUserInfoCQ { //========================================================================== @@ -142,16 +142,16 @@ "NotExistsSubQuery at inline() is unsupported! Sorry!"); } - public String keepUserId_DeriveSubQuery_GroupMappingList( + public String keepUserId_DerivedReferrer_GroupMappingList( GroupMappingCQ subQuery) { throw new UnsupportedOperationException( - "DeriveSubQuery at inline() is unsupported! Sorry!"); + "DerivedReferrer at inline() is unsupported! Sorry!"); } - public String keepUserId_DeriveSubQuery_RoleMappingList( + public String keepUserId_DerivedReferrer_RoleMappingList( RoleMappingCQ subQuery) { throw new UnsupportedOperationException( - "DeriveSubQuery at inline() is unsupported! Sorry!"); + "DerivedReferrer at inline() is unsupported! Sorry!"); } protected ConditionValue getCValueGivenName() { @@ -218,6 +218,10 @@ return _myCQ.keepGroupId_InScopeSubQuery_GroupInfo(subQuery); } + protected ConditionValue getCValueStatus() { + return _myCQ.getStatus(); + } + protected ConditionValue getCValueCreatedTime() { return _myCQ.getCreatedTime(); } @@ -246,6 +250,20 @@ return _myCQ.getVersionno(); } + //========================================================================== + // ========= + // Derived Query + // ============= + public String keepScalarSubQuery(UserInfoCQ subQuery) { + throw new UnsupportedOperationException( + "ScalarSubQuery at inline() is unsupported! Sorry!"); + } + + // Very Internal (for Suppressing Warn about 'Not Use Import') + protected String getConditionBeanClassNameInternally() { + return UserInfoCB.class.getName(); + } + protected String getConditionQueryClassNameInternally() { return UserInfoCQ.class.getName(); } Modified: userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/cbean/nss/GroupInfoNss.java =================================================================== --- userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/cbean/nss/GroupInfoNss.java 2008-12-26 22:11:31 UTC (rev 1622) +++ userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/cbean/nss/GroupInfoNss.java 2008-12-27 22:02:56 UTC (rev 1623) @@ -7,7 +7,6 @@ * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public class GroupInfoNss { protected GroupInfoCQ _query; Modified: userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/cbean/nss/GroupMappingNss.java =================================================================== --- userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/cbean/nss/GroupMappingNss.java 2008-12-26 22:11:31 UTC (rev 1622) +++ userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/cbean/nss/GroupMappingNss.java 2008-12-27 22:02:56 UTC (rev 1623) @@ -8,7 +8,6 @@ * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public class GroupMappingNss { protected GroupMappingCQ _query; Modified: userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/cbean/nss/RoleInfoNss.java =================================================================== --- userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/cbean/nss/RoleInfoNss.java 2008-12-26 22:11:31 UTC (rev 1622) +++ userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/cbean/nss/RoleInfoNss.java 2008-12-27 22:02:56 UTC (rev 1623) @@ -7,7 +7,6 @@ * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public class RoleInfoNss { protected RoleInfoCQ _query; Modified: userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/cbean/nss/RoleMappingNss.java =================================================================== --- userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/cbean/nss/RoleMappingNss.java 2008-12-26 22:11:31 UTC (rev 1622) +++ userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/cbean/nss/RoleMappingNss.java 2008-12-27 22:02:56 UTC (rev 1623) @@ -8,7 +8,6 @@ * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public class RoleMappingNss { protected RoleMappingCQ _query; Modified: userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/cbean/nss/UserInfoNss.java =================================================================== --- userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/cbean/nss/UserInfoNss.java 2008-12-26 22:11:31 UTC (rev 1622) +++ userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/cbean/nss/UserInfoNss.java 2008-12-27 22:02:56 UTC (rev 1623) @@ -8,7 +8,6 @@ * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public class UserInfoNss { protected UserInfoCQ _query; Deleted: userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/exdao/GroupInfoDao.java =================================================================== --- userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/exdao/GroupInfoDao.java 2008-12-26 22:11:31 UTC (rev 1622) +++ userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/exdao/GroupInfoDao.java 2008-12-27 22:02:56 UTC (rev 1623) @@ -1,15 +0,0 @@ -package jp.sf.pal.userinfo.db.exdao; - -/** - * The dao interface of GROUP_INFO.
- *

- * You can implement your original methods here. This class is NOT overrided - * when re-generating. - *

- * - * @author DBFlute(AutoGenerator) - */ - ¡÷ SuppressWarnings("unchecked") -public interface GroupInfoDao extends - jp.sf.pal.userinfo.db.bsdao.BsGroupInfoDao { -} Deleted: userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/exdao/GroupMappingDao.java =================================================================== --- userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/exdao/GroupMappingDao.java 2008-12-26 22:11:31 UTC (rev 1622) +++ userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/exdao/GroupMappingDao.java 2008-12-27 22:02:56 UTC (rev 1623) @@ -1,15 +0,0 @@ -package jp.sf.pal.userinfo.db.exdao; - -/** - * The dao interface of GROUP_MAPPING.
- *

- * You can implement your original methods here. This class is NOT overrided - * when re-generating. - *

- * - * @author DBFlute(AutoGenerator) - */ - ¡÷ SuppressWarnings("unchecked") -public interface GroupMappingDao extends - jp.sf.pal.userinfo.db.bsdao.BsGroupMappingDao { -} Deleted: userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/exdao/RoleInfoDao.java =================================================================== --- userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/exdao/RoleInfoDao.java 2008-12-26 22:11:31 UTC (rev 1622) +++ userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/exdao/RoleInfoDao.java 2008-12-27 22:02:56 UTC (rev 1623) @@ -1,14 +0,0 @@ -package jp.sf.pal.userinfo.db.exdao; - -/** - * The dao interface of ROLE_INFO.
- *

- * You can implement your original methods here. This class is NOT overrided - * when re-generating. - *

- * - * @author DBFlute(AutoGenerator) - */ - ¡÷ SuppressWarnings("unchecked") -public interface RoleInfoDao extends jp.sf.pal.userinfo.db.bsdao.BsRoleInfoDao { -} Deleted: userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/exdao/RoleMappingDao.java =================================================================== --- userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/exdao/RoleMappingDao.java 2008-12-26 22:11:31 UTC (rev 1622) +++ userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/exdao/RoleMappingDao.java 2008-12-27 22:02:56 UTC (rev 1623) @@ -1,15 +0,0 @@ -package jp.sf.pal.userinfo.db.exdao; - -/** - * The dao interface of ROLE_MAPPING.
- *

- * You can implement your original methods here. This class is NOT overrided - * when re-generating. - *

- * - * @author DBFlute(AutoGenerator) - */ - ¡÷ SuppressWarnings("unchecked") -public interface RoleMappingDao extends - jp.sf.pal.userinfo.db.bsdao.BsRoleMappingDao { -} Deleted: userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/exdao/UserInfoDao.java =================================================================== --- userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/exdao/UserInfoDao.java 2008-12-26 22:11:31 UTC (rev 1622) +++ userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/exdao/UserInfoDao.java 2008-12-27 22:02:56 UTC (rev 1623) @@ -1,14 +0,0 @@ -package jp.sf.pal.userinfo.db.exdao; - -/** - * The dao interface of USER_INFO.
- *

- * You can implement your original methods here. This class is NOT overrided - * when re-generating. - *

- * - * @author DBFlute(AutoGenerator) - */ - ¡÷ SuppressWarnings("unchecked") -public interface UserInfoDao extends jp.sf.pal.userinfo.db.bsdao.BsUserInfoDao { -} Modified: userinfo/trunk/src/main/java/jp/sf/pal/userinfo/dxo/UserInfoDxo.java =================================================================== --- userinfo/trunk/src/main/java/jp/sf/pal/userinfo/dxo/UserInfoDxo.java 2008-12-26 22:11:31 UTC (rev 1622) +++ userinfo/trunk/src/main/java/jp/sf/pal/userinfo/dxo/UserInfoDxo.java 2008-12-27 22:02:56 UTC (rev 1623) @@ -26,6 +26,7 @@ + ", url : url" // + ", telephone : telephone" // + ", locale : locale" // + + ", status : status" // + ", roleId : roleId" // + ", groupId : groupId" // + ", createdTime : createdTime" // @@ -55,6 +56,7 @@ + ", url : url" // + ", telephone : telephone" // + ", locale : locale" // + + ", status : status" // + ", roleId : roleId" // + ", groupId : groupId" // // + ", createdTime : createdTime" // Modified: userinfo/trunk/src/main/java/jp/sf/pal/userinfo/form/UserInfoForm.java =================================================================== --- userinfo/trunk/src/main/java/jp/sf/pal/userinfo/form/UserInfoForm.java 2008-12-26 22:11:31 UTC (rev 1622) +++ userinfo/trunk/src/main/java/jp/sf/pal/userinfo/form/UserInfoForm.java 2008-12-27 22:02:56 UTC (rev 1623) @@ -2,6 +2,7 @@ import java.io.Serializable; +import jp.sf.pal.userinfo.UserInfoConstants; import jp.sf.pal.userinfo.common.form.PagingResultForm; import org.seasar.struts.annotation.DateType; @@ -56,6 +57,9 @@ @Maxbytelength(maxbytelength = 5) public String locale; + @Maxbytelength(maxbytelength = 1) + public String status; + @Maxbytelength(maxbytelength = 255) public String roleId; @@ -95,6 +99,8 @@ @IntegerType public String pageNumber; + public String statusForSearch; + public void initialize() { userId = null; givenName = null; @@ -109,6 +115,7 @@ url = null; telephone = null; locale = null; + status = UserInfoConstants.USER_ACTIVE; roleId = null; groupId = null; createdTime = null; Modified: userinfo/trunk/src/main/java/jp/sf/pal/userinfo/pager/UserInfoPager.java =================================================================== --- userinfo/trunk/src/main/java/jp/sf/pal/userinfo/pager/UserInfoPager.java 2008-12-26 22:11:31 UTC (rev 1622) +++ userinfo/trunk/src/main/java/jp/sf/pal/userinfo/pager/UserInfoPager.java 2008-12-27 22:02:56 UTC (rev 1623) @@ -1,21 +1,33 @@ package jp.sf.pal.userinfo.pager; +import jp.sf.pal.userinfo.UserInfoConstants; import jp.sf.pal.userinfo.common.pager.DefaultPager; public class UserInfoPager extends DefaultPager { private static final long serialVersionUID = -1518841728377756219L; + public String status; + public UserInfoPager() { - + status = UserInfoConstants.USER_ACTIVE; } public void clear() { super.clear(); + status = UserInfoConstants.USER_ACTIVE; } protected int getDefaultPageSize() { return 50; } + public String getStatus() { + return status; + } + + public void setStatus(String status) { + this.status = status; + } + } Modified: userinfo/trunk/src/main/java/jp/sf/pal/userinfo/service/UserInfoService.java =================================================================== --- userinfo/trunk/src/main/java/jp/sf/pal/userinfo/service/UserInfoService.java 2008-12-26 22:11:31 UTC (rev 1622) +++ userinfo/trunk/src/main/java/jp/sf/pal/userinfo/service/UserInfoService.java 2008-12-27 22:02:56 UTC (rev 1623) @@ -47,6 +47,11 @@ cb.query().setDeletedBy_IsNull(); + // search + if (!StringUtils.isEmpty(userInfoPager.getStatus())) { + cb.query().setStatus_Equal(userInfoPager.getStatus()); + } + cb.query().addOrderBy_UserId_Asc(); PagingResultBean userInfoList = userInfoBhv.selectPage(cb); Modified: userinfo/trunk/src/main/resources/application.properties =================================================================== --- userinfo/trunk/src/main/resources/application.properties 2008-12-26 22:11:31 UTC (rev 1622) +++ userinfo/trunk/src/main/resources/application.properties 2008-12-27 22:02:56 UTC (rev 1623) @@ -155,3 +155,10 @@ labels.selectedGroups=Selected Groups labels.selectedRoles=Selected Roles +labels.status=Status +labels.active=Active +labels.locked=Locked +labels.disabled=Disabled +labels.search=Search +labels.reset=Reset +labels.all=All Modified: userinfo/trunk/src/main/resources/application_ja.properties =================================================================== --- userinfo/trunk/src/main/resources/application_ja.properties 2008-12-26 22:11:31 UTC (rev 1622) +++ userinfo/trunk/src/main/resources/application_ja.properties 2008-12-27 22:02:56 UTC (rev 1623) @@ -147,3 +147,11 @@ labels.roleAvailable=\u6709\u52b9\u306a\u30ed\u30fc\u30eb labels.selectedGroups=\u9078\u629e\u3055\u308c\u305f\u30b0\u30eb\u30fc\u30d7 labels.selectedRoles=\u9078\u629e\u3055\u308c\u305f\u30ed\u30fc\u30eb + +labels.status=\u72b6\u614b +labels.active=\u6709\u52b9 +labels.locked=\u30ed\u30c3\u30af +labels.disabled=\u7121\u52b9 +labels.search=\u691c\u7d22 +labels.reset=\u30ea\u30bb\u30c3\u30c8 +labels.all=\u3059\u3079\u3066 \ No newline at end of file Modified: userinfo/trunk/src/main/resources/dbflute.dicon =================================================================== --- userinfo/trunk/src/main/resources/dbflute.dicon 2008-12-26 22:11:31 UTC (rev 1622) +++ userinfo/trunk/src/main/resources/dbflute.dicon 2008-12-27 22:02:56 UTC (rev 1623) @@ -5,71 +5,37 @@ - - - "UTF-8" + + + + + + - + + + + + - - - - + + - - - - - - - - - - - - dbflute.interceptor - - - - - - dbflute.interceptor - - - - - dbflute.interceptor - - - - - dbflute.interceptor - - - - - dbflute.interceptor - - - - - dbflute.interceptor - Modified: userinfo/trunk/src/main/webapp/WEB-INF/db/userinfo.1.log.db =================================================================== (Binary files differ) Modified: userinfo/trunk/src/main/webapp/WEB-INF/db/userinfo.data.db =================================================================== (Binary files differ) Modified: userinfo/trunk/src/main/webapp/WEB-INF/view/userInfo/confirm.jsp =================================================================== --- userinfo/trunk/src/main/webapp/WEB-INF/view/userInfo/confirm.jsp 2008-12-26 22:11:31 UTC (rev 1622) +++ userinfo/trunk/src/main/webapp/WEB-INF/view/userInfo/confirm.jsp 2008-12-27 22:02:56 UTC (rev 1623) @@ -111,6 +111,15 @@

+ + + + +
+ + + + + +
+ + + + + + +
+ + + + + + + "/> + "/> +
+ +
Modified: userinfo/trunk/src/main/webapp/WEB-INF/view/userInfo/rolelist.jsp =================================================================== --- userinfo/trunk/src/main/webapp/WEB-INF/view/userInfo/rolelist.jsp 2008-12-26 22:11:31 UTC (rev 1622) +++ userinfo/trunk/src/main/webapp/WEB-INF/view/userInfo/rolelist.jsp 2008-12-27 22:02:56 UTC (rev 1623) @@ -60,6 +60,7 @@ + ${f:u(u.groupId)} From svnnotify ¡÷ sourceforge.jp Sun Dec 28 07:06:43 2008 From: svnnotify ¡÷ sourceforge.jp (svnnotify ¡÷ sourceforge.jp) Date: Sun, 28 Dec 2008 07:06:43 +0900 Subject: [pal-cvs 3889] [1624] added status column to userinfo table. Message-ID: <1230415603.063464.6129.nullmailer@users.sourceforge.jp> Revision: 1624 http://svn.sourceforge.jp/view?root=pal&view=rev&rev=1624 Author: shinsuke Date: 2008-12-28 07:06:42 +0900 (Sun, 28 Dec 2008) Log Message: ----------- added status column to userinfo table. replaced with dbflute 0.8.7. Modified Paths: -------------- addresslist/trunk/dbflute/_project.bat addresslist/trunk/dbflute/_project.sh addresslist/trunk/mydbflute/README.txt addresslist/trunk/src/main/config/erd/addresslist.erd addresslist/trunk/src/main/config/sql/addresslist.ddl addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/BehaviorSelector.java addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/CacheBehaviorSelector.java addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/DBFluteConfig.java addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/EntityDefinedCommonColumn.java addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/bhv/AbstractBehaviorReadable.java addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/bhv/AbstractBehaviorWritable.java addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/bhv/BehaviorReadable.java addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/bhv/BehaviorWritable.java addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/cbean/AbstractConditionBean.java addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/cbean/AbstractConditionQuery.java addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/cbean/ConditionBean.java addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/cbean/ConditionBeanContext.java addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/cbean/ConditionQuery.java addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/cbean/ckey/ConditionKey.java addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/cbean/coption/FromToOption.java addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/cbean/coption/LikeSearchOption.java addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/cbean/cvalue/ConditionValue.java addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/cbean/outsidesql/OutsideSqlContext.java addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/cbean/outsidesql/OutsideSqlOption.java addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/cbean/outsidesql/executor/OutsideSqlBasicExecutor.java addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/cbean/outsidesql/executor/OutsideSqlCursorExecutor.java addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/cbean/outsidesql/executor/OutsideSqlEntityExecutor.java addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/cbean/outsidesql/executor/OutsideSqlPagingExecutor.java addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/cbean/sqlclause/AbstractSqlClause.java addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/cbean/sqlclause/SqlClause.java addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/cbean/sqlclause/SqlClauseOracle.java addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/dbmeta/AbstractDBMeta.java addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/dbmeta/DBMeta.java addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/dbmeta/DBMetaInstanceHandler.java addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/dbmeta/hierarchy/HierarchyArranger.java addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/dbmeta/hierarchy/HierarchyRequest.java addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/dbmeta/hierarchy/HierarchyRequestElement.java addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/dbmeta/hierarchy/HierarchySourceColumn.java addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/dbmeta/hierarchy/HierarchySourceIterator.java addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/dbmeta/hierarchy/HierarchySourceRow.java addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/dbmeta/info/ColumnInfo.java addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/dbmeta/info/RelationInfo.java addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/helper/MapStringBuilderImpl.java addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/s2dao/FetchNarrowingResultSetWrapper.java addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/s2dao/internal/rshandler/InternalAbstractDtoMetaDataResultSetHandler.java addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/s2dao/internal/sqlcommand/InternalAbstractAutoStaticCommand.java addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/s2dao/internal/sqlcommand/InternalAbstractBatchAutoStaticCommand.java addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/s2dao/internal/sqlcommand/InternalAbstractDynamicCommand.java addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/s2dao/internal/sqlcommand/InternalAbstractSqlCommand.java addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/s2dao/internal/sqlcommand/InternalDeleteAutoStaticCommand.java addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/s2dao/internal/sqlcommand/InternalDeleteBatchAutoStaticCommand.java addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/s2dao/internal/sqlcommand/InternalDeleteQueryAutoDynamicCommand.java addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/s2dao/internal/sqlcommand/InternalInsertAutoDynamicCommand.java addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/s2dao/internal/sqlcommand/InternalInsertBatchAutoStaticCommand.java addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/s2dao/internal/sqlcommand/InternalProcedureCommand.java addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/s2dao/internal/sqlcommand/InternalUpdateAutoDynamicCommand.java addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/s2dao/internal/sqlcommand/InternalUpdateBatchAutoStaticCommand.java addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/s2dao/internal/sqlcommand/InternalUpdateDynamicCommand.java addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/s2dao/internal/sqlcommand/InternalUpdateQueryAutoDynamicCommand.java addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/s2dao/internal/sqlhandler/InternalAbstractAutoHandler.java addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/s2dao/internal/sqlhandler/InternalAbstractBatchAutoHandler.java addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/s2dao/internal/sqlhandler/InternalBasicHandler.java addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/s2dao/internal/sqlhandler/InternalBasicSelectHandler.java addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/s2dao/internal/sqlhandler/InternalBasicUpdateHandler.java addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/s2dao/internal/sqlhandler/InternalInsertAutoHandler.java addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/s2dao/internal/sqlhandler/InternalInsertBatchAutoHandler.java addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/s2dao/internal/sqlhandler/InternalProcedureHandler.java addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/s2dao/internal/sqlhandler/InternalUpdateAutoHandler.java addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/s2dao/internal/sqlparser/InternalSqlParser.java addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/s2dao/internal/various/InternalProcedureMetaDataFactory.java addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/util/SimpleAssertUtil.java addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/util/SimpleStringUtil.java addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/util/SimpleSystemUtil.java addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/bsbhv/BsCompanyBhv.java addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/bsbhv/BsContactBhv.java addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/bsbhv/BsCustomBhv.java addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/bsbhv/BsGroupInfoBhv.java addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/bsbhv/BsGroupMappingBhv.java addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/bsbhv/BsPersonBhv.java addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/bsbhv/BsPostalBhv.java addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/bsbhv/BsRoleInfoBhv.java addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/bsbhv/BsRoleMappingBhv.java addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/bsbhv/BsUserInfoBhv.java addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/bsentity/BsCompany.java addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/bsentity/BsContact.java addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/bsentity/BsCustom.java addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/bsentity/BsGroupInfo.java addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/bsentity/BsGroupMapping.java addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/bsentity/BsPerson.java addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/bsentity/BsPostal.java addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/bsentity/BsRoleInfo.java addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/bsentity/BsRoleMapping.java addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/bsentity/BsUserInfo.java addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/bsentity/dbmeta/CompanyDbm.java addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/bsentity/dbmeta/ContactDbm.java addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/bsentity/dbmeta/CustomDbm.java addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/bsentity/dbmeta/GroupInfoDbm.java addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/bsentity/dbmeta/GroupMappingDbm.java addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/bsentity/dbmeta/PersonDbm.java addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/bsentity/dbmeta/PostalDbm.java addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/bsentity/dbmeta/RoleInfoDbm.java addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/bsentity/dbmeta/RoleMappingDbm.java addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/bsentity/dbmeta/UserInfoDbm.java addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/cbean/bs/BsCompanyCB.java addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/cbean/bs/BsContactCB.java addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/cbean/bs/BsCustomCB.java addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/cbean/bs/BsGroupInfoCB.java addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/cbean/bs/BsGroupMappingCB.java addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/cbean/bs/BsPersonCB.java addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/cbean/bs/BsPostalCB.java addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/cbean/bs/BsRoleInfoCB.java addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/cbean/bs/BsRoleMappingCB.java addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/cbean/bs/BsUserInfoCB.java addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/cbean/cq/bs/AbstractBsCompanyCQ.java addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/cbean/cq/bs/AbstractBsContactCQ.java addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/cbean/cq/bs/AbstractBsCustomCQ.java addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/cbean/cq/bs/AbstractBsGroupInfoCQ.java addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/cbean/cq/bs/AbstractBsGroupMappingCQ.java addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/cbean/cq/bs/AbstractBsPersonCQ.java addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/cbean/cq/bs/AbstractBsPostalCQ.java addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/cbean/cq/bs/AbstractBsRoleInfoCQ.java addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/cbean/cq/bs/AbstractBsRoleMappingCQ.java addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/cbean/cq/bs/AbstractBsUserInfoCQ.java addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/cbean/cq/bs/BsCompanyCQ.java addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/cbean/cq/bs/BsContactCQ.java addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/cbean/cq/bs/BsCustomCQ.java addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/cbean/cq/bs/BsGroupInfoCQ.java addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/cbean/cq/bs/BsGroupMappingCQ.java addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/cbean/cq/bs/BsPersonCQ.java addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/cbean/cq/bs/BsPostalCQ.java addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/cbean/cq/bs/BsRoleInfoCQ.java addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/cbean/cq/bs/BsRoleMappingCQ.java addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/cbean/cq/bs/BsUserInfoCQ.java addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/cbean/cq/ciq/CompanyCIQ.java addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/cbean/cq/ciq/ContactCIQ.java addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/cbean/cq/ciq/CustomCIQ.java addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/cbean/cq/ciq/GroupInfoCIQ.java addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/cbean/cq/ciq/GroupMappingCIQ.java addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/cbean/cq/ciq/PersonCIQ.java addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/cbean/cq/ciq/PostalCIQ.java addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/cbean/cq/ciq/RoleInfoCIQ.java addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/cbean/cq/ciq/RoleMappingCIQ.java addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/cbean/cq/ciq/UserInfoCIQ.java addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/cbean/nss/CompanyNss.java addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/cbean/nss/ContactNss.java addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/cbean/nss/CustomNss.java addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/cbean/nss/GroupInfoNss.java addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/cbean/nss/GroupMappingNss.java addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/cbean/nss/PersonNss.java addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/cbean/nss/PostalNss.java addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/cbean/nss/RoleInfoNss.java addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/cbean/nss/RoleMappingNss.java addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/cbean/nss/UserInfoNss.java addresslist/trunk/src/main/resources/dbflute.dicon addresslist/trunk/src/main/webapp/WEB-INF/db/addresslist.1.log.db addresslist/trunk/src/main/webapp/WEB-INF/db/addresslist.data.db Added Paths: ----------- addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/CommonColumnAutoSetupper.java addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/CommonColumnBasicAutoSetupper.java addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/DBDef.java addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/bhv/core/ addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/bhv/core/BehaviorCommand.java addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/bhv/core/BehaviorCommandComponentSetup.java addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/bhv/core/BehaviorCommandInvoker.java addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/bhv/core/BehaviorInitializer.java addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/bhv/core/SqlExecution.java addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/bhv/core/SqlExecutionCreator.java addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/bhv/core/command/ addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/bhv/core/command/AbstractBehaviorCommand.java addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/bhv/core/command/AbstractEntityCommand.java addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/bhv/core/command/AbstractListEntityCommand.java addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/bhv/core/command/AbstractOutsideSqlCommand.java addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/bhv/core/command/AbstractOutsideSqlSelectCommand.java addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/bhv/core/command/AbstractSelectCBCommand.java addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/bhv/core/command/BatchDeleteEntityCommand.java addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/bhv/core/command/BatchDeleteNonstrictEntityCommand.java addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/bhv/core/command/BatchInsertEntityCommand.java addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/bhv/core/command/BatchUpdateEntityCommand.java addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/bhv/core/command/BatchUpdateNonstrictEntityCommand.java addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/bhv/core/command/DeleteEntityCommand.java addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/bhv/core/command/DeleteNonstrictEntityCommand.java addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/bhv/core/command/InsertEntityCommand.java addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/bhv/core/command/OutsideSqlCallCommand.java addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/bhv/core/command/OutsideSqlExecuteCommand.java addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/bhv/core/command/OutsideSqlSelectCursorCommand.java addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/bhv/core/command/OutsideSqlSelectListCommand.java addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/bhv/core/command/QueryDeleteCBCommand.java addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/bhv/core/command/QueryUpdateEntityCBCommand.java addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/bhv/core/command/SelectCountCBCommand.java addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/bhv/core/command/SelectListCBCommand.java addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/bhv/core/command/SelectNextValCommand.java addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/bhv/core/command/SelectScalarCBCommand.java addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/bhv/core/command/UpdateEntityCommand.java addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/bhv/core/command/UpdateNonstrictEntityCommand.java addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/bhv/core/execution/ addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/bhv/core/execution/BasicSelectExecution.java addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/bhv/core/execution/OutsideSqlSelectExecution.java addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/bhv/core/execution/SelectCBExecution.java addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/cbean/ScalarQuery.java addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/cbean/ckey/ConditionKeyNotLikeSearch.java addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/helper/StringKeyMap.java addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/helper/StringSet.java addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/s2dao/BeanMetaDataFactoryExtension.java addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/s2dao/PropertyTypeFactoryBuilderExtension.java addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/s2dao/SqlLogRegistryLatestSqlProvider.java addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/s2dao/internal/various/InternalIdentifierAbstractGenerator.java addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/s2dao/internal/various/InternalIdentifierAssignedGenerator.java addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/s2dao/internal/various/InternalIdentifierGeneratorFactory.java addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/s2dao/internal/various/InternalIdentifierIdentityGenerator.java addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/s2dao/internal/various/InternalIdentifierSequenceGenerator.java addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/s2dao/internal/various/InternalStatementFactory.java addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/util/SimpleResourceUtil.java addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/util/SimpleTypeUtil.java Removed Paths: ------------- addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/BFinder.java addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/CacheDaoSelector.java addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/DaoReadable.java addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/DaoSelector.java addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/DaoWritable.java addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/GenMetaData.java addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/annotation/OutsideSql.java addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/cbean/SimpleOrderByBean.java addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/cbean/outsidesql/OutsideSqlDao.java addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/s2dao/FetchNarrowingResultSetFactory.java addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/s2dao/S2BeanMetaDataFactoryImpl.java addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/s2dao/S2DaoInterceptor.java addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/s2dao/S2DaoLatestSqlProvider.java addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/s2dao/S2DaoMetaDataExtension.java addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/s2dao/S2DaoMetaDataFactoryImpl.java addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/s2dao/S2DaoPropertyTypeFactoryBuilderExtension.java addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/s2dao/S2DaoSelectDynamicCommand.java addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/bsdao/ addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/exdao/ -------------- next part -------------- Modified: addresslist/trunk/dbflute/_project.bat =================================================================== --- addresslist/trunk/dbflute/_project.bat 2008-12-27 22:02:56 UTC (rev 1623) +++ addresslist/trunk/dbflute/_project.bat 2008-12-27 22:06:42 UTC (rev 1624) @@ -2,4 +2,4 @@ set MY_PROJECT_NAME=addresslist -set DBFLUTE_HOME=..\mydbflute\dbflute-0.8.2 +set DBFLUTE_HOME=..\mydbflute\dbflute-0.8.7 Modified: addresslist/trunk/dbflute/_project.sh =================================================================== --- addresslist/trunk/dbflute/_project.sh 2008-12-27 22:02:56 UTC (rev 1623) +++ addresslist/trunk/dbflute/_project.sh 2008-12-27 22:06:42 UTC (rev 1624) @@ -2,4 +2,4 @@ export MY_PROJECT_NAME=addresslist -export DBFLUTE_HOME=../mydbflute/dbflute-0.8.2 +export DBFLUTE_HOME=../mydbflute/dbflute-0.8.7 Modified: addresslist/trunk/mydbflute/README.txt =================================================================== --- addresslist/trunk/mydbflute/README.txt 2008-12-27 22:02:56 UTC (rev 1623) +++ addresslist/trunk/mydbflute/README.txt 2008-12-27 22:06:42 UTC (rev 1624) @@ -1,3 +1,3 @@ -$ mkdir dbflute-0.8.2 -$ cd dbflute-0.8.2 -$ unzip ../dbflute-0.8.2.zip +$ mkdir dbflute-0.8.7 +$ cd dbflute-0.8.7 +$ unzip ../dbflute-0.8.7.zip Modified: addresslist/trunk/src/main/config/erd/addresslist.erd =================================================================== --- addresslist/trunk/src/main/config/erd/addresslist.erd 2008-12-27 22:02:56 UTC (rev 1623) +++ addresslist/trunk/src/main/config/erd/addresslist.erd 2008-12-27 22:06:42 UTC (rev 1624) @@ -204,6 +204,22 @@ + status + Status + + VARCHAR + String + true + 12 + + 1 + false + false + + false + + + created_time Created Time @@ -233,7 +249,7 @@ updated_time Updated Time - + 10 true false @@ -255,7 +271,7 @@ deleted_time Deleted Time - + 10 false false @@ -292,6 +308,11 @@ + + 255 + 255 + 206 + 407 1315 @@ -384,7 +405,7 @@ created_time Created Time - + 10 true false @@ -406,7 +427,7 @@ updated_time Updated Time - + 10 true false @@ -428,7 +449,7 @@ deleted_time Deleted Time - + 10 false false @@ -450,7 +471,7 @@ versionNo Version No. - + 10 true false @@ -460,6 +481,11 @@ + + 255 + 255 + 206 + 40 1835 @@ -529,6 +555,11 @@ + + 255 + 255 + 206 + 44 757 @@ -686,7 +717,7 @@ created_time Created Time - + 10 true false @@ -708,7 +739,7 @@ updated_time Updated Time - + 10 true false @@ -730,7 +761,7 @@ deleted_time Deleted Time - + 10 false false @@ -752,7 +783,7 @@ versionNo Version No. - + 10 true false @@ -762,6 +793,11 @@ + + 255 + 255 + 206 + 586 1835 @@ -826,6 +862,11 @@ + + 255 + 255 + 206 + 594 757 @@ -1179,6 +1220,11 @@ + + 255 + 255 + 206 + 432 275 @@ -1473,6 +1519,11 @@ + + 255 + 255 + 206 + 305 757 @@ -1603,6 +1654,11 @@ + + 255 + 255 + 206 + 181 40 @@ -1700,6 +1756,11 @@ + + 255 + 255 + 206 + 449 40 @@ -1825,6 +1886,11 @@ + + 255 + 255 + 206 + 717 40 Modified: addresslist/trunk/src/main/config/sql/addresslist.ddl =================================================================== --- addresslist/trunk/src/main/config/sql/addresslist.ddl 2008-12-27 22:02:56 UTC (rev 1623) +++ addresslist/trunk/src/main/config/sql/addresslist.ddl 2008-12-27 22:06:42 UTC (rev 1624) @@ -9,9 +9,9 @@ DROP TABLE role_info; DROP TABLE group_info; -/********************************** -Table Name: Group Information -**********************************/ +/**********************************/ +/* Table Name: Group Information */ +/**********************************/ CREATE TABLE group_info( group_id VARCHAR(255) NOT NULL PRIMARY KEY, name VARCHAR(100), @@ -28,9 +28,9 @@ versionNo INTEGER NOT NULL ); -/********************************** -Table Name: Role Information -**********************************/ +/**********************************/ +/* Table Name: Role Information */ +/**********************************/ CREATE TABLE role_info( role_id VARCHAR(255) NOT NULL PRIMARY KEY, name VARCHAR(100), @@ -47,9 +47,9 @@ versionNo INTEGER NOT NULL ); -/********************************** -Table Name: User Information -**********************************/ +/**********************************/ +/* Table Name: User Information */ +/**********************************/ CREATE TABLE user_info( user_id VARCHAR(255) NOT NULL PRIMARY KEY, given_name VARCHAR(100), @@ -66,6 +66,7 @@ locale VARCHAR(5), role_id VARCHAR(255), group_id VARCHAR(255), + status VARCHAR(1), created_time TIMESTAMP NOT NULL, created_by VARCHAR(255) NOT NULL, updated_time TIMESTAMP NOT NULL, @@ -77,9 +78,9 @@ FOREIGN KEY (role_id) REFERENCES role_info (role_id) ); -/********************************** -Table Name: Group Mapping -**********************************/ +/**********************************/ +/* Table Name: Group Mapping */ +/**********************************/ CREATE TABLE group_mapping( id INTEGER NOT NULL IDENTITY PRIMARY KEY, user_id VARCHAR(255) NOT NULL, @@ -88,9 +89,9 @@ FOREIGN KEY (group_id) REFERENCES group_info (group_id) ); -/********************************** -Table Name: Role Mapping -**********************************/ +/**********************************/ +/* Table Name: Role Mapping */ +/**********************************/ CREATE TABLE role_mapping( id INT NOT NULL IDENTITY PRIMARY KEY, user_id VARCHAR(255) NOT NULL, @@ -99,9 +100,9 @@ FOREIGN KEY (role_id) REFERENCES role_info (role_id) ); -/********************************** -Table Name: Company -**********************************/ +/**********************************/ +/* Table Name: Company */ +/**********************************/ CREATE TABLE company( id BIGINT(19) NOT NULL IDENTITY PRIMARY KEY, user_id VARCHAR(255), @@ -130,9 +131,9 @@ FOREIGN KEY (user_id) REFERENCES user_info (user_id) ); -/********************************** -Table Name: Person -**********************************/ +/**********************************/ +/* Table Name: Person */ +/**********************************/ CREATE TABLE person( id BIGINT(19) NOT NULL IDENTITY PRIMARY KEY, user_id VARCHAR(255), @@ -158,9 +159,9 @@ FOREIGN KEY (user_id) REFERENCES user_info (user_id) ); -/********************************** -Table Name: Custom -**********************************/ +/**********************************/ +/* Table Name: Custom */ +/**********************************/ CREATE TABLE custom( id BIGINT(19) NOT NULL IDENTITY PRIMARY KEY, person_id BIGINT(19) NOT NULL, @@ -169,9 +170,9 @@ FOREIGN KEY (person_id) REFERENCES person (id) ); -/********************************** -Table Name: Contact -**********************************/ +/**********************************/ +/* Table Name: Contact */ +/**********************************/ CREATE TABLE contact( id BIGINT(19) NOT NULL IDENTITY PRIMARY KEY, person_id BIGINT(19) NOT NULL, @@ -180,9 +181,9 @@ FOREIGN KEY (person_id) REFERENCES person (id) ); -/********************************** -Table Name: Postal -**********************************/ +/**********************************/ +/* Table Name: Postal */ +/**********************************/ CREATE TABLE postal( person_id BIGINT(19) NOT NULL PRIMARY KEY, building VARCHAR(200), Deleted: addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/BFinder.java =================================================================== --- addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/BFinder.java 2008-12-27 22:02:56 UTC (rev 1623) +++ addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/BFinder.java 2008-12-27 22:06:42 UTC (rev 1624) @@ -1,110 +0,0 @@ -package jp.sf.pal.addresslist.db.allcommon; - -import jp.sf.pal.addresslist.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 find( - Class behaviorType) { - assertObjectNotNull("behaviorType", behaviorType); - if (!org.seasar.framework.container.factory.SingletonS2ContainerFactory - .hasContainer()) { - synchronized (BFinder.class) { - if (!org.seasar.framework.container.factory.SingletonS2ContainerFactory - .hasContainer()) { - final String configFile = _dbfluteDiconName; - if (org.seasar.framework.util.ResourceUtil - .isExist(configFile)) { - org.seasar.framework.container.factory.SingletonS2ContainerFactory - .setConfigPath(configFile); - org.seasar.framework.container.factory.SingletonS2ContainerFactory - .init(); - } else { - String msg = "S2Container is not initialized! Confirm your initializer and your dicon files."; - throw new IllegalStateException(msg); - } - } - } - } - final org.seasar.framework.container.S2Container container = org.seasar.framework.container.factory.SingletonS2ContainerFactory - .getContainer(); - final BEHAVIOR_TYPE behavior = (BEHAVIOR_TYPE) container - .getComponent(behaviorType); - return behavior; - } - - //========================================================================== - // ========= - // Accessor - // ======== - public static void setDBFluteDiconName(String dbfluteDiconName) { - _dbfluteDiconName = dbfluteDiconName; - } - - //========================================================================== - // ========= - // General Helper - // ============== - /** - * Assert that the object is not null. - * - * @param variableName Variable name. (NotNull) - * @param value Value. (NotNull) - * @exception IllegalArgumentException - */ - protected static void assertObjectNotNull(String variableName, Object value) { - if (variableName == null) { - String msg = "The value should not be null: variableName=" - + variableName + " value=" + value; - throw new IllegalArgumentException(msg); - } - if (value == null) { - String msg = "The value should not be null: variableName=" - + variableName; - throw new IllegalArgumentException(msg); - } - } - - // ---------------------------------------------------------------- - // Assert String - // ------------- - /** - * Assert that the entity is not null and not trimmed empty. - * - * @param variableName Variable name. (NotNull) - * @param value Value. (NotNull) - */ - protected void assertStringNotNullAndNotTrimmedEmpty(String variableName, - String value) { - assertObjectNotNull("variableName", variableName); - assertObjectNotNull("value", value); - if (value.trim().length() == 0) { - String msg = "The value should not be empty: variableName=" - + variableName + " value=" + value; - throw new IllegalArgumentException(msg); - } - } -} Modified: addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/BehaviorSelector.java =================================================================== --- addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/BehaviorSelector.java 2008-12-27 22:02:56 UTC (rev 1623) +++ addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/BehaviorSelector.java 2008-12-27 22:06:42 UTC (rev 1624) @@ -10,8 +10,7 @@ public interface BehaviorSelector { /** - * Initialize condition-bean meta data.
If you call this, Hot Deploy - * of OutsideSql becomes Cool! + * Initialize condition-bean meta data.
*/ public void initializeConditionBeanMetaData(); Modified: addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/CacheBehaviorSelector.java =================================================================== --- addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/CacheBehaviorSelector.java 2008-12-27 22:02:56 UTC (rev 1623) +++ addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/CacheBehaviorSelector.java 2008-12-27 22:06:42 UTC (rev 1624) @@ -1,8 +1,8 @@ package jp.sf.pal.addresslist.db.allcommon; import java.util.Collection; -import java.util.LinkedHashMap; import java.util.Map; +import java.util.concurrent.ConcurrentHashMap; import jp.sf.pal.addresslist.db.allcommon.bhv.BehaviorReadable; import jp.sf.pal.addresslist.db.allcommon.dbmeta.DBMeta; @@ -31,15 +31,14 @@ // Attribute // ========= /** The cache of behavior. (It's the generic hell!) */ - protected Map, BehaviorReadable> _behaviorCache = new LinkedHashMap, BehaviorReadable>(); + protected Map, BehaviorReadable> _behaviorCache = new ConcurrentHashMap, BehaviorReadable>(); //========================================================================== // ========= // Initialize // ========== /** - * Initialize condition-bean meta data.
If you call this, Hot Deploy - * of OutsideSql becomes Cool! + * Initialize condition-bean meta data.
*/ public void initializeConditionBeanMetaData() { final Map dbmetaMap = DBMetaInstanceHandler @@ -53,8 +52,7 @@ } for (DBMeta dbmeta : dbmetas) { final BehaviorReadable bhv = byName(dbmeta.getTableDbName()); - final DaoReadable dao = bhv.getDaoReadable(); - dao.initializeDaoMetaData("selectList"); + bhv.warmUpCommand(); } if (_log.isInfoEnabled()) { long after = System.currentTimeMillis(); Deleted: addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/CacheDaoSelector.java =================================================================== --- addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/CacheDaoSelector.java 2008-12-27 22:02:56 UTC (rev 1623) +++ addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/CacheDaoSelector.java 2008-12-27 22:06:42 UTC (rev 1624) @@ -1,66 +0,0 @@ -package jp.sf.pal.addresslist.db.allcommon; - -import jp.sf.pal.addresslist.db.allcommon.dbmeta.DBMeta; -import jp.sf.pal.addresslist.db.allcommon.dbmeta.DBMetaInstanceHandler; - -/** - * The implementation of DAO-selector. - * - *
- * 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.
- * 
- * - * @author DBFlute(AutoGenerator) - */ - ¡÷ SuppressWarnings("unchecked") -public class CacheDaoSelector extends CacheAbstractSelector implements - DaoSelector { - - //========================================================================== - // ========= - // Selector - // ======== - /** - * Select DAO. - * - * @param The type of DAO. - * @param daoType DAO type. (NotNull) - * @return DAO. (NotNull) - */ - public DAO select(Class 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 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 daoType; - try { - daoType = (Class) Class.forName(daoTypeName); - } catch (ClassNotFoundException e) { - throw new RuntimeException("The class does not exist: " - + daoTypeName, e); - } - return daoType; - } -} Added: addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/CommonColumnAutoSetupper.java =================================================================== --- addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/CommonColumnAutoSetupper.java (rev 0) +++ addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/CommonColumnAutoSetupper.java 2008-12-27 22:06:42 UTC (rev 1624) @@ -0,0 +1,25 @@ +package jp.sf.pal.addresslist.db.allcommon; + +/** + * The auto set-upper of common column. + * + * @author DBFlute(AutoGenerator) + */ +public interface CommonColumnAutoSetupper { + + /** + * Handle common columns of insert if it needs. + * + * @param targetEntity Target entity that the type is entity interface. + * (NotNull) + */ + public void handleCommonColumnOfInsertIfNeeds(Entity targetEntity); + + /** + * Handle common columns of update if it needs. + * + * @param targetEntity Target entity that the type is entity interface. + * (NotNull) + */ + public void handleCommonColumnOfUpdateIfNeeds(Entity targetEntity); +} Property changes on: addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/CommonColumnAutoSetupper.java ___________________________________________________________________ Name: svn:eol-style + native Added: addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/CommonColumnBasicAutoSetupper.java =================================================================== --- addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/CommonColumnBasicAutoSetupper.java (rev 0) +++ addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/CommonColumnBasicAutoSetupper.java 2008-12-27 22:06:42 UTC (rev 1624) @@ -0,0 +1,31 @@ +package jp.sf.pal.addresslist.db.allcommon; + +/** + * The basic implementation of the auto set-upper of common column. + * + * @author DBFlute(AutoGenerator) + */ +public class CommonColumnBasicAutoSetupper implements CommonColumnAutoSetupper { + + //========================================================================== + // =========== + // Set up + // ====== + /** + * Handle common columns of insert if it needs. + * + * @param targetEntity Target entity that the type is entity interface. + * (NotNull) + */ + public void handleCommonColumnOfInsertIfNeeds(Entity targetEntity) { + } + + /** + * Handle common columns of update if it needs. + * + * @param targetEntity Target entity that the type is entity interface. + * (NotNull) + */ + public void handleCommonColumnOfUpdateIfNeeds(Entity targetEntity) { + } +} Property changes on: addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/CommonColumnBasicAutoSetupper.java ___________________________________________________________________ Name: svn:eol-style + native Added: addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/DBDef.java =================================================================== --- addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/DBDef.java (rev 0) +++ addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/DBDef.java 2008-12-27 22:06:42 UTC (rev 1624) @@ -0,0 +1,179 @@ +package jp.sf.pal.addresslist.db.allcommon; + +import java.util.Collections; +import java.util.HashMap; +import java.util.Iterator; +import java.util.Map; +import java.util.Set; + +/** + * The definition of database. + * + * @author DBFlute(AutoGenerator) + */ +public enum DBDef { + + //========================================================================== + // ========= + // ENUM + // ==== + MySQL("mysql", null), PostgreSQL("postgresql", "postgre"), Oracle("oracle", + null), DB2("db2", null), SQLServer("sqlserver", "mssql"), FireBird( + "firebird", null), H2("h2", null), Derby("derby", null), MSAccess( + "msaccess", null), Unknown("unknown", null); + + //========================================================================== + // ========= + // Static Reference + // ================ + // ----------------------------------------------------- + // Code Value + // ---------- + private static final Map _codeValueMap = new HashMap(); + static { + for (DBDef value : values()) { + _codeValueMap.put(value.code().toLowerCase(), value); + } + } + + private static final Map _codeAliasValueMap = new HashMap(); + static { + for (DBDef value : values()) { + if (value.codeAlias() != null) { + _codeAliasValueMap.put(value.codeAlias().toLowerCase(), value); + } + } + } + + /** + * @param code The code of the DB. (Nullable: If the code is null, it + * returns null) + * @return The instance that has the code. (Nullable) + */ + public static DBDef codeOf(String code) { + if (code == null) { + return null; + } + final String lowerCaseCode = code.toLowerCase(); + DBDef def = _codeValueMap.get(lowerCaseCode); + if (def == null) { + def = _codeAliasValueMap.get(lowerCaseCode); + } + return def; + } + + // ----------------------------------------------------- + // Driver Hint + // ----------- + private static final Map _driverHintMap; + static { + final Map tmpMap = new HashMap(); + tmpMap.put("mysql", MySQL); + tmpMap.put("postgresql", PostgreSQL); + tmpMap.put("oracle", Oracle); + tmpMap.put("db2", DB2); + tmpMap.put("sqlserver", SQLServer); + tmpMap.put("firebird", FireBird); + tmpMap.put("org.h2", H2); + tmpMap.put("org.apache.derby", Derby); + _driverHintMap = Collections.unmodifiableMap(tmpMap); + } + + public static DBDef byDriverClassName(String driverClassName) { + final Set keySet = _driverHintMap.keySet(); + for (final Iterator ite = keySet.iterator(); ite.hasNext();) { + final String driverHint = ite.next(); + if (driverClassName.indexOf(driverHint) >= 0) { + final DBDef dbdef = _driverHintMap.get(driverHint); + if (dbdef != null) { + return dbdef; + } + } + } + return null; + } + + //========================================================================== + // ========= + // Current Definition + // ================== + /** The current definition of database. (NotNull, Default 'Unknown') */ + private static DBDef _currentDef; + static { + _currentDef = codeOf("H2"); + if (_currentDef == null) { + _currentDef = Unknown; + } + } + + /** + * @return The current definition of database. (NotNull) + */ + public static DBDef getCurrentDef() { + return _currentDef; + } + + /** + * @param currentDef The current definition of database. (NotNull) + */ + public static void setCurrentDef(DBDef currentDef) { + if (currentDef == null) { + String msg = "The argument 'currentDef' should not be null at DBDef.setCurrentDef()"; + throw new IllegalArgumentException(msg); + } + _currentDef = currentDef; + } + + /** + * @param dbdef The definition of database. (NotNull) + * @return Is the definition of database current? + */ + public static boolean isCurrentDef(DBDef dbdef) { + if (dbdef == null) { + String msg = "The argument 'dbdef' should not be null at DBDef.isCurrentDef()"; + throw new IllegalArgumentException(msg); + } + return _currentDef != null ? _currentDef.equals(dbdef) : false; + } + + //========================================================================== + // ========= + // Attribute + // ========= + /** The code of the DB. (NotNull) */ + private String _code; + + /** The code alias of the DB. (Nullable) */ + private String _codeAlias; + + //========================================================================== + // ========= + // Constructor + // =========== + /** + * @param code The code of the DB. (NotNull) + * @param codeAlias The code alias of the DB. (Nullable) + */ + private DBDef(String code, String codeAlias) { + _code = code; + _codeAlias = codeAlias; + } + + //========================================================================== + // ========= + // Accessor + // ======== + /** + * @return The code of the DB. (NotNull) + */ + public String code() { + return _code; + } + + /** + * @return The code alias of the DB. (Nullable) + */ + private String codeAlias() { + return _codeAlias; + } +} Property changes on: addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/DBDef.java ___________________________________________________________________ Name: svn:eol-style + native Modified: addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/DBFluteConfig.java =================================================================== --- addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/DBFluteConfig.java 2008-12-27 22:02:56 UTC (rev 1623) +++ addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/DBFluteConfig.java 2008-12-27 22:06:42 UTC (rev 1624) @@ -24,10 +24,6 @@ // ========= protected StatementConfig _defaultStatementConfig; - protected boolean _conditionBeanFormatSql = true;// This is for - - // compatibility! - protected boolean _queryLogLevelInfo; protected boolean _executeStatusLogLevelInfo; @@ -36,10 +32,6 @@ protected UniqueConstraintDeterminator _uniqueConstraintDeterminator; - protected boolean _sqlExceptionOldStyleHandling = false;// This is for - - // compatibility! - protected String _logDateFormat; protected String _logTimestampFormat; @@ -92,27 +84,6 @@ //========================================================================== // ========= - // ConditionBean Format Sql - // ======================== - public boolean isConditionBeanFormatSql() { - return _conditionBeanFormatSql; - } - - /** - * @param conditionBeanFormatSql The value of the config. - * @deprecated This is for compatibility! - */ - public void setConditionBeanFormatSql(boolean conditionBeanFormatSql) { - assertNotLocked(); - if (_log.isInfoEnabled()) { - _log.info("...Setting conditionBeanFormatSql: " - + conditionBeanFormatSql); - } - _conditionBeanFormatSql = conditionBeanFormatSql; - } - - //========================================================================== - // ========= // Query Log Level Info // ==================== public boolean isQueryLogLevelInfo() { @@ -184,31 +155,8 @@ public boolean isUniqueConstraintException(Throwable t); } - // [DBFlute-0.7.7] //========================================================================== // ========= - // SQL Exception Old Style - // ======================= - public boolean isSqlExceptionOldStyleHandling() { - return _sqlExceptionOldStyleHandling; - } - - /** - * @param sqlExceptionOldStyleHandling The value of the config. - * @deprecated This is for compatibility! - */ - public void setSqlExceptionOldStyleHandling( - boolean sqlExceptionOldStyleHandling) { - assertNotLocked(); - if (_log.isInfoEnabled()) { - _log.info("...Setting sqlExceptionOldStyleHandling: " - + sqlExceptionOldStyleHandling); - } - _sqlExceptionOldStyleHandling = sqlExceptionOldStyleHandling; - } - - //========================================================================== - // ========= // Log Format // ========== public String getLogDateFormat() { @@ -303,7 +251,6 @@ // ============ public void clear() { // the only properties that update OK while executing _defaultStatementConfig = null; - _conditionBeanFormatSql = true; // as default _queryLogLevelInfo = false; _executeStatusLogLevelInfo = false; _useSqlLogRegistry = false; Deleted: addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/DaoReadable.java =================================================================== --- addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/DaoReadable.java 2008-12-27 22:02:56 UTC (rev 1623) +++ addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/DaoReadable.java 2008-12-27 22:06:42 UTC (rev 1624) @@ -1,11 +0,0 @@ -package jp.sf.pal.addresslist.db.allcommon; - -/** - * The interface of dao-readable. - * - * @author DBFlute(AutoGenerator) - */ -public interface DaoReadable { - public void initializeDaoMetaData(String methodName);// Very Internal - // Method! -} Deleted: addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/DaoSelector.java =================================================================== --- addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/DaoSelector.java 2008-12-27 22:02:56 UTC (rev 1623) +++ addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/DaoSelector.java 2008-12-27 22:06:42 UTC (rev 1624) @@ -1,26 +0,0 @@ -package jp.sf.pal.addresslist.db.allcommon; - -/** - * The interface of DAO-selector. - * - * @author DBFlute(AutoGenerator) - */ -public interface DaoSelector { - - /** - * Select DAO. - * - * @param The type of DAO. - * @param daoType DAO type. (NotNull) - * @return Dao. (NotNull) - */ - public DAO select(Class daoType); - - /** - * Select DAO-readable by name. - * - * @param tableFlexibleName Table flexible name. (NotNull) - * @return DAO-readable. (NotNull) - */ - public DaoReadable byName(String tableFlexibleName); -} Deleted: addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/DaoWritable.java =================================================================== --- addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/DaoWritable.java 2008-12-27 22:02:56 UTC (rev 1623) +++ addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/DaoWritable.java 2008-12-27 22:06:42 UTC (rev 1624) @@ -1,70 +0,0 @@ -package jp.sf.pal.addresslist.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 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 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 entityList); -} Modified: addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/EntityDefinedCommonColumn.java =================================================================== --- addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/EntityDefinedCommonColumn.java 2008-12-27 22:02:56 UTC (rev 1623) +++ addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/EntityDefinedCommonColumn.java 2008-12-27 22:06:42 UTC (rev 1624) @@ -8,6 +8,12 @@ public interface EntityDefinedCommonColumn extends Entity { /** + * Enable common column auto set up. {for after disable because the default + * is enabled} + */ + public void enableCommonColumnAutoSetup(); + + /** * Disable common column auto set up. */ public void disableCommonColumnAutoSetup(); Deleted: addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/GenMetaData.java =================================================================== --- addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/GenMetaData.java 2008-12-27 22:02:56 UTC (rev 1623) +++ addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/GenMetaData.java 2008-12-27 22:06:42 UTC (rev 1624) @@ -1,258 +0,0 @@ -package jp.sf.pal.addresslist.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.addresslist.db.allcommon"; - } - - /** - * Get the property-value of baseBehaviorPackage. - * - * @return The property-value. - */ - public String getBaseBehaviorPackage() { - return "jp.sf.pal.addresslist.db.bsbhv"; - } - - /** - * Get the property-value of baseDaoPackage. - * - * @return The property-value. - */ - public String getBaseDaoPackage() { - return "jp.sf.pal.addresslist.db.bsdao"; - } - - /** - * Get the property-value of baseEntityPackage. - * - * @return The property-value. - */ - public String getBaseEntityPackage() { - return "jp.sf.pal.addresslist.db.bsentity"; - } - - /** - * Get the property-value of conditionBeanPackage. - * - * @return The property-value. - */ - public String getConditionBeanPackage() { - return "jp.sf.pal.addresslist.db.cbean"; - } - - /** - * Get the property-value of extendedDaoPackage. - * - * @return The property-value. - */ - public String getExtendedDaoPackage() { - return "jp.sf.pal.addresslist.db.exdao"; - } - - /** - * Get the property-value of extendedBehaviorPackage. - * - * @return The property-value. - */ - public String getExtendedBehaviorPackage() { - return "jp.sf.pal.addresslist.db.exbhv"; - } - - /** - * Get the property-value of extendedEntityPackage. - * - * @return The property-value. - */ - public String getExtendedEntityPackage() { - return "jp.sf.pal.addresslist.db.exentity"; - } - - //========================================================================== - // ========= - // Optimistic Lock - // =============== - /** - * Get the property-value of updateDateFieldName. - * - * @return The property-value. - */ - public String getUpdateDateFieldName() { - return ""; - } - - /** - * Get the property-value of versionNoFieldName. - * - * @return The property-value. - */ - public String getVersionNoFieldName() { - return ""; - } - - //========================================================================== - // ========= - // Extract - // ======= - /** - * Get the value of 'extractAcceptStartBrace'. - * - * @return The property-value. (NotNull) - */ - public String getExtractAcceptStartBrace() { - return "@{"; - } - - /** - * Get the value of 'extractAcceptEndBrace'. - * - * @return The property-value. (NotNull) - */ - public String getExtractAcceptEndBrace() { - return "@}"; - } - - /** - * Get the value of 'extractAcceptDelimiter'. - * - * @return The property-value. (NotNull) - */ - public String getExtractAcceptDelimiter() { - return "@;"; - } - - /** - * Get the value of 'extractAcceptEqual'. - * - * @return The property-value. (NotNull) - */ - public String getExtractAcceptEqual() { - return "@="; - } -} Deleted: addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/annotation/OutsideSql.java =================================================================== --- addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/annotation/OutsideSql.java 2008-12-27 22:02:56 UTC (rev 1623) +++ addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/annotation/OutsideSql.java 2008-12-27 22:06:42 UTC (rev 1624) @@ -1,18 +0,0 @@ -package jp.sf.pal.addresslist.db.allcommon.annotation; - -import java.lang.annotation.ElementType; -import java.lang.annotation.Inherited; -import java.lang.annotation.Retention; -import java.lang.annotation.RetentionPolicy; -import java.lang.annotation.Target; - - ¡÷ Inherited - ¡÷ Retention(RetentionPolicy.RUNTIME) - ¡÷ Target(ElementType.METHOD) -public @interface OutsideSql { - boolean dynamicBinding() default false; - - boolean offsetByCursor() default false; - - boolean limitByCursor() default false; -} Modified: addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/bhv/AbstractBehaviorReadable.java =================================================================== --- addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/bhv/AbstractBehaviorReadable.java 2008-12-27 22:02:56 UTC (rev 1623) +++ addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/bhv/AbstractBehaviorReadable.java 2008-12-27 22:06:42 UTC (rev 1624) @@ -11,10 +11,16 @@ import java.util.Set; import jp.sf.pal.addresslist.db.allcommon.BehaviorSelector; -import jp.sf.pal.addresslist.db.allcommon.DaoSelector; import jp.sf.pal.addresslist.db.allcommon.Entity; import jp.sf.pal.addresslist.db.allcommon.bhv.batch.TokenFileOutputOption; import jp.sf.pal.addresslist.db.allcommon.bhv.batch.TokenFileOutputResult; +import jp.sf.pal.addresslist.db.allcommon.bhv.core.BehaviorCommand; +import jp.sf.pal.addresslist.db.allcommon.bhv.core.BehaviorCommandInvoker; +import jp.sf.pal.addresslist.db.allcommon.bhv.core.command.AbstractBehaviorCommand; +import jp.sf.pal.addresslist.db.allcommon.bhv.core.command.SelectCountCBCommand; +import jp.sf.pal.addresslist.db.allcommon.bhv.core.command.SelectListCBCommand; +import jp.sf.pal.addresslist.db.allcommon.bhv.core.command.SelectNextValCommand; +import jp.sf.pal.addresslist.db.allcommon.bhv.core.command.SelectScalarCBCommand; import jp.sf.pal.addresslist.db.allcommon.bhv.load.LoadReferrerOption; import jp.sf.pal.addresslist.db.allcommon.bhv.setup.ValueLabelBox; import jp.sf.pal.addresslist.db.allcommon.bhv.setup.ValueLabelSetupper; @@ -25,8 +31,9 @@ import jp.sf.pal.addresslist.db.allcommon.cbean.PagingHandler; import jp.sf.pal.addresslist.db.allcommon.cbean.PagingInvoker; import jp.sf.pal.addresslist.db.allcommon.cbean.PagingResultBean; -import jp.sf.pal.addresslist.db.allcommon.cbean.outsidesql.OutsideSqlDao; +import jp.sf.pal.addresslist.db.allcommon.cbean.ScalarQuery; import jp.sf.pal.addresslist.db.allcommon.cbean.outsidesql.executor.OutsideSqlBasicExecutor; +import jp.sf.pal.addresslist.db.allcommon.cbean.sqlclause.SqlClause; import jp.sf.pal.addresslist.db.allcommon.dbmeta.info.ColumnInfo; import jp.sf.pal.addresslist.db.allcommon.helper.token.file.FileMakingHeaderInfo; import jp.sf.pal.addresslist.db.allcommon.helper.token.file.FileMakingOption; @@ -35,11 +42,10 @@ import jp.sf.pal.addresslist.db.allcommon.util.SimpleSystemUtil; /** - * The abstract class of behavior-readable. + * The abstract class of readable behavior. * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public abstract class AbstractBehaviorReadable implements BehaviorReadable { //========================================================================== @@ -50,13 +56,13 @@ * Behavior-selector instance. It's basically referred at loadReferrer. * (Required for loadReferrer) */ - protected BehaviorSelector _behaviorSelector; + protected BehaviorCommandInvoker _behaviorCommandInvoker; /** - * Dao-selector instance. It's basically referred at loadReferrer. (Required - * for OutsideSql) + * Behavior-selector instance. It's basically referred at loadReferrer. + * (Required for loadReferrer) */ - protected DaoSelector _daoSelector; + protected BehaviorSelector _behaviorSelector; //========================================================================== // =========== @@ -83,7 +89,7 @@ * @return Read count. (NotNull) */ public int readCount(ConditionBean cb) { - assertConditionBeanNotNull(cb); + assertCBNotNull(cb); return callReadCount(cb); } @@ -100,7 +106,7 @@ * When the entity has been duplicated. */ public Entity readEntity(ConditionBean cb) { - assertConditionBeanNotNull(cb); + assertCBNotNull(cb); final List ls = readList(cb); if (ls.isEmpty()) { return null; @@ -120,7 +126,7 @@ * When the entity has been duplicated. */ public Entity readEntityWithDeletedCheck(ConditionBean cb) { - assertConditionBeanNotNull(cb); + assertCBNotNull(cb); final List ls = readList(cb); assertEntityNotDeleted(ls, cb); assertEntitySelectedAsOne(ls, cb); @@ -133,7 +139,7 @@ // =========================== protected ENTITY helpSelectEntityInternally( CB cb, InternalSelectEntityCallback callback) { - assertConditionBeanNotNull(cb); + assertCBNotNull(cb); cb.checkSafetyResult(1); List ls = null; try { @@ -156,7 +162,7 @@ protected ENTITY helpSelectEntityWithDeletedCheckInternally( CB cb, InternalSelectEntityWithDeletedCheckCallback callback) { - assertConditionBeanNotNull(cb); + assertCBNotNull(cb); cb.checkSafetyResult(1); List ls = null; try { @@ -175,7 +181,7 @@ } //========================================================================== - // =========== + // ========= // List Read // ========= /** @@ -186,7 +192,7 @@ * list. (NotNull) */ public ListResultBean readList(ConditionBean cb) { - assertConditionBeanNotNull(cb); + assertCBNotNull(cb); return new jp.sf.pal.addresslist.db.allcommon.cbean.ResultBeanBuilder( getTableDbName()).buildListResultBean(cb, callReadList(cb)); } @@ -198,7 +204,7 @@ * @return Read page. (NotNull) */ public PagingResultBean readPage(final ConditionBean cb) { - assertConditionBeanNotNull(cb); + assertCBNotNull(cb); final PagingInvoker invoker = new PagingInvoker( getTableDbName()); final PagingHandler handler = new PagingHandler() { @@ -225,9 +231,7 @@ * @exception jp.sf.pal.addresslist.db.allcommon.exception.EntityAlreadyDeletedException * When the entity has already been deleted. */ - protected void assertEntityNotDeleted( - jp.sf.pal.addresslist.db.allcommon.Entity entity, - Object searchKey4Log) { + protected void assertEntityNotDeleted(Entity entity, Object searchKey4Log) { if (entity == null) { throwEntityAlreadyDeletedException(searchKey4Log); } @@ -240,7 +244,8 @@ * @param searchKey4Log Search-key for Logging. (NotNull) * @exception jp.sf.pal.addresslist.db.allcommon.exception.EntityAlreadyDeletedException */ - protected void assertEntityNotDeleted(List ls, Object searchKey4Log) { + protected void assertEntityNotDeleted(List ls, + Object searchKey4Log) { if (ls == null || ls.isEmpty()) { throwEntityAlreadyDeletedException(searchKey4Log); } @@ -254,7 +259,8 @@ * @exception jp.sf.pal.addresslist.db.allcommon.exception.EntityAlreadyDeletedException * @exception jp.sf.pal.addresslist.db.allcommon.exception.EntityDuplicatedException */ - protected void assertEntitySelectedAsOne(List ls, Object searchKey4Log) { + protected void assertEntitySelectedAsOne(List ls, + Object searchKey4Log) { if (ls == null || ls.isEmpty()) { throwEntityAlreadyDeletedException(searchKey4Log); } @@ -275,49 +281,254 @@ //========================================================================== // ========= - // Various Select - // ============== - public OutsideSqlBasicExecutor outsideSql() { - assertDaoSelectorNotNull("outsideSql"); - final OutsideSqlDao outsideSqlDao = _daoSelector - .select(OutsideSqlDao.class); - return new OutsideSqlBasicExecutor(outsideSqlDao, getTableDbName()); - } + // Scalar Select + // ============= + /** + * The scalar function.
This is not static class because this uses + * the method 'invoke(BehaviorCommand)' + * + * @param The type of condition-bean. + * @param The type of result. + */ + public class SLFunction { // SL: ScaLar - private void assertDaoSelectorNotNull(String methodName) { - if (_daoSelector == null) { + /** The condition-bean for scalar select. (NotNull) */ + protected CB _conditionBean; + + /** The condition-bean for scalar select. (NotNull) */ + protected Class _resultType; + + /** + * @param conditionBean The condition-bean initialized only for scalar + * select. (NotNull) + * @param resultType The type os result. (NotNull) + */ + public SLFunction(CB conditionBean, Class resultType) { + _conditionBean = conditionBean; + _resultType = resultType; + } + + /** + * Select the maximum value.
+ * + *
+         * memberBhv.scalarSelect(Date.class).max(new ScalarQuery(MemberCB cb) {
+         *     cb.specify().columnMemberBirthday(); // the required specification of target column
+         *     cb.query().setMemberStatusCode_Equal_Formalized(); // query as you like it
+         * });
+         * 
+ * + * @param scalarQuery The query for scalar. (NotNull) + * @return The maximum value. (Nullable) + */ + public RESULT max(ScalarQuery scalarQuery) { + assertObjectNotNull("scalarQuery", scalarQuery); + return exec(scalarQuery, SqlClause.SelectClauseType.MAX); + } + + /** + * Select the minimum value.
+ * + *
+         * memberBhv.scalarSelect(Date.class).min(new ScalarQuery(MemberCB cb) {
+         *     cb.specify().columnMemberBirthday(); // the required specification of target column
+         *     cb.query().setMemberStatusCode_Equal_Formalized(); // query as you like it
+         * });
+         * 
+ * + * @param scalarQuery The query for scalar. (NotNull) + * @return The minimum value. (Nullable) + */ + public RESULT min(ScalarQuery scalarQuery) { + assertObjectNotNull("scalarQuery", scalarQuery); + return exec(scalarQuery, SqlClause.SelectClauseType.MIN); + } + + /** + * Select the summary value.
+ * + *
+         * purchaseBhv.scalarSelect(Integer.class).sum(new ScalarQuery(PurchaseCB cb) {
+         *     cb.specify().columnPurchaseCount(); // the required specification of target column
+         *     cb.query().setPurchaseDatetime_GreaterEqual(date); // query as you like it
+         * });
+         * 
+ * + * @param scalarQuery The query for scalar. (NotNull) + * @return The summary value. (Nullable) + */ + public RESULT sum(ScalarQuery scalarQuery) { + assertObjectNotNull("scalarQuery", scalarQuery); + return exec(scalarQuery, SqlClause.SelectClauseType.SUM); + } + + /** + * Select the average value.
+ * + *
+         * purchaseBhv.scalarSelect(Integer.class).avg(new ScalarQuery(PurchaseCB cb) {
+         *     cb.specify().columnPurchaseCount(); // the required specification of target column
+         *     cb.query().setPurchaseDatetime_GreaterEqual(date); // query as you like it
+         * });
+         * 
+ * + * @param scalarQuery The query for scalar. (NotNull) + * @return The average value. (Nullable) + */ + public RESULT avg(ScalarQuery scalarQuery) { + assertObjectNotNull("scalarQuery", scalarQuery); + return exec(scalarQuery, SqlClause.SelectClauseType.AVG); + } + + protected RESULT exec(ScalarQuery scalarQuery, + SqlClause.SelectClauseType selectClauseType) { + assertObjectNotNull("scalarQuery", scalarQuery); + assertObjectNotNull("selectClauseType", selectClauseType); + assertObjectNotNull("conditionBean", _conditionBean); + assertObjectNotNull("resultType", _resultType); + scalarQuery.query(_conditionBean); + assertScalarSelectRequiredSpecifyColumn(); + return invoke(createSelectScalarCBCommand(_conditionBean, + _resultType, selectClauseType)); + } + + protected void assertScalarSelectRequiredSpecifyColumn() { + final String columnName = _conditionBean.getSqlClause() + .getSpecifiedColumnNameAsOne(); + if (columnName == null) { + throwScalarSelectInvalidColumnSpecificationException(); + } + } + + protected void throwScalarSelectInvalidColumnSpecificationException() { String msg = "Look! Read the message below." + getLineSeparator(); msg = msg + "/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *" + getLineSeparator(); - msg = msg - + "Not found the selector of dao as behavior's attributed!" + msg = msg + "The specified column for scalar select was Invalid!" + getLineSeparator(); msg = msg + getLineSeparator(); msg = msg + "[Advice]" + getLineSeparator(); msg = msg - + "Please confirm the definition of the selector at your 'dbflute.dicon'." + + " You should call specify().column[TargetColumn]() only once." + getLineSeparator(); - msg = msg + "It is precondition that '" + methodName - + "()' needs the selector instance." + getLineSeparator(); - msg = msg + getLineSeparator(); - msg = msg + "[Your Behavior's Attributes]" + getLineSeparator(); - msg = msg + " _behaviorSelector : " + _behaviorSelector + msg = msg + " For example:" + getLineSeparator(); + msg = msg + " " + getLineSeparator(); + msg = msg + " [Wrong]" + getLineSeparator(); + msg = msg + " /- - - - - - - - - - - - - - - - - - - - " + getLineSeparator(); - msg = msg + " _daoSelector : " + _daoSelector + msg = msg + + " memberBhv.scalarSelect(Date.class).max(new ScalarQuery() {" + getLineSeparator(); - msg = msg + "* * * * * * * * * */" + getLineSeparator(); - throw new IllegalStateException(msg); + msg = msg + " public void query(MemberCB cb) {" + + getLineSeparator(); + msg = msg + " // *No! It's empty!" + getLineSeparator(); + msg = msg + " }" + getLineSeparator(); + msg = msg + " });" + getLineSeparator(); + msg = msg + " - - - - - - - - - -/" + getLineSeparator(); + msg = msg + " " + getLineSeparator(); + msg = msg + " [Wrong]" + getLineSeparator(); + msg = msg + " /- - - - - - - - - - - - - - - - - - - - " + + getLineSeparator(); + msg = msg + + " memberBhv.scalarSelect(Date.class).max(new ScalarQuery() {" + + getLineSeparator(); + msg = msg + " public void query(MemberCB cb) {" + + getLineSeparator(); + msg = msg + " cb.specify().columnMemberBirthday();" + + getLineSeparator(); + msg = msg + + " cb.specify().columnRegisterDatetime(); // *No! It's duplicated!" + + getLineSeparator(); + msg = msg + " }" + getLineSeparator(); + msg = msg + " });" + getLineSeparator(); + msg = msg + " - - - - - - - - - -/" + getLineSeparator(); + msg = msg + " " + getLineSeparator(); + msg = msg + " [Good!]" + getLineSeparator(); + msg = msg + " /- - - - - - - - - - - - - - - - - - - - " + + getLineSeparator(); + msg = msg + + " memberBhv.scalarSelect(Date.class).max(new ScalarQuery() {" + + getLineSeparator(); + msg = msg + " public void query(MemberCB cb) {" + + getLineSeparator(); + msg = msg + + " cb.specify().columnMemberBirthday(); // *Point!" + + getLineSeparator(); + msg = msg + " }" + getLineSeparator(); + msg = msg + " });" + getLineSeparator(); + msg = msg + " - - - - - - - - - -/" + getLineSeparator(); + msg = msg + getLineSeparator(); + msg = msg + "[ConditionBean Type]" + getLineSeparator() + + _conditionBean.getClass().getName() + getLineSeparator(); + msg = msg + getLineSeparator(); + msg = msg + "[Result Type]" + getLineSeparator() + + _resultType.getName() + getLineSeparator(); + msg = msg + "* * * * * * * * * */"; + throw new ScalarSelectInvalidColumnSpecificationException(msg); } } + public static class ScalarSelectInvalidColumnSpecificationException extends + RuntimeException { + private static final long serialVersionUID = 1L; + + public ScalarSelectInvalidColumnSpecificationException(String msg) { + super(msg); + } + } + + //========================================================================== + // ========= + // OutsideSql + // ========== /** - * Create value-label list. + * Get the basic executor of outside-SQL.
The invoker of behavior + * command should be not null when you call this method. * + *
+     * You can use the methods for outside-SQL are as follows:
+     * {Basic}
+     *   o selectList()
+     *   o execute()
+     *   o call()
+     * 
+     * {Entity}
+     *   o entityHandling().selectEntity()
+     *   o entityHandling().selectEntityWithDeletedCheck()
+     * 
+     * {Cursor}
+     *   o cursorHandling().selectCursor()
+     * 
+     * {Paging}
+     *   o autoPaging().selectList()
+     *   o autoPaging().selectPage()
+     *   o manualPaging().selectList()
+     *   o manualPaging().selectPage()
+     * 
+     * {Option -- Dynamic}
+     *   o dynamicBinding().selectList()
+     * 
+ * + * @return The basic executor of outside-SQL. (NotNull) + */ + public OutsideSqlBasicExecutor outsideSql() { + assertBehaviorCommandInvoker("outsideSql"); + return new OutsideSqlBasicExecutor(_behaviorCommandInvoker, + getTableDbName()); + } + + //========================================================================== + // ========= + // Various Select + // ============== + /** + * Create the list of value-label. + * * @param The type of entity. * @param entityList The list of entity. (NotNull) - * @param valueLabelSetupper Value-label-setupper. (NotNull) - * @return Value-label list. (NotNull) + * @param valueLabelSetupper The setupper of value-label. (NotNull) + * @return The list of value-label. (NotNull) */ public List> createValueLabelList( List entityList, @@ -363,10 +574,10 @@ } } - protected Object helpConvertingSequenceObject(Class resultClass, + protected Object helpConvertingSequenceObject(Class resultClass, Object sequenceObject) { try { - final Constructor constructor = resultClass + final Constructor constructor = resultClass .getConstructor(new Class[] { String.class }); return constructor.newInstance(new Object[] { sequenceObject .toString() }); @@ -535,6 +746,7 @@ * @param value The value of primary key. (Nullable) * @return The value of primary key. (Nullable) */ + @SuppressWarnings("unchecked") protected PK toLowerCasePrimaryKeyIfString(PK value) { return (PK) toLowerCaseIfString(value); } @@ -581,22 +793,22 @@ + "/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *" + getLineSeparator(); msg = msg - + "Not found the selector of behavior as behavior's attributed!" + + "Not found the selector of behavior as behavior's attribute!" + getLineSeparator(); msg = msg + getLineSeparator(); msg = msg + "[Advice]" + getLineSeparator(); msg = msg - + "Please confirm the definition of the selector at your 'dbflute.dicon'." + + "Please confirm the definition of the selector at your component configuration of DBFlute." + getLineSeparator(); msg = msg + "It is precondition that '" + methodName + "()' needs the selector instance." + getLineSeparator(); msg = msg + getLineSeparator(); msg = msg + "[Your Behavior's Attributes]" + getLineSeparator(); - msg = msg + " _behaviorSelector : " + _behaviorSelector + msg = msg + " _behaviorCommandInvoker : " + + _behaviorCommandInvoker + getLineSeparator(); + msg = msg + " _behaviorSelector : " + _behaviorSelector + getLineSeparator(); - msg = msg + " _daoSelector : " + _daoSelector - + getLineSeparator(); - msg = msg + "* * * * * * * * * */" + getLineSeparator(); + msg = msg + "* * * * * * * * * */"; throw new IllegalStateException(msg); } } @@ -649,14 +861,14 @@ public TokenFileOutputResult outputTokenFile(ConditionBean cb, String filename, TokenFileOutputOption tokenFileOutputOption) throws java.io.FileNotFoundException, java.io.IOException { - assertConditionBeanNotNull(cb); + assertCBNotNull(cb); assertStringNotNullAndNotTrimmedEmpty("filename", filename); assertObjectNotNull("tokenFileOutputOption", tokenFileOutputOption); final List ls = readList(cb); List> rowList = new ArrayList>(); - for (java.util.Iterator ite = ls.iterator(); ite.hasNext();) { - final Entity entity = (Entity) ite.next(); + for (java.util.Iterator ite = ls.iterator(); ite.hasNext();) { + final Entity entity = ite.next(); final List valueList = getDBMeta() .convertToColumnStringValueList(entity); rowList.add(valueList); @@ -666,9 +878,9 @@ .getFileMakingOption(); final FileMakingHeaderInfo fileMakingHeaderInfo = new FileMakingHeaderInfo(); final List columnDbNameList = new ArrayList(); - for (final java.util.Iterator ite = getDBMeta().getColumnInfoList() - .iterator(); ite.hasNext();) { - final ColumnInfo columnInfo = (ColumnInfo) ite.next(); + for (final java.util.Iterator ite = getDBMeta() + .getColumnInfoList().iterator(); ite.hasNext();) { + final ColumnInfo columnInfo = ite.next(); columnDbNameList.add(columnInfo.getColumnDbName()); } fileMakingHeaderInfo.setColumnNameList(columnDbNameList); @@ -691,7 +903,7 @@ * @return All count. */ protected int callGetCountAll() { - return readCount(newConditionBean()); + return callReadCount(newConditionBean()); } /** @@ -700,7 +912,7 @@ * @return All list. (NotNull) */ protected List callGetListAll() { - return readList(newConditionBean()); + return callReadList(newConditionBean()); } /** @@ -711,14 +923,12 @@ * @return Read count. (NotNull) */ protected int callReadCount(ConditionBean cb) { - assertConditionBeanNotNull(cb); - final Class[] types = new Class[] { cb.getClass() }; - final java.lang.reflect.Method mtd = getMethod(getDaoReadable() - .getClass(), "selectCount", types); - final Object result = invoke(mtd, getDaoReadable(), new Object[] { cb }); - return ((Integer) result).intValue(); + assertCBNotNull(cb); + return doCallReadCount(cb); } + protected abstract int doCallReadCount(ConditionBean cb); + /** * The implementation. * @@ -728,42 +938,110 @@ * (NotNull) */ protected List 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) result; + assertCBNotNull(cb); + return doCallReadList(cb); } - private Method getMethod(Class clazz, String methodName, Class[] argTypes) { - try { - return clazz.getMethod(methodName, argTypes); - } catch (NoSuchMethodException ex) { - String msg = "class=" + clazz + " method=" + methodName + "-" - + java.util.Arrays.asList(argTypes); - throw new RuntimeException(msg, ex); + protected abstract List doCallReadList(ConditionBean cb); + + //========================================================================== + // ========= + // Behavior Command + // ================ + public void warmUpCommand() { + { + SelectCountCBCommand cmd = createSelectCountCBCommand(newConditionBean()); + cmd.setInitializeOnly(true); + invoke(cmd); } + { + SelectListCBCommand cmd = createSelectListCBCommand( + newConditionBean(), getDBMeta().getEntityType()); + cmd.setInitializeOnly(true); + invoke(cmd); + } } - private Object invoke(Method method, Object target, Object[] args) { - try { - return method.invoke(target, args); - } catch (java.lang.reflect.InvocationTargetException ex) { - Throwable t = ex.getCause(); - if (t instanceof RuntimeException) { - throw (RuntimeException) t; - } - if (t instanceof Error) { - throw (Error) t; - } - String msg = "target=" + target + " method=" + method + "-" - + java.util.Arrays.asList(args); - throw new RuntimeException(msg, ex); - } catch (IllegalAccessException ex) { - String msg = "target=" + target + " method=" + method + "-" - + java.util.Arrays.asList(args); - throw new RuntimeException(msg, ex); + protected SelectCountCBCommand createSelectCountCBCommand(ConditionBean cb) { + assertBehaviorCommandInvoker("createSelectCountCBCommand"); + final SelectCountCBCommand command = xsetupSelectCommand(new SelectCountCBCommand()); + command.setConditionBeanType(cb.getClass()); + command.setConditionBean(cb); + return command; + } + + protected SelectListCBCommand createSelectListCBCommand( + ConditionBean cb, Class entityType) { + assertBehaviorCommandInvoker("createSelectListCBCommand"); + final SelectListCBCommand command = xsetupSelectCommand(new SelectListCBCommand()); + command.setConditionBeanType(cb.getClass()); + command.setConditionBean(cb); + command.setEntityType(entityType); + return command; + } + + protected SelectNextValCommand createSelectNextValCommand( + Class resultType) { + assertBehaviorCommandInvoker("createSelectNextValCommand"); + final SelectNextValCommand command = xsetupSelectCommand(new SelectNextValCommand()); + command.setResultType(resultType); + return command; + } + + protected SelectScalarCBCommand createSelectScalarCBCommand( + ConditionBean cb, Class resultType, + SqlClause.SelectClauseType selectClauseType) { + assertBehaviorCommandInvoker("createSelectScalarCBCommand"); + final SelectScalarCBCommand command = xsetupSelectCommand(new SelectScalarCBCommand()); + command.setConditionBeanType(cb.getClass()); + command.setConditionBean(cb); + command.setResultType(resultType); + command.setSelectClauseType(selectClauseType); + return command; + } + + private > COMMAND xsetupSelectCommand( + COMMAND command) { + command.setTableDbName(getTableDbName()); + _behaviorCommandInvoker.injectComponentProperty(command); + return command; + } + + /** + * Invoke the command of behavior. + * + * @param The type of result. + * @param behaviorCommand The command of behavior. (NotNull) + * @return The instance of result. (Nullable) + */ + protected RESULT invoke(BehaviorCommand behaviorCommand) { + return _behaviorCommandInvoker.invoke(behaviorCommand); + } + + protected void assertBehaviorCommandInvoker(String methodName) { + if (_behaviorCommandInvoker == null) { + String msg = "Look! Read the message below." + getLineSeparator(); + msg = msg + + "/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *" + + getLineSeparator(); + msg = msg + + "Not found the invoker of behavior command as behavior's attributed!" + + getLineSeparator(); + msg = msg + getLineSeparator(); + msg = msg + "[Advice]" + getLineSeparator(); + msg = msg + + "Please confirm the definition of the invoker at your 'dbflute.dicon'." + + getLineSeparator(); + msg = msg + "It is precondition that '" + methodName + + "()' needs the invoker instance." + getLineSeparator(); + msg = msg + getLineSeparator(); + msg = msg + "[Your Behavior's Attributes]" + getLineSeparator(); + msg = msg + " _behaviorCommandInvoker : " + + _behaviorCommandInvoker + getLineSeparator(); + msg = msg + " _behaviorSelector : " + _behaviorSelector + + getLineSeparator(); + msg = msg + "* * * * * * * * * */"; + throw new IllegalStateException(msg); } } @@ -801,6 +1079,7 @@ return SimpleSystemUtil.getLineSeparator(); } + @SuppressWarnings("unchecked") protected ENTITY helpDowncastInternally( Entity entity, Class clazz) { assertObjectNotNull("entity", entity); @@ -851,8 +1130,16 @@ * * @param cb Condition-bean. (NotNull) */ - protected void assertConditionBeanNotNull( - jp.sf.pal.addresslist.db.allcommon.cbean.ConditionBean cb) { + protected void assertConditionBeanNotNull(ConditionBean cb) { + assertCBNotNull(cb); + } + + /** + * Assert that the condition-bean is not null. + * + * @param cb Condition-bean. (NotNull) + */ + protected void assertCBNotNull(ConditionBean cb) { assertObjectNotNull("cb", cb); } @@ -897,7 +1184,7 @@ * * @param ls List. (NotNull) */ - protected void assertListNotNullAndEmpty(List ls) { + protected void assertListNotNullAndEmpty(List ls) { assertObjectNotNull("ls", ls); if (!ls.isEmpty()) { String msg = "The list should be empty: ls=" + ls.toString(); @@ -910,7 +1197,7 @@ * * @param ls List. (NotNull) */ - protected void assertListNotNullAndNotEmpty(List ls) { + protected void assertListNotNullAndNotEmpty(List ls) { assertObjectNotNull("ls", ls); if (ls.isEmpty()) { String msg = "The list should not be empty: ls=" + ls.toString(); @@ -923,7 +1210,7 @@ * * @param ls List. (NotNull) */ - protected void assertListNotNullAndHasOnlyOne(List ls) { + protected void assertListNotNullAndHasOnlyOne(List ls) { assertObjectNotNull("ls", ls); if (ls.size() != 1) { String msg = "The list should contain only one object: ls=" @@ -937,38 +1224,39 @@ // Accessor // ======== /** - * Get the selector of behavior. + * Get the invoker of behavior command. * - * @return The select of behavior. (Nullable: But normally NotNull) + * @return The invoker of behavior command. (Nullable: But normally NotNull) */ - protected BehaviorSelector getBehaviorSelector() { - return _behaviorSelector; + protected BehaviorCommandInvoker getBehaviorCommandInvoker() { + return _behaviorCommandInvoker; } /** - * Set the selector of behavior. + * Set the invoker of behavior command. * - * @param behaviorSelector The selector of behavior. (NotNull) + * @param behaviorCommandInvoker The invoker of behavior command. (NotNull) */ - public void setBehaviorSelector(BehaviorSelector behaviorSelector) { - this._behaviorSelector = behaviorSelector; + public void setBehaviorCommandInvoker( + BehaviorCommandInvoker behaviorCommandInvoker) { + this._behaviorCommandInvoker = behaviorCommandInvoker; } /** - * Get the selector of DAO. + * Get the selector of behavior. * - * @return The select of DAO. (Nullable: But normally NotNull) + * @return The select of behavior. (Nullable: But normally NotNull) */ - protected DaoSelector getDaoSelector() { - return _daoSelector; + protected BehaviorSelector getBehaviorSelector() { + return _behaviorSelector; } /** - * Set the selector of DAO. + * Set the selector of behavior. * - * @param daoSelector The selector of DAO. (NotNull) + * @param behaviorSelector The selector of behavior. (NotNull) */ - public void setDaoSelector(DaoSelector daoSelector) { - _daoSelector = daoSelector; + public void setBehaviorSelector(BehaviorSelector behaviorSelector) { + this._behaviorSelector = behaviorSelector; } } Modified: addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/bhv/AbstractBehaviorWritable.java =================================================================== --- addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/bhv/AbstractBehaviorWritable.java 2008-12-27 22:02:56 UTC (rev 1623) +++ addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/bhv/AbstractBehaviorWritable.java 2008-12-27 22:06:42 UTC (rev 1624) @@ -4,10 +4,25 @@ import java.util.Iterator; import java.util.List; +import jp.sf.pal.addresslist.db.allcommon.CommonColumnAutoSetupper; import jp.sf.pal.addresslist.db.allcommon.Entity; import jp.sf.pal.addresslist.db.allcommon.bhv.batch.TokenFileReflectionFailure; import jp.sf.pal.addresslist.db.allcommon.bhv.batch.TokenFileReflectionOption; import jp.sf.pal.addresslist.db.allcommon.bhv.batch.TokenFileReflectionResult; +import jp.sf.pal.addresslist.db.allcommon.bhv.core.command.AbstractEntityCommand; +import jp.sf.pal.addresslist.db.allcommon.bhv.core.command.AbstractListEntityCommand; +import jp.sf.pal.addresslist.db.allcommon.bhv.core.command.BatchDeleteEntityCommand; +import jp.sf.pal.addresslist.db.allcommon.bhv.core.command.BatchDeleteNonstrictEntityCommand; +import jp.sf.pal.addresslist.db.allcommon.bhv.core.command.BatchInsertEntityCommand; +import jp.sf.pal.addresslist.db.allcommon.bhv.core.command.BatchUpdateEntityCommand; +import jp.sf.pal.addresslist.db.allcommon.bhv.core.command.BatchUpdateNonstrictEntityCommand; +import jp.sf.pal.addresslist.db.allcommon.bhv.core.command.DeleteEntityCommand; +import jp.sf.pal.addresslist.db.allcommon.bhv.core.command.DeleteNonstrictEntityCommand; +import jp.sf.pal.addresslist.db.allcommon.bhv.core.command.InsertEntityCommand; +import jp.sf.pal.addresslist.db.allcommon.bhv.core.command.QueryDeleteCBCommand; +import jp.sf.pal.addresslist.db.allcommon.bhv.core.command.QueryUpdateEntityCBCommand; +import jp.sf.pal.addresslist.db.allcommon.bhv.core.command.UpdateEntityCommand; +import jp.sf.pal.addresslist.db.allcommon.bhv.core.command.UpdateNonstrictEntityCommand; import jp.sf.pal.addresslist.db.allcommon.cbean.ConditionBean; import jp.sf.pal.addresslist.db.allcommon.dbmeta.DBMeta; import jp.sf.pal.addresslist.db.allcommon.helper.MapStringBuilder; @@ -20,7 +35,7 @@ import jp.sf.pal.addresslist.db.allcommon.helper.token.file.impl.FileTokenImpl; /** - * The abstract class of behavior-writable. + * The abstract class of writable behavior. * * @author DBFlute(AutoGenerator) */ @@ -29,6 +44,31 @@ //========================================================================== // ========= + // Definition + // ========== + /** Map-string map-mark. */ + private static final String MAP_STRING_MAP_MARK = "map:"; + + /** Map-string start-brace. */ + private static final String MAP_STRING_START_BRACE = "@{"; + + /** Map-string end-brace. */ + private static final String MAP_STRING_END_BRACE = "@}"; + + /** Map-string delimiter. */ + private static final String MAP_STRING_DELIMITER = "@;"; + + /** Map-string equal. */ + private static final String MAP_STRING_EQUAL = "@="; + + //========================================================================== + // =========== + // Attribute + // ========= + protected CommonColumnAutoSetupper _commonColumnAutoSetupper; + + //========================================================================== + // ========= // Entity Update // ============= // ----------------------------------------------------- @@ -357,7 +397,7 @@ * @param entityList Entity list. (NotNull and NotEmpty) * @return The array of created count. */ - public int[] lumpCreate(java.util.List entityList) { + public int[] lumpCreate(List entityList) { assertListNotNullAndNotEmpty(entityList); return callCreateList(entityList); } @@ -370,7 +410,7 @@ * @exception jp.sf.pal.addresslist.db.allcommon.exception.EntityAlreadyUpdatedException * If s2dao's version is over 1.0.47 (contains 1.0.47). */ - public int[] lumpModify(java.util.List entityList) { + public int[] lumpModify(List entityList) { assertListNotNullAndNotEmpty(entityList); return callModifyList(entityList); } @@ -383,7 +423,7 @@ * @exception jp.sf.pal.addresslist.db.allcommon.exception.EntityAlreadyUpdatedException * If s2dao's version is over 1.0.47 (contains 1.0.47). */ - public int[] lumpRemove(java.util.List entityList) { + public int[] lumpRemove(List entityList) { assertListNotNullAndNotEmpty(entityList); return callRemoveList(entityList); } @@ -611,9 +651,11 @@ if (!processBeforeInsert(entity)) { return 1;/* as Normal End */ } - return getDaoWritable().create(entity); + return doCallCreate(entity); } + protected abstract int doCallCreate(Entity entity); + /** * Process before insert. * @@ -645,9 +687,11 @@ if (!processBeforeUpdate(entity)) { return 1;/* as Normal End */ } - return getDaoWritable().modifyModifiedOnly(entity); + return doCallModify(entity); } + protected abstract int doCallModify(Entity entity); + /** * Process before update. * @@ -678,9 +722,11 @@ if (!processBeforeDelete(entity)) { return 1;/* as Normal End */ } - return getDaoWritable().remove(entity); + return doCallRemove(entity); } + protected abstract int doCallRemove(Entity entity); + /** * Process before delete. * @@ -729,8 +775,38 @@ * (NotNull) */ protected void setupCommonColumnOfInsertIfNeeds(Entity targetEntity) { + final CommonColumnAutoSetupper setupper = getCommonColumnAutoSetupper(); + assertCommonColumnAutoSetupperNotNull(); + setupper.handleCommonColumnOfInsertIfNeeds(targetEntity); } + private void assertCommonColumnAutoSetupperNotNull() { + if (_commonColumnAutoSetupper == null) { + String msg = "Look! Read the message below." + getLineSeparator(); + msg = msg + + "/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *" + + getLineSeparator(); + msg = msg + + "Not found the auto set-upper of common column as behavior's attribute!" + + getLineSeparator(); + msg = msg + getLineSeparator(); + msg = msg + "[Advice]" + getLineSeparator(); + msg = msg + + "Please confirm the definition of the set-upper at your component configuration of DBFlute." + + getLineSeparator(); + msg = msg + getLineSeparator(); + msg = msg + "[Your Behavior's Attributes]" + getLineSeparator(); + msg = msg + " _behaviorCommandInvoker : " + + _behaviorCommandInvoker + getLineSeparator(); + msg = msg + " _behaviorSelector : " + _behaviorSelector + + getLineSeparator(); + msg = msg + " _commonColumnAutoSetupper : " + + _commonColumnAutoSetupper + getLineSeparator(); + msg = msg + "* * * * * * * * * */"; + throw new IllegalStateException(msg); + } + } + /** * Filter the entity of insert. * @@ -778,6 +854,9 @@ * (NotNull) */ protected void setupCommonColumnOfUpdateIfNeeds(Entity targetEntity) { + final CommonColumnAutoSetupper setupper = getCommonColumnAutoSetupper(); + assertCommonColumnAutoSetupperNotNull(); + setupper.handleCommonColumnOfUpdateIfNeeds(targetEntity); } /** @@ -843,12 +922,14 @@ * (NotNull) * @return Inserted count. */ - public int[] callCreateList(java.util.List entityList) { + public int[] callCreateList(List entityList) { assertObjectNotNull("entityList", entityList); helpFilterBeforeInsertInternally(entityList); - return getDaoWritable().createList(entityList); + return doCreateList(entityList); } + protected abstract int[] doCreateList(List entityList); + /** * The implementation. * @@ -856,12 +937,14 @@ * (NotNull) * @return Updated count. */ - public int[] callModifyList(java.util.List entityList) { + public int[] callModifyList(List entityList) { assertObjectNotNull("entityList", entityList); helpFilterBeforeUpdateInternally(entityList); - return getDaoWritable().modifyList(entityList); + return doModifyList(entityList); } + protected abstract int[] doModifyList(List entityList); + /** * The implementation. * @@ -869,12 +952,14 @@ * (NotNull) * @return Deleted count. */ - public int[] callRemoveList(java.util.List entityList) { + public int[] callRemoveList(List entityList) { assertObjectNotNull("entityList", entityList); helpFilterBeforeDeleteInternally(entityList); - return getDaoWritable().removeList(entityList); + return doRemoveList(entityList); } + protected abstract int[] doRemoveList(List entityList); + protected void assertEntityHasVersionNoValue(Entity entity) { if (!getDBMeta().hasVersionNo()) { return; @@ -994,4 +1079,148 @@ } return filteredList; } + + //========================================================================== + // ========= + // Behavior Command + // ================ + protected InsertEntityCommand createInsertEntityCommand(Entity entity) { + assertBehaviorCommandInvoker("createInsertEntityCommand"); + return xsetupEntityCommand(new InsertEntityCommand(), entity); + } + + protected UpdateEntityCommand createUpdateEntityCommand(Entity entity) { + assertBehaviorCommandInvoker("createUpdateEntityCommand"); + return xsetupEntityCommand(new UpdateEntityCommand(), entity); + } + + protected UpdateNonstrictEntityCommand createUpdateNonstrictEntityCommand( + Entity entity) { + assertBehaviorCommandInvoker("createUpdateNonstrictEntityCommand"); + return xsetupEntityCommand(new UpdateNonstrictEntityCommand(), entity); + } + + protected DeleteEntityCommand createDeleteEntityCommand(Entity entity) { + assertBehaviorCommandInvoker("createDeleteEntityCommand"); + return xsetupEntityCommand(new DeleteEntityCommand(), entity); + } + + protected DeleteNonstrictEntityCommand createDeleteNonstrictEntityCommand( + Entity entity) { + assertBehaviorCommandInvoker("createDeleteNonstrictEntityCommand"); + return xsetupEntityCommand(new DeleteNonstrictEntityCommand(), entity); + } + + private COMMAND xsetupEntityCommand( + COMMAND command, Entity entity) { + command.setTableDbName(getTableDbName()); + _behaviorCommandInvoker.injectComponentProperty(command); + command.setEntityType(entity.getClass()); + command.setEntity(entity); + return command; + } + + protected BatchInsertEntityCommand createBatchInsertEntityCommand( + List entityList) { + assertBehaviorCommandInvoker("createBatchInsertEntityCommand"); + return xsetupListEntityCommand(new BatchInsertEntityCommand(), + entityList); + } + + protected BatchUpdateEntityCommand createBatchUpdateEntityCommand( + List entityList) { + assertBehaviorCommandInvoker("createBatchUpdateEntityCommand"); + return xsetupListEntityCommand(new BatchUpdateEntityCommand(), + entityList); + } + + protected BatchUpdateNonstrictEntityCommand createBatchUpdateNonstrictEntityCommand( + List entityList) { + assertBehaviorCommandInvoker("createBatchUpdateNonstrictEntityCommand"); + return xsetupListEntityCommand(new BatchUpdateNonstrictEntityCommand(), + entityList); + } + + protected BatchDeleteEntityCommand createBatchDeleteEntityCommand( + List entityList) { + assertBehaviorCommandInvoker("createBatchDeleteEntityCommand"); + return xsetupListEntityCommand(new BatchDeleteEntityCommand(), + entityList); + } + + protected BatchDeleteNonstrictEntityCommand createBatchDeleteNonstrictEntityCommand( + List entityList) { + assertBehaviorCommandInvoker("createBatchDeleteNonstrictEntityCommand"); + return xsetupListEntityCommand(new BatchDeleteNonstrictEntityCommand(), + entityList); + } + + /** + * @param The type of behavior command for list entity. + * @param command The command of behavior. (NotNull) + * @param entityList The list of entity. (NotNull, NotEmpty) + * @return The command of behavior. (NotNull) + */ + private COMMAND xsetupListEntityCommand( + COMMAND command, List entityList) { + if (entityList.isEmpty()) { + String msg = "The argument 'entityList' should not be empty: " + + entityList; + throw new IllegalStateException(msg); + } + command.setTableDbName(getTableDbName()); + _behaviorCommandInvoker.injectComponentProperty(command); + command.setEntityType(entityList.get(0).getClass()); // *The list should + // not be empty! + command.setEntityList(entityList); + return command; + } + + protected QueryDeleteCBCommand createQueryDeleteCBCommand(ConditionBean cb) { + assertBehaviorCommandInvoker("createQueryDeleteCBCommand"); + final QueryDeleteCBCommand cmd = new QueryDeleteCBCommand(); + cmd.setTableDbName(getTableDbName()); + _behaviorCommandInvoker.injectComponentProperty(cmd); + cmd.setConditionBeanType(cb.getClass()); + cmd.setConditionBean(cb); + return cmd; + } + + protected QueryUpdateEntityCBCommand createQueryUpdateEntityCBCommand( + Entity entity, ConditionBean cb) { + assertBehaviorCommandInvoker("createQueryUpdateEntityCBCommand"); + final QueryUpdateEntityCBCommand cmd = new QueryUpdateEntityCBCommand(); + cmd.setTableDbName(getTableDbName()); + _behaviorCommandInvoker.injectComponentProperty(cmd); + cmd.setConditionBeanType(cb.getClass()); + cmd.setConditionBean(cb); + cmd.setEntityType(entity.getClass()); + cmd.setEntity(entity); + return cmd; + } + + //========================================================================== + // ========= + // Accessor + // ======== + /** + * Get the auto set-upper of common column. + * + * @return The auto set-upper of common column. (Nullable: But normally + * NotNull) + */ + protected CommonColumnAutoSetupper getCommonColumnAutoSetupper() { + return _commonColumnAutoSetupper; + } + + /** + * Set the auto set-upper of common column. + * + * @param commonColumnAutoSetupper The auto set-upper of common column. + * (NotNull) + */ + public void setCommonColumnAutoSetupper( + CommonColumnAutoSetupper commonColumnAutoSetupper) { + this._commonColumnAutoSetupper = commonColumnAutoSetupper; + } } Modified: addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/bhv/BehaviorReadable.java =================================================================== --- addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/bhv/BehaviorReadable.java 2008-12-27 22:02:56 UTC (rev 1623) +++ addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/bhv/BehaviorReadable.java 2008-12-27 22:06:42 UTC (rev 1624) @@ -1,6 +1,5 @@ package jp.sf.pal.addresslist.db.allcommon.bhv; -import jp.sf.pal.addresslist.db.allcommon.DaoReadable; import jp.sf.pal.addresslist.db.allcommon.Entity; import jp.sf.pal.addresslist.db.allcommon.cbean.ConditionBean; import jp.sf.pal.addresslist.db.allcommon.cbean.ListResultBean; @@ -16,34 +15,12 @@ //========================================================================== // ========= - // Definition - // ========== - /** Map-string map-mark. */ - public static final String MAP_STRING_MAP_MARK = "map:"; - - /** Map-string list-mark. */ - public static final String MAP_STRING_LIST_MARK = "list:"; - - /** Map-string start-brace. */ - public static final String MAP_STRING_START_BRACE = "@{"; - - /** Map-string end-brace. */ - public static final String MAP_STRING_END_BRACE = "@}"; - - /** Map-string delimiter. */ - public static final String MAP_STRING_DELIMITER = "@;"; - - /** Map-string equal. */ - public static final String MAP_STRING_EQUAL = "@="; - - //========================================================================== - // ========= // Table name // ========== /** - * Get table db-name. + * Get table DB name. * - * @return Table db-name. (NotNull) + * @return Table DB name. (NotNull) */ public String getTableDbName(); @@ -52,25 +29,14 @@ // DBMeta // ====== /** - * Get dbmeta. + * Get the instance of DBMeta. * - * @return DBMeta. (NotNull) + * @return The instance of DBMeta. (NotNull) */ public DBMeta getDBMeta(); //========================================================================== // ========= - // Dao Accessor - // ============ - /** - * Get dao-readable. - * - * @return Dao-readable. (NotNull) - */ - public DaoReadable getDaoReadable(); - - //========================================================================== - // ========= // New Instance // ============ /** @@ -173,4 +139,13 @@ * @return The value of sequence. (NotNull) */ public java.math.BigDecimal readNextVal(); + + //========================================================================== + // ========= + // Warm Up + // ======= + /** + * Warm up the command of behavior. + */ + public void warmUpCommand(); } Modified: addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/bhv/BehaviorWritable.java =================================================================== --- addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/bhv/BehaviorWritable.java 2008-12-27 22:02:56 UTC (rev 1623) +++ addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/bhv/BehaviorWritable.java 2008-12-27 22:06:42 UTC (rev 1624) @@ -1,6 +1,7 @@ package jp.sf.pal.addresslist.db.allcommon.bhv; -import jp.sf.pal.addresslist.db.allcommon.DaoWritable; +import java.util.List; + import jp.sf.pal.addresslist.db.allcommon.Entity; /** @@ -10,13 +11,6 @@ */ public interface BehaviorWritable extends BehaviorReadable { - /** - * Get dao-writable. - * - * @return Dao-writable. (NotNull) - */ - public DaoWritable getDaoWritable(); - //========================================================================== // =========== // Basic Entity Update @@ -116,15 +110,15 @@ /** * Lump create the list. * - * @param entityList Entity-list. (NotNull and NotEmpty) + * @param entityList The list of entity. (NotNull and NotEmpty) * @return The array of created count. */ - public int[] lumpCreate(java.util.List entityList); + public int[] lumpCreate(List entityList); /** - * Lump Modify the list. + * Lump modify the list. * - * @param entityList Entity-list. (NotNull and NotEmpty) + * @param entityList The list of entity. (NotNull and NotEmpty) * @return Modified count. * @exception jp.sf.pal.addresslist.db.allcommon.exception.EntityAlreadyUpdatedException * When the entity has already been updated. And Only when @@ -132,12 +126,12 @@ * @exception jp.sf.pal.addresslist.db.allcommon.exception.EntityDuplicatedException * When the entity has been duplicated. */ - public int[] lumpModify(java.util.List entityList); + public int[] lumpModify(List entityList); /** * Lump remove the list. * - * @param entityList Entity-list. (NotNull and NotEmpty) + * @param entityList The list of entity. (NotNull and NotEmpty) * @return Removed count. * @exception jp.sf.pal.addresslist.db.allcommon.exception.EntityAlreadyUpdatedException * When the entity has already been updated. And Only when @@ -145,5 +139,5 @@ * @exception jp.sf.pal.addresslist.db.allcommon.exception.EntityDuplicatedException * When the entity has been duplicated. */ - public int[] lumpRemove(java.util.List entityList); + public int[] lumpRemove(List entityList); } Added: addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/bhv/core/BehaviorCommand.java =================================================================== --- addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/bhv/core/BehaviorCommand.java (rev 0) +++ addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/bhv/core/BehaviorCommand.java 2008-12-27 22:06:42 UTC (rev 1624) @@ -0,0 +1,71 @@ +package jp.sf.pal.addresslist.db.allcommon.bhv.core; + +import jp.sf.pal.addresslist.db.allcommon.cbean.ConditionBean; +import jp.sf.pal.addresslist.db.allcommon.cbean.outsidesql.OutsideSqlOption; + +/** + * @author DBFlute(AutoGenerator) + * @param The type of result. + */ +public interface BehaviorCommand { + + //========================================================================== + // ========= + // Basic Information + // ================= + public String getTableDbName(); + + public String getCommandName(); + + /** + * Get the return type of command. This type is not related to generic type + * because this is for conversion and check only. + * + * @return The return type of command. (NotNull) + */ + public Class getCommandReturnType(); + + public boolean isInitializeOnly(); + + //========================================================================== + // ========= + // Detail Information + // ================== + public boolean isConditionBean(); + + public boolean isOutsideSql(); + + public boolean isProcedure(); + + public boolean isSelect(); + + public boolean isSelectCount(); + + //========================================================================== + // ========= + // Process Callback + // ================ + public void beforeGettingSqlExecution(); + + public void afterExecuting(); + + //========================================================================== + // ========= + // SqlExecution Handling + // ===================== + public String buildSqlExecutionKey(); + + public SqlExecutionCreator createSqlExecutionCreator(); + + public Object[] getSqlExecutionArgument(); + + //========================================================================== + // ========= + // Argument Information + // ==================== + public ConditionBean getConditionBean(); + + public String getOutsideSqlPath(); + + public OutsideSqlOption getOutsideSqlOption(); +} Property changes on: addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/bhv/core/BehaviorCommand.java ___________________________________________________________________ Name: svn:eol-style + native Added: addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/bhv/core/BehaviorCommandComponentSetup.java =================================================================== --- addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/bhv/core/BehaviorCommandComponentSetup.java (rev 0) +++ addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/bhv/core/BehaviorCommandComponentSetup.java 2008-12-27 22:06:42 UTC (rev 1624) @@ -0,0 +1,23 @@ +package jp.sf.pal.addresslist.db.allcommon.bhv.core; + +import javax.sql.DataSource; + +import org.seasar.dao.BeanMetaDataFactory; +import org.seasar.dao.ValueTypeFactory; +import org.seasar.extension.jdbc.StatementFactory; + +/** + * @author DBFlute(AutoGenerator) + */ +public interface BehaviorCommandComponentSetup { + + public void setDataSource(DataSource dataSource); + + public void setStatementFactory(StatementFactory statementFactory); + + public void setBeanMetaDataFactory(BeanMetaDataFactory beanMetaDataFactory); + + public void setValueTypeFactory(ValueTypeFactory valueTypeFactory); + + public void setSqlFileEncoding(String sqlFileEncoding); +} Property changes on: addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/bhv/core/BehaviorCommandComponentSetup.java ___________________________________________________________________ Name: svn:eol-style + native Added: addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/bhv/core/BehaviorCommandInvoker.java =================================================================== --- addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/bhv/core/BehaviorCommandInvoker.java (rev 0) +++ addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/bhv/core/BehaviorCommandInvoker.java 2008-12-27 22:06:42 UTC (rev 1624) @@ -0,0 +1,842 @@ +package jp.sf.pal.addresslist.db.allcommon.bhv.core; + +import java.util.Arrays; +import java.util.List; +import java.util.Map; +import java.util.concurrent.ConcurrentHashMap; + +import javax.sql.DataSource; + +import jp.sf.pal.addresslist.db.allcommon.DBFluteConfig; +import jp.sf.pal.addresslist.db.allcommon.Entity; +import jp.sf.pal.addresslist.db.allcommon.InternalMapContext; +import jp.sf.pal.addresslist.db.allcommon.XLog; +import jp.sf.pal.addresslist.db.allcommon.cbean.ConditionBeanContext; +import jp.sf.pal.addresslist.db.allcommon.cbean.FetchNarrowingBeanContext; +import jp.sf.pal.addresslist.db.allcommon.cbean.outsidesql.OutsideSqlContext; +import jp.sf.pal.addresslist.db.allcommon.dbmeta.DBMeta; +import jp.sf.pal.addresslist.db.allcommon.dbmeta.DBMetaInstanceHandler; +import jp.sf.pal.addresslist.db.allcommon.helper.stacktrace.InvokeNameExtractingResource; +import jp.sf.pal.addresslist.db.allcommon.helper.stacktrace.InvokeNameResult; +import jp.sf.pal.addresslist.db.allcommon.helper.stacktrace.impl.InvokeNameExtractorImpl; +import jp.sf.pal.addresslist.db.allcommon.jdbc.StatementConfig; +import jp.sf.pal.addresslist.db.allcommon.s2dao.internal.various.InternalStatementFactory; +import jp.sf.pal.addresslist.db.allcommon.util.SimpleSystemUtil; +import jp.sf.pal.addresslist.db.allcommon.util.SimpleTypeUtil; +import jp.sf.pal.addresslist.db.allcommon.util.TraceViewUtil; + +import org.seasar.dao.BeanMetaDataFactory; +import org.seasar.dao.ValueTypeFactory; +import org.seasar.extension.jdbc.StatementFactory; +import org.seasar.framework.util.Disposable; +import org.seasar.framework.util.DisposableUtil; + +/** + * The invoker of behavior command. + * + *
+ * public interface methods are as follows:
+ * 
+ *   o injectComponentProperty(BehaviorCommandComponentSetup behaviorCommand);
+ *   o invoke(BehaviorCommand behaviorCommand);
+ *   o isDisposable();
+ *   o isExecutionCacheEmpty();
+ * 
+ * + * @author DBFlute(AutoGenerator) + */ +public class BehaviorCommandInvoker implements Disposable { + + //========================================================================== + // ========= + // Attribute + // ========= + // ----------------------------------------------------- + // Injection Target + // ---------------- + protected DataSource _dataSource; + + protected BeanMetaDataFactory _beanMetaDataFactory; + + protected ValueTypeFactory _valueTypeFactory; + + // ----------------------------------------------------- + // Fixed Property + // -------------- + protected final StatementFactory _statementFactory = createStatememtFactory(); + + protected final Map _executionMap = new ConcurrentHashMap(); + + // ----------------------------------------------------- + // Dispose Status + // -------------- + protected boolean disposable; + + //========================================================================== + // ========= + // Constructor + // =========== + public BehaviorCommandInvoker() { + } + + //========================================================================== + // ========= + // Command Set up + // ============== + /** + * Inject the properties of component to the command of behavior. {Public + * Interface} + * + * @param behaviorCommand The command of behavior. (NotNull) + */ + public void injectComponentProperty( + BehaviorCommandComponentSetup behaviorCommand) { + behaviorCommand.setDataSource(_dataSource); + behaviorCommand.setStatementFactory(_statementFactory); + behaviorCommand.setBeanMetaDataFactory(_beanMetaDataFactory); + behaviorCommand.setValueTypeFactory(_valueTypeFactory); + behaviorCommand.setSqlFileEncoding(getSqlFileEncoding()); + } + + protected String getSqlFileEncoding() { + return "UTF-8"; // This value is set when generating. + } + + //========================================================================== + // ========= + // Command Invoke + // ============== + /** + * Invoke the command of behavior. {Public Interface} This method is an + * entry point! + * + * @param The type of result. + * @param behaviorCommand The command of behavior. (NotNull) + * @return The result object. (Nullable) + */ + public RESULT invoke(BehaviorCommand behaviorCommand) { + clearContext(); + try { + return doInvoke(behaviorCommand); + } finally { + clearContext(); + } + } + + /** + * @param The type of result. + * @param behaviorCommand The command of behavior. (NotNull) + * @return The result object. (Nullable) + */ + protected RESULT doInvoke(BehaviorCommand behaviorCommand) { + // - - - - - - - - - - - - - + // Initialize SQL Execution + // - - - - - - - - - - - - - + if (behaviorCommand.isInitializeOnly()) { + initializeSqlExecution(behaviorCommand); + return null; // The end! (Initialize Only) + } + behaviorCommand.beforeGettingSqlExecution(); + + SqlExecution execution = null; + try { + final String key = behaviorCommand.buildSqlExecutionKey(); + execution = getSqlExecution(key); + if (execution == null) { + long beforeCmd = 0; + if (isLogEnabled()) { + beforeCmd = System.currentTimeMillis(); + } + SqlExecutionCreator creator = behaviorCommand + .createSqlExecutionCreator(); + execution = getSqlExecution(key, creator); + if (isLogEnabled()) { + final long afterCmd = System.currentTimeMillis(); + if (beforeCmd != afterCmd) { + logSqlExecution(behaviorCommand, execution, beforeCmd, + afterCmd); + } + } + } + } finally { + if (isLogEnabled()) { + logInvocation(behaviorCommand); + } + } + + long before = 0; + if (isLogEnabled()) { + before = System.currentTimeMillis(); + } + + Object ret = null; + try { + final Object[] args = behaviorCommand.getSqlExecutionArgument(); + ret = executeSql(execution, args); + } finally { + behaviorCommand.afterExecuting(); + } + final Class retType = behaviorCommand.getCommandReturnType(); + assertRetType(retType, ret); + + if (isLogEnabled()) { + final long after = System.currentTimeMillis(); + logReturn(behaviorCommand, retType, ret, before, after); + } + + // - - - - - - - - - - + // Convert and Return! + // - - - - - - - - - - + if (retType.isPrimitive()) { + ret = convertPrimitiveWrapper(retType, ret); + } else if (Number.class.isAssignableFrom(retType)) { + ret = convertNumber(retType, ret); + } + @SuppressWarnings("unchecked") + final RESULT result = (RESULT) ret; + return result; + } + + //========================================================================== + // ========= + // SQL Execution + // ============= + protected void initializeSqlExecution( + BehaviorCommand behaviorCommand) { + final String key = behaviorCommand.buildSqlExecutionKey(); + SqlExecutionCreator creator = behaviorCommand + .createSqlExecutionCreator(); + getSqlExecution(key, creator); + } + + protected SqlExecution getSqlExecution(String key) { + return _executionMap.get(key); + } + + /** + * @param key The key of SQL execution. (NotNull) + * @param executionCreator The creator of SQL execution. (NotNull) + * @return The SQL execution that may be created then. (NotNull) + */ + protected SqlExecution getSqlExecution(String key, + SqlExecutionCreator executionCreator) { + SqlExecution execution = getSqlExecution(key); + if (execution == null) { + synchronized (_executionMap) { + execution = getSqlExecution(key); + if (execution == null) { + if (isLogEnabled()) { + log("...Initializing sqlExecution for the key '" + key + + "'"); + } + _executionMap.put(key, executionCreator + .createSqlExecution()); + } else { + if (isLogEnabled()) { + log("...Getting sqlExecution as cache because the previous thread have already initilized."); + } + } + } + execution = getSqlExecution(key); + if (execution == null) { + String msg = "sqlExecutionCreator.createSqlCommand() should not return null:"; + msg = msg + " sqlExecutionCreator=" + executionCreator + + " key=" + key; + throw new IllegalStateException(msg); + } + if (!disposable) { + synchronized (this) { + if (!disposable) { + toBeDisposable(); + } + } + } + } + return execution; + } + + protected Object executeSql(SqlExecution execution, Object[] args) { + return execution.execute(args); + } + + //========================================================================== + // ========= + // Log SqlCommand + // ============== + protected void logSqlExecution( + BehaviorCommand behaviorCommand, SqlExecution execution, + long beforeCmd, long afterCmd) { + log("SqlExecution Initialization Cost: [" + + TraceViewUtil.convertToPerformanceView(afterCmd - beforeCmd) + + "]"); + } + + //========================================================================== + // ========= + // Log Invocation + // ============== + protected void logInvocation( + BehaviorCommand behaviorCommand) { + final StackTraceElement[] stackTrace = new Exception().getStackTrace(); + final InvokeNameResult behaviorResult = extractBehaviorInvokeName(stackTrace); + filterBehaviorResult(behaviorCommand, behaviorResult); + + final String invokeClassName; + final String invokeMethodName; + if (!behaviorResult.isEmptyResult()) { + invokeClassName = behaviorResult.getSimpleClassName(); + invokeMethodName = behaviorResult.getMethodName(); + } else { + invokeClassName = behaviorCommand.getTableDbName(); + invokeMethodName = behaviorCommand.getCommandName(); + } + final String expWithoutKakko = buildInvocationExpressionWithoutKakko( + behaviorCommand, invokeClassName, invokeMethodName); + + // Save behavior invoke name for error message. + putObjectToMapContext("df:BehaviorInvokeName", expWithoutKakko + "()"); + + final String equalBorder = buildFitBorder("", "=", expWithoutKakko, + false); + final String callerExpression = expWithoutKakko + "()"; + + log("/=====================================================" + + equalBorder + "=="); + log(" " + + callerExpression); + log(" " + + equalBorder + "=/"); + + logPath(behaviorCommand, stackTrace, behaviorResult); + + if (behaviorCommand.isOutsideSql() && !behaviorCommand.isProcedure()) { + final OutsideSqlContext outsideSqlContext = getOutsideSqlContext(); + if (outsideSqlContext != null) { + log("path: " + behaviorCommand.getOutsideSqlPath()); + log("option: " + behaviorCommand.getOutsideSqlOption()); + } + } + } + + protected void filterBehaviorResult( + BehaviorCommand behaviorCommand, + InvokeNameResult behaviorResult) { + final String simpleClassName = behaviorResult.getSimpleClassName(); + if (simpleClassName == null) { + return; + } + if (simpleClassName.contains("Behavior") + && simpleClassName.endsWith("$SLFunction")) { + final String behaviorClassName = findBehaviorClassNameFromDBMeta(behaviorCommand + .getTableDbName()); + behaviorResult.setSimpleClassName(behaviorClassName); + behaviorResult.setMethodName("scalarSelect()." + + behaviorResult.getMethodName()); + } + } + + protected void logPath(BehaviorCommand behaviorCommand, + StackTraceElement[] stackTrace, InvokeNameResult behaviorResult) { + final int bhvNextIndex = behaviorResult.getNextStartIndex(); + final InvokeNameResult clientResult = extractClientInvokeName( + stackTrace, bhvNextIndex); + final int clientFirstIndex = clientResult.getFoundFirstIndex(); + final InvokeNameResult byPassResult = extractByPassInvokeName( + stackTrace, bhvNextIndex, clientFirstIndex - bhvNextIndex); + + final String clientInvokeName = clientResult.getInvokeName(); + final String byPassInvokeName = byPassResult.getInvokeName(); + final String behaviorInvokeName = behaviorResult.getInvokeName(); + if (clientInvokeName.trim().length() == 0 + && byPassInvokeName.trim().length() == 0) { + return; + } + + // Save client invoke name for error message. + if (!clientResult.isEmptyResult()) { + putObjectToMapContext("df:ClientInvokeName", clientInvokeName); + } + // Save by-pass invoke name for error message. + if (!byPassResult.isEmptyResult()) { + putObjectToMapContext("df:ByPassInvokeName", byPassInvokeName); + } + + log(clientInvokeName + byPassInvokeName + behaviorInvokeName + "..."); + } + + protected String buildInvocationExpressionWithoutKakko( + BehaviorCommand behaviorCommand, String invokeClassName, + String invokeMethodName) { + if (invokeClassName.contains("OutsideSql") + && invokeClassName.endsWith("Executor")) { // OutsideSql + // Executor Handling + try { + final String originalName = invokeClassName; + if (behaviorCommand.isOutsideSql()) { + final OutsideSqlContext outsideSqlContext = getOutsideSqlContext(); + final String tableDbName = outsideSqlContext + .getTableDbName(); + final String behaviorClassName = findBehaviorClassNameFromDBMeta(tableDbName); + invokeClassName = behaviorClassName + ".outsideSql()"; + if (originalName.endsWith("OutsideSqlEntityExecutor")) { + invokeClassName = invokeClassName + ".entityHandling()"; + } else if (originalName + .endsWith("OutsideSqlPagingExecutor")) { + if (outsideSqlContext.isAutoPagingLogging()) { + invokeClassName = invokeClassName + ".autoPaging()"; + } else { + invokeClassName = invokeClassName + + ".manualPaging()"; + } + } else if (originalName + .endsWith("OutsideSqlCursorExecutor")) { + invokeClassName = invokeClassName + ".cursorHandling()"; + } + } else { + invokeClassName = "OutsideSql"; + } + } catch (RuntimeException ignored) { + log("Ignored exception occurred: msg=" + ignored.getMessage()); + } + } + String callerExpressionWithoutKakko = invokeClassName + "." + + invokeMethodName; + if ("selectPage".equals(invokeMethodName)) { // Special Handling! + boolean resultTypeInteger = false; + if (behaviorCommand.isOutsideSql()) { + final OutsideSqlContext outsideSqlContext = getOutsideSqlContext(); + final Object resultTypeSpecification = outsideSqlContext + .getResultTypeSpecification(); + if (resultTypeSpecification != null + && resultTypeSpecification instanceof Class) { + final Class resultType = (Class) resultTypeSpecification; + if (Integer.class.isAssignableFrom(resultType)) { + resultTypeInteger = true; + } + } + } + if (resultTypeInteger || behaviorCommand.isSelectCount()) { + callerExpressionWithoutKakko = callerExpressionWithoutKakko + + "():count"; + } else { + callerExpressionWithoutKakko = callerExpressionWithoutKakko + + "():paging"; + } + } + return callerExpressionWithoutKakko; + } + + protected String buildFitBorder(String prefix, String element, + String lengthTargetString, boolean space) { + final int length = space ? lengthTargetString.length() / 2 + : lengthTargetString.length(); + final StringBuffer sb = new StringBuffer(); + sb.append(prefix); + for (int i = 0; i < length; i++) { + sb.append(element); + if (space) { + sb.append(" "); + } + } + if (space) { + sb.append(element); + } + return sb.toString(); + } + + protected InvokeNameResult extractClientInvokeName( + StackTraceElement[] stackTrace, final int startIndex) { + final List 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 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 suffixList = Arrays.asList(new String[] { "Bhv", + "BehaviorReadable", "BehaviorWritable", "PagingInvoker" }); + final List keywordList = Arrays.asList(new String[] { "Bhv$", + "BehaviorReadable$", "BehaviorWritable$" }); + final List ousideSql1List = Arrays + .asList(new String[] { "OutsideSql" }); + final List ousideSql2List = Arrays + .asList(new String[] { "Executor" }); + final List 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 suffixList) { + for (String suffix : suffixList) { + if (className.endsWith(suffix)) { + return true; + } + } + return false; + } + + protected boolean isClassNameContains(String className, + List keywordList) { + for (String keyword : keywordList) { + if (className.contains(keyword)) { + return true; + } + } + return false; + } + + /** + * @param resource the call-back resource for invoke-name-extracting. + * (NotNull) + * @param stackTrace Stack log. (NotNull) + * @return The result of invoke name. (NotNull: If not found, returns empty + * string.) + */ + protected InvokeNameResult extractInvokeName( + InvokeNameExtractingResource resource, + StackTraceElement[] stackTrace) { + final InvokeNameExtractorImpl extractor = new InvokeNameExtractorImpl(); + extractor.setStackTrace(stackTrace); + return extractor.extractInvokeName(resource); + } + + /** + * @param simpleClassName The simple class name. (NotNull) + * @return The simple class name removed the base prefix. (NotNull) + */ + protected String removeBasePrefixFromSimpleClassName(String simpleClassName) { + if (!simpleClassName.startsWith("Bs")) { + return simpleClassName; + } + final int prefixLength = "Bs".length(); + if (!Character.isUpperCase(simpleClassName.substring(prefixLength) + .charAt(0))) { + return simpleClassName; + } + if (simpleClassName.length() <= prefixLength) { + return simpleClassName; + } + return "" + simpleClassName.substring(prefixLength); + } + + protected String findBehaviorClassNameFromDBMeta(String tableDbName) { + final DBMeta dbmeta = DBMetaInstanceHandler.findDBMeta(tableDbName); + final String behaviorTypeName = dbmeta.getBehaviorTypeName(); + final String behaviorClassName = behaviorTypeName + .substring(behaviorTypeName.lastIndexOf(".") + ".".length()); + return removeBasePrefixFromSimpleClassName(behaviorClassName); + } + + //========================================================================== + // ========= + // Log Return + // ========== + protected void logReturn(BehaviorCommand behaviorCommand, + Class retType, Object ret, long before, long after) { + try { + final String daoResultPrefix = "===========/ [" + + TraceViewUtil.convertToPerformanceView(after - before) + + " - "; + if (List.class.isAssignableFrom(retType)) { + if (ret == null) { + log(daoResultPrefix + "Selected list: null]"); + } else { + final List ls = (java.util.List) ret; + if (ls.isEmpty()) { + log(daoResultPrefix + "Selected list: 0]"); + } else if (ls.size() == 1 && ls.get(0) instanceof Number) { + log(daoResultPrefix + "Selected count: " + ls.get(0) + + "]"); + } else { + log(daoResultPrefix + "Selected list: " + ls.size() + + " first=" + ls.get(0) + "]"); + } + } + } else if (Entity.class.isAssignableFrom(retType)) { + if (ret == null) { + log(daoResultPrefix + "Selected entity: null" + "]"); + } else { + final Entity entity = (Entity) ret; + log(daoResultPrefix + "Selected entity: " + entity + "]"); + } + } else if (Entity.class.isAssignableFrom(retType)) { + if (ret == null) { + log(daoResultPrefix + "Selected entity: null" + "]"); + } else { + final Entity entity = (Entity) ret; + log(daoResultPrefix + "Selected entity: " + entity + "]"); + } + } else if (int[].class.isAssignableFrom(retType)) { + if (ret == null) { + log(daoResultPrefix + "Selected entity: null" + "]"); + } else { + final int[] resultArray = (int[]) ret; + if (resultArray.length == 0) { + log(daoResultPrefix + "All updated count: 0]"); + } else { + final StringBuilder sb = new StringBuilder(); + boolean resultExpressionScope = true; + int resultCount = 0; + int loopCount = 0; + for (int element : resultArray) { + resultCount = resultCount + element; + if (resultExpressionScope) { + if (loopCount <= 10) { + if (sb.length() == 0) { + sb.append(element); + } else { + sb.append(",").append(element); + } + } else { + sb.append(",").append("..."); + resultExpressionScope = false; + } + } + ++loopCount; + } + sb.insert(0, "{").append("}"); + log(daoResultPrefix + "All updated count: " + + resultCount + " result=" + sb + "]"); + } + } + } else { + if (behaviorCommand.isSelectCount()) { + log(daoResultPrefix + "Selected count: " + ret + "]"); + } else { + log(daoResultPrefix + "Result: " + ret + "]"); + } + } + log(" "); + } catch (RuntimeException e) { + String msg = "Result object debug threw the exception: behaviorCommand="; + msg = msg + behaviorCommand + " retType=" + retType; + msg = msg + " ret=" + ret; + throw e; + } + } + + //========================================================================== + // ========= + // Context Helper + // ============== + protected OutsideSqlContext getOutsideSqlContext() { + if (!OutsideSqlContext.isExistOutsideSqlContextOnThread()) { + return null; + } + return OutsideSqlContext.getOutsideSqlContextOnThread(); + } + + protected void putObjectToMapContext(String key, Object value) { + InternalMapContext.setObject(key, value); + } + + protected void clearContext() { + if (OutsideSqlContext.isExistOutsideSqlContextOnThread()) { + OutsideSqlContext.clearOutsideSqlContextOnThread(); + } + if (FetchNarrowingBeanContext.isExistFetchNarrowingBeanOnThread()) { + // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + // - - - - - - - - - - - - - - - + // Because there is possible that fetch narrowing has been ignored + // for manualPaging of outsideSql. + // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + // - - - - - - - - - - - - - - - + FetchNarrowingBeanContext.getFetchNarrowingBeanOnThread() + .restoreIgnoredFetchNarrowing(); + + FetchNarrowingBeanContext.clearFetchNarrowingBeanOnThread(); + } + if (ConditionBeanContext.isExistConditionBeanOnThread()) { + ConditionBeanContext.clearConditionBeanOnThread(); + } + if (InternalMapContext.isExistInternalMapContextOnThread()) { + InternalMapContext.clearInternalMapContextOnThread(); + } + } + + //========================================================================== + // ========= + // Execute Status Log + // ================== + protected void log(String msg) { + XLog.log(msg); + } + + protected boolean isLogEnabled() { + return XLog.isLogEnabled(); + } + + protected StatementFactory createStatememtFactory() { + final StatementConfig defaultStatementConfig = DBFluteConfig + .getInstance().getDefaultStatementConfig(); + final boolean internalDebug = DBFluteConfig.getInstance() + .isInternalDebug(); + InternalStatementFactory factory = new InternalStatementFactory(); + factory.setDefaultStatementConfig(defaultStatementConfig); + factory.setInternalDebug(internalDebug); + return factory; + } + + //========================================================================== + // ========= + // Dispose + // ======= + public void toBeDisposable() { + DisposableUtil.add(this); + disposable = true; + } + + public void dispose() { + _executionMap.clear(); + disposable = false; + } + + public boolean isDisposable() { + return disposable; + } + + public boolean isExecutionCacheEmpty() { + return _executionMap.isEmpty(); + } + + //========================================================================== + // ========= + // Convert Helper + // ============== + protected Object convertPrimitiveWrapper(Class retType, Object ret) { + return SimpleTypeUtil.toWrapper(retType, ret); + } + + protected Object convertNumber(Class retType, Object ret) { + return SimpleTypeUtil.toNumber(retType, ret); + } + + //========================================================================== + // ========= + // Assert Helper + // ============= + protected void assertRetType(Class retType, Object ret) { + if (List.class.isAssignableFrom(retType)) { + if (ret != null && !(ret instanceof List)) { + String msg = "The retType is difference from actual return: "; + msg = msg + "retType=" + retType + " ret.getClass()=" + + ret.getClass() + " ref=" + ret; + throw new IllegalStateException(msg); + } + } else if (Entity.class.isAssignableFrom(retType)) { + if (ret != null && !(ret instanceof Entity)) { + String msg = "The retType is difference from actual return: "; + msg = msg + "retType=" + retType + " ret.getClass()=" + + ret.getClass() + " ref=" + ret; + throw new IllegalStateException(msg); + } + } + } + + //========================================================================== + // ========= + // General Helper + // ============== + protected String getLineSeparator() { + return SimpleSystemUtil.getLineSeparator(); + } + + //========================================================================== + // ========= + // Accessor + // ======== + public void setDataSource(DataSource dataSource) { + _dataSource = dataSource; + } + + public void setBeanMetaDataFactory(BeanMetaDataFactory beanMetaDataFactory) { + _beanMetaDataFactory = beanMetaDataFactory; + } + + public void setValueTypeFactory(ValueTypeFactory valueTypeFactory) { + _valueTypeFactory = valueTypeFactory; + } +} Property changes on: addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/bhv/core/BehaviorCommandInvoker.java ___________________________________________________________________ Name: svn:eol-style + native Added: addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/bhv/core/BehaviorInitializer.java =================================================================== --- addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/bhv/core/BehaviorInitializer.java (rev 0) +++ addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/bhv/core/BehaviorInitializer.java 2008-12-27 22:06:42 UTC (rev 1624) @@ -0,0 +1,183 @@ +package jp.sf.pal.addresslist.db.allcommon.bhv.core; + +import java.util.Collections; +import java.util.Map; +import java.util.concurrent.ConcurrentHashMap; + +import javax.sql.XADataSource; + +import jp.sf.pal.addresslist.db.allcommon.DBDef; +import jp.sf.pal.addresslist.db.allcommon.DBFluteConfig; +import jp.sf.pal.addresslist.db.allcommon.cbean.ConditionBeanContext; +import jp.sf.pal.addresslist.db.allcommon.dbmeta.DBMetaInstanceHandler; +import jp.sf.pal.addresslist.db.allcommon.s2dao.internal.sqllog.InternalSqlLogRegistry; +import jp.sf.pal.addresslist.db.allcommon.util.SimpleSystemUtil; + +import org.seasar.extension.dbcp.impl.XADataSourceImpl; + +/** + * @author DBFlute(AutoGenerator) + */ +public class BehaviorInitializer { + + //========================================================================== + // ========= + // Definition + // ========== + /** Log-instance. */ + private static final org.apache.commons.logging.Log _log = org.apache.commons.logging.LogFactory + .getLog(BehaviorInitializer.class); + + // ----------------------------------------------------- + // For DBMeta + // ---------- + /** + * The map of table DB name and class name for the handler of DB meta + * instance. + */ + protected static final Map _tableDbNameClassNameMap; + static { + final Map tmpMap = newConcurrentHashMap(); + tmpMap.put("COMPANY", + "jp.sf.pal.addresslist.db.bsentity.dbmeta.CompanyDbm"); + tmpMap.put("CONTACT", + "jp.sf.pal.addresslist.db.bsentity.dbmeta.ContactDbm"); + tmpMap.put("CUSTOM", + "jp.sf.pal.addresslist.db.bsentity.dbmeta.CustomDbm"); + tmpMap.put("GROUP_INFO", + "jp.sf.pal.addresslist.db.bsentity.dbmeta.GroupInfoDbm"); + tmpMap.put("GROUP_MAPPING", + "jp.sf.pal.addresslist.db.bsentity.dbmeta.GroupMappingDbm"); + tmpMap.put("PERSON", + "jp.sf.pal.addresslist.db.bsentity.dbmeta.PersonDbm"); + tmpMap.put("POSTAL", + "jp.sf.pal.addresslist.db.bsentity.dbmeta.PostalDbm"); + tmpMap.put("ROLE_INFO", + "jp.sf.pal.addresslist.db.bsentity.dbmeta.RoleInfoDbm"); + tmpMap.put("ROLE_MAPPING", + "jp.sf.pal.addresslist.db.bsentity.dbmeta.RoleMappingDbm"); + tmpMap.put("USER_INFO", + "jp.sf.pal.addresslist.db.bsentity.dbmeta.UserInfoDbm"); + _tableDbNameClassNameMap = Collections.unmodifiableMap(tmpMap); + } + + protected static ConcurrentHashMap newConcurrentHashMap() { + return new ConcurrentHashMap(); + } + + //========================================================================== + // ========= + // Constructor + // =========== + /** + * Constructor. And initialize various components related behavior. + * + * @param xaDataSource The data source of XA. (Nullable) + */ + public BehaviorInitializer(XADataSource xaDataSource) { + _log + .info("/* * * * * * * * * * * * * * * * * * * * * * * * * * * * {DBFlute}"); + initializeDBMetaResource(); + handleSqlLogRegistry(); + loadCoolClasses(); + if (xaDataSource != null) { + showInformation(xaDataSource); + setupDBDefByDriverClassName(xaDataSource); + } + DBFluteConfig.getInstance().lock(); + _log.info("* * * * */"); + } + + //========================================================================== + // ========= + // DBMeta + // ====== + protected void initializeDBMetaResource() { + DBMetaInstanceHandler.setupDBMetaResource(_tableDbNameClassNameMap); + } + + //========================================================================== + // ========= + // Cool Classes + // ============ + protected void loadCoolClasses() { // for S2Container basically + ConditionBeanContext.loadCoolClasses(); // Against the ClassLoader + // Headache! + } + + //========================================================================== + // ========= + // Information + // =========== + protected void showInformation(XADataSource xaDataSource) { + if (xaDataSource != null && xaDataSource instanceof XADataSourceImpl) { + final StringBuilder sb = new StringBuilder(); + final XADataSourceImpl xaDataSourceImpl = (XADataSourceImpl) xaDataSource; + final String driverClassName = xaDataSourceImpl + .getDriverClassName(); + final String url = xaDataSourceImpl.getURL(); + final String user = xaDataSourceImpl.getUser(); + sb.append(" [XADataSource]:").append(getLineSeparator()); + sb.append(" driver = " + driverClassName).append( + getLineSeparator()); + sb.append(" url = " + url).append(getLineSeparator()); + sb.append(" user = " + user); + _log.info("{Injection Information}" + getLineSeparator() + sb); + } + } + + //========================================================================== + // ========= + // Database Product Name + // ===================== + protected void setupDBDefByDriverClassName(XADataSource xaDataSource) { + if (xaDataSource != null && xaDataSource instanceof XADataSourceImpl) { + final XADataSourceImpl xaDataSourceImpl = (XADataSourceImpl) xaDataSource; + final String driverClassName = xaDataSourceImpl + .getDriverClassName(); + final DBDef dbdef = DBDef.byDriverClassName(driverClassName); + if (dbdef != null) { + DBDef.setCurrentDef(dbdef); + return; + } + } + } + + //========================================================================== + // ========= + // SQL Log Registry + // ================ + protected void handleSqlLogRegistry() { + if (DBFluteConfig.getInstance().isUseSqlLogRegistry()) { + final StringBuilder sb = new StringBuilder(); + sb.append("{SqlLog Information}").append(getLineSeparator()); + sb.append(" [SqlLogRegistry]").append(getLineSeparator()); + if (InternalSqlLogRegistry.setupSqlLogRegistry()) { + sb + .append( + " ...Setting up SqlLogRegistry(org.seasar.extension.jdbc)!") + .append(getLineSeparator()); + sb + .append(" Because the property 'useSqlLogRegistry' of the config of DBFlute is true."); + } else { + sb + .append(" SqlLogRegistry(org.seasar.extension.jdbc) is not supported at the version!"); + } + _log.info(sb); + } else { + final Object sqlLogRegistry = InternalSqlLogRegistry + .findContainerSqlLogRegistry(); + if (sqlLogRegistry != null) { + InternalSqlLogRegistry.closeRegistration(); + } + } + } + + //========================================================================== + // ========= + // General Helper + // ============== + protected String getLineSeparator() { + return SimpleSystemUtil.getLineSeparator(); + } +} Property changes on: addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/bhv/core/BehaviorInitializer.java ___________________________________________________________________ Name: svn:eol-style + native Added: addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/bhv/core/SqlExecution.java =================================================================== --- addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/bhv/core/SqlExecution.java (rev 0) +++ addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/bhv/core/SqlExecution.java 2008-12-27 22:06:42 UTC (rev 1624) @@ -0,0 +1,9 @@ +package jp.sf.pal.addresslist.db.allcommon.bhv.core; + +/** + * @author DBFlute(AutoGenerator) + */ +public interface SqlExecution { + + public Object execute(Object[] args); +} Property changes on: addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/bhv/core/SqlExecution.java ___________________________________________________________________ Name: svn:eol-style + native Added: addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/bhv/core/SqlExecutionCreator.java =================================================================== --- addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/bhv/core/SqlExecutionCreator.java (rev 0) +++ addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/bhv/core/SqlExecutionCreator.java 2008-12-27 22:06:42 UTC (rev 1624) @@ -0,0 +1,9 @@ +package jp.sf.pal.addresslist.db.allcommon.bhv.core; + +/** + * @author DBFlute(AutoGenerator) + */ +public interface SqlExecutionCreator { + + SqlExecution createSqlExecution(); +} Property changes on: addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/bhv/core/SqlExecutionCreator.java ___________________________________________________________________ Name: svn:eol-style + native Added: addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/bhv/core/command/AbstractBehaviorCommand.java =================================================================== --- addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/bhv/core/command/AbstractBehaviorCommand.java (rev 0) +++ addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/bhv/core/command/AbstractBehaviorCommand.java 2008-12-27 22:06:42 UTC (rev 1624) @@ -0,0 +1,261 @@ +package jp.sf.pal.addresslist.db.allcommon.bhv.core.command; + +import java.sql.ResultSet; +import java.sql.SQLException; +import java.util.ArrayList; +import java.util.List; + +import javax.sql.DataSource; + +import jp.sf.pal.addresslist.db.allcommon.DBDef; +import jp.sf.pal.addresslist.db.allcommon.bhv.core.BehaviorCommand; +import jp.sf.pal.addresslist.db.allcommon.bhv.core.BehaviorCommandComponentSetup; +import jp.sf.pal.addresslist.db.allcommon.s2dao.internal.rshandler.InternalBeanListMetaDataResultSetHandler; +import jp.sf.pal.addresslist.db.allcommon.s2dao.internal.sqlcommand.InternalUpdateDynamicCommand; +import jp.sf.pal.addresslist.db.allcommon.s2dao.internal.various.InternalRelationRowCreator; +import jp.sf.pal.addresslist.db.allcommon.s2dao.internal.various.InternalRowCreator; + +import org.seasar.dao.BeanMetaData; +import org.seasar.dao.BeanMetaDataFactory; +import org.seasar.dao.ValueTypeFactory; +import org.seasar.extension.jdbc.ResultSetHandler; +import org.seasar.extension.jdbc.StatementFactory; +import org.seasar.extension.jdbc.ValueType; +import org.seasar.extension.jdbc.types.ValueTypes; + +/** + * @author DBFlute(AutoGenerator) + * @param The type of result. + */ +public abstract class AbstractBehaviorCommand implements + BehaviorCommand, BehaviorCommandComponentSetup { + + //========================================================================== + // ========= + // Attribute + // ========= + // ----------------------------------------------------- + // Basic Information + // ----------------- + /** The table DB name. (Required) */ + protected String _tableDbName; + + /** Is it initialize only? (Choice) */ + protected boolean _initializeOnly; + + // ----------------------------------------------------- + // Injection Component + // ------------------- + protected DataSource _dataSource; + + protected StatementFactory _statementFactory; + + protected BeanMetaDataFactory _beanMetaDataFactory; + + protected ValueTypeFactory _valueTypeFactory; + + protected String _sqlFileEncoding; + + //========================================================================== + // ========= + // Factory + // ======= + // ----------------------------------------------------- + // UpdateDynamicCommnd + // ------------------- + protected InternalUpdateDynamicCommand createUpdateDynamicCommand( + String[] argNames, Class[] argTypes, String sql) { + final InternalUpdateDynamicCommand cmd = new InternalUpdateDynamicCommand( + _dataSource, _statementFactory); + cmd.setArgNames(argNames); + cmd.setArgTypes(argTypes); + if (sql != null) { + cmd.setSql(sql); + } + return cmd; + } + + // ----------------------------------------------------- + // ResultSetHandler + // ---------------- + protected ResultSetHandler createBeanListMetaDataResultSetHandler( + BeanMetaData bmd) { + final InternalRowCreator rowCreator = createInternalRowCreator(bmd); + final InternalRelationRowCreator relationRowCreator = createInternalRelationRowCreator(bmd); + return new InternalBeanListMetaDataResultSetHandler(bmd, rowCreator, + relationRowCreator); + } + + protected ResultSetHandler createObjectResultSetHandler(Class objectType) { + final ValueType valueType = ValueTypes.getValueType(objectType); + return new InternalObjectResultSetHandler(valueType); + } + + protected ResultSetHandler createObjectListResultSetHandler( + Class objectType) { + final ValueType valueType = ValueTypes.getValueType(objectType); + return createObjectListResultSetHandler(valueType); + } + + protected ResultSetHandler createObjectListResultSetHandler( + ValueType valueType) { + return new InternalObjectListResultSetHandler(valueType); + } + + protected static class InternalObjectResultSetHandler implements + ResultSetHandler { + private ValueType valueType; + + public InternalObjectResultSetHandler(ValueType valueType) { + this.valueType = valueType; + } + + public Object handle(ResultSet rs) throws SQLException { + while (rs.next()) { + return valueType.getValue(rs, 1); + } + return null; + } + } + + protected static class InternalObjectListResultSetHandler implements + ResultSetHandler { + private ValueType valueType; + + public InternalObjectListResultSetHandler(ValueType valueType) { + this.valueType = valueType; + } + + public Object handle(ResultSet rs) throws SQLException { + final List ret = new ArrayList(); + while (rs.next()) { + ret.add(valueType.getValue(rs, 1)); + } + return ret; + } + } + + protected static class InternalNullResultSetHandler implements + ResultSetHandler { + public Object handle(ResultSet rs) throws SQLException { + return null; + } + } + + protected InternalRowCreator createInternalRowCreator(BeanMetaData bmd) { + final Class clazz = bmd != null ? bmd.getBeanClass() : null; + return InternalRowCreator.createInternalRowCreator(clazz); + } + + protected InternalRelationRowCreator createInternalRelationRowCreator( + BeanMetaData bmd) { + return new InternalRelationRowCreator(); // Not yet implemented about + // performance tuning! + } + + //========================================================================== + // ========= + // Assist Helper + // ============= + protected String buildDbmsSuffix() { + final String productName = DBDef.getCurrentDef().code(); + return (productName != null ? "_" + productName.toLowerCase() : ""); + } + + //========================================================================== + // ========= + // Assert Helper + // ============= + protected void assertBasicProperty(String methodName) { + if (_tableDbName == null) { + throw new IllegalStateException(buildAssertMessage("_tableDbName", + methodName)); + } + } + + protected void assertComponentProperty(String methodName) { + if (_dataSource == null) { + throw new IllegalStateException(buildAssertMessage("_dataSource", + methodName)); + } + if (_statementFactory == null) { + throw new IllegalStateException(buildAssertMessage( + "_statementFactory", methodName)); + } + if (_beanMetaDataFactory == null) { + throw new IllegalStateException(buildAssertMessage( + "_beanMetaDataFactory", methodName)); + } + if (_valueTypeFactory == null) { + throw new IllegalStateException(buildAssertMessage( + "_valueTypeFactory", methodName)); + } + if (_sqlFileEncoding == null) { + throw new IllegalStateException(buildAssertMessage( + "_sqlFileEncoding", methodName)); + } + } + + protected String buildAssertMessage(String propertyName, String methodName) { + propertyName = propertyName.startsWith("_") ? propertyName + .substring("_".length()) : propertyName; + String msg = "The property '" + propertyName + "' should not be null"; + msg = msg + " when you call " + methodName + "()."; + throw new IllegalStateException(msg); + } + + //========================================================================== + // ========= + // Basic Override + // ============== + @Override + public String toString() { + return getClass().getSimpleName() + ":{" + buildSqlExecutionKey() + "}"; + } + + //========================================================================== + // ========= + // Accessor + // ======== + // ----------------------------------------------------- + // Basic Information + // ----------------- + public String getTableDbName() { + return _tableDbName; + } + + public void setTableDbName(String tableDbName) { + _tableDbName = tableDbName; + } + + public void setInitializeOnly(boolean initializeOnly) { + _initializeOnly = initializeOnly; + } + + public boolean isInitializeOnly() { + return _initializeOnly; + } + + // ----------------------------------------------------- + // Injection Component + // ------------------- + public void setDataSource(DataSource dataSource) { + _dataSource = dataSource; + } + + public void setStatementFactory(StatementFactory statementFactory) { + _statementFactory = statementFactory; + } + + public void setBeanMetaDataFactory(BeanMetaDataFactory beanMetaDataFactory) { + _beanMetaDataFactory = beanMetaDataFactory; + } + + public void setValueTypeFactory(ValueTypeFactory valueTypeFactory) { + _valueTypeFactory = valueTypeFactory; + } + + public void setSqlFileEncoding(String sqlFileEncoding) { + _sqlFileEncoding = sqlFileEncoding; + } +} Property changes on: addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/bhv/core/command/AbstractBehaviorCommand.java ___________________________________________________________________ Name: svn:eol-style + native Added: addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/bhv/core/command/AbstractEntityCommand.java =================================================================== --- addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/bhv/core/command/AbstractEntityCommand.java (rev 0) +++ addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/bhv/core/command/AbstractEntityCommand.java 2008-12-27 22:06:42 UTC (rev 1624) @@ -0,0 +1,182 @@ +package jp.sf.pal.addresslist.db.allcommon.bhv.core.command; + +import java.util.ArrayList; +import java.util.List; + +import jp.sf.pal.addresslist.db.allcommon.Entity; +import jp.sf.pal.addresslist.db.allcommon.cbean.ConditionBean; +import jp.sf.pal.addresslist.db.allcommon.cbean.outsidesql.OutsideSqlOption; +import jp.sf.pal.addresslist.db.allcommon.dbmeta.DBMeta; + +import org.seasar.dao.BeanMetaData; +import org.seasar.extension.jdbc.PropertyType; + +/** + * @author DBFlute(AutoGenerator) + */ +public abstract class AbstractEntityCommand extends + AbstractBehaviorCommand { + + //========================================================================== + // ========= + // Attribute + // ========= + /** The type of entity. (Required) */ + protected Class _entityType; + + /** The instance of condition-bean. (Required) */ + protected Entity _entity; + + //========================================================================== + // ========= + // Basic Information + // ================= + public Class getCommandReturnType() { + return Integer.class; + } + + //========================================================================== + // ========= + // Detail Information + // ================== + public boolean isConditionBean() { + return false; + } + + public boolean isOutsideSql() { + return false; + } + + public boolean isProcedure() { + return false; + } + + public boolean isSelect() { + return false; + } + + public boolean isSelectCount() { + return false; + } + + //========================================================================== + // ========= + // Factory + // ======= + // ----------------------------------------------------- + // BeanMetaData + // ------------ + protected BeanMetaData createBeanMetaData() { + return _beanMetaDataFactory.createBeanMetaData(_entityType); + } + + //========================================================================== + // ========= + // Process Callback + // ================ + public void beforeGettingSqlExecution() { + } + + public void afterExecuting() { + } + + //========================================================================== + // ========= + // SqlExecution Handling + // ===================== + public String buildSqlExecutionKey() { + assertStatus("buildSqlExecutionKey"); + return _tableDbName + ":" + getCommandName() + "(" + + _entityType.getSimpleName() + ")"; + } + + public Object[] getSqlExecutionArgument() { + assertStatus("getSqlExecutionArgument"); + return new Object[] { _entity }; + } + + //========================================================================== + // ========= + // Argument Information + // ==================== + public ConditionBean getConditionBean() { + return null; + } + + public String getOutsideSqlPath() { + return null; + } + + public OutsideSqlOption getOutsideSqlOption() { + return null; + } + + //========================================================================== + // ========= + // Assist Helper + // ============= + protected DBMeta findDBMeta() { + // /- - - - - - - - - - - - - - - - - - - - - - - - - - - - + // Cannot use the handler of DBMeta instance + // because the customize-entity is contained to find here. + // - - - - - - - - - -/ + // DBMetaInstanceHandler.findDBMeta(_tableDbName); + + final Class beanType = _entityType; + if (beanType == null) { + return null; + } + if (!Entity.class.isAssignableFrom(beanType)) { + return null; + } + final Entity entity; + try { + entity = (Entity) beanType.newInstance(); + } catch (InstantiationException e) { + throw new IllegalStateException(e); + } catch (IllegalAccessException e) { + throw new IllegalStateException(e); + } + return entity.getDBMeta(); + } + + protected String[] getPersistentPropertyNames(BeanMetaData bmd) { + final List nameList = new ArrayList(); + for (int i = 0; i < bmd.getPropertyTypeSize(); ++i) { + final PropertyType pt = bmd.getPropertyType(i); + if (pt.isPersistent()) { + nameList.add(pt.getPropertyName()); + } + } + return nameList.toArray(new String[nameList.size()]); + } + + //========================================================================== + // ========= + // Assert Helper + // ============= + protected void assertStatus(String methodName) { + assertBasicProperty(methodName); + assertComponentProperty(methodName); + if (_entityType == null) { + throw new IllegalStateException(buildAssertMessage("_entityType", + methodName)); + } + if (_entity == null) { + throw new IllegalStateException(buildAssertMessage("_entity", + methodName)); + } + } + + //========================================================================== + // ========= + // Accessor + // ======== + public void setEntityType(Class entityType) { + _entityType = entityType; + } + + public void setEntity(Entity entity) { + _entity = entity; + } +} Property changes on: addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/bhv/core/command/AbstractEntityCommand.java ___________________________________________________________________ Name: svn:eol-style + native Added: addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/bhv/core/command/AbstractListEntityCommand.java =================================================================== --- addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/bhv/core/command/AbstractListEntityCommand.java (rev 0) +++ addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/bhv/core/command/AbstractListEntityCommand.java 2008-12-27 22:06:42 UTC (rev 1624) @@ -0,0 +1,182 @@ +package jp.sf.pal.addresslist.db.allcommon.bhv.core.command; + +import java.util.ArrayList; +import java.util.List; + +import jp.sf.pal.addresslist.db.allcommon.Entity; +import jp.sf.pal.addresslist.db.allcommon.cbean.ConditionBean; +import jp.sf.pal.addresslist.db.allcommon.cbean.outsidesql.OutsideSqlOption; +import jp.sf.pal.addresslist.db.allcommon.dbmeta.DBMeta; + +import org.seasar.dao.BeanMetaData; +import org.seasar.extension.jdbc.PropertyType; + +/** + * @author DBFlute(AutoGenerator) + */ +public abstract class AbstractListEntityCommand extends + AbstractBehaviorCommand { + + //========================================================================== + // ========= + // Attribute + // ========= + /** The type of entity. (Required) */ + protected Class _entityType; + + /** The instance of condition-bean. (Required) */ + protected List _entityList; + + //========================================================================== + // ========= + // Basic Information + // ================= + public Class getCommandReturnType() { + return int[].class; + } + + //========================================================================== + // ========= + // Detail Information + // ================== + public boolean isConditionBean() { + return false; + } + + public boolean isOutsideSql() { + return false; + } + + public boolean isProcedure() { + return false; + } + + public boolean isSelect() { + return false; + } + + public boolean isSelectCount() { + return false; + } + + //========================================================================== + // ========= + // Factory + // ======= + // ----------------------------------------------------- + // BeanMetaData + // ------------ + protected BeanMetaData createBeanMetaData() { + return _beanMetaDataFactory.createBeanMetaData(_entityType); + } + + //========================================================================== + // ========= + // Process Callback + // ================ + public void beforeGettingSqlExecution() { + } + + public void afterExecuting() { + } + + //========================================================================== + // ========= + // SqlExecution Handling + // ===================== + public String buildSqlExecutionKey() { + assertStatus("buildSqlExecutionKey"); + return _tableDbName + ":" + getCommandName() + "(List<" + + _entityType.getSimpleName() + ">)"; + } + + public Object[] getSqlExecutionArgument() { + assertStatus("getSqlExecutionArgument"); + return new Object[] { _entityList }; + } + + //========================================================================== + // ========= + // Argument Information + // ==================== + public ConditionBean getConditionBean() { + return null; + } + + public String getOutsideSqlPath() { + return null; + } + + public OutsideSqlOption getOutsideSqlOption() { + return null; + } + + //========================================================================== + // ========= + // Assist Helper + // ============= + protected DBMeta findDBMeta() { + // /- - - - - - - - - - - - - - - - - - - - - - - - - - - - + // Cannot use the handler of DBMeta instance + // because the customize-entity is contained to find here. + // - - - - - - - - - -/ + // DBMetaInstanceHandler.findDBMeta(_tableDbName); + + final Class beanType = _entityType; + if (beanType == null) { + return null; + } + if (!Entity.class.isAssignableFrom(beanType)) { + return null; + } + final Entity entity; + try { + entity = (Entity) beanType.newInstance(); + } catch (InstantiationException e) { + throw new IllegalStateException(e); + } catch (IllegalAccessException e) { + throw new IllegalStateException(e); + } + return entity.getDBMeta(); + } + + protected String[] getPersistentPropertyNames(BeanMetaData bmd) { + final List nameList = new ArrayList(); + for (int i = 0; i < bmd.getPropertyTypeSize(); ++i) { + final PropertyType pt = bmd.getPropertyType(i); + if (pt.isPersistent()) { + nameList.add(pt.getPropertyName()); + } + } + return nameList.toArray(new String[nameList.size()]); + } + + //========================================================================== + // ========= + // Assert Helper + // ============= + protected void assertStatus(String methodName) { + assertBasicProperty(methodName); + assertComponentProperty(methodName); + if (_entityType == null) { + throw new IllegalStateException(buildAssertMessage("_entityType", + methodName)); + } + if (_entityList == null) { + throw new IllegalStateException(buildAssertMessage("_entityList", + methodName)); + } + } + + //========================================================================== + // ========= + // Accessor + // ======== + public void setEntityType(Class entityType) { + _entityType = entityType; + } + + public void setEntityList(List entityList) { + _entityList = entityList; + } +} Property changes on: addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/bhv/core/command/AbstractListEntityCommand.java ___________________________________________________________________ Name: svn:eol-style + native Added: addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/bhv/core/command/AbstractOutsideSqlCommand.java =================================================================== --- addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/bhv/core/command/AbstractOutsideSqlCommand.java (rev 0) +++ addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/bhv/core/command/AbstractOutsideSqlCommand.java 2008-12-27 22:06:42 UTC (rev 1624) @@ -0,0 +1,93 @@ +package jp.sf.pal.addresslist.db.allcommon.bhv.core.command; + +import jp.sf.pal.addresslist.db.allcommon.cbean.ConditionBean; +import jp.sf.pal.addresslist.db.allcommon.cbean.outsidesql.OutsideSqlOption; + +/** + * @author DBFlute(AutoGenerator) + * @param The type of result. + */ +public abstract class AbstractOutsideSqlCommand extends + AbstractBehaviorCommand { + + //========================================================================== + // ========= + // Attribute + // ========= + // ----------------------------------------------------- + // Basic Information + // ----------------- + /** The path of outside-SQL. (Required) */ + protected String _outsideSqlPath; + + /** The parameter-bean. (Required to set, but Nullable) */ + protected Object _parameterBean; + + /** The option of outside-SQL. (Required) */ + protected OutsideSqlOption _outsideSqlOption; + + //========================================================================== + // ========= + // Detail Information + // ================== + public boolean isConditionBean() { + return false; // When the command is for outside-SQL, it always be + // false. + } + + public boolean isOutsideSql() { + return true; + } + + public boolean isSelectCount() { + return false; // When the command is for outside-SQL, it always be + // false. + } + + //========================================================================== + // ========= + // Argument Information + // ==================== + public ConditionBean getConditionBean() { + return null; + } + + public String getOutsideSqlPath() { + return _outsideSqlPath; + } + + public OutsideSqlOption getOutsideSqlOption() { + return _outsideSqlOption; + } + + //========================================================================== + // ========= + // Assert Helper + // ============= + protected void assertOutsideSqlBasic(String methodName) { + if (_outsideSqlPath == null) { + throw new IllegalStateException(buildAssertMessage( + "_outsideSqlPath", methodName)); + } + if (_outsideSqlOption == null) { + throw new IllegalStateException(buildAssertMessage( + "_outsideSqlOption", methodName)); + } + } + + //========================================================================== + // ========= + // Accessor + // ======== + public void setOutsideSqlPath(String outsideSqlPath) { + _outsideSqlPath = outsideSqlPath; + } + + public void setParameterBean(Object parameterBean) { + _parameterBean = parameterBean; + } + + public void setOutsideSqlOption(OutsideSqlOption outsideSqlOption) { + _outsideSqlOption = outsideSqlOption; + } +} Property changes on: addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/bhv/core/command/AbstractOutsideSqlCommand.java ___________________________________________________________________ Name: svn:eol-style + native Added: addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/bhv/core/command/AbstractOutsideSqlSelectCommand.java =================================================================== --- addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/bhv/core/command/AbstractOutsideSqlSelectCommand.java (rev 0) +++ addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/bhv/core/command/AbstractOutsideSqlSelectCommand.java 2008-12-27 22:06:42 UTC (rev 1624) @@ -0,0 +1,175 @@ +package jp.sf.pal.addresslist.db.allcommon.bhv.core.command; + +import jp.sf.pal.addresslist.db.allcommon.bhv.core.SqlExecution; +import jp.sf.pal.addresslist.db.allcommon.bhv.core.SqlExecutionCreator; +import jp.sf.pal.addresslist.db.allcommon.bhv.core.execution.OutsideSqlSelectExecution; +import jp.sf.pal.addresslist.db.allcommon.cbean.FetchNarrowingBean; +import jp.sf.pal.addresslist.db.allcommon.cbean.FetchNarrowingBeanContext; +import jp.sf.pal.addresslist.db.allcommon.cbean.outsidesql.OutsideSqlContext; +import jp.sf.pal.addresslist.db.allcommon.cbean.outsidesql.OutsideSqlOption; + +import org.seasar.extension.jdbc.ResultSetHandler; + +/** + * The abstract command for OutsideSql.selectSomething(). + * + * @author DBFlute(AutoGenerator) + * @param The type of result. + */ +public abstract class AbstractOutsideSqlSelectCommand extends + AbstractOutsideSqlCommand { + + //========================================================================== + // ========= + // Detail Information + // ================== + public boolean isProcedure() { + return false; + } + + public boolean isSelect() { + return true; + } + + //========================================================================== + // ========= + // Process Callback + // ================ + public void beforeGettingSqlExecution() { + assertStatus("beforeGettingSqlExecution"); + final String path = _outsideSqlPath; + final Object pmb = _parameterBean; + final OutsideSqlOption option = _outsideSqlOption; + final Object resultTypeSpecification = getResultTypeSpecification(); + final boolean autoPagingLogging = (option.isAutoPaging() || option + .isSourcePagingRequestTypeAuto()); + final OutsideSqlContext outsideSqlContext = new OutsideSqlContext(); + outsideSqlContext.setOutsideSqlPath(path); + outsideSqlContext.setParameterBean(pmb); + outsideSqlContext.setResultTypeSpecification(resultTypeSpecification); + outsideSqlContext.setMethodName(getCommandName()); + outsideSqlContext.setStatementConfig(option.getStatementConfig()); + outsideSqlContext.setTableDbName(option.getTableDbName()); + outsideSqlContext.setDynamicBinding(option.isDynamicBinding()); + outsideSqlContext.setOffsetByCursorForcedly(option.isAutoPaging()); + outsideSqlContext.setLimitByCursorForcedly(option.isAutoPaging()); + outsideSqlContext.setAutoPagingLogging(autoPagingLogging); // for + // logging + outsideSqlContext.setupBehaviorQueryPathIfNeeds(); + OutsideSqlContext.setOutsideSqlContextOnThread(outsideSqlContext); + + // Set up fetchNarrowingBean. + setupOutsideSqlFetchNarrowingBean(pmb, option); + } + + protected void setupOutsideSqlFetchNarrowingBean(Object pmb, + OutsideSqlOption option) { + if (pmb == null + || !FetchNarrowingBeanContext.isTheTypeFetchNarrowingBean(pmb + .getClass())) { + return; + } + final FetchNarrowingBean fetchNarrowingBean = (FetchNarrowingBean) pmb; + if (option.isManualPaging()) { + fetchNarrowingBean.ignoreFetchNarrowing(); + } + FetchNarrowingBeanContext + .setFetchNarrowingBeanOnThread(fetchNarrowingBean); + } + + public void afterExecuting() { + } + + //========================================================================== + // ========= + // SqlExecution Handling + // ===================== + public String buildSqlExecutionKey() { + assertStatus("buildSqlExecutionKey"); + return generateSpecifiedOutsideSqlUniqueKey(); + } + + protected String generateSpecifiedOutsideSqlUniqueKey() { + final String methodName = getCommandName(); + final String path = _outsideSqlPath; + final Object pmb = _parameterBean; + final OutsideSqlOption option = _outsideSqlOption; + final Object resultTypeSpecification = getResultTypeSpecification(); + return OutsideSqlContext.generateSpecifiedOutsideSqlUniqueKey( + methodName, path, pmb, option, resultTypeSpecification); + } + + public SqlExecutionCreator createSqlExecutionCreator() { + assertStatus("createSqlExecutionCreator"); + return new SqlExecutionCreator() { + public SqlExecution createSqlExecution() { + final OutsideSqlContext outsideSqlContext = OutsideSqlContext + .getOutsideSqlContextOnThread(); + return createOutsideSqlSelectExecution(outsideSqlContext); + } + }; + } + + protected SqlExecution createOutsideSqlSelectExecution( + OutsideSqlContext outsideSqlContext) { + // - - - - - - - - - - - - - - - - - - - - - - - + // The attribute of Specified-OutsideSqlContext. + // - - - - - - - - - - - - - - - - - - - - - - - + final String suffix = buildDbmsSuffix(); + final String sql = outsideSqlContext.readFilteredOutsideSql( + _sqlFileEncoding, suffix); + final Object pmb = outsideSqlContext.getParameterBean(); + + // - - - - - - - - - - - - - - - + // The attribute of SqlCommand. + // - - - - - - - - - - - - - - - + final String[] argNames = (pmb != null ? new String[] { "pmb" } + : new String[] {}); + final Class[] argTypes = (pmb != null ? new Class[] { pmb + .getClass() } : new Class[] {}); + + // - - - - - - - - - - - - - + // Create ResultSetHandler. + // - - - - - - - - - - - - - + final ResultSetHandler handler = createOutsideSqlSelectResultSetHandler(); + + // - - - - - - - - - - - + // Create SqlExecution. + // - - - - - - - - - - - + return createOutsideSqlSelectExecution(handler, argNames, argTypes, sql); + } + + protected OutsideSqlSelectExecution createOutsideSqlSelectExecution( + ResultSetHandler handler, String[] argNames, Class[] argTypes, + String sql) { + final OutsideSqlSelectExecution cmd = new OutsideSqlSelectExecution( + _dataSource, _statementFactory, handler); + cmd.setArgNames(argNames); + cmd.setArgTypes(argTypes); + cmd.setSql(sql); + return cmd; + } + + public Object[] getSqlExecutionArgument() { + assertStatus("getSqlExecutionArgument"); + return new Object[] { _parameterBean }; + } + + //========================================================================== + // ========= + // Extension Point + // =============== + protected abstract ResultSetHandler createOutsideSqlSelectResultSetHandler(); + + protected abstract Object getResultTypeSpecification(); + + //========================================================================== + // ========= + // Assert Helper + // ============= + protected void assertStatus(String methodName) { + assertBasicProperty(methodName); + assertComponentProperty(methodName); + assertOutsideSqlBasic(methodName); + } +} Property changes on: addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/bhv/core/command/AbstractOutsideSqlSelectCommand.java ___________________________________________________________________ Name: svn:eol-style + native Added: addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/bhv/core/command/AbstractSelectCBCommand.java =================================================================== --- addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/bhv/core/command/AbstractSelectCBCommand.java (rev 0) +++ addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/bhv/core/command/AbstractSelectCBCommand.java 2008-12-27 22:06:42 UTC (rev 1624) @@ -0,0 +1,122 @@ +package jp.sf.pal.addresslist.db.allcommon.bhv.core.command; + +import jp.sf.pal.addresslist.db.allcommon.bhv.core.SqlExecution; +import jp.sf.pal.addresslist.db.allcommon.bhv.core.execution.SelectCBExecution; +import jp.sf.pal.addresslist.db.allcommon.cbean.ConditionBean; +import jp.sf.pal.addresslist.db.allcommon.cbean.outsidesql.OutsideSqlOption; + +import org.seasar.extension.jdbc.ResultSetHandler; + +/** + * @author DBFlute(AutoGenerator) + * @param The type of result. + */ +public abstract class AbstractSelectCBCommand extends + AbstractBehaviorCommand { + + //========================================================================== + // ========= + // Attribute + // ========= + /** The type of condition-bean. (Derived from conditionBean) */ + protected Class _conditionBeanType; + + /** The instance of condition-bean. (Required) */ + protected ConditionBean _conditionBean; + + //========================================================================== + // ========= + // Detail Information + // ================== + public boolean isConditionBean() { + return true; + } + + public boolean isOutsideSql() { + return false; + } + + public boolean isProcedure() { + return false; + } + + public boolean isSelect() { + return true; + } + + //========================================================================== + // ========= + // SqlExecution Handling + // ===================== + public String buildSqlExecutionKey() { + assertStatus("buildSqlExecutionKey"); + return _tableDbName + ":" + getCommandName() + "(" + + _conditionBeanType.getSimpleName() + ")"; + } + + protected SqlExecution createSelectCBExecution( + Class cbType, ResultSetHandler handler) { + return createSelectCBExecution(handler, new String[] { "dto" }, + new Class[] { cbType }); + } + + protected SelectCBExecution createSelectCBExecution( + ResultSetHandler handler, String[] argNames, Class[] argTypes) { + final SelectCBExecution cmd = new SelectCBExecution(_dataSource, + _statementFactory, handler); + cmd.setArgNames(argNames); + cmd.setArgTypes(argTypes); + return cmd; + } + + public Object[] getSqlExecutionArgument() { + assertStatus("getSqlExecutionArgument"); + return new Object[] { _conditionBean }; + } + + //========================================================================== + // ========= + // Argument Information + // ==================== + public ConditionBean getConditionBean() { + return _conditionBean; + } + + public String getOutsideSqlPath() { + return null; + } + + public OutsideSqlOption getOutsideSqlOption() { + return null; + } + + //========================================================================== + // ========= + // Assert Helper + // ============= + protected void assertStatus(String methodName) { + assertBasicProperty(methodName); + assertComponentProperty(methodName); + if (_conditionBeanType == null) { + throw new IllegalStateException(buildAssertMessage( + "_conditionBeanType", methodName)); + } + if (_conditionBean == null) { + throw new IllegalStateException(buildAssertMessage( + "_conditionBean", methodName)); + } + } + + //========================================================================== + // ========= + // Accessor + // ======== + public void setConditionBeanType( + Class conditionBeanType) { + _conditionBeanType = conditionBeanType; + } + + public void setConditionBean(ConditionBean conditionBean) { + _conditionBean = conditionBean; + } +} Property changes on: addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/bhv/core/command/AbstractSelectCBCommand.java ___________________________________________________________________ Name: svn:eol-style + native Added: addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/bhv/core/command/BatchDeleteEntityCommand.java =================================================================== --- addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/bhv/core/command/BatchDeleteEntityCommand.java (rev 0) +++ addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/bhv/core/command/BatchDeleteEntityCommand.java 2008-12-27 22:06:42 UTC (rev 1624) @@ -0,0 +1,51 @@ +package jp.sf.pal.addresslist.db.allcommon.bhv.core.command; + +import jp.sf.pal.addresslist.db.allcommon.bhv.core.SqlExecution; +import jp.sf.pal.addresslist.db.allcommon.bhv.core.SqlExecutionCreator; +import jp.sf.pal.addresslist.db.allcommon.s2dao.internal.sqlcommand.InternalDeleteBatchAutoStaticCommand; + +import org.seasar.dao.BeanMetaData; + +/** + * @author DBFlute(AutoGenerator) + */ +public class BatchDeleteEntityCommand extends AbstractListEntityCommand { + + //========================================================================== + // ========= + // Basic Information + // ================= + public String getCommandName() { + return "batchDelete"; + } + + //========================================================================== + // ========= + // SqlExecution Handling + // ===================== + public SqlExecutionCreator createSqlExecutionCreator() { + assertStatus("createSqlExecutionCreator"); + return new SqlExecutionCreator() { + public SqlExecution createSqlExecution() { + final BeanMetaData bmd = createBeanMetaData(); + return createBatchDeleteEntitySqlExecution(bmd); + } + }; + } + + protected SqlExecution createBatchDeleteEntitySqlExecution(BeanMetaData bmd) { + final String[] propertyNames = getPersistentPropertyNames(bmd); + return createDeleteBatchAutoStaticCommand(bmd, propertyNames); + } + + protected InternalDeleteBatchAutoStaticCommand createDeleteBatchAutoStaticCommand( + BeanMetaData bmd, String[] propertyNames) { + boolean opt = isOptimisticLockHandling(); + return new InternalDeleteBatchAutoStaticCommand(_dataSource, + _statementFactory, bmd, propertyNames, opt); + } + + protected boolean isOptimisticLockHandling() { + return true; + } +} Property changes on: addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/bhv/core/command/BatchDeleteEntityCommand.java ___________________________________________________________________ Name: svn:eol-style + native Added: addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/bhv/core/command/BatchDeleteNonstrictEntityCommand.java =================================================================== --- addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/bhv/core/command/BatchDeleteNonstrictEntityCommand.java (rev 0) +++ addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/bhv/core/command/BatchDeleteNonstrictEntityCommand.java 2008-12-27 22:06:42 UTC (rev 1624) @@ -0,0 +1,25 @@ +package jp.sf.pal.addresslist.db.allcommon.bhv.core.command; + +/** + * @author DBFlute(AutoGenerator) + */ +public class BatchDeleteNonstrictEntityCommand extends BatchDeleteEntityCommand { + + //========================================================================== + // ========= + // Basic Information + // ================= + @Override + public String getCommandName() { + return "batchDeleteNonstrict"; + } + + //========================================================================== + // ========= + // SqlExecution Handling + // ===================== + @Override + protected boolean isOptimisticLockHandling() { + return false; + } +} Property changes on: addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/bhv/core/command/BatchDeleteNonstrictEntityCommand.java ___________________________________________________________________ Name: svn:eol-style + native Added: addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/bhv/core/command/BatchInsertEntityCommand.java =================================================================== --- addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/bhv/core/command/BatchInsertEntityCommand.java (rev 0) +++ addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/bhv/core/command/BatchInsertEntityCommand.java 2008-12-27 22:06:42 UTC (rev 1624) @@ -0,0 +1,46 @@ +package jp.sf.pal.addresslist.db.allcommon.bhv.core.command; + +import jp.sf.pal.addresslist.db.allcommon.bhv.core.SqlExecution; +import jp.sf.pal.addresslist.db.allcommon.bhv.core.SqlExecutionCreator; +import jp.sf.pal.addresslist.db.allcommon.s2dao.internal.sqlcommand.InternalInsertBatchAutoStaticCommand; + +import org.seasar.dao.BeanMetaData; + +/** + * @author DBFlute(AutoGenerator) + */ +public class BatchInsertEntityCommand extends AbstractListEntityCommand { + + //========================================================================== + // ========= + // Basic Information + // ================= + public String getCommandName() { + return "batchInsert"; + } + + //========================================================================== + // ========= + // SqlExecution Handling + // ===================== + public SqlExecutionCreator createSqlExecutionCreator() { + assertStatus("createSqlExecutionCreator"); + return new SqlExecutionCreator() { + public SqlExecution createSqlExecution() { + final BeanMetaData bmd = createBeanMetaData(); + return createBatchInsertEntitySqlExecution(bmd); + } + }; + } + + protected SqlExecution createBatchInsertEntitySqlExecution(BeanMetaData bmd) { + final String[] propertyNames = getPersistentPropertyNames(bmd); + return createInsertBatchAutoStaticCommand(bmd, propertyNames); + } + + protected InternalInsertBatchAutoStaticCommand createInsertBatchAutoStaticCommand( + BeanMetaData bmd, String[] propertyNames) { + return new InternalInsertBatchAutoStaticCommand(_dataSource, + _statementFactory, bmd, propertyNames); + } +} Property changes on: addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/bhv/core/command/BatchInsertEntityCommand.java ___________________________________________________________________ Name: svn:eol-style + native Added: addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/bhv/core/command/BatchUpdateEntityCommand.java =================================================================== --- addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/bhv/core/command/BatchUpdateEntityCommand.java (rev 0) +++ addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/bhv/core/command/BatchUpdateEntityCommand.java 2008-12-27 22:06:42 UTC (rev 1624) @@ -0,0 +1,51 @@ +package jp.sf.pal.addresslist.db.allcommon.bhv.core.command; + +import jp.sf.pal.addresslist.db.allcommon.bhv.core.SqlExecution; +import jp.sf.pal.addresslist.db.allcommon.bhv.core.SqlExecutionCreator; +import jp.sf.pal.addresslist.db.allcommon.s2dao.internal.sqlcommand.InternalUpdateBatchAutoStaticCommand; + +import org.seasar.dao.BeanMetaData; + +/** + * @author DBFlute(AutoGenerator) + */ +public class BatchUpdateEntityCommand extends AbstractListEntityCommand { + + //========================================================================== + // ========= + // Basic Information + // ================= + public String getCommandName() { + return "batchUpdate"; + } + + //========================================================================== + // ========= + // SqlExecution Handling + // ===================== + public SqlExecutionCreator createSqlExecutionCreator() { + assertStatus("createSqlExecutionCreator"); + return new SqlExecutionCreator() { + public SqlExecution createSqlExecution() { + final BeanMetaData bmd = createBeanMetaData(); + return createBatchUpdateEntitySqlExecution(bmd); + } + }; + } + + protected SqlExecution createBatchUpdateEntitySqlExecution(BeanMetaData bmd) { + final String[] propertyNames = getPersistentPropertyNames(bmd); + return createUpdateBatchAutoStaticCommand(bmd, propertyNames); + } + + protected InternalUpdateBatchAutoStaticCommand createUpdateBatchAutoStaticCommand( + BeanMetaData bmd, String[] propertyNames) { + boolean opt = isOptimisticLockHandling(); + return new InternalUpdateBatchAutoStaticCommand(_dataSource, + _statementFactory, bmd, propertyNames, opt, opt); + } + + protected boolean isOptimisticLockHandling() { + return true; + } +} Property changes on: addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/bhv/core/command/BatchUpdateEntityCommand.java ___________________________________________________________________ Name: svn:eol-style + native Added: addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/bhv/core/command/BatchUpdateNonstrictEntityCommand.java =================================================================== --- addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/bhv/core/command/BatchUpdateNonstrictEntityCommand.java (rev 0) +++ addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/bhv/core/command/BatchUpdateNonstrictEntityCommand.java 2008-12-27 22:06:42 UTC (rev 1624) @@ -0,0 +1,25 @@ +package jp.sf.pal.addresslist.db.allcommon.bhv.core.command; + +/** + * @author DBFlute(AutoGenerator) + */ +public class BatchUpdateNonstrictEntityCommand extends BatchUpdateEntityCommand { + + //========================================================================== + // ========= + // Basic Information + // ================= + @Override + public String getCommandName() { + return "batchUpdateNonstrict"; + } + + //========================================================================== + // ========= + // SqlExecution Handling + // ===================== + @Override + protected boolean isOptimisticLockHandling() { + return false; + } +} Property changes on: addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/bhv/core/command/BatchUpdateNonstrictEntityCommand.java ___________________________________________________________________ Name: svn:eol-style + native Added: addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/bhv/core/command/DeleteEntityCommand.java =================================================================== --- addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/bhv/core/command/DeleteEntityCommand.java (rev 0) +++ addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/bhv/core/command/DeleteEntityCommand.java 2008-12-27 22:06:42 UTC (rev 1624) @@ -0,0 +1,51 @@ +package jp.sf.pal.addresslist.db.allcommon.bhv.core.command; + +import jp.sf.pal.addresslist.db.allcommon.bhv.core.SqlExecution; +import jp.sf.pal.addresslist.db.allcommon.bhv.core.SqlExecutionCreator; +import jp.sf.pal.addresslist.db.allcommon.s2dao.internal.sqlcommand.InternalDeleteAutoStaticCommand; + +import org.seasar.dao.BeanMetaData; + +/** + * @author DBFlute(AutoGenerator) + */ +public class DeleteEntityCommand extends AbstractEntityCommand { + + //========================================================================== + // ========= + // Basic Information + // ================= + public String getCommandName() { + return "delete"; + } + + //========================================================================== + // ========= + // SqlExecution Handling + // ===================== + public SqlExecutionCreator createSqlExecutionCreator() { + assertStatus("createSqlExecutionCreator"); + return new SqlExecutionCreator() { + public SqlExecution createSqlExecution() { + final BeanMetaData bmd = createBeanMetaData(); + return createDeleteEntitySqlExecution(bmd); + } + }; + } + + protected SqlExecution createDeleteEntitySqlExecution(BeanMetaData bmd) { + final String[] propertyNames = getPersistentPropertyNames(bmd); + return createDeleteAutoStaticCommand(bmd, propertyNames); + } + + protected InternalDeleteAutoStaticCommand createDeleteAutoStaticCommand( + BeanMetaData bmd, String[] propertyNames) { + return new InternalDeleteAutoStaticCommand(_dataSource, + _statementFactory, bmd, propertyNames, + isOptimisticLockHandling()); + } + + protected boolean isOptimisticLockHandling() { + return true; + } +} Property changes on: addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/bhv/core/command/DeleteEntityCommand.java ___________________________________________________________________ Name: svn:eol-style + native Added: addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/bhv/core/command/DeleteNonstrictEntityCommand.java =================================================================== --- addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/bhv/core/command/DeleteNonstrictEntityCommand.java (rev 0) +++ addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/bhv/core/command/DeleteNonstrictEntityCommand.java 2008-12-27 22:06:42 UTC (rev 1624) @@ -0,0 +1,25 @@ +package jp.sf.pal.addresslist.db.allcommon.bhv.core.command; + +/** + * @author DBFlute(AutoGenerator) + */ +public class DeleteNonstrictEntityCommand extends DeleteEntityCommand { + + //========================================================================== + // ========= + // Basic Information + // ================= + @Override + public String getCommandName() { + return "deleteNonstrict"; + } + + //========================================================================== + // ========= + // SqlExecution Handling + // ===================== + @Override + protected boolean isOptimisticLockHandling() { + return false; + } +} Property changes on: addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/bhv/core/command/DeleteNonstrictEntityCommand.java ___________________________________________________________________ Name: svn:eol-style + native Added: addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/bhv/core/command/InsertEntityCommand.java =================================================================== --- addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/bhv/core/command/InsertEntityCommand.java (rev 0) +++ addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/bhv/core/command/InsertEntityCommand.java 2008-12-27 22:06:42 UTC (rev 1624) @@ -0,0 +1,86 @@ +package jp.sf.pal.addresslist.db.allcommon.bhv.core.command; + +import java.util.List; + +import jp.sf.pal.addresslist.db.allcommon.bhv.core.SqlExecution; +import jp.sf.pal.addresslist.db.allcommon.bhv.core.SqlExecutionCreator; +import jp.sf.pal.addresslist.db.allcommon.dbmeta.DBMeta; +import jp.sf.pal.addresslist.db.allcommon.dbmeta.info.ColumnInfo; +import jp.sf.pal.addresslist.db.allcommon.s2dao.internal.sqlcommand.InternalInsertAutoDynamicCommand; + +import org.seasar.dao.BeanMetaData; + +/** + * @author DBFlute(AutoGenerator) + */ +public class InsertEntityCommand extends AbstractEntityCommand { + + //========================================================================== + // ========= + // Basic Information + // ================= + public String getCommandName() { + return "insert"; + } + + //========================================================================== + // ========= + // SqlExecution Handling + // ===================== + public SqlExecutionCreator createSqlExecutionCreator() { + assertStatus("createSqlExecutionCreator"); + return new SqlExecutionCreator() { + public SqlExecution createSqlExecution() { + final BeanMetaData bmd = createBeanMetaData(); + return createInsertEntitySqlExecution(bmd); + } + }; + } + + protected SqlExecution createInsertEntitySqlExecution(BeanMetaData bmd) { + final SqlExecution nonPrimaryKeySqlExecution = createNonPrimaryInsertSqlExecution(bmd); + if (nonPrimaryKeySqlExecution != null) { + return nonPrimaryKeySqlExecution; + } + final String[] propertyNames = getPersistentPropertyNames(bmd); + return createInsertAutoDynamicCommand(bmd, propertyNames); + } + + protected InternalInsertAutoDynamicCommand createInsertAutoDynamicCommand( + BeanMetaData bmd, String[] propertyNames) { + final InternalInsertAutoDynamicCommand cmd = new InternalInsertAutoDynamicCommand(); + cmd.setBeanMetaData(bmd); + cmd.setDataSource(_dataSource); + cmd.setPropertyNames(propertyNames); + cmd.setStatementFactory(_statementFactory); + return cmd; + } + + /** + * @param bmd The meta data of bean. (NotNull) + * @return Whether the method is target. (For example if it has primary key, + * returns false.) + */ + protected SqlExecution createNonPrimaryInsertSqlExecution(BeanMetaData bmd) { + final DBMeta dbmeta = findDBMeta(); + if (dbmeta.hasPrimaryKey()) { + return null; + } + final List columnInfoList = dbmeta.getColumnInfoList(); + final StringBuilder columnDefSb = new StringBuilder(); + for (jp.sf.pal.addresslist.db.allcommon.dbmeta.info.ColumnInfo columnInfo : columnInfoList) { + columnDefSb.append(", ").append(columnInfo.getColumnDbName()); + } + columnDefSb.delete(0, ", ".length()).insert(0, "(").append(")"); + final StringBuilder columnValuesSb = new StringBuilder(); + for (jp.sf.pal.addresslist.db.allcommon.dbmeta.info.ColumnInfo columnInfo : columnInfoList) { + columnValuesSb.append(", /*dto.").append( + columnInfo.getPropertyName()).append("*/null"); + } + columnValuesSb.delete(0, ", ".length()).insert(0, "(").append(")"); + final String sql = "insert into " + dbmeta.getTableSqlName() + + columnDefSb + " values" + columnValuesSb; + return createUpdateDynamicCommand(new String[] { "dto" }, + new Class[] { _entityType }, sql); + } +} Property changes on: addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/bhv/core/command/InsertEntityCommand.java ___________________________________________________________________ Name: svn:eol-style + native Added: addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/bhv/core/command/OutsideSqlCallCommand.java =================================================================== --- addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/bhv/core/command/OutsideSqlCallCommand.java (rev 0) +++ addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/bhv/core/command/OutsideSqlCallCommand.java 2008-12-27 22:06:42 UTC (rev 1624) @@ -0,0 +1,152 @@ +package jp.sf.pal.addresslist.db.allcommon.bhv.core.command; + +import jp.sf.pal.addresslist.db.allcommon.bhv.core.SqlExecution; +import jp.sf.pal.addresslist.db.allcommon.bhv.core.SqlExecutionCreator; +import jp.sf.pal.addresslist.db.allcommon.cbean.outsidesql.OutsideSqlContext; +import jp.sf.pal.addresslist.db.allcommon.cbean.outsidesql.OutsideSqlOption; +import jp.sf.pal.addresslist.db.allcommon.s2dao.internal.sqlcommand.InternalProcedureCommand; +import jp.sf.pal.addresslist.db.allcommon.s2dao.internal.various.InternalProcedureMetaData; +import jp.sf.pal.addresslist.db.allcommon.s2dao.internal.various.InternalProcedureMetaDataFactory; + +import org.seasar.extension.jdbc.ResultSetHandler; + +/** + * The behavior command for OutsideSql.execute(). + * + * @author DBFlute(AutoGenerator) + */ +public class OutsideSqlCallCommand extends AbstractOutsideSqlCommand { + + //========================================================================== + // ========= + // Basic Information + // ================= + public String getCommandName() { + return "call"; + } + + public Class getCommandReturnType() { + return void.class; + } + + //========================================================================== + // ========= + // Detail Information + // ================== + public boolean isProcedure() { + return true; + } + + public boolean isSelect() { + return false; + } + + //========================================================================== + // ========= + // Process Callback + // ================ + public void beforeGettingSqlExecution() { + assertStatus("beforeGettingSqlExecution"); + final String path = _outsideSqlPath; + final Object pmb = _parameterBean; + final OutsideSqlOption option = _outsideSqlOption; + final OutsideSqlContext outsideSqlContext = new OutsideSqlContext(); + outsideSqlContext.setDynamicBinding(option.isDynamicBinding()); + outsideSqlContext.setOffsetByCursorForcedly(option.isAutoPaging()); + outsideSqlContext.setLimitByCursorForcedly(option.isAutoPaging()); + outsideSqlContext.setOutsideSqlPath(path); + outsideSqlContext.setParameterBean(pmb); + outsideSqlContext.setMethodName(getCommandName()); + outsideSqlContext.setStatementConfig(option.getStatementConfig()); + outsideSqlContext.setTableDbName(option.getTableDbName()); + outsideSqlContext.setupBehaviorQueryPathIfNeeds(); + OutsideSqlContext.setOutsideSqlContextOnThread(outsideSqlContext); + } + + public void afterExecuting() { + } + + //========================================================================== + // ========= + // SqlExecution Handling + // ===================== + public String buildSqlExecutionKey() { + assertStatus("buildSqlExecutionKey"); + return generateSpecifiedOutsideSqlUniqueKey(); + } + + protected String generateSpecifiedOutsideSqlUniqueKey() { + final String methodName = getCommandName(); + final String path = _outsideSqlPath; + final Object pmb = _parameterBean; + final OutsideSqlOption option = _outsideSqlOption; + return OutsideSqlContext.generateSpecifiedOutsideSqlUniqueKey( + methodName, path, pmb, option, null); + } + + public SqlExecutionCreator createSqlExecutionCreator() { + assertStatus("createSqlExecutionCreator"); + return new SqlExecutionCreator() { + public SqlExecution createSqlExecution() { + final OutsideSqlContext outsideSqlContext = OutsideSqlContext + .getOutsideSqlContextOnThread(); + return createOutsideSqlCallCommand(outsideSqlContext); + } + }; + } + + protected SqlExecution createOutsideSqlCallCommand( + OutsideSqlContext outsideSqlContext) { + // - - - - - - - - - - - - - - - - - - - - - - - + // The attribute of Specified-OutsideSqlContext. + // - - - - - - - - - - - - - - - - - - - - - - - + final Object pmb = outsideSqlContext.getParameterBean(); + final String procedureName = outsideSqlContext.getOutsideSqlPath(); + + // - - - - - - - - - - - - - - - + // The attribute of SqlCommand. + // - - - - - - - - - - - - - - - + final InternalProcedureMetaDataFactory factory = createProcedureMetaDataFactory(); + factory.setValueTypeFactory(_valueTypeFactory); + final Class pmbType = (pmb != null ? pmb.getClass() : null); + final InternalProcedureMetaData metaData = factory + .createProcedureMetaData(procedureName, pmbType); + return createProcedureCommand(metaData); + } + + protected InternalProcedureMetaDataFactory createProcedureMetaDataFactory() { + return new InternalProcedureMetaDataFactory(); + } + + protected InternalProcedureCommand createProcedureCommand( + InternalProcedureMetaData metaData) { + // Because a procedure command does not use result set handler. + final ResultSetHandler resultSetHandler = new InternalNullResultSetHandler(); + return new InternalProcedureCommand(_dataSource, resultSetHandler, + _statementFactory, metaData); + } + + // /- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + // - - + // InternalProcedureCommand switches argument so this is unnecessary + // actually! + // - - - - - - - - - -/ + public Object[] getSqlExecutionArgument() { + return new Object[] { _parameterBean }; + } + + //========================================================================== + // ========= + // Assert Helper + // ============= + protected void assertStatus(String methodName) { + assertBasicProperty(methodName); + assertComponentProperty(methodName); + assertOutsideSqlBasic(methodName); + if (_parameterBean == null) { + String msg = "The property 'parameterBean' should not be null"; + msg = msg + " when you call " + methodName + "()."; + throw new IllegalStateException(msg); + } + } +} Property changes on: addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/bhv/core/command/OutsideSqlCallCommand.java ___________________________________________________________________ Name: svn:eol-style + native Added: addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/bhv/core/command/OutsideSqlExecuteCommand.java =================================================================== --- addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/bhv/core/command/OutsideSqlExecuteCommand.java (rev 0) +++ addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/bhv/core/command/OutsideSqlExecuteCommand.java 2008-12-27 22:06:42 UTC (rev 1624) @@ -0,0 +1,128 @@ +package jp.sf.pal.addresslist.db.allcommon.bhv.core.command; + +import jp.sf.pal.addresslist.db.allcommon.bhv.core.SqlExecution; +import jp.sf.pal.addresslist.db.allcommon.bhv.core.SqlExecutionCreator; +import jp.sf.pal.addresslist.db.allcommon.cbean.outsidesql.OutsideSqlContext; +import jp.sf.pal.addresslist.db.allcommon.cbean.outsidesql.OutsideSqlOption; + +/** + * The behavior command for OutsideSql.execute(). + * + * @author DBFlute(AutoGenerator) + */ +public class OutsideSqlExecuteCommand extends + AbstractOutsideSqlCommand { + + //========================================================================== + // ========= + // Basic Information + // ================= + public String getCommandName() { + return "execute"; + } + + public Class getCommandReturnType() { + return Integer.class; + } + + //========================================================================== + // ========= + // Detail Information + // ================== + public boolean isProcedure() { + return false; + } + + public boolean isSelect() { + return false; + } + + //========================================================================== + // ========= + // Process Callback + // ================ + public void beforeGettingSqlExecution() { + assertStatus("beforeGettingSqlExecution"); + final String path = _outsideSqlPath; + final Object pmb = _parameterBean; + final OutsideSqlOption option = _outsideSqlOption; + final OutsideSqlContext outsideSqlContext = new OutsideSqlContext(); + outsideSqlContext.setDynamicBinding(option.isDynamicBinding()); + outsideSqlContext.setOffsetByCursorForcedly(option.isAutoPaging()); + outsideSqlContext.setLimitByCursorForcedly(option.isAutoPaging()); + outsideSqlContext.setOutsideSqlPath(path); + outsideSqlContext.setParameterBean(pmb); + outsideSqlContext.setMethodName(getCommandName()); + outsideSqlContext.setStatementConfig(option.getStatementConfig()); + outsideSqlContext.setTableDbName(option.getTableDbName()); + outsideSqlContext.setupBehaviorQueryPathIfNeeds(); + OutsideSqlContext.setOutsideSqlContextOnThread(outsideSqlContext); + } + + public void afterExecuting() { + } + + //========================================================================== + // ========= + // SqlExecution Handling + // ===================== + public String buildSqlExecutionKey() { + assertStatus("buildSqlExecutionKey"); + return generateSpecifiedOutsideSqlUniqueKey(); + } + + protected String generateSpecifiedOutsideSqlUniqueKey() { + final String methodName = getCommandName(); + final String path = _outsideSqlPath; + final Object pmb = _parameterBean; + final OutsideSqlOption option = _outsideSqlOption; + return OutsideSqlContext.generateSpecifiedOutsideSqlUniqueKey( + methodName, path, pmb, option, null); + } + + public SqlExecutionCreator createSqlExecutionCreator() { + assertStatus("createSqlExecutionCreator"); + return new SqlExecutionCreator() { + public SqlExecution createSqlExecution() { + final OutsideSqlContext outsideSqlContext = OutsideSqlContext + .getOutsideSqlContextOnThread(); + return createOutsideSqlExecuteExecution(outsideSqlContext); + } + }; + } + + protected SqlExecution createOutsideSqlExecuteExecution( + OutsideSqlContext outsideSqlContext) { + // - - - - - - - - - - - - - - - - - - - - - - - + // The attribute of Specified-OutsideSqlContext. + // - - - - - - - - - - - - - - - - - - - - - - - + final String suffix = buildDbmsSuffix(); + final String sql = outsideSqlContext.readFilteredOutsideSql( + _sqlFileEncoding, suffix); + final Object pmb = outsideSqlContext.getParameterBean(); + + // - - - - - - - - - - - - - - - + // The attribute of SqlCommand. + // - - - - - - - - - - - - - - - + final String[] argNames = (pmb != null ? new String[] { "pmb" } + : new String[] {}); + final Class[] argTypes = (pmb != null ? new Class[] { pmb + .getClass() } : new Class[] {}); + + return createUpdateDynamicCommand(argNames, argTypes, sql); + } + + public Object[] getSqlExecutionArgument() { + return new Object[] { _parameterBean }; + } + + //========================================================================== + // ========= + // Assert Helper + // ============= + protected void assertStatus(String methodName) { + assertBasicProperty(methodName); + assertComponentProperty(methodName); + assertOutsideSqlBasic(methodName); + } +} Property changes on: addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/bhv/core/command/OutsideSqlExecuteCommand.java ___________________________________________________________________ Name: svn:eol-style + native Added: addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/bhv/core/command/OutsideSqlSelectCursorCommand.java =================================================================== --- addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/bhv/core/command/OutsideSqlSelectCursorCommand.java (rev 0) +++ addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/bhv/core/command/OutsideSqlSelectCursorCommand.java 2008-12-27 22:06:42 UTC (rev 1624) @@ -0,0 +1,77 @@ +package jp.sf.pal.addresslist.db.allcommon.bhv.core.command; + +import java.sql.ResultSet; +import java.sql.SQLException; + +import jp.sf.pal.addresslist.db.allcommon.jdbc.CursorHandler; + +import org.seasar.extension.jdbc.ResultSetHandler; + +/** + * The behavior command for OutsideSql.selectList(). + * + * @author DBFlute(AutoGenerator) + */ +public class OutsideSqlSelectCursorCommand extends + AbstractOutsideSqlSelectCommand { + + //========================================================================== + // ========= + // Attribute + // ========= + /** The handler of cursor. (Required) */ + protected CursorHandler _cursorHandler; + + //========================================================================== + // ========= + // Basic Information + // ================= + public String getCommandName() { + return "selectCursor"; + } + + public Class getCommandReturnType() { + return Object.class; + } + + //========================================================================== + // ========= + // Extension Point + // =============== + @Override + protected ResultSetHandler createOutsideSqlSelectResultSetHandler() { + return new ResultSetHandler() { + public Object handle(ResultSet rs) throws SQLException { + return _cursorHandler.handle(rs); + } + }; + } + + @Override + protected Object getResultTypeSpecification() { + return _cursorHandler; + } + + //========================================================================== + // ========= + // Assert Helper + // ============= + @Override + protected void assertStatus(String methodName) { + assertBasicProperty(methodName); + assertComponentProperty(methodName); + assertOutsideSqlBasic(methodName); + if (_cursorHandler == null) { + throw new IllegalStateException(buildAssertMessage( + "_cursorHandler", methodName)); + } + } + + //========================================================================== + // ========= + // Accessor + // ======== + public void setCursorHandler(CursorHandler cursorHandler) { + _cursorHandler = cursorHandler; + } +} Property changes on: addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/bhv/core/command/OutsideSqlSelectCursorCommand.java ___________________________________________________________________ Name: svn:eol-style + native Added: addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/bhv/core/command/OutsideSqlSelectListCommand.java =================================================================== --- addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/bhv/core/command/OutsideSqlSelectListCommand.java (rev 0) +++ addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/bhv/core/command/OutsideSqlSelectListCommand.java 2008-12-27 22:06:42 UTC (rev 1624) @@ -0,0 +1,96 @@ +package jp.sf.pal.addresslist.db.allcommon.bhv.core.command; + +import java.util.List; + +import org.seasar.dao.BeanMetaData; +import org.seasar.extension.jdbc.ResultSetHandler; +import org.seasar.extension.jdbc.ValueType; +import org.seasar.extension.jdbc.types.ValueTypes; + +/** + * The behavior command for OutsideSql.selectList(). + * + * @author DBFlute(AutoGenerator) + * @param The type of entity. + */ +public class OutsideSqlSelectListCommand extends + AbstractOutsideSqlSelectCommand> { + + //========================================================================== + // ========= + // Attribute + // ========= + /** The type of entity. (Required) */ + protected Class _entityType; + + //========================================================================== + // ========= + // Basic Information + // ================= + public String getCommandName() { + return "selectList"; + } + + public Class getCommandReturnType() { + return List.class; + } + + //========================================================================== + // ========= + // Factory + // ======= + // ----------------------------------------------------- + // BeanMetaData + // ------------ + protected BeanMetaData createBeanMetaData() { + assertEntityType("createBeanMetaData"); + return _beanMetaDataFactory.createBeanMetaData(_entityType); + } + + // ----------------------------------------------------- + // ResultSetHandler + // ---------------- + protected ResultSetHandler createOutsideSqlBeanListResultSetHandler( + BeanMetaData bmd) { + final ValueType valueType = ValueTypes.getValueType(_entityType); + if (valueType == null || !valueType.equals(ValueTypes.OBJECT)) { + return createObjectListResultSetHandler(valueType); + } + return createBeanListMetaDataResultSetHandler(bmd); + } + + //========================================================================== + // ========= + // Extension Point + // =============== + @Override + protected ResultSetHandler createOutsideSqlSelectResultSetHandler() { + final BeanMetaData bmd = createBeanMetaData(); + final ResultSetHandler handler = createOutsideSqlBeanListResultSetHandler(bmd); + return handler; + } + + @Override + protected Object getResultTypeSpecification() { + return _entityType; + } + + //========================================================================== + // ========= + // Assert Helper + // ============= + protected void assertEntityType(String methodName) { + if (_entityType == null) { + throw new IllegalStateException(buildAssertMessage("_entityType", + methodName)); + } + } + + //========================================================================== + // ========= + // Accessor + // ======== + public void setEntityType(Class entityType) { + _entityType = entityType; + } +} Property changes on: addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/bhv/core/command/OutsideSqlSelectListCommand.java ___________________________________________________________________ Name: svn:eol-style + native Added: addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/bhv/core/command/QueryDeleteCBCommand.java =================================================================== --- addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/bhv/core/command/QueryDeleteCBCommand.java (rev 0) +++ addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/bhv/core/command/QueryDeleteCBCommand.java 2008-12-27 22:06:42 UTC (rev 1624) @@ -0,0 +1,151 @@ +package jp.sf.pal.addresslist.db.allcommon.bhv.core.command; + +import jp.sf.pal.addresslist.db.allcommon.bhv.core.SqlExecution; +import jp.sf.pal.addresslist.db.allcommon.bhv.core.SqlExecutionCreator; +import jp.sf.pal.addresslist.db.allcommon.cbean.ConditionBean; +import jp.sf.pal.addresslist.db.allcommon.cbean.ConditionBeanContext; +import jp.sf.pal.addresslist.db.allcommon.cbean.FetchNarrowingBeanContext; +import jp.sf.pal.addresslist.db.allcommon.cbean.outsidesql.OutsideSqlOption; +import jp.sf.pal.addresslist.db.allcommon.s2dao.internal.sqlcommand.InternalDeleteQueryAutoDynamicCommand; + +/** + * @author DBFlute(AutoGenerator) + */ +public class QueryDeleteCBCommand extends AbstractBehaviorCommand { + + //========================================================================== + // ========= + // Attribute + // ========= + /** The type of condition-bean. (Derived from conditionBean) */ + protected Class _conditionBeanType; + + /** The instance of condition-bean. (Required) */ + protected ConditionBean _conditionBean; + + //========================================================================== + // ========= + // Basic Information + // ================= + public String getCommandName() { + return "queryDelete"; + } + + public Class getCommandReturnType() { + return int.class; + } + + //========================================================================== + // ========= + // Detail Information + // ================== + public boolean isConditionBean() { + return true; + } + + public boolean isOutsideSql() { + return false; + } + + public boolean isProcedure() { + return false; + } + + public boolean isSelect() { + return false; + } + + public boolean isSelectCount() { + return false; + } + + //========================================================================== + // ========= + // Process Callback + // ================ + public void beforeGettingSqlExecution() { + assertStatus("beforeGettingSqlExecution"); + final ConditionBean cb = _conditionBean; + FetchNarrowingBeanContext.setFetchNarrowingBeanOnThread(cb); + ConditionBeanContext.setConditionBeanOnThread(cb); + } + + public void afterExecuting() { + } + + //========================================================================== + // ========= + // SqlExecution Handling + // ===================== + public String buildSqlExecutionKey() { + assertStatus("buildSqlExecutionKey"); + return _tableDbName + ":" + getCommandName() + "(" + + _conditionBeanType.getSimpleName() + ")"; + } + + public SqlExecutionCreator createSqlExecutionCreator() { + assertStatus("createSqlExecutionCreator"); + return new SqlExecutionCreator() { + public SqlExecution createSqlExecution() { + return createQueryDeleteCBExecution(_conditionBeanType); + } + }; + } + + protected SqlExecution createQueryDeleteCBExecution( + Class cbType) { + return new InternalDeleteQueryAutoDynamicCommand(_dataSource, + _statementFactory); + } + + public Object[] getSqlExecutionArgument() { + assertStatus("getSqlExecutionArgument"); + return new Object[] { _conditionBean }; + } + + //========================================================================== + // ========= + // Argument Information + // ==================== + public ConditionBean getConditionBean() { + return _conditionBean; + } + + public String getOutsideSqlPath() { + return null; + } + + public OutsideSqlOption getOutsideSqlOption() { + return null; + } + + //========================================================================== + // ========= + // Assert Helper + // ============= + protected void assertStatus(String methodName) { + assertBasicProperty(methodName); + assertComponentProperty(methodName); + if (_conditionBeanType == null) { + throw new IllegalStateException(buildAssertMessage( + "_conditionBeanType", methodName)); + } + if (_conditionBean == null) { + throw new IllegalStateException(buildAssertMessage( + "_conditionBean", methodName)); + } + } + + //========================================================================== + // ========= + // Accessor + // ======== + public void setConditionBeanType( + Class conditionBeanType) { + _conditionBeanType = conditionBeanType; + } + + public void setConditionBean(ConditionBean conditionBean) { + _conditionBean = conditionBean; + } +} Property changes on: addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/bhv/core/command/QueryDeleteCBCommand.java ___________________________________________________________________ Name: svn:eol-style + native Added: addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/bhv/core/command/QueryUpdateEntityCBCommand.java =================================================================== --- addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/bhv/core/command/QueryUpdateEntityCBCommand.java (rev 0) +++ addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/bhv/core/command/QueryUpdateEntityCBCommand.java 2008-12-27 22:06:42 UTC (rev 1624) @@ -0,0 +1,140 @@ +package jp.sf.pal.addresslist.db.allcommon.bhv.core.command; + +import jp.sf.pal.addresslist.db.allcommon.bhv.core.SqlExecution; +import jp.sf.pal.addresslist.db.allcommon.bhv.core.SqlExecutionCreator; +import jp.sf.pal.addresslist.db.allcommon.cbean.ConditionBean; +import jp.sf.pal.addresslist.db.allcommon.cbean.ConditionBeanContext; +import jp.sf.pal.addresslist.db.allcommon.cbean.FetchNarrowingBeanContext; +import jp.sf.pal.addresslist.db.allcommon.cbean.outsidesql.OutsideSqlOption; +import jp.sf.pal.addresslist.db.allcommon.s2dao.internal.sqlcommand.InternalUpdateQueryAutoDynamicCommand; + +/** + * @author DBFlute(AutoGenerator) + */ +public class QueryUpdateEntityCBCommand extends AbstractEntityCommand { + + //========================================================================== + // ========= + // Attribute + // ========= + /** The type of condition-bean. (Derived from conditionBean) */ + protected Class _conditionBeanType; + + /** The instance of condition-bean. (Required) */ + protected ConditionBean _conditionBean; + + //========================================================================== + // ========= + // Basic Information + // ================= + public String getCommandName() { + return "queryUpdate"; + } + + //========================================================================== + // ========= + // Detail Information + // ================== + @Override + public boolean isConditionBean() { + return true; + } + + //========================================================================== + // ========= + // Process Callback + // ================ + @Override + public void beforeGettingSqlExecution() { + assertStatus("beforeGettingSqlExecution"); + final ConditionBean cb = _conditionBean; + FetchNarrowingBeanContext.setFetchNarrowingBeanOnThread(cb); + ConditionBeanContext.setConditionBeanOnThread(cb); + } + + //========================================================================== + // ========= + // SqlExecution Handling + // ===================== + public String buildSqlExecutionKey() { + assertStatus("buildSqlExecutionKey"); + return _tableDbName + ":" + getCommandName() + "(" + + _entityType.getSimpleName() + ", " + + _conditionBeanType.getSimpleName() + ")"; + } + + public SqlExecutionCreator createSqlExecutionCreator() { + assertStatus("createSqlExecutionCreator"); + return new SqlExecutionCreator() { + public SqlExecution createSqlExecution() { + return createQueryUpdateEntityCBExecution(_conditionBeanType); + } + }; + } + + protected SqlExecution createQueryUpdateEntityCBExecution( + Class cbType) { + return new InternalUpdateQueryAutoDynamicCommand(_dataSource, + _statementFactory); + } + + public Object[] getSqlExecutionArgument() { + assertStatus("getSqlExecutionArgument"); + return new Object[] { _conditionBean, _entity }; + } + + //========================================================================== + // ========= + // Argument Information + // ==================== + public ConditionBean getConditionBean() { + return _conditionBean; + } + + public String getOutsideSqlPath() { + return null; + } + + public OutsideSqlOption getOutsideSqlOption() { + return null; + } + + //========================================================================== + // ========= + // Assert Helper + // ============= + @Override + protected void assertStatus(String methodName) { + assertBasicProperty(methodName); + assertComponentProperty(methodName); + if (_entityType == null) { + throw new IllegalStateException(buildAssertMessage("_entityType", + methodName)); + } + if (_entity == null) { + throw new IllegalStateException(buildAssertMessage("_entity", + methodName)); + } + if (_conditionBeanType == null) { + throw new IllegalStateException(buildAssertMessage( + "_conditionBeanType", methodName)); + } + if (_conditionBean == null) { + throw new IllegalStateException(buildAssertMessage( + "_conditionBean", methodName)); + } + } + + //========================================================================== + // ========= + // Accessor + // ======== + public void setConditionBeanType( + Class conditionBeanType) { + _conditionBeanType = conditionBeanType; + } + + public void setConditionBean(ConditionBean conditionBean) { + _conditionBean = conditionBean; + } +} Property changes on: addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/bhv/core/command/QueryUpdateEntityCBCommand.java ___________________________________________________________________ Name: svn:eol-style + native Added: addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/bhv/core/command/SelectCountCBCommand.java =================================================================== --- addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/bhv/core/command/SelectCountCBCommand.java (rev 0) +++ addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/bhv/core/command/SelectCountCBCommand.java 2008-12-27 22:06:42 UTC (rev 1624) @@ -0,0 +1,65 @@ +package jp.sf.pal.addresslist.db.allcommon.bhv.core.command; + +import jp.sf.pal.addresslist.db.allcommon.bhv.core.SqlExecution; +import jp.sf.pal.addresslist.db.allcommon.bhv.core.SqlExecutionCreator; +import jp.sf.pal.addresslist.db.allcommon.cbean.ConditionBean; +import jp.sf.pal.addresslist.db.allcommon.cbean.ConditionBeanContext; + +import org.seasar.extension.jdbc.ResultSetHandler; + +/** + * @author DBFlute(AutoGenerator) + */ +public class SelectCountCBCommand extends AbstractSelectCBCommand { + + //========================================================================== + // ========= + // Basic Information + // ================= + public String getCommandName() { + return "selectCount"; + } + + public Class getCommandReturnType() { + return Integer.class; + } + + //========================================================================== + // ========= + // Process Callback + // ================ + public void beforeGettingSqlExecution() { + assertStatus("beforeGettingSqlExecution"); + final ConditionBean cb = _conditionBean; + cb.xsetupSelectCountIgnoreFetchScope(); // *Point! + ConditionBeanContext.setConditionBeanOnThread(cb); + } + + public void afterExecuting() { + assertStatus("afterExecuting"); + final ConditionBean cb = _conditionBean; + cb.xafterCareSelectCountIgnoreFetchScope(); + } + + //========================================================================== + // ========= + // Detail Information + // ================== + public boolean isSelectCount() { + return true; + } + + //========================================================================== + // ========= + // SqlExecution Handling + // ===================== + public SqlExecutionCreator createSqlExecutionCreator() { + assertStatus("createSqlExecutionCreator"); + return new SqlExecutionCreator() { + public SqlExecution createSqlExecution() { + ResultSetHandler handler = createObjectResultSetHandler(getCommandReturnType()); + return createSelectCBExecution(_conditionBeanType, handler); + } + }; + } +} Property changes on: addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/bhv/core/command/SelectCountCBCommand.java ___________________________________________________________________ Name: svn:eol-style + native Added: addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/bhv/core/command/SelectListCBCommand.java =================================================================== --- addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/bhv/core/command/SelectListCBCommand.java (rev 0) +++ addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/bhv/core/command/SelectListCBCommand.java 2008-12-27 22:06:42 UTC (rev 1624) @@ -0,0 +1,103 @@ +package jp.sf.pal.addresslist.db.allcommon.bhv.core.command; + +import java.util.List; + +import jp.sf.pal.addresslist.db.allcommon.Entity; +import jp.sf.pal.addresslist.db.allcommon.bhv.core.SqlExecution; +import jp.sf.pal.addresslist.db.allcommon.bhv.core.SqlExecutionCreator; +import jp.sf.pal.addresslist.db.allcommon.cbean.ConditionBean; +import jp.sf.pal.addresslist.db.allcommon.cbean.ConditionBeanContext; +import jp.sf.pal.addresslist.db.allcommon.cbean.FetchNarrowingBeanContext; + +import org.seasar.dao.BeanMetaData; +import org.seasar.extension.jdbc.ResultSetHandler; + +/** + * @author DBFlute(AutoGenerator) + * @param The type of entity. + */ +public class SelectListCBCommand extends + AbstractSelectCBCommand> { + + //========================================================================== + // ========= + // Attribute + // ========= + /** The type of entity. (Required) */ + protected Class _entityType; + + //========================================================================== + // ========= + // Basic Information + // ================= + public String getCommandName() { + return "selectList"; + } + + public Class getCommandReturnType() { + return List.class; + } + + //========================================================================== + // ========= + // Detail Information + // ================== + public boolean isSelectCount() { + return false; + } + + //========================================================================== + // ========= + // Process Callback + // ================ + public void beforeGettingSqlExecution() { + assertStatus("beforeGettingSqlExecution"); + final ConditionBean cb = _conditionBean; + FetchNarrowingBeanContext.setFetchNarrowingBeanOnThread(cb); + ConditionBeanContext.setConditionBeanOnThread(cb); + } + + public void afterExecuting() { + assertStatus("afterExecuting"); + } + + //========================================================================== + // ========= + // SqlExecution Handling + // ===================== + public SqlExecutionCreator createSqlExecutionCreator() { + assertStatus("createSqlExecutionCreator"); + return new SqlExecutionCreator() { + public SqlExecution createSqlExecution() { + BeanMetaData bmd = createBeanMetaData(); + ResultSetHandler handler = createBeanListMetaDataResultSetHandler(bmd); + return createSelectCBExecution(_conditionBeanType, handler); + } + }; + } + + protected BeanMetaData createBeanMetaData() { + return _beanMetaDataFactory.createBeanMetaData(_entityType); + } + + //========================================================================== + // ========= + // Assert Helper + // ============= + @Override + protected void assertStatus(String methodName) { + super.assertStatus(methodName); + if (_entityType == null) { + throw new IllegalStateException(buildAssertMessage("_entityType", + methodName)); + } + } + + //========================================================================== + // ========= + // Accessor + // ======== + public void setEntityType(Class entityType) { + _entityType = entityType; + } +} Property changes on: addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/bhv/core/command/SelectListCBCommand.java ___________________________________________________________________ Name: svn:eol-style + native Added: addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/bhv/core/command/SelectNextValCommand.java =================================================================== --- addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/bhv/core/command/SelectNextValCommand.java (rev 0) +++ addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/bhv/core/command/SelectNextValCommand.java 2008-12-27 22:06:42 UTC (rev 1624) @@ -0,0 +1,162 @@ +package jp.sf.pal.addresslist.db.allcommon.bhv.core.command; + +import jp.sf.pal.addresslist.db.allcommon.bhv.core.SqlExecution; +import jp.sf.pal.addresslist.db.allcommon.bhv.core.SqlExecutionCreator; +import jp.sf.pal.addresslist.db.allcommon.bhv.core.execution.BasicSelectExecution; +import jp.sf.pal.addresslist.db.allcommon.cbean.ConditionBean; +import jp.sf.pal.addresslist.db.allcommon.cbean.outsidesql.OutsideSqlOption; +import jp.sf.pal.addresslist.db.allcommon.dbmeta.DBMeta; +import jp.sf.pal.addresslist.db.allcommon.dbmeta.DBMetaInstanceHandler; + +import org.seasar.extension.jdbc.ResultSetHandler; + +/** + * @author DBFlute(AutoGenerator) + * @param The type of result. + */ +public class SelectNextValCommand extends + AbstractBehaviorCommand { + + //========================================================================== + // ========= + // Attribute + // ========= + /** The type of result. (NotNull) */ + protected Class _resultType; + + //========================================================================== + // ========= + // Basic Information + // ================= + public String getCommandName() { + return "selectNextVal"; + } + + public Class getCommandReturnType() { + return _resultType; + } + + //========================================================================== + // ========= + // Detail Information + // ================== + public boolean isConditionBean() { + return false; + } + + public boolean isOutsideSql() { + return false; + } + + public boolean isProcedure() { + return false; + } + + public boolean isSelect() { + return true; + } + + public boolean isSelectCount() { + return false; + } + + //========================================================================== + // ========= + // Process Callback + // ================ + public void beforeGettingSqlExecution() { + } + + public void afterExecuting() { + } + + //========================================================================== + // ========= + // SqlExecution Handling + // ===================== + public String buildSqlExecutionKey() { + assertStatus("buildSqlExecutionKey"); + return _tableDbName + ":" + getCommandName() + "()"; + } + + public SqlExecutionCreator createSqlExecutionCreator() { + assertStatus("createSqlExecutionCreator"); + return new SqlExecutionCreator() { + public SqlExecution createSqlExecution() { + ResultSetHandler handler = createObjectResultSetHandler(_resultType); + return createSelectNextValExecution(handler); + } + }; + } + + protected SqlExecution createSelectNextValExecution(ResultSetHandler handler) { + final DBMeta dbmeta = findDBMeta(); + if (!dbmeta.hasSequence()) { + String msg = "If the method 'selectNextVal()' exists, DBMeta.hasSequence() should return true:"; + msg = msg + " dbmeta.hasSequence()=" + dbmeta.hasSequence(); + throw new IllegalStateException(msg); + } + final String nextValSql = dbmeta.getSequenceNextValSql(); + if (nextValSql == null) { + String msg = "If the method 'selectNextVal()' exists, DBMeta.getSequenceNextValSql() should not return null:"; + msg = msg + " dbmeta.getSequenceNextValSql()=" + + dbmeta.getSequenceNextValSql(); + throw new IllegalStateException(msg); + } + return createBasicSelectExecution(handler, new String[] {}, + new Class[] {}, nextValSql); + } + + protected BasicSelectExecution createBasicSelectExecution( + ResultSetHandler handler, String[] argNames, Class[] argTypes, + String sql) { + final BasicSelectExecution cmd = new BasicSelectExecution(_dataSource, + _statementFactory, handler); + cmd.setArgNames(argNames); + cmd.setArgTypes(argTypes); + cmd.setSql(sql); + return cmd; + } + + protected DBMeta findDBMeta() { + return DBMetaInstanceHandler.findDBMeta(_tableDbName); + } + + public Object[] getSqlExecutionArgument() { + assertStatus("getSqlExecutionArgument"); + return new Object[] {}; + } + + //========================================================================== + // ========= + // Argument Information + // ==================== + public ConditionBean getConditionBean() { + return null; + } + + public String getOutsideSqlPath() { + return null; + } + + public OutsideSqlOption getOutsideSqlOption() { + return null; + } + + //========================================================================== + // ========= + // Assert Helper + // ============= + protected void assertStatus(String methodName) { + assertBasicProperty(methodName); + assertComponentProperty(methodName); + } + + //========================================================================== + // ========= + // Accessor + // ======== + public void setResultType(Class resultType) { + _resultType = resultType; + } +} Property changes on: addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/bhv/core/command/SelectNextValCommand.java ___________________________________________________________________ Name: svn:eol-style + native Added: addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/bhv/core/command/SelectScalarCBCommand.java =================================================================== --- addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/bhv/core/command/SelectScalarCBCommand.java (rev 0) +++ addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/bhv/core/command/SelectScalarCBCommand.java 2008-12-27 22:06:42 UTC (rev 1624) @@ -0,0 +1,112 @@ +package jp.sf.pal.addresslist.db.allcommon.bhv.core.command; + +import jp.sf.pal.addresslist.db.allcommon.bhv.core.SqlExecution; +import jp.sf.pal.addresslist.db.allcommon.bhv.core.SqlExecutionCreator; +import jp.sf.pal.addresslist.db.allcommon.cbean.ConditionBean; +import jp.sf.pal.addresslist.db.allcommon.cbean.ConditionBeanContext; +import jp.sf.pal.addresslist.db.allcommon.cbean.sqlclause.SqlClause; + +import org.seasar.extension.jdbc.ResultSetHandler; + +/** + * @author DBFlute(AutoGenerator) + * @param The type of result. + */ +public class SelectScalarCBCommand extends + AbstractSelectCBCommand { + + //========================================================================== + // ========= + // Attribute + // ========= + /** The type of result. (NotNull) */ + protected Class _resultType; + + /** The type of select clause. (NotNull) */ + protected SqlClause.SelectClauseType _selectClauseType; + + //========================================================================== + // ========= + // Basic Information + // ================= + public String getCommandName() { + assertStatus("getCommandName"); + final String resultTypeName = _resultType.getSimpleName(); + final String scalarMethodName = _selectClauseType.toString() + .toLowerCase(); + return "scalarSelect(" + resultTypeName + ")." + scalarMethodName; + } + + public Class getCommandReturnType() { + assertStatus("getCommandReturnType"); + return _resultType; + } + + //========================================================================== + // ========= + // Detail Information + // ================== + public boolean isSelectCount() { + return false; + } + + //========================================================================== + // ========= + // Process Callback + // ================ + public void beforeGettingSqlExecution() { + assertStatus("beforeGettingSqlExecution"); + final ConditionBean cb = _conditionBean; + ConditionBeanContext.setConditionBeanOnThread(cb); + cb.getSqlClause().classifySelectClauseType(_selectClauseType); //*Point! + } + + public void afterExecuting() { + assertStatus("afterExecuting"); + final ConditionBean cb = _conditionBean; + cb.getSqlClause().rollbackSelectClauseType(); + } + + //========================================================================== + // ========= + // SqlExecution Handling + // ===================== + public SqlExecutionCreator createSqlExecutionCreator() { + assertStatus("createSqlExecutionCreator"); + return new SqlExecutionCreator() { + public SqlExecution createSqlExecution() { + ResultSetHandler handler = createObjectResultSetHandler(getCommandReturnType()); + return createSelectCBExecution(_conditionBeanType, handler); + } + }; + } + + //========================================================================== + // ========= + // Assert Helper + // ============= + @Override + protected void assertStatus(String methodName) { + super.assertStatus(methodName); + if (_resultType == null) { + throw new IllegalStateException(buildAssertMessage("_resultType", + methodName)); + } + if (_selectClauseType == null) { + throw new IllegalStateException(buildAssertMessage( + "_selectClauseType", methodName)); + } + } + + //========================================================================== + // ========= + // Accessor + // ======== + public void setResultType(Class resultType) { + _resultType = resultType; + } + + public void setSelectClauseType(SqlClause.SelectClauseType selectClauseType) { + _selectClauseType = selectClauseType; + } +} Property changes on: addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/bhv/core/command/SelectScalarCBCommand.java ___________________________________________________________________ Name: svn:eol-style + native Added: addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/bhv/core/command/UpdateEntityCommand.java =================================================================== --- addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/bhv/core/command/UpdateEntityCommand.java (rev 0) +++ addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/bhv/core/command/UpdateEntityCommand.java 2008-12-27 22:06:42 UTC (rev 1624) @@ -0,0 +1,55 @@ +package jp.sf.pal.addresslist.db.allcommon.bhv.core.command; + +import jp.sf.pal.addresslist.db.allcommon.bhv.core.SqlExecution; +import jp.sf.pal.addresslist.db.allcommon.bhv.core.SqlExecutionCreator; +import jp.sf.pal.addresslist.db.allcommon.s2dao.internal.sqlcommand.InternalUpdateModifiedOnlyCommand; + +import org.seasar.dao.BeanMetaData; + +/** + * @author DBFlute(AutoGenerator) + */ +public class UpdateEntityCommand extends AbstractEntityCommand { + + //========================================================================== + // ========= + // Basic Information + // ================= + public String getCommandName() { + return "update"; + } + + //========================================================================== + // ========= + // SqlExecution Handling + // ===================== + public SqlExecutionCreator createSqlExecutionCreator() { + assertStatus("createSqlExecutionCreator"); + return new SqlExecutionCreator() { + public SqlExecution createSqlExecution() { + final BeanMetaData bmd = createBeanMetaData(); + return createUpdateEntitySqlExecution(bmd); + } + }; + } + + protected SqlExecution createUpdateEntitySqlExecution(BeanMetaData bmd) { + final String[] propertyNames = getPersistentPropertyNames(bmd); + return createUpdateModifiedOnlyCommand(bmd, propertyNames); + } + + protected InternalUpdateModifiedOnlyCommand createUpdateModifiedOnlyCommand( + BeanMetaData bmd, String[] propertyNames) { + final InternalUpdateModifiedOnlyCommand cmd = new InternalUpdateModifiedOnlyCommand( + _dataSource, _statementFactory); + cmd.setBeanMetaData(bmd);// Extension Point! + cmd.setPropertyNames(propertyNames); + cmd.setOptimisticLockHandling(isOptimisticLockHandling()); + cmd.setVersionNoAutoIncrementOnMemory(isOptimisticLockHandling()); + return cmd; + } + + protected boolean isOptimisticLockHandling() { + return true; + } +} Property changes on: addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/bhv/core/command/UpdateEntityCommand.java ___________________________________________________________________ Name: svn:eol-style + native Added: addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/bhv/core/command/UpdateNonstrictEntityCommand.java =================================================================== --- addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/bhv/core/command/UpdateNonstrictEntityCommand.java (rev 0) +++ addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/bhv/core/command/UpdateNonstrictEntityCommand.java 2008-12-27 22:06:42 UTC (rev 1624) @@ -0,0 +1,25 @@ +package jp.sf.pal.addresslist.db.allcommon.bhv.core.command; + +/** + * @author DBFlute(AutoGenerator) + */ +public class UpdateNonstrictEntityCommand extends UpdateEntityCommand { + + //========================================================================== + // ========= + // Basic Information + // ================= + @Override + public String getCommandName() { + return "updateNonstrict"; + } + + //========================================================================== + // ========= + // SqlExecution Handling + // ===================== + @Override + protected boolean isOptimisticLockHandling() { + return false; + } +} Property changes on: addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/bhv/core/command/UpdateNonstrictEntityCommand.java ___________________________________________________________________ Name: svn:eol-style + native Added: addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/bhv/core/execution/BasicSelectExecution.java =================================================================== --- addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/bhv/core/execution/BasicSelectExecution.java (rev 0) +++ addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/bhv/core/execution/BasicSelectExecution.java 2008-12-27 22:06:42 UTC (rev 1624) @@ -0,0 +1,77 @@ +package jp.sf.pal.addresslist.db.allcommon.bhv.core.execution; + +import javax.sql.DataSource; + +import jp.sf.pal.addresslist.db.allcommon.s2dao.internal.sqlcommand.InternalAbstractDynamicCommand; +import jp.sf.pal.addresslist.db.allcommon.s2dao.internal.sqlhandler.InternalBasicSelectHandler; + +import org.seasar.dao.CommandContext; +import org.seasar.extension.jdbc.ResultSetHandler; +import org.seasar.extension.jdbc.StatementFactory; + +/** + * @author DBFlute(AutoGenerator) + */ +public class BasicSelectExecution extends InternalAbstractDynamicCommand { + + //========================================================================== + // ========= + // Attribute + // ========= + /** The handler of resultSet. */ + protected ResultSetHandler resultSetHandler; + + //========================================================================== + // ========= + // Constructor + // =========== + /** + * Constructor. + * + * @param dataSource Data source. + * @param statementFactory The factory of statement. + * @param resultSetHandler The handler of resultSet. + */ + public BasicSelectExecution(DataSource dataSource, + StatementFactory statementFactory, ResultSetHandler resultSetHandler) { + super(dataSource, statementFactory); + this.resultSetHandler = resultSetHandler; + } + + //========================================================================== + // ========= + // Execute + // ======= + /** + * @param args The array of argument. (Nullable) + * @return The object of execution result. (Nullable) + */ + public Object execute(Object[] args) { + final CommandContext ctx = apply(args); + final InternalBasicSelectHandler selectHandler = createBasicSelectHandler( + ctx.getSql(), this.resultSetHandler); + final Object[] bindVariableArray = ctx.getBindVariables(); + selectHandler.setLoggingMessageSqlArgs(bindVariableArray); + return selectHandler.execute(bindVariableArray, ctx + .getBindVariableTypes()); + } + + //========================================================================== + // ========= + // Select Handler + // ============== + protected InternalBasicSelectHandler createBasicSelectHandler( + String realSql, ResultSetHandler rsh) { + return new InternalBasicSelectHandler(getDataSource(), realSql, rsh, + getStatementFactory()); + } + + //========================================================================== + // ========= + // Parser Option + // ============= + @Override + protected boolean isBlockNullParameter() { + return true; // Because the SQL is select. + } +} Property changes on: addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/bhv/core/execution/BasicSelectExecution.java ___________________________________________________________________ Name: svn:eol-style + native Added: addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/bhv/core/execution/OutsideSqlSelectExecution.java =================================================================== --- addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/bhv/core/execution/OutsideSqlSelectExecution.java (rev 0) +++ addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/bhv/core/execution/OutsideSqlSelectExecution.java 2008-12-27 22:06:42 UTC (rev 1624) @@ -0,0 +1,225 @@ +package jp.sf.pal.addresslist.db.allcommon.bhv.core.execution; + +import java.util.ArrayList; +import java.util.List; + +import javax.sql.DataSource; + +import jp.sf.pal.addresslist.db.allcommon.cbean.outsidesql.OutsideSqlContext; +import jp.sf.pal.addresslist.db.allcommon.s2dao.internal.sqlcommand.InternalAbstractDynamicCommand; +import jp.sf.pal.addresslist.db.allcommon.s2dao.internal.sqlhandler.InternalBasicSelectHandler; +import jp.sf.pal.addresslist.db.allcommon.util.SimpleStringUtil; +import jp.sf.pal.addresslist.db.allcommon.util.SimpleSystemUtil; + +import org.seasar.dao.CommandContext; +import org.seasar.extension.jdbc.ResultSetHandler; +import org.seasar.extension.jdbc.StatementFactory; +import org.seasar.framework.beans.BeanDesc; +import org.seasar.framework.beans.PropertyDesc; +import org.seasar.framework.beans.factory.BeanDescFactory; + +/** + * @author DBFlute(AutoGenerator) + */ +public class OutsideSqlSelectExecution extends InternalAbstractDynamicCommand { + + //========================================================================== + // ========= + // Attribute + // ========= + /** The handler of resultSet. */ + protected ResultSetHandler resultSetHandler; + + //========================================================================== + // ========= + // Constructor + // =========== + /** + * Constructor. + * + * @param dataSource Data source. + * @param statementFactory The factory of statement. + * @param resultSetHandler The handler of resultSet. + */ + public OutsideSqlSelectExecution(DataSource dataSource, + StatementFactory statementFactory, ResultSetHandler resultSetHandler) { + super(dataSource, statementFactory); + this.resultSetHandler = resultSetHandler; + } + + //========================================================================== + // ========= + // Execute + // ======= + /** + * @param args The array of argument. (NotNull, The first element should be + * the instance of Pmb) + * @return The object of execution result. (Nullable) + */ + public Object execute(Object[] args) { + final OutsideSqlContext outsideSqlContext = OutsideSqlContext + .getOutsideSqlContextOnThread(); + if (outsideSqlContext.isDynamicBinding()) { + return executeOutsideSqlAsDynamic(args, outsideSqlContext); + } else { + return executeOutsideSqlAsStatic(args, outsideSqlContext); + } + } + + // ----------------------------------------------------- + // OutsideSql Execute + // ------------------ + /** + * Execute outside-SQL as Dynamic. + * + * @param args The array of argument. (NotNull, The first element should be + * the instance of Pmb) + * @param outsideSqlContext The context of outside-SQL. (NotNull) + * @return Result. (Nullable) + */ + protected Object executeOutsideSqlAsDynamic(Object[] args, + OutsideSqlContext outsideSqlContext) { + final Object firstArg = args[0]; + String staticSql = getSql(); + if (firstArg != null) { + final BeanDesc beanDesc = BeanDescFactory.getBeanDesc(firstArg + .getClass()); + + // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + // - - - - - - - + // Resolve embedded comment for parsing bind variable comment in + // embedded comment. + // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + // - - - - - - - + for (int i = 0; i < beanDesc.getPropertyDescSize(); i++) { + final PropertyDesc propertyDesc = beanDesc.getPropertyDesc(i); + final Class propertyType = propertyDesc.getPropertyType(); + if (!propertyType.equals(String.class)) { + continue; + } + final String outsideSqlPiece = (String) propertyDesc + .getValue(firstArg); + if (outsideSqlPiece == null) { + continue; + } + final String embeddedComment = "/*$pmb." + + propertyDesc.getPropertyName() + "*/"; + staticSql = replaceString(staticSql, embeddedComment, + outsideSqlPiece); + } + } + + final OutsideSqlSelectExecution outsideSqlCommand = createDynamicSqlFactory(); + outsideSqlCommand.setArgNames(getArgNames()); + outsideSqlCommand.setArgTypes(getArgTypes()); + outsideSqlCommand.setSql(staticSql); + + final CommandContext ctx = outsideSqlCommand.apply(args); + final List bindVariableList = new ArrayList(); + final List> bindVariableTypeList = new ArrayList>(); + addBindVariableInfo(ctx, bindVariableList, bindVariableTypeList); + final InternalBasicSelectHandler selectHandler = createBasicSelectHandler( + ctx.getSql(), this.resultSetHandler); + final Object[] bindVariableArray = bindVariableList.toArray(); + selectHandler.setLoggingMessageSqlArgs(bindVariableArray); + return selectHandler.execute(bindVariableArray, + toClassArray(bindVariableTypeList)); + } + + /** + * Execute outside-SQL as static. + * + * @param args The array of argument. (NotNull, The first element should be + * the instance of Pmb) + * @param outsideSqlContext The context of outside-SQL. (NotNull) + * @return Result. (Nullable) + */ + protected Object executeOutsideSqlAsStatic(Object[] args, + OutsideSqlContext outsideSqlContext) { + final CommandContext ctx = apply(args); + final InternalBasicSelectHandler selectHandler = createBasicSelectHandler( + ctx.getSql(), this.resultSetHandler); + final Object[] bindVariableArray = ctx.getBindVariables(); + selectHandler.setLoggingMessageSqlArgs(bindVariableArray); + return selectHandler.execute(bindVariableArray, ctx + .getBindVariableTypes()); + } + + //========================================================================== + // ========= + // Dynamic SQL Factory + // =================== + protected OutsideSqlSelectExecution createDynamicSqlFactory() { + return new OutsideSqlSelectExecution(getDataSource(), + getStatementFactory(), resultSetHandler); + } + + //========================================================================== + // ========= + // Select Handler + // ============== + protected InternalBasicSelectHandler createBasicSelectHandler( + String realSql, ResultSetHandler rsh) { + return new InternalBasicSelectHandler(getDataSource(), realSql, rsh, + getStatementFactory()); + } + + //========================================================================== + // ========= + // Parser Option + // ============= + @Override + protected boolean isBlockNullParameter() { + return true; // Because the SQL is select. + } + + //========================================================================== + // ========= + // Setup Helper + // ============ + protected Class[] toClassArray(List> 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 bindVariableList, List> bindVariableTypeList) { + final Object[] bindVariables = ctx.getBindVariables(); + addBindVariableList(bindVariableList, bindVariables); + final Class[] bindVariableTypes = ctx.getBindVariableTypes(); + addBindVariableTypeList(bindVariableTypeList, bindVariableTypes); + } + + protected void addBindVariableList(List bindVariableList, + Object[] bindVariables) { + for (int i = 0; i < bindVariables.length; i++) { + bindVariableList.add(bindVariables[i]); + } + } + + protected void addBindVariableTypeList(List> bindVariableTypeList, + Class[] bindVariableTypes) { + for (int i = 0; i < bindVariableTypes.length; i++) { + bindVariableTypeList.add(bindVariableTypes[i]); + } + } + + //========================================================================== + // ========= + // General Helper + // ============== + protected final String replaceString(String text, String fromText, + String toText) { + return SimpleStringUtil.replace(text, fromText, toText); + } + + protected String getLineSeparator() { + return SimpleSystemUtil.getLineSeparator(); + } +} Property changes on: addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/bhv/core/execution/OutsideSqlSelectExecution.java ___________________________________________________________________ Name: svn:eol-style + native Added: addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/bhv/core/execution/SelectCBExecution.java =================================================================== --- addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/bhv/core/execution/SelectCBExecution.java (rev 0) +++ addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/bhv/core/execution/SelectCBExecution.java 2008-12-27 22:06:42 UTC (rev 1624) @@ -0,0 +1,168 @@ +package jp.sf.pal.addresslist.db.allcommon.bhv.core.execution; + +import java.util.ArrayList; +import java.util.List; + +import javax.sql.DataSource; + +import jp.sf.pal.addresslist.db.allcommon.cbean.ConditionBean; +import jp.sf.pal.addresslist.db.allcommon.cbean.ConditionBeanContext; +import jp.sf.pal.addresslist.db.allcommon.s2dao.internal.sqlcommand.InternalAbstractDynamicCommand; +import jp.sf.pal.addresslist.db.allcommon.s2dao.internal.sqlhandler.InternalBasicSelectHandler; +import jp.sf.pal.addresslist.db.allcommon.util.SimpleStringUtil; +import jp.sf.pal.addresslist.db.allcommon.util.SimpleSystemUtil; + +import org.seasar.dao.CommandContext; +import org.seasar.extension.jdbc.ResultSetHandler; +import org.seasar.extension.jdbc.StatementFactory; + +/** + * @author DBFlute(AutoGenerator) + */ +public class SelectCBExecution extends InternalAbstractDynamicCommand { + + //========================================================================== + // ========= + // Attribute + // ========= + /** The handler of resultSet. */ + protected ResultSetHandler resultSetHandler; + + //========================================================================== + // ========= + // Constructor + // =========== + /** + * Constructor. + * + * @param dataSource Data source. + * @param statementFactory The factory of statement. + * @param resultSetHandler The handler of resultSet. + */ + public SelectCBExecution(DataSource dataSource, + StatementFactory statementFactory, ResultSetHandler resultSetHandler) { + super(dataSource, statementFactory); + this.resultSetHandler = resultSetHandler; + } + + //========================================================================== + // ========= + // Execute + // ======= + /** + * @param args The array of argument. (NotNull, The first element should be + * the instance of CB) + * @return The object of execution result. (Nullable) + */ + public Object execute(Object[] args) { + final List bindVariableList = new ArrayList(); + final List> bindVariableTypeList = new ArrayList>(); + + final String finalClause = setupRealClause(args, bindVariableList, + bindVariableTypeList); + final InternalBasicSelectHandler selectHandler = createBasicSelectHandler( + finalClause, this.resultSetHandler); + final Object[] bindVariableArray = bindVariableList.toArray(); + selectHandler.setLoggingMessageSqlArgs(bindVariableArray); + return selectHandler.execute(bindVariableArray, + toClassArray(bindVariableTypeList)); + } + + // ----------------------------------------------------- + // Setup Clause + // ------------ + protected String setupRealClause(Object[] args, + List bindVariableList, List> bindVariableTypeList) { + final ConditionBean cb = ConditionBeanContext + .getConditionBeanOnThread(); + final String realClause; + { + final SelectCBExecution dynamicSqlFactory = createDynamicSqlFactory(); + dynamicSqlFactory.setArgNames(getArgNames()); + dynamicSqlFactory.setArgTypes(getArgTypes()); + dynamicSqlFactory.setSql(cb.getSqlClause().getClause()); + final CommandContext ctx = dynamicSqlFactory.apply(args); + realClause = ctx.getSql(); + addBindVariableInfo(ctx, bindVariableList, bindVariableTypeList); + } + return realClause; + } + + //========================================================================== + // ========= + // Dynamic SQL Factory + // =================== + protected SelectCBExecution createDynamicSqlFactory() { + return new SelectCBExecution(getDataSource(), getStatementFactory(), + resultSetHandler); + } + + //========================================================================== + // ========= + // Select Handler + // ============== + protected InternalBasicSelectHandler createBasicSelectHandler( + String realSql, ResultSetHandler rsh) { + return new InternalBasicSelectHandler(getDataSource(), realSql, rsh, + getStatementFactory()); + } + + //========================================================================== + // ========= + // Parser Option + // ============= + @Override + protected boolean isBlockNullParameter() { + return true; // Because the SQL is select. + } + + //========================================================================== + // ========= + // Setup Helper + // ============ + protected Class[] toClassArray(List> 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 bindVariableList, List> bindVariableTypeList) { + final Object[] bindVariables = ctx.getBindVariables(); + addBindVariableList(bindVariableList, bindVariables); + final Class[] bindVariableTypes = ctx.getBindVariableTypes(); + addBindVariableTypeList(bindVariableTypeList, bindVariableTypes); + } + + protected void addBindVariableList(List bindVariableList, + Object[] bindVariables) { + for (int i = 0; i < bindVariables.length; i++) { + bindVariableList.add(bindVariables[i]); + } + } + + protected void addBindVariableTypeList(List> bindVariableTypeList, + Class[] bindVariableTypes) { + for (int i = 0; i < bindVariableTypes.length; i++) { + bindVariableTypeList.add(bindVariableTypes[i]); + } + } + + //========================================================================== + // ========= + // General Helper + // ============== + protected final String replaceString(String text, String fromText, + String toText) { + return SimpleStringUtil.replace(text, fromText, toText); + } + + protected String getLineSeparator() { + return SimpleSystemUtil.getLineSeparator(); + } +} Property changes on: addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/bhv/core/execution/SelectCBExecution.java ___________________________________________________________________ Name: svn:eol-style + native Modified: addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/cbean/AbstractConditionBean.java =================================================================== --- addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/cbean/AbstractConditionBean.java 2008-12-27 22:02:56 UTC (rev 1623) +++ addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/cbean/AbstractConditionBean.java 2008-12-27 22:06:42 UTC (rev 1624) @@ -24,6 +24,28 @@ public abstract class AbstractConditionBean implements ConditionBean { //========================================================================== + // =========== + // Definition + // ========== + /** Map-string map-mark. */ + private static final String MAP_STRING_MAP_MARK = "map:"; + + /** Map-string list-mark. */ + private static final String MAP_STRING_LIST_MARK = "list:"; + + /** Map-string start-brace. */ + private static final String MAP_STRING_START_BRACE = "@{"; + + /** Map-string end-brace. */ + private static final String MAP_STRING_END_BRACE = "@}"; + + /** Map-string delimiter. */ + private static final String MAP_STRING_DELIMITER = "@;"; + + /** Map-string equal. */ + private static final String MAP_STRING_EQUAL = "@="; + + //========================================================================== // ========= // Attribute // ========= @@ -41,8 +63,12 @@ // [DBFlute-0.7.4] @jflute -- At the future, I'll implement some check // logics by these purpose types. - protected boolean _forDeriveReferrer; + protected boolean _forDerivedReferrer; + protected boolean _forScalarSelect; + + protected boolean _forScalarSubQuery; + protected boolean _forUnion; protected boolean _forExistsSubQuery; @@ -73,27 +99,6 @@ //========================================================================== // ========= - // ConditionQuery - // ============== - /** - * Get condition query as interface. At the future, change public to - * protected. - * - * @return Instance of query as interface. (NotNull) - */ - abstract public ConditionQuery getConditionQueryAsInterface(); - - /** - * The implementation. - * - * @return The conditionQuery of the local table as interface. (NotNull) - */ - public ConditionQuery localCQ() { - return getConditionQueryAsInterface(); - } - - //========================================================================== - // ========= // Accept PrimaryKey // ================= /** @@ -498,42 +503,6 @@ //========================================================================== // ========= - // Limit Select - // ============ - /** Is limit-select PK only? */ - protected boolean _isLimitSelectPKOnly; - - /** - * Is limit-select PK only? - * - * @return Determination. - */ - public boolean isLimitSelect_PKOnly() { - return _isLimitSelectPKOnly; - } - - /** - * Limit select PK only. - * - * @return this. (NotNull) - */ - public ConditionBean limitSelect_PKOnly() { - _isLimitSelectPKOnly = true; - return this; - } - - /** - * Limit select off. - * - * @return this. (NotNull) - */ - public ConditionBean limitSelect_Off() { - _isLimitSelectPKOnly = false; - return this; - } - - //========================================================================== - // ========= // Lock Setting // ============ /** @@ -559,11 +528,8 @@ public ConditionBean xsetupSelectCountIgnoreFetchScope() { _isSelectCountIgnoreFetchScope = true; - // If the query uses union query, it needs included-select-column. - if (!hasUnionQueryOrUnionAllQuery()) { - getSqlClause().ignoreIncludedSelectColumn(); - } - + getSqlClause().classifySelectClauseType( + SqlClause.SelectClauseType.COUNT); getSqlClause().ignoreOrderBy(); getSqlClause().ignoreFetchScope(); return this; @@ -578,11 +544,7 @@ public ConditionBean xafterCareSelectCountIgnoreFetchScope() { _isSelectCountIgnoreFetchScope = false; - // If the query uses union query, it needs included-select-column. - if (!hasUnionQueryOrUnionAllQuery()) { - getSqlClause().makeIncludedSelectColumnEffective(); - } - + getSqlClause().rollbackSelectClauseType(); getSqlClause().makeOrderByEffective(); getSqlClause().makeFetchScopeEffective(); return this; @@ -613,20 +575,29 @@ protected CQ _query; - protected boolean _forDeriveReferrer; + protected boolean _forDerivedReferrer; - protected boolean alreadySpecifyRequiredColumn; + protected boolean _forScalarSelect; + protected boolean _forScalarSubQuery; + + protected boolean _alreadySpecifyRequiredColumn; + /** * @param baseCB The condition-bean of base level. (NotNull) - * @param qyCall The callback for condition-query. (NotNull) - * @param forDeriveReferrer Is this for derive referrer? + * @param qyCall The call-back for condition-query. (NotNull) + * @param forDerivedReferrer Is this for derive referrer? + * @param forScalarSelect Is this for scalar select? + * @param forScalarSubQuery Is this for scalar sub-query? */ protected AbstractSpecification(ConditionBean baseCB, - SpQyCall qyCall, boolean forDeriveReferrer) { + SpQyCall qyCall, boolean forDerivedReferrer, + boolean forScalarSelect, boolean forScalarSubQuery) { _baseCB = baseCB; _qyCall = qyCall; - _forDeriveReferrer = forDeriveReferrer; + _forDerivedReferrer = forDerivedReferrer; + _forScalarSelect = forScalarSelect; + _forScalarSubQuery = forScalarSubQuery; } protected void doColumn(String columnName) { @@ -634,8 +605,8 @@ if (_query == null) { _query = _qyCall.qy(); } - if (!_forDeriveReferrer && !alreadySpecifyRequiredColumn) { - alreadySpecifyRequiredColumn = true; + if (isRequiredColumnSpecificationEnabled()) { + _alreadySpecifyRequiredColumn = true; doSpecifyRequiredColumn(); } String relationPath = _query.getRelationPath() != null ? _query @@ -652,6 +623,11 @@ columnName); } + protected boolean isRequiredColumnSpecificationEnabled() { + return !_forDerivedReferrer && !_forScalarSelect + && !_forScalarSubQuery && !_alreadySpecifyRequiredColumn; + } + protected void assertColumn(String columnName) { if (_query == null && !_qyCall.has()) { throwSpecifyColumnNotSetupSelectColumnException(columnName); @@ -659,9 +635,15 @@ } protected void assertForeign(String foreignPropertyName) { - if (_forDeriveReferrer) { - throwDeriveReferrerInvalidForeignSpecificationException(foreignPropertyName); + if (_forDerivedReferrer) { + throwDerivedReferrerInvalidForeignSpecificationException(foreignPropertyName); } + if (_forScalarSelect) { + throwScalarSelectInvalidForeignSpecificationException(foreignPropertyName); + } + if (_forScalarSubQuery) { + throwScalarSubQueryInvalidForeignSpecificationException(foreignPropertyName); + } } protected abstract void doSpecifyRequiredColumn(); @@ -714,19 +696,19 @@ throw new SpecifyColumnNotSetupSelectColumnException(msg); } - protected void throwDeriveReferrerInvalidForeignSpecificationException( + protected void throwDerivedReferrerInvalidForeignSpecificationException( String foreignPropertyName) { String msg = "Look! Read the message below." + getLineSeparator(); msg = msg + "/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *" + getLineSeparator(); msg = msg - + "You specified a foreign table column in spite of derive-sub-query!" + + "You specified a foreign table column in spite of derived-referrer!" + getLineSeparator(); msg = msg + getLineSeparator(); msg = msg + "[Advice]" + getLineSeparator(); msg = msg - + "You should specified a local table column at condition-bean for derive-sub-query." + + "You should specified a local table column at condition-bean for derived-referrer." + getLineSeparator(); msg = msg + " For example:" + getLineSeparator(); msg = msg + " " + getLineSeparator(); @@ -736,7 +718,7 @@ msg = msg + " MemberCB cb = new MemberCB();" + getLineSeparator(); msg = msg - + " cb.specify().derivePurchaseList().max(new SubQuery() {" + + " cb.specify().derivedPurchaseList().max(new SubQuery() {" + getLineSeparator(); msg = msg + " public void query(PurchaseCB subCB) {" + getLineSeparator(); @@ -754,7 +736,7 @@ msg = msg + " MemberCB cb = new MemberCB();" + getLineSeparator(); msg = msg - + " cb.specify().derivePurchaseList().max(new SubQuery() {" + + " cb.specify().derivedPurchaseList().max(new SubQuery() {" + getLineSeparator(); msg = msg + " public void query(PurchaseCB subCB) {" + getLineSeparator(); @@ -769,9 +751,117 @@ msg = msg + "[Specified Foreign Property]" + getLineSeparator() + foreignPropertyName + getLineSeparator(); msg = msg + "* * * * * * * * * */"; - throw new DeriveReferrerInvalidForeignSpecificationException(msg); + throw new DerivedReferrerInvalidForeignSpecificationException(msg); } + protected void throwScalarSelectInvalidForeignSpecificationException( + String foreignPropertyName) { + String msg = "Look! Read the message below." + getLineSeparator(); + msg = msg + + "/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *" + + getLineSeparator(); + msg = msg + + "You specified a foreign table column in spite of scalar select!" + + getLineSeparator(); + msg = msg + getLineSeparator(); + msg = msg + "[Advice]" + getLineSeparator(); + msg = msg + + "You should specified a local table column at condition-bean for scalar select." + + getLineSeparator(); + msg = msg + " For example:" + getLineSeparator(); + msg = msg + " " + getLineSeparator(); + msg = msg + " [Wrong]" + getLineSeparator(); + msg = msg + " /- - - - - - - - - - - - - - - - - - - - " + + getLineSeparator(); + msg = msg + + " memberBhv.scalarSelect(Integer.class).max(new ScalarSelect() {" + + getLineSeparator(); + msg = msg + " public void query(MemberCB cb) {" + + getLineSeparator(); + msg = msg + + " cb.specify().specifyMemberStatus().columnDisplayOrder(); // *No!" + + getLineSeparator(); + msg = msg + " }" + getLineSeparator(); + msg = msg + " });" + getLineSeparator(); + msg = msg + " - - - - - - - - - -/" + getLineSeparator(); + msg = msg + " " + getLineSeparator(); + msg = msg + " [Good!]" + getLineSeparator(); + msg = msg + " /- - - - - - - - - - - - - - - - - - - - " + + getLineSeparator(); + msg = msg + + " memberBhv.scalarSelect(Date.class).max(new ScalarSelect() {" + + getLineSeparator(); + msg = msg + " public void query(MemberCB cb) {" + + getLineSeparator(); + msg = msg + + " cb.specify().columnMemberBirthday(); // *Point!" + + getLineSeparator(); + msg = msg + " }" + getLineSeparator(); + msg = msg + " });" + getLineSeparator(); + msg = msg + " - - - - - - - - - -/" + getLineSeparator(); + msg = msg + getLineSeparator(); + msg = msg + "[Specified Foreign Property]" + getLineSeparator() + + foreignPropertyName + getLineSeparator(); + msg = msg + "* * * * * * * * * */"; + throw new ScalarSelectInvalidForeignSpecificationException(msg); + } + + protected void throwScalarSubQueryInvalidForeignSpecificationException( + String foreignPropertyName) { + String msg = "Look! Read the message below." + getLineSeparator(); + msg = msg + + "/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *" + + getLineSeparator(); + msg = msg + + "You specified a foreign table column in spite of derived-query!" + + getLineSeparator(); + msg = msg + getLineSeparator(); + msg = msg + "[Advice]" + getLineSeparator(); + msg = msg + + "You should specified a local table column at condition-bean for derived-query." + + getLineSeparator(); + msg = msg + " For example:" + getLineSeparator(); + msg = msg + " " + getLineSeparator(); + msg = msg + " [Wrong]" + getLineSeparator(); + msg = msg + " /- - - - - - - - - - - - - - - - - - - - " + + getLineSeparator(); + msg = msg + " MemberCB cb = new MemberCB();" + + getLineSeparator(); + msg = msg + + " cb.query().scalar_Equal().max(new SubQuery() {" + + getLineSeparator(); + msg = msg + " public void query(MemberCB subCB) {" + + getLineSeparator(); + msg = msg + + " subCB.specify().specifyMemberStatusName().columnDisplayOrder(); // *No!" + + getLineSeparator(); + msg = msg + " }" + getLineSeparator(); + msg = msg + " });" + getLineSeparator(); + msg = msg + " - - - - - - - - - -/" + getLineSeparator(); + msg = msg + " " + getLineSeparator(); + msg = msg + " [Good!]" + getLineSeparator(); + msg = msg + " /- - - - - - - - - - - - - - - - - - - - " + + getLineSeparator(); + msg = msg + " MemberCB cb = new MemberCB();" + + getLineSeparator(); + msg = msg + + " cb.query().scalar_Equal().max(new SubQuery() {" + + getLineSeparator(); + msg = msg + " public void query(MemberCB subCB) {" + + getLineSeparator(); + msg = msg + + " subCB.specify().columnMemberBirthday();// *Point!" + + getLineSeparator(); + msg = msg + " }" + getLineSeparator(); + msg = msg + " });" + getLineSeparator(); + msg = msg + " - - - - - - - - - -/" + getLineSeparator(); + msg = msg + getLineSeparator(); + msg = msg + "[Specified Foreign Property]" + getLineSeparator() + + foreignPropertyName + getLineSeparator(); + msg = msg + "* * * * * * * * * */"; + throw new ScalarSubQueryInvalidForeignSpecificationException(msg); + } + protected String getLineSeparator() { return SimpleSystemUtil.getLineSeparator(); } @@ -792,15 +882,33 @@ } } - public static class DeriveReferrerInvalidForeignSpecificationException + public static class DerivedReferrerInvalidForeignSpecificationException extends RuntimeException { private static final long serialVersionUID = 1L; - public DeriveReferrerInvalidForeignSpecificationException(String msg) { + public DerivedReferrerInvalidForeignSpecificationException(String msg) { super(msg); } } + public static class ScalarSubQueryInvalidForeignSpecificationException + extends RuntimeException { + private static final long serialVersionUID = 1L; + + public ScalarSubQueryInvalidForeignSpecificationException(String msg) { + super(msg); + } + } + + public static class ScalarSelectInvalidForeignSpecificationException extends + RuntimeException { + private static final long serialVersionUID = 1L; + + public ScalarSelectInvalidForeignSpecificationException(String msg) { + super(msg); + } + } + public static class RAFunction { protected ConditionBean _baseCB; @@ -815,6 +923,18 @@ _querySetupper = querySetupper; } + public void count(SubQuery subQuery, String aliasName) { + assertAliasName(aliasName); + _querySetupper.setup("count", subQuery, _localCQ, aliasName.trim()); + } + + public void countDistinct(SubQuery subQuery, + String aliasName) { + assertAliasName(aliasName); + _querySetupper.setup("count(distinct", subQuery, _localCQ, + aliasName.trim()); + } + public void max(SubQuery subQuery, String aliasName) { assertAliasName(aliasName); _querySetupper.setup("max", subQuery, _localCQ, aliasName.trim()); @@ -835,14 +955,9 @@ _querySetupper.setup("avg", subQuery, _localCQ, aliasName.trim()); } - public void count(SubQuery subQuery, String aliasName) { - assertAliasName(aliasName); - _querySetupper.setup("count", subQuery, _localCQ, aliasName.trim()); - } - protected void assertAliasName(String aliasName) { if (aliasName == null || aliasName.trim().length() == 0) { - throwDeriveReferrerInvalidAliasNameException(); + throwDerivedReferrerInvalidAliasNameException(); } DBMeta dbmeta = DBMetaInstanceHandler.findDBMeta(_baseCB .getTableDbName()); @@ -860,17 +975,17 @@ } } if (!existsSetterMethod) { - throwDeriveReferrerEntityPropertyNotFoundException(aliasName, + throwDerivedReferrerEntityPropertyNotFoundException(aliasName, dbmeta.getEntityType()); } } - protected void throwDeriveReferrerInvalidAliasNameException() { + protected void throwDerivedReferrerInvalidAliasNameException() { String msg = "Look! Read the message below." + getLineSeparator(); msg = msg + "/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *" + getLineSeparator(); - msg = msg + "The alias name for derive-referrer was Invalid!" + msg = msg + "The alias name for derived-referrer was Invalid!" + getLineSeparator(); msg = msg + getLineSeparator(); msg = msg + "[Advice]" + getLineSeparator(); @@ -915,17 +1030,17 @@ msg = msg + "[Local Table]" + getLineSeparator() + _localCQ.getTableDbName() + getLineSeparator(); msg = msg + "* * * * * * * * * */"; - throw new DeriveReferrerInvalidAliasNameException(msg); + throw new DerivedReferrerInvalidAliasNameException(msg); } - protected void throwDeriveReferrerEntityPropertyNotFoundException( + protected void throwDerivedReferrerEntityPropertyNotFoundException( String aliasName, Class entityType) { String msg = "Look! Read the message below." + getLineSeparator(); msg = msg + "/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *" + getLineSeparator(); msg = msg - + "A property for derive-referrer was Not Found in the entity!" + + "A property for derived-referrer was Not Found in the entity!" + getLineSeparator(); msg = msg + getLineSeparator(); msg = msg + "[Advice]" + getLineSeparator(); @@ -981,7 +1096,7 @@ msg = msg + "[Target Entity]" + getLineSeparator() + entityType + getLineSeparator(); msg = msg + "* * * * * * * * * */"; - throw new DeriveReferrerEntityPropertyNotFoundException(msg); + throw new DerivedReferrerEntityPropertyNotFoundException(msg); } protected String replaceString(String text, String fromText, @@ -999,20 +1114,20 @@ LOCAL_CQ cq, String aliasName); } - public static class DeriveReferrerInvalidAliasNameException extends + public static class DerivedReferrerInvalidAliasNameException extends RuntimeException { private static final long serialVersionUID = 1L; - public DeriveReferrerInvalidAliasNameException(String msg) { + public DerivedReferrerInvalidAliasNameException(String msg) { super(msg); } } - public static class DeriveReferrerEntityPropertyNotFoundException extends + public static class DerivedReferrerEntityPropertyNotFoundException extends RuntimeException { private static final long serialVersionUID = 1L; - public DeriveReferrerEntityPropertyNotFoundException(String msg) { + public DerivedReferrerEntityPropertyNotFoundException(String msg) { super(msg); } } @@ -1042,7 +1157,6 @@ protected void doSetupSelect(SsCall callback) { String foreignPropertyName = callback.qf().getForeignPropertyName(); assertSetupSelectBeforeUnion(foreignPropertyName); - limitSelect_Off(); String foreignTableAliasName = callback.qf().getRealAliasName(); String localRelationPath = localCQ().getRelationPath(); getSqlClause().registerSelectedSelectColumn(foreignTableAliasName, @@ -1164,19 +1278,27 @@ // ========= // Purpose Type // ============ - public void xsetupForDeriveReferrer() { - _forDeriveReferrer = true; + public void xsetupForDerivedReferrer() { // Very Internal + _forDerivedReferrer = true; } - public void xsetupForUnion() { + public void xsetupForScalarSelect() { // Very Internal + _forScalarSelect = true; + } + + public void xsetupForScalarSubQuery() { // Very Internal + _forScalarSubQuery = true; + } + + public void xsetupForUnion() { // Very Internal _forUnion = true; } - public void xsetupForExistsSubQuery() { + public void xsetupForExistsSubQuery() { // Very Internal _forExistsSubQuery = true; } - public void xsetupForInScopeSubQuery() { + public void xsetupForInScopeSubQuery() { // Very Internal _forInScopeSubQuery = true; } Modified: addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/cbean/AbstractConditionQuery.java =================================================================== --- addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/cbean/AbstractConditionQuery.java 2008-12-27 22:02:56 UTC (rev 1623) +++ addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/cbean/AbstractConditionQuery.java 2008-12-27 22:06:42 UTC (rev 1624) @@ -48,12 +48,14 @@ protected static final ConditionKey CK_PS = ConditionKey.CK_PREFIX_SEARCH; - protected static final ConditionKey CK_LS = ConditionKey.CK_LIKE_SEARCH; - protected static final ConditionKey CK_INS = ConditionKey.CK_IN_SCOPE; protected static final ConditionKey CK_NINS = ConditionKey.CK_NOT_IN_SCOPE; + protected static final ConditionKey CK_LS = ConditionKey.CK_LIKE_SEARCH; + + protected static final ConditionKey CK_NLS = ConditionKey.CK_NOT_LIKE_SEARCH; + protected static final ConditionKey CK_ISN = ConditionKey.CK_IS_NULL; protected static final ConditionKey CK_ISNN = ConditionKey.CK_IS_NOT_NULL; @@ -351,15 +353,7 @@ String msg = "The argument[unionQuery] should not be null."; throw new IllegalArgumentException(msg); } - reflectRelationOnUnionQuery(this, unionQuery);// Reflect Relation! - getSqlClause().copyIncludedSelectColumn(unionQuery.getSqlClause());// Reflect - // IncludedSelectColumn - // ! - if (getSqlClause().isFormatClauseEffective()) { - unionQuery.getSqlClause().makeFormatClauseEffective();// Reflect - // FormatClause - // ! - } + reflectRelationOnUnionQuery(this, unionQuery); // Reflect Relation! String key = (unionAll ? "unionAllQuery" : "unionQuery") + unionQueryMap.size(); unionQueryMap.put(key, unionQuery); @@ -416,22 +410,6 @@ // Register // ======== // ----------------------------------------------------- - // Include-As-Mine - // --------------- - /** - * Register included-select-column. - * - * @param aliasName Alias name. This should not contain comma. (NotNull) - * @param realColumnName Real column name. This should not contain comma. - * (NotNull) - * @deprecated Unsupported! - */ - protected void registerIncludedSelectColumn(String aliasName, - String realColumnName) { - throw new UnsupportedOperationException(); - } - - // ----------------------------------------------------- // Query // ----- protected void registerQuery(ConditionKey key, Object value, @@ -488,6 +466,13 @@ // ----------------------------------------------------- // LikeSearch Query // ---------------- + protected void regLSQ(ConditionKey key, String value, + ConditionValue cvalue, String colName, String capPropName, + String uncapPropName, LikeSearchOption option) { + registerLikeSearchQuery(key, value, cvalue, colName, capPropName, + uncapPropName, option); + } + @SuppressWarnings("deprecation") protected void registerLikeSearchQuery(ConditionKey key, String value, ConditionValue cvalue, String colName, String capPropName, @@ -700,25 +685,20 @@ assertObjectNotNull("InScopeSubQyery(" + columnName + ")", subQuery); inScopeOption = inScopeOption != null ? inScopeOption + " " : ""; String realColumnName = getInScopeSubQueryRealColumnName(columnName); + xincrementLocalSubQueryLevelIfNeeds(subQuery); String subQueryClause = getInScopeSubQuerySql(subQuery, relatedColumnName, propertyName); - String clause = null; - if (getSqlClause().isFormatClauseEffective()) { - String ln = getLineSeparator(); - int subQueryLevel = subQuery.getSubQueryLevel(); - String subQueryIdentity = propertyName + "[" + subQueryLevel + "]"; - String beginMark = getSqlClause().resolveSubQueryBeginMark( - subQueryIdentity) - + ln; - String endMark = getSqlClause().resolveSubQueryEndMark( - subQueryIdentity); - String endIndent = " "; - clause = realColumnName + " " + inScopeOption + "in (" + beginMark - + subQueryClause + ln + endIndent + ")" + endMark; - } else { - clause = realColumnName + " " + inScopeOption + "in (" - + subQueryClause + ")"; - } + String ln = getLineSeparator(); + int subQueryLevel = subQuery.getSubQueryLevel(); + String subQueryIdentity = propertyName + "[" + subQueryLevel + "]"; + String beginMark = getSqlClause().resolveSubQueryBeginMark( + subQueryIdentity) + + ln; + String endMark = getSqlClause() + .resolveSubQueryEndMark(subQueryIdentity); + String endIndent = " "; + String clause = realColumnName + " " + inScopeOption + "in (" + + beginMark + subQueryClause + ln + endIndent + ")" + endMark; registerWhereClause(clause); } @@ -728,22 +708,11 @@ protected String getInScopeSubQuerySql(ConditionQuery subQuery, String relatedColumnName, String propertyName) { - String selectClause = "select " - + getSqlClause().getLocalTableAliasName() + "." + String tableAliasName = getSqlClause().getLocalTableAliasName(); + String selectClause = "select " + tableAliasName + "." + relatedColumnName; - String fromWhereClause = subQuery.getSqlClause() - .getClauseFromWhereWithUnionTemplate(); - fromWhereClause = replaceString(fromWhereClause, ".conditionQuery.", - "." + getLocationBase(propertyName) + ".");// Very Important! - - // Replace template marks. These are very important! - fromWhereClause = replaceString(fromWhereClause, getSqlClause() - .getUnionSelectClauseMark(), selectClause); - fromWhereClause = replaceString(fromWhereClause, getSqlClause() - .getUnionWhereClauseMark(), ""); - fromWhereClause = replaceString(fromWhereClause, getSqlClause() - .getUnionWhereFirstConditionMark(), ""); - + String fromWhereClause = buildPlainSubQueryFromWhereClause(subQuery, + relatedColumnName, propertyName, selectClause, tableAliasName); return selectClause + " " + fromWhereClause; } @@ -769,24 +738,20 @@ assertObjectNotNull("ExistsSubQyery(" + columnName + ")", subQuery); existsOption = existsOption != null ? existsOption + " " : ""; String realColumnName = getExistsSubQueryRealColumnName(columnName); + xincrementLocalSubQueryLevelIfNeeds(subQuery); String subQueryClause = getExistsSubQuerySql(subQuery, realColumnName, relatedColumnName, propertyName); - String clause = null; - if (getSqlClause().isFormatClauseEffective()) { - String ln = getLineSeparator(); - int subQueryLevel = subQuery.getSubQueryLevel(); - String subQueryIdentity = propertyName + "[" + subQueryLevel + "]"; - String beginMark = getSqlClause().resolveSubQueryBeginMark( - subQueryIdentity) - + ln; - String endMark = getSqlClause().resolveSubQueryEndMark( - subQueryIdentity); - String endIndent = " "; - clause = existsOption + "exists (" + beginMark + subQueryClause - + ln + endIndent + ")" + endMark; - } else { - clause = existsOption + "exists (" + subQueryClause + ")"; - } + String ln = getLineSeparator(); + int subQueryLevel = subQuery.getSubQueryLevel(); + String subQueryIdentity = propertyName + "[" + subQueryLevel + "]"; + String beginMark = getSqlClause().resolveSubQueryBeginMark( + subQueryIdentity) + + ln; + String endMark = getSqlClause() + .resolveSubQueryEndMark(subQueryIdentity); + String endIndent = " "; + String clause = existsOption + "exists (" + beginMark + subQueryClause + + ln + endIndent + ")" + endMark; registerWhereClause(clause); } @@ -801,134 +766,116 @@ protected String getExistsSubQuerySql(ConditionQuery subQuery, String realColumnName, String relatedColumnName, String propertyName) { int subQueryLevel = subQuery.getSubQueryLevel(); - if (_subQueryLevel <= subQueryLevel) { - _subQueryLevel = subQueryLevel + 1; - } String tableAliasName = "dfsublocal_" + subQueryLevel; String selectClause = "select " + tableAliasName + "." + relatedColumnName; - String fromWhereClause = subQuery.getSqlClause() - .getClauseFromWhereWithWhereUnionTemplate(); - fromWhereClause = replaceString(fromWhereClause, "dflocal", - tableAliasName);// Very Important! - fromWhereClause = replaceString(fromWhereClause, ".conditionQuery.", - "." + getLocationBase(propertyName) + ".");// Very Important! - - String joinCondition = tableAliasName + "." + relatedColumnName + " = " - + realColumnName; - String firstConditionAfter = " and "; - if (getSqlClause().isFormatClauseEffective()) { - firstConditionAfter = getLineSeparator() + " and "; - } - - // Replace template marks. These are very important! - fromWhereClause = replaceString(fromWhereClause, getSqlClause() - .getWhereClauseMark(), "where " + joinCondition); - fromWhereClause = replaceString(fromWhereClause, getSqlClause() - .getWhereFirstConditionMark(), joinCondition - + firstConditionAfter); - fromWhereClause = replaceString(fromWhereClause, getSqlClause() - .getUnionSelectClauseMark(), selectClause); - fromWhereClause = replaceString(fromWhereClause, getSqlClause() - .getUnionWhereClauseMark(), "where " + joinCondition); - fromWhereClause = replaceString(fromWhereClause, getSqlClause() - .getUnionWhereFirstConditionMark(), joinCondition - + firstConditionAfter); - + String fromWhereClause = buildCorrelationSubQueryFromWhereClause( + subQuery, relatedColumnName, propertyName, selectClause, + tableAliasName, realColumnName); return selectClause + " " + fromWhereClause; } // [DBFlute-0.7.4] // ----------------------------------------------------- - // DeriveSubQuery - // -------------- - protected void registerDeriveSubQuery(String function, + // DerivedReferrerSubQuery + // ----------------------- + protected void registerDerivedReferrerSubQuery(String function, ConditionQuery subQuery, String columnName, String relatedColumnName, String propertyName, String aliasName) { - assertObjectNotNull("DeriveSubQuery(" + columnName + ")", subQuery); - final String realColumnName = getDeriveSubQueryRealColumnName(columnName); - final String subQueryClause = getDeriveSubQuerySql(function, subQuery, - realColumnName, relatedColumnName, propertyName, aliasName); - final String clause; - if (getSqlClause().isFormatClauseEffective()) { - final String ln = getLineSeparator(); - final int subQueryLevel = subQuery.getSubQueryLevel(); - final String subQueryIdentity = propertyName + "[" + subQueryLevel - + "]"; - final String beginMark = getSqlClause().resolveSubQueryBeginMark( - subQueryIdentity) - + ln; - final String endMark = getSqlClause().resolveSubQueryEndMark( - subQueryIdentity); - final String endIndent = " "; - clause = "(" + beginMark + subQueryClause + ln + endIndent - + ") as " + aliasName + endMark; - } else { - clause = "(" + subQueryClause + ") as " + aliasName; - } + assertObjectNotNull("DerivedReferrerSubQuery(function)", function); + assertObjectNotNull("DerivedReferrerSubQuery(" + columnName + ")", + subQuery); + String realColumnName = getDerivedReferrerSubQueryRealColumnName(columnName); + xincrementLocalSubQueryLevelIfNeeds(subQuery); + String subQueryClause = getDerivedReferrerSubQuerySql(function, + subQuery, realColumnName, relatedColumnName, propertyName, + aliasName); + String ln = getLineSeparator(); + int subQueryLevel = subQuery.getSubQueryLevel(); + String subQueryIdentity = propertyName + "[" + subQueryLevel + "]"; + String beginMark = getSqlClause().resolveSubQueryBeginMark( + subQueryIdentity) + + ln; + String endMark = getSqlClause() + .resolveSubQueryEndMark(subQueryIdentity); + String endIndent = " "; + String clause = "(" + beginMark + subQueryClause + ln + endIndent + + ") " + aliasName + endMark; getSqlClause().specifyDeriveSubQuery(aliasName, clause); } - protected String getDeriveSubQueryRealColumnName(String columnName) { + protected String getDerivedReferrerSubQueryRealColumnName(String columnName) { return getRealColumnName(columnName); } - protected String getDeriveSubQuerySql(String function, + protected String getDerivedReferrerSubQuerySql(String function, ConditionQuery subQuery, String realColumnName, String relatedColumnName, String propertyName, String aliasName) { - final int subQueryLevel = subQuery.getSubQueryLevel(); - if (_subQueryLevel <= subQueryLevel) { - _subQueryLevel = subQueryLevel + 1; - } - final String tableAliasName = "dfsublocal_" + subQueryLevel; - final String deriveColumnName = subQuery.getSqlClause() + int subQueryLevel = subQuery.getSubQueryLevel(); + String tableAliasName = "dfsublocal_" + subQueryLevel; + String deriveColumnName = subQuery.getSqlClause() .getSpecifiedColumnNameAsOne(); if (deriveColumnName == null || deriveColumnName.trim().length() == 0) { - throwDeriveReferrerInvalidColumnSpecificationException(function, + throwDerivedReferrerInvalidColumnSpecificationException(function, aliasName); } - assertDeriveReferrerColumnType(function, subQuery, deriveColumnName); - subQuery.getSqlClause().clearSpecifiedSelectColumn(); - final String selectClause = "select " + function + "(" + tableAliasName - + "." + deriveColumnName + ")"; - String fromWhereClause = subQuery.getSqlClause() - .getClauseFromWhereWithWhereUnionTemplate(); - fromWhereClause = replaceString(fromWhereClause, "dflocal", - tableAliasName);// Very Important! - fromWhereClause = replaceString(fromWhereClause, ".conditionQuery.", - "." + getLocationBase(propertyName) + ".");// Very Important! - - final String joinCondition = tableAliasName + "." + relatedColumnName - + " = " + realColumnName; - String firstConditionAfter = " and "; - if (getSqlClause().isFormatClauseEffective()) { - firstConditionAfter = getLineSeparator() + " and "; + assertDerivedReferrerColumnType(function, subQuery, deriveColumnName); + subQuery.getSqlClause().clearSpecifiedSelectColumn(); // specified + // columns + // disappear at + // this timing + String connect = xbuildFunctionConnector(function); + if (subQuery.getSqlClause().hasUnionQuery()) { + String ln = getLineSeparator(); + String subQueryIdentity = propertyName + "[" + subQueryLevel + + ":subquerymain]"; + String beginMark = getSqlClause().resolveSubQueryBeginMark( + subQueryIdentity) + + ln; + String endMark = getSqlClause().resolveSubQueryEndMark( + subQueryIdentity); + DBMeta dbmeta = DBMetaInstanceHandler.findDBMeta(subQuery + .getTableDbName()); + if (!dbmeta.hasPrimaryKey() || dbmeta.hasTwoOrMorePrimaryKeys()) { + String msg = "The derived-referrer is unsupported when no primary key or two-or-more primary keys:"; + msg = msg + " table=" + subQuery.getTableDbName(); + throw new UnsupportedOperationException(msg); + } + String primaryKeyName = dbmeta.getPrimaryUniqueInfo() + .getFirstColumn().getColumnDbName(); + String selectClause = "select " + tableAliasName + "." + + primaryKeyName + ", " + tableAliasName + "." + + relatedColumnName + ", " + tableAliasName + "." + + deriveColumnName; + String fromWhereClause = buildPlainSubQueryFromWhereClause( + subQuery, relatedColumnName, propertyName, selectClause, + tableAliasName); + String mainSql = selectClause + " " + fromWhereClause; + String joinCondition = "dfsubquerymain." + relatedColumnName + + " = " + realColumnName; + return "select " + function + connect + "dfsubquerymain." + + deriveColumnName + ")" + ln + " from (" + beginMark + + mainSql + ln + " ) dfsubquerymain" + endMark + ln + + " where " + joinCondition; + } else { + String selectClause = "select " + function + connect + + tableAliasName + "." + deriveColumnName + ")"; + String fromWhereClause = buildCorrelationSubQueryFromWhereClause( + subQuery, relatedColumnName, propertyName, selectClause, + tableAliasName, realColumnName); + return selectClause + " " + fromWhereClause; } - - // Replace template marks. These are very important! - fromWhereClause = replaceString(fromWhereClause, getSqlClause() - .getWhereClauseMark(), "where " + joinCondition); - fromWhereClause = replaceString(fromWhereClause, getSqlClause() - .getWhereFirstConditionMark(), joinCondition - + firstConditionAfter); - fromWhereClause = replaceString(fromWhereClause, getSqlClause() - .getUnionSelectClauseMark(), selectClause); - fromWhereClause = replaceString(fromWhereClause, getSqlClause() - .getUnionWhereClauseMark(), "where " + joinCondition); - fromWhereClause = replaceString(fromWhereClause, getSqlClause() - .getUnionWhereFirstConditionMark(), joinCondition - + firstConditionAfter); - - return selectClause + " " + fromWhereClause; } - protected void throwDeriveReferrerInvalidColumnSpecificationException( + protected void throwDerivedReferrerInvalidColumnSpecificationException( String function, String aliasName) { + String method = xconvertFunctionToMethod(function); String msg = "Look! Read the message below." + getLineSeparator(); msg = msg + "/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *" + getLineSeparator(); - msg = msg + "The specified the column for derive-referrer was Invalid!" + msg = msg + + "The specified the column for derived-referrer was Invalid!" + getLineSeparator(); msg = msg + getLineSeparator(); msg = msg + "[Advice]" + getLineSeparator(); @@ -941,7 +888,7 @@ msg = msg + " /- - - - - - - - - - - - - - - - - - - - " + getLineSeparator(); msg = msg + " MemberCB cb = new MemberCB();" + getLineSeparator(); - msg = msg + " cb.specify().derivePurchaseList()." + function + msg = msg + " cb.specify().derivePurchaseList()." + method + "(new SubQuery() {" + getLineSeparator(); msg = msg + " public void query(PurchaseCB subCB) {" + getLineSeparator(); @@ -955,7 +902,7 @@ msg = msg + " /- - - - - - - - - - - - - - - - - - - - " + getLineSeparator(); msg = msg + " MemberCB cb = new MemberCB();" + getLineSeparator(); - msg = msg + " cb.specify().derivePurchaseList()." + function + msg = msg + " cb.specify().derivePurchaseList()." + method + "(new SubQuery() {" + getLineSeparator(); msg = msg + " public void query(PurchaseCB subCB) {" + getLineSeparator(); @@ -973,7 +920,7 @@ msg = msg + " /- - - - - - - - - - - - - - - - - - - - " + getLineSeparator(); msg = msg + " MemberCB cb = new MemberCB();" + getLineSeparator(); - msg = msg + " cb.specify().derivePurchaseList()." + function + msg = msg + " cb.specify().derivePurchaseList()." + method + "(new SubQuery() {" + getLineSeparator(); msg = msg + " public void query(PurchaseCB subCB) {" + getLineSeparator(); @@ -988,19 +935,19 @@ msg = msg + "[Alias Name]" + getLineSeparator() + aliasName + getLineSeparator(); msg = msg + "* * * * * * * * * */"; - throw new DeriveReferrerInvalidColumnSpecificationException(msg); + throw new DerivedReferrerInvalidColumnSpecificationException(msg); } - public static class DeriveReferrerInvalidColumnSpecificationException + public static class DerivedReferrerInvalidColumnSpecificationException extends RuntimeException { private static final long serialVersionUID = 1L; - public DeriveReferrerInvalidColumnSpecificationException(String msg) { + public DerivedReferrerInvalidColumnSpecificationException(String msg) { super(msg); } } - protected void assertDeriveReferrerColumnType(String function, + protected void assertDerivedReferrerColumnType(String function, ConditionQuery subQuery, String deriveColumnName) { final DBMeta dbmeta = DBMetaInstanceHandler.findDBMeta(subQuery .getTableDbName()); @@ -1009,13 +956,13 @@ if ("sum".equalsIgnoreCase(function) || "avg".equalsIgnoreCase(function)) { if (!Number.class.isAssignableFrom(deriveColumnType)) { - throwDeriveReferrerUnmatchedColumnTypeException(function, + throwDerivedReferrerUnmatchedColumnTypeException(function, deriveColumnName, deriveColumnType); } } } - protected void throwDeriveReferrerUnmatchedColumnTypeException( + protected void throwDerivedReferrerUnmatchedColumnTypeException( String function, String deriveColumnName, Class deriveColumnType) { String msg = "Look! Read the message below." + getLineSeparator(); msg = msg @@ -1040,19 +987,366 @@ msg = msg + "[Derive Column]" + getLineSeparator() + deriveColumnName + "(" + deriveColumnType.getName() + ")" + getLineSeparator(); msg = msg + "* * * * * * * * * */"; - throw new DeriveReferrerUnmatchedColumnTypeException(msg); + throw new DerivedReferrerUnmatchedColumnTypeException(msg); } - public static class DeriveReferrerUnmatchedColumnTypeException extends + public static class DerivedReferrerUnmatchedColumnTypeException extends RuntimeException { private static final long serialVersionUID = 1L; - public DeriveReferrerUnmatchedColumnTypeException(String msg) { + public DerivedReferrerUnmatchedColumnTypeException(String msg) { super(msg); } } + // [DBFlute-0.8.8] // ----------------------------------------------------- + // ScalarSubQuery + // -------------- + protected void registerScalarSubQuery(String function, + ConditionQuery subQuery, String propertyName, String operand) { + assertObjectNotNull("ScalarSubQuery(" + propertyName + ")", subQuery); + + // Get the specified column before it disappears at sub-query making. + String deriveRealColumnName; + { + String deriveColumnName = subQuery.getSqlClause() + .getSpecifiedColumnNameAsOne(); + if (deriveColumnName == null + || deriveColumnName.trim().length() == 0) { + throwScalarSubQueryInvalidColumnSpecificationException(function); + } + deriveRealColumnName = getScalarSubQueryRealColumnName(deriveColumnName); + } + + xincrementLocalSubQueryLevelIfNeeds(subQuery); + String subQueryClause = getScalarSubQuerySql(function, subQuery, + propertyName); + String ln = getLineSeparator(); + int subQueryLevel = subQuery.getSubQueryLevel(); + String subQueryIdentity = propertyName + "[" + subQueryLevel + "]"; + String beginMark = getSqlClause().resolveSubQueryBeginMark( + subQueryIdentity) + + ln; + String endMark = getSqlClause() + .resolveSubQueryEndMark(subQueryIdentity); + String endIndent = " "; + String clause = deriveRealColumnName + " " + operand + " (" + beginMark + + subQueryClause + ln + endIndent + ") " + endMark; + registerWhereClause(clause); + } + + protected String getScalarSubQueryRealColumnName(String columnName) { + return getRealColumnName(columnName); + } + + protected String getScalarSubQuerySql(String function, + ConditionQuery subQuery, String propertyName) { + int subQueryLevel = subQuery.getSubQueryLevel(); + String tableAliasName = "dfsublocal_" + subQueryLevel; + String deriveColumnName = subQuery.getSqlClause() + .getSpecifiedColumnNameAsOne(); + if (deriveColumnName == null || deriveColumnName.trim().length() == 0) { + throwScalarSubQueryInvalidColumnSpecificationException(function); + } + assertScalarSubQueryColumnType(function, subQuery, deriveColumnName); + subQuery.getSqlClause().clearSpecifiedSelectColumn(); // specified + // columns + // disappear at + // this timing + DBMeta dbmeta = DBMetaInstanceHandler.findDBMeta(subQuery + .getTableDbName()); + if (!dbmeta.hasPrimaryKey() || dbmeta.hasTwoOrMorePrimaryKeys()) { + String msg = "The scalar-sub-query is unsupported when no primary key or two-or-more primary keys:"; + msg = msg + " table=" + subQuery.getTableDbName(); + throw new UnsupportedOperationException(msg); + } + String primaryKeyName = dbmeta.getPrimaryUniqueInfo().getFirstColumn() + .getColumnDbName(); + if (subQuery.getSqlClause().hasUnionQuery()) { + String ln = getLineSeparator(); + String subQueryIdentity = propertyName + "[" + subQueryLevel + + ":subquerymain]"; + String beginMark = getSqlClause().resolveSubQueryBeginMark( + subQueryIdentity) + + ln; + String endMark = getSqlClause().resolveSubQueryEndMark( + subQueryIdentity); + String selectClause = "select " + tableAliasName + "." + + primaryKeyName + ", " + tableAliasName + "." + + deriveColumnName; + String fromWhereClause = buildPlainSubQueryFromWhereClause( + subQuery, primaryKeyName, propertyName, selectClause, + tableAliasName); + String mainSql = selectClause + " " + fromWhereClause; + return "select " + function + "(dfsubquerymain." + deriveColumnName + + ")" + ln + " from (" + beginMark + mainSql + ln + + " ) dfsubquerymain" + endMark; + } else { + String selectClause = "select " + function + "(" + tableAliasName + + "." + deriveColumnName + ")"; + String fromWhereClause = buildPlainSubQueryFromWhereClause( + subQuery, primaryKeyName, propertyName, selectClause, + tableAliasName); + return selectClause + " " + fromWhereClause; + } + } + + protected void throwScalarSubQueryInvalidColumnSpecificationException( + String function) { + String msg = "Look! Read the message below." + getLineSeparator(); + msg = msg + + "/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *" + + getLineSeparator(); + msg = msg + + "The specified the column for derived-referrer was Invalid!" + + getLineSeparator(); + msg = msg + getLineSeparator(); + msg = msg + "[Advice]" + getLineSeparator(); + msg = msg + + " You should call specify().column[TargetColumn]() only once." + + getLineSeparator(); + msg = msg + " For example:" + getLineSeparator(); + msg = msg + " " + getLineSeparator(); + msg = msg + " [Wrong]" + getLineSeparator(); + msg = msg + " /- - - - - - - - - - - - - - - - - - - - " + + getLineSeparator(); + msg = msg + " MemberCB cb = new MemberCB();" + getLineSeparator(); + msg = msg + " cb.query().scalar_Equal()." + function + + "(new SubQuery() {" + getLineSeparator(); + msg = msg + " public void query(MemberCB subCB) {" + + getLineSeparator(); + msg = msg + " // *No! It's empty!" + getLineSeparator(); + msg = msg + " }" + getLineSeparator(); + msg = msg + " });" + getLineSeparator(); + msg = msg + " - - - - - - - - - -/" + getLineSeparator(); + msg = msg + " " + getLineSeparator(); + msg = msg + " [Wrong]" + getLineSeparator(); + msg = msg + " /- - - - - - - - - - - - - - - - - - - - " + + getLineSeparator(); + msg = msg + " MemberCB cb = new MemberCB();" + getLineSeparator(); + msg = msg + " cb.query().scalar_Equal()." + function + + "(new SubQuery() {" + getLineSeparator(); + msg = msg + " public void query(MemberCB subCB) {" + + getLineSeparator(); + msg = msg + " subCB.specify().columnMemberBirthday();" + + getLineSeparator(); + msg = msg + + " subCB.specify().columnMemberName(); // *No! It's duplicated!" + + getLineSeparator(); + msg = msg + " }" + getLineSeparator(); + msg = msg + " });" + getLineSeparator(); + msg = msg + " - - - - - - - - - -/" + getLineSeparator(); + msg = msg + " " + getLineSeparator(); + msg = msg + " [Good!]" + getLineSeparator(); + msg = msg + " /- - - - - - - - - - - - - - - - - - - - " + + getLineSeparator(); + msg = msg + " MemberCB cb = new MemberCB();" + getLineSeparator(); + msg = msg + " cb.query().scalar_Equal()." + function + + "(new SubQuery() {" + getLineSeparator(); + msg = msg + " public void query(MemberCB subCB) {" + + getLineSeparator(); + msg = msg + + " subCB.specify().columnPurchaseDatetime(); // *Point!" + + getLineSeparator(); + msg = msg + " }" + getLineSeparator(); + msg = msg + " });" + getLineSeparator(); + msg = msg + " - - - - - - - - - -/" + getLineSeparator(); + msg = msg + "* * * * * * * * * */"; + throw new ScalarSubQueryInvalidColumnSpecificationException(msg); + } + + public static class ScalarSubQueryInvalidColumnSpecificationException + extends RuntimeException { + private static final long serialVersionUID = 1L; + + public ScalarSubQueryInvalidColumnSpecificationException(String msg) { + super(msg); + } + } + + protected void assertScalarSubQueryColumnType(String function, + ConditionQuery subQuery, String deriveColumnName) { + final DBMeta dbmeta = DBMetaInstanceHandler.findDBMeta(subQuery + .getTableDbName()); + final Class deriveColumnType = dbmeta.findColumnInfo( + deriveColumnName).getPropertyType(); + if ("sum".equalsIgnoreCase(function) + || "avg".equalsIgnoreCase(function)) { + if (!Number.class.isAssignableFrom(deriveColumnType)) { + throwScalarSubQueryUnmatchedColumnTypeException(function, + deriveColumnName, deriveColumnType); + } + } + } + + protected void throwScalarSubQueryUnmatchedColumnTypeException( + String function, String deriveColumnName, Class deriveColumnType) { + String msg = "Look! Read the message below." + getLineSeparator(); + msg = msg + + "/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *" + + getLineSeparator(); + msg = msg + + "The type of the specified the column unmatched with the function!" + + getLineSeparator(); + msg = msg + getLineSeparator(); + msg = msg + "[Advice]" + getLineSeparator(); + msg = msg + "You should confirm the list as follow:" + + getLineSeparator(); + msg = msg + " max() : String, Number, Date" + getLineSeparator(); + msg = msg + " min() : String, Number, Date" + getLineSeparator(); + msg = msg + " sum() : Number" + getLineSeparator(); + msg = msg + " avg() : Number" + getLineSeparator(); + msg = msg + getLineSeparator(); + msg = msg + "[Function]" + getLineSeparator() + function + + getLineSeparator(); + msg = msg + getLineSeparator(); + msg = msg + "[Derive Column]" + getLineSeparator() + deriveColumnName + + "(" + deriveColumnType.getName() + ")" + getLineSeparator(); + msg = msg + "* * * * * * * * * */"; + throw new ScalarSubQueryUnmatchedColumnTypeException(msg); + } + + public static class ScalarSubQueryUnmatchedColumnTypeException extends + RuntimeException { + private static final long serialVersionUID = 1L; + + public ScalarSubQueryUnmatchedColumnTypeException(String msg) { + super(msg); + } + } + + public static class SSQFunction { + protected SSQSetupper _setupper; + + public SSQFunction(SSQSetupper setupper) { + _setupper = setupper; + } + + public void max(SubQuery subQuery) { + _setupper.setup("max", subQuery); + } + + public void min(SubQuery subQuery) { + _setupper.setup("min", subQuery); + } + + public void sum(SubQuery subQuery) { + _setupper.setup("sum", subQuery); + } + + public void avg(SubQuery subQuery) { + _setupper.setup("avg", subQuery); + } + } + + protected static interface SSQSetupper { + public void setup(String function, SubQuery subQuery); + } + + // ----------------------------------------------------- + // SubQuery Common + // --------------- + protected String buildPlainSubQueryFromWhereClause(ConditionQuery subQuery, + String relatedColumnName, String propertyName, String selectClause, + String tableAliasName) { + String fromWhereClause = subQuery.getSqlClause() + .getClauseFromWhereWithUnionTemplate(); + + // Replace the alias names for local table with alias name of sub-query + // unique. + // However when it's inScope this replacement is unnecessary so comment + // out here. + // (Override base alias name at sub-query on SQL) + // So if the argument 'tableAliasName' is not null, replace it. + if (tableAliasName != null) { + fromWhereClause = replaceString(fromWhereClause, "dflocal", + tableAliasName); + } + + // Resolve the location path for the condition-query of sub-query. + fromWhereClause = replaceString(fromWhereClause, ".conditionQuery.", + "." + getLocationBase(propertyName) + "."); + + // Replace template marks. These are very important! + fromWhereClause = replaceString(fromWhereClause, getSqlClause() + .getUnionSelectClauseMark(), selectClause); + fromWhereClause = replaceString(fromWhereClause, getSqlClause() + .getUnionWhereClauseMark(), ""); + fromWhereClause = replaceString(fromWhereClause, getSqlClause() + .getUnionWhereFirstConditionMark(), ""); + return fromWhereClause; + } + + protected String buildCorrelationSubQueryFromWhereClause( + ConditionQuery subQuery, String relatedColumnName, + String propertyName, String selectClause, String tableAliasName, + String realColumnName) { + String fromWhereClause = subQuery.getSqlClause() + .getClauseFromWhereWithWhereUnionTemplate(); + + // Replace the alias names for local table with alias name of sub-query + // unique. + fromWhereClause = replaceString(fromWhereClause, "dflocal", + tableAliasName); + + // Resolve the location path for the condition-query of sub-query. + fromWhereClause = replaceString(fromWhereClause, ".conditionQuery.", + "." + getLocationBase(propertyName) + "."); + + String joinCondition = tableAliasName + "." + relatedColumnName + " = " + + realColumnName; + String firstConditionAfter = getLineSeparator() + " and "; + + // Replace template marks. These are very important! + fromWhereClause = replaceString(fromWhereClause, getSqlClause() + .getWhereClauseMark(), "where " + joinCondition); + fromWhereClause = replaceString(fromWhereClause, getSqlClause() + .getWhereFirstConditionMark(), joinCondition + + firstConditionAfter); + fromWhereClause = replaceString(fromWhereClause, getSqlClause() + .getUnionSelectClauseMark(), selectClause); + fromWhereClause = replaceString(fromWhereClause, getSqlClause() + .getUnionWhereClauseMark(), "where " + joinCondition); + fromWhereClause = replaceString(fromWhereClause, getSqlClause() + .getUnionWhereFirstConditionMark(), joinCondition + + firstConditionAfter); + return fromWhereClause; + } + + protected void xincrementLocalSubQueryLevelIfNeeds(ConditionQuery subQuery) { // Very + // Internal + int subQueryLevel = subQuery.getSubQueryLevel(); + if (_subQueryLevel <= subQueryLevel) { + _subQueryLevel = subQueryLevel + 1; + } + } + + protected String xbuildFunctionConnector(String function) { + if (function != null && function.endsWith("(distinct")) { // For example + // 'count(distinct' + return " "; + } else { + return "("; + } + } + + protected String xconvertFunctionToMethod(String function) { + if (function != null && function.contains("(")) { // For example + // 'count(distinct' + int index = function.indexOf("("); + String front = function.substring(0, index); + if (function.length() > front.length() + "(".length()) { + String rear = function.substring(index + "(".length()); + function = front + initCap(rear); + } else { + function = front; + } + } + return function; + } + + // ----------------------------------------------------- // Where Clause // ------------ protected void setupConditionValueAndRegisterWhereClause(ConditionKey key, @@ -1276,14 +1570,16 @@ // ========= // Fixed Condition // =============== - protected String prepareFixedCondition(String fixedCondition, - String localAliasName, String foreignAliasName) { + protected String ppFxCd(String fixedCondition, String localAliasName, + String foreignAliasName) { // prepareFixedCondition fixedCondition = replaceString(fixedCondition, "$$alias$$", foreignAliasName); fixedCondition = replaceString(fixedCondition, "$$foreignAlias$$", foreignAliasName); fixedCondition = replaceString(fixedCondition, "$$localAlias$$", localAliasName); + fixedCondition = replaceString(fixedCondition, "$$locationBase$$.", + "dto." + getLocationBase()); return fixedCondition; } @@ -1515,7 +1811,7 @@ return newList; } - public void doNss(NssCall callback) {// Very Internal + public void doNss(NssCall callback) { // Very Internal String foreignPropertyName = callback.qf().getForeignPropertyName(); String foreignTableAliasName = callback.qf().getRealAliasName(); getSqlClause().registerSelectedSelectColumn(foreignTableAliasName, @@ -1524,7 +1820,7 @@ callback.qf().getRelationPath(), foreignPropertyName); } - public static interface NssCall {// Very Internal + public static interface NssCall { // Very Internal public ConditionQuery qf(); } Modified: addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/cbean/ConditionBean.java =================================================================== --- addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/cbean/ConditionBean.java 2008-12-27 22:02:56 UTC (rev 1623) +++ addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/cbean/ConditionBean.java 2008-12-27 22:06:42 UTC (rev 1624) @@ -1,5 +1,7 @@ package jp.sf.pal.addresslist.db.allcommon.cbean; +import java.util.Map; + import jp.sf.pal.addresslist.db.allcommon.cbean.sqlclause.SqlClause; import jp.sf.pal.addresslist.db.allcommon.jdbc.StatementConfig; @@ -11,28 +13,6 @@ public interface ConditionBean extends PagingBean { //========================================================================== - // =========== - // Definition - // ========== - /** Map-string map-mark. */ - public static final String MAP_STRING_MAP_MARK = "map:"; - - /** Map-string list-mark. */ - public static final String MAP_STRING_LIST_MARK = "list:"; - - /** Map-string start-brace. */ - public static final String MAP_STRING_START_BRACE = "@{"; - - /** Map-string end-brace. */ - public static final String MAP_STRING_END_BRACE = "@}"; - - /** Map-string delimiter. */ - public static final String MAP_STRING_DELIMITER = "@;"; - - /** Map-string equal. */ - public static final String MAP_STRING_EQUAL = "@="; - - //========================================================================== // ========= // Table Name // ========== @@ -70,8 +50,7 @@ * * @param primaryKeyMap Primary-key map. (NotNull and NotEmpty) */ - public void acceptPrimaryKeyMap( - java.util.Map primaryKeyMap); + public void acceptPrimaryKeyMap(Map primaryKeyMap); /** * Accept primary-key map-string. Delimiter is at-mark and semicolon. @@ -105,14 +84,6 @@ // Query // ===== /** - * Get condition-query as interface. - * - * @return Instance of query as interface. (NotNull) - * @deprecated - */ - public ConditionQuery getConditionQueryAsInterface(); - - /** * Get the conditionQuery of the local table as interface. * * @return The conditionQuery of the local table as interface. (NotNull) @@ -131,32 +102,6 @@ public boolean hasUnionQueryOrUnionAllQuery(); //========================================================================== - // ========= - // Limit Select - // ============ - /** - * Limit select PK only. This is OLD style. You can do the same thing by - * specify(). - * - * @return this. (NotNull) - */ - public ConditionBean limitSelect_PKOnly(); - - /** - * Limit select off. - * - * @return this. (NotNull) - */ - public ConditionBean limitSelect_Off(); - - /** - * Is limit-select PK only? - * - * @return Determination. - */ - public boolean isLimitSelect_PKOnly(); - - //========================================================================== // =========== // Lock Setting // ============ Modified: addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/cbean/ConditionBeanContext.java =================================================================== --- addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/cbean/ConditionBeanContext.java 2008-12-27 22:02:56 UTC (rev 1623) +++ addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/cbean/ConditionBeanContext.java 2008-12-27 22:06:42 UTC (rev 1624) @@ -1,10 +1,6 @@ package jp.sf.pal.addresslist.db.allcommon.cbean; -import java.util.Collections; -import java.util.LinkedHashMap; -import java.util.Map; - -import jp.sf.pal.addresslist.db.allcommon.DBFluteConfig; +import jp.sf.pal.addresslist.db.allcommon.DBDef; import jp.sf.pal.addresslist.db.allcommon.cbean.sqlclause.SqlClause; import jp.sf.pal.addresslist.db.allcommon.cbean.sqlclause.SqlClauseDb2; import jp.sf.pal.addresslist.db.allcommon.cbean.sqlclause.SqlClauseDerby; @@ -78,11 +74,35 @@ //========================================================================== // ========= - // Initialize against the ClassLoader Headache - // =========================================== + // Type Determination + // ================== + /** + * Is the argument condition-bean? + * + * @param dtoInstance DTO instance. + * @return Determination. + */ + public static boolean isTheArgumentConditionBean(final Object dtoInstance) { + return dtoInstance instanceof ConditionBean; + } + + /** + * Is the type condition-bean? + * + * @param dtoClass DtoClass. + * @return Determination. + */ + public static boolean isTheTypeConditionBean(final Class dtoClass) { + return ConditionBean.class.isAssignableFrom(dtoClass); + } + + //========================================================================== + // ========= + // Cool Classes + // ============ @SuppressWarnings("unused") - public static void initialize() { - boolean debugEnabled = _log.isDebugEnabled(); + public static void loadCoolClasses() { + boolean debugEnabled = false; // If you watch the log, set this true. // Against the ClassLoader Headache! final StringBuilder sb = new StringBuilder(); { @@ -119,120 +139,6 @@ //========================================================================== // ========= - // Type Determination - // ================== - /** - * Is the argument condition-bean? - * - * @param dtoInstance DTO instance. - * @return Determination. - */ - public static boolean isTheArgumentConditionBean(final Object dtoInstance) { - if (dtoInstance instanceof ConditionBean) { - return true; - } else { - return false; - } - } - - /** - * Is the type condition-bean? - * - * @param dtoClass DtoClass. - * @return Determination. - */ - public static boolean isTheTypeConditionBean(final Class dtoClass) { - if (ConditionBean.class.isAssignableFrom(dtoClass)) { - return true; - } else { - return false; - } - } - - //========================================================================== - // ========= - // Product Name - // ============ - public static final String DB_NAME_DERBY = "derby"; - - public static final String DB_NAME_H2 = "h2"; - - public static final String DB_NAME_ORACLE = "oracle"; - - public static final String DB_NAME_MYSQL = "mysql"; - - public static final String DB_NAME_POSTGRESQL = "postgresql"; - - public static final String DB_NAME_FIREBIRD = "firebird"; - - public static final String DB_NAME_MSSQL = "mssql"; - - public static final String DB_NAME_SYBASE = "sybase"; - - public static final String DB_NAME_DB2 = "db2"; - - protected static final Map _driverHintDatabaseProductNameMap; - static { - final Map tmpMap = Collections - .synchronizedMap(new LinkedHashMap()); - 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 keySet = _driverHintDatabaseProductNameMap - .keySet(); - for (final java.util.Iterator ite = keySet.iterator(); ite - .hasNext();) { - final String driverHint = (String) ite.next(); - if (driverClassName.indexOf(driverHint) >= 0) { - final String databaseProductName = (String) _driverHintDatabaseProductNameMap - .get(driverHint); - setDatabaseProductName(databaseProductName); - return true; - } - } - return false; - } - - /** The database product name. */ - private static String _databaseProductName; - - /** - * Get database product name. - * - * @return Database product name. - */ - public static String getDatabaseProductName() { - return _databaseProductName; - } - - /** - * Set database product name. - * - * @param name Database product name. (NotNull) - */ - public static void setDatabaseProductName(String name) { - if (_databaseProductName != null) { - String msg = "Already set up: current=" + _databaseProductName - + " your=" + name; - throw new IllegalStateException(msg); - } - _databaseProductName = name; - } - - //========================================================================== - // ========= // SqlClause Creator // ================= /** @@ -244,9 +150,6 @@ public static SqlClause createSqlClause(ConditionBean cb) { final String tableSqlName = cb.getTableSqlName(); final SqlClause sqlClause = createSqlClause(tableSqlName); - if (DBFluteConfig.getInstance().isConditionBeanFormatSql()) { - sqlClause.makeFormatClauseEffective(); - } return sqlClause; } @@ -257,27 +160,22 @@ * @return SQL-clause. (NotNull) */ public static SqlClause createSqlClause(String tableDbName) { - final String databaseProductName = getDatabaseProductName(); - if (databaseProductName == null) { - return new SqlClauseH2(tableDbName); - } - final String name = databaseProductName.toLowerCase(); - if (name.equalsIgnoreCase(DB_NAME_DERBY)) { - return new SqlClauseDerby(tableDbName); - } else if (name.equalsIgnoreCase(DB_NAME_H2)) { - return new SqlClauseH2(tableDbName); - } else if (name.equalsIgnoreCase(DB_NAME_ORACLE)) { - return new SqlClauseOracle(tableDbName); - } else if (name.equalsIgnoreCase(DB_NAME_FIREBIRD)) { - return new SqlClauseFirebird(tableDbName); - } else if (name.equalsIgnoreCase(DB_NAME_MYSQL)) { + if (DBDef.isCurrentDef(DBDef.MySQL)) { return new SqlClauseMySql(tableDbName); - } else if (name.equalsIgnoreCase(DB_NAME_POSTGRESQL)) { + } else if (DBDef.isCurrentDef(DBDef.PostgreSQL)) { return new SqlClausePostgreSql(tableDbName); - } else if (name.equalsIgnoreCase(DB_NAME_MSSQL)) { - return new SqlClauseSqlServer(tableDbName); - } else if (name.equalsIgnoreCase(DB_NAME_DB2)) { + } else if (DBDef.isCurrentDef(DBDef.Oracle)) { + return new SqlClauseOracle(tableDbName); + } else if (DBDef.isCurrentDef(DBDef.DB2)) { return new SqlClauseDb2(tableDbName); + } else if (DBDef.isCurrentDef(DBDef.SQLServer)) { + return new SqlClauseSqlServer(tableDbName); + } else if (DBDef.isCurrentDef(DBDef.FireBird)) { + return new SqlClauseFirebird(tableDbName); + } else if (DBDef.isCurrentDef(DBDef.H2)) { + return new SqlClauseH2(tableDbName); + } else if (DBDef.isCurrentDef(DBDef.Derby)) { + return new SqlClauseDerby(tableDbName); } else { return new SqlClauseH2(tableDbName); } @@ -362,12 +260,7 @@ // Display SQL // =========== public static String convertConditionBean2DisplaySql(ConditionBean cb) { - final String twoWaySql; - if (cb.isLimitSelect_PKOnly()) { - twoWaySql = cb.getSqlClause().getClausePKOnly(); - } else { - twoWaySql = cb.getSqlClause().getClause(); - } + final String twoWaySql = cb.getSqlClause().getClause(); return InternalSqlParser.convertTwoWaySql2DisplaySql(twoWaySql, cb); } @@ -390,31 +283,8 @@ errorCode); } - // [DBFlute-0.7.8] //========================================================================== // ========= - // Database Type - // ============= - /** - * Is the database Oracle? - * - * @return Is the database Oracle? - */ - public static boolean isOracle() { - return createSqlClause("dummy") instanceof SqlClauseOracle; - } - - /** - * Is the database PostgreSQL? - * - * @return Is the database PostgreSQL? - */ - public static boolean isPostgreSql() { - return createSqlClause("dummy") instanceof SqlClausePostgreSql; - } - - //========================================================================== - // ========= // Helper // ====== /** Modified: addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/cbean/ConditionQuery.java =================================================================== --- addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/cbean/ConditionQuery.java 2008-12-27 22:02:56 UTC (rev 1623) +++ addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/cbean/ConditionQuery.java 2008-12-27 22:06:42 UTC (rev 1624) @@ -8,7 +8,6 @@ * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public interface ConditionQuery { //========================================================================== Added: addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/cbean/ScalarQuery.java =================================================================== --- addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/cbean/ScalarQuery.java (rev 0) +++ addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/cbean/ScalarQuery.java 2008-12-27 22:06:42 UTC (rev 1624) @@ -0,0 +1,5 @@ +package jp.sf.pal.addresslist.db.allcommon.cbean; + +public interface ScalarQuery { + public void query(CB cb); +} Property changes on: addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/cbean/ScalarQuery.java ___________________________________________________________________ Name: svn:eol-style + native Deleted: addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/cbean/SimpleOrderByBean.java =================================================================== --- addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/cbean/SimpleOrderByBean.java 2008-12-27 22:02:56 UTC (rev 1623) +++ addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/cbean/SimpleOrderByBean.java 2008-12-27 22:06:42 UTC (rev 1624) @@ -1,165 +0,0 @@ -package jp.sf.pal.addresslist.db.allcommon.cbean; - -import jp.sf.pal.addresslist.db.allcommon.cbean.sqlclause.OrderByClause; -import jp.sf.pal.addresslist.db.allcommon.cbean.sqlclause.SqlClause; - -/** - * @deprecated - */ -public class SimpleOrderByBean implements OrderByBean { - - //========================================================================== - // ========= - // Attribute - // ========= - /** SQL clause instance. */ - protected final SqlClause _sqlClause; - { - _sqlClause = ConditionBeanContext.createSqlClause("Dummy"); - } - - //========================================================================== - // ========= - // Constructor - // =========== - /** - * Constructor. - */ - public SimpleOrderByBean() { - } - - //========================================================================== - // ========= - // SqlClause - // ========= - /** - * Get sql-clause. - * - * @return Sql clause. (NotNull) - */ - protected SqlClause getSqlClause() { - return _sqlClause; - } - - //========================================================================== - // ========= - // Select Resource - // =============== - /** - * Check safety result. - * - * @param safetyMaxResultSize Safety max result size. (If zero or minus, - * ignore checking) - */ - public void checkSafetyResult(int safetyMaxResultSize) { - throw new UnsupportedOperationException(); - } - - //========================================================================== - // ========= - // OrderBy - // ======= - /** - * The implementation. - * - * @return Sql component of order-by clause. (NotNull) - */ - public OrderByClause getSqlComponentOfOrderByClause() { - return getSqlClause().getSqlComponentOfOrderByClause(); - } - - /** - * The implementation. - * - * @return Order-by clause. (NotNull) - */ - public String getOrderByClause() { - return getSqlClause().getOrderByClause(); - } - - /** - * The implementation. - * - * @return this. (NotNull) - */ - public OrderByBean clearOrderBy() { - getSqlClause().clearOrderBy(); - return this; - } - - /** - * The implementation. - * - * @return this. (NotNull) - */ - public OrderByBean ignoreOrderBy() { - getSqlClause().ignoreOrderBy(); - return this; - } - - /** - * The implementation. - * - * @return this. (NotNull) - */ - public OrderByBean makeOrderByEffective() { - getSqlClause().makeOrderByEffective(); - return this; - } - - /** - * Register order-by-asc. - * - * @param orderByProperty Order-by-property. - * 'aliasName.columnName/aliasName.columnName/...' (NotNull) - * @return this. (NotNull) - * @deprecated - */ - public OrderByBean registerOrderByAsc(String orderByProperty) { - getSqlClause().registerOrderBy(orderByProperty, orderByProperty, true); - return this; - } - - /** - * Register order-by-desc. - * - * @param orderByProperty Order-by-property. - * 'aliasName.columnName/aliasName.columnName/...' (NotNull) - * @return this. (NotNull) - * @deprecated - */ - public OrderByBean registerOrderByDesc(String orderByProperty) { - getSqlClause().registerOrderBy(orderByProperty, orderByProperty, false); - return this; - } - - /** - * Reverse order-by or Override order-by asc. - * - * @param orderByProperty Order-by-property. - * 'aliasName.columnName/aliasName.columnName/...' (NotNull) - * @return this. (NotNull) - * @deprecated - */ - public OrderByBean reverseOrderBy_Or_OverrideOrderByAsc( - String orderByProperty) { - getSqlClause().reverseOrderBy_Or_OverrideOrderBy(orderByProperty, - orderByProperty, true); - return this; - } - - /** - * Reverse order-by or Override order-by desc. - * - * @param orderByProperty Order-by-property. - * 'aliasName.columnName/aliasName.columnName/...' (NotNull) - * @return this. (NotNull) - * @deprecated - */ - public OrderByBean reverseOrderBy_Or_OverrideOrderByDesc( - String orderByProperty) { - getSqlClause().reverseOrderBy_Or_OverrideOrderBy(orderByProperty, - orderByProperty, false); - return this; - } -} Modified: addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/cbean/ckey/ConditionKey.java =================================================================== --- addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/cbean/ckey/ConditionKey.java 2008-12-27 22:02:56 UTC (rev 1623) +++ addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/cbean/ckey/ConditionKey.java 2008-12-27 22:06:42 UTC (rev 1624) @@ -12,6 +12,10 @@ */ public abstract class ConditionKey { + //========================================================================== + // ========= + // Definition + // ========== /** Mark of replaced value. */ public static final String MARK_OF_REPLACED_VALUE = "ReplacedValue"; @@ -36,15 +40,18 @@ /** The condition key of prefixSearch. */ public static final ConditionKey CK_PREFIX_SEARCH = new ConditionKeyPrefixSearch(); - /** The condition key of likeSearch. */ - public static final ConditionKey CK_LIKE_SEARCH = new ConditionKeyLikeSearch(); - /** The condition key of inScope. */ public static final ConditionKey CK_IN_SCOPE = new ConditionKeyInScope(); /** The condition key of notInScope. */ public static final ConditionKey CK_NOT_IN_SCOPE = new ConditionKeyNotInScope(); + /** The condition key of likeSearch. */ + public static final ConditionKey CK_LIKE_SEARCH = new ConditionKeyLikeSearch(); + + /** The condition key of notLikeSearch. */ + public static final ConditionKey CK_NOT_LIKE_SEARCH = new ConditionKeyNotLikeSearch(); + /** The condition key of isNull. */ public static final ConditionKey CK_IS_NULL = new ConditionKeyIsNull(); @@ -54,31 +61,21 @@ /** Dummy-object for IsNull and IsNotNull and so on... */ protected static final Object DUMMY_OBJECT = new Object(); + //========================================================================== + // ========= + // Attribute + // ========= /** Condition-key. */ protected String _conditionKey; /** Operand. */ protected String _operand; + //========================================================================== + // ========= + // Validation + // ========== /** - * Get condition-key. - * - * @return Condition-key. - */ - public String getConditionKey() { - return _conditionKey; - } - - /** - * Get operand. - * - * @return Operand. - */ - public String getOperand() { - return _operand; - } - - /** * Is valid registration? * * @param conditionValue Condition value. (NotNull) @@ -89,6 +86,10 @@ abstract public boolean isValidRegistration(ConditionValue conditionValue, Object value, String callerName); + //========================================================================== + // ========= + // Where Clause + // ============ /** * Add where clause. * @@ -149,6 +150,10 @@ abstract protected void doAddWhereClause(List conditionList, String columnName, ConditionValue value, ConditionOption option); + //========================================================================== + // ========= + // Condition Value + // =============== /** * Setup condition value. * @@ -210,6 +215,10 @@ ConditionValue conditionValue, Object value, String location, ConditionOption option); + //========================================================================== + // ========= + // Bind Clause + // =========== /** * Build bind clause. (for s2dao) * @@ -269,6 +278,10 @@ return "%"; } + //========================================================================== + // ========= + // Basic Override + // ============== /** * The override. Returns hash-code of this condition-key string. * @@ -304,4 +317,26 @@ return "ConditionKey: " + getConditionKey() + " " + getOperand() + " wild-card=[" + getWildCard() + "]"; } + + //========================================================================== + // ========= + // Accessor + // ======== + /** + * Get condition-key. + * + * @return Condition-key. + */ + public String getConditionKey() { + return _conditionKey; + } + + /** + * Get operand. + * + * @return Operand. + */ + public String getOperand() { + return _operand; + } } Added: addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/cbean/ckey/ConditionKeyNotLikeSearch.java =================================================================== --- addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/cbean/ckey/ConditionKeyNotLikeSearch.java (rev 0) +++ addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/cbean/ckey/ConditionKeyNotLikeSearch.java 2008-12-27 22:06:42 UTC (rev 1624) @@ -0,0 +1,104 @@ +package jp.sf.pal.addresslist.db.allcommon.cbean.ckey; + +import java.util.List; + +import jp.sf.pal.addresslist.db.allcommon.cbean.coption.ConditionOption; +import jp.sf.pal.addresslist.db.allcommon.cbean.coption.LikeSearchOption; +import jp.sf.pal.addresslist.db.allcommon.cbean.cvalue.ConditionValue; + +/** + * The condition-key of notLikeSearch. + * + * @author DBFlute(AutoGenerator) + */ +public class ConditionKeyNotLikeSearch extends ConditionKey { + + /** + * Constructor. + */ + protected ConditionKeyNotLikeSearch() { + _conditionKey = "notLikeSearch"; + _operand = "not like"; + } + + /** + * Is valid registration? + * + * @param conditionValue Condition value. (NotNull) + * @param value Value. (NotNull) + * @param callerName Caller name. (NotNull) + * @return Determination. + */ + public boolean isValidRegistration(ConditionValue conditionValue, + Object value, String callerName) { + if (value == null) { + return false; + } + return true; + } + + /** + * This method implements super#doAddWhereClause(). + * + * @param conditionList Condition list. (NotNull) + * @param columnName Column name. (NotNull) + * @param value Condition value. (NotNull) + */ + protected void doAddWhereClause(List 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 conditionList, + String columnName, ConditionValue value, ConditionOption option) { + if (option == null) { + String msg = "The argument[option] should not be null: columnName=" + + columnName + " value=" + value; + throw new IllegalArgumentException(msg); + } + if (!(option instanceof LikeSearchOption)) { + String msg = "The argument[option] should be LikeSearchOption: columnName=" + + columnName + " value=" + value; + throw new IllegalArgumentException(msg); + } + final LikeSearchOption myOption = (LikeSearchOption) option; + conditionList.add(buildBindClauseWithRearOption(columnName, value + .getNotLikeSearchLocation(), myOption.getRearOption())); + } + + /** + * This method implements super#doSetupConditionValue(). + * + * @param conditionValue Condition value. (NotNull) + * @param value Value. (NotNull) + * @param location Location. (NotNull) + */ + protected void doSetupConditionValue(ConditionValue conditionValue, + Object value, String location) { + throw new UnsupportedOperationException( + "doSetupConditionValue without condition-option is unsupported!!!"); + } + + /** + * This method implements super#doSetupConditionValue(). + * + * @param conditionValue Condition value. (NotNull) + * @param value Value. (NotNull) + * @param location Location. (NotNull) + * @param option Condition option. (NotNull) + */ + protected void doSetupConditionValue(ConditionValue conditionValue, + Object value, String location, ConditionOption option) { + conditionValue.setNotLikeSearch((String) value, + (LikeSearchOption) option).setNotLikeSearchLocation(location); + } +} Property changes on: addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/cbean/ckey/ConditionKeyNotLikeSearch.java ___________________________________________________________________ Name: svn:eol-style + native Modified: addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/cbean/coption/FromToOption.java =================================================================== --- addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/cbean/coption/FromToOption.java 2008-12-27 22:02:56 UTC (rev 1623) +++ addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/cbean/coption/FromToOption.java 2008-12-27 22:06:42 UTC (rev 1624) @@ -1,5 +1,10 @@ package jp.sf.pal.addresslist.db.allcommon.cbean.coption; +import java.util.Calendar; +import java.util.Date; + +import jp.sf.pal.addresslist.db.allcommon.cbean.ckey.ConditionKey; + /** * The option of from-to. * @@ -85,60 +90,84 @@ // ========= // Internal Main // ============= - public java.util.Date filterFromDate(java.util.Date fromDate) { + /** + * Filter the date as From. It requires this method is called before + * getFromDateConditionKey(). + * + * @param fromDate The date as From. (Nullable: If the value is null, it + * returns null) + * @return The filtered date as From. (Nullable) + */ + public Date filterFromDate(Date fromDate) { if (fromDate == null) { return null; } if (_compareAsDate) { - final java.util.Calendar cal = java.util.Calendar.getInstance(); + final Calendar cal = Calendar.getInstance(); cal.setTimeInMillis(fromDate.getTime()); clearCalendarHourMinuteSecondMilli(cal); - final java.util.Date cloneDate = (java.util.Date) fromDate.clone(); + final Date cloneDate = (Date) fromDate.clone(); cloneDate.setTime(cal.getTimeInMillis()); return cloneDate; } return fromDate; } - public java.util.Date filterToDate(java.util.Date toDate) { + /** + * Filter the date as To. It requires this method is called before + * getToDateConditionKey(). + * + * @param toDate The date as To. (Nullable: If the value is null, it returns + * null) + * @return The filtered date as To. (Nullable) + */ + public Date filterToDate(Date toDate) { if (toDate == null) { return null; } if (_compareAsDate) { - final java.util.Calendar cal = java.util.Calendar.getInstance(); + final Calendar cal = Calendar.getInstance(); cal.setTimeInMillis(toDate.getTime()); clearCalendarHourMinuteSecondMilli(cal); addCalendarNextDay(cal);// Key Point! - final java.util.Date cloneDate = (java.util.Date) toDate.clone(); + final Date cloneDate = (Date) toDate.clone(); cloneDate.setTime(cal.getTimeInMillis()); return cloneDate; } return toDate; } - public jp.sf.pal.addresslist.db.allcommon.cbean.ckey.ConditionKey getFromDateConditionKey() { + /** + * Get the condition-key of the from-date. It requires this method is called + * after filterFromDate(). + * + * @return The condition-key of the from-date. (NotNull) + */ + public ConditionKey getFromDateConditionKey() { if (_compareAsDate) { - return jp.sf.pal.addresslist.db.allcommon.cbean.ckey.ConditionKey.CK_GREATER_EQUAL; + return ConditionKey.CK_GREATER_EQUAL; } if (_fromDateGreaterThan) { - return jp.sf.pal.addresslist.db.allcommon.cbean.ckey.ConditionKey.CK_GREATER_THAN;// Default - // ! + return ConditionKey.CK_GREATER_THAN;// Default! } else { - return jp.sf.pal.addresslist.db.allcommon.cbean.ckey.ConditionKey.CK_GREATER_EQUAL;// Default - // ! + return ConditionKey.CK_GREATER_EQUAL;// Default! } } - public jp.sf.pal.addresslist.db.allcommon.cbean.ckey.ConditionKey getToDateConditionKey() { + /** + * Get the condition-key of the to-date. It requires this method is called + * after filterToDate(). + * + * @return The condition-key of the to-date. (NotNull) + */ + public ConditionKey getToDateConditionKey() { if (_compareAsDate) { - return jp.sf.pal.addresslist.db.allcommon.cbean.ckey.ConditionKey.CK_LESS_THAN; + return ConditionKey.CK_LESS_THAN; } if (_toDateLessThan) { - return jp.sf.pal.addresslist.db.allcommon.cbean.ckey.ConditionKey.CK_LESS_THAN;// Default - // ! + return ConditionKey.CK_LESS_THAN;// Default! } else { - return jp.sf.pal.addresslist.db.allcommon.cbean.ckey.ConditionKey.CK_LESS_EQUAL;// Default - // ! + return ConditionKey.CK_LESS_EQUAL;// Default! } } @@ -146,15 +175,15 @@ // ========= // Calendar Helper // =============== - protected void addCalendarNextDay(java.util.Calendar cal) { - cal.add(java.util.Calendar.DAY_OF_MONTH, 1); + protected void addCalendarNextDay(Calendar cal) { + cal.add(Calendar.DAY_OF_MONTH, 1); } - protected void clearCalendarHourMinuteSecondMilli(java.util.Calendar cal) { - cal.clear(java.util.Calendar.MILLISECOND); - cal.clear(java.util.Calendar.SECOND); - cal.clear(java.util.Calendar.MINUTE); - cal.set(java.util.Calendar.HOUR_OF_DAY, cal - .getActualMinimum(java.util.Calendar.HOUR_OF_DAY)); + protected void clearCalendarHourMinuteSecondMilli(Calendar cal) { + cal.clear(Calendar.MILLISECOND); + cal.clear(Calendar.SECOND); + cal.clear(Calendar.MINUTE); + cal.set(Calendar.HOUR_OF_DAY, cal + .getActualMinimum(Calendar.HOUR_OF_DAY)); } } Modified: addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/cbean/coption/LikeSearchOption.java =================================================================== --- addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/cbean/coption/LikeSearchOption.java 2008-12-27 22:02:56 UTC (rev 1623) +++ addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/cbean/coption/LikeSearchOption.java 2008-12-27 22:06:42 UTC (rev 1624) @@ -4,6 +4,7 @@ import java.util.Iterator; import java.util.List; +import jp.sf.pal.addresslist.db.allcommon.DBDef; import jp.sf.pal.addresslist.db.allcommon.cbean.coption.parts.local.JapaneseOptionPartsAgent; /** @@ -230,6 +231,10 @@ String tmp = replace(value, _escape, _escape + _escape); tmp = replace(tmp, "%", _escape + "%"); tmp = replace(tmp, "_", _escape + "_"); + if (DBDef.isCurrentDef(DBDef.Oracle)) { + tmp = replace(tmp, "\uff05", _escape + "\uff05"); + tmp = replace(tmp, "\uff3f", _escape + "\uff3f"); + } value = tmp; } final String wildCard = "%"; Modified: addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/cbean/cvalue/ConditionValue.java =================================================================== --- addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/cbean/cvalue/ConditionValue.java 2008-12-27 22:02:56 UTC (rev 1623) +++ addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/cbean/cvalue/ConditionValue.java 2008-12-27 22:06:42 UTC (rev 1624) @@ -6,9 +6,10 @@ import jp.sf.pal.addresslist.db.allcommon.cbean.coption.InScopeOption; import jp.sf.pal.addresslist.db.allcommon.cbean.coption.LikeSearchOption; +import jp.sf.pal.addresslist.db.allcommon.util.SimpleTypeUtil; /** - * Condition value. + * Condition-value. * * @author DBFlute(AutoGenerator) */ @@ -578,110 +579,9 @@ //========================================================================== // ========= - // Like Search - // =========== - /** Value of likeSearch. */ - protected List _likeSearch; - - /** Value of likeSearch for spare. */ - protected List _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(); - _likeSearch4Spare = new ArrayList(); - } - if (_likeSearch.isEmpty() && !_likeSearch4Spare.isEmpty()) { - for (int index = 0; index < _likeSearch4Spare.size(); index++) { - _likeSearch.add(_likeSearch4Spare.get(index)); - } - } - LikeSearchValue likeSearchValue = new LikeSearchValue(value, option); - _likeSearch.add(likeSearchValue); - _likeSearch4Spare.add(likeSearchValue); - return this; - } - - /** Location of likeSearch. */ - protected String _likeSearchLocation; - - /** - * Get the location of likeSearch. - * - * @return The location of likeSearch. (Nullable) - */ - public String getLikeSearchLocation() { - return _likeSearchLocation; - } - - /** - * Set the location of likeSearch. - * - * @param location The location of likeSearch. (Nullable) - * @return this. (NotNull) - */ - public ConditionValue setLikeSearchLocation(String location) { - _likeSearchLocation = location; - return this; - } - - protected static class LikeSearchValue { - protected String _value; - - protected LikeSearchOption _option; - - public LikeSearchValue(String value, LikeSearchOption option) { - _value = value; - _option = option; - } - - public String getValue() { - return _value; - } - - public LikeSearchOption getOption() { - return _option; - } - - public String generateRealValue() { - if (_option == null) { - return _value; - } - return _option.generateRealValue(_value); - } - } - - //========================================================================== - // ========= // In Scope // ======== - /** Value of inScope. */ + /** The value of inScope. */ protected List _inScope; protected InScopeOption _inScopeOption; @@ -774,7 +674,7 @@ // ========= // Not In Scope // ============ - /** Value of notInScope. */ + /** The value of notInScope. */ protected List _notInScope; /** @@ -852,6 +752,207 @@ //========================================================================== // ========= + // Like Search + // =========== + /** The value of likeSearch. */ + protected List _likeSearch; + + /** The value of likeSearch for spare. */ + protected List _likeSearch4Spare; + + /** + * Get the value of likeSearch. + * + * @return The value of likeSearch. (Nullable) + */ + public String getLikeSearch() { + if (_likeSearch == null) { + return null; + } + if (_likeSearch.isEmpty() && !_likeSearch4Spare.isEmpty()) { + for (int index = 0; index < _likeSearch4Spare.size(); index++) { + _likeSearch.add(_likeSearch4Spare.get(index)); + } + } + final LikeSearchValue likeSearchValue = _likeSearch.remove(0); + return (String) filterValue(likeSearchValue.generateRealValue()); + } + + /** + * Set the value of likeSearch. + * + * @param value The value of likeSearch. (Nullable) + * @param option The option of likeSearch. (Nullable) + * @return this. (NotNull) + */ + public ConditionValue setLikeSearch(String value, LikeSearchOption option) { + if (_likeSearch == null) { + _likeSearch = new ArrayList(); + _likeSearch4Spare = new ArrayList(); + } + if (_likeSearch.isEmpty() && !_likeSearch4Spare.isEmpty()) { + for (int index = 0; index < _likeSearch4Spare.size(); index++) { + _likeSearch.add(_likeSearch4Spare.get(index)); + } + } + LikeSearchValue likeSearchValue = new LikeSearchValue(value, option); + _likeSearch.add(likeSearchValue); + _likeSearch4Spare.add(likeSearchValue); + return this; + } + + /** Location of likeSearch. */ + protected String _likeSearchLocation; + + /** + * Get the location of likeSearch. + * + * @return The location of likeSearch. (Nullable) + */ + public String getLikeSearchLocation() { + return _likeSearchLocation; + } + + /** + * Set the location of likeSearch. + * + * @param location The location of likeSearch. (Nullable) + * @return this. (NotNull) + */ + public ConditionValue setLikeSearchLocation(String location) { + _likeSearchLocation = location; + return this; + } + + protected static class LikeSearchValue { + protected String _value; + + protected LikeSearchOption _option; + + public LikeSearchValue(String value, LikeSearchOption option) { + _value = value; + _option = option; + } + + public String getValue() { + return _value; + } + + public LikeSearchOption getOption() { + return _option; + } + + public String generateRealValue() { + if (_option == null) { + return _value; + } + return _option.generateRealValue(_value); + } + } + + //========================================================================== + // ========= + // Not Like Search + // =============== + /** The value of notLikeSearch. */ + protected List _notLikeSearch; + + /** The value of notLikeSearch for spare. */ + protected List _notLikeSearch4Spare; + + /** + * Get the value of notLikeSearch. + * + * @return The value of notLikeSearch. (Nullable) + */ + public String getNotLikeSearch() { + if (_notLikeSearch == null) { + return null; + } + if (_notLikeSearch.isEmpty() && !_notLikeSearch4Spare.isEmpty()) { + for (int index = 0; index < _notLikeSearch4Spare.size(); index++) { + _notLikeSearch.add(_notLikeSearch4Spare.get(index)); + } + } + final NotLikeSearchValue notLikeSearchValue = _notLikeSearch.remove(0); + return (String) filterValue(notLikeSearchValue.generateRealValue()); + } + + /** + * Set the value of notLikeSearch. + * + * @param value The value of notLikeSearch. (Nullable) + * @param option The option of notLikeSearch. (Nullable) + * @return this. (NotNull) + */ + public ConditionValue setNotLikeSearch(String value, LikeSearchOption option) { + if (_notLikeSearch == null) { + _notLikeSearch = new ArrayList(); + _notLikeSearch4Spare = new ArrayList(); + } + if (_notLikeSearch.isEmpty() && !_notLikeSearch4Spare.isEmpty()) { + for (int index = 0; index < _notLikeSearch4Spare.size(); index++) { + _notLikeSearch.add(_notLikeSearch4Spare.get(index)); + } + } + NotLikeSearchValue notLikeSearchValue = new NotLikeSearchValue(value, + option); + _notLikeSearch.add(notLikeSearchValue); + _notLikeSearch4Spare.add(notLikeSearchValue); + return this; + } + + /** Location of notLikeSearch. */ + protected String _notLikeSearchLocation; + + /** + * Get the location of notLikeSearch. + * + * @return The location of notLikeSearch. (Nullable) + */ + public String getNotLikeSearchLocation() { + return _notLikeSearchLocation; + } + + /** + * Set the location of notLikeSearch. + * + * @param location The location of notLikeSearch. (Nullable) + * @return this. (NotNull) + */ + public ConditionValue setNotLikeSearchLocation(String location) { + _notLikeSearchLocation = location; + return this; + } + + protected static class NotLikeSearchValue { + protected String _value; + + protected LikeSearchOption _option; + + public NotLikeSearchValue(String value, LikeSearchOption option) { + _value = value; + _option = option; + } + + public String getValue() { + return _value; + } + + public LikeSearchOption getOption() { + return _option; + } + + public String generateRealValue() { + if (_option == null) { + return _value; + } + return _option.generateRealValue(_value); + } + } + + //========================================================================== + // ========= // Is Null // ======= /** Value of isNull. */ @@ -976,8 +1077,8 @@ * Filter value. If the value is instance of java.util.Date or * java.util.Calendar, returns value as java.sql.Date. * - * @param value Value. (Nullable) - * @return Filtered value. (Nullable) + * @param value The value. (Nullable) + * @return The filtered value. (Nullable) */ protected Object filterValue(Object value) { if (value == null) { @@ -991,18 +1092,18 @@ } if (value instanceof java.util.Date || value instanceof java.util.Calendar) { - return SqlDateConversionUtil.toDate(value); + return SimpleTypeUtil.toSqlDate(value); } else { return value; } } /** - * Filter value. If the value is instance of java.util.Date or + * Filter the list of value. If the value is instance of java.util.Date or * java.util.Calendar, returns value as java.sql.Date. * - * @param valueList Value-list. (Nullable) - * @return Filtered value-list. (Nullable) + * @param valueList The list of value. (Nullable) + * @return The filtered list of value. (Nullable) */ protected List filterValue(List valueList) { if (valueList == null || valueList.isEmpty()) { @@ -1015,204 +1116,4 @@ } return resultList; } - - protected static class SqlDateConversionUtil { - - private SqlDateConversionUtil() { - } - - public static java.sql.Date toDate(Object o) { - return toDate(o, null); - } - - public static java.sql.Date toDate(Object o, String pattern) { - if (o instanceof java.sql.Date) { - return (java.sql.Date) o; - } - java.util.Date date = DateConversionUtil.toDate(o, pattern); - if (date != null) { - return new java.sql.Date(date.getTime()); - } - return null; - } - } - - protected static class DateConversionUtil { - - private DateConversionUtil() { - } - - public static java.util.Date toDate(Object o) { - return toDate(o, null); - } - - public static java.util.Date toDate(Object o, String pattern) { - if (o == null) { - return null; - } else if (o instanceof String) { - return toDate((String) o, pattern); - } else if (o instanceof java.util.Date) { - return (java.util.Date) o; - } else if (o instanceof java.util.Calendar) { - return ((java.util.Calendar) o).getTime(); - } else { - return toDate(o.toString(), pattern); - } - } - - public static java.util.Date toDate(String s, String pattern) { - return toDate(s, pattern, java.util.Locale.getDefault()); - } - - public static java.util.Date toDate(String s, String pattern, - java.util.Locale locale) { - java.text.SimpleDateFormat sdf = getDateFormat(s, pattern, locale); - try { - return sdf.parse(s); - } catch (java.text.ParseException ex) { - throw new RuntimeException(ex); - } - } - - public static java.text.SimpleDateFormat getDateFormat(String s, - String pattern, java.util.Locale locale) { - if (pattern != null) { - return new java.text.SimpleDateFormat(pattern); - } - return getDateFormat(s, locale); - } - - public static java.text.SimpleDateFormat getDateFormat(String s, - java.util.Locale locale) { - String pattern = getPattern(locale); - String shortPattern = removeDelimiter(pattern); - String delimitor = findDelimiter(s); - if (delimitor == null) { - if (s.length() == shortPattern.length()) { - return new java.text.SimpleDateFormat(shortPattern); - } - if (s.length() == shortPattern.length() + 2) { - return new java.text.SimpleDateFormat(InternalStringUtil - .replace(shortPattern, "yy", "yyyy")); - } - } else { - String[] array = InternalStringUtil.split(s, delimitor); - for (int i = 0; i < array.length; ++i) { - if (array[i].length() == 4) { - pattern = InternalStringUtil.replace(pattern, "yy", - "yyyy"); - break; - } - } - return new java.text.SimpleDateFormat(pattern); - } - return new java.text.SimpleDateFormat(); - } - - public static java.text.SimpleDateFormat getDateFormat( - java.util.Locale locale) { - return new java.text.SimpleDateFormat(getPattern(locale)); - } - - public static java.text.SimpleDateFormat getY4DateFormat( - java.util.Locale locale) { - return new java.text.SimpleDateFormat(getY4Pattern(locale)); - } - - public static String getY4Pattern(java.util.Locale locale) { - String pattern = getPattern(locale); - if (pattern.indexOf("yyyy") < 0) { - pattern = InternalStringUtil.replace(pattern, "yy", "yyyy"); - } - return pattern; - } - - public static String getPattern(java.util.Locale locale) { - java.text.SimpleDateFormat df = (java.text.SimpleDateFormat) java.text.DateFormat - .getDateInstance(java.text.DateFormat.SHORT, locale); - String pattern = df.toPattern(); - int index = pattern.indexOf(' '); - if (index > 0) { - pattern = pattern.substring(0, index); - } - if (pattern.indexOf("MM") < 0) { - pattern = InternalStringUtil.replace(pattern, "M", "MM"); - } - if (pattern.indexOf("dd") < 0) { - pattern = InternalStringUtil.replace(pattern, "d", "dd"); - } - return pattern; - } - - public static String findDelimiter(String value) { - for (int i = 0; i < value.length(); ++i) { - char c = value.charAt(i); - if (Character.isDigit(c)) { - continue; - } - return Character.toString(c); - } - return null; - } - - public static String removeDelimiter(String pattern) { - StringBuffer buf = new StringBuffer(); - for (int i = 0; i < pattern.length(); ++i) { - char c = pattern.charAt(i); - if (c == 'y' || c == 'M' || c == 'd') { - buf.append(c); - } - } - return buf.toString(); - } - } - - protected static class InternalStringUtil { - public static final String[] EMPTY_STRINGS = new String[0]; - - private InternalStringUtil() { - } - - public static final boolean isEmpty(String text) { - return text == null || text.length() == 0; - } - - public static final String replace(String text, String fromText, - String toText) { - if (text == null || fromText == null || toText == null) { - return null; - } - StringBuffer buf = new StringBuffer(100); - int pos = 0; - int pos2 = 0; - while (true) { - pos = text.indexOf(fromText, pos2); - if (pos == 0) { - buf.append(toText); - pos2 = fromText.length(); - } else if (pos > 0) { - buf.append(text.substring(pos2, pos)); - buf.append(toText); - pos2 = pos + fromText.length(); - } else { - buf.append(text.substring(pos2)); - break; - } - } - return buf.toString(); - } - - public static String[] split(String str, String delim) { - if (str == null) { - return EMPTY_STRINGS; - } - List list = new java.util.ArrayList(); - java.util.StringTokenizer st = new java.util.StringTokenizer(str, - delim); - while (st.hasMoreElements()) { - list.add(st.nextToken()); - } - return (String[]) list.toArray(new String[list.size()]); - } - } } Modified: addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/cbean/outsidesql/OutsideSqlContext.java =================================================================== --- addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/cbean/outsidesql/OutsideSqlContext.java 2008-12-27 22:02:56 UTC (rev 1623) +++ addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/cbean/outsidesql/OutsideSqlContext.java 2008-12-27 22:06:42 UTC (rev 1624) @@ -1,17 +1,21 @@ package jp.sf.pal.addresslist.db.allcommon.cbean.outsidesql; +import java.io.BufferedReader; +import java.io.IOException; +import java.io.InputStream; +import java.io.InputStreamReader; +import java.io.Reader; + import jp.sf.pal.addresslist.db.allcommon.DBFluteConfig; import jp.sf.pal.addresslist.db.allcommon.dbmeta.DBMeta; import jp.sf.pal.addresslist.db.allcommon.dbmeta.DBMetaInstanceHandler; import jp.sf.pal.addresslist.db.allcommon.jdbc.StatementConfig; +import jp.sf.pal.addresslist.db.allcommon.util.SimpleResourceUtil; import jp.sf.pal.addresslist.db.allcommon.util.SimpleStringUtil; import jp.sf.pal.addresslist.db.allcommon.util.SimpleSystemUtil; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; -import org.seasar.framework.util.InputStreamReaderUtil; -import org.seasar.framework.util.ReaderUtil; -import org.seasar.framework.util.ResourceUtil; /** * The context of outside-SQL. @@ -33,7 +37,7 @@ /** * Get outside-SQL context on thread. * - * @return Outside-SQL context. (Nullable) + * @return The context of outside-SQL. (Nullable) */ public static OutsideSqlContext getOutsideSqlContextOnThread() { return (OutsideSqlContext) _threadLocal.get(); @@ -42,7 +46,7 @@ /** * Set outside-SQL context on thread. * - * @param outsideSqlContext Outside-SQL context. (NotNull) + * @param outsideSqlContext The context of outside-SQL. (NotNull) */ public static void setOutsideSqlContextOnThread( OutsideSqlContext outsideSqlContext) { @@ -54,7 +58,7 @@ } /** - * Is existing outside-SQL context on thread? + * Is existing the context of outside-SQL on thread? * * @return Determination. */ @@ -63,7 +67,7 @@ } /** - * Clear outside-SQL context on thread. + * Clear the context of outside-SQL on thread. */ public static void clearOutsideSqlContextOnThread() { _threadLocal.set(null); @@ -77,12 +81,20 @@ String methodName, String path, Object pmb, OutsideSqlOption option, Object resultTypeSpecification) { final String pmbKey = (pmb != null ? pmb.getClass().getName() : "null"); - final String resultKey = (resultTypeSpecification != null ? ":" - + resultTypeSpecification : "null"); + final String resultKey; + if (resultTypeSpecification != null) { + if (resultTypeSpecification instanceof Class) { + resultKey = ((Class) resultTypeSpecification).getName(); + } else { + resultKey = resultTypeSpecification.toString(); + } + } else { + resultKey = "null"; + } final String tableDbName = option.getTableDbName(); final String generatedUniqueKey = option.generateUniqueKey(); - return methodName + "():" + tableDbName + ":" + path + ":" + pmbKey - + ":" + generatedUniqueKey + resultKey; + return tableDbName + ":" + methodName + "():" + path + ":" + pmbKey + + ":" + generatedUniqueKey + ":" + resultKey; } //========================================================================== @@ -116,18 +128,9 @@ // Attribute // ========= // ----------------------------------------------------- - // Common of OutsideSql - // -------------------- - protected boolean _dynamicBinding; - - protected boolean _offsetByCursorForcedly; - - protected boolean _limitByCursorForcedly; - - // ----------------------------------------------------- - // Specified OutsideSql - // -------------------- - /** The path of outside-sql. (The mark of Specified-OutsideSql) */ + // Basic + // ----- + /** The path of outside-SQL. (The mark of specified outside-SQL) */ protected String _outsideSqlPath; protected Object _parameterBean; @@ -136,12 +139,23 @@ protected String _methodName; - /** The config of statement. (Nullable) */ + /** The configuration of statement. (Nullable) */ protected StatementConfig _statementConfig; /** The DB name of table for using behavior-SQL-path. (Nullable) */ protected String _tableDbName; + // ----------------------------------------------------- + // Option + // ------ + protected boolean _dynamicBinding; + + protected boolean _offsetByCursorForcedly; + + protected boolean _limitByCursorForcedly; + + protected boolean _autoPagingLogging; // for logging + //========================================================================== // ========= // Read SQL @@ -200,7 +214,7 @@ } /** - * Read outside-sql path. Required attribute is 'outsideSqlPath'. + * Read outside-SQL path. Required attribute is 'outsideSqlPath'. * * @param sqlFileEncoding The encoding of SQL file. (NotNull) * @param dbmsSuffix The suffix of DBMS. (NotNull) @@ -214,6 +228,13 @@ String sql; if (isExistResource(dbmsPath)) { sql = readText(dbmsPath, sqlFileEncoding); + } else if ("_postgresql".equals(dbmsSuffix) + && isExistResource("_postgre")) { + sql = readText("_postgre", sqlFileEncoding); // Patch for name + // difference + } else if ("_sqlserver".equals(dbmsSuffix) && isExistResource("_mssql")) { + sql = readText("_mssql", sqlFileEncoding); // Patch for name + // difference } else if (isExistResource(standardPath)) { sql = readText(standardPath, sqlFileEncoding); } else { @@ -324,16 +345,46 @@ // General Helper // ============== protected boolean isExistResource(String path) { - return ResourceUtil.isExist(path); + return SimpleResourceUtil.isExist(path); } protected String readText(final String path, String sqlFileEncoding) { - final java.io.InputStream is = ResourceUtil.getResourceAsStream(path); - final java.io.Reader reader = InputStreamReaderUtil.create(is, - sqlFileEncoding); - return ReaderUtil.readText(reader); + final InputStream ins = SimpleResourceUtil.getResourceStream(path); + final Reader reader = createInputStreamReader(ins, sqlFileEncoding); + return readText(reader); } + protected Reader createInputStreamReader(InputStream ins, String encoding) { + try { + return new InputStreamReader(ins, encoding); + } catch (IOException e) { + String msg = "Failed to create the reader of the input stream:"; + msg = msg + " ins=" + ins + " encoding=" + encoding; + throw new IllegalStateException(msg, e); + } + } + + public String readText(Reader reader) { + final BufferedReader bfreader = new BufferedReader(reader); + final StringBuilder out = new StringBuilder(100); + try { + try { + final char[] buf = new char[8192]; + int n; + while ((n = bfreader.read(buf)) >= 0) { + out.append(buf, 0, n); + } + } finally { + bfreader.close(); + } + } catch (IOException e) { + String msg = "Failed to read the input stream:"; + msg = msg + " bfreader=" + bfreader + " reader=" + reader; + throw new IllegalStateException(msg, e); + } + return out.toString(); + } + protected static String replaceString(String text, String fromText, String toText) { return SimpleStringUtil.replace(text, fromText, toText); @@ -348,35 +399,8 @@ // Accessor // ======== // ----------------------------------------------------- - // Common of OutsideSql - // -------------------- - public boolean isDynamicBinding() { - return _dynamicBinding; - } - - public void setDynamicBinding(boolean dynamicBinding) { - this._dynamicBinding = dynamicBinding; - } - - public boolean isOffsetByCursorForcedly() { - return _offsetByCursorForcedly; - } - - public void setOffsetByCursorForcedly(boolean offsetByCursorForcedly) { - this._offsetByCursorForcedly = offsetByCursorForcedly; - } - - public boolean isLimitByCursorForcedly() { - return _limitByCursorForcedly; - } - - public void setLimitByCursorForcedly(boolean limitByCursorForcedly) { - this._limitByCursorForcedly = limitByCursorForcedly; - } - - // ----------------------------------------------------- - // Specified OutsideSql - // -------------------- + // Basic + // ----- public String getOutsideSqlPath() { return _outsideSqlPath; } @@ -424,4 +448,39 @@ public void setTableDbName(String tableDbName) { this._tableDbName = tableDbName; } + + // ----------------------------------------------------- + // Option + // ------ + public boolean isDynamicBinding() { + return _dynamicBinding; + } + + public void setDynamicBinding(boolean dynamicBinding) { + this._dynamicBinding = dynamicBinding; + } + + public boolean isOffsetByCursorForcedly() { + return _offsetByCursorForcedly; + } + + public void setOffsetByCursorForcedly(boolean offsetByCursorForcedly) { + this._offsetByCursorForcedly = offsetByCursorForcedly; + } + + public boolean isLimitByCursorForcedly() { + return _limitByCursorForcedly; + } + + public void setLimitByCursorForcedly(boolean limitByCursorForcedly) { + this._limitByCursorForcedly = limitByCursorForcedly; + } + + public boolean isAutoPagingLogging() { // for logging + return _autoPagingLogging; + } + + public void setAutoPagingLogging(boolean autoPagingLogging) { // for logging + this._autoPagingLogging = autoPagingLogging; + } } Deleted: addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/cbean/outsidesql/OutsideSqlDao.java =================================================================== --- addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/cbean/outsidesql/OutsideSqlDao.java 2008-12-27 22:02:56 UTC (rev 1623) +++ addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/cbean/outsidesql/OutsideSqlDao.java 2008-12-27 22:06:42 UTC (rev 1624) @@ -1,37 +0,0 @@ -package jp.sf.pal.addresslist.db.allcommon.cbean.outsidesql; - -import java.util.List; - -import jp.sf.pal.addresslist.db.allcommon.DaoReadable; -import jp.sf.pal.addresslist.db.allcommon.jdbc.CursorHandler; - -/** - * The dao of outside-sql. - * - * @author DBFlute(AutoGenerator) - */ -public interface OutsideSqlDao extends DaoReadable { - - //========================================================================== - // ========= - // Select - // ====== - List selectList(String path, Object pmb, - OutsideSqlOption option, Class entityType); - - Object selectCursor(String path, Object pmb, - OutsideSqlOption option, CursorHandler handler); - - //========================================================================== - // ========= - // Execute - // ======= - int execute(String path, Object pmb, OutsideSqlOption option); - - // [DBFlute-0.7.5] - //========================================================================== - // ========= - // Call - // ==== - void call(String path, Object pmb, OutsideSqlOption option); -} Modified: addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/cbean/outsidesql/OutsideSqlOption.java =================================================================== --- addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/cbean/outsidesql/OutsideSqlOption.java 2008-12-27 22:02:56 UTC (rev 1623) +++ addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/cbean/outsidesql/OutsideSqlOption.java 2008-12-27 22:06:42 UTC (rev 1624) @@ -16,6 +16,7 @@ // ----------------------------------------------------- // Option // ------ + /** The request type of paging. */ protected String _pagingRequestType = "non"; protected boolean _dynamicBinding; @@ -23,6 +24,8 @@ /** The configuration of statement. (Nullable) */ protected StatementConfig _statementConfig; + protected String _sourcePagingRequestType = "non"; + // ----------------------------------------------------- // Information // ----------- @@ -59,6 +62,7 @@ // ==== public OutsideSqlOption copyOptionWithoutPaging() { final OutsideSqlOption copyOption = new OutsideSqlOption(); + copyOption.setPagingSourceRequestType(_pagingRequestType); if (isDynamicBinding()) { copyOption.dynamicBinding(); } @@ -103,6 +107,15 @@ _statementConfig = statementConfig; } + protected void setPagingSourceRequestType(String sourcePagingRequestType) { // Very + // Internal + _sourcePagingRequestType = sourcePagingRequestType; + } + + public boolean isSourcePagingRequestTypeAuto() { // Very Internal + return "auto".equals(_sourcePagingRequestType); + } + // ----------------------------------------------------- // Information // ----------- Modified: addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/cbean/outsidesql/executor/OutsideSqlBasicExecutor.java =================================================================== --- addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/cbean/outsidesql/executor/OutsideSqlBasicExecutor.java 2008-12-27 22:02:56 UTC (rev 1623) +++ addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/cbean/outsidesql/executor/OutsideSqlBasicExecutor.java 2008-12-27 22:06:42 UTC (rev 1624) @@ -2,15 +2,20 @@ import java.util.List; +import jp.sf.pal.addresslist.db.allcommon.bhv.core.BehaviorCommand; +import jp.sf.pal.addresslist.db.allcommon.bhv.core.BehaviorCommandInvoker; +import jp.sf.pal.addresslist.db.allcommon.bhv.core.command.AbstractOutsideSqlCommand; +import jp.sf.pal.addresslist.db.allcommon.bhv.core.command.OutsideSqlCallCommand; +import jp.sf.pal.addresslist.db.allcommon.bhv.core.command.OutsideSqlExecuteCommand; +import jp.sf.pal.addresslist.db.allcommon.bhv.core.command.OutsideSqlSelectListCommand; import jp.sf.pal.addresslist.db.allcommon.cbean.ListResultBean; import jp.sf.pal.addresslist.db.allcommon.cbean.ResultBeanBuilder; -import jp.sf.pal.addresslist.db.allcommon.cbean.outsidesql.OutsideSqlDao; import jp.sf.pal.addresslist.db.allcommon.cbean.outsidesql.OutsideSqlOption; import jp.sf.pal.addresslist.db.allcommon.cbean.outsidesql.ProcedurePmb; import jp.sf.pal.addresslist.db.allcommon.jdbc.StatementConfig; /** - * The executor of outside-sql.
+ * The executor of outside-SQL.
* *
  * {Basic}
@@ -33,7 +38,6 @@
  * 
  * {Option -- Dynamic}
  *   o dynamicBinding().selectList()
- * 
  * 
* * @author DBFlute(AutoGenerator) @@ -44,8 +48,8 @@ // ========= // Attribute // ========= - /** The DAO of outside-sql. (NotNull) */ - protected final OutsideSqlDao _outsideSqlDao; + /** The invoker of behavior command. (NotNull) */ + protected final BehaviorCommandInvoker _behaviorCommandInvoker; /** Table DB name. (NotNull) */ protected final String _tableDbName; @@ -60,9 +64,9 @@ // ========= // Constructor // =========== - public OutsideSqlBasicExecutor(OutsideSqlDao outsideSqlDao, - String tableDbName) { - this._outsideSqlDao = outsideSqlDao; + public OutsideSqlBasicExecutor( + BehaviorCommandInvoker behaviorCommandInvoker, String tableDbName) { + this._behaviorCommandInvoker = behaviorCommandInvoker; this._tableDbName = tableDbName; } @@ -80,12 +84,12 @@ * @param entityType The element type of entity. (NotNull) * @return The result bean of selected list. (NotNull) * @exception jp.sf.pal.addresslist.db.allcommon.exception.OutsideSqlNotFoundException - * When the outside-sql is not found. + * When the outside-SQL is not found. */ public ListResultBean selectList(String path, Object pmb, Class entityType) { - List resultList = _outsideSqlDao.selectList(path, pmb, - createOutsideSqlOption(), entityType); + List resultList = invoke(createSelectListCommand(path, pmb, + entityType)); return new ResultBeanBuilder(_tableDbName) .buildListResultBean(resultList); } @@ -102,10 +106,10 @@ * object. (Nullable) * @return The count of execution. * @exception jp.sf.pal.addresslist.db.allcommon.exception.OutsideSqlNotFoundException - * When the outside-sql is not found. + * When the outside-SQL is not found. */ public int execute(String path, Object pmb) { - return _outsideSqlDao.execute(path, pmb, createOutsideSqlOption()); + return invoke(createExecuteCommand(path, pmb)); } // [DBFlute-0.7.5] @@ -123,12 +127,53 @@ throw new IllegalArgumentException( "The argument of call() 'pmb' should not be null!"); } - _outsideSqlDao.call(pmb.getProcedureName(), pmb, - createOutsideSqlOption()); + invoke(createCallCommand(pmb.getProcedureName(), pmb)); } //========================================================================== // ========= + // Behavior Command + // ================ + protected BehaviorCommand> createSelectListCommand( + String path, Object pmb, Class entityType) { + final OutsideSqlSelectListCommand cmd = xsetupCommand( + new OutsideSqlSelectListCommand(), path, pmb); + cmd.setEntityType(entityType); + return cmd; + } + + protected BehaviorCommand createExecuteCommand(String path, + Object pmb) { + return xsetupCommand(new OutsideSqlExecuteCommand(), path, pmb); + } + + protected BehaviorCommand createCallCommand(String path, Object pmb) { + return xsetupCommand(new OutsideSqlCallCommand(), path, pmb); + } + + private > COMMAND xsetupCommand( + COMMAND command, String path, Object pmb) { + command.setTableDbName(_tableDbName); + _behaviorCommandInvoker.injectComponentProperty(command); + command.setOutsideSqlPath(path); + command.setParameterBean(pmb); + command.setOutsideSqlOption(createOutsideSqlOption()); + return command; + } + + /** + * Invoke the command of behavior. + * + * @param The type of result. + * @param behaviorCommand The command of behavior. (NotNull) + * @return The instance of result. (Nullable) + */ + protected RESULT invoke(BehaviorCommand behaviorCommand) { + return _behaviorCommandInvoker.invoke(behaviorCommand); + } + + //========================================================================== + // ========= // Option // ====== // ----------------------------------------------------- @@ -144,11 +189,11 @@ * # * * - * @return The cursor executor of outside-sql. (NotNull) + * @return The cursor executor of outside-SQL. (NotNull) */ public OutsideSqlCursorExecutor cursorHandling() { - return new OutsideSqlCursorExecutor(_outsideSqlDao, - createOutsideSqlOption()); + return new OutsideSqlCursorExecutor(_behaviorCommandInvoker, + createOutsideSqlOption(), _tableDbName); } /** @@ -161,11 +206,11 @@ * # * * - * @return The cursor executor of outside-sql. (NotNull) + * @return The cursor executor of outside-SQL. (NotNull) */ public OutsideSqlEntityExecutor entityHandling() { - return new OutsideSqlEntityExecutor(_outsideSqlDao, - createOutsideSqlOption()); + return new OutsideSqlEntityExecutor(_behaviorCommandInvoker, + createOutsideSqlOption(), _tableDbName); } // ----------------------------------------------------- @@ -191,7 +236,7 @@ public OutsideSqlPagingExecutor autoPaging() { final OutsideSqlOption option = createOutsideSqlOption(); option.autoPaging(); - return new OutsideSqlPagingExecutor(_outsideSqlDao, option, + return new OutsideSqlPagingExecutor(_behaviorCommandInvoker, option, _tableDbName); } @@ -215,7 +260,7 @@ public OutsideSqlPagingExecutor manualPaging() { final OutsideSqlOption option = createOutsideSqlOption(); option.manualPaging(); - return new OutsideSqlPagingExecutor(_outsideSqlDao, option, + return new OutsideSqlPagingExecutor(_behaviorCommandInvoker, option, _tableDbName); } Modified: addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/cbean/outsidesql/executor/OutsideSqlCursorExecutor.java =================================================================== --- addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/cbean/outsidesql/executor/OutsideSqlCursorExecutor.java 2008-12-27 22:02:56 UTC (rev 1623) +++ addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/cbean/outsidesql/executor/OutsideSqlCursorExecutor.java 2008-12-27 22:06:42 UTC (rev 1624) @@ -1,12 +1,14 @@ package jp.sf.pal.addresslist.db.allcommon.cbean.outsidesql.executor; -import jp.sf.pal.addresslist.db.allcommon.cbean.outsidesql.OutsideSqlDao; +import jp.sf.pal.addresslist.db.allcommon.bhv.core.BehaviorCommand; +import jp.sf.pal.addresslist.db.allcommon.bhv.core.BehaviorCommandInvoker; +import jp.sf.pal.addresslist.db.allcommon.bhv.core.command.OutsideSqlSelectCursorCommand; import jp.sf.pal.addresslist.db.allcommon.cbean.outsidesql.OutsideSqlOption; import jp.sf.pal.addresslist.db.allcommon.jdbc.CursorHandler; import jp.sf.pal.addresslist.db.allcommon.jdbc.StatementConfig; /** - * The cursor executor of outside-sql. + * The cursor executor of outside-SQL. * * @param The type of parameter-bean. * @author DBFlute(AutoGenerator) @@ -17,18 +19,25 @@ // ========= // Attribute // ========= - protected final OutsideSqlDao _outsideSqlDao; + /** The invoker of behavior command. (NotNull) */ + protected final BehaviorCommandInvoker _behaviorCommandInvoker; + /** The option of outside-SQL. (NotNull) */ protected final OutsideSqlOption _outsideSqlOption; + /** The DB name of table. (NotNull) */ + protected final String _tableDbName; + //========================================================================== // ========= // Constructor // =========== - public OutsideSqlCursorExecutor(OutsideSqlDao outsideSqlDao, - OutsideSqlOption outsideSqlOption) { - this._outsideSqlDao = outsideSqlDao; + public OutsideSqlCursorExecutor( + BehaviorCommandInvoker behaviorCommandInvoker, + OutsideSqlOption outsideSqlOption, String tableDbName) { + this._behaviorCommandInvoker = behaviorCommandInvoker; this._outsideSqlOption = outsideSqlOption; + this._tableDbName = tableDbName; } //========================================================================== @@ -44,14 +53,46 @@ * @param handler The handler of cursor. (NotNull) * @return The result object that the cursor handler returns. (Nullable) * @exception jp.sf.pal.addresslist.db.allcommon.exception.OutsideSqlNotFoundException - * When the outside-sql is not found. + * When the outside-SQL is not found. */ public Object selectCursor(String path, PARAMETER_BEAN pmb, CursorHandler handler) { - return _outsideSqlDao.selectCursor(path, pmb, _outsideSqlOption, + return invoke(createSelectCursorCommand(path, pmb, handler)); + } + + //========================================================================== + // ========= + // Behavior Command + // ================ + protected BehaviorCommand createSelectCursorCommand(String path, + PARAMETER_BEAN pmb, CursorHandler handler) { + return xsetupCommand(new OutsideSqlSelectCursorCommand(), path, pmb, handler); } + private OutsideSqlSelectCursorCommand xsetupCommand( + OutsideSqlSelectCursorCommand command, String path, + PARAMETER_BEAN pmb, CursorHandler handler) { + command.setTableDbName(_tableDbName); + _behaviorCommandInvoker.injectComponentProperty(command); + command.setOutsideSqlPath(path); + command.setParameterBean(pmb); + command.setOutsideSqlOption(_outsideSqlOption); + command.setCursorHandler(handler); + return command; + } + + /** + * Invoke the command of behavior. + * + * @param The type of result. + * @param behaviorCommand The command of behavior. (NotNull) + * @return The instance of result. (Nullable) + */ + protected RESULT invoke(BehaviorCommand behaviorCommand) { + return _behaviorCommandInvoker.invoke(behaviorCommand); + } + //========================================================================== // ========= // Option Modified: addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/cbean/outsidesql/executor/OutsideSqlEntityExecutor.java =================================================================== --- addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/cbean/outsidesql/executor/OutsideSqlEntityExecutor.java 2008-12-27 22:02:56 UTC (rev 1623) +++ addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/cbean/outsidesql/executor/OutsideSqlEntityExecutor.java 2008-12-27 22:06:42 UTC (rev 1624) @@ -2,14 +2,16 @@ import java.util.List; +import jp.sf.pal.addresslist.db.allcommon.bhv.core.BehaviorCommand; +import jp.sf.pal.addresslist.db.allcommon.bhv.core.BehaviorCommandInvoker; +import jp.sf.pal.addresslist.db.allcommon.bhv.core.command.OutsideSqlSelectListCommand; import jp.sf.pal.addresslist.db.allcommon.cbean.ConditionBeanContext; -import jp.sf.pal.addresslist.db.allcommon.cbean.outsidesql.OutsideSqlDao; import jp.sf.pal.addresslist.db.allcommon.cbean.outsidesql.OutsideSqlOption; import jp.sf.pal.addresslist.db.allcommon.jdbc.StatementConfig; import jp.sf.pal.addresslist.db.allcommon.util.SimpleSystemUtil; /** - * The cursor executor of outside-sql. + * The cursor executor of outside-SQL. * * @param The type of parameter-bean. * @author DBFlute(AutoGenerator) @@ -20,18 +22,25 @@ // ========= // Attribute // ========= - protected final OutsideSqlDao _outsideSqlDao; + /** The invoker of behavior command. (NotNull) */ + protected final BehaviorCommandInvoker _behaviorCommandInvoker; + /** The option of outside-SQL. (NotNull) */ protected final OutsideSqlOption _outsideSqlOption; + /** The DB name of table. (NotNull) */ + protected final String _tableDbName; + //========================================================================== // ========= // Constructor // =========== - public OutsideSqlEntityExecutor(OutsideSqlDao outsideSqlDao, - OutsideSqlOption outsideSqlOption) { - this._outsideSqlDao = outsideSqlDao; + public OutsideSqlEntityExecutor( + BehaviorCommandInvoker behaviorCommandInvoker, + OutsideSqlOption outsideSqlOption, String tableDbName) { + this._behaviorCommandInvoker = behaviorCommandInvoker; this._outsideSqlOption = outsideSqlOption; + this._tableDbName = tableDbName; } //========================================================================== @@ -48,14 +57,14 @@ * @param entityType The type of entity. (NotNull) * @return The selected entity. (Nullable) * @exception jp.sf.pal.addresslist.db.allcommon.exception.OutsideSqlNotFoundException - * When the outside-sql is not found. + * When the outside-SQL is not found. * @exception jp.sf.pal.addresslist.db.allcommon.exception.EntityDuplicatedException * When the entity is duplicated. */ public ENTITY selectEntity(String path, PARAMETER_BEAN pmb, Class entityType) { - final List ls = _outsideSqlDao.selectList(path, pmb, - _outsideSqlOption, entityType); + final List ls = invoke(createSelectListCommand(path, pmb, + entityType)); if (ls.isEmpty()) { return null; } @@ -76,7 +85,7 @@ * @param entityType The type of entity. (NotNull) * @return The selected entity. (Nullable) * @exception jp.sf.pal.addresslist.db.allcommon.exception.OutsideSqlNotFoundException - * When the outside-sql is not found. + * When the outside-SQL is not found. * @exception jp.sf.pal.addresslist.db.allcommon.exception.EntityAlreadyDeletedException * When the entity has already been deleted(not found). * @exception jp.sf.pal.addresslist.db.allcommon.exception.EntityDuplicatedException @@ -84,8 +93,8 @@ */ public ENTITY selectEntityWithDeletedCheck(String path, PARAMETER_BEAN pmb, Class entityType) { - final List ls = _outsideSqlDao.selectList(path, pmb, - _outsideSqlOption, entityType); + final List ls = invoke(createSelectListCommand(path, pmb, + entityType)); if (ls == null || ls.isEmpty()) { throwEntityAlreadyDeletedException(buildSearch4LogString(path, pmb, entityType)); @@ -127,6 +136,39 @@ //========================================================================== // ========= + // Behavior Command + // ================ + protected BehaviorCommand> createSelectListCommand( + String path, PARAMETER_BEAN pmb, Class entityType) { + return xsetupCommand(new OutsideSqlSelectListCommand(), path, + pmb, entityType); + } + + private OutsideSqlSelectListCommand xsetupCommand( + OutsideSqlSelectListCommand command, String path, + PARAMETER_BEAN pmb, Class entityType) { + command.setTableDbName(_tableDbName); + _behaviorCommandInvoker.injectComponentProperty(command); + command.setOutsideSqlPath(path); + command.setParameterBean(pmb); + command.setOutsideSqlOption(_outsideSqlOption); + command.setEntityType(entityType); + return command; + } + + /** + * Invoke the command of behavior. + * + * @param The type of result. + * @param behaviorCommand The command of behavior. (NotNull) + * @return The instance of result. (Nullable) + */ + protected RESULT invoke(BehaviorCommand behaviorCommand) { + return _behaviorCommandInvoker.invoke(behaviorCommand); + } + + //========================================================================== + // ========= // Option // ====== public OutsideSqlEntityExecutor configure( Modified: addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/cbean/outsidesql/executor/OutsideSqlPagingExecutor.java =================================================================== --- addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/cbean/outsidesql/executor/OutsideSqlPagingExecutor.java 2008-12-27 22:02:56 UTC (rev 1623) +++ addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/cbean/outsidesql/executor/OutsideSqlPagingExecutor.java 2008-12-27 22:06:42 UTC (rev 1624) @@ -3,18 +3,20 @@ import java.util.List; import jp.sf.pal.addresslist.db.allcommon.DBFluteConfig; +import jp.sf.pal.addresslist.db.allcommon.bhv.core.BehaviorCommand; +import jp.sf.pal.addresslist.db.allcommon.bhv.core.BehaviorCommandInvoker; +import jp.sf.pal.addresslist.db.allcommon.bhv.core.command.OutsideSqlSelectListCommand; import jp.sf.pal.addresslist.db.allcommon.cbean.ListResultBean; import jp.sf.pal.addresslist.db.allcommon.cbean.PagingBean; import jp.sf.pal.addresslist.db.allcommon.cbean.PagingHandler; import jp.sf.pal.addresslist.db.allcommon.cbean.PagingInvoker; import jp.sf.pal.addresslist.db.allcommon.cbean.PagingResultBean; import jp.sf.pal.addresslist.db.allcommon.cbean.ResultBeanBuilder; -import jp.sf.pal.addresslist.db.allcommon.cbean.outsidesql.OutsideSqlDao; import jp.sf.pal.addresslist.db.allcommon.cbean.outsidesql.OutsideSqlOption; import jp.sf.pal.addresslist.db.allcommon.jdbc.StatementConfig; /** - * The paging executor of outsideSql. + * The paging executor of outside-SQL. * * @author DBFlute(AutoGenerator) */ @@ -24,10 +26,10 @@ // ========= // Attribute // ========= - /** The DAO of outsideSql. (NotNull) */ - protected final OutsideSqlDao _outsideSqlDao; + /** The invoker of behavior command. (NotNull) */ + protected final BehaviorCommandInvoker _behaviorCommandInvoker; - /** The option of outsideSql. (NotNull) */ + /** The option of outside-SQL. (NotNull) */ protected final OutsideSqlOption _outsideSqlOption; /** The DB name of table. (NotNull) */ @@ -37,9 +39,10 @@ // ========= // Constructor // =========== - public OutsideSqlPagingExecutor(OutsideSqlDao outsideSqlDao, + public OutsideSqlPagingExecutor( + BehaviorCommandInvoker behaviorCommandInvoker, OutsideSqlOption outsideSqlOption, String tableDbName) { - this._outsideSqlDao = outsideSqlDao; + this._behaviorCommandInvoker = behaviorCommandInvoker; this._outsideSqlOption = outsideSqlOption; this._tableDbName = tableDbName; } @@ -81,13 +84,13 @@ * @param entityType The type of result entity. (NotNull) * @return The result bean of paged list. (NotNull) * @exception com.example.dbflute.basic.dbflute.allcommon.exception.OutsideSqlNotFoundException - * When the outside-sql is not found. + * When the outside-SQL is not found. */ public ListResultBean selectList(String path, PagingBean pmb, Class entityType) { setupScrollableCursorIfNeeds(); - List resultList = _outsideSqlDao.selectList(path, pmb, - _outsideSqlOption, entityType); + List resultList = invoke(createSelectListCommand(path, pmb, + entityType)); return new ResultBeanBuilder(_tableDbName) .buildListResultBean(resultList); } @@ -141,7 +144,7 @@ * # -- ELSE select count(*) * # /[*]END[*]/ * # ... - * o It's S2Dao's restriction...Sorry + * o It's restriction...Sorry * * * @param The type of entity. @@ -150,14 +153,11 @@ * @param entityType The type of result entity. (NotNull) * @return The result bean of paging. (NotNull) * @exception jp.sf.pal.addresslist.db.allcommon.exception.OutsideSqlNotFoundException - * When the outside-sql is not found. + * When the outside-SQL is not found. */ public PagingResultBean selectPage(final String path, final PagingBean pmb, final Class entityType) { - final OutsideSqlOption countOption = _outsideSqlOption - .copyOptionWithoutPaging(); - final OutsideSqlEntityExecutor countExecutor = new OutsideSqlEntityExecutor( - _outsideSqlDao, countOption); + final OutsideSqlEntityExecutor countExecutor = createCountExecutor(); final PagingHandler handler = new PagingHandler() { public PagingBean getPagingBean() { return pmb; @@ -182,6 +182,13 @@ return invoker.invokePaging(handler); } + protected OutsideSqlEntityExecutor createCountExecutor() { + final OutsideSqlOption countOption = _outsideSqlOption + .copyOptionWithoutPaging(); + return new OutsideSqlEntityExecutor( + _behaviorCommandInvoker, countOption, _tableDbName); + } + protected void setupScrollableCursorIfNeeds() { if (!_outsideSqlOption.isAutoPaging()) { return; @@ -207,6 +214,39 @@ //========================================================================== // ========= + // Behavior Command + // ================ + protected BehaviorCommand> createSelectListCommand( + String path, Object pmb, Class entityType) { + return xsetupCommand(new OutsideSqlSelectListCommand(), path, + pmb, entityType); + } + + private OutsideSqlSelectListCommand xsetupCommand( + OutsideSqlSelectListCommand command, String path, + Object pmb, Class entityType) { + command.setTableDbName(_tableDbName); + _behaviorCommandInvoker.injectComponentProperty(command); + command.setOutsideSqlPath(path); + command.setParameterBean(pmb); + command.setOutsideSqlOption(_outsideSqlOption); + command.setEntityType(entityType); + return command; + } + + /** + * Invoke the command of behavior. + * + * @param The type of result. + * @param behaviorCommand The command of behavior. (NotNull) + * @return The instance of result. (Nullable) + */ + protected RESULT invoke(BehaviorCommand behaviorCommand) { + return _behaviorCommandInvoker.invoke(behaviorCommand); + } + + //========================================================================== + // ========= // Option // ====== public OutsideSqlPagingExecutor configure(StatementConfig statementConfig) { Modified: addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/cbean/sqlclause/AbstractSqlClause.java =================================================================== --- addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/cbean/sqlclause/AbstractSqlClause.java 2008-12-27 22:02:56 UTC (rev 1623) +++ addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/cbean/sqlclause/AbstractSqlClause.java 2008-12-27 22:06:42 UTC (rev 1624) @@ -17,23 +17,23 @@ import jp.sf.pal.addresslist.db.allcommon.dbmeta.DBMetaInstanceHandler; import jp.sf.pal.addresslist.db.allcommon.dbmeta.info.ColumnInfo; import jp.sf.pal.addresslist.db.allcommon.dbmeta.info.ForeignInfo; -import jp.sf.pal.addresslist.db.allcommon.dbmeta.info.UniqueInfo; import jp.sf.pal.addresslist.db.allcommon.util.SimpleAssertUtil; import jp.sf.pal.addresslist.db.allcommon.util.SimpleStringUtil; import jp.sf.pal.addresslist.db.allcommon.util.SimpleSystemUtil; /** - * The abstract class of SqlClause. + * The abstract class of SQL clause. * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public abstract class AbstractSqlClause implements SqlClause { //========================================================================== // ========= // Definition // ========== + protected static final SelectClauseType DEFAULT_SELECT_CLAUSE_TYPE = SelectClauseType.COLUMNS; + protected static final String SELECT_HINT = "/*$dto.selectHint*/"; //========================================================================== @@ -43,12 +43,16 @@ // ----------------------------------------------------- // Basic // ----- - /** Target table name. */ + /** The name of table. */ protected final String _tableName; // ----------------------------------------------------- // Clause Resource // --------------- + // /- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + // - + // The resources that are not often used to are lazy-loaded for performance. + // - - - - - - - - - -/ /** * Selected select column map. map:{tableAliasName : map:{columnName : * selectColumnInfo}} @@ -57,48 +61,48 @@ /** * Specified select column map. map:{ tableAliasName = map:{ columnName : - * null } } + * null } } (Nullable: This is lazy-loaded) */ - protected Map> _specifiedSelectColumnMap;// [ + protected Map> _specifiedSelectColumnMap; // [ // DBFlute // - - // 0.7.4 - // ] + // 0.7 + // .4] - /** Specified derive sub-query map. */ - protected Map _specifiedDeriveSubQueryMap;// [DBFlute-0.7.4] + /** Specified derive sub-query map. (Nullable: This is lazy-loaded) */ + protected Map _specifiedDeriveSubQueryMap; //[DBFlute-0.7.4] - /** Included select column map. */ - protected Map _includedSelectColumnMap = new LinkedHashMap(); - /** * The map of real column and alias of select clause. map:{realColumnName : * aliasName} */ - protected Map _selectClauseRealColumnAliasMap = new HashMap();// Without + protected Map _selectClauseRealColumnAliasMap = new HashMap(); // Without // linked // ! + /** The type of select clause. (NotNull) */ + protected SelectClauseType _selectClauseType = DEFAULT_SELECT_CLAUSE_TYPE; + + /** The previous type of select clause. (Nullable: The default is null) */ + protected SelectClauseType _previousSelectClauseType; + /** Outer join map. */ protected Map _outerJoinMap = new LinkedHashMap(); - /** Where list. */ + /** The list of where clause. */ protected List _whereList = new ArrayList(); /** Inline where list for BaseTable. */ protected List _baseTableInlineWhereList = new ArrayList(); - /** Order-by clause. */ + /** The clause of order-by. (NotNull) */ protected final OrderByClause _orderByClause = new OrderByClause(); - /** Union clause list. */ - protected List _unionQueryInfoList = new ArrayList(); + /** The list of union clause. (Nullable: This is lazy-loaded) */ + protected List _unionQueryInfoList; - /** Is included-select-column effective? Default value is false. */ - protected boolean _isIncludedSelectColumnEffective = false; - /** Is order-by effective? Default value is false. */ protected boolean _isOrderByEffective = false; @@ -138,7 +142,7 @@ // ----------------------------------------------------- // Optional Info // ------------- - protected boolean _formatClause; + protected boolean _formatClause = true; //========================================================================== // ========= @@ -163,28 +167,20 @@ StringBuilder sb = new StringBuilder(512); sb.append(getSelectClause()); sb.append(" "); - sb.append(buildClauseWithoutMainSelect(false)); + sb.append(buildClauseWithoutMainSelect()); String sql = sb.toString(); - return filterSubQueryIndent(sql); + sql = filterUnionCountOrScalar(sql); + sql = filterSubQueryIndent(sql); + return sql; } - public String getClausePKOnly() { + protected String buildClauseWithoutMainSelect() { StringBuilder sb = new StringBuilder(512); - sb.append(getSelectClausePKOnly()); - sb.append(" "); - sb.append(buildClauseWithoutMainSelect(true)); - String sql = sb.toString(); - return filterSubQueryIndent(sql); - } - - protected String buildClauseWithoutMainSelect(boolean pkonly) { - StringBuilder sb = new StringBuilder(512); sb.append(getFromClause()); sb.append(getFromHint()); sb.append(" "); sb.append(getWhereClause()); - String unionClause = buildUnionClause(pkonly ? getSelectClausePKOnly() - : getSelectClause()); + String unionClause = buildUnionClause(getSelectClause()); // Delete template mark! (At the future this will be unnecessary.) unionClause = replaceString(unionClause, getUnionWhereClauseMark(), "");// Required @@ -225,29 +221,45 @@ protected String buildUnionClause(String selectClause) { StringBuilder sb = new StringBuilder(); - for (final Iterator ite = _unionQueryInfoList - .iterator(); ite.hasNext();) { - final UnionQueryInfo unionQueryInfo = (UnionQueryInfo) ite.next(); - final String unionQueryClause = unionQueryInfo - .getUnionQueryClause(); - final boolean unionAll = unionQueryInfo.isUnionAll(); - if (isFormatClauseEffective()) { + if (hasUnionQuery()) { + for (Iterator ite = _unionQueryInfoList.iterator(); ite + .hasNext();) { + UnionQueryInfo unionQueryInfo = (UnionQueryInfo) ite.next(); + String unionQueryClause = unionQueryInfo.getUnionQueryClause(); + boolean unionAll = unionQueryInfo.isUnionAll(); sb.append(getLineSeparator()); - } - sb.append(unionAll ? " union all " : " union "); - if (isFormatClauseEffective()) { + sb.append(unionAll ? " union all " : " union "); sb.append(getLineSeparator()); + sb.append(selectClause).append(" ").append(unionQueryClause); } - sb.append(selectClause).append(" ").append(unionQueryClause); } return sb.toString(); } + protected String filterUnionCountOrScalar(String sql) { + if (!isSelectClauseTypeCountOrScalar() || !hasUnionQuery()) { + return sql; + } + String selectClause = buildSelectClauseCountOrScalar("dfmain"); + String ln = getLineSeparator(); + String beginMark = resolveSubQueryBeginMark("dfmain") + ln; + String endMark = resolveSubQueryEndMark("dfmain"); + return selectClause + ln + " from (" + beginMark + sql + ln + + " ) dfmain" + endMark; + } + //========================================================================== // ========= // Clause Parts // ============ public String getSelectClause() { + // [DBFlute-0.8.6] + if (isSelectClauseTypeCountOrScalar() && !hasUnionQuery()) { + return buildSelectClauseCountOrScalar("dflocal"); + } + // /- - - - - - - - - - - - - - - - - - - - - - - - + // The type of select clause is COLUMNS since here. + // - - - - - - - - - -/ StringBuilder sb = new StringBuilder(); DBMeta dbmeta = DBMetaInstanceHandler.findDBMeta(_tableName); List columnInfoList = dbmeta.getColumnInfoList(); @@ -265,7 +277,19 @@ // [DBFlute-0.7.4] if (existsSpecifiedLocal && !localSpecifiedMap.containsKey(columnName)) { - continue; + if (isSelectClauseTypeCountOrScalar() && hasUnionQuery()) { + // Here it must be with union query. + // So the primary Key is target for saving unique. + // But if it does not have primary keys, all column is + // target. + if (dbmeta.hasPrimaryKey()) { + if (!columnInfo.isPrimary()) { + continue; + } + } + } else { + continue; + } } if (sb.length() > 0) { @@ -307,10 +331,6 @@ selectColumnInfo.getColumnAliasName()); } } - if (_isIncludedSelectColumnEffective - && !_includedSelectColumnMap.isEmpty()) { - sb.append(getIncludedSelectColumnClause()); - } // [DBFlute-0.7.4] if (_specifiedDeriveSubQueryMap != null @@ -318,9 +338,7 @@ Collection deriveSubQuerySet = _specifiedDeriveSubQueryMap .values(); for (String deriveSubQuery : deriveSubQuerySet) { - if (isFormatClauseEffective()) { - sb.append(getLineSeparator()).append(" "); - } + sb.append(getLineSeparator()).append(" "); sb.append(", ").append(deriveSubQuery); } } @@ -328,67 +346,83 @@ return sb.toString(); } - public String getSelectClausePKOnly() { - StringBuilder sb = new StringBuilder(); - DBMeta dbmeta = DBMetaInstanceHandler.findDBMeta(_tableName); - UniqueInfo uniqueInfo = dbmeta.getPrimaryUniqueInfo(); - List columnInfoList = uniqueInfo.getUniqueColumnList(); - for (ColumnInfo columnInfo : columnInfoList) { - String columnName = columnInfo.getColumnDbName(); - if (sb.length() > 0) { - sb.append(", "); - } else { - sb.append("select").append(SELECT_HINT).append(" "); - } - String realColumnName = getLocalTableAliasName() + "." + columnName; - sb.append(realColumnName).append(" as ").append(columnName); - _selectClauseRealColumnAliasMap.put(realColumnName, columnName); + protected boolean isSelectClauseTypeCountOrScalar() { + if (_selectClauseType.equals(SelectClauseType.COUNT)) { + return true; + } else if (_selectClauseType.equals(SelectClauseType.MAX)) { + return true; + } else if (_selectClauseType.equals(SelectClauseType.MIN)) { + return true; + } else if (_selectClauseType.equals(SelectClauseType.SUM)) { + return true; + } else if (_selectClauseType.equals(SelectClauseType.AVG)) { + return true; } - if (_isIncludedSelectColumnEffective - && !_includedSelectColumnMap.isEmpty()) { - sb.append(getIncludedSelectColumnClause()); - } + return false; + } - // [DBFlute-0.7.4] - if (_specifiedDeriveSubQueryMap != null - && !_specifiedDeriveSubQueryMap.isEmpty()) { - Collection deriveSubQuerySet = _specifiedDeriveSubQueryMap - .values(); - for (String deriveSubQuery : deriveSubQuerySet) { - if (isFormatClauseEffective()) { - sb.append(getLineSeparator()).append(" "); - } - sb.append(", ").append(deriveSubQuery); - } + protected String buildSelectClauseCountOrScalar(String aliasName) { + if (_selectClauseType.equals(SelectClauseType.COUNT)) { + return buildSelectClauseCount(); + } else if (_selectClauseType.equals(SelectClauseType.MAX)) { + return buildSelectClauseMax(aliasName); + } else if (_selectClauseType.equals(SelectClauseType.MIN)) { + return buildSelectClauseMin(aliasName); + } else if (_selectClauseType.equals(SelectClauseType.SUM)) { + return buildSelectClauseSum(aliasName); + } else if (_selectClauseType.equals(SelectClauseType.AVG)) { + return buildSelectClauseAvg(aliasName); } + String msg = "The type of select clause is not for scalar:"; + msg = msg + " type=" + _selectClauseType; + throw new IllegalStateException(msg); + } - return sb.toString(); + protected String buildSelectClauseCount() { + return "select count(*)"; } - public String getSelectHint() { - return createSelectHint(); + protected String buildSelectClauseMax(String aliasName) { + String columnName = getSpecifiedColumnNameAsOne(); + assertScalarSelectSpecifiedColumnOnlyOne(columnName); + return "select max(" + aliasName + "." + columnName + ")"; } - public String getIncludedSelectColumnClause() { - StringBuilder sb = new StringBuilder(); - int count = 0; - for (Iterator ite = _includedSelectColumnMap.keySet() - .iterator(); ite.hasNext(); count++) { - String aliasName = ite.next(); - String realColumnName = (String) _includedSelectColumnMap - .get(aliasName); - sb.append(", ").append(realColumnName).append(" as ").append( - aliasName); - _selectClauseRealColumnAliasMap.put(realColumnName, aliasName); + protected String buildSelectClauseMin(String aliasName) { + String columnName = getSpecifiedColumnNameAsOne(); + assertScalarSelectSpecifiedColumnOnlyOne(columnName); + return "select min(" + aliasName + "." + columnName + ")"; + } + + protected String buildSelectClauseSum(String aliasName) { + String columnName = getSpecifiedColumnNameAsOne(); + assertScalarSelectSpecifiedColumnOnlyOne(columnName); + return "select sum(" + aliasName + "." + columnName + ")"; + } + + protected String buildSelectClauseAvg(String aliasName) { + String columnName = getSpecifiedColumnNameAsOne(); + assertScalarSelectSpecifiedColumnOnlyOne(columnName); + return "select avg(" + aliasName + "." + columnName + ")"; + } + + protected void assertScalarSelectSpecifiedColumnOnlyOne(String columnName) { + if (columnName != null) { + return; } - return sb.toString(); + String msg = "The specified column exists one"; + msg = msg + " when the type of select clause is for scalar:"; + msg = msg + " specifiedSelectColumnMap=" + _specifiedSelectColumnMap; + throw new IllegalStateException(msg); } + public String getSelectHint() { + return createSelectHint(); + } + public String getFromClause() { StringBuilder sb = new StringBuilder(); - if (isFormatClauseEffective()) { - sb.append(getLineSeparator()).append(" "); - } + sb.append(getLineSeparator()).append(" "); sb.append("from "); if (_baseTableInlineWhereList.isEmpty()) { sb.append(_tableName).append(" dflocal"); @@ -417,9 +451,7 @@ Map joinOnMap = joinInfo.getJoinOnMap(); assertJoinOnMapNotEmpty(joinOnMap, aliasName); - if (isFormatClauseEffective()) { - sb.append(getLineSeparator()).append(" "); - } + sb.append(getLineSeparator()).append(" "); sb.append(" left outer join "); if (inlineWhereClauseList.isEmpty()) { sb.append(joinTableName); @@ -489,16 +521,12 @@ String clauseElement = (String) ite.next(); clauseElement = filterWhereClauseSimply(clauseElement); if (count == 0) { - if (isFormatClauseEffective()) { - sb.append(getLineSeparator()).append(" "); - } + sb.append(getLineSeparator()).append(" "); sb.append("where ").append( template ? getWhereFirstConditionMark() : "").append( clauseElement); } else { - if (isFormatClauseEffective()) { - sb.append(getLineSeparator()).append(" "); - } + sb.append(getLineSeparator()).append(" "); sb.append(" and ").append(clauseElement); } } @@ -510,7 +538,7 @@ public String getOrderByClause() { String orderByClause = null; - if (!_unionQueryInfoList.isEmpty()) { + if (hasUnionQuery()) { if (_selectClauseRealColumnAliasMap == null || _selectClauseRealColumnAliasMap.isEmpty()) { String msg = "The selectClauseColumnAliasMap should not be null or empty when union query exists: " @@ -522,8 +550,7 @@ } else { orderByClause = _orderByClause.getOrderByClause(); } - if (isFormatClauseEffective() && orderByClause != null - && orderByClause.trim().length() > 0) { + if (orderByClause != null && orderByClause.trim().length() > 0) { return getLineSeparator() + " " + orderByClause; } else { return orderByClause; @@ -532,8 +559,7 @@ public String getSqlSuffix() { String sqlSuffix = createSqlSuffix(); - if (isFormatClauseEffective() && sqlSuffix != null - && sqlSuffix.trim().length() > 0) { + if (sqlSuffix != null && sqlSuffix.trim().length() > 0) { return getLineSeparator() + sqlSuffix; } else { return sqlSuffix; @@ -542,20 +568,6 @@ //========================================================================== // ========= - // Copy Parts - // ========== - public void copyIncludedSelectColumn(SqlClause sqlClause) { - Set keySet = _includedSelectColumnMap.keySet(); - for (Iterator ite = keySet.iterator(); ite.hasNext();) { - String aliasName = ite.next(); - String realColumnName = (String) _includedSelectColumnMap - .get(aliasName); - sqlClause.registerIncludedSelectColumn(aliasName, realColumnName); - } - } - - //========================================================================== - // ========= // SelectedSelectColumn // ==================== /** @@ -644,26 +656,6 @@ //========================================================================== // ========= - // IncludedSelectColumn - // ==================== - public void ignoreIncludedSelectColumn() { - _isIncludedSelectColumnEffective = false; - } - - public void makeIncludedSelectColumnEffective() { - if (!_includedSelectColumnMap.isEmpty()) { - _isIncludedSelectColumnEffective = true; - } - } - - public void registerIncludedSelectColumn(String aliasName, - String realColumnName) { - _isIncludedSelectColumnEffective = true; - _includedSelectColumnMap.put(aliasName, realColumnName); - } - - //========================================================================== - // ========= // OuterJoin // ========= public void registerOuterJoin(String joinTableName, String aliasName, @@ -1079,12 +1071,23 @@ public void registerUnionQuery(String unionQueryClause, boolean unionAll) { assertStringNotNullAndNotTrimmedEmpty("unionQueryClause", unionQueryClause); - final UnionQueryInfo unionQueryInfo = new UnionQueryInfo(); + UnionQueryInfo unionQueryInfo = new UnionQueryInfo(); unionQueryInfo.setUnionQueryClause(unionQueryClause); unionQueryInfo.setUnionAll(unionAll); + addUnionQueryInfo(unionQueryInfo); + } + + protected void addUnionQueryInfo(UnionQueryInfo unionQueryInfo) { + if (_unionQueryInfoList == null) { + _unionQueryInfoList = new ArrayList(); + } _unionQueryInfoList.add(unionQueryInfo); } + public boolean hasUnionQuery() { + return _unionQueryInfoList != null && !_unionQueryInfoList.isEmpty(); + } + protected static class UnionQueryInfo { protected String _unionQueryClause; @@ -1425,18 +1428,6 @@ //========================================================================== // ========= - // Format Clause - // ============= - public boolean isFormatClauseEffective() { - return _formatClause; - } - - public void makeFormatClauseEffective() { - _formatClause = true; - } - - //========================================================================== - // ========= // Sub Query Indent // ================ public String resolveSubQueryBeginMark(String subQueryIdentity) { @@ -1462,13 +1453,11 @@ } public String filterSubQueryIndent(String sql) { - return isFormatClauseEffective() ? filterSubQueryIndent(sql, "") : sql; + return filterSubQueryIndent(sql, "", sql); } - protected String filterSubQueryIndent(String sql, String preIndent) { - if (!isFormatClauseEffective()) { - return sql; - } + protected String filterSubQueryIndent(String sql, String preIndent, + String originalSql) { final String lineSeparator = getLineSeparator(); if (!sql.contains(getSubQueryBeginMarkPrefix())) { return sql; @@ -1509,7 +1498,8 @@ // - - - - - - - - // In begin to end // - - - - - - - - - if (line.contains(endMarkPrefix + subQueryIdentity)) {// The end + if (line.contains(endMarkPrefix + subQueryIdentity)) { // The + // end final int markIndex = line.indexOf(endMarkPrefix); final int terminalIndex = line.indexOf(identityTerminal); if (terminalIndex < 0) { @@ -1521,7 +1511,7 @@ + line.substring(terminalIndex + terminalLength); subSb.append(clause).append(getLineSeparator()); final String currentSql = filterSubQueryIndent(subSb - .toString(), preIndent + indent); + .toString(), preIndent + indent, originalSql); mainSb.append(currentSql); throughBegin = false; throughBeginFirst = false; @@ -1544,10 +1534,11 @@ + getLineSeparator(); msg = msg + subQueryIdentity + getLineSeparator(); msg = msg + getLineSeparator() + "[Before Filter]" - + getLineSeparator(); - msg = msg + sql + getLineSeparator(); + + getLineSeparator() + sql; msg = msg + getLineSeparator() + "[After Filter]" + getLineSeparator() + filteredSql; + msg = msg + getLineSeparator() + "[Original SQL]" + + getLineSeparator() + originalSql; throw new SubQueryIndentFailureException(msg); } if (filteredSql.contains(beginMarkPrefix)) { @@ -1556,10 +1547,11 @@ + getLineSeparator(); msg = msg + subQueryIdentity + getLineSeparator(); msg = msg + getLineSeparator() + "[Before Filter]" - + getLineSeparator(); - msg = msg + sql + getLineSeparator(); + + getLineSeparator() + sql; msg = msg + getLineSeparator() + "[After Filter]" + getLineSeparator() + filteredSql; + msg = msg + getLineSeparator() + "[Original SQL]" + + getLineSeparator() + originalSql; throw new SubQueryIndentFailureException(msg); } return filteredSql; @@ -1592,7 +1584,7 @@ } if (!_specifiedSelectColumnMap.containsKey(tableAliasName)) { _specifiedSelectColumnMap.put(tableAliasName, - new HashMap()); + new LinkedHashMap()); } Map elementMap = _specifiedSelectColumnMap .get(tableAliasName); @@ -1666,10 +1658,7 @@ getUnionWhereFirstConditionMark(), ""); final StringBuilder sb = new StringBuilder(); - String ln = ""; - if (isFormatClauseEffective()) { - ln = getLineSeparator(); - } + String ln = getLineSeparator(); sb.append("update ").append(_tableName).append(ln); int index = 0; // It is guaranteed that the map has one or more elements. @@ -1728,10 +1717,7 @@ final String subQuery = filterSubQueryIndent(selectClause + " " + fromWhereClause); final StringBuilder sb = new StringBuilder(); - String ln = ""; - if (isFormatClauseEffective()) { - ln = getLineSeparator(); - } + String ln = getLineSeparator(); sb.append("delete from ").append(_tableName).append(ln); sb.append(" where ").append(primaryKeyName); sb.append(" in (").append(ln).append(subQuery).append(ln).append( @@ -1760,6 +1746,29 @@ return false; } + // [DBFlute-0.8.6] + //========================================================================== + // ========= + // Select Clause Type + // ================== + public void classifySelectClauseType(SelectClauseType selectClauseType) { + changeSelectClauseType(selectClauseType); + } + + protected void changeSelectClauseType(SelectClauseType selectClauseType) { + savePreviousSelectClauseType(); + _selectClauseType = selectClauseType; + } + + protected void savePreviousSelectClauseType() { + _previousSelectClauseType = _selectClauseType; + } + + public void rollbackSelectClauseType() { + _selectClauseType = _previousSelectClauseType != null ? _previousSelectClauseType + : DEFAULT_SELECT_CLAUSE_TYPE; + } + // [DBFlute-0.7.5] //========================================================================== // ========= Modified: addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/cbean/sqlclause/SqlClause.java =================================================================== --- addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/cbean/sqlclause/SqlClause.java 2008-12-27 22:02:56 UTC (rev 1623) +++ addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/cbean/sqlclause/SqlClause.java 2008-12-27 22:06:42 UTC (rev 1624) @@ -7,7 +7,7 @@ import jp.sf.pal.addresslist.db.allcommon.cbean.cvalue.ConditionValue; /** - * The interface of SQL-clause. + * The interface of SQL clause. * * @author DBFlute(AutoGenerator) */ @@ -35,21 +35,6 @@ */ public String getClause(); - /** - * Get clause of all parts as PK-only. - * - *
-     * # 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
-     * 
- * - * @return The clause of all parts as PK-Only. (NotNull) - */ - public String getClausePKOnly(); - // ----------------------------------------------------- // Fragment Clause // --------------- @@ -92,14 +77,6 @@ public String getSelectClause(); /** - * Get The clause of 'select' as PK-only. This is an internal method. - * - * @return The clause of select PK-only. {[select ...] from table...} - * (NotNull) - */ - public String getSelectClausePKOnly(); - - /** * Get the hint of 'select'. This is an internal method. * * @return The hint of 'select'. {select [select-hint] * from table...} @@ -108,14 +85,6 @@ public String getSelectHint(); /** - * Get the clause of included-select-column. This is an internal method. - * - * @return The clause of included-select-column. {select ... , - * [included-select-column clause] from table...} (NotNull) - */ - public String getIncludedSelectColumnClause(); - - /** * Get the clause of 'from'. This is an internal method. * * @return The clause of 'from'. (NotNull) @@ -162,17 +131,6 @@ //========================================================================== // ========= - // Copy Parts - // ========== - /** - * Copy included-select-column. - * - * @param sqlClause SQL-clause. (NotNull) - */ - public void copyIncludedSelectColumn(SqlClause sqlClause); - - //========================================================================== - // ========= // SelectedSelectColumn // ==================== /** @@ -189,30 +147,6 @@ //========================================================================== // ========= - // IncludedSelectColumn - // ==================== - /** - * Ignore included-select-column. - */ - public void ignoreIncludedSelectColumn(); - - /** - * Make included-select-column effective. - */ - public void makeIncludedSelectColumnEffective(); - - /** - * Register included-select-column. - * - * @param aliasName The alias name of the included-select-column. (NotNull) - * @param realColumnName The real column name of the included-select-column. - * (NotNull) - */ - public void registerIncludedSelectColumn(String aliasName, - String realColumnName); - - //========================================================================== - // ========= // OuterJoin // ========= /** @@ -340,6 +274,8 @@ // ===== public void registerUnionQuery(String unionClause, boolean unionAll); + public boolean hasUnionQuery(); + //========================================================================== // ========= // FetchScope @@ -561,14 +497,6 @@ //========================================================================== // ========= - // Format Clause - // ============= - public boolean isFormatClauseEffective(); - - public void makeFormatClauseEffective(); - - //========================================================================== - // ========= // Sub Query Indent // ================ public String resolveSubQueryBeginMark(String subQueryIdentity); @@ -588,8 +516,17 @@ public boolean hasSpecifiedDeriveSubQuery(String aliasName); + /** + * Get the name of only one specified column. + * + * @return The name of only one specified column. (Nullable: If it's not + * found or duplicated, it returns null) + */ public String getSpecifiedColumnNameAsOne(); + /** + * Clear specified select columns. + */ public void clearSpecifiedSelectColumn(); // [DBFlute-0.7.5] @@ -621,4 +558,29 @@ */ public boolean isUniqueConstraintException(String sqlState, Integer errorCode); + + // [DBFlute-0.8.6] + //========================================================================== + // ========= + // Select Clause Type + // ================== + /** + * Classify the type of select clause into specified type. + * + * @param selectClauseType The type of select clause. (NotNull) + */ + public void classifySelectClauseType(SelectClauseType selectClauseType); + + /** + * Roll-back the type of select clause into previous one. If it has no + * change, classify its type into default type. + */ + public void rollbackSelectClauseType(); + + /** + * The type of select clause. + */ + public static enum SelectClauseType { + COLUMNS, COUNT, MAX, MIN, SUM, AVG + } } Modified: addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/cbean/sqlclause/SqlClauseOracle.java =================================================================== --- addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/cbean/sqlclause/SqlClauseOracle.java 2008-12-27 22:02:56 UTC (rev 1623) +++ addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/cbean/sqlclause/SqlClauseOracle.java 2008-12-27 22:06:42 UTC (rev 1624) @@ -71,12 +71,7 @@ if (!isFetchStartIndexSupported() && !isFetchSizeSupported()) { return; } - String ln = null; - if (isFormatClauseEffective()) { - ln = getLineSeparator(); - } else { - ln = ""; - } + String ln = getLineSeparator(); _fetchScopeSelectHint = " * from (select base.*, rownum as rn from (" + ln + "select"; _fetchScopeSqlSuffix = ""; Modified: addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/dbmeta/AbstractDBMeta.java =================================================================== --- addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/dbmeta/AbstractDBMeta.java 2008-12-27 22:02:56 UTC (rev 1623) +++ addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/dbmeta/AbstractDBMeta.java 2008-12-27 22:06:42 UTC (rev 1624) @@ -5,12 +5,11 @@ import java.util.Collection; import java.util.Collections; import java.util.HashMap; -import java.util.HashSet; import java.util.Iterator; import java.util.LinkedHashMap; import java.util.List; import java.util.Map; -import java.util.Set; +import java.util.concurrent.ConcurrentHashMap; import jp.sf.pal.addresslist.db.allcommon.Entity; import jp.sf.pal.addresslist.db.allcommon.dbmeta.info.ColumnInfo; @@ -22,6 +21,7 @@ import jp.sf.pal.addresslist.db.allcommon.helper.MapListStringImpl; import jp.sf.pal.addresslist.db.allcommon.helper.MapStringBuilder; import jp.sf.pal.addresslist.db.allcommon.helper.MapStringBuilderImpl; +import jp.sf.pal.addresslist.db.allcommon.helper.StringKeyMap; import jp.sf.pal.addresslist.db.allcommon.util.SimpleAssertUtil; import jp.sf.pal.addresslist.db.allcommon.util.SimpleStringUtil; import jp.sf.pal.addresslist.db.allcommon.util.SimpleSystemUtil; @@ -31,68 +31,113 @@ * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public abstract class AbstractDBMeta implements DBMeta { //========================================================================== // ========= + // Definition + // ========== + protected static final Object DUMMY_VALUE = new Object(); + + //========================================================================== + // ========= // Attribute // ========= - protected List _columnInfoList; + // ----------------------------------------------------- + // Information Resource + // -------------------- + // Initialized at its getter. + private StringKeyMap _tableDbNameFlexibleMap; + private StringKeyMap _tablePropertyNameFlexibleMap; + + private List _columnInfoList; + + private StringKeyMap _columnInfoFlexibleMap; + + // Initialized at hasMethod(). + private Map _methodNameMap = newConcurrentHashMap(); + //========================================================================== // ========= + // Table Info + // ========== + /** + * Get the flexible map of table DB name. + * + * @return The flexible map of table DB name. (NotNull, NotEmpty) + */ + protected Map getTableDbNameFlexibleMap() { + if (_tableDbNameFlexibleMap != null) { + return _tableDbNameFlexibleMap; + } + synchronized (this) { + if (_tableDbNameFlexibleMap != null) { + return _tableDbNameFlexibleMap; + } + _tableDbNameFlexibleMap = StringKeyMap.createAsFlexibleConcurrent(); + _tableDbNameFlexibleMap.put(getTableDbName(), getTableDbName()); + return _tableDbNameFlexibleMap; + } + } + + /** + * Get the flexible map of table property name. + * + * @return The flexible map of table property name. (NotNull, NotEmpty) + */ + protected Map getTablePropertyNameFlexibleMap() { + if (_tablePropertyNameFlexibleMap != null) { + return _tablePropertyNameFlexibleMap; + } + synchronized (this) { + if (_tablePropertyNameFlexibleMap != null) { + return _tablePropertyNameFlexibleMap; + } + _tablePropertyNameFlexibleMap = StringKeyMap + .createAsFlexibleConcurrent(); + _tablePropertyNameFlexibleMap.put(getTableDbName(), + getTablePropertyName()); + return _tableDbNameFlexibleMap; + } + } + + //========================================================================== + // ========= // Column Info // =========== /** * The implementation. * - * @param columnFlexibleName The flexible name of the column. (NotNull) + * @param columnFlexibleName The flexible name(IgnoreCase, IgnoreUnderscore) + * of the column. (NotNull, NotEmpty) * @return Determination. */ public boolean hasColumn(String columnFlexibleName) { - if (!hasFlexibleName(columnFlexibleName)) { - return false; - } - final String propertyName = findPropertyName(columnFlexibleName); - return hasMethod("column" + initCap(propertyName)); + assertStringNotNullAndNotTrimmedEmpty("columnFlexibleName", + columnFlexibleName); + return getColumnInfoFlexibleMap().containsKey(columnFlexibleName); } /** * The implementation. * - * @param columnFlexibleName The flexible name of the column. (NotNull and - * NotEmpty) + * @param columnFlexibleName The flexible name(IgnoreCase, IgnoreUnderscore) + * of the column. (NotNull, NotEmpty) * @return The information of the column. (NotNull) */ public ColumnInfo findColumnInfo(String columnFlexibleName) { assertStringNotNullAndNotTrimmedEmpty("columnFlexibleName", columnFlexibleName); - if (!hasColumn(columnFlexibleName)) { + final ColumnInfo columnInfo = getColumnInfoFlexibleMap().get( + columnFlexibleName); + if (columnInfo == null) { String msg = "Not found column by columnFlexibleName: " + columnFlexibleName; msg = msg + " tableName=" + getTableDbName(); throw new IllegalArgumentException(msg); } - String methodName = "column" - + initCap(findPropertyName(columnFlexibleName)); - Method method = null; - try { - method = this.getClass().getMethod(methodName, new Class[] {}); - } catch (NoSuchMethodException e) { - String msg = "Not found column by columnFlexibleName: " - + columnFlexibleName; - msg = msg + " tableName=" + getTableDbName() + " methodName=" - + methodName; - throw new RuntimeException(msg, e); - } - try { - return (ColumnInfo) method.invoke(this, new Object[] {}); - } catch (IllegalAccessException e) { - throw new RuntimeException(e); - } catch (java.lang.reflect.InvocationTargetException e) { - throw new RuntimeException(e.getCause()); - } + return columnInfo; } protected ColumnInfo cci(String columnDbName, String propertyName, @@ -114,7 +159,7 @@ /** * The implementation. * - * @return The list of columns. (NotNull and NotEmpty) + * @return The list of columns. (NotNull, NotEmpty) */ public List getColumnInfoList() { if (_columnInfoList != null) { @@ -144,79 +189,118 @@ } } - protected void initializeColumnInfoList() { - getColumnInfoList();// Ignore return value because of initialization - // only! + /** + * Get the flexible map of column information. + * + * @return The flexible map of column information. (NotNull, NotEmpty) + */ + protected Map getColumnInfoFlexibleMap() { + if (_columnInfoFlexibleMap != null) { + return _columnInfoFlexibleMap; + } + final List columnInfoList = getColumnInfoList(); + synchronized (this) { + if (_columnInfoFlexibleMap != null) { + return _columnInfoFlexibleMap; + } + _columnInfoFlexibleMap = StringKeyMap.createAsFlexibleConcurrent(); + for (ColumnInfo columnInfo : columnInfoList) { + _columnInfoFlexibleMap.put(columnInfo.getColumnDbName(), + columnInfo); + } + return _columnInfoFlexibleMap; + } } //========================================================================== - // =========== + // ========= + // Resource Initialization + // ======================= + protected void initializeInformationResource() { // for instance initializer + // of subclass. + // Initialize the flexible map of table DB name. + getTableDbNameFlexibleMap(); + + // Initialize the flexible map of table property name. + getTablePropertyNameFlexibleMap(); + + // Initialize the list of column information. + getColumnInfoList(); + + // Initialize the flexible map of column information. + getColumnInfoFlexibleMap(); + + // Initialize the map of (public)method name. + hasMethod("dummy"); + } + + //========================================================================== + // ========= // Name Handling // ============= /** * The implementation. * - * @param flexibleName Flexible-name(IgnoreCase). (NotNull and NotEmpty) + * @param flexibleName The flexible name(IgnoreCase, IgnoreUnderscore). + * (NotNull, NotEmpty) * @return Determination. */ public boolean hasFlexibleName(String flexibleName) { - final String key = flexibleName.toLowerCase(); - if (getDbNamePropertyNameKeyToLowerMap().containsKey(key)) { - return true; - } - if (getPropertyNameDbNameKeyToLowerMap().containsKey(key)) { - return true; - } - return false; + assertStringNotNullAndNotTrimmedEmpty("flexibleName", flexibleName); + + // It uses column before table because column is used much more than + // table. + // This is the same consideration at other methods. + return getColumnInfoFlexibleMap().containsKey(flexibleName) + || getTableDbNameFlexibleMap().containsKey(flexibleName); } /** * The implementation. * - * @param flexibleName Flexible-name(IgnoreCase). (NotNull and NotEmpty) - * @return DB name. (NotNull and NotEmpty) + * @param flexibleName The flexible name(IgnoreCase, IgnoreUnderscore). + * (NotNull, NotEmpty) + * @return DB name. (NotNull, NotEmpty) */ public String findDbName(String flexibleName) { - final String key = flexibleName.toLowerCase(); - if (getPropertyNameDbNameKeyToLowerMap().containsKey(key)) { - return (String) getPropertyNameDbNameKeyToLowerMap().get(key); + assertStringNotNullAndNotTrimmedEmpty("flexibleName", flexibleName); + final ColumnInfo columnInfoMap = getColumnInfoFlexibleMap().get( + flexibleName); + if (columnInfoMap != null) { + return columnInfoMap.getColumnDbName(); } - if (getDbNamePropertyNameKeyToLowerMap().containsKey(key)) { - final String dbNameKeyToLower = ((String) getDbNamePropertyNameKeyToLowerMap() - .get(key)).toLowerCase(); - if (getPropertyNameDbNameKeyToLowerMap().containsKey( - dbNameKeyToLower)) { - return (String) getPropertyNameDbNameKeyToLowerMap().get( - dbNameKeyToLower); - } + final String tableDbName = getTableDbNameFlexibleMap() + .get(flexibleName); + if (tableDbName != null) { + return tableDbName; } - String msg = "Not found object by the flexible name: flexibleName=" + String msg = "Not found DB name by the flexible name: flexibleName=" + flexibleName; - throw new IllegalStateException(msg); + throw new IllegalArgumentException(msg); } /** * The implementation. * - * @param flexibleName Flexible-name(IgnoreCase). (NotNull and NotEmpty) - * @return DB name. (NotNull and NotEmpty) + * @param flexibleName The flexible name(IgnoreCase, IgnoreUnderscore). + * (NotNull, NotEmpty) + * @return DB name. (NotNull, NotEmpty) */ public String findPropertyName(String flexibleName) { - final String key = flexibleName.toLowerCase(); - if (getDbNamePropertyNameKeyToLowerMap().containsKey(key)) { - return (String) getDbNamePropertyNameKeyToLowerMap().get(key); + assertStringNotNullAndNotTrimmedEmpty("flexibleName", flexibleName); + final ColumnInfo columnInfoMap = getColumnInfoFlexibleMap().get( + flexibleName); + if (columnInfoMap != null) { + return columnInfoMap.getPropertyName(); } - if (getPropertyNameDbNameKeyToLowerMap().containsKey(key)) { - final String dbNameToLower = ((String) getPropertyNameDbNameKeyToLowerMap() - .get(key)).toLowerCase(); - if (getDbNamePropertyNameKeyToLowerMap().containsKey(dbNameToLower)) { - return (String) getDbNamePropertyNameKeyToLowerMap().get( - dbNameToLower); - } + final String tablePropertyName = getTablePropertyNameFlexibleMap().get( + flexibleName); + if (tablePropertyName != null) { + return tablePropertyName; } - String msg = "Not found object by the flexible name: flexibleName=" + String msg = "Not found property name by the flexible name: flexibleName=" + flexibleName; - throw new IllegalStateException(msg); + throw new IllegalArgumentException(msg); } //========================================================================== @@ -735,10 +819,8 @@ protected void registerEntityPropertySetupper( String columnName, String propertyName, Eps setupper, Map> entityPropertySetupperMap) { + // Only column name is registered because the map must be flexible map. entityPropertySetupperMap.put(columnName, setupper); - entityPropertySetupperMap.put(propertyName, setupper); - entityPropertySetupperMap.put(columnName.toLowerCase(), setupper); - entityPropertySetupperMap.put(propertyName.toLowerCase(), setupper); } protected Eps findEps( @@ -945,6 +1027,7 @@ /** * This class is for Internal. Don't use this! */ + @SuppressWarnings("unchecked") protected static class MapStringValueAnalyzer { protected java.util.Map _valueMap; @@ -1072,6 +1155,7 @@ // ========= // Assist Helper // ============= + @SuppressWarnings("unchecked") protected ENTITY downcast(Entity entity) { checkDowncast(entity); return (ENTITY) entity; @@ -1118,10 +1202,10 @@ protected Map setupKeyToLowerMap(boolean dbNameKey) { final Map map; if (dbNameKey) { - map = newLinkedHashMap(getTableDbName().toLowerCase(), + map = newConcurrentHashMap(getTableDbName().toLowerCase(), getTablePropertyName()); } else { - map = newLinkedHashMap(getTablePropertyName().toLowerCase(), + map = newConcurrentHashMap(getTablePropertyName().toLowerCase(), getTableDbName()); } Method[] methods = this.getClass().getMethods(); @@ -1178,6 +1262,17 @@ return new HashMap(); } + protected ConcurrentHashMap newConcurrentHashMap() { + return new ConcurrentHashMap(); + } + + protected ConcurrentHashMap newConcurrentHashMap( + KEY key, VALUE value) { + ConcurrentHashMap map = newConcurrentHashMap(); + map.put(key, value); + return map; + } + protected LinkedHashMap newLinkedHashMap() { return new LinkedHashMap(); } @@ -1201,23 +1296,26 @@ // ----------------------------------------------------- // Reflection Handling // ------------------- - private Set _cachedMethodNames = new HashSet(); // for - - // performance - + /** + * Does it have the method? + * + * @param methodName The name of method. (NotNull, NotEmpty, + * PublicMethodOnly) + * @return Determination. + */ protected boolean hasMethod(String methodName) { assertStringNotNullAndNotTrimmedEmpty("methodName", methodName); - if (_cachedMethodNames.isEmpty()) { - synchronized (_cachedMethodNames) { - if (_cachedMethodNames.isEmpty()) { + if (_methodNameMap.isEmpty()) { + synchronized (_methodNameMap) { + if (_methodNameMap.isEmpty()) { final Method[] methods = this.getClass().getMethods(); for (Method method : methods) { - _cachedMethodNames.add(method.getName()); + _methodNameMap.put(method.getName(), DUMMY_VALUE); } } } } - return _cachedMethodNames.contains(methodName); + return _methodNameMap.containsKey(methodName); } // ----------------------------------------------------- Modified: addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/dbmeta/DBMeta.java =================================================================== --- addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/dbmeta/DBMeta.java 2008-12-27 22:02:56 UTC (rev 1623) +++ addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/dbmeta/DBMeta.java 2008-12-27 22:06:42 UTC (rev 1624) @@ -17,23 +17,22 @@ * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public interface DBMeta { //========================================================================== // ========= // Definition // ========== - /** Map-string map-mark. */ + /** Map-string map mark. */ public static final String MAP_STRING_MAP_MARK = "map:"; - /** Map-string list-mark. */ + /** Map-string list mark. */ public static final String MAP_STRING_LIST_MARK = "list:"; - /** Map-string start-brace. */ + /** Map-string start brace. */ public static final String MAP_STRING_START_BRACE = "@{"; - /** Map-string end-brace. */ + /** Map-string end brace. */ public static final String MAP_STRING_END_BRACE = "@}"; /** Map-string delimiter. */ @@ -47,23 +46,23 @@ // Table Info // ========== /** - * Get table db-name. + * Get table DB name. * - * @return Table db-name. (NotNull) + * @return Table DB name. (NotNull) */ public String getTableDbName(); /** - * Get table property-name(JavaBeansRule). + * Get table property name(JavaBeansRule). * - * @return Table property-name(JavaBeansRule). (NotNull) + * @return Table property name(JavaBeansRule). (NotNull) */ public String getTablePropertyName(); /** - * Get table SQL-name. + * Get table SQL name. * - * @return Table SQL-name. (NotNull) + * @return Table SQL name. (NotNull) */ public String getTableSqlName(); @@ -80,10 +79,10 @@ public boolean hasFlexibleName(String flexibleName); /** - * Find db name by flexible name. {Target objects are TABLE and COLUMN} + * Find DB name by flexible name. {Target objects are TABLE and COLUMN} * * @param flexibleName The flexible name. (NotNull and NotEmpty) - * @return Db name. (NotNull and NotEmpty) + * @return The DB name of anything. (NotNull and NotEmpty) */ public String findDbName(String flexibleName); @@ -92,60 +91,40 @@ * TABLE and COLUMN} * * @param flexibleName The flexible name. (NotNull and NotEmpty) - * @return Db name. (NotNull and NotEmpty) + * @return The DB name of anything. (NotNull and NotEmpty) */ public String findPropertyName(String flexibleName); //========================================================================== // ========= - // Name Map - // ======== - /** - * Get the key-to-lower map of DB name(lower) and property name. - * - * @return The key-to-lower map of DB name(lower) and property name. - * (NotNull) - */ - public Map 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 getPropertyNameDbNameKeyToLowerMap(); - - //========================================================================== - // ========= // Type Name // ========= /** - * Get the type-name of entity. + * Get the type name of entity. * - * @return The type-name of entity. (NotNull) + * @return The type name of entity. (NotNull) */ public String getEntityTypeName(); /** - * Get the type-name of condition-bean. + * Get the type name of condition-bean. * - * @return The type-name of condition-bean. (Nullable: If the condition-bean + * @return The type name of condition-bean. (Nullable: If the condition-bean * does not exist) */ public String getConditionBeanTypeName(); /** - * Get the type-name of dao. + * Get the type name of DAO. * - * @return The type-name of dao. (Nullable: If the dao does not exist) + * @return The type name of DAO. (Nullable: If the DAO does not exist) */ public String getDaoTypeName(); /** - * Get the type-name of behavior. + * Get the type name of behavior. * - * @return The type-name of behavior. (Nullable: If the behavior does not + * @return The type name of behavior. (Nullable: If the behavior does not * exist) */ public String getBehaviorTypeName(); Modified: addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/dbmeta/DBMetaInstanceHandler.java =================================================================== --- addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/dbmeta/DBMetaInstanceHandler.java 2008-12-27 22:02:56 UTC (rev 1623) +++ addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/dbmeta/DBMetaInstanceHandler.java 2008-12-27 22:06:42 UTC (rev 1624) @@ -1,110 +1,85 @@ package jp.sf.pal.addresslist.db.allcommon.dbmeta; -import java.util.Collections; -import java.util.LinkedHashMap; +import java.lang.reflect.Method; import java.util.Map; import java.util.Set; +import java.util.concurrent.ConcurrentHashMap; +import jp.sf.pal.addresslist.db.allcommon.helper.StringKeyMap; import jp.sf.pal.addresslist.db.allcommon.util.SimpleAssertUtil; /** - * DBMeta instance handler. + * The instance handler of DB meta. * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public class DBMetaInstanceHandler { //========================================================================== // ========= // Definition // ========== + /** Log-instance. */ + private static final org.apache.commons.logging.Log _log = org.apache.commons.logging.LogFactory + .getLog(DBMetaInstanceHandler.class); + + //========================================================================== + // ========= + // Resource Map + // ============ /** Table DB-name instance map. */ - protected static final Map _tableDbNameInstanceMap = new LinkedHashMap(); + protected static final Map _tableDbNameInstanceMap = newConcurrentHashMap(); - /** The map of table DB-name and class name. */ - protected static final Map _tableDbNameClassNameMap; - static { - Map tmpMap = new LinkedHashMap(); + /** The map of table DB name and class name. This is for initialization. */ + protected static final Map _tableDbNameClassNameMap = newConcurrentHashMap(); - tmpMap.put("COMPANY", - "jp.sf.pal.addresslist.db.bsentity.dbmeta.CompanyDbm"); - tmpMap.put("CONTACT", - "jp.sf.pal.addresslist.db.bsentity.dbmeta.ContactDbm"); - tmpMap.put("CUSTOM", - "jp.sf.pal.addresslist.db.bsentity.dbmeta.CustomDbm"); - tmpMap.put("GROUP_INFO", - "jp.sf.pal.addresslist.db.bsentity.dbmeta.GroupInfoDbm"); - tmpMap.put("GROUP_MAPPING", - "jp.sf.pal.addresslist.db.bsentity.dbmeta.GroupMappingDbm"); - tmpMap.put("PERSON", - "jp.sf.pal.addresslist.db.bsentity.dbmeta.PersonDbm"); - tmpMap.put("POSTAL", - "jp.sf.pal.addresslist.db.bsentity.dbmeta.PostalDbm"); - tmpMap.put("ROLE_INFO", - "jp.sf.pal.addresslist.db.bsentity.dbmeta.RoleInfoDbm"); - tmpMap.put("ROLE_MAPPING", - "jp.sf.pal.addresslist.db.bsentity.dbmeta.RoleMappingDbm"); - tmpMap.put("USER_INFO", - "jp.sf.pal.addresslist.db.bsentity.dbmeta.UserInfoDbm"); + /** The flexible map of table DB name. This is for conversion at finding. */ + protected static final Map _tableDbNameFlexibleMap = StringKeyMap + .createAsFlexibleConcurrent(); - _tableDbNameClassNameMap = Collections.unmodifiableMap(tmpMap); - } + /** The count of setting up resources of DB meta for internal information. */ + protected static int setupCount = 0; - /** The key-to-lower map of DB-name and property-name for table. */ - protected static final Map _tableDbNamePropertyNameKeyToLowerMap; - static { - Map tmpMap = new LinkedHashMap(); - - tmpMap.put("COMPANY".toLowerCase(), "company"); - tmpMap.put("CONTACT".toLowerCase(), "contact"); - tmpMap.put("CUSTOM".toLowerCase(), "custom"); - tmpMap.put("GROUP_INFO".toLowerCase(), "groupInfo"); - tmpMap.put("GROUP_MAPPING".toLowerCase(), "groupMapping"); - tmpMap.put("PERSON".toLowerCase(), "person"); - tmpMap.put("POSTAL".toLowerCase(), "postal"); - tmpMap.put("ROLE_INFO".toLowerCase(), "roleInfo"); - tmpMap.put("ROLE_MAPPING".toLowerCase(), "roleMapping"); - tmpMap.put("USER_INFO".toLowerCase(), "userInfo"); - - _tableDbNamePropertyNameKeyToLowerMap = Collections - .unmodifiableMap(tmpMap); - } - - /** The key-to-lower map of property-name and DB-name for table. */ - protected static final Map _tablePropertyNameDbNameKeyToLowerMap; - static { - Map tmpMap = new LinkedHashMap(); - - tmpMap.put("company".toLowerCase(), "COMPANY"); - tmpMap.put("contact".toLowerCase(), "CONTACT"); - tmpMap.put("custom".toLowerCase(), "CUSTOM"); - tmpMap.put("groupInfo".toLowerCase(), "GROUP_INFO"); - tmpMap.put("groupMapping".toLowerCase(), "GROUP_MAPPING"); - tmpMap.put("person".toLowerCase(), "PERSON"); - tmpMap.put("postal".toLowerCase(), "POSTAL"); - tmpMap.put("roleInfo".toLowerCase(), "ROLE_INFO"); - tmpMap.put("roleMapping".toLowerCase(), "ROLE_MAPPING"); - tmpMap.put("userInfo".toLowerCase(), "USER_INFO"); - - _tablePropertyNameDbNameKeyToLowerMap = Collections - .unmodifiableMap(tmpMap); - } - - protected static DBMeta getDBMeta(String className) { - try { - Class clazz = Class.forName(className); - java.lang.reflect.Method methoz = clazz.getMethod("getInstance", - (Class[]) null); - Object result = methoz.invoke(null, (Object[]) null); - return (DBMeta) result; - } catch (Exception e) { - throw new RuntimeException(e); + /** + * Set up the resource of DBMeta. Lock this class. + * + * @param tableDbNameClassNameMap The map of table DB name and class name. + * (NotNull) + */ + public static synchronized void setupDBMetaResource( + Map tableDbNameClassNameMap) { + if (tableDbNameClassNameMap == null) { + String msg = "The argument 'tableDbNameClassNameMap' should not be null"; + msg = msg + " at DBMetaInstanceHandler.setupDBMetaResource()"; + throw new IllegalArgumentException(msg); } + if (tableDbNameClassNameMap.isEmpty()) { + String msg = "The argument 'tableDbNameClassNameMap' should not be empty"; + msg = msg + " at DBMetaInstanceHandler.setupDBMetaResource()"; + throw new IllegalArgumentException(msg); + } + final String firstMsg = "...Setting up resources of DB meta"; + final int tableCount = tableDbNameClassNameMap.size(); + if (setupCount == 0) { + _log.info(firstMsg + ": tables=" + tableCount); // basically here + } else { + _log.info(firstMsg + " AGAIN(" + (setupCount + 1) + + " times): tables=" + tableCount); + } + _tableDbNameInstanceMap.clear(); + _tableDbNameClassNameMap.clear(); + _tableDbNameFlexibleMap.clear(); + final Set tableDbNameSet = tableDbNameClassNameMap.keySet(); + for (String tableDbName : tableDbNameSet) { + final String className = tableDbNameClassNameMap.get(tableDbName); + _tableDbNameClassNameMap.put(tableDbName, className); + _tableDbNameFlexibleMap.put(tableDbName, tableDbName); + } + ++setupCount; } /** - * @return The initialized map that contains all instances of dbmeta. + * @return The initialized map that contains all instances of DB meta. * (NotNull & NotEmpty) */ public static Map getDBMetaMap() { @@ -137,45 +112,31 @@ // Main Method // =========== /** - * Find dbmeta by table flexible-name. + * Find DB meta by table flexible name. * *
-     * If the table name is 'ORDER_DETAIL', you can find the dbmeta by ...(as follows)
+     * If the table name is 'ORDER_DETAIL', you can find the DB meta by ...(as follows)
      *     'ORDER_DETAIL', 'ORDer_DeTAiL', 'order_detail'
      *     , 'OrderDetail', 'orderdetail', 'oRderDetaIl'
      * 
* - * @param tableFlexibleName Table flexible-name. (NotNull) - * @return The instance of dbmeta. (NotNull) - * @exception DBMetaNotFoundException When the dbmeta is not found. + * @param tableFlexibleName The flexible name of table. (NotNull) + * @return The instance of DB meta. (NotNull) + * @exception DBMetaNotFoundException When the DB meta is not found. */ public static DBMeta findDBMeta(String tableFlexibleName) { assertStringNotNullAndNotTrimmedEmpty("tableFlexibleName", tableFlexibleName); - if (_tableDbNameInstanceMap.containsKey(tableFlexibleName)) { - return byTableDbName(tableFlexibleName); - } - String toLowerKey = tableFlexibleName.toLowerCase(); - if (_tableDbNamePropertyNameKeyToLowerMap.containsKey(toLowerKey)) { - String propertyName = (String) _tableDbNamePropertyNameKeyToLowerMap - .get(toLowerKey); - String dbName = (String) _tablePropertyNameDbNameKeyToLowerMap - .get(propertyName.toLowerCase()); - return byTableDbName(dbName); - } - if (_tablePropertyNameDbNameKeyToLowerMap.containsKey(toLowerKey)) { - String dbName = (String) _tablePropertyNameDbNameKeyToLowerMap - .get(toLowerKey); - return byTableDbName(dbName); - } final int dotLastIndex = tableFlexibleName.lastIndexOf("."); if (dotLastIndex >= 0) { - try { - return findDBMeta(tableFlexibleName.substring(dotLastIndex + 1)); - } catch (DBMetaNotFoundException e) { - // Nothing - } + tableFlexibleName = tableFlexibleName.substring(dotLastIndex + + ".".length()); } + final String tableDbName = _tableDbNameFlexibleMap + .get(tableFlexibleName); + if (tableDbName != null) { + return byTableDbName(tableDbName); + } String msg = "The instance map returned null by the key: key=" + tableFlexibleName + " instanceMap=" + _tableDbNameInstanceMap; throw new DBMetaNotFoundException(msg); @@ -199,8 +160,9 @@ assertStringNotNullAndNotTrimmedEmpty("tableDbName", tableDbName); DBMeta instance = getCachedDBMeta(tableDbName); if (instance == null) { - String msg = "The instance map returned null by the key: key=" - + tableDbName + " instanceMap=" + _tableDbNameInstanceMap; + String msg = "The instance map returned null by the key:"; + msg = msg + " key=" + tableDbName + " instanceMap=" + + _tableDbNameInstanceMap; throw new DBMetaNotFoundException(msg); } return instance; @@ -222,10 +184,25 @@ return _tableDbNameInstanceMap.get(tableName); } + protected static DBMeta getDBMeta(String className) { + try { + Class clazz = Class.forName(className); + Method methoz = clazz.getMethod("getInstance", (Class[]) null); + Object result = methoz.invoke(null, (Object[]) null); + return (DBMeta) result; + } catch (Exception e) { + throw new RuntimeException(e); + } + } + //========================================================================== // ========= // General Helper // ============== + protected static ConcurrentHashMap newConcurrentHashMap() { + return new ConcurrentHashMap(); + } + // ----------------------------------------------------- // Assert Object // ------------- Modified: addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/dbmeta/hierarchy/HierarchyArranger.java =================================================================== --- addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/dbmeta/hierarchy/HierarchyArranger.java 2008-12-27 22:02:56 UTC (rev 1623) +++ addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/dbmeta/hierarchy/HierarchyArranger.java 2008-12-27 22:06:42 UTC (rev 1624) @@ -222,7 +222,6 @@ * @author DBFlute(AutoGenerator) * @param The type of local entity extends Entity */ - ¡÷ SuppressWarnings("unchecked") public class HierarchyArranger { //========================================================================== @@ -457,9 +456,9 @@ List referrerList = extractReferrerList(localEntity, referrerInfo); if (referrerList == null) { - String msg = "The referrer list should not be null: localEntity=" - + localEntity + " referrerInfo=" + referrerInfo; - throw new IllegalStateException(msg); + // Initialize the list of referrer and inject it. + referrerList = new ArrayList(); + injectReferrerList(localEntity, referrerInfo, referrerList); } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -765,8 +764,8 @@ return capPropReferrerName; } - private java.lang.reflect.Method findMethod(Class clazz, String methodName, - Class[] argTypes) { + private java.lang.reflect.Method findMethod(Class clazz, + String methodName, Class[] argTypes) { try { return clazz.getMethod(methodName, argTypes); } catch (NoSuchMethodException ex) { @@ -852,10 +851,10 @@ return sb.toString(); } - private String createTypeViewFromTypeArray(Class[] array) { + private String createTypeViewFromTypeArray(Class[] array) { final StringBuffer sb = new StringBuffer(); for (int i = 0; i < array.length; i++) { - final Class type = array[i]; + final Class type = array[i]; if (sb.length() == 0) { sb.append(type.getSimpleName()); } else { Modified: addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/dbmeta/hierarchy/HierarchyRequest.java =================================================================== --- addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/dbmeta/hierarchy/HierarchyRequest.java 2008-12-27 22:02:56 UTC (rev 1623) +++ addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/dbmeta/hierarchy/HierarchyRequest.java 2008-12-27 22:06:42 UTC (rev 1624) @@ -16,7 +16,6 @@ * @author DBFlute(AutoGenerator) * @param The type of local entity. */ - ¡÷ SuppressWarnings("unchecked") public class HierarchyRequest { //========================================================================== Modified: addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/dbmeta/hierarchy/HierarchyRequestElement.java =================================================================== --- addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/dbmeta/hierarchy/HierarchyRequestElement.java 2008-12-27 22:02:56 UTC (rev 1623) +++ addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/dbmeta/hierarchy/HierarchyRequestElement.java 2008-12-27 22:06:42 UTC (rev 1624) @@ -9,7 +9,6 @@ /** * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public class HierarchyRequestElement { //========================================================================== Modified: addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/dbmeta/hierarchy/HierarchySourceColumn.java =================================================================== --- addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/dbmeta/hierarchy/HierarchySourceColumn.java 2008-12-27 22:02:56 UTC (rev 1623) +++ addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/dbmeta/hierarchy/HierarchySourceColumn.java 2008-12-27 22:06:42 UTC (rev 1624) @@ -3,7 +3,6 @@ /** * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public interface HierarchySourceColumn { public String getColumnName(); Modified: addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/dbmeta/hierarchy/HierarchySourceIterator.java =================================================================== --- addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/dbmeta/hierarchy/HierarchySourceIterator.java 2008-12-27 22:02:56 UTC (rev 1623) +++ addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/dbmeta/hierarchy/HierarchySourceIterator.java 2008-12-27 22:06:42 UTC (rev 1624) @@ -3,7 +3,6 @@ /** * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public interface HierarchySourceIterator { public boolean hasNext(); Modified: addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/dbmeta/hierarchy/HierarchySourceRow.java =================================================================== --- addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/dbmeta/hierarchy/HierarchySourceRow.java 2008-12-27 22:02:56 UTC (rev 1623) +++ addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/dbmeta/hierarchy/HierarchySourceRow.java 2008-12-27 22:06:42 UTC (rev 1624) @@ -3,7 +3,6 @@ /** * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public interface HierarchySourceRow { public Object extractColumnValue(HierarchySourceColumn columnInfo); Modified: addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/dbmeta/info/ColumnInfo.java =================================================================== --- addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/dbmeta/info/ColumnInfo.java 2008-12-27 22:02:56 UTC (rev 1623) +++ addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/dbmeta/info/ColumnInfo.java 2008-12-27 22:06:42 UTC (rev 1624) @@ -8,7 +8,6 @@ * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public class ColumnInfo { //========================================================================== Modified: addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/dbmeta/info/RelationInfo.java =================================================================== --- addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/dbmeta/info/RelationInfo.java 2008-12-27 22:02:56 UTC (rev 1623) +++ addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/dbmeta/info/RelationInfo.java 2008-12-27 22:06:42 UTC (rev 1624) @@ -1,13 +1,14 @@ package jp.sf.pal.addresslist.db.allcommon.dbmeta.info; +import java.util.Map; + import jp.sf.pal.addresslist.db.allcommon.dbmeta.DBMeta; /** - * The class of referer information. + * The class of referrer information. * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public interface RelationInfo { public String getRelationPropertyName(); @@ -16,7 +17,7 @@ public DBMeta getTargetDBMeta(); - public java.util.Map getLocalTargetColumnInfoMap(); + public Map getLocalTargetColumnInfoMap(); public boolean isOneToOne(); Modified: addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/helper/MapStringBuilderImpl.java =================================================================== --- addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/helper/MapStringBuilderImpl.java 2008-12-27 22:02:56 UTC (rev 1623) +++ addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/helper/MapStringBuilderImpl.java 2008-12-27 22:06:42 UTC (rev 1624) @@ -1,17 +1,20 @@ package jp.sf.pal.addresslist.db.allcommon.helper; +import java.util.Arrays; +import java.util.List; + import jp.sf.pal.addresslist.db.allcommon.helper.token.line.LineToken; import jp.sf.pal.addresslist.db.allcommon.helper.token.line.LineTokenizingOption; import jp.sf.pal.addresslist.db.allcommon.helper.token.line.impl.LineTokenImpl; /** - * The implementation of map-string-builder. + * The implementation of map-string builder. * * @author DBFlute(AutoGenerator) */ public class MapStringBuilderImpl implements MapStringBuilder { - protected java.util.List _columnNameList; + protected List _columnNameList; protected String _msMapMark; @@ -26,10 +29,10 @@ protected boolean _trimDoubleQuotation; public void setColumnNames(String[] columnNames) { - _columnNameList = java.util.Arrays.asList(columnNames); + _columnNameList = Arrays.asList(columnNames); } - public void setColumnNameList(java.util.List columnNameList) { + public void setColumnNameList(List columnNameList) { _columnNameList = columnNameList; } @@ -83,7 +86,7 @@ return sb.toString(); } - public String buildFromList(java.util.List valueList) { + public String buildFromList(List valueList) { if (valueList == null) { String msg = "The argument[valueList] should not be null."; throw new IllegalArgumentException(msg); @@ -103,7 +106,7 @@ return sb.toString(); } - protected java.util.List tokenize(String value, String delimiter) { + protected List tokenize(String value, String delimiter) { final LineToken lineToken = new LineTokenImpl(); final LineTokenizingOption lineTokenizingOption = new LineTokenizingOption(); lineTokenizingOption.setDelimiter(delimiter); @@ -144,8 +147,8 @@ } } - protected void assertColumnValueList(java.util.List columnNameList, - java.util.List valueList) { + protected void assertColumnValueList(List columnNameList, + List valueList) { if (columnNameList.size() != valueList.size()) { String msg = "The length of columnNameList and valueList are difference. (" + columnNameList.size() + ", " + valueList.size() + ")"; Added: addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/helper/StringKeyMap.java =================================================================== --- addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/helper/StringKeyMap.java (rev 0) +++ addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/helper/StringKeyMap.java 2008-12-27 22:06:42 UTC (rev 1624) @@ -0,0 +1,201 @@ +package jp.sf.pal.addresslist.db.allcommon.helper; + +import java.util.Collection; +import java.util.HashMap; +import java.util.Map; +import java.util.Set; +import java.util.concurrent.ConcurrentHashMap; + +/** + * @author DBFlute(AutoGenerator) + * @param The type of value. + */ +public class StringKeyMap implements Map { + + //========================================================================== + // ========= + // Attribute + // ========= + protected final Map _internalMap; + + protected boolean _removeUnderscore; + + //========================================================================== + // ========= + // Constructor + // =========== + protected StringKeyMap(boolean removeUnderscore, boolean concurrent) { + _removeUnderscore = removeUnderscore; + if (concurrent) { + _internalMap = newConcurrentHashMap(); + } else { + _internalMap = newHashMap(); + } + } + + public static StringKeyMap createAsFlexible() { + return new StringKeyMap(true, false); + } + + public static StringKeyMap createAsFlexibleConcurrent() { + return new StringKeyMap(true, true); + } + + public static StringKeyMap createAsCaseInsensitive() { + return new StringKeyMap(false, false); + } + + public static StringKeyMap createAsCaseInsensitiveConcurrent() { + return new StringKeyMap(false, true); + } + + //========================================================================== + // ========= + // Map Emulator + // ============ + // ----------------------------------------------------- + // Key Related + // ----------- + public VALUE get(Object key) { + final String stringKey = convertStringKey(key); + if (stringKey != null) { + return _internalMap.get(stringKey); + } + return null; + } + + public VALUE put(String key, VALUE value) { + final String stringKey = convertStringKey(key); + if (stringKey != null) { + return _internalMap.put(stringKey, value); + } + return null; + } + + public VALUE remove(Object key) { + final String stringKey = convertStringKey(key); + if (stringKey != null) { + return _internalMap.remove(stringKey); + } + return null; + } + + public final void putAll(Map map) { + final Set keySet = map.keySet(); + for (String key : keySet) { + put(key, map.get(key)); + } + } + + public boolean containsKey(Object key) { + return get(key) != null; + } + + // ----------------------------------------------------- + // Delegate + // -------- + public void clear() { + _internalMap.clear(); + } + + public int size() { + return _internalMap.size(); + } + + public boolean isEmpty() { + return _internalMap.isEmpty(); + } + + public Set keySet() { + return _internalMap.keySet(); + } + + public Collection values() { + return _internalMap.values(); + } + + public boolean containsValue(Object obj) { + return _internalMap.containsValue(obj); + } + + public Set> entrySet() { + return _internalMap.entrySet(); + } + + //========================================================================== + // ========= + // Key Converter + // ============= + protected String convertStringKey(Object key) { + if (!(key instanceof String)) { + return null; + } + return toLowerCase(removeUnderscore((String) key)); + } + + protected String removeUnderscore(String value) { + if (_removeUnderscore) { + return replace(value, "_", ""); + } + return value; + } + + protected String toLowerCase(String value) { + return value.toLowerCase(); + } + + //========================================================================== + // ========= + // General Helper + // ============== + protected static String replace(String text, String fromText, String toText) { + if (text == null || fromText == null || toText == null) { + return null; + } + StringBuilder sb = new StringBuilder(100); + int pos = 0; + int pos2 = 0; + while (true) { + pos = text.indexOf(fromText, pos2); + if (pos == 0) { + sb.append(toText); + pos2 = fromText.length(); + } else if (pos > 0) { + sb.append(text.substring(pos2, pos)); + sb.append(toText); + pos2 = pos + fromText.length(); + } else { + sb.append(text.substring(pos2)); + break; + } + } + return sb.toString(); + } + + protected static ConcurrentHashMap newConcurrentHashMap() { + return new ConcurrentHashMap(); + } + + protected static HashMap newHashMap() { + return new HashMap(); + } + + //========================================================================== + // ========= + // Basic Override + // ============== + @Override + public boolean equals(Object obj) { + return _internalMap.equals(obj); + } + + @Override + public int hashCode() { + return _internalMap.hashCode(); + } + + @Override + public String toString() { + return _internalMap.toString(); + } +} \ No newline at end of file Property changes on: addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/helper/StringKeyMap.java ___________________________________________________________________ Name: svn:eol-style + native Added: addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/helper/StringSet.java =================================================================== --- addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/helper/StringSet.java (rev 0) +++ addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/helper/StringSet.java 2008-12-27 22:06:42 UTC (rev 1624) @@ -0,0 +1,233 @@ +package jp.sf.pal.addresslist.db.allcommon.helper; + +import java.util.Collection; +import java.util.HashMap; +import java.util.Iterator; +import java.util.Map; +import java.util.Set; +import java.util.concurrent.ConcurrentHashMap; + +/** + * @author DBFlute(AutoGenerator) + */ +public class StringSet implements Set { + + //========================================================================== + // ========= + // Definition + // ========== + protected static final Object DUMMY_VALUE = new Object(); + + //========================================================================== + // ========= + // Attribute + // ========= + protected final Map _internalMap; + + protected boolean _removeUnderscore; + + //========================================================================== + // ========= + // Constructor + // =========== + protected StringSet(boolean removeUnderscore, boolean concurrent) { + _removeUnderscore = removeUnderscore; + if (concurrent) { + _internalMap = newConcurrentHashMap(); + } else { + _internalMap = newHashMap(); + } + } + + public static StringSet createAsFlexible() { + return new StringSet(true, false); + } + + public static StringSet createAsFlexibleConcurrent() { + return new StringSet(true, true); + } + + public static StringSet createAsCaseInsensitive() { + return new StringSet(false, false); + } + + public static StringSet createAsCaseInsensitiveConcurrent() { + return new StringSet(false, true); + } + + //========================================================================== + // ========= + // Map Emulator + // ============ + // ----------------------------------------------------- + // Key Related + // ----------- + public boolean add(String value) { + final String stringValue = convertStringKey(value); + if (stringValue != null) { + return _internalMap.put(stringValue, DUMMY_VALUE) != null; + } + return false; + } + + public boolean remove(Object value) { + final String stringValue = convertStringKey(value); + if (stringValue != null) { + return _internalMap.remove(stringValue) != null; + } + return false; + } + + public boolean contains(Object value) { + final String stringValue = convertStringKey(value); + if (stringValue != null) { + return _internalMap.containsKey(stringValue); + } + return false; + } + + // ----------------------------------------------------- + // Delegate + // -------- + public void clear() { + _internalMap.clear(); + } + + public int size() { + return _internalMap.size(); + } + + public boolean isEmpty() { + return _internalMap.isEmpty(); + } + + public boolean addAll(Collection c) { + boolean success = false; + for (String s : c) { + if (add(s)) { + success = true; + } + } + return success; + } + + public boolean removeAll(Collection c) { + boolean success = false; + for (Object s : c) { + if (remove(s)) { + success = true; + } + } + return success; + } + + public boolean containsAll(Collection c) { + for (Object s : c) { + if (contains(s)) { + return true; + } + } + return false; + } + + public Iterator iterator() { + return _internalMap.keySet().iterator(); + } + + public boolean retainAll(Collection c) { + boolean success = false; + for (Object s : c) { + if (!contains(s)) { + if (remove(s)) { + success = true; + } + } + } + return success; + } + + public Object[] toArray() { + return _internalMap.keySet().toArray(); + } + + public T[] toArray(T[] a) { + return _internalMap.keySet().toArray(a); + } + + //========================================================================== + // ========= + // Key Converter + // ============= + protected String convertStringKey(Object value) { + if (!(value instanceof String)) { + return null; + } + return toLowerCase(removeUnderscore((String) value)); + } + + protected String removeUnderscore(String value) { + if (_removeUnderscore) { + return replace(value, "_", ""); + } + return value; + } + + protected String toLowerCase(String value) { + return value.toLowerCase(); + } + + //========================================================================== + // ========= + // General Helper + // ============== + protected static String replace(String text, String fromText, String toText) { + if (text == null || fromText == null || toText == null) { + return null; + } + StringBuilder sb = new StringBuilder(100); + int pos = 0; + int pos2 = 0; + while (true) { + pos = text.indexOf(fromText, pos2); + if (pos == 0) { + sb.append(toText); + pos2 = fromText.length(); + } else if (pos > 0) { + sb.append(text.substring(pos2, pos)); + sb.append(toText); + pos2 = pos + fromText.length(); + } else { + sb.append(text.substring(pos2)); + break; + } + } + return sb.toString(); + } + + protected static ConcurrentHashMap newConcurrentHashMap() { + return new ConcurrentHashMap(); + } + + protected static HashMap newHashMap() { + return new HashMap(); + } + + //========================================================================== + // ========= + // Basic Override + // ============== + @Override + public boolean equals(Object obj) { + return _internalMap.keySet().equals(obj); + } + + @Override + public int hashCode() { + return _internalMap.keySet().hashCode(); + } + + @Override + public String toString() { + return _internalMap.keySet().toString(); + } +} \ No newline at end of file Property changes on: addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/helper/StringSet.java ___________________________________________________________________ Name: svn:eol-style + native Added: addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/s2dao/BeanMetaDataFactoryExtension.java =================================================================== --- addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/s2dao/BeanMetaDataFactoryExtension.java (rev 0) +++ addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/s2dao/BeanMetaDataFactoryExtension.java 2008-12-27 22:06:42 UTC (rev 1624) @@ -0,0 +1,213 @@ +package jp.sf.pal.addresslist.db.allcommon.s2dao; + +import java.sql.DatabaseMetaData; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.concurrent.ConcurrentHashMap; + +import jp.sf.pal.addresslist.db.allcommon.Entity; +import jp.sf.pal.addresslist.db.allcommon.s2dao.internal.various.InternalIdentifierGeneratorFactory; + +import org.seasar.dao.BeanMetaData; +import org.seasar.dao.IdentifierGenerator; +import org.seasar.dao.impl.BeanMetaDataFactoryImpl; +import org.seasar.dao.impl.BeanMetaDataImpl; +import org.seasar.extension.jdbc.PropertyType; +import org.seasar.framework.beans.PropertyDesc; + +/** + * BeanMetaDataFactoryImpl for DBFlute. + * + * @author DBFlute(AutoGenerator) + */ + ¡÷ SuppressWarnings("unchecked") +public class BeanMetaDataFactoryExtension extends BeanMetaDataFactoryImpl { + + //========================================================================== + // ========= + // Attribute + // ========= + /** The map of bean meta data for cache. */ + protected Map, BeanMetaData> _metaMap = newConcurrentHashMap(); + + //========================================================================== + // ========= + // Override for Cache + // ================== + @Override + public BeanMetaData createBeanMetaData(Class beanClass) { + final BeanMetaData cachedMeta = findCachedMeta(beanClass); + if (cachedMeta != null) { + return cachedMeta; + } else { + return super.createBeanMetaData(beanClass); + } + } + + @Override + public BeanMetaData createBeanMetaData(Class beanClass, + int relationNestLevel) { + final BeanMetaData cachedMeta = findCachedMeta(beanClass); + if (cachedMeta != null) { + return cachedMeta; + } else { + return super.createBeanMetaData(beanClass, relationNestLevel); + } + } + + @Override + public BeanMetaData createBeanMetaData(DatabaseMetaData dbMetaData, + Class beanClass, int relationNestLevel) { + final BeanMetaData cachedMeta = findOrCreateCachedMetaIfNeeds( + dbMetaData, beanClass, relationNestLevel); + if (cachedMeta != null) { + return cachedMeta; + } else { + return super.createBeanMetaData(dbMetaData, beanClass, + relationNestLevel); + } + } + + protected BeanMetaData findCachedMeta(Class beanClass) { + if (isDBFluteEntity(beanClass)) { + final BeanMetaData cachedMeta = getMetaFromCache(beanClass); + if (cachedMeta != null) { + return cachedMeta; + } + } + return null; + } + + protected BeanMetaData findOrCreateCachedMetaIfNeeds( + DatabaseMetaData dbMetaData, Class beanClass, int relationNestLevel) { + if (isDBFluteEntity(beanClass)) { + final BeanMetaData cachedMeta = getMetaFromCache(beanClass); + if (cachedMeta != null) { + return cachedMeta; + } else { + return super.createBeanMetaData(dbMetaData, beanClass, 0); + } + } + return null; + } + + //========================================================================== + // ========= + // BeanMetaData Creation + // ===================== + @Override + protected BeanMetaDataImpl createBeanMetaDataImpl() { + // /= = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = + // = = + // for ConditionBean and insert() and update() and delete() and so on... + // = = = = = = = = = =/ + return new BeanMetaDataImpl() { + protected List _internalIdentifierGeneratorList = new ArrayList(); + + protected Map _internalIdentifierGeneratorsByPropertyName = newConcurrentHashMap(); + + // /= = = = = = = + // for cache + // = = = = =/ + @Override + public void initialize() { // for Cache + final Class myBeanClass = getBeanClass(); + if (isDBFluteEntity(myBeanClass)) { + final BeanMetaData cachedMeta = getMetaFromCache(myBeanClass); + if (cachedMeta == null) { + _metaMap.put(myBeanClass, this); + } + } + super.initialize(); + } + + // /= = = = = = = + // for insert() + // = = = = =/ + // The attributes 'identifierGenerators' and + // 'identifierGeneratorsByPropertyName' + // of super class are unused. It prepares original atributes here. + @Override + protected void setupIdentifierGenerator(PropertyType propertyType) { + final PropertyDesc pd = propertyType.getPropertyDesc(); + final String propertyName = propertyType.getPropertyName(); + final String idType = beanAnnotationReader.getId(pd, getDbms()); + final IdentifierGenerator generator = createInternalIdentifierGenerator( + propertyType, idType); + _internalIdentifierGeneratorList.add(generator); + _internalIdentifierGeneratorsByPropertyName.put(propertyName, + generator); + } + + protected IdentifierGenerator createInternalIdentifierGenerator( + PropertyType propertyType, String idType) { + return InternalIdentifierGeneratorFactory + .createIdentifierGenerator(propertyType, getDbms(), + idType); + } + + @Override + public IdentifierGenerator getIdentifierGenerator(int index) { + return _internalIdentifierGeneratorList.get(index); + } + + @Override + public int getIdentifierGeneratorSize() { + return _internalIdentifierGeneratorList.size(); + } + + @Override + public IdentifierGenerator getIdentifierGenerator( + String propertyName) { + return _internalIdentifierGeneratorsByPropertyName + .get(propertyName); + } + }; + } + + // /= = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = + // Other extension points about BeanMetaDataImpl is as follows: + // + // S2DaoMetaDataExtension.createNonConcurrencyBmdFactory() + // --> for NonConcurrency (updateNonstrict() and deleteNonstrict() and so + // on...) + // + // S2DaoMetaDataExtension.createOutsideSqlCustomizeBeanMetaDataFactory() + // --> for OutsideSql but it overrides nothing. + // = = = = = = = = = =/ + + //========================================================================== + // ========= + // Relation Next Level + // =================== + /** + * Get the limit nest level of relation. + * + * @return The limit nest level of relation. + */ + @Override + protected int getLimitRelationNestLevel() { + return 2; // for Compatible to old version DBFlute + } + + //========================================================================== + // ========= + // General Helper + // ============== + protected ConcurrentHashMap newConcurrentHashMap() { + return new ConcurrentHashMap(); + } + + //========================================================================== + // ========= + // Assist Helper + // ============= + protected boolean isDBFluteEntity(Class beanClass) { + return Entity.class.isAssignableFrom(beanClass); + } + + protected BeanMetaData getMetaFromCache(Class beanClass) { + return _metaMap.get(beanClass); + } +} \ No newline at end of file Property changes on: addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/s2dao/BeanMetaDataFactoryExtension.java ___________________________________________________________________ Name: svn:eol-style + native Deleted: addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/s2dao/FetchNarrowingResultSetFactory.java =================================================================== --- addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/s2dao/FetchNarrowingResultSetFactory.java 2008-12-27 22:02:56 UTC (rev 1623) +++ addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/s2dao/FetchNarrowingResultSetFactory.java 2008-12-27 22:06:42 UTC (rev 1624) @@ -1,125 +0,0 @@ -package jp.sf.pal.addresslist.db.allcommon.s2dao; - -import java.sql.PreparedStatement; -import java.sql.ResultSet; -import java.sql.SQLException; -import java.sql.Statement; - -import jp.sf.pal.addresslist.db.allcommon.s2dao.internal.sqlhandler.InternalBasicHandler.SQLExceptionHandler; - -import org.seasar.extension.jdbc.ResultSetFactory; - -/** - * This is unused in DBFlute so this is very NORMAL result-set-factory for - * S2Dao. - * - * @author DBFlute(AutoGenerator) - */ -public class FetchNarrowingResultSetFactory implements ResultSetFactory { - - //========================================================================== - // ========= - // Constructor - // =========== - /** - * Constructor. - */ - public FetchNarrowingResultSetFactory() { - } - - //========================================================================== - // ========= - // Main - // ==== - /** - * Get result set. - * - * @param statement Statement. (NotNull) - * @return Result set for procedure executing of s2dao. (NotNull) - */ - public ResultSet getResultSet(Statement statement) { // Unused in DBFlute - return doGetResultSet(statement); - } - - /** - * Create result set. - * - * @param ps Prepared statement. (NotNull) - * @return Result set. (NotNull) - */ - public ResultSet createResultSet(PreparedStatement ps) { // Unused in - // DBFlute - return executeQuery(ps); - - // *Move to InternalBasicSelectHandler - // if (!FetchNarrowingBeanContext.isExistFetchNarrowingBeanOnThread()) { - // return resultSet; - // } - // final FetchNarrowingBean cb = - // FetchNarrowingBeanContext.getFetchNarrowingBeanOnThread(); - // if (!isUseFetchNarrowingResultSetWrapper(cb)) { - // return resultSet; - // } - // final FetchNarrowingResultSetWrapper wrapper; - // if (OutsideSqlContext.isExistOutsideSqlContextOnThread()) { - // final OutsideSqlContext outsideSqlContext = - // OutsideSqlContext.getOutsideSqlContextOnThread(); - // wrapper = new FetchNarrowingResultSetWrapper(resultSet, cb, - // outsideSqlContext.isOffsetByCursorForcedly(), - // outsideSqlContext.isLimitByCursorForcedly()); - // } else { - // wrapper = new FetchNarrowingResultSetWrapper(resultSet, cb, false, - // false); - // } - // return wrapper; - } - - // protected boolean isUseFetchNarrowingResultSetWrapper(FetchNarrowingBean - // cb) { - // if (cb.getSafetyMaxResultSize() > 0) { - // return true; - // } - // if (!cb.isFetchNarrowingEffective()) { - // return false;// It is not necessary to control. - // } - // if (OutsideSqlContext.isExistOutsideSqlContextOnThread()) { - // final OutsideSqlContext outsideSqlContext = - // OutsideSqlContext.getOutsideSqlContextOnThread(); - // if (outsideSqlContext.isOffsetByCursorForcedly() || - // outsideSqlContext.isLimitByCursorForcedly()) { - // return true; - // } - // } - // if (cb.isFetchNarrowingSkipStartIndexEffective() || - // cb.isFetchNarrowingLoopCountEffective()) { - // return true; - // } - // return false; - // } - - //========================================================================== - // ========= - // JDBC Delegator - // ============== - protected ResultSet doGetResultSet(Statement statement) { - try { - return statement.getResultSet(); - } catch (SQLException e) { - handleSQLException(e, statement); - return null;// Unreachable! - } - } - - protected ResultSet executeQuery(PreparedStatement ps) { - try { - return ps.executeQuery(); - } catch (SQLException e) { - handleSQLException(e, ps); - return null;// Unreachable! - } - } - - protected void handleSQLException(SQLException e, Statement statement) { - new SQLExceptionHandler().handleSQLException(e, statement); - } -} Modified: addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/s2dao/FetchNarrowingResultSetWrapper.java =================================================================== --- addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/s2dao/FetchNarrowingResultSetWrapper.java 2008-12-27 22:02:56 UTC (rev 1623) +++ addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/s2dao/FetchNarrowingResultSetWrapper.java 2008-12-27 22:06:42 UTC (rev 1624) @@ -4,6 +4,7 @@ import java.sql.SQLException; import java.sql.Statement; +import jp.sf.pal.addresslist.db.allcommon.DBDef; import jp.sf.pal.addresslist.db.allcommon.cbean.FetchNarrowingBean; import jp.sf.pal.addresslist.db.allcommon.s2dao.internal.sqlhandler.InternalBasicHandler.SQLExceptionHandler; @@ -41,6 +42,9 @@ /** Does it skip to cursor end? */ protected boolean _skipToCursorEnd; + /** Is the database DB2? */ + protected final boolean _db2 = DBDef.isCurrentDef(DBDef.DB2); + //========================================================================== // ========= // Constructor @@ -71,7 +75,7 @@ // Skip // ==== /** - * Skip to start-index. + * Skip to the point at start index. */ protected void skip() { if (!isAvailableSkipRecord()) { @@ -125,12 +129,15 @@ // Next // ==== /** - * Next. + * Move to the next record. * * @return Does the result set have next record? * @throws SQLException */ public boolean next() throws SQLException { + if (_db2 && _skipToCursorEnd) { // [DBFLUTE-243] + return false; + } final boolean hasNext = super.next(); ++_requestCounter; if (!isAvailableLimitLoopCount()) { Added: addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/s2dao/PropertyTypeFactoryBuilderExtension.java =================================================================== --- addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/s2dao/PropertyTypeFactoryBuilderExtension.java (rev 0) +++ addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/s2dao/PropertyTypeFactoryBuilderExtension.java 2008-12-27 22:06:42 UTC (rev 1624) @@ -0,0 +1,215 @@ +package jp.sf.pal.addresslist.db.allcommon.s2dao; + +import java.sql.DatabaseMetaData; +import java.util.ArrayList; +import java.util.List; + +import jp.sf.pal.addresslist.db.allcommon.Entity; +import jp.sf.pal.addresslist.db.allcommon.dbmeta.DBMeta; + +import org.seasar.dao.BeanAnnotationReader; +import org.seasar.dao.ColumnNaming; +import org.seasar.dao.Dbms; +import org.seasar.dao.PropertyTypeFactory; +import org.seasar.dao.PropertyTypeFactoryBuilder; +import org.seasar.dao.ValueTypeFactory; +import org.seasar.dao.impl.AbstractPropertyTypeFactory; +import org.seasar.extension.jdbc.PropertyType; +import org.seasar.framework.beans.BeanDesc; +import org.seasar.framework.beans.PropertyDesc; + +/** + * The factory builder of property type for S2Dao. {Since S2Dao-1.0.47} + * + * @author DBFlute(AutoGenerator) + */ + ¡÷ SuppressWarnings("unchecked") +public class PropertyTypeFactoryBuilderExtension implements + PropertyTypeFactoryBuilder { + + //========================================================================== + // ========= + // Attribute + // ========= + protected ValueTypeFactory valueTypeFactory; + + protected ColumnNaming columnNaming; + + //========================================================================== + // ========= + // Build + // ===== + public PropertyTypeFactory build(Class beanClass, + BeanAnnotationReader beanAnnotationReader) { + return new FastPropertyTypeFactoryExtension(beanClass, + beanAnnotationReader, valueTypeFactory, columnNaming); + } + + public PropertyTypeFactory build(Class beanClass, + BeanAnnotationReader beanAnnotationReader, Dbms dbms, + DatabaseMetaData databaseMetaData) { + return new FastPropertyTypeFactoryExtension(beanClass, + beanAnnotationReader, valueTypeFactory, columnNaming, dbms); + } + + //========================================================================== + // ========= + // Extension Class + // =============== + protected static class FastPropertyTypeFactoryExtension extends + AbstractPropertyTypeFactory { + + protected DBMeta _dbmeta; + + protected String[] _noPersisteneProps; + + public FastPropertyTypeFactoryExtension(Class beanClass, + BeanAnnotationReader beanAnnotationReader, + ValueTypeFactory valueTypeFactory, ColumnNaming columnNaming) { + super(beanClass, beanAnnotationReader, valueTypeFactory, + columnNaming); + initializeResources(); + } + + public FastPropertyTypeFactoryExtension(Class beanClass, + BeanAnnotationReader beanAnnotationReader, + ValueTypeFactory valueTypeFactory, ColumnNaming columnNaming, + Dbms dbms) { + super(beanClass, beanAnnotationReader, valueTypeFactory, + columnNaming, dbms); + initializeResources(); + } + + protected void initializeResources() { + if (isEntity()) { + _dbmeta = findDBMeta(); + } + _noPersisteneProps = beanAnnotationReader.getNoPersisteneProps(); + } + + protected boolean isEntity() { + return Entity.class.isAssignableFrom(beanClass); + } + + protected boolean hasDBMeta() { + return _dbmeta != null; + } + + protected DBMeta findDBMeta() { + try { + final Entity entity = (Entity) beanClass.newInstance(); + return entity.getDBMeta(); + } catch (Exception e) { + String msg = "beanClass.newInstance() threw the exception: beanClass=" + + beanClass; + throw new RuntimeException(msg, e); + } + } + + public PropertyType[] createBeanPropertyTypes(String tableName) { + final List list = new ArrayList(); + 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: addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/s2dao/PropertyTypeFactoryBuilderExtension.java ___________________________________________________________________ Name: svn:eol-style + native Deleted: addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/s2dao/S2BeanMetaDataFactoryImpl.java =================================================================== --- addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/s2dao/S2BeanMetaDataFactoryImpl.java 2008-12-27 22:02:56 UTC (rev 1623) +++ addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/s2dao/S2BeanMetaDataFactoryImpl.java 2008-12-27 22:06:42 UTC (rev 1624) @@ -1,116 +0,0 @@ -package jp.sf.pal.addresslist.db.allcommon.s2dao; - -import java.sql.DatabaseMetaData; -import java.util.Collections; -import java.util.HashMap; -import java.util.Map; - -import jp.sf.pal.addresslist.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, BeanMetaData> _metaMap = Collections - .synchronizedMap(new HashMap, BeanMetaData>()); - - @Override - public BeanMetaData createBeanMetaData(Class beanClass) { - final BeanMetaData cachedMeta = findCachedMeta(beanClass); - if (cachedMeta != null) { - return cachedMeta; - } else { - return super.createBeanMetaData(beanClass); - } - } - - @Override - public BeanMetaData createBeanMetaData(Class beanClass, - int relationNestLevel) { - final BeanMetaData cachedMeta = findCachedMeta(beanClass); - if (cachedMeta != null) { - return cachedMeta; - } else { - return super.createBeanMetaData(beanClass, relationNestLevel); - } - } - - @Override - public BeanMetaData createBeanMetaData(DatabaseMetaData dbMetaData, - Class beanClass, int relationNestLevel) { - final BeanMetaData cachedMeta = findOrCreateCachedMetaIfNeeds( - dbMetaData, beanClass, relationNestLevel); - if (cachedMeta != null) { - return cachedMeta; - } else { - return super.createBeanMetaData(dbMetaData, beanClass, - relationNestLevel); - } - } - - protected BeanMetaData findCachedMeta(Class beanClass) { - if (isDBFluteEntity(beanClass)) { - final BeanMetaData cachedMeta = getMetaFromCache(beanClass); - if (cachedMeta != null) { - return cachedMeta; - } - } - return null; - } - - protected BeanMetaData findOrCreateCachedMetaIfNeeds( - DatabaseMetaData dbMetaData, Class beanClass, int relationNestLevel) { - if (isDBFluteEntity(beanClass)) { - final BeanMetaData cachedMeta = getMetaFromCache(beanClass); - if (cachedMeta != null) { - return cachedMeta; - } else { - return super.createBeanMetaData(dbMetaData, beanClass, 0); - } - } - return null; - } - - @Override - protected BeanMetaDataImpl createBeanMetaDataImpl() { - return new BeanMetaDataImpl() { - @Override - public void initialize() { - final Class myBeanClass = getBeanClass(); - if (isDBFluteEntity(myBeanClass)) { - final BeanMetaData cachedMeta = getMetaFromCache(myBeanClass); - if (cachedMeta == null) { - _metaMap.put(myBeanClass, this); - } - } - super.initialize(); - } - }; - } - - protected boolean isDBFluteEntity(Class beanClass) { - return Entity.class.isAssignableFrom(beanClass); - } - - protected BeanMetaData getMetaFromCache(Class beanClass) { - return _metaMap.get(beanClass); - } - - /** - * Get the limit nest level of relation. - * - * @return The limit nest level of relation. - */ - @Override - protected int getLimitRelationNestLevel() { - return 2;// for Compatible to old version DBFlute - } -} \ No newline at end of file Deleted: addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/s2dao/S2DaoInterceptor.java =================================================================== --- addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/s2dao/S2DaoInterceptor.java 2008-12-27 22:02:56 UTC (rev 1623) +++ addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/s2dao/S2DaoInterceptor.java 2008-12-27 22:06:42 UTC (rev 1624) @@ -1,1027 +0,0 @@ -package jp.sf.pal.addresslist.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.addresslist.db.allcommon.Entity; -import jp.sf.pal.addresslist.db.allcommon.InternalMapContext; -import jp.sf.pal.addresslist.db.allcommon.XLog; -import jp.sf.pal.addresslist.db.allcommon.cbean.ConditionBean; -import jp.sf.pal.addresslist.db.allcommon.cbean.ConditionBeanContext; -import jp.sf.pal.addresslist.db.allcommon.cbean.FetchNarrowingBean; -import jp.sf.pal.addresslist.db.allcommon.cbean.FetchNarrowingBeanContext; -import jp.sf.pal.addresslist.db.allcommon.cbean.outsidesql.OutsideSqlContext; -import jp.sf.pal.addresslist.db.allcommon.cbean.outsidesql.OutsideSqlDao; -import jp.sf.pal.addresslist.db.allcommon.cbean.outsidesql.OutsideSqlOption; -import jp.sf.pal.addresslist.db.allcommon.dbmeta.DBMeta; -import jp.sf.pal.addresslist.db.allcommon.dbmeta.DBMetaInstanceHandler; -import jp.sf.pal.addresslist.db.allcommon.exception.EntityAlreadyUpdatedException; -import jp.sf.pal.addresslist.db.allcommon.helper.stacktrace.InvokeNameExtractingResource; -import jp.sf.pal.addresslist.db.allcommon.helper.stacktrace.InvokeNameResult; -import jp.sf.pal.addresslist.db.allcommon.helper.stacktrace.impl.InvokeNameExtractorImpl; -import jp.sf.pal.addresslist.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 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 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 suffixList = Arrays.asList(new String[] { "Bhv", - "BehaviorReadable", "BehaviorWritable", "PagingInvoker" }); - final List keywordList = Arrays.asList(new String[] { "Bhv$", - "BehaviorReadable$", "BehaviorWritable$" }); - final List ousideSql1List = Arrays - .asList(new String[] { "OutsideSql" }); - final List ousideSql2List = Arrays - .asList(new String[] { "Executor" }); - final List 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 suffixList) { - for (String suffix : suffixList) { - if (className.endsWith(suffix)) { - return true; - } - } - return false; - } - - protected boolean isClassNameContains(String className, - List 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 outsideSqlType = jp.sf.pal.addresslist.db.allcommon.annotation.OutsideSql.class; - final jp.sf.pal.addresslist.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. - *

- * If this method is condition bean select target, make dynamic SQL. Else - * nothing. - * - * @param invocation Method invocation. (NotNull) - * @return ConditionBean. (Nullable) - */ - protected ConditionBean preprocessConditionBean(MethodInvocation invocation) { - final OutsideSqlContext outsideSqlContext = getOutsideSqlContext(); - if (outsideSqlContext != null) { - return null; // Because it has already finished setting up - // fetchNarrowingBean for outsideSql here. - } - - final ConditionBean cb; - { - final Object[] args = invocation.getArguments(); - if (args == null || args.length == 0) { - return null; - } - final Object arg0 = args[0]; - if (arg0 == null) { - return null; - } - if (!ConditionBeanContext.isTheTypeConditionBean(arg0.getClass())) {// The - // argument - // is - // not - // condition - // - - // bean - // ... - if (FetchNarrowingBeanContext.isTheTypeFetchNarrowingBean(arg0 - .getClass()) - && !isSelectCountIgnoreFetchScopeMethod(invocation)) { - // Fetch-narrowing-bean and Not select count! - FetchNarrowingBeanContext - .setFetchNarrowingBeanOnThread((FetchNarrowingBean) arg0); - } - return null; - } - cb = (ConditionBean) arg0; - } - - if (isSelectCountIgnoreFetchScopeMethod(invocation)) { - cb.xsetupSelectCountIgnoreFetchScope(); - } else { - FetchNarrowingBeanContext.setFetchNarrowingBeanOnThread(cb); - } - - ConditionBeanContext.setConditionBeanOnThread(cb); - return cb; - } - - /** - * Post-process condition-bean. - * - * @param invocation Method invocation. (NotNull) - * @param cb Condition-bean. (Nullable) - */ - protected void postprocessConditionBean(MethodInvocation invocation, - ConditionBean cb) { - if (cb == null) { - return; - } - if (isSelectCountIgnoreFetchScopeMethod(invocation)) { - cb.xafterCareSelectCountIgnoreFetchScope(); - } - } - - // ----------------------------------------------------- - // Clear Thread Local - // ------------------ - protected void clearThreadLocal() { - if (OutsideSqlContext.isExistOutsideSqlContextOnThread()) { - OutsideSqlContext.clearOutsideSqlContextOnThread(); - } - if (FetchNarrowingBeanContext.isExistFetchNarrowingBeanOnThread()) { - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - // Because there is possible that fetch narrowing has been ignored - // for manualPaging of outsideSql. - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - FetchNarrowingBeanContext.getFetchNarrowingBeanOnThread() - .restoreIgnoredFetchNarrowing(); - - FetchNarrowingBeanContext.clearFetchNarrowingBeanOnThread(); - } - if (ConditionBeanContext.isExistConditionBeanOnThread()) { - ConditionBeanContext.clearConditionBeanOnThread(); - } - if (InternalMapContext.isExistInternalMapContextOnThread()) { - InternalMapContext.clearInternalMapContextOnThread(); - } - } - - //========================================================================== - // ========= - // Context Helper - // ============== - protected OutsideSqlContext getOutsideSqlContext() { - if (!OutsideSqlContext.isExistOutsideSqlContextOnThread()) { - return null; - } - return OutsideSqlContext.getOutsideSqlContextOnThread(); - } - - protected boolean isSpecifiedOutsideSql() { - final OutsideSqlContext outsideSqlContext = getOutsideSqlContext(); - return outsideSqlContext != null - && outsideSqlContext.isSpecifiedOutsideSql(); - } - - protected void putObjectToMapContext(String key, Object value) { - InternalMapContext.setObject(key, value); - } - - //========================================================================== - // ========= - // Determination - // ============= - /** - * Is select count ignore-fetch-scope method? - * - * @param invocation Method invocation. (NotNull) - * @return Determination. - */ - protected boolean isSelectCountIgnoreFetchScopeMethod( - MethodInvocation invocation) { - final String name = invocation.getMethod().getName(); - return name.startsWith("readCount") || name.startsWith("selectCount"); - } - - //========================================================================== - // ========= - // General Helper - // ============== - /** - * Is the method abstract? - * - * @param method Method. (NotNull) - * @return Determination. (NotNull) - */ - public boolean isAbstract(Method method) { - final int mod = method.getModifiers(); - return Modifier.isAbstract(mod); - } - - /** - * Get the value of line separator. - * - * @return The value of line separator. (NotNull) - */ - protected String getLineSeparator() { - return System.getProperty("line.separator"); - } -} \ No newline at end of file Deleted: addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/s2dao/S2DaoLatestSqlProvider.java =================================================================== --- addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/s2dao/S2DaoLatestSqlProvider.java 2008-12-27 22:02:56 UTC (rev 1623) +++ addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/s2dao/S2DaoLatestSqlProvider.java 2008-12-27 22:06:42 UTC (rev 1624) @@ -1,20 +0,0 @@ -package jp.sf.pal.addresslist.db.allcommon.s2dao; - -import jp.sf.pal.addresslist.db.allcommon.jdbc.LatestSqlProvider; -import jp.sf.pal.addresslist.db.allcommon.s2dao.internal.sqllog.InternalSqlLogRegistry; - -/** - * The provider of latest SQL as S2Dao. This instance should be singleton. - * - * @author DBFlute(AutoGenerator) - */ -public class S2DaoLatestSqlProvider implements LatestSqlProvider { - - public String getDisplaySql() { - return InternalSqlLogRegistry.peekCompleteSql(); - } - - public void clearSqlCache() { - InternalSqlLogRegistry.clearSqlLogRegistry(); - } -} Deleted: addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/s2dao/S2DaoMetaDataExtension.java =================================================================== --- addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/s2dao/S2DaoMetaDataExtension.java 2008-12-27 22:02:56 UTC (rev 1623) +++ addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/s2dao/S2DaoMetaDataExtension.java 2008-12-27 22:06:42 UTC (rev 1624) @@ -1,1460 +0,0 @@ -package jp.sf.pal.addresslist.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.addresslist.db.allcommon.BehaviorSelector; -import jp.sf.pal.addresslist.db.allcommon.Entity; -import jp.sf.pal.addresslist.db.allcommon.annotation.OutsideSql; -import jp.sf.pal.addresslist.db.allcommon.cbean.ConditionBean; -import jp.sf.pal.addresslist.db.allcommon.cbean.ConditionBeanContext; -import jp.sf.pal.addresslist.db.allcommon.cbean.outsidesql.OutsideSqlContext; -import jp.sf.pal.addresslist.db.allcommon.dbmeta.DBMeta; -import jp.sf.pal.addresslist.db.allcommon.exception.BatchEntityAlreadyUpdatedException; -import jp.sf.pal.addresslist.db.allcommon.exception.EntityAlreadyDeletedException; -import jp.sf.pal.addresslist.db.allcommon.exception.EntityDuplicatedException; -import jp.sf.pal.addresslist.db.allcommon.jdbc.CursorHandler; -import jp.sf.pal.addresslist.db.allcommon.s2dao.internal.rshandler.InternalBeanArrayMetaDataResultSetHandler; -import jp.sf.pal.addresslist.db.allcommon.s2dao.internal.rshandler.InternalBeanListMetaDataResultSetHandler; -import jp.sf.pal.addresslist.db.allcommon.s2dao.internal.sqlcommand.InternalDeleteAutoStaticCommand; -import jp.sf.pal.addresslist.db.allcommon.s2dao.internal.sqlcommand.InternalDeleteBatchAutoStaticCommand; -import jp.sf.pal.addresslist.db.allcommon.s2dao.internal.sqlcommand.InternalDeleteQueryAutoDynamicCommand; -import jp.sf.pal.addresslist.db.allcommon.s2dao.internal.sqlcommand.InternalInsertAutoDynamicCommand; -import jp.sf.pal.addresslist.db.allcommon.s2dao.internal.sqlcommand.InternalInsertBatchAutoStaticCommand; -import jp.sf.pal.addresslist.db.allcommon.s2dao.internal.sqlcommand.InternalProcedureCommand; -import jp.sf.pal.addresslist.db.allcommon.s2dao.internal.sqlcommand.InternalUpdateAutoDynamicCommand; -import jp.sf.pal.addresslist.db.allcommon.s2dao.internal.sqlcommand.InternalUpdateBatchAutoStaticCommand; -import jp.sf.pal.addresslist.db.allcommon.s2dao.internal.sqlcommand.InternalUpdateDynamicCommand; -import jp.sf.pal.addresslist.db.allcommon.s2dao.internal.sqlcommand.InternalUpdateModifiedOnlyCommand; -import jp.sf.pal.addresslist.db.allcommon.s2dao.internal.sqlcommand.InternalUpdateQueryAutoDynamicCommand; -import jp.sf.pal.addresslist.db.allcommon.s2dao.internal.sqlhandler.InternalDeleteBatchAutoHandler; -import jp.sf.pal.addresslist.db.allcommon.s2dao.internal.sqlhandler.InternalUpdateBatchAutoHandler; -import jp.sf.pal.addresslist.db.allcommon.s2dao.internal.sqlhandler.InternalBasicHandler.SQLExceptionHandler; -import jp.sf.pal.addresslist.db.allcommon.s2dao.internal.various.InternalProcedureMetaData; -import jp.sf.pal.addresslist.db.allcommon.s2dao.internal.various.InternalProcedureMetaDataFactory; -import jp.sf.pal.addresslist.db.allcommon.s2dao.internal.various.InternalRelationRowCreator; -import jp.sf.pal.addresslist.db.allcommon.s2dao.internal.various.InternalRowCreator; -import jp.sf.pal.addresslist.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 ret = new ArrayList(); - while (rs.next()) { - ret.add(valueType.getValue(rs, 1)); - } - return ret; - } - } - - protected BeanMetaData createSpecifiedOutsideSqlCursorBeanMetaData( - Method method) { - return createOutsideSqlCustomizeBeanMetaDataFactory() - .createBeanMetaData(getOutsideSqlDefaultBeanClass(method)); - } - - protected ResultSetHandler createSpecifiedOutsideSqlCursorResultSetHandler( - BeanMetaData specifiedBeanMetaData) { - return new org.seasar.extension.jdbc.impl.ObjectResultSetHandler();// This - // is - // dummy - // for - // cursor - // handling - // ! - } - - // - - - - - - - - - - - - - // Execute - // - - - - - protected void setupSpecifiedOutsideSqlExecuteCommand(String sqlCommandKey, - Method method, OutsideSqlContext outsideSqlContext) { - // - - - - - - - - - - - - - - - - - - - - - - - - // The attribute of Specified-OutsideSqlContext. - // - - - - - - - - - - - - - - - - - - - - - - - - final String sql = outsideSqlContext.readFilteredOutsideSql( - getSqlFileEncoding(), dbms.getSuffix()); - final Object pmb = outsideSqlContext.getParameterBean(); - - // - - - - - - - - - - - - - - - - // The attribute of SqlCommand. - // - - - - - - - - - - - - - - - - final String[] argNames = (pmb != null ? new String[] { "pmb" } - : new String[] {}); - final Class[] argTypes = (pmb != null ? new Class[] { pmb - .getClass() } : new Class[] {}); - - final InternalUpdateDynamicCommand cmd = new InternalUpdateDynamicCommand( - dataSource, statementFactory) { - @Override - public Object execute(Object[] args) { - if (args.length != 3) { - String msg = "Internal Error! OutsideSqlDao.execute() should have 3 arguements: args.length=" - + args.length; - throw new IllegalStateException(msg); - } - Object arg = args[1]; - return super.execute(new Object[] { arg }); - } - }; - - // It is unnecessary for DBFlute! - // cmd.setNotSingleRowUpdatedExceptionClass( - // getNotSingleRowUpdatedExceptionClass(method)); - - registerSqlCommand(sqlCommandKey, method, sql, argNames, argTypes, cmd); - } - - // - - - - - - - - - - - - - // Call Procedure - // - - - - - - - - protected void setupSpecifiedOutsideSqlCallCommand(String sqlCommandKey, - Method method, OutsideSqlContext outsideSqlContext) { - // - - - - - - - - - - - - - - - - - - - - - - - - // The attribute of Specified-OutsideSqlContext. - // - - - - - - - - - - - - - - - - - - - - - - - - final Object pmb = outsideSqlContext.getParameterBean(); - final String procedureName = outsideSqlContext.getOutsideSqlPath(); - - // - - - - - - - - - - - - - - - - // The attribute of SqlCommand. - // - - - - - - - - - - - - - - - - final InternalProcedureMetaDataFactory factory = createInternalProcedureMetaDataFactory(); - factory.setValueTypeFactory(valueTypeFactory); - final Class pmbType = pmb != null ? pmb.getClass() : null; - final InternalProcedureMetaData metaData = factory - .createProcedureMetaData(procedureName, pmbType); - final InternalProcedureCommand cmd = createInternalProcedureCommand( - method, metaData); - putSqlCommand(sqlCommandKey, cmd); - } - - protected InternalProcedureMetaDataFactory createInternalProcedureMetaDataFactory() { - return new InternalProcedureMetaDataFactory(); - } - - protected InternalProcedureCommand createInternalProcedureCommand( - Method method, InternalProcedureMetaData metaData) { - final ResultSetHandler resultSetHandler = createResultSetHandler(method); - return new InternalProcedureCommand(dataSource, resultSetHandler, - statementFactory, metaData); - } - - // ----------------------------------------------------- - // Common of OutsideSql - // -------------------- - protected BeanMetaDataFactory createOutsideSqlCustomizeBeanMetaDataFactory() { - final S2BeanMetaDataFactoryImpl originalBmdFactory = new S2BeanMetaDataFactoryImpl() { - protected BeanMetaDataImpl createBeanMetaDataImpl() { - return newOutsideSqlCustomizeBeanMetaDataImpl(); - } - }; - originalBmdFactory - .setAnnotationReaderFactory(this.annotationReaderFactory); - originalBmdFactory - .setPropertyTypeFactoryBuilder(createOutsideSqlPropertyTypeFactoryBuilder()); - originalBmdFactory - .setRelationPropertyTypeFactoryBuilder(this.relationPropertyTypeFactoryBuilder); - originalBmdFactory.setTableNaming(this.tableNaming); - originalBmdFactory.setDataSource(this.dataSource); - originalBmdFactory.setDaoNamingConvention(this.daoNamingConvention); - originalBmdFactory.setBeanEnhancer(this.beanEnhancer); - return originalBmdFactory; - } - - protected BeanMetaDataImpl newOutsideSqlCustomizeBeanMetaDataImpl() { - return new OutsideSqlCustomizeBeanMetaDataImpl(); - } - - protected static class OutsideSqlCustomizeBeanMetaDataImpl extends - BeanMetaDataImpl { - // Though nothing to override, it uses original class just in case. - } - - protected S2DaoPropertyTypeFactoryBuilderExtension createOutsideSqlPropertyTypeFactoryBuilder() { - final S2DaoPropertyTypeFactoryBuilderExtension impl = new S2DaoPropertyTypeFactoryBuilderExtension(); - if (columnNaming == null) { - String msg = "Internal Error! The columnNaming should not be null! {Failed to Injection!}"; - throw new IllegalStateException(msg); - } - impl.setColumnNaming(columnNaming); - impl.setValueTypeFactory(valueTypeFactory); - return impl; - } - - protected Class getOutsideSqlDefaultBeanClass(Method method) { - final Class retType = method.getReturnType(); - if (java.util.List.class.isAssignableFrom(retType)) { - final Class elementType = InternalMethodUtil - .getElementTypeOfListFromReturnMethod(method); - if (elementType != null) { - return elementType; - } else { - return getBeanClass(); - } - } else if (retType.isArray()) { - return retType.getComponentType(); - } else if (retType.isPrimitive() - || !ValueTypes.getValueType(retType).equals(ValueTypes.OBJECT)) { - return getBeanClass(); - } else { - return retType; - } - } - - protected void registerSqlCommand(String sqlCommandKey, Method method, - String sql, String[] argNames, Class[] argTypes, - BeanMetaData myBeanMetaData) { - registerSqlCommand(sqlCommandKey, method, sql, argNames, argTypes, - createResultSetHandler(myBeanMetaData, method)); - } - - protected void registerSqlCommand(String sqlCommandKey, Method method, - String sql, String[] argNames, Class[] argTypes, - ResultSetHandler myResultSetHandler) { - final S2DaoSelectDynamicCommand cmd = createCustomizeSelectDynamicCommand(myResultSetHandler); - registerSqlCommand(sqlCommandKey, method, sql, argNames, argTypes, cmd); - } - - protected void registerSqlCommand(String sqlCommandKey, Method method, - String sql, String[] argNames, Class[] argTypes, - S2DaoSelectDynamicCommand cmd) { - cmd.setSql(sql); - cmd.setArgNames(argNames); - cmd.setArgTypes(argTypes); - this.sqlCommands.put(sqlCommandKey, cmd); - } - - protected void registerSqlCommand(String sqlCommandKey, Method method, - String sql, String[] argNames, Class[] argTypes, - InternalUpdateDynamicCommand cmd) { - cmd.setSql(sql); - cmd.setArgNames(argNames); - cmd.setArgTypes(argTypes); - this.sqlCommands.put(sqlCommandKey, cmd); - } - - //========================================================================== - // ========= - // Common Handlnig - // =============== - @Override - protected void putSqlCommand(String methodName, SqlCommand cmd) { - sqlCommands.put(methodName, cmd); - } - - protected boolean isCheckSingleRowUpdate(Method method) { - return checkSingleRowUpdateForAll - & daoAnnotationReader.isCheckSingleRowUpdate(method); - } - - //========================================================================== - // ========= - // Customize SelectDynamicCommand Creation - // ======================================= - /** - * Create the customize select dynamic command that is for all select SQL on - * DBFlute. - * - * @param handler The handler of result set. (NotNull) - * @return The customize select dynamic command. (NotNull) - */ - protected S2DaoSelectDynamicCommand createCustomizeSelectDynamicCommand( - ResultSetHandler handler) { - return new S2DaoSelectDynamicCommand(dataSource, statementFactory, - handler); - } - - //========================================================================== - // ========= - // ResultSetHandler Override - // ========================= - @Override - protected ResultSetHandler createResultSetHandler(Method method) { - return this.resultSetHandlerFactory.getResultSetHandler( - daoAnnotationReader, beanMetaData, method); - } - - protected ResultSetHandler createResultSetHandler( - BeanMetaData specifiedBeanMetaData, Method method) {// For specified - // BeanMetaData - return this.resultSetHandlerFactory.getResultSetHandler( - daoAnnotationReader, specifiedBeanMetaData, method); - } - - //========================================================================== - // ========= - // JDBC Delegator - // ============== - protected Connection getConnection() { - if (dataSource == null) { - throw new IllegalStateException( - "The dataSource should not be null!"); - } - try { - return dataSource.getConnection(); - } catch (SQLException e) { - handleSQLException(e, null); - return null;// Unreachable! - } - } - - protected DatabaseMetaData getMetaData(Connection conn) { - try { - return conn.getMetaData(); - } catch (SQLException e) { - handleSQLException(e, null); - return null;// Unreachable! - } - } - - protected String getDatabaseProductName(DatabaseMetaData dbMetaData) { - try { - return dbMetaData.getDatabaseProductName(); - } catch (SQLException e) { - handleSQLException(e, null); - return null;// Unreachable! - } - } - - protected void close(Connection conn) { - if (conn == null) { - return; - } - try { - conn.close(); - } catch (SQLException e) { - handleSQLException(e, null); - } - } - - //========================================================================== - // ========= - // Exception Handlnig - // ================== - protected void handleSQLException(SQLException e, Statement statement) { - new SQLExceptionHandler().handleSQLException(e, statement); - } - - //========================================================================== - // ========= - // ResultSetHandlerFactoryImpl Extension - // ===================================== - public static class ResultSetHandlerFactoryExtension extends - ResultSetHandlerFactoryImpl { - public ResultSetHandlerFactoryExtension() { - super(); - } - - @Override - protected RowCreator createRowCreator() { // [DAO-118] (2007/08/25) - return createInternalRowCreator(null); - } - - @Override - protected RelationRowCreator createRelationRowCreator() { - return createInternalRelationRowCreator(null); - } - - @Override - protected ResultSetHandler createBeanListMetaDataResultSetHandler( - BeanMetaData bmd) { // DBFlute Target - final InternalRowCreator rowCreator = createInternalRowCreator(bmd); - final InternalRelationRowCreator relationRowCreator = createInternalRelationRowCreator(bmd); - return new InternalBeanListMetaDataResultSetHandler(bmd, - rowCreator, relationRowCreator); - } - - @Override - protected ResultSetHandler createBeanArrayMetaDataResultSetHandler( - BeanMetaData bmd) { // DBFlute Target - final InternalRowCreator rowCreator = createInternalRowCreator(bmd); - final InternalRelationRowCreator relationRowCreator = createInternalRelationRowCreator(bmd); - return new InternalBeanArrayMetaDataResultSetHandler(bmd, - rowCreator, relationRowCreator); - } - - protected InternalRowCreator createInternalRowCreator(BeanMetaData bmd) { - final Class clazz = bmd != null ? bmd.getBeanClass() : null; - return InternalRowCreator.createInternalRowCreator(clazz); - } - - protected InternalRelationRowCreator createInternalRelationRowCreator( - BeanMetaData bmd) { - return new InternalRelationRowCreator(); // Not yet implemented - // about performance - // tuning! - } - } - - //========================================================================== - // ========= - // Vert Internal - // ============= - protected static class InternalMethodUtil { - public static Class getElementTypeOfListFromReturnMethod(Method method) { - return InternalReflectionUtil - .getElementTypeOfListFromReturnType(method); - } - } - - protected static class InternalReflectionUtil { - public static Class getElementTypeOfList(final Type parameterizedList) { - if (!(parameterizedList instanceof ParameterizedType)) { - return null; - } - final ParameterizedType parameterizedType = ParameterizedType.class - .cast(parameterizedList); - final Type rawType = parameterizedType.getRawType(); - if (!(rawType instanceof Class)) { - return null; - } - final Class rawClass = Class.class.cast(rawType); - if (!rawClass.isAssignableFrom(List.class)) { - return null; - } - final Type[] actualTypeArgument = parameterizedType - .getActualTypeArguments(); - if (actualTypeArgument == null || actualTypeArgument.length != 1) { - return null; - } - if (!(actualTypeArgument[0] instanceof Class)) { - return null; - } - return Class.class.cast(actualTypeArgument[0]); - } - - public static Class getElementTypeOfListFromParameterType( - final Method method, final int parameterPosition) { - final Type[] pmbTypes = method.getGenericParameterTypes(); - return getElementTypeOfList(pmbTypes[parameterPosition]); - } - - public static Class getElementTypeOfListFromReturnType( - final Method method) { - return getElementTypeOfList(method.getGenericReturnType()); - } - } - - //========================================================================== - // ========= - // Assist Helper - // ============= - protected DBMeta findDBMeta() { - final Class beanType = getBeanClass(); - if (beanType == null) { - return null; - } - if (!Entity.class.isAssignableFrom(beanType)) { - return null; - } - final Entity entity; - try { - entity = (Entity) beanType.newInstance(); - } catch (InstantiationException e) { - throw new IllegalStateException(e); - } catch (IllegalAccessException e) { - throw new IllegalStateException(e); - } - return entity.getDBMeta(); - } - - //========================================================================== - // ========= - // General Helper - // ============== - protected String getLineSeparator() { - return SimpleSystemUtil.getLineSeparator(); - } - - //========================================================================== - // ========= - // Accessor - // ======== - // ----------------------------------------------------- - // Sql File Encoding - // ----------------- - public String getSqlFileEncoding() { - return sqlFileEncoding; - } - - // ----------------------------------------------------- - // Bean Enhancer - // ------------- - public BeanEnhancer getBeanEnhancer() { - return beanEnhancer; - } - - public void setBeanEnhancer(final BeanEnhancer beanEnhancer) { - this.beanEnhancer = beanEnhancer; - } - - // ----------------------------------------------------- - // Annotation Reader Factory - // ------------------------- - public void setAnnotationReaderFactory( - org.seasar.dao.AnnotationReaderFactory annotationReaderFactory) { - this.annotationReaderFactory = annotationReaderFactory; - } - - // ----------------------------------------------------- - // Version After 1.0.47 - // -------------------- - public ColumnNaming getColumnNaming() { - return columnNaming; - } - - public void setColumnNaming(final ColumnNaming columnNaming) { - this.columnNaming = columnNaming; - } - - public PropertyTypeFactoryBuilder getPropertyTypeFactoryBuilder() { - return propertyTypeFactoryBuilder; - } - - public void setPropertyTypeFactoryBuilder( - final PropertyTypeFactoryBuilder propertyTypeFactoryBuilder) { - this.propertyTypeFactoryBuilder = propertyTypeFactoryBuilder; - } - - public RelationPropertyTypeFactoryBuilder getRelationPropertyTypeFactoryBuilder() { - return relationPropertyTypeFactoryBuilder; - } - - public void setRelationPropertyTypeFactoryBuilder( - final RelationPropertyTypeFactoryBuilder relationPropertyTypeFactoryBuilder) { - this.relationPropertyTypeFactoryBuilder = relationPropertyTypeFactoryBuilder; - } - - public TableNaming getTableNaming() { - return tableNaming; - } - - public void setTableNaming(final TableNaming tableNaming) { - this.tableNaming = tableNaming; - } - - // ----------------------------------------------------- - // DBFlute Extension - // ----------------- - public BehaviorSelector getBehaviorSelector() { - return _behaviorSelector; - } - - public void setBehaviorSelector(final BehaviorSelector behaviorSelector) { - this._behaviorSelector = behaviorSelector; - } - - public boolean isInternalDebug() { - return _internalDebug; - } - - public void setInternalDebug(final boolean internalDebug) { - this._internalDebug = internalDebug; - } -} Deleted: addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/s2dao/S2DaoMetaDataFactoryImpl.java =================================================================== --- addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/s2dao/S2DaoMetaDataFactoryImpl.java 2008-12-27 22:02:56 UTC (rev 1623) +++ addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/s2dao/S2DaoMetaDataFactoryImpl.java 2008-12-27 22:06:42 UTC (rev 1624) @@ -1,655 +0,0 @@ -package jp.sf.pal.addresslist.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.addresslist.db.allcommon.DBFluteConfig; -import jp.sf.pal.addresslist.db.allcommon.cbean.ConditionBean; -import jp.sf.pal.addresslist.db.allcommon.cbean.ConditionBeanContext; -import jp.sf.pal.addresslist.db.allcommon.cbean.outsidesql.OutsideSqlContext; -import jp.sf.pal.addresslist.db.allcommon.jdbc.StatementConfig; -import jp.sf.pal.addresslist.db.allcommon.s2dao.internal.sqlhandler.InternalBasicHandler.SQLExceptionHandler; -import jp.sf.pal.addresslist.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 daoMetaDataCache = new HashMap(); - - protected boolean initialized; - - protected boolean useDaoClassForLog; - - protected String sqlFileEncoding; - - protected BeanEnhancer beanEnhancer; - - // ----------------------------------------------------- - // Version After 1.0.47 - // -------------------- - /** The naming of column. {After S2Dao-1.0.47} */ - protected ColumnNaming columnNaming; - - /** The builder of property type factory. {After S2Dao-1.0.47} */ - protected PropertyTypeFactoryBuilder propertyTypeFactoryBuilder; - - /** The builder of relation property type factory. {After S2Dao-1.0.47} */ - protected RelationPropertyTypeFactoryBuilder relationPropertyTypeFactoryBuilder; - - /** The builder of table naming. {After S2Dao-1.0.47} */ - protected TableNaming tableNaming; - - // ----------------------------------------------------- - // DBFlute Extension - // ----------------- - /** The lock monitor of DAO meta data initialization. */ - protected Object _daoMetaDataInitializationLockMonitor = new Object(); - - //========================================================================== - // ========= - // Constructor - // =========== - public S2DaoMetaDataFactoryImpl(DataSource dataSource, - AnnotationReaderFactory annotationReaderFactory, - XADataSource xaDataSource) { - this.dataSource = dataSource; - this.annotationReaderFactory = annotationReaderFactory; - - _log - .info("/* * * * * * * * * * * * * * * * * * * * * * * * * * * * {DBFlute}"); - showInformation(dataSource, xaDataSource); - - // Stop the LinkageError! - ConditionBeanContext.initialize(); - - initializeDatabaseProductNameOfContext(xaDataSource); - - handleSqlLogRegistry(); - - DBFluteConfig.getInstance().lock(); - _log.info("* * * * */"); - } - - protected void showInformation(javax.sql.DataSource dataSource, - javax.sql.XADataSource xaDataSource) { - final StringBuilder sb = new StringBuilder(); - if (xaDataSource != null - && xaDataSource instanceof org.seasar.extension.dbcp.impl.XADataSourceImpl) { - final org.seasar.extension.dbcp.impl.XADataSourceImpl xaDataSourceImpl = (org.seasar.extension.dbcp.impl.XADataSourceImpl) xaDataSource; - final String driverClassName = xaDataSourceImpl - .getDriverClassName(); - final String url = xaDataSourceImpl.getURL(); - final String user = xaDataSourceImpl.getUser(); - sb.append(" [XADataSource]:").append(getLineSeparator()); - sb.append(" driver = " + driverClassName).append( - getLineSeparator()); - sb.append(" url = " + url).append(getLineSeparator()); - sb.append(" user = " + user); - } - _log.info("{Injection Information}" + getLineSeparator() + sb); - } - - protected void handleSqlLogRegistry() { - final StringBuilder sb = new StringBuilder(); - sb.append("{SqlLog Information}").append(getLineSeparator()); - sb.append(" [SqlLogRegistry]").append(getLineSeparator()); - if (DBFluteConfig.getInstance().isUseSqlLogRegistry()) { - if (InternalSqlLogRegistry.setupSqlLogRegistry()) { - sb - .append( - " ...Setting up SqlLogRegistry(org.seasar.extension.jdbc)!") - .append(getLineSeparator()); - sb - .append(" Because the property 'useSqlLogRegistry' of the config of DBFlute is true."); - } else { - sb - .append(" SqlLogRegistry(org.seasar.extension.jdbc) is not supported at the version!"); - } - } else { - final Object sqlLogRegistry = InternalSqlLogRegistry - .findContainerSqlLogRegistry(); - if (sqlLogRegistry != null) { - InternalSqlLogRegistry.closeRegistration(); - sb - .append( - " SqlLogRegistry(org.seasar.extension.jdbc) is close! It's default for DBFlute.") - .append(getLineSeparator()); - sb - .append(" If you want to use this, set SqlLogRegistry to SqlLogRegistryLocator at yourself."); - } else { - sb - .append(" SqlLogRegistry(org.seasar.extension.jdbc) is not available!"); - } - } - _log.info(sb); - } - - // ----------------------------------------------------- - // Database Product Name - // --------------------- - protected void initializeDatabaseProductNameOfContext( - javax.sql.XADataSource xaDataSource) { - if (getDatabaseProductNameFromContext() != null) { - return; - } - - // From JDBC Driver! - if (xaDataSource != null - && xaDataSource instanceof org.seasar.extension.dbcp.impl.XADataSourceImpl) { - final org.seasar.extension.dbcp.impl.XADataSourceImpl xaDataSourceImpl = (org.seasar.extension.dbcp.impl.XADataSourceImpl) xaDataSource; - final String driverClassName = xaDataSourceImpl - .getDriverClassName(); - if (driverClassName != null) { - if (setupDatabaseProductNameByDriverClassName(driverClassName)) { - _log - .info("...Initializing database product name from driverClassName: " - + getDatabaseProductNameFromContext()); - return; - } - } - } - - _log.info("...Initializing database product name as default: H2"); - setDatabaseProductNameToContext("H2"); - } - - protected String getDatabaseProductNameFromContext() { - return ConditionBeanContext.getDatabaseProductName(); - } - - protected void setDatabaseProductNameToContext(String name) { - ConditionBeanContext.setDatabaseProductName(name); - } - - protected boolean setupDatabaseProductNameByDriverClassName( - String driverClassName) { - return ConditionBeanContext - .setupDatabaseProductNameByDriverClassName(driverClassName); - } - - //========================================================================== - // ========= - // Implementation - // ============== - @SuppressWarnings("unchecked") - public DaoMetaData getDaoMetaData(final Class daoClass) { - if (!initialized) { - DisposableUtil.add(this); - initialized = true; - } - final String key = daoClass.getName(); - - // [A] - DaoMetaData dmd = getSynchronizedDaoMetaDataCache(key); - - // [B] - if (dmd != null) { - return dmd; - } - - // [C] - synchronized (_daoMetaDataInitializationLockMonitor) {// One Thread Only - // Entered - // [D] - dmd = getSynchronizedDaoMetaDataCache(key); - // [E] - if (dmd != null) { - // The second thread that stops at [C] can find - // because the first thread have already initialized. - if (_log.isDebugEnabled()) { - _log - .debug("...Getting daoMetaData as cache because the previous thread have already initilized."); - } - return dmd; - } - // [F] - if (_log.isDebugEnabled()) { - _log.debug("...Creating daoMetaData for " - + daoClass.getSimpleName() + "."); - } - final DaoMetaData dmdi = createDaoMetaData(daoClass); - putSynchronizedDaoMetaDataCache(key, dmdi); - } - // [G] - dmd = getSynchronizedDaoMetaDataCache(key); - if (dmd != null) { - return dmd; - } - String msg = "The cache should have data meta data here: key=" + key - + " cache=" + daoMetaDataCache; - throw new IllegalStateException(msg); - } - - @SuppressWarnings("unchecked") - protected void putSynchronizedDaoMetaDataCache(String key, DaoMetaData dmd) { - synchronized (daoMetaDataCache) { - daoMetaDataCache.put(key, dmd); - } - } - - protected DaoMetaData getSynchronizedDaoMetaDataCache(String key) { - DaoMetaData dmd = null; - synchronized (daoMetaDataCache) { - dmd = (DaoMetaData) daoMetaDataCache.get(key); - } - return dmd; - } - - //========================================================================== - // ========= - // DataMetaData Creation - // ===================== - protected DaoMetaData createDaoMetaData(final Class daoClass) { - final BeanDesc daoBeanDesc = BeanDescFactory.getBeanDesc(daoClass); - final DaoAnnotationReader daoAnnotationReader = annotationReaderFactory - .createDaoAnnotationReader(daoBeanDesc); - - final DaoMetaDataImpl daoMetaData = createDaoMetaDataExtension(); - daoMetaData.setDaoClass(daoClass); - daoMetaData.setDataSource(dataSource); - daoMetaData.setStatementFactory(createCustomizeStatememtFactory()); - daoMetaData.setResultSetFactory(createCustomizeResultSetFactory()); - daoMetaData.setValueTypeFactory(valueTypeFactory); - daoMetaData.setBeanMetaDataFactory(getBeanMetaDataFactory()); - daoMetaData.setDaoNamingConvention(getDaoNamingConvention()); - daoMetaData.setUseDaoClassForLog(useDaoClassForLog); - daoMetaData.setDaoAnnotationReader(daoAnnotationReader); - daoMetaData.setProcedureMetaDataFactory(procedureMetaDataFactory); - daoMetaData.setDtoMetaDataFactory(dtoMetaDataFactory); - daoMetaData.setResultSetHandlerFactory(resultSetHandlerFactory); - if (sqlFileEncoding != null) { - daoMetaData.setSqlFileEncoding(sqlFileEncoding); - } - if (pagingSqlRewriter != null) { - daoMetaData.setPagingSQLRewriter(pagingSqlRewriter); - } - daoMetaData.initialize(); - return daoMetaData; - } - - protected S2DaoMetaDataExtension createDaoMetaDataExtension() { - final S2DaoMetaDataExtension dmdExtension = newDaoMetaDataExtension(); - dmdExtension.setBeanEnhancer(beanEnhancer); - dmdExtension.setAnnotationReaderFactory(this.annotationReaderFactory); - dmdExtension.setColumnNaming(this.columnNaming); - dmdExtension - .setPropertyTypeFactoryBuilder(this.propertyTypeFactoryBuilder); - dmdExtension - .setRelationPropertyTypeFactoryBuilder(this.relationPropertyTypeFactoryBuilder); - dmdExtension.setTableNaming(tableNaming); - dmdExtension.setInternalDebug(DBFluteConfig.getInstance() - .isInternalDebug()); - return dmdExtension; - } - - protected S2DaoMetaDataExtension newDaoMetaDataExtension() { - return new S2DaoMetaDataExtension(); - } - - //========================================================================== - // ========= - // Result Set Factory - // ================== - /** - * Create the customize result set factory that is for all SQL on DBFlute. - * - * @return The customize statement factory. (NotNull) - */ - protected ResultSetFactory createCustomizeResultSetFactory() { - return new FetchNarrowingResultSetFactory(); - } - - //========================================================================== - // ========= - // Statement Factory - // ================= - /** - * Create the customize statement factory that is for all SQL on DBFlute. - * - * @return The customize statement factory. (NotNull) - */ - protected StatementFactory createCustomizeStatememtFactory() { - final StatementConfig defaultStatementConfig = DBFluteConfig - .getInstance().getDefaultStatementConfig(); - final boolean internalDebug = DBFluteConfig.getInstance() - .isInternalDebug(); - return new StatementFactory() { - public PreparedStatement createPreparedStatement(Connection con, - String sql) { - try { - final StatementConfig config = findStatementConfigOnThread(); - ; - final int resultSetType; - if (config != null && config.hasResultSetType()) { - resultSetType = config.getResultSetType(); - } else if (defaultStatementConfig != null - && defaultStatementConfig.hasResultSetType()) { - resultSetType = defaultStatementConfig - .getResultSetType(); - } else { - resultSetType = java.sql.ResultSet.TYPE_FORWARD_ONLY; - } - final int resultSetConcurrency = java.sql.ResultSet.CONCUR_READ_ONLY; - if (internalDebug) { - _log.debug("...Creating prepareStatement(sql, " - + resultSetType + ", " + resultSetConcurrency - + ")"); - } - final PreparedStatement ps = con.prepareStatement(sql, - resultSetType, resultSetConcurrency); - if (config != null && config.hasStatementOptions()) { - if (internalDebug) { - _log - .debug("...Setting statement config as request: " - + config); - } - reflectStatementOptions(config, ps); - } else { - reflectDefaultOptionsToStatementIfNeeds(ps); - } - return ps; - } catch (SQLException e) { - handleSQLException(e, null); - return null;// Unreachable! - } - } - - public CallableStatement createCallableStatement(Connection conn, - String sql) { - return prepareCall(conn, sql); - } - - protected StatementConfig findStatementConfigOnThread() { - final StatementConfig config; - if (ConditionBeanContext.isExistConditionBeanOnThread()) { - final ConditionBean cb = ConditionBeanContext - .getConditionBeanOnThread(); - config = cb.getStatementConfig(); - } else if (OutsideSqlContext.isExistOutsideSqlContextOnThread()) { - final OutsideSqlContext context = OutsideSqlContext - .getOutsideSqlContextOnThread(); - config = context.getStatementConfig(); - } else { - config = null; - } - return config; - } - - protected void reflectDefaultOptionsToStatementIfNeeds( - PreparedStatement ps) { - if (defaultStatementConfig != null - && defaultStatementConfig.hasStatementOptions()) { - if (internalDebug) { - _log.debug("...Setting statement config as default: " - + defaultStatementConfig); - } - reflectStatementOptions(defaultStatementConfig, ps); - return; - } - } - - protected void reflectStatementOptions(StatementConfig config, - PreparedStatement ps) { - try { - if (config.hasQueryTimeout()) { - ps.setQueryTimeout(config.getQueryTimeout()); - } - if (config.hasFetchSize()) { - ps.setFetchSize(config.getFetchSize()); - } - if (config.hasMaxRows()) { - ps.setMaxRows(config.getMaxRows()); - } - } catch (SQLException e) { - handleSQLException(e, ps); - } - } - - protected CallableStatement prepareCall(Connection conn, String sql) { - try { - return conn.prepareCall(sql); - } catch (SQLException e) { - handleSQLException(e, null); - return null;// Unreachable! - } - } - - protected void handleSQLException(SQLException e, - Statement statement) { - new SQLExceptionHandler().handleSQLException(e, statement); - } - }; - } - - //========================================================================== - // ========= - // Dispose - // ======= - public synchronized void dispose() { - daoMetaDataCache.clear(); - initialized = false; - } - - //========================================================================== - // ========= - // Helper - // ====== - /** - * Get the value of line separator. - * - * @return The value of line separator. (NotNull) - */ - protected static String getLineSeparator() { - return System.getProperty("line.separator"); - } - - //========================================================================== - // ========= - // Accessor - // ======== - // ----------------------------------------------------- - // Factory Basic - // ------------- - public void setValueTypeFactory(final ValueTypeFactory valueTypeFactory) { - this.valueTypeFactory = valueTypeFactory; - } - - protected BeanMetaDataFactory getBeanMetaDataFactory() { - return beanMetaDataFactory; - } - - public void setBeanMetaDataFactory( - final BeanMetaDataFactory beanMetaDataFactory) { - this.beanMetaDataFactory = beanMetaDataFactory; - } - - public DaoNamingConvention getDaoNamingConvention() { - return daoNamingConvention; - } - - public void setDaoNamingConvention( - final DaoNamingConvention daoNamingConvention) { - this.daoNamingConvention = daoNamingConvention; - } - - public void setAnnotationReaderFactory( - final AnnotationReaderFactory annotationReaderFactory) { - this.annotationReaderFactory = annotationReaderFactory; - } - - public void setDataSource(final DataSource dataSource) { - this.dataSource = dataSource; - } - - public void setUseDaoClassForLog(final boolean userDaoClassForLog) { - useDaoClassForLog = userDaoClassForLog; - } - - public void setResultSetHandlerFactory( - final ResultSetHandlerFactory resultSetHandlerFactory) { - this.resultSetHandlerFactory = resultSetHandlerFactory; - } - - public void setDtoMetaDataFactory( - final DtoMetaDataFactory dtoMetaDataFactory) { - this.dtoMetaDataFactory = dtoMetaDataFactory; - } - - public void setProcedureMetaDataFactory( - ProcedureMetaDataFactory procedureMetaDataFactory) { - this.procedureMetaDataFactory = procedureMetaDataFactory; - } - - public void setPagingSQLRewriter(final PagingSqlRewriter pagingSqlRewriter) { - this.pagingSqlRewriter = pagingSqlRewriter; - } - - public String getSqlFileEncoding() { - return sqlFileEncoding; - } - - public void setSqlFileEncoding(final String encoding) { - sqlFileEncoding = encoding; - } - - public BeanEnhancer getBeanEnhancer() { - return beanEnhancer; - } - - public void setBeanEnhancer(final BeanEnhancer beanEnhancer) { - this.beanEnhancer = beanEnhancer; - } - - // ----------------------------------------------------- - // Version After 1.0.47 - // -------------------- - public ColumnNaming getColumnNaming() { - return columnNaming; - } - - public void setColumnNaming(final ColumnNaming columnNaming) { - this.columnNaming = columnNaming; - } - - public PropertyTypeFactoryBuilder getPropertyTypeFactoryBuilder() { - return propertyTypeFactoryBuilder; - } - - public void setPropertyTypeFactoryBuilder( - final PropertyTypeFactoryBuilder propertyTypeFactoryBuilder) { - this.propertyTypeFactoryBuilder = propertyTypeFactoryBuilder; - } - - public RelationPropertyTypeFactoryBuilder getRelationPropertyTypeFactoryBuilder() { - return relationPropertyTypeFactoryBuilder; - } - - public void setRelationPropertyTypeFactoryBuilder( - final RelationPropertyTypeFactoryBuilder relationPropertyTypeFactoryBuilder) { - this.relationPropertyTypeFactoryBuilder = relationPropertyTypeFactoryBuilder; - } - - public TableNaming getTableNaming() { - return tableNaming; - } - - public void setTableNaming(final TableNaming tableNaming) { - this.tableNaming = tableNaming; - } -} \ No newline at end of file Deleted: addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/s2dao/S2DaoPropertyTypeFactoryBuilderExtension.java =================================================================== --- addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/s2dao/S2DaoPropertyTypeFactoryBuilderExtension.java 2008-12-27 22:02:56 UTC (rev 1623) +++ addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/s2dao/S2DaoPropertyTypeFactoryBuilderExtension.java 2008-12-27 22:06:42 UTC (rev 1624) @@ -1,215 +0,0 @@ -package jp.sf.pal.addresslist.db.allcommon.s2dao; - -import java.sql.DatabaseMetaData; -import java.util.ArrayList; -import java.util.List; - -import jp.sf.pal.addresslist.db.allcommon.Entity; -import jp.sf.pal.addresslist.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 list = new ArrayList(); - final BeanDesc beanDesc = getBeanDesc(); - for (int i = 0; i < beanDesc.getPropertyDescSize(); ++i) { - final PropertyDesc pd = beanDesc.getPropertyDesc(i); - - // Read-only property is unnecessary! - if (!pd.hasWriteMethod()) { - continue; - } - - // Relation property is unnecessary! - if (isRelation(pd)) { - continue; - } - - final PropertyType pt = createPropertyType(pd); - pt.setPrimaryKey(isPrimaryKey(pd)); - pt.setPersistent(isPersistent(pt)); - list.add(pt); - } - return list.toArray(new PropertyType[list.size()]); - } - - @Override - protected boolean isRelation(PropertyDesc propertyDesc) { - final String propertyName = propertyDesc.getPropertyName(); - if (hasDBMeta() - && (_dbmeta.hasForeign(propertyName) || _dbmeta - .hasReferrer(propertyName))) { - return true; - } - return hasRelationNoAnnotation(propertyDesc); - } - - protected boolean hasRelationNoAnnotation(PropertyDesc propertyDesc) { - return beanAnnotationReader.hasRelationNo(propertyDesc); - } - - @Override - protected boolean isPrimaryKey(PropertyDesc propertyDesc) { - final String propertyName = propertyDesc.getPropertyName(); - if (hasDBMeta() && _dbmeta.hasPrimaryKey() - && _dbmeta.hasColumn(propertyName)) { - if (_dbmeta.findColumnInfo(propertyName).isPrimary()) { - return true; - } - } - return hasIdAnnotation(propertyDesc); - } - - protected boolean hasIdAnnotation(PropertyDesc propertyDesc) { - final Dbms dbms = getDbms(); - return beanAnnotationReader.getId(propertyDesc, dbms) != null; - } - - @Override - protected boolean isPersistent(PropertyType propertyType) { - final String propertyName = propertyType.getPropertyName(); - final PropertyDesc propertyDesc = propertyType.getPropertyDesc(); - if ((hasDBMeta() && _dbmeta.hasColumn(propertyName)) - || hasColumnAnnotation(propertyDesc)) { - if (!isElementOfNoPersistentProps(propertyDesc)) { - return true; - } - } - return false; - } - - protected boolean hasColumnAnnotation(PropertyDesc propertyDesc) { - return beanAnnotationReader.getColumnAnnotation(propertyDesc) != null; - } - - protected boolean isElementOfNoPersistentProps(PropertyDesc propertyDesc) { - final String propertyName = propertyDesc.getPropertyName(); - final String[] props = _noPersisteneProps; - if (props != null && props.length >= 0) { - for (int i = 0; i < props.length; ++i) { - if (props[i].equals(propertyName)) { - return true; - } - } - } - return false; - } - } - - //========================================================================== - // ========= - // Accessor - // ======== - public ValueTypeFactory getValueTypeFactory() { - return valueTypeFactory; - } - - public void setValueTypeFactory(ValueTypeFactory valueTypeFactory) { - this.valueTypeFactory = valueTypeFactory; - } - - public ColumnNaming getColumnNaming() { - return columnNaming; - } - - public void setColumnNaming(ColumnNaming columnNaming) { - this.columnNaming = columnNaming; - } -} Deleted: addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/s2dao/S2DaoSelectDynamicCommand.java =================================================================== --- addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/s2dao/S2DaoSelectDynamicCommand.java 2008-12-27 22:02:56 UTC (rev 1623) +++ addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/s2dao/S2DaoSelectDynamicCommand.java 2008-12-27 22:06:42 UTC (rev 1624) @@ -1,491 +0,0 @@ -package jp.sf.pal.addresslist.db.allcommon.s2dao; - -import java.util.ArrayList; -import java.util.List; - -import javax.sql.DataSource; - -import jp.sf.pal.addresslist.db.allcommon.cbean.ConditionBean; -import jp.sf.pal.addresslist.db.allcommon.cbean.ConditionBeanContext; -import jp.sf.pal.addresslist.db.allcommon.cbean.outsidesql.OutsideSqlContext; -import jp.sf.pal.addresslist.db.allcommon.s2dao.internal.sqlcommand.InternalAbstractDynamicCommand; -import jp.sf.pal.addresslist.db.allcommon.s2dao.internal.sqlhandler.InternalBasicSelectHandler; -import jp.sf.pal.addresslist.db.allcommon.util.SimpleStringUtil; -import jp.sf.pal.addresslist.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 bindVariableList = new ArrayList(4); - final List bindVariableTypeList = new ArrayList(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 bindVariableList = new java.util.ArrayList(); - final java.util.List bindVariableTypeList = new java.util.ArrayList(); - 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.addresslist.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.addresslist.db.allcommon.jdbc.CursorHandler) { - final jp.sf.pal.addresslist.db.allcommon.jdbc.CursorHandler cursorHandler = (jp.sf.pal.addresslist.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 bindVariableList, List 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 bindVariableList, List 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 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 bindVariableList, List bindVariableTypeList) { - final Object[] bindVariables = ctx.getBindVariables(); - addBindVariableList(bindVariableList, bindVariables); - final Class[] bindVariableTypes = ctx.getBindVariableTypes(); - addBindVariableTypeList(bindVariableTypeList, bindVariableTypes); - } - - protected void addBindVariableList(List bindVariableList, - Object[] bindVariables) { - for (int i = 0; i < bindVariables.length; i++) { - bindVariableList.add(bindVariables[i]); - } - } - - protected void addBindVariableTypeList(List bindVariableTypeList, - Class[] bindVariableTypes) { - for (int i = 0; i < bindVariableTypes.length; i++) { - bindVariableTypeList.add(bindVariableTypes[i]); - } - } - - //========================================================================== - // ========= - // General Helper - // ============== - protected final String replaceString(String text, String fromText, - String toText) { - return SimpleStringUtil.replace(text, fromText, toText); - } - - protected String getLineSeparator() { - return SimpleSystemUtil.getLineSeparator(); - } -} \ No newline at end of file Added: addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/s2dao/SqlLogRegistryLatestSqlProvider.java =================================================================== --- addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/s2dao/SqlLogRegistryLatestSqlProvider.java (rev 0) +++ addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/s2dao/SqlLogRegistryLatestSqlProvider.java 2008-12-27 22:06:42 UTC (rev 1624) @@ -0,0 +1,21 @@ +package jp.sf.pal.addresslist.db.allcommon.s2dao; + +import jp.sf.pal.addresslist.db.allcommon.jdbc.LatestSqlProvider; +import jp.sf.pal.addresslist.db.allcommon.s2dao.internal.sqllog.InternalSqlLogRegistry; + +/** + * The provider of latest SQL using SqlLogRegistry. This instance should be + * singleton. + * + * @author DBFlute(AutoGenerator) + */ +public class SqlLogRegistryLatestSqlProvider implements LatestSqlProvider { + + public String getDisplaySql() { + return InternalSqlLogRegistry.peekCompleteSql(); + } + + public void clearSqlCache() { + InternalSqlLogRegistry.clearSqlLogRegistry(); + } +} Property changes on: addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/s2dao/SqlLogRegistryLatestSqlProvider.java ___________________________________________________________________ Name: svn:eol-style + native Modified: addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/s2dao/internal/rshandler/InternalAbstractDtoMetaDataResultSetHandler.java =================================================================== --- addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/s2dao/internal/rshandler/InternalAbstractDtoMetaDataResultSetHandler.java 2008-12-27 22:02:56 UTC (rev 1623) +++ addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/s2dao/internal/rshandler/InternalAbstractDtoMetaDataResultSetHandler.java 2008-12-27 22:06:42 UTC (rev 1624) @@ -6,10 +6,11 @@ import java.util.Map; import java.util.Set; +import jp.sf.pal.addresslist.db.allcommon.helper.StringSet; + import org.seasar.dao.DtoMetaData; import org.seasar.dao.RowCreator; import org.seasar.extension.jdbc.ResultSetHandler; -import org.seasar.framework.util.CaseInsensitiveSet; /** * @author DBFlute(AutoGenerator) @@ -67,10 +68,10 @@ return rowCreator.createRow(rs, propertyCache, beanClass); } - protected Set createColumnNames(final ResultSetMetaData rsmd) + protected Set createColumnNames(final ResultSetMetaData rsmd) throws SQLException { final int count = rsmd.getColumnCount(); - final Set columnNames = new CaseInsensitiveSet(); + final Set columnNames = StringSet.createAsCaseInsensitive(); for (int i = 0; i < count; ++i) { final String columnName = rsmd.getColumnLabel(i + 1); final int pos = columnName.lastIndexOf('.'); // [DAO-41] Modified: addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/s2dao/internal/sqlcommand/InternalAbstractAutoStaticCommand.java =================================================================== --- addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/s2dao/internal/sqlcommand/InternalAbstractAutoStaticCommand.java 2008-12-27 22:02:56 UTC (rev 1623) +++ addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/s2dao/internal/sqlcommand/InternalAbstractAutoStaticCommand.java 2008-12-27 22:06:42 UTC (rev 1624) @@ -10,7 +10,6 @@ import org.seasar.dao.BeanMetaData; import org.seasar.dao.IdentifierGenerator; -import org.seasar.dao.NotSingleRowUpdatedRuntimeException; import org.seasar.dao.PrimaryKeyNotFoundRuntimeException; import org.seasar.extension.jdbc.PropertyType; import org.seasar.extension.jdbc.StatementFactory; @@ -24,19 +23,13 @@ //========================================================================== // ========= - // Definition - // ========== - protected static final boolean DEFAULT_VERSION_NO_AUTO_INCREMENT_ON_MEMORY = true; - - //========================================================================== - // ========= // Attribute // ========= private PropertyType[] propertyTypes; - private boolean checkSingleRowUpdate = true; + protected boolean optimisticLockHandling; - protected boolean versionNoAutoIncrementOnMemory = DEFAULT_VERSION_NO_AUTO_INCREMENT_ON_MEMORY; + protected boolean versionNoAutoIncrementOnMemory; //========================================================================== // ========= @@ -44,15 +37,10 @@ // =========== public InternalAbstractAutoStaticCommand(DataSource dataSource, StatementFactory statementFactory, BeanMetaData beanMetaData, - String[] propertyNames) { - this(dataSource, statementFactory, beanMetaData, propertyNames, - DEFAULT_VERSION_NO_AUTO_INCREMENT_ON_MEMORY); - } - - public InternalAbstractAutoStaticCommand(DataSource dataSource, - StatementFactory statementFactory, BeanMetaData beanMetaData, - String[] propertyNames, boolean versionNoAutoIncrementOnMemory) { + String[] propertyNames, boolean optimisticLockHandling, + boolean versionNoAutoIncrementOnMemory) { super(dataSource, statementFactory, beanMetaData); + this.optimisticLockHandling = optimisticLockHandling; this.versionNoAutoIncrementOnMemory = versionNoAutoIncrementOnMemory; setupPropertyTypes(propertyNames); setupSql(); @@ -62,26 +50,19 @@ // ========= // Execute // ======= - public Object execute(Object[] args) { + public Object execute(Object[] args) { // NOT for Batch. Batch should + // override. InternalAbstractAutoHandler handler = createAutoHandler(); + handler.setOptimisticLockHandling(optimisticLockHandling); + handler + .setVersionNoAutoIncrementOnMemory(versionNoAutoIncrementOnMemory); handler.setSql(getSql()); handler.setLoggingMessageSqlArgs(args); int rows = handler.execute(args); - if (isCheckSingleRowUpdate() && rows != 1) { - throw createNotSingleRowUpdatedRuntimeException(args[0], rows); - } return new Integer(rows); } - public boolean isCheckSingleRowUpdate() { - return checkSingleRowUpdate; - } - - public void setCheckSingleRowUpdate(boolean checkSingleRowUpdate) { - this.checkSingleRowUpdate = checkSingleRowUpdate; - } - - protected NotSingleRowUpdatedRuntimeException createNotSingleRowUpdatedRuntimeException( + protected EntityAlreadyUpdatedException createEntityAlreadyUpdatedException( Object bean, int rows) { return new EntityAlreadyUpdatedException(bean, rows); } @@ -194,7 +175,7 @@ protected void setupDeleteSql() { checkPrimaryKey(); - StringBuilder sb = new StringBuilder(100); + final StringBuilder sb = new StringBuilder(100); sb.append("delete from "); sb.append(getBeanMetaData().getTableName()); setupUpdateWhere(sb); @@ -215,11 +196,11 @@ sb.append(bmd.getPrimaryKey(i)).append(" = ? and "); } sb.setLength(sb.length() - 5); - if (bmd.hasVersionNoPropertyType()) { + if (optimisticLockHandling && bmd.hasVersionNoPropertyType()) { PropertyType pt = bmd.getVersionNoPropertyType(); sb.append(" and ").append(pt.getColumnName()).append(" = ?"); } - if (bmd.hasTimestampPropertyType()) { + if (optimisticLockHandling && bmd.hasTimestampPropertyType()) { PropertyType pt = bmd.getTimestampPropertyType(); sb.append(" and ").append(pt.getColumnName()).append(" = ?"); } Modified: addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/s2dao/internal/sqlcommand/InternalAbstractBatchAutoStaticCommand.java =================================================================== --- addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/s2dao/internal/sqlcommand/InternalAbstractBatchAutoStaticCommand.java 2008-12-27 22:02:56 UTC (rev 1623) +++ addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/s2dao/internal/sqlcommand/InternalAbstractBatchAutoStaticCommand.java 2008-12-27 22:06:42 UTC (rev 1624) @@ -15,49 +15,30 @@ //========================================================================== // ========= - // Attribute - // ========= - protected final boolean returningRows; - - //========================================================================== - // ========= // Constructor // =========== public InternalAbstractBatchAutoStaticCommand(DataSource dataSource, StatementFactory statementFactory, BeanMetaData beanMetaData, - String[] propertyNames, boolean returningRows) { - this(dataSource, statementFactory, beanMetaData, propertyNames, - returningRows, DEFAULT_VERSION_NO_AUTO_INCREMENT_ON_MEMORY); - } - - public InternalAbstractBatchAutoStaticCommand(DataSource dataSource, - StatementFactory statementFactory, BeanMetaData beanMetaData, - String[] propertyNames, boolean returningRows, + String[] propertyNames, boolean optimisticLockHandling, boolean versionNoAutoIncrementOnMemory) { super(dataSource, statementFactory, beanMetaData, propertyNames, - versionNoAutoIncrementOnMemory); - this.returningRows = returningRows; + optimisticLockHandling, versionNoAutoIncrementOnMemory); } //========================================================================== // ========= // Execute // ======= + @Override public Object execute(Object[] args) { final InternalAbstractBatchAutoHandler handler = createBatchAutoHandler(); - - // It is unnecessary! - // injectDaoClass(handler); - + handler.setOptimisticLockHandling(optimisticLockHandling); + handler + .setVersionNoAutoIncrementOnMemory(versionNoAutoIncrementOnMemory); handler.setSql(getSql()); // The logging message SQL of procedure is unnecessary. // handler.setLoggingMessageSqlArgs(args); - if (this.returningRows) { - return handler.executeBatch(args); - } else { - final int updatedRows = handler.execute(args); - return new Integer(updatedRows); - } + return handler.executeBatch(args); } protected abstract InternalAbstractBatchAutoHandler createBatchAutoHandler(); Modified: addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/s2dao/internal/sqlcommand/InternalAbstractDynamicCommand.java =================================================================== --- addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/s2dao/internal/sqlcommand/InternalAbstractDynamicCommand.java 2008-12-27 22:02:56 UTC (rev 1623) +++ addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/s2dao/internal/sqlcommand/InternalAbstractDynamicCommand.java 2008-12-27 22:06:42 UTC (rev 1624) @@ -44,10 +44,15 @@ } protected InternalSqlParser createInternalSqlParser(String sql) { - return new InternalSqlParser(sql); + return new InternalSqlParser(sql, isBlockNullParameter()); } - public CommandContext apply(Object[] args) {// It is necessary to be public! + protected boolean isBlockNullParameter() { // Extension Point! + return false; + } + + public CommandContext apply(Object[] args) { // It is necessary to be + // public! final CommandContext ctx = createCommandContext(args); rootNode.accept(ctx); return ctx; Modified: addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/s2dao/internal/sqlcommand/InternalAbstractSqlCommand.java =================================================================== --- addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/s2dao/internal/sqlcommand/InternalAbstractSqlCommand.java 2008-12-27 22:02:56 UTC (rev 1623) +++ addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/s2dao/internal/sqlcommand/InternalAbstractSqlCommand.java 2008-12-27 22:06:42 UTC (rev 1624) @@ -2,13 +2,16 @@ import javax.sql.DataSource; +import jp.sf.pal.addresslist.db.allcommon.bhv.core.SqlExecution; + import org.seasar.dao.SqlCommand; import org.seasar.extension.jdbc.StatementFactory; /** * @author DBFlute(AutoGenerator) */ -public abstract class InternalAbstractSqlCommand implements SqlCommand { +public abstract class InternalAbstractSqlCommand implements SqlCommand, + SqlExecution { //========================================================================== // ========= Modified: addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/s2dao/internal/sqlcommand/InternalDeleteAutoStaticCommand.java =================================================================== --- addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/s2dao/internal/sqlcommand/InternalDeleteAutoStaticCommand.java 2008-12-27 22:02:56 UTC (rev 1623) +++ addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/s2dao/internal/sqlcommand/InternalDeleteAutoStaticCommand.java 2008-12-27 22:06:42 UTC (rev 1624) @@ -20,8 +20,9 @@ // =========== public InternalDeleteAutoStaticCommand(DataSource dataSource, StatementFactory statementFactory, BeanMetaData beanMetaData, - String[] propertyNames) { - super(dataSource, statementFactory, beanMetaData, propertyNames); + String[] propertyNames, boolean optimisticLockHandling) { + super(dataSource, statementFactory, beanMetaData, propertyNames, + optimisticLockHandling, false); } //========================================================================== Modified: addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/s2dao/internal/sqlcommand/InternalDeleteBatchAutoStaticCommand.java =================================================================== --- addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/s2dao/internal/sqlcommand/InternalDeleteBatchAutoStaticCommand.java 2008-12-27 22:02:56 UTC (rev 1623) +++ addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/s2dao/internal/sqlcommand/InternalDeleteBatchAutoStaticCommand.java 2008-12-27 22:06:42 UTC (rev 1624) @@ -21,9 +21,9 @@ // =========== public InternalDeleteBatchAutoStaticCommand(DataSource dataSource, StatementFactory statementFactory, BeanMetaData beanMetaData, - String[] propertyNames, boolean returningRows) { + String[] propertyNames, boolean optimisticLockHandling) { super(dataSource, statementFactory, beanMetaData, propertyNames, - returningRows); + optimisticLockHandling, false); } //========================================================================== Modified: addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/s2dao/internal/sqlcommand/InternalDeleteQueryAutoDynamicCommand.java =================================================================== --- addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/s2dao/internal/sqlcommand/InternalDeleteQueryAutoDynamicCommand.java 2008-12-27 22:02:56 UTC (rev 1623) +++ addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/s2dao/internal/sqlcommand/InternalDeleteQueryAutoDynamicCommand.java 2008-12-27 22:06:42 UTC (rev 1624) @@ -2,6 +2,7 @@ import javax.sql.DataSource; +import jp.sf.pal.addresslist.db.allcommon.bhv.core.SqlExecution; import jp.sf.pal.addresslist.db.allcommon.cbean.ConditionBean; import jp.sf.pal.addresslist.db.allcommon.s2dao.internal.sqlhandler.InternalCommandContextHandler; import jp.sf.pal.addresslist.db.allcommon.s2dao.internal.sqlparser.InternalCommandContextCreator; @@ -16,7 +17,8 @@ /** * @author DBFlute(AutoGenerator) */ -public class InternalDeleteQueryAutoDynamicCommand implements SqlCommand { +public class InternalDeleteQueryAutoDynamicCommand implements SqlCommand, + SqlExecution { //========================================================================== // ========= @@ -83,7 +85,7 @@ String[] argNames, Class[] argTypes, Object[] args) { CommandContext context; { - InternalSqlParser parser = new InternalSqlParser(twoWaySql); + InternalSqlParser parser = new InternalSqlParser(twoWaySql, true); Node node = parser.parse(); InternalCommandContextCreator creator = new InternalCommandContextCreator( argNames, argTypes); Modified: addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/s2dao/internal/sqlcommand/InternalInsertAutoDynamicCommand.java =================================================================== --- addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/s2dao/internal/sqlcommand/InternalInsertAutoDynamicCommand.java 2008-12-27 22:02:56 UTC (rev 1623) +++ addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/s2dao/internal/sqlcommand/InternalInsertAutoDynamicCommand.java 2008-12-27 22:06:42 UTC (rev 1624) @@ -5,11 +5,11 @@ import javax.sql.DataSource; +import jp.sf.pal.addresslist.db.allcommon.bhv.core.SqlExecution; import jp.sf.pal.addresslist.db.allcommon.s2dao.internal.sqlhandler.InternalInsertAutoHandler; import org.seasar.dao.BeanMetaData; import org.seasar.dao.IdentifierGenerator; -import org.seasar.dao.NotSingleRowUpdatedRuntimeException; import org.seasar.dao.SqlCommand; import org.seasar.extension.jdbc.PropertyType; import org.seasar.extension.jdbc.StatementFactory; @@ -18,7 +18,8 @@ /** * @author DBFlute(AutoGenerator) */ -public class InternalInsertAutoDynamicCommand implements SqlCommand { +public class InternalInsertAutoDynamicCommand implements SqlCommand, + SqlExecution { //========================================================================== // ========= @@ -32,8 +33,6 @@ protected String[] propertyNames; - protected boolean checkSingleRowUpdate = true; - //========================================================================== // ========= // Constructor @@ -56,9 +55,6 @@ handler.setSql(sql); handler.setLoggingMessageSqlArgs(args); final int rows = handler.execute(args); - if (isCheckSingleRowUpdate() && rows != 1) { - throw new NotSingleRowUpdatedRuntimeException(args[0], rows); - } return new Integer(rows); } @@ -161,12 +157,4 @@ public void setPropertyNames(String[] propertyNames) { this.propertyNames = propertyNames; } - - public boolean isCheckSingleRowUpdate() { - return checkSingleRowUpdate; - } - - public void setCheckSingleRowUpdate(boolean checkSingleRowUpdate) { - this.checkSingleRowUpdate = checkSingleRowUpdate; - } } Modified: addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/s2dao/internal/sqlcommand/InternalInsertBatchAutoStaticCommand.java =================================================================== --- addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/s2dao/internal/sqlcommand/InternalInsertBatchAutoStaticCommand.java 2008-12-27 22:02:56 UTC (rev 1623) +++ addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/s2dao/internal/sqlcommand/InternalInsertBatchAutoStaticCommand.java 2008-12-27 22:06:42 UTC (rev 1624) @@ -21,9 +21,9 @@ // =========== public InternalInsertBatchAutoStaticCommand(DataSource dataSource, StatementFactory statementFactory, BeanMetaData beanMetaData, - String[] propertyNames, boolean returningRows) { - super(dataSource, statementFactory, beanMetaData, propertyNames, - returningRows); + String[] propertyNames) { + super(dataSource, statementFactory, beanMetaData, propertyNames, false, + false); } //========================================================================== Modified: addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/s2dao/internal/sqlcommand/InternalProcedureCommand.java =================================================================== --- addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/s2dao/internal/sqlcommand/InternalProcedureCommand.java 2008-12-27 22:02:56 UTC (rev 1623) +++ addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/s2dao/internal/sqlcommand/InternalProcedureCommand.java 2008-12-27 22:06:42 UTC (rev 1624) @@ -2,6 +2,7 @@ import javax.sql.DataSource; +import jp.sf.pal.addresslist.db.allcommon.bhv.core.SqlExecution; import jp.sf.pal.addresslist.db.allcommon.cbean.outsidesql.OutsideSqlContext; import jp.sf.pal.addresslist.db.allcommon.s2dao.internal.sqlhandler.InternalProcedureHandler; import jp.sf.pal.addresslist.db.allcommon.s2dao.internal.various.InternalProcedureMetaData; @@ -13,7 +14,7 @@ /** * @author DBFlute(AutoGenerator) */ -public class InternalProcedureCommand implements SqlCommand { +public class InternalProcedureCommand implements SqlCommand, SqlExecution { //========================================================================== // ========= Modified: addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/s2dao/internal/sqlcommand/InternalUpdateAutoDynamicCommand.java =================================================================== --- addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/s2dao/internal/sqlcommand/InternalUpdateAutoDynamicCommand.java 2008-12-27 22:02:56 UTC (rev 1623) +++ addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/s2dao/internal/sqlcommand/InternalUpdateAutoDynamicCommand.java 2008-12-27 22:06:42 UTC (rev 1624) @@ -5,29 +5,27 @@ import javax.sql.DataSource; +import jp.sf.pal.addresslist.db.allcommon.XLog; import jp.sf.pal.addresslist.db.allcommon.s2dao.internal.sqlhandler.InternalUpdateAutoHandler; import org.seasar.dao.BeanMetaData; import org.seasar.dao.NoUpdatePropertyTypeRuntimeException; -import org.seasar.dao.impl.AbstractSqlCommand; import org.seasar.extension.jdbc.PropertyType; import org.seasar.extension.jdbc.StatementFactory; /** * @author DBFlute(AutoGenerator) */ -public class InternalUpdateAutoDynamicCommand extends AbstractSqlCommand { +public class InternalUpdateAutoDynamicCommand extends + InternalAbstractSqlCommand { //========================================================================== // ========= // Definition // ========== - /** Log instance. */ - private static final org.apache.commons.logging.Log _log = org.apache.commons.logging.LogFactory - .getLog(InternalUpdateAutoDynamicCommand.class); + /** The result for no update as normal execution. */ + private static final Integer NO_UPDATE = new Integer(1); - private static final Integer NO_UPDATE = new Integer(0); - //========================================================================== // ========= // Attribute @@ -36,9 +34,9 @@ private String[] propertyNames; - private boolean checkSingleRowUpdate = true; + private boolean optimisticLockHandling; - private boolean versionNoAutoIncrementOnMemory = true; + private boolean versionNoAutoIncrementOnMemory; //========================================================================== // ========= @@ -59,8 +57,8 @@ final PropertyType[] propertyTypes = createUpdatePropertyTypes(bmd, bean, getPropertyNames()); if (propertyTypes.length == 0) { - if (_log.isDebugEnabled()) { - _log.debug(createNoUpdateLogMessage(bean, bmd)); + if (isLogEnabled()) { + log(createNoUpdateLogMessage(bean, bmd)); } return NO_UPDATE; } @@ -83,10 +81,10 @@ BeanMetaData bmd, PropertyType[] propertyTypes) { InternalUpdateAutoHandler handler = new InternalUpdateAutoHandler( getDataSource(), getStatementFactory(), bmd, propertyTypes); + handler.setOptimisticLockHandling(optimisticLockHandling); //[DBFlute-0.8 + // .0] handler .setVersionNoAutoIncrementOnMemory(versionNoAutoIncrementOnMemory); - handler.setCheckSingleRowUpdate(isCheckSingleRowUpdate()); //[DBFlute-0.8 - // .0] return handler; } @@ -182,17 +180,33 @@ sb.append(bmd.getPrimaryKey(i)).append(" = ? and "); } sb.setLength(sb.length() - 5); - if (bmd.hasVersionNoPropertyType()) { + if (optimisticLockHandling && bmd.hasVersionNoPropertyType()) { PropertyType pt = bmd.getVersionNoPropertyType(); sb.append(" and ").append(pt.getColumnName()).append(" = ?"); } - if (bmd.hasTimestampPropertyType()) { + if (optimisticLockHandling && bmd.hasTimestampPropertyType()) { PropertyType pt = bmd.getTimestampPropertyType(); sb.append(" and ").append(pt.getColumnName()).append(" = ?"); } return sb.toString(); } + //========================================================================== + // ========= + // Execute Status Log + // ================== + protected void log(String msg) { + XLog.log(msg); + } + + protected boolean isLogEnabled() { + return XLog.isLogEnabled(); + } + + //========================================================================== + // ========= + // Accessor + // ======== protected boolean isVersionNoAutoIncrementOnMemory() { return versionNoAutoIncrementOnMemory; } @@ -223,11 +237,7 @@ this.propertyNames = propertyNames; } - public boolean isCheckSingleRowUpdate() { - return checkSingleRowUpdate; + public void setOptimisticLockHandling(boolean optimisticLockHandling) { + this.optimisticLockHandling = optimisticLockHandling; } - - public void setCheckSingleRowUpdate(boolean resultCheck) { - this.checkSingleRowUpdate = resultCheck; - } } Modified: addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/s2dao/internal/sqlcommand/InternalUpdateBatchAutoStaticCommand.java =================================================================== --- addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/s2dao/internal/sqlcommand/InternalUpdateBatchAutoStaticCommand.java 2008-12-27 22:02:56 UTC (rev 1623) +++ addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/s2dao/internal/sqlcommand/InternalUpdateBatchAutoStaticCommand.java 2008-12-27 22:06:42 UTC (rev 1624) @@ -21,10 +21,10 @@ // =========== public InternalUpdateBatchAutoStaticCommand(DataSource dataSource, StatementFactory statementFactory, BeanMetaData beanMetaData, - String[] propertyNames, boolean returningRows, + String[] propertyNames, boolean optimisticLockHandling, boolean versionNoAutoIncrementOnMemory) { super(dataSource, statementFactory, beanMetaData, propertyNames, - returningRows, versionNoAutoIncrementOnMemory); + optimisticLockHandling, versionNoAutoIncrementOnMemory); } //========================================================================== Modified: addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/s2dao/internal/sqlcommand/InternalUpdateDynamicCommand.java =================================================================== --- addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/s2dao/internal/sqlcommand/InternalUpdateDynamicCommand.java 2008-12-27 22:02:56 UTC (rev 1623) +++ addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/s2dao/internal/sqlcommand/InternalUpdateDynamicCommand.java 2008-12-27 22:06:42 UTC (rev 1624) @@ -28,11 +28,16 @@ // ======= public Object execute(Object args[]) { final CommandContext ctx = apply(args); - final InternalBasicUpdateHandler updateHandler = new InternalBasicUpdateHandler( - getDataSource(), ctx.getSql(), getStatementFactory()); - Object[] bindVariables = ctx.getBindVariables(); + final InternalBasicUpdateHandler updateHandler = createBasicUpdateHandler(ctx); + final Object[] bindVariables = ctx.getBindVariables(); updateHandler.setLoggingMessageSqlArgs(bindVariables); return new Integer(updateHandler.execute(bindVariables, ctx .getBindVariableTypes())); } + + protected InternalBasicUpdateHandler createBasicUpdateHandler( + CommandContext ctx) { + return new InternalBasicUpdateHandler(getDataSource(), ctx.getSql(), + getStatementFactory()); + } } Modified: addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/s2dao/internal/sqlcommand/InternalUpdateQueryAutoDynamicCommand.java =================================================================== --- addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/s2dao/internal/sqlcommand/InternalUpdateQueryAutoDynamicCommand.java 2008-12-27 22:02:56 UTC (rev 1623) +++ addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/s2dao/internal/sqlcommand/InternalUpdateQueryAutoDynamicCommand.java 2008-12-27 22:06:42 UTC (rev 1624) @@ -10,6 +10,7 @@ import javax.sql.DataSource; import jp.sf.pal.addresslist.db.allcommon.Entity; +import jp.sf.pal.addresslist.db.allcommon.bhv.core.SqlExecution; import jp.sf.pal.addresslist.db.allcommon.cbean.ConditionBean; import jp.sf.pal.addresslist.db.allcommon.dbmeta.DBMeta; import jp.sf.pal.addresslist.db.allcommon.dbmeta.DBMetaInstanceHandler; @@ -27,7 +28,8 @@ /** * @author DBFlute(AutoGenerator) */ -public class InternalUpdateQueryAutoDynamicCommand implements SqlCommand { +public class InternalUpdateQueryAutoDynamicCommand implements SqlCommand, + SqlExecution { //========================================================================== // ========= @@ -209,7 +211,7 @@ String[] argNames, Class[] argTypes, Object[] args) { CommandContext context; { - InternalSqlParser parser = new InternalSqlParser(twoWaySql); + InternalSqlParser parser = new InternalSqlParser(twoWaySql, true); Node node = parser.parse(); InternalCommandContextCreator creator = new InternalCommandContextCreator( argNames, argTypes); Modified: addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/s2dao/internal/sqlhandler/InternalAbstractAutoHandler.java =================================================================== --- addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/s2dao/internal/sqlhandler/InternalAbstractAutoHandler.java 2008-12-27 22:02:56 UTC (rev 1623) +++ addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/s2dao/internal/sqlhandler/InternalAbstractAutoHandler.java 2008-12-27 22:06:42 UTC (rev 1624) @@ -10,12 +10,14 @@ import javax.sql.DataSource; +import jp.sf.pal.addresslist.db.allcommon.exception.EntityAlreadyUpdatedException; +import jp.sf.pal.addresslist.db.allcommon.util.SimpleTypeUtil; + import org.seasar.dao.BeanMetaData; import org.seasar.extension.jdbc.PropertyType; import org.seasar.extension.jdbc.StatementFactory; import org.seasar.extension.jdbc.ValueType; import org.seasar.framework.beans.PropertyDesc; -import org.seasar.framework.util.IntegerConversionUtil; /** * @author DBFlute(AutoGenerator) @@ -38,8 +40,10 @@ protected PropertyType[] propertyTypes; - protected boolean versionNoAutoIncrementOnMemory = true; + protected boolean optimisticLockHandling; + protected boolean versionNoAutoIncrementOnMemory; + //========================================================================== // ========= // Constructor @@ -52,6 +56,10 @@ this.propertyTypes = propertyTypes; } + //========================================================================== + // ========= + // Execute + // ======= public int execute(Object[] args) { Connection connection = getConnection(); try { @@ -77,6 +85,9 @@ } finally { close(ps); } + if (optimisticLockHandling && ret != 1) { + throw createEntityAlreadyUpdatedException(bean, ret); + } postUpdateBean(bean, ret); return ret; } @@ -96,12 +107,25 @@ } } + protected EntityAlreadyUpdatedException createEntityAlreadyUpdatedException( + Object bean, int rows) { + return new EntityAlreadyUpdatedException(bean, rows); + } + + //========================================================================== + // ========= + // Pre/Post Bean + // ============= protected void preUpdateBean(Object bean) { } protected void postUpdateBean(Object bean, int ret) { } + //========================================================================== + // ========= + // Bind Setupper + // ============= protected abstract void setupBindVariables(Object bean); protected void setupInsertBindVariables(Object bean) { @@ -149,7 +173,7 @@ if (value == null) { continue;// because of 'VERSION_NO = VERSION_NO + 1' } - int intValue = IntegerConversionUtil.toPrimitiveInt(value) + 1; + int intValue = SimpleTypeUtil.toPrimitiveInt(value) + 1; setVersionNo(new Integer(intValue)); varList.add(getVersionNo()); } else { @@ -182,13 +206,13 @@ varList.add(pd.getValue(bean)); varValueTypeList.add(pt.getValueType()); } - if (bmd.hasVersionNoPropertyType()) { + if (optimisticLockHandling && bmd.hasVersionNoPropertyType()) { PropertyType pt = bmd.getVersionNoPropertyType(); PropertyDesc pd = pt.getPropertyDesc(); varList.add(pd.getValue(bean)); varValueTypeList.add(pt.getValueType()); } - if (bmd.hasTimestampPropertyType()) { + if (optimisticLockHandling && bmd.hasTimestampPropertyType()) { PropertyType pt = bmd.getTimestampPropertyType(); PropertyDesc pd = pt.getPropertyDesc(); varList.add(pd.getValue(bean)); @@ -260,6 +284,14 @@ this.propertyTypes = propertyTypes; } + public boolean isOptimisticLockHandling() { + return optimisticLockHandling; + } + + public void setOptimisticLockHandling(boolean optimisticLockHandling) { + this.optimisticLockHandling = optimisticLockHandling; + } + protected boolean isVersionNoAutoIncrementOnMemory() { return versionNoAutoIncrementOnMemory; } Modified: addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/s2dao/internal/sqlhandler/InternalAbstractBatchAutoHandler.java =================================================================== --- addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/s2dao/internal/sqlhandler/InternalAbstractBatchAutoHandler.java 2008-12-27 22:02:56 UTC (rev 1623) +++ addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/s2dao/internal/sqlhandler/InternalAbstractBatchAutoHandler.java 2008-12-27 22:06:42 UTC (rev 1624) @@ -9,6 +9,11 @@ import javax.sql.DataSource; +import jp.sf.pal.addresslist.db.allcommon.DBDef; +import jp.sf.pal.addresslist.db.allcommon.exception.BatchEntityAlreadyUpdatedException; +import jp.sf.pal.addresslist.db.allcommon.exception.EntityAlreadyDeletedException; +import jp.sf.pal.addresslist.db.allcommon.exception.EntityDuplicatedException; + import org.seasar.dao.BeanMetaData; import org.seasar.extension.jdbc.PropertyType; import org.seasar.extension.jdbc.StatementFactory; @@ -41,6 +46,39 @@ // ========= // Execute // ======= + public int execute(Object[] args) { + List list = null; + if (args[0] instanceof Object[]) { + list = Arrays.asList((Object[]) args[0]); + } else if (args[0] instanceof List) { + list = (List) args[0]; + } + if (list == null) { + throw new IllegalArgumentException("args[0]"); + } + int[] ret = execute(list); + int updatedRow = 0; + for (int i = 0; i < ret.length; i++) { + if (ret[i] > 0) { + updatedRow += ret[i]; + } + } + return updatedRow; + } + + public int[] executeBatch(Object[] args) { + List list = null; + if (args[0] instanceof Object[]) { + list = Arrays.asList((Object[]) args[0]); + } else if (args[0] instanceof List) { + list = (List) args[0]; + } + if (list == null) { + throw new IllegalArgumentException("args[0]"); + } + return execute(list); + } + public int[] execute(List list, Class[] argTypes) { return execute(list); } @@ -63,7 +101,9 @@ final Object bean = (Object) iter.next(); prepareBatchElement(ps, bean); } - return executeBatch(ps, list); + final int[] result = executeBatch(ps, list); + handleBatchUpdateResultWithOptimisticLock(ps, list, result); + return result; } finally { close(ps); } @@ -74,46 +114,100 @@ // postBatchUpdateBean(...); } - public int execute(Object[] args) { - List list = null; - if (args[0] instanceof Object[]) { - list = Arrays.asList((Object[]) args[0]); - } else if (args[0] instanceof List) { - list = (List) args[0]; + protected void prepareBatchElement(PreparedStatement ps, Object bean) { + setupBindVariables(bean); + logSql(getBindVariables(), getArgTypes(getBindVariables())); + bindArgs(ps, getBindVariables(), getBindVariableValueTypes()); + addBatch(ps); + } + + //========================================================================== + // ========= + // Optimistic Lock + // =============== + protected void handleBatchUpdateResultWithOptimisticLock( + PreparedStatement ps, List list, int[] result) { + if (DBDef.isCurrentDef(DBDef.Oracle)) { + final int updateCount; + try { + updateCount = ps.getUpdateCount(); + } catch (SQLException e) { + handleSQLException(e, ps); + return; // Unreachable! + } + handleBatchUpdateResultWithOptimisticLockByUpdateCount(list, + updateCount); + } else { + handleBatchUpdateResultWithOptimisticLockByResult(list, result); } - if (list == null) { - throw new IllegalArgumentException("args[0]"); + } + + protected void handleBatchUpdateResultWithOptimisticLockByUpdateCount( + List list, int updateCount) { + if (list.isEmpty()) { + return;// for Safety! } - int[] ret = execute(list); - int updatedRow = 0; - for (int i = 0; i < ret.length; i++) { - if (ret[i] > 0) { - updatedRow += ret[i]; + if (updateCount < 0) { + return;// for Safety! + } + final int entityCount = list.size(); + if (updateCount < entityCount) { + if (isOptimisticLockHandling()) { + throw new BatchEntityAlreadyUpdatedException(list.get(0), 0, + updateCount); + } else { + String msg = "The entity have already deleted:"; + msg = msg + " updateCount=" + updateCount; + msg = msg + " entityCount=" + entityCount; + msg = msg + " allEntities=" + list; + throw new EntityAlreadyDeletedException(msg); } } - return updatedRow; } - public int[] executeBatch(Object[] args) { - List list = null; - if (args[0] instanceof Object[]) { - list = Arrays.asList((Object[]) args[0]); - } else if (args[0] instanceof List) { - list = (List) args[0]; + protected void handleBatchUpdateResultWithOptimisticLockByResult( + List list, int[] result) { + if (list.isEmpty()) { + return;// for Safety! } - if (list == null) { - throw new IllegalArgumentException("args[0]"); + final int[] updatedCountArray = result; + final int entityCount = list.size(); + int index = 0; + boolean alreadyUpdated = false; + for (int oneUpdateCount : updatedCountArray) { + if (entityCount <= index) { + break;// for Safety! + } + if (oneUpdateCount == 0) { + alreadyUpdated = true; + break; + } else if (oneUpdateCount > 1) { + String msg = "The entity updated two or more records in batch update:"; + msg = msg + " entity=" + list.get(index); + msg = msg + " updatedCount=" + oneUpdateCount; + msg = msg + " allEntities=" + list; + throw new EntityDuplicatedException(msg); + } + ++index; } - return execute(list); + if (alreadyUpdated) { + int updateCount = 0; + for (int oneUpdateCount : updatedCountArray) { + updateCount = updateCount + oneUpdateCount; + } + if (isOptimisticLockHandling()) { + throw new BatchEntityAlreadyUpdatedException(list.get(index), + 0, updateCount); + } else { + String msg = "The entity have already deleted:"; + msg = msg + " entity=" + list.get(index); + msg = msg + " updateCount=" + updateCount; + msg = msg + " allEntities=" + list; + throw new EntityAlreadyDeletedException(msg); + } + } } - protected void prepareBatchElement(PreparedStatement ps, Object bean) { - setupBindVariables(bean); - logSql(getBindVariables(), getArgTypes(getBindVariables())); - bindArgs(ps, getBindVariables(), getBindVariableValueTypes()); - addBatch(ps); - } - //========================================================================== // ========= // JDBC Delegator Modified: addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/s2dao/internal/sqlhandler/InternalBasicHandler.java =================================================================== --- addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/s2dao/internal/sqlhandler/InternalBasicHandler.java 2008-12-27 22:02:56 UTC (rev 1623) +++ addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/s2dao/internal/sqlhandler/InternalBasicHandler.java 2008-12-27 22:06:42 UTC (rev 1624) @@ -9,6 +9,7 @@ import javax.sql.DataSource; import jp.sf.pal.addresslist.db.allcommon.CallbackContext; +import jp.sf.pal.addresslist.db.allcommon.DBDef; import jp.sf.pal.addresslist.db.allcommon.DBFluteConfig; import jp.sf.pal.addresslist.db.allcommon.InternalMapContext; import jp.sf.pal.addresslist.db.allcommon.QLog; @@ -25,7 +26,6 @@ import org.seasar.extension.jdbc.StatementFactory; import org.seasar.extension.jdbc.ValueType; import org.seasar.extension.jdbc.types.ValueTypes; -import org.seasar.framework.exception.SQLRuntimeException; /** * @author DBFlute(AutoGenerator) @@ -73,7 +73,7 @@ return; } for (int i = 0; i < args.length; ++i) { - ValueType valueType = getValueType(argTypes[i]); + final ValueType valueType = findValueType(args[i], argTypes[i]); try { valueType.bindValue(ps, i + 1, args[i]); } catch (SQLException e) { @@ -82,6 +82,19 @@ } } + protected ValueType findValueType(Object arg, Class argType) { + ValueType valueType = ValueTypes.getValueType(arg); + if (valueType != null) { + return valueType; + } + valueType = ValueTypes.getValueType(argType); + if (valueType != null) { + return valueType; + } + String msg = "Unknown type¡§argType=" + argType + " args=" + arg; + throw new IllegalStateException(msg); + } + protected Class[] getArgTypes(Object[] args) { if (args == null) { return null; @@ -151,10 +164,6 @@ return InternalBindVariableUtil.getBindVariableText(bindVariable); } - protected ValueType getValueType(Class clazz) { - return ValueTypes.getValueType(clazz); - } - //========================================================================== // ========= // Exception Handler @@ -194,9 +203,6 @@ public void handleSQLException(SQLException e, Statement statement, boolean uniqueConstraintValid, String completeSql) { - if (isSqlExceptionOldStyleHandling()) { - throw new SQLRuntimeException(e); - } if (uniqueConstraintValid && isUniqueConstraintException(e)) { throwEntityAlreadyExistsException(e, statement, completeSql); } @@ -217,10 +223,6 @@ .getUniqueConstraintDeterminator(); } - protected boolean isSqlExceptionOldStyleHandling() { - return DBFluteConfig.getInstance().isSqlExceptionOldStyleHandling(); - } - protected void throwEntityAlreadyExistsException(SQLException e, Statement statement, String completeSql) { String msg = "Look! Read the message below." + getLineSeparator(); @@ -560,7 +562,7 @@ // ========= // Assist Helper // ============= - // It needs this method if the target database doest not support line + // It needs this method if the target database does not support line // comment. protected String removeLineComment(final String sql) { // With removing CR! if (sql == null || sql.trim().length() == 0) { @@ -578,7 +580,8 @@ } sb.append(line).append("\n"); } - return sb.toString(); + final String filteredSql = sb.toString(); + return filteredSql.substring(0, filteredSql.lastIndexOf("\n")); } //========================================================================== @@ -606,9 +609,17 @@ } public void setSql(String sql) { + if (isRemoveLineCommentFromSql()) { + sql = removeLineComment(sql); + } this.sql = sql; } + protected boolean isRemoveLineCommentFromSql() { + // Because the MS-Access does not support line comments. + return DBDef.isCurrentDef(DBDef.MSAccess); + } + public StatementFactory getStatementFactory() { return statementFactory; } Modified: addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/s2dao/internal/sqlhandler/InternalBasicSelectHandler.java =================================================================== --- addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/s2dao/internal/sqlhandler/InternalBasicSelectHandler.java 2008-12-27 22:02:56 UTC (rev 1623) +++ addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/s2dao/internal/sqlhandler/InternalBasicSelectHandler.java 2008-12-27 22:06:42 UTC (rev 1624) @@ -45,8 +45,7 @@ return execute(args, getArgTypes(args)); } - @SuppressWarnings("unchecked") - public Object execute(Object[] args, Class[] argTypes) { + public Object execute(Object[] args, Class[] argTypes) { Connection conn = getConnection(); try { return execute(conn, args, argTypes); @@ -55,8 +54,7 @@ } } - @SuppressWarnings("unchecked") - public Object execute(Connection conn, Object[] args, Class[] argTypes) { + public Object execute(Connection conn, Object[] args, Class[] argTypes) { logSql(args, argTypes); PreparedStatement ps = null; try { Modified: addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/s2dao/internal/sqlhandler/InternalBasicUpdateHandler.java =================================================================== --- addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/s2dao/internal/sqlhandler/InternalBasicUpdateHandler.java 2008-12-27 22:02:56 UTC (rev 1623) +++ addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/s2dao/internal/sqlhandler/InternalBasicUpdateHandler.java 2008-12-27 22:06:42 UTC (rev 1624) @@ -29,8 +29,7 @@ return execute(args, getArgTypes(args)); } - @SuppressWarnings("unchecked") - public int execute(Object[] args, Class[] argTypes) { + public int execute(Object[] args, Class[] argTypes) { Connection connection = getConnection(); try { return execute(connection, args, argTypes); @@ -39,8 +38,7 @@ } } - @SuppressWarnings("unchecked") - public int execute(Connection connection, Object[] args, Class[] argTypes) { + public int execute(Connection connection, Object[] args, Class[] argTypes) { logSql(args, argTypes); PreparedStatement ps = prepareStatement(connection); try { Modified: addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/s2dao/internal/sqlhandler/InternalInsertAutoHandler.java =================================================================== --- addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/s2dao/internal/sqlhandler/InternalInsertAutoHandler.java 2008-12-27 22:02:56 UTC (rev 1623) +++ addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/s2dao/internal/sqlhandler/InternalInsertAutoHandler.java 2008-12-27 22:06:42 UTC (rev 1624) @@ -20,6 +20,7 @@ StatementFactory statementFactory, BeanMetaData beanMetaData, PropertyType[] propertyTypes) { super(dataSource, statementFactory, beanMetaData, propertyTypes); + setOptimisticLockHandling(false); } //========================================================================== Modified: addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/s2dao/internal/sqlhandler/InternalInsertBatchAutoHandler.java =================================================================== --- addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/s2dao/internal/sqlhandler/InternalInsertBatchAutoHandler.java 2008-12-27 22:02:56 UTC (rev 1623) +++ addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/s2dao/internal/sqlhandler/InternalInsertBatchAutoHandler.java 2008-12-27 22:06:42 UTC (rev 1624) @@ -19,8 +19,8 @@ public InternalInsertBatchAutoHandler(DataSource dataSource, StatementFactory statementFactory, BeanMetaData beanMetaData, PropertyType[] propertyTypes) { - super(dataSource, statementFactory, beanMetaData, propertyTypes); + setOptimisticLockHandling(false); } //========================================================================== Modified: addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/s2dao/internal/sqlhandler/InternalProcedureHandler.java =================================================================== --- addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/s2dao/internal/sqlhandler/InternalProcedureHandler.java 2008-12-27 22:02:56 UTC (rev 1623) +++ addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/s2dao/internal/sqlhandler/InternalProcedureHandler.java 2008-12-27 22:06:42 UTC (rev 1624) @@ -12,6 +12,7 @@ import javax.sql.DataSource; +import jp.sf.pal.addresslist.db.allcommon.helper.StringKeyMap; import jp.sf.pal.addresslist.db.allcommon.s2dao.internal.various.InternalProcedureMetaData; import jp.sf.pal.addresslist.db.allcommon.s2dao.internal.various.InternalProcedureParameterType; @@ -21,7 +22,6 @@ import org.seasar.extension.jdbc.ValueType; import org.seasar.extension.jdbc.impl.PropertyTypeImpl; import org.seasar.extension.jdbc.types.ValueTypes; -import org.seasar.framework.util.CaseInsensitiveMap; /** * @author DBFlute(AutoGenerator) @@ -220,10 +220,9 @@ protected static abstract class InternalAbstractMapResultSetHandler implements ResultSetHandler { - @SuppressWarnings("unchecked") protected Map createRow(ResultSet rs, PropertyType[] propertyTypes) throws SQLException { - Map row = new CaseInsensitiveMap(); + Map row = StringKeyMap.createAsFlexible(); for (int i = 0; i < propertyTypes.length; ++i) { Object value = propertyTypes[i].getValueType().getValue(rs, i + 1); Modified: addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/s2dao/internal/sqlhandler/InternalUpdateAutoHandler.java =================================================================== --- addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/s2dao/internal/sqlhandler/InternalUpdateAutoHandler.java 2008-12-27 22:02:56 UTC (rev 1623) +++ addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/s2dao/internal/sqlhandler/InternalUpdateAutoHandler.java 2008-12-27 22:06:42 UTC (rev 1624) @@ -2,8 +2,6 @@ import javax.sql.DataSource; -import jp.sf.pal.addresslist.db.allcommon.exception.EntityAlreadyUpdatedException; - import org.seasar.dao.BeanMetaData; import org.seasar.extension.jdbc.PropertyType; import org.seasar.extension.jdbc.StatementFactory; @@ -17,12 +15,6 @@ // ========= // Constructor // =========== - private boolean checkSingleRowUpdate = true; - - //========================================================================== - // ========= - // Constructor - // =========== public InternalUpdateAutoHandler(DataSource dataSource, StatementFactory statementFactory, BeanMetaData beanMetaData, PropertyType[] propertyTypes) { @@ -41,27 +33,7 @@ @Override protected void postUpdateBean(Object bean, int ret) { - if (isCheckSingleRowUpdate() && ret < 1) { - throw createEntityAlreadyUpdatedException(bean, ret); - } updateVersionNoIfNeed(bean); updateTimestampIfNeed(bean); } - - protected EntityAlreadyUpdatedException createEntityAlreadyUpdatedException( - Object bean, int rows) { - return new EntityAlreadyUpdatedException(bean, rows); - } - - //========================================================================== - // ========= - // Accessor - // ======== - public boolean isCheckSingleRowUpdate() { - return checkSingleRowUpdate; - } - - public void setCheckSingleRowUpdate(boolean resultCheck) { - this.checkSingleRowUpdate = resultCheck; - } } Modified: addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/s2dao/internal/sqlparser/InternalSqlParser.java =================================================================== --- addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/s2dao/internal/sqlparser/InternalSqlParser.java 2008-12-27 22:02:56 UTC (rev 1623) +++ addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/s2dao/internal/sqlparser/InternalSqlParser.java 2008-12-27 22:06:42 UTC (rev 1624) @@ -45,22 +45,25 @@ // ========= // Attribute // ========= + protected String specifiedSql; + + protected boolean blockNullParameter; + protected InternalSqlTokenizer tokenizer; protected Stack nodeStack = new Stack(); - protected String specifiedSql;// Extension! - //========================================================================== // ========= // Constructor // =========== - public InternalSqlParser(String sql) { + public InternalSqlParser(String sql, boolean blockNullParameter) { sql = sql.trim(); if (sql.endsWith(";")) { sql = sql.substring(0, sql.length() - 1); } - specifiedSql = sql;// Extension! + specifiedSql = sql; + this.blockNullParameter = blockNullParameter; tokenizer = new InternalSqlTokenizer(sql); } @@ -303,12 +306,14 @@ protected AbstractNode createBindVariableNode(String expr, String testValue) {// Extension // ! - return new InternalBindVariableNode(expr, testValue, specifiedSql); + return new InternalBindVariableNode(expr, testValue, specifiedSql, + blockNullParameter); } protected AbstractNode createEmbeddedValueNode(String expr, String testValue) {// Extension // ! - return new InternalEmbeddedValueNode(expr, testValue, specifiedSql); + return new InternalEmbeddedValueNode(expr, testValue, specifiedSql, + blockNullParameter); } protected ContainerNode createIfNode(String expr) {// Extension! @@ -344,12 +349,15 @@ protected String _specifiedSql; + protected boolean _blockNullParameter; + public InternalBindVariableNode(String expression, String testValue, - String specifiedSql) { + String specifiedSql, boolean blockNullParameter) { this._expression = expression; this._testValue = testValue; this._names = InternalStringUtil.split(expression, "."); this._specifiedSql = specifiedSql; + this._blockNullParameter = blockNullParameter; } public void accept(CommandContext ctx) { @@ -360,7 +368,7 @@ valueAndType.setTargetType(clazz); setupValueAndType(valueAndType); - if (valueAndType.getTargetValue() == null) { + if (_blockNullParameter && valueAndType.getTargetValue() == null) { throwBindOrEmbeddedParameterNullValueException(valueAndType); } if (!isInScope()) { @@ -462,12 +470,15 @@ protected String _specifiedSql; + protected boolean _blockNullParameter; + public InternalEmbeddedValueNode(String expression, String testValue, - String specifiedSql) { + String specifiedSql, boolean blockNullParameter) { this._expression = expression; this._testValue = testValue; this._names = InternalStringUtil.split(expression, "."); this._specifiedSql = specifiedSql; + this._blockNullParameter = blockNullParameter; } public void accept(CommandContext ctx) { @@ -478,7 +489,7 @@ valueAndType.setTargetType(clazz); setupValueAndType(valueAndType); - if (valueAndType.getTargetValue() == null) { + if (_blockNullParameter && valueAndType.getTargetValue() == null) { throwBindOrEmbeddedParameterNullValueException(valueAndType); } if (!isInScope()) { @@ -1276,7 +1287,8 @@ String[] argNames, Class[] argTypes, Object[] args) { final CommandContext context; { - final InternalSqlParser parser = new InternalSqlParser(twoWaySql); + final InternalSqlParser parser = new InternalSqlParser(twoWaySql, + false); final Node node = parser.parse(); final InternalCommandContextCreator creator = new InternalCommandContextCreator( argNames, argTypes); Added: addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/s2dao/internal/various/InternalIdentifierAbstractGenerator.java =================================================================== --- addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/s2dao/internal/various/InternalIdentifierAbstractGenerator.java (rev 0) +++ addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/s2dao/internal/various/InternalIdentifierAbstractGenerator.java 2008-12-27 22:06:42 UTC (rev 1624) @@ -0,0 +1,146 @@ +package jp.sf.pal.addresslist.db.allcommon.s2dao.internal.various; + +import java.sql.CallableStatement; +import java.sql.Connection; +import java.sql.PreparedStatement; +import java.sql.ResultSet; +import java.sql.SQLException; +import java.sql.Statement; + +import javax.sql.DataSource; + +import jp.sf.pal.addresslist.db.allcommon.s2dao.internal.sqlhandler.InternalBasicSelectHandler; +import jp.sf.pal.addresslist.db.allcommon.s2dao.internal.sqlhandler.InternalBasicHandler.SQLExceptionHandler; + +import org.seasar.dao.Dbms; +import org.seasar.dao.IdentifierGenerator; +import org.seasar.extension.jdbc.PropertyType; +import org.seasar.extension.jdbc.ResultSetHandler; +import org.seasar.extension.jdbc.StatementFactory; +import org.seasar.extension.jdbc.ValueType; +import org.seasar.framework.beans.PropertyDesc; + +/** + * @author DBFlute(AutoGenerator) + */ +public abstract class InternalIdentifierAbstractGenerator implements + IdentifierGenerator { + + //========================================================================== + // ========= + // Attribute + // ========= + protected PropertyType propertyType; + + protected Dbms dbms; + + protected ResultSetHandler resultSetHandler; + + //========================================================================== + // ========= + // Constructor + // =========== + public InternalIdentifierAbstractGenerator(PropertyType propertyType, + Dbms dbms) { + this.propertyType = propertyType; + this.dbms = dbms; + resultSetHandler = new InternalIdentifierResultSetHandler(propertyType + .getValueType()); + } + + //========================================================================== + // ========= + // Assist Helper + // ============= + protected Object executeSql(DataSource ds, String sql, Object[] args) { + InternalBasicSelectHandler selectHandler = createSelectHandler(ds, sql); + if (args != null) { + selectHandler.setLoggingMessageSqlArgs(args); + } + return selectHandler.execute(args); + } + + protected InternalBasicSelectHandler createSelectHandler(DataSource ds, + String sql) { + // Use original statement factory for identifier generator. + return new InternalBasicSelectHandler(ds, sql, resultSetHandler, + createStatementFactory(ds, sql)); + } + + protected StatementFactory createStatementFactory(DataSource ds, String sql) { + return new InternalIdentifierGeneratorStatementFactory(); + } + + protected void reflectIdentifier(Object bean, Object value) { + if (propertyType == null) { + String msg = "The arguement[propertyType] should not be null: value=" + + value; + throw new IllegalArgumentException(msg); + } + PropertyDesc pd = propertyType.getPropertyDesc(); + pd.setValue(bean, value); + } + + //========================================================================== + // ========= + // Result Set Handler + // ================== + protected static class InternalIdentifierResultSetHandler implements + ResultSetHandler { + private ValueType valueType; + + public InternalIdentifierResultSetHandler(ValueType valueType) { + this.valueType = valueType; + } + + public Object handle(ResultSet rs) throws SQLException { + if (rs.next()) { + return valueType.getValue(rs, 1); + } + return null; + } + } + + //========================================================================== + // ========= + // Statement Factory + // ================= + protected static class InternalIdentifierGeneratorStatementFactory + implements StatementFactory { + public PreparedStatement createPreparedStatement(Connection conn, + String sql) { + try { + return conn.prepareStatement(sql); + } catch (SQLException e) { + handleSQLException(e, null); + return null; // Unreachable! + } + } + + public CallableStatement createCallableStatement(Connection conn, + String sql) { + try { + return conn.prepareCall(sql); + } catch (SQLException e) { + handleSQLException(e, null); + return null; // Unreachable! + } + } + + protected void handleSQLException(SQLException e, Statement statement) { + new SQLExceptionHandler().handleSQLException(e, statement); + } + } + + //========================================================================== + // ========= + // Accessor + // ======== + public String getPropertyName() { + return propertyType.getPropertyName(); + } + + public Dbms getDbms() { + return dbms; + } +} Property changes on: addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/s2dao/internal/various/InternalIdentifierAbstractGenerator.java ___________________________________________________________________ Name: svn:eol-style + native Added: addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/s2dao/internal/various/InternalIdentifierAssignedGenerator.java =================================================================== --- addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/s2dao/internal/various/InternalIdentifierAssignedGenerator.java (rev 0) +++ addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/s2dao/internal/various/InternalIdentifierAssignedGenerator.java 2008-12-27 22:06:42 UTC (rev 1624) @@ -0,0 +1,33 @@ +package jp.sf.pal.addresslist.db.allcommon.s2dao.internal.various; + +import javax.sql.DataSource; + +import org.seasar.dao.Dbms; +import org.seasar.extension.jdbc.PropertyType; + +/** + * @author DBFlute(AutoGenerator) + */ +public class InternalIdentifierAssignedGenerator extends + InternalIdentifierAbstractGenerator { + + //========================================================================== + // ========= + // Constructor + // =========== + public InternalIdentifierAssignedGenerator(PropertyType propertyType, + Dbms dbms) { + super(propertyType, dbms); + } + + //========================================================================== + // ========= + // Implementation + // ============== + public void setIdentifier(Object bean, DataSource ds) { + } + + public boolean isSelfGenerate() { + return true; + } +} Property changes on: addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/s2dao/internal/various/InternalIdentifierAssignedGenerator.java ___________________________________________________________________ Name: svn:eol-style + native Added: addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/s2dao/internal/various/InternalIdentifierGeneratorFactory.java =================================================================== --- addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/s2dao/internal/various/InternalIdentifierGeneratorFactory.java (rev 0) +++ addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/s2dao/internal/various/InternalIdentifierGeneratorFactory.java 2008-12-27 22:06:42 UTC (rev 1624) @@ -0,0 +1,105 @@ +package jp.sf.pal.addresslist.db.allcommon.s2dao.internal.various; + +import java.lang.reflect.Constructor; +import java.util.HashMap; +import java.util.Map; + +import jp.sf.pal.addresslist.db.allcommon.util.SimpleStringUtil; + +import org.seasar.dao.Dbms; +import org.seasar.dao.IdentifierGenerator; +import org.seasar.extension.jdbc.PropertyType; +import org.seasar.framework.beans.BeanDesc; +import org.seasar.framework.beans.PropertyDesc; +import org.seasar.framework.beans.factory.BeanDescFactory; +import org.seasar.framework.util.ClassUtil; +import org.seasar.framework.util.ConstructorUtil; + +/** + * @author DBFlute(AutoGenerator) + */ +public class InternalIdentifierGeneratorFactory { + + //========================================================================== + // ========= + // Attribute + // ========= + private static Map> generatorClasses = new HashMap>(); + + static { + addIdentifierGeneratorClass("assigned", + InternalIdentifierAssignedGenerator.class); + addIdentifierGeneratorClass("identity", + InternalIdentifierIdentityGenerator.class); + addIdentifierGeneratorClass("sequence", + InternalIdentifierSequenceGenerator.class); + } + + //========================================================================== + // ========= + // Constructor + // =========== + private InternalIdentifierGeneratorFactory() { + } + + //========================================================================== + // ========= + // Identifier Generator + // ==================== + public static void addIdentifierGeneratorClass(String name, Class clazz) { + generatorClasses.put(name, clazz); + } + + public static IdentifierGenerator createIdentifierGenerator( + PropertyType propertyType, Dbms dbms) { + return createIdentifierGenerator(propertyType, dbms, null); + } + + public static IdentifierGenerator createIdentifierGenerator( + PropertyType propertyType, Dbms dbms, String annotation) { + if (propertyType == null) { + String msg = "The argument[propertyType] should not be null: dbms=" + + dbms + " annotation=" + annotation; + throw new IllegalArgumentException(msg); + } + if (dbms == null) { + String msg = "The argument[dbms] should not be null: propertyType=" + + propertyType + " annotation=" + annotation; + throw new IllegalArgumentException(msg); + } + if (annotation == null) { + return new InternalIdentifierAssignedGenerator(propertyType, dbms); + } + String[] array = SimpleStringUtil.split(annotation, "=, "); + Class clazz = getGeneratorClass(array[0]); + IdentifierGenerator generator = createIdentifierGenerator(clazz, + propertyType, dbms); + for (int i = 1; i < array.length; i += 2) { + setProperty(generator, array[i].trim(), array[i + 1].trim()); + } + return generator; + } + + protected static Class getGeneratorClass(String name) { + Class clazz = generatorClasses.get(name); + if (clazz != null) { + return clazz; + } + return ClassUtil.forName(name); + } + + protected static IdentifierGenerator createIdentifierGenerator( + Class clazz, PropertyType propertyType, Dbms dbms) { + Constructor constructor = ClassUtil.getConstructor(clazz, + new Class[] { PropertyType.class, Dbms.class }); + return (IdentifierGenerator) ConstructorUtil.newInstance(constructor, + new Object[] { propertyType, dbms }); + } + + protected static void setProperty(IdentifierGenerator generator, + String propertyName, String value) { + BeanDesc beanDesc = BeanDescFactory.getBeanDesc(generator.getClass()); + PropertyDesc pd = beanDesc.getPropertyDesc(propertyName); + pd.setValue(generator, value); + } +} Property changes on: addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/s2dao/internal/various/InternalIdentifierGeneratorFactory.java ___________________________________________________________________ Name: svn:eol-style + native Added: addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/s2dao/internal/various/InternalIdentifierIdentityGenerator.java =================================================================== --- addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/s2dao/internal/various/InternalIdentifierIdentityGenerator.java (rev 0) +++ addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/s2dao/internal/various/InternalIdentifierIdentityGenerator.java 2008-12-27 22:06:42 UTC (rev 1624) @@ -0,0 +1,35 @@ +package jp.sf.pal.addresslist.db.allcommon.s2dao.internal.various; + +import javax.sql.DataSource; + +import org.seasar.dao.Dbms; +import org.seasar.extension.jdbc.PropertyType; + +/** + * @author DBFlute(AutoGenerator) + */ +public class InternalIdentifierIdentityGenerator extends + InternalIdentifierAbstractGenerator { + + //========================================================================== + // ========= + // Constructor + // =========== + public InternalIdentifierIdentityGenerator(PropertyType propertyType, + Dbms dbms) { + super(propertyType, dbms); + } + + //========================================================================== + // ========= + // Implementation + // ============== + public void setIdentifier(Object bean, DataSource ds) { + Object value = executeSql(ds, getDbms().getIdentitySelectString(), null); + reflectIdentifier(bean, value); + } + + public boolean isSelfGenerate() { + return false; + } +} Property changes on: addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/s2dao/internal/various/InternalIdentifierIdentityGenerator.java ___________________________________________________________________ Name: svn:eol-style + native Added: addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/s2dao/internal/various/InternalIdentifierSequenceGenerator.java =================================================================== --- addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/s2dao/internal/various/InternalIdentifierSequenceGenerator.java (rev 0) +++ addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/s2dao/internal/various/InternalIdentifierSequenceGenerator.java 2008-12-27 22:06:42 UTC (rev 1624) @@ -0,0 +1,116 @@ +package jp.sf.pal.addresslist.db.allcommon.s2dao.internal.various; + +import java.util.HashMap; + +import javax.sql.DataSource; + +import jp.sf.pal.addresslist.db.allcommon.util.SimpleTypeUtil; + +import org.seasar.dao.Dbms; +import org.seasar.extension.jdbc.PropertyType; + +/** + * @author DBFlute(AutoGenerator) + */ +public class InternalIdentifierSequenceGenerator extends + InternalIdentifierAbstractGenerator { + + // - - - - - - - - - - + // [Unused on DBFlute] + // - - - - - - - - - - + + //========================================================================== + // ========= + // Attribute + // ========= + private String sequenceName; + + private long allocationSize = 0; + + private HashMap idContextMap = new HashMap(); + + //========================================================================== + // ========= + // Constructor + // =========== + public InternalIdentifierSequenceGenerator(PropertyType propertyType, + Dbms dbms) { + super(propertyType, dbms); + } + + //========================================================================== + // ========= + // Implementation + // ============== + public void setIdentifier(Object bean, DataSource ds) { + reflectIdentifier(bean, getNextValue(ds)); + } + + public boolean isSelfGenerate() { + return getDbms().isSelfGenerate(); + } + + //========================================================================== + // ========= + // Next Value + // ========== + protected Object getNextValue(DataSource ds) { + if (allocationSize > 0) { + long value = getIdContext(ds).getNextValue(ds); + return new Long(value); + } + return getNewInitialValue(ds); + } + + protected Object getNewInitialValue(DataSource ds) { + return executeSql(ds, getDbms().getSequenceNextValString(sequenceName), + null); + } + + protected IdContext getIdContext(DataSource ds) { + synchronized (idContextMap) { + IdContext context = idContextMap.get(ds); + if (context == null) { + context = new IdContext(); + idContextMap.put(ds, context); + } + return context; + } + } + + public class IdContext { + protected long initialValue; + + protected long allocated = Long.MAX_VALUE; + + public synchronized long getNextValue(DataSource ds) { + if (allocated < allocationSize) { + return initialValue + allocated++; + } + initialValue = SimpleTypeUtil + .toPrimitiveLong(getNewInitialValue(ds)); + allocated = 1; + return initialValue; + } + } + + //========================================================================== + // ========= + // Accessor + // ======== + public String getSequenceName() { + return sequenceName; + } + + public void setSequenceName(String sequenceName) { + this.sequenceName = sequenceName; + } + + public long getAllocationSize() { + return allocationSize; + } + + public void setAllocationSize(long allocationSize) { + this.allocationSize = allocationSize; + } +} Property changes on: addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/s2dao/internal/various/InternalIdentifierSequenceGenerator.java ___________________________________________________________________ Name: svn:eol-style + native Modified: addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/s2dao/internal/various/InternalProcedureMetaDataFactory.java =================================================================== --- addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/s2dao/internal/various/InternalProcedureMetaDataFactory.java 2008-12-27 22:02:56 UTC (rev 1623) +++ addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/s2dao/internal/various/InternalProcedureMetaDataFactory.java 2008-12-27 22:06:42 UTC (rev 1624) @@ -7,7 +7,7 @@ import java.util.Map; import java.util.Stack; -import jp.sf.pal.addresslist.db.allcommon.cbean.ConditionBeanContext; +import jp.sf.pal.addresslist.db.allcommon.DBDef; import org.seasar.dao.ValueTypeFactory; import org.seasar.dao.util.TypeUtil; @@ -146,9 +146,9 @@ } final Class type = field.getType(); if (List.class.isAssignableFrom(type)) {// is for out parameter cursor. - if (ConditionBeanContext.isOracle()) { + if (DBDef.isCurrentDef(DBDef.Oracle)) { return ValueTypes.ORACLE_RESULT_SET; - } else if (ConditionBeanContext.isPostgreSql()) { + } else if (DBDef.isCurrentDef(DBDef.PostgreSQL)) { return ValueTypes.POSTGRE_RESULT_SET; } else { return ValueTypes.SERIALIZABLE_BYTE_ARRAY; Added: addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/s2dao/internal/various/InternalStatementFactory.java =================================================================== --- addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/s2dao/internal/various/InternalStatementFactory.java (rev 0) +++ addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/s2dao/internal/various/InternalStatementFactory.java 2008-12-27 22:06:42 UTC (rev 1624) @@ -0,0 +1,158 @@ +package jp.sf.pal.addresslist.db.allcommon.s2dao.internal.various; + +import java.sql.CallableStatement; +import java.sql.Connection; +import java.sql.PreparedStatement; +import java.sql.SQLException; +import java.sql.Statement; + +import jp.sf.pal.addresslist.db.allcommon.cbean.ConditionBean; +import jp.sf.pal.addresslist.db.allcommon.cbean.ConditionBeanContext; +import jp.sf.pal.addresslist.db.allcommon.cbean.outsidesql.OutsideSqlContext; +import jp.sf.pal.addresslist.db.allcommon.jdbc.StatementConfig; +import jp.sf.pal.addresslist.db.allcommon.s2dao.internal.sqlhandler.InternalBasicHandler.SQLExceptionHandler; + +import org.seasar.extension.jdbc.StatementFactory; + +/** + * @author DBFlute(AutoGenerator) + */ +public class InternalStatementFactory implements StatementFactory { + + //========================================================================== + // ========= + // Definition + // ========== + /** Log-instance. */ + private static final org.apache.commons.logging.Log _log = org.apache.commons.logging.LogFactory + .getLog(InternalStatementFactory.class); + + //========================================================================== + // ========= + // Attribute + // ========= + protected StatementConfig defaultStatementConfig; + + protected boolean internalDebug; + + //========================================================================== + // ========= + // Constructor + // =========== + public InternalStatementFactory() { + } + + //========================================================================== + // ========= + // Implementation + // ============== + public PreparedStatement createPreparedStatement(Connection conn, String sql) { + try { + final StatementConfig config = findStatementConfigOnThread(); + ; + final int resultSetType; + if (config != null && config.hasResultSetType()) { + resultSetType = config.getResultSetType(); + } else if (defaultStatementConfig != null + && defaultStatementConfig.hasResultSetType()) { + resultSetType = defaultStatementConfig.getResultSetType(); + } else { + resultSetType = java.sql.ResultSet.TYPE_FORWARD_ONLY; + } + final int resultSetConcurrency = java.sql.ResultSet.CONCUR_READ_ONLY; + if (internalDebug) { + _log.debug("...Creating prepareStatement(sql, " + resultSetType + + ", " + resultSetConcurrency + ")"); + } + final PreparedStatement ps = conn.prepareStatement(sql, + resultSetType, resultSetConcurrency); + if (config != null && config.hasStatementOptions()) { + if (internalDebug) { + _log.debug("...Setting statement config as request: " + + config); + } + reflectStatementOptions(config, ps); + } else { + reflectDefaultOptionsToStatementIfNeeds(ps); + } + return ps; + } catch (SQLException e) { + handleSQLException(e, null); + return null;// Unreachable! + } + } + + public CallableStatement createCallableStatement(Connection conn, String sql) { + return prepareCall(conn, sql); + } + + protected StatementConfig findStatementConfigOnThread() { + final StatementConfig config; + if (ConditionBeanContext.isExistConditionBeanOnThread()) { + final ConditionBean cb = ConditionBeanContext + .getConditionBeanOnThread(); + config = cb.getStatementConfig(); + } else if (OutsideSqlContext.isExistOutsideSqlContextOnThread()) { + final OutsideSqlContext context = OutsideSqlContext + .getOutsideSqlContextOnThread(); + config = context.getStatementConfig(); + } else { + config = null; + } + return config; + } + + protected void reflectDefaultOptionsToStatementIfNeeds(PreparedStatement ps) { + if (defaultStatementConfig != null + && defaultStatementConfig.hasStatementOptions()) { + if (internalDebug) { + _log.debug("...Setting statement config as default: " + + defaultStatementConfig); + } + reflectStatementOptions(defaultStatementConfig, ps); + return; + } + } + + protected void reflectStatementOptions(StatementConfig config, + PreparedStatement ps) { + try { + if (config.hasQueryTimeout()) { + ps.setQueryTimeout(config.getQueryTimeout()); + } + if (config.hasFetchSize()) { + ps.setFetchSize(config.getFetchSize()); + } + if (config.hasMaxRows()) { + ps.setMaxRows(config.getMaxRows()); + } + } catch (SQLException e) { + handleSQLException(e, ps); + } + } + + protected CallableStatement prepareCall(Connection conn, String sql) { + try { + return conn.prepareCall(sql); + } catch (SQLException e) { + handleSQLException(e, null); + return null;// Unreachable! + } + } + + protected void handleSQLException(SQLException e, Statement statement) { + new SQLExceptionHandler().handleSQLException(e, statement); + } + + //========================================================================== + // ========= + // Accessor + // ======== + public void setDefaultStatementConfig(StatementConfig defaultStatementConfig) { + this.defaultStatementConfig = defaultStatementConfig; + } + + public void setInternalDebug(boolean internalDebug) { + this.internalDebug = internalDebug; + } +} Property changes on: addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/s2dao/internal/various/InternalStatementFactory.java ___________________________________________________________________ Name: svn:eol-style + native Modified: addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/util/SimpleAssertUtil.java =================================================================== --- addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/util/SimpleAssertUtil.java 2008-12-27 22:02:56 UTC (rev 1623) +++ addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/util/SimpleAssertUtil.java 2008-12-27 22:06:42 UTC (rev 1624) @@ -7,11 +7,8 @@ //========================================================================== // ========= - // Assert + // Object // ====== - // ----------------------------------------------------- - // Assert Object - // ------------- /** * Assert that the object is not null. * @@ -32,9 +29,10 @@ } } - // ----------------------------------------------------- - // Assert String - // ------------- + //========================================================================== + // ========= + // String + // ====== /** * Assert that the entity is not null and not trimmed empty. * Added: addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/util/SimpleResourceUtil.java =================================================================== --- addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/util/SimpleResourceUtil.java (rev 0) +++ addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/util/SimpleResourceUtil.java 2008-12-27 22:06:42 UTC (rev 1624) @@ -0,0 +1,117 @@ +package jp.sf.pal.addresslist.db.allcommon.util; + +import java.io.IOException; +import java.io.InputStream; +import java.net.URL; +import java.net.URLConnection; + +/** + * @author DBFlute(AutoGenerator) + */ +public class SimpleResourceUtil { + + //========================================================================== + // ========= + // Resource Path + // ============= + public static String getResourcePath(String path, String extension) { + if (extension == null) { + return path; + } + extension = "." + extension; + if (path.endsWith(extension)) { + return path; + } + return path.replace('.', '/') + extension; + } + + public static String getResourcePath(Class clazz) { + return clazz.getName().replace('.', '/') + ".class"; + } + + //========================================================================== + // ========= + // Resource URL + // ============ + public static URL getResourceUrl(String path) { + return getResourceUrl(path, null); + } + + public static URL getResourceUrl(String path, String extension) { + return getResourceUrl(path, extension, Thread.currentThread() + .getContextClassLoader()); + } + + public static URL getResourceUrl(String path, String extension, + ClassLoader loader) { + if (path == null || loader == null) { + return null; + } + path = getResourcePath(path, extension); + return loader.getResource(path); + } + + //========================================================================== + // ========= + // Resource Stream + // =============== + public static InputStream getResourceStream(String path) { + return getResourceStream(path, null); + } + + public static InputStream getResourceStream(String path, String extension) { + final URL url = getResourceUrl(path, extension); + return url != null ? openStream(url) : null; + } + + //========================================================================== + // ========= + // Resource Existence + // ================== + public static boolean isExist(String path) { + return getResourceUrl(path) != null; + } + + //========================================================================== + // ========= + // Assist Helper + // ============= + protected static ClassLoader getClassLoader() { + return Thread.currentThread().getContextClassLoader(); + } + + protected static InputStream openStream(URL url) { + try { + URLConnection connection = url.openConnection(); + connection.setUseCaches(false); + return connection.getInputStream(); + } catch (IOException e) { + String msg = "Failed to open the stream: url=" + url; + throw new IllegalStateException(msg, e); + } + } + + //========================================================================== + // ========= + // Assert Helper + // ============= + /** + * Assert that the object is not null. + * + * @param variableName Variable name. (NotNull) + * @param value Value. (NotNull) + * @exception IllegalArgumentException + */ + protected static void assertObjectNotNull(String variableName, Object value) { + if (variableName == null) { + String msg = "The value should not be null: variableName=" + + variableName + " value=" + value; + throw new IllegalArgumentException(msg); + } + if (value == null) { + String msg = "The value should not be null: variableName=" + + variableName; + throw new IllegalArgumentException(msg); + } + } +} Property changes on: addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/util/SimpleResourceUtil.java ___________________________________________________________________ Name: svn:eol-style + native Modified: addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/util/SimpleStringUtil.java =================================================================== --- addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/util/SimpleStringUtil.java 2008-12-27 22:02:56 UTC (rev 1623) +++ addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/util/SimpleStringUtil.java 2008-12-27 22:06:42 UTC (rev 1624) @@ -1,14 +1,20 @@ package jp.sf.pal.addresslist.db.allcommon.util; +import java.util.ArrayList; +import java.util.List; +import java.util.StringTokenizer; + /** * @author DBFlute(AutoGenerator) */ public class SimpleStringUtil { + protected static final String[] EMPTY_STRINGS = new String[0]; + //========================================================================== // ========= - // String - // ====== + // Replace + // ======= public static String replace(String text, String fromText, String toText) { if (text == null || fromText == null || toText == null) { return null; @@ -32,6 +38,26 @@ } while (true); } + //========================================================================== + // ========= + // Split + // ===== + public static String[] split(final String str, final String delimiter) { + if (str == null || str.trim().length() == 0) { + return EMPTY_STRINGS; + } + final List list = new ArrayList(); + final StringTokenizer st = new StringTokenizer(str, delimiter); + while (st.hasMoreElements()) { + list.add(st.nextToken()); + } + return (String[]) list.toArray(new String[list.size()]); + } + + //========================================================================== + // ========= + // Initial Convert + // =============== public static String initCap(String str) { assertObjectNotNull("str", str); return str.substring(0, 1).toUpperCase() + str.substring(1); @@ -42,9 +68,10 @@ return str.substring(0, 1).toLowerCase() + str.substring(1); } - // ----------------------------------------------------- - // Assert Object - // ------------- + //========================================================================== + // ========= + // Assert Helper + // ============= /** * Assert that the object is not null. * Modified: addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/util/SimpleSystemUtil.java =================================================================== --- addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/util/SimpleSystemUtil.java 2008-12-27 22:02:56 UTC (rev 1623) +++ addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/util/SimpleSystemUtil.java 2008-12-27 22:06:42 UTC (rev 1624) @@ -7,8 +7,8 @@ //========================================================================== // ========= - // System - // ====== + // Line Separator + // ============== public static String getLineSeparator() { // /- - - - - - - - - - - - - - - - - - - - - - // Because 'CR + LF' caused many trouble! Added: addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/util/SimpleTypeUtil.java =================================================================== --- addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/util/SimpleTypeUtil.java (rev 0) +++ addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/util/SimpleTypeUtil.java 2008-12-27 22:06:42 UTC (rev 1624) @@ -0,0 +1,692 @@ +package jp.sf.pal.addresslist.db.allcommon.util; + +import java.math.BigDecimal; +import java.math.BigInteger; +import java.text.DateFormat; +import java.text.DecimalFormatSymbols; +import java.text.ParseException; +import java.text.SimpleDateFormat; +import java.util.ArrayList; +import java.util.Calendar; +import java.util.Date; +import java.util.List; +import java.util.Locale; +import java.util.Map; +import java.util.StringTokenizer; +import java.util.concurrent.ConcurrentHashMap; + +/** + * {Refers to S2Container's utility and Extends it} + * + * @author DBFlute(AutoGenerator) + */ +public class SimpleTypeUtil { + + //========================================================================== + // ========= + // Convert To + // ========== + // ----------------------------------------------------- + // Boolean + // ------- + public static Boolean toBoolean(Object o) { + if (o == null) { + return null; + } else if (o instanceof Boolean) { + return (Boolean) o; + } else if (o instanceof Number) { + int num = ((Number) o).intValue(); + return Boolean.valueOf(num != 0); + } else if (o instanceof String) { + String s = (String) o; + if ("true".equalsIgnoreCase(s)) { + return Boolean.TRUE; + } else if ("false".equalsIgnoreCase(s)) { + return Boolean.FALSE; + } else if (s.equals("0")) { + return Boolean.FALSE; + } else { + return Boolean.TRUE; + } + } else { + return Boolean.TRUE; + } + } + + // ----------------------------------------------------- + // Integer + // ------- + public static Integer toInteger(Object o) { + return toInteger(o, null); + } + + public static Integer toInteger(Object o, String pattern) { + if (o == null) { + return null; + } else if (o instanceof Integer) { + return (Integer) o; + } else if (o instanceof Number) { + return new Integer(((Number) o).intValue()); + } else if (o instanceof String) { + return toInteger((String) o); + } else if (o instanceof java.util.Date) { + if (pattern != null) { + return new Integer(new SimpleDateFormat(pattern).format(o)); + } + return new Integer((int) ((java.util.Date) o).getTime()); + } else if (o instanceof Boolean) { + return ((Boolean) o).booleanValue() ? new Integer(1) : new Integer( + 0); + } else { + return toInteger(o.toString()); + } + } + + protected static Integer toInteger(String s) { + if (s == null || s.trim().length() == 0) { + return null; + } + return new Integer(normalize(s)); + } + + public static int toPrimitiveInt(Object o) { + return toPrimitiveInt(o, null); + } + + public static int toPrimitiveInt(Object o, String pattern) { + if (o == null) { + return 0; + } else if (o instanceof Number) { + return ((Number) o).intValue(); + } else if (o instanceof String) { + return toPrimitiveInt((String) o); + } else if (o instanceof java.util.Date) { + if (pattern != null) { + return Integer + .parseInt(new SimpleDateFormat(pattern).format(o)); + } + return (int) ((java.util.Date) o).getTime(); + } else if (o instanceof Boolean) { + return ((Boolean) o).booleanValue() ? 1 : 0; + } else { + return toPrimitiveInt(o.toString()); + } + } + + protected static int toPrimitiveInt(String s) { + if (s == null || s.trim().length() == 0) { + return 0; + } + return Integer.parseInt(normalize(s)); + } + + // ----------------------------------------------------- + // BigDecimal + // ---------- + public static BigDecimal toBigDecimal(Object o) { + return toBigDecimal(o, null); + } + + public static BigDecimal toBigDecimal(Object o, String pattern) { + if (o == null) { + return null; + } else if (o instanceof BigDecimal) { + return (BigDecimal) o; + } else if (o instanceof java.util.Date) { + if (pattern != null) { + return new BigDecimal(new SimpleDateFormat(pattern).format(o)); + } + return new BigDecimal(Long.toString(((java.util.Date) o).getTime())); + } else if (o instanceof String) { + String s = (String) o; + if (s == null || s.trim().length() == 0) { + return null; + } + return new BigDecimal(new BigDecimal(s).toPlainString()); + } else { + return new BigDecimal(new BigDecimal(o.toString()).toPlainString()); + } + } + + // ----------------------------------------------------- + // Double + // ------ + public static Double toDouble(Object o) { + return toDouble(o, null); + } + + public static Double toDouble(Object o, String pattern) { + if (o == null) { + return null; + } else if (o instanceof Double) { + return (Double) o; + } else if (o instanceof Number) { + return new Double(((Number) o).doubleValue()); + } else if (o instanceof String) { + return toDouble((String) o); + } else if (o instanceof java.util.Date) { + if (pattern != null) { + return new Double(new SimpleDateFormat(pattern).format(o)); + } + return new Double(((java.util.Date) o).getTime()); + } else { + return toDouble(o.toString()); + } + } + + protected static Double toDouble(String s) { + if (s == null || s.trim().length() == 0) { + return null; + } + return new Double(normalize(s)); + } + + // ----------------------------------------------------- + // Long + // ---- + public static Long toLong(Object o) { + return toLong(o, null); + } + + public static Long toLong(Object o, String pattern) { + if (o == null) { + return null; + } else if (o instanceof Long) { + return (Long) o; + } else if (o instanceof Number) { + return new Long(((Number) o).longValue()); + } else if (o instanceof String) { + return toLong((String) o); + } else if (o instanceof java.util.Date) { + if (pattern != null) { + return new Long(new SimpleDateFormat(pattern).format(o)); + } + return new Long(((java.util.Date) o).getTime()); + } else if (o instanceof Boolean) { + return ((Boolean) o).booleanValue() ? new Long(1) : new Long(0); + } else { + return toLong(o.toString()); + } + } + + protected static Long toLong(String s) { + if (s == null || s.trim().length() == 0) { + return null; + } + return new Long(normalize(s)); + } + + public static long toPrimitiveLong(Object o) { + return toPrimitiveLong(o, null); + } + + public static long toPrimitiveLong(Object o, String pattern) { + if (o == null) { + return 0; + } else if (o instanceof Number) { + return ((Number) o).longValue(); + } else if (o instanceof String) { + return toPrimitiveLong((String) o); + } else if (o instanceof java.util.Date) { + if (pattern != null) { + return Long.parseLong(new SimpleDateFormat(pattern).format(o)); + } + return ((java.util.Date) o).getTime(); + } else if (o instanceof Boolean) { + return ((Boolean) o).booleanValue() ? 1 : 0; + } else { + return toPrimitiveLong(o.toString()); + } + } + + protected static long toPrimitiveLong(String s) { + if (s == null || s.trim().length() == 0) { + return 0; + } + return Long.parseLong(normalize(s)); + } + + // ----------------------------------------------------- + // Float + // ----- + public static Float toFloat(Object o) { + return toFloat(o, null); + } + + public static Float toFloat(Object o, String pattern) { + if (o == null) { + return null; + } else if (o instanceof Float) { + return (Float) o; + } else if (o instanceof Number) { + return new Float(((Number) o).floatValue()); + } else if (o instanceof String) { + return toFloat((String) o); + } else if (o instanceof java.util.Date) { + if (pattern != null) { + return new Float(new SimpleDateFormat(pattern).format(o)); + } + return new Float(((java.util.Date) o).getTime()); + } else { + return toFloat(o.toString()); + } + } + + protected static Float toFloat(String s) { + if (s == null || s.trim().length() == 0) { + return null; + } + return new Float(normalize(s)); + } + + // ----------------------------------------------------- + // Short + // ----- + public static Short toShort(Object o) { + return toShort(o, null); + } + + public static Short toShort(Object o, String pattern) { + if (o == null) { + return null; + } else if (o instanceof Short) { + return (Short) o; + } else if (o instanceof Number) { + return new Short(((Number) o).shortValue()); + } else if (o instanceof String) { + return toShort((String) o); + } else if (o instanceof java.util.Date) { + if (pattern != null) { + return new Short(new SimpleDateFormat(pattern).format(o)); + } + return new Short((short) ((java.util.Date) o).getTime()); + } else if (o instanceof Boolean) { + return ((Boolean) o).booleanValue() ? new Short((short) 1) + : new Short((short) 0); + } else { + return toShort(o.toString()); + } + } + + protected static Short toShort(String s) { + if (s == null || s.trim().length() == 0) { + return null; + } + return new Short(normalize(s)); + } + + // ----------------------------------------------------- + // BigInteger + // ---------- + public static BigInteger toBigInteger(Object o) { + return toBigInteger(o, null); + } + + public static BigInteger toBigInteger(Object o, String pattern) { + if (o == null) { + return null; + } else if (o instanceof BigInteger) { + return (BigInteger) o; + } else { + Long l = toLong(o, pattern); + if (l == null) { + return null; + } + return BigInteger.valueOf(l.longValue()); + } + } + + // ----------------------------------------------------- + // Byte + // ---- + public static Byte toByte(Object o) { + return toByte(o, null); + } + + public static Byte toByte(Object o, String pattern) { + if (o == null) { + return null; + } else if (o instanceof Byte) { + return (Byte) o; + } else if (o instanceof Number) { + return new Byte(((Number) o).byteValue()); + } else if (o instanceof String) { + return toByte((String) o); + } else if (o instanceof java.util.Date) { + if (pattern != null) { + return new Byte(new SimpleDateFormat(pattern).format(o)); + } + return new Byte((byte) ((java.util.Date) o).getTime()); + } else if (o instanceof Boolean) { + return ((Boolean) o).booleanValue() ? new Byte((byte) 1) + : new Byte((byte) 0); + } else { + return toByte(o.toString()); + } + } + + protected static Byte toByte(String s) { + if (s == null || s.trim().length() == 0) { + return null; + } + return new Byte(normalize(s)); + } + + // ----------------------------------------------------- + // Date + // ---- + public static Date toDate(Object o) { + return toDate(o, null); + } + + public static Date toDate(Object o, String pattern) { + if (o == null) { + return null; + } else if (o instanceof String) { + return toDate((String) o, pattern); + } else if (o instanceof Date) { + return (Date) o; + } else if (o instanceof Calendar) { + return ((Calendar) o).getTime(); + } else { + return toDate(o.toString(), pattern); + } + } + + protected static Date toDate(String s, String pattern) { + return toDate(s, pattern, Locale.getDefault()); + } + + protected static Date toDate(String s, String pattern, Locale locale) { + if (s == null || s.trim().length() == 0) { + return null; + } + SimpleDateFormat sdf = getDateFormat(s, pattern, locale); + try { + return sdf.parse(s); + } catch (ParseException e) { + String msg = "Failed to parse the string to date: "; + msg = msg + " string=" + s + " format=" + sdf + " locale=" + locale; + throw new IllegalStateException(msg, e); + } + } + + public static java.sql.Date toSqlDate(Object o) { + return toSqlDate(o, null); + } + + public static java.sql.Date toSqlDate(Object o, String pattern) { + if (o instanceof java.sql.Date) { + return (java.sql.Date) o; + } + java.util.Date date = toDate(o, pattern); + if (date != null) { + return new java.sql.Date(date.getTime()); + } + return null; + } + + // ----------------------------------------------------- + // Number + // ------ + public static Object toNumber(Class type, Object o) { + if (type == Integer.class) { + return toInteger(o); + } else if (type == BigDecimal.class) { + return toBigDecimal(o); + } else if (type == Double.class) { + return toDouble(o); + } else if (type == Long.class) { + return toLong(o); + } else if (type == Float.class) { + return toFloat(o); + } else if (type == Short.class) { + return toShort(o); + } else if (type == BigInteger.class) { + return toBigInteger(o); + } else if (type == Byte.class) { + return toByte(o); + } + return o; + } + + // ----------------------------------------------------- + // Wrapper + // ------- + public static Object toWrapper(Class type, Object o) { + if (type == int.class) { + Integer i = toInteger(o); + if (i != null) { + return i; + } + return new Integer(0); + } else if (type == double.class) { + Double d = toDouble(o); + if (d != null) { + return d; + } + return new Double(0); + } else if (type == long.class) { + Long l = toLong(o); + if (l != null) { + return l; + } + return new Long(0); + } else if (type == float.class) { + Float f = toFloat(o); + if (f != null) { + return f; + } + return new Float(0); + } else if (type == short.class) { + Short s = toShort(o); + if (s != null) { + return s; + } + return new Short((short) 0); + } else if (type == boolean.class) { + Boolean b = toBoolean(o); + if (b != null) { + return b; + } + return Boolean.FALSE; + } else if (type == byte.class) { + Byte b = toByte(o); + if (b != null) { + return b; + } + return new Byte((byte) 0); + } + return o; + } + + //========================================================================== + // ========= + // Normalize + // ========= + protected static String normalize(String s) { + return normalize(s, Locale.getDefault()); + } + + protected static String normalize(String s, Locale locale) { + if (s == null) { + return null; + } + DecimalFormatSymbols symbols = getDecimalFormatSymbols(locale); + char decimalSep = symbols.getDecimalSeparator(); + char groupingSep = symbols.getGroupingSeparator(); + StringBuilder sb = new StringBuilder(20); + for (int i = 0; i < s.length(); ++i) { + char c = s.charAt(i); + if (c == groupingSep) { + continue; + } else if (c == decimalSep) { + c = '.'; + } + sb.append(c); + } + return sb.toString(); + } + + //========================================================================== + // ========= + // Assist Helper + // ============= + + // ----------------------------------------------------- + // DateFormat + // ---------- + protected static SimpleDateFormat getDateFormat(String s, String pattern, + Locale locale) { + if (pattern != null) { + return new SimpleDateFormat(pattern); + } + return getDateFormat(s, locale); + } + + protected static SimpleDateFormat getDateFormat(String s, Locale locale) { + String pattern = getDateFormatPattern(locale); + String shortPattern = removeDateDelimiter(pattern); + String delimitor = findDateDelimiter(s); + if (delimitor == null) { + if (s.length() == shortPattern.length()) { + return new SimpleDateFormat(shortPattern); + } + if (s.length() == shortPattern.length() + 2) { + return new SimpleDateFormat(replace(shortPattern, "yy", "yyyy")); + } + } else { + String[] array = split(s, delimitor); + for (int i = 0; i < array.length; ++i) { + if (array[i].length() == 4) { + pattern = replace(pattern, "yy", "yyyy"); + break; + } + } + return new SimpleDateFormat(pattern); + } + return new SimpleDateFormat(); + } + + protected static String getDateFormatPattern(Locale locale) { + SimpleDateFormat df = (SimpleDateFormat) DateFormat.getDateInstance( + DateFormat.SHORT, locale); + String pattern = df.toPattern(); + int index = pattern.indexOf(' '); + if (index > 0) { + pattern = pattern.substring(0, index); + } + if (pattern.indexOf("MM") < 0) { + pattern = replace(pattern, "M", "MM"); + } + if (pattern.indexOf("dd") < 0) { + pattern = replace(pattern, "d", "dd"); + } + return pattern; + } + + protected static String removeDateDelimiter(String pattern) { + StringBuilder sb = new StringBuilder(); + for (int i = 0; i < pattern.length(); ++i) { + char c = pattern.charAt(i); + if (c == 'y' || c == 'M' || c == 'd') { + sb.append(c); + } + } + return sb.toString(); + } + + protected static String findDateDelimiter(String value) { + for (int i = 0; i < value.length(); ++i) { + char c = value.charAt(i); + if (Character.isDigit(c)) { + continue; + } + return Character.toString(c); + } + return null; + } + + // ----------------------------------------------------- + // DecimalFormatSymbols + // -------------------- + protected static Map symbolsCache = new ConcurrentHashMap(); + + protected static DecimalFormatSymbols getDecimalFormatSymbols() { + return getDecimalFormatSymbols(Locale.getDefault()); + } + + protected static DecimalFormatSymbols getDecimalFormatSymbols(Locale locale) { + DecimalFormatSymbols symbols = (DecimalFormatSymbols) symbolsCache + .get(locale); + if (symbols == null) { + symbols = new DecimalFormatSymbols(locale); + symbolsCache.put(locale, symbols); + } + return symbols; + } + + // ----------------------------------------------------- + // String + // ------ + protected static String replace(String text, String fromText, String toText) { + if (text == null || fromText == null || toText == null) { + return null; + } + StringBuilder sb = new StringBuilder(); + int pos = 0; + int pos2 = 0; + do { + pos = text.indexOf(fromText, pos2); + if (pos == 0) { + sb.append(toText); + pos2 = fromText.length(); + } else if (pos > 0) { + sb.append(text.substring(pos2, pos)); + sb.append(toText); + pos2 = pos + fromText.length(); + } else { + sb.append(text.substring(pos2)); + return sb.toString(); + } + } while (true); + } + + protected static final String[] EMPTY_STRINGS = new String[0]; + + protected static String[] split(final String str, final String delimiter) { + if (str == null || str.trim().length() == 0) { + return EMPTY_STRINGS; + } + final List list = new ArrayList(); + final StringTokenizer st = new StringTokenizer(str, delimiter); + while (st.hasMoreElements()) { + list.add(st.nextToken()); + } + return (String[]) list.toArray(new String[list.size()]); + } + + //========================================================================== + // ========= + // Assert Helper + // ============= + /** + * Assert that the object is not null. + * + * @param variableName Variable name. (NotNull) + * @param value Value. (NotNull) + * @exception IllegalArgumentException + */ + protected static void assertObjectNotNull(String variableName, Object value) { + if (variableName == null) { + String msg = "The value should not be null: variableName=" + + variableName + " value=" + value; + throw new IllegalArgumentException(msg); + } + if (value == null) { + String msg = "The value should not be null: variableName=" + + variableName; + throw new IllegalArgumentException(msg); + } + } +} Property changes on: addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/allcommon/util/SimpleTypeUtil.java ___________________________________________________________________ Name: svn:eol-style + native Modified: addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/bsbhv/BsCompanyBhv.java =================================================================== --- addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/bsbhv/BsCompanyBhv.java 2008-12-27 22:02:56 UTC (rev 1623) +++ addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/bsbhv/BsCompanyBhv.java 2008-12-27 22:06:42 UTC (rev 1624) @@ -1,9 +1,8 @@ package jp.sf.pal.addresslist.db.bsbhv; import java.util.List; +import java.util.Map; -import jp.sf.pal.addresslist.db.allcommon.DaoReadable; -import jp.sf.pal.addresslist.db.allcommon.DaoWritable; import jp.sf.pal.addresslist.db.allcommon.Entity; import jp.sf.pal.addresslist.db.allcommon.bhv.load.LoadReferrerOption; import jp.sf.pal.addresslist.db.allcommon.bhv.setup.ConditionBeanSetupper; @@ -20,13 +19,12 @@ import jp.sf.pal.addresslist.db.cbean.CompanyCB; import jp.sf.pal.addresslist.db.cbean.PersonCB; import jp.sf.pal.addresslist.db.exbhv.PersonBhv; -import jp.sf.pal.addresslist.db.exdao.CompanyDao; import jp.sf.pal.addresslist.db.exentity.Company; import jp.sf.pal.addresslist.db.exentity.Person; import jp.sf.pal.addresslist.db.exentity.UserInfo; /** - * The behavior of COMPANY. + * The behavior of COMPANY that the type is TABLE.
* *
  * [primary-key]
@@ -71,12 +69,6 @@
 
     //==========================================================================
     // =========
-    // Attribute
-    // =========
-    protected CompanyDao _dao;
-
-    //==========================================================================
-    // =========
     // Table name
     // ==========
     /** @return The name on database of table. (NotNull) */
@@ -88,39 +80,18 @@
     // =========
     // DBMeta
     // ======
-    /** @return The meta data of the database. (NotNull) */
+    /** @return The instance of DBMeta. (NotNull) */
     public DBMeta getDBMeta() {
         return CompanyDbm.getInstance();
     }
 
-    /** @return The meta data of the database as my table type. (NotNull) */
+    /** @return The instance of DBMeta as my table type. (NotNull) */
     public CompanyDbm getMyDBMeta() {
         return CompanyDbm.getInstance();
     }
 
     //==========================================================================
     // =========
-    // Dao Accessor
-    // ============
-    public CompanyDao getMyDao() {
-        return _dao;
-    }
-
-    public void setMyDao(CompanyDao dao) {
-        assertObjectNotNull("dao", dao);
-        _dao = dao;
-    }
-
-    public DaoReadable getDaoReadable() {
-        return getMyDao();
-    }
-
-    public DaoWritable getDaoWritable() {
-        return getMyDao();
-    }
-
-    //==========================================================================
-    // =========
     // New Instance
     // ============
     public Entity newEntity() {
@@ -150,7 +121,7 @@
      * @return The selected count.
      */
     public int selectCount(CompanyCB cb) {
-        assertConditionBeanNotNull(cb);
+        assertCBNotNull(cb);
         return delegateSelectCount(cb);
     }
 
@@ -227,7 +198,7 @@
      * @return The result bean of selected list. (NotNull)
      */
     public ListResultBean selectList(CompanyCB cb) {
-        assertConditionBeanNotNull(cb);
+        assertCBNotNull(cb);
         return new ResultBeanBuilder(getTableDbName())
                 .buildListResultBean(cb, delegateSelectList(cb));
     }
@@ -243,7 +214,7 @@
      * @return The result bean of selected page. (NotNull)
      */
     public PagingResultBean selectPage(final CompanyCB cb) {
-        assertConditionBeanNotNull(cb);
+        assertCBNotNull(cb);
         final PagingInvoker invoker = new PagingInvoker(
                 getTableDbName());
         final PagingHandler handler = new PagingHandler() {
@@ -264,6 +235,32 @@
 
     //==========================================================================
     // =========
+    // Scalar Select
+    // =============
+    /**
+     * Select the scalar value derived by a function. 
Call a function + * method after this method called like as follows: + * + *
+     * companyBhv.scalarSelect(Date.class).max(new ScalarQuery(CompanyCB cb) {
+     *     cb.specify().columnXxxDatetime(); // the required specification of target column
+     *     cb.query().setXxxName_PrefixSearch("S"); // query as you like it
+     * });
+     * 
+ * + * @param The type of result. + * @param resultType The type of result. (NotNull) + * @return The scalar value derived by a function. (Nullable) + */ + public SLFunction scalarSelect( + Class resultType) { + CompanyCB cb = newMyConditionBean(); + cb.xsetupForScalarSelect(); + return new SLFunction(cb, resultType); + } + + //========================================================================== + // ========= // Various Select // ============== /** @@ -273,8 +270,8 @@ * @param valueLabelSetupper The setupper of value-label. (NotNull) * @return The list of value-label. (NotNull) */ - public List> selectValueLabelList( - CompanyCB cb, ValueLabelSetupper valueLabelSetupper) { + public List> selectValueLabelList(CompanyCB cb, + ValueLabelSetupper valueLabelSetupper) { return createValueLabelList(selectList(cb), valueLabelSetupper); } @@ -371,8 +368,8 @@ //========================================================================== // ========= - // Pullout Foreign - // =============== + // Pull out Foreign + // ================ /** * Pull out the list of foreign table 'UserInfo'. * @@ -682,11 +679,11 @@ */ public int queryUpdate(Company company, CompanyCB cb) { assertObjectNotNull("company", company); - assertConditionBeanNotNull(cb); + assertCBNotNull(cb); setupCommonColumnOfUpdateIfNeeds(company); filterEntityOfUpdate(company); assertEntityOfUpdate(company); - return getMyDao().updateByQuery(cb, company); + return invoke(createQueryUpdateEntityCBCommand(company, cb)); } /** @@ -696,8 +693,8 @@ * @return The deleted count. */ public int queryDelete(CompanyCB cb) { - assertConditionBeanNotNull(cb); - return getMyDao().deleteByQuery(cb); + assertCBNotNull(cb); + return invoke(createQueryDeleteCBCommand(cb)); } //========================================================================== @@ -709,19 +706,27 @@ // ========= // Delegate Method // =============== + // [Behavior Command] // ----------------------------------------------------- // Select // ------ protected int delegateSelectCount(CompanyCB cb) { - assertConditionBeanNotNull(cb); - return getMyDao().selectCount(cb); + return invoke(createSelectCountCBCommand(cb)); } + protected int doCallReadCount(ConditionBean cb) { + return delegateSelectCount((CompanyCB) cb); + } + protected List delegateSelectList(CompanyCB cb) { - assertConditionBeanNotNull(cb); - return getMyDao().selectList(cb); + return invoke(createSelectListCBCommand(cb, Company.class)); } + @SuppressWarnings("unchecked") + protected List doCallReadList(ConditionBean cb) { + return (List) delegateSelectList((CompanyCB) cb); + } + // ----------------------------------------------------- // Update // ------ @@ -729,62 +734,97 @@ if (!processBeforeInsert(e)) { return 1; } - return getMyDao().insert(e); + return invoke(createInsertEntityCommand(e)); } + protected int doCallCreate(Entity entity) { + return delegateInsert(downcast(entity)); + } + protected int delegateUpdate(Company e) { if (!processBeforeUpdate(e)) { return 1; } - return getMyDao().updateModifiedOnly(e); + return invoke(createUpdateEntityCommand(e)); } + protected int doCallModify(Entity entity) { + return delegateUpdate(downcast(entity)); + } + protected int delegateUpdateNonstrict(Company e) { if (!processBeforeUpdate(e)) { return 1; } - return getMyDao().updateNonstrictModifiedOnly(e); + return invoke(createUpdateNonstrictEntityCommand(e)); } protected int delegateDelete(Company e) { if (!processBeforeDelete(e)) { return 1; } - return getMyDao().delete(e); + return invoke(createDeleteEntityCommand(e)); } + protected int doCallRemove(Entity entity) { + return delegateDelete(downcast(entity)); + } + protected int delegateDeleteNonstrict(Company e) { if (!processBeforeDelete(e)) { return 1; } - return getMyDao().deleteNonstrict(e); + return invoke(createDeleteNonstrictEntityCommand(e)); } protected int[] delegateInsertList(List ls) { - assertObjectNotNull("companyList", ls); - return getMyDao().insertList(helpFilterBeforeInsertInternally(ls)); + if (ls.isEmpty()) { + return new int[] {}; + } + return invoke(createBatchInsertEntityCommand(helpFilterBeforeInsertInternally(ls))); } + @SuppressWarnings("unchecked") + protected int[] doCreateList(List ls) { + return delegateInsertList((List) ls); + } + protected int[] delegateUpdateList(List ls) { - assertObjectNotNull("companyList", ls); - return getMyDao().updateList(helpFilterBeforeUpdateInternally(ls)); + if (ls.isEmpty()) { + return new int[] {}; + } + return invoke(createBatchUpdateEntityCommand(helpFilterBeforeUpdateInternally(ls))); } + @SuppressWarnings("unchecked") + protected int[] doModifyList(List ls) { + return delegateUpdateList((List) ls); + } + protected int[] delegateUpdateListNonstrict(List ls) { - assertObjectNotNull("companyList", ls); - return getMyDao().updateListNonstrict( - helpFilterBeforeUpdateInternally(ls)); + if (ls.isEmpty()) { + return new int[] {}; + } + return invoke(createBatchUpdateNonstrictEntityCommand(helpFilterBeforeUpdateInternally(ls))); } protected int[] delegateDeleteList(List ls) { - assertObjectNotNull("companyList", ls); - return getMyDao().deleteList(helpFilterBeforeDeleteInternally(ls)); + if (ls.isEmpty()) { + return new int[] {}; + } + return invoke(createBatchDeleteEntityCommand(helpFilterBeforeDeleteInternally(ls))); } + @SuppressWarnings("unchecked") + protected int[] doRemoveList(List ls) { + return delegateDeleteList((List) ls); + } + protected int[] delegateDeleteListNonstrict(List ls) { - assertObjectNotNull("companyList", ls); - return getMyDao().deleteListNonstrict( - helpFilterBeforeDeleteInternally(ls)); + if (ls.isEmpty()) { + return new int[] {}; + } + return invoke(createBatchDeleteNonstrictEntityCommand(helpFilterBeforeDeleteInternally(ls))); } //========================================================================== Modified: addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/bsbhv/BsContactBhv.java =================================================================== --- addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/bsbhv/BsContactBhv.java 2008-12-27 22:02:56 UTC (rev 1623) +++ addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/bsbhv/BsContactBhv.java 2008-12-27 22:06:42 UTC (rev 1624) @@ -1,9 +1,8 @@ package jp.sf.pal.addresslist.db.bsbhv; import java.util.List; +import java.util.Map; -import jp.sf.pal.addresslist.db.allcommon.DaoReadable; -import jp.sf.pal.addresslist.db.allcommon.DaoWritable; import jp.sf.pal.addresslist.db.allcommon.Entity; import jp.sf.pal.addresslist.db.allcommon.bhv.setup.ValueLabelSetupper; import jp.sf.pal.addresslist.db.allcommon.cbean.ConditionBean; @@ -16,12 +15,11 @@ import jp.sf.pal.addresslist.db.allcommon.dbmeta.DBMeta; import jp.sf.pal.addresslist.db.bsentity.dbmeta.ContactDbm; import jp.sf.pal.addresslist.db.cbean.ContactCB; -import jp.sf.pal.addresslist.db.exdao.ContactDao; import jp.sf.pal.addresslist.db.exentity.Contact; import jp.sf.pal.addresslist.db.exentity.Person; /** - * The behavior of CONTACT. + * The behavior of CONTACT that the type is TABLE.
* *
  * [primary-key]
@@ -66,12 +64,6 @@
 
     //==========================================================================
     // =========
-    // Attribute
-    // =========
-    protected ContactDao _dao;
-
-    //==========================================================================
-    // =========
     // Table name
     // ==========
     /** @return The name on database of table. (NotNull) */
@@ -83,39 +75,18 @@
     // =========
     // DBMeta
     // ======
-    /** @return The meta data of the database. (NotNull) */
+    /** @return The instance of DBMeta. (NotNull) */
     public DBMeta getDBMeta() {
         return ContactDbm.getInstance();
     }
 
-    /** @return The meta data of the database as my table type. (NotNull) */
+    /** @return The instance of DBMeta as my table type. (NotNull) */
     public ContactDbm getMyDBMeta() {
         return ContactDbm.getInstance();
     }
 
     //==========================================================================
     // =========
-    // Dao Accessor
-    // ============
-    public ContactDao getMyDao() {
-        return _dao;
-    }
-
-    public void setMyDao(ContactDao dao) {
-        assertObjectNotNull("dao", dao);
-        _dao = dao;
-    }
-
-    public DaoReadable getDaoReadable() {
-        return getMyDao();
-    }
-
-    public DaoWritable getDaoWritable() {
-        return getMyDao();
-    }
-
-    //==========================================================================
-    // =========
     // New Instance
     // ============
     public Entity newEntity() {
@@ -145,7 +116,7 @@
      * @return The selected count.
      */
     public int selectCount(ContactCB cb) {
-        assertConditionBeanNotNull(cb);
+        assertCBNotNull(cb);
         return delegateSelectCount(cb);
     }
 
@@ -222,7 +193,7 @@
      * @return The result bean of selected list. (NotNull)
      */
     public ListResultBean selectList(ContactCB cb) {
-        assertConditionBeanNotNull(cb);
+        assertCBNotNull(cb);
         return new ResultBeanBuilder(getTableDbName())
                 .buildListResultBean(cb, delegateSelectList(cb));
     }
@@ -238,7 +209,7 @@
      * @return The result bean of selected page. (NotNull)
      */
     public PagingResultBean selectPage(final ContactCB cb) {
-        assertConditionBeanNotNull(cb);
+        assertCBNotNull(cb);
         final PagingInvoker invoker = new PagingInvoker(
                 getTableDbName());
         final PagingHandler handler = new PagingHandler() {
@@ -259,6 +230,32 @@
 
     //==========================================================================
     // =========
+    // Scalar Select
+    // =============
+    /**
+     * Select the scalar value derived by a function. 
Call a function + * method after this method called like as follows: + * + *
+     * contactBhv.scalarSelect(Date.class).max(new ScalarQuery(ContactCB cb) {
+     *     cb.specify().columnXxxDatetime(); // the required specification of target column
+     *     cb.query().setXxxName_PrefixSearch("S"); // query as you like it
+     * });
+     * 
+ * + * @param The type of result. + * @param resultType The type of result. (NotNull) + * @return The scalar value derived by a function. (Nullable) + */ + public SLFunction scalarSelect( + Class resultType) { + ContactCB cb = newMyConditionBean(); + cb.xsetupForScalarSelect(); + return new SLFunction(cb, resultType); + } + + //========================================================================== + // ========= // Various Select // ============== /** @@ -268,8 +265,8 @@ * @param valueLabelSetupper The setupper of value-label. (NotNull) * @return The list of value-label. (NotNull) */ - public List> selectValueLabelList( - ContactCB cb, ValueLabelSetupper valueLabelSetupper) { + public List> selectValueLabelList(ContactCB cb, + ValueLabelSetupper valueLabelSetupper) { return createValueLabelList(selectList(cb), valueLabelSetupper); } @@ -280,8 +277,8 @@ //========================================================================== // ========= - // Pullout Foreign - // =============== + // Pull out Foreign + // ================ /** * Pull out the list of foreign table 'Person'. * @@ -475,11 +472,11 @@ */ public int queryUpdate(Contact contact, ContactCB cb) { assertObjectNotNull("contact", contact); - assertConditionBeanNotNull(cb); + assertCBNotNull(cb); setupCommonColumnOfUpdateIfNeeds(contact); filterEntityOfUpdate(contact); assertEntityOfUpdate(contact); - return getMyDao().updateByQuery(cb, contact); + return invoke(createQueryUpdateEntityCBCommand(contact, cb)); } /** @@ -489,8 +486,8 @@ * @return The deleted count. */ public int queryDelete(ContactCB cb) { - assertConditionBeanNotNull(cb); - return getMyDao().deleteByQuery(cb); + assertCBNotNull(cb); + return invoke(createQueryDeleteCBCommand(cb)); } //========================================================================== @@ -502,19 +499,27 @@ // ========= // Delegate Method // =============== + // [Behavior Command] // ----------------------------------------------------- // Select // ------ protected int delegateSelectCount(ContactCB cb) { - assertConditionBeanNotNull(cb); - return getMyDao().selectCount(cb); + return invoke(createSelectCountCBCommand(cb)); } + protected int doCallReadCount(ConditionBean cb) { + return delegateSelectCount((ContactCB) cb); + } + protected List delegateSelectList(ContactCB cb) { - assertConditionBeanNotNull(cb); - return getMyDao().selectList(cb); + return invoke(createSelectListCBCommand(cb, Contact.class)); } + @SuppressWarnings("unchecked") + protected List doCallReadList(ConditionBean cb) { + return (List) delegateSelectList((ContactCB) cb); + } + // ----------------------------------------------------- // Update // ------ @@ -522,38 +527,71 @@ if (!processBeforeInsert(e)) { return 1; } - return getMyDao().insert(e); + return invoke(createInsertEntityCommand(e)); } + protected int doCallCreate(Entity entity) { + return delegateInsert(downcast(entity)); + } + protected int delegateUpdate(Contact e) { if (!processBeforeUpdate(e)) { return 1; } - return getMyDao().updateModifiedOnly(e); + return invoke(createUpdateEntityCommand(e)); } + protected int doCallModify(Entity entity) { + return delegateUpdate(downcast(entity)); + } + protected int delegateDelete(Contact e) { if (!processBeforeDelete(e)) { return 1; } - return getMyDao().delete(e); + return invoke(createDeleteEntityCommand(e)); } + protected int doCallRemove(Entity entity) { + return delegateDelete(downcast(entity)); + } + protected int[] delegateInsertList(List ls) { - assertObjectNotNull("contactList", ls); - return getMyDao().insertList(helpFilterBeforeInsertInternally(ls)); + if (ls.isEmpty()) { + return new int[] {}; + } + return invoke(createBatchInsertEntityCommand(helpFilterBeforeInsertInternally(ls))); } + @SuppressWarnings("unchecked") + protected int[] doCreateList(List ls) { + return delegateInsertList((List) ls); + } + protected int[] delegateUpdateList(List ls) { - assertObjectNotNull("contactList", ls); - return getMyDao().updateList(helpFilterBeforeUpdateInternally(ls)); + if (ls.isEmpty()) { + return new int[] {}; + } + return invoke(createBatchUpdateEntityCommand(helpFilterBeforeUpdateInternally(ls))); } + @SuppressWarnings("unchecked") + protected int[] doModifyList(List ls) { + return delegateUpdateList((List) ls); + } + protected int[] delegateDeleteList(List ls) { - assertObjectNotNull("contactList", ls); - return getMyDao().deleteList(helpFilterBeforeDeleteInternally(ls)); + if (ls.isEmpty()) { + return new int[] {}; + } + return invoke(createBatchDeleteEntityCommand(helpFilterBeforeDeleteInternally(ls))); } + @SuppressWarnings("unchecked") + protected int[] doRemoveList(List ls) { + return delegateDeleteList((List) ls); + } + //========================================================================== // ========= // Optimistic Lock Info Modified: addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/bsbhv/BsCustomBhv.java =================================================================== --- addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/bsbhv/BsCustomBhv.java 2008-12-27 22:02:56 UTC (rev 1623) +++ addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/bsbhv/BsCustomBhv.java 2008-12-27 22:06:42 UTC (rev 1624) @@ -1,9 +1,8 @@ package jp.sf.pal.addresslist.db.bsbhv; import java.util.List; +import java.util.Map; -import jp.sf.pal.addresslist.db.allcommon.DaoReadable; -import jp.sf.pal.addresslist.db.allcommon.DaoWritable; import jp.sf.pal.addresslist.db.allcommon.Entity; import jp.sf.pal.addresslist.db.allcommon.bhv.setup.ValueLabelSetupper; import jp.sf.pal.addresslist.db.allcommon.cbean.ConditionBean; @@ -16,12 +15,11 @@ import jp.sf.pal.addresslist.db.allcommon.dbmeta.DBMeta; import jp.sf.pal.addresslist.db.bsentity.dbmeta.CustomDbm; import jp.sf.pal.addresslist.db.cbean.CustomCB; -import jp.sf.pal.addresslist.db.exdao.CustomDao; import jp.sf.pal.addresslist.db.exentity.Custom; import jp.sf.pal.addresslist.db.exentity.Person; /** - * The behavior of CUSTOM. + * The behavior of CUSTOM that the type is TABLE.
* *
  * [primary-key]
@@ -66,12 +64,6 @@
 
     //==========================================================================
     // =========
-    // Attribute
-    // =========
-    protected CustomDao _dao;
-
-    //==========================================================================
-    // =========
     // Table name
     // ==========
     /** @return The name on database of table. (NotNull) */
@@ -83,39 +75,18 @@
     // =========
     // DBMeta
     // ======
-    /** @return The meta data of the database. (NotNull) */
+    /** @return The instance of DBMeta. (NotNull) */
     public DBMeta getDBMeta() {
         return CustomDbm.getInstance();
     }
 
-    /** @return The meta data of the database as my table type. (NotNull) */
+    /** @return The instance of DBMeta as my table type. (NotNull) */
     public CustomDbm getMyDBMeta() {
         return CustomDbm.getInstance();
     }
 
     //==========================================================================
     // =========
-    // Dao Accessor
-    // ============
-    public CustomDao getMyDao() {
-        return _dao;
-    }
-
-    public void setMyDao(CustomDao dao) {
-        assertObjectNotNull("dao", dao);
-        _dao = dao;
-    }
-
-    public DaoReadable getDaoReadable() {
-        return getMyDao();
-    }
-
-    public DaoWritable getDaoWritable() {
-        return getMyDao();
-    }
-
-    //==========================================================================
-    // =========
     // New Instance
     // ============
     public Entity newEntity() {
@@ -145,7 +116,7 @@
      * @return The selected count.
      */
     public int selectCount(CustomCB cb) {
-        assertConditionBeanNotNull(cb);
+        assertCBNotNull(cb);
         return delegateSelectCount(cb);
     }
 
@@ -222,7 +193,7 @@
      * @return The result bean of selected list. (NotNull)
      */
     public ListResultBean selectList(CustomCB cb) {
-        assertConditionBeanNotNull(cb);
+        assertCBNotNull(cb);
         return new ResultBeanBuilder(getTableDbName())
                 .buildListResultBean(cb, delegateSelectList(cb));
     }
@@ -238,7 +209,7 @@
      * @return The result bean of selected page. (NotNull)
      */
     public PagingResultBean selectPage(final CustomCB cb) {
-        assertConditionBeanNotNull(cb);
+        assertCBNotNull(cb);
         final PagingInvoker invoker = new PagingInvoker(
                 getTableDbName());
         final PagingHandler handler = new PagingHandler() {
@@ -259,6 +230,32 @@
 
     //==========================================================================
     // =========
+    // Scalar Select
+    // =============
+    /**
+     * Select the scalar value derived by a function. 
Call a function + * method after this method called like as follows: + * + *
+     * customBhv.scalarSelect(Date.class).max(new ScalarQuery(CustomCB cb) {
+     *     cb.specify().columnXxxDatetime(); // the required specification of target column
+     *     cb.query().setXxxName_PrefixSearch("S"); // query as you like it
+     * });
+     * 
+ * + * @param The type of result. + * @param resultType The type of result. (NotNull) + * @return The scalar value derived by a function. (Nullable) + */ + public SLFunction scalarSelect( + Class resultType) { + CustomCB cb = newMyConditionBean(); + cb.xsetupForScalarSelect(); + return new SLFunction(cb, resultType); + } + + //========================================================================== + // ========= // Various Select // ============== /** @@ -268,8 +265,8 @@ * @param valueLabelSetupper The setupper of value-label. (NotNull) * @return The list of value-label. (NotNull) */ - public List> selectValueLabelList( - CustomCB cb, ValueLabelSetupper valueLabelSetupper) { + public List> selectValueLabelList(CustomCB cb, + ValueLabelSetupper valueLabelSetupper) { return createValueLabelList(selectList(cb), valueLabelSetupper); } @@ -280,8 +277,8 @@ //========================================================================== // ========= - // Pullout Foreign - // =============== + // Pull out Foreign + // ================ /** * Pull out the list of foreign table 'Person'. * @@ -475,11 +472,11 @@ */ public int queryUpdate(Custom custom, CustomCB cb) { assertObjectNotNull("custom", custom); - assertConditionBeanNotNull(cb); + assertCBNotNull(cb); setupCommonColumnOfUpdateIfNeeds(custom); filterEntityOfUpdate(custom); assertEntityOfUpdate(custom); - return getMyDao().updateByQuery(cb, custom); + return invoke(createQueryUpdateEntityCBCommand(custom, cb)); } /** @@ -489,8 +486,8 @@ * @return The deleted count. */ public int queryDelete(CustomCB cb) { - assertConditionBeanNotNull(cb); - return getMyDao().deleteByQuery(cb); + assertCBNotNull(cb); + return invoke(createQueryDeleteCBCommand(cb)); } //========================================================================== @@ -502,19 +499,27 @@ // ========= // Delegate Method // =============== + // [Behavior Command] // ----------------------------------------------------- // Select // ------ protected int delegateSelectCount(CustomCB cb) { - assertConditionBeanNotNull(cb); - return getMyDao().selectCount(cb); + return invoke(createSelectCountCBCommand(cb)); } + protected int doCallReadCount(ConditionBean cb) { + return delegateSelectCount((CustomCB) cb); + } + protected List delegateSelectList(CustomCB cb) { - assertConditionBeanNotNull(cb); - return getMyDao().selectList(cb); + return invoke(createSelectListCBCommand(cb, Custom.class)); } + @SuppressWarnings("unchecked") + protected List doCallReadList(ConditionBean cb) { + return (List) delegateSelectList((CustomCB) cb); + } + // ----------------------------------------------------- // Update // ------ @@ -522,38 +527,71 @@ if (!processBeforeInsert(e)) { return 1; } - return getMyDao().insert(e); + return invoke(createInsertEntityCommand(e)); } + protected int doCallCreate(Entity entity) { + return delegateInsert(downcast(entity)); + } + protected int delegateUpdate(Custom e) { if (!processBeforeUpdate(e)) { return 1; } - return getMyDao().updateModifiedOnly(e); + return invoke(createUpdateEntityCommand(e)); } + protected int doCallModify(Entity entity) { + return delegateUpdate(downcast(entity)); + } + protected int delegateDelete(Custom e) { if (!processBeforeDelete(e)) { return 1; } - return getMyDao().delete(e); + return invoke(createDeleteEntityCommand(e)); } + protected int doCallRemove(Entity entity) { + return delegateDelete(downcast(entity)); + } + protected int[] delegateInsertList(List ls) { - assertObjectNotNull("customList", ls); - return getMyDao().insertList(helpFilterBeforeInsertInternally(ls)); + if (ls.isEmpty()) { + return new int[] {}; + } + return invoke(createBatchInsertEntityCommand(helpFilterBeforeInsertInternally(ls))); } + @SuppressWarnings("unchecked") + protected int[] doCreateList(List ls) { + return delegateInsertList((List) ls); + } + protected int[] delegateUpdateList(List ls) { - assertObjectNotNull("customList", ls); - return getMyDao().updateList(helpFilterBeforeUpdateInternally(ls)); + if (ls.isEmpty()) { + return new int[] {}; + } + return invoke(createBatchUpdateEntityCommand(helpFilterBeforeUpdateInternally(ls))); } + @SuppressWarnings("unchecked") + protected int[] doModifyList(List ls) { + return delegateUpdateList((List) ls); + } + protected int[] delegateDeleteList(List ls) { - assertObjectNotNull("customList", ls); - return getMyDao().deleteList(helpFilterBeforeDeleteInternally(ls)); + if (ls.isEmpty()) { + return new int[] {}; + } + return invoke(createBatchDeleteEntityCommand(helpFilterBeforeDeleteInternally(ls))); } + @SuppressWarnings("unchecked") + protected int[] doRemoveList(List ls) { + return delegateDeleteList((List) ls); + } + //========================================================================== // ========= // Optimistic Lock Info Modified: addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/bsbhv/BsGroupInfoBhv.java =================================================================== --- addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/bsbhv/BsGroupInfoBhv.java 2008-12-27 22:02:56 UTC (rev 1623) +++ addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/bsbhv/BsGroupInfoBhv.java 2008-12-27 22:06:42 UTC (rev 1624) @@ -1,9 +1,8 @@ package jp.sf.pal.addresslist.db.bsbhv; import java.util.List; +import java.util.Map; -import jp.sf.pal.addresslist.db.allcommon.DaoReadable; -import jp.sf.pal.addresslist.db.allcommon.DaoWritable; import jp.sf.pal.addresslist.db.allcommon.Entity; import jp.sf.pal.addresslist.db.allcommon.bhv.load.LoadReferrerOption; import jp.sf.pal.addresslist.db.allcommon.bhv.setup.ConditionBeanSetupper; @@ -22,13 +21,12 @@ import jp.sf.pal.addresslist.db.cbean.UserInfoCB; import jp.sf.pal.addresslist.db.exbhv.GroupMappingBhv; import jp.sf.pal.addresslist.db.exbhv.UserInfoBhv; -import jp.sf.pal.addresslist.db.exdao.GroupInfoDao; import jp.sf.pal.addresslist.db.exentity.GroupInfo; import jp.sf.pal.addresslist.db.exentity.GroupMapping; import jp.sf.pal.addresslist.db.exentity.UserInfo; /** - * The behavior of GROUP_INFO. + * The behavior of GROUP_INFO that the type is TABLE.
* *
  * [primary-key]
@@ -73,12 +71,6 @@
 
     //==========================================================================
     // =========
-    // Attribute
-    // =========
-    protected GroupInfoDao _dao;
-
-    //==========================================================================
-    // =========
     // Table name
     // ==========
     /** @return The name on database of table. (NotNull) */
@@ -90,39 +82,18 @@
     // =========
     // DBMeta
     // ======
-    /** @return The meta data of the database. (NotNull) */
+    /** @return The instance of DBMeta. (NotNull) */
     public DBMeta getDBMeta() {
         return GroupInfoDbm.getInstance();
     }
 
-    /** @return The meta data of the database as my table type. (NotNull) */
+    /** @return The instance of DBMeta as my table type. (NotNull) */
     public GroupInfoDbm getMyDBMeta() {
         return GroupInfoDbm.getInstance();
     }
 
     //==========================================================================
     // =========
-    // Dao Accessor
-    // ============
-    public GroupInfoDao getMyDao() {
-        return _dao;
-    }
-
-    public void setMyDao(GroupInfoDao dao) {
-        assertObjectNotNull("dao", dao);
-        _dao = dao;
-    }
-
-    public DaoReadable getDaoReadable() {
-        return getMyDao();
-    }
-
-    public DaoWritable getDaoWritable() {
-        return getMyDao();
-    }
-
-    //==========================================================================
-    // =========
     // New Instance
     // ============
     public Entity newEntity() {
@@ -152,7 +123,7 @@
      * @return The selected count.
      */
     public int selectCount(GroupInfoCB cb) {
-        assertConditionBeanNotNull(cb);
+        assertCBNotNull(cb);
         return delegateSelectCount(cb);
     }
 
@@ -229,7 +200,7 @@
      * @return The result bean of selected list. (NotNull)
      */
     public ListResultBean selectList(GroupInfoCB cb) {
-        assertConditionBeanNotNull(cb);
+        assertCBNotNull(cb);
         return new ResultBeanBuilder(getTableDbName())
                 .buildListResultBean(cb, delegateSelectList(cb));
     }
@@ -245,7 +216,7 @@
      * @return The result bean of selected page. (NotNull)
      */
     public PagingResultBean selectPage(final GroupInfoCB cb) {
-        assertConditionBeanNotNull(cb);
+        assertCBNotNull(cb);
         final PagingInvoker invoker = new PagingInvoker(
                 getTableDbName());
         final PagingHandler handler = new PagingHandler() {
@@ -266,6 +237,32 @@
 
     //==========================================================================
     // =========
+    // Scalar Select
+    // =============
+    /**
+     * Select the scalar value derived by a function. 
Call a function + * method after this method called like as follows: + * + *
+     * groupInfoBhv.scalarSelect(Date.class).max(new ScalarQuery(GroupInfoCB cb) {
+     *     cb.specify().columnXxxDatetime(); // the required specification of target column
+     *     cb.query().setXxxName_PrefixSearch("S"); // query as you like it
+     * });
+     * 
+ * + * @param The type of result. + * @param resultType The type of result. (NotNull) + * @return The scalar value derived by a function. (Nullable) + */ + public SLFunction scalarSelect( + Class resultType) { + GroupInfoCB cb = newMyConditionBean(); + cb.xsetupForScalarSelect(); + return new SLFunction(cb, resultType); + } + + //========================================================================== + // ========= // Various Select // ============== /** @@ -275,8 +272,8 @@ * @param valueLabelSetupper The setupper of value-label. (NotNull) * @return The list of value-label. (NotNull) */ - public List> selectValueLabelList( - GroupInfoCB cb, ValueLabelSetupper valueLabelSetupper) { + public List> selectValueLabelList(GroupInfoCB cb, + ValueLabelSetupper valueLabelSetupper) { return createValueLabelList(selectList(cb), valueLabelSetupper); } @@ -467,8 +464,8 @@ //========================================================================== // ========= - // Pullout Foreign - // =============== + // Pull out Foreign + // ================ //========================================================================== // ========= @@ -766,11 +763,11 @@ */ public int queryUpdate(GroupInfo groupInfo, GroupInfoCB cb) { assertObjectNotNull("groupInfo", groupInfo); - assertConditionBeanNotNull(cb); + assertCBNotNull(cb); setupCommonColumnOfUpdateIfNeeds(groupInfo); filterEntityOfUpdate(groupInfo); assertEntityOfUpdate(groupInfo); - return getMyDao().updateByQuery(cb, groupInfo); + return invoke(createQueryUpdateEntityCBCommand(groupInfo, cb)); } /** @@ -780,8 +777,8 @@ * @return The deleted count. */ public int queryDelete(GroupInfoCB cb) { - assertConditionBeanNotNull(cb); - return getMyDao().deleteByQuery(cb); + assertCBNotNull(cb); + return invoke(createQueryDeleteCBCommand(cb)); } //========================================================================== @@ -793,19 +790,27 @@ // ========= // Delegate Method // =============== + // [Behavior Command] // ----------------------------------------------------- // Select // ------ protected int delegateSelectCount(GroupInfoCB cb) { - assertConditionBeanNotNull(cb); - return getMyDao().selectCount(cb); + return invoke(createSelectCountCBCommand(cb)); } + protected int doCallReadCount(ConditionBean cb) { + return delegateSelectCount((GroupInfoCB) cb); + } + protected List delegateSelectList(GroupInfoCB cb) { - assertConditionBeanNotNull(cb); - return getMyDao().selectList(cb); + return invoke(createSelectListCBCommand(cb, GroupInfo.class)); } + @SuppressWarnings("unchecked") + protected List doCallReadList(ConditionBean cb) { + return (List) delegateSelectList((GroupInfoCB) cb); + } + // ----------------------------------------------------- // Update // ------ @@ -813,62 +818,97 @@ if (!processBeforeInsert(e)) { return 1; } - return getMyDao().insert(e); + return invoke(createInsertEntityCommand(e)); } + protected int doCallCreate(Entity entity) { + return delegateInsert(downcast(entity)); + } + protected int delegateUpdate(GroupInfo e) { if (!processBeforeUpdate(e)) { return 1; } - return getMyDao().updateModifiedOnly(e); + return invoke(createUpdateEntityCommand(e)); } + protected int doCallModify(Entity entity) { + return delegateUpdate(downcast(entity)); + } + protected int delegateUpdateNonstrict(GroupInfo e) { if (!processBeforeUpdate(e)) { return 1; } - return getMyDao().updateNonstrictModifiedOnly(e); + return invoke(createUpdateNonstrictEntityCommand(e)); } protected int delegateDelete(GroupInfo e) { if (!processBeforeDelete(e)) { return 1; } - return getMyDao().delete(e); + return invoke(createDeleteEntityCommand(e)); } + protected int doCallRemove(Entity entity) { + return delegateDelete(downcast(entity)); + } + protected int delegateDeleteNonstrict(GroupInfo e) { if (!processBeforeDelete(e)) { return 1; } - return getMyDao().deleteNonstrict(e); + return invoke(createDeleteNonstrictEntityCommand(e)); } protected int[] delegateInsertList(List ls) { - assertObjectNotNull("groupInfoList", ls); - return getMyDao().insertList(helpFilterBeforeInsertInternally(ls)); + if (ls.isEmpty()) { + return new int[] {}; + } + return invoke(createBatchInsertEntityCommand(helpFilterBeforeInsertInternally(ls))); } + @SuppressWarnings("unchecked") + protected int[] doCreateList(List ls) { + return delegateInsertList((List) ls); + } + protected int[] delegateUpdateList(List ls) { - assertObjectNotNull("groupInfoList", ls); - return getMyDao().updateList(helpFilterBeforeUpdateInternally(ls)); + if (ls.isEmpty()) { + return new int[] {}; + } + return invoke(createBatchUpdateEntityCommand(helpFilterBeforeUpdateInternally(ls))); } + @SuppressWarnings("unchecked") + protected int[] doModifyList(List ls) { + return delegateUpdateList((List) ls); + } + protected int[] delegateUpdateListNonstrict(List ls) { - assertObjectNotNull("groupInfoList", ls); - return getMyDao().updateListNonstrict( - helpFilterBeforeUpdateInternally(ls)); + if (ls.isEmpty()) { + return new int[] {}; + } + return invoke(createBatchUpdateNonstrictEntityCommand(helpFilterBeforeUpdateInternally(ls))); } protected int[] delegateDeleteList(List ls) { - assertObjectNotNull("groupInfoList", ls); - return getMyDao().deleteList(helpFilterBeforeDeleteInternally(ls)); + if (ls.isEmpty()) { + return new int[] {}; + } + return invoke(createBatchDeleteEntityCommand(helpFilterBeforeDeleteInternally(ls))); } + @SuppressWarnings("unchecked") + protected int[] doRemoveList(List ls) { + return delegateDeleteList((List) ls); + } + protected int[] delegateDeleteListNonstrict(List ls) { - assertObjectNotNull("groupInfoList", ls); - return getMyDao().deleteListNonstrict( - helpFilterBeforeDeleteInternally(ls)); + if (ls.isEmpty()) { + return new int[] {}; + } + return invoke(createBatchDeleteNonstrictEntityCommand(helpFilterBeforeDeleteInternally(ls))); } //========================================================================== Modified: addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/bsbhv/BsGroupMappingBhv.java =================================================================== --- addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/bsbhv/BsGroupMappingBhv.java 2008-12-27 22:02:56 UTC (rev 1623) +++ addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/bsbhv/BsGroupMappingBhv.java 2008-12-27 22:06:42 UTC (rev 1624) @@ -1,9 +1,8 @@ package jp.sf.pal.addresslist.db.bsbhv; import java.util.List; +import java.util.Map; -import jp.sf.pal.addresslist.db.allcommon.DaoReadable; -import jp.sf.pal.addresslist.db.allcommon.DaoWritable; import jp.sf.pal.addresslist.db.allcommon.Entity; import jp.sf.pal.addresslist.db.allcommon.bhv.setup.ValueLabelSetupper; import jp.sf.pal.addresslist.db.allcommon.cbean.ConditionBean; @@ -16,13 +15,12 @@ import jp.sf.pal.addresslist.db.allcommon.dbmeta.DBMeta; import jp.sf.pal.addresslist.db.bsentity.dbmeta.GroupMappingDbm; import jp.sf.pal.addresslist.db.cbean.GroupMappingCB; -import jp.sf.pal.addresslist.db.exdao.GroupMappingDao; import jp.sf.pal.addresslist.db.exentity.GroupInfo; import jp.sf.pal.addresslist.db.exentity.GroupMapping; import jp.sf.pal.addresslist.db.exentity.UserInfo; /** - * The behavior of GROUP_MAPPING. + * The behavior of GROUP_MAPPING that the type is TABLE.
* *
  * [primary-key]
@@ -67,12 +65,6 @@
 
     //==========================================================================
     // =========
-    // Attribute
-    // =========
-    protected GroupMappingDao _dao;
-
-    //==========================================================================
-    // =========
     // Table name
     // ==========
     /** @return The name on database of table. (NotNull) */
@@ -84,39 +76,18 @@
     // =========
     // DBMeta
     // ======
-    /** @return The meta data of the database. (NotNull) */
+    /** @return The instance of DBMeta. (NotNull) */
     public DBMeta getDBMeta() {
         return GroupMappingDbm.getInstance();
     }
 
-    /** @return The meta data of the database as my table type. (NotNull) */
+    /** @return The instance of DBMeta as my table type. (NotNull) */
     public GroupMappingDbm getMyDBMeta() {
         return GroupMappingDbm.getInstance();
     }
 
     //==========================================================================
     // =========
-    // Dao Accessor
-    // ============
-    public GroupMappingDao getMyDao() {
-        return _dao;
-    }
-
-    public void setMyDao(GroupMappingDao dao) {
-        assertObjectNotNull("dao", dao);
-        _dao = dao;
-    }
-
-    public DaoReadable getDaoReadable() {
-        return getMyDao();
-    }
-
-    public DaoWritable getDaoWritable() {
-        return getMyDao();
-    }
-
-    //==========================================================================
-    // =========
     // New Instance
     // ============
     public Entity newEntity() {
@@ -146,7 +117,7 @@
      * @return The selected count.
      */
     public int selectCount(GroupMappingCB cb) {
-        assertConditionBeanNotNull(cb);
+        assertCBNotNull(cb);
         return delegateSelectCount(cb);
     }
 
@@ -226,7 +197,7 @@
      * @return The result bean of selected list. (NotNull)
      */
     public ListResultBean selectList(GroupMappingCB cb) {
-        assertConditionBeanNotNull(cb);
+        assertCBNotNull(cb);
         return new ResultBeanBuilder(getTableDbName())
                 .buildListResultBean(cb, delegateSelectList(cb));
     }
@@ -242,7 +213,7 @@
      * @return The result bean of selected page. (NotNull)
      */
     public PagingResultBean selectPage(final GroupMappingCB cb) {
-        assertConditionBeanNotNull(cb);
+        assertCBNotNull(cb);
         final PagingInvoker invoker = new PagingInvoker(
                 getTableDbName());
         final PagingHandler handler = new PagingHandler() {
@@ -263,6 +234,32 @@
 
     //==========================================================================
     // =========
+    // Scalar Select
+    // =============
+    /**
+     * Select the scalar value derived by a function. 
Call a function + * method after this method called like as follows: + * + *
+     * groupMappingBhv.scalarSelect(Date.class).max(new ScalarQuery(GroupMappingCB cb) {
+     *     cb.specify().columnXxxDatetime(); // the required specification of target column
+     *     cb.query().setXxxName_PrefixSearch("S"); // query as you like it
+     * });
+     * 
+ * + * @param The type of result. + * @param resultType The type of result. (NotNull) + * @return The scalar value derived by a function. (Nullable) + */ + public SLFunction scalarSelect( + Class resultType) { + GroupMappingCB cb = newMyConditionBean(); + cb.xsetupForScalarSelect(); + return new SLFunction(cb, resultType); + } + + //========================================================================== + // ========= // Various Select // ============== /** @@ -272,8 +269,7 @@ * @param valueLabelSetupper The setupper of value-label. (NotNull) * @return The list of value-label. (NotNull) */ - public List> selectValueLabelList( - GroupMappingCB cb, + public List> selectValueLabelList(GroupMappingCB cb, ValueLabelSetupper valueLabelSetupper) { return createValueLabelList(selectList(cb), valueLabelSetupper); } @@ -285,8 +281,8 @@ //========================================================================== // ========= - // Pullout Foreign - // =============== + // Pull out Foreign + // ================ /** * Pull out the list of foreign table 'GroupInfo'. * @@ -499,11 +495,11 @@ */ public int queryUpdate(GroupMapping groupMapping, GroupMappingCB cb) { assertObjectNotNull("groupMapping", groupMapping); - assertConditionBeanNotNull(cb); + assertCBNotNull(cb); setupCommonColumnOfUpdateIfNeeds(groupMapping); filterEntityOfUpdate(groupMapping); assertEntityOfUpdate(groupMapping); - return getMyDao().updateByQuery(cb, groupMapping); + return invoke(createQueryUpdateEntityCBCommand(groupMapping, cb)); } /** @@ -513,8 +509,8 @@ * @return The deleted count. */ public int queryDelete(GroupMappingCB cb) { - assertConditionBeanNotNull(cb); - return getMyDao().deleteByQuery(cb); + assertCBNotNull(cb); + return invoke(createQueryDeleteCBCommand(cb)); } //========================================================================== @@ -526,19 +522,27 @@ // ========= // Delegate Method // =============== + // [Behavior Command] // ----------------------------------------------------- // Select // ------ protected int delegateSelectCount(GroupMappingCB cb) { - assertConditionBeanNotNull(cb); - return getMyDao().selectCount(cb); + return invoke(createSelectCountCBCommand(cb)); } + protected int doCallReadCount(ConditionBean cb) { + return delegateSelectCount((GroupMappingCB) cb); + } + protected List delegateSelectList(GroupMappingCB cb) { - assertConditionBeanNotNull(cb); - return getMyDao().selectList(cb); + return invoke(createSelectListCBCommand(cb, GroupMapping.class)); } + @SuppressWarnings("unchecked") + protected List doCallReadList(ConditionBean cb) { + return (List) delegateSelectList((GroupMappingCB) cb); + } + // ----------------------------------------------------- // Update // ------ @@ -546,38 +550,71 @@ if (!processBeforeInsert(e)) { return 1; } - return getMyDao().insert(e); + return invoke(createInsertEntityCommand(e)); } + protected int doCallCreate(Entity entity) { + return delegateInsert(downcast(entity)); + } + protected int delegateUpdate(GroupMapping e) { if (!processBeforeUpdate(e)) { return 1; } - return getMyDao().updateModifiedOnly(e); + return invoke(createUpdateEntityCommand(e)); } + protected int doCallModify(Entity entity) { + return delegateUpdate(downcast(entity)); + } + protected int delegateDelete(GroupMapping e) { if (!processBeforeDelete(e)) { return 1; } - return getMyDao().delete(e); + return invoke(createDeleteEntityCommand(e)); } + protected int doCallRemove(Entity entity) { + return delegateDelete(downcast(entity)); + } + protected int[] delegateInsertList(List ls) { - assertObjectNotNull("groupMappingList", ls); - return getMyDao().insertList(helpFilterBeforeInsertInternally(ls)); + if (ls.isEmpty()) { + return new int[] {}; + } + return invoke(createBatchInsertEntityCommand(helpFilterBeforeInsertInternally(ls))); } + @SuppressWarnings("unchecked") + protected int[] doCreateList(List ls) { + return delegateInsertList((List) ls); + } + protected int[] delegateUpdateList(List ls) { - assertObjectNotNull("groupMappingList", ls); - return getMyDao().updateList(helpFilterBeforeUpdateInternally(ls)); + if (ls.isEmpty()) { + return new int[] {}; + } + return invoke(createBatchUpdateEntityCommand(helpFilterBeforeUpdateInternally(ls))); } + @SuppressWarnings("unchecked") + protected int[] doModifyList(List ls) { + return delegateUpdateList((List) ls); + } + protected int[] delegateDeleteList(List ls) { - assertObjectNotNull("groupMappingList", ls); - return getMyDao().deleteList(helpFilterBeforeDeleteInternally(ls)); + if (ls.isEmpty()) { + return new int[] {}; + } + return invoke(createBatchDeleteEntityCommand(helpFilterBeforeDeleteInternally(ls))); } + @SuppressWarnings("unchecked") + protected int[] doRemoveList(List ls) { + return delegateDeleteList((List) ls); + } + //========================================================================== // ========= // Optimistic Lock Info Modified: addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/bsbhv/BsPersonBhv.java =================================================================== --- addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/bsbhv/BsPersonBhv.java 2008-12-27 22:02:56 UTC (rev 1623) +++ addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/bsbhv/BsPersonBhv.java 2008-12-27 22:06:42 UTC (rev 1624) @@ -1,9 +1,8 @@ package jp.sf.pal.addresslist.db.bsbhv; import java.util.List; +import java.util.Map; -import jp.sf.pal.addresslist.db.allcommon.DaoReadable; -import jp.sf.pal.addresslist.db.allcommon.DaoWritable; import jp.sf.pal.addresslist.db.allcommon.Entity; import jp.sf.pal.addresslist.db.allcommon.bhv.load.LoadReferrerOption; import jp.sf.pal.addresslist.db.allcommon.bhv.setup.ConditionBeanSetupper; @@ -22,7 +21,6 @@ import jp.sf.pal.addresslist.db.cbean.PersonCB; import jp.sf.pal.addresslist.db.exbhv.ContactBhv; import jp.sf.pal.addresslist.db.exbhv.CustomBhv; -import jp.sf.pal.addresslist.db.exdao.PersonDao; import jp.sf.pal.addresslist.db.exentity.Company; import jp.sf.pal.addresslist.db.exentity.Contact; import jp.sf.pal.addresslist.db.exentity.Custom; @@ -31,7 +29,7 @@ import jp.sf.pal.addresslist.db.exentity.UserInfo; /** - * The behavior of PERSON. + * The behavior of PERSON that the type is TABLE.
* *
  * [primary-key]
@@ -76,12 +74,6 @@
 
     //==========================================================================
     // =========
-    // Attribute
-    // =========
-    protected PersonDao _dao;
-
-    //==========================================================================
-    // =========
     // Table name
     // ==========
     /** @return The name on database of table. (NotNull) */
@@ -93,39 +85,18 @@
     // =========
     // DBMeta
     // ======
-    /** @return The meta data of the database. (NotNull) */
+    /** @return The instance of DBMeta. (NotNull) */
     public DBMeta getDBMeta() {
         return PersonDbm.getInstance();
     }
 
-    /** @return The meta data of the database as my table type. (NotNull) */
+    /** @return The instance of DBMeta as my table type. (NotNull) */
     public PersonDbm getMyDBMeta() {
         return PersonDbm.getInstance();
     }
 
     //==========================================================================
     // =========
-    // Dao Accessor
-    // ============
-    public PersonDao getMyDao() {
-        return _dao;
-    }
-
-    public void setMyDao(PersonDao dao) {
-        assertObjectNotNull("dao", dao);
-        _dao = dao;
-    }
-
-    public DaoReadable getDaoReadable() {
-        return getMyDao();
-    }
-
-    public DaoWritable getDaoWritable() {
-        return getMyDao();
-    }
-
-    //==========================================================================
-    // =========
     // New Instance
     // ============
     public Entity newEntity() {
@@ -155,7 +126,7 @@
      * @return The selected count.
      */
     public int selectCount(PersonCB cb) {
-        assertConditionBeanNotNull(cb);
+        assertCBNotNull(cb);
         return delegateSelectCount(cb);
     }
 
@@ -232,7 +203,7 @@
      * @return The result bean of selected list. (NotNull)
      */
     public ListResultBean selectList(PersonCB cb) {
-        assertConditionBeanNotNull(cb);
+        assertCBNotNull(cb);
         return new ResultBeanBuilder(getTableDbName())
                 .buildListResultBean(cb, delegateSelectList(cb));
     }
@@ -248,7 +219,7 @@
      * @return The result bean of selected page. (NotNull)
      */
     public PagingResultBean selectPage(final PersonCB cb) {
-        assertConditionBeanNotNull(cb);
+        assertCBNotNull(cb);
         final PagingInvoker invoker = new PagingInvoker(
                 getTableDbName());
         final PagingHandler handler = new PagingHandler() {
@@ -269,6 +240,32 @@
 
     //==========================================================================
     // =========
+    // Scalar Select
+    // =============
+    /**
+     * Select the scalar value derived by a function. 
Call a function + * method after this method called like as follows: + * + *
+     * personBhv.scalarSelect(Date.class).max(new ScalarQuery(PersonCB cb) {
+     *     cb.specify().columnXxxDatetime(); // the required specification of target column
+     *     cb.query().setXxxName_PrefixSearch("S"); // query as you like it
+     * });
+     * 
+ * + * @param The type of result. + * @param resultType The type of result. (NotNull) + * @return The scalar value derived by a function. (Nullable) + */ + public SLFunction scalarSelect( + Class resultType) { + PersonCB cb = newMyConditionBean(); + cb.xsetupForScalarSelect(); + return new SLFunction(cb, resultType); + } + + //========================================================================== + // ========= // Various Select // ============== /** @@ -278,8 +275,8 @@ * @param valueLabelSetupper The setupper of value-label. (NotNull) * @return The list of value-label. (NotNull) */ - public List> selectValueLabelList( - PersonCB cb, ValueLabelSetupper valueLabelSetupper) { + public List> selectValueLabelList(PersonCB cb, + ValueLabelSetupper valueLabelSetupper) { return createValueLabelList(selectList(cb), valueLabelSetupper); } @@ -464,8 +461,8 @@ //========================================================================== // ========= - // Pullout Foreign - // =============== + // Pull out Foreign + // ================ /** * Pull out the list of foreign table 'Company'. * @@ -804,11 +801,11 @@ */ public int queryUpdate(Person person, PersonCB cb) { assertObjectNotNull("person", person); - assertConditionBeanNotNull(cb); + assertCBNotNull(cb); setupCommonColumnOfUpdateIfNeeds(person); filterEntityOfUpdate(person); assertEntityOfUpdate(person); - return getMyDao().updateByQuery(cb, person); + return invoke(createQueryUpdateEntityCBCommand(person, cb)); } /** @@ -818,8 +815,8 @@ * @return The deleted count. */ public int queryDelete(PersonCB cb) { - assertConditionBeanNotNull(cb); - return getMyDao().deleteByQuery(cb); + assertCBNotNull(cb); + return invoke(createQueryDeleteCBCommand(cb)); } //========================================================================== @@ -831,19 +828,27 @@ // ========= // Delegate Method // =============== + // [Behavior Command] // ----------------------------------------------------- // Select // ------ protected int delegateSelectCount(PersonCB cb) { - assertConditionBeanNotNull(cb); - return getMyDao().selectCount(cb); + return invoke(createSelectCountCBCommand(cb)); } + protected int doCallReadCount(ConditionBean cb) { + return delegateSelectCount((PersonCB) cb); + } + protected List delegateSelectList(PersonCB cb) { - assertConditionBeanNotNull(cb); - return getMyDao().selectList(cb); + return invoke(createSelectListCBCommand(cb, Person.class)); } + @SuppressWarnings("unchecked") + protected List doCallReadList(ConditionBean cb) { + return (List) delegateSelectList((PersonCB) cb); + } + // ----------------------------------------------------- // Update // ------ @@ -851,62 +856,97 @@ if (!processBeforeInsert(e)) { return 1; } - return getMyDao().insert(e); + return invoke(createInsertEntityCommand(e)); } + protected int doCallCreate(Entity entity) { + return delegateInsert(downcast(entity)); + } + protected int delegateUpdate(Person e) { if (!processBeforeUpdate(e)) { return 1; } - return getMyDao().updateModifiedOnly(e); + return invoke(createUpdateEntityCommand(e)); } + protected int doCallModify(Entity entity) { + return delegateUpdate(downcast(entity)); + } + protected int delegateUpdateNonstrict(Person e) { if (!processBeforeUpdate(e)) { return 1; } - return getMyDao().updateNonstrictModifiedOnly(e); + return invoke(createUpdateNonstrictEntityCommand(e)); } protected int delegateDelete(Person e) { if (!processBeforeDelete(e)) { return 1; } - return getMyDao().delete(e); + return invoke(createDeleteEntityCommand(e)); } + protected int doCallRemove(Entity entity) { + return delegateDelete(downcast(entity)); + } + protected int delegateDeleteNonstrict(Person e) { if (!processBeforeDelete(e)) { return 1; } - return getMyDao().deleteNonstrict(e); + return invoke(createDeleteNonstrictEntityCommand(e)); } protected int[] delegateInsertList(List ls) { - assertObjectNotNull("personList", ls); - return getMyDao().insertList(helpFilterBeforeInsertInternally(ls)); + if (ls.isEmpty()) { + return new int[] {}; + } + return invoke(createBatchInsertEntityCommand(helpFilterBeforeInsertInternally(ls))); } + @SuppressWarnings("unchecked") + protected int[] doCreateList(List ls) { + return delegateInsertList((List) ls); + } + protected int[] delegateUpdateList(List ls) { - assertObjectNotNull("personList", ls); - return getMyDao().updateList(helpFilterBeforeUpdateInternally(ls)); + if (ls.isEmpty()) { + return new int[] {}; + } + return invoke(createBatchUpdateEntityCommand(helpFilterBeforeUpdateInternally(ls))); } + @SuppressWarnings("unchecked") + protected int[] doModifyList(List ls) { + return delegateUpdateList((List) ls); + } + protected int[] delegateUpdateListNonstrict(List ls) { - assertObjectNotNull("personList", ls); - return getMyDao().updateListNonstrict( - helpFilterBeforeUpdateInternally(ls)); + if (ls.isEmpty()) { + return new int[] {}; + } + return invoke(createBatchUpdateNonstrictEntityCommand(helpFilterBeforeUpdateInternally(ls))); } protected int[] delegateDeleteList(List ls) { - assertObjectNotNull("personList", ls); - return getMyDao().deleteList(helpFilterBeforeDeleteInternally(ls)); + if (ls.isEmpty()) { + return new int[] {}; + } + return invoke(createBatchDeleteEntityCommand(helpFilterBeforeDeleteInternally(ls))); } + @SuppressWarnings("unchecked") + protected int[] doRemoveList(List ls) { + return delegateDeleteList((List) ls); + } + protected int[] delegateDeleteListNonstrict(List ls) { - assertObjectNotNull("personList", ls); - return getMyDao().deleteListNonstrict( - helpFilterBeforeDeleteInternally(ls)); + if (ls.isEmpty()) { + return new int[] {}; + } + return invoke(createBatchDeleteNonstrictEntityCommand(helpFilterBeforeDeleteInternally(ls))); } //========================================================================== Modified: addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/bsbhv/BsPostalBhv.java =================================================================== --- addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/bsbhv/BsPostalBhv.java 2008-12-27 22:02:56 UTC (rev 1623) +++ addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/bsbhv/BsPostalBhv.java 2008-12-27 22:06:42 UTC (rev 1624) @@ -1,9 +1,8 @@ package jp.sf.pal.addresslist.db.bsbhv; import java.util.List; +import java.util.Map; -import jp.sf.pal.addresslist.db.allcommon.DaoReadable; -import jp.sf.pal.addresslist.db.allcommon.DaoWritable; import jp.sf.pal.addresslist.db.allcommon.Entity; import jp.sf.pal.addresslist.db.allcommon.bhv.setup.ValueLabelSetupper; import jp.sf.pal.addresslist.db.allcommon.cbean.ConditionBean; @@ -16,12 +15,11 @@ import jp.sf.pal.addresslist.db.allcommon.dbmeta.DBMeta; import jp.sf.pal.addresslist.db.bsentity.dbmeta.PostalDbm; import jp.sf.pal.addresslist.db.cbean.PostalCB; -import jp.sf.pal.addresslist.db.exdao.PostalDao; import jp.sf.pal.addresslist.db.exentity.Person; import jp.sf.pal.addresslist.db.exentity.Postal; /** - * The behavior of POSTAL. + * The behavior of POSTAL that the type is TABLE.
* *
  * [primary-key]
@@ -66,12 +64,6 @@
 
     //==========================================================================
     // =========
-    // Attribute
-    // =========
-    protected PostalDao _dao;
-
-    //==========================================================================
-    // =========
     // Table name
     // ==========
     /** @return The name on database of table. (NotNull) */
@@ -83,39 +75,18 @@
     // =========
     // DBMeta
     // ======
-    /** @return The meta data of the database. (NotNull) */
+    /** @return The instance of DBMeta. (NotNull) */
     public DBMeta getDBMeta() {
         return PostalDbm.getInstance();
     }
 
-    /** @return The meta data of the database as my table type. (NotNull) */
+    /** @return The instance of DBMeta as my table type. (NotNull) */
     public PostalDbm getMyDBMeta() {
         return PostalDbm.getInstance();
     }
 
     //==========================================================================
     // =========
-    // Dao Accessor
-    // ============
-    public PostalDao getMyDao() {
-        return _dao;
-    }
-
-    public void setMyDao(PostalDao dao) {
-        assertObjectNotNull("dao", dao);
-        _dao = dao;
-    }
-
-    public DaoReadable getDaoReadable() {
-        return getMyDao();
-    }
-
-    public DaoWritable getDaoWritable() {
-        return getMyDao();
-    }
-
-    //==========================================================================
-    // =========
     // New Instance
     // ============
     public Entity newEntity() {
@@ -145,7 +116,7 @@
      * @return The selected count.
      */
     public int selectCount(PostalCB cb) {
-        assertConditionBeanNotNull(cb);
+        assertCBNotNull(cb);
         return delegateSelectCount(cb);
     }
 
@@ -222,7 +193,7 @@
      * @return The result bean of selected list. (NotNull)
      */
     public ListResultBean selectList(PostalCB cb) {
-        assertConditionBeanNotNull(cb);
+        assertCBNotNull(cb);
         return new ResultBeanBuilder(getTableDbName())
                 .buildListResultBean(cb, delegateSelectList(cb));
     }
@@ -238,7 +209,7 @@
      * @return The result bean of selected page. (NotNull)
      */
     public PagingResultBean selectPage(final PostalCB cb) {
-        assertConditionBeanNotNull(cb);
+        assertCBNotNull(cb);
         final PagingInvoker invoker = new PagingInvoker(
                 getTableDbName());
         final PagingHandler handler = new PagingHandler() {
@@ -259,6 +230,32 @@
 
     //==========================================================================
     // =========
+    // Scalar Select
+    // =============
+    /**
+     * Select the scalar value derived by a function. 
Call a function + * method after this method called like as follows: + * + *
+     * postalBhv.scalarSelect(Date.class).max(new ScalarQuery(PostalCB cb) {
+     *     cb.specify().columnXxxDatetime(); // the required specification of target column
+     *     cb.query().setXxxName_PrefixSearch("S"); // query as you like it
+     * });
+     * 
+ * + * @param The type of result. + * @param resultType The type of result. (NotNull) + * @return The scalar value derived by a function. (Nullable) + */ + public SLFunction scalarSelect( + Class resultType) { + PostalCB cb = newMyConditionBean(); + cb.xsetupForScalarSelect(); + return new SLFunction(cb, resultType); + } + + //========================================================================== + // ========= // Various Select // ============== /** @@ -268,8 +265,8 @@ * @param valueLabelSetupper The setupper of value-label. (NotNull) * @return The list of value-label. (NotNull) */ - public List> selectValueLabelList( - PostalCB cb, ValueLabelSetupper valueLabelSetupper) { + public List> selectValueLabelList(PostalCB cb, + ValueLabelSetupper valueLabelSetupper) { return createValueLabelList(selectList(cb), valueLabelSetupper); } @@ -280,8 +277,8 @@ //========================================================================== // ========= - // Pullout Foreign - // =============== + // Pull out Foreign + // ================ /** * Pull out the list of foreign table 'Person'. * @@ -475,11 +472,11 @@ */ public int queryUpdate(Postal postal, PostalCB cb) { assertObjectNotNull("postal", postal); - assertConditionBeanNotNull(cb); + assertCBNotNull(cb); setupCommonColumnOfUpdateIfNeeds(postal); filterEntityOfUpdate(postal); assertEntityOfUpdate(postal); - return getMyDao().updateByQuery(cb, postal); + return invoke(createQueryUpdateEntityCBCommand(postal, cb)); } /** @@ -489,8 +486,8 @@ * @return The deleted count. */ public int queryDelete(PostalCB cb) { - assertConditionBeanNotNull(cb); - return getMyDao().deleteByQuery(cb); + assertCBNotNull(cb); + return invoke(createQueryDeleteCBCommand(cb)); } //========================================================================== @@ -502,19 +499,27 @@ // ========= // Delegate Method // =============== + // [Behavior Command] // ----------------------------------------------------- // Select // ------ protected int delegateSelectCount(PostalCB cb) { - assertConditionBeanNotNull(cb); - return getMyDao().selectCount(cb); + return invoke(createSelectCountCBCommand(cb)); } + protected int doCallReadCount(ConditionBean cb) { + return delegateSelectCount((PostalCB) cb); + } + protected List delegateSelectList(PostalCB cb) { - assertConditionBeanNotNull(cb); - return getMyDao().selectList(cb); + return invoke(createSelectListCBCommand(cb, Postal.class)); } + @SuppressWarnings("unchecked") + protected List doCallReadList(ConditionBean cb) { + return (List) delegateSelectList((PostalCB) cb); + } + // ----------------------------------------------------- // Update // ------ @@ -522,38 +527,71 @@ if (!processBeforeInsert(e)) { return 1; } - return getMyDao().insert(e); + return invoke(createInsertEntityCommand(e)); } + protected int doCallCreate(Entity entity) { + return delegateInsert(downcast(entity)); + } + protected int delegateUpdate(Postal e) { if (!processBeforeUpdate(e)) { return 1; } - return getMyDao().updateModifiedOnly(e); + return invoke(createUpdateEntityCommand(e)); } + protected int doCallModify(Entity entity) { + return delegateUpdate(downcast(entity)); + } + protected int delegateDelete(Postal e) { if (!processBeforeDelete(e)) { return 1; } - return getMyDao().delete(e); + return invoke(createDeleteEntityCommand(e)); } + protected int doCallRemove(Entity entity) { + return delegateDelete(downcast(entity)); + } + protected int[] delegateInsertList(List ls) { - assertObjectNotNull("postalList", ls); - return getMyDao().insertList(helpFilterBeforeInsertInternally(ls)); + if (ls.isEmpty()) { + return new int[] {}; + } + return invoke(createBatchInsertEntityCommand(helpFilterBeforeInsertInternally(ls))); } + @SuppressWarnings("unchecked") + protected int[] doCreateList(List ls) { + return delegateInsertList((List) ls); + } + protected int[] delegateUpdateList(List ls) { - assertObjectNotNull("postalList", ls); - return getMyDao().updateList(helpFilterBeforeUpdateInternally(ls)); + if (ls.isEmpty()) { + return new int[] {}; + } + return invoke(createBatchUpdateEntityCommand(helpFilterBeforeUpdateInternally(ls))); } + @SuppressWarnings("unchecked") + protected int[] doModifyList(List ls) { + return delegateUpdateList((List) ls); + } + protected int[] delegateDeleteList(List ls) { - assertObjectNotNull("postalList", ls); - return getMyDao().deleteList(helpFilterBeforeDeleteInternally(ls)); + if (ls.isEmpty()) { + return new int[] {}; + } + return invoke(createBatchDeleteEntityCommand(helpFilterBeforeDeleteInternally(ls))); } + @SuppressWarnings("unchecked") + protected int[] doRemoveList(List ls) { + return delegateDeleteList((List) ls); + } + //========================================================================== // ========= // Optimistic Lock Info Modified: addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/bsbhv/BsRoleInfoBhv.java =================================================================== --- addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/bsbhv/BsRoleInfoBhv.java 2008-12-27 22:02:56 UTC (rev 1623) +++ addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/bsbhv/BsRoleInfoBhv.java 2008-12-27 22:06:42 UTC (rev 1624) @@ -1,9 +1,8 @@ package jp.sf.pal.addresslist.db.bsbhv; import java.util.List; +import java.util.Map; -import jp.sf.pal.addresslist.db.allcommon.DaoReadable; -import jp.sf.pal.addresslist.db.allcommon.DaoWritable; import jp.sf.pal.addresslist.db.allcommon.Entity; import jp.sf.pal.addresslist.db.allcommon.bhv.load.LoadReferrerOption; import jp.sf.pal.addresslist.db.allcommon.bhv.setup.ConditionBeanSetupper; @@ -22,13 +21,12 @@ import jp.sf.pal.addresslist.db.cbean.UserInfoCB; import jp.sf.pal.addresslist.db.exbhv.RoleMappingBhv; import jp.sf.pal.addresslist.db.exbhv.UserInfoBhv; -import jp.sf.pal.addresslist.db.exdao.RoleInfoDao; import jp.sf.pal.addresslist.db.exentity.RoleInfo; import jp.sf.pal.addresslist.db.exentity.RoleMapping; import jp.sf.pal.addresslist.db.exentity.UserInfo; /** - * The behavior of ROLE_INFO. + * The behavior of ROLE_INFO that the type is TABLE.
* *
  * [primary-key]
@@ -73,12 +71,6 @@
 
     //==========================================================================
     // =========
-    // Attribute
-    // =========
-    protected RoleInfoDao _dao;
-
-    //==========================================================================
-    // =========
     // Table name
     // ==========
     /** @return The name on database of table. (NotNull) */
@@ -90,39 +82,18 @@
     // =========
     // DBMeta
     // ======
-    /** @return The meta data of the database. (NotNull) */
+    /** @return The instance of DBMeta. (NotNull) */
     public DBMeta getDBMeta() {
         return RoleInfoDbm.getInstance();
     }
 
-    /** @return The meta data of the database as my table type. (NotNull) */
+    /** @return The instance of DBMeta as my table type. (NotNull) */
     public RoleInfoDbm getMyDBMeta() {
         return RoleInfoDbm.getInstance();
     }
 
     //==========================================================================
     // =========
-    // Dao Accessor
-    // ============
-    public RoleInfoDao getMyDao() {
-        return _dao;
-    }
-
-    public void setMyDao(RoleInfoDao dao) {
-        assertObjectNotNull("dao", dao);
-        _dao = dao;
-    }
-
-    public DaoReadable getDaoReadable() {
-        return getMyDao();
-    }
-
-    public DaoWritable getDaoWritable() {
-        return getMyDao();
-    }
-
-    //==========================================================================
-    // =========
     // New Instance
     // ============
     public Entity newEntity() {
@@ -152,7 +123,7 @@
      * @return The selected count.
      */
     public int selectCount(RoleInfoCB cb) {
-        assertConditionBeanNotNull(cb);
+        assertCBNotNull(cb);
         return delegateSelectCount(cb);
     }
 
@@ -229,7 +200,7 @@
      * @return The result bean of selected list. (NotNull)
      */
     public ListResultBean selectList(RoleInfoCB cb) {
-        assertConditionBeanNotNull(cb);
+        assertCBNotNull(cb);
         return new ResultBeanBuilder(getTableDbName())
                 .buildListResultBean(cb, delegateSelectList(cb));
     }
@@ -245,7 +216,7 @@
      * @return The result bean of selected page. (NotNull)
      */
     public PagingResultBean selectPage(final RoleInfoCB cb) {
-        assertConditionBeanNotNull(cb);
+        assertCBNotNull(cb);
         final PagingInvoker invoker = new PagingInvoker(
                 getTableDbName());
         final PagingHandler handler = new PagingHandler() {
@@ -266,6 +237,32 @@
 
     //==========================================================================
     // =========
+    // Scalar Select
+    // =============
+    /**
+     * Select the scalar value derived by a function. 
Call a function + * method after this method called like as follows: + * + *
+     * roleInfoBhv.scalarSelect(Date.class).max(new ScalarQuery(RoleInfoCB cb) {
+     *     cb.specify().columnXxxDatetime(); // the required specification of target column
+     *     cb.query().setXxxName_PrefixSearch("S"); // query as you like it
+     * });
+     * 
+ * + * @param The type of result. + * @param resultType The type of result. (NotNull) + * @return The scalar value derived by a function. (Nullable) + */ + public SLFunction scalarSelect( + Class resultType) { + RoleInfoCB cb = newMyConditionBean(); + cb.xsetupForScalarSelect(); + return new SLFunction(cb, resultType); + } + + //========================================================================== + // ========= // Various Select // ============== /** @@ -275,8 +272,8 @@ * @param valueLabelSetupper The setupper of value-label. (NotNull) * @return The list of value-label. (NotNull) */ - public List> selectValueLabelList( - RoleInfoCB cb, ValueLabelSetupper valueLabelSetupper) { + public List> selectValueLabelList(RoleInfoCB cb, + ValueLabelSetupper valueLabelSetupper) { return createValueLabelList(selectList(cb), valueLabelSetupper); } @@ -467,8 +464,8 @@ //========================================================================== // ========= - // Pullout Foreign - // =============== + // Pull out Foreign + // ================ //========================================================================== // ========= @@ -764,11 +761,11 @@ */ public int queryUpdate(RoleInfo roleInfo, RoleInfoCB cb) { assertObjectNotNull("roleInfo", roleInfo); - assertConditionBeanNotNull(cb); + assertCBNotNull(cb); setupCommonColumnOfUpdateIfNeeds(roleInfo); filterEntityOfUpdate(roleInfo); assertEntityOfUpdate(roleInfo); - return getMyDao().updateByQuery(cb, roleInfo); + return invoke(createQueryUpdateEntityCBCommand(roleInfo, cb)); } /** @@ -778,8 +775,8 @@ * @return The deleted count. */ public int queryDelete(RoleInfoCB cb) { - assertConditionBeanNotNull(cb); - return getMyDao().deleteByQuery(cb); + assertCBNotNull(cb); + return invoke(createQueryDeleteCBCommand(cb)); } //========================================================================== @@ -791,19 +788,27 @@ // ========= // Delegate Method // =============== + // [Behavior Command] // ----------------------------------------------------- // Select // ------ protected int delegateSelectCount(RoleInfoCB cb) { - assertConditionBeanNotNull(cb); - return getMyDao().selectCount(cb); + return invoke(createSelectCountCBCommand(cb)); } + protected int doCallReadCount(ConditionBean cb) { + return delegateSelectCount((RoleInfoCB) cb); + } + protected List delegateSelectList(RoleInfoCB cb) { - assertConditionBeanNotNull(cb); - return getMyDao().selectList(cb); + return invoke(createSelectListCBCommand(cb, RoleInfo.class)); } + @SuppressWarnings("unchecked") + protected List doCallReadList(ConditionBean cb) { + return (List) delegateSelectList((RoleInfoCB) cb); + } + // ----------------------------------------------------- // Update // ------ @@ -811,62 +816,97 @@ if (!processBeforeInsert(e)) { return 1; } - return getMyDao().insert(e); + return invoke(createInsertEntityCommand(e)); } + protected int doCallCreate(Entity entity) { + return delegateInsert(downcast(entity)); + } + protected int delegateUpdate(RoleInfo e) { if (!processBeforeUpdate(e)) { return 1; } - return getMyDao().updateModifiedOnly(e); + return invoke(createUpdateEntityCommand(e)); } + protected int doCallModify(Entity entity) { + return delegateUpdate(downcast(entity)); + } + protected int delegateUpdateNonstrict(RoleInfo e) { if (!processBeforeUpdate(e)) { return 1; } - return getMyDao().updateNonstrictModifiedOnly(e); + return invoke(createUpdateNonstrictEntityCommand(e)); } protected int delegateDelete(RoleInfo e) { if (!processBeforeDelete(e)) { return 1; } - return getMyDao().delete(e); + return invoke(createDeleteEntityCommand(e)); } + protected int doCallRemove(Entity entity) { + return delegateDelete(downcast(entity)); + } + protected int delegateDeleteNonstrict(RoleInfo e) { if (!processBeforeDelete(e)) { return 1; } - return getMyDao().deleteNonstrict(e); + return invoke(createDeleteNonstrictEntityCommand(e)); } protected int[] delegateInsertList(List ls) { - assertObjectNotNull("roleInfoList", ls); - return getMyDao().insertList(helpFilterBeforeInsertInternally(ls)); + if (ls.isEmpty()) { + return new int[] {}; + } + return invoke(createBatchInsertEntityCommand(helpFilterBeforeInsertInternally(ls))); } + @SuppressWarnings("unchecked") + protected int[] doCreateList(List ls) { + return delegateInsertList((List) ls); + } + protected int[] delegateUpdateList(List ls) { - assertObjectNotNull("roleInfoList", ls); - return getMyDao().updateList(helpFilterBeforeUpdateInternally(ls)); + if (ls.isEmpty()) { + return new int[] {}; + } + return invoke(createBatchUpdateEntityCommand(helpFilterBeforeUpdateInternally(ls))); } + @SuppressWarnings("unchecked") + protected int[] doModifyList(List ls) { + return delegateUpdateList((List) ls); + } + protected int[] delegateUpdateListNonstrict(List ls) { - assertObjectNotNull("roleInfoList", ls); - return getMyDao().updateListNonstrict( - helpFilterBeforeUpdateInternally(ls)); + if (ls.isEmpty()) { + return new int[] {}; + } + return invoke(createBatchUpdateNonstrictEntityCommand(helpFilterBeforeUpdateInternally(ls))); } protected int[] delegateDeleteList(List ls) { - assertObjectNotNull("roleInfoList", ls); - return getMyDao().deleteList(helpFilterBeforeDeleteInternally(ls)); + if (ls.isEmpty()) { + return new int[] {}; + } + return invoke(createBatchDeleteEntityCommand(helpFilterBeforeDeleteInternally(ls))); } + @SuppressWarnings("unchecked") + protected int[] doRemoveList(List ls) { + return delegateDeleteList((List) ls); + } + protected int[] delegateDeleteListNonstrict(List ls) { - assertObjectNotNull("roleInfoList", ls); - return getMyDao().deleteListNonstrict( - helpFilterBeforeDeleteInternally(ls)); + if (ls.isEmpty()) { + return new int[] {}; + } + return invoke(createBatchDeleteNonstrictEntityCommand(helpFilterBeforeDeleteInternally(ls))); } //========================================================================== Modified: addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/bsbhv/BsRoleMappingBhv.java =================================================================== --- addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/bsbhv/BsRoleMappingBhv.java 2008-12-27 22:02:56 UTC (rev 1623) +++ addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/bsbhv/BsRoleMappingBhv.java 2008-12-27 22:06:42 UTC (rev 1624) @@ -1,9 +1,8 @@ package jp.sf.pal.addresslist.db.bsbhv; import java.util.List; +import java.util.Map; -import jp.sf.pal.addresslist.db.allcommon.DaoReadable; -import jp.sf.pal.addresslist.db.allcommon.DaoWritable; import jp.sf.pal.addresslist.db.allcommon.Entity; import jp.sf.pal.addresslist.db.allcommon.bhv.setup.ValueLabelSetupper; import jp.sf.pal.addresslist.db.allcommon.cbean.ConditionBean; @@ -16,13 +15,12 @@ import jp.sf.pal.addresslist.db.allcommon.dbmeta.DBMeta; import jp.sf.pal.addresslist.db.bsentity.dbmeta.RoleMappingDbm; import jp.sf.pal.addresslist.db.cbean.RoleMappingCB; -import jp.sf.pal.addresslist.db.exdao.RoleMappingDao; import jp.sf.pal.addresslist.db.exentity.RoleInfo; import jp.sf.pal.addresslist.db.exentity.RoleMapping; import jp.sf.pal.addresslist.db.exentity.UserInfo; /** - * The behavior of ROLE_MAPPING. + * The behavior of ROLE_MAPPING that the type is TABLE.
* *
  * [primary-key]
@@ -67,12 +65,6 @@
 
     //==========================================================================
     // =========
-    // Attribute
-    // =========
-    protected RoleMappingDao _dao;
-
-    //==========================================================================
-    // =========
     // Table name
     // ==========
     /** @return The name on database of table. (NotNull) */
@@ -84,39 +76,18 @@
     // =========
     // DBMeta
     // ======
-    /** @return The meta data of the database. (NotNull) */
+    /** @return The instance of DBMeta. (NotNull) */
     public DBMeta getDBMeta() {
         return RoleMappingDbm.getInstance();
     }
 
-    /** @return The meta data of the database as my table type. (NotNull) */
+    /** @return The instance of DBMeta as my table type. (NotNull) */
     public RoleMappingDbm getMyDBMeta() {
         return RoleMappingDbm.getInstance();
     }
 
     //==========================================================================
     // =========
-    // Dao Accessor
-    // ============
-    public RoleMappingDao getMyDao() {
-        return _dao;
-    }
-
-    public void setMyDao(RoleMappingDao dao) {
-        assertObjectNotNull("dao", dao);
-        _dao = dao;
-    }
-
-    public DaoReadable getDaoReadable() {
-        return getMyDao();
-    }
-
-    public DaoWritable getDaoWritable() {
-        return getMyDao();
-    }
-
-    //==========================================================================
-    // =========
     // New Instance
     // ============
     public Entity newEntity() {
@@ -146,7 +117,7 @@
      * @return The selected count.
      */
     public int selectCount(RoleMappingCB cb) {
-        assertConditionBeanNotNull(cb);
+        assertCBNotNull(cb);
         return delegateSelectCount(cb);
     }
 
@@ -223,7 +194,7 @@
      * @return The result bean of selected list. (NotNull)
      */
     public ListResultBean selectList(RoleMappingCB cb) {
-        assertConditionBeanNotNull(cb);
+        assertCBNotNull(cb);
         return new ResultBeanBuilder(getTableDbName())
                 .buildListResultBean(cb, delegateSelectList(cb));
     }
@@ -239,7 +210,7 @@
      * @return The result bean of selected page. (NotNull)
      */
     public PagingResultBean selectPage(final RoleMappingCB cb) {
-        assertConditionBeanNotNull(cb);
+        assertCBNotNull(cb);
         final PagingInvoker invoker = new PagingInvoker(
                 getTableDbName());
         final PagingHandler handler = new PagingHandler() {
@@ -260,6 +231,32 @@
 
     //==========================================================================
     // =========
+    // Scalar Select
+    // =============
+    /**
+     * Select the scalar value derived by a function. 
Call a function + * method after this method called like as follows: + * + *
+     * roleMappingBhv.scalarSelect(Date.class).max(new ScalarQuery(RoleMappingCB cb) {
+     *     cb.specify().columnXxxDatetime(); // the required specification of target column
+     *     cb.query().setXxxName_PrefixSearch("S"); // query as you like it
+     * });
+     * 
+ * + * @param The type of result. + * @param resultType The type of result. (NotNull) + * @return The scalar value derived by a function. (Nullable) + */ + public SLFunction scalarSelect( + Class resultType) { + RoleMappingCB cb = newMyConditionBean(); + cb.xsetupForScalarSelect(); + return new SLFunction(cb, resultType); + } + + //========================================================================== + // ========= // Various Select // ============== /** @@ -269,8 +266,8 @@ * @param valueLabelSetupper The setupper of value-label. (NotNull) * @return The list of value-label. (NotNull) */ - public List> selectValueLabelList( - RoleMappingCB cb, ValueLabelSetupper valueLabelSetupper) { + public List> selectValueLabelList(RoleMappingCB cb, + ValueLabelSetupper valueLabelSetupper) { return createValueLabelList(selectList(cb), valueLabelSetupper); } @@ -281,8 +278,8 @@ //========================================================================== // ========= - // Pullout Foreign - // =============== + // Pull out Foreign + // ================ /** * Pull out the list of foreign table 'RoleInfo'. * @@ -494,11 +491,11 @@ */ public int queryUpdate(RoleMapping roleMapping, RoleMappingCB cb) { assertObjectNotNull("roleMapping", roleMapping); - assertConditionBeanNotNull(cb); + assertCBNotNull(cb); setupCommonColumnOfUpdateIfNeeds(roleMapping); filterEntityOfUpdate(roleMapping); assertEntityOfUpdate(roleMapping); - return getMyDao().updateByQuery(cb, roleMapping); + return invoke(createQueryUpdateEntityCBCommand(roleMapping, cb)); } /** @@ -508,8 +505,8 @@ * @return The deleted count. */ public int queryDelete(RoleMappingCB cb) { - assertConditionBeanNotNull(cb); - return getMyDao().deleteByQuery(cb); + assertCBNotNull(cb); + return invoke(createQueryDeleteCBCommand(cb)); } //========================================================================== @@ -521,19 +518,27 @@ // ========= // Delegate Method // =============== + // [Behavior Command] // ----------------------------------------------------- // Select // ------ protected int delegateSelectCount(RoleMappingCB cb) { - assertConditionBeanNotNull(cb); - return getMyDao().selectCount(cb); + return invoke(createSelectCountCBCommand(cb)); } + protected int doCallReadCount(ConditionBean cb) { + return delegateSelectCount((RoleMappingCB) cb); + } + protected List delegateSelectList(RoleMappingCB cb) { - assertConditionBeanNotNull(cb); - return getMyDao().selectList(cb); + return invoke(createSelectListCBCommand(cb, RoleMapping.class)); } + @SuppressWarnings("unchecked") + protected List doCallReadList(ConditionBean cb) { + return (List) delegateSelectList((RoleMappingCB) cb); + } + // ----------------------------------------------------- // Update // ------ @@ -541,38 +546,71 @@ if (!processBeforeInsert(e)) { return 1; } - return getMyDao().insert(e); + return invoke(createInsertEntityCommand(e)); } + protected int doCallCreate(Entity entity) { + return delegateInsert(downcast(entity)); + } + protected int delegateUpdate(RoleMapping e) { if (!processBeforeUpdate(e)) { return 1; } - return getMyDao().updateModifiedOnly(e); + return invoke(createUpdateEntityCommand(e)); } + protected int doCallModify(Entity entity) { + return delegateUpdate(downcast(entity)); + } + protected int delegateDelete(RoleMapping e) { if (!processBeforeDelete(e)) { return 1; } - return getMyDao().delete(e); + return invoke(createDeleteEntityCommand(e)); } + protected int doCallRemove(Entity entity) { + return delegateDelete(downcast(entity)); + } + protected int[] delegateInsertList(List ls) { - assertObjectNotNull("roleMappingList", ls); - return getMyDao().insertList(helpFilterBeforeInsertInternally(ls)); + if (ls.isEmpty()) { + return new int[] {}; + } + return invoke(createBatchInsertEntityCommand(helpFilterBeforeInsertInternally(ls))); } + @SuppressWarnings("unchecked") + protected int[] doCreateList(List ls) { + return delegateInsertList((List) ls); + } + protected int[] delegateUpdateList(List ls) { - assertObjectNotNull("roleMappingList", ls); - return getMyDao().updateList(helpFilterBeforeUpdateInternally(ls)); + if (ls.isEmpty()) { + return new int[] {}; + } + return invoke(createBatchUpdateEntityCommand(helpFilterBeforeUpdateInternally(ls))); } + @SuppressWarnings("unchecked") + protected int[] doModifyList(List ls) { + return delegateUpdateList((List) ls); + } + protected int[] delegateDeleteList(List ls) { - assertObjectNotNull("roleMappingList", ls); - return getMyDao().deleteList(helpFilterBeforeDeleteInternally(ls)); + if (ls.isEmpty()) { + return new int[] {}; + } + return invoke(createBatchDeleteEntityCommand(helpFilterBeforeDeleteInternally(ls))); } + @SuppressWarnings("unchecked") + protected int[] doRemoveList(List ls) { + return delegateDeleteList((List) ls); + } + //========================================================================== // ========= // Optimistic Lock Info Modified: addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/bsbhv/BsUserInfoBhv.java =================================================================== --- addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/bsbhv/BsUserInfoBhv.java 2008-12-27 22:02:56 UTC (rev 1623) +++ addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/bsbhv/BsUserInfoBhv.java 2008-12-27 22:06:42 UTC (rev 1624) @@ -1,9 +1,8 @@ package jp.sf.pal.addresslist.db.bsbhv; import java.util.List; +import java.util.Map; -import jp.sf.pal.addresslist.db.allcommon.DaoReadable; -import jp.sf.pal.addresslist.db.allcommon.DaoWritable; import jp.sf.pal.addresslist.db.allcommon.Entity; import jp.sf.pal.addresslist.db.allcommon.bhv.load.LoadReferrerOption; import jp.sf.pal.addresslist.db.allcommon.bhv.setup.ConditionBeanSetupper; @@ -26,7 +25,6 @@ import jp.sf.pal.addresslist.db.exbhv.GroupMappingBhv; import jp.sf.pal.addresslist.db.exbhv.PersonBhv; import jp.sf.pal.addresslist.db.exbhv.RoleMappingBhv; -import jp.sf.pal.addresslist.db.exdao.UserInfoDao; import jp.sf.pal.addresslist.db.exentity.Company; import jp.sf.pal.addresslist.db.exentity.GroupInfo; import jp.sf.pal.addresslist.db.exentity.GroupMapping; @@ -36,14 +34,14 @@ import jp.sf.pal.addresslist.db.exentity.UserInfo; /** - * The behavior of USER_INFO. + * The behavior of USER_INFO that the type is TABLE.
* *
  * [primary-key]
  *     USER_ID
  * 
  * [column]
- *     USER_ID, GIVEN_NAME, FAMILY_NAME, MIDDLE_NAME, GIVEN_NAME_DESC, FAMILY_NAME_DESC, NICKNAME, GENDER, BIRTH_DATE, EMAIL, URL, TELEPHONE, LOCALE, ROLE_ID, GROUP_ID, CREATED_TIME, CREATED_BY, UPDATED_TIME, UPDATED_BY, DELETED_TIME, DELETED_BY, VERSIONNO
+ *     USER_ID, GIVEN_NAME, FAMILY_NAME, MIDDLE_NAME, GIVEN_NAME_DESC, FAMILY_NAME_DESC, NICKNAME, GENDER, BIRTH_DATE, EMAIL, URL, TELEPHONE, LOCALE, ROLE_ID, GROUP_ID, STATUS, CREATED_TIME, CREATED_BY, UPDATED_TIME, UPDATED_BY, DELETED_TIME, DELETED_BY, VERSIONNO
  * 
  * [sequence]
  *     
@@ -81,12 +79,6 @@
 
     //==========================================================================
     // =========
-    // Attribute
-    // =========
-    protected UserInfoDao _dao;
-
-    //==========================================================================
-    // =========
     // Table name
     // ==========
     /** @return The name on database of table. (NotNull) */
@@ -98,39 +90,18 @@
     // =========
     // DBMeta
     // ======
-    /** @return The meta data of the database. (NotNull) */
+    /** @return The instance of DBMeta. (NotNull) */
     public DBMeta getDBMeta() {
         return UserInfoDbm.getInstance();
     }
 
-    /** @return The meta data of the database as my table type. (NotNull) */
+    /** @return The instance of DBMeta as my table type. (NotNull) */
     public UserInfoDbm getMyDBMeta() {
         return UserInfoDbm.getInstance();
     }
 
     //==========================================================================
     // =========
-    // Dao Accessor
-    // ============
-    public UserInfoDao getMyDao() {
-        return _dao;
-    }
-
-    public void setMyDao(UserInfoDao dao) {
-        assertObjectNotNull("dao", dao);
-        _dao = dao;
-    }
-
-    public DaoReadable getDaoReadable() {
-        return getMyDao();
-    }
-
-    public DaoWritable getDaoWritable() {
-        return getMyDao();
-    }
-
-    //==========================================================================
-    // =========
     // New Instance
     // ============
     public Entity newEntity() {
@@ -160,7 +131,7 @@
      * @return The selected count.
      */
     public int selectCount(UserInfoCB cb) {
-        assertConditionBeanNotNull(cb);
+        assertCBNotNull(cb);
         return delegateSelectCount(cb);
     }
 
@@ -237,7 +208,7 @@
      * @return The result bean of selected list. (NotNull)
      */
     public ListResultBean selectList(UserInfoCB cb) {
-        assertConditionBeanNotNull(cb);
+        assertCBNotNull(cb);
         return new ResultBeanBuilder(getTableDbName())
                 .buildListResultBean(cb, delegateSelectList(cb));
     }
@@ -253,7 +224,7 @@
      * @return The result bean of selected page. (NotNull)
      */
     public PagingResultBean selectPage(final UserInfoCB cb) {
-        assertConditionBeanNotNull(cb);
+        assertCBNotNull(cb);
         final PagingInvoker invoker = new PagingInvoker(
                 getTableDbName());
         final PagingHandler handler = new PagingHandler() {
@@ -274,6 +245,32 @@
 
     //==========================================================================
     // =========
+    // Scalar Select
+    // =============
+    /**
+     * Select the scalar value derived by a function. 
Call a function + * method after this method called like as follows: + * + *
+     * userInfoBhv.scalarSelect(Date.class).max(new ScalarQuery(UserInfoCB cb) {
+     *     cb.specify().columnXxxDatetime(); // the required specification of target column
+     *     cb.query().setXxxName_PrefixSearch("S"); // query as you like it
+     * });
+     * 
+ * + * @param The type of result. + * @param resultType The type of result. (NotNull) + * @return The scalar value derived by a function. (Nullable) + */ + public SLFunction scalarSelect( + Class resultType) { + UserInfoCB cb = newMyConditionBean(); + cb.xsetupForScalarSelect(); + return new SLFunction(cb, resultType); + } + + //========================================================================== + // ========= // Various Select // ============== /** @@ -283,8 +280,8 @@ * @param valueLabelSetupper The setupper of value-label. (NotNull) * @return The list of value-label. (NotNull) */ - public List> selectValueLabelList( - UserInfoCB cb, ValueLabelSetupper valueLabelSetupper) { + public List> selectValueLabelList(UserInfoCB cb, + ValueLabelSetupper valueLabelSetupper) { return createValueLabelList(selectList(cb), valueLabelSetupper); } @@ -654,8 +651,8 @@ //========================================================================== // ========= - // Pullout Foreign - // =============== + // Pull out Foreign + // ================ /** * Pull out the list of foreign table 'GroupInfo'. * @@ -980,11 +977,11 @@ */ public int queryUpdate(UserInfo userInfo, UserInfoCB cb) { assertObjectNotNull("userInfo", userInfo); - assertConditionBeanNotNull(cb); + assertCBNotNull(cb); setupCommonColumnOfUpdateIfNeeds(userInfo); filterEntityOfUpdate(userInfo); assertEntityOfUpdate(userInfo); - return getMyDao().updateByQuery(cb, userInfo); + return invoke(createQueryUpdateEntityCBCommand(userInfo, cb)); } /** @@ -994,8 +991,8 @@ * @return The deleted count. */ public int queryDelete(UserInfoCB cb) { - assertConditionBeanNotNull(cb); - return getMyDao().deleteByQuery(cb); + assertCBNotNull(cb); + return invoke(createQueryDeleteCBCommand(cb)); } //========================================================================== @@ -1007,19 +1004,27 @@ // ========= // Delegate Method // =============== + // [Behavior Command] // ----------------------------------------------------- // Select // ------ protected int delegateSelectCount(UserInfoCB cb) { - assertConditionBeanNotNull(cb); - return getMyDao().selectCount(cb); + return invoke(createSelectCountCBCommand(cb)); } + protected int doCallReadCount(ConditionBean cb) { + return delegateSelectCount((UserInfoCB) cb); + } + protected List delegateSelectList(UserInfoCB cb) { - assertConditionBeanNotNull(cb); - return getMyDao().selectList(cb); + return invoke(createSelectListCBCommand(cb, UserInfo.class)); } + @SuppressWarnings("unchecked") + protected List doCallReadList(ConditionBean cb) { + return (List) delegateSelectList((UserInfoCB) cb); + } + // ----------------------------------------------------- // Update // ------ @@ -1027,62 +1032,97 @@ if (!processBeforeInsert(e)) { return 1; } - return getMyDao().insert(e); + return invoke(createInsertEntityCommand(e)); } + protected int doCallCreate(Entity entity) { + return delegateInsert(downcast(entity)); + } + protected int delegateUpdate(UserInfo e) { if (!processBeforeUpdate(e)) { return 1; } - return getMyDao().updateModifiedOnly(e); + return invoke(createUpdateEntityCommand(e)); } + protected int doCallModify(Entity entity) { + return delegateUpdate(downcast(entity)); + } + protected int delegateUpdateNonstrict(UserInfo e) { if (!processBeforeUpdate(e)) { return 1; } - return getMyDao().updateNonstrictModifiedOnly(e); + return invoke(createUpdateNonstrictEntityCommand(e)); } protected int delegateDelete(UserInfo e) { if (!processBeforeDelete(e)) { return 1; } - return getMyDao().delete(e); + return invoke(createDeleteEntityCommand(e)); } + protected int doCallRemove(Entity entity) { + return delegateDelete(downcast(entity)); + } + protected int delegateDeleteNonstrict(UserInfo e) { if (!processBeforeDelete(e)) { return 1; } - return getMyDao().deleteNonstrict(e); + return invoke(createDeleteNonstrictEntityCommand(e)); } protected int[] delegateInsertList(List ls) { - assertObjectNotNull("userInfoList", ls); - return getMyDao().insertList(helpFilterBeforeInsertInternally(ls)); + if (ls.isEmpty()) { + return new int[] {}; + } + return invoke(createBatchInsertEntityCommand(helpFilterBeforeInsertInternally(ls))); } + @SuppressWarnings("unchecked") + protected int[] doCreateList(List ls) { + return delegateInsertList((List) ls); + } + protected int[] delegateUpdateList(List ls) { - assertObjectNotNull("userInfoList", ls); - return getMyDao().updateList(helpFilterBeforeUpdateInternally(ls)); + if (ls.isEmpty()) { + return new int[] {}; + } + return invoke(createBatchUpdateEntityCommand(helpFilterBeforeUpdateInternally(ls))); } + @SuppressWarnings("unchecked") + protected int[] doModifyList(List ls) { + return delegateUpdateList((List) ls); + } + protected int[] delegateUpdateListNonstrict(List ls) { - assertObjectNotNull("userInfoList", ls); - return getMyDao().updateListNonstrict( - helpFilterBeforeUpdateInternally(ls)); + if (ls.isEmpty()) { + return new int[] {}; + } + return invoke(createBatchUpdateNonstrictEntityCommand(helpFilterBeforeUpdateInternally(ls))); } protected int[] delegateDeleteList(List ls) { - assertObjectNotNull("userInfoList", ls); - return getMyDao().deleteList(helpFilterBeforeDeleteInternally(ls)); + if (ls.isEmpty()) { + return new int[] {}; + } + return invoke(createBatchDeleteEntityCommand(helpFilterBeforeDeleteInternally(ls))); } + @SuppressWarnings("unchecked") + protected int[] doRemoveList(List ls) { + return delegateDeleteList((List) ls); + } + protected int[] delegateDeleteListNonstrict(List ls) { - assertObjectNotNull("userInfoList", ls); - return getMyDao().deleteListNonstrict( - helpFilterBeforeDeleteInternally(ls)); + if (ls.isEmpty()) { + return new int[] {}; + } + return invoke(createBatchDeleteNonstrictEntityCommand(helpFilterBeforeDeleteInternally(ls))); } //========================================================================== Modified: addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/bsentity/BsCompany.java =================================================================== --- addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/bsentity/BsCompany.java 2008-12-27 22:02:56 UTC (rev 1623) +++ addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/bsentity/BsCompany.java 2008-12-27 22:06:42 UTC (rev 1624) @@ -44,7 +44,6 @@ * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public abstract class BsCompany implements Entity, java.io.Serializable { //========================================================================== Modified: addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/bsentity/BsContact.java =================================================================== --- addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/bsentity/BsContact.java 2008-12-27 22:02:56 UTC (rev 1623) +++ addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/bsentity/BsContact.java 2008-12-27 22:06:42 UTC (rev 1624) @@ -41,7 +41,6 @@ * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public abstract class BsContact implements Entity, java.io.Serializable { //========================================================================== Modified: addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/bsentity/BsCustom.java =================================================================== --- addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/bsentity/BsCustom.java 2008-12-27 22:02:56 UTC (rev 1623) +++ addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/bsentity/BsCustom.java 2008-12-27 22:06:42 UTC (rev 1624) @@ -41,7 +41,6 @@ * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public abstract class BsCustom implements Entity, java.io.Serializable { //========================================================================== Modified: addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/bsentity/BsGroupInfo.java =================================================================== --- addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/bsentity/BsGroupInfo.java 2008-12-27 22:02:56 UTC (rev 1623) +++ addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/bsentity/BsGroupInfo.java 2008-12-27 22:06:42 UTC (rev 1624) @@ -44,7 +44,6 @@ * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public abstract class BsGroupInfo implements Entity, java.io.Serializable { //========================================================================== Modified: addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/bsentity/BsGroupMapping.java =================================================================== --- addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/bsentity/BsGroupMapping.java 2008-12-27 22:02:56 UTC (rev 1623) +++ addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/bsentity/BsGroupMapping.java 2008-12-27 22:06:42 UTC (rev 1624) @@ -42,7 +42,6 @@ * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public abstract class BsGroupMapping implements Entity, java.io.Serializable { //========================================================================== Modified: addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/bsentity/BsPerson.java =================================================================== --- addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/bsentity/BsPerson.java 2008-12-27 22:02:56 UTC (rev 1623) +++ addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/bsentity/BsPerson.java 2008-12-27 22:06:42 UTC (rev 1624) @@ -47,7 +47,6 @@ * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public abstract class BsPerson implements Entity, java.io.Serializable { //========================================================================== Modified: addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/bsentity/BsPostal.java =================================================================== --- addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/bsentity/BsPostal.java 2008-12-27 22:02:56 UTC (rev 1623) +++ addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/bsentity/BsPostal.java 2008-12-27 22:06:42 UTC (rev 1624) @@ -41,7 +41,6 @@ * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public abstract class BsPostal implements Entity, java.io.Serializable { //========================================================================== Modified: addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/bsentity/BsRoleInfo.java =================================================================== --- addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/bsentity/BsRoleInfo.java 2008-12-27 22:02:56 UTC (rev 1623) +++ addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/bsentity/BsRoleInfo.java 2008-12-27 22:06:42 UTC (rev 1624) @@ -44,7 +44,6 @@ * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public abstract class BsRoleInfo implements Entity, java.io.Serializable { //========================================================================== Modified: addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/bsentity/BsRoleMapping.java =================================================================== --- addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/bsentity/BsRoleMapping.java 2008-12-27 22:02:56 UTC (rev 1623) +++ addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/bsentity/BsRoleMapping.java 2008-12-27 22:06:42 UTC (rev 1624) @@ -42,7 +42,6 @@ * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public abstract class BsRoleMapping implements Entity, java.io.Serializable { //========================================================================== Modified: addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/bsentity/BsUserInfo.java =================================================================== --- addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/bsentity/BsUserInfo.java 2008-12-27 22:02:56 UTC (rev 1623) +++ addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/bsentity/BsUserInfo.java 2008-12-27 22:06:42 UTC (rev 1624) @@ -22,7 +22,7 @@ * USER_ID * * [column] - * USER_ID, GIVEN_NAME, FAMILY_NAME, MIDDLE_NAME, GIVEN_NAME_DESC, FAMILY_NAME_DESC, NICKNAME, GENDER, BIRTH_DATE, EMAIL, URL, TELEPHONE, LOCALE, ROLE_ID, GROUP_ID, CREATED_TIME, CREATED_BY, UPDATED_TIME, UPDATED_BY, DELETED_TIME, DELETED_BY, VERSIONNO + * USER_ID, GIVEN_NAME, FAMILY_NAME, MIDDLE_NAME, GIVEN_NAME_DESC, FAMILY_NAME_DESC, NICKNAME, GENDER, BIRTH_DATE, EMAIL, URL, TELEPHONE, LOCALE, ROLE_ID, GROUP_ID, STATUS, CREATED_TIME, CREATED_BY, UPDATED_TIME, UPDATED_BY, DELETED_TIME, DELETED_BY, VERSIONNO * * [sequence] * @@ -48,7 +48,6 @@ * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public abstract class BsUserInfo implements Entity, java.io.Serializable { //========================================================================== @@ -116,6 +115,9 @@ /** GROUP_ID: {VARCHAR(255) : FK to GROUP_INFO} */ protected String _groupId; + /** STATUS: {VARCHAR(1)} */ + protected String _status; + /** CREATED_TIME: {NotNull : TIMESTAMP} */ protected java.sql.Timestamp _createdTime; @@ -463,6 +465,7 @@ sb.append(delimiter).append(getLocale()); sb.append(delimiter).append(getRoleId()); sb.append(delimiter).append(getGroupId()); + sb.append(delimiter).append(getStatus()); sb.append(delimiter).append(getCreatedTime()); sb.append(delimiter).append(getCreatedBy()); sb.append(delimiter).append(getUpdatedTime()); @@ -814,6 +817,28 @@ this._groupId = groupId; } + /** The column annotation for S2Dao. {VARCHAR(1)} */ + public static final String status_COLUMN = "STATUS"; + + /** + * STATUS: {VARCHAR(1)}
+ * + * @return The value of the column 'STATUS'. (Nullable) + */ + public String getStatus() { + return _status; + } + + /** + * STATUS: {VARCHAR(1)}
+ * + * @param status The value of the column 'STATUS'. (Nullable) + */ + public void setStatus(String status) { + _modifiedProperties.addPropertyName("status"); + this._status = status; + } + /** The column annotation for S2Dao. {NotNull : TIMESTAMP} */ public static final String createdTime_COLUMN = "CREATED_TIME"; Modified: addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/bsentity/dbmeta/CompanyDbm.java =================================================================== --- addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/bsentity/dbmeta/CompanyDbm.java 2008-12-27 22:02:56 UTC (rev 1623) +++ addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/bsentity/dbmeta/CompanyDbm.java 2008-12-27 22:06:42 UTC (rev 1624) @@ -9,6 +9,7 @@ import jp.sf.pal.addresslist.db.allcommon.dbmeta.info.ForeignInfo; import jp.sf.pal.addresslist.db.allcommon.dbmeta.info.ReferrerInfo; import jp.sf.pal.addresslist.db.allcommon.dbmeta.info.UniqueInfo; +import jp.sf.pal.addresslist.db.allcommon.helper.StringKeyMap; import jp.sf.pal.addresslist.db.exentity.Company; /** @@ -16,7 +17,6 @@ * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public class CompanyDbm extends AbstractDBMeta { private static final CompanyDbm _instance = new CompanyDbm(); @@ -216,40 +216,14 @@ return _columnVersionno; } - { - initializeColumnInfoList(); - } - //========================================================================== // ========= - // Name Map - // ======== - public Map getDbNamePropertyNameKeyToLowerMap() { - return createDbNamePropertyNameKeyToLowerMap(); + // Resource Initialization + // ======================= + { + initializeInformationResource(); } - public Map getPropertyNameDbNameKeyToLowerMap() { - return createPropertyNameDbNameKeyToLowerMap(); - } - - protected static Map _dbNamePropertyNameKeyToLowerMap; - - protected Map createDbNamePropertyNameKeyToLowerMap() { - if (_dbNamePropertyNameKeyToLowerMap == null) { - _dbNamePropertyNameKeyToLowerMap = setupKeyToLowerMap(true); - } - return _dbNamePropertyNameKeyToLowerMap; - } - - protected static Map _propertyNameDbNameKeyToLowerMap; - - protected Map createPropertyNameDbNameKeyToLowerMap() { - if (_propertyNameDbNameKeyToLowerMap == null) { - _propertyNameDbNameKeyToLowerMap = setupKeyToLowerMap(false); - } - return _propertyNameDbNameKeyToLowerMap; - } - //========================================================================== // ========= // Type Name @@ -417,7 +391,8 @@ // Entity Property Setup // ===================== // It's very INTERNAL! - protected Map> _epsMap = newHashMap(); + protected Map> _epsMap = StringKeyMap + .createAsFlexibleConcurrent(); { setupEps(_epsMap, new EpsId(), columnId()); setupEps(_epsMap, new EpsUserId(), columnUserId()); Modified: addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/bsentity/dbmeta/ContactDbm.java =================================================================== --- addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/bsentity/dbmeta/ContactDbm.java 2008-12-27 22:02:56 UTC (rev 1623) +++ addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/bsentity/dbmeta/ContactDbm.java 2008-12-27 22:06:42 UTC (rev 1624) @@ -8,6 +8,7 @@ import jp.sf.pal.addresslist.db.allcommon.dbmeta.info.ColumnInfo; import jp.sf.pal.addresslist.db.allcommon.dbmeta.info.ForeignInfo; import jp.sf.pal.addresslist.db.allcommon.dbmeta.info.UniqueInfo; +import jp.sf.pal.addresslist.db.allcommon.helper.StringKeyMap; import jp.sf.pal.addresslist.db.exentity.Contact; /** @@ -15,7 +16,6 @@ * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public class ContactDbm extends AbstractDBMeta { private static final ContactDbm _instance = new ContactDbm(); @@ -75,40 +75,14 @@ return _columnValue; } - { - initializeColumnInfoList(); - } - //========================================================================== // ========= - // Name Map - // ======== - public Map getDbNamePropertyNameKeyToLowerMap() { - return createDbNamePropertyNameKeyToLowerMap(); + // Resource Initialization + // ======================= + { + initializeInformationResource(); } - public Map getPropertyNameDbNameKeyToLowerMap() { - return createPropertyNameDbNameKeyToLowerMap(); - } - - protected static Map _dbNamePropertyNameKeyToLowerMap; - - protected Map createDbNamePropertyNameKeyToLowerMap() { - if (_dbNamePropertyNameKeyToLowerMap == null) { - _dbNamePropertyNameKeyToLowerMap = setupKeyToLowerMap(true); - } - return _dbNamePropertyNameKeyToLowerMap; - } - - protected static Map _propertyNameDbNameKeyToLowerMap; - - protected Map createPropertyNameDbNameKeyToLowerMap() { - if (_propertyNameDbNameKeyToLowerMap == null) { - _propertyNameDbNameKeyToLowerMap = setupKeyToLowerMap(false); - } - return _propertyNameDbNameKeyToLowerMap; - } - //========================================================================== // ========= // Type Name @@ -264,7 +238,8 @@ // Entity Property Setup // ===================== // It's very INTERNAL! - protected Map> _epsMap = newHashMap(); + protected Map> _epsMap = StringKeyMap + .createAsFlexibleConcurrent(); { setupEps(_epsMap, new EpsId(), columnId()); setupEps(_epsMap, new EpsPersonId(), columnPersonId()); Modified: addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/bsentity/dbmeta/CustomDbm.java =================================================================== --- addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/bsentity/dbmeta/CustomDbm.java 2008-12-27 22:02:56 UTC (rev 1623) +++ addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/bsentity/dbmeta/CustomDbm.java 2008-12-27 22:06:42 UTC (rev 1624) @@ -8,6 +8,7 @@ import jp.sf.pal.addresslist.db.allcommon.dbmeta.info.ColumnInfo; import jp.sf.pal.addresslist.db.allcommon.dbmeta.info.ForeignInfo; import jp.sf.pal.addresslist.db.allcommon.dbmeta.info.UniqueInfo; +import jp.sf.pal.addresslist.db.allcommon.helper.StringKeyMap; import jp.sf.pal.addresslist.db.exentity.Custom; /** @@ -15,7 +16,6 @@ * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public class CustomDbm extends AbstractDBMeta { private static final CustomDbm _instance = new CustomDbm(); @@ -75,40 +75,14 @@ return _columnSortOrder; } - { - initializeColumnInfoList(); - } - //========================================================================== // ========= - // Name Map - // ======== - public Map getDbNamePropertyNameKeyToLowerMap() { - return createDbNamePropertyNameKeyToLowerMap(); + // Resource Initialization + // ======================= + { + initializeInformationResource(); } - public Map getPropertyNameDbNameKeyToLowerMap() { - return createPropertyNameDbNameKeyToLowerMap(); - } - - protected static Map _dbNamePropertyNameKeyToLowerMap; - - protected Map createDbNamePropertyNameKeyToLowerMap() { - if (_dbNamePropertyNameKeyToLowerMap == null) { - _dbNamePropertyNameKeyToLowerMap = setupKeyToLowerMap(true); - } - return _dbNamePropertyNameKeyToLowerMap; - } - - protected static Map _propertyNameDbNameKeyToLowerMap; - - protected Map createPropertyNameDbNameKeyToLowerMap() { - if (_propertyNameDbNameKeyToLowerMap == null) { - _propertyNameDbNameKeyToLowerMap = setupKeyToLowerMap(false); - } - return _propertyNameDbNameKeyToLowerMap; - } - //========================================================================== // ========= // Type Name @@ -264,7 +238,8 @@ // Entity Property Setup // ===================== // It's very INTERNAL! - protected Map> _epsMap = newHashMap(); + protected Map> _epsMap = StringKeyMap + .createAsFlexibleConcurrent(); { setupEps(_epsMap, new EpsId(), columnId()); setupEps(_epsMap, new EpsPersonId(), columnPersonId()); Modified: addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/bsentity/dbmeta/GroupInfoDbm.java =================================================================== --- addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/bsentity/dbmeta/GroupInfoDbm.java 2008-12-27 22:02:56 UTC (rev 1623) +++ addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/bsentity/dbmeta/GroupInfoDbm.java 2008-12-27 22:06:42 UTC (rev 1624) @@ -8,6 +8,7 @@ import jp.sf.pal.addresslist.db.allcommon.dbmeta.info.ColumnInfo; import jp.sf.pal.addresslist.db.allcommon.dbmeta.info.ReferrerInfo; import jp.sf.pal.addresslist.db.allcommon.dbmeta.info.UniqueInfo; +import jp.sf.pal.addresslist.db.allcommon.helper.StringKeyMap; import jp.sf.pal.addresslist.db.exentity.GroupInfo; /** @@ -15,7 +16,6 @@ * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public class GroupInfoDbm extends AbstractDBMeta { private static final GroupInfoDbm _instance = new GroupInfoDbm(); @@ -138,40 +138,14 @@ return _columnVersionno; } - { - initializeColumnInfoList(); - } - //========================================================================== // ========= - // Name Map - // ======== - public Map getDbNamePropertyNameKeyToLowerMap() { - return createDbNamePropertyNameKeyToLowerMap(); + // Resource Initialization + // ======================= + { + initializeInformationResource(); } - public Map getPropertyNameDbNameKeyToLowerMap() { - return createPropertyNameDbNameKeyToLowerMap(); - } - - protected static Map _dbNamePropertyNameKeyToLowerMap; - - protected Map createDbNamePropertyNameKeyToLowerMap() { - if (_dbNamePropertyNameKeyToLowerMap == null) { - _dbNamePropertyNameKeyToLowerMap = setupKeyToLowerMap(true); - } - return _dbNamePropertyNameKeyToLowerMap; - } - - protected static Map _propertyNameDbNameKeyToLowerMap; - - protected Map createPropertyNameDbNameKeyToLowerMap() { - if (_propertyNameDbNameKeyToLowerMap == null) { - _propertyNameDbNameKeyToLowerMap = setupKeyToLowerMap(false); - } - return _propertyNameDbNameKeyToLowerMap; - } - //========================================================================== // ========= // Type Name @@ -341,7 +315,8 @@ // Entity Property Setup // ===================== // It's very INTERNAL! - protected Map> _epsMap = newHashMap(); + protected Map> _epsMap = StringKeyMap + .createAsFlexibleConcurrent(); { setupEps(_epsMap, new EpsGroupId(), columnGroupId()); setupEps(_epsMap, new EpsName(), columnName()); Modified: addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/bsentity/dbmeta/GroupMappingDbm.java =================================================================== --- addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/bsentity/dbmeta/GroupMappingDbm.java 2008-12-27 22:02:56 UTC (rev 1623) +++ addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/bsentity/dbmeta/GroupMappingDbm.java 2008-12-27 22:06:42 UTC (rev 1624) @@ -8,6 +8,7 @@ import jp.sf.pal.addresslist.db.allcommon.dbmeta.info.ColumnInfo; import jp.sf.pal.addresslist.db.allcommon.dbmeta.info.ForeignInfo; import jp.sf.pal.addresslist.db.allcommon.dbmeta.info.UniqueInfo; +import jp.sf.pal.addresslist.db.allcommon.helper.StringKeyMap; import jp.sf.pal.addresslist.db.exentity.GroupMapping; /** @@ -15,7 +16,6 @@ * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public class GroupMappingDbm extends AbstractDBMeta { private static final GroupMappingDbm _instance = new GroupMappingDbm(); @@ -68,40 +68,14 @@ return _columnGroupId; } - { - initializeColumnInfoList(); - } - //========================================================================== // ========= - // Name Map - // ======== - public Map getDbNamePropertyNameKeyToLowerMap() { - return createDbNamePropertyNameKeyToLowerMap(); + // Resource Initialization + // ======================= + { + initializeInformationResource(); } - public Map getPropertyNameDbNameKeyToLowerMap() { - return createPropertyNameDbNameKeyToLowerMap(); - } - - protected static Map _dbNamePropertyNameKeyToLowerMap; - - protected Map createDbNamePropertyNameKeyToLowerMap() { - if (_dbNamePropertyNameKeyToLowerMap == null) { - _dbNamePropertyNameKeyToLowerMap = setupKeyToLowerMap(true); - } - return _dbNamePropertyNameKeyToLowerMap; - } - - protected static Map _propertyNameDbNameKeyToLowerMap; - - protected Map createPropertyNameDbNameKeyToLowerMap() { - if (_propertyNameDbNameKeyToLowerMap == null) { - _propertyNameDbNameKeyToLowerMap = setupKeyToLowerMap(false); - } - return _propertyNameDbNameKeyToLowerMap; - } - //========================================================================== // ========= // Type Name @@ -263,7 +237,8 @@ // Entity Property Setup // ===================== // It's very INTERNAL! - protected Map> _epsMap = newHashMap(); + protected Map> _epsMap = StringKeyMap + .createAsFlexibleConcurrent(); { setupEps(_epsMap, new EpsId(), columnId()); setupEps(_epsMap, new EpsUserId(), columnUserId()); Modified: addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/bsentity/dbmeta/PersonDbm.java =================================================================== --- addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/bsentity/dbmeta/PersonDbm.java 2008-12-27 22:02:56 UTC (rev 1623) +++ addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/bsentity/dbmeta/PersonDbm.java 2008-12-27 22:06:42 UTC (rev 1624) @@ -9,6 +9,7 @@ import jp.sf.pal.addresslist.db.allcommon.dbmeta.info.ForeignInfo; import jp.sf.pal.addresslist.db.allcommon.dbmeta.info.ReferrerInfo; import jp.sf.pal.addresslist.db.allcommon.dbmeta.info.UniqueInfo; +import jp.sf.pal.addresslist.db.allcommon.helper.StringKeyMap; import jp.sf.pal.addresslist.db.exentity.Person; /** @@ -16,7 +17,6 @@ * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public class PersonDbm extends AbstractDBMeta { private static final PersonDbm _instance = new PersonDbm(); @@ -188,40 +188,14 @@ return _columnVersionno; } - { - initializeColumnInfoList(); - } - //========================================================================== // ========= - // Name Map - // ======== - public Map getDbNamePropertyNameKeyToLowerMap() { - return createDbNamePropertyNameKeyToLowerMap(); + // Resource Initialization + // ======================= + { + initializeInformationResource(); } - public Map getPropertyNameDbNameKeyToLowerMap() { - return createPropertyNameDbNameKeyToLowerMap(); - } - - protected static Map _dbNamePropertyNameKeyToLowerMap; - - protected Map createDbNamePropertyNameKeyToLowerMap() { - if (_dbNamePropertyNameKeyToLowerMap == null) { - _dbNamePropertyNameKeyToLowerMap = setupKeyToLowerMap(true); - } - return _dbNamePropertyNameKeyToLowerMap; - } - - protected static Map _propertyNameDbNameKeyToLowerMap; - - protected Map createPropertyNameDbNameKeyToLowerMap() { - if (_propertyNameDbNameKeyToLowerMap == null) { - _propertyNameDbNameKeyToLowerMap = setupKeyToLowerMap(false); - } - return _propertyNameDbNameKeyToLowerMap; - } - //========================================================================== // ========= // Type Name @@ -407,7 +381,8 @@ // Entity Property Setup // ===================== // It's very INTERNAL! - protected Map> _epsMap = newHashMap(); + protected Map> _epsMap = StringKeyMap + .createAsFlexibleConcurrent(); { setupEps(_epsMap, new EpsId(), columnId()); setupEps(_epsMap, new EpsUserId(), columnUserId()); Modified: addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/bsentity/dbmeta/PostalDbm.java =================================================================== --- addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/bsentity/dbmeta/PostalDbm.java 2008-12-27 22:02:56 UTC (rev 1623) +++ addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/bsentity/dbmeta/PostalDbm.java 2008-12-27 22:06:42 UTC (rev 1624) @@ -8,6 +8,7 @@ import jp.sf.pal.addresslist.db.allcommon.dbmeta.info.ColumnInfo; import jp.sf.pal.addresslist.db.allcommon.dbmeta.info.ForeignInfo; import jp.sf.pal.addresslist.db.allcommon.dbmeta.info.UniqueInfo; +import jp.sf.pal.addresslist.db.allcommon.helper.StringKeyMap; import jp.sf.pal.addresslist.db.exentity.Postal; /** @@ -15,7 +16,6 @@ * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public class PostalDbm extends AbstractDBMeta { private static final PostalDbm _instance = new PostalDbm(); @@ -96,40 +96,14 @@ return _columnCountry; } - { - initializeColumnInfoList(); - } - //========================================================================== // ========= - // Name Map - // ======== - public Map getDbNamePropertyNameKeyToLowerMap() { - return createDbNamePropertyNameKeyToLowerMap(); + // Resource Initialization + // ======================= + { + initializeInformationResource(); } - public Map getPropertyNameDbNameKeyToLowerMap() { - return createPropertyNameDbNameKeyToLowerMap(); - } - - protected static Map _dbNamePropertyNameKeyToLowerMap; - - protected Map createDbNamePropertyNameKeyToLowerMap() { - if (_dbNamePropertyNameKeyToLowerMap == null) { - _dbNamePropertyNameKeyToLowerMap = setupKeyToLowerMap(true); - } - return _dbNamePropertyNameKeyToLowerMap; - } - - protected static Map _propertyNameDbNameKeyToLowerMap; - - protected Map createPropertyNameDbNameKeyToLowerMap() { - if (_propertyNameDbNameKeyToLowerMap == null) { - _propertyNameDbNameKeyToLowerMap = setupKeyToLowerMap(false); - } - return _propertyNameDbNameKeyToLowerMap; - } - //========================================================================== // ========= // Type Name @@ -285,7 +259,8 @@ // Entity Property Setup // ===================== // It's very INTERNAL! - protected Map> _epsMap = newHashMap(); + protected Map> _epsMap = StringKeyMap + .createAsFlexibleConcurrent(); { setupEps(_epsMap, new EpsPersonId(), columnPersonId()); setupEps(_epsMap, new EpsBuilding(), columnBuilding()); Modified: addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/bsentity/dbmeta/RoleInfoDbm.java =================================================================== --- addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/bsentity/dbmeta/RoleInfoDbm.java 2008-12-27 22:02:56 UTC (rev 1623) +++ addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/bsentity/dbmeta/RoleInfoDbm.java 2008-12-27 22:06:42 UTC (rev 1624) @@ -8,6 +8,7 @@ import jp.sf.pal.addresslist.db.allcommon.dbmeta.info.ColumnInfo; import jp.sf.pal.addresslist.db.allcommon.dbmeta.info.ReferrerInfo; import jp.sf.pal.addresslist.db.allcommon.dbmeta.info.UniqueInfo; +import jp.sf.pal.addresslist.db.allcommon.helper.StringKeyMap; import jp.sf.pal.addresslist.db.exentity.RoleInfo; /** @@ -15,7 +16,6 @@ * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public class RoleInfoDbm extends AbstractDBMeta { private static final RoleInfoDbm _instance = new RoleInfoDbm(); @@ -138,40 +138,14 @@ return _columnVersionno; } - { - initializeColumnInfoList(); - } - //========================================================================== // ========= - // Name Map - // ======== - public Map getDbNamePropertyNameKeyToLowerMap() { - return createDbNamePropertyNameKeyToLowerMap(); + // Resource Initialization + // ======================= + { + initializeInformationResource(); } - public Map getPropertyNameDbNameKeyToLowerMap() { - return createPropertyNameDbNameKeyToLowerMap(); - } - - protected static Map _dbNamePropertyNameKeyToLowerMap; - - protected Map createDbNamePropertyNameKeyToLowerMap() { - if (_dbNamePropertyNameKeyToLowerMap == null) { - _dbNamePropertyNameKeyToLowerMap = setupKeyToLowerMap(true); - } - return _dbNamePropertyNameKeyToLowerMap; - } - - protected static Map _propertyNameDbNameKeyToLowerMap; - - protected Map createPropertyNameDbNameKeyToLowerMap() { - if (_propertyNameDbNameKeyToLowerMap == null) { - _propertyNameDbNameKeyToLowerMap = setupKeyToLowerMap(false); - } - return _propertyNameDbNameKeyToLowerMap; - } - //========================================================================== // ========= // Type Name @@ -341,7 +315,8 @@ // Entity Property Setup // ===================== // It's very INTERNAL! - protected Map> _epsMap = newHashMap(); + protected Map> _epsMap = StringKeyMap + .createAsFlexibleConcurrent(); { setupEps(_epsMap, new EpsRoleId(), columnRoleId()); setupEps(_epsMap, new EpsName(), columnName()); Modified: addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/bsentity/dbmeta/RoleMappingDbm.java =================================================================== --- addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/bsentity/dbmeta/RoleMappingDbm.java 2008-12-27 22:02:56 UTC (rev 1623) +++ addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/bsentity/dbmeta/RoleMappingDbm.java 2008-12-27 22:06:42 UTC (rev 1624) @@ -8,6 +8,7 @@ import jp.sf.pal.addresslist.db.allcommon.dbmeta.info.ColumnInfo; import jp.sf.pal.addresslist.db.allcommon.dbmeta.info.ForeignInfo; import jp.sf.pal.addresslist.db.allcommon.dbmeta.info.UniqueInfo; +import jp.sf.pal.addresslist.db.allcommon.helper.StringKeyMap; import jp.sf.pal.addresslist.db.exentity.RoleMapping; /** @@ -15,7 +16,6 @@ * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public class RoleMappingDbm extends AbstractDBMeta { private static final RoleMappingDbm _instance = new RoleMappingDbm(); @@ -68,40 +68,14 @@ return _columnRoleId; } - { - initializeColumnInfoList(); - } - //========================================================================== // ========= - // Name Map - // ======== - public Map getDbNamePropertyNameKeyToLowerMap() { - return createDbNamePropertyNameKeyToLowerMap(); + // Resource Initialization + // ======================= + { + initializeInformationResource(); } - public Map getPropertyNameDbNameKeyToLowerMap() { - return createPropertyNameDbNameKeyToLowerMap(); - } - - protected static Map _dbNamePropertyNameKeyToLowerMap; - - protected Map createDbNamePropertyNameKeyToLowerMap() { - if (_dbNamePropertyNameKeyToLowerMap == null) { - _dbNamePropertyNameKeyToLowerMap = setupKeyToLowerMap(true); - } - return _dbNamePropertyNameKeyToLowerMap; - } - - protected static Map _propertyNameDbNameKeyToLowerMap; - - protected Map createPropertyNameDbNameKeyToLowerMap() { - if (_propertyNameDbNameKeyToLowerMap == null) { - _propertyNameDbNameKeyToLowerMap = setupKeyToLowerMap(false); - } - return _propertyNameDbNameKeyToLowerMap; - } - //========================================================================== // ========= // Type Name @@ -263,7 +237,8 @@ // Entity Property Setup // ===================== // It's very INTERNAL! - protected Map> _epsMap = newHashMap(); + protected Map> _epsMap = StringKeyMap + .createAsFlexibleConcurrent(); { setupEps(_epsMap, new EpsId(), columnId()); setupEps(_epsMap, new EpsUserId(), columnUserId()); Modified: addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/bsentity/dbmeta/UserInfoDbm.java =================================================================== --- addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/bsentity/dbmeta/UserInfoDbm.java 2008-12-27 22:02:56 UTC (rev 1623) +++ addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/bsentity/dbmeta/UserInfoDbm.java 2008-12-27 22:06:42 UTC (rev 1624) @@ -9,6 +9,7 @@ import jp.sf.pal.addresslist.db.allcommon.dbmeta.info.ForeignInfo; import jp.sf.pal.addresslist.db.allcommon.dbmeta.info.ReferrerInfo; import jp.sf.pal.addresslist.db.allcommon.dbmeta.info.UniqueInfo; +import jp.sf.pal.addresslist.db.allcommon.helper.StringKeyMap; import jp.sf.pal.addresslist.db.exentity.UserInfo; /** @@ -16,7 +17,6 @@ * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public class UserInfoDbm extends AbstractDBMeta { private static final UserInfoDbm _instance = new UserInfoDbm(); @@ -93,6 +93,9 @@ protected ColumnInfo _columnGroupId = cci("GROUP_ID", "groupId", String.class, false, 255, 0); + protected ColumnInfo _columnStatus = cci("STATUS", "status", String.class, + false, 1, 0); + protected ColumnInfo _columnCreatedTime = cci("CREATED_TIME", "createdTime", java.sql.Timestamp.class, false, null, null); @@ -174,6 +177,10 @@ return _columnGroupId; } + public ColumnInfo columnStatus() { + return _columnStatus; + } + public ColumnInfo columnCreatedTime() { return _columnCreatedTime; } @@ -202,40 +209,14 @@ return _columnVersionno; } - { - initializeColumnInfoList(); - } - //========================================================================== // ========= - // Name Map - // ======== - public Map getDbNamePropertyNameKeyToLowerMap() { - return createDbNamePropertyNameKeyToLowerMap(); + // Resource Initialization + // ======================= + { + initializeInformationResource(); } - public Map getPropertyNameDbNameKeyToLowerMap() { - return createPropertyNameDbNameKeyToLowerMap(); - } - - protected static Map _dbNamePropertyNameKeyToLowerMap; - - protected Map createDbNamePropertyNameKeyToLowerMap() { - if (_dbNamePropertyNameKeyToLowerMap == null) { - _dbNamePropertyNameKeyToLowerMap = setupKeyToLowerMap(true); - } - return _dbNamePropertyNameKeyToLowerMap; - } - - protected static Map _propertyNameDbNameKeyToLowerMap; - - protected Map createPropertyNameDbNameKeyToLowerMap() { - if (_propertyNameDbNameKeyToLowerMap == null) { - _propertyNameDbNameKeyToLowerMap = setupKeyToLowerMap(false); - } - return _propertyNameDbNameKeyToLowerMap; - } - //========================================================================== // ========= // Type Name @@ -429,7 +410,8 @@ // Entity Property Setup // ===================== // It's very INTERNAL! - protected Map> _epsMap = newHashMap(); + protected Map> _epsMap = StringKeyMap + .createAsFlexibleConcurrent(); { setupEps(_epsMap, new EpsUserId(), columnUserId()); setupEps(_epsMap, new EpsGivenName(), columnGivenName()); @@ -446,6 +428,7 @@ setupEps(_epsMap, new EpsLocale(), columnLocale()); setupEps(_epsMap, new EpsRoleId(), columnRoleId()); setupEps(_epsMap, new EpsGroupId(), columnGroupId()); + setupEps(_epsMap, new EpsStatus(), columnStatus()); setupEps(_epsMap, new EpsCreatedTime(), columnCreatedTime()); setupEps(_epsMap, new EpsCreatedBy(), columnCreatedBy()); setupEps(_epsMap, new EpsUpdatedTime(), columnUpdatedTime()); @@ -554,6 +537,12 @@ } } + public static class EpsStatus implements Eps { + public void setup(UserInfo e, Object v) { + e.setStatus((String) v); + } + } + public static class EpsCreatedTime implements Eps { public void setup(UserInfo e, Object v) { e.setCreatedTime((java.sql.Timestamp) v); Modified: addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/cbean/bs/BsCompanyCB.java =================================================================== --- addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/cbean/bs/BsCompanyCB.java 2008-12-27 22:02:56 UTC (rev 1623) +++ addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/cbean/bs/BsCompanyCB.java 2008-12-27 22:06:42 UTC (rev 1624) @@ -19,7 +19,6 @@ * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public class BsCompanyCB extends AbstractConditionBean { //========================================================================== @@ -87,7 +86,12 @@ return _conditionQuery; } - public ConditionQuery getConditionQueryAsInterface() { + /** + * The implementation. + * + * @return The conditionQuery of the local table as interface. (NotNull) + */ + public ConditionQuery localCQ() { return getConditionQuery(); } @@ -137,22 +141,6 @@ query().xsetUnionAllQuery(cq); } - /** - * @param unionQuery The query of 'union'. (NotNull) - * @deprecated Sorry! Please use union(UnionQuery unionQuery). - */ - public void union(CompanyCQ unionQuery) { - query().xsetUnionQuery(unionQuery); - } - - /** - * @param unionQuery The query of 'union'. (NotNull) - * @deprecated Sorry! Please use unionAll(UnionQuery unionQuery). - */ - public void unionAll(CompanyCQ unionQuery) { - query().xsetUnionAllQuery(unionQuery); - } - public boolean hasUnionQueryOrUnionAllQuery() { return query().hasUnionQueryOrUnionAllQuery(); } @@ -161,7 +149,6 @@ // ========= // Setup Select // ============ - protected UserInfoNss _nssUserInfo; public UserInfoNss getNssUserInfo() { @@ -200,7 +187,7 @@ public CompanyCQ qy() { return query(); } - }, _forDeriveReferrer); + }, _forDerivedReferrer, _forScalarSelect, _forScalarSubQuery); } return _specification; } @@ -211,8 +198,10 @@ protected UserInfoCB.Specification _userInfo; public Specification(ConditionBean baseCB, SpQyCall qyCall, - boolean forDeriveReferrer) { - super(baseCB, qyCall, forDeriveReferrer); + boolean forDeriveReferrer, boolean forScalarSelect, + boolean forScalarSubQuery) { + super(baseCB, qyCall, forDeriveReferrer, forScalarSelect, + forScalarSubQuery); _myQyCall = qyCall; } @@ -337,7 +326,8 @@ public UserInfoCQ qy() { return _myQyCall.qy().queryUserInfo(); } - }, _forDeriveReferrer); + }, _forDerivedReferrer, _forScalarSelect, + _forScalarSubQuery); } return _userInfo; } Modified: addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/cbean/bs/BsContactCB.java =================================================================== --- addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/cbean/bs/BsContactCB.java 2008-12-27 22:02:56 UTC (rev 1623) +++ addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/cbean/bs/BsContactCB.java 2008-12-27 22:06:42 UTC (rev 1624) @@ -18,7 +18,6 @@ * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public class BsContactCB extends AbstractConditionBean { //========================================================================== @@ -86,7 +85,12 @@ return _conditionQuery; } - public ConditionQuery getConditionQueryAsInterface() { + /** + * The implementation. + * + * @return The conditionQuery of the local table as interface. (NotNull) + */ + public ConditionQuery localCQ() { return getConditionQuery(); } @@ -136,22 +140,6 @@ query().xsetUnionAllQuery(cq); } - /** - * @param unionQuery The query of 'union'. (NotNull) - * @deprecated Sorry! Please use union(UnionQuery unionQuery). - */ - public void union(ContactCQ unionQuery) { - query().xsetUnionQuery(unionQuery); - } - - /** - * @param unionQuery The query of 'union'. (NotNull) - * @deprecated Sorry! Please use unionAll(UnionQuery unionQuery). - */ - public void unionAll(ContactCQ unionQuery) { - query().xsetUnionAllQuery(unionQuery); - } - public boolean hasUnionQueryOrUnionAllQuery() { return query().hasUnionQueryOrUnionAllQuery(); } @@ -160,7 +148,6 @@ // ========= // Setup Select // ============ - protected PersonNss _nssPerson; public PersonNss getNssPerson() { @@ -199,7 +186,7 @@ public ContactCQ qy() { return query(); } - }, _forDeriveReferrer); + }, _forDerivedReferrer, _forScalarSelect, _forScalarSubQuery); } return _specification; } @@ -210,8 +197,10 @@ protected PersonCB.Specification _person; public Specification(ConditionBean baseCB, SpQyCall qyCall, - boolean forDeriveReferrer) { - super(baseCB, qyCall, forDeriveReferrer); + boolean forDeriveReferrer, boolean forScalarSelect, + boolean forScalarSubQuery) { + super(baseCB, qyCall, forDeriveReferrer, forScalarSelect, + forScalarSubQuery); _myQyCall = qyCall; } @@ -256,7 +245,8 @@ public PersonCQ qy() { return _myQyCall.qy().queryPerson(); } - }, _forDeriveReferrer); + }, _forDerivedReferrer, _forScalarSelect, + _forScalarSubQuery); } return _person; } Modified: addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/cbean/bs/BsCustomCB.java =================================================================== --- addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/cbean/bs/BsCustomCB.java 2008-12-27 22:02:56 UTC (rev 1623) +++ addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/cbean/bs/BsCustomCB.java 2008-12-27 22:06:42 UTC (rev 1624) @@ -18,7 +18,6 @@ * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public class BsCustomCB extends AbstractConditionBean { //========================================================================== @@ -86,7 +85,12 @@ return _conditionQuery; } - public ConditionQuery getConditionQueryAsInterface() { + /** + * The implementation. + * + * @return The conditionQuery of the local table as interface. (NotNull) + */ + public ConditionQuery localCQ() { return getConditionQuery(); } @@ -136,22 +140,6 @@ query().xsetUnionAllQuery(cq); } - /** - * @param unionQuery The query of 'union'. (NotNull) - * @deprecated Sorry! Please use union(UnionQuery unionQuery). - */ - public void union(CustomCQ unionQuery) { - query().xsetUnionQuery(unionQuery); - } - - /** - * @param unionQuery The query of 'union'. (NotNull) - * @deprecated Sorry! Please use unionAll(UnionQuery unionQuery). - */ - public void unionAll(CustomCQ unionQuery) { - query().xsetUnionAllQuery(unionQuery); - } - public boolean hasUnionQueryOrUnionAllQuery() { return query().hasUnionQueryOrUnionAllQuery(); } @@ -160,7 +148,6 @@ // ========= // Setup Select // ============ - protected PersonNss _nssPerson; public PersonNss getNssPerson() { @@ -199,7 +186,7 @@ public CustomCQ qy() { return query(); } - }, _forDeriveReferrer); + }, _forDerivedReferrer, _forScalarSelect, _forScalarSubQuery); } return _specification; } @@ -210,8 +197,10 @@ protected PersonCB.Specification _person; public Specification(ConditionBean baseCB, SpQyCall qyCall, - boolean forDeriveReferrer) { - super(baseCB, qyCall, forDeriveReferrer); + boolean forDeriveReferrer, boolean forScalarSelect, + boolean forScalarSubQuery) { + super(baseCB, qyCall, forDeriveReferrer, forScalarSelect, + forScalarSubQuery); _myQyCall = qyCall; } @@ -256,7 +245,8 @@ public PersonCQ qy() { return _myQyCall.qy().queryPerson(); } - }, _forDeriveReferrer); + }, _forDerivedReferrer, _forScalarSelect, + _forScalarSubQuery); } return _person; } Modified: addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/cbean/bs/BsGroupInfoCB.java =================================================================== --- addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/cbean/bs/BsGroupInfoCB.java 2008-12-27 22:02:56 UTC (rev 1623) +++ addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/cbean/bs/BsGroupInfoCB.java 2008-12-27 22:06:42 UTC (rev 1624) @@ -17,7 +17,6 @@ * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public class BsGroupInfoCB extends AbstractConditionBean { //========================================================================== @@ -86,7 +85,12 @@ return _conditionQuery; } - public ConditionQuery getConditionQueryAsInterface() { + /** + * The implementation. + * + * @return The conditionQuery of the local table as interface. (NotNull) + */ + public ConditionQuery localCQ() { return getConditionQuery(); } @@ -136,23 +140,6 @@ query().xsetUnionAllQuery(cq); } - /** - * @param unionQuery The query of 'union'. (NotNull) - * @deprecated Sorry! Please use union(UnionQuery unionQuery). - */ - public void union(GroupInfoCQ unionQuery) { - query().xsetUnionQuery(unionQuery); - } - - /** - * @param unionQuery The query of 'union'. (NotNull) - * @deprecated Sorry! Please use unionAll(UnionQuery - * unionQuery). - */ - public void unionAll(GroupInfoCQ unionQuery) { - query().xsetUnionAllQuery(unionQuery); - } - public boolean hasUnionQueryOrUnionAllQuery() { return query().hasUnionQueryOrUnionAllQuery(); } @@ -180,7 +167,8 @@ public GroupInfoCQ qy() { return query(); } - }, _forDeriveReferrer); + }, _forDerivedReferrer, _forScalarSelect, + _forScalarSubQuery); } return _specification; } @@ -190,8 +178,10 @@ protected SpQyCall _myQyCall; public Specification(ConditionBean baseCB, - SpQyCall qyCall, boolean forDeriveReferrer) { - super(baseCB, qyCall, forDeriveReferrer); + SpQyCall qyCall, boolean forDeriveReferrer, + boolean forScalarSelect, boolean forScalarSubQuery) { + super(baseCB, qyCall, forDeriveReferrer, forScalarSelect, + forScalarSubQuery); _myQyCall = qyCall; } Modified: addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/cbean/bs/BsGroupMappingCB.java =================================================================== --- addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/cbean/bs/BsGroupMappingCB.java 2008-12-27 22:02:56 UTC (rev 1623) +++ addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/cbean/bs/BsGroupMappingCB.java 2008-12-27 22:06:42 UTC (rev 1624) @@ -21,7 +21,6 @@ * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public class BsGroupMappingCB extends AbstractConditionBean { //========================================================================== @@ -89,7 +88,12 @@ return _conditionQuery; } - public ConditionQuery getConditionQueryAsInterface() { + /** + * The implementation. + * + * @return The conditionQuery of the local table as interface. (NotNull) + */ + public ConditionQuery localCQ() { return getConditionQuery(); } @@ -139,24 +143,6 @@ query().xsetUnionAllQuery(cq); } - /** - * @param unionQuery The query of 'union'. (NotNull) - * @deprecated Sorry! Please use union(UnionQuery - * unionQuery). - */ - public void union(GroupMappingCQ unionQuery) { - query().xsetUnionQuery(unionQuery); - } - - /** - * @param unionQuery The query of 'union'. (NotNull) - * @deprecated Sorry! Please use unionAll(UnionQuery - * unionQuery). - */ - public void unionAll(GroupMappingCQ unionQuery) { - query().xsetUnionAllQuery(unionQuery); - } - public boolean hasUnionQueryOrUnionAllQuery() { return query().hasUnionQueryOrUnionAllQuery(); } @@ -165,7 +151,6 @@ // ========= // Setup Select // ============ - protected GroupInfoNss _nssGroupInfo; public GroupInfoNss getNssGroupInfo() { @@ -226,7 +211,8 @@ public GroupMappingCQ qy() { return query(); } - }, _forDeriveReferrer); + }, _forDerivedReferrer, _forScalarSelect, + _forScalarSubQuery); } return _specification; } @@ -240,8 +226,10 @@ protected UserInfoCB.Specification _userInfo; public Specification(ConditionBean baseCB, - SpQyCall qyCall, boolean forDeriveReferrer) { - super(baseCB, qyCall, forDeriveReferrer); + SpQyCall qyCall, boolean forDeriveReferrer, + boolean forScalarSelect, boolean forScalarSubQuery) { + super(baseCB, qyCall, forDeriveReferrer, forScalarSelect, + forScalarSubQuery); _myQyCall = qyCall; } @@ -285,7 +273,8 @@ public GroupInfoCQ qy() { return _myQyCall.qy().queryGroupInfo(); } - }, _forDeriveReferrer); + }, _forDerivedReferrer, _forScalarSelect, + _forScalarSubQuery); } return _groupInfo; } @@ -304,7 +293,8 @@ public UserInfoCQ qy() { return _myQyCall.qy().queryUserInfo(); } - }, _forDeriveReferrer); + }, _forDerivedReferrer, _forScalarSelect, + _forScalarSubQuery); } return _userInfo; } Modified: addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/cbean/bs/BsPersonCB.java =================================================================== --- addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/cbean/bs/BsPersonCB.java 2008-12-27 22:02:56 UTC (rev 1623) +++ addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/cbean/bs/BsPersonCB.java 2008-12-27 22:06:42 UTC (rev 1624) @@ -26,7 +26,6 @@ * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public class BsPersonCB extends AbstractConditionBean { //========================================================================== @@ -94,7 +93,12 @@ return _conditionQuery; } - public ConditionQuery getConditionQueryAsInterface() { + /** + * The implementation. + * + * @return The conditionQuery of the local table as interface. (NotNull) + */ + public ConditionQuery localCQ() { return getConditionQuery(); } @@ -144,22 +148,6 @@ query().xsetUnionAllQuery(cq); } - /** - * @param unionQuery The query of 'union'. (NotNull) - * @deprecated Sorry! Please use union(UnionQuery unionQuery). - */ - public void union(PersonCQ unionQuery) { - query().xsetUnionQuery(unionQuery); - } - - /** - * @param unionQuery The query of 'union'. (NotNull) - * @deprecated Sorry! Please use unionAll(UnionQuery unionQuery). - */ - public void unionAll(PersonCQ unionQuery) { - query().xsetUnionAllQuery(unionQuery); - } - public boolean hasUnionQueryOrUnionAllQuery() { return query().hasUnionQueryOrUnionAllQuery(); } @@ -168,7 +156,6 @@ // ========= // Setup Select // ============ - protected CompanyNss _nssCompany; public CompanyNss getNssCompany() { @@ -249,7 +236,7 @@ public PersonCQ qy() { return query(); } - }, _forDeriveReferrer); + }, _forDerivedReferrer, _forScalarSelect, _forScalarSubQuery); } return _specification; } @@ -264,8 +251,10 @@ protected PostalCB.Specification _postalAsOne; public Specification(ConditionBean baseCB, SpQyCall qyCall, - boolean forDeriveReferrer) { - super(baseCB, qyCall, forDeriveReferrer); + boolean forDeriveReferrer, boolean forScalarSelect, + boolean forScalarSubQuery) { + super(baseCB, qyCall, forDeriveReferrer, forScalarSelect, + forScalarSubQuery); _myQyCall = qyCall; } @@ -377,7 +366,8 @@ public CompanyCQ qy() { return _myQyCall.qy().queryCompany(); } - }, _forDeriveReferrer); + }, _forDerivedReferrer, _forScalarSelect, + _forScalarSubQuery); } return _company; } @@ -396,7 +386,8 @@ public UserInfoCQ qy() { return _myQyCall.qy().queryUserInfo(); } - }, _forDeriveReferrer); + }, _forDerivedReferrer, _forScalarSelect, + _forScalarSubQuery); } return _userInfo; } @@ -404,7 +395,8 @@ public PostalCB.Specification specifyPostalAsOne() { assertForeign("postalAsOne"); if (_postalAsOne == null) { - _postalAsOne = new PostalCB.Specification(_baseCB, + _postalAsOne = new PostalCB.Specification( + _baseCB, new SpQyCall() { public boolean has() { return _myQyCall.has() @@ -415,7 +407,8 @@ public PostalCQ qy() { return _myQyCall.qy().queryPostalAsOne(); } - }, _forDeriveReferrer); + }, _forDerivedReferrer, _forScalarSelect, + _forScalarSubQuery); } return _postalAsOne; } Modified: addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/cbean/bs/BsPostalCB.java =================================================================== --- addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/cbean/bs/BsPostalCB.java 2008-12-27 22:02:56 UTC (rev 1623) +++ addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/cbean/bs/BsPostalCB.java 2008-12-27 22:06:42 UTC (rev 1624) @@ -18,7 +18,6 @@ * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public class BsPostalCB extends AbstractConditionBean { //========================================================================== @@ -86,7 +85,12 @@ return _conditionQuery; } - public ConditionQuery getConditionQueryAsInterface() { + /** + * The implementation. + * + * @return The conditionQuery of the local table as interface. (NotNull) + */ + public ConditionQuery localCQ() { return getConditionQuery(); } @@ -136,22 +140,6 @@ query().xsetUnionAllQuery(cq); } - /** - * @param unionQuery The query of 'union'. (NotNull) - * @deprecated Sorry! Please use union(UnionQuery unionQuery). - */ - public void union(PostalCQ unionQuery) { - query().xsetUnionQuery(unionQuery); - } - - /** - * @param unionQuery The query of 'union'. (NotNull) - * @deprecated Sorry! Please use unionAll(UnionQuery unionQuery). - */ - public void unionAll(PostalCQ unionQuery) { - query().xsetUnionAllQuery(unionQuery); - } - public boolean hasUnionQueryOrUnionAllQuery() { return query().hasUnionQueryOrUnionAllQuery(); } @@ -160,7 +148,6 @@ // ========= // Setup Select // ============ - protected PersonNss _nssPerson; public PersonNss getNssPerson() { @@ -199,7 +186,7 @@ public PostalCQ qy() { return query(); } - }, _forDeriveReferrer); + }, _forDerivedReferrer, _forScalarSelect, _forScalarSubQuery); } return _specification; } @@ -210,8 +197,10 @@ protected PersonCB.Specification _person; public Specification(ConditionBean baseCB, SpQyCall qyCall, - boolean forDeriveReferrer) { - super(baseCB, qyCall, forDeriveReferrer); + boolean forDeriveReferrer, boolean forScalarSelect, + boolean forScalarSubQuery) { + super(baseCB, qyCall, forDeriveReferrer, forScalarSelect, + forScalarSubQuery); _myQyCall = qyCall; } @@ -267,7 +256,8 @@ public PersonCQ qy() { return _myQyCall.qy().queryPerson(); } - }, _forDeriveReferrer); + }, _forDerivedReferrer, _forScalarSelect, + _forScalarSubQuery); } return _person; } Modified: addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/cbean/bs/BsRoleInfoCB.java =================================================================== --- addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/cbean/bs/BsRoleInfoCB.java 2008-12-27 22:02:56 UTC (rev 1623) +++ addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/cbean/bs/BsRoleInfoCB.java 2008-12-27 22:06:42 UTC (rev 1624) @@ -17,7 +17,6 @@ * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public class BsRoleInfoCB extends AbstractConditionBean { //========================================================================== @@ -86,7 +85,12 @@ return _conditionQuery; } - public ConditionQuery getConditionQueryAsInterface() { + /** + * The implementation. + * + * @return The conditionQuery of the local table as interface. (NotNull) + */ + public ConditionQuery localCQ() { return getConditionQuery(); } @@ -136,23 +140,6 @@ query().xsetUnionAllQuery(cq); } - /** - * @param unionQuery The query of 'union'. (NotNull) - * @deprecated Sorry! Please use union(UnionQuery unionQuery). - */ - public void union(RoleInfoCQ unionQuery) { - query().xsetUnionQuery(unionQuery); - } - - /** - * @param unionQuery The query of 'union'. (NotNull) - * @deprecated Sorry! Please use unionAll(UnionQuery - * unionQuery). - */ - public void unionAll(RoleInfoCQ unionQuery) { - query().xsetUnionAllQuery(unionQuery); - } - public boolean hasUnionQueryOrUnionAllQuery() { return query().hasUnionQueryOrUnionAllQuery(); } @@ -180,7 +167,8 @@ public RoleInfoCQ qy() { return query(); } - }, _forDeriveReferrer); + }, _forDerivedReferrer, _forScalarSelect, + _forScalarSubQuery); } return _specification; } @@ -189,8 +177,10 @@ protected SpQyCall _myQyCall; public Specification(ConditionBean baseCB, SpQyCall qyCall, - boolean forDeriveReferrer) { - super(baseCB, qyCall, forDeriveReferrer); + boolean forDeriveReferrer, boolean forScalarSelect, + boolean forScalarSubQuery) { + super(baseCB, qyCall, forDeriveReferrer, forScalarSelect, + forScalarSubQuery); _myQyCall = qyCall; } Modified: addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/cbean/bs/BsRoleMappingCB.java =================================================================== --- addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/cbean/bs/BsRoleMappingCB.java 2008-12-27 22:02:56 UTC (rev 1623) +++ addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/cbean/bs/BsRoleMappingCB.java 2008-12-27 22:06:42 UTC (rev 1624) @@ -21,7 +21,6 @@ * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public class BsRoleMappingCB extends AbstractConditionBean { //========================================================================== @@ -89,7 +88,12 @@ return _conditionQuery; } - public ConditionQuery getConditionQueryAsInterface() { + /** + * The implementation. + * + * @return The conditionQuery of the local table as interface. (NotNull) + */ + public ConditionQuery localCQ() { return getConditionQuery(); } @@ -139,24 +143,6 @@ query().xsetUnionAllQuery(cq); } - /** - * @param unionQuery The query of 'union'. (NotNull) - * @deprecated Sorry! Please use union(UnionQuery - * unionQuery). - */ - public void union(RoleMappingCQ unionQuery) { - query().xsetUnionQuery(unionQuery); - } - - /** - * @param unionQuery The query of 'union'. (NotNull) - * @deprecated Sorry! Please use unionAll(UnionQuery - * unionQuery). - */ - public void unionAll(RoleMappingCQ unionQuery) { - query().xsetUnionAllQuery(unionQuery); - } - public boolean hasUnionQueryOrUnionAllQuery() { return query().hasUnionQueryOrUnionAllQuery(); } @@ -165,7 +151,6 @@ // ========= // Setup Select // ============ - protected RoleInfoNss _nssRoleInfo; public RoleInfoNss getNssRoleInfo() { @@ -226,7 +211,8 @@ public RoleMappingCQ qy() { return query(); } - }, _forDeriveReferrer); + }, _forDerivedReferrer, _forScalarSelect, + _forScalarSubQuery); } return _specification; } @@ -240,8 +226,10 @@ protected UserInfoCB.Specification _userInfo; public Specification(ConditionBean baseCB, - SpQyCall qyCall, boolean forDeriveReferrer) { - super(baseCB, qyCall, forDeriveReferrer); + SpQyCall qyCall, boolean forDeriveReferrer, + boolean forScalarSelect, boolean forScalarSubQuery) { + super(baseCB, qyCall, forDeriveReferrer, forScalarSelect, + forScalarSubQuery); _myQyCall = qyCall; } @@ -285,7 +273,8 @@ public RoleInfoCQ qy() { return _myQyCall.qy().queryRoleInfo(); } - }, _forDeriveReferrer); + }, _forDerivedReferrer, _forScalarSelect, + _forScalarSubQuery); } return _roleInfo; } @@ -304,7 +293,8 @@ public UserInfoCQ qy() { return _myQyCall.qy().queryUserInfo(); } - }, _forDeriveReferrer); + }, _forDerivedReferrer, _forScalarSelect, + _forScalarSubQuery); } return _userInfo; } Modified: addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/cbean/bs/BsUserInfoCB.java =================================================================== --- addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/cbean/bs/BsUserInfoCB.java 2008-12-27 22:02:56 UTC (rev 1623) +++ addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/cbean/bs/BsUserInfoCB.java 2008-12-27 22:06:42 UTC (rev 1624) @@ -25,7 +25,6 @@ * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public class BsUserInfoCB extends AbstractConditionBean { //========================================================================== @@ -94,7 +93,12 @@ return _conditionQuery; } - public ConditionQuery getConditionQueryAsInterface() { + /** + * The implementation. + * + * @return The conditionQuery of the local table as interface. (NotNull) + */ + public ConditionQuery localCQ() { return getConditionQuery(); } @@ -144,23 +148,6 @@ query().xsetUnionAllQuery(cq); } - /** - * @param unionQuery The query of 'union'. (NotNull) - * @deprecated Sorry! Please use union(UnionQuery unionQuery). - */ - public void union(UserInfoCQ unionQuery) { - query().xsetUnionQuery(unionQuery); - } - - /** - * @param unionQuery The query of 'union'. (NotNull) - * @deprecated Sorry! Please use unionAll(UnionQuery - * unionQuery). - */ - public void unionAll(UserInfoCQ unionQuery) { - query().xsetUnionAllQuery(unionQuery); - } - public boolean hasUnionQueryOrUnionAllQuery() { return query().hasUnionQueryOrUnionAllQuery(); } @@ -169,7 +156,6 @@ // ========= // Setup Select // ============ - protected GroupInfoNss _nssGroupInfo; public GroupInfoNss getNssGroupInfo() { @@ -230,7 +216,8 @@ public UserInfoCQ qy() { return query(); } - }, _forDeriveReferrer); + }, _forDerivedReferrer, _forScalarSelect, + _forScalarSubQuery); } return _specification; } @@ -243,8 +230,10 @@ protected RoleInfoCB.Specification _roleInfo; public Specification(ConditionBean baseCB, SpQyCall qyCall, - boolean forDeriveReferrer) { - super(baseCB, qyCall, forDeriveReferrer); + boolean forDeriveReferrer, boolean forScalarSelect, + boolean forScalarSubQuery) { + super(baseCB, qyCall, forDeriveReferrer, forScalarSelect, + forScalarSubQuery); _myQyCall = qyCall; } @@ -308,6 +297,10 @@ doColumn("GROUP_ID"); } + public void columnStatus() { + doColumn("STATUS"); + } + public void columnCreatedTime() { doColumn("CREATED_TIME"); } @@ -364,7 +357,8 @@ public GroupInfoCQ qy() { return _myQyCall.qy().queryGroupInfo(); } - }, _forDeriveReferrer); + }, _forDerivedReferrer, _forScalarSelect, + _forScalarSubQuery); } return _groupInfo; } @@ -383,7 +377,8 @@ public RoleInfoCQ qy() { return _myQyCall.qy().queryRoleInfo(); } - }, _forDeriveReferrer); + }, _forDerivedReferrer, _forScalarSelect, + _forScalarSubQuery); } return _roleInfo; } Modified: addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/cbean/cq/bs/AbstractBsCompanyCQ.java =================================================================== --- addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/cbean/cq/bs/AbstractBsCompanyCQ.java 2008-12-27 22:02:56 UTC (rev 1623) +++ addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/cbean/cq/bs/AbstractBsCompanyCQ.java 2008-12-27 22:06:42 UTC (rev 1624) @@ -13,14 +13,12 @@ import jp.sf.pal.addresslist.db.cbean.UserInfoCB; import jp.sf.pal.addresslist.db.cbean.cq.CompanyCQ; import jp.sf.pal.addresslist.db.cbean.cq.PersonCQ; -import jp.sf.pal.addresslist.db.cbean.cq.UserInfoCQ; /** * The abstract condition-query of COMPANY. * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public abstract class AbstractBsCompanyCQ extends AbstractConditionQuery { //========================================================================== @@ -50,7 +48,8 @@ // ===== /** - * Equal(=). And NullIgnored, OnceRegistered. {PK : ID : NotNull : BIGINT} + * Equal(=). And NullIgnored, OnlyOnceRegistered. {PK : ID : NotNull : + * BIGINT} * * @param id The value of id as equal. */ @@ -59,7 +58,7 @@ } /** - * NotEqual(!=). And NullIgnored, OnceRegistered. + * NotEqual(!=). And NullIgnored, OnlyOnceRegistered. * * @param id The value of id as notEqual. */ @@ -68,7 +67,7 @@ } /** - * GreaterThan(>). And NullIgnored, OnceRegistered. + * GreaterThan(>). And NullIgnored, OnlyOnceRegistered. * * @param id The value of id as greaterThan. */ @@ -77,7 +76,7 @@ } /** - * LessThan(<). And NullIgnored, OnceRegistered. + * LessThan(<). And NullIgnored, OnlyOnceRegistered. * * @param id The value of id as lessThan. */ @@ -86,7 +85,7 @@ } /** - * GreaterEqual(>=). And NullIgnored, OnceRegistered. + * GreaterEqual(>=). And NullIgnored, OnlyOnceRegistered. * * @param id The value of id as greaterEqual. */ @@ -95,7 +94,7 @@ } /** - * LessEqual(<=). And NullIgnored, OnceRegistered. + * LessEqual(<=). And NullIgnored, OnlyOnceRegistered. * * @param id The value of id as lessEqual. */ @@ -123,33 +122,18 @@ regId(CK_NINS, cTL(idList)); } - /** - * @param personCBquery Query. - * @deprecated Please use inScopePersonList(subQuery) method. - */ - public void setId_InScopeSubQuery_PersonList(PersonCQ personCBquery) { - String subQueryPropertyName = keepId_InScopeSubQuery_PersonList(personCBquery);// for - // saving - // query - // - - // value - // . - registerInScopeSubQuery(personCBquery, "ID", "COMPANY_ID", - subQueryPropertyName); - } - public void inScopePersonList(SubQuery subQuery) { assertObjectNotNull("subQuery", subQuery); PersonCB cb = new PersonCB(); cb.xsetupForInScopeSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepId_InScopeSubQuery_PersonList(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerInScopeSubQuery(cb.query(), "ID", "COMPANY_ID", subQueryPropertyName); } - abstract public String keepId_InScopeSubQuery_PersonList(PersonCQ subQuery); + public abstract String keepId_InScopeSubQuery_PersonList(PersonCQ subQuery); public void notInScopePersonList(SubQuery subQuery) { assertObjectNotNull("subQuery", subQuery); @@ -157,30 +141,15 @@ cb.xsetupForInScopeSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepId_NotInScopeSubQuery_PersonList(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerNotInScopeSubQuery(cb.query(), "ID", "COMPANY_ID", subQueryPropertyName); } - abstract public String keepId_NotInScopeSubQuery_PersonList( + public abstract String keepId_NotInScopeSubQuery_PersonList( PersonCQ subQuery); /** - * @param personCBquery Query. - * @deprecated Please use existsPersonList(subQuery) method. - */ - public void setId_ExistsSubQuery_PersonList(PersonCQ personCBquery) { - String subQueryPropertyName = keepId_ExistsSubQuery_PersonList(personCBquery);// for - // saving - // query - // - - // value - // . - registerExistsSubQuery(personCBquery, "ID", "COMPANY_ID", - subQueryPropertyName); - } - - /** * Set up 'exists' sub-query. {exists (select COMPANY_ID from PERSON where * ...)} * @@ -193,12 +162,12 @@ cb.xsetupForExistsSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepId_ExistsSubQuery_PersonList(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerExistsSubQuery(cb.query(), "ID", "COMPANY_ID", subQueryPropertyName); } - abstract public String keepId_ExistsSubQuery_PersonList(PersonCQ subQuery); + public abstract String keepId_ExistsSubQuery_PersonList(PersonCQ subQuery); /** * Set up 'not exists' sub-query. {not exists (select COMPANY_ID from PERSON @@ -213,36 +182,36 @@ cb.xsetupForExistsSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepId_NotExistsSubQuery_PersonList(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerNotExistsSubQuery(cb.query(), "ID", "COMPANY_ID", subQueryPropertyName); } - abstract public String keepId_NotExistsSubQuery_PersonList(PersonCQ subQuery); + public abstract String keepId_NotExistsSubQuery_PersonList(PersonCQ subQuery); public void xderivePersonList(String function, SubQuery subQuery, String aliasName) { assertObjectNotNull("subQuery", subQuery); PersonCB cb = new PersonCB(); - cb.xsetupForDeriveReferrer(); + cb.xsetupForDerivedReferrer(); subQuery.query(cb); - String subQueryPropertyName = keepId_DeriveSubQuery_PersonList(cb - .query());// for saving query-value. - registerDeriveSubQuery(function, cb.query(), "ID", "COMPANY_ID", - subQueryPropertyName, aliasName); + String subQueryPropertyName = keepId_DerivedReferrer_PersonList(cb + .query()); // for saving query-value. + registerDerivedReferrerSubQuery(function, cb.query(), "ID", + "COMPANY_ID", subQueryPropertyName, aliasName); } - abstract public String keepId_DeriveSubQuery_PersonList(PersonCQ subQuery); + public abstract String keepId_DerivedReferrer_PersonList(PersonCQ subQuery); /** - * IsNull(is null). And OnceRegistered. + * IsNull(is null). And OnlyOnceRegistered. */ public void setId_IsNull() { regId(CK_ISN, DUMMY_OBJECT); } /** - * IsNotNull(is not null). And OnceRegistered. + * IsNotNull(is not null). And OnlyOnceRegistered. */ public void setId_IsNotNull() { regId(CK_ISNN, DUMMY_OBJECT); @@ -259,8 +228,8 @@ abstract protected ConditionValue getCValueId(); /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {VARCHAR(255) : FK to - * USER_INFO} + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {VARCHAR(255) : FK + * to USER_INFO} * * @param userId The value of userId as equal. */ @@ -269,7 +238,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param userId The value of userId as notEqual. */ @@ -278,7 +247,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param userId The value of userId as greaterThan. */ @@ -287,7 +256,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param userId The value of userId as lessThan. */ @@ -296,7 +265,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param userId The value of userId as greaterEqual. */ @@ -305,7 +274,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param userId The value of userId as lessEqual. */ @@ -314,7 +283,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param userId The value of userId as prefixSearch. */ @@ -323,20 +292,6 @@ } /** - * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, - * SeveralRegistered. - * - * @param userId The value of userId as likeSearch. - * @param likeSearchOption The option of like-search. (NotNull) - */ - public void setUserId_LikeSearch( - String userId, - jp.sf.pal.addresslist.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. * @@ -347,42 +302,41 @@ } /** - * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * - * @param userId The collection of userId as inScope. - * @param inScopeOption The option of in-scope. (NotNull) + * @param userIdList The collection of userId as notInScope. */ - public void setUserId_InScope( - String userId, - jp.sf.pal.addresslist.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(userId), getCValueUserId(), - "USER_ID", "UserId", "userId", inScopeOption); + public void setUserId_NotInScope(Collection userIdList) { + regUserId(CK_NINS, cTL(userIdList)); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param userIdList The collection of userId as notInScope. + * @param userId The value of userId as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) */ - public void setUserId_NotInScope(Collection userIdList) { - regUserId(CK_NINS, cTL(userIdList)); + public void setUserId_LikeSearch( + String userId, + jp.sf.pal.addresslist.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(userId), getCValueUserId(), "USER_ID", "UserId", + "userId", likeSearchOption); } /** - * @param userInfoCBquery Query. - * @deprecated Please use inScopeUserInfo(subQuery) method. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param userId The value of userId as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setUserId_InScopeSubQuery_UserInfo(UserInfoCQ userInfoCBquery) { - String subQueryPropertyName = keepUserId_InScopeSubQuery_UserInfo(userInfoCBquery);// for - // saving - // query - // - - // value - // . - registerInScopeSubQuery(userInfoCBquery, "USER_ID", "USER_ID", - subQueryPropertyName); + public void setUserId_NotLikeSearch( + String userId, + jp.sf.pal.addresslist.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(userId), getCValueUserId(), "USER_ID", "UserId", + "userId", likeSearchOption); } public void inScopeUserInfo(SubQuery subQuery) { @@ -391,23 +345,23 @@ cb.xsetupForInScopeSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepUserId_InScopeSubQuery_UserInfo(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerInScopeSubQuery(cb.query(), "USER_ID", "USER_ID", subQueryPropertyName); } - abstract public String keepUserId_InScopeSubQuery_UserInfo( + public abstract String keepUserId_InScopeSubQuery_UserInfo( jp.sf.pal.addresslist.db.cbean.cq.UserInfoCQ subQuery); /** - * IsNull(is null). And OnceRegistered. + * IsNull(is null). And OnlyOnceRegistered. */ public void setUserId_IsNull() { regUserId(CK_ISN, DUMMY_OBJECT); } /** - * IsNotNull(is not null). And OnceRegistered. + * IsNotNull(is not null). And OnlyOnceRegistered. */ public void setUserId_IsNotNull() { regUserId(CK_ISNN, DUMMY_OBJECT); @@ -426,7 +380,7 @@ abstract protected ConditionValue getCValueUserId(); /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {VARCHAR(200)} + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {VARCHAR(200)} * * @param name The value of name as equal. */ @@ -435,7 +389,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param name The value of name as notEqual. */ @@ -444,7 +398,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param name The value of name as greaterThan. */ @@ -453,7 +407,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param name The value of name as lessThan. */ @@ -462,7 +416,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param name The value of name as greaterEqual. */ @@ -471,7 +425,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param name The value of name as lessEqual. */ @@ -480,7 +434,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param name The value of name as prefixSearch. */ @@ -489,20 +443,6 @@ } /** - * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, - * SeveralRegistered. - * - * @param name The value of name as likeSearch. - * @param likeSearchOption The option of like-search. (NotNull) - */ - public void setName_LikeSearch( - String name, - jp.sf.pal.addresslist.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { - registerLikeSearchQuery(CK_LS, fRES(name), getCValueName(), "NAME", - "Name", "name", likeSearchOption); - } - - /** * InScope(in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * @@ -513,38 +453,52 @@ } /** - * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * - * @param name The collection of name as inScope. - * @param inScopeOption The option of in-scope. (NotNull) + * @param nameList The collection of name as notInScope. */ - public void setName_InScope( + public void setName_NotInScope(Collection nameList) { + regName(CK_NINS, cTL(nameList)); + } + + /** + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param name The value of name as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) + */ + public void setName_LikeSearch( String name, - jp.sf.pal.addresslist.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(name), getCValueName(), "NAME", - "Name", "name", inScopeOption); + jp.sf.pal.addresslist.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(name), getCValueName(), "NAME", "Name", "name", + likeSearchOption); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param nameList The collection of name as notInScope. + * @param name The value of name as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setName_NotInScope(Collection nameList) { - regName(CK_NINS, cTL(nameList)); + public void setName_NotLikeSearch( + String name, + jp.sf.pal.addresslist.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(name), getCValueName(), "NAME", "Name", "name", + likeSearchOption); } /** - * IsNull(is null). And OnceRegistered. + * IsNull(is null). And OnlyOnceRegistered. */ public void setName_IsNull() { regName(CK_ISN, DUMMY_OBJECT); } /** - * IsNotNull(is not null). And OnceRegistered. + * IsNotNull(is not null). And OnlyOnceRegistered. */ public void setName_IsNotNull() { regName(CK_ISNN, DUMMY_OBJECT); @@ -561,7 +515,7 @@ abstract protected ConditionValue getCValueName(); /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {VARCHAR(200)} + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {VARCHAR(200)} * * @param nameDesc The value of nameDesc as equal. */ @@ -570,7 +524,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param nameDesc The value of nameDesc as notEqual. */ @@ -579,7 +533,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param nameDesc The value of nameDesc as greaterThan. */ @@ -588,7 +542,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param nameDesc The value of nameDesc as lessThan. */ @@ -597,7 +551,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param nameDesc The value of nameDesc as greaterEqual. */ @@ -606,7 +560,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param nameDesc The value of nameDesc as lessEqual. */ @@ -615,7 +569,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param nameDesc The value of nameDesc as prefixSearch. */ @@ -624,20 +578,6 @@ } /** - * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, - * SeveralRegistered. - * - * @param nameDesc The value of nameDesc as likeSearch. - * @param likeSearchOption The option of like-search. (NotNull) - */ - public void setNameDesc_LikeSearch( - String nameDesc, - jp.sf.pal.addresslist.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { - registerLikeSearchQuery(CK_LS, fRES(nameDesc), getCValueNameDesc(), - "NAME_DESC", "NameDesc", "nameDesc", likeSearchOption); - } - - /** * InScope(in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * @@ -648,38 +588,52 @@ } /** - * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * - * @param nameDesc The collection of nameDesc as inScope. - * @param inScopeOption The option of in-scope. (NotNull) + * @param nameDescList The collection of nameDesc as notInScope. */ - public void setNameDesc_InScope( + public void setNameDesc_NotInScope(Collection nameDescList) { + regNameDesc(CK_NINS, cTL(nameDescList)); + } + + /** + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param nameDesc The value of nameDesc as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) + */ + public void setNameDesc_LikeSearch( String nameDesc, - jp.sf.pal.addresslist.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(nameDesc), getCValueNameDesc(), - "NAME_DESC", "NameDesc", "nameDesc", inScopeOption); + jp.sf.pal.addresslist.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(nameDesc), getCValueNameDesc(), "NAME_DESC", + "NameDesc", "nameDesc", likeSearchOption); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param nameDescList The collection of nameDesc as notInScope. + * @param nameDesc The value of nameDesc as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setNameDesc_NotInScope(Collection nameDescList) { - regNameDesc(CK_NINS, cTL(nameDescList)); + public void setNameDesc_NotLikeSearch( + String nameDesc, + jp.sf.pal.addresslist.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(nameDesc), getCValueNameDesc(), "NAME_DESC", + "NameDesc", "nameDesc", likeSearchOption); } /** - * IsNull(is null). And OnceRegistered. + * IsNull(is null). And OnlyOnceRegistered. */ public void setNameDesc_IsNull() { regNameDesc(CK_ISN, DUMMY_OBJECT); } /** - * IsNotNull(is not null). And OnceRegistered. + * IsNotNull(is not null). And OnlyOnceRegistered. */ public void setNameDesc_IsNotNull() { regNameDesc(CK_ISNN, DUMMY_OBJECT); @@ -698,7 +652,7 @@ abstract protected ConditionValue getCValueNameDesc(); /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {VARCHAR(200)} + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {VARCHAR(200)} * * @param department The value of department as equal. */ @@ -707,7 +661,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param department The value of department as notEqual. */ @@ -716,7 +670,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param department The value of department as greaterThan. */ @@ -725,7 +679,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param department The value of department as lessThan. */ @@ -734,7 +688,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param department The value of department as greaterEqual. */ @@ -743,7 +697,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param department The value of department as lessEqual. */ @@ -752,7 +706,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param department The value of department as prefixSearch. */ @@ -761,20 +715,6 @@ } /** - * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, - * SeveralRegistered. - * - * @param department The value of department as likeSearch. - * @param likeSearchOption The option of like-search. (NotNull) - */ - public void setDepartment_LikeSearch( - String department, - jp.sf.pal.addresslist.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { - registerLikeSearchQuery(CK_LS, fRES(department), getCValueDepartment(), - "DEPARTMENT", "Department", "department", likeSearchOption); - } - - /** * InScope(in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * @@ -785,38 +725,52 @@ } /** - * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * - * @param department The collection of department as inScope. - * @param inScopeOption The option of in-scope. (NotNull) + * @param departmentList The collection of department as notInScope. */ - public void setDepartment_InScope( + public void setDepartment_NotInScope(Collection departmentList) { + regDepartment(CK_NINS, cTL(departmentList)); + } + + /** + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param department The value of department as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) + */ + public void setDepartment_LikeSearch( String department, - jp.sf.pal.addresslist.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(department), getCValueDepartment(), - "DEPARTMENT", "Department", "department", inScopeOption); + jp.sf.pal.addresslist.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(department), getCValueDepartment(), "DEPARTMENT", + "Department", "department", likeSearchOption); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param departmentList The collection of department as notInScope. + * @param department The value of department as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setDepartment_NotInScope(Collection departmentList) { - regDepartment(CK_NINS, cTL(departmentList)); + public void setDepartment_NotLikeSearch( + String department, + jp.sf.pal.addresslist.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(department), getCValueDepartment(), "DEPARTMENT", + "Department", "department", likeSearchOption); } /** - * IsNull(is null). And OnceRegistered. + * IsNull(is null). And OnlyOnceRegistered. */ public void setDepartment_IsNull() { regDepartment(CK_ISN, DUMMY_OBJECT); } /** - * IsNotNull(is not null). And OnceRegistered. + * IsNotNull(is not null). And OnlyOnceRegistered. */ public void setDepartment_IsNotNull() { regDepartment(CK_ISNN, DUMMY_OBJECT); @@ -835,7 +789,7 @@ abstract protected ConditionValue getCValueDepartment(); /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {VARCHAR(200)} + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {VARCHAR(200)} * * @param building The value of building as equal. */ @@ -844,7 +798,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param building The value of building as notEqual. */ @@ -853,7 +807,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param building The value of building as greaterThan. */ @@ -862,7 +816,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param building The value of building as lessThan. */ @@ -871,7 +825,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param building The value of building as greaterEqual. */ @@ -880,7 +834,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param building The value of building as lessEqual. */ @@ -889,7 +843,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param building The value of building as prefixSearch. */ @@ -898,20 +852,6 @@ } /** - * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, - * SeveralRegistered. - * - * @param building The value of building as likeSearch. - * @param likeSearchOption The option of like-search. (NotNull) - */ - public void setBuilding_LikeSearch( - String building, - jp.sf.pal.addresslist.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { - registerLikeSearchQuery(CK_LS, fRES(building), getCValueBuilding(), - "BUILDING", "Building", "building", likeSearchOption); - } - - /** * InScope(in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * @@ -922,38 +862,52 @@ } /** - * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * - * @param building The collection of building as inScope. - * @param inScopeOption The option of in-scope. (NotNull) + * @param buildingList The collection of building as notInScope. */ - public void setBuilding_InScope( + public void setBuilding_NotInScope(Collection buildingList) { + regBuilding(CK_NINS, cTL(buildingList)); + } + + /** + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param building The value of building as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) + */ + public void setBuilding_LikeSearch( String building, - jp.sf.pal.addresslist.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(building), getCValueBuilding(), - "BUILDING", "Building", "building", inScopeOption); + jp.sf.pal.addresslist.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(building), getCValueBuilding(), "BUILDING", + "Building", "building", likeSearchOption); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param buildingList The collection of building as notInScope. + * @param building The value of building as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setBuilding_NotInScope(Collection buildingList) { - regBuilding(CK_NINS, cTL(buildingList)); + public void setBuilding_NotLikeSearch( + String building, + jp.sf.pal.addresslist.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(building), getCValueBuilding(), "BUILDING", + "Building", "building", likeSearchOption); } /** - * IsNull(is null). And OnceRegistered. + * IsNull(is null). And OnlyOnceRegistered. */ public void setBuilding_IsNull() { regBuilding(CK_ISN, DUMMY_OBJECT); } /** - * IsNotNull(is not null). And OnceRegistered. + * IsNotNull(is not null). And OnlyOnceRegistered. */ public void setBuilding_IsNotNull() { regBuilding(CK_ISNN, DUMMY_OBJECT); @@ -972,7 +926,7 @@ abstract protected ConditionValue getCValueBuilding(); /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {VARCHAR(200)} + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {VARCHAR(200)} * * @param street The value of street as equal. */ @@ -981,7 +935,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param street The value of street as notEqual. */ @@ -990,7 +944,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param street The value of street as greaterThan. */ @@ -999,7 +953,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param street The value of street as lessThan. */ @@ -1008,7 +962,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param street The value of street as greaterEqual. */ @@ -1017,7 +971,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param street The value of street as lessEqual. */ @@ -1026,7 +980,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param street The value of street as prefixSearch. */ @@ -1035,20 +989,6 @@ } /** - * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, - * SeveralRegistered. - * - * @param street The value of street as likeSearch. - * @param likeSearchOption The option of like-search. (NotNull) - */ - public void setStreet_LikeSearch( - String street, - jp.sf.pal.addresslist.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { - registerLikeSearchQuery(CK_LS, fRES(street), getCValueStreet(), - "STREET", "Street", "street", likeSearchOption); - } - - /** * InScope(in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * @@ -1059,38 +999,52 @@ } /** - * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * - * @param street The collection of street as inScope. - * @param inScopeOption The option of in-scope. (NotNull) + * @param streetList The collection of street as notInScope. */ - public void setStreet_InScope( + public void setStreet_NotInScope(Collection streetList) { + regStreet(CK_NINS, cTL(streetList)); + } + + /** + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param street The value of street as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) + */ + public void setStreet_LikeSearch( String street, - jp.sf.pal.addresslist.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(street), getCValueStreet(), "STREET", - "Street", "street", inScopeOption); + jp.sf.pal.addresslist.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(street), getCValueStreet(), "STREET", "Street", + "street", likeSearchOption); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param streetList The collection of street as notInScope. + * @param street The value of street as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setStreet_NotInScope(Collection streetList) { - regStreet(CK_NINS, cTL(streetList)); + public void setStreet_NotLikeSearch( + String street, + jp.sf.pal.addresslist.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(street), getCValueStreet(), "STREET", "Street", + "street", likeSearchOption); } /** - * IsNull(is null). And OnceRegistered. + * IsNull(is null). And OnlyOnceRegistered. */ public void setStreet_IsNull() { regStreet(CK_ISN, DUMMY_OBJECT); } /** - * IsNotNull(is not null). And OnceRegistered. + * IsNotNull(is not null). And OnlyOnceRegistered. */ public void setStreet_IsNotNull() { regStreet(CK_ISNN, DUMMY_OBJECT); @@ -1109,7 +1063,7 @@ abstract protected ConditionValue getCValueStreet(); /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {VARCHAR(100)} + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {VARCHAR(100)} * * @param city The value of city as equal. */ @@ -1118,7 +1072,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param city The value of city as notEqual. */ @@ -1127,7 +1081,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param city The value of city as greaterThan. */ @@ -1136,7 +1090,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param city The value of city as lessThan. */ @@ -1145,7 +1099,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param city The value of city as greaterEqual. */ @@ -1154,7 +1108,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param city The value of city as lessEqual. */ @@ -1163,7 +1117,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param city The value of city as prefixSearch. */ @@ -1172,20 +1126,6 @@ } /** - * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, - * SeveralRegistered. - * - * @param city The value of city as likeSearch. - * @param likeSearchOption The option of like-search. (NotNull) - */ - public void setCity_LikeSearch( - String city, - jp.sf.pal.addresslist.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { - registerLikeSearchQuery(CK_LS, fRES(city), getCValueCity(), "CITY", - "City", "city", likeSearchOption); - } - - /** * InScope(in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * @@ -1196,38 +1136,52 @@ } /** - * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * - * @param city The collection of city as inScope. - * @param inScopeOption The option of in-scope. (NotNull) + * @param cityList The collection of city as notInScope. */ - public void setCity_InScope( + public void setCity_NotInScope(Collection cityList) { + regCity(CK_NINS, cTL(cityList)); + } + + /** + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param city The value of city as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) + */ + public void setCity_LikeSearch( String city, - jp.sf.pal.addresslist.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(city), getCValueCity(), "CITY", - "City", "city", inScopeOption); + jp.sf.pal.addresslist.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(city), getCValueCity(), "CITY", "City", "city", + likeSearchOption); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param cityList The collection of city as notInScope. + * @param city The value of city as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setCity_NotInScope(Collection cityList) { - regCity(CK_NINS, cTL(cityList)); + public void setCity_NotLikeSearch( + String city, + jp.sf.pal.addresslist.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(city), getCValueCity(), "CITY", "City", "city", + likeSearchOption); } /** - * IsNull(is null). And OnceRegistered. + * IsNull(is null). And OnlyOnceRegistered. */ public void setCity_IsNull() { regCity(CK_ISN, DUMMY_OBJECT); } /** - * IsNotNull(is not null). And OnceRegistered. + * IsNotNull(is not null). And OnlyOnceRegistered. */ public void setCity_IsNotNull() { regCity(CK_ISNN, DUMMY_OBJECT); @@ -1244,7 +1198,7 @@ abstract protected ConditionValue getCValueCity(); /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {VARCHAR(100)} + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {VARCHAR(100)} * * @param state The value of state as equal. */ @@ -1253,7 +1207,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param state The value of state as notEqual. */ @@ -1262,7 +1216,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param state The value of state as greaterThan. */ @@ -1271,7 +1225,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param state The value of state as lessThan. */ @@ -1280,7 +1234,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param state The value of state as greaterEqual. */ @@ -1289,7 +1243,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param state The value of state as lessEqual. */ @@ -1298,7 +1252,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param state The value of state as prefixSearch. */ @@ -1307,20 +1261,6 @@ } /** - * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, - * SeveralRegistered. - * - * @param state The value of state as likeSearch. - * @param likeSearchOption The option of like-search. (NotNull) - */ - public void setState_LikeSearch( - String state, - jp.sf.pal.addresslist.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { - registerLikeSearchQuery(CK_LS, fRES(state), getCValueState(), "STATE", - "State", "state", likeSearchOption); - } - - /** * InScope(in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * @@ -1331,38 +1271,52 @@ } /** - * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * - * @param state The collection of state as inScope. - * @param inScopeOption The option of in-scope. (NotNull) + * @param stateList The collection of state as notInScope. */ - public void setState_InScope( + public void setState_NotInScope(Collection stateList) { + regState(CK_NINS, cTL(stateList)); + } + + /** + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param state The value of state as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) + */ + public void setState_LikeSearch( String state, - jp.sf.pal.addresslist.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(state), getCValueState(), "STATE", - "State", "state", inScopeOption); + jp.sf.pal.addresslist.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(state), getCValueState(), "STATE", "State", "state", + likeSearchOption); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param stateList The collection of state as notInScope. + * @param state The value of state as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setState_NotInScope(Collection stateList) { - regState(CK_NINS, cTL(stateList)); + public void setState_NotLikeSearch( + String state, + jp.sf.pal.addresslist.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(state), getCValueState(), "STATE", "State", + "state", likeSearchOption); } /** - * IsNull(is null). And OnceRegistered. + * IsNull(is null). And OnlyOnceRegistered. */ public void setState_IsNull() { regState(CK_ISN, DUMMY_OBJECT); } /** - * IsNotNull(is not null). And OnceRegistered. + * IsNotNull(is not null). And OnlyOnceRegistered. */ public void setState_IsNotNull() { regState(CK_ISNN, DUMMY_OBJECT); @@ -1380,7 +1334,7 @@ abstract protected ConditionValue getCValueState(); /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {VARCHAR(30)} + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {VARCHAR(30)} * * @param postalCode The value of postalCode as equal. */ @@ -1389,7 +1343,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param postalCode The value of postalCode as notEqual. */ @@ -1398,7 +1352,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param postalCode The value of postalCode as greaterThan. */ @@ -1407,7 +1361,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param postalCode The value of postalCode as lessThan. */ @@ -1416,7 +1370,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param postalCode The value of postalCode as greaterEqual. */ @@ -1425,7 +1379,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param postalCode The value of postalCode as lessEqual. */ @@ -1434,7 +1388,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param postalCode The value of postalCode as prefixSearch. */ @@ -1443,20 +1397,6 @@ } /** - * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, - * SeveralRegistered. - * - * @param postalCode The value of postalCode as likeSearch. - * @param likeSearchOption The option of like-search. (NotNull) - */ - public void setPostalCode_LikeSearch( - String postalCode, - jp.sf.pal.addresslist.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { - registerLikeSearchQuery(CK_LS, fRES(postalCode), getCValuePostalCode(), - "POSTAL_CODE", "PostalCode", "postalCode", likeSearchOption); - } - - /** * InScope(in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * @@ -1467,38 +1407,52 @@ } /** - * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * - * @param postalCode The collection of postalCode as inScope. - * @param inScopeOption The option of in-scope. (NotNull) + * @param postalCodeList The collection of postalCode as notInScope. */ - public void setPostalCode_InScope( + public void setPostalCode_NotInScope(Collection postalCodeList) { + regPostalCode(CK_NINS, cTL(postalCodeList)); + } + + /** + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param postalCode The value of postalCode as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) + */ + public void setPostalCode_LikeSearch( String postalCode, - jp.sf.pal.addresslist.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(postalCode), getCValuePostalCode(), - "POSTAL_CODE", "PostalCode", "postalCode", inScopeOption); + jp.sf.pal.addresslist.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(postalCode), getCValuePostalCode(), "POSTAL_CODE", + "PostalCode", "postalCode", likeSearchOption); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param postalCodeList The collection of postalCode as notInScope. + * @param postalCode The value of postalCode as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setPostalCode_NotInScope(Collection postalCodeList) { - regPostalCode(CK_NINS, cTL(postalCodeList)); + public void setPostalCode_NotLikeSearch( + String postalCode, + jp.sf.pal.addresslist.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(postalCode), getCValuePostalCode(), "POSTAL_CODE", + "PostalCode", "postalCode", likeSearchOption); } /** - * IsNull(is null). And OnceRegistered. + * IsNull(is null). And OnlyOnceRegistered. */ public void setPostalCode_IsNull() { regPostalCode(CK_ISN, DUMMY_OBJECT); } /** - * IsNotNull(is not null). And OnceRegistered. + * IsNotNull(is not null). And OnlyOnceRegistered. */ public void setPostalCode_IsNotNull() { regPostalCode(CK_ISNN, DUMMY_OBJECT); @@ -1517,7 +1471,7 @@ abstract protected ConditionValue getCValuePostalCode(); /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {VARCHAR(200)} + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {VARCHAR(200)} * * @param country The value of country as equal. */ @@ -1526,7 +1480,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param country The value of country as notEqual. */ @@ -1535,7 +1489,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param country The value of country as greaterThan. */ @@ -1544,7 +1498,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param country The value of country as lessThan. */ @@ -1553,7 +1507,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param country The value of country as greaterEqual. */ @@ -1562,7 +1516,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param country The value of country as lessEqual. */ @@ -1571,7 +1525,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param country The value of country as prefixSearch. */ @@ -1580,20 +1534,6 @@ } /** - * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, - * SeveralRegistered. - * - * @param country The value of country as likeSearch. - * @param likeSearchOption The option of like-search. (NotNull) - */ - public void setCountry_LikeSearch( - String country, - jp.sf.pal.addresslist.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { - registerLikeSearchQuery(CK_LS, fRES(country), getCValueCountry(), - "COUNTRY", "Country", "country", likeSearchOption); - } - - /** * InScope(in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * @@ -1604,38 +1544,52 @@ } /** - * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * - * @param country The collection of country as inScope. - * @param inScopeOption The option of in-scope. (NotNull) + * @param countryList The collection of country as notInScope. */ - public void setCountry_InScope( + public void setCountry_NotInScope(Collection countryList) { + regCountry(CK_NINS, cTL(countryList)); + } + + /** + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param country The value of country as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) + */ + public void setCountry_LikeSearch( String country, - jp.sf.pal.addresslist.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(country), getCValueCountry(), - "COUNTRY", "Country", "country", inScopeOption); + jp.sf.pal.addresslist.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(country), getCValueCountry(), "COUNTRY", "Country", + "country", likeSearchOption); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param countryList The collection of country as notInScope. + * @param country The value of country as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setCountry_NotInScope(Collection countryList) { - regCountry(CK_NINS, cTL(countryList)); + public void setCountry_NotLikeSearch( + String country, + jp.sf.pal.addresslist.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(country), getCValueCountry(), "COUNTRY", "Country", + "country", likeSearchOption); } /** - * IsNull(is null). And OnceRegistered. + * IsNull(is null). And OnlyOnceRegistered. */ public void setCountry_IsNull() { regCountry(CK_ISN, DUMMY_OBJECT); } /** - * IsNotNull(is not null). And OnceRegistered. + * IsNotNull(is not null). And OnlyOnceRegistered. */ public void setCountry_IsNotNull() { regCountry(CK_ISNN, DUMMY_OBJECT); @@ -1654,7 +1608,7 @@ abstract protected ConditionValue getCValueCountry(); /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {VARCHAR(40)} + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {VARCHAR(40)} * * @param telephone1 The value of telephone1 as equal. */ @@ -1663,7 +1617,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param telephone1 The value of telephone1 as notEqual. */ @@ -1672,7 +1626,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param telephone1 The value of telephone1 as greaterThan. */ @@ -1681,7 +1635,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param telephone1 The value of telephone1 as lessThan. */ @@ -1690,7 +1644,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param telephone1 The value of telephone1 as greaterEqual. */ @@ -1699,7 +1653,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param telephone1 The value of telephone1 as lessEqual. */ @@ -1708,7 +1662,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param telephone1 The value of telephone1 as prefixSearch. */ @@ -1717,20 +1671,6 @@ } /** - * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, - * SeveralRegistered. - * - * @param telephone1 The value of telephone1 as likeSearch. - * @param likeSearchOption The option of like-search. (NotNull) - */ - public void setTelephone1_LikeSearch( - String telephone1, - jp.sf.pal.addresslist.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { - registerLikeSearchQuery(CK_LS, fRES(telephone1), getCValueTelephone1(), - "TELEPHONE1", "Telephone1", "telephone1", likeSearchOption); - } - - /** * InScope(in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * @@ -1741,38 +1681,52 @@ } /** - * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * - * @param telephone1 The collection of telephone1 as inScope. - * @param inScopeOption The option of in-scope. (NotNull) + * @param telephone1List The collection of telephone1 as notInScope. */ - public void setTelephone1_InScope( + public void setTelephone1_NotInScope(Collection telephone1List) { + regTelephone1(CK_NINS, cTL(telephone1List)); + } + + /** + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param telephone1 The value of telephone1 as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) + */ + public void setTelephone1_LikeSearch( String telephone1, - jp.sf.pal.addresslist.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(telephone1), getCValueTelephone1(), - "TELEPHONE1", "Telephone1", "telephone1", inScopeOption); + jp.sf.pal.addresslist.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(telephone1), getCValueTelephone1(), "TELEPHONE1", + "Telephone1", "telephone1", likeSearchOption); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param telephone1List The collection of telephone1 as notInScope. + * @param telephone1 The value of telephone1 as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setTelephone1_NotInScope(Collection telephone1List) { - regTelephone1(CK_NINS, cTL(telephone1List)); + public void setTelephone1_NotLikeSearch( + String telephone1, + jp.sf.pal.addresslist.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(telephone1), getCValueTelephone1(), "TELEPHONE1", + "Telephone1", "telephone1", likeSearchOption); } /** - * IsNull(is null). And OnceRegistered. + * IsNull(is null). And OnlyOnceRegistered. */ public void setTelephone1_IsNull() { regTelephone1(CK_ISN, DUMMY_OBJECT); } /** - * IsNotNull(is not null). And OnceRegistered. + * IsNotNull(is not null). And OnlyOnceRegistered. */ public void setTelephone1_IsNotNull() { regTelephone1(CK_ISNN, DUMMY_OBJECT); @@ -1791,7 +1745,7 @@ abstract protected ConditionValue getCValueTelephone1(); /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {VARCHAR(40)} + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {VARCHAR(40)} * * @param telephone2 The value of telephone2 as equal. */ @@ -1800,7 +1754,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param telephone2 The value of telephone2 as notEqual. */ @@ -1809,7 +1763,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param telephone2 The value of telephone2 as greaterThan. */ @@ -1818,7 +1772,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param telephone2 The value of telephone2 as lessThan. */ @@ -1827,7 +1781,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param telephone2 The value of telephone2 as greaterEqual. */ @@ -1836,7 +1790,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param telephone2 The value of telephone2 as lessEqual. */ @@ -1845,7 +1799,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param telephone2 The value of telephone2 as prefixSearch. */ @@ -1854,20 +1808,6 @@ } /** - * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, - * SeveralRegistered. - * - * @param telephone2 The value of telephone2 as likeSearch. - * @param likeSearchOption The option of like-search. (NotNull) - */ - public void setTelephone2_LikeSearch( - String telephone2, - jp.sf.pal.addresslist.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { - registerLikeSearchQuery(CK_LS, fRES(telephone2), getCValueTelephone2(), - "TELEPHONE2", "Telephone2", "telephone2", likeSearchOption); - } - - /** * InScope(in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * @@ -1878,38 +1818,52 @@ } /** - * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * - * @param telephone2 The collection of telephone2 as inScope. - * @param inScopeOption The option of in-scope. (NotNull) + * @param telephone2List The collection of telephone2 as notInScope. */ - public void setTelephone2_InScope( + public void setTelephone2_NotInScope(Collection telephone2List) { + regTelephone2(CK_NINS, cTL(telephone2List)); + } + + /** + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param telephone2 The value of telephone2 as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) + */ + public void setTelephone2_LikeSearch( String telephone2, - jp.sf.pal.addresslist.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(telephone2), getCValueTelephone2(), - "TELEPHONE2", "Telephone2", "telephone2", inScopeOption); + jp.sf.pal.addresslist.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(telephone2), getCValueTelephone2(), "TELEPHONE2", + "Telephone2", "telephone2", likeSearchOption); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param telephone2List The collection of telephone2 as notInScope. + * @param telephone2 The value of telephone2 as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setTelephone2_NotInScope(Collection telephone2List) { - regTelephone2(CK_NINS, cTL(telephone2List)); + public void setTelephone2_NotLikeSearch( + String telephone2, + jp.sf.pal.addresslist.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(telephone2), getCValueTelephone2(), "TELEPHONE2", + "Telephone2", "telephone2", likeSearchOption); } /** - * IsNull(is null). And OnceRegistered. + * IsNull(is null). And OnlyOnceRegistered. */ public void setTelephone2_IsNull() { regTelephone2(CK_ISN, DUMMY_OBJECT); } /** - * IsNotNull(is not null). And OnceRegistered. + * IsNotNull(is not null). And OnlyOnceRegistered. */ public void setTelephone2_IsNotNull() { regTelephone2(CK_ISNN, DUMMY_OBJECT); @@ -1928,7 +1882,7 @@ abstract protected ConditionValue getCValueTelephone2(); /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {VARCHAR(40)} + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {VARCHAR(40)} * * @param fax1 The value of fax1 as equal. */ @@ -1937,7 +1891,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param fax1 The value of fax1 as notEqual. */ @@ -1946,7 +1900,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param fax1 The value of fax1 as greaterThan. */ @@ -1955,7 +1909,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param fax1 The value of fax1 as lessThan. */ @@ -1964,7 +1918,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param fax1 The value of fax1 as greaterEqual. */ @@ -1973,7 +1927,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param fax1 The value of fax1 as lessEqual. */ @@ -1982,7 +1936,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param fax1 The value of fax1 as prefixSearch. */ @@ -1991,20 +1945,6 @@ } /** - * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, - * SeveralRegistered. - * - * @param fax1 The value of fax1 as likeSearch. - * @param likeSearchOption The option of like-search. (NotNull) - */ - public void setFax1_LikeSearch( - String fax1, - jp.sf.pal.addresslist.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { - registerLikeSearchQuery(CK_LS, fRES(fax1), getCValueFax1(), "FAX1", - "Fax1", "fax1", likeSearchOption); - } - - /** * InScope(in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * @@ -2015,38 +1955,52 @@ } /** - * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * - * @param fax1 The collection of fax1 as inScope. - * @param inScopeOption The option of in-scope. (NotNull) + * @param fax1List The collection of fax1 as notInScope. */ - public void setFax1_InScope( + public void setFax1_NotInScope(Collection fax1List) { + regFax1(CK_NINS, cTL(fax1List)); + } + + /** + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param fax1 The value of fax1 as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) + */ + public void setFax1_LikeSearch( String fax1, - jp.sf.pal.addresslist.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(fax1), getCValueFax1(), "FAX1", - "Fax1", "fax1", inScopeOption); + jp.sf.pal.addresslist.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(fax1), getCValueFax1(), "FAX1", "Fax1", "fax1", + likeSearchOption); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param fax1List The collection of fax1 as notInScope. + * @param fax1 The value of fax1 as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setFax1_NotInScope(Collection fax1List) { - regFax1(CK_NINS, cTL(fax1List)); + public void setFax1_NotLikeSearch( + String fax1, + jp.sf.pal.addresslist.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(fax1), getCValueFax1(), "FAX1", "Fax1", "fax1", + likeSearchOption); } /** - * IsNull(is null). And OnceRegistered. + * IsNull(is null). And OnlyOnceRegistered. */ public void setFax1_IsNull() { regFax1(CK_ISN, DUMMY_OBJECT); } /** - * IsNotNull(is not null). And OnceRegistered. + * IsNotNull(is not null). And OnlyOnceRegistered. */ public void setFax1_IsNotNull() { regFax1(CK_ISNN, DUMMY_OBJECT); @@ -2063,7 +2017,7 @@ abstract protected ConditionValue getCValueFax1(); /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {VARCHAR(40)} + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {VARCHAR(40)} * * @param fax2 The value of fax2 as equal. */ @@ -2072,7 +2026,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param fax2 The value of fax2 as notEqual. */ @@ -2081,7 +2035,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param fax2 The value of fax2 as greaterThan. */ @@ -2090,7 +2044,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param fax2 The value of fax2 as lessThan. */ @@ -2099,7 +2053,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param fax2 The value of fax2 as greaterEqual. */ @@ -2108,7 +2062,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param fax2 The value of fax2 as lessEqual. */ @@ -2117,7 +2071,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param fax2 The value of fax2 as prefixSearch. */ @@ -2126,20 +2080,6 @@ } /** - * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, - * SeveralRegistered. - * - * @param fax2 The value of fax2 as likeSearch. - * @param likeSearchOption The option of like-search. (NotNull) - */ - public void setFax2_LikeSearch( - String fax2, - jp.sf.pal.addresslist.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { - registerLikeSearchQuery(CK_LS, fRES(fax2), getCValueFax2(), "FAX2", - "Fax2", "fax2", likeSearchOption); - } - - /** * InScope(in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * @@ -2150,38 +2090,52 @@ } /** - * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * - * @param fax2 The collection of fax2 as inScope. - * @param inScopeOption The option of in-scope. (NotNull) + * @param fax2List The collection of fax2 as notInScope. */ - public void setFax2_InScope( + public void setFax2_NotInScope(Collection fax2List) { + regFax2(CK_NINS, cTL(fax2List)); + } + + /** + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param fax2 The value of fax2 as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) + */ + public void setFax2_LikeSearch( String fax2, - jp.sf.pal.addresslist.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(fax2), getCValueFax2(), "FAX2", - "Fax2", "fax2", inScopeOption); + jp.sf.pal.addresslist.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(fax2), getCValueFax2(), "FAX2", "Fax2", "fax2", + likeSearchOption); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param fax2List The collection of fax2 as notInScope. + * @param fax2 The value of fax2 as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setFax2_NotInScope(Collection fax2List) { - regFax2(CK_NINS, cTL(fax2List)); + public void setFax2_NotLikeSearch( + String fax2, + jp.sf.pal.addresslist.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(fax2), getCValueFax2(), "FAX2", "Fax2", "fax2", + likeSearchOption); } /** - * IsNull(is null). And OnceRegistered. + * IsNull(is null). And OnlyOnceRegistered. */ public void setFax2_IsNull() { regFax2(CK_ISN, DUMMY_OBJECT); } /** - * IsNotNull(is not null). And OnceRegistered. + * IsNotNull(is not null). And OnlyOnceRegistered. */ public void setFax2_IsNotNull() { regFax2(CK_ISNN, DUMMY_OBJECT); @@ -2198,7 +2152,7 @@ abstract protected ConditionValue getCValueFax2(); /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {VARCHAR(255)} + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {VARCHAR(255)} * * @param url The value of url as equal. */ @@ -2207,7 +2161,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param url The value of url as notEqual. */ @@ -2216,7 +2170,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param url The value of url as greaterThan. */ @@ -2225,7 +2179,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param url The value of url as lessThan. */ @@ -2234,7 +2188,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param url The value of url as greaterEqual. */ @@ -2243,7 +2197,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param url The value of url as lessEqual. */ @@ -2252,7 +2206,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param url The value of url as prefixSearch. */ @@ -2261,20 +2215,6 @@ } /** - * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, - * SeveralRegistered. - * - * @param url The value of url as likeSearch. - * @param likeSearchOption The option of like-search. (NotNull) - */ - public void setUrl_LikeSearch( - String url, - jp.sf.pal.addresslist.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { - registerLikeSearchQuery(CK_LS, fRES(url), getCValueUrl(), "URL", "Url", - "url", likeSearchOption); - } - - /** * InScope(in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * @@ -2285,38 +2225,52 @@ } /** - * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * - * @param url The collection of url as inScope. - * @param inScopeOption The option of in-scope. (NotNull) + * @param urlList The collection of url as notInScope. */ - public void setUrl_InScope( + public void setUrl_NotInScope(Collection urlList) { + regUrl(CK_NINS, cTL(urlList)); + } + + /** + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param url The value of url as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) + */ + public void setUrl_LikeSearch( String url, - jp.sf.pal.addresslist.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(url), getCValueUrl(), "URL", "Url", - "url", inScopeOption); + jp.sf.pal.addresslist.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(url), getCValueUrl(), "URL", "Url", "url", + likeSearchOption); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param urlList The collection of url as notInScope. + * @param url The value of url as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setUrl_NotInScope(Collection urlList) { - regUrl(CK_NINS, cTL(urlList)); + public void setUrl_NotLikeSearch( + String url, + jp.sf.pal.addresslist.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(url), getCValueUrl(), "URL", "Url", "url", + likeSearchOption); } /** - * IsNull(is null). And OnceRegistered. + * IsNull(is null). And OnlyOnceRegistered. */ public void setUrl_IsNull() { regUrl(CK_ISN, DUMMY_OBJECT); } /** - * IsNotNull(is not null). And OnceRegistered. + * IsNotNull(is not null). And OnlyOnceRegistered. */ public void setUrl_IsNotNull() { regUrl(CK_ISNN, DUMMY_OBJECT); @@ -2333,7 +2287,7 @@ abstract protected ConditionValue getCValueUrl(); /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {VARCHAR(1) : + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {VARCHAR(1) : * Default=[T]} * * @param isPublic The value of isPublic as equal. @@ -2343,7 +2297,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param isPublic The value of isPublic as notEqual. */ @@ -2352,7 +2306,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param isPublic The value of isPublic as greaterThan. */ @@ -2361,7 +2315,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param isPublic The value of isPublic as lessThan. */ @@ -2370,7 +2324,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param isPublic The value of isPublic as greaterEqual. */ @@ -2379,7 +2333,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param isPublic The value of isPublic as lessEqual. */ @@ -2388,7 +2342,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param isPublic The value of isPublic as prefixSearch. */ @@ -2397,20 +2351,6 @@ } /** - * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, - * SeveralRegistered. - * - * @param isPublic The value of isPublic as likeSearch. - * @param likeSearchOption The option of like-search. (NotNull) - */ - public void setIsPublic_LikeSearch( - String isPublic, - jp.sf.pal.addresslist.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { - registerLikeSearchQuery(CK_LS, fRES(isPublic), getCValueIsPublic(), - "IS_PUBLIC", "IsPublic", "isPublic", likeSearchOption); - } - - /** * InScope(in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * @@ -2421,38 +2361,52 @@ } /** - * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * - * @param isPublic The collection of isPublic as inScope. - * @param inScopeOption The option of in-scope. (NotNull) + * @param isPublicList The collection of isPublic as notInScope. */ - public void setIsPublic_InScope( + public void setIsPublic_NotInScope(Collection isPublicList) { + regIsPublic(CK_NINS, cTL(isPublicList)); + } + + /** + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param isPublic The value of isPublic as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) + */ + public void setIsPublic_LikeSearch( String isPublic, - jp.sf.pal.addresslist.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(isPublic), getCValueIsPublic(), - "IS_PUBLIC", "IsPublic", "isPublic", inScopeOption); + jp.sf.pal.addresslist.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(isPublic), getCValueIsPublic(), "IS_PUBLIC", + "IsPublic", "isPublic", likeSearchOption); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param isPublicList The collection of isPublic as notInScope. + * @param isPublic The value of isPublic as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setIsPublic_NotInScope(Collection isPublicList) { - regIsPublic(CK_NINS, cTL(isPublicList)); + public void setIsPublic_NotLikeSearch( + String isPublic, + jp.sf.pal.addresslist.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(isPublic), getCValueIsPublic(), "IS_PUBLIC", + "IsPublic", "isPublic", likeSearchOption); } /** - * IsNull(is null). And OnceRegistered. + * IsNull(is null). And OnlyOnceRegistered. */ public void setIsPublic_IsNull() { regIsPublic(CK_ISN, DUMMY_OBJECT); } /** - * IsNotNull(is not null). And OnceRegistered. + * IsNotNull(is not null). And OnlyOnceRegistered. */ public void setIsPublic_IsNotNull() { regIsPublic(CK_ISNN, DUMMY_OBJECT); @@ -2471,7 +2425,7 @@ abstract protected ConditionValue getCValueIsPublic(); /** - * Equal(=). And NullIgnored, OnceRegistered. {NotNull : TIMESTAMP} + * Equal(=). And NullIgnored, OnlyOnceRegistered. {NotNull : TIMESTAMP} * * @param createdTime The value of createdTime as equal. */ @@ -2480,7 +2434,7 @@ } /** - * NotEqual(!=). And NullIgnored, OnceRegistered. + * NotEqual(!=). And NullIgnored, OnlyOnceRegistered. * * @param createdTime The value of createdTime as notEqual. */ @@ -2489,7 +2443,7 @@ } /** - * GreaterThan(>). And NullIgnored, OnceRegistered. + * GreaterThan(>). And NullIgnored, OnlyOnceRegistered. * * @param createdTime The value of createdTime as greaterThan. */ @@ -2498,7 +2452,7 @@ } /** - * LessThan(>). And NullIgnored, OnceRegistered. + * LessThan(>). And NullIgnored, OnlyOnceRegistered. * * @param createdTime The value of createdTime as lessThan. */ @@ -2507,7 +2461,7 @@ } /** - * GreaterEqual(>). And NullIgnored, OnceRegistered. + * GreaterEqual(>). And NullIgnored, OnlyOnceRegistered. * * @param createdTime The value of createdTime as greaterEqual. */ @@ -2516,7 +2470,7 @@ } /** - * LessEqual(>). And NullIgnored, OnceRegistered. + * LessEqual(>). And NullIgnored, OnlyOnceRegistered. * * @param createdTime The value of createdTime as lessEqual. */ @@ -2526,7 +2480,7 @@ /** * FromTo($fromDate <= COLUMN_NAME <= $toDate). And NullIgnored, - * OnceRegistered. {NotNull : TIMESTAMP} + * OnlyOnceRegistered. {NotNull : TIMESTAMP} * * @param fromDate The from-date of createdTime. (Nullable) * @param toDate The to-date of createdTime. (Nullable) @@ -2544,7 +2498,7 @@ /** * FromTo($fromDate <= COLUMN_NAME < $toDate + 1). And NullIgnored, - * OnceRegistered. {NotNull : TIMESTAMP} + * OnlyOnceRegistered. {NotNull : TIMESTAMP} * * @param fromDate The from-date of createdTime. (Nullable) * @param toDate The to-date of createdTime. (Nullable) @@ -2570,7 +2524,7 @@ abstract protected ConditionValue getCValueCreatedTime(); /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {NotNull : + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {NotNull : * VARCHAR(255)} * * @param createdBy The value of createdBy as equal. @@ -2580,7 +2534,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param createdBy The value of createdBy as notEqual. */ @@ -2589,7 +2543,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param createdBy The value of createdBy as greaterThan. */ @@ -2598,7 +2552,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param createdBy The value of createdBy as lessThan. */ @@ -2607,7 +2561,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param createdBy The value of createdBy as greaterEqual. */ @@ -2616,7 +2570,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param createdBy The value of createdBy as lessEqual. */ @@ -2625,7 +2579,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param createdBy The value of createdBy as prefixSearch. */ @@ -2634,20 +2588,6 @@ } /** - * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, - * SeveralRegistered. - * - * @param createdBy The value of createdBy as likeSearch. - * @param likeSearchOption The option of like-search. (NotNull) - */ - public void setCreatedBy_LikeSearch( - String createdBy, - jp.sf.pal.addresslist.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. * @@ -2658,27 +2598,41 @@ } /** - * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * - * @param createdBy The collection of createdBy as inScope. - * @param inScopeOption The option of in-scope. (NotNull) + * @param createdByList The collection of createdBy as notInScope. */ - public void setCreatedBy_InScope( + public void setCreatedBy_NotInScope(Collection createdByList) { + regCreatedBy(CK_NINS, cTL(createdByList)); + } + + /** + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param createdBy The value of createdBy as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) + */ + public void setCreatedBy_LikeSearch( String createdBy, - jp.sf.pal.addresslist.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(createdBy), getCValueCreatedBy(), - "CREATED_BY", "CreatedBy", "createdBy", inScopeOption); + jp.sf.pal.addresslist.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(createdBy), getCValueCreatedBy(), "CREATED_BY", + "CreatedBy", "createdBy", likeSearchOption); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param createdByList The collection of createdBy as notInScope. + * @param createdBy The value of createdBy as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setCreatedBy_NotInScope(Collection createdByList) { - regCreatedBy(CK_NINS, cTL(createdByList)); + public void setCreatedBy_NotLikeSearch( + String createdBy, + jp.sf.pal.addresslist.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(createdBy), getCValueCreatedBy(), "CREATED_BY", + "CreatedBy", "createdBy", likeSearchOption); } protected void regCreatedBy(ConditionKey key, Object value) { @@ -2694,7 +2648,7 @@ abstract protected ConditionValue getCValueCreatedBy(); /** - * Equal(=). And NullIgnored, OnceRegistered. {NotNull : TIMESTAMP} + * Equal(=). And NullIgnored, OnlyOnceRegistered. {NotNull : TIMESTAMP} * * @param updatedTime The value of updatedTime as equal. */ @@ -2703,7 +2657,7 @@ } /** - * NotEqual(!=). And NullIgnored, OnceRegistered. + * NotEqual(!=). And NullIgnored, OnlyOnceRegistered. * * @param updatedTime The value of updatedTime as notEqual. */ @@ -2712,7 +2666,7 @@ } /** - * GreaterThan(>). And NullIgnored, OnceRegistered. + * GreaterThan(>). And NullIgnored, OnlyOnceRegistered. * * @param updatedTime The value of updatedTime as greaterThan. */ @@ -2721,7 +2675,7 @@ } /** - * LessThan(>). And NullIgnored, OnceRegistered. + * LessThan(>). And NullIgnored, OnlyOnceRegistered. * * @param updatedTime The value of updatedTime as lessThan. */ @@ -2730,7 +2684,7 @@ } /** - * GreaterEqual(>). And NullIgnored, OnceRegistered. + * GreaterEqual(>). And NullIgnored, OnlyOnceRegistered. * * @param updatedTime The value of updatedTime as greaterEqual. */ @@ -2739,7 +2693,7 @@ } /** - * LessEqual(>). And NullIgnored, OnceRegistered. + * LessEqual(>). And NullIgnored, OnlyOnceRegistered. * * @param updatedTime The value of updatedTime as lessEqual. */ @@ -2749,7 +2703,7 @@ /** * FromTo($fromDate <= COLUMN_NAME <= $toDate). And NullIgnored, - * OnceRegistered. {NotNull : TIMESTAMP} + * OnlyOnceRegistered. {NotNull : TIMESTAMP} * * @param fromDate The from-date of updatedTime. (Nullable) * @param toDate The to-date of updatedTime. (Nullable) @@ -2767,7 +2721,7 @@ /** * FromTo($fromDate <= COLUMN_NAME < $toDate + 1). And NullIgnored, - * OnceRegistered. {NotNull : TIMESTAMP} + * OnlyOnceRegistered. {NotNull : TIMESTAMP} * * @param fromDate The from-date of updatedTime. (Nullable) * @param toDate The to-date of updatedTime. (Nullable) @@ -2793,7 +2747,7 @@ abstract protected ConditionValue getCValueUpdatedTime(); /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {NotNull : + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {NotNull : * VARCHAR(255)} * * @param updatedBy The value of updatedBy as equal. @@ -2803,7 +2757,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param updatedBy The value of updatedBy as notEqual. */ @@ -2812,7 +2766,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param updatedBy The value of updatedBy as greaterThan. */ @@ -2821,7 +2775,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param updatedBy The value of updatedBy as lessThan. */ @@ -2830,7 +2784,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param updatedBy The value of updatedBy as greaterEqual. */ @@ -2839,7 +2793,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param updatedBy The value of updatedBy as lessEqual. */ @@ -2848,7 +2802,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param updatedBy The value of updatedBy as prefixSearch. */ @@ -2857,20 +2811,6 @@ } /** - * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, - * SeveralRegistered. - * - * @param updatedBy The value of updatedBy as likeSearch. - * @param likeSearchOption The option of like-search. (NotNull) - */ - public void setUpdatedBy_LikeSearch( - String updatedBy, - jp.sf.pal.addresslist.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. * @@ -2881,27 +2821,41 @@ } /** - * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * - * @param updatedBy The collection of updatedBy as inScope. - * @param inScopeOption The option of in-scope. (NotNull) + * @param updatedByList The collection of updatedBy as notInScope. */ - public void setUpdatedBy_InScope( + public void setUpdatedBy_NotInScope(Collection updatedByList) { + regUpdatedBy(CK_NINS, cTL(updatedByList)); + } + + /** + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param updatedBy The value of updatedBy as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) + */ + public void setUpdatedBy_LikeSearch( String updatedBy, - jp.sf.pal.addresslist.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(updatedBy), getCValueUpdatedBy(), - "UPDATED_BY", "UpdatedBy", "updatedBy", inScopeOption); + jp.sf.pal.addresslist.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(updatedBy), getCValueUpdatedBy(), "UPDATED_BY", + "UpdatedBy", "updatedBy", likeSearchOption); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param updatedByList The collection of updatedBy as notInScope. + * @param updatedBy The value of updatedBy as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setUpdatedBy_NotInScope(Collection updatedByList) { - regUpdatedBy(CK_NINS, cTL(updatedByList)); + public void setUpdatedBy_NotLikeSearch( + String updatedBy, + jp.sf.pal.addresslist.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(updatedBy), getCValueUpdatedBy(), "UPDATED_BY", + "UpdatedBy", "updatedBy", likeSearchOption); } protected void regUpdatedBy(ConditionKey key, Object value) { @@ -2917,7 +2871,7 @@ abstract protected ConditionValue getCValueUpdatedBy(); /** - * Equal(=). And NullIgnored, OnceRegistered. {TIMESTAMP} + * Equal(=). And NullIgnored, OnlyOnceRegistered. {TIMESTAMP} * * @param deletedTime The value of deletedTime as equal. */ @@ -2926,7 +2880,7 @@ } /** - * NotEqual(!=). And NullIgnored, OnceRegistered. + * NotEqual(!=). And NullIgnored, OnlyOnceRegistered. * * @param deletedTime The value of deletedTime as notEqual. */ @@ -2935,7 +2889,7 @@ } /** - * GreaterThan(>). And NullIgnored, OnceRegistered. + * GreaterThan(>). And NullIgnored, OnlyOnceRegistered. * * @param deletedTime The value of deletedTime as greaterThan. */ @@ -2944,7 +2898,7 @@ } /** - * LessThan(>). And NullIgnored, OnceRegistered. + * LessThan(>). And NullIgnored, OnlyOnceRegistered. * * @param deletedTime The value of deletedTime as lessThan. */ @@ -2953,7 +2907,7 @@ } /** - * GreaterEqual(>). And NullIgnored, OnceRegistered. + * GreaterEqual(>). And NullIgnored, OnlyOnceRegistered. * * @param deletedTime The value of deletedTime as greaterEqual. */ @@ -2962,7 +2916,7 @@ } /** - * LessEqual(>). And NullIgnored, OnceRegistered. + * LessEqual(>). And NullIgnored, OnlyOnceRegistered. * * @param deletedTime The value of deletedTime as lessEqual. */ @@ -2972,7 +2926,7 @@ /** * FromTo($fromDate <= COLUMN_NAME <= $toDate). And NullIgnored, - * OnceRegistered. {TIMESTAMP} + * OnlyOnceRegistered. {TIMESTAMP} * * @param fromDate The from-date of deletedTime. (Nullable) * @param toDate The to-date of deletedTime. (Nullable) @@ -2990,7 +2944,7 @@ /** * FromTo($fromDate <= COLUMN_NAME < $toDate + 1). And NullIgnored, - * OnceRegistered. {TIMESTAMP} + * OnlyOnceRegistered. {TIMESTAMP} * * @param fromDate The from-date of deletedTime. (Nullable) * @param toDate The to-date of deletedTime. (Nullable) @@ -3004,14 +2958,14 @@ } /** - * IsNull(is null). And OnceRegistered. + * IsNull(is null). And OnlyOnceRegistered. */ public void setDeletedTime_IsNull() { regDeletedTime(CK_ISN, DUMMY_OBJECT); } /** - * IsNotNull(is not null). And OnceRegistered. + * IsNotNull(is not null). And OnlyOnceRegistered. */ public void setDeletedTime_IsNotNull() { regDeletedTime(CK_ISNN, DUMMY_OBJECT); @@ -3030,7 +2984,7 @@ abstract protected ConditionValue getCValueDeletedTime(); /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {VARCHAR(255)} + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {VARCHAR(255)} * * @param deletedBy The value of deletedBy as equal. */ @@ -3039,7 +2993,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param deletedBy The value of deletedBy as notEqual. */ @@ -3048,7 +3002,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param deletedBy The value of deletedBy as greaterThan. */ @@ -3057,7 +3011,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param deletedBy The value of deletedBy as lessThan. */ @@ -3066,7 +3020,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param deletedBy The value of deletedBy as greaterEqual. */ @@ -3075,7 +3029,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param deletedBy The value of deletedBy as lessEqual. */ @@ -3084,7 +3038,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param deletedBy The value of deletedBy as prefixSearch. */ @@ -3093,20 +3047,6 @@ } /** - * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, - * SeveralRegistered. - * - * @param deletedBy The value of deletedBy as likeSearch. - * @param likeSearchOption The option of like-search. (NotNull) - */ - public void setDeletedBy_LikeSearch( - String deletedBy, - jp.sf.pal.addresslist.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. * @@ -3117,38 +3057,52 @@ } /** - * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * - * @param deletedBy The collection of deletedBy as inScope. - * @param inScopeOption The option of in-scope. (NotNull) + * @param deletedByList The collection of deletedBy as notInScope. */ - public void setDeletedBy_InScope( + public void setDeletedBy_NotInScope(Collection deletedByList) { + regDeletedBy(CK_NINS, cTL(deletedByList)); + } + + /** + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param deletedBy The value of deletedBy as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) + */ + public void setDeletedBy_LikeSearch( String deletedBy, - jp.sf.pal.addresslist.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(deletedBy), getCValueDeletedBy(), - "DELETED_BY", "DeletedBy", "deletedBy", inScopeOption); + jp.sf.pal.addresslist.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(deletedBy), getCValueDeletedBy(), "DELETED_BY", + "DeletedBy", "deletedBy", likeSearchOption); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param deletedByList The collection of deletedBy as notInScope. + * @param deletedBy The value of deletedBy as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setDeletedBy_NotInScope(Collection deletedByList) { - regDeletedBy(CK_NINS, cTL(deletedByList)); + public void setDeletedBy_NotLikeSearch( + String deletedBy, + jp.sf.pal.addresslist.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(deletedBy), getCValueDeletedBy(), "DELETED_BY", + "DeletedBy", "deletedBy", likeSearchOption); } /** - * IsNull(is null). And OnceRegistered. + * IsNull(is null). And OnlyOnceRegistered. */ public void setDeletedBy_IsNull() { regDeletedBy(CK_ISN, DUMMY_OBJECT); } /** - * IsNotNull(is not null). And OnceRegistered. + * IsNotNull(is not null). And OnlyOnceRegistered. */ public void setDeletedBy_IsNotNull() { regDeletedBy(CK_ISNN, DUMMY_OBJECT); @@ -3167,7 +3121,7 @@ abstract protected ConditionValue getCValueDeletedBy(); /** - * Equal(=). And NullIgnored, OnceRegistered. {NotNull : INTEGER : + * Equal(=). And NullIgnored, OnlyOnceRegistered. {NotNull : INTEGER : * Default=[1]} * * @param versionno The value of versionno as equal. @@ -3177,7 +3131,7 @@ } /** - * NotEqual(!=). And NullIgnored, OnceRegistered. + * NotEqual(!=). And NullIgnored, OnlyOnceRegistered. * * @param versionno The value of versionno as notEqual. */ @@ -3186,7 +3140,7 @@ } /** - * GreaterThan(>). And NullIgnored, OnceRegistered. + * GreaterThan(>). And NullIgnored, OnlyOnceRegistered. * * @param versionno The value of versionno as greaterThan. */ @@ -3195,7 +3149,7 @@ } /** - * LessThan(<). And NullIgnored, OnceRegistered. + * LessThan(<). And NullIgnored, OnlyOnceRegistered. * * @param versionno The value of versionno as lessThan. */ @@ -3204,7 +3158,7 @@ } /** - * GreaterEqual(>=). And NullIgnored, OnceRegistered. + * GreaterEqual(>=). And NullIgnored, OnlyOnceRegistered. * * @param versionno The value of versionno as greaterEqual. */ @@ -3213,7 +3167,7 @@ } /** - * LessEqual(<=). And NullIgnored, OnceRegistered. + * LessEqual(<=). And NullIgnored, OnlyOnceRegistered. * * @param versionno The value of versionno as lessEqual. */ @@ -3253,6 +3207,50 @@ abstract protected ConditionValue getCValueVersionno(); + public SSQFunction scalar_Equal() { + return xcreateSSQFunction("="); + } + + public SSQFunction scalar_GreaterEqual() { + return xcreateSSQFunction(">="); + } + + public SSQFunction scalar_GreaterThan() { + return xcreateSSQFunction(">"); + } + + public SSQFunction scalar_LessEqual() { + return xcreateSSQFunction("<="); + } + + public SSQFunction scalar_LessThan() { + return xcreateSSQFunction("<"); + } + + protected SSQFunction xcreateSSQFunction(final String operand) { + return new SSQFunction(new SSQSetupper() { + public void setup(String function, SubQuery subQuery) { + xscalarSubQuery(function, subQuery, operand); + } + }); + } + + protected void xscalarSubQuery(String function, + SubQuery subQuery, String operand) { + assertObjectNotNull("subQuery", subQuery); + CompanyCB cb = new CompanyCB(); + cb.xsetupForScalarSubQuery(); + subQuery.query(cb); + String subQueryPropertyName = keepScalarSubQuery(cb.query()); // for + // saving + // query + // -value. + registerScalarSubQuery(function, cb.query(), subQueryPropertyName, + operand); + } + + public abstract String keepScalarSubQuery(CompanyCQ subQuery); + // Very Internal (for Suppressing Warn about 'Not Use Import') protected String getConditionBeanClassNameInternally() { return CompanyCB.class.getName(); Modified: addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/cbean/cq/bs/AbstractBsContactCQ.java =================================================================== --- addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/cbean/cq/bs/AbstractBsContactCQ.java 2008-12-27 22:02:56 UTC (rev 1623) +++ addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/cbean/cq/bs/AbstractBsContactCQ.java 2008-12-27 22:06:42 UTC (rev 1624) @@ -18,7 +18,6 @@ * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public abstract class AbstractBsContactCQ extends AbstractConditionQuery { //========================================================================== @@ -48,7 +47,8 @@ // ===== /** - * Equal(=). And NullIgnored, OnceRegistered. {PK : ID : NotNull : BIGINT} + * Equal(=). And NullIgnored, OnlyOnceRegistered. {PK : ID : NotNull : + * BIGINT} * * @param id The value of id as equal. */ @@ -57,7 +57,7 @@ } /** - * NotEqual(!=). And NullIgnored, OnceRegistered. + * NotEqual(!=). And NullIgnored, OnlyOnceRegistered. * * @param id The value of id as notEqual. */ @@ -66,7 +66,7 @@ } /** - * GreaterThan(>). And NullIgnored, OnceRegistered. + * GreaterThan(>). And NullIgnored, OnlyOnceRegistered. * * @param id The value of id as greaterThan. */ @@ -75,7 +75,7 @@ } /** - * LessThan(<). And NullIgnored, OnceRegistered. + * LessThan(<). And NullIgnored, OnlyOnceRegistered. * * @param id The value of id as lessThan. */ @@ -84,7 +84,7 @@ } /** - * GreaterEqual(>=). And NullIgnored, OnceRegistered. + * GreaterEqual(>=). And NullIgnored, OnlyOnceRegistered. * * @param id The value of id as greaterEqual. */ @@ -93,7 +93,7 @@ } /** - * LessEqual(<=). And NullIgnored, OnceRegistered. + * LessEqual(<=). And NullIgnored, OnlyOnceRegistered. * * @param id The value of id as lessEqual. */ @@ -122,14 +122,14 @@ } /** - * IsNull(is null). And OnceRegistered. + * IsNull(is null). And OnlyOnceRegistered. */ public void setId_IsNull() { regId(CK_ISN, DUMMY_OBJECT); } /** - * IsNotNull(is not null). And OnceRegistered. + * IsNotNull(is not null). And OnlyOnceRegistered. */ public void setId_IsNotNull() { regId(CK_ISNN, DUMMY_OBJECT); @@ -146,7 +146,7 @@ abstract protected ConditionValue getCValueId(); /** - * Equal(=). And NullIgnored, OnceRegistered. {NotNull : BIGINT : FK to + * Equal(=). And NullIgnored, OnlyOnceRegistered. {NotNull : BIGINT : FK to * PERSON} * * @param personId The value of personId as equal. @@ -156,7 +156,7 @@ } /** - * NotEqual(!=). And NullIgnored, OnceRegistered. + * NotEqual(!=). And NullIgnored, OnlyOnceRegistered. * * @param personId The value of personId as notEqual. */ @@ -165,7 +165,7 @@ } /** - * GreaterThan(>). And NullIgnored, OnceRegistered. + * GreaterThan(>). And NullIgnored, OnlyOnceRegistered. * * @param personId The value of personId as greaterThan. */ @@ -174,7 +174,7 @@ } /** - * LessThan(<). And NullIgnored, OnceRegistered. + * LessThan(<). And NullIgnored, OnlyOnceRegistered. * * @param personId The value of personId as lessThan. */ @@ -183,7 +183,7 @@ } /** - * GreaterEqual(>=). And NullIgnored, OnceRegistered. + * GreaterEqual(>=). And NullIgnored, OnlyOnceRegistered. * * @param personId The value of personId as greaterEqual. */ @@ -192,7 +192,7 @@ } /** - * LessEqual(<=). And NullIgnored, OnceRegistered. + * LessEqual(<=). And NullIgnored, OnlyOnceRegistered. * * @param personId The value of personId as lessEqual. */ @@ -220,33 +220,18 @@ regPersonId(CK_NINS, cTL(personIdList)); } - /** - * @param personCBquery Query. - * @deprecated Please use inScopePerson(subQuery) method. - */ - public void setPersonId_InScopeSubQuery_Person(PersonCQ personCBquery) { - String subQueryPropertyName = keepPersonId_InScopeSubQuery_Person(personCBquery);// for - // saving - // query - // - - // value - // . - registerInScopeSubQuery(personCBquery, "PERSON_ID", "ID", - subQueryPropertyName); - } - public void inScopePerson(SubQuery subQuery) { assertObjectNotNull("subQuery", subQuery); PersonCB cb = new PersonCB(); cb.xsetupForInScopeSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepPersonId_InScopeSubQuery_Person(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerInScopeSubQuery(cb.query(), "PERSON_ID", "ID", subQueryPropertyName); } - abstract public String keepPersonId_InScopeSubQuery_Person(PersonCQ subQuery); + public abstract String keepPersonId_InScopeSubQuery_Person(PersonCQ subQuery); protected void regPersonId(ConditionKey key, Object value) { registerQuery(key, value, getCValuePersonId(), "PERSON_ID", "PersonId", @@ -261,7 +246,8 @@ abstract protected ConditionValue getCValuePersonId(); /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {NotNull : VARCHAR(20)} + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {NotNull : + * VARCHAR(20)} * * @param name The value of name as equal. */ @@ -270,7 +256,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param name The value of name as notEqual. */ @@ -279,7 +265,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param name The value of name as greaterThan. */ @@ -288,7 +274,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param name The value of name as lessThan. */ @@ -297,7 +283,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param name The value of name as greaterEqual. */ @@ -306,7 +292,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param name The value of name as lessEqual. */ @@ -315,7 +301,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param name The value of name as prefixSearch. */ @@ -324,20 +310,6 @@ } /** - * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, - * SeveralRegistered. - * - * @param name The value of name as likeSearch. - * @param likeSearchOption The option of like-search. (NotNull) - */ - public void setName_LikeSearch( - String name, - jp.sf.pal.addresslist.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { - registerLikeSearchQuery(CK_LS, fRES(name), getCValueName(), "NAME", - "Name", "name", likeSearchOption); - } - - /** * InScope(in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * @@ -348,27 +320,41 @@ } /** - * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * - * @param name The collection of name as inScope. - * @param inScopeOption The option of in-scope. (NotNull) + * @param nameList The collection of name as notInScope. */ - public void setName_InScope( + public void setName_NotInScope(Collection nameList) { + regName(CK_NINS, cTL(nameList)); + } + + /** + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param name The value of name as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) + */ + public void setName_LikeSearch( String name, - jp.sf.pal.addresslist.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(name), getCValueName(), "NAME", - "Name", "name", inScopeOption); + jp.sf.pal.addresslist.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(name), getCValueName(), "NAME", "Name", "name", + likeSearchOption); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param nameList The collection of name as notInScope. + * @param name The value of name as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setName_NotInScope(Collection nameList) { - regName(CK_NINS, cTL(nameList)); + public void setName_NotLikeSearch( + String name, + jp.sf.pal.addresslist.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(name), getCValueName(), "NAME", "Name", "name", + likeSearchOption); } protected void regName(ConditionKey key, Object value) { @@ -382,7 +368,7 @@ abstract protected ConditionValue getCValueName(); /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {VARCHAR(255)} + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {VARCHAR(255)} * * @param value The value of value as equal. */ @@ -391,7 +377,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param value The value of value as notEqual. */ @@ -400,7 +386,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param value The value of value as greaterThan. */ @@ -409,7 +395,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param value The value of value as lessThan. */ @@ -418,7 +404,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param value The value of value as greaterEqual. */ @@ -427,7 +413,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param value The value of value as lessEqual. */ @@ -436,7 +422,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param value The value of value as prefixSearch. */ @@ -445,20 +431,6 @@ } /** - * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, - * SeveralRegistered. - * - * @param value The value of value as likeSearch. - * @param likeSearchOption The option of like-search. (NotNull) - */ - public void setValue_LikeSearch( - String value, - jp.sf.pal.addresslist.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { - registerLikeSearchQuery(CK_LS, fRES(value), getCValueValue(), "VALUE", - "Value", "value", likeSearchOption); - } - - /** * InScope(in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * @@ -469,38 +441,52 @@ } /** - * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * - * @param value The collection of value as inScope. - * @param inScopeOption The option of in-scope. (NotNull) + * @param valueList The collection of value as notInScope. */ - public void setValue_InScope( + public void setValue_NotInScope(Collection valueList) { + regValue(CK_NINS, cTL(valueList)); + } + + /** + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param value The value of value as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) + */ + public void setValue_LikeSearch( String value, - jp.sf.pal.addresslist.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(value), getCValueValue(), "VALUE", - "Value", "value", inScopeOption); + jp.sf.pal.addresslist.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(value), getCValueValue(), "VALUE", "Value", "value", + likeSearchOption); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param valueList The collection of value as notInScope. + * @param value The value of value as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setValue_NotInScope(Collection valueList) { - regValue(CK_NINS, cTL(valueList)); + public void setValue_NotLikeSearch( + String value, + jp.sf.pal.addresslist.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(value), getCValueValue(), "VALUE", "Value", + "value", likeSearchOption); } /** - * IsNull(is null). And OnceRegistered. + * IsNull(is null). And OnlyOnceRegistered. */ public void setValue_IsNull() { regValue(CK_ISN, DUMMY_OBJECT); } /** - * IsNotNull(is not null). And OnceRegistered. + * IsNotNull(is not null). And OnlyOnceRegistered. */ public void setValue_IsNotNull() { regValue(CK_ISNN, DUMMY_OBJECT); @@ -517,6 +503,50 @@ abstract protected ConditionValue getCValueValue(); + public SSQFunction scalar_Equal() { + return xcreateSSQFunction("="); + } + + public SSQFunction scalar_GreaterEqual() { + return xcreateSSQFunction(">="); + } + + public SSQFunction scalar_GreaterThan() { + return xcreateSSQFunction(">"); + } + + public SSQFunction scalar_LessEqual() { + return xcreateSSQFunction("<="); + } + + public SSQFunction scalar_LessThan() { + return xcreateSSQFunction("<"); + } + + protected SSQFunction xcreateSSQFunction(final String operand) { + return new SSQFunction(new SSQSetupper() { + public void setup(String function, SubQuery subQuery) { + xscalarSubQuery(function, subQuery, operand); + } + }); + } + + protected void xscalarSubQuery(String function, + SubQuery subQuery, String operand) { + assertObjectNotNull("subQuery", subQuery); + ContactCB cb = new ContactCB(); + cb.xsetupForScalarSubQuery(); + subQuery.query(cb); + String subQueryPropertyName = keepScalarSubQuery(cb.query()); // for + // saving + // query + // -value. + registerScalarSubQuery(function, cb.query(), subQueryPropertyName, + operand); + } + + public abstract String keepScalarSubQuery(ContactCQ subQuery); + // Very Internal (for Suppressing Warn about 'Not Use Import') protected String getConditionBeanClassNameInternally() { return ContactCB.class.getName(); Modified: addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/cbean/cq/bs/AbstractBsCustomCQ.java =================================================================== --- addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/cbean/cq/bs/AbstractBsCustomCQ.java 2008-12-27 22:02:56 UTC (rev 1623) +++ addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/cbean/cq/bs/AbstractBsCustomCQ.java 2008-12-27 22:06:42 UTC (rev 1624) @@ -18,7 +18,6 @@ * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public abstract class AbstractBsCustomCQ extends AbstractConditionQuery { //========================================================================== @@ -48,7 +47,8 @@ // ===== /** - * Equal(=). And NullIgnored, OnceRegistered. {PK : ID : NotNull : BIGINT} + * Equal(=). And NullIgnored, OnlyOnceRegistered. {PK : ID : NotNull : + * BIGINT} * * @param id The value of id as equal. */ @@ -57,7 +57,7 @@ } /** - * NotEqual(!=). And NullIgnored, OnceRegistered. + * NotEqual(!=). And NullIgnored, OnlyOnceRegistered. * * @param id The value of id as notEqual. */ @@ -66,7 +66,7 @@ } /** - * GreaterThan(>). And NullIgnored, OnceRegistered. + * GreaterThan(>). And NullIgnored, OnlyOnceRegistered. * * @param id The value of id as greaterThan. */ @@ -75,7 +75,7 @@ } /** - * LessThan(<). And NullIgnored, OnceRegistered. + * LessThan(<). And NullIgnored, OnlyOnceRegistered. * * @param id The value of id as lessThan. */ @@ -84,7 +84,7 @@ } /** - * GreaterEqual(>=). And NullIgnored, OnceRegistered. + * GreaterEqual(>=). And NullIgnored, OnlyOnceRegistered. * * @param id The value of id as greaterEqual. */ @@ -93,7 +93,7 @@ } /** - * LessEqual(<=). And NullIgnored, OnceRegistered. + * LessEqual(<=). And NullIgnored, OnlyOnceRegistered. * * @param id The value of id as lessEqual. */ @@ -122,14 +122,14 @@ } /** - * IsNull(is null). And OnceRegistered. + * IsNull(is null). And OnlyOnceRegistered. */ public void setId_IsNull() { regId(CK_ISN, DUMMY_OBJECT); } /** - * IsNotNull(is not null). And OnceRegistered. + * IsNotNull(is not null). And OnlyOnceRegistered. */ public void setId_IsNotNull() { regId(CK_ISNN, DUMMY_OBJECT); @@ -146,7 +146,7 @@ abstract protected ConditionValue getCValueId(); /** - * Equal(=). And NullIgnored, OnceRegistered. {NotNull : BIGINT : FK to + * Equal(=). And NullIgnored, OnlyOnceRegistered. {NotNull : BIGINT : FK to * PERSON} * * @param personId The value of personId as equal. @@ -156,7 +156,7 @@ } /** - * NotEqual(!=). And NullIgnored, OnceRegistered. + * NotEqual(!=). And NullIgnored, OnlyOnceRegistered. * * @param personId The value of personId as notEqual. */ @@ -165,7 +165,7 @@ } /** - * GreaterThan(>). And NullIgnored, OnceRegistered. + * GreaterThan(>). And NullIgnored, OnlyOnceRegistered. * * @param personId The value of personId as greaterThan. */ @@ -174,7 +174,7 @@ } /** - * LessThan(<). And NullIgnored, OnceRegistered. + * LessThan(<). And NullIgnored, OnlyOnceRegistered. * * @param personId The value of personId as lessThan. */ @@ -183,7 +183,7 @@ } /** - * GreaterEqual(>=). And NullIgnored, OnceRegistered. + * GreaterEqual(>=). And NullIgnored, OnlyOnceRegistered. * * @param personId The value of personId as greaterEqual. */ @@ -192,7 +192,7 @@ } /** - * LessEqual(<=). And NullIgnored, OnceRegistered. + * LessEqual(<=). And NullIgnored, OnlyOnceRegistered. * * @param personId The value of personId as lessEqual. */ @@ -220,33 +220,18 @@ regPersonId(CK_NINS, cTL(personIdList)); } - /** - * @param personCBquery Query. - * @deprecated Please use inScopePerson(subQuery) method. - */ - public void setPersonId_InScopeSubQuery_Person(PersonCQ personCBquery) { - String subQueryPropertyName = keepPersonId_InScopeSubQuery_Person(personCBquery);// for - // saving - // query - // - - // value - // . - registerInScopeSubQuery(personCBquery, "PERSON_ID", "ID", - subQueryPropertyName); - } - public void inScopePerson(SubQuery subQuery) { assertObjectNotNull("subQuery", subQuery); PersonCB cb = new PersonCB(); cb.xsetupForInScopeSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepPersonId_InScopeSubQuery_Person(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerInScopeSubQuery(cb.query(), "PERSON_ID", "ID", subQueryPropertyName); } - abstract public String keepPersonId_InScopeSubQuery_Person(PersonCQ subQuery); + public abstract String keepPersonId_InScopeSubQuery_Person(PersonCQ subQuery); protected void regPersonId(ConditionKey key, Object value) { registerQuery(key, value, getCValuePersonId(), "PERSON_ID", "PersonId", @@ -261,7 +246,7 @@ abstract protected ConditionValue getCValuePersonId(); /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {VARCHAR(255)} + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {VARCHAR(255)} * * @param value The value of value as equal. */ @@ -270,7 +255,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param value The value of value as notEqual. */ @@ -279,7 +264,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param value The value of value as greaterThan. */ @@ -288,7 +273,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param value The value of value as lessThan. */ @@ -297,7 +282,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param value The value of value as greaterEqual. */ @@ -306,7 +291,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param value The value of value as lessEqual. */ @@ -315,7 +300,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param value The value of value as prefixSearch. */ @@ -324,20 +309,6 @@ } /** - * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, - * SeveralRegistered. - * - * @param value The value of value as likeSearch. - * @param likeSearchOption The option of like-search. (NotNull) - */ - public void setValue_LikeSearch( - String value, - jp.sf.pal.addresslist.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { - registerLikeSearchQuery(CK_LS, fRES(value), getCValueValue(), "VALUE", - "Value", "value", likeSearchOption); - } - - /** * InScope(in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * @@ -348,38 +319,52 @@ } /** - * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * - * @param value The collection of value as inScope. - * @param inScopeOption The option of in-scope. (NotNull) + * @param valueList The collection of value as notInScope. */ - public void setValue_InScope( + public void setValue_NotInScope(Collection valueList) { + regValue(CK_NINS, cTL(valueList)); + } + + /** + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param value The value of value as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) + */ + public void setValue_LikeSearch( String value, - jp.sf.pal.addresslist.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(value), getCValueValue(), "VALUE", - "Value", "value", inScopeOption); + jp.sf.pal.addresslist.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(value), getCValueValue(), "VALUE", "Value", "value", + likeSearchOption); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param valueList The collection of value as notInScope. + * @param value The value of value as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setValue_NotInScope(Collection valueList) { - regValue(CK_NINS, cTL(valueList)); + public void setValue_NotLikeSearch( + String value, + jp.sf.pal.addresslist.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(value), getCValueValue(), "VALUE", "Value", + "value", likeSearchOption); } /** - * IsNull(is null). And OnceRegistered. + * IsNull(is null). And OnlyOnceRegistered. */ public void setValue_IsNull() { regValue(CK_ISN, DUMMY_OBJECT); } /** - * IsNotNull(is not null). And OnceRegistered. + * IsNotNull(is not null). And OnlyOnceRegistered. */ public void setValue_IsNotNull() { regValue(CK_ISNN, DUMMY_OBJECT); @@ -397,7 +382,7 @@ abstract protected ConditionValue getCValueValue(); /** - * Equal(=). And NullIgnored, OnceRegistered. {NotNull : INTEGER} + * Equal(=). And NullIgnored, OnlyOnceRegistered. {NotNull : INTEGER} * * @param sortOrder The value of sortOrder as equal. */ @@ -406,7 +391,7 @@ } /** - * NotEqual(!=). And NullIgnored, OnceRegistered. + * NotEqual(!=). And NullIgnored, OnlyOnceRegistered. * * @param sortOrder The value of sortOrder as notEqual. */ @@ -415,7 +400,7 @@ } /** - * GreaterThan(>). And NullIgnored, OnceRegistered. + * GreaterThan(>). And NullIgnored, OnlyOnceRegistered. * * @param sortOrder The value of sortOrder as greaterThan. */ @@ -424,7 +409,7 @@ } /** - * LessThan(<). And NullIgnored, OnceRegistered. + * LessThan(<). And NullIgnored, OnlyOnceRegistered. * * @param sortOrder The value of sortOrder as lessThan. */ @@ -433,7 +418,7 @@ } /** - * GreaterEqual(>=). And NullIgnored, OnceRegistered. + * GreaterEqual(>=). And NullIgnored, OnlyOnceRegistered. * * @param sortOrder The value of sortOrder as greaterEqual. */ @@ -442,7 +427,7 @@ } /** - * LessEqual(<=). And NullIgnored, OnceRegistered. + * LessEqual(<=). And NullIgnored, OnlyOnceRegistered. * * @param sortOrder The value of sortOrder as lessEqual. */ @@ -482,6 +467,50 @@ abstract protected ConditionValue getCValueSortOrder(); + public SSQFunction scalar_Equal() { + return xcreateSSQFunction("="); + } + + public SSQFunction scalar_GreaterEqual() { + return xcreateSSQFunction(">="); + } + + public SSQFunction scalar_GreaterThan() { + return xcreateSSQFunction(">"); + } + + public SSQFunction scalar_LessEqual() { + return xcreateSSQFunction("<="); + } + + public SSQFunction scalar_LessThan() { + return xcreateSSQFunction("<"); + } + + protected SSQFunction xcreateSSQFunction(final String operand) { + return new SSQFunction(new SSQSetupper() { + public void setup(String function, SubQuery subQuery) { + xscalarSubQuery(function, subQuery, operand); + } + }); + } + + protected void xscalarSubQuery(String function, + SubQuery subQuery, String operand) { + assertObjectNotNull("subQuery", subQuery); + CustomCB cb = new CustomCB(); + cb.xsetupForScalarSubQuery(); + subQuery.query(cb); + String subQueryPropertyName = keepScalarSubQuery(cb.query()); // for + // saving + // query + // -value. + registerScalarSubQuery(function, cb.query(), subQueryPropertyName, + operand); + } + + public abstract String keepScalarSubQuery(CustomCQ subQuery); + // Very Internal (for Suppressing Warn about 'Not Use Import') protected String getConditionBeanClassNameInternally() { return CustomCB.class.getName(); Modified: addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/cbean/cq/bs/AbstractBsGroupInfoCQ.java =================================================================== --- addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/cbean/cq/bs/AbstractBsGroupInfoCQ.java 2008-12-27 22:02:56 UTC (rev 1623) +++ addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/cbean/cq/bs/AbstractBsGroupInfoCQ.java 2008-12-27 22:06:42 UTC (rev 1624) @@ -20,7 +20,6 @@ * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public abstract class AbstractBsGroupInfoCQ extends AbstractConditionQuery { //========================================================================== @@ -50,7 +49,7 @@ // ===== /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {PK : NotNull : + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {PK : NotNull : * VARCHAR(255)} * * @param groupId The value of groupId as equal. @@ -60,7 +59,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param groupId The value of groupId as notEqual. */ @@ -69,7 +68,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param groupId The value of groupId as greaterThan. */ @@ -78,7 +77,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param groupId The value of groupId as lessThan. */ @@ -87,7 +86,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param groupId The value of groupId as greaterEqual. */ @@ -96,7 +95,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param groupId The value of groupId as lessEqual. */ @@ -105,7 +104,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param groupId The value of groupId as prefixSearch. */ @@ -114,20 +113,6 @@ } /** - * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, - * SeveralRegistered. - * - * @param groupId The value of groupId as likeSearch. - * @param likeSearchOption The option of like-search. (NotNull) - */ - public void setGroupId_LikeSearch( - String groupId, - jp.sf.pal.addresslist.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { - registerLikeSearchQuery(CK_LS, fRES(groupId), getCValueGroupId(), - "GROUP_ID", "GroupId", "groupId", likeSearchOption); - } - - /** * InScope(in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * @@ -138,43 +123,41 @@ } /** - * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * - * @param groupId The collection of groupId as inScope. - * @param inScopeOption The option of in-scope. (NotNull) + * @param groupIdList The collection of groupId as notInScope. */ - public void setGroupId_InScope( - String groupId, - jp.sf.pal.addresslist.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(groupId), getCValueGroupId(), - "GROUP_ID", "GroupId", "groupId", inScopeOption); + public void setGroupId_NotInScope(Collection groupIdList) { + regGroupId(CK_NINS, cTL(groupIdList)); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param groupIdList The collection of groupId as notInScope. + * @param groupId The value of groupId as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) */ - public void setGroupId_NotInScope(Collection groupIdList) { - regGroupId(CK_NINS, cTL(groupIdList)); + public void setGroupId_LikeSearch( + String groupId, + jp.sf.pal.addresslist.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(groupId), getCValueGroupId(), "GROUP_ID", "GroupId", + "groupId", likeSearchOption); } /** - * @param groupMappingCBquery Query. - * @deprecated Please use inScopeGroupMappingList(subQuery) method. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param groupId The value of groupId as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setGroupId_InScopeSubQuery_GroupMappingList( - GroupMappingCQ groupMappingCBquery) { - String subQueryPropertyName = keepGroupId_InScopeSubQuery_GroupMappingList(groupMappingCBquery);// for - // saving - // query - // - - // value - // . - registerInScopeSubQuery(groupMappingCBquery, "GROUP_ID", "GROUP_ID", - subQueryPropertyName); + public void setGroupId_NotLikeSearch( + String groupId, + jp.sf.pal.addresslist.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(groupId), getCValueGroupId(), "GROUP_ID", + "GroupId", "groupId", likeSearchOption); } public void inScopeGroupMappingList(SubQuery subQuery) { @@ -183,42 +166,26 @@ cb.xsetupForInScopeSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepGroupId_InScopeSubQuery_GroupMappingList(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerInScopeSubQuery(cb.query(), "GROUP_ID", "GROUP_ID", subQueryPropertyName); } - abstract public String keepGroupId_InScopeSubQuery_GroupMappingList( + public abstract String keepGroupId_InScopeSubQuery_GroupMappingList( GroupMappingCQ subQuery); - /** - * @param userInfoCBquery Query. - * @deprecated Please use inScopeUserInfoList(subQuery) method. - */ - public void setGroupId_InScopeSubQuery_UserInfoList( - UserInfoCQ userInfoCBquery) { - String subQueryPropertyName = keepGroupId_InScopeSubQuery_UserInfoList(userInfoCBquery);// for - // saving - // query - // - - // value - // . - registerInScopeSubQuery(userInfoCBquery, "GROUP_ID", "GROUP_ID", - subQueryPropertyName); - } - public void inScopeUserInfoList(SubQuery subQuery) { assertObjectNotNull("subQuery", subQuery); UserInfoCB cb = new UserInfoCB(); cb.xsetupForInScopeSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepGroupId_InScopeSubQuery_UserInfoList(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerInScopeSubQuery(cb.query(), "GROUP_ID", "GROUP_ID", subQueryPropertyName); } - abstract public String keepGroupId_InScopeSubQuery_UserInfoList( + public abstract String keepGroupId_InScopeSubQuery_UserInfoList( UserInfoCQ subQuery); public void notInScopeGroupMappingList(SubQuery subQuery) { @@ -227,12 +194,12 @@ cb.xsetupForInScopeSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepGroupId_NotInScopeSubQuery_GroupMappingList(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerNotInScopeSubQuery(cb.query(), "GROUP_ID", "GROUP_ID", subQueryPropertyName); } - abstract public String keepGroupId_NotInScopeSubQuery_GroupMappingList( + public abstract String keepGroupId_NotInScopeSubQuery_GroupMappingList( GroupMappingCQ subQuery); public void notInScopeUserInfoList(SubQuery subQuery) { @@ -241,31 +208,15 @@ cb.xsetupForInScopeSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepGroupId_NotInScopeSubQuery_UserInfoList(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerNotInScopeSubQuery(cb.query(), "GROUP_ID", "GROUP_ID", subQueryPropertyName); } - abstract public String keepGroupId_NotInScopeSubQuery_UserInfoList( + public abstract String keepGroupId_NotInScopeSubQuery_UserInfoList( UserInfoCQ subQuery); /** - * @param groupMappingCBquery Query. - * @deprecated Please use existsGroupMappingList(subQuery) method. - */ - public void setGroupId_ExistsSubQuery_GroupMappingList( - GroupMappingCQ groupMappingCBquery) { - String subQueryPropertyName = keepGroupId_ExistsSubQuery_GroupMappingList(groupMappingCBquery);// for - // saving - // query - // - - // value - // . - registerExistsSubQuery(groupMappingCBquery, "GROUP_ID", "GROUP_ID", - subQueryPropertyName); - } - - /** * Set up 'exists' sub-query. {exists (select GROUP_ID from GROUP_MAPPING * where ...)} * @@ -278,31 +229,15 @@ cb.xsetupForExistsSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepGroupId_ExistsSubQuery_GroupMappingList(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerExistsSubQuery(cb.query(), "GROUP_ID", "GROUP_ID", subQueryPropertyName); } - abstract public String keepGroupId_ExistsSubQuery_GroupMappingList( + public abstract String keepGroupId_ExistsSubQuery_GroupMappingList( GroupMappingCQ subQuery); /** - * @param userInfoCBquery Query. - * @deprecated Please use existsUserInfoList(subQuery) method. - */ - public void setGroupId_ExistsSubQuery_UserInfoList( - UserInfoCQ userInfoCBquery) { - String subQueryPropertyName = keepGroupId_ExistsSubQuery_UserInfoList(userInfoCBquery);// for - // saving - // query - // - - // value - // . - registerExistsSubQuery(userInfoCBquery, "GROUP_ID", "GROUP_ID", - subQueryPropertyName); - } - - /** * Set up 'exists' sub-query. {exists (select GROUP_ID from USER_INFO where * ...)} * @@ -315,12 +250,12 @@ cb.xsetupForExistsSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepGroupId_ExistsSubQuery_UserInfoList(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerExistsSubQuery(cb.query(), "GROUP_ID", "GROUP_ID", subQueryPropertyName); } - abstract public String keepGroupId_ExistsSubQuery_UserInfoList( + public abstract String keepGroupId_ExistsSubQuery_UserInfoList( UserInfoCQ subQuery); /** @@ -337,12 +272,12 @@ cb.xsetupForExistsSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepGroupId_NotExistsSubQuery_GroupMappingList(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerNotExistsSubQuery(cb.query(), "GROUP_ID", "GROUP_ID", subQueryPropertyName); } - abstract public String keepGroupId_NotExistsSubQuery_GroupMappingList( + public abstract String keepGroupId_NotExistsSubQuery_GroupMappingList( GroupMappingCQ subQuery); /** @@ -358,53 +293,53 @@ cb.xsetupForExistsSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepGroupId_NotExistsSubQuery_UserInfoList(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerNotExistsSubQuery(cb.query(), "GROUP_ID", "GROUP_ID", subQueryPropertyName); } - abstract public String keepGroupId_NotExistsSubQuery_UserInfoList( + public abstract String keepGroupId_NotExistsSubQuery_UserInfoList( UserInfoCQ subQuery); public void xderiveGroupMappingList(String function, SubQuery subQuery, String aliasName) { assertObjectNotNull("subQuery", subQuery); GroupMappingCB cb = new GroupMappingCB(); - cb.xsetupForDeriveReferrer(); + cb.xsetupForDerivedReferrer(); subQuery.query(cb); - String subQueryPropertyName = keepGroupId_DeriveSubQuery_GroupMappingList(cb - .query());// for saving query-value. - registerDeriveSubQuery(function, cb.query(), "GROUP_ID", "GROUP_ID", - subQueryPropertyName, aliasName); + String subQueryPropertyName = keepGroupId_DerivedReferrer_GroupMappingList(cb + .query()); // for saving query-value. + registerDerivedReferrerSubQuery(function, cb.query(), "GROUP_ID", + "GROUP_ID", subQueryPropertyName, aliasName); } - abstract public String keepGroupId_DeriveSubQuery_GroupMappingList( + public abstract String keepGroupId_DerivedReferrer_GroupMappingList( GroupMappingCQ subQuery); public void xderiveUserInfoList(String function, SubQuery subQuery, String aliasName) { assertObjectNotNull("subQuery", subQuery); UserInfoCB cb = new UserInfoCB(); - cb.xsetupForDeriveReferrer(); + cb.xsetupForDerivedReferrer(); subQuery.query(cb); - String subQueryPropertyName = keepGroupId_DeriveSubQuery_UserInfoList(cb - .query());// for saving query-value. - registerDeriveSubQuery(function, cb.query(), "GROUP_ID", "GROUP_ID", - subQueryPropertyName, aliasName); + String subQueryPropertyName = keepGroupId_DerivedReferrer_UserInfoList(cb + .query()); // for saving query-value. + registerDerivedReferrerSubQuery(function, cb.query(), "GROUP_ID", + "GROUP_ID", subQueryPropertyName, aliasName); } - abstract public String keepGroupId_DeriveSubQuery_UserInfoList( + public abstract String keepGroupId_DerivedReferrer_UserInfoList( UserInfoCQ subQuery); /** - * IsNull(is null). And OnceRegistered. + * IsNull(is null). And OnlyOnceRegistered. */ public void setGroupId_IsNull() { regGroupId(CK_ISN, DUMMY_OBJECT); } /** - * IsNotNull(is not null). And OnceRegistered. + * IsNotNull(is not null). And OnlyOnceRegistered. */ public void setGroupId_IsNotNull() { regGroupId(CK_ISNN, DUMMY_OBJECT); @@ -423,7 +358,7 @@ abstract protected ConditionValue getCValueGroupId(); /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {VARCHAR(100)} + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {VARCHAR(100)} * * @param name The value of name as equal. */ @@ -432,7 +367,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param name The value of name as notEqual. */ @@ -441,7 +376,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param name The value of name as greaterThan. */ @@ -450,7 +385,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param name The value of name as lessThan. */ @@ -459,7 +394,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param name The value of name as greaterEqual. */ @@ -468,7 +403,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param name The value of name as lessEqual. */ @@ -477,7 +412,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param name The value of name as prefixSearch. */ @@ -486,20 +421,6 @@ } /** - * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, - * SeveralRegistered. - * - * @param name The value of name as likeSearch. - * @param likeSearchOption The option of like-search. (NotNull) - */ - public void setName_LikeSearch( - String name, - jp.sf.pal.addresslist.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { - registerLikeSearchQuery(CK_LS, fRES(name), getCValueName(), "NAME", - "Name", "name", likeSearchOption); - } - - /** * InScope(in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * @@ -510,38 +431,52 @@ } /** - * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * - * @param name The collection of name as inScope. - * @param inScopeOption The option of in-scope. (NotNull) + * @param nameList The collection of name as notInScope. */ - public void setName_InScope( + public void setName_NotInScope(Collection nameList) { + regName(CK_NINS, cTL(nameList)); + } + + /** + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param name The value of name as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) + */ + public void setName_LikeSearch( String name, - jp.sf.pal.addresslist.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(name), getCValueName(), "NAME", - "Name", "name", inScopeOption); + jp.sf.pal.addresslist.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(name), getCValueName(), "NAME", "Name", "name", + likeSearchOption); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param nameList The collection of name as notInScope. + * @param name The value of name as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setName_NotInScope(Collection nameList) { - regName(CK_NINS, cTL(nameList)); + public void setName_NotLikeSearch( + String name, + jp.sf.pal.addresslist.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(name), getCValueName(), "NAME", "Name", "name", + likeSearchOption); } /** - * IsNull(is null). And OnceRegistered. + * IsNull(is null). And OnlyOnceRegistered. */ public void setName_IsNull() { regName(CK_ISN, DUMMY_OBJECT); } /** - * IsNotNull(is not null). And OnceRegistered. + * IsNotNull(is not null). And OnlyOnceRegistered. */ public void setName_IsNotNull() { regName(CK_ISNN, DUMMY_OBJECT); @@ -558,7 +493,7 @@ abstract protected ConditionValue getCValueName(); /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {VARCHAR(255)} + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {VARCHAR(255)} * * @param description The value of description as equal. */ @@ -567,7 +502,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param description The value of description as notEqual. */ @@ -576,7 +511,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param description The value of description as greaterThan. */ @@ -585,7 +520,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param description The value of description as lessThan. */ @@ -594,7 +529,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param description The value of description as greaterEqual. */ @@ -603,7 +538,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param description The value of description as lessEqual. */ @@ -612,7 +547,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param description The value of description as prefixSearch. */ @@ -621,21 +556,6 @@ } /** - * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, - * SeveralRegistered. - * - * @param description The value of description as likeSearch. - * @param likeSearchOption The option of like-search. (NotNull) - */ - public void setDescription_LikeSearch( - String description, - jp.sf.pal.addresslist.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { - registerLikeSearchQuery(CK_LS, fRES(description), - getCValueDescription(), "DESCRIPTION", "Description", - "description", likeSearchOption); - } - - /** * InScope(in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * @@ -646,38 +566,52 @@ } /** - * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * - * @param description The collection of description as inScope. - * @param inScopeOption The option of in-scope. (NotNull) + * @param descriptionList The collection of description as notInScope. */ - public void setDescription_InScope( + public void setDescription_NotInScope(Collection descriptionList) { + regDescription(CK_NINS, cTL(descriptionList)); + } + + /** + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param description The value of description as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) + */ + public void setDescription_LikeSearch( String description, - jp.sf.pal.addresslist.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(description), getCValueDescription(), - "DESCRIPTION", "Description", "description", inScopeOption); + jp.sf.pal.addresslist.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(description), getCValueDescription(), "DESCRIPTION", + "Description", "description", likeSearchOption); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param descriptionList The collection of description as notInScope. + * @param description The value of description as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setDescription_NotInScope(Collection descriptionList) { - regDescription(CK_NINS, cTL(descriptionList)); + public void setDescription_NotLikeSearch( + String description, + jp.sf.pal.addresslist.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(description), getCValueDescription(), + "DESCRIPTION", "Description", "description", likeSearchOption); } /** - * IsNull(is null). And OnceRegistered. + * IsNull(is null). And OnlyOnceRegistered. */ public void setDescription_IsNull() { regDescription(CK_ISN, DUMMY_OBJECT); } /** - * IsNotNull(is not null). And OnceRegistered. + * IsNotNull(is not null). And OnlyOnceRegistered. */ public void setDescription_IsNotNull() { regDescription(CK_ISNN, DUMMY_OBJECT); @@ -696,7 +630,7 @@ abstract protected ConditionValue getCValueDescription(); /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {VARCHAR(255)} + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {VARCHAR(255)} * * @param email The value of email as equal. */ @@ -705,7 +639,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param email The value of email as notEqual. */ @@ -714,7 +648,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param email The value of email as greaterThan. */ @@ -723,7 +657,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param email The value of email as lessThan. */ @@ -732,7 +666,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param email The value of email as greaterEqual. */ @@ -741,7 +675,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param email The value of email as lessEqual. */ @@ -750,7 +684,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param email The value of email as prefixSearch. */ @@ -759,20 +693,6 @@ } /** - * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, - * SeveralRegistered. - * - * @param email The value of email as likeSearch. - * @param likeSearchOption The option of like-search. (NotNull) - */ - public void setEmail_LikeSearch( - String email, - jp.sf.pal.addresslist.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { - registerLikeSearchQuery(CK_LS, fRES(email), getCValueEmail(), "EMAIL", - "Email", "email", likeSearchOption); - } - - /** * InScope(in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * @@ -783,38 +703,52 @@ } /** - * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * - * @param email The collection of email as inScope. - * @param inScopeOption The option of in-scope. (NotNull) + * @param emailList The collection of email as notInScope. */ - public void setEmail_InScope( + public void setEmail_NotInScope(Collection emailList) { + regEmail(CK_NINS, cTL(emailList)); + } + + /** + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param email The value of email as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) + */ + public void setEmail_LikeSearch( String email, - jp.sf.pal.addresslist.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(email), getCValueEmail(), "EMAIL", - "Email", "email", inScopeOption); + jp.sf.pal.addresslist.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(email), getCValueEmail(), "EMAIL", "Email", "email", + likeSearchOption); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param emailList The collection of email as notInScope. + * @param email The value of email as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setEmail_NotInScope(Collection emailList) { - regEmail(CK_NINS, cTL(emailList)); + public void setEmail_NotLikeSearch( + String email, + jp.sf.pal.addresslist.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(email), getCValueEmail(), "EMAIL", "Email", + "email", likeSearchOption); } /** - * IsNull(is null). And OnceRegistered. + * IsNull(is null). And OnlyOnceRegistered. */ public void setEmail_IsNull() { regEmail(CK_ISN, DUMMY_OBJECT); } /** - * IsNotNull(is not null). And OnceRegistered. + * IsNotNull(is not null). And OnlyOnceRegistered. */ public void setEmail_IsNotNull() { regEmail(CK_ISNN, DUMMY_OBJECT); @@ -832,7 +766,7 @@ abstract protected ConditionValue getCValueEmail(); /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {VARCHAR(255)} + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {VARCHAR(255)} * * @param url The value of url as equal. */ @@ -841,7 +775,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param url The value of url as notEqual. */ @@ -850,7 +784,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param url The value of url as greaterThan. */ @@ -859,7 +793,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param url The value of url as lessThan. */ @@ -868,7 +802,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param url The value of url as greaterEqual. */ @@ -877,7 +811,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param url The value of url as lessEqual. */ @@ -886,7 +820,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param url The value of url as prefixSearch. */ @@ -895,20 +829,6 @@ } /** - * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, - * SeveralRegistered. - * - * @param url The value of url as likeSearch. - * @param likeSearchOption The option of like-search. (NotNull) - */ - public void setUrl_LikeSearch( - String url, - jp.sf.pal.addresslist.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { - registerLikeSearchQuery(CK_LS, fRES(url), getCValueUrl(), "URL", "Url", - "url", likeSearchOption); - } - - /** * InScope(in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * @@ -919,38 +839,52 @@ } /** - * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * - * @param url The collection of url as inScope. - * @param inScopeOption The option of in-scope. (NotNull) + * @param urlList The collection of url as notInScope. */ - public void setUrl_InScope( + public void setUrl_NotInScope(Collection urlList) { + regUrl(CK_NINS, cTL(urlList)); + } + + /** + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param url The value of url as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) + */ + public void setUrl_LikeSearch( String url, - jp.sf.pal.addresslist.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(url), getCValueUrl(), "URL", "Url", - "url", inScopeOption); + jp.sf.pal.addresslist.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(url), getCValueUrl(), "URL", "Url", "url", + likeSearchOption); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param urlList The collection of url as notInScope. + * @param url The value of url as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setUrl_NotInScope(Collection urlList) { - regUrl(CK_NINS, cTL(urlList)); + public void setUrl_NotLikeSearch( + String url, + jp.sf.pal.addresslist.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(url), getCValueUrl(), "URL", "Url", "url", + likeSearchOption); } /** - * IsNull(is null). And OnceRegistered. + * IsNull(is null). And OnlyOnceRegistered. */ public void setUrl_IsNull() { regUrl(CK_ISN, DUMMY_OBJECT); } /** - * IsNotNull(is not null). And OnceRegistered. + * IsNotNull(is not null). And OnlyOnceRegistered. */ public void setUrl_IsNotNull() { regUrl(CK_ISNN, DUMMY_OBJECT); @@ -967,7 +901,7 @@ abstract protected ConditionValue getCValueUrl(); /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {VARCHAR(40)} + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {VARCHAR(40)} * * @param telephone The value of telephone as equal. */ @@ -976,7 +910,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param telephone The value of telephone as notEqual. */ @@ -985,7 +919,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param telephone The value of telephone as greaterThan. */ @@ -994,7 +928,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param telephone The value of telephone as lessThan. */ @@ -1003,7 +937,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param telephone The value of telephone as greaterEqual. */ @@ -1012,7 +946,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param telephone The value of telephone as lessEqual. */ @@ -1021,7 +955,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param telephone The value of telephone as prefixSearch. */ @@ -1030,20 +964,6 @@ } /** - * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, - * SeveralRegistered. - * - * @param telephone The value of telephone as likeSearch. - * @param likeSearchOption The option of like-search. (NotNull) - */ - public void setTelephone_LikeSearch( - String telephone, - jp.sf.pal.addresslist.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { - registerLikeSearchQuery(CK_LS, fRES(telephone), getCValueTelephone(), - "TELEPHONE", "Telephone", "telephone", likeSearchOption); - } - - /** * InScope(in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * @@ -1054,38 +974,52 @@ } /** - * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * - * @param telephone The collection of telephone as inScope. - * @param inScopeOption The option of in-scope. (NotNull) + * @param telephoneList The collection of telephone as notInScope. */ - public void setTelephone_InScope( + public void setTelephone_NotInScope(Collection telephoneList) { + regTelephone(CK_NINS, cTL(telephoneList)); + } + + /** + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param telephone The value of telephone as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) + */ + public void setTelephone_LikeSearch( String telephone, - jp.sf.pal.addresslist.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(telephone), getCValueTelephone(), - "TELEPHONE", "Telephone", "telephone", inScopeOption); + jp.sf.pal.addresslist.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(telephone), getCValueTelephone(), "TELEPHONE", + "Telephone", "telephone", likeSearchOption); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param telephoneList The collection of telephone as notInScope. + * @param telephone The value of telephone as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setTelephone_NotInScope(Collection telephoneList) { - regTelephone(CK_NINS, cTL(telephoneList)); + public void setTelephone_NotLikeSearch( + String telephone, + jp.sf.pal.addresslist.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(telephone), getCValueTelephone(), "TELEPHONE", + "Telephone", "telephone", likeSearchOption); } /** - * IsNull(is null). And OnceRegistered. + * IsNull(is null). And OnlyOnceRegistered. */ public void setTelephone_IsNull() { regTelephone(CK_ISN, DUMMY_OBJECT); } /** - * IsNotNull(is not null). And OnceRegistered. + * IsNotNull(is not null). And OnlyOnceRegistered. */ public void setTelephone_IsNotNull() { regTelephone(CK_ISNN, DUMMY_OBJECT); @@ -1104,7 +1038,7 @@ abstract protected ConditionValue getCValueTelephone(); /** - * Equal(=). And NullIgnored, OnceRegistered. {NotNull : TIMESTAMP} + * Equal(=). And NullIgnored, OnlyOnceRegistered. {NotNull : TIMESTAMP} * * @param createdTime The value of createdTime as equal. */ @@ -1113,7 +1047,7 @@ } /** - * NotEqual(!=). And NullIgnored, OnceRegistered. + * NotEqual(!=). And NullIgnored, OnlyOnceRegistered. * * @param createdTime The value of createdTime as notEqual. */ @@ -1122,7 +1056,7 @@ } /** - * GreaterThan(>). And NullIgnored, OnceRegistered. + * GreaterThan(>). And NullIgnored, OnlyOnceRegistered. * * @param createdTime The value of createdTime as greaterThan. */ @@ -1131,7 +1065,7 @@ } /** - * LessThan(>). And NullIgnored, OnceRegistered. + * LessThan(>). And NullIgnored, OnlyOnceRegistered. * * @param createdTime The value of createdTime as lessThan. */ @@ -1140,7 +1074,7 @@ } /** - * GreaterEqual(>). And NullIgnored, OnceRegistered. + * GreaterEqual(>). And NullIgnored, OnlyOnceRegistered. * * @param createdTime The value of createdTime as greaterEqual. */ @@ -1149,7 +1083,7 @@ } /** - * LessEqual(>). And NullIgnored, OnceRegistered. + * LessEqual(>). And NullIgnored, OnlyOnceRegistered. * * @param createdTime The value of createdTime as lessEqual. */ @@ -1159,7 +1093,7 @@ /** * FromTo($fromDate <= COLUMN_NAME <= $toDate). And NullIgnored, - * OnceRegistered. {NotNull : TIMESTAMP} + * OnlyOnceRegistered. {NotNull : TIMESTAMP} * * @param fromDate The from-date of createdTime. (Nullable) * @param toDate The to-date of createdTime. (Nullable) @@ -1177,7 +1111,7 @@ /** * FromTo($fromDate <= COLUMN_NAME < $toDate + 1). And NullIgnored, - * OnceRegistered. {NotNull : TIMESTAMP} + * OnlyOnceRegistered. {NotNull : TIMESTAMP} * * @param fromDate The from-date of createdTime. (Nullable) * @param toDate The to-date of createdTime. (Nullable) @@ -1203,7 +1137,7 @@ abstract protected ConditionValue getCValueCreatedTime(); /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {NotNull : + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {NotNull : * VARCHAR(255)} * * @param createdBy The value of createdBy as equal. @@ -1213,7 +1147,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param createdBy The value of createdBy as notEqual. */ @@ -1222,7 +1156,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param createdBy The value of createdBy as greaterThan. */ @@ -1231,7 +1165,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param createdBy The value of createdBy as lessThan. */ @@ -1240,7 +1174,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param createdBy The value of createdBy as greaterEqual. */ @@ -1249,7 +1183,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param createdBy The value of createdBy as lessEqual. */ @@ -1258,7 +1192,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param createdBy The value of createdBy as prefixSearch. */ @@ -1267,20 +1201,6 @@ } /** - * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, - * SeveralRegistered. - * - * @param createdBy The value of createdBy as likeSearch. - * @param likeSearchOption The option of like-search. (NotNull) - */ - public void setCreatedBy_LikeSearch( - String createdBy, - jp.sf.pal.addresslist.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { - registerLikeSearchQuery(CK_LS, fRES(createdBy), getCValueCreatedBy(), - "CREATED_BY", "CreatedBy", "createdBy", likeSearchOption); - } - - /** * InScope(in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * @@ -1291,27 +1211,41 @@ } /** - * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * - * @param createdBy The collection of createdBy as inScope. - * @param inScopeOption The option of in-scope. (NotNull) + * @param createdByList The collection of createdBy as notInScope. */ - public void setCreatedBy_InScope( + public void setCreatedBy_NotInScope(Collection createdByList) { + regCreatedBy(CK_NINS, cTL(createdByList)); + } + + /** + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param createdBy The value of createdBy as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) + */ + public void setCreatedBy_LikeSearch( String createdBy, - jp.sf.pal.addresslist.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(createdBy), getCValueCreatedBy(), - "CREATED_BY", "CreatedBy", "createdBy", inScopeOption); + jp.sf.pal.addresslist.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(createdBy), getCValueCreatedBy(), "CREATED_BY", + "CreatedBy", "createdBy", likeSearchOption); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param createdByList The collection of createdBy as notInScope. + * @param createdBy The value of createdBy as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setCreatedBy_NotInScope(Collection createdByList) { - regCreatedBy(CK_NINS, cTL(createdByList)); + public void setCreatedBy_NotLikeSearch( + String createdBy, + jp.sf.pal.addresslist.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(createdBy), getCValueCreatedBy(), "CREATED_BY", + "CreatedBy", "createdBy", likeSearchOption); } protected void regCreatedBy(ConditionKey key, Object value) { @@ -1327,7 +1261,7 @@ abstract protected ConditionValue getCValueCreatedBy(); /** - * Equal(=). And NullIgnored, OnceRegistered. {NotNull : TIMESTAMP} + * Equal(=). And NullIgnored, OnlyOnceRegistered. {NotNull : TIMESTAMP} * * @param updatedTime The value of updatedTime as equal. */ @@ -1336,7 +1270,7 @@ } /** - * NotEqual(!=). And NullIgnored, OnceRegistered. + * NotEqual(!=). And NullIgnored, OnlyOnceRegistered. * * @param updatedTime The value of updatedTime as notEqual. */ @@ -1345,7 +1279,7 @@ } /** - * GreaterThan(>). And NullIgnored, OnceRegistered. + * GreaterThan(>). And NullIgnored, OnlyOnceRegistered. * * @param updatedTime The value of updatedTime as greaterThan. */ @@ -1354,7 +1288,7 @@ } /** - * LessThan(>). And NullIgnored, OnceRegistered. + * LessThan(>). And NullIgnored, OnlyOnceRegistered. * * @param updatedTime The value of updatedTime as lessThan. */ @@ -1363,7 +1297,7 @@ } /** - * GreaterEqual(>). And NullIgnored, OnceRegistered. + * GreaterEqual(>). And NullIgnored, OnlyOnceRegistered. * * @param updatedTime The value of updatedTime as greaterEqual. */ @@ -1372,7 +1306,7 @@ } /** - * LessEqual(>). And NullIgnored, OnceRegistered. + * LessEqual(>). And NullIgnored, OnlyOnceRegistered. * * @param updatedTime The value of updatedTime as lessEqual. */ @@ -1382,7 +1316,7 @@ /** * FromTo($fromDate <= COLUMN_NAME <= $toDate). And NullIgnored, - * OnceRegistered. {NotNull : TIMESTAMP} + * OnlyOnceRegistered. {NotNull : TIMESTAMP} * * @param fromDate The from-date of updatedTime. (Nullable) * @param toDate The to-date of updatedTime. (Nullable) @@ -1400,7 +1334,7 @@ /** * FromTo($fromDate <= COLUMN_NAME < $toDate + 1). And NullIgnored, - * OnceRegistered. {NotNull : TIMESTAMP} + * OnlyOnceRegistered. {NotNull : TIMESTAMP} * * @param fromDate The from-date of updatedTime. (Nullable) * @param toDate The to-date of updatedTime. (Nullable) @@ -1426,7 +1360,7 @@ abstract protected ConditionValue getCValueUpdatedTime(); /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {NotNull : + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {NotNull : * VARCHAR(255)} * * @param updatedBy The value of updatedBy as equal. @@ -1436,7 +1370,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param updatedBy The value of updatedBy as notEqual. */ @@ -1445,7 +1379,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param updatedBy The value of updatedBy as greaterThan. */ @@ -1454,7 +1388,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param updatedBy The value of updatedBy as lessThan. */ @@ -1463,7 +1397,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param updatedBy The value of updatedBy as greaterEqual. */ @@ -1472,7 +1406,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param updatedBy The value of updatedBy as lessEqual. */ @@ -1481,7 +1415,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param updatedBy The value of updatedBy as prefixSearch. */ @@ -1490,20 +1424,6 @@ } /** - * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, - * SeveralRegistered. - * - * @param updatedBy The value of updatedBy as likeSearch. - * @param likeSearchOption The option of like-search. (NotNull) - */ - public void setUpdatedBy_LikeSearch( - String updatedBy, - jp.sf.pal.addresslist.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { - registerLikeSearchQuery(CK_LS, fRES(updatedBy), getCValueUpdatedBy(), - "UPDATED_BY", "UpdatedBy", "updatedBy", likeSearchOption); - } - - /** * InScope(in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * @@ -1514,27 +1434,41 @@ } /** - * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * - * @param updatedBy The collection of updatedBy as inScope. - * @param inScopeOption The option of in-scope. (NotNull) + * @param updatedByList The collection of updatedBy as notInScope. */ - public void setUpdatedBy_InScope( + public void setUpdatedBy_NotInScope(Collection updatedByList) { + regUpdatedBy(CK_NINS, cTL(updatedByList)); + } + + /** + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param updatedBy The value of updatedBy as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) + */ + public void setUpdatedBy_LikeSearch( String updatedBy, - jp.sf.pal.addresslist.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(updatedBy), getCValueUpdatedBy(), - "UPDATED_BY", "UpdatedBy", "updatedBy", inScopeOption); + jp.sf.pal.addresslist.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(updatedBy), getCValueUpdatedBy(), "UPDATED_BY", + "UpdatedBy", "updatedBy", likeSearchOption); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param updatedByList The collection of updatedBy as notInScope. + * @param updatedBy The value of updatedBy as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setUpdatedBy_NotInScope(Collection updatedByList) { - regUpdatedBy(CK_NINS, cTL(updatedByList)); + public void setUpdatedBy_NotLikeSearch( + String updatedBy, + jp.sf.pal.addresslist.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(updatedBy), getCValueUpdatedBy(), "UPDATED_BY", + "UpdatedBy", "updatedBy", likeSearchOption); } protected void regUpdatedBy(ConditionKey key, Object value) { @@ -1550,7 +1484,7 @@ abstract protected ConditionValue getCValueUpdatedBy(); /** - * Equal(=). And NullIgnored, OnceRegistered. {TIMESTAMP} + * Equal(=). And NullIgnored, OnlyOnceRegistered. {TIMESTAMP} * * @param deletedTime The value of deletedTime as equal. */ @@ -1559,7 +1493,7 @@ } /** - * NotEqual(!=). And NullIgnored, OnceRegistered. + * NotEqual(!=). And NullIgnored, OnlyOnceRegistered. * * @param deletedTime The value of deletedTime as notEqual. */ @@ -1568,7 +1502,7 @@ } /** - * GreaterThan(>). And NullIgnored, OnceRegistered. + * GreaterThan(>). And NullIgnored, OnlyOnceRegistered. * * @param deletedTime The value of deletedTime as greaterThan. */ @@ -1577,7 +1511,7 @@ } /** - * LessThan(>). And NullIgnored, OnceRegistered. + * LessThan(>). And NullIgnored, OnlyOnceRegistered. * * @param deletedTime The value of deletedTime as lessThan. */ @@ -1586,7 +1520,7 @@ } /** - * GreaterEqual(>). And NullIgnored, OnceRegistered. + * GreaterEqual(>). And NullIgnored, OnlyOnceRegistered. * * @param deletedTime The value of deletedTime as greaterEqual. */ @@ -1595,7 +1529,7 @@ } /** - * LessEqual(>). And NullIgnored, OnceRegistered. + * LessEqual(>). And NullIgnored, OnlyOnceRegistered. * * @param deletedTime The value of deletedTime as lessEqual. */ @@ -1605,7 +1539,7 @@ /** * FromTo($fromDate <= COLUMN_NAME <= $toDate). And NullIgnored, - * OnceRegistered. {TIMESTAMP} + * OnlyOnceRegistered. {TIMESTAMP} * * @param fromDate The from-date of deletedTime. (Nullable) * @param toDate The to-date of deletedTime. (Nullable) @@ -1623,7 +1557,7 @@ /** * FromTo($fromDate <= COLUMN_NAME < $toDate + 1). And NullIgnored, - * OnceRegistered. {TIMESTAMP} + * OnlyOnceRegistered. {TIMESTAMP} * * @param fromDate The from-date of deletedTime. (Nullable) * @param toDate The to-date of deletedTime. (Nullable) @@ -1637,14 +1571,14 @@ } /** - * IsNull(is null). And OnceRegistered. + * IsNull(is null). And OnlyOnceRegistered. */ public void setDeletedTime_IsNull() { regDeletedTime(CK_ISN, DUMMY_OBJECT); } /** - * IsNotNull(is not null). And OnceRegistered. + * IsNotNull(is not null). And OnlyOnceRegistered. */ public void setDeletedTime_IsNotNull() { regDeletedTime(CK_ISNN, DUMMY_OBJECT); @@ -1663,7 +1597,7 @@ abstract protected ConditionValue getCValueDeletedTime(); /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {VARCHAR(255)} + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {VARCHAR(255)} * * @param deletedBy The value of deletedBy as equal. */ @@ -1672,7 +1606,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param deletedBy The value of deletedBy as notEqual. */ @@ -1681,7 +1615,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param deletedBy The value of deletedBy as greaterThan. */ @@ -1690,7 +1624,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param deletedBy The value of deletedBy as lessThan. */ @@ -1699,7 +1633,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param deletedBy The value of deletedBy as greaterEqual. */ @@ -1708,7 +1642,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param deletedBy The value of deletedBy as lessEqual. */ @@ -1717,7 +1651,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param deletedBy The value of deletedBy as prefixSearch. */ @@ -1726,20 +1660,6 @@ } /** - * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, - * SeveralRegistered. - * - * @param deletedBy The value of deletedBy as likeSearch. - * @param likeSearchOption The option of like-search. (NotNull) - */ - public void setDeletedBy_LikeSearch( - String deletedBy, - jp.sf.pal.addresslist.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { - registerLikeSearchQuery(CK_LS, fRES(deletedBy), getCValueDeletedBy(), - "DELETED_BY", "DeletedBy", "deletedBy", likeSearchOption); - } - - /** * InScope(in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * @@ -1750,38 +1670,52 @@ } /** - * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * - * @param deletedBy The collection of deletedBy as inScope. - * @param inScopeOption The option of in-scope. (NotNull) + * @param deletedByList The collection of deletedBy as notInScope. */ - public void setDeletedBy_InScope( + public void setDeletedBy_NotInScope(Collection deletedByList) { + regDeletedBy(CK_NINS, cTL(deletedByList)); + } + + /** + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param deletedBy The value of deletedBy as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) + */ + public void setDeletedBy_LikeSearch( String deletedBy, - jp.sf.pal.addresslist.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(deletedBy), getCValueDeletedBy(), - "DELETED_BY", "DeletedBy", "deletedBy", inScopeOption); + jp.sf.pal.addresslist.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(deletedBy), getCValueDeletedBy(), "DELETED_BY", + "DeletedBy", "deletedBy", likeSearchOption); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param deletedByList The collection of deletedBy as notInScope. + * @param deletedBy The value of deletedBy as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setDeletedBy_NotInScope(Collection deletedByList) { - regDeletedBy(CK_NINS, cTL(deletedByList)); + public void setDeletedBy_NotLikeSearch( + String deletedBy, + jp.sf.pal.addresslist.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(deletedBy), getCValueDeletedBy(), "DELETED_BY", + "DeletedBy", "deletedBy", likeSearchOption); } /** - * IsNull(is null). And OnceRegistered. + * IsNull(is null). And OnlyOnceRegistered. */ public void setDeletedBy_IsNull() { regDeletedBy(CK_ISN, DUMMY_OBJECT); } /** - * IsNotNull(is not null). And OnceRegistered. + * IsNotNull(is not null). And OnlyOnceRegistered. */ public void setDeletedBy_IsNotNull() { regDeletedBy(CK_ISNN, DUMMY_OBJECT); @@ -1800,7 +1734,7 @@ abstract protected ConditionValue getCValueDeletedBy(); /** - * Equal(=). And NullIgnored, OnceRegistered. {NotNull : INTEGER} + * Equal(=). And NullIgnored, OnlyOnceRegistered. {NotNull : INTEGER} * * @param versionno The value of versionno as equal. */ @@ -1809,7 +1743,7 @@ } /** - * NotEqual(!=). And NullIgnored, OnceRegistered. + * NotEqual(!=). And NullIgnored, OnlyOnceRegistered. * * @param versionno The value of versionno as notEqual. */ @@ -1818,7 +1752,7 @@ } /** - * GreaterThan(>). And NullIgnored, OnceRegistered. + * GreaterThan(>). And NullIgnored, OnlyOnceRegistered. * * @param versionno The value of versionno as greaterThan. */ @@ -1827,7 +1761,7 @@ } /** - * LessThan(<). And NullIgnored, OnceRegistered. + * LessThan(<). And NullIgnored, OnlyOnceRegistered. * * @param versionno The value of versionno as lessThan. */ @@ -1836,7 +1770,7 @@ } /** - * GreaterEqual(>=). And NullIgnored, OnceRegistered. + * GreaterEqual(>=). And NullIgnored, OnlyOnceRegistered. * * @param versionno The value of versionno as greaterEqual. */ @@ -1845,7 +1779,7 @@ } /** - * LessEqual(<=). And NullIgnored, OnceRegistered. + * LessEqual(<=). And NullIgnored, OnlyOnceRegistered. * * @param versionno The value of versionno as lessEqual. */ @@ -1885,6 +1819,50 @@ abstract protected ConditionValue getCValueVersionno(); + public SSQFunction scalar_Equal() { + return xcreateSSQFunction("="); + } + + public SSQFunction scalar_GreaterEqual() { + return xcreateSSQFunction(">="); + } + + public SSQFunction scalar_GreaterThan() { + return xcreateSSQFunction(">"); + } + + public SSQFunction scalar_LessEqual() { + return xcreateSSQFunction("<="); + } + + public SSQFunction scalar_LessThan() { + return xcreateSSQFunction("<"); + } + + protected SSQFunction xcreateSSQFunction(final String operand) { + return new SSQFunction(new SSQSetupper() { + public void setup(String function, SubQuery subQuery) { + xscalarSubQuery(function, subQuery, operand); + } + }); + } + + protected void xscalarSubQuery(String function, + SubQuery subQuery, String operand) { + assertObjectNotNull("subQuery", subQuery); + GroupInfoCB cb = new GroupInfoCB(); + cb.xsetupForScalarSubQuery(); + subQuery.query(cb); + String subQueryPropertyName = keepScalarSubQuery(cb.query()); // for + // saving + // query + // -value. + registerScalarSubQuery(function, cb.query(), subQueryPropertyName, + operand); + } + + public abstract String keepScalarSubQuery(GroupInfoCQ subQuery); + // Very Internal (for Suppressing Warn about 'Not Use Import') protected String getConditionBeanClassNameInternally() { return GroupInfoCB.class.getName(); Modified: addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/cbean/cq/bs/AbstractBsGroupMappingCQ.java =================================================================== --- addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/cbean/cq/bs/AbstractBsGroupMappingCQ.java 2008-12-27 22:02:56 UTC (rev 1623) +++ addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/cbean/cq/bs/AbstractBsGroupMappingCQ.java 2008-12-27 22:06:42 UTC (rev 1624) @@ -11,16 +11,13 @@ import jp.sf.pal.addresslist.db.cbean.GroupInfoCB; import jp.sf.pal.addresslist.db.cbean.GroupMappingCB; import jp.sf.pal.addresslist.db.cbean.UserInfoCB; -import jp.sf.pal.addresslist.db.cbean.cq.GroupInfoCQ; import jp.sf.pal.addresslist.db.cbean.cq.GroupMappingCQ; -import jp.sf.pal.addresslist.db.cbean.cq.UserInfoCQ; /** * The abstract condition-query of GROUP_MAPPING. * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public abstract class AbstractBsGroupMappingCQ extends AbstractConditionQuery { //========================================================================== @@ -50,7 +47,8 @@ // ===== /** - * Equal(=). And NullIgnored, OnceRegistered. {PK : ID : NotNull : INTEGER} + * Equal(=). And NullIgnored, OnlyOnceRegistered. {PK : ID : NotNull : + * INTEGER} * * @param id The value of id as equal. */ @@ -59,7 +57,7 @@ } /** - * NotEqual(!=). And NullIgnored, OnceRegistered. + * NotEqual(!=). And NullIgnored, OnlyOnceRegistered. * * @param id The value of id as notEqual. */ @@ -68,7 +66,7 @@ } /** - * GreaterThan(>). And NullIgnored, OnceRegistered. + * GreaterThan(>). And NullIgnored, OnlyOnceRegistered. * * @param id The value of id as greaterThan. */ @@ -77,7 +75,7 @@ } /** - * LessThan(<). And NullIgnored, OnceRegistered. + * LessThan(<). And NullIgnored, OnlyOnceRegistered. * * @param id The value of id as lessThan. */ @@ -86,7 +84,7 @@ } /** - * GreaterEqual(>=). And NullIgnored, OnceRegistered. + * GreaterEqual(>=). And NullIgnored, OnlyOnceRegistered. * * @param id The value of id as greaterEqual. */ @@ -95,7 +93,7 @@ } /** - * LessEqual(<=). And NullIgnored, OnceRegistered. + * LessEqual(<=). And NullIgnored, OnlyOnceRegistered. * * @param id The value of id as lessEqual. */ @@ -124,14 +122,14 @@ } /** - * IsNull(is null). And OnceRegistered. + * IsNull(is null). And OnlyOnceRegistered. */ public void setId_IsNull() { regId(CK_ISN, DUMMY_OBJECT); } /** - * IsNotNull(is not null). And OnceRegistered. + * IsNotNull(is not null). And OnlyOnceRegistered. */ public void setId_IsNotNull() { regId(CK_ISNN, DUMMY_OBJECT); @@ -148,8 +146,8 @@ abstract protected ConditionValue getCValueId(); /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {NotNull : VARCHAR(255) - * : FK to USER_INFO} + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {NotNull : + * VARCHAR(255) : FK to USER_INFO} * * @param userId The value of userId as equal. */ @@ -158,7 +156,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param userId The value of userId as notEqual. */ @@ -167,7 +165,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param userId The value of userId as greaterThan. */ @@ -176,7 +174,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param userId The value of userId as lessThan. */ @@ -185,7 +183,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param userId The value of userId as greaterEqual. */ @@ -194,7 +192,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param userId The value of userId as lessEqual. */ @@ -203,7 +201,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param userId The value of userId as prefixSearch. */ @@ -212,20 +210,6 @@ } /** - * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, - * SeveralRegistered. - * - * @param userId The value of userId as likeSearch. - * @param likeSearchOption The option of like-search. (NotNull) - */ - public void setUserId_LikeSearch( - String userId, - jp.sf.pal.addresslist.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { - registerLikeSearchQuery(CK_LS, fRES(userId), getCValueUserId(), - "USER_ID", "UserId", "userId", likeSearchOption); - } - - /** * InScope(in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * @@ -236,42 +220,41 @@ } /** - * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * - * @param userId The collection of userId as inScope. - * @param inScopeOption The option of in-scope. (NotNull) + * @param userIdList The collection of userId as notInScope. */ - public void setUserId_InScope( - String userId, - jp.sf.pal.addresslist.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(userId), getCValueUserId(), - "USER_ID", "UserId", "userId", inScopeOption); + public void setUserId_NotInScope(Collection userIdList) { + regUserId(CK_NINS, cTL(userIdList)); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param userIdList The collection of userId as notInScope. + * @param userId The value of userId as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) */ - public void setUserId_NotInScope(Collection userIdList) { - regUserId(CK_NINS, cTL(userIdList)); + public void setUserId_LikeSearch( + String userId, + jp.sf.pal.addresslist.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(userId), getCValueUserId(), "USER_ID", "UserId", + "userId", likeSearchOption); } /** - * @param userInfoCBquery Query. - * @deprecated Please use inScopeUserInfo(subQuery) method. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param userId The value of userId as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setUserId_InScopeSubQuery_UserInfo(UserInfoCQ userInfoCBquery) { - String subQueryPropertyName = keepUserId_InScopeSubQuery_UserInfo(userInfoCBquery);// for - // saving - // query - // - - // value - // . - registerInScopeSubQuery(userInfoCBquery, "USER_ID", "USER_ID", - subQueryPropertyName); + public void setUserId_NotLikeSearch( + String userId, + jp.sf.pal.addresslist.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(userId), getCValueUserId(), "USER_ID", "UserId", + "userId", likeSearchOption); } public void inScopeUserInfo(SubQuery subQuery) { @@ -280,12 +263,12 @@ cb.xsetupForInScopeSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepUserId_InScopeSubQuery_UserInfo(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerInScopeSubQuery(cb.query(), "USER_ID", "USER_ID", subQueryPropertyName); } - abstract public String keepUserId_InScopeSubQuery_UserInfo( + public abstract String keepUserId_InScopeSubQuery_UserInfo( jp.sf.pal.addresslist.db.cbean.cq.UserInfoCQ subQuery); protected void regUserId(ConditionKey key, Object value) { @@ -301,8 +284,8 @@ abstract protected ConditionValue getCValueUserId(); /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {NotNull : VARCHAR(255) - * : FK to GROUP_INFO} + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {NotNull : + * VARCHAR(255) : FK to GROUP_INFO} * * @param groupId The value of groupId as equal. */ @@ -311,7 +294,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param groupId The value of groupId as notEqual. */ @@ -320,7 +303,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param groupId The value of groupId as greaterThan. */ @@ -329,7 +312,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param groupId The value of groupId as lessThan. */ @@ -338,7 +321,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param groupId The value of groupId as greaterEqual. */ @@ -347,7 +330,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param groupId The value of groupId as lessEqual. */ @@ -356,7 +339,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param groupId The value of groupId as prefixSearch. */ @@ -365,20 +348,6 @@ } /** - * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, - * SeveralRegistered. - * - * @param groupId The value of groupId as likeSearch. - * @param likeSearchOption The option of like-search. (NotNull) - */ - public void setGroupId_LikeSearch( - String groupId, - jp.sf.pal.addresslist.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { - registerLikeSearchQuery(CK_LS, fRES(groupId), getCValueGroupId(), - "GROUP_ID", "GroupId", "groupId", likeSearchOption); - } - - /** * InScope(in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * @@ -389,43 +358,41 @@ } /** - * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * - * @param groupId The collection of groupId as inScope. - * @param inScopeOption The option of in-scope. (NotNull) + * @param groupIdList The collection of groupId as notInScope. */ - public void setGroupId_InScope( - String groupId, - jp.sf.pal.addresslist.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(groupId), getCValueGroupId(), - "GROUP_ID", "GroupId", "groupId", inScopeOption); + public void setGroupId_NotInScope(Collection groupIdList) { + regGroupId(CK_NINS, cTL(groupIdList)); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param groupIdList The collection of groupId as notInScope. + * @param groupId The value of groupId as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) */ - public void setGroupId_NotInScope(Collection groupIdList) { - regGroupId(CK_NINS, cTL(groupIdList)); + public void setGroupId_LikeSearch( + String groupId, + jp.sf.pal.addresslist.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(groupId), getCValueGroupId(), "GROUP_ID", "GroupId", + "groupId", likeSearchOption); } /** - * @param groupInfoCBquery Query. - * @deprecated Please use inScopeGroupInfo(subQuery) method. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param groupId The value of groupId as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setGroupId_InScopeSubQuery_GroupInfo( - GroupInfoCQ groupInfoCBquery) { - String subQueryPropertyName = keepGroupId_InScopeSubQuery_GroupInfo(groupInfoCBquery);// for - // saving - // query - // - - // value - // . - registerInScopeSubQuery(groupInfoCBquery, "GROUP_ID", "GROUP_ID", - subQueryPropertyName); + public void setGroupId_NotLikeSearch( + String groupId, + jp.sf.pal.addresslist.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(groupId), getCValueGroupId(), "GROUP_ID", + "GroupId", "groupId", likeSearchOption); } public void inScopeGroupInfo(SubQuery subQuery) { @@ -434,12 +401,12 @@ cb.xsetupForInScopeSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepGroupId_InScopeSubQuery_GroupInfo(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerInScopeSubQuery(cb.query(), "GROUP_ID", "GROUP_ID", subQueryPropertyName); } - abstract public String keepGroupId_InScopeSubQuery_GroupInfo( + public abstract String keepGroupId_InScopeSubQuery_GroupInfo( jp.sf.pal.addresslist.db.cbean.cq.GroupInfoCQ subQuery); protected void regGroupId(ConditionKey key, Object value) { @@ -454,6 +421,53 @@ abstract protected ConditionValue getCValueGroupId(); + public SSQFunction scalar_Equal() { + return xcreateSSQFunction("="); + } + + public SSQFunction scalar_GreaterEqual() { + return xcreateSSQFunction(">="); + } + + public SSQFunction scalar_GreaterThan() { + return xcreateSSQFunction(">"); + } + + public SSQFunction scalar_LessEqual() { + return xcreateSSQFunction("<="); + } + + public SSQFunction scalar_LessThan() { + return xcreateSSQFunction("<"); + } + + protected SSQFunction xcreateSSQFunction( + final String operand) { + return new SSQFunction( + new SSQSetupper() { + public void setup(String function, + SubQuery subQuery) { + xscalarSubQuery(function, subQuery, operand); + } + }); + } + + protected void xscalarSubQuery(String function, + SubQuery subQuery, String operand) { + assertObjectNotNull("subQuery", subQuery); + GroupMappingCB cb = new GroupMappingCB(); + cb.xsetupForScalarSubQuery(); + subQuery.query(cb); + String subQueryPropertyName = keepScalarSubQuery(cb.query()); // for + // saving + // query + // -value. + registerScalarSubQuery(function, cb.query(), subQueryPropertyName, + operand); + } + + public abstract String keepScalarSubQuery(GroupMappingCQ subQuery); + // Very Internal (for Suppressing Warn about 'Not Use Import') protected String getConditionBeanClassNameInternally() { return GroupMappingCB.class.getName(); Modified: addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/cbean/cq/bs/AbstractBsPersonCQ.java =================================================================== --- addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/cbean/cq/bs/AbstractBsPersonCQ.java 2008-12-27 22:02:56 UTC (rev 1623) +++ addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/cbean/cq/bs/AbstractBsPersonCQ.java 2008-12-27 22:06:42 UTC (rev 1624) @@ -19,14 +19,12 @@ import jp.sf.pal.addresslist.db.cbean.cq.CustomCQ; import jp.sf.pal.addresslist.db.cbean.cq.PersonCQ; import jp.sf.pal.addresslist.db.cbean.cq.PostalCQ; -import jp.sf.pal.addresslist.db.cbean.cq.UserInfoCQ; /** * The abstract condition-query of PERSON. * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public abstract class AbstractBsPersonCQ extends AbstractConditionQuery { //========================================================================== @@ -56,7 +54,8 @@ // ===== /** - * Equal(=). And NullIgnored, OnceRegistered. {PK : ID : NotNull : BIGINT} + * Equal(=). And NullIgnored, OnlyOnceRegistered. {PK : ID : NotNull : + * BIGINT} * * @param id The value of id as equal. */ @@ -65,7 +64,7 @@ } /** - * NotEqual(!=). And NullIgnored, OnceRegistered. + * NotEqual(!=). And NullIgnored, OnlyOnceRegistered. * * @param id The value of id as notEqual. */ @@ -74,7 +73,7 @@ } /** - * GreaterThan(>). And NullIgnored, OnceRegistered. + * GreaterThan(>). And NullIgnored, OnlyOnceRegistered. * * @param id The value of id as greaterThan. */ @@ -83,7 +82,7 @@ } /** - * LessThan(<). And NullIgnored, OnceRegistered. + * LessThan(<). And NullIgnored, OnlyOnceRegistered. * * @param id The value of id as lessThan. */ @@ -92,7 +91,7 @@ } /** - * GreaterEqual(>=). And NullIgnored, OnceRegistered. + * GreaterEqual(>=). And NullIgnored, OnlyOnceRegistered. * * @param id The value of id as greaterEqual. */ @@ -101,7 +100,7 @@ } /** - * LessEqual(<=). And NullIgnored, OnceRegistered. + * LessEqual(<=). And NullIgnored, OnlyOnceRegistered. * * @param id The value of id as lessEqual. */ @@ -129,89 +128,44 @@ regId(CK_NINS, cTL(idList)); } - /** - * @param contactCBquery Query. - * @deprecated Please use inScopeContactList(subQuery) method. - */ - public void setId_InScopeSubQuery_ContactList(ContactCQ contactCBquery) { - String subQueryPropertyName = keepId_InScopeSubQuery_ContactList(contactCBquery);// for - // saving - // query - // - - // value - // . - registerInScopeSubQuery(contactCBquery, "ID", "PERSON_ID", - subQueryPropertyName); - } - public void inScopeContactList(SubQuery subQuery) { assertObjectNotNull("subQuery", subQuery); ContactCB cb = new ContactCB(); cb.xsetupForInScopeSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepId_InScopeSubQuery_ContactList(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerInScopeSubQuery(cb.query(), "ID", "PERSON_ID", subQueryPropertyName); } - abstract public String keepId_InScopeSubQuery_ContactList(ContactCQ subQuery); + public abstract String keepId_InScopeSubQuery_ContactList(ContactCQ subQuery); - /** - * @param customCBquery Query. - * @deprecated Please use inScopeCustomList(subQuery) method. - */ - public void setId_InScopeSubQuery_CustomList(CustomCQ customCBquery) { - String subQueryPropertyName = keepId_InScopeSubQuery_CustomList(customCBquery);// for - // saving - // query - // - - // value - // . - registerInScopeSubQuery(customCBquery, "ID", "PERSON_ID", - subQueryPropertyName); - } - public void inScopeCustomList(SubQuery subQuery) { assertObjectNotNull("subQuery", subQuery); CustomCB cb = new CustomCB(); cb.xsetupForInScopeSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepId_InScopeSubQuery_CustomList(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerInScopeSubQuery(cb.query(), "ID", "PERSON_ID", subQueryPropertyName); } - abstract public String keepId_InScopeSubQuery_CustomList(CustomCQ subQuery); + public abstract String keepId_InScopeSubQuery_CustomList(CustomCQ subQuery); - /** - * @param postalCBquery Query. - * @deprecated Please use inScopePostalAsOne(subQuery) method. - */ - public void setId_InScopeSubQuery_PostalAsOne(PostalCQ postalCBquery) { - String subQueryPropertyName = keepId_InScopeSubQuery_PostalAsOne(postalCBquery);// for - // saving - // query - // - - // value - // . - registerInScopeSubQuery(postalCBquery, "ID", "PERSON_ID", - subQueryPropertyName); - } - public void inScopePostalAsOne(SubQuery subQuery) { assertObjectNotNull("subQuery", subQuery); PostalCB cb = new PostalCB(); cb.xsetupForInScopeSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepId_InScopeSubQuery_PostalAsOne(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerInScopeSubQuery(cb.query(), "ID", "PERSON_ID", subQueryPropertyName); } - abstract public String keepId_InScopeSubQuery_PostalAsOne(PostalCQ subQuery); + public abstract String keepId_InScopeSubQuery_PostalAsOne(PostalCQ subQuery); public void notInScopeContactList(SubQuery subQuery) { assertObjectNotNull("subQuery", subQuery); @@ -219,12 +173,12 @@ cb.xsetupForInScopeSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepId_NotInScopeSubQuery_ContactList(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerNotInScopeSubQuery(cb.query(), "ID", "PERSON_ID", subQueryPropertyName); } - abstract public String keepId_NotInScopeSubQuery_ContactList( + public abstract String keepId_NotInScopeSubQuery_ContactList( ContactCQ subQuery); public void notInScopeCustomList(SubQuery subQuery) { @@ -233,12 +187,12 @@ cb.xsetupForInScopeSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepId_NotInScopeSubQuery_CustomList(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerNotInScopeSubQuery(cb.query(), "ID", "PERSON_ID", subQueryPropertyName); } - abstract public String keepId_NotInScopeSubQuery_CustomList( + public abstract String keepId_NotInScopeSubQuery_CustomList( CustomCQ subQuery); public void notInScopePostalAsOne(SubQuery subQuery) { @@ -247,30 +201,15 @@ cb.xsetupForInScopeSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepId_NotInScopeSubQuery_PostalAsOne(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerNotInScopeSubQuery(cb.query(), "ID", "PERSON_ID", subQueryPropertyName); } - abstract public String keepId_NotInScopeSubQuery_PostalAsOne( + public abstract String keepId_NotInScopeSubQuery_PostalAsOne( PostalCQ subQuery); /** - * @param contactCBquery Query. - * @deprecated Please use existsContactList(subQuery) method. - */ - public void setId_ExistsSubQuery_ContactList(ContactCQ contactCBquery) { - String subQueryPropertyName = keepId_ExistsSubQuery_ContactList(contactCBquery);// for - // saving - // query - // - - // value - // . - registerExistsSubQuery(contactCBquery, "ID", "PERSON_ID", - subQueryPropertyName); - } - - /** * Set up 'exists' sub-query. {exists (select PERSON_ID from CONTACT where * ...)} * @@ -283,29 +222,14 @@ cb.xsetupForExistsSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepId_ExistsSubQuery_ContactList(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerExistsSubQuery(cb.query(), "ID", "PERSON_ID", subQueryPropertyName); } - abstract public String keepId_ExistsSubQuery_ContactList(ContactCQ subQuery); + public abstract String keepId_ExistsSubQuery_ContactList(ContactCQ subQuery); /** - * @param customCBquery Query. - * @deprecated Please use existsCustomList(subQuery) method. - */ - public void setId_ExistsSubQuery_CustomList(CustomCQ customCBquery) { - String subQueryPropertyName = keepId_ExistsSubQuery_CustomList(customCBquery);// for - // saving - // query - // - - // value - // . - registerExistsSubQuery(customCBquery, "ID", "PERSON_ID", - subQueryPropertyName); - } - - /** * Set up 'exists' sub-query. {exists (select PERSON_ID from CUSTOM where * ...)} * @@ -318,29 +242,14 @@ cb.xsetupForExistsSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepId_ExistsSubQuery_CustomList(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerExistsSubQuery(cb.query(), "ID", "PERSON_ID", subQueryPropertyName); } - abstract public String keepId_ExistsSubQuery_CustomList(CustomCQ subQuery); + public abstract String keepId_ExistsSubQuery_CustomList(CustomCQ subQuery); /** - * @param postalCBquery Query. - * @deprecated Please use existsPostalAsOne(subQuery) method. - */ - public void setId_ExistsSubQuery_PostalAsOne(PostalCQ postalCBquery) { - String subQueryPropertyName = keepId_ExistsSubQuery_PostalAsOne(postalCBquery);// for - // saving - // query - // - - // value - // . - registerExistsSubQuery(postalCBquery, "ID", "PERSON_ID", - subQueryPropertyName); - } - - /** * Set up 'exists' sub-query. {exists (select PERSON_ID from POSTAL where * ...)} * @@ -353,12 +262,12 @@ cb.xsetupForExistsSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepId_ExistsSubQuery_PostalAsOne(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerExistsSubQuery(cb.query(), "ID", "PERSON_ID", subQueryPropertyName); } - abstract public String keepId_ExistsSubQuery_PostalAsOne(PostalCQ subQuery); + public abstract String keepId_ExistsSubQuery_PostalAsOne(PostalCQ subQuery); /** * Set up 'not exists' sub-query. {not exists (select PERSON_ID from CONTACT @@ -373,12 +282,12 @@ cb.xsetupForExistsSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepId_NotExistsSubQuery_ContactList(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerNotExistsSubQuery(cb.query(), "ID", "PERSON_ID", subQueryPropertyName); } - abstract public String keepId_NotExistsSubQuery_ContactList( + public abstract String keepId_NotExistsSubQuery_ContactList( ContactCQ subQuery); /** @@ -394,12 +303,12 @@ cb.xsetupForExistsSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepId_NotExistsSubQuery_CustomList(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerNotExistsSubQuery(cb.query(), "ID", "PERSON_ID", subQueryPropertyName); } - abstract public String keepId_NotExistsSubQuery_CustomList(CustomCQ subQuery); + public abstract String keepId_NotExistsSubQuery_CustomList(CustomCQ subQuery); /** * Set up 'not exists' sub-query. {not exists (select PERSON_ID from POSTAL @@ -414,51 +323,51 @@ cb.xsetupForExistsSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepId_NotExistsSubQuery_PostalAsOne(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerNotExistsSubQuery(cb.query(), "ID", "PERSON_ID", subQueryPropertyName); } - abstract public String keepId_NotExistsSubQuery_PostalAsOne( + public abstract String keepId_NotExistsSubQuery_PostalAsOne( PostalCQ subQuery); public void xderiveContactList(String function, SubQuery subQuery, String aliasName) { assertObjectNotNull("subQuery", subQuery); ContactCB cb = new ContactCB(); - cb.xsetupForDeriveReferrer(); + cb.xsetupForDerivedReferrer(); subQuery.query(cb); - String subQueryPropertyName = keepId_DeriveSubQuery_ContactList(cb - .query());// for saving query-value. - registerDeriveSubQuery(function, cb.query(), "ID", "PERSON_ID", - subQueryPropertyName, aliasName); + String subQueryPropertyName = keepId_DerivedReferrer_ContactList(cb + .query()); // for saving query-value. + registerDerivedReferrerSubQuery(function, cb.query(), "ID", + "PERSON_ID", subQueryPropertyName, aliasName); } - abstract public String keepId_DeriveSubQuery_ContactList(ContactCQ subQuery); + public abstract String keepId_DerivedReferrer_ContactList(ContactCQ subQuery); public void xderiveCustomList(String function, SubQuery subQuery, String aliasName) { assertObjectNotNull("subQuery", subQuery); CustomCB cb = new CustomCB(); - cb.xsetupForDeriveReferrer(); + cb.xsetupForDerivedReferrer(); subQuery.query(cb); - String subQueryPropertyName = keepId_DeriveSubQuery_CustomList(cb - .query());// for saving query-value. - registerDeriveSubQuery(function, cb.query(), "ID", "PERSON_ID", - subQueryPropertyName, aliasName); + String subQueryPropertyName = keepId_DerivedReferrer_CustomList(cb + .query()); // for saving query-value. + registerDerivedReferrerSubQuery(function, cb.query(), "ID", + "PERSON_ID", subQueryPropertyName, aliasName); } - abstract public String keepId_DeriveSubQuery_CustomList(CustomCQ subQuery); + public abstract String keepId_DerivedReferrer_CustomList(CustomCQ subQuery); /** - * IsNull(is null). And OnceRegistered. + * IsNull(is null). And OnlyOnceRegistered. */ public void setId_IsNull() { regId(CK_ISN, DUMMY_OBJECT); } /** - * IsNotNull(is not null). And OnceRegistered. + * IsNotNull(is not null). And OnlyOnceRegistered. */ public void setId_IsNotNull() { regId(CK_ISNN, DUMMY_OBJECT); @@ -475,8 +384,8 @@ abstract protected ConditionValue getCValueId(); /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {VARCHAR(255) : FK to - * USER_INFO} + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {VARCHAR(255) : FK + * to USER_INFO} * * @param userId The value of userId as equal. */ @@ -485,7 +394,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param userId The value of userId as notEqual. */ @@ -494,7 +403,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param userId The value of userId as greaterThan. */ @@ -503,7 +412,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param userId The value of userId as lessThan. */ @@ -512,7 +421,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param userId The value of userId as greaterEqual. */ @@ -521,7 +430,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param userId The value of userId as lessEqual. */ @@ -530,7 +439,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param userId The value of userId as prefixSearch. */ @@ -539,20 +448,6 @@ } /** - * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, - * SeveralRegistered. - * - * @param userId The value of userId as likeSearch. - * @param likeSearchOption The option of like-search. (NotNull) - */ - public void setUserId_LikeSearch( - String userId, - jp.sf.pal.addresslist.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. * @@ -563,42 +458,41 @@ } /** - * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * - * @param userId The collection of userId as inScope. - * @param inScopeOption The option of in-scope. (NotNull) + * @param userIdList The collection of userId as notInScope. */ - public void setUserId_InScope( - String userId, - jp.sf.pal.addresslist.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(userId), getCValueUserId(), - "USER_ID", "UserId", "userId", inScopeOption); + public void setUserId_NotInScope(Collection userIdList) { + regUserId(CK_NINS, cTL(userIdList)); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param userIdList The collection of userId as notInScope. + * @param userId The value of userId as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) */ - public void setUserId_NotInScope(Collection userIdList) { - regUserId(CK_NINS, cTL(userIdList)); + public void setUserId_LikeSearch( + String userId, + jp.sf.pal.addresslist.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(userId), getCValueUserId(), "USER_ID", "UserId", + "userId", likeSearchOption); } /** - * @param userInfoCBquery Query. - * @deprecated Please use inScopeUserInfo(subQuery) method. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param userId The value of userId as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setUserId_InScopeSubQuery_UserInfo(UserInfoCQ userInfoCBquery) { - String subQueryPropertyName = keepUserId_InScopeSubQuery_UserInfo(userInfoCBquery);// for - // saving - // query - // - - // value - // . - registerInScopeSubQuery(userInfoCBquery, "USER_ID", "USER_ID", - subQueryPropertyName); + public void setUserId_NotLikeSearch( + String userId, + jp.sf.pal.addresslist.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(userId), getCValueUserId(), "USER_ID", "UserId", + "userId", likeSearchOption); } public void inScopeUserInfo(SubQuery subQuery) { @@ -607,23 +501,23 @@ cb.xsetupForInScopeSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepUserId_InScopeSubQuery_UserInfo(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerInScopeSubQuery(cb.query(), "USER_ID", "USER_ID", subQueryPropertyName); } - abstract public String keepUserId_InScopeSubQuery_UserInfo( + public abstract String keepUserId_InScopeSubQuery_UserInfo( jp.sf.pal.addresslist.db.cbean.cq.UserInfoCQ subQuery); /** - * IsNull(is null). And OnceRegistered. + * IsNull(is null). And OnlyOnceRegistered. */ public void setUserId_IsNull() { regUserId(CK_ISN, DUMMY_OBJECT); } /** - * IsNotNull(is not null). And OnceRegistered. + * IsNotNull(is not null). And OnlyOnceRegistered. */ public void setUserId_IsNotNull() { regUserId(CK_ISNN, DUMMY_OBJECT); @@ -642,7 +536,7 @@ abstract protected ConditionValue getCValueUserId(); /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {VARCHAR(100)} + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {VARCHAR(100)} * * @param givenName The value of givenName as equal. */ @@ -651,7 +545,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param givenName The value of givenName as notEqual. */ @@ -660,7 +554,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param givenName The value of givenName as greaterThan. */ @@ -669,7 +563,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param givenName The value of givenName as lessThan. */ @@ -678,7 +572,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param givenName The value of givenName as greaterEqual. */ @@ -687,7 +581,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param givenName The value of givenName as lessEqual. */ @@ -696,7 +590,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param givenName The value of givenName as prefixSearch. */ @@ -705,20 +599,6 @@ } /** - * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, - * SeveralRegistered. - * - * @param givenName The value of givenName as likeSearch. - * @param likeSearchOption The option of like-search. (NotNull) - */ - public void setGivenName_LikeSearch( - String givenName, - jp.sf.pal.addresslist.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. * @@ -729,38 +609,52 @@ } /** - * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * - * @param givenName The collection of givenName as inScope. - * @param inScopeOption The option of in-scope. (NotNull) + * @param givenNameList The collection of givenName as notInScope. */ - public void setGivenName_InScope( + public void setGivenName_NotInScope(Collection givenNameList) { + regGivenName(CK_NINS, cTL(givenNameList)); + } + + /** + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param givenName The value of givenName as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) + */ + public void setGivenName_LikeSearch( String givenName, - jp.sf.pal.addresslist.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(givenName), getCValueGivenName(), - "GIVEN_NAME", "GivenName", "givenName", inScopeOption); + jp.sf.pal.addresslist.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(givenName), getCValueGivenName(), "GIVEN_NAME", + "GivenName", "givenName", likeSearchOption); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param givenNameList The collection of givenName as notInScope. + * @param givenName The value of givenName as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setGivenName_NotInScope(Collection givenNameList) { - regGivenName(CK_NINS, cTL(givenNameList)); + public void setGivenName_NotLikeSearch( + String givenName, + jp.sf.pal.addresslist.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(givenName), getCValueGivenName(), "GIVEN_NAME", + "GivenName", "givenName", likeSearchOption); } /** - * IsNull(is null). And OnceRegistered. + * IsNull(is null). And OnlyOnceRegistered. */ public void setGivenName_IsNull() { regGivenName(CK_ISN, DUMMY_OBJECT); } /** - * IsNotNull(is not null). And OnceRegistered. + * IsNotNull(is not null). And OnlyOnceRegistered. */ public void setGivenName_IsNotNull() { regGivenName(CK_ISNN, DUMMY_OBJECT); @@ -779,7 +673,7 @@ abstract protected ConditionValue getCValueGivenName(); /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {VARCHAR(100)} + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {VARCHAR(100)} * * @param givenNameDesc The value of givenNameDesc as equal. */ @@ -788,7 +682,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param givenNameDesc The value of givenNameDesc as notEqual. */ @@ -797,7 +691,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param givenNameDesc The value of givenNameDesc as greaterThan. */ @@ -806,7 +700,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param givenNameDesc The value of givenNameDesc as lessThan. */ @@ -815,7 +709,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param givenNameDesc The value of givenNameDesc as greaterEqual. */ @@ -824,7 +718,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param givenNameDesc The value of givenNameDesc as lessEqual. */ @@ -833,7 +727,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param givenNameDesc The value of givenNameDesc as prefixSearch. */ @@ -842,21 +736,6 @@ } /** - * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, - * SeveralRegistered. - * - * @param givenNameDesc The value of givenNameDesc as likeSearch. - * @param likeSearchOption The option of like-search. (NotNull) - */ - public void setGivenNameDesc_LikeSearch( - String givenNameDesc, - jp.sf.pal.addresslist.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. * @@ -867,39 +746,54 @@ } /** - * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * - * @param givenNameDesc The collection of givenNameDesc as inScope. - * @param inScopeOption The option of in-scope. (NotNull) + * @param givenNameDescList The collection of givenNameDesc as notInScope. */ - public void setGivenNameDesc_InScope( + public void setGivenNameDesc_NotInScope(Collection givenNameDescList) { + regGivenNameDesc(CK_NINS, cTL(givenNameDescList)); + } + + /** + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param givenNameDesc The value of givenNameDesc as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) + */ + public void setGivenNameDesc_LikeSearch( String givenNameDesc, - jp.sf.pal.addresslist.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(givenNameDesc), - getCValueGivenNameDesc(), "GIVEN_NAME_DESC", "GivenNameDesc", - "givenNameDesc", inScopeOption); + jp.sf.pal.addresslist.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(givenNameDesc), getCValueGivenNameDesc(), + "GIVEN_NAME_DESC", "GivenNameDesc", "givenNameDesc", + likeSearchOption); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param givenNameDescList The collection of givenNameDesc as notInScope. + * @param givenNameDesc The value of givenNameDesc as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setGivenNameDesc_NotInScope(Collection givenNameDescList) { - regGivenNameDesc(CK_NINS, cTL(givenNameDescList)); + public void setGivenNameDesc_NotLikeSearch( + String givenNameDesc, + jp.sf.pal.addresslist.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(givenNameDesc), getCValueGivenNameDesc(), + "GIVEN_NAME_DESC", "GivenNameDesc", "givenNameDesc", + likeSearchOption); } /** - * IsNull(is null). And OnceRegistered. + * IsNull(is null). And OnlyOnceRegistered. */ public void setGivenNameDesc_IsNull() { regGivenNameDesc(CK_ISN, DUMMY_OBJECT); } /** - * IsNotNull(is not null). And OnceRegistered. + * IsNotNull(is not null). And OnlyOnceRegistered. */ public void setGivenNameDesc_IsNotNull() { regGivenNameDesc(CK_ISNN, DUMMY_OBJECT); @@ -918,7 +812,7 @@ abstract protected ConditionValue getCValueGivenNameDesc(); /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {VARCHAR(100)} + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {VARCHAR(100)} * * @param familyName The value of familyName as equal. */ @@ -927,7 +821,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param familyName The value of familyName as notEqual. */ @@ -936,7 +830,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param familyName The value of familyName as greaterThan. */ @@ -945,7 +839,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param familyName The value of familyName as lessThan. */ @@ -954,7 +848,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param familyName The value of familyName as greaterEqual. */ @@ -963,7 +857,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param familyName The value of familyName as lessEqual. */ @@ -972,7 +866,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param familyName The value of familyName as prefixSearch. */ @@ -981,20 +875,6 @@ } /** - * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, - * SeveralRegistered. - * - * @param familyName The value of familyName as likeSearch. - * @param likeSearchOption The option of like-search. (NotNull) - */ - public void setFamilyName_LikeSearch( - String familyName, - jp.sf.pal.addresslist.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. * @@ -1005,38 +885,52 @@ } /** - * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * - * @param familyName The collection of familyName as inScope. - * @param inScopeOption The option of in-scope. (NotNull) + * @param familyNameList The collection of familyName as notInScope. */ - public void setFamilyName_InScope( + public void setFamilyName_NotInScope(Collection familyNameList) { + regFamilyName(CK_NINS, cTL(familyNameList)); + } + + /** + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param familyName The value of familyName as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) + */ + public void setFamilyName_LikeSearch( String familyName, - jp.sf.pal.addresslist.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(familyName), getCValueFamilyName(), - "FAMILY_NAME", "FamilyName", "familyName", inScopeOption); + jp.sf.pal.addresslist.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(familyName), getCValueFamilyName(), "FAMILY_NAME", + "FamilyName", "familyName", likeSearchOption); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param familyNameList The collection of familyName as notInScope. + * @param familyName The value of familyName as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setFamilyName_NotInScope(Collection familyNameList) { - regFamilyName(CK_NINS, cTL(familyNameList)); + public void setFamilyName_NotLikeSearch( + String familyName, + jp.sf.pal.addresslist.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(familyName), getCValueFamilyName(), "FAMILY_NAME", + "FamilyName", "familyName", likeSearchOption); } /** - * IsNull(is null). And OnceRegistered. + * IsNull(is null). And OnlyOnceRegistered. */ public void setFamilyName_IsNull() { regFamilyName(CK_ISN, DUMMY_OBJECT); } /** - * IsNotNull(is not null). And OnceRegistered. + * IsNotNull(is not null). And OnlyOnceRegistered. */ public void setFamilyName_IsNotNull() { regFamilyName(CK_ISNN, DUMMY_OBJECT); @@ -1055,7 +949,7 @@ abstract protected ConditionValue getCValueFamilyName(); /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {VARCHAR(100)} + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {VARCHAR(100)} * * @param familyNameDesc The value of familyNameDesc as equal. */ @@ -1064,7 +958,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param familyNameDesc The value of familyNameDesc as notEqual. */ @@ -1073,7 +967,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param familyNameDesc The value of familyNameDesc as greaterThan. */ @@ -1082,7 +976,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param familyNameDesc The value of familyNameDesc as lessThan. */ @@ -1091,7 +985,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param familyNameDesc The value of familyNameDesc as greaterEqual. */ @@ -1100,7 +994,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param familyNameDesc The value of familyNameDesc as lessEqual. */ @@ -1109,7 +1003,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param familyNameDesc The value of familyNameDesc as prefixSearch. */ @@ -1118,21 +1012,6 @@ } /** - * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, - * SeveralRegistered. - * - * @param familyNameDesc The value of familyNameDesc as likeSearch. - * @param likeSearchOption The option of like-search. (NotNull) - */ - public void setFamilyNameDesc_LikeSearch( - String familyNameDesc, - jp.sf.pal.addresslist.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. * @@ -1143,40 +1022,55 @@ } /** - * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * - * @param familyNameDesc The collection of familyNameDesc as inScope. - * @param inScopeOption The option of in-scope. (NotNull) + * @param familyNameDescList The collection of familyNameDesc as notInScope. */ - public void setFamilyNameDesc_InScope( + public void setFamilyNameDesc_NotInScope( + Collection familyNameDescList) { + regFamilyNameDesc(CK_NINS, cTL(familyNameDescList)); + } + + /** + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param familyNameDesc The value of familyNameDesc as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) + */ + public void setFamilyNameDesc_LikeSearch( String familyNameDesc, - jp.sf.pal.addresslist.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(familyNameDesc), - getCValueFamilyNameDesc(), "FAMILY_NAME_DESC", - "FamilyNameDesc", "familyNameDesc", inScopeOption); + jp.sf.pal.addresslist.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(familyNameDesc), getCValueFamilyNameDesc(), + "FAMILY_NAME_DESC", "FamilyNameDesc", "familyNameDesc", + likeSearchOption); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param familyNameDescList The collection of familyNameDesc as notInScope. + * @param familyNameDesc The value of familyNameDesc as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setFamilyNameDesc_NotInScope( - Collection familyNameDescList) { - regFamilyNameDesc(CK_NINS, cTL(familyNameDescList)); + public void setFamilyNameDesc_NotLikeSearch( + String familyNameDesc, + jp.sf.pal.addresslist.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(familyNameDesc), getCValueFamilyNameDesc(), + "FAMILY_NAME_DESC", "FamilyNameDesc", "familyNameDesc", + likeSearchOption); } /** - * IsNull(is null). And OnceRegistered. + * IsNull(is null). And OnlyOnceRegistered. */ public void setFamilyNameDesc_IsNull() { regFamilyNameDesc(CK_ISN, DUMMY_OBJECT); } /** - * IsNotNull(is not null). And OnceRegistered. + * IsNotNull(is not null). And OnlyOnceRegistered. */ public void setFamilyNameDesc_IsNotNull() { regFamilyNameDesc(CK_ISNN, DUMMY_OBJECT); @@ -1195,7 +1089,7 @@ abstract protected ConditionValue getCValueFamilyNameDesc(); /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {VARCHAR(50)} + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {VARCHAR(50)} * * @param middleName The value of middleName as equal. */ @@ -1204,7 +1098,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param middleName The value of middleName as notEqual. */ @@ -1213,7 +1107,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param middleName The value of middleName as greaterThan. */ @@ -1222,7 +1116,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param middleName The value of middleName as lessThan. */ @@ -1231,7 +1125,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param middleName The value of middleName as greaterEqual. */ @@ -1240,7 +1134,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param middleName The value of middleName as lessEqual. */ @@ -1249,7 +1143,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param middleName The value of middleName as prefixSearch. */ @@ -1258,20 +1152,6 @@ } /** - * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, - * SeveralRegistered. - * - * @param middleName The value of middleName as likeSearch. - * @param likeSearchOption The option of like-search. (NotNull) - */ - public void setMiddleName_LikeSearch( - String middleName, - jp.sf.pal.addresslist.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. * @@ -1282,38 +1162,52 @@ } /** - * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * - * @param middleName The collection of middleName as inScope. - * @param inScopeOption The option of in-scope. (NotNull) + * @param middleNameList The collection of middleName as notInScope. */ - public void setMiddleName_InScope( + public void setMiddleName_NotInScope(Collection middleNameList) { + regMiddleName(CK_NINS, cTL(middleNameList)); + } + + /** + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param middleName The value of middleName as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) + */ + public void setMiddleName_LikeSearch( String middleName, - jp.sf.pal.addresslist.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(middleName), getCValueMiddleName(), - "MIDDLE_NAME", "MiddleName", "middleName", inScopeOption); + jp.sf.pal.addresslist.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(middleName), getCValueMiddleName(), "MIDDLE_NAME", + "MiddleName", "middleName", likeSearchOption); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param middleNameList The collection of middleName as notInScope. + * @param middleName The value of middleName as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setMiddleName_NotInScope(Collection middleNameList) { - regMiddleName(CK_NINS, cTL(middleNameList)); + public void setMiddleName_NotLikeSearch( + String middleName, + jp.sf.pal.addresslist.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(middleName), getCValueMiddleName(), "MIDDLE_NAME", + "MiddleName", "middleName", likeSearchOption); } /** - * IsNull(is null). And OnceRegistered. + * IsNull(is null). And OnlyOnceRegistered. */ public void setMiddleName_IsNull() { regMiddleName(CK_ISN, DUMMY_OBJECT); } /** - * IsNotNull(is not null). And OnceRegistered. + * IsNotNull(is not null). And OnlyOnceRegistered. */ public void setMiddleName_IsNotNull() { regMiddleName(CK_ISNN, DUMMY_OBJECT); @@ -1332,7 +1226,7 @@ abstract protected ConditionValue getCValueMiddleName(); /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {VARCHAR(30)} + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {VARCHAR(30)} * * @param namePrefix The value of namePrefix as equal. */ @@ -1341,7 +1235,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param namePrefix The value of namePrefix as notEqual. */ @@ -1350,7 +1244,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param namePrefix The value of namePrefix as greaterThan. */ @@ -1359,7 +1253,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param namePrefix The value of namePrefix as lessThan. */ @@ -1368,7 +1262,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param namePrefix The value of namePrefix as greaterEqual. */ @@ -1377,7 +1271,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param namePrefix The value of namePrefix as lessEqual. */ @@ -1386,7 +1280,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param namePrefix The value of namePrefix as prefixSearch. */ @@ -1395,20 +1289,6 @@ } /** - * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, - * SeveralRegistered. - * - * @param namePrefix The value of namePrefix as likeSearch. - * @param likeSearchOption The option of like-search. (NotNull) - */ - public void setNamePrefix_LikeSearch( - String namePrefix, - jp.sf.pal.addresslist.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { - registerLikeSearchQuery(CK_LS, fRES(namePrefix), getCValueNamePrefix(), - "NAME_PREFIX", "NamePrefix", "namePrefix", likeSearchOption); - } - - /** * InScope(in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * @@ -1419,38 +1299,52 @@ } /** - * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * - * @param namePrefix The collection of namePrefix as inScope. - * @param inScopeOption The option of in-scope. (NotNull) + * @param namePrefixList The collection of namePrefix as notInScope. */ - public void setNamePrefix_InScope( + public void setNamePrefix_NotInScope(Collection namePrefixList) { + regNamePrefix(CK_NINS, cTL(namePrefixList)); + } + + /** + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param namePrefix The value of namePrefix as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) + */ + public void setNamePrefix_LikeSearch( String namePrefix, - jp.sf.pal.addresslist.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(namePrefix), getCValueNamePrefix(), - "NAME_PREFIX", "NamePrefix", "namePrefix", inScopeOption); + jp.sf.pal.addresslist.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(namePrefix), getCValueNamePrefix(), "NAME_PREFIX", + "NamePrefix", "namePrefix", likeSearchOption); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param namePrefixList The collection of namePrefix as notInScope. + * @param namePrefix The value of namePrefix as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setNamePrefix_NotInScope(Collection namePrefixList) { - regNamePrefix(CK_NINS, cTL(namePrefixList)); + public void setNamePrefix_NotLikeSearch( + String namePrefix, + jp.sf.pal.addresslist.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(namePrefix), getCValueNamePrefix(), "NAME_PREFIX", + "NamePrefix", "namePrefix", likeSearchOption); } /** - * IsNull(is null). And OnceRegistered. + * IsNull(is null). And OnlyOnceRegistered. */ public void setNamePrefix_IsNull() { regNamePrefix(CK_ISN, DUMMY_OBJECT); } /** - * IsNotNull(is not null). And OnceRegistered. + * IsNotNull(is not null). And OnlyOnceRegistered. */ public void setNamePrefix_IsNotNull() { regNamePrefix(CK_ISNN, DUMMY_OBJECT); @@ -1469,7 +1363,7 @@ abstract protected ConditionValue getCValueNamePrefix(); /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {VARCHAR(30)} + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {VARCHAR(30)} * * @param nameSuffix The value of nameSuffix as equal. */ @@ -1478,7 +1372,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param nameSuffix The value of nameSuffix as notEqual. */ @@ -1487,7 +1381,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param nameSuffix The value of nameSuffix as greaterThan. */ @@ -1496,7 +1390,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param nameSuffix The value of nameSuffix as lessThan. */ @@ -1505,7 +1399,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param nameSuffix The value of nameSuffix as greaterEqual. */ @@ -1514,7 +1408,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param nameSuffix The value of nameSuffix as lessEqual. */ @@ -1523,7 +1417,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param nameSuffix The value of nameSuffix as prefixSearch. */ @@ -1532,20 +1426,6 @@ } /** - * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, - * SeveralRegistered. - * - * @param nameSuffix The value of nameSuffix as likeSearch. - * @param likeSearchOption The option of like-search. (NotNull) - */ - public void setNameSuffix_LikeSearch( - String nameSuffix, - jp.sf.pal.addresslist.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { - registerLikeSearchQuery(CK_LS, fRES(nameSuffix), getCValueNameSuffix(), - "NAME_SUFFIX", "NameSuffix", "nameSuffix", likeSearchOption); - } - - /** * InScope(in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * @@ -1556,38 +1436,52 @@ } /** - * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * - * @param nameSuffix The collection of nameSuffix as inScope. - * @param inScopeOption The option of in-scope. (NotNull) + * @param nameSuffixList The collection of nameSuffix as notInScope. */ - public void setNameSuffix_InScope( + public void setNameSuffix_NotInScope(Collection nameSuffixList) { + regNameSuffix(CK_NINS, cTL(nameSuffixList)); + } + + /** + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param nameSuffix The value of nameSuffix as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) + */ + public void setNameSuffix_LikeSearch( String nameSuffix, - jp.sf.pal.addresslist.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(nameSuffix), getCValueNameSuffix(), - "NAME_SUFFIX", "NameSuffix", "nameSuffix", inScopeOption); + jp.sf.pal.addresslist.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(nameSuffix), getCValueNameSuffix(), "NAME_SUFFIX", + "NameSuffix", "nameSuffix", likeSearchOption); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param nameSuffixList The collection of nameSuffix as notInScope. + * @param nameSuffix The value of nameSuffix as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setNameSuffix_NotInScope(Collection nameSuffixList) { - regNameSuffix(CK_NINS, cTL(nameSuffixList)); + public void setNameSuffix_NotLikeSearch( + String nameSuffix, + jp.sf.pal.addresslist.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(nameSuffix), getCValueNameSuffix(), "NAME_SUFFIX", + "NameSuffix", "nameSuffix", likeSearchOption); } /** - * IsNull(is null). And OnceRegistered. + * IsNull(is null). And OnlyOnceRegistered. */ public void setNameSuffix_IsNull() { regNameSuffix(CK_ISN, DUMMY_OBJECT); } /** - * IsNotNull(is not null). And OnceRegistered. + * IsNotNull(is not null). And OnlyOnceRegistered. */ public void setNameSuffix_IsNotNull() { regNameSuffix(CK_ISNN, DUMMY_OBJECT); @@ -1606,7 +1500,7 @@ abstract protected ConditionValue getCValueNameSuffix(); /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {VARCHAR(100)} + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {VARCHAR(100)} * * @param nickname The value of nickname as equal. */ @@ -1615,7 +1509,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param nickname The value of nickname as notEqual. */ @@ -1624,7 +1518,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param nickname The value of nickname as greaterThan. */ @@ -1633,7 +1527,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param nickname The value of nickname as lessThan. */ @@ -1642,7 +1536,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param nickname The value of nickname as greaterEqual. */ @@ -1651,7 +1545,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param nickname The value of nickname as lessEqual. */ @@ -1660,7 +1554,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param nickname The value of nickname as prefixSearch. */ @@ -1669,20 +1563,6 @@ } /** - * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, - * SeveralRegistered. - * - * @param nickname The value of nickname as likeSearch. - * @param likeSearchOption The option of like-search. (NotNull) - */ - public void setNickname_LikeSearch( - String nickname, - jp.sf.pal.addresslist.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { - registerLikeSearchQuery(CK_LS, fRES(nickname), getCValueNickname(), - "NICKNAME", "Nickname", "nickname", likeSearchOption); - } - - /** * InScope(in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * @@ -1693,38 +1573,52 @@ } /** - * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * - * @param nickname The collection of nickname as inScope. - * @param inScopeOption The option of in-scope. (NotNull) + * @param nicknameList The collection of nickname as notInScope. */ - public void setNickname_InScope( + public void setNickname_NotInScope(Collection nicknameList) { + regNickname(CK_NINS, cTL(nicknameList)); + } + + /** + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param nickname The value of nickname as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) + */ + public void setNickname_LikeSearch( String nickname, - jp.sf.pal.addresslist.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(nickname), getCValueNickname(), - "NICKNAME", "Nickname", "nickname", inScopeOption); + jp.sf.pal.addresslist.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(nickname), getCValueNickname(), "NICKNAME", + "Nickname", "nickname", likeSearchOption); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param nicknameList The collection of nickname as notInScope. + * @param nickname The value of nickname as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setNickname_NotInScope(Collection nicknameList) { - regNickname(CK_NINS, cTL(nicknameList)); + public void setNickname_NotLikeSearch( + String nickname, + jp.sf.pal.addresslist.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(nickname), getCValueNickname(), "NICKNAME", + "Nickname", "nickname", likeSearchOption); } /** - * IsNull(is null). And OnceRegistered. + * IsNull(is null). And OnlyOnceRegistered. */ public void setNickname_IsNull() { regNickname(CK_ISN, DUMMY_OBJECT); } /** - * IsNotNull(is not null). And OnceRegistered. + * IsNotNull(is not null). And OnlyOnceRegistered. */ public void setNickname_IsNotNull() { regNickname(CK_ISNN, DUMMY_OBJECT); @@ -1743,7 +1637,7 @@ abstract protected ConditionValue getCValueNickname(); /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {VARCHAR(50)} + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {VARCHAR(50)} * * @param jobTitle The value of jobTitle as equal. */ @@ -1752,7 +1646,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param jobTitle The value of jobTitle as notEqual. */ @@ -1761,7 +1655,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param jobTitle The value of jobTitle as greaterThan. */ @@ -1770,7 +1664,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param jobTitle The value of jobTitle as lessThan. */ @@ -1779,7 +1673,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param jobTitle The value of jobTitle as greaterEqual. */ @@ -1788,7 +1682,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param jobTitle The value of jobTitle as lessEqual. */ @@ -1797,7 +1691,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param jobTitle The value of jobTitle as prefixSearch. */ @@ -1806,20 +1700,6 @@ } /** - * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, - * SeveralRegistered. - * - * @param jobTitle The value of jobTitle as likeSearch. - * @param likeSearchOption The option of like-search. (NotNull) - */ - public void setJobTitle_LikeSearch( - String jobTitle, - jp.sf.pal.addresslist.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { - registerLikeSearchQuery(CK_LS, fRES(jobTitle), getCValueJobTitle(), - "JOB_TITLE", "JobTitle", "jobTitle", likeSearchOption); - } - - /** * InScope(in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * @@ -1830,38 +1710,52 @@ } /** - * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * - * @param jobTitle The collection of jobTitle as inScope. - * @param inScopeOption The option of in-scope. (NotNull) + * @param jobTitleList The collection of jobTitle as notInScope. */ - public void setJobTitle_InScope( + public void setJobTitle_NotInScope(Collection jobTitleList) { + regJobTitle(CK_NINS, cTL(jobTitleList)); + } + + /** + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param jobTitle The value of jobTitle as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) + */ + public void setJobTitle_LikeSearch( String jobTitle, - jp.sf.pal.addresslist.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(jobTitle), getCValueJobTitle(), - "JOB_TITLE", "JobTitle", "jobTitle", inScopeOption); + jp.sf.pal.addresslist.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(jobTitle), getCValueJobTitle(), "JOB_TITLE", + "JobTitle", "jobTitle", likeSearchOption); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param jobTitleList The collection of jobTitle as notInScope. + * @param jobTitle The value of jobTitle as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setJobTitle_NotInScope(Collection jobTitleList) { - regJobTitle(CK_NINS, cTL(jobTitleList)); + public void setJobTitle_NotLikeSearch( + String jobTitle, + jp.sf.pal.addresslist.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(jobTitle), getCValueJobTitle(), "JOB_TITLE", + "JobTitle", "jobTitle", likeSearchOption); } /** - * IsNull(is null). And OnceRegistered. + * IsNull(is null). And OnlyOnceRegistered. */ public void setJobTitle_IsNull() { regJobTitle(CK_ISN, DUMMY_OBJECT); } /** - * IsNotNull(is not null). And OnceRegistered. + * IsNotNull(is not null). And OnlyOnceRegistered. */ public void setJobTitle_IsNotNull() { regJobTitle(CK_ISNN, DUMMY_OBJECT); @@ -1880,7 +1774,7 @@ abstract protected ConditionValue getCValueJobTitle(); /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {VARCHAR(1) : + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {VARCHAR(1) : * Default=[T]} * * @param isPublic The value of isPublic as equal. @@ -1890,7 +1784,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param isPublic The value of isPublic as notEqual. */ @@ -1899,7 +1793,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param isPublic The value of isPublic as greaterThan. */ @@ -1908,7 +1802,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param isPublic The value of isPublic as lessThan. */ @@ -1917,7 +1811,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param isPublic The value of isPublic as greaterEqual. */ @@ -1926,7 +1820,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param isPublic The value of isPublic as lessEqual. */ @@ -1935,7 +1829,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param isPublic The value of isPublic as prefixSearch. */ @@ -1944,20 +1838,6 @@ } /** - * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, - * SeveralRegistered. - * - * @param isPublic The value of isPublic as likeSearch. - * @param likeSearchOption The option of like-search. (NotNull) - */ - public void setIsPublic_LikeSearch( - String isPublic, - jp.sf.pal.addresslist.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { - registerLikeSearchQuery(CK_LS, fRES(isPublic), getCValueIsPublic(), - "IS_PUBLIC", "IsPublic", "isPublic", likeSearchOption); - } - - /** * InScope(in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * @@ -1968,38 +1848,52 @@ } /** - * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * - * @param isPublic The collection of isPublic as inScope. - * @param inScopeOption The option of in-scope. (NotNull) + * @param isPublicList The collection of isPublic as notInScope. */ - public void setIsPublic_InScope( + public void setIsPublic_NotInScope(Collection isPublicList) { + regIsPublic(CK_NINS, cTL(isPublicList)); + } + + /** + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param isPublic The value of isPublic as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) + */ + public void setIsPublic_LikeSearch( String isPublic, - jp.sf.pal.addresslist.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(isPublic), getCValueIsPublic(), - "IS_PUBLIC", "IsPublic", "isPublic", inScopeOption); + jp.sf.pal.addresslist.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(isPublic), getCValueIsPublic(), "IS_PUBLIC", + "IsPublic", "isPublic", likeSearchOption); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param isPublicList The collection of isPublic as notInScope. + * @param isPublic The value of isPublic as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setIsPublic_NotInScope(Collection isPublicList) { - regIsPublic(CK_NINS, cTL(isPublicList)); + public void setIsPublic_NotLikeSearch( + String isPublic, + jp.sf.pal.addresslist.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(isPublic), getCValueIsPublic(), "IS_PUBLIC", + "IsPublic", "isPublic", likeSearchOption); } /** - * IsNull(is null). And OnceRegistered. + * IsNull(is null). And OnlyOnceRegistered. */ public void setIsPublic_IsNull() { regIsPublic(CK_ISN, DUMMY_OBJECT); } /** - * IsNotNull(is not null). And OnceRegistered. + * IsNotNull(is not null). And OnlyOnceRegistered. */ public void setIsPublic_IsNotNull() { regIsPublic(CK_ISNN, DUMMY_OBJECT); @@ -2018,7 +1912,7 @@ abstract protected ConditionValue getCValueIsPublic(); /** - * Equal(=). And NullIgnored, OnceRegistered. {BIGINT : FK to COMPANY} + * Equal(=). And NullIgnored, OnlyOnceRegistered. {BIGINT : FK to COMPANY} * * @param companyId The value of companyId as equal. */ @@ -2027,7 +1921,7 @@ } /** - * NotEqual(!=). And NullIgnored, OnceRegistered. + * NotEqual(!=). And NullIgnored, OnlyOnceRegistered. * * @param companyId The value of companyId as notEqual. */ @@ -2036,7 +1930,7 @@ } /** - * GreaterThan(>). And NullIgnored, OnceRegistered. + * GreaterThan(>). And NullIgnored, OnlyOnceRegistered. * * @param companyId The value of companyId as greaterThan. */ @@ -2045,7 +1939,7 @@ } /** - * LessThan(<). And NullIgnored, OnceRegistered. + * LessThan(<). And NullIgnored, OnlyOnceRegistered. * * @param companyId The value of companyId as lessThan. */ @@ -2054,7 +1948,7 @@ } /** - * GreaterEqual(>=). And NullIgnored, OnceRegistered. + * GreaterEqual(>=). And NullIgnored, OnlyOnceRegistered. * * @param companyId The value of companyId as greaterEqual. */ @@ -2063,7 +1957,7 @@ } /** - * LessEqual(<=). And NullIgnored, OnceRegistered. + * LessEqual(<=). And NullIgnored, OnlyOnceRegistered. * * @param companyId The value of companyId as lessEqual. */ @@ -2091,44 +1985,29 @@ regCompanyId(CK_NINS, cTL(companyIdList)); } - /** - * @param companyCBquery Query. - * @deprecated Please use inScopeCompany(subQuery) method. - */ - public void setCompanyId_InScopeSubQuery_Company(CompanyCQ companyCBquery) { - String subQueryPropertyName = keepCompanyId_InScopeSubQuery_Company(companyCBquery);// for - // saving - // query - // - - // value - // . - registerInScopeSubQuery(companyCBquery, "COMPANY_ID", "ID", - subQueryPropertyName); - } - public void inScopeCompany(SubQuery subQuery) { assertObjectNotNull("subQuery", subQuery); CompanyCB cb = new CompanyCB(); cb.xsetupForInScopeSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepCompanyId_InScopeSubQuery_Company(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerInScopeSubQuery(cb.query(), "COMPANY_ID", "ID", subQueryPropertyName); } - abstract public String keepCompanyId_InScopeSubQuery_Company( + public abstract String keepCompanyId_InScopeSubQuery_Company( CompanyCQ subQuery); /** - * IsNull(is null). And OnceRegistered. + * IsNull(is null). And OnlyOnceRegistered. */ public void setCompanyId_IsNull() { regCompanyId(CK_ISN, DUMMY_OBJECT); } /** - * IsNotNull(is not null). And OnceRegistered. + * IsNotNull(is not null). And OnlyOnceRegistered. */ public void setCompanyId_IsNotNull() { regCompanyId(CK_ISNN, DUMMY_OBJECT); @@ -2147,7 +2026,7 @@ abstract protected ConditionValue getCValueCompanyId(); /** - * Equal(=). And NullIgnored, OnceRegistered. {NotNull : TIMESTAMP} + * Equal(=). And NullIgnored, OnlyOnceRegistered. {NotNull : TIMESTAMP} * * @param createdTime The value of createdTime as equal. */ @@ -2156,7 +2035,7 @@ } /** - * NotEqual(!=). And NullIgnored, OnceRegistered. + * NotEqual(!=). And NullIgnored, OnlyOnceRegistered. * * @param createdTime The value of createdTime as notEqual. */ @@ -2165,7 +2044,7 @@ } /** - * GreaterThan(>). And NullIgnored, OnceRegistered. + * GreaterThan(>). And NullIgnored, OnlyOnceRegistered. * * @param createdTime The value of createdTime as greaterThan. */ @@ -2174,7 +2053,7 @@ } /** - * LessThan(>). And NullIgnored, OnceRegistered. + * LessThan(>). And NullIgnored, OnlyOnceRegistered. * * @param createdTime The value of createdTime as lessThan. */ @@ -2183,7 +2062,7 @@ } /** - * GreaterEqual(>). And NullIgnored, OnceRegistered. + * GreaterEqual(>). And NullIgnored, OnlyOnceRegistered. * * @param createdTime The value of createdTime as greaterEqual. */ @@ -2192,7 +2071,7 @@ } /** - * LessEqual(>). And NullIgnored, OnceRegistered. + * LessEqual(>). And NullIgnored, OnlyOnceRegistered. * * @param createdTime The value of createdTime as lessEqual. */ @@ -2202,7 +2081,7 @@ /** * FromTo($fromDate <= COLUMN_NAME <= $toDate). And NullIgnored, - * OnceRegistered. {NotNull : TIMESTAMP} + * OnlyOnceRegistered. {NotNull : TIMESTAMP} * * @param fromDate The from-date of createdTime. (Nullable) * @param toDate The to-date of createdTime. (Nullable) @@ -2220,7 +2099,7 @@ /** * FromTo($fromDate <= COLUMN_NAME < $toDate + 1). And NullIgnored, - * OnceRegistered. {NotNull : TIMESTAMP} + * OnlyOnceRegistered. {NotNull : TIMESTAMP} * * @param fromDate The from-date of createdTime. (Nullable) * @param toDate The to-date of createdTime. (Nullable) @@ -2246,7 +2125,7 @@ abstract protected ConditionValue getCValueCreatedTime(); /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {NotNull : + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {NotNull : * VARCHAR(255)} * * @param createdBy The value of createdBy as equal. @@ -2256,7 +2135,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param createdBy The value of createdBy as notEqual. */ @@ -2265,7 +2144,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param createdBy The value of createdBy as greaterThan. */ @@ -2274,7 +2153,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param createdBy The value of createdBy as lessThan. */ @@ -2283,7 +2162,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param createdBy The value of createdBy as greaterEqual. */ @@ -2292,7 +2171,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param createdBy The value of createdBy as lessEqual. */ @@ -2301,7 +2180,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param createdBy The value of createdBy as prefixSearch. */ @@ -2310,20 +2189,6 @@ } /** - * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, - * SeveralRegistered. - * - * @param createdBy The value of createdBy as likeSearch. - * @param likeSearchOption The option of like-search. (NotNull) - */ - public void setCreatedBy_LikeSearch( - String createdBy, - jp.sf.pal.addresslist.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. * @@ -2334,27 +2199,41 @@ } /** - * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * - * @param createdBy The collection of createdBy as inScope. - * @param inScopeOption The option of in-scope. (NotNull) + * @param createdByList The collection of createdBy as notInScope. */ - public void setCreatedBy_InScope( + public void setCreatedBy_NotInScope(Collection createdByList) { + regCreatedBy(CK_NINS, cTL(createdByList)); + } + + /** + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param createdBy The value of createdBy as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) + */ + public void setCreatedBy_LikeSearch( String createdBy, - jp.sf.pal.addresslist.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(createdBy), getCValueCreatedBy(), - "CREATED_BY", "CreatedBy", "createdBy", inScopeOption); + jp.sf.pal.addresslist.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(createdBy), getCValueCreatedBy(), "CREATED_BY", + "CreatedBy", "createdBy", likeSearchOption); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param createdByList The collection of createdBy as notInScope. + * @param createdBy The value of createdBy as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setCreatedBy_NotInScope(Collection createdByList) { - regCreatedBy(CK_NINS, cTL(createdByList)); + public void setCreatedBy_NotLikeSearch( + String createdBy, + jp.sf.pal.addresslist.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(createdBy), getCValueCreatedBy(), "CREATED_BY", + "CreatedBy", "createdBy", likeSearchOption); } protected void regCreatedBy(ConditionKey key, Object value) { @@ -2370,7 +2249,7 @@ abstract protected ConditionValue getCValueCreatedBy(); /** - * Equal(=). And NullIgnored, OnceRegistered. {NotNull : TIMESTAMP} + * Equal(=). And NullIgnored, OnlyOnceRegistered. {NotNull : TIMESTAMP} * * @param updatedTime The value of updatedTime as equal. */ @@ -2379,7 +2258,7 @@ } /** - * NotEqual(!=). And NullIgnored, OnceRegistered. + * NotEqual(!=). And NullIgnored, OnlyOnceRegistered. * * @param updatedTime The value of updatedTime as notEqual. */ @@ -2388,7 +2267,7 @@ } /** - * GreaterThan(>). And NullIgnored, OnceRegistered. + * GreaterThan(>). And NullIgnored, OnlyOnceRegistered. * * @param updatedTime The value of updatedTime as greaterThan. */ @@ -2397,7 +2276,7 @@ } /** - * LessThan(>). And NullIgnored, OnceRegistered. + * LessThan(>). And NullIgnored, OnlyOnceRegistered. * * @param updatedTime The value of updatedTime as lessThan. */ @@ -2406,7 +2285,7 @@ } /** - * GreaterEqual(>). And NullIgnored, OnceRegistered. + * GreaterEqual(>). And NullIgnored, OnlyOnceRegistered. * * @param updatedTime The value of updatedTime as greaterEqual. */ @@ -2415,7 +2294,7 @@ } /** - * LessEqual(>). And NullIgnored, OnceRegistered. + * LessEqual(>). And NullIgnored, OnlyOnceRegistered. * * @param updatedTime The value of updatedTime as lessEqual. */ @@ -2425,7 +2304,7 @@ /** * FromTo($fromDate <= COLUMN_NAME <= $toDate). And NullIgnored, - * OnceRegistered. {NotNull : TIMESTAMP} + * OnlyOnceRegistered. {NotNull : TIMESTAMP} * * @param fromDate The from-date of updatedTime. (Nullable) * @param toDate The to-date of updatedTime. (Nullable) @@ -2443,7 +2322,7 @@ /** * FromTo($fromDate <= COLUMN_NAME < $toDate + 1). And NullIgnored, - * OnceRegistered. {NotNull : TIMESTAMP} + * OnlyOnceRegistered. {NotNull : TIMESTAMP} * * @param fromDate The from-date of updatedTime. (Nullable) * @param toDate The to-date of updatedTime. (Nullable) @@ -2469,7 +2348,7 @@ abstract protected ConditionValue getCValueUpdatedTime(); /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {NotNull : + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {NotNull : * VARCHAR(255)} * * @param updatedBy The value of updatedBy as equal. @@ -2479,7 +2358,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param updatedBy The value of updatedBy as notEqual. */ @@ -2488,7 +2367,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param updatedBy The value of updatedBy as greaterThan. */ @@ -2497,7 +2376,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param updatedBy The value of updatedBy as lessThan. */ @@ -2506,7 +2385,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param updatedBy The value of updatedBy as greaterEqual. */ @@ -2515,7 +2394,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param updatedBy The value of updatedBy as lessEqual. */ @@ -2524,7 +2403,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param updatedBy The value of updatedBy as prefixSearch. */ @@ -2533,20 +2412,6 @@ } /** - * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, - * SeveralRegistered. - * - * @param updatedBy The value of updatedBy as likeSearch. - * @param likeSearchOption The option of like-search. (NotNull) - */ - public void setUpdatedBy_LikeSearch( - String updatedBy, - jp.sf.pal.addresslist.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. * @@ -2557,27 +2422,41 @@ } /** - * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * - * @param updatedBy The collection of updatedBy as inScope. - * @param inScopeOption The option of in-scope. (NotNull) + * @param updatedByList The collection of updatedBy as notInScope. */ - public void setUpdatedBy_InScope( + public void setUpdatedBy_NotInScope(Collection updatedByList) { + regUpdatedBy(CK_NINS, cTL(updatedByList)); + } + + /** + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param updatedBy The value of updatedBy as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) + */ + public void setUpdatedBy_LikeSearch( String updatedBy, - jp.sf.pal.addresslist.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(updatedBy), getCValueUpdatedBy(), - "UPDATED_BY", "UpdatedBy", "updatedBy", inScopeOption); + jp.sf.pal.addresslist.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(updatedBy), getCValueUpdatedBy(), "UPDATED_BY", + "UpdatedBy", "updatedBy", likeSearchOption); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param updatedByList The collection of updatedBy as notInScope. + * @param updatedBy The value of updatedBy as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setUpdatedBy_NotInScope(Collection updatedByList) { - regUpdatedBy(CK_NINS, cTL(updatedByList)); + public void setUpdatedBy_NotLikeSearch( + String updatedBy, + jp.sf.pal.addresslist.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(updatedBy), getCValueUpdatedBy(), "UPDATED_BY", + "UpdatedBy", "updatedBy", likeSearchOption); } protected void regUpdatedBy(ConditionKey key, Object value) { @@ -2593,7 +2472,7 @@ abstract protected ConditionValue getCValueUpdatedBy(); /** - * Equal(=). And NullIgnored, OnceRegistered. {TIMESTAMP} + * Equal(=). And NullIgnored, OnlyOnceRegistered. {TIMESTAMP} * * @param deletedTime The value of deletedTime as equal. */ @@ -2602,7 +2481,7 @@ } /** - * NotEqual(!=). And NullIgnored, OnceRegistered. + * NotEqual(!=). And NullIgnored, OnlyOnceRegistered. * * @param deletedTime The value of deletedTime as notEqual. */ @@ -2611,7 +2490,7 @@ } /** - * GreaterThan(>). And NullIgnored, OnceRegistered. + * GreaterThan(>). And NullIgnored, OnlyOnceRegistered. * * @param deletedTime The value of deletedTime as greaterThan. */ @@ -2620,7 +2499,7 @@ } /** - * LessThan(>). And NullIgnored, OnceRegistered. + * LessThan(>). And NullIgnored, OnlyOnceRegistered. * * @param deletedTime The value of deletedTime as lessThan. */ @@ -2629,7 +2508,7 @@ } /** - * GreaterEqual(>). And NullIgnored, OnceRegistered. + * GreaterEqual(>). And NullIgnored, OnlyOnceRegistered. * * @param deletedTime The value of deletedTime as greaterEqual. */ @@ -2638,7 +2517,7 @@ } /** - * LessEqual(>). And NullIgnored, OnceRegistered. + * LessEqual(>). And NullIgnored, OnlyOnceRegistered. * * @param deletedTime The value of deletedTime as lessEqual. */ @@ -2648,7 +2527,7 @@ /** * FromTo($fromDate <= COLUMN_NAME <= $toDate). And NullIgnored, - * OnceRegistered. {TIMESTAMP} + * OnlyOnceRegistered. {TIMESTAMP} * * @param fromDate The from-date of deletedTime. (Nullable) * @param toDate The to-date of deletedTime. (Nullable) @@ -2666,7 +2545,7 @@ /** * FromTo($fromDate <= COLUMN_NAME < $toDate + 1). And NullIgnored, - * OnceRegistered. {TIMESTAMP} + * OnlyOnceRegistered. {TIMESTAMP} * * @param fromDate The from-date of deletedTime. (Nullable) * @param toDate The to-date of deletedTime. (Nullable) @@ -2680,14 +2559,14 @@ } /** - * IsNull(is null). And OnceRegistered. + * IsNull(is null). And OnlyOnceRegistered. */ public void setDeletedTime_IsNull() { regDeletedTime(CK_ISN, DUMMY_OBJECT); } /** - * IsNotNull(is not null). And OnceRegistered. + * IsNotNull(is not null). And OnlyOnceRegistered. */ public void setDeletedTime_IsNotNull() { regDeletedTime(CK_ISNN, DUMMY_OBJECT); @@ -2706,7 +2585,7 @@ abstract protected ConditionValue getCValueDeletedTime(); /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {VARCHAR(255)} + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {VARCHAR(255)} * * @param deletedBy The value of deletedBy as equal. */ @@ -2715,7 +2594,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param deletedBy The value of deletedBy as notEqual. */ @@ -2724,7 +2603,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param deletedBy The value of deletedBy as greaterThan. */ @@ -2733,7 +2612,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param deletedBy The value of deletedBy as lessThan. */ @@ -2742,7 +2621,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param deletedBy The value of deletedBy as greaterEqual. */ @@ -2751,7 +2630,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param deletedBy The value of deletedBy as lessEqual. */ @@ -2760,7 +2639,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param deletedBy The value of deletedBy as prefixSearch. */ @@ -2769,20 +2648,6 @@ } /** - * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, - * SeveralRegistered. - * - * @param deletedBy The value of deletedBy as likeSearch. - * @param likeSearchOption The option of like-search. (NotNull) - */ - public void setDeletedBy_LikeSearch( - String deletedBy, - jp.sf.pal.addresslist.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. * @@ -2793,38 +2658,52 @@ } /** - * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * - * @param deletedBy The collection of deletedBy as inScope. - * @param inScopeOption The option of in-scope. (NotNull) + * @param deletedByList The collection of deletedBy as notInScope. */ - public void setDeletedBy_InScope( + public void setDeletedBy_NotInScope(Collection deletedByList) { + regDeletedBy(CK_NINS, cTL(deletedByList)); + } + + /** + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param deletedBy The value of deletedBy as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) + */ + public void setDeletedBy_LikeSearch( String deletedBy, - jp.sf.pal.addresslist.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(deletedBy), getCValueDeletedBy(), - "DELETED_BY", "DeletedBy", "deletedBy", inScopeOption); + jp.sf.pal.addresslist.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(deletedBy), getCValueDeletedBy(), "DELETED_BY", + "DeletedBy", "deletedBy", likeSearchOption); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param deletedByList The collection of deletedBy as notInScope. + * @param deletedBy The value of deletedBy as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setDeletedBy_NotInScope(Collection deletedByList) { - regDeletedBy(CK_NINS, cTL(deletedByList)); + public void setDeletedBy_NotLikeSearch( + String deletedBy, + jp.sf.pal.addresslist.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(deletedBy), getCValueDeletedBy(), "DELETED_BY", + "DeletedBy", "deletedBy", likeSearchOption); } /** - * IsNull(is null). And OnceRegistered. + * IsNull(is null). And OnlyOnceRegistered. */ public void setDeletedBy_IsNull() { regDeletedBy(CK_ISN, DUMMY_OBJECT); } /** - * IsNotNull(is not null). And OnceRegistered. + * IsNotNull(is not null). And OnlyOnceRegistered. */ public void setDeletedBy_IsNotNull() { regDeletedBy(CK_ISNN, DUMMY_OBJECT); @@ -2843,7 +2722,7 @@ abstract protected ConditionValue getCValueDeletedBy(); /** - * Equal(=). And NullIgnored, OnceRegistered. {NotNull : INTEGER : + * Equal(=). And NullIgnored, OnlyOnceRegistered. {NotNull : INTEGER : * Default=[1]} * * @param versionno The value of versionno as equal. @@ -2853,7 +2732,7 @@ } /** - * NotEqual(!=). And NullIgnored, OnceRegistered. + * NotEqual(!=). And NullIgnored, OnlyOnceRegistered. * * @param versionno The value of versionno as notEqual. */ @@ -2862,7 +2741,7 @@ } /** - * GreaterThan(>). And NullIgnored, OnceRegistered. + * GreaterThan(>). And NullIgnored, OnlyOnceRegistered. * * @param versionno The value of versionno as greaterThan. */ @@ -2871,7 +2750,7 @@ } /** - * LessThan(<). And NullIgnored, OnceRegistered. + * LessThan(<). And NullIgnored, OnlyOnceRegistered. * * @param versionno The value of versionno as lessThan. */ @@ -2880,7 +2759,7 @@ } /** - * GreaterEqual(>=). And NullIgnored, OnceRegistered. + * GreaterEqual(>=). And NullIgnored, OnlyOnceRegistered. * * @param versionno The value of versionno as greaterEqual. */ @@ -2889,7 +2768,7 @@ } /** - * LessEqual(<=). And NullIgnored, OnceRegistered. + * LessEqual(<=). And NullIgnored, OnlyOnceRegistered. * * @param versionno The value of versionno as lessEqual. */ @@ -2929,6 +2808,50 @@ abstract protected ConditionValue getCValueVersionno(); + public SSQFunction scalar_Equal() { + return xcreateSSQFunction("="); + } + + public SSQFunction scalar_GreaterEqual() { + return xcreateSSQFunction(">="); + } + + public SSQFunction scalar_GreaterThan() { + return xcreateSSQFunction(">"); + } + + public SSQFunction scalar_LessEqual() { + return xcreateSSQFunction("<="); + } + + public SSQFunction scalar_LessThan() { + return xcreateSSQFunction("<"); + } + + protected SSQFunction xcreateSSQFunction(final String operand) { + return new SSQFunction(new SSQSetupper() { + public void setup(String function, SubQuery subQuery) { + xscalarSubQuery(function, subQuery, operand); + } + }); + } + + protected void xscalarSubQuery(String function, + SubQuery subQuery, String operand) { + assertObjectNotNull("subQuery", subQuery); + PersonCB cb = new PersonCB(); + cb.xsetupForScalarSubQuery(); + subQuery.query(cb); + String subQueryPropertyName = keepScalarSubQuery(cb.query()); // for + // saving + // query + // -value. + registerScalarSubQuery(function, cb.query(), subQueryPropertyName, + operand); + } + + public abstract String keepScalarSubQuery(PersonCQ subQuery); + // Very Internal (for Suppressing Warn about 'Not Use Import') protected String getConditionBeanClassNameInternally() { return PersonCB.class.getName(); Modified: addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/cbean/cq/bs/AbstractBsPostalCQ.java =================================================================== --- addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/cbean/cq/bs/AbstractBsPostalCQ.java 2008-12-27 22:02:56 UTC (rev 1623) +++ addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/cbean/cq/bs/AbstractBsPostalCQ.java 2008-12-27 22:06:42 UTC (rev 1624) @@ -18,7 +18,6 @@ * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public abstract class AbstractBsPostalCQ extends AbstractConditionQuery { //========================================================================== @@ -48,8 +47,8 @@ // ===== /** - * Equal(=). And NullIgnored, OnceRegistered. {PK : NotNull : BIGINT : FK to - * PERSON} + * Equal(=). And NullIgnored, OnlyOnceRegistered. {PK : NotNull : BIGINT : + * FK to PERSON} * * @param personId The value of personId as equal. */ @@ -58,7 +57,7 @@ } /** - * NotEqual(!=). And NullIgnored, OnceRegistered. + * NotEqual(!=). And NullIgnored, OnlyOnceRegistered. * * @param personId The value of personId as notEqual. */ @@ -67,7 +66,7 @@ } /** - * GreaterThan(>). And NullIgnored, OnceRegistered. + * GreaterThan(>). And NullIgnored, OnlyOnceRegistered. * * @param personId The value of personId as greaterThan. */ @@ -76,7 +75,7 @@ } /** - * LessThan(<). And NullIgnored, OnceRegistered. + * LessThan(<). And NullIgnored, OnlyOnceRegistered. * * @param personId The value of personId as lessThan. */ @@ -85,7 +84,7 @@ } /** - * GreaterEqual(>=). And NullIgnored, OnceRegistered. + * GreaterEqual(>=). And NullIgnored, OnlyOnceRegistered. * * @param personId The value of personId as greaterEqual. */ @@ -94,7 +93,7 @@ } /** - * LessEqual(<=). And NullIgnored, OnceRegistered. + * LessEqual(<=). And NullIgnored, OnlyOnceRegistered. * * @param personId The value of personId as lessEqual. */ @@ -122,43 +121,28 @@ regPersonId(CK_NINS, cTL(personIdList)); } - /** - * @param personCBquery Query. - * @deprecated Please use inScopePerson(subQuery) method. - */ - public void setPersonId_InScopeSubQuery_Person(PersonCQ personCBquery) { - String subQueryPropertyName = keepPersonId_InScopeSubQuery_Person(personCBquery);// for - // saving - // query - // - - // value - // . - registerInScopeSubQuery(personCBquery, "PERSON_ID", "ID", - subQueryPropertyName); - } - public void inScopePerson(SubQuery subQuery) { assertObjectNotNull("subQuery", subQuery); PersonCB cb = new PersonCB(); cb.xsetupForInScopeSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepPersonId_InScopeSubQuery_Person(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerInScopeSubQuery(cb.query(), "PERSON_ID", "ID", subQueryPropertyName); } - abstract public String keepPersonId_InScopeSubQuery_Person(PersonCQ subQuery); + public abstract String keepPersonId_InScopeSubQuery_Person(PersonCQ subQuery); /** - * IsNull(is null). And OnceRegistered. + * IsNull(is null). And OnlyOnceRegistered. */ public void setPersonId_IsNull() { regPersonId(CK_ISN, DUMMY_OBJECT); } /** - * IsNotNull(is not null). And OnceRegistered. + * IsNotNull(is not null). And OnlyOnceRegistered. */ public void setPersonId_IsNotNull() { regPersonId(CK_ISNN, DUMMY_OBJECT); @@ -177,7 +161,7 @@ abstract protected ConditionValue getCValuePersonId(); /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {VARCHAR(200)} + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {VARCHAR(200)} * * @param building The value of building as equal. */ @@ -186,7 +170,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param building The value of building as notEqual. */ @@ -195,7 +179,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param building The value of building as greaterThan. */ @@ -204,7 +188,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param building The value of building as lessThan. */ @@ -213,7 +197,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param building The value of building as greaterEqual. */ @@ -222,7 +206,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param building The value of building as lessEqual. */ @@ -231,7 +215,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param building The value of building as prefixSearch. */ @@ -240,20 +224,6 @@ } /** - * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, - * SeveralRegistered. - * - * @param building The value of building as likeSearch. - * @param likeSearchOption The option of like-search. (NotNull) - */ - public void setBuilding_LikeSearch( - String building, - jp.sf.pal.addresslist.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { - registerLikeSearchQuery(CK_LS, fRES(building), getCValueBuilding(), - "BUILDING", "Building", "building", likeSearchOption); - } - - /** * InScope(in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * @@ -264,38 +234,52 @@ } /** - * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * - * @param building The collection of building as inScope. - * @param inScopeOption The option of in-scope. (NotNull) + * @param buildingList The collection of building as notInScope. */ - public void setBuilding_InScope( + public void setBuilding_NotInScope(Collection buildingList) { + regBuilding(CK_NINS, cTL(buildingList)); + } + + /** + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param building The value of building as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) + */ + public void setBuilding_LikeSearch( String building, - jp.sf.pal.addresslist.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(building), getCValueBuilding(), - "BUILDING", "Building", "building", inScopeOption); + jp.sf.pal.addresslist.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(building), getCValueBuilding(), "BUILDING", + "Building", "building", likeSearchOption); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param buildingList The collection of building as notInScope. + * @param building The value of building as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setBuilding_NotInScope(Collection buildingList) { - regBuilding(CK_NINS, cTL(buildingList)); + public void setBuilding_NotLikeSearch( + String building, + jp.sf.pal.addresslist.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(building), getCValueBuilding(), "BUILDING", + "Building", "building", likeSearchOption); } /** - * IsNull(is null). And OnceRegistered. + * IsNull(is null). And OnlyOnceRegistered. */ public void setBuilding_IsNull() { regBuilding(CK_ISN, DUMMY_OBJECT); } /** - * IsNotNull(is not null). And OnceRegistered. + * IsNotNull(is not null). And OnlyOnceRegistered. */ public void setBuilding_IsNotNull() { regBuilding(CK_ISNN, DUMMY_OBJECT); @@ -314,7 +298,7 @@ abstract protected ConditionValue getCValueBuilding(); /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {VARCHAR(200)} + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {VARCHAR(200)} * * @param street The value of street as equal. */ @@ -323,7 +307,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param street The value of street as notEqual. */ @@ -332,7 +316,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param street The value of street as greaterThan. */ @@ -341,7 +325,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param street The value of street as lessThan. */ @@ -350,7 +334,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param street The value of street as greaterEqual. */ @@ -359,7 +343,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param street The value of street as lessEqual. */ @@ -368,7 +352,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param street The value of street as prefixSearch. */ @@ -377,20 +361,6 @@ } /** - * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, - * SeveralRegistered. - * - * @param street The value of street as likeSearch. - * @param likeSearchOption The option of like-search. (NotNull) - */ - public void setStreet_LikeSearch( - String street, - jp.sf.pal.addresslist.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { - registerLikeSearchQuery(CK_LS, fRES(street), getCValueStreet(), - "STREET", "Street", "street", likeSearchOption); - } - - /** * InScope(in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * @@ -401,38 +371,52 @@ } /** - * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * - * @param street The collection of street as inScope. - * @param inScopeOption The option of in-scope. (NotNull) + * @param streetList The collection of street as notInScope. */ - public void setStreet_InScope( + public void setStreet_NotInScope(Collection streetList) { + regStreet(CK_NINS, cTL(streetList)); + } + + /** + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param street The value of street as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) + */ + public void setStreet_LikeSearch( String street, - jp.sf.pal.addresslist.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(street), getCValueStreet(), "STREET", - "Street", "street", inScopeOption); + jp.sf.pal.addresslist.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(street), getCValueStreet(), "STREET", "Street", + "street", likeSearchOption); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param streetList The collection of street as notInScope. + * @param street The value of street as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setStreet_NotInScope(Collection streetList) { - regStreet(CK_NINS, cTL(streetList)); + public void setStreet_NotLikeSearch( + String street, + jp.sf.pal.addresslist.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(street), getCValueStreet(), "STREET", "Street", + "street", likeSearchOption); } /** - * IsNull(is null). And OnceRegistered. + * IsNull(is null). And OnlyOnceRegistered. */ public void setStreet_IsNull() { regStreet(CK_ISN, DUMMY_OBJECT); } /** - * IsNotNull(is not null). And OnceRegistered. + * IsNotNull(is not null). And OnlyOnceRegistered. */ public void setStreet_IsNotNull() { regStreet(CK_ISNN, DUMMY_OBJECT); @@ -451,7 +435,7 @@ abstract protected ConditionValue getCValueStreet(); /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {VARCHAR(100)} + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {VARCHAR(100)} * * @param city The value of city as equal. */ @@ -460,7 +444,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param city The value of city as notEqual. */ @@ -469,7 +453,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param city The value of city as greaterThan. */ @@ -478,7 +462,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param city The value of city as lessThan. */ @@ -487,7 +471,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param city The value of city as greaterEqual. */ @@ -496,7 +480,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param city The value of city as lessEqual. */ @@ -505,7 +489,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param city The value of city as prefixSearch. */ @@ -514,20 +498,6 @@ } /** - * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, - * SeveralRegistered. - * - * @param city The value of city as likeSearch. - * @param likeSearchOption The option of like-search. (NotNull) - */ - public void setCity_LikeSearch( - String city, - jp.sf.pal.addresslist.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { - registerLikeSearchQuery(CK_LS, fRES(city), getCValueCity(), "CITY", - "City", "city", likeSearchOption); - } - - /** * InScope(in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * @@ -538,38 +508,52 @@ } /** - * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * - * @param city The collection of city as inScope. - * @param inScopeOption The option of in-scope. (NotNull) + * @param cityList The collection of city as notInScope. */ - public void setCity_InScope( + public void setCity_NotInScope(Collection cityList) { + regCity(CK_NINS, cTL(cityList)); + } + + /** + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param city The value of city as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) + */ + public void setCity_LikeSearch( String city, - jp.sf.pal.addresslist.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(city), getCValueCity(), "CITY", - "City", "city", inScopeOption); + jp.sf.pal.addresslist.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(city), getCValueCity(), "CITY", "City", "city", + likeSearchOption); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param cityList The collection of city as notInScope. + * @param city The value of city as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setCity_NotInScope(Collection cityList) { - regCity(CK_NINS, cTL(cityList)); + public void setCity_NotLikeSearch( + String city, + jp.sf.pal.addresslist.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(city), getCValueCity(), "CITY", "City", "city", + likeSearchOption); } /** - * IsNull(is null). And OnceRegistered. + * IsNull(is null). And OnlyOnceRegistered. */ public void setCity_IsNull() { regCity(CK_ISN, DUMMY_OBJECT); } /** - * IsNotNull(is not null). And OnceRegistered. + * IsNotNull(is not null). And OnlyOnceRegistered. */ public void setCity_IsNotNull() { regCity(CK_ISNN, DUMMY_OBJECT); @@ -586,7 +570,7 @@ abstract protected ConditionValue getCValueCity(); /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {VARCHAR(100)} + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {VARCHAR(100)} * * @param state The value of state as equal. */ @@ -595,7 +579,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param state The value of state as notEqual. */ @@ -604,7 +588,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param state The value of state as greaterThan. */ @@ -613,7 +597,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param state The value of state as lessThan. */ @@ -622,7 +606,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param state The value of state as greaterEqual. */ @@ -631,7 +615,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param state The value of state as lessEqual. */ @@ -640,7 +624,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param state The value of state as prefixSearch. */ @@ -649,20 +633,6 @@ } /** - * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, - * SeveralRegistered. - * - * @param state The value of state as likeSearch. - * @param likeSearchOption The option of like-search. (NotNull) - */ - public void setState_LikeSearch( - String state, - jp.sf.pal.addresslist.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { - registerLikeSearchQuery(CK_LS, fRES(state), getCValueState(), "STATE", - "State", "state", likeSearchOption); - } - - /** * InScope(in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * @@ -673,38 +643,52 @@ } /** - * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * - * @param state The collection of state as inScope. - * @param inScopeOption The option of in-scope. (NotNull) + * @param stateList The collection of state as notInScope. */ - public void setState_InScope( + public void setState_NotInScope(Collection stateList) { + regState(CK_NINS, cTL(stateList)); + } + + /** + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param state The value of state as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) + */ + public void setState_LikeSearch( String state, - jp.sf.pal.addresslist.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(state), getCValueState(), "STATE", - "State", "state", inScopeOption); + jp.sf.pal.addresslist.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(state), getCValueState(), "STATE", "State", "state", + likeSearchOption); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param stateList The collection of state as notInScope. + * @param state The value of state as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setState_NotInScope(Collection stateList) { - regState(CK_NINS, cTL(stateList)); + public void setState_NotLikeSearch( + String state, + jp.sf.pal.addresslist.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(state), getCValueState(), "STATE", "State", + "state", likeSearchOption); } /** - * IsNull(is null). And OnceRegistered. + * IsNull(is null). And OnlyOnceRegistered. */ public void setState_IsNull() { regState(CK_ISN, DUMMY_OBJECT); } /** - * IsNotNull(is not null). And OnceRegistered. + * IsNotNull(is not null). And OnlyOnceRegistered. */ public void setState_IsNotNull() { regState(CK_ISNN, DUMMY_OBJECT); @@ -722,7 +706,7 @@ abstract protected ConditionValue getCValueState(); /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {VARCHAR(30)} + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {VARCHAR(30)} * * @param postalCode The value of postalCode as equal. */ @@ -731,7 +715,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param postalCode The value of postalCode as notEqual. */ @@ -740,7 +724,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param postalCode The value of postalCode as greaterThan. */ @@ -749,7 +733,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param postalCode The value of postalCode as lessThan. */ @@ -758,7 +742,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param postalCode The value of postalCode as greaterEqual. */ @@ -767,7 +751,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param postalCode The value of postalCode as lessEqual. */ @@ -776,7 +760,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param postalCode The value of postalCode as prefixSearch. */ @@ -785,20 +769,6 @@ } /** - * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, - * SeveralRegistered. - * - * @param postalCode The value of postalCode as likeSearch. - * @param likeSearchOption The option of like-search. (NotNull) - */ - public void setPostalCode_LikeSearch( - String postalCode, - jp.sf.pal.addresslist.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { - registerLikeSearchQuery(CK_LS, fRES(postalCode), getCValuePostalCode(), - "POSTAL_CODE", "PostalCode", "postalCode", likeSearchOption); - } - - /** * InScope(in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * @@ -809,38 +779,52 @@ } /** - * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * - * @param postalCode The collection of postalCode as inScope. - * @param inScopeOption The option of in-scope. (NotNull) + * @param postalCodeList The collection of postalCode as notInScope. */ - public void setPostalCode_InScope( + public void setPostalCode_NotInScope(Collection postalCodeList) { + regPostalCode(CK_NINS, cTL(postalCodeList)); + } + + /** + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param postalCode The value of postalCode as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) + */ + public void setPostalCode_LikeSearch( String postalCode, - jp.sf.pal.addresslist.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(postalCode), getCValuePostalCode(), - "POSTAL_CODE", "PostalCode", "postalCode", inScopeOption); + jp.sf.pal.addresslist.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(postalCode), getCValuePostalCode(), "POSTAL_CODE", + "PostalCode", "postalCode", likeSearchOption); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param postalCodeList The collection of postalCode as notInScope. + * @param postalCode The value of postalCode as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setPostalCode_NotInScope(Collection postalCodeList) { - regPostalCode(CK_NINS, cTL(postalCodeList)); + public void setPostalCode_NotLikeSearch( + String postalCode, + jp.sf.pal.addresslist.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(postalCode), getCValuePostalCode(), "POSTAL_CODE", + "PostalCode", "postalCode", likeSearchOption); } /** - * IsNull(is null). And OnceRegistered. + * IsNull(is null). And OnlyOnceRegistered. */ public void setPostalCode_IsNull() { regPostalCode(CK_ISN, DUMMY_OBJECT); } /** - * IsNotNull(is not null). And OnceRegistered. + * IsNotNull(is not null). And OnlyOnceRegistered. */ public void setPostalCode_IsNotNull() { regPostalCode(CK_ISNN, DUMMY_OBJECT); @@ -859,7 +843,7 @@ abstract protected ConditionValue getCValuePostalCode(); /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {VARCHAR(100)} + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {VARCHAR(100)} * * @param country The value of country as equal. */ @@ -868,7 +852,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param country The value of country as notEqual. */ @@ -877,7 +861,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param country The value of country as greaterThan. */ @@ -886,7 +870,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param country The value of country as lessThan. */ @@ -895,7 +879,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param country The value of country as greaterEqual. */ @@ -904,7 +888,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param country The value of country as lessEqual. */ @@ -913,7 +897,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param country The value of country as prefixSearch. */ @@ -922,20 +906,6 @@ } /** - * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, - * SeveralRegistered. - * - * @param country The value of country as likeSearch. - * @param likeSearchOption The option of like-search. (NotNull) - */ - public void setCountry_LikeSearch( - String country, - jp.sf.pal.addresslist.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { - registerLikeSearchQuery(CK_LS, fRES(country), getCValueCountry(), - "COUNTRY", "Country", "country", likeSearchOption); - } - - /** * InScope(in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * @@ -946,38 +916,52 @@ } /** - * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * - * @param country The collection of country as inScope. - * @param inScopeOption The option of in-scope. (NotNull) + * @param countryList The collection of country as notInScope. */ - public void setCountry_InScope( + public void setCountry_NotInScope(Collection countryList) { + regCountry(CK_NINS, cTL(countryList)); + } + + /** + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param country The value of country as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) + */ + public void setCountry_LikeSearch( String country, - jp.sf.pal.addresslist.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(country), getCValueCountry(), - "COUNTRY", "Country", "country", inScopeOption); + jp.sf.pal.addresslist.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(country), getCValueCountry(), "COUNTRY", "Country", + "country", likeSearchOption); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param countryList The collection of country as notInScope. + * @param country The value of country as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setCountry_NotInScope(Collection countryList) { - regCountry(CK_NINS, cTL(countryList)); + public void setCountry_NotLikeSearch( + String country, + jp.sf.pal.addresslist.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(country), getCValueCountry(), "COUNTRY", "Country", + "country", likeSearchOption); } /** - * IsNull(is null). And OnceRegistered. + * IsNull(is null). And OnlyOnceRegistered. */ public void setCountry_IsNull() { regCountry(CK_ISN, DUMMY_OBJECT); } /** - * IsNotNull(is not null). And OnceRegistered. + * IsNotNull(is not null). And OnlyOnceRegistered. */ public void setCountry_IsNotNull() { regCountry(CK_ISNN, DUMMY_OBJECT); @@ -995,6 +979,50 @@ abstract protected ConditionValue getCValueCountry(); + public SSQFunction scalar_Equal() { + return xcreateSSQFunction("="); + } + + public SSQFunction scalar_GreaterEqual() { + return xcreateSSQFunction(">="); + } + + public SSQFunction scalar_GreaterThan() { + return xcreateSSQFunction(">"); + } + + public SSQFunction scalar_LessEqual() { + return xcreateSSQFunction("<="); + } + + public SSQFunction scalar_LessThan() { + return xcreateSSQFunction("<"); + } + + protected SSQFunction xcreateSSQFunction(final String operand) { + return new SSQFunction(new SSQSetupper() { + public void setup(String function, SubQuery subQuery) { + xscalarSubQuery(function, subQuery, operand); + } + }); + } + + protected void xscalarSubQuery(String function, + SubQuery subQuery, String operand) { + assertObjectNotNull("subQuery", subQuery); + PostalCB cb = new PostalCB(); + cb.xsetupForScalarSubQuery(); + subQuery.query(cb); + String subQueryPropertyName = keepScalarSubQuery(cb.query()); // for + // saving + // query + // -value. + registerScalarSubQuery(function, cb.query(), subQueryPropertyName, + operand); + } + + public abstract String keepScalarSubQuery(PostalCQ subQuery); + // Very Internal (for Suppressing Warn about 'Not Use Import') protected String getConditionBeanClassNameInternally() { return PostalCB.class.getName(); Modified: addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/cbean/cq/bs/AbstractBsRoleInfoCQ.java =================================================================== --- addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/cbean/cq/bs/AbstractBsRoleInfoCQ.java 2008-12-27 22:02:56 UTC (rev 1623) +++ addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/cbean/cq/bs/AbstractBsRoleInfoCQ.java 2008-12-27 22:06:42 UTC (rev 1624) @@ -20,7 +20,6 @@ * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public abstract class AbstractBsRoleInfoCQ extends AbstractConditionQuery { //========================================================================== @@ -50,7 +49,7 @@ // ===== /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {PK : NotNull : + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {PK : NotNull : * VARCHAR(255)} * * @param roleId The value of roleId as equal. @@ -60,7 +59,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param roleId The value of roleId as notEqual. */ @@ -69,7 +68,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param roleId The value of roleId as greaterThan. */ @@ -78,7 +77,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param roleId The value of roleId as lessThan. */ @@ -87,7 +86,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param roleId The value of roleId as greaterEqual. */ @@ -96,7 +95,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param roleId The value of roleId as lessEqual. */ @@ -105,7 +104,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param roleId The value of roleId as prefixSearch. */ @@ -114,20 +113,6 @@ } /** - * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, - * SeveralRegistered. - * - * @param roleId The value of roleId as likeSearch. - * @param likeSearchOption The option of like-search. (NotNull) - */ - public void setRoleId_LikeSearch( - String roleId, - jp.sf.pal.addresslist.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { - registerLikeSearchQuery(CK_LS, fRES(roleId), getCValueRoleId(), - "ROLE_ID", "RoleId", "roleId", likeSearchOption); - } - - /** * InScope(in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * @@ -138,43 +123,41 @@ } /** - * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * - * @param roleId The collection of roleId as inScope. - * @param inScopeOption The option of in-scope. (NotNull) + * @param roleIdList The collection of roleId as notInScope. */ - public void setRoleId_InScope( - String roleId, - jp.sf.pal.addresslist.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(roleId), getCValueRoleId(), - "ROLE_ID", "RoleId", "roleId", inScopeOption); + public void setRoleId_NotInScope(Collection roleIdList) { + regRoleId(CK_NINS, cTL(roleIdList)); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param roleIdList The collection of roleId as notInScope. + * @param roleId The value of roleId as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) */ - public void setRoleId_NotInScope(Collection roleIdList) { - regRoleId(CK_NINS, cTL(roleIdList)); + public void setRoleId_LikeSearch( + String roleId, + jp.sf.pal.addresslist.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(roleId), getCValueRoleId(), "ROLE_ID", "RoleId", + "roleId", likeSearchOption); } /** - * @param roleMappingCBquery Query. - * @deprecated Please use inScopeRoleMappingList(subQuery) method. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param roleId The value of roleId as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setRoleId_InScopeSubQuery_RoleMappingList( - RoleMappingCQ roleMappingCBquery) { - String subQueryPropertyName = keepRoleId_InScopeSubQuery_RoleMappingList(roleMappingCBquery);// for - // saving - // query - // - - // value - // . - registerInScopeSubQuery(roleMappingCBquery, "ROLE_ID", "ROLE_ID", - subQueryPropertyName); + public void setRoleId_NotLikeSearch( + String roleId, + jp.sf.pal.addresslist.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(roleId), getCValueRoleId(), "ROLE_ID", "RoleId", + "roleId", likeSearchOption); } public void inScopeRoleMappingList(SubQuery subQuery) { @@ -183,42 +166,26 @@ cb.xsetupForInScopeSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepRoleId_InScopeSubQuery_RoleMappingList(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerInScopeSubQuery(cb.query(), "ROLE_ID", "ROLE_ID", subQueryPropertyName); } - abstract public String keepRoleId_InScopeSubQuery_RoleMappingList( + public abstract String keepRoleId_InScopeSubQuery_RoleMappingList( RoleMappingCQ subQuery); - /** - * @param userInfoCBquery Query. - * @deprecated Please use inScopeUserInfoList(subQuery) method. - */ - public void setRoleId_InScopeSubQuery_UserInfoList( - UserInfoCQ userInfoCBquery) { - String subQueryPropertyName = keepRoleId_InScopeSubQuery_UserInfoList(userInfoCBquery);// for - // saving - // query - // - - // value - // . - registerInScopeSubQuery(userInfoCBquery, "ROLE_ID", "ROLE_ID", - subQueryPropertyName); - } - public void inScopeUserInfoList(SubQuery subQuery) { assertObjectNotNull("subQuery", subQuery); UserInfoCB cb = new UserInfoCB(); cb.xsetupForInScopeSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepRoleId_InScopeSubQuery_UserInfoList(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerInScopeSubQuery(cb.query(), "ROLE_ID", "ROLE_ID", subQueryPropertyName); } - abstract public String keepRoleId_InScopeSubQuery_UserInfoList( + public abstract String keepRoleId_InScopeSubQuery_UserInfoList( UserInfoCQ subQuery); public void notInScopeRoleMappingList(SubQuery subQuery) { @@ -227,12 +194,12 @@ cb.xsetupForInScopeSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepRoleId_NotInScopeSubQuery_RoleMappingList(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerNotInScopeSubQuery(cb.query(), "ROLE_ID", "ROLE_ID", subQueryPropertyName); } - abstract public String keepRoleId_NotInScopeSubQuery_RoleMappingList( + public abstract String keepRoleId_NotInScopeSubQuery_RoleMappingList( RoleMappingCQ subQuery); public void notInScopeUserInfoList(SubQuery subQuery) { @@ -241,31 +208,15 @@ cb.xsetupForInScopeSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepRoleId_NotInScopeSubQuery_UserInfoList(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerNotInScopeSubQuery(cb.query(), "ROLE_ID", "ROLE_ID", subQueryPropertyName); } - abstract public String keepRoleId_NotInScopeSubQuery_UserInfoList( + public abstract String keepRoleId_NotInScopeSubQuery_UserInfoList( UserInfoCQ subQuery); /** - * @param roleMappingCBquery Query. - * @deprecated Please use existsRoleMappingList(subQuery) method. - */ - public void setRoleId_ExistsSubQuery_RoleMappingList( - RoleMappingCQ roleMappingCBquery) { - String subQueryPropertyName = keepRoleId_ExistsSubQuery_RoleMappingList(roleMappingCBquery);// for - // saving - // query - // - - // value - // . - registerExistsSubQuery(roleMappingCBquery, "ROLE_ID", "ROLE_ID", - subQueryPropertyName); - } - - /** * Set up 'exists' sub-query. {exists (select ROLE_ID from ROLE_MAPPING * where ...)} * @@ -278,30 +229,15 @@ cb.xsetupForExistsSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepRoleId_ExistsSubQuery_RoleMappingList(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerExistsSubQuery(cb.query(), "ROLE_ID", "ROLE_ID", subQueryPropertyName); } - abstract public String keepRoleId_ExistsSubQuery_RoleMappingList( + public abstract String keepRoleId_ExistsSubQuery_RoleMappingList( RoleMappingCQ subQuery); /** - * @param userInfoCBquery Query. - * @deprecated Please use existsUserInfoList(subQuery) method. - */ - public void setRoleId_ExistsSubQuery_UserInfoList(UserInfoCQ userInfoCBquery) { - String subQueryPropertyName = keepRoleId_ExistsSubQuery_UserInfoList(userInfoCBquery);// for - // saving - // query - // - - // value - // . - registerExistsSubQuery(userInfoCBquery, "ROLE_ID", "ROLE_ID", - subQueryPropertyName); - } - - /** * Set up 'exists' sub-query. {exists (select ROLE_ID from USER_INFO where * ...)} * @@ -314,12 +250,12 @@ cb.xsetupForExistsSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepRoleId_ExistsSubQuery_UserInfoList(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerExistsSubQuery(cb.query(), "ROLE_ID", "ROLE_ID", subQueryPropertyName); } - abstract public String keepRoleId_ExistsSubQuery_UserInfoList( + public abstract String keepRoleId_ExistsSubQuery_UserInfoList( UserInfoCQ subQuery); /** @@ -335,12 +271,12 @@ cb.xsetupForExistsSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepRoleId_NotExistsSubQuery_RoleMappingList(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerNotExistsSubQuery(cb.query(), "ROLE_ID", "ROLE_ID", subQueryPropertyName); } - abstract public String keepRoleId_NotExistsSubQuery_RoleMappingList( + public abstract String keepRoleId_NotExistsSubQuery_RoleMappingList( RoleMappingCQ subQuery); /** @@ -356,53 +292,53 @@ cb.xsetupForExistsSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepRoleId_NotExistsSubQuery_UserInfoList(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerNotExistsSubQuery(cb.query(), "ROLE_ID", "ROLE_ID", subQueryPropertyName); } - abstract public String keepRoleId_NotExistsSubQuery_UserInfoList( + public abstract String keepRoleId_NotExistsSubQuery_UserInfoList( UserInfoCQ subQuery); public void xderiveRoleMappingList(String function, SubQuery subQuery, String aliasName) { assertObjectNotNull("subQuery", subQuery); RoleMappingCB cb = new RoleMappingCB(); - cb.xsetupForDeriveReferrer(); + cb.xsetupForDerivedReferrer(); subQuery.query(cb); - String subQueryPropertyName = keepRoleId_DeriveSubQuery_RoleMappingList(cb - .query());// for saving query-value. - registerDeriveSubQuery(function, cb.query(), "ROLE_ID", "ROLE_ID", - subQueryPropertyName, aliasName); + String subQueryPropertyName = keepRoleId_DerivedReferrer_RoleMappingList(cb + .query()); // for saving query-value. + registerDerivedReferrerSubQuery(function, cb.query(), "ROLE_ID", + "ROLE_ID", subQueryPropertyName, aliasName); } - abstract public String keepRoleId_DeriveSubQuery_RoleMappingList( + public abstract String keepRoleId_DerivedReferrer_RoleMappingList( RoleMappingCQ subQuery); public void xderiveUserInfoList(String function, SubQuery subQuery, String aliasName) { assertObjectNotNull("subQuery", subQuery); UserInfoCB cb = new UserInfoCB(); - cb.xsetupForDeriveReferrer(); + cb.xsetupForDerivedReferrer(); subQuery.query(cb); - String subQueryPropertyName = keepRoleId_DeriveSubQuery_UserInfoList(cb - .query());// for saving query-value. - registerDeriveSubQuery(function, cb.query(), "ROLE_ID", "ROLE_ID", - subQueryPropertyName, aliasName); + String subQueryPropertyName = keepRoleId_DerivedReferrer_UserInfoList(cb + .query()); // for saving query-value. + registerDerivedReferrerSubQuery(function, cb.query(), "ROLE_ID", + "ROLE_ID", subQueryPropertyName, aliasName); } - abstract public String keepRoleId_DeriveSubQuery_UserInfoList( + public abstract String keepRoleId_DerivedReferrer_UserInfoList( UserInfoCQ subQuery); /** - * IsNull(is null). And OnceRegistered. + * IsNull(is null). And OnlyOnceRegistered. */ public void setRoleId_IsNull() { regRoleId(CK_ISN, DUMMY_OBJECT); } /** - * IsNotNull(is not null). And OnceRegistered. + * IsNotNull(is not null). And OnlyOnceRegistered. */ public void setRoleId_IsNotNull() { regRoleId(CK_ISNN, DUMMY_OBJECT); @@ -421,7 +357,7 @@ abstract protected ConditionValue getCValueRoleId(); /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {VARCHAR(100)} + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {VARCHAR(100)} * * @param name The value of name as equal. */ @@ -430,7 +366,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param name The value of name as notEqual. */ @@ -439,7 +375,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param name The value of name as greaterThan. */ @@ -448,7 +384,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param name The value of name as lessThan. */ @@ -457,7 +393,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param name The value of name as greaterEqual. */ @@ -466,7 +402,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param name The value of name as lessEqual. */ @@ -475,7 +411,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param name The value of name as prefixSearch. */ @@ -484,20 +420,6 @@ } /** - * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, - * SeveralRegistered. - * - * @param name The value of name as likeSearch. - * @param likeSearchOption The option of like-search. (NotNull) - */ - public void setName_LikeSearch( - String name, - jp.sf.pal.addresslist.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { - registerLikeSearchQuery(CK_LS, fRES(name), getCValueName(), "NAME", - "Name", "name", likeSearchOption); - } - - /** * InScope(in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * @@ -508,38 +430,52 @@ } /** - * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * - * @param name The collection of name as inScope. - * @param inScopeOption The option of in-scope. (NotNull) + * @param nameList The collection of name as notInScope. */ - public void setName_InScope( + public void setName_NotInScope(Collection nameList) { + regName(CK_NINS, cTL(nameList)); + } + + /** + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param name The value of name as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) + */ + public void setName_LikeSearch( String name, - jp.sf.pal.addresslist.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(name), getCValueName(), "NAME", - "Name", "name", inScopeOption); + jp.sf.pal.addresslist.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(name), getCValueName(), "NAME", "Name", "name", + likeSearchOption); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param nameList The collection of name as notInScope. + * @param name The value of name as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setName_NotInScope(Collection nameList) { - regName(CK_NINS, cTL(nameList)); + public void setName_NotLikeSearch( + String name, + jp.sf.pal.addresslist.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(name), getCValueName(), "NAME", "Name", "name", + likeSearchOption); } /** - * IsNull(is null). And OnceRegistered. + * IsNull(is null). And OnlyOnceRegistered. */ public void setName_IsNull() { regName(CK_ISN, DUMMY_OBJECT); } /** - * IsNotNull(is not null). And OnceRegistered. + * IsNotNull(is not null). And OnlyOnceRegistered. */ public void setName_IsNotNull() { regName(CK_ISNN, DUMMY_OBJECT); @@ -556,7 +492,7 @@ abstract protected ConditionValue getCValueName(); /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {VARCHAR(255)} + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {VARCHAR(255)} * * @param description The value of description as equal. */ @@ -565,7 +501,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param description The value of description as notEqual. */ @@ -574,7 +510,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param description The value of description as greaterThan. */ @@ -583,7 +519,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param description The value of description as lessThan. */ @@ -592,7 +528,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param description The value of description as greaterEqual. */ @@ -601,7 +537,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param description The value of description as lessEqual. */ @@ -610,7 +546,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param description The value of description as prefixSearch. */ @@ -619,21 +555,6 @@ } /** - * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, - * SeveralRegistered. - * - * @param description The value of description as likeSearch. - * @param likeSearchOption The option of like-search. (NotNull) - */ - public void setDescription_LikeSearch( - String description, - jp.sf.pal.addresslist.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { - registerLikeSearchQuery(CK_LS, fRES(description), - getCValueDescription(), "DESCRIPTION", "Description", - "description", likeSearchOption); - } - - /** * InScope(in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * @@ -644,38 +565,52 @@ } /** - * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * - * @param description The collection of description as inScope. - * @param inScopeOption The option of in-scope. (NotNull) + * @param descriptionList The collection of description as notInScope. */ - public void setDescription_InScope( + public void setDescription_NotInScope(Collection descriptionList) { + regDescription(CK_NINS, cTL(descriptionList)); + } + + /** + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param description The value of description as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) + */ + public void setDescription_LikeSearch( String description, - jp.sf.pal.addresslist.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(description), getCValueDescription(), - "DESCRIPTION", "Description", "description", inScopeOption); + jp.sf.pal.addresslist.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(description), getCValueDescription(), "DESCRIPTION", + "Description", "description", likeSearchOption); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param descriptionList The collection of description as notInScope. + * @param description The value of description as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setDescription_NotInScope(Collection descriptionList) { - regDescription(CK_NINS, cTL(descriptionList)); + public void setDescription_NotLikeSearch( + String description, + jp.sf.pal.addresslist.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(description), getCValueDescription(), + "DESCRIPTION", "Description", "description", likeSearchOption); } /** - * IsNull(is null). And OnceRegistered. + * IsNull(is null). And OnlyOnceRegistered. */ public void setDescription_IsNull() { regDescription(CK_ISN, DUMMY_OBJECT); } /** - * IsNotNull(is not null). And OnceRegistered. + * IsNotNull(is not null). And OnlyOnceRegistered. */ public void setDescription_IsNotNull() { regDescription(CK_ISNN, DUMMY_OBJECT); @@ -694,7 +629,7 @@ abstract protected ConditionValue getCValueDescription(); /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {VARCHAR(255)} + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {VARCHAR(255)} * * @param email The value of email as equal. */ @@ -703,7 +638,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param email The value of email as notEqual. */ @@ -712,7 +647,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param email The value of email as greaterThan. */ @@ -721,7 +656,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param email The value of email as lessThan. */ @@ -730,7 +665,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param email The value of email as greaterEqual. */ @@ -739,7 +674,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param email The value of email as lessEqual. */ @@ -748,7 +683,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param email The value of email as prefixSearch. */ @@ -757,20 +692,6 @@ } /** - * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, - * SeveralRegistered. - * - * @param email The value of email as likeSearch. - * @param likeSearchOption The option of like-search. (NotNull) - */ - public void setEmail_LikeSearch( - String email, - jp.sf.pal.addresslist.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { - registerLikeSearchQuery(CK_LS, fRES(email), getCValueEmail(), "EMAIL", - "Email", "email", likeSearchOption); - } - - /** * InScope(in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * @@ -781,38 +702,52 @@ } /** - * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * - * @param email The collection of email as inScope. - * @param inScopeOption The option of in-scope. (NotNull) + * @param emailList The collection of email as notInScope. */ - public void setEmail_InScope( + public void setEmail_NotInScope(Collection emailList) { + regEmail(CK_NINS, cTL(emailList)); + } + + /** + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param email The value of email as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) + */ + public void setEmail_LikeSearch( String email, - jp.sf.pal.addresslist.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(email), getCValueEmail(), "EMAIL", - "Email", "email", inScopeOption); + jp.sf.pal.addresslist.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(email), getCValueEmail(), "EMAIL", "Email", "email", + likeSearchOption); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param emailList The collection of email as notInScope. + * @param email The value of email as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setEmail_NotInScope(Collection emailList) { - regEmail(CK_NINS, cTL(emailList)); + public void setEmail_NotLikeSearch( + String email, + jp.sf.pal.addresslist.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(email), getCValueEmail(), "EMAIL", "Email", + "email", likeSearchOption); } /** - * IsNull(is null). And OnceRegistered. + * IsNull(is null). And OnlyOnceRegistered. */ public void setEmail_IsNull() { regEmail(CK_ISN, DUMMY_OBJECT); } /** - * IsNotNull(is not null). And OnceRegistered. + * IsNotNull(is not null). And OnlyOnceRegistered. */ public void setEmail_IsNotNull() { regEmail(CK_ISNN, DUMMY_OBJECT); @@ -830,7 +765,7 @@ abstract protected ConditionValue getCValueEmail(); /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {VARCHAR(255)} + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {VARCHAR(255)} * * @param url The value of url as equal. */ @@ -839,7 +774,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param url The value of url as notEqual. */ @@ -848,7 +783,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param url The value of url as greaterThan. */ @@ -857,7 +792,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param url The value of url as lessThan. */ @@ -866,7 +801,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param url The value of url as greaterEqual. */ @@ -875,7 +810,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param url The value of url as lessEqual. */ @@ -884,7 +819,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param url The value of url as prefixSearch. */ @@ -893,20 +828,6 @@ } /** - * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, - * SeveralRegistered. - * - * @param url The value of url as likeSearch. - * @param likeSearchOption The option of like-search. (NotNull) - */ - public void setUrl_LikeSearch( - String url, - jp.sf.pal.addresslist.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { - registerLikeSearchQuery(CK_LS, fRES(url), getCValueUrl(), "URL", "Url", - "url", likeSearchOption); - } - - /** * InScope(in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * @@ -917,38 +838,52 @@ } /** - * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * - * @param url The collection of url as inScope. - * @param inScopeOption The option of in-scope. (NotNull) + * @param urlList The collection of url as notInScope. */ - public void setUrl_InScope( + public void setUrl_NotInScope(Collection urlList) { + regUrl(CK_NINS, cTL(urlList)); + } + + /** + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param url The value of url as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) + */ + public void setUrl_LikeSearch( String url, - jp.sf.pal.addresslist.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(url), getCValueUrl(), "URL", "Url", - "url", inScopeOption); + jp.sf.pal.addresslist.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(url), getCValueUrl(), "URL", "Url", "url", + likeSearchOption); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param urlList The collection of url as notInScope. + * @param url The value of url as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setUrl_NotInScope(Collection urlList) { - regUrl(CK_NINS, cTL(urlList)); + public void setUrl_NotLikeSearch( + String url, + jp.sf.pal.addresslist.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(url), getCValueUrl(), "URL", "Url", "url", + likeSearchOption); } /** - * IsNull(is null). And OnceRegistered. + * IsNull(is null). And OnlyOnceRegistered. */ public void setUrl_IsNull() { regUrl(CK_ISN, DUMMY_OBJECT); } /** - * IsNotNull(is not null). And OnceRegistered. + * IsNotNull(is not null). And OnlyOnceRegistered. */ public void setUrl_IsNotNull() { regUrl(CK_ISNN, DUMMY_OBJECT); @@ -965,7 +900,7 @@ abstract protected ConditionValue getCValueUrl(); /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {VARCHAR(40)} + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {VARCHAR(40)} * * @param telephone The value of telephone as equal. */ @@ -974,7 +909,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param telephone The value of telephone as notEqual. */ @@ -983,7 +918,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param telephone The value of telephone as greaterThan. */ @@ -992,7 +927,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param telephone The value of telephone as lessThan. */ @@ -1001,7 +936,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param telephone The value of telephone as greaterEqual. */ @@ -1010,7 +945,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param telephone The value of telephone as lessEqual. */ @@ -1019,7 +954,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param telephone The value of telephone as prefixSearch. */ @@ -1028,20 +963,6 @@ } /** - * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, - * SeveralRegistered. - * - * @param telephone The value of telephone as likeSearch. - * @param likeSearchOption The option of like-search. (NotNull) - */ - public void setTelephone_LikeSearch( - String telephone, - jp.sf.pal.addresslist.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { - registerLikeSearchQuery(CK_LS, fRES(telephone), getCValueTelephone(), - "TELEPHONE", "Telephone", "telephone", likeSearchOption); - } - - /** * InScope(in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * @@ -1052,38 +973,52 @@ } /** - * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * - * @param telephone The collection of telephone as inScope. - * @param inScopeOption The option of in-scope. (NotNull) + * @param telephoneList The collection of telephone as notInScope. */ - public void setTelephone_InScope( + public void setTelephone_NotInScope(Collection telephoneList) { + regTelephone(CK_NINS, cTL(telephoneList)); + } + + /** + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param telephone The value of telephone as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) + */ + public void setTelephone_LikeSearch( String telephone, - jp.sf.pal.addresslist.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(telephone), getCValueTelephone(), - "TELEPHONE", "Telephone", "telephone", inScopeOption); + jp.sf.pal.addresslist.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(telephone), getCValueTelephone(), "TELEPHONE", + "Telephone", "telephone", likeSearchOption); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param telephoneList The collection of telephone as notInScope. + * @param telephone The value of telephone as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setTelephone_NotInScope(Collection telephoneList) { - regTelephone(CK_NINS, cTL(telephoneList)); + public void setTelephone_NotLikeSearch( + String telephone, + jp.sf.pal.addresslist.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(telephone), getCValueTelephone(), "TELEPHONE", + "Telephone", "telephone", likeSearchOption); } /** - * IsNull(is null). And OnceRegistered. + * IsNull(is null). And OnlyOnceRegistered. */ public void setTelephone_IsNull() { regTelephone(CK_ISN, DUMMY_OBJECT); } /** - * IsNotNull(is not null). And OnceRegistered. + * IsNotNull(is not null). And OnlyOnceRegistered. */ public void setTelephone_IsNotNull() { regTelephone(CK_ISNN, DUMMY_OBJECT); @@ -1102,7 +1037,7 @@ abstract protected ConditionValue getCValueTelephone(); /** - * Equal(=). And NullIgnored, OnceRegistered. {NotNull : TIMESTAMP} + * Equal(=). And NullIgnored, OnlyOnceRegistered. {NotNull : TIMESTAMP} * * @param createdTime The value of createdTime as equal. */ @@ -1111,7 +1046,7 @@ } /** - * NotEqual(!=). And NullIgnored, OnceRegistered. + * NotEqual(!=). And NullIgnored, OnlyOnceRegistered. * * @param createdTime The value of createdTime as notEqual. */ @@ -1120,7 +1055,7 @@ } /** - * GreaterThan(>). And NullIgnored, OnceRegistered. + * GreaterThan(>). And NullIgnored, OnlyOnceRegistered. * * @param createdTime The value of createdTime as greaterThan. */ @@ -1129,7 +1064,7 @@ } /** - * LessThan(>). And NullIgnored, OnceRegistered. + * LessThan(>). And NullIgnored, OnlyOnceRegistered. * * @param createdTime The value of createdTime as lessThan. */ @@ -1138,7 +1073,7 @@ } /** - * GreaterEqual(>). And NullIgnored, OnceRegistered. + * GreaterEqual(>). And NullIgnored, OnlyOnceRegistered. * * @param createdTime The value of createdTime as greaterEqual. */ @@ -1147,7 +1082,7 @@ } /** - * LessEqual(>). And NullIgnored, OnceRegistered. + * LessEqual(>). And NullIgnored, OnlyOnceRegistered. * * @param createdTime The value of createdTime as lessEqual. */ @@ -1157,7 +1092,7 @@ /** * FromTo($fromDate <= COLUMN_NAME <= $toDate). And NullIgnored, - * OnceRegistered. {NotNull : TIMESTAMP} + * OnlyOnceRegistered. {NotNull : TIMESTAMP} * * @param fromDate The from-date of createdTime. (Nullable) * @param toDate The to-date of createdTime. (Nullable) @@ -1175,7 +1110,7 @@ /** * FromTo($fromDate <= COLUMN_NAME < $toDate + 1). And NullIgnored, - * OnceRegistered. {NotNull : TIMESTAMP} + * OnlyOnceRegistered. {NotNull : TIMESTAMP} * * @param fromDate The from-date of createdTime. (Nullable) * @param toDate The to-date of createdTime. (Nullable) @@ -1201,7 +1136,7 @@ abstract protected ConditionValue getCValueCreatedTime(); /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {NotNull : + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {NotNull : * VARCHAR(255)} * * @param createdBy The value of createdBy as equal. @@ -1211,7 +1146,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param createdBy The value of createdBy as notEqual. */ @@ -1220,7 +1155,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param createdBy The value of createdBy as greaterThan. */ @@ -1229,7 +1164,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param createdBy The value of createdBy as lessThan. */ @@ -1238,7 +1173,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param createdBy The value of createdBy as greaterEqual. */ @@ -1247,7 +1182,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param createdBy The value of createdBy as lessEqual. */ @@ -1256,7 +1191,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param createdBy The value of createdBy as prefixSearch. */ @@ -1265,20 +1200,6 @@ } /** - * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, - * SeveralRegistered. - * - * @param createdBy The value of createdBy as likeSearch. - * @param likeSearchOption The option of like-search. (NotNull) - */ - public void setCreatedBy_LikeSearch( - String createdBy, - jp.sf.pal.addresslist.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { - registerLikeSearchQuery(CK_LS, fRES(createdBy), getCValueCreatedBy(), - "CREATED_BY", "CreatedBy", "createdBy", likeSearchOption); - } - - /** * InScope(in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * @@ -1289,27 +1210,41 @@ } /** - * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * - * @param createdBy The collection of createdBy as inScope. - * @param inScopeOption The option of in-scope. (NotNull) + * @param createdByList The collection of createdBy as notInScope. */ - public void setCreatedBy_InScope( + public void setCreatedBy_NotInScope(Collection createdByList) { + regCreatedBy(CK_NINS, cTL(createdByList)); + } + + /** + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param createdBy The value of createdBy as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) + */ + public void setCreatedBy_LikeSearch( String createdBy, - jp.sf.pal.addresslist.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(createdBy), getCValueCreatedBy(), - "CREATED_BY", "CreatedBy", "createdBy", inScopeOption); + jp.sf.pal.addresslist.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(createdBy), getCValueCreatedBy(), "CREATED_BY", + "CreatedBy", "createdBy", likeSearchOption); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param createdByList The collection of createdBy as notInScope. + * @param createdBy The value of createdBy as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setCreatedBy_NotInScope(Collection createdByList) { - regCreatedBy(CK_NINS, cTL(createdByList)); + public void setCreatedBy_NotLikeSearch( + String createdBy, + jp.sf.pal.addresslist.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(createdBy), getCValueCreatedBy(), "CREATED_BY", + "CreatedBy", "createdBy", likeSearchOption); } protected void regCreatedBy(ConditionKey key, Object value) { @@ -1325,7 +1260,7 @@ abstract protected ConditionValue getCValueCreatedBy(); /** - * Equal(=). And NullIgnored, OnceRegistered. {NotNull : TIMESTAMP} + * Equal(=). And NullIgnored, OnlyOnceRegistered. {NotNull : TIMESTAMP} * * @param updatedTime The value of updatedTime as equal. */ @@ -1334,7 +1269,7 @@ } /** - * NotEqual(!=). And NullIgnored, OnceRegistered. + * NotEqual(!=). And NullIgnored, OnlyOnceRegistered. * * @param updatedTime The value of updatedTime as notEqual. */ @@ -1343,7 +1278,7 @@ } /** - * GreaterThan(>). And NullIgnored, OnceRegistered. + * GreaterThan(>). And NullIgnored, OnlyOnceRegistered. * * @param updatedTime The value of updatedTime as greaterThan. */ @@ -1352,7 +1287,7 @@ } /** - * LessThan(>). And NullIgnored, OnceRegistered. + * LessThan(>). And NullIgnored, OnlyOnceRegistered. * * @param updatedTime The value of updatedTime as lessThan. */ @@ -1361,7 +1296,7 @@ } /** - * GreaterEqual(>). And NullIgnored, OnceRegistered. + * GreaterEqual(>). And NullIgnored, OnlyOnceRegistered. * * @param updatedTime The value of updatedTime as greaterEqual. */ @@ -1370,7 +1305,7 @@ } /** - * LessEqual(>). And NullIgnored, OnceRegistered. + * LessEqual(>). And NullIgnored, OnlyOnceRegistered. * * @param updatedTime The value of updatedTime as lessEqual. */ @@ -1380,7 +1315,7 @@ /** * FromTo($fromDate <= COLUMN_NAME <= $toDate). And NullIgnored, - * OnceRegistered. {NotNull : TIMESTAMP} + * OnlyOnceRegistered. {NotNull : TIMESTAMP} * * @param fromDate The from-date of updatedTime. (Nullable) * @param toDate The to-date of updatedTime. (Nullable) @@ -1398,7 +1333,7 @@ /** * FromTo($fromDate <= COLUMN_NAME < $toDate + 1). And NullIgnored, - * OnceRegistered. {NotNull : TIMESTAMP} + * OnlyOnceRegistered. {NotNull : TIMESTAMP} * * @param fromDate The from-date of updatedTime. (Nullable) * @param toDate The to-date of updatedTime. (Nullable) @@ -1424,7 +1359,7 @@ abstract protected ConditionValue getCValueUpdatedTime(); /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {NotNull : + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {NotNull : * VARCHAR(255)} * * @param updatedBy The value of updatedBy as equal. @@ -1434,7 +1369,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param updatedBy The value of updatedBy as notEqual. */ @@ -1443,7 +1378,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param updatedBy The value of updatedBy as greaterThan. */ @@ -1452,7 +1387,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param updatedBy The value of updatedBy as lessThan. */ @@ -1461,7 +1396,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param updatedBy The value of updatedBy as greaterEqual. */ @@ -1470,7 +1405,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param updatedBy The value of updatedBy as lessEqual. */ @@ -1479,7 +1414,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param updatedBy The value of updatedBy as prefixSearch. */ @@ -1488,20 +1423,6 @@ } /** - * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, - * SeveralRegistered. - * - * @param updatedBy The value of updatedBy as likeSearch. - * @param likeSearchOption The option of like-search. (NotNull) - */ - public void setUpdatedBy_LikeSearch( - String updatedBy, - jp.sf.pal.addresslist.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { - registerLikeSearchQuery(CK_LS, fRES(updatedBy), getCValueUpdatedBy(), - "UPDATED_BY", "UpdatedBy", "updatedBy", likeSearchOption); - } - - /** * InScope(in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * @@ -1512,27 +1433,41 @@ } /** - * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * - * @param updatedBy The collection of updatedBy as inScope. - * @param inScopeOption The option of in-scope. (NotNull) + * @param updatedByList The collection of updatedBy as notInScope. */ - public void setUpdatedBy_InScope( + public void setUpdatedBy_NotInScope(Collection updatedByList) { + regUpdatedBy(CK_NINS, cTL(updatedByList)); + } + + /** + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param updatedBy The value of updatedBy as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) + */ + public void setUpdatedBy_LikeSearch( String updatedBy, - jp.sf.pal.addresslist.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(updatedBy), getCValueUpdatedBy(), - "UPDATED_BY", "UpdatedBy", "updatedBy", inScopeOption); + jp.sf.pal.addresslist.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(updatedBy), getCValueUpdatedBy(), "UPDATED_BY", + "UpdatedBy", "updatedBy", likeSearchOption); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param updatedByList The collection of updatedBy as notInScope. + * @param updatedBy The value of updatedBy as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setUpdatedBy_NotInScope(Collection updatedByList) { - regUpdatedBy(CK_NINS, cTL(updatedByList)); + public void setUpdatedBy_NotLikeSearch( + String updatedBy, + jp.sf.pal.addresslist.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(updatedBy), getCValueUpdatedBy(), "UPDATED_BY", + "UpdatedBy", "updatedBy", likeSearchOption); } protected void regUpdatedBy(ConditionKey key, Object value) { @@ -1548,7 +1483,7 @@ abstract protected ConditionValue getCValueUpdatedBy(); /** - * Equal(=). And NullIgnored, OnceRegistered. {TIMESTAMP} + * Equal(=). And NullIgnored, OnlyOnceRegistered. {TIMESTAMP} * * @param deletedTime The value of deletedTime as equal. */ @@ -1557,7 +1492,7 @@ } /** - * NotEqual(!=). And NullIgnored, OnceRegistered. + * NotEqual(!=). And NullIgnored, OnlyOnceRegistered. * * @param deletedTime The value of deletedTime as notEqual. */ @@ -1566,7 +1501,7 @@ } /** - * GreaterThan(>). And NullIgnored, OnceRegistered. + * GreaterThan(>). And NullIgnored, OnlyOnceRegistered. * * @param deletedTime The value of deletedTime as greaterThan. */ @@ -1575,7 +1510,7 @@ } /** - * LessThan(>). And NullIgnored, OnceRegistered. + * LessThan(>). And NullIgnored, OnlyOnceRegistered. * * @param deletedTime The value of deletedTime as lessThan. */ @@ -1584,7 +1519,7 @@ } /** - * GreaterEqual(>). And NullIgnored, OnceRegistered. + * GreaterEqual(>). And NullIgnored, OnlyOnceRegistered. * * @param deletedTime The value of deletedTime as greaterEqual. */ @@ -1593,7 +1528,7 @@ } /** - * LessEqual(>). And NullIgnored, OnceRegistered. + * LessEqual(>). And NullIgnored, OnlyOnceRegistered. * * @param deletedTime The value of deletedTime as lessEqual. */ @@ -1603,7 +1538,7 @@ /** * FromTo($fromDate <= COLUMN_NAME <= $toDate). And NullIgnored, - * OnceRegistered. {TIMESTAMP} + * OnlyOnceRegistered. {TIMESTAMP} * * @param fromDate The from-date of deletedTime. (Nullable) * @param toDate The to-date of deletedTime. (Nullable) @@ -1621,7 +1556,7 @@ /** * FromTo($fromDate <= COLUMN_NAME < $toDate + 1). And NullIgnored, - * OnceRegistered. {TIMESTAMP} + * OnlyOnceRegistered. {TIMESTAMP} * * @param fromDate The from-date of deletedTime. (Nullable) * @param toDate The to-date of deletedTime. (Nullable) @@ -1635,14 +1570,14 @@ } /** - * IsNull(is null). And OnceRegistered. + * IsNull(is null). And OnlyOnceRegistered. */ public void setDeletedTime_IsNull() { regDeletedTime(CK_ISN, DUMMY_OBJECT); } /** - * IsNotNull(is not null). And OnceRegistered. + * IsNotNull(is not null). And OnlyOnceRegistered. */ public void setDeletedTime_IsNotNull() { regDeletedTime(CK_ISNN, DUMMY_OBJECT); @@ -1661,7 +1596,7 @@ abstract protected ConditionValue getCValueDeletedTime(); /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {VARCHAR(255)} + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {VARCHAR(255)} * * @param deletedBy The value of deletedBy as equal. */ @@ -1670,7 +1605,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param deletedBy The value of deletedBy as notEqual. */ @@ -1679,7 +1614,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param deletedBy The value of deletedBy as greaterThan. */ @@ -1688,7 +1623,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param deletedBy The value of deletedBy as lessThan. */ @@ -1697,7 +1632,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param deletedBy The value of deletedBy as greaterEqual. */ @@ -1706,7 +1641,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param deletedBy The value of deletedBy as lessEqual. */ @@ -1715,7 +1650,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param deletedBy The value of deletedBy as prefixSearch. */ @@ -1724,20 +1659,6 @@ } /** - * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, - * SeveralRegistered. - * - * @param deletedBy The value of deletedBy as likeSearch. - * @param likeSearchOption The option of like-search. (NotNull) - */ - public void setDeletedBy_LikeSearch( - String deletedBy, - jp.sf.pal.addresslist.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { - registerLikeSearchQuery(CK_LS, fRES(deletedBy), getCValueDeletedBy(), - "DELETED_BY", "DeletedBy", "deletedBy", likeSearchOption); - } - - /** * InScope(in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * @@ -1748,38 +1669,52 @@ } /** - * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * - * @param deletedBy The collection of deletedBy as inScope. - * @param inScopeOption The option of in-scope. (NotNull) + * @param deletedByList The collection of deletedBy as notInScope. */ - public void setDeletedBy_InScope( + public void setDeletedBy_NotInScope(Collection deletedByList) { + regDeletedBy(CK_NINS, cTL(deletedByList)); + } + + /** + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param deletedBy The value of deletedBy as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) + */ + public void setDeletedBy_LikeSearch( String deletedBy, - jp.sf.pal.addresslist.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(deletedBy), getCValueDeletedBy(), - "DELETED_BY", "DeletedBy", "deletedBy", inScopeOption); + jp.sf.pal.addresslist.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(deletedBy), getCValueDeletedBy(), "DELETED_BY", + "DeletedBy", "deletedBy", likeSearchOption); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param deletedByList The collection of deletedBy as notInScope. + * @param deletedBy The value of deletedBy as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setDeletedBy_NotInScope(Collection deletedByList) { - regDeletedBy(CK_NINS, cTL(deletedByList)); + public void setDeletedBy_NotLikeSearch( + String deletedBy, + jp.sf.pal.addresslist.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(deletedBy), getCValueDeletedBy(), "DELETED_BY", + "DeletedBy", "deletedBy", likeSearchOption); } /** - * IsNull(is null). And OnceRegistered. + * IsNull(is null). And OnlyOnceRegistered. */ public void setDeletedBy_IsNull() { regDeletedBy(CK_ISN, DUMMY_OBJECT); } /** - * IsNotNull(is not null). And OnceRegistered. + * IsNotNull(is not null). And OnlyOnceRegistered. */ public void setDeletedBy_IsNotNull() { regDeletedBy(CK_ISNN, DUMMY_OBJECT); @@ -1798,7 +1733,7 @@ abstract protected ConditionValue getCValueDeletedBy(); /** - * Equal(=). And NullIgnored, OnceRegistered. {NotNull : INTEGER} + * Equal(=). And NullIgnored, OnlyOnceRegistered. {NotNull : INTEGER} * * @param versionno The value of versionno as equal. */ @@ -1807,7 +1742,7 @@ } /** - * NotEqual(!=). And NullIgnored, OnceRegistered. + * NotEqual(!=). And NullIgnored, OnlyOnceRegistered. * * @param versionno The value of versionno as notEqual. */ @@ -1816,7 +1751,7 @@ } /** - * GreaterThan(>). And NullIgnored, OnceRegistered. + * GreaterThan(>). And NullIgnored, OnlyOnceRegistered. * * @param versionno The value of versionno as greaterThan. */ @@ -1825,7 +1760,7 @@ } /** - * LessThan(<). And NullIgnored, OnceRegistered. + * LessThan(<). And NullIgnored, OnlyOnceRegistered. * * @param versionno The value of versionno as lessThan. */ @@ -1834,7 +1769,7 @@ } /** - * GreaterEqual(>=). And NullIgnored, OnceRegistered. + * GreaterEqual(>=). And NullIgnored, OnlyOnceRegistered. * * @param versionno The value of versionno as greaterEqual. */ @@ -1843,7 +1778,7 @@ } /** - * LessEqual(<=). And NullIgnored, OnceRegistered. + * LessEqual(<=). And NullIgnored, OnlyOnceRegistered. * * @param versionno The value of versionno as lessEqual. */ @@ -1883,6 +1818,50 @@ abstract protected ConditionValue getCValueVersionno(); + public SSQFunction scalar_Equal() { + return xcreateSSQFunction("="); + } + + public SSQFunction scalar_GreaterEqual() { + return xcreateSSQFunction(">="); + } + + public SSQFunction scalar_GreaterThan() { + return xcreateSSQFunction(">"); + } + + public SSQFunction scalar_LessEqual() { + return xcreateSSQFunction("<="); + } + + public SSQFunction scalar_LessThan() { + return xcreateSSQFunction("<"); + } + + protected SSQFunction xcreateSSQFunction(final String operand) { + return new SSQFunction(new SSQSetupper() { + public void setup(String function, SubQuery subQuery) { + xscalarSubQuery(function, subQuery, operand); + } + }); + } + + protected void xscalarSubQuery(String function, + SubQuery subQuery, String operand) { + assertObjectNotNull("subQuery", subQuery); + RoleInfoCB cb = new RoleInfoCB(); + cb.xsetupForScalarSubQuery(); + subQuery.query(cb); + String subQueryPropertyName = keepScalarSubQuery(cb.query()); // for + // saving + // query + // -value. + registerScalarSubQuery(function, cb.query(), subQueryPropertyName, + operand); + } + + public abstract String keepScalarSubQuery(RoleInfoCQ subQuery); + // Very Internal (for Suppressing Warn about 'Not Use Import') protected String getConditionBeanClassNameInternally() { return RoleInfoCB.class.getName(); Modified: addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/cbean/cq/bs/AbstractBsRoleMappingCQ.java =================================================================== --- addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/cbean/cq/bs/AbstractBsRoleMappingCQ.java 2008-12-27 22:02:56 UTC (rev 1623) +++ addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/cbean/cq/bs/AbstractBsRoleMappingCQ.java 2008-12-27 22:06:42 UTC (rev 1624) @@ -11,16 +11,13 @@ import jp.sf.pal.addresslist.db.cbean.RoleInfoCB; import jp.sf.pal.addresslist.db.cbean.RoleMappingCB; import jp.sf.pal.addresslist.db.cbean.UserInfoCB; -import jp.sf.pal.addresslist.db.cbean.cq.RoleInfoCQ; import jp.sf.pal.addresslist.db.cbean.cq.RoleMappingCQ; -import jp.sf.pal.addresslist.db.cbean.cq.UserInfoCQ; /** * The abstract condition-query of ROLE_MAPPING. * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public abstract class AbstractBsRoleMappingCQ extends AbstractConditionQuery { //========================================================================== @@ -50,7 +47,8 @@ // ===== /** - * Equal(=). And NullIgnored, OnceRegistered. {PK : ID : NotNull : INTEGER} + * Equal(=). And NullIgnored, OnlyOnceRegistered. {PK : ID : NotNull : + * INTEGER} * * @param id The value of id as equal. */ @@ -59,7 +57,7 @@ } /** - * NotEqual(!=). And NullIgnored, OnceRegistered. + * NotEqual(!=). And NullIgnored, OnlyOnceRegistered. * * @param id The value of id as notEqual. */ @@ -68,7 +66,7 @@ } /** - * GreaterThan(>). And NullIgnored, OnceRegistered. + * GreaterThan(>). And NullIgnored, OnlyOnceRegistered. * * @param id The value of id as greaterThan. */ @@ -77,7 +75,7 @@ } /** - * LessThan(<). And NullIgnored, OnceRegistered. + * LessThan(<). And NullIgnored, OnlyOnceRegistered. * * @param id The value of id as lessThan. */ @@ -86,7 +84,7 @@ } /** - * GreaterEqual(>=). And NullIgnored, OnceRegistered. + * GreaterEqual(>=). And NullIgnored, OnlyOnceRegistered. * * @param id The value of id as greaterEqual. */ @@ -95,7 +93,7 @@ } /** - * LessEqual(<=). And NullIgnored, OnceRegistered. + * LessEqual(<=). And NullIgnored, OnlyOnceRegistered. * * @param id The value of id as lessEqual. */ @@ -124,14 +122,14 @@ } /** - * IsNull(is null). And OnceRegistered. + * IsNull(is null). And OnlyOnceRegistered. */ public void setId_IsNull() { regId(CK_ISN, DUMMY_OBJECT); } /** - * IsNotNull(is not null). And OnceRegistered. + * IsNotNull(is not null). And OnlyOnceRegistered. */ public void setId_IsNotNull() { regId(CK_ISNN, DUMMY_OBJECT); @@ -148,8 +146,8 @@ abstract protected ConditionValue getCValueId(); /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {NotNull : VARCHAR(255) - * : FK to USER_INFO} + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {NotNull : + * VARCHAR(255) : FK to USER_INFO} * * @param userId The value of userId as equal. */ @@ -158,7 +156,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param userId The value of userId as notEqual. */ @@ -167,7 +165,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param userId The value of userId as greaterThan. */ @@ -176,7 +174,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param userId The value of userId as lessThan. */ @@ -185,7 +183,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param userId The value of userId as greaterEqual. */ @@ -194,7 +192,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param userId The value of userId as lessEqual. */ @@ -203,7 +201,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param userId The value of userId as prefixSearch. */ @@ -212,20 +210,6 @@ } /** - * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, - * SeveralRegistered. - * - * @param userId The value of userId as likeSearch. - * @param likeSearchOption The option of like-search. (NotNull) - */ - public void setUserId_LikeSearch( - String userId, - jp.sf.pal.addresslist.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { - registerLikeSearchQuery(CK_LS, fRES(userId), getCValueUserId(), - "USER_ID", "UserId", "userId", likeSearchOption); - } - - /** * InScope(in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * @@ -236,42 +220,41 @@ } /** - * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * - * @param userId The collection of userId as inScope. - * @param inScopeOption The option of in-scope. (NotNull) + * @param userIdList The collection of userId as notInScope. */ - public void setUserId_InScope( - String userId, - jp.sf.pal.addresslist.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(userId), getCValueUserId(), - "USER_ID", "UserId", "userId", inScopeOption); + public void setUserId_NotInScope(Collection userIdList) { + regUserId(CK_NINS, cTL(userIdList)); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param userIdList The collection of userId as notInScope. + * @param userId The value of userId as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) */ - public void setUserId_NotInScope(Collection userIdList) { - regUserId(CK_NINS, cTL(userIdList)); + public void setUserId_LikeSearch( + String userId, + jp.sf.pal.addresslist.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(userId), getCValueUserId(), "USER_ID", "UserId", + "userId", likeSearchOption); } /** - * @param userInfoCBquery Query. - * @deprecated Please use inScopeUserInfo(subQuery) method. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param userId The value of userId as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setUserId_InScopeSubQuery_UserInfo(UserInfoCQ userInfoCBquery) { - String subQueryPropertyName = keepUserId_InScopeSubQuery_UserInfo(userInfoCBquery);// for - // saving - // query - // - - // value - // . - registerInScopeSubQuery(userInfoCBquery, "USER_ID", "USER_ID", - subQueryPropertyName); + public void setUserId_NotLikeSearch( + String userId, + jp.sf.pal.addresslist.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(userId), getCValueUserId(), "USER_ID", "UserId", + "userId", likeSearchOption); } public void inScopeUserInfo(SubQuery subQuery) { @@ -280,12 +263,12 @@ cb.xsetupForInScopeSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepUserId_InScopeSubQuery_UserInfo(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerInScopeSubQuery(cb.query(), "USER_ID", "USER_ID", subQueryPropertyName); } - abstract public String keepUserId_InScopeSubQuery_UserInfo( + public abstract String keepUserId_InScopeSubQuery_UserInfo( jp.sf.pal.addresslist.db.cbean.cq.UserInfoCQ subQuery); protected void regUserId(ConditionKey key, Object value) { @@ -301,8 +284,8 @@ abstract protected ConditionValue getCValueUserId(); /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {NotNull : VARCHAR(255) - * : FK to ROLE_INFO} + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {NotNull : + * VARCHAR(255) : FK to ROLE_INFO} * * @param roleId The value of roleId as equal. */ @@ -311,7 +294,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param roleId The value of roleId as notEqual. */ @@ -320,7 +303,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param roleId The value of roleId as greaterThan. */ @@ -329,7 +312,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param roleId The value of roleId as lessThan. */ @@ -338,7 +321,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param roleId The value of roleId as greaterEqual. */ @@ -347,7 +330,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param roleId The value of roleId as lessEqual. */ @@ -356,7 +339,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param roleId The value of roleId as prefixSearch. */ @@ -365,20 +348,6 @@ } /** - * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, - * SeveralRegistered. - * - * @param roleId The value of roleId as likeSearch. - * @param likeSearchOption The option of like-search. (NotNull) - */ - public void setRoleId_LikeSearch( - String roleId, - jp.sf.pal.addresslist.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { - registerLikeSearchQuery(CK_LS, fRES(roleId), getCValueRoleId(), - "ROLE_ID", "RoleId", "roleId", likeSearchOption); - } - - /** * InScope(in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * @@ -389,42 +358,41 @@ } /** - * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * - * @param roleId The collection of roleId as inScope. - * @param inScopeOption The option of in-scope. (NotNull) + * @param roleIdList The collection of roleId as notInScope. */ - public void setRoleId_InScope( - String roleId, - jp.sf.pal.addresslist.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(roleId), getCValueRoleId(), - "ROLE_ID", "RoleId", "roleId", inScopeOption); + public void setRoleId_NotInScope(Collection roleIdList) { + regRoleId(CK_NINS, cTL(roleIdList)); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param roleIdList The collection of roleId as notInScope. + * @param roleId The value of roleId as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) */ - public void setRoleId_NotInScope(Collection roleIdList) { - regRoleId(CK_NINS, cTL(roleIdList)); + public void setRoleId_LikeSearch( + String roleId, + jp.sf.pal.addresslist.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(roleId), getCValueRoleId(), "ROLE_ID", "RoleId", + "roleId", likeSearchOption); } /** - * @param roleInfoCBquery Query. - * @deprecated Please use inScopeRoleInfo(subQuery) method. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param roleId The value of roleId as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setRoleId_InScopeSubQuery_RoleInfo(RoleInfoCQ roleInfoCBquery) { - String subQueryPropertyName = keepRoleId_InScopeSubQuery_RoleInfo(roleInfoCBquery);// for - // saving - // query - // - - // value - // . - registerInScopeSubQuery(roleInfoCBquery, "ROLE_ID", "ROLE_ID", - subQueryPropertyName); + public void setRoleId_NotLikeSearch( + String roleId, + jp.sf.pal.addresslist.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(roleId), getCValueRoleId(), "ROLE_ID", "RoleId", + "roleId", likeSearchOption); } public void inScopeRoleInfo(SubQuery subQuery) { @@ -433,12 +401,12 @@ cb.xsetupForInScopeSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepRoleId_InScopeSubQuery_RoleInfo(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerInScopeSubQuery(cb.query(), "ROLE_ID", "ROLE_ID", subQueryPropertyName); } - abstract public String keepRoleId_InScopeSubQuery_RoleInfo( + public abstract String keepRoleId_InScopeSubQuery_RoleInfo( jp.sf.pal.addresslist.db.cbean.cq.RoleInfoCQ subQuery); protected void regRoleId(ConditionKey key, Object value) { @@ -453,6 +421,50 @@ abstract protected ConditionValue getCValueRoleId(); + public SSQFunction scalar_Equal() { + return xcreateSSQFunction("="); + } + + public SSQFunction scalar_GreaterEqual() { + return xcreateSSQFunction(">="); + } + + public SSQFunction scalar_GreaterThan() { + return xcreateSSQFunction(">"); + } + + public SSQFunction scalar_LessEqual() { + return xcreateSSQFunction("<="); + } + + public SSQFunction scalar_LessThan() { + return xcreateSSQFunction("<"); + } + + protected SSQFunction xcreateSSQFunction(final String operand) { + return new SSQFunction(new SSQSetupper() { + public void setup(String function, SubQuery subQuery) { + xscalarSubQuery(function, subQuery, operand); + } + }); + } + + protected void xscalarSubQuery(String function, + SubQuery subQuery, String operand) { + assertObjectNotNull("subQuery", subQuery); + RoleMappingCB cb = new RoleMappingCB(); + cb.xsetupForScalarSubQuery(); + subQuery.query(cb); + String subQueryPropertyName = keepScalarSubQuery(cb.query()); // for + // saving + // query + // -value. + registerScalarSubQuery(function, cb.query(), subQueryPropertyName, + operand); + } + + public abstract String keepScalarSubQuery(RoleMappingCQ subQuery); + // Very Internal (for Suppressing Warn about 'Not Use Import') protected String getConditionBeanClassNameInternally() { return RoleMappingCB.class.getName(); Modified: addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/cbean/cq/bs/AbstractBsUserInfoCQ.java =================================================================== --- addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/cbean/cq/bs/AbstractBsUserInfoCQ.java 2008-12-27 22:02:56 UTC (rev 1623) +++ addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/cbean/cq/bs/AbstractBsUserInfoCQ.java 2008-12-27 22:06:42 UTC (rev 1624) @@ -16,10 +16,8 @@ import jp.sf.pal.addresslist.db.cbean.RoleMappingCB; import jp.sf.pal.addresslist.db.cbean.UserInfoCB; import jp.sf.pal.addresslist.db.cbean.cq.CompanyCQ; -import jp.sf.pal.addresslist.db.cbean.cq.GroupInfoCQ; import jp.sf.pal.addresslist.db.cbean.cq.GroupMappingCQ; import jp.sf.pal.addresslist.db.cbean.cq.PersonCQ; -import jp.sf.pal.addresslist.db.cbean.cq.RoleInfoCQ; import jp.sf.pal.addresslist.db.cbean.cq.RoleMappingCQ; import jp.sf.pal.addresslist.db.cbean.cq.UserInfoCQ; @@ -28,7 +26,6 @@ * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public abstract class AbstractBsUserInfoCQ extends AbstractConditionQuery { //========================================================================== @@ -58,7 +55,7 @@ // ===== /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {PK : NotNull : + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {PK : NotNull : * VARCHAR(255)} * * @param userId The value of userId as equal. @@ -68,7 +65,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param userId The value of userId as notEqual. */ @@ -77,7 +74,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param userId The value of userId as greaterThan. */ @@ -86,7 +83,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param userId The value of userId as lessThan. */ @@ -95,7 +92,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param userId The value of userId as greaterEqual. */ @@ -104,7 +101,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param userId The value of userId as lessEqual. */ @@ -113,7 +110,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param userId The value of userId as prefixSearch. */ @@ -122,20 +119,6 @@ } /** - * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, - * SeveralRegistered. - * - * @param userId The value of userId as likeSearch. - * @param likeSearchOption The option of like-search. (NotNull) - */ - public void setUserId_LikeSearch( - String userId, - jp.sf.pal.addresslist.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { - registerLikeSearchQuery(CK_LS, fRES(userId), getCValueUserId(), - "USER_ID", "UserId", "userId", likeSearchOption); - } - - /** * InScope(in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * @@ -146,42 +129,41 @@ } /** - * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * - * @param userId The collection of userId as inScope. - * @param inScopeOption The option of in-scope. (NotNull) + * @param userIdList The collection of userId as notInScope. */ - public void setUserId_InScope( - String userId, - jp.sf.pal.addresslist.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(userId), getCValueUserId(), - "USER_ID", "UserId", "userId", inScopeOption); + public void setUserId_NotInScope(Collection userIdList) { + regUserId(CK_NINS, cTL(userIdList)); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param userIdList The collection of userId as notInScope. + * @param userId The value of userId as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) */ - public void setUserId_NotInScope(Collection userIdList) { - regUserId(CK_NINS, cTL(userIdList)); + public void setUserId_LikeSearch( + String userId, + jp.sf.pal.addresslist.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(userId), getCValueUserId(), "USER_ID", "UserId", + "userId", likeSearchOption); } /** - * @param companyCBquery Query. - * @deprecated Please use inScopeCompanyList(subQuery) method. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param userId The value of userId as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setUserId_InScopeSubQuery_CompanyList(CompanyCQ companyCBquery) { - String subQueryPropertyName = keepUserId_InScopeSubQuery_CompanyList(companyCBquery);// for - // saving - // query - // - - // value - // . - registerInScopeSubQuery(companyCBquery, "USER_ID", "USER_ID", - subQueryPropertyName); + public void setUserId_NotLikeSearch( + String userId, + jp.sf.pal.addresslist.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(userId), getCValueUserId(), "USER_ID", "UserId", + "userId", likeSearchOption); } public void inScopeCompanyList(SubQuery subQuery) { @@ -190,101 +172,54 @@ cb.xsetupForInScopeSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepUserId_InScopeSubQuery_CompanyList(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerInScopeSubQuery(cb.query(), "USER_ID", "USER_ID", subQueryPropertyName); } - abstract public String keepUserId_InScopeSubQuery_CompanyList( + public abstract String keepUserId_InScopeSubQuery_CompanyList( CompanyCQ subQuery); - /** - * @param groupMappingCBquery Query. - * @deprecated Please use inScopeGroupMappingList(subQuery) method. - */ - public void setUserId_InScopeSubQuery_GroupMappingList( - GroupMappingCQ groupMappingCBquery) { - String subQueryPropertyName = keepUserId_InScopeSubQuery_GroupMappingList(groupMappingCBquery);// for - // saving - // query - // - - // value - // . - registerInScopeSubQuery(groupMappingCBquery, "USER_ID", "USER_ID", - subQueryPropertyName); - } - public void inScopeGroupMappingList(SubQuery subQuery) { assertObjectNotNull("subQuery", subQuery); GroupMappingCB cb = new GroupMappingCB(); cb.xsetupForInScopeSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepUserId_InScopeSubQuery_GroupMappingList(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerInScopeSubQuery(cb.query(), "USER_ID", "USER_ID", subQueryPropertyName); } - abstract public String keepUserId_InScopeSubQuery_GroupMappingList( + public abstract String keepUserId_InScopeSubQuery_GroupMappingList( GroupMappingCQ subQuery); - /** - * @param personCBquery Query. - * @deprecated Please use inScopePersonList(subQuery) method. - */ - public void setUserId_InScopeSubQuery_PersonList(PersonCQ personCBquery) { - String subQueryPropertyName = keepUserId_InScopeSubQuery_PersonList(personCBquery);// for - // saving - // query - // - - // value - // . - registerInScopeSubQuery(personCBquery, "USER_ID", "USER_ID", - subQueryPropertyName); - } - public void inScopePersonList(SubQuery subQuery) { assertObjectNotNull("subQuery", subQuery); PersonCB cb = new PersonCB(); cb.xsetupForInScopeSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepUserId_InScopeSubQuery_PersonList(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerInScopeSubQuery(cb.query(), "USER_ID", "USER_ID", subQueryPropertyName); } - abstract public String keepUserId_InScopeSubQuery_PersonList( + public abstract String keepUserId_InScopeSubQuery_PersonList( PersonCQ 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 subQuery) { assertObjectNotNull("subQuery", subQuery); RoleMappingCB cb = new RoleMappingCB(); cb.xsetupForInScopeSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepUserId_InScopeSubQuery_RoleMappingList(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerInScopeSubQuery(cb.query(), "USER_ID", "USER_ID", subQueryPropertyName); } - abstract public String keepUserId_InScopeSubQuery_RoleMappingList( + public abstract String keepUserId_InScopeSubQuery_RoleMappingList( RoleMappingCQ subQuery); public void notInScopeCompanyList(SubQuery subQuery) { @@ -293,12 +228,12 @@ cb.xsetupForInScopeSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepUserId_NotInScopeSubQuery_CompanyList(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerNotInScopeSubQuery(cb.query(), "USER_ID", "USER_ID", subQueryPropertyName); } - abstract public String keepUserId_NotInScopeSubQuery_CompanyList( + public abstract String keepUserId_NotInScopeSubQuery_CompanyList( CompanyCQ subQuery); public void notInScopeGroupMappingList(SubQuery subQuery) { @@ -307,12 +242,12 @@ cb.xsetupForInScopeSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepUserId_NotInScopeSubQuery_GroupMappingList(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerNotInScopeSubQuery(cb.query(), "USER_ID", "USER_ID", subQueryPropertyName); } - abstract public String keepUserId_NotInScopeSubQuery_GroupMappingList( + public abstract String keepUserId_NotInScopeSubQuery_GroupMappingList( GroupMappingCQ subQuery); public void notInScopePersonList(SubQuery subQuery) { @@ -321,12 +256,12 @@ cb.xsetupForInScopeSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepUserId_NotInScopeSubQuery_PersonList(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerNotInScopeSubQuery(cb.query(), "USER_ID", "USER_ID", subQueryPropertyName); } - abstract public String keepUserId_NotInScopeSubQuery_PersonList( + public abstract String keepUserId_NotInScopeSubQuery_PersonList( PersonCQ subQuery); public void notInScopeRoleMappingList(SubQuery subQuery) { @@ -335,30 +270,15 @@ cb.xsetupForInScopeSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepUserId_NotInScopeSubQuery_RoleMappingList(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerNotInScopeSubQuery(cb.query(), "USER_ID", "USER_ID", subQueryPropertyName); } - abstract public String keepUserId_NotInScopeSubQuery_RoleMappingList( + public abstract String keepUserId_NotInScopeSubQuery_RoleMappingList( RoleMappingCQ subQuery); /** - * @param companyCBquery Query. - * @deprecated Please use existsCompanyList(subQuery) method. - */ - public void setUserId_ExistsSubQuery_CompanyList(CompanyCQ companyCBquery) { - String subQueryPropertyName = keepUserId_ExistsSubQuery_CompanyList(companyCBquery);// for - // saving - // query - // - - // value - // . - registerExistsSubQuery(companyCBquery, "USER_ID", "USER_ID", - subQueryPropertyName); - } - - /** * Set up 'exists' sub-query. {exists (select USER_ID from COMPANY where * ...)} * @@ -371,31 +291,15 @@ cb.xsetupForExistsSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepUserId_ExistsSubQuery_CompanyList(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerExistsSubQuery(cb.query(), "USER_ID", "USER_ID", subQueryPropertyName); } - abstract public String keepUserId_ExistsSubQuery_CompanyList( + public abstract String keepUserId_ExistsSubQuery_CompanyList( CompanyCQ 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 ...)} * @@ -408,30 +312,15 @@ cb.xsetupForExistsSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepUserId_ExistsSubQuery_GroupMappingList(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerExistsSubQuery(cb.query(), "USER_ID", "USER_ID", subQueryPropertyName); } - abstract public String keepUserId_ExistsSubQuery_GroupMappingList( + public abstract String keepUserId_ExistsSubQuery_GroupMappingList( GroupMappingCQ subQuery); /** - * @param personCBquery Query. - * @deprecated Please use existsPersonList(subQuery) method. - */ - public void setUserId_ExistsSubQuery_PersonList(PersonCQ personCBquery) { - String subQueryPropertyName = keepUserId_ExistsSubQuery_PersonList(personCBquery);// for - // saving - // query - // - - // value - // . - registerExistsSubQuery(personCBquery, "USER_ID", "USER_ID", - subQueryPropertyName); - } - - /** * Set up 'exists' sub-query. {exists (select USER_ID from PERSON where * ...)} * @@ -444,31 +333,15 @@ cb.xsetupForExistsSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepUserId_ExistsSubQuery_PersonList(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerExistsSubQuery(cb.query(), "USER_ID", "USER_ID", subQueryPropertyName); } - abstract public String keepUserId_ExistsSubQuery_PersonList( + public abstract String keepUserId_ExistsSubQuery_PersonList( PersonCQ 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 ...)} * @@ -481,12 +354,12 @@ cb.xsetupForExistsSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepUserId_ExistsSubQuery_RoleMappingList(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerExistsSubQuery(cb.query(), "USER_ID", "USER_ID", subQueryPropertyName); } - abstract public String keepUserId_ExistsSubQuery_RoleMappingList( + public abstract String keepUserId_ExistsSubQuery_RoleMappingList( RoleMappingCQ subQuery); /** @@ -502,12 +375,12 @@ cb.xsetupForExistsSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepUserId_NotExistsSubQuery_CompanyList(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerNotExistsSubQuery(cb.query(), "USER_ID", "USER_ID", subQueryPropertyName); } - abstract public String keepUserId_NotExistsSubQuery_CompanyList( + public abstract String keepUserId_NotExistsSubQuery_CompanyList( CompanyCQ subQuery); /** @@ -524,12 +397,12 @@ cb.xsetupForExistsSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepUserId_NotExistsSubQuery_GroupMappingList(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerNotExistsSubQuery(cb.query(), "USER_ID", "USER_ID", subQueryPropertyName); } - abstract public String keepUserId_NotExistsSubQuery_GroupMappingList( + public abstract String keepUserId_NotExistsSubQuery_GroupMappingList( GroupMappingCQ subQuery); /** @@ -545,12 +418,12 @@ cb.xsetupForExistsSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepUserId_NotExistsSubQuery_PersonList(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerNotExistsSubQuery(cb.query(), "USER_ID", "USER_ID", subQueryPropertyName); } - abstract public String keepUserId_NotExistsSubQuery_PersonList( + public abstract String keepUserId_NotExistsSubQuery_PersonList( PersonCQ subQuery); /** @@ -566,83 +439,83 @@ cb.xsetupForExistsSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepUserId_NotExistsSubQuery_RoleMappingList(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerNotExistsSubQuery(cb.query(), "USER_ID", "USER_ID", subQueryPropertyName); } - abstract public String keepUserId_NotExistsSubQuery_RoleMappingList( + public abstract String keepUserId_NotExistsSubQuery_RoleMappingList( RoleMappingCQ subQuery); public void xderiveCompanyList(String function, SubQuery subQuery, String aliasName) { assertObjectNotNull("subQuery", subQuery); CompanyCB cb = new CompanyCB(); - cb.xsetupForDeriveReferrer(); + cb.xsetupForDerivedReferrer(); subQuery.query(cb); - String subQueryPropertyName = keepUserId_DeriveSubQuery_CompanyList(cb - .query());// for saving query-value. - registerDeriveSubQuery(function, cb.query(), "USER_ID", "USER_ID", - subQueryPropertyName, aliasName); + String subQueryPropertyName = keepUserId_DerivedReferrer_CompanyList(cb + .query()); // for saving query-value. + registerDerivedReferrerSubQuery(function, cb.query(), "USER_ID", + "USER_ID", subQueryPropertyName, aliasName); } - abstract public String keepUserId_DeriveSubQuery_CompanyList( + public abstract String keepUserId_DerivedReferrer_CompanyList( CompanyCQ subQuery); public void xderiveGroupMappingList(String function, SubQuery subQuery, String aliasName) { assertObjectNotNull("subQuery", subQuery); GroupMappingCB cb = new GroupMappingCB(); - cb.xsetupForDeriveReferrer(); + cb.xsetupForDerivedReferrer(); subQuery.query(cb); - String subQueryPropertyName = keepUserId_DeriveSubQuery_GroupMappingList(cb - .query());// for saving query-value. - registerDeriveSubQuery(function, cb.query(), "USER_ID", "USER_ID", - subQueryPropertyName, aliasName); + String subQueryPropertyName = keepUserId_DerivedReferrer_GroupMappingList(cb + .query()); // for saving query-value. + registerDerivedReferrerSubQuery(function, cb.query(), "USER_ID", + "USER_ID", subQueryPropertyName, aliasName); } - abstract public String keepUserId_DeriveSubQuery_GroupMappingList( + public abstract String keepUserId_DerivedReferrer_GroupMappingList( GroupMappingCQ subQuery); public void xderivePersonList(String function, SubQuery subQuery, String aliasName) { assertObjectNotNull("subQuery", subQuery); PersonCB cb = new PersonCB(); - cb.xsetupForDeriveReferrer(); + cb.xsetupForDerivedReferrer(); subQuery.query(cb); - String subQueryPropertyName = keepUserId_DeriveSubQuery_PersonList(cb - .query());// for saving query-value. - registerDeriveSubQuery(function, cb.query(), "USER_ID", "USER_ID", - subQueryPropertyName, aliasName); + String subQueryPropertyName = keepUserId_DerivedReferrer_PersonList(cb + .query()); // for saving query-value. + registerDerivedReferrerSubQuery(function, cb.query(), "USER_ID", + "USER_ID", subQueryPropertyName, aliasName); } - abstract public String keepUserId_DeriveSubQuery_PersonList( + public abstract String keepUserId_DerivedReferrer_PersonList( PersonCQ subQuery); public void xderiveRoleMappingList(String function, SubQuery subQuery, String aliasName) { assertObjectNotNull("subQuery", subQuery); RoleMappingCB cb = new RoleMappingCB(); - cb.xsetupForDeriveReferrer(); + cb.xsetupForDerivedReferrer(); subQuery.query(cb); - String subQueryPropertyName = keepUserId_DeriveSubQuery_RoleMappingList(cb - .query());// for saving query-value. - registerDeriveSubQuery(function, cb.query(), "USER_ID", "USER_ID", - subQueryPropertyName, aliasName); + String subQueryPropertyName = keepUserId_DerivedReferrer_RoleMappingList(cb + .query()); // for saving query-value. + registerDerivedReferrerSubQuery(function, cb.query(), "USER_ID", + "USER_ID", subQueryPropertyName, aliasName); } - abstract public String keepUserId_DeriveSubQuery_RoleMappingList( + public abstract String keepUserId_DerivedReferrer_RoleMappingList( RoleMappingCQ subQuery); /** - * IsNull(is null). And OnceRegistered. + * IsNull(is null). And OnlyOnceRegistered. */ public void setUserId_IsNull() { regUserId(CK_ISN, DUMMY_OBJECT); } /** - * IsNotNull(is not null). And OnceRegistered. + * IsNotNull(is not null). And OnlyOnceRegistered. */ public void setUserId_IsNotNull() { regUserId(CK_ISNN, DUMMY_OBJECT); @@ -661,7 +534,7 @@ abstract protected ConditionValue getCValueUserId(); /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {VARCHAR(100)} + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {VARCHAR(100)} * * @param givenName The value of givenName as equal. */ @@ -670,7 +543,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param givenName The value of givenName as notEqual. */ @@ -679,7 +552,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param givenName The value of givenName as greaterThan. */ @@ -688,7 +561,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param givenName The value of givenName as lessThan. */ @@ -697,7 +570,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param givenName The value of givenName as greaterEqual. */ @@ -706,7 +579,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param givenName The value of givenName as lessEqual. */ @@ -715,7 +588,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param givenName The value of givenName as prefixSearch. */ @@ -724,20 +597,6 @@ } /** - * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, - * SeveralRegistered. - * - * @param givenName The value of givenName as likeSearch. - * @param likeSearchOption The option of like-search. (NotNull) - */ - public void setGivenName_LikeSearch( - String givenName, - jp.sf.pal.addresslist.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. * @@ -748,38 +607,52 @@ } /** - * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * - * @param givenName The collection of givenName as inScope. - * @param inScopeOption The option of in-scope. (NotNull) + * @param givenNameList The collection of givenName as notInScope. */ - public void setGivenName_InScope( + public void setGivenName_NotInScope(Collection givenNameList) { + regGivenName(CK_NINS, cTL(givenNameList)); + } + + /** + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param givenName The value of givenName as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) + */ + public void setGivenName_LikeSearch( String givenName, - jp.sf.pal.addresslist.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(givenName), getCValueGivenName(), - "GIVEN_NAME", "GivenName", "givenName", inScopeOption); + jp.sf.pal.addresslist.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(givenName), getCValueGivenName(), "GIVEN_NAME", + "GivenName", "givenName", likeSearchOption); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param givenNameList The collection of givenName as notInScope. + * @param givenName The value of givenName as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setGivenName_NotInScope(Collection givenNameList) { - regGivenName(CK_NINS, cTL(givenNameList)); + public void setGivenName_NotLikeSearch( + String givenName, + jp.sf.pal.addresslist.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(givenName), getCValueGivenName(), "GIVEN_NAME", + "GivenName", "givenName", likeSearchOption); } /** - * IsNull(is null). And OnceRegistered. + * IsNull(is null). And OnlyOnceRegistered. */ public void setGivenName_IsNull() { regGivenName(CK_ISN, DUMMY_OBJECT); } /** - * IsNotNull(is not null). And OnceRegistered. + * IsNotNull(is not null). And OnlyOnceRegistered. */ public void setGivenName_IsNotNull() { regGivenName(CK_ISNN, DUMMY_OBJECT); @@ -798,7 +671,7 @@ abstract protected ConditionValue getCValueGivenName(); /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {VARCHAR(100)} + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {VARCHAR(100)} * * @param familyName The value of familyName as equal. */ @@ -807,7 +680,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param familyName The value of familyName as notEqual. */ @@ -816,7 +689,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param familyName The value of familyName as greaterThan. */ @@ -825,7 +698,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param familyName The value of familyName as lessThan. */ @@ -834,7 +707,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param familyName The value of familyName as greaterEqual. */ @@ -843,7 +716,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param familyName The value of familyName as lessEqual. */ @@ -852,7 +725,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param familyName The value of familyName as prefixSearch. */ @@ -861,20 +734,6 @@ } /** - * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, - * SeveralRegistered. - * - * @param familyName The value of familyName as likeSearch. - * @param likeSearchOption The option of like-search. (NotNull) - */ - public void setFamilyName_LikeSearch( - String familyName, - jp.sf.pal.addresslist.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. * @@ -885,38 +744,52 @@ } /** - * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * - * @param familyName The collection of familyName as inScope. - * @param inScopeOption The option of in-scope. (NotNull) + * @param familyNameList The collection of familyName as notInScope. */ - public void setFamilyName_InScope( + public void setFamilyName_NotInScope(Collection familyNameList) { + regFamilyName(CK_NINS, cTL(familyNameList)); + } + + /** + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param familyName The value of familyName as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) + */ + public void setFamilyName_LikeSearch( String familyName, - jp.sf.pal.addresslist.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(familyName), getCValueFamilyName(), - "FAMILY_NAME", "FamilyName", "familyName", inScopeOption); + jp.sf.pal.addresslist.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(familyName), getCValueFamilyName(), "FAMILY_NAME", + "FamilyName", "familyName", likeSearchOption); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param familyNameList The collection of familyName as notInScope. + * @param familyName The value of familyName as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setFamilyName_NotInScope(Collection familyNameList) { - regFamilyName(CK_NINS, cTL(familyNameList)); + public void setFamilyName_NotLikeSearch( + String familyName, + jp.sf.pal.addresslist.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(familyName), getCValueFamilyName(), "FAMILY_NAME", + "FamilyName", "familyName", likeSearchOption); } /** - * IsNull(is null). And OnceRegistered. + * IsNull(is null). And OnlyOnceRegistered. */ public void setFamilyName_IsNull() { regFamilyName(CK_ISN, DUMMY_OBJECT); } /** - * IsNotNull(is not null). And OnceRegistered. + * IsNotNull(is not null). And OnlyOnceRegistered. */ public void setFamilyName_IsNotNull() { regFamilyName(CK_ISNN, DUMMY_OBJECT); @@ -935,7 +808,7 @@ abstract protected ConditionValue getCValueFamilyName(); /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {VARCHAR(50)} + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {VARCHAR(50)} * * @param middleName The value of middleName as equal. */ @@ -944,7 +817,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param middleName The value of middleName as notEqual. */ @@ -953,7 +826,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param middleName The value of middleName as greaterThan. */ @@ -962,7 +835,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param middleName The value of middleName as lessThan. */ @@ -971,7 +844,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param middleName The value of middleName as greaterEqual. */ @@ -980,7 +853,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param middleName The value of middleName as lessEqual. */ @@ -989,7 +862,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param middleName The value of middleName as prefixSearch. */ @@ -998,20 +871,6 @@ } /** - * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, - * SeveralRegistered. - * - * @param middleName The value of middleName as likeSearch. - * @param likeSearchOption The option of like-search. (NotNull) - */ - public void setMiddleName_LikeSearch( - String middleName, - jp.sf.pal.addresslist.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. * @@ -1022,38 +881,52 @@ } /** - * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * - * @param middleName The collection of middleName as inScope. - * @param inScopeOption The option of in-scope. (NotNull) + * @param middleNameList The collection of middleName as notInScope. */ - public void setMiddleName_InScope( + public void setMiddleName_NotInScope(Collection middleNameList) { + regMiddleName(CK_NINS, cTL(middleNameList)); + } + + /** + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param middleName The value of middleName as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) + */ + public void setMiddleName_LikeSearch( String middleName, - jp.sf.pal.addresslist.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(middleName), getCValueMiddleName(), - "MIDDLE_NAME", "MiddleName", "middleName", inScopeOption); + jp.sf.pal.addresslist.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(middleName), getCValueMiddleName(), "MIDDLE_NAME", + "MiddleName", "middleName", likeSearchOption); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param middleNameList The collection of middleName as notInScope. + * @param middleName The value of middleName as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setMiddleName_NotInScope(Collection middleNameList) { - regMiddleName(CK_NINS, cTL(middleNameList)); + public void setMiddleName_NotLikeSearch( + String middleName, + jp.sf.pal.addresslist.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(middleName), getCValueMiddleName(), "MIDDLE_NAME", + "MiddleName", "middleName", likeSearchOption); } /** - * IsNull(is null). And OnceRegistered. + * IsNull(is null). And OnlyOnceRegistered. */ public void setMiddleName_IsNull() { regMiddleName(CK_ISN, DUMMY_OBJECT); } /** - * IsNotNull(is not null). And OnceRegistered. + * IsNotNull(is not null). And OnlyOnceRegistered. */ public void setMiddleName_IsNotNull() { regMiddleName(CK_ISNN, DUMMY_OBJECT); @@ -1072,7 +945,7 @@ abstract protected ConditionValue getCValueMiddleName(); /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {VARCHAR(100)} + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {VARCHAR(100)} * * @param givenNameDesc The value of givenNameDesc as equal. */ @@ -1081,7 +954,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param givenNameDesc The value of givenNameDesc as notEqual. */ @@ -1090,7 +963,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param givenNameDesc The value of givenNameDesc as greaterThan. */ @@ -1099,7 +972,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param givenNameDesc The value of givenNameDesc as lessThan. */ @@ -1108,7 +981,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param givenNameDesc The value of givenNameDesc as greaterEqual. */ @@ -1117,7 +990,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param givenNameDesc The value of givenNameDesc as lessEqual. */ @@ -1126,7 +999,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param givenNameDesc The value of givenNameDesc as prefixSearch. */ @@ -1135,21 +1008,6 @@ } /** - * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, - * SeveralRegistered. - * - * @param givenNameDesc The value of givenNameDesc as likeSearch. - * @param likeSearchOption The option of like-search. (NotNull) - */ - public void setGivenNameDesc_LikeSearch( - String givenNameDesc, - jp.sf.pal.addresslist.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. * @@ -1160,39 +1018,54 @@ } /** - * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * - * @param givenNameDesc The collection of givenNameDesc as inScope. - * @param inScopeOption The option of in-scope. (NotNull) + * @param givenNameDescList The collection of givenNameDesc as notInScope. */ - public void setGivenNameDesc_InScope( + public void setGivenNameDesc_NotInScope(Collection givenNameDescList) { + regGivenNameDesc(CK_NINS, cTL(givenNameDescList)); + } + + /** + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param givenNameDesc The value of givenNameDesc as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) + */ + public void setGivenNameDesc_LikeSearch( String givenNameDesc, - jp.sf.pal.addresslist.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(givenNameDesc), - getCValueGivenNameDesc(), "GIVEN_NAME_DESC", "GivenNameDesc", - "givenNameDesc", inScopeOption); + jp.sf.pal.addresslist.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(givenNameDesc), getCValueGivenNameDesc(), + "GIVEN_NAME_DESC", "GivenNameDesc", "givenNameDesc", + likeSearchOption); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param givenNameDescList The collection of givenNameDesc as notInScope. + * @param givenNameDesc The value of givenNameDesc as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setGivenNameDesc_NotInScope(Collection givenNameDescList) { - regGivenNameDesc(CK_NINS, cTL(givenNameDescList)); + public void setGivenNameDesc_NotLikeSearch( + String givenNameDesc, + jp.sf.pal.addresslist.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(givenNameDesc), getCValueGivenNameDesc(), + "GIVEN_NAME_DESC", "GivenNameDesc", "givenNameDesc", + likeSearchOption); } /** - * IsNull(is null). And OnceRegistered. + * IsNull(is null). And OnlyOnceRegistered. */ public void setGivenNameDesc_IsNull() { regGivenNameDesc(CK_ISN, DUMMY_OBJECT); } /** - * IsNotNull(is not null). And OnceRegistered. + * IsNotNull(is not null). And OnlyOnceRegistered. */ public void setGivenNameDesc_IsNotNull() { regGivenNameDesc(CK_ISNN, DUMMY_OBJECT); @@ -1211,7 +1084,7 @@ abstract protected ConditionValue getCValueGivenNameDesc(); /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {VARCHAR(100)} + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {VARCHAR(100)} * * @param familyNameDesc The value of familyNameDesc as equal. */ @@ -1220,7 +1093,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param familyNameDesc The value of familyNameDesc as notEqual. */ @@ -1229,7 +1102,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param familyNameDesc The value of familyNameDesc as greaterThan. */ @@ -1238,7 +1111,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param familyNameDesc The value of familyNameDesc as lessThan. */ @@ -1247,7 +1120,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param familyNameDesc The value of familyNameDesc as greaterEqual. */ @@ -1256,7 +1129,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param familyNameDesc The value of familyNameDesc as lessEqual. */ @@ -1265,7 +1138,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param familyNameDesc The value of familyNameDesc as prefixSearch. */ @@ -1274,21 +1147,6 @@ } /** - * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, - * SeveralRegistered. - * - * @param familyNameDesc The value of familyNameDesc as likeSearch. - * @param likeSearchOption The option of like-search. (NotNull) - */ - public void setFamilyNameDesc_LikeSearch( - String familyNameDesc, - jp.sf.pal.addresslist.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. * @@ -1299,40 +1157,55 @@ } /** - * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * - * @param familyNameDesc The collection of familyNameDesc as inScope. - * @param inScopeOption The option of in-scope. (NotNull) + * @param familyNameDescList The collection of familyNameDesc as notInScope. */ - public void setFamilyNameDesc_InScope( + public void setFamilyNameDesc_NotInScope( + Collection familyNameDescList) { + regFamilyNameDesc(CK_NINS, cTL(familyNameDescList)); + } + + /** + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param familyNameDesc The value of familyNameDesc as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) + */ + public void setFamilyNameDesc_LikeSearch( String familyNameDesc, - jp.sf.pal.addresslist.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(familyNameDesc), - getCValueFamilyNameDesc(), "FAMILY_NAME_DESC", - "FamilyNameDesc", "familyNameDesc", inScopeOption); + jp.sf.pal.addresslist.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(familyNameDesc), getCValueFamilyNameDesc(), + "FAMILY_NAME_DESC", "FamilyNameDesc", "familyNameDesc", + likeSearchOption); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param familyNameDescList The collection of familyNameDesc as notInScope. + * @param familyNameDesc The value of familyNameDesc as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setFamilyNameDesc_NotInScope( - Collection familyNameDescList) { - regFamilyNameDesc(CK_NINS, cTL(familyNameDescList)); + public void setFamilyNameDesc_NotLikeSearch( + String familyNameDesc, + jp.sf.pal.addresslist.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(familyNameDesc), getCValueFamilyNameDesc(), + "FAMILY_NAME_DESC", "FamilyNameDesc", "familyNameDesc", + likeSearchOption); } /** - * IsNull(is null). And OnceRegistered. + * IsNull(is null). And OnlyOnceRegistered. */ public void setFamilyNameDesc_IsNull() { regFamilyNameDesc(CK_ISN, DUMMY_OBJECT); } /** - * IsNotNull(is not null). And OnceRegistered. + * IsNotNull(is not null). And OnlyOnceRegistered. */ public void setFamilyNameDesc_IsNotNull() { regFamilyNameDesc(CK_ISNN, DUMMY_OBJECT); @@ -1351,7 +1224,7 @@ abstract protected ConditionValue getCValueFamilyNameDesc(); /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {VARCHAR(100)} + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {VARCHAR(100)} * * @param nickname The value of nickname as equal. */ @@ -1360,7 +1233,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param nickname The value of nickname as notEqual. */ @@ -1369,7 +1242,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param nickname The value of nickname as greaterThan. */ @@ -1378,7 +1251,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param nickname The value of nickname as lessThan. */ @@ -1387,7 +1260,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param nickname The value of nickname as greaterEqual. */ @@ -1396,7 +1269,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param nickname The value of nickname as lessEqual. */ @@ -1405,7 +1278,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param nickname The value of nickname as prefixSearch. */ @@ -1414,20 +1287,6 @@ } /** - * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, - * SeveralRegistered. - * - * @param nickname The value of nickname as likeSearch. - * @param likeSearchOption The option of like-search. (NotNull) - */ - public void setNickname_LikeSearch( - String nickname, - jp.sf.pal.addresslist.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { - registerLikeSearchQuery(CK_LS, fRES(nickname), getCValueNickname(), - "NICKNAME", "Nickname", "nickname", likeSearchOption); - } - - /** * InScope(in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * @@ -1438,38 +1297,52 @@ } /** - * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * - * @param nickname The collection of nickname as inScope. - * @param inScopeOption The option of in-scope. (NotNull) + * @param nicknameList The collection of nickname as notInScope. */ - public void setNickname_InScope( + public void setNickname_NotInScope(Collection nicknameList) { + regNickname(CK_NINS, cTL(nicknameList)); + } + + /** + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param nickname The value of nickname as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) + */ + public void setNickname_LikeSearch( String nickname, - jp.sf.pal.addresslist.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(nickname), getCValueNickname(), - "NICKNAME", "Nickname", "nickname", inScopeOption); + jp.sf.pal.addresslist.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(nickname), getCValueNickname(), "NICKNAME", + "Nickname", "nickname", likeSearchOption); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param nicknameList The collection of nickname as notInScope. + * @param nickname The value of nickname as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setNickname_NotInScope(Collection nicknameList) { - regNickname(CK_NINS, cTL(nicknameList)); + public void setNickname_NotLikeSearch( + String nickname, + jp.sf.pal.addresslist.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(nickname), getCValueNickname(), "NICKNAME", + "Nickname", "nickname", likeSearchOption); } /** - * IsNull(is null). And OnceRegistered. + * IsNull(is null). And OnlyOnceRegistered. */ public void setNickname_IsNull() { regNickname(CK_ISN, DUMMY_OBJECT); } /** - * IsNotNull(is not null). And OnceRegistered. + * IsNotNull(is not null). And OnlyOnceRegistered. */ public void setNickname_IsNotNull() { regNickname(CK_ISNN, DUMMY_OBJECT); @@ -1488,7 +1361,7 @@ abstract protected ConditionValue getCValueNickname(); /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {VARCHAR(1)} + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {VARCHAR(1)} * * @param gender The value of gender as equal. */ @@ -1497,7 +1370,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param gender The value of gender as notEqual. */ @@ -1506,7 +1379,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param gender The value of gender as greaterThan. */ @@ -1515,7 +1388,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param gender The value of gender as lessThan. */ @@ -1524,7 +1397,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param gender The value of gender as greaterEqual. */ @@ -1533,7 +1406,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param gender The value of gender as lessEqual. */ @@ -1542,7 +1415,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param gender The value of gender as prefixSearch. */ @@ -1551,20 +1424,6 @@ } /** - * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, - * SeveralRegistered. - * - * @param gender The value of gender as likeSearch. - * @param likeSearchOption The option of like-search. (NotNull) - */ - public void setGender_LikeSearch( - String gender, - jp.sf.pal.addresslist.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { - registerLikeSearchQuery(CK_LS, fRES(gender), getCValueGender(), - "GENDER", "Gender", "gender", likeSearchOption); - } - - /** * InScope(in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * @@ -1575,38 +1434,52 @@ } /** - * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * - * @param gender The collection of gender as inScope. - * @param inScopeOption The option of in-scope. (NotNull) + * @param genderList The collection of gender as notInScope. */ - public void setGender_InScope( + public void setGender_NotInScope(Collection genderList) { + regGender(CK_NINS, cTL(genderList)); + } + + /** + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param gender The value of gender as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) + */ + public void setGender_LikeSearch( String gender, - jp.sf.pal.addresslist.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(gender), getCValueGender(), "GENDER", - "Gender", "gender", inScopeOption); + jp.sf.pal.addresslist.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(gender), getCValueGender(), "GENDER", "Gender", + "gender", likeSearchOption); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param genderList The collection of gender as notInScope. + * @param gender The value of gender as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setGender_NotInScope(Collection genderList) { - regGender(CK_NINS, cTL(genderList)); + public void setGender_NotLikeSearch( + String gender, + jp.sf.pal.addresslist.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(gender), getCValueGender(), "GENDER", "Gender", + "gender", likeSearchOption); } /** - * IsNull(is null). And OnceRegistered. + * IsNull(is null). And OnlyOnceRegistered. */ public void setGender_IsNull() { regGender(CK_ISN, DUMMY_OBJECT); } /** - * IsNotNull(is not null). And OnceRegistered. + * IsNotNull(is not null). And OnlyOnceRegistered. */ public void setGender_IsNotNull() { regGender(CK_ISNN, DUMMY_OBJECT); @@ -1625,7 +1498,7 @@ abstract protected ConditionValue getCValueGender(); /** - * Equal(=). And NullIgnored, OnceRegistered. {DATE} + * Equal(=). And NullIgnored, OnlyOnceRegistered. {DATE} * * @param birthDate The value of birthDate as equal. */ @@ -1634,7 +1507,7 @@ } /** - * NotEqual(!=). And NullIgnored, OnceRegistered. + * NotEqual(!=). And NullIgnored, OnlyOnceRegistered. * * @param birthDate The value of birthDate as notEqual. */ @@ -1643,7 +1516,7 @@ } /** - * GreaterThan(>). And NullIgnored, OnceRegistered. + * GreaterThan(>). And NullIgnored, OnlyOnceRegistered. * * @param birthDate The value of birthDate as greaterThan. */ @@ -1652,7 +1525,7 @@ } /** - * LessThan(>). And NullIgnored, OnceRegistered. + * LessThan(>). And NullIgnored, OnlyOnceRegistered. * * @param birthDate The value of birthDate as lessThan. */ @@ -1661,7 +1534,7 @@ } /** - * GreaterEqual(>). And NullIgnored, OnceRegistered. + * GreaterEqual(>). And NullIgnored, OnlyOnceRegistered. * * @param birthDate The value of birthDate as greaterEqual. */ @@ -1670,7 +1543,7 @@ } /** - * LessEqual(>). And NullIgnored, OnceRegistered. + * LessEqual(>). And NullIgnored, OnlyOnceRegistered. * * @param birthDate The value of birthDate as lessEqual. */ @@ -1680,7 +1553,7 @@ /** * FromTo($fromDate <= COLUMN_NAME <= $toDate). And NullIgnored, - * OnceRegistered. {DATE} + * OnlyOnceRegistered. {DATE} * * @param fromDate The from-date of birthDate. (Nullable) * @param toDate The to-date of birthDate. (Nullable) @@ -1696,7 +1569,7 @@ /** * FromTo($fromDate <= COLUMN_NAME < $toDate + 1). And NullIgnored, - * OnceRegistered. {DATE} + * OnlyOnceRegistered. {DATE} * * @param fromDate The from-date of birthDate. (Nullable) * @param toDate The to-date of birthDate. (Nullable) @@ -1710,14 +1583,14 @@ } /** - * IsNull(is null). And OnceRegistered. + * IsNull(is null). And OnlyOnceRegistered. */ public void setBirthDate_IsNull() { regBirthDate(CK_ISN, DUMMY_OBJECT); } /** - * IsNotNull(is not null). And OnceRegistered. + * IsNotNull(is not null). And OnlyOnceRegistered. */ public void setBirthDate_IsNotNull() { regBirthDate(CK_ISNN, DUMMY_OBJECT); @@ -1736,7 +1609,7 @@ abstract protected ConditionValue getCValueBirthDate(); /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {VARCHAR(255)} + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {VARCHAR(255)} * * @param email The value of email as equal. */ @@ -1745,7 +1618,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param email The value of email as notEqual. */ @@ -1754,7 +1627,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param email The value of email as greaterThan. */ @@ -1763,7 +1636,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param email The value of email as lessThan. */ @@ -1772,7 +1645,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param email The value of email as greaterEqual. */ @@ -1781,7 +1654,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param email The value of email as lessEqual. */ @@ -1790,7 +1663,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param email The value of email as prefixSearch. */ @@ -1799,20 +1672,6 @@ } /** - * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, - * SeveralRegistered. - * - * @param email The value of email as likeSearch. - * @param likeSearchOption The option of like-search. (NotNull) - */ - public void setEmail_LikeSearch( - String email, - jp.sf.pal.addresslist.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { - registerLikeSearchQuery(CK_LS, fRES(email), getCValueEmail(), "EMAIL", - "Email", "email", likeSearchOption); - } - - /** * InScope(in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * @@ -1823,38 +1682,52 @@ } /** - * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * - * @param email The collection of email as inScope. - * @param inScopeOption The option of in-scope. (NotNull) + * @param emailList The collection of email as notInScope. */ - public void setEmail_InScope( + public void setEmail_NotInScope(Collection emailList) { + regEmail(CK_NINS, cTL(emailList)); + } + + /** + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param email The value of email as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) + */ + public void setEmail_LikeSearch( String email, - jp.sf.pal.addresslist.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(email), getCValueEmail(), "EMAIL", - "Email", "email", inScopeOption); + jp.sf.pal.addresslist.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(email), getCValueEmail(), "EMAIL", "Email", "email", + likeSearchOption); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param emailList The collection of email as notInScope. + * @param email The value of email as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setEmail_NotInScope(Collection emailList) { - regEmail(CK_NINS, cTL(emailList)); + public void setEmail_NotLikeSearch( + String email, + jp.sf.pal.addresslist.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(email), getCValueEmail(), "EMAIL", "Email", + "email", likeSearchOption); } /** - * IsNull(is null). And OnceRegistered. + * IsNull(is null). And OnlyOnceRegistered. */ public void setEmail_IsNull() { regEmail(CK_ISN, DUMMY_OBJECT); } /** - * IsNotNull(is not null). And OnceRegistered. + * IsNotNull(is not null). And OnlyOnceRegistered. */ public void setEmail_IsNotNull() { regEmail(CK_ISNN, DUMMY_OBJECT); @@ -1872,7 +1745,7 @@ abstract protected ConditionValue getCValueEmail(); /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {VARCHAR(255)} + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {VARCHAR(255)} * * @param url The value of url as equal. */ @@ -1881,7 +1754,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param url The value of url as notEqual. */ @@ -1890,7 +1763,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param url The value of url as greaterThan. */ @@ -1899,7 +1772,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param url The value of url as lessThan. */ @@ -1908,7 +1781,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param url The value of url as greaterEqual. */ @@ -1917,7 +1790,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param url The value of url as lessEqual. */ @@ -1926,7 +1799,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param url The value of url as prefixSearch. */ @@ -1935,20 +1808,6 @@ } /** - * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, - * SeveralRegistered. - * - * @param url The value of url as likeSearch. - * @param likeSearchOption The option of like-search. (NotNull) - */ - public void setUrl_LikeSearch( - String url, - jp.sf.pal.addresslist.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { - registerLikeSearchQuery(CK_LS, fRES(url), getCValueUrl(), "URL", "Url", - "url", likeSearchOption); - } - - /** * InScope(in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * @@ -1959,38 +1818,52 @@ } /** - * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * - * @param url The collection of url as inScope. - * @param inScopeOption The option of in-scope. (NotNull) + * @param urlList The collection of url as notInScope. */ - public void setUrl_InScope( + public void setUrl_NotInScope(Collection urlList) { + regUrl(CK_NINS, cTL(urlList)); + } + + /** + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param url The value of url as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) + */ + public void setUrl_LikeSearch( String url, - jp.sf.pal.addresslist.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(url), getCValueUrl(), "URL", "Url", - "url", inScopeOption); + jp.sf.pal.addresslist.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(url), getCValueUrl(), "URL", "Url", "url", + likeSearchOption); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param urlList The collection of url as notInScope. + * @param url The value of url as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setUrl_NotInScope(Collection urlList) { - regUrl(CK_NINS, cTL(urlList)); + public void setUrl_NotLikeSearch( + String url, + jp.sf.pal.addresslist.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(url), getCValueUrl(), "URL", "Url", "url", + likeSearchOption); } /** - * IsNull(is null). And OnceRegistered. + * IsNull(is null). And OnlyOnceRegistered. */ public void setUrl_IsNull() { regUrl(CK_ISN, DUMMY_OBJECT); } /** - * IsNotNull(is not null). And OnceRegistered. + * IsNotNull(is not null). And OnlyOnceRegistered. */ public void setUrl_IsNotNull() { regUrl(CK_ISNN, DUMMY_OBJECT); @@ -2007,7 +1880,7 @@ abstract protected ConditionValue getCValueUrl(); /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {VARCHAR(40)} + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {VARCHAR(40)} * * @param telephone The value of telephone as equal. */ @@ -2016,7 +1889,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param telephone The value of telephone as notEqual. */ @@ -2025,7 +1898,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param telephone The value of telephone as greaterThan. */ @@ -2034,7 +1907,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param telephone The value of telephone as lessThan. */ @@ -2043,7 +1916,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param telephone The value of telephone as greaterEqual. */ @@ -2052,7 +1925,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param telephone The value of telephone as lessEqual. */ @@ -2061,7 +1934,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param telephone The value of telephone as prefixSearch. */ @@ -2070,20 +1943,6 @@ } /** - * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, - * SeveralRegistered. - * - * @param telephone The value of telephone as likeSearch. - * @param likeSearchOption The option of like-search. (NotNull) - */ - public void setTelephone_LikeSearch( - String telephone, - jp.sf.pal.addresslist.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { - registerLikeSearchQuery(CK_LS, fRES(telephone), getCValueTelephone(), - "TELEPHONE", "Telephone", "telephone", likeSearchOption); - } - - /** * InScope(in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * @@ -2094,38 +1953,52 @@ } /** - * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * - * @param telephone The collection of telephone as inScope. - * @param inScopeOption The option of in-scope. (NotNull) + * @param telephoneList The collection of telephone as notInScope. */ - public void setTelephone_InScope( + public void setTelephone_NotInScope(Collection telephoneList) { + regTelephone(CK_NINS, cTL(telephoneList)); + } + + /** + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param telephone The value of telephone as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) + */ + public void setTelephone_LikeSearch( String telephone, - jp.sf.pal.addresslist.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(telephone), getCValueTelephone(), - "TELEPHONE", "Telephone", "telephone", inScopeOption); + jp.sf.pal.addresslist.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(telephone), getCValueTelephone(), "TELEPHONE", + "Telephone", "telephone", likeSearchOption); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param telephoneList The collection of telephone as notInScope. + * @param telephone The value of telephone as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setTelephone_NotInScope(Collection telephoneList) { - regTelephone(CK_NINS, cTL(telephoneList)); + public void setTelephone_NotLikeSearch( + String telephone, + jp.sf.pal.addresslist.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(telephone), getCValueTelephone(), "TELEPHONE", + "Telephone", "telephone", likeSearchOption); } /** - * IsNull(is null). And OnceRegistered. + * IsNull(is null). And OnlyOnceRegistered. */ public void setTelephone_IsNull() { regTelephone(CK_ISN, DUMMY_OBJECT); } /** - * IsNotNull(is not null). And OnceRegistered. + * IsNotNull(is not null). And OnlyOnceRegistered. */ public void setTelephone_IsNotNull() { regTelephone(CK_ISNN, DUMMY_OBJECT); @@ -2144,7 +2017,7 @@ abstract protected ConditionValue getCValueTelephone(); /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {VARCHAR(5)} + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {VARCHAR(5)} * * @param locale The value of locale as equal. */ @@ -2153,7 +2026,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param locale The value of locale as notEqual. */ @@ -2162,7 +2035,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param locale The value of locale as greaterThan. */ @@ -2171,7 +2044,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param locale The value of locale as lessThan. */ @@ -2180,7 +2053,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param locale The value of locale as greaterEqual. */ @@ -2189,7 +2062,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param locale The value of locale as lessEqual. */ @@ -2198,7 +2071,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param locale The value of locale as prefixSearch. */ @@ -2207,20 +2080,6 @@ } /** - * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, - * SeveralRegistered. - * - * @param locale The value of locale as likeSearch. - * @param likeSearchOption The option of like-search. (NotNull) - */ - public void setLocale_LikeSearch( - String locale, - jp.sf.pal.addresslist.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { - registerLikeSearchQuery(CK_LS, fRES(locale), getCValueLocale(), - "LOCALE", "Locale", "locale", likeSearchOption); - } - - /** * InScope(in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * @@ -2231,38 +2090,52 @@ } /** - * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * - * @param locale The collection of locale as inScope. - * @param inScopeOption The option of in-scope. (NotNull) + * @param localeList The collection of locale as notInScope. */ - public void setLocale_InScope( + public void setLocale_NotInScope(Collection localeList) { + regLocale(CK_NINS, cTL(localeList)); + } + + /** + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param locale The value of locale as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) + */ + public void setLocale_LikeSearch( String locale, - jp.sf.pal.addresslist.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(locale), getCValueLocale(), "LOCALE", - "Locale", "locale", inScopeOption); + jp.sf.pal.addresslist.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(locale), getCValueLocale(), "LOCALE", "Locale", + "locale", likeSearchOption); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param localeList The collection of locale as notInScope. + * @param locale The value of locale as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setLocale_NotInScope(Collection localeList) { - regLocale(CK_NINS, cTL(localeList)); + public void setLocale_NotLikeSearch( + String locale, + jp.sf.pal.addresslist.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(locale), getCValueLocale(), "LOCALE", "Locale", + "locale", likeSearchOption); } /** - * IsNull(is null). And OnceRegistered. + * IsNull(is null). And OnlyOnceRegistered. */ public void setLocale_IsNull() { regLocale(CK_ISN, DUMMY_OBJECT); } /** - * IsNotNull(is not null). And OnceRegistered. + * IsNotNull(is not null). And OnlyOnceRegistered. */ public void setLocale_IsNotNull() { regLocale(CK_ISNN, DUMMY_OBJECT); @@ -2281,8 +2154,8 @@ abstract protected ConditionValue getCValueLocale(); /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {VARCHAR(255) : FK to - * ROLE_INFO} + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {VARCHAR(255) : FK + * to ROLE_INFO} * * @param roleId The value of roleId as equal. */ @@ -2291,7 +2164,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param roleId The value of roleId as notEqual. */ @@ -2300,7 +2173,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param roleId The value of roleId as greaterThan. */ @@ -2309,7 +2182,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param roleId The value of roleId as lessThan. */ @@ -2318,7 +2191,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param roleId The value of roleId as greaterEqual. */ @@ -2327,7 +2200,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param roleId The value of roleId as lessEqual. */ @@ -2336,7 +2209,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param roleId The value of roleId as prefixSearch. */ @@ -2345,20 +2218,6 @@ } /** - * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, - * SeveralRegistered. - * - * @param roleId The value of roleId as likeSearch. - * @param likeSearchOption The option of like-search. (NotNull) - */ - public void setRoleId_LikeSearch( - String roleId, - jp.sf.pal.addresslist.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. * @@ -2369,42 +2228,41 @@ } /** - * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * - * @param roleId The collection of roleId as inScope. - * @param inScopeOption The option of in-scope. (NotNull) + * @param roleIdList The collection of roleId as notInScope. */ - public void setRoleId_InScope( - String roleId, - jp.sf.pal.addresslist.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(roleId), getCValueRoleId(), - "ROLE_ID", "RoleId", "roleId", inScopeOption); + public void setRoleId_NotInScope(Collection roleIdList) { + regRoleId(CK_NINS, cTL(roleIdList)); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param roleIdList The collection of roleId as notInScope. + * @param roleId The value of roleId as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) */ - public void setRoleId_NotInScope(Collection roleIdList) { - regRoleId(CK_NINS, cTL(roleIdList)); + public void setRoleId_LikeSearch( + String roleId, + jp.sf.pal.addresslist.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(roleId), getCValueRoleId(), "ROLE_ID", "RoleId", + "roleId", likeSearchOption); } /** - * @param roleInfoCBquery Query. - * @deprecated Please use inScopeRoleInfo(subQuery) method. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param roleId The value of roleId as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setRoleId_InScopeSubQuery_RoleInfo(RoleInfoCQ roleInfoCBquery) { - String subQueryPropertyName = keepRoleId_InScopeSubQuery_RoleInfo(roleInfoCBquery);// for - // saving - // query - // - - // value - // . - registerInScopeSubQuery(roleInfoCBquery, "ROLE_ID", "ROLE_ID", - subQueryPropertyName); + public void setRoleId_NotLikeSearch( + String roleId, + jp.sf.pal.addresslist.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(roleId), getCValueRoleId(), "ROLE_ID", "RoleId", + "roleId", likeSearchOption); } public void inScopeRoleInfo(SubQuery subQuery) { @@ -2413,23 +2271,23 @@ cb.xsetupForInScopeSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepRoleId_InScopeSubQuery_RoleInfo(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerInScopeSubQuery(cb.query(), "ROLE_ID", "ROLE_ID", subQueryPropertyName); } - abstract public String keepRoleId_InScopeSubQuery_RoleInfo( + public abstract String keepRoleId_InScopeSubQuery_RoleInfo( jp.sf.pal.addresslist.db.cbean.cq.RoleInfoCQ subQuery); /** - * IsNull(is null). And OnceRegistered. + * IsNull(is null). And OnlyOnceRegistered. */ public void setRoleId_IsNull() { regRoleId(CK_ISN, DUMMY_OBJECT); } /** - * IsNotNull(is not null). And OnceRegistered. + * IsNotNull(is not null). And OnlyOnceRegistered. */ public void setRoleId_IsNotNull() { regRoleId(CK_ISNN, DUMMY_OBJECT); @@ -2448,8 +2306,8 @@ abstract protected ConditionValue getCValueRoleId(); /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {VARCHAR(255) : FK to - * GROUP_INFO} + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {VARCHAR(255) : FK + * to GROUP_INFO} * * @param groupId The value of groupId as equal. */ @@ -2458,7 +2316,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param groupId The value of groupId as notEqual. */ @@ -2467,7 +2325,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param groupId The value of groupId as greaterThan. */ @@ -2476,7 +2334,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param groupId The value of groupId as lessThan. */ @@ -2485,7 +2343,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param groupId The value of groupId as greaterEqual. */ @@ -2494,7 +2352,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param groupId The value of groupId as lessEqual. */ @@ -2503,7 +2361,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param groupId The value of groupId as prefixSearch. */ @@ -2512,20 +2370,6 @@ } /** - * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, - * SeveralRegistered. - * - * @param groupId The value of groupId as likeSearch. - * @param likeSearchOption The option of like-search. (NotNull) - */ - public void setGroupId_LikeSearch( - String groupId, - jp.sf.pal.addresslist.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. * @@ -2536,43 +2380,41 @@ } /** - * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * - * @param groupId The collection of groupId as inScope. - * @param inScopeOption The option of in-scope. (NotNull) + * @param groupIdList The collection of groupId as notInScope. */ - public void setGroupId_InScope( - String groupId, - jp.sf.pal.addresslist.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(groupId), getCValueGroupId(), - "GROUP_ID", "GroupId", "groupId", inScopeOption); + public void setGroupId_NotInScope(Collection groupIdList) { + regGroupId(CK_NINS, cTL(groupIdList)); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param groupIdList The collection of groupId as notInScope. + * @param groupId The value of groupId as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) */ - public void setGroupId_NotInScope(Collection groupIdList) { - regGroupId(CK_NINS, cTL(groupIdList)); + public void setGroupId_LikeSearch( + String groupId, + jp.sf.pal.addresslist.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(groupId), getCValueGroupId(), "GROUP_ID", "GroupId", + "groupId", likeSearchOption); } /** - * @param groupInfoCBquery Query. - * @deprecated Please use inScopeGroupInfo(subQuery) method. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param groupId The value of groupId as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setGroupId_InScopeSubQuery_GroupInfo( - GroupInfoCQ groupInfoCBquery) { - String subQueryPropertyName = keepGroupId_InScopeSubQuery_GroupInfo(groupInfoCBquery);// for - // saving - // query - // - - // value - // . - registerInScopeSubQuery(groupInfoCBquery, "GROUP_ID", "GROUP_ID", - subQueryPropertyName); + public void setGroupId_NotLikeSearch( + String groupId, + jp.sf.pal.addresslist.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(groupId), getCValueGroupId(), "GROUP_ID", + "GroupId", "groupId", likeSearchOption); } public void inScopeGroupInfo(SubQuery subQuery) { @@ -2581,23 +2423,23 @@ cb.xsetupForInScopeSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepGroupId_InScopeSubQuery_GroupInfo(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerInScopeSubQuery(cb.query(), "GROUP_ID", "GROUP_ID", subQueryPropertyName); } - abstract public String keepGroupId_InScopeSubQuery_GroupInfo( + public abstract String keepGroupId_InScopeSubQuery_GroupInfo( jp.sf.pal.addresslist.db.cbean.cq.GroupInfoCQ subQuery); /** - * IsNull(is null). And OnceRegistered. + * IsNull(is null). And OnlyOnceRegistered. */ public void setGroupId_IsNull() { regGroupId(CK_ISN, DUMMY_OBJECT); } /** - * IsNotNull(is not null). And OnceRegistered. + * IsNotNull(is not null). And OnlyOnceRegistered. */ public void setGroupId_IsNotNull() { regGroupId(CK_ISNN, DUMMY_OBJECT); @@ -2616,8 +2458,145 @@ abstract protected ConditionValue getCValueGroupId(); /** - * Equal(=). And NullIgnored, OnceRegistered. {NotNull : TIMESTAMP} + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {VARCHAR(1)} * + * @param status The value of status as equal. + */ + public void setStatus_Equal(String status) { + regStatus(CK_EQ, fRES(status)); + } + + /** + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. + * + * @param status The value of status as notEqual. + */ + public void setStatus_NotEqual(String status) { + regStatus(CK_NE, fRES(status)); + } + + /** + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. + * + * @param status The value of status as greaterThan. + */ + public void setStatus_GreaterThan(String status) { + regStatus(CK_GT, fRES(status)); + } + + /** + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. + * + * @param status The value of status as lessThan. + */ + public void setStatus_LessThan(String status) { + regStatus(CK_LT, fRES(status)); + } + + /** + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. + * + * @param status The value of status as greaterEqual. + */ + public void setStatus_GreaterEqual(String status) { + regStatus(CK_GE, fRES(status)); + } + + /** + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. + * + * @param status The value of status as lessEqual. + */ + public void setStatus_LessEqual(String status) { + regStatus(CK_LE, fRES(status)); + } + + /** + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. + * + * @param status The value of status as prefixSearch. + */ + public void setStatus_PrefixSearch(String status) { + regStatus(CK_PS, fRES(status)); + } + + /** + * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NullOrEmptyElementIgnored, SeveralRegistered. + * + * @param statusList The collection of status as inScope. + */ + public void setStatus_InScope(Collection statusList) { + regStatus(CK_INS, cTL(statusList)); + } + + /** + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, + * NullOrEmptyElementIgnored, SeveralRegistered. + * + * @param statusList The collection of status as notInScope. + */ + public void setStatus_NotInScope(Collection statusList) { + regStatus(CK_NINS, cTL(statusList)); + } + + /** + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param status The value of status as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) + */ + public void setStatus_LikeSearch( + String status, + jp.sf.pal.addresslist.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(status), getCValueStatus(), "STATUS", "Status", + "status", likeSearchOption); + } + + /** + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param status The value of status as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) + */ + public void setStatus_NotLikeSearch( + String status, + jp.sf.pal.addresslist.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(status), getCValueStatus(), "STATUS", "Status", + "status", likeSearchOption); + } + + /** + * IsNull(is null). And OnlyOnceRegistered. + */ + public void setStatus_IsNull() { + regStatus(CK_ISN, DUMMY_OBJECT); + } + + /** + * IsNotNull(is not null). And OnlyOnceRegistered. + */ + public void setStatus_IsNotNull() { + regStatus(CK_ISNN, DUMMY_OBJECT); + } + + protected void regStatus(ConditionKey key, Object value) { + registerQuery(key, value, getCValueStatus(), "STATUS", "Status", + "status"); + } + + protected void registerInlineStatus(ConditionKey key, Object value) { + registerInlineQuery(key, value, getCValueStatus(), "STATUS", "Status", + "status"); + } + + abstract protected ConditionValue getCValueStatus(); + + /** + * Equal(=). And NullIgnored, OnlyOnceRegistered. {NotNull : TIMESTAMP} + * * @param createdTime The value of createdTime as equal. */ public void setCreatedTime_Equal(java.sql.Timestamp createdTime) { @@ -2625,7 +2604,7 @@ } /** - * NotEqual(!=). And NullIgnored, OnceRegistered. + * NotEqual(!=). And NullIgnored, OnlyOnceRegistered. * * @param createdTime The value of createdTime as notEqual. */ @@ -2634,7 +2613,7 @@ } /** - * GreaterThan(>). And NullIgnored, OnceRegistered. + * GreaterThan(>). And NullIgnored, OnlyOnceRegistered. * * @param createdTime The value of createdTime as greaterThan. */ @@ -2643,7 +2622,7 @@ } /** - * LessThan(>). And NullIgnored, OnceRegistered. + * LessThan(>). And NullIgnored, OnlyOnceRegistered. * * @param createdTime The value of createdTime as lessThan. */ @@ -2652,7 +2631,7 @@ } /** - * GreaterEqual(>). And NullIgnored, OnceRegistered. + * GreaterEqual(>). And NullIgnored, OnlyOnceRegistered. * * @param createdTime The value of createdTime as greaterEqual. */ @@ -2661,7 +2640,7 @@ } /** - * LessEqual(>). And NullIgnored, OnceRegistered. + * LessEqual(>). And NullIgnored, OnlyOnceRegistered. * * @param createdTime The value of createdTime as lessEqual. */ @@ -2671,7 +2650,7 @@ /** * FromTo($fromDate <= COLUMN_NAME <= $toDate). And NullIgnored, - * OnceRegistered. {NotNull : TIMESTAMP} + * OnlyOnceRegistered. {NotNull : TIMESTAMP} * * @param fromDate The from-date of createdTime. (Nullable) * @param toDate The to-date of createdTime. (Nullable) @@ -2689,7 +2668,7 @@ /** * FromTo($fromDate <= COLUMN_NAME < $toDate + 1). And NullIgnored, - * OnceRegistered. {NotNull : TIMESTAMP} + * OnlyOnceRegistered. {NotNull : TIMESTAMP} * * @param fromDate The from-date of createdTime. (Nullable) * @param toDate The to-date of createdTime. (Nullable) @@ -2715,7 +2694,7 @@ abstract protected ConditionValue getCValueCreatedTime(); /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {NotNull : + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {NotNull : * VARCHAR(255)} * * @param createdBy The value of createdBy as equal. @@ -2725,7 +2704,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param createdBy The value of createdBy as notEqual. */ @@ -2734,7 +2713,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param createdBy The value of createdBy as greaterThan. */ @@ -2743,7 +2722,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param createdBy The value of createdBy as lessThan. */ @@ -2752,7 +2731,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param createdBy The value of createdBy as greaterEqual. */ @@ -2761,7 +2740,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param createdBy The value of createdBy as lessEqual. */ @@ -2770,7 +2749,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param createdBy The value of createdBy as prefixSearch. */ @@ -2779,20 +2758,6 @@ } /** - * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, - * SeveralRegistered. - * - * @param createdBy The value of createdBy as likeSearch. - * @param likeSearchOption The option of like-search. (NotNull) - */ - public void setCreatedBy_LikeSearch( - String createdBy, - jp.sf.pal.addresslist.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. * @@ -2803,27 +2768,41 @@ } /** - * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * - * @param createdBy The collection of createdBy as inScope. - * @param inScopeOption The option of in-scope. (NotNull) + * @param createdByList The collection of createdBy as notInScope. */ - public void setCreatedBy_InScope( + public void setCreatedBy_NotInScope(Collection createdByList) { + regCreatedBy(CK_NINS, cTL(createdByList)); + } + + /** + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param createdBy The value of createdBy as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) + */ + public void setCreatedBy_LikeSearch( String createdBy, - jp.sf.pal.addresslist.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(createdBy), getCValueCreatedBy(), - "CREATED_BY", "CreatedBy", "createdBy", inScopeOption); + jp.sf.pal.addresslist.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(createdBy), getCValueCreatedBy(), "CREATED_BY", + "CreatedBy", "createdBy", likeSearchOption); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param createdByList The collection of createdBy as notInScope. + * @param createdBy The value of createdBy as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setCreatedBy_NotInScope(Collection createdByList) { - regCreatedBy(CK_NINS, cTL(createdByList)); + public void setCreatedBy_NotLikeSearch( + String createdBy, + jp.sf.pal.addresslist.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(createdBy), getCValueCreatedBy(), "CREATED_BY", + "CreatedBy", "createdBy", likeSearchOption); } protected void regCreatedBy(ConditionKey key, Object value) { @@ -2839,7 +2818,7 @@ abstract protected ConditionValue getCValueCreatedBy(); /** - * Equal(=). And NullIgnored, OnceRegistered. {NotNull : TIMESTAMP} + * Equal(=). And NullIgnored, OnlyOnceRegistered. {NotNull : TIMESTAMP} * * @param updatedTime The value of updatedTime as equal. */ @@ -2848,7 +2827,7 @@ } /** - * NotEqual(!=). And NullIgnored, OnceRegistered. + * NotEqual(!=). And NullIgnored, OnlyOnceRegistered. * * @param updatedTime The value of updatedTime as notEqual. */ @@ -2857,7 +2836,7 @@ } /** - * GreaterThan(>). And NullIgnored, OnceRegistered. + * GreaterThan(>). And NullIgnored, OnlyOnceRegistered. * * @param updatedTime The value of updatedTime as greaterThan. */ @@ -2866,7 +2845,7 @@ } /** - * LessThan(>). And NullIgnored, OnceRegistered. + * LessThan(>). And NullIgnored, OnlyOnceRegistered. * * @param updatedTime The value of updatedTime as lessThan. */ @@ -2875,7 +2854,7 @@ } /** - * GreaterEqual(>). And NullIgnored, OnceRegistered. + * GreaterEqual(>). And NullIgnored, OnlyOnceRegistered. * * @param updatedTime The value of updatedTime as greaterEqual. */ @@ -2884,7 +2863,7 @@ } /** - * LessEqual(>). And NullIgnored, OnceRegistered. + * LessEqual(>). And NullIgnored, OnlyOnceRegistered. * * @param updatedTime The value of updatedTime as lessEqual. */ @@ -2894,7 +2873,7 @@ /** * FromTo($fromDate <= COLUMN_NAME <= $toDate). And NullIgnored, - * OnceRegistered. {NotNull : TIMESTAMP} + * OnlyOnceRegistered. {NotNull : TIMESTAMP} * * @param fromDate The from-date of updatedTime. (Nullable) * @param toDate The to-date of updatedTime. (Nullable) @@ -2912,7 +2891,7 @@ /** * FromTo($fromDate <= COLUMN_NAME < $toDate + 1). And NullIgnored, - * OnceRegistered. {NotNull : TIMESTAMP} + * OnlyOnceRegistered. {NotNull : TIMESTAMP} * * @param fromDate The from-date of updatedTime. (Nullable) * @param toDate The to-date of updatedTime. (Nullable) @@ -2938,7 +2917,7 @@ abstract protected ConditionValue getCValueUpdatedTime(); /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {NotNull : + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {NotNull : * VARCHAR(255)} * * @param updatedBy The value of updatedBy as equal. @@ -2948,7 +2927,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param updatedBy The value of updatedBy as notEqual. */ @@ -2957,7 +2936,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param updatedBy The value of updatedBy as greaterThan. */ @@ -2966,7 +2945,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param updatedBy The value of updatedBy as lessThan. */ @@ -2975,7 +2954,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param updatedBy The value of updatedBy as greaterEqual. */ @@ -2984,7 +2963,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param updatedBy The value of updatedBy as lessEqual. */ @@ -2993,7 +2972,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param updatedBy The value of updatedBy as prefixSearch. */ @@ -3002,20 +2981,6 @@ } /** - * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, - * SeveralRegistered. - * - * @param updatedBy The value of updatedBy as likeSearch. - * @param likeSearchOption The option of like-search. (NotNull) - */ - public void setUpdatedBy_LikeSearch( - String updatedBy, - jp.sf.pal.addresslist.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. * @@ -3026,27 +2991,41 @@ } /** - * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * - * @param updatedBy The collection of updatedBy as inScope. - * @param inScopeOption The option of in-scope. (NotNull) + * @param updatedByList The collection of updatedBy as notInScope. */ - public void setUpdatedBy_InScope( + public void setUpdatedBy_NotInScope(Collection updatedByList) { + regUpdatedBy(CK_NINS, cTL(updatedByList)); + } + + /** + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param updatedBy The value of updatedBy as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) + */ + public void setUpdatedBy_LikeSearch( String updatedBy, - jp.sf.pal.addresslist.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(updatedBy), getCValueUpdatedBy(), - "UPDATED_BY", "UpdatedBy", "updatedBy", inScopeOption); + jp.sf.pal.addresslist.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(updatedBy), getCValueUpdatedBy(), "UPDATED_BY", + "UpdatedBy", "updatedBy", likeSearchOption); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param updatedByList The collection of updatedBy as notInScope. + * @param updatedBy The value of updatedBy as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setUpdatedBy_NotInScope(Collection updatedByList) { - regUpdatedBy(CK_NINS, cTL(updatedByList)); + public void setUpdatedBy_NotLikeSearch( + String updatedBy, + jp.sf.pal.addresslist.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(updatedBy), getCValueUpdatedBy(), "UPDATED_BY", + "UpdatedBy", "updatedBy", likeSearchOption); } protected void regUpdatedBy(ConditionKey key, Object value) { @@ -3062,7 +3041,7 @@ abstract protected ConditionValue getCValueUpdatedBy(); /** - * Equal(=). And NullIgnored, OnceRegistered. {TIMESTAMP} + * Equal(=). And NullIgnored, OnlyOnceRegistered. {TIMESTAMP} * * @param deletedTime The value of deletedTime as equal. */ @@ -3071,7 +3050,7 @@ } /** - * NotEqual(!=). And NullIgnored, OnceRegistered. + * NotEqual(!=). And NullIgnored, OnlyOnceRegistered. * * @param deletedTime The value of deletedTime as notEqual. */ @@ -3080,7 +3059,7 @@ } /** - * GreaterThan(>). And NullIgnored, OnceRegistered. + * GreaterThan(>). And NullIgnored, OnlyOnceRegistered. * * @param deletedTime The value of deletedTime as greaterThan. */ @@ -3089,7 +3068,7 @@ } /** - * LessThan(>). And NullIgnored, OnceRegistered. + * LessThan(>). And NullIgnored, OnlyOnceRegistered. * * @param deletedTime The value of deletedTime as lessThan. */ @@ -3098,7 +3077,7 @@ } /** - * GreaterEqual(>). And NullIgnored, OnceRegistered. + * GreaterEqual(>). And NullIgnored, OnlyOnceRegistered. * * @param deletedTime The value of deletedTime as greaterEqual. */ @@ -3107,7 +3086,7 @@ } /** - * LessEqual(>). And NullIgnored, OnceRegistered. + * LessEqual(>). And NullIgnored, OnlyOnceRegistered. * * @param deletedTime The value of deletedTime as lessEqual. */ @@ -3117,7 +3096,7 @@ /** * FromTo($fromDate <= COLUMN_NAME <= $toDate). And NullIgnored, - * OnceRegistered. {TIMESTAMP} + * OnlyOnceRegistered. {TIMESTAMP} * * @param fromDate The from-date of deletedTime. (Nullable) * @param toDate The to-date of deletedTime. (Nullable) @@ -3135,7 +3114,7 @@ /** * FromTo($fromDate <= COLUMN_NAME < $toDate + 1). And NullIgnored, - * OnceRegistered. {TIMESTAMP} + * OnlyOnceRegistered. {TIMESTAMP} * * @param fromDate The from-date of deletedTime. (Nullable) * @param toDate The to-date of deletedTime. (Nullable) @@ -3149,14 +3128,14 @@ } /** - * IsNull(is null). And OnceRegistered. + * IsNull(is null). And OnlyOnceRegistered. */ public void setDeletedTime_IsNull() { regDeletedTime(CK_ISN, DUMMY_OBJECT); } /** - * IsNotNull(is not null). And OnceRegistered. + * IsNotNull(is not null). And OnlyOnceRegistered. */ public void setDeletedTime_IsNotNull() { regDeletedTime(CK_ISNN, DUMMY_OBJECT); @@ -3175,7 +3154,7 @@ abstract protected ConditionValue getCValueDeletedTime(); /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {VARCHAR(255)} + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {VARCHAR(255)} * * @param deletedBy The value of deletedBy as equal. */ @@ -3184,7 +3163,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param deletedBy The value of deletedBy as notEqual. */ @@ -3193,7 +3172,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param deletedBy The value of deletedBy as greaterThan. */ @@ -3202,7 +3181,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param deletedBy The value of deletedBy as lessThan. */ @@ -3211,7 +3190,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param deletedBy The value of deletedBy as greaterEqual. */ @@ -3220,7 +3199,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param deletedBy The value of deletedBy as lessEqual. */ @@ -3229,7 +3208,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param deletedBy The value of deletedBy as prefixSearch. */ @@ -3238,20 +3217,6 @@ } /** - * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, - * SeveralRegistered. - * - * @param deletedBy The value of deletedBy as likeSearch. - * @param likeSearchOption The option of like-search. (NotNull) - */ - public void setDeletedBy_LikeSearch( - String deletedBy, - jp.sf.pal.addresslist.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. * @@ -3262,38 +3227,52 @@ } /** - * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * - * @param deletedBy The collection of deletedBy as inScope. - * @param inScopeOption The option of in-scope. (NotNull) + * @param deletedByList The collection of deletedBy as notInScope. */ - public void setDeletedBy_InScope( + public void setDeletedBy_NotInScope(Collection deletedByList) { + regDeletedBy(CK_NINS, cTL(deletedByList)); + } + + /** + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param deletedBy The value of deletedBy as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) + */ + public void setDeletedBy_LikeSearch( String deletedBy, - jp.sf.pal.addresslist.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(deletedBy), getCValueDeletedBy(), - "DELETED_BY", "DeletedBy", "deletedBy", inScopeOption); + jp.sf.pal.addresslist.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(deletedBy), getCValueDeletedBy(), "DELETED_BY", + "DeletedBy", "deletedBy", likeSearchOption); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param deletedByList The collection of deletedBy as notInScope. + * @param deletedBy The value of deletedBy as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setDeletedBy_NotInScope(Collection deletedByList) { - regDeletedBy(CK_NINS, cTL(deletedByList)); + public void setDeletedBy_NotLikeSearch( + String deletedBy, + jp.sf.pal.addresslist.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(deletedBy), getCValueDeletedBy(), "DELETED_BY", + "DeletedBy", "deletedBy", likeSearchOption); } /** - * IsNull(is null). And OnceRegistered. + * IsNull(is null). And OnlyOnceRegistered. */ public void setDeletedBy_IsNull() { regDeletedBy(CK_ISN, DUMMY_OBJECT); } /** - * IsNotNull(is not null). And OnceRegistered. + * IsNotNull(is not null). And OnlyOnceRegistered. */ public void setDeletedBy_IsNotNull() { regDeletedBy(CK_ISNN, DUMMY_OBJECT); @@ -3312,7 +3291,7 @@ abstract protected ConditionValue getCValueDeletedBy(); /** - * Equal(=). And NullIgnored, OnceRegistered. {NotNull : INTEGER} + * Equal(=). And NullIgnored, OnlyOnceRegistered. {NotNull : INTEGER} * * @param versionno The value of versionno as equal. */ @@ -3321,7 +3300,7 @@ } /** - * NotEqual(!=). And NullIgnored, OnceRegistered. + * NotEqual(!=). And NullIgnored, OnlyOnceRegistered. * * @param versionno The value of versionno as notEqual. */ @@ -3330,7 +3309,7 @@ } /** - * GreaterThan(>). And NullIgnored, OnceRegistered. + * GreaterThan(>). And NullIgnored, OnlyOnceRegistered. * * @param versionno The value of versionno as greaterThan. */ @@ -3339,7 +3318,7 @@ } /** - * LessThan(<). And NullIgnored, OnceRegistered. + * LessThan(<). And NullIgnored, OnlyOnceRegistered. * * @param versionno The value of versionno as lessThan. */ @@ -3348,7 +3327,7 @@ } /** - * GreaterEqual(>=). And NullIgnored, OnceRegistered. + * GreaterEqual(>=). And NullIgnored, OnlyOnceRegistered. * * @param versionno The value of versionno as greaterEqual. */ @@ -3357,7 +3336,7 @@ } /** - * LessEqual(<=). And NullIgnored, OnceRegistered. + * LessEqual(<=). And NullIgnored, OnlyOnceRegistered. * * @param versionno The value of versionno as lessEqual. */ @@ -3397,6 +3376,50 @@ abstract protected ConditionValue getCValueVersionno(); + public SSQFunction scalar_Equal() { + return xcreateSSQFunction("="); + } + + public SSQFunction scalar_GreaterEqual() { + return xcreateSSQFunction(">="); + } + + public SSQFunction scalar_GreaterThan() { + return xcreateSSQFunction(">"); + } + + public SSQFunction scalar_LessEqual() { + return xcreateSSQFunction("<="); + } + + public SSQFunction scalar_LessThan() { + return xcreateSSQFunction("<"); + } + + protected SSQFunction xcreateSSQFunction(final String operand) { + return new SSQFunction(new SSQSetupper() { + public void setup(String function, SubQuery subQuery) { + xscalarSubQuery(function, subQuery, operand); + } + }); + } + + protected void xscalarSubQuery(String function, + SubQuery subQuery, String operand) { + assertObjectNotNull("subQuery", subQuery); + UserInfoCB cb = new UserInfoCB(); + cb.xsetupForScalarSubQuery(); + subQuery.query(cb); + String subQueryPropertyName = keepScalarSubQuery(cb.query()); // for + // saving + // query + // -value. + registerScalarSubQuery(function, cb.query(), subQueryPropertyName, + operand); + } + + public abstract String keepScalarSubQuery(UserInfoCQ subQuery); + // Very Internal (for Suppressing Warn about 'Not Use Import') protected String getConditionBeanClassNameInternally() { return UserInfoCB.class.getName(); Modified: addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/cbean/cq/bs/BsCompanyCQ.java =================================================================== --- addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/cbean/cq/bs/BsCompanyCQ.java 2008-12-27 22:02:56 UTC (rev 1623) +++ addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/cbean/cq/bs/BsCompanyCQ.java 2008-12-27 22:06:42 UTC (rev 1624) @@ -5,6 +5,7 @@ import jp.sf.pal.addresslist.db.allcommon.cbean.ConditionQuery; import jp.sf.pal.addresslist.db.allcommon.cbean.cvalue.ConditionValue; import jp.sf.pal.addresslist.db.allcommon.cbean.sqlclause.SqlClause; +import jp.sf.pal.addresslist.db.cbean.CompanyCB; import jp.sf.pal.addresslist.db.cbean.cq.CompanyCQ; import jp.sf.pal.addresslist.db.cbean.cq.PersonCQ; import jp.sf.pal.addresslist.db.cbean.cq.UserInfoCQ; @@ -15,7 +16,6 @@ * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public class BsCompanyCQ extends AbstractBsCompanyCQ { //========================================================================== @@ -61,7 +61,7 @@ public CompanyCIQ on() { if (isBaseQuery(this)) { throw new UnsupportedOperationException( - "Unsupported onClause of Base Table!"); + "Unsupported on-clause for local table!"); } CompanyCIQ inlineQuery = inline(); inlineQuery.xsetOnClauseInline(true); @@ -150,20 +150,20 @@ return "id_NotExistsSubQuery_PersonList." + key; } - protected Map _id_DeriveSubQuery_PersonListMap; + protected Map _id_DerivedReferrer_PersonListMap; - public Map getId_DeriveSubQuery_PersonList() { - return _id_DeriveSubQuery_PersonListMap; + public Map getId_DerivedReferrer_PersonList() { + return _id_DerivedReferrer_PersonListMap; } - public String keepId_DeriveSubQuery_PersonList(PersonCQ subQuery) { - if (_id_DeriveSubQuery_PersonListMap == null) { - _id_DeriveSubQuery_PersonListMap = newLinkedHashMap(); + public String keepId_DerivedReferrer_PersonList(PersonCQ subQuery) { + if (_id_DerivedReferrer_PersonListMap == null) { + _id_DerivedReferrer_PersonListMap = newLinkedHashMap(); } String key = "subQueryMapKey" - + (_id_DeriveSubQuery_PersonListMap.size() + 1); - _id_DeriveSubQuery_PersonListMap.put(key, subQuery); - return "id_DeriveSubQuery_PersonList." + key; + + (_id_DerivedReferrer_PersonListMap.size() + 1); + _id_DerivedReferrer_PersonListMap.put(key, subQuery); + return "id_DerivedReferrer_PersonList." + key; } public BsCompanyCQ addOrderBy_Id_Asc() { @@ -753,7 +753,6 @@ // ========= // Foreign Query // ============= - public UserInfoCQ queryUserInfo() { return getConditionQueryUserInfo(); } @@ -762,20 +761,13 @@ public UserInfoCQ getConditionQueryUserInfo() { if (_conditionQueryUserInfo == null) { - _conditionQueryUserInfo = createQueryUserInfo(); - setupOuterJoin_UserInfo(); + _conditionQueryUserInfo = xcreateQueryUserInfo(); + xsetupOuterJoinUserInfo(); } return _conditionQueryUserInfo; } - protected void setupOuterJoin_UserInfo() { - Map joinOnMap = newLinkedHashMap(); - joinOnMap.put(getRealColumnName("USER_ID"), getConditionQueryUserInfo() - .getRealColumnName("USER_ID")); - registerOuterJoin(getConditionQueryUserInfo(), joinOnMap); - } - - protected UserInfoCQ createQueryUserInfo() { + protected UserInfoCQ xcreateQueryUserInfo() { String nrp = resolveNextRelationPath("COMPANY", "userInfo"); String jan = resolveJoinAliasName(nrp, getNextNestLevel()); UserInfoCQ cq = new UserInfoCQ(this, getSqlClause(), jan, @@ -785,10 +777,42 @@ return cq; } + protected void xsetupOuterJoinUserInfo() { + UserInfoCQ cq = getConditionQueryUserInfo(); + Map joinOnMap = newLinkedHashMap(); + joinOnMap.put(getRealColumnName("USER_ID"), cq + .getRealColumnName("USER_ID")); + registerOuterJoin(cq, joinOnMap); + } + public boolean hasConditionQueryUserInfo() { return _conditionQueryUserInfo != null; } + //========================================================================== + // ========= + // Derived Query + // ============= + protected Map _scalarSubQueryMap; + + public Map getScalarSubQuery() { + return _scalarSubQueryMap; + } + + public String keepScalarSubQuery(CompanyCQ subQuery) { + if (_scalarSubQueryMap == null) { + _scalarSubQueryMap = newLinkedHashMap(); + } + String key = "subQueryMapKey" + (_scalarSubQueryMap.size() + 1); + _scalarSubQueryMap.put(key, subQuery); + return "scalarSubQuery." + key; + } + + // Very Internal (for Suppressing Warn about 'Not Use Import') + protected String getConditionBeanClassNameInternally() { + return CompanyCB.class.getName(); + } + protected String getConditionQueryClassNameInternally() { return CompanyCQ.class.getName(); } Modified: addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/cbean/cq/bs/BsContactCQ.java =================================================================== --- addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/cbean/cq/bs/BsContactCQ.java 2008-12-27 22:02:56 UTC (rev 1623) +++ addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/cbean/cq/bs/BsContactCQ.java 2008-12-27 22:06:42 UTC (rev 1624) @@ -5,6 +5,7 @@ import jp.sf.pal.addresslist.db.allcommon.cbean.ConditionQuery; import jp.sf.pal.addresslist.db.allcommon.cbean.cvalue.ConditionValue; import jp.sf.pal.addresslist.db.allcommon.cbean.sqlclause.SqlClause; +import jp.sf.pal.addresslist.db.cbean.ContactCB; import jp.sf.pal.addresslist.db.cbean.cq.ContactCQ; import jp.sf.pal.addresslist.db.cbean.cq.PersonCQ; import jp.sf.pal.addresslist.db.cbean.cq.ciq.ContactCIQ; @@ -14,7 +15,6 @@ * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public class BsContactCQ extends AbstractBsContactCQ { //========================================================================== @@ -60,7 +60,7 @@ public ContactCIQ on() { if (isBaseQuery(this)) { throw new UnsupportedOperationException( - "Unsupported onClause of Base Table!"); + "Unsupported on-clause for local table!"); } ContactCIQ inlineQuery = inline(); inlineQuery.xsetOnClauseInline(true); @@ -212,7 +212,6 @@ // ========= // Foreign Query // ============= - public PersonCQ queryPerson() { return getConditionQueryPerson(); } @@ -221,20 +220,13 @@ public PersonCQ getConditionQueryPerson() { if (_conditionQueryPerson == null) { - _conditionQueryPerson = createQueryPerson(); - setupOuterJoin_Person(); + _conditionQueryPerson = xcreateQueryPerson(); + xsetupOuterJoinPerson(); } return _conditionQueryPerson; } - protected void setupOuterJoin_Person() { - Map joinOnMap = newLinkedHashMap(); - joinOnMap.put(getRealColumnName("PERSON_ID"), getConditionQueryPerson() - .getRealColumnName("ID")); - registerOuterJoin(getConditionQueryPerson(), joinOnMap); - } - - protected PersonCQ createQueryPerson() { + protected PersonCQ xcreateQueryPerson() { String nrp = resolveNextRelationPath("CONTACT", "person"); String jan = resolveJoinAliasName(nrp, getNextNestLevel()); PersonCQ cq = new PersonCQ(this, getSqlClause(), jan, @@ -244,10 +236,42 @@ return cq; } + protected void xsetupOuterJoinPerson() { + PersonCQ cq = getConditionQueryPerson(); + Map joinOnMap = newLinkedHashMap(); + joinOnMap.put(getRealColumnName("PERSON_ID"), cq + .getRealColumnName("ID")); + registerOuterJoin(cq, joinOnMap); + } + public boolean hasConditionQueryPerson() { return _conditionQueryPerson != null; } + //========================================================================== + // ========= + // Derived Query + // ============= + protected Map _scalarSubQueryMap; + + public Map getScalarSubQuery() { + return _scalarSubQueryMap; + } + + public String keepScalarSubQuery(ContactCQ subQuery) { + if (_scalarSubQueryMap == null) { + _scalarSubQueryMap = newLinkedHashMap(); + } + String key = "subQueryMapKey" + (_scalarSubQueryMap.size() + 1); + _scalarSubQueryMap.put(key, subQuery); + return "scalarSubQuery." + key; + } + + // Very Internal (for Suppressing Warn about 'Not Use Import') + protected String getConditionBeanClassNameInternally() { + return ContactCB.class.getName(); + } + protected String getConditionQueryClassNameInternally() { return ContactCQ.class.getName(); } Modified: addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/cbean/cq/bs/BsCustomCQ.java =================================================================== --- addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/cbean/cq/bs/BsCustomCQ.java 2008-12-27 22:02:56 UTC (rev 1623) +++ addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/cbean/cq/bs/BsCustomCQ.java 2008-12-27 22:06:42 UTC (rev 1624) @@ -5,6 +5,7 @@ import jp.sf.pal.addresslist.db.allcommon.cbean.ConditionQuery; import jp.sf.pal.addresslist.db.allcommon.cbean.cvalue.ConditionValue; import jp.sf.pal.addresslist.db.allcommon.cbean.sqlclause.SqlClause; +import jp.sf.pal.addresslist.db.cbean.CustomCB; import jp.sf.pal.addresslist.db.cbean.cq.CustomCQ; import jp.sf.pal.addresslist.db.cbean.cq.PersonCQ; import jp.sf.pal.addresslist.db.cbean.cq.ciq.CustomCIQ; @@ -14,7 +15,6 @@ * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public class BsCustomCQ extends AbstractBsCustomCQ { //========================================================================== @@ -60,7 +60,7 @@ public CustomCIQ on() { if (isBaseQuery(this)) { throw new UnsupportedOperationException( - "Unsupported onClause of Base Table!"); + "Unsupported on-clause for local table!"); } CustomCIQ inlineQuery = inline(); inlineQuery.xsetOnClauseInline(true); @@ -212,7 +212,6 @@ // ========= // Foreign Query // ============= - public PersonCQ queryPerson() { return getConditionQueryPerson(); } @@ -221,20 +220,13 @@ public PersonCQ getConditionQueryPerson() { if (_conditionQueryPerson == null) { - _conditionQueryPerson = createQueryPerson(); - setupOuterJoin_Person(); + _conditionQueryPerson = xcreateQueryPerson(); + xsetupOuterJoinPerson(); } return _conditionQueryPerson; } - protected void setupOuterJoin_Person() { - Map joinOnMap = newLinkedHashMap(); - joinOnMap.put(getRealColumnName("PERSON_ID"), getConditionQueryPerson() - .getRealColumnName("ID")); - registerOuterJoin(getConditionQueryPerson(), joinOnMap); - } - - protected PersonCQ createQueryPerson() { + protected PersonCQ xcreateQueryPerson() { String nrp = resolveNextRelationPath("CUSTOM", "person"); String jan = resolveJoinAliasName(nrp, getNextNestLevel()); PersonCQ cq = new PersonCQ(this, getSqlClause(), jan, @@ -244,10 +236,42 @@ return cq; } + protected void xsetupOuterJoinPerson() { + PersonCQ cq = getConditionQueryPerson(); + Map joinOnMap = newLinkedHashMap(); + joinOnMap.put(getRealColumnName("PERSON_ID"), cq + .getRealColumnName("ID")); + registerOuterJoin(cq, joinOnMap); + } + public boolean hasConditionQueryPerson() { return _conditionQueryPerson != null; } + //========================================================================== + // ========= + // Derived Query + // ============= + protected Map _scalarSubQueryMap; + + public Map getScalarSubQuery() { + return _scalarSubQueryMap; + } + + public String keepScalarSubQuery(CustomCQ subQuery) { + if (_scalarSubQueryMap == null) { + _scalarSubQueryMap = newLinkedHashMap(); + } + String key = "subQueryMapKey" + (_scalarSubQueryMap.size() + 1); + _scalarSubQueryMap.put(key, subQuery); + return "scalarSubQuery." + key; + } + + // Very Internal (for Suppressing Warn about 'Not Use Import') + protected String getConditionBeanClassNameInternally() { + return CustomCB.class.getName(); + } + protected String getConditionQueryClassNameInternally() { return CustomCQ.class.getName(); } Modified: addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/cbean/cq/bs/BsGroupInfoCQ.java =================================================================== --- addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/cbean/cq/bs/BsGroupInfoCQ.java 2008-12-27 22:02:56 UTC (rev 1623) +++ addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/cbean/cq/bs/BsGroupInfoCQ.java 2008-12-27 22:06:42 UTC (rev 1624) @@ -5,6 +5,7 @@ import jp.sf.pal.addresslist.db.allcommon.cbean.ConditionQuery; import jp.sf.pal.addresslist.db.allcommon.cbean.cvalue.ConditionValue; import jp.sf.pal.addresslist.db.allcommon.cbean.sqlclause.SqlClause; +import jp.sf.pal.addresslist.db.cbean.GroupInfoCB; import jp.sf.pal.addresslist.db.cbean.cq.GroupInfoCQ; import jp.sf.pal.addresslist.db.cbean.cq.GroupMappingCQ; import jp.sf.pal.addresslist.db.cbean.cq.UserInfoCQ; @@ -15,7 +16,6 @@ * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public class BsGroupInfoCQ extends AbstractBsGroupInfoCQ { //========================================================================== @@ -61,7 +61,7 @@ public GroupInfoCIQ on() { if (isBaseQuery(this)) { throw new UnsupportedOperationException( - "Unsupported onClause of Base Table!"); + "Unsupported on-clause for local table!"); } GroupInfoCIQ inlineQuery = inline(); inlineQuery.xsetOnClauseInline(true); @@ -219,37 +219,37 @@ return "groupId_NotExistsSubQuery_UserInfoList." + key; } - protected Map _groupId_DeriveSubQuery_GroupMappingListMap; + protected Map _groupId_DerivedReferrer_GroupMappingListMap; - public Map getGroupId_DeriveSubQuery_GroupMappingList() { - return _groupId_DeriveSubQuery_GroupMappingListMap; + public Map getGroupId_DerivedReferrer_GroupMappingList() { + return _groupId_DerivedReferrer_GroupMappingListMap; } - public String keepGroupId_DeriveSubQuery_GroupMappingList( + public String keepGroupId_DerivedReferrer_GroupMappingList( GroupMappingCQ subQuery) { - if (_groupId_DeriveSubQuery_GroupMappingListMap == null) { - _groupId_DeriveSubQuery_GroupMappingListMap = newLinkedHashMap(); + if (_groupId_DerivedReferrer_GroupMappingListMap == null) { + _groupId_DerivedReferrer_GroupMappingListMap = newLinkedHashMap(); } String key = "subQueryMapKey" - + (_groupId_DeriveSubQuery_GroupMappingListMap.size() + 1); - _groupId_DeriveSubQuery_GroupMappingListMap.put(key, subQuery); - return "groupId_DeriveSubQuery_GroupMappingList." + key; + + (_groupId_DerivedReferrer_GroupMappingListMap.size() + 1); + _groupId_DerivedReferrer_GroupMappingListMap.put(key, subQuery); + return "groupId_DerivedReferrer_GroupMappingList." + key; } - protected Map _groupId_DeriveSubQuery_UserInfoListMap; + protected Map _groupId_DerivedReferrer_UserInfoListMap; - public Map getGroupId_DeriveSubQuery_UserInfoList() { - return _groupId_DeriveSubQuery_UserInfoListMap; + public Map getGroupId_DerivedReferrer_UserInfoList() { + return _groupId_DerivedReferrer_UserInfoListMap; } - public String keepGroupId_DeriveSubQuery_UserInfoList(UserInfoCQ subQuery) { - if (_groupId_DeriveSubQuery_UserInfoListMap == null) { - _groupId_DeriveSubQuery_UserInfoListMap = newLinkedHashMap(); + public String keepGroupId_DerivedReferrer_UserInfoList(UserInfoCQ subQuery) { + if (_groupId_DerivedReferrer_UserInfoListMap == null) { + _groupId_DerivedReferrer_UserInfoListMap = newLinkedHashMap(); } String key = "subQueryMapKey" - + (_groupId_DeriveSubQuery_UserInfoListMap.size() + 1); - _groupId_DeriveSubQuery_UserInfoListMap.put(key, subQuery); - return "groupId_DeriveSubQuery_UserInfoList." + key; + + (_groupId_DerivedReferrer_UserInfoListMap.size() + 1); + _groupId_DerivedReferrer_UserInfoListMap.put(key, subQuery); + return "groupId_DerivedReferrer_UserInfoList." + key; } public BsGroupInfoCQ addOrderBy_GroupId_Asc() { @@ -564,7 +564,30 @@ // ========= // Foreign Query // ============= + //========================================================================== + // ========= + // Derived Query + // ============= + protected Map _scalarSubQueryMap; + public Map getScalarSubQuery() { + return _scalarSubQueryMap; + } + + public String keepScalarSubQuery(GroupInfoCQ subQuery) { + if (_scalarSubQueryMap == null) { + _scalarSubQueryMap = newLinkedHashMap(); + } + String key = "subQueryMapKey" + (_scalarSubQueryMap.size() + 1); + _scalarSubQueryMap.put(key, subQuery); + return "scalarSubQuery." + key; + } + + // Very Internal (for Suppressing Warn about 'Not Use Import') + protected String getConditionBeanClassNameInternally() { + return GroupInfoCB.class.getName(); + } + protected String getConditionQueryClassNameInternally() { return GroupInfoCQ.class.getName(); } Modified: addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/cbean/cq/bs/BsGroupMappingCQ.java =================================================================== --- addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/cbean/cq/bs/BsGroupMappingCQ.java 2008-12-27 22:02:56 UTC (rev 1623) +++ addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/cbean/cq/bs/BsGroupMappingCQ.java 2008-12-27 22:06:42 UTC (rev 1624) @@ -5,6 +5,7 @@ import jp.sf.pal.addresslist.db.allcommon.cbean.ConditionQuery; import jp.sf.pal.addresslist.db.allcommon.cbean.cvalue.ConditionValue; import jp.sf.pal.addresslist.db.allcommon.cbean.sqlclause.SqlClause; +import jp.sf.pal.addresslist.db.cbean.GroupMappingCB; import jp.sf.pal.addresslist.db.cbean.cq.GroupInfoCQ; import jp.sf.pal.addresslist.db.cbean.cq.GroupMappingCQ; import jp.sf.pal.addresslist.db.cbean.cq.UserInfoCQ; @@ -15,7 +16,6 @@ * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public class BsGroupMappingCQ extends AbstractBsGroupMappingCQ { //========================================================================== @@ -61,7 +61,7 @@ public GroupMappingCIQ on() { if (isBaseQuery(this)) { throw new UnsupportedOperationException( - "Unsupported onClause of Base Table!"); + "Unsupported on-clause for local table!"); } GroupMappingCIQ inlineQuery = inline(); inlineQuery.xsetOnClauseInline(true); @@ -210,7 +210,6 @@ // ========= // Foreign Query // ============= - public GroupInfoCQ queryGroupInfo() { return getConditionQueryGroupInfo(); } @@ -219,20 +218,13 @@ public GroupInfoCQ getConditionQueryGroupInfo() { if (_conditionQueryGroupInfo == null) { - _conditionQueryGroupInfo = createQueryGroupInfo(); - setupOuterJoin_GroupInfo(); + _conditionQueryGroupInfo = xcreateQueryGroupInfo(); + xsetupOuterJoinGroupInfo(); } return _conditionQueryGroupInfo; } - protected void setupOuterJoin_GroupInfo() { - Map joinOnMap = newLinkedHashMap(); - joinOnMap.put(getRealColumnName("GROUP_ID"), - getConditionQueryGroupInfo().getRealColumnName("GROUP_ID")); - registerOuterJoin(getConditionQueryGroupInfo(), joinOnMap); - } - - protected GroupInfoCQ createQueryGroupInfo() { + protected GroupInfoCQ xcreateQueryGroupInfo() { String nrp = resolveNextRelationPath("GROUP_MAPPING", "groupInfo"); String jan = resolveJoinAliasName(nrp, getNextNestLevel()); GroupInfoCQ cq = new GroupInfoCQ(this, getSqlClause(), jan, @@ -242,6 +234,14 @@ return cq; } + protected void xsetupOuterJoinGroupInfo() { + GroupInfoCQ cq = getConditionQueryGroupInfo(); + Map joinOnMap = newLinkedHashMap(); + joinOnMap.put(getRealColumnName("GROUP_ID"), cq + .getRealColumnName("GROUP_ID")); + registerOuterJoin(cq, joinOnMap); + } + public boolean hasConditionQueryGroupInfo() { return _conditionQueryGroupInfo != null; } @@ -254,20 +254,13 @@ public UserInfoCQ getConditionQueryUserInfo() { if (_conditionQueryUserInfo == null) { - _conditionQueryUserInfo = createQueryUserInfo(); - setupOuterJoin_UserInfo(); + _conditionQueryUserInfo = xcreateQueryUserInfo(); + xsetupOuterJoinUserInfo(); } return _conditionQueryUserInfo; } - protected void setupOuterJoin_UserInfo() { - Map joinOnMap = newLinkedHashMap(); - joinOnMap.put(getRealColumnName("USER_ID"), getConditionQueryUserInfo() - .getRealColumnName("USER_ID")); - registerOuterJoin(getConditionQueryUserInfo(), joinOnMap); - } - - protected UserInfoCQ createQueryUserInfo() { + protected UserInfoCQ xcreateQueryUserInfo() { String nrp = resolveNextRelationPath("GROUP_MAPPING", "userInfo"); String jan = resolveJoinAliasName(nrp, getNextNestLevel()); UserInfoCQ cq = new UserInfoCQ(this, getSqlClause(), jan, @@ -277,10 +270,42 @@ return cq; } + protected void xsetupOuterJoinUserInfo() { + UserInfoCQ cq = getConditionQueryUserInfo(); + Map joinOnMap = newLinkedHashMap(); + joinOnMap.put(getRealColumnName("USER_ID"), cq + .getRealColumnName("USER_ID")); + registerOuterJoin(cq, joinOnMap); + } + public boolean hasConditionQueryUserInfo() { return _conditionQueryUserInfo != null; } + //========================================================================== + // ========= + // Derived Query + // ============= + protected Map _scalarSubQueryMap; + + public Map getScalarSubQuery() { + return _scalarSubQueryMap; + } + + public String keepScalarSubQuery(GroupMappingCQ subQuery) { + if (_scalarSubQueryMap == null) { + _scalarSubQueryMap = newLinkedHashMap(); + } + String key = "subQueryMapKey" + (_scalarSubQueryMap.size() + 1); + _scalarSubQueryMap.put(key, subQuery); + return "scalarSubQuery." + key; + } + + // Very Internal (for Suppressing Warn about 'Not Use Import') + protected String getConditionBeanClassNameInternally() { + return GroupMappingCB.class.getName(); + } + protected String getConditionQueryClassNameInternally() { return GroupMappingCQ.class.getName(); } Modified: addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/cbean/cq/bs/BsPersonCQ.java =================================================================== --- addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/cbean/cq/bs/BsPersonCQ.java 2008-12-27 22:02:56 UTC (rev 1623) +++ addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/cbean/cq/bs/BsPersonCQ.java 2008-12-27 22:06:42 UTC (rev 1624) @@ -5,6 +5,7 @@ import jp.sf.pal.addresslist.db.allcommon.cbean.ConditionQuery; import jp.sf.pal.addresslist.db.allcommon.cbean.cvalue.ConditionValue; import jp.sf.pal.addresslist.db.allcommon.cbean.sqlclause.SqlClause; +import jp.sf.pal.addresslist.db.cbean.PersonCB; import jp.sf.pal.addresslist.db.cbean.cq.CompanyCQ; import jp.sf.pal.addresslist.db.cbean.cq.ContactCQ; import jp.sf.pal.addresslist.db.cbean.cq.CustomCQ; @@ -18,7 +19,6 @@ * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public class BsPersonCQ extends AbstractBsPersonCQ { //========================================================================== @@ -64,7 +64,7 @@ public PersonCIQ on() { if (isBaseQuery(this)) { throw new UnsupportedOperationException( - "Unsupported onClause of Base Table!"); + "Unsupported on-clause for local table!"); } PersonCIQ inlineQuery = inline(); inlineQuery.xsetOnClauseInline(true); @@ -281,36 +281,36 @@ return "id_NotExistsSubQuery_PostalAsOne." + key; } - protected Map _id_DeriveSubQuery_ContactListMap; + protected Map _id_DerivedReferrer_ContactListMap; - public Map getId_DeriveSubQuery_ContactList() { - return _id_DeriveSubQuery_ContactListMap; + public Map getId_DerivedReferrer_ContactList() { + return _id_DerivedReferrer_ContactListMap; } - public String keepId_DeriveSubQuery_ContactList(ContactCQ subQuery) { - if (_id_DeriveSubQuery_ContactListMap == null) { - _id_DeriveSubQuery_ContactListMap = newLinkedHashMap(); + public String keepId_DerivedReferrer_ContactList(ContactCQ subQuery) { + if (_id_DerivedReferrer_ContactListMap == null) { + _id_DerivedReferrer_ContactListMap = newLinkedHashMap(); } String key = "subQueryMapKey" - + (_id_DeriveSubQuery_ContactListMap.size() + 1); - _id_DeriveSubQuery_ContactListMap.put(key, subQuery); - return "id_DeriveSubQuery_ContactList." + key; + + (_id_DerivedReferrer_ContactListMap.size() + 1); + _id_DerivedReferrer_ContactListMap.put(key, subQuery); + return "id_DerivedReferrer_ContactList." + key; } - protected Map _id_DeriveSubQuery_CustomListMap; + protected Map _id_DerivedReferrer_CustomListMap; - public Map getId_DeriveSubQuery_CustomList() { - return _id_DeriveSubQuery_CustomListMap; + public Map getId_DerivedReferrer_CustomList() { + return _id_DerivedReferrer_CustomListMap; } - public String keepId_DeriveSubQuery_CustomList(CustomCQ subQuery) { - if (_id_DeriveSubQuery_CustomListMap == null) { - _id_DeriveSubQuery_CustomListMap = newLinkedHashMap(); + public String keepId_DerivedReferrer_CustomList(CustomCQ subQuery) { + if (_id_DerivedReferrer_CustomListMap == null) { + _id_DerivedReferrer_CustomListMap = newLinkedHashMap(); } String key = "subQueryMapKey" - + (_id_DeriveSubQuery_CustomListMap.size() + 1); - _id_DeriveSubQuery_CustomListMap.put(key, subQuery); - return "id_DeriveSubQuery_CustomList." + key; + + (_id_DerivedReferrer_CustomListMap.size() + 1); + _id_DerivedReferrer_CustomListMap.put(key, subQuery); + return "id_DerivedReferrer_CustomList." + key; } public BsPersonCQ addOrderBy_Id_Asc() { @@ -833,7 +833,6 @@ // ========= // Foreign Query // ============= - public CompanyCQ queryCompany() { return getConditionQueryCompany(); } @@ -842,20 +841,13 @@ public CompanyCQ getConditionQueryCompany() { if (_conditionQueryCompany == null) { - _conditionQueryCompany = createQueryCompany(); - setupOuterJoin_Company(); + _conditionQueryCompany = xcreateQueryCompany(); + xsetupOuterJoinCompany(); } return _conditionQueryCompany; } - protected void setupOuterJoin_Company() { - Map joinOnMap = newLinkedHashMap(); - joinOnMap.put(getRealColumnName("COMPANY_ID"), - getConditionQueryCompany().getRealColumnName("ID")); - registerOuterJoin(getConditionQueryCompany(), joinOnMap); - } - - protected CompanyCQ createQueryCompany() { + protected CompanyCQ xcreateQueryCompany() { String nrp = resolveNextRelationPath("PERSON", "company"); String jan = resolveJoinAliasName(nrp, getNextNestLevel()); CompanyCQ cq = new CompanyCQ(this, getSqlClause(), jan, @@ -865,6 +857,14 @@ return cq; } + protected void xsetupOuterJoinCompany() { + CompanyCQ cq = getConditionQueryCompany(); + Map joinOnMap = newLinkedHashMap(); + joinOnMap.put(getRealColumnName("COMPANY_ID"), cq + .getRealColumnName("ID")); + registerOuterJoin(cq, joinOnMap); + } + public boolean hasConditionQueryCompany() { return _conditionQueryCompany != null; } @@ -877,20 +877,13 @@ public UserInfoCQ getConditionQueryUserInfo() { if (_conditionQueryUserInfo == null) { - _conditionQueryUserInfo = createQueryUserInfo(); - setupOuterJoin_UserInfo(); + _conditionQueryUserInfo = xcreateQueryUserInfo(); + xsetupOuterJoinUserInfo(); } return _conditionQueryUserInfo; } - protected void setupOuterJoin_UserInfo() { - Map joinOnMap = newLinkedHashMap(); - joinOnMap.put(getRealColumnName("USER_ID"), getConditionQueryUserInfo() - .getRealColumnName("USER_ID")); - registerOuterJoin(getConditionQueryUserInfo(), joinOnMap); - } - - protected UserInfoCQ createQueryUserInfo() { + protected UserInfoCQ xcreateQueryUserInfo() { String nrp = resolveNextRelationPath("PERSON", "userInfo"); String jan = resolveJoinAliasName(nrp, getNextNestLevel()); UserInfoCQ cq = new UserInfoCQ(this, getSqlClause(), jan, @@ -900,6 +893,14 @@ return cq; } + protected void xsetupOuterJoinUserInfo() { + UserInfoCQ cq = getConditionQueryUserInfo(); + Map joinOnMap = newLinkedHashMap(); + joinOnMap.put(getRealColumnName("USER_ID"), cq + .getRealColumnName("USER_ID")); + registerOuterJoin(cq, joinOnMap); + } + public boolean hasConditionQueryUserInfo() { return _conditionQueryUserInfo != null; } @@ -912,20 +913,13 @@ public PostalCQ getConditionQueryPostalAsOne() { if (_conditionQueryPostalAsOne == null) { - _conditionQueryPostalAsOne = createQueryPostalAsOne(); - setupOuterJoin_PostalAsOne(); + _conditionQueryPostalAsOne = xcreateQueryPostalAsOne(); + xsetupOuterJoinPostalAsOne(); } return _conditionQueryPostalAsOne; } - protected void setupOuterJoin_PostalAsOne() { - Map joinOnMap = newLinkedHashMap(); - joinOnMap.put(getRealColumnName("ID"), getConditionQueryPostalAsOne() - .getRealColumnName("PERSON_ID")); - registerOuterJoin(getConditionQueryPostalAsOne(), joinOnMap); - } - - protected PostalCQ createQueryPostalAsOne() { + protected PostalCQ xcreateQueryPostalAsOne() { String nrp = resolveNextRelationPath("PERSON", "postalAsOne"); String jan = resolveJoinAliasName(nrp, getNextNestLevel()); PostalCQ cq = new PostalCQ(this, getSqlClause(), jan, @@ -935,10 +929,42 @@ return cq; } + protected void xsetupOuterJoinPostalAsOne() { + PostalCQ cq = getConditionQueryPostalAsOne(); + Map joinOnMap = newLinkedHashMap(); + joinOnMap.put(getRealColumnName("ID"), cq + .getRealColumnName("PERSON_ID")); + registerOuterJoin(cq, joinOnMap); + } + public boolean hasConditionQueryPostalAsOne() { return _conditionQueryPostalAsOne != null; } + //========================================================================== + // ========= + // Derived Query + // ============= + protected Map _scalarSubQueryMap; + + public Map getScalarSubQuery() { + return _scalarSubQueryMap; + } + + public String keepScalarSubQuery(PersonCQ subQuery) { + if (_scalarSubQueryMap == null) { + _scalarSubQueryMap = newLinkedHashMap(); + } + String key = "subQueryMapKey" + (_scalarSubQueryMap.size() + 1); + _scalarSubQueryMap.put(key, subQuery); + return "scalarSubQuery." + key; + } + + // Very Internal (for Suppressing Warn about 'Not Use Import') + protected String getConditionBeanClassNameInternally() { + return PersonCB.class.getName(); + } + protected String getConditionQueryClassNameInternally() { return PersonCQ.class.getName(); } Modified: addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/cbean/cq/bs/BsPostalCQ.java =================================================================== --- addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/cbean/cq/bs/BsPostalCQ.java 2008-12-27 22:02:56 UTC (rev 1623) +++ addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/cbean/cq/bs/BsPostalCQ.java 2008-12-27 22:06:42 UTC (rev 1624) @@ -5,6 +5,7 @@ import jp.sf.pal.addresslist.db.allcommon.cbean.ConditionQuery; import jp.sf.pal.addresslist.db.allcommon.cbean.cvalue.ConditionValue; import jp.sf.pal.addresslist.db.allcommon.cbean.sqlclause.SqlClause; +import jp.sf.pal.addresslist.db.cbean.PostalCB; import jp.sf.pal.addresslist.db.cbean.cq.PersonCQ; import jp.sf.pal.addresslist.db.cbean.cq.PostalCQ; import jp.sf.pal.addresslist.db.cbean.cq.ciq.PostalCIQ; @@ -14,7 +15,6 @@ * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public class BsPostalCQ extends AbstractBsPostalCQ { //========================================================================== @@ -60,7 +60,7 @@ public PostalCIQ on() { if (isBaseQuery(this)) { throw new UnsupportedOperationException( - "Unsupported onClause of Base Table!"); + "Unsupported on-clause for local table!"); } PostalCIQ inlineQuery = inline(); inlineQuery.xsetOnClauseInline(true); @@ -281,7 +281,6 @@ // ========= // Foreign Query // ============= - public PersonCQ queryPerson() { return getConditionQueryPerson(); } @@ -290,20 +289,13 @@ public PersonCQ getConditionQueryPerson() { if (_conditionQueryPerson == null) { - _conditionQueryPerson = createQueryPerson(); - setupOuterJoin_Person(); + _conditionQueryPerson = xcreateQueryPerson(); + xsetupOuterJoinPerson(); } return _conditionQueryPerson; } - protected void setupOuterJoin_Person() { - Map joinOnMap = newLinkedHashMap(); - joinOnMap.put(getRealColumnName("PERSON_ID"), getConditionQueryPerson() - .getRealColumnName("ID")); - registerOuterJoin(getConditionQueryPerson(), joinOnMap); - } - - protected PersonCQ createQueryPerson() { + protected PersonCQ xcreateQueryPerson() { String nrp = resolveNextRelationPath("POSTAL", "person"); String jan = resolveJoinAliasName(nrp, getNextNestLevel()); PersonCQ cq = new PersonCQ(this, getSqlClause(), jan, @@ -313,10 +305,42 @@ return cq; } + protected void xsetupOuterJoinPerson() { + PersonCQ cq = getConditionQueryPerson(); + Map joinOnMap = newLinkedHashMap(); + joinOnMap.put(getRealColumnName("PERSON_ID"), cq + .getRealColumnName("ID")); + registerOuterJoin(cq, joinOnMap); + } + public boolean hasConditionQueryPerson() { return _conditionQueryPerson != null; } + //========================================================================== + // ========= + // Derived Query + // ============= + protected Map _scalarSubQueryMap; + + public Map getScalarSubQuery() { + return _scalarSubQueryMap; + } + + public String keepScalarSubQuery(PostalCQ subQuery) { + if (_scalarSubQueryMap == null) { + _scalarSubQueryMap = newLinkedHashMap(); + } + String key = "subQueryMapKey" + (_scalarSubQueryMap.size() + 1); + _scalarSubQueryMap.put(key, subQuery); + return "scalarSubQuery." + key; + } + + // Very Internal (for Suppressing Warn about 'Not Use Import') + protected String getConditionBeanClassNameInternally() { + return PostalCB.class.getName(); + } + protected String getConditionQueryClassNameInternally() { return PostalCQ.class.getName(); } Modified: addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/cbean/cq/bs/BsRoleInfoCQ.java =================================================================== --- addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/cbean/cq/bs/BsRoleInfoCQ.java 2008-12-27 22:02:56 UTC (rev 1623) +++ addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/cbean/cq/bs/BsRoleInfoCQ.java 2008-12-27 22:06:42 UTC (rev 1624) @@ -5,6 +5,7 @@ import jp.sf.pal.addresslist.db.allcommon.cbean.ConditionQuery; import jp.sf.pal.addresslist.db.allcommon.cbean.cvalue.ConditionValue; import jp.sf.pal.addresslist.db.allcommon.cbean.sqlclause.SqlClause; +import jp.sf.pal.addresslist.db.cbean.RoleInfoCB; import jp.sf.pal.addresslist.db.cbean.cq.RoleInfoCQ; import jp.sf.pal.addresslist.db.cbean.cq.RoleMappingCQ; import jp.sf.pal.addresslist.db.cbean.cq.UserInfoCQ; @@ -15,7 +16,6 @@ * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public class BsRoleInfoCQ extends AbstractBsRoleInfoCQ { //========================================================================== @@ -61,7 +61,7 @@ public RoleInfoCIQ on() { if (isBaseQuery(this)) { throw new UnsupportedOperationException( - "Unsupported onClause of Base Table!"); + "Unsupported on-clause for local table!"); } RoleInfoCIQ inlineQuery = inline(); inlineQuery.xsetOnClauseInline(true); @@ -218,37 +218,37 @@ return "roleId_NotExistsSubQuery_UserInfoList." + key; } - protected Map _roleId_DeriveSubQuery_RoleMappingListMap; + protected Map _roleId_DerivedReferrer_RoleMappingListMap; - public Map getRoleId_DeriveSubQuery_RoleMappingList() { - return _roleId_DeriveSubQuery_RoleMappingListMap; + public Map getRoleId_DerivedReferrer_RoleMappingList() { + return _roleId_DerivedReferrer_RoleMappingListMap; } - public String keepRoleId_DeriveSubQuery_RoleMappingList( + public String keepRoleId_DerivedReferrer_RoleMappingList( RoleMappingCQ subQuery) { - if (_roleId_DeriveSubQuery_RoleMappingListMap == null) { - _roleId_DeriveSubQuery_RoleMappingListMap = newLinkedHashMap(); + if (_roleId_DerivedReferrer_RoleMappingListMap == null) { + _roleId_DerivedReferrer_RoleMappingListMap = newLinkedHashMap(); } String key = "subQueryMapKey" - + (_roleId_DeriveSubQuery_RoleMappingListMap.size() + 1); - _roleId_DeriveSubQuery_RoleMappingListMap.put(key, subQuery); - return "roleId_DeriveSubQuery_RoleMappingList." + key; + + (_roleId_DerivedReferrer_RoleMappingListMap.size() + 1); + _roleId_DerivedReferrer_RoleMappingListMap.put(key, subQuery); + return "roleId_DerivedReferrer_RoleMappingList." + key; } - protected Map _roleId_DeriveSubQuery_UserInfoListMap; + protected Map _roleId_DerivedReferrer_UserInfoListMap; - public Map getRoleId_DeriveSubQuery_UserInfoList() { - return _roleId_DeriveSubQuery_UserInfoListMap; + public Map getRoleId_DerivedReferrer_UserInfoList() { + return _roleId_DerivedReferrer_UserInfoListMap; } - public String keepRoleId_DeriveSubQuery_UserInfoList(UserInfoCQ subQuery) { - if (_roleId_DeriveSubQuery_UserInfoListMap == null) { - _roleId_DeriveSubQuery_UserInfoListMap = newLinkedHashMap(); + public String keepRoleId_DerivedReferrer_UserInfoList(UserInfoCQ subQuery) { + if (_roleId_DerivedReferrer_UserInfoListMap == null) { + _roleId_DerivedReferrer_UserInfoListMap = newLinkedHashMap(); } String key = "subQueryMapKey" - + (_roleId_DeriveSubQuery_UserInfoListMap.size() + 1); - _roleId_DeriveSubQuery_UserInfoListMap.put(key, subQuery); - return "roleId_DeriveSubQuery_UserInfoList." + key; + + (_roleId_DerivedReferrer_UserInfoListMap.size() + 1); + _roleId_DerivedReferrer_UserInfoListMap.put(key, subQuery); + return "roleId_DerivedReferrer_UserInfoList." + key; } public BsRoleInfoCQ addOrderBy_RoleId_Asc() { @@ -563,7 +563,30 @@ // ========= // Foreign Query // ============= + //========================================================================== + // ========= + // Derived Query + // ============= + protected Map _scalarSubQueryMap; + public Map getScalarSubQuery() { + return _scalarSubQueryMap; + } + + public String keepScalarSubQuery(RoleInfoCQ subQuery) { + if (_scalarSubQueryMap == null) { + _scalarSubQueryMap = newLinkedHashMap(); + } + String key = "subQueryMapKey" + (_scalarSubQueryMap.size() + 1); + _scalarSubQueryMap.put(key, subQuery); + return "scalarSubQuery." + key; + } + + // Very Internal (for Suppressing Warn about 'Not Use Import') + protected String getConditionBeanClassNameInternally() { + return RoleInfoCB.class.getName(); + } + protected String getConditionQueryClassNameInternally() { return RoleInfoCQ.class.getName(); } Modified: addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/cbean/cq/bs/BsRoleMappingCQ.java =================================================================== --- addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/cbean/cq/bs/BsRoleMappingCQ.java 2008-12-27 22:02:56 UTC (rev 1623) +++ addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/cbean/cq/bs/BsRoleMappingCQ.java 2008-12-27 22:06:42 UTC (rev 1624) @@ -5,6 +5,7 @@ import jp.sf.pal.addresslist.db.allcommon.cbean.ConditionQuery; import jp.sf.pal.addresslist.db.allcommon.cbean.cvalue.ConditionValue; import jp.sf.pal.addresslist.db.allcommon.cbean.sqlclause.SqlClause; +import jp.sf.pal.addresslist.db.cbean.RoleMappingCB; import jp.sf.pal.addresslist.db.cbean.cq.RoleInfoCQ; import jp.sf.pal.addresslist.db.cbean.cq.RoleMappingCQ; import jp.sf.pal.addresslist.db.cbean.cq.UserInfoCQ; @@ -15,7 +16,6 @@ * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public class BsRoleMappingCQ extends AbstractBsRoleMappingCQ { //========================================================================== @@ -61,7 +61,7 @@ public RoleMappingCIQ on() { if (isBaseQuery(this)) { throw new UnsupportedOperationException( - "Unsupported onClause of Base Table!"); + "Unsupported on-clause for local table!"); } RoleMappingCIQ inlineQuery = inline(); inlineQuery.xsetOnClauseInline(true); @@ -210,7 +210,6 @@ // ========= // Foreign Query // ============= - public RoleInfoCQ queryRoleInfo() { return getConditionQueryRoleInfo(); } @@ -219,20 +218,13 @@ public RoleInfoCQ getConditionQueryRoleInfo() { if (_conditionQueryRoleInfo == null) { - _conditionQueryRoleInfo = createQueryRoleInfo(); - setupOuterJoin_RoleInfo(); + _conditionQueryRoleInfo = xcreateQueryRoleInfo(); + xsetupOuterJoinRoleInfo(); } return _conditionQueryRoleInfo; } - protected void setupOuterJoin_RoleInfo() { - Map joinOnMap = newLinkedHashMap(); - joinOnMap.put(getRealColumnName("ROLE_ID"), getConditionQueryRoleInfo() - .getRealColumnName("ROLE_ID")); - registerOuterJoin(getConditionQueryRoleInfo(), joinOnMap); - } - - protected RoleInfoCQ createQueryRoleInfo() { + protected RoleInfoCQ xcreateQueryRoleInfo() { String nrp = resolveNextRelationPath("ROLE_MAPPING", "roleInfo"); String jan = resolveJoinAliasName(nrp, getNextNestLevel()); RoleInfoCQ cq = new RoleInfoCQ(this, getSqlClause(), jan, @@ -242,6 +234,14 @@ return cq; } + protected void xsetupOuterJoinRoleInfo() { + RoleInfoCQ cq = getConditionQueryRoleInfo(); + Map joinOnMap = newLinkedHashMap(); + joinOnMap.put(getRealColumnName("ROLE_ID"), cq + .getRealColumnName("ROLE_ID")); + registerOuterJoin(cq, joinOnMap); + } + public boolean hasConditionQueryRoleInfo() { return _conditionQueryRoleInfo != null; } @@ -254,20 +254,13 @@ public UserInfoCQ getConditionQueryUserInfo() { if (_conditionQueryUserInfo == null) { - _conditionQueryUserInfo = createQueryUserInfo(); - setupOuterJoin_UserInfo(); + _conditionQueryUserInfo = xcreateQueryUserInfo(); + xsetupOuterJoinUserInfo(); } return _conditionQueryUserInfo; } - protected void setupOuterJoin_UserInfo() { - Map joinOnMap = newLinkedHashMap(); - joinOnMap.put(getRealColumnName("USER_ID"), getConditionQueryUserInfo() - .getRealColumnName("USER_ID")); - registerOuterJoin(getConditionQueryUserInfo(), joinOnMap); - } - - protected UserInfoCQ createQueryUserInfo() { + protected UserInfoCQ xcreateQueryUserInfo() { String nrp = resolveNextRelationPath("ROLE_MAPPING", "userInfo"); String jan = resolveJoinAliasName(nrp, getNextNestLevel()); UserInfoCQ cq = new UserInfoCQ(this, getSqlClause(), jan, @@ -277,10 +270,42 @@ return cq; } + protected void xsetupOuterJoinUserInfo() { + UserInfoCQ cq = getConditionQueryUserInfo(); + Map joinOnMap = newLinkedHashMap(); + joinOnMap.put(getRealColumnName("USER_ID"), cq + .getRealColumnName("USER_ID")); + registerOuterJoin(cq, joinOnMap); + } + public boolean hasConditionQueryUserInfo() { return _conditionQueryUserInfo != null; } + //========================================================================== + // ========= + // Derived Query + // ============= + protected Map _scalarSubQueryMap; + + public Map getScalarSubQuery() { + return _scalarSubQueryMap; + } + + public String keepScalarSubQuery(RoleMappingCQ subQuery) { + if (_scalarSubQueryMap == null) { + _scalarSubQueryMap = newLinkedHashMap(); + } + String key = "subQueryMapKey" + (_scalarSubQueryMap.size() + 1); + _scalarSubQueryMap.put(key, subQuery); + return "scalarSubQuery." + key; + } + + // Very Internal (for Suppressing Warn about 'Not Use Import') + protected String getConditionBeanClassNameInternally() { + return RoleMappingCB.class.getName(); + } + protected String getConditionQueryClassNameInternally() { return RoleMappingCQ.class.getName(); } Modified: addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/cbean/cq/bs/BsUserInfoCQ.java =================================================================== --- addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/cbean/cq/bs/BsUserInfoCQ.java 2008-12-27 22:02:56 UTC (rev 1623) +++ addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/cbean/cq/bs/BsUserInfoCQ.java 2008-12-27 22:06:42 UTC (rev 1624) @@ -5,6 +5,7 @@ import jp.sf.pal.addresslist.db.allcommon.cbean.ConditionQuery; import jp.sf.pal.addresslist.db.allcommon.cbean.cvalue.ConditionValue; import jp.sf.pal.addresslist.db.allcommon.cbean.sqlclause.SqlClause; +import jp.sf.pal.addresslist.db.cbean.UserInfoCB; import jp.sf.pal.addresslist.db.cbean.cq.CompanyCQ; import jp.sf.pal.addresslist.db.cbean.cq.GroupInfoCQ; import jp.sf.pal.addresslist.db.cbean.cq.GroupMappingCQ; @@ -19,7 +20,6 @@ * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public class BsUserInfoCQ extends AbstractBsUserInfoCQ { //========================================================================== @@ -65,7 +65,7 @@ public UserInfoCIQ on() { if (isBaseQuery(this)) { throw new UnsupportedOperationException( - "Unsupported onClause of Base Table!"); + "Unsupported on-clause for local table!"); } UserInfoCIQ inlineQuery = inline(); inlineQuery.xsetOnClauseInline(true); @@ -354,70 +354,70 @@ return "userId_NotExistsSubQuery_RoleMappingList." + key; } - protected Map _userId_DeriveSubQuery_CompanyListMap; + protected Map _userId_DerivedReferrer_CompanyListMap; - public Map getUserId_DeriveSubQuery_CompanyList() { - return _userId_DeriveSubQuery_CompanyListMap; + public Map getUserId_DerivedReferrer_CompanyList() { + return _userId_DerivedReferrer_CompanyListMap; } - public String keepUserId_DeriveSubQuery_CompanyList(CompanyCQ subQuery) { - if (_userId_DeriveSubQuery_CompanyListMap == null) { - _userId_DeriveSubQuery_CompanyListMap = newLinkedHashMap(); + public String keepUserId_DerivedReferrer_CompanyList(CompanyCQ subQuery) { + if (_userId_DerivedReferrer_CompanyListMap == null) { + _userId_DerivedReferrer_CompanyListMap = newLinkedHashMap(); } String key = "subQueryMapKey" - + (_userId_DeriveSubQuery_CompanyListMap.size() + 1); - _userId_DeriveSubQuery_CompanyListMap.put(key, subQuery); - return "userId_DeriveSubQuery_CompanyList." + key; + + (_userId_DerivedReferrer_CompanyListMap.size() + 1); + _userId_DerivedReferrer_CompanyListMap.put(key, subQuery); + return "userId_DerivedReferrer_CompanyList." + key; } - protected Map _userId_DeriveSubQuery_GroupMappingListMap; + protected Map _userId_DerivedReferrer_GroupMappingListMap; - public Map getUserId_DeriveSubQuery_GroupMappingList() { - return _userId_DeriveSubQuery_GroupMappingListMap; + public Map getUserId_DerivedReferrer_GroupMappingList() { + return _userId_DerivedReferrer_GroupMappingListMap; } - public String keepUserId_DeriveSubQuery_GroupMappingList( + public String keepUserId_DerivedReferrer_GroupMappingList( GroupMappingCQ subQuery) { - if (_userId_DeriveSubQuery_GroupMappingListMap == null) { - _userId_DeriveSubQuery_GroupMappingListMap = newLinkedHashMap(); + if (_userId_DerivedReferrer_GroupMappingListMap == null) { + _userId_DerivedReferrer_GroupMappingListMap = newLinkedHashMap(); } String key = "subQueryMapKey" - + (_userId_DeriveSubQuery_GroupMappingListMap.size() + 1); - _userId_DeriveSubQuery_GroupMappingListMap.put(key, subQuery); - return "userId_DeriveSubQuery_GroupMappingList." + key; + + (_userId_DerivedReferrer_GroupMappingListMap.size() + 1); + _userId_DerivedReferrer_GroupMappingListMap.put(key, subQuery); + return "userId_DerivedReferrer_GroupMappingList." + key; } - protected Map _userId_DeriveSubQuery_PersonListMap; + protected Map _userId_DerivedReferrer_PersonListMap; - public Map getUserId_DeriveSubQuery_PersonList() { - return _userId_DeriveSubQuery_PersonListMap; + public Map getUserId_DerivedReferrer_PersonList() { + return _userId_DerivedReferrer_PersonListMap; } - public String keepUserId_DeriveSubQuery_PersonList(PersonCQ subQuery) { - if (_userId_DeriveSubQuery_PersonListMap == null) { - _userId_DeriveSubQuery_PersonListMap = newLinkedHashMap(); + public String keepUserId_DerivedReferrer_PersonList(PersonCQ subQuery) { + if (_userId_DerivedReferrer_PersonListMap == null) { + _userId_DerivedReferrer_PersonListMap = newLinkedHashMap(); } String key = "subQueryMapKey" - + (_userId_DeriveSubQuery_PersonListMap.size() + 1); - _userId_DeriveSubQuery_PersonListMap.put(key, subQuery); - return "userId_DeriveSubQuery_PersonList." + key; + + (_userId_DerivedReferrer_PersonListMap.size() + 1); + _userId_DerivedReferrer_PersonListMap.put(key, subQuery); + return "userId_DerivedReferrer_PersonList." + key; } - protected Map _userId_DeriveSubQuery_RoleMappingListMap; + protected Map _userId_DerivedReferrer_RoleMappingListMap; - public Map getUserId_DeriveSubQuery_RoleMappingList() { - return _userId_DeriveSubQuery_RoleMappingListMap; + public Map getUserId_DerivedReferrer_RoleMappingList() { + return _userId_DerivedReferrer_RoleMappingListMap; } - public String keepUserId_DeriveSubQuery_RoleMappingList( + public String keepUserId_DerivedReferrer_RoleMappingList( RoleMappingCQ subQuery) { - if (_userId_DeriveSubQuery_RoleMappingListMap == null) { - _userId_DeriveSubQuery_RoleMappingListMap = newLinkedHashMap(); + if (_userId_DerivedReferrer_RoleMappingListMap == null) { + _userId_DerivedReferrer_RoleMappingListMap = newLinkedHashMap(); } String key = "subQueryMapKey" - + (_userId_DeriveSubQuery_RoleMappingListMap.size() + 1); - _userId_DeriveSubQuery_RoleMappingListMap.put(key, subQuery); - return "userId_DeriveSubQuery_RoleMappingList." + key; + + (_userId_DerivedReferrer_RoleMappingListMap.size() + 1); + _userId_DerivedReferrer_RoleMappingListMap.put(key, subQuery); + return "userId_DerivedReferrer_RoleMappingList." + key; } public BsUserInfoCQ addOrderBy_UserId_Asc() { @@ -784,6 +784,29 @@ return this; } + protected ConditionValue _status; + + public ConditionValue getStatus() { + if (_status == null) { + _status = new ConditionValue(); + } + return _status; + } + + protected ConditionValue getCValueStatus() { + return getStatus(); + } + + public BsUserInfoCQ addOrderBy_Status_Asc() { + regOBA("STATUS"); + return this; + } + + public BsUserInfoCQ addOrderBy_Status_Desc() { + regOBD("STATUS"); + return this; + } + protected ConditionValue _createdTime; public ConditionValue getCreatedTime() { @@ -981,7 +1004,6 @@ // ========= // Foreign Query // ============= - public GroupInfoCQ queryGroupInfo() { return getConditionQueryGroupInfo(); } @@ -990,20 +1012,13 @@ public GroupInfoCQ getConditionQueryGroupInfo() { if (_conditionQueryGroupInfo == null) { - _conditionQueryGroupInfo = createQueryGroupInfo(); - setupOuterJoin_GroupInfo(); + _conditionQueryGroupInfo = xcreateQueryGroupInfo(); + xsetupOuterJoinGroupInfo(); } return _conditionQueryGroupInfo; } - protected void setupOuterJoin_GroupInfo() { - Map joinOnMap = newLinkedHashMap(); - joinOnMap.put(getRealColumnName("GROUP_ID"), - getConditionQueryGroupInfo().getRealColumnName("GROUP_ID")); - registerOuterJoin(getConditionQueryGroupInfo(), joinOnMap); - } - - protected GroupInfoCQ createQueryGroupInfo() { + protected GroupInfoCQ xcreateQueryGroupInfo() { String nrp = resolveNextRelationPath("USER_INFO", "groupInfo"); String jan = resolveJoinAliasName(nrp, getNextNestLevel()); GroupInfoCQ cq = new GroupInfoCQ(this, getSqlClause(), jan, @@ -1013,6 +1028,14 @@ return cq; } + protected void xsetupOuterJoinGroupInfo() { + GroupInfoCQ cq = getConditionQueryGroupInfo(); + Map joinOnMap = newLinkedHashMap(); + joinOnMap.put(getRealColumnName("GROUP_ID"), cq + .getRealColumnName("GROUP_ID")); + registerOuterJoin(cq, joinOnMap); + } + public boolean hasConditionQueryGroupInfo() { return _conditionQueryGroupInfo != null; } @@ -1025,20 +1048,13 @@ public RoleInfoCQ getConditionQueryRoleInfo() { if (_conditionQueryRoleInfo == null) { - _conditionQueryRoleInfo = createQueryRoleInfo(); - setupOuterJoin_RoleInfo(); + _conditionQueryRoleInfo = xcreateQueryRoleInfo(); + xsetupOuterJoinRoleInfo(); } return _conditionQueryRoleInfo; } - protected void setupOuterJoin_RoleInfo() { - Map joinOnMap = newLinkedHashMap(); - joinOnMap.put(getRealColumnName("ROLE_ID"), getConditionQueryRoleInfo() - .getRealColumnName("ROLE_ID")); - registerOuterJoin(getConditionQueryRoleInfo(), joinOnMap); - } - - protected RoleInfoCQ createQueryRoleInfo() { + protected RoleInfoCQ xcreateQueryRoleInfo() { String nrp = resolveNextRelationPath("USER_INFO", "roleInfo"); String jan = resolveJoinAliasName(nrp, getNextNestLevel()); RoleInfoCQ cq = new RoleInfoCQ(this, getSqlClause(), jan, @@ -1048,10 +1064,42 @@ return cq; } + protected void xsetupOuterJoinRoleInfo() { + RoleInfoCQ cq = getConditionQueryRoleInfo(); + Map joinOnMap = newLinkedHashMap(); + joinOnMap.put(getRealColumnName("ROLE_ID"), cq + .getRealColumnName("ROLE_ID")); + registerOuterJoin(cq, joinOnMap); + } + public boolean hasConditionQueryRoleInfo() { return _conditionQueryRoleInfo != null; } + //========================================================================== + // ========= + // Derived Query + // ============= + protected Map _scalarSubQueryMap; + + public Map getScalarSubQuery() { + return _scalarSubQueryMap; + } + + public String keepScalarSubQuery(UserInfoCQ subQuery) { + if (_scalarSubQueryMap == null) { + _scalarSubQueryMap = newLinkedHashMap(); + } + String key = "subQueryMapKey" + (_scalarSubQueryMap.size() + 1); + _scalarSubQueryMap.put(key, subQuery); + return "scalarSubQuery." + key; + } + + // Very Internal (for Suppressing Warn about 'Not Use Import') + protected String getConditionBeanClassNameInternally() { + return UserInfoCB.class.getName(); + } + protected String getConditionQueryClassNameInternally() { return UserInfoCQ.class.getName(); } Modified: addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/cbean/cq/ciq/CompanyCIQ.java =================================================================== --- addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/cbean/cq/ciq/CompanyCIQ.java 2008-12-27 22:02:56 UTC (rev 1623) +++ addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/cbean/cq/ciq/CompanyCIQ.java 2008-12-27 22:06:42 UTC (rev 1624) @@ -5,6 +5,7 @@ import jp.sf.pal.addresslist.db.allcommon.cbean.coption.ConditionOption; import jp.sf.pal.addresslist.db.allcommon.cbean.cvalue.ConditionValue; import jp.sf.pal.addresslist.db.allcommon.cbean.sqlclause.SqlClause; +import jp.sf.pal.addresslist.db.cbean.CompanyCB; import jp.sf.pal.addresslist.db.cbean.cq.CompanyCQ; import jp.sf.pal.addresslist.db.cbean.cq.PersonCQ; import jp.sf.pal.addresslist.db.cbean.cq.UserInfoCQ; @@ -16,7 +17,6 @@ * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public class CompanyCIQ extends AbstractBsCompanyCQ { //========================================================================== @@ -114,9 +114,9 @@ "NotExistsSubQuery at inline() is unsupported! Sorry!"); } - public String keepId_DeriveSubQuery_PersonList(PersonCQ subQuery) { + public String keepId_DerivedReferrer_PersonList(PersonCQ subQuery) { throw new UnsupportedOperationException( - "DeriveSubQuery at inline() is unsupported! Sorry!"); + "DerivedReferrer at inline() is unsupported! Sorry!"); } protected ConditionValue getCValueUserId() { @@ -215,6 +215,20 @@ return _myCQ.getVersionno(); } + //========================================================================== + // ========= + // Derived Query + // ============= + public String keepScalarSubQuery(CompanyCQ subQuery) { + throw new UnsupportedOperationException( + "ScalarSubQuery at inline() is unsupported! Sorry!"); + } + + // Very Internal (for Suppressing Warn about 'Not Use Import') + protected String getConditionBeanClassNameInternally() { + return CompanyCB.class.getName(); + } + protected String getConditionQueryClassNameInternally() { return CompanyCQ.class.getName(); } Modified: addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/cbean/cq/ciq/ContactCIQ.java =================================================================== --- addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/cbean/cq/ciq/ContactCIQ.java 2008-12-27 22:02:56 UTC (rev 1623) +++ addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/cbean/cq/ciq/ContactCIQ.java 2008-12-27 22:06:42 UTC (rev 1624) @@ -5,6 +5,7 @@ import jp.sf.pal.addresslist.db.allcommon.cbean.coption.ConditionOption; import jp.sf.pal.addresslist.db.allcommon.cbean.cvalue.ConditionValue; import jp.sf.pal.addresslist.db.allcommon.cbean.sqlclause.SqlClause; +import jp.sf.pal.addresslist.db.cbean.ContactCB; import jp.sf.pal.addresslist.db.cbean.cq.ContactCQ; import jp.sf.pal.addresslist.db.cbean.cq.PersonCQ; import jp.sf.pal.addresslist.db.cbean.cq.bs.AbstractBsContactCQ; @@ -15,7 +16,6 @@ * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public class ContactCIQ extends AbstractBsContactCQ { //========================================================================== @@ -111,6 +111,20 @@ return _myCQ.getValue(); } + //========================================================================== + // ========= + // Derived Query + // ============= + public String keepScalarSubQuery(ContactCQ subQuery) { + throw new UnsupportedOperationException( + "ScalarSubQuery at inline() is unsupported! Sorry!"); + } + + // Very Internal (for Suppressing Warn about 'Not Use Import') + protected String getConditionBeanClassNameInternally() { + return ContactCB.class.getName(); + } + protected String getConditionQueryClassNameInternally() { return ContactCQ.class.getName(); } Modified: addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/cbean/cq/ciq/CustomCIQ.java =================================================================== --- addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/cbean/cq/ciq/CustomCIQ.java 2008-12-27 22:02:56 UTC (rev 1623) +++ addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/cbean/cq/ciq/CustomCIQ.java 2008-12-27 22:06:42 UTC (rev 1624) @@ -5,6 +5,7 @@ import jp.sf.pal.addresslist.db.allcommon.cbean.coption.ConditionOption; import jp.sf.pal.addresslist.db.allcommon.cbean.cvalue.ConditionValue; import jp.sf.pal.addresslist.db.allcommon.cbean.sqlclause.SqlClause; +import jp.sf.pal.addresslist.db.cbean.CustomCB; import jp.sf.pal.addresslist.db.cbean.cq.CustomCQ; import jp.sf.pal.addresslist.db.cbean.cq.PersonCQ; import jp.sf.pal.addresslist.db.cbean.cq.bs.AbstractBsCustomCQ; @@ -15,7 +16,6 @@ * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public class CustomCIQ extends AbstractBsCustomCQ { //========================================================================== @@ -111,6 +111,20 @@ return _myCQ.getSortOrder(); } + //========================================================================== + // ========= + // Derived Query + // ============= + public String keepScalarSubQuery(CustomCQ subQuery) { + throw new UnsupportedOperationException( + "ScalarSubQuery at inline() is unsupported! Sorry!"); + } + + // Very Internal (for Suppressing Warn about 'Not Use Import') + protected String getConditionBeanClassNameInternally() { + return CustomCB.class.getName(); + } + protected String getConditionQueryClassNameInternally() { return CustomCQ.class.getName(); } Modified: addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/cbean/cq/ciq/GroupInfoCIQ.java =================================================================== --- addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/cbean/cq/ciq/GroupInfoCIQ.java 2008-12-27 22:02:56 UTC (rev 1623) +++ addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/cbean/cq/ciq/GroupInfoCIQ.java 2008-12-27 22:06:42 UTC (rev 1624) @@ -5,6 +5,7 @@ import jp.sf.pal.addresslist.db.allcommon.cbean.coption.ConditionOption; import jp.sf.pal.addresslist.db.allcommon.cbean.cvalue.ConditionValue; import jp.sf.pal.addresslist.db.allcommon.cbean.sqlclause.SqlClause; +import jp.sf.pal.addresslist.db.cbean.GroupInfoCB; import jp.sf.pal.addresslist.db.cbean.cq.GroupInfoCQ; import jp.sf.pal.addresslist.db.cbean.cq.GroupMappingCQ; import jp.sf.pal.addresslist.db.cbean.cq.UserInfoCQ; @@ -16,7 +17,6 @@ * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public class GroupInfoCIQ extends AbstractBsGroupInfoCQ { //========================================================================== @@ -137,15 +137,15 @@ "NotExistsSubQuery at inline() is unsupported! Sorry!"); } - public String keepGroupId_DeriveSubQuery_GroupMappingList( + public String keepGroupId_DerivedReferrer_GroupMappingList( GroupMappingCQ subQuery) { throw new UnsupportedOperationException( - "DeriveSubQuery at inline() is unsupported! Sorry!"); + "DerivedReferrer at inline() is unsupported! Sorry!"); } - public String keepGroupId_DeriveSubQuery_UserInfoList(UserInfoCQ subQuery) { + public String keepGroupId_DerivedReferrer_UserInfoList(UserInfoCQ subQuery) { throw new UnsupportedOperationException( - "DeriveSubQuery at inline() is unsupported! Sorry!"); + "DerivedReferrer at inline() is unsupported! Sorry!"); } protected ConditionValue getCValueName() { @@ -196,6 +196,20 @@ return _myCQ.getVersionno(); } + //========================================================================== + // ========= + // Derived Query + // ============= + public String keepScalarSubQuery(GroupInfoCQ subQuery) { + throw new UnsupportedOperationException( + "ScalarSubQuery at inline() is unsupported! Sorry!"); + } + + // Very Internal (for Suppressing Warn about 'Not Use Import') + protected String getConditionBeanClassNameInternally() { + return GroupInfoCB.class.getName(); + } + protected String getConditionQueryClassNameInternally() { return GroupInfoCQ.class.getName(); } Modified: addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/cbean/cq/ciq/GroupMappingCIQ.java =================================================================== --- addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/cbean/cq/ciq/GroupMappingCIQ.java 2008-12-27 22:02:56 UTC (rev 1623) +++ addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/cbean/cq/ciq/GroupMappingCIQ.java 2008-12-27 22:06:42 UTC (rev 1624) @@ -5,6 +5,7 @@ import jp.sf.pal.addresslist.db.allcommon.cbean.coption.ConditionOption; import jp.sf.pal.addresslist.db.allcommon.cbean.cvalue.ConditionValue; import jp.sf.pal.addresslist.db.allcommon.cbean.sqlclause.SqlClause; +import jp.sf.pal.addresslist.db.cbean.GroupMappingCB; import jp.sf.pal.addresslist.db.cbean.cq.GroupInfoCQ; import jp.sf.pal.addresslist.db.cbean.cq.GroupMappingCQ; import jp.sf.pal.addresslist.db.cbean.cq.UserInfoCQ; @@ -16,7 +17,6 @@ * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public class GroupMappingCIQ extends AbstractBsGroupMappingCQ { //========================================================================== @@ -112,6 +112,20 @@ return _myCQ.keepGroupId_InScopeSubQuery_GroupInfo(subQuery); } + //========================================================================== + // ========= + // Derived Query + // ============= + public String keepScalarSubQuery(GroupMappingCQ subQuery) { + throw new UnsupportedOperationException( + "ScalarSubQuery at inline() is unsupported! Sorry!"); + } + + // Very Internal (for Suppressing Warn about 'Not Use Import') + protected String getConditionBeanClassNameInternally() { + return GroupMappingCB.class.getName(); + } + protected String getConditionQueryClassNameInternally() { return GroupMappingCQ.class.getName(); } Modified: addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/cbean/cq/ciq/PersonCIQ.java =================================================================== --- addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/cbean/cq/ciq/PersonCIQ.java 2008-12-27 22:02:56 UTC (rev 1623) +++ addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/cbean/cq/ciq/PersonCIQ.java 2008-12-27 22:06:42 UTC (rev 1624) @@ -5,6 +5,7 @@ import jp.sf.pal.addresslist.db.allcommon.cbean.coption.ConditionOption; import jp.sf.pal.addresslist.db.allcommon.cbean.cvalue.ConditionValue; import jp.sf.pal.addresslist.db.allcommon.cbean.sqlclause.SqlClause; +import jp.sf.pal.addresslist.db.cbean.PersonCB; import jp.sf.pal.addresslist.db.cbean.cq.CompanyCQ; import jp.sf.pal.addresslist.db.cbean.cq.ContactCQ; import jp.sf.pal.addresslist.db.cbean.cq.CustomCQ; @@ -19,7 +20,6 @@ * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public class PersonCIQ extends AbstractBsPersonCQ { //========================================================================== @@ -153,14 +153,14 @@ "NotExistsSubQuery at inline() is unsupported! Sorry!"); } - public String keepId_DeriveSubQuery_ContactList(ContactCQ subQuery) { + public String keepId_DerivedReferrer_ContactList(ContactCQ subQuery) { throw new UnsupportedOperationException( - "DeriveSubQuery at inline() is unsupported! Sorry!"); + "DerivedReferrer at inline() is unsupported! Sorry!"); } - public String keepId_DeriveSubQuery_CustomList(CustomCQ subQuery) { + public String keepId_DerivedReferrer_CustomList(CustomCQ subQuery) { throw new UnsupportedOperationException( - "DeriveSubQuery at inline() is unsupported! Sorry!"); + "DerivedReferrer at inline() is unsupported! Sorry!"); } protected ConditionValue getCValueUserId() { @@ -247,6 +247,20 @@ return _myCQ.getVersionno(); } + //========================================================================== + // ========= + // Derived Query + // ============= + public String keepScalarSubQuery(PersonCQ subQuery) { + throw new UnsupportedOperationException( + "ScalarSubQuery at inline() is unsupported! Sorry!"); + } + + // Very Internal (for Suppressing Warn about 'Not Use Import') + protected String getConditionBeanClassNameInternally() { + return PersonCB.class.getName(); + } + protected String getConditionQueryClassNameInternally() { return PersonCQ.class.getName(); } Modified: addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/cbean/cq/ciq/PostalCIQ.java =================================================================== --- addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/cbean/cq/ciq/PostalCIQ.java 2008-12-27 22:02:56 UTC (rev 1623) +++ addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/cbean/cq/ciq/PostalCIQ.java 2008-12-27 22:06:42 UTC (rev 1624) @@ -5,6 +5,7 @@ import jp.sf.pal.addresslist.db.allcommon.cbean.coption.ConditionOption; import jp.sf.pal.addresslist.db.allcommon.cbean.cvalue.ConditionValue; import jp.sf.pal.addresslist.db.allcommon.cbean.sqlclause.SqlClause; +import jp.sf.pal.addresslist.db.cbean.PostalCB; import jp.sf.pal.addresslist.db.cbean.cq.PersonCQ; import jp.sf.pal.addresslist.db.cbean.cq.PostalCQ; import jp.sf.pal.addresslist.db.cbean.cq.bs.AbstractBsPostalCQ; @@ -15,7 +16,6 @@ * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public class PostalCIQ extends AbstractBsPostalCQ { //========================================================================== @@ -123,6 +123,20 @@ return _myCQ.getCountry(); } + //========================================================================== + // ========= + // Derived Query + // ============= + public String keepScalarSubQuery(PostalCQ subQuery) { + throw new UnsupportedOperationException( + "ScalarSubQuery at inline() is unsupported! Sorry!"); + } + + // Very Internal (for Suppressing Warn about 'Not Use Import') + protected String getConditionBeanClassNameInternally() { + return PostalCB.class.getName(); + } + protected String getConditionQueryClassNameInternally() { return PostalCQ.class.getName(); } Modified: addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/cbean/cq/ciq/RoleInfoCIQ.java =================================================================== --- addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/cbean/cq/ciq/RoleInfoCIQ.java 2008-12-27 22:02:56 UTC (rev 1623) +++ addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/cbean/cq/ciq/RoleInfoCIQ.java 2008-12-27 22:06:42 UTC (rev 1624) @@ -5,6 +5,7 @@ import jp.sf.pal.addresslist.db.allcommon.cbean.coption.ConditionOption; import jp.sf.pal.addresslist.db.allcommon.cbean.cvalue.ConditionValue; import jp.sf.pal.addresslist.db.allcommon.cbean.sqlclause.SqlClause; +import jp.sf.pal.addresslist.db.cbean.RoleInfoCB; import jp.sf.pal.addresslist.db.cbean.cq.RoleInfoCQ; import jp.sf.pal.addresslist.db.cbean.cq.RoleMappingCQ; import jp.sf.pal.addresslist.db.cbean.cq.UserInfoCQ; @@ -16,7 +17,6 @@ * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public class RoleInfoCIQ extends AbstractBsRoleInfoCQ { //========================================================================== @@ -136,15 +136,15 @@ "NotExistsSubQuery at inline() is unsupported! Sorry!"); } - public String keepRoleId_DeriveSubQuery_RoleMappingList( + public String keepRoleId_DerivedReferrer_RoleMappingList( RoleMappingCQ subQuery) { throw new UnsupportedOperationException( - "DeriveSubQuery at inline() is unsupported! Sorry!"); + "DerivedReferrer at inline() is unsupported! Sorry!"); } - public String keepRoleId_DeriveSubQuery_UserInfoList(UserInfoCQ subQuery) { + public String keepRoleId_DerivedReferrer_UserInfoList(UserInfoCQ subQuery) { throw new UnsupportedOperationException( - "DeriveSubQuery at inline() is unsupported! Sorry!"); + "DerivedReferrer at inline() is unsupported! Sorry!"); } protected ConditionValue getCValueName() { @@ -195,6 +195,20 @@ return _myCQ.getVersionno(); } + //========================================================================== + // ========= + // Derived Query + // ============= + public String keepScalarSubQuery(RoleInfoCQ subQuery) { + throw new UnsupportedOperationException( + "ScalarSubQuery at inline() is unsupported! Sorry!"); + } + + // Very Internal (for Suppressing Warn about 'Not Use Import') + protected String getConditionBeanClassNameInternally() { + return RoleInfoCB.class.getName(); + } + protected String getConditionQueryClassNameInternally() { return RoleInfoCQ.class.getName(); } Modified: addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/cbean/cq/ciq/RoleMappingCIQ.java =================================================================== --- addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/cbean/cq/ciq/RoleMappingCIQ.java 2008-12-27 22:02:56 UTC (rev 1623) +++ addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/cbean/cq/ciq/RoleMappingCIQ.java 2008-12-27 22:06:42 UTC (rev 1624) @@ -5,6 +5,7 @@ import jp.sf.pal.addresslist.db.allcommon.cbean.coption.ConditionOption; import jp.sf.pal.addresslist.db.allcommon.cbean.cvalue.ConditionValue; import jp.sf.pal.addresslist.db.allcommon.cbean.sqlclause.SqlClause; +import jp.sf.pal.addresslist.db.cbean.RoleMappingCB; import jp.sf.pal.addresslist.db.cbean.cq.RoleInfoCQ; import jp.sf.pal.addresslist.db.cbean.cq.RoleMappingCQ; import jp.sf.pal.addresslist.db.cbean.cq.UserInfoCQ; @@ -16,7 +17,6 @@ * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public class RoleMappingCIQ extends AbstractBsRoleMappingCQ { //========================================================================== @@ -112,6 +112,20 @@ return _myCQ.keepRoleId_InScopeSubQuery_RoleInfo(subQuery); } + //========================================================================== + // ========= + // Derived Query + // ============= + public String keepScalarSubQuery(RoleMappingCQ subQuery) { + throw new UnsupportedOperationException( + "ScalarSubQuery at inline() is unsupported! Sorry!"); + } + + // Very Internal (for Suppressing Warn about 'Not Use Import') + protected String getConditionBeanClassNameInternally() { + return RoleMappingCB.class.getName(); + } + protected String getConditionQueryClassNameInternally() { return RoleMappingCQ.class.getName(); } Modified: addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/cbean/cq/ciq/UserInfoCIQ.java =================================================================== --- addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/cbean/cq/ciq/UserInfoCIQ.java 2008-12-27 22:02:56 UTC (rev 1623) +++ addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/cbean/cq/ciq/UserInfoCIQ.java 2008-12-27 22:06:42 UTC (rev 1624) @@ -5,6 +5,7 @@ import jp.sf.pal.addresslist.db.allcommon.cbean.coption.ConditionOption; import jp.sf.pal.addresslist.db.allcommon.cbean.cvalue.ConditionValue; import jp.sf.pal.addresslist.db.allcommon.cbean.sqlclause.SqlClause; +import jp.sf.pal.addresslist.db.cbean.UserInfoCB; import jp.sf.pal.addresslist.db.cbean.cq.CompanyCQ; import jp.sf.pal.addresslist.db.cbean.cq.GroupInfoCQ; import jp.sf.pal.addresslist.db.cbean.cq.GroupMappingCQ; @@ -20,7 +21,6 @@ * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public class UserInfoCIQ extends AbstractBsUserInfoCQ { //========================================================================== @@ -180,26 +180,26 @@ "NotExistsSubQuery at inline() is unsupported! Sorry!"); } - public String keepUserId_DeriveSubQuery_CompanyList(CompanyCQ subQuery) { + public String keepUserId_DerivedReferrer_CompanyList(CompanyCQ subQuery) { throw new UnsupportedOperationException( - "DeriveSubQuery at inline() is unsupported! Sorry!"); + "DerivedReferrer at inline() is unsupported! Sorry!"); } - public String keepUserId_DeriveSubQuery_GroupMappingList( + public String keepUserId_DerivedReferrer_GroupMappingList( GroupMappingCQ subQuery) { throw new UnsupportedOperationException( - "DeriveSubQuery at inline() is unsupported! Sorry!"); + "DerivedReferrer at inline() is unsupported! Sorry!"); } - public String keepUserId_DeriveSubQuery_PersonList(PersonCQ subQuery) { + public String keepUserId_DerivedReferrer_PersonList(PersonCQ subQuery) { throw new UnsupportedOperationException( - "DeriveSubQuery at inline() is unsupported! Sorry!"); + "DerivedReferrer at inline() is unsupported! Sorry!"); } - public String keepUserId_DeriveSubQuery_RoleMappingList( + public String keepUserId_DerivedReferrer_RoleMappingList( RoleMappingCQ subQuery) { throw new UnsupportedOperationException( - "DeriveSubQuery at inline() is unsupported! Sorry!"); + "DerivedReferrer at inline() is unsupported! Sorry!"); } protected ConditionValue getCValueGivenName() { @@ -266,6 +266,10 @@ return _myCQ.keepGroupId_InScopeSubQuery_GroupInfo(subQuery); } + protected ConditionValue getCValueStatus() { + return _myCQ.getStatus(); + } + protected ConditionValue getCValueCreatedTime() { return _myCQ.getCreatedTime(); } @@ -294,6 +298,20 @@ return _myCQ.getVersionno(); } + //========================================================================== + // ========= + // Derived Query + // ============= + public String keepScalarSubQuery(UserInfoCQ subQuery) { + throw new UnsupportedOperationException( + "ScalarSubQuery at inline() is unsupported! Sorry!"); + } + + // Very Internal (for Suppressing Warn about 'Not Use Import') + protected String getConditionBeanClassNameInternally() { + return UserInfoCB.class.getName(); + } + protected String getConditionQueryClassNameInternally() { return UserInfoCQ.class.getName(); } Modified: addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/cbean/nss/CompanyNss.java =================================================================== --- addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/cbean/nss/CompanyNss.java 2008-12-27 22:02:56 UTC (rev 1623) +++ addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/cbean/nss/CompanyNss.java 2008-12-27 22:06:42 UTC (rev 1624) @@ -8,7 +8,6 @@ * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public class CompanyNss { protected CompanyCQ _query; Modified: addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/cbean/nss/ContactNss.java =================================================================== --- addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/cbean/nss/ContactNss.java 2008-12-27 22:02:56 UTC (rev 1623) +++ addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/cbean/nss/ContactNss.java 2008-12-27 22:06:42 UTC (rev 1624) @@ -8,7 +8,6 @@ * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public class ContactNss { protected ContactCQ _query; Modified: addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/cbean/nss/CustomNss.java =================================================================== --- addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/cbean/nss/CustomNss.java 2008-12-27 22:02:56 UTC (rev 1623) +++ addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/cbean/nss/CustomNss.java 2008-12-27 22:06:42 UTC (rev 1624) @@ -8,7 +8,6 @@ * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public class CustomNss { protected CustomCQ _query; Modified: addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/cbean/nss/GroupInfoNss.java =================================================================== --- addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/cbean/nss/GroupInfoNss.java 2008-12-27 22:02:56 UTC (rev 1623) +++ addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/cbean/nss/GroupInfoNss.java 2008-12-27 22:06:42 UTC (rev 1624) @@ -7,7 +7,6 @@ * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public class GroupInfoNss { protected GroupInfoCQ _query; Modified: addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/cbean/nss/GroupMappingNss.java =================================================================== --- addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/cbean/nss/GroupMappingNss.java 2008-12-27 22:02:56 UTC (rev 1623) +++ addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/cbean/nss/GroupMappingNss.java 2008-12-27 22:06:42 UTC (rev 1624) @@ -8,7 +8,6 @@ * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public class GroupMappingNss { protected GroupMappingCQ _query; Modified: addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/cbean/nss/PersonNss.java =================================================================== --- addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/cbean/nss/PersonNss.java 2008-12-27 22:02:56 UTC (rev 1623) +++ addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/cbean/nss/PersonNss.java 2008-12-27 22:06:42 UTC (rev 1624) @@ -8,7 +8,6 @@ * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public class PersonNss { protected PersonCQ _query; Modified: addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/cbean/nss/PostalNss.java =================================================================== --- addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/cbean/nss/PostalNss.java 2008-12-27 22:02:56 UTC (rev 1623) +++ addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/cbean/nss/PostalNss.java 2008-12-27 22:06:42 UTC (rev 1624) @@ -8,7 +8,6 @@ * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public class PostalNss { protected PostalCQ _query; Modified: addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/cbean/nss/RoleInfoNss.java =================================================================== --- addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/cbean/nss/RoleInfoNss.java 2008-12-27 22:02:56 UTC (rev 1623) +++ addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/cbean/nss/RoleInfoNss.java 2008-12-27 22:06:42 UTC (rev 1624) @@ -7,7 +7,6 @@ * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public class RoleInfoNss { protected RoleInfoCQ _query; Modified: addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/cbean/nss/RoleMappingNss.java =================================================================== --- addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/cbean/nss/RoleMappingNss.java 2008-12-27 22:02:56 UTC (rev 1623) +++ addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/cbean/nss/RoleMappingNss.java 2008-12-27 22:06:42 UTC (rev 1624) @@ -8,7 +8,6 @@ * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public class RoleMappingNss { protected RoleMappingCQ _query; Modified: addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/cbean/nss/UserInfoNss.java =================================================================== --- addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/cbean/nss/UserInfoNss.java 2008-12-27 22:02:56 UTC (rev 1623) +++ addresslist/trunk/src/main/java/jp/sf/pal/addresslist/db/cbean/nss/UserInfoNss.java 2008-12-27 22:06:42 UTC (rev 1624) @@ -8,7 +8,6 @@ * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public class UserInfoNss { protected UserInfoCQ _query; Modified: addresslist/trunk/src/main/resources/dbflute.dicon =================================================================== --- addresslist/trunk/src/main/resources/dbflute.dicon 2008-12-27 22:02:56 UTC (rev 1623) +++ addresslist/trunk/src/main/resources/dbflute.dicon 2008-12-27 22:06:42 UTC (rev 1624) @@ -5,101 +5,42 @@ - - - "UTF-8" + + + + + + - + + + + + - - - - + + - - - - - - - - - - - - dbflute.interceptor - - - - - - dbflute.interceptor - - - - - dbflute.interceptor - - - - - dbflute.interceptor - - - - - dbflute.interceptor - - - - - dbflute.interceptor - - - - - dbflute.interceptor - - - - - dbflute.interceptor - - - - - dbflute.interceptor - - - - - dbflute.interceptor - - - - - dbflute.interceptor - Modified: addresslist/trunk/src/main/webapp/WEB-INF/db/addresslist.1.log.db =================================================================== (Binary files differ) Modified: addresslist/trunk/src/main/webapp/WEB-INF/db/addresslist.data.db =================================================================== (Binary files differ) From svnnotify ¡÷ sourceforge.jp Sun Dec 28 07:09:08 2008 From: svnnotify ¡÷ sourceforge.jp (svnnotify ¡÷ sourceforge.jp) Date: Sun, 28 Dec 2008 07:09:08 +0900 Subject: [pal-cvs 3890] [1625] added status column to userinfo table. Message-ID: <1230415748.822663.7646.nullmailer@users.sourceforge.jp> Revision: 1625 http://svn.sourceforge.jp/view?root=pal&view=rev&rev=1625 Author: shinsuke Date: 2008-12-28 07:09:08 +0900 (Sun, 28 Dec 2008) Log Message: ----------- added status column to userinfo table. replaced with dbflute 0.8.7. Modified Paths: -------------- board/trunk/dbflute/_project.bat board/trunk/dbflute/_project.sh board/trunk/dbflute/build-board.properties board/trunk/mydbflute/README.txt board/trunk/src/main/config/erd/board.erd board/trunk/src/main/config/sql/board.ddl board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/BehaviorSelector.java board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/CacheBehaviorSelector.java board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/DBFluteConfig.java board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/EntityDefinedCommonColumn.java board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/bhv/AbstractBehaviorReadable.java board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/bhv/AbstractBehaviorWritable.java board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/bhv/BehaviorReadable.java board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/bhv/BehaviorWritable.java board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/cbean/AbstractConditionBean.java board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/cbean/AbstractConditionQuery.java board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/cbean/ConditionBean.java board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/cbean/ConditionBeanContext.java board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/cbean/ConditionQuery.java board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/cbean/ckey/ConditionKey.java board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/cbean/coption/FromToOption.java board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/cbean/coption/LikeSearchOption.java board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/cbean/cvalue/ConditionValue.java board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/cbean/outsidesql/OutsideSqlContext.java board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/cbean/outsidesql/OutsideSqlOption.java board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/cbean/outsidesql/executor/OutsideSqlBasicExecutor.java board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/cbean/outsidesql/executor/OutsideSqlCursorExecutor.java board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/cbean/outsidesql/executor/OutsideSqlEntityExecutor.java board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/cbean/outsidesql/executor/OutsideSqlPagingExecutor.java board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/cbean/sqlclause/AbstractSqlClause.java board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/cbean/sqlclause/SqlClause.java board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/cbean/sqlclause/SqlClauseOracle.java board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/dbmeta/AbstractDBMeta.java board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/dbmeta/DBMeta.java board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/dbmeta/DBMetaInstanceHandler.java board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/dbmeta/hierarchy/HierarchyArranger.java board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/dbmeta/hierarchy/HierarchyRequest.java board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/dbmeta/hierarchy/HierarchyRequestElement.java board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/dbmeta/hierarchy/HierarchySourceColumn.java board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/dbmeta/hierarchy/HierarchySourceIterator.java board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/dbmeta/hierarchy/HierarchySourceRow.java board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/dbmeta/info/ColumnInfo.java board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/dbmeta/info/RelationInfo.java board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/helper/MapStringBuilderImpl.java board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/s2dao/FetchNarrowingResultSetWrapper.java board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/s2dao/internal/rshandler/InternalAbstractDtoMetaDataResultSetHandler.java board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/s2dao/internal/sqlcommand/InternalAbstractAutoStaticCommand.java board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/s2dao/internal/sqlcommand/InternalAbstractBatchAutoStaticCommand.java board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/s2dao/internal/sqlcommand/InternalAbstractDynamicCommand.java board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/s2dao/internal/sqlcommand/InternalAbstractSqlCommand.java board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/s2dao/internal/sqlcommand/InternalDeleteAutoStaticCommand.java board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/s2dao/internal/sqlcommand/InternalDeleteBatchAutoStaticCommand.java board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/s2dao/internal/sqlcommand/InternalDeleteQueryAutoDynamicCommand.java board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/s2dao/internal/sqlcommand/InternalInsertAutoDynamicCommand.java board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/s2dao/internal/sqlcommand/InternalInsertBatchAutoStaticCommand.java board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/s2dao/internal/sqlcommand/InternalProcedureCommand.java board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/s2dao/internal/sqlcommand/InternalUpdateAutoDynamicCommand.java board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/s2dao/internal/sqlcommand/InternalUpdateBatchAutoStaticCommand.java board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/s2dao/internal/sqlcommand/InternalUpdateDynamicCommand.java board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/s2dao/internal/sqlcommand/InternalUpdateQueryAutoDynamicCommand.java board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/s2dao/internal/sqlhandler/InternalAbstractAutoHandler.java board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/s2dao/internal/sqlhandler/InternalAbstractBatchAutoHandler.java board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/s2dao/internal/sqlhandler/InternalBasicHandler.java board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/s2dao/internal/sqlhandler/InternalBasicSelectHandler.java board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/s2dao/internal/sqlhandler/InternalBasicUpdateHandler.java board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/s2dao/internal/sqlhandler/InternalInsertAutoHandler.java board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/s2dao/internal/sqlhandler/InternalInsertBatchAutoHandler.java board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/s2dao/internal/sqlhandler/InternalProcedureHandler.java board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/s2dao/internal/sqlhandler/InternalUpdateAutoHandler.java board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/s2dao/internal/sqlparser/InternalSqlParser.java board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/s2dao/internal/various/InternalProcedureMetaDataFactory.java board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/util/SimpleAssertUtil.java board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/util/SimpleStringUtil.java board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/util/SimpleSystemUtil.java board/trunk/src/main/java/jp/sf/pal/board/db/bsbhv/BsAttachmentBhv.java board/trunk/src/main/java/jp/sf/pal/board/db/bsbhv/BsCategoryAccessBhv.java board/trunk/src/main/java/jp/sf/pal/board/db/bsbhv/BsCategoryBhv.java board/trunk/src/main/java/jp/sf/pal/board/db/bsbhv/BsGroupInfoBhv.java board/trunk/src/main/java/jp/sf/pal/board/db/bsbhv/BsGroupMappingBhv.java board/trunk/src/main/java/jp/sf/pal/board/db/bsbhv/BsMessageAttachmentBhv.java board/trunk/src/main/java/jp/sf/pal/board/db/bsbhv/BsMessageBhv.java board/trunk/src/main/java/jp/sf/pal/board/db/bsbhv/BsMessageContentBhv.java board/trunk/src/main/java/jp/sf/pal/board/db/bsbhv/BsReplyBhv.java board/trunk/src/main/java/jp/sf/pal/board/db/bsbhv/BsRoleInfoBhv.java board/trunk/src/main/java/jp/sf/pal/board/db/bsbhv/BsRoleMappingBhv.java board/trunk/src/main/java/jp/sf/pal/board/db/bsbhv/BsUserInfoBhv.java board/trunk/src/main/java/jp/sf/pal/board/db/bsentity/BsAttachment.java board/trunk/src/main/java/jp/sf/pal/board/db/bsentity/BsCategory.java board/trunk/src/main/java/jp/sf/pal/board/db/bsentity/BsCategoryAccess.java board/trunk/src/main/java/jp/sf/pal/board/db/bsentity/BsGroupInfo.java board/trunk/src/main/java/jp/sf/pal/board/db/bsentity/BsGroupMapping.java board/trunk/src/main/java/jp/sf/pal/board/db/bsentity/BsMessage.java board/trunk/src/main/java/jp/sf/pal/board/db/bsentity/BsMessageAttachment.java board/trunk/src/main/java/jp/sf/pal/board/db/bsentity/BsMessageContent.java board/trunk/src/main/java/jp/sf/pal/board/db/bsentity/BsReply.java board/trunk/src/main/java/jp/sf/pal/board/db/bsentity/BsRoleInfo.java board/trunk/src/main/java/jp/sf/pal/board/db/bsentity/BsRoleMapping.java board/trunk/src/main/java/jp/sf/pal/board/db/bsentity/BsUserInfo.java board/trunk/src/main/java/jp/sf/pal/board/db/bsentity/dbmeta/AttachmentDbm.java board/trunk/src/main/java/jp/sf/pal/board/db/bsentity/dbmeta/CategoryAccessDbm.java board/trunk/src/main/java/jp/sf/pal/board/db/bsentity/dbmeta/CategoryDbm.java board/trunk/src/main/java/jp/sf/pal/board/db/bsentity/dbmeta/GroupInfoDbm.java board/trunk/src/main/java/jp/sf/pal/board/db/bsentity/dbmeta/GroupMappingDbm.java board/trunk/src/main/java/jp/sf/pal/board/db/bsentity/dbmeta/MessageAttachmentDbm.java board/trunk/src/main/java/jp/sf/pal/board/db/bsentity/dbmeta/MessageContentDbm.java board/trunk/src/main/java/jp/sf/pal/board/db/bsentity/dbmeta/MessageDbm.java board/trunk/src/main/java/jp/sf/pal/board/db/bsentity/dbmeta/ReplyDbm.java board/trunk/src/main/java/jp/sf/pal/board/db/bsentity/dbmeta/RoleInfoDbm.java board/trunk/src/main/java/jp/sf/pal/board/db/bsentity/dbmeta/RoleMappingDbm.java board/trunk/src/main/java/jp/sf/pal/board/db/bsentity/dbmeta/UserInfoDbm.java board/trunk/src/main/java/jp/sf/pal/board/db/cbean/bs/BsAttachmentCB.java board/trunk/src/main/java/jp/sf/pal/board/db/cbean/bs/BsCategoryAccessCB.java board/trunk/src/main/java/jp/sf/pal/board/db/cbean/bs/BsCategoryCB.java board/trunk/src/main/java/jp/sf/pal/board/db/cbean/bs/BsGroupInfoCB.java board/trunk/src/main/java/jp/sf/pal/board/db/cbean/bs/BsGroupMappingCB.java board/trunk/src/main/java/jp/sf/pal/board/db/cbean/bs/BsMessageAttachmentCB.java board/trunk/src/main/java/jp/sf/pal/board/db/cbean/bs/BsMessageCB.java board/trunk/src/main/java/jp/sf/pal/board/db/cbean/bs/BsMessageContentCB.java board/trunk/src/main/java/jp/sf/pal/board/db/cbean/bs/BsReplyCB.java board/trunk/src/main/java/jp/sf/pal/board/db/cbean/bs/BsRoleInfoCB.java board/trunk/src/main/java/jp/sf/pal/board/db/cbean/bs/BsRoleMappingCB.java board/trunk/src/main/java/jp/sf/pal/board/db/cbean/bs/BsUserInfoCB.java board/trunk/src/main/java/jp/sf/pal/board/db/cbean/cq/bs/AbstractBsAttachmentCQ.java board/trunk/src/main/java/jp/sf/pal/board/db/cbean/cq/bs/AbstractBsCategoryAccessCQ.java board/trunk/src/main/java/jp/sf/pal/board/db/cbean/cq/bs/AbstractBsCategoryCQ.java board/trunk/src/main/java/jp/sf/pal/board/db/cbean/cq/bs/AbstractBsGroupInfoCQ.java board/trunk/src/main/java/jp/sf/pal/board/db/cbean/cq/bs/AbstractBsGroupMappingCQ.java board/trunk/src/main/java/jp/sf/pal/board/db/cbean/cq/bs/AbstractBsMessageAttachmentCQ.java board/trunk/src/main/java/jp/sf/pal/board/db/cbean/cq/bs/AbstractBsMessageCQ.java board/trunk/src/main/java/jp/sf/pal/board/db/cbean/cq/bs/AbstractBsMessageContentCQ.java board/trunk/src/main/java/jp/sf/pal/board/db/cbean/cq/bs/AbstractBsReplyCQ.java board/trunk/src/main/java/jp/sf/pal/board/db/cbean/cq/bs/AbstractBsRoleInfoCQ.java board/trunk/src/main/java/jp/sf/pal/board/db/cbean/cq/bs/AbstractBsRoleMappingCQ.java board/trunk/src/main/java/jp/sf/pal/board/db/cbean/cq/bs/AbstractBsUserInfoCQ.java board/trunk/src/main/java/jp/sf/pal/board/db/cbean/cq/bs/BsAttachmentCQ.java board/trunk/src/main/java/jp/sf/pal/board/db/cbean/cq/bs/BsCategoryAccessCQ.java board/trunk/src/main/java/jp/sf/pal/board/db/cbean/cq/bs/BsCategoryCQ.java board/trunk/src/main/java/jp/sf/pal/board/db/cbean/cq/bs/BsGroupInfoCQ.java board/trunk/src/main/java/jp/sf/pal/board/db/cbean/cq/bs/BsGroupMappingCQ.java board/trunk/src/main/java/jp/sf/pal/board/db/cbean/cq/bs/BsMessageAttachmentCQ.java board/trunk/src/main/java/jp/sf/pal/board/db/cbean/cq/bs/BsMessageCQ.java board/trunk/src/main/java/jp/sf/pal/board/db/cbean/cq/bs/BsMessageContentCQ.java board/trunk/src/main/java/jp/sf/pal/board/db/cbean/cq/bs/BsReplyCQ.java board/trunk/src/main/java/jp/sf/pal/board/db/cbean/cq/bs/BsRoleInfoCQ.java board/trunk/src/main/java/jp/sf/pal/board/db/cbean/cq/bs/BsRoleMappingCQ.java board/trunk/src/main/java/jp/sf/pal/board/db/cbean/cq/bs/BsUserInfoCQ.java board/trunk/src/main/java/jp/sf/pal/board/db/cbean/cq/ciq/AttachmentCIQ.java board/trunk/src/main/java/jp/sf/pal/board/db/cbean/cq/ciq/CategoryAccessCIQ.java board/trunk/src/main/java/jp/sf/pal/board/db/cbean/cq/ciq/CategoryCIQ.java board/trunk/src/main/java/jp/sf/pal/board/db/cbean/cq/ciq/GroupInfoCIQ.java board/trunk/src/main/java/jp/sf/pal/board/db/cbean/cq/ciq/GroupMappingCIQ.java board/trunk/src/main/java/jp/sf/pal/board/db/cbean/cq/ciq/MessageAttachmentCIQ.java board/trunk/src/main/java/jp/sf/pal/board/db/cbean/cq/ciq/MessageCIQ.java board/trunk/src/main/java/jp/sf/pal/board/db/cbean/cq/ciq/MessageContentCIQ.java board/trunk/src/main/java/jp/sf/pal/board/db/cbean/cq/ciq/ReplyCIQ.java board/trunk/src/main/java/jp/sf/pal/board/db/cbean/cq/ciq/RoleInfoCIQ.java board/trunk/src/main/java/jp/sf/pal/board/db/cbean/cq/ciq/RoleMappingCIQ.java board/trunk/src/main/java/jp/sf/pal/board/db/cbean/cq/ciq/UserInfoCIQ.java board/trunk/src/main/java/jp/sf/pal/board/db/cbean/nss/AttachmentNss.java board/trunk/src/main/java/jp/sf/pal/board/db/cbean/nss/CategoryAccessNss.java board/trunk/src/main/java/jp/sf/pal/board/db/cbean/nss/CategoryNss.java board/trunk/src/main/java/jp/sf/pal/board/db/cbean/nss/GroupInfoNss.java board/trunk/src/main/java/jp/sf/pal/board/db/cbean/nss/GroupMappingNss.java board/trunk/src/main/java/jp/sf/pal/board/db/cbean/nss/MessageAttachmentNss.java board/trunk/src/main/java/jp/sf/pal/board/db/cbean/nss/MessageContentNss.java board/trunk/src/main/java/jp/sf/pal/board/db/cbean/nss/MessageNss.java board/trunk/src/main/java/jp/sf/pal/board/db/cbean/nss/ReplyNss.java board/trunk/src/main/java/jp/sf/pal/board/db/cbean/nss/RoleInfoNss.java board/trunk/src/main/java/jp/sf/pal/board/db/cbean/nss/RoleMappingNss.java board/trunk/src/main/java/jp/sf/pal/board/db/cbean/nss/UserInfoNss.java board/trunk/src/main/resources/dbflute.dicon board/trunk/src/main/webapp/WEB-INF/db/board.data.db Added Paths: ----------- board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/CommonColumnAutoSetupper.java board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/CommonColumnBasicAutoSetupper.java board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/DBDef.java board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/bhv/core/ board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/bhv/core/BehaviorCommand.java board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/bhv/core/BehaviorCommandComponentSetup.java board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/bhv/core/BehaviorCommandInvoker.java board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/bhv/core/BehaviorInitializer.java board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/bhv/core/SqlExecution.java board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/bhv/core/SqlExecutionCreator.java board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/bhv/core/command/ board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/bhv/core/command/AbstractBehaviorCommand.java board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/bhv/core/command/AbstractEntityCommand.java board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/bhv/core/command/AbstractListEntityCommand.java board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/bhv/core/command/AbstractOutsideSqlCommand.java board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/bhv/core/command/AbstractOutsideSqlSelectCommand.java board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/bhv/core/command/AbstractSelectCBCommand.java board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/bhv/core/command/BatchDeleteEntityCommand.java board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/bhv/core/command/BatchDeleteNonstrictEntityCommand.java board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/bhv/core/command/BatchInsertEntityCommand.java board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/bhv/core/command/BatchUpdateEntityCommand.java board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/bhv/core/command/BatchUpdateNonstrictEntityCommand.java board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/bhv/core/command/DeleteEntityCommand.java board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/bhv/core/command/DeleteNonstrictEntityCommand.java board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/bhv/core/command/InsertEntityCommand.java board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/bhv/core/command/OutsideSqlCallCommand.java board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/bhv/core/command/OutsideSqlExecuteCommand.java board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/bhv/core/command/OutsideSqlSelectCursorCommand.java board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/bhv/core/command/OutsideSqlSelectListCommand.java board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/bhv/core/command/QueryDeleteCBCommand.java board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/bhv/core/command/QueryUpdateEntityCBCommand.java board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/bhv/core/command/SelectCountCBCommand.java board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/bhv/core/command/SelectListCBCommand.java board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/bhv/core/command/SelectNextValCommand.java board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/bhv/core/command/SelectScalarCBCommand.java board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/bhv/core/command/UpdateEntityCommand.java board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/bhv/core/command/UpdateNonstrictEntityCommand.java board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/bhv/core/execution/ board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/bhv/core/execution/BasicSelectExecution.java board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/bhv/core/execution/OutsideSqlSelectExecution.java board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/bhv/core/execution/SelectCBExecution.java board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/cbean/ScalarQuery.java board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/cbean/ckey/ConditionKeyNotLikeSearch.java board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/helper/StringKeyMap.java board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/helper/StringSet.java board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/s2dao/BeanMetaDataFactoryExtension.java board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/s2dao/PropertyTypeFactoryBuilderExtension.java board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/s2dao/SqlLogRegistryLatestSqlProvider.java board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/s2dao/internal/various/InternalIdentifierAbstractGenerator.java board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/s2dao/internal/various/InternalIdentifierAssignedGenerator.java board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/s2dao/internal/various/InternalIdentifierGeneratorFactory.java board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/s2dao/internal/various/InternalIdentifierIdentityGenerator.java board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/s2dao/internal/various/InternalIdentifierSequenceGenerator.java board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/s2dao/internal/various/InternalStatementFactory.java board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/util/SimpleResourceUtil.java board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/util/SimpleTypeUtil.java Removed Paths: ------------- board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/BFinder.java board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/CacheDaoSelector.java board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/DaoReadable.java board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/DaoSelector.java board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/DaoWritable.java board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/GenMetaData.java board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/annotation/OutsideSql.java board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/bhv/load/LoadRefererOption.java board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/cbean/SimpleOrderByBean.java board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/cbean/outsidesql/OutsideSqlDao.java board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/s2dao/FetchNarrowingResultSetFactory.java board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/s2dao/S2BeanMetaDataFactoryImpl.java board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/s2dao/S2DaoInterceptor.java board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/s2dao/S2DaoLatestSqlProvider.java board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/s2dao/S2DaoMetaDataExtension.java board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/s2dao/S2DaoMetaDataFactoryImpl.java board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/s2dao/S2DaoPropertyTypeFactoryBuilderExtension.java board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/s2dao/S2DaoSelectDynamicCommand.java board/trunk/src/main/java/jp/sf/pal/board/db/bsdao/ board/trunk/src/main/java/jp/sf/pal/board/db/exdao/ -------------- next part -------------- Modified: board/trunk/dbflute/_project.bat =================================================================== --- board/trunk/dbflute/_project.bat 2008-12-27 22:06:42 UTC (rev 1624) +++ board/trunk/dbflute/_project.bat 2008-12-27 22:09:08 UTC (rev 1625) @@ -2,4 +2,4 @@ set MY_PROJECT_NAME=board -set DBFLUTE_HOME=..\mydbflute\dbflute-0.8.2 +set DBFLUTE_HOME=..\mydbflute\dbflute-0.8.7 Modified: board/trunk/dbflute/_project.sh =================================================================== --- board/trunk/dbflute/_project.sh 2008-12-27 22:06:42 UTC (rev 1624) +++ board/trunk/dbflute/_project.sh 2008-12-27 22:09:08 UTC (rev 1625) @@ -2,4 +2,4 @@ export MY_PROJECT_NAME=board -export DBFLUTE_HOME=../mydbflute/dbflute-0.8.2 +export DBFLUTE_HOME=../mydbflute/dbflute-0.8.7 Modified: board/trunk/dbflute/build-board.properties =================================================================== --- board/trunk/dbflute/build-board.properties 2008-12-27 22:06:42 UTC (rev 1624) +++ board/trunk/dbflute/build-board.properties 2008-12-27 22:09:08 UTC (rev 1625) @@ -157,5 +157,5 @@ torque.additionalForeignKeyMap = map:{ \ } -#torque.isDeleteOldTableClass = true +torque.isDeleteOldTableClass = true Modified: board/trunk/mydbflute/README.txt =================================================================== --- board/trunk/mydbflute/README.txt 2008-12-27 22:06:42 UTC (rev 1624) +++ board/trunk/mydbflute/README.txt 2008-12-27 22:09:08 UTC (rev 1625) @@ -1,3 +1,3 @@ -$ mkdir dbflute-0.8.2 -$ cd dbflute-0.8.2 -$ unzip ../dbflute-0.8.2.zip +$ mkdir dbflute-0.8.7 +$ cd dbflute-0.8.7 +$ unzip ../dbflute-0.8.7.zip Modified: board/trunk/src/main/config/erd/board.erd =================================================================== --- board/trunk/src/main/config/erd/board.erd 2008-12-27 22:06:42 UTC (rev 1624) +++ board/trunk/src/main/config/erd/board.erd 2008-12-27 22:09:08 UTC (rev 1625) @@ -150,6 +150,11 @@ + + 255 + 255 + 206 + 452 890 @@ -299,6 +304,11 @@ + + 255 + 255 + 206 + 305 370 @@ -547,6 +557,11 @@ + + 255 + 255 + 206 + 586 370 @@ -672,6 +687,11 @@ + + 255 + 255 + 206 + 516 40 @@ -852,6 +872,11 @@ + + 255 + 255 + 206 + 219 40 @@ -965,6 +990,11 @@ + + 255 + 255 + 206 + 40 370 @@ -1077,6 +1107,11 @@ + + 255 + 255 + 206 + 807 40 @@ -1350,6 +1385,22 @@ + status + Status + + VARCHAR + String + true + 12 + + 1 + false + false + + false + + + created_time Created Time @@ -1379,7 +1430,7 @@ updated_time Updated Time - + 10 true false @@ -1401,7 +1452,7 @@ deleted_time Deleted Time - + 10 false false @@ -1438,6 +1489,11 @@ + + 255 + 255 + 206 + 1239 370 @@ -1530,7 +1586,7 @@ created_time Created Time - + 10 true false @@ -1552,7 +1608,7 @@ updated_time Updated Time - + 10 true false @@ -1574,7 +1630,7 @@ deleted_time Deleted Time - + 10 false false @@ -1596,7 +1652,7 @@ versionNo Version No. - + 10 true false @@ -1606,6 +1662,11 @@ + + 255 + 255 + 206 + 1094 890 @@ -1674,6 +1735,11 @@ + + 255 + 255 + 206 + 1098 40 @@ -1832,7 +1898,7 @@ created_time Created Time - + 10 true false @@ -1854,7 +1920,7 @@ updated_time Updated Time - + 10 true false @@ -1876,7 +1942,7 @@ deleted_time Deleted Time - + 10 false false @@ -1898,7 +1964,7 @@ versionNo Version No. - + 10 true false @@ -1908,6 +1974,11 @@ + + 255 + 255 + 206 + 1418 890 @@ -1971,6 +2042,11 @@ + + 255 + 255 + 206 + 1426 40 Modified: board/trunk/src/main/config/sql/board.ddl =================================================================== --- board/trunk/src/main/config/sql/board.ddl 2008-12-27 22:06:42 UTC (rev 1624) +++ board/trunk/src/main/config/sql/board.ddl 2008-12-27 22:09:08 UTC (rev 1625) @@ -11,9 +11,9 @@ DROP TABLE attachment; DROP TABLE category; -/********************************** -Table Name: Category -**********************************/ +/**********************************/ +/* Table Name: Category */ +/**********************************/ CREATE TABLE category( id INTEGER NOT NULL IDENTITY PRIMARY KEY, name VARCHAR(100) NOT NULL, @@ -27,9 +27,9 @@ versionNo INTEGER DEFAULT 0 NOT NULL ); -/********************************** -Table Name: Attachment -**********************************/ +/**********************************/ +/* Table Name: Attachment */ +/**********************************/ CREATE TABLE attachment( id BIGINT(20) NOT NULL IDENTITY PRIMARY KEY, data BLOB NOT NULL, @@ -40,9 +40,9 @@ created_by VARCHAR(255) NOT NULL ); -/********************************** -Table Name: Message -**********************************/ +/**********************************/ +/* Table Name: Message */ +/**********************************/ CREATE TABLE message( id BIGINT(20) NOT NULL IDENTITY PRIMARY KEY, display_name VARCHAR(100) NOT NULL, @@ -62,9 +62,9 @@ FOREIGN KEY (category_id) REFERENCES category (id) ); -/********************************** -Table Name: Category Access -**********************************/ +/**********************************/ +/* Table Name: Category Access */ +/**********************************/ CREATE TABLE category_access( id BIGINT(20) NOT NULL IDENTITY PRIMARY KEY, name VARCHAR(255) NOT NULL, @@ -78,9 +78,9 @@ FOREIGN KEY (category_id) REFERENCES category (id) ); -/********************************** -Table Name: Reply -**********************************/ +/**********************************/ +/* Table Name: Reply */ +/**********************************/ CREATE TABLE reply( id BIGINT(20) NOT NULL IDENTITY PRIMARY KEY, display_name VARCHAR(100) NOT NULL, @@ -93,9 +93,9 @@ FOREIGN KEY (message_id) REFERENCES message (id) ); -/********************************** -Table Name: Message Attachment -**********************************/ +/**********************************/ +/* Table Name: Message Attachment */ +/**********************************/ CREATE TABLE message_attachment( id BIGINT(20) NOT NULL IDENTITY PRIMARY KEY, memo VARCHAR(100), @@ -113,18 +113,18 @@ FOREIGN KEY (attachment_id) REFERENCES attachment (id) ); -/********************************** -Table Name: Message Content -**********************************/ +/**********************************/ +/* Table Name: Message Content */ +/**********************************/ CREATE TABLE message_content( message_id BIGINT(20) NOT NULL PRIMARY KEY, content VARCHAR(4000), FOREIGN KEY (message_id) REFERENCES message (id) ); -/********************************** -Table Name: Group Information -**********************************/ +/**********************************/ +/* Table Name: Group Information */ +/**********************************/ CREATE TABLE group_info( group_id VARCHAR(255) NOT NULL PRIMARY KEY, name VARCHAR(100), @@ -141,9 +141,9 @@ versionNo INTEGER NOT NULL ); -/********************************** -Table Name: Role Information -**********************************/ +/**********************************/ +/* Table Name: Role Information */ +/**********************************/ CREATE TABLE role_info( role_id VARCHAR(255) NOT NULL PRIMARY KEY, name VARCHAR(100), @@ -160,9 +160,9 @@ versionNo INTEGER NOT NULL ); -/********************************** -Table Name: User Information -**********************************/ +/**********************************/ +/* Table Name: User Information */ +/**********************************/ CREATE TABLE user_info( user_id VARCHAR(255) NOT NULL PRIMARY KEY, given_name VARCHAR(100), @@ -179,6 +179,7 @@ locale VARCHAR(5), role_id VARCHAR(255), group_id VARCHAR(255), + status VARCHAR(1), created_time TIMESTAMP NOT NULL, created_by VARCHAR(255) NOT NULL, updated_time TIMESTAMP NOT NULL, @@ -190,9 +191,9 @@ FOREIGN KEY (role_id) REFERENCES role_info (role_id) ); -/********************************** -Table Name: Group Mapping -**********************************/ +/**********************************/ +/* Table Name: Group Mapping */ +/**********************************/ CREATE TABLE group_mapping( id INTEGER NOT NULL IDENTITY PRIMARY KEY, user_id VARCHAR(255) NOT NULL, @@ -201,9 +202,9 @@ FOREIGN KEY (group_id) REFERENCES group_info (group_id) ); -/********************************** -Table Name: Role Mapping -**********************************/ +/**********************************/ +/* Table Name: Role Mapping */ +/**********************************/ CREATE TABLE role_mapping( id INT NOT NULL IDENTITY PRIMARY KEY, user_id VARCHAR(255) NOT NULL, Deleted: board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/BFinder.java =================================================================== --- board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/BFinder.java 2008-12-27 22:06:42 UTC (rev 1624) +++ board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/BFinder.java 2008-12-27 22:09:08 UTC (rev 1625) @@ -1,110 +0,0 @@ -package jp.sf.pal.board.db.allcommon; - -import jp.sf.pal.board.db.allcommon.bhv.BehaviorReadable; - -/** - * The entry of DBFlute. - * - * @author DBFlute(AutoGenerator) - */ - ¡÷ SuppressWarnings("unchecked") -public class BFinder { - - //========================================================================== - // ========= - // Definition - // ========== - protected static String _dbfluteDiconName = "dbflute.dicon"; - - //========================================================================== - // ========= - // Constructor - // =========== - private BFinder() { - } - - //========================================================================== - // ========= - // Finder - // ====== - public static BEHAVIOR_TYPE find( - Class behaviorType) { - assertObjectNotNull("behaviorType", behaviorType); - if (!org.seasar.framework.container.factory.SingletonS2ContainerFactory - .hasContainer()) { - synchronized (BFinder.class) { - if (!org.seasar.framework.container.factory.SingletonS2ContainerFactory - .hasContainer()) { - final String configFile = _dbfluteDiconName; - if (org.seasar.framework.util.ResourceUtil - .isExist(configFile)) { - org.seasar.framework.container.factory.SingletonS2ContainerFactory - .setConfigPath(configFile); - org.seasar.framework.container.factory.SingletonS2ContainerFactory - .init(); - } else { - String msg = "S2Container is not initialized! Confirm your initializer and your dicon files."; - throw new IllegalStateException(msg); - } - } - } - } - final org.seasar.framework.container.S2Container container = org.seasar.framework.container.factory.SingletonS2ContainerFactory - .getContainer(); - final BEHAVIOR_TYPE behavior = (BEHAVIOR_TYPE) container - .getComponent(behaviorType); - return behavior; - } - - //========================================================================== - // ========= - // Accessor - // ======== - public static void setDBFluteDiconName(String dbfluteDiconName) { - _dbfluteDiconName = dbfluteDiconName; - } - - //========================================================================== - // ========= - // General Helper - // ============== - /** - * Assert that the object is not null. - * - * @param variableName Variable name. (NotNull) - * @param value Value. (NotNull) - * @exception IllegalArgumentException - */ - protected static void assertObjectNotNull(String variableName, Object value) { - if (variableName == null) { - String msg = "The value should not be null: variableName=" - + variableName + " value=" + value; - throw new IllegalArgumentException(msg); - } - if (value == null) { - String msg = "The value should not be null: variableName=" - + variableName; - throw new IllegalArgumentException(msg); - } - } - - // ---------------------------------------------------------------- - // Assert String - // ------------- - /** - * Assert that the entity is not null and not trimmed empty. - * - * @param variableName Variable name. (NotNull) - * @param value Value. (NotNull) - */ - protected void assertStringNotNullAndNotTrimmedEmpty(String variableName, - String value) { - assertObjectNotNull("variableName", variableName); - assertObjectNotNull("value", value); - if (value.trim().length() == 0) { - String msg = "The value should not be empty: variableName=" - + variableName + " value=" + value; - throw new IllegalArgumentException(msg); - } - } -} Modified: board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/BehaviorSelector.java =================================================================== --- board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/BehaviorSelector.java 2008-12-27 22:06:42 UTC (rev 1624) +++ board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/BehaviorSelector.java 2008-12-27 22:09:08 UTC (rev 1625) @@ -10,8 +10,7 @@ public interface BehaviorSelector { /** - * Initialize condition-bean meta data.
If you call this, Hot Deploy - * of OutsideSql becomes Cool! + * Initialize condition-bean meta data.
*/ public void initializeConditionBeanMetaData(); Modified: board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/CacheBehaviorSelector.java =================================================================== --- board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/CacheBehaviorSelector.java 2008-12-27 22:06:42 UTC (rev 1624) +++ board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/CacheBehaviorSelector.java 2008-12-27 22:09:08 UTC (rev 1625) @@ -1,8 +1,8 @@ package jp.sf.pal.board.db.allcommon; import java.util.Collection; -import java.util.LinkedHashMap; import java.util.Map; +import java.util.concurrent.ConcurrentHashMap; import jp.sf.pal.board.db.allcommon.bhv.BehaviorReadable; import jp.sf.pal.board.db.allcommon.dbmeta.DBMeta; @@ -31,15 +31,14 @@ // Attribute // ========= /** The cache of behavior. (It's the generic hell!) */ - protected Map, BehaviorReadable> _behaviorCache = new LinkedHashMap, BehaviorReadable>(); + protected Map, BehaviorReadable> _behaviorCache = new ConcurrentHashMap, BehaviorReadable>(); //========================================================================== // ========= // Initialize // ========== /** - * Initialize condition-bean meta data.
If you call this, Hot Deploy - * of OutsideSql becomes Cool! + * Initialize condition-bean meta data.
*/ public void initializeConditionBeanMetaData() { final Map dbmetaMap = DBMetaInstanceHandler @@ -53,8 +52,7 @@ } for (DBMeta dbmeta : dbmetas) { final BehaviorReadable bhv = byName(dbmeta.getTableDbName()); - final DaoReadable dao = bhv.getDaoReadable(); - dao.initializeDaoMetaData("selectList"); + bhv.warmUpCommand(); } if (_log.isInfoEnabled()) { long after = System.currentTimeMillis(); Deleted: board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/CacheDaoSelector.java =================================================================== --- board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/CacheDaoSelector.java 2008-12-27 22:06:42 UTC (rev 1624) +++ board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/CacheDaoSelector.java 2008-12-27 22:09:08 UTC (rev 1625) @@ -1,66 +0,0 @@ -package jp.sf.pal.board.db.allcommon; - -import jp.sf.pal.board.db.allcommon.dbmeta.DBMeta; -import jp.sf.pal.board.db.allcommon.dbmeta.DBMetaInstanceHandler; - -/** - * The implementation of DAO-selector. - * - *
- * 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.
- * 
- * - * @author DBFlute(AutoGenerator) - */ - ¡÷ SuppressWarnings("unchecked") -public class CacheDaoSelector extends CacheAbstractSelector implements - DaoSelector { - - //========================================================================== - // ========= - // Selector - // ======== - /** - * Select DAO. - * - * @param The type of DAO. - * @param daoType DAO type. (NotNull) - * @return DAO. (NotNull) - */ - public DAO select(Class 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 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 daoType; - try { - daoType = (Class) Class.forName(daoTypeName); - } catch (ClassNotFoundException e) { - throw new RuntimeException("The class does not exist: " - + daoTypeName, e); - } - return daoType; - } -} Added: board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/CommonColumnAutoSetupper.java =================================================================== --- board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/CommonColumnAutoSetupper.java (rev 0) +++ board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/CommonColumnAutoSetupper.java 2008-12-27 22:09:08 UTC (rev 1625) @@ -0,0 +1,25 @@ +package jp.sf.pal.board.db.allcommon; + +/** + * The auto set-upper of common column. + * + * @author DBFlute(AutoGenerator) + */ +public interface CommonColumnAutoSetupper { + + /** + * Handle common columns of insert if it needs. + * + * @param targetEntity Target entity that the type is entity interface. + * (NotNull) + */ + public void handleCommonColumnOfInsertIfNeeds(Entity targetEntity); + + /** + * Handle common columns of update if it needs. + * + * @param targetEntity Target entity that the type is entity interface. + * (NotNull) + */ + public void handleCommonColumnOfUpdateIfNeeds(Entity targetEntity); +} Property changes on: board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/CommonColumnAutoSetupper.java ___________________________________________________________________ Name: svn:eol-style + native Added: board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/CommonColumnBasicAutoSetupper.java =================================================================== --- board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/CommonColumnBasicAutoSetupper.java (rev 0) +++ board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/CommonColumnBasicAutoSetupper.java 2008-12-27 22:09:08 UTC (rev 1625) @@ -0,0 +1,31 @@ +package jp.sf.pal.board.db.allcommon; + +/** + * The basic implementation of the auto set-upper of common column. + * + * @author DBFlute(AutoGenerator) + */ +public class CommonColumnBasicAutoSetupper implements CommonColumnAutoSetupper { + + //========================================================================== + // =========== + // Set up + // ====== + /** + * Handle common columns of insert if it needs. + * + * @param targetEntity Target entity that the type is entity interface. + * (NotNull) + */ + public void handleCommonColumnOfInsertIfNeeds(Entity targetEntity) { + } + + /** + * Handle common columns of update if it needs. + * + * @param targetEntity Target entity that the type is entity interface. + * (NotNull) + */ + public void handleCommonColumnOfUpdateIfNeeds(Entity targetEntity) { + } +} Property changes on: board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/CommonColumnBasicAutoSetupper.java ___________________________________________________________________ Name: svn:eol-style + native Added: board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/DBDef.java =================================================================== --- board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/DBDef.java (rev 0) +++ board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/DBDef.java 2008-12-27 22:09:08 UTC (rev 1625) @@ -0,0 +1,179 @@ +package jp.sf.pal.board.db.allcommon; + +import java.util.Collections; +import java.util.HashMap; +import java.util.Iterator; +import java.util.Map; +import java.util.Set; + +/** + * The definition of database. + * + * @author DBFlute(AutoGenerator) + */ +public enum DBDef { + + //========================================================================== + // ========= + // ENUM + // ==== + MySQL("mysql", null), PostgreSQL("postgresql", "postgre"), Oracle("oracle", + null), DB2("db2", null), SQLServer("sqlserver", "mssql"), FireBird( + "firebird", null), H2("h2", null), Derby("derby", null), MSAccess( + "msaccess", null), Unknown("unknown", null); + + //========================================================================== + // ========= + // Static Reference + // ================ + // ----------------------------------------------------- + // Code Value + // ---------- + private static final Map _codeValueMap = new HashMap(); + static { + for (DBDef value : values()) { + _codeValueMap.put(value.code().toLowerCase(), value); + } + } + + private static final Map _codeAliasValueMap = new HashMap(); + static { + for (DBDef value : values()) { + if (value.codeAlias() != null) { + _codeAliasValueMap.put(value.codeAlias().toLowerCase(), value); + } + } + } + + /** + * @param code The code of the DB. (Nullable: If the code is null, it + * returns null) + * @return The instance that has the code. (Nullable) + */ + public static DBDef codeOf(String code) { + if (code == null) { + return null; + } + final String lowerCaseCode = code.toLowerCase(); + DBDef def = _codeValueMap.get(lowerCaseCode); + if (def == null) { + def = _codeAliasValueMap.get(lowerCaseCode); + } + return def; + } + + // ----------------------------------------------------- + // Driver Hint + // ----------- + private static final Map _driverHintMap; + static { + final Map tmpMap = new HashMap(); + tmpMap.put("mysql", MySQL); + tmpMap.put("postgresql", PostgreSQL); + tmpMap.put("oracle", Oracle); + tmpMap.put("db2", DB2); + tmpMap.put("sqlserver", SQLServer); + tmpMap.put("firebird", FireBird); + tmpMap.put("org.h2", H2); + tmpMap.put("org.apache.derby", Derby); + _driverHintMap = Collections.unmodifiableMap(tmpMap); + } + + public static DBDef byDriverClassName(String driverClassName) { + final Set keySet = _driverHintMap.keySet(); + for (final Iterator ite = keySet.iterator(); ite.hasNext();) { + final String driverHint = ite.next(); + if (driverClassName.indexOf(driverHint) >= 0) { + final DBDef dbdef = _driverHintMap.get(driverHint); + if (dbdef != null) { + return dbdef; + } + } + } + return null; + } + + //========================================================================== + // ========= + // Current Definition + // ================== + /** The current definition of database. (NotNull, Default 'Unknown') */ + private static DBDef _currentDef; + static { + _currentDef = codeOf("H2"); + if (_currentDef == null) { + _currentDef = Unknown; + } + } + + /** + * @return The current definition of database. (NotNull) + */ + public static DBDef getCurrentDef() { + return _currentDef; + } + + /** + * @param currentDef The current definition of database. (NotNull) + */ + public static void setCurrentDef(DBDef currentDef) { + if (currentDef == null) { + String msg = "The argument 'currentDef' should not be null at DBDef.setCurrentDef()"; + throw new IllegalArgumentException(msg); + } + _currentDef = currentDef; + } + + /** + * @param dbdef The definition of database. (NotNull) + * @return Is the definition of database current? + */ + public static boolean isCurrentDef(DBDef dbdef) { + if (dbdef == null) { + String msg = "The argument 'dbdef' should not be null at DBDef.isCurrentDef()"; + throw new IllegalArgumentException(msg); + } + return _currentDef != null ? _currentDef.equals(dbdef) : false; + } + + //========================================================================== + // ========= + // Attribute + // ========= + /** The code of the DB. (NotNull) */ + private String _code; + + /** The code alias of the DB. (Nullable) */ + private String _codeAlias; + + //========================================================================== + // ========= + // Constructor + // =========== + /** + * @param code The code of the DB. (NotNull) + * @param codeAlias The code alias of the DB. (Nullable) + */ + private DBDef(String code, String codeAlias) { + _code = code; + _codeAlias = codeAlias; + } + + //========================================================================== + // ========= + // Accessor + // ======== + /** + * @return The code of the DB. (NotNull) + */ + public String code() { + return _code; + } + + /** + * @return The code alias of the DB. (Nullable) + */ + private String codeAlias() { + return _codeAlias; + } +} Property changes on: board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/DBDef.java ___________________________________________________________________ Name: svn:eol-style + native Modified: board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/DBFluteConfig.java =================================================================== --- board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/DBFluteConfig.java 2008-12-27 22:06:42 UTC (rev 1624) +++ board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/DBFluteConfig.java 2008-12-27 22:09:08 UTC (rev 1625) @@ -24,10 +24,6 @@ // ========= protected StatementConfig _defaultStatementConfig; - protected boolean _conditionBeanFormatSql = true;// This is for - - // compatibility! - protected boolean _queryLogLevelInfo; protected boolean _executeStatusLogLevelInfo; @@ -36,10 +32,6 @@ protected UniqueConstraintDeterminator _uniqueConstraintDeterminator; - protected boolean _sqlExceptionOldStyleHandling = false;// This is for - - // compatibility! - protected String _logDateFormat; protected String _logTimestampFormat; @@ -92,27 +84,6 @@ //========================================================================== // ========= - // ConditionBean Format Sql - // ======================== - public boolean isConditionBeanFormatSql() { - return _conditionBeanFormatSql; - } - - /** - * @param conditionBeanFormatSql The value of the config. - * @deprecated This is for compatibility! - */ - public void setConditionBeanFormatSql(boolean conditionBeanFormatSql) { - assertNotLocked(); - if (_log.isInfoEnabled()) { - _log.info("...Setting conditionBeanFormatSql: " - + conditionBeanFormatSql); - } - _conditionBeanFormatSql = conditionBeanFormatSql; - } - - //========================================================================== - // ========= // Query Log Level Info // ==================== public boolean isQueryLogLevelInfo() { @@ -184,31 +155,8 @@ public boolean isUniqueConstraintException(Throwable t); } - // [DBFlute-0.7.7] //========================================================================== // ========= - // SQL Exception Old Style - // ======================= - public boolean isSqlExceptionOldStyleHandling() { - return _sqlExceptionOldStyleHandling; - } - - /** - * @param sqlExceptionOldStyleHandling The value of the config. - * @deprecated This is for compatibility! - */ - public void setSqlExceptionOldStyleHandling( - boolean sqlExceptionOldStyleHandling) { - assertNotLocked(); - if (_log.isInfoEnabled()) { - _log.info("...Setting sqlExceptionOldStyleHandling: " - + sqlExceptionOldStyleHandling); - } - _sqlExceptionOldStyleHandling = sqlExceptionOldStyleHandling; - } - - //========================================================================== - // ========= // Log Format // ========== public String getLogDateFormat() { @@ -303,7 +251,6 @@ // ============ public void clear() { // the only properties that update OK while executing _defaultStatementConfig = null; - _conditionBeanFormatSql = true; // as default _queryLogLevelInfo = false; _executeStatusLogLevelInfo = false; _useSqlLogRegistry = false; Deleted: board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/DaoReadable.java =================================================================== --- board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/DaoReadable.java 2008-12-27 22:06:42 UTC (rev 1624) +++ board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/DaoReadable.java 2008-12-27 22:09:08 UTC (rev 1625) @@ -1,11 +0,0 @@ -package jp.sf.pal.board.db.allcommon; - -/** - * The interface of dao-readable. - * - * @author DBFlute(AutoGenerator) - */ -public interface DaoReadable { - public void initializeDaoMetaData(String methodName);// Very Internal - // Method! -} Deleted: board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/DaoSelector.java =================================================================== --- board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/DaoSelector.java 2008-12-27 22:06:42 UTC (rev 1624) +++ board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/DaoSelector.java 2008-12-27 22:09:08 UTC (rev 1625) @@ -1,26 +0,0 @@ -package jp.sf.pal.board.db.allcommon; - -/** - * The interface of DAO-selector. - * - * @author DBFlute(AutoGenerator) - */ -public interface DaoSelector { - - /** - * Select DAO. - * - * @param The type of DAO. - * @param daoType DAO type. (NotNull) - * @return Dao. (NotNull) - */ - public DAO select(Class daoType); - - /** - * Select DAO-readable by name. - * - * @param tableFlexibleName Table flexible name. (NotNull) - * @return DAO-readable. (NotNull) - */ - public DaoReadable byName(String tableFlexibleName); -} Deleted: board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/DaoWritable.java =================================================================== --- board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/DaoWritable.java 2008-12-27 22:06:42 UTC (rev 1624) +++ board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/DaoWritable.java 2008-12-27 22:09:08 UTC (rev 1625) @@ -1,70 +0,0 @@ -package jp.sf.pal.board.db.allcommon; - -import java.util.List; - -/** - * The interface of dao-writable. - * - * @author DBFlute(AutoGenerator) - */ -public interface DaoWritable extends DaoReadable { - - /** - * Insert one entity that the type is entity-interface. - * - * @param entity Entity that the type is entity-interface. (NotNull) - * @return Inserted count. - */ - public int create(Entity entity); - - /** - * Update one entity that the type is entity-interface. - * - * @param entity Entity that the type is entity-interface. (NotNull) - * @return Updated count. - */ - public int modify(Entity entity); - - /** - * Update one entity that the type is entity-interface. (modified only) - * - * @param entity Entity that the type is entity-interface. (NotNull) - * @return Updated count. - */ - public int modifyModifiedOnly(Entity entity); - - /** - * Delete one entity that the type is entity-interface. - * - * @param entity Entity that the type is entity-interface. (NotNull) - * @return Deleted count. - */ - public int remove(Entity entity); - - /** - * Insert several entities that the type is entity-interface. - * - * @param entityList Entity-list that the type is entity-interface. - * (NotNull) - * @return The array of inserted count. - */ - public int[] createList(List 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 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 entityList); -} Modified: board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/EntityDefinedCommonColumn.java =================================================================== --- board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/EntityDefinedCommonColumn.java 2008-12-27 22:06:42 UTC (rev 1624) +++ board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/EntityDefinedCommonColumn.java 2008-12-27 22:09:08 UTC (rev 1625) @@ -8,6 +8,12 @@ public interface EntityDefinedCommonColumn extends Entity { /** + * Enable common column auto set up. {for after disable because the default + * is enabled} + */ + public void enableCommonColumnAutoSetup(); + + /** * Disable common column auto set up. */ public void disableCommonColumnAutoSetup(); Deleted: board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/GenMetaData.java =================================================================== --- board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/GenMetaData.java 2008-12-27 22:06:42 UTC (rev 1624) +++ board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/GenMetaData.java 2008-12-27 22:09:08 UTC (rev 1625) @@ -1,258 +0,0 @@ -package jp.sf.pal.board.db.allcommon; - -/** - * The sigleton class that has generate-meta-data(GenMetaData). - * - * @author DBFlute(AutoGenerator) - */ -public class GenMetaData { - - /** Singleton instance. */ - private static final GenMetaData _instance = new GenMetaData(); - - /** - * Constructor. - */ - private GenMetaData() { - } - - /** - * Get instance. - * - * @return Singleton instance. - */ - public static GenMetaData getInstance() { - return _instance; - } - - //========================================================================== - // ========= - // Basic - // ===== - /** - * Get the property-value of targetLanguage. - * - * @return The property-value. - */ - public String getTargetLanguage() { - return "java"; - } - - /** - * Get the property-value of templateFileExtension. - * - * @return The property-value. - */ - public String getTemplateFileExtension() { - return "vm"; - } - - /** - * Get the property-value of classFileExtension. - * - * @return The property-value. - */ - public String getClassFileExtension() { - return "java"; - } - - /** - * Get the property-value of templateFileEncoding. - * - * @return The property-value. - */ - public String getTemplateEncoding() { - return "UTF-8"; - } - - /** - * Get the property-value of classAuthor. - * - * @return The property-value. - */ - public String getClassAuthor() { - return "DBFlute(AutoGenerator)"; - } - - //========================================================================== - // ========= - // Naming - // ====== - /** - * Is java name of table same as db name? Answer is false! - * - * @return The property-value. - */ - public boolean isJavaNameOfTableSameAsDbName() { - return false; - } - - /** - * Is java name of column same as db name? Answer is false! - * - * @return The property-value. - */ - public boolean isJavaNameOfColumnSameAsDbName() { - return false; - } - - //========================================================================== - // ========= - // Prefix - // ====== - /** - * Get the property-value of projectPrefix. - * - * @return The property-value. - */ - public String getProjectPrefix() { - return ""; - } - - /** - * Get the property-value of basePrefix. - * - * @return The property-value. - */ - public String getBasePrefix() { - return "Bs"; - } - - //========================================================================== - // ========= - // Package - // ======= - /** - * Get the property-value of baseCommonPackage. - * - * @return The property-value. - */ - public String getBaseCommonPackage() { - return "jp.sf.pal.board.db.allcommon"; - } - - /** - * Get the property-value of baseBehaviorPackage. - * - * @return The property-value. - */ - public String getBaseBehaviorPackage() { - return "jp.sf.pal.board.db.bsbhv"; - } - - /** - * Get the property-value of baseDaoPackage. - * - * @return The property-value. - */ - public String getBaseDaoPackage() { - return "jp.sf.pal.board.db.bsdao"; - } - - /** - * Get the property-value of baseEntityPackage. - * - * @return The property-value. - */ - public String getBaseEntityPackage() { - return "jp.sf.pal.board.db.bsentity"; - } - - /** - * Get the property-value of conditionBeanPackage. - * - * @return The property-value. - */ - public String getConditionBeanPackage() { - return "jp.sf.pal.board.db.cbean"; - } - - /** - * Get the property-value of extendedDaoPackage. - * - * @return The property-value. - */ - public String getExtendedDaoPackage() { - return "jp.sf.pal.board.db.exdao"; - } - - /** - * Get the property-value of extendedBehaviorPackage. - * - * @return The property-value. - */ - public String getExtendedBehaviorPackage() { - return "jp.sf.pal.board.db.exbhv"; - } - - /** - * Get the property-value of extendedEntityPackage. - * - * @return The property-value. - */ - public String getExtendedEntityPackage() { - return "jp.sf.pal.board.db.exentity"; - } - - //========================================================================== - // ========= - // Optimistic Lock - // =============== - /** - * Get the property-value of updateDateFieldName. - * - * @return The property-value. - */ - public String getUpdateDateFieldName() { - return ""; - } - - /** - * Get the property-value of versionNoFieldName. - * - * @return The property-value. - */ - public String getVersionNoFieldName() { - return ""; - } - - //========================================================================== - // ========= - // Extract - // ======= - /** - * Get the value of 'extractAcceptStartBrace'. - * - * @return The property-value. (NotNull) - */ - public String getExtractAcceptStartBrace() { - return "@{"; - } - - /** - * Get the value of 'extractAcceptEndBrace'. - * - * @return The property-value. (NotNull) - */ - public String getExtractAcceptEndBrace() { - return "@}"; - } - - /** - * Get the value of 'extractAcceptDelimiter'. - * - * @return The property-value. (NotNull) - */ - public String getExtractAcceptDelimiter() { - return "@;"; - } - - /** - * Get the value of 'extractAcceptEqual'. - * - * @return The property-value. (NotNull) - */ - public String getExtractAcceptEqual() { - return "@="; - } -} Deleted: board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/annotation/OutsideSql.java =================================================================== --- board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/annotation/OutsideSql.java 2008-12-27 22:06:42 UTC (rev 1624) +++ board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/annotation/OutsideSql.java 2008-12-27 22:09:08 UTC (rev 1625) @@ -1,18 +0,0 @@ -package jp.sf.pal.board.db.allcommon.annotation; - -import java.lang.annotation.ElementType; -import java.lang.annotation.Inherited; -import java.lang.annotation.Retention; -import java.lang.annotation.RetentionPolicy; -import java.lang.annotation.Target; - - ¡÷ Inherited - ¡÷ Retention(RetentionPolicy.RUNTIME) - ¡÷ Target(ElementType.METHOD) -public @interface OutsideSql { - boolean dynamicBinding() default false; - - boolean offsetByCursor() default false; - - boolean limitByCursor() default false; -} Modified: board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/bhv/AbstractBehaviorReadable.java =================================================================== --- board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/bhv/AbstractBehaviorReadable.java 2008-12-27 22:06:42 UTC (rev 1624) +++ board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/bhv/AbstractBehaviorReadable.java 2008-12-27 22:09:08 UTC (rev 1625) @@ -11,10 +11,16 @@ import java.util.Set; import jp.sf.pal.board.db.allcommon.BehaviorSelector; -import jp.sf.pal.board.db.allcommon.DaoSelector; import jp.sf.pal.board.db.allcommon.Entity; import jp.sf.pal.board.db.allcommon.bhv.batch.TokenFileOutputOption; import jp.sf.pal.board.db.allcommon.bhv.batch.TokenFileOutputResult; +import jp.sf.pal.board.db.allcommon.bhv.core.BehaviorCommand; +import jp.sf.pal.board.db.allcommon.bhv.core.BehaviorCommandInvoker; +import jp.sf.pal.board.db.allcommon.bhv.core.command.AbstractBehaviorCommand; +import jp.sf.pal.board.db.allcommon.bhv.core.command.SelectCountCBCommand; +import jp.sf.pal.board.db.allcommon.bhv.core.command.SelectListCBCommand; +import jp.sf.pal.board.db.allcommon.bhv.core.command.SelectNextValCommand; +import jp.sf.pal.board.db.allcommon.bhv.core.command.SelectScalarCBCommand; import jp.sf.pal.board.db.allcommon.bhv.load.LoadReferrerOption; import jp.sf.pal.board.db.allcommon.bhv.setup.ValueLabelBox; import jp.sf.pal.board.db.allcommon.bhv.setup.ValueLabelSetupper; @@ -25,8 +31,9 @@ import jp.sf.pal.board.db.allcommon.cbean.PagingHandler; import jp.sf.pal.board.db.allcommon.cbean.PagingInvoker; import jp.sf.pal.board.db.allcommon.cbean.PagingResultBean; -import jp.sf.pal.board.db.allcommon.cbean.outsidesql.OutsideSqlDao; +import jp.sf.pal.board.db.allcommon.cbean.ScalarQuery; import jp.sf.pal.board.db.allcommon.cbean.outsidesql.executor.OutsideSqlBasicExecutor; +import jp.sf.pal.board.db.allcommon.cbean.sqlclause.SqlClause; import jp.sf.pal.board.db.allcommon.dbmeta.info.ColumnInfo; import jp.sf.pal.board.db.allcommon.helper.token.file.FileMakingHeaderInfo; import jp.sf.pal.board.db.allcommon.helper.token.file.FileMakingOption; @@ -35,11 +42,10 @@ import jp.sf.pal.board.db.allcommon.util.SimpleSystemUtil; /** - * The abstract class of behavior-readable. + * The abstract class of readable behavior. * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public abstract class AbstractBehaviorReadable implements BehaviorReadable { //========================================================================== @@ -50,13 +56,13 @@ * Behavior-selector instance. It's basically referred at loadReferrer. * (Required for loadReferrer) */ - protected BehaviorSelector _behaviorSelector; + protected BehaviorCommandInvoker _behaviorCommandInvoker; /** - * Dao-selector instance. It's basically referred at loadReferrer. (Required - * for OutsideSql) + * Behavior-selector instance. It's basically referred at loadReferrer. + * (Required for loadReferrer) */ - protected DaoSelector _daoSelector; + protected BehaviorSelector _behaviorSelector; //========================================================================== // =========== @@ -83,7 +89,7 @@ * @return Read count. (NotNull) */ public int readCount(ConditionBean cb) { - assertConditionBeanNotNull(cb); + assertCBNotNull(cb); return callReadCount(cb); } @@ -100,7 +106,7 @@ * When the entity has been duplicated. */ public Entity readEntity(ConditionBean cb) { - assertConditionBeanNotNull(cb); + assertCBNotNull(cb); final List ls = readList(cb); if (ls.isEmpty()) { return null; @@ -120,7 +126,7 @@ * When the entity has been duplicated. */ public Entity readEntityWithDeletedCheck(ConditionBean cb) { - assertConditionBeanNotNull(cb); + assertCBNotNull(cb); final List ls = readList(cb); assertEntityNotDeleted(ls, cb); assertEntitySelectedAsOne(ls, cb); @@ -133,7 +139,7 @@ // =========================== protected ENTITY helpSelectEntityInternally( CB cb, InternalSelectEntityCallback callback) { - assertConditionBeanNotNull(cb); + assertCBNotNull(cb); cb.checkSafetyResult(1); List ls = null; try { @@ -156,7 +162,7 @@ protected ENTITY helpSelectEntityWithDeletedCheckInternally( CB cb, InternalSelectEntityWithDeletedCheckCallback callback) { - assertConditionBeanNotNull(cb); + assertCBNotNull(cb); cb.checkSafetyResult(1); List ls = null; try { @@ -175,7 +181,7 @@ } //========================================================================== - // =========== + // ========= // List Read // ========= /** @@ -186,7 +192,7 @@ * list. (NotNull) */ public ListResultBean readList(ConditionBean cb) { - assertConditionBeanNotNull(cb); + assertCBNotNull(cb); return new jp.sf.pal.board.db.allcommon.cbean.ResultBeanBuilder( getTableDbName()).buildListResultBean(cb, callReadList(cb)); } @@ -198,7 +204,7 @@ * @return Read page. (NotNull) */ public PagingResultBean readPage(final ConditionBean cb) { - assertConditionBeanNotNull(cb); + assertCBNotNull(cb); final PagingInvoker invoker = new PagingInvoker( getTableDbName()); final PagingHandler handler = new PagingHandler() { @@ -225,8 +231,7 @@ * @exception jp.sf.pal.board.db.allcommon.exception.EntityAlreadyDeletedException * When the entity has already been deleted. */ - protected void assertEntityNotDeleted( - jp.sf.pal.board.db.allcommon.Entity entity, Object searchKey4Log) { + protected void assertEntityNotDeleted(Entity entity, Object searchKey4Log) { if (entity == null) { throwEntityAlreadyDeletedException(searchKey4Log); } @@ -239,7 +244,8 @@ * @param searchKey4Log Search-key for Logging. (NotNull) * @exception jp.sf.pal.board.db.allcommon.exception.EntityAlreadyDeletedException */ - protected void assertEntityNotDeleted(List ls, Object searchKey4Log) { + protected void assertEntityNotDeleted(List ls, + Object searchKey4Log) { if (ls == null || ls.isEmpty()) { throwEntityAlreadyDeletedException(searchKey4Log); } @@ -253,7 +259,8 @@ * @exception jp.sf.pal.board.db.allcommon.exception.EntityAlreadyDeletedException * @exception jp.sf.pal.board.db.allcommon.exception.EntityDuplicatedException */ - protected void assertEntitySelectedAsOne(List ls, Object searchKey4Log) { + protected void assertEntitySelectedAsOne(List ls, + Object searchKey4Log) { if (ls == null || ls.isEmpty()) { throwEntityAlreadyDeletedException(searchKey4Log); } @@ -274,49 +281,254 @@ //========================================================================== // ========= - // Various Select - // ============== - public OutsideSqlBasicExecutor outsideSql() { - assertDaoSelectorNotNull("outsideSql"); - final OutsideSqlDao outsideSqlDao = _daoSelector - .select(OutsideSqlDao.class); - return new OutsideSqlBasicExecutor(outsideSqlDao, getTableDbName()); - } + // Scalar Select + // ============= + /** + * The scalar function.
This is not static class because this uses + * the method 'invoke(BehaviorCommand)' + * + * @param The type of condition-bean. + * @param The type of result. + */ + public class SLFunction { // SL: ScaLar - private void assertDaoSelectorNotNull(String methodName) { - if (_daoSelector == null) { + /** The condition-bean for scalar select. (NotNull) */ + protected CB _conditionBean; + + /** The condition-bean for scalar select. (NotNull) */ + protected Class _resultType; + + /** + * @param conditionBean The condition-bean initialized only for scalar + * select. (NotNull) + * @param resultType The type os result. (NotNull) + */ + public SLFunction(CB conditionBean, Class resultType) { + _conditionBean = conditionBean; + _resultType = resultType; + } + + /** + * Select the maximum value.
+ * + *
+         * memberBhv.scalarSelect(Date.class).max(new ScalarQuery(MemberCB cb) {
+         *     cb.specify().columnMemberBirthday(); // the required specification of target column
+         *     cb.query().setMemberStatusCode_Equal_Formalized(); // query as you like it
+         * });
+         * 
+ * + * @param scalarQuery The query for scalar. (NotNull) + * @return The maximum value. (Nullable) + */ + public RESULT max(ScalarQuery scalarQuery) { + assertObjectNotNull("scalarQuery", scalarQuery); + return exec(scalarQuery, SqlClause.SelectClauseType.MAX); + } + + /** + * Select the minimum value.
+ * + *
+         * memberBhv.scalarSelect(Date.class).min(new ScalarQuery(MemberCB cb) {
+         *     cb.specify().columnMemberBirthday(); // the required specification of target column
+         *     cb.query().setMemberStatusCode_Equal_Formalized(); // query as you like it
+         * });
+         * 
+ * + * @param scalarQuery The query for scalar. (NotNull) + * @return The minimum value. (Nullable) + */ + public RESULT min(ScalarQuery scalarQuery) { + assertObjectNotNull("scalarQuery", scalarQuery); + return exec(scalarQuery, SqlClause.SelectClauseType.MIN); + } + + /** + * Select the summary value.
+ * + *
+         * purchaseBhv.scalarSelect(Integer.class).sum(new ScalarQuery(PurchaseCB cb) {
+         *     cb.specify().columnPurchaseCount(); // the required specification of target column
+         *     cb.query().setPurchaseDatetime_GreaterEqual(date); // query as you like it
+         * });
+         * 
+ * + * @param scalarQuery The query for scalar. (NotNull) + * @return The summary value. (Nullable) + */ + public RESULT sum(ScalarQuery scalarQuery) { + assertObjectNotNull("scalarQuery", scalarQuery); + return exec(scalarQuery, SqlClause.SelectClauseType.SUM); + } + + /** + * Select the average value.
+ * + *
+         * purchaseBhv.scalarSelect(Integer.class).avg(new ScalarQuery(PurchaseCB cb) {
+         *     cb.specify().columnPurchaseCount(); // the required specification of target column
+         *     cb.query().setPurchaseDatetime_GreaterEqual(date); // query as you like it
+         * });
+         * 
+ * + * @param scalarQuery The query for scalar. (NotNull) + * @return The average value. (Nullable) + */ + public RESULT avg(ScalarQuery scalarQuery) { + assertObjectNotNull("scalarQuery", scalarQuery); + return exec(scalarQuery, SqlClause.SelectClauseType.AVG); + } + + protected RESULT exec(ScalarQuery scalarQuery, + SqlClause.SelectClauseType selectClauseType) { + assertObjectNotNull("scalarQuery", scalarQuery); + assertObjectNotNull("selectClauseType", selectClauseType); + assertObjectNotNull("conditionBean", _conditionBean); + assertObjectNotNull("resultType", _resultType); + scalarQuery.query(_conditionBean); + assertScalarSelectRequiredSpecifyColumn(); + return invoke(createSelectScalarCBCommand(_conditionBean, + _resultType, selectClauseType)); + } + + protected void assertScalarSelectRequiredSpecifyColumn() { + final String columnName = _conditionBean.getSqlClause() + .getSpecifiedColumnNameAsOne(); + if (columnName == null) { + throwScalarSelectInvalidColumnSpecificationException(); + } + } + + protected void throwScalarSelectInvalidColumnSpecificationException() { String msg = "Look! Read the message below." + getLineSeparator(); msg = msg + "/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *" + getLineSeparator(); - msg = msg - + "Not found the selector of dao as behavior's attributed!" + msg = msg + "The specified column for scalar select was Invalid!" + getLineSeparator(); msg = msg + getLineSeparator(); msg = msg + "[Advice]" + getLineSeparator(); msg = msg - + "Please confirm the definition of the selector at your 'dbflute.dicon'." + + " You should call specify().column[TargetColumn]() only once." + getLineSeparator(); - msg = msg + "It is precondition that '" + methodName - + "()' needs the selector instance." + getLineSeparator(); - msg = msg + getLineSeparator(); - msg = msg + "[Your Behavior's Attributes]" + getLineSeparator(); - msg = msg + " _behaviorSelector : " + _behaviorSelector + msg = msg + " For example:" + getLineSeparator(); + msg = msg + " " + getLineSeparator(); + msg = msg + " [Wrong]" + getLineSeparator(); + msg = msg + " /- - - - - - - - - - - - - - - - - - - - " + getLineSeparator(); - msg = msg + " _daoSelector : " + _daoSelector + msg = msg + + " memberBhv.scalarSelect(Date.class).max(new ScalarQuery() {" + getLineSeparator(); - msg = msg + "* * * * * * * * * */" + getLineSeparator(); - throw new IllegalStateException(msg); + msg = msg + " public void query(MemberCB cb) {" + + getLineSeparator(); + msg = msg + " // *No! It's empty!" + getLineSeparator(); + msg = msg + " }" + getLineSeparator(); + msg = msg + " });" + getLineSeparator(); + msg = msg + " - - - - - - - - - -/" + getLineSeparator(); + msg = msg + " " + getLineSeparator(); + msg = msg + " [Wrong]" + getLineSeparator(); + msg = msg + " /- - - - - - - - - - - - - - - - - - - - " + + getLineSeparator(); + msg = msg + + " memberBhv.scalarSelect(Date.class).max(new ScalarQuery() {" + + getLineSeparator(); + msg = msg + " public void query(MemberCB cb) {" + + getLineSeparator(); + msg = msg + " cb.specify().columnMemberBirthday();" + + getLineSeparator(); + msg = msg + + " cb.specify().columnRegisterDatetime(); // *No! It's duplicated!" + + getLineSeparator(); + msg = msg + " }" + getLineSeparator(); + msg = msg + " });" + getLineSeparator(); + msg = msg + " - - - - - - - - - -/" + getLineSeparator(); + msg = msg + " " + getLineSeparator(); + msg = msg + " [Good!]" + getLineSeparator(); + msg = msg + " /- - - - - - - - - - - - - - - - - - - - " + + getLineSeparator(); + msg = msg + + " memberBhv.scalarSelect(Date.class).max(new ScalarQuery() {" + + getLineSeparator(); + msg = msg + " public void query(MemberCB cb) {" + + getLineSeparator(); + msg = msg + + " cb.specify().columnMemberBirthday(); // *Point!" + + getLineSeparator(); + msg = msg + " }" + getLineSeparator(); + msg = msg + " });" + getLineSeparator(); + msg = msg + " - - - - - - - - - -/" + getLineSeparator(); + msg = msg + getLineSeparator(); + msg = msg + "[ConditionBean Type]" + getLineSeparator() + + _conditionBean.getClass().getName() + getLineSeparator(); + msg = msg + getLineSeparator(); + msg = msg + "[Result Type]" + getLineSeparator() + + _resultType.getName() + getLineSeparator(); + msg = msg + "* * * * * * * * * */"; + throw new ScalarSelectInvalidColumnSpecificationException(msg); } } + public static class ScalarSelectInvalidColumnSpecificationException extends + RuntimeException { + private static final long serialVersionUID = 1L; + + public ScalarSelectInvalidColumnSpecificationException(String msg) { + super(msg); + } + } + + //========================================================================== + // ========= + // OutsideSql + // ========== /** - * Create value-label list. + * Get the basic executor of outside-SQL.
The invoker of behavior + * command should be not null when you call this method. * + *
+     * You can use the methods for outside-SQL are as follows:
+     * {Basic}
+     *   o selectList()
+     *   o execute()
+     *   o call()
+     * 
+     * {Entity}
+     *   o entityHandling().selectEntity()
+     *   o entityHandling().selectEntityWithDeletedCheck()
+     * 
+     * {Cursor}
+     *   o cursorHandling().selectCursor()
+     * 
+     * {Paging}
+     *   o autoPaging().selectList()
+     *   o autoPaging().selectPage()
+     *   o manualPaging().selectList()
+     *   o manualPaging().selectPage()
+     * 
+     * {Option -- Dynamic}
+     *   o dynamicBinding().selectList()
+     * 
+ * + * @return The basic executor of outside-SQL. (NotNull) + */ + public OutsideSqlBasicExecutor outsideSql() { + assertBehaviorCommandInvoker("outsideSql"); + return new OutsideSqlBasicExecutor(_behaviorCommandInvoker, + getTableDbName()); + } + + //========================================================================== + // ========= + // Various Select + // ============== + /** + * Create the list of value-label. + * * @param The type of entity. * @param entityList The list of entity. (NotNull) - * @param valueLabelSetupper Value-label-setupper. (NotNull) - * @return Value-label list. (NotNull) + * @param valueLabelSetupper The setupper of value-label. (NotNull) + * @return The list of value-label. (NotNull) */ public List> createValueLabelList( List entityList, @@ -362,10 +574,10 @@ } } - protected Object helpConvertingSequenceObject(Class resultClass, + protected Object helpConvertingSequenceObject(Class resultClass, Object sequenceObject) { try { - final Constructor constructor = resultClass + final Constructor constructor = resultClass .getConstructor(new Class[] { String.class }); return constructor.newInstance(new Object[] { sequenceObject .toString() }); @@ -534,6 +746,7 @@ * @param value The value of primary key. (Nullable) * @return The value of primary key. (Nullable) */ + @SuppressWarnings("unchecked") protected PK toLowerCasePrimaryKeyIfString(PK value) { return (PK) toLowerCaseIfString(value); } @@ -580,22 +793,22 @@ + "/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *" + getLineSeparator(); msg = msg - + "Not found the selector of behavior as behavior's attributed!" + + "Not found the selector of behavior as behavior's attribute!" + getLineSeparator(); msg = msg + getLineSeparator(); msg = msg + "[Advice]" + getLineSeparator(); msg = msg - + "Please confirm the definition of the selector at your 'dbflute.dicon'." + + "Please confirm the definition of the selector at your component configuration of DBFlute." + getLineSeparator(); msg = msg + "It is precondition that '" + methodName + "()' needs the selector instance." + getLineSeparator(); msg = msg + getLineSeparator(); msg = msg + "[Your Behavior's Attributes]" + getLineSeparator(); - msg = msg + " _behaviorSelector : " + _behaviorSelector + msg = msg + " _behaviorCommandInvoker : " + + _behaviorCommandInvoker + getLineSeparator(); + msg = msg + " _behaviorSelector : " + _behaviorSelector + getLineSeparator(); - msg = msg + " _daoSelector : " + _daoSelector - + getLineSeparator(); - msg = msg + "* * * * * * * * * */" + getLineSeparator(); + msg = msg + "* * * * * * * * * */"; throw new IllegalStateException(msg); } } @@ -648,14 +861,14 @@ public TokenFileOutputResult outputTokenFile(ConditionBean cb, String filename, TokenFileOutputOption tokenFileOutputOption) throws java.io.FileNotFoundException, java.io.IOException { - assertConditionBeanNotNull(cb); + assertCBNotNull(cb); assertStringNotNullAndNotTrimmedEmpty("filename", filename); assertObjectNotNull("tokenFileOutputOption", tokenFileOutputOption); final List ls = readList(cb); List> rowList = new ArrayList>(); - for (java.util.Iterator ite = ls.iterator(); ite.hasNext();) { - final Entity entity = (Entity) ite.next(); + for (java.util.Iterator ite = ls.iterator(); ite.hasNext();) { + final Entity entity = ite.next(); final List valueList = getDBMeta() .convertToColumnStringValueList(entity); rowList.add(valueList); @@ -665,9 +878,9 @@ .getFileMakingOption(); final FileMakingHeaderInfo fileMakingHeaderInfo = new FileMakingHeaderInfo(); final List columnDbNameList = new ArrayList(); - for (final java.util.Iterator ite = getDBMeta().getColumnInfoList() - .iterator(); ite.hasNext();) { - final ColumnInfo columnInfo = (ColumnInfo) ite.next(); + for (final java.util.Iterator ite = getDBMeta() + .getColumnInfoList().iterator(); ite.hasNext();) { + final ColumnInfo columnInfo = ite.next(); columnDbNameList.add(columnInfo.getColumnDbName()); } fileMakingHeaderInfo.setColumnNameList(columnDbNameList); @@ -690,7 +903,7 @@ * @return All count. */ protected int callGetCountAll() { - return readCount(newConditionBean()); + return callReadCount(newConditionBean()); } /** @@ -699,7 +912,7 @@ * @return All list. (NotNull) */ protected List callGetListAll() { - return readList(newConditionBean()); + return callReadList(newConditionBean()); } /** @@ -710,14 +923,12 @@ * @return Read count. (NotNull) */ protected int callReadCount(ConditionBean cb) { - assertConditionBeanNotNull(cb); - final Class[] types = new Class[] { cb.getClass() }; - final java.lang.reflect.Method mtd = getMethod(getDaoReadable() - .getClass(), "selectCount", types); - final Object result = invoke(mtd, getDaoReadable(), new Object[] { cb }); - return ((Integer) result).intValue(); + assertCBNotNull(cb); + return doCallReadCount(cb); } + protected abstract int doCallReadCount(ConditionBean cb); + /** * The implementation. * @@ -727,42 +938,110 @@ * (NotNull) */ protected List 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) result; + assertCBNotNull(cb); + return doCallReadList(cb); } - private Method getMethod(Class clazz, String methodName, Class[] argTypes) { - try { - return clazz.getMethod(methodName, argTypes); - } catch (NoSuchMethodException ex) { - String msg = "class=" + clazz + " method=" + methodName + "-" - + java.util.Arrays.asList(argTypes); - throw new RuntimeException(msg, ex); + protected abstract List doCallReadList(ConditionBean cb); + + //========================================================================== + // ========= + // Behavior Command + // ================ + public void warmUpCommand() { + { + SelectCountCBCommand cmd = createSelectCountCBCommand(newConditionBean()); + cmd.setInitializeOnly(true); + invoke(cmd); } + { + SelectListCBCommand cmd = createSelectListCBCommand( + newConditionBean(), getDBMeta().getEntityType()); + cmd.setInitializeOnly(true); + invoke(cmd); + } } - private Object invoke(Method method, Object target, Object[] args) { - try { - return method.invoke(target, args); - } catch (java.lang.reflect.InvocationTargetException ex) { - Throwable t = ex.getCause(); - if (t instanceof RuntimeException) { - throw (RuntimeException) t; - } - if (t instanceof Error) { - throw (Error) t; - } - String msg = "target=" + target + " method=" + method + "-" - + java.util.Arrays.asList(args); - throw new RuntimeException(msg, ex); - } catch (IllegalAccessException ex) { - String msg = "target=" + target + " method=" + method + "-" - + java.util.Arrays.asList(args); - throw new RuntimeException(msg, ex); + protected SelectCountCBCommand createSelectCountCBCommand(ConditionBean cb) { + assertBehaviorCommandInvoker("createSelectCountCBCommand"); + final SelectCountCBCommand command = xsetupSelectCommand(new SelectCountCBCommand()); + command.setConditionBeanType(cb.getClass()); + command.setConditionBean(cb); + return command; + } + + protected SelectListCBCommand createSelectListCBCommand( + ConditionBean cb, Class entityType) { + assertBehaviorCommandInvoker("createSelectListCBCommand"); + final SelectListCBCommand command = xsetupSelectCommand(new SelectListCBCommand()); + command.setConditionBeanType(cb.getClass()); + command.setConditionBean(cb); + command.setEntityType(entityType); + return command; + } + + protected SelectNextValCommand createSelectNextValCommand( + Class resultType) { + assertBehaviorCommandInvoker("createSelectNextValCommand"); + final SelectNextValCommand command = xsetupSelectCommand(new SelectNextValCommand()); + command.setResultType(resultType); + return command; + } + + protected SelectScalarCBCommand createSelectScalarCBCommand( + ConditionBean cb, Class resultType, + SqlClause.SelectClauseType selectClauseType) { + assertBehaviorCommandInvoker("createSelectScalarCBCommand"); + final SelectScalarCBCommand command = xsetupSelectCommand(new SelectScalarCBCommand()); + command.setConditionBeanType(cb.getClass()); + command.setConditionBean(cb); + command.setResultType(resultType); + command.setSelectClauseType(selectClauseType); + return command; + } + + private > COMMAND xsetupSelectCommand( + COMMAND command) { + command.setTableDbName(getTableDbName()); + _behaviorCommandInvoker.injectComponentProperty(command); + return command; + } + + /** + * Invoke the command of behavior. + * + * @param The type of result. + * @param behaviorCommand The command of behavior. (NotNull) + * @return The instance of result. (Nullable) + */ + protected RESULT invoke(BehaviorCommand behaviorCommand) { + return _behaviorCommandInvoker.invoke(behaviorCommand); + } + + protected void assertBehaviorCommandInvoker(String methodName) { + if (_behaviorCommandInvoker == null) { + String msg = "Look! Read the message below." + getLineSeparator(); + msg = msg + + "/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *" + + getLineSeparator(); + msg = msg + + "Not found the invoker of behavior command as behavior's attributed!" + + getLineSeparator(); + msg = msg + getLineSeparator(); + msg = msg + "[Advice]" + getLineSeparator(); + msg = msg + + "Please confirm the definition of the invoker at your 'dbflute.dicon'." + + getLineSeparator(); + msg = msg + "It is precondition that '" + methodName + + "()' needs the invoker instance." + getLineSeparator(); + msg = msg + getLineSeparator(); + msg = msg + "[Your Behavior's Attributes]" + getLineSeparator(); + msg = msg + " _behaviorCommandInvoker : " + + _behaviorCommandInvoker + getLineSeparator(); + msg = msg + " _behaviorSelector : " + _behaviorSelector + + getLineSeparator(); + msg = msg + "* * * * * * * * * */"; + throw new IllegalStateException(msg); } } @@ -800,6 +1079,7 @@ return SimpleSystemUtil.getLineSeparator(); } + @SuppressWarnings("unchecked") protected ENTITY helpDowncastInternally( Entity entity, Class clazz) { assertObjectNotNull("entity", entity); @@ -850,8 +1130,16 @@ * * @param cb Condition-bean. (NotNull) */ - protected void assertConditionBeanNotNull( - jp.sf.pal.board.db.allcommon.cbean.ConditionBean cb) { + protected void assertConditionBeanNotNull(ConditionBean cb) { + assertCBNotNull(cb); + } + + /** + * Assert that the condition-bean is not null. + * + * @param cb Condition-bean. (NotNull) + */ + protected void assertCBNotNull(ConditionBean cb) { assertObjectNotNull("cb", cb); } @@ -896,7 +1184,7 @@ * * @param ls List. (NotNull) */ - protected void assertListNotNullAndEmpty(List ls) { + protected void assertListNotNullAndEmpty(List ls) { assertObjectNotNull("ls", ls); if (!ls.isEmpty()) { String msg = "The list should be empty: ls=" + ls.toString(); @@ -909,7 +1197,7 @@ * * @param ls List. (NotNull) */ - protected void assertListNotNullAndNotEmpty(List ls) { + protected void assertListNotNullAndNotEmpty(List ls) { assertObjectNotNull("ls", ls); if (ls.isEmpty()) { String msg = "The list should not be empty: ls=" + ls.toString(); @@ -922,7 +1210,7 @@ * * @param ls List. (NotNull) */ - protected void assertListNotNullAndHasOnlyOne(List ls) { + protected void assertListNotNullAndHasOnlyOne(List ls) { assertObjectNotNull("ls", ls); if (ls.size() != 1) { String msg = "The list should contain only one object: ls=" @@ -936,38 +1224,39 @@ // Accessor // ======== /** - * Get the selector of behavior. + * Get the invoker of behavior command. * - * @return The select of behavior. (Nullable: But normally NotNull) + * @return The invoker of behavior command. (Nullable: But normally NotNull) */ - protected BehaviorSelector getBehaviorSelector() { - return _behaviorSelector; + protected BehaviorCommandInvoker getBehaviorCommandInvoker() { + return _behaviorCommandInvoker; } /** - * Set the selector of behavior. + * Set the invoker of behavior command. * - * @param behaviorSelector The selector of behavior. (NotNull) + * @param behaviorCommandInvoker The invoker of behavior command. (NotNull) */ - public void setBehaviorSelector(BehaviorSelector behaviorSelector) { - this._behaviorSelector = behaviorSelector; + public void setBehaviorCommandInvoker( + BehaviorCommandInvoker behaviorCommandInvoker) { + this._behaviorCommandInvoker = behaviorCommandInvoker; } /** - * Get the selector of DAO. + * Get the selector of behavior. * - * @return The select of DAO. (Nullable: But normally NotNull) + * @return The select of behavior. (Nullable: But normally NotNull) */ - protected DaoSelector getDaoSelector() { - return _daoSelector; + protected BehaviorSelector getBehaviorSelector() { + return _behaviorSelector; } /** - * Set the selector of DAO. + * Set the selector of behavior. * - * @param daoSelector The selector of DAO. (NotNull) + * @param behaviorSelector The selector of behavior. (NotNull) */ - public void setDaoSelector(DaoSelector daoSelector) { - _daoSelector = daoSelector; + public void setBehaviorSelector(BehaviorSelector behaviorSelector) { + this._behaviorSelector = behaviorSelector; } } Modified: board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/bhv/AbstractBehaviorWritable.java =================================================================== --- board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/bhv/AbstractBehaviorWritable.java 2008-12-27 22:06:42 UTC (rev 1624) +++ board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/bhv/AbstractBehaviorWritable.java 2008-12-27 22:09:08 UTC (rev 1625) @@ -4,10 +4,25 @@ import java.util.Iterator; import java.util.List; +import jp.sf.pal.board.db.allcommon.CommonColumnAutoSetupper; import jp.sf.pal.board.db.allcommon.Entity; import jp.sf.pal.board.db.allcommon.bhv.batch.TokenFileReflectionFailure; import jp.sf.pal.board.db.allcommon.bhv.batch.TokenFileReflectionOption; import jp.sf.pal.board.db.allcommon.bhv.batch.TokenFileReflectionResult; +import jp.sf.pal.board.db.allcommon.bhv.core.command.AbstractEntityCommand; +import jp.sf.pal.board.db.allcommon.bhv.core.command.AbstractListEntityCommand; +import jp.sf.pal.board.db.allcommon.bhv.core.command.BatchDeleteEntityCommand; +import jp.sf.pal.board.db.allcommon.bhv.core.command.BatchDeleteNonstrictEntityCommand; +import jp.sf.pal.board.db.allcommon.bhv.core.command.BatchInsertEntityCommand; +import jp.sf.pal.board.db.allcommon.bhv.core.command.BatchUpdateEntityCommand; +import jp.sf.pal.board.db.allcommon.bhv.core.command.BatchUpdateNonstrictEntityCommand; +import jp.sf.pal.board.db.allcommon.bhv.core.command.DeleteEntityCommand; +import jp.sf.pal.board.db.allcommon.bhv.core.command.DeleteNonstrictEntityCommand; +import jp.sf.pal.board.db.allcommon.bhv.core.command.InsertEntityCommand; +import jp.sf.pal.board.db.allcommon.bhv.core.command.QueryDeleteCBCommand; +import jp.sf.pal.board.db.allcommon.bhv.core.command.QueryUpdateEntityCBCommand; +import jp.sf.pal.board.db.allcommon.bhv.core.command.UpdateEntityCommand; +import jp.sf.pal.board.db.allcommon.bhv.core.command.UpdateNonstrictEntityCommand; import jp.sf.pal.board.db.allcommon.cbean.ConditionBean; import jp.sf.pal.board.db.allcommon.dbmeta.DBMeta; import jp.sf.pal.board.db.allcommon.helper.MapStringBuilder; @@ -20,7 +35,7 @@ import jp.sf.pal.board.db.allcommon.helper.token.file.impl.FileTokenImpl; /** - * The abstract class of behavior-writable. + * The abstract class of writable behavior. * * @author DBFlute(AutoGenerator) */ @@ -29,6 +44,31 @@ //========================================================================== // ========= + // Definition + // ========== + /** Map-string map-mark. */ + private static final String MAP_STRING_MAP_MARK = "map:"; + + /** Map-string start-brace. */ + private static final String MAP_STRING_START_BRACE = "@{"; + + /** Map-string end-brace. */ + private static final String MAP_STRING_END_BRACE = "@}"; + + /** Map-string delimiter. */ + private static final String MAP_STRING_DELIMITER = "@;"; + + /** Map-string equal. */ + private static final String MAP_STRING_EQUAL = "@="; + + //========================================================================== + // =========== + // Attribute + // ========= + protected CommonColumnAutoSetupper _commonColumnAutoSetupper; + + //========================================================================== + // ========= // Entity Update // ============= // ----------------------------------------------------- @@ -357,7 +397,7 @@ * @param entityList Entity list. (NotNull and NotEmpty) * @return The array of created count. */ - public int[] lumpCreate(java.util.List entityList) { + public int[] lumpCreate(List entityList) { assertListNotNullAndNotEmpty(entityList); return callCreateList(entityList); } @@ -370,7 +410,7 @@ * @exception jp.sf.pal.board.db.allcommon.exception.EntityAlreadyUpdatedException * If s2dao's version is over 1.0.47 (contains 1.0.47). */ - public int[] lumpModify(java.util.List entityList) { + public int[] lumpModify(List entityList) { assertListNotNullAndNotEmpty(entityList); return callModifyList(entityList); } @@ -383,7 +423,7 @@ * @exception jp.sf.pal.board.db.allcommon.exception.EntityAlreadyUpdatedException * If s2dao's version is over 1.0.47 (contains 1.0.47). */ - public int[] lumpRemove(java.util.List entityList) { + public int[] lumpRemove(List entityList) { assertListNotNullAndNotEmpty(entityList); return callRemoveList(entityList); } @@ -611,9 +651,11 @@ if (!processBeforeInsert(entity)) { return 1;/* as Normal End */ } - return getDaoWritable().create(entity); + return doCallCreate(entity); } + protected abstract int doCallCreate(Entity entity); + /** * Process before insert. * @@ -645,9 +687,11 @@ if (!processBeforeUpdate(entity)) { return 1;/* as Normal End */ } - return getDaoWritable().modifyModifiedOnly(entity); + return doCallModify(entity); } + protected abstract int doCallModify(Entity entity); + /** * Process before update. * @@ -678,9 +722,11 @@ if (!processBeforeDelete(entity)) { return 1;/* as Normal End */ } - return getDaoWritable().remove(entity); + return doCallRemove(entity); } + protected abstract int doCallRemove(Entity entity); + /** * Process before delete. * @@ -729,8 +775,38 @@ * (NotNull) */ protected void setupCommonColumnOfInsertIfNeeds(Entity targetEntity) { + final CommonColumnAutoSetupper setupper = getCommonColumnAutoSetupper(); + assertCommonColumnAutoSetupperNotNull(); + setupper.handleCommonColumnOfInsertIfNeeds(targetEntity); } + private void assertCommonColumnAutoSetupperNotNull() { + if (_commonColumnAutoSetupper == null) { + String msg = "Look! Read the message below." + getLineSeparator(); + msg = msg + + "/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *" + + getLineSeparator(); + msg = msg + + "Not found the auto set-upper of common column as behavior's attribute!" + + getLineSeparator(); + msg = msg + getLineSeparator(); + msg = msg + "[Advice]" + getLineSeparator(); + msg = msg + + "Please confirm the definition of the set-upper at your component configuration of DBFlute." + + getLineSeparator(); + msg = msg + getLineSeparator(); + msg = msg + "[Your Behavior's Attributes]" + getLineSeparator(); + msg = msg + " _behaviorCommandInvoker : " + + _behaviorCommandInvoker + getLineSeparator(); + msg = msg + " _behaviorSelector : " + _behaviorSelector + + getLineSeparator(); + msg = msg + " _commonColumnAutoSetupper : " + + _commonColumnAutoSetupper + getLineSeparator(); + msg = msg + "* * * * * * * * * */"; + throw new IllegalStateException(msg); + } + } + /** * Filter the entity of insert. * @@ -778,6 +854,9 @@ * (NotNull) */ protected void setupCommonColumnOfUpdateIfNeeds(Entity targetEntity) { + final CommonColumnAutoSetupper setupper = getCommonColumnAutoSetupper(); + assertCommonColumnAutoSetupperNotNull(); + setupper.handleCommonColumnOfUpdateIfNeeds(targetEntity); } /** @@ -843,12 +922,14 @@ * (NotNull) * @return Inserted count. */ - public int[] callCreateList(java.util.List entityList) { + public int[] callCreateList(List entityList) { assertObjectNotNull("entityList", entityList); helpFilterBeforeInsertInternally(entityList); - return getDaoWritable().createList(entityList); + return doCreateList(entityList); } + protected abstract int[] doCreateList(List entityList); + /** * The implementation. * @@ -856,12 +937,14 @@ * (NotNull) * @return Updated count. */ - public int[] callModifyList(java.util.List entityList) { + public int[] callModifyList(List entityList) { assertObjectNotNull("entityList", entityList); helpFilterBeforeUpdateInternally(entityList); - return getDaoWritable().modifyList(entityList); + return doModifyList(entityList); } + protected abstract int[] doModifyList(List entityList); + /** * The implementation. * @@ -869,12 +952,14 @@ * (NotNull) * @return Deleted count. */ - public int[] callRemoveList(java.util.List entityList) { + public int[] callRemoveList(List entityList) { assertObjectNotNull("entityList", entityList); helpFilterBeforeDeleteInternally(entityList); - return getDaoWritable().removeList(entityList); + return doRemoveList(entityList); } + protected abstract int[] doRemoveList(List entityList); + protected void assertEntityHasVersionNoValue(Entity entity) { if (!getDBMeta().hasVersionNo()) { return; @@ -994,4 +1079,148 @@ } return filteredList; } + + //========================================================================== + // ========= + // Behavior Command + // ================ + protected InsertEntityCommand createInsertEntityCommand(Entity entity) { + assertBehaviorCommandInvoker("createInsertEntityCommand"); + return xsetupEntityCommand(new InsertEntityCommand(), entity); + } + + protected UpdateEntityCommand createUpdateEntityCommand(Entity entity) { + assertBehaviorCommandInvoker("createUpdateEntityCommand"); + return xsetupEntityCommand(new UpdateEntityCommand(), entity); + } + + protected UpdateNonstrictEntityCommand createUpdateNonstrictEntityCommand( + Entity entity) { + assertBehaviorCommandInvoker("createUpdateNonstrictEntityCommand"); + return xsetupEntityCommand(new UpdateNonstrictEntityCommand(), entity); + } + + protected DeleteEntityCommand createDeleteEntityCommand(Entity entity) { + assertBehaviorCommandInvoker("createDeleteEntityCommand"); + return xsetupEntityCommand(new DeleteEntityCommand(), entity); + } + + protected DeleteNonstrictEntityCommand createDeleteNonstrictEntityCommand( + Entity entity) { + assertBehaviorCommandInvoker("createDeleteNonstrictEntityCommand"); + return xsetupEntityCommand(new DeleteNonstrictEntityCommand(), entity); + } + + private COMMAND xsetupEntityCommand( + COMMAND command, Entity entity) { + command.setTableDbName(getTableDbName()); + _behaviorCommandInvoker.injectComponentProperty(command); + command.setEntityType(entity.getClass()); + command.setEntity(entity); + return command; + } + + protected BatchInsertEntityCommand createBatchInsertEntityCommand( + List entityList) { + assertBehaviorCommandInvoker("createBatchInsertEntityCommand"); + return xsetupListEntityCommand(new BatchInsertEntityCommand(), + entityList); + } + + protected BatchUpdateEntityCommand createBatchUpdateEntityCommand( + List entityList) { + assertBehaviorCommandInvoker("createBatchUpdateEntityCommand"); + return xsetupListEntityCommand(new BatchUpdateEntityCommand(), + entityList); + } + + protected BatchUpdateNonstrictEntityCommand createBatchUpdateNonstrictEntityCommand( + List entityList) { + assertBehaviorCommandInvoker("createBatchUpdateNonstrictEntityCommand"); + return xsetupListEntityCommand(new BatchUpdateNonstrictEntityCommand(), + entityList); + } + + protected BatchDeleteEntityCommand createBatchDeleteEntityCommand( + List entityList) { + assertBehaviorCommandInvoker("createBatchDeleteEntityCommand"); + return xsetupListEntityCommand(new BatchDeleteEntityCommand(), + entityList); + } + + protected BatchDeleteNonstrictEntityCommand createBatchDeleteNonstrictEntityCommand( + List entityList) { + assertBehaviorCommandInvoker("createBatchDeleteNonstrictEntityCommand"); + return xsetupListEntityCommand(new BatchDeleteNonstrictEntityCommand(), + entityList); + } + + /** + * @param The type of behavior command for list entity. + * @param command The command of behavior. (NotNull) + * @param entityList The list of entity. (NotNull, NotEmpty) + * @return The command of behavior. (NotNull) + */ + private COMMAND xsetupListEntityCommand( + COMMAND command, List entityList) { + if (entityList.isEmpty()) { + String msg = "The argument 'entityList' should not be empty: " + + entityList; + throw new IllegalStateException(msg); + } + command.setTableDbName(getTableDbName()); + _behaviorCommandInvoker.injectComponentProperty(command); + command.setEntityType(entityList.get(0).getClass()); // *The list should + // not be empty! + command.setEntityList(entityList); + return command; + } + + protected QueryDeleteCBCommand createQueryDeleteCBCommand(ConditionBean cb) { + assertBehaviorCommandInvoker("createQueryDeleteCBCommand"); + final QueryDeleteCBCommand cmd = new QueryDeleteCBCommand(); + cmd.setTableDbName(getTableDbName()); + _behaviorCommandInvoker.injectComponentProperty(cmd); + cmd.setConditionBeanType(cb.getClass()); + cmd.setConditionBean(cb); + return cmd; + } + + protected QueryUpdateEntityCBCommand createQueryUpdateEntityCBCommand( + Entity entity, ConditionBean cb) { + assertBehaviorCommandInvoker("createQueryUpdateEntityCBCommand"); + final QueryUpdateEntityCBCommand cmd = new QueryUpdateEntityCBCommand(); + cmd.setTableDbName(getTableDbName()); + _behaviorCommandInvoker.injectComponentProperty(cmd); + cmd.setConditionBeanType(cb.getClass()); + cmd.setConditionBean(cb); + cmd.setEntityType(entity.getClass()); + cmd.setEntity(entity); + return cmd; + } + + //========================================================================== + // ========= + // Accessor + // ======== + /** + * Get the auto set-upper of common column. + * + * @return The auto set-upper of common column. (Nullable: But normally + * NotNull) + */ + protected CommonColumnAutoSetupper getCommonColumnAutoSetupper() { + return _commonColumnAutoSetupper; + } + + /** + * Set the auto set-upper of common column. + * + * @param commonColumnAutoSetupper The auto set-upper of common column. + * (NotNull) + */ + public void setCommonColumnAutoSetupper( + CommonColumnAutoSetupper commonColumnAutoSetupper) { + this._commonColumnAutoSetupper = commonColumnAutoSetupper; + } } Modified: board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/bhv/BehaviorReadable.java =================================================================== --- board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/bhv/BehaviorReadable.java 2008-12-27 22:06:42 UTC (rev 1624) +++ board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/bhv/BehaviorReadable.java 2008-12-27 22:09:08 UTC (rev 1625) @@ -1,6 +1,5 @@ package jp.sf.pal.board.db.allcommon.bhv; -import jp.sf.pal.board.db.allcommon.DaoReadable; import jp.sf.pal.board.db.allcommon.Entity; import jp.sf.pal.board.db.allcommon.cbean.ConditionBean; import jp.sf.pal.board.db.allcommon.cbean.ListResultBean; @@ -16,34 +15,12 @@ //========================================================================== // ========= - // Definition - // ========== - /** Map-string map-mark. */ - public static final String MAP_STRING_MAP_MARK = "map:"; - - /** Map-string list-mark. */ - public static final String MAP_STRING_LIST_MARK = "list:"; - - /** Map-string start-brace. */ - public static final String MAP_STRING_START_BRACE = "@{"; - - /** Map-string end-brace. */ - public static final String MAP_STRING_END_BRACE = "@}"; - - /** Map-string delimiter. */ - public static final String MAP_STRING_DELIMITER = "@;"; - - /** Map-string equal. */ - public static final String MAP_STRING_EQUAL = "@="; - - //========================================================================== - // ========= // Table name // ========== /** - * Get table db-name. + * Get table DB name. * - * @return Table db-name. (NotNull) + * @return Table DB name. (NotNull) */ public String getTableDbName(); @@ -52,25 +29,14 @@ // DBMeta // ====== /** - * Get dbmeta. + * Get the instance of DBMeta. * - * @return DBMeta. (NotNull) + * @return The instance of DBMeta. (NotNull) */ public DBMeta getDBMeta(); //========================================================================== // ========= - // Dao Accessor - // ============ - /** - * Get dao-readable. - * - * @return Dao-readable. (NotNull) - */ - public DaoReadable getDaoReadable(); - - //========================================================================== - // ========= // New Instance // ============ /** @@ -173,4 +139,13 @@ * @return The value of sequence. (NotNull) */ public java.math.BigDecimal readNextVal(); + + //========================================================================== + // ========= + // Warm Up + // ======= + /** + * Warm up the command of behavior. + */ + public void warmUpCommand(); } Modified: board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/bhv/BehaviorWritable.java =================================================================== --- board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/bhv/BehaviorWritable.java 2008-12-27 22:06:42 UTC (rev 1624) +++ board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/bhv/BehaviorWritable.java 2008-12-27 22:09:08 UTC (rev 1625) @@ -1,6 +1,7 @@ package jp.sf.pal.board.db.allcommon.bhv; -import jp.sf.pal.board.db.allcommon.DaoWritable; +import java.util.List; + import jp.sf.pal.board.db.allcommon.Entity; /** @@ -10,13 +11,6 @@ */ public interface BehaviorWritable extends BehaviorReadable { - /** - * Get dao-writable. - * - * @return Dao-writable. (NotNull) - */ - public DaoWritable getDaoWritable(); - //========================================================================== // =========== // Basic Entity Update @@ -116,15 +110,15 @@ /** * Lump create the list. * - * @param entityList Entity-list. (NotNull and NotEmpty) + * @param entityList The list of entity. (NotNull and NotEmpty) * @return The array of created count. */ - public int[] lumpCreate(java.util.List entityList); + public int[] lumpCreate(List entityList); /** - * Lump Modify the list. + * Lump modify the list. * - * @param entityList Entity-list. (NotNull and NotEmpty) + * @param entityList The list of entity. (NotNull and NotEmpty) * @return Modified count. * @exception jp.sf.pal.board.db.allcommon.exception.EntityAlreadyUpdatedException * When the entity has already been updated. And Only when @@ -132,12 +126,12 @@ * @exception jp.sf.pal.board.db.allcommon.exception.EntityDuplicatedException * When the entity has been duplicated. */ - public int[] lumpModify(java.util.List entityList); + public int[] lumpModify(List entityList); /** * Lump remove the list. * - * @param entityList Entity-list. (NotNull and NotEmpty) + * @param entityList The list of entity. (NotNull and NotEmpty) * @return Removed count. * @exception jp.sf.pal.board.db.allcommon.exception.EntityAlreadyUpdatedException * When the entity has already been updated. And Only when @@ -145,5 +139,5 @@ * @exception jp.sf.pal.board.db.allcommon.exception.EntityDuplicatedException * When the entity has been duplicated. */ - public int[] lumpRemove(java.util.List entityList); + public int[] lumpRemove(List entityList); } Added: board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/bhv/core/BehaviorCommand.java =================================================================== --- board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/bhv/core/BehaviorCommand.java (rev 0) +++ board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/bhv/core/BehaviorCommand.java 2008-12-27 22:09:08 UTC (rev 1625) @@ -0,0 +1,71 @@ +package jp.sf.pal.board.db.allcommon.bhv.core; + +import jp.sf.pal.board.db.allcommon.cbean.ConditionBean; +import jp.sf.pal.board.db.allcommon.cbean.outsidesql.OutsideSqlOption; + +/** + * @author DBFlute(AutoGenerator) + * @param The type of result. + */ +public interface BehaviorCommand { + + //========================================================================== + // ========= + // Basic Information + // ================= + public String getTableDbName(); + + public String getCommandName(); + + /** + * Get the return type of command. This type is not related to generic type + * because this is for conversion and check only. + * + * @return The return type of command. (NotNull) + */ + public Class getCommandReturnType(); + + public boolean isInitializeOnly(); + + //========================================================================== + // ========= + // Detail Information + // ================== + public boolean isConditionBean(); + + public boolean isOutsideSql(); + + public boolean isProcedure(); + + public boolean isSelect(); + + public boolean isSelectCount(); + + //========================================================================== + // ========= + // Process Callback + // ================ + public void beforeGettingSqlExecution(); + + public void afterExecuting(); + + //========================================================================== + // ========= + // SqlExecution Handling + // ===================== + public String buildSqlExecutionKey(); + + public SqlExecutionCreator createSqlExecutionCreator(); + + public Object[] getSqlExecutionArgument(); + + //========================================================================== + // ========= + // Argument Information + // ==================== + public ConditionBean getConditionBean(); + + public String getOutsideSqlPath(); + + public OutsideSqlOption getOutsideSqlOption(); +} Property changes on: board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/bhv/core/BehaviorCommand.java ___________________________________________________________________ Name: svn:eol-style + native Added: board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/bhv/core/BehaviorCommandComponentSetup.java =================================================================== --- board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/bhv/core/BehaviorCommandComponentSetup.java (rev 0) +++ board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/bhv/core/BehaviorCommandComponentSetup.java 2008-12-27 22:09:08 UTC (rev 1625) @@ -0,0 +1,23 @@ +package jp.sf.pal.board.db.allcommon.bhv.core; + +import javax.sql.DataSource; + +import org.seasar.dao.BeanMetaDataFactory; +import org.seasar.dao.ValueTypeFactory; +import org.seasar.extension.jdbc.StatementFactory; + +/** + * @author DBFlute(AutoGenerator) + */ +public interface BehaviorCommandComponentSetup { + + public void setDataSource(DataSource dataSource); + + public void setStatementFactory(StatementFactory statementFactory); + + public void setBeanMetaDataFactory(BeanMetaDataFactory beanMetaDataFactory); + + public void setValueTypeFactory(ValueTypeFactory valueTypeFactory); + + public void setSqlFileEncoding(String sqlFileEncoding); +} Property changes on: board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/bhv/core/BehaviorCommandComponentSetup.java ___________________________________________________________________ Name: svn:eol-style + native Added: board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/bhv/core/BehaviorCommandInvoker.java =================================================================== --- board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/bhv/core/BehaviorCommandInvoker.java (rev 0) +++ board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/bhv/core/BehaviorCommandInvoker.java 2008-12-27 22:09:08 UTC (rev 1625) @@ -0,0 +1,842 @@ +package jp.sf.pal.board.db.allcommon.bhv.core; + +import java.util.Arrays; +import java.util.List; +import java.util.Map; +import java.util.concurrent.ConcurrentHashMap; + +import javax.sql.DataSource; + +import jp.sf.pal.board.db.allcommon.DBFluteConfig; +import jp.sf.pal.board.db.allcommon.Entity; +import jp.sf.pal.board.db.allcommon.InternalMapContext; +import jp.sf.pal.board.db.allcommon.XLog; +import jp.sf.pal.board.db.allcommon.cbean.ConditionBeanContext; +import jp.sf.pal.board.db.allcommon.cbean.FetchNarrowingBeanContext; +import jp.sf.pal.board.db.allcommon.cbean.outsidesql.OutsideSqlContext; +import jp.sf.pal.board.db.allcommon.dbmeta.DBMeta; +import jp.sf.pal.board.db.allcommon.dbmeta.DBMetaInstanceHandler; +import jp.sf.pal.board.db.allcommon.helper.stacktrace.InvokeNameExtractingResource; +import jp.sf.pal.board.db.allcommon.helper.stacktrace.InvokeNameResult; +import jp.sf.pal.board.db.allcommon.helper.stacktrace.impl.InvokeNameExtractorImpl; +import jp.sf.pal.board.db.allcommon.jdbc.StatementConfig; +import jp.sf.pal.board.db.allcommon.s2dao.internal.various.InternalStatementFactory; +import jp.sf.pal.board.db.allcommon.util.SimpleSystemUtil; +import jp.sf.pal.board.db.allcommon.util.SimpleTypeUtil; +import jp.sf.pal.board.db.allcommon.util.TraceViewUtil; + +import org.seasar.dao.BeanMetaDataFactory; +import org.seasar.dao.ValueTypeFactory; +import org.seasar.extension.jdbc.StatementFactory; +import org.seasar.framework.util.Disposable; +import org.seasar.framework.util.DisposableUtil; + +/** + * The invoker of behavior command. + * + *
+ * public interface methods are as follows:
+ * 
+ *   o injectComponentProperty(BehaviorCommandComponentSetup behaviorCommand);
+ *   o invoke(BehaviorCommand behaviorCommand);
+ *   o isDisposable();
+ *   o isExecutionCacheEmpty();
+ * 
+ * + * @author DBFlute(AutoGenerator) + */ +public class BehaviorCommandInvoker implements Disposable { + + //========================================================================== + // ========= + // Attribute + // ========= + // ----------------------------------------------------- + // Injection Target + // ---------------- + protected DataSource _dataSource; + + protected BeanMetaDataFactory _beanMetaDataFactory; + + protected ValueTypeFactory _valueTypeFactory; + + // ----------------------------------------------------- + // Fixed Property + // -------------- + protected final StatementFactory _statementFactory = createStatememtFactory(); + + protected final Map _executionMap = new ConcurrentHashMap(); + + // ----------------------------------------------------- + // Dispose Status + // -------------- + protected boolean disposable; + + //========================================================================== + // ========= + // Constructor + // =========== + public BehaviorCommandInvoker() { + } + + //========================================================================== + // ========= + // Command Set up + // ============== + /** + * Inject the properties of component to the command of behavior. {Public + * Interface} + * + * @param behaviorCommand The command of behavior. (NotNull) + */ + public void injectComponentProperty( + BehaviorCommandComponentSetup behaviorCommand) { + behaviorCommand.setDataSource(_dataSource); + behaviorCommand.setStatementFactory(_statementFactory); + behaviorCommand.setBeanMetaDataFactory(_beanMetaDataFactory); + behaviorCommand.setValueTypeFactory(_valueTypeFactory); + behaviorCommand.setSqlFileEncoding(getSqlFileEncoding()); + } + + protected String getSqlFileEncoding() { + return "UTF-8"; // This value is set when generating. + } + + //========================================================================== + // ========= + // Command Invoke + // ============== + /** + * Invoke the command of behavior. {Public Interface} This method is an + * entry point! + * + * @param The type of result. + * @param behaviorCommand The command of behavior. (NotNull) + * @return The result object. (Nullable) + */ + public RESULT invoke(BehaviorCommand behaviorCommand) { + clearContext(); + try { + return doInvoke(behaviorCommand); + } finally { + clearContext(); + } + } + + /** + * @param The type of result. + * @param behaviorCommand The command of behavior. (NotNull) + * @return The result object. (Nullable) + */ + protected RESULT doInvoke(BehaviorCommand behaviorCommand) { + // - - - - - - - - - - - - - + // Initialize SQL Execution + // - - - - - - - - - - - - - + if (behaviorCommand.isInitializeOnly()) { + initializeSqlExecution(behaviorCommand); + return null; // The end! (Initialize Only) + } + behaviorCommand.beforeGettingSqlExecution(); + + SqlExecution execution = null; + try { + final String key = behaviorCommand.buildSqlExecutionKey(); + execution = getSqlExecution(key); + if (execution == null) { + long beforeCmd = 0; + if (isLogEnabled()) { + beforeCmd = System.currentTimeMillis(); + } + SqlExecutionCreator creator = behaviorCommand + .createSqlExecutionCreator(); + execution = getSqlExecution(key, creator); + if (isLogEnabled()) { + final long afterCmd = System.currentTimeMillis(); + if (beforeCmd != afterCmd) { + logSqlExecution(behaviorCommand, execution, beforeCmd, + afterCmd); + } + } + } + } finally { + if (isLogEnabled()) { + logInvocation(behaviorCommand); + } + } + + long before = 0; + if (isLogEnabled()) { + before = System.currentTimeMillis(); + } + + Object ret = null; + try { + final Object[] args = behaviorCommand.getSqlExecutionArgument(); + ret = executeSql(execution, args); + } finally { + behaviorCommand.afterExecuting(); + } + final Class retType = behaviorCommand.getCommandReturnType(); + assertRetType(retType, ret); + + if (isLogEnabled()) { + final long after = System.currentTimeMillis(); + logReturn(behaviorCommand, retType, ret, before, after); + } + + // - - - - - - - - - - + // Convert and Return! + // - - - - - - - - - - + if (retType.isPrimitive()) { + ret = convertPrimitiveWrapper(retType, ret); + } else if (Number.class.isAssignableFrom(retType)) { + ret = convertNumber(retType, ret); + } + @SuppressWarnings("unchecked") + final RESULT result = (RESULT) ret; + return result; + } + + //========================================================================== + // ========= + // SQL Execution + // ============= + protected void initializeSqlExecution( + BehaviorCommand behaviorCommand) { + final String key = behaviorCommand.buildSqlExecutionKey(); + SqlExecutionCreator creator = behaviorCommand + .createSqlExecutionCreator(); + getSqlExecution(key, creator); + } + + protected SqlExecution getSqlExecution(String key) { + return _executionMap.get(key); + } + + /** + * @param key The key of SQL execution. (NotNull) + * @param executionCreator The creator of SQL execution. (NotNull) + * @return The SQL execution that may be created then. (NotNull) + */ + protected SqlExecution getSqlExecution(String key, + SqlExecutionCreator executionCreator) { + SqlExecution execution = getSqlExecution(key); + if (execution == null) { + synchronized (_executionMap) { + execution = getSqlExecution(key); + if (execution == null) { + if (isLogEnabled()) { + log("...Initializing sqlExecution for the key '" + key + + "'"); + } + _executionMap.put(key, executionCreator + .createSqlExecution()); + } else { + if (isLogEnabled()) { + log("...Getting sqlExecution as cache because the previous thread have already initilized."); + } + } + } + execution = getSqlExecution(key); + if (execution == null) { + String msg = "sqlExecutionCreator.createSqlCommand() should not return null:"; + msg = msg + " sqlExecutionCreator=" + executionCreator + + " key=" + key; + throw new IllegalStateException(msg); + } + if (!disposable) { + synchronized (this) { + if (!disposable) { + toBeDisposable(); + } + } + } + } + return execution; + } + + protected Object executeSql(SqlExecution execution, Object[] args) { + return execution.execute(args); + } + + //========================================================================== + // ========= + // Log SqlCommand + // ============== + protected void logSqlExecution( + BehaviorCommand behaviorCommand, SqlExecution execution, + long beforeCmd, long afterCmd) { + log("SqlExecution Initialization Cost: [" + + TraceViewUtil.convertToPerformanceView(afterCmd - beforeCmd) + + "]"); + } + + //========================================================================== + // ========= + // Log Invocation + // ============== + protected void logInvocation( + BehaviorCommand behaviorCommand) { + final StackTraceElement[] stackTrace = new Exception().getStackTrace(); + final InvokeNameResult behaviorResult = extractBehaviorInvokeName(stackTrace); + filterBehaviorResult(behaviorCommand, behaviorResult); + + final String invokeClassName; + final String invokeMethodName; + if (!behaviorResult.isEmptyResult()) { + invokeClassName = behaviorResult.getSimpleClassName(); + invokeMethodName = behaviorResult.getMethodName(); + } else { + invokeClassName = behaviorCommand.getTableDbName(); + invokeMethodName = behaviorCommand.getCommandName(); + } + final String expWithoutKakko = buildInvocationExpressionWithoutKakko( + behaviorCommand, invokeClassName, invokeMethodName); + + // Save behavior invoke name for error message. + putObjectToMapContext("df:BehaviorInvokeName", expWithoutKakko + "()"); + + final String equalBorder = buildFitBorder("", "=", expWithoutKakko, + false); + final String callerExpression = expWithoutKakko + "()"; + + log("/=====================================================" + + equalBorder + "=="); + log(" " + + callerExpression); + log(" " + + equalBorder + "=/"); + + logPath(behaviorCommand, stackTrace, behaviorResult); + + if (behaviorCommand.isOutsideSql() && !behaviorCommand.isProcedure()) { + final OutsideSqlContext outsideSqlContext = getOutsideSqlContext(); + if (outsideSqlContext != null) { + log("path: " + behaviorCommand.getOutsideSqlPath()); + log("option: " + behaviorCommand.getOutsideSqlOption()); + } + } + } + + protected void filterBehaviorResult( + BehaviorCommand behaviorCommand, + InvokeNameResult behaviorResult) { + final String simpleClassName = behaviorResult.getSimpleClassName(); + if (simpleClassName == null) { + return; + } + if (simpleClassName.contains("Behavior") + && simpleClassName.endsWith("$SLFunction")) { + final String behaviorClassName = findBehaviorClassNameFromDBMeta(behaviorCommand + .getTableDbName()); + behaviorResult.setSimpleClassName(behaviorClassName); + behaviorResult.setMethodName("scalarSelect()." + + behaviorResult.getMethodName()); + } + } + + protected void logPath(BehaviorCommand behaviorCommand, + StackTraceElement[] stackTrace, InvokeNameResult behaviorResult) { + final int bhvNextIndex = behaviorResult.getNextStartIndex(); + final InvokeNameResult clientResult = extractClientInvokeName( + stackTrace, bhvNextIndex); + final int clientFirstIndex = clientResult.getFoundFirstIndex(); + final InvokeNameResult byPassResult = extractByPassInvokeName( + stackTrace, bhvNextIndex, clientFirstIndex - bhvNextIndex); + + final String clientInvokeName = clientResult.getInvokeName(); + final String byPassInvokeName = byPassResult.getInvokeName(); + final String behaviorInvokeName = behaviorResult.getInvokeName(); + if (clientInvokeName.trim().length() == 0 + && byPassInvokeName.trim().length() == 0) { + return; + } + + // Save client invoke name for error message. + if (!clientResult.isEmptyResult()) { + putObjectToMapContext("df:ClientInvokeName", clientInvokeName); + } + // Save by-pass invoke name for error message. + if (!byPassResult.isEmptyResult()) { + putObjectToMapContext("df:ByPassInvokeName", byPassInvokeName); + } + + log(clientInvokeName + byPassInvokeName + behaviorInvokeName + "..."); + } + + protected String buildInvocationExpressionWithoutKakko( + BehaviorCommand behaviorCommand, String invokeClassName, + String invokeMethodName) { + if (invokeClassName.contains("OutsideSql") + && invokeClassName.endsWith("Executor")) { // OutsideSql + // Executor Handling + try { + final String originalName = invokeClassName; + if (behaviorCommand.isOutsideSql()) { + final OutsideSqlContext outsideSqlContext = getOutsideSqlContext(); + final String tableDbName = outsideSqlContext + .getTableDbName(); + final String behaviorClassName = findBehaviorClassNameFromDBMeta(tableDbName); + invokeClassName = behaviorClassName + ".outsideSql()"; + if (originalName.endsWith("OutsideSqlEntityExecutor")) { + invokeClassName = invokeClassName + ".entityHandling()"; + } else if (originalName + .endsWith("OutsideSqlPagingExecutor")) { + if (outsideSqlContext.isAutoPagingLogging()) { + invokeClassName = invokeClassName + ".autoPaging()"; + } else { + invokeClassName = invokeClassName + + ".manualPaging()"; + } + } else if (originalName + .endsWith("OutsideSqlCursorExecutor")) { + invokeClassName = invokeClassName + ".cursorHandling()"; + } + } else { + invokeClassName = "OutsideSql"; + } + } catch (RuntimeException ignored) { + log("Ignored exception occurred: msg=" + ignored.getMessage()); + } + } + String callerExpressionWithoutKakko = invokeClassName + "." + + invokeMethodName; + if ("selectPage".equals(invokeMethodName)) { // Special Handling! + boolean resultTypeInteger = false; + if (behaviorCommand.isOutsideSql()) { + final OutsideSqlContext outsideSqlContext = getOutsideSqlContext(); + final Object resultTypeSpecification = outsideSqlContext + .getResultTypeSpecification(); + if (resultTypeSpecification != null + && resultTypeSpecification instanceof Class) { + final Class resultType = (Class) resultTypeSpecification; + if (Integer.class.isAssignableFrom(resultType)) { + resultTypeInteger = true; + } + } + } + if (resultTypeInteger || behaviorCommand.isSelectCount()) { + callerExpressionWithoutKakko = callerExpressionWithoutKakko + + "():count"; + } else { + callerExpressionWithoutKakko = callerExpressionWithoutKakko + + "():paging"; + } + } + return callerExpressionWithoutKakko; + } + + protected String buildFitBorder(String prefix, String element, + String lengthTargetString, boolean space) { + final int length = space ? lengthTargetString.length() / 2 + : lengthTargetString.length(); + final StringBuffer sb = new StringBuffer(); + sb.append(prefix); + for (int i = 0; i < length; i++) { + sb.append(element); + if (space) { + sb.append(" "); + } + } + if (space) { + sb.append(element); + } + return sb.toString(); + } + + protected InvokeNameResult extractClientInvokeName( + StackTraceElement[] stackTrace, final int startIndex) { + final List 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 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 suffixList = Arrays.asList(new String[] { "Bhv", + "BehaviorReadable", "BehaviorWritable", "PagingInvoker" }); + final List keywordList = Arrays.asList(new String[] { "Bhv$", + "BehaviorReadable$", "BehaviorWritable$" }); + final List ousideSql1List = Arrays + .asList(new String[] { "OutsideSql" }); + final List ousideSql2List = Arrays + .asList(new String[] { "Executor" }); + final List 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 suffixList) { + for (String suffix : suffixList) { + if (className.endsWith(suffix)) { + return true; + } + } + return false; + } + + protected boolean isClassNameContains(String className, + List keywordList) { + for (String keyword : keywordList) { + if (className.contains(keyword)) { + return true; + } + } + return false; + } + + /** + * @param resource the call-back resource for invoke-name-extracting. + * (NotNull) + * @param stackTrace Stack log. (NotNull) + * @return The result of invoke name. (NotNull: If not found, returns empty + * string.) + */ + protected InvokeNameResult extractInvokeName( + InvokeNameExtractingResource resource, + StackTraceElement[] stackTrace) { + final InvokeNameExtractorImpl extractor = new InvokeNameExtractorImpl(); + extractor.setStackTrace(stackTrace); + return extractor.extractInvokeName(resource); + } + + /** + * @param simpleClassName The simple class name. (NotNull) + * @return The simple class name removed the base prefix. (NotNull) + */ + protected String removeBasePrefixFromSimpleClassName(String simpleClassName) { + if (!simpleClassName.startsWith("Bs")) { + return simpleClassName; + } + final int prefixLength = "Bs".length(); + if (!Character.isUpperCase(simpleClassName.substring(prefixLength) + .charAt(0))) { + return simpleClassName; + } + if (simpleClassName.length() <= prefixLength) { + return simpleClassName; + } + return "" + simpleClassName.substring(prefixLength); + } + + protected String findBehaviorClassNameFromDBMeta(String tableDbName) { + final DBMeta dbmeta = DBMetaInstanceHandler.findDBMeta(tableDbName); + final String behaviorTypeName = dbmeta.getBehaviorTypeName(); + final String behaviorClassName = behaviorTypeName + .substring(behaviorTypeName.lastIndexOf(".") + ".".length()); + return removeBasePrefixFromSimpleClassName(behaviorClassName); + } + + //========================================================================== + // ========= + // Log Return + // ========== + protected void logReturn(BehaviorCommand behaviorCommand, + Class retType, Object ret, long before, long after) { + try { + final String daoResultPrefix = "===========/ [" + + TraceViewUtil.convertToPerformanceView(after - before) + + " - "; + if (List.class.isAssignableFrom(retType)) { + if (ret == null) { + log(daoResultPrefix + "Selected list: null]"); + } else { + final List ls = (java.util.List) ret; + if (ls.isEmpty()) { + log(daoResultPrefix + "Selected list: 0]"); + } else if (ls.size() == 1 && ls.get(0) instanceof Number) { + log(daoResultPrefix + "Selected count: " + ls.get(0) + + "]"); + } else { + log(daoResultPrefix + "Selected list: " + ls.size() + + " first=" + ls.get(0) + "]"); + } + } + } else if (Entity.class.isAssignableFrom(retType)) { + if (ret == null) { + log(daoResultPrefix + "Selected entity: null" + "]"); + } else { + final Entity entity = (Entity) ret; + log(daoResultPrefix + "Selected entity: " + entity + "]"); + } + } else if (Entity.class.isAssignableFrom(retType)) { + if (ret == null) { + log(daoResultPrefix + "Selected entity: null" + "]"); + } else { + final Entity entity = (Entity) ret; + log(daoResultPrefix + "Selected entity: " + entity + "]"); + } + } else if (int[].class.isAssignableFrom(retType)) { + if (ret == null) { + log(daoResultPrefix + "Selected entity: null" + "]"); + } else { + final int[] resultArray = (int[]) ret; + if (resultArray.length == 0) { + log(daoResultPrefix + "All updated count: 0]"); + } else { + final StringBuilder sb = new StringBuilder(); + boolean resultExpressionScope = true; + int resultCount = 0; + int loopCount = 0; + for (int element : resultArray) { + resultCount = resultCount + element; + if (resultExpressionScope) { + if (loopCount <= 10) { + if (sb.length() == 0) { + sb.append(element); + } else { + sb.append(",").append(element); + } + } else { + sb.append(",").append("..."); + resultExpressionScope = false; + } + } + ++loopCount; + } + sb.insert(0, "{").append("}"); + log(daoResultPrefix + "All updated count: " + + resultCount + " result=" + sb + "]"); + } + } + } else { + if (behaviorCommand.isSelectCount()) { + log(daoResultPrefix + "Selected count: " + ret + "]"); + } else { + log(daoResultPrefix + "Result: " + ret + "]"); + } + } + log(" "); + } catch (RuntimeException e) { + String msg = "Result object debug threw the exception: behaviorCommand="; + msg = msg + behaviorCommand + " retType=" + retType; + msg = msg + " ret=" + ret; + throw e; + } + } + + //========================================================================== + // ========= + // Context Helper + // ============== + protected OutsideSqlContext getOutsideSqlContext() { + if (!OutsideSqlContext.isExistOutsideSqlContextOnThread()) { + return null; + } + return OutsideSqlContext.getOutsideSqlContextOnThread(); + } + + protected void putObjectToMapContext(String key, Object value) { + InternalMapContext.setObject(key, value); + } + + protected void clearContext() { + if (OutsideSqlContext.isExistOutsideSqlContextOnThread()) { + OutsideSqlContext.clearOutsideSqlContextOnThread(); + } + if (FetchNarrowingBeanContext.isExistFetchNarrowingBeanOnThread()) { + // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + // - - - - - - - - - - - - - - - + // Because there is possible that fetch narrowing has been ignored + // for manualPaging of outsideSql. + // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + // - - - - - - - - - - - - - - - + FetchNarrowingBeanContext.getFetchNarrowingBeanOnThread() + .restoreIgnoredFetchNarrowing(); + + FetchNarrowingBeanContext.clearFetchNarrowingBeanOnThread(); + } + if (ConditionBeanContext.isExistConditionBeanOnThread()) { + ConditionBeanContext.clearConditionBeanOnThread(); + } + if (InternalMapContext.isExistInternalMapContextOnThread()) { + InternalMapContext.clearInternalMapContextOnThread(); + } + } + + //========================================================================== + // ========= + // Execute Status Log + // ================== + protected void log(String msg) { + XLog.log(msg); + } + + protected boolean isLogEnabled() { + return XLog.isLogEnabled(); + } + + protected StatementFactory createStatememtFactory() { + final StatementConfig defaultStatementConfig = DBFluteConfig + .getInstance().getDefaultStatementConfig(); + final boolean internalDebug = DBFluteConfig.getInstance() + .isInternalDebug(); + InternalStatementFactory factory = new InternalStatementFactory(); + factory.setDefaultStatementConfig(defaultStatementConfig); + factory.setInternalDebug(internalDebug); + return factory; + } + + //========================================================================== + // ========= + // Dispose + // ======= + public void toBeDisposable() { + DisposableUtil.add(this); + disposable = true; + } + + public void dispose() { + _executionMap.clear(); + disposable = false; + } + + public boolean isDisposable() { + return disposable; + } + + public boolean isExecutionCacheEmpty() { + return _executionMap.isEmpty(); + } + + //========================================================================== + // ========= + // Convert Helper + // ============== + protected Object convertPrimitiveWrapper(Class retType, Object ret) { + return SimpleTypeUtil.toWrapper(retType, ret); + } + + protected Object convertNumber(Class retType, Object ret) { + return SimpleTypeUtil.toNumber(retType, ret); + } + + //========================================================================== + // ========= + // Assert Helper + // ============= + protected void assertRetType(Class retType, Object ret) { + if (List.class.isAssignableFrom(retType)) { + if (ret != null && !(ret instanceof List)) { + String msg = "The retType is difference from actual return: "; + msg = msg + "retType=" + retType + " ret.getClass()=" + + ret.getClass() + " ref=" + ret; + throw new IllegalStateException(msg); + } + } else if (Entity.class.isAssignableFrom(retType)) { + if (ret != null && !(ret instanceof Entity)) { + String msg = "The retType is difference from actual return: "; + msg = msg + "retType=" + retType + " ret.getClass()=" + + ret.getClass() + " ref=" + ret; + throw new IllegalStateException(msg); + } + } + } + + //========================================================================== + // ========= + // General Helper + // ============== + protected String getLineSeparator() { + return SimpleSystemUtil.getLineSeparator(); + } + + //========================================================================== + // ========= + // Accessor + // ======== + public void setDataSource(DataSource dataSource) { + _dataSource = dataSource; + } + + public void setBeanMetaDataFactory(BeanMetaDataFactory beanMetaDataFactory) { + _beanMetaDataFactory = beanMetaDataFactory; + } + + public void setValueTypeFactory(ValueTypeFactory valueTypeFactory) { + _valueTypeFactory = valueTypeFactory; + } +} Property changes on: board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/bhv/core/BehaviorCommandInvoker.java ___________________________________________________________________ Name: svn:eol-style + native Added: board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/bhv/core/BehaviorInitializer.java =================================================================== --- board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/bhv/core/BehaviorInitializer.java (rev 0) +++ board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/bhv/core/BehaviorInitializer.java 2008-12-27 22:09:08 UTC (rev 1625) @@ -0,0 +1,186 @@ +package jp.sf.pal.board.db.allcommon.bhv.core; + +import java.util.Collections; +import java.util.Map; +import java.util.concurrent.ConcurrentHashMap; + +import javax.sql.XADataSource; + +import jp.sf.pal.board.db.allcommon.DBDef; +import jp.sf.pal.board.db.allcommon.DBFluteConfig; +import jp.sf.pal.board.db.allcommon.cbean.ConditionBeanContext; +import jp.sf.pal.board.db.allcommon.dbmeta.DBMetaInstanceHandler; +import jp.sf.pal.board.db.allcommon.s2dao.internal.sqllog.InternalSqlLogRegistry; +import jp.sf.pal.board.db.allcommon.util.SimpleSystemUtil; + +import org.seasar.extension.dbcp.impl.XADataSourceImpl; + +/** + * @author DBFlute(AutoGenerator) + */ +public class BehaviorInitializer { + + //========================================================================== + // ========= + // Definition + // ========== + /** Log-instance. */ + private static final org.apache.commons.logging.Log _log = org.apache.commons.logging.LogFactory + .getLog(BehaviorInitializer.class); + + // ----------------------------------------------------- + // For DBMeta + // ---------- + /** + * The map of table DB name and class name for the handler of DB meta + * instance. + */ + protected static final Map _tableDbNameClassNameMap; + static { + final Map tmpMap = newConcurrentHashMap(); + tmpMap.put("ATTACHMENT", + "jp.sf.pal.board.db.bsentity.dbmeta.AttachmentDbm"); + tmpMap + .put("CATEGORY", + "jp.sf.pal.board.db.bsentity.dbmeta.CategoryDbm"); + tmpMap.put("CATEGORY_ACCESS", + "jp.sf.pal.board.db.bsentity.dbmeta.CategoryAccessDbm"); + tmpMap.put("GROUP_INFO", + "jp.sf.pal.board.db.bsentity.dbmeta.GroupInfoDbm"); + tmpMap.put("GROUP_MAPPING", + "jp.sf.pal.board.db.bsentity.dbmeta.GroupMappingDbm"); + tmpMap.put("MESSAGE", "jp.sf.pal.board.db.bsentity.dbmeta.MessageDbm"); + tmpMap.put("MESSAGE_ATTACHMENT", + "jp.sf.pal.board.db.bsentity.dbmeta.MessageAttachmentDbm"); + tmpMap.put("MESSAGE_CONTENT", + "jp.sf.pal.board.db.bsentity.dbmeta.MessageContentDbm"); + tmpMap.put("REPLY", "jp.sf.pal.board.db.bsentity.dbmeta.ReplyDbm"); + tmpMap.put("ROLE_INFO", + "jp.sf.pal.board.db.bsentity.dbmeta.RoleInfoDbm"); + tmpMap.put("ROLE_MAPPING", + "jp.sf.pal.board.db.bsentity.dbmeta.RoleMappingDbm"); + tmpMap.put("USER_INFO", + "jp.sf.pal.board.db.bsentity.dbmeta.UserInfoDbm"); + _tableDbNameClassNameMap = Collections.unmodifiableMap(tmpMap); + } + + protected static ConcurrentHashMap newConcurrentHashMap() { + return new ConcurrentHashMap(); + } + + //========================================================================== + // ========= + // Constructor + // =========== + /** + * Constructor. And initialize various components related behavior. + * + * @param xaDataSource The data source of XA. (Nullable) + */ + public BehaviorInitializer(XADataSource xaDataSource) { + _log + .info("/* * * * * * * * * * * * * * * * * * * * * * * * * * * * {DBFlute}"); + initializeDBMetaResource(); + handleSqlLogRegistry(); + loadCoolClasses(); + if (xaDataSource != null) { + showInformation(xaDataSource); + setupDBDefByDriverClassName(xaDataSource); + } + DBFluteConfig.getInstance().lock(); + _log.info("* * * * */"); + } + + //========================================================================== + // ========= + // DBMeta + // ====== + protected void initializeDBMetaResource() { + DBMetaInstanceHandler.setupDBMetaResource(_tableDbNameClassNameMap); + } + + //========================================================================== + // ========= + // Cool Classes + // ============ + protected void loadCoolClasses() { // for S2Container basically + ConditionBeanContext.loadCoolClasses(); // Against the ClassLoader + // Headache! + } + + //========================================================================== + // ========= + // Information + // =========== + protected void showInformation(XADataSource xaDataSource) { + if (xaDataSource != null && xaDataSource instanceof XADataSourceImpl) { + final StringBuilder sb = new StringBuilder(); + final XADataSourceImpl xaDataSourceImpl = (XADataSourceImpl) xaDataSource; + final String driverClassName = xaDataSourceImpl + .getDriverClassName(); + final String url = xaDataSourceImpl.getURL(); + final String user = xaDataSourceImpl.getUser(); + sb.append(" [XADataSource]:").append(getLineSeparator()); + sb.append(" driver = " + driverClassName).append( + getLineSeparator()); + sb.append(" url = " + url).append(getLineSeparator()); + sb.append(" user = " + user); + _log.info("{Injection Information}" + getLineSeparator() + sb); + } + } + + //========================================================================== + // ========= + // Database Product Name + // ===================== + protected void setupDBDefByDriverClassName(XADataSource xaDataSource) { + if (xaDataSource != null && xaDataSource instanceof XADataSourceImpl) { + final XADataSourceImpl xaDataSourceImpl = (XADataSourceImpl) xaDataSource; + final String driverClassName = xaDataSourceImpl + .getDriverClassName(); + final DBDef dbdef = DBDef.byDriverClassName(driverClassName); + if (dbdef != null) { + DBDef.setCurrentDef(dbdef); + return; + } + } + } + + //========================================================================== + // ========= + // SQL Log Registry + // ================ + protected void handleSqlLogRegistry() { + if (DBFluteConfig.getInstance().isUseSqlLogRegistry()) { + final StringBuilder sb = new StringBuilder(); + sb.append("{SqlLog Information}").append(getLineSeparator()); + sb.append(" [SqlLogRegistry]").append(getLineSeparator()); + if (InternalSqlLogRegistry.setupSqlLogRegistry()) { + sb + .append( + " ...Setting up SqlLogRegistry(org.seasar.extension.jdbc)!") + .append(getLineSeparator()); + sb + .append(" Because the property 'useSqlLogRegistry' of the config of DBFlute is true."); + } else { + sb + .append(" SqlLogRegistry(org.seasar.extension.jdbc) is not supported at the version!"); + } + _log.info(sb); + } else { + final Object sqlLogRegistry = InternalSqlLogRegistry + .findContainerSqlLogRegistry(); + if (sqlLogRegistry != null) { + InternalSqlLogRegistry.closeRegistration(); + } + } + } + + //========================================================================== + // ========= + // General Helper + // ============== + protected String getLineSeparator() { + return SimpleSystemUtil.getLineSeparator(); + } +} Property changes on: board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/bhv/core/BehaviorInitializer.java ___________________________________________________________________ Name: svn:eol-style + native Added: board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/bhv/core/SqlExecution.java =================================================================== --- board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/bhv/core/SqlExecution.java (rev 0) +++ board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/bhv/core/SqlExecution.java 2008-12-27 22:09:08 UTC (rev 1625) @@ -0,0 +1,9 @@ +package jp.sf.pal.board.db.allcommon.bhv.core; + +/** + * @author DBFlute(AutoGenerator) + */ +public interface SqlExecution { + + public Object execute(Object[] args); +} Property changes on: board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/bhv/core/SqlExecution.java ___________________________________________________________________ Name: svn:eol-style + native Added: board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/bhv/core/SqlExecutionCreator.java =================================================================== --- board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/bhv/core/SqlExecutionCreator.java (rev 0) +++ board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/bhv/core/SqlExecutionCreator.java 2008-12-27 22:09:08 UTC (rev 1625) @@ -0,0 +1,9 @@ +package jp.sf.pal.board.db.allcommon.bhv.core; + +/** + * @author DBFlute(AutoGenerator) + */ +public interface SqlExecutionCreator { + + SqlExecution createSqlExecution(); +} Property changes on: board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/bhv/core/SqlExecutionCreator.java ___________________________________________________________________ Name: svn:eol-style + native Added: board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/bhv/core/command/AbstractBehaviorCommand.java =================================================================== --- board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/bhv/core/command/AbstractBehaviorCommand.java (rev 0) +++ board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/bhv/core/command/AbstractBehaviorCommand.java 2008-12-27 22:09:08 UTC (rev 1625) @@ -0,0 +1,261 @@ +package jp.sf.pal.board.db.allcommon.bhv.core.command; + +import java.sql.ResultSet; +import java.sql.SQLException; +import java.util.ArrayList; +import java.util.List; + +import javax.sql.DataSource; + +import jp.sf.pal.board.db.allcommon.DBDef; +import jp.sf.pal.board.db.allcommon.bhv.core.BehaviorCommand; +import jp.sf.pal.board.db.allcommon.bhv.core.BehaviorCommandComponentSetup; +import jp.sf.pal.board.db.allcommon.s2dao.internal.rshandler.InternalBeanListMetaDataResultSetHandler; +import jp.sf.pal.board.db.allcommon.s2dao.internal.sqlcommand.InternalUpdateDynamicCommand; +import jp.sf.pal.board.db.allcommon.s2dao.internal.various.InternalRelationRowCreator; +import jp.sf.pal.board.db.allcommon.s2dao.internal.various.InternalRowCreator; + +import org.seasar.dao.BeanMetaData; +import org.seasar.dao.BeanMetaDataFactory; +import org.seasar.dao.ValueTypeFactory; +import org.seasar.extension.jdbc.ResultSetHandler; +import org.seasar.extension.jdbc.StatementFactory; +import org.seasar.extension.jdbc.ValueType; +import org.seasar.extension.jdbc.types.ValueTypes; + +/** + * @author DBFlute(AutoGenerator) + * @param The type of result. + */ +public abstract class AbstractBehaviorCommand implements + BehaviorCommand, BehaviorCommandComponentSetup { + + //========================================================================== + // ========= + // Attribute + // ========= + // ----------------------------------------------------- + // Basic Information + // ----------------- + /** The table DB name. (Required) */ + protected String _tableDbName; + + /** Is it initialize only? (Choice) */ + protected boolean _initializeOnly; + + // ----------------------------------------------------- + // Injection Component + // ------------------- + protected DataSource _dataSource; + + protected StatementFactory _statementFactory; + + protected BeanMetaDataFactory _beanMetaDataFactory; + + protected ValueTypeFactory _valueTypeFactory; + + protected String _sqlFileEncoding; + + //========================================================================== + // ========= + // Factory + // ======= + // ----------------------------------------------------- + // UpdateDynamicCommnd + // ------------------- + protected InternalUpdateDynamicCommand createUpdateDynamicCommand( + String[] argNames, Class[] argTypes, String sql) { + final InternalUpdateDynamicCommand cmd = new InternalUpdateDynamicCommand( + _dataSource, _statementFactory); + cmd.setArgNames(argNames); + cmd.setArgTypes(argTypes); + if (sql != null) { + cmd.setSql(sql); + } + return cmd; + } + + // ----------------------------------------------------- + // ResultSetHandler + // ---------------- + protected ResultSetHandler createBeanListMetaDataResultSetHandler( + BeanMetaData bmd) { + final InternalRowCreator rowCreator = createInternalRowCreator(bmd); + final InternalRelationRowCreator relationRowCreator = createInternalRelationRowCreator(bmd); + return new InternalBeanListMetaDataResultSetHandler(bmd, rowCreator, + relationRowCreator); + } + + protected ResultSetHandler createObjectResultSetHandler(Class objectType) { + final ValueType valueType = ValueTypes.getValueType(objectType); + return new InternalObjectResultSetHandler(valueType); + } + + protected ResultSetHandler createObjectListResultSetHandler( + Class objectType) { + final ValueType valueType = ValueTypes.getValueType(objectType); + return createObjectListResultSetHandler(valueType); + } + + protected ResultSetHandler createObjectListResultSetHandler( + ValueType valueType) { + return new InternalObjectListResultSetHandler(valueType); + } + + protected static class InternalObjectResultSetHandler implements + ResultSetHandler { + private ValueType valueType; + + public InternalObjectResultSetHandler(ValueType valueType) { + this.valueType = valueType; + } + + public Object handle(ResultSet rs) throws SQLException { + while (rs.next()) { + return valueType.getValue(rs, 1); + } + return null; + } + } + + protected static class InternalObjectListResultSetHandler implements + ResultSetHandler { + private ValueType valueType; + + public InternalObjectListResultSetHandler(ValueType valueType) { + this.valueType = valueType; + } + + public Object handle(ResultSet rs) throws SQLException { + final List ret = new ArrayList(); + while (rs.next()) { + ret.add(valueType.getValue(rs, 1)); + } + return ret; + } + } + + protected static class InternalNullResultSetHandler implements + ResultSetHandler { + public Object handle(ResultSet rs) throws SQLException { + return null; + } + } + + protected InternalRowCreator createInternalRowCreator(BeanMetaData bmd) { + final Class clazz = bmd != null ? bmd.getBeanClass() : null; + return InternalRowCreator.createInternalRowCreator(clazz); + } + + protected InternalRelationRowCreator createInternalRelationRowCreator( + BeanMetaData bmd) { + return new InternalRelationRowCreator(); // Not yet implemented about + // performance tuning! + } + + //========================================================================== + // ========= + // Assist Helper + // ============= + protected String buildDbmsSuffix() { + final String productName = DBDef.getCurrentDef().code(); + return (productName != null ? "_" + productName.toLowerCase() : ""); + } + + //========================================================================== + // ========= + // Assert Helper + // ============= + protected void assertBasicProperty(String methodName) { + if (_tableDbName == null) { + throw new IllegalStateException(buildAssertMessage("_tableDbName", + methodName)); + } + } + + protected void assertComponentProperty(String methodName) { + if (_dataSource == null) { + throw new IllegalStateException(buildAssertMessage("_dataSource", + methodName)); + } + if (_statementFactory == null) { + throw new IllegalStateException(buildAssertMessage( + "_statementFactory", methodName)); + } + if (_beanMetaDataFactory == null) { + throw new IllegalStateException(buildAssertMessage( + "_beanMetaDataFactory", methodName)); + } + if (_valueTypeFactory == null) { + throw new IllegalStateException(buildAssertMessage( + "_valueTypeFactory", methodName)); + } + if (_sqlFileEncoding == null) { + throw new IllegalStateException(buildAssertMessage( + "_sqlFileEncoding", methodName)); + } + } + + protected String buildAssertMessage(String propertyName, String methodName) { + propertyName = propertyName.startsWith("_") ? propertyName + .substring("_".length()) : propertyName; + String msg = "The property '" + propertyName + "' should not be null"; + msg = msg + " when you call " + methodName + "()."; + throw new IllegalStateException(msg); + } + + //========================================================================== + // ========= + // Basic Override + // ============== + @Override + public String toString() { + return getClass().getSimpleName() + ":{" + buildSqlExecutionKey() + "}"; + } + + //========================================================================== + // ========= + // Accessor + // ======== + // ----------------------------------------------------- + // Basic Information + // ----------------- + public String getTableDbName() { + return _tableDbName; + } + + public void setTableDbName(String tableDbName) { + _tableDbName = tableDbName; + } + + public void setInitializeOnly(boolean initializeOnly) { + _initializeOnly = initializeOnly; + } + + public boolean isInitializeOnly() { + return _initializeOnly; + } + + // ----------------------------------------------------- + // Injection Component + // ------------------- + public void setDataSource(DataSource dataSource) { + _dataSource = dataSource; + } + + public void setStatementFactory(StatementFactory statementFactory) { + _statementFactory = statementFactory; + } + + public void setBeanMetaDataFactory(BeanMetaDataFactory beanMetaDataFactory) { + _beanMetaDataFactory = beanMetaDataFactory; + } + + public void setValueTypeFactory(ValueTypeFactory valueTypeFactory) { + _valueTypeFactory = valueTypeFactory; + } + + public void setSqlFileEncoding(String sqlFileEncoding) { + _sqlFileEncoding = sqlFileEncoding; + } +} Property changes on: board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/bhv/core/command/AbstractBehaviorCommand.java ___________________________________________________________________ Name: svn:eol-style + native Added: board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/bhv/core/command/AbstractEntityCommand.java =================================================================== --- board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/bhv/core/command/AbstractEntityCommand.java (rev 0) +++ board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/bhv/core/command/AbstractEntityCommand.java 2008-12-27 22:09:08 UTC (rev 1625) @@ -0,0 +1,182 @@ +package jp.sf.pal.board.db.allcommon.bhv.core.command; + +import java.util.ArrayList; +import java.util.List; + +import jp.sf.pal.board.db.allcommon.Entity; +import jp.sf.pal.board.db.allcommon.cbean.ConditionBean; +import jp.sf.pal.board.db.allcommon.cbean.outsidesql.OutsideSqlOption; +import jp.sf.pal.board.db.allcommon.dbmeta.DBMeta; + +import org.seasar.dao.BeanMetaData; +import org.seasar.extension.jdbc.PropertyType; + +/** + * @author DBFlute(AutoGenerator) + */ +public abstract class AbstractEntityCommand extends + AbstractBehaviorCommand { + + //========================================================================== + // ========= + // Attribute + // ========= + /** The type of entity. (Required) */ + protected Class _entityType; + + /** The instance of condition-bean. (Required) */ + protected Entity _entity; + + //========================================================================== + // ========= + // Basic Information + // ================= + public Class getCommandReturnType() { + return Integer.class; + } + + //========================================================================== + // ========= + // Detail Information + // ================== + public boolean isConditionBean() { + return false; + } + + public boolean isOutsideSql() { + return false; + } + + public boolean isProcedure() { + return false; + } + + public boolean isSelect() { + return false; + } + + public boolean isSelectCount() { + return false; + } + + //========================================================================== + // ========= + // Factory + // ======= + // ----------------------------------------------------- + // BeanMetaData + // ------------ + protected BeanMetaData createBeanMetaData() { + return _beanMetaDataFactory.createBeanMetaData(_entityType); + } + + //========================================================================== + // ========= + // Process Callback + // ================ + public void beforeGettingSqlExecution() { + } + + public void afterExecuting() { + } + + //========================================================================== + // ========= + // SqlExecution Handling + // ===================== + public String buildSqlExecutionKey() { + assertStatus("buildSqlExecutionKey"); + return _tableDbName + ":" + getCommandName() + "(" + + _entityType.getSimpleName() + ")"; + } + + public Object[] getSqlExecutionArgument() { + assertStatus("getSqlExecutionArgument"); + return new Object[] { _entity }; + } + + //========================================================================== + // ========= + // Argument Information + // ==================== + public ConditionBean getConditionBean() { + return null; + } + + public String getOutsideSqlPath() { + return null; + } + + public OutsideSqlOption getOutsideSqlOption() { + return null; + } + + //========================================================================== + // ========= + // Assist Helper + // ============= + protected DBMeta findDBMeta() { + // /- - - - - - - - - - - - - - - - - - - - - - - - - - - - + // Cannot use the handler of DBMeta instance + // because the customize-entity is contained to find here. + // - - - - - - - - - -/ + // DBMetaInstanceHandler.findDBMeta(_tableDbName); + + final Class beanType = _entityType; + if (beanType == null) { + return null; + } + if (!Entity.class.isAssignableFrom(beanType)) { + return null; + } + final Entity entity; + try { + entity = (Entity) beanType.newInstance(); + } catch (InstantiationException e) { + throw new IllegalStateException(e); + } catch (IllegalAccessException e) { + throw new IllegalStateException(e); + } + return entity.getDBMeta(); + } + + protected String[] getPersistentPropertyNames(BeanMetaData bmd) { + final List nameList = new ArrayList(); + for (int i = 0; i < bmd.getPropertyTypeSize(); ++i) { + final PropertyType pt = bmd.getPropertyType(i); + if (pt.isPersistent()) { + nameList.add(pt.getPropertyName()); + } + } + return nameList.toArray(new String[nameList.size()]); + } + + //========================================================================== + // ========= + // Assert Helper + // ============= + protected void assertStatus(String methodName) { + assertBasicProperty(methodName); + assertComponentProperty(methodName); + if (_entityType == null) { + throw new IllegalStateException(buildAssertMessage("_entityType", + methodName)); + } + if (_entity == null) { + throw new IllegalStateException(buildAssertMessage("_entity", + methodName)); + } + } + + //========================================================================== + // ========= + // Accessor + // ======== + public void setEntityType(Class entityType) { + _entityType = entityType; + } + + public void setEntity(Entity entity) { + _entity = entity; + } +} Property changes on: board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/bhv/core/command/AbstractEntityCommand.java ___________________________________________________________________ Name: svn:eol-style + native Added: board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/bhv/core/command/AbstractListEntityCommand.java =================================================================== --- board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/bhv/core/command/AbstractListEntityCommand.java (rev 0) +++ board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/bhv/core/command/AbstractListEntityCommand.java 2008-12-27 22:09:08 UTC (rev 1625) @@ -0,0 +1,182 @@ +package jp.sf.pal.board.db.allcommon.bhv.core.command; + +import java.util.ArrayList; +import java.util.List; + +import jp.sf.pal.board.db.allcommon.Entity; +import jp.sf.pal.board.db.allcommon.cbean.ConditionBean; +import jp.sf.pal.board.db.allcommon.cbean.outsidesql.OutsideSqlOption; +import jp.sf.pal.board.db.allcommon.dbmeta.DBMeta; + +import org.seasar.dao.BeanMetaData; +import org.seasar.extension.jdbc.PropertyType; + +/** + * @author DBFlute(AutoGenerator) + */ +public abstract class AbstractListEntityCommand extends + AbstractBehaviorCommand { + + //========================================================================== + // ========= + // Attribute + // ========= + /** The type of entity. (Required) */ + protected Class _entityType; + + /** The instance of condition-bean. (Required) */ + protected List _entityList; + + //========================================================================== + // ========= + // Basic Information + // ================= + public Class getCommandReturnType() { + return int[].class; + } + + //========================================================================== + // ========= + // Detail Information + // ================== + public boolean isConditionBean() { + return false; + } + + public boolean isOutsideSql() { + return false; + } + + public boolean isProcedure() { + return false; + } + + public boolean isSelect() { + return false; + } + + public boolean isSelectCount() { + return false; + } + + //========================================================================== + // ========= + // Factory + // ======= + // ----------------------------------------------------- + // BeanMetaData + // ------------ + protected BeanMetaData createBeanMetaData() { + return _beanMetaDataFactory.createBeanMetaData(_entityType); + } + + //========================================================================== + // ========= + // Process Callback + // ================ + public void beforeGettingSqlExecution() { + } + + public void afterExecuting() { + } + + //========================================================================== + // ========= + // SqlExecution Handling + // ===================== + public String buildSqlExecutionKey() { + assertStatus("buildSqlExecutionKey"); + return _tableDbName + ":" + getCommandName() + "(List<" + + _entityType.getSimpleName() + ">)"; + } + + public Object[] getSqlExecutionArgument() { + assertStatus("getSqlExecutionArgument"); + return new Object[] { _entityList }; + } + + //========================================================================== + // ========= + // Argument Information + // ==================== + public ConditionBean getConditionBean() { + return null; + } + + public String getOutsideSqlPath() { + return null; + } + + public OutsideSqlOption getOutsideSqlOption() { + return null; + } + + //========================================================================== + // ========= + // Assist Helper + // ============= + protected DBMeta findDBMeta() { + // /- - - - - - - - - - - - - - - - - - - - - - - - - - - - + // Cannot use the handler of DBMeta instance + // because the customize-entity is contained to find here. + // - - - - - - - - - -/ + // DBMetaInstanceHandler.findDBMeta(_tableDbName); + + final Class beanType = _entityType; + if (beanType == null) { + return null; + } + if (!Entity.class.isAssignableFrom(beanType)) { + return null; + } + final Entity entity; + try { + entity = (Entity) beanType.newInstance(); + } catch (InstantiationException e) { + throw new IllegalStateException(e); + } catch (IllegalAccessException e) { + throw new IllegalStateException(e); + } + return entity.getDBMeta(); + } + + protected String[] getPersistentPropertyNames(BeanMetaData bmd) { + final List nameList = new ArrayList(); + for (int i = 0; i < bmd.getPropertyTypeSize(); ++i) { + final PropertyType pt = bmd.getPropertyType(i); + if (pt.isPersistent()) { + nameList.add(pt.getPropertyName()); + } + } + return nameList.toArray(new String[nameList.size()]); + } + + //========================================================================== + // ========= + // Assert Helper + // ============= + protected void assertStatus(String methodName) { + assertBasicProperty(methodName); + assertComponentProperty(methodName); + if (_entityType == null) { + throw new IllegalStateException(buildAssertMessage("_entityType", + methodName)); + } + if (_entityList == null) { + throw new IllegalStateException(buildAssertMessage("_entityList", + methodName)); + } + } + + //========================================================================== + // ========= + // Accessor + // ======== + public void setEntityType(Class entityType) { + _entityType = entityType; + } + + public void setEntityList(List entityList) { + _entityList = entityList; + } +} Property changes on: board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/bhv/core/command/AbstractListEntityCommand.java ___________________________________________________________________ Name: svn:eol-style + native Added: board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/bhv/core/command/AbstractOutsideSqlCommand.java =================================================================== --- board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/bhv/core/command/AbstractOutsideSqlCommand.java (rev 0) +++ board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/bhv/core/command/AbstractOutsideSqlCommand.java 2008-12-27 22:09:08 UTC (rev 1625) @@ -0,0 +1,93 @@ +package jp.sf.pal.board.db.allcommon.bhv.core.command; + +import jp.sf.pal.board.db.allcommon.cbean.ConditionBean; +import jp.sf.pal.board.db.allcommon.cbean.outsidesql.OutsideSqlOption; + +/** + * @author DBFlute(AutoGenerator) + * @param The type of result. + */ +public abstract class AbstractOutsideSqlCommand extends + AbstractBehaviorCommand { + + //========================================================================== + // ========= + // Attribute + // ========= + // ----------------------------------------------------- + // Basic Information + // ----------------- + /** The path of outside-SQL. (Required) */ + protected String _outsideSqlPath; + + /** The parameter-bean. (Required to set, but Nullable) */ + protected Object _parameterBean; + + /** The option of outside-SQL. (Required) */ + protected OutsideSqlOption _outsideSqlOption; + + //========================================================================== + // ========= + // Detail Information + // ================== + public boolean isConditionBean() { + return false; // When the command is for outside-SQL, it always be + // false. + } + + public boolean isOutsideSql() { + return true; + } + + public boolean isSelectCount() { + return false; // When the command is for outside-SQL, it always be + // false. + } + + //========================================================================== + // ========= + // Argument Information + // ==================== + public ConditionBean getConditionBean() { + return null; + } + + public String getOutsideSqlPath() { + return _outsideSqlPath; + } + + public OutsideSqlOption getOutsideSqlOption() { + return _outsideSqlOption; + } + + //========================================================================== + // ========= + // Assert Helper + // ============= + protected void assertOutsideSqlBasic(String methodName) { + if (_outsideSqlPath == null) { + throw new IllegalStateException(buildAssertMessage( + "_outsideSqlPath", methodName)); + } + if (_outsideSqlOption == null) { + throw new IllegalStateException(buildAssertMessage( + "_outsideSqlOption", methodName)); + } + } + + //========================================================================== + // ========= + // Accessor + // ======== + public void setOutsideSqlPath(String outsideSqlPath) { + _outsideSqlPath = outsideSqlPath; + } + + public void setParameterBean(Object parameterBean) { + _parameterBean = parameterBean; + } + + public void setOutsideSqlOption(OutsideSqlOption outsideSqlOption) { + _outsideSqlOption = outsideSqlOption; + } +} Property changes on: board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/bhv/core/command/AbstractOutsideSqlCommand.java ___________________________________________________________________ Name: svn:eol-style + native Added: board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/bhv/core/command/AbstractOutsideSqlSelectCommand.java =================================================================== --- board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/bhv/core/command/AbstractOutsideSqlSelectCommand.java (rev 0) +++ board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/bhv/core/command/AbstractOutsideSqlSelectCommand.java 2008-12-27 22:09:08 UTC (rev 1625) @@ -0,0 +1,175 @@ +package jp.sf.pal.board.db.allcommon.bhv.core.command; + +import jp.sf.pal.board.db.allcommon.bhv.core.SqlExecution; +import jp.sf.pal.board.db.allcommon.bhv.core.SqlExecutionCreator; +import jp.sf.pal.board.db.allcommon.bhv.core.execution.OutsideSqlSelectExecution; +import jp.sf.pal.board.db.allcommon.cbean.FetchNarrowingBean; +import jp.sf.pal.board.db.allcommon.cbean.FetchNarrowingBeanContext; +import jp.sf.pal.board.db.allcommon.cbean.outsidesql.OutsideSqlContext; +import jp.sf.pal.board.db.allcommon.cbean.outsidesql.OutsideSqlOption; + +import org.seasar.extension.jdbc.ResultSetHandler; + +/** + * The abstract command for OutsideSql.selectSomething(). + * + * @author DBFlute(AutoGenerator) + * @param The type of result. + */ +public abstract class AbstractOutsideSqlSelectCommand extends + AbstractOutsideSqlCommand { + + //========================================================================== + // ========= + // Detail Information + // ================== + public boolean isProcedure() { + return false; + } + + public boolean isSelect() { + return true; + } + + //========================================================================== + // ========= + // Process Callback + // ================ + public void beforeGettingSqlExecution() { + assertStatus("beforeGettingSqlExecution"); + final String path = _outsideSqlPath; + final Object pmb = _parameterBean; + final OutsideSqlOption option = _outsideSqlOption; + final Object resultTypeSpecification = getResultTypeSpecification(); + final boolean autoPagingLogging = (option.isAutoPaging() || option + .isSourcePagingRequestTypeAuto()); + final OutsideSqlContext outsideSqlContext = new OutsideSqlContext(); + outsideSqlContext.setOutsideSqlPath(path); + outsideSqlContext.setParameterBean(pmb); + outsideSqlContext.setResultTypeSpecification(resultTypeSpecification); + outsideSqlContext.setMethodName(getCommandName()); + outsideSqlContext.setStatementConfig(option.getStatementConfig()); + outsideSqlContext.setTableDbName(option.getTableDbName()); + outsideSqlContext.setDynamicBinding(option.isDynamicBinding()); + outsideSqlContext.setOffsetByCursorForcedly(option.isAutoPaging()); + outsideSqlContext.setLimitByCursorForcedly(option.isAutoPaging()); + outsideSqlContext.setAutoPagingLogging(autoPagingLogging); // for + // logging + outsideSqlContext.setupBehaviorQueryPathIfNeeds(); + OutsideSqlContext.setOutsideSqlContextOnThread(outsideSqlContext); + + // Set up fetchNarrowingBean. + setupOutsideSqlFetchNarrowingBean(pmb, option); + } + + protected void setupOutsideSqlFetchNarrowingBean(Object pmb, + OutsideSqlOption option) { + if (pmb == null + || !FetchNarrowingBeanContext.isTheTypeFetchNarrowingBean(pmb + .getClass())) { + return; + } + final FetchNarrowingBean fetchNarrowingBean = (FetchNarrowingBean) pmb; + if (option.isManualPaging()) { + fetchNarrowingBean.ignoreFetchNarrowing(); + } + FetchNarrowingBeanContext + .setFetchNarrowingBeanOnThread(fetchNarrowingBean); + } + + public void afterExecuting() { + } + + //========================================================================== + // ========= + // SqlExecution Handling + // ===================== + public String buildSqlExecutionKey() { + assertStatus("buildSqlExecutionKey"); + return generateSpecifiedOutsideSqlUniqueKey(); + } + + protected String generateSpecifiedOutsideSqlUniqueKey() { + final String methodName = getCommandName(); + final String path = _outsideSqlPath; + final Object pmb = _parameterBean; + final OutsideSqlOption option = _outsideSqlOption; + final Object resultTypeSpecification = getResultTypeSpecification(); + return OutsideSqlContext.generateSpecifiedOutsideSqlUniqueKey( + methodName, path, pmb, option, resultTypeSpecification); + } + + public SqlExecutionCreator createSqlExecutionCreator() { + assertStatus("createSqlExecutionCreator"); + return new SqlExecutionCreator() { + public SqlExecution createSqlExecution() { + final OutsideSqlContext outsideSqlContext = OutsideSqlContext + .getOutsideSqlContextOnThread(); + return createOutsideSqlSelectExecution(outsideSqlContext); + } + }; + } + + protected SqlExecution createOutsideSqlSelectExecution( + OutsideSqlContext outsideSqlContext) { + // - - - - - - - - - - - - - - - - - - - - - - - + // The attribute of Specified-OutsideSqlContext. + // - - - - - - - - - - - - - - - - - - - - - - - + final String suffix = buildDbmsSuffix(); + final String sql = outsideSqlContext.readFilteredOutsideSql( + _sqlFileEncoding, suffix); + final Object pmb = outsideSqlContext.getParameterBean(); + + // - - - - - - - - - - - - - - - + // The attribute of SqlCommand. + // - - - - - - - - - - - - - - - + final String[] argNames = (pmb != null ? new String[] { "pmb" } + : new String[] {}); + final Class[] argTypes = (pmb != null ? new Class[] { pmb + .getClass() } : new Class[] {}); + + // - - - - - - - - - - - - - + // Create ResultSetHandler. + // - - - - - - - - - - - - - + final ResultSetHandler handler = createOutsideSqlSelectResultSetHandler(); + + // - - - - - - - - - - - + // Create SqlExecution. + // - - - - - - - - - - - + return createOutsideSqlSelectExecution(handler, argNames, argTypes, sql); + } + + protected OutsideSqlSelectExecution createOutsideSqlSelectExecution( + ResultSetHandler handler, String[] argNames, Class[] argTypes, + String sql) { + final OutsideSqlSelectExecution cmd = new OutsideSqlSelectExecution( + _dataSource, _statementFactory, handler); + cmd.setArgNames(argNames); + cmd.setArgTypes(argTypes); + cmd.setSql(sql); + return cmd; + } + + public Object[] getSqlExecutionArgument() { + assertStatus("getSqlExecutionArgument"); + return new Object[] { _parameterBean }; + } + + //========================================================================== + // ========= + // Extension Point + // =============== + protected abstract ResultSetHandler createOutsideSqlSelectResultSetHandler(); + + protected abstract Object getResultTypeSpecification(); + + //========================================================================== + // ========= + // Assert Helper + // ============= + protected void assertStatus(String methodName) { + assertBasicProperty(methodName); + assertComponentProperty(methodName); + assertOutsideSqlBasic(methodName); + } +} Property changes on: board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/bhv/core/command/AbstractOutsideSqlSelectCommand.java ___________________________________________________________________ Name: svn:eol-style + native Added: board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/bhv/core/command/AbstractSelectCBCommand.java =================================================================== --- board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/bhv/core/command/AbstractSelectCBCommand.java (rev 0) +++ board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/bhv/core/command/AbstractSelectCBCommand.java 2008-12-27 22:09:08 UTC (rev 1625) @@ -0,0 +1,122 @@ +package jp.sf.pal.board.db.allcommon.bhv.core.command; + +import jp.sf.pal.board.db.allcommon.bhv.core.SqlExecution; +import jp.sf.pal.board.db.allcommon.bhv.core.execution.SelectCBExecution; +import jp.sf.pal.board.db.allcommon.cbean.ConditionBean; +import jp.sf.pal.board.db.allcommon.cbean.outsidesql.OutsideSqlOption; + +import org.seasar.extension.jdbc.ResultSetHandler; + +/** + * @author DBFlute(AutoGenerator) + * @param The type of result. + */ +public abstract class AbstractSelectCBCommand extends + AbstractBehaviorCommand { + + //========================================================================== + // ========= + // Attribute + // ========= + /** The type of condition-bean. (Derived from conditionBean) */ + protected Class _conditionBeanType; + + /** The instance of condition-bean. (Required) */ + protected ConditionBean _conditionBean; + + //========================================================================== + // ========= + // Detail Information + // ================== + public boolean isConditionBean() { + return true; + } + + public boolean isOutsideSql() { + return false; + } + + public boolean isProcedure() { + return false; + } + + public boolean isSelect() { + return true; + } + + //========================================================================== + // ========= + // SqlExecution Handling + // ===================== + public String buildSqlExecutionKey() { + assertStatus("buildSqlExecutionKey"); + return _tableDbName + ":" + getCommandName() + "(" + + _conditionBeanType.getSimpleName() + ")"; + } + + protected SqlExecution createSelectCBExecution( + Class cbType, ResultSetHandler handler) { + return createSelectCBExecution(handler, new String[] { "dto" }, + new Class[] { cbType }); + } + + protected SelectCBExecution createSelectCBExecution( + ResultSetHandler handler, String[] argNames, Class[] argTypes) { + final SelectCBExecution cmd = new SelectCBExecution(_dataSource, + _statementFactory, handler); + cmd.setArgNames(argNames); + cmd.setArgTypes(argTypes); + return cmd; + } + + public Object[] getSqlExecutionArgument() { + assertStatus("getSqlExecutionArgument"); + return new Object[] { _conditionBean }; + } + + //========================================================================== + // ========= + // Argument Information + // ==================== + public ConditionBean getConditionBean() { + return _conditionBean; + } + + public String getOutsideSqlPath() { + return null; + } + + public OutsideSqlOption getOutsideSqlOption() { + return null; + } + + //========================================================================== + // ========= + // Assert Helper + // ============= + protected void assertStatus(String methodName) { + assertBasicProperty(methodName); + assertComponentProperty(methodName); + if (_conditionBeanType == null) { + throw new IllegalStateException(buildAssertMessage( + "_conditionBeanType", methodName)); + } + if (_conditionBean == null) { + throw new IllegalStateException(buildAssertMessage( + "_conditionBean", methodName)); + } + } + + //========================================================================== + // ========= + // Accessor + // ======== + public void setConditionBeanType( + Class conditionBeanType) { + _conditionBeanType = conditionBeanType; + } + + public void setConditionBean(ConditionBean conditionBean) { + _conditionBean = conditionBean; + } +} Property changes on: board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/bhv/core/command/AbstractSelectCBCommand.java ___________________________________________________________________ Name: svn:eol-style + native Added: board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/bhv/core/command/BatchDeleteEntityCommand.java =================================================================== --- board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/bhv/core/command/BatchDeleteEntityCommand.java (rev 0) +++ board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/bhv/core/command/BatchDeleteEntityCommand.java 2008-12-27 22:09:08 UTC (rev 1625) @@ -0,0 +1,51 @@ +package jp.sf.pal.board.db.allcommon.bhv.core.command; + +import jp.sf.pal.board.db.allcommon.bhv.core.SqlExecution; +import jp.sf.pal.board.db.allcommon.bhv.core.SqlExecutionCreator; +import jp.sf.pal.board.db.allcommon.s2dao.internal.sqlcommand.InternalDeleteBatchAutoStaticCommand; + +import org.seasar.dao.BeanMetaData; + +/** + * @author DBFlute(AutoGenerator) + */ +public class BatchDeleteEntityCommand extends AbstractListEntityCommand { + + //========================================================================== + // ========= + // Basic Information + // ================= + public String getCommandName() { + return "batchDelete"; + } + + //========================================================================== + // ========= + // SqlExecution Handling + // ===================== + public SqlExecutionCreator createSqlExecutionCreator() { + assertStatus("createSqlExecutionCreator"); + return new SqlExecutionCreator() { + public SqlExecution createSqlExecution() { + final BeanMetaData bmd = createBeanMetaData(); + return createBatchDeleteEntitySqlExecution(bmd); + } + }; + } + + protected SqlExecution createBatchDeleteEntitySqlExecution(BeanMetaData bmd) { + final String[] propertyNames = getPersistentPropertyNames(bmd); + return createDeleteBatchAutoStaticCommand(bmd, propertyNames); + } + + protected InternalDeleteBatchAutoStaticCommand createDeleteBatchAutoStaticCommand( + BeanMetaData bmd, String[] propertyNames) { + boolean opt = isOptimisticLockHandling(); + return new InternalDeleteBatchAutoStaticCommand(_dataSource, + _statementFactory, bmd, propertyNames, opt); + } + + protected boolean isOptimisticLockHandling() { + return true; + } +} Property changes on: board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/bhv/core/command/BatchDeleteEntityCommand.java ___________________________________________________________________ Name: svn:eol-style + native Added: board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/bhv/core/command/BatchDeleteNonstrictEntityCommand.java =================================================================== --- board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/bhv/core/command/BatchDeleteNonstrictEntityCommand.java (rev 0) +++ board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/bhv/core/command/BatchDeleteNonstrictEntityCommand.java 2008-12-27 22:09:08 UTC (rev 1625) @@ -0,0 +1,25 @@ +package jp.sf.pal.board.db.allcommon.bhv.core.command; + +/** + * @author DBFlute(AutoGenerator) + */ +public class BatchDeleteNonstrictEntityCommand extends BatchDeleteEntityCommand { + + //========================================================================== + // ========= + // Basic Information + // ================= + @Override + public String getCommandName() { + return "batchDeleteNonstrict"; + } + + //========================================================================== + // ========= + // SqlExecution Handling + // ===================== + @Override + protected boolean isOptimisticLockHandling() { + return false; + } +} Property changes on: board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/bhv/core/command/BatchDeleteNonstrictEntityCommand.java ___________________________________________________________________ Name: svn:eol-style + native Added: board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/bhv/core/command/BatchInsertEntityCommand.java =================================================================== --- board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/bhv/core/command/BatchInsertEntityCommand.java (rev 0) +++ board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/bhv/core/command/BatchInsertEntityCommand.java 2008-12-27 22:09:08 UTC (rev 1625) @@ -0,0 +1,46 @@ +package jp.sf.pal.board.db.allcommon.bhv.core.command; + +import jp.sf.pal.board.db.allcommon.bhv.core.SqlExecution; +import jp.sf.pal.board.db.allcommon.bhv.core.SqlExecutionCreator; +import jp.sf.pal.board.db.allcommon.s2dao.internal.sqlcommand.InternalInsertBatchAutoStaticCommand; + +import org.seasar.dao.BeanMetaData; + +/** + * @author DBFlute(AutoGenerator) + */ +public class BatchInsertEntityCommand extends AbstractListEntityCommand { + + //========================================================================== + // ========= + // Basic Information + // ================= + public String getCommandName() { + return "batchInsert"; + } + + //========================================================================== + // ========= + // SqlExecution Handling + // ===================== + public SqlExecutionCreator createSqlExecutionCreator() { + assertStatus("createSqlExecutionCreator"); + return new SqlExecutionCreator() { + public SqlExecution createSqlExecution() { + final BeanMetaData bmd = createBeanMetaData(); + return createBatchInsertEntitySqlExecution(bmd); + } + }; + } + + protected SqlExecution createBatchInsertEntitySqlExecution(BeanMetaData bmd) { + final String[] propertyNames = getPersistentPropertyNames(bmd); + return createInsertBatchAutoStaticCommand(bmd, propertyNames); + } + + protected InternalInsertBatchAutoStaticCommand createInsertBatchAutoStaticCommand( + BeanMetaData bmd, String[] propertyNames) { + return new InternalInsertBatchAutoStaticCommand(_dataSource, + _statementFactory, bmd, propertyNames); + } +} Property changes on: board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/bhv/core/command/BatchInsertEntityCommand.java ___________________________________________________________________ Name: svn:eol-style + native Added: board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/bhv/core/command/BatchUpdateEntityCommand.java =================================================================== --- board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/bhv/core/command/BatchUpdateEntityCommand.java (rev 0) +++ board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/bhv/core/command/BatchUpdateEntityCommand.java 2008-12-27 22:09:08 UTC (rev 1625) @@ -0,0 +1,51 @@ +package jp.sf.pal.board.db.allcommon.bhv.core.command; + +import jp.sf.pal.board.db.allcommon.bhv.core.SqlExecution; +import jp.sf.pal.board.db.allcommon.bhv.core.SqlExecutionCreator; +import jp.sf.pal.board.db.allcommon.s2dao.internal.sqlcommand.InternalUpdateBatchAutoStaticCommand; + +import org.seasar.dao.BeanMetaData; + +/** + * @author DBFlute(AutoGenerator) + */ +public class BatchUpdateEntityCommand extends AbstractListEntityCommand { + + //========================================================================== + // ========= + // Basic Information + // ================= + public String getCommandName() { + return "batchUpdate"; + } + + //========================================================================== + // ========= + // SqlExecution Handling + // ===================== + public SqlExecutionCreator createSqlExecutionCreator() { + assertStatus("createSqlExecutionCreator"); + return new SqlExecutionCreator() { + public SqlExecution createSqlExecution() { + final BeanMetaData bmd = createBeanMetaData(); + return createBatchUpdateEntitySqlExecution(bmd); + } + }; + } + + protected SqlExecution createBatchUpdateEntitySqlExecution(BeanMetaData bmd) { + final String[] propertyNames = getPersistentPropertyNames(bmd); + return createUpdateBatchAutoStaticCommand(bmd, propertyNames); + } + + protected InternalUpdateBatchAutoStaticCommand createUpdateBatchAutoStaticCommand( + BeanMetaData bmd, String[] propertyNames) { + boolean opt = isOptimisticLockHandling(); + return new InternalUpdateBatchAutoStaticCommand(_dataSource, + _statementFactory, bmd, propertyNames, opt, opt); + } + + protected boolean isOptimisticLockHandling() { + return true; + } +} Property changes on: board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/bhv/core/command/BatchUpdateEntityCommand.java ___________________________________________________________________ Name: svn:eol-style + native Added: board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/bhv/core/command/BatchUpdateNonstrictEntityCommand.java =================================================================== --- board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/bhv/core/command/BatchUpdateNonstrictEntityCommand.java (rev 0) +++ board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/bhv/core/command/BatchUpdateNonstrictEntityCommand.java 2008-12-27 22:09:08 UTC (rev 1625) @@ -0,0 +1,25 @@ +package jp.sf.pal.board.db.allcommon.bhv.core.command; + +/** + * @author DBFlute(AutoGenerator) + */ +public class BatchUpdateNonstrictEntityCommand extends BatchUpdateEntityCommand { + + //========================================================================== + // ========= + // Basic Information + // ================= + @Override + public String getCommandName() { + return "batchUpdateNonstrict"; + } + + //========================================================================== + // ========= + // SqlExecution Handling + // ===================== + @Override + protected boolean isOptimisticLockHandling() { + return false; + } +} Property changes on: board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/bhv/core/command/BatchUpdateNonstrictEntityCommand.java ___________________________________________________________________ Name: svn:eol-style + native Added: board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/bhv/core/command/DeleteEntityCommand.java =================================================================== --- board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/bhv/core/command/DeleteEntityCommand.java (rev 0) +++ board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/bhv/core/command/DeleteEntityCommand.java 2008-12-27 22:09:08 UTC (rev 1625) @@ -0,0 +1,51 @@ +package jp.sf.pal.board.db.allcommon.bhv.core.command; + +import jp.sf.pal.board.db.allcommon.bhv.core.SqlExecution; +import jp.sf.pal.board.db.allcommon.bhv.core.SqlExecutionCreator; +import jp.sf.pal.board.db.allcommon.s2dao.internal.sqlcommand.InternalDeleteAutoStaticCommand; + +import org.seasar.dao.BeanMetaData; + +/** + * @author DBFlute(AutoGenerator) + */ +public class DeleteEntityCommand extends AbstractEntityCommand { + + //========================================================================== + // ========= + // Basic Information + // ================= + public String getCommandName() { + return "delete"; + } + + //========================================================================== + // ========= + // SqlExecution Handling + // ===================== + public SqlExecutionCreator createSqlExecutionCreator() { + assertStatus("createSqlExecutionCreator"); + return new SqlExecutionCreator() { + public SqlExecution createSqlExecution() { + final BeanMetaData bmd = createBeanMetaData(); + return createDeleteEntitySqlExecution(bmd); + } + }; + } + + protected SqlExecution createDeleteEntitySqlExecution(BeanMetaData bmd) { + final String[] propertyNames = getPersistentPropertyNames(bmd); + return createDeleteAutoStaticCommand(bmd, propertyNames); + } + + protected InternalDeleteAutoStaticCommand createDeleteAutoStaticCommand( + BeanMetaData bmd, String[] propertyNames) { + return new InternalDeleteAutoStaticCommand(_dataSource, + _statementFactory, bmd, propertyNames, + isOptimisticLockHandling()); + } + + protected boolean isOptimisticLockHandling() { + return true; + } +} Property changes on: board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/bhv/core/command/DeleteEntityCommand.java ___________________________________________________________________ Name: svn:eol-style + native Added: board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/bhv/core/command/DeleteNonstrictEntityCommand.java =================================================================== --- board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/bhv/core/command/DeleteNonstrictEntityCommand.java (rev 0) +++ board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/bhv/core/command/DeleteNonstrictEntityCommand.java 2008-12-27 22:09:08 UTC (rev 1625) @@ -0,0 +1,25 @@ +package jp.sf.pal.board.db.allcommon.bhv.core.command; + +/** + * @author DBFlute(AutoGenerator) + */ +public class DeleteNonstrictEntityCommand extends DeleteEntityCommand { + + //========================================================================== + // ========= + // Basic Information + // ================= + @Override + public String getCommandName() { + return "deleteNonstrict"; + } + + //========================================================================== + // ========= + // SqlExecution Handling + // ===================== + @Override + protected boolean isOptimisticLockHandling() { + return false; + } +} Property changes on: board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/bhv/core/command/DeleteNonstrictEntityCommand.java ___________________________________________________________________ Name: svn:eol-style + native Added: board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/bhv/core/command/InsertEntityCommand.java =================================================================== --- board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/bhv/core/command/InsertEntityCommand.java (rev 0) +++ board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/bhv/core/command/InsertEntityCommand.java 2008-12-27 22:09:08 UTC (rev 1625) @@ -0,0 +1,86 @@ +package jp.sf.pal.board.db.allcommon.bhv.core.command; + +import java.util.List; + +import jp.sf.pal.board.db.allcommon.bhv.core.SqlExecution; +import jp.sf.pal.board.db.allcommon.bhv.core.SqlExecutionCreator; +import jp.sf.pal.board.db.allcommon.dbmeta.DBMeta; +import jp.sf.pal.board.db.allcommon.dbmeta.info.ColumnInfo; +import jp.sf.pal.board.db.allcommon.s2dao.internal.sqlcommand.InternalInsertAutoDynamicCommand; + +import org.seasar.dao.BeanMetaData; + +/** + * @author DBFlute(AutoGenerator) + */ +public class InsertEntityCommand extends AbstractEntityCommand { + + //========================================================================== + // ========= + // Basic Information + // ================= + public String getCommandName() { + return "insert"; + } + + //========================================================================== + // ========= + // SqlExecution Handling + // ===================== + public SqlExecutionCreator createSqlExecutionCreator() { + assertStatus("createSqlExecutionCreator"); + return new SqlExecutionCreator() { + public SqlExecution createSqlExecution() { + final BeanMetaData bmd = createBeanMetaData(); + return createInsertEntitySqlExecution(bmd); + } + }; + } + + protected SqlExecution createInsertEntitySqlExecution(BeanMetaData bmd) { + final SqlExecution nonPrimaryKeySqlExecution = createNonPrimaryInsertSqlExecution(bmd); + if (nonPrimaryKeySqlExecution != null) { + return nonPrimaryKeySqlExecution; + } + final String[] propertyNames = getPersistentPropertyNames(bmd); + return createInsertAutoDynamicCommand(bmd, propertyNames); + } + + protected InternalInsertAutoDynamicCommand createInsertAutoDynamicCommand( + BeanMetaData bmd, String[] propertyNames) { + final InternalInsertAutoDynamicCommand cmd = new InternalInsertAutoDynamicCommand(); + cmd.setBeanMetaData(bmd); + cmd.setDataSource(_dataSource); + cmd.setPropertyNames(propertyNames); + cmd.setStatementFactory(_statementFactory); + return cmd; + } + + /** + * @param bmd The meta data of bean. (NotNull) + * @return Whether the method is target. (For example if it has primary key, + * returns false.) + */ + protected SqlExecution createNonPrimaryInsertSqlExecution(BeanMetaData bmd) { + final DBMeta dbmeta = findDBMeta(); + if (dbmeta.hasPrimaryKey()) { + return null; + } + final List columnInfoList = dbmeta.getColumnInfoList(); + final StringBuilder columnDefSb = new StringBuilder(); + for (jp.sf.pal.board.db.allcommon.dbmeta.info.ColumnInfo columnInfo : columnInfoList) { + columnDefSb.append(", ").append(columnInfo.getColumnDbName()); + } + columnDefSb.delete(0, ", ".length()).insert(0, "(").append(")"); + final StringBuilder columnValuesSb = new StringBuilder(); + for (jp.sf.pal.board.db.allcommon.dbmeta.info.ColumnInfo columnInfo : columnInfoList) { + columnValuesSb.append(", /*dto.").append( + columnInfo.getPropertyName()).append("*/null"); + } + columnValuesSb.delete(0, ", ".length()).insert(0, "(").append(")"); + final String sql = "insert into " + dbmeta.getTableSqlName() + + columnDefSb + " values" + columnValuesSb; + return createUpdateDynamicCommand(new String[] { "dto" }, + new Class[] { _entityType }, sql); + } +} Property changes on: board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/bhv/core/command/InsertEntityCommand.java ___________________________________________________________________ Name: svn:eol-style + native Added: board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/bhv/core/command/OutsideSqlCallCommand.java =================================================================== --- board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/bhv/core/command/OutsideSqlCallCommand.java (rev 0) +++ board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/bhv/core/command/OutsideSqlCallCommand.java 2008-12-27 22:09:08 UTC (rev 1625) @@ -0,0 +1,152 @@ +package jp.sf.pal.board.db.allcommon.bhv.core.command; + +import jp.sf.pal.board.db.allcommon.bhv.core.SqlExecution; +import jp.sf.pal.board.db.allcommon.bhv.core.SqlExecutionCreator; +import jp.sf.pal.board.db.allcommon.cbean.outsidesql.OutsideSqlContext; +import jp.sf.pal.board.db.allcommon.cbean.outsidesql.OutsideSqlOption; +import jp.sf.pal.board.db.allcommon.s2dao.internal.sqlcommand.InternalProcedureCommand; +import jp.sf.pal.board.db.allcommon.s2dao.internal.various.InternalProcedureMetaData; +import jp.sf.pal.board.db.allcommon.s2dao.internal.various.InternalProcedureMetaDataFactory; + +import org.seasar.extension.jdbc.ResultSetHandler; + +/** + * The behavior command for OutsideSql.execute(). + * + * @author DBFlute(AutoGenerator) + */ +public class OutsideSqlCallCommand extends AbstractOutsideSqlCommand { + + //========================================================================== + // ========= + // Basic Information + // ================= + public String getCommandName() { + return "call"; + } + + public Class getCommandReturnType() { + return void.class; + } + + //========================================================================== + // ========= + // Detail Information + // ================== + public boolean isProcedure() { + return true; + } + + public boolean isSelect() { + return false; + } + + //========================================================================== + // ========= + // Process Callback + // ================ + public void beforeGettingSqlExecution() { + assertStatus("beforeGettingSqlExecution"); + final String path = _outsideSqlPath; + final Object pmb = _parameterBean; + final OutsideSqlOption option = _outsideSqlOption; + final OutsideSqlContext outsideSqlContext = new OutsideSqlContext(); + outsideSqlContext.setDynamicBinding(option.isDynamicBinding()); + outsideSqlContext.setOffsetByCursorForcedly(option.isAutoPaging()); + outsideSqlContext.setLimitByCursorForcedly(option.isAutoPaging()); + outsideSqlContext.setOutsideSqlPath(path); + outsideSqlContext.setParameterBean(pmb); + outsideSqlContext.setMethodName(getCommandName()); + outsideSqlContext.setStatementConfig(option.getStatementConfig()); + outsideSqlContext.setTableDbName(option.getTableDbName()); + outsideSqlContext.setupBehaviorQueryPathIfNeeds(); + OutsideSqlContext.setOutsideSqlContextOnThread(outsideSqlContext); + } + + public void afterExecuting() { + } + + //========================================================================== + // ========= + // SqlExecution Handling + // ===================== + public String buildSqlExecutionKey() { + assertStatus("buildSqlExecutionKey"); + return generateSpecifiedOutsideSqlUniqueKey(); + } + + protected String generateSpecifiedOutsideSqlUniqueKey() { + final String methodName = getCommandName(); + final String path = _outsideSqlPath; + final Object pmb = _parameterBean; + final OutsideSqlOption option = _outsideSqlOption; + return OutsideSqlContext.generateSpecifiedOutsideSqlUniqueKey( + methodName, path, pmb, option, null); + } + + public SqlExecutionCreator createSqlExecutionCreator() { + assertStatus("createSqlExecutionCreator"); + return new SqlExecutionCreator() { + public SqlExecution createSqlExecution() { + final OutsideSqlContext outsideSqlContext = OutsideSqlContext + .getOutsideSqlContextOnThread(); + return createOutsideSqlCallCommand(outsideSqlContext); + } + }; + } + + protected SqlExecution createOutsideSqlCallCommand( + OutsideSqlContext outsideSqlContext) { + // - - - - - - - - - - - - - - - - - - - - - - - + // The attribute of Specified-OutsideSqlContext. + // - - - - - - - - - - - - - - - - - - - - - - - + final Object pmb = outsideSqlContext.getParameterBean(); + final String procedureName = outsideSqlContext.getOutsideSqlPath(); + + // - - - - - - - - - - - - - - - + // The attribute of SqlCommand. + // - - - - - - - - - - - - - - - + final InternalProcedureMetaDataFactory factory = createProcedureMetaDataFactory(); + factory.setValueTypeFactory(_valueTypeFactory); + final Class pmbType = (pmb != null ? pmb.getClass() : null); + final InternalProcedureMetaData metaData = factory + .createProcedureMetaData(procedureName, pmbType); + return createProcedureCommand(metaData); + } + + protected InternalProcedureMetaDataFactory createProcedureMetaDataFactory() { + return new InternalProcedureMetaDataFactory(); + } + + protected InternalProcedureCommand createProcedureCommand( + InternalProcedureMetaData metaData) { + // Because a procedure command does not use result set handler. + final ResultSetHandler resultSetHandler = new InternalNullResultSetHandler(); + return new InternalProcedureCommand(_dataSource, resultSetHandler, + _statementFactory, metaData); + } + + // /- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + // - - + // InternalProcedureCommand switches argument so this is unnecessary + // actually! + // - - - - - - - - - -/ + public Object[] getSqlExecutionArgument() { + return new Object[] { _parameterBean }; + } + + //========================================================================== + // ========= + // Assert Helper + // ============= + protected void assertStatus(String methodName) { + assertBasicProperty(methodName); + assertComponentProperty(methodName); + assertOutsideSqlBasic(methodName); + if (_parameterBean == null) { + String msg = "The property 'parameterBean' should not be null"; + msg = msg + " when you call " + methodName + "()."; + throw new IllegalStateException(msg); + } + } +} Property changes on: board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/bhv/core/command/OutsideSqlCallCommand.java ___________________________________________________________________ Name: svn:eol-style + native Added: board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/bhv/core/command/OutsideSqlExecuteCommand.java =================================================================== --- board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/bhv/core/command/OutsideSqlExecuteCommand.java (rev 0) +++ board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/bhv/core/command/OutsideSqlExecuteCommand.java 2008-12-27 22:09:08 UTC (rev 1625) @@ -0,0 +1,128 @@ +package jp.sf.pal.board.db.allcommon.bhv.core.command; + +import jp.sf.pal.board.db.allcommon.bhv.core.SqlExecution; +import jp.sf.pal.board.db.allcommon.bhv.core.SqlExecutionCreator; +import jp.sf.pal.board.db.allcommon.cbean.outsidesql.OutsideSqlContext; +import jp.sf.pal.board.db.allcommon.cbean.outsidesql.OutsideSqlOption; + +/** + * The behavior command for OutsideSql.execute(). + * + * @author DBFlute(AutoGenerator) + */ +public class OutsideSqlExecuteCommand extends + AbstractOutsideSqlCommand { + + //========================================================================== + // ========= + // Basic Information + // ================= + public String getCommandName() { + return "execute"; + } + + public Class getCommandReturnType() { + return Integer.class; + } + + //========================================================================== + // ========= + // Detail Information + // ================== + public boolean isProcedure() { + return false; + } + + public boolean isSelect() { + return false; + } + + //========================================================================== + // ========= + // Process Callback + // ================ + public void beforeGettingSqlExecution() { + assertStatus("beforeGettingSqlExecution"); + final String path = _outsideSqlPath; + final Object pmb = _parameterBean; + final OutsideSqlOption option = _outsideSqlOption; + final OutsideSqlContext outsideSqlContext = new OutsideSqlContext(); + outsideSqlContext.setDynamicBinding(option.isDynamicBinding()); + outsideSqlContext.setOffsetByCursorForcedly(option.isAutoPaging()); + outsideSqlContext.setLimitByCursorForcedly(option.isAutoPaging()); + outsideSqlContext.setOutsideSqlPath(path); + outsideSqlContext.setParameterBean(pmb); + outsideSqlContext.setMethodName(getCommandName()); + outsideSqlContext.setStatementConfig(option.getStatementConfig()); + outsideSqlContext.setTableDbName(option.getTableDbName()); + outsideSqlContext.setupBehaviorQueryPathIfNeeds(); + OutsideSqlContext.setOutsideSqlContextOnThread(outsideSqlContext); + } + + public void afterExecuting() { + } + + //========================================================================== + // ========= + // SqlExecution Handling + // ===================== + public String buildSqlExecutionKey() { + assertStatus("buildSqlExecutionKey"); + return generateSpecifiedOutsideSqlUniqueKey(); + } + + protected String generateSpecifiedOutsideSqlUniqueKey() { + final String methodName = getCommandName(); + final String path = _outsideSqlPath; + final Object pmb = _parameterBean; + final OutsideSqlOption option = _outsideSqlOption; + return OutsideSqlContext.generateSpecifiedOutsideSqlUniqueKey( + methodName, path, pmb, option, null); + } + + public SqlExecutionCreator createSqlExecutionCreator() { + assertStatus("createSqlExecutionCreator"); + return new SqlExecutionCreator() { + public SqlExecution createSqlExecution() { + final OutsideSqlContext outsideSqlContext = OutsideSqlContext + .getOutsideSqlContextOnThread(); + return createOutsideSqlExecuteExecution(outsideSqlContext); + } + }; + } + + protected SqlExecution createOutsideSqlExecuteExecution( + OutsideSqlContext outsideSqlContext) { + // - - - - - - - - - - - - - - - - - - - - - - - + // The attribute of Specified-OutsideSqlContext. + // - - - - - - - - - - - - - - - - - - - - - - - + final String suffix = buildDbmsSuffix(); + final String sql = outsideSqlContext.readFilteredOutsideSql( + _sqlFileEncoding, suffix); + final Object pmb = outsideSqlContext.getParameterBean(); + + // - - - - - - - - - - - - - - - + // The attribute of SqlCommand. + // - - - - - - - - - - - - - - - + final String[] argNames = (pmb != null ? new String[] { "pmb" } + : new String[] {}); + final Class[] argTypes = (pmb != null ? new Class[] { pmb + .getClass() } : new Class[] {}); + + return createUpdateDynamicCommand(argNames, argTypes, sql); + } + + public Object[] getSqlExecutionArgument() { + return new Object[] { _parameterBean }; + } + + //========================================================================== + // ========= + // Assert Helper + // ============= + protected void assertStatus(String methodName) { + assertBasicProperty(methodName); + assertComponentProperty(methodName); + assertOutsideSqlBasic(methodName); + } +} Property changes on: board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/bhv/core/command/OutsideSqlExecuteCommand.java ___________________________________________________________________ Name: svn:eol-style + native Added: board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/bhv/core/command/OutsideSqlSelectCursorCommand.java =================================================================== --- board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/bhv/core/command/OutsideSqlSelectCursorCommand.java (rev 0) +++ board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/bhv/core/command/OutsideSqlSelectCursorCommand.java 2008-12-27 22:09:08 UTC (rev 1625) @@ -0,0 +1,77 @@ +package jp.sf.pal.board.db.allcommon.bhv.core.command; + +import java.sql.ResultSet; +import java.sql.SQLException; + +import jp.sf.pal.board.db.allcommon.jdbc.CursorHandler; + +import org.seasar.extension.jdbc.ResultSetHandler; + +/** + * The behavior command for OutsideSql.selectList(). + * + * @author DBFlute(AutoGenerator) + */ +public class OutsideSqlSelectCursorCommand extends + AbstractOutsideSqlSelectCommand { + + //========================================================================== + // ========= + // Attribute + // ========= + /** The handler of cursor. (Required) */ + protected CursorHandler _cursorHandler; + + //========================================================================== + // ========= + // Basic Information + // ================= + public String getCommandName() { + return "selectCursor"; + } + + public Class getCommandReturnType() { + return Object.class; + } + + //========================================================================== + // ========= + // Extension Point + // =============== + @Override + protected ResultSetHandler createOutsideSqlSelectResultSetHandler() { + return new ResultSetHandler() { + public Object handle(ResultSet rs) throws SQLException { + return _cursorHandler.handle(rs); + } + }; + } + + @Override + protected Object getResultTypeSpecification() { + return _cursorHandler; + } + + //========================================================================== + // ========= + // Assert Helper + // ============= + @Override + protected void assertStatus(String methodName) { + assertBasicProperty(methodName); + assertComponentProperty(methodName); + assertOutsideSqlBasic(methodName); + if (_cursorHandler == null) { + throw new IllegalStateException(buildAssertMessage( + "_cursorHandler", methodName)); + } + } + + //========================================================================== + // ========= + // Accessor + // ======== + public void setCursorHandler(CursorHandler cursorHandler) { + _cursorHandler = cursorHandler; + } +} Property changes on: board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/bhv/core/command/OutsideSqlSelectCursorCommand.java ___________________________________________________________________ Name: svn:eol-style + native Added: board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/bhv/core/command/OutsideSqlSelectListCommand.java =================================================================== --- board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/bhv/core/command/OutsideSqlSelectListCommand.java (rev 0) +++ board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/bhv/core/command/OutsideSqlSelectListCommand.java 2008-12-27 22:09:08 UTC (rev 1625) @@ -0,0 +1,96 @@ +package jp.sf.pal.board.db.allcommon.bhv.core.command; + +import java.util.List; + +import org.seasar.dao.BeanMetaData; +import org.seasar.extension.jdbc.ResultSetHandler; +import org.seasar.extension.jdbc.ValueType; +import org.seasar.extension.jdbc.types.ValueTypes; + +/** + * The behavior command for OutsideSql.selectList(). + * + * @author DBFlute(AutoGenerator) + * @param The type of entity. + */ +public class OutsideSqlSelectListCommand extends + AbstractOutsideSqlSelectCommand> { + + //========================================================================== + // ========= + // Attribute + // ========= + /** The type of entity. (Required) */ + protected Class _entityType; + + //========================================================================== + // ========= + // Basic Information + // ================= + public String getCommandName() { + return "selectList"; + } + + public Class getCommandReturnType() { + return List.class; + } + + //========================================================================== + // ========= + // Factory + // ======= + // ----------------------------------------------------- + // BeanMetaData + // ------------ + protected BeanMetaData createBeanMetaData() { + assertEntityType("createBeanMetaData"); + return _beanMetaDataFactory.createBeanMetaData(_entityType); + } + + // ----------------------------------------------------- + // ResultSetHandler + // ---------------- + protected ResultSetHandler createOutsideSqlBeanListResultSetHandler( + BeanMetaData bmd) { + final ValueType valueType = ValueTypes.getValueType(_entityType); + if (valueType == null || !valueType.equals(ValueTypes.OBJECT)) { + return createObjectListResultSetHandler(valueType); + } + return createBeanListMetaDataResultSetHandler(bmd); + } + + //========================================================================== + // ========= + // Extension Point + // =============== + @Override + protected ResultSetHandler createOutsideSqlSelectResultSetHandler() { + final BeanMetaData bmd = createBeanMetaData(); + final ResultSetHandler handler = createOutsideSqlBeanListResultSetHandler(bmd); + return handler; + } + + @Override + protected Object getResultTypeSpecification() { + return _entityType; + } + + //========================================================================== + // ========= + // Assert Helper + // ============= + protected void assertEntityType(String methodName) { + if (_entityType == null) { + throw new IllegalStateException(buildAssertMessage("_entityType", + methodName)); + } + } + + //========================================================================== + // ========= + // Accessor + // ======== + public void setEntityType(Class entityType) { + _entityType = entityType; + } +} Property changes on: board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/bhv/core/command/OutsideSqlSelectListCommand.java ___________________________________________________________________ Name: svn:eol-style + native Added: board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/bhv/core/command/QueryDeleteCBCommand.java =================================================================== --- board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/bhv/core/command/QueryDeleteCBCommand.java (rev 0) +++ board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/bhv/core/command/QueryDeleteCBCommand.java 2008-12-27 22:09:08 UTC (rev 1625) @@ -0,0 +1,151 @@ +package jp.sf.pal.board.db.allcommon.bhv.core.command; + +import jp.sf.pal.board.db.allcommon.bhv.core.SqlExecution; +import jp.sf.pal.board.db.allcommon.bhv.core.SqlExecutionCreator; +import jp.sf.pal.board.db.allcommon.cbean.ConditionBean; +import jp.sf.pal.board.db.allcommon.cbean.ConditionBeanContext; +import jp.sf.pal.board.db.allcommon.cbean.FetchNarrowingBeanContext; +import jp.sf.pal.board.db.allcommon.cbean.outsidesql.OutsideSqlOption; +import jp.sf.pal.board.db.allcommon.s2dao.internal.sqlcommand.InternalDeleteQueryAutoDynamicCommand; + +/** + * @author DBFlute(AutoGenerator) + */ +public class QueryDeleteCBCommand extends AbstractBehaviorCommand { + + //========================================================================== + // ========= + // Attribute + // ========= + /** The type of condition-bean. (Derived from conditionBean) */ + protected Class _conditionBeanType; + + /** The instance of condition-bean. (Required) */ + protected ConditionBean _conditionBean; + + //========================================================================== + // ========= + // Basic Information + // ================= + public String getCommandName() { + return "queryDelete"; + } + + public Class getCommandReturnType() { + return int.class; + } + + //========================================================================== + // ========= + // Detail Information + // ================== + public boolean isConditionBean() { + return true; + } + + public boolean isOutsideSql() { + return false; + } + + public boolean isProcedure() { + return false; + } + + public boolean isSelect() { + return false; + } + + public boolean isSelectCount() { + return false; + } + + //========================================================================== + // ========= + // Process Callback + // ================ + public void beforeGettingSqlExecution() { + assertStatus("beforeGettingSqlExecution"); + final ConditionBean cb = _conditionBean; + FetchNarrowingBeanContext.setFetchNarrowingBeanOnThread(cb); + ConditionBeanContext.setConditionBeanOnThread(cb); + } + + public void afterExecuting() { + } + + //========================================================================== + // ========= + // SqlExecution Handling + // ===================== + public String buildSqlExecutionKey() { + assertStatus("buildSqlExecutionKey"); + return _tableDbName + ":" + getCommandName() + "(" + + _conditionBeanType.getSimpleName() + ")"; + } + + public SqlExecutionCreator createSqlExecutionCreator() { + assertStatus("createSqlExecutionCreator"); + return new SqlExecutionCreator() { + public SqlExecution createSqlExecution() { + return createQueryDeleteCBExecution(_conditionBeanType); + } + }; + } + + protected SqlExecution createQueryDeleteCBExecution( + Class cbType) { + return new InternalDeleteQueryAutoDynamicCommand(_dataSource, + _statementFactory); + } + + public Object[] getSqlExecutionArgument() { + assertStatus("getSqlExecutionArgument"); + return new Object[] { _conditionBean }; + } + + //========================================================================== + // ========= + // Argument Information + // ==================== + public ConditionBean getConditionBean() { + return _conditionBean; + } + + public String getOutsideSqlPath() { + return null; + } + + public OutsideSqlOption getOutsideSqlOption() { + return null; + } + + //========================================================================== + // ========= + // Assert Helper + // ============= + protected void assertStatus(String methodName) { + assertBasicProperty(methodName); + assertComponentProperty(methodName); + if (_conditionBeanType == null) { + throw new IllegalStateException(buildAssertMessage( + "_conditionBeanType", methodName)); + } + if (_conditionBean == null) { + throw new IllegalStateException(buildAssertMessage( + "_conditionBean", methodName)); + } + } + + //========================================================================== + // ========= + // Accessor + // ======== + public void setConditionBeanType( + Class conditionBeanType) { + _conditionBeanType = conditionBeanType; + } + + public void setConditionBean(ConditionBean conditionBean) { + _conditionBean = conditionBean; + } +} Property changes on: board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/bhv/core/command/QueryDeleteCBCommand.java ___________________________________________________________________ Name: svn:eol-style + native Added: board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/bhv/core/command/QueryUpdateEntityCBCommand.java =================================================================== --- board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/bhv/core/command/QueryUpdateEntityCBCommand.java (rev 0) +++ board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/bhv/core/command/QueryUpdateEntityCBCommand.java 2008-12-27 22:09:08 UTC (rev 1625) @@ -0,0 +1,140 @@ +package jp.sf.pal.board.db.allcommon.bhv.core.command; + +import jp.sf.pal.board.db.allcommon.bhv.core.SqlExecution; +import jp.sf.pal.board.db.allcommon.bhv.core.SqlExecutionCreator; +import jp.sf.pal.board.db.allcommon.cbean.ConditionBean; +import jp.sf.pal.board.db.allcommon.cbean.ConditionBeanContext; +import jp.sf.pal.board.db.allcommon.cbean.FetchNarrowingBeanContext; +import jp.sf.pal.board.db.allcommon.cbean.outsidesql.OutsideSqlOption; +import jp.sf.pal.board.db.allcommon.s2dao.internal.sqlcommand.InternalUpdateQueryAutoDynamicCommand; + +/** + * @author DBFlute(AutoGenerator) + */ +public class QueryUpdateEntityCBCommand extends AbstractEntityCommand { + + //========================================================================== + // ========= + // Attribute + // ========= + /** The type of condition-bean. (Derived from conditionBean) */ + protected Class _conditionBeanType; + + /** The instance of condition-bean. (Required) */ + protected ConditionBean _conditionBean; + + //========================================================================== + // ========= + // Basic Information + // ================= + public String getCommandName() { + return "queryUpdate"; + } + + //========================================================================== + // ========= + // Detail Information + // ================== + @Override + public boolean isConditionBean() { + return true; + } + + //========================================================================== + // ========= + // Process Callback + // ================ + @Override + public void beforeGettingSqlExecution() { + assertStatus("beforeGettingSqlExecution"); + final ConditionBean cb = _conditionBean; + FetchNarrowingBeanContext.setFetchNarrowingBeanOnThread(cb); + ConditionBeanContext.setConditionBeanOnThread(cb); + } + + //========================================================================== + // ========= + // SqlExecution Handling + // ===================== + public String buildSqlExecutionKey() { + assertStatus("buildSqlExecutionKey"); + return _tableDbName + ":" + getCommandName() + "(" + + _entityType.getSimpleName() + ", " + + _conditionBeanType.getSimpleName() + ")"; + } + + public SqlExecutionCreator createSqlExecutionCreator() { + assertStatus("createSqlExecutionCreator"); + return new SqlExecutionCreator() { + public SqlExecution createSqlExecution() { + return createQueryUpdateEntityCBExecution(_conditionBeanType); + } + }; + } + + protected SqlExecution createQueryUpdateEntityCBExecution( + Class cbType) { + return new InternalUpdateQueryAutoDynamicCommand(_dataSource, + _statementFactory); + } + + public Object[] getSqlExecutionArgument() { + assertStatus("getSqlExecutionArgument"); + return new Object[] { _conditionBean, _entity }; + } + + //========================================================================== + // ========= + // Argument Information + // ==================== + public ConditionBean getConditionBean() { + return _conditionBean; + } + + public String getOutsideSqlPath() { + return null; + } + + public OutsideSqlOption getOutsideSqlOption() { + return null; + } + + //========================================================================== + // ========= + // Assert Helper + // ============= + @Override + protected void assertStatus(String methodName) { + assertBasicProperty(methodName); + assertComponentProperty(methodName); + if (_entityType == null) { + throw new IllegalStateException(buildAssertMessage("_entityType", + methodName)); + } + if (_entity == null) { + throw new IllegalStateException(buildAssertMessage("_entity", + methodName)); + } + if (_conditionBeanType == null) { + throw new IllegalStateException(buildAssertMessage( + "_conditionBeanType", methodName)); + } + if (_conditionBean == null) { + throw new IllegalStateException(buildAssertMessage( + "_conditionBean", methodName)); + } + } + + //========================================================================== + // ========= + // Accessor + // ======== + public void setConditionBeanType( + Class conditionBeanType) { + _conditionBeanType = conditionBeanType; + } + + public void setConditionBean(ConditionBean conditionBean) { + _conditionBean = conditionBean; + } +} Property changes on: board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/bhv/core/command/QueryUpdateEntityCBCommand.java ___________________________________________________________________ Name: svn:eol-style + native Added: board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/bhv/core/command/SelectCountCBCommand.java =================================================================== --- board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/bhv/core/command/SelectCountCBCommand.java (rev 0) +++ board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/bhv/core/command/SelectCountCBCommand.java 2008-12-27 22:09:08 UTC (rev 1625) @@ -0,0 +1,65 @@ +package jp.sf.pal.board.db.allcommon.bhv.core.command; + +import jp.sf.pal.board.db.allcommon.bhv.core.SqlExecution; +import jp.sf.pal.board.db.allcommon.bhv.core.SqlExecutionCreator; +import jp.sf.pal.board.db.allcommon.cbean.ConditionBean; +import jp.sf.pal.board.db.allcommon.cbean.ConditionBeanContext; + +import org.seasar.extension.jdbc.ResultSetHandler; + +/** + * @author DBFlute(AutoGenerator) + */ +public class SelectCountCBCommand extends AbstractSelectCBCommand { + + //========================================================================== + // ========= + // Basic Information + // ================= + public String getCommandName() { + return "selectCount"; + } + + public Class getCommandReturnType() { + return Integer.class; + } + + //========================================================================== + // ========= + // Process Callback + // ================ + public void beforeGettingSqlExecution() { + assertStatus("beforeGettingSqlExecution"); + final ConditionBean cb = _conditionBean; + cb.xsetupSelectCountIgnoreFetchScope(); // *Point! + ConditionBeanContext.setConditionBeanOnThread(cb); + } + + public void afterExecuting() { + assertStatus("afterExecuting"); + final ConditionBean cb = _conditionBean; + cb.xafterCareSelectCountIgnoreFetchScope(); + } + + //========================================================================== + // ========= + // Detail Information + // ================== + public boolean isSelectCount() { + return true; + } + + //========================================================================== + // ========= + // SqlExecution Handling + // ===================== + public SqlExecutionCreator createSqlExecutionCreator() { + assertStatus("createSqlExecutionCreator"); + return new SqlExecutionCreator() { + public SqlExecution createSqlExecution() { + ResultSetHandler handler = createObjectResultSetHandler(getCommandReturnType()); + return createSelectCBExecution(_conditionBeanType, handler); + } + }; + } +} Property changes on: board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/bhv/core/command/SelectCountCBCommand.java ___________________________________________________________________ Name: svn:eol-style + native Added: board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/bhv/core/command/SelectListCBCommand.java =================================================================== --- board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/bhv/core/command/SelectListCBCommand.java (rev 0) +++ board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/bhv/core/command/SelectListCBCommand.java 2008-12-27 22:09:08 UTC (rev 1625) @@ -0,0 +1,103 @@ +package jp.sf.pal.board.db.allcommon.bhv.core.command; + +import java.util.List; + +import jp.sf.pal.board.db.allcommon.Entity; +import jp.sf.pal.board.db.allcommon.bhv.core.SqlExecution; +import jp.sf.pal.board.db.allcommon.bhv.core.SqlExecutionCreator; +import jp.sf.pal.board.db.allcommon.cbean.ConditionBean; +import jp.sf.pal.board.db.allcommon.cbean.ConditionBeanContext; +import jp.sf.pal.board.db.allcommon.cbean.FetchNarrowingBeanContext; + +import org.seasar.dao.BeanMetaData; +import org.seasar.extension.jdbc.ResultSetHandler; + +/** + * @author DBFlute(AutoGenerator) + * @param The type of entity. + */ +public class SelectListCBCommand extends + AbstractSelectCBCommand> { + + //========================================================================== + // ========= + // Attribute + // ========= + /** The type of entity. (Required) */ + protected Class _entityType; + + //========================================================================== + // ========= + // Basic Information + // ================= + public String getCommandName() { + return "selectList"; + } + + public Class getCommandReturnType() { + return List.class; + } + + //========================================================================== + // ========= + // Detail Information + // ================== + public boolean isSelectCount() { + return false; + } + + //========================================================================== + // ========= + // Process Callback + // ================ + public void beforeGettingSqlExecution() { + assertStatus("beforeGettingSqlExecution"); + final ConditionBean cb = _conditionBean; + FetchNarrowingBeanContext.setFetchNarrowingBeanOnThread(cb); + ConditionBeanContext.setConditionBeanOnThread(cb); + } + + public void afterExecuting() { + assertStatus("afterExecuting"); + } + + //========================================================================== + // ========= + // SqlExecution Handling + // ===================== + public SqlExecutionCreator createSqlExecutionCreator() { + assertStatus("createSqlExecutionCreator"); + return new SqlExecutionCreator() { + public SqlExecution createSqlExecution() { + BeanMetaData bmd = createBeanMetaData(); + ResultSetHandler handler = createBeanListMetaDataResultSetHandler(bmd); + return createSelectCBExecution(_conditionBeanType, handler); + } + }; + } + + protected BeanMetaData createBeanMetaData() { + return _beanMetaDataFactory.createBeanMetaData(_entityType); + } + + //========================================================================== + // ========= + // Assert Helper + // ============= + @Override + protected void assertStatus(String methodName) { + super.assertStatus(methodName); + if (_entityType == null) { + throw new IllegalStateException(buildAssertMessage("_entityType", + methodName)); + } + } + + //========================================================================== + // ========= + // Accessor + // ======== + public void setEntityType(Class entityType) { + _entityType = entityType; + } +} Property changes on: board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/bhv/core/command/SelectListCBCommand.java ___________________________________________________________________ Name: svn:eol-style + native Added: board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/bhv/core/command/SelectNextValCommand.java =================================================================== --- board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/bhv/core/command/SelectNextValCommand.java (rev 0) +++ board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/bhv/core/command/SelectNextValCommand.java 2008-12-27 22:09:08 UTC (rev 1625) @@ -0,0 +1,162 @@ +package jp.sf.pal.board.db.allcommon.bhv.core.command; + +import jp.sf.pal.board.db.allcommon.bhv.core.SqlExecution; +import jp.sf.pal.board.db.allcommon.bhv.core.SqlExecutionCreator; +import jp.sf.pal.board.db.allcommon.bhv.core.execution.BasicSelectExecution; +import jp.sf.pal.board.db.allcommon.cbean.ConditionBean; +import jp.sf.pal.board.db.allcommon.cbean.outsidesql.OutsideSqlOption; +import jp.sf.pal.board.db.allcommon.dbmeta.DBMeta; +import jp.sf.pal.board.db.allcommon.dbmeta.DBMetaInstanceHandler; + +import org.seasar.extension.jdbc.ResultSetHandler; + +/** + * @author DBFlute(AutoGenerator) + * @param The type of result. + */ +public class SelectNextValCommand extends + AbstractBehaviorCommand { + + //========================================================================== + // ========= + // Attribute + // ========= + /** The type of result. (NotNull) */ + protected Class _resultType; + + //========================================================================== + // ========= + // Basic Information + // ================= + public String getCommandName() { + return "selectNextVal"; + } + + public Class getCommandReturnType() { + return _resultType; + } + + //========================================================================== + // ========= + // Detail Information + // ================== + public boolean isConditionBean() { + return false; + } + + public boolean isOutsideSql() { + return false; + } + + public boolean isProcedure() { + return false; + } + + public boolean isSelect() { + return true; + } + + public boolean isSelectCount() { + return false; + } + + //========================================================================== + // ========= + // Process Callback + // ================ + public void beforeGettingSqlExecution() { + } + + public void afterExecuting() { + } + + //========================================================================== + // ========= + // SqlExecution Handling + // ===================== + public String buildSqlExecutionKey() { + assertStatus("buildSqlExecutionKey"); + return _tableDbName + ":" + getCommandName() + "()"; + } + + public SqlExecutionCreator createSqlExecutionCreator() { + assertStatus("createSqlExecutionCreator"); + return new SqlExecutionCreator() { + public SqlExecution createSqlExecution() { + ResultSetHandler handler = createObjectResultSetHandler(_resultType); + return createSelectNextValExecution(handler); + } + }; + } + + protected SqlExecution createSelectNextValExecution(ResultSetHandler handler) { + final DBMeta dbmeta = findDBMeta(); + if (!dbmeta.hasSequence()) { + String msg = "If the method 'selectNextVal()' exists, DBMeta.hasSequence() should return true:"; + msg = msg + " dbmeta.hasSequence()=" + dbmeta.hasSequence(); + throw new IllegalStateException(msg); + } + final String nextValSql = dbmeta.getSequenceNextValSql(); + if (nextValSql == null) { + String msg = "If the method 'selectNextVal()' exists, DBMeta.getSequenceNextValSql() should not return null:"; + msg = msg + " dbmeta.getSequenceNextValSql()=" + + dbmeta.getSequenceNextValSql(); + throw new IllegalStateException(msg); + } + return createBasicSelectExecution(handler, new String[] {}, + new Class[] {}, nextValSql); + } + + protected BasicSelectExecution createBasicSelectExecution( + ResultSetHandler handler, String[] argNames, Class[] argTypes, + String sql) { + final BasicSelectExecution cmd = new BasicSelectExecution(_dataSource, + _statementFactory, handler); + cmd.setArgNames(argNames); + cmd.setArgTypes(argTypes); + cmd.setSql(sql); + return cmd; + } + + protected DBMeta findDBMeta() { + return DBMetaInstanceHandler.findDBMeta(_tableDbName); + } + + public Object[] getSqlExecutionArgument() { + assertStatus("getSqlExecutionArgument"); + return new Object[] {}; + } + + //========================================================================== + // ========= + // Argument Information + // ==================== + public ConditionBean getConditionBean() { + return null; + } + + public String getOutsideSqlPath() { + return null; + } + + public OutsideSqlOption getOutsideSqlOption() { + return null; + } + + //========================================================================== + // ========= + // Assert Helper + // ============= + protected void assertStatus(String methodName) { + assertBasicProperty(methodName); + assertComponentProperty(methodName); + } + + //========================================================================== + // ========= + // Accessor + // ======== + public void setResultType(Class resultType) { + _resultType = resultType; + } +} Property changes on: board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/bhv/core/command/SelectNextValCommand.java ___________________________________________________________________ Name: svn:eol-style + native Added: board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/bhv/core/command/SelectScalarCBCommand.java =================================================================== --- board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/bhv/core/command/SelectScalarCBCommand.java (rev 0) +++ board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/bhv/core/command/SelectScalarCBCommand.java 2008-12-27 22:09:08 UTC (rev 1625) @@ -0,0 +1,112 @@ +package jp.sf.pal.board.db.allcommon.bhv.core.command; + +import jp.sf.pal.board.db.allcommon.bhv.core.SqlExecution; +import jp.sf.pal.board.db.allcommon.bhv.core.SqlExecutionCreator; +import jp.sf.pal.board.db.allcommon.cbean.ConditionBean; +import jp.sf.pal.board.db.allcommon.cbean.ConditionBeanContext; +import jp.sf.pal.board.db.allcommon.cbean.sqlclause.SqlClause; + +import org.seasar.extension.jdbc.ResultSetHandler; + +/** + * @author DBFlute(AutoGenerator) + * @param The type of result. + */ +public class SelectScalarCBCommand extends + AbstractSelectCBCommand { + + //========================================================================== + // ========= + // Attribute + // ========= + /** The type of result. (NotNull) */ + protected Class _resultType; + + /** The type of select clause. (NotNull) */ + protected SqlClause.SelectClauseType _selectClauseType; + + //========================================================================== + // ========= + // Basic Information + // ================= + public String getCommandName() { + assertStatus("getCommandName"); + final String resultTypeName = _resultType.getSimpleName(); + final String scalarMethodName = _selectClauseType.toString() + .toLowerCase(); + return "scalarSelect(" + resultTypeName + ")." + scalarMethodName; + } + + public Class getCommandReturnType() { + assertStatus("getCommandReturnType"); + return _resultType; + } + + //========================================================================== + // ========= + // Detail Information + // ================== + public boolean isSelectCount() { + return false; + } + + //========================================================================== + // ========= + // Process Callback + // ================ + public void beforeGettingSqlExecution() { + assertStatus("beforeGettingSqlExecution"); + final ConditionBean cb = _conditionBean; + ConditionBeanContext.setConditionBeanOnThread(cb); + cb.getSqlClause().classifySelectClauseType(_selectClauseType); //*Point! + } + + public void afterExecuting() { + assertStatus("afterExecuting"); + final ConditionBean cb = _conditionBean; + cb.getSqlClause().rollbackSelectClauseType(); + } + + //========================================================================== + // ========= + // SqlExecution Handling + // ===================== + public SqlExecutionCreator createSqlExecutionCreator() { + assertStatus("createSqlExecutionCreator"); + return new SqlExecutionCreator() { + public SqlExecution createSqlExecution() { + ResultSetHandler handler = createObjectResultSetHandler(getCommandReturnType()); + return createSelectCBExecution(_conditionBeanType, handler); + } + }; + } + + //========================================================================== + // ========= + // Assert Helper + // ============= + @Override + protected void assertStatus(String methodName) { + super.assertStatus(methodName); + if (_resultType == null) { + throw new IllegalStateException(buildAssertMessage("_resultType", + methodName)); + } + if (_selectClauseType == null) { + throw new IllegalStateException(buildAssertMessage( + "_selectClauseType", methodName)); + } + } + + //========================================================================== + // ========= + // Accessor + // ======== + public void setResultType(Class resultType) { + _resultType = resultType; + } + + public void setSelectClauseType(SqlClause.SelectClauseType selectClauseType) { + _selectClauseType = selectClauseType; + } +} Property changes on: board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/bhv/core/command/SelectScalarCBCommand.java ___________________________________________________________________ Name: svn:eol-style + native Added: board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/bhv/core/command/UpdateEntityCommand.java =================================================================== --- board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/bhv/core/command/UpdateEntityCommand.java (rev 0) +++ board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/bhv/core/command/UpdateEntityCommand.java 2008-12-27 22:09:08 UTC (rev 1625) @@ -0,0 +1,55 @@ +package jp.sf.pal.board.db.allcommon.bhv.core.command; + +import jp.sf.pal.board.db.allcommon.bhv.core.SqlExecution; +import jp.sf.pal.board.db.allcommon.bhv.core.SqlExecutionCreator; +import jp.sf.pal.board.db.allcommon.s2dao.internal.sqlcommand.InternalUpdateModifiedOnlyCommand; + +import org.seasar.dao.BeanMetaData; + +/** + * @author DBFlute(AutoGenerator) + */ +public class UpdateEntityCommand extends AbstractEntityCommand { + + //========================================================================== + // ========= + // Basic Information + // ================= + public String getCommandName() { + return "update"; + } + + //========================================================================== + // ========= + // SqlExecution Handling + // ===================== + public SqlExecutionCreator createSqlExecutionCreator() { + assertStatus("createSqlExecutionCreator"); + return new SqlExecutionCreator() { + public SqlExecution createSqlExecution() { + final BeanMetaData bmd = createBeanMetaData(); + return createUpdateEntitySqlExecution(bmd); + } + }; + } + + protected SqlExecution createUpdateEntitySqlExecution(BeanMetaData bmd) { + final String[] propertyNames = getPersistentPropertyNames(bmd); + return createUpdateModifiedOnlyCommand(bmd, propertyNames); + } + + protected InternalUpdateModifiedOnlyCommand createUpdateModifiedOnlyCommand( + BeanMetaData bmd, String[] propertyNames) { + final InternalUpdateModifiedOnlyCommand cmd = new InternalUpdateModifiedOnlyCommand( + _dataSource, _statementFactory); + cmd.setBeanMetaData(bmd);// Extension Point! + cmd.setPropertyNames(propertyNames); + cmd.setOptimisticLockHandling(isOptimisticLockHandling()); + cmd.setVersionNoAutoIncrementOnMemory(isOptimisticLockHandling()); + return cmd; + } + + protected boolean isOptimisticLockHandling() { + return true; + } +} Property changes on: board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/bhv/core/command/UpdateEntityCommand.java ___________________________________________________________________ Name: svn:eol-style + native Added: board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/bhv/core/command/UpdateNonstrictEntityCommand.java =================================================================== --- board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/bhv/core/command/UpdateNonstrictEntityCommand.java (rev 0) +++ board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/bhv/core/command/UpdateNonstrictEntityCommand.java 2008-12-27 22:09:08 UTC (rev 1625) @@ -0,0 +1,25 @@ +package jp.sf.pal.board.db.allcommon.bhv.core.command; + +/** + * @author DBFlute(AutoGenerator) + */ +public class UpdateNonstrictEntityCommand extends UpdateEntityCommand { + + //========================================================================== + // ========= + // Basic Information + // ================= + @Override + public String getCommandName() { + return "updateNonstrict"; + } + + //========================================================================== + // ========= + // SqlExecution Handling + // ===================== + @Override + protected boolean isOptimisticLockHandling() { + return false; + } +} Property changes on: board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/bhv/core/command/UpdateNonstrictEntityCommand.java ___________________________________________________________________ Name: svn:eol-style + native Added: board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/bhv/core/execution/BasicSelectExecution.java =================================================================== --- board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/bhv/core/execution/BasicSelectExecution.java (rev 0) +++ board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/bhv/core/execution/BasicSelectExecution.java 2008-12-27 22:09:08 UTC (rev 1625) @@ -0,0 +1,77 @@ +package jp.sf.pal.board.db.allcommon.bhv.core.execution; + +import javax.sql.DataSource; + +import jp.sf.pal.board.db.allcommon.s2dao.internal.sqlcommand.InternalAbstractDynamicCommand; +import jp.sf.pal.board.db.allcommon.s2dao.internal.sqlhandler.InternalBasicSelectHandler; + +import org.seasar.dao.CommandContext; +import org.seasar.extension.jdbc.ResultSetHandler; +import org.seasar.extension.jdbc.StatementFactory; + +/** + * @author DBFlute(AutoGenerator) + */ +public class BasicSelectExecution extends InternalAbstractDynamicCommand { + + //========================================================================== + // ========= + // Attribute + // ========= + /** The handler of resultSet. */ + protected ResultSetHandler resultSetHandler; + + //========================================================================== + // ========= + // Constructor + // =========== + /** + * Constructor. + * + * @param dataSource Data source. + * @param statementFactory The factory of statement. + * @param resultSetHandler The handler of resultSet. + */ + public BasicSelectExecution(DataSource dataSource, + StatementFactory statementFactory, ResultSetHandler resultSetHandler) { + super(dataSource, statementFactory); + this.resultSetHandler = resultSetHandler; + } + + //========================================================================== + // ========= + // Execute + // ======= + /** + * @param args The array of argument. (Nullable) + * @return The object of execution result. (Nullable) + */ + public Object execute(Object[] args) { + final CommandContext ctx = apply(args); + final InternalBasicSelectHandler selectHandler = createBasicSelectHandler( + ctx.getSql(), this.resultSetHandler); + final Object[] bindVariableArray = ctx.getBindVariables(); + selectHandler.setLoggingMessageSqlArgs(bindVariableArray); + return selectHandler.execute(bindVariableArray, ctx + .getBindVariableTypes()); + } + + //========================================================================== + // ========= + // Select Handler + // ============== + protected InternalBasicSelectHandler createBasicSelectHandler( + String realSql, ResultSetHandler rsh) { + return new InternalBasicSelectHandler(getDataSource(), realSql, rsh, + getStatementFactory()); + } + + //========================================================================== + // ========= + // Parser Option + // ============= + @Override + protected boolean isBlockNullParameter() { + return true; // Because the SQL is select. + } +} Property changes on: board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/bhv/core/execution/BasicSelectExecution.java ___________________________________________________________________ Name: svn:eol-style + native Added: board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/bhv/core/execution/OutsideSqlSelectExecution.java =================================================================== --- board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/bhv/core/execution/OutsideSqlSelectExecution.java (rev 0) +++ board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/bhv/core/execution/OutsideSqlSelectExecution.java 2008-12-27 22:09:08 UTC (rev 1625) @@ -0,0 +1,225 @@ +package jp.sf.pal.board.db.allcommon.bhv.core.execution; + +import java.util.ArrayList; +import java.util.List; + +import javax.sql.DataSource; + +import jp.sf.pal.board.db.allcommon.cbean.outsidesql.OutsideSqlContext; +import jp.sf.pal.board.db.allcommon.s2dao.internal.sqlcommand.InternalAbstractDynamicCommand; +import jp.sf.pal.board.db.allcommon.s2dao.internal.sqlhandler.InternalBasicSelectHandler; +import jp.sf.pal.board.db.allcommon.util.SimpleStringUtil; +import jp.sf.pal.board.db.allcommon.util.SimpleSystemUtil; + +import org.seasar.dao.CommandContext; +import org.seasar.extension.jdbc.ResultSetHandler; +import org.seasar.extension.jdbc.StatementFactory; +import org.seasar.framework.beans.BeanDesc; +import org.seasar.framework.beans.PropertyDesc; +import org.seasar.framework.beans.factory.BeanDescFactory; + +/** + * @author DBFlute(AutoGenerator) + */ +public class OutsideSqlSelectExecution extends InternalAbstractDynamicCommand { + + //========================================================================== + // ========= + // Attribute + // ========= + /** The handler of resultSet. */ + protected ResultSetHandler resultSetHandler; + + //========================================================================== + // ========= + // Constructor + // =========== + /** + * Constructor. + * + * @param dataSource Data source. + * @param statementFactory The factory of statement. + * @param resultSetHandler The handler of resultSet. + */ + public OutsideSqlSelectExecution(DataSource dataSource, + StatementFactory statementFactory, ResultSetHandler resultSetHandler) { + super(dataSource, statementFactory); + this.resultSetHandler = resultSetHandler; + } + + //========================================================================== + // ========= + // Execute + // ======= + /** + * @param args The array of argument. (NotNull, The first element should be + * the instance of Pmb) + * @return The object of execution result. (Nullable) + */ + public Object execute(Object[] args) { + final OutsideSqlContext outsideSqlContext = OutsideSqlContext + .getOutsideSqlContextOnThread(); + if (outsideSqlContext.isDynamicBinding()) { + return executeOutsideSqlAsDynamic(args, outsideSqlContext); + } else { + return executeOutsideSqlAsStatic(args, outsideSqlContext); + } + } + + // ----------------------------------------------------- + // OutsideSql Execute + // ------------------ + /** + * Execute outside-SQL as Dynamic. + * + * @param args The array of argument. (NotNull, The first element should be + * the instance of Pmb) + * @param outsideSqlContext The context of outside-SQL. (NotNull) + * @return Result. (Nullable) + */ + protected Object executeOutsideSqlAsDynamic(Object[] args, + OutsideSqlContext outsideSqlContext) { + final Object firstArg = args[0]; + String staticSql = getSql(); + if (firstArg != null) { + final BeanDesc beanDesc = BeanDescFactory.getBeanDesc(firstArg + .getClass()); + + // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + // - - - - - - - + // Resolve embedded comment for parsing bind variable comment in + // embedded comment. + // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + // - - - - - - - + for (int i = 0; i < beanDesc.getPropertyDescSize(); i++) { + final PropertyDesc propertyDesc = beanDesc.getPropertyDesc(i); + final Class propertyType = propertyDesc.getPropertyType(); + if (!propertyType.equals(String.class)) { + continue; + } + final String outsideSqlPiece = (String) propertyDesc + .getValue(firstArg); + if (outsideSqlPiece == null) { + continue; + } + final String embeddedComment = "/*$pmb." + + propertyDesc.getPropertyName() + "*/"; + staticSql = replaceString(staticSql, embeddedComment, + outsideSqlPiece); + } + } + + final OutsideSqlSelectExecution outsideSqlCommand = createDynamicSqlFactory(); + outsideSqlCommand.setArgNames(getArgNames()); + outsideSqlCommand.setArgTypes(getArgTypes()); + outsideSqlCommand.setSql(staticSql); + + final CommandContext ctx = outsideSqlCommand.apply(args); + final List bindVariableList = new ArrayList(); + final List> bindVariableTypeList = new ArrayList>(); + addBindVariableInfo(ctx, bindVariableList, bindVariableTypeList); + final InternalBasicSelectHandler selectHandler = createBasicSelectHandler( + ctx.getSql(), this.resultSetHandler); + final Object[] bindVariableArray = bindVariableList.toArray(); + selectHandler.setLoggingMessageSqlArgs(bindVariableArray); + return selectHandler.execute(bindVariableArray, + toClassArray(bindVariableTypeList)); + } + + /** + * Execute outside-SQL as static. + * + * @param args The array of argument. (NotNull, The first element should be + * the instance of Pmb) + * @param outsideSqlContext The context of outside-SQL. (NotNull) + * @return Result. (Nullable) + */ + protected Object executeOutsideSqlAsStatic(Object[] args, + OutsideSqlContext outsideSqlContext) { + final CommandContext ctx = apply(args); + final InternalBasicSelectHandler selectHandler = createBasicSelectHandler( + ctx.getSql(), this.resultSetHandler); + final Object[] bindVariableArray = ctx.getBindVariables(); + selectHandler.setLoggingMessageSqlArgs(bindVariableArray); + return selectHandler.execute(bindVariableArray, ctx + .getBindVariableTypes()); + } + + //========================================================================== + // ========= + // Dynamic SQL Factory + // =================== + protected OutsideSqlSelectExecution createDynamicSqlFactory() { + return new OutsideSqlSelectExecution(getDataSource(), + getStatementFactory(), resultSetHandler); + } + + //========================================================================== + // ========= + // Select Handler + // ============== + protected InternalBasicSelectHandler createBasicSelectHandler( + String realSql, ResultSetHandler rsh) { + return new InternalBasicSelectHandler(getDataSource(), realSql, rsh, + getStatementFactory()); + } + + //========================================================================== + // ========= + // Parser Option + // ============= + @Override + protected boolean isBlockNullParameter() { + return true; // Because the SQL is select. + } + + //========================================================================== + // ========= + // Setup Helper + // ============ + protected Class[] toClassArray(List> 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 bindVariableList, List> bindVariableTypeList) { + final Object[] bindVariables = ctx.getBindVariables(); + addBindVariableList(bindVariableList, bindVariables); + final Class[] bindVariableTypes = ctx.getBindVariableTypes(); + addBindVariableTypeList(bindVariableTypeList, bindVariableTypes); + } + + protected void addBindVariableList(List bindVariableList, + Object[] bindVariables) { + for (int i = 0; i < bindVariables.length; i++) { + bindVariableList.add(bindVariables[i]); + } + } + + protected void addBindVariableTypeList(List> bindVariableTypeList, + Class[] bindVariableTypes) { + for (int i = 0; i < bindVariableTypes.length; i++) { + bindVariableTypeList.add(bindVariableTypes[i]); + } + } + + //========================================================================== + // ========= + // General Helper + // ============== + protected final String replaceString(String text, String fromText, + String toText) { + return SimpleStringUtil.replace(text, fromText, toText); + } + + protected String getLineSeparator() { + return SimpleSystemUtil.getLineSeparator(); + } +} Property changes on: board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/bhv/core/execution/OutsideSqlSelectExecution.java ___________________________________________________________________ Name: svn:eol-style + native Added: board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/bhv/core/execution/SelectCBExecution.java =================================================================== --- board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/bhv/core/execution/SelectCBExecution.java (rev 0) +++ board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/bhv/core/execution/SelectCBExecution.java 2008-12-27 22:09:08 UTC (rev 1625) @@ -0,0 +1,168 @@ +package jp.sf.pal.board.db.allcommon.bhv.core.execution; + +import java.util.ArrayList; +import java.util.List; + +import javax.sql.DataSource; + +import jp.sf.pal.board.db.allcommon.cbean.ConditionBean; +import jp.sf.pal.board.db.allcommon.cbean.ConditionBeanContext; +import jp.sf.pal.board.db.allcommon.s2dao.internal.sqlcommand.InternalAbstractDynamicCommand; +import jp.sf.pal.board.db.allcommon.s2dao.internal.sqlhandler.InternalBasicSelectHandler; +import jp.sf.pal.board.db.allcommon.util.SimpleStringUtil; +import jp.sf.pal.board.db.allcommon.util.SimpleSystemUtil; + +import org.seasar.dao.CommandContext; +import org.seasar.extension.jdbc.ResultSetHandler; +import org.seasar.extension.jdbc.StatementFactory; + +/** + * @author DBFlute(AutoGenerator) + */ +public class SelectCBExecution extends InternalAbstractDynamicCommand { + + //========================================================================== + // ========= + // Attribute + // ========= + /** The handler of resultSet. */ + protected ResultSetHandler resultSetHandler; + + //========================================================================== + // ========= + // Constructor + // =========== + /** + * Constructor. + * + * @param dataSource Data source. + * @param statementFactory The factory of statement. + * @param resultSetHandler The handler of resultSet. + */ + public SelectCBExecution(DataSource dataSource, + StatementFactory statementFactory, ResultSetHandler resultSetHandler) { + super(dataSource, statementFactory); + this.resultSetHandler = resultSetHandler; + } + + //========================================================================== + // ========= + // Execute + // ======= + /** + * @param args The array of argument. (NotNull, The first element should be + * the instance of CB) + * @return The object of execution result. (Nullable) + */ + public Object execute(Object[] args) { + final List bindVariableList = new ArrayList(); + final List> bindVariableTypeList = new ArrayList>(); + + final String finalClause = setupRealClause(args, bindVariableList, + bindVariableTypeList); + final InternalBasicSelectHandler selectHandler = createBasicSelectHandler( + finalClause, this.resultSetHandler); + final Object[] bindVariableArray = bindVariableList.toArray(); + selectHandler.setLoggingMessageSqlArgs(bindVariableArray); + return selectHandler.execute(bindVariableArray, + toClassArray(bindVariableTypeList)); + } + + // ----------------------------------------------------- + // Setup Clause + // ------------ + protected String setupRealClause(Object[] args, + List bindVariableList, List> bindVariableTypeList) { + final ConditionBean cb = ConditionBeanContext + .getConditionBeanOnThread(); + final String realClause; + { + final SelectCBExecution dynamicSqlFactory = createDynamicSqlFactory(); + dynamicSqlFactory.setArgNames(getArgNames()); + dynamicSqlFactory.setArgTypes(getArgTypes()); + dynamicSqlFactory.setSql(cb.getSqlClause().getClause()); + final CommandContext ctx = dynamicSqlFactory.apply(args); + realClause = ctx.getSql(); + addBindVariableInfo(ctx, bindVariableList, bindVariableTypeList); + } + return realClause; + } + + //========================================================================== + // ========= + // Dynamic SQL Factory + // =================== + protected SelectCBExecution createDynamicSqlFactory() { + return new SelectCBExecution(getDataSource(), getStatementFactory(), + resultSetHandler); + } + + //========================================================================== + // ========= + // Select Handler + // ============== + protected InternalBasicSelectHandler createBasicSelectHandler( + String realSql, ResultSetHandler rsh) { + return new InternalBasicSelectHandler(getDataSource(), realSql, rsh, + getStatementFactory()); + } + + //========================================================================== + // ========= + // Parser Option + // ============= + @Override + protected boolean isBlockNullParameter() { + return true; // Because the SQL is select. + } + + //========================================================================== + // ========= + // Setup Helper + // ============ + protected Class[] toClassArray(List> 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 bindVariableList, List> bindVariableTypeList) { + final Object[] bindVariables = ctx.getBindVariables(); + addBindVariableList(bindVariableList, bindVariables); + final Class[] bindVariableTypes = ctx.getBindVariableTypes(); + addBindVariableTypeList(bindVariableTypeList, bindVariableTypes); + } + + protected void addBindVariableList(List bindVariableList, + Object[] bindVariables) { + for (int i = 0; i < bindVariables.length; i++) { + bindVariableList.add(bindVariables[i]); + } + } + + protected void addBindVariableTypeList(List> bindVariableTypeList, + Class[] bindVariableTypes) { + for (int i = 0; i < bindVariableTypes.length; i++) { + bindVariableTypeList.add(bindVariableTypes[i]); + } + } + + //========================================================================== + // ========= + // General Helper + // ============== + protected final String replaceString(String text, String fromText, + String toText) { + return SimpleStringUtil.replace(text, fromText, toText); + } + + protected String getLineSeparator() { + return SimpleSystemUtil.getLineSeparator(); + } +} Property changes on: board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/bhv/core/execution/SelectCBExecution.java ___________________________________________________________________ Name: svn:eol-style + native Deleted: board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/bhv/load/LoadRefererOption.java =================================================================== --- board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/bhv/load/LoadRefererOption.java 2008-12-27 22:06:42 UTC (rev 1624) +++ board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/bhv/load/LoadRefererOption.java 2008-12-27 22:09:08 UTC (rev 1625) @@ -1,78 +0,0 @@ -package jp.sf.pal.board.db.allcommon.bhv.load; - -import jp.sf.pal.board.db.allcommon.Entity; -import jp.sf.pal.board.db.allcommon.bhv.setup.ConditionBeanSetupper; -import jp.sf.pal.board.db.allcommon.bhv.setup.EntityListSetupper; -import jp.sf.pal.board.db.allcommon.cbean.ConditionBean; - -/** - * The class of load referrer option. - * - * @param The type of referrer condition-bean. - * @param The type of referrer entity. - * @author DBFlute(AutoGenerator) - */ -public class LoadRefererOption - extends LoadReferrerOption { - - //========================================================================== - // ========= - // Constructor - // =========== - public LoadRefererOption() { - } - - public LoadRefererOption( - ConditionBeanSetupper conditionBeanSetupper) { - super(conditionBeanSetupper); - } - - public LoadRefererOption( - ConditionBeanSetupper conditionBeanSetupper, - EntityListSetupper entityListSetupper) { - super(conditionBeanSetupper, entityListSetupper); - } - - public LoadRefererOption( - LoadReferrerOption option) { - super(option); - } - - //========================================================================== - // ========= - // Accessor - // ======== - /** - * @return The condition-bean of referrer. - * @deprecated Sorry! This methid have typo! Please use - * getRefererConditionBean(). - */ - public REFERRER_CONDITION_BEAN getReffererConditionBean() { - return super.getReferrerConditionBean(); - } - - /** - * @param referrerConditionBean The condition-bean of referrer. - * @deprecated Sorry! This methid have typo! Please use - * setReferrerConditionBean(). - */ - public void setReffererConditionBean( - REFERRER_CONDITION_BEAN referrerConditionBean) { - super.setReferrerConditionBean(referrerConditionBean); - } - - /** - * @return The condition-bean of referrer. - */ - public REFERRER_CONDITION_BEAN getRefererConditionBean() { - return super.getReferrerConditionBean(); - } - - /** - * @param referrerConditionBean The condition-bean of referrer. - */ - public void setRefererConditionBean( - REFERRER_CONDITION_BEAN referrerConditionBean) { - super.setReferrerConditionBean(referrerConditionBean); - } -} Modified: board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/cbean/AbstractConditionBean.java =================================================================== --- board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/cbean/AbstractConditionBean.java 2008-12-27 22:06:42 UTC (rev 1624) +++ board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/cbean/AbstractConditionBean.java 2008-12-27 22:09:08 UTC (rev 1625) @@ -24,6 +24,28 @@ public abstract class AbstractConditionBean implements ConditionBean { //========================================================================== + // =========== + // Definition + // ========== + /** Map-string map-mark. */ + private static final String MAP_STRING_MAP_MARK = "map:"; + + /** Map-string list-mark. */ + private static final String MAP_STRING_LIST_MARK = "list:"; + + /** Map-string start-brace. */ + private static final String MAP_STRING_START_BRACE = "@{"; + + /** Map-string end-brace. */ + private static final String MAP_STRING_END_BRACE = "@}"; + + /** Map-string delimiter. */ + private static final String MAP_STRING_DELIMITER = "@;"; + + /** Map-string equal. */ + private static final String MAP_STRING_EQUAL = "@="; + + //========================================================================== // ========= // Attribute // ========= @@ -41,8 +63,12 @@ // [DBFlute-0.7.4] @jflute -- At the future, I'll implement some check // logics by these purpose types. - protected boolean _forDeriveReferrer; + protected boolean _forDerivedReferrer; + protected boolean _forScalarSelect; + + protected boolean _forScalarSubQuery; + protected boolean _forUnion; protected boolean _forExistsSubQuery; @@ -73,27 +99,6 @@ //========================================================================== // ========= - // ConditionQuery - // ============== - /** - * Get condition query as interface. At the future, change public to - * protected. - * - * @return Instance of query as interface. (NotNull) - */ - abstract public ConditionQuery getConditionQueryAsInterface(); - - /** - * The implementation. - * - * @return The conditionQuery of the local table as interface. (NotNull) - */ - public ConditionQuery localCQ() { - return getConditionQueryAsInterface(); - } - - //========================================================================== - // ========= // Accept PrimaryKey // ================= /** @@ -498,42 +503,6 @@ //========================================================================== // ========= - // Limit Select - // ============ - /** Is limit-select PK only? */ - protected boolean _isLimitSelectPKOnly; - - /** - * Is limit-select PK only? - * - * @return Determination. - */ - public boolean isLimitSelect_PKOnly() { - return _isLimitSelectPKOnly; - } - - /** - * Limit select PK only. - * - * @return this. (NotNull) - */ - public ConditionBean limitSelect_PKOnly() { - _isLimitSelectPKOnly = true; - return this; - } - - /** - * Limit select off. - * - * @return this. (NotNull) - */ - public ConditionBean limitSelect_Off() { - _isLimitSelectPKOnly = false; - return this; - } - - //========================================================================== - // ========= // Lock Setting // ============ /** @@ -559,11 +528,8 @@ public ConditionBean xsetupSelectCountIgnoreFetchScope() { _isSelectCountIgnoreFetchScope = true; - // If the query uses union query, it needs included-select-column. - if (!hasUnionQueryOrUnionAllQuery()) { - getSqlClause().ignoreIncludedSelectColumn(); - } - + getSqlClause().classifySelectClauseType( + SqlClause.SelectClauseType.COUNT); getSqlClause().ignoreOrderBy(); getSqlClause().ignoreFetchScope(); return this; @@ -578,11 +544,7 @@ public ConditionBean xafterCareSelectCountIgnoreFetchScope() { _isSelectCountIgnoreFetchScope = false; - // If the query uses union query, it needs included-select-column. - if (!hasUnionQueryOrUnionAllQuery()) { - getSqlClause().makeIncludedSelectColumnEffective(); - } - + getSqlClause().rollbackSelectClauseType(); getSqlClause().makeOrderByEffective(); getSqlClause().makeFetchScopeEffective(); return this; @@ -613,20 +575,29 @@ protected CQ _query; - protected boolean _forDeriveReferrer; + protected boolean _forDerivedReferrer; - protected boolean alreadySpecifyRequiredColumn; + protected boolean _forScalarSelect; + protected boolean _forScalarSubQuery; + + protected boolean _alreadySpecifyRequiredColumn; + /** * @param baseCB The condition-bean of base level. (NotNull) - * @param qyCall The callback for condition-query. (NotNull) - * @param forDeriveReferrer Is this for derive referrer? + * @param qyCall The call-back for condition-query. (NotNull) + * @param forDerivedReferrer Is this for derive referrer? + * @param forScalarSelect Is this for scalar select? + * @param forScalarSubQuery Is this for scalar sub-query? */ protected AbstractSpecification(ConditionBean baseCB, - SpQyCall qyCall, boolean forDeriveReferrer) { + SpQyCall qyCall, boolean forDerivedReferrer, + boolean forScalarSelect, boolean forScalarSubQuery) { _baseCB = baseCB; _qyCall = qyCall; - _forDeriveReferrer = forDeriveReferrer; + _forDerivedReferrer = forDerivedReferrer; + _forScalarSelect = forScalarSelect; + _forScalarSubQuery = forScalarSubQuery; } protected void doColumn(String columnName) { @@ -634,8 +605,8 @@ if (_query == null) { _query = _qyCall.qy(); } - if (!_forDeriveReferrer && !alreadySpecifyRequiredColumn) { - alreadySpecifyRequiredColumn = true; + if (isRequiredColumnSpecificationEnabled()) { + _alreadySpecifyRequiredColumn = true; doSpecifyRequiredColumn(); } String relationPath = _query.getRelationPath() != null ? _query @@ -652,6 +623,11 @@ columnName); } + protected boolean isRequiredColumnSpecificationEnabled() { + return !_forDerivedReferrer && !_forScalarSelect + && !_forScalarSubQuery && !_alreadySpecifyRequiredColumn; + } + protected void assertColumn(String columnName) { if (_query == null && !_qyCall.has()) { throwSpecifyColumnNotSetupSelectColumnException(columnName); @@ -659,9 +635,15 @@ } protected void assertForeign(String foreignPropertyName) { - if (_forDeriveReferrer) { - throwDeriveReferrerInvalidForeignSpecificationException(foreignPropertyName); + if (_forDerivedReferrer) { + throwDerivedReferrerInvalidForeignSpecificationException(foreignPropertyName); } + if (_forScalarSelect) { + throwScalarSelectInvalidForeignSpecificationException(foreignPropertyName); + } + if (_forScalarSubQuery) { + throwScalarSubQueryInvalidForeignSpecificationException(foreignPropertyName); + } } protected abstract void doSpecifyRequiredColumn(); @@ -714,19 +696,19 @@ throw new SpecifyColumnNotSetupSelectColumnException(msg); } - protected void throwDeriveReferrerInvalidForeignSpecificationException( + protected void throwDerivedReferrerInvalidForeignSpecificationException( String foreignPropertyName) { String msg = "Look! Read the message below." + getLineSeparator(); msg = msg + "/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *" + getLineSeparator(); msg = msg - + "You specified a foreign table column in spite of derive-sub-query!" + + "You specified a foreign table column in spite of derived-referrer!" + getLineSeparator(); msg = msg + getLineSeparator(); msg = msg + "[Advice]" + getLineSeparator(); msg = msg - + "You should specified a local table column at condition-bean for derive-sub-query." + + "You should specified a local table column at condition-bean for derived-referrer." + getLineSeparator(); msg = msg + " For example:" + getLineSeparator(); msg = msg + " " + getLineSeparator(); @@ -736,7 +718,7 @@ msg = msg + " MemberCB cb = new MemberCB();" + getLineSeparator(); msg = msg - + " cb.specify().derivePurchaseList().max(new SubQuery() {" + + " cb.specify().derivedPurchaseList().max(new SubQuery() {" + getLineSeparator(); msg = msg + " public void query(PurchaseCB subCB) {" + getLineSeparator(); @@ -754,7 +736,7 @@ msg = msg + " MemberCB cb = new MemberCB();" + getLineSeparator(); msg = msg - + " cb.specify().derivePurchaseList().max(new SubQuery() {" + + " cb.specify().derivedPurchaseList().max(new SubQuery() {" + getLineSeparator(); msg = msg + " public void query(PurchaseCB subCB) {" + getLineSeparator(); @@ -769,9 +751,117 @@ msg = msg + "[Specified Foreign Property]" + getLineSeparator() + foreignPropertyName + getLineSeparator(); msg = msg + "* * * * * * * * * */"; - throw new DeriveReferrerInvalidForeignSpecificationException(msg); + throw new DerivedReferrerInvalidForeignSpecificationException(msg); } + protected void throwScalarSelectInvalidForeignSpecificationException( + String foreignPropertyName) { + String msg = "Look! Read the message below." + getLineSeparator(); + msg = msg + + "/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *" + + getLineSeparator(); + msg = msg + + "You specified a foreign table column in spite of scalar select!" + + getLineSeparator(); + msg = msg + getLineSeparator(); + msg = msg + "[Advice]" + getLineSeparator(); + msg = msg + + "You should specified a local table column at condition-bean for scalar select." + + getLineSeparator(); + msg = msg + " For example:" + getLineSeparator(); + msg = msg + " " + getLineSeparator(); + msg = msg + " [Wrong]" + getLineSeparator(); + msg = msg + " /- - - - - - - - - - - - - - - - - - - - " + + getLineSeparator(); + msg = msg + + " memberBhv.scalarSelect(Integer.class).max(new ScalarSelect() {" + + getLineSeparator(); + msg = msg + " public void query(MemberCB cb) {" + + getLineSeparator(); + msg = msg + + " cb.specify().specifyMemberStatus().columnDisplayOrder(); // *No!" + + getLineSeparator(); + msg = msg + " }" + getLineSeparator(); + msg = msg + " });" + getLineSeparator(); + msg = msg + " - - - - - - - - - -/" + getLineSeparator(); + msg = msg + " " + getLineSeparator(); + msg = msg + " [Good!]" + getLineSeparator(); + msg = msg + " /- - - - - - - - - - - - - - - - - - - - " + + getLineSeparator(); + msg = msg + + " memberBhv.scalarSelect(Date.class).max(new ScalarSelect() {" + + getLineSeparator(); + msg = msg + " public void query(MemberCB cb) {" + + getLineSeparator(); + msg = msg + + " cb.specify().columnMemberBirthday(); // *Point!" + + getLineSeparator(); + msg = msg + " }" + getLineSeparator(); + msg = msg + " });" + getLineSeparator(); + msg = msg + " - - - - - - - - - -/" + getLineSeparator(); + msg = msg + getLineSeparator(); + msg = msg + "[Specified Foreign Property]" + getLineSeparator() + + foreignPropertyName + getLineSeparator(); + msg = msg + "* * * * * * * * * */"; + throw new ScalarSelectInvalidForeignSpecificationException(msg); + } + + protected void throwScalarSubQueryInvalidForeignSpecificationException( + String foreignPropertyName) { + String msg = "Look! Read the message below." + getLineSeparator(); + msg = msg + + "/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *" + + getLineSeparator(); + msg = msg + + "You specified a foreign table column in spite of derived-query!" + + getLineSeparator(); + msg = msg + getLineSeparator(); + msg = msg + "[Advice]" + getLineSeparator(); + msg = msg + + "You should specified a local table column at condition-bean for derived-query." + + getLineSeparator(); + msg = msg + " For example:" + getLineSeparator(); + msg = msg + " " + getLineSeparator(); + msg = msg + " [Wrong]" + getLineSeparator(); + msg = msg + " /- - - - - - - - - - - - - - - - - - - - " + + getLineSeparator(); + msg = msg + " MemberCB cb = new MemberCB();" + + getLineSeparator(); + msg = msg + + " cb.query().scalar_Equal().max(new SubQuery() {" + + getLineSeparator(); + msg = msg + " public void query(MemberCB subCB) {" + + getLineSeparator(); + msg = msg + + " subCB.specify().specifyMemberStatusName().columnDisplayOrder(); // *No!" + + getLineSeparator(); + msg = msg + " }" + getLineSeparator(); + msg = msg + " });" + getLineSeparator(); + msg = msg + " - - - - - - - - - -/" + getLineSeparator(); + msg = msg + " " + getLineSeparator(); + msg = msg + " [Good!]" + getLineSeparator(); + msg = msg + " /- - - - - - - - - - - - - - - - - - - - " + + getLineSeparator(); + msg = msg + " MemberCB cb = new MemberCB();" + + getLineSeparator(); + msg = msg + + " cb.query().scalar_Equal().max(new SubQuery() {" + + getLineSeparator(); + msg = msg + " public void query(MemberCB subCB) {" + + getLineSeparator(); + msg = msg + + " subCB.specify().columnMemberBirthday();// *Point!" + + getLineSeparator(); + msg = msg + " }" + getLineSeparator(); + msg = msg + " });" + getLineSeparator(); + msg = msg + " - - - - - - - - - -/" + getLineSeparator(); + msg = msg + getLineSeparator(); + msg = msg + "[Specified Foreign Property]" + getLineSeparator() + + foreignPropertyName + getLineSeparator(); + msg = msg + "* * * * * * * * * */"; + throw new ScalarSubQueryInvalidForeignSpecificationException(msg); + } + protected String getLineSeparator() { return SimpleSystemUtil.getLineSeparator(); } @@ -792,15 +882,33 @@ } } - public static class DeriveReferrerInvalidForeignSpecificationException + public static class DerivedReferrerInvalidForeignSpecificationException extends RuntimeException { private static final long serialVersionUID = 1L; - public DeriveReferrerInvalidForeignSpecificationException(String msg) { + public DerivedReferrerInvalidForeignSpecificationException(String msg) { super(msg); } } + public static class ScalarSubQueryInvalidForeignSpecificationException + extends RuntimeException { + private static final long serialVersionUID = 1L; + + public ScalarSubQueryInvalidForeignSpecificationException(String msg) { + super(msg); + } + } + + public static class ScalarSelectInvalidForeignSpecificationException extends + RuntimeException { + private static final long serialVersionUID = 1L; + + public ScalarSelectInvalidForeignSpecificationException(String msg) { + super(msg); + } + } + public static class RAFunction { protected ConditionBean _baseCB; @@ -815,6 +923,18 @@ _querySetupper = querySetupper; } + public void count(SubQuery subQuery, String aliasName) { + assertAliasName(aliasName); + _querySetupper.setup("count", subQuery, _localCQ, aliasName.trim()); + } + + public void countDistinct(SubQuery subQuery, + String aliasName) { + assertAliasName(aliasName); + _querySetupper.setup("count(distinct", subQuery, _localCQ, + aliasName.trim()); + } + public void max(SubQuery subQuery, String aliasName) { assertAliasName(aliasName); _querySetupper.setup("max", subQuery, _localCQ, aliasName.trim()); @@ -835,14 +955,9 @@ _querySetupper.setup("avg", subQuery, _localCQ, aliasName.trim()); } - public void count(SubQuery subQuery, String aliasName) { - assertAliasName(aliasName); - _querySetupper.setup("count", subQuery, _localCQ, aliasName.trim()); - } - protected void assertAliasName(String aliasName) { if (aliasName == null || aliasName.trim().length() == 0) { - throwDeriveReferrerInvalidAliasNameException(); + throwDerivedReferrerInvalidAliasNameException(); } DBMeta dbmeta = DBMetaInstanceHandler.findDBMeta(_baseCB .getTableDbName()); @@ -860,17 +975,17 @@ } } if (!existsSetterMethod) { - throwDeriveReferrerEntityPropertyNotFoundException(aliasName, + throwDerivedReferrerEntityPropertyNotFoundException(aliasName, dbmeta.getEntityType()); } } - protected void throwDeriveReferrerInvalidAliasNameException() { + protected void throwDerivedReferrerInvalidAliasNameException() { String msg = "Look! Read the message below." + getLineSeparator(); msg = msg + "/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *" + getLineSeparator(); - msg = msg + "The alias name for derive-referrer was Invalid!" + msg = msg + "The alias name for derived-referrer was Invalid!" + getLineSeparator(); msg = msg + getLineSeparator(); msg = msg + "[Advice]" + getLineSeparator(); @@ -915,17 +1030,17 @@ msg = msg + "[Local Table]" + getLineSeparator() + _localCQ.getTableDbName() + getLineSeparator(); msg = msg + "* * * * * * * * * */"; - throw new DeriveReferrerInvalidAliasNameException(msg); + throw new DerivedReferrerInvalidAliasNameException(msg); } - protected void throwDeriveReferrerEntityPropertyNotFoundException( + protected void throwDerivedReferrerEntityPropertyNotFoundException( String aliasName, Class entityType) { String msg = "Look! Read the message below." + getLineSeparator(); msg = msg + "/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *" + getLineSeparator(); msg = msg - + "A property for derive-referrer was Not Found in the entity!" + + "A property for derived-referrer was Not Found in the entity!" + getLineSeparator(); msg = msg + getLineSeparator(); msg = msg + "[Advice]" + getLineSeparator(); @@ -981,7 +1096,7 @@ msg = msg + "[Target Entity]" + getLineSeparator() + entityType + getLineSeparator(); msg = msg + "* * * * * * * * * */"; - throw new DeriveReferrerEntityPropertyNotFoundException(msg); + throw new DerivedReferrerEntityPropertyNotFoundException(msg); } protected String replaceString(String text, String fromText, @@ -999,20 +1114,20 @@ LOCAL_CQ cq, String aliasName); } - public static class DeriveReferrerInvalidAliasNameException extends + public static class DerivedReferrerInvalidAliasNameException extends RuntimeException { private static final long serialVersionUID = 1L; - public DeriveReferrerInvalidAliasNameException(String msg) { + public DerivedReferrerInvalidAliasNameException(String msg) { super(msg); } } - public static class DeriveReferrerEntityPropertyNotFoundException extends + public static class DerivedReferrerEntityPropertyNotFoundException extends RuntimeException { private static final long serialVersionUID = 1L; - public DeriveReferrerEntityPropertyNotFoundException(String msg) { + public DerivedReferrerEntityPropertyNotFoundException(String msg) { super(msg); } } @@ -1042,7 +1157,6 @@ protected void doSetupSelect(SsCall callback) { String foreignPropertyName = callback.qf().getForeignPropertyName(); assertSetupSelectBeforeUnion(foreignPropertyName); - limitSelect_Off(); String foreignTableAliasName = callback.qf().getRealAliasName(); String localRelationPath = localCQ().getRelationPath(); getSqlClause().registerSelectedSelectColumn(foreignTableAliasName, @@ -1164,19 +1278,27 @@ // ========= // Purpose Type // ============ - public void xsetupForDeriveReferrer() { - _forDeriveReferrer = true; + public void xsetupForDerivedReferrer() { // Very Internal + _forDerivedReferrer = true; } - public void xsetupForUnion() { + public void xsetupForScalarSelect() { // Very Internal + _forScalarSelect = true; + } + + public void xsetupForScalarSubQuery() { // Very Internal + _forScalarSubQuery = true; + } + + public void xsetupForUnion() { // Very Internal _forUnion = true; } - public void xsetupForExistsSubQuery() { + public void xsetupForExistsSubQuery() { // Very Internal _forExistsSubQuery = true; } - public void xsetupForInScopeSubQuery() { + public void xsetupForInScopeSubQuery() { // Very Internal _forInScopeSubQuery = true; } Modified: board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/cbean/AbstractConditionQuery.java =================================================================== --- board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/cbean/AbstractConditionQuery.java 2008-12-27 22:06:42 UTC (rev 1624) +++ board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/cbean/AbstractConditionQuery.java 2008-12-27 22:09:08 UTC (rev 1625) @@ -48,12 +48,14 @@ protected static final ConditionKey CK_PS = ConditionKey.CK_PREFIX_SEARCH; - protected static final ConditionKey CK_LS = ConditionKey.CK_LIKE_SEARCH; - protected static final ConditionKey CK_INS = ConditionKey.CK_IN_SCOPE; protected static final ConditionKey CK_NINS = ConditionKey.CK_NOT_IN_SCOPE; + protected static final ConditionKey CK_LS = ConditionKey.CK_LIKE_SEARCH; + + protected static final ConditionKey CK_NLS = ConditionKey.CK_NOT_LIKE_SEARCH; + protected static final ConditionKey CK_ISN = ConditionKey.CK_IS_NULL; protected static final ConditionKey CK_ISNN = ConditionKey.CK_IS_NOT_NULL; @@ -351,15 +353,7 @@ String msg = "The argument[unionQuery] should not be null."; throw new IllegalArgumentException(msg); } - reflectRelationOnUnionQuery(this, unionQuery);// Reflect Relation! - getSqlClause().copyIncludedSelectColumn(unionQuery.getSqlClause());// Reflect - // IncludedSelectColumn - // ! - if (getSqlClause().isFormatClauseEffective()) { - unionQuery.getSqlClause().makeFormatClauseEffective();// Reflect - // FormatClause - // ! - } + reflectRelationOnUnionQuery(this, unionQuery); // Reflect Relation! String key = (unionAll ? "unionAllQuery" : "unionQuery") + unionQueryMap.size(); unionQueryMap.put(key, unionQuery); @@ -416,22 +410,6 @@ // Register // ======== // ----------------------------------------------------- - // Include-As-Mine - // --------------- - /** - * Register included-select-column. - * - * @param aliasName Alias name. This should not contain comma. (NotNull) - * @param realColumnName Real column name. This should not contain comma. - * (NotNull) - * @deprecated Unsupported! - */ - protected void registerIncludedSelectColumn(String aliasName, - String realColumnName) { - throw new UnsupportedOperationException(); - } - - // ----------------------------------------------------- // Query // ----- protected void registerQuery(ConditionKey key, Object value, @@ -488,6 +466,13 @@ // ----------------------------------------------------- // LikeSearch Query // ---------------- + protected void regLSQ(ConditionKey key, String value, + ConditionValue cvalue, String colName, String capPropName, + String uncapPropName, LikeSearchOption option) { + registerLikeSearchQuery(key, value, cvalue, colName, capPropName, + uncapPropName, option); + } + @SuppressWarnings("deprecation") protected void registerLikeSearchQuery(ConditionKey key, String value, ConditionValue cvalue, String colName, String capPropName, @@ -700,25 +685,20 @@ assertObjectNotNull("InScopeSubQyery(" + columnName + ")", subQuery); inScopeOption = inScopeOption != null ? inScopeOption + " " : ""; String realColumnName = getInScopeSubQueryRealColumnName(columnName); + xincrementLocalSubQueryLevelIfNeeds(subQuery); String subQueryClause = getInScopeSubQuerySql(subQuery, relatedColumnName, propertyName); - String clause = null; - if (getSqlClause().isFormatClauseEffective()) { - String ln = getLineSeparator(); - int subQueryLevel = subQuery.getSubQueryLevel(); - String subQueryIdentity = propertyName + "[" + subQueryLevel + "]"; - String beginMark = getSqlClause().resolveSubQueryBeginMark( - subQueryIdentity) - + ln; - String endMark = getSqlClause().resolveSubQueryEndMark( - subQueryIdentity); - String endIndent = " "; - clause = realColumnName + " " + inScopeOption + "in (" + beginMark - + subQueryClause + ln + endIndent + ")" + endMark; - } else { - clause = realColumnName + " " + inScopeOption + "in (" - + subQueryClause + ")"; - } + String ln = getLineSeparator(); + int subQueryLevel = subQuery.getSubQueryLevel(); + String subQueryIdentity = propertyName + "[" + subQueryLevel + "]"; + String beginMark = getSqlClause().resolveSubQueryBeginMark( + subQueryIdentity) + + ln; + String endMark = getSqlClause() + .resolveSubQueryEndMark(subQueryIdentity); + String endIndent = " "; + String clause = realColumnName + " " + inScopeOption + "in (" + + beginMark + subQueryClause + ln + endIndent + ")" + endMark; registerWhereClause(clause); } @@ -728,22 +708,11 @@ protected String getInScopeSubQuerySql(ConditionQuery subQuery, String relatedColumnName, String propertyName) { - String selectClause = "select " - + getSqlClause().getLocalTableAliasName() + "." + String tableAliasName = getSqlClause().getLocalTableAliasName(); + String selectClause = "select " + tableAliasName + "." + relatedColumnName; - String fromWhereClause = subQuery.getSqlClause() - .getClauseFromWhereWithUnionTemplate(); - fromWhereClause = replaceString(fromWhereClause, ".conditionQuery.", - "." + getLocationBase(propertyName) + ".");// Very Important! - - // Replace template marks. These are very important! - fromWhereClause = replaceString(fromWhereClause, getSqlClause() - .getUnionSelectClauseMark(), selectClause); - fromWhereClause = replaceString(fromWhereClause, getSqlClause() - .getUnionWhereClauseMark(), ""); - fromWhereClause = replaceString(fromWhereClause, getSqlClause() - .getUnionWhereFirstConditionMark(), ""); - + String fromWhereClause = buildPlainSubQueryFromWhereClause(subQuery, + relatedColumnName, propertyName, selectClause, tableAliasName); return selectClause + " " + fromWhereClause; } @@ -769,24 +738,20 @@ assertObjectNotNull("ExistsSubQyery(" + columnName + ")", subQuery); existsOption = existsOption != null ? existsOption + " " : ""; String realColumnName = getExistsSubQueryRealColumnName(columnName); + xincrementLocalSubQueryLevelIfNeeds(subQuery); String subQueryClause = getExistsSubQuerySql(subQuery, realColumnName, relatedColumnName, propertyName); - String clause = null; - if (getSqlClause().isFormatClauseEffective()) { - String ln = getLineSeparator(); - int subQueryLevel = subQuery.getSubQueryLevel(); - String subQueryIdentity = propertyName + "[" + subQueryLevel + "]"; - String beginMark = getSqlClause().resolveSubQueryBeginMark( - subQueryIdentity) - + ln; - String endMark = getSqlClause().resolveSubQueryEndMark( - subQueryIdentity); - String endIndent = " "; - clause = existsOption + "exists (" + beginMark + subQueryClause - + ln + endIndent + ")" + endMark; - } else { - clause = existsOption + "exists (" + subQueryClause + ")"; - } + String ln = getLineSeparator(); + int subQueryLevel = subQuery.getSubQueryLevel(); + String subQueryIdentity = propertyName + "[" + subQueryLevel + "]"; + String beginMark = getSqlClause().resolveSubQueryBeginMark( + subQueryIdentity) + + ln; + String endMark = getSqlClause() + .resolveSubQueryEndMark(subQueryIdentity); + String endIndent = " "; + String clause = existsOption + "exists (" + beginMark + subQueryClause + + ln + endIndent + ")" + endMark; registerWhereClause(clause); } @@ -801,134 +766,116 @@ protected String getExistsSubQuerySql(ConditionQuery subQuery, String realColumnName, String relatedColumnName, String propertyName) { int subQueryLevel = subQuery.getSubQueryLevel(); - if (_subQueryLevel <= subQueryLevel) { - _subQueryLevel = subQueryLevel + 1; - } String tableAliasName = "dfsublocal_" + subQueryLevel; String selectClause = "select " + tableAliasName + "." + relatedColumnName; - String fromWhereClause = subQuery.getSqlClause() - .getClauseFromWhereWithWhereUnionTemplate(); - fromWhereClause = replaceString(fromWhereClause, "dflocal", - tableAliasName);// Very Important! - fromWhereClause = replaceString(fromWhereClause, ".conditionQuery.", - "." + getLocationBase(propertyName) + ".");// Very Important! - - String joinCondition = tableAliasName + "." + relatedColumnName + " = " - + realColumnName; - String firstConditionAfter = " and "; - if (getSqlClause().isFormatClauseEffective()) { - firstConditionAfter = getLineSeparator() + " and "; - } - - // Replace template marks. These are very important! - fromWhereClause = replaceString(fromWhereClause, getSqlClause() - .getWhereClauseMark(), "where " + joinCondition); - fromWhereClause = replaceString(fromWhereClause, getSqlClause() - .getWhereFirstConditionMark(), joinCondition - + firstConditionAfter); - fromWhereClause = replaceString(fromWhereClause, getSqlClause() - .getUnionSelectClauseMark(), selectClause); - fromWhereClause = replaceString(fromWhereClause, getSqlClause() - .getUnionWhereClauseMark(), "where " + joinCondition); - fromWhereClause = replaceString(fromWhereClause, getSqlClause() - .getUnionWhereFirstConditionMark(), joinCondition - + firstConditionAfter); - + String fromWhereClause = buildCorrelationSubQueryFromWhereClause( + subQuery, relatedColumnName, propertyName, selectClause, + tableAliasName, realColumnName); return selectClause + " " + fromWhereClause; } // [DBFlute-0.7.4] // ----------------------------------------------------- - // DeriveSubQuery - // -------------- - protected void registerDeriveSubQuery(String function, + // DerivedReferrerSubQuery + // ----------------------- + protected void registerDerivedReferrerSubQuery(String function, ConditionQuery subQuery, String columnName, String relatedColumnName, String propertyName, String aliasName) { - assertObjectNotNull("DeriveSubQuery(" + columnName + ")", subQuery); - final String realColumnName = getDeriveSubQueryRealColumnName(columnName); - final String subQueryClause = getDeriveSubQuerySql(function, subQuery, - realColumnName, relatedColumnName, propertyName, aliasName); - final String clause; - if (getSqlClause().isFormatClauseEffective()) { - final String ln = getLineSeparator(); - final int subQueryLevel = subQuery.getSubQueryLevel(); - final String subQueryIdentity = propertyName + "[" + subQueryLevel - + "]"; - final String beginMark = getSqlClause().resolveSubQueryBeginMark( - subQueryIdentity) - + ln; - final String endMark = getSqlClause().resolveSubQueryEndMark( - subQueryIdentity); - final String endIndent = " "; - clause = "(" + beginMark + subQueryClause + ln + endIndent - + ") as " + aliasName + endMark; - } else { - clause = "(" + subQueryClause + ") as " + aliasName; - } + assertObjectNotNull("DerivedReferrerSubQuery(function)", function); + assertObjectNotNull("DerivedReferrerSubQuery(" + columnName + ")", + subQuery); + String realColumnName = getDerivedReferrerSubQueryRealColumnName(columnName); + xincrementLocalSubQueryLevelIfNeeds(subQuery); + String subQueryClause = getDerivedReferrerSubQuerySql(function, + subQuery, realColumnName, relatedColumnName, propertyName, + aliasName); + String ln = getLineSeparator(); + int subQueryLevel = subQuery.getSubQueryLevel(); + String subQueryIdentity = propertyName + "[" + subQueryLevel + "]"; + String beginMark = getSqlClause().resolveSubQueryBeginMark( + subQueryIdentity) + + ln; + String endMark = getSqlClause() + .resolveSubQueryEndMark(subQueryIdentity); + String endIndent = " "; + String clause = "(" + beginMark + subQueryClause + ln + endIndent + + ") " + aliasName + endMark; getSqlClause().specifyDeriveSubQuery(aliasName, clause); } - protected String getDeriveSubQueryRealColumnName(String columnName) { + protected String getDerivedReferrerSubQueryRealColumnName(String columnName) { return getRealColumnName(columnName); } - protected String getDeriveSubQuerySql(String function, + protected String getDerivedReferrerSubQuerySql(String function, ConditionQuery subQuery, String realColumnName, String relatedColumnName, String propertyName, String aliasName) { - final int subQueryLevel = subQuery.getSubQueryLevel(); - if (_subQueryLevel <= subQueryLevel) { - _subQueryLevel = subQueryLevel + 1; - } - final String tableAliasName = "dfsublocal_" + subQueryLevel; - final String deriveColumnName = subQuery.getSqlClause() + int subQueryLevel = subQuery.getSubQueryLevel(); + String tableAliasName = "dfsublocal_" + subQueryLevel; + String deriveColumnName = subQuery.getSqlClause() .getSpecifiedColumnNameAsOne(); if (deriveColumnName == null || deriveColumnName.trim().length() == 0) { - throwDeriveReferrerInvalidColumnSpecificationException(function, + throwDerivedReferrerInvalidColumnSpecificationException(function, aliasName); } - assertDeriveReferrerColumnType(function, subQuery, deriveColumnName); - subQuery.getSqlClause().clearSpecifiedSelectColumn(); - final String selectClause = "select " + function + "(" + tableAliasName - + "." + deriveColumnName + ")"; - String fromWhereClause = subQuery.getSqlClause() - .getClauseFromWhereWithWhereUnionTemplate(); - fromWhereClause = replaceString(fromWhereClause, "dflocal", - tableAliasName);// Very Important! - fromWhereClause = replaceString(fromWhereClause, ".conditionQuery.", - "." + getLocationBase(propertyName) + ".");// Very Important! - - final String joinCondition = tableAliasName + "." + relatedColumnName - + " = " + realColumnName; - String firstConditionAfter = " and "; - if (getSqlClause().isFormatClauseEffective()) { - firstConditionAfter = getLineSeparator() + " and "; + assertDerivedReferrerColumnType(function, subQuery, deriveColumnName); + subQuery.getSqlClause().clearSpecifiedSelectColumn(); // specified + // columns + // disappear at + // this timing + String connect = xbuildFunctionConnector(function); + if (subQuery.getSqlClause().hasUnionQuery()) { + String ln = getLineSeparator(); + String subQueryIdentity = propertyName + "[" + subQueryLevel + + ":subquerymain]"; + String beginMark = getSqlClause().resolveSubQueryBeginMark( + subQueryIdentity) + + ln; + String endMark = getSqlClause().resolveSubQueryEndMark( + subQueryIdentity); + DBMeta dbmeta = DBMetaInstanceHandler.findDBMeta(subQuery + .getTableDbName()); + if (!dbmeta.hasPrimaryKey() || dbmeta.hasTwoOrMorePrimaryKeys()) { + String msg = "The derived-referrer is unsupported when no primary key or two-or-more primary keys:"; + msg = msg + " table=" + subQuery.getTableDbName(); + throw new UnsupportedOperationException(msg); + } + String primaryKeyName = dbmeta.getPrimaryUniqueInfo() + .getFirstColumn().getColumnDbName(); + String selectClause = "select " + tableAliasName + "." + + primaryKeyName + ", " + tableAliasName + "." + + relatedColumnName + ", " + tableAliasName + "." + + deriveColumnName; + String fromWhereClause = buildPlainSubQueryFromWhereClause( + subQuery, relatedColumnName, propertyName, selectClause, + tableAliasName); + String mainSql = selectClause + " " + fromWhereClause; + String joinCondition = "dfsubquerymain." + relatedColumnName + + " = " + realColumnName; + return "select " + function + connect + "dfsubquerymain." + + deriveColumnName + ")" + ln + " from (" + beginMark + + mainSql + ln + " ) dfsubquerymain" + endMark + ln + + " where " + joinCondition; + } else { + String selectClause = "select " + function + connect + + tableAliasName + "." + deriveColumnName + ")"; + String fromWhereClause = buildCorrelationSubQueryFromWhereClause( + subQuery, relatedColumnName, propertyName, selectClause, + tableAliasName, realColumnName); + return selectClause + " " + fromWhereClause; } - - // Replace template marks. These are very important! - fromWhereClause = replaceString(fromWhereClause, getSqlClause() - .getWhereClauseMark(), "where " + joinCondition); - fromWhereClause = replaceString(fromWhereClause, getSqlClause() - .getWhereFirstConditionMark(), joinCondition - + firstConditionAfter); - fromWhereClause = replaceString(fromWhereClause, getSqlClause() - .getUnionSelectClauseMark(), selectClause); - fromWhereClause = replaceString(fromWhereClause, getSqlClause() - .getUnionWhereClauseMark(), "where " + joinCondition); - fromWhereClause = replaceString(fromWhereClause, getSqlClause() - .getUnionWhereFirstConditionMark(), joinCondition - + firstConditionAfter); - - return selectClause + " " + fromWhereClause; } - protected void throwDeriveReferrerInvalidColumnSpecificationException( + protected void throwDerivedReferrerInvalidColumnSpecificationException( String function, String aliasName) { + String method = xconvertFunctionToMethod(function); String msg = "Look! Read the message below." + getLineSeparator(); msg = msg + "/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *" + getLineSeparator(); - msg = msg + "The specified the column for derive-referrer was Invalid!" + msg = msg + + "The specified the column for derived-referrer was Invalid!" + getLineSeparator(); msg = msg + getLineSeparator(); msg = msg + "[Advice]" + getLineSeparator(); @@ -941,7 +888,7 @@ msg = msg + " /- - - - - - - - - - - - - - - - - - - - " + getLineSeparator(); msg = msg + " MemberCB cb = new MemberCB();" + getLineSeparator(); - msg = msg + " cb.specify().derivePurchaseList()." + function + msg = msg + " cb.specify().derivePurchaseList()." + method + "(new SubQuery() {" + getLineSeparator(); msg = msg + " public void query(PurchaseCB subCB) {" + getLineSeparator(); @@ -955,7 +902,7 @@ msg = msg + " /- - - - - - - - - - - - - - - - - - - - " + getLineSeparator(); msg = msg + " MemberCB cb = new MemberCB();" + getLineSeparator(); - msg = msg + " cb.specify().derivePurchaseList()." + function + msg = msg + " cb.specify().derivePurchaseList()." + method + "(new SubQuery() {" + getLineSeparator(); msg = msg + " public void query(PurchaseCB subCB) {" + getLineSeparator(); @@ -973,7 +920,7 @@ msg = msg + " /- - - - - - - - - - - - - - - - - - - - " + getLineSeparator(); msg = msg + " MemberCB cb = new MemberCB();" + getLineSeparator(); - msg = msg + " cb.specify().derivePurchaseList()." + function + msg = msg + " cb.specify().derivePurchaseList()." + method + "(new SubQuery() {" + getLineSeparator(); msg = msg + " public void query(PurchaseCB subCB) {" + getLineSeparator(); @@ -988,19 +935,19 @@ msg = msg + "[Alias Name]" + getLineSeparator() + aliasName + getLineSeparator(); msg = msg + "* * * * * * * * * */"; - throw new DeriveReferrerInvalidColumnSpecificationException(msg); + throw new DerivedReferrerInvalidColumnSpecificationException(msg); } - public static class DeriveReferrerInvalidColumnSpecificationException + public static class DerivedReferrerInvalidColumnSpecificationException extends RuntimeException { private static final long serialVersionUID = 1L; - public DeriveReferrerInvalidColumnSpecificationException(String msg) { + public DerivedReferrerInvalidColumnSpecificationException(String msg) { super(msg); } } - protected void assertDeriveReferrerColumnType(String function, + protected void assertDerivedReferrerColumnType(String function, ConditionQuery subQuery, String deriveColumnName) { final DBMeta dbmeta = DBMetaInstanceHandler.findDBMeta(subQuery .getTableDbName()); @@ -1009,13 +956,13 @@ if ("sum".equalsIgnoreCase(function) || "avg".equalsIgnoreCase(function)) { if (!Number.class.isAssignableFrom(deriveColumnType)) { - throwDeriveReferrerUnmatchedColumnTypeException(function, + throwDerivedReferrerUnmatchedColumnTypeException(function, deriveColumnName, deriveColumnType); } } } - protected void throwDeriveReferrerUnmatchedColumnTypeException( + protected void throwDerivedReferrerUnmatchedColumnTypeException( String function, String deriveColumnName, Class deriveColumnType) { String msg = "Look! Read the message below." + getLineSeparator(); msg = msg @@ -1040,19 +987,366 @@ msg = msg + "[Derive Column]" + getLineSeparator() + deriveColumnName + "(" + deriveColumnType.getName() + ")" + getLineSeparator(); msg = msg + "* * * * * * * * * */"; - throw new DeriveReferrerUnmatchedColumnTypeException(msg); + throw new DerivedReferrerUnmatchedColumnTypeException(msg); } - public static class DeriveReferrerUnmatchedColumnTypeException extends + public static class DerivedReferrerUnmatchedColumnTypeException extends RuntimeException { private static final long serialVersionUID = 1L; - public DeriveReferrerUnmatchedColumnTypeException(String msg) { + public DerivedReferrerUnmatchedColumnTypeException(String msg) { super(msg); } } + // [DBFlute-0.8.8] // ----------------------------------------------------- + // ScalarSubQuery + // -------------- + protected void registerScalarSubQuery(String function, + ConditionQuery subQuery, String propertyName, String operand) { + assertObjectNotNull("ScalarSubQuery(" + propertyName + ")", subQuery); + + // Get the specified column before it disappears at sub-query making. + String deriveRealColumnName; + { + String deriveColumnName = subQuery.getSqlClause() + .getSpecifiedColumnNameAsOne(); + if (deriveColumnName == null + || deriveColumnName.trim().length() == 0) { + throwScalarSubQueryInvalidColumnSpecificationException(function); + } + deriveRealColumnName = getScalarSubQueryRealColumnName(deriveColumnName); + } + + xincrementLocalSubQueryLevelIfNeeds(subQuery); + String subQueryClause = getScalarSubQuerySql(function, subQuery, + propertyName); + String ln = getLineSeparator(); + int subQueryLevel = subQuery.getSubQueryLevel(); + String subQueryIdentity = propertyName + "[" + subQueryLevel + "]"; + String beginMark = getSqlClause().resolveSubQueryBeginMark( + subQueryIdentity) + + ln; + String endMark = getSqlClause() + .resolveSubQueryEndMark(subQueryIdentity); + String endIndent = " "; + String clause = deriveRealColumnName + " " + operand + " (" + beginMark + + subQueryClause + ln + endIndent + ") " + endMark; + registerWhereClause(clause); + } + + protected String getScalarSubQueryRealColumnName(String columnName) { + return getRealColumnName(columnName); + } + + protected String getScalarSubQuerySql(String function, + ConditionQuery subQuery, String propertyName) { + int subQueryLevel = subQuery.getSubQueryLevel(); + String tableAliasName = "dfsublocal_" + subQueryLevel; + String deriveColumnName = subQuery.getSqlClause() + .getSpecifiedColumnNameAsOne(); + if (deriveColumnName == null || deriveColumnName.trim().length() == 0) { + throwScalarSubQueryInvalidColumnSpecificationException(function); + } + assertScalarSubQueryColumnType(function, subQuery, deriveColumnName); + subQuery.getSqlClause().clearSpecifiedSelectColumn(); // specified + // columns + // disappear at + // this timing + DBMeta dbmeta = DBMetaInstanceHandler.findDBMeta(subQuery + .getTableDbName()); + if (!dbmeta.hasPrimaryKey() || dbmeta.hasTwoOrMorePrimaryKeys()) { + String msg = "The scalar-sub-query is unsupported when no primary key or two-or-more primary keys:"; + msg = msg + " table=" + subQuery.getTableDbName(); + throw new UnsupportedOperationException(msg); + } + String primaryKeyName = dbmeta.getPrimaryUniqueInfo().getFirstColumn() + .getColumnDbName(); + if (subQuery.getSqlClause().hasUnionQuery()) { + String ln = getLineSeparator(); + String subQueryIdentity = propertyName + "[" + subQueryLevel + + ":subquerymain]"; + String beginMark = getSqlClause().resolveSubQueryBeginMark( + subQueryIdentity) + + ln; + String endMark = getSqlClause().resolveSubQueryEndMark( + subQueryIdentity); + String selectClause = "select " + tableAliasName + "." + + primaryKeyName + ", " + tableAliasName + "." + + deriveColumnName; + String fromWhereClause = buildPlainSubQueryFromWhereClause( + subQuery, primaryKeyName, propertyName, selectClause, + tableAliasName); + String mainSql = selectClause + " " + fromWhereClause; + return "select " + function + "(dfsubquerymain." + deriveColumnName + + ")" + ln + " from (" + beginMark + mainSql + ln + + " ) dfsubquerymain" + endMark; + } else { + String selectClause = "select " + function + "(" + tableAliasName + + "." + deriveColumnName + ")"; + String fromWhereClause = buildPlainSubQueryFromWhereClause( + subQuery, primaryKeyName, propertyName, selectClause, + tableAliasName); + return selectClause + " " + fromWhereClause; + } + } + + protected void throwScalarSubQueryInvalidColumnSpecificationException( + String function) { + String msg = "Look! Read the message below." + getLineSeparator(); + msg = msg + + "/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *" + + getLineSeparator(); + msg = msg + + "The specified the column for derived-referrer was Invalid!" + + getLineSeparator(); + msg = msg + getLineSeparator(); + msg = msg + "[Advice]" + getLineSeparator(); + msg = msg + + " You should call specify().column[TargetColumn]() only once." + + getLineSeparator(); + msg = msg + " For example:" + getLineSeparator(); + msg = msg + " " + getLineSeparator(); + msg = msg + " [Wrong]" + getLineSeparator(); + msg = msg + " /- - - - - - - - - - - - - - - - - - - - " + + getLineSeparator(); + msg = msg + " MemberCB cb = new MemberCB();" + getLineSeparator(); + msg = msg + " cb.query().scalar_Equal()." + function + + "(new SubQuery() {" + getLineSeparator(); + msg = msg + " public void query(MemberCB subCB) {" + + getLineSeparator(); + msg = msg + " // *No! It's empty!" + getLineSeparator(); + msg = msg + " }" + getLineSeparator(); + msg = msg + " });" + getLineSeparator(); + msg = msg + " - - - - - - - - - -/" + getLineSeparator(); + msg = msg + " " + getLineSeparator(); + msg = msg + " [Wrong]" + getLineSeparator(); + msg = msg + " /- - - - - - - - - - - - - - - - - - - - " + + getLineSeparator(); + msg = msg + " MemberCB cb = new MemberCB();" + getLineSeparator(); + msg = msg + " cb.query().scalar_Equal()." + function + + "(new SubQuery() {" + getLineSeparator(); + msg = msg + " public void query(MemberCB subCB) {" + + getLineSeparator(); + msg = msg + " subCB.specify().columnMemberBirthday();" + + getLineSeparator(); + msg = msg + + " subCB.specify().columnMemberName(); // *No! It's duplicated!" + + getLineSeparator(); + msg = msg + " }" + getLineSeparator(); + msg = msg + " });" + getLineSeparator(); + msg = msg + " - - - - - - - - - -/" + getLineSeparator(); + msg = msg + " " + getLineSeparator(); + msg = msg + " [Good!]" + getLineSeparator(); + msg = msg + " /- - - - - - - - - - - - - - - - - - - - " + + getLineSeparator(); + msg = msg + " MemberCB cb = new MemberCB();" + getLineSeparator(); + msg = msg + " cb.query().scalar_Equal()." + function + + "(new SubQuery() {" + getLineSeparator(); + msg = msg + " public void query(MemberCB subCB) {" + + getLineSeparator(); + msg = msg + + " subCB.specify().columnPurchaseDatetime(); // *Point!" + + getLineSeparator(); + msg = msg + " }" + getLineSeparator(); + msg = msg + " });" + getLineSeparator(); + msg = msg + " - - - - - - - - - -/" + getLineSeparator(); + msg = msg + "* * * * * * * * * */"; + throw new ScalarSubQueryInvalidColumnSpecificationException(msg); + } + + public static class ScalarSubQueryInvalidColumnSpecificationException + extends RuntimeException { + private static final long serialVersionUID = 1L; + + public ScalarSubQueryInvalidColumnSpecificationException(String msg) { + super(msg); + } + } + + protected void assertScalarSubQueryColumnType(String function, + ConditionQuery subQuery, String deriveColumnName) { + final DBMeta dbmeta = DBMetaInstanceHandler.findDBMeta(subQuery + .getTableDbName()); + final Class deriveColumnType = dbmeta.findColumnInfo( + deriveColumnName).getPropertyType(); + if ("sum".equalsIgnoreCase(function) + || "avg".equalsIgnoreCase(function)) { + if (!Number.class.isAssignableFrom(deriveColumnType)) { + throwScalarSubQueryUnmatchedColumnTypeException(function, + deriveColumnName, deriveColumnType); + } + } + } + + protected void throwScalarSubQueryUnmatchedColumnTypeException( + String function, String deriveColumnName, Class deriveColumnType) { + String msg = "Look! Read the message below." + getLineSeparator(); + msg = msg + + "/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *" + + getLineSeparator(); + msg = msg + + "The type of the specified the column unmatched with the function!" + + getLineSeparator(); + msg = msg + getLineSeparator(); + msg = msg + "[Advice]" + getLineSeparator(); + msg = msg + "You should confirm the list as follow:" + + getLineSeparator(); + msg = msg + " max() : String, Number, Date" + getLineSeparator(); + msg = msg + " min() : String, Number, Date" + getLineSeparator(); + msg = msg + " sum() : Number" + getLineSeparator(); + msg = msg + " avg() : Number" + getLineSeparator(); + msg = msg + getLineSeparator(); + msg = msg + "[Function]" + getLineSeparator() + function + + getLineSeparator(); + msg = msg + getLineSeparator(); + msg = msg + "[Derive Column]" + getLineSeparator() + deriveColumnName + + "(" + deriveColumnType.getName() + ")" + getLineSeparator(); + msg = msg + "* * * * * * * * * */"; + throw new ScalarSubQueryUnmatchedColumnTypeException(msg); + } + + public static class ScalarSubQueryUnmatchedColumnTypeException extends + RuntimeException { + private static final long serialVersionUID = 1L; + + public ScalarSubQueryUnmatchedColumnTypeException(String msg) { + super(msg); + } + } + + public static class SSQFunction { + protected SSQSetupper _setupper; + + public SSQFunction(SSQSetupper setupper) { + _setupper = setupper; + } + + public void max(SubQuery subQuery) { + _setupper.setup("max", subQuery); + } + + public void min(SubQuery subQuery) { + _setupper.setup("min", subQuery); + } + + public void sum(SubQuery subQuery) { + _setupper.setup("sum", subQuery); + } + + public void avg(SubQuery subQuery) { + _setupper.setup("avg", subQuery); + } + } + + protected static interface SSQSetupper { + public void setup(String function, SubQuery subQuery); + } + + // ----------------------------------------------------- + // SubQuery Common + // --------------- + protected String buildPlainSubQueryFromWhereClause(ConditionQuery subQuery, + String relatedColumnName, String propertyName, String selectClause, + String tableAliasName) { + String fromWhereClause = subQuery.getSqlClause() + .getClauseFromWhereWithUnionTemplate(); + + // Replace the alias names for local table with alias name of sub-query + // unique. + // However when it's inScope this replacement is unnecessary so comment + // out here. + // (Override base alias name at sub-query on SQL) + // So if the argument 'tableAliasName' is not null, replace it. + if (tableAliasName != null) { + fromWhereClause = replaceString(fromWhereClause, "dflocal", + tableAliasName); + } + + // Resolve the location path for the condition-query of sub-query. + fromWhereClause = replaceString(fromWhereClause, ".conditionQuery.", + "." + getLocationBase(propertyName) + "."); + + // Replace template marks. These are very important! + fromWhereClause = replaceString(fromWhereClause, getSqlClause() + .getUnionSelectClauseMark(), selectClause); + fromWhereClause = replaceString(fromWhereClause, getSqlClause() + .getUnionWhereClauseMark(), ""); + fromWhereClause = replaceString(fromWhereClause, getSqlClause() + .getUnionWhereFirstConditionMark(), ""); + return fromWhereClause; + } + + protected String buildCorrelationSubQueryFromWhereClause( + ConditionQuery subQuery, String relatedColumnName, + String propertyName, String selectClause, String tableAliasName, + String realColumnName) { + String fromWhereClause = subQuery.getSqlClause() + .getClauseFromWhereWithWhereUnionTemplate(); + + // Replace the alias names for local table with alias name of sub-query + // unique. + fromWhereClause = replaceString(fromWhereClause, "dflocal", + tableAliasName); + + // Resolve the location path for the condition-query of sub-query. + fromWhereClause = replaceString(fromWhereClause, ".conditionQuery.", + "." + getLocationBase(propertyName) + "."); + + String joinCondition = tableAliasName + "." + relatedColumnName + " = " + + realColumnName; + String firstConditionAfter = getLineSeparator() + " and "; + + // Replace template marks. These are very important! + fromWhereClause = replaceString(fromWhereClause, getSqlClause() + .getWhereClauseMark(), "where " + joinCondition); + fromWhereClause = replaceString(fromWhereClause, getSqlClause() + .getWhereFirstConditionMark(), joinCondition + + firstConditionAfter); + fromWhereClause = replaceString(fromWhereClause, getSqlClause() + .getUnionSelectClauseMark(), selectClause); + fromWhereClause = replaceString(fromWhereClause, getSqlClause() + .getUnionWhereClauseMark(), "where " + joinCondition); + fromWhereClause = replaceString(fromWhereClause, getSqlClause() + .getUnionWhereFirstConditionMark(), joinCondition + + firstConditionAfter); + return fromWhereClause; + } + + protected void xincrementLocalSubQueryLevelIfNeeds(ConditionQuery subQuery) { // Very + // Internal + int subQueryLevel = subQuery.getSubQueryLevel(); + if (_subQueryLevel <= subQueryLevel) { + _subQueryLevel = subQueryLevel + 1; + } + } + + protected String xbuildFunctionConnector(String function) { + if (function != null && function.endsWith("(distinct")) { // For example + // 'count(distinct' + return " "; + } else { + return "("; + } + } + + protected String xconvertFunctionToMethod(String function) { + if (function != null && function.contains("(")) { // For example + // 'count(distinct' + int index = function.indexOf("("); + String front = function.substring(0, index); + if (function.length() > front.length() + "(".length()) { + String rear = function.substring(index + "(".length()); + function = front + initCap(rear); + } else { + function = front; + } + } + return function; + } + + // ----------------------------------------------------- // Where Clause // ------------ protected void setupConditionValueAndRegisterWhereClause(ConditionKey key, @@ -1276,14 +1570,16 @@ // ========= // Fixed Condition // =============== - protected String prepareFixedCondition(String fixedCondition, - String localAliasName, String foreignAliasName) { + protected String ppFxCd(String fixedCondition, String localAliasName, + String foreignAliasName) { // prepareFixedCondition fixedCondition = replaceString(fixedCondition, "$$alias$$", foreignAliasName); fixedCondition = replaceString(fixedCondition, "$$foreignAlias$$", foreignAliasName); fixedCondition = replaceString(fixedCondition, "$$localAlias$$", localAliasName); + fixedCondition = replaceString(fixedCondition, "$$locationBase$$.", + "dto." + getLocationBase()); return fixedCondition; } @@ -1515,7 +1811,7 @@ return newList; } - public void doNss(NssCall callback) {// Very Internal + public void doNss(NssCall callback) { // Very Internal String foreignPropertyName = callback.qf().getForeignPropertyName(); String foreignTableAliasName = callback.qf().getRealAliasName(); getSqlClause().registerSelectedSelectColumn(foreignTableAliasName, @@ -1524,7 +1820,7 @@ callback.qf().getRelationPath(), foreignPropertyName); } - public static interface NssCall {// Very Internal + public static interface NssCall { // Very Internal public ConditionQuery qf(); } Modified: board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/cbean/ConditionBean.java =================================================================== --- board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/cbean/ConditionBean.java 2008-12-27 22:06:42 UTC (rev 1624) +++ board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/cbean/ConditionBean.java 2008-12-27 22:09:08 UTC (rev 1625) @@ -1,5 +1,7 @@ package jp.sf.pal.board.db.allcommon.cbean; +import java.util.Map; + import jp.sf.pal.board.db.allcommon.cbean.sqlclause.SqlClause; import jp.sf.pal.board.db.allcommon.jdbc.StatementConfig; @@ -11,28 +13,6 @@ public interface ConditionBean extends PagingBean { //========================================================================== - // =========== - // Definition - // ========== - /** Map-string map-mark. */ - public static final String MAP_STRING_MAP_MARK = "map:"; - - /** Map-string list-mark. */ - public static final String MAP_STRING_LIST_MARK = "list:"; - - /** Map-string start-brace. */ - public static final String MAP_STRING_START_BRACE = "@{"; - - /** Map-string end-brace. */ - public static final String MAP_STRING_END_BRACE = "@}"; - - /** Map-string delimiter. */ - public static final String MAP_STRING_DELIMITER = "@;"; - - /** Map-string equal. */ - public static final String MAP_STRING_EQUAL = "@="; - - //========================================================================== // ========= // Table Name // ========== @@ -70,8 +50,7 @@ * * @param primaryKeyMap Primary-key map. (NotNull and NotEmpty) */ - public void acceptPrimaryKeyMap( - java.util.Map primaryKeyMap); + public void acceptPrimaryKeyMap(Map primaryKeyMap); /** * Accept primary-key map-string. Delimiter is at-mark and semicolon. @@ -105,14 +84,6 @@ // Query // ===== /** - * Get condition-query as interface. - * - * @return Instance of query as interface. (NotNull) - * @deprecated - */ - public ConditionQuery getConditionQueryAsInterface(); - - /** * Get the conditionQuery of the local table as interface. * * @return The conditionQuery of the local table as interface. (NotNull) @@ -131,32 +102,6 @@ public boolean hasUnionQueryOrUnionAllQuery(); //========================================================================== - // ========= - // Limit Select - // ============ - /** - * Limit select PK only. This is OLD style. You can do the same thing by - * specify(). - * - * @return this. (NotNull) - */ - public ConditionBean limitSelect_PKOnly(); - - /** - * Limit select off. - * - * @return this. (NotNull) - */ - public ConditionBean limitSelect_Off(); - - /** - * Is limit-select PK only? - * - * @return Determination. - */ - public boolean isLimitSelect_PKOnly(); - - //========================================================================== // =========== // Lock Setting // ============ Modified: board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/cbean/ConditionBeanContext.java =================================================================== --- board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/cbean/ConditionBeanContext.java 2008-12-27 22:06:42 UTC (rev 1624) +++ board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/cbean/ConditionBeanContext.java 2008-12-27 22:09:08 UTC (rev 1625) @@ -1,10 +1,6 @@ package jp.sf.pal.board.db.allcommon.cbean; -import java.util.Collections; -import java.util.LinkedHashMap; -import java.util.Map; - -import jp.sf.pal.board.db.allcommon.DBFluteConfig; +import jp.sf.pal.board.db.allcommon.DBDef; import jp.sf.pal.board.db.allcommon.cbean.sqlclause.SqlClause; import jp.sf.pal.board.db.allcommon.cbean.sqlclause.SqlClauseDb2; import jp.sf.pal.board.db.allcommon.cbean.sqlclause.SqlClauseDerby; @@ -78,11 +74,35 @@ //========================================================================== // ========= - // Initialize against the ClassLoader Headache - // =========================================== + // Type Determination + // ================== + /** + * Is the argument condition-bean? + * + * @param dtoInstance DTO instance. + * @return Determination. + */ + public static boolean isTheArgumentConditionBean(final Object dtoInstance) { + return dtoInstance instanceof ConditionBean; + } + + /** + * Is the type condition-bean? + * + * @param dtoClass DtoClass. + * @return Determination. + */ + public static boolean isTheTypeConditionBean(final Class dtoClass) { + return ConditionBean.class.isAssignableFrom(dtoClass); + } + + //========================================================================== + // ========= + // Cool Classes + // ============ @SuppressWarnings("unused") - public static void initialize() { - boolean debugEnabled = _log.isDebugEnabled(); + public static void loadCoolClasses() { + boolean debugEnabled = false; // If you watch the log, set this true. // Against the ClassLoader Headache! final StringBuilder sb = new StringBuilder(); { @@ -119,120 +139,6 @@ //========================================================================== // ========= - // Type Determination - // ================== - /** - * Is the argument condition-bean? - * - * @param dtoInstance DTO instance. - * @return Determination. - */ - public static boolean isTheArgumentConditionBean(final Object dtoInstance) { - if (dtoInstance instanceof ConditionBean) { - return true; - } else { - return false; - } - } - - /** - * Is the type condition-bean? - * - * @param dtoClass DtoClass. - * @return Determination. - */ - public static boolean isTheTypeConditionBean(final Class dtoClass) { - if (ConditionBean.class.isAssignableFrom(dtoClass)) { - return true; - } else { - return false; - } - } - - //========================================================================== - // ========= - // Product Name - // ============ - public static final String DB_NAME_DERBY = "derby"; - - public static final String DB_NAME_H2 = "h2"; - - public static final String DB_NAME_ORACLE = "oracle"; - - public static final String DB_NAME_MYSQL = "mysql"; - - public static final String DB_NAME_POSTGRESQL = "postgresql"; - - public static final String DB_NAME_FIREBIRD = "firebird"; - - public static final String DB_NAME_MSSQL = "mssql"; - - public static final String DB_NAME_SYBASE = "sybase"; - - public static final String DB_NAME_DB2 = "db2"; - - protected static final Map _driverHintDatabaseProductNameMap; - static { - final Map tmpMap = Collections - .synchronizedMap(new LinkedHashMap()); - 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 keySet = _driverHintDatabaseProductNameMap - .keySet(); - for (final java.util.Iterator ite = keySet.iterator(); ite - .hasNext();) { - final String driverHint = (String) ite.next(); - if (driverClassName.indexOf(driverHint) >= 0) { - final String databaseProductName = (String) _driverHintDatabaseProductNameMap - .get(driverHint); - setDatabaseProductName(databaseProductName); - return true; - } - } - return false; - } - - /** The database product name. */ - private static String _databaseProductName; - - /** - * Get database product name. - * - * @return Database product name. - */ - public static String getDatabaseProductName() { - return _databaseProductName; - } - - /** - * Set database product name. - * - * @param name Database product name. (NotNull) - */ - public static void setDatabaseProductName(String name) { - if (_databaseProductName != null) { - String msg = "Already set up: current=" + _databaseProductName - + " your=" + name; - throw new IllegalStateException(msg); - } - _databaseProductName = name; - } - - //========================================================================== - // ========= // SqlClause Creator // ================= /** @@ -244,9 +150,6 @@ public static SqlClause createSqlClause(ConditionBean cb) { final String tableSqlName = cb.getTableSqlName(); final SqlClause sqlClause = createSqlClause(tableSqlName); - if (DBFluteConfig.getInstance().isConditionBeanFormatSql()) { - sqlClause.makeFormatClauseEffective(); - } return sqlClause; } @@ -257,27 +160,22 @@ * @return SQL-clause. (NotNull) */ public static SqlClause createSqlClause(String tableDbName) { - final String databaseProductName = getDatabaseProductName(); - if (databaseProductName == null) { - return new SqlClauseH2(tableDbName); - } - final String name = databaseProductName.toLowerCase(); - if (name.equalsIgnoreCase(DB_NAME_DERBY)) { - return new SqlClauseDerby(tableDbName); - } else if (name.equalsIgnoreCase(DB_NAME_H2)) { - return new SqlClauseH2(tableDbName); - } else if (name.equalsIgnoreCase(DB_NAME_ORACLE)) { - return new SqlClauseOracle(tableDbName); - } else if (name.equalsIgnoreCase(DB_NAME_FIREBIRD)) { - return new SqlClauseFirebird(tableDbName); - } else if (name.equalsIgnoreCase(DB_NAME_MYSQL)) { + if (DBDef.isCurrentDef(DBDef.MySQL)) { return new SqlClauseMySql(tableDbName); - } else if (name.equalsIgnoreCase(DB_NAME_POSTGRESQL)) { + } else if (DBDef.isCurrentDef(DBDef.PostgreSQL)) { return new SqlClausePostgreSql(tableDbName); - } else if (name.equalsIgnoreCase(DB_NAME_MSSQL)) { - return new SqlClauseSqlServer(tableDbName); - } else if (name.equalsIgnoreCase(DB_NAME_DB2)) { + } else if (DBDef.isCurrentDef(DBDef.Oracle)) { + return new SqlClauseOracle(tableDbName); + } else if (DBDef.isCurrentDef(DBDef.DB2)) { return new SqlClauseDb2(tableDbName); + } else if (DBDef.isCurrentDef(DBDef.SQLServer)) { + return new SqlClauseSqlServer(tableDbName); + } else if (DBDef.isCurrentDef(DBDef.FireBird)) { + return new SqlClauseFirebird(tableDbName); + } else if (DBDef.isCurrentDef(DBDef.H2)) { + return new SqlClauseH2(tableDbName); + } else if (DBDef.isCurrentDef(DBDef.Derby)) { + return new SqlClauseDerby(tableDbName); } else { return new SqlClauseH2(tableDbName); } @@ -362,12 +260,7 @@ // Display SQL // =========== public static String convertConditionBean2DisplaySql(ConditionBean cb) { - final String twoWaySql; - if (cb.isLimitSelect_PKOnly()) { - twoWaySql = cb.getSqlClause().getClausePKOnly(); - } else { - twoWaySql = cb.getSqlClause().getClause(); - } + final String twoWaySql = cb.getSqlClause().getClause(); return InternalSqlParser.convertTwoWaySql2DisplaySql(twoWaySql, cb); } @@ -390,31 +283,8 @@ errorCode); } - // [DBFlute-0.7.8] //========================================================================== // ========= - // Database Type - // ============= - /** - * Is the database Oracle? - * - * @return Is the database Oracle? - */ - public static boolean isOracle() { - return createSqlClause("dummy") instanceof SqlClauseOracle; - } - - /** - * Is the database PostgreSQL? - * - * @return Is the database PostgreSQL? - */ - public static boolean isPostgreSql() { - return createSqlClause("dummy") instanceof SqlClausePostgreSql; - } - - //========================================================================== - // ========= // Helper // ====== /** Modified: board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/cbean/ConditionQuery.java =================================================================== --- board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/cbean/ConditionQuery.java 2008-12-27 22:06:42 UTC (rev 1624) +++ board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/cbean/ConditionQuery.java 2008-12-27 22:09:08 UTC (rev 1625) @@ -8,7 +8,6 @@ * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public interface ConditionQuery { //========================================================================== Added: board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/cbean/ScalarQuery.java =================================================================== --- board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/cbean/ScalarQuery.java (rev 0) +++ board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/cbean/ScalarQuery.java 2008-12-27 22:09:08 UTC (rev 1625) @@ -0,0 +1,5 @@ +package jp.sf.pal.board.db.allcommon.cbean; + +public interface ScalarQuery { + public void query(CB cb); +} Property changes on: board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/cbean/ScalarQuery.java ___________________________________________________________________ Name: svn:eol-style + native Deleted: board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/cbean/SimpleOrderByBean.java =================================================================== --- board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/cbean/SimpleOrderByBean.java 2008-12-27 22:06:42 UTC (rev 1624) +++ board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/cbean/SimpleOrderByBean.java 2008-12-27 22:09:08 UTC (rev 1625) @@ -1,165 +0,0 @@ -package jp.sf.pal.board.db.allcommon.cbean; - -import jp.sf.pal.board.db.allcommon.cbean.sqlclause.OrderByClause; -import jp.sf.pal.board.db.allcommon.cbean.sqlclause.SqlClause; - -/** - * @deprecated - */ -public class SimpleOrderByBean implements OrderByBean { - - //========================================================================== - // ========= - // Attribute - // ========= - /** SQL clause instance. */ - protected final SqlClause _sqlClause; - { - _sqlClause = ConditionBeanContext.createSqlClause("Dummy"); - } - - //========================================================================== - // ========= - // Constructor - // =========== - /** - * Constructor. - */ - public SimpleOrderByBean() { - } - - //========================================================================== - // ========= - // SqlClause - // ========= - /** - * Get sql-clause. - * - * @return Sql clause. (NotNull) - */ - protected SqlClause getSqlClause() { - return _sqlClause; - } - - //========================================================================== - // ========= - // Select Resource - // =============== - /** - * Check safety result. - * - * @param safetyMaxResultSize Safety max result size. (If zero or minus, - * ignore checking) - */ - public void checkSafetyResult(int safetyMaxResultSize) { - throw new UnsupportedOperationException(); - } - - //========================================================================== - // ========= - // OrderBy - // ======= - /** - * The implementation. - * - * @return Sql component of order-by clause. (NotNull) - */ - public OrderByClause getSqlComponentOfOrderByClause() { - return getSqlClause().getSqlComponentOfOrderByClause(); - } - - /** - * The implementation. - * - * @return Order-by clause. (NotNull) - */ - public String getOrderByClause() { - return getSqlClause().getOrderByClause(); - } - - /** - * The implementation. - * - * @return this. (NotNull) - */ - public OrderByBean clearOrderBy() { - getSqlClause().clearOrderBy(); - return this; - } - - /** - * The implementation. - * - * @return this. (NotNull) - */ - public OrderByBean ignoreOrderBy() { - getSqlClause().ignoreOrderBy(); - return this; - } - - /** - * The implementation. - * - * @return this. (NotNull) - */ - public OrderByBean makeOrderByEffective() { - getSqlClause().makeOrderByEffective(); - return this; - } - - /** - * Register order-by-asc. - * - * @param orderByProperty Order-by-property. - * 'aliasName.columnName/aliasName.columnName/...' (NotNull) - * @return this. (NotNull) - * @deprecated - */ - public OrderByBean registerOrderByAsc(String orderByProperty) { - getSqlClause().registerOrderBy(orderByProperty, orderByProperty, true); - return this; - } - - /** - * Register order-by-desc. - * - * @param orderByProperty Order-by-property. - * 'aliasName.columnName/aliasName.columnName/...' (NotNull) - * @return this. (NotNull) - * @deprecated - */ - public OrderByBean registerOrderByDesc(String orderByProperty) { - getSqlClause().registerOrderBy(orderByProperty, orderByProperty, false); - return this; - } - - /** - * Reverse order-by or Override order-by asc. - * - * @param orderByProperty Order-by-property. - * 'aliasName.columnName/aliasName.columnName/...' (NotNull) - * @return this. (NotNull) - * @deprecated - */ - public OrderByBean reverseOrderBy_Or_OverrideOrderByAsc( - String orderByProperty) { - getSqlClause().reverseOrderBy_Or_OverrideOrderBy(orderByProperty, - orderByProperty, true); - return this; - } - - /** - * Reverse order-by or Override order-by desc. - * - * @param orderByProperty Order-by-property. - * 'aliasName.columnName/aliasName.columnName/...' (NotNull) - * @return this. (NotNull) - * @deprecated - */ - public OrderByBean reverseOrderBy_Or_OverrideOrderByDesc( - String orderByProperty) { - getSqlClause().reverseOrderBy_Or_OverrideOrderBy(orderByProperty, - orderByProperty, false); - return this; - } -} Modified: board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/cbean/ckey/ConditionKey.java =================================================================== --- board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/cbean/ckey/ConditionKey.java 2008-12-27 22:06:42 UTC (rev 1624) +++ board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/cbean/ckey/ConditionKey.java 2008-12-27 22:09:08 UTC (rev 1625) @@ -12,6 +12,10 @@ */ public abstract class ConditionKey { + //========================================================================== + // ========= + // Definition + // ========== /** Mark of replaced value. */ public static final String MARK_OF_REPLACED_VALUE = "ReplacedValue"; @@ -36,15 +40,18 @@ /** The condition key of prefixSearch. */ public static final ConditionKey CK_PREFIX_SEARCH = new ConditionKeyPrefixSearch(); - /** The condition key of likeSearch. */ - public static final ConditionKey CK_LIKE_SEARCH = new ConditionKeyLikeSearch(); - /** The condition key of inScope. */ public static final ConditionKey CK_IN_SCOPE = new ConditionKeyInScope(); /** The condition key of notInScope. */ public static final ConditionKey CK_NOT_IN_SCOPE = new ConditionKeyNotInScope(); + /** The condition key of likeSearch. */ + public static final ConditionKey CK_LIKE_SEARCH = new ConditionKeyLikeSearch(); + + /** The condition key of notLikeSearch. */ + public static final ConditionKey CK_NOT_LIKE_SEARCH = new ConditionKeyNotLikeSearch(); + /** The condition key of isNull. */ public static final ConditionKey CK_IS_NULL = new ConditionKeyIsNull(); @@ -54,31 +61,21 @@ /** Dummy-object for IsNull and IsNotNull and so on... */ protected static final Object DUMMY_OBJECT = new Object(); + //========================================================================== + // ========= + // Attribute + // ========= /** Condition-key. */ protected String _conditionKey; /** Operand. */ protected String _operand; + //========================================================================== + // ========= + // Validation + // ========== /** - * Get condition-key. - * - * @return Condition-key. - */ - public String getConditionKey() { - return _conditionKey; - } - - /** - * Get operand. - * - * @return Operand. - */ - public String getOperand() { - return _operand; - } - - /** * Is valid registration? * * @param conditionValue Condition value. (NotNull) @@ -89,6 +86,10 @@ abstract public boolean isValidRegistration(ConditionValue conditionValue, Object value, String callerName); + //========================================================================== + // ========= + // Where Clause + // ============ /** * Add where clause. * @@ -149,6 +150,10 @@ abstract protected void doAddWhereClause(List conditionList, String columnName, ConditionValue value, ConditionOption option); + //========================================================================== + // ========= + // Condition Value + // =============== /** * Setup condition value. * @@ -210,6 +215,10 @@ ConditionValue conditionValue, Object value, String location, ConditionOption option); + //========================================================================== + // ========= + // Bind Clause + // =========== /** * Build bind clause. (for s2dao) * @@ -269,6 +278,10 @@ return "%"; } + //========================================================================== + // ========= + // Basic Override + // ============== /** * The override. Returns hash-code of this condition-key string. * @@ -304,4 +317,26 @@ return "ConditionKey: " + getConditionKey() + " " + getOperand() + " wild-card=[" + getWildCard() + "]"; } + + //========================================================================== + // ========= + // Accessor + // ======== + /** + * Get condition-key. + * + * @return Condition-key. + */ + public String getConditionKey() { + return _conditionKey; + } + + /** + * Get operand. + * + * @return Operand. + */ + public String getOperand() { + return _operand; + } } Added: board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/cbean/ckey/ConditionKeyNotLikeSearch.java =================================================================== --- board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/cbean/ckey/ConditionKeyNotLikeSearch.java (rev 0) +++ board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/cbean/ckey/ConditionKeyNotLikeSearch.java 2008-12-27 22:09:08 UTC (rev 1625) @@ -0,0 +1,104 @@ +package jp.sf.pal.board.db.allcommon.cbean.ckey; + +import java.util.List; + +import jp.sf.pal.board.db.allcommon.cbean.coption.ConditionOption; +import jp.sf.pal.board.db.allcommon.cbean.coption.LikeSearchOption; +import jp.sf.pal.board.db.allcommon.cbean.cvalue.ConditionValue; + +/** + * The condition-key of notLikeSearch. + * + * @author DBFlute(AutoGenerator) + */ +public class ConditionKeyNotLikeSearch extends ConditionKey { + + /** + * Constructor. + */ + protected ConditionKeyNotLikeSearch() { + _conditionKey = "notLikeSearch"; + _operand = "not like"; + } + + /** + * Is valid registration? + * + * @param conditionValue Condition value. (NotNull) + * @param value Value. (NotNull) + * @param callerName Caller name. (NotNull) + * @return Determination. + */ + public boolean isValidRegistration(ConditionValue conditionValue, + Object value, String callerName) { + if (value == null) { + return false; + } + return true; + } + + /** + * This method implements super#doAddWhereClause(). + * + * @param conditionList Condition list. (NotNull) + * @param columnName Column name. (NotNull) + * @param value Condition value. (NotNull) + */ + protected void doAddWhereClause(List 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 conditionList, + String columnName, ConditionValue value, ConditionOption option) { + if (option == null) { + String msg = "The argument[option] should not be null: columnName=" + + columnName + " value=" + value; + throw new IllegalArgumentException(msg); + } + if (!(option instanceof LikeSearchOption)) { + String msg = "The argument[option] should be LikeSearchOption: columnName=" + + columnName + " value=" + value; + throw new IllegalArgumentException(msg); + } + final LikeSearchOption myOption = (LikeSearchOption) option; + conditionList.add(buildBindClauseWithRearOption(columnName, value + .getNotLikeSearchLocation(), myOption.getRearOption())); + } + + /** + * This method implements super#doSetupConditionValue(). + * + * @param conditionValue Condition value. (NotNull) + * @param value Value. (NotNull) + * @param location Location. (NotNull) + */ + protected void doSetupConditionValue(ConditionValue conditionValue, + Object value, String location) { + throw new UnsupportedOperationException( + "doSetupConditionValue without condition-option is unsupported!!!"); + } + + /** + * This method implements super#doSetupConditionValue(). + * + * @param conditionValue Condition value. (NotNull) + * @param value Value. (NotNull) + * @param location Location. (NotNull) + * @param option Condition option. (NotNull) + */ + protected void doSetupConditionValue(ConditionValue conditionValue, + Object value, String location, ConditionOption option) { + conditionValue.setNotLikeSearch((String) value, + (LikeSearchOption) option).setNotLikeSearchLocation(location); + } +} Property changes on: board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/cbean/ckey/ConditionKeyNotLikeSearch.java ___________________________________________________________________ Name: svn:eol-style + native Modified: board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/cbean/coption/FromToOption.java =================================================================== --- board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/cbean/coption/FromToOption.java 2008-12-27 22:06:42 UTC (rev 1624) +++ board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/cbean/coption/FromToOption.java 2008-12-27 22:09:08 UTC (rev 1625) @@ -1,5 +1,10 @@ package jp.sf.pal.board.db.allcommon.cbean.coption; +import java.util.Calendar; +import java.util.Date; + +import jp.sf.pal.board.db.allcommon.cbean.ckey.ConditionKey; + /** * The option of from-to. * @@ -85,60 +90,84 @@ // ========= // Internal Main // ============= - public java.util.Date filterFromDate(java.util.Date fromDate) { + /** + * Filter the date as From. It requires this method is called before + * getFromDateConditionKey(). + * + * @param fromDate The date as From. (Nullable: If the value is null, it + * returns null) + * @return The filtered date as From. (Nullable) + */ + public Date filterFromDate(Date fromDate) { if (fromDate == null) { return null; } if (_compareAsDate) { - final java.util.Calendar cal = java.util.Calendar.getInstance(); + final Calendar cal = Calendar.getInstance(); cal.setTimeInMillis(fromDate.getTime()); clearCalendarHourMinuteSecondMilli(cal); - final java.util.Date cloneDate = (java.util.Date) fromDate.clone(); + final Date cloneDate = (Date) fromDate.clone(); cloneDate.setTime(cal.getTimeInMillis()); return cloneDate; } return fromDate; } - public java.util.Date filterToDate(java.util.Date toDate) { + /** + * Filter the date as To. It requires this method is called before + * getToDateConditionKey(). + * + * @param toDate The date as To. (Nullable: If the value is null, it returns + * null) + * @return The filtered date as To. (Nullable) + */ + public Date filterToDate(Date toDate) { if (toDate == null) { return null; } if (_compareAsDate) { - final java.util.Calendar cal = java.util.Calendar.getInstance(); + final Calendar cal = Calendar.getInstance(); cal.setTimeInMillis(toDate.getTime()); clearCalendarHourMinuteSecondMilli(cal); addCalendarNextDay(cal);// Key Point! - final java.util.Date cloneDate = (java.util.Date) toDate.clone(); + final Date cloneDate = (Date) toDate.clone(); cloneDate.setTime(cal.getTimeInMillis()); return cloneDate; } return toDate; } - public jp.sf.pal.board.db.allcommon.cbean.ckey.ConditionKey getFromDateConditionKey() { + /** + * Get the condition-key of the from-date. It requires this method is called + * after filterFromDate(). + * + * @return The condition-key of the from-date. (NotNull) + */ + public ConditionKey getFromDateConditionKey() { if (_compareAsDate) { - return jp.sf.pal.board.db.allcommon.cbean.ckey.ConditionKey.CK_GREATER_EQUAL; + return ConditionKey.CK_GREATER_EQUAL; } if (_fromDateGreaterThan) { - return jp.sf.pal.board.db.allcommon.cbean.ckey.ConditionKey.CK_GREATER_THAN;// Default - // ! + return ConditionKey.CK_GREATER_THAN;// Default! } else { - return jp.sf.pal.board.db.allcommon.cbean.ckey.ConditionKey.CK_GREATER_EQUAL;// Default - // ! + return ConditionKey.CK_GREATER_EQUAL;// Default! } } - public jp.sf.pal.board.db.allcommon.cbean.ckey.ConditionKey getToDateConditionKey() { + /** + * Get the condition-key of the to-date. It requires this method is called + * after filterToDate(). + * + * @return The condition-key of the to-date. (NotNull) + */ + public ConditionKey getToDateConditionKey() { if (_compareAsDate) { - return jp.sf.pal.board.db.allcommon.cbean.ckey.ConditionKey.CK_LESS_THAN; + return ConditionKey.CK_LESS_THAN; } if (_toDateLessThan) { - return jp.sf.pal.board.db.allcommon.cbean.ckey.ConditionKey.CK_LESS_THAN;// Default - // ! + return ConditionKey.CK_LESS_THAN;// Default! } else { - return jp.sf.pal.board.db.allcommon.cbean.ckey.ConditionKey.CK_LESS_EQUAL;// Default - // ! + return ConditionKey.CK_LESS_EQUAL;// Default! } } @@ -146,15 +175,15 @@ // ========= // Calendar Helper // =============== - protected void addCalendarNextDay(java.util.Calendar cal) { - cal.add(java.util.Calendar.DAY_OF_MONTH, 1); + protected void addCalendarNextDay(Calendar cal) { + cal.add(Calendar.DAY_OF_MONTH, 1); } - protected void clearCalendarHourMinuteSecondMilli(java.util.Calendar cal) { - cal.clear(java.util.Calendar.MILLISECOND); - cal.clear(java.util.Calendar.SECOND); - cal.clear(java.util.Calendar.MINUTE); - cal.set(java.util.Calendar.HOUR_OF_DAY, cal - .getActualMinimum(java.util.Calendar.HOUR_OF_DAY)); + protected void clearCalendarHourMinuteSecondMilli(Calendar cal) { + cal.clear(Calendar.MILLISECOND); + cal.clear(Calendar.SECOND); + cal.clear(Calendar.MINUTE); + cal.set(Calendar.HOUR_OF_DAY, cal + .getActualMinimum(Calendar.HOUR_OF_DAY)); } } Modified: board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/cbean/coption/LikeSearchOption.java =================================================================== --- board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/cbean/coption/LikeSearchOption.java 2008-12-27 22:06:42 UTC (rev 1624) +++ board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/cbean/coption/LikeSearchOption.java 2008-12-27 22:09:08 UTC (rev 1625) @@ -4,6 +4,7 @@ import java.util.Iterator; import java.util.List; +import jp.sf.pal.board.db.allcommon.DBDef; import jp.sf.pal.board.db.allcommon.cbean.coption.parts.local.JapaneseOptionPartsAgent; /** @@ -230,6 +231,10 @@ String tmp = replace(value, _escape, _escape + _escape); tmp = replace(tmp, "%", _escape + "%"); tmp = replace(tmp, "_", _escape + "_"); + if (DBDef.isCurrentDef(DBDef.Oracle)) { + tmp = replace(tmp, "\uff05", _escape + "\uff05"); + tmp = replace(tmp, "\uff3f", _escape + "\uff3f"); + } value = tmp; } final String wildCard = "%"; Modified: board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/cbean/cvalue/ConditionValue.java =================================================================== --- board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/cbean/cvalue/ConditionValue.java 2008-12-27 22:06:42 UTC (rev 1624) +++ board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/cbean/cvalue/ConditionValue.java 2008-12-27 22:09:08 UTC (rev 1625) @@ -6,9 +6,10 @@ import jp.sf.pal.board.db.allcommon.cbean.coption.InScopeOption; import jp.sf.pal.board.db.allcommon.cbean.coption.LikeSearchOption; +import jp.sf.pal.board.db.allcommon.util.SimpleTypeUtil; /** - * Condition value. + * Condition-value. * * @author DBFlute(AutoGenerator) */ @@ -578,110 +579,9 @@ //========================================================================== // ========= - // Like Search - // =========== - /** Value of likeSearch. */ - protected List _likeSearch; - - /** Value of likeSearch for spare. */ - protected List _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(); - _likeSearch4Spare = new ArrayList(); - } - if (_likeSearch.isEmpty() && !_likeSearch4Spare.isEmpty()) { - for (int index = 0; index < _likeSearch4Spare.size(); index++) { - _likeSearch.add(_likeSearch4Spare.get(index)); - } - } - LikeSearchValue likeSearchValue = new LikeSearchValue(value, option); - _likeSearch.add(likeSearchValue); - _likeSearch4Spare.add(likeSearchValue); - return this; - } - - /** Location of likeSearch. */ - protected String _likeSearchLocation; - - /** - * Get the location of likeSearch. - * - * @return The location of likeSearch. (Nullable) - */ - public String getLikeSearchLocation() { - return _likeSearchLocation; - } - - /** - * Set the location of likeSearch. - * - * @param location The location of likeSearch. (Nullable) - * @return this. (NotNull) - */ - public ConditionValue setLikeSearchLocation(String location) { - _likeSearchLocation = location; - return this; - } - - protected static class LikeSearchValue { - protected String _value; - - protected LikeSearchOption _option; - - public LikeSearchValue(String value, LikeSearchOption option) { - _value = value; - _option = option; - } - - public String getValue() { - return _value; - } - - public LikeSearchOption getOption() { - return _option; - } - - public String generateRealValue() { - if (_option == null) { - return _value; - } - return _option.generateRealValue(_value); - } - } - - //========================================================================== - // ========= // In Scope // ======== - /** Value of inScope. */ + /** The value of inScope. */ protected List _inScope; protected InScopeOption _inScopeOption; @@ -774,7 +674,7 @@ // ========= // Not In Scope // ============ - /** Value of notInScope. */ + /** The value of notInScope. */ protected List _notInScope; /** @@ -852,6 +752,207 @@ //========================================================================== // ========= + // Like Search + // =========== + /** The value of likeSearch. */ + protected List _likeSearch; + + /** The value of likeSearch for spare. */ + protected List _likeSearch4Spare; + + /** + * Get the value of likeSearch. + * + * @return The value of likeSearch. (Nullable) + */ + public String getLikeSearch() { + if (_likeSearch == null) { + return null; + } + if (_likeSearch.isEmpty() && !_likeSearch4Spare.isEmpty()) { + for (int index = 0; index < _likeSearch4Spare.size(); index++) { + _likeSearch.add(_likeSearch4Spare.get(index)); + } + } + final LikeSearchValue likeSearchValue = _likeSearch.remove(0); + return (String) filterValue(likeSearchValue.generateRealValue()); + } + + /** + * Set the value of likeSearch. + * + * @param value The value of likeSearch. (Nullable) + * @param option The option of likeSearch. (Nullable) + * @return this. (NotNull) + */ + public ConditionValue setLikeSearch(String value, LikeSearchOption option) { + if (_likeSearch == null) { + _likeSearch = new ArrayList(); + _likeSearch4Spare = new ArrayList(); + } + if (_likeSearch.isEmpty() && !_likeSearch4Spare.isEmpty()) { + for (int index = 0; index < _likeSearch4Spare.size(); index++) { + _likeSearch.add(_likeSearch4Spare.get(index)); + } + } + LikeSearchValue likeSearchValue = new LikeSearchValue(value, option); + _likeSearch.add(likeSearchValue); + _likeSearch4Spare.add(likeSearchValue); + return this; + } + + /** Location of likeSearch. */ + protected String _likeSearchLocation; + + /** + * Get the location of likeSearch. + * + * @return The location of likeSearch. (Nullable) + */ + public String getLikeSearchLocation() { + return _likeSearchLocation; + } + + /** + * Set the location of likeSearch. + * + * @param location The location of likeSearch. (Nullable) + * @return this. (NotNull) + */ + public ConditionValue setLikeSearchLocation(String location) { + _likeSearchLocation = location; + return this; + } + + protected static class LikeSearchValue { + protected String _value; + + protected LikeSearchOption _option; + + public LikeSearchValue(String value, LikeSearchOption option) { + _value = value; + _option = option; + } + + public String getValue() { + return _value; + } + + public LikeSearchOption getOption() { + return _option; + } + + public String generateRealValue() { + if (_option == null) { + return _value; + } + return _option.generateRealValue(_value); + } + } + + //========================================================================== + // ========= + // Not Like Search + // =============== + /** The value of notLikeSearch. */ + protected List _notLikeSearch; + + /** The value of notLikeSearch for spare. */ + protected List _notLikeSearch4Spare; + + /** + * Get the value of notLikeSearch. + * + * @return The value of notLikeSearch. (Nullable) + */ + public String getNotLikeSearch() { + if (_notLikeSearch == null) { + return null; + } + if (_notLikeSearch.isEmpty() && !_notLikeSearch4Spare.isEmpty()) { + for (int index = 0; index < _notLikeSearch4Spare.size(); index++) { + _notLikeSearch.add(_notLikeSearch4Spare.get(index)); + } + } + final NotLikeSearchValue notLikeSearchValue = _notLikeSearch.remove(0); + return (String) filterValue(notLikeSearchValue.generateRealValue()); + } + + /** + * Set the value of notLikeSearch. + * + * @param value The value of notLikeSearch. (Nullable) + * @param option The option of notLikeSearch. (Nullable) + * @return this. (NotNull) + */ + public ConditionValue setNotLikeSearch(String value, LikeSearchOption option) { + if (_notLikeSearch == null) { + _notLikeSearch = new ArrayList(); + _notLikeSearch4Spare = new ArrayList(); + } + if (_notLikeSearch.isEmpty() && !_notLikeSearch4Spare.isEmpty()) { + for (int index = 0; index < _notLikeSearch4Spare.size(); index++) { + _notLikeSearch.add(_notLikeSearch4Spare.get(index)); + } + } + NotLikeSearchValue notLikeSearchValue = new NotLikeSearchValue(value, + option); + _notLikeSearch.add(notLikeSearchValue); + _notLikeSearch4Spare.add(notLikeSearchValue); + return this; + } + + /** Location of notLikeSearch. */ + protected String _notLikeSearchLocation; + + /** + * Get the location of notLikeSearch. + * + * @return The location of notLikeSearch. (Nullable) + */ + public String getNotLikeSearchLocation() { + return _notLikeSearchLocation; + } + + /** + * Set the location of notLikeSearch. + * + * @param location The location of notLikeSearch. (Nullable) + * @return this. (NotNull) + */ + public ConditionValue setNotLikeSearchLocation(String location) { + _notLikeSearchLocation = location; + return this; + } + + protected static class NotLikeSearchValue { + protected String _value; + + protected LikeSearchOption _option; + + public NotLikeSearchValue(String value, LikeSearchOption option) { + _value = value; + _option = option; + } + + public String getValue() { + return _value; + } + + public LikeSearchOption getOption() { + return _option; + } + + public String generateRealValue() { + if (_option == null) { + return _value; + } + return _option.generateRealValue(_value); + } + } + + //========================================================================== + // ========= // Is Null // ======= /** Value of isNull. */ @@ -976,8 +1077,8 @@ * Filter value. If the value is instance of java.util.Date or * java.util.Calendar, returns value as java.sql.Date. * - * @param value Value. (Nullable) - * @return Filtered value. (Nullable) + * @param value The value. (Nullable) + * @return The filtered value. (Nullable) */ protected Object filterValue(Object value) { if (value == null) { @@ -991,18 +1092,18 @@ } if (value instanceof java.util.Date || value instanceof java.util.Calendar) { - return SqlDateConversionUtil.toDate(value); + return SimpleTypeUtil.toSqlDate(value); } else { return value; } } /** - * Filter value. If the value is instance of java.util.Date or + * Filter the list of value. If the value is instance of java.util.Date or * java.util.Calendar, returns value as java.sql.Date. * - * @param valueList Value-list. (Nullable) - * @return Filtered value-list. (Nullable) + * @param valueList The list of value. (Nullable) + * @return The filtered list of value. (Nullable) */ protected List filterValue(List valueList) { if (valueList == null || valueList.isEmpty()) { @@ -1015,204 +1116,4 @@ } return resultList; } - - protected static class SqlDateConversionUtil { - - private SqlDateConversionUtil() { - } - - public static java.sql.Date toDate(Object o) { - return toDate(o, null); - } - - public static java.sql.Date toDate(Object o, String pattern) { - if (o instanceof java.sql.Date) { - return (java.sql.Date) o; - } - java.util.Date date = DateConversionUtil.toDate(o, pattern); - if (date != null) { - return new java.sql.Date(date.getTime()); - } - return null; - } - } - - protected static class DateConversionUtil { - - private DateConversionUtil() { - } - - public static java.util.Date toDate(Object o) { - return toDate(o, null); - } - - public static java.util.Date toDate(Object o, String pattern) { - if (o == null) { - return null; - } else if (o instanceof String) { - return toDate((String) o, pattern); - } else if (o instanceof java.util.Date) { - return (java.util.Date) o; - } else if (o instanceof java.util.Calendar) { - return ((java.util.Calendar) o).getTime(); - } else { - return toDate(o.toString(), pattern); - } - } - - public static java.util.Date toDate(String s, String pattern) { - return toDate(s, pattern, java.util.Locale.getDefault()); - } - - public static java.util.Date toDate(String s, String pattern, - java.util.Locale locale) { - java.text.SimpleDateFormat sdf = getDateFormat(s, pattern, locale); - try { - return sdf.parse(s); - } catch (java.text.ParseException ex) { - throw new RuntimeException(ex); - } - } - - public static java.text.SimpleDateFormat getDateFormat(String s, - String pattern, java.util.Locale locale) { - if (pattern != null) { - return new java.text.SimpleDateFormat(pattern); - } - return getDateFormat(s, locale); - } - - public static java.text.SimpleDateFormat getDateFormat(String s, - java.util.Locale locale) { - String pattern = getPattern(locale); - String shortPattern = removeDelimiter(pattern); - String delimitor = findDelimiter(s); - if (delimitor == null) { - if (s.length() == shortPattern.length()) { - return new java.text.SimpleDateFormat(shortPattern); - } - if (s.length() == shortPattern.length() + 2) { - return new java.text.SimpleDateFormat(InternalStringUtil - .replace(shortPattern, "yy", "yyyy")); - } - } else { - String[] array = InternalStringUtil.split(s, delimitor); - for (int i = 0; i < array.length; ++i) { - if (array[i].length() == 4) { - pattern = InternalStringUtil.replace(pattern, "yy", - "yyyy"); - break; - } - } - return new java.text.SimpleDateFormat(pattern); - } - return new java.text.SimpleDateFormat(); - } - - public static java.text.SimpleDateFormat getDateFormat( - java.util.Locale locale) { - return new java.text.SimpleDateFormat(getPattern(locale)); - } - - public static java.text.SimpleDateFormat getY4DateFormat( - java.util.Locale locale) { - return new java.text.SimpleDateFormat(getY4Pattern(locale)); - } - - public static String getY4Pattern(java.util.Locale locale) { - String pattern = getPattern(locale); - if (pattern.indexOf("yyyy") < 0) { - pattern = InternalStringUtil.replace(pattern, "yy", "yyyy"); - } - return pattern; - } - - public static String getPattern(java.util.Locale locale) { - java.text.SimpleDateFormat df = (java.text.SimpleDateFormat) java.text.DateFormat - .getDateInstance(java.text.DateFormat.SHORT, locale); - String pattern = df.toPattern(); - int index = pattern.indexOf(' '); - if (index > 0) { - pattern = pattern.substring(0, index); - } - if (pattern.indexOf("MM") < 0) { - pattern = InternalStringUtil.replace(pattern, "M", "MM"); - } - if (pattern.indexOf("dd") < 0) { - pattern = InternalStringUtil.replace(pattern, "d", "dd"); - } - return pattern; - } - - public static String findDelimiter(String value) { - for (int i = 0; i < value.length(); ++i) { - char c = value.charAt(i); - if (Character.isDigit(c)) { - continue; - } - return Character.toString(c); - } - return null; - } - - public static String removeDelimiter(String pattern) { - StringBuffer buf = new StringBuffer(); - for (int i = 0; i < pattern.length(); ++i) { - char c = pattern.charAt(i); - if (c == 'y' || c == 'M' || c == 'd') { - buf.append(c); - } - } - return buf.toString(); - } - } - - protected static class InternalStringUtil { - public static final String[] EMPTY_STRINGS = new String[0]; - - private InternalStringUtil() { - } - - public static final boolean isEmpty(String text) { - return text == null || text.length() == 0; - } - - public static final String replace(String text, String fromText, - String toText) { - if (text == null || fromText == null || toText == null) { - return null; - } - StringBuffer buf = new StringBuffer(100); - int pos = 0; - int pos2 = 0; - while (true) { - pos = text.indexOf(fromText, pos2); - if (pos == 0) { - buf.append(toText); - pos2 = fromText.length(); - } else if (pos > 0) { - buf.append(text.substring(pos2, pos)); - buf.append(toText); - pos2 = pos + fromText.length(); - } else { - buf.append(text.substring(pos2)); - break; - } - } - return buf.toString(); - } - - public static String[] split(String str, String delim) { - if (str == null) { - return EMPTY_STRINGS; - } - List list = new java.util.ArrayList(); - java.util.StringTokenizer st = new java.util.StringTokenizer(str, - delim); - while (st.hasMoreElements()) { - list.add(st.nextToken()); - } - return (String[]) list.toArray(new String[list.size()]); - } - } } Modified: board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/cbean/outsidesql/OutsideSqlContext.java =================================================================== --- board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/cbean/outsidesql/OutsideSqlContext.java 2008-12-27 22:06:42 UTC (rev 1624) +++ board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/cbean/outsidesql/OutsideSqlContext.java 2008-12-27 22:09:08 UTC (rev 1625) @@ -1,17 +1,21 @@ package jp.sf.pal.board.db.allcommon.cbean.outsidesql; +import java.io.BufferedReader; +import java.io.IOException; +import java.io.InputStream; +import java.io.InputStreamReader; +import java.io.Reader; + import jp.sf.pal.board.db.allcommon.DBFluteConfig; import jp.sf.pal.board.db.allcommon.dbmeta.DBMeta; import jp.sf.pal.board.db.allcommon.dbmeta.DBMetaInstanceHandler; import jp.sf.pal.board.db.allcommon.jdbc.StatementConfig; +import jp.sf.pal.board.db.allcommon.util.SimpleResourceUtil; import jp.sf.pal.board.db.allcommon.util.SimpleStringUtil; import jp.sf.pal.board.db.allcommon.util.SimpleSystemUtil; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; -import org.seasar.framework.util.InputStreamReaderUtil; -import org.seasar.framework.util.ReaderUtil; -import org.seasar.framework.util.ResourceUtil; /** * The context of outside-SQL. @@ -33,7 +37,7 @@ /** * Get outside-SQL context on thread. * - * @return Outside-SQL context. (Nullable) + * @return The context of outside-SQL. (Nullable) */ public static OutsideSqlContext getOutsideSqlContextOnThread() { return (OutsideSqlContext) _threadLocal.get(); @@ -42,7 +46,7 @@ /** * Set outside-SQL context on thread. * - * @param outsideSqlContext Outside-SQL context. (NotNull) + * @param outsideSqlContext The context of outside-SQL. (NotNull) */ public static void setOutsideSqlContextOnThread( OutsideSqlContext outsideSqlContext) { @@ -54,7 +58,7 @@ } /** - * Is existing outside-SQL context on thread? + * Is existing the context of outside-SQL on thread? * * @return Determination. */ @@ -63,7 +67,7 @@ } /** - * Clear outside-SQL context on thread. + * Clear the context of outside-SQL on thread. */ public static void clearOutsideSqlContextOnThread() { _threadLocal.set(null); @@ -77,12 +81,20 @@ String methodName, String path, Object pmb, OutsideSqlOption option, Object resultTypeSpecification) { final String pmbKey = (pmb != null ? pmb.getClass().getName() : "null"); - final String resultKey = (resultTypeSpecification != null ? ":" - + resultTypeSpecification : "null"); + final String resultKey; + if (resultTypeSpecification != null) { + if (resultTypeSpecification instanceof Class) { + resultKey = ((Class) resultTypeSpecification).getName(); + } else { + resultKey = resultTypeSpecification.toString(); + } + } else { + resultKey = "null"; + } final String tableDbName = option.getTableDbName(); final String generatedUniqueKey = option.generateUniqueKey(); - return methodName + "():" + tableDbName + ":" + path + ":" + pmbKey - + ":" + generatedUniqueKey + resultKey; + return tableDbName + ":" + methodName + "():" + path + ":" + pmbKey + + ":" + generatedUniqueKey + ":" + resultKey; } //========================================================================== @@ -116,18 +128,9 @@ // Attribute // ========= // ----------------------------------------------------- - // Common of OutsideSql - // -------------------- - protected boolean _dynamicBinding; - - protected boolean _offsetByCursorForcedly; - - protected boolean _limitByCursorForcedly; - - // ----------------------------------------------------- - // Specified OutsideSql - // -------------------- - /** The path of outside-sql. (The mark of Specified-OutsideSql) */ + // Basic + // ----- + /** The path of outside-SQL. (The mark of specified outside-SQL) */ protected String _outsideSqlPath; protected Object _parameterBean; @@ -136,12 +139,23 @@ protected String _methodName; - /** The config of statement. (Nullable) */ + /** The configuration of statement. (Nullable) */ protected StatementConfig _statementConfig; /** The DB name of table for using behavior-SQL-path. (Nullable) */ protected String _tableDbName; + // ----------------------------------------------------- + // Option + // ------ + protected boolean _dynamicBinding; + + protected boolean _offsetByCursorForcedly; + + protected boolean _limitByCursorForcedly; + + protected boolean _autoPagingLogging; // for logging + //========================================================================== // ========= // Read SQL @@ -200,7 +214,7 @@ } /** - * Read outside-sql path. Required attribute is 'outsideSqlPath'. + * Read outside-SQL path. Required attribute is 'outsideSqlPath'. * * @param sqlFileEncoding The encoding of SQL file. (NotNull) * @param dbmsSuffix The suffix of DBMS. (NotNull) @@ -214,6 +228,13 @@ String sql; if (isExistResource(dbmsPath)) { sql = readText(dbmsPath, sqlFileEncoding); + } else if ("_postgresql".equals(dbmsSuffix) + && isExistResource("_postgre")) { + sql = readText("_postgre", sqlFileEncoding); // Patch for name + // difference + } else if ("_sqlserver".equals(dbmsSuffix) && isExistResource("_mssql")) { + sql = readText("_mssql", sqlFileEncoding); // Patch for name + // difference } else if (isExistResource(standardPath)) { sql = readText(standardPath, sqlFileEncoding); } else { @@ -324,16 +345,46 @@ // General Helper // ============== protected boolean isExistResource(String path) { - return ResourceUtil.isExist(path); + return SimpleResourceUtil.isExist(path); } protected String readText(final String path, String sqlFileEncoding) { - final java.io.InputStream is = ResourceUtil.getResourceAsStream(path); - final java.io.Reader reader = InputStreamReaderUtil.create(is, - sqlFileEncoding); - return ReaderUtil.readText(reader); + final InputStream ins = SimpleResourceUtil.getResourceStream(path); + final Reader reader = createInputStreamReader(ins, sqlFileEncoding); + return readText(reader); } + protected Reader createInputStreamReader(InputStream ins, String encoding) { + try { + return new InputStreamReader(ins, encoding); + } catch (IOException e) { + String msg = "Failed to create the reader of the input stream:"; + msg = msg + " ins=" + ins + " encoding=" + encoding; + throw new IllegalStateException(msg, e); + } + } + + public String readText(Reader reader) { + final BufferedReader bfreader = new BufferedReader(reader); + final StringBuilder out = new StringBuilder(100); + try { + try { + final char[] buf = new char[8192]; + int n; + while ((n = bfreader.read(buf)) >= 0) { + out.append(buf, 0, n); + } + } finally { + bfreader.close(); + } + } catch (IOException e) { + String msg = "Failed to read the input stream:"; + msg = msg + " bfreader=" + bfreader + " reader=" + reader; + throw new IllegalStateException(msg, e); + } + return out.toString(); + } + protected static String replaceString(String text, String fromText, String toText) { return SimpleStringUtil.replace(text, fromText, toText); @@ -348,35 +399,8 @@ // Accessor // ======== // ----------------------------------------------------- - // Common of OutsideSql - // -------------------- - public boolean isDynamicBinding() { - return _dynamicBinding; - } - - public void setDynamicBinding(boolean dynamicBinding) { - this._dynamicBinding = dynamicBinding; - } - - public boolean isOffsetByCursorForcedly() { - return _offsetByCursorForcedly; - } - - public void setOffsetByCursorForcedly(boolean offsetByCursorForcedly) { - this._offsetByCursorForcedly = offsetByCursorForcedly; - } - - public boolean isLimitByCursorForcedly() { - return _limitByCursorForcedly; - } - - public void setLimitByCursorForcedly(boolean limitByCursorForcedly) { - this._limitByCursorForcedly = limitByCursorForcedly; - } - - // ----------------------------------------------------- - // Specified OutsideSql - // -------------------- + // Basic + // ----- public String getOutsideSqlPath() { return _outsideSqlPath; } @@ -424,4 +448,39 @@ public void setTableDbName(String tableDbName) { this._tableDbName = tableDbName; } + + // ----------------------------------------------------- + // Option + // ------ + public boolean isDynamicBinding() { + return _dynamicBinding; + } + + public void setDynamicBinding(boolean dynamicBinding) { + this._dynamicBinding = dynamicBinding; + } + + public boolean isOffsetByCursorForcedly() { + return _offsetByCursorForcedly; + } + + public void setOffsetByCursorForcedly(boolean offsetByCursorForcedly) { + this._offsetByCursorForcedly = offsetByCursorForcedly; + } + + public boolean isLimitByCursorForcedly() { + return _limitByCursorForcedly; + } + + public void setLimitByCursorForcedly(boolean limitByCursorForcedly) { + this._limitByCursorForcedly = limitByCursorForcedly; + } + + public boolean isAutoPagingLogging() { // for logging + return _autoPagingLogging; + } + + public void setAutoPagingLogging(boolean autoPagingLogging) { // for logging + this._autoPagingLogging = autoPagingLogging; + } } Deleted: board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/cbean/outsidesql/OutsideSqlDao.java =================================================================== --- board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/cbean/outsidesql/OutsideSqlDao.java 2008-12-27 22:06:42 UTC (rev 1624) +++ board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/cbean/outsidesql/OutsideSqlDao.java 2008-12-27 22:09:08 UTC (rev 1625) @@ -1,37 +0,0 @@ -package jp.sf.pal.board.db.allcommon.cbean.outsidesql; - -import java.util.List; - -import jp.sf.pal.board.db.allcommon.DaoReadable; -import jp.sf.pal.board.db.allcommon.jdbc.CursorHandler; - -/** - * The dao of outside-sql. - * - * @author DBFlute(AutoGenerator) - */ -public interface OutsideSqlDao extends DaoReadable { - - //========================================================================== - // ========= - // Select - // ====== - List selectList(String path, Object pmb, - OutsideSqlOption option, Class entityType); - - Object selectCursor(String path, Object pmb, - OutsideSqlOption option, CursorHandler handler); - - //========================================================================== - // ========= - // Execute - // ======= - int execute(String path, Object pmb, OutsideSqlOption option); - - // [DBFlute-0.7.5] - //========================================================================== - // ========= - // Call - // ==== - void call(String path, Object pmb, OutsideSqlOption option); -} Modified: board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/cbean/outsidesql/OutsideSqlOption.java =================================================================== --- board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/cbean/outsidesql/OutsideSqlOption.java 2008-12-27 22:06:42 UTC (rev 1624) +++ board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/cbean/outsidesql/OutsideSqlOption.java 2008-12-27 22:09:08 UTC (rev 1625) @@ -16,6 +16,7 @@ // ----------------------------------------------------- // Option // ------ + /** The request type of paging. */ protected String _pagingRequestType = "non"; protected boolean _dynamicBinding; @@ -23,6 +24,8 @@ /** The configuration of statement. (Nullable) */ protected StatementConfig _statementConfig; + protected String _sourcePagingRequestType = "non"; + // ----------------------------------------------------- // Information // ----------- @@ -59,6 +62,7 @@ // ==== public OutsideSqlOption copyOptionWithoutPaging() { final OutsideSqlOption copyOption = new OutsideSqlOption(); + copyOption.setPagingSourceRequestType(_pagingRequestType); if (isDynamicBinding()) { copyOption.dynamicBinding(); } @@ -103,6 +107,15 @@ _statementConfig = statementConfig; } + protected void setPagingSourceRequestType(String sourcePagingRequestType) { // Very + // Internal + _sourcePagingRequestType = sourcePagingRequestType; + } + + public boolean isSourcePagingRequestTypeAuto() { // Very Internal + return "auto".equals(_sourcePagingRequestType); + } + // ----------------------------------------------------- // Information // ----------- Modified: board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/cbean/outsidesql/executor/OutsideSqlBasicExecutor.java =================================================================== --- board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/cbean/outsidesql/executor/OutsideSqlBasicExecutor.java 2008-12-27 22:06:42 UTC (rev 1624) +++ board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/cbean/outsidesql/executor/OutsideSqlBasicExecutor.java 2008-12-27 22:09:08 UTC (rev 1625) @@ -2,15 +2,20 @@ import java.util.List; +import jp.sf.pal.board.db.allcommon.bhv.core.BehaviorCommand; +import jp.sf.pal.board.db.allcommon.bhv.core.BehaviorCommandInvoker; +import jp.sf.pal.board.db.allcommon.bhv.core.command.AbstractOutsideSqlCommand; +import jp.sf.pal.board.db.allcommon.bhv.core.command.OutsideSqlCallCommand; +import jp.sf.pal.board.db.allcommon.bhv.core.command.OutsideSqlExecuteCommand; +import jp.sf.pal.board.db.allcommon.bhv.core.command.OutsideSqlSelectListCommand; import jp.sf.pal.board.db.allcommon.cbean.ListResultBean; import jp.sf.pal.board.db.allcommon.cbean.ResultBeanBuilder; -import jp.sf.pal.board.db.allcommon.cbean.outsidesql.OutsideSqlDao; import jp.sf.pal.board.db.allcommon.cbean.outsidesql.OutsideSqlOption; import jp.sf.pal.board.db.allcommon.cbean.outsidesql.ProcedurePmb; import jp.sf.pal.board.db.allcommon.jdbc.StatementConfig; /** - * The executor of outside-sql.
+ * The executor of outside-SQL.
* *
  * {Basic}
@@ -33,7 +38,6 @@
  * 
  * {Option -- Dynamic}
  *   o dynamicBinding().selectList()
- * 
  * 
* * @author DBFlute(AutoGenerator) @@ -44,8 +48,8 @@ // ========= // Attribute // ========= - /** The DAO of outside-sql. (NotNull) */ - protected final OutsideSqlDao _outsideSqlDao; + /** The invoker of behavior command. (NotNull) */ + protected final BehaviorCommandInvoker _behaviorCommandInvoker; /** Table DB name. (NotNull) */ protected final String _tableDbName; @@ -60,9 +64,9 @@ // ========= // Constructor // =========== - public OutsideSqlBasicExecutor(OutsideSqlDao outsideSqlDao, - String tableDbName) { - this._outsideSqlDao = outsideSqlDao; + public OutsideSqlBasicExecutor( + BehaviorCommandInvoker behaviorCommandInvoker, String tableDbName) { + this._behaviorCommandInvoker = behaviorCommandInvoker; this._tableDbName = tableDbName; } @@ -80,12 +84,12 @@ * @param entityType The element type of entity. (NotNull) * @return The result bean of selected list. (NotNull) * @exception jp.sf.pal.board.db.allcommon.exception.OutsideSqlNotFoundException - * When the outside-sql is not found. + * When the outside-SQL is not found. */ public ListResultBean selectList(String path, Object pmb, Class entityType) { - List resultList = _outsideSqlDao.selectList(path, pmb, - createOutsideSqlOption(), entityType); + List resultList = invoke(createSelectListCommand(path, pmb, + entityType)); return new ResultBeanBuilder(_tableDbName) .buildListResultBean(resultList); } @@ -102,10 +106,10 @@ * object. (Nullable) * @return The count of execution. * @exception jp.sf.pal.board.db.allcommon.exception.OutsideSqlNotFoundException - * When the outside-sql is not found. + * When the outside-SQL is not found. */ public int execute(String path, Object pmb) { - return _outsideSqlDao.execute(path, pmb, createOutsideSqlOption()); + return invoke(createExecuteCommand(path, pmb)); } // [DBFlute-0.7.5] @@ -123,12 +127,53 @@ throw new IllegalArgumentException( "The argument of call() 'pmb' should not be null!"); } - _outsideSqlDao.call(pmb.getProcedureName(), pmb, - createOutsideSqlOption()); + invoke(createCallCommand(pmb.getProcedureName(), pmb)); } //========================================================================== // ========= + // Behavior Command + // ================ + protected BehaviorCommand> createSelectListCommand( + String path, Object pmb, Class entityType) { + final OutsideSqlSelectListCommand cmd = xsetupCommand( + new OutsideSqlSelectListCommand(), path, pmb); + cmd.setEntityType(entityType); + return cmd; + } + + protected BehaviorCommand createExecuteCommand(String path, + Object pmb) { + return xsetupCommand(new OutsideSqlExecuteCommand(), path, pmb); + } + + protected BehaviorCommand createCallCommand(String path, Object pmb) { + return xsetupCommand(new OutsideSqlCallCommand(), path, pmb); + } + + private > COMMAND xsetupCommand( + COMMAND command, String path, Object pmb) { + command.setTableDbName(_tableDbName); + _behaviorCommandInvoker.injectComponentProperty(command); + command.setOutsideSqlPath(path); + command.setParameterBean(pmb); + command.setOutsideSqlOption(createOutsideSqlOption()); + return command; + } + + /** + * Invoke the command of behavior. + * + * @param The type of result. + * @param behaviorCommand The command of behavior. (NotNull) + * @return The instance of result. (Nullable) + */ + protected RESULT invoke(BehaviorCommand behaviorCommand) { + return _behaviorCommandInvoker.invoke(behaviorCommand); + } + + //========================================================================== + // ========= // Option // ====== // ----------------------------------------------------- @@ -144,11 +189,11 @@ * # * * - * @return The cursor executor of outside-sql. (NotNull) + * @return The cursor executor of outside-SQL. (NotNull) */ public OutsideSqlCursorExecutor cursorHandling() { - return new OutsideSqlCursorExecutor(_outsideSqlDao, - createOutsideSqlOption()); + return new OutsideSqlCursorExecutor(_behaviorCommandInvoker, + createOutsideSqlOption(), _tableDbName); } /** @@ -161,11 +206,11 @@ * # * * - * @return The cursor executor of outside-sql. (NotNull) + * @return The cursor executor of outside-SQL. (NotNull) */ public OutsideSqlEntityExecutor entityHandling() { - return new OutsideSqlEntityExecutor(_outsideSqlDao, - createOutsideSqlOption()); + return new OutsideSqlEntityExecutor(_behaviorCommandInvoker, + createOutsideSqlOption(), _tableDbName); } // ----------------------------------------------------- @@ -191,7 +236,7 @@ public OutsideSqlPagingExecutor autoPaging() { final OutsideSqlOption option = createOutsideSqlOption(); option.autoPaging(); - return new OutsideSqlPagingExecutor(_outsideSqlDao, option, + return new OutsideSqlPagingExecutor(_behaviorCommandInvoker, option, _tableDbName); } @@ -215,7 +260,7 @@ public OutsideSqlPagingExecutor manualPaging() { final OutsideSqlOption option = createOutsideSqlOption(); option.manualPaging(); - return new OutsideSqlPagingExecutor(_outsideSqlDao, option, + return new OutsideSqlPagingExecutor(_behaviorCommandInvoker, option, _tableDbName); } Modified: board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/cbean/outsidesql/executor/OutsideSqlCursorExecutor.java =================================================================== --- board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/cbean/outsidesql/executor/OutsideSqlCursorExecutor.java 2008-12-27 22:06:42 UTC (rev 1624) +++ board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/cbean/outsidesql/executor/OutsideSqlCursorExecutor.java 2008-12-27 22:09:08 UTC (rev 1625) @@ -1,12 +1,14 @@ package jp.sf.pal.board.db.allcommon.cbean.outsidesql.executor; -import jp.sf.pal.board.db.allcommon.cbean.outsidesql.OutsideSqlDao; +import jp.sf.pal.board.db.allcommon.bhv.core.BehaviorCommand; +import jp.sf.pal.board.db.allcommon.bhv.core.BehaviorCommandInvoker; +import jp.sf.pal.board.db.allcommon.bhv.core.command.OutsideSqlSelectCursorCommand; import jp.sf.pal.board.db.allcommon.cbean.outsidesql.OutsideSqlOption; import jp.sf.pal.board.db.allcommon.jdbc.CursorHandler; import jp.sf.pal.board.db.allcommon.jdbc.StatementConfig; /** - * The cursor executor of outside-sql. + * The cursor executor of outside-SQL. * * @param The type of parameter-bean. * @author DBFlute(AutoGenerator) @@ -17,18 +19,25 @@ // ========= // Attribute // ========= - protected final OutsideSqlDao _outsideSqlDao; + /** The invoker of behavior command. (NotNull) */ + protected final BehaviorCommandInvoker _behaviorCommandInvoker; + /** The option of outside-SQL. (NotNull) */ protected final OutsideSqlOption _outsideSqlOption; + /** The DB name of table. (NotNull) */ + protected final String _tableDbName; + //========================================================================== // ========= // Constructor // =========== - public OutsideSqlCursorExecutor(OutsideSqlDao outsideSqlDao, - OutsideSqlOption outsideSqlOption) { - this._outsideSqlDao = outsideSqlDao; + public OutsideSqlCursorExecutor( + BehaviorCommandInvoker behaviorCommandInvoker, + OutsideSqlOption outsideSqlOption, String tableDbName) { + this._behaviorCommandInvoker = behaviorCommandInvoker; this._outsideSqlOption = outsideSqlOption; + this._tableDbName = tableDbName; } //========================================================================== @@ -44,14 +53,46 @@ * @param handler The handler of cursor. (NotNull) * @return The result object that the cursor handler returns. (Nullable) * @exception jp.sf.pal.board.db.allcommon.exception.OutsideSqlNotFoundException - * When the outside-sql is not found. + * When the outside-SQL is not found. */ public Object selectCursor(String path, PARAMETER_BEAN pmb, CursorHandler handler) { - return _outsideSqlDao.selectCursor(path, pmb, _outsideSqlOption, + return invoke(createSelectCursorCommand(path, pmb, handler)); + } + + //========================================================================== + // ========= + // Behavior Command + // ================ + protected BehaviorCommand createSelectCursorCommand(String path, + PARAMETER_BEAN pmb, CursorHandler handler) { + return xsetupCommand(new OutsideSqlSelectCursorCommand(), path, pmb, handler); } + private OutsideSqlSelectCursorCommand xsetupCommand( + OutsideSqlSelectCursorCommand command, String path, + PARAMETER_BEAN pmb, CursorHandler handler) { + command.setTableDbName(_tableDbName); + _behaviorCommandInvoker.injectComponentProperty(command); + command.setOutsideSqlPath(path); + command.setParameterBean(pmb); + command.setOutsideSqlOption(_outsideSqlOption); + command.setCursorHandler(handler); + return command; + } + + /** + * Invoke the command of behavior. + * + * @param The type of result. + * @param behaviorCommand The command of behavior. (NotNull) + * @return The instance of result. (Nullable) + */ + protected RESULT invoke(BehaviorCommand behaviorCommand) { + return _behaviorCommandInvoker.invoke(behaviorCommand); + } + //========================================================================== // ========= // Option Modified: board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/cbean/outsidesql/executor/OutsideSqlEntityExecutor.java =================================================================== --- board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/cbean/outsidesql/executor/OutsideSqlEntityExecutor.java 2008-12-27 22:06:42 UTC (rev 1624) +++ board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/cbean/outsidesql/executor/OutsideSqlEntityExecutor.java 2008-12-27 22:09:08 UTC (rev 1625) @@ -2,14 +2,16 @@ import java.util.List; +import jp.sf.pal.board.db.allcommon.bhv.core.BehaviorCommand; +import jp.sf.pal.board.db.allcommon.bhv.core.BehaviorCommandInvoker; +import jp.sf.pal.board.db.allcommon.bhv.core.command.OutsideSqlSelectListCommand; import jp.sf.pal.board.db.allcommon.cbean.ConditionBeanContext; -import jp.sf.pal.board.db.allcommon.cbean.outsidesql.OutsideSqlDao; import jp.sf.pal.board.db.allcommon.cbean.outsidesql.OutsideSqlOption; import jp.sf.pal.board.db.allcommon.jdbc.StatementConfig; import jp.sf.pal.board.db.allcommon.util.SimpleSystemUtil; /** - * The cursor executor of outside-sql. + * The cursor executor of outside-SQL. * * @param The type of parameter-bean. * @author DBFlute(AutoGenerator) @@ -20,18 +22,25 @@ // ========= // Attribute // ========= - protected final OutsideSqlDao _outsideSqlDao; + /** The invoker of behavior command. (NotNull) */ + protected final BehaviorCommandInvoker _behaviorCommandInvoker; + /** The option of outside-SQL. (NotNull) */ protected final OutsideSqlOption _outsideSqlOption; + /** The DB name of table. (NotNull) */ + protected final String _tableDbName; + //========================================================================== // ========= // Constructor // =========== - public OutsideSqlEntityExecutor(OutsideSqlDao outsideSqlDao, - OutsideSqlOption outsideSqlOption) { - this._outsideSqlDao = outsideSqlDao; + public OutsideSqlEntityExecutor( + BehaviorCommandInvoker behaviorCommandInvoker, + OutsideSqlOption outsideSqlOption, String tableDbName) { + this._behaviorCommandInvoker = behaviorCommandInvoker; this._outsideSqlOption = outsideSqlOption; + this._tableDbName = tableDbName; } //========================================================================== @@ -48,14 +57,14 @@ * @param entityType The type of entity. (NotNull) * @return The selected entity. (Nullable) * @exception jp.sf.pal.board.db.allcommon.exception.OutsideSqlNotFoundException - * When the outside-sql is not found. + * When the outside-SQL is not found. * @exception jp.sf.pal.board.db.allcommon.exception.EntityDuplicatedException * When the entity is duplicated. */ public ENTITY selectEntity(String path, PARAMETER_BEAN pmb, Class entityType) { - final List ls = _outsideSqlDao.selectList(path, pmb, - _outsideSqlOption, entityType); + final List ls = invoke(createSelectListCommand(path, pmb, + entityType)); if (ls.isEmpty()) { return null; } @@ -76,7 +85,7 @@ * @param entityType The type of entity. (NotNull) * @return The selected entity. (Nullable) * @exception jp.sf.pal.board.db.allcommon.exception.OutsideSqlNotFoundException - * When the outside-sql is not found. + * When the outside-SQL is not found. * @exception jp.sf.pal.board.db.allcommon.exception.EntityAlreadyDeletedException * When the entity has already been deleted(not found). * @exception jp.sf.pal.board.db.allcommon.exception.EntityDuplicatedException @@ -84,8 +93,8 @@ */ public ENTITY selectEntityWithDeletedCheck(String path, PARAMETER_BEAN pmb, Class entityType) { - final List ls = _outsideSqlDao.selectList(path, pmb, - _outsideSqlOption, entityType); + final List ls = invoke(createSelectListCommand(path, pmb, + entityType)); if (ls == null || ls.isEmpty()) { throwEntityAlreadyDeletedException(buildSearch4LogString(path, pmb, entityType)); @@ -127,6 +136,39 @@ //========================================================================== // ========= + // Behavior Command + // ================ + protected BehaviorCommand> createSelectListCommand( + String path, PARAMETER_BEAN pmb, Class entityType) { + return xsetupCommand(new OutsideSqlSelectListCommand(), path, + pmb, entityType); + } + + private OutsideSqlSelectListCommand xsetupCommand( + OutsideSqlSelectListCommand command, String path, + PARAMETER_BEAN pmb, Class entityType) { + command.setTableDbName(_tableDbName); + _behaviorCommandInvoker.injectComponentProperty(command); + command.setOutsideSqlPath(path); + command.setParameterBean(pmb); + command.setOutsideSqlOption(_outsideSqlOption); + command.setEntityType(entityType); + return command; + } + + /** + * Invoke the command of behavior. + * + * @param The type of result. + * @param behaviorCommand The command of behavior. (NotNull) + * @return The instance of result. (Nullable) + */ + protected RESULT invoke(BehaviorCommand behaviorCommand) { + return _behaviorCommandInvoker.invoke(behaviorCommand); + } + + //========================================================================== + // ========= // Option // ====== public OutsideSqlEntityExecutor configure( Modified: board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/cbean/outsidesql/executor/OutsideSqlPagingExecutor.java =================================================================== --- board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/cbean/outsidesql/executor/OutsideSqlPagingExecutor.java 2008-12-27 22:06:42 UTC (rev 1624) +++ board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/cbean/outsidesql/executor/OutsideSqlPagingExecutor.java 2008-12-27 22:09:08 UTC (rev 1625) @@ -3,18 +3,20 @@ import java.util.List; import jp.sf.pal.board.db.allcommon.DBFluteConfig; +import jp.sf.pal.board.db.allcommon.bhv.core.BehaviorCommand; +import jp.sf.pal.board.db.allcommon.bhv.core.BehaviorCommandInvoker; +import jp.sf.pal.board.db.allcommon.bhv.core.command.OutsideSqlSelectListCommand; import jp.sf.pal.board.db.allcommon.cbean.ListResultBean; import jp.sf.pal.board.db.allcommon.cbean.PagingBean; import jp.sf.pal.board.db.allcommon.cbean.PagingHandler; import jp.sf.pal.board.db.allcommon.cbean.PagingInvoker; import jp.sf.pal.board.db.allcommon.cbean.PagingResultBean; import jp.sf.pal.board.db.allcommon.cbean.ResultBeanBuilder; -import jp.sf.pal.board.db.allcommon.cbean.outsidesql.OutsideSqlDao; import jp.sf.pal.board.db.allcommon.cbean.outsidesql.OutsideSqlOption; import jp.sf.pal.board.db.allcommon.jdbc.StatementConfig; /** - * The paging executor of outsideSql. + * The paging executor of outside-SQL. * * @author DBFlute(AutoGenerator) */ @@ -24,10 +26,10 @@ // ========= // Attribute // ========= - /** The DAO of outsideSql. (NotNull) */ - protected final OutsideSqlDao _outsideSqlDao; + /** The invoker of behavior command. (NotNull) */ + protected final BehaviorCommandInvoker _behaviorCommandInvoker; - /** The option of outsideSql. (NotNull) */ + /** The option of outside-SQL. (NotNull) */ protected final OutsideSqlOption _outsideSqlOption; /** The DB name of table. (NotNull) */ @@ -37,9 +39,10 @@ // ========= // Constructor // =========== - public OutsideSqlPagingExecutor(OutsideSqlDao outsideSqlDao, + public OutsideSqlPagingExecutor( + BehaviorCommandInvoker behaviorCommandInvoker, OutsideSqlOption outsideSqlOption, String tableDbName) { - this._outsideSqlDao = outsideSqlDao; + this._behaviorCommandInvoker = behaviorCommandInvoker; this._outsideSqlOption = outsideSqlOption; this._tableDbName = tableDbName; } @@ -81,13 +84,13 @@ * @param entityType The type of result entity. (NotNull) * @return The result bean of paged list. (NotNull) * @exception com.example.dbflute.basic.dbflute.allcommon.exception.OutsideSqlNotFoundException - * When the outside-sql is not found. + * When the outside-SQL is not found. */ public ListResultBean selectList(String path, PagingBean pmb, Class entityType) { setupScrollableCursorIfNeeds(); - List resultList = _outsideSqlDao.selectList(path, pmb, - _outsideSqlOption, entityType); + List resultList = invoke(createSelectListCommand(path, pmb, + entityType)); return new ResultBeanBuilder(_tableDbName) .buildListResultBean(resultList); } @@ -141,7 +144,7 @@ * # -- ELSE select count(*) * # /[*]END[*]/ * # ... - * o It's S2Dao's restriction...Sorry + * o It's restriction...Sorry * * * @param The type of entity. @@ -150,14 +153,11 @@ * @param entityType The type of result entity. (NotNull) * @return The result bean of paging. (NotNull) * @exception jp.sf.pal.board.db.allcommon.exception.OutsideSqlNotFoundException - * When the outside-sql is not found. + * When the outside-SQL is not found. */ public PagingResultBean selectPage(final String path, final PagingBean pmb, final Class entityType) { - final OutsideSqlOption countOption = _outsideSqlOption - .copyOptionWithoutPaging(); - final OutsideSqlEntityExecutor countExecutor = new OutsideSqlEntityExecutor( - _outsideSqlDao, countOption); + final OutsideSqlEntityExecutor countExecutor = createCountExecutor(); final PagingHandler handler = new PagingHandler() { public PagingBean getPagingBean() { return pmb; @@ -182,6 +182,13 @@ return invoker.invokePaging(handler); } + protected OutsideSqlEntityExecutor createCountExecutor() { + final OutsideSqlOption countOption = _outsideSqlOption + .copyOptionWithoutPaging(); + return new OutsideSqlEntityExecutor( + _behaviorCommandInvoker, countOption, _tableDbName); + } + protected void setupScrollableCursorIfNeeds() { if (!_outsideSqlOption.isAutoPaging()) { return; @@ -207,6 +214,39 @@ //========================================================================== // ========= + // Behavior Command + // ================ + protected BehaviorCommand> createSelectListCommand( + String path, Object pmb, Class entityType) { + return xsetupCommand(new OutsideSqlSelectListCommand(), path, + pmb, entityType); + } + + private OutsideSqlSelectListCommand xsetupCommand( + OutsideSqlSelectListCommand command, String path, + Object pmb, Class entityType) { + command.setTableDbName(_tableDbName); + _behaviorCommandInvoker.injectComponentProperty(command); + command.setOutsideSqlPath(path); + command.setParameterBean(pmb); + command.setOutsideSqlOption(_outsideSqlOption); + command.setEntityType(entityType); + return command; + } + + /** + * Invoke the command of behavior. + * + * @param The type of result. + * @param behaviorCommand The command of behavior. (NotNull) + * @return The instance of result. (Nullable) + */ + protected RESULT invoke(BehaviorCommand behaviorCommand) { + return _behaviorCommandInvoker.invoke(behaviorCommand); + } + + //========================================================================== + // ========= // Option // ====== public OutsideSqlPagingExecutor configure(StatementConfig statementConfig) { Modified: board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/cbean/sqlclause/AbstractSqlClause.java =================================================================== --- board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/cbean/sqlclause/AbstractSqlClause.java 2008-12-27 22:06:42 UTC (rev 1624) +++ board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/cbean/sqlclause/AbstractSqlClause.java 2008-12-27 22:09:08 UTC (rev 1625) @@ -17,23 +17,23 @@ import jp.sf.pal.board.db.allcommon.dbmeta.DBMetaInstanceHandler; import jp.sf.pal.board.db.allcommon.dbmeta.info.ColumnInfo; import jp.sf.pal.board.db.allcommon.dbmeta.info.ForeignInfo; -import jp.sf.pal.board.db.allcommon.dbmeta.info.UniqueInfo; import jp.sf.pal.board.db.allcommon.util.SimpleAssertUtil; import jp.sf.pal.board.db.allcommon.util.SimpleStringUtil; import jp.sf.pal.board.db.allcommon.util.SimpleSystemUtil; /** - * The abstract class of SqlClause. + * The abstract class of SQL clause. * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public abstract class AbstractSqlClause implements SqlClause { //========================================================================== // ========= // Definition // ========== + protected static final SelectClauseType DEFAULT_SELECT_CLAUSE_TYPE = SelectClauseType.COLUMNS; + protected static final String SELECT_HINT = "/*$dto.selectHint*/"; //========================================================================== @@ -43,12 +43,16 @@ // ----------------------------------------------------- // Basic // ----- - /** Target table name. */ + /** The name of table. */ protected final String _tableName; // ----------------------------------------------------- // Clause Resource // --------------- + // /- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + // - + // The resources that are not often used to are lazy-loaded for performance. + // - - - - - - - - - -/ /** * Selected select column map. map:{tableAliasName : map:{columnName : * selectColumnInfo}} @@ -57,48 +61,48 @@ /** * Specified select column map. map:{ tableAliasName = map:{ columnName : - * null } } + * null } } (Nullable: This is lazy-loaded) */ - protected Map> _specifiedSelectColumnMap;// [ + protected Map> _specifiedSelectColumnMap; // [ // DBFlute // - - // 0.7.4 - // ] + // 0.7 + // .4] - /** Specified derive sub-query map. */ - protected Map _specifiedDeriveSubQueryMap;// [DBFlute-0.7.4] + /** Specified derive sub-query map. (Nullable: This is lazy-loaded) */ + protected Map _specifiedDeriveSubQueryMap; //[DBFlute-0.7.4] - /** Included select column map. */ - protected Map _includedSelectColumnMap = new LinkedHashMap(); - /** * The map of real column and alias of select clause. map:{realColumnName : * aliasName} */ - protected Map _selectClauseRealColumnAliasMap = new HashMap();// Without + protected Map _selectClauseRealColumnAliasMap = new HashMap(); // Without // linked // ! + /** The type of select clause. (NotNull) */ + protected SelectClauseType _selectClauseType = DEFAULT_SELECT_CLAUSE_TYPE; + + /** The previous type of select clause. (Nullable: The default is null) */ + protected SelectClauseType _previousSelectClauseType; + /** Outer join map. */ protected Map _outerJoinMap = new LinkedHashMap(); - /** Where list. */ + /** The list of where clause. */ protected List _whereList = new ArrayList(); /** Inline where list for BaseTable. */ protected List _baseTableInlineWhereList = new ArrayList(); - /** Order-by clause. */ + /** The clause of order-by. (NotNull) */ protected final OrderByClause _orderByClause = new OrderByClause(); - /** Union clause list. */ - protected List _unionQueryInfoList = new ArrayList(); + /** The list of union clause. (Nullable: This is lazy-loaded) */ + protected List _unionQueryInfoList; - /** Is included-select-column effective? Default value is false. */ - protected boolean _isIncludedSelectColumnEffective = false; - /** Is order-by effective? Default value is false. */ protected boolean _isOrderByEffective = false; @@ -138,7 +142,7 @@ // ----------------------------------------------------- // Optional Info // ------------- - protected boolean _formatClause; + protected boolean _formatClause = true; //========================================================================== // ========= @@ -163,28 +167,20 @@ StringBuilder sb = new StringBuilder(512); sb.append(getSelectClause()); sb.append(" "); - sb.append(buildClauseWithoutMainSelect(false)); + sb.append(buildClauseWithoutMainSelect()); String sql = sb.toString(); - return filterSubQueryIndent(sql); + sql = filterUnionCountOrScalar(sql); + sql = filterSubQueryIndent(sql); + return sql; } - public String getClausePKOnly() { + protected String buildClauseWithoutMainSelect() { StringBuilder sb = new StringBuilder(512); - sb.append(getSelectClausePKOnly()); - sb.append(" "); - sb.append(buildClauseWithoutMainSelect(true)); - String sql = sb.toString(); - return filterSubQueryIndent(sql); - } - - protected String buildClauseWithoutMainSelect(boolean pkonly) { - StringBuilder sb = new StringBuilder(512); sb.append(getFromClause()); sb.append(getFromHint()); sb.append(" "); sb.append(getWhereClause()); - String unionClause = buildUnionClause(pkonly ? getSelectClausePKOnly() - : getSelectClause()); + String unionClause = buildUnionClause(getSelectClause()); // Delete template mark! (At the future this will be unnecessary.) unionClause = replaceString(unionClause, getUnionWhereClauseMark(), "");// Required @@ -225,29 +221,45 @@ protected String buildUnionClause(String selectClause) { StringBuilder sb = new StringBuilder(); - for (final Iterator ite = _unionQueryInfoList - .iterator(); ite.hasNext();) { - final UnionQueryInfo unionQueryInfo = (UnionQueryInfo) ite.next(); - final String unionQueryClause = unionQueryInfo - .getUnionQueryClause(); - final boolean unionAll = unionQueryInfo.isUnionAll(); - if (isFormatClauseEffective()) { + if (hasUnionQuery()) { + for (Iterator ite = _unionQueryInfoList.iterator(); ite + .hasNext();) { + UnionQueryInfo unionQueryInfo = (UnionQueryInfo) ite.next(); + String unionQueryClause = unionQueryInfo.getUnionQueryClause(); + boolean unionAll = unionQueryInfo.isUnionAll(); sb.append(getLineSeparator()); - } - sb.append(unionAll ? " union all " : " union "); - if (isFormatClauseEffective()) { + sb.append(unionAll ? " union all " : " union "); sb.append(getLineSeparator()); + sb.append(selectClause).append(" ").append(unionQueryClause); } - sb.append(selectClause).append(" ").append(unionQueryClause); } return sb.toString(); } + protected String filterUnionCountOrScalar(String sql) { + if (!isSelectClauseTypeCountOrScalar() || !hasUnionQuery()) { + return sql; + } + String selectClause = buildSelectClauseCountOrScalar("dfmain"); + String ln = getLineSeparator(); + String beginMark = resolveSubQueryBeginMark("dfmain") + ln; + String endMark = resolveSubQueryEndMark("dfmain"); + return selectClause + ln + " from (" + beginMark + sql + ln + + " ) dfmain" + endMark; + } + //========================================================================== // ========= // Clause Parts // ============ public String getSelectClause() { + // [DBFlute-0.8.6] + if (isSelectClauseTypeCountOrScalar() && !hasUnionQuery()) { + return buildSelectClauseCountOrScalar("dflocal"); + } + // /- - - - - - - - - - - - - - - - - - - - - - - - + // The type of select clause is COLUMNS since here. + // - - - - - - - - - -/ StringBuilder sb = new StringBuilder(); DBMeta dbmeta = DBMetaInstanceHandler.findDBMeta(_tableName); List columnInfoList = dbmeta.getColumnInfoList(); @@ -265,7 +277,19 @@ // [DBFlute-0.7.4] if (existsSpecifiedLocal && !localSpecifiedMap.containsKey(columnName)) { - continue; + if (isSelectClauseTypeCountOrScalar() && hasUnionQuery()) { + // Here it must be with union query. + // So the primary Key is target for saving unique. + // But if it does not have primary keys, all column is + // target. + if (dbmeta.hasPrimaryKey()) { + if (!columnInfo.isPrimary()) { + continue; + } + } + } else { + continue; + } } if (sb.length() > 0) { @@ -307,10 +331,6 @@ selectColumnInfo.getColumnAliasName()); } } - if (_isIncludedSelectColumnEffective - && !_includedSelectColumnMap.isEmpty()) { - sb.append(getIncludedSelectColumnClause()); - } // [DBFlute-0.7.4] if (_specifiedDeriveSubQueryMap != null @@ -318,9 +338,7 @@ Collection deriveSubQuerySet = _specifiedDeriveSubQueryMap .values(); for (String deriveSubQuery : deriveSubQuerySet) { - if (isFormatClauseEffective()) { - sb.append(getLineSeparator()).append(" "); - } + sb.append(getLineSeparator()).append(" "); sb.append(", ").append(deriveSubQuery); } } @@ -328,67 +346,83 @@ return sb.toString(); } - public String getSelectClausePKOnly() { - StringBuilder sb = new StringBuilder(); - DBMeta dbmeta = DBMetaInstanceHandler.findDBMeta(_tableName); - UniqueInfo uniqueInfo = dbmeta.getPrimaryUniqueInfo(); - List columnInfoList = uniqueInfo.getUniqueColumnList(); - for (ColumnInfo columnInfo : columnInfoList) { - String columnName = columnInfo.getColumnDbName(); - if (sb.length() > 0) { - sb.append(", "); - } else { - sb.append("select").append(SELECT_HINT).append(" "); - } - String realColumnName = getLocalTableAliasName() + "." + columnName; - sb.append(realColumnName).append(" as ").append(columnName); - _selectClauseRealColumnAliasMap.put(realColumnName, columnName); + protected boolean isSelectClauseTypeCountOrScalar() { + if (_selectClauseType.equals(SelectClauseType.COUNT)) { + return true; + } else if (_selectClauseType.equals(SelectClauseType.MAX)) { + return true; + } else if (_selectClauseType.equals(SelectClauseType.MIN)) { + return true; + } else if (_selectClauseType.equals(SelectClauseType.SUM)) { + return true; + } else if (_selectClauseType.equals(SelectClauseType.AVG)) { + return true; } - if (_isIncludedSelectColumnEffective - && !_includedSelectColumnMap.isEmpty()) { - sb.append(getIncludedSelectColumnClause()); - } + return false; + } - // [DBFlute-0.7.4] - if (_specifiedDeriveSubQueryMap != null - && !_specifiedDeriveSubQueryMap.isEmpty()) { - Collection deriveSubQuerySet = _specifiedDeriveSubQueryMap - .values(); - for (String deriveSubQuery : deriveSubQuerySet) { - if (isFormatClauseEffective()) { - sb.append(getLineSeparator()).append(" "); - } - sb.append(", ").append(deriveSubQuery); - } + protected String buildSelectClauseCountOrScalar(String aliasName) { + if (_selectClauseType.equals(SelectClauseType.COUNT)) { + return buildSelectClauseCount(); + } else if (_selectClauseType.equals(SelectClauseType.MAX)) { + return buildSelectClauseMax(aliasName); + } else if (_selectClauseType.equals(SelectClauseType.MIN)) { + return buildSelectClauseMin(aliasName); + } else if (_selectClauseType.equals(SelectClauseType.SUM)) { + return buildSelectClauseSum(aliasName); + } else if (_selectClauseType.equals(SelectClauseType.AVG)) { + return buildSelectClauseAvg(aliasName); } + String msg = "The type of select clause is not for scalar:"; + msg = msg + " type=" + _selectClauseType; + throw new IllegalStateException(msg); + } - return sb.toString(); + protected String buildSelectClauseCount() { + return "select count(*)"; } - public String getSelectHint() { - return createSelectHint(); + protected String buildSelectClauseMax(String aliasName) { + String columnName = getSpecifiedColumnNameAsOne(); + assertScalarSelectSpecifiedColumnOnlyOne(columnName); + return "select max(" + aliasName + "." + columnName + ")"; } - public String getIncludedSelectColumnClause() { - StringBuilder sb = new StringBuilder(); - int count = 0; - for (Iterator ite = _includedSelectColumnMap.keySet() - .iterator(); ite.hasNext(); count++) { - String aliasName = ite.next(); - String realColumnName = (String) _includedSelectColumnMap - .get(aliasName); - sb.append(", ").append(realColumnName).append(" as ").append( - aliasName); - _selectClauseRealColumnAliasMap.put(realColumnName, aliasName); + protected String buildSelectClauseMin(String aliasName) { + String columnName = getSpecifiedColumnNameAsOne(); + assertScalarSelectSpecifiedColumnOnlyOne(columnName); + return "select min(" + aliasName + "." + columnName + ")"; + } + + protected String buildSelectClauseSum(String aliasName) { + String columnName = getSpecifiedColumnNameAsOne(); + assertScalarSelectSpecifiedColumnOnlyOne(columnName); + return "select sum(" + aliasName + "." + columnName + ")"; + } + + protected String buildSelectClauseAvg(String aliasName) { + String columnName = getSpecifiedColumnNameAsOne(); + assertScalarSelectSpecifiedColumnOnlyOne(columnName); + return "select avg(" + aliasName + "." + columnName + ")"; + } + + protected void assertScalarSelectSpecifiedColumnOnlyOne(String columnName) { + if (columnName != null) { + return; } - return sb.toString(); + String msg = "The specified column exists one"; + msg = msg + " when the type of select clause is for scalar:"; + msg = msg + " specifiedSelectColumnMap=" + _specifiedSelectColumnMap; + throw new IllegalStateException(msg); } + public String getSelectHint() { + return createSelectHint(); + } + public String getFromClause() { StringBuilder sb = new StringBuilder(); - if (isFormatClauseEffective()) { - sb.append(getLineSeparator()).append(" "); - } + sb.append(getLineSeparator()).append(" "); sb.append("from "); if (_baseTableInlineWhereList.isEmpty()) { sb.append(_tableName).append(" dflocal"); @@ -417,9 +451,7 @@ Map joinOnMap = joinInfo.getJoinOnMap(); assertJoinOnMapNotEmpty(joinOnMap, aliasName); - if (isFormatClauseEffective()) { - sb.append(getLineSeparator()).append(" "); - } + sb.append(getLineSeparator()).append(" "); sb.append(" left outer join "); if (inlineWhereClauseList.isEmpty()) { sb.append(joinTableName); @@ -489,16 +521,12 @@ String clauseElement = (String) ite.next(); clauseElement = filterWhereClauseSimply(clauseElement); if (count == 0) { - if (isFormatClauseEffective()) { - sb.append(getLineSeparator()).append(" "); - } + sb.append(getLineSeparator()).append(" "); sb.append("where ").append( template ? getWhereFirstConditionMark() : "").append( clauseElement); } else { - if (isFormatClauseEffective()) { - sb.append(getLineSeparator()).append(" "); - } + sb.append(getLineSeparator()).append(" "); sb.append(" and ").append(clauseElement); } } @@ -510,7 +538,7 @@ public String getOrderByClause() { String orderByClause = null; - if (!_unionQueryInfoList.isEmpty()) { + if (hasUnionQuery()) { if (_selectClauseRealColumnAliasMap == null || _selectClauseRealColumnAliasMap.isEmpty()) { String msg = "The selectClauseColumnAliasMap should not be null or empty when union query exists: " @@ -522,8 +550,7 @@ } else { orderByClause = _orderByClause.getOrderByClause(); } - if (isFormatClauseEffective() && orderByClause != null - && orderByClause.trim().length() > 0) { + if (orderByClause != null && orderByClause.trim().length() > 0) { return getLineSeparator() + " " + orderByClause; } else { return orderByClause; @@ -532,8 +559,7 @@ public String getSqlSuffix() { String sqlSuffix = createSqlSuffix(); - if (isFormatClauseEffective() && sqlSuffix != null - && sqlSuffix.trim().length() > 0) { + if (sqlSuffix != null && sqlSuffix.trim().length() > 0) { return getLineSeparator() + sqlSuffix; } else { return sqlSuffix; @@ -542,20 +568,6 @@ //========================================================================== // ========= - // Copy Parts - // ========== - public void copyIncludedSelectColumn(SqlClause sqlClause) { - Set keySet = _includedSelectColumnMap.keySet(); - for (Iterator ite = keySet.iterator(); ite.hasNext();) { - String aliasName = ite.next(); - String realColumnName = (String) _includedSelectColumnMap - .get(aliasName); - sqlClause.registerIncludedSelectColumn(aliasName, realColumnName); - } - } - - //========================================================================== - // ========= // SelectedSelectColumn // ==================== /** @@ -644,26 +656,6 @@ //========================================================================== // ========= - // IncludedSelectColumn - // ==================== - public void ignoreIncludedSelectColumn() { - _isIncludedSelectColumnEffective = false; - } - - public void makeIncludedSelectColumnEffective() { - if (!_includedSelectColumnMap.isEmpty()) { - _isIncludedSelectColumnEffective = true; - } - } - - public void registerIncludedSelectColumn(String aliasName, - String realColumnName) { - _isIncludedSelectColumnEffective = true; - _includedSelectColumnMap.put(aliasName, realColumnName); - } - - //========================================================================== - // ========= // OuterJoin // ========= public void registerOuterJoin(String joinTableName, String aliasName, @@ -1079,12 +1071,23 @@ public void registerUnionQuery(String unionQueryClause, boolean unionAll) { assertStringNotNullAndNotTrimmedEmpty("unionQueryClause", unionQueryClause); - final UnionQueryInfo unionQueryInfo = new UnionQueryInfo(); + UnionQueryInfo unionQueryInfo = new UnionQueryInfo(); unionQueryInfo.setUnionQueryClause(unionQueryClause); unionQueryInfo.setUnionAll(unionAll); + addUnionQueryInfo(unionQueryInfo); + } + + protected void addUnionQueryInfo(UnionQueryInfo unionQueryInfo) { + if (_unionQueryInfoList == null) { + _unionQueryInfoList = new ArrayList(); + } _unionQueryInfoList.add(unionQueryInfo); } + public boolean hasUnionQuery() { + return _unionQueryInfoList != null && !_unionQueryInfoList.isEmpty(); + } + protected static class UnionQueryInfo { protected String _unionQueryClause; @@ -1425,18 +1428,6 @@ //========================================================================== // ========= - // Format Clause - // ============= - public boolean isFormatClauseEffective() { - return _formatClause; - } - - public void makeFormatClauseEffective() { - _formatClause = true; - } - - //========================================================================== - // ========= // Sub Query Indent // ================ public String resolveSubQueryBeginMark(String subQueryIdentity) { @@ -1462,13 +1453,11 @@ } public String filterSubQueryIndent(String sql) { - return isFormatClauseEffective() ? filterSubQueryIndent(sql, "") : sql; + return filterSubQueryIndent(sql, "", sql); } - protected String filterSubQueryIndent(String sql, String preIndent) { - if (!isFormatClauseEffective()) { - return sql; - } + protected String filterSubQueryIndent(String sql, String preIndent, + String originalSql) { final String lineSeparator = getLineSeparator(); if (!sql.contains(getSubQueryBeginMarkPrefix())) { return sql; @@ -1509,7 +1498,8 @@ // - - - - - - - - // In begin to end // - - - - - - - - - if (line.contains(endMarkPrefix + subQueryIdentity)) {// The end + if (line.contains(endMarkPrefix + subQueryIdentity)) { // The + // end final int markIndex = line.indexOf(endMarkPrefix); final int terminalIndex = line.indexOf(identityTerminal); if (terminalIndex < 0) { @@ -1521,7 +1511,7 @@ + line.substring(terminalIndex + terminalLength); subSb.append(clause).append(getLineSeparator()); final String currentSql = filterSubQueryIndent(subSb - .toString(), preIndent + indent); + .toString(), preIndent + indent, originalSql); mainSb.append(currentSql); throughBegin = false; throughBeginFirst = false; @@ -1544,10 +1534,11 @@ + getLineSeparator(); msg = msg + subQueryIdentity + getLineSeparator(); msg = msg + getLineSeparator() + "[Before Filter]" - + getLineSeparator(); - msg = msg + sql + getLineSeparator(); + + getLineSeparator() + sql; msg = msg + getLineSeparator() + "[After Filter]" + getLineSeparator() + filteredSql; + msg = msg + getLineSeparator() + "[Original SQL]" + + getLineSeparator() + originalSql; throw new SubQueryIndentFailureException(msg); } if (filteredSql.contains(beginMarkPrefix)) { @@ -1556,10 +1547,11 @@ + getLineSeparator(); msg = msg + subQueryIdentity + getLineSeparator(); msg = msg + getLineSeparator() + "[Before Filter]" - + getLineSeparator(); - msg = msg + sql + getLineSeparator(); + + getLineSeparator() + sql; msg = msg + getLineSeparator() + "[After Filter]" + getLineSeparator() + filteredSql; + msg = msg + getLineSeparator() + "[Original SQL]" + + getLineSeparator() + originalSql; throw new SubQueryIndentFailureException(msg); } return filteredSql; @@ -1592,7 +1584,7 @@ } if (!_specifiedSelectColumnMap.containsKey(tableAliasName)) { _specifiedSelectColumnMap.put(tableAliasName, - new HashMap()); + new LinkedHashMap()); } Map elementMap = _specifiedSelectColumnMap .get(tableAliasName); @@ -1666,10 +1658,7 @@ getUnionWhereFirstConditionMark(), ""); final StringBuilder sb = new StringBuilder(); - String ln = ""; - if (isFormatClauseEffective()) { - ln = getLineSeparator(); - } + String ln = getLineSeparator(); sb.append("update ").append(_tableName).append(ln); int index = 0; // It is guaranteed that the map has one or more elements. @@ -1728,10 +1717,7 @@ final String subQuery = filterSubQueryIndent(selectClause + " " + fromWhereClause); final StringBuilder sb = new StringBuilder(); - String ln = ""; - if (isFormatClauseEffective()) { - ln = getLineSeparator(); - } + String ln = getLineSeparator(); sb.append("delete from ").append(_tableName).append(ln); sb.append(" where ").append(primaryKeyName); sb.append(" in (").append(ln).append(subQuery).append(ln).append( @@ -1760,6 +1746,29 @@ return false; } + // [DBFlute-0.8.6] + //========================================================================== + // ========= + // Select Clause Type + // ================== + public void classifySelectClauseType(SelectClauseType selectClauseType) { + changeSelectClauseType(selectClauseType); + } + + protected void changeSelectClauseType(SelectClauseType selectClauseType) { + savePreviousSelectClauseType(); + _selectClauseType = selectClauseType; + } + + protected void savePreviousSelectClauseType() { + _previousSelectClauseType = _selectClauseType; + } + + public void rollbackSelectClauseType() { + _selectClauseType = _previousSelectClauseType != null ? _previousSelectClauseType + : DEFAULT_SELECT_CLAUSE_TYPE; + } + // [DBFlute-0.7.5] //========================================================================== // ========= Modified: board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/cbean/sqlclause/SqlClause.java =================================================================== --- board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/cbean/sqlclause/SqlClause.java 2008-12-27 22:06:42 UTC (rev 1624) +++ board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/cbean/sqlclause/SqlClause.java 2008-12-27 22:09:08 UTC (rev 1625) @@ -7,7 +7,7 @@ import jp.sf.pal.board.db.allcommon.cbean.cvalue.ConditionValue; /** - * The interface of SQL-clause. + * The interface of SQL clause. * * @author DBFlute(AutoGenerator) */ @@ -35,21 +35,6 @@ */ public String getClause(); - /** - * Get clause of all parts as PK-only. - * - *
-     * # 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
-     * 
- * - * @return The clause of all parts as PK-Only. (NotNull) - */ - public String getClausePKOnly(); - // ----------------------------------------------------- // Fragment Clause // --------------- @@ -92,14 +77,6 @@ public String getSelectClause(); /** - * Get The clause of 'select' as PK-only. This is an internal method. - * - * @return The clause of select PK-only. {[select ...] from table...} - * (NotNull) - */ - public String getSelectClausePKOnly(); - - /** * Get the hint of 'select'. This is an internal method. * * @return The hint of 'select'. {select [select-hint] * from table...} @@ -108,14 +85,6 @@ public String getSelectHint(); /** - * Get the clause of included-select-column. This is an internal method. - * - * @return The clause of included-select-column. {select ... , - * [included-select-column clause] from table...} (NotNull) - */ - public String getIncludedSelectColumnClause(); - - /** * Get the clause of 'from'. This is an internal method. * * @return The clause of 'from'. (NotNull) @@ -162,17 +131,6 @@ //========================================================================== // ========= - // Copy Parts - // ========== - /** - * Copy included-select-column. - * - * @param sqlClause SQL-clause. (NotNull) - */ - public void copyIncludedSelectColumn(SqlClause sqlClause); - - //========================================================================== - // ========= // SelectedSelectColumn // ==================== /** @@ -189,30 +147,6 @@ //========================================================================== // ========= - // IncludedSelectColumn - // ==================== - /** - * Ignore included-select-column. - */ - public void ignoreIncludedSelectColumn(); - - /** - * Make included-select-column effective. - */ - public void makeIncludedSelectColumnEffective(); - - /** - * Register included-select-column. - * - * @param aliasName The alias name of the included-select-column. (NotNull) - * @param realColumnName The real column name of the included-select-column. - * (NotNull) - */ - public void registerIncludedSelectColumn(String aliasName, - String realColumnName); - - //========================================================================== - // ========= // OuterJoin // ========= /** @@ -340,6 +274,8 @@ // ===== public void registerUnionQuery(String unionClause, boolean unionAll); + public boolean hasUnionQuery(); + //========================================================================== // ========= // FetchScope @@ -561,14 +497,6 @@ //========================================================================== // ========= - // Format Clause - // ============= - public boolean isFormatClauseEffective(); - - public void makeFormatClauseEffective(); - - //========================================================================== - // ========= // Sub Query Indent // ================ public String resolveSubQueryBeginMark(String subQueryIdentity); @@ -588,8 +516,17 @@ public boolean hasSpecifiedDeriveSubQuery(String aliasName); + /** + * Get the name of only one specified column. + * + * @return The name of only one specified column. (Nullable: If it's not + * found or duplicated, it returns null) + */ public String getSpecifiedColumnNameAsOne(); + /** + * Clear specified select columns. + */ public void clearSpecifiedSelectColumn(); // [DBFlute-0.7.5] @@ -621,4 +558,29 @@ */ public boolean isUniqueConstraintException(String sqlState, Integer errorCode); + + // [DBFlute-0.8.6] + //========================================================================== + // ========= + // Select Clause Type + // ================== + /** + * Classify the type of select clause into specified type. + * + * @param selectClauseType The type of select clause. (NotNull) + */ + public void classifySelectClauseType(SelectClauseType selectClauseType); + + /** + * Roll-back the type of select clause into previous one. If it has no + * change, classify its type into default type. + */ + public void rollbackSelectClauseType(); + + /** + * The type of select clause. + */ + public static enum SelectClauseType { + COLUMNS, COUNT, MAX, MIN, SUM, AVG + } } Modified: board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/cbean/sqlclause/SqlClauseOracle.java =================================================================== --- board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/cbean/sqlclause/SqlClauseOracle.java 2008-12-27 22:06:42 UTC (rev 1624) +++ board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/cbean/sqlclause/SqlClauseOracle.java 2008-12-27 22:09:08 UTC (rev 1625) @@ -71,12 +71,7 @@ if (!isFetchStartIndexSupported() && !isFetchSizeSupported()) { return; } - String ln = null; - if (isFormatClauseEffective()) { - ln = getLineSeparator(); - } else { - ln = ""; - } + String ln = getLineSeparator(); _fetchScopeSelectHint = " * from (select base.*, rownum as rn from (" + ln + "select"; _fetchScopeSqlSuffix = ""; Modified: board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/dbmeta/AbstractDBMeta.java =================================================================== --- board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/dbmeta/AbstractDBMeta.java 2008-12-27 22:06:42 UTC (rev 1624) +++ board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/dbmeta/AbstractDBMeta.java 2008-12-27 22:09:08 UTC (rev 1625) @@ -5,12 +5,11 @@ import java.util.Collection; import java.util.Collections; import java.util.HashMap; -import java.util.HashSet; import java.util.Iterator; import java.util.LinkedHashMap; import java.util.List; import java.util.Map; -import java.util.Set; +import java.util.concurrent.ConcurrentHashMap; import jp.sf.pal.board.db.allcommon.Entity; import jp.sf.pal.board.db.allcommon.dbmeta.info.ColumnInfo; @@ -22,6 +21,7 @@ import jp.sf.pal.board.db.allcommon.helper.MapListStringImpl; import jp.sf.pal.board.db.allcommon.helper.MapStringBuilder; import jp.sf.pal.board.db.allcommon.helper.MapStringBuilderImpl; +import jp.sf.pal.board.db.allcommon.helper.StringKeyMap; import jp.sf.pal.board.db.allcommon.util.SimpleAssertUtil; import jp.sf.pal.board.db.allcommon.util.SimpleStringUtil; import jp.sf.pal.board.db.allcommon.util.SimpleSystemUtil; @@ -31,68 +31,113 @@ * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public abstract class AbstractDBMeta implements DBMeta { //========================================================================== // ========= + // Definition + // ========== + protected static final Object DUMMY_VALUE = new Object(); + + //========================================================================== + // ========= // Attribute // ========= - protected List _columnInfoList; + // ----------------------------------------------------- + // Information Resource + // -------------------- + // Initialized at its getter. + private StringKeyMap _tableDbNameFlexibleMap; + private StringKeyMap _tablePropertyNameFlexibleMap; + + private List _columnInfoList; + + private StringKeyMap _columnInfoFlexibleMap; + + // Initialized at hasMethod(). + private Map _methodNameMap = newConcurrentHashMap(); + //========================================================================== // ========= + // Table Info + // ========== + /** + * Get the flexible map of table DB name. + * + * @return The flexible map of table DB name. (NotNull, NotEmpty) + */ + protected Map getTableDbNameFlexibleMap() { + if (_tableDbNameFlexibleMap != null) { + return _tableDbNameFlexibleMap; + } + synchronized (this) { + if (_tableDbNameFlexibleMap != null) { + return _tableDbNameFlexibleMap; + } + _tableDbNameFlexibleMap = StringKeyMap.createAsFlexibleConcurrent(); + _tableDbNameFlexibleMap.put(getTableDbName(), getTableDbName()); + return _tableDbNameFlexibleMap; + } + } + + /** + * Get the flexible map of table property name. + * + * @return The flexible map of table property name. (NotNull, NotEmpty) + */ + protected Map getTablePropertyNameFlexibleMap() { + if (_tablePropertyNameFlexibleMap != null) { + return _tablePropertyNameFlexibleMap; + } + synchronized (this) { + if (_tablePropertyNameFlexibleMap != null) { + return _tablePropertyNameFlexibleMap; + } + _tablePropertyNameFlexibleMap = StringKeyMap + .createAsFlexibleConcurrent(); + _tablePropertyNameFlexibleMap.put(getTableDbName(), + getTablePropertyName()); + return _tableDbNameFlexibleMap; + } + } + + //========================================================================== + // ========= // Column Info // =========== /** * The implementation. * - * @param columnFlexibleName The flexible name of the column. (NotNull) + * @param columnFlexibleName The flexible name(IgnoreCase, IgnoreUnderscore) + * of the column. (NotNull, NotEmpty) * @return Determination. */ public boolean hasColumn(String columnFlexibleName) { - if (!hasFlexibleName(columnFlexibleName)) { - return false; - } - final String propertyName = findPropertyName(columnFlexibleName); - return hasMethod("column" + initCap(propertyName)); + assertStringNotNullAndNotTrimmedEmpty("columnFlexibleName", + columnFlexibleName); + return getColumnInfoFlexibleMap().containsKey(columnFlexibleName); } /** * The implementation. * - * @param columnFlexibleName The flexible name of the column. (NotNull and - * NotEmpty) + * @param columnFlexibleName The flexible name(IgnoreCase, IgnoreUnderscore) + * of the column. (NotNull, NotEmpty) * @return The information of the column. (NotNull) */ public ColumnInfo findColumnInfo(String columnFlexibleName) { assertStringNotNullAndNotTrimmedEmpty("columnFlexibleName", columnFlexibleName); - if (!hasColumn(columnFlexibleName)) { + final ColumnInfo columnInfo = getColumnInfoFlexibleMap().get( + columnFlexibleName); + if (columnInfo == null) { String msg = "Not found column by columnFlexibleName: " + columnFlexibleName; msg = msg + " tableName=" + getTableDbName(); throw new IllegalArgumentException(msg); } - String methodName = "column" - + initCap(findPropertyName(columnFlexibleName)); - Method method = null; - try { - method = this.getClass().getMethod(methodName, new Class[] {}); - } catch (NoSuchMethodException e) { - String msg = "Not found column by columnFlexibleName: " - + columnFlexibleName; - msg = msg + " tableName=" + getTableDbName() + " methodName=" - + methodName; - throw new RuntimeException(msg, e); - } - try { - return (ColumnInfo) method.invoke(this, new Object[] {}); - } catch (IllegalAccessException e) { - throw new RuntimeException(e); - } catch (java.lang.reflect.InvocationTargetException e) { - throw new RuntimeException(e.getCause()); - } + return columnInfo; } protected ColumnInfo cci(String columnDbName, String propertyName, @@ -114,7 +159,7 @@ /** * The implementation. * - * @return The list of columns. (NotNull and NotEmpty) + * @return The list of columns. (NotNull, NotEmpty) */ public List getColumnInfoList() { if (_columnInfoList != null) { @@ -144,79 +189,118 @@ } } - protected void initializeColumnInfoList() { - getColumnInfoList();// Ignore return value because of initialization - // only! + /** + * Get the flexible map of column information. + * + * @return The flexible map of column information. (NotNull, NotEmpty) + */ + protected Map getColumnInfoFlexibleMap() { + if (_columnInfoFlexibleMap != null) { + return _columnInfoFlexibleMap; + } + final List columnInfoList = getColumnInfoList(); + synchronized (this) { + if (_columnInfoFlexibleMap != null) { + return _columnInfoFlexibleMap; + } + _columnInfoFlexibleMap = StringKeyMap.createAsFlexibleConcurrent(); + for (ColumnInfo columnInfo : columnInfoList) { + _columnInfoFlexibleMap.put(columnInfo.getColumnDbName(), + columnInfo); + } + return _columnInfoFlexibleMap; + } } //========================================================================== - // =========== + // ========= + // Resource Initialization + // ======================= + protected void initializeInformationResource() { // for instance initializer + // of subclass. + // Initialize the flexible map of table DB name. + getTableDbNameFlexibleMap(); + + // Initialize the flexible map of table property name. + getTablePropertyNameFlexibleMap(); + + // Initialize the list of column information. + getColumnInfoList(); + + // Initialize the flexible map of column information. + getColumnInfoFlexibleMap(); + + // Initialize the map of (public)method name. + hasMethod("dummy"); + } + + //========================================================================== + // ========= // Name Handling // ============= /** * The implementation. * - * @param flexibleName Flexible-name(IgnoreCase). (NotNull and NotEmpty) + * @param flexibleName The flexible name(IgnoreCase, IgnoreUnderscore). + * (NotNull, NotEmpty) * @return Determination. */ public boolean hasFlexibleName(String flexibleName) { - final String key = flexibleName.toLowerCase(); - if (getDbNamePropertyNameKeyToLowerMap().containsKey(key)) { - return true; - } - if (getPropertyNameDbNameKeyToLowerMap().containsKey(key)) { - return true; - } - return false; + assertStringNotNullAndNotTrimmedEmpty("flexibleName", flexibleName); + + // It uses column before table because column is used much more than + // table. + // This is the same consideration at other methods. + return getColumnInfoFlexibleMap().containsKey(flexibleName) + || getTableDbNameFlexibleMap().containsKey(flexibleName); } /** * The implementation. * - * @param flexibleName Flexible-name(IgnoreCase). (NotNull and NotEmpty) - * @return DB name. (NotNull and NotEmpty) + * @param flexibleName The flexible name(IgnoreCase, IgnoreUnderscore). + * (NotNull, NotEmpty) + * @return DB name. (NotNull, NotEmpty) */ public String findDbName(String flexibleName) { - final String key = flexibleName.toLowerCase(); - if (getPropertyNameDbNameKeyToLowerMap().containsKey(key)) { - return (String) getPropertyNameDbNameKeyToLowerMap().get(key); + assertStringNotNullAndNotTrimmedEmpty("flexibleName", flexibleName); + final ColumnInfo columnInfoMap = getColumnInfoFlexibleMap().get( + flexibleName); + if (columnInfoMap != null) { + return columnInfoMap.getColumnDbName(); } - if (getDbNamePropertyNameKeyToLowerMap().containsKey(key)) { - final String dbNameKeyToLower = ((String) getDbNamePropertyNameKeyToLowerMap() - .get(key)).toLowerCase(); - if (getPropertyNameDbNameKeyToLowerMap().containsKey( - dbNameKeyToLower)) { - return (String) getPropertyNameDbNameKeyToLowerMap().get( - dbNameKeyToLower); - } + final String tableDbName = getTableDbNameFlexibleMap() + .get(flexibleName); + if (tableDbName != null) { + return tableDbName; } - String msg = "Not found object by the flexible name: flexibleName=" + String msg = "Not found DB name by the flexible name: flexibleName=" + flexibleName; - throw new IllegalStateException(msg); + throw new IllegalArgumentException(msg); } /** * The implementation. * - * @param flexibleName Flexible-name(IgnoreCase). (NotNull and NotEmpty) - * @return DB name. (NotNull and NotEmpty) + * @param flexibleName The flexible name(IgnoreCase, IgnoreUnderscore). + * (NotNull, NotEmpty) + * @return DB name. (NotNull, NotEmpty) */ public String findPropertyName(String flexibleName) { - final String key = flexibleName.toLowerCase(); - if (getDbNamePropertyNameKeyToLowerMap().containsKey(key)) { - return (String) getDbNamePropertyNameKeyToLowerMap().get(key); + assertStringNotNullAndNotTrimmedEmpty("flexibleName", flexibleName); + final ColumnInfo columnInfoMap = getColumnInfoFlexibleMap().get( + flexibleName); + if (columnInfoMap != null) { + return columnInfoMap.getPropertyName(); } - if (getPropertyNameDbNameKeyToLowerMap().containsKey(key)) { - final String dbNameToLower = ((String) getPropertyNameDbNameKeyToLowerMap() - .get(key)).toLowerCase(); - if (getDbNamePropertyNameKeyToLowerMap().containsKey(dbNameToLower)) { - return (String) getDbNamePropertyNameKeyToLowerMap().get( - dbNameToLower); - } + final String tablePropertyName = getTablePropertyNameFlexibleMap().get( + flexibleName); + if (tablePropertyName != null) { + return tablePropertyName; } - String msg = "Not found object by the flexible name: flexibleName=" + String msg = "Not found property name by the flexible name: flexibleName=" + flexibleName; - throw new IllegalStateException(msg); + throw new IllegalArgumentException(msg); } //========================================================================== @@ -735,10 +819,8 @@ protected void registerEntityPropertySetupper( String columnName, String propertyName, Eps setupper, Map> entityPropertySetupperMap) { + // Only column name is registered because the map must be flexible map. entityPropertySetupperMap.put(columnName, setupper); - entityPropertySetupperMap.put(propertyName, setupper); - entityPropertySetupperMap.put(columnName.toLowerCase(), setupper); - entityPropertySetupperMap.put(propertyName.toLowerCase(), setupper); } protected Eps findEps( @@ -945,6 +1027,7 @@ /** * This class is for Internal. Don't use this! */ + @SuppressWarnings("unchecked") protected static class MapStringValueAnalyzer { protected java.util.Map _valueMap; @@ -1072,6 +1155,7 @@ // ========= // Assist Helper // ============= + @SuppressWarnings("unchecked") protected ENTITY downcast(Entity entity) { checkDowncast(entity); return (ENTITY) entity; @@ -1118,10 +1202,10 @@ protected Map setupKeyToLowerMap(boolean dbNameKey) { final Map map; if (dbNameKey) { - map = newLinkedHashMap(getTableDbName().toLowerCase(), + map = newConcurrentHashMap(getTableDbName().toLowerCase(), getTablePropertyName()); } else { - map = newLinkedHashMap(getTablePropertyName().toLowerCase(), + map = newConcurrentHashMap(getTablePropertyName().toLowerCase(), getTableDbName()); } Method[] methods = this.getClass().getMethods(); @@ -1178,6 +1262,17 @@ return new HashMap(); } + protected ConcurrentHashMap newConcurrentHashMap() { + return new ConcurrentHashMap(); + } + + protected ConcurrentHashMap newConcurrentHashMap( + KEY key, VALUE value) { + ConcurrentHashMap map = newConcurrentHashMap(); + map.put(key, value); + return map; + } + protected LinkedHashMap newLinkedHashMap() { return new LinkedHashMap(); } @@ -1201,23 +1296,26 @@ // ----------------------------------------------------- // Reflection Handling // ------------------- - private Set _cachedMethodNames = new HashSet(); // for - - // performance - + /** + * Does it have the method? + * + * @param methodName The name of method. (NotNull, NotEmpty, + * PublicMethodOnly) + * @return Determination. + */ protected boolean hasMethod(String methodName) { assertStringNotNullAndNotTrimmedEmpty("methodName", methodName); - if (_cachedMethodNames.isEmpty()) { - synchronized (_cachedMethodNames) { - if (_cachedMethodNames.isEmpty()) { + if (_methodNameMap.isEmpty()) { + synchronized (_methodNameMap) { + if (_methodNameMap.isEmpty()) { final Method[] methods = this.getClass().getMethods(); for (Method method : methods) { - _cachedMethodNames.add(method.getName()); + _methodNameMap.put(method.getName(), DUMMY_VALUE); } } } } - return _cachedMethodNames.contains(methodName); + return _methodNameMap.containsKey(methodName); } // ----------------------------------------------------- Modified: board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/dbmeta/DBMeta.java =================================================================== --- board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/dbmeta/DBMeta.java 2008-12-27 22:06:42 UTC (rev 1624) +++ board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/dbmeta/DBMeta.java 2008-12-27 22:09:08 UTC (rev 1625) @@ -17,23 +17,22 @@ * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public interface DBMeta { //========================================================================== // ========= // Definition // ========== - /** Map-string map-mark. */ + /** Map-string map mark. */ public static final String MAP_STRING_MAP_MARK = "map:"; - /** Map-string list-mark. */ + /** Map-string list mark. */ public static final String MAP_STRING_LIST_MARK = "list:"; - /** Map-string start-brace. */ + /** Map-string start brace. */ public static final String MAP_STRING_START_BRACE = "@{"; - /** Map-string end-brace. */ + /** Map-string end brace. */ public static final String MAP_STRING_END_BRACE = "@}"; /** Map-string delimiter. */ @@ -47,23 +46,23 @@ // Table Info // ========== /** - * Get table db-name. + * Get table DB name. * - * @return Table db-name. (NotNull) + * @return Table DB name. (NotNull) */ public String getTableDbName(); /** - * Get table property-name(JavaBeansRule). + * Get table property name(JavaBeansRule). * - * @return Table property-name(JavaBeansRule). (NotNull) + * @return Table property name(JavaBeansRule). (NotNull) */ public String getTablePropertyName(); /** - * Get table SQL-name. + * Get table SQL name. * - * @return Table SQL-name. (NotNull) + * @return Table SQL name. (NotNull) */ public String getTableSqlName(); @@ -80,10 +79,10 @@ public boolean hasFlexibleName(String flexibleName); /** - * Find db name by flexible name. {Target objects are TABLE and COLUMN} + * Find DB name by flexible name. {Target objects are TABLE and COLUMN} * * @param flexibleName The flexible name. (NotNull and NotEmpty) - * @return Db name. (NotNull and NotEmpty) + * @return The DB name of anything. (NotNull and NotEmpty) */ public String findDbName(String flexibleName); @@ -92,60 +91,40 @@ * TABLE and COLUMN} * * @param flexibleName The flexible name. (NotNull and NotEmpty) - * @return Db name. (NotNull and NotEmpty) + * @return The DB name of anything. (NotNull and NotEmpty) */ public String findPropertyName(String flexibleName); //========================================================================== // ========= - // Name Map - // ======== - /** - * Get the key-to-lower map of DB name(lower) and property name. - * - * @return The key-to-lower map of DB name(lower) and property name. - * (NotNull) - */ - public Map 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 getPropertyNameDbNameKeyToLowerMap(); - - //========================================================================== - // ========= // Type Name // ========= /** - * Get the type-name of entity. + * Get the type name of entity. * - * @return The type-name of entity. (NotNull) + * @return The type name of entity. (NotNull) */ public String getEntityTypeName(); /** - * Get the type-name of condition-bean. + * Get the type name of condition-bean. * - * @return The type-name of condition-bean. (Nullable: If the condition-bean + * @return The type name of condition-bean. (Nullable: If the condition-bean * does not exist) */ public String getConditionBeanTypeName(); /** - * Get the type-name of dao. + * Get the type name of DAO. * - * @return The type-name of dao. (Nullable: If the dao does not exist) + * @return The type name of DAO. (Nullable: If the DAO does not exist) */ public String getDaoTypeName(); /** - * Get the type-name of behavior. + * Get the type name of behavior. * - * @return The type-name of behavior. (Nullable: If the behavior does not + * @return The type name of behavior. (Nullable: If the behavior does not * exist) */ public String getBehaviorTypeName(); Modified: board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/dbmeta/DBMetaInstanceHandler.java =================================================================== --- board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/dbmeta/DBMetaInstanceHandler.java 2008-12-27 22:06:42 UTC (rev 1624) +++ board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/dbmeta/DBMetaInstanceHandler.java 2008-12-27 22:09:08 UTC (rev 1625) @@ -1,117 +1,85 @@ package jp.sf.pal.board.db.allcommon.dbmeta; -import java.util.Collections; -import java.util.LinkedHashMap; +import java.lang.reflect.Method; import java.util.Map; import java.util.Set; +import java.util.concurrent.ConcurrentHashMap; +import jp.sf.pal.board.db.allcommon.helper.StringKeyMap; import jp.sf.pal.board.db.allcommon.util.SimpleAssertUtil; /** - * DBMeta instance handler. + * The instance handler of DB meta. * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public class DBMetaInstanceHandler { //========================================================================== // ========= // Definition // ========== + /** Log-instance. */ + private static final org.apache.commons.logging.Log _log = org.apache.commons.logging.LogFactory + .getLog(DBMetaInstanceHandler.class); + + //========================================================================== + // ========= + // Resource Map + // ============ /** Table DB-name instance map. */ - protected static final Map _tableDbNameInstanceMap = new LinkedHashMap(); + protected static final Map _tableDbNameInstanceMap = newConcurrentHashMap(); - /** The map of table DB-name and class name. */ - protected static final Map _tableDbNameClassNameMap; - static { - Map tmpMap = new LinkedHashMap(); + /** The map of table DB name and class name. This is for initialization. */ + protected static final Map _tableDbNameClassNameMap = newConcurrentHashMap(); - tmpMap.put("ATTACHMENT", - "jp.sf.pal.board.db.bsentity.dbmeta.AttachmentDbm"); - tmpMap - .put("CATEGORY", - "jp.sf.pal.board.db.bsentity.dbmeta.CategoryDbm"); - tmpMap.put("CATEGORY_ACCESS", - "jp.sf.pal.board.db.bsentity.dbmeta.CategoryAccessDbm"); - tmpMap.put("GROUP_INFO", - "jp.sf.pal.board.db.bsentity.dbmeta.GroupInfoDbm"); - tmpMap.put("GROUP_MAPPING", - "jp.sf.pal.board.db.bsentity.dbmeta.GroupMappingDbm"); - tmpMap.put("MESSAGE", "jp.sf.pal.board.db.bsentity.dbmeta.MessageDbm"); - tmpMap.put("MESSAGE_ATTACHMENT", - "jp.sf.pal.board.db.bsentity.dbmeta.MessageAttachmentDbm"); - tmpMap.put("MESSAGE_CONTENT", - "jp.sf.pal.board.db.bsentity.dbmeta.MessageContentDbm"); - tmpMap.put("REPLY", "jp.sf.pal.board.db.bsentity.dbmeta.ReplyDbm"); - tmpMap.put("ROLE_INFO", - "jp.sf.pal.board.db.bsentity.dbmeta.RoleInfoDbm"); - tmpMap.put("ROLE_MAPPING", - "jp.sf.pal.board.db.bsentity.dbmeta.RoleMappingDbm"); - tmpMap.put("USER_INFO", - "jp.sf.pal.board.db.bsentity.dbmeta.UserInfoDbm"); + /** The flexible map of table DB name. This is for conversion at finding. */ + protected static final Map _tableDbNameFlexibleMap = StringKeyMap + .createAsFlexibleConcurrent(); - _tableDbNameClassNameMap = Collections.unmodifiableMap(tmpMap); - } + /** The count of setting up resources of DB meta for internal information. */ + protected static int setupCount = 0; - /** The key-to-lower map of DB-name and property-name for table. */ - protected static final Map _tableDbNamePropertyNameKeyToLowerMap; - static { - Map tmpMap = new LinkedHashMap(); - - tmpMap.put("ATTACHMENT".toLowerCase(), "attachment"); - tmpMap.put("CATEGORY".toLowerCase(), "category"); - tmpMap.put("CATEGORY_ACCESS".toLowerCase(), "categoryAccess"); - tmpMap.put("GROUP_INFO".toLowerCase(), "groupInfo"); - tmpMap.put("GROUP_MAPPING".toLowerCase(), "groupMapping"); - tmpMap.put("MESSAGE".toLowerCase(), "message"); - tmpMap.put("MESSAGE_ATTACHMENT".toLowerCase(), "messageAttachment"); - tmpMap.put("MESSAGE_CONTENT".toLowerCase(), "messageContent"); - tmpMap.put("REPLY".toLowerCase(), "reply"); - tmpMap.put("ROLE_INFO".toLowerCase(), "roleInfo"); - tmpMap.put("ROLE_MAPPING".toLowerCase(), "roleMapping"); - tmpMap.put("USER_INFO".toLowerCase(), "userInfo"); - - _tableDbNamePropertyNameKeyToLowerMap = Collections - .unmodifiableMap(tmpMap); - } - - /** The key-to-lower map of property-name and DB-name for table. */ - protected static final Map _tablePropertyNameDbNameKeyToLowerMap; - static { - Map tmpMap = new LinkedHashMap(); - - tmpMap.put("attachment".toLowerCase(), "ATTACHMENT"); - tmpMap.put("category".toLowerCase(), "CATEGORY"); - tmpMap.put("categoryAccess".toLowerCase(), "CATEGORY_ACCESS"); - tmpMap.put("groupInfo".toLowerCase(), "GROUP_INFO"); - tmpMap.put("groupMapping".toLowerCase(), "GROUP_MAPPING"); - tmpMap.put("message".toLowerCase(), "MESSAGE"); - tmpMap.put("messageAttachment".toLowerCase(), "MESSAGE_ATTACHMENT"); - tmpMap.put("messageContent".toLowerCase(), "MESSAGE_CONTENT"); - tmpMap.put("reply".toLowerCase(), "REPLY"); - tmpMap.put("roleInfo".toLowerCase(), "ROLE_INFO"); - tmpMap.put("roleMapping".toLowerCase(), "ROLE_MAPPING"); - tmpMap.put("userInfo".toLowerCase(), "USER_INFO"); - - _tablePropertyNameDbNameKeyToLowerMap = Collections - .unmodifiableMap(tmpMap); - } - - protected static DBMeta getDBMeta(String className) { - try { - Class clazz = Class.forName(className); - java.lang.reflect.Method methoz = clazz.getMethod("getInstance", - (Class[]) null); - Object result = methoz.invoke(null, (Object[]) null); - return (DBMeta) result; - } catch (Exception e) { - throw new RuntimeException(e); + /** + * Set up the resource of DBMeta. Lock this class. + * + * @param tableDbNameClassNameMap The map of table DB name and class name. + * (NotNull) + */ + public static synchronized void setupDBMetaResource( + Map tableDbNameClassNameMap) { + if (tableDbNameClassNameMap == null) { + String msg = "The argument 'tableDbNameClassNameMap' should not be null"; + msg = msg + " at DBMetaInstanceHandler.setupDBMetaResource()"; + throw new IllegalArgumentException(msg); } + if (tableDbNameClassNameMap.isEmpty()) { + String msg = "The argument 'tableDbNameClassNameMap' should not be empty"; + msg = msg + " at DBMetaInstanceHandler.setupDBMetaResource()"; + throw new IllegalArgumentException(msg); + } + final String firstMsg = "...Setting up resources of DB meta"; + final int tableCount = tableDbNameClassNameMap.size(); + if (setupCount == 0) { + _log.info(firstMsg + ": tables=" + tableCount); // basically here + } else { + _log.info(firstMsg + " AGAIN(" + (setupCount + 1) + + " times): tables=" + tableCount); + } + _tableDbNameInstanceMap.clear(); + _tableDbNameClassNameMap.clear(); + _tableDbNameFlexibleMap.clear(); + final Set tableDbNameSet = tableDbNameClassNameMap.keySet(); + for (String tableDbName : tableDbNameSet) { + final String className = tableDbNameClassNameMap.get(tableDbName); + _tableDbNameClassNameMap.put(tableDbName, className); + _tableDbNameFlexibleMap.put(tableDbName, tableDbName); + } + ++setupCount; } /** - * @return The initialized map that contains all instances of dbmeta. + * @return The initialized map that contains all instances of DB meta. * (NotNull & NotEmpty) */ public static Map getDBMetaMap() { @@ -144,45 +112,31 @@ // Main Method // =========== /** - * Find dbmeta by table flexible-name. + * Find DB meta by table flexible name. * *
-     * If the table name is 'ORDER_DETAIL', you can find the dbmeta by ...(as follows)
+     * If the table name is 'ORDER_DETAIL', you can find the DB meta by ...(as follows)
      *     'ORDER_DETAIL', 'ORDer_DeTAiL', 'order_detail'
      *     , 'OrderDetail', 'orderdetail', 'oRderDetaIl'
      * 
* - * @param tableFlexibleName Table flexible-name. (NotNull) - * @return The instance of dbmeta. (NotNull) - * @exception DBMetaNotFoundException When the dbmeta is not found. + * @param tableFlexibleName The flexible name of table. (NotNull) + * @return The instance of DB meta. (NotNull) + * @exception DBMetaNotFoundException When the DB meta is not found. */ public static DBMeta findDBMeta(String tableFlexibleName) { assertStringNotNullAndNotTrimmedEmpty("tableFlexibleName", tableFlexibleName); - if (_tableDbNameInstanceMap.containsKey(tableFlexibleName)) { - return byTableDbName(tableFlexibleName); - } - String toLowerKey = tableFlexibleName.toLowerCase(); - if (_tableDbNamePropertyNameKeyToLowerMap.containsKey(toLowerKey)) { - String propertyName = (String) _tableDbNamePropertyNameKeyToLowerMap - .get(toLowerKey); - String dbName = (String) _tablePropertyNameDbNameKeyToLowerMap - .get(propertyName.toLowerCase()); - return byTableDbName(dbName); - } - if (_tablePropertyNameDbNameKeyToLowerMap.containsKey(toLowerKey)) { - String dbName = (String) _tablePropertyNameDbNameKeyToLowerMap - .get(toLowerKey); - return byTableDbName(dbName); - } final int dotLastIndex = tableFlexibleName.lastIndexOf("."); if (dotLastIndex >= 0) { - try { - return findDBMeta(tableFlexibleName.substring(dotLastIndex + 1)); - } catch (DBMetaNotFoundException e) { - // Nothing - } + tableFlexibleName = tableFlexibleName.substring(dotLastIndex + + ".".length()); } + final String tableDbName = _tableDbNameFlexibleMap + .get(tableFlexibleName); + if (tableDbName != null) { + return byTableDbName(tableDbName); + } String msg = "The instance map returned null by the key: key=" + tableFlexibleName + " instanceMap=" + _tableDbNameInstanceMap; throw new DBMetaNotFoundException(msg); @@ -206,8 +160,9 @@ assertStringNotNullAndNotTrimmedEmpty("tableDbName", tableDbName); DBMeta instance = getCachedDBMeta(tableDbName); if (instance == null) { - String msg = "The instance map returned null by the key: key=" - + tableDbName + " instanceMap=" + _tableDbNameInstanceMap; + String msg = "The instance map returned null by the key:"; + msg = msg + " key=" + tableDbName + " instanceMap=" + + _tableDbNameInstanceMap; throw new DBMetaNotFoundException(msg); } return instance; @@ -229,10 +184,25 @@ return _tableDbNameInstanceMap.get(tableName); } + protected static DBMeta getDBMeta(String className) { + try { + Class clazz = Class.forName(className); + Method methoz = clazz.getMethod("getInstance", (Class[]) null); + Object result = methoz.invoke(null, (Object[]) null); + return (DBMeta) result; + } catch (Exception e) { + throw new RuntimeException(e); + } + } + //========================================================================== // ========= // General Helper // ============== + protected static ConcurrentHashMap newConcurrentHashMap() { + return new ConcurrentHashMap(); + } + // ----------------------------------------------------- // Assert Object // ------------- Modified: board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/dbmeta/hierarchy/HierarchyArranger.java =================================================================== --- board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/dbmeta/hierarchy/HierarchyArranger.java 2008-12-27 22:06:42 UTC (rev 1624) +++ board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/dbmeta/hierarchy/HierarchyArranger.java 2008-12-27 22:09:08 UTC (rev 1625) @@ -222,7 +222,6 @@ * @author DBFlute(AutoGenerator) * @param The type of local entity extends Entity */ - ¡÷ SuppressWarnings("unchecked") public class HierarchyArranger { //========================================================================== @@ -457,9 +456,9 @@ List referrerList = extractReferrerList(localEntity, referrerInfo); if (referrerList == null) { - String msg = "The referrer list should not be null: localEntity=" - + localEntity + " referrerInfo=" + referrerInfo; - throw new IllegalStateException(msg); + // Initialize the list of referrer and inject it. + referrerList = new ArrayList(); + injectReferrerList(localEntity, referrerInfo, referrerList); } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -765,8 +764,8 @@ return capPropReferrerName; } - private java.lang.reflect.Method findMethod(Class clazz, String methodName, - Class[] argTypes) { + private java.lang.reflect.Method findMethod(Class clazz, + String methodName, Class[] argTypes) { try { return clazz.getMethod(methodName, argTypes); } catch (NoSuchMethodException ex) { @@ -852,10 +851,10 @@ return sb.toString(); } - private String createTypeViewFromTypeArray(Class[] array) { + private String createTypeViewFromTypeArray(Class[] array) { final StringBuffer sb = new StringBuffer(); for (int i = 0; i < array.length; i++) { - final Class type = array[i]; + final Class type = array[i]; if (sb.length() == 0) { sb.append(type.getSimpleName()); } else { Modified: board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/dbmeta/hierarchy/HierarchyRequest.java =================================================================== --- board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/dbmeta/hierarchy/HierarchyRequest.java 2008-12-27 22:06:42 UTC (rev 1624) +++ board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/dbmeta/hierarchy/HierarchyRequest.java 2008-12-27 22:09:08 UTC (rev 1625) @@ -16,7 +16,6 @@ * @author DBFlute(AutoGenerator) * @param The type of local entity. */ - ¡÷ SuppressWarnings("unchecked") public class HierarchyRequest { //========================================================================== Modified: board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/dbmeta/hierarchy/HierarchyRequestElement.java =================================================================== --- board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/dbmeta/hierarchy/HierarchyRequestElement.java 2008-12-27 22:06:42 UTC (rev 1624) +++ board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/dbmeta/hierarchy/HierarchyRequestElement.java 2008-12-27 22:09:08 UTC (rev 1625) @@ -9,7 +9,6 @@ /** * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public class HierarchyRequestElement { //========================================================================== Modified: board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/dbmeta/hierarchy/HierarchySourceColumn.java =================================================================== --- board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/dbmeta/hierarchy/HierarchySourceColumn.java 2008-12-27 22:06:42 UTC (rev 1624) +++ board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/dbmeta/hierarchy/HierarchySourceColumn.java 2008-12-27 22:09:08 UTC (rev 1625) @@ -3,7 +3,6 @@ /** * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public interface HierarchySourceColumn { public String getColumnName(); Modified: board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/dbmeta/hierarchy/HierarchySourceIterator.java =================================================================== --- board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/dbmeta/hierarchy/HierarchySourceIterator.java 2008-12-27 22:06:42 UTC (rev 1624) +++ board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/dbmeta/hierarchy/HierarchySourceIterator.java 2008-12-27 22:09:08 UTC (rev 1625) @@ -3,7 +3,6 @@ /** * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public interface HierarchySourceIterator { public boolean hasNext(); Modified: board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/dbmeta/hierarchy/HierarchySourceRow.java =================================================================== --- board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/dbmeta/hierarchy/HierarchySourceRow.java 2008-12-27 22:06:42 UTC (rev 1624) +++ board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/dbmeta/hierarchy/HierarchySourceRow.java 2008-12-27 22:09:08 UTC (rev 1625) @@ -3,7 +3,6 @@ /** * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public interface HierarchySourceRow { public Object extractColumnValue(HierarchySourceColumn columnInfo); Modified: board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/dbmeta/info/ColumnInfo.java =================================================================== --- board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/dbmeta/info/ColumnInfo.java 2008-12-27 22:06:42 UTC (rev 1624) +++ board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/dbmeta/info/ColumnInfo.java 2008-12-27 22:09:08 UTC (rev 1625) @@ -8,7 +8,6 @@ * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public class ColumnInfo { //========================================================================== Modified: board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/dbmeta/info/RelationInfo.java =================================================================== --- board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/dbmeta/info/RelationInfo.java 2008-12-27 22:06:42 UTC (rev 1624) +++ board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/dbmeta/info/RelationInfo.java 2008-12-27 22:09:08 UTC (rev 1625) @@ -1,13 +1,14 @@ package jp.sf.pal.board.db.allcommon.dbmeta.info; +import java.util.Map; + import jp.sf.pal.board.db.allcommon.dbmeta.DBMeta; /** - * The class of referer information. + * The class of referrer information. * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public interface RelationInfo { public String getRelationPropertyName(); @@ -16,7 +17,7 @@ public DBMeta getTargetDBMeta(); - public java.util.Map getLocalTargetColumnInfoMap(); + public Map getLocalTargetColumnInfoMap(); public boolean isOneToOne(); Modified: board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/helper/MapStringBuilderImpl.java =================================================================== --- board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/helper/MapStringBuilderImpl.java 2008-12-27 22:06:42 UTC (rev 1624) +++ board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/helper/MapStringBuilderImpl.java 2008-12-27 22:09:08 UTC (rev 1625) @@ -1,17 +1,20 @@ package jp.sf.pal.board.db.allcommon.helper; +import java.util.Arrays; +import java.util.List; + import jp.sf.pal.board.db.allcommon.helper.token.line.LineToken; import jp.sf.pal.board.db.allcommon.helper.token.line.LineTokenizingOption; import jp.sf.pal.board.db.allcommon.helper.token.line.impl.LineTokenImpl; /** - * The implementation of map-string-builder. + * The implementation of map-string builder. * * @author DBFlute(AutoGenerator) */ public class MapStringBuilderImpl implements MapStringBuilder { - protected java.util.List _columnNameList; + protected List _columnNameList; protected String _msMapMark; @@ -26,10 +29,10 @@ protected boolean _trimDoubleQuotation; public void setColumnNames(String[] columnNames) { - _columnNameList = java.util.Arrays.asList(columnNames); + _columnNameList = Arrays.asList(columnNames); } - public void setColumnNameList(java.util.List columnNameList) { + public void setColumnNameList(List columnNameList) { _columnNameList = columnNameList; } @@ -83,7 +86,7 @@ return sb.toString(); } - public String buildFromList(java.util.List valueList) { + public String buildFromList(List valueList) { if (valueList == null) { String msg = "The argument[valueList] should not be null."; throw new IllegalArgumentException(msg); @@ -103,7 +106,7 @@ return sb.toString(); } - protected java.util.List tokenize(String value, String delimiter) { + protected List tokenize(String value, String delimiter) { final LineToken lineToken = new LineTokenImpl(); final LineTokenizingOption lineTokenizingOption = new LineTokenizingOption(); lineTokenizingOption.setDelimiter(delimiter); @@ -144,8 +147,8 @@ } } - protected void assertColumnValueList(java.util.List columnNameList, - java.util.List valueList) { + protected void assertColumnValueList(List columnNameList, + List valueList) { if (columnNameList.size() != valueList.size()) { String msg = "The length of columnNameList and valueList are difference. (" + columnNameList.size() + ", " + valueList.size() + ")"; Added: board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/helper/StringKeyMap.java =================================================================== --- board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/helper/StringKeyMap.java (rev 0) +++ board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/helper/StringKeyMap.java 2008-12-27 22:09:08 UTC (rev 1625) @@ -0,0 +1,201 @@ +package jp.sf.pal.board.db.allcommon.helper; + +import java.util.Collection; +import java.util.HashMap; +import java.util.Map; +import java.util.Set; +import java.util.concurrent.ConcurrentHashMap; + +/** + * @author DBFlute(AutoGenerator) + * @param The type of value. + */ +public class StringKeyMap implements Map { + + //========================================================================== + // ========= + // Attribute + // ========= + protected final Map _internalMap; + + protected boolean _removeUnderscore; + + //========================================================================== + // ========= + // Constructor + // =========== + protected StringKeyMap(boolean removeUnderscore, boolean concurrent) { + _removeUnderscore = removeUnderscore; + if (concurrent) { + _internalMap = newConcurrentHashMap(); + } else { + _internalMap = newHashMap(); + } + } + + public static StringKeyMap createAsFlexible() { + return new StringKeyMap(true, false); + } + + public static StringKeyMap createAsFlexibleConcurrent() { + return new StringKeyMap(true, true); + } + + public static StringKeyMap createAsCaseInsensitive() { + return new StringKeyMap(false, false); + } + + public static StringKeyMap createAsCaseInsensitiveConcurrent() { + return new StringKeyMap(false, true); + } + + //========================================================================== + // ========= + // Map Emulator + // ============ + // ----------------------------------------------------- + // Key Related + // ----------- + public VALUE get(Object key) { + final String stringKey = convertStringKey(key); + if (stringKey != null) { + return _internalMap.get(stringKey); + } + return null; + } + + public VALUE put(String key, VALUE value) { + final String stringKey = convertStringKey(key); + if (stringKey != null) { + return _internalMap.put(stringKey, value); + } + return null; + } + + public VALUE remove(Object key) { + final String stringKey = convertStringKey(key); + if (stringKey != null) { + return _internalMap.remove(stringKey); + } + return null; + } + + public final void putAll(Map map) { + final Set keySet = map.keySet(); + for (String key : keySet) { + put(key, map.get(key)); + } + } + + public boolean containsKey(Object key) { + return get(key) != null; + } + + // ----------------------------------------------------- + // Delegate + // -------- + public void clear() { + _internalMap.clear(); + } + + public int size() { + return _internalMap.size(); + } + + public boolean isEmpty() { + return _internalMap.isEmpty(); + } + + public Set keySet() { + return _internalMap.keySet(); + } + + public Collection values() { + return _internalMap.values(); + } + + public boolean containsValue(Object obj) { + return _internalMap.containsValue(obj); + } + + public Set> entrySet() { + return _internalMap.entrySet(); + } + + //========================================================================== + // ========= + // Key Converter + // ============= + protected String convertStringKey(Object key) { + if (!(key instanceof String)) { + return null; + } + return toLowerCase(removeUnderscore((String) key)); + } + + protected String removeUnderscore(String value) { + if (_removeUnderscore) { + return replace(value, "_", ""); + } + return value; + } + + protected String toLowerCase(String value) { + return value.toLowerCase(); + } + + //========================================================================== + // ========= + // General Helper + // ============== + protected static String replace(String text, String fromText, String toText) { + if (text == null || fromText == null || toText == null) { + return null; + } + StringBuilder sb = new StringBuilder(100); + int pos = 0; + int pos2 = 0; + while (true) { + pos = text.indexOf(fromText, pos2); + if (pos == 0) { + sb.append(toText); + pos2 = fromText.length(); + } else if (pos > 0) { + sb.append(text.substring(pos2, pos)); + sb.append(toText); + pos2 = pos + fromText.length(); + } else { + sb.append(text.substring(pos2)); + break; + } + } + return sb.toString(); + } + + protected static ConcurrentHashMap newConcurrentHashMap() { + return new ConcurrentHashMap(); + } + + protected static HashMap newHashMap() { + return new HashMap(); + } + + //========================================================================== + // ========= + // Basic Override + // ============== + @Override + public boolean equals(Object obj) { + return _internalMap.equals(obj); + } + + @Override + public int hashCode() { + return _internalMap.hashCode(); + } + + @Override + public String toString() { + return _internalMap.toString(); + } +} \ No newline at end of file Property changes on: board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/helper/StringKeyMap.java ___________________________________________________________________ Name: svn:eol-style + native Added: board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/helper/StringSet.java =================================================================== --- board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/helper/StringSet.java (rev 0) +++ board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/helper/StringSet.java 2008-12-27 22:09:08 UTC (rev 1625) @@ -0,0 +1,233 @@ +package jp.sf.pal.board.db.allcommon.helper; + +import java.util.Collection; +import java.util.HashMap; +import java.util.Iterator; +import java.util.Map; +import java.util.Set; +import java.util.concurrent.ConcurrentHashMap; + +/** + * @author DBFlute(AutoGenerator) + */ +public class StringSet implements Set { + + //========================================================================== + // ========= + // Definition + // ========== + protected static final Object DUMMY_VALUE = new Object(); + + //========================================================================== + // ========= + // Attribute + // ========= + protected final Map _internalMap; + + protected boolean _removeUnderscore; + + //========================================================================== + // ========= + // Constructor + // =========== + protected StringSet(boolean removeUnderscore, boolean concurrent) { + _removeUnderscore = removeUnderscore; + if (concurrent) { + _internalMap = newConcurrentHashMap(); + } else { + _internalMap = newHashMap(); + } + } + + public static StringSet createAsFlexible() { + return new StringSet(true, false); + } + + public static StringSet createAsFlexibleConcurrent() { + return new StringSet(true, true); + } + + public static StringSet createAsCaseInsensitive() { + return new StringSet(false, false); + } + + public static StringSet createAsCaseInsensitiveConcurrent() { + return new StringSet(false, true); + } + + //========================================================================== + // ========= + // Map Emulator + // ============ + // ----------------------------------------------------- + // Key Related + // ----------- + public boolean add(String value) { + final String stringValue = convertStringKey(value); + if (stringValue != null) { + return _internalMap.put(stringValue, DUMMY_VALUE) != null; + } + return false; + } + + public boolean remove(Object value) { + final String stringValue = convertStringKey(value); + if (stringValue != null) { + return _internalMap.remove(stringValue) != null; + } + return false; + } + + public boolean contains(Object value) { + final String stringValue = convertStringKey(value); + if (stringValue != null) { + return _internalMap.containsKey(stringValue); + } + return false; + } + + // ----------------------------------------------------- + // Delegate + // -------- + public void clear() { + _internalMap.clear(); + } + + public int size() { + return _internalMap.size(); + } + + public boolean isEmpty() { + return _internalMap.isEmpty(); + } + + public boolean addAll(Collection c) { + boolean success = false; + for (String s : c) { + if (add(s)) { + success = true; + } + } + return success; + } + + public boolean removeAll(Collection c) { + boolean success = false; + for (Object s : c) { + if (remove(s)) { + success = true; + } + } + return success; + } + + public boolean containsAll(Collection c) { + for (Object s : c) { + if (contains(s)) { + return true; + } + } + return false; + } + + public Iterator iterator() { + return _internalMap.keySet().iterator(); + } + + public boolean retainAll(Collection c) { + boolean success = false; + for (Object s : c) { + if (!contains(s)) { + if (remove(s)) { + success = true; + } + } + } + return success; + } + + public Object[] toArray() { + return _internalMap.keySet().toArray(); + } + + public T[] toArray(T[] a) { + return _internalMap.keySet().toArray(a); + } + + //========================================================================== + // ========= + // Key Converter + // ============= + protected String convertStringKey(Object value) { + if (!(value instanceof String)) { + return null; + } + return toLowerCase(removeUnderscore((String) value)); + } + + protected String removeUnderscore(String value) { + if (_removeUnderscore) { + return replace(value, "_", ""); + } + return value; + } + + protected String toLowerCase(String value) { + return value.toLowerCase(); + } + + //========================================================================== + // ========= + // General Helper + // ============== + protected static String replace(String text, String fromText, String toText) { + if (text == null || fromText == null || toText == null) { + return null; + } + StringBuilder sb = new StringBuilder(100); + int pos = 0; + int pos2 = 0; + while (true) { + pos = text.indexOf(fromText, pos2); + if (pos == 0) { + sb.append(toText); + pos2 = fromText.length(); + } else if (pos > 0) { + sb.append(text.substring(pos2, pos)); + sb.append(toText); + pos2 = pos + fromText.length(); + } else { + sb.append(text.substring(pos2)); + break; + } + } + return sb.toString(); + } + + protected static ConcurrentHashMap newConcurrentHashMap() { + return new ConcurrentHashMap(); + } + + protected static HashMap newHashMap() { + return new HashMap(); + } + + //========================================================================== + // ========= + // Basic Override + // ============== + @Override + public boolean equals(Object obj) { + return _internalMap.keySet().equals(obj); + } + + @Override + public int hashCode() { + return _internalMap.keySet().hashCode(); + } + + @Override + public String toString() { + return _internalMap.keySet().toString(); + } +} \ No newline at end of file Property changes on: board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/helper/StringSet.java ___________________________________________________________________ Name: svn:eol-style + native Added: board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/s2dao/BeanMetaDataFactoryExtension.java =================================================================== --- board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/s2dao/BeanMetaDataFactoryExtension.java (rev 0) +++ board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/s2dao/BeanMetaDataFactoryExtension.java 2008-12-27 22:09:08 UTC (rev 1625) @@ -0,0 +1,213 @@ +package jp.sf.pal.board.db.allcommon.s2dao; + +import java.sql.DatabaseMetaData; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.concurrent.ConcurrentHashMap; + +import jp.sf.pal.board.db.allcommon.Entity; +import jp.sf.pal.board.db.allcommon.s2dao.internal.various.InternalIdentifierGeneratorFactory; + +import org.seasar.dao.BeanMetaData; +import org.seasar.dao.IdentifierGenerator; +import org.seasar.dao.impl.BeanMetaDataFactoryImpl; +import org.seasar.dao.impl.BeanMetaDataImpl; +import org.seasar.extension.jdbc.PropertyType; +import org.seasar.framework.beans.PropertyDesc; + +/** + * BeanMetaDataFactoryImpl for DBFlute. + * + * @author DBFlute(AutoGenerator) + */ + ¡÷ SuppressWarnings("unchecked") +public class BeanMetaDataFactoryExtension extends BeanMetaDataFactoryImpl { + + //========================================================================== + // ========= + // Attribute + // ========= + /** The map of bean meta data for cache. */ + protected Map, BeanMetaData> _metaMap = newConcurrentHashMap(); + + //========================================================================== + // ========= + // Override for Cache + // ================== + @Override + public BeanMetaData createBeanMetaData(Class beanClass) { + final BeanMetaData cachedMeta = findCachedMeta(beanClass); + if (cachedMeta != null) { + return cachedMeta; + } else { + return super.createBeanMetaData(beanClass); + } + } + + @Override + public BeanMetaData createBeanMetaData(Class beanClass, + int relationNestLevel) { + final BeanMetaData cachedMeta = findCachedMeta(beanClass); + if (cachedMeta != null) { + return cachedMeta; + } else { + return super.createBeanMetaData(beanClass, relationNestLevel); + } + } + + @Override + public BeanMetaData createBeanMetaData(DatabaseMetaData dbMetaData, + Class beanClass, int relationNestLevel) { + final BeanMetaData cachedMeta = findOrCreateCachedMetaIfNeeds( + dbMetaData, beanClass, relationNestLevel); + if (cachedMeta != null) { + return cachedMeta; + } else { + return super.createBeanMetaData(dbMetaData, beanClass, + relationNestLevel); + } + } + + protected BeanMetaData findCachedMeta(Class beanClass) { + if (isDBFluteEntity(beanClass)) { + final BeanMetaData cachedMeta = getMetaFromCache(beanClass); + if (cachedMeta != null) { + return cachedMeta; + } + } + return null; + } + + protected BeanMetaData findOrCreateCachedMetaIfNeeds( + DatabaseMetaData dbMetaData, Class beanClass, int relationNestLevel) { + if (isDBFluteEntity(beanClass)) { + final BeanMetaData cachedMeta = getMetaFromCache(beanClass); + if (cachedMeta != null) { + return cachedMeta; + } else { + return super.createBeanMetaData(dbMetaData, beanClass, 0); + } + } + return null; + } + + //========================================================================== + // ========= + // BeanMetaData Creation + // ===================== + @Override + protected BeanMetaDataImpl createBeanMetaDataImpl() { + // /= = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = + // = = + // for ConditionBean and insert() and update() and delete() and so on... + // = = = = = = = = = =/ + return new BeanMetaDataImpl() { + protected List _internalIdentifierGeneratorList = new ArrayList(); + + protected Map _internalIdentifierGeneratorsByPropertyName = newConcurrentHashMap(); + + // /= = = = = = = + // for cache + // = = = = =/ + @Override + public void initialize() { // for Cache + final Class myBeanClass = getBeanClass(); + if (isDBFluteEntity(myBeanClass)) { + final BeanMetaData cachedMeta = getMetaFromCache(myBeanClass); + if (cachedMeta == null) { + _metaMap.put(myBeanClass, this); + } + } + super.initialize(); + } + + // /= = = = = = = + // for insert() + // = = = = =/ + // The attributes 'identifierGenerators' and + // 'identifierGeneratorsByPropertyName' + // of super class are unused. It prepares original atributes here. + @Override + protected void setupIdentifierGenerator(PropertyType propertyType) { + final PropertyDesc pd = propertyType.getPropertyDesc(); + final String propertyName = propertyType.getPropertyName(); + final String idType = beanAnnotationReader.getId(pd, getDbms()); + final IdentifierGenerator generator = createInternalIdentifierGenerator( + propertyType, idType); + _internalIdentifierGeneratorList.add(generator); + _internalIdentifierGeneratorsByPropertyName.put(propertyName, + generator); + } + + protected IdentifierGenerator createInternalIdentifierGenerator( + PropertyType propertyType, String idType) { + return InternalIdentifierGeneratorFactory + .createIdentifierGenerator(propertyType, getDbms(), + idType); + } + + @Override + public IdentifierGenerator getIdentifierGenerator(int index) { + return _internalIdentifierGeneratorList.get(index); + } + + @Override + public int getIdentifierGeneratorSize() { + return _internalIdentifierGeneratorList.size(); + } + + @Override + public IdentifierGenerator getIdentifierGenerator( + String propertyName) { + return _internalIdentifierGeneratorsByPropertyName + .get(propertyName); + } + }; + } + + // /= = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = + // Other extension points about BeanMetaDataImpl is as follows: + // + // S2DaoMetaDataExtension.createNonConcurrencyBmdFactory() + // --> for NonConcurrency (updateNonstrict() and deleteNonstrict() and so + // on...) + // + // S2DaoMetaDataExtension.createOutsideSqlCustomizeBeanMetaDataFactory() + // --> for OutsideSql but it overrides nothing. + // = = = = = = = = = =/ + + //========================================================================== + // ========= + // Relation Next Level + // =================== + /** + * Get the limit nest level of relation. + * + * @return The limit nest level of relation. + */ + @Override + protected int getLimitRelationNestLevel() { + return 2; // for Compatible to old version DBFlute + } + + //========================================================================== + // ========= + // General Helper + // ============== + protected ConcurrentHashMap newConcurrentHashMap() { + return new ConcurrentHashMap(); + } + + //========================================================================== + // ========= + // Assist Helper + // ============= + protected boolean isDBFluteEntity(Class beanClass) { + return Entity.class.isAssignableFrom(beanClass); + } + + protected BeanMetaData getMetaFromCache(Class beanClass) { + return _metaMap.get(beanClass); + } +} \ No newline at end of file Property changes on: board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/s2dao/BeanMetaDataFactoryExtension.java ___________________________________________________________________ Name: svn:eol-style + native Deleted: board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/s2dao/FetchNarrowingResultSetFactory.java =================================================================== --- board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/s2dao/FetchNarrowingResultSetFactory.java 2008-12-27 22:06:42 UTC (rev 1624) +++ board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/s2dao/FetchNarrowingResultSetFactory.java 2008-12-27 22:09:08 UTC (rev 1625) @@ -1,125 +0,0 @@ -package jp.sf.pal.board.db.allcommon.s2dao; - -import java.sql.PreparedStatement; -import java.sql.ResultSet; -import java.sql.SQLException; -import java.sql.Statement; - -import jp.sf.pal.board.db.allcommon.s2dao.internal.sqlhandler.InternalBasicHandler.SQLExceptionHandler; - -import org.seasar.extension.jdbc.ResultSetFactory; - -/** - * This is unused in DBFlute so this is very NORMAL result-set-factory for - * S2Dao. - * - * @author DBFlute(AutoGenerator) - */ -public class FetchNarrowingResultSetFactory implements ResultSetFactory { - - //========================================================================== - // ========= - // Constructor - // =========== - /** - * Constructor. - */ - public FetchNarrowingResultSetFactory() { - } - - //========================================================================== - // ========= - // Main - // ==== - /** - * Get result set. - * - * @param statement Statement. (NotNull) - * @return Result set for procedure executing of s2dao. (NotNull) - */ - public ResultSet getResultSet(Statement statement) { // Unused in DBFlute - return doGetResultSet(statement); - } - - /** - * Create result set. - * - * @param ps Prepared statement. (NotNull) - * @return Result set. (NotNull) - */ - public ResultSet createResultSet(PreparedStatement ps) { // Unused in - // DBFlute - return executeQuery(ps); - - // *Move to InternalBasicSelectHandler - // if (!FetchNarrowingBeanContext.isExistFetchNarrowingBeanOnThread()) { - // return resultSet; - // } - // final FetchNarrowingBean cb = - // FetchNarrowingBeanContext.getFetchNarrowingBeanOnThread(); - // if (!isUseFetchNarrowingResultSetWrapper(cb)) { - // return resultSet; - // } - // final FetchNarrowingResultSetWrapper wrapper; - // if (OutsideSqlContext.isExistOutsideSqlContextOnThread()) { - // final OutsideSqlContext outsideSqlContext = - // OutsideSqlContext.getOutsideSqlContextOnThread(); - // wrapper = new FetchNarrowingResultSetWrapper(resultSet, cb, - // outsideSqlContext.isOffsetByCursorForcedly(), - // outsideSqlContext.isLimitByCursorForcedly()); - // } else { - // wrapper = new FetchNarrowingResultSetWrapper(resultSet, cb, false, - // false); - // } - // return wrapper; - } - - // protected boolean isUseFetchNarrowingResultSetWrapper(FetchNarrowingBean - // cb) { - // if (cb.getSafetyMaxResultSize() > 0) { - // return true; - // } - // if (!cb.isFetchNarrowingEffective()) { - // return false;// It is not necessary to control. - // } - // if (OutsideSqlContext.isExistOutsideSqlContextOnThread()) { - // final OutsideSqlContext outsideSqlContext = - // OutsideSqlContext.getOutsideSqlContextOnThread(); - // if (outsideSqlContext.isOffsetByCursorForcedly() || - // outsideSqlContext.isLimitByCursorForcedly()) { - // return true; - // } - // } - // if (cb.isFetchNarrowingSkipStartIndexEffective() || - // cb.isFetchNarrowingLoopCountEffective()) { - // return true; - // } - // return false; - // } - - //========================================================================== - // ========= - // JDBC Delegator - // ============== - protected ResultSet doGetResultSet(Statement statement) { - try { - return statement.getResultSet(); - } catch (SQLException e) { - handleSQLException(e, statement); - return null;// Unreachable! - } - } - - protected ResultSet executeQuery(PreparedStatement ps) { - try { - return ps.executeQuery(); - } catch (SQLException e) { - handleSQLException(e, ps); - return null;// Unreachable! - } - } - - protected void handleSQLException(SQLException e, Statement statement) { - new SQLExceptionHandler().handleSQLException(e, statement); - } -} Modified: board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/s2dao/FetchNarrowingResultSetWrapper.java =================================================================== --- board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/s2dao/FetchNarrowingResultSetWrapper.java 2008-12-27 22:06:42 UTC (rev 1624) +++ board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/s2dao/FetchNarrowingResultSetWrapper.java 2008-12-27 22:09:08 UTC (rev 1625) @@ -4,6 +4,7 @@ import java.sql.SQLException; import java.sql.Statement; +import jp.sf.pal.board.db.allcommon.DBDef; import jp.sf.pal.board.db.allcommon.cbean.FetchNarrowingBean; import jp.sf.pal.board.db.allcommon.s2dao.internal.sqlhandler.InternalBasicHandler.SQLExceptionHandler; @@ -41,6 +42,9 @@ /** Does it skip to cursor end? */ protected boolean _skipToCursorEnd; + /** Is the database DB2? */ + protected final boolean _db2 = DBDef.isCurrentDef(DBDef.DB2); + //========================================================================== // ========= // Constructor @@ -71,7 +75,7 @@ // Skip // ==== /** - * Skip to start-index. + * Skip to the point at start index. */ protected void skip() { if (!isAvailableSkipRecord()) { @@ -125,12 +129,15 @@ // Next // ==== /** - * Next. + * Move to the next record. * * @return Does the result set have next record? * @throws SQLException */ public boolean next() throws SQLException { + if (_db2 && _skipToCursorEnd) { // [DBFLUTE-243] + return false; + } final boolean hasNext = super.next(); ++_requestCounter; if (!isAvailableLimitLoopCount()) { Added: board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/s2dao/PropertyTypeFactoryBuilderExtension.java =================================================================== --- board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/s2dao/PropertyTypeFactoryBuilderExtension.java (rev 0) +++ board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/s2dao/PropertyTypeFactoryBuilderExtension.java 2008-12-27 22:09:08 UTC (rev 1625) @@ -0,0 +1,215 @@ +package jp.sf.pal.board.db.allcommon.s2dao; + +import java.sql.DatabaseMetaData; +import java.util.ArrayList; +import java.util.List; + +import jp.sf.pal.board.db.allcommon.Entity; +import jp.sf.pal.board.db.allcommon.dbmeta.DBMeta; + +import org.seasar.dao.BeanAnnotationReader; +import org.seasar.dao.ColumnNaming; +import org.seasar.dao.Dbms; +import org.seasar.dao.PropertyTypeFactory; +import org.seasar.dao.PropertyTypeFactoryBuilder; +import org.seasar.dao.ValueTypeFactory; +import org.seasar.dao.impl.AbstractPropertyTypeFactory; +import org.seasar.extension.jdbc.PropertyType; +import org.seasar.framework.beans.BeanDesc; +import org.seasar.framework.beans.PropertyDesc; + +/** + * The factory builder of property type for S2Dao. {Since S2Dao-1.0.47} + * + * @author DBFlute(AutoGenerator) + */ + ¡÷ SuppressWarnings("unchecked") +public class PropertyTypeFactoryBuilderExtension implements + PropertyTypeFactoryBuilder { + + //========================================================================== + // ========= + // Attribute + // ========= + protected ValueTypeFactory valueTypeFactory; + + protected ColumnNaming columnNaming; + + //========================================================================== + // ========= + // Build + // ===== + public PropertyTypeFactory build(Class beanClass, + BeanAnnotationReader beanAnnotationReader) { + return new FastPropertyTypeFactoryExtension(beanClass, + beanAnnotationReader, valueTypeFactory, columnNaming); + } + + public PropertyTypeFactory build(Class beanClass, + BeanAnnotationReader beanAnnotationReader, Dbms dbms, + DatabaseMetaData databaseMetaData) { + return new FastPropertyTypeFactoryExtension(beanClass, + beanAnnotationReader, valueTypeFactory, columnNaming, dbms); + } + + //========================================================================== + // ========= + // Extension Class + // =============== + protected static class FastPropertyTypeFactoryExtension extends + AbstractPropertyTypeFactory { + + protected DBMeta _dbmeta; + + protected String[] _noPersisteneProps; + + public FastPropertyTypeFactoryExtension(Class beanClass, + BeanAnnotationReader beanAnnotationReader, + ValueTypeFactory valueTypeFactory, ColumnNaming columnNaming) { + super(beanClass, beanAnnotationReader, valueTypeFactory, + columnNaming); + initializeResources(); + } + + public FastPropertyTypeFactoryExtension(Class beanClass, + BeanAnnotationReader beanAnnotationReader, + ValueTypeFactory valueTypeFactory, ColumnNaming columnNaming, + Dbms dbms) { + super(beanClass, beanAnnotationReader, valueTypeFactory, + columnNaming, dbms); + initializeResources(); + } + + protected void initializeResources() { + if (isEntity()) { + _dbmeta = findDBMeta(); + } + _noPersisteneProps = beanAnnotationReader.getNoPersisteneProps(); + } + + protected boolean isEntity() { + return Entity.class.isAssignableFrom(beanClass); + } + + protected boolean hasDBMeta() { + return _dbmeta != null; + } + + protected DBMeta findDBMeta() { + try { + final Entity entity = (Entity) beanClass.newInstance(); + return entity.getDBMeta(); + } catch (Exception e) { + String msg = "beanClass.newInstance() threw the exception: beanClass=" + + beanClass; + throw new RuntimeException(msg, e); + } + } + + public PropertyType[] createBeanPropertyTypes(String tableName) { + final List list = new ArrayList(); + final BeanDesc beanDesc = getBeanDesc(); + for (int i = 0; i < beanDesc.getPropertyDescSize(); ++i) { + final PropertyDesc pd = beanDesc.getPropertyDesc(i); + + // Read-only property is unnecessary! + if (!pd.hasWriteMethod()) { + continue; + } + + // Relation property is unnecessary! + if (isRelation(pd)) { + continue; + } + + final PropertyType pt = createPropertyType(pd); + pt.setPrimaryKey(isPrimaryKey(pd)); + pt.setPersistent(isPersistent(pt)); + list.add(pt); + } + return list.toArray(new PropertyType[list.size()]); + } + + @Override + protected boolean isRelation(PropertyDesc propertyDesc) { + final String propertyName = propertyDesc.getPropertyName(); + if (hasDBMeta() + && (_dbmeta.hasForeign(propertyName) || _dbmeta + .hasReferrer(propertyName))) { + return true; + } + return hasRelationNoAnnotation(propertyDesc); + } + + protected boolean hasRelationNoAnnotation(PropertyDesc propertyDesc) { + return beanAnnotationReader.hasRelationNo(propertyDesc); + } + + @Override + protected boolean isPrimaryKey(PropertyDesc propertyDesc) { + final String propertyName = propertyDesc.getPropertyName(); + if (hasDBMeta() && _dbmeta.hasPrimaryKey() + && _dbmeta.hasColumn(propertyName)) { + if (_dbmeta.findColumnInfo(propertyName).isPrimary()) { + return true; + } + } + return hasIdAnnotation(propertyDesc); + } + + protected boolean hasIdAnnotation(PropertyDesc propertyDesc) { + final Dbms dbms = getDbms(); + return beanAnnotationReader.getId(propertyDesc, dbms) != null; + } + + @Override + protected boolean isPersistent(PropertyType propertyType) { + final String propertyName = propertyType.getPropertyName(); + final PropertyDesc propertyDesc = propertyType.getPropertyDesc(); + if ((hasDBMeta() && _dbmeta.hasColumn(propertyName)) + || hasColumnAnnotation(propertyDesc)) { + if (!isElementOfNoPersistentProps(propertyDesc)) { + return true; + } + } + return false; + } + + protected boolean hasColumnAnnotation(PropertyDesc propertyDesc) { + return beanAnnotationReader.getColumnAnnotation(propertyDesc) != null; + } + + protected boolean isElementOfNoPersistentProps(PropertyDesc propertyDesc) { + final String propertyName = propertyDesc.getPropertyName(); + final String[] props = _noPersisteneProps; + if (props != null && props.length >= 0) { + for (int i = 0; i < props.length; ++i) { + if (props[i].equals(propertyName)) { + return true; + } + } + } + return false; + } + } + + //========================================================================== + // ========= + // Accessor + // ======== + public ValueTypeFactory getValueTypeFactory() { + return valueTypeFactory; + } + + public void setValueTypeFactory(ValueTypeFactory valueTypeFactory) { + this.valueTypeFactory = valueTypeFactory; + } + + public ColumnNaming getColumnNaming() { + return columnNaming; + } + + public void setColumnNaming(ColumnNaming columnNaming) { + this.columnNaming = columnNaming; + } +} Deleted: board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/s2dao/S2BeanMetaDataFactoryImpl.java =================================================================== --- board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/s2dao/S2BeanMetaDataFactoryImpl.java 2008-12-27 22:06:42 UTC (rev 1624) +++ board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/s2dao/S2BeanMetaDataFactoryImpl.java 2008-12-27 22:09:08 UTC (rev 1625) @@ -1,116 +0,0 @@ -package jp.sf.pal.board.db.allcommon.s2dao; - -import java.sql.DatabaseMetaData; -import java.util.Collections; -import java.util.HashMap; -import java.util.Map; - -import jp.sf.pal.board.db.allcommon.Entity; - -import org.seasar.dao.BeanMetaData; -import org.seasar.dao.impl.BeanMetaDataFactoryImpl; -import org.seasar.dao.impl.BeanMetaDataImpl; - -/** - * BeanMetaDataFactoryImpl for DBFlute. - * - * @author DBFlute(AutoGenerator) - */ - ¡÷ SuppressWarnings("unchecked") -public class S2BeanMetaDataFactoryImpl extends BeanMetaDataFactoryImpl { - - protected Map, BeanMetaData> _metaMap = Collections - .synchronizedMap(new HashMap, BeanMetaData>()); - - @Override - public BeanMetaData createBeanMetaData(Class beanClass) { - final BeanMetaData cachedMeta = findCachedMeta(beanClass); - if (cachedMeta != null) { - return cachedMeta; - } else { - return super.createBeanMetaData(beanClass); - } - } - - @Override - public BeanMetaData createBeanMetaData(Class beanClass, - int relationNestLevel) { - final BeanMetaData cachedMeta = findCachedMeta(beanClass); - if (cachedMeta != null) { - return cachedMeta; - } else { - return super.createBeanMetaData(beanClass, relationNestLevel); - } - } - - @Override - public BeanMetaData createBeanMetaData(DatabaseMetaData dbMetaData, - Class beanClass, int relationNestLevel) { - final BeanMetaData cachedMeta = findOrCreateCachedMetaIfNeeds( - dbMetaData, beanClass, relationNestLevel); - if (cachedMeta != null) { - return cachedMeta; - } else { - return super.createBeanMetaData(dbMetaData, beanClass, - relationNestLevel); - } - } - - protected BeanMetaData findCachedMeta(Class beanClass) { - if (isDBFluteEntity(beanClass)) { - final BeanMetaData cachedMeta = getMetaFromCache(beanClass); - if (cachedMeta != null) { - return cachedMeta; - } - } - return null; - } - - protected BeanMetaData findOrCreateCachedMetaIfNeeds( - DatabaseMetaData dbMetaData, Class beanClass, int relationNestLevel) { - if (isDBFluteEntity(beanClass)) { - final BeanMetaData cachedMeta = getMetaFromCache(beanClass); - if (cachedMeta != null) { - return cachedMeta; - } else { - return super.createBeanMetaData(dbMetaData, beanClass, 0); - } - } - return null; - } - - @Override - protected BeanMetaDataImpl createBeanMetaDataImpl() { - return new BeanMetaDataImpl() { - @Override - public void initialize() { - final Class myBeanClass = getBeanClass(); - if (isDBFluteEntity(myBeanClass)) { - final BeanMetaData cachedMeta = getMetaFromCache(myBeanClass); - if (cachedMeta == null) { - _metaMap.put(myBeanClass, this); - } - } - super.initialize(); - } - }; - } - - protected boolean isDBFluteEntity(Class beanClass) { - return Entity.class.isAssignableFrom(beanClass); - } - - protected BeanMetaData getMetaFromCache(Class beanClass) { - return _metaMap.get(beanClass); - } - - /** - * Get the limit nest level of relation. - * - * @return The limit nest level of relation. - */ - @Override - protected int getLimitRelationNestLevel() { - return 2;// for Compatible to old version DBFlute - } -} \ No newline at end of file Deleted: board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/s2dao/S2DaoInterceptor.java =================================================================== --- board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/s2dao/S2DaoInterceptor.java 2008-12-27 22:06:42 UTC (rev 1624) +++ board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/s2dao/S2DaoInterceptor.java 2008-12-27 22:09:08 UTC (rev 1625) @@ -1,1027 +0,0 @@ -package jp.sf.pal.board.db.allcommon.s2dao; - -import java.lang.reflect.Method; -import java.lang.reflect.Modifier; -import java.util.Arrays; -import java.util.List; - -import jp.sf.pal.board.db.allcommon.Entity; -import jp.sf.pal.board.db.allcommon.InternalMapContext; -import jp.sf.pal.board.db.allcommon.XLog; -import jp.sf.pal.board.db.allcommon.cbean.ConditionBean; -import jp.sf.pal.board.db.allcommon.cbean.ConditionBeanContext; -import jp.sf.pal.board.db.allcommon.cbean.FetchNarrowingBean; -import jp.sf.pal.board.db.allcommon.cbean.FetchNarrowingBeanContext; -import jp.sf.pal.board.db.allcommon.cbean.outsidesql.OutsideSqlContext; -import jp.sf.pal.board.db.allcommon.cbean.outsidesql.OutsideSqlDao; -import jp.sf.pal.board.db.allcommon.cbean.outsidesql.OutsideSqlOption; -import jp.sf.pal.board.db.allcommon.dbmeta.DBMeta; -import jp.sf.pal.board.db.allcommon.dbmeta.DBMetaInstanceHandler; -import jp.sf.pal.board.db.allcommon.exception.EntityAlreadyUpdatedException; -import jp.sf.pal.board.db.allcommon.helper.stacktrace.InvokeNameExtractingResource; -import jp.sf.pal.board.db.allcommon.helper.stacktrace.InvokeNameResult; -import jp.sf.pal.board.db.allcommon.helper.stacktrace.impl.InvokeNameExtractorImpl; -import jp.sf.pal.board.db.allcommon.util.TraceViewUtil; - -import org.aopalliance.intercept.MethodInvocation; -import org.seasar.dao.DaoMetaData; -import org.seasar.dao.DaoMetaDataFactory; -import org.seasar.dao.NotSingleRowUpdatedRuntimeException; -import org.seasar.dao.SqlCommand; -import org.seasar.framework.beans.MethodNotFoundRuntimeException; - -/** - * The interceptor of S2Dao for DBFlute. - * - * @author DBFlute(AutoGenerator) - */ -public class S2DaoInterceptor extends - org.seasar.framework.aop.interceptors.AbstractInterceptor { - - //========================================================================== - // ========= - // Definition - // ========== - /** Serial version UID. (Default) */ - private static final long serialVersionUID = 1L; - - /** Log instance. */ - private static final org.apache.commons.logging.Log _log = org.apache.commons.logging.LogFactory - .getLog(S2DaoInterceptor.class); - - //========================================================================== - // ========= - // Attribute - // ========= - /** The factory of DAO meta data. */ - protected DaoMetaDataFactory _daoMetaDataFactory; - - //========================================================================== - // ========= - // Constructor - // =========== - /** - * Constructor. - * - * @param daoMetaDataFactory The factory of DAO meta data. (NotNull) - */ - public S2DaoInterceptor(DaoMetaDataFactory daoMetaDataFactory) { - _daoMetaDataFactory = daoMetaDataFactory; - } - - //========================================================================== - // ========= - // Execute Status Log - // ================== - protected void log(String msg) { - XLog.log(msg); - } - - protected boolean isLogEnabled() { - return XLog.isLogEnabled(); - } - - //========================================================================== - // ========= - // Invoke - // ====== - /** - * Invoke the method. - * - * @param invocation The method invocation. (NotNull) - * @return The result of the method. (Nullable) - * @throws Throwable - */ - public Object invoke(MethodInvocation invocation) throws Throwable { - clearThreadLocal(); - try { - return dispatchInvoking(invocation); - } finally { - clearThreadLocal(); - } - } - - /** - * Dispatch invoking the method. - * - * @param invocation The method invocation. (NotNull) - * @return The result of the method. (Nullable) - * @throws Throwable - */ - protected Object dispatchInvoking(MethodInvocation invocation) - throws Throwable { - final Method method = invocation.getMethod(); - if (!isAbstract(method)) { - return invocation.proceed(); - } - - // - - - - - - - - - - - - - - // Initialize DAO meta data - // - - - - - - - - - - - - - - if (method.getName().equals("initializeDaoMetaData")) { - initializeSqlCommand(invocation); - return null;// The end! (Initilization Only) - } - - // - - - - - - - - - - - - - // Preprocess outside-SQL - // - - - - - - - - - - - - - preprocessOutsideSql(invocation); - - // - - - - - - - - - - - - - - // Preprocess condition-bean - // - - - - - - - - - - - - - - final ConditionBean cb = preprocessConditionBean(invocation); - - // - - - - - - - - - - - // Set up SQL-command - // - - - - - - - - - - - final SqlCommand cmd; - try { - long beforeCmd = 0; - if (isLogEnabled()) { - beforeCmd = System.currentTimeMillis(); - } - cmd = findSqlCommand(invocation); - if (isLogEnabled()) { - final long afterCmd = System.currentTimeMillis(); - if (beforeCmd != afterCmd) { - logSqlCommand(invocation, cmd, beforeCmd, afterCmd); - } - } - } finally { - if (isLogEnabled()) { - logInvocation(invocation); - } - } - - long before = 0; - if (isLogEnabled()) { - before = System.currentTimeMillis(); - } - - // - - - - - - - - - - - // Execute SQL-command - // - - - - - - - - - - - Object ret = null; - try { - ret = cmd.execute(invocation.getArguments()); - } catch (Exception e) { - if (e.getClass().equals(NotSingleRowUpdatedRuntimeException.class)) { - throw new EntityAlreadyUpdatedException( - (NotSingleRowUpdatedRuntimeException) e); - } - throw e; - } finally { - postprocessConditionBean(invocation, cb); - } - final Class retType = method.getReturnType(); - assertRetType(retType, ret); - - if (isLogEnabled()) { - final long after = System.currentTimeMillis(); - logReturn(invocation, retType, ret, before, after); - } - - // - - - - - - - - - - - // Convert and Return! - // - - - - - - - - - - - if (retType.isPrimitive()) { - return org.seasar.framework.util.NumberConversionUtil - .convertPrimitiveWrapper(retType, ret); - } else if (Number.class.isAssignableFrom(retType)) { - return org.seasar.framework.util.NumberConversionUtil - .convertNumber(retType, ret); - } else { - return ret; - } - } - - //========================================================================== - // ========= - // SqlCommand - // ========== - protected void initializeSqlCommand(MethodInvocation invocation) { - final Class targetType = getTargetClass(invocation); - final DaoMetaData dmd = _daoMetaDataFactory.getDaoMetaData(targetType); - if (OutsideSqlDao.class.isAssignableFrom(targetType)) { - return;// Do nothing! - } else { - final Object[] arguments = invocation.getArguments(); - if (arguments != null && arguments.length > 0 - && arguments[0] instanceof String) { - final String methodName = (String) arguments[0]; - try { - dmd.getSqlCommand(methodName); - } catch (MethodNotFoundRuntimeException ignored) { - // Do nothing! - if (isLogEnabled()) { - log("Not Found the method: " + methodName + " msg=" - + ignored.getMessage()); - } - } - return; - } else { - String msg = "The method should have one string argument as method name: " - + invocation; - throw new IllegalStateException(msg); - } - } - } - - protected SqlCommand findSqlCommand(MethodInvocation invocation) { - final SqlCommand cmd; - final Class targetType = getTargetClass(invocation); - final DaoMetaData dmd = _daoMetaDataFactory.getDaoMetaData(targetType); - if (OutsideSqlDao.class.isAssignableFrom(targetType)) { - cmd = dmd - .getSqlCommand(generateSpecifiedOutsideSqlUniqueKey(invocation)); - } else { - cmd = dmd.getSqlCommand(invocation.getMethod().getName()); - } - return cmd; - } - - protected String generateSpecifiedOutsideSqlUniqueKey( - MethodInvocation invocation) { - final Object[] args = invocation.getArguments(); - final String path = (String) args[0]; - final Object pmb = args[1]; - final OutsideSqlOption option = (OutsideSqlOption) args[2]; - Object resultTypeSpecification = null; - if (args.length > 3) { - resultTypeSpecification = args[3]; - } - return OutsideSqlContext.generateSpecifiedOutsideSqlUniqueKey( - invocation.getMethod().getName(), path, pmb, option, - resultTypeSpecification); - } - - //========================================================================== - // ========= - // Log Invocation - // ============== - protected void logInvocation(MethodInvocation invocation) { - final StackTraceElement[] stackTrace = new Exception().getStackTrace(); - final InvokeNameResult behaviorResult = extractBehaviorInvokeName(stackTrace); - - final String invokeClassName; - final String invokeMethodName; - if (!behaviorResult.isEmptyResult()) { - invokeClassName = behaviorResult.getSimpleClassName(); - invokeMethodName = behaviorResult.getMethodName(); - } else { - final Method method = invocation.getMethod(); - invokeClassName = extractInvocationExpression(method); - invokeMethodName = method.getName(); - } - final String expWithoutKakko = buildInvocationExpressionWithoutKakko( - invocation, invokeClassName, invokeMethodName); - - // Save behavior invoke name for error message. - putObjectToMapContext("df:BehaviorInvokeName", expWithoutKakko + "()"); - - final String equalBorder = buildFitBorder("", "=", expWithoutKakko, - false); - final String invocationExpression = expWithoutKakko + "()"; - - log("/=====================================================" - + equalBorder + "=="); - log(" " - + invocationExpression); - log(" " - + equalBorder + "=/"); - - logPath(invocation, stackTrace, behaviorResult); - - // Specified OutsideSql - if (isSpecifiedOutsideSql(invocation)) { - final OutsideSqlContext outsideSqlContext = getOutsideSqlContext(); - if (!outsideSqlContext.isProcedure()) {// [DBFlute-0.7.5] - Object[] args = invocation.getArguments(); - if (outsideSqlContext != null) { - log("path: " + outsideSqlContext.getOutsideSqlPath()); - } else { - log("path: " + getOutsideSqlPath(args)); - } - log("option: " + getOutsideSqlOption(args)); - } - } - } - - protected String buildInvocationExpressionWithoutKakko( - MethodInvocation invocation, String invokeClassName, - String invokeMethodName) { - if (invokeClassName.contains("OutsideSql") - && invokeClassName.endsWith("Executor")) { // OutsideSql - // Executor Handling - try { - final String originalName = invokeClassName; - if (isSpecifiedOutsideSql()) { - final OutsideSqlContext outsideSqlContext = getOutsideSqlContext(); - final String tableDbName = outsideSqlContext - .getTableDbName(); - final DBMeta dbmeta = DBMetaInstanceHandler - .findDBMeta(tableDbName); - final String behaviorTypeName = dbmeta - .getBehaviorTypeName(); - final String behaviorClassName = behaviorTypeName - .substring(behaviorTypeName.lastIndexOf(".") - + ".".length()); - invokeClassName = behaviorClassName + ".outsideSql()"; - if (originalName.endsWith("OutsideSqlEntityExecutor")) { - invokeClassName = invokeClassName + ".entityHandling()"; - } else if (originalName - .endsWith("OutsideSqlPagingExecutor")) { - if (outsideSqlContext.isOffsetByCursorForcedly() - || outsideSqlContext.isLimitByCursorForcedly()) { - invokeClassName = invokeClassName + ".autoPaging()"; - } else { - invokeClassName = invokeClassName - + ".manualPaging()"; - } - } else if (originalName - .endsWith("OutsideSqlCursorExecutor")) { - invokeClassName = invokeClassName + ".cursorHandling()"; - } - } else { - invokeClassName = "OutsideSql"; - } - } catch (RuntimeException ignored) { - log("Ignored exception occurred: msg=" + ignored.getMessage()); - } - } - String invocationExpressionWithoutKakko = invokeClassName + "." - + invokeMethodName; - if ("selectPage".equals(invokeMethodName)) { // Special Handling! - boolean resultTypeInteger = false; - if (isSpecifiedOutsideSql()) { - final OutsideSqlContext outsideSqlContext = getOutsideSqlContext(); - final Object resultTypeSpecification = outsideSqlContext - .getResultTypeSpecification(); - if (resultTypeSpecification != null - && resultTypeSpecification instanceof Class) { - final Class resultType = (Class) resultTypeSpecification; - if (Integer.class.isAssignableFrom(resultType)) { - resultTypeInteger = true; - } - } - } - if (resultTypeInteger - || "selectCount".equals(invocation.getMethod().getName())) { - invocationExpressionWithoutKakko = invocationExpressionWithoutKakko - + "():count"; - } else { - invocationExpressionWithoutKakko = invocationExpressionWithoutKakko - + "():paging"; - } - } - return invocationExpressionWithoutKakko; - } - - protected void logPath(MethodInvocation invocation, - StackTraceElement[] stackTrace, InvokeNameResult behaviorResult) { - final int bhvNextIndex = behaviorResult.getNextStartIndex(); - final InvokeNameResult clientResult = extractClientInvokeName( - stackTrace, bhvNextIndex); - final int clientFirstIndex = clientResult.getFoundFirstIndex(); - final InvokeNameResult byPassResult = extractByPassInvokeName( - stackTrace, bhvNextIndex, clientFirstIndex - bhvNextIndex); - - final String clientInvokeName = clientResult.getInvokeName(); - final String byPassInvokeName = byPassResult.getInvokeName(); - final String behaviorInvokeName = behaviorResult.getInvokeName(); - if (clientInvokeName.trim().length() == 0 - && byPassInvokeName.trim().length() == 0) { - return; - } - - // Save client invoke name for error message. - if (!clientResult.isEmptyResult()) { - putObjectToMapContext("df:ClientInvokeName", clientInvokeName); - } - // Save by-pass invoke name for error message. - if (!byPassResult.isEmptyResult()) { - putObjectToMapContext("df:ByPassInvokeName", byPassInvokeName); - } - - log(clientInvokeName + byPassInvokeName + behaviorInvokeName + "..."); - } - - protected String buildFitBorder(String prefix, String element, - String lengthTargetString, boolean space) { - final int length = space ? lengthTargetString.length() / 2 - : lengthTargetString.length(); - final StringBuffer sb = new StringBuffer(); - sb.append(prefix); - for (int i = 0; i < length; i++) { - sb.append(element); - if (space) { - sb.append(" "); - } - } - if (space) { - sb.append(element); - } - return sb.toString(); - } - - protected InvokeNameResult extractClientInvokeName( - StackTraceElement[] stackTrace, final int startIndex) { - final List 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 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 suffixList = Arrays.asList(new String[] { "Bhv", - "BehaviorReadable", "BehaviorWritable", "PagingInvoker" }); - final List keywordList = Arrays.asList(new String[] { "Bhv$", - "BehaviorReadable$", "BehaviorWritable$" }); - final List ousideSql1List = Arrays - .asList(new String[] { "OutsideSql" }); - final List ousideSql2List = Arrays - .asList(new String[] { "Executor" }); - final List 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 suffixList) { - for (String suffix : suffixList) { - if (className.endsWith(suffix)) { - return true; - } - } - return false; - } - - protected boolean isClassNameContains(String className, - List 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 outsideSqlType = jp.sf.pal.board.db.allcommon.annotation.OutsideSql.class; - final jp.sf.pal.board.db.allcommon.annotation.OutsideSql outsideSql = invocation - .getMethod().getAnnotation(outsideSqlType); - - // Traditional OutsideSql - if (outsideSql != null - && (outsideSql.dynamicBinding() || outsideSql.offsetByCursor() - || outsideSql.offsetByCursor() || outsideSql - .limitByCursor())) { - final OutsideSqlContext outsideSqlContext = new OutsideSqlContext(); - outsideSqlContext.setDynamicBinding(outsideSql.dynamicBinding()); - outsideSqlContext.setOffsetByCursorForcedly(outsideSql - .offsetByCursor()); - outsideSqlContext.setLimitByCursorForcedly(outsideSql - .limitByCursor()); - OutsideSqlContext.setOutsideSqlContextOnThread(outsideSqlContext); - - // Set up fetchNarrowingBean. - final Object[] args = invocation.getArguments(); - if (args == null || args.length == 0) { - return; - } - if (FetchNarrowingBeanContext.isTheTypeFetchNarrowingBean(args[0] - .getClass())) { - FetchNarrowingBeanContext - .setFetchNarrowingBeanOnThread((FetchNarrowingBean) args[0]); - } - return; - } - - // Specified OutsideSql - if (isSpecifiedOutsideSql(invocation)) { - if (isOutsideSqlDaoMethodSelect(invocation)) { - setupOutsideSqlContextSelect(invocation); - } else { - setupOutsideSqlContextExecute(invocation); - } - return; - } - } - - protected boolean isSpecifiedOutsideSql(MethodInvocation invocation) { - return OutsideSqlDao.class.isAssignableFrom(getTargetClass(invocation)); - } - - // - - - - - - - - - - - - - // Select - // - - - - protected boolean isOutsideSqlDaoMethodSelect(MethodInvocation invocation) { - return invocation.getMethod().getName().startsWith("select"); - } - - protected void setupOutsideSqlContextSelect(MethodInvocation invocation) { - final Object[] args = invocation.getArguments(); - if (args.length != 4) { - String msg = "Internal Error! OutsideSqlDao.selectXxx() should have 4 arguements: args.length=" - + args.length; - throw new IllegalStateException(msg); - } - final String path = getOutsideSqlPath(args); - final Object pmb = getOutsideSqlParameterBean(args); - final OutsideSqlOption option = getOutsideSqlOption(args); - final Object resultTypeSpecification = args[3]; - final OutsideSqlContext outsideSqlContext = new OutsideSqlContext(); - outsideSqlContext.setDynamicBinding(option.isDynamicBinding()); - outsideSqlContext.setOffsetByCursorForcedly(option.isAutoPaging()); - outsideSqlContext.setLimitByCursorForcedly(option.isAutoPaging()); - outsideSqlContext.setOutsideSqlPath(path); - outsideSqlContext.setParameterBean(pmb); - outsideSqlContext.setResultTypeSpecification(resultTypeSpecification); - outsideSqlContext.setMethodName(invocation.getMethod().getName()); - outsideSqlContext.setStatementConfig(option.getStatementConfig()); - outsideSqlContext.setTableDbName(option.getTableDbName()); - outsideSqlContext.setupBehaviorQueryPathIfNeeds(); - OutsideSqlContext.setOutsideSqlContextOnThread(outsideSqlContext); - - // Set up fetchNarrowingBean. - setupOutsideSqlFetchNarrowingBean(pmb, option); - } - - // - - - - - - - - - - - - - // Execute - // - - - - - protected void setupOutsideSqlContextExecute(MethodInvocation invocation) { - final Object[] args = invocation.getArguments(); - if (args.length != 3) { - String msg = "Internal Error! OutsideSqlDao.execute() should have 3 arguements: args.length=" - + args.length; - throw new IllegalStateException(msg); - } - final String path = getOutsideSqlPath(args); - final Object pmb = getOutsideSqlParameterBean(args); - final OutsideSqlOption option = getOutsideSqlOption(args); - final OutsideSqlContext outsideSqlContext = new OutsideSqlContext(); - outsideSqlContext.setDynamicBinding(option.isDynamicBinding()); - outsideSqlContext.setOffsetByCursorForcedly(option.isAutoPaging()); - outsideSqlContext.setLimitByCursorForcedly(option.isAutoPaging()); - outsideSqlContext.setOutsideSqlPath(path); - outsideSqlContext.setParameterBean(pmb); - outsideSqlContext.setMethodName(invocation.getMethod().getName()); - outsideSqlContext.setStatementConfig(option.getStatementConfig()); - outsideSqlContext.setTableDbName(option.getTableDbName()); - outsideSqlContext.setupBehaviorQueryPathIfNeeds(); - OutsideSqlContext.setOutsideSqlContextOnThread(outsideSqlContext); - - // Set up fetchNarrowingBean. - setupOutsideSqlFetchNarrowingBean(pmb, option); - } - - // - - - - - - - - - - - - - // Common - // - - - - protected String getOutsideSqlPath(Object[] args) { - return (String) args[0]; - } - - protected Object getOutsideSqlParameterBean(Object[] args) { - return args[1]; - } - - protected OutsideSqlOption getOutsideSqlOption(Object[] args) { - return (OutsideSqlOption) args[2]; - } - - protected void setupOutsideSqlFetchNarrowingBean(Object pmb, - OutsideSqlOption option) { - if (pmb == null - || !FetchNarrowingBeanContext.isTheTypeFetchNarrowingBean(pmb - .getClass())) { - return; - } - final FetchNarrowingBean fetchNarrowingBean = (FetchNarrowingBean) pmb; - if (option.isManualPaging()) { - fetchNarrowingBean.ignoreFetchNarrowing(); - } - FetchNarrowingBeanContext - .setFetchNarrowingBeanOnThread(fetchNarrowingBean); - } - - // ----------------------------------------------------- - // ConditionBean - // ------------- - /** - * Pre-process conditionBean. - *

- * If this method is condition bean select target, make dynamic SQL. Else - * nothing. - * - * @param invocation Method invocation. (NotNull) - * @return ConditionBean. (Nullable) - */ - protected ConditionBean preprocessConditionBean(MethodInvocation invocation) { - final OutsideSqlContext outsideSqlContext = getOutsideSqlContext(); - if (outsideSqlContext != null) { - return null; // Because it has already finished setting up - // fetchNarrowingBean for outsideSql here. - } - - final ConditionBean cb; - { - final Object[] args = invocation.getArguments(); - if (args == null || args.length == 0) { - return null; - } - final Object arg0 = args[0]; - if (arg0 == null) { - return null; - } - if (!ConditionBeanContext.isTheTypeConditionBean(arg0.getClass())) {// The - // argument - // is - // not - // condition - // - - // bean - // ... - if (FetchNarrowingBeanContext.isTheTypeFetchNarrowingBean(arg0 - .getClass()) - && !isSelectCountIgnoreFetchScopeMethod(invocation)) { - // Fetch-narrowing-bean and Not select count! - FetchNarrowingBeanContext - .setFetchNarrowingBeanOnThread((FetchNarrowingBean) arg0); - } - return null; - } - cb = (ConditionBean) arg0; - } - - if (isSelectCountIgnoreFetchScopeMethod(invocation)) { - cb.xsetupSelectCountIgnoreFetchScope(); - } else { - FetchNarrowingBeanContext.setFetchNarrowingBeanOnThread(cb); - } - - ConditionBeanContext.setConditionBeanOnThread(cb); - return cb; - } - - /** - * Post-process condition-bean. - * - * @param invocation Method invocation. (NotNull) - * @param cb Condition-bean. (Nullable) - */ - protected void postprocessConditionBean(MethodInvocation invocation, - ConditionBean cb) { - if (cb == null) { - return; - } - if (isSelectCountIgnoreFetchScopeMethod(invocation)) { - cb.xafterCareSelectCountIgnoreFetchScope(); - } - } - - // ----------------------------------------------------- - // Clear Thread Local - // ------------------ - protected void clearThreadLocal() { - if (OutsideSqlContext.isExistOutsideSqlContextOnThread()) { - OutsideSqlContext.clearOutsideSqlContextOnThread(); - } - if (FetchNarrowingBeanContext.isExistFetchNarrowingBeanOnThread()) { - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - // Because there is possible that fetch narrowing has been ignored - // for manualPaging of outsideSql. - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - FetchNarrowingBeanContext.getFetchNarrowingBeanOnThread() - .restoreIgnoredFetchNarrowing(); - - FetchNarrowingBeanContext.clearFetchNarrowingBeanOnThread(); - } - if (ConditionBeanContext.isExistConditionBeanOnThread()) { - ConditionBeanContext.clearConditionBeanOnThread(); - } - if (InternalMapContext.isExistInternalMapContextOnThread()) { - InternalMapContext.clearInternalMapContextOnThread(); - } - } - - //========================================================================== - // ========= - // Context Helper - // ============== - protected OutsideSqlContext getOutsideSqlContext() { - if (!OutsideSqlContext.isExistOutsideSqlContextOnThread()) { - return null; - } - return OutsideSqlContext.getOutsideSqlContextOnThread(); - } - - protected boolean isSpecifiedOutsideSql() { - final OutsideSqlContext outsideSqlContext = getOutsideSqlContext(); - return outsideSqlContext != null - && outsideSqlContext.isSpecifiedOutsideSql(); - } - - protected void putObjectToMapContext(String key, Object value) { - InternalMapContext.setObject(key, value); - } - - //========================================================================== - // ========= - // Determination - // ============= - /** - * Is select count ignore-fetch-scope method? - * - * @param invocation Method invocation. (NotNull) - * @return Determination. - */ - protected boolean isSelectCountIgnoreFetchScopeMethod( - MethodInvocation invocation) { - final String name = invocation.getMethod().getName(); - return name.startsWith("readCount") || name.startsWith("selectCount"); - } - - //========================================================================== - // ========= - // General Helper - // ============== - /** - * Is the method abstract? - * - * @param method Method. (NotNull) - * @return Determination. (NotNull) - */ - public boolean isAbstract(Method method) { - final int mod = method.getModifiers(); - return Modifier.isAbstract(mod); - } - - /** - * Get the value of line separator. - * - * @return The value of line separator. (NotNull) - */ - protected String getLineSeparator() { - return System.getProperty("line.separator"); - } -} \ No newline at end of file Deleted: board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/s2dao/S2DaoLatestSqlProvider.java =================================================================== --- board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/s2dao/S2DaoLatestSqlProvider.java 2008-12-27 22:06:42 UTC (rev 1624) +++ board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/s2dao/S2DaoLatestSqlProvider.java 2008-12-27 22:09:08 UTC (rev 1625) @@ -1,20 +0,0 @@ -package jp.sf.pal.board.db.allcommon.s2dao; - -import jp.sf.pal.board.db.allcommon.jdbc.LatestSqlProvider; -import jp.sf.pal.board.db.allcommon.s2dao.internal.sqllog.InternalSqlLogRegistry; - -/** - * The provider of latest SQL as S2Dao. This instance should be singleton. - * - * @author DBFlute(AutoGenerator) - */ -public class S2DaoLatestSqlProvider implements LatestSqlProvider { - - public String getDisplaySql() { - return InternalSqlLogRegistry.peekCompleteSql(); - } - - public void clearSqlCache() { - InternalSqlLogRegistry.clearSqlLogRegistry(); - } -} Deleted: board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/s2dao/S2DaoMetaDataExtension.java =================================================================== --- board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/s2dao/S2DaoMetaDataExtension.java 2008-12-27 22:06:42 UTC (rev 1624) +++ board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/s2dao/S2DaoMetaDataExtension.java 2008-12-27 22:09:08 UTC (rev 1625) @@ -1,1460 +0,0 @@ -package jp.sf.pal.board.db.allcommon.s2dao; - -import java.lang.reflect.Method; -import java.lang.reflect.ParameterizedType; -import java.lang.reflect.Type; -import java.sql.Connection; -import java.sql.DatabaseMetaData; -import java.sql.PreparedStatement; -import java.sql.ResultSet; -import java.sql.SQLException; -import java.sql.Statement; -import java.util.ArrayList; -import java.util.List; - -import javax.sql.DataSource; - -import jp.sf.pal.board.db.allcommon.BehaviorSelector; -import jp.sf.pal.board.db.allcommon.Entity; -import jp.sf.pal.board.db.allcommon.annotation.OutsideSql; -import jp.sf.pal.board.db.allcommon.cbean.ConditionBean; -import jp.sf.pal.board.db.allcommon.cbean.ConditionBeanContext; -import jp.sf.pal.board.db.allcommon.cbean.outsidesql.OutsideSqlContext; -import jp.sf.pal.board.db.allcommon.dbmeta.DBMeta; -import jp.sf.pal.board.db.allcommon.exception.BatchEntityAlreadyUpdatedException; -import jp.sf.pal.board.db.allcommon.exception.EntityAlreadyDeletedException; -import jp.sf.pal.board.db.allcommon.exception.EntityDuplicatedException; -import jp.sf.pal.board.db.allcommon.jdbc.CursorHandler; -import jp.sf.pal.board.db.allcommon.s2dao.internal.rshandler.InternalBeanArrayMetaDataResultSetHandler; -import jp.sf.pal.board.db.allcommon.s2dao.internal.rshandler.InternalBeanListMetaDataResultSetHandler; -import jp.sf.pal.board.db.allcommon.s2dao.internal.sqlcommand.InternalDeleteAutoStaticCommand; -import jp.sf.pal.board.db.allcommon.s2dao.internal.sqlcommand.InternalDeleteBatchAutoStaticCommand; -import jp.sf.pal.board.db.allcommon.s2dao.internal.sqlcommand.InternalDeleteQueryAutoDynamicCommand; -import jp.sf.pal.board.db.allcommon.s2dao.internal.sqlcommand.InternalInsertAutoDynamicCommand; -import jp.sf.pal.board.db.allcommon.s2dao.internal.sqlcommand.InternalInsertBatchAutoStaticCommand; -import jp.sf.pal.board.db.allcommon.s2dao.internal.sqlcommand.InternalProcedureCommand; -import jp.sf.pal.board.db.allcommon.s2dao.internal.sqlcommand.InternalUpdateAutoDynamicCommand; -import jp.sf.pal.board.db.allcommon.s2dao.internal.sqlcommand.InternalUpdateBatchAutoStaticCommand; -import jp.sf.pal.board.db.allcommon.s2dao.internal.sqlcommand.InternalUpdateDynamicCommand; -import jp.sf.pal.board.db.allcommon.s2dao.internal.sqlcommand.InternalUpdateModifiedOnlyCommand; -import jp.sf.pal.board.db.allcommon.s2dao.internal.sqlcommand.InternalUpdateQueryAutoDynamicCommand; -import jp.sf.pal.board.db.allcommon.s2dao.internal.sqlhandler.InternalDeleteBatchAutoHandler; -import jp.sf.pal.board.db.allcommon.s2dao.internal.sqlhandler.InternalUpdateBatchAutoHandler; -import jp.sf.pal.board.db.allcommon.s2dao.internal.sqlhandler.InternalBasicHandler.SQLExceptionHandler; -import jp.sf.pal.board.db.allcommon.s2dao.internal.various.InternalProcedureMetaData; -import jp.sf.pal.board.db.allcommon.s2dao.internal.various.InternalProcedureMetaDataFactory; -import jp.sf.pal.board.db.allcommon.s2dao.internal.various.InternalRelationRowCreator; -import jp.sf.pal.board.db.allcommon.s2dao.internal.various.InternalRowCreator; -import jp.sf.pal.board.db.allcommon.util.SimpleSystemUtil; - -import org.seasar.dao.BeanEnhancer; -import org.seasar.dao.BeanMetaData; -import org.seasar.dao.BeanMetaDataFactory; -import org.seasar.dao.ColumnNaming; -import org.seasar.dao.PropertyTypeFactoryBuilder; -import org.seasar.dao.RelationPropertyTypeFactoryBuilder; -import org.seasar.dao.RelationRowCreator; -import org.seasar.dao.RowCreator; -import org.seasar.dao.SqlCommand; -import org.seasar.dao.TableNaming; -import org.seasar.dao.dbms.DbmsManager; -import org.seasar.dao.impl.BeanMetaDataImpl; -import org.seasar.dao.impl.DaoMetaDataImpl; -import org.seasar.dao.impl.ResultSetHandlerFactoryImpl; -import org.seasar.dao.impl.SelectDynamicCommand; -import org.seasar.dao.impl.UpdateAutoStaticCommand; -import org.seasar.extension.jdbc.ResultSetHandler; -import org.seasar.extension.jdbc.StatementFactory; -import org.seasar.extension.jdbc.ValueType; -import org.seasar.extension.jdbc.types.ValueTypes; -import org.seasar.framework.beans.MethodNotFoundRuntimeException; -import org.seasar.framework.beans.factory.BeanDescFactory; -import org.seasar.framework.util.MethodUtil; - -/** - * The extension of DaoMetaDataImpl for DBFlute. - * - * @author DBFlute(AutoGenerator) - */ - ¡÷ SuppressWarnings("unchecked") -public class S2DaoMetaDataExtension extends DaoMetaDataImpl { - - //========================================================================== - // ========= - // Definition - // ========== - /** Log instance. */ - private static final org.apache.commons.logging.Log _log = org.apache.commons.logging.LogFactory - .getLog(S2DaoMetaDataExtension.class); - - //========================================================================== - // ========= - // Attribute - // ========= - /** Bean enhancer. */ - protected BeanEnhancer beanEnhancer; - - /** The factory of annotation reader. */ - protected org.seasar.dao.AnnotationReaderFactory annotationReaderFactory; - - /** The naming of column. {After S2Dao-1.0.47} */ - protected ColumnNaming columnNaming; - - /** The builder of property type factory. {After S2Dao-1.0.47} */ - protected PropertyTypeFactoryBuilder propertyTypeFactoryBuilder; - - /** The builder of relation property type factory. {After S2Dao-1.0.47} */ - protected RelationPropertyTypeFactoryBuilder relationPropertyTypeFactoryBuilder; - - /** The builder of table naming. {After S2Dao-1.0.47} */ - protected TableNaming tableNaming; - - // ----------------------------------------------------- - // DBFlute Extension - // ----------------- - /** The selector of behavior. {Since DBFlute-0.7.1} */ - protected BehaviorSelector _behaviorSelector; - - /** The lock monitor of method initialization. */ - protected Object _methodInitializationLockMonitor = new Object(); - - /** The determination of internal debug. {Since DBFlute-0.6.2} */ - protected boolean _internalDebug; - - //========================================================================== - // ========= - // Constructor - // =========== - public S2DaoMetaDataExtension() { - } - - //========================================================================== - // ========= - // Initialize Override - // =================== - @Override - public void initialize() { - beanClass = daoAnnotationReader.getBeanClass(); - daoInterface = getDaoInterface(daoClass); - daoBeanDesc = BeanDescFactory.getBeanDesc(daoClass); - final Connection conn = getConnection();// It is first impact to - // Database! - try { - final DatabaseMetaData dbMetaData = getMetaData(conn); - dbms = DbmsManager.getDbms(getDatabaseProductName(dbMetaData)); - } finally { - close(conn); - } - this.beanMetaData = beanMetaDataFactory.createBeanMetaData( - daoInterface, beanClass); - checkSingleRowUpdateForAll = daoAnnotationReader - .isCheckSingleRowUpdate(); - - // Comment out for lazy-load! - // setupSqlCommand(); - } - - //========================================================================== - // ========= - // SqlCommand Setup Override - // ========================= - @Override - public SqlCommand getSqlCommand(String methodName) - throws MethodNotFoundRuntimeException { - SqlCommand cmd = (SqlCommand) sqlCommands.get(methodName); - if (cmd != null) { - return cmd; - } - synchronized (_methodInitializationLockMonitor) { - cmd = (SqlCommand) sqlCommands.get(methodName); - if (cmd != null) { - if (_log.isDebugEnabled()) { - _log - .debug("...Getting sqlCommand as cache because the previous thread have already initilized."); - } - return cmd; - } - if (_log.isDebugEnabled()) { - _log.debug("...Initializing sqlCommand for " + methodName - + "()."); - } - cmd = initializeSqlCommand(methodName); - } - return cmd; - } - - protected SqlCommand initializeSqlCommand(String methodName) - throws MethodNotFoundRuntimeException { - if (OutsideSqlContext.isExistOutsideSqlContextOnThread()) { - final OutsideSqlContext outsideSqlContext = OutsideSqlContext - .getOutsideSqlContextOnThread(); - if (outsideSqlContext != null - && outsideSqlContext.isSpecifiedOutsideSql()) { - return initializeSpecifiedOutsideSqlCommand(methodName, - outsideSqlContext); - } - } - final Method[] methods = daoBeanDesc.getMethods(methodName); - if (methods.length == 1 && MethodUtil.isAbstract(methods[0])) { - setupMethod(methods[0]); - } - final SqlCommand cmd = (SqlCommand) sqlCommands.get(methodName); - if (cmd != null) { - return cmd; - } - throw new MethodNotFoundRuntimeException(daoClass, methodName, null); - } - - protected SqlCommand initializeSpecifiedOutsideSqlCommand( - String sqlCommandKey, OutsideSqlContext outsideSqlContext) - throws MethodNotFoundRuntimeException { - final Method[] methods = daoBeanDesc.getMethods(outsideSqlContext - .getMethodName());// By real method name. - if (methods.length == 1 - && org.seasar.framework.util.MethodUtil.isAbstract(methods[0])) { - final Method method = methods[0]; - if (isOutsideSqlDaoMethodSelect(method)) { - setupSpecifiedOutsideSqlSelectCommand(sqlCommandKey, method, - outsideSqlContext); - } else if (isOutsideSqlDaoMethodCall(method)) { - setupSpecifiedOutsideSqlCallCommand(sqlCommandKey, method, - outsideSqlContext); - } else { - setupSpecifiedOutsideSqlExecuteCommand(sqlCommandKey, method, - outsideSqlContext); - } - } - final SqlCommand cmd = (SqlCommand) sqlCommands.get(sqlCommandKey); - if (cmd != null) { - return cmd; - } - String msg = "Internal Error! The sql-command is not found:"; - msg = msg + " sqlCommandKey=" + sqlCommandKey; - msg = msg + " sqlCommands=" + sqlCommands; - throw new IllegalStateException(msg); - } - - protected boolean isOutsideSqlDaoMethodSelect(Method method) { - return method.getName().startsWith("select"); - } - - protected boolean isOutsideSqlDaoMethodCall(Method method) { - return method.getName().startsWith("call"); - } - - //========================================================================== - // ========= - // Assert Override - // =============== - @Override - protected void setupMethodByAnnotation(Class daoInterface, Method method) { - final String sql = daoAnnotationReader.getSQL(method, dbms.getSuffix()); - assertSQLAnnotationUnsupported(method, sql); - super.setupMethodByAnnotation(daoInterface, method); - } - - protected void assertSQLAnnotationUnsupported(final Method method, - String sql) { - if (sql != null) { - throwS2DaoSQLAnnotationUnsupportedException(method, sql); - } - } - - protected void throwS2DaoSQLAnnotationUnsupportedException( - final Method method, String sql) { - String msg = "Look! Read the message below." + getLineSeparator(); - msg = msg - + "/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *" - + getLineSeparator(); - msg = msg - + "Sorry, the SQL annotation of S2Dao is unsupported on DBFlute!" - + getLineSeparator(); - msg = msg + getLineSeparator(); - msg = msg + "[Advice]" + getLineSeparator(); - msg = msg + "Please use outside-sql of behavior." + getLineSeparator(); - msg = msg + " For example:" + getLineSeparator(); - msg = msg + " memberBhv.outsideSql().selectList(...)" - + getLineSeparator(); - msg = msg + getLineSeparator(); - msg = msg + "If you've got to use it, you can set the property:" - + getLineSeparator(); - msg = msg + "{torque.isCompatibleS2DaoSQLAnnotationValid = true}" - + getLineSeparator(); - msg = msg + "But pay attention to version up of DBFlute" - + getLineSeparator(); - msg = msg - + " because the property will not always supported at the future." - + getLineSeparator(); - msg = msg + getLineSeparator(); - msg = msg + "[Method]" + getLineSeparator() + method - + getLineSeparator(); - msg = msg + getLineSeparator(); - msg = msg + "[SQL]" + getLineSeparator() + sql + getLineSeparator(); - msg = msg + "* * * * * * * * * */"; - throw new UnsupportedOperationException(msg); - } - - @Override - protected void setupMethodByAuto(Method method) { - final OutsideSql outsideSql = method.getAnnotation(OutsideSql.class); - if (outsideSql != null) { - String msg = "This method '" + method.getName() - + "()' should use Outside Sql but the file was not found!"; - msg = msg + " Expected sql file name is '" - + method.getDeclaringClass().getSimpleName() + "_" - + method.getName() + ".sql'"; - throw new IllegalStateException(msg); - } - super.setupMethodByAuto(method); - } - - //========================================================================== - // ========= - // ConditionBean Override - // ====================== - @Override - protected void setupSelectMethodByAuto(final Method method) { - if (setupInternalSelectMethodSequenceNextVal(method)) { // For sequence - return; - } - if (setupInternalSelectMethodEntityByIdsForBuri(method)) { // For Buri - return; - } - - // Assert unsupported - final String query = daoAnnotationReader.getQuery(method); - assertQueryAnnotationUnsupported(method, query); - final String[] argNames = daoAnnotationReader.getArgNames(method); - assertAutoQueryByArgsAnnotationUnsupported(method, argNames); - - // Here it is the only method that the argument is DTO. - final ResultSetHandler handler = createResultSetHandler(method); - final SqlCommand cmd = setupInternalNonQuerySelectMethodByDto(method, - handler); - - putSqlCommand(method.getName(), cmd); - } - - protected boolean setupInternalSelectMethodSequenceNextVal( - final Method method) { // For sequence - if (!"selectNextVal".equals(method.getName())) { - return false; - } - final DBMeta dbmeta = findDBMeta(); - if (!dbmeta.hasSequence()) { - String msg = "If the method 'selectNextVal()' exists, DBMeta.hasSequence() should return true:"; - msg = msg + " dbmeta.hasSequence()=" + dbmeta.hasSequence() - + " method=" + method; - throw new IllegalStateException(msg); - } - final String nextValSql = dbmeta.getSequenceNextValSql(); - if (nextValSql == null) { - String msg = "If the method 'selectNextVal()' exists, DBMeta.getSequenceNextValSql() should not return null:"; - msg = msg + " dbmeta.getSequenceNextValSql()=" - + dbmeta.getSequenceNextValSql() + " method=" + method; - throw new IllegalStateException(msg); - } - setupSelectMethodByManual(method, nextValSql); - return true; - } - - protected boolean setupInternalSelectMethodEntityByIdsForBuri( - final Method method) { // For Buri - if (!"getEntityByIds".equals(method.getName())) { - return false; - } - final ResultSetHandler handler = createResultSetHandler(method); - final String[] argNames = daoAnnotationReader.getArgNames(method); - final String query = daoAnnotationReader.getQuery(method); - if (query == null) { - String msg = "The method 'getEntityByIds()' should have QUERY annotation:"; - msg = msg + " method=" + method; - throw new IllegalStateException(msg); - } - final Class[] types = method.getParameterTypes(); - final SelectDynamicCommand cmd = createSelectDynamicCommand(handler, - query); - cmd.setArgNames(argNames); - cmd.setArgTypes(types); - putSqlCommand(method.getName(), cmd); - return true; - } - - protected void assertQueryAnnotationUnsupported(final Method method, - String query) { - if (query != null) { - String msg = "Sorry! The QUERY annotation of S2Dao is unsupported on DBFlute:"; - msg = msg + " query=" + query + " method=" + method; - throw new UnsupportedOperationException(msg); - } - } - - protected void assertAutoQueryByArgsAnnotationUnsupported( - final Method method, String[] argNames) { - if (!isAutoSelectSqlByDto(method, argNames)) { - String msg = "Sorry! The auto query by ARGS annotation of S2Dao is unsupported on DBFlute:"; - msg = msg + " argNames=" + argNames + " method=" + method; - throw new UnsupportedOperationException(msg); - } - } - - // For condition-bean! - protected SqlCommand setupInternalNonQuerySelectMethodByDto(Method method, - ResultSetHandler handler) { - final Class[] argTypes = method.getParameterTypes(); - assertAutoQueryByDtoUnsupported(method, argTypes); - final S2DaoSelectDynamicCommand cmd = createCustomizeSelectDynamicCommand(handler); - cmd.setArgNames(new String[] { "dto" }); - cmd.setArgTypes(argTypes); - return cmd; - } - - protected void assertAutoQueryByDtoUnsupported(final Method method, - Class[] argTypes) { - final Class firstArgType = argTypes[0]; - if (!ConditionBeanContext.isTheTypeConditionBean(firstArgType)) { - String msg = "Sorry! The auto query by DTO of S2Dao is unsupported on DBFlute:"; - msg = msg + " dto=" + firstArgType + " method=" + method; - throw new UnsupportedOperationException(msg); - } - } - - //========================================================================== - // ========= - // Insert and Update and Delete By Auto Override - // ============================================= - // ----------------------------------------------------- - // Insert - // ------ - @Override - protected void setupInsertMethodByAuto(final Method method) { - checkAutoUpdateMethod(method); - final String[] propertyNames = getPersistentPropertyNames(method); - final SqlCommand command; - if (isUpdateSignatureForBean(method)) { - final InternalInsertAutoDynamicCommand cmd = new InternalInsertAutoDynamicCommand(); - cmd.setBeanMetaData(getBeanMetaData()); - cmd.setDataSource(dataSource); - - // It is unnecessary for DBFlute! - // cmd.setNotSingleRowUpdatedExceptionClass( - // getNotSingleRowUpdatedExceptionClass(method)); - - cmd.setPropertyNames(propertyNames); - cmd.setStatementFactory(statementFactory); - cmd.setCheckSingleRowUpdate(isCheckSingleRowUpdate(method)); - command = cmd; - } else { - boolean returningRows = false; - if (int[].class.isAssignableFrom(method.getReturnType())) { - returningRows = true; - } - final InternalInsertBatchAutoStaticCommand cmd = new InternalInsertBatchAutoStaticCommand( - dataSource, statementFactory, getBeanMetaData(), - propertyNames, returningRows); - command = cmd; - } - putSqlCommand(method.getName(), command); - } - - // ----------------------------------------------------- - // Update - // ------ - @Override - protected void setupUpdateMethodByAuto(final Method method) { - if (isFirstArgumentConditionBean(method)) { - final SqlCommand cmd = new InternalUpdateQueryAutoDynamicCommand( - dataSource, statementFactory); - putSqlCommand(method.getName(), cmd); - return; - } - checkAutoUpdateMethod(method); - final String[] propertyNames = getPersistentPropertyNames(method); - SqlCommand cmd; - if (isUpdateSignatureForBean(method)) { - if (isUnlessNull(method.getName())) { - cmd = createInternalUpdateAutoDynamicCommand(method, - propertyNames); - } else if (isModifiedOnly(method.getName())) { - cmd = createInternalUpdateModifiedOnlyCommand(method, - propertyNames); - } else { - cmd = createInternalUpdateAutoStaticCommand(method, - propertyNames); - } - } else { - boolean returningRows = false; - if (int[].class.isAssignableFrom(method.getReturnType())) { - returningRows = true; - } - cmd = createInternalUpdateBatchAutoStaticCommand(method, - propertyNames, returningRows); - } - putSqlCommand(method.getName(), cmd); - } - - protected UpdateAutoStaticCommand createInternalUpdateAutoStaticCommand( - final Method method, final String[] propertyNames) { - final UpdateAutoStaticCommand cmd = new UpdateAutoStaticCommand( - dataSource, statementFactory, beanMetaData, propertyNames); - cmd.setCheckSingleRowUpdate(isCheckSingleRowUpdate(method)); - return cmd; - } - - protected InternalUpdateAutoDynamicCommand createInternalUpdateAutoDynamicCommand( - Method method, String[] propertyNames) { - final InternalUpdateAutoDynamicCommand cmd = newUpdateAutoDynamicCommand( - method, dataSource, statementFactory); - cmd.setBeanMetaData(createBeanMetaData4UpdateDeleteByAuto(method));// Extension - // Point - // ! - cmd.setPropertyNames(propertyNames); - cmd.setCheckSingleRowUpdate(!isNonstrictMethod(method)); - - // It is unnecessary for DBFlute! - // cmd.setNotSingleRowUpdatedExceptionClass( - // getNotSingleRowUpdatedExceptionClass(method)); - - cmd - .setVersionNoAutoIncrementOnMemory(isUpdateVersionNoAutoIncrementOnMemory(method)); - return cmd; - } - - protected InternalUpdateAutoDynamicCommand newUpdateAutoDynamicCommand( - Method method, DataSource ds, StatementFactory sf) { - return new InternalUpdateAutoDynamicCommand(ds, sf); - } - - protected InternalUpdateModifiedOnlyCommand createInternalUpdateModifiedOnlyCommand( - final Method method, final String[] propertyNames) { - final InternalUpdateModifiedOnlyCommand cmd = newInternalUpdateModifiedOnlyCommand( - method, dataSource, statementFactory); - cmd.setBeanMetaData(createBeanMetaData4UpdateDeleteByAuto(method));// Extension - // Point - // ! - cmd.setPropertyNames(propertyNames); - cmd.setCheckSingleRowUpdate(!isNonstrictMethod(method)); - - // It is unnecessary for DBFlute! - // cmd.setNotSingleRowUpdatedExceptionClass( - // getNotSingleRowUpdatedExceptionClass(method)); - - cmd - .setVersionNoAutoIncrementOnMemory(isUpdateVersionNoAutoIncrementOnMemory(method)); - return cmd; - } - - protected InternalUpdateModifiedOnlyCommand newInternalUpdateModifiedOnlyCommand( - Method method, DataSource ds, StatementFactory sf) { - return new InternalUpdateModifiedOnlyCommand(ds, sf); - } - - protected InternalUpdateBatchAutoStaticCommand createInternalUpdateBatchAutoStaticCommand( - final Method method, final String[] propertyNames, - boolean returningRows) { - return new InternalUpdateBatchAutoStaticCommand(dataSource, - statementFactory, - createBeanMetaData4UpdateDeleteByAuto(method), propertyNames, - returningRows, isUpdateVersionNoAutoIncrementOnMemory(method)) { - @Override - protected InternalUpdateBatchAutoHandler newInternalBatchAutoHandler() { - return new InternalUpdateBatchAutoHandler(getDataSource(), - getStatementFactory(), getBeanMetaData(), - getPropertyTypes()) { - @Override - protected int[] executeBatch(PreparedStatement ps, - List list) { - final int[] result = super.executeBatch(ps, list); - try { - handleBatchUpdateResultWithOptimisticLock(ps, list, - result, method); - } catch (SQLException e) { - handleSQLException(e, ps, false); - return null;// Unreachable! - } - return result; - } - }; - } - }; - } - - // ----------------------------------------------------- - // Delete - // ------ - @Override - protected void setupDeleteMethodByAuto(final Method method) { - if (isFirstArgumentConditionBean(method)) { - final SqlCommand cmd = new InternalDeleteQueryAutoDynamicCommand( - dataSource, statementFactory); - putSqlCommand(method.getName(), cmd); - return; - } - checkAutoUpdateMethod(method); - final String[] propertyNames = getPersistentPropertyNames(method); - final SqlCommand cmd; - if (isUpdateSignatureForBean(method)) { - cmd = createInternalDeleteAutoStaticCommand(method, propertyNames); - } else { - boolean returningRows = false; - if (int[].class.isAssignableFrom(method.getReturnType())) { - returningRows = true; - } - cmd = createInternalDeleteBatchAutoStaticCommand(method, - propertyNames, returningRows); - } - putSqlCommand(method.getName(), cmd); - } - - protected InternalDeleteAutoStaticCommand createInternalDeleteAutoStaticCommand( - final Method method, final String[] propertyNames) { - final InternalDeleteAutoStaticCommand cmd = new InternalDeleteAutoStaticCommand( - dataSource, statementFactory, - createBeanMetaData4UpdateDeleteByAuto(method), propertyNames); - cmd.setCheckSingleRowUpdate(!isNonstrictMethod(method)); - return cmd; - } - - protected InternalDeleteBatchAutoStaticCommand createInternalDeleteBatchAutoStaticCommand( - final Method method, final String[] propertyNames, - boolean returningRows) { - return new InternalDeleteBatchAutoStaticCommand(dataSource, - statementFactory, - createBeanMetaData4UpdateDeleteByAuto(method), propertyNames, - returningRows) { - @Override - protected InternalDeleteBatchAutoHandler newInternalBatchAutoHandler() { - return new InternalDeleteBatchAutoHandler(getDataSource(), - getStatementFactory(), getBeanMetaData(), - getPropertyTypes()) { - @Override - protected int[] executeBatch(PreparedStatement ps, - List list) { - final int[] result = super.executeBatch(ps, list); - try { - handleBatchUpdateResultWithOptimisticLock(ps, list, - result, method); - } catch (SQLException e) { - handleSQLException(e, ps, false); - return null;// Unreachable! - } - return result; - } - }; - } - }; - } - - // ----------------------------------------------------- - // Common Helper - // ------------- - protected BeanMetaData createBeanMetaData4UpdateDeleteByAuto(Method method) { - if (isNonstrictMethod(method)) { - return createNonConcurrencyBmdFactory().createBeanMetaData( - getBeanClass()); - } else { - return getBeanMetaData(); - } - } - - protected boolean isUpdateVersionNoAutoIncrementOnMemory(Method method) { - return !isNonstrictMethod(method); - } - - protected boolean isNonstrictMethod(Method method) { - return method.getName().contains("Nonstrict"); - } - - protected BeanMetaDataFactory createNonConcurrencyBmdFactory() { - final S2BeanMetaDataFactoryImpl nonConcurrencyBmdFactory = new S2BeanMetaDataFactoryImpl() { - protected BeanMetaDataImpl createBeanMetaDataImpl() { - return new BeanMetaDataImpl() { - public boolean hasVersionNoPropertyType() { - return false; - } - - public boolean hasTimestampPropertyType() { - return false; - } - }; - } - }; - nonConcurrencyBmdFactory - .setAnnotationReaderFactory(this.annotationReaderFactory); - nonConcurrencyBmdFactory - .setPropertyTypeFactoryBuilder(this.propertyTypeFactoryBuilder); - nonConcurrencyBmdFactory - .setRelationPropertyTypeFactoryBuilder(this.relationPropertyTypeFactoryBuilder); - nonConcurrencyBmdFactory.setTableNaming(this.tableNaming); - nonConcurrencyBmdFactory.setDataSource(this.dataSource); - nonConcurrencyBmdFactory - .setDaoNamingConvention(this.daoNamingConvention); - nonConcurrencyBmdFactory.setBeanEnhancer(this.beanEnhancer); - return nonConcurrencyBmdFactory; - } - - protected boolean isFirstArgumentConditionBean(final Method method) { - final Class[] pmbTypes = method.getParameterTypes(); - return pmbTypes.length > 0 - && ConditionBean.class.isAssignableFrom(pmbTypes[0]); - } - - protected void handleBatchUpdateResultWithOptimisticLock( - PreparedStatement ps, List list, int[] result, Method method) - throws SQLException { - if (ConditionBeanContext.isOracle()) { - final int updateCount = ps.getUpdateCount(); - handleBatchUpdateResultWithOptimisticLockByUpdateCount(list, - updateCount, method); - } else { - handleBatchUpdateResultWithOptimisticLockByResult(list, result, - method); - } - } - - protected void handleBatchUpdateResultWithOptimisticLockByUpdateCount( - List list, int updateCount, Method method) { - if (list.isEmpty()) { - return;// for Safety! - } - if (updateCount < 0) { - return;// for Safety! - } - final int entityCount = list.size(); - if (updateCount < entityCount) { - if (isNonstrictMethod(method)) { - String msg = "The entity have already deleted:"; - msg = msg + " updateCount=" + updateCount; - msg = msg + " entityCount=" + entityCount; - msg = msg + " allEntities=" + list; - throw new EntityAlreadyDeletedException(msg); - } else { - throw new BatchEntityAlreadyUpdatedException(list.get(0), 0, - updateCount); - } - } - } - - protected void handleBatchUpdateResultWithOptimisticLockByResult( - List list, Object result, Method method) { - if (list.isEmpty()) { - return;// for Safety! - } - if (!(result instanceof int[])) { - return;// for Safety! - } - final int[] updatedCountArray = (int[]) result; - final int entityCount = list.size(); - int index = 0; - boolean alreadyUpdated = false; - for (int oneUpdateCount : updatedCountArray) { - if (entityCount <= index) { - break;// for Safety! - } - if (oneUpdateCount == 0) { - alreadyUpdated = true; - break; - } else if (oneUpdateCount > 1) { - String msg = "The entity updated two or more records in batch update:"; - msg = msg + " entity=" + list.get(index); - msg = msg + " updatedCount=" + oneUpdateCount; - msg = msg + " allEntities=" + list; - throw new EntityDuplicatedException(msg); - } - ++index; - } - if (alreadyUpdated) { - int updateCount = 0; - for (int oneUpdateCount : updatedCountArray) { - updateCount = updateCount + oneUpdateCount; - } - if (isNonstrictMethod(method)) { - String msg = "The entity have already deleted:"; - msg = msg + " entity=" + list.get(index); - msg = msg + " updateCount=" + updateCount; - msg = msg + " allEntities=" + list; - throw new EntityAlreadyDeletedException(msg); - } else { - throw new BatchEntityAlreadyUpdatedException(list.get(index), - 0, updateCount); - } - } - } - - //========================================================================== - // ========= - // OutsideSql Override - // =================== - // ----------------------------------------------------- - // Normal OutsideSql - // ----------------- - @Override - protected void setupSelectMethodByManual(Method method, String sql) { - final Class[] pmbTypes = method.getParameterTypes(); - final String[] argNames = this.daoAnnotationReader.getArgNames(method); - final Class[] argTypes; - if (pmbTypes != null - && pmbTypes.length > 0 - && CursorHandler.class - .isAssignableFrom(pmbTypes[pmbTypes.length - 1])) { - argTypes = new Class[pmbTypes.length - 1]; - for (int i = 0; i < pmbTypes.length - 1; i++) { - argTypes[i] = pmbTypes[i]; - } - } else { - argTypes = pmbTypes; - } - final BeanMetaData myBeanMetaData = getOutsideSqlBeanMetaData(method); - registerSqlCommand(method.getName(), method, sql, argNames, argTypes, - myBeanMetaData); - } - - protected BeanMetaData getOutsideSqlBeanMetaData(Method method) { - final Class beanClass4SelectMethodByManual = getOutsideSqlDefaultBeanClass(method); - if (beanClass4SelectMethodByManual.equals(getBeanClass())) { - return getBeanMetaData(); - } - return createOutsideSqlCustomizeBeanMetaDataFactory() - .createBeanMetaData(getOutsideSqlDefaultBeanClass(method)); - } - - @Override - protected void setupUpdateMethodByManual(Method method, final String sql) { - // DBFlute Extesion does not exist. Because DBFlute methods don't use - // this! - // The insert/update/delete methods on DAO interface as outside SQL are - // target. - // And especially NonPrimaryInsertMethod uses this for using S2Dao's - // BindVariableNode. - super.setupUpdateMethodByManual(method, sql); - } - - // ----------------------------------------------------- - // Specified OutsideSql - // -------------------- - // - - - - - - - - - - - - - // Select - // - - - - protected void setupSpecifiedOutsideSqlSelectCommand(String sqlCommandKey, - Method method, OutsideSqlContext outsideSqlContext) { - // - - - - - - - - - - - - - - - - - - - - - - - - // The attribute of Specified-OutsideSqlContext. - // - - - - - - - - - - - - - - - - - - - - - - - - final String sql = outsideSqlContext.readFilteredOutsideSql( - getSqlFileEncoding(), dbms.getSuffix()); - final Object pmb = outsideSqlContext.getParameterBean(); - final Object resultTypeSpecification = outsideSqlContext - .getResultTypeSpecification(); - - // - - - - - - - - - - - - - - - - // The attribute of SqlCommand. - // - - - - - - - - - - - - - - - - final String[] argNames = (pmb != null ? new String[] { "pmb" } - : new String[] {}); - final Class[] argTypes = (pmb != null ? new Class[] { pmb - .getClass() } : new Class[] {}); - - // - - - - - - - - - - - - - - - - - // Create customized BeanMetaData. - // - - - - - - - - - - - - - - - - - final Class lastestArguementType = method.getParameterTypes()[method - .getParameterTypes().length - 1]; - final ResultSetHandler myResultSetHandler; - if (Class.class.isAssignableFrom(lastestArguementType)) { - // - - - - - - - - - // EntityHandling - // - - - - - - - - - final Class customizeEntityType = (Class) resultTypeSpecification; - final BeanMetaData myBeanMetaData = createSpecifiedOutsideSqlCustomizeBeanMetaData(customizeEntityType); - if (List.class.isAssignableFrom(method.getReturnType())) { - myResultSetHandler = createSpecifiedOutsideSqlCustomizeBeanListResultSetHandler( - myBeanMetaData, customizeEntityType); - } else { - throw new UnsupportedOperationException( - "The return type of method is unsupported: method.getReturnType()=" - + method.getReturnType()); - // myResultSetHandler = - // createSpecifiedOutsideSqlCustomizeBeanResultSetHandler - // (myBeanMetaData, customizeEntityType); - } - } else if (CursorHandler.class.isAssignableFrom(lastestArguementType)) { - // - - - - - - - - - // CursorHandling - // - - - - - - - - - final BeanMetaData myBeanMetaData = createSpecifiedOutsideSqlCursorBeanMetaData(method); - myResultSetHandler = createSpecifiedOutsideSqlCursorResultSetHandler(myBeanMetaData); - } else { - String msg = "The lastestArguementType is unsupported:"; - msg = msg + " lastestArguementType=" + lastestArguementType; - msg = msg + " method=" + method; - throw new IllegalStateException(msg); - } - - // - - - - - - - - - - - - // Register Sql-Command. - // - - - - - - - - - - - - registerSqlCommand(sqlCommandKey, method, sql, argNames, argTypes, - myResultSetHandler); - } - - protected BeanMetaData createSpecifiedOutsideSqlCustomizeBeanMetaData( - Class clazz) { - return createOutsideSqlCustomizeBeanMetaDataFactory() - .createBeanMetaData(clazz); - } - - /** - * Create the handler of result set of specified outside-sql for the list of - * customize bean. - * - * @param specifiedBeanMetaData Specified bean meta data. (NotNull) - * @param customizeEntityType The type of customize entity. (NotNull) - * @return The handler of result set. (NotNull) - */ - protected ResultSetHandler createSpecifiedOutsideSqlCustomizeBeanListResultSetHandler( - BeanMetaData specifiedBeanMetaData, Class customizeEntityType) { - final ValueType valueType = ValueTypes - .getValueType(customizeEntityType); - if (valueType == null || !valueType.equals(ValueTypes.OBJECT)) { - return new InternalObjectListResultSetHandler(valueType); - } - final InternalRowCreator rowCreator = createSpecifiedOutsideSqlInternalRowCreator(specifiedBeanMetaData); - final InternalRelationRowCreator relationRowCreator = createSpecifiedOutsideSqlInternalRelationRowCreator(specifiedBeanMetaData); - return new InternalBeanListMetaDataResultSetHandler( - specifiedBeanMetaData, rowCreator, relationRowCreator); - } - - protected InternalRowCreator createSpecifiedOutsideSqlInternalRowCreator( - BeanMetaData bmd) { - final Class clazz = bmd.getBeanClass(); - return InternalRowCreator.createInternalRowCreator(clazz); - } - - protected InternalRelationRowCreator createSpecifiedOutsideSqlInternalRelationRowCreator( - BeanMetaData bmd) { - return new InternalRelationRowCreator(); - } - - protected class InternalObjectListResultSetHandler implements - ResultSetHandler { - private ValueType valueType; - - public InternalObjectListResultSetHandler(ValueType valueType) { - this.valueType = valueType; - } - - public Object handle(ResultSet rs) throws SQLException { - final List ret = new ArrayList(); - while (rs.next()) { - ret.add(valueType.getValue(rs, 1)); - } - return ret; - } - } - - protected BeanMetaData createSpecifiedOutsideSqlCursorBeanMetaData( - Method method) { - return createOutsideSqlCustomizeBeanMetaDataFactory() - .createBeanMetaData(getOutsideSqlDefaultBeanClass(method)); - } - - protected ResultSetHandler createSpecifiedOutsideSqlCursorResultSetHandler( - BeanMetaData specifiedBeanMetaData) { - return new org.seasar.extension.jdbc.impl.ObjectResultSetHandler();// This - // is - // dummy - // for - // cursor - // handling - // ! - } - - // - - - - - - - - - - - - - // Execute - // - - - - - protected void setupSpecifiedOutsideSqlExecuteCommand(String sqlCommandKey, - Method method, OutsideSqlContext outsideSqlContext) { - // - - - - - - - - - - - - - - - - - - - - - - - - // The attribute of Specified-OutsideSqlContext. - // - - - - - - - - - - - - - - - - - - - - - - - - final String sql = outsideSqlContext.readFilteredOutsideSql( - getSqlFileEncoding(), dbms.getSuffix()); - final Object pmb = outsideSqlContext.getParameterBean(); - - // - - - - - - - - - - - - - - - - // The attribute of SqlCommand. - // - - - - - - - - - - - - - - - - final String[] argNames = (pmb != null ? new String[] { "pmb" } - : new String[] {}); - final Class[] argTypes = (pmb != null ? new Class[] { pmb - .getClass() } : new Class[] {}); - - final InternalUpdateDynamicCommand cmd = new InternalUpdateDynamicCommand( - dataSource, statementFactory) { - @Override - public Object execute(Object[] args) { - if (args.length != 3) { - String msg = "Internal Error! OutsideSqlDao.execute() should have 3 arguements: args.length=" - + args.length; - throw new IllegalStateException(msg); - } - Object arg = args[1]; - return super.execute(new Object[] { arg }); - } - }; - - // It is unnecessary for DBFlute! - // cmd.setNotSingleRowUpdatedExceptionClass( - // getNotSingleRowUpdatedExceptionClass(method)); - - registerSqlCommand(sqlCommandKey, method, sql, argNames, argTypes, cmd); - } - - // - - - - - - - - - - - - - // Call Procedure - // - - - - - - - - protected void setupSpecifiedOutsideSqlCallCommand(String sqlCommandKey, - Method method, OutsideSqlContext outsideSqlContext) { - // - - - - - - - - - - - - - - - - - - - - - - - - // The attribute of Specified-OutsideSqlContext. - // - - - - - - - - - - - - - - - - - - - - - - - - final Object pmb = outsideSqlContext.getParameterBean(); - final String procedureName = outsideSqlContext.getOutsideSqlPath(); - - // - - - - - - - - - - - - - - - - // The attribute of SqlCommand. - // - - - - - - - - - - - - - - - - final InternalProcedureMetaDataFactory factory = createInternalProcedureMetaDataFactory(); - factory.setValueTypeFactory(valueTypeFactory); - final Class pmbType = pmb != null ? pmb.getClass() : null; - final InternalProcedureMetaData metaData = factory - .createProcedureMetaData(procedureName, pmbType); - final InternalProcedureCommand cmd = createInternalProcedureCommand( - method, metaData); - putSqlCommand(sqlCommandKey, cmd); - } - - protected InternalProcedureMetaDataFactory createInternalProcedureMetaDataFactory() { - return new InternalProcedureMetaDataFactory(); - } - - protected InternalProcedureCommand createInternalProcedureCommand( - Method method, InternalProcedureMetaData metaData) { - final ResultSetHandler resultSetHandler = createResultSetHandler(method); - return new InternalProcedureCommand(dataSource, resultSetHandler, - statementFactory, metaData); - } - - // ----------------------------------------------------- - // Common of OutsideSql - // -------------------- - protected BeanMetaDataFactory createOutsideSqlCustomizeBeanMetaDataFactory() { - final S2BeanMetaDataFactoryImpl originalBmdFactory = new S2BeanMetaDataFactoryImpl() { - protected BeanMetaDataImpl createBeanMetaDataImpl() { - return newOutsideSqlCustomizeBeanMetaDataImpl(); - } - }; - originalBmdFactory - .setAnnotationReaderFactory(this.annotationReaderFactory); - originalBmdFactory - .setPropertyTypeFactoryBuilder(createOutsideSqlPropertyTypeFactoryBuilder()); - originalBmdFactory - .setRelationPropertyTypeFactoryBuilder(this.relationPropertyTypeFactoryBuilder); - originalBmdFactory.setTableNaming(this.tableNaming); - originalBmdFactory.setDataSource(this.dataSource); - originalBmdFactory.setDaoNamingConvention(this.daoNamingConvention); - originalBmdFactory.setBeanEnhancer(this.beanEnhancer); - return originalBmdFactory; - } - - protected BeanMetaDataImpl newOutsideSqlCustomizeBeanMetaDataImpl() { - return new OutsideSqlCustomizeBeanMetaDataImpl(); - } - - protected static class OutsideSqlCustomizeBeanMetaDataImpl extends - BeanMetaDataImpl { - // Though nothing to override, it uses original class just in case. - } - - protected S2DaoPropertyTypeFactoryBuilderExtension createOutsideSqlPropertyTypeFactoryBuilder() { - final S2DaoPropertyTypeFactoryBuilderExtension impl = new S2DaoPropertyTypeFactoryBuilderExtension(); - if (columnNaming == null) { - String msg = "Internal Error! The columnNaming should not be null! {Failed to Injection!}"; - throw new IllegalStateException(msg); - } - impl.setColumnNaming(columnNaming); - impl.setValueTypeFactory(valueTypeFactory); - return impl; - } - - protected Class getOutsideSqlDefaultBeanClass(Method method) { - final Class retType = method.getReturnType(); - if (java.util.List.class.isAssignableFrom(retType)) { - final Class elementType = InternalMethodUtil - .getElementTypeOfListFromReturnMethod(method); - if (elementType != null) { - return elementType; - } else { - return getBeanClass(); - } - } else if (retType.isArray()) { - return retType.getComponentType(); - } else if (retType.isPrimitive() - || !ValueTypes.getValueType(retType).equals(ValueTypes.OBJECT)) { - return getBeanClass(); - } else { - return retType; - } - } - - protected void registerSqlCommand(String sqlCommandKey, Method method, - String sql, String[] argNames, Class[] argTypes, - BeanMetaData myBeanMetaData) { - registerSqlCommand(sqlCommandKey, method, sql, argNames, argTypes, - createResultSetHandler(myBeanMetaData, method)); - } - - protected void registerSqlCommand(String sqlCommandKey, Method method, - String sql, String[] argNames, Class[] argTypes, - ResultSetHandler myResultSetHandler) { - final S2DaoSelectDynamicCommand cmd = createCustomizeSelectDynamicCommand(myResultSetHandler); - registerSqlCommand(sqlCommandKey, method, sql, argNames, argTypes, cmd); - } - - protected void registerSqlCommand(String sqlCommandKey, Method method, - String sql, String[] argNames, Class[] argTypes, - S2DaoSelectDynamicCommand cmd) { - cmd.setSql(sql); - cmd.setArgNames(argNames); - cmd.setArgTypes(argTypes); - this.sqlCommands.put(sqlCommandKey, cmd); - } - - protected void registerSqlCommand(String sqlCommandKey, Method method, - String sql, String[] argNames, Class[] argTypes, - InternalUpdateDynamicCommand cmd) { - cmd.setSql(sql); - cmd.setArgNames(argNames); - cmd.setArgTypes(argTypes); - this.sqlCommands.put(sqlCommandKey, cmd); - } - - //========================================================================== - // ========= - // Common Handlnig - // =============== - @Override - protected void putSqlCommand(String methodName, SqlCommand cmd) { - sqlCommands.put(methodName, cmd); - } - - protected boolean isCheckSingleRowUpdate(Method method) { - return checkSingleRowUpdateForAll - & daoAnnotationReader.isCheckSingleRowUpdate(method); - } - - //========================================================================== - // ========= - // Customize SelectDynamicCommand Creation - // ======================================= - /** - * Create the customize select dynamic command that is for all select SQL on - * DBFlute. - * - * @param handler The handler of result set. (NotNull) - * @return The customize select dynamic command. (NotNull) - */ - protected S2DaoSelectDynamicCommand createCustomizeSelectDynamicCommand( - ResultSetHandler handler) { - return new S2DaoSelectDynamicCommand(dataSource, statementFactory, - handler); - } - - //========================================================================== - // ========= - // ResultSetHandler Override - // ========================= - @Override - protected ResultSetHandler createResultSetHandler(Method method) { - return this.resultSetHandlerFactory.getResultSetHandler( - daoAnnotationReader, beanMetaData, method); - } - - protected ResultSetHandler createResultSetHandler( - BeanMetaData specifiedBeanMetaData, Method method) {// For specified - // BeanMetaData - return this.resultSetHandlerFactory.getResultSetHandler( - daoAnnotationReader, specifiedBeanMetaData, method); - } - - //========================================================================== - // ========= - // JDBC Delegator - // ============== - protected Connection getConnection() { - if (dataSource == null) { - throw new IllegalStateException( - "The dataSource should not be null!"); - } - try { - return dataSource.getConnection(); - } catch (SQLException e) { - handleSQLException(e, null); - return null;// Unreachable! - } - } - - protected DatabaseMetaData getMetaData(Connection conn) { - try { - return conn.getMetaData(); - } catch (SQLException e) { - handleSQLException(e, null); - return null;// Unreachable! - } - } - - protected String getDatabaseProductName(DatabaseMetaData dbMetaData) { - try { - return dbMetaData.getDatabaseProductName(); - } catch (SQLException e) { - handleSQLException(e, null); - return null;// Unreachable! - } - } - - protected void close(Connection conn) { - if (conn == null) { - return; - } - try { - conn.close(); - } catch (SQLException e) { - handleSQLException(e, null); - } - } - - //========================================================================== - // ========= - // Exception Handlnig - // ================== - protected void handleSQLException(SQLException e, Statement statement) { - new SQLExceptionHandler().handleSQLException(e, statement); - } - - //========================================================================== - // ========= - // ResultSetHandlerFactoryImpl Extension - // ===================================== - public static class ResultSetHandlerFactoryExtension extends - ResultSetHandlerFactoryImpl { - public ResultSetHandlerFactoryExtension() { - super(); - } - - @Override - protected RowCreator createRowCreator() { // [DAO-118] (2007/08/25) - return createInternalRowCreator(null); - } - - @Override - protected RelationRowCreator createRelationRowCreator() { - return createInternalRelationRowCreator(null); - } - - @Override - protected ResultSetHandler createBeanListMetaDataResultSetHandler( - BeanMetaData bmd) { // DBFlute Target - final InternalRowCreator rowCreator = createInternalRowCreator(bmd); - final InternalRelationRowCreator relationRowCreator = createInternalRelationRowCreator(bmd); - return new InternalBeanListMetaDataResultSetHandler(bmd, - rowCreator, relationRowCreator); - } - - @Override - protected ResultSetHandler createBeanArrayMetaDataResultSetHandler( - BeanMetaData bmd) { // DBFlute Target - final InternalRowCreator rowCreator = createInternalRowCreator(bmd); - final InternalRelationRowCreator relationRowCreator = createInternalRelationRowCreator(bmd); - return new InternalBeanArrayMetaDataResultSetHandler(bmd, - rowCreator, relationRowCreator); - } - - protected InternalRowCreator createInternalRowCreator(BeanMetaData bmd) { - final Class clazz = bmd != null ? bmd.getBeanClass() : null; - return InternalRowCreator.createInternalRowCreator(clazz); - } - - protected InternalRelationRowCreator createInternalRelationRowCreator( - BeanMetaData bmd) { - return new InternalRelationRowCreator(); // Not yet implemented - // about performance - // tuning! - } - } - - //========================================================================== - // ========= - // Vert Internal - // ============= - protected static class InternalMethodUtil { - public static Class getElementTypeOfListFromReturnMethod(Method method) { - return InternalReflectionUtil - .getElementTypeOfListFromReturnType(method); - } - } - - protected static class InternalReflectionUtil { - public static Class getElementTypeOfList(final Type parameterizedList) { - if (!(parameterizedList instanceof ParameterizedType)) { - return null; - } - final ParameterizedType parameterizedType = ParameterizedType.class - .cast(parameterizedList); - final Type rawType = parameterizedType.getRawType(); - if (!(rawType instanceof Class)) { - return null; - } - final Class rawClass = Class.class.cast(rawType); - if (!rawClass.isAssignableFrom(List.class)) { - return null; - } - final Type[] actualTypeArgument = parameterizedType - .getActualTypeArguments(); - if (actualTypeArgument == null || actualTypeArgument.length != 1) { - return null; - } - if (!(actualTypeArgument[0] instanceof Class)) { - return null; - } - return Class.class.cast(actualTypeArgument[0]); - } - - public static Class getElementTypeOfListFromParameterType( - final Method method, final int parameterPosition) { - final Type[] pmbTypes = method.getGenericParameterTypes(); - return getElementTypeOfList(pmbTypes[parameterPosition]); - } - - public static Class getElementTypeOfListFromReturnType( - final Method method) { - return getElementTypeOfList(method.getGenericReturnType()); - } - } - - //========================================================================== - // ========= - // Assist Helper - // ============= - protected DBMeta findDBMeta() { - final Class beanType = getBeanClass(); - if (beanType == null) { - return null; - } - if (!Entity.class.isAssignableFrom(beanType)) { - return null; - } - final Entity entity; - try { - entity = (Entity) beanType.newInstance(); - } catch (InstantiationException e) { - throw new IllegalStateException(e); - } catch (IllegalAccessException e) { - throw new IllegalStateException(e); - } - return entity.getDBMeta(); - } - - //========================================================================== - // ========= - // General Helper - // ============== - protected String getLineSeparator() { - return SimpleSystemUtil.getLineSeparator(); - } - - //========================================================================== - // ========= - // Accessor - // ======== - // ----------------------------------------------------- - // Sql File Encoding - // ----------------- - public String getSqlFileEncoding() { - return sqlFileEncoding; - } - - // ----------------------------------------------------- - // Bean Enhancer - // ------------- - public BeanEnhancer getBeanEnhancer() { - return beanEnhancer; - } - - public void setBeanEnhancer(final BeanEnhancer beanEnhancer) { - this.beanEnhancer = beanEnhancer; - } - - // ----------------------------------------------------- - // Annotation Reader Factory - // ------------------------- - public void setAnnotationReaderFactory( - org.seasar.dao.AnnotationReaderFactory annotationReaderFactory) { - this.annotationReaderFactory = annotationReaderFactory; - } - - // ----------------------------------------------------- - // Version After 1.0.47 - // -------------------- - public ColumnNaming getColumnNaming() { - return columnNaming; - } - - public void setColumnNaming(final ColumnNaming columnNaming) { - this.columnNaming = columnNaming; - } - - public PropertyTypeFactoryBuilder getPropertyTypeFactoryBuilder() { - return propertyTypeFactoryBuilder; - } - - public void setPropertyTypeFactoryBuilder( - final PropertyTypeFactoryBuilder propertyTypeFactoryBuilder) { - this.propertyTypeFactoryBuilder = propertyTypeFactoryBuilder; - } - - public RelationPropertyTypeFactoryBuilder getRelationPropertyTypeFactoryBuilder() { - return relationPropertyTypeFactoryBuilder; - } - - public void setRelationPropertyTypeFactoryBuilder( - final RelationPropertyTypeFactoryBuilder relationPropertyTypeFactoryBuilder) { - this.relationPropertyTypeFactoryBuilder = relationPropertyTypeFactoryBuilder; - } - - public TableNaming getTableNaming() { - return tableNaming; - } - - public void setTableNaming(final TableNaming tableNaming) { - this.tableNaming = tableNaming; - } - - // ----------------------------------------------------- - // DBFlute Extension - // ----------------- - public BehaviorSelector getBehaviorSelector() { - return _behaviorSelector; - } - - public void setBehaviorSelector(final BehaviorSelector behaviorSelector) { - this._behaviorSelector = behaviorSelector; - } - - public boolean isInternalDebug() { - return _internalDebug; - } - - public void setInternalDebug(final boolean internalDebug) { - this._internalDebug = internalDebug; - } -} Deleted: board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/s2dao/S2DaoMetaDataFactoryImpl.java =================================================================== --- board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/s2dao/S2DaoMetaDataFactoryImpl.java 2008-12-27 22:06:42 UTC (rev 1624) +++ board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/s2dao/S2DaoMetaDataFactoryImpl.java 2008-12-27 22:09:08 UTC (rev 1625) @@ -1,655 +0,0 @@ -package jp.sf.pal.board.db.allcommon.s2dao; - -import java.sql.CallableStatement; -import java.sql.Connection; -import java.sql.PreparedStatement; -import java.sql.SQLException; -import java.sql.Statement; -import java.util.HashMap; -import java.util.Map; - -import javax.sql.DataSource; -import javax.sql.XADataSource; - -import jp.sf.pal.board.db.allcommon.DBFluteConfig; -import jp.sf.pal.board.db.allcommon.cbean.ConditionBean; -import jp.sf.pal.board.db.allcommon.cbean.ConditionBeanContext; -import jp.sf.pal.board.db.allcommon.cbean.outsidesql.OutsideSqlContext; -import jp.sf.pal.board.db.allcommon.jdbc.StatementConfig; -import jp.sf.pal.board.db.allcommon.s2dao.internal.sqlhandler.InternalBasicHandler.SQLExceptionHandler; -import jp.sf.pal.board.db.allcommon.s2dao.internal.sqllog.InternalSqlLogRegistry; - -import org.seasar.dao.AnnotationReaderFactory; -import org.seasar.dao.BeanEnhancer; -import org.seasar.dao.BeanMetaDataFactory; -import org.seasar.dao.ColumnNaming; -import org.seasar.dao.DaoAnnotationReader; -import org.seasar.dao.DaoMetaData; -import org.seasar.dao.DaoMetaDataFactory; -import org.seasar.dao.DaoNamingConvention; -import org.seasar.dao.DtoMetaDataFactory; -import org.seasar.dao.ProcedureMetaDataFactory; -import org.seasar.dao.PropertyTypeFactoryBuilder; -import org.seasar.dao.RelationPropertyTypeFactoryBuilder; -import org.seasar.dao.ResultSetHandlerFactory; -import org.seasar.dao.TableNaming; -import org.seasar.dao.ValueTypeFactory; -import org.seasar.dao.impl.DaoMetaDataImpl; -import org.seasar.dao.pager.PagingSqlRewriter; -import org.seasar.extension.jdbc.ResultSetFactory; -import org.seasar.extension.jdbc.StatementFactory; -import org.seasar.framework.beans.BeanDesc; -import org.seasar.framework.beans.factory.BeanDescFactory; -import org.seasar.framework.util.Disposable; -import org.seasar.framework.util.DisposableUtil; - -/** - * The implementation of DaoMetaDataFactory for DBFlute. - * - * @author DBFlute(AutoGenerator) - */ -public class S2DaoMetaDataFactoryImpl implements DaoMetaDataFactory, Disposable { - - //========================================================================== - // ========= - // Definition - // ========== - /** Log-instance. */ - private static final org.apache.commons.logging.Log _log = org.apache.commons.logging.LogFactory - .getLog(S2DaoMetaDataFactoryImpl.class); - - // ----------------------------------------------------- - // For Logging - // ----------- - /** The binding annotation for xaDataSource. {bindingType=may} */ - public static final String xaDataSource_BINDING = "bindingType=may"; - - // ----------------------------------------------------- - // Factory Basic - // ------------- - public static final String dataSource_BINDING = "bindingType=must"; - - public static final String annotationReaderFactory_BINDING = "bindingType=must"; - - public static final String valueTypeFactory_BINDING = "bindingType=must"; - - public static final String beanMetaDataFactory_BINDING = "bindingType=must"; - - public static final String daoNamingConvention_BINDING = "bindingType=must"; - - public static final String resultSetHandlerFactory_BINDING = "bindingType=must"; - - public static final String dtoMetaDataFactory_BINDING = "bindingType=must"; - - public static final String procedureMetaDataFactory_BINDING = "bindingType=must"; - - public static final String pagingSQLRewriter_BINDING = "bindingType=may"; - - //========================================================================== - // ========= - // Attribute - // ========= - // ----------------------------------------------------- - // Factory Basic - // ------------- - protected DataSource dataSource; - - protected AnnotationReaderFactory annotationReaderFactory; - - protected ValueTypeFactory valueTypeFactory; - - protected BeanMetaDataFactory beanMetaDataFactory; - - protected DaoNamingConvention daoNamingConvention; - - protected ResultSetHandlerFactory resultSetHandlerFactory; - - protected DtoMetaDataFactory dtoMetaDataFactory; - - protected ProcedureMetaDataFactory procedureMetaDataFactory; - - protected PagingSqlRewriter pagingSqlRewriter; - - protected Map daoMetaDataCache = new HashMap(); - - protected boolean initialized; - - protected boolean useDaoClassForLog; - - protected String sqlFileEncoding; - - protected BeanEnhancer beanEnhancer; - - // ----------------------------------------------------- - // Version After 1.0.47 - // -------------------- - /** The naming of column. {After S2Dao-1.0.47} */ - protected ColumnNaming columnNaming; - - /** The builder of property type factory. {After S2Dao-1.0.47} */ - protected PropertyTypeFactoryBuilder propertyTypeFactoryBuilder; - - /** The builder of relation property type factory. {After S2Dao-1.0.47} */ - protected RelationPropertyTypeFactoryBuilder relationPropertyTypeFactoryBuilder; - - /** The builder of table naming. {After S2Dao-1.0.47} */ - protected TableNaming tableNaming; - - // ----------------------------------------------------- - // DBFlute Extension - // ----------------- - /** The lock monitor of DAO meta data initialization. */ - protected Object _daoMetaDataInitializationLockMonitor = new Object(); - - //========================================================================== - // ========= - // Constructor - // =========== - public S2DaoMetaDataFactoryImpl(DataSource dataSource, - AnnotationReaderFactory annotationReaderFactory, - XADataSource xaDataSource) { - this.dataSource = dataSource; - this.annotationReaderFactory = annotationReaderFactory; - - _log - .info("/* * * * * * * * * * * * * * * * * * * * * * * * * * * * {DBFlute}"); - showInformation(dataSource, xaDataSource); - - // Stop the LinkageError! - ConditionBeanContext.initialize(); - - initializeDatabaseProductNameOfContext(xaDataSource); - - handleSqlLogRegistry(); - - DBFluteConfig.getInstance().lock(); - _log.info("* * * * */"); - } - - protected void showInformation(javax.sql.DataSource dataSource, - javax.sql.XADataSource xaDataSource) { - final StringBuilder sb = new StringBuilder(); - if (xaDataSource != null - && xaDataSource instanceof org.seasar.extension.dbcp.impl.XADataSourceImpl) { - final org.seasar.extension.dbcp.impl.XADataSourceImpl xaDataSourceImpl = (org.seasar.extension.dbcp.impl.XADataSourceImpl) xaDataSource; - final String driverClassName = xaDataSourceImpl - .getDriverClassName(); - final String url = xaDataSourceImpl.getURL(); - final String user = xaDataSourceImpl.getUser(); - sb.append(" [XADataSource]:").append(getLineSeparator()); - sb.append(" driver = " + driverClassName).append( - getLineSeparator()); - sb.append(" url = " + url).append(getLineSeparator()); - sb.append(" user = " + user); - } - _log.info("{Injection Information}" + getLineSeparator() + sb); - } - - protected void handleSqlLogRegistry() { - final StringBuilder sb = new StringBuilder(); - sb.append("{SqlLog Information}").append(getLineSeparator()); - sb.append(" [SqlLogRegistry]").append(getLineSeparator()); - if (DBFluteConfig.getInstance().isUseSqlLogRegistry()) { - if (InternalSqlLogRegistry.setupSqlLogRegistry()) { - sb - .append( - " ...Setting up SqlLogRegistry(org.seasar.extension.jdbc)!") - .append(getLineSeparator()); - sb - .append(" Because the property 'useSqlLogRegistry' of the config of DBFlute is true."); - } else { - sb - .append(" SqlLogRegistry(org.seasar.extension.jdbc) is not supported at the version!"); - } - } else { - final Object sqlLogRegistry = InternalSqlLogRegistry - .findContainerSqlLogRegistry(); - if (sqlLogRegistry != null) { - InternalSqlLogRegistry.closeRegistration(); - sb - .append( - " SqlLogRegistry(org.seasar.extension.jdbc) is close! It's default for DBFlute.") - .append(getLineSeparator()); - sb - .append(" If you want to use this, set SqlLogRegistry to SqlLogRegistryLocator at yourself."); - } else { - sb - .append(" SqlLogRegistry(org.seasar.extension.jdbc) is not available!"); - } - } - _log.info(sb); - } - - // ----------------------------------------------------- - // Database Product Name - // --------------------- - protected void initializeDatabaseProductNameOfContext( - javax.sql.XADataSource xaDataSource) { - if (getDatabaseProductNameFromContext() != null) { - return; - } - - // From JDBC Driver! - if (xaDataSource != null - && xaDataSource instanceof org.seasar.extension.dbcp.impl.XADataSourceImpl) { - final org.seasar.extension.dbcp.impl.XADataSourceImpl xaDataSourceImpl = (org.seasar.extension.dbcp.impl.XADataSourceImpl) xaDataSource; - final String driverClassName = xaDataSourceImpl - .getDriverClassName(); - if (driverClassName != null) { - if (setupDatabaseProductNameByDriverClassName(driverClassName)) { - _log - .info("...Initializing database product name from driverClassName: " - + getDatabaseProductNameFromContext()); - return; - } - } - } - - _log.info("...Initializing database product name as default: H2"); - setDatabaseProductNameToContext("H2"); - } - - protected String getDatabaseProductNameFromContext() { - return ConditionBeanContext.getDatabaseProductName(); - } - - protected void setDatabaseProductNameToContext(String name) { - ConditionBeanContext.setDatabaseProductName(name); - } - - protected boolean setupDatabaseProductNameByDriverClassName( - String driverClassName) { - return ConditionBeanContext - .setupDatabaseProductNameByDriverClassName(driverClassName); - } - - //========================================================================== - // ========= - // Implementation - // ============== - @SuppressWarnings("unchecked") - public DaoMetaData getDaoMetaData(final Class daoClass) { - if (!initialized) { - DisposableUtil.add(this); - initialized = true; - } - final String key = daoClass.getName(); - - // [A] - DaoMetaData dmd = getSynchronizedDaoMetaDataCache(key); - - // [B] - if (dmd != null) { - return dmd; - } - - // [C] - synchronized (_daoMetaDataInitializationLockMonitor) {// One Thread Only - // Entered - // [D] - dmd = getSynchronizedDaoMetaDataCache(key); - // [E] - if (dmd != null) { - // The second thread that stops at [C] can find - // because the first thread have already initialized. - if (_log.isDebugEnabled()) { - _log - .debug("...Getting daoMetaData as cache because the previous thread have already initilized."); - } - return dmd; - } - // [F] - if (_log.isDebugEnabled()) { - _log.debug("...Creating daoMetaData for " - + daoClass.getSimpleName() + "."); - } - final DaoMetaData dmdi = createDaoMetaData(daoClass); - putSynchronizedDaoMetaDataCache(key, dmdi); - } - // [G] - dmd = getSynchronizedDaoMetaDataCache(key); - if (dmd != null) { - return dmd; - } - String msg = "The cache should have data meta data here: key=" + key - + " cache=" + daoMetaDataCache; - throw new IllegalStateException(msg); - } - - @SuppressWarnings("unchecked") - protected void putSynchronizedDaoMetaDataCache(String key, DaoMetaData dmd) { - synchronized (daoMetaDataCache) { - daoMetaDataCache.put(key, dmd); - } - } - - protected DaoMetaData getSynchronizedDaoMetaDataCache(String key) { - DaoMetaData dmd = null; - synchronized (daoMetaDataCache) { - dmd = (DaoMetaData) daoMetaDataCache.get(key); - } - return dmd; - } - - //========================================================================== - // ========= - // DataMetaData Creation - // ===================== - protected DaoMetaData createDaoMetaData(final Class daoClass) { - final BeanDesc daoBeanDesc = BeanDescFactory.getBeanDesc(daoClass); - final DaoAnnotationReader daoAnnotationReader = annotationReaderFactory - .createDaoAnnotationReader(daoBeanDesc); - - final DaoMetaDataImpl daoMetaData = createDaoMetaDataExtension(); - daoMetaData.setDaoClass(daoClass); - daoMetaData.setDataSource(dataSource); - daoMetaData.setStatementFactory(createCustomizeStatememtFactory()); - daoMetaData.setResultSetFactory(createCustomizeResultSetFactory()); - daoMetaData.setValueTypeFactory(valueTypeFactory); - daoMetaData.setBeanMetaDataFactory(getBeanMetaDataFactory()); - daoMetaData.setDaoNamingConvention(getDaoNamingConvention()); - daoMetaData.setUseDaoClassForLog(useDaoClassForLog); - daoMetaData.setDaoAnnotationReader(daoAnnotationReader); - daoMetaData.setProcedureMetaDataFactory(procedureMetaDataFactory); - daoMetaData.setDtoMetaDataFactory(dtoMetaDataFactory); - daoMetaData.setResultSetHandlerFactory(resultSetHandlerFactory); - if (sqlFileEncoding != null) { - daoMetaData.setSqlFileEncoding(sqlFileEncoding); - } - if (pagingSqlRewriter != null) { - daoMetaData.setPagingSQLRewriter(pagingSqlRewriter); - } - daoMetaData.initialize(); - return daoMetaData; - } - - protected S2DaoMetaDataExtension createDaoMetaDataExtension() { - final S2DaoMetaDataExtension dmdExtension = newDaoMetaDataExtension(); - dmdExtension.setBeanEnhancer(beanEnhancer); - dmdExtension.setAnnotationReaderFactory(this.annotationReaderFactory); - dmdExtension.setColumnNaming(this.columnNaming); - dmdExtension - .setPropertyTypeFactoryBuilder(this.propertyTypeFactoryBuilder); - dmdExtension - .setRelationPropertyTypeFactoryBuilder(this.relationPropertyTypeFactoryBuilder); - dmdExtension.setTableNaming(tableNaming); - dmdExtension.setInternalDebug(DBFluteConfig.getInstance() - .isInternalDebug()); - return dmdExtension; - } - - protected S2DaoMetaDataExtension newDaoMetaDataExtension() { - return new S2DaoMetaDataExtension(); - } - - //========================================================================== - // ========= - // Result Set Factory - // ================== - /** - * Create the customize result set factory that is for all SQL on DBFlute. - * - * @return The customize statement factory. (NotNull) - */ - protected ResultSetFactory createCustomizeResultSetFactory() { - return new FetchNarrowingResultSetFactory(); - } - - //========================================================================== - // ========= - // Statement Factory - // ================= - /** - * Create the customize statement factory that is for all SQL on DBFlute. - * - * @return The customize statement factory. (NotNull) - */ - protected StatementFactory createCustomizeStatememtFactory() { - final StatementConfig defaultStatementConfig = DBFluteConfig - .getInstance().getDefaultStatementConfig(); - final boolean internalDebug = DBFluteConfig.getInstance() - .isInternalDebug(); - return new StatementFactory() { - public PreparedStatement createPreparedStatement(Connection con, - String sql) { - try { - final StatementConfig config = findStatementConfigOnThread(); - ; - final int resultSetType; - if (config != null && config.hasResultSetType()) { - resultSetType = config.getResultSetType(); - } else if (defaultStatementConfig != null - && defaultStatementConfig.hasResultSetType()) { - resultSetType = defaultStatementConfig - .getResultSetType(); - } else { - resultSetType = java.sql.ResultSet.TYPE_FORWARD_ONLY; - } - final int resultSetConcurrency = java.sql.ResultSet.CONCUR_READ_ONLY; - if (internalDebug) { - _log.debug("...Creating prepareStatement(sql, " - + resultSetType + ", " + resultSetConcurrency - + ")"); - } - final PreparedStatement ps = con.prepareStatement(sql, - resultSetType, resultSetConcurrency); - if (config != null && config.hasStatementOptions()) { - if (internalDebug) { - _log - .debug("...Setting statement config as request: " - + config); - } - reflectStatementOptions(config, ps); - } else { - reflectDefaultOptionsToStatementIfNeeds(ps); - } - return ps; - } catch (SQLException e) { - handleSQLException(e, null); - return null;// Unreachable! - } - } - - public CallableStatement createCallableStatement(Connection conn, - String sql) { - return prepareCall(conn, sql); - } - - protected StatementConfig findStatementConfigOnThread() { - final StatementConfig config; - if (ConditionBeanContext.isExistConditionBeanOnThread()) { - final ConditionBean cb = ConditionBeanContext - .getConditionBeanOnThread(); - config = cb.getStatementConfig(); - } else if (OutsideSqlContext.isExistOutsideSqlContextOnThread()) { - final OutsideSqlContext context = OutsideSqlContext - .getOutsideSqlContextOnThread(); - config = context.getStatementConfig(); - } else { - config = null; - } - return config; - } - - protected void reflectDefaultOptionsToStatementIfNeeds( - PreparedStatement ps) { - if (defaultStatementConfig != null - && defaultStatementConfig.hasStatementOptions()) { - if (internalDebug) { - _log.debug("...Setting statement config as default: " - + defaultStatementConfig); - } - reflectStatementOptions(defaultStatementConfig, ps); - return; - } - } - - protected void reflectStatementOptions(StatementConfig config, - PreparedStatement ps) { - try { - if (config.hasQueryTimeout()) { - ps.setQueryTimeout(config.getQueryTimeout()); - } - if (config.hasFetchSize()) { - ps.setFetchSize(config.getFetchSize()); - } - if (config.hasMaxRows()) { - ps.setMaxRows(config.getMaxRows()); - } - } catch (SQLException e) { - handleSQLException(e, ps); - } - } - - protected CallableStatement prepareCall(Connection conn, String sql) { - try { - return conn.prepareCall(sql); - } catch (SQLException e) { - handleSQLException(e, null); - return null;// Unreachable! - } - } - - protected void handleSQLException(SQLException e, - Statement statement) { - new SQLExceptionHandler().handleSQLException(e, statement); - } - }; - } - - //========================================================================== - // ========= - // Dispose - // ======= - public synchronized void dispose() { - daoMetaDataCache.clear(); - initialized = false; - } - - //========================================================================== - // ========= - // Helper - // ====== - /** - * Get the value of line separator. - * - * @return The value of line separator. (NotNull) - */ - protected static String getLineSeparator() { - return System.getProperty("line.separator"); - } - - //========================================================================== - // ========= - // Accessor - // ======== - // ----------------------------------------------------- - // Factory Basic - // ------------- - public void setValueTypeFactory(final ValueTypeFactory valueTypeFactory) { - this.valueTypeFactory = valueTypeFactory; - } - - protected BeanMetaDataFactory getBeanMetaDataFactory() { - return beanMetaDataFactory; - } - - public void setBeanMetaDataFactory( - final BeanMetaDataFactory beanMetaDataFactory) { - this.beanMetaDataFactory = beanMetaDataFactory; - } - - public DaoNamingConvention getDaoNamingConvention() { - return daoNamingConvention; - } - - public void setDaoNamingConvention( - final DaoNamingConvention daoNamingConvention) { - this.daoNamingConvention = daoNamingConvention; - } - - public void setAnnotationReaderFactory( - final AnnotationReaderFactory annotationReaderFactory) { - this.annotationReaderFactory = annotationReaderFactory; - } - - public void setDataSource(final DataSource dataSource) { - this.dataSource = dataSource; - } - - public void setUseDaoClassForLog(final boolean userDaoClassForLog) { - useDaoClassForLog = userDaoClassForLog; - } - - public void setResultSetHandlerFactory( - final ResultSetHandlerFactory resultSetHandlerFactory) { - this.resultSetHandlerFactory = resultSetHandlerFactory; - } - - public void setDtoMetaDataFactory( - final DtoMetaDataFactory dtoMetaDataFactory) { - this.dtoMetaDataFactory = dtoMetaDataFactory; - } - - public void setProcedureMetaDataFactory( - ProcedureMetaDataFactory procedureMetaDataFactory) { - this.procedureMetaDataFactory = procedureMetaDataFactory; - } - - public void setPagingSQLRewriter(final PagingSqlRewriter pagingSqlRewriter) { - this.pagingSqlRewriter = pagingSqlRewriter; - } - - public String getSqlFileEncoding() { - return sqlFileEncoding; - } - - public void setSqlFileEncoding(final String encoding) { - sqlFileEncoding = encoding; - } - - public BeanEnhancer getBeanEnhancer() { - return beanEnhancer; - } - - public void setBeanEnhancer(final BeanEnhancer beanEnhancer) { - this.beanEnhancer = beanEnhancer; - } - - // ----------------------------------------------------- - // Version After 1.0.47 - // -------------------- - public ColumnNaming getColumnNaming() { - return columnNaming; - } - - public void setColumnNaming(final ColumnNaming columnNaming) { - this.columnNaming = columnNaming; - } - - public PropertyTypeFactoryBuilder getPropertyTypeFactoryBuilder() { - return propertyTypeFactoryBuilder; - } - - public void setPropertyTypeFactoryBuilder( - final PropertyTypeFactoryBuilder propertyTypeFactoryBuilder) { - this.propertyTypeFactoryBuilder = propertyTypeFactoryBuilder; - } - - public RelationPropertyTypeFactoryBuilder getRelationPropertyTypeFactoryBuilder() { - return relationPropertyTypeFactoryBuilder; - } - - public void setRelationPropertyTypeFactoryBuilder( - final RelationPropertyTypeFactoryBuilder relationPropertyTypeFactoryBuilder) { - this.relationPropertyTypeFactoryBuilder = relationPropertyTypeFactoryBuilder; - } - - public TableNaming getTableNaming() { - return tableNaming; - } - - public void setTableNaming(final TableNaming tableNaming) { - this.tableNaming = tableNaming; - } -} \ No newline at end of file Deleted: board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/s2dao/S2DaoPropertyTypeFactoryBuilderExtension.java =================================================================== --- board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/s2dao/S2DaoPropertyTypeFactoryBuilderExtension.java 2008-12-27 22:06:42 UTC (rev 1624) +++ board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/s2dao/S2DaoPropertyTypeFactoryBuilderExtension.java 2008-12-27 22:09:08 UTC (rev 1625) @@ -1,215 +0,0 @@ -package jp.sf.pal.board.db.allcommon.s2dao; - -import java.sql.DatabaseMetaData; -import java.util.ArrayList; -import java.util.List; - -import jp.sf.pal.board.db.allcommon.Entity; -import jp.sf.pal.board.db.allcommon.dbmeta.DBMeta; - -import org.seasar.dao.BeanAnnotationReader; -import org.seasar.dao.ColumnNaming; -import org.seasar.dao.Dbms; -import org.seasar.dao.PropertyTypeFactory; -import org.seasar.dao.PropertyTypeFactoryBuilder; -import org.seasar.dao.ValueTypeFactory; -import org.seasar.dao.impl.AbstractPropertyTypeFactory; -import org.seasar.extension.jdbc.PropertyType; -import org.seasar.framework.beans.BeanDesc; -import org.seasar.framework.beans.PropertyDesc; - -/** - * The factory builder of property type for S2Dao. {Since S2Dao-1.0.47} - * - * @author DBFlute(AutoGenerator) - */ - ¡÷ SuppressWarnings("unchecked") -public class S2DaoPropertyTypeFactoryBuilderExtension implements - PropertyTypeFactoryBuilder { - - //========================================================================== - // ========= - // Attribute - // ========= - protected ValueTypeFactory valueTypeFactory; - - protected ColumnNaming columnNaming; - - //========================================================================== - // ========= - // Build - // ===== - public PropertyTypeFactory build(Class beanClass, - BeanAnnotationReader beanAnnotationReader) { - return new FastPropertyTypeFactoryExtension(beanClass, - beanAnnotationReader, valueTypeFactory, columnNaming); - } - - public PropertyTypeFactory build(Class beanClass, - BeanAnnotationReader beanAnnotationReader, Dbms dbms, - DatabaseMetaData databaseMetaData) { - return new FastPropertyTypeFactoryExtension(beanClass, - beanAnnotationReader, valueTypeFactory, columnNaming, dbms); - } - - //========================================================================== - // ========= - // Extension Class - // =============== - protected static class FastPropertyTypeFactoryExtension extends - AbstractPropertyTypeFactory { - - protected DBMeta _dbmeta; - - protected String[] _noPersisteneProps; - - public FastPropertyTypeFactoryExtension(Class beanClass, - BeanAnnotationReader beanAnnotationReader, - ValueTypeFactory valueTypeFactory, ColumnNaming columnNaming) { - super(beanClass, beanAnnotationReader, valueTypeFactory, - columnNaming); - initializeResources(); - } - - public FastPropertyTypeFactoryExtension(Class beanClass, - BeanAnnotationReader beanAnnotationReader, - ValueTypeFactory valueTypeFactory, ColumnNaming columnNaming, - Dbms dbms) { - super(beanClass, beanAnnotationReader, valueTypeFactory, - columnNaming, dbms); - initializeResources(); - } - - protected void initializeResources() { - if (isEntity()) { - _dbmeta = findDBMeta(); - } - _noPersisteneProps = beanAnnotationReader.getNoPersisteneProps(); - } - - protected boolean isEntity() { - return Entity.class.isAssignableFrom(beanClass); - } - - protected boolean hasDBMeta() { - return _dbmeta != null; - } - - protected DBMeta findDBMeta() { - try { - final Entity entity = (Entity) beanClass.newInstance(); - return entity.getDBMeta(); - } catch (Exception e) { - String msg = "beanClass.newInstance() threw the exception: beanClass=" - + beanClass; - throw new RuntimeException(msg, e); - } - } - - public PropertyType[] createBeanPropertyTypes(String tableName) { - final List list = new ArrayList(); - final BeanDesc beanDesc = getBeanDesc(); - for (int i = 0; i < beanDesc.getPropertyDescSize(); ++i) { - final PropertyDesc pd = beanDesc.getPropertyDesc(i); - - // Read-only property is unnecessary! - if (!pd.hasWriteMethod()) { - continue; - } - - // Relation property is unnecessary! - if (isRelation(pd)) { - continue; - } - - final PropertyType pt = createPropertyType(pd); - pt.setPrimaryKey(isPrimaryKey(pd)); - pt.setPersistent(isPersistent(pt)); - list.add(pt); - } - return list.toArray(new PropertyType[list.size()]); - } - - @Override - protected boolean isRelation(PropertyDesc propertyDesc) { - final String propertyName = propertyDesc.getPropertyName(); - if (hasDBMeta() - && (_dbmeta.hasForeign(propertyName) || _dbmeta - .hasReferrer(propertyName))) { - return true; - } - return hasRelationNoAnnotation(propertyDesc); - } - - protected boolean hasRelationNoAnnotation(PropertyDesc propertyDesc) { - return beanAnnotationReader.hasRelationNo(propertyDesc); - } - - @Override - protected boolean isPrimaryKey(PropertyDesc propertyDesc) { - final String propertyName = propertyDesc.getPropertyName(); - if (hasDBMeta() && _dbmeta.hasPrimaryKey() - && _dbmeta.hasColumn(propertyName)) { - if (_dbmeta.findColumnInfo(propertyName).isPrimary()) { - return true; - } - } - return hasIdAnnotation(propertyDesc); - } - - protected boolean hasIdAnnotation(PropertyDesc propertyDesc) { - final Dbms dbms = getDbms(); - return beanAnnotationReader.getId(propertyDesc, dbms) != null; - } - - @Override - protected boolean isPersistent(PropertyType propertyType) { - final String propertyName = propertyType.getPropertyName(); - final PropertyDesc propertyDesc = propertyType.getPropertyDesc(); - if ((hasDBMeta() && _dbmeta.hasColumn(propertyName)) - || hasColumnAnnotation(propertyDesc)) { - if (!isElementOfNoPersistentProps(propertyDesc)) { - return true; - } - } - return false; - } - - protected boolean hasColumnAnnotation(PropertyDesc propertyDesc) { - return beanAnnotationReader.getColumnAnnotation(propertyDesc) != null; - } - - protected boolean isElementOfNoPersistentProps(PropertyDesc propertyDesc) { - final String propertyName = propertyDesc.getPropertyName(); - final String[] props = _noPersisteneProps; - if (props != null && props.length >= 0) { - for (int i = 0; i < props.length; ++i) { - if (props[i].equals(propertyName)) { - return true; - } - } - } - return false; - } - } - - //========================================================================== - // ========= - // Accessor - // ======== - public ValueTypeFactory getValueTypeFactory() { - return valueTypeFactory; - } - - public void setValueTypeFactory(ValueTypeFactory valueTypeFactory) { - this.valueTypeFactory = valueTypeFactory; - } - - public ColumnNaming getColumnNaming() { - return columnNaming; - } - - public void setColumnNaming(ColumnNaming columnNaming) { - this.columnNaming = columnNaming; - } -} Deleted: board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/s2dao/S2DaoSelectDynamicCommand.java =================================================================== --- board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/s2dao/S2DaoSelectDynamicCommand.java 2008-12-27 22:06:42 UTC (rev 1624) +++ board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/s2dao/S2DaoSelectDynamicCommand.java 2008-12-27 22:09:08 UTC (rev 1625) @@ -1,491 +0,0 @@ -package jp.sf.pal.board.db.allcommon.s2dao; - -import java.util.ArrayList; -import java.util.List; - -import javax.sql.DataSource; - -import jp.sf.pal.board.db.allcommon.cbean.ConditionBean; -import jp.sf.pal.board.db.allcommon.cbean.ConditionBeanContext; -import jp.sf.pal.board.db.allcommon.cbean.outsidesql.OutsideSqlContext; -import jp.sf.pal.board.db.allcommon.s2dao.internal.sqlcommand.InternalAbstractDynamicCommand; -import jp.sf.pal.board.db.allcommon.s2dao.internal.sqlhandler.InternalBasicSelectHandler; -import jp.sf.pal.board.db.allcommon.util.SimpleStringUtil; -import jp.sf.pal.board.db.allcommon.util.SimpleSystemUtil; - -import org.seasar.dao.CommandContext; -import org.seasar.extension.jdbc.ResultSetHandler; -import org.seasar.extension.jdbc.StatementFactory; -import org.seasar.extension.jdbc.ValueType; -import org.seasar.extension.jdbc.types.ValueTypes; -import org.seasar.framework.beans.BeanDesc; -import org.seasar.framework.beans.PropertyDesc; -import org.seasar.framework.beans.factory.BeanDescFactory; - -/** - * SelectDynamicCommand for DBFlute. - * - * @author DBFlute(AutoGenerator) - */ - ¡÷ SuppressWarnings("unchecked") -public class S2DaoSelectDynamicCommand extends InternalAbstractDynamicCommand { - - //========================================================================== - // ========= - // Attribute - // ========= - /** The handler of resultSet. */ - protected ResultSetHandler resultSetHandler; - - //========================================================================== - // ========= - // Constructor - // =========== - /** - * Constructor. - * - * @param dataSource Data source. - * @param statementFactory The factory of statement. - * @param resultSetHandler The handler of resultSet. - */ - public S2DaoSelectDynamicCommand(DataSource dataSource, - StatementFactory statementFactory, ResultSetHandler resultSetHandler) { - super(dataSource, statementFactory); - this.resultSetHandler = resultSetHandler; - } - - //========================================================================== - // ========= - // Very Important Extension - // ======================== - // ----------------------------------------------------- - // SelectDynamicCommand Creation - // ----------------------------- - protected S2DaoSelectDynamicCommand createMySelectDynamicCommand() { - return new S2DaoSelectDynamicCommand(getDataSource(), - getStatementFactory(), resultSetHandler); - } - - //========================================================================== - // ========= - // Execute - // ======= - // ----------------------------------------------------- - // Top Execute - // ----------- - /** - * @param args The array of argument. (Nullable) - * @return The object of execution result. (Nullable) - */ - public Object execute(Object[] args) { - // - - - - - - - - - - - - - // This is top execution. - // - - - - - - - - - - - - - - if (!ConditionBeanContext.isExistConditionBeanOnThread()) { - // - - - - - - - - - - - // Execute outsideSql. - // - - - - - - - - - - - if (OutsideSqlContext.isExistOutsideSqlContextOnThread()) { - final OutsideSqlContext outsideSqlContext = OutsideSqlContext - .getOutsideSqlContextOnThread(); - if (outsideSqlContext.isDynamicBinding()) { - return executeOutsideSqlAsDynamic(args, outsideSqlContext); - } else { - return executeOutsideSqlAsStatic(args, outsideSqlContext); - } - } - - // - - - - - - - - - - // Execute default. - // - - - - - - - - - - return executeDefault(args); - } - - // - - - - - - - - - - - - - // Execute conditionBean. - // - - - - - - - - - - - - - final List bindVariableList = new ArrayList(4); - final List bindVariableTypeList = new ArrayList(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 bindVariableList = new java.util.ArrayList(); - final java.util.List bindVariableTypeList = new java.util.ArrayList(); - addBindVariableInfo(ctx, bindVariableList, bindVariableTypeList); - final InternalBasicSelectHandler selectHandler = createBasicSelectHandler( - ctx.getSql(), specifiedResultSetHandler); - final Object[] bindVariableArray = bindVariableList.toArray(); - selectHandler.setLoggingMessageSqlArgs(bindVariableArray); - return selectHandler.execute(bindVariableArray, - toClassArray(bindVariableTypeList)); - } - - protected Object[] filterArgumentsForResultSetHandler(Object[] args) { - if (args == null || args.length == 0) { - return args; - } - final Object[] filteredArgs; - if (args[args.length - 1] instanceof jp.sf.pal.board.db.allcommon.jdbc.CursorHandler) { - filteredArgs = new Object[args.length - 1]; - for (int i = 0; i < args.length - 1; i++) { - filteredArgs[i] = args[i]; - } - } else { - filteredArgs = args; - } - return filteredArgs; - } - - protected ResultSetHandler findSpecifiedResultSetHandler(Object[] args) { - if (args == null || args.length == 0) { - return this.resultSetHandler; - } - if (args[args.length - 1] instanceof jp.sf.pal.board.db.allcommon.jdbc.CursorHandler) { - final jp.sf.pal.board.db.allcommon.jdbc.CursorHandler cursorHandler = (jp.sf.pal.board.db.allcommon.jdbc.CursorHandler) args[args.length - 1]; - return new ResultSetHandler() { - public Object handle(java.sql.ResultSet rs) - throws java.sql.SQLException { - return cursorHandler.handle(rs); - } - }; - } - if (getArgTypes().length + 1 == args.length - && args[args.length - 1] == null) { - String msg = "System Level Exception!" + getLineSeparator(); - msg = msg - + "/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *" - + getLineSeparator(); - msg = msg - + "The size of arg types have not been same as the size of arg objects:"; - msg = msg + " argTypes=" + getArgTypes().length + " args=" - + args.length + getLineSeparator(); - msg = msg - + "If the arguments contain ResultSetHandler, the argument value should not be null!" - + getLineSeparator(); - for (int i = 0; i < args.length - 1; i++) { - msg = msg + " args[" + i + "] -- " + args[i] - + getLineSeparator(); - } - msg = msg + "* * * * * * * * * */" + getLineSeparator(); - throw new IllegalStateException(msg); - } - return this.resultSetHandler; - } - - // ----------------------------------------------------- - // Setup Clause - // ------------ - protected String setupRealClause(Object[] args, - List bindVariableList, List 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 bindVariableList, List 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 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 bindVariableList, List bindVariableTypeList) { - final Object[] bindVariables = ctx.getBindVariables(); - addBindVariableList(bindVariableList, bindVariables); - final Class[] bindVariableTypes = ctx.getBindVariableTypes(); - addBindVariableTypeList(bindVariableTypeList, bindVariableTypes); - } - - protected void addBindVariableList(List bindVariableList, - Object[] bindVariables) { - for (int i = 0; i < bindVariables.length; i++) { - bindVariableList.add(bindVariables[i]); - } - } - - protected void addBindVariableTypeList(List bindVariableTypeList, - Class[] bindVariableTypes) { - for (int i = 0; i < bindVariableTypes.length; i++) { - bindVariableTypeList.add(bindVariableTypes[i]); - } - } - - //========================================================================== - // ========= - // General Helper - // ============== - protected final String replaceString(String text, String fromText, - String toText) { - return SimpleStringUtil.replace(text, fromText, toText); - } - - protected String getLineSeparator() { - return SimpleSystemUtil.getLineSeparator(); - } -} \ No newline at end of file Added: board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/s2dao/SqlLogRegistryLatestSqlProvider.java =================================================================== --- board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/s2dao/SqlLogRegistryLatestSqlProvider.java (rev 0) +++ board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/s2dao/SqlLogRegistryLatestSqlProvider.java 2008-12-27 22:09:08 UTC (rev 1625) @@ -0,0 +1,21 @@ +package jp.sf.pal.board.db.allcommon.s2dao; + +import jp.sf.pal.board.db.allcommon.jdbc.LatestSqlProvider; +import jp.sf.pal.board.db.allcommon.s2dao.internal.sqllog.InternalSqlLogRegistry; + +/** + * The provider of latest SQL using SqlLogRegistry. This instance should be + * singleton. + * + * @author DBFlute(AutoGenerator) + */ +public class SqlLogRegistryLatestSqlProvider implements LatestSqlProvider { + + public String getDisplaySql() { + return InternalSqlLogRegistry.peekCompleteSql(); + } + + public void clearSqlCache() { + InternalSqlLogRegistry.clearSqlLogRegistry(); + } +} Property changes on: board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/s2dao/SqlLogRegistryLatestSqlProvider.java ___________________________________________________________________ Name: svn:eol-style + native Modified: board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/s2dao/internal/rshandler/InternalAbstractDtoMetaDataResultSetHandler.java =================================================================== --- board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/s2dao/internal/rshandler/InternalAbstractDtoMetaDataResultSetHandler.java 2008-12-27 22:06:42 UTC (rev 1624) +++ board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/s2dao/internal/rshandler/InternalAbstractDtoMetaDataResultSetHandler.java 2008-12-27 22:09:08 UTC (rev 1625) @@ -6,10 +6,11 @@ import java.util.Map; import java.util.Set; +import jp.sf.pal.board.db.allcommon.helper.StringSet; + import org.seasar.dao.DtoMetaData; import org.seasar.dao.RowCreator; import org.seasar.extension.jdbc.ResultSetHandler; -import org.seasar.framework.util.CaseInsensitiveSet; /** * @author DBFlute(AutoGenerator) @@ -67,10 +68,10 @@ return rowCreator.createRow(rs, propertyCache, beanClass); } - protected Set createColumnNames(final ResultSetMetaData rsmd) + protected Set createColumnNames(final ResultSetMetaData rsmd) throws SQLException { final int count = rsmd.getColumnCount(); - final Set columnNames = new CaseInsensitiveSet(); + final Set columnNames = StringSet.createAsCaseInsensitive(); for (int i = 0; i < count; ++i) { final String columnName = rsmd.getColumnLabel(i + 1); final int pos = columnName.lastIndexOf('.'); // [DAO-41] Modified: board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/s2dao/internal/sqlcommand/InternalAbstractAutoStaticCommand.java =================================================================== --- board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/s2dao/internal/sqlcommand/InternalAbstractAutoStaticCommand.java 2008-12-27 22:06:42 UTC (rev 1624) +++ board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/s2dao/internal/sqlcommand/InternalAbstractAutoStaticCommand.java 2008-12-27 22:09:08 UTC (rev 1625) @@ -10,7 +10,6 @@ import org.seasar.dao.BeanMetaData; import org.seasar.dao.IdentifierGenerator; -import org.seasar.dao.NotSingleRowUpdatedRuntimeException; import org.seasar.dao.PrimaryKeyNotFoundRuntimeException; import org.seasar.extension.jdbc.PropertyType; import org.seasar.extension.jdbc.StatementFactory; @@ -24,19 +23,13 @@ //========================================================================== // ========= - // Definition - // ========== - protected static final boolean DEFAULT_VERSION_NO_AUTO_INCREMENT_ON_MEMORY = true; - - //========================================================================== - // ========= // Attribute // ========= private PropertyType[] propertyTypes; - private boolean checkSingleRowUpdate = true; + protected boolean optimisticLockHandling; - protected boolean versionNoAutoIncrementOnMemory = DEFAULT_VERSION_NO_AUTO_INCREMENT_ON_MEMORY; + protected boolean versionNoAutoIncrementOnMemory; //========================================================================== // ========= @@ -44,15 +37,10 @@ // =========== public InternalAbstractAutoStaticCommand(DataSource dataSource, StatementFactory statementFactory, BeanMetaData beanMetaData, - String[] propertyNames) { - this(dataSource, statementFactory, beanMetaData, propertyNames, - DEFAULT_VERSION_NO_AUTO_INCREMENT_ON_MEMORY); - } - - public InternalAbstractAutoStaticCommand(DataSource dataSource, - StatementFactory statementFactory, BeanMetaData beanMetaData, - String[] propertyNames, boolean versionNoAutoIncrementOnMemory) { + String[] propertyNames, boolean optimisticLockHandling, + boolean versionNoAutoIncrementOnMemory) { super(dataSource, statementFactory, beanMetaData); + this.optimisticLockHandling = optimisticLockHandling; this.versionNoAutoIncrementOnMemory = versionNoAutoIncrementOnMemory; setupPropertyTypes(propertyNames); setupSql(); @@ -62,26 +50,19 @@ // ========= // Execute // ======= - public Object execute(Object[] args) { + public Object execute(Object[] args) { // NOT for Batch. Batch should + // override. InternalAbstractAutoHandler handler = createAutoHandler(); + handler.setOptimisticLockHandling(optimisticLockHandling); + handler + .setVersionNoAutoIncrementOnMemory(versionNoAutoIncrementOnMemory); handler.setSql(getSql()); handler.setLoggingMessageSqlArgs(args); int rows = handler.execute(args); - if (isCheckSingleRowUpdate() && rows != 1) { - throw createNotSingleRowUpdatedRuntimeException(args[0], rows); - } return new Integer(rows); } - public boolean isCheckSingleRowUpdate() { - return checkSingleRowUpdate; - } - - public void setCheckSingleRowUpdate(boolean checkSingleRowUpdate) { - this.checkSingleRowUpdate = checkSingleRowUpdate; - } - - protected NotSingleRowUpdatedRuntimeException createNotSingleRowUpdatedRuntimeException( + protected EntityAlreadyUpdatedException createEntityAlreadyUpdatedException( Object bean, int rows) { return new EntityAlreadyUpdatedException(bean, rows); } @@ -194,7 +175,7 @@ protected void setupDeleteSql() { checkPrimaryKey(); - StringBuilder sb = new StringBuilder(100); + final StringBuilder sb = new StringBuilder(100); sb.append("delete from "); sb.append(getBeanMetaData().getTableName()); setupUpdateWhere(sb); @@ -215,11 +196,11 @@ sb.append(bmd.getPrimaryKey(i)).append(" = ? and "); } sb.setLength(sb.length() - 5); - if (bmd.hasVersionNoPropertyType()) { + if (optimisticLockHandling && bmd.hasVersionNoPropertyType()) { PropertyType pt = bmd.getVersionNoPropertyType(); sb.append(" and ").append(pt.getColumnName()).append(" = ?"); } - if (bmd.hasTimestampPropertyType()) { + if (optimisticLockHandling && bmd.hasTimestampPropertyType()) { PropertyType pt = bmd.getTimestampPropertyType(); sb.append(" and ").append(pt.getColumnName()).append(" = ?"); } Modified: board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/s2dao/internal/sqlcommand/InternalAbstractBatchAutoStaticCommand.java =================================================================== --- board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/s2dao/internal/sqlcommand/InternalAbstractBatchAutoStaticCommand.java 2008-12-27 22:06:42 UTC (rev 1624) +++ board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/s2dao/internal/sqlcommand/InternalAbstractBatchAutoStaticCommand.java 2008-12-27 22:09:08 UTC (rev 1625) @@ -15,49 +15,30 @@ //========================================================================== // ========= - // Attribute - // ========= - protected final boolean returningRows; - - //========================================================================== - // ========= // Constructor // =========== public InternalAbstractBatchAutoStaticCommand(DataSource dataSource, StatementFactory statementFactory, BeanMetaData beanMetaData, - String[] propertyNames, boolean returningRows) { - this(dataSource, statementFactory, beanMetaData, propertyNames, - returningRows, DEFAULT_VERSION_NO_AUTO_INCREMENT_ON_MEMORY); - } - - public InternalAbstractBatchAutoStaticCommand(DataSource dataSource, - StatementFactory statementFactory, BeanMetaData beanMetaData, - String[] propertyNames, boolean returningRows, + String[] propertyNames, boolean optimisticLockHandling, boolean versionNoAutoIncrementOnMemory) { super(dataSource, statementFactory, beanMetaData, propertyNames, - versionNoAutoIncrementOnMemory); - this.returningRows = returningRows; + optimisticLockHandling, versionNoAutoIncrementOnMemory); } //========================================================================== // ========= // Execute // ======= + @Override public Object execute(Object[] args) { final InternalAbstractBatchAutoHandler handler = createBatchAutoHandler(); - - // It is unnecessary! - // injectDaoClass(handler); - + handler.setOptimisticLockHandling(optimisticLockHandling); + handler + .setVersionNoAutoIncrementOnMemory(versionNoAutoIncrementOnMemory); handler.setSql(getSql()); // The logging message SQL of procedure is unnecessary. // handler.setLoggingMessageSqlArgs(args); - if (this.returningRows) { - return handler.executeBatch(args); - } else { - final int updatedRows = handler.execute(args); - return new Integer(updatedRows); - } + return handler.executeBatch(args); } protected abstract InternalAbstractBatchAutoHandler createBatchAutoHandler(); Modified: board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/s2dao/internal/sqlcommand/InternalAbstractDynamicCommand.java =================================================================== --- board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/s2dao/internal/sqlcommand/InternalAbstractDynamicCommand.java 2008-12-27 22:06:42 UTC (rev 1624) +++ board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/s2dao/internal/sqlcommand/InternalAbstractDynamicCommand.java 2008-12-27 22:09:08 UTC (rev 1625) @@ -44,10 +44,15 @@ } protected InternalSqlParser createInternalSqlParser(String sql) { - return new InternalSqlParser(sql); + return new InternalSqlParser(sql, isBlockNullParameter()); } - public CommandContext apply(Object[] args) {// It is necessary to be public! + protected boolean isBlockNullParameter() { // Extension Point! + return false; + } + + public CommandContext apply(Object[] args) { // It is necessary to be + // public! final CommandContext ctx = createCommandContext(args); rootNode.accept(ctx); return ctx; Modified: board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/s2dao/internal/sqlcommand/InternalAbstractSqlCommand.java =================================================================== --- board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/s2dao/internal/sqlcommand/InternalAbstractSqlCommand.java 2008-12-27 22:06:42 UTC (rev 1624) +++ board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/s2dao/internal/sqlcommand/InternalAbstractSqlCommand.java 2008-12-27 22:09:08 UTC (rev 1625) @@ -2,13 +2,16 @@ import javax.sql.DataSource; +import jp.sf.pal.board.db.allcommon.bhv.core.SqlExecution; + import org.seasar.dao.SqlCommand; import org.seasar.extension.jdbc.StatementFactory; /** * @author DBFlute(AutoGenerator) */ -public abstract class InternalAbstractSqlCommand implements SqlCommand { +public abstract class InternalAbstractSqlCommand implements SqlCommand, + SqlExecution { //========================================================================== // ========= Modified: board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/s2dao/internal/sqlcommand/InternalDeleteAutoStaticCommand.java =================================================================== --- board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/s2dao/internal/sqlcommand/InternalDeleteAutoStaticCommand.java 2008-12-27 22:06:42 UTC (rev 1624) +++ board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/s2dao/internal/sqlcommand/InternalDeleteAutoStaticCommand.java 2008-12-27 22:09:08 UTC (rev 1625) @@ -20,8 +20,9 @@ // =========== public InternalDeleteAutoStaticCommand(DataSource dataSource, StatementFactory statementFactory, BeanMetaData beanMetaData, - String[] propertyNames) { - super(dataSource, statementFactory, beanMetaData, propertyNames); + String[] propertyNames, boolean optimisticLockHandling) { + super(dataSource, statementFactory, beanMetaData, propertyNames, + optimisticLockHandling, false); } //========================================================================== Modified: board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/s2dao/internal/sqlcommand/InternalDeleteBatchAutoStaticCommand.java =================================================================== --- board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/s2dao/internal/sqlcommand/InternalDeleteBatchAutoStaticCommand.java 2008-12-27 22:06:42 UTC (rev 1624) +++ board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/s2dao/internal/sqlcommand/InternalDeleteBatchAutoStaticCommand.java 2008-12-27 22:09:08 UTC (rev 1625) @@ -21,9 +21,9 @@ // =========== public InternalDeleteBatchAutoStaticCommand(DataSource dataSource, StatementFactory statementFactory, BeanMetaData beanMetaData, - String[] propertyNames, boolean returningRows) { + String[] propertyNames, boolean optimisticLockHandling) { super(dataSource, statementFactory, beanMetaData, propertyNames, - returningRows); + optimisticLockHandling, false); } //========================================================================== Modified: board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/s2dao/internal/sqlcommand/InternalDeleteQueryAutoDynamicCommand.java =================================================================== --- board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/s2dao/internal/sqlcommand/InternalDeleteQueryAutoDynamicCommand.java 2008-12-27 22:06:42 UTC (rev 1624) +++ board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/s2dao/internal/sqlcommand/InternalDeleteQueryAutoDynamicCommand.java 2008-12-27 22:09:08 UTC (rev 1625) @@ -2,6 +2,7 @@ import javax.sql.DataSource; +import jp.sf.pal.board.db.allcommon.bhv.core.SqlExecution; import jp.sf.pal.board.db.allcommon.cbean.ConditionBean; import jp.sf.pal.board.db.allcommon.s2dao.internal.sqlhandler.InternalCommandContextHandler; import jp.sf.pal.board.db.allcommon.s2dao.internal.sqlparser.InternalCommandContextCreator; @@ -16,7 +17,8 @@ /** * @author DBFlute(AutoGenerator) */ -public class InternalDeleteQueryAutoDynamicCommand implements SqlCommand { +public class InternalDeleteQueryAutoDynamicCommand implements SqlCommand, + SqlExecution { //========================================================================== // ========= @@ -83,7 +85,7 @@ String[] argNames, Class[] argTypes, Object[] args) { CommandContext context; { - InternalSqlParser parser = new InternalSqlParser(twoWaySql); + InternalSqlParser parser = new InternalSqlParser(twoWaySql, true); Node node = parser.parse(); InternalCommandContextCreator creator = new InternalCommandContextCreator( argNames, argTypes); Modified: board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/s2dao/internal/sqlcommand/InternalInsertAutoDynamicCommand.java =================================================================== --- board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/s2dao/internal/sqlcommand/InternalInsertAutoDynamicCommand.java 2008-12-27 22:06:42 UTC (rev 1624) +++ board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/s2dao/internal/sqlcommand/InternalInsertAutoDynamicCommand.java 2008-12-27 22:09:08 UTC (rev 1625) @@ -5,11 +5,11 @@ import javax.sql.DataSource; +import jp.sf.pal.board.db.allcommon.bhv.core.SqlExecution; import jp.sf.pal.board.db.allcommon.s2dao.internal.sqlhandler.InternalInsertAutoHandler; import org.seasar.dao.BeanMetaData; import org.seasar.dao.IdentifierGenerator; -import org.seasar.dao.NotSingleRowUpdatedRuntimeException; import org.seasar.dao.SqlCommand; import org.seasar.extension.jdbc.PropertyType; import org.seasar.extension.jdbc.StatementFactory; @@ -18,7 +18,8 @@ /** * @author DBFlute(AutoGenerator) */ -public class InternalInsertAutoDynamicCommand implements SqlCommand { +public class InternalInsertAutoDynamicCommand implements SqlCommand, + SqlExecution { //========================================================================== // ========= @@ -32,8 +33,6 @@ protected String[] propertyNames; - protected boolean checkSingleRowUpdate = true; - //========================================================================== // ========= // Constructor @@ -56,9 +55,6 @@ handler.setSql(sql); handler.setLoggingMessageSqlArgs(args); final int rows = handler.execute(args); - if (isCheckSingleRowUpdate() && rows != 1) { - throw new NotSingleRowUpdatedRuntimeException(args[0], rows); - } return new Integer(rows); } @@ -161,12 +157,4 @@ public void setPropertyNames(String[] propertyNames) { this.propertyNames = propertyNames; } - - public boolean isCheckSingleRowUpdate() { - return checkSingleRowUpdate; - } - - public void setCheckSingleRowUpdate(boolean checkSingleRowUpdate) { - this.checkSingleRowUpdate = checkSingleRowUpdate; - } } Modified: board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/s2dao/internal/sqlcommand/InternalInsertBatchAutoStaticCommand.java =================================================================== --- board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/s2dao/internal/sqlcommand/InternalInsertBatchAutoStaticCommand.java 2008-12-27 22:06:42 UTC (rev 1624) +++ board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/s2dao/internal/sqlcommand/InternalInsertBatchAutoStaticCommand.java 2008-12-27 22:09:08 UTC (rev 1625) @@ -21,9 +21,9 @@ // =========== public InternalInsertBatchAutoStaticCommand(DataSource dataSource, StatementFactory statementFactory, BeanMetaData beanMetaData, - String[] propertyNames, boolean returningRows) { - super(dataSource, statementFactory, beanMetaData, propertyNames, - returningRows); + String[] propertyNames) { + super(dataSource, statementFactory, beanMetaData, propertyNames, false, + false); } //========================================================================== Modified: board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/s2dao/internal/sqlcommand/InternalProcedureCommand.java =================================================================== --- board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/s2dao/internal/sqlcommand/InternalProcedureCommand.java 2008-12-27 22:06:42 UTC (rev 1624) +++ board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/s2dao/internal/sqlcommand/InternalProcedureCommand.java 2008-12-27 22:09:08 UTC (rev 1625) @@ -2,6 +2,7 @@ import javax.sql.DataSource; +import jp.sf.pal.board.db.allcommon.bhv.core.SqlExecution; import jp.sf.pal.board.db.allcommon.cbean.outsidesql.OutsideSqlContext; import jp.sf.pal.board.db.allcommon.s2dao.internal.sqlhandler.InternalProcedureHandler; import jp.sf.pal.board.db.allcommon.s2dao.internal.various.InternalProcedureMetaData; @@ -13,7 +14,7 @@ /** * @author DBFlute(AutoGenerator) */ -public class InternalProcedureCommand implements SqlCommand { +public class InternalProcedureCommand implements SqlCommand, SqlExecution { //========================================================================== // ========= Modified: board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/s2dao/internal/sqlcommand/InternalUpdateAutoDynamicCommand.java =================================================================== --- board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/s2dao/internal/sqlcommand/InternalUpdateAutoDynamicCommand.java 2008-12-27 22:06:42 UTC (rev 1624) +++ board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/s2dao/internal/sqlcommand/InternalUpdateAutoDynamicCommand.java 2008-12-27 22:09:08 UTC (rev 1625) @@ -5,29 +5,27 @@ import javax.sql.DataSource; +import jp.sf.pal.board.db.allcommon.XLog; import jp.sf.pal.board.db.allcommon.s2dao.internal.sqlhandler.InternalUpdateAutoHandler; import org.seasar.dao.BeanMetaData; import org.seasar.dao.NoUpdatePropertyTypeRuntimeException; -import org.seasar.dao.impl.AbstractSqlCommand; import org.seasar.extension.jdbc.PropertyType; import org.seasar.extension.jdbc.StatementFactory; /** * @author DBFlute(AutoGenerator) */ -public class InternalUpdateAutoDynamicCommand extends AbstractSqlCommand { +public class InternalUpdateAutoDynamicCommand extends + InternalAbstractSqlCommand { //========================================================================== // ========= // Definition // ========== - /** Log instance. */ - private static final org.apache.commons.logging.Log _log = org.apache.commons.logging.LogFactory - .getLog(InternalUpdateAutoDynamicCommand.class); + /** The result for no update as normal execution. */ + private static final Integer NO_UPDATE = new Integer(1); - private static final Integer NO_UPDATE = new Integer(0); - //========================================================================== // ========= // Attribute @@ -36,9 +34,9 @@ private String[] propertyNames; - private boolean checkSingleRowUpdate = true; + private boolean optimisticLockHandling; - private boolean versionNoAutoIncrementOnMemory = true; + private boolean versionNoAutoIncrementOnMemory; //========================================================================== // ========= @@ -59,8 +57,8 @@ final PropertyType[] propertyTypes = createUpdatePropertyTypes(bmd, bean, getPropertyNames()); if (propertyTypes.length == 0) { - if (_log.isDebugEnabled()) { - _log.debug(createNoUpdateLogMessage(bean, bmd)); + if (isLogEnabled()) { + log(createNoUpdateLogMessage(bean, bmd)); } return NO_UPDATE; } @@ -83,10 +81,10 @@ BeanMetaData bmd, PropertyType[] propertyTypes) { InternalUpdateAutoHandler handler = new InternalUpdateAutoHandler( getDataSource(), getStatementFactory(), bmd, propertyTypes); + handler.setOptimisticLockHandling(optimisticLockHandling); //[DBFlute-0.8 + // .0] handler .setVersionNoAutoIncrementOnMemory(versionNoAutoIncrementOnMemory); - handler.setCheckSingleRowUpdate(isCheckSingleRowUpdate()); //[DBFlute-0.8 - // .0] return handler; } @@ -182,17 +180,33 @@ sb.append(bmd.getPrimaryKey(i)).append(" = ? and "); } sb.setLength(sb.length() - 5); - if (bmd.hasVersionNoPropertyType()) { + if (optimisticLockHandling && bmd.hasVersionNoPropertyType()) { PropertyType pt = bmd.getVersionNoPropertyType(); sb.append(" and ").append(pt.getColumnName()).append(" = ?"); } - if (bmd.hasTimestampPropertyType()) { + if (optimisticLockHandling && bmd.hasTimestampPropertyType()) { PropertyType pt = bmd.getTimestampPropertyType(); sb.append(" and ").append(pt.getColumnName()).append(" = ?"); } return sb.toString(); } + //========================================================================== + // ========= + // Execute Status Log + // ================== + protected void log(String msg) { + XLog.log(msg); + } + + protected boolean isLogEnabled() { + return XLog.isLogEnabled(); + } + + //========================================================================== + // ========= + // Accessor + // ======== protected boolean isVersionNoAutoIncrementOnMemory() { return versionNoAutoIncrementOnMemory; } @@ -223,11 +237,7 @@ this.propertyNames = propertyNames; } - public boolean isCheckSingleRowUpdate() { - return checkSingleRowUpdate; + public void setOptimisticLockHandling(boolean optimisticLockHandling) { + this.optimisticLockHandling = optimisticLockHandling; } - - public void setCheckSingleRowUpdate(boolean resultCheck) { - this.checkSingleRowUpdate = resultCheck; - } } Modified: board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/s2dao/internal/sqlcommand/InternalUpdateBatchAutoStaticCommand.java =================================================================== --- board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/s2dao/internal/sqlcommand/InternalUpdateBatchAutoStaticCommand.java 2008-12-27 22:06:42 UTC (rev 1624) +++ board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/s2dao/internal/sqlcommand/InternalUpdateBatchAutoStaticCommand.java 2008-12-27 22:09:08 UTC (rev 1625) @@ -21,10 +21,10 @@ // =========== public InternalUpdateBatchAutoStaticCommand(DataSource dataSource, StatementFactory statementFactory, BeanMetaData beanMetaData, - String[] propertyNames, boolean returningRows, + String[] propertyNames, boolean optimisticLockHandling, boolean versionNoAutoIncrementOnMemory) { super(dataSource, statementFactory, beanMetaData, propertyNames, - returningRows, versionNoAutoIncrementOnMemory); + optimisticLockHandling, versionNoAutoIncrementOnMemory); } //========================================================================== Modified: board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/s2dao/internal/sqlcommand/InternalUpdateDynamicCommand.java =================================================================== --- board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/s2dao/internal/sqlcommand/InternalUpdateDynamicCommand.java 2008-12-27 22:06:42 UTC (rev 1624) +++ board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/s2dao/internal/sqlcommand/InternalUpdateDynamicCommand.java 2008-12-27 22:09:08 UTC (rev 1625) @@ -28,11 +28,16 @@ // ======= public Object execute(Object args[]) { final CommandContext ctx = apply(args); - final InternalBasicUpdateHandler updateHandler = new InternalBasicUpdateHandler( - getDataSource(), ctx.getSql(), getStatementFactory()); - Object[] bindVariables = ctx.getBindVariables(); + final InternalBasicUpdateHandler updateHandler = createBasicUpdateHandler(ctx); + final Object[] bindVariables = ctx.getBindVariables(); updateHandler.setLoggingMessageSqlArgs(bindVariables); return new Integer(updateHandler.execute(bindVariables, ctx .getBindVariableTypes())); } + + protected InternalBasicUpdateHandler createBasicUpdateHandler( + CommandContext ctx) { + return new InternalBasicUpdateHandler(getDataSource(), ctx.getSql(), + getStatementFactory()); + } } Modified: board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/s2dao/internal/sqlcommand/InternalUpdateQueryAutoDynamicCommand.java =================================================================== --- board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/s2dao/internal/sqlcommand/InternalUpdateQueryAutoDynamicCommand.java 2008-12-27 22:06:42 UTC (rev 1624) +++ board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/s2dao/internal/sqlcommand/InternalUpdateQueryAutoDynamicCommand.java 2008-12-27 22:09:08 UTC (rev 1625) @@ -10,6 +10,7 @@ import javax.sql.DataSource; import jp.sf.pal.board.db.allcommon.Entity; +import jp.sf.pal.board.db.allcommon.bhv.core.SqlExecution; import jp.sf.pal.board.db.allcommon.cbean.ConditionBean; import jp.sf.pal.board.db.allcommon.dbmeta.DBMeta; import jp.sf.pal.board.db.allcommon.dbmeta.DBMetaInstanceHandler; @@ -27,7 +28,8 @@ /** * @author DBFlute(AutoGenerator) */ -public class InternalUpdateQueryAutoDynamicCommand implements SqlCommand { +public class InternalUpdateQueryAutoDynamicCommand implements SqlCommand, + SqlExecution { //========================================================================== // ========= @@ -209,7 +211,7 @@ String[] argNames, Class[] argTypes, Object[] args) { CommandContext context; { - InternalSqlParser parser = new InternalSqlParser(twoWaySql); + InternalSqlParser parser = new InternalSqlParser(twoWaySql, true); Node node = parser.parse(); InternalCommandContextCreator creator = new InternalCommandContextCreator( argNames, argTypes); Modified: board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/s2dao/internal/sqlhandler/InternalAbstractAutoHandler.java =================================================================== --- board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/s2dao/internal/sqlhandler/InternalAbstractAutoHandler.java 2008-12-27 22:06:42 UTC (rev 1624) +++ board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/s2dao/internal/sqlhandler/InternalAbstractAutoHandler.java 2008-12-27 22:09:08 UTC (rev 1625) @@ -10,12 +10,14 @@ import javax.sql.DataSource; +import jp.sf.pal.board.db.allcommon.exception.EntityAlreadyUpdatedException; +import jp.sf.pal.board.db.allcommon.util.SimpleTypeUtil; + import org.seasar.dao.BeanMetaData; import org.seasar.extension.jdbc.PropertyType; import org.seasar.extension.jdbc.StatementFactory; import org.seasar.extension.jdbc.ValueType; import org.seasar.framework.beans.PropertyDesc; -import org.seasar.framework.util.IntegerConversionUtil; /** * @author DBFlute(AutoGenerator) @@ -38,8 +40,10 @@ protected PropertyType[] propertyTypes; - protected boolean versionNoAutoIncrementOnMemory = true; + protected boolean optimisticLockHandling; + protected boolean versionNoAutoIncrementOnMemory; + //========================================================================== // ========= // Constructor @@ -52,6 +56,10 @@ this.propertyTypes = propertyTypes; } + //========================================================================== + // ========= + // Execute + // ======= public int execute(Object[] args) { Connection connection = getConnection(); try { @@ -77,6 +85,9 @@ } finally { close(ps); } + if (optimisticLockHandling && ret != 1) { + throw createEntityAlreadyUpdatedException(bean, ret); + } postUpdateBean(bean, ret); return ret; } @@ -96,12 +107,25 @@ } } + protected EntityAlreadyUpdatedException createEntityAlreadyUpdatedException( + Object bean, int rows) { + return new EntityAlreadyUpdatedException(bean, rows); + } + + //========================================================================== + // ========= + // Pre/Post Bean + // ============= protected void preUpdateBean(Object bean) { } protected void postUpdateBean(Object bean, int ret) { } + //========================================================================== + // ========= + // Bind Setupper + // ============= protected abstract void setupBindVariables(Object bean); protected void setupInsertBindVariables(Object bean) { @@ -149,7 +173,7 @@ if (value == null) { continue;// because of 'VERSION_NO = VERSION_NO + 1' } - int intValue = IntegerConversionUtil.toPrimitiveInt(value) + 1; + int intValue = SimpleTypeUtil.toPrimitiveInt(value) + 1; setVersionNo(new Integer(intValue)); varList.add(getVersionNo()); } else { @@ -182,13 +206,13 @@ varList.add(pd.getValue(bean)); varValueTypeList.add(pt.getValueType()); } - if (bmd.hasVersionNoPropertyType()) { + if (optimisticLockHandling && bmd.hasVersionNoPropertyType()) { PropertyType pt = bmd.getVersionNoPropertyType(); PropertyDesc pd = pt.getPropertyDesc(); varList.add(pd.getValue(bean)); varValueTypeList.add(pt.getValueType()); } - if (bmd.hasTimestampPropertyType()) { + if (optimisticLockHandling && bmd.hasTimestampPropertyType()) { PropertyType pt = bmd.getTimestampPropertyType(); PropertyDesc pd = pt.getPropertyDesc(); varList.add(pd.getValue(bean)); @@ -260,6 +284,14 @@ this.propertyTypes = propertyTypes; } + public boolean isOptimisticLockHandling() { + return optimisticLockHandling; + } + + public void setOptimisticLockHandling(boolean optimisticLockHandling) { + this.optimisticLockHandling = optimisticLockHandling; + } + protected boolean isVersionNoAutoIncrementOnMemory() { return versionNoAutoIncrementOnMemory; } Modified: board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/s2dao/internal/sqlhandler/InternalAbstractBatchAutoHandler.java =================================================================== --- board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/s2dao/internal/sqlhandler/InternalAbstractBatchAutoHandler.java 2008-12-27 22:06:42 UTC (rev 1624) +++ board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/s2dao/internal/sqlhandler/InternalAbstractBatchAutoHandler.java 2008-12-27 22:09:08 UTC (rev 1625) @@ -9,6 +9,11 @@ import javax.sql.DataSource; +import jp.sf.pal.board.db.allcommon.DBDef; +import jp.sf.pal.board.db.allcommon.exception.BatchEntityAlreadyUpdatedException; +import jp.sf.pal.board.db.allcommon.exception.EntityAlreadyDeletedException; +import jp.sf.pal.board.db.allcommon.exception.EntityDuplicatedException; + import org.seasar.dao.BeanMetaData; import org.seasar.extension.jdbc.PropertyType; import org.seasar.extension.jdbc.StatementFactory; @@ -41,6 +46,39 @@ // ========= // Execute // ======= + public int execute(Object[] args) { + List list = null; + if (args[0] instanceof Object[]) { + list = Arrays.asList((Object[]) args[0]); + } else if (args[0] instanceof List) { + list = (List) args[0]; + } + if (list == null) { + throw new IllegalArgumentException("args[0]"); + } + int[] ret = execute(list); + int updatedRow = 0; + for (int i = 0; i < ret.length; i++) { + if (ret[i] > 0) { + updatedRow += ret[i]; + } + } + return updatedRow; + } + + public int[] executeBatch(Object[] args) { + List list = null; + if (args[0] instanceof Object[]) { + list = Arrays.asList((Object[]) args[0]); + } else if (args[0] instanceof List) { + list = (List) args[0]; + } + if (list == null) { + throw new IllegalArgumentException("args[0]"); + } + return execute(list); + } + public int[] execute(List list, Class[] argTypes) { return execute(list); } @@ -63,7 +101,9 @@ final Object bean = (Object) iter.next(); prepareBatchElement(ps, bean); } - return executeBatch(ps, list); + final int[] result = executeBatch(ps, list); + handleBatchUpdateResultWithOptimisticLock(ps, list, result); + return result; } finally { close(ps); } @@ -74,46 +114,100 @@ // postBatchUpdateBean(...); } - public int execute(Object[] args) { - List list = null; - if (args[0] instanceof Object[]) { - list = Arrays.asList((Object[]) args[0]); - } else if (args[0] instanceof List) { - list = (List) args[0]; + protected void prepareBatchElement(PreparedStatement ps, Object bean) { + setupBindVariables(bean); + logSql(getBindVariables(), getArgTypes(getBindVariables())); + bindArgs(ps, getBindVariables(), getBindVariableValueTypes()); + addBatch(ps); + } + + //========================================================================== + // ========= + // Optimistic Lock + // =============== + protected void handleBatchUpdateResultWithOptimisticLock( + PreparedStatement ps, List list, int[] result) { + if (DBDef.isCurrentDef(DBDef.Oracle)) { + final int updateCount; + try { + updateCount = ps.getUpdateCount(); + } catch (SQLException e) { + handleSQLException(e, ps); + return; // Unreachable! + } + handleBatchUpdateResultWithOptimisticLockByUpdateCount(list, + updateCount); + } else { + handleBatchUpdateResultWithOptimisticLockByResult(list, result); } - if (list == null) { - throw new IllegalArgumentException("args[0]"); + } + + protected void handleBatchUpdateResultWithOptimisticLockByUpdateCount( + List list, int updateCount) { + if (list.isEmpty()) { + return;// for Safety! } - int[] ret = execute(list); - int updatedRow = 0; - for (int i = 0; i < ret.length; i++) { - if (ret[i] > 0) { - updatedRow += ret[i]; + if (updateCount < 0) { + return;// for Safety! + } + final int entityCount = list.size(); + if (updateCount < entityCount) { + if (isOptimisticLockHandling()) { + throw new BatchEntityAlreadyUpdatedException(list.get(0), 0, + updateCount); + } else { + String msg = "The entity have already deleted:"; + msg = msg + " updateCount=" + updateCount; + msg = msg + " entityCount=" + entityCount; + msg = msg + " allEntities=" + list; + throw new EntityAlreadyDeletedException(msg); } } - return updatedRow; } - public int[] executeBatch(Object[] args) { - List list = null; - if (args[0] instanceof Object[]) { - list = Arrays.asList((Object[]) args[0]); - } else if (args[0] instanceof List) { - list = (List) args[0]; + protected void handleBatchUpdateResultWithOptimisticLockByResult( + List list, int[] result) { + if (list.isEmpty()) { + return;// for Safety! } - if (list == null) { - throw new IllegalArgumentException("args[0]"); + final int[] updatedCountArray = result; + final int entityCount = list.size(); + int index = 0; + boolean alreadyUpdated = false; + for (int oneUpdateCount : updatedCountArray) { + if (entityCount <= index) { + break;// for Safety! + } + if (oneUpdateCount == 0) { + alreadyUpdated = true; + break; + } else if (oneUpdateCount > 1) { + String msg = "The entity updated two or more records in batch update:"; + msg = msg + " entity=" + list.get(index); + msg = msg + " updatedCount=" + oneUpdateCount; + msg = msg + " allEntities=" + list; + throw new EntityDuplicatedException(msg); + } + ++index; } - return execute(list); + if (alreadyUpdated) { + int updateCount = 0; + for (int oneUpdateCount : updatedCountArray) { + updateCount = updateCount + oneUpdateCount; + } + if (isOptimisticLockHandling()) { + throw new BatchEntityAlreadyUpdatedException(list.get(index), + 0, updateCount); + } else { + String msg = "The entity have already deleted:"; + msg = msg + " entity=" + list.get(index); + msg = msg + " updateCount=" + updateCount; + msg = msg + " allEntities=" + list; + throw new EntityAlreadyDeletedException(msg); + } + } } - protected void prepareBatchElement(PreparedStatement ps, Object bean) { - setupBindVariables(bean); - logSql(getBindVariables(), getArgTypes(getBindVariables())); - bindArgs(ps, getBindVariables(), getBindVariableValueTypes()); - addBatch(ps); - } - //========================================================================== // ========= // JDBC Delegator Modified: board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/s2dao/internal/sqlhandler/InternalBasicHandler.java =================================================================== --- board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/s2dao/internal/sqlhandler/InternalBasicHandler.java 2008-12-27 22:06:42 UTC (rev 1624) +++ board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/s2dao/internal/sqlhandler/InternalBasicHandler.java 2008-12-27 22:09:08 UTC (rev 1625) @@ -9,6 +9,7 @@ import javax.sql.DataSource; import jp.sf.pal.board.db.allcommon.CallbackContext; +import jp.sf.pal.board.db.allcommon.DBDef; import jp.sf.pal.board.db.allcommon.DBFluteConfig; import jp.sf.pal.board.db.allcommon.InternalMapContext; import jp.sf.pal.board.db.allcommon.QLog; @@ -25,7 +26,6 @@ import org.seasar.extension.jdbc.StatementFactory; import org.seasar.extension.jdbc.ValueType; import org.seasar.extension.jdbc.types.ValueTypes; -import org.seasar.framework.exception.SQLRuntimeException; /** * @author DBFlute(AutoGenerator) @@ -73,7 +73,7 @@ return; } for (int i = 0; i < args.length; ++i) { - ValueType valueType = getValueType(argTypes[i]); + final ValueType valueType = findValueType(args[i], argTypes[i]); try { valueType.bindValue(ps, i + 1, args[i]); } catch (SQLException e) { @@ -82,6 +82,19 @@ } } + protected ValueType findValueType(Object arg, Class argType) { + ValueType valueType = ValueTypes.getValueType(arg); + if (valueType != null) { + return valueType; + } + valueType = ValueTypes.getValueType(argType); + if (valueType != null) { + return valueType; + } + String msg = "Unknown type¡§argType=" + argType + " args=" + arg; + throw new IllegalStateException(msg); + } + protected Class[] getArgTypes(Object[] args) { if (args == null) { return null; @@ -151,10 +164,6 @@ return InternalBindVariableUtil.getBindVariableText(bindVariable); } - protected ValueType getValueType(Class clazz) { - return ValueTypes.getValueType(clazz); - } - //========================================================================== // ========= // Exception Handler @@ -194,9 +203,6 @@ public void handleSQLException(SQLException e, Statement statement, boolean uniqueConstraintValid, String completeSql) { - if (isSqlExceptionOldStyleHandling()) { - throw new SQLRuntimeException(e); - } if (uniqueConstraintValid && isUniqueConstraintException(e)) { throwEntityAlreadyExistsException(e, statement, completeSql); } @@ -217,10 +223,6 @@ .getUniqueConstraintDeterminator(); } - protected boolean isSqlExceptionOldStyleHandling() { - return DBFluteConfig.getInstance().isSqlExceptionOldStyleHandling(); - } - protected void throwEntityAlreadyExistsException(SQLException e, Statement statement, String completeSql) { String msg = "Look! Read the message below." + getLineSeparator(); @@ -560,7 +562,7 @@ // ========= // Assist Helper // ============= - // It needs this method if the target database doest not support line + // It needs this method if the target database does not support line // comment. protected String removeLineComment(final String sql) { // With removing CR! if (sql == null || sql.trim().length() == 0) { @@ -578,7 +580,8 @@ } sb.append(line).append("\n"); } - return sb.toString(); + final String filteredSql = sb.toString(); + return filteredSql.substring(0, filteredSql.lastIndexOf("\n")); } //========================================================================== @@ -606,9 +609,17 @@ } public void setSql(String sql) { + if (isRemoveLineCommentFromSql()) { + sql = removeLineComment(sql); + } this.sql = sql; } + protected boolean isRemoveLineCommentFromSql() { + // Because the MS-Access does not support line comments. + return DBDef.isCurrentDef(DBDef.MSAccess); + } + public StatementFactory getStatementFactory() { return statementFactory; } Modified: board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/s2dao/internal/sqlhandler/InternalBasicSelectHandler.java =================================================================== --- board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/s2dao/internal/sqlhandler/InternalBasicSelectHandler.java 2008-12-27 22:06:42 UTC (rev 1624) +++ board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/s2dao/internal/sqlhandler/InternalBasicSelectHandler.java 2008-12-27 22:09:08 UTC (rev 1625) @@ -45,8 +45,7 @@ return execute(args, getArgTypes(args)); } - @SuppressWarnings("unchecked") - public Object execute(Object[] args, Class[] argTypes) { + public Object execute(Object[] args, Class[] argTypes) { Connection conn = getConnection(); try { return execute(conn, args, argTypes); @@ -55,8 +54,7 @@ } } - @SuppressWarnings("unchecked") - public Object execute(Connection conn, Object[] args, Class[] argTypes) { + public Object execute(Connection conn, Object[] args, Class[] argTypes) { logSql(args, argTypes); PreparedStatement ps = null; try { Modified: board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/s2dao/internal/sqlhandler/InternalBasicUpdateHandler.java =================================================================== --- board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/s2dao/internal/sqlhandler/InternalBasicUpdateHandler.java 2008-12-27 22:06:42 UTC (rev 1624) +++ board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/s2dao/internal/sqlhandler/InternalBasicUpdateHandler.java 2008-12-27 22:09:08 UTC (rev 1625) @@ -29,8 +29,7 @@ return execute(args, getArgTypes(args)); } - @SuppressWarnings("unchecked") - public int execute(Object[] args, Class[] argTypes) { + public int execute(Object[] args, Class[] argTypes) { Connection connection = getConnection(); try { return execute(connection, args, argTypes); @@ -39,8 +38,7 @@ } } - @SuppressWarnings("unchecked") - public int execute(Connection connection, Object[] args, Class[] argTypes) { + public int execute(Connection connection, Object[] args, Class[] argTypes) { logSql(args, argTypes); PreparedStatement ps = prepareStatement(connection); try { Modified: board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/s2dao/internal/sqlhandler/InternalInsertAutoHandler.java =================================================================== --- board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/s2dao/internal/sqlhandler/InternalInsertAutoHandler.java 2008-12-27 22:06:42 UTC (rev 1624) +++ board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/s2dao/internal/sqlhandler/InternalInsertAutoHandler.java 2008-12-27 22:09:08 UTC (rev 1625) @@ -20,6 +20,7 @@ StatementFactory statementFactory, BeanMetaData beanMetaData, PropertyType[] propertyTypes) { super(dataSource, statementFactory, beanMetaData, propertyTypes); + setOptimisticLockHandling(false); } //========================================================================== Modified: board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/s2dao/internal/sqlhandler/InternalInsertBatchAutoHandler.java =================================================================== --- board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/s2dao/internal/sqlhandler/InternalInsertBatchAutoHandler.java 2008-12-27 22:06:42 UTC (rev 1624) +++ board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/s2dao/internal/sqlhandler/InternalInsertBatchAutoHandler.java 2008-12-27 22:09:08 UTC (rev 1625) @@ -19,8 +19,8 @@ public InternalInsertBatchAutoHandler(DataSource dataSource, StatementFactory statementFactory, BeanMetaData beanMetaData, PropertyType[] propertyTypes) { - super(dataSource, statementFactory, beanMetaData, propertyTypes); + setOptimisticLockHandling(false); } //========================================================================== Modified: board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/s2dao/internal/sqlhandler/InternalProcedureHandler.java =================================================================== --- board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/s2dao/internal/sqlhandler/InternalProcedureHandler.java 2008-12-27 22:06:42 UTC (rev 1624) +++ board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/s2dao/internal/sqlhandler/InternalProcedureHandler.java 2008-12-27 22:09:08 UTC (rev 1625) @@ -12,6 +12,7 @@ import javax.sql.DataSource; +import jp.sf.pal.board.db.allcommon.helper.StringKeyMap; import jp.sf.pal.board.db.allcommon.s2dao.internal.various.InternalProcedureMetaData; import jp.sf.pal.board.db.allcommon.s2dao.internal.various.InternalProcedureParameterType; @@ -21,7 +22,6 @@ import org.seasar.extension.jdbc.ValueType; import org.seasar.extension.jdbc.impl.PropertyTypeImpl; import org.seasar.extension.jdbc.types.ValueTypes; -import org.seasar.framework.util.CaseInsensitiveMap; /** * @author DBFlute(AutoGenerator) @@ -220,10 +220,9 @@ protected static abstract class InternalAbstractMapResultSetHandler implements ResultSetHandler { - @SuppressWarnings("unchecked") protected Map createRow(ResultSet rs, PropertyType[] propertyTypes) throws SQLException { - Map row = new CaseInsensitiveMap(); + Map row = StringKeyMap.createAsFlexible(); for (int i = 0; i < propertyTypes.length; ++i) { Object value = propertyTypes[i].getValueType().getValue(rs, i + 1); Modified: board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/s2dao/internal/sqlhandler/InternalUpdateAutoHandler.java =================================================================== --- board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/s2dao/internal/sqlhandler/InternalUpdateAutoHandler.java 2008-12-27 22:06:42 UTC (rev 1624) +++ board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/s2dao/internal/sqlhandler/InternalUpdateAutoHandler.java 2008-12-27 22:09:08 UTC (rev 1625) @@ -2,8 +2,6 @@ import javax.sql.DataSource; -import jp.sf.pal.board.db.allcommon.exception.EntityAlreadyUpdatedException; - import org.seasar.dao.BeanMetaData; import org.seasar.extension.jdbc.PropertyType; import org.seasar.extension.jdbc.StatementFactory; @@ -17,12 +15,6 @@ // ========= // Constructor // =========== - private boolean checkSingleRowUpdate = true; - - //========================================================================== - // ========= - // Constructor - // =========== public InternalUpdateAutoHandler(DataSource dataSource, StatementFactory statementFactory, BeanMetaData beanMetaData, PropertyType[] propertyTypes) { @@ -41,27 +33,7 @@ @Override protected void postUpdateBean(Object bean, int ret) { - if (isCheckSingleRowUpdate() && ret < 1) { - throw createEntityAlreadyUpdatedException(bean, ret); - } updateVersionNoIfNeed(bean); updateTimestampIfNeed(bean); } - - protected EntityAlreadyUpdatedException createEntityAlreadyUpdatedException( - Object bean, int rows) { - return new EntityAlreadyUpdatedException(bean, rows); - } - - //========================================================================== - // ========= - // Accessor - // ======== - public boolean isCheckSingleRowUpdate() { - return checkSingleRowUpdate; - } - - public void setCheckSingleRowUpdate(boolean resultCheck) { - this.checkSingleRowUpdate = resultCheck; - } } Modified: board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/s2dao/internal/sqlparser/InternalSqlParser.java =================================================================== --- board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/s2dao/internal/sqlparser/InternalSqlParser.java 2008-12-27 22:06:42 UTC (rev 1624) +++ board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/s2dao/internal/sqlparser/InternalSqlParser.java 2008-12-27 22:09:08 UTC (rev 1625) @@ -45,22 +45,25 @@ // ========= // Attribute // ========= + protected String specifiedSql; + + protected boolean blockNullParameter; + protected InternalSqlTokenizer tokenizer; protected Stack nodeStack = new Stack(); - protected String specifiedSql;// Extension! - //========================================================================== // ========= // Constructor // =========== - public InternalSqlParser(String sql) { + public InternalSqlParser(String sql, boolean blockNullParameter) { sql = sql.trim(); if (sql.endsWith(";")) { sql = sql.substring(0, sql.length() - 1); } - specifiedSql = sql;// Extension! + specifiedSql = sql; + this.blockNullParameter = blockNullParameter; tokenizer = new InternalSqlTokenizer(sql); } @@ -303,12 +306,14 @@ protected AbstractNode createBindVariableNode(String expr, String testValue) {// Extension // ! - return new InternalBindVariableNode(expr, testValue, specifiedSql); + return new InternalBindVariableNode(expr, testValue, specifiedSql, + blockNullParameter); } protected AbstractNode createEmbeddedValueNode(String expr, String testValue) {// Extension // ! - return new InternalEmbeddedValueNode(expr, testValue, specifiedSql); + return new InternalEmbeddedValueNode(expr, testValue, specifiedSql, + blockNullParameter); } protected ContainerNode createIfNode(String expr) {// Extension! @@ -344,12 +349,15 @@ protected String _specifiedSql; + protected boolean _blockNullParameter; + public InternalBindVariableNode(String expression, String testValue, - String specifiedSql) { + String specifiedSql, boolean blockNullParameter) { this._expression = expression; this._testValue = testValue; this._names = InternalStringUtil.split(expression, "."); this._specifiedSql = specifiedSql; + this._blockNullParameter = blockNullParameter; } public void accept(CommandContext ctx) { @@ -360,7 +368,7 @@ valueAndType.setTargetType(clazz); setupValueAndType(valueAndType); - if (valueAndType.getTargetValue() == null) { + if (_blockNullParameter && valueAndType.getTargetValue() == null) { throwBindOrEmbeddedParameterNullValueException(valueAndType); } if (!isInScope()) { @@ -462,12 +470,15 @@ protected String _specifiedSql; + protected boolean _blockNullParameter; + public InternalEmbeddedValueNode(String expression, String testValue, - String specifiedSql) { + String specifiedSql, boolean blockNullParameter) { this._expression = expression; this._testValue = testValue; this._names = InternalStringUtil.split(expression, "."); this._specifiedSql = specifiedSql; + this._blockNullParameter = blockNullParameter; } public void accept(CommandContext ctx) { @@ -478,7 +489,7 @@ valueAndType.setTargetType(clazz); setupValueAndType(valueAndType); - if (valueAndType.getTargetValue() == null) { + if (_blockNullParameter && valueAndType.getTargetValue() == null) { throwBindOrEmbeddedParameterNullValueException(valueAndType); } if (!isInScope()) { @@ -1276,7 +1287,8 @@ String[] argNames, Class[] argTypes, Object[] args) { final CommandContext context; { - final InternalSqlParser parser = new InternalSqlParser(twoWaySql); + final InternalSqlParser parser = new InternalSqlParser(twoWaySql, + false); final Node node = parser.parse(); final InternalCommandContextCreator creator = new InternalCommandContextCreator( argNames, argTypes); Added: board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/s2dao/internal/various/InternalIdentifierAbstractGenerator.java =================================================================== --- board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/s2dao/internal/various/InternalIdentifierAbstractGenerator.java (rev 0) +++ board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/s2dao/internal/various/InternalIdentifierAbstractGenerator.java 2008-12-27 22:09:08 UTC (rev 1625) @@ -0,0 +1,146 @@ +package jp.sf.pal.board.db.allcommon.s2dao.internal.various; + +import java.sql.CallableStatement; +import java.sql.Connection; +import java.sql.PreparedStatement; +import java.sql.ResultSet; +import java.sql.SQLException; +import java.sql.Statement; + +import javax.sql.DataSource; + +import jp.sf.pal.board.db.allcommon.s2dao.internal.sqlhandler.InternalBasicSelectHandler; +import jp.sf.pal.board.db.allcommon.s2dao.internal.sqlhandler.InternalBasicHandler.SQLExceptionHandler; + +import org.seasar.dao.Dbms; +import org.seasar.dao.IdentifierGenerator; +import org.seasar.extension.jdbc.PropertyType; +import org.seasar.extension.jdbc.ResultSetHandler; +import org.seasar.extension.jdbc.StatementFactory; +import org.seasar.extension.jdbc.ValueType; +import org.seasar.framework.beans.PropertyDesc; + +/** + * @author DBFlute(AutoGenerator) + */ +public abstract class InternalIdentifierAbstractGenerator implements + IdentifierGenerator { + + //========================================================================== + // ========= + // Attribute + // ========= + protected PropertyType propertyType; + + protected Dbms dbms; + + protected ResultSetHandler resultSetHandler; + + //========================================================================== + // ========= + // Constructor + // =========== + public InternalIdentifierAbstractGenerator(PropertyType propertyType, + Dbms dbms) { + this.propertyType = propertyType; + this.dbms = dbms; + resultSetHandler = new InternalIdentifierResultSetHandler(propertyType + .getValueType()); + } + + //========================================================================== + // ========= + // Assist Helper + // ============= + protected Object executeSql(DataSource ds, String sql, Object[] args) { + InternalBasicSelectHandler selectHandler = createSelectHandler(ds, sql); + if (args != null) { + selectHandler.setLoggingMessageSqlArgs(args); + } + return selectHandler.execute(args); + } + + protected InternalBasicSelectHandler createSelectHandler(DataSource ds, + String sql) { + // Use original statement factory for identifier generator. + return new InternalBasicSelectHandler(ds, sql, resultSetHandler, + createStatementFactory(ds, sql)); + } + + protected StatementFactory createStatementFactory(DataSource ds, String sql) { + return new InternalIdentifierGeneratorStatementFactory(); + } + + protected void reflectIdentifier(Object bean, Object value) { + if (propertyType == null) { + String msg = "The arguement[propertyType] should not be null: value=" + + value; + throw new IllegalArgumentException(msg); + } + PropertyDesc pd = propertyType.getPropertyDesc(); + pd.setValue(bean, value); + } + + //========================================================================== + // ========= + // Result Set Handler + // ================== + protected static class InternalIdentifierResultSetHandler implements + ResultSetHandler { + private ValueType valueType; + + public InternalIdentifierResultSetHandler(ValueType valueType) { + this.valueType = valueType; + } + + public Object handle(ResultSet rs) throws SQLException { + if (rs.next()) { + return valueType.getValue(rs, 1); + } + return null; + } + } + + //========================================================================== + // ========= + // Statement Factory + // ================= + protected static class InternalIdentifierGeneratorStatementFactory + implements StatementFactory { + public PreparedStatement createPreparedStatement(Connection conn, + String sql) { + try { + return conn.prepareStatement(sql); + } catch (SQLException e) { + handleSQLException(e, null); + return null; // Unreachable! + } + } + + public CallableStatement createCallableStatement(Connection conn, + String sql) { + try { + return conn.prepareCall(sql); + } catch (SQLException e) { + handleSQLException(e, null); + return null; // Unreachable! + } + } + + protected void handleSQLException(SQLException e, Statement statement) { + new SQLExceptionHandler().handleSQLException(e, statement); + } + } + + //========================================================================== + // ========= + // Accessor + // ======== + public String getPropertyName() { + return propertyType.getPropertyName(); + } + + public Dbms getDbms() { + return dbms; + } +} Property changes on: board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/s2dao/internal/various/InternalIdentifierAbstractGenerator.java ___________________________________________________________________ Name: svn:eol-style + native Added: board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/s2dao/internal/various/InternalIdentifierAssignedGenerator.java =================================================================== --- board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/s2dao/internal/various/InternalIdentifierAssignedGenerator.java (rev 0) +++ board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/s2dao/internal/various/InternalIdentifierAssignedGenerator.java 2008-12-27 22:09:08 UTC (rev 1625) @@ -0,0 +1,33 @@ +package jp.sf.pal.board.db.allcommon.s2dao.internal.various; + +import javax.sql.DataSource; + +import org.seasar.dao.Dbms; +import org.seasar.extension.jdbc.PropertyType; + +/** + * @author DBFlute(AutoGenerator) + */ +public class InternalIdentifierAssignedGenerator extends + InternalIdentifierAbstractGenerator { + + //========================================================================== + // ========= + // Constructor + // =========== + public InternalIdentifierAssignedGenerator(PropertyType propertyType, + Dbms dbms) { + super(propertyType, dbms); + } + + //========================================================================== + // ========= + // Implementation + // ============== + public void setIdentifier(Object bean, DataSource ds) { + } + + public boolean isSelfGenerate() { + return true; + } +} Property changes on: board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/s2dao/internal/various/InternalIdentifierAssignedGenerator.java ___________________________________________________________________ Name: svn:eol-style + native Added: board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/s2dao/internal/various/InternalIdentifierGeneratorFactory.java =================================================================== --- board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/s2dao/internal/various/InternalIdentifierGeneratorFactory.java (rev 0) +++ board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/s2dao/internal/various/InternalIdentifierGeneratorFactory.java 2008-12-27 22:09:08 UTC (rev 1625) @@ -0,0 +1,105 @@ +package jp.sf.pal.board.db.allcommon.s2dao.internal.various; + +import java.lang.reflect.Constructor; +import java.util.HashMap; +import java.util.Map; + +import jp.sf.pal.board.db.allcommon.util.SimpleStringUtil; + +import org.seasar.dao.Dbms; +import org.seasar.dao.IdentifierGenerator; +import org.seasar.extension.jdbc.PropertyType; +import org.seasar.framework.beans.BeanDesc; +import org.seasar.framework.beans.PropertyDesc; +import org.seasar.framework.beans.factory.BeanDescFactory; +import org.seasar.framework.util.ClassUtil; +import org.seasar.framework.util.ConstructorUtil; + +/** + * @author DBFlute(AutoGenerator) + */ +public class InternalIdentifierGeneratorFactory { + + //========================================================================== + // ========= + // Attribute + // ========= + private static Map> generatorClasses = new HashMap>(); + + static { + addIdentifierGeneratorClass("assigned", + InternalIdentifierAssignedGenerator.class); + addIdentifierGeneratorClass("identity", + InternalIdentifierIdentityGenerator.class); + addIdentifierGeneratorClass("sequence", + InternalIdentifierSequenceGenerator.class); + } + + //========================================================================== + // ========= + // Constructor + // =========== + private InternalIdentifierGeneratorFactory() { + } + + //========================================================================== + // ========= + // Identifier Generator + // ==================== + public static void addIdentifierGeneratorClass(String name, Class clazz) { + generatorClasses.put(name, clazz); + } + + public static IdentifierGenerator createIdentifierGenerator( + PropertyType propertyType, Dbms dbms) { + return createIdentifierGenerator(propertyType, dbms, null); + } + + public static IdentifierGenerator createIdentifierGenerator( + PropertyType propertyType, Dbms dbms, String annotation) { + if (propertyType == null) { + String msg = "The argument[propertyType] should not be null: dbms=" + + dbms + " annotation=" + annotation; + throw new IllegalArgumentException(msg); + } + if (dbms == null) { + String msg = "The argument[dbms] should not be null: propertyType=" + + propertyType + " annotation=" + annotation; + throw new IllegalArgumentException(msg); + } + if (annotation == null) { + return new InternalIdentifierAssignedGenerator(propertyType, dbms); + } + String[] array = SimpleStringUtil.split(annotation, "=, "); + Class clazz = getGeneratorClass(array[0]); + IdentifierGenerator generator = createIdentifierGenerator(clazz, + propertyType, dbms); + for (int i = 1; i < array.length; i += 2) { + setProperty(generator, array[i].trim(), array[i + 1].trim()); + } + return generator; + } + + protected static Class getGeneratorClass(String name) { + Class clazz = generatorClasses.get(name); + if (clazz != null) { + return clazz; + } + return ClassUtil.forName(name); + } + + protected static IdentifierGenerator createIdentifierGenerator( + Class clazz, PropertyType propertyType, Dbms dbms) { + Constructor constructor = ClassUtil.getConstructor(clazz, + new Class[] { PropertyType.class, Dbms.class }); + return (IdentifierGenerator) ConstructorUtil.newInstance(constructor, + new Object[] { propertyType, dbms }); + } + + protected static void setProperty(IdentifierGenerator generator, + String propertyName, String value) { + BeanDesc beanDesc = BeanDescFactory.getBeanDesc(generator.getClass()); + PropertyDesc pd = beanDesc.getPropertyDesc(propertyName); + pd.setValue(generator, value); + } +} Property changes on: board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/s2dao/internal/various/InternalIdentifierGeneratorFactory.java ___________________________________________________________________ Name: svn:eol-style + native Added: board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/s2dao/internal/various/InternalIdentifierIdentityGenerator.java =================================================================== --- board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/s2dao/internal/various/InternalIdentifierIdentityGenerator.java (rev 0) +++ board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/s2dao/internal/various/InternalIdentifierIdentityGenerator.java 2008-12-27 22:09:08 UTC (rev 1625) @@ -0,0 +1,35 @@ +package jp.sf.pal.board.db.allcommon.s2dao.internal.various; + +import javax.sql.DataSource; + +import org.seasar.dao.Dbms; +import org.seasar.extension.jdbc.PropertyType; + +/** + * @author DBFlute(AutoGenerator) + */ +public class InternalIdentifierIdentityGenerator extends + InternalIdentifierAbstractGenerator { + + //========================================================================== + // ========= + // Constructor + // =========== + public InternalIdentifierIdentityGenerator(PropertyType propertyType, + Dbms dbms) { + super(propertyType, dbms); + } + + //========================================================================== + // ========= + // Implementation + // ============== + public void setIdentifier(Object bean, DataSource ds) { + Object value = executeSql(ds, getDbms().getIdentitySelectString(), null); + reflectIdentifier(bean, value); + } + + public boolean isSelfGenerate() { + return false; + } +} Property changes on: board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/s2dao/internal/various/InternalIdentifierIdentityGenerator.java ___________________________________________________________________ Name: svn:eol-style + native Added: board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/s2dao/internal/various/InternalIdentifierSequenceGenerator.java =================================================================== --- board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/s2dao/internal/various/InternalIdentifierSequenceGenerator.java (rev 0) +++ board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/s2dao/internal/various/InternalIdentifierSequenceGenerator.java 2008-12-27 22:09:08 UTC (rev 1625) @@ -0,0 +1,116 @@ +package jp.sf.pal.board.db.allcommon.s2dao.internal.various; + +import java.util.HashMap; + +import javax.sql.DataSource; + +import jp.sf.pal.board.db.allcommon.util.SimpleTypeUtil; + +import org.seasar.dao.Dbms; +import org.seasar.extension.jdbc.PropertyType; + +/** + * @author DBFlute(AutoGenerator) + */ +public class InternalIdentifierSequenceGenerator extends + InternalIdentifierAbstractGenerator { + + // - - - - - - - - - - + // [Unused on DBFlute] + // - - - - - - - - - - + + //========================================================================== + // ========= + // Attribute + // ========= + private String sequenceName; + + private long allocationSize = 0; + + private HashMap idContextMap = new HashMap(); + + //========================================================================== + // ========= + // Constructor + // =========== + public InternalIdentifierSequenceGenerator(PropertyType propertyType, + Dbms dbms) { + super(propertyType, dbms); + } + + //========================================================================== + // ========= + // Implementation + // ============== + public void setIdentifier(Object bean, DataSource ds) { + reflectIdentifier(bean, getNextValue(ds)); + } + + public boolean isSelfGenerate() { + return getDbms().isSelfGenerate(); + } + + //========================================================================== + // ========= + // Next Value + // ========== + protected Object getNextValue(DataSource ds) { + if (allocationSize > 0) { + long value = getIdContext(ds).getNextValue(ds); + return new Long(value); + } + return getNewInitialValue(ds); + } + + protected Object getNewInitialValue(DataSource ds) { + return executeSql(ds, getDbms().getSequenceNextValString(sequenceName), + null); + } + + protected IdContext getIdContext(DataSource ds) { + synchronized (idContextMap) { + IdContext context = idContextMap.get(ds); + if (context == null) { + context = new IdContext(); + idContextMap.put(ds, context); + } + return context; + } + } + + public class IdContext { + protected long initialValue; + + protected long allocated = Long.MAX_VALUE; + + public synchronized long getNextValue(DataSource ds) { + if (allocated < allocationSize) { + return initialValue + allocated++; + } + initialValue = SimpleTypeUtil + .toPrimitiveLong(getNewInitialValue(ds)); + allocated = 1; + return initialValue; + } + } + + //========================================================================== + // ========= + // Accessor + // ======== + public String getSequenceName() { + return sequenceName; + } + + public void setSequenceName(String sequenceName) { + this.sequenceName = sequenceName; + } + + public long getAllocationSize() { + return allocationSize; + } + + public void setAllocationSize(long allocationSize) { + this.allocationSize = allocationSize; + } +} Property changes on: board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/s2dao/internal/various/InternalIdentifierSequenceGenerator.java ___________________________________________________________________ Name: svn:eol-style + native Modified: board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/s2dao/internal/various/InternalProcedureMetaDataFactory.java =================================================================== --- board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/s2dao/internal/various/InternalProcedureMetaDataFactory.java 2008-12-27 22:06:42 UTC (rev 1624) +++ board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/s2dao/internal/various/InternalProcedureMetaDataFactory.java 2008-12-27 22:09:08 UTC (rev 1625) @@ -7,7 +7,7 @@ import java.util.Map; import java.util.Stack; -import jp.sf.pal.board.db.allcommon.cbean.ConditionBeanContext; +import jp.sf.pal.board.db.allcommon.DBDef; import org.seasar.dao.ValueTypeFactory; import org.seasar.dao.util.TypeUtil; @@ -146,9 +146,9 @@ } final Class type = field.getType(); if (List.class.isAssignableFrom(type)) {// is for out parameter cursor. - if (ConditionBeanContext.isOracle()) { + if (DBDef.isCurrentDef(DBDef.Oracle)) { return ValueTypes.ORACLE_RESULT_SET; - } else if (ConditionBeanContext.isPostgreSql()) { + } else if (DBDef.isCurrentDef(DBDef.PostgreSQL)) { return ValueTypes.POSTGRE_RESULT_SET; } else { return ValueTypes.SERIALIZABLE_BYTE_ARRAY; Added: board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/s2dao/internal/various/InternalStatementFactory.java =================================================================== --- board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/s2dao/internal/various/InternalStatementFactory.java (rev 0) +++ board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/s2dao/internal/various/InternalStatementFactory.java 2008-12-27 22:09:08 UTC (rev 1625) @@ -0,0 +1,158 @@ +package jp.sf.pal.board.db.allcommon.s2dao.internal.various; + +import java.sql.CallableStatement; +import java.sql.Connection; +import java.sql.PreparedStatement; +import java.sql.SQLException; +import java.sql.Statement; + +import jp.sf.pal.board.db.allcommon.cbean.ConditionBean; +import jp.sf.pal.board.db.allcommon.cbean.ConditionBeanContext; +import jp.sf.pal.board.db.allcommon.cbean.outsidesql.OutsideSqlContext; +import jp.sf.pal.board.db.allcommon.jdbc.StatementConfig; +import jp.sf.pal.board.db.allcommon.s2dao.internal.sqlhandler.InternalBasicHandler.SQLExceptionHandler; + +import org.seasar.extension.jdbc.StatementFactory; + +/** + * @author DBFlute(AutoGenerator) + */ +public class InternalStatementFactory implements StatementFactory { + + //========================================================================== + // ========= + // Definition + // ========== + /** Log-instance. */ + private static final org.apache.commons.logging.Log _log = org.apache.commons.logging.LogFactory + .getLog(InternalStatementFactory.class); + + //========================================================================== + // ========= + // Attribute + // ========= + protected StatementConfig defaultStatementConfig; + + protected boolean internalDebug; + + //========================================================================== + // ========= + // Constructor + // =========== + public InternalStatementFactory() { + } + + //========================================================================== + // ========= + // Implementation + // ============== + public PreparedStatement createPreparedStatement(Connection conn, String sql) { + try { + final StatementConfig config = findStatementConfigOnThread(); + ; + final int resultSetType; + if (config != null && config.hasResultSetType()) { + resultSetType = config.getResultSetType(); + } else if (defaultStatementConfig != null + && defaultStatementConfig.hasResultSetType()) { + resultSetType = defaultStatementConfig.getResultSetType(); + } else { + resultSetType = java.sql.ResultSet.TYPE_FORWARD_ONLY; + } + final int resultSetConcurrency = java.sql.ResultSet.CONCUR_READ_ONLY; + if (internalDebug) { + _log.debug("...Creating prepareStatement(sql, " + resultSetType + + ", " + resultSetConcurrency + ")"); + } + final PreparedStatement ps = conn.prepareStatement(sql, + resultSetType, resultSetConcurrency); + if (config != null && config.hasStatementOptions()) { + if (internalDebug) { + _log.debug("...Setting statement config as request: " + + config); + } + reflectStatementOptions(config, ps); + } else { + reflectDefaultOptionsToStatementIfNeeds(ps); + } + return ps; + } catch (SQLException e) { + handleSQLException(e, null); + return null;// Unreachable! + } + } + + public CallableStatement createCallableStatement(Connection conn, String sql) { + return prepareCall(conn, sql); + } + + protected StatementConfig findStatementConfigOnThread() { + final StatementConfig config; + if (ConditionBeanContext.isExistConditionBeanOnThread()) { + final ConditionBean cb = ConditionBeanContext + .getConditionBeanOnThread(); + config = cb.getStatementConfig(); + } else if (OutsideSqlContext.isExistOutsideSqlContextOnThread()) { + final OutsideSqlContext context = OutsideSqlContext + .getOutsideSqlContextOnThread(); + config = context.getStatementConfig(); + } else { + config = null; + } + return config; + } + + protected void reflectDefaultOptionsToStatementIfNeeds(PreparedStatement ps) { + if (defaultStatementConfig != null + && defaultStatementConfig.hasStatementOptions()) { + if (internalDebug) { + _log.debug("...Setting statement config as default: " + + defaultStatementConfig); + } + reflectStatementOptions(defaultStatementConfig, ps); + return; + } + } + + protected void reflectStatementOptions(StatementConfig config, + PreparedStatement ps) { + try { + if (config.hasQueryTimeout()) { + ps.setQueryTimeout(config.getQueryTimeout()); + } + if (config.hasFetchSize()) { + ps.setFetchSize(config.getFetchSize()); + } + if (config.hasMaxRows()) { + ps.setMaxRows(config.getMaxRows()); + } + } catch (SQLException e) { + handleSQLException(e, ps); + } + } + + protected CallableStatement prepareCall(Connection conn, String sql) { + try { + return conn.prepareCall(sql); + } catch (SQLException e) { + handleSQLException(e, null); + return null;// Unreachable! + } + } + + protected void handleSQLException(SQLException e, Statement statement) { + new SQLExceptionHandler().handleSQLException(e, statement); + } + + //========================================================================== + // ========= + // Accessor + // ======== + public void setDefaultStatementConfig(StatementConfig defaultStatementConfig) { + this.defaultStatementConfig = defaultStatementConfig; + } + + public void setInternalDebug(boolean internalDebug) { + this.internalDebug = internalDebug; + } +} Property changes on: board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/s2dao/internal/various/InternalStatementFactory.java ___________________________________________________________________ Name: svn:eol-style + native Modified: board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/util/SimpleAssertUtil.java =================================================================== --- board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/util/SimpleAssertUtil.java 2008-12-27 22:06:42 UTC (rev 1624) +++ board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/util/SimpleAssertUtil.java 2008-12-27 22:09:08 UTC (rev 1625) @@ -7,11 +7,8 @@ //========================================================================== // ========= - // Assert + // Object // ====== - // ----------------------------------------------------- - // Assert Object - // ------------- /** * Assert that the object is not null. * @@ -32,9 +29,10 @@ } } - // ----------------------------------------------------- - // Assert String - // ------------- + //========================================================================== + // ========= + // String + // ====== /** * Assert that the entity is not null and not trimmed empty. * Added: board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/util/SimpleResourceUtil.java =================================================================== --- board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/util/SimpleResourceUtil.java (rev 0) +++ board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/util/SimpleResourceUtil.java 2008-12-27 22:09:08 UTC (rev 1625) @@ -0,0 +1,117 @@ +package jp.sf.pal.board.db.allcommon.util; + +import java.io.IOException; +import java.io.InputStream; +import java.net.URL; +import java.net.URLConnection; + +/** + * @author DBFlute(AutoGenerator) + */ +public class SimpleResourceUtil { + + //========================================================================== + // ========= + // Resource Path + // ============= + public static String getResourcePath(String path, String extension) { + if (extension == null) { + return path; + } + extension = "." + extension; + if (path.endsWith(extension)) { + return path; + } + return path.replace('.', '/') + extension; + } + + public static String getResourcePath(Class clazz) { + return clazz.getName().replace('.', '/') + ".class"; + } + + //========================================================================== + // ========= + // Resource URL + // ============ + public static URL getResourceUrl(String path) { + return getResourceUrl(path, null); + } + + public static URL getResourceUrl(String path, String extension) { + return getResourceUrl(path, extension, Thread.currentThread() + .getContextClassLoader()); + } + + public static URL getResourceUrl(String path, String extension, + ClassLoader loader) { + if (path == null || loader == null) { + return null; + } + path = getResourcePath(path, extension); + return loader.getResource(path); + } + + //========================================================================== + // ========= + // Resource Stream + // =============== + public static InputStream getResourceStream(String path) { + return getResourceStream(path, null); + } + + public static InputStream getResourceStream(String path, String extension) { + final URL url = getResourceUrl(path, extension); + return url != null ? openStream(url) : null; + } + + //========================================================================== + // ========= + // Resource Existence + // ================== + public static boolean isExist(String path) { + return getResourceUrl(path) != null; + } + + //========================================================================== + // ========= + // Assist Helper + // ============= + protected static ClassLoader getClassLoader() { + return Thread.currentThread().getContextClassLoader(); + } + + protected static InputStream openStream(URL url) { + try { + URLConnection connection = url.openConnection(); + connection.setUseCaches(false); + return connection.getInputStream(); + } catch (IOException e) { + String msg = "Failed to open the stream: url=" + url; + throw new IllegalStateException(msg, e); + } + } + + //========================================================================== + // ========= + // Assert Helper + // ============= + /** + * Assert that the object is not null. + * + * @param variableName Variable name. (NotNull) + * @param value Value. (NotNull) + * @exception IllegalArgumentException + */ + protected static void assertObjectNotNull(String variableName, Object value) { + if (variableName == null) { + String msg = "The value should not be null: variableName=" + + variableName + " value=" + value; + throw new IllegalArgumentException(msg); + } + if (value == null) { + String msg = "The value should not be null: variableName=" + + variableName; + throw new IllegalArgumentException(msg); + } + } +} Property changes on: board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/util/SimpleResourceUtil.java ___________________________________________________________________ Name: svn:eol-style + native Modified: board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/util/SimpleStringUtil.java =================================================================== --- board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/util/SimpleStringUtil.java 2008-12-27 22:06:42 UTC (rev 1624) +++ board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/util/SimpleStringUtil.java 2008-12-27 22:09:08 UTC (rev 1625) @@ -1,14 +1,20 @@ package jp.sf.pal.board.db.allcommon.util; +import java.util.ArrayList; +import java.util.List; +import java.util.StringTokenizer; + /** * @author DBFlute(AutoGenerator) */ public class SimpleStringUtil { + protected static final String[] EMPTY_STRINGS = new String[0]; + //========================================================================== // ========= - // String - // ====== + // Replace + // ======= public static String replace(String text, String fromText, String toText) { if (text == null || fromText == null || toText == null) { return null; @@ -32,6 +38,26 @@ } while (true); } + //========================================================================== + // ========= + // Split + // ===== + public static String[] split(final String str, final String delimiter) { + if (str == null || str.trim().length() == 0) { + return EMPTY_STRINGS; + } + final List list = new ArrayList(); + final StringTokenizer st = new StringTokenizer(str, delimiter); + while (st.hasMoreElements()) { + list.add(st.nextToken()); + } + return (String[]) list.toArray(new String[list.size()]); + } + + //========================================================================== + // ========= + // Initial Convert + // =============== public static String initCap(String str) { assertObjectNotNull("str", str); return str.substring(0, 1).toUpperCase() + str.substring(1); @@ -42,9 +68,10 @@ return str.substring(0, 1).toLowerCase() + str.substring(1); } - // ----------------------------------------------------- - // Assert Object - // ------------- + //========================================================================== + // ========= + // Assert Helper + // ============= /** * Assert that the object is not null. * Modified: board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/util/SimpleSystemUtil.java =================================================================== --- board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/util/SimpleSystemUtil.java 2008-12-27 22:06:42 UTC (rev 1624) +++ board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/util/SimpleSystemUtil.java 2008-12-27 22:09:08 UTC (rev 1625) @@ -7,8 +7,8 @@ //========================================================================== // ========= - // System - // ====== + // Line Separator + // ============== public static String getLineSeparator() { // /- - - - - - - - - - - - - - - - - - - - - - // Because 'CR + LF' caused many trouble! Added: board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/util/SimpleTypeUtil.java =================================================================== --- board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/util/SimpleTypeUtil.java (rev 0) +++ board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/util/SimpleTypeUtil.java 2008-12-27 22:09:08 UTC (rev 1625) @@ -0,0 +1,692 @@ +package jp.sf.pal.board.db.allcommon.util; + +import java.math.BigDecimal; +import java.math.BigInteger; +import java.text.DateFormat; +import java.text.DecimalFormatSymbols; +import java.text.ParseException; +import java.text.SimpleDateFormat; +import java.util.ArrayList; +import java.util.Calendar; +import java.util.Date; +import java.util.List; +import java.util.Locale; +import java.util.Map; +import java.util.StringTokenizer; +import java.util.concurrent.ConcurrentHashMap; + +/** + * {Refers to S2Container's utility and Extends it} + * + * @author DBFlute(AutoGenerator) + */ +public class SimpleTypeUtil { + + //========================================================================== + // ========= + // Convert To + // ========== + // ----------------------------------------------------- + // Boolean + // ------- + public static Boolean toBoolean(Object o) { + if (o == null) { + return null; + } else if (o instanceof Boolean) { + return (Boolean) o; + } else if (o instanceof Number) { + int num = ((Number) o).intValue(); + return Boolean.valueOf(num != 0); + } else if (o instanceof String) { + String s = (String) o; + if ("true".equalsIgnoreCase(s)) { + return Boolean.TRUE; + } else if ("false".equalsIgnoreCase(s)) { + return Boolean.FALSE; + } else if (s.equals("0")) { + return Boolean.FALSE; + } else { + return Boolean.TRUE; + } + } else { + return Boolean.TRUE; + } + } + + // ----------------------------------------------------- + // Integer + // ------- + public static Integer toInteger(Object o) { + return toInteger(o, null); + } + + public static Integer toInteger(Object o, String pattern) { + if (o == null) { + return null; + } else if (o instanceof Integer) { + return (Integer) o; + } else if (o instanceof Number) { + return new Integer(((Number) o).intValue()); + } else if (o instanceof String) { + return toInteger((String) o); + } else if (o instanceof java.util.Date) { + if (pattern != null) { + return new Integer(new SimpleDateFormat(pattern).format(o)); + } + return new Integer((int) ((java.util.Date) o).getTime()); + } else if (o instanceof Boolean) { + return ((Boolean) o).booleanValue() ? new Integer(1) : new Integer( + 0); + } else { + return toInteger(o.toString()); + } + } + + protected static Integer toInteger(String s) { + if (s == null || s.trim().length() == 0) { + return null; + } + return new Integer(normalize(s)); + } + + public static int toPrimitiveInt(Object o) { + return toPrimitiveInt(o, null); + } + + public static int toPrimitiveInt(Object o, String pattern) { + if (o == null) { + return 0; + } else if (o instanceof Number) { + return ((Number) o).intValue(); + } else if (o instanceof String) { + return toPrimitiveInt((String) o); + } else if (o instanceof java.util.Date) { + if (pattern != null) { + return Integer + .parseInt(new SimpleDateFormat(pattern).format(o)); + } + return (int) ((java.util.Date) o).getTime(); + } else if (o instanceof Boolean) { + return ((Boolean) o).booleanValue() ? 1 : 0; + } else { + return toPrimitiveInt(o.toString()); + } + } + + protected static int toPrimitiveInt(String s) { + if (s == null || s.trim().length() == 0) { + return 0; + } + return Integer.parseInt(normalize(s)); + } + + // ----------------------------------------------------- + // BigDecimal + // ---------- + public static BigDecimal toBigDecimal(Object o) { + return toBigDecimal(o, null); + } + + public static BigDecimal toBigDecimal(Object o, String pattern) { + if (o == null) { + return null; + } else if (o instanceof BigDecimal) { + return (BigDecimal) o; + } else if (o instanceof java.util.Date) { + if (pattern != null) { + return new BigDecimal(new SimpleDateFormat(pattern).format(o)); + } + return new BigDecimal(Long.toString(((java.util.Date) o).getTime())); + } else if (o instanceof String) { + String s = (String) o; + if (s == null || s.trim().length() == 0) { + return null; + } + return new BigDecimal(new BigDecimal(s).toPlainString()); + } else { + return new BigDecimal(new BigDecimal(o.toString()).toPlainString()); + } + } + + // ----------------------------------------------------- + // Double + // ------ + public static Double toDouble(Object o) { + return toDouble(o, null); + } + + public static Double toDouble(Object o, String pattern) { + if (o == null) { + return null; + } else if (o instanceof Double) { + return (Double) o; + } else if (o instanceof Number) { + return new Double(((Number) o).doubleValue()); + } else if (o instanceof String) { + return toDouble((String) o); + } else if (o instanceof java.util.Date) { + if (pattern != null) { + return new Double(new SimpleDateFormat(pattern).format(o)); + } + return new Double(((java.util.Date) o).getTime()); + } else { + return toDouble(o.toString()); + } + } + + protected static Double toDouble(String s) { + if (s == null || s.trim().length() == 0) { + return null; + } + return new Double(normalize(s)); + } + + // ----------------------------------------------------- + // Long + // ---- + public static Long toLong(Object o) { + return toLong(o, null); + } + + public static Long toLong(Object o, String pattern) { + if (o == null) { + return null; + } else if (o instanceof Long) { + return (Long) o; + } else if (o instanceof Number) { + return new Long(((Number) o).longValue()); + } else if (o instanceof String) { + return toLong((String) o); + } else if (o instanceof java.util.Date) { + if (pattern != null) { + return new Long(new SimpleDateFormat(pattern).format(o)); + } + return new Long(((java.util.Date) o).getTime()); + } else if (o instanceof Boolean) { + return ((Boolean) o).booleanValue() ? new Long(1) : new Long(0); + } else { + return toLong(o.toString()); + } + } + + protected static Long toLong(String s) { + if (s == null || s.trim().length() == 0) { + return null; + } + return new Long(normalize(s)); + } + + public static long toPrimitiveLong(Object o) { + return toPrimitiveLong(o, null); + } + + public static long toPrimitiveLong(Object o, String pattern) { + if (o == null) { + return 0; + } else if (o instanceof Number) { + return ((Number) o).longValue(); + } else if (o instanceof String) { + return toPrimitiveLong((String) o); + } else if (o instanceof java.util.Date) { + if (pattern != null) { + return Long.parseLong(new SimpleDateFormat(pattern).format(o)); + } + return ((java.util.Date) o).getTime(); + } else if (o instanceof Boolean) { + return ((Boolean) o).booleanValue() ? 1 : 0; + } else { + return toPrimitiveLong(o.toString()); + } + } + + protected static long toPrimitiveLong(String s) { + if (s == null || s.trim().length() == 0) { + return 0; + } + return Long.parseLong(normalize(s)); + } + + // ----------------------------------------------------- + // Float + // ----- + public static Float toFloat(Object o) { + return toFloat(o, null); + } + + public static Float toFloat(Object o, String pattern) { + if (o == null) { + return null; + } else if (o instanceof Float) { + return (Float) o; + } else if (o instanceof Number) { + return new Float(((Number) o).floatValue()); + } else if (o instanceof String) { + return toFloat((String) o); + } else if (o instanceof java.util.Date) { + if (pattern != null) { + return new Float(new SimpleDateFormat(pattern).format(o)); + } + return new Float(((java.util.Date) o).getTime()); + } else { + return toFloat(o.toString()); + } + } + + protected static Float toFloat(String s) { + if (s == null || s.trim().length() == 0) { + return null; + } + return new Float(normalize(s)); + } + + // ----------------------------------------------------- + // Short + // ----- + public static Short toShort(Object o) { + return toShort(o, null); + } + + public static Short toShort(Object o, String pattern) { + if (o == null) { + return null; + } else if (o instanceof Short) { + return (Short) o; + } else if (o instanceof Number) { + return new Short(((Number) o).shortValue()); + } else if (o instanceof String) { + return toShort((String) o); + } else if (o instanceof java.util.Date) { + if (pattern != null) { + return new Short(new SimpleDateFormat(pattern).format(o)); + } + return new Short((short) ((java.util.Date) o).getTime()); + } else if (o instanceof Boolean) { + return ((Boolean) o).booleanValue() ? new Short((short) 1) + : new Short((short) 0); + } else { + return toShort(o.toString()); + } + } + + protected static Short toShort(String s) { + if (s == null || s.trim().length() == 0) { + return null; + } + return new Short(normalize(s)); + } + + // ----------------------------------------------------- + // BigInteger + // ---------- + public static BigInteger toBigInteger(Object o) { + return toBigInteger(o, null); + } + + public static BigInteger toBigInteger(Object o, String pattern) { + if (o == null) { + return null; + } else if (o instanceof BigInteger) { + return (BigInteger) o; + } else { + Long l = toLong(o, pattern); + if (l == null) { + return null; + } + return BigInteger.valueOf(l.longValue()); + } + } + + // ----------------------------------------------------- + // Byte + // ---- + public static Byte toByte(Object o) { + return toByte(o, null); + } + + public static Byte toByte(Object o, String pattern) { + if (o == null) { + return null; + } else if (o instanceof Byte) { + return (Byte) o; + } else if (o instanceof Number) { + return new Byte(((Number) o).byteValue()); + } else if (o instanceof String) { + return toByte((String) o); + } else if (o instanceof java.util.Date) { + if (pattern != null) { + return new Byte(new SimpleDateFormat(pattern).format(o)); + } + return new Byte((byte) ((java.util.Date) o).getTime()); + } else if (o instanceof Boolean) { + return ((Boolean) o).booleanValue() ? new Byte((byte) 1) + : new Byte((byte) 0); + } else { + return toByte(o.toString()); + } + } + + protected static Byte toByte(String s) { + if (s == null || s.trim().length() == 0) { + return null; + } + return new Byte(normalize(s)); + } + + // ----------------------------------------------------- + // Date + // ---- + public static Date toDate(Object o) { + return toDate(o, null); + } + + public static Date toDate(Object o, String pattern) { + if (o == null) { + return null; + } else if (o instanceof String) { + return toDate((String) o, pattern); + } else if (o instanceof Date) { + return (Date) o; + } else if (o instanceof Calendar) { + return ((Calendar) o).getTime(); + } else { + return toDate(o.toString(), pattern); + } + } + + protected static Date toDate(String s, String pattern) { + return toDate(s, pattern, Locale.getDefault()); + } + + protected static Date toDate(String s, String pattern, Locale locale) { + if (s == null || s.trim().length() == 0) { + return null; + } + SimpleDateFormat sdf = getDateFormat(s, pattern, locale); + try { + return sdf.parse(s); + } catch (ParseException e) { + String msg = "Failed to parse the string to date: "; + msg = msg + " string=" + s + " format=" + sdf + " locale=" + locale; + throw new IllegalStateException(msg, e); + } + } + + public static java.sql.Date toSqlDate(Object o) { + return toSqlDate(o, null); + } + + public static java.sql.Date toSqlDate(Object o, String pattern) { + if (o instanceof java.sql.Date) { + return (java.sql.Date) o; + } + java.util.Date date = toDate(o, pattern); + if (date != null) { + return new java.sql.Date(date.getTime()); + } + return null; + } + + // ----------------------------------------------------- + // Number + // ------ + public static Object toNumber(Class type, Object o) { + if (type == Integer.class) { + return toInteger(o); + } else if (type == BigDecimal.class) { + return toBigDecimal(o); + } else if (type == Double.class) { + return toDouble(o); + } else if (type == Long.class) { + return toLong(o); + } else if (type == Float.class) { + return toFloat(o); + } else if (type == Short.class) { + return toShort(o); + } else if (type == BigInteger.class) { + return toBigInteger(o); + } else if (type == Byte.class) { + return toByte(o); + } + return o; + } + + // ----------------------------------------------------- + // Wrapper + // ------- + public static Object toWrapper(Class type, Object o) { + if (type == int.class) { + Integer i = toInteger(o); + if (i != null) { + return i; + } + return new Integer(0); + } else if (type == double.class) { + Double d = toDouble(o); + if (d != null) { + return d; + } + return new Double(0); + } else if (type == long.class) { + Long l = toLong(o); + if (l != null) { + return l; + } + return new Long(0); + } else if (type == float.class) { + Float f = toFloat(o); + if (f != null) { + return f; + } + return new Float(0); + } else if (type == short.class) { + Short s = toShort(o); + if (s != null) { + return s; + } + return new Short((short) 0); + } else if (type == boolean.class) { + Boolean b = toBoolean(o); + if (b != null) { + return b; + } + return Boolean.FALSE; + } else if (type == byte.class) { + Byte b = toByte(o); + if (b != null) { + return b; + } + return new Byte((byte) 0); + } + return o; + } + + //========================================================================== + // ========= + // Normalize + // ========= + protected static String normalize(String s) { + return normalize(s, Locale.getDefault()); + } + + protected static String normalize(String s, Locale locale) { + if (s == null) { + return null; + } + DecimalFormatSymbols symbols = getDecimalFormatSymbols(locale); + char decimalSep = symbols.getDecimalSeparator(); + char groupingSep = symbols.getGroupingSeparator(); + StringBuilder sb = new StringBuilder(20); + for (int i = 0; i < s.length(); ++i) { + char c = s.charAt(i); + if (c == groupingSep) { + continue; + } else if (c == decimalSep) { + c = '.'; + } + sb.append(c); + } + return sb.toString(); + } + + //========================================================================== + // ========= + // Assist Helper + // ============= + + // ----------------------------------------------------- + // DateFormat + // ---------- + protected static SimpleDateFormat getDateFormat(String s, String pattern, + Locale locale) { + if (pattern != null) { + return new SimpleDateFormat(pattern); + } + return getDateFormat(s, locale); + } + + protected static SimpleDateFormat getDateFormat(String s, Locale locale) { + String pattern = getDateFormatPattern(locale); + String shortPattern = removeDateDelimiter(pattern); + String delimitor = findDateDelimiter(s); + if (delimitor == null) { + if (s.length() == shortPattern.length()) { + return new SimpleDateFormat(shortPattern); + } + if (s.length() == shortPattern.length() + 2) { + return new SimpleDateFormat(replace(shortPattern, "yy", "yyyy")); + } + } else { + String[] array = split(s, delimitor); + for (int i = 0; i < array.length; ++i) { + if (array[i].length() == 4) { + pattern = replace(pattern, "yy", "yyyy"); + break; + } + } + return new SimpleDateFormat(pattern); + } + return new SimpleDateFormat(); + } + + protected static String getDateFormatPattern(Locale locale) { + SimpleDateFormat df = (SimpleDateFormat) DateFormat.getDateInstance( + DateFormat.SHORT, locale); + String pattern = df.toPattern(); + int index = pattern.indexOf(' '); + if (index > 0) { + pattern = pattern.substring(0, index); + } + if (pattern.indexOf("MM") < 0) { + pattern = replace(pattern, "M", "MM"); + } + if (pattern.indexOf("dd") < 0) { + pattern = replace(pattern, "d", "dd"); + } + return pattern; + } + + protected static String removeDateDelimiter(String pattern) { + StringBuilder sb = new StringBuilder(); + for (int i = 0; i < pattern.length(); ++i) { + char c = pattern.charAt(i); + if (c == 'y' || c == 'M' || c == 'd') { + sb.append(c); + } + } + return sb.toString(); + } + + protected static String findDateDelimiter(String value) { + for (int i = 0; i < value.length(); ++i) { + char c = value.charAt(i); + if (Character.isDigit(c)) { + continue; + } + return Character.toString(c); + } + return null; + } + + // ----------------------------------------------------- + // DecimalFormatSymbols + // -------------------- + protected static Map symbolsCache = new ConcurrentHashMap(); + + protected static DecimalFormatSymbols getDecimalFormatSymbols() { + return getDecimalFormatSymbols(Locale.getDefault()); + } + + protected static DecimalFormatSymbols getDecimalFormatSymbols(Locale locale) { + DecimalFormatSymbols symbols = (DecimalFormatSymbols) symbolsCache + .get(locale); + if (symbols == null) { + symbols = new DecimalFormatSymbols(locale); + symbolsCache.put(locale, symbols); + } + return symbols; + } + + // ----------------------------------------------------- + // String + // ------ + protected static String replace(String text, String fromText, String toText) { + if (text == null || fromText == null || toText == null) { + return null; + } + StringBuilder sb = new StringBuilder(); + int pos = 0; + int pos2 = 0; + do { + pos = text.indexOf(fromText, pos2); + if (pos == 0) { + sb.append(toText); + pos2 = fromText.length(); + } else if (pos > 0) { + sb.append(text.substring(pos2, pos)); + sb.append(toText); + pos2 = pos + fromText.length(); + } else { + sb.append(text.substring(pos2)); + return sb.toString(); + } + } while (true); + } + + protected static final String[] EMPTY_STRINGS = new String[0]; + + protected static String[] split(final String str, final String delimiter) { + if (str == null || str.trim().length() == 0) { + return EMPTY_STRINGS; + } + final List list = new ArrayList(); + final StringTokenizer st = new StringTokenizer(str, delimiter); + while (st.hasMoreElements()) { + list.add(st.nextToken()); + } + return (String[]) list.toArray(new String[list.size()]); + } + + //========================================================================== + // ========= + // Assert Helper + // ============= + /** + * Assert that the object is not null. + * + * @param variableName Variable name. (NotNull) + * @param value Value. (NotNull) + * @exception IllegalArgumentException + */ + protected static void assertObjectNotNull(String variableName, Object value) { + if (variableName == null) { + String msg = "The value should not be null: variableName=" + + variableName + " value=" + value; + throw new IllegalArgumentException(msg); + } + if (value == null) { + String msg = "The value should not be null: variableName=" + + variableName; + throw new IllegalArgumentException(msg); + } + } +} Property changes on: board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/util/SimpleTypeUtil.java ___________________________________________________________________ Name: svn:eol-style + native Modified: board/trunk/src/main/java/jp/sf/pal/board/db/bsbhv/BsAttachmentBhv.java =================================================================== --- board/trunk/src/main/java/jp/sf/pal/board/db/bsbhv/BsAttachmentBhv.java 2008-12-27 22:06:42 UTC (rev 1624) +++ board/trunk/src/main/java/jp/sf/pal/board/db/bsbhv/BsAttachmentBhv.java 2008-12-27 22:09:08 UTC (rev 1625) @@ -1,9 +1,8 @@ package jp.sf.pal.board.db.bsbhv; import java.util.List; +import java.util.Map; -import jp.sf.pal.board.db.allcommon.DaoReadable; -import jp.sf.pal.board.db.allcommon.DaoWritable; import jp.sf.pal.board.db.allcommon.Entity; import jp.sf.pal.board.db.allcommon.bhv.load.LoadReferrerOption; import jp.sf.pal.board.db.allcommon.bhv.setup.ConditionBeanSetupper; @@ -20,12 +19,11 @@ import jp.sf.pal.board.db.cbean.AttachmentCB; import jp.sf.pal.board.db.cbean.MessageAttachmentCB; import jp.sf.pal.board.db.exbhv.MessageAttachmentBhv; -import jp.sf.pal.board.db.exdao.AttachmentDao; import jp.sf.pal.board.db.exentity.Attachment; import jp.sf.pal.board.db.exentity.MessageAttachment; /** - * The behavior of ATTACHMENT. + * The behavior of ATTACHMENT that the type is TABLE.
* *
  * [primary-key]
@@ -70,12 +68,6 @@
 
     //==========================================================================
     // =========
-    // Attribute
-    // =========
-    protected AttachmentDao _dao;
-
-    //==========================================================================
-    // =========
     // Table name
     // ==========
     /** @return The name on database of table. (NotNull) */
@@ -87,39 +79,18 @@
     // =========
     // DBMeta
     // ======
-    /** @return The meta data of the database. (NotNull) */
+    /** @return The instance of DBMeta. (NotNull) */
     public DBMeta getDBMeta() {
         return AttachmentDbm.getInstance();
     }
 
-    /** @return The meta data of the database as my table type. (NotNull) */
+    /** @return The instance of DBMeta as my table type. (NotNull) */
     public AttachmentDbm getMyDBMeta() {
         return AttachmentDbm.getInstance();
     }
 
     //==========================================================================
     // =========
-    // Dao Accessor
-    // ============
-    public AttachmentDao getMyDao() {
-        return _dao;
-    }
-
-    public void setMyDao(AttachmentDao dao) {
-        assertObjectNotNull("dao", dao);
-        _dao = dao;
-    }
-
-    public DaoReadable getDaoReadable() {
-        return getMyDao();
-    }
-
-    public DaoWritable getDaoWritable() {
-        return getMyDao();
-    }
-
-    //==========================================================================
-    // =========
     // New Instance
     // ============
     public Entity newEntity() {
@@ -149,7 +120,7 @@
      * @return The selected count.
      */
     public int selectCount(AttachmentCB cb) {
-        assertConditionBeanNotNull(cb);
+        assertCBNotNull(cb);
         return delegateSelectCount(cb);
     }
 
@@ -226,7 +197,7 @@
      * @return The result bean of selected list. (NotNull)
      */
     public ListResultBean selectList(AttachmentCB cb) {
-        assertConditionBeanNotNull(cb);
+        assertCBNotNull(cb);
         return new ResultBeanBuilder(getTableDbName())
                 .buildListResultBean(cb, delegateSelectList(cb));
     }
@@ -242,7 +213,7 @@
      * @return The result bean of selected page. (NotNull)
      */
     public PagingResultBean selectPage(final AttachmentCB cb) {
-        assertConditionBeanNotNull(cb);
+        assertCBNotNull(cb);
         final PagingInvoker invoker = new PagingInvoker(
                 getTableDbName());
         final PagingHandler handler = new PagingHandler() {
@@ -263,6 +234,32 @@
 
     //==========================================================================
     // =========
+    // Scalar Select
+    // =============
+    /**
+     * Select the scalar value derived by a function. 
Call a function + * method after this method called like as follows: + * + *
+     * attachmentBhv.scalarSelect(Date.class).max(new ScalarQuery(AttachmentCB cb) {
+     *     cb.specify().columnXxxDatetime(); // the required specification of target column
+     *     cb.query().setXxxName_PrefixSearch("S"); // query as you like it
+     * });
+     * 
+ * + * @param The type of result. + * @param resultType The type of result. (NotNull) + * @return The scalar value derived by a function. (Nullable) + */ + public SLFunction scalarSelect( + Class resultType) { + AttachmentCB cb = newMyConditionBean(); + cb.xsetupForScalarSelect(); + return new SLFunction(cb, resultType); + } + + //========================================================================== + // ========= // Various Select // ============== /** @@ -272,8 +269,8 @@ * @param valueLabelSetupper The setupper of value-label. (NotNull) * @return The list of value-label. (NotNull) */ - public List> selectValueLabelList( - AttachmentCB cb, ValueLabelSetupper valueLabelSetupper) { + public List> selectValueLabelList(AttachmentCB cb, + ValueLabelSetupper valueLabelSetupper) { return createValueLabelList(selectList(cb), valueLabelSetupper); } @@ -377,8 +374,8 @@ //========================================================================== // ========= - // Pullout Foreign - // =============== + // Pull out Foreign + // ================ //========================================================================== // ========= @@ -560,11 +557,11 @@ */ public int queryUpdate(Attachment attachment, AttachmentCB cb) { assertObjectNotNull("attachment", attachment); - assertConditionBeanNotNull(cb); + assertCBNotNull(cb); setupCommonColumnOfUpdateIfNeeds(attachment); filterEntityOfUpdate(attachment); assertEntityOfUpdate(attachment); - return getMyDao().updateByQuery(cb, attachment); + return invoke(createQueryUpdateEntityCBCommand(attachment, cb)); } /** @@ -574,8 +571,8 @@ * @return The deleted count. */ public int queryDelete(AttachmentCB cb) { - assertConditionBeanNotNull(cb); - return getMyDao().deleteByQuery(cb); + assertCBNotNull(cb); + return invoke(createQueryDeleteCBCommand(cb)); } //========================================================================== @@ -587,19 +584,27 @@ // ========= // Delegate Method // =============== + // [Behavior Command] // ----------------------------------------------------- // Select // ------ protected int delegateSelectCount(AttachmentCB cb) { - assertConditionBeanNotNull(cb); - return getMyDao().selectCount(cb); + return invoke(createSelectCountCBCommand(cb)); } + protected int doCallReadCount(ConditionBean cb) { + return delegateSelectCount((AttachmentCB) cb); + } + protected List delegateSelectList(AttachmentCB cb) { - assertConditionBeanNotNull(cb); - return getMyDao().selectList(cb); + return invoke(createSelectListCBCommand(cb, Attachment.class)); } + @SuppressWarnings("unchecked") + protected List doCallReadList(ConditionBean cb) { + return (List) delegateSelectList((AttachmentCB) cb); + } + // ----------------------------------------------------- // Update // ------ @@ -607,38 +612,71 @@ if (!processBeforeInsert(e)) { return 1; } - return getMyDao().insert(e); + return invoke(createInsertEntityCommand(e)); } + protected int doCallCreate(Entity entity) { + return delegateInsert(downcast(entity)); + } + protected int delegateUpdate(Attachment e) { if (!processBeforeUpdate(e)) { return 1; } - return getMyDao().updateModifiedOnly(e); + return invoke(createUpdateEntityCommand(e)); } + protected int doCallModify(Entity entity) { + return delegateUpdate(downcast(entity)); + } + protected int delegateDelete(Attachment e) { if (!processBeforeDelete(e)) { return 1; } - return getMyDao().delete(e); + return invoke(createDeleteEntityCommand(e)); } + protected int doCallRemove(Entity entity) { + return delegateDelete(downcast(entity)); + } + protected int[] delegateInsertList(List ls) { - assertObjectNotNull("attachmentList", ls); - return getMyDao().insertList(helpFilterBeforeInsertInternally(ls)); + if (ls.isEmpty()) { + return new int[] {}; + } + return invoke(createBatchInsertEntityCommand(helpFilterBeforeInsertInternally(ls))); } + @SuppressWarnings("unchecked") + protected int[] doCreateList(List ls) { + return delegateInsertList((List) ls); + } + protected int[] delegateUpdateList(List ls) { - assertObjectNotNull("attachmentList", ls); - return getMyDao().updateList(helpFilterBeforeUpdateInternally(ls)); + if (ls.isEmpty()) { + return new int[] {}; + } + return invoke(createBatchUpdateEntityCommand(helpFilterBeforeUpdateInternally(ls))); } + @SuppressWarnings("unchecked") + protected int[] doModifyList(List ls) { + return delegateUpdateList((List) ls); + } + protected int[] delegateDeleteList(List ls) { - assertObjectNotNull("attachmentList", ls); - return getMyDao().deleteList(helpFilterBeforeDeleteInternally(ls)); + if (ls.isEmpty()) { + return new int[] {}; + } + return invoke(createBatchDeleteEntityCommand(helpFilterBeforeDeleteInternally(ls))); } + @SuppressWarnings("unchecked") + protected int[] doRemoveList(List ls) { + return delegateDeleteList((List) ls); + } + //========================================================================== // ========= // Optimistic Lock Info Modified: board/trunk/src/main/java/jp/sf/pal/board/db/bsbhv/BsCategoryAccessBhv.java =================================================================== --- board/trunk/src/main/java/jp/sf/pal/board/db/bsbhv/BsCategoryAccessBhv.java 2008-12-27 22:06:42 UTC (rev 1624) +++ board/trunk/src/main/java/jp/sf/pal/board/db/bsbhv/BsCategoryAccessBhv.java 2008-12-27 22:09:08 UTC (rev 1625) @@ -1,9 +1,8 @@ package jp.sf.pal.board.db.bsbhv; import java.util.List; +import java.util.Map; -import jp.sf.pal.board.db.allcommon.DaoReadable; -import jp.sf.pal.board.db.allcommon.DaoWritable; import jp.sf.pal.board.db.allcommon.Entity; import jp.sf.pal.board.db.allcommon.bhv.setup.ValueLabelSetupper; import jp.sf.pal.board.db.allcommon.cbean.ConditionBean; @@ -16,12 +15,11 @@ import jp.sf.pal.board.db.allcommon.dbmeta.DBMeta; import jp.sf.pal.board.db.bsentity.dbmeta.CategoryAccessDbm; import jp.sf.pal.board.db.cbean.CategoryAccessCB; -import jp.sf.pal.board.db.exdao.CategoryAccessDao; import jp.sf.pal.board.db.exentity.Category; import jp.sf.pal.board.db.exentity.CategoryAccess; /** - * The behavior of CATEGORY_ACCESS. + * The behavior of CATEGORY_ACCESS that the type is TABLE.
* *
  * [primary-key]
@@ -66,12 +64,6 @@
 
     //==========================================================================
     // =========
-    // Attribute
-    // =========
-    protected CategoryAccessDao _dao;
-
-    //==========================================================================
-    // =========
     // Table name
     // ==========
     /** @return The name on database of table. (NotNull) */
@@ -83,39 +75,18 @@
     // =========
     // DBMeta
     // ======
-    /** @return The meta data of the database. (NotNull) */
+    /** @return The instance of DBMeta. (NotNull) */
     public DBMeta getDBMeta() {
         return CategoryAccessDbm.getInstance();
     }
 
-    /** @return The meta data of the database as my table type. (NotNull) */
+    /** @return The instance of DBMeta as my table type. (NotNull) */
     public CategoryAccessDbm getMyDBMeta() {
         return CategoryAccessDbm.getInstance();
     }
 
     //==========================================================================
     // =========
-    // Dao Accessor
-    // ============
-    public CategoryAccessDao getMyDao() {
-        return _dao;
-    }
-
-    public void setMyDao(CategoryAccessDao dao) {
-        assertObjectNotNull("dao", dao);
-        _dao = dao;
-    }
-
-    public DaoReadable getDaoReadable() {
-        return getMyDao();
-    }
-
-    public DaoWritable getDaoWritable() {
-        return getMyDao();
-    }
-
-    //==========================================================================
-    // =========
     // New Instance
     // ============
     public Entity newEntity() {
@@ -145,7 +116,7 @@
      * @return The selected count.
      */
     public int selectCount(CategoryAccessCB cb) {
-        assertConditionBeanNotNull(cb);
+        assertCBNotNull(cb);
         return delegateSelectCount(cb);
     }
 
@@ -225,7 +196,7 @@
      * @return The result bean of selected list. (NotNull)
      */
     public ListResultBean selectList(CategoryAccessCB cb) {
-        assertConditionBeanNotNull(cb);
+        assertCBNotNull(cb);
         return new ResultBeanBuilder(getTableDbName())
                 .buildListResultBean(cb, delegateSelectList(cb));
     }
@@ -241,7 +212,7 @@
      * @return The result bean of selected page. (NotNull)
      */
     public PagingResultBean selectPage(final CategoryAccessCB cb) {
-        assertConditionBeanNotNull(cb);
+        assertCBNotNull(cb);
         final PagingInvoker invoker = new PagingInvoker(
                 getTableDbName());
         final PagingHandler handler = new PagingHandler() {
@@ -262,6 +233,32 @@
 
     //==========================================================================
     // =========
+    // Scalar Select
+    // =============
+    /**
+     * Select the scalar value derived by a function. 
Call a function + * method after this method called like as follows: + * + *
+     * categoryAccessBhv.scalarSelect(Date.class).max(new ScalarQuery(CategoryAccessCB cb) {
+     *     cb.specify().columnXxxDatetime(); // the required specification of target column
+     *     cb.query().setXxxName_PrefixSearch("S"); // query as you like it
+     * });
+     * 
+ * + * @param The type of result. + * @param resultType The type of result. (NotNull) + * @return The scalar value derived by a function. (Nullable) + */ + public SLFunction scalarSelect( + Class resultType) { + CategoryAccessCB cb = newMyConditionBean(); + cb.xsetupForScalarSelect(); + return new SLFunction(cb, resultType); + } + + //========================================================================== + // ========= // Various Select // ============== /** @@ -271,8 +268,7 @@ * @param valueLabelSetupper The setupper of value-label. (NotNull) * @return The list of value-label. (NotNull) */ - public List> selectValueLabelList( - CategoryAccessCB cb, + public List> selectValueLabelList(CategoryAccessCB cb, ValueLabelSetupper valueLabelSetupper) { return createValueLabelList(selectList(cb), valueLabelSetupper); } @@ -284,8 +280,8 @@ //========================================================================== // ========= - // Pullout Foreign - // =============== + // Pull out Foreign + // ================ /** * Pull out the list of foreign table 'Category'. * @@ -604,11 +600,11 @@ */ public int queryUpdate(CategoryAccess categoryAccess, CategoryAccessCB cb) { assertObjectNotNull("categoryAccess", categoryAccess); - assertConditionBeanNotNull(cb); + assertCBNotNull(cb); setupCommonColumnOfUpdateIfNeeds(categoryAccess); filterEntityOfUpdate(categoryAccess); assertEntityOfUpdate(categoryAccess); - return getMyDao().updateByQuery(cb, categoryAccess); + return invoke(createQueryUpdateEntityCBCommand(categoryAccess, cb)); } /** @@ -618,8 +614,8 @@ * @return The deleted count. */ public int queryDelete(CategoryAccessCB cb) { - assertConditionBeanNotNull(cb); - return getMyDao().deleteByQuery(cb); + assertCBNotNull(cb); + return invoke(createQueryDeleteCBCommand(cb)); } //========================================================================== @@ -631,19 +627,27 @@ // ========= // Delegate Method // =============== + // [Behavior Command] // ----------------------------------------------------- // Select // ------ protected int delegateSelectCount(CategoryAccessCB cb) { - assertConditionBeanNotNull(cb); - return getMyDao().selectCount(cb); + return invoke(createSelectCountCBCommand(cb)); } + protected int doCallReadCount(ConditionBean cb) { + return delegateSelectCount((CategoryAccessCB) cb); + } + protected List delegateSelectList(CategoryAccessCB cb) { - assertConditionBeanNotNull(cb); - return getMyDao().selectList(cb); + return invoke(createSelectListCBCommand(cb, CategoryAccess.class)); } + @SuppressWarnings("unchecked") + protected List doCallReadList(ConditionBean cb) { + return (List) delegateSelectList((CategoryAccessCB) cb); + } + // ----------------------------------------------------- // Update // ------ @@ -651,62 +655,97 @@ if (!processBeforeInsert(e)) { return 1; } - return getMyDao().insert(e); + return invoke(createInsertEntityCommand(e)); } + protected int doCallCreate(Entity entity) { + return delegateInsert(downcast(entity)); + } + protected int delegateUpdate(CategoryAccess e) { if (!processBeforeUpdate(e)) { return 1; } - return getMyDao().updateModifiedOnly(e); + return invoke(createUpdateEntityCommand(e)); } + protected int doCallModify(Entity entity) { + return delegateUpdate(downcast(entity)); + } + protected int delegateUpdateNonstrict(CategoryAccess e) { if (!processBeforeUpdate(e)) { return 1; } - return getMyDao().updateNonstrictModifiedOnly(e); + return invoke(createUpdateNonstrictEntityCommand(e)); } protected int delegateDelete(CategoryAccess e) { if (!processBeforeDelete(e)) { return 1; } - return getMyDao().delete(e); + return invoke(createDeleteEntityCommand(e)); } + protected int doCallRemove(Entity entity) { + return delegateDelete(downcast(entity)); + } + protected int delegateDeleteNonstrict(CategoryAccess e) { if (!processBeforeDelete(e)) { return 1; } - return getMyDao().deleteNonstrict(e); + return invoke(createDeleteNonstrictEntityCommand(e)); } protected int[] delegateInsertList(List ls) { - assertObjectNotNull("categoryAccessList", ls); - return getMyDao().insertList(helpFilterBeforeInsertInternally(ls)); + if (ls.isEmpty()) { + return new int[] {}; + } + return invoke(createBatchInsertEntityCommand(helpFilterBeforeInsertInternally(ls))); } + @SuppressWarnings("unchecked") + protected int[] doCreateList(List ls) { + return delegateInsertList((List) ls); + } + protected int[] delegateUpdateList(List ls) { - assertObjectNotNull("categoryAccessList", ls); - return getMyDao().updateList(helpFilterBeforeUpdateInternally(ls)); + if (ls.isEmpty()) { + return new int[] {}; + } + return invoke(createBatchUpdateEntityCommand(helpFilterBeforeUpdateInternally(ls))); } + @SuppressWarnings("unchecked") + protected int[] doModifyList(List ls) { + return delegateUpdateList((List) ls); + } + protected int[] delegateUpdateListNonstrict(List ls) { - assertObjectNotNull("categoryAccessList", ls); - return getMyDao().updateListNonstrict( - helpFilterBeforeUpdateInternally(ls)); + if (ls.isEmpty()) { + return new int[] {}; + } + return invoke(createBatchUpdateNonstrictEntityCommand(helpFilterBeforeUpdateInternally(ls))); } protected int[] delegateDeleteList(List ls) { - assertObjectNotNull("categoryAccessList", ls); - return getMyDao().deleteList(helpFilterBeforeDeleteInternally(ls)); + if (ls.isEmpty()) { + return new int[] {}; + } + return invoke(createBatchDeleteEntityCommand(helpFilterBeforeDeleteInternally(ls))); } + @SuppressWarnings("unchecked") + protected int[] doRemoveList(List ls) { + return delegateDeleteList((List) ls); + } + protected int[] delegateDeleteListNonstrict(List ls) { - assertObjectNotNull("categoryAccessList", ls); - return getMyDao().deleteListNonstrict( - helpFilterBeforeDeleteInternally(ls)); + if (ls.isEmpty()) { + return new int[] {}; + } + return invoke(createBatchDeleteNonstrictEntityCommand(helpFilterBeforeDeleteInternally(ls))); } //========================================================================== Modified: board/trunk/src/main/java/jp/sf/pal/board/db/bsbhv/BsCategoryBhv.java =================================================================== --- board/trunk/src/main/java/jp/sf/pal/board/db/bsbhv/BsCategoryBhv.java 2008-12-27 22:06:42 UTC (rev 1624) +++ board/trunk/src/main/java/jp/sf/pal/board/db/bsbhv/BsCategoryBhv.java 2008-12-27 22:09:08 UTC (rev 1625) @@ -1,9 +1,8 @@ package jp.sf.pal.board.db.bsbhv; import java.util.List; +import java.util.Map; -import jp.sf.pal.board.db.allcommon.DaoReadable; -import jp.sf.pal.board.db.allcommon.DaoWritable; import jp.sf.pal.board.db.allcommon.Entity; import jp.sf.pal.board.db.allcommon.bhv.load.LoadReferrerOption; import jp.sf.pal.board.db.allcommon.bhv.setup.ConditionBeanSetupper; @@ -22,13 +21,12 @@ import jp.sf.pal.board.db.cbean.MessageCB; import jp.sf.pal.board.db.exbhv.CategoryAccessBhv; import jp.sf.pal.board.db.exbhv.MessageBhv; -import jp.sf.pal.board.db.exdao.CategoryDao; import jp.sf.pal.board.db.exentity.Category; import jp.sf.pal.board.db.exentity.CategoryAccess; import jp.sf.pal.board.db.exentity.Message; /** - * The behavior of CATEGORY. + * The behavior of CATEGORY that the type is TABLE.
* *
  * [primary-key]
@@ -73,12 +71,6 @@
 
     //==========================================================================
     // =========
-    // Attribute
-    // =========
-    protected CategoryDao _dao;
-
-    //==========================================================================
-    // =========
     // Table name
     // ==========
     /** @return The name on database of table. (NotNull) */
@@ -90,39 +82,18 @@
     // =========
     // DBMeta
     // ======
-    /** @return The meta data of the database. (NotNull) */
+    /** @return The instance of DBMeta. (NotNull) */
     public DBMeta getDBMeta() {
         return CategoryDbm.getInstance();
     }
 
-    /** @return The meta data of the database as my table type. (NotNull) */
+    /** @return The instance of DBMeta as my table type. (NotNull) */
     public CategoryDbm getMyDBMeta() {
         return CategoryDbm.getInstance();
     }
 
     //==========================================================================
     // =========
-    // Dao Accessor
-    // ============
-    public CategoryDao getMyDao() {
-        return _dao;
-    }
-
-    public void setMyDao(CategoryDao dao) {
-        assertObjectNotNull("dao", dao);
-        _dao = dao;
-    }
-
-    public DaoReadable getDaoReadable() {
-        return getMyDao();
-    }
-
-    public DaoWritable getDaoWritable() {
-        return getMyDao();
-    }
-
-    //==========================================================================
-    // =========
     // New Instance
     // ============
     public Entity newEntity() {
@@ -152,7 +123,7 @@
      * @return The selected count.
      */
     public int selectCount(CategoryCB cb) {
-        assertConditionBeanNotNull(cb);
+        assertCBNotNull(cb);
         return delegateSelectCount(cb);
     }
 
@@ -229,7 +200,7 @@
      * @return The result bean of selected list. (NotNull)
      */
     public ListResultBean selectList(CategoryCB cb) {
-        assertConditionBeanNotNull(cb);
+        assertCBNotNull(cb);
         return new ResultBeanBuilder(getTableDbName())
                 .buildListResultBean(cb, delegateSelectList(cb));
     }
@@ -245,7 +216,7 @@
      * @return The result bean of selected page. (NotNull)
      */
     public PagingResultBean selectPage(final CategoryCB cb) {
-        assertConditionBeanNotNull(cb);
+        assertCBNotNull(cb);
         final PagingInvoker invoker = new PagingInvoker(
                 getTableDbName());
         final PagingHandler handler = new PagingHandler() {
@@ -266,6 +237,32 @@
 
     //==========================================================================
     // =========
+    // Scalar Select
+    // =============
+    /**
+     * Select the scalar value derived by a function. 
Call a function + * method after this method called like as follows: + * + *
+     * categoryBhv.scalarSelect(Date.class).max(new ScalarQuery(CategoryCB cb) {
+     *     cb.specify().columnXxxDatetime(); // the required specification of target column
+     *     cb.query().setXxxName_PrefixSearch("S"); // query as you like it
+     * });
+     * 
+ * + * @param The type of result. + * @param resultType The type of result. (NotNull) + * @return The scalar value derived by a function. (Nullable) + */ + public SLFunction scalarSelect( + Class resultType) { + CategoryCB cb = newMyConditionBean(); + cb.xsetupForScalarSelect(); + return new SLFunction(cb, resultType); + } + + //========================================================================== + // ========= // Various Select // ============== /** @@ -275,8 +272,8 @@ * @param valueLabelSetupper The setupper of value-label. (NotNull) * @return The list of value-label. (NotNull) */ - public List> selectValueLabelList( - CategoryCB cb, ValueLabelSetupper valueLabelSetupper) { + public List> selectValueLabelList(CategoryCB cb, + ValueLabelSetupper valueLabelSetupper) { return createValueLabelList(selectList(cb), valueLabelSetupper); } @@ -469,8 +466,8 @@ //========================================================================== // ========= - // Pullout Foreign - // =============== + // Pull out Foreign + // ================ //========================================================================== // ========= @@ -766,11 +763,11 @@ */ public int queryUpdate(Category category, CategoryCB cb) { assertObjectNotNull("category", category); - assertConditionBeanNotNull(cb); + assertCBNotNull(cb); setupCommonColumnOfUpdateIfNeeds(category); filterEntityOfUpdate(category); assertEntityOfUpdate(category); - return getMyDao().updateByQuery(cb, category); + return invoke(createQueryUpdateEntityCBCommand(category, cb)); } /** @@ -780,8 +777,8 @@ * @return The deleted count. */ public int queryDelete(CategoryCB cb) { - assertConditionBeanNotNull(cb); - return getMyDao().deleteByQuery(cb); + assertCBNotNull(cb); + return invoke(createQueryDeleteCBCommand(cb)); } //========================================================================== @@ -793,19 +790,27 @@ // ========= // Delegate Method // =============== + // [Behavior Command] // ----------------------------------------------------- // Select // ------ protected int delegateSelectCount(CategoryCB cb) { - assertConditionBeanNotNull(cb); - return getMyDao().selectCount(cb); + return invoke(createSelectCountCBCommand(cb)); } + protected int doCallReadCount(ConditionBean cb) { + return delegateSelectCount((CategoryCB) cb); + } + protected List delegateSelectList(CategoryCB cb) { - assertConditionBeanNotNull(cb); - return getMyDao().selectList(cb); + return invoke(createSelectListCBCommand(cb, Category.class)); } + @SuppressWarnings("unchecked") + protected List doCallReadList(ConditionBean cb) { + return (List) delegateSelectList((CategoryCB) cb); + } + // ----------------------------------------------------- // Update // ------ @@ -813,62 +818,97 @@ if (!processBeforeInsert(e)) { return 1; } - return getMyDao().insert(e); + return invoke(createInsertEntityCommand(e)); } + protected int doCallCreate(Entity entity) { + return delegateInsert(downcast(entity)); + } + protected int delegateUpdate(Category e) { if (!processBeforeUpdate(e)) { return 1; } - return getMyDao().updateModifiedOnly(e); + return invoke(createUpdateEntityCommand(e)); } + protected int doCallModify(Entity entity) { + return delegateUpdate(downcast(entity)); + } + protected int delegateUpdateNonstrict(Category e) { if (!processBeforeUpdate(e)) { return 1; } - return getMyDao().updateNonstrictModifiedOnly(e); + return invoke(createUpdateNonstrictEntityCommand(e)); } protected int delegateDelete(Category e) { if (!processBeforeDelete(e)) { return 1; } - return getMyDao().delete(e); + return invoke(createDeleteEntityCommand(e)); } + protected int doCallRemove(Entity entity) { + return delegateDelete(downcast(entity)); + } + protected int delegateDeleteNonstrict(Category e) { if (!processBeforeDelete(e)) { return 1; } - return getMyDao().deleteNonstrict(e); + return invoke(createDeleteNonstrictEntityCommand(e)); } protected int[] delegateInsertList(List ls) { - assertObjectNotNull("categoryList", ls); - return getMyDao().insertList(helpFilterBeforeInsertInternally(ls)); + if (ls.isEmpty()) { + return new int[] {}; + } + return invoke(createBatchInsertEntityCommand(helpFilterBeforeInsertInternally(ls))); } + @SuppressWarnings("unchecked") + protected int[] doCreateList(List ls) { + return delegateInsertList((List) ls); + } + protected int[] delegateUpdateList(List ls) { - assertObjectNotNull("categoryList", ls); - return getMyDao().updateList(helpFilterBeforeUpdateInternally(ls)); + if (ls.isEmpty()) { + return new int[] {}; + } + return invoke(createBatchUpdateEntityCommand(helpFilterBeforeUpdateInternally(ls))); } + @SuppressWarnings("unchecked") + protected int[] doModifyList(List ls) { + return delegateUpdateList((List) ls); + } + protected int[] delegateUpdateListNonstrict(List ls) { - assertObjectNotNull("categoryList", ls); - return getMyDao().updateListNonstrict( - helpFilterBeforeUpdateInternally(ls)); + if (ls.isEmpty()) { + return new int[] {}; + } + return invoke(createBatchUpdateNonstrictEntityCommand(helpFilterBeforeUpdateInternally(ls))); } protected int[] delegateDeleteList(List ls) { - assertObjectNotNull("categoryList", ls); - return getMyDao().deleteList(helpFilterBeforeDeleteInternally(ls)); + if (ls.isEmpty()) { + return new int[] {}; + } + return invoke(createBatchDeleteEntityCommand(helpFilterBeforeDeleteInternally(ls))); } + @SuppressWarnings("unchecked") + protected int[] doRemoveList(List ls) { + return delegateDeleteList((List) ls); + } + protected int[] delegateDeleteListNonstrict(List ls) { - assertObjectNotNull("categoryList", ls); - return getMyDao().deleteListNonstrict( - helpFilterBeforeDeleteInternally(ls)); + if (ls.isEmpty()) { + return new int[] {}; + } + return invoke(createBatchDeleteNonstrictEntityCommand(helpFilterBeforeDeleteInternally(ls))); } //========================================================================== Modified: board/trunk/src/main/java/jp/sf/pal/board/db/bsbhv/BsGroupInfoBhv.java =================================================================== --- board/trunk/src/main/java/jp/sf/pal/board/db/bsbhv/BsGroupInfoBhv.java 2008-12-27 22:06:42 UTC (rev 1624) +++ board/trunk/src/main/java/jp/sf/pal/board/db/bsbhv/BsGroupInfoBhv.java 2008-12-27 22:09:08 UTC (rev 1625) @@ -1,9 +1,8 @@ package jp.sf.pal.board.db.bsbhv; import java.util.List; +import java.util.Map; -import jp.sf.pal.board.db.allcommon.DaoReadable; -import jp.sf.pal.board.db.allcommon.DaoWritable; import jp.sf.pal.board.db.allcommon.Entity; import jp.sf.pal.board.db.allcommon.bhv.load.LoadReferrerOption; import jp.sf.pal.board.db.allcommon.bhv.setup.ConditionBeanSetupper; @@ -22,13 +21,12 @@ import jp.sf.pal.board.db.cbean.UserInfoCB; import jp.sf.pal.board.db.exbhv.GroupMappingBhv; import jp.sf.pal.board.db.exbhv.UserInfoBhv; -import jp.sf.pal.board.db.exdao.GroupInfoDao; import jp.sf.pal.board.db.exentity.GroupInfo; import jp.sf.pal.board.db.exentity.GroupMapping; import jp.sf.pal.board.db.exentity.UserInfo; /** - * The behavior of GROUP_INFO. + * The behavior of GROUP_INFO that the type is TABLE.
* *
  * [primary-key]
@@ -73,12 +71,6 @@
 
     //==========================================================================
     // =========
-    // Attribute
-    // =========
-    protected GroupInfoDao _dao;
-
-    //==========================================================================
-    // =========
     // Table name
     // ==========
     /** @return The name on database of table. (NotNull) */
@@ -90,39 +82,18 @@
     // =========
     // DBMeta
     // ======
-    /** @return The meta data of the database. (NotNull) */
+    /** @return The instance of DBMeta. (NotNull) */
     public DBMeta getDBMeta() {
         return GroupInfoDbm.getInstance();
     }
 
-    /** @return The meta data of the database as my table type. (NotNull) */
+    /** @return The instance of DBMeta as my table type. (NotNull) */
     public GroupInfoDbm getMyDBMeta() {
         return GroupInfoDbm.getInstance();
     }
 
     //==========================================================================
     // =========
-    // Dao Accessor
-    // ============
-    public GroupInfoDao getMyDao() {
-        return _dao;
-    }
-
-    public void setMyDao(GroupInfoDao dao) {
-        assertObjectNotNull("dao", dao);
-        _dao = dao;
-    }
-
-    public DaoReadable getDaoReadable() {
-        return getMyDao();
-    }
-
-    public DaoWritable getDaoWritable() {
-        return getMyDao();
-    }
-
-    //==========================================================================
-    // =========
     // New Instance
     // ============
     public Entity newEntity() {
@@ -152,7 +123,7 @@
      * @return The selected count.
      */
     public int selectCount(GroupInfoCB cb) {
-        assertConditionBeanNotNull(cb);
+        assertCBNotNull(cb);
         return delegateSelectCount(cb);
     }
 
@@ -229,7 +200,7 @@
      * @return The result bean of selected list. (NotNull)
      */
     public ListResultBean selectList(GroupInfoCB cb) {
-        assertConditionBeanNotNull(cb);
+        assertCBNotNull(cb);
         return new ResultBeanBuilder(getTableDbName())
                 .buildListResultBean(cb, delegateSelectList(cb));
     }
@@ -245,7 +216,7 @@
      * @return The result bean of selected page. (NotNull)
      */
     public PagingResultBean selectPage(final GroupInfoCB cb) {
-        assertConditionBeanNotNull(cb);
+        assertCBNotNull(cb);
         final PagingInvoker invoker = new PagingInvoker(
                 getTableDbName());
         final PagingHandler handler = new PagingHandler() {
@@ -266,6 +237,32 @@
 
     //==========================================================================
     // =========
+    // Scalar Select
+    // =============
+    /**
+     * Select the scalar value derived by a function. 
Call a function + * method after this method called like as follows: + * + *
+     * groupInfoBhv.scalarSelect(Date.class).max(new ScalarQuery(GroupInfoCB cb) {
+     *     cb.specify().columnXxxDatetime(); // the required specification of target column
+     *     cb.query().setXxxName_PrefixSearch("S"); // query as you like it
+     * });
+     * 
+ * + * @param The type of result. + * @param resultType The type of result. (NotNull) + * @return The scalar value derived by a function. (Nullable) + */ + public SLFunction scalarSelect( + Class resultType) { + GroupInfoCB cb = newMyConditionBean(); + cb.xsetupForScalarSelect(); + return new SLFunction(cb, resultType); + } + + //========================================================================== + // ========= // Various Select // ============== /** @@ -275,8 +272,8 @@ * @param valueLabelSetupper The setupper of value-label. (NotNull) * @return The list of value-label. (NotNull) */ - public List> selectValueLabelList( - GroupInfoCB cb, ValueLabelSetupper valueLabelSetupper) { + public List> selectValueLabelList(GroupInfoCB cb, + ValueLabelSetupper valueLabelSetupper) { return createValueLabelList(selectList(cb), valueLabelSetupper); } @@ -467,8 +464,8 @@ //========================================================================== // ========= - // Pullout Foreign - // =============== + // Pull out Foreign + // ================ //========================================================================== // ========= @@ -766,11 +763,11 @@ */ public int queryUpdate(GroupInfo groupInfo, GroupInfoCB cb) { assertObjectNotNull("groupInfo", groupInfo); - assertConditionBeanNotNull(cb); + assertCBNotNull(cb); setupCommonColumnOfUpdateIfNeeds(groupInfo); filterEntityOfUpdate(groupInfo); assertEntityOfUpdate(groupInfo); - return getMyDao().updateByQuery(cb, groupInfo); + return invoke(createQueryUpdateEntityCBCommand(groupInfo, cb)); } /** @@ -780,8 +777,8 @@ * @return The deleted count. */ public int queryDelete(GroupInfoCB cb) { - assertConditionBeanNotNull(cb); - return getMyDao().deleteByQuery(cb); + assertCBNotNull(cb); + return invoke(createQueryDeleteCBCommand(cb)); } //========================================================================== @@ -793,19 +790,27 @@ // ========= // Delegate Method // =============== + // [Behavior Command] // ----------------------------------------------------- // Select // ------ protected int delegateSelectCount(GroupInfoCB cb) { - assertConditionBeanNotNull(cb); - return getMyDao().selectCount(cb); + return invoke(createSelectCountCBCommand(cb)); } + protected int doCallReadCount(ConditionBean cb) { + return delegateSelectCount((GroupInfoCB) cb); + } + protected List delegateSelectList(GroupInfoCB cb) { - assertConditionBeanNotNull(cb); - return getMyDao().selectList(cb); + return invoke(createSelectListCBCommand(cb, GroupInfo.class)); } + @SuppressWarnings("unchecked") + protected List doCallReadList(ConditionBean cb) { + return (List) delegateSelectList((GroupInfoCB) cb); + } + // ----------------------------------------------------- // Update // ------ @@ -813,62 +818,97 @@ if (!processBeforeInsert(e)) { return 1; } - return getMyDao().insert(e); + return invoke(createInsertEntityCommand(e)); } + protected int doCallCreate(Entity entity) { + return delegateInsert(downcast(entity)); + } + protected int delegateUpdate(GroupInfo e) { if (!processBeforeUpdate(e)) { return 1; } - return getMyDao().updateModifiedOnly(e); + return invoke(createUpdateEntityCommand(e)); } + protected int doCallModify(Entity entity) { + return delegateUpdate(downcast(entity)); + } + protected int delegateUpdateNonstrict(GroupInfo e) { if (!processBeforeUpdate(e)) { return 1; } - return getMyDao().updateNonstrictModifiedOnly(e); + return invoke(createUpdateNonstrictEntityCommand(e)); } protected int delegateDelete(GroupInfo e) { if (!processBeforeDelete(e)) { return 1; } - return getMyDao().delete(e); + return invoke(createDeleteEntityCommand(e)); } + protected int doCallRemove(Entity entity) { + return delegateDelete(downcast(entity)); + } + protected int delegateDeleteNonstrict(GroupInfo e) { if (!processBeforeDelete(e)) { return 1; } - return getMyDao().deleteNonstrict(e); + return invoke(createDeleteNonstrictEntityCommand(e)); } protected int[] delegateInsertList(List ls) { - assertObjectNotNull("groupInfoList", ls); - return getMyDao().insertList(helpFilterBeforeInsertInternally(ls)); + if (ls.isEmpty()) { + return new int[] {}; + } + return invoke(createBatchInsertEntityCommand(helpFilterBeforeInsertInternally(ls))); } + @SuppressWarnings("unchecked") + protected int[] doCreateList(List ls) { + return delegateInsertList((List) ls); + } + protected int[] delegateUpdateList(List ls) { - assertObjectNotNull("groupInfoList", ls); - return getMyDao().updateList(helpFilterBeforeUpdateInternally(ls)); + if (ls.isEmpty()) { + return new int[] {}; + } + return invoke(createBatchUpdateEntityCommand(helpFilterBeforeUpdateInternally(ls))); } + @SuppressWarnings("unchecked") + protected int[] doModifyList(List ls) { + return delegateUpdateList((List) ls); + } + protected int[] delegateUpdateListNonstrict(List ls) { - assertObjectNotNull("groupInfoList", ls); - return getMyDao().updateListNonstrict( - helpFilterBeforeUpdateInternally(ls)); + if (ls.isEmpty()) { + return new int[] {}; + } + return invoke(createBatchUpdateNonstrictEntityCommand(helpFilterBeforeUpdateInternally(ls))); } protected int[] delegateDeleteList(List ls) { - assertObjectNotNull("groupInfoList", ls); - return getMyDao().deleteList(helpFilterBeforeDeleteInternally(ls)); + if (ls.isEmpty()) { + return new int[] {}; + } + return invoke(createBatchDeleteEntityCommand(helpFilterBeforeDeleteInternally(ls))); } + @SuppressWarnings("unchecked") + protected int[] doRemoveList(List ls) { + return delegateDeleteList((List) ls); + } + protected int[] delegateDeleteListNonstrict(List ls) { - assertObjectNotNull("groupInfoList", ls); - return getMyDao().deleteListNonstrict( - helpFilterBeforeDeleteInternally(ls)); + if (ls.isEmpty()) { + return new int[] {}; + } + return invoke(createBatchDeleteNonstrictEntityCommand(helpFilterBeforeDeleteInternally(ls))); } //========================================================================== Modified: board/trunk/src/main/java/jp/sf/pal/board/db/bsbhv/BsGroupMappingBhv.java =================================================================== --- board/trunk/src/main/java/jp/sf/pal/board/db/bsbhv/BsGroupMappingBhv.java 2008-12-27 22:06:42 UTC (rev 1624) +++ board/trunk/src/main/java/jp/sf/pal/board/db/bsbhv/BsGroupMappingBhv.java 2008-12-27 22:09:08 UTC (rev 1625) @@ -1,9 +1,8 @@ package jp.sf.pal.board.db.bsbhv; import java.util.List; +import java.util.Map; -import jp.sf.pal.board.db.allcommon.DaoReadable; -import jp.sf.pal.board.db.allcommon.DaoWritable; import jp.sf.pal.board.db.allcommon.Entity; import jp.sf.pal.board.db.allcommon.bhv.setup.ValueLabelSetupper; import jp.sf.pal.board.db.allcommon.cbean.ConditionBean; @@ -16,13 +15,12 @@ import jp.sf.pal.board.db.allcommon.dbmeta.DBMeta; import jp.sf.pal.board.db.bsentity.dbmeta.GroupMappingDbm; import jp.sf.pal.board.db.cbean.GroupMappingCB; -import jp.sf.pal.board.db.exdao.GroupMappingDao; import jp.sf.pal.board.db.exentity.GroupInfo; import jp.sf.pal.board.db.exentity.GroupMapping; import jp.sf.pal.board.db.exentity.UserInfo; /** - * The behavior of GROUP_MAPPING. + * The behavior of GROUP_MAPPING that the type is TABLE.
* *
  * [primary-key]
@@ -67,12 +65,6 @@
 
     //==========================================================================
     // =========
-    // Attribute
-    // =========
-    protected GroupMappingDao _dao;
-
-    //==========================================================================
-    // =========
     // Table name
     // ==========
     /** @return The name on database of table. (NotNull) */
@@ -84,39 +76,18 @@
     // =========
     // DBMeta
     // ======
-    /** @return The meta data of the database. (NotNull) */
+    /** @return The instance of DBMeta. (NotNull) */
     public DBMeta getDBMeta() {
         return GroupMappingDbm.getInstance();
     }
 
-    /** @return The meta data of the database as my table type. (NotNull) */
+    /** @return The instance of DBMeta as my table type. (NotNull) */
     public GroupMappingDbm getMyDBMeta() {
         return GroupMappingDbm.getInstance();
     }
 
     //==========================================================================
     // =========
-    // Dao Accessor
-    // ============
-    public GroupMappingDao getMyDao() {
-        return _dao;
-    }
-
-    public void setMyDao(GroupMappingDao dao) {
-        assertObjectNotNull("dao", dao);
-        _dao = dao;
-    }
-
-    public DaoReadable getDaoReadable() {
-        return getMyDao();
-    }
-
-    public DaoWritable getDaoWritable() {
-        return getMyDao();
-    }
-
-    //==========================================================================
-    // =========
     // New Instance
     // ============
     public Entity newEntity() {
@@ -146,7 +117,7 @@
      * @return The selected count.
      */
     public int selectCount(GroupMappingCB cb) {
-        assertConditionBeanNotNull(cb);
+        assertCBNotNull(cb);
         return delegateSelectCount(cb);
     }
 
@@ -226,7 +197,7 @@
      * @return The result bean of selected list. (NotNull)
      */
     public ListResultBean selectList(GroupMappingCB cb) {
-        assertConditionBeanNotNull(cb);
+        assertCBNotNull(cb);
         return new ResultBeanBuilder(getTableDbName())
                 .buildListResultBean(cb, delegateSelectList(cb));
     }
@@ -242,7 +213,7 @@
      * @return The result bean of selected page. (NotNull)
      */
     public PagingResultBean selectPage(final GroupMappingCB cb) {
-        assertConditionBeanNotNull(cb);
+        assertCBNotNull(cb);
         final PagingInvoker invoker = new PagingInvoker(
                 getTableDbName());
         final PagingHandler handler = new PagingHandler() {
@@ -263,6 +234,32 @@
 
     //==========================================================================
     // =========
+    // Scalar Select
+    // =============
+    /**
+     * Select the scalar value derived by a function. 
Call a function + * method after this method called like as follows: + * + *
+     * groupMappingBhv.scalarSelect(Date.class).max(new ScalarQuery(GroupMappingCB cb) {
+     *     cb.specify().columnXxxDatetime(); // the required specification of target column
+     *     cb.query().setXxxName_PrefixSearch("S"); // query as you like it
+     * });
+     * 
+ * + * @param The type of result. + * @param resultType The type of result. (NotNull) + * @return The scalar value derived by a function. (Nullable) + */ + public SLFunction scalarSelect( + Class resultType) { + GroupMappingCB cb = newMyConditionBean(); + cb.xsetupForScalarSelect(); + return new SLFunction(cb, resultType); + } + + //========================================================================== + // ========= // Various Select // ============== /** @@ -272,8 +269,7 @@ * @param valueLabelSetupper The setupper of value-label. (NotNull) * @return The list of value-label. (NotNull) */ - public List> selectValueLabelList( - GroupMappingCB cb, + public List> selectValueLabelList(GroupMappingCB cb, ValueLabelSetupper valueLabelSetupper) { return createValueLabelList(selectList(cb), valueLabelSetupper); } @@ -285,8 +281,8 @@ //========================================================================== // ========= - // Pullout Foreign - // =============== + // Pull out Foreign + // ================ /** * Pull out the list of foreign table 'GroupInfo'. * @@ -499,11 +495,11 @@ */ public int queryUpdate(GroupMapping groupMapping, GroupMappingCB cb) { assertObjectNotNull("groupMapping", groupMapping); - assertConditionBeanNotNull(cb); + assertCBNotNull(cb); setupCommonColumnOfUpdateIfNeeds(groupMapping); filterEntityOfUpdate(groupMapping); assertEntityOfUpdate(groupMapping); - return getMyDao().updateByQuery(cb, groupMapping); + return invoke(createQueryUpdateEntityCBCommand(groupMapping, cb)); } /** @@ -513,8 +509,8 @@ * @return The deleted count. */ public int queryDelete(GroupMappingCB cb) { - assertConditionBeanNotNull(cb); - return getMyDao().deleteByQuery(cb); + assertCBNotNull(cb); + return invoke(createQueryDeleteCBCommand(cb)); } //========================================================================== @@ -526,19 +522,27 @@ // ========= // Delegate Method // =============== + // [Behavior Command] // ----------------------------------------------------- // Select // ------ protected int delegateSelectCount(GroupMappingCB cb) { - assertConditionBeanNotNull(cb); - return getMyDao().selectCount(cb); + return invoke(createSelectCountCBCommand(cb)); } + protected int doCallReadCount(ConditionBean cb) { + return delegateSelectCount((GroupMappingCB) cb); + } + protected List delegateSelectList(GroupMappingCB cb) { - assertConditionBeanNotNull(cb); - return getMyDao().selectList(cb); + return invoke(createSelectListCBCommand(cb, GroupMapping.class)); } + @SuppressWarnings("unchecked") + protected List doCallReadList(ConditionBean cb) { + return (List) delegateSelectList((GroupMappingCB) cb); + } + // ----------------------------------------------------- // Update // ------ @@ -546,38 +550,71 @@ if (!processBeforeInsert(e)) { return 1; } - return getMyDao().insert(e); + return invoke(createInsertEntityCommand(e)); } + protected int doCallCreate(Entity entity) { + return delegateInsert(downcast(entity)); + } + protected int delegateUpdate(GroupMapping e) { if (!processBeforeUpdate(e)) { return 1; } - return getMyDao().updateModifiedOnly(e); + return invoke(createUpdateEntityCommand(e)); } + protected int doCallModify(Entity entity) { + return delegateUpdate(downcast(entity)); + } + protected int delegateDelete(GroupMapping e) { if (!processBeforeDelete(e)) { return 1; } - return getMyDao().delete(e); + return invoke(createDeleteEntityCommand(e)); } + protected int doCallRemove(Entity entity) { + return delegateDelete(downcast(entity)); + } + protected int[] delegateInsertList(List ls) { - assertObjectNotNull("groupMappingList", ls); - return getMyDao().insertList(helpFilterBeforeInsertInternally(ls)); + if (ls.isEmpty()) { + return new int[] {}; + } + return invoke(createBatchInsertEntityCommand(helpFilterBeforeInsertInternally(ls))); } + @SuppressWarnings("unchecked") + protected int[] doCreateList(List ls) { + return delegateInsertList((List) ls); + } + protected int[] delegateUpdateList(List ls) { - assertObjectNotNull("groupMappingList", ls); - return getMyDao().updateList(helpFilterBeforeUpdateInternally(ls)); + if (ls.isEmpty()) { + return new int[] {}; + } + return invoke(createBatchUpdateEntityCommand(helpFilterBeforeUpdateInternally(ls))); } + @SuppressWarnings("unchecked") + protected int[] doModifyList(List ls) { + return delegateUpdateList((List) ls); + } + protected int[] delegateDeleteList(List ls) { - assertObjectNotNull("groupMappingList", ls); - return getMyDao().deleteList(helpFilterBeforeDeleteInternally(ls)); + if (ls.isEmpty()) { + return new int[] {}; + } + return invoke(createBatchDeleteEntityCommand(helpFilterBeforeDeleteInternally(ls))); } + @SuppressWarnings("unchecked") + protected int[] doRemoveList(List ls) { + return delegateDeleteList((List) ls); + } + //========================================================================== // ========= // Optimistic Lock Info Modified: board/trunk/src/main/java/jp/sf/pal/board/db/bsbhv/BsMessageAttachmentBhv.java =================================================================== --- board/trunk/src/main/java/jp/sf/pal/board/db/bsbhv/BsMessageAttachmentBhv.java 2008-12-27 22:06:42 UTC (rev 1624) +++ board/trunk/src/main/java/jp/sf/pal/board/db/bsbhv/BsMessageAttachmentBhv.java 2008-12-27 22:09:08 UTC (rev 1625) @@ -1,9 +1,8 @@ package jp.sf.pal.board.db.bsbhv; import java.util.List; +import java.util.Map; -import jp.sf.pal.board.db.allcommon.DaoReadable; -import jp.sf.pal.board.db.allcommon.DaoWritable; import jp.sf.pal.board.db.allcommon.Entity; import jp.sf.pal.board.db.allcommon.bhv.setup.ValueLabelSetupper; import jp.sf.pal.board.db.allcommon.cbean.ConditionBean; @@ -16,13 +15,12 @@ import jp.sf.pal.board.db.allcommon.dbmeta.DBMeta; import jp.sf.pal.board.db.bsentity.dbmeta.MessageAttachmentDbm; import jp.sf.pal.board.db.cbean.MessageAttachmentCB; -import jp.sf.pal.board.db.exdao.MessageAttachmentDao; import jp.sf.pal.board.db.exentity.Attachment; import jp.sf.pal.board.db.exentity.Message; import jp.sf.pal.board.db.exentity.MessageAttachment; /** - * The behavior of MESSAGE_ATTACHMENT. + * The behavior of MESSAGE_ATTACHMENT that the type is TABLE.
* *
  * [primary-key]
@@ -67,12 +65,6 @@
 
     //==========================================================================
     // =========
-    // Attribute
-    // =========
-    protected MessageAttachmentDao _dao;
-
-    //==========================================================================
-    // =========
     // Table name
     // ==========
     /** @return The name on database of table. (NotNull) */
@@ -84,39 +76,18 @@
     // =========
     // DBMeta
     // ======
-    /** @return The meta data of the database. (NotNull) */
+    /** @return The instance of DBMeta. (NotNull) */
     public DBMeta getDBMeta() {
         return MessageAttachmentDbm.getInstance();
     }
 
-    /** @return The meta data of the database as my table type. (NotNull) */
+    /** @return The instance of DBMeta as my table type. (NotNull) */
     public MessageAttachmentDbm getMyDBMeta() {
         return MessageAttachmentDbm.getInstance();
     }
 
     //==========================================================================
     // =========
-    // Dao Accessor
-    // ============
-    public MessageAttachmentDao getMyDao() {
-        return _dao;
-    }
-
-    public void setMyDao(MessageAttachmentDao dao) {
-        assertObjectNotNull("dao", dao);
-        _dao = dao;
-    }
-
-    public DaoReadable getDaoReadable() {
-        return getMyDao();
-    }
-
-    public DaoWritable getDaoWritable() {
-        return getMyDao();
-    }
-
-    //==========================================================================
-    // =========
     // New Instance
     // ============
     public Entity newEntity() {
@@ -146,7 +117,7 @@
      * @return The selected count.
      */
     public int selectCount(MessageAttachmentCB cb) {
-        assertConditionBeanNotNull(cb);
+        assertCBNotNull(cb);
         return delegateSelectCount(cb);
     }
 
@@ -227,7 +198,7 @@
      * @return The result bean of selected list. (NotNull)
      */
     public ListResultBean selectList(MessageAttachmentCB cb) {
-        assertConditionBeanNotNull(cb);
+        assertCBNotNull(cb);
         return new ResultBeanBuilder(getTableDbName())
                 .buildListResultBean(cb, delegateSelectList(cb));
     }
@@ -244,7 +215,7 @@
      */
     public PagingResultBean selectPage(
             final MessageAttachmentCB cb) {
-        assertConditionBeanNotNull(cb);
+        assertCBNotNull(cb);
         final PagingInvoker invoker = new PagingInvoker(
                 getTableDbName());
         final PagingHandler handler = new PagingHandler() {
@@ -265,6 +236,32 @@
 
     //==========================================================================
     // =========
+    // Scalar Select
+    // =============
+    /**
+     * Select the scalar value derived by a function. 
Call a function + * method after this method called like as follows: + * + *
+     * messageAttachmentBhv.scalarSelect(Date.class).max(new ScalarQuery(MessageAttachmentCB cb) {
+     *     cb.specify().columnXxxDatetime(); // the required specification of target column
+     *     cb.query().setXxxName_PrefixSearch("S"); // query as you like it
+     * });
+     * 
+ * + * @param The type of result. + * @param resultType The type of result. (NotNull) + * @return The scalar value derived by a function. (Nullable) + */ + public SLFunction scalarSelect( + Class resultType) { + MessageAttachmentCB cb = newMyConditionBean(); + cb.xsetupForScalarSelect(); + return new SLFunction(cb, resultType); + } + + //========================================================================== + // ========= // Various Select // ============== /** @@ -274,7 +271,7 @@ * @param valueLabelSetupper The setupper of value-label. (NotNull) * @return The list of value-label. (NotNull) */ - public List> selectValueLabelList( + public List> selectValueLabelList( MessageAttachmentCB cb, ValueLabelSetupper valueLabelSetupper) { return createValueLabelList(selectList(cb), valueLabelSetupper); @@ -287,8 +284,8 @@ //========================================================================== // ========= - // Pullout Foreign - // =============== + // Pull out Foreign + // ================ /** * Pull out the list of foreign table 'Attachment'. * @@ -628,11 +625,11 @@ public int queryUpdate(MessageAttachment messageAttachment, MessageAttachmentCB cb) { assertObjectNotNull("messageAttachment", messageAttachment); - assertConditionBeanNotNull(cb); + assertCBNotNull(cb); setupCommonColumnOfUpdateIfNeeds(messageAttachment); filterEntityOfUpdate(messageAttachment); assertEntityOfUpdate(messageAttachment); - return getMyDao().updateByQuery(cb, messageAttachment); + return invoke(createQueryUpdateEntityCBCommand(messageAttachment, cb)); } /** @@ -642,8 +639,8 @@ * @return The deleted count. */ public int queryDelete(MessageAttachmentCB cb) { - assertConditionBeanNotNull(cb); - return getMyDao().deleteByQuery(cb); + assertCBNotNull(cb); + return invoke(createQueryDeleteCBCommand(cb)); } //========================================================================== @@ -655,19 +652,27 @@ // ========= // Delegate Method // =============== + // [Behavior Command] // ----------------------------------------------------- // Select // ------ protected int delegateSelectCount(MessageAttachmentCB cb) { - assertConditionBeanNotNull(cb); - return getMyDao().selectCount(cb); + return invoke(createSelectCountCBCommand(cb)); } + protected int doCallReadCount(ConditionBean cb) { + return delegateSelectCount((MessageAttachmentCB) cb); + } + protected List delegateSelectList(MessageAttachmentCB cb) { - assertConditionBeanNotNull(cb); - return getMyDao().selectList(cb); + return invoke(createSelectListCBCommand(cb, MessageAttachment.class)); } + @SuppressWarnings("unchecked") + protected List doCallReadList(ConditionBean cb) { + return (List) delegateSelectList((MessageAttachmentCB) cb); + } + // ----------------------------------------------------- // Update // ------ @@ -675,62 +680,97 @@ if (!processBeforeInsert(e)) { return 1; } - return getMyDao().insert(e); + return invoke(createInsertEntityCommand(e)); } + protected int doCallCreate(Entity entity) { + return delegateInsert(downcast(entity)); + } + protected int delegateUpdate(MessageAttachment e) { if (!processBeforeUpdate(e)) { return 1; } - return getMyDao().updateModifiedOnly(e); + return invoke(createUpdateEntityCommand(e)); } + protected int doCallModify(Entity entity) { + return delegateUpdate(downcast(entity)); + } + protected int delegateUpdateNonstrict(MessageAttachment e) { if (!processBeforeUpdate(e)) { return 1; } - return getMyDao().updateNonstrictModifiedOnly(e); + return invoke(createUpdateNonstrictEntityCommand(e)); } protected int delegateDelete(MessageAttachment e) { if (!processBeforeDelete(e)) { return 1; } - return getMyDao().delete(e); + return invoke(createDeleteEntityCommand(e)); } + protected int doCallRemove(Entity entity) { + return delegateDelete(downcast(entity)); + } + protected int delegateDeleteNonstrict(MessageAttachment e) { if (!processBeforeDelete(e)) { return 1; } - return getMyDao().deleteNonstrict(e); + return invoke(createDeleteNonstrictEntityCommand(e)); } protected int[] delegateInsertList(List ls) { - assertObjectNotNull("messageAttachmentList", ls); - return getMyDao().insertList(helpFilterBeforeInsertInternally(ls)); + if (ls.isEmpty()) { + return new int[] {}; + } + return invoke(createBatchInsertEntityCommand(helpFilterBeforeInsertInternally(ls))); } + @SuppressWarnings("unchecked") + protected int[] doCreateList(List ls) { + return delegateInsertList((List) ls); + } + protected int[] delegateUpdateList(List ls) { - assertObjectNotNull("messageAttachmentList", ls); - return getMyDao().updateList(helpFilterBeforeUpdateInternally(ls)); + if (ls.isEmpty()) { + return new int[] {}; + } + return invoke(createBatchUpdateEntityCommand(helpFilterBeforeUpdateInternally(ls))); } + @SuppressWarnings("unchecked") + protected int[] doModifyList(List ls) { + return delegateUpdateList((List) ls); + } + protected int[] delegateUpdateListNonstrict(List ls) { - assertObjectNotNull("messageAttachmentList", ls); - return getMyDao().updateListNonstrict( - helpFilterBeforeUpdateInternally(ls)); + if (ls.isEmpty()) { + return new int[] {}; + } + return invoke(createBatchUpdateNonstrictEntityCommand(helpFilterBeforeUpdateInternally(ls))); } protected int[] delegateDeleteList(List ls) { - assertObjectNotNull("messageAttachmentList", ls); - return getMyDao().deleteList(helpFilterBeforeDeleteInternally(ls)); + if (ls.isEmpty()) { + return new int[] {}; + } + return invoke(createBatchDeleteEntityCommand(helpFilterBeforeDeleteInternally(ls))); } + @SuppressWarnings("unchecked") + protected int[] doRemoveList(List ls) { + return delegateDeleteList((List) ls); + } + protected int[] delegateDeleteListNonstrict(List ls) { - assertObjectNotNull("messageAttachmentList", ls); - return getMyDao().deleteListNonstrict( - helpFilterBeforeDeleteInternally(ls)); + if (ls.isEmpty()) { + return new int[] {}; + } + return invoke(createBatchDeleteNonstrictEntityCommand(helpFilterBeforeDeleteInternally(ls))); } //========================================================================== Modified: board/trunk/src/main/java/jp/sf/pal/board/db/bsbhv/BsMessageBhv.java =================================================================== --- board/trunk/src/main/java/jp/sf/pal/board/db/bsbhv/BsMessageBhv.java 2008-12-27 22:06:42 UTC (rev 1624) +++ board/trunk/src/main/java/jp/sf/pal/board/db/bsbhv/BsMessageBhv.java 2008-12-27 22:09:08 UTC (rev 1625) @@ -1,9 +1,8 @@ package jp.sf.pal.board.db.bsbhv; import java.util.List; +import java.util.Map; -import jp.sf.pal.board.db.allcommon.DaoReadable; -import jp.sf.pal.board.db.allcommon.DaoWritable; import jp.sf.pal.board.db.allcommon.Entity; import jp.sf.pal.board.db.allcommon.bhv.load.LoadReferrerOption; import jp.sf.pal.board.db.allcommon.bhv.setup.ConditionBeanSetupper; @@ -22,7 +21,6 @@ import jp.sf.pal.board.db.cbean.ReplyCB; import jp.sf.pal.board.db.exbhv.MessageAttachmentBhv; import jp.sf.pal.board.db.exbhv.ReplyBhv; -import jp.sf.pal.board.db.exdao.MessageDao; import jp.sf.pal.board.db.exentity.Category; import jp.sf.pal.board.db.exentity.Message; import jp.sf.pal.board.db.exentity.MessageAttachment; @@ -30,7 +28,7 @@ import jp.sf.pal.board.db.exentity.Reply; /** - * The behavior of MESSAGE. + * The behavior of MESSAGE that the type is TABLE.
* *
  * [primary-key]
@@ -75,12 +73,6 @@
 
     //==========================================================================
     // =========
-    // Attribute
-    // =========
-    protected MessageDao _dao;
-
-    //==========================================================================
-    // =========
     // Table name
     // ==========
     /** @return The name on database of table. (NotNull) */
@@ -92,39 +84,18 @@
     // =========
     // DBMeta
     // ======
-    /** @return The meta data of the database. (NotNull) */
+    /** @return The instance of DBMeta. (NotNull) */
     public DBMeta getDBMeta() {
         return MessageDbm.getInstance();
     }
 
-    /** @return The meta data of the database as my table type. (NotNull) */
+    /** @return The instance of DBMeta as my table type. (NotNull) */
     public MessageDbm getMyDBMeta() {
         return MessageDbm.getInstance();
     }
 
     //==========================================================================
     // =========
-    // Dao Accessor
-    // ============
-    public MessageDao getMyDao() {
-        return _dao;
-    }
-
-    public void setMyDao(MessageDao dao) {
-        assertObjectNotNull("dao", dao);
-        _dao = dao;
-    }
-
-    public DaoReadable getDaoReadable() {
-        return getMyDao();
-    }
-
-    public DaoWritable getDaoWritable() {
-        return getMyDao();
-    }
-
-    //==========================================================================
-    // =========
     // New Instance
     // ============
     public Entity newEntity() {
@@ -154,7 +125,7 @@
      * @return The selected count.
      */
     public int selectCount(MessageCB cb) {
-        assertConditionBeanNotNull(cb);
+        assertCBNotNull(cb);
         return delegateSelectCount(cb);
     }
 
@@ -231,7 +202,7 @@
      * @return The result bean of selected list. (NotNull)
      */
     public ListResultBean selectList(MessageCB cb) {
-        assertConditionBeanNotNull(cb);
+        assertCBNotNull(cb);
         return new ResultBeanBuilder(getTableDbName())
                 .buildListResultBean(cb, delegateSelectList(cb));
     }
@@ -247,7 +218,7 @@
      * @return The result bean of selected page. (NotNull)
      */
     public PagingResultBean selectPage(final MessageCB cb) {
-        assertConditionBeanNotNull(cb);
+        assertCBNotNull(cb);
         final PagingInvoker invoker = new PagingInvoker(
                 getTableDbName());
         final PagingHandler handler = new PagingHandler() {
@@ -268,6 +239,32 @@
 
     //==========================================================================
     // =========
+    // Scalar Select
+    // =============
+    /**
+     * Select the scalar value derived by a function. 
Call a function + * method after this method called like as follows: + * + *
+     * messageBhv.scalarSelect(Date.class).max(new ScalarQuery(MessageCB cb) {
+     *     cb.specify().columnXxxDatetime(); // the required specification of target column
+     *     cb.query().setXxxName_PrefixSearch("S"); // query as you like it
+     * });
+     * 
+ * + * @param The type of result. + * @param resultType The type of result. (NotNull) + * @return The scalar value derived by a function. (Nullable) + */ + public SLFunction scalarSelect( + Class resultType) { + MessageCB cb = newMyConditionBean(); + cb.xsetupForScalarSelect(); + return new SLFunction(cb, resultType); + } + + //========================================================================== + // ========= // Various Select // ============== /** @@ -277,8 +274,8 @@ * @param valueLabelSetupper The setupper of value-label. (NotNull) * @return The list of value-label. (NotNull) */ - public List> selectValueLabelList( - MessageCB cb, ValueLabelSetupper valueLabelSetupper) { + public List> selectValueLabelList(MessageCB cb, + ValueLabelSetupper valueLabelSetupper) { return createValueLabelList(selectList(cb), valueLabelSetupper); } @@ -466,8 +463,8 @@ //========================================================================== // ========= - // Pullout Foreign - // =============== + // Pull out Foreign + // ================ /** * Pull out the list of foreign table 'Category'. * @@ -794,11 +791,11 @@ */ public int queryUpdate(Message message, MessageCB cb) { assertObjectNotNull("message", message); - assertConditionBeanNotNull(cb); + assertCBNotNull(cb); setupCommonColumnOfUpdateIfNeeds(message); filterEntityOfUpdate(message); assertEntityOfUpdate(message); - return getMyDao().updateByQuery(cb, message); + return invoke(createQueryUpdateEntityCBCommand(message, cb)); } /** @@ -808,8 +805,8 @@ * @return The deleted count. */ public int queryDelete(MessageCB cb) { - assertConditionBeanNotNull(cb); - return getMyDao().deleteByQuery(cb); + assertCBNotNull(cb); + return invoke(createQueryDeleteCBCommand(cb)); } //========================================================================== @@ -821,19 +818,27 @@ // ========= // Delegate Method // =============== + // [Behavior Command] // ----------------------------------------------------- // Select // ------ protected int delegateSelectCount(MessageCB cb) { - assertConditionBeanNotNull(cb); - return getMyDao().selectCount(cb); + return invoke(createSelectCountCBCommand(cb)); } + protected int doCallReadCount(ConditionBean cb) { + return delegateSelectCount((MessageCB) cb); + } + protected List delegateSelectList(MessageCB cb) { - assertConditionBeanNotNull(cb); - return getMyDao().selectList(cb); + return invoke(createSelectListCBCommand(cb, Message.class)); } + @SuppressWarnings("unchecked") + protected List doCallReadList(ConditionBean cb) { + return (List) delegateSelectList((MessageCB) cb); + } + // ----------------------------------------------------- // Update // ------ @@ -841,62 +846,97 @@ if (!processBeforeInsert(e)) { return 1; } - return getMyDao().insert(e); + return invoke(createInsertEntityCommand(e)); } + protected int doCallCreate(Entity entity) { + return delegateInsert(downcast(entity)); + } + protected int delegateUpdate(Message e) { if (!processBeforeUpdate(e)) { return 1; } - return getMyDao().updateModifiedOnly(e); + return invoke(createUpdateEntityCommand(e)); } + protected int doCallModify(Entity entity) { + return delegateUpdate(downcast(entity)); + } + protected int delegateUpdateNonstrict(Message e) { if (!processBeforeUpdate(e)) { return 1; } - return getMyDao().updateNonstrictModifiedOnly(e); + return invoke(createUpdateNonstrictEntityCommand(e)); } protected int delegateDelete(Message e) { if (!processBeforeDelete(e)) { return 1; } - return getMyDao().delete(e); + return invoke(createDeleteEntityCommand(e)); } + protected int doCallRemove(Entity entity) { + return delegateDelete(downcast(entity)); + } + protected int delegateDeleteNonstrict(Message e) { if (!processBeforeDelete(e)) { return 1; } - return getMyDao().deleteNonstrict(e); + return invoke(createDeleteNonstrictEntityCommand(e)); } protected int[] delegateInsertList(List ls) { - assertObjectNotNull("messageList", ls); - return getMyDao().insertList(helpFilterBeforeInsertInternally(ls)); + if (ls.isEmpty()) { + return new int[] {}; + } + return invoke(createBatchInsertEntityCommand(helpFilterBeforeInsertInternally(ls))); } + @SuppressWarnings("unchecked") + protected int[] doCreateList(List ls) { + return delegateInsertList((List) ls); + } + protected int[] delegateUpdateList(List ls) { - assertObjectNotNull("messageList", ls); - return getMyDao().updateList(helpFilterBeforeUpdateInternally(ls)); + if (ls.isEmpty()) { + return new int[] {}; + } + return invoke(createBatchUpdateEntityCommand(helpFilterBeforeUpdateInternally(ls))); } + @SuppressWarnings("unchecked") + protected int[] doModifyList(List ls) { + return delegateUpdateList((List) ls); + } + protected int[] delegateUpdateListNonstrict(List ls) { - assertObjectNotNull("messageList", ls); - return getMyDao().updateListNonstrict( - helpFilterBeforeUpdateInternally(ls)); + if (ls.isEmpty()) { + return new int[] {}; + } + return invoke(createBatchUpdateNonstrictEntityCommand(helpFilterBeforeUpdateInternally(ls))); } protected int[] delegateDeleteList(List ls) { - assertObjectNotNull("messageList", ls); - return getMyDao().deleteList(helpFilterBeforeDeleteInternally(ls)); + if (ls.isEmpty()) { + return new int[] {}; + } + return invoke(createBatchDeleteEntityCommand(helpFilterBeforeDeleteInternally(ls))); } + @SuppressWarnings("unchecked") + protected int[] doRemoveList(List ls) { + return delegateDeleteList((List) ls); + } + protected int[] delegateDeleteListNonstrict(List ls) { - assertObjectNotNull("messageList", ls); - return getMyDao().deleteListNonstrict( - helpFilterBeforeDeleteInternally(ls)); + if (ls.isEmpty()) { + return new int[] {}; + } + return invoke(createBatchDeleteNonstrictEntityCommand(helpFilterBeforeDeleteInternally(ls))); } //========================================================================== Modified: board/trunk/src/main/java/jp/sf/pal/board/db/bsbhv/BsMessageContentBhv.java =================================================================== --- board/trunk/src/main/java/jp/sf/pal/board/db/bsbhv/BsMessageContentBhv.java 2008-12-27 22:06:42 UTC (rev 1624) +++ board/trunk/src/main/java/jp/sf/pal/board/db/bsbhv/BsMessageContentBhv.java 2008-12-27 22:09:08 UTC (rev 1625) @@ -1,9 +1,8 @@ package jp.sf.pal.board.db.bsbhv; import java.util.List; +import java.util.Map; -import jp.sf.pal.board.db.allcommon.DaoReadable; -import jp.sf.pal.board.db.allcommon.DaoWritable; import jp.sf.pal.board.db.allcommon.Entity; import jp.sf.pal.board.db.allcommon.bhv.setup.ValueLabelSetupper; import jp.sf.pal.board.db.allcommon.cbean.ConditionBean; @@ -16,12 +15,11 @@ import jp.sf.pal.board.db.allcommon.dbmeta.DBMeta; import jp.sf.pal.board.db.bsentity.dbmeta.MessageContentDbm; import jp.sf.pal.board.db.cbean.MessageContentCB; -import jp.sf.pal.board.db.exdao.MessageContentDao; import jp.sf.pal.board.db.exentity.Message; import jp.sf.pal.board.db.exentity.MessageContent; /** - * The behavior of MESSAGE_CONTENT. + * The behavior of MESSAGE_CONTENT that the type is TABLE.
* *
  * [primary-key]
@@ -66,12 +64,6 @@
 
     //==========================================================================
     // =========
-    // Attribute
-    // =========
-    protected MessageContentDao _dao;
-
-    //==========================================================================
-    // =========
     // Table name
     // ==========
     /** @return The name on database of table. (NotNull) */
@@ -83,39 +75,18 @@
     // =========
     // DBMeta
     // ======
-    /** @return The meta data of the database. (NotNull) */
+    /** @return The instance of DBMeta. (NotNull) */
     public DBMeta getDBMeta() {
         return MessageContentDbm.getInstance();
     }
 
-    /** @return The meta data of the database as my table type. (NotNull) */
+    /** @return The instance of DBMeta as my table type. (NotNull) */
     public MessageContentDbm getMyDBMeta() {
         return MessageContentDbm.getInstance();
     }
 
     //==========================================================================
     // =========
-    // Dao Accessor
-    // ============
-    public MessageContentDao getMyDao() {
-        return _dao;
-    }
-
-    public void setMyDao(MessageContentDao dao) {
-        assertObjectNotNull("dao", dao);
-        _dao = dao;
-    }
-
-    public DaoReadable getDaoReadable() {
-        return getMyDao();
-    }
-
-    public DaoWritable getDaoWritable() {
-        return getMyDao();
-    }
-
-    //==========================================================================
-    // =========
     // New Instance
     // ============
     public Entity newEntity() {
@@ -145,7 +116,7 @@
      * @return The selected count.
      */
     public int selectCount(MessageContentCB cb) {
-        assertConditionBeanNotNull(cb);
+        assertCBNotNull(cb);
         return delegateSelectCount(cb);
     }
 
@@ -225,7 +196,7 @@
      * @return The result bean of selected list. (NotNull)
      */
     public ListResultBean selectList(MessageContentCB cb) {
-        assertConditionBeanNotNull(cb);
+        assertCBNotNull(cb);
         return new ResultBeanBuilder(getTableDbName())
                 .buildListResultBean(cb, delegateSelectList(cb));
     }
@@ -241,7 +212,7 @@
      * @return The result bean of selected page. (NotNull)
      */
     public PagingResultBean selectPage(final MessageContentCB cb) {
-        assertConditionBeanNotNull(cb);
+        assertCBNotNull(cb);
         final PagingInvoker invoker = new PagingInvoker(
                 getTableDbName());
         final PagingHandler handler = new PagingHandler() {
@@ -262,6 +233,32 @@
 
     //==========================================================================
     // =========
+    // Scalar Select
+    // =============
+    /**
+     * Select the scalar value derived by a function. 
Call a function + * method after this method called like as follows: + * + *
+     * messageContentBhv.scalarSelect(Date.class).max(new ScalarQuery(MessageContentCB cb) {
+     *     cb.specify().columnXxxDatetime(); // the required specification of target column
+     *     cb.query().setXxxName_PrefixSearch("S"); // query as you like it
+     * });
+     * 
+ * + * @param The type of result. + * @param resultType The type of result. (NotNull) + * @return The scalar value derived by a function. (Nullable) + */ + public SLFunction scalarSelect( + Class resultType) { + MessageContentCB cb = newMyConditionBean(); + cb.xsetupForScalarSelect(); + return new SLFunction(cb, resultType); + } + + //========================================================================== + // ========= // Various Select // ============== /** @@ -271,8 +268,7 @@ * @param valueLabelSetupper The setupper of value-label. (NotNull) * @return The list of value-label. (NotNull) */ - public List> selectValueLabelList( - MessageContentCB cb, + public List> selectValueLabelList(MessageContentCB cb, ValueLabelSetupper valueLabelSetupper) { return createValueLabelList(selectList(cb), valueLabelSetupper); } @@ -284,8 +280,8 @@ //========================================================================== // ========= - // Pullout Foreign - // =============== + // Pull out Foreign + // ================ /** * Pull out the list of foreign table 'Message'. * @@ -483,11 +479,11 @@ */ public int queryUpdate(MessageContent messageContent, MessageContentCB cb) { assertObjectNotNull("messageContent", messageContent); - assertConditionBeanNotNull(cb); + assertCBNotNull(cb); setupCommonColumnOfUpdateIfNeeds(messageContent); filterEntityOfUpdate(messageContent); assertEntityOfUpdate(messageContent); - return getMyDao().updateByQuery(cb, messageContent); + return invoke(createQueryUpdateEntityCBCommand(messageContent, cb)); } /** @@ -497,8 +493,8 @@ * @return The deleted count. */ public int queryDelete(MessageContentCB cb) { - assertConditionBeanNotNull(cb); - return getMyDao().deleteByQuery(cb); + assertCBNotNull(cb); + return invoke(createQueryDeleteCBCommand(cb)); } //========================================================================== @@ -510,19 +506,27 @@ // ========= // Delegate Method // =============== + // [Behavior Command] // ----------------------------------------------------- // Select // ------ protected int delegateSelectCount(MessageContentCB cb) { - assertConditionBeanNotNull(cb); - return getMyDao().selectCount(cb); + return invoke(createSelectCountCBCommand(cb)); } + protected int doCallReadCount(ConditionBean cb) { + return delegateSelectCount((MessageContentCB) cb); + } + protected List delegateSelectList(MessageContentCB cb) { - assertConditionBeanNotNull(cb); - return getMyDao().selectList(cb); + return invoke(createSelectListCBCommand(cb, MessageContent.class)); } + @SuppressWarnings("unchecked") + protected List doCallReadList(ConditionBean cb) { + return (List) delegateSelectList((MessageContentCB) cb); + } + // ----------------------------------------------------- // Update // ------ @@ -530,38 +534,71 @@ if (!processBeforeInsert(e)) { return 1; } - return getMyDao().insert(e); + return invoke(createInsertEntityCommand(e)); } + protected int doCallCreate(Entity entity) { + return delegateInsert(downcast(entity)); + } + protected int delegateUpdate(MessageContent e) { if (!processBeforeUpdate(e)) { return 1; } - return getMyDao().updateModifiedOnly(e); + return invoke(createUpdateEntityCommand(e)); } + protected int doCallModify(Entity entity) { + return delegateUpdate(downcast(entity)); + } + protected int delegateDelete(MessageContent e) { if (!processBeforeDelete(e)) { return 1; } - return getMyDao().delete(e); + return invoke(createDeleteEntityCommand(e)); } + protected int doCallRemove(Entity entity) { + return delegateDelete(downcast(entity)); + } + protected int[] delegateInsertList(List ls) { - assertObjectNotNull("messageContentList", ls); - return getMyDao().insertList(helpFilterBeforeInsertInternally(ls)); + if (ls.isEmpty()) { + return new int[] {}; + } + return invoke(createBatchInsertEntityCommand(helpFilterBeforeInsertInternally(ls))); } + @SuppressWarnings("unchecked") + protected int[] doCreateList(List ls) { + return delegateInsertList((List) ls); + } + protected int[] delegateUpdateList(List ls) { - assertObjectNotNull("messageContentList", ls); - return getMyDao().updateList(helpFilterBeforeUpdateInternally(ls)); + if (ls.isEmpty()) { + return new int[] {}; + } + return invoke(createBatchUpdateEntityCommand(helpFilterBeforeUpdateInternally(ls))); } + @SuppressWarnings("unchecked") + protected int[] doModifyList(List ls) { + return delegateUpdateList((List) ls); + } + protected int[] delegateDeleteList(List ls) { - assertObjectNotNull("messageContentList", ls); - return getMyDao().deleteList(helpFilterBeforeDeleteInternally(ls)); + if (ls.isEmpty()) { + return new int[] {}; + } + return invoke(createBatchDeleteEntityCommand(helpFilterBeforeDeleteInternally(ls))); } + @SuppressWarnings("unchecked") + protected int[] doRemoveList(List ls) { + return delegateDeleteList((List) ls); + } + //========================================================================== // ========= // Optimistic Lock Info Modified: board/trunk/src/main/java/jp/sf/pal/board/db/bsbhv/BsReplyBhv.java =================================================================== --- board/trunk/src/main/java/jp/sf/pal/board/db/bsbhv/BsReplyBhv.java 2008-12-27 22:06:42 UTC (rev 1624) +++ board/trunk/src/main/java/jp/sf/pal/board/db/bsbhv/BsReplyBhv.java 2008-12-27 22:09:08 UTC (rev 1625) @@ -1,9 +1,8 @@ package jp.sf.pal.board.db.bsbhv; import java.util.List; +import java.util.Map; -import jp.sf.pal.board.db.allcommon.DaoReadable; -import jp.sf.pal.board.db.allcommon.DaoWritable; import jp.sf.pal.board.db.allcommon.Entity; import jp.sf.pal.board.db.allcommon.bhv.setup.ValueLabelSetupper; import jp.sf.pal.board.db.allcommon.cbean.ConditionBean; @@ -16,12 +15,11 @@ import jp.sf.pal.board.db.allcommon.dbmeta.DBMeta; import jp.sf.pal.board.db.bsentity.dbmeta.ReplyDbm; import jp.sf.pal.board.db.cbean.ReplyCB; -import jp.sf.pal.board.db.exdao.ReplyDao; import jp.sf.pal.board.db.exentity.Message; import jp.sf.pal.board.db.exentity.Reply; /** - * The behavior of REPLY. + * The behavior of REPLY that the type is TABLE.
* *
  * [primary-key]
@@ -66,12 +64,6 @@
 
     //==========================================================================
     // =========
-    // Attribute
-    // =========
-    protected ReplyDao _dao;
-
-    //==========================================================================
-    // =========
     // Table name
     // ==========
     /** @return The name on database of table. (NotNull) */
@@ -83,39 +75,18 @@
     // =========
     // DBMeta
     // ======
-    /** @return The meta data of the database. (NotNull) */
+    /** @return The instance of DBMeta. (NotNull) */
     public DBMeta getDBMeta() {
         return ReplyDbm.getInstance();
     }
 
-    /** @return The meta data of the database as my table type. (NotNull) */
+    /** @return The instance of DBMeta as my table type. (NotNull) */
     public ReplyDbm getMyDBMeta() {
         return ReplyDbm.getInstance();
     }
 
     //==========================================================================
     // =========
-    // Dao Accessor
-    // ============
-    public ReplyDao getMyDao() {
-        return _dao;
-    }
-
-    public void setMyDao(ReplyDao dao) {
-        assertObjectNotNull("dao", dao);
-        _dao = dao;
-    }
-
-    public DaoReadable getDaoReadable() {
-        return getMyDao();
-    }
-
-    public DaoWritable getDaoWritable() {
-        return getMyDao();
-    }
-
-    //==========================================================================
-    // =========
     // New Instance
     // ============
     public Entity newEntity() {
@@ -145,7 +116,7 @@
      * @return The selected count.
      */
     public int selectCount(ReplyCB cb) {
-        assertConditionBeanNotNull(cb);
+        assertCBNotNull(cb);
         return delegateSelectCount(cb);
     }
 
@@ -222,7 +193,7 @@
      * @return The result bean of selected list. (NotNull)
      */
     public ListResultBean selectList(ReplyCB cb) {
-        assertConditionBeanNotNull(cb);
+        assertCBNotNull(cb);
         return new ResultBeanBuilder(getTableDbName())
                 .buildListResultBean(cb, delegateSelectList(cb));
     }
@@ -238,7 +209,7 @@
      * @return The result bean of selected page. (NotNull)
      */
     public PagingResultBean selectPage(final ReplyCB cb) {
-        assertConditionBeanNotNull(cb);
+        assertCBNotNull(cb);
         final PagingInvoker invoker = new PagingInvoker(
                 getTableDbName());
         final PagingHandler handler = new PagingHandler() {
@@ -259,6 +230,32 @@
 
     //==========================================================================
     // =========
+    // Scalar Select
+    // =============
+    /**
+     * Select the scalar value derived by a function. 
Call a function + * method after this method called like as follows: + * + *
+     * replyBhv.scalarSelect(Date.class).max(new ScalarQuery(ReplyCB cb) {
+     *     cb.specify().columnXxxDatetime(); // the required specification of target column
+     *     cb.query().setXxxName_PrefixSearch("S"); // query as you like it
+     * });
+     * 
+ * + * @param The type of result. + * @param resultType The type of result. (NotNull) + * @return The scalar value derived by a function. (Nullable) + */ + public SLFunction scalarSelect( + Class resultType) { + ReplyCB cb = newMyConditionBean(); + cb.xsetupForScalarSelect(); + return new SLFunction(cb, resultType); + } + + //========================================================================== + // ========= // Various Select // ============== /** @@ -268,7 +265,7 @@ * @param valueLabelSetupper The setupper of value-label. (NotNull) * @return The list of value-label. (NotNull) */ - public List> selectValueLabelList(ReplyCB cb, + public List> selectValueLabelList(ReplyCB cb, ValueLabelSetupper valueLabelSetupper) { return createValueLabelList(selectList(cb), valueLabelSetupper); } @@ -280,8 +277,8 @@ //========================================================================== // ========= - // Pullout Foreign - // =============== + // Pull out Foreign + // ================ /** * Pull out the list of foreign table 'Message'. * @@ -475,11 +472,11 @@ */ public int queryUpdate(Reply reply, ReplyCB cb) { assertObjectNotNull("reply", reply); - assertConditionBeanNotNull(cb); + assertCBNotNull(cb); setupCommonColumnOfUpdateIfNeeds(reply); filterEntityOfUpdate(reply); assertEntityOfUpdate(reply); - return getMyDao().updateByQuery(cb, reply); + return invoke(createQueryUpdateEntityCBCommand(reply, cb)); } /** @@ -489,8 +486,8 @@ * @return The deleted count. */ public int queryDelete(ReplyCB cb) { - assertConditionBeanNotNull(cb); - return getMyDao().deleteByQuery(cb); + assertCBNotNull(cb); + return invoke(createQueryDeleteCBCommand(cb)); } //========================================================================== @@ -502,19 +499,27 @@ // ========= // Delegate Method // =============== + // [Behavior Command] // ----------------------------------------------------- // Select // ------ protected int delegateSelectCount(ReplyCB cb) { - assertConditionBeanNotNull(cb); - return getMyDao().selectCount(cb); + return invoke(createSelectCountCBCommand(cb)); } + protected int doCallReadCount(ConditionBean cb) { + return delegateSelectCount((ReplyCB) cb); + } + protected List delegateSelectList(ReplyCB cb) { - assertConditionBeanNotNull(cb); - return getMyDao().selectList(cb); + return invoke(createSelectListCBCommand(cb, Reply.class)); } + @SuppressWarnings("unchecked") + protected List doCallReadList(ConditionBean cb) { + return (List) delegateSelectList((ReplyCB) cb); + } + // ----------------------------------------------------- // Update // ------ @@ -522,38 +527,71 @@ if (!processBeforeInsert(e)) { return 1; } - return getMyDao().insert(e); + return invoke(createInsertEntityCommand(e)); } + protected int doCallCreate(Entity entity) { + return delegateInsert(downcast(entity)); + } + protected int delegateUpdate(Reply e) { if (!processBeforeUpdate(e)) { return 1; } - return getMyDao().updateModifiedOnly(e); + return invoke(createUpdateEntityCommand(e)); } + protected int doCallModify(Entity entity) { + return delegateUpdate(downcast(entity)); + } + protected int delegateDelete(Reply e) { if (!processBeforeDelete(e)) { return 1; } - return getMyDao().delete(e); + return invoke(createDeleteEntityCommand(e)); } + protected int doCallRemove(Entity entity) { + return delegateDelete(downcast(entity)); + } + protected int[] delegateInsertList(List ls) { - assertObjectNotNull("replyList", ls); - return getMyDao().insertList(helpFilterBeforeInsertInternally(ls)); + if (ls.isEmpty()) { + return new int[] {}; + } + return invoke(createBatchInsertEntityCommand(helpFilterBeforeInsertInternally(ls))); } + @SuppressWarnings("unchecked") + protected int[] doCreateList(List ls) { + return delegateInsertList((List) ls); + } + protected int[] delegateUpdateList(List ls) { - assertObjectNotNull("replyList", ls); - return getMyDao().updateList(helpFilterBeforeUpdateInternally(ls)); + if (ls.isEmpty()) { + return new int[] {}; + } + return invoke(createBatchUpdateEntityCommand(helpFilterBeforeUpdateInternally(ls))); } + @SuppressWarnings("unchecked") + protected int[] doModifyList(List ls) { + return delegateUpdateList((List) ls); + } + protected int[] delegateDeleteList(List ls) { - assertObjectNotNull("replyList", ls); - return getMyDao().deleteList(helpFilterBeforeDeleteInternally(ls)); + if (ls.isEmpty()) { + return new int[] {}; + } + return invoke(createBatchDeleteEntityCommand(helpFilterBeforeDeleteInternally(ls))); } + @SuppressWarnings("unchecked") + protected int[] doRemoveList(List ls) { + return delegateDeleteList((List) ls); + } + //========================================================================== // ========= // Optimistic Lock Info Modified: board/trunk/src/main/java/jp/sf/pal/board/db/bsbhv/BsRoleInfoBhv.java =================================================================== --- board/trunk/src/main/java/jp/sf/pal/board/db/bsbhv/BsRoleInfoBhv.java 2008-12-27 22:06:42 UTC (rev 1624) +++ board/trunk/src/main/java/jp/sf/pal/board/db/bsbhv/BsRoleInfoBhv.java 2008-12-27 22:09:08 UTC (rev 1625) @@ -1,9 +1,8 @@ package jp.sf.pal.board.db.bsbhv; import java.util.List; +import java.util.Map; -import jp.sf.pal.board.db.allcommon.DaoReadable; -import jp.sf.pal.board.db.allcommon.DaoWritable; import jp.sf.pal.board.db.allcommon.Entity; import jp.sf.pal.board.db.allcommon.bhv.load.LoadReferrerOption; import jp.sf.pal.board.db.allcommon.bhv.setup.ConditionBeanSetupper; @@ -22,13 +21,12 @@ import jp.sf.pal.board.db.cbean.UserInfoCB; import jp.sf.pal.board.db.exbhv.RoleMappingBhv; import jp.sf.pal.board.db.exbhv.UserInfoBhv; -import jp.sf.pal.board.db.exdao.RoleInfoDao; import jp.sf.pal.board.db.exentity.RoleInfo; import jp.sf.pal.board.db.exentity.RoleMapping; import jp.sf.pal.board.db.exentity.UserInfo; /** - * The behavior of ROLE_INFO. + * The behavior of ROLE_INFO that the type is TABLE.
* *
  * [primary-key]
@@ -73,12 +71,6 @@
 
     //==========================================================================
     // =========
-    // Attribute
-    // =========
-    protected RoleInfoDao _dao;
-
-    //==========================================================================
-    // =========
     // Table name
     // ==========
     /** @return The name on database of table. (NotNull) */
@@ -90,39 +82,18 @@
     // =========
     // DBMeta
     // ======
-    /** @return The meta data of the database. (NotNull) */
+    /** @return The instance of DBMeta. (NotNull) */
     public DBMeta getDBMeta() {
         return RoleInfoDbm.getInstance();
     }
 
-    /** @return The meta data of the database as my table type. (NotNull) */
+    /** @return The instance of DBMeta as my table type. (NotNull) */
     public RoleInfoDbm getMyDBMeta() {
         return RoleInfoDbm.getInstance();
     }
 
     //==========================================================================
     // =========
-    // Dao Accessor
-    // ============
-    public RoleInfoDao getMyDao() {
-        return _dao;
-    }
-
-    public void setMyDao(RoleInfoDao dao) {
-        assertObjectNotNull("dao", dao);
-        _dao = dao;
-    }
-
-    public DaoReadable getDaoReadable() {
-        return getMyDao();
-    }
-
-    public DaoWritable getDaoWritable() {
-        return getMyDao();
-    }
-
-    //==========================================================================
-    // =========
     // New Instance
     // ============
     public Entity newEntity() {
@@ -152,7 +123,7 @@
      * @return The selected count.
      */
     public int selectCount(RoleInfoCB cb) {
-        assertConditionBeanNotNull(cb);
+        assertCBNotNull(cb);
         return delegateSelectCount(cb);
     }
 
@@ -229,7 +200,7 @@
      * @return The result bean of selected list. (NotNull)
      */
     public ListResultBean selectList(RoleInfoCB cb) {
-        assertConditionBeanNotNull(cb);
+        assertCBNotNull(cb);
         return new ResultBeanBuilder(getTableDbName())
                 .buildListResultBean(cb, delegateSelectList(cb));
     }
@@ -245,7 +216,7 @@
      * @return The result bean of selected page. (NotNull)
      */
     public PagingResultBean selectPage(final RoleInfoCB cb) {
-        assertConditionBeanNotNull(cb);
+        assertCBNotNull(cb);
         final PagingInvoker invoker = new PagingInvoker(
                 getTableDbName());
         final PagingHandler handler = new PagingHandler() {
@@ -266,6 +237,32 @@
 
     //==========================================================================
     // =========
+    // Scalar Select
+    // =============
+    /**
+     * Select the scalar value derived by a function. 
Call a function + * method after this method called like as follows: + * + *
+     * roleInfoBhv.scalarSelect(Date.class).max(new ScalarQuery(RoleInfoCB cb) {
+     *     cb.specify().columnXxxDatetime(); // the required specification of target column
+     *     cb.query().setXxxName_PrefixSearch("S"); // query as you like it
+     * });
+     * 
+ * + * @param The type of result. + * @param resultType The type of result. (NotNull) + * @return The scalar value derived by a function. (Nullable) + */ + public SLFunction scalarSelect( + Class resultType) { + RoleInfoCB cb = newMyConditionBean(); + cb.xsetupForScalarSelect(); + return new SLFunction(cb, resultType); + } + + //========================================================================== + // ========= // Various Select // ============== /** @@ -275,8 +272,8 @@ * @param valueLabelSetupper The setupper of value-label. (NotNull) * @return The list of value-label. (NotNull) */ - public List> selectValueLabelList( - RoleInfoCB cb, ValueLabelSetupper valueLabelSetupper) { + public List> selectValueLabelList(RoleInfoCB cb, + ValueLabelSetupper valueLabelSetupper) { return createValueLabelList(selectList(cb), valueLabelSetupper); } @@ -467,8 +464,8 @@ //========================================================================== // ========= - // Pullout Foreign - // =============== + // Pull out Foreign + // ================ //========================================================================== // ========= @@ -764,11 +761,11 @@ */ public int queryUpdate(RoleInfo roleInfo, RoleInfoCB cb) { assertObjectNotNull("roleInfo", roleInfo); - assertConditionBeanNotNull(cb); + assertCBNotNull(cb); setupCommonColumnOfUpdateIfNeeds(roleInfo); filterEntityOfUpdate(roleInfo); assertEntityOfUpdate(roleInfo); - return getMyDao().updateByQuery(cb, roleInfo); + return invoke(createQueryUpdateEntityCBCommand(roleInfo, cb)); } /** @@ -778,8 +775,8 @@ * @return The deleted count. */ public int queryDelete(RoleInfoCB cb) { - assertConditionBeanNotNull(cb); - return getMyDao().deleteByQuery(cb); + assertCBNotNull(cb); + return invoke(createQueryDeleteCBCommand(cb)); } //========================================================================== @@ -791,19 +788,27 @@ // ========= // Delegate Method // =============== + // [Behavior Command] // ----------------------------------------------------- // Select // ------ protected int delegateSelectCount(RoleInfoCB cb) { - assertConditionBeanNotNull(cb); - return getMyDao().selectCount(cb); + return invoke(createSelectCountCBCommand(cb)); } + protected int doCallReadCount(ConditionBean cb) { + return delegateSelectCount((RoleInfoCB) cb); + } + protected List delegateSelectList(RoleInfoCB cb) { - assertConditionBeanNotNull(cb); - return getMyDao().selectList(cb); + return invoke(createSelectListCBCommand(cb, RoleInfo.class)); } + @SuppressWarnings("unchecked") + protected List doCallReadList(ConditionBean cb) { + return (List) delegateSelectList((RoleInfoCB) cb); + } + // ----------------------------------------------------- // Update // ------ @@ -811,62 +816,97 @@ if (!processBeforeInsert(e)) { return 1; } - return getMyDao().insert(e); + return invoke(createInsertEntityCommand(e)); } + protected int doCallCreate(Entity entity) { + return delegateInsert(downcast(entity)); + } + protected int delegateUpdate(RoleInfo e) { if (!processBeforeUpdate(e)) { return 1; } - return getMyDao().updateModifiedOnly(e); + return invoke(createUpdateEntityCommand(e)); } + protected int doCallModify(Entity entity) { + return delegateUpdate(downcast(entity)); + } + protected int delegateUpdateNonstrict(RoleInfo e) { if (!processBeforeUpdate(e)) { return 1; } - return getMyDao().updateNonstrictModifiedOnly(e); + return invoke(createUpdateNonstrictEntityCommand(e)); } protected int delegateDelete(RoleInfo e) { if (!processBeforeDelete(e)) { return 1; } - return getMyDao().delete(e); + return invoke(createDeleteEntityCommand(e)); } + protected int doCallRemove(Entity entity) { + return delegateDelete(downcast(entity)); + } + protected int delegateDeleteNonstrict(RoleInfo e) { if (!processBeforeDelete(e)) { return 1; } - return getMyDao().deleteNonstrict(e); + return invoke(createDeleteNonstrictEntityCommand(e)); } protected int[] delegateInsertList(List ls) { - assertObjectNotNull("roleInfoList", ls); - return getMyDao().insertList(helpFilterBeforeInsertInternally(ls)); + if (ls.isEmpty()) { + return new int[] {}; + } + return invoke(createBatchInsertEntityCommand(helpFilterBeforeInsertInternally(ls))); } + @SuppressWarnings("unchecked") + protected int[] doCreateList(List ls) { + return delegateInsertList((List) ls); + } + protected int[] delegateUpdateList(List ls) { - assertObjectNotNull("roleInfoList", ls); - return getMyDao().updateList(helpFilterBeforeUpdateInternally(ls)); + if (ls.isEmpty()) { + return new int[] {}; + } + return invoke(createBatchUpdateEntityCommand(helpFilterBeforeUpdateInternally(ls))); } + @SuppressWarnings("unchecked") + protected int[] doModifyList(List ls) { + return delegateUpdateList((List) ls); + } + protected int[] delegateUpdateListNonstrict(List ls) { - assertObjectNotNull("roleInfoList", ls); - return getMyDao().updateListNonstrict( - helpFilterBeforeUpdateInternally(ls)); + if (ls.isEmpty()) { + return new int[] {}; + } + return invoke(createBatchUpdateNonstrictEntityCommand(helpFilterBeforeUpdateInternally(ls))); } protected int[] delegateDeleteList(List ls) { - assertObjectNotNull("roleInfoList", ls); - return getMyDao().deleteList(helpFilterBeforeDeleteInternally(ls)); + if (ls.isEmpty()) { + return new int[] {}; + } + return invoke(createBatchDeleteEntityCommand(helpFilterBeforeDeleteInternally(ls))); } + @SuppressWarnings("unchecked") + protected int[] doRemoveList(List ls) { + return delegateDeleteList((List) ls); + } + protected int[] delegateDeleteListNonstrict(List ls) { - assertObjectNotNull("roleInfoList", ls); - return getMyDao().deleteListNonstrict( - helpFilterBeforeDeleteInternally(ls)); + if (ls.isEmpty()) { + return new int[] {}; + } + return invoke(createBatchDeleteNonstrictEntityCommand(helpFilterBeforeDeleteInternally(ls))); } //========================================================================== Modified: board/trunk/src/main/java/jp/sf/pal/board/db/bsbhv/BsRoleMappingBhv.java =================================================================== --- board/trunk/src/main/java/jp/sf/pal/board/db/bsbhv/BsRoleMappingBhv.java 2008-12-27 22:06:42 UTC (rev 1624) +++ board/trunk/src/main/java/jp/sf/pal/board/db/bsbhv/BsRoleMappingBhv.java 2008-12-27 22:09:08 UTC (rev 1625) @@ -1,9 +1,8 @@ package jp.sf.pal.board.db.bsbhv; import java.util.List; +import java.util.Map; -import jp.sf.pal.board.db.allcommon.DaoReadable; -import jp.sf.pal.board.db.allcommon.DaoWritable; import jp.sf.pal.board.db.allcommon.Entity; import jp.sf.pal.board.db.allcommon.bhv.setup.ValueLabelSetupper; import jp.sf.pal.board.db.allcommon.cbean.ConditionBean; @@ -16,13 +15,12 @@ import jp.sf.pal.board.db.allcommon.dbmeta.DBMeta; import jp.sf.pal.board.db.bsentity.dbmeta.RoleMappingDbm; import jp.sf.pal.board.db.cbean.RoleMappingCB; -import jp.sf.pal.board.db.exdao.RoleMappingDao; import jp.sf.pal.board.db.exentity.RoleInfo; import jp.sf.pal.board.db.exentity.RoleMapping; import jp.sf.pal.board.db.exentity.UserInfo; /** - * The behavior of ROLE_MAPPING. + * The behavior of ROLE_MAPPING that the type is TABLE.
* *
  * [primary-key]
@@ -67,12 +65,6 @@
 
     //==========================================================================
     // =========
-    // Attribute
-    // =========
-    protected RoleMappingDao _dao;
-
-    //==========================================================================
-    // =========
     // Table name
     // ==========
     /** @return The name on database of table. (NotNull) */
@@ -84,39 +76,18 @@
     // =========
     // DBMeta
     // ======
-    /** @return The meta data of the database. (NotNull) */
+    /** @return The instance of DBMeta. (NotNull) */
     public DBMeta getDBMeta() {
         return RoleMappingDbm.getInstance();
     }
 
-    /** @return The meta data of the database as my table type. (NotNull) */
+    /** @return The instance of DBMeta as my table type. (NotNull) */
     public RoleMappingDbm getMyDBMeta() {
         return RoleMappingDbm.getInstance();
     }
 
     //==========================================================================
     // =========
-    // Dao Accessor
-    // ============
-    public RoleMappingDao getMyDao() {
-        return _dao;
-    }
-
-    public void setMyDao(RoleMappingDao dao) {
-        assertObjectNotNull("dao", dao);
-        _dao = dao;
-    }
-
-    public DaoReadable getDaoReadable() {
-        return getMyDao();
-    }
-
-    public DaoWritable getDaoWritable() {
-        return getMyDao();
-    }
-
-    //==========================================================================
-    // =========
     // New Instance
     // ============
     public Entity newEntity() {
@@ -146,7 +117,7 @@
      * @return The selected count.
      */
     public int selectCount(RoleMappingCB cb) {
-        assertConditionBeanNotNull(cb);
+        assertCBNotNull(cb);
         return delegateSelectCount(cb);
     }
 
@@ -223,7 +194,7 @@
      * @return The result bean of selected list. (NotNull)
      */
     public ListResultBean selectList(RoleMappingCB cb) {
-        assertConditionBeanNotNull(cb);
+        assertCBNotNull(cb);
         return new ResultBeanBuilder(getTableDbName())
                 .buildListResultBean(cb, delegateSelectList(cb));
     }
@@ -239,7 +210,7 @@
      * @return The result bean of selected page. (NotNull)
      */
     public PagingResultBean selectPage(final RoleMappingCB cb) {
-        assertConditionBeanNotNull(cb);
+        assertCBNotNull(cb);
         final PagingInvoker invoker = new PagingInvoker(
                 getTableDbName());
         final PagingHandler handler = new PagingHandler() {
@@ -260,6 +231,32 @@
 
     //==========================================================================
     // =========
+    // Scalar Select
+    // =============
+    /**
+     * Select the scalar value derived by a function. 
Call a function + * method after this method called like as follows: + * + *
+     * roleMappingBhv.scalarSelect(Date.class).max(new ScalarQuery(RoleMappingCB cb) {
+     *     cb.specify().columnXxxDatetime(); // the required specification of target column
+     *     cb.query().setXxxName_PrefixSearch("S"); // query as you like it
+     * });
+     * 
+ * + * @param The type of result. + * @param resultType The type of result. (NotNull) + * @return The scalar value derived by a function. (Nullable) + */ + public SLFunction scalarSelect( + Class resultType) { + RoleMappingCB cb = newMyConditionBean(); + cb.xsetupForScalarSelect(); + return new SLFunction(cb, resultType); + } + + //========================================================================== + // ========= // Various Select // ============== /** @@ -269,8 +266,8 @@ * @param valueLabelSetupper The setupper of value-label. (NotNull) * @return The list of value-label. (NotNull) */ - public List> selectValueLabelList( - RoleMappingCB cb, ValueLabelSetupper valueLabelSetupper) { + public List> selectValueLabelList(RoleMappingCB cb, + ValueLabelSetupper valueLabelSetupper) { return createValueLabelList(selectList(cb), valueLabelSetupper); } @@ -281,8 +278,8 @@ //========================================================================== // ========= - // Pullout Foreign - // =============== + // Pull out Foreign + // ================ /** * Pull out the list of foreign table 'RoleInfo'. * @@ -494,11 +491,11 @@ */ public int queryUpdate(RoleMapping roleMapping, RoleMappingCB cb) { assertObjectNotNull("roleMapping", roleMapping); - assertConditionBeanNotNull(cb); + assertCBNotNull(cb); setupCommonColumnOfUpdateIfNeeds(roleMapping); filterEntityOfUpdate(roleMapping); assertEntityOfUpdate(roleMapping); - return getMyDao().updateByQuery(cb, roleMapping); + return invoke(createQueryUpdateEntityCBCommand(roleMapping, cb)); } /** @@ -508,8 +505,8 @@ * @return The deleted count. */ public int queryDelete(RoleMappingCB cb) { - assertConditionBeanNotNull(cb); - return getMyDao().deleteByQuery(cb); + assertCBNotNull(cb); + return invoke(createQueryDeleteCBCommand(cb)); } //========================================================================== @@ -521,19 +518,27 @@ // ========= // Delegate Method // =============== + // [Behavior Command] // ----------------------------------------------------- // Select // ------ protected int delegateSelectCount(RoleMappingCB cb) { - assertConditionBeanNotNull(cb); - return getMyDao().selectCount(cb); + return invoke(createSelectCountCBCommand(cb)); } + protected int doCallReadCount(ConditionBean cb) { + return delegateSelectCount((RoleMappingCB) cb); + } + protected List delegateSelectList(RoleMappingCB cb) { - assertConditionBeanNotNull(cb); - return getMyDao().selectList(cb); + return invoke(createSelectListCBCommand(cb, RoleMapping.class)); } + @SuppressWarnings("unchecked") + protected List doCallReadList(ConditionBean cb) { + return (List) delegateSelectList((RoleMappingCB) cb); + } + // ----------------------------------------------------- // Update // ------ @@ -541,38 +546,71 @@ if (!processBeforeInsert(e)) { return 1; } - return getMyDao().insert(e); + return invoke(createInsertEntityCommand(e)); } + protected int doCallCreate(Entity entity) { + return delegateInsert(downcast(entity)); + } + protected int delegateUpdate(RoleMapping e) { if (!processBeforeUpdate(e)) { return 1; } - return getMyDao().updateModifiedOnly(e); + return invoke(createUpdateEntityCommand(e)); } + protected int doCallModify(Entity entity) { + return delegateUpdate(downcast(entity)); + } + protected int delegateDelete(RoleMapping e) { if (!processBeforeDelete(e)) { return 1; } - return getMyDao().delete(e); + return invoke(createDeleteEntityCommand(e)); } + protected int doCallRemove(Entity entity) { + return delegateDelete(downcast(entity)); + } + protected int[] delegateInsertList(List ls) { - assertObjectNotNull("roleMappingList", ls); - return getMyDao().insertList(helpFilterBeforeInsertInternally(ls)); + if (ls.isEmpty()) { + return new int[] {}; + } + return invoke(createBatchInsertEntityCommand(helpFilterBeforeInsertInternally(ls))); } + @SuppressWarnings("unchecked") + protected int[] doCreateList(List ls) { + return delegateInsertList((List) ls); + } + protected int[] delegateUpdateList(List ls) { - assertObjectNotNull("roleMappingList", ls); - return getMyDao().updateList(helpFilterBeforeUpdateInternally(ls)); + if (ls.isEmpty()) { + return new int[] {}; + } + return invoke(createBatchUpdateEntityCommand(helpFilterBeforeUpdateInternally(ls))); } + @SuppressWarnings("unchecked") + protected int[] doModifyList(List ls) { + return delegateUpdateList((List) ls); + } + protected int[] delegateDeleteList(List ls) { - assertObjectNotNull("roleMappingList", ls); - return getMyDao().deleteList(helpFilterBeforeDeleteInternally(ls)); + if (ls.isEmpty()) { + return new int[] {}; + } + return invoke(createBatchDeleteEntityCommand(helpFilterBeforeDeleteInternally(ls))); } + @SuppressWarnings("unchecked") + protected int[] doRemoveList(List ls) { + return delegateDeleteList((List) ls); + } + //========================================================================== // ========= // Optimistic Lock Info Modified: board/trunk/src/main/java/jp/sf/pal/board/db/bsbhv/BsUserInfoBhv.java =================================================================== --- board/trunk/src/main/java/jp/sf/pal/board/db/bsbhv/BsUserInfoBhv.java 2008-12-27 22:06:42 UTC (rev 1624) +++ board/trunk/src/main/java/jp/sf/pal/board/db/bsbhv/BsUserInfoBhv.java 2008-12-27 22:09:08 UTC (rev 1625) @@ -1,9 +1,8 @@ package jp.sf.pal.board.db.bsbhv; import java.util.List; +import java.util.Map; -import jp.sf.pal.board.db.allcommon.DaoReadable; -import jp.sf.pal.board.db.allcommon.DaoWritable; import jp.sf.pal.board.db.allcommon.Entity; import jp.sf.pal.board.db.allcommon.bhv.load.LoadReferrerOption; import jp.sf.pal.board.db.allcommon.bhv.setup.ConditionBeanSetupper; @@ -22,7 +21,6 @@ import jp.sf.pal.board.db.cbean.UserInfoCB; import jp.sf.pal.board.db.exbhv.GroupMappingBhv; import jp.sf.pal.board.db.exbhv.RoleMappingBhv; -import jp.sf.pal.board.db.exdao.UserInfoDao; import jp.sf.pal.board.db.exentity.GroupInfo; import jp.sf.pal.board.db.exentity.GroupMapping; import jp.sf.pal.board.db.exentity.RoleInfo; @@ -30,14 +28,14 @@ import jp.sf.pal.board.db.exentity.UserInfo; /** - * The behavior of USER_INFO. + * The behavior of USER_INFO that the type is TABLE.
* *
  * [primary-key]
  *     USER_ID
  * 
  * [column]
- *     USER_ID, GIVEN_NAME, FAMILY_NAME, MIDDLE_NAME, GIVEN_NAME_DESC, FAMILY_NAME_DESC, NICKNAME, GENDER, BIRTH_DATE, EMAIL, URL, TELEPHONE, LOCALE, ROLE_ID, GROUP_ID, CREATED_TIME, CREATED_BY, UPDATED_TIME, UPDATED_BY, DELETED_TIME, DELETED_BY, VERSIONNO
+ *     USER_ID, GIVEN_NAME, FAMILY_NAME, MIDDLE_NAME, GIVEN_NAME_DESC, FAMILY_NAME_DESC, NICKNAME, GENDER, BIRTH_DATE, EMAIL, URL, TELEPHONE, LOCALE, ROLE_ID, GROUP_ID, STATUS, CREATED_TIME, CREATED_BY, UPDATED_TIME, UPDATED_BY, DELETED_TIME, DELETED_BY, VERSIONNO
  * 
  * [sequence]
  *     
@@ -75,12 +73,6 @@
 
     //==========================================================================
     // =========
-    // Attribute
-    // =========
-    protected UserInfoDao _dao;
-
-    //==========================================================================
-    // =========
     // Table name
     // ==========
     /** @return The name on database of table. (NotNull) */
@@ -92,39 +84,18 @@
     // =========
     // DBMeta
     // ======
-    /** @return The meta data of the database. (NotNull) */
+    /** @return The instance of DBMeta. (NotNull) */
     public DBMeta getDBMeta() {
         return UserInfoDbm.getInstance();
     }
 
-    /** @return The meta data of the database as my table type. (NotNull) */
+    /** @return The instance of DBMeta as my table type. (NotNull) */
     public UserInfoDbm getMyDBMeta() {
         return UserInfoDbm.getInstance();
     }
 
     //==========================================================================
     // =========
-    // Dao Accessor
-    // ============
-    public UserInfoDao getMyDao() {
-        return _dao;
-    }
-
-    public void setMyDao(UserInfoDao dao) {
-        assertObjectNotNull("dao", dao);
-        _dao = dao;
-    }
-
-    public DaoReadable getDaoReadable() {
-        return getMyDao();
-    }
-
-    public DaoWritable getDaoWritable() {
-        return getMyDao();
-    }
-
-    //==========================================================================
-    // =========
     // New Instance
     // ============
     public Entity newEntity() {
@@ -154,7 +125,7 @@
      * @return The selected count.
      */
     public int selectCount(UserInfoCB cb) {
-        assertConditionBeanNotNull(cb);
+        assertCBNotNull(cb);
         return delegateSelectCount(cb);
     }
 
@@ -231,7 +202,7 @@
      * @return The result bean of selected list. (NotNull)
      */
     public ListResultBean selectList(UserInfoCB cb) {
-        assertConditionBeanNotNull(cb);
+        assertCBNotNull(cb);
         return new ResultBeanBuilder(getTableDbName())
                 .buildListResultBean(cb, delegateSelectList(cb));
     }
@@ -247,7 +218,7 @@
      * @return The result bean of selected page. (NotNull)
      */
     public PagingResultBean selectPage(final UserInfoCB cb) {
-        assertConditionBeanNotNull(cb);
+        assertCBNotNull(cb);
         final PagingInvoker invoker = new PagingInvoker(
                 getTableDbName());
         final PagingHandler handler = new PagingHandler() {
@@ -268,6 +239,32 @@
 
     //==========================================================================
     // =========
+    // Scalar Select
+    // =============
+    /**
+     * Select the scalar value derived by a function. 
Call a function + * method after this method called like as follows: + * + *
+     * userInfoBhv.scalarSelect(Date.class).max(new ScalarQuery(UserInfoCB cb) {
+     *     cb.specify().columnXxxDatetime(); // the required specification of target column
+     *     cb.query().setXxxName_PrefixSearch("S"); // query as you like it
+     * });
+     * 
+ * + * @param The type of result. + * @param resultType The type of result. (NotNull) + * @return The scalar value derived by a function. (Nullable) + */ + public SLFunction scalarSelect( + Class resultType) { + UserInfoCB cb = newMyConditionBean(); + cb.xsetupForScalarSelect(); + return new SLFunction(cb, resultType); + } + + //========================================================================== + // ========= // Various Select // ============== /** @@ -277,8 +274,8 @@ * @param valueLabelSetupper The setupper of value-label. (NotNull) * @return The list of value-label. (NotNull) */ - public List> selectValueLabelList( - UserInfoCB cb, ValueLabelSetupper valueLabelSetupper) { + public List> selectValueLabelList(UserInfoCB cb, + ValueLabelSetupper valueLabelSetupper) { return createValueLabelList(selectList(cb), valueLabelSetupper); } @@ -470,8 +467,8 @@ //========================================================================== // ========= - // Pullout Foreign - // =============== + // Pull out Foreign + // ================ /** * Pull out the list of foreign table 'GroupInfo'. * @@ -796,11 +793,11 @@ */ public int queryUpdate(UserInfo userInfo, UserInfoCB cb) { assertObjectNotNull("userInfo", userInfo); - assertConditionBeanNotNull(cb); + assertCBNotNull(cb); setupCommonColumnOfUpdateIfNeeds(userInfo); filterEntityOfUpdate(userInfo); assertEntityOfUpdate(userInfo); - return getMyDao().updateByQuery(cb, userInfo); + return invoke(createQueryUpdateEntityCBCommand(userInfo, cb)); } /** @@ -810,8 +807,8 @@ * @return The deleted count. */ public int queryDelete(UserInfoCB cb) { - assertConditionBeanNotNull(cb); - return getMyDao().deleteByQuery(cb); + assertCBNotNull(cb); + return invoke(createQueryDeleteCBCommand(cb)); } //========================================================================== @@ -823,19 +820,27 @@ // ========= // Delegate Method // =============== + // [Behavior Command] // ----------------------------------------------------- // Select // ------ protected int delegateSelectCount(UserInfoCB cb) { - assertConditionBeanNotNull(cb); - return getMyDao().selectCount(cb); + return invoke(createSelectCountCBCommand(cb)); } + protected int doCallReadCount(ConditionBean cb) { + return delegateSelectCount((UserInfoCB) cb); + } + protected List delegateSelectList(UserInfoCB cb) { - assertConditionBeanNotNull(cb); - return getMyDao().selectList(cb); + return invoke(createSelectListCBCommand(cb, UserInfo.class)); } + @SuppressWarnings("unchecked") + protected List doCallReadList(ConditionBean cb) { + return (List) delegateSelectList((UserInfoCB) cb); + } + // ----------------------------------------------------- // Update // ------ @@ -843,62 +848,97 @@ if (!processBeforeInsert(e)) { return 1; } - return getMyDao().insert(e); + return invoke(createInsertEntityCommand(e)); } + protected int doCallCreate(Entity entity) { + return delegateInsert(downcast(entity)); + } + protected int delegateUpdate(UserInfo e) { if (!processBeforeUpdate(e)) { return 1; } - return getMyDao().updateModifiedOnly(e); + return invoke(createUpdateEntityCommand(e)); } + protected int doCallModify(Entity entity) { + return delegateUpdate(downcast(entity)); + } + protected int delegateUpdateNonstrict(UserInfo e) { if (!processBeforeUpdate(e)) { return 1; } - return getMyDao().updateNonstrictModifiedOnly(e); + return invoke(createUpdateNonstrictEntityCommand(e)); } protected int delegateDelete(UserInfo e) { if (!processBeforeDelete(e)) { return 1; } - return getMyDao().delete(e); + return invoke(createDeleteEntityCommand(e)); } + protected int doCallRemove(Entity entity) { + return delegateDelete(downcast(entity)); + } + protected int delegateDeleteNonstrict(UserInfo e) { if (!processBeforeDelete(e)) { return 1; } - return getMyDao().deleteNonstrict(e); + return invoke(createDeleteNonstrictEntityCommand(e)); } protected int[] delegateInsertList(List ls) { - assertObjectNotNull("userInfoList", ls); - return getMyDao().insertList(helpFilterBeforeInsertInternally(ls)); + if (ls.isEmpty()) { + return new int[] {}; + } + return invoke(createBatchInsertEntityCommand(helpFilterBeforeInsertInternally(ls))); } + @SuppressWarnings("unchecked") + protected int[] doCreateList(List ls) { + return delegateInsertList((List) ls); + } + protected int[] delegateUpdateList(List ls) { - assertObjectNotNull("userInfoList", ls); - return getMyDao().updateList(helpFilterBeforeUpdateInternally(ls)); + if (ls.isEmpty()) { + return new int[] {}; + } + return invoke(createBatchUpdateEntityCommand(helpFilterBeforeUpdateInternally(ls))); } + @SuppressWarnings("unchecked") + protected int[] doModifyList(List ls) { + return delegateUpdateList((List) ls); + } + protected int[] delegateUpdateListNonstrict(List ls) { - assertObjectNotNull("userInfoList", ls); - return getMyDao().updateListNonstrict( - helpFilterBeforeUpdateInternally(ls)); + if (ls.isEmpty()) { + return new int[] {}; + } + return invoke(createBatchUpdateNonstrictEntityCommand(helpFilterBeforeUpdateInternally(ls))); } protected int[] delegateDeleteList(List ls) { - assertObjectNotNull("userInfoList", ls); - return getMyDao().deleteList(helpFilterBeforeDeleteInternally(ls)); + if (ls.isEmpty()) { + return new int[] {}; + } + return invoke(createBatchDeleteEntityCommand(helpFilterBeforeDeleteInternally(ls))); } + @SuppressWarnings("unchecked") + protected int[] doRemoveList(List ls) { + return delegateDeleteList((List) ls); + } + protected int[] delegateDeleteListNonstrict(List ls) { - assertObjectNotNull("userInfoList", ls); - return getMyDao().deleteListNonstrict( - helpFilterBeforeDeleteInternally(ls)); + if (ls.isEmpty()) { + return new int[] {}; + } + return invoke(createBatchDeleteNonstrictEntityCommand(helpFilterBeforeDeleteInternally(ls))); } //========================================================================== Modified: board/trunk/src/main/java/jp/sf/pal/board/db/bsentity/BsAttachment.java =================================================================== --- board/trunk/src/main/java/jp/sf/pal/board/db/bsentity/BsAttachment.java 2008-12-27 22:06:42 UTC (rev 1624) +++ board/trunk/src/main/java/jp/sf/pal/board/db/bsentity/BsAttachment.java 2008-12-27 22:09:08 UTC (rev 1625) @@ -43,7 +43,6 @@ * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public abstract class BsAttachment implements Entity, java.io.Serializable { //========================================================================== Modified: board/trunk/src/main/java/jp/sf/pal/board/db/bsentity/BsCategory.java =================================================================== --- board/trunk/src/main/java/jp/sf/pal/board/db/bsentity/BsCategory.java 2008-12-27 22:06:42 UTC (rev 1624) +++ board/trunk/src/main/java/jp/sf/pal/board/db/bsentity/BsCategory.java 2008-12-27 22:09:08 UTC (rev 1625) @@ -44,7 +44,6 @@ * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public abstract class BsCategory implements Entity, java.io.Serializable { //========================================================================== Modified: board/trunk/src/main/java/jp/sf/pal/board/db/bsentity/BsCategoryAccess.java =================================================================== --- board/trunk/src/main/java/jp/sf/pal/board/db/bsentity/BsCategoryAccess.java 2008-12-27 22:06:42 UTC (rev 1624) +++ board/trunk/src/main/java/jp/sf/pal/board/db/bsentity/BsCategoryAccess.java 2008-12-27 22:09:08 UTC (rev 1625) @@ -41,7 +41,6 @@ * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public abstract class BsCategoryAccess implements Entity, java.io.Serializable { //========================================================================== Modified: board/trunk/src/main/java/jp/sf/pal/board/db/bsentity/BsGroupInfo.java =================================================================== --- board/trunk/src/main/java/jp/sf/pal/board/db/bsentity/BsGroupInfo.java 2008-12-27 22:06:42 UTC (rev 1624) +++ board/trunk/src/main/java/jp/sf/pal/board/db/bsentity/BsGroupInfo.java 2008-12-27 22:09:08 UTC (rev 1625) @@ -44,7 +44,6 @@ * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public abstract class BsGroupInfo implements Entity, java.io.Serializable { //========================================================================== Modified: board/trunk/src/main/java/jp/sf/pal/board/db/bsentity/BsGroupMapping.java =================================================================== --- board/trunk/src/main/java/jp/sf/pal/board/db/bsentity/BsGroupMapping.java 2008-12-27 22:06:42 UTC (rev 1624) +++ board/trunk/src/main/java/jp/sf/pal/board/db/bsentity/BsGroupMapping.java 2008-12-27 22:09:08 UTC (rev 1625) @@ -42,7 +42,6 @@ * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public abstract class BsGroupMapping implements Entity, java.io.Serializable { //========================================================================== Modified: board/trunk/src/main/java/jp/sf/pal/board/db/bsentity/BsMessage.java =================================================================== --- board/trunk/src/main/java/jp/sf/pal/board/db/bsentity/BsMessage.java 2008-12-27 22:06:42 UTC (rev 1624) +++ board/trunk/src/main/java/jp/sf/pal/board/db/bsentity/BsMessage.java 2008-12-27 22:09:08 UTC (rev 1625) @@ -46,7 +46,6 @@ * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public abstract class BsMessage implements Entity, java.io.Serializable { //========================================================================== Modified: board/trunk/src/main/java/jp/sf/pal/board/db/bsentity/BsMessageAttachment.java =================================================================== --- board/trunk/src/main/java/jp/sf/pal/board/db/bsentity/BsMessageAttachment.java 2008-12-27 22:06:42 UTC (rev 1624) +++ board/trunk/src/main/java/jp/sf/pal/board/db/bsentity/BsMessageAttachment.java 2008-12-27 22:09:08 UTC (rev 1625) @@ -42,7 +42,6 @@ * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public abstract class BsMessageAttachment implements Entity, java.io.Serializable { Modified: board/trunk/src/main/java/jp/sf/pal/board/db/bsentity/BsMessageContent.java =================================================================== --- board/trunk/src/main/java/jp/sf/pal/board/db/bsentity/BsMessageContent.java 2008-12-27 22:06:42 UTC (rev 1624) +++ board/trunk/src/main/java/jp/sf/pal/board/db/bsentity/BsMessageContent.java 2008-12-27 22:09:08 UTC (rev 1625) @@ -41,7 +41,6 @@ * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public abstract class BsMessageContent implements Entity, java.io.Serializable { //========================================================================== Modified: board/trunk/src/main/java/jp/sf/pal/board/db/bsentity/BsReply.java =================================================================== --- board/trunk/src/main/java/jp/sf/pal/board/db/bsentity/BsReply.java 2008-12-27 22:06:42 UTC (rev 1624) +++ board/trunk/src/main/java/jp/sf/pal/board/db/bsentity/BsReply.java 2008-12-27 22:09:08 UTC (rev 1625) @@ -41,7 +41,6 @@ * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public abstract class BsReply implements Entity, java.io.Serializable { //========================================================================== Modified: board/trunk/src/main/java/jp/sf/pal/board/db/bsentity/BsRoleInfo.java =================================================================== --- board/trunk/src/main/java/jp/sf/pal/board/db/bsentity/BsRoleInfo.java 2008-12-27 22:06:42 UTC (rev 1624) +++ board/trunk/src/main/java/jp/sf/pal/board/db/bsentity/BsRoleInfo.java 2008-12-27 22:09:08 UTC (rev 1625) @@ -44,7 +44,6 @@ * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public abstract class BsRoleInfo implements Entity, java.io.Serializable { //========================================================================== Modified: board/trunk/src/main/java/jp/sf/pal/board/db/bsentity/BsRoleMapping.java =================================================================== --- board/trunk/src/main/java/jp/sf/pal/board/db/bsentity/BsRoleMapping.java 2008-12-27 22:06:42 UTC (rev 1624) +++ board/trunk/src/main/java/jp/sf/pal/board/db/bsentity/BsRoleMapping.java 2008-12-27 22:09:08 UTC (rev 1625) @@ -42,7 +42,6 @@ * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public abstract class BsRoleMapping implements Entity, java.io.Serializable { //========================================================================== Modified: board/trunk/src/main/java/jp/sf/pal/board/db/bsentity/BsUserInfo.java =================================================================== --- board/trunk/src/main/java/jp/sf/pal/board/db/bsentity/BsUserInfo.java 2008-12-27 22:06:42 UTC (rev 1624) +++ board/trunk/src/main/java/jp/sf/pal/board/db/bsentity/BsUserInfo.java 2008-12-27 22:09:08 UTC (rev 1625) @@ -20,7 +20,7 @@ * USER_ID * * [column] - * USER_ID, GIVEN_NAME, FAMILY_NAME, MIDDLE_NAME, GIVEN_NAME_DESC, FAMILY_NAME_DESC, NICKNAME, GENDER, BIRTH_DATE, EMAIL, URL, TELEPHONE, LOCALE, ROLE_ID, GROUP_ID, CREATED_TIME, CREATED_BY, UPDATED_TIME, UPDATED_BY, DELETED_TIME, DELETED_BY, VERSIONNO + * USER_ID, GIVEN_NAME, FAMILY_NAME, MIDDLE_NAME, GIVEN_NAME_DESC, FAMILY_NAME_DESC, NICKNAME, GENDER, BIRTH_DATE, EMAIL, URL, TELEPHONE, LOCALE, ROLE_ID, GROUP_ID, STATUS, CREATED_TIME, CREATED_BY, UPDATED_TIME, UPDATED_BY, DELETED_TIME, DELETED_BY, VERSIONNO * * [sequence] * @@ -46,7 +46,6 @@ * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public abstract class BsUserInfo implements Entity, java.io.Serializable { //========================================================================== @@ -114,6 +113,9 @@ /** GROUP_ID: {VARCHAR(255) : FK to GROUP_INFO} */ protected String _groupId; + /** STATUS: {VARCHAR(1)} */ + protected String _status; + /** CREATED_TIME: {NotNull : TIMESTAMP} */ protected java.sql.Timestamp _createdTime; @@ -401,6 +403,7 @@ sb.append(delimiter).append(getLocale()); sb.append(delimiter).append(getRoleId()); sb.append(delimiter).append(getGroupId()); + sb.append(delimiter).append(getStatus()); sb.append(delimiter).append(getCreatedTime()); sb.append(delimiter).append(getCreatedBy()); sb.append(delimiter).append(getUpdatedTime()); @@ -752,6 +755,28 @@ this._groupId = groupId; } + /** The column annotation for S2Dao. {VARCHAR(1)} */ + public static final String status_COLUMN = "STATUS"; + + /** + * STATUS: {VARCHAR(1)}
+ * + * @return The value of the column 'STATUS'. (Nullable) + */ + public String getStatus() { + return _status; + } + + /** + * STATUS: {VARCHAR(1)}
+ * + * @param status The value of the column 'STATUS'. (Nullable) + */ + public void setStatus(String status) { + _modifiedProperties.addPropertyName("status"); + this._status = status; + } + /** The column annotation for S2Dao. {NotNull : TIMESTAMP} */ public static final String createdTime_COLUMN = "CREATED_TIME"; Modified: board/trunk/src/main/java/jp/sf/pal/board/db/bsentity/dbmeta/AttachmentDbm.java =================================================================== --- board/trunk/src/main/java/jp/sf/pal/board/db/bsentity/dbmeta/AttachmentDbm.java 2008-12-27 22:06:42 UTC (rev 1624) +++ board/trunk/src/main/java/jp/sf/pal/board/db/bsentity/dbmeta/AttachmentDbm.java 2008-12-27 22:09:08 UTC (rev 1625) @@ -8,6 +8,7 @@ import jp.sf.pal.board.db.allcommon.dbmeta.info.ColumnInfo; import jp.sf.pal.board.db.allcommon.dbmeta.info.ReferrerInfo; import jp.sf.pal.board.db.allcommon.dbmeta.info.UniqueInfo; +import jp.sf.pal.board.db.allcommon.helper.StringKeyMap; import jp.sf.pal.board.db.exentity.Attachment; /** @@ -15,7 +16,6 @@ * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public class AttachmentDbm extends AbstractDBMeta { private static final AttachmentDbm _instance = new AttachmentDbm(); @@ -96,40 +96,14 @@ return _columnCreatedBy; } - { - initializeColumnInfoList(); - } - //========================================================================== // ========= - // Name Map - // ======== - public Map getDbNamePropertyNameKeyToLowerMap() { - return createDbNamePropertyNameKeyToLowerMap(); + // Resource Initialization + // ======================= + { + initializeInformationResource(); } - public Map getPropertyNameDbNameKeyToLowerMap() { - return createPropertyNameDbNameKeyToLowerMap(); - } - - protected static Map _dbNamePropertyNameKeyToLowerMap; - - protected Map createDbNamePropertyNameKeyToLowerMap() { - if (_dbNamePropertyNameKeyToLowerMap == null) { - _dbNamePropertyNameKeyToLowerMap = setupKeyToLowerMap(true); - } - return _dbNamePropertyNameKeyToLowerMap; - } - - protected static Map _propertyNameDbNameKeyToLowerMap; - - protected Map createPropertyNameDbNameKeyToLowerMap() { - if (_propertyNameDbNameKeyToLowerMap == null) { - _propertyNameDbNameKeyToLowerMap = setupKeyToLowerMap(false); - } - return _propertyNameDbNameKeyToLowerMap; - } - //========================================================================== // ========= // Type Name @@ -286,7 +260,8 @@ // Entity Property Setup // ===================== // It's very INTERNAL! - protected Map> _epsMap = newHashMap(); + protected Map> _epsMap = StringKeyMap + .createAsFlexibleConcurrent(); { setupEps(_epsMap, new EpsId(), columnId()); setupEps(_epsMap, new EpsData(), columnData()); Modified: board/trunk/src/main/java/jp/sf/pal/board/db/bsentity/dbmeta/CategoryAccessDbm.java =================================================================== --- board/trunk/src/main/java/jp/sf/pal/board/db/bsentity/dbmeta/CategoryAccessDbm.java 2008-12-27 22:06:42 UTC (rev 1624) +++ board/trunk/src/main/java/jp/sf/pal/board/db/bsentity/dbmeta/CategoryAccessDbm.java 2008-12-27 22:09:08 UTC (rev 1625) @@ -8,6 +8,7 @@ import jp.sf.pal.board.db.allcommon.dbmeta.info.ColumnInfo; import jp.sf.pal.board.db.allcommon.dbmeta.info.ForeignInfo; import jp.sf.pal.board.db.allcommon.dbmeta.info.UniqueInfo; +import jp.sf.pal.board.db.allcommon.helper.StringKeyMap; import jp.sf.pal.board.db.exentity.CategoryAccess; /** @@ -15,7 +16,6 @@ * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public class CategoryAccessDbm extends AbstractDBMeta { private static final CategoryAccessDbm _instance = new CategoryAccessDbm(); @@ -110,40 +110,14 @@ return _columnVersionno; } - { - initializeColumnInfoList(); - } - //========================================================================== // ========= - // Name Map - // ======== - public Map getDbNamePropertyNameKeyToLowerMap() { - return createDbNamePropertyNameKeyToLowerMap(); + // Resource Initialization + // ======================= + { + initializeInformationResource(); } - public Map getPropertyNameDbNameKeyToLowerMap() { - return createPropertyNameDbNameKeyToLowerMap(); - } - - protected static Map _dbNamePropertyNameKeyToLowerMap; - - protected Map createDbNamePropertyNameKeyToLowerMap() { - if (_dbNamePropertyNameKeyToLowerMap == null) { - _dbNamePropertyNameKeyToLowerMap = setupKeyToLowerMap(true); - } - return _dbNamePropertyNameKeyToLowerMap; - } - - protected static Map _propertyNameDbNameKeyToLowerMap; - - protected Map createPropertyNameDbNameKeyToLowerMap() { - if (_propertyNameDbNameKeyToLowerMap == null) { - _propertyNameDbNameKeyToLowerMap = setupKeyToLowerMap(false); - } - return _propertyNameDbNameKeyToLowerMap; - } - //========================================================================== // ========= // Type Name @@ -306,7 +280,8 @@ // Entity Property Setup // ===================== // It's very INTERNAL! - protected Map> _epsMap = newHashMap(); + protected Map> _epsMap = StringKeyMap + .createAsFlexibleConcurrent(); { setupEps(_epsMap, new EpsId(), columnId()); setupEps(_epsMap, new EpsName(), columnName()); Modified: board/trunk/src/main/java/jp/sf/pal/board/db/bsentity/dbmeta/CategoryDbm.java =================================================================== --- board/trunk/src/main/java/jp/sf/pal/board/db/bsentity/dbmeta/CategoryDbm.java 2008-12-27 22:06:42 UTC (rev 1624) +++ board/trunk/src/main/java/jp/sf/pal/board/db/bsentity/dbmeta/CategoryDbm.java 2008-12-27 22:09:08 UTC (rev 1625) @@ -8,6 +8,7 @@ import jp.sf.pal.board.db.allcommon.dbmeta.info.ColumnInfo; import jp.sf.pal.board.db.allcommon.dbmeta.info.ReferrerInfo; import jp.sf.pal.board.db.allcommon.dbmeta.info.UniqueInfo; +import jp.sf.pal.board.db.allcommon.helper.StringKeyMap; import jp.sf.pal.board.db.exentity.Category; /** @@ -15,7 +16,6 @@ * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public class CategoryDbm extends AbstractDBMeta { private static final CategoryDbm _instance = new CategoryDbm(); @@ -117,40 +117,14 @@ return _columnVersionno; } - { - initializeColumnInfoList(); - } - //========================================================================== // ========= - // Name Map - // ======== - public Map getDbNamePropertyNameKeyToLowerMap() { - return createDbNamePropertyNameKeyToLowerMap(); + // Resource Initialization + // ======================= + { + initializeInformationResource(); } - public Map getPropertyNameDbNameKeyToLowerMap() { - return createPropertyNameDbNameKeyToLowerMap(); - } - - protected static Map _dbNamePropertyNameKeyToLowerMap; - - protected Map createDbNamePropertyNameKeyToLowerMap() { - if (_dbNamePropertyNameKeyToLowerMap == null) { - _dbNamePropertyNameKeyToLowerMap = setupKeyToLowerMap(true); - } - return _dbNamePropertyNameKeyToLowerMap; - } - - protected static Map _propertyNameDbNameKeyToLowerMap; - - protected Map createPropertyNameDbNameKeyToLowerMap() { - if (_propertyNameDbNameKeyToLowerMap == null) { - _propertyNameDbNameKeyToLowerMap = setupKeyToLowerMap(false); - } - return _propertyNameDbNameKeyToLowerMap; - } - //========================================================================== // ========= // Type Name @@ -320,7 +294,8 @@ // Entity Property Setup // ===================== // It's very INTERNAL! - protected Map> _epsMap = newHashMap(); + protected Map> _epsMap = StringKeyMap + .createAsFlexibleConcurrent(); { setupEps(_epsMap, new EpsId(), columnId()); setupEps(_epsMap, new EpsName(), columnName()); Modified: board/trunk/src/main/java/jp/sf/pal/board/db/bsentity/dbmeta/GroupInfoDbm.java =================================================================== --- board/trunk/src/main/java/jp/sf/pal/board/db/bsentity/dbmeta/GroupInfoDbm.java 2008-12-27 22:06:42 UTC (rev 1624) +++ board/trunk/src/main/java/jp/sf/pal/board/db/bsentity/dbmeta/GroupInfoDbm.java 2008-12-27 22:09:08 UTC (rev 1625) @@ -8,6 +8,7 @@ import jp.sf.pal.board.db.allcommon.dbmeta.info.ColumnInfo; import jp.sf.pal.board.db.allcommon.dbmeta.info.ReferrerInfo; import jp.sf.pal.board.db.allcommon.dbmeta.info.UniqueInfo; +import jp.sf.pal.board.db.allcommon.helper.StringKeyMap; import jp.sf.pal.board.db.exentity.GroupInfo; /** @@ -15,7 +16,6 @@ * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public class GroupInfoDbm extends AbstractDBMeta { private static final GroupInfoDbm _instance = new GroupInfoDbm(); @@ -138,40 +138,14 @@ return _columnVersionno; } - { - initializeColumnInfoList(); - } - //========================================================================== // ========= - // Name Map - // ======== - public Map getDbNamePropertyNameKeyToLowerMap() { - return createDbNamePropertyNameKeyToLowerMap(); + // Resource Initialization + // ======================= + { + initializeInformationResource(); } - public Map getPropertyNameDbNameKeyToLowerMap() { - return createPropertyNameDbNameKeyToLowerMap(); - } - - protected static Map _dbNamePropertyNameKeyToLowerMap; - - protected Map createDbNamePropertyNameKeyToLowerMap() { - if (_dbNamePropertyNameKeyToLowerMap == null) { - _dbNamePropertyNameKeyToLowerMap = setupKeyToLowerMap(true); - } - return _dbNamePropertyNameKeyToLowerMap; - } - - protected static Map _propertyNameDbNameKeyToLowerMap; - - protected Map createPropertyNameDbNameKeyToLowerMap() { - if (_propertyNameDbNameKeyToLowerMap == null) { - _propertyNameDbNameKeyToLowerMap = setupKeyToLowerMap(false); - } - return _propertyNameDbNameKeyToLowerMap; - } - //========================================================================== // ========= // Type Name @@ -341,7 +315,8 @@ // Entity Property Setup // ===================== // It's very INTERNAL! - protected Map> _epsMap = newHashMap(); + protected Map> _epsMap = StringKeyMap + .createAsFlexibleConcurrent(); { setupEps(_epsMap, new EpsGroupId(), columnGroupId()); setupEps(_epsMap, new EpsName(), columnName()); Modified: board/trunk/src/main/java/jp/sf/pal/board/db/bsentity/dbmeta/GroupMappingDbm.java =================================================================== --- board/trunk/src/main/java/jp/sf/pal/board/db/bsentity/dbmeta/GroupMappingDbm.java 2008-12-27 22:06:42 UTC (rev 1624) +++ board/trunk/src/main/java/jp/sf/pal/board/db/bsentity/dbmeta/GroupMappingDbm.java 2008-12-27 22:09:08 UTC (rev 1625) @@ -8,6 +8,7 @@ import jp.sf.pal.board.db.allcommon.dbmeta.info.ColumnInfo; import jp.sf.pal.board.db.allcommon.dbmeta.info.ForeignInfo; import jp.sf.pal.board.db.allcommon.dbmeta.info.UniqueInfo; +import jp.sf.pal.board.db.allcommon.helper.StringKeyMap; import jp.sf.pal.board.db.exentity.GroupMapping; /** @@ -15,7 +16,6 @@ * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public class GroupMappingDbm extends AbstractDBMeta { private static final GroupMappingDbm _instance = new GroupMappingDbm(); @@ -68,40 +68,14 @@ return _columnGroupId; } - { - initializeColumnInfoList(); - } - //========================================================================== // ========= - // Name Map - // ======== - public Map getDbNamePropertyNameKeyToLowerMap() { - return createDbNamePropertyNameKeyToLowerMap(); + // Resource Initialization + // ======================= + { + initializeInformationResource(); } - public Map getPropertyNameDbNameKeyToLowerMap() { - return createPropertyNameDbNameKeyToLowerMap(); - } - - protected static Map _dbNamePropertyNameKeyToLowerMap; - - protected Map createDbNamePropertyNameKeyToLowerMap() { - if (_dbNamePropertyNameKeyToLowerMap == null) { - _dbNamePropertyNameKeyToLowerMap = setupKeyToLowerMap(true); - } - return _dbNamePropertyNameKeyToLowerMap; - } - - protected static Map _propertyNameDbNameKeyToLowerMap; - - protected Map createPropertyNameDbNameKeyToLowerMap() { - if (_propertyNameDbNameKeyToLowerMap == null) { - _propertyNameDbNameKeyToLowerMap = setupKeyToLowerMap(false); - } - return _propertyNameDbNameKeyToLowerMap; - } - //========================================================================== // ========= // Type Name @@ -263,7 +237,8 @@ // Entity Property Setup // ===================== // It's very INTERNAL! - protected Map> _epsMap = newHashMap(); + protected Map> _epsMap = StringKeyMap + .createAsFlexibleConcurrent(); { setupEps(_epsMap, new EpsId(), columnId()); setupEps(_epsMap, new EpsUserId(), columnUserId()); Modified: board/trunk/src/main/java/jp/sf/pal/board/db/bsentity/dbmeta/MessageAttachmentDbm.java =================================================================== --- board/trunk/src/main/java/jp/sf/pal/board/db/bsentity/dbmeta/MessageAttachmentDbm.java 2008-12-27 22:06:42 UTC (rev 1624) +++ board/trunk/src/main/java/jp/sf/pal/board/db/bsentity/dbmeta/MessageAttachmentDbm.java 2008-12-27 22:09:08 UTC (rev 1625) @@ -8,6 +8,7 @@ import jp.sf.pal.board.db.allcommon.dbmeta.info.ColumnInfo; import jp.sf.pal.board.db.allcommon.dbmeta.info.ForeignInfo; import jp.sf.pal.board.db.allcommon.dbmeta.info.UniqueInfo; +import jp.sf.pal.board.db.allcommon.helper.StringKeyMap; import jp.sf.pal.board.db.exentity.MessageAttachment; /** @@ -15,7 +16,6 @@ * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public class MessageAttachmentDbm extends AbstractDBMeta { private static final MessageAttachmentDbm _instance = new MessageAttachmentDbm(); @@ -131,40 +131,14 @@ return _columnVersionno; } - { - initializeColumnInfoList(); - } - //========================================================================== // ========= - // Name Map - // ======== - public Map getDbNamePropertyNameKeyToLowerMap() { - return createDbNamePropertyNameKeyToLowerMap(); + // Resource Initialization + // ======================= + { + initializeInformationResource(); } - public Map getPropertyNameDbNameKeyToLowerMap() { - return createPropertyNameDbNameKeyToLowerMap(); - } - - protected static Map _dbNamePropertyNameKeyToLowerMap; - - protected Map createDbNamePropertyNameKeyToLowerMap() { - if (_dbNamePropertyNameKeyToLowerMap == null) { - _dbNamePropertyNameKeyToLowerMap = setupKeyToLowerMap(true); - } - return _dbNamePropertyNameKeyToLowerMap; - } - - protected static Map _propertyNameDbNameKeyToLowerMap; - - protected Map createPropertyNameDbNameKeyToLowerMap() { - if (_propertyNameDbNameKeyToLowerMap == null) { - _propertyNameDbNameKeyToLowerMap = setupKeyToLowerMap(false); - } - return _propertyNameDbNameKeyToLowerMap; - } - //========================================================================== // ========= // Type Name @@ -336,7 +310,8 @@ // Entity Property Setup // ===================== // It's very INTERNAL! - protected Map> _epsMap = newHashMap(); + protected Map> _epsMap = StringKeyMap + .createAsFlexibleConcurrent(); { setupEps(_epsMap, new EpsId(), columnId()); setupEps(_epsMap, new EpsMemo(), columnMemo()); Modified: board/trunk/src/main/java/jp/sf/pal/board/db/bsentity/dbmeta/MessageContentDbm.java =================================================================== --- board/trunk/src/main/java/jp/sf/pal/board/db/bsentity/dbmeta/MessageContentDbm.java 2008-12-27 22:06:42 UTC (rev 1624) +++ board/trunk/src/main/java/jp/sf/pal/board/db/bsentity/dbmeta/MessageContentDbm.java 2008-12-27 22:09:08 UTC (rev 1625) @@ -8,6 +8,7 @@ import jp.sf.pal.board.db.allcommon.dbmeta.info.ColumnInfo; import jp.sf.pal.board.db.allcommon.dbmeta.info.ForeignInfo; import jp.sf.pal.board.db.allcommon.dbmeta.info.UniqueInfo; +import jp.sf.pal.board.db.allcommon.helper.StringKeyMap; import jp.sf.pal.board.db.exentity.MessageContent; /** @@ -15,7 +16,6 @@ * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public class MessageContentDbm extends AbstractDBMeta { private static final MessageContentDbm _instance = new MessageContentDbm(); @@ -61,40 +61,14 @@ return _columnContent; } - { - initializeColumnInfoList(); - } - //========================================================================== // ========= - // Name Map - // ======== - public Map getDbNamePropertyNameKeyToLowerMap() { - return createDbNamePropertyNameKeyToLowerMap(); + // Resource Initialization + // ======================= + { + initializeInformationResource(); } - public Map getPropertyNameDbNameKeyToLowerMap() { - return createPropertyNameDbNameKeyToLowerMap(); - } - - protected static Map _dbNamePropertyNameKeyToLowerMap; - - protected Map createDbNamePropertyNameKeyToLowerMap() { - if (_dbNamePropertyNameKeyToLowerMap == null) { - _dbNamePropertyNameKeyToLowerMap = setupKeyToLowerMap(true); - } - return _dbNamePropertyNameKeyToLowerMap; - } - - protected static Map _propertyNameDbNameKeyToLowerMap; - - protected Map createPropertyNameDbNameKeyToLowerMap() { - if (_propertyNameDbNameKeyToLowerMap == null) { - _propertyNameDbNameKeyToLowerMap = setupKeyToLowerMap(false); - } - return _propertyNameDbNameKeyToLowerMap; - } - //========================================================================== // ========= // Type Name @@ -250,7 +224,8 @@ // Entity Property Setup // ===================== // It's very INTERNAL! - protected Map> _epsMap = newHashMap(); + protected Map> _epsMap = StringKeyMap + .createAsFlexibleConcurrent(); { setupEps(_epsMap, new EpsMessageId(), columnMessageId()); setupEps(_epsMap, new EpsContent(), columnContent()); Modified: board/trunk/src/main/java/jp/sf/pal/board/db/bsentity/dbmeta/MessageDbm.java =================================================================== --- board/trunk/src/main/java/jp/sf/pal/board/db/bsentity/dbmeta/MessageDbm.java 2008-12-27 22:06:42 UTC (rev 1624) +++ board/trunk/src/main/java/jp/sf/pal/board/db/bsentity/dbmeta/MessageDbm.java 2008-12-27 22:09:08 UTC (rev 1625) @@ -9,6 +9,7 @@ import jp.sf.pal.board.db.allcommon.dbmeta.info.ForeignInfo; import jp.sf.pal.board.db.allcommon.dbmeta.info.ReferrerInfo; import jp.sf.pal.board.db.allcommon.dbmeta.info.UniqueInfo; +import jp.sf.pal.board.db.allcommon.helper.StringKeyMap; import jp.sf.pal.board.db.exentity.Message; /** @@ -16,7 +17,6 @@ * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public class MessageDbm extends AbstractDBMeta { private static final MessageDbm _instance = new MessageDbm(); @@ -153,40 +153,14 @@ return _columnVersionno; } - { - initializeColumnInfoList(); - } - //========================================================================== // ========= - // Name Map - // ======== - public Map getDbNamePropertyNameKeyToLowerMap() { - return createDbNamePropertyNameKeyToLowerMap(); + // Resource Initialization + // ======================= + { + initializeInformationResource(); } - public Map getPropertyNameDbNameKeyToLowerMap() { - return createPropertyNameDbNameKeyToLowerMap(); - } - - protected static Map _dbNamePropertyNameKeyToLowerMap; - - protected Map createDbNamePropertyNameKeyToLowerMap() { - if (_dbNamePropertyNameKeyToLowerMap == null) { - _dbNamePropertyNameKeyToLowerMap = setupKeyToLowerMap(true); - } - return _dbNamePropertyNameKeyToLowerMap; - } - - protected static Map _propertyNameDbNameKeyToLowerMap; - - protected Map createPropertyNameDbNameKeyToLowerMap() { - if (_propertyNameDbNameKeyToLowerMap == null) { - _propertyNameDbNameKeyToLowerMap = setupKeyToLowerMap(false); - } - return _propertyNameDbNameKeyToLowerMap; - } - //========================================================================== // ========= // Type Name @@ -368,7 +342,8 @@ // Entity Property Setup // ===================== // It's very INTERNAL! - protected Map> _epsMap = newHashMap(); + protected Map> _epsMap = StringKeyMap + .createAsFlexibleConcurrent(); { setupEps(_epsMap, new EpsId(), columnId()); setupEps(_epsMap, new EpsDisplayName(), columnDisplayName()); Modified: board/trunk/src/main/java/jp/sf/pal/board/db/bsentity/dbmeta/ReplyDbm.java =================================================================== --- board/trunk/src/main/java/jp/sf/pal/board/db/bsentity/dbmeta/ReplyDbm.java 2008-12-27 22:06:42 UTC (rev 1624) +++ board/trunk/src/main/java/jp/sf/pal/board/db/bsentity/dbmeta/ReplyDbm.java 2008-12-27 22:09:08 UTC (rev 1625) @@ -8,6 +8,7 @@ import jp.sf.pal.board.db.allcommon.dbmeta.info.ColumnInfo; import jp.sf.pal.board.db.allcommon.dbmeta.info.ForeignInfo; import jp.sf.pal.board.db.allcommon.dbmeta.info.UniqueInfo; +import jp.sf.pal.board.db.allcommon.helper.StringKeyMap; import jp.sf.pal.board.db.exentity.Reply; /** @@ -15,7 +16,6 @@ * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public class ReplyDbm extends AbstractDBMeta { private static final ReplyDbm _instance = new ReplyDbm(); @@ -103,40 +103,14 @@ return _columnDeletedBy; } - { - initializeColumnInfoList(); - } - //========================================================================== // ========= - // Name Map - // ======== - public Map getDbNamePropertyNameKeyToLowerMap() { - return createDbNamePropertyNameKeyToLowerMap(); + // Resource Initialization + // ======================= + { + initializeInformationResource(); } - public Map getPropertyNameDbNameKeyToLowerMap() { - return createPropertyNameDbNameKeyToLowerMap(); - } - - protected static Map _dbNamePropertyNameKeyToLowerMap; - - protected Map createDbNamePropertyNameKeyToLowerMap() { - if (_dbNamePropertyNameKeyToLowerMap == null) { - _dbNamePropertyNameKeyToLowerMap = setupKeyToLowerMap(true); - } - return _dbNamePropertyNameKeyToLowerMap; - } - - protected static Map _propertyNameDbNameKeyToLowerMap; - - protected Map createPropertyNameDbNameKeyToLowerMap() { - if (_propertyNameDbNameKeyToLowerMap == null) { - _propertyNameDbNameKeyToLowerMap = setupKeyToLowerMap(false); - } - return _propertyNameDbNameKeyToLowerMap; - } - //========================================================================== // ========= // Type Name @@ -292,7 +266,8 @@ // Entity Property Setup // ===================== // It's very INTERNAL! - protected Map> _epsMap = newHashMap(); + protected Map> _epsMap = StringKeyMap + .createAsFlexibleConcurrent(); { setupEps(_epsMap, new EpsId(), columnId()); setupEps(_epsMap, new EpsDisplayName(), columnDisplayName()); Modified: board/trunk/src/main/java/jp/sf/pal/board/db/bsentity/dbmeta/RoleInfoDbm.java =================================================================== --- board/trunk/src/main/java/jp/sf/pal/board/db/bsentity/dbmeta/RoleInfoDbm.java 2008-12-27 22:06:42 UTC (rev 1624) +++ board/trunk/src/main/java/jp/sf/pal/board/db/bsentity/dbmeta/RoleInfoDbm.java 2008-12-27 22:09:08 UTC (rev 1625) @@ -8,6 +8,7 @@ import jp.sf.pal.board.db.allcommon.dbmeta.info.ColumnInfo; import jp.sf.pal.board.db.allcommon.dbmeta.info.ReferrerInfo; import jp.sf.pal.board.db.allcommon.dbmeta.info.UniqueInfo; +import jp.sf.pal.board.db.allcommon.helper.StringKeyMap; import jp.sf.pal.board.db.exentity.RoleInfo; /** @@ -15,7 +16,6 @@ * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public class RoleInfoDbm extends AbstractDBMeta { private static final RoleInfoDbm _instance = new RoleInfoDbm(); @@ -138,40 +138,14 @@ return _columnVersionno; } - { - initializeColumnInfoList(); - } - //========================================================================== // ========= - // Name Map - // ======== - public Map getDbNamePropertyNameKeyToLowerMap() { - return createDbNamePropertyNameKeyToLowerMap(); + // Resource Initialization + // ======================= + { + initializeInformationResource(); } - public Map getPropertyNameDbNameKeyToLowerMap() { - return createPropertyNameDbNameKeyToLowerMap(); - } - - protected static Map _dbNamePropertyNameKeyToLowerMap; - - protected Map createDbNamePropertyNameKeyToLowerMap() { - if (_dbNamePropertyNameKeyToLowerMap == null) { - _dbNamePropertyNameKeyToLowerMap = setupKeyToLowerMap(true); - } - return _dbNamePropertyNameKeyToLowerMap; - } - - protected static Map _propertyNameDbNameKeyToLowerMap; - - protected Map createPropertyNameDbNameKeyToLowerMap() { - if (_propertyNameDbNameKeyToLowerMap == null) { - _propertyNameDbNameKeyToLowerMap = setupKeyToLowerMap(false); - } - return _propertyNameDbNameKeyToLowerMap; - } - //========================================================================== // ========= // Type Name @@ -341,7 +315,8 @@ // Entity Property Setup // ===================== // It's very INTERNAL! - protected Map> _epsMap = newHashMap(); + protected Map> _epsMap = StringKeyMap + .createAsFlexibleConcurrent(); { setupEps(_epsMap, new EpsRoleId(), columnRoleId()); setupEps(_epsMap, new EpsName(), columnName()); Modified: board/trunk/src/main/java/jp/sf/pal/board/db/bsentity/dbmeta/RoleMappingDbm.java =================================================================== --- board/trunk/src/main/java/jp/sf/pal/board/db/bsentity/dbmeta/RoleMappingDbm.java 2008-12-27 22:06:42 UTC (rev 1624) +++ board/trunk/src/main/java/jp/sf/pal/board/db/bsentity/dbmeta/RoleMappingDbm.java 2008-12-27 22:09:08 UTC (rev 1625) @@ -8,6 +8,7 @@ import jp.sf.pal.board.db.allcommon.dbmeta.info.ColumnInfo; import jp.sf.pal.board.db.allcommon.dbmeta.info.ForeignInfo; import jp.sf.pal.board.db.allcommon.dbmeta.info.UniqueInfo; +import jp.sf.pal.board.db.allcommon.helper.StringKeyMap; import jp.sf.pal.board.db.exentity.RoleMapping; /** @@ -15,7 +16,6 @@ * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public class RoleMappingDbm extends AbstractDBMeta { private static final RoleMappingDbm _instance = new RoleMappingDbm(); @@ -68,40 +68,14 @@ return _columnRoleId; } - { - initializeColumnInfoList(); - } - //========================================================================== // ========= - // Name Map - // ======== - public Map getDbNamePropertyNameKeyToLowerMap() { - return createDbNamePropertyNameKeyToLowerMap(); + // Resource Initialization + // ======================= + { + initializeInformationResource(); } - public Map getPropertyNameDbNameKeyToLowerMap() { - return createPropertyNameDbNameKeyToLowerMap(); - } - - protected static Map _dbNamePropertyNameKeyToLowerMap; - - protected Map createDbNamePropertyNameKeyToLowerMap() { - if (_dbNamePropertyNameKeyToLowerMap == null) { - _dbNamePropertyNameKeyToLowerMap = setupKeyToLowerMap(true); - } - return _dbNamePropertyNameKeyToLowerMap; - } - - protected static Map _propertyNameDbNameKeyToLowerMap; - - protected Map createPropertyNameDbNameKeyToLowerMap() { - if (_propertyNameDbNameKeyToLowerMap == null) { - _propertyNameDbNameKeyToLowerMap = setupKeyToLowerMap(false); - } - return _propertyNameDbNameKeyToLowerMap; - } - //========================================================================== // ========= // Type Name @@ -263,7 +237,8 @@ // Entity Property Setup // ===================== // It's very INTERNAL! - protected Map> _epsMap = newHashMap(); + protected Map> _epsMap = StringKeyMap + .createAsFlexibleConcurrent(); { setupEps(_epsMap, new EpsId(), columnId()); setupEps(_epsMap, new EpsUserId(), columnUserId()); Modified: board/trunk/src/main/java/jp/sf/pal/board/db/bsentity/dbmeta/UserInfoDbm.java =================================================================== --- board/trunk/src/main/java/jp/sf/pal/board/db/bsentity/dbmeta/UserInfoDbm.java 2008-12-27 22:06:42 UTC (rev 1624) +++ board/trunk/src/main/java/jp/sf/pal/board/db/bsentity/dbmeta/UserInfoDbm.java 2008-12-27 22:09:08 UTC (rev 1625) @@ -9,6 +9,7 @@ import jp.sf.pal.board.db.allcommon.dbmeta.info.ForeignInfo; import jp.sf.pal.board.db.allcommon.dbmeta.info.ReferrerInfo; import jp.sf.pal.board.db.allcommon.dbmeta.info.UniqueInfo; +import jp.sf.pal.board.db.allcommon.helper.StringKeyMap; import jp.sf.pal.board.db.exentity.UserInfo; /** @@ -16,7 +17,6 @@ * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public class UserInfoDbm extends AbstractDBMeta { private static final UserInfoDbm _instance = new UserInfoDbm(); @@ -93,6 +93,9 @@ protected ColumnInfo _columnGroupId = cci("GROUP_ID", "groupId", String.class, false, 255, 0); + protected ColumnInfo _columnStatus = cci("STATUS", "status", String.class, + false, 1, 0); + protected ColumnInfo _columnCreatedTime = cci("CREATED_TIME", "createdTime", java.sql.Timestamp.class, false, null, null); @@ -174,6 +177,10 @@ return _columnGroupId; } + public ColumnInfo columnStatus() { + return _columnStatus; + } + public ColumnInfo columnCreatedTime() { return _columnCreatedTime; } @@ -202,40 +209,14 @@ return _columnVersionno; } - { - initializeColumnInfoList(); - } - //========================================================================== // ========= - // Name Map - // ======== - public Map getDbNamePropertyNameKeyToLowerMap() { - return createDbNamePropertyNameKeyToLowerMap(); + // Resource Initialization + // ======================= + { + initializeInformationResource(); } - public Map getPropertyNameDbNameKeyToLowerMap() { - return createPropertyNameDbNameKeyToLowerMap(); - } - - protected static Map _dbNamePropertyNameKeyToLowerMap; - - protected Map createDbNamePropertyNameKeyToLowerMap() { - if (_dbNamePropertyNameKeyToLowerMap == null) { - _dbNamePropertyNameKeyToLowerMap = setupKeyToLowerMap(true); - } - return _dbNamePropertyNameKeyToLowerMap; - } - - protected static Map _propertyNameDbNameKeyToLowerMap; - - protected Map createPropertyNameDbNameKeyToLowerMap() { - if (_propertyNameDbNameKeyToLowerMap == null) { - _propertyNameDbNameKeyToLowerMap = setupKeyToLowerMap(false); - } - return _propertyNameDbNameKeyToLowerMap; - } - //========================================================================== // ========= // Type Name @@ -417,7 +398,8 @@ // Entity Property Setup // ===================== // It's very INTERNAL! - protected Map> _epsMap = newHashMap(); + protected Map> _epsMap = StringKeyMap + .createAsFlexibleConcurrent(); { setupEps(_epsMap, new EpsUserId(), columnUserId()); setupEps(_epsMap, new EpsGivenName(), columnGivenName()); @@ -434,6 +416,7 @@ setupEps(_epsMap, new EpsLocale(), columnLocale()); setupEps(_epsMap, new EpsRoleId(), columnRoleId()); setupEps(_epsMap, new EpsGroupId(), columnGroupId()); + setupEps(_epsMap, new EpsStatus(), columnStatus()); setupEps(_epsMap, new EpsCreatedTime(), columnCreatedTime()); setupEps(_epsMap, new EpsCreatedBy(), columnCreatedBy()); setupEps(_epsMap, new EpsUpdatedTime(), columnUpdatedTime()); @@ -542,6 +525,12 @@ } } + public static class EpsStatus implements Eps { + public void setup(UserInfo e, Object v) { + e.setStatus((String) v); + } + } + public static class EpsCreatedTime implements Eps { public void setup(UserInfo e, Object v) { e.setCreatedTime((java.sql.Timestamp) v); Modified: board/trunk/src/main/java/jp/sf/pal/board/db/cbean/bs/BsAttachmentCB.java =================================================================== --- board/trunk/src/main/java/jp/sf/pal/board/db/cbean/bs/BsAttachmentCB.java 2008-12-27 22:06:42 UTC (rev 1624) +++ board/trunk/src/main/java/jp/sf/pal/board/db/cbean/bs/BsAttachmentCB.java 2008-12-27 22:09:08 UTC (rev 1625) @@ -16,7 +16,6 @@ * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public class BsAttachmentCB extends AbstractConditionBean { //========================================================================== @@ -84,7 +83,12 @@ return _conditionQuery; } - public ConditionQuery getConditionQueryAsInterface() { + /** + * The implementation. + * + * @return The conditionQuery of the local table as interface. (NotNull) + */ + public ConditionQuery localCQ() { return getConditionQuery(); } @@ -134,23 +138,6 @@ query().xsetUnionAllQuery(cq); } - /** - * @param unionQuery The query of 'union'. (NotNull) - * @deprecated Sorry! Please use union(UnionQuery unionQuery). - */ - public void union(AttachmentCQ unionQuery) { - query().xsetUnionQuery(unionQuery); - } - - /** - * @param unionQuery The query of 'union'. (NotNull) - * @deprecated Sorry! Please use unionAll(UnionQuery - * unionQuery). - */ - public void unionAll(AttachmentCQ unionQuery) { - query().xsetUnionAllQuery(unionQuery); - } - public boolean hasUnionQueryOrUnionAllQuery() { return query().hasUnionQueryOrUnionAllQuery(); } @@ -178,7 +165,8 @@ public AttachmentCQ qy() { return query(); } - }, _forDeriveReferrer); + }, _forDerivedReferrer, _forScalarSelect, + _forScalarSubQuery); } return _specification; } @@ -188,8 +176,10 @@ protected SpQyCall _myQyCall; public Specification(ConditionBean baseCB, - SpQyCall qyCall, boolean forDeriveReferrer) { - super(baseCB, qyCall, forDeriveReferrer); + SpQyCall qyCall, boolean forDeriveReferrer, + boolean forScalarSelect, boolean forScalarSubQuery) { + super(baseCB, qyCall, forDeriveReferrer, forScalarSelect, + forScalarSubQuery); _myQyCall = qyCall; } Modified: board/trunk/src/main/java/jp/sf/pal/board/db/cbean/bs/BsCategoryAccessCB.java =================================================================== --- board/trunk/src/main/java/jp/sf/pal/board/db/cbean/bs/BsCategoryAccessCB.java 2008-12-27 22:06:42 UTC (rev 1624) +++ board/trunk/src/main/java/jp/sf/pal/board/db/cbean/bs/BsCategoryAccessCB.java 2008-12-27 22:09:08 UTC (rev 1625) @@ -18,7 +18,6 @@ * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public class BsCategoryAccessCB extends AbstractConditionBean { //========================================================================== @@ -86,7 +85,12 @@ return _conditionQuery; } - public ConditionQuery getConditionQueryAsInterface() { + /** + * The implementation. + * + * @return The conditionQuery of the local table as interface. (NotNull) + */ + public ConditionQuery localCQ() { return getConditionQuery(); } @@ -136,24 +140,6 @@ query().xsetUnionAllQuery(cq); } - /** - * @param unionQuery The query of 'union'. (NotNull) - * @deprecated Sorry! Please use union(UnionQuery - * unionQuery). - */ - public void union(CategoryAccessCQ unionQuery) { - query().xsetUnionQuery(unionQuery); - } - - /** - * @param unionQuery The query of 'union'. (NotNull) - * @deprecated Sorry! Please use unionAll(UnionQuery - * unionQuery). - */ - public void unionAll(CategoryAccessCQ unionQuery) { - query().xsetUnionAllQuery(unionQuery); - } - public boolean hasUnionQueryOrUnionAllQuery() { return query().hasUnionQueryOrUnionAllQuery(); } @@ -162,7 +148,6 @@ // ========= // Setup Select // ============ - protected CategoryNss _nssCategory; public CategoryNss getNssCategory() { @@ -202,7 +187,8 @@ public CategoryAccessCQ qy() { return query(); } - }, _forDeriveReferrer); + }, _forDerivedReferrer, _forScalarSelect, + _forScalarSubQuery); } return _specification; } @@ -214,8 +200,10 @@ protected CategoryCB.Specification _category; public Specification(ConditionBean baseCB, - SpQyCall qyCall, boolean forDeriveReferrer) { - super(baseCB, qyCall, forDeriveReferrer); + SpQyCall qyCall, boolean forDeriveReferrer, + boolean forScalarSelect, boolean forScalarSubQuery) { + super(baseCB, qyCall, forDeriveReferrer, forScalarSelect, + forScalarSubQuery); _myQyCall = qyCall; } @@ -280,7 +268,8 @@ public CategoryCQ qy() { return _myQyCall.qy().queryCategory(); } - }, _forDeriveReferrer); + }, _forDerivedReferrer, _forScalarSelect, + _forScalarSubQuery); } return _category; } Modified: board/trunk/src/main/java/jp/sf/pal/board/db/cbean/bs/BsCategoryCB.java =================================================================== --- board/trunk/src/main/java/jp/sf/pal/board/db/cbean/bs/BsCategoryCB.java 2008-12-27 22:06:42 UTC (rev 1624) +++ board/trunk/src/main/java/jp/sf/pal/board/db/cbean/bs/BsCategoryCB.java 2008-12-27 22:09:08 UTC (rev 1625) @@ -17,7 +17,6 @@ * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public class BsCategoryCB extends AbstractConditionBean { //========================================================================== @@ -85,7 +84,12 @@ return _conditionQuery; } - public ConditionQuery getConditionQueryAsInterface() { + /** + * The implementation. + * + * @return The conditionQuery of the local table as interface. (NotNull) + */ + public ConditionQuery localCQ() { return getConditionQuery(); } @@ -135,23 +139,6 @@ query().xsetUnionAllQuery(cq); } - /** - * @param unionQuery The query of 'union'. (NotNull) - * @deprecated Sorry! Please use union(UnionQuery unionQuery). - */ - public void union(CategoryCQ unionQuery) { - query().xsetUnionQuery(unionQuery); - } - - /** - * @param unionQuery The query of 'union'. (NotNull) - * @deprecated Sorry! Please use unionAll(UnionQuery - * unionQuery). - */ - public void unionAll(CategoryCQ unionQuery) { - query().xsetUnionAllQuery(unionQuery); - } - public boolean hasUnionQueryOrUnionAllQuery() { return query().hasUnionQueryOrUnionAllQuery(); } @@ -179,7 +166,8 @@ public CategoryCQ qy() { return query(); } - }, _forDeriveReferrer); + }, _forDerivedReferrer, _forScalarSelect, + _forScalarSubQuery); } return _specification; } @@ -188,8 +176,10 @@ protected SpQyCall _myQyCall; public Specification(ConditionBean baseCB, SpQyCall qyCall, - boolean forDeriveReferrer) { - super(baseCB, qyCall, forDeriveReferrer); + boolean forDeriveReferrer, boolean forScalarSelect, + boolean forScalarSubQuery) { + super(baseCB, qyCall, forDeriveReferrer, forScalarSelect, + forScalarSubQuery); _myQyCall = qyCall; } Modified: board/trunk/src/main/java/jp/sf/pal/board/db/cbean/bs/BsGroupInfoCB.java =================================================================== --- board/trunk/src/main/java/jp/sf/pal/board/db/cbean/bs/BsGroupInfoCB.java 2008-12-27 22:06:42 UTC (rev 1624) +++ board/trunk/src/main/java/jp/sf/pal/board/db/cbean/bs/BsGroupInfoCB.java 2008-12-27 22:09:08 UTC (rev 1625) @@ -17,7 +17,6 @@ * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public class BsGroupInfoCB extends AbstractConditionBean { //========================================================================== @@ -86,7 +85,12 @@ return _conditionQuery; } - public ConditionQuery getConditionQueryAsInterface() { + /** + * The implementation. + * + * @return The conditionQuery of the local table as interface. (NotNull) + */ + public ConditionQuery localCQ() { return getConditionQuery(); } @@ -136,23 +140,6 @@ query().xsetUnionAllQuery(cq); } - /** - * @param unionQuery The query of 'union'. (NotNull) - * @deprecated Sorry! Please use union(UnionQuery unionQuery). - */ - public void union(GroupInfoCQ unionQuery) { - query().xsetUnionQuery(unionQuery); - } - - /** - * @param unionQuery The query of 'union'. (NotNull) - * @deprecated Sorry! Please use unionAll(UnionQuery - * unionQuery). - */ - public void unionAll(GroupInfoCQ unionQuery) { - query().xsetUnionAllQuery(unionQuery); - } - public boolean hasUnionQueryOrUnionAllQuery() { return query().hasUnionQueryOrUnionAllQuery(); } @@ -180,7 +167,8 @@ public GroupInfoCQ qy() { return query(); } - }, _forDeriveReferrer); + }, _forDerivedReferrer, _forScalarSelect, + _forScalarSubQuery); } return _specification; } @@ -190,8 +178,10 @@ protected SpQyCall _myQyCall; public Specification(ConditionBean baseCB, - SpQyCall qyCall, boolean forDeriveReferrer) { - super(baseCB, qyCall, forDeriveReferrer); + SpQyCall qyCall, boolean forDeriveReferrer, + boolean forScalarSelect, boolean forScalarSubQuery) { + super(baseCB, qyCall, forDeriveReferrer, forScalarSelect, + forScalarSubQuery); _myQyCall = qyCall; } Modified: board/trunk/src/main/java/jp/sf/pal/board/db/cbean/bs/BsGroupMappingCB.java =================================================================== --- board/trunk/src/main/java/jp/sf/pal/board/db/cbean/bs/BsGroupMappingCB.java 2008-12-27 22:06:42 UTC (rev 1624) +++ board/trunk/src/main/java/jp/sf/pal/board/db/cbean/bs/BsGroupMappingCB.java 2008-12-27 22:09:08 UTC (rev 1625) @@ -21,7 +21,6 @@ * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public class BsGroupMappingCB extends AbstractConditionBean { //========================================================================== @@ -89,7 +88,12 @@ return _conditionQuery; } - public ConditionQuery getConditionQueryAsInterface() { + /** + * The implementation. + * + * @return The conditionQuery of the local table as interface. (NotNull) + */ + public ConditionQuery localCQ() { return getConditionQuery(); } @@ -139,24 +143,6 @@ query().xsetUnionAllQuery(cq); } - /** - * @param unionQuery The query of 'union'. (NotNull) - * @deprecated Sorry! Please use union(UnionQuery - * unionQuery). - */ - public void union(GroupMappingCQ unionQuery) { - query().xsetUnionQuery(unionQuery); - } - - /** - * @param unionQuery The query of 'union'. (NotNull) - * @deprecated Sorry! Please use unionAll(UnionQuery - * unionQuery). - */ - public void unionAll(GroupMappingCQ unionQuery) { - query().xsetUnionAllQuery(unionQuery); - } - public boolean hasUnionQueryOrUnionAllQuery() { return query().hasUnionQueryOrUnionAllQuery(); } @@ -165,7 +151,6 @@ // ========= // Setup Select // ============ - protected GroupInfoNss _nssGroupInfo; public GroupInfoNss getNssGroupInfo() { @@ -226,7 +211,8 @@ public GroupMappingCQ qy() { return query(); } - }, _forDeriveReferrer); + }, _forDerivedReferrer, _forScalarSelect, + _forScalarSubQuery); } return _specification; } @@ -240,8 +226,10 @@ protected UserInfoCB.Specification _userInfo; public Specification(ConditionBean baseCB, - SpQyCall qyCall, boolean forDeriveReferrer) { - super(baseCB, qyCall, forDeriveReferrer); + SpQyCall qyCall, boolean forDeriveReferrer, + boolean forScalarSelect, boolean forScalarSubQuery) { + super(baseCB, qyCall, forDeriveReferrer, forScalarSelect, + forScalarSubQuery); _myQyCall = qyCall; } @@ -285,7 +273,8 @@ public GroupInfoCQ qy() { return _myQyCall.qy().queryGroupInfo(); } - }, _forDeriveReferrer); + }, _forDerivedReferrer, _forScalarSelect, + _forScalarSubQuery); } return _groupInfo; } @@ -304,7 +293,8 @@ public UserInfoCQ qy() { return _myQyCall.qy().queryUserInfo(); } - }, _forDeriveReferrer); + }, _forDerivedReferrer, _forScalarSelect, + _forScalarSubQuery); } return _userInfo; } Modified: board/trunk/src/main/java/jp/sf/pal/board/db/cbean/bs/BsMessageAttachmentCB.java =================================================================== --- board/trunk/src/main/java/jp/sf/pal/board/db/cbean/bs/BsMessageAttachmentCB.java 2008-12-27 22:06:42 UTC (rev 1624) +++ board/trunk/src/main/java/jp/sf/pal/board/db/cbean/bs/BsMessageAttachmentCB.java 2008-12-27 22:09:08 UTC (rev 1625) @@ -21,7 +21,6 @@ * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public class BsMessageAttachmentCB extends AbstractConditionBean { //========================================================================== @@ -89,7 +88,12 @@ return _conditionQuery; } - public ConditionQuery getConditionQueryAsInterface() { + /** + * The implementation. + * + * @return The conditionQuery of the local table as interface. (NotNull) + */ + public ConditionQuery localCQ() { return getConditionQuery(); } @@ -139,24 +143,6 @@ query().xsetUnionAllQuery(cq); } - /** - * @param unionQuery The query of 'union'. (NotNull) - * @deprecated Sorry! Please use union(UnionQuery - * unionQuery). - */ - public void union(MessageAttachmentCQ unionQuery) { - query().xsetUnionQuery(unionQuery); - } - - /** - * @param unionQuery The query of 'union'. (NotNull) - * @deprecated Sorry! Please use unionAll(UnionQuery - * unionQuery). - */ - public void unionAll(MessageAttachmentCQ unionQuery) { - query().xsetUnionAllQuery(unionQuery); - } - public boolean hasUnionQueryOrUnionAllQuery() { return query().hasUnionQueryOrUnionAllQuery(); } @@ -165,7 +151,6 @@ // ========= // Setup Select // ============ - protected AttachmentNss _nssAttachment; public AttachmentNss getNssAttachment() { @@ -226,7 +211,8 @@ public MessageAttachmentCQ qy() { return query(); } - }, _forDeriveReferrer); + }, _forDerivedReferrer, _forScalarSelect, + _forScalarSubQuery); } return _specification; } @@ -240,8 +226,11 @@ protected MessageCB.Specification _message; public Specification(ConditionBean baseCB, - SpQyCall qyCall, boolean forDeriveReferrer) { - super(baseCB, qyCall, forDeriveReferrer); + SpQyCall qyCall, + boolean forDeriveReferrer, boolean forScalarSelect, + boolean forScalarSubQuery) { + super(baseCB, qyCall, forDeriveReferrer, forScalarSelect, + forScalarSubQuery); _myQyCall = qyCall; } @@ -321,7 +310,8 @@ public AttachmentCQ qy() { return _myQyCall.qy().queryAttachment(); } - }, _forDeriveReferrer); + }, _forDerivedReferrer, _forScalarSelect, + _forScalarSubQuery); } return _attachment; } @@ -340,7 +330,8 @@ public MessageCQ qy() { return _myQyCall.qy().queryMessage(); } - }, _forDeriveReferrer); + }, _forDerivedReferrer, _forScalarSelect, + _forScalarSubQuery); } return _message; } Modified: board/trunk/src/main/java/jp/sf/pal/board/db/cbean/bs/BsMessageCB.java =================================================================== --- board/trunk/src/main/java/jp/sf/pal/board/db/cbean/bs/BsMessageCB.java 2008-12-27 22:06:42 UTC (rev 1624) +++ board/trunk/src/main/java/jp/sf/pal/board/db/cbean/bs/BsMessageCB.java 2008-12-27 22:09:08 UTC (rev 1625) @@ -23,7 +23,6 @@ * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public class BsMessageCB extends AbstractConditionBean { //========================================================================== @@ -91,7 +90,12 @@ return _conditionQuery; } - public ConditionQuery getConditionQueryAsInterface() { + /** + * The implementation. + * + * @return The conditionQuery of the local table as interface. (NotNull) + */ + public ConditionQuery localCQ() { return getConditionQuery(); } @@ -141,22 +145,6 @@ query().xsetUnionAllQuery(cq); } - /** - * @param unionQuery The query of 'union'. (NotNull) - * @deprecated Sorry! Please use union(UnionQuery unionQuery). - */ - public void union(MessageCQ unionQuery) { - query().xsetUnionQuery(unionQuery); - } - - /** - * @param unionQuery The query of 'union'. (NotNull) - * @deprecated Sorry! Please use unionAll(UnionQuery unionQuery). - */ - public void unionAll(MessageCQ unionQuery) { - query().xsetUnionAllQuery(unionQuery); - } - public boolean hasUnionQueryOrUnionAllQuery() { return query().hasUnionQueryOrUnionAllQuery(); } @@ -165,7 +153,6 @@ // ========= // Setup Select // ============ - protected CategoryNss _nssCategory; public CategoryNss getNssCategory() { @@ -227,7 +214,7 @@ public MessageCQ qy() { return query(); } - }, _forDeriveReferrer); + }, _forDerivedReferrer, _forScalarSelect, _forScalarSubQuery); } return _specification; } @@ -240,8 +227,10 @@ protected MessageContentCB.Specification _messageContentAsOne; public Specification(ConditionBean baseCB, SpQyCall qyCall, - boolean forDeriveReferrer) { - super(baseCB, qyCall, forDeriveReferrer); + boolean forDeriveReferrer, boolean forScalarSelect, + boolean forScalarSubQuery) { + super(baseCB, qyCall, forDeriveReferrer, forScalarSelect, + forScalarSubQuery); _myQyCall = qyCall; } @@ -330,7 +319,8 @@ public CategoryCQ qy() { return _myQyCall.qy().queryCategory(); } - }, _forDeriveReferrer); + }, _forDerivedReferrer, _forScalarSelect, + _forScalarSubQuery); } return _category; } @@ -339,7 +329,8 @@ assertForeign("messageContentAsOne"); if (_messageContentAsOne == null) { _messageContentAsOne = new MessageContentCB.Specification( - _baseCB, new SpQyCall() { + _baseCB, + new SpQyCall() { public boolean has() { return _myQyCall.has() && _myQyCall @@ -351,7 +342,8 @@ return _myQyCall.qy() .queryMessageContentAsOne(); } - }, _forDeriveReferrer); + }, _forDerivedReferrer, _forScalarSelect, + _forScalarSubQuery); } return _messageContentAsOne; } Modified: board/trunk/src/main/java/jp/sf/pal/board/db/cbean/bs/BsMessageContentCB.java =================================================================== --- board/trunk/src/main/java/jp/sf/pal/board/db/cbean/bs/BsMessageContentCB.java 2008-12-27 22:06:42 UTC (rev 1624) +++ board/trunk/src/main/java/jp/sf/pal/board/db/cbean/bs/BsMessageContentCB.java 2008-12-27 22:09:08 UTC (rev 1625) @@ -18,7 +18,6 @@ * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public class BsMessageContentCB extends AbstractConditionBean { //========================================================================== @@ -86,7 +85,12 @@ return _conditionQuery; } - public ConditionQuery getConditionQueryAsInterface() { + /** + * The implementation. + * + * @return The conditionQuery of the local table as interface. (NotNull) + */ + public ConditionQuery localCQ() { return getConditionQuery(); } @@ -136,24 +140,6 @@ query().xsetUnionAllQuery(cq); } - /** - * @param unionQuery The query of 'union'. (NotNull) - * @deprecated Sorry! Please use union(UnionQuery - * unionQuery). - */ - public void union(MessageContentCQ unionQuery) { - query().xsetUnionQuery(unionQuery); - } - - /** - * @param unionQuery The query of 'union'. (NotNull) - * @deprecated Sorry! Please use unionAll(UnionQuery - * unionQuery). - */ - public void unionAll(MessageContentCQ unionQuery) { - query().xsetUnionAllQuery(unionQuery); - } - public boolean hasUnionQueryOrUnionAllQuery() { return query().hasUnionQueryOrUnionAllQuery(); } @@ -162,7 +148,6 @@ // ========= // Setup Select // ============ - protected MessageNss _nssMessage; public MessageNss getNssMessage() { @@ -202,7 +187,8 @@ public MessageContentCQ qy() { return query(); } - }, _forDeriveReferrer); + }, _forDerivedReferrer, _forScalarSelect, + _forScalarSubQuery); } return _specification; } @@ -214,8 +200,10 @@ protected MessageCB.Specification _message; public Specification(ConditionBean baseCB, - SpQyCall qyCall, boolean forDeriveReferrer) { - super(baseCB, qyCall, forDeriveReferrer); + SpQyCall qyCall, boolean forDeriveReferrer, + boolean forScalarSelect, boolean forScalarSubQuery) { + super(baseCB, qyCall, forDeriveReferrer, forScalarSelect, + forScalarSubQuery); _myQyCall = qyCall; } @@ -251,7 +239,8 @@ public MessageCQ qy() { return _myQyCall.qy().queryMessage(); } - }, _forDeriveReferrer); + }, _forDerivedReferrer, _forScalarSelect, + _forScalarSubQuery); } return _message; } Modified: board/trunk/src/main/java/jp/sf/pal/board/db/cbean/bs/BsReplyCB.java =================================================================== --- board/trunk/src/main/java/jp/sf/pal/board/db/cbean/bs/BsReplyCB.java 2008-12-27 22:06:42 UTC (rev 1624) +++ board/trunk/src/main/java/jp/sf/pal/board/db/cbean/bs/BsReplyCB.java 2008-12-27 22:09:08 UTC (rev 1625) @@ -18,7 +18,6 @@ * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public class BsReplyCB extends AbstractConditionBean { //========================================================================== @@ -86,7 +85,12 @@ return _conditionQuery; } - public ConditionQuery getConditionQueryAsInterface() { + /** + * The implementation. + * + * @return The conditionQuery of the local table as interface. (NotNull) + */ + public ConditionQuery localCQ() { return getConditionQuery(); } @@ -136,22 +140,6 @@ query().xsetUnionAllQuery(cq); } - /** - * @param unionQuery The query of 'union'. (NotNull) - * @deprecated Sorry! Please use union(UnionQuery unionQuery). - */ - public void union(ReplyCQ unionQuery) { - query().xsetUnionQuery(unionQuery); - } - - /** - * @param unionQuery The query of 'union'. (NotNull) - * @deprecated Sorry! Please use unionAll(UnionQuery unionQuery). - */ - public void unionAll(ReplyCQ unionQuery) { - query().xsetUnionAllQuery(unionQuery); - } - public boolean hasUnionQueryOrUnionAllQuery() { return query().hasUnionQueryOrUnionAllQuery(); } @@ -160,7 +148,6 @@ // ========= // Setup Select // ============ - protected MessageNss _nssMessage; public MessageNss getNssMessage() { @@ -199,7 +186,7 @@ public ReplyCQ qy() { return query(); } - }, _forDeriveReferrer); + }, _forDerivedReferrer, _forScalarSelect, _forScalarSubQuery); } return _specification; } @@ -210,8 +197,10 @@ protected MessageCB.Specification _message; public Specification(ConditionBean baseCB, SpQyCall qyCall, - boolean forDeriveReferrer) { - super(baseCB, qyCall, forDeriveReferrer); + boolean forDeriveReferrer, boolean forScalarSelect, + boolean forScalarSubQuery) { + super(baseCB, qyCall, forDeriveReferrer, forScalarSelect, + forScalarSubQuery); _myQyCall = qyCall; } @@ -272,7 +261,8 @@ public MessageCQ qy() { return _myQyCall.qy().queryMessage(); } - }, _forDeriveReferrer); + }, _forDerivedReferrer, _forScalarSelect, + _forScalarSubQuery); } return _message; } Modified: board/trunk/src/main/java/jp/sf/pal/board/db/cbean/bs/BsRoleInfoCB.java =================================================================== --- board/trunk/src/main/java/jp/sf/pal/board/db/cbean/bs/BsRoleInfoCB.java 2008-12-27 22:06:42 UTC (rev 1624) +++ board/trunk/src/main/java/jp/sf/pal/board/db/cbean/bs/BsRoleInfoCB.java 2008-12-27 22:09:08 UTC (rev 1625) @@ -17,7 +17,6 @@ * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public class BsRoleInfoCB extends AbstractConditionBean { //========================================================================== @@ -86,7 +85,12 @@ return _conditionQuery; } - public ConditionQuery getConditionQueryAsInterface() { + /** + * The implementation. + * + * @return The conditionQuery of the local table as interface. (NotNull) + */ + public ConditionQuery localCQ() { return getConditionQuery(); } @@ -136,23 +140,6 @@ query().xsetUnionAllQuery(cq); } - /** - * @param unionQuery The query of 'union'. (NotNull) - * @deprecated Sorry! Please use union(UnionQuery unionQuery). - */ - public void union(RoleInfoCQ unionQuery) { - query().xsetUnionQuery(unionQuery); - } - - /** - * @param unionQuery The query of 'union'. (NotNull) - * @deprecated Sorry! Please use unionAll(UnionQuery - * unionQuery). - */ - public void unionAll(RoleInfoCQ unionQuery) { - query().xsetUnionAllQuery(unionQuery); - } - public boolean hasUnionQueryOrUnionAllQuery() { return query().hasUnionQueryOrUnionAllQuery(); } @@ -180,7 +167,8 @@ public RoleInfoCQ qy() { return query(); } - }, _forDeriveReferrer); + }, _forDerivedReferrer, _forScalarSelect, + _forScalarSubQuery); } return _specification; } @@ -189,8 +177,10 @@ protected SpQyCall _myQyCall; public Specification(ConditionBean baseCB, SpQyCall qyCall, - boolean forDeriveReferrer) { - super(baseCB, qyCall, forDeriveReferrer); + boolean forDeriveReferrer, boolean forScalarSelect, + boolean forScalarSubQuery) { + super(baseCB, qyCall, forDeriveReferrer, forScalarSelect, + forScalarSubQuery); _myQyCall = qyCall; } Modified: board/trunk/src/main/java/jp/sf/pal/board/db/cbean/bs/BsRoleMappingCB.java =================================================================== --- board/trunk/src/main/java/jp/sf/pal/board/db/cbean/bs/BsRoleMappingCB.java 2008-12-27 22:06:42 UTC (rev 1624) +++ board/trunk/src/main/java/jp/sf/pal/board/db/cbean/bs/BsRoleMappingCB.java 2008-12-27 22:09:08 UTC (rev 1625) @@ -21,7 +21,6 @@ * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public class BsRoleMappingCB extends AbstractConditionBean { //========================================================================== @@ -89,7 +88,12 @@ return _conditionQuery; } - public ConditionQuery getConditionQueryAsInterface() { + /** + * The implementation. + * + * @return The conditionQuery of the local table as interface. (NotNull) + */ + public ConditionQuery localCQ() { return getConditionQuery(); } @@ -139,24 +143,6 @@ query().xsetUnionAllQuery(cq); } - /** - * @param unionQuery The query of 'union'. (NotNull) - * @deprecated Sorry! Please use union(UnionQuery - * unionQuery). - */ - public void union(RoleMappingCQ unionQuery) { - query().xsetUnionQuery(unionQuery); - } - - /** - * @param unionQuery The query of 'union'. (NotNull) - * @deprecated Sorry! Please use unionAll(UnionQuery - * unionQuery). - */ - public void unionAll(RoleMappingCQ unionQuery) { - query().xsetUnionAllQuery(unionQuery); - } - public boolean hasUnionQueryOrUnionAllQuery() { return query().hasUnionQueryOrUnionAllQuery(); } @@ -165,7 +151,6 @@ // ========= // Setup Select // ============ - protected RoleInfoNss _nssRoleInfo; public RoleInfoNss getNssRoleInfo() { @@ -226,7 +211,8 @@ public RoleMappingCQ qy() { return query(); } - }, _forDeriveReferrer); + }, _forDerivedReferrer, _forScalarSelect, + _forScalarSubQuery); } return _specification; } @@ -240,8 +226,10 @@ protected UserInfoCB.Specification _userInfo; public Specification(ConditionBean baseCB, - SpQyCall qyCall, boolean forDeriveReferrer) { - super(baseCB, qyCall, forDeriveReferrer); + SpQyCall qyCall, boolean forDeriveReferrer, + boolean forScalarSelect, boolean forScalarSubQuery) { + super(baseCB, qyCall, forDeriveReferrer, forScalarSelect, + forScalarSubQuery); _myQyCall = qyCall; } @@ -285,7 +273,8 @@ public RoleInfoCQ qy() { return _myQyCall.qy().queryRoleInfo(); } - }, _forDeriveReferrer); + }, _forDerivedReferrer, _forScalarSelect, + _forScalarSubQuery); } return _roleInfo; } @@ -304,7 +293,8 @@ public UserInfoCQ qy() { return _myQyCall.qy().queryUserInfo(); } - }, _forDeriveReferrer); + }, _forDerivedReferrer, _forScalarSelect, + _forScalarSubQuery); } return _userInfo; } Modified: board/trunk/src/main/java/jp/sf/pal/board/db/cbean/bs/BsUserInfoCB.java =================================================================== --- board/trunk/src/main/java/jp/sf/pal/board/db/cbean/bs/BsUserInfoCB.java 2008-12-27 22:06:42 UTC (rev 1624) +++ board/trunk/src/main/java/jp/sf/pal/board/db/cbean/bs/BsUserInfoCB.java 2008-12-27 22:09:08 UTC (rev 1625) @@ -23,7 +23,6 @@ * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public class BsUserInfoCB extends AbstractConditionBean { //========================================================================== @@ -92,7 +91,12 @@ return _conditionQuery; } - public ConditionQuery getConditionQueryAsInterface() { + /** + * The implementation. + * + * @return The conditionQuery of the local table as interface. (NotNull) + */ + public ConditionQuery localCQ() { return getConditionQuery(); } @@ -142,23 +146,6 @@ query().xsetUnionAllQuery(cq); } - /** - * @param unionQuery The query of 'union'. (NotNull) - * @deprecated Sorry! Please use union(UnionQuery unionQuery). - */ - public void union(UserInfoCQ unionQuery) { - query().xsetUnionQuery(unionQuery); - } - - /** - * @param unionQuery The query of 'union'. (NotNull) - * @deprecated Sorry! Please use unionAll(UnionQuery - * unionQuery). - */ - public void unionAll(UserInfoCQ unionQuery) { - query().xsetUnionAllQuery(unionQuery); - } - public boolean hasUnionQueryOrUnionAllQuery() { return query().hasUnionQueryOrUnionAllQuery(); } @@ -167,7 +154,6 @@ // ========= // Setup Select // ============ - protected GroupInfoNss _nssGroupInfo; public GroupInfoNss getNssGroupInfo() { @@ -228,7 +214,8 @@ public UserInfoCQ qy() { return query(); } - }, _forDeriveReferrer); + }, _forDerivedReferrer, _forScalarSelect, + _forScalarSubQuery); } return _specification; } @@ -241,8 +228,10 @@ protected RoleInfoCB.Specification _roleInfo; public Specification(ConditionBean baseCB, SpQyCall qyCall, - boolean forDeriveReferrer) { - super(baseCB, qyCall, forDeriveReferrer); + boolean forDeriveReferrer, boolean forScalarSelect, + boolean forScalarSubQuery) { + super(baseCB, qyCall, forDeriveReferrer, forScalarSelect, + forScalarSubQuery); _myQyCall = qyCall; } @@ -306,6 +295,10 @@ doColumn("GROUP_ID"); } + public void columnStatus() { + doColumn("STATUS"); + } + public void columnCreatedTime() { doColumn("CREATED_TIME"); } @@ -362,7 +355,8 @@ public GroupInfoCQ qy() { return _myQyCall.qy().queryGroupInfo(); } - }, _forDeriveReferrer); + }, _forDerivedReferrer, _forScalarSelect, + _forScalarSubQuery); } return _groupInfo; } @@ -381,7 +375,8 @@ public RoleInfoCQ qy() { return _myQyCall.qy().queryRoleInfo(); } - }, _forDeriveReferrer); + }, _forDerivedReferrer, _forScalarSelect, + _forScalarSubQuery); } return _roleInfo; } Modified: board/trunk/src/main/java/jp/sf/pal/board/db/cbean/cq/bs/AbstractBsAttachmentCQ.java =================================================================== --- board/trunk/src/main/java/jp/sf/pal/board/db/cbean/cq/bs/AbstractBsAttachmentCQ.java 2008-12-27 22:06:42 UTC (rev 1624) +++ board/trunk/src/main/java/jp/sf/pal/board/db/cbean/cq/bs/AbstractBsAttachmentCQ.java 2008-12-27 22:09:08 UTC (rev 1625) @@ -18,7 +18,6 @@ * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public abstract class AbstractBsAttachmentCQ extends AbstractConditionQuery { //========================================================================== @@ -48,7 +47,8 @@ // ===== /** - * Equal(=). And NullIgnored, OnceRegistered. {PK : ID : NotNull : BIGINT} + * Equal(=). And NullIgnored, OnlyOnceRegistered. {PK : ID : NotNull : + * BIGINT} * * @param id The value of id as equal. */ @@ -57,7 +57,7 @@ } /** - * NotEqual(!=). And NullIgnored, OnceRegistered. + * NotEqual(!=). And NullIgnored, OnlyOnceRegistered. * * @param id The value of id as notEqual. */ @@ -66,7 +66,7 @@ } /** - * GreaterThan(>). And NullIgnored, OnceRegistered. + * GreaterThan(>). And NullIgnored, OnlyOnceRegistered. * * @param id The value of id as greaterThan. */ @@ -75,7 +75,7 @@ } /** - * LessThan(<). And NullIgnored, OnceRegistered. + * LessThan(<). And NullIgnored, OnlyOnceRegistered. * * @param id The value of id as lessThan. */ @@ -84,7 +84,7 @@ } /** - * GreaterEqual(>=). And NullIgnored, OnceRegistered. + * GreaterEqual(>=). And NullIgnored, OnlyOnceRegistered. * * @param id The value of id as greaterEqual. */ @@ -93,7 +93,7 @@ } /** - * LessEqual(<=). And NullIgnored, OnceRegistered. + * LessEqual(<=). And NullIgnored, OnlyOnceRegistered. * * @param id The value of id as lessEqual. */ @@ -121,22 +121,6 @@ regId(CK_NINS, cTL(idList)); } - /** - * @param messageAttachmentCBquery Query. - * @deprecated Please use inScopeMessageAttachmentList(subQuery) method. - */ - public void setId_InScopeSubQuery_MessageAttachmentList( - MessageAttachmentCQ messageAttachmentCBquery) { - String subQueryPropertyName = keepId_InScopeSubQuery_MessageAttachmentList(messageAttachmentCBquery);// for - // saving - // query - // - - // value - // . - registerInScopeSubQuery(messageAttachmentCBquery, "ID", - "ATTACHMENT_ID", subQueryPropertyName); - } - public void inScopeMessageAttachmentList( SubQuery subQuery) { assertObjectNotNull("subQuery", subQuery); @@ -144,12 +128,12 @@ cb.xsetupForInScopeSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepId_InScopeSubQuery_MessageAttachmentList(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerInScopeSubQuery(cb.query(), "ID", "ATTACHMENT_ID", subQueryPropertyName); } - abstract public String keepId_InScopeSubQuery_MessageAttachmentList( + public abstract String keepId_InScopeSubQuery_MessageAttachmentList( MessageAttachmentCQ subQuery); public void notInScopeMessageAttachmentList( @@ -159,31 +143,15 @@ cb.xsetupForInScopeSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepId_NotInScopeSubQuery_MessageAttachmentList(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerNotInScopeSubQuery(cb.query(), "ID", "ATTACHMENT_ID", subQueryPropertyName); } - abstract public String keepId_NotInScopeSubQuery_MessageAttachmentList( + public abstract String keepId_NotInScopeSubQuery_MessageAttachmentList( MessageAttachmentCQ subQuery); /** - * @param messageAttachmentCBquery Query. - * @deprecated Please use existsMessageAttachmentList(subQuery) method. - */ - public void setId_ExistsSubQuery_MessageAttachmentList( - MessageAttachmentCQ messageAttachmentCBquery) { - String subQueryPropertyName = keepId_ExistsSubQuery_MessageAttachmentList(messageAttachmentCBquery);// for - // saving - // query - // - - // value - // . - registerExistsSubQuery(messageAttachmentCBquery, "ID", "ATTACHMENT_ID", - subQueryPropertyName); - } - - /** * Set up 'exists' sub-query. {exists (select ATTACHMENT_ID from * MESSAGE_ATTACHMENT where ...)} * @@ -197,12 +165,12 @@ cb.xsetupForExistsSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepId_ExistsSubQuery_MessageAttachmentList(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerExistsSubQuery(cb.query(), "ID", "ATTACHMENT_ID", subQueryPropertyName); } - abstract public String keepId_ExistsSubQuery_MessageAttachmentList( + public abstract String keepId_ExistsSubQuery_MessageAttachmentList( MessageAttachmentCQ subQuery); /** @@ -220,38 +188,38 @@ cb.xsetupForExistsSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepId_NotExistsSubQuery_MessageAttachmentList(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerNotExistsSubQuery(cb.query(), "ID", "ATTACHMENT_ID", subQueryPropertyName); } - abstract public String keepId_NotExistsSubQuery_MessageAttachmentList( + public abstract String keepId_NotExistsSubQuery_MessageAttachmentList( MessageAttachmentCQ subQuery); public void xderiveMessageAttachmentList(String function, SubQuery subQuery, String aliasName) { assertObjectNotNull("subQuery", subQuery); MessageAttachmentCB cb = new MessageAttachmentCB(); - cb.xsetupForDeriveReferrer(); + cb.xsetupForDerivedReferrer(); subQuery.query(cb); - String subQueryPropertyName = keepId_DeriveSubQuery_MessageAttachmentList(cb - .query());// for saving query-value. - registerDeriveSubQuery(function, cb.query(), "ID", "ATTACHMENT_ID", - subQueryPropertyName, aliasName); + String subQueryPropertyName = keepId_DerivedReferrer_MessageAttachmentList(cb + .query()); // for saving query-value. + registerDerivedReferrerSubQuery(function, cb.query(), "ID", + "ATTACHMENT_ID", subQueryPropertyName, aliasName); } - abstract public String keepId_DeriveSubQuery_MessageAttachmentList( + public abstract String keepId_DerivedReferrer_MessageAttachmentList( MessageAttachmentCQ subQuery); /** - * IsNull(is null). And OnceRegistered. + * IsNull(is null). And OnlyOnceRegistered. */ public void setId_IsNull() { regId(CK_ISN, DUMMY_OBJECT); } /** - * IsNotNull(is not null). And OnceRegistered. + * IsNotNull(is not null). And OnlyOnceRegistered. */ public void setId_IsNotNull() { regId(CK_ISNN, DUMMY_OBJECT); @@ -278,7 +246,7 @@ abstract protected ConditionValue getCValueData(); /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {VARCHAR(255)} + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {VARCHAR(255)} * * @param name The value of name as equal. */ @@ -287,7 +255,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param name The value of name as notEqual. */ @@ -296,7 +264,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param name The value of name as greaterThan. */ @@ -305,7 +273,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param name The value of name as lessThan. */ @@ -314,7 +282,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param name The value of name as greaterEqual. */ @@ -323,7 +291,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param name The value of name as lessEqual. */ @@ -332,7 +300,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param name The value of name as prefixSearch. */ @@ -341,20 +309,6 @@ } /** - * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, - * SeveralRegistered. - * - * @param name The value of name as likeSearch. - * @param likeSearchOption The option of like-search. (NotNull) - */ - public void setName_LikeSearch( - String name, - jp.sf.pal.board.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { - registerLikeSearchQuery(CK_LS, fRES(name), getCValueName(), "NAME", - "Name", "name", likeSearchOption); - } - - /** * InScope(in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * @@ -365,38 +319,52 @@ } /** - * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * - * @param name The collection of name as inScope. - * @param inScopeOption The option of in-scope. (NotNull) + * @param nameList The collection of name as notInScope. */ - public void setName_InScope( + public void setName_NotInScope(Collection nameList) { + regName(CK_NINS, cTL(nameList)); + } + + /** + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param name The value of name as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) + */ + public void setName_LikeSearch( String name, - jp.sf.pal.board.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(name), getCValueName(), "NAME", - "Name", "name", inScopeOption); + jp.sf.pal.board.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(name), getCValueName(), "NAME", "Name", "name", + likeSearchOption); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param nameList The collection of name as notInScope. + * @param name The value of name as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setName_NotInScope(Collection nameList) { - regName(CK_NINS, cTL(nameList)); + public void setName_NotLikeSearch( + String name, + jp.sf.pal.board.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(name), getCValueName(), "NAME", "Name", "name", + likeSearchOption); } /** - * IsNull(is null). And OnceRegistered. + * IsNull(is null). And OnlyOnceRegistered. */ public void setName_IsNull() { regName(CK_ISN, DUMMY_OBJECT); } /** - * IsNotNull(is not null). And OnceRegistered. + * IsNotNull(is not null). And OnlyOnceRegistered. */ public void setName_IsNotNull() { regName(CK_ISNN, DUMMY_OBJECT); @@ -413,7 +381,7 @@ abstract protected ConditionValue getCValueName(); /** - * Equal(=). And NullIgnored, OnceRegistered. {INTEGER} + * Equal(=). And NullIgnored, OnlyOnceRegistered. {INTEGER} * * @param size The value of size as equal. */ @@ -422,7 +390,7 @@ } /** - * NotEqual(!=). And NullIgnored, OnceRegistered. + * NotEqual(!=). And NullIgnored, OnlyOnceRegistered. * * @param size The value of size as notEqual. */ @@ -431,7 +399,7 @@ } /** - * GreaterThan(>). And NullIgnored, OnceRegistered. + * GreaterThan(>). And NullIgnored, OnlyOnceRegistered. * * @param size The value of size as greaterThan. */ @@ -440,7 +408,7 @@ } /** - * LessThan(<). And NullIgnored, OnceRegistered. + * LessThan(<). And NullIgnored, OnlyOnceRegistered. * * @param size The value of size as lessThan. */ @@ -449,7 +417,7 @@ } /** - * GreaterEqual(>=). And NullIgnored, OnceRegistered. + * GreaterEqual(>=). And NullIgnored, OnlyOnceRegistered. * * @param size The value of size as greaterEqual. */ @@ -458,7 +426,7 @@ } /** - * LessEqual(<=). And NullIgnored, OnceRegistered. + * LessEqual(<=). And NullIgnored, OnlyOnceRegistered. * * @param size The value of size as lessEqual. */ @@ -487,14 +455,14 @@ } /** - * IsNull(is null). And OnceRegistered. + * IsNull(is null). And OnlyOnceRegistered. */ public void setSize_IsNull() { regSize(CK_ISN, DUMMY_OBJECT); } /** - * IsNotNull(is not null). And OnceRegistered. + * IsNotNull(is not null). And OnlyOnceRegistered. */ public void setSize_IsNotNull() { regSize(CK_ISNN, DUMMY_OBJECT); @@ -511,7 +479,7 @@ abstract protected ConditionValue getCValueSize(); /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {VARCHAR(40)} + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {VARCHAR(40)} * * @param contentType The value of contentType as equal. */ @@ -520,7 +488,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param contentType The value of contentType as notEqual. */ @@ -529,7 +497,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param contentType The value of contentType as greaterThan. */ @@ -538,7 +506,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param contentType The value of contentType as lessThan. */ @@ -547,7 +515,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param contentType The value of contentType as greaterEqual. */ @@ -556,7 +524,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param contentType The value of contentType as lessEqual. */ @@ -565,7 +533,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param contentType The value of contentType as prefixSearch. */ @@ -574,21 +542,6 @@ } /** - * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, - * SeveralRegistered. - * - * @param contentType The value of contentType as likeSearch. - * @param likeSearchOption The option of like-search. (NotNull) - */ - public void setContentType_LikeSearch( - String contentType, - jp.sf.pal.board.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { - registerLikeSearchQuery(CK_LS, fRES(contentType), - getCValueContentType(), "CONTENT_TYPE", "ContentType", - "contentType", likeSearchOption); - } - - /** * InScope(in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * @@ -599,38 +552,52 @@ } /** - * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * - * @param contentType The collection of contentType as inScope. - * @param inScopeOption The option of in-scope. (NotNull) + * @param contentTypeList The collection of contentType as notInScope. */ - public void setContentType_InScope( + public void setContentType_NotInScope(Collection contentTypeList) { + regContentType(CK_NINS, cTL(contentTypeList)); + } + + /** + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param contentType The value of contentType as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) + */ + public void setContentType_LikeSearch( String contentType, - jp.sf.pal.board.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(contentType), getCValueContentType(), - "CONTENT_TYPE", "ContentType", "contentType", inScopeOption); + jp.sf.pal.board.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(contentType), getCValueContentType(), + "CONTENT_TYPE", "ContentType", "contentType", likeSearchOption); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param contentTypeList The collection of contentType as notInScope. + * @param contentType The value of contentType as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setContentType_NotInScope(Collection contentTypeList) { - regContentType(CK_NINS, cTL(contentTypeList)); + public void setContentType_NotLikeSearch( + String contentType, + jp.sf.pal.board.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(contentType), getCValueContentType(), + "CONTENT_TYPE", "ContentType", "contentType", likeSearchOption); } /** - * IsNull(is null). And OnceRegistered. + * IsNull(is null). And OnlyOnceRegistered. */ public void setContentType_IsNull() { regContentType(CK_ISN, DUMMY_OBJECT); } /** - * IsNotNull(is not null). And OnceRegistered. + * IsNotNull(is not null). And OnlyOnceRegistered. */ public void setContentType_IsNotNull() { regContentType(CK_ISNN, DUMMY_OBJECT); @@ -649,7 +616,7 @@ abstract protected ConditionValue getCValueContentType(); /** - * Equal(=). And NullIgnored, OnceRegistered. {NotNull : TIMESTAMP} + * Equal(=). And NullIgnored, OnlyOnceRegistered. {NotNull : TIMESTAMP} * * @param createdTime The value of createdTime as equal. */ @@ -658,7 +625,7 @@ } /** - * NotEqual(!=). And NullIgnored, OnceRegistered. + * NotEqual(!=). And NullIgnored, OnlyOnceRegistered. * * @param createdTime The value of createdTime as notEqual. */ @@ -667,7 +634,7 @@ } /** - * GreaterThan(>). And NullIgnored, OnceRegistered. + * GreaterThan(>). And NullIgnored, OnlyOnceRegistered. * * @param createdTime The value of createdTime as greaterThan. */ @@ -676,7 +643,7 @@ } /** - * LessThan(>). And NullIgnored, OnceRegistered. + * LessThan(>). And NullIgnored, OnlyOnceRegistered. * * @param createdTime The value of createdTime as lessThan. */ @@ -685,7 +652,7 @@ } /** - * GreaterEqual(>). And NullIgnored, OnceRegistered. + * GreaterEqual(>). And NullIgnored, OnlyOnceRegistered. * * @param createdTime The value of createdTime as greaterEqual. */ @@ -694,7 +661,7 @@ } /** - * LessEqual(>). And NullIgnored, OnceRegistered. + * LessEqual(>). And NullIgnored, OnlyOnceRegistered. * * @param createdTime The value of createdTime as lessEqual. */ @@ -704,7 +671,7 @@ /** * FromTo($fromDate <= COLUMN_NAME <= $toDate). And NullIgnored, - * OnceRegistered. {NotNull : TIMESTAMP} + * OnlyOnceRegistered. {NotNull : TIMESTAMP} * * @param fromDate The from-date of createdTime. (Nullable) * @param toDate The to-date of createdTime. (Nullable) @@ -721,7 +688,7 @@ /** * FromTo($fromDate <= COLUMN_NAME < $toDate + 1). And NullIgnored, - * OnceRegistered. {NotNull : TIMESTAMP} + * OnlyOnceRegistered. {NotNull : TIMESTAMP} * * @param fromDate The from-date of createdTime. (Nullable) * @param toDate The to-date of createdTime. (Nullable) @@ -747,7 +714,7 @@ abstract protected ConditionValue getCValueCreatedTime(); /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {NotNull : + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {NotNull : * VARCHAR(255)} * * @param createdBy The value of createdBy as equal. @@ -757,7 +724,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param createdBy The value of createdBy as notEqual. */ @@ -766,7 +733,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param createdBy The value of createdBy as greaterThan. */ @@ -775,7 +742,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param createdBy The value of createdBy as lessThan. */ @@ -784,7 +751,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param createdBy The value of createdBy as greaterEqual. */ @@ -793,7 +760,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param createdBy The value of createdBy as lessEqual. */ @@ -802,7 +769,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param createdBy The value of createdBy as prefixSearch. */ @@ -811,20 +778,6 @@ } /** - * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, - * SeveralRegistered. - * - * @param createdBy The value of createdBy as likeSearch. - * @param likeSearchOption The option of like-search. (NotNull) - */ - public void setCreatedBy_LikeSearch( - String createdBy, - jp.sf.pal.board.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { - registerLikeSearchQuery(CK_LS, fRES(createdBy), getCValueCreatedBy(), - "CREATED_BY", "CreatedBy", "createdBy", likeSearchOption); - } - - /** * InScope(in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * @@ -835,27 +788,41 @@ } /** - * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * - * @param createdBy The collection of createdBy as inScope. - * @param inScopeOption The option of in-scope. (NotNull) + * @param createdByList The collection of createdBy as notInScope. */ - public void setCreatedBy_InScope( + public void setCreatedBy_NotInScope(Collection createdByList) { + regCreatedBy(CK_NINS, cTL(createdByList)); + } + + /** + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param createdBy The value of createdBy as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) + */ + public void setCreatedBy_LikeSearch( String createdBy, - jp.sf.pal.board.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(createdBy), getCValueCreatedBy(), - "CREATED_BY", "CreatedBy", "createdBy", inScopeOption); + jp.sf.pal.board.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(createdBy), getCValueCreatedBy(), "CREATED_BY", + "CreatedBy", "createdBy", likeSearchOption); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param createdByList The collection of createdBy as notInScope. + * @param createdBy The value of createdBy as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setCreatedBy_NotInScope(Collection createdByList) { - regCreatedBy(CK_NINS, cTL(createdByList)); + public void setCreatedBy_NotLikeSearch( + String createdBy, + jp.sf.pal.board.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(createdBy), getCValueCreatedBy(), "CREATED_BY", + "CreatedBy", "createdBy", likeSearchOption); } protected void regCreatedBy(ConditionKey key, Object value) { @@ -870,6 +837,50 @@ abstract protected ConditionValue getCValueCreatedBy(); + public SSQFunction scalar_Equal() { + return xcreateSSQFunction("="); + } + + public SSQFunction scalar_GreaterEqual() { + return xcreateSSQFunction(">="); + } + + public SSQFunction scalar_GreaterThan() { + return xcreateSSQFunction(">"); + } + + public SSQFunction scalar_LessEqual() { + return xcreateSSQFunction("<="); + } + + public SSQFunction scalar_LessThan() { + return xcreateSSQFunction("<"); + } + + protected SSQFunction xcreateSSQFunction(final String operand) { + return new SSQFunction(new SSQSetupper() { + public void setup(String function, SubQuery subQuery) { + xscalarSubQuery(function, subQuery, operand); + } + }); + } + + protected void xscalarSubQuery(String function, + SubQuery subQuery, String operand) { + assertObjectNotNull("subQuery", subQuery); + AttachmentCB cb = new AttachmentCB(); + cb.xsetupForScalarSubQuery(); + subQuery.query(cb); + String subQueryPropertyName = keepScalarSubQuery(cb.query()); // for + // saving + // query + // -value. + registerScalarSubQuery(function, cb.query(), subQueryPropertyName, + operand); + } + + public abstract String keepScalarSubQuery(AttachmentCQ subQuery); + // Very Internal (for Suppressing Warn about 'Not Use Import') protected String getConditionBeanClassNameInternally() { return AttachmentCB.class.getName(); Modified: board/trunk/src/main/java/jp/sf/pal/board/db/cbean/cq/bs/AbstractBsCategoryAccessCQ.java =================================================================== --- board/trunk/src/main/java/jp/sf/pal/board/db/cbean/cq/bs/AbstractBsCategoryAccessCQ.java 2008-12-27 22:06:42 UTC (rev 1624) +++ board/trunk/src/main/java/jp/sf/pal/board/db/cbean/cq/bs/AbstractBsCategoryAccessCQ.java 2008-12-27 22:09:08 UTC (rev 1625) @@ -18,7 +18,6 @@ * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public abstract class AbstractBsCategoryAccessCQ extends AbstractConditionQuery { //========================================================================== @@ -48,7 +47,8 @@ // ===== /** - * Equal(=). And NullIgnored, OnceRegistered. {PK : ID : NotNull : BIGINT} + * Equal(=). And NullIgnored, OnlyOnceRegistered. {PK : ID : NotNull : + * BIGINT} * * @param id The value of id as equal. */ @@ -57,7 +57,7 @@ } /** - * NotEqual(!=). And NullIgnored, OnceRegistered. + * NotEqual(!=). And NullIgnored, OnlyOnceRegistered. * * @param id The value of id as notEqual. */ @@ -66,7 +66,7 @@ } /** - * GreaterThan(>). And NullIgnored, OnceRegistered. + * GreaterThan(>). And NullIgnored, OnlyOnceRegistered. * * @param id The value of id as greaterThan. */ @@ -75,7 +75,7 @@ } /** - * LessThan(<). And NullIgnored, OnceRegistered. + * LessThan(<). And NullIgnored, OnlyOnceRegistered. * * @param id The value of id as lessThan. */ @@ -84,7 +84,7 @@ } /** - * GreaterEqual(>=). And NullIgnored, OnceRegistered. + * GreaterEqual(>=). And NullIgnored, OnlyOnceRegistered. * * @param id The value of id as greaterEqual. */ @@ -93,7 +93,7 @@ } /** - * LessEqual(<=). And NullIgnored, OnceRegistered. + * LessEqual(<=). And NullIgnored, OnlyOnceRegistered. * * @param id The value of id as lessEqual. */ @@ -122,14 +122,14 @@ } /** - * IsNull(is null). And OnceRegistered. + * IsNull(is null). And OnlyOnceRegistered. */ public void setId_IsNull() { regId(CK_ISN, DUMMY_OBJECT); } /** - * IsNotNull(is not null). And OnceRegistered. + * IsNotNull(is not null). And OnlyOnceRegistered. */ public void setId_IsNotNull() { regId(CK_ISNN, DUMMY_OBJECT); @@ -146,7 +146,7 @@ abstract protected ConditionValue getCValueId(); /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {NotNull : + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {NotNull : * VARCHAR(255)} * * @param name The value of name as equal. @@ -156,7 +156,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param name The value of name as notEqual. */ @@ -165,7 +165,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param name The value of name as greaterThan. */ @@ -174,7 +174,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param name The value of name as lessThan. */ @@ -183,7 +183,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param name The value of name as greaterEqual. */ @@ -192,7 +192,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param name The value of name as lessEqual. */ @@ -201,7 +201,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param name The value of name as prefixSearch. */ @@ -210,20 +210,6 @@ } /** - * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, - * SeveralRegistered. - * - * @param name The value of name as likeSearch. - * @param likeSearchOption The option of like-search. (NotNull) - */ - public void setName_LikeSearch( - String name, - jp.sf.pal.board.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { - registerLikeSearchQuery(CK_LS, fRES(name), getCValueName(), "NAME", - "Name", "name", likeSearchOption); - } - - /** * InScope(in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * @@ -234,27 +220,41 @@ } /** - * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * - * @param name The collection of name as inScope. - * @param inScopeOption The option of in-scope. (NotNull) + * @param nameList The collection of name as notInScope. */ - public void setName_InScope( + public void setName_NotInScope(Collection nameList) { + regName(CK_NINS, cTL(nameList)); + } + + /** + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param name The value of name as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) + */ + public void setName_LikeSearch( String name, - jp.sf.pal.board.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(name), getCValueName(), "NAME", - "Name", "name", inScopeOption); + jp.sf.pal.board.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(name), getCValueName(), "NAME", "Name", "name", + likeSearchOption); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param nameList The collection of name as notInScope. + * @param name The value of name as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setName_NotInScope(Collection nameList) { - regName(CK_NINS, cTL(nameList)); + public void setName_NotLikeSearch( + String name, + jp.sf.pal.board.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(name), getCValueName(), "NAME", "Name", "name", + likeSearchOption); } protected void regName(ConditionKey key, Object value) { @@ -268,7 +268,7 @@ abstract protected ConditionValue getCValueName(); /** - * Equal(=). And NullIgnored, OnceRegistered. {NotNull : INTEGER} + * Equal(=). And NullIgnored, OnlyOnceRegistered. {NotNull : INTEGER} * * @param accessType The value of accessType as equal. */ @@ -277,7 +277,7 @@ } /** - * NotEqual(!=). And NullIgnored, OnceRegistered. + * NotEqual(!=). And NullIgnored, OnlyOnceRegistered. * * @param accessType The value of accessType as notEqual. */ @@ -286,7 +286,7 @@ } /** - * GreaterThan(>). And NullIgnored, OnceRegistered. + * GreaterThan(>). And NullIgnored, OnlyOnceRegistered. * * @param accessType The value of accessType as greaterThan. */ @@ -295,7 +295,7 @@ } /** - * LessThan(<). And NullIgnored, OnceRegistered. + * LessThan(<). And NullIgnored, OnlyOnceRegistered. * * @param accessType The value of accessType as lessThan. */ @@ -304,7 +304,7 @@ } /** - * GreaterEqual(>=). And NullIgnored, OnceRegistered. + * GreaterEqual(>=). And NullIgnored, OnlyOnceRegistered. * * @param accessType The value of accessType as greaterEqual. */ @@ -313,7 +313,7 @@ } /** - * LessEqual(<=). And NullIgnored, OnceRegistered. + * LessEqual(<=). And NullIgnored, OnlyOnceRegistered. * * @param accessType The value of accessType as lessEqual. */ @@ -354,7 +354,7 @@ abstract protected ConditionValue getCValueAccessType(); /** - * Equal(=). And NullIgnored, OnceRegistered. {NotNull : INTEGER : FK to + * Equal(=). And NullIgnored, OnlyOnceRegistered. {NotNull : INTEGER : FK to * CATEGORY} * * @param categoryId The value of categoryId as equal. @@ -364,7 +364,7 @@ } /** - * NotEqual(!=). And NullIgnored, OnceRegistered. + * NotEqual(!=). And NullIgnored, OnlyOnceRegistered. * * @param categoryId The value of categoryId as notEqual. */ @@ -373,7 +373,7 @@ } /** - * GreaterThan(>). And NullIgnored, OnceRegistered. + * GreaterThan(>). And NullIgnored, OnlyOnceRegistered. * * @param categoryId The value of categoryId as greaterThan. */ @@ -382,7 +382,7 @@ } /** - * LessThan(<). And NullIgnored, OnceRegistered. + * LessThan(<). And NullIgnored, OnlyOnceRegistered. * * @param categoryId The value of categoryId as lessThan. */ @@ -391,7 +391,7 @@ } /** - * GreaterEqual(>=). And NullIgnored, OnceRegistered. + * GreaterEqual(>=). And NullIgnored, OnlyOnceRegistered. * * @param categoryId The value of categoryId as greaterEqual. */ @@ -400,7 +400,7 @@ } /** - * LessEqual(<=). And NullIgnored, OnceRegistered. + * LessEqual(<=). And NullIgnored, OnlyOnceRegistered. * * @param categoryId The value of categoryId as lessEqual. */ @@ -428,34 +428,18 @@ regCategoryId(CK_NINS, cTL(categoryIdList)); } - /** - * @param categoryCBquery Query. - * @deprecated Please use inScopeCategory(subQuery) method. - */ - public void setCategoryId_InScopeSubQuery_Category( - CategoryCQ categoryCBquery) { - String subQueryPropertyName = keepCategoryId_InScopeSubQuery_Category(categoryCBquery);// for - // saving - // query - // - - // value - // . - registerInScopeSubQuery(categoryCBquery, "CATEGORY_ID", "ID", - subQueryPropertyName); - } - public void inScopeCategory(SubQuery subQuery) { assertObjectNotNull("subQuery", subQuery); CategoryCB cb = new CategoryCB(); cb.xsetupForInScopeSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepCategoryId_InScopeSubQuery_Category(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerInScopeSubQuery(cb.query(), "CATEGORY_ID", "ID", subQueryPropertyName); } - abstract public String keepCategoryId_InScopeSubQuery_Category( + public abstract String keepCategoryId_InScopeSubQuery_Category( CategoryCQ subQuery); protected void regCategoryId(ConditionKey key, Object value) { @@ -471,7 +455,7 @@ abstract protected ConditionValue getCValueCategoryId(); /** - * Equal(=). And NullIgnored, OnceRegistered. {NotNull : TIMESTAMP} + * Equal(=). And NullIgnored, OnlyOnceRegistered. {NotNull : TIMESTAMP} * * @param createdTime The value of createdTime as equal. */ @@ -480,7 +464,7 @@ } /** - * NotEqual(!=). And NullIgnored, OnceRegistered. + * NotEqual(!=). And NullIgnored, OnlyOnceRegistered. * * @param createdTime The value of createdTime as notEqual. */ @@ -489,7 +473,7 @@ } /** - * GreaterThan(>). And NullIgnored, OnceRegistered. + * GreaterThan(>). And NullIgnored, OnlyOnceRegistered. * * @param createdTime The value of createdTime as greaterThan. */ @@ -498,7 +482,7 @@ } /** - * LessThan(>). And NullIgnored, OnceRegistered. + * LessThan(>). And NullIgnored, OnlyOnceRegistered. * * @param createdTime The value of createdTime as lessThan. */ @@ -507,7 +491,7 @@ } /** - * GreaterEqual(>). And NullIgnored, OnceRegistered. + * GreaterEqual(>). And NullIgnored, OnlyOnceRegistered. * * @param createdTime The value of createdTime as greaterEqual. */ @@ -516,7 +500,7 @@ } /** - * LessEqual(>). And NullIgnored, OnceRegistered. + * LessEqual(>). And NullIgnored, OnlyOnceRegistered. * * @param createdTime The value of createdTime as lessEqual. */ @@ -526,7 +510,7 @@ /** * FromTo($fromDate <= COLUMN_NAME <= $toDate). And NullIgnored, - * OnceRegistered. {NotNull : TIMESTAMP} + * OnlyOnceRegistered. {NotNull : TIMESTAMP} * * @param fromDate The from-date of createdTime. (Nullable) * @param toDate The to-date of createdTime. (Nullable) @@ -543,7 +527,7 @@ /** * FromTo($fromDate <= COLUMN_NAME < $toDate + 1). And NullIgnored, - * OnceRegistered. {NotNull : TIMESTAMP} + * OnlyOnceRegistered. {NotNull : TIMESTAMP} * * @param fromDate The from-date of createdTime. (Nullable) * @param toDate The to-date of createdTime. (Nullable) @@ -569,7 +553,7 @@ abstract protected ConditionValue getCValueCreatedTime(); /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {NotNull : + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {NotNull : * VARCHAR(255)} * * @param createdBy The value of createdBy as equal. @@ -579,7 +563,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param createdBy The value of createdBy as notEqual. */ @@ -588,7 +572,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param createdBy The value of createdBy as greaterThan. */ @@ -597,7 +581,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param createdBy The value of createdBy as lessThan. */ @@ -606,7 +590,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param createdBy The value of createdBy as greaterEqual. */ @@ -615,7 +599,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param createdBy The value of createdBy as lessEqual. */ @@ -624,7 +608,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param createdBy The value of createdBy as prefixSearch. */ @@ -633,20 +617,6 @@ } /** - * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, - * SeveralRegistered. - * - * @param createdBy The value of createdBy as likeSearch. - * @param likeSearchOption The option of like-search. (NotNull) - */ - public void setCreatedBy_LikeSearch( - String createdBy, - jp.sf.pal.board.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { - registerLikeSearchQuery(CK_LS, fRES(createdBy), getCValueCreatedBy(), - "CREATED_BY", "CreatedBy", "createdBy", likeSearchOption); - } - - /** * InScope(in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * @@ -657,27 +627,41 @@ } /** - * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * - * @param createdBy The collection of createdBy as inScope. - * @param inScopeOption The option of in-scope. (NotNull) + * @param createdByList The collection of createdBy as notInScope. */ - public void setCreatedBy_InScope( + public void setCreatedBy_NotInScope(Collection createdByList) { + regCreatedBy(CK_NINS, cTL(createdByList)); + } + + /** + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param createdBy The value of createdBy as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) + */ + public void setCreatedBy_LikeSearch( String createdBy, - jp.sf.pal.board.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(createdBy), getCValueCreatedBy(), - "CREATED_BY", "CreatedBy", "createdBy", inScopeOption); + jp.sf.pal.board.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(createdBy), getCValueCreatedBy(), "CREATED_BY", + "CreatedBy", "createdBy", likeSearchOption); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param createdByList The collection of createdBy as notInScope. + * @param createdBy The value of createdBy as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setCreatedBy_NotInScope(Collection createdByList) { - regCreatedBy(CK_NINS, cTL(createdByList)); + public void setCreatedBy_NotLikeSearch( + String createdBy, + jp.sf.pal.board.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(createdBy), getCValueCreatedBy(), "CREATED_BY", + "CreatedBy", "createdBy", likeSearchOption); } protected void regCreatedBy(ConditionKey key, Object value) { @@ -693,7 +677,7 @@ abstract protected ConditionValue getCValueCreatedBy(); /** - * Equal(=). And NullIgnored, OnceRegistered. {NotNull : TIMESTAMP} + * Equal(=). And NullIgnored, OnlyOnceRegistered. {NotNull : TIMESTAMP} * * @param updatedTime The value of updatedTime as equal. */ @@ -702,7 +686,7 @@ } /** - * NotEqual(!=). And NullIgnored, OnceRegistered. + * NotEqual(!=). And NullIgnored, OnlyOnceRegistered. * * @param updatedTime The value of updatedTime as notEqual. */ @@ -711,7 +695,7 @@ } /** - * GreaterThan(>). And NullIgnored, OnceRegistered. + * GreaterThan(>). And NullIgnored, OnlyOnceRegistered. * * @param updatedTime The value of updatedTime as greaterThan. */ @@ -720,7 +704,7 @@ } /** - * LessThan(>). And NullIgnored, OnceRegistered. + * LessThan(>). And NullIgnored, OnlyOnceRegistered. * * @param updatedTime The value of updatedTime as lessThan. */ @@ -729,7 +713,7 @@ } /** - * GreaterEqual(>). And NullIgnored, OnceRegistered. + * GreaterEqual(>). And NullIgnored, OnlyOnceRegistered. * * @param updatedTime The value of updatedTime as greaterEqual. */ @@ -738,7 +722,7 @@ } /** - * LessEqual(>). And NullIgnored, OnceRegistered. + * LessEqual(>). And NullIgnored, OnlyOnceRegistered. * * @param updatedTime The value of updatedTime as lessEqual. */ @@ -748,7 +732,7 @@ /** * FromTo($fromDate <= COLUMN_NAME <= $toDate). And NullIgnored, - * OnceRegistered. {NotNull : TIMESTAMP} + * OnlyOnceRegistered. {NotNull : TIMESTAMP} * * @param fromDate The from-date of updatedTime. (Nullable) * @param toDate The to-date of updatedTime. (Nullable) @@ -765,7 +749,7 @@ /** * FromTo($fromDate <= COLUMN_NAME < $toDate + 1). And NullIgnored, - * OnceRegistered. {NotNull : TIMESTAMP} + * OnlyOnceRegistered. {NotNull : TIMESTAMP} * * @param fromDate The from-date of updatedTime. (Nullable) * @param toDate The to-date of updatedTime. (Nullable) @@ -791,7 +775,7 @@ abstract protected ConditionValue getCValueUpdatedTime(); /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {NotNull : + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {NotNull : * VARCHAR(255)} * * @param updatedBy The value of updatedBy as equal. @@ -801,7 +785,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param updatedBy The value of updatedBy as notEqual. */ @@ -810,7 +794,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param updatedBy The value of updatedBy as greaterThan. */ @@ -819,7 +803,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param updatedBy The value of updatedBy as lessThan. */ @@ -828,7 +812,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param updatedBy The value of updatedBy as greaterEqual. */ @@ -837,7 +821,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param updatedBy The value of updatedBy as lessEqual. */ @@ -846,7 +830,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param updatedBy The value of updatedBy as prefixSearch. */ @@ -855,20 +839,6 @@ } /** - * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, - * SeveralRegistered. - * - * @param updatedBy The value of updatedBy as likeSearch. - * @param likeSearchOption The option of like-search. (NotNull) - */ - public void setUpdatedBy_LikeSearch( - String updatedBy, - jp.sf.pal.board.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { - registerLikeSearchQuery(CK_LS, fRES(updatedBy), getCValueUpdatedBy(), - "UPDATED_BY", "UpdatedBy", "updatedBy", likeSearchOption); - } - - /** * InScope(in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * @@ -879,27 +849,41 @@ } /** - * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * - * @param updatedBy The collection of updatedBy as inScope. - * @param inScopeOption The option of in-scope. (NotNull) + * @param updatedByList The collection of updatedBy as notInScope. */ - public void setUpdatedBy_InScope( + public void setUpdatedBy_NotInScope(Collection updatedByList) { + regUpdatedBy(CK_NINS, cTL(updatedByList)); + } + + /** + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param updatedBy The value of updatedBy as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) + */ + public void setUpdatedBy_LikeSearch( String updatedBy, - jp.sf.pal.board.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(updatedBy), getCValueUpdatedBy(), - "UPDATED_BY", "UpdatedBy", "updatedBy", inScopeOption); + jp.sf.pal.board.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(updatedBy), getCValueUpdatedBy(), "UPDATED_BY", + "UpdatedBy", "updatedBy", likeSearchOption); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param updatedByList The collection of updatedBy as notInScope. + * @param updatedBy The value of updatedBy as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setUpdatedBy_NotInScope(Collection updatedByList) { - regUpdatedBy(CK_NINS, cTL(updatedByList)); + public void setUpdatedBy_NotLikeSearch( + String updatedBy, + jp.sf.pal.board.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(updatedBy), getCValueUpdatedBy(), "UPDATED_BY", + "UpdatedBy", "updatedBy", likeSearchOption); } protected void regUpdatedBy(ConditionKey key, Object value) { @@ -915,7 +899,7 @@ abstract protected ConditionValue getCValueUpdatedBy(); /** - * Equal(=). And NullIgnored, OnceRegistered. {NotNull : INTEGER : + * Equal(=). And NullIgnored, OnlyOnceRegistered. {NotNull : INTEGER : * Default=[0]} * * @param versionno The value of versionno as equal. @@ -925,7 +909,7 @@ } /** - * NotEqual(!=). And NullIgnored, OnceRegistered. + * NotEqual(!=). And NullIgnored, OnlyOnceRegistered. * * @param versionno The value of versionno as notEqual. */ @@ -934,7 +918,7 @@ } /** - * GreaterThan(>). And NullIgnored, OnceRegistered. + * GreaterThan(>). And NullIgnored, OnlyOnceRegistered. * * @param versionno The value of versionno as greaterThan. */ @@ -943,7 +927,7 @@ } /** - * LessThan(<). And NullIgnored, OnceRegistered. + * LessThan(<). And NullIgnored, OnlyOnceRegistered. * * @param versionno The value of versionno as lessThan. */ @@ -952,7 +936,7 @@ } /** - * GreaterEqual(>=). And NullIgnored, OnceRegistered. + * GreaterEqual(>=). And NullIgnored, OnlyOnceRegistered. * * @param versionno The value of versionno as greaterEqual. */ @@ -961,7 +945,7 @@ } /** - * LessEqual(<=). And NullIgnored, OnceRegistered. + * LessEqual(<=). And NullIgnored, OnlyOnceRegistered. * * @param versionno The value of versionno as lessEqual. */ @@ -1001,6 +985,53 @@ abstract protected ConditionValue getCValueVersionno(); + public SSQFunction scalar_Equal() { + return xcreateSSQFunction("="); + } + + public SSQFunction scalar_GreaterEqual() { + return xcreateSSQFunction(">="); + } + + public SSQFunction scalar_GreaterThan() { + return xcreateSSQFunction(">"); + } + + public SSQFunction scalar_LessEqual() { + return xcreateSSQFunction("<="); + } + + public SSQFunction scalar_LessThan() { + return xcreateSSQFunction("<"); + } + + protected SSQFunction xcreateSSQFunction( + final String operand) { + return new SSQFunction( + new SSQSetupper() { + public void setup(String function, + SubQuery subQuery) { + xscalarSubQuery(function, subQuery, operand); + } + }); + } + + protected void xscalarSubQuery(String function, + SubQuery subQuery, String operand) { + assertObjectNotNull("subQuery", subQuery); + CategoryAccessCB cb = new CategoryAccessCB(); + cb.xsetupForScalarSubQuery(); + subQuery.query(cb); + String subQueryPropertyName = keepScalarSubQuery(cb.query()); // for + // saving + // query + // -value. + registerScalarSubQuery(function, cb.query(), subQueryPropertyName, + operand); + } + + public abstract String keepScalarSubQuery(CategoryAccessCQ subQuery); + // Very Internal (for Suppressing Warn about 'Not Use Import') protected String getConditionBeanClassNameInternally() { return CategoryAccessCB.class.getName(); Modified: board/trunk/src/main/java/jp/sf/pal/board/db/cbean/cq/bs/AbstractBsCategoryCQ.java =================================================================== --- board/trunk/src/main/java/jp/sf/pal/board/db/cbean/cq/bs/AbstractBsCategoryCQ.java 2008-12-27 22:06:42 UTC (rev 1624) +++ board/trunk/src/main/java/jp/sf/pal/board/db/cbean/cq/bs/AbstractBsCategoryCQ.java 2008-12-27 22:09:08 UTC (rev 1625) @@ -20,7 +20,6 @@ * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public abstract class AbstractBsCategoryCQ extends AbstractConditionQuery { //========================================================================== @@ -50,7 +49,8 @@ // ===== /** - * Equal(=). And NullIgnored, OnceRegistered. {PK : ID : NotNull : INTEGER} + * Equal(=). And NullIgnored, OnlyOnceRegistered. {PK : ID : NotNull : + * INTEGER} * * @param id The value of id as equal. */ @@ -59,7 +59,7 @@ } /** - * NotEqual(!=). And NullIgnored, OnceRegistered. + * NotEqual(!=). And NullIgnored, OnlyOnceRegistered. * * @param id The value of id as notEqual. */ @@ -68,7 +68,7 @@ } /** - * GreaterThan(>). And NullIgnored, OnceRegistered. + * GreaterThan(>). And NullIgnored, OnlyOnceRegistered. * * @param id The value of id as greaterThan. */ @@ -77,7 +77,7 @@ } /** - * LessThan(<). And NullIgnored, OnceRegistered. + * LessThan(<). And NullIgnored, OnlyOnceRegistered. * * @param id The value of id as lessThan. */ @@ -86,7 +86,7 @@ } /** - * GreaterEqual(>=). And NullIgnored, OnceRegistered. + * GreaterEqual(>=). And NullIgnored, OnlyOnceRegistered. * * @param id The value of id as greaterEqual. */ @@ -95,7 +95,7 @@ } /** - * LessEqual(<=). And NullIgnored, OnceRegistered. + * LessEqual(<=). And NullIgnored, OnlyOnceRegistered. * * @param id The value of id as lessEqual. */ @@ -123,63 +123,32 @@ regId(CK_NINS, cTL(idList)); } - /** - * @param categoryAccessCBquery Query. - * @deprecated Please use inScopeCategoryAccessList(subQuery) method. - */ - public void setId_InScopeSubQuery_CategoryAccessList( - CategoryAccessCQ categoryAccessCBquery) { - String subQueryPropertyName = keepId_InScopeSubQuery_CategoryAccessList(categoryAccessCBquery);// for - // saving - // query - // - - // value - // . - registerInScopeSubQuery(categoryAccessCBquery, "ID", "CATEGORY_ID", - subQueryPropertyName); - } - public void inScopeCategoryAccessList(SubQuery subQuery) { assertObjectNotNull("subQuery", subQuery); CategoryAccessCB cb = new CategoryAccessCB(); cb.xsetupForInScopeSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepId_InScopeSubQuery_CategoryAccessList(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerInScopeSubQuery(cb.query(), "ID", "CATEGORY_ID", subQueryPropertyName); } - abstract public String keepId_InScopeSubQuery_CategoryAccessList( + public abstract String keepId_InScopeSubQuery_CategoryAccessList( CategoryAccessCQ subQuery); - /** - * @param messageCBquery Query. - * @deprecated Please use inScopeMessageList(subQuery) method. - */ - public void setId_InScopeSubQuery_MessageList(MessageCQ messageCBquery) { - String subQueryPropertyName = keepId_InScopeSubQuery_MessageList(messageCBquery);// for - // saving - // query - // - - // value - // . - registerInScopeSubQuery(messageCBquery, "ID", "CATEGORY_ID", - subQueryPropertyName); - } - public void inScopeMessageList(SubQuery subQuery) { assertObjectNotNull("subQuery", subQuery); MessageCB cb = new MessageCB(); cb.xsetupForInScopeSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepId_InScopeSubQuery_MessageList(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerInScopeSubQuery(cb.query(), "ID", "CATEGORY_ID", subQueryPropertyName); } - abstract public String keepId_InScopeSubQuery_MessageList(MessageCQ subQuery); + public abstract String keepId_InScopeSubQuery_MessageList(MessageCQ subQuery); public void notInScopeCategoryAccessList(SubQuery subQuery) { assertObjectNotNull("subQuery", subQuery); @@ -187,12 +156,12 @@ cb.xsetupForInScopeSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepId_NotInScopeSubQuery_CategoryAccessList(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerNotInScopeSubQuery(cb.query(), "ID", "CATEGORY_ID", subQueryPropertyName); } - abstract public String keepId_NotInScopeSubQuery_CategoryAccessList( + public abstract String keepId_NotInScopeSubQuery_CategoryAccessList( CategoryAccessCQ subQuery); public void notInScopeMessageList(SubQuery subQuery) { @@ -201,31 +170,15 @@ cb.xsetupForInScopeSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepId_NotInScopeSubQuery_MessageList(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerNotInScopeSubQuery(cb.query(), "ID", "CATEGORY_ID", subQueryPropertyName); } - abstract public String keepId_NotInScopeSubQuery_MessageList( + public abstract String keepId_NotInScopeSubQuery_MessageList( MessageCQ subQuery); /** - * @param categoryAccessCBquery Query. - * @deprecated Please use existsCategoryAccessList(subQuery) method. - */ - public void setId_ExistsSubQuery_CategoryAccessList( - CategoryAccessCQ categoryAccessCBquery) { - String subQueryPropertyName = keepId_ExistsSubQuery_CategoryAccessList(categoryAccessCBquery);// for - // saving - // query - // - - // value - // . - registerExistsSubQuery(categoryAccessCBquery, "ID", "CATEGORY_ID", - subQueryPropertyName); - } - - /** * Set up 'exists' sub-query. {exists (select CATEGORY_ID from * CATEGORY_ACCESS where ...)} * @@ -238,30 +191,15 @@ cb.xsetupForExistsSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepId_ExistsSubQuery_CategoryAccessList(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerExistsSubQuery(cb.query(), "ID", "CATEGORY_ID", subQueryPropertyName); } - abstract public String keepId_ExistsSubQuery_CategoryAccessList( + public abstract String keepId_ExistsSubQuery_CategoryAccessList( CategoryAccessCQ subQuery); /** - * @param messageCBquery Query. - * @deprecated Please use existsMessageList(subQuery) method. - */ - public void setId_ExistsSubQuery_MessageList(MessageCQ messageCBquery) { - String subQueryPropertyName = keepId_ExistsSubQuery_MessageList(messageCBquery);// for - // saving - // query - // - - // value - // . - registerExistsSubQuery(messageCBquery, "ID", "CATEGORY_ID", - subQueryPropertyName); - } - - /** * Set up 'exists' sub-query. {exists (select CATEGORY_ID from MESSAGE where * ...)} * @@ -274,12 +212,12 @@ cb.xsetupForExistsSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepId_ExistsSubQuery_MessageList(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerExistsSubQuery(cb.query(), "ID", "CATEGORY_ID", subQueryPropertyName); } - abstract public String keepId_ExistsSubQuery_MessageList(MessageCQ subQuery); + public abstract String keepId_ExistsSubQuery_MessageList(MessageCQ subQuery); /** * Set up 'not exists' sub-query. {not exists (select CATEGORY_ID from @@ -294,12 +232,12 @@ cb.xsetupForExistsSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepId_NotExistsSubQuery_CategoryAccessList(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerNotExistsSubQuery(cb.query(), "ID", "CATEGORY_ID", subQueryPropertyName); } - abstract public String keepId_NotExistsSubQuery_CategoryAccessList( + public abstract String keepId_NotExistsSubQuery_CategoryAccessList( CategoryAccessCQ subQuery); /** @@ -315,52 +253,52 @@ cb.xsetupForExistsSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepId_NotExistsSubQuery_MessageList(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerNotExistsSubQuery(cb.query(), "ID", "CATEGORY_ID", subQueryPropertyName); } - abstract public String keepId_NotExistsSubQuery_MessageList( + public abstract String keepId_NotExistsSubQuery_MessageList( MessageCQ subQuery); public void xderiveCategoryAccessList(String function, SubQuery subQuery, String aliasName) { assertObjectNotNull("subQuery", subQuery); CategoryAccessCB cb = new CategoryAccessCB(); - cb.xsetupForDeriveReferrer(); + cb.xsetupForDerivedReferrer(); subQuery.query(cb); - String subQueryPropertyName = keepId_DeriveSubQuery_CategoryAccessList(cb - .query());// for saving query-value. - registerDeriveSubQuery(function, cb.query(), "ID", "CATEGORY_ID", - subQueryPropertyName, aliasName); + String subQueryPropertyName = keepId_DerivedReferrer_CategoryAccessList(cb + .query()); // for saving query-value. + registerDerivedReferrerSubQuery(function, cb.query(), "ID", + "CATEGORY_ID", subQueryPropertyName, aliasName); } - abstract public String keepId_DeriveSubQuery_CategoryAccessList( + public abstract String keepId_DerivedReferrer_CategoryAccessList( CategoryAccessCQ subQuery); public void xderiveMessageList(String function, SubQuery subQuery, String aliasName) { assertObjectNotNull("subQuery", subQuery); MessageCB cb = new MessageCB(); - cb.xsetupForDeriveReferrer(); + cb.xsetupForDerivedReferrer(); subQuery.query(cb); - String subQueryPropertyName = keepId_DeriveSubQuery_MessageList(cb - .query());// for saving query-value. - registerDeriveSubQuery(function, cb.query(), "ID", "CATEGORY_ID", - subQueryPropertyName, aliasName); + String subQueryPropertyName = keepId_DerivedReferrer_MessageList(cb + .query()); // for saving query-value. + registerDerivedReferrerSubQuery(function, cb.query(), "ID", + "CATEGORY_ID", subQueryPropertyName, aliasName); } - abstract public String keepId_DeriveSubQuery_MessageList(MessageCQ subQuery); + public abstract String keepId_DerivedReferrer_MessageList(MessageCQ subQuery); /** - * IsNull(is null). And OnceRegistered. + * IsNull(is null). And OnlyOnceRegistered. */ public void setId_IsNull() { regId(CK_ISN, DUMMY_OBJECT); } /** - * IsNotNull(is not null). And OnceRegistered. + * IsNotNull(is not null). And OnlyOnceRegistered. */ public void setId_IsNotNull() { regId(CK_ISNN, DUMMY_OBJECT); @@ -377,7 +315,7 @@ abstract protected ConditionValue getCValueId(); /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {NotNull : + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {NotNull : * VARCHAR(100)} * * @param name The value of name as equal. @@ -387,7 +325,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param name The value of name as notEqual. */ @@ -396,7 +334,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param name The value of name as greaterThan. */ @@ -405,7 +343,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param name The value of name as lessThan. */ @@ -414,7 +352,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param name The value of name as greaterEqual. */ @@ -423,7 +361,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param name The value of name as lessEqual. */ @@ -432,7 +370,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param name The value of name as prefixSearch. */ @@ -441,20 +379,6 @@ } /** - * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, - * SeveralRegistered. - * - * @param name The value of name as likeSearch. - * @param likeSearchOption The option of like-search. (NotNull) - */ - public void setName_LikeSearch( - String name, - jp.sf.pal.board.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { - registerLikeSearchQuery(CK_LS, fRES(name), getCValueName(), "NAME", - "Name", "name", likeSearchOption); - } - - /** * InScope(in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * @@ -465,27 +389,41 @@ } /** - * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * - * @param name The collection of name as inScope. - * @param inScopeOption The option of in-scope. (NotNull) + * @param nameList The collection of name as notInScope. */ - public void setName_InScope( + public void setName_NotInScope(Collection nameList) { + regName(CK_NINS, cTL(nameList)); + } + + /** + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param name The value of name as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) + */ + public void setName_LikeSearch( String name, - jp.sf.pal.board.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(name), getCValueName(), "NAME", - "Name", "name", inScopeOption); + jp.sf.pal.board.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(name), getCValueName(), "NAME", "Name", "name", + likeSearchOption); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param nameList The collection of name as notInScope. + * @param name The value of name as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setName_NotInScope(Collection nameList) { - regName(CK_NINS, cTL(nameList)); + public void setName_NotLikeSearch( + String name, + jp.sf.pal.board.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(name), getCValueName(), "NAME", "Name", "name", + likeSearchOption); } protected void regName(ConditionKey key, Object value) { @@ -499,7 +437,7 @@ abstract protected ConditionValue getCValueName(); /** - * Equal(=). And NullIgnored, OnceRegistered. {NotNull : INTEGER : + * Equal(=). And NullIgnored, OnlyOnceRegistered. {NotNull : INTEGER : * Default=[0]} * * @param sortOrder The value of sortOrder as equal. @@ -509,7 +447,7 @@ } /** - * NotEqual(!=). And NullIgnored, OnceRegistered. + * NotEqual(!=). And NullIgnored, OnlyOnceRegistered. * * @param sortOrder The value of sortOrder as notEqual. */ @@ -518,7 +456,7 @@ } /** - * GreaterThan(>). And NullIgnored, OnceRegistered. + * GreaterThan(>). And NullIgnored, OnlyOnceRegistered. * * @param sortOrder The value of sortOrder as greaterThan. */ @@ -527,7 +465,7 @@ } /** - * LessThan(<). And NullIgnored, OnceRegistered. + * LessThan(<). And NullIgnored, OnlyOnceRegistered. * * @param sortOrder The value of sortOrder as lessThan. */ @@ -536,7 +474,7 @@ } /** - * GreaterEqual(>=). And NullIgnored, OnceRegistered. + * GreaterEqual(>=). And NullIgnored, OnlyOnceRegistered. * * @param sortOrder The value of sortOrder as greaterEqual. */ @@ -545,7 +483,7 @@ } /** - * LessEqual(<=). And NullIgnored, OnceRegistered. + * LessEqual(<=). And NullIgnored, OnlyOnceRegistered. * * @param sortOrder The value of sortOrder as lessEqual. */ @@ -586,7 +524,7 @@ abstract protected ConditionValue getCValueSortOrder(); /** - * Equal(=). And NullIgnored, OnceRegistered. {NotNull : TIMESTAMP} + * Equal(=). And NullIgnored, OnlyOnceRegistered. {NotNull : TIMESTAMP} * * @param createdTime The value of createdTime as equal. */ @@ -595,7 +533,7 @@ } /** - * NotEqual(!=). And NullIgnored, OnceRegistered. + * NotEqual(!=). And NullIgnored, OnlyOnceRegistered. * * @param createdTime The value of createdTime as notEqual. */ @@ -604,7 +542,7 @@ } /** - * GreaterThan(>). And NullIgnored, OnceRegistered. + * GreaterThan(>). And NullIgnored, OnlyOnceRegistered. * * @param createdTime The value of createdTime as greaterThan. */ @@ -613,7 +551,7 @@ } /** - * LessThan(>). And NullIgnored, OnceRegistered. + * LessThan(>). And NullIgnored, OnlyOnceRegistered. * * @param createdTime The value of createdTime as lessThan. */ @@ -622,7 +560,7 @@ } /** - * GreaterEqual(>). And NullIgnored, OnceRegistered. + * GreaterEqual(>). And NullIgnored, OnlyOnceRegistered. * * @param createdTime The value of createdTime as greaterEqual. */ @@ -631,7 +569,7 @@ } /** - * LessEqual(>). And NullIgnored, OnceRegistered. + * LessEqual(>). And NullIgnored, OnlyOnceRegistered. * * @param createdTime The value of createdTime as lessEqual. */ @@ -641,7 +579,7 @@ /** * FromTo($fromDate <= COLUMN_NAME <= $toDate). And NullIgnored, - * OnceRegistered. {NotNull : TIMESTAMP} + * OnlyOnceRegistered. {NotNull : TIMESTAMP} * * @param fromDate The from-date of createdTime. (Nullable) * @param toDate The to-date of createdTime. (Nullable) @@ -658,7 +596,7 @@ /** * FromTo($fromDate <= COLUMN_NAME < $toDate + 1). And NullIgnored, - * OnceRegistered. {NotNull : TIMESTAMP} + * OnlyOnceRegistered. {NotNull : TIMESTAMP} * * @param fromDate The from-date of createdTime. (Nullable) * @param toDate The to-date of createdTime. (Nullable) @@ -684,7 +622,7 @@ abstract protected ConditionValue getCValueCreatedTime(); /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {NotNull : + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {NotNull : * VARCHAR(255)} * * @param createdBy The value of createdBy as equal. @@ -694,7 +632,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param createdBy The value of createdBy as notEqual. */ @@ -703,7 +641,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param createdBy The value of createdBy as greaterThan. */ @@ -712,7 +650,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param createdBy The value of createdBy as lessThan. */ @@ -721,7 +659,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param createdBy The value of createdBy as greaterEqual. */ @@ -730,7 +668,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param createdBy The value of createdBy as lessEqual. */ @@ -739,7 +677,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param createdBy The value of createdBy as prefixSearch. */ @@ -748,20 +686,6 @@ } /** - * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, - * SeveralRegistered. - * - * @param createdBy The value of createdBy as likeSearch. - * @param likeSearchOption The option of like-search. (NotNull) - */ - public void setCreatedBy_LikeSearch( - String createdBy, - jp.sf.pal.board.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { - registerLikeSearchQuery(CK_LS, fRES(createdBy), getCValueCreatedBy(), - "CREATED_BY", "CreatedBy", "createdBy", likeSearchOption); - } - - /** * InScope(in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * @@ -772,27 +696,41 @@ } /** - * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * - * @param createdBy The collection of createdBy as inScope. - * @param inScopeOption The option of in-scope. (NotNull) + * @param createdByList The collection of createdBy as notInScope. */ - public void setCreatedBy_InScope( + public void setCreatedBy_NotInScope(Collection createdByList) { + regCreatedBy(CK_NINS, cTL(createdByList)); + } + + /** + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param createdBy The value of createdBy as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) + */ + public void setCreatedBy_LikeSearch( String createdBy, - jp.sf.pal.board.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(createdBy), getCValueCreatedBy(), - "CREATED_BY", "CreatedBy", "createdBy", inScopeOption); + jp.sf.pal.board.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(createdBy), getCValueCreatedBy(), "CREATED_BY", + "CreatedBy", "createdBy", likeSearchOption); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param createdByList The collection of createdBy as notInScope. + * @param createdBy The value of createdBy as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setCreatedBy_NotInScope(Collection createdByList) { - regCreatedBy(CK_NINS, cTL(createdByList)); + public void setCreatedBy_NotLikeSearch( + String createdBy, + jp.sf.pal.board.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(createdBy), getCValueCreatedBy(), "CREATED_BY", + "CreatedBy", "createdBy", likeSearchOption); } protected void regCreatedBy(ConditionKey key, Object value) { @@ -808,7 +746,7 @@ abstract protected ConditionValue getCValueCreatedBy(); /** - * Equal(=). And NullIgnored, OnceRegistered. {NotNull : TIMESTAMP} + * Equal(=). And NullIgnored, OnlyOnceRegistered. {NotNull : TIMESTAMP} * * @param updatedTime The value of updatedTime as equal. */ @@ -817,7 +755,7 @@ } /** - * NotEqual(!=). And NullIgnored, OnceRegistered. + * NotEqual(!=). And NullIgnored, OnlyOnceRegistered. * * @param updatedTime The value of updatedTime as notEqual. */ @@ -826,7 +764,7 @@ } /** - * GreaterThan(>). And NullIgnored, OnceRegistered. + * GreaterThan(>). And NullIgnored, OnlyOnceRegistered. * * @param updatedTime The value of updatedTime as greaterThan. */ @@ -835,7 +773,7 @@ } /** - * LessThan(>). And NullIgnored, OnceRegistered. + * LessThan(>). And NullIgnored, OnlyOnceRegistered. * * @param updatedTime The value of updatedTime as lessThan. */ @@ -844,7 +782,7 @@ } /** - * GreaterEqual(>). And NullIgnored, OnceRegistered. + * GreaterEqual(>). And NullIgnored, OnlyOnceRegistered. * * @param updatedTime The value of updatedTime as greaterEqual. */ @@ -853,7 +791,7 @@ } /** - * LessEqual(>). And NullIgnored, OnceRegistered. + * LessEqual(>). And NullIgnored, OnlyOnceRegistered. * * @param updatedTime The value of updatedTime as lessEqual. */ @@ -863,7 +801,7 @@ /** * FromTo($fromDate <= COLUMN_NAME <= $toDate). And NullIgnored, - * OnceRegistered. {NotNull : TIMESTAMP} + * OnlyOnceRegistered. {NotNull : TIMESTAMP} * * @param fromDate The from-date of updatedTime. (Nullable) * @param toDate The to-date of updatedTime. (Nullable) @@ -880,7 +818,7 @@ /** * FromTo($fromDate <= COLUMN_NAME < $toDate + 1). And NullIgnored, - * OnceRegistered. {NotNull : TIMESTAMP} + * OnlyOnceRegistered. {NotNull : TIMESTAMP} * * @param fromDate The from-date of updatedTime. (Nullable) * @param toDate The to-date of updatedTime. (Nullable) @@ -906,7 +844,7 @@ abstract protected ConditionValue getCValueUpdatedTime(); /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {NotNull : + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {NotNull : * VARCHAR(255)} * * @param updatedBy The value of updatedBy as equal. @@ -916,7 +854,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param updatedBy The value of updatedBy as notEqual. */ @@ -925,7 +863,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param updatedBy The value of updatedBy as greaterThan. */ @@ -934,7 +872,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param updatedBy The value of updatedBy as lessThan. */ @@ -943,7 +881,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param updatedBy The value of updatedBy as greaterEqual. */ @@ -952,7 +890,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param updatedBy The value of updatedBy as lessEqual. */ @@ -961,7 +899,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param updatedBy The value of updatedBy as prefixSearch. */ @@ -970,20 +908,6 @@ } /** - * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, - * SeveralRegistered. - * - * @param updatedBy The value of updatedBy as likeSearch. - * @param likeSearchOption The option of like-search. (NotNull) - */ - public void setUpdatedBy_LikeSearch( - String updatedBy, - jp.sf.pal.board.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { - registerLikeSearchQuery(CK_LS, fRES(updatedBy), getCValueUpdatedBy(), - "UPDATED_BY", "UpdatedBy", "updatedBy", likeSearchOption); - } - - /** * InScope(in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * @@ -994,27 +918,41 @@ } /** - * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * - * @param updatedBy The collection of updatedBy as inScope. - * @param inScopeOption The option of in-scope. (NotNull) + * @param updatedByList The collection of updatedBy as notInScope. */ - public void setUpdatedBy_InScope( + public void setUpdatedBy_NotInScope(Collection updatedByList) { + regUpdatedBy(CK_NINS, cTL(updatedByList)); + } + + /** + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param updatedBy The value of updatedBy as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) + */ + public void setUpdatedBy_LikeSearch( String updatedBy, - jp.sf.pal.board.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(updatedBy), getCValueUpdatedBy(), - "UPDATED_BY", "UpdatedBy", "updatedBy", inScopeOption); + jp.sf.pal.board.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(updatedBy), getCValueUpdatedBy(), "UPDATED_BY", + "UpdatedBy", "updatedBy", likeSearchOption); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param updatedByList The collection of updatedBy as notInScope. + * @param updatedBy The value of updatedBy as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setUpdatedBy_NotInScope(Collection updatedByList) { - regUpdatedBy(CK_NINS, cTL(updatedByList)); + public void setUpdatedBy_NotLikeSearch( + String updatedBy, + jp.sf.pal.board.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(updatedBy), getCValueUpdatedBy(), "UPDATED_BY", + "UpdatedBy", "updatedBy", likeSearchOption); } protected void regUpdatedBy(ConditionKey key, Object value) { @@ -1030,7 +968,7 @@ abstract protected ConditionValue getCValueUpdatedBy(); /** - * Equal(=). And NullIgnored, OnceRegistered. {TIMESTAMP} + * Equal(=). And NullIgnored, OnlyOnceRegistered. {TIMESTAMP} * * @param deletedTime The value of deletedTime as equal. */ @@ -1039,7 +977,7 @@ } /** - * NotEqual(!=). And NullIgnored, OnceRegistered. + * NotEqual(!=). And NullIgnored, OnlyOnceRegistered. * * @param deletedTime The value of deletedTime as notEqual. */ @@ -1048,7 +986,7 @@ } /** - * GreaterThan(>). And NullIgnored, OnceRegistered. + * GreaterThan(>). And NullIgnored, OnlyOnceRegistered. * * @param deletedTime The value of deletedTime as greaterThan. */ @@ -1057,7 +995,7 @@ } /** - * LessThan(>). And NullIgnored, OnceRegistered. + * LessThan(>). And NullIgnored, OnlyOnceRegistered. * * @param deletedTime The value of deletedTime as lessThan. */ @@ -1066,7 +1004,7 @@ } /** - * GreaterEqual(>). And NullIgnored, OnceRegistered. + * GreaterEqual(>). And NullIgnored, OnlyOnceRegistered. * * @param deletedTime The value of deletedTime as greaterEqual. */ @@ -1075,7 +1013,7 @@ } /** - * LessEqual(>). And NullIgnored, OnceRegistered. + * LessEqual(>). And NullIgnored, OnlyOnceRegistered. * * @param deletedTime The value of deletedTime as lessEqual. */ @@ -1085,7 +1023,7 @@ /** * FromTo($fromDate <= COLUMN_NAME <= $toDate). And NullIgnored, - * OnceRegistered. {TIMESTAMP} + * OnlyOnceRegistered. {TIMESTAMP} * * @param fromDate The from-date of deletedTime. (Nullable) * @param toDate The to-date of deletedTime. (Nullable) @@ -1102,7 +1040,7 @@ /** * FromTo($fromDate <= COLUMN_NAME < $toDate + 1). And NullIgnored, - * OnceRegistered. {TIMESTAMP} + * OnlyOnceRegistered. {TIMESTAMP} * * @param fromDate The from-date of deletedTime. (Nullable) * @param toDate The to-date of deletedTime. (Nullable) @@ -1116,14 +1054,14 @@ } /** - * IsNull(is null). And OnceRegistered. + * IsNull(is null). And OnlyOnceRegistered. */ public void setDeletedTime_IsNull() { regDeletedTime(CK_ISN, DUMMY_OBJECT); } /** - * IsNotNull(is not null). And OnceRegistered. + * IsNotNull(is not null). And OnlyOnceRegistered. */ public void setDeletedTime_IsNotNull() { regDeletedTime(CK_ISNN, DUMMY_OBJECT); @@ -1142,7 +1080,7 @@ abstract protected ConditionValue getCValueDeletedTime(); /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {VARCHAR(255)} + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {VARCHAR(255)} * * @param deletedBy The value of deletedBy as equal. */ @@ -1151,7 +1089,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param deletedBy The value of deletedBy as notEqual. */ @@ -1160,7 +1098,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param deletedBy The value of deletedBy as greaterThan. */ @@ -1169,7 +1107,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param deletedBy The value of deletedBy as lessThan. */ @@ -1178,7 +1116,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param deletedBy The value of deletedBy as greaterEqual. */ @@ -1187,7 +1125,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param deletedBy The value of deletedBy as lessEqual. */ @@ -1196,7 +1134,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param deletedBy The value of deletedBy as prefixSearch. */ @@ -1205,20 +1143,6 @@ } /** - * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, - * SeveralRegistered. - * - * @param deletedBy The value of deletedBy as likeSearch. - * @param likeSearchOption The option of like-search. (NotNull) - */ - public void setDeletedBy_LikeSearch( - String deletedBy, - jp.sf.pal.board.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { - registerLikeSearchQuery(CK_LS, fRES(deletedBy), getCValueDeletedBy(), - "DELETED_BY", "DeletedBy", "deletedBy", likeSearchOption); - } - - /** * InScope(in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * @@ -1229,38 +1153,52 @@ } /** - * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * - * @param deletedBy The collection of deletedBy as inScope. - * @param inScopeOption The option of in-scope. (NotNull) + * @param deletedByList The collection of deletedBy as notInScope. */ - public void setDeletedBy_InScope( + public void setDeletedBy_NotInScope(Collection deletedByList) { + regDeletedBy(CK_NINS, cTL(deletedByList)); + } + + /** + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param deletedBy The value of deletedBy as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) + */ + public void setDeletedBy_LikeSearch( String deletedBy, - jp.sf.pal.board.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(deletedBy), getCValueDeletedBy(), - "DELETED_BY", "DeletedBy", "deletedBy", inScopeOption); + jp.sf.pal.board.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(deletedBy), getCValueDeletedBy(), "DELETED_BY", + "DeletedBy", "deletedBy", likeSearchOption); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param deletedByList The collection of deletedBy as notInScope. + * @param deletedBy The value of deletedBy as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setDeletedBy_NotInScope(Collection deletedByList) { - regDeletedBy(CK_NINS, cTL(deletedByList)); + public void setDeletedBy_NotLikeSearch( + String deletedBy, + jp.sf.pal.board.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(deletedBy), getCValueDeletedBy(), "DELETED_BY", + "DeletedBy", "deletedBy", likeSearchOption); } /** - * IsNull(is null). And OnceRegistered. + * IsNull(is null). And OnlyOnceRegistered. */ public void setDeletedBy_IsNull() { regDeletedBy(CK_ISN, DUMMY_OBJECT); } /** - * IsNotNull(is not null). And OnceRegistered. + * IsNotNull(is not null). And OnlyOnceRegistered. */ public void setDeletedBy_IsNotNull() { regDeletedBy(CK_ISNN, DUMMY_OBJECT); @@ -1279,7 +1217,7 @@ abstract protected ConditionValue getCValueDeletedBy(); /** - * Equal(=). And NullIgnored, OnceRegistered. {NotNull : INTEGER : + * Equal(=). And NullIgnored, OnlyOnceRegistered. {NotNull : INTEGER : * Default=[0]} * * @param versionno The value of versionno as equal. @@ -1289,7 +1227,7 @@ } /** - * NotEqual(!=). And NullIgnored, OnceRegistered. + * NotEqual(!=). And NullIgnored, OnlyOnceRegistered. * * @param versionno The value of versionno as notEqual. */ @@ -1298,7 +1236,7 @@ } /** - * GreaterThan(>). And NullIgnored, OnceRegistered. + * GreaterThan(>). And NullIgnored, OnlyOnceRegistered. * * @param versionno The value of versionno as greaterThan. */ @@ -1307,7 +1245,7 @@ } /** - * LessThan(<). And NullIgnored, OnceRegistered. + * LessThan(<). And NullIgnored, OnlyOnceRegistered. * * @param versionno The value of versionno as lessThan. */ @@ -1316,7 +1254,7 @@ } /** - * GreaterEqual(>=). And NullIgnored, OnceRegistered. + * GreaterEqual(>=). And NullIgnored, OnlyOnceRegistered. * * @param versionno The value of versionno as greaterEqual. */ @@ -1325,7 +1263,7 @@ } /** - * LessEqual(<=). And NullIgnored, OnceRegistered. + * LessEqual(<=). And NullIgnored, OnlyOnceRegistered. * * @param versionno The value of versionno as lessEqual. */ @@ -1365,6 +1303,50 @@ abstract protected ConditionValue getCValueVersionno(); + public SSQFunction scalar_Equal() { + return xcreateSSQFunction("="); + } + + public SSQFunction scalar_GreaterEqual() { + return xcreateSSQFunction(">="); + } + + public SSQFunction scalar_GreaterThan() { + return xcreateSSQFunction(">"); + } + + public SSQFunction scalar_LessEqual() { + return xcreateSSQFunction("<="); + } + + public SSQFunction scalar_LessThan() { + return xcreateSSQFunction("<"); + } + + protected SSQFunction xcreateSSQFunction(final String operand) { + return new SSQFunction(new SSQSetupper() { + public void setup(String function, SubQuery subQuery) { + xscalarSubQuery(function, subQuery, operand); + } + }); + } + + protected void xscalarSubQuery(String function, + SubQuery subQuery, String operand) { + assertObjectNotNull("subQuery", subQuery); + CategoryCB cb = new CategoryCB(); + cb.xsetupForScalarSubQuery(); + subQuery.query(cb); + String subQueryPropertyName = keepScalarSubQuery(cb.query()); // for + // saving + // query + // -value. + registerScalarSubQuery(function, cb.query(), subQueryPropertyName, + operand); + } + + public abstract String keepScalarSubQuery(CategoryCQ subQuery); + // Very Internal (for Suppressing Warn about 'Not Use Import') protected String getConditionBeanClassNameInternally() { return CategoryCB.class.getName(); Modified: board/trunk/src/main/java/jp/sf/pal/board/db/cbean/cq/bs/AbstractBsGroupInfoCQ.java =================================================================== --- board/trunk/src/main/java/jp/sf/pal/board/db/cbean/cq/bs/AbstractBsGroupInfoCQ.java 2008-12-27 22:06:42 UTC (rev 1624) +++ board/trunk/src/main/java/jp/sf/pal/board/db/cbean/cq/bs/AbstractBsGroupInfoCQ.java 2008-12-27 22:09:08 UTC (rev 1625) @@ -20,7 +20,6 @@ * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public abstract class AbstractBsGroupInfoCQ extends AbstractConditionQuery { //========================================================================== @@ -50,7 +49,7 @@ // ===== /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {PK : NotNull : + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {PK : NotNull : * VARCHAR(255)} * * @param groupId The value of groupId as equal. @@ -60,7 +59,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param groupId The value of groupId as notEqual. */ @@ -69,7 +68,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param groupId The value of groupId as greaterThan. */ @@ -78,7 +77,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param groupId The value of groupId as lessThan. */ @@ -87,7 +86,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param groupId The value of groupId as greaterEqual. */ @@ -96,7 +95,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param groupId The value of groupId as lessEqual. */ @@ -105,7 +104,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param groupId The value of groupId as prefixSearch. */ @@ -114,20 +113,6 @@ } /** - * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, - * SeveralRegistered. - * - * @param groupId The value of groupId as likeSearch. - * @param likeSearchOption The option of like-search. (NotNull) - */ - public void setGroupId_LikeSearch( - String groupId, - jp.sf.pal.board.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { - registerLikeSearchQuery(CK_LS, fRES(groupId), getCValueGroupId(), - "GROUP_ID", "GroupId", "groupId", likeSearchOption); - } - - /** * InScope(in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * @@ -138,43 +123,41 @@ } /** - * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * - * @param groupId The collection of groupId as inScope. - * @param inScopeOption The option of in-scope. (NotNull) + * @param groupIdList The collection of groupId as notInScope. */ - public void setGroupId_InScope( - String groupId, - jp.sf.pal.board.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(groupId), getCValueGroupId(), - "GROUP_ID", "GroupId", "groupId", inScopeOption); + public void setGroupId_NotInScope(Collection groupIdList) { + regGroupId(CK_NINS, cTL(groupIdList)); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param groupIdList The collection of groupId as notInScope. + * @param groupId The value of groupId as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) */ - public void setGroupId_NotInScope(Collection groupIdList) { - regGroupId(CK_NINS, cTL(groupIdList)); + public void setGroupId_LikeSearch( + String groupId, + jp.sf.pal.board.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(groupId), getCValueGroupId(), "GROUP_ID", "GroupId", + "groupId", likeSearchOption); } /** - * @param groupMappingCBquery Query. - * @deprecated Please use inScopeGroupMappingList(subQuery) method. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param groupId The value of groupId as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setGroupId_InScopeSubQuery_GroupMappingList( - GroupMappingCQ groupMappingCBquery) { - String subQueryPropertyName = keepGroupId_InScopeSubQuery_GroupMappingList(groupMappingCBquery);// for - // saving - // query - // - - // value - // . - registerInScopeSubQuery(groupMappingCBquery, "GROUP_ID", "GROUP_ID", - subQueryPropertyName); + public void setGroupId_NotLikeSearch( + String groupId, + jp.sf.pal.board.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(groupId), getCValueGroupId(), "GROUP_ID", + "GroupId", "groupId", likeSearchOption); } public void inScopeGroupMappingList(SubQuery subQuery) { @@ -183,42 +166,26 @@ cb.xsetupForInScopeSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepGroupId_InScopeSubQuery_GroupMappingList(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerInScopeSubQuery(cb.query(), "GROUP_ID", "GROUP_ID", subQueryPropertyName); } - abstract public String keepGroupId_InScopeSubQuery_GroupMappingList( + public abstract String keepGroupId_InScopeSubQuery_GroupMappingList( GroupMappingCQ subQuery); - /** - * @param userInfoCBquery Query. - * @deprecated Please use inScopeUserInfoList(subQuery) method. - */ - public void setGroupId_InScopeSubQuery_UserInfoList( - UserInfoCQ userInfoCBquery) { - String subQueryPropertyName = keepGroupId_InScopeSubQuery_UserInfoList(userInfoCBquery);// for - // saving - // query - // - - // value - // . - registerInScopeSubQuery(userInfoCBquery, "GROUP_ID", "GROUP_ID", - subQueryPropertyName); - } - public void inScopeUserInfoList(SubQuery subQuery) { assertObjectNotNull("subQuery", subQuery); UserInfoCB cb = new UserInfoCB(); cb.xsetupForInScopeSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepGroupId_InScopeSubQuery_UserInfoList(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerInScopeSubQuery(cb.query(), "GROUP_ID", "GROUP_ID", subQueryPropertyName); } - abstract public String keepGroupId_InScopeSubQuery_UserInfoList( + public abstract String keepGroupId_InScopeSubQuery_UserInfoList( UserInfoCQ subQuery); public void notInScopeGroupMappingList(SubQuery subQuery) { @@ -227,12 +194,12 @@ cb.xsetupForInScopeSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepGroupId_NotInScopeSubQuery_GroupMappingList(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerNotInScopeSubQuery(cb.query(), "GROUP_ID", "GROUP_ID", subQueryPropertyName); } - abstract public String keepGroupId_NotInScopeSubQuery_GroupMappingList( + public abstract String keepGroupId_NotInScopeSubQuery_GroupMappingList( GroupMappingCQ subQuery); public void notInScopeUserInfoList(SubQuery subQuery) { @@ -241,31 +208,15 @@ cb.xsetupForInScopeSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepGroupId_NotInScopeSubQuery_UserInfoList(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerNotInScopeSubQuery(cb.query(), "GROUP_ID", "GROUP_ID", subQueryPropertyName); } - abstract public String keepGroupId_NotInScopeSubQuery_UserInfoList( + public abstract String keepGroupId_NotInScopeSubQuery_UserInfoList( UserInfoCQ subQuery); /** - * @param groupMappingCBquery Query. - * @deprecated Please use existsGroupMappingList(subQuery) method. - */ - public void setGroupId_ExistsSubQuery_GroupMappingList( - GroupMappingCQ groupMappingCBquery) { - String subQueryPropertyName = keepGroupId_ExistsSubQuery_GroupMappingList(groupMappingCBquery);// for - // saving - // query - // - - // value - // . - registerExistsSubQuery(groupMappingCBquery, "GROUP_ID", "GROUP_ID", - subQueryPropertyName); - } - - /** * Set up 'exists' sub-query. {exists (select GROUP_ID from GROUP_MAPPING * where ...)} * @@ -278,31 +229,15 @@ cb.xsetupForExistsSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepGroupId_ExistsSubQuery_GroupMappingList(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerExistsSubQuery(cb.query(), "GROUP_ID", "GROUP_ID", subQueryPropertyName); } - abstract public String keepGroupId_ExistsSubQuery_GroupMappingList( + public abstract String keepGroupId_ExistsSubQuery_GroupMappingList( GroupMappingCQ subQuery); /** - * @param userInfoCBquery Query. - * @deprecated Please use existsUserInfoList(subQuery) method. - */ - public void setGroupId_ExistsSubQuery_UserInfoList( - UserInfoCQ userInfoCBquery) { - String subQueryPropertyName = keepGroupId_ExistsSubQuery_UserInfoList(userInfoCBquery);// for - // saving - // query - // - - // value - // . - registerExistsSubQuery(userInfoCBquery, "GROUP_ID", "GROUP_ID", - subQueryPropertyName); - } - - /** * Set up 'exists' sub-query. {exists (select GROUP_ID from USER_INFO where * ...)} * @@ -315,12 +250,12 @@ cb.xsetupForExistsSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepGroupId_ExistsSubQuery_UserInfoList(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerExistsSubQuery(cb.query(), "GROUP_ID", "GROUP_ID", subQueryPropertyName); } - abstract public String keepGroupId_ExistsSubQuery_UserInfoList( + public abstract String keepGroupId_ExistsSubQuery_UserInfoList( UserInfoCQ subQuery); /** @@ -337,12 +272,12 @@ cb.xsetupForExistsSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepGroupId_NotExistsSubQuery_GroupMappingList(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerNotExistsSubQuery(cb.query(), "GROUP_ID", "GROUP_ID", subQueryPropertyName); } - abstract public String keepGroupId_NotExistsSubQuery_GroupMappingList( + public abstract String keepGroupId_NotExistsSubQuery_GroupMappingList( GroupMappingCQ subQuery); /** @@ -358,53 +293,53 @@ cb.xsetupForExistsSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepGroupId_NotExistsSubQuery_UserInfoList(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerNotExistsSubQuery(cb.query(), "GROUP_ID", "GROUP_ID", subQueryPropertyName); } - abstract public String keepGroupId_NotExistsSubQuery_UserInfoList( + public abstract String keepGroupId_NotExistsSubQuery_UserInfoList( UserInfoCQ subQuery); public void xderiveGroupMappingList(String function, SubQuery subQuery, String aliasName) { assertObjectNotNull("subQuery", subQuery); GroupMappingCB cb = new GroupMappingCB(); - cb.xsetupForDeriveReferrer(); + cb.xsetupForDerivedReferrer(); subQuery.query(cb); - String subQueryPropertyName = keepGroupId_DeriveSubQuery_GroupMappingList(cb - .query());// for saving query-value. - registerDeriveSubQuery(function, cb.query(), "GROUP_ID", "GROUP_ID", - subQueryPropertyName, aliasName); + String subQueryPropertyName = keepGroupId_DerivedReferrer_GroupMappingList(cb + .query()); // for saving query-value. + registerDerivedReferrerSubQuery(function, cb.query(), "GROUP_ID", + "GROUP_ID", subQueryPropertyName, aliasName); } - abstract public String keepGroupId_DeriveSubQuery_GroupMappingList( + public abstract String keepGroupId_DerivedReferrer_GroupMappingList( GroupMappingCQ subQuery); public void xderiveUserInfoList(String function, SubQuery subQuery, String aliasName) { assertObjectNotNull("subQuery", subQuery); UserInfoCB cb = new UserInfoCB(); - cb.xsetupForDeriveReferrer(); + cb.xsetupForDerivedReferrer(); subQuery.query(cb); - String subQueryPropertyName = keepGroupId_DeriveSubQuery_UserInfoList(cb - .query());// for saving query-value. - registerDeriveSubQuery(function, cb.query(), "GROUP_ID", "GROUP_ID", - subQueryPropertyName, aliasName); + String subQueryPropertyName = keepGroupId_DerivedReferrer_UserInfoList(cb + .query()); // for saving query-value. + registerDerivedReferrerSubQuery(function, cb.query(), "GROUP_ID", + "GROUP_ID", subQueryPropertyName, aliasName); } - abstract public String keepGroupId_DeriveSubQuery_UserInfoList( + public abstract String keepGroupId_DerivedReferrer_UserInfoList( UserInfoCQ subQuery); /** - * IsNull(is null). And OnceRegistered. + * IsNull(is null). And OnlyOnceRegistered. */ public void setGroupId_IsNull() { regGroupId(CK_ISN, DUMMY_OBJECT); } /** - * IsNotNull(is not null). And OnceRegistered. + * IsNotNull(is not null). And OnlyOnceRegistered. */ public void setGroupId_IsNotNull() { regGroupId(CK_ISNN, DUMMY_OBJECT); @@ -423,7 +358,7 @@ abstract protected ConditionValue getCValueGroupId(); /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {VARCHAR(100)} + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {VARCHAR(100)} * * @param name The value of name as equal. */ @@ -432,7 +367,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param name The value of name as notEqual. */ @@ -441,7 +376,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param name The value of name as greaterThan. */ @@ -450,7 +385,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param name The value of name as lessThan. */ @@ -459,7 +394,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param name The value of name as greaterEqual. */ @@ -468,7 +403,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param name The value of name as lessEqual. */ @@ -477,7 +412,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param name The value of name as prefixSearch. */ @@ -486,20 +421,6 @@ } /** - * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, - * SeveralRegistered. - * - * @param name The value of name as likeSearch. - * @param likeSearchOption The option of like-search. (NotNull) - */ - public void setName_LikeSearch( - String name, - jp.sf.pal.board.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { - registerLikeSearchQuery(CK_LS, fRES(name), getCValueName(), "NAME", - "Name", "name", likeSearchOption); - } - - /** * InScope(in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * @@ -510,38 +431,52 @@ } /** - * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * - * @param name The collection of name as inScope. - * @param inScopeOption The option of in-scope. (NotNull) + * @param nameList The collection of name as notInScope. */ - public void setName_InScope( + public void setName_NotInScope(Collection nameList) { + regName(CK_NINS, cTL(nameList)); + } + + /** + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param name The value of name as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) + */ + public void setName_LikeSearch( String name, - jp.sf.pal.board.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(name), getCValueName(), "NAME", - "Name", "name", inScopeOption); + jp.sf.pal.board.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(name), getCValueName(), "NAME", "Name", "name", + likeSearchOption); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param nameList The collection of name as notInScope. + * @param name The value of name as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setName_NotInScope(Collection nameList) { - regName(CK_NINS, cTL(nameList)); + public void setName_NotLikeSearch( + String name, + jp.sf.pal.board.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(name), getCValueName(), "NAME", "Name", "name", + likeSearchOption); } /** - * IsNull(is null). And OnceRegistered. + * IsNull(is null). And OnlyOnceRegistered. */ public void setName_IsNull() { regName(CK_ISN, DUMMY_OBJECT); } /** - * IsNotNull(is not null). And OnceRegistered. + * IsNotNull(is not null). And OnlyOnceRegistered. */ public void setName_IsNotNull() { regName(CK_ISNN, DUMMY_OBJECT); @@ -558,7 +493,7 @@ abstract protected ConditionValue getCValueName(); /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {VARCHAR(255)} + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {VARCHAR(255)} * * @param description The value of description as equal. */ @@ -567,7 +502,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param description The value of description as notEqual. */ @@ -576,7 +511,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param description The value of description as greaterThan. */ @@ -585,7 +520,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param description The value of description as lessThan. */ @@ -594,7 +529,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param description The value of description as greaterEqual. */ @@ -603,7 +538,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param description The value of description as lessEqual. */ @@ -612,7 +547,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param description The value of description as prefixSearch. */ @@ -621,21 +556,6 @@ } /** - * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, - * SeveralRegistered. - * - * @param description The value of description as likeSearch. - * @param likeSearchOption The option of like-search. (NotNull) - */ - public void setDescription_LikeSearch( - String description, - jp.sf.pal.board.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { - registerLikeSearchQuery(CK_LS, fRES(description), - getCValueDescription(), "DESCRIPTION", "Description", - "description", likeSearchOption); - } - - /** * InScope(in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * @@ -646,38 +566,52 @@ } /** - * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * - * @param description The collection of description as inScope. - * @param inScopeOption The option of in-scope. (NotNull) + * @param descriptionList The collection of description as notInScope. */ - public void setDescription_InScope( + public void setDescription_NotInScope(Collection descriptionList) { + regDescription(CK_NINS, cTL(descriptionList)); + } + + /** + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param description The value of description as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) + */ + public void setDescription_LikeSearch( String description, - jp.sf.pal.board.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(description), getCValueDescription(), - "DESCRIPTION", "Description", "description", inScopeOption); + jp.sf.pal.board.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(description), getCValueDescription(), "DESCRIPTION", + "Description", "description", likeSearchOption); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param descriptionList The collection of description as notInScope. + * @param description The value of description as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setDescription_NotInScope(Collection descriptionList) { - regDescription(CK_NINS, cTL(descriptionList)); + public void setDescription_NotLikeSearch( + String description, + jp.sf.pal.board.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(description), getCValueDescription(), + "DESCRIPTION", "Description", "description", likeSearchOption); } /** - * IsNull(is null). And OnceRegistered. + * IsNull(is null). And OnlyOnceRegistered. */ public void setDescription_IsNull() { regDescription(CK_ISN, DUMMY_OBJECT); } /** - * IsNotNull(is not null). And OnceRegistered. + * IsNotNull(is not null). And OnlyOnceRegistered. */ public void setDescription_IsNotNull() { regDescription(CK_ISNN, DUMMY_OBJECT); @@ -696,7 +630,7 @@ abstract protected ConditionValue getCValueDescription(); /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {VARCHAR(255)} + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {VARCHAR(255)} * * @param email The value of email as equal. */ @@ -705,7 +639,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param email The value of email as notEqual. */ @@ -714,7 +648,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param email The value of email as greaterThan. */ @@ -723,7 +657,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param email The value of email as lessThan. */ @@ -732,7 +666,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param email The value of email as greaterEqual. */ @@ -741,7 +675,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param email The value of email as lessEqual. */ @@ -750,7 +684,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param email The value of email as prefixSearch. */ @@ -759,20 +693,6 @@ } /** - * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, - * SeveralRegistered. - * - * @param email The value of email as likeSearch. - * @param likeSearchOption The option of like-search. (NotNull) - */ - public void setEmail_LikeSearch( - String email, - jp.sf.pal.board.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { - registerLikeSearchQuery(CK_LS, fRES(email), getCValueEmail(), "EMAIL", - "Email", "email", likeSearchOption); - } - - /** * InScope(in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * @@ -783,38 +703,52 @@ } /** - * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * - * @param email The collection of email as inScope. - * @param inScopeOption The option of in-scope. (NotNull) + * @param emailList The collection of email as notInScope. */ - public void setEmail_InScope( + public void setEmail_NotInScope(Collection emailList) { + regEmail(CK_NINS, cTL(emailList)); + } + + /** + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param email The value of email as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) + */ + public void setEmail_LikeSearch( String email, - jp.sf.pal.board.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(email), getCValueEmail(), "EMAIL", - "Email", "email", inScopeOption); + jp.sf.pal.board.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(email), getCValueEmail(), "EMAIL", "Email", "email", + likeSearchOption); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param emailList The collection of email as notInScope. + * @param email The value of email as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setEmail_NotInScope(Collection emailList) { - regEmail(CK_NINS, cTL(emailList)); + public void setEmail_NotLikeSearch( + String email, + jp.sf.pal.board.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(email), getCValueEmail(), "EMAIL", "Email", + "email", likeSearchOption); } /** - * IsNull(is null). And OnceRegistered. + * IsNull(is null). And OnlyOnceRegistered. */ public void setEmail_IsNull() { regEmail(CK_ISN, DUMMY_OBJECT); } /** - * IsNotNull(is not null). And OnceRegistered. + * IsNotNull(is not null). And OnlyOnceRegistered. */ public void setEmail_IsNotNull() { regEmail(CK_ISNN, DUMMY_OBJECT); @@ -832,7 +766,7 @@ abstract protected ConditionValue getCValueEmail(); /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {VARCHAR(255)} + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {VARCHAR(255)} * * @param url The value of url as equal. */ @@ -841,7 +775,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param url The value of url as notEqual. */ @@ -850,7 +784,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param url The value of url as greaterThan. */ @@ -859,7 +793,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param url The value of url as lessThan. */ @@ -868,7 +802,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param url The value of url as greaterEqual. */ @@ -877,7 +811,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param url The value of url as lessEqual. */ @@ -886,7 +820,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param url The value of url as prefixSearch. */ @@ -895,20 +829,6 @@ } /** - * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, - * SeveralRegistered. - * - * @param url The value of url as likeSearch. - * @param likeSearchOption The option of like-search. (NotNull) - */ - public void setUrl_LikeSearch( - String url, - jp.sf.pal.board.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { - registerLikeSearchQuery(CK_LS, fRES(url), getCValueUrl(), "URL", "Url", - "url", likeSearchOption); - } - - /** * InScope(in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * @@ -919,38 +839,52 @@ } /** - * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * - * @param url The collection of url as inScope. - * @param inScopeOption The option of in-scope. (NotNull) + * @param urlList The collection of url as notInScope. */ - public void setUrl_InScope( + public void setUrl_NotInScope(Collection urlList) { + regUrl(CK_NINS, cTL(urlList)); + } + + /** + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param url The value of url as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) + */ + public void setUrl_LikeSearch( String url, - jp.sf.pal.board.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(url), getCValueUrl(), "URL", "Url", - "url", inScopeOption); + jp.sf.pal.board.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(url), getCValueUrl(), "URL", "Url", "url", + likeSearchOption); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param urlList The collection of url as notInScope. + * @param url The value of url as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setUrl_NotInScope(Collection urlList) { - regUrl(CK_NINS, cTL(urlList)); + public void setUrl_NotLikeSearch( + String url, + jp.sf.pal.board.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(url), getCValueUrl(), "URL", "Url", "url", + likeSearchOption); } /** - * IsNull(is null). And OnceRegistered. + * IsNull(is null). And OnlyOnceRegistered. */ public void setUrl_IsNull() { regUrl(CK_ISN, DUMMY_OBJECT); } /** - * IsNotNull(is not null). And OnceRegistered. + * IsNotNull(is not null). And OnlyOnceRegistered. */ public void setUrl_IsNotNull() { regUrl(CK_ISNN, DUMMY_OBJECT); @@ -967,7 +901,7 @@ abstract protected ConditionValue getCValueUrl(); /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {VARCHAR(40)} + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {VARCHAR(40)} * * @param telephone The value of telephone as equal. */ @@ -976,7 +910,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param telephone The value of telephone as notEqual. */ @@ -985,7 +919,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param telephone The value of telephone as greaterThan. */ @@ -994,7 +928,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param telephone The value of telephone as lessThan. */ @@ -1003,7 +937,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param telephone The value of telephone as greaterEqual. */ @@ -1012,7 +946,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param telephone The value of telephone as lessEqual. */ @@ -1021,7 +955,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param telephone The value of telephone as prefixSearch. */ @@ -1030,20 +964,6 @@ } /** - * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, - * SeveralRegistered. - * - * @param telephone The value of telephone as likeSearch. - * @param likeSearchOption The option of like-search. (NotNull) - */ - public void setTelephone_LikeSearch( - String telephone, - jp.sf.pal.board.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { - registerLikeSearchQuery(CK_LS, fRES(telephone), getCValueTelephone(), - "TELEPHONE", "Telephone", "telephone", likeSearchOption); - } - - /** * InScope(in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * @@ -1054,38 +974,52 @@ } /** - * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * - * @param telephone The collection of telephone as inScope. - * @param inScopeOption The option of in-scope. (NotNull) + * @param telephoneList The collection of telephone as notInScope. */ - public void setTelephone_InScope( + public void setTelephone_NotInScope(Collection telephoneList) { + regTelephone(CK_NINS, cTL(telephoneList)); + } + + /** + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param telephone The value of telephone as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) + */ + public void setTelephone_LikeSearch( String telephone, - jp.sf.pal.board.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(telephone), getCValueTelephone(), - "TELEPHONE", "Telephone", "telephone", inScopeOption); + jp.sf.pal.board.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(telephone), getCValueTelephone(), "TELEPHONE", + "Telephone", "telephone", likeSearchOption); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param telephoneList The collection of telephone as notInScope. + * @param telephone The value of telephone as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setTelephone_NotInScope(Collection telephoneList) { - regTelephone(CK_NINS, cTL(telephoneList)); + public void setTelephone_NotLikeSearch( + String telephone, + jp.sf.pal.board.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(telephone), getCValueTelephone(), "TELEPHONE", + "Telephone", "telephone", likeSearchOption); } /** - * IsNull(is null). And OnceRegistered. + * IsNull(is null). And OnlyOnceRegistered. */ public void setTelephone_IsNull() { regTelephone(CK_ISN, DUMMY_OBJECT); } /** - * IsNotNull(is not null). And OnceRegistered. + * IsNotNull(is not null). And OnlyOnceRegistered. */ public void setTelephone_IsNotNull() { regTelephone(CK_ISNN, DUMMY_OBJECT); @@ -1104,7 +1038,7 @@ abstract protected ConditionValue getCValueTelephone(); /** - * Equal(=). And NullIgnored, OnceRegistered. {NotNull : TIMESTAMP} + * Equal(=). And NullIgnored, OnlyOnceRegistered. {NotNull : TIMESTAMP} * * @param createdTime The value of createdTime as equal. */ @@ -1113,7 +1047,7 @@ } /** - * NotEqual(!=). And NullIgnored, OnceRegistered. + * NotEqual(!=). And NullIgnored, OnlyOnceRegistered. * * @param createdTime The value of createdTime as notEqual. */ @@ -1122,7 +1056,7 @@ } /** - * GreaterThan(>). And NullIgnored, OnceRegistered. + * GreaterThan(>). And NullIgnored, OnlyOnceRegistered. * * @param createdTime The value of createdTime as greaterThan. */ @@ -1131,7 +1065,7 @@ } /** - * LessThan(>). And NullIgnored, OnceRegistered. + * LessThan(>). And NullIgnored, OnlyOnceRegistered. * * @param createdTime The value of createdTime as lessThan. */ @@ -1140,7 +1074,7 @@ } /** - * GreaterEqual(>). And NullIgnored, OnceRegistered. + * GreaterEqual(>). And NullIgnored, OnlyOnceRegistered. * * @param createdTime The value of createdTime as greaterEqual. */ @@ -1149,7 +1083,7 @@ } /** - * LessEqual(>). And NullIgnored, OnceRegistered. + * LessEqual(>). And NullIgnored, OnlyOnceRegistered. * * @param createdTime The value of createdTime as lessEqual. */ @@ -1159,7 +1093,7 @@ /** * FromTo($fromDate <= COLUMN_NAME <= $toDate). And NullIgnored, - * OnceRegistered. {NotNull : TIMESTAMP} + * OnlyOnceRegistered. {NotNull : TIMESTAMP} * * @param fromDate The from-date of createdTime. (Nullable) * @param toDate The to-date of createdTime. (Nullable) @@ -1176,7 +1110,7 @@ /** * FromTo($fromDate <= COLUMN_NAME < $toDate + 1). And NullIgnored, - * OnceRegistered. {NotNull : TIMESTAMP} + * OnlyOnceRegistered. {NotNull : TIMESTAMP} * * @param fromDate The from-date of createdTime. (Nullable) * @param toDate The to-date of createdTime. (Nullable) @@ -1202,7 +1136,7 @@ abstract protected ConditionValue getCValueCreatedTime(); /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {NotNull : + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {NotNull : * VARCHAR(255)} * * @param createdBy The value of createdBy as equal. @@ -1212,7 +1146,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param createdBy The value of createdBy as notEqual. */ @@ -1221,7 +1155,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param createdBy The value of createdBy as greaterThan. */ @@ -1230,7 +1164,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param createdBy The value of createdBy as lessThan. */ @@ -1239,7 +1173,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param createdBy The value of createdBy as greaterEqual. */ @@ -1248,7 +1182,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param createdBy The value of createdBy as lessEqual. */ @@ -1257,7 +1191,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param createdBy The value of createdBy as prefixSearch. */ @@ -1266,20 +1200,6 @@ } /** - * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, - * SeveralRegistered. - * - * @param createdBy The value of createdBy as likeSearch. - * @param likeSearchOption The option of like-search. (NotNull) - */ - public void setCreatedBy_LikeSearch( - String createdBy, - jp.sf.pal.board.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { - registerLikeSearchQuery(CK_LS, fRES(createdBy), getCValueCreatedBy(), - "CREATED_BY", "CreatedBy", "createdBy", likeSearchOption); - } - - /** * InScope(in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * @@ -1290,27 +1210,41 @@ } /** - * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * - * @param createdBy The collection of createdBy as inScope. - * @param inScopeOption The option of in-scope. (NotNull) + * @param createdByList The collection of createdBy as notInScope. */ - public void setCreatedBy_InScope( + public void setCreatedBy_NotInScope(Collection createdByList) { + regCreatedBy(CK_NINS, cTL(createdByList)); + } + + /** + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param createdBy The value of createdBy as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) + */ + public void setCreatedBy_LikeSearch( String createdBy, - jp.sf.pal.board.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(createdBy), getCValueCreatedBy(), - "CREATED_BY", "CreatedBy", "createdBy", inScopeOption); + jp.sf.pal.board.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(createdBy), getCValueCreatedBy(), "CREATED_BY", + "CreatedBy", "createdBy", likeSearchOption); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param createdByList The collection of createdBy as notInScope. + * @param createdBy The value of createdBy as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setCreatedBy_NotInScope(Collection createdByList) { - regCreatedBy(CK_NINS, cTL(createdByList)); + public void setCreatedBy_NotLikeSearch( + String createdBy, + jp.sf.pal.board.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(createdBy), getCValueCreatedBy(), "CREATED_BY", + "CreatedBy", "createdBy", likeSearchOption); } protected void regCreatedBy(ConditionKey key, Object value) { @@ -1326,7 +1260,7 @@ abstract protected ConditionValue getCValueCreatedBy(); /** - * Equal(=). And NullIgnored, OnceRegistered. {NotNull : TIMESTAMP} + * Equal(=). And NullIgnored, OnlyOnceRegistered. {NotNull : TIMESTAMP} * * @param updatedTime The value of updatedTime as equal. */ @@ -1335,7 +1269,7 @@ } /** - * NotEqual(!=). And NullIgnored, OnceRegistered. + * NotEqual(!=). And NullIgnored, OnlyOnceRegistered. * * @param updatedTime The value of updatedTime as notEqual. */ @@ -1344,7 +1278,7 @@ } /** - * GreaterThan(>). And NullIgnored, OnceRegistered. + * GreaterThan(>). And NullIgnored, OnlyOnceRegistered. * * @param updatedTime The value of updatedTime as greaterThan. */ @@ -1353,7 +1287,7 @@ } /** - * LessThan(>). And NullIgnored, OnceRegistered. + * LessThan(>). And NullIgnored, OnlyOnceRegistered. * * @param updatedTime The value of updatedTime as lessThan. */ @@ -1362,7 +1296,7 @@ } /** - * GreaterEqual(>). And NullIgnored, OnceRegistered. + * GreaterEqual(>). And NullIgnored, OnlyOnceRegistered. * * @param updatedTime The value of updatedTime as greaterEqual. */ @@ -1371,7 +1305,7 @@ } /** - * LessEqual(>). And NullIgnored, OnceRegistered. + * LessEqual(>). And NullIgnored, OnlyOnceRegistered. * * @param updatedTime The value of updatedTime as lessEqual. */ @@ -1381,7 +1315,7 @@ /** * FromTo($fromDate <= COLUMN_NAME <= $toDate). And NullIgnored, - * OnceRegistered. {NotNull : TIMESTAMP} + * OnlyOnceRegistered. {NotNull : TIMESTAMP} * * @param fromDate The from-date of updatedTime. (Nullable) * @param toDate The to-date of updatedTime. (Nullable) @@ -1398,7 +1332,7 @@ /** * FromTo($fromDate <= COLUMN_NAME < $toDate + 1). And NullIgnored, - * OnceRegistered. {NotNull : TIMESTAMP} + * OnlyOnceRegistered. {NotNull : TIMESTAMP} * * @param fromDate The from-date of updatedTime. (Nullable) * @param toDate The to-date of updatedTime. (Nullable) @@ -1424,7 +1358,7 @@ abstract protected ConditionValue getCValueUpdatedTime(); /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {NotNull : + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {NotNull : * VARCHAR(255)} * * @param updatedBy The value of updatedBy as equal. @@ -1434,7 +1368,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param updatedBy The value of updatedBy as notEqual. */ @@ -1443,7 +1377,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param updatedBy The value of updatedBy as greaterThan. */ @@ -1452,7 +1386,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param updatedBy The value of updatedBy as lessThan. */ @@ -1461,7 +1395,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param updatedBy The value of updatedBy as greaterEqual. */ @@ -1470,7 +1404,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param updatedBy The value of updatedBy as lessEqual. */ @@ -1479,7 +1413,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param updatedBy The value of updatedBy as prefixSearch. */ @@ -1488,20 +1422,6 @@ } /** - * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, - * SeveralRegistered. - * - * @param updatedBy The value of updatedBy as likeSearch. - * @param likeSearchOption The option of like-search. (NotNull) - */ - public void setUpdatedBy_LikeSearch( - String updatedBy, - jp.sf.pal.board.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { - registerLikeSearchQuery(CK_LS, fRES(updatedBy), getCValueUpdatedBy(), - "UPDATED_BY", "UpdatedBy", "updatedBy", likeSearchOption); - } - - /** * InScope(in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * @@ -1512,27 +1432,41 @@ } /** - * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * - * @param updatedBy The collection of updatedBy as inScope. - * @param inScopeOption The option of in-scope. (NotNull) + * @param updatedByList The collection of updatedBy as notInScope. */ - public void setUpdatedBy_InScope( + public void setUpdatedBy_NotInScope(Collection updatedByList) { + regUpdatedBy(CK_NINS, cTL(updatedByList)); + } + + /** + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param updatedBy The value of updatedBy as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) + */ + public void setUpdatedBy_LikeSearch( String updatedBy, - jp.sf.pal.board.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(updatedBy), getCValueUpdatedBy(), - "UPDATED_BY", "UpdatedBy", "updatedBy", inScopeOption); + jp.sf.pal.board.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(updatedBy), getCValueUpdatedBy(), "UPDATED_BY", + "UpdatedBy", "updatedBy", likeSearchOption); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param updatedByList The collection of updatedBy as notInScope. + * @param updatedBy The value of updatedBy as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setUpdatedBy_NotInScope(Collection updatedByList) { - regUpdatedBy(CK_NINS, cTL(updatedByList)); + public void setUpdatedBy_NotLikeSearch( + String updatedBy, + jp.sf.pal.board.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(updatedBy), getCValueUpdatedBy(), "UPDATED_BY", + "UpdatedBy", "updatedBy", likeSearchOption); } protected void regUpdatedBy(ConditionKey key, Object value) { @@ -1548,7 +1482,7 @@ abstract protected ConditionValue getCValueUpdatedBy(); /** - * Equal(=). And NullIgnored, OnceRegistered. {TIMESTAMP} + * Equal(=). And NullIgnored, OnlyOnceRegistered. {TIMESTAMP} * * @param deletedTime The value of deletedTime as equal. */ @@ -1557,7 +1491,7 @@ } /** - * NotEqual(!=). And NullIgnored, OnceRegistered. + * NotEqual(!=). And NullIgnored, OnlyOnceRegistered. * * @param deletedTime The value of deletedTime as notEqual. */ @@ -1566,7 +1500,7 @@ } /** - * GreaterThan(>). And NullIgnored, OnceRegistered. + * GreaterThan(>). And NullIgnored, OnlyOnceRegistered. * * @param deletedTime The value of deletedTime as greaterThan. */ @@ -1575,7 +1509,7 @@ } /** - * LessThan(>). And NullIgnored, OnceRegistered. + * LessThan(>). And NullIgnored, OnlyOnceRegistered. * * @param deletedTime The value of deletedTime as lessThan. */ @@ -1584,7 +1518,7 @@ } /** - * GreaterEqual(>). And NullIgnored, OnceRegistered. + * GreaterEqual(>). And NullIgnored, OnlyOnceRegistered. * * @param deletedTime The value of deletedTime as greaterEqual. */ @@ -1593,7 +1527,7 @@ } /** - * LessEqual(>). And NullIgnored, OnceRegistered. + * LessEqual(>). And NullIgnored, OnlyOnceRegistered. * * @param deletedTime The value of deletedTime as lessEqual. */ @@ -1603,7 +1537,7 @@ /** * FromTo($fromDate <= COLUMN_NAME <= $toDate). And NullIgnored, - * OnceRegistered. {TIMESTAMP} + * OnlyOnceRegistered. {TIMESTAMP} * * @param fromDate The from-date of deletedTime. (Nullable) * @param toDate The to-date of deletedTime. (Nullable) @@ -1620,7 +1554,7 @@ /** * FromTo($fromDate <= COLUMN_NAME < $toDate + 1). And NullIgnored, - * OnceRegistered. {TIMESTAMP} + * OnlyOnceRegistered. {TIMESTAMP} * * @param fromDate The from-date of deletedTime. (Nullable) * @param toDate The to-date of deletedTime. (Nullable) @@ -1634,14 +1568,14 @@ } /** - * IsNull(is null). And OnceRegistered. + * IsNull(is null). And OnlyOnceRegistered. */ public void setDeletedTime_IsNull() { regDeletedTime(CK_ISN, DUMMY_OBJECT); } /** - * IsNotNull(is not null). And OnceRegistered. + * IsNotNull(is not null). And OnlyOnceRegistered. */ public void setDeletedTime_IsNotNull() { regDeletedTime(CK_ISNN, DUMMY_OBJECT); @@ -1660,7 +1594,7 @@ abstract protected ConditionValue getCValueDeletedTime(); /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {VARCHAR(255)} + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {VARCHAR(255)} * * @param deletedBy The value of deletedBy as equal. */ @@ -1669,7 +1603,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param deletedBy The value of deletedBy as notEqual. */ @@ -1678,7 +1612,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param deletedBy The value of deletedBy as greaterThan. */ @@ -1687,7 +1621,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param deletedBy The value of deletedBy as lessThan. */ @@ -1696,7 +1630,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param deletedBy The value of deletedBy as greaterEqual. */ @@ -1705,7 +1639,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param deletedBy The value of deletedBy as lessEqual. */ @@ -1714,7 +1648,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param deletedBy The value of deletedBy as prefixSearch. */ @@ -1723,20 +1657,6 @@ } /** - * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, - * SeveralRegistered. - * - * @param deletedBy The value of deletedBy as likeSearch. - * @param likeSearchOption The option of like-search. (NotNull) - */ - public void setDeletedBy_LikeSearch( - String deletedBy, - jp.sf.pal.board.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { - registerLikeSearchQuery(CK_LS, fRES(deletedBy), getCValueDeletedBy(), - "DELETED_BY", "DeletedBy", "deletedBy", likeSearchOption); - } - - /** * InScope(in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * @@ -1747,38 +1667,52 @@ } /** - * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * - * @param deletedBy The collection of deletedBy as inScope. - * @param inScopeOption The option of in-scope. (NotNull) + * @param deletedByList The collection of deletedBy as notInScope. */ - public void setDeletedBy_InScope( + public void setDeletedBy_NotInScope(Collection deletedByList) { + regDeletedBy(CK_NINS, cTL(deletedByList)); + } + + /** + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param deletedBy The value of deletedBy as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) + */ + public void setDeletedBy_LikeSearch( String deletedBy, - jp.sf.pal.board.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(deletedBy), getCValueDeletedBy(), - "DELETED_BY", "DeletedBy", "deletedBy", inScopeOption); + jp.sf.pal.board.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(deletedBy), getCValueDeletedBy(), "DELETED_BY", + "DeletedBy", "deletedBy", likeSearchOption); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param deletedByList The collection of deletedBy as notInScope. + * @param deletedBy The value of deletedBy as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setDeletedBy_NotInScope(Collection deletedByList) { - regDeletedBy(CK_NINS, cTL(deletedByList)); + public void setDeletedBy_NotLikeSearch( + String deletedBy, + jp.sf.pal.board.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(deletedBy), getCValueDeletedBy(), "DELETED_BY", + "DeletedBy", "deletedBy", likeSearchOption); } /** - * IsNull(is null). And OnceRegistered. + * IsNull(is null). And OnlyOnceRegistered. */ public void setDeletedBy_IsNull() { regDeletedBy(CK_ISN, DUMMY_OBJECT); } /** - * IsNotNull(is not null). And OnceRegistered. + * IsNotNull(is not null). And OnlyOnceRegistered. */ public void setDeletedBy_IsNotNull() { regDeletedBy(CK_ISNN, DUMMY_OBJECT); @@ -1797,7 +1731,7 @@ abstract protected ConditionValue getCValueDeletedBy(); /** - * Equal(=). And NullIgnored, OnceRegistered. {NotNull : INTEGER} + * Equal(=). And NullIgnored, OnlyOnceRegistered. {NotNull : INTEGER} * * @param versionno The value of versionno as equal. */ @@ -1806,7 +1740,7 @@ } /** - * NotEqual(!=). And NullIgnored, OnceRegistered. + * NotEqual(!=). And NullIgnored, OnlyOnceRegistered. * * @param versionno The value of versionno as notEqual. */ @@ -1815,7 +1749,7 @@ } /** - * GreaterThan(>). And NullIgnored, OnceRegistered. + * GreaterThan(>). And NullIgnored, OnlyOnceRegistered. * * @param versionno The value of versionno as greaterThan. */ @@ -1824,7 +1758,7 @@ } /** - * LessThan(<). And NullIgnored, OnceRegistered. + * LessThan(<). And NullIgnored, OnlyOnceRegistered. * * @param versionno The value of versionno as lessThan. */ @@ -1833,7 +1767,7 @@ } /** - * GreaterEqual(>=). And NullIgnored, OnceRegistered. + * GreaterEqual(>=). And NullIgnored, OnlyOnceRegistered. * * @param versionno The value of versionno as greaterEqual. */ @@ -1842,7 +1776,7 @@ } /** - * LessEqual(<=). And NullIgnored, OnceRegistered. + * LessEqual(<=). And NullIgnored, OnlyOnceRegistered. * * @param versionno The value of versionno as lessEqual. */ @@ -1882,6 +1816,50 @@ abstract protected ConditionValue getCValueVersionno(); + public SSQFunction scalar_Equal() { + return xcreateSSQFunction("="); + } + + public SSQFunction scalar_GreaterEqual() { + return xcreateSSQFunction(">="); + } + + public SSQFunction scalar_GreaterThan() { + return xcreateSSQFunction(">"); + } + + public SSQFunction scalar_LessEqual() { + return xcreateSSQFunction("<="); + } + + public SSQFunction scalar_LessThan() { + return xcreateSSQFunction("<"); + } + + protected SSQFunction xcreateSSQFunction(final String operand) { + return new SSQFunction(new SSQSetupper() { + public void setup(String function, SubQuery subQuery) { + xscalarSubQuery(function, subQuery, operand); + } + }); + } + + protected void xscalarSubQuery(String function, + SubQuery subQuery, String operand) { + assertObjectNotNull("subQuery", subQuery); + GroupInfoCB cb = new GroupInfoCB(); + cb.xsetupForScalarSubQuery(); + subQuery.query(cb); + String subQueryPropertyName = keepScalarSubQuery(cb.query()); // for + // saving + // query + // -value. + registerScalarSubQuery(function, cb.query(), subQueryPropertyName, + operand); + } + + public abstract String keepScalarSubQuery(GroupInfoCQ subQuery); + // Very Internal (for Suppressing Warn about 'Not Use Import') protected String getConditionBeanClassNameInternally() { return GroupInfoCB.class.getName(); Modified: board/trunk/src/main/java/jp/sf/pal/board/db/cbean/cq/bs/AbstractBsGroupMappingCQ.java =================================================================== --- board/trunk/src/main/java/jp/sf/pal/board/db/cbean/cq/bs/AbstractBsGroupMappingCQ.java 2008-12-27 22:06:42 UTC (rev 1624) +++ board/trunk/src/main/java/jp/sf/pal/board/db/cbean/cq/bs/AbstractBsGroupMappingCQ.java 2008-12-27 22:09:08 UTC (rev 1625) @@ -11,16 +11,13 @@ import jp.sf.pal.board.db.cbean.GroupInfoCB; import jp.sf.pal.board.db.cbean.GroupMappingCB; import jp.sf.pal.board.db.cbean.UserInfoCB; -import jp.sf.pal.board.db.cbean.cq.GroupInfoCQ; import jp.sf.pal.board.db.cbean.cq.GroupMappingCQ; -import jp.sf.pal.board.db.cbean.cq.UserInfoCQ; /** * The abstract condition-query of GROUP_MAPPING. * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public abstract class AbstractBsGroupMappingCQ extends AbstractConditionQuery { //========================================================================== @@ -50,7 +47,8 @@ // ===== /** - * Equal(=). And NullIgnored, OnceRegistered. {PK : ID : NotNull : INTEGER} + * Equal(=). And NullIgnored, OnlyOnceRegistered. {PK : ID : NotNull : + * INTEGER} * * @param id The value of id as equal. */ @@ -59,7 +57,7 @@ } /** - * NotEqual(!=). And NullIgnored, OnceRegistered. + * NotEqual(!=). And NullIgnored, OnlyOnceRegistered. * * @param id The value of id as notEqual. */ @@ -68,7 +66,7 @@ } /** - * GreaterThan(>). And NullIgnored, OnceRegistered. + * GreaterThan(>). And NullIgnored, OnlyOnceRegistered. * * @param id The value of id as greaterThan. */ @@ -77,7 +75,7 @@ } /** - * LessThan(<). And NullIgnored, OnceRegistered. + * LessThan(<). And NullIgnored, OnlyOnceRegistered. * * @param id The value of id as lessThan. */ @@ -86,7 +84,7 @@ } /** - * GreaterEqual(>=). And NullIgnored, OnceRegistered. + * GreaterEqual(>=). And NullIgnored, OnlyOnceRegistered. * * @param id The value of id as greaterEqual. */ @@ -95,7 +93,7 @@ } /** - * LessEqual(<=). And NullIgnored, OnceRegistered. + * LessEqual(<=). And NullIgnored, OnlyOnceRegistered. * * @param id The value of id as lessEqual. */ @@ -124,14 +122,14 @@ } /** - * IsNull(is null). And OnceRegistered. + * IsNull(is null). And OnlyOnceRegistered. */ public void setId_IsNull() { regId(CK_ISN, DUMMY_OBJECT); } /** - * IsNotNull(is not null). And OnceRegistered. + * IsNotNull(is not null). And OnlyOnceRegistered. */ public void setId_IsNotNull() { regId(CK_ISNN, DUMMY_OBJECT); @@ -148,8 +146,8 @@ abstract protected ConditionValue getCValueId(); /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {NotNull : VARCHAR(255) - * : FK to USER_INFO} + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {NotNull : + * VARCHAR(255) : FK to USER_INFO} * * @param userId The value of userId as equal. */ @@ -158,7 +156,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param userId The value of userId as notEqual. */ @@ -167,7 +165,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param userId The value of userId as greaterThan. */ @@ -176,7 +174,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param userId The value of userId as lessThan. */ @@ -185,7 +183,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param userId The value of userId as greaterEqual. */ @@ -194,7 +192,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param userId The value of userId as lessEqual. */ @@ -203,7 +201,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param userId The value of userId as prefixSearch. */ @@ -212,20 +210,6 @@ } /** - * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, - * SeveralRegistered. - * - * @param userId The value of userId as likeSearch. - * @param likeSearchOption The option of like-search. (NotNull) - */ - public void setUserId_LikeSearch( - String userId, - jp.sf.pal.board.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { - registerLikeSearchQuery(CK_LS, fRES(userId), getCValueUserId(), - "USER_ID", "UserId", "userId", likeSearchOption); - } - - /** * InScope(in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * @@ -236,42 +220,41 @@ } /** - * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * - * @param userId The collection of userId as inScope. - * @param inScopeOption The option of in-scope. (NotNull) + * @param userIdList The collection of userId as notInScope. */ - public void setUserId_InScope( - String userId, - jp.sf.pal.board.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(userId), getCValueUserId(), - "USER_ID", "UserId", "userId", inScopeOption); + public void setUserId_NotInScope(Collection userIdList) { + regUserId(CK_NINS, cTL(userIdList)); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param userIdList The collection of userId as notInScope. + * @param userId The value of userId as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) */ - public void setUserId_NotInScope(Collection userIdList) { - regUserId(CK_NINS, cTL(userIdList)); + public void setUserId_LikeSearch( + String userId, + jp.sf.pal.board.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(userId), getCValueUserId(), "USER_ID", "UserId", + "userId", likeSearchOption); } /** - * @param userInfoCBquery Query. - * @deprecated Please use inScopeUserInfo(subQuery) method. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param userId The value of userId as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setUserId_InScopeSubQuery_UserInfo(UserInfoCQ userInfoCBquery) { - String subQueryPropertyName = keepUserId_InScopeSubQuery_UserInfo(userInfoCBquery);// for - // saving - // query - // - - // value - // . - registerInScopeSubQuery(userInfoCBquery, "USER_ID", "USER_ID", - subQueryPropertyName); + public void setUserId_NotLikeSearch( + String userId, + jp.sf.pal.board.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(userId), getCValueUserId(), "USER_ID", "UserId", + "userId", likeSearchOption); } public void inScopeUserInfo(SubQuery subQuery) { @@ -280,12 +263,12 @@ cb.xsetupForInScopeSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepUserId_InScopeSubQuery_UserInfo(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerInScopeSubQuery(cb.query(), "USER_ID", "USER_ID", subQueryPropertyName); } - abstract public String keepUserId_InScopeSubQuery_UserInfo( + public abstract String keepUserId_InScopeSubQuery_UserInfo( jp.sf.pal.board.db.cbean.cq.UserInfoCQ subQuery); protected void regUserId(ConditionKey key, Object value) { @@ -301,8 +284,8 @@ abstract protected ConditionValue getCValueUserId(); /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {NotNull : VARCHAR(255) - * : FK to GROUP_INFO} + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {NotNull : + * VARCHAR(255) : FK to GROUP_INFO} * * @param groupId The value of groupId as equal. */ @@ -311,7 +294,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param groupId The value of groupId as notEqual. */ @@ -320,7 +303,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param groupId The value of groupId as greaterThan. */ @@ -329,7 +312,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param groupId The value of groupId as lessThan. */ @@ -338,7 +321,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param groupId The value of groupId as greaterEqual. */ @@ -347,7 +330,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param groupId The value of groupId as lessEqual. */ @@ -356,7 +339,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param groupId The value of groupId as prefixSearch. */ @@ -365,20 +348,6 @@ } /** - * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, - * SeveralRegistered. - * - * @param groupId The value of groupId as likeSearch. - * @param likeSearchOption The option of like-search. (NotNull) - */ - public void setGroupId_LikeSearch( - String groupId, - jp.sf.pal.board.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { - registerLikeSearchQuery(CK_LS, fRES(groupId), getCValueGroupId(), - "GROUP_ID", "GroupId", "groupId", likeSearchOption); - } - - /** * InScope(in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * @@ -389,43 +358,41 @@ } /** - * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * - * @param groupId The collection of groupId as inScope. - * @param inScopeOption The option of in-scope. (NotNull) + * @param groupIdList The collection of groupId as notInScope. */ - public void setGroupId_InScope( - String groupId, - jp.sf.pal.board.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(groupId), getCValueGroupId(), - "GROUP_ID", "GroupId", "groupId", inScopeOption); + public void setGroupId_NotInScope(Collection groupIdList) { + regGroupId(CK_NINS, cTL(groupIdList)); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param groupIdList The collection of groupId as notInScope. + * @param groupId The value of groupId as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) */ - public void setGroupId_NotInScope(Collection groupIdList) { - regGroupId(CK_NINS, cTL(groupIdList)); + public void setGroupId_LikeSearch( + String groupId, + jp.sf.pal.board.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(groupId), getCValueGroupId(), "GROUP_ID", "GroupId", + "groupId", likeSearchOption); } /** - * @param groupInfoCBquery Query. - * @deprecated Please use inScopeGroupInfo(subQuery) method. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param groupId The value of groupId as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setGroupId_InScopeSubQuery_GroupInfo( - GroupInfoCQ groupInfoCBquery) { - String subQueryPropertyName = keepGroupId_InScopeSubQuery_GroupInfo(groupInfoCBquery);// for - // saving - // query - // - - // value - // . - registerInScopeSubQuery(groupInfoCBquery, "GROUP_ID", "GROUP_ID", - subQueryPropertyName); + public void setGroupId_NotLikeSearch( + String groupId, + jp.sf.pal.board.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(groupId), getCValueGroupId(), "GROUP_ID", + "GroupId", "groupId", likeSearchOption); } public void inScopeGroupInfo(SubQuery subQuery) { @@ -434,12 +401,12 @@ cb.xsetupForInScopeSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepGroupId_InScopeSubQuery_GroupInfo(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerInScopeSubQuery(cb.query(), "GROUP_ID", "GROUP_ID", subQueryPropertyName); } - abstract public String keepGroupId_InScopeSubQuery_GroupInfo( + public abstract String keepGroupId_InScopeSubQuery_GroupInfo( jp.sf.pal.board.db.cbean.cq.GroupInfoCQ subQuery); protected void regGroupId(ConditionKey key, Object value) { @@ -454,6 +421,53 @@ abstract protected ConditionValue getCValueGroupId(); + public SSQFunction scalar_Equal() { + return xcreateSSQFunction("="); + } + + public SSQFunction scalar_GreaterEqual() { + return xcreateSSQFunction(">="); + } + + public SSQFunction scalar_GreaterThan() { + return xcreateSSQFunction(">"); + } + + public SSQFunction scalar_LessEqual() { + return xcreateSSQFunction("<="); + } + + public SSQFunction scalar_LessThan() { + return xcreateSSQFunction("<"); + } + + protected SSQFunction xcreateSSQFunction( + final String operand) { + return new SSQFunction( + new SSQSetupper() { + public void setup(String function, + SubQuery subQuery) { + xscalarSubQuery(function, subQuery, operand); + } + }); + } + + protected void xscalarSubQuery(String function, + SubQuery subQuery, String operand) { + assertObjectNotNull("subQuery", subQuery); + GroupMappingCB cb = new GroupMappingCB(); + cb.xsetupForScalarSubQuery(); + subQuery.query(cb); + String subQueryPropertyName = keepScalarSubQuery(cb.query()); // for + // saving + // query + // -value. + registerScalarSubQuery(function, cb.query(), subQueryPropertyName, + operand); + } + + public abstract String keepScalarSubQuery(GroupMappingCQ subQuery); + // Very Internal (for Suppressing Warn about 'Not Use Import') protected String getConditionBeanClassNameInternally() { return GroupMappingCB.class.getName(); Modified: board/trunk/src/main/java/jp/sf/pal/board/db/cbean/cq/bs/AbstractBsMessageAttachmentCQ.java =================================================================== --- board/trunk/src/main/java/jp/sf/pal/board/db/cbean/cq/bs/AbstractBsMessageAttachmentCQ.java 2008-12-27 22:06:42 UTC (rev 1624) +++ board/trunk/src/main/java/jp/sf/pal/board/db/cbean/cq/bs/AbstractBsMessageAttachmentCQ.java 2008-12-27 22:09:08 UTC (rev 1625) @@ -20,7 +20,6 @@ * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public abstract class AbstractBsMessageAttachmentCQ extends AbstractConditionQuery { @@ -51,7 +50,8 @@ // ===== /** - * Equal(=). And NullIgnored, OnceRegistered. {PK : ID : NotNull : BIGINT} + * Equal(=). And NullIgnored, OnlyOnceRegistered. {PK : ID : NotNull : + * BIGINT} * * @param id The value of id as equal. */ @@ -60,7 +60,7 @@ } /** - * NotEqual(!=). And NullIgnored, OnceRegistered. + * NotEqual(!=). And NullIgnored, OnlyOnceRegistered. * * @param id The value of id as notEqual. */ @@ -69,7 +69,7 @@ } /** - * GreaterThan(>). And NullIgnored, OnceRegistered. + * GreaterThan(>). And NullIgnored, OnlyOnceRegistered. * * @param id The value of id as greaterThan. */ @@ -78,7 +78,7 @@ } /** - * LessThan(<). And NullIgnored, OnceRegistered. + * LessThan(<). And NullIgnored, OnlyOnceRegistered. * * @param id The value of id as lessThan. */ @@ -87,7 +87,7 @@ } /** - * GreaterEqual(>=). And NullIgnored, OnceRegistered. + * GreaterEqual(>=). And NullIgnored, OnlyOnceRegistered. * * @param id The value of id as greaterEqual. */ @@ -96,7 +96,7 @@ } /** - * LessEqual(<=). And NullIgnored, OnceRegistered. + * LessEqual(<=). And NullIgnored, OnlyOnceRegistered. * * @param id The value of id as lessEqual. */ @@ -125,14 +125,14 @@ } /** - * IsNull(is null). And OnceRegistered. + * IsNull(is null). And OnlyOnceRegistered. */ public void setId_IsNull() { regId(CK_ISN, DUMMY_OBJECT); } /** - * IsNotNull(is not null). And OnceRegistered. + * IsNotNull(is not null). And OnlyOnceRegistered. */ public void setId_IsNotNull() { regId(CK_ISNN, DUMMY_OBJECT); @@ -149,7 +149,7 @@ abstract protected ConditionValue getCValueId(); /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {VARCHAR(100)} + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {VARCHAR(100)} * * @param memo The value of memo as equal. */ @@ -158,7 +158,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param memo The value of memo as notEqual. */ @@ -167,7 +167,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param memo The value of memo as greaterThan. */ @@ -176,7 +176,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param memo The value of memo as lessThan. */ @@ -185,7 +185,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param memo The value of memo as greaterEqual. */ @@ -194,7 +194,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param memo The value of memo as lessEqual. */ @@ -203,7 +203,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param memo The value of memo as prefixSearch. */ @@ -212,20 +212,6 @@ } /** - * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, - * SeveralRegistered. - * - * @param memo The value of memo as likeSearch. - * @param likeSearchOption The option of like-search. (NotNull) - */ - public void setMemo_LikeSearch( - String memo, - jp.sf.pal.board.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { - registerLikeSearchQuery(CK_LS, fRES(memo), getCValueMemo(), "MEMO", - "Memo", "memo", likeSearchOption); - } - - /** * InScope(in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * @@ -236,38 +222,52 @@ } /** - * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * - * @param memo The collection of memo as inScope. - * @param inScopeOption The option of in-scope. (NotNull) + * @param memoList The collection of memo as notInScope. */ - public void setMemo_InScope( + public void setMemo_NotInScope(Collection memoList) { + regMemo(CK_NINS, cTL(memoList)); + } + + /** + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param memo The value of memo as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) + */ + public void setMemo_LikeSearch( String memo, - jp.sf.pal.board.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(memo), getCValueMemo(), "MEMO", - "Memo", "memo", inScopeOption); + jp.sf.pal.board.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(memo), getCValueMemo(), "MEMO", "Memo", "memo", + likeSearchOption); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param memoList The collection of memo as notInScope. + * @param memo The value of memo as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setMemo_NotInScope(Collection memoList) { - regMemo(CK_NINS, cTL(memoList)); + public void setMemo_NotLikeSearch( + String memo, + jp.sf.pal.board.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(memo), getCValueMemo(), "MEMO", "Memo", "memo", + likeSearchOption); } /** - * IsNull(is null). And OnceRegistered. + * IsNull(is null). And OnlyOnceRegistered. */ public void setMemo_IsNull() { regMemo(CK_ISN, DUMMY_OBJECT); } /** - * IsNotNull(is not null). And OnceRegistered. + * IsNotNull(is not null). And OnlyOnceRegistered. */ public void setMemo_IsNotNull() { regMemo(CK_ISNN, DUMMY_OBJECT); @@ -284,8 +284,8 @@ abstract protected ConditionValue getCValueMemo(); /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {NotNull : VARCHAR(1) : - * Default=[F]} + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {NotNull : + * VARCHAR(1) : Default=[F]} * * @param versionable The value of versionable as equal. */ @@ -294,7 +294,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param versionable The value of versionable as notEqual. */ @@ -303,7 +303,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param versionable The value of versionable as greaterThan. */ @@ -312,7 +312,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param versionable The value of versionable as lessThan. */ @@ -321,7 +321,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param versionable The value of versionable as greaterEqual. */ @@ -330,7 +330,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param versionable The value of versionable as lessEqual. */ @@ -339,7 +339,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param versionable The value of versionable as prefixSearch. */ @@ -348,21 +348,6 @@ } /** - * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, - * SeveralRegistered. - * - * @param versionable The value of versionable as likeSearch. - * @param likeSearchOption The option of like-search. (NotNull) - */ - public void setVersionable_LikeSearch( - String versionable, - jp.sf.pal.board.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { - registerLikeSearchQuery(CK_LS, fRES(versionable), - getCValueVersionable(), "VERSIONABLE", "Versionable", - "versionable", likeSearchOption); - } - - /** * InScope(in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * @@ -373,27 +358,41 @@ } /** - * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * - * @param versionable The collection of versionable as inScope. - * @param inScopeOption The option of in-scope. (NotNull) + * @param versionableList The collection of versionable as notInScope. */ - public void setVersionable_InScope( + public void setVersionable_NotInScope(Collection versionableList) { + regVersionable(CK_NINS, cTL(versionableList)); + } + + /** + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param versionable The value of versionable as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) + */ + public void setVersionable_LikeSearch( String versionable, - jp.sf.pal.board.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(versionable), getCValueVersionable(), - "VERSIONABLE", "Versionable", "versionable", inScopeOption); + jp.sf.pal.board.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(versionable), getCValueVersionable(), "VERSIONABLE", + "Versionable", "versionable", likeSearchOption); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param versionableList The collection of versionable as notInScope. + * @param versionable The value of versionable as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setVersionable_NotInScope(Collection versionableList) { - regVersionable(CK_NINS, cTL(versionableList)); + public void setVersionable_NotLikeSearch( + String versionable, + jp.sf.pal.board.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(versionable), getCValueVersionable(), + "VERSIONABLE", "Versionable", "versionable", likeSearchOption); } protected void regVersionable(ConditionKey key, Object value) { @@ -409,7 +408,7 @@ abstract protected ConditionValue getCValueVersionable(); /** - * Equal(=). And NullIgnored, OnceRegistered. {NotNull : BIGINT : FK to + * Equal(=). And NullIgnored, OnlyOnceRegistered. {NotNull : BIGINT : FK to * MESSAGE} * * @param messageId The value of messageId as equal. @@ -419,7 +418,7 @@ } /** - * NotEqual(!=). And NullIgnored, OnceRegistered. + * NotEqual(!=). And NullIgnored, OnlyOnceRegistered. * * @param messageId The value of messageId as notEqual. */ @@ -428,7 +427,7 @@ } /** - * GreaterThan(>). And NullIgnored, OnceRegistered. + * GreaterThan(>). And NullIgnored, OnlyOnceRegistered. * * @param messageId The value of messageId as greaterThan. */ @@ -437,7 +436,7 @@ } /** - * LessThan(<). And NullIgnored, OnceRegistered. + * LessThan(<). And NullIgnored, OnlyOnceRegistered. * * @param messageId The value of messageId as lessThan. */ @@ -446,7 +445,7 @@ } /** - * GreaterEqual(>=). And NullIgnored, OnceRegistered. + * GreaterEqual(>=). And NullIgnored, OnlyOnceRegistered. * * @param messageId The value of messageId as greaterEqual. */ @@ -455,7 +454,7 @@ } /** - * LessEqual(<=). And NullIgnored, OnceRegistered. + * LessEqual(<=). And NullIgnored, OnlyOnceRegistered. * * @param messageId The value of messageId as lessEqual. */ @@ -483,33 +482,18 @@ regMessageId(CK_NINS, cTL(messageIdList)); } - /** - * @param messageCBquery Query. - * @deprecated Please use inScopeMessage(subQuery) method. - */ - public void setMessageId_InScopeSubQuery_Message(MessageCQ messageCBquery) { - String subQueryPropertyName = keepMessageId_InScopeSubQuery_Message(messageCBquery);// for - // saving - // query - // - - // value - // . - registerInScopeSubQuery(messageCBquery, "MESSAGE_ID", "ID", - subQueryPropertyName); - } - public void inScopeMessage(SubQuery subQuery) { assertObjectNotNull("subQuery", subQuery); MessageCB cb = new MessageCB(); cb.xsetupForInScopeSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepMessageId_InScopeSubQuery_Message(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerInScopeSubQuery(cb.query(), "MESSAGE_ID", "ID", subQueryPropertyName); } - abstract public String keepMessageId_InScopeSubQuery_Message( + public abstract String keepMessageId_InScopeSubQuery_Message( MessageCQ subQuery); protected void regMessageId(ConditionKey key, Object value) { @@ -525,7 +509,7 @@ abstract protected ConditionValue getCValueMessageId(); /** - * Equal(=). And NullIgnored, OnceRegistered. {NotNull : BIGINT : FK to + * Equal(=). And NullIgnored, OnlyOnceRegistered. {NotNull : BIGINT : FK to * ATTACHMENT} * * @param attachmentId The value of attachmentId as equal. @@ -535,7 +519,7 @@ } /** - * NotEqual(!=). And NullIgnored, OnceRegistered. + * NotEqual(!=). And NullIgnored, OnlyOnceRegistered. * * @param attachmentId The value of attachmentId as notEqual. */ @@ -544,7 +528,7 @@ } /** - * GreaterThan(>). And NullIgnored, OnceRegistered. + * GreaterThan(>). And NullIgnored, OnlyOnceRegistered. * * @param attachmentId The value of attachmentId as greaterThan. */ @@ -553,7 +537,7 @@ } /** - * LessThan(<). And NullIgnored, OnceRegistered. + * LessThan(<). And NullIgnored, OnlyOnceRegistered. * * @param attachmentId The value of attachmentId as lessThan. */ @@ -562,7 +546,7 @@ } /** - * GreaterEqual(>=). And NullIgnored, OnceRegistered. + * GreaterEqual(>=). And NullIgnored, OnlyOnceRegistered. * * @param attachmentId The value of attachmentId as greaterEqual. */ @@ -571,7 +555,7 @@ } /** - * LessEqual(<=). And NullIgnored, OnceRegistered. + * LessEqual(<=). And NullIgnored, OnlyOnceRegistered. * * @param attachmentId The value of attachmentId as lessEqual. */ @@ -599,34 +583,18 @@ regAttachmentId(CK_NINS, cTL(attachmentIdList)); } - /** - * @param attachmentCBquery Query. - * @deprecated Please use inScopeAttachment(subQuery) method. - */ - public void setAttachmentId_InScopeSubQuery_Attachment( - AttachmentCQ attachmentCBquery) { - String subQueryPropertyName = keepAttachmentId_InScopeSubQuery_Attachment(attachmentCBquery);// for - // saving - // query - // - - // value - // . - registerInScopeSubQuery(attachmentCBquery, "ATTACHMENT_ID", "ID", - subQueryPropertyName); - } - public void inScopeAttachment(SubQuery subQuery) { assertObjectNotNull("subQuery", subQuery); AttachmentCB cb = new AttachmentCB(); cb.xsetupForInScopeSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepAttachmentId_InScopeSubQuery_Attachment(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerInScopeSubQuery(cb.query(), "ATTACHMENT_ID", "ID", subQueryPropertyName); } - abstract public String keepAttachmentId_InScopeSubQuery_Attachment( + public abstract String keepAttachmentId_InScopeSubQuery_Attachment( AttachmentCQ subQuery); protected void regAttachmentId(ConditionKey key, Object value) { @@ -642,7 +610,7 @@ abstract protected ConditionValue getCValueAttachmentId(); /** - * Equal(=). And NullIgnored, OnceRegistered. {NotNull : TIMESTAMP} + * Equal(=). And NullIgnored, OnlyOnceRegistered. {NotNull : TIMESTAMP} * * @param createdTime The value of createdTime as equal. */ @@ -651,7 +619,7 @@ } /** - * NotEqual(!=). And NullIgnored, OnceRegistered. + * NotEqual(!=). And NullIgnored, OnlyOnceRegistered. * * @param createdTime The value of createdTime as notEqual. */ @@ -660,7 +628,7 @@ } /** - * GreaterThan(>). And NullIgnored, OnceRegistered. + * GreaterThan(>). And NullIgnored, OnlyOnceRegistered. * * @param createdTime The value of createdTime as greaterThan. */ @@ -669,7 +637,7 @@ } /** - * LessThan(>). And NullIgnored, OnceRegistered. + * LessThan(>). And NullIgnored, OnlyOnceRegistered. * * @param createdTime The value of createdTime as lessThan. */ @@ -678,7 +646,7 @@ } /** - * GreaterEqual(>). And NullIgnored, OnceRegistered. + * GreaterEqual(>). And NullIgnored, OnlyOnceRegistered. * * @param createdTime The value of createdTime as greaterEqual. */ @@ -687,7 +655,7 @@ } /** - * LessEqual(>). And NullIgnored, OnceRegistered. + * LessEqual(>). And NullIgnored, OnlyOnceRegistered. * * @param createdTime The value of createdTime as lessEqual. */ @@ -697,7 +665,7 @@ /** * FromTo($fromDate <= COLUMN_NAME <= $toDate). And NullIgnored, - * OnceRegistered. {NotNull : TIMESTAMP} + * OnlyOnceRegistered. {NotNull : TIMESTAMP} * * @param fromDate The from-date of createdTime. (Nullable) * @param toDate The to-date of createdTime. (Nullable) @@ -714,7 +682,7 @@ /** * FromTo($fromDate <= COLUMN_NAME < $toDate + 1). And NullIgnored, - * OnceRegistered. {NotNull : TIMESTAMP} + * OnlyOnceRegistered. {NotNull : TIMESTAMP} * * @param fromDate The from-date of createdTime. (Nullable) * @param toDate The to-date of createdTime. (Nullable) @@ -740,7 +708,7 @@ abstract protected ConditionValue getCValueCreatedTime(); /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {NotNull : + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {NotNull : * VARCHAR(255)} * * @param createdBy The value of createdBy as equal. @@ -750,7 +718,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param createdBy The value of createdBy as notEqual. */ @@ -759,7 +727,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param createdBy The value of createdBy as greaterThan. */ @@ -768,7 +736,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param createdBy The value of createdBy as lessThan. */ @@ -777,7 +745,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param createdBy The value of createdBy as greaterEqual. */ @@ -786,7 +754,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param createdBy The value of createdBy as lessEqual. */ @@ -795,7 +763,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param createdBy The value of createdBy as prefixSearch. */ @@ -804,20 +772,6 @@ } /** - * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, - * SeveralRegistered. - * - * @param createdBy The value of createdBy as likeSearch. - * @param likeSearchOption The option of like-search. (NotNull) - */ - public void setCreatedBy_LikeSearch( - String createdBy, - jp.sf.pal.board.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { - registerLikeSearchQuery(CK_LS, fRES(createdBy), getCValueCreatedBy(), - "CREATED_BY", "CreatedBy", "createdBy", likeSearchOption); - } - - /** * InScope(in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * @@ -828,27 +782,41 @@ } /** - * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * - * @param createdBy The collection of createdBy as inScope. - * @param inScopeOption The option of in-scope. (NotNull) + * @param createdByList The collection of createdBy as notInScope. */ - public void setCreatedBy_InScope( + public void setCreatedBy_NotInScope(Collection createdByList) { + regCreatedBy(CK_NINS, cTL(createdByList)); + } + + /** + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param createdBy The value of createdBy as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) + */ + public void setCreatedBy_LikeSearch( String createdBy, - jp.sf.pal.board.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(createdBy), getCValueCreatedBy(), - "CREATED_BY", "CreatedBy", "createdBy", inScopeOption); + jp.sf.pal.board.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(createdBy), getCValueCreatedBy(), "CREATED_BY", + "CreatedBy", "createdBy", likeSearchOption); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param createdByList The collection of createdBy as notInScope. + * @param createdBy The value of createdBy as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setCreatedBy_NotInScope(Collection createdByList) { - regCreatedBy(CK_NINS, cTL(createdByList)); + public void setCreatedBy_NotLikeSearch( + String createdBy, + jp.sf.pal.board.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(createdBy), getCValueCreatedBy(), "CREATED_BY", + "CreatedBy", "createdBy", likeSearchOption); } protected void regCreatedBy(ConditionKey key, Object value) { @@ -864,7 +832,7 @@ abstract protected ConditionValue getCValueCreatedBy(); /** - * Equal(=). And NullIgnored, OnceRegistered. {NotNull : TIMESTAMP} + * Equal(=). And NullIgnored, OnlyOnceRegistered. {NotNull : TIMESTAMP} * * @param updatedTime The value of updatedTime as equal. */ @@ -873,7 +841,7 @@ } /** - * NotEqual(!=). And NullIgnored, OnceRegistered. + * NotEqual(!=). And NullIgnored, OnlyOnceRegistered. * * @param updatedTime The value of updatedTime as notEqual. */ @@ -882,7 +850,7 @@ } /** - * GreaterThan(>). And NullIgnored, OnceRegistered. + * GreaterThan(>). And NullIgnored, OnlyOnceRegistered. * * @param updatedTime The value of updatedTime as greaterThan. */ @@ -891,7 +859,7 @@ } /** - * LessThan(>). And NullIgnored, OnceRegistered. + * LessThan(>). And NullIgnored, OnlyOnceRegistered. * * @param updatedTime The value of updatedTime as lessThan. */ @@ -900,7 +868,7 @@ } /** - * GreaterEqual(>). And NullIgnored, OnceRegistered. + * GreaterEqual(>). And NullIgnored, OnlyOnceRegistered. * * @param updatedTime The value of updatedTime as greaterEqual. */ @@ -909,7 +877,7 @@ } /** - * LessEqual(>). And NullIgnored, OnceRegistered. + * LessEqual(>). And NullIgnored, OnlyOnceRegistered. * * @param updatedTime The value of updatedTime as lessEqual. */ @@ -919,7 +887,7 @@ /** * FromTo($fromDate <= COLUMN_NAME <= $toDate). And NullIgnored, - * OnceRegistered. {NotNull : TIMESTAMP} + * OnlyOnceRegistered. {NotNull : TIMESTAMP} * * @param fromDate The from-date of updatedTime. (Nullable) * @param toDate The to-date of updatedTime. (Nullable) @@ -936,7 +904,7 @@ /** * FromTo($fromDate <= COLUMN_NAME < $toDate + 1). And NullIgnored, - * OnceRegistered. {NotNull : TIMESTAMP} + * OnlyOnceRegistered. {NotNull : TIMESTAMP} * * @param fromDate The from-date of updatedTime. (Nullable) * @param toDate The to-date of updatedTime. (Nullable) @@ -962,7 +930,7 @@ abstract protected ConditionValue getCValueUpdatedTime(); /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {NotNull : + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {NotNull : * VARCHAR(255)} * * @param updatedBy The value of updatedBy as equal. @@ -972,7 +940,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param updatedBy The value of updatedBy as notEqual. */ @@ -981,7 +949,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param updatedBy The value of updatedBy as greaterThan. */ @@ -990,7 +958,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param updatedBy The value of updatedBy as lessThan. */ @@ -999,7 +967,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param updatedBy The value of updatedBy as greaterEqual. */ @@ -1008,7 +976,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param updatedBy The value of updatedBy as lessEqual. */ @@ -1017,7 +985,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param updatedBy The value of updatedBy as prefixSearch. */ @@ -1026,20 +994,6 @@ } /** - * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, - * SeveralRegistered. - * - * @param updatedBy The value of updatedBy as likeSearch. - * @param likeSearchOption The option of like-search. (NotNull) - */ - public void setUpdatedBy_LikeSearch( - String updatedBy, - jp.sf.pal.board.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { - registerLikeSearchQuery(CK_LS, fRES(updatedBy), getCValueUpdatedBy(), - "UPDATED_BY", "UpdatedBy", "updatedBy", likeSearchOption); - } - - /** * InScope(in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * @@ -1050,27 +1004,41 @@ } /** - * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * - * @param updatedBy The collection of updatedBy as inScope. - * @param inScopeOption The option of in-scope. (NotNull) + * @param updatedByList The collection of updatedBy as notInScope. */ - public void setUpdatedBy_InScope( + public void setUpdatedBy_NotInScope(Collection updatedByList) { + regUpdatedBy(CK_NINS, cTL(updatedByList)); + } + + /** + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param updatedBy The value of updatedBy as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) + */ + public void setUpdatedBy_LikeSearch( String updatedBy, - jp.sf.pal.board.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(updatedBy), getCValueUpdatedBy(), - "UPDATED_BY", "UpdatedBy", "updatedBy", inScopeOption); + jp.sf.pal.board.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(updatedBy), getCValueUpdatedBy(), "UPDATED_BY", + "UpdatedBy", "updatedBy", likeSearchOption); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param updatedByList The collection of updatedBy as notInScope. + * @param updatedBy The value of updatedBy as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setUpdatedBy_NotInScope(Collection updatedByList) { - regUpdatedBy(CK_NINS, cTL(updatedByList)); + public void setUpdatedBy_NotLikeSearch( + String updatedBy, + jp.sf.pal.board.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(updatedBy), getCValueUpdatedBy(), "UPDATED_BY", + "UpdatedBy", "updatedBy", likeSearchOption); } protected void regUpdatedBy(ConditionKey key, Object value) { @@ -1086,7 +1054,7 @@ abstract protected ConditionValue getCValueUpdatedBy(); /** - * Equal(=). And NullIgnored, OnceRegistered. {TIMESTAMP} + * Equal(=). And NullIgnored, OnlyOnceRegistered. {TIMESTAMP} * * @param deletedTime The value of deletedTime as equal. */ @@ -1095,7 +1063,7 @@ } /** - * NotEqual(!=). And NullIgnored, OnceRegistered. + * NotEqual(!=). And NullIgnored, OnlyOnceRegistered. * * @param deletedTime The value of deletedTime as notEqual. */ @@ -1104,7 +1072,7 @@ } /** - * GreaterThan(>). And NullIgnored, OnceRegistered. + * GreaterThan(>). And NullIgnored, OnlyOnceRegistered. * * @param deletedTime The value of deletedTime as greaterThan. */ @@ -1113,7 +1081,7 @@ } /** - * LessThan(>). And NullIgnored, OnceRegistered. + * LessThan(>). And NullIgnored, OnlyOnceRegistered. * * @param deletedTime The value of deletedTime as lessThan. */ @@ -1122,7 +1090,7 @@ } /** - * GreaterEqual(>). And NullIgnored, OnceRegistered. + * GreaterEqual(>). And NullIgnored, OnlyOnceRegistered. * * @param deletedTime The value of deletedTime as greaterEqual. */ @@ -1131,7 +1099,7 @@ } /** - * LessEqual(>). And NullIgnored, OnceRegistered. + * LessEqual(>). And NullIgnored, OnlyOnceRegistered. * * @param deletedTime The value of deletedTime as lessEqual. */ @@ -1141,7 +1109,7 @@ /** * FromTo($fromDate <= COLUMN_NAME <= $toDate). And NullIgnored, - * OnceRegistered. {TIMESTAMP} + * OnlyOnceRegistered. {TIMESTAMP} * * @param fromDate The from-date of deletedTime. (Nullable) * @param toDate The to-date of deletedTime. (Nullable) @@ -1158,7 +1126,7 @@ /** * FromTo($fromDate <= COLUMN_NAME < $toDate + 1). And NullIgnored, - * OnceRegistered. {TIMESTAMP} + * OnlyOnceRegistered. {TIMESTAMP} * * @param fromDate The from-date of deletedTime. (Nullable) * @param toDate The to-date of deletedTime. (Nullable) @@ -1172,14 +1140,14 @@ } /** - * IsNull(is null). And OnceRegistered. + * IsNull(is null). And OnlyOnceRegistered. */ public void setDeletedTime_IsNull() { regDeletedTime(CK_ISN, DUMMY_OBJECT); } /** - * IsNotNull(is not null). And OnceRegistered. + * IsNotNull(is not null). And OnlyOnceRegistered. */ public void setDeletedTime_IsNotNull() { regDeletedTime(CK_ISNN, DUMMY_OBJECT); @@ -1198,7 +1166,7 @@ abstract protected ConditionValue getCValueDeletedTime(); /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {VARCHAR(255)} + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {VARCHAR(255)} * * @param deletedBy The value of deletedBy as equal. */ @@ -1207,7 +1175,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param deletedBy The value of deletedBy as notEqual. */ @@ -1216,7 +1184,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param deletedBy The value of deletedBy as greaterThan. */ @@ -1225,7 +1193,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param deletedBy The value of deletedBy as lessThan. */ @@ -1234,7 +1202,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param deletedBy The value of deletedBy as greaterEqual. */ @@ -1243,7 +1211,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param deletedBy The value of deletedBy as lessEqual. */ @@ -1252,7 +1220,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param deletedBy The value of deletedBy as prefixSearch. */ @@ -1261,20 +1229,6 @@ } /** - * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, - * SeveralRegistered. - * - * @param deletedBy The value of deletedBy as likeSearch. - * @param likeSearchOption The option of like-search. (NotNull) - */ - public void setDeletedBy_LikeSearch( - String deletedBy, - jp.sf.pal.board.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { - registerLikeSearchQuery(CK_LS, fRES(deletedBy), getCValueDeletedBy(), - "DELETED_BY", "DeletedBy", "deletedBy", likeSearchOption); - } - - /** * InScope(in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * @@ -1285,38 +1239,52 @@ } /** - * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * - * @param deletedBy The collection of deletedBy as inScope. - * @param inScopeOption The option of in-scope. (NotNull) + * @param deletedByList The collection of deletedBy as notInScope. */ - public void setDeletedBy_InScope( + public void setDeletedBy_NotInScope(Collection deletedByList) { + regDeletedBy(CK_NINS, cTL(deletedByList)); + } + + /** + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param deletedBy The value of deletedBy as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) + */ + public void setDeletedBy_LikeSearch( String deletedBy, - jp.sf.pal.board.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(deletedBy), getCValueDeletedBy(), - "DELETED_BY", "DeletedBy", "deletedBy", inScopeOption); + jp.sf.pal.board.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(deletedBy), getCValueDeletedBy(), "DELETED_BY", + "DeletedBy", "deletedBy", likeSearchOption); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param deletedByList The collection of deletedBy as notInScope. + * @param deletedBy The value of deletedBy as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setDeletedBy_NotInScope(Collection deletedByList) { - regDeletedBy(CK_NINS, cTL(deletedByList)); + public void setDeletedBy_NotLikeSearch( + String deletedBy, + jp.sf.pal.board.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(deletedBy), getCValueDeletedBy(), "DELETED_BY", + "DeletedBy", "deletedBy", likeSearchOption); } /** - * IsNull(is null). And OnceRegistered. + * IsNull(is null). And OnlyOnceRegistered. */ public void setDeletedBy_IsNull() { regDeletedBy(CK_ISN, DUMMY_OBJECT); } /** - * IsNotNull(is not null). And OnceRegistered. + * IsNotNull(is not null). And OnlyOnceRegistered. */ public void setDeletedBy_IsNotNull() { regDeletedBy(CK_ISNN, DUMMY_OBJECT); @@ -1335,7 +1303,7 @@ abstract protected ConditionValue getCValueDeletedBy(); /** - * Equal(=). And NullIgnored, OnceRegistered. {NotNull : INTEGER : + * Equal(=). And NullIgnored, OnlyOnceRegistered. {NotNull : INTEGER : * Default=[0]} * * @param versionno The value of versionno as equal. @@ -1345,7 +1313,7 @@ } /** - * NotEqual(!=). And NullIgnored, OnceRegistered. + * NotEqual(!=). And NullIgnored, OnlyOnceRegistered. * * @param versionno The value of versionno as notEqual. */ @@ -1354,7 +1322,7 @@ } /** - * GreaterThan(>). And NullIgnored, OnceRegistered. + * GreaterThan(>). And NullIgnored, OnlyOnceRegistered. * * @param versionno The value of versionno as greaterThan. */ @@ -1363,7 +1331,7 @@ } /** - * LessThan(<). And NullIgnored, OnceRegistered. + * LessThan(<). And NullIgnored, OnlyOnceRegistered. * * @param versionno The value of versionno as lessThan. */ @@ -1372,7 +1340,7 @@ } /** - * GreaterEqual(>=). And NullIgnored, OnceRegistered. + * GreaterEqual(>=). And NullIgnored, OnlyOnceRegistered. * * @param versionno The value of versionno as greaterEqual. */ @@ -1381,7 +1349,7 @@ } /** - * LessEqual(<=). And NullIgnored, OnceRegistered. + * LessEqual(<=). And NullIgnored, OnlyOnceRegistered. * * @param versionno The value of versionno as lessEqual. */ @@ -1421,6 +1389,53 @@ abstract protected ConditionValue getCValueVersionno(); + public SSQFunction scalar_Equal() { + return xcreateSSQFunction("="); + } + + public SSQFunction scalar_GreaterEqual() { + return xcreateSSQFunction(">="); + } + + public SSQFunction scalar_GreaterThan() { + return xcreateSSQFunction(">"); + } + + public SSQFunction scalar_LessEqual() { + return xcreateSSQFunction("<="); + } + + public SSQFunction scalar_LessThan() { + return xcreateSSQFunction("<"); + } + + protected SSQFunction xcreateSSQFunction( + final String operand) { + return new SSQFunction( + new SSQSetupper() { + public void setup(String function, + SubQuery subQuery) { + xscalarSubQuery(function, subQuery, operand); + } + }); + } + + protected void xscalarSubQuery(String function, + SubQuery subQuery, String operand) { + assertObjectNotNull("subQuery", subQuery); + MessageAttachmentCB cb = new MessageAttachmentCB(); + cb.xsetupForScalarSubQuery(); + subQuery.query(cb); + String subQueryPropertyName = keepScalarSubQuery(cb.query()); // for + // saving + // query + // -value. + registerScalarSubQuery(function, cb.query(), subQueryPropertyName, + operand); + } + + public abstract String keepScalarSubQuery(MessageAttachmentCQ subQuery); + // Very Internal (for Suppressing Warn about 'Not Use Import') protected String getConditionBeanClassNameInternally() { return MessageAttachmentCB.class.getName(); Modified: board/trunk/src/main/java/jp/sf/pal/board/db/cbean/cq/bs/AbstractBsMessageCQ.java =================================================================== --- board/trunk/src/main/java/jp/sf/pal/board/db/cbean/cq/bs/AbstractBsMessageCQ.java 2008-12-27 22:06:42 UTC (rev 1624) +++ board/trunk/src/main/java/jp/sf/pal/board/db/cbean/cq/bs/AbstractBsMessageCQ.java 2008-12-27 22:09:08 UTC (rev 1625) @@ -24,7 +24,6 @@ * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public abstract class AbstractBsMessageCQ extends AbstractConditionQuery { //========================================================================== @@ -54,7 +53,8 @@ // ===== /** - * Equal(=). And NullIgnored, OnceRegistered. {PK : ID : NotNull : BIGINT} + * Equal(=). And NullIgnored, OnlyOnceRegistered. {PK : ID : NotNull : + * BIGINT} * * @param id The value of id as equal. */ @@ -63,7 +63,7 @@ } /** - * NotEqual(!=). And NullIgnored, OnceRegistered. + * NotEqual(!=). And NullIgnored, OnlyOnceRegistered. * * @param id The value of id as notEqual. */ @@ -72,7 +72,7 @@ } /** - * GreaterThan(>). And NullIgnored, OnceRegistered. + * GreaterThan(>). And NullIgnored, OnlyOnceRegistered. * * @param id The value of id as greaterThan. */ @@ -81,7 +81,7 @@ } /** - * LessThan(<). And NullIgnored, OnceRegistered. + * LessThan(<). And NullIgnored, OnlyOnceRegistered. * * @param id The value of id as lessThan. */ @@ -90,7 +90,7 @@ } /** - * GreaterEqual(>=). And NullIgnored, OnceRegistered. + * GreaterEqual(>=). And NullIgnored, OnlyOnceRegistered. * * @param id The value of id as greaterEqual. */ @@ -99,7 +99,7 @@ } /** - * LessEqual(<=). And NullIgnored, OnceRegistered. + * LessEqual(<=). And NullIgnored, OnlyOnceRegistered. * * @param id The value of id as lessEqual. */ @@ -127,22 +127,6 @@ regId(CK_NINS, cTL(idList)); } - /** - * @param messageAttachmentCBquery Query. - * @deprecated Please use inScopeMessageAttachmentList(subQuery) method. - */ - public void setId_InScopeSubQuery_MessageAttachmentList( - MessageAttachmentCQ messageAttachmentCBquery) { - String subQueryPropertyName = keepId_InScopeSubQuery_MessageAttachmentList(messageAttachmentCBquery);// for - // saving - // query - // - - // value - // . - registerInScopeSubQuery(messageAttachmentCBquery, "ID", "MESSAGE_ID", - subQueryPropertyName); - } - public void inScopeMessageAttachmentList( SubQuery subQuery) { assertObjectNotNull("subQuery", subQuery); @@ -150,71 +134,40 @@ cb.xsetupForInScopeSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepId_InScopeSubQuery_MessageAttachmentList(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerInScopeSubQuery(cb.query(), "ID", "MESSAGE_ID", subQueryPropertyName); } - abstract public String keepId_InScopeSubQuery_MessageAttachmentList( + public abstract String keepId_InScopeSubQuery_MessageAttachmentList( MessageAttachmentCQ subQuery); - /** - * @param messageContentCBquery Query. - * @deprecated Please use inScopeMessageContentAsOne(subQuery) method. - */ - public void setId_InScopeSubQuery_MessageContentAsOne( - MessageContentCQ messageContentCBquery) { - String subQueryPropertyName = keepId_InScopeSubQuery_MessageContentAsOne(messageContentCBquery);// for - // saving - // query - // - - // value - // . - registerInScopeSubQuery(messageContentCBquery, "ID", "MESSAGE_ID", - subQueryPropertyName); - } - public void inScopeMessageContentAsOne(SubQuery subQuery) { assertObjectNotNull("subQuery", subQuery); MessageContentCB cb = new MessageContentCB(); cb.xsetupForInScopeSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepId_InScopeSubQuery_MessageContentAsOne(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerInScopeSubQuery(cb.query(), "ID", "MESSAGE_ID", subQueryPropertyName); } - abstract public String keepId_InScopeSubQuery_MessageContentAsOne( + public abstract String keepId_InScopeSubQuery_MessageContentAsOne( MessageContentCQ subQuery); - /** - * @param replyCBquery Query. - * @deprecated Please use inScopeReplyList(subQuery) method. - */ - public void setId_InScopeSubQuery_ReplyList(ReplyCQ replyCBquery) { - String subQueryPropertyName = keepId_InScopeSubQuery_ReplyList(replyCBquery);// for - // saving - // query - // - - // value - // . - registerInScopeSubQuery(replyCBquery, "ID", "MESSAGE_ID", - subQueryPropertyName); - } - public void inScopeReplyList(SubQuery subQuery) { assertObjectNotNull("subQuery", subQuery); ReplyCB cb = new ReplyCB(); cb.xsetupForInScopeSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepId_InScopeSubQuery_ReplyList(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerInScopeSubQuery(cb.query(), "ID", "MESSAGE_ID", subQueryPropertyName); } - abstract public String keepId_InScopeSubQuery_ReplyList(ReplyCQ subQuery); + public abstract String keepId_InScopeSubQuery_ReplyList(ReplyCQ subQuery); public void notInScopeMessageAttachmentList( SubQuery subQuery) { @@ -223,12 +176,12 @@ cb.xsetupForInScopeSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepId_NotInScopeSubQuery_MessageAttachmentList(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerNotInScopeSubQuery(cb.query(), "ID", "MESSAGE_ID", subQueryPropertyName); } - abstract public String keepId_NotInScopeSubQuery_MessageAttachmentList( + public abstract String keepId_NotInScopeSubQuery_MessageAttachmentList( MessageAttachmentCQ subQuery); public void notInScopeMessageContentAsOne( @@ -238,12 +191,12 @@ cb.xsetupForInScopeSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepId_NotInScopeSubQuery_MessageContentAsOne(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerNotInScopeSubQuery(cb.query(), "ID", "MESSAGE_ID", subQueryPropertyName); } - abstract public String keepId_NotInScopeSubQuery_MessageContentAsOne( + public abstract String keepId_NotInScopeSubQuery_MessageContentAsOne( MessageContentCQ subQuery); public void notInScopeReplyList(SubQuery subQuery) { @@ -252,30 +205,14 @@ cb.xsetupForInScopeSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepId_NotInScopeSubQuery_ReplyList(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerNotInScopeSubQuery(cb.query(), "ID", "MESSAGE_ID", subQueryPropertyName); } - abstract public String keepId_NotInScopeSubQuery_ReplyList(ReplyCQ subQuery); + public abstract String keepId_NotInScopeSubQuery_ReplyList(ReplyCQ subQuery); /** - * @param messageAttachmentCBquery Query. - * @deprecated Please use existsMessageAttachmentList(subQuery) method. - */ - public void setId_ExistsSubQuery_MessageAttachmentList( - MessageAttachmentCQ messageAttachmentCBquery) { - String subQueryPropertyName = keepId_ExistsSubQuery_MessageAttachmentList(messageAttachmentCBquery);// for - // saving - // query - // - - // value - // . - registerExistsSubQuery(messageAttachmentCBquery, "ID", "MESSAGE_ID", - subQueryPropertyName); - } - - /** * Set up 'exists' sub-query. {exists (select MESSAGE_ID from * MESSAGE_ATTACHMENT where ...)} * @@ -289,31 +226,15 @@ cb.xsetupForExistsSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepId_ExistsSubQuery_MessageAttachmentList(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerExistsSubQuery(cb.query(), "ID", "MESSAGE_ID", subQueryPropertyName); } - abstract public String keepId_ExistsSubQuery_MessageAttachmentList( + public abstract String keepId_ExistsSubQuery_MessageAttachmentList( MessageAttachmentCQ subQuery); /** - * @param messageContentCBquery Query. - * @deprecated Please use existsMessageContentAsOne(subQuery) method. - */ - public void setId_ExistsSubQuery_MessageContentAsOne( - MessageContentCQ messageContentCBquery) { - String subQueryPropertyName = keepId_ExistsSubQuery_MessageContentAsOne(messageContentCBquery);// for - // saving - // query - // - - // value - // . - registerExistsSubQuery(messageContentCBquery, "ID", "MESSAGE_ID", - subQueryPropertyName); - } - - /** * Set up 'exists' sub-query. {exists (select MESSAGE_ID from * MESSAGE_CONTENT where ...)} * @@ -326,30 +247,15 @@ cb.xsetupForExistsSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepId_ExistsSubQuery_MessageContentAsOne(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerExistsSubQuery(cb.query(), "ID", "MESSAGE_ID", subQueryPropertyName); } - abstract public String keepId_ExistsSubQuery_MessageContentAsOne( + public abstract String keepId_ExistsSubQuery_MessageContentAsOne( MessageContentCQ subQuery); /** - * @param replyCBquery Query. - * @deprecated Please use existsReplyList(subQuery) method. - */ - public void setId_ExistsSubQuery_ReplyList(ReplyCQ replyCBquery) { - String subQueryPropertyName = keepId_ExistsSubQuery_ReplyList(replyCBquery);// for - // saving - // query - // - - // value - // . - registerExistsSubQuery(replyCBquery, "ID", "MESSAGE_ID", - subQueryPropertyName); - } - - /** * Set up 'exists' sub-query. {exists (select MESSAGE_ID from REPLY where * ...)} * @@ -362,12 +268,12 @@ cb.xsetupForExistsSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepId_ExistsSubQuery_ReplyList(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerExistsSubQuery(cb.query(), "ID", "MESSAGE_ID", subQueryPropertyName); } - abstract public String keepId_ExistsSubQuery_ReplyList(ReplyCQ subQuery); + public abstract String keepId_ExistsSubQuery_ReplyList(ReplyCQ subQuery); /** * Set up 'not exists' sub-query. {not exists (select MESSAGE_ID from @@ -384,12 +290,12 @@ cb.xsetupForExistsSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepId_NotExistsSubQuery_MessageAttachmentList(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerNotExistsSubQuery(cb.query(), "ID", "MESSAGE_ID", subQueryPropertyName); } - abstract public String keepId_NotExistsSubQuery_MessageAttachmentList( + public abstract String keepId_NotExistsSubQuery_MessageAttachmentList( MessageAttachmentCQ subQuery); /** @@ -405,12 +311,12 @@ cb.xsetupForExistsSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepId_NotExistsSubQuery_MessageContentAsOne(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerNotExistsSubQuery(cb.query(), "ID", "MESSAGE_ID", subQueryPropertyName); } - abstract public String keepId_NotExistsSubQuery_MessageContentAsOne( + public abstract String keepId_NotExistsSubQuery_MessageContentAsOne( MessageContentCQ subQuery); /** @@ -426,51 +332,51 @@ cb.xsetupForExistsSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepId_NotExistsSubQuery_ReplyList(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerNotExistsSubQuery(cb.query(), "ID", "MESSAGE_ID", subQueryPropertyName); } - abstract public String keepId_NotExistsSubQuery_ReplyList(ReplyCQ subQuery); + public abstract String keepId_NotExistsSubQuery_ReplyList(ReplyCQ subQuery); public void xderiveMessageAttachmentList(String function, SubQuery subQuery, String aliasName) { assertObjectNotNull("subQuery", subQuery); MessageAttachmentCB cb = new MessageAttachmentCB(); - cb.xsetupForDeriveReferrer(); + cb.xsetupForDerivedReferrer(); subQuery.query(cb); - String subQueryPropertyName = keepId_DeriveSubQuery_MessageAttachmentList(cb - .query());// for saving query-value. - registerDeriveSubQuery(function, cb.query(), "ID", "MESSAGE_ID", - subQueryPropertyName, aliasName); + String subQueryPropertyName = keepId_DerivedReferrer_MessageAttachmentList(cb + .query()); // for saving query-value. + registerDerivedReferrerSubQuery(function, cb.query(), "ID", + "MESSAGE_ID", subQueryPropertyName, aliasName); } - abstract public String keepId_DeriveSubQuery_MessageAttachmentList( + public abstract String keepId_DerivedReferrer_MessageAttachmentList( MessageAttachmentCQ subQuery); public void xderiveReplyList(String function, SubQuery subQuery, String aliasName) { assertObjectNotNull("subQuery", subQuery); ReplyCB cb = new ReplyCB(); - cb.xsetupForDeriveReferrer(); + cb.xsetupForDerivedReferrer(); subQuery.query(cb); - String subQueryPropertyName = keepId_DeriveSubQuery_ReplyList(cb - .query());// for saving query-value. - registerDeriveSubQuery(function, cb.query(), "ID", "MESSAGE_ID", - subQueryPropertyName, aliasName); + String subQueryPropertyName = keepId_DerivedReferrer_ReplyList(cb + .query()); // for saving query-value. + registerDerivedReferrerSubQuery(function, cb.query(), "ID", + "MESSAGE_ID", subQueryPropertyName, aliasName); } - abstract public String keepId_DeriveSubQuery_ReplyList(ReplyCQ subQuery); + public abstract String keepId_DerivedReferrer_ReplyList(ReplyCQ subQuery); /** - * IsNull(is null). And OnceRegistered. + * IsNull(is null). And OnlyOnceRegistered. */ public void setId_IsNull() { regId(CK_ISN, DUMMY_OBJECT); } /** - * IsNotNull(is not null). And OnceRegistered. + * IsNotNull(is not null). And OnlyOnceRegistered. */ public void setId_IsNotNull() { regId(CK_ISNN, DUMMY_OBJECT); @@ -487,7 +393,7 @@ abstract protected ConditionValue getCValueId(); /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {NotNull : + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {NotNull : * VARCHAR(100)} * * @param displayName The value of displayName as equal. @@ -497,7 +403,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param displayName The value of displayName as notEqual. */ @@ -506,7 +412,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param displayName The value of displayName as greaterThan. */ @@ -515,7 +421,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param displayName The value of displayName as lessThan. */ @@ -524,7 +430,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param displayName The value of displayName as greaterEqual. */ @@ -533,7 +439,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param displayName The value of displayName as lessEqual. */ @@ -542,7 +448,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param displayName The value of displayName as prefixSearch. */ @@ -551,21 +457,6 @@ } /** - * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, - * SeveralRegistered. - * - * @param displayName The value of displayName as likeSearch. - * @param likeSearchOption The option of like-search. (NotNull) - */ - public void setDisplayName_LikeSearch( - String displayName, - jp.sf.pal.board.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { - registerLikeSearchQuery(CK_LS, fRES(displayName), - getCValueDisplayName(), "DISPLAY_NAME", "DisplayName", - "displayName", likeSearchOption); - } - - /** * InScope(in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * @@ -576,27 +467,41 @@ } /** - * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * - * @param displayName The collection of displayName as inScope. - * @param inScopeOption The option of in-scope. (NotNull) + * @param displayNameList The collection of displayName as notInScope. */ - public void setDisplayName_InScope( + public void setDisplayName_NotInScope(Collection displayNameList) { + regDisplayName(CK_NINS, cTL(displayNameList)); + } + + /** + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param displayName The value of displayName as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) + */ + public void setDisplayName_LikeSearch( String displayName, - jp.sf.pal.board.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(displayName), getCValueDisplayName(), - "DISPLAY_NAME", "DisplayName", "displayName", inScopeOption); + jp.sf.pal.board.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(displayName), getCValueDisplayName(), + "DISPLAY_NAME", "DisplayName", "displayName", likeSearchOption); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param displayNameList The collection of displayName as notInScope. + * @param displayName The value of displayName as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setDisplayName_NotInScope(Collection displayNameList) { - regDisplayName(CK_NINS, cTL(displayNameList)); + public void setDisplayName_NotLikeSearch( + String displayName, + jp.sf.pal.board.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(displayName), getCValueDisplayName(), + "DISPLAY_NAME", "DisplayName", "displayName", likeSearchOption); } protected void regDisplayName(ConditionKey key, Object value) { @@ -612,7 +517,7 @@ abstract protected ConditionValue getCValueDisplayName(); /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {NotNull : + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {NotNull : * VARCHAR(200)} * * @param title The value of title as equal. @@ -622,7 +527,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param title The value of title as notEqual. */ @@ -631,7 +536,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param title The value of title as greaterThan. */ @@ -640,7 +545,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param title The value of title as lessThan. */ @@ -649,7 +554,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param title The value of title as greaterEqual. */ @@ -658,7 +563,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param title The value of title as lessEqual. */ @@ -667,7 +572,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param title The value of title as prefixSearch. */ @@ -676,20 +581,6 @@ } /** - * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, - * SeveralRegistered. - * - * @param title The value of title as likeSearch. - * @param likeSearchOption The option of like-search. (NotNull) - */ - public void setTitle_LikeSearch( - String title, - jp.sf.pal.board.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { - registerLikeSearchQuery(CK_LS, fRES(title), getCValueTitle(), "TITLE", - "Title", "title", likeSearchOption); - } - - /** * InScope(in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * @@ -700,27 +591,41 @@ } /** - * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * - * @param title The collection of title as inScope. - * @param inScopeOption The option of in-scope. (NotNull) + * @param titleList The collection of title as notInScope. */ - public void setTitle_InScope( + public void setTitle_NotInScope(Collection titleList) { + regTitle(CK_NINS, cTL(titleList)); + } + + /** + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param title The value of title as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) + */ + public void setTitle_LikeSearch( String title, - jp.sf.pal.board.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(title), getCValueTitle(), "TITLE", - "Title", "title", inScopeOption); + jp.sf.pal.board.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(title), getCValueTitle(), "TITLE", "Title", "title", + likeSearchOption); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param titleList The collection of title as notInScope. + * @param title The value of title as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setTitle_NotInScope(Collection titleList) { - regTitle(CK_NINS, cTL(titleList)); + public void setTitle_NotLikeSearch( + String title, + jp.sf.pal.board.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(title), getCValueTitle(), "TITLE", "Title", + "title", likeSearchOption); } protected void regTitle(ConditionKey key, Object value) { @@ -735,8 +640,8 @@ abstract protected ConditionValue getCValueTitle(); /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {NotNull : VARCHAR(1) : - * Default=[E]} + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {NotNull : + * VARCHAR(1) : Default=[E]} * * @param status The value of status as equal. */ @@ -745,7 +650,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param status The value of status as notEqual. */ @@ -754,7 +659,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param status The value of status as greaterThan. */ @@ -763,7 +668,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param status The value of status as lessThan. */ @@ -772,7 +677,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param status The value of status as greaterEqual. */ @@ -781,7 +686,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param status The value of status as lessEqual. */ @@ -790,7 +695,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param status The value of status as prefixSearch. */ @@ -799,20 +704,6 @@ } /** - * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, - * SeveralRegistered. - * - * @param status The value of status as likeSearch. - * @param likeSearchOption The option of like-search. (NotNull) - */ - public void setStatus_LikeSearch( - String status, - jp.sf.pal.board.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { - registerLikeSearchQuery(CK_LS, fRES(status), getCValueStatus(), - "STATUS", "Status", "status", likeSearchOption); - } - - /** * InScope(in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * @@ -823,27 +714,41 @@ } /** - * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * - * @param status The collection of status as inScope. - * @param inScopeOption The option of in-scope. (NotNull) + * @param statusList The collection of status as notInScope. */ - public void setStatus_InScope( + public void setStatus_NotInScope(Collection statusList) { + regStatus(CK_NINS, cTL(statusList)); + } + + /** + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param status The value of status as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) + */ + public void setStatus_LikeSearch( String status, - jp.sf.pal.board.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(status), getCValueStatus(), "STATUS", - "Status", "status", inScopeOption); + jp.sf.pal.board.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(status), getCValueStatus(), "STATUS", "Status", + "status", likeSearchOption); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param statusList The collection of status as notInScope. + * @param status The value of status as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setStatus_NotInScope(Collection statusList) { - regStatus(CK_NINS, cTL(statusList)); + public void setStatus_NotLikeSearch( + String status, + jp.sf.pal.board.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(status), getCValueStatus(), "STATUS", "Status", + "status", likeSearchOption); } protected void regStatus(ConditionKey key, Object value) { @@ -859,7 +764,7 @@ abstract protected ConditionValue getCValueStatus(); /** - * Equal(=). And NullIgnored, OnceRegistered. {TIMESTAMP} + * Equal(=). And NullIgnored, OnlyOnceRegistered. {TIMESTAMP} * * @param startTime The value of startTime as equal. */ @@ -868,7 +773,7 @@ } /** - * NotEqual(!=). And NullIgnored, OnceRegistered. + * NotEqual(!=). And NullIgnored, OnlyOnceRegistered. * * @param startTime The value of startTime as notEqual. */ @@ -877,7 +782,7 @@ } /** - * GreaterThan(>). And NullIgnored, OnceRegistered. + * GreaterThan(>). And NullIgnored, OnlyOnceRegistered. * * @param startTime The value of startTime as greaterThan. */ @@ -886,7 +791,7 @@ } /** - * LessThan(>). And NullIgnored, OnceRegistered. + * LessThan(>). And NullIgnored, OnlyOnceRegistered. * * @param startTime The value of startTime as lessThan. */ @@ -895,7 +800,7 @@ } /** - * GreaterEqual(>). And NullIgnored, OnceRegistered. + * GreaterEqual(>). And NullIgnored, OnlyOnceRegistered. * * @param startTime The value of startTime as greaterEqual. */ @@ -904,7 +809,7 @@ } /** - * LessEqual(>). And NullIgnored, OnceRegistered. + * LessEqual(>). And NullIgnored, OnlyOnceRegistered. * * @param startTime The value of startTime as lessEqual. */ @@ -914,7 +819,7 @@ /** * FromTo($fromDate <= COLUMN_NAME <= $toDate). And NullIgnored, - * OnceRegistered. {TIMESTAMP} + * OnlyOnceRegistered. {TIMESTAMP} * * @param fromDate The from-date of startTime. (Nullable) * @param toDate The to-date of startTime. (Nullable) @@ -931,7 +836,7 @@ /** * FromTo($fromDate <= COLUMN_NAME < $toDate + 1). And NullIgnored, - * OnceRegistered. {TIMESTAMP} + * OnlyOnceRegistered. {TIMESTAMP} * * @param fromDate The from-date of startTime. (Nullable) * @param toDate The to-date of startTime. (Nullable) @@ -945,14 +850,14 @@ } /** - * IsNull(is null). And OnceRegistered. + * IsNull(is null). And OnlyOnceRegistered. */ public void setStartTime_IsNull() { regStartTime(CK_ISN, DUMMY_OBJECT); } /** - * IsNotNull(is not null). And OnceRegistered. + * IsNotNull(is not null). And OnlyOnceRegistered. */ public void setStartTime_IsNotNull() { regStartTime(CK_ISNN, DUMMY_OBJECT); @@ -971,7 +876,7 @@ abstract protected ConditionValue getCValueStartTime(); /** - * Equal(=). And NullIgnored, OnceRegistered. {TIMESTAMP} + * Equal(=). And NullIgnored, OnlyOnceRegistered. {TIMESTAMP} * * @param endTime The value of endTime as equal. */ @@ -980,7 +885,7 @@ } /** - * NotEqual(!=). And NullIgnored, OnceRegistered. + * NotEqual(!=). And NullIgnored, OnlyOnceRegistered. * * @param endTime The value of endTime as notEqual. */ @@ -989,7 +894,7 @@ } /** - * GreaterThan(>). And NullIgnored, OnceRegistered. + * GreaterThan(>). And NullIgnored, OnlyOnceRegistered. * * @param endTime The value of endTime as greaterThan. */ @@ -998,7 +903,7 @@ } /** - * LessThan(>). And NullIgnored, OnceRegistered. + * LessThan(>). And NullIgnored, OnlyOnceRegistered. * * @param endTime The value of endTime as lessThan. */ @@ -1007,7 +912,7 @@ } /** - * GreaterEqual(>). And NullIgnored, OnceRegistered. + * GreaterEqual(>). And NullIgnored, OnlyOnceRegistered. * * @param endTime The value of endTime as greaterEqual. */ @@ -1016,7 +921,7 @@ } /** - * LessEqual(>). And NullIgnored, OnceRegistered. + * LessEqual(>). And NullIgnored, OnlyOnceRegistered. * * @param endTime The value of endTime as lessEqual. */ @@ -1026,7 +931,7 @@ /** * FromTo($fromDate <= COLUMN_NAME <= $toDate). And NullIgnored, - * OnceRegistered. {TIMESTAMP} + * OnlyOnceRegistered. {TIMESTAMP} * * @param fromDate The from-date of endTime. (Nullable) * @param toDate The to-date of endTime. (Nullable) @@ -1043,7 +948,7 @@ /** * FromTo($fromDate <= COLUMN_NAME < $toDate + 1). And NullIgnored, - * OnceRegistered. {TIMESTAMP} + * OnlyOnceRegistered. {TIMESTAMP} * * @param fromDate The from-date of endTime. (Nullable) * @param toDate The to-date of endTime. (Nullable) @@ -1057,14 +962,14 @@ } /** - * IsNull(is null). And OnceRegistered. + * IsNull(is null). And OnlyOnceRegistered. */ public void setEndTime_IsNull() { regEndTime(CK_ISN, DUMMY_OBJECT); } /** - * IsNotNull(is not null). And OnceRegistered. + * IsNotNull(is not null). And OnlyOnceRegistered. */ public void setEndTime_IsNotNull() { regEndTime(CK_ISNN, DUMMY_OBJECT); @@ -1083,8 +988,8 @@ abstract protected ConditionValue getCValueEndTime(); /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {NotNull : VARCHAR(1) : - * Default=[T]} + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {NotNull : + * VARCHAR(1) : Default=[T]} * * @param hasReply The value of hasReply as equal. */ @@ -1093,7 +998,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param hasReply The value of hasReply as notEqual. */ @@ -1102,7 +1007,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param hasReply The value of hasReply as greaterThan. */ @@ -1111,7 +1016,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param hasReply The value of hasReply as lessThan. */ @@ -1120,7 +1025,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param hasReply The value of hasReply as greaterEqual. */ @@ -1129,7 +1034,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param hasReply The value of hasReply as lessEqual. */ @@ -1138,7 +1043,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param hasReply The value of hasReply as prefixSearch. */ @@ -1147,20 +1052,6 @@ } /** - * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, - * SeveralRegistered. - * - * @param hasReply The value of hasReply as likeSearch. - * @param likeSearchOption The option of like-search. (NotNull) - */ - public void setHasReply_LikeSearch( - String hasReply, - jp.sf.pal.board.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { - registerLikeSearchQuery(CK_LS, fRES(hasReply), getCValueHasReply(), - "HAS_REPLY", "HasReply", "hasReply", likeSearchOption); - } - - /** * InScope(in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * @@ -1171,27 +1062,41 @@ } /** - * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * - * @param hasReply The collection of hasReply as inScope. - * @param inScopeOption The option of in-scope. (NotNull) + * @param hasReplyList The collection of hasReply as notInScope. */ - public void setHasReply_InScope( + public void setHasReply_NotInScope(Collection hasReplyList) { + regHasReply(CK_NINS, cTL(hasReplyList)); + } + + /** + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param hasReply The value of hasReply as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) + */ + public void setHasReply_LikeSearch( String hasReply, - jp.sf.pal.board.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(hasReply), getCValueHasReply(), - "HAS_REPLY", "HasReply", "hasReply", inScopeOption); + jp.sf.pal.board.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(hasReply), getCValueHasReply(), "HAS_REPLY", + "HasReply", "hasReply", likeSearchOption); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param hasReplyList The collection of hasReply as notInScope. + * @param hasReply The value of hasReply as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setHasReply_NotInScope(Collection hasReplyList) { - regHasReply(CK_NINS, cTL(hasReplyList)); + public void setHasReply_NotLikeSearch( + String hasReply, + jp.sf.pal.board.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(hasReply), getCValueHasReply(), "HAS_REPLY", + "HasReply", "hasReply", likeSearchOption); } protected void regHasReply(ConditionKey key, Object value) { @@ -1207,7 +1112,7 @@ abstract protected ConditionValue getCValueHasReply(); /** - * Equal(=). And NullIgnored, OnceRegistered. {NotNull : INTEGER : + * Equal(=). And NullIgnored, OnlyOnceRegistered. {NotNull : INTEGER : * Default=[0] : FK to CATEGORY} * * @param categoryId The value of categoryId as equal. @@ -1217,7 +1122,7 @@ } /** - * NotEqual(!=). And NullIgnored, OnceRegistered. + * NotEqual(!=). And NullIgnored, OnlyOnceRegistered. * * @param categoryId The value of categoryId as notEqual. */ @@ -1226,7 +1131,7 @@ } /** - * GreaterThan(>). And NullIgnored, OnceRegistered. + * GreaterThan(>). And NullIgnored, OnlyOnceRegistered. * * @param categoryId The value of categoryId as greaterThan. */ @@ -1235,7 +1140,7 @@ } /** - * LessThan(<). And NullIgnored, OnceRegistered. + * LessThan(<). And NullIgnored, OnlyOnceRegistered. * * @param categoryId The value of categoryId as lessThan. */ @@ -1244,7 +1149,7 @@ } /** - * GreaterEqual(>=). And NullIgnored, OnceRegistered. + * GreaterEqual(>=). And NullIgnored, OnlyOnceRegistered. * * @param categoryId The value of categoryId as greaterEqual. */ @@ -1253,7 +1158,7 @@ } /** - * LessEqual(<=). And NullIgnored, OnceRegistered. + * LessEqual(<=). And NullIgnored, OnlyOnceRegistered. * * @param categoryId The value of categoryId as lessEqual. */ @@ -1281,34 +1186,18 @@ regCategoryId(CK_NINS, cTL(categoryIdList)); } - /** - * @param categoryCBquery Query. - * @deprecated Please use inScopeCategory(subQuery) method. - */ - public void setCategoryId_InScopeSubQuery_Category( - CategoryCQ categoryCBquery) { - String subQueryPropertyName = keepCategoryId_InScopeSubQuery_Category(categoryCBquery);// for - // saving - // query - // - - // value - // . - registerInScopeSubQuery(categoryCBquery, "CATEGORY_ID", "ID", - subQueryPropertyName); - } - public void inScopeCategory(SubQuery subQuery) { assertObjectNotNull("subQuery", subQuery); CategoryCB cb = new CategoryCB(); cb.xsetupForInScopeSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepCategoryId_InScopeSubQuery_Category(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerInScopeSubQuery(cb.query(), "CATEGORY_ID", "ID", subQueryPropertyName); } - abstract public String keepCategoryId_InScopeSubQuery_Category( + public abstract String keepCategoryId_InScopeSubQuery_Category( CategoryCQ subQuery); protected void regCategoryId(ConditionKey key, Object value) { @@ -1324,7 +1213,7 @@ abstract protected ConditionValue getCValueCategoryId(); /** - * Equal(=). And NullIgnored, OnceRegistered. {NotNull : TIMESTAMP} + * Equal(=). And NullIgnored, OnlyOnceRegistered. {NotNull : TIMESTAMP} * * @param createdTime The value of createdTime as equal. */ @@ -1333,7 +1222,7 @@ } /** - * NotEqual(!=). And NullIgnored, OnceRegistered. + * NotEqual(!=). And NullIgnored, OnlyOnceRegistered. * * @param createdTime The value of createdTime as notEqual. */ @@ -1342,7 +1231,7 @@ } /** - * GreaterThan(>). And NullIgnored, OnceRegistered. + * GreaterThan(>). And NullIgnored, OnlyOnceRegistered. * * @param createdTime The value of createdTime as greaterThan. */ @@ -1351,7 +1240,7 @@ } /** - * LessThan(>). And NullIgnored, OnceRegistered. + * LessThan(>). And NullIgnored, OnlyOnceRegistered. * * @param createdTime The value of createdTime as lessThan. */ @@ -1360,7 +1249,7 @@ } /** - * GreaterEqual(>). And NullIgnored, OnceRegistered. + * GreaterEqual(>). And NullIgnored, OnlyOnceRegistered. * * @param createdTime The value of createdTime as greaterEqual. */ @@ -1369,7 +1258,7 @@ } /** - * LessEqual(>). And NullIgnored, OnceRegistered. + * LessEqual(>). And NullIgnored, OnlyOnceRegistered. * * @param createdTime The value of createdTime as lessEqual. */ @@ -1379,7 +1268,7 @@ /** * FromTo($fromDate <= COLUMN_NAME <= $toDate). And NullIgnored, - * OnceRegistered. {NotNull : TIMESTAMP} + * OnlyOnceRegistered. {NotNull : TIMESTAMP} * * @param fromDate The from-date of createdTime. (Nullable) * @param toDate The to-date of createdTime. (Nullable) @@ -1396,7 +1285,7 @@ /** * FromTo($fromDate <= COLUMN_NAME < $toDate + 1). And NullIgnored, - * OnceRegistered. {NotNull : TIMESTAMP} + * OnlyOnceRegistered. {NotNull : TIMESTAMP} * * @param fromDate The from-date of createdTime. (Nullable) * @param toDate The to-date of createdTime. (Nullable) @@ -1422,7 +1311,7 @@ abstract protected ConditionValue getCValueCreatedTime(); /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {NotNull : + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {NotNull : * VARCHAR(255)} * * @param createdBy The value of createdBy as equal. @@ -1432,7 +1321,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param createdBy The value of createdBy as notEqual. */ @@ -1441,7 +1330,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param createdBy The value of createdBy as greaterThan. */ @@ -1450,7 +1339,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param createdBy The value of createdBy as lessThan. */ @@ -1459,7 +1348,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param createdBy The value of createdBy as greaterEqual. */ @@ -1468,7 +1357,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param createdBy The value of createdBy as lessEqual. */ @@ -1477,7 +1366,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param createdBy The value of createdBy as prefixSearch. */ @@ -1486,20 +1375,6 @@ } /** - * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, - * SeveralRegistered. - * - * @param createdBy The value of createdBy as likeSearch. - * @param likeSearchOption The option of like-search. (NotNull) - */ - public void setCreatedBy_LikeSearch( - String createdBy, - jp.sf.pal.board.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { - registerLikeSearchQuery(CK_LS, fRES(createdBy), getCValueCreatedBy(), - "CREATED_BY", "CreatedBy", "createdBy", likeSearchOption); - } - - /** * InScope(in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * @@ -1510,27 +1385,41 @@ } /** - * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * - * @param createdBy The collection of createdBy as inScope. - * @param inScopeOption The option of in-scope. (NotNull) + * @param createdByList The collection of createdBy as notInScope. */ - public void setCreatedBy_InScope( + public void setCreatedBy_NotInScope(Collection createdByList) { + regCreatedBy(CK_NINS, cTL(createdByList)); + } + + /** + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param createdBy The value of createdBy as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) + */ + public void setCreatedBy_LikeSearch( String createdBy, - jp.sf.pal.board.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(createdBy), getCValueCreatedBy(), - "CREATED_BY", "CreatedBy", "createdBy", inScopeOption); + jp.sf.pal.board.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(createdBy), getCValueCreatedBy(), "CREATED_BY", + "CreatedBy", "createdBy", likeSearchOption); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param createdByList The collection of createdBy as notInScope. + * @param createdBy The value of createdBy as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setCreatedBy_NotInScope(Collection createdByList) { - regCreatedBy(CK_NINS, cTL(createdByList)); + public void setCreatedBy_NotLikeSearch( + String createdBy, + jp.sf.pal.board.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(createdBy), getCValueCreatedBy(), "CREATED_BY", + "CreatedBy", "createdBy", likeSearchOption); } protected void regCreatedBy(ConditionKey key, Object value) { @@ -1546,7 +1435,7 @@ abstract protected ConditionValue getCValueCreatedBy(); /** - * Equal(=). And NullIgnored, OnceRegistered. {NotNull : TIMESTAMP} + * Equal(=). And NullIgnored, OnlyOnceRegistered. {NotNull : TIMESTAMP} * * @param updatedTime The value of updatedTime as equal. */ @@ -1555,7 +1444,7 @@ } /** - * NotEqual(!=). And NullIgnored, OnceRegistered. + * NotEqual(!=). And NullIgnored, OnlyOnceRegistered. * * @param updatedTime The value of updatedTime as notEqual. */ @@ -1564,7 +1453,7 @@ } /** - * GreaterThan(>). And NullIgnored, OnceRegistered. + * GreaterThan(>). And NullIgnored, OnlyOnceRegistered. * * @param updatedTime The value of updatedTime as greaterThan. */ @@ -1573,7 +1462,7 @@ } /** - * LessThan(>). And NullIgnored, OnceRegistered. + * LessThan(>). And NullIgnored, OnlyOnceRegistered. * * @param updatedTime The value of updatedTime as lessThan. */ @@ -1582,7 +1471,7 @@ } /** - * GreaterEqual(>). And NullIgnored, OnceRegistered. + * GreaterEqual(>). And NullIgnored, OnlyOnceRegistered. * * @param updatedTime The value of updatedTime as greaterEqual. */ @@ -1591,7 +1480,7 @@ } /** - * LessEqual(>). And NullIgnored, OnceRegistered. + * LessEqual(>). And NullIgnored, OnlyOnceRegistered. * * @param updatedTime The value of updatedTime as lessEqual. */ @@ -1601,7 +1490,7 @@ /** * FromTo($fromDate <= COLUMN_NAME <= $toDate). And NullIgnored, - * OnceRegistered. {NotNull : TIMESTAMP} + * OnlyOnceRegistered. {NotNull : TIMESTAMP} * * @param fromDate The from-date of updatedTime. (Nullable) * @param toDate The to-date of updatedTime. (Nullable) @@ -1618,7 +1507,7 @@ /** * FromTo($fromDate <= COLUMN_NAME < $toDate + 1). And NullIgnored, - * OnceRegistered. {NotNull : TIMESTAMP} + * OnlyOnceRegistered. {NotNull : TIMESTAMP} * * @param fromDate The from-date of updatedTime. (Nullable) * @param toDate The to-date of updatedTime. (Nullable) @@ -1644,7 +1533,7 @@ abstract protected ConditionValue getCValueUpdatedTime(); /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {NotNull : + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {NotNull : * VARCHAR(255)} * * @param updatedBy The value of updatedBy as equal. @@ -1654,7 +1543,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param updatedBy The value of updatedBy as notEqual. */ @@ -1663,7 +1552,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param updatedBy The value of updatedBy as greaterThan. */ @@ -1672,7 +1561,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param updatedBy The value of updatedBy as lessThan. */ @@ -1681,7 +1570,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param updatedBy The value of updatedBy as greaterEqual. */ @@ -1690,7 +1579,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param updatedBy The value of updatedBy as lessEqual. */ @@ -1699,7 +1588,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param updatedBy The value of updatedBy as prefixSearch. */ @@ -1708,20 +1597,6 @@ } /** - * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, - * SeveralRegistered. - * - * @param updatedBy The value of updatedBy as likeSearch. - * @param likeSearchOption The option of like-search. (NotNull) - */ - public void setUpdatedBy_LikeSearch( - String updatedBy, - jp.sf.pal.board.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { - registerLikeSearchQuery(CK_LS, fRES(updatedBy), getCValueUpdatedBy(), - "UPDATED_BY", "UpdatedBy", "updatedBy", likeSearchOption); - } - - /** * InScope(in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * @@ -1732,27 +1607,41 @@ } /** - * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * - * @param updatedBy The collection of updatedBy as inScope. - * @param inScopeOption The option of in-scope. (NotNull) + * @param updatedByList The collection of updatedBy as notInScope. */ - public void setUpdatedBy_InScope( + public void setUpdatedBy_NotInScope(Collection updatedByList) { + regUpdatedBy(CK_NINS, cTL(updatedByList)); + } + + /** + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param updatedBy The value of updatedBy as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) + */ + public void setUpdatedBy_LikeSearch( String updatedBy, - jp.sf.pal.board.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(updatedBy), getCValueUpdatedBy(), - "UPDATED_BY", "UpdatedBy", "updatedBy", inScopeOption); + jp.sf.pal.board.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(updatedBy), getCValueUpdatedBy(), "UPDATED_BY", + "UpdatedBy", "updatedBy", likeSearchOption); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param updatedByList The collection of updatedBy as notInScope. + * @param updatedBy The value of updatedBy as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setUpdatedBy_NotInScope(Collection updatedByList) { - regUpdatedBy(CK_NINS, cTL(updatedByList)); + public void setUpdatedBy_NotLikeSearch( + String updatedBy, + jp.sf.pal.board.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(updatedBy), getCValueUpdatedBy(), "UPDATED_BY", + "UpdatedBy", "updatedBy", likeSearchOption); } protected void regUpdatedBy(ConditionKey key, Object value) { @@ -1768,7 +1657,7 @@ abstract protected ConditionValue getCValueUpdatedBy(); /** - * Equal(=). And NullIgnored, OnceRegistered. {TIMESTAMP} + * Equal(=). And NullIgnored, OnlyOnceRegistered. {TIMESTAMP} * * @param deletedTime The value of deletedTime as equal. */ @@ -1777,7 +1666,7 @@ } /** - * NotEqual(!=). And NullIgnored, OnceRegistered. + * NotEqual(!=). And NullIgnored, OnlyOnceRegistered. * * @param deletedTime The value of deletedTime as notEqual. */ @@ -1786,7 +1675,7 @@ } /** - * GreaterThan(>). And NullIgnored, OnceRegistered. + * GreaterThan(>). And NullIgnored, OnlyOnceRegistered. * * @param deletedTime The value of deletedTime as greaterThan. */ @@ -1795,7 +1684,7 @@ } /** - * LessThan(>). And NullIgnored, OnceRegistered. + * LessThan(>). And NullIgnored, OnlyOnceRegistered. * * @param deletedTime The value of deletedTime as lessThan. */ @@ -1804,7 +1693,7 @@ } /** - * GreaterEqual(>). And NullIgnored, OnceRegistered. + * GreaterEqual(>). And NullIgnored, OnlyOnceRegistered. * * @param deletedTime The value of deletedTime as greaterEqual. */ @@ -1813,7 +1702,7 @@ } /** - * LessEqual(>). And NullIgnored, OnceRegistered. + * LessEqual(>). And NullIgnored, OnlyOnceRegistered. * * @param deletedTime The value of deletedTime as lessEqual. */ @@ -1823,7 +1712,7 @@ /** * FromTo($fromDate <= COLUMN_NAME <= $toDate). And NullIgnored, - * OnceRegistered. {TIMESTAMP} + * OnlyOnceRegistered. {TIMESTAMP} * * @param fromDate The from-date of deletedTime. (Nullable) * @param toDate The to-date of deletedTime. (Nullable) @@ -1840,7 +1729,7 @@ /** * FromTo($fromDate <= COLUMN_NAME < $toDate + 1). And NullIgnored, - * OnceRegistered. {TIMESTAMP} + * OnlyOnceRegistered. {TIMESTAMP} * * @param fromDate The from-date of deletedTime. (Nullable) * @param toDate The to-date of deletedTime. (Nullable) @@ -1854,14 +1743,14 @@ } /** - * IsNull(is null). And OnceRegistered. + * IsNull(is null). And OnlyOnceRegistered. */ public void setDeletedTime_IsNull() { regDeletedTime(CK_ISN, DUMMY_OBJECT); } /** - * IsNotNull(is not null). And OnceRegistered. + * IsNotNull(is not null). And OnlyOnceRegistered. */ public void setDeletedTime_IsNotNull() { regDeletedTime(CK_ISNN, DUMMY_OBJECT); @@ -1880,7 +1769,7 @@ abstract protected ConditionValue getCValueDeletedTime(); /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {VARCHAR(255)} + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {VARCHAR(255)} * * @param deletedBy The value of deletedBy as equal. */ @@ -1889,7 +1778,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param deletedBy The value of deletedBy as notEqual. */ @@ -1898,7 +1787,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param deletedBy The value of deletedBy as greaterThan. */ @@ -1907,7 +1796,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param deletedBy The value of deletedBy as lessThan. */ @@ -1916,7 +1805,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param deletedBy The value of deletedBy as greaterEqual. */ @@ -1925,7 +1814,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param deletedBy The value of deletedBy as lessEqual. */ @@ -1934,7 +1823,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param deletedBy The value of deletedBy as prefixSearch. */ @@ -1943,20 +1832,6 @@ } /** - * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, - * SeveralRegistered. - * - * @param deletedBy The value of deletedBy as likeSearch. - * @param likeSearchOption The option of like-search. (NotNull) - */ - public void setDeletedBy_LikeSearch( - String deletedBy, - jp.sf.pal.board.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { - registerLikeSearchQuery(CK_LS, fRES(deletedBy), getCValueDeletedBy(), - "DELETED_BY", "DeletedBy", "deletedBy", likeSearchOption); - } - - /** * InScope(in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * @@ -1967,38 +1842,52 @@ } /** - * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * - * @param deletedBy The collection of deletedBy as inScope. - * @param inScopeOption The option of in-scope. (NotNull) + * @param deletedByList The collection of deletedBy as notInScope. */ - public void setDeletedBy_InScope( + public void setDeletedBy_NotInScope(Collection deletedByList) { + regDeletedBy(CK_NINS, cTL(deletedByList)); + } + + /** + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param deletedBy The value of deletedBy as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) + */ + public void setDeletedBy_LikeSearch( String deletedBy, - jp.sf.pal.board.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(deletedBy), getCValueDeletedBy(), - "DELETED_BY", "DeletedBy", "deletedBy", inScopeOption); + jp.sf.pal.board.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(deletedBy), getCValueDeletedBy(), "DELETED_BY", + "DeletedBy", "deletedBy", likeSearchOption); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param deletedByList The collection of deletedBy as notInScope. + * @param deletedBy The value of deletedBy as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setDeletedBy_NotInScope(Collection deletedByList) { - regDeletedBy(CK_NINS, cTL(deletedByList)); + public void setDeletedBy_NotLikeSearch( + String deletedBy, + jp.sf.pal.board.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(deletedBy), getCValueDeletedBy(), "DELETED_BY", + "DeletedBy", "deletedBy", likeSearchOption); } /** - * IsNull(is null). And OnceRegistered. + * IsNull(is null). And OnlyOnceRegistered. */ public void setDeletedBy_IsNull() { regDeletedBy(CK_ISN, DUMMY_OBJECT); } /** - * IsNotNull(is not null). And OnceRegistered. + * IsNotNull(is not null). And OnlyOnceRegistered. */ public void setDeletedBy_IsNotNull() { regDeletedBy(CK_ISNN, DUMMY_OBJECT); @@ -2017,7 +1906,7 @@ abstract protected ConditionValue getCValueDeletedBy(); /** - * Equal(=). And NullIgnored, OnceRegistered. {NotNull : INTEGER : + * Equal(=). And NullIgnored, OnlyOnceRegistered. {NotNull : INTEGER : * Default=[0]} * * @param versionno The value of versionno as equal. @@ -2027,7 +1916,7 @@ } /** - * NotEqual(!=). And NullIgnored, OnceRegistered. + * NotEqual(!=). And NullIgnored, OnlyOnceRegistered. * * @param versionno The value of versionno as notEqual. */ @@ -2036,7 +1925,7 @@ } /** - * GreaterThan(>). And NullIgnored, OnceRegistered. + * GreaterThan(>). And NullIgnored, OnlyOnceRegistered. * * @param versionno The value of versionno as greaterThan. */ @@ -2045,7 +1934,7 @@ } /** - * LessThan(<). And NullIgnored, OnceRegistered. + * LessThan(<). And NullIgnored, OnlyOnceRegistered. * * @param versionno The value of versionno as lessThan. */ @@ -2054,7 +1943,7 @@ } /** - * GreaterEqual(>=). And NullIgnored, OnceRegistered. + * GreaterEqual(>=). And NullIgnored, OnlyOnceRegistered. * * @param versionno The value of versionno as greaterEqual. */ @@ -2063,7 +1952,7 @@ } /** - * LessEqual(<=). And NullIgnored, OnceRegistered. + * LessEqual(<=). And NullIgnored, OnlyOnceRegistered. * * @param versionno The value of versionno as lessEqual. */ @@ -2103,6 +1992,50 @@ abstract protected ConditionValue getCValueVersionno(); + public SSQFunction scalar_Equal() { + return xcreateSSQFunction("="); + } + + public SSQFunction scalar_GreaterEqual() { + return xcreateSSQFunction(">="); + } + + public SSQFunction scalar_GreaterThan() { + return xcreateSSQFunction(">"); + } + + public SSQFunction scalar_LessEqual() { + return xcreateSSQFunction("<="); + } + + public SSQFunction scalar_LessThan() { + return xcreateSSQFunction("<"); + } + + protected SSQFunction xcreateSSQFunction(final String operand) { + return new SSQFunction(new SSQSetupper() { + public void setup(String function, SubQuery subQuery) { + xscalarSubQuery(function, subQuery, operand); + } + }); + } + + protected void xscalarSubQuery(String function, + SubQuery subQuery, String operand) { + assertObjectNotNull("subQuery", subQuery); + MessageCB cb = new MessageCB(); + cb.xsetupForScalarSubQuery(); + subQuery.query(cb); + String subQueryPropertyName = keepScalarSubQuery(cb.query()); // for + // saving + // query + // -value. + registerScalarSubQuery(function, cb.query(), subQueryPropertyName, + operand); + } + + public abstract String keepScalarSubQuery(MessageCQ subQuery); + // Very Internal (for Suppressing Warn about 'Not Use Import') protected String getConditionBeanClassNameInternally() { return MessageCB.class.getName(); Modified: board/trunk/src/main/java/jp/sf/pal/board/db/cbean/cq/bs/AbstractBsMessageContentCQ.java =================================================================== --- board/trunk/src/main/java/jp/sf/pal/board/db/cbean/cq/bs/AbstractBsMessageContentCQ.java 2008-12-27 22:06:42 UTC (rev 1624) +++ board/trunk/src/main/java/jp/sf/pal/board/db/cbean/cq/bs/AbstractBsMessageContentCQ.java 2008-12-27 22:09:08 UTC (rev 1625) @@ -18,7 +18,6 @@ * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public abstract class AbstractBsMessageContentCQ extends AbstractConditionQuery { //========================================================================== @@ -48,8 +47,8 @@ // ===== /** - * Equal(=). And NullIgnored, OnceRegistered. {PK : NotNull : BIGINT : FK to - * MESSAGE} + * Equal(=). And NullIgnored, OnlyOnceRegistered. {PK : NotNull : BIGINT : + * FK to MESSAGE} * * @param messageId The value of messageId as equal. */ @@ -58,7 +57,7 @@ } /** - * NotEqual(!=). And NullIgnored, OnceRegistered. + * NotEqual(!=). And NullIgnored, OnlyOnceRegistered. * * @param messageId The value of messageId as notEqual. */ @@ -67,7 +66,7 @@ } /** - * GreaterThan(>). And NullIgnored, OnceRegistered. + * GreaterThan(>). And NullIgnored, OnlyOnceRegistered. * * @param messageId The value of messageId as greaterThan. */ @@ -76,7 +75,7 @@ } /** - * LessThan(<). And NullIgnored, OnceRegistered. + * LessThan(<). And NullIgnored, OnlyOnceRegistered. * * @param messageId The value of messageId as lessThan. */ @@ -85,7 +84,7 @@ } /** - * GreaterEqual(>=). And NullIgnored, OnceRegistered. + * GreaterEqual(>=). And NullIgnored, OnlyOnceRegistered. * * @param messageId The value of messageId as greaterEqual. */ @@ -94,7 +93,7 @@ } /** - * LessEqual(<=). And NullIgnored, OnceRegistered. + * LessEqual(<=). And NullIgnored, OnlyOnceRegistered. * * @param messageId The value of messageId as lessEqual. */ @@ -122,44 +121,29 @@ regMessageId(CK_NINS, cTL(messageIdList)); } - /** - * @param messageCBquery Query. - * @deprecated Please use inScopeMessage(subQuery) method. - */ - public void setMessageId_InScopeSubQuery_Message(MessageCQ messageCBquery) { - String subQueryPropertyName = keepMessageId_InScopeSubQuery_Message(messageCBquery);// for - // saving - // query - // - - // value - // . - registerInScopeSubQuery(messageCBquery, "MESSAGE_ID", "ID", - subQueryPropertyName); - } - public void inScopeMessage(SubQuery subQuery) { assertObjectNotNull("subQuery", subQuery); MessageCB cb = new MessageCB(); cb.xsetupForInScopeSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepMessageId_InScopeSubQuery_Message(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerInScopeSubQuery(cb.query(), "MESSAGE_ID", "ID", subQueryPropertyName); } - abstract public String keepMessageId_InScopeSubQuery_Message( + public abstract String keepMessageId_InScopeSubQuery_Message( MessageCQ subQuery); /** - * IsNull(is null). And OnceRegistered. + * IsNull(is null). And OnlyOnceRegistered. */ public void setMessageId_IsNull() { regMessageId(CK_ISN, DUMMY_OBJECT); } /** - * IsNotNull(is not null). And OnceRegistered. + * IsNotNull(is not null). And OnlyOnceRegistered. */ public void setMessageId_IsNotNull() { regMessageId(CK_ISNN, DUMMY_OBJECT); @@ -178,7 +162,7 @@ abstract protected ConditionValue getCValueMessageId(); /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {VARCHAR(4000)} + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {VARCHAR(4000)} * * @param content The value of content as equal. */ @@ -187,7 +171,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param content The value of content as notEqual. */ @@ -196,7 +180,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param content The value of content as greaterThan. */ @@ -205,7 +189,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param content The value of content as lessThan. */ @@ -214,7 +198,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param content The value of content as greaterEqual. */ @@ -223,7 +207,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param content The value of content as lessEqual. */ @@ -232,7 +216,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param content The value of content as prefixSearch. */ @@ -241,20 +225,6 @@ } /** - * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, - * SeveralRegistered. - * - * @param content The value of content as likeSearch. - * @param likeSearchOption The option of like-search. (NotNull) - */ - public void setContent_LikeSearch( - String content, - jp.sf.pal.board.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { - registerLikeSearchQuery(CK_LS, fRES(content), getCValueContent(), - "CONTENT", "Content", "content", likeSearchOption); - } - - /** * InScope(in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * @@ -265,38 +235,52 @@ } /** - * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * - * @param content The collection of content as inScope. - * @param inScopeOption The option of in-scope. (NotNull) + * @param contentList The collection of content as notInScope. */ - public void setContent_InScope( + public void setContent_NotInScope(Collection contentList) { + regContent(CK_NINS, cTL(contentList)); + } + + /** + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param content The value of content as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) + */ + public void setContent_LikeSearch( String content, - jp.sf.pal.board.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(content), getCValueContent(), - "CONTENT", "Content", "content", inScopeOption); + jp.sf.pal.board.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(content), getCValueContent(), "CONTENT", "Content", + "content", likeSearchOption); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param contentList The collection of content as notInScope. + * @param content The value of content as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setContent_NotInScope(Collection contentList) { - regContent(CK_NINS, cTL(contentList)); + public void setContent_NotLikeSearch( + String content, + jp.sf.pal.board.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(content), getCValueContent(), "CONTENT", "Content", + "content", likeSearchOption); } /** - * IsNull(is null). And OnceRegistered. + * IsNull(is null). And OnlyOnceRegistered. */ public void setContent_IsNull() { regContent(CK_ISN, DUMMY_OBJECT); } /** - * IsNotNull(is not null). And OnceRegistered. + * IsNotNull(is not null). And OnlyOnceRegistered. */ public void setContent_IsNotNull() { regContent(CK_ISNN, DUMMY_OBJECT); @@ -314,6 +298,53 @@ abstract protected ConditionValue getCValueContent(); + public SSQFunction scalar_Equal() { + return xcreateSSQFunction("="); + } + + public SSQFunction scalar_GreaterEqual() { + return xcreateSSQFunction(">="); + } + + public SSQFunction scalar_GreaterThan() { + return xcreateSSQFunction(">"); + } + + public SSQFunction scalar_LessEqual() { + return xcreateSSQFunction("<="); + } + + public SSQFunction scalar_LessThan() { + return xcreateSSQFunction("<"); + } + + protected SSQFunction xcreateSSQFunction( + final String operand) { + return new SSQFunction( + new SSQSetupper() { + public void setup(String function, + SubQuery subQuery) { + xscalarSubQuery(function, subQuery, operand); + } + }); + } + + protected void xscalarSubQuery(String function, + SubQuery subQuery, String operand) { + assertObjectNotNull("subQuery", subQuery); + MessageContentCB cb = new MessageContentCB(); + cb.xsetupForScalarSubQuery(); + subQuery.query(cb); + String subQueryPropertyName = keepScalarSubQuery(cb.query()); // for + // saving + // query + // -value. + registerScalarSubQuery(function, cb.query(), subQueryPropertyName, + operand); + } + + public abstract String keepScalarSubQuery(MessageContentCQ subQuery); + // Very Internal (for Suppressing Warn about 'Not Use Import') protected String getConditionBeanClassNameInternally() { return MessageContentCB.class.getName(); Modified: board/trunk/src/main/java/jp/sf/pal/board/db/cbean/cq/bs/AbstractBsReplyCQ.java =================================================================== --- board/trunk/src/main/java/jp/sf/pal/board/db/cbean/cq/bs/AbstractBsReplyCQ.java 2008-12-27 22:06:42 UTC (rev 1624) +++ board/trunk/src/main/java/jp/sf/pal/board/db/cbean/cq/bs/AbstractBsReplyCQ.java 2008-12-27 22:09:08 UTC (rev 1625) @@ -18,7 +18,6 @@ * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public abstract class AbstractBsReplyCQ extends AbstractConditionQuery { //========================================================================== @@ -48,7 +47,8 @@ // ===== /** - * Equal(=). And NullIgnored, OnceRegistered. {PK : ID : NotNull : BIGINT} + * Equal(=). And NullIgnored, OnlyOnceRegistered. {PK : ID : NotNull : + * BIGINT} * * @param id The value of id as equal. */ @@ -57,7 +57,7 @@ } /** - * NotEqual(!=). And NullIgnored, OnceRegistered. + * NotEqual(!=). And NullIgnored, OnlyOnceRegistered. * * @param id The value of id as notEqual. */ @@ -66,7 +66,7 @@ } /** - * GreaterThan(>). And NullIgnored, OnceRegistered. + * GreaterThan(>). And NullIgnored, OnlyOnceRegistered. * * @param id The value of id as greaterThan. */ @@ -75,7 +75,7 @@ } /** - * LessThan(<). And NullIgnored, OnceRegistered. + * LessThan(<). And NullIgnored, OnlyOnceRegistered. * * @param id The value of id as lessThan. */ @@ -84,7 +84,7 @@ } /** - * GreaterEqual(>=). And NullIgnored, OnceRegistered. + * GreaterEqual(>=). And NullIgnored, OnlyOnceRegistered. * * @param id The value of id as greaterEqual. */ @@ -93,7 +93,7 @@ } /** - * LessEqual(<=). And NullIgnored, OnceRegistered. + * LessEqual(<=). And NullIgnored, OnlyOnceRegistered. * * @param id The value of id as lessEqual. */ @@ -122,14 +122,14 @@ } /** - * IsNull(is null). And OnceRegistered. + * IsNull(is null). And OnlyOnceRegistered. */ public void setId_IsNull() { regId(CK_ISN, DUMMY_OBJECT); } /** - * IsNotNull(is not null). And OnceRegistered. + * IsNotNull(is not null). And OnlyOnceRegistered. */ public void setId_IsNotNull() { regId(CK_ISNN, DUMMY_OBJECT); @@ -146,7 +146,7 @@ abstract protected ConditionValue getCValueId(); /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {NotNull : + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {NotNull : * VARCHAR(100)} * * @param displayName The value of displayName as equal. @@ -156,7 +156,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param displayName The value of displayName as notEqual. */ @@ -165,7 +165,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param displayName The value of displayName as greaterThan. */ @@ -174,7 +174,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param displayName The value of displayName as lessThan. */ @@ -183,7 +183,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param displayName The value of displayName as greaterEqual. */ @@ -192,7 +192,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param displayName The value of displayName as lessEqual. */ @@ -201,7 +201,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param displayName The value of displayName as prefixSearch. */ @@ -210,21 +210,6 @@ } /** - * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, - * SeveralRegistered. - * - * @param displayName The value of displayName as likeSearch. - * @param likeSearchOption The option of like-search. (NotNull) - */ - public void setDisplayName_LikeSearch( - String displayName, - jp.sf.pal.board.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { - registerLikeSearchQuery(CK_LS, fRES(displayName), - getCValueDisplayName(), "DISPLAY_NAME", "DisplayName", - "displayName", likeSearchOption); - } - - /** * InScope(in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * @@ -235,27 +220,41 @@ } /** - * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * - * @param displayName The collection of displayName as inScope. - * @param inScopeOption The option of in-scope. (NotNull) + * @param displayNameList The collection of displayName as notInScope. */ - public void setDisplayName_InScope( + public void setDisplayName_NotInScope(Collection displayNameList) { + regDisplayName(CK_NINS, cTL(displayNameList)); + } + + /** + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param displayName The value of displayName as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) + */ + public void setDisplayName_LikeSearch( String displayName, - jp.sf.pal.board.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(displayName), getCValueDisplayName(), - "DISPLAY_NAME", "DisplayName", "displayName", inScopeOption); + jp.sf.pal.board.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(displayName), getCValueDisplayName(), + "DISPLAY_NAME", "DisplayName", "displayName", likeSearchOption); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param displayNameList The collection of displayName as notInScope. + * @param displayName The value of displayName as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setDisplayName_NotInScope(Collection displayNameList) { - regDisplayName(CK_NINS, cTL(displayNameList)); + public void setDisplayName_NotLikeSearch( + String displayName, + jp.sf.pal.board.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(displayName), getCValueDisplayName(), + "DISPLAY_NAME", "DisplayName", "displayName", likeSearchOption); } protected void regDisplayName(ConditionKey key, Object value) { @@ -271,7 +270,7 @@ abstract protected ConditionValue getCValueDisplayName(); /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {VARCHAR(4000)} + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {VARCHAR(4000)} * * @param content The value of content as equal. */ @@ -280,7 +279,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param content The value of content as notEqual. */ @@ -289,7 +288,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param content The value of content as greaterThan. */ @@ -298,7 +297,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param content The value of content as lessThan. */ @@ -307,7 +306,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param content The value of content as greaterEqual. */ @@ -316,7 +315,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param content The value of content as lessEqual. */ @@ -325,7 +324,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param content The value of content as prefixSearch. */ @@ -334,20 +333,6 @@ } /** - * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, - * SeveralRegistered. - * - * @param content The value of content as likeSearch. - * @param likeSearchOption The option of like-search. (NotNull) - */ - public void setContent_LikeSearch( - String content, - jp.sf.pal.board.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { - registerLikeSearchQuery(CK_LS, fRES(content), getCValueContent(), - "CONTENT", "Content", "content", likeSearchOption); - } - - /** * InScope(in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * @@ -358,38 +343,52 @@ } /** - * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * - * @param content The collection of content as inScope. - * @param inScopeOption The option of in-scope. (NotNull) + * @param contentList The collection of content as notInScope. */ - public void setContent_InScope( + public void setContent_NotInScope(Collection contentList) { + regContent(CK_NINS, cTL(contentList)); + } + + /** + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param content The value of content as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) + */ + public void setContent_LikeSearch( String content, - jp.sf.pal.board.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(content), getCValueContent(), - "CONTENT", "Content", "content", inScopeOption); + jp.sf.pal.board.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(content), getCValueContent(), "CONTENT", "Content", + "content", likeSearchOption); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param contentList The collection of content as notInScope. + * @param content The value of content as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setContent_NotInScope(Collection contentList) { - regContent(CK_NINS, cTL(contentList)); + public void setContent_NotLikeSearch( + String content, + jp.sf.pal.board.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(content), getCValueContent(), "CONTENT", "Content", + "content", likeSearchOption); } /** - * IsNull(is null). And OnceRegistered. + * IsNull(is null). And OnlyOnceRegistered. */ public void setContent_IsNull() { regContent(CK_ISN, DUMMY_OBJECT); } /** - * IsNotNull(is not null). And OnceRegistered. + * IsNotNull(is not null). And OnlyOnceRegistered. */ public void setContent_IsNotNull() { regContent(CK_ISNN, DUMMY_OBJECT); @@ -408,7 +407,7 @@ abstract protected ConditionValue getCValueContent(); /** - * Equal(=). And NullIgnored, OnceRegistered. {NotNull : BIGINT : FK to + * Equal(=). And NullIgnored, OnlyOnceRegistered. {NotNull : BIGINT : FK to * MESSAGE} * * @param messageId The value of messageId as equal. @@ -418,7 +417,7 @@ } /** - * NotEqual(!=). And NullIgnored, OnceRegistered. + * NotEqual(!=). And NullIgnored, OnlyOnceRegistered. * * @param messageId The value of messageId as notEqual. */ @@ -427,7 +426,7 @@ } /** - * GreaterThan(>). And NullIgnored, OnceRegistered. + * GreaterThan(>). And NullIgnored, OnlyOnceRegistered. * * @param messageId The value of messageId as greaterThan. */ @@ -436,7 +435,7 @@ } /** - * LessThan(<). And NullIgnored, OnceRegistered. + * LessThan(<). And NullIgnored, OnlyOnceRegistered. * * @param messageId The value of messageId as lessThan. */ @@ -445,7 +444,7 @@ } /** - * GreaterEqual(>=). And NullIgnored, OnceRegistered. + * GreaterEqual(>=). And NullIgnored, OnlyOnceRegistered. * * @param messageId The value of messageId as greaterEqual. */ @@ -454,7 +453,7 @@ } /** - * LessEqual(<=). And NullIgnored, OnceRegistered. + * LessEqual(<=). And NullIgnored, OnlyOnceRegistered. * * @param messageId The value of messageId as lessEqual. */ @@ -482,33 +481,18 @@ regMessageId(CK_NINS, cTL(messageIdList)); } - /** - * @param messageCBquery Query. - * @deprecated Please use inScopeMessage(subQuery) method. - */ - public void setMessageId_InScopeSubQuery_Message(MessageCQ messageCBquery) { - String subQueryPropertyName = keepMessageId_InScopeSubQuery_Message(messageCBquery);// for - // saving - // query - // - - // value - // . - registerInScopeSubQuery(messageCBquery, "MESSAGE_ID", "ID", - subQueryPropertyName); - } - public void inScopeMessage(SubQuery subQuery) { assertObjectNotNull("subQuery", subQuery); MessageCB cb = new MessageCB(); cb.xsetupForInScopeSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepMessageId_InScopeSubQuery_Message(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerInScopeSubQuery(cb.query(), "MESSAGE_ID", "ID", subQueryPropertyName); } - abstract public String keepMessageId_InScopeSubQuery_Message( + public abstract String keepMessageId_InScopeSubQuery_Message( MessageCQ subQuery); protected void regMessageId(ConditionKey key, Object value) { @@ -524,7 +508,7 @@ abstract protected ConditionValue getCValueMessageId(); /** - * Equal(=). And NullIgnored, OnceRegistered. {NotNull : TIMESTAMP} + * Equal(=). And NullIgnored, OnlyOnceRegistered. {NotNull : TIMESTAMP} * * @param createdTime The value of createdTime as equal. */ @@ -533,7 +517,7 @@ } /** - * NotEqual(!=). And NullIgnored, OnceRegistered. + * NotEqual(!=). And NullIgnored, OnlyOnceRegistered. * * @param createdTime The value of createdTime as notEqual. */ @@ -542,7 +526,7 @@ } /** - * GreaterThan(>). And NullIgnored, OnceRegistered. + * GreaterThan(>). And NullIgnored, OnlyOnceRegistered. * * @param createdTime The value of createdTime as greaterThan. */ @@ -551,7 +535,7 @@ } /** - * LessThan(>). And NullIgnored, OnceRegistered. + * LessThan(>). And NullIgnored, OnlyOnceRegistered. * * @param createdTime The value of createdTime as lessThan. */ @@ -560,7 +544,7 @@ } /** - * GreaterEqual(>). And NullIgnored, OnceRegistered. + * GreaterEqual(>). And NullIgnored, OnlyOnceRegistered. * * @param createdTime The value of createdTime as greaterEqual. */ @@ -569,7 +553,7 @@ } /** - * LessEqual(>). And NullIgnored, OnceRegistered. + * LessEqual(>). And NullIgnored, OnlyOnceRegistered. * * @param createdTime The value of createdTime as lessEqual. */ @@ -579,7 +563,7 @@ /** * FromTo($fromDate <= COLUMN_NAME <= $toDate). And NullIgnored, - * OnceRegistered. {NotNull : TIMESTAMP} + * OnlyOnceRegistered. {NotNull : TIMESTAMP} * * @param fromDate The from-date of createdTime. (Nullable) * @param toDate The to-date of createdTime. (Nullable) @@ -596,7 +580,7 @@ /** * FromTo($fromDate <= COLUMN_NAME < $toDate + 1). And NullIgnored, - * OnceRegistered. {NotNull : TIMESTAMP} + * OnlyOnceRegistered. {NotNull : TIMESTAMP} * * @param fromDate The from-date of createdTime. (Nullable) * @param toDate The to-date of createdTime. (Nullable) @@ -622,7 +606,7 @@ abstract protected ConditionValue getCValueCreatedTime(); /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {NotNull : + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {NotNull : * VARCHAR(255)} * * @param createdBy The value of createdBy as equal. @@ -632,7 +616,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param createdBy The value of createdBy as notEqual. */ @@ -641,7 +625,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param createdBy The value of createdBy as greaterThan. */ @@ -650,7 +634,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param createdBy The value of createdBy as lessThan. */ @@ -659,7 +643,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param createdBy The value of createdBy as greaterEqual. */ @@ -668,7 +652,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param createdBy The value of createdBy as lessEqual. */ @@ -677,7 +661,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param createdBy The value of createdBy as prefixSearch. */ @@ -686,20 +670,6 @@ } /** - * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, - * SeveralRegistered. - * - * @param createdBy The value of createdBy as likeSearch. - * @param likeSearchOption The option of like-search. (NotNull) - */ - public void setCreatedBy_LikeSearch( - String createdBy, - jp.sf.pal.board.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { - registerLikeSearchQuery(CK_LS, fRES(createdBy), getCValueCreatedBy(), - "CREATED_BY", "CreatedBy", "createdBy", likeSearchOption); - } - - /** * InScope(in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * @@ -710,27 +680,41 @@ } /** - * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * - * @param createdBy The collection of createdBy as inScope. - * @param inScopeOption The option of in-scope. (NotNull) + * @param createdByList The collection of createdBy as notInScope. */ - public void setCreatedBy_InScope( + public void setCreatedBy_NotInScope(Collection createdByList) { + regCreatedBy(CK_NINS, cTL(createdByList)); + } + + /** + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param createdBy The value of createdBy as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) + */ + public void setCreatedBy_LikeSearch( String createdBy, - jp.sf.pal.board.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(createdBy), getCValueCreatedBy(), - "CREATED_BY", "CreatedBy", "createdBy", inScopeOption); + jp.sf.pal.board.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(createdBy), getCValueCreatedBy(), "CREATED_BY", + "CreatedBy", "createdBy", likeSearchOption); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param createdByList The collection of createdBy as notInScope. + * @param createdBy The value of createdBy as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setCreatedBy_NotInScope(Collection createdByList) { - regCreatedBy(CK_NINS, cTL(createdByList)); + public void setCreatedBy_NotLikeSearch( + String createdBy, + jp.sf.pal.board.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(createdBy), getCValueCreatedBy(), "CREATED_BY", + "CreatedBy", "createdBy", likeSearchOption); } protected void regCreatedBy(ConditionKey key, Object value) { @@ -746,7 +730,7 @@ abstract protected ConditionValue getCValueCreatedBy(); /** - * Equal(=). And NullIgnored, OnceRegistered. {TIMESTAMP} + * Equal(=). And NullIgnored, OnlyOnceRegistered. {TIMESTAMP} * * @param deletedTime The value of deletedTime as equal. */ @@ -755,7 +739,7 @@ } /** - * NotEqual(!=). And NullIgnored, OnceRegistered. + * NotEqual(!=). And NullIgnored, OnlyOnceRegistered. * * @param deletedTime The value of deletedTime as notEqual. */ @@ -764,7 +748,7 @@ } /** - * GreaterThan(>). And NullIgnored, OnceRegistered. + * GreaterThan(>). And NullIgnored, OnlyOnceRegistered. * * @param deletedTime The value of deletedTime as greaterThan. */ @@ -773,7 +757,7 @@ } /** - * LessThan(>). And NullIgnored, OnceRegistered. + * LessThan(>). And NullIgnored, OnlyOnceRegistered. * * @param deletedTime The value of deletedTime as lessThan. */ @@ -782,7 +766,7 @@ } /** - * GreaterEqual(>). And NullIgnored, OnceRegistered. + * GreaterEqual(>). And NullIgnored, OnlyOnceRegistered. * * @param deletedTime The value of deletedTime as greaterEqual. */ @@ -791,7 +775,7 @@ } /** - * LessEqual(>). And NullIgnored, OnceRegistered. + * LessEqual(>). And NullIgnored, OnlyOnceRegistered. * * @param deletedTime The value of deletedTime as lessEqual. */ @@ -801,7 +785,7 @@ /** * FromTo($fromDate <= COLUMN_NAME <= $toDate). And NullIgnored, - * OnceRegistered. {TIMESTAMP} + * OnlyOnceRegistered. {TIMESTAMP} * * @param fromDate The from-date of deletedTime. (Nullable) * @param toDate The to-date of deletedTime. (Nullable) @@ -818,7 +802,7 @@ /** * FromTo($fromDate <= COLUMN_NAME < $toDate + 1). And NullIgnored, - * OnceRegistered. {TIMESTAMP} + * OnlyOnceRegistered. {TIMESTAMP} * * @param fromDate The from-date of deletedTime. (Nullable) * @param toDate The to-date of deletedTime. (Nullable) @@ -832,14 +816,14 @@ } /** - * IsNull(is null). And OnceRegistered. + * IsNull(is null). And OnlyOnceRegistered. */ public void setDeletedTime_IsNull() { regDeletedTime(CK_ISN, DUMMY_OBJECT); } /** - * IsNotNull(is not null). And OnceRegistered. + * IsNotNull(is not null). And OnlyOnceRegistered. */ public void setDeletedTime_IsNotNull() { regDeletedTime(CK_ISNN, DUMMY_OBJECT); @@ -858,7 +842,7 @@ abstract protected ConditionValue getCValueDeletedTime(); /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {VARCHAR(255)} + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {VARCHAR(255)} * * @param deletedBy The value of deletedBy as equal. */ @@ -867,7 +851,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param deletedBy The value of deletedBy as notEqual. */ @@ -876,7 +860,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param deletedBy The value of deletedBy as greaterThan. */ @@ -885,7 +869,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param deletedBy The value of deletedBy as lessThan. */ @@ -894,7 +878,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param deletedBy The value of deletedBy as greaterEqual. */ @@ -903,7 +887,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param deletedBy The value of deletedBy as lessEqual. */ @@ -912,7 +896,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param deletedBy The value of deletedBy as prefixSearch. */ @@ -921,20 +905,6 @@ } /** - * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, - * SeveralRegistered. - * - * @param deletedBy The value of deletedBy as likeSearch. - * @param likeSearchOption The option of like-search. (NotNull) - */ - public void setDeletedBy_LikeSearch( - String deletedBy, - jp.sf.pal.board.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { - registerLikeSearchQuery(CK_LS, fRES(deletedBy), getCValueDeletedBy(), - "DELETED_BY", "DeletedBy", "deletedBy", likeSearchOption); - } - - /** * InScope(in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * @@ -945,38 +915,52 @@ } /** - * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * - * @param deletedBy The collection of deletedBy as inScope. - * @param inScopeOption The option of in-scope. (NotNull) + * @param deletedByList The collection of deletedBy as notInScope. */ - public void setDeletedBy_InScope( + public void setDeletedBy_NotInScope(Collection deletedByList) { + regDeletedBy(CK_NINS, cTL(deletedByList)); + } + + /** + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param deletedBy The value of deletedBy as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) + */ + public void setDeletedBy_LikeSearch( String deletedBy, - jp.sf.pal.board.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(deletedBy), getCValueDeletedBy(), - "DELETED_BY", "DeletedBy", "deletedBy", inScopeOption); + jp.sf.pal.board.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(deletedBy), getCValueDeletedBy(), "DELETED_BY", + "DeletedBy", "deletedBy", likeSearchOption); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param deletedByList The collection of deletedBy as notInScope. + * @param deletedBy The value of deletedBy as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setDeletedBy_NotInScope(Collection deletedByList) { - regDeletedBy(CK_NINS, cTL(deletedByList)); + public void setDeletedBy_NotLikeSearch( + String deletedBy, + jp.sf.pal.board.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(deletedBy), getCValueDeletedBy(), "DELETED_BY", + "DeletedBy", "deletedBy", likeSearchOption); } /** - * IsNull(is null). And OnceRegistered. + * IsNull(is null). And OnlyOnceRegistered. */ public void setDeletedBy_IsNull() { regDeletedBy(CK_ISN, DUMMY_OBJECT); } /** - * IsNotNull(is not null). And OnceRegistered. + * IsNotNull(is not null). And OnlyOnceRegistered. */ public void setDeletedBy_IsNotNull() { regDeletedBy(CK_ISNN, DUMMY_OBJECT); @@ -994,6 +978,50 @@ abstract protected ConditionValue getCValueDeletedBy(); + public SSQFunction scalar_Equal() { + return xcreateSSQFunction("="); + } + + public SSQFunction scalar_GreaterEqual() { + return xcreateSSQFunction(">="); + } + + public SSQFunction scalar_GreaterThan() { + return xcreateSSQFunction(">"); + } + + public SSQFunction scalar_LessEqual() { + return xcreateSSQFunction("<="); + } + + public SSQFunction scalar_LessThan() { + return xcreateSSQFunction("<"); + } + + protected SSQFunction xcreateSSQFunction(final String operand) { + return new SSQFunction(new SSQSetupper() { + public void setup(String function, SubQuery subQuery) { + xscalarSubQuery(function, subQuery, operand); + } + }); + } + + protected void xscalarSubQuery(String function, SubQuery subQuery, + String operand) { + assertObjectNotNull("subQuery", subQuery); + ReplyCB cb = new ReplyCB(); + cb.xsetupForScalarSubQuery(); + subQuery.query(cb); + String subQueryPropertyName = keepScalarSubQuery(cb.query()); // for + // saving + // query + // -value. + registerScalarSubQuery(function, cb.query(), subQueryPropertyName, + operand); + } + + public abstract String keepScalarSubQuery(ReplyCQ subQuery); + // Very Internal (for Suppressing Warn about 'Not Use Import') protected String getConditionBeanClassNameInternally() { return ReplyCB.class.getName(); Modified: board/trunk/src/main/java/jp/sf/pal/board/db/cbean/cq/bs/AbstractBsRoleInfoCQ.java =================================================================== --- board/trunk/src/main/java/jp/sf/pal/board/db/cbean/cq/bs/AbstractBsRoleInfoCQ.java 2008-12-27 22:06:42 UTC (rev 1624) +++ board/trunk/src/main/java/jp/sf/pal/board/db/cbean/cq/bs/AbstractBsRoleInfoCQ.java 2008-12-27 22:09:08 UTC (rev 1625) @@ -20,7 +20,6 @@ * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public abstract class AbstractBsRoleInfoCQ extends AbstractConditionQuery { //========================================================================== @@ -50,7 +49,7 @@ // ===== /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {PK : NotNull : + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {PK : NotNull : * VARCHAR(255)} * * @param roleId The value of roleId as equal. @@ -60,7 +59,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param roleId The value of roleId as notEqual. */ @@ -69,7 +68,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param roleId The value of roleId as greaterThan. */ @@ -78,7 +77,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param roleId The value of roleId as lessThan. */ @@ -87,7 +86,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param roleId The value of roleId as greaterEqual. */ @@ -96,7 +95,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param roleId The value of roleId as lessEqual. */ @@ -105,7 +104,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param roleId The value of roleId as prefixSearch. */ @@ -114,20 +113,6 @@ } /** - * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, - * SeveralRegistered. - * - * @param roleId The value of roleId as likeSearch. - * @param likeSearchOption The option of like-search. (NotNull) - */ - public void setRoleId_LikeSearch( - String roleId, - jp.sf.pal.board.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { - registerLikeSearchQuery(CK_LS, fRES(roleId), getCValueRoleId(), - "ROLE_ID", "RoleId", "roleId", likeSearchOption); - } - - /** * InScope(in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * @@ -138,43 +123,41 @@ } /** - * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * - * @param roleId The collection of roleId as inScope. - * @param inScopeOption The option of in-scope. (NotNull) + * @param roleIdList The collection of roleId as notInScope. */ - public void setRoleId_InScope( - String roleId, - jp.sf.pal.board.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(roleId), getCValueRoleId(), - "ROLE_ID", "RoleId", "roleId", inScopeOption); + public void setRoleId_NotInScope(Collection roleIdList) { + regRoleId(CK_NINS, cTL(roleIdList)); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param roleIdList The collection of roleId as notInScope. + * @param roleId The value of roleId as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) */ - public void setRoleId_NotInScope(Collection roleIdList) { - regRoleId(CK_NINS, cTL(roleIdList)); + public void setRoleId_LikeSearch( + String roleId, + jp.sf.pal.board.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(roleId), getCValueRoleId(), "ROLE_ID", "RoleId", + "roleId", likeSearchOption); } /** - * @param roleMappingCBquery Query. - * @deprecated Please use inScopeRoleMappingList(subQuery) method. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param roleId The value of roleId as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setRoleId_InScopeSubQuery_RoleMappingList( - RoleMappingCQ roleMappingCBquery) { - String subQueryPropertyName = keepRoleId_InScopeSubQuery_RoleMappingList(roleMappingCBquery);// for - // saving - // query - // - - // value - // . - registerInScopeSubQuery(roleMappingCBquery, "ROLE_ID", "ROLE_ID", - subQueryPropertyName); + public void setRoleId_NotLikeSearch( + String roleId, + jp.sf.pal.board.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(roleId), getCValueRoleId(), "ROLE_ID", "RoleId", + "roleId", likeSearchOption); } public void inScopeRoleMappingList(SubQuery subQuery) { @@ -183,42 +166,26 @@ cb.xsetupForInScopeSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepRoleId_InScopeSubQuery_RoleMappingList(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerInScopeSubQuery(cb.query(), "ROLE_ID", "ROLE_ID", subQueryPropertyName); } - abstract public String keepRoleId_InScopeSubQuery_RoleMappingList( + public abstract String keepRoleId_InScopeSubQuery_RoleMappingList( RoleMappingCQ subQuery); - /** - * @param userInfoCBquery Query. - * @deprecated Please use inScopeUserInfoList(subQuery) method. - */ - public void setRoleId_InScopeSubQuery_UserInfoList( - UserInfoCQ userInfoCBquery) { - String subQueryPropertyName = keepRoleId_InScopeSubQuery_UserInfoList(userInfoCBquery);// for - // saving - // query - // - - // value - // . - registerInScopeSubQuery(userInfoCBquery, "ROLE_ID", "ROLE_ID", - subQueryPropertyName); - } - public void inScopeUserInfoList(SubQuery subQuery) { assertObjectNotNull("subQuery", subQuery); UserInfoCB cb = new UserInfoCB(); cb.xsetupForInScopeSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepRoleId_InScopeSubQuery_UserInfoList(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerInScopeSubQuery(cb.query(), "ROLE_ID", "ROLE_ID", subQueryPropertyName); } - abstract public String keepRoleId_InScopeSubQuery_UserInfoList( + public abstract String keepRoleId_InScopeSubQuery_UserInfoList( UserInfoCQ subQuery); public void notInScopeRoleMappingList(SubQuery subQuery) { @@ -227,12 +194,12 @@ cb.xsetupForInScopeSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepRoleId_NotInScopeSubQuery_RoleMappingList(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerNotInScopeSubQuery(cb.query(), "ROLE_ID", "ROLE_ID", subQueryPropertyName); } - abstract public String keepRoleId_NotInScopeSubQuery_RoleMappingList( + public abstract String keepRoleId_NotInScopeSubQuery_RoleMappingList( RoleMappingCQ subQuery); public void notInScopeUserInfoList(SubQuery subQuery) { @@ -241,31 +208,15 @@ cb.xsetupForInScopeSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepRoleId_NotInScopeSubQuery_UserInfoList(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerNotInScopeSubQuery(cb.query(), "ROLE_ID", "ROLE_ID", subQueryPropertyName); } - abstract public String keepRoleId_NotInScopeSubQuery_UserInfoList( + public abstract String keepRoleId_NotInScopeSubQuery_UserInfoList( UserInfoCQ subQuery); /** - * @param roleMappingCBquery Query. - * @deprecated Please use existsRoleMappingList(subQuery) method. - */ - public void setRoleId_ExistsSubQuery_RoleMappingList( - RoleMappingCQ roleMappingCBquery) { - String subQueryPropertyName = keepRoleId_ExistsSubQuery_RoleMappingList(roleMappingCBquery);// for - // saving - // query - // - - // value - // . - registerExistsSubQuery(roleMappingCBquery, "ROLE_ID", "ROLE_ID", - subQueryPropertyName); - } - - /** * Set up 'exists' sub-query. {exists (select ROLE_ID from ROLE_MAPPING * where ...)} * @@ -278,30 +229,15 @@ cb.xsetupForExistsSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepRoleId_ExistsSubQuery_RoleMappingList(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerExistsSubQuery(cb.query(), "ROLE_ID", "ROLE_ID", subQueryPropertyName); } - abstract public String keepRoleId_ExistsSubQuery_RoleMappingList( + public abstract String keepRoleId_ExistsSubQuery_RoleMappingList( RoleMappingCQ subQuery); /** - * @param userInfoCBquery Query. - * @deprecated Please use existsUserInfoList(subQuery) method. - */ - public void setRoleId_ExistsSubQuery_UserInfoList(UserInfoCQ userInfoCBquery) { - String subQueryPropertyName = keepRoleId_ExistsSubQuery_UserInfoList(userInfoCBquery);// for - // saving - // query - // - - // value - // . - registerExistsSubQuery(userInfoCBquery, "ROLE_ID", "ROLE_ID", - subQueryPropertyName); - } - - /** * Set up 'exists' sub-query. {exists (select ROLE_ID from USER_INFO where * ...)} * @@ -314,12 +250,12 @@ cb.xsetupForExistsSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepRoleId_ExistsSubQuery_UserInfoList(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerExistsSubQuery(cb.query(), "ROLE_ID", "ROLE_ID", subQueryPropertyName); } - abstract public String keepRoleId_ExistsSubQuery_UserInfoList( + public abstract String keepRoleId_ExistsSubQuery_UserInfoList( UserInfoCQ subQuery); /** @@ -335,12 +271,12 @@ cb.xsetupForExistsSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepRoleId_NotExistsSubQuery_RoleMappingList(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerNotExistsSubQuery(cb.query(), "ROLE_ID", "ROLE_ID", subQueryPropertyName); } - abstract public String keepRoleId_NotExistsSubQuery_RoleMappingList( + public abstract String keepRoleId_NotExistsSubQuery_RoleMappingList( RoleMappingCQ subQuery); /** @@ -356,53 +292,53 @@ cb.xsetupForExistsSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepRoleId_NotExistsSubQuery_UserInfoList(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerNotExistsSubQuery(cb.query(), "ROLE_ID", "ROLE_ID", subQueryPropertyName); } - abstract public String keepRoleId_NotExistsSubQuery_UserInfoList( + public abstract String keepRoleId_NotExistsSubQuery_UserInfoList( UserInfoCQ subQuery); public void xderiveRoleMappingList(String function, SubQuery subQuery, String aliasName) { assertObjectNotNull("subQuery", subQuery); RoleMappingCB cb = new RoleMappingCB(); - cb.xsetupForDeriveReferrer(); + cb.xsetupForDerivedReferrer(); subQuery.query(cb); - String subQueryPropertyName = keepRoleId_DeriveSubQuery_RoleMappingList(cb - .query());// for saving query-value. - registerDeriveSubQuery(function, cb.query(), "ROLE_ID", "ROLE_ID", - subQueryPropertyName, aliasName); + String subQueryPropertyName = keepRoleId_DerivedReferrer_RoleMappingList(cb + .query()); // for saving query-value. + registerDerivedReferrerSubQuery(function, cb.query(), "ROLE_ID", + "ROLE_ID", subQueryPropertyName, aliasName); } - abstract public String keepRoleId_DeriveSubQuery_RoleMappingList( + public abstract String keepRoleId_DerivedReferrer_RoleMappingList( RoleMappingCQ subQuery); public void xderiveUserInfoList(String function, SubQuery subQuery, String aliasName) { assertObjectNotNull("subQuery", subQuery); UserInfoCB cb = new UserInfoCB(); - cb.xsetupForDeriveReferrer(); + cb.xsetupForDerivedReferrer(); subQuery.query(cb); - String subQueryPropertyName = keepRoleId_DeriveSubQuery_UserInfoList(cb - .query());// for saving query-value. - registerDeriveSubQuery(function, cb.query(), "ROLE_ID", "ROLE_ID", - subQueryPropertyName, aliasName); + String subQueryPropertyName = keepRoleId_DerivedReferrer_UserInfoList(cb + .query()); // for saving query-value. + registerDerivedReferrerSubQuery(function, cb.query(), "ROLE_ID", + "ROLE_ID", subQueryPropertyName, aliasName); } - abstract public String keepRoleId_DeriveSubQuery_UserInfoList( + public abstract String keepRoleId_DerivedReferrer_UserInfoList( UserInfoCQ subQuery); /** - * IsNull(is null). And OnceRegistered. + * IsNull(is null). And OnlyOnceRegistered. */ public void setRoleId_IsNull() { regRoleId(CK_ISN, DUMMY_OBJECT); } /** - * IsNotNull(is not null). And OnceRegistered. + * IsNotNull(is not null). And OnlyOnceRegistered. */ public void setRoleId_IsNotNull() { regRoleId(CK_ISNN, DUMMY_OBJECT); @@ -421,7 +357,7 @@ abstract protected ConditionValue getCValueRoleId(); /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {VARCHAR(100)} + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {VARCHAR(100)} * * @param name The value of name as equal. */ @@ -430,7 +366,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param name The value of name as notEqual. */ @@ -439,7 +375,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param name The value of name as greaterThan. */ @@ -448,7 +384,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param name The value of name as lessThan. */ @@ -457,7 +393,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param name The value of name as greaterEqual. */ @@ -466,7 +402,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param name The value of name as lessEqual. */ @@ -475,7 +411,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param name The value of name as prefixSearch. */ @@ -484,20 +420,6 @@ } /** - * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, - * SeveralRegistered. - * - * @param name The value of name as likeSearch. - * @param likeSearchOption The option of like-search. (NotNull) - */ - public void setName_LikeSearch( - String name, - jp.sf.pal.board.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { - registerLikeSearchQuery(CK_LS, fRES(name), getCValueName(), "NAME", - "Name", "name", likeSearchOption); - } - - /** * InScope(in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * @@ -508,38 +430,52 @@ } /** - * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * - * @param name The collection of name as inScope. - * @param inScopeOption The option of in-scope. (NotNull) + * @param nameList The collection of name as notInScope. */ - public void setName_InScope( + public void setName_NotInScope(Collection nameList) { + regName(CK_NINS, cTL(nameList)); + } + + /** + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param name The value of name as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) + */ + public void setName_LikeSearch( String name, - jp.sf.pal.board.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(name), getCValueName(), "NAME", - "Name", "name", inScopeOption); + jp.sf.pal.board.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(name), getCValueName(), "NAME", "Name", "name", + likeSearchOption); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param nameList The collection of name as notInScope. + * @param name The value of name as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setName_NotInScope(Collection nameList) { - regName(CK_NINS, cTL(nameList)); + public void setName_NotLikeSearch( + String name, + jp.sf.pal.board.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(name), getCValueName(), "NAME", "Name", "name", + likeSearchOption); } /** - * IsNull(is null). And OnceRegistered. + * IsNull(is null). And OnlyOnceRegistered. */ public void setName_IsNull() { regName(CK_ISN, DUMMY_OBJECT); } /** - * IsNotNull(is not null). And OnceRegistered. + * IsNotNull(is not null). And OnlyOnceRegistered. */ public void setName_IsNotNull() { regName(CK_ISNN, DUMMY_OBJECT); @@ -556,7 +492,7 @@ abstract protected ConditionValue getCValueName(); /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {VARCHAR(255)} + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {VARCHAR(255)} * * @param description The value of description as equal. */ @@ -565,7 +501,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param description The value of description as notEqual. */ @@ -574,7 +510,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param description The value of description as greaterThan. */ @@ -583,7 +519,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param description The value of description as lessThan. */ @@ -592,7 +528,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param description The value of description as greaterEqual. */ @@ -601,7 +537,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param description The value of description as lessEqual. */ @@ -610,7 +546,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param description The value of description as prefixSearch. */ @@ -619,21 +555,6 @@ } /** - * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, - * SeveralRegistered. - * - * @param description The value of description as likeSearch. - * @param likeSearchOption The option of like-search. (NotNull) - */ - public void setDescription_LikeSearch( - String description, - jp.sf.pal.board.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { - registerLikeSearchQuery(CK_LS, fRES(description), - getCValueDescription(), "DESCRIPTION", "Description", - "description", likeSearchOption); - } - - /** * InScope(in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * @@ -644,38 +565,52 @@ } /** - * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * - * @param description The collection of description as inScope. - * @param inScopeOption The option of in-scope. (NotNull) + * @param descriptionList The collection of description as notInScope. */ - public void setDescription_InScope( + public void setDescription_NotInScope(Collection descriptionList) { + regDescription(CK_NINS, cTL(descriptionList)); + } + + /** + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param description The value of description as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) + */ + public void setDescription_LikeSearch( String description, - jp.sf.pal.board.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(description), getCValueDescription(), - "DESCRIPTION", "Description", "description", inScopeOption); + jp.sf.pal.board.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(description), getCValueDescription(), "DESCRIPTION", + "Description", "description", likeSearchOption); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param descriptionList The collection of description as notInScope. + * @param description The value of description as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setDescription_NotInScope(Collection descriptionList) { - regDescription(CK_NINS, cTL(descriptionList)); + public void setDescription_NotLikeSearch( + String description, + jp.sf.pal.board.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(description), getCValueDescription(), + "DESCRIPTION", "Description", "description", likeSearchOption); } /** - * IsNull(is null). And OnceRegistered. + * IsNull(is null). And OnlyOnceRegistered. */ public void setDescription_IsNull() { regDescription(CK_ISN, DUMMY_OBJECT); } /** - * IsNotNull(is not null). And OnceRegistered. + * IsNotNull(is not null). And OnlyOnceRegistered. */ public void setDescription_IsNotNull() { regDescription(CK_ISNN, DUMMY_OBJECT); @@ -694,7 +629,7 @@ abstract protected ConditionValue getCValueDescription(); /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {VARCHAR(255)} + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {VARCHAR(255)} * * @param email The value of email as equal. */ @@ -703,7 +638,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param email The value of email as notEqual. */ @@ -712,7 +647,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param email The value of email as greaterThan. */ @@ -721,7 +656,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param email The value of email as lessThan. */ @@ -730,7 +665,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param email The value of email as greaterEqual. */ @@ -739,7 +674,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param email The value of email as lessEqual. */ @@ -748,7 +683,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param email The value of email as prefixSearch. */ @@ -757,20 +692,6 @@ } /** - * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, - * SeveralRegistered. - * - * @param email The value of email as likeSearch. - * @param likeSearchOption The option of like-search. (NotNull) - */ - public void setEmail_LikeSearch( - String email, - jp.sf.pal.board.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { - registerLikeSearchQuery(CK_LS, fRES(email), getCValueEmail(), "EMAIL", - "Email", "email", likeSearchOption); - } - - /** * InScope(in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * @@ -781,38 +702,52 @@ } /** - * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * - * @param email The collection of email as inScope. - * @param inScopeOption The option of in-scope. (NotNull) + * @param emailList The collection of email as notInScope. */ - public void setEmail_InScope( + public void setEmail_NotInScope(Collection emailList) { + regEmail(CK_NINS, cTL(emailList)); + } + + /** + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param email The value of email as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) + */ + public void setEmail_LikeSearch( String email, - jp.sf.pal.board.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(email), getCValueEmail(), "EMAIL", - "Email", "email", inScopeOption); + jp.sf.pal.board.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(email), getCValueEmail(), "EMAIL", "Email", "email", + likeSearchOption); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param emailList The collection of email as notInScope. + * @param email The value of email as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setEmail_NotInScope(Collection emailList) { - regEmail(CK_NINS, cTL(emailList)); + public void setEmail_NotLikeSearch( + String email, + jp.sf.pal.board.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(email), getCValueEmail(), "EMAIL", "Email", + "email", likeSearchOption); } /** - * IsNull(is null). And OnceRegistered. + * IsNull(is null). And OnlyOnceRegistered. */ public void setEmail_IsNull() { regEmail(CK_ISN, DUMMY_OBJECT); } /** - * IsNotNull(is not null). And OnceRegistered. + * IsNotNull(is not null). And OnlyOnceRegistered. */ public void setEmail_IsNotNull() { regEmail(CK_ISNN, DUMMY_OBJECT); @@ -830,7 +765,7 @@ abstract protected ConditionValue getCValueEmail(); /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {VARCHAR(255)} + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {VARCHAR(255)} * * @param url The value of url as equal. */ @@ -839,7 +774,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param url The value of url as notEqual. */ @@ -848,7 +783,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param url The value of url as greaterThan. */ @@ -857,7 +792,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param url The value of url as lessThan. */ @@ -866,7 +801,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param url The value of url as greaterEqual. */ @@ -875,7 +810,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param url The value of url as lessEqual. */ @@ -884,7 +819,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param url The value of url as prefixSearch. */ @@ -893,20 +828,6 @@ } /** - * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, - * SeveralRegistered. - * - * @param url The value of url as likeSearch. - * @param likeSearchOption The option of like-search. (NotNull) - */ - public void setUrl_LikeSearch( - String url, - jp.sf.pal.board.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { - registerLikeSearchQuery(CK_LS, fRES(url), getCValueUrl(), "URL", "Url", - "url", likeSearchOption); - } - - /** * InScope(in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * @@ -917,38 +838,52 @@ } /** - * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * - * @param url The collection of url as inScope. - * @param inScopeOption The option of in-scope. (NotNull) + * @param urlList The collection of url as notInScope. */ - public void setUrl_InScope( + public void setUrl_NotInScope(Collection urlList) { + regUrl(CK_NINS, cTL(urlList)); + } + + /** + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param url The value of url as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) + */ + public void setUrl_LikeSearch( String url, - jp.sf.pal.board.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(url), getCValueUrl(), "URL", "Url", - "url", inScopeOption); + jp.sf.pal.board.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(url), getCValueUrl(), "URL", "Url", "url", + likeSearchOption); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param urlList The collection of url as notInScope. + * @param url The value of url as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setUrl_NotInScope(Collection urlList) { - regUrl(CK_NINS, cTL(urlList)); + public void setUrl_NotLikeSearch( + String url, + jp.sf.pal.board.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(url), getCValueUrl(), "URL", "Url", "url", + likeSearchOption); } /** - * IsNull(is null). And OnceRegistered. + * IsNull(is null). And OnlyOnceRegistered. */ public void setUrl_IsNull() { regUrl(CK_ISN, DUMMY_OBJECT); } /** - * IsNotNull(is not null). And OnceRegistered. + * IsNotNull(is not null). And OnlyOnceRegistered. */ public void setUrl_IsNotNull() { regUrl(CK_ISNN, DUMMY_OBJECT); @@ -965,7 +900,7 @@ abstract protected ConditionValue getCValueUrl(); /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {VARCHAR(40)} + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {VARCHAR(40)} * * @param telephone The value of telephone as equal. */ @@ -974,7 +909,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param telephone The value of telephone as notEqual. */ @@ -983,7 +918,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param telephone The value of telephone as greaterThan. */ @@ -992,7 +927,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param telephone The value of telephone as lessThan. */ @@ -1001,7 +936,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param telephone The value of telephone as greaterEqual. */ @@ -1010,7 +945,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param telephone The value of telephone as lessEqual. */ @@ -1019,7 +954,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param telephone The value of telephone as prefixSearch. */ @@ -1028,20 +963,6 @@ } /** - * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, - * SeveralRegistered. - * - * @param telephone The value of telephone as likeSearch. - * @param likeSearchOption The option of like-search. (NotNull) - */ - public void setTelephone_LikeSearch( - String telephone, - jp.sf.pal.board.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { - registerLikeSearchQuery(CK_LS, fRES(telephone), getCValueTelephone(), - "TELEPHONE", "Telephone", "telephone", likeSearchOption); - } - - /** * InScope(in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * @@ -1052,38 +973,52 @@ } /** - * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * - * @param telephone The collection of telephone as inScope. - * @param inScopeOption The option of in-scope. (NotNull) + * @param telephoneList The collection of telephone as notInScope. */ - public void setTelephone_InScope( + public void setTelephone_NotInScope(Collection telephoneList) { + regTelephone(CK_NINS, cTL(telephoneList)); + } + + /** + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param telephone The value of telephone as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) + */ + public void setTelephone_LikeSearch( String telephone, - jp.sf.pal.board.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(telephone), getCValueTelephone(), - "TELEPHONE", "Telephone", "telephone", inScopeOption); + jp.sf.pal.board.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(telephone), getCValueTelephone(), "TELEPHONE", + "Telephone", "telephone", likeSearchOption); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param telephoneList The collection of telephone as notInScope. + * @param telephone The value of telephone as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setTelephone_NotInScope(Collection telephoneList) { - regTelephone(CK_NINS, cTL(telephoneList)); + public void setTelephone_NotLikeSearch( + String telephone, + jp.sf.pal.board.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(telephone), getCValueTelephone(), "TELEPHONE", + "Telephone", "telephone", likeSearchOption); } /** - * IsNull(is null). And OnceRegistered. + * IsNull(is null). And OnlyOnceRegistered. */ public void setTelephone_IsNull() { regTelephone(CK_ISN, DUMMY_OBJECT); } /** - * IsNotNull(is not null). And OnceRegistered. + * IsNotNull(is not null). And OnlyOnceRegistered. */ public void setTelephone_IsNotNull() { regTelephone(CK_ISNN, DUMMY_OBJECT); @@ -1102,7 +1037,7 @@ abstract protected ConditionValue getCValueTelephone(); /** - * Equal(=). And NullIgnored, OnceRegistered. {NotNull : TIMESTAMP} + * Equal(=). And NullIgnored, OnlyOnceRegistered. {NotNull : TIMESTAMP} * * @param createdTime The value of createdTime as equal. */ @@ -1111,7 +1046,7 @@ } /** - * NotEqual(!=). And NullIgnored, OnceRegistered. + * NotEqual(!=). And NullIgnored, OnlyOnceRegistered. * * @param createdTime The value of createdTime as notEqual. */ @@ -1120,7 +1055,7 @@ } /** - * GreaterThan(>). And NullIgnored, OnceRegistered. + * GreaterThan(>). And NullIgnored, OnlyOnceRegistered. * * @param createdTime The value of createdTime as greaterThan. */ @@ -1129,7 +1064,7 @@ } /** - * LessThan(>). And NullIgnored, OnceRegistered. + * LessThan(>). And NullIgnored, OnlyOnceRegistered. * * @param createdTime The value of createdTime as lessThan. */ @@ -1138,7 +1073,7 @@ } /** - * GreaterEqual(>). And NullIgnored, OnceRegistered. + * GreaterEqual(>). And NullIgnored, OnlyOnceRegistered. * * @param createdTime The value of createdTime as greaterEqual. */ @@ -1147,7 +1082,7 @@ } /** - * LessEqual(>). And NullIgnored, OnceRegistered. + * LessEqual(>). And NullIgnored, OnlyOnceRegistered. * * @param createdTime The value of createdTime as lessEqual. */ @@ -1157,7 +1092,7 @@ /** * FromTo($fromDate <= COLUMN_NAME <= $toDate). And NullIgnored, - * OnceRegistered. {NotNull : TIMESTAMP} + * OnlyOnceRegistered. {NotNull : TIMESTAMP} * * @param fromDate The from-date of createdTime. (Nullable) * @param toDate The to-date of createdTime. (Nullable) @@ -1174,7 +1109,7 @@ /** * FromTo($fromDate <= COLUMN_NAME < $toDate + 1). And NullIgnored, - * OnceRegistered. {NotNull : TIMESTAMP} + * OnlyOnceRegistered. {NotNull : TIMESTAMP} * * @param fromDate The from-date of createdTime. (Nullable) * @param toDate The to-date of createdTime. (Nullable) @@ -1200,7 +1135,7 @@ abstract protected ConditionValue getCValueCreatedTime(); /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {NotNull : + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {NotNull : * VARCHAR(255)} * * @param createdBy The value of createdBy as equal. @@ -1210,7 +1145,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param createdBy The value of createdBy as notEqual. */ @@ -1219,7 +1154,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param createdBy The value of createdBy as greaterThan. */ @@ -1228,7 +1163,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param createdBy The value of createdBy as lessThan. */ @@ -1237,7 +1172,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param createdBy The value of createdBy as greaterEqual. */ @@ -1246,7 +1181,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param createdBy The value of createdBy as lessEqual. */ @@ -1255,7 +1190,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param createdBy The value of createdBy as prefixSearch. */ @@ -1264,20 +1199,6 @@ } /** - * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, - * SeveralRegistered. - * - * @param createdBy The value of createdBy as likeSearch. - * @param likeSearchOption The option of like-search. (NotNull) - */ - public void setCreatedBy_LikeSearch( - String createdBy, - jp.sf.pal.board.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { - registerLikeSearchQuery(CK_LS, fRES(createdBy), getCValueCreatedBy(), - "CREATED_BY", "CreatedBy", "createdBy", likeSearchOption); - } - - /** * InScope(in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * @@ -1288,27 +1209,41 @@ } /** - * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * - * @param createdBy The collection of createdBy as inScope. - * @param inScopeOption The option of in-scope. (NotNull) + * @param createdByList The collection of createdBy as notInScope. */ - public void setCreatedBy_InScope( + public void setCreatedBy_NotInScope(Collection createdByList) { + regCreatedBy(CK_NINS, cTL(createdByList)); + } + + /** + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param createdBy The value of createdBy as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) + */ + public void setCreatedBy_LikeSearch( String createdBy, - jp.sf.pal.board.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(createdBy), getCValueCreatedBy(), - "CREATED_BY", "CreatedBy", "createdBy", inScopeOption); + jp.sf.pal.board.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(createdBy), getCValueCreatedBy(), "CREATED_BY", + "CreatedBy", "createdBy", likeSearchOption); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param createdByList The collection of createdBy as notInScope. + * @param createdBy The value of createdBy as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setCreatedBy_NotInScope(Collection createdByList) { - regCreatedBy(CK_NINS, cTL(createdByList)); + public void setCreatedBy_NotLikeSearch( + String createdBy, + jp.sf.pal.board.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(createdBy), getCValueCreatedBy(), "CREATED_BY", + "CreatedBy", "createdBy", likeSearchOption); } protected void regCreatedBy(ConditionKey key, Object value) { @@ -1324,7 +1259,7 @@ abstract protected ConditionValue getCValueCreatedBy(); /** - * Equal(=). And NullIgnored, OnceRegistered. {NotNull : TIMESTAMP} + * Equal(=). And NullIgnored, OnlyOnceRegistered. {NotNull : TIMESTAMP} * * @param updatedTime The value of updatedTime as equal. */ @@ -1333,7 +1268,7 @@ } /** - * NotEqual(!=). And NullIgnored, OnceRegistered. + * NotEqual(!=). And NullIgnored, OnlyOnceRegistered. * * @param updatedTime The value of updatedTime as notEqual. */ @@ -1342,7 +1277,7 @@ } /** - * GreaterThan(>). And NullIgnored, OnceRegistered. + * GreaterThan(>). And NullIgnored, OnlyOnceRegistered. * * @param updatedTime The value of updatedTime as greaterThan. */ @@ -1351,7 +1286,7 @@ } /** - * LessThan(>). And NullIgnored, OnceRegistered. + * LessThan(>). And NullIgnored, OnlyOnceRegistered. * * @param updatedTime The value of updatedTime as lessThan. */ @@ -1360,7 +1295,7 @@ } /** - * GreaterEqual(>). And NullIgnored, OnceRegistered. + * GreaterEqual(>). And NullIgnored, OnlyOnceRegistered. * * @param updatedTime The value of updatedTime as greaterEqual. */ @@ -1369,7 +1304,7 @@ } /** - * LessEqual(>). And NullIgnored, OnceRegistered. + * LessEqual(>). And NullIgnored, OnlyOnceRegistered. * * @param updatedTime The value of updatedTime as lessEqual. */ @@ -1379,7 +1314,7 @@ /** * FromTo($fromDate <= COLUMN_NAME <= $toDate). And NullIgnored, - * OnceRegistered. {NotNull : TIMESTAMP} + * OnlyOnceRegistered. {NotNull : TIMESTAMP} * * @param fromDate The from-date of updatedTime. (Nullable) * @param toDate The to-date of updatedTime. (Nullable) @@ -1396,7 +1331,7 @@ /** * FromTo($fromDate <= COLUMN_NAME < $toDate + 1). And NullIgnored, - * OnceRegistered. {NotNull : TIMESTAMP} + * OnlyOnceRegistered. {NotNull : TIMESTAMP} * * @param fromDate The from-date of updatedTime. (Nullable) * @param toDate The to-date of updatedTime. (Nullable) @@ -1422,7 +1357,7 @@ abstract protected ConditionValue getCValueUpdatedTime(); /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {NotNull : + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {NotNull : * VARCHAR(255)} * * @param updatedBy The value of updatedBy as equal. @@ -1432,7 +1367,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param updatedBy The value of updatedBy as notEqual. */ @@ -1441,7 +1376,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param updatedBy The value of updatedBy as greaterThan. */ @@ -1450,7 +1385,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param updatedBy The value of updatedBy as lessThan. */ @@ -1459,7 +1394,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param updatedBy The value of updatedBy as greaterEqual. */ @@ -1468,7 +1403,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param updatedBy The value of updatedBy as lessEqual. */ @@ -1477,7 +1412,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param updatedBy The value of updatedBy as prefixSearch. */ @@ -1486,20 +1421,6 @@ } /** - * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, - * SeveralRegistered. - * - * @param updatedBy The value of updatedBy as likeSearch. - * @param likeSearchOption The option of like-search. (NotNull) - */ - public void setUpdatedBy_LikeSearch( - String updatedBy, - jp.sf.pal.board.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { - registerLikeSearchQuery(CK_LS, fRES(updatedBy), getCValueUpdatedBy(), - "UPDATED_BY", "UpdatedBy", "updatedBy", likeSearchOption); - } - - /** * InScope(in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * @@ -1510,27 +1431,41 @@ } /** - * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * - * @param updatedBy The collection of updatedBy as inScope. - * @param inScopeOption The option of in-scope. (NotNull) + * @param updatedByList The collection of updatedBy as notInScope. */ - public void setUpdatedBy_InScope( + public void setUpdatedBy_NotInScope(Collection updatedByList) { + regUpdatedBy(CK_NINS, cTL(updatedByList)); + } + + /** + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param updatedBy The value of updatedBy as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) + */ + public void setUpdatedBy_LikeSearch( String updatedBy, - jp.sf.pal.board.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(updatedBy), getCValueUpdatedBy(), - "UPDATED_BY", "UpdatedBy", "updatedBy", inScopeOption); + jp.sf.pal.board.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(updatedBy), getCValueUpdatedBy(), "UPDATED_BY", + "UpdatedBy", "updatedBy", likeSearchOption); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param updatedByList The collection of updatedBy as notInScope. + * @param updatedBy The value of updatedBy as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setUpdatedBy_NotInScope(Collection updatedByList) { - regUpdatedBy(CK_NINS, cTL(updatedByList)); + public void setUpdatedBy_NotLikeSearch( + String updatedBy, + jp.sf.pal.board.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(updatedBy), getCValueUpdatedBy(), "UPDATED_BY", + "UpdatedBy", "updatedBy", likeSearchOption); } protected void regUpdatedBy(ConditionKey key, Object value) { @@ -1546,7 +1481,7 @@ abstract protected ConditionValue getCValueUpdatedBy(); /** - * Equal(=). And NullIgnored, OnceRegistered. {TIMESTAMP} + * Equal(=). And NullIgnored, OnlyOnceRegistered. {TIMESTAMP} * * @param deletedTime The value of deletedTime as equal. */ @@ -1555,7 +1490,7 @@ } /** - * NotEqual(!=). And NullIgnored, OnceRegistered. + * NotEqual(!=). And NullIgnored, OnlyOnceRegistered. * * @param deletedTime The value of deletedTime as notEqual. */ @@ -1564,7 +1499,7 @@ } /** - * GreaterThan(>). And NullIgnored, OnceRegistered. + * GreaterThan(>). And NullIgnored, OnlyOnceRegistered. * * @param deletedTime The value of deletedTime as greaterThan. */ @@ -1573,7 +1508,7 @@ } /** - * LessThan(>). And NullIgnored, OnceRegistered. + * LessThan(>). And NullIgnored, OnlyOnceRegistered. * * @param deletedTime The value of deletedTime as lessThan. */ @@ -1582,7 +1517,7 @@ } /** - * GreaterEqual(>). And NullIgnored, OnceRegistered. + * GreaterEqual(>). And NullIgnored, OnlyOnceRegistered. * * @param deletedTime The value of deletedTime as greaterEqual. */ @@ -1591,7 +1526,7 @@ } /** - * LessEqual(>). And NullIgnored, OnceRegistered. + * LessEqual(>). And NullIgnored, OnlyOnceRegistered. * * @param deletedTime The value of deletedTime as lessEqual. */ @@ -1601,7 +1536,7 @@ /** * FromTo($fromDate <= COLUMN_NAME <= $toDate). And NullIgnored, - * OnceRegistered. {TIMESTAMP} + * OnlyOnceRegistered. {TIMESTAMP} * * @param fromDate The from-date of deletedTime. (Nullable) * @param toDate The to-date of deletedTime. (Nullable) @@ -1618,7 +1553,7 @@ /** * FromTo($fromDate <= COLUMN_NAME < $toDate + 1). And NullIgnored, - * OnceRegistered. {TIMESTAMP} + * OnlyOnceRegistered. {TIMESTAMP} * * @param fromDate The from-date of deletedTime. (Nullable) * @param toDate The to-date of deletedTime. (Nullable) @@ -1632,14 +1567,14 @@ } /** - * IsNull(is null). And OnceRegistered. + * IsNull(is null). And OnlyOnceRegistered. */ public void setDeletedTime_IsNull() { regDeletedTime(CK_ISN, DUMMY_OBJECT); } /** - * IsNotNull(is not null). And OnceRegistered. + * IsNotNull(is not null). And OnlyOnceRegistered. */ public void setDeletedTime_IsNotNull() { regDeletedTime(CK_ISNN, DUMMY_OBJECT); @@ -1658,7 +1593,7 @@ abstract protected ConditionValue getCValueDeletedTime(); /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {VARCHAR(255)} + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {VARCHAR(255)} * * @param deletedBy The value of deletedBy as equal. */ @@ -1667,7 +1602,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param deletedBy The value of deletedBy as notEqual. */ @@ -1676,7 +1611,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param deletedBy The value of deletedBy as greaterThan. */ @@ -1685,7 +1620,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param deletedBy The value of deletedBy as lessThan. */ @@ -1694,7 +1629,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param deletedBy The value of deletedBy as greaterEqual. */ @@ -1703,7 +1638,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param deletedBy The value of deletedBy as lessEqual. */ @@ -1712,7 +1647,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param deletedBy The value of deletedBy as prefixSearch. */ @@ -1721,20 +1656,6 @@ } /** - * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, - * SeveralRegistered. - * - * @param deletedBy The value of deletedBy as likeSearch. - * @param likeSearchOption The option of like-search. (NotNull) - */ - public void setDeletedBy_LikeSearch( - String deletedBy, - jp.sf.pal.board.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { - registerLikeSearchQuery(CK_LS, fRES(deletedBy), getCValueDeletedBy(), - "DELETED_BY", "DeletedBy", "deletedBy", likeSearchOption); - } - - /** * InScope(in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * @@ -1745,38 +1666,52 @@ } /** - * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * - * @param deletedBy The collection of deletedBy as inScope. - * @param inScopeOption The option of in-scope. (NotNull) + * @param deletedByList The collection of deletedBy as notInScope. */ - public void setDeletedBy_InScope( + public void setDeletedBy_NotInScope(Collection deletedByList) { + regDeletedBy(CK_NINS, cTL(deletedByList)); + } + + /** + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param deletedBy The value of deletedBy as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) + */ + public void setDeletedBy_LikeSearch( String deletedBy, - jp.sf.pal.board.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(deletedBy), getCValueDeletedBy(), - "DELETED_BY", "DeletedBy", "deletedBy", inScopeOption); + jp.sf.pal.board.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(deletedBy), getCValueDeletedBy(), "DELETED_BY", + "DeletedBy", "deletedBy", likeSearchOption); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param deletedByList The collection of deletedBy as notInScope. + * @param deletedBy The value of deletedBy as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setDeletedBy_NotInScope(Collection deletedByList) { - regDeletedBy(CK_NINS, cTL(deletedByList)); + public void setDeletedBy_NotLikeSearch( + String deletedBy, + jp.sf.pal.board.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(deletedBy), getCValueDeletedBy(), "DELETED_BY", + "DeletedBy", "deletedBy", likeSearchOption); } /** - * IsNull(is null). And OnceRegistered. + * IsNull(is null). And OnlyOnceRegistered. */ public void setDeletedBy_IsNull() { regDeletedBy(CK_ISN, DUMMY_OBJECT); } /** - * IsNotNull(is not null). And OnceRegistered. + * IsNotNull(is not null). And OnlyOnceRegistered. */ public void setDeletedBy_IsNotNull() { regDeletedBy(CK_ISNN, DUMMY_OBJECT); @@ -1795,7 +1730,7 @@ abstract protected ConditionValue getCValueDeletedBy(); /** - * Equal(=). And NullIgnored, OnceRegistered. {NotNull : INTEGER} + * Equal(=). And NullIgnored, OnlyOnceRegistered. {NotNull : INTEGER} * * @param versionno The value of versionno as equal. */ @@ -1804,7 +1739,7 @@ } /** - * NotEqual(!=). And NullIgnored, OnceRegistered. + * NotEqual(!=). And NullIgnored, OnlyOnceRegistered. * * @param versionno The value of versionno as notEqual. */ @@ -1813,7 +1748,7 @@ } /** - * GreaterThan(>). And NullIgnored, OnceRegistered. + * GreaterThan(>). And NullIgnored, OnlyOnceRegistered. * * @param versionno The value of versionno as greaterThan. */ @@ -1822,7 +1757,7 @@ } /** - * LessThan(<). And NullIgnored, OnceRegistered. + * LessThan(<). And NullIgnored, OnlyOnceRegistered. * * @param versionno The value of versionno as lessThan. */ @@ -1831,7 +1766,7 @@ } /** - * GreaterEqual(>=). And NullIgnored, OnceRegistered. + * GreaterEqual(>=). And NullIgnored, OnlyOnceRegistered. * * @param versionno The value of versionno as greaterEqual. */ @@ -1840,7 +1775,7 @@ } /** - * LessEqual(<=). And NullIgnored, OnceRegistered. + * LessEqual(<=). And NullIgnored, OnlyOnceRegistered. * * @param versionno The value of versionno as lessEqual. */ @@ -1880,6 +1815,50 @@ abstract protected ConditionValue getCValueVersionno(); + public SSQFunction scalar_Equal() { + return xcreateSSQFunction("="); + } + + public SSQFunction scalar_GreaterEqual() { + return xcreateSSQFunction(">="); + } + + public SSQFunction scalar_GreaterThan() { + return xcreateSSQFunction(">"); + } + + public SSQFunction scalar_LessEqual() { + return xcreateSSQFunction("<="); + } + + public SSQFunction scalar_LessThan() { + return xcreateSSQFunction("<"); + } + + protected SSQFunction xcreateSSQFunction(final String operand) { + return new SSQFunction(new SSQSetupper() { + public void setup(String function, SubQuery subQuery) { + xscalarSubQuery(function, subQuery, operand); + } + }); + } + + protected void xscalarSubQuery(String function, + SubQuery subQuery, String operand) { + assertObjectNotNull("subQuery", subQuery); + RoleInfoCB cb = new RoleInfoCB(); + cb.xsetupForScalarSubQuery(); + subQuery.query(cb); + String subQueryPropertyName = keepScalarSubQuery(cb.query()); // for + // saving + // query + // -value. + registerScalarSubQuery(function, cb.query(), subQueryPropertyName, + operand); + } + + public abstract String keepScalarSubQuery(RoleInfoCQ subQuery); + // Very Internal (for Suppressing Warn about 'Not Use Import') protected String getConditionBeanClassNameInternally() { return RoleInfoCB.class.getName(); Modified: board/trunk/src/main/java/jp/sf/pal/board/db/cbean/cq/bs/AbstractBsRoleMappingCQ.java =================================================================== --- board/trunk/src/main/java/jp/sf/pal/board/db/cbean/cq/bs/AbstractBsRoleMappingCQ.java 2008-12-27 22:06:42 UTC (rev 1624) +++ board/trunk/src/main/java/jp/sf/pal/board/db/cbean/cq/bs/AbstractBsRoleMappingCQ.java 2008-12-27 22:09:08 UTC (rev 1625) @@ -11,16 +11,13 @@ import jp.sf.pal.board.db.cbean.RoleInfoCB; import jp.sf.pal.board.db.cbean.RoleMappingCB; import jp.sf.pal.board.db.cbean.UserInfoCB; -import jp.sf.pal.board.db.cbean.cq.RoleInfoCQ; import jp.sf.pal.board.db.cbean.cq.RoleMappingCQ; -import jp.sf.pal.board.db.cbean.cq.UserInfoCQ; /** * The abstract condition-query of ROLE_MAPPING. * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public abstract class AbstractBsRoleMappingCQ extends AbstractConditionQuery { //========================================================================== @@ -50,7 +47,8 @@ // ===== /** - * Equal(=). And NullIgnored, OnceRegistered. {PK : ID : NotNull : INTEGER} + * Equal(=). And NullIgnored, OnlyOnceRegistered. {PK : ID : NotNull : + * INTEGER} * * @param id The value of id as equal. */ @@ -59,7 +57,7 @@ } /** - * NotEqual(!=). And NullIgnored, OnceRegistered. + * NotEqual(!=). And NullIgnored, OnlyOnceRegistered. * * @param id The value of id as notEqual. */ @@ -68,7 +66,7 @@ } /** - * GreaterThan(>). And NullIgnored, OnceRegistered. + * GreaterThan(>). And NullIgnored, OnlyOnceRegistered. * * @param id The value of id as greaterThan. */ @@ -77,7 +75,7 @@ } /** - * LessThan(<). And NullIgnored, OnceRegistered. + * LessThan(<). And NullIgnored, OnlyOnceRegistered. * * @param id The value of id as lessThan. */ @@ -86,7 +84,7 @@ } /** - * GreaterEqual(>=). And NullIgnored, OnceRegistered. + * GreaterEqual(>=). And NullIgnored, OnlyOnceRegistered. * * @param id The value of id as greaterEqual. */ @@ -95,7 +93,7 @@ } /** - * LessEqual(<=). And NullIgnored, OnceRegistered. + * LessEqual(<=). And NullIgnored, OnlyOnceRegistered. * * @param id The value of id as lessEqual. */ @@ -124,14 +122,14 @@ } /** - * IsNull(is null). And OnceRegistered. + * IsNull(is null). And OnlyOnceRegistered. */ public void setId_IsNull() { regId(CK_ISN, DUMMY_OBJECT); } /** - * IsNotNull(is not null). And OnceRegistered. + * IsNotNull(is not null). And OnlyOnceRegistered. */ public void setId_IsNotNull() { regId(CK_ISNN, DUMMY_OBJECT); @@ -148,8 +146,8 @@ abstract protected ConditionValue getCValueId(); /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {NotNull : VARCHAR(255) - * : FK to USER_INFO} + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {NotNull : + * VARCHAR(255) : FK to USER_INFO} * * @param userId The value of userId as equal. */ @@ -158,7 +156,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param userId The value of userId as notEqual. */ @@ -167,7 +165,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param userId The value of userId as greaterThan. */ @@ -176,7 +174,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param userId The value of userId as lessThan. */ @@ -185,7 +183,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param userId The value of userId as greaterEqual. */ @@ -194,7 +192,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param userId The value of userId as lessEqual. */ @@ -203,7 +201,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param userId The value of userId as prefixSearch. */ @@ -212,20 +210,6 @@ } /** - * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, - * SeveralRegistered. - * - * @param userId The value of userId as likeSearch. - * @param likeSearchOption The option of like-search. (NotNull) - */ - public void setUserId_LikeSearch( - String userId, - jp.sf.pal.board.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { - registerLikeSearchQuery(CK_LS, fRES(userId), getCValueUserId(), - "USER_ID", "UserId", "userId", likeSearchOption); - } - - /** * InScope(in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * @@ -236,42 +220,41 @@ } /** - * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * - * @param userId The collection of userId as inScope. - * @param inScopeOption The option of in-scope. (NotNull) + * @param userIdList The collection of userId as notInScope. */ - public void setUserId_InScope( - String userId, - jp.sf.pal.board.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(userId), getCValueUserId(), - "USER_ID", "UserId", "userId", inScopeOption); + public void setUserId_NotInScope(Collection userIdList) { + regUserId(CK_NINS, cTL(userIdList)); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param userIdList The collection of userId as notInScope. + * @param userId The value of userId as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) */ - public void setUserId_NotInScope(Collection userIdList) { - regUserId(CK_NINS, cTL(userIdList)); + public void setUserId_LikeSearch( + String userId, + jp.sf.pal.board.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(userId), getCValueUserId(), "USER_ID", "UserId", + "userId", likeSearchOption); } /** - * @param userInfoCBquery Query. - * @deprecated Please use inScopeUserInfo(subQuery) method. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param userId The value of userId as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setUserId_InScopeSubQuery_UserInfo(UserInfoCQ userInfoCBquery) { - String subQueryPropertyName = keepUserId_InScopeSubQuery_UserInfo(userInfoCBquery);// for - // saving - // query - // - - // value - // . - registerInScopeSubQuery(userInfoCBquery, "USER_ID", "USER_ID", - subQueryPropertyName); + public void setUserId_NotLikeSearch( + String userId, + jp.sf.pal.board.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(userId), getCValueUserId(), "USER_ID", "UserId", + "userId", likeSearchOption); } public void inScopeUserInfo(SubQuery subQuery) { @@ -280,12 +263,12 @@ cb.xsetupForInScopeSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepUserId_InScopeSubQuery_UserInfo(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerInScopeSubQuery(cb.query(), "USER_ID", "USER_ID", subQueryPropertyName); } - abstract public String keepUserId_InScopeSubQuery_UserInfo( + public abstract String keepUserId_InScopeSubQuery_UserInfo( jp.sf.pal.board.db.cbean.cq.UserInfoCQ subQuery); protected void regUserId(ConditionKey key, Object value) { @@ -301,8 +284,8 @@ abstract protected ConditionValue getCValueUserId(); /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {NotNull : VARCHAR(255) - * : FK to ROLE_INFO} + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {NotNull : + * VARCHAR(255) : FK to ROLE_INFO} * * @param roleId The value of roleId as equal. */ @@ -311,7 +294,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param roleId The value of roleId as notEqual. */ @@ -320,7 +303,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param roleId The value of roleId as greaterThan. */ @@ -329,7 +312,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param roleId The value of roleId as lessThan. */ @@ -338,7 +321,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param roleId The value of roleId as greaterEqual. */ @@ -347,7 +330,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param roleId The value of roleId as lessEqual. */ @@ -356,7 +339,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param roleId The value of roleId as prefixSearch. */ @@ -365,20 +348,6 @@ } /** - * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, - * SeveralRegistered. - * - * @param roleId The value of roleId as likeSearch. - * @param likeSearchOption The option of like-search. (NotNull) - */ - public void setRoleId_LikeSearch( - String roleId, - jp.sf.pal.board.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { - registerLikeSearchQuery(CK_LS, fRES(roleId), getCValueRoleId(), - "ROLE_ID", "RoleId", "roleId", likeSearchOption); - } - - /** * InScope(in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * @@ -389,42 +358,41 @@ } /** - * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * - * @param roleId The collection of roleId as inScope. - * @param inScopeOption The option of in-scope. (NotNull) + * @param roleIdList The collection of roleId as notInScope. */ - public void setRoleId_InScope( - String roleId, - jp.sf.pal.board.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(roleId), getCValueRoleId(), - "ROLE_ID", "RoleId", "roleId", inScopeOption); + public void setRoleId_NotInScope(Collection roleIdList) { + regRoleId(CK_NINS, cTL(roleIdList)); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param roleIdList The collection of roleId as notInScope. + * @param roleId The value of roleId as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) */ - public void setRoleId_NotInScope(Collection roleIdList) { - regRoleId(CK_NINS, cTL(roleIdList)); + public void setRoleId_LikeSearch( + String roleId, + jp.sf.pal.board.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(roleId), getCValueRoleId(), "ROLE_ID", "RoleId", + "roleId", likeSearchOption); } /** - * @param roleInfoCBquery Query. - * @deprecated Please use inScopeRoleInfo(subQuery) method. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param roleId The value of roleId as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setRoleId_InScopeSubQuery_RoleInfo(RoleInfoCQ roleInfoCBquery) { - String subQueryPropertyName = keepRoleId_InScopeSubQuery_RoleInfo(roleInfoCBquery);// for - // saving - // query - // - - // value - // . - registerInScopeSubQuery(roleInfoCBquery, "ROLE_ID", "ROLE_ID", - subQueryPropertyName); + public void setRoleId_NotLikeSearch( + String roleId, + jp.sf.pal.board.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(roleId), getCValueRoleId(), "ROLE_ID", "RoleId", + "roleId", likeSearchOption); } public void inScopeRoleInfo(SubQuery subQuery) { @@ -433,12 +401,12 @@ cb.xsetupForInScopeSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepRoleId_InScopeSubQuery_RoleInfo(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerInScopeSubQuery(cb.query(), "ROLE_ID", "ROLE_ID", subQueryPropertyName); } - abstract public String keepRoleId_InScopeSubQuery_RoleInfo( + public abstract String keepRoleId_InScopeSubQuery_RoleInfo( jp.sf.pal.board.db.cbean.cq.RoleInfoCQ subQuery); protected void regRoleId(ConditionKey key, Object value) { @@ -453,6 +421,50 @@ abstract protected ConditionValue getCValueRoleId(); + public SSQFunction scalar_Equal() { + return xcreateSSQFunction("="); + } + + public SSQFunction scalar_GreaterEqual() { + return xcreateSSQFunction(">="); + } + + public SSQFunction scalar_GreaterThan() { + return xcreateSSQFunction(">"); + } + + public SSQFunction scalar_LessEqual() { + return xcreateSSQFunction("<="); + } + + public SSQFunction scalar_LessThan() { + return xcreateSSQFunction("<"); + } + + protected SSQFunction xcreateSSQFunction(final String operand) { + return new SSQFunction(new SSQSetupper() { + public void setup(String function, SubQuery subQuery) { + xscalarSubQuery(function, subQuery, operand); + } + }); + } + + protected void xscalarSubQuery(String function, + SubQuery subQuery, String operand) { + assertObjectNotNull("subQuery", subQuery); + RoleMappingCB cb = new RoleMappingCB(); + cb.xsetupForScalarSubQuery(); + subQuery.query(cb); + String subQueryPropertyName = keepScalarSubQuery(cb.query()); // for + // saving + // query + // -value. + registerScalarSubQuery(function, cb.query(), subQueryPropertyName, + operand); + } + + public abstract String keepScalarSubQuery(RoleMappingCQ subQuery); + // Very Internal (for Suppressing Warn about 'Not Use Import') protected String getConditionBeanClassNameInternally() { return RoleMappingCB.class.getName(); Modified: board/trunk/src/main/java/jp/sf/pal/board/db/cbean/cq/bs/AbstractBsUserInfoCQ.java =================================================================== --- board/trunk/src/main/java/jp/sf/pal/board/db/cbean/cq/bs/AbstractBsUserInfoCQ.java 2008-12-27 22:06:42 UTC (rev 1624) +++ board/trunk/src/main/java/jp/sf/pal/board/db/cbean/cq/bs/AbstractBsUserInfoCQ.java 2008-12-27 22:09:08 UTC (rev 1625) @@ -13,9 +13,7 @@ import jp.sf.pal.board.db.cbean.RoleInfoCB; import jp.sf.pal.board.db.cbean.RoleMappingCB; import jp.sf.pal.board.db.cbean.UserInfoCB; -import jp.sf.pal.board.db.cbean.cq.GroupInfoCQ; import jp.sf.pal.board.db.cbean.cq.GroupMappingCQ; -import jp.sf.pal.board.db.cbean.cq.RoleInfoCQ; import jp.sf.pal.board.db.cbean.cq.RoleMappingCQ; import jp.sf.pal.board.db.cbean.cq.UserInfoCQ; @@ -24,7 +22,6 @@ * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public abstract class AbstractBsUserInfoCQ extends AbstractConditionQuery { //========================================================================== @@ -54,7 +51,7 @@ // ===== /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {PK : NotNull : + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {PK : NotNull : * VARCHAR(255)} * * @param userId The value of userId as equal. @@ -64,7 +61,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param userId The value of userId as notEqual. */ @@ -73,7 +70,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param userId The value of userId as greaterThan. */ @@ -82,7 +79,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param userId The value of userId as lessThan. */ @@ -91,7 +88,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param userId The value of userId as greaterEqual. */ @@ -100,7 +97,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param userId The value of userId as lessEqual. */ @@ -109,7 +106,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param userId The value of userId as prefixSearch. */ @@ -118,20 +115,6 @@ } /** - * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, - * SeveralRegistered. - * - * @param userId The value of userId as likeSearch. - * @param likeSearchOption The option of like-search. (NotNull) - */ - public void setUserId_LikeSearch( - String userId, - jp.sf.pal.board.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { - registerLikeSearchQuery(CK_LS, fRES(userId), getCValueUserId(), - "USER_ID", "UserId", "userId", likeSearchOption); - } - - /** * InScope(in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * @@ -142,43 +125,41 @@ } /** - * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * - * @param userId The collection of userId as inScope. - * @param inScopeOption The option of in-scope. (NotNull) + * @param userIdList The collection of userId as notInScope. */ - public void setUserId_InScope( - String userId, - jp.sf.pal.board.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(userId), getCValueUserId(), - "USER_ID", "UserId", "userId", inScopeOption); + public void setUserId_NotInScope(Collection userIdList) { + regUserId(CK_NINS, cTL(userIdList)); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param userIdList The collection of userId as notInScope. + * @param userId The value of userId as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) */ - public void setUserId_NotInScope(Collection userIdList) { - regUserId(CK_NINS, cTL(userIdList)); + public void setUserId_LikeSearch( + String userId, + jp.sf.pal.board.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(userId), getCValueUserId(), "USER_ID", "UserId", + "userId", likeSearchOption); } /** - * @param groupMappingCBquery Query. - * @deprecated Please use inScopeGroupMappingList(subQuery) method. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param userId The value of userId as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setUserId_InScopeSubQuery_GroupMappingList( - GroupMappingCQ groupMappingCBquery) { - String subQueryPropertyName = keepUserId_InScopeSubQuery_GroupMappingList(groupMappingCBquery);// for - // saving - // query - // - - // value - // . - registerInScopeSubQuery(groupMappingCBquery, "USER_ID", "USER_ID", - subQueryPropertyName); + public void setUserId_NotLikeSearch( + String userId, + jp.sf.pal.board.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(userId), getCValueUserId(), "USER_ID", "UserId", + "userId", likeSearchOption); } public void inScopeGroupMappingList(SubQuery subQuery) { @@ -187,42 +168,26 @@ cb.xsetupForInScopeSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepUserId_InScopeSubQuery_GroupMappingList(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerInScopeSubQuery(cb.query(), "USER_ID", "USER_ID", subQueryPropertyName); } - abstract public String keepUserId_InScopeSubQuery_GroupMappingList( + public abstract String keepUserId_InScopeSubQuery_GroupMappingList( GroupMappingCQ subQuery); - /** - * @param roleMappingCBquery Query. - * @deprecated Please use inScopeRoleMappingList(subQuery) method. - */ - public void setUserId_InScopeSubQuery_RoleMappingList( - RoleMappingCQ roleMappingCBquery) { - String subQueryPropertyName = keepUserId_InScopeSubQuery_RoleMappingList(roleMappingCBquery);// for - // saving - // query - // - - // value - // . - registerInScopeSubQuery(roleMappingCBquery, "USER_ID", "USER_ID", - subQueryPropertyName); - } - public void inScopeRoleMappingList(SubQuery subQuery) { assertObjectNotNull("subQuery", subQuery); RoleMappingCB cb = new RoleMappingCB(); cb.xsetupForInScopeSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepUserId_InScopeSubQuery_RoleMappingList(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerInScopeSubQuery(cb.query(), "USER_ID", "USER_ID", subQueryPropertyName); } - abstract public String keepUserId_InScopeSubQuery_RoleMappingList( + public abstract String keepUserId_InScopeSubQuery_RoleMappingList( RoleMappingCQ subQuery); public void notInScopeGroupMappingList(SubQuery subQuery) { @@ -231,12 +196,12 @@ cb.xsetupForInScopeSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepUserId_NotInScopeSubQuery_GroupMappingList(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerNotInScopeSubQuery(cb.query(), "USER_ID", "USER_ID", subQueryPropertyName); } - abstract public String keepUserId_NotInScopeSubQuery_GroupMappingList( + public abstract String keepUserId_NotInScopeSubQuery_GroupMappingList( GroupMappingCQ subQuery); public void notInScopeRoleMappingList(SubQuery subQuery) { @@ -245,31 +210,15 @@ cb.xsetupForInScopeSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepUserId_NotInScopeSubQuery_RoleMappingList(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerNotInScopeSubQuery(cb.query(), "USER_ID", "USER_ID", subQueryPropertyName); } - abstract public String keepUserId_NotInScopeSubQuery_RoleMappingList( + public abstract String keepUserId_NotInScopeSubQuery_RoleMappingList( RoleMappingCQ subQuery); /** - * @param groupMappingCBquery Query. - * @deprecated Please use existsGroupMappingList(subQuery) method. - */ - public void setUserId_ExistsSubQuery_GroupMappingList( - GroupMappingCQ groupMappingCBquery) { - String subQueryPropertyName = keepUserId_ExistsSubQuery_GroupMappingList(groupMappingCBquery);// for - // saving - // query - // - - // value - // . - registerExistsSubQuery(groupMappingCBquery, "USER_ID", "USER_ID", - subQueryPropertyName); - } - - /** * Set up 'exists' sub-query. {exists (select USER_ID from GROUP_MAPPING * where ...)} * @@ -282,31 +231,15 @@ cb.xsetupForExistsSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepUserId_ExistsSubQuery_GroupMappingList(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerExistsSubQuery(cb.query(), "USER_ID", "USER_ID", subQueryPropertyName); } - abstract public String keepUserId_ExistsSubQuery_GroupMappingList( + public abstract String keepUserId_ExistsSubQuery_GroupMappingList( GroupMappingCQ subQuery); /** - * @param roleMappingCBquery Query. - * @deprecated Please use existsRoleMappingList(subQuery) method. - */ - public void setUserId_ExistsSubQuery_RoleMappingList( - RoleMappingCQ roleMappingCBquery) { - String subQueryPropertyName = keepUserId_ExistsSubQuery_RoleMappingList(roleMappingCBquery);// for - // saving - // query - // - - // value - // . - registerExistsSubQuery(roleMappingCBquery, "USER_ID", "USER_ID", - subQueryPropertyName); - } - - /** * Set up 'exists' sub-query. {exists (select USER_ID from ROLE_MAPPING * where ...)} * @@ -319,12 +252,12 @@ cb.xsetupForExistsSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepUserId_ExistsSubQuery_RoleMappingList(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerExistsSubQuery(cb.query(), "USER_ID", "USER_ID", subQueryPropertyName); } - abstract public String keepUserId_ExistsSubQuery_RoleMappingList( + public abstract String keepUserId_ExistsSubQuery_RoleMappingList( RoleMappingCQ subQuery); /** @@ -341,12 +274,12 @@ cb.xsetupForExistsSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepUserId_NotExistsSubQuery_GroupMappingList(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerNotExistsSubQuery(cb.query(), "USER_ID", "USER_ID", subQueryPropertyName); } - abstract public String keepUserId_NotExistsSubQuery_GroupMappingList( + public abstract String keepUserId_NotExistsSubQuery_GroupMappingList( GroupMappingCQ subQuery); /** @@ -362,53 +295,53 @@ cb.xsetupForExistsSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepUserId_NotExistsSubQuery_RoleMappingList(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerNotExistsSubQuery(cb.query(), "USER_ID", "USER_ID", subQueryPropertyName); } - abstract public String keepUserId_NotExistsSubQuery_RoleMappingList( + public abstract String keepUserId_NotExistsSubQuery_RoleMappingList( RoleMappingCQ subQuery); public void xderiveGroupMappingList(String function, SubQuery subQuery, String aliasName) { assertObjectNotNull("subQuery", subQuery); GroupMappingCB cb = new GroupMappingCB(); - cb.xsetupForDeriveReferrer(); + cb.xsetupForDerivedReferrer(); subQuery.query(cb); - String subQueryPropertyName = keepUserId_DeriveSubQuery_GroupMappingList(cb - .query());// for saving query-value. - registerDeriveSubQuery(function, cb.query(), "USER_ID", "USER_ID", - subQueryPropertyName, aliasName); + String subQueryPropertyName = keepUserId_DerivedReferrer_GroupMappingList(cb + .query()); // for saving query-value. + registerDerivedReferrerSubQuery(function, cb.query(), "USER_ID", + "USER_ID", subQueryPropertyName, aliasName); } - abstract public String keepUserId_DeriveSubQuery_GroupMappingList( + public abstract String keepUserId_DerivedReferrer_GroupMappingList( GroupMappingCQ subQuery); public void xderiveRoleMappingList(String function, SubQuery subQuery, String aliasName) { assertObjectNotNull("subQuery", subQuery); RoleMappingCB cb = new RoleMappingCB(); - cb.xsetupForDeriveReferrer(); + cb.xsetupForDerivedReferrer(); subQuery.query(cb); - String subQueryPropertyName = keepUserId_DeriveSubQuery_RoleMappingList(cb - .query());// for saving query-value. - registerDeriveSubQuery(function, cb.query(), "USER_ID", "USER_ID", - subQueryPropertyName, aliasName); + String subQueryPropertyName = keepUserId_DerivedReferrer_RoleMappingList(cb + .query()); // for saving query-value. + registerDerivedReferrerSubQuery(function, cb.query(), "USER_ID", + "USER_ID", subQueryPropertyName, aliasName); } - abstract public String keepUserId_DeriveSubQuery_RoleMappingList( + public abstract String keepUserId_DerivedReferrer_RoleMappingList( RoleMappingCQ subQuery); /** - * IsNull(is null). And OnceRegistered. + * IsNull(is null). And OnlyOnceRegistered. */ public void setUserId_IsNull() { regUserId(CK_ISN, DUMMY_OBJECT); } /** - * IsNotNull(is not null). And OnceRegistered. + * IsNotNull(is not null). And OnlyOnceRegistered. */ public void setUserId_IsNotNull() { regUserId(CK_ISNN, DUMMY_OBJECT); @@ -427,7 +360,7 @@ abstract protected ConditionValue getCValueUserId(); /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {VARCHAR(100)} + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {VARCHAR(100)} * * @param givenName The value of givenName as equal. */ @@ -436,7 +369,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param givenName The value of givenName as notEqual. */ @@ -445,7 +378,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param givenName The value of givenName as greaterThan. */ @@ -454,7 +387,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param givenName The value of givenName as lessThan. */ @@ -463,7 +396,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param givenName The value of givenName as greaterEqual. */ @@ -472,7 +405,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param givenName The value of givenName as lessEqual. */ @@ -481,7 +414,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param givenName The value of givenName as prefixSearch. */ @@ -490,20 +423,6 @@ } /** - * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, - * SeveralRegistered. - * - * @param givenName The value of givenName as likeSearch. - * @param likeSearchOption The option of like-search. (NotNull) - */ - public void setGivenName_LikeSearch( - String givenName, - jp.sf.pal.board.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { - registerLikeSearchQuery(CK_LS, fRES(givenName), getCValueGivenName(), - "GIVEN_NAME", "GivenName", "givenName", likeSearchOption); - } - - /** * InScope(in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * @@ -514,38 +433,52 @@ } /** - * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * - * @param givenName The collection of givenName as inScope. - * @param inScopeOption The option of in-scope. (NotNull) + * @param givenNameList The collection of givenName as notInScope. */ - public void setGivenName_InScope( + public void setGivenName_NotInScope(Collection givenNameList) { + regGivenName(CK_NINS, cTL(givenNameList)); + } + + /** + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param givenName The value of givenName as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) + */ + public void setGivenName_LikeSearch( String givenName, - jp.sf.pal.board.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(givenName), getCValueGivenName(), - "GIVEN_NAME", "GivenName", "givenName", inScopeOption); + jp.sf.pal.board.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(givenName), getCValueGivenName(), "GIVEN_NAME", + "GivenName", "givenName", likeSearchOption); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param givenNameList The collection of givenName as notInScope. + * @param givenName The value of givenName as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setGivenName_NotInScope(Collection givenNameList) { - regGivenName(CK_NINS, cTL(givenNameList)); + public void setGivenName_NotLikeSearch( + String givenName, + jp.sf.pal.board.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(givenName), getCValueGivenName(), "GIVEN_NAME", + "GivenName", "givenName", likeSearchOption); } /** - * IsNull(is null). And OnceRegistered. + * IsNull(is null). And OnlyOnceRegistered. */ public void setGivenName_IsNull() { regGivenName(CK_ISN, DUMMY_OBJECT); } /** - * IsNotNull(is not null). And OnceRegistered. + * IsNotNull(is not null). And OnlyOnceRegistered. */ public void setGivenName_IsNotNull() { regGivenName(CK_ISNN, DUMMY_OBJECT); @@ -564,7 +497,7 @@ abstract protected ConditionValue getCValueGivenName(); /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {VARCHAR(100)} + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {VARCHAR(100)} * * @param familyName The value of familyName as equal. */ @@ -573,7 +506,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param familyName The value of familyName as notEqual. */ @@ -582,7 +515,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param familyName The value of familyName as greaterThan. */ @@ -591,7 +524,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param familyName The value of familyName as lessThan. */ @@ -600,7 +533,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param familyName The value of familyName as greaterEqual. */ @@ -609,7 +542,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param familyName The value of familyName as lessEqual. */ @@ -618,7 +551,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param familyName The value of familyName as prefixSearch. */ @@ -627,20 +560,6 @@ } /** - * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, - * SeveralRegistered. - * - * @param familyName The value of familyName as likeSearch. - * @param likeSearchOption The option of like-search. (NotNull) - */ - public void setFamilyName_LikeSearch( - String familyName, - jp.sf.pal.board.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { - registerLikeSearchQuery(CK_LS, fRES(familyName), getCValueFamilyName(), - "FAMILY_NAME", "FamilyName", "familyName", likeSearchOption); - } - - /** * InScope(in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * @@ -651,38 +570,52 @@ } /** - * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * - * @param familyName The collection of familyName as inScope. - * @param inScopeOption The option of in-scope. (NotNull) + * @param familyNameList The collection of familyName as notInScope. */ - public void setFamilyName_InScope( + public void setFamilyName_NotInScope(Collection familyNameList) { + regFamilyName(CK_NINS, cTL(familyNameList)); + } + + /** + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param familyName The value of familyName as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) + */ + public void setFamilyName_LikeSearch( String familyName, - jp.sf.pal.board.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(familyName), getCValueFamilyName(), - "FAMILY_NAME", "FamilyName", "familyName", inScopeOption); + jp.sf.pal.board.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(familyName), getCValueFamilyName(), "FAMILY_NAME", + "FamilyName", "familyName", likeSearchOption); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param familyNameList The collection of familyName as notInScope. + * @param familyName The value of familyName as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setFamilyName_NotInScope(Collection familyNameList) { - regFamilyName(CK_NINS, cTL(familyNameList)); + public void setFamilyName_NotLikeSearch( + String familyName, + jp.sf.pal.board.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(familyName), getCValueFamilyName(), "FAMILY_NAME", + "FamilyName", "familyName", likeSearchOption); } /** - * IsNull(is null). And OnceRegistered. + * IsNull(is null). And OnlyOnceRegistered. */ public void setFamilyName_IsNull() { regFamilyName(CK_ISN, DUMMY_OBJECT); } /** - * IsNotNull(is not null). And OnceRegistered. + * IsNotNull(is not null). And OnlyOnceRegistered. */ public void setFamilyName_IsNotNull() { regFamilyName(CK_ISNN, DUMMY_OBJECT); @@ -701,7 +634,7 @@ abstract protected ConditionValue getCValueFamilyName(); /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {VARCHAR(50)} + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {VARCHAR(50)} * * @param middleName The value of middleName as equal. */ @@ -710,7 +643,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param middleName The value of middleName as notEqual. */ @@ -719,7 +652,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param middleName The value of middleName as greaterThan. */ @@ -728,7 +661,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param middleName The value of middleName as lessThan. */ @@ -737,7 +670,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param middleName The value of middleName as greaterEqual. */ @@ -746,7 +679,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param middleName The value of middleName as lessEqual. */ @@ -755,7 +688,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param middleName The value of middleName as prefixSearch. */ @@ -764,20 +697,6 @@ } /** - * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, - * SeveralRegistered. - * - * @param middleName The value of middleName as likeSearch. - * @param likeSearchOption The option of like-search. (NotNull) - */ - public void setMiddleName_LikeSearch( - String middleName, - jp.sf.pal.board.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { - registerLikeSearchQuery(CK_LS, fRES(middleName), getCValueMiddleName(), - "MIDDLE_NAME", "MiddleName", "middleName", likeSearchOption); - } - - /** * InScope(in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * @@ -788,38 +707,52 @@ } /** - * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * - * @param middleName The collection of middleName as inScope. - * @param inScopeOption The option of in-scope. (NotNull) + * @param middleNameList The collection of middleName as notInScope. */ - public void setMiddleName_InScope( + public void setMiddleName_NotInScope(Collection middleNameList) { + regMiddleName(CK_NINS, cTL(middleNameList)); + } + + /** + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param middleName The value of middleName as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) + */ + public void setMiddleName_LikeSearch( String middleName, - jp.sf.pal.board.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(middleName), getCValueMiddleName(), - "MIDDLE_NAME", "MiddleName", "middleName", inScopeOption); + jp.sf.pal.board.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(middleName), getCValueMiddleName(), "MIDDLE_NAME", + "MiddleName", "middleName", likeSearchOption); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param middleNameList The collection of middleName as notInScope. + * @param middleName The value of middleName as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setMiddleName_NotInScope(Collection middleNameList) { - regMiddleName(CK_NINS, cTL(middleNameList)); + public void setMiddleName_NotLikeSearch( + String middleName, + jp.sf.pal.board.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(middleName), getCValueMiddleName(), "MIDDLE_NAME", + "MiddleName", "middleName", likeSearchOption); } /** - * IsNull(is null). And OnceRegistered. + * IsNull(is null). And OnlyOnceRegistered. */ public void setMiddleName_IsNull() { regMiddleName(CK_ISN, DUMMY_OBJECT); } /** - * IsNotNull(is not null). And OnceRegistered. + * IsNotNull(is not null). And OnlyOnceRegistered. */ public void setMiddleName_IsNotNull() { regMiddleName(CK_ISNN, DUMMY_OBJECT); @@ -838,7 +771,7 @@ abstract protected ConditionValue getCValueMiddleName(); /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {VARCHAR(100)} + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {VARCHAR(100)} * * @param givenNameDesc The value of givenNameDesc as equal. */ @@ -847,7 +780,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param givenNameDesc The value of givenNameDesc as notEqual. */ @@ -856,7 +789,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param givenNameDesc The value of givenNameDesc as greaterThan. */ @@ -865,7 +798,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param givenNameDesc The value of givenNameDesc as lessThan. */ @@ -874,7 +807,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param givenNameDesc The value of givenNameDesc as greaterEqual. */ @@ -883,7 +816,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param givenNameDesc The value of givenNameDesc as lessEqual. */ @@ -892,7 +825,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param givenNameDesc The value of givenNameDesc as prefixSearch. */ @@ -901,21 +834,6 @@ } /** - * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, - * SeveralRegistered. - * - * @param givenNameDesc The value of givenNameDesc as likeSearch. - * @param likeSearchOption The option of like-search. (NotNull) - */ - public void setGivenNameDesc_LikeSearch( - String givenNameDesc, - jp.sf.pal.board.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { - registerLikeSearchQuery(CK_LS, fRES(givenNameDesc), - getCValueGivenNameDesc(), "GIVEN_NAME_DESC", "GivenNameDesc", - "givenNameDesc", likeSearchOption); - } - - /** * InScope(in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * @@ -926,39 +844,54 @@ } /** - * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * - * @param givenNameDesc The collection of givenNameDesc as inScope. - * @param inScopeOption The option of in-scope. (NotNull) + * @param givenNameDescList The collection of givenNameDesc as notInScope. */ - public void setGivenNameDesc_InScope( + public void setGivenNameDesc_NotInScope(Collection givenNameDescList) { + regGivenNameDesc(CK_NINS, cTL(givenNameDescList)); + } + + /** + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param givenNameDesc The value of givenNameDesc as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) + */ + public void setGivenNameDesc_LikeSearch( String givenNameDesc, - jp.sf.pal.board.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(givenNameDesc), - getCValueGivenNameDesc(), "GIVEN_NAME_DESC", "GivenNameDesc", - "givenNameDesc", inScopeOption); + jp.sf.pal.board.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(givenNameDesc), getCValueGivenNameDesc(), + "GIVEN_NAME_DESC", "GivenNameDesc", "givenNameDesc", + likeSearchOption); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param givenNameDescList The collection of givenNameDesc as notInScope. + * @param givenNameDesc The value of givenNameDesc as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setGivenNameDesc_NotInScope(Collection givenNameDescList) { - regGivenNameDesc(CK_NINS, cTL(givenNameDescList)); + public void setGivenNameDesc_NotLikeSearch( + String givenNameDesc, + jp.sf.pal.board.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(givenNameDesc), getCValueGivenNameDesc(), + "GIVEN_NAME_DESC", "GivenNameDesc", "givenNameDesc", + likeSearchOption); } /** - * IsNull(is null). And OnceRegistered. + * IsNull(is null). And OnlyOnceRegistered. */ public void setGivenNameDesc_IsNull() { regGivenNameDesc(CK_ISN, DUMMY_OBJECT); } /** - * IsNotNull(is not null). And OnceRegistered. + * IsNotNull(is not null). And OnlyOnceRegistered. */ public void setGivenNameDesc_IsNotNull() { regGivenNameDesc(CK_ISNN, DUMMY_OBJECT); @@ -977,7 +910,7 @@ abstract protected ConditionValue getCValueGivenNameDesc(); /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {VARCHAR(100)} + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {VARCHAR(100)} * * @param familyNameDesc The value of familyNameDesc as equal. */ @@ -986,7 +919,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param familyNameDesc The value of familyNameDesc as notEqual. */ @@ -995,7 +928,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param familyNameDesc The value of familyNameDesc as greaterThan. */ @@ -1004,7 +937,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param familyNameDesc The value of familyNameDesc as lessThan. */ @@ -1013,7 +946,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param familyNameDesc The value of familyNameDesc as greaterEqual. */ @@ -1022,7 +955,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param familyNameDesc The value of familyNameDesc as lessEqual. */ @@ -1031,7 +964,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param familyNameDesc The value of familyNameDesc as prefixSearch. */ @@ -1040,21 +973,6 @@ } /** - * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, - * SeveralRegistered. - * - * @param familyNameDesc The value of familyNameDesc as likeSearch. - * @param likeSearchOption The option of like-search. (NotNull) - */ - public void setFamilyNameDesc_LikeSearch( - String familyNameDesc, - jp.sf.pal.board.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { - registerLikeSearchQuery(CK_LS, fRES(familyNameDesc), - getCValueFamilyNameDesc(), "FAMILY_NAME_DESC", - "FamilyNameDesc", "familyNameDesc", likeSearchOption); - } - - /** * InScope(in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * @@ -1065,40 +983,55 @@ } /** - * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * - * @param familyNameDesc The collection of familyNameDesc as inScope. - * @param inScopeOption The option of in-scope. (NotNull) + * @param familyNameDescList The collection of familyNameDesc as notInScope. */ - public void setFamilyNameDesc_InScope( + public void setFamilyNameDesc_NotInScope( + Collection familyNameDescList) { + regFamilyNameDesc(CK_NINS, cTL(familyNameDescList)); + } + + /** + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param familyNameDesc The value of familyNameDesc as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) + */ + public void setFamilyNameDesc_LikeSearch( String familyNameDesc, - jp.sf.pal.board.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(familyNameDesc), - getCValueFamilyNameDesc(), "FAMILY_NAME_DESC", - "FamilyNameDesc", "familyNameDesc", inScopeOption); + jp.sf.pal.board.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(familyNameDesc), getCValueFamilyNameDesc(), + "FAMILY_NAME_DESC", "FamilyNameDesc", "familyNameDesc", + likeSearchOption); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param familyNameDescList The collection of familyNameDesc as notInScope. + * @param familyNameDesc The value of familyNameDesc as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setFamilyNameDesc_NotInScope( - Collection familyNameDescList) { - regFamilyNameDesc(CK_NINS, cTL(familyNameDescList)); + public void setFamilyNameDesc_NotLikeSearch( + String familyNameDesc, + jp.sf.pal.board.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(familyNameDesc), getCValueFamilyNameDesc(), + "FAMILY_NAME_DESC", "FamilyNameDesc", "familyNameDesc", + likeSearchOption); } /** - * IsNull(is null). And OnceRegistered. + * IsNull(is null). And OnlyOnceRegistered. */ public void setFamilyNameDesc_IsNull() { regFamilyNameDesc(CK_ISN, DUMMY_OBJECT); } /** - * IsNotNull(is not null). And OnceRegistered. + * IsNotNull(is not null). And OnlyOnceRegistered. */ public void setFamilyNameDesc_IsNotNull() { regFamilyNameDesc(CK_ISNN, DUMMY_OBJECT); @@ -1117,7 +1050,7 @@ abstract protected ConditionValue getCValueFamilyNameDesc(); /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {VARCHAR(100)} + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {VARCHAR(100)} * * @param nickname The value of nickname as equal. */ @@ -1126,7 +1059,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param nickname The value of nickname as notEqual. */ @@ -1135,7 +1068,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param nickname The value of nickname as greaterThan. */ @@ -1144,7 +1077,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param nickname The value of nickname as lessThan. */ @@ -1153,7 +1086,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param nickname The value of nickname as greaterEqual. */ @@ -1162,7 +1095,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param nickname The value of nickname as lessEqual. */ @@ -1171,7 +1104,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param nickname The value of nickname as prefixSearch. */ @@ -1180,20 +1113,6 @@ } /** - * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, - * SeveralRegistered. - * - * @param nickname The value of nickname as likeSearch. - * @param likeSearchOption The option of like-search. (NotNull) - */ - public void setNickname_LikeSearch( - String nickname, - jp.sf.pal.board.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { - registerLikeSearchQuery(CK_LS, fRES(nickname), getCValueNickname(), - "NICKNAME", "Nickname", "nickname", likeSearchOption); - } - - /** * InScope(in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * @@ -1204,38 +1123,52 @@ } /** - * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * - * @param nickname The collection of nickname as inScope. - * @param inScopeOption The option of in-scope. (NotNull) + * @param nicknameList The collection of nickname as notInScope. */ - public void setNickname_InScope( + public void setNickname_NotInScope(Collection nicknameList) { + regNickname(CK_NINS, cTL(nicknameList)); + } + + /** + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param nickname The value of nickname as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) + */ + public void setNickname_LikeSearch( String nickname, - jp.sf.pal.board.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(nickname), getCValueNickname(), - "NICKNAME", "Nickname", "nickname", inScopeOption); + jp.sf.pal.board.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(nickname), getCValueNickname(), "NICKNAME", + "Nickname", "nickname", likeSearchOption); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param nicknameList The collection of nickname as notInScope. + * @param nickname The value of nickname as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setNickname_NotInScope(Collection nicknameList) { - regNickname(CK_NINS, cTL(nicknameList)); + public void setNickname_NotLikeSearch( + String nickname, + jp.sf.pal.board.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(nickname), getCValueNickname(), "NICKNAME", + "Nickname", "nickname", likeSearchOption); } /** - * IsNull(is null). And OnceRegistered. + * IsNull(is null). And OnlyOnceRegistered. */ public void setNickname_IsNull() { regNickname(CK_ISN, DUMMY_OBJECT); } /** - * IsNotNull(is not null). And OnceRegistered. + * IsNotNull(is not null). And OnlyOnceRegistered. */ public void setNickname_IsNotNull() { regNickname(CK_ISNN, DUMMY_OBJECT); @@ -1254,7 +1187,7 @@ abstract protected ConditionValue getCValueNickname(); /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {VARCHAR(1)} + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {VARCHAR(1)} * * @param gender The value of gender as equal. */ @@ -1263,7 +1196,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param gender The value of gender as notEqual. */ @@ -1272,7 +1205,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param gender The value of gender as greaterThan. */ @@ -1281,7 +1214,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param gender The value of gender as lessThan. */ @@ -1290,7 +1223,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param gender The value of gender as greaterEqual. */ @@ -1299,7 +1232,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param gender The value of gender as lessEqual. */ @@ -1308,7 +1241,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param gender The value of gender as prefixSearch. */ @@ -1317,20 +1250,6 @@ } /** - * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, - * SeveralRegistered. - * - * @param gender The value of gender as likeSearch. - * @param likeSearchOption The option of like-search. (NotNull) - */ - public void setGender_LikeSearch( - String gender, - jp.sf.pal.board.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { - registerLikeSearchQuery(CK_LS, fRES(gender), getCValueGender(), - "GENDER", "Gender", "gender", likeSearchOption); - } - - /** * InScope(in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * @@ -1341,38 +1260,52 @@ } /** - * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * - * @param gender The collection of gender as inScope. - * @param inScopeOption The option of in-scope. (NotNull) + * @param genderList The collection of gender as notInScope. */ - public void setGender_InScope( + public void setGender_NotInScope(Collection genderList) { + regGender(CK_NINS, cTL(genderList)); + } + + /** + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param gender The value of gender as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) + */ + public void setGender_LikeSearch( String gender, - jp.sf.pal.board.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(gender), getCValueGender(), "GENDER", - "Gender", "gender", inScopeOption); + jp.sf.pal.board.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(gender), getCValueGender(), "GENDER", "Gender", + "gender", likeSearchOption); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param genderList The collection of gender as notInScope. + * @param gender The value of gender as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setGender_NotInScope(Collection genderList) { - regGender(CK_NINS, cTL(genderList)); + public void setGender_NotLikeSearch( + String gender, + jp.sf.pal.board.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(gender), getCValueGender(), "GENDER", "Gender", + "gender", likeSearchOption); } /** - * IsNull(is null). And OnceRegistered. + * IsNull(is null). And OnlyOnceRegistered. */ public void setGender_IsNull() { regGender(CK_ISN, DUMMY_OBJECT); } /** - * IsNotNull(is not null). And OnceRegistered. + * IsNotNull(is not null). And OnlyOnceRegistered. */ public void setGender_IsNotNull() { regGender(CK_ISNN, DUMMY_OBJECT); @@ -1391,7 +1324,7 @@ abstract protected ConditionValue getCValueGender(); /** - * Equal(=). And NullIgnored, OnceRegistered. {DATE} + * Equal(=). And NullIgnored, OnlyOnceRegistered. {DATE} * * @param birthDate The value of birthDate as equal. */ @@ -1400,7 +1333,7 @@ } /** - * NotEqual(!=). And NullIgnored, OnceRegistered. + * NotEqual(!=). And NullIgnored, OnlyOnceRegistered. * * @param birthDate The value of birthDate as notEqual. */ @@ -1409,7 +1342,7 @@ } /** - * GreaterThan(>). And NullIgnored, OnceRegistered. + * GreaterThan(>). And NullIgnored, OnlyOnceRegistered. * * @param birthDate The value of birthDate as greaterThan. */ @@ -1418,7 +1351,7 @@ } /** - * LessThan(>). And NullIgnored, OnceRegistered. + * LessThan(>). And NullIgnored, OnlyOnceRegistered. * * @param birthDate The value of birthDate as lessThan. */ @@ -1427,7 +1360,7 @@ } /** - * GreaterEqual(>). And NullIgnored, OnceRegistered. + * GreaterEqual(>). And NullIgnored, OnlyOnceRegistered. * * @param birthDate The value of birthDate as greaterEqual. */ @@ -1436,7 +1369,7 @@ } /** - * LessEqual(>). And NullIgnored, OnceRegistered. + * LessEqual(>). And NullIgnored, OnlyOnceRegistered. * * @param birthDate The value of birthDate as lessEqual. */ @@ -1446,7 +1379,7 @@ /** * FromTo($fromDate <= COLUMN_NAME <= $toDate). And NullIgnored, - * OnceRegistered. {DATE} + * OnlyOnceRegistered. {DATE} * * @param fromDate The from-date of birthDate. (Nullable) * @param toDate The to-date of birthDate. (Nullable) @@ -1461,7 +1394,7 @@ /** * FromTo($fromDate <= COLUMN_NAME < $toDate + 1). And NullIgnored, - * OnceRegistered. {DATE} + * OnlyOnceRegistered. {DATE} * * @param fromDate The from-date of birthDate. (Nullable) * @param toDate The to-date of birthDate. (Nullable) @@ -1475,14 +1408,14 @@ } /** - * IsNull(is null). And OnceRegistered. + * IsNull(is null). And OnlyOnceRegistered. */ public void setBirthDate_IsNull() { regBirthDate(CK_ISN, DUMMY_OBJECT); } /** - * IsNotNull(is not null). And OnceRegistered. + * IsNotNull(is not null). And OnlyOnceRegistered. */ public void setBirthDate_IsNotNull() { regBirthDate(CK_ISNN, DUMMY_OBJECT); @@ -1501,7 +1434,7 @@ abstract protected ConditionValue getCValueBirthDate(); /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {VARCHAR(255)} + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {VARCHAR(255)} * * @param email The value of email as equal. */ @@ -1510,7 +1443,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param email The value of email as notEqual. */ @@ -1519,7 +1452,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param email The value of email as greaterThan. */ @@ -1528,7 +1461,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param email The value of email as lessThan. */ @@ -1537,7 +1470,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param email The value of email as greaterEqual. */ @@ -1546,7 +1479,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param email The value of email as lessEqual. */ @@ -1555,7 +1488,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param email The value of email as prefixSearch. */ @@ -1564,20 +1497,6 @@ } /** - * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, - * SeveralRegistered. - * - * @param email The value of email as likeSearch. - * @param likeSearchOption The option of like-search. (NotNull) - */ - public void setEmail_LikeSearch( - String email, - jp.sf.pal.board.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { - registerLikeSearchQuery(CK_LS, fRES(email), getCValueEmail(), "EMAIL", - "Email", "email", likeSearchOption); - } - - /** * InScope(in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * @@ -1588,38 +1507,52 @@ } /** - * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * - * @param email The collection of email as inScope. - * @param inScopeOption The option of in-scope. (NotNull) + * @param emailList The collection of email as notInScope. */ - public void setEmail_InScope( + public void setEmail_NotInScope(Collection emailList) { + regEmail(CK_NINS, cTL(emailList)); + } + + /** + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param email The value of email as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) + */ + public void setEmail_LikeSearch( String email, - jp.sf.pal.board.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(email), getCValueEmail(), "EMAIL", - "Email", "email", inScopeOption); + jp.sf.pal.board.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(email), getCValueEmail(), "EMAIL", "Email", "email", + likeSearchOption); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param emailList The collection of email as notInScope. + * @param email The value of email as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setEmail_NotInScope(Collection emailList) { - regEmail(CK_NINS, cTL(emailList)); + public void setEmail_NotLikeSearch( + String email, + jp.sf.pal.board.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(email), getCValueEmail(), "EMAIL", "Email", + "email", likeSearchOption); } /** - * IsNull(is null). And OnceRegistered. + * IsNull(is null). And OnlyOnceRegistered. */ public void setEmail_IsNull() { regEmail(CK_ISN, DUMMY_OBJECT); } /** - * IsNotNull(is not null). And OnceRegistered. + * IsNotNull(is not null). And OnlyOnceRegistered. */ public void setEmail_IsNotNull() { regEmail(CK_ISNN, DUMMY_OBJECT); @@ -1637,7 +1570,7 @@ abstract protected ConditionValue getCValueEmail(); /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {VARCHAR(255)} + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {VARCHAR(255)} * * @param url The value of url as equal. */ @@ -1646,7 +1579,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param url The value of url as notEqual. */ @@ -1655,7 +1588,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param url The value of url as greaterThan. */ @@ -1664,7 +1597,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param url The value of url as lessThan. */ @@ -1673,7 +1606,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param url The value of url as greaterEqual. */ @@ -1682,7 +1615,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param url The value of url as lessEqual. */ @@ -1691,7 +1624,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param url The value of url as prefixSearch. */ @@ -1700,20 +1633,6 @@ } /** - * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, - * SeveralRegistered. - * - * @param url The value of url as likeSearch. - * @param likeSearchOption The option of like-search. (NotNull) - */ - public void setUrl_LikeSearch( - String url, - jp.sf.pal.board.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { - registerLikeSearchQuery(CK_LS, fRES(url), getCValueUrl(), "URL", "Url", - "url", likeSearchOption); - } - - /** * InScope(in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * @@ -1724,38 +1643,52 @@ } /** - * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * - * @param url The collection of url as inScope. - * @param inScopeOption The option of in-scope. (NotNull) + * @param urlList The collection of url as notInScope. */ - public void setUrl_InScope( + public void setUrl_NotInScope(Collection urlList) { + regUrl(CK_NINS, cTL(urlList)); + } + + /** + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param url The value of url as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) + */ + public void setUrl_LikeSearch( String url, - jp.sf.pal.board.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(url), getCValueUrl(), "URL", "Url", - "url", inScopeOption); + jp.sf.pal.board.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(url), getCValueUrl(), "URL", "Url", "url", + likeSearchOption); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param urlList The collection of url as notInScope. + * @param url The value of url as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setUrl_NotInScope(Collection urlList) { - regUrl(CK_NINS, cTL(urlList)); + public void setUrl_NotLikeSearch( + String url, + jp.sf.pal.board.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(url), getCValueUrl(), "URL", "Url", "url", + likeSearchOption); } /** - * IsNull(is null). And OnceRegistered. + * IsNull(is null). And OnlyOnceRegistered. */ public void setUrl_IsNull() { regUrl(CK_ISN, DUMMY_OBJECT); } /** - * IsNotNull(is not null). And OnceRegistered. + * IsNotNull(is not null). And OnlyOnceRegistered. */ public void setUrl_IsNotNull() { regUrl(CK_ISNN, DUMMY_OBJECT); @@ -1772,7 +1705,7 @@ abstract protected ConditionValue getCValueUrl(); /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {VARCHAR(40)} + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {VARCHAR(40)} * * @param telephone The value of telephone as equal. */ @@ -1781,7 +1714,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param telephone The value of telephone as notEqual. */ @@ -1790,7 +1723,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param telephone The value of telephone as greaterThan. */ @@ -1799,7 +1732,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param telephone The value of telephone as lessThan. */ @@ -1808,7 +1741,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param telephone The value of telephone as greaterEqual. */ @@ -1817,7 +1750,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param telephone The value of telephone as lessEqual. */ @@ -1826,7 +1759,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param telephone The value of telephone as prefixSearch. */ @@ -1835,20 +1768,6 @@ } /** - * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, - * SeveralRegistered. - * - * @param telephone The value of telephone as likeSearch. - * @param likeSearchOption The option of like-search. (NotNull) - */ - public void setTelephone_LikeSearch( - String telephone, - jp.sf.pal.board.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { - registerLikeSearchQuery(CK_LS, fRES(telephone), getCValueTelephone(), - "TELEPHONE", "Telephone", "telephone", likeSearchOption); - } - - /** * InScope(in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * @@ -1859,38 +1778,52 @@ } /** - * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * - * @param telephone The collection of telephone as inScope. - * @param inScopeOption The option of in-scope. (NotNull) + * @param telephoneList The collection of telephone as notInScope. */ - public void setTelephone_InScope( + public void setTelephone_NotInScope(Collection telephoneList) { + regTelephone(CK_NINS, cTL(telephoneList)); + } + + /** + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param telephone The value of telephone as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) + */ + public void setTelephone_LikeSearch( String telephone, - jp.sf.pal.board.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(telephone), getCValueTelephone(), - "TELEPHONE", "Telephone", "telephone", inScopeOption); + jp.sf.pal.board.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(telephone), getCValueTelephone(), "TELEPHONE", + "Telephone", "telephone", likeSearchOption); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param telephoneList The collection of telephone as notInScope. + * @param telephone The value of telephone as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setTelephone_NotInScope(Collection telephoneList) { - regTelephone(CK_NINS, cTL(telephoneList)); + public void setTelephone_NotLikeSearch( + String telephone, + jp.sf.pal.board.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(telephone), getCValueTelephone(), "TELEPHONE", + "Telephone", "telephone", likeSearchOption); } /** - * IsNull(is null). And OnceRegistered. + * IsNull(is null). And OnlyOnceRegistered. */ public void setTelephone_IsNull() { regTelephone(CK_ISN, DUMMY_OBJECT); } /** - * IsNotNull(is not null). And OnceRegistered. + * IsNotNull(is not null). And OnlyOnceRegistered. */ public void setTelephone_IsNotNull() { regTelephone(CK_ISNN, DUMMY_OBJECT); @@ -1909,7 +1842,7 @@ abstract protected ConditionValue getCValueTelephone(); /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {VARCHAR(5)} + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {VARCHAR(5)} * * @param locale The value of locale as equal. */ @@ -1918,7 +1851,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param locale The value of locale as notEqual. */ @@ -1927,7 +1860,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param locale The value of locale as greaterThan. */ @@ -1936,7 +1869,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param locale The value of locale as lessThan. */ @@ -1945,7 +1878,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param locale The value of locale as greaterEqual. */ @@ -1954,7 +1887,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param locale The value of locale as lessEqual. */ @@ -1963,7 +1896,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param locale The value of locale as prefixSearch. */ @@ -1972,20 +1905,6 @@ } /** - * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, - * SeveralRegistered. - * - * @param locale The value of locale as likeSearch. - * @param likeSearchOption The option of like-search. (NotNull) - */ - public void setLocale_LikeSearch( - String locale, - jp.sf.pal.board.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { - registerLikeSearchQuery(CK_LS, fRES(locale), getCValueLocale(), - "LOCALE", "Locale", "locale", likeSearchOption); - } - - /** * InScope(in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * @@ -1996,38 +1915,52 @@ } /** - * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * - * @param locale The collection of locale as inScope. - * @param inScopeOption The option of in-scope. (NotNull) + * @param localeList The collection of locale as notInScope. */ - public void setLocale_InScope( + public void setLocale_NotInScope(Collection localeList) { + regLocale(CK_NINS, cTL(localeList)); + } + + /** + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param locale The value of locale as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) + */ + public void setLocale_LikeSearch( String locale, - jp.sf.pal.board.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(locale), getCValueLocale(), "LOCALE", - "Locale", "locale", inScopeOption); + jp.sf.pal.board.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(locale), getCValueLocale(), "LOCALE", "Locale", + "locale", likeSearchOption); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param localeList The collection of locale as notInScope. + * @param locale The value of locale as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setLocale_NotInScope(Collection localeList) { - regLocale(CK_NINS, cTL(localeList)); + public void setLocale_NotLikeSearch( + String locale, + jp.sf.pal.board.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(locale), getCValueLocale(), "LOCALE", "Locale", + "locale", likeSearchOption); } /** - * IsNull(is null). And OnceRegistered. + * IsNull(is null). And OnlyOnceRegistered. */ public void setLocale_IsNull() { regLocale(CK_ISN, DUMMY_OBJECT); } /** - * IsNotNull(is not null). And OnceRegistered. + * IsNotNull(is not null). And OnlyOnceRegistered. */ public void setLocale_IsNotNull() { regLocale(CK_ISNN, DUMMY_OBJECT); @@ -2046,8 +1979,8 @@ abstract protected ConditionValue getCValueLocale(); /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {VARCHAR(255) : FK to - * ROLE_INFO} + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {VARCHAR(255) : FK + * to ROLE_INFO} * * @param roleId The value of roleId as equal. */ @@ -2056,7 +1989,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param roleId The value of roleId as notEqual. */ @@ -2065,7 +1998,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param roleId The value of roleId as greaterThan. */ @@ -2074,7 +2007,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param roleId The value of roleId as lessThan. */ @@ -2083,7 +2016,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param roleId The value of roleId as greaterEqual. */ @@ -2092,7 +2025,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param roleId The value of roleId as lessEqual. */ @@ -2101,7 +2034,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param roleId The value of roleId as prefixSearch. */ @@ -2110,20 +2043,6 @@ } /** - * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, - * SeveralRegistered. - * - * @param roleId The value of roleId as likeSearch. - * @param likeSearchOption The option of like-search. (NotNull) - */ - public void setRoleId_LikeSearch( - String roleId, - jp.sf.pal.board.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { - registerLikeSearchQuery(CK_LS, fRES(roleId), getCValueRoleId(), - "ROLE_ID", "RoleId", "roleId", likeSearchOption); - } - - /** * InScope(in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * @@ -2134,42 +2053,41 @@ } /** - * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * - * @param roleId The collection of roleId as inScope. - * @param inScopeOption The option of in-scope. (NotNull) + * @param roleIdList The collection of roleId as notInScope. */ - public void setRoleId_InScope( - String roleId, - jp.sf.pal.board.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(roleId), getCValueRoleId(), - "ROLE_ID", "RoleId", "roleId", inScopeOption); + public void setRoleId_NotInScope(Collection roleIdList) { + regRoleId(CK_NINS, cTL(roleIdList)); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param roleIdList The collection of roleId as notInScope. + * @param roleId The value of roleId as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) */ - public void setRoleId_NotInScope(Collection roleIdList) { - regRoleId(CK_NINS, cTL(roleIdList)); + public void setRoleId_LikeSearch( + String roleId, + jp.sf.pal.board.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(roleId), getCValueRoleId(), "ROLE_ID", "RoleId", + "roleId", likeSearchOption); } /** - * @param roleInfoCBquery Query. - * @deprecated Please use inScopeRoleInfo(subQuery) method. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param roleId The value of roleId as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setRoleId_InScopeSubQuery_RoleInfo(RoleInfoCQ roleInfoCBquery) { - String subQueryPropertyName = keepRoleId_InScopeSubQuery_RoleInfo(roleInfoCBquery);// for - // saving - // query - // - - // value - // . - registerInScopeSubQuery(roleInfoCBquery, "ROLE_ID", "ROLE_ID", - subQueryPropertyName); + public void setRoleId_NotLikeSearch( + String roleId, + jp.sf.pal.board.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(roleId), getCValueRoleId(), "ROLE_ID", "RoleId", + "roleId", likeSearchOption); } public void inScopeRoleInfo(SubQuery subQuery) { @@ -2178,23 +2096,23 @@ cb.xsetupForInScopeSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepRoleId_InScopeSubQuery_RoleInfo(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerInScopeSubQuery(cb.query(), "ROLE_ID", "ROLE_ID", subQueryPropertyName); } - abstract public String keepRoleId_InScopeSubQuery_RoleInfo( + public abstract String keepRoleId_InScopeSubQuery_RoleInfo( jp.sf.pal.board.db.cbean.cq.RoleInfoCQ subQuery); /** - * IsNull(is null). And OnceRegistered. + * IsNull(is null). And OnlyOnceRegistered. */ public void setRoleId_IsNull() { regRoleId(CK_ISN, DUMMY_OBJECT); } /** - * IsNotNull(is not null). And OnceRegistered. + * IsNotNull(is not null). And OnlyOnceRegistered. */ public void setRoleId_IsNotNull() { regRoleId(CK_ISNN, DUMMY_OBJECT); @@ -2213,8 +2131,8 @@ abstract protected ConditionValue getCValueRoleId(); /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {VARCHAR(255) : FK to - * GROUP_INFO} + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {VARCHAR(255) : FK + * to GROUP_INFO} * * @param groupId The value of groupId as equal. */ @@ -2223,7 +2141,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param groupId The value of groupId as notEqual. */ @@ -2232,7 +2150,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param groupId The value of groupId as greaterThan. */ @@ -2241,7 +2159,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param groupId The value of groupId as lessThan. */ @@ -2250,7 +2168,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param groupId The value of groupId as greaterEqual. */ @@ -2259,7 +2177,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param groupId The value of groupId as lessEqual. */ @@ -2268,7 +2186,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param groupId The value of groupId as prefixSearch. */ @@ -2277,20 +2195,6 @@ } /** - * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, - * SeveralRegistered. - * - * @param groupId The value of groupId as likeSearch. - * @param likeSearchOption The option of like-search. (NotNull) - */ - public void setGroupId_LikeSearch( - String groupId, - jp.sf.pal.board.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { - registerLikeSearchQuery(CK_LS, fRES(groupId), getCValueGroupId(), - "GROUP_ID", "GroupId", "groupId", likeSearchOption); - } - - /** * InScope(in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * @@ -2301,43 +2205,41 @@ } /** - * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * - * @param groupId The collection of groupId as inScope. - * @param inScopeOption The option of in-scope. (NotNull) + * @param groupIdList The collection of groupId as notInScope. */ - public void setGroupId_InScope( - String groupId, - jp.sf.pal.board.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(groupId), getCValueGroupId(), - "GROUP_ID", "GroupId", "groupId", inScopeOption); + public void setGroupId_NotInScope(Collection groupIdList) { + regGroupId(CK_NINS, cTL(groupIdList)); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param groupIdList The collection of groupId as notInScope. + * @param groupId The value of groupId as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) */ - public void setGroupId_NotInScope(Collection groupIdList) { - regGroupId(CK_NINS, cTL(groupIdList)); + public void setGroupId_LikeSearch( + String groupId, + jp.sf.pal.board.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(groupId), getCValueGroupId(), "GROUP_ID", "GroupId", + "groupId", likeSearchOption); } /** - * @param groupInfoCBquery Query. - * @deprecated Please use inScopeGroupInfo(subQuery) method. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param groupId The value of groupId as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setGroupId_InScopeSubQuery_GroupInfo( - GroupInfoCQ groupInfoCBquery) { - String subQueryPropertyName = keepGroupId_InScopeSubQuery_GroupInfo(groupInfoCBquery);// for - // saving - // query - // - - // value - // . - registerInScopeSubQuery(groupInfoCBquery, "GROUP_ID", "GROUP_ID", - subQueryPropertyName); + public void setGroupId_NotLikeSearch( + String groupId, + jp.sf.pal.board.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(groupId), getCValueGroupId(), "GROUP_ID", + "GroupId", "groupId", likeSearchOption); } public void inScopeGroupInfo(SubQuery subQuery) { @@ -2346,23 +2248,23 @@ cb.xsetupForInScopeSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepGroupId_InScopeSubQuery_GroupInfo(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerInScopeSubQuery(cb.query(), "GROUP_ID", "GROUP_ID", subQueryPropertyName); } - abstract public String keepGroupId_InScopeSubQuery_GroupInfo( + public abstract String keepGroupId_InScopeSubQuery_GroupInfo( jp.sf.pal.board.db.cbean.cq.GroupInfoCQ subQuery); /** - * IsNull(is null). And OnceRegistered. + * IsNull(is null). And OnlyOnceRegistered. */ public void setGroupId_IsNull() { regGroupId(CK_ISN, DUMMY_OBJECT); } /** - * IsNotNull(is not null). And OnceRegistered. + * IsNotNull(is not null). And OnlyOnceRegistered. */ public void setGroupId_IsNotNull() { regGroupId(CK_ISNN, DUMMY_OBJECT); @@ -2381,8 +2283,145 @@ abstract protected ConditionValue getCValueGroupId(); /** - * Equal(=). And NullIgnored, OnceRegistered. {NotNull : TIMESTAMP} + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {VARCHAR(1)} * + * @param status The value of status as equal. + */ + public void setStatus_Equal(String status) { + regStatus(CK_EQ, fRES(status)); + } + + /** + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. + * + * @param status The value of status as notEqual. + */ + public void setStatus_NotEqual(String status) { + regStatus(CK_NE, fRES(status)); + } + + /** + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. + * + * @param status The value of status as greaterThan. + */ + public void setStatus_GreaterThan(String status) { + regStatus(CK_GT, fRES(status)); + } + + /** + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. + * + * @param status The value of status as lessThan. + */ + public void setStatus_LessThan(String status) { + regStatus(CK_LT, fRES(status)); + } + + /** + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. + * + * @param status The value of status as greaterEqual. + */ + public void setStatus_GreaterEqual(String status) { + regStatus(CK_GE, fRES(status)); + } + + /** + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. + * + * @param status The value of status as lessEqual. + */ + public void setStatus_LessEqual(String status) { + regStatus(CK_LE, fRES(status)); + } + + /** + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. + * + * @param status The value of status as prefixSearch. + */ + public void setStatus_PrefixSearch(String status) { + regStatus(CK_PS, fRES(status)); + } + + /** + * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NullOrEmptyElementIgnored, SeveralRegistered. + * + * @param statusList The collection of status as inScope. + */ + public void setStatus_InScope(Collection statusList) { + regStatus(CK_INS, cTL(statusList)); + } + + /** + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, + * NullOrEmptyElementIgnored, SeveralRegistered. + * + * @param statusList The collection of status as notInScope. + */ + public void setStatus_NotInScope(Collection statusList) { + regStatus(CK_NINS, cTL(statusList)); + } + + /** + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param status The value of status as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) + */ + public void setStatus_LikeSearch( + String status, + jp.sf.pal.board.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(status), getCValueStatus(), "STATUS", "Status", + "status", likeSearchOption); + } + + /** + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param status The value of status as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) + */ + public void setStatus_NotLikeSearch( + String status, + jp.sf.pal.board.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(status), getCValueStatus(), "STATUS", "Status", + "status", likeSearchOption); + } + + /** + * IsNull(is null). And OnlyOnceRegistered. + */ + public void setStatus_IsNull() { + regStatus(CK_ISN, DUMMY_OBJECT); + } + + /** + * IsNotNull(is not null). And OnlyOnceRegistered. + */ + public void setStatus_IsNotNull() { + regStatus(CK_ISNN, DUMMY_OBJECT); + } + + protected void regStatus(ConditionKey key, Object value) { + registerQuery(key, value, getCValueStatus(), "STATUS", "Status", + "status"); + } + + protected void registerInlineStatus(ConditionKey key, Object value) { + registerInlineQuery(key, value, getCValueStatus(), "STATUS", "Status", + "status"); + } + + abstract protected ConditionValue getCValueStatus(); + + /** + * Equal(=). And NullIgnored, OnlyOnceRegistered. {NotNull : TIMESTAMP} + * * @param createdTime The value of createdTime as equal. */ public void setCreatedTime_Equal(java.sql.Timestamp createdTime) { @@ -2390,7 +2429,7 @@ } /** - * NotEqual(!=). And NullIgnored, OnceRegistered. + * NotEqual(!=). And NullIgnored, OnlyOnceRegistered. * * @param createdTime The value of createdTime as notEqual. */ @@ -2399,7 +2438,7 @@ } /** - * GreaterThan(>). And NullIgnored, OnceRegistered. + * GreaterThan(>). And NullIgnored, OnlyOnceRegistered. * * @param createdTime The value of createdTime as greaterThan. */ @@ -2408,7 +2447,7 @@ } /** - * LessThan(>). And NullIgnored, OnceRegistered. + * LessThan(>). And NullIgnored, OnlyOnceRegistered. * * @param createdTime The value of createdTime as lessThan. */ @@ -2417,7 +2456,7 @@ } /** - * GreaterEqual(>). And NullIgnored, OnceRegistered. + * GreaterEqual(>). And NullIgnored, OnlyOnceRegistered. * * @param createdTime The value of createdTime as greaterEqual. */ @@ -2426,7 +2465,7 @@ } /** - * LessEqual(>). And NullIgnored, OnceRegistered. + * LessEqual(>). And NullIgnored, OnlyOnceRegistered. * * @param createdTime The value of createdTime as lessEqual. */ @@ -2436,7 +2475,7 @@ /** * FromTo($fromDate <= COLUMN_NAME <= $toDate). And NullIgnored, - * OnceRegistered. {NotNull : TIMESTAMP} + * OnlyOnceRegistered. {NotNull : TIMESTAMP} * * @param fromDate The from-date of createdTime. (Nullable) * @param toDate The to-date of createdTime. (Nullable) @@ -2453,7 +2492,7 @@ /** * FromTo($fromDate <= COLUMN_NAME < $toDate + 1). And NullIgnored, - * OnceRegistered. {NotNull : TIMESTAMP} + * OnlyOnceRegistered. {NotNull : TIMESTAMP} * * @param fromDate The from-date of createdTime. (Nullable) * @param toDate The to-date of createdTime. (Nullable) @@ -2479,7 +2518,7 @@ abstract protected ConditionValue getCValueCreatedTime(); /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {NotNull : + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {NotNull : * VARCHAR(255)} * * @param createdBy The value of createdBy as equal. @@ -2489,7 +2528,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param createdBy The value of createdBy as notEqual. */ @@ -2498,7 +2537,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param createdBy The value of createdBy as greaterThan. */ @@ -2507,7 +2546,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param createdBy The value of createdBy as lessThan. */ @@ -2516,7 +2555,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param createdBy The value of createdBy as greaterEqual. */ @@ -2525,7 +2564,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param createdBy The value of createdBy as lessEqual. */ @@ -2534,7 +2573,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param createdBy The value of createdBy as prefixSearch. */ @@ -2543,20 +2582,6 @@ } /** - * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, - * SeveralRegistered. - * - * @param createdBy The value of createdBy as likeSearch. - * @param likeSearchOption The option of like-search. (NotNull) - */ - public void setCreatedBy_LikeSearch( - String createdBy, - jp.sf.pal.board.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { - registerLikeSearchQuery(CK_LS, fRES(createdBy), getCValueCreatedBy(), - "CREATED_BY", "CreatedBy", "createdBy", likeSearchOption); - } - - /** * InScope(in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * @@ -2567,27 +2592,41 @@ } /** - * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * - * @param createdBy The collection of createdBy as inScope. - * @param inScopeOption The option of in-scope. (NotNull) + * @param createdByList The collection of createdBy as notInScope. */ - public void setCreatedBy_InScope( + public void setCreatedBy_NotInScope(Collection createdByList) { + regCreatedBy(CK_NINS, cTL(createdByList)); + } + + /** + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param createdBy The value of createdBy as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) + */ + public void setCreatedBy_LikeSearch( String createdBy, - jp.sf.pal.board.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(createdBy), getCValueCreatedBy(), - "CREATED_BY", "CreatedBy", "createdBy", inScopeOption); + jp.sf.pal.board.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(createdBy), getCValueCreatedBy(), "CREATED_BY", + "CreatedBy", "createdBy", likeSearchOption); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param createdByList The collection of createdBy as notInScope. + * @param createdBy The value of createdBy as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setCreatedBy_NotInScope(Collection createdByList) { - regCreatedBy(CK_NINS, cTL(createdByList)); + public void setCreatedBy_NotLikeSearch( + String createdBy, + jp.sf.pal.board.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(createdBy), getCValueCreatedBy(), "CREATED_BY", + "CreatedBy", "createdBy", likeSearchOption); } protected void regCreatedBy(ConditionKey key, Object value) { @@ -2603,7 +2642,7 @@ abstract protected ConditionValue getCValueCreatedBy(); /** - * Equal(=). And NullIgnored, OnceRegistered. {NotNull : TIMESTAMP} + * Equal(=). And NullIgnored, OnlyOnceRegistered. {NotNull : TIMESTAMP} * * @param updatedTime The value of updatedTime as equal. */ @@ -2612,7 +2651,7 @@ } /** - * NotEqual(!=). And NullIgnored, OnceRegistered. + * NotEqual(!=). And NullIgnored, OnlyOnceRegistered. * * @param updatedTime The value of updatedTime as notEqual. */ @@ -2621,7 +2660,7 @@ } /** - * GreaterThan(>). And NullIgnored, OnceRegistered. + * GreaterThan(>). And NullIgnored, OnlyOnceRegistered. * * @param updatedTime The value of updatedTime as greaterThan. */ @@ -2630,7 +2669,7 @@ } /** - * LessThan(>). And NullIgnored, OnceRegistered. + * LessThan(>). And NullIgnored, OnlyOnceRegistered. * * @param updatedTime The value of updatedTime as lessThan. */ @@ -2639,7 +2678,7 @@ } /** - * GreaterEqual(>). And NullIgnored, OnceRegistered. + * GreaterEqual(>). And NullIgnored, OnlyOnceRegistered. * * @param updatedTime The value of updatedTime as greaterEqual. */ @@ -2648,7 +2687,7 @@ } /** - * LessEqual(>). And NullIgnored, OnceRegistered. + * LessEqual(>). And NullIgnored, OnlyOnceRegistered. * * @param updatedTime The value of updatedTime as lessEqual. */ @@ -2658,7 +2697,7 @@ /** * FromTo($fromDate <= COLUMN_NAME <= $toDate). And NullIgnored, - * OnceRegistered. {NotNull : TIMESTAMP} + * OnlyOnceRegistered. {NotNull : TIMESTAMP} * * @param fromDate The from-date of updatedTime. (Nullable) * @param toDate The to-date of updatedTime. (Nullable) @@ -2675,7 +2714,7 @@ /** * FromTo($fromDate <= COLUMN_NAME < $toDate + 1). And NullIgnored, - * OnceRegistered. {NotNull : TIMESTAMP} + * OnlyOnceRegistered. {NotNull : TIMESTAMP} * * @param fromDate The from-date of updatedTime. (Nullable) * @param toDate The to-date of updatedTime. (Nullable) @@ -2701,7 +2740,7 @@ abstract protected ConditionValue getCValueUpdatedTime(); /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {NotNull : + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {NotNull : * VARCHAR(255)} * * @param updatedBy The value of updatedBy as equal. @@ -2711,7 +2750,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param updatedBy The value of updatedBy as notEqual. */ @@ -2720,7 +2759,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param updatedBy The value of updatedBy as greaterThan. */ @@ -2729,7 +2768,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param updatedBy The value of updatedBy as lessThan. */ @@ -2738,7 +2777,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param updatedBy The value of updatedBy as greaterEqual. */ @@ -2747,7 +2786,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param updatedBy The value of updatedBy as lessEqual. */ @@ -2756,7 +2795,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param updatedBy The value of updatedBy as prefixSearch. */ @@ -2765,20 +2804,6 @@ } /** - * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, - * SeveralRegistered. - * - * @param updatedBy The value of updatedBy as likeSearch. - * @param likeSearchOption The option of like-search. (NotNull) - */ - public void setUpdatedBy_LikeSearch( - String updatedBy, - jp.sf.pal.board.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { - registerLikeSearchQuery(CK_LS, fRES(updatedBy), getCValueUpdatedBy(), - "UPDATED_BY", "UpdatedBy", "updatedBy", likeSearchOption); - } - - /** * InScope(in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * @@ -2789,27 +2814,41 @@ } /** - * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * - * @param updatedBy The collection of updatedBy as inScope. - * @param inScopeOption The option of in-scope. (NotNull) + * @param updatedByList The collection of updatedBy as notInScope. */ - public void setUpdatedBy_InScope( + public void setUpdatedBy_NotInScope(Collection updatedByList) { + regUpdatedBy(CK_NINS, cTL(updatedByList)); + } + + /** + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param updatedBy The value of updatedBy as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) + */ + public void setUpdatedBy_LikeSearch( String updatedBy, - jp.sf.pal.board.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(updatedBy), getCValueUpdatedBy(), - "UPDATED_BY", "UpdatedBy", "updatedBy", inScopeOption); + jp.sf.pal.board.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(updatedBy), getCValueUpdatedBy(), "UPDATED_BY", + "UpdatedBy", "updatedBy", likeSearchOption); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param updatedByList The collection of updatedBy as notInScope. + * @param updatedBy The value of updatedBy as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setUpdatedBy_NotInScope(Collection updatedByList) { - regUpdatedBy(CK_NINS, cTL(updatedByList)); + public void setUpdatedBy_NotLikeSearch( + String updatedBy, + jp.sf.pal.board.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(updatedBy), getCValueUpdatedBy(), "UPDATED_BY", + "UpdatedBy", "updatedBy", likeSearchOption); } protected void regUpdatedBy(ConditionKey key, Object value) { @@ -2825,7 +2864,7 @@ abstract protected ConditionValue getCValueUpdatedBy(); /** - * Equal(=). And NullIgnored, OnceRegistered. {TIMESTAMP} + * Equal(=). And NullIgnored, OnlyOnceRegistered. {TIMESTAMP} * * @param deletedTime The value of deletedTime as equal. */ @@ -2834,7 +2873,7 @@ } /** - * NotEqual(!=). And NullIgnored, OnceRegistered. + * NotEqual(!=). And NullIgnored, OnlyOnceRegistered. * * @param deletedTime The value of deletedTime as notEqual. */ @@ -2843,7 +2882,7 @@ } /** - * GreaterThan(>). And NullIgnored, OnceRegistered. + * GreaterThan(>). And NullIgnored, OnlyOnceRegistered. * * @param deletedTime The value of deletedTime as greaterThan. */ @@ -2852,7 +2891,7 @@ } /** - * LessThan(>). And NullIgnored, OnceRegistered. + * LessThan(>). And NullIgnored, OnlyOnceRegistered. * * @param deletedTime The value of deletedTime as lessThan. */ @@ -2861,7 +2900,7 @@ } /** - * GreaterEqual(>). And NullIgnored, OnceRegistered. + * GreaterEqual(>). And NullIgnored, OnlyOnceRegistered. * * @param deletedTime The value of deletedTime as greaterEqual. */ @@ -2870,7 +2909,7 @@ } /** - * LessEqual(>). And NullIgnored, OnceRegistered. + * LessEqual(>). And NullIgnored, OnlyOnceRegistered. * * @param deletedTime The value of deletedTime as lessEqual. */ @@ -2880,7 +2919,7 @@ /** * FromTo($fromDate <= COLUMN_NAME <= $toDate). And NullIgnored, - * OnceRegistered. {TIMESTAMP} + * OnlyOnceRegistered. {TIMESTAMP} * * @param fromDate The from-date of deletedTime. (Nullable) * @param toDate The to-date of deletedTime. (Nullable) @@ -2897,7 +2936,7 @@ /** * FromTo($fromDate <= COLUMN_NAME < $toDate + 1). And NullIgnored, - * OnceRegistered. {TIMESTAMP} + * OnlyOnceRegistered. {TIMESTAMP} * * @param fromDate The from-date of deletedTime. (Nullable) * @param toDate The to-date of deletedTime. (Nullable) @@ -2911,14 +2950,14 @@ } /** - * IsNull(is null). And OnceRegistered. + * IsNull(is null). And OnlyOnceRegistered. */ public void setDeletedTime_IsNull() { regDeletedTime(CK_ISN, DUMMY_OBJECT); } /** - * IsNotNull(is not null). And OnceRegistered. + * IsNotNull(is not null). And OnlyOnceRegistered. */ public void setDeletedTime_IsNotNull() { regDeletedTime(CK_ISNN, DUMMY_OBJECT); @@ -2937,7 +2976,7 @@ abstract protected ConditionValue getCValueDeletedTime(); /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {VARCHAR(255)} + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {VARCHAR(255)} * * @param deletedBy The value of deletedBy as equal. */ @@ -2946,7 +2985,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param deletedBy The value of deletedBy as notEqual. */ @@ -2955,7 +2994,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param deletedBy The value of deletedBy as greaterThan. */ @@ -2964,7 +3003,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param deletedBy The value of deletedBy as lessThan. */ @@ -2973,7 +3012,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param deletedBy The value of deletedBy as greaterEqual. */ @@ -2982,7 +3021,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param deletedBy The value of deletedBy as lessEqual. */ @@ -2991,7 +3030,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param deletedBy The value of deletedBy as prefixSearch. */ @@ -3000,20 +3039,6 @@ } /** - * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, - * SeveralRegistered. - * - * @param deletedBy The value of deletedBy as likeSearch. - * @param likeSearchOption The option of like-search. (NotNull) - */ - public void setDeletedBy_LikeSearch( - String deletedBy, - jp.sf.pal.board.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { - registerLikeSearchQuery(CK_LS, fRES(deletedBy), getCValueDeletedBy(), - "DELETED_BY", "DeletedBy", "deletedBy", likeSearchOption); - } - - /** * InScope(in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * @@ -3024,38 +3049,52 @@ } /** - * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * - * @param deletedBy The collection of deletedBy as inScope. - * @param inScopeOption The option of in-scope. (NotNull) + * @param deletedByList The collection of deletedBy as notInScope. */ - public void setDeletedBy_InScope( + public void setDeletedBy_NotInScope(Collection deletedByList) { + regDeletedBy(CK_NINS, cTL(deletedByList)); + } + + /** + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param deletedBy The value of deletedBy as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) + */ + public void setDeletedBy_LikeSearch( String deletedBy, - jp.sf.pal.board.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(deletedBy), getCValueDeletedBy(), - "DELETED_BY", "DeletedBy", "deletedBy", inScopeOption); + jp.sf.pal.board.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(deletedBy), getCValueDeletedBy(), "DELETED_BY", + "DeletedBy", "deletedBy", likeSearchOption); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param deletedByList The collection of deletedBy as notInScope. + * @param deletedBy The value of deletedBy as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setDeletedBy_NotInScope(Collection deletedByList) { - regDeletedBy(CK_NINS, cTL(deletedByList)); + public void setDeletedBy_NotLikeSearch( + String deletedBy, + jp.sf.pal.board.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(deletedBy), getCValueDeletedBy(), "DELETED_BY", + "DeletedBy", "deletedBy", likeSearchOption); } /** - * IsNull(is null). And OnceRegistered. + * IsNull(is null). And OnlyOnceRegistered. */ public void setDeletedBy_IsNull() { regDeletedBy(CK_ISN, DUMMY_OBJECT); } /** - * IsNotNull(is not null). And OnceRegistered. + * IsNotNull(is not null). And OnlyOnceRegistered. */ public void setDeletedBy_IsNotNull() { regDeletedBy(CK_ISNN, DUMMY_OBJECT); @@ -3074,7 +3113,7 @@ abstract protected ConditionValue getCValueDeletedBy(); /** - * Equal(=). And NullIgnored, OnceRegistered. {NotNull : INTEGER} + * Equal(=). And NullIgnored, OnlyOnceRegistered. {NotNull : INTEGER} * * @param versionno The value of versionno as equal. */ @@ -3083,7 +3122,7 @@ } /** - * NotEqual(!=). And NullIgnored, OnceRegistered. + * NotEqual(!=). And NullIgnored, OnlyOnceRegistered. * * @param versionno The value of versionno as notEqual. */ @@ -3092,7 +3131,7 @@ } /** - * GreaterThan(>). And NullIgnored, OnceRegistered. + * GreaterThan(>). And NullIgnored, OnlyOnceRegistered. * * @param versionno The value of versionno as greaterThan. */ @@ -3101,7 +3140,7 @@ } /** - * LessThan(<). And NullIgnored, OnceRegistered. + * LessThan(<). And NullIgnored, OnlyOnceRegistered. * * @param versionno The value of versionno as lessThan. */ @@ -3110,7 +3149,7 @@ } /** - * GreaterEqual(>=). And NullIgnored, OnceRegistered. + * GreaterEqual(>=). And NullIgnored, OnlyOnceRegistered. * * @param versionno The value of versionno as greaterEqual. */ @@ -3119,7 +3158,7 @@ } /** - * LessEqual(<=). And NullIgnored, OnceRegistered. + * LessEqual(<=). And NullIgnored, OnlyOnceRegistered. * * @param versionno The value of versionno as lessEqual. */ @@ -3159,6 +3198,50 @@ abstract protected ConditionValue getCValueVersionno(); + public SSQFunction scalar_Equal() { + return xcreateSSQFunction("="); + } + + public SSQFunction scalar_GreaterEqual() { + return xcreateSSQFunction(">="); + } + + public SSQFunction scalar_GreaterThan() { + return xcreateSSQFunction(">"); + } + + public SSQFunction scalar_LessEqual() { + return xcreateSSQFunction("<="); + } + + public SSQFunction scalar_LessThan() { + return xcreateSSQFunction("<"); + } + + protected SSQFunction xcreateSSQFunction(final String operand) { + return new SSQFunction(new SSQSetupper() { + public void setup(String function, SubQuery subQuery) { + xscalarSubQuery(function, subQuery, operand); + } + }); + } + + protected void xscalarSubQuery(String function, + SubQuery subQuery, String operand) { + assertObjectNotNull("subQuery", subQuery); + UserInfoCB cb = new UserInfoCB(); + cb.xsetupForScalarSubQuery(); + subQuery.query(cb); + String subQueryPropertyName = keepScalarSubQuery(cb.query()); // for + // saving + // query + // -value. + registerScalarSubQuery(function, cb.query(), subQueryPropertyName, + operand); + } + + public abstract String keepScalarSubQuery(UserInfoCQ subQuery); + // Very Internal (for Suppressing Warn about 'Not Use Import') protected String getConditionBeanClassNameInternally() { return UserInfoCB.class.getName(); Modified: board/trunk/src/main/java/jp/sf/pal/board/db/cbean/cq/bs/BsAttachmentCQ.java =================================================================== --- board/trunk/src/main/java/jp/sf/pal/board/db/cbean/cq/bs/BsAttachmentCQ.java 2008-12-27 22:06:42 UTC (rev 1624) +++ board/trunk/src/main/java/jp/sf/pal/board/db/cbean/cq/bs/BsAttachmentCQ.java 2008-12-27 22:09:08 UTC (rev 1625) @@ -5,6 +5,7 @@ import jp.sf.pal.board.db.allcommon.cbean.ConditionQuery; import jp.sf.pal.board.db.allcommon.cbean.cvalue.ConditionValue; import jp.sf.pal.board.db.allcommon.cbean.sqlclause.SqlClause; +import jp.sf.pal.board.db.cbean.AttachmentCB; import jp.sf.pal.board.db.cbean.cq.AttachmentCQ; import jp.sf.pal.board.db.cbean.cq.MessageAttachmentCQ; import jp.sf.pal.board.db.cbean.cq.ciq.AttachmentCIQ; @@ -14,7 +15,6 @@ * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public class BsAttachmentCQ extends AbstractBsAttachmentCQ { //========================================================================== @@ -60,7 +60,7 @@ public AttachmentCIQ on() { if (isBaseQuery(this)) { throw new UnsupportedOperationException( - "Unsupported onClause of Base Table!"); + "Unsupported on-clause for local table!"); } AttachmentCIQ inlineQuery = inline(); inlineQuery.xsetOnClauseInline(true); @@ -153,21 +153,21 @@ return "id_NotExistsSubQuery_MessageAttachmentList." + key; } - protected Map _id_DeriveSubQuery_MessageAttachmentListMap; + protected Map _id_DerivedReferrer_MessageAttachmentListMap; - public Map getId_DeriveSubQuery_MessageAttachmentList() { - return _id_DeriveSubQuery_MessageAttachmentListMap; + public Map getId_DerivedReferrer_MessageAttachmentList() { + return _id_DerivedReferrer_MessageAttachmentListMap; } - public String keepId_DeriveSubQuery_MessageAttachmentList( + public String keepId_DerivedReferrer_MessageAttachmentList( MessageAttachmentCQ subQuery) { - if (_id_DeriveSubQuery_MessageAttachmentListMap == null) { - _id_DeriveSubQuery_MessageAttachmentListMap = newLinkedHashMap(); + if (_id_DerivedReferrer_MessageAttachmentListMap == null) { + _id_DerivedReferrer_MessageAttachmentListMap = newLinkedHashMap(); } String key = "subQueryMapKey" - + (_id_DeriveSubQuery_MessageAttachmentListMap.size() + 1); - _id_DeriveSubQuery_MessageAttachmentListMap.put(key, subQuery); - return "id_DeriveSubQuery_MessageAttachmentList." + key; + + (_id_DerivedReferrer_MessageAttachmentListMap.size() + 1); + _id_DerivedReferrer_MessageAttachmentListMap.put(key, subQuery); + return "id_DerivedReferrer_MessageAttachmentList." + key; } public BsAttachmentCQ addOrderBy_Id_Asc() { @@ -344,7 +344,30 @@ // ========= // Foreign Query // ============= + //========================================================================== + // ========= + // Derived Query + // ============= + protected Map _scalarSubQueryMap; + public Map getScalarSubQuery() { + return _scalarSubQueryMap; + } + + public String keepScalarSubQuery(AttachmentCQ subQuery) { + if (_scalarSubQueryMap == null) { + _scalarSubQueryMap = newLinkedHashMap(); + } + String key = "subQueryMapKey" + (_scalarSubQueryMap.size() + 1); + _scalarSubQueryMap.put(key, subQuery); + return "scalarSubQuery." + key; + } + + // Very Internal (for Suppressing Warn about 'Not Use Import') + protected String getConditionBeanClassNameInternally() { + return AttachmentCB.class.getName(); + } + protected String getConditionQueryClassNameInternally() { return AttachmentCQ.class.getName(); } Modified: board/trunk/src/main/java/jp/sf/pal/board/db/cbean/cq/bs/BsCategoryAccessCQ.java =================================================================== --- board/trunk/src/main/java/jp/sf/pal/board/db/cbean/cq/bs/BsCategoryAccessCQ.java 2008-12-27 22:06:42 UTC (rev 1624) +++ board/trunk/src/main/java/jp/sf/pal/board/db/cbean/cq/bs/BsCategoryAccessCQ.java 2008-12-27 22:09:08 UTC (rev 1625) @@ -5,6 +5,7 @@ import jp.sf.pal.board.db.allcommon.cbean.ConditionQuery; import jp.sf.pal.board.db.allcommon.cbean.cvalue.ConditionValue; import jp.sf.pal.board.db.allcommon.cbean.sqlclause.SqlClause; +import jp.sf.pal.board.db.cbean.CategoryAccessCB; import jp.sf.pal.board.db.cbean.cq.CategoryAccessCQ; import jp.sf.pal.board.db.cbean.cq.CategoryCQ; import jp.sf.pal.board.db.cbean.cq.ciq.CategoryAccessCIQ; @@ -14,7 +15,6 @@ * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public class BsCategoryAccessCQ extends AbstractBsCategoryAccessCQ { //========================================================================== @@ -60,7 +60,7 @@ public CategoryAccessCIQ on() { if (isBaseQuery(this)) { throw new UnsupportedOperationException( - "Unsupported onClause of Base Table!"); + "Unsupported on-clause for local table!"); } CategoryAccessCIQ inlineQuery = inline(); inlineQuery.xsetOnClauseInline(true); @@ -327,7 +327,6 @@ // ========= // Foreign Query // ============= - public CategoryCQ queryCategory() { return getConditionQueryCategory(); } @@ -336,20 +335,13 @@ public CategoryCQ getConditionQueryCategory() { if (_conditionQueryCategory == null) { - _conditionQueryCategory = createQueryCategory(); - setupOuterJoin_Category(); + _conditionQueryCategory = xcreateQueryCategory(); + xsetupOuterJoinCategory(); } return _conditionQueryCategory; } - protected void setupOuterJoin_Category() { - Map joinOnMap = newLinkedHashMap(); - joinOnMap.put(getRealColumnName("CATEGORY_ID"), - getConditionQueryCategory().getRealColumnName("ID")); - registerOuterJoin(getConditionQueryCategory(), joinOnMap); - } - - protected CategoryCQ createQueryCategory() { + protected CategoryCQ xcreateQueryCategory() { String nrp = resolveNextRelationPath("CATEGORY_ACCESS", "category"); String jan = resolveJoinAliasName(nrp, getNextNestLevel()); CategoryCQ cq = new CategoryCQ(this, getSqlClause(), jan, @@ -359,10 +351,42 @@ return cq; } + protected void xsetupOuterJoinCategory() { + CategoryCQ cq = getConditionQueryCategory(); + Map joinOnMap = newLinkedHashMap(); + joinOnMap.put(getRealColumnName("CATEGORY_ID"), cq + .getRealColumnName("ID")); + registerOuterJoin(cq, joinOnMap); + } + public boolean hasConditionQueryCategory() { return _conditionQueryCategory != null; } + //========================================================================== + // ========= + // Derived Query + // ============= + protected Map _scalarSubQueryMap; + + public Map getScalarSubQuery() { + return _scalarSubQueryMap; + } + + public String keepScalarSubQuery(CategoryAccessCQ subQuery) { + if (_scalarSubQueryMap == null) { + _scalarSubQueryMap = newLinkedHashMap(); + } + String key = "subQueryMapKey" + (_scalarSubQueryMap.size() + 1); + _scalarSubQueryMap.put(key, subQuery); + return "scalarSubQuery." + key; + } + + // Very Internal (for Suppressing Warn about 'Not Use Import') + protected String getConditionBeanClassNameInternally() { + return CategoryAccessCB.class.getName(); + } + protected String getConditionQueryClassNameInternally() { return CategoryAccessCQ.class.getName(); } Modified: board/trunk/src/main/java/jp/sf/pal/board/db/cbean/cq/bs/BsCategoryCQ.java =================================================================== --- board/trunk/src/main/java/jp/sf/pal/board/db/cbean/cq/bs/BsCategoryCQ.java 2008-12-27 22:06:42 UTC (rev 1624) +++ board/trunk/src/main/java/jp/sf/pal/board/db/cbean/cq/bs/BsCategoryCQ.java 2008-12-27 22:09:08 UTC (rev 1625) @@ -5,6 +5,7 @@ import jp.sf.pal.board.db.allcommon.cbean.ConditionQuery; import jp.sf.pal.board.db.allcommon.cbean.cvalue.ConditionValue; import jp.sf.pal.board.db.allcommon.cbean.sqlclause.SqlClause; +import jp.sf.pal.board.db.cbean.CategoryCB; import jp.sf.pal.board.db.cbean.cq.CategoryAccessCQ; import jp.sf.pal.board.db.cbean.cq.CategoryCQ; import jp.sf.pal.board.db.cbean.cq.MessageCQ; @@ -15,7 +16,6 @@ * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public class BsCategoryCQ extends AbstractBsCategoryCQ { //========================================================================== @@ -61,7 +61,7 @@ public CategoryCIQ on() { if (isBaseQuery(this)) { throw new UnsupportedOperationException( - "Unsupported onClause of Base Table!"); + "Unsupported on-clause for local table!"); } CategoryCIQ inlineQuery = inline(); inlineQuery.xsetOnClauseInline(true); @@ -218,37 +218,37 @@ return "id_NotExistsSubQuery_MessageList." + key; } - protected Map _id_DeriveSubQuery_CategoryAccessListMap; + protected Map _id_DerivedReferrer_CategoryAccessListMap; - public Map getId_DeriveSubQuery_CategoryAccessList() { - return _id_DeriveSubQuery_CategoryAccessListMap; + public Map getId_DerivedReferrer_CategoryAccessList() { + return _id_DerivedReferrer_CategoryAccessListMap; } - public String keepId_DeriveSubQuery_CategoryAccessList( + public String keepId_DerivedReferrer_CategoryAccessList( CategoryAccessCQ subQuery) { - if (_id_DeriveSubQuery_CategoryAccessListMap == null) { - _id_DeriveSubQuery_CategoryAccessListMap = newLinkedHashMap(); + if (_id_DerivedReferrer_CategoryAccessListMap == null) { + _id_DerivedReferrer_CategoryAccessListMap = newLinkedHashMap(); } String key = "subQueryMapKey" - + (_id_DeriveSubQuery_CategoryAccessListMap.size() + 1); - _id_DeriveSubQuery_CategoryAccessListMap.put(key, subQuery); - return "id_DeriveSubQuery_CategoryAccessList." + key; + + (_id_DerivedReferrer_CategoryAccessListMap.size() + 1); + _id_DerivedReferrer_CategoryAccessListMap.put(key, subQuery); + return "id_DerivedReferrer_CategoryAccessList." + key; } - protected Map _id_DeriveSubQuery_MessageListMap; + protected Map _id_DerivedReferrer_MessageListMap; - public Map getId_DeriveSubQuery_MessageList() { - return _id_DeriveSubQuery_MessageListMap; + public Map getId_DerivedReferrer_MessageList() { + return _id_DerivedReferrer_MessageListMap; } - public String keepId_DeriveSubQuery_MessageList(MessageCQ subQuery) { - if (_id_DeriveSubQuery_MessageListMap == null) { - _id_DeriveSubQuery_MessageListMap = newLinkedHashMap(); + public String keepId_DerivedReferrer_MessageList(MessageCQ subQuery) { + if (_id_DerivedReferrer_MessageListMap == null) { + _id_DerivedReferrer_MessageListMap = newLinkedHashMap(); } String key = "subQueryMapKey" - + (_id_DeriveSubQuery_MessageListMap.size() + 1); - _id_DeriveSubQuery_MessageListMap.put(key, subQuery); - return "id_DeriveSubQuery_MessageList." + key; + + (_id_DerivedReferrer_MessageListMap.size() + 1); + _id_DerivedReferrer_MessageListMap.put(key, subQuery); + return "id_DerivedReferrer_MessageList." + key; } public BsCategoryCQ addOrderBy_Id_Asc() { @@ -494,7 +494,30 @@ // ========= // Foreign Query // ============= + //========================================================================== + // ========= + // Derived Query + // ============= + protected Map _scalarSubQueryMap; + public Map getScalarSubQuery() { + return _scalarSubQueryMap; + } + + public String keepScalarSubQuery(CategoryCQ subQuery) { + if (_scalarSubQueryMap == null) { + _scalarSubQueryMap = newLinkedHashMap(); + } + String key = "subQueryMapKey" + (_scalarSubQueryMap.size() + 1); + _scalarSubQueryMap.put(key, subQuery); + return "scalarSubQuery." + key; + } + + // Very Internal (for Suppressing Warn about 'Not Use Import') + protected String getConditionBeanClassNameInternally() { + return CategoryCB.class.getName(); + } + protected String getConditionQueryClassNameInternally() { return CategoryCQ.class.getName(); } Modified: board/trunk/src/main/java/jp/sf/pal/board/db/cbean/cq/bs/BsGroupInfoCQ.java =================================================================== --- board/trunk/src/main/java/jp/sf/pal/board/db/cbean/cq/bs/BsGroupInfoCQ.java 2008-12-27 22:06:42 UTC (rev 1624) +++ board/trunk/src/main/java/jp/sf/pal/board/db/cbean/cq/bs/BsGroupInfoCQ.java 2008-12-27 22:09:08 UTC (rev 1625) @@ -5,6 +5,7 @@ import jp.sf.pal.board.db.allcommon.cbean.ConditionQuery; import jp.sf.pal.board.db.allcommon.cbean.cvalue.ConditionValue; import jp.sf.pal.board.db.allcommon.cbean.sqlclause.SqlClause; +import jp.sf.pal.board.db.cbean.GroupInfoCB; import jp.sf.pal.board.db.cbean.cq.GroupInfoCQ; import jp.sf.pal.board.db.cbean.cq.GroupMappingCQ; import jp.sf.pal.board.db.cbean.cq.UserInfoCQ; @@ -15,7 +16,6 @@ * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public class BsGroupInfoCQ extends AbstractBsGroupInfoCQ { //========================================================================== @@ -61,7 +61,7 @@ public GroupInfoCIQ on() { if (isBaseQuery(this)) { throw new UnsupportedOperationException( - "Unsupported onClause of Base Table!"); + "Unsupported on-clause for local table!"); } GroupInfoCIQ inlineQuery = inline(); inlineQuery.xsetOnClauseInline(true); @@ -219,37 +219,37 @@ return "groupId_NotExistsSubQuery_UserInfoList." + key; } - protected Map _groupId_DeriveSubQuery_GroupMappingListMap; + protected Map _groupId_DerivedReferrer_GroupMappingListMap; - public Map getGroupId_DeriveSubQuery_GroupMappingList() { - return _groupId_DeriveSubQuery_GroupMappingListMap; + public Map getGroupId_DerivedReferrer_GroupMappingList() { + return _groupId_DerivedReferrer_GroupMappingListMap; } - public String keepGroupId_DeriveSubQuery_GroupMappingList( + public String keepGroupId_DerivedReferrer_GroupMappingList( GroupMappingCQ subQuery) { - if (_groupId_DeriveSubQuery_GroupMappingListMap == null) { - _groupId_DeriveSubQuery_GroupMappingListMap = newLinkedHashMap(); + if (_groupId_DerivedReferrer_GroupMappingListMap == null) { + _groupId_DerivedReferrer_GroupMappingListMap = newLinkedHashMap(); } String key = "subQueryMapKey" - + (_groupId_DeriveSubQuery_GroupMappingListMap.size() + 1); - _groupId_DeriveSubQuery_GroupMappingListMap.put(key, subQuery); - return "groupId_DeriveSubQuery_GroupMappingList." + key; + + (_groupId_DerivedReferrer_GroupMappingListMap.size() + 1); + _groupId_DerivedReferrer_GroupMappingListMap.put(key, subQuery); + return "groupId_DerivedReferrer_GroupMappingList." + key; } - protected Map _groupId_DeriveSubQuery_UserInfoListMap; + protected Map _groupId_DerivedReferrer_UserInfoListMap; - public Map getGroupId_DeriveSubQuery_UserInfoList() { - return _groupId_DeriveSubQuery_UserInfoListMap; + public Map getGroupId_DerivedReferrer_UserInfoList() { + return _groupId_DerivedReferrer_UserInfoListMap; } - public String keepGroupId_DeriveSubQuery_UserInfoList(UserInfoCQ subQuery) { - if (_groupId_DeriveSubQuery_UserInfoListMap == null) { - _groupId_DeriveSubQuery_UserInfoListMap = newLinkedHashMap(); + public String keepGroupId_DerivedReferrer_UserInfoList(UserInfoCQ subQuery) { + if (_groupId_DerivedReferrer_UserInfoListMap == null) { + _groupId_DerivedReferrer_UserInfoListMap = newLinkedHashMap(); } String key = "subQueryMapKey" - + (_groupId_DeriveSubQuery_UserInfoListMap.size() + 1); - _groupId_DeriveSubQuery_UserInfoListMap.put(key, subQuery); - return "groupId_DeriveSubQuery_UserInfoList." + key; + + (_groupId_DerivedReferrer_UserInfoListMap.size() + 1); + _groupId_DerivedReferrer_UserInfoListMap.put(key, subQuery); + return "groupId_DerivedReferrer_UserInfoList." + key; } public BsGroupInfoCQ addOrderBy_GroupId_Asc() { @@ -564,7 +564,30 @@ // ========= // Foreign Query // ============= + //========================================================================== + // ========= + // Derived Query + // ============= + protected Map _scalarSubQueryMap; + public Map getScalarSubQuery() { + return _scalarSubQueryMap; + } + + public String keepScalarSubQuery(GroupInfoCQ subQuery) { + if (_scalarSubQueryMap == null) { + _scalarSubQueryMap = newLinkedHashMap(); + } + String key = "subQueryMapKey" + (_scalarSubQueryMap.size() + 1); + _scalarSubQueryMap.put(key, subQuery); + return "scalarSubQuery." + key; + } + + // Very Internal (for Suppressing Warn about 'Not Use Import') + protected String getConditionBeanClassNameInternally() { + return GroupInfoCB.class.getName(); + } + protected String getConditionQueryClassNameInternally() { return GroupInfoCQ.class.getName(); } Modified: board/trunk/src/main/java/jp/sf/pal/board/db/cbean/cq/bs/BsGroupMappingCQ.java =================================================================== --- board/trunk/src/main/java/jp/sf/pal/board/db/cbean/cq/bs/BsGroupMappingCQ.java 2008-12-27 22:06:42 UTC (rev 1624) +++ board/trunk/src/main/java/jp/sf/pal/board/db/cbean/cq/bs/BsGroupMappingCQ.java 2008-12-27 22:09:08 UTC (rev 1625) @@ -5,6 +5,7 @@ import jp.sf.pal.board.db.allcommon.cbean.ConditionQuery; import jp.sf.pal.board.db.allcommon.cbean.cvalue.ConditionValue; import jp.sf.pal.board.db.allcommon.cbean.sqlclause.SqlClause; +import jp.sf.pal.board.db.cbean.GroupMappingCB; import jp.sf.pal.board.db.cbean.cq.GroupInfoCQ; import jp.sf.pal.board.db.cbean.cq.GroupMappingCQ; import jp.sf.pal.board.db.cbean.cq.UserInfoCQ; @@ -15,7 +16,6 @@ * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public class BsGroupMappingCQ extends AbstractBsGroupMappingCQ { //========================================================================== @@ -61,7 +61,7 @@ public GroupMappingCIQ on() { if (isBaseQuery(this)) { throw new UnsupportedOperationException( - "Unsupported onClause of Base Table!"); + "Unsupported on-clause for local table!"); } GroupMappingCIQ inlineQuery = inline(); inlineQuery.xsetOnClauseInline(true); @@ -210,7 +210,6 @@ // ========= // Foreign Query // ============= - public GroupInfoCQ queryGroupInfo() { return getConditionQueryGroupInfo(); } @@ -219,20 +218,13 @@ public GroupInfoCQ getConditionQueryGroupInfo() { if (_conditionQueryGroupInfo == null) { - _conditionQueryGroupInfo = createQueryGroupInfo(); - setupOuterJoin_GroupInfo(); + _conditionQueryGroupInfo = xcreateQueryGroupInfo(); + xsetupOuterJoinGroupInfo(); } return _conditionQueryGroupInfo; } - protected void setupOuterJoin_GroupInfo() { - Map joinOnMap = newLinkedHashMap(); - joinOnMap.put(getRealColumnName("GROUP_ID"), - getConditionQueryGroupInfo().getRealColumnName("GROUP_ID")); - registerOuterJoin(getConditionQueryGroupInfo(), joinOnMap); - } - - protected GroupInfoCQ createQueryGroupInfo() { + protected GroupInfoCQ xcreateQueryGroupInfo() { String nrp = resolveNextRelationPath("GROUP_MAPPING", "groupInfo"); String jan = resolveJoinAliasName(nrp, getNextNestLevel()); GroupInfoCQ cq = new GroupInfoCQ(this, getSqlClause(), jan, @@ -242,6 +234,14 @@ return cq; } + protected void xsetupOuterJoinGroupInfo() { + GroupInfoCQ cq = getConditionQueryGroupInfo(); + Map joinOnMap = newLinkedHashMap(); + joinOnMap.put(getRealColumnName("GROUP_ID"), cq + .getRealColumnName("GROUP_ID")); + registerOuterJoin(cq, joinOnMap); + } + public boolean hasConditionQueryGroupInfo() { return _conditionQueryGroupInfo != null; } @@ -254,20 +254,13 @@ public UserInfoCQ getConditionQueryUserInfo() { if (_conditionQueryUserInfo == null) { - _conditionQueryUserInfo = createQueryUserInfo(); - setupOuterJoin_UserInfo(); + _conditionQueryUserInfo = xcreateQueryUserInfo(); + xsetupOuterJoinUserInfo(); } return _conditionQueryUserInfo; } - protected void setupOuterJoin_UserInfo() { - Map joinOnMap = newLinkedHashMap(); - joinOnMap.put(getRealColumnName("USER_ID"), getConditionQueryUserInfo() - .getRealColumnName("USER_ID")); - registerOuterJoin(getConditionQueryUserInfo(), joinOnMap); - } - - protected UserInfoCQ createQueryUserInfo() { + protected UserInfoCQ xcreateQueryUserInfo() { String nrp = resolveNextRelationPath("GROUP_MAPPING", "userInfo"); String jan = resolveJoinAliasName(nrp, getNextNestLevel()); UserInfoCQ cq = new UserInfoCQ(this, getSqlClause(), jan, @@ -277,10 +270,42 @@ return cq; } + protected void xsetupOuterJoinUserInfo() { + UserInfoCQ cq = getConditionQueryUserInfo(); + Map joinOnMap = newLinkedHashMap(); + joinOnMap.put(getRealColumnName("USER_ID"), cq + .getRealColumnName("USER_ID")); + registerOuterJoin(cq, joinOnMap); + } + public boolean hasConditionQueryUserInfo() { return _conditionQueryUserInfo != null; } + //========================================================================== + // ========= + // Derived Query + // ============= + protected Map _scalarSubQueryMap; + + public Map getScalarSubQuery() { + return _scalarSubQueryMap; + } + + public String keepScalarSubQuery(GroupMappingCQ subQuery) { + if (_scalarSubQueryMap == null) { + _scalarSubQueryMap = newLinkedHashMap(); + } + String key = "subQueryMapKey" + (_scalarSubQueryMap.size() + 1); + _scalarSubQueryMap.put(key, subQuery); + return "scalarSubQuery." + key; + } + + // Very Internal (for Suppressing Warn about 'Not Use Import') + protected String getConditionBeanClassNameInternally() { + return GroupMappingCB.class.getName(); + } + protected String getConditionQueryClassNameInternally() { return GroupMappingCQ.class.getName(); } Modified: board/trunk/src/main/java/jp/sf/pal/board/db/cbean/cq/bs/BsMessageAttachmentCQ.java =================================================================== --- board/trunk/src/main/java/jp/sf/pal/board/db/cbean/cq/bs/BsMessageAttachmentCQ.java 2008-12-27 22:06:42 UTC (rev 1624) +++ board/trunk/src/main/java/jp/sf/pal/board/db/cbean/cq/bs/BsMessageAttachmentCQ.java 2008-12-27 22:09:08 UTC (rev 1625) @@ -5,6 +5,7 @@ import jp.sf.pal.board.db.allcommon.cbean.ConditionQuery; import jp.sf.pal.board.db.allcommon.cbean.cvalue.ConditionValue; import jp.sf.pal.board.db.allcommon.cbean.sqlclause.SqlClause; +import jp.sf.pal.board.db.cbean.MessageAttachmentCB; import jp.sf.pal.board.db.cbean.cq.AttachmentCQ; import jp.sf.pal.board.db.cbean.cq.MessageAttachmentCQ; import jp.sf.pal.board.db.cbean.cq.MessageCQ; @@ -15,7 +16,6 @@ * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public class BsMessageAttachmentCQ extends AbstractBsMessageAttachmentCQ { //========================================================================== @@ -61,7 +61,7 @@ public MessageAttachmentCIQ on() { if (isBaseQuery(this)) { throw new UnsupportedOperationException( - "Unsupported onClause of Base Table!"); + "Unsupported on-clause for local table!"); } MessageAttachmentCIQ inlineQuery = inline(); inlineQuery.xsetOnClauseInline(true); @@ -419,7 +419,6 @@ // ========= // Foreign Query // ============= - public AttachmentCQ queryAttachment() { return getConditionQueryAttachment(); } @@ -428,20 +427,13 @@ public AttachmentCQ getConditionQueryAttachment() { if (_conditionQueryAttachment == null) { - _conditionQueryAttachment = createQueryAttachment(); - setupOuterJoin_Attachment(); + _conditionQueryAttachment = xcreateQueryAttachment(); + xsetupOuterJoinAttachment(); } return _conditionQueryAttachment; } - protected void setupOuterJoin_Attachment() { - Map joinOnMap = newLinkedHashMap(); - joinOnMap.put(getRealColumnName("ATTACHMENT_ID"), - getConditionQueryAttachment().getRealColumnName("ID")); - registerOuterJoin(getConditionQueryAttachment(), joinOnMap); - } - - protected AttachmentCQ createQueryAttachment() { + protected AttachmentCQ xcreateQueryAttachment() { String nrp = resolveNextRelationPath("MESSAGE_ATTACHMENT", "attachment"); String jan = resolveJoinAliasName(nrp, getNextNestLevel()); AttachmentCQ cq = new AttachmentCQ(this, getSqlClause(), jan, @@ -451,6 +443,14 @@ return cq; } + protected void xsetupOuterJoinAttachment() { + AttachmentCQ cq = getConditionQueryAttachment(); + Map joinOnMap = newLinkedHashMap(); + joinOnMap.put(getRealColumnName("ATTACHMENT_ID"), cq + .getRealColumnName("ID")); + registerOuterJoin(cq, joinOnMap); + } + public boolean hasConditionQueryAttachment() { return _conditionQueryAttachment != null; } @@ -463,20 +463,13 @@ public MessageCQ getConditionQueryMessage() { if (_conditionQueryMessage == null) { - _conditionQueryMessage = createQueryMessage(); - setupOuterJoin_Message(); + _conditionQueryMessage = xcreateQueryMessage(); + xsetupOuterJoinMessage(); } return _conditionQueryMessage; } - protected void setupOuterJoin_Message() { - Map joinOnMap = newLinkedHashMap(); - joinOnMap.put(getRealColumnName("MESSAGE_ID"), - getConditionQueryMessage().getRealColumnName("ID")); - registerOuterJoin(getConditionQueryMessage(), joinOnMap); - } - - protected MessageCQ createQueryMessage() { + protected MessageCQ xcreateQueryMessage() { String nrp = resolveNextRelationPath("MESSAGE_ATTACHMENT", "message"); String jan = resolveJoinAliasName(nrp, getNextNestLevel()); MessageCQ cq = new MessageCQ(this, getSqlClause(), jan, @@ -486,10 +479,42 @@ return cq; } + protected void xsetupOuterJoinMessage() { + MessageCQ cq = getConditionQueryMessage(); + Map joinOnMap = newLinkedHashMap(); + joinOnMap.put(getRealColumnName("MESSAGE_ID"), cq + .getRealColumnName("ID")); + registerOuterJoin(cq, joinOnMap); + } + public boolean hasConditionQueryMessage() { return _conditionQueryMessage != null; } + //========================================================================== + // ========= + // Derived Query + // ============= + protected Map _scalarSubQueryMap; + + public Map getScalarSubQuery() { + return _scalarSubQueryMap; + } + + public String keepScalarSubQuery(MessageAttachmentCQ subQuery) { + if (_scalarSubQueryMap == null) { + _scalarSubQueryMap = newLinkedHashMap(); + } + String key = "subQueryMapKey" + (_scalarSubQueryMap.size() + 1); + _scalarSubQueryMap.put(key, subQuery); + return "scalarSubQuery." + key; + } + + // Very Internal (for Suppressing Warn about 'Not Use Import') + protected String getConditionBeanClassNameInternally() { + return MessageAttachmentCB.class.getName(); + } + protected String getConditionQueryClassNameInternally() { return MessageAttachmentCQ.class.getName(); } Modified: board/trunk/src/main/java/jp/sf/pal/board/db/cbean/cq/bs/BsMessageCQ.java =================================================================== --- board/trunk/src/main/java/jp/sf/pal/board/db/cbean/cq/bs/BsMessageCQ.java 2008-12-27 22:06:42 UTC (rev 1624) +++ board/trunk/src/main/java/jp/sf/pal/board/db/cbean/cq/bs/BsMessageCQ.java 2008-12-27 22:09:08 UTC (rev 1625) @@ -5,6 +5,7 @@ import jp.sf.pal.board.db.allcommon.cbean.ConditionQuery; import jp.sf.pal.board.db.allcommon.cbean.cvalue.ConditionValue; import jp.sf.pal.board.db.allcommon.cbean.sqlclause.SqlClause; +import jp.sf.pal.board.db.cbean.MessageCB; import jp.sf.pal.board.db.cbean.cq.CategoryCQ; import jp.sf.pal.board.db.cbean.cq.MessageAttachmentCQ; import jp.sf.pal.board.db.cbean.cq.MessageCQ; @@ -17,7 +18,6 @@ * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public class BsMessageCQ extends AbstractBsMessageCQ { //========================================================================== @@ -63,7 +63,7 @@ public MessageCIQ on() { if (isBaseQuery(this)) { throw new UnsupportedOperationException( - "Unsupported onClause of Base Table!"); + "Unsupported on-clause for local table!"); } MessageCIQ inlineQuery = inline(); inlineQuery.xsetOnClauseInline(true); @@ -288,37 +288,37 @@ return "id_NotExistsSubQuery_ReplyList." + key; } - protected Map _id_DeriveSubQuery_MessageAttachmentListMap; + protected Map _id_DerivedReferrer_MessageAttachmentListMap; - public Map getId_DeriveSubQuery_MessageAttachmentList() { - return _id_DeriveSubQuery_MessageAttachmentListMap; + public Map getId_DerivedReferrer_MessageAttachmentList() { + return _id_DerivedReferrer_MessageAttachmentListMap; } - public String keepId_DeriveSubQuery_MessageAttachmentList( + public String keepId_DerivedReferrer_MessageAttachmentList( MessageAttachmentCQ subQuery) { - if (_id_DeriveSubQuery_MessageAttachmentListMap == null) { - _id_DeriveSubQuery_MessageAttachmentListMap = newLinkedHashMap(); + if (_id_DerivedReferrer_MessageAttachmentListMap == null) { + _id_DerivedReferrer_MessageAttachmentListMap = newLinkedHashMap(); } String key = "subQueryMapKey" - + (_id_DeriveSubQuery_MessageAttachmentListMap.size() + 1); - _id_DeriveSubQuery_MessageAttachmentListMap.put(key, subQuery); - return "id_DeriveSubQuery_MessageAttachmentList." + key; + + (_id_DerivedReferrer_MessageAttachmentListMap.size() + 1); + _id_DerivedReferrer_MessageAttachmentListMap.put(key, subQuery); + return "id_DerivedReferrer_MessageAttachmentList." + key; } - protected Map _id_DeriveSubQuery_ReplyListMap; + protected Map _id_DerivedReferrer_ReplyListMap; - public Map getId_DeriveSubQuery_ReplyList() { - return _id_DeriveSubQuery_ReplyListMap; + public Map getId_DerivedReferrer_ReplyList() { + return _id_DerivedReferrer_ReplyListMap; } - public String keepId_DeriveSubQuery_ReplyList(ReplyCQ subQuery) { - if (_id_DeriveSubQuery_ReplyListMap == null) { - _id_DeriveSubQuery_ReplyListMap = newLinkedHashMap(); + public String keepId_DerivedReferrer_ReplyList(ReplyCQ subQuery) { + if (_id_DerivedReferrer_ReplyListMap == null) { + _id_DerivedReferrer_ReplyListMap = newLinkedHashMap(); } String key = "subQueryMapKey" - + (_id_DeriveSubQuery_ReplyListMap.size() + 1); - _id_DeriveSubQuery_ReplyListMap.put(key, subQuery); - return "id_DeriveSubQuery_ReplyList." + key; + + (_id_DerivedReferrer_ReplyListMap.size() + 1); + _id_DerivedReferrer_ReplyListMap.put(key, subQuery); + return "id_DerivedReferrer_ReplyList." + key; } public BsMessageCQ addOrderBy_Id_Asc() { @@ -706,7 +706,6 @@ // ========= // Foreign Query // ============= - public CategoryCQ queryCategory() { return getConditionQueryCategory(); } @@ -715,20 +714,13 @@ public CategoryCQ getConditionQueryCategory() { if (_conditionQueryCategory == null) { - _conditionQueryCategory = createQueryCategory(); - setupOuterJoin_Category(); + _conditionQueryCategory = xcreateQueryCategory(); + xsetupOuterJoinCategory(); } return _conditionQueryCategory; } - protected void setupOuterJoin_Category() { - Map joinOnMap = newLinkedHashMap(); - joinOnMap.put(getRealColumnName("CATEGORY_ID"), - getConditionQueryCategory().getRealColumnName("ID")); - registerOuterJoin(getConditionQueryCategory(), joinOnMap); - } - - protected CategoryCQ createQueryCategory() { + protected CategoryCQ xcreateQueryCategory() { String nrp = resolveNextRelationPath("MESSAGE", "category"); String jan = resolveJoinAliasName(nrp, getNextNestLevel()); CategoryCQ cq = new CategoryCQ(this, getSqlClause(), jan, @@ -738,6 +730,14 @@ return cq; } + protected void xsetupOuterJoinCategory() { + CategoryCQ cq = getConditionQueryCategory(); + Map joinOnMap = newLinkedHashMap(); + joinOnMap.put(getRealColumnName("CATEGORY_ID"), cq + .getRealColumnName("ID")); + registerOuterJoin(cq, joinOnMap); + } + public boolean hasConditionQueryCategory() { return _conditionQueryCategory != null; } @@ -750,21 +750,13 @@ public MessageContentCQ getConditionQueryMessageContentAsOne() { if (_conditionQueryMessageContentAsOne == null) { - _conditionQueryMessageContentAsOne = createQueryMessageContentAsOne(); - setupOuterJoin_MessageContentAsOne(); + _conditionQueryMessageContentAsOne = xcreateQueryMessageContentAsOne(); + xsetupOuterJoinMessageContentAsOne(); } return _conditionQueryMessageContentAsOne; } - protected void setupOuterJoin_MessageContentAsOne() { - Map joinOnMap = newLinkedHashMap(); - joinOnMap.put(getRealColumnName("ID"), - getConditionQueryMessageContentAsOne().getRealColumnName( - "MESSAGE_ID")); - registerOuterJoin(getConditionQueryMessageContentAsOne(), joinOnMap); - } - - protected MessageContentCQ createQueryMessageContentAsOne() { + protected MessageContentCQ xcreateQueryMessageContentAsOne() { String nrp = resolveNextRelationPath("MESSAGE", "messageContentAsOne"); String jan = resolveJoinAliasName(nrp, getNextNestLevel()); MessageContentCQ cq = new MessageContentCQ(this, getSqlClause(), jan, @@ -774,10 +766,42 @@ return cq; } + protected void xsetupOuterJoinMessageContentAsOne() { + MessageContentCQ cq = getConditionQueryMessageContentAsOne(); + Map joinOnMap = newLinkedHashMap(); + joinOnMap.put(getRealColumnName("ID"), cq + .getRealColumnName("MESSAGE_ID")); + registerOuterJoin(cq, joinOnMap); + } + public boolean hasConditionQueryMessageContentAsOne() { return _conditionQueryMessageContentAsOne != null; } + //========================================================================== + // ========= + // Derived Query + // ============= + protected Map _scalarSubQueryMap; + + public Map getScalarSubQuery() { + return _scalarSubQueryMap; + } + + public String keepScalarSubQuery(MessageCQ subQuery) { + if (_scalarSubQueryMap == null) { + _scalarSubQueryMap = newLinkedHashMap(); + } + String key = "subQueryMapKey" + (_scalarSubQueryMap.size() + 1); + _scalarSubQueryMap.put(key, subQuery); + return "scalarSubQuery." + key; + } + + // Very Internal (for Suppressing Warn about 'Not Use Import') + protected String getConditionBeanClassNameInternally() { + return MessageCB.class.getName(); + } + protected String getConditionQueryClassNameInternally() { return MessageCQ.class.getName(); } Modified: board/trunk/src/main/java/jp/sf/pal/board/db/cbean/cq/bs/BsMessageContentCQ.java =================================================================== --- board/trunk/src/main/java/jp/sf/pal/board/db/cbean/cq/bs/BsMessageContentCQ.java 2008-12-27 22:06:42 UTC (rev 1624) +++ board/trunk/src/main/java/jp/sf/pal/board/db/cbean/cq/bs/BsMessageContentCQ.java 2008-12-27 22:09:08 UTC (rev 1625) @@ -5,6 +5,7 @@ import jp.sf.pal.board.db.allcommon.cbean.ConditionQuery; import jp.sf.pal.board.db.allcommon.cbean.cvalue.ConditionValue; import jp.sf.pal.board.db.allcommon.cbean.sqlclause.SqlClause; +import jp.sf.pal.board.db.cbean.MessageContentCB; import jp.sf.pal.board.db.cbean.cq.MessageCQ; import jp.sf.pal.board.db.cbean.cq.MessageContentCQ; import jp.sf.pal.board.db.cbean.cq.ciq.MessageContentCIQ; @@ -14,7 +15,6 @@ * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public class BsMessageContentCQ extends AbstractBsMessageContentCQ { //========================================================================== @@ -60,7 +60,7 @@ public MessageContentCIQ on() { if (isBaseQuery(this)) { throw new UnsupportedOperationException( - "Unsupported onClause of Base Table!"); + "Unsupported on-clause for local table!"); } MessageContentCIQ inlineQuery = inline(); inlineQuery.xsetOnClauseInline(true); @@ -166,7 +166,6 @@ // ========= // Foreign Query // ============= - public MessageCQ queryMessage() { return getConditionQueryMessage(); } @@ -175,20 +174,13 @@ public MessageCQ getConditionQueryMessage() { if (_conditionQueryMessage == null) { - _conditionQueryMessage = createQueryMessage(); - setupOuterJoin_Message(); + _conditionQueryMessage = xcreateQueryMessage(); + xsetupOuterJoinMessage(); } return _conditionQueryMessage; } - protected void setupOuterJoin_Message() { - Map joinOnMap = newLinkedHashMap(); - joinOnMap.put(getRealColumnName("MESSAGE_ID"), - getConditionQueryMessage().getRealColumnName("ID")); - registerOuterJoin(getConditionQueryMessage(), joinOnMap); - } - - protected MessageCQ createQueryMessage() { + protected MessageCQ xcreateQueryMessage() { String nrp = resolveNextRelationPath("MESSAGE_CONTENT", "message"); String jan = resolveJoinAliasName(nrp, getNextNestLevel()); MessageCQ cq = new MessageCQ(this, getSqlClause(), jan, @@ -198,10 +190,42 @@ return cq; } + protected void xsetupOuterJoinMessage() { + MessageCQ cq = getConditionQueryMessage(); + Map joinOnMap = newLinkedHashMap(); + joinOnMap.put(getRealColumnName("MESSAGE_ID"), cq + .getRealColumnName("ID")); + registerOuterJoin(cq, joinOnMap); + } + public boolean hasConditionQueryMessage() { return _conditionQueryMessage != null; } + //========================================================================== + // ========= + // Derived Query + // ============= + protected Map _scalarSubQueryMap; + + public Map getScalarSubQuery() { + return _scalarSubQueryMap; + } + + public String keepScalarSubQuery(MessageContentCQ subQuery) { + if (_scalarSubQueryMap == null) { + _scalarSubQueryMap = newLinkedHashMap(); + } + String key = "subQueryMapKey" + (_scalarSubQueryMap.size() + 1); + _scalarSubQueryMap.put(key, subQuery); + return "scalarSubQuery." + key; + } + + // Very Internal (for Suppressing Warn about 'Not Use Import') + protected String getConditionBeanClassNameInternally() { + return MessageContentCB.class.getName(); + } + protected String getConditionQueryClassNameInternally() { return MessageContentCQ.class.getName(); } Modified: board/trunk/src/main/java/jp/sf/pal/board/db/cbean/cq/bs/BsReplyCQ.java =================================================================== --- board/trunk/src/main/java/jp/sf/pal/board/db/cbean/cq/bs/BsReplyCQ.java 2008-12-27 22:06:42 UTC (rev 1624) +++ board/trunk/src/main/java/jp/sf/pal/board/db/cbean/cq/bs/BsReplyCQ.java 2008-12-27 22:09:08 UTC (rev 1625) @@ -5,6 +5,7 @@ import jp.sf.pal.board.db.allcommon.cbean.ConditionQuery; import jp.sf.pal.board.db.allcommon.cbean.cvalue.ConditionValue; import jp.sf.pal.board.db.allcommon.cbean.sqlclause.SqlClause; +import jp.sf.pal.board.db.cbean.ReplyCB; import jp.sf.pal.board.db.cbean.cq.MessageCQ; import jp.sf.pal.board.db.cbean.cq.ReplyCQ; import jp.sf.pal.board.db.cbean.cq.ciq.ReplyCIQ; @@ -14,7 +15,6 @@ * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public class BsReplyCQ extends AbstractBsReplyCQ { //========================================================================== @@ -60,7 +60,7 @@ public ReplyCIQ on() { if (isBaseQuery(this)) { throw new UnsupportedOperationException( - "Unsupported onClause of Base Table!"); + "Unsupported on-clause for local table!"); } ReplyCIQ inlineQuery = inline(); inlineQuery.xsetOnClauseInline(true); @@ -304,7 +304,6 @@ // ========= // Foreign Query // ============= - public MessageCQ queryMessage() { return getConditionQueryMessage(); } @@ -313,20 +312,13 @@ public MessageCQ getConditionQueryMessage() { if (_conditionQueryMessage == null) { - _conditionQueryMessage = createQueryMessage(); - setupOuterJoin_Message(); + _conditionQueryMessage = xcreateQueryMessage(); + xsetupOuterJoinMessage(); } return _conditionQueryMessage; } - protected void setupOuterJoin_Message() { - Map joinOnMap = newLinkedHashMap(); - joinOnMap.put(getRealColumnName("MESSAGE_ID"), - getConditionQueryMessage().getRealColumnName("ID")); - registerOuterJoin(getConditionQueryMessage(), joinOnMap); - } - - protected MessageCQ createQueryMessage() { + protected MessageCQ xcreateQueryMessage() { String nrp = resolveNextRelationPath("REPLY", "message"); String jan = resolveJoinAliasName(nrp, getNextNestLevel()); MessageCQ cq = new MessageCQ(this, getSqlClause(), jan, @@ -336,10 +328,42 @@ return cq; } + protected void xsetupOuterJoinMessage() { + MessageCQ cq = getConditionQueryMessage(); + Map joinOnMap = newLinkedHashMap(); + joinOnMap.put(getRealColumnName("MESSAGE_ID"), cq + .getRealColumnName("ID")); + registerOuterJoin(cq, joinOnMap); + } + public boolean hasConditionQueryMessage() { return _conditionQueryMessage != null; } + //========================================================================== + // ========= + // Derived Query + // ============= + protected Map _scalarSubQueryMap; + + public Map getScalarSubQuery() { + return _scalarSubQueryMap; + } + + public String keepScalarSubQuery(ReplyCQ subQuery) { + if (_scalarSubQueryMap == null) { + _scalarSubQueryMap = newLinkedHashMap(); + } + String key = "subQueryMapKey" + (_scalarSubQueryMap.size() + 1); + _scalarSubQueryMap.put(key, subQuery); + return "scalarSubQuery." + key; + } + + // Very Internal (for Suppressing Warn about 'Not Use Import') + protected String getConditionBeanClassNameInternally() { + return ReplyCB.class.getName(); + } + protected String getConditionQueryClassNameInternally() { return ReplyCQ.class.getName(); } Modified: board/trunk/src/main/java/jp/sf/pal/board/db/cbean/cq/bs/BsRoleInfoCQ.java =================================================================== --- board/trunk/src/main/java/jp/sf/pal/board/db/cbean/cq/bs/BsRoleInfoCQ.java 2008-12-27 22:06:42 UTC (rev 1624) +++ board/trunk/src/main/java/jp/sf/pal/board/db/cbean/cq/bs/BsRoleInfoCQ.java 2008-12-27 22:09:08 UTC (rev 1625) @@ -5,6 +5,7 @@ import jp.sf.pal.board.db.allcommon.cbean.ConditionQuery; import jp.sf.pal.board.db.allcommon.cbean.cvalue.ConditionValue; import jp.sf.pal.board.db.allcommon.cbean.sqlclause.SqlClause; +import jp.sf.pal.board.db.cbean.RoleInfoCB; import jp.sf.pal.board.db.cbean.cq.RoleInfoCQ; import jp.sf.pal.board.db.cbean.cq.RoleMappingCQ; import jp.sf.pal.board.db.cbean.cq.UserInfoCQ; @@ -15,7 +16,6 @@ * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public class BsRoleInfoCQ extends AbstractBsRoleInfoCQ { //========================================================================== @@ -61,7 +61,7 @@ public RoleInfoCIQ on() { if (isBaseQuery(this)) { throw new UnsupportedOperationException( - "Unsupported onClause of Base Table!"); + "Unsupported on-clause for local table!"); } RoleInfoCIQ inlineQuery = inline(); inlineQuery.xsetOnClauseInline(true); @@ -218,37 +218,37 @@ return "roleId_NotExistsSubQuery_UserInfoList." + key; } - protected Map _roleId_DeriveSubQuery_RoleMappingListMap; + protected Map _roleId_DerivedReferrer_RoleMappingListMap; - public Map getRoleId_DeriveSubQuery_RoleMappingList() { - return _roleId_DeriveSubQuery_RoleMappingListMap; + public Map getRoleId_DerivedReferrer_RoleMappingList() { + return _roleId_DerivedReferrer_RoleMappingListMap; } - public String keepRoleId_DeriveSubQuery_RoleMappingList( + public String keepRoleId_DerivedReferrer_RoleMappingList( RoleMappingCQ subQuery) { - if (_roleId_DeriveSubQuery_RoleMappingListMap == null) { - _roleId_DeriveSubQuery_RoleMappingListMap = newLinkedHashMap(); + if (_roleId_DerivedReferrer_RoleMappingListMap == null) { + _roleId_DerivedReferrer_RoleMappingListMap = newLinkedHashMap(); } String key = "subQueryMapKey" - + (_roleId_DeriveSubQuery_RoleMappingListMap.size() + 1); - _roleId_DeriveSubQuery_RoleMappingListMap.put(key, subQuery); - return "roleId_DeriveSubQuery_RoleMappingList." + key; + + (_roleId_DerivedReferrer_RoleMappingListMap.size() + 1); + _roleId_DerivedReferrer_RoleMappingListMap.put(key, subQuery); + return "roleId_DerivedReferrer_RoleMappingList." + key; } - protected Map _roleId_DeriveSubQuery_UserInfoListMap; + protected Map _roleId_DerivedReferrer_UserInfoListMap; - public Map getRoleId_DeriveSubQuery_UserInfoList() { - return _roleId_DeriveSubQuery_UserInfoListMap; + public Map getRoleId_DerivedReferrer_UserInfoList() { + return _roleId_DerivedReferrer_UserInfoListMap; } - public String keepRoleId_DeriveSubQuery_UserInfoList(UserInfoCQ subQuery) { - if (_roleId_DeriveSubQuery_UserInfoListMap == null) { - _roleId_DeriveSubQuery_UserInfoListMap = newLinkedHashMap(); + public String keepRoleId_DerivedReferrer_UserInfoList(UserInfoCQ subQuery) { + if (_roleId_DerivedReferrer_UserInfoListMap == null) { + _roleId_DerivedReferrer_UserInfoListMap = newLinkedHashMap(); } String key = "subQueryMapKey" - + (_roleId_DeriveSubQuery_UserInfoListMap.size() + 1); - _roleId_DeriveSubQuery_UserInfoListMap.put(key, subQuery); - return "roleId_DeriveSubQuery_UserInfoList." + key; + + (_roleId_DerivedReferrer_UserInfoListMap.size() + 1); + _roleId_DerivedReferrer_UserInfoListMap.put(key, subQuery); + return "roleId_DerivedReferrer_UserInfoList." + key; } public BsRoleInfoCQ addOrderBy_RoleId_Asc() { @@ -563,7 +563,30 @@ // ========= // Foreign Query // ============= + //========================================================================== + // ========= + // Derived Query + // ============= + protected Map _scalarSubQueryMap; + public Map getScalarSubQuery() { + return _scalarSubQueryMap; + } + + public String keepScalarSubQuery(RoleInfoCQ subQuery) { + if (_scalarSubQueryMap == null) { + _scalarSubQueryMap = newLinkedHashMap(); + } + String key = "subQueryMapKey" + (_scalarSubQueryMap.size() + 1); + _scalarSubQueryMap.put(key, subQuery); + return "scalarSubQuery." + key; + } + + // Very Internal (for Suppressing Warn about 'Not Use Import') + protected String getConditionBeanClassNameInternally() { + return RoleInfoCB.class.getName(); + } + protected String getConditionQueryClassNameInternally() { return RoleInfoCQ.class.getName(); } Modified: board/trunk/src/main/java/jp/sf/pal/board/db/cbean/cq/bs/BsRoleMappingCQ.java =================================================================== --- board/trunk/src/main/java/jp/sf/pal/board/db/cbean/cq/bs/BsRoleMappingCQ.java 2008-12-27 22:06:42 UTC (rev 1624) +++ board/trunk/src/main/java/jp/sf/pal/board/db/cbean/cq/bs/BsRoleMappingCQ.java 2008-12-27 22:09:08 UTC (rev 1625) @@ -5,6 +5,7 @@ import jp.sf.pal.board.db.allcommon.cbean.ConditionQuery; import jp.sf.pal.board.db.allcommon.cbean.cvalue.ConditionValue; import jp.sf.pal.board.db.allcommon.cbean.sqlclause.SqlClause; +import jp.sf.pal.board.db.cbean.RoleMappingCB; import jp.sf.pal.board.db.cbean.cq.RoleInfoCQ; import jp.sf.pal.board.db.cbean.cq.RoleMappingCQ; import jp.sf.pal.board.db.cbean.cq.UserInfoCQ; @@ -15,7 +16,6 @@ * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public class BsRoleMappingCQ extends AbstractBsRoleMappingCQ { //========================================================================== @@ -61,7 +61,7 @@ public RoleMappingCIQ on() { if (isBaseQuery(this)) { throw new UnsupportedOperationException( - "Unsupported onClause of Base Table!"); + "Unsupported on-clause for local table!"); } RoleMappingCIQ inlineQuery = inline(); inlineQuery.xsetOnClauseInline(true); @@ -210,7 +210,6 @@ // ========= // Foreign Query // ============= - public RoleInfoCQ queryRoleInfo() { return getConditionQueryRoleInfo(); } @@ -219,20 +218,13 @@ public RoleInfoCQ getConditionQueryRoleInfo() { if (_conditionQueryRoleInfo == null) { - _conditionQueryRoleInfo = createQueryRoleInfo(); - setupOuterJoin_RoleInfo(); + _conditionQueryRoleInfo = xcreateQueryRoleInfo(); + xsetupOuterJoinRoleInfo(); } return _conditionQueryRoleInfo; } - protected void setupOuterJoin_RoleInfo() { - Map joinOnMap = newLinkedHashMap(); - joinOnMap.put(getRealColumnName("ROLE_ID"), getConditionQueryRoleInfo() - .getRealColumnName("ROLE_ID")); - registerOuterJoin(getConditionQueryRoleInfo(), joinOnMap); - } - - protected RoleInfoCQ createQueryRoleInfo() { + protected RoleInfoCQ xcreateQueryRoleInfo() { String nrp = resolveNextRelationPath("ROLE_MAPPING", "roleInfo"); String jan = resolveJoinAliasName(nrp, getNextNestLevel()); RoleInfoCQ cq = new RoleInfoCQ(this, getSqlClause(), jan, @@ -242,6 +234,14 @@ return cq; } + protected void xsetupOuterJoinRoleInfo() { + RoleInfoCQ cq = getConditionQueryRoleInfo(); + Map joinOnMap = newLinkedHashMap(); + joinOnMap.put(getRealColumnName("ROLE_ID"), cq + .getRealColumnName("ROLE_ID")); + registerOuterJoin(cq, joinOnMap); + } + public boolean hasConditionQueryRoleInfo() { return _conditionQueryRoleInfo != null; } @@ -254,20 +254,13 @@ public UserInfoCQ getConditionQueryUserInfo() { if (_conditionQueryUserInfo == null) { - _conditionQueryUserInfo = createQueryUserInfo(); - setupOuterJoin_UserInfo(); + _conditionQueryUserInfo = xcreateQueryUserInfo(); + xsetupOuterJoinUserInfo(); } return _conditionQueryUserInfo; } - protected void setupOuterJoin_UserInfo() { - Map joinOnMap = newLinkedHashMap(); - joinOnMap.put(getRealColumnName("USER_ID"), getConditionQueryUserInfo() - .getRealColumnName("USER_ID")); - registerOuterJoin(getConditionQueryUserInfo(), joinOnMap); - } - - protected UserInfoCQ createQueryUserInfo() { + protected UserInfoCQ xcreateQueryUserInfo() { String nrp = resolveNextRelationPath("ROLE_MAPPING", "userInfo"); String jan = resolveJoinAliasName(nrp, getNextNestLevel()); UserInfoCQ cq = new UserInfoCQ(this, getSqlClause(), jan, @@ -277,10 +270,42 @@ return cq; } + protected void xsetupOuterJoinUserInfo() { + UserInfoCQ cq = getConditionQueryUserInfo(); + Map joinOnMap = newLinkedHashMap(); + joinOnMap.put(getRealColumnName("USER_ID"), cq + .getRealColumnName("USER_ID")); + registerOuterJoin(cq, joinOnMap); + } + public boolean hasConditionQueryUserInfo() { return _conditionQueryUserInfo != null; } + //========================================================================== + // ========= + // Derived Query + // ============= + protected Map _scalarSubQueryMap; + + public Map getScalarSubQuery() { + return _scalarSubQueryMap; + } + + public String keepScalarSubQuery(RoleMappingCQ subQuery) { + if (_scalarSubQueryMap == null) { + _scalarSubQueryMap = newLinkedHashMap(); + } + String key = "subQueryMapKey" + (_scalarSubQueryMap.size() + 1); + _scalarSubQueryMap.put(key, subQuery); + return "scalarSubQuery." + key; + } + + // Very Internal (for Suppressing Warn about 'Not Use Import') + protected String getConditionBeanClassNameInternally() { + return RoleMappingCB.class.getName(); + } + protected String getConditionQueryClassNameInternally() { return RoleMappingCQ.class.getName(); } Modified: board/trunk/src/main/java/jp/sf/pal/board/db/cbean/cq/bs/BsUserInfoCQ.java =================================================================== --- board/trunk/src/main/java/jp/sf/pal/board/db/cbean/cq/bs/BsUserInfoCQ.java 2008-12-27 22:06:42 UTC (rev 1624) +++ board/trunk/src/main/java/jp/sf/pal/board/db/cbean/cq/bs/BsUserInfoCQ.java 2008-12-27 22:09:08 UTC (rev 1625) @@ -5,6 +5,7 @@ import jp.sf.pal.board.db.allcommon.cbean.ConditionQuery; import jp.sf.pal.board.db.allcommon.cbean.cvalue.ConditionValue; import jp.sf.pal.board.db.allcommon.cbean.sqlclause.SqlClause; +import jp.sf.pal.board.db.cbean.UserInfoCB; import jp.sf.pal.board.db.cbean.cq.GroupInfoCQ; import jp.sf.pal.board.db.cbean.cq.GroupMappingCQ; import jp.sf.pal.board.db.cbean.cq.RoleInfoCQ; @@ -17,7 +18,6 @@ * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public class BsUserInfoCQ extends AbstractBsUserInfoCQ { //========================================================================== @@ -63,7 +63,7 @@ public UserInfoCIQ on() { if (isBaseQuery(this)) { throw new UnsupportedOperationException( - "Unsupported onClause of Base Table!"); + "Unsupported on-clause for local table!"); } UserInfoCIQ inlineQuery = inline(); inlineQuery.xsetOnClauseInline(true); @@ -224,38 +224,38 @@ return "userId_NotExistsSubQuery_RoleMappingList." + key; } - protected Map _userId_DeriveSubQuery_GroupMappingListMap; + protected Map _userId_DerivedReferrer_GroupMappingListMap; - public Map getUserId_DeriveSubQuery_GroupMappingList() { - return _userId_DeriveSubQuery_GroupMappingListMap; + public Map getUserId_DerivedReferrer_GroupMappingList() { + return _userId_DerivedReferrer_GroupMappingListMap; } - public String keepUserId_DeriveSubQuery_GroupMappingList( + public String keepUserId_DerivedReferrer_GroupMappingList( GroupMappingCQ subQuery) { - if (_userId_DeriveSubQuery_GroupMappingListMap == null) { - _userId_DeriveSubQuery_GroupMappingListMap = newLinkedHashMap(); + if (_userId_DerivedReferrer_GroupMappingListMap == null) { + _userId_DerivedReferrer_GroupMappingListMap = newLinkedHashMap(); } String key = "subQueryMapKey" - + (_userId_DeriveSubQuery_GroupMappingListMap.size() + 1); - _userId_DeriveSubQuery_GroupMappingListMap.put(key, subQuery); - return "userId_DeriveSubQuery_GroupMappingList." + key; + + (_userId_DerivedReferrer_GroupMappingListMap.size() + 1); + _userId_DerivedReferrer_GroupMappingListMap.put(key, subQuery); + return "userId_DerivedReferrer_GroupMappingList." + key; } - protected Map _userId_DeriveSubQuery_RoleMappingListMap; + protected Map _userId_DerivedReferrer_RoleMappingListMap; - public Map getUserId_DeriveSubQuery_RoleMappingList() { - return _userId_DeriveSubQuery_RoleMappingListMap; + public Map getUserId_DerivedReferrer_RoleMappingList() { + return _userId_DerivedReferrer_RoleMappingListMap; } - public String keepUserId_DeriveSubQuery_RoleMappingList( + public String keepUserId_DerivedReferrer_RoleMappingList( RoleMappingCQ subQuery) { - if (_userId_DeriveSubQuery_RoleMappingListMap == null) { - _userId_DeriveSubQuery_RoleMappingListMap = newLinkedHashMap(); + if (_userId_DerivedReferrer_RoleMappingListMap == null) { + _userId_DerivedReferrer_RoleMappingListMap = newLinkedHashMap(); } String key = "subQueryMapKey" - + (_userId_DeriveSubQuery_RoleMappingListMap.size() + 1); - _userId_DeriveSubQuery_RoleMappingListMap.put(key, subQuery); - return "userId_DeriveSubQuery_RoleMappingList." + key; + + (_userId_DerivedReferrer_RoleMappingListMap.size() + 1); + _userId_DerivedReferrer_RoleMappingListMap.put(key, subQuery); + return "userId_DerivedReferrer_RoleMappingList." + key; } public BsUserInfoCQ addOrderBy_UserId_Asc() { @@ -622,6 +622,29 @@ return this; } + protected ConditionValue _status; + + public ConditionValue getStatus() { + if (_status == null) { + _status = new ConditionValue(); + } + return _status; + } + + protected ConditionValue getCValueStatus() { + return getStatus(); + } + + public BsUserInfoCQ addOrderBy_Status_Asc() { + regOBA("STATUS"); + return this; + } + + public BsUserInfoCQ addOrderBy_Status_Desc() { + regOBD("STATUS"); + return this; + } + protected ConditionValue _createdTime; public ConditionValue getCreatedTime() { @@ -819,7 +842,6 @@ // ========= // Foreign Query // ============= - public GroupInfoCQ queryGroupInfo() { return getConditionQueryGroupInfo(); } @@ -828,20 +850,13 @@ public GroupInfoCQ getConditionQueryGroupInfo() { if (_conditionQueryGroupInfo == null) { - _conditionQueryGroupInfo = createQueryGroupInfo(); - setupOuterJoin_GroupInfo(); + _conditionQueryGroupInfo = xcreateQueryGroupInfo(); + xsetupOuterJoinGroupInfo(); } return _conditionQueryGroupInfo; } - protected void setupOuterJoin_GroupInfo() { - Map joinOnMap = newLinkedHashMap(); - joinOnMap.put(getRealColumnName("GROUP_ID"), - getConditionQueryGroupInfo().getRealColumnName("GROUP_ID")); - registerOuterJoin(getConditionQueryGroupInfo(), joinOnMap); - } - - protected GroupInfoCQ createQueryGroupInfo() { + protected GroupInfoCQ xcreateQueryGroupInfo() { String nrp = resolveNextRelationPath("USER_INFO", "groupInfo"); String jan = resolveJoinAliasName(nrp, getNextNestLevel()); GroupInfoCQ cq = new GroupInfoCQ(this, getSqlClause(), jan, @@ -851,6 +866,14 @@ return cq; } + protected void xsetupOuterJoinGroupInfo() { + GroupInfoCQ cq = getConditionQueryGroupInfo(); + Map joinOnMap = newLinkedHashMap(); + joinOnMap.put(getRealColumnName("GROUP_ID"), cq + .getRealColumnName("GROUP_ID")); + registerOuterJoin(cq, joinOnMap); + } + public boolean hasConditionQueryGroupInfo() { return _conditionQueryGroupInfo != null; } @@ -863,20 +886,13 @@ public RoleInfoCQ getConditionQueryRoleInfo() { if (_conditionQueryRoleInfo == null) { - _conditionQueryRoleInfo = createQueryRoleInfo(); - setupOuterJoin_RoleInfo(); + _conditionQueryRoleInfo = xcreateQueryRoleInfo(); + xsetupOuterJoinRoleInfo(); } return _conditionQueryRoleInfo; } - protected void setupOuterJoin_RoleInfo() { - Map joinOnMap = newLinkedHashMap(); - joinOnMap.put(getRealColumnName("ROLE_ID"), getConditionQueryRoleInfo() - .getRealColumnName("ROLE_ID")); - registerOuterJoin(getConditionQueryRoleInfo(), joinOnMap); - } - - protected RoleInfoCQ createQueryRoleInfo() { + protected RoleInfoCQ xcreateQueryRoleInfo() { String nrp = resolveNextRelationPath("USER_INFO", "roleInfo"); String jan = resolveJoinAliasName(nrp, getNextNestLevel()); RoleInfoCQ cq = new RoleInfoCQ(this, getSqlClause(), jan, @@ -886,10 +902,42 @@ return cq; } + protected void xsetupOuterJoinRoleInfo() { + RoleInfoCQ cq = getConditionQueryRoleInfo(); + Map joinOnMap = newLinkedHashMap(); + joinOnMap.put(getRealColumnName("ROLE_ID"), cq + .getRealColumnName("ROLE_ID")); + registerOuterJoin(cq, joinOnMap); + } + public boolean hasConditionQueryRoleInfo() { return _conditionQueryRoleInfo != null; } + //========================================================================== + // ========= + // Derived Query + // ============= + protected Map _scalarSubQueryMap; + + public Map getScalarSubQuery() { + return _scalarSubQueryMap; + } + + public String keepScalarSubQuery(UserInfoCQ subQuery) { + if (_scalarSubQueryMap == null) { + _scalarSubQueryMap = newLinkedHashMap(); + } + String key = "subQueryMapKey" + (_scalarSubQueryMap.size() + 1); + _scalarSubQueryMap.put(key, subQuery); + return "scalarSubQuery." + key; + } + + // Very Internal (for Suppressing Warn about 'Not Use Import') + protected String getConditionBeanClassNameInternally() { + return UserInfoCB.class.getName(); + } + protected String getConditionQueryClassNameInternally() { return UserInfoCQ.class.getName(); } Modified: board/trunk/src/main/java/jp/sf/pal/board/db/cbean/cq/ciq/AttachmentCIQ.java =================================================================== --- board/trunk/src/main/java/jp/sf/pal/board/db/cbean/cq/ciq/AttachmentCIQ.java 2008-12-27 22:06:42 UTC (rev 1624) +++ board/trunk/src/main/java/jp/sf/pal/board/db/cbean/cq/ciq/AttachmentCIQ.java 2008-12-27 22:09:08 UTC (rev 1625) @@ -5,6 +5,7 @@ import jp.sf.pal.board.db.allcommon.cbean.coption.ConditionOption; import jp.sf.pal.board.db.allcommon.cbean.cvalue.ConditionValue; import jp.sf.pal.board.db.allcommon.cbean.sqlclause.SqlClause; +import jp.sf.pal.board.db.cbean.AttachmentCB; import jp.sf.pal.board.db.cbean.cq.AttachmentCQ; import jp.sf.pal.board.db.cbean.cq.MessageAttachmentCQ; import jp.sf.pal.board.db.cbean.cq.bs.AbstractBsAttachmentCQ; @@ -15,7 +16,6 @@ * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public class AttachmentCIQ extends AbstractBsAttachmentCQ { //========================================================================== @@ -117,10 +117,10 @@ "NotExistsSubQuery at inline() is unsupported! Sorry!"); } - public String keepId_DeriveSubQuery_MessageAttachmentList( + public String keepId_DerivedReferrer_MessageAttachmentList( MessageAttachmentCQ subQuery) { throw new UnsupportedOperationException( - "DeriveSubQuery at inline() is unsupported! Sorry!"); + "DerivedReferrer at inline() is unsupported! Sorry!"); } protected ConditionValue getCValueData() { @@ -147,6 +147,20 @@ return _myCQ.getCreatedBy(); } + //========================================================================== + // ========= + // Derived Query + // ============= + public String keepScalarSubQuery(AttachmentCQ subQuery) { + throw new UnsupportedOperationException( + "ScalarSubQuery at inline() is unsupported! Sorry!"); + } + + // Very Internal (for Suppressing Warn about 'Not Use Import') + protected String getConditionBeanClassNameInternally() { + return AttachmentCB.class.getName(); + } + protected String getConditionQueryClassNameInternally() { return AttachmentCQ.class.getName(); } Modified: board/trunk/src/main/java/jp/sf/pal/board/db/cbean/cq/ciq/CategoryAccessCIQ.java =================================================================== --- board/trunk/src/main/java/jp/sf/pal/board/db/cbean/cq/ciq/CategoryAccessCIQ.java 2008-12-27 22:06:42 UTC (rev 1624) +++ board/trunk/src/main/java/jp/sf/pal/board/db/cbean/cq/ciq/CategoryAccessCIQ.java 2008-12-27 22:09:08 UTC (rev 1625) @@ -5,6 +5,7 @@ import jp.sf.pal.board.db.allcommon.cbean.coption.ConditionOption; import jp.sf.pal.board.db.allcommon.cbean.cvalue.ConditionValue; import jp.sf.pal.board.db.allcommon.cbean.sqlclause.SqlClause; +import jp.sf.pal.board.db.cbean.CategoryAccessCB; import jp.sf.pal.board.db.cbean.cq.CategoryAccessCQ; import jp.sf.pal.board.db.cbean.cq.CategoryCQ; import jp.sf.pal.board.db.cbean.cq.bs.AbstractBsCategoryAccessCQ; @@ -15,7 +16,6 @@ * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public class CategoryAccessCIQ extends AbstractBsCategoryAccessCQ { //========================================================================== @@ -131,6 +131,20 @@ return _myCQ.getVersionno(); } + //========================================================================== + // ========= + // Derived Query + // ============= + public String keepScalarSubQuery(CategoryAccessCQ subQuery) { + throw new UnsupportedOperationException( + "ScalarSubQuery at inline() is unsupported! Sorry!"); + } + + // Very Internal (for Suppressing Warn about 'Not Use Import') + protected String getConditionBeanClassNameInternally() { + return CategoryAccessCB.class.getName(); + } + protected String getConditionQueryClassNameInternally() { return CategoryAccessCQ.class.getName(); } Modified: board/trunk/src/main/java/jp/sf/pal/board/db/cbean/cq/ciq/CategoryCIQ.java =================================================================== --- board/trunk/src/main/java/jp/sf/pal/board/db/cbean/cq/ciq/CategoryCIQ.java 2008-12-27 22:06:42 UTC (rev 1624) +++ board/trunk/src/main/java/jp/sf/pal/board/db/cbean/cq/ciq/CategoryCIQ.java 2008-12-27 22:09:08 UTC (rev 1625) @@ -5,6 +5,7 @@ import jp.sf.pal.board.db.allcommon.cbean.coption.ConditionOption; import jp.sf.pal.board.db.allcommon.cbean.cvalue.ConditionValue; import jp.sf.pal.board.db.allcommon.cbean.sqlclause.SqlClause; +import jp.sf.pal.board.db.cbean.CategoryCB; import jp.sf.pal.board.db.cbean.cq.CategoryAccessCQ; import jp.sf.pal.board.db.cbean.cq.CategoryCQ; import jp.sf.pal.board.db.cbean.cq.MessageCQ; @@ -16,7 +17,6 @@ * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public class CategoryCIQ extends AbstractBsCategoryCQ { //========================================================================== @@ -136,15 +136,15 @@ "NotExistsSubQuery at inline() is unsupported! Sorry!"); } - public String keepId_DeriveSubQuery_CategoryAccessList( + public String keepId_DerivedReferrer_CategoryAccessList( CategoryAccessCQ subQuery) { throw new UnsupportedOperationException( - "DeriveSubQuery at inline() is unsupported! Sorry!"); + "DerivedReferrer at inline() is unsupported! Sorry!"); } - public String keepId_DeriveSubQuery_MessageList(MessageCQ subQuery) { + public String keepId_DerivedReferrer_MessageList(MessageCQ subQuery) { throw new UnsupportedOperationException( - "DeriveSubQuery at inline() is unsupported! Sorry!"); + "DerivedReferrer at inline() is unsupported! Sorry!"); } protected ConditionValue getCValueName() { @@ -183,6 +183,20 @@ return _myCQ.getVersionno(); } + //========================================================================== + // ========= + // Derived Query + // ============= + public String keepScalarSubQuery(CategoryCQ subQuery) { + throw new UnsupportedOperationException( + "ScalarSubQuery at inline() is unsupported! Sorry!"); + } + + // Very Internal (for Suppressing Warn about 'Not Use Import') + protected String getConditionBeanClassNameInternally() { + return CategoryCB.class.getName(); + } + protected String getConditionQueryClassNameInternally() { return CategoryCQ.class.getName(); } Modified: board/trunk/src/main/java/jp/sf/pal/board/db/cbean/cq/ciq/GroupInfoCIQ.java =================================================================== --- board/trunk/src/main/java/jp/sf/pal/board/db/cbean/cq/ciq/GroupInfoCIQ.java 2008-12-27 22:06:42 UTC (rev 1624) +++ board/trunk/src/main/java/jp/sf/pal/board/db/cbean/cq/ciq/GroupInfoCIQ.java 2008-12-27 22:09:08 UTC (rev 1625) @@ -5,6 +5,7 @@ import jp.sf.pal.board.db.allcommon.cbean.coption.ConditionOption; import jp.sf.pal.board.db.allcommon.cbean.cvalue.ConditionValue; import jp.sf.pal.board.db.allcommon.cbean.sqlclause.SqlClause; +import jp.sf.pal.board.db.cbean.GroupInfoCB; import jp.sf.pal.board.db.cbean.cq.GroupInfoCQ; import jp.sf.pal.board.db.cbean.cq.GroupMappingCQ; import jp.sf.pal.board.db.cbean.cq.UserInfoCQ; @@ -16,7 +17,6 @@ * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public class GroupInfoCIQ extends AbstractBsGroupInfoCQ { //========================================================================== @@ -137,15 +137,15 @@ "NotExistsSubQuery at inline() is unsupported! Sorry!"); } - public String keepGroupId_DeriveSubQuery_GroupMappingList( + public String keepGroupId_DerivedReferrer_GroupMappingList( GroupMappingCQ subQuery) { throw new UnsupportedOperationException( - "DeriveSubQuery at inline() is unsupported! Sorry!"); + "DerivedReferrer at inline() is unsupported! Sorry!"); } - public String keepGroupId_DeriveSubQuery_UserInfoList(UserInfoCQ subQuery) { + public String keepGroupId_DerivedReferrer_UserInfoList(UserInfoCQ subQuery) { throw new UnsupportedOperationException( - "DeriveSubQuery at inline() is unsupported! Sorry!"); + "DerivedReferrer at inline() is unsupported! Sorry!"); } protected ConditionValue getCValueName() { @@ -196,6 +196,20 @@ return _myCQ.getVersionno(); } + //========================================================================== + // ========= + // Derived Query + // ============= + public String keepScalarSubQuery(GroupInfoCQ subQuery) { + throw new UnsupportedOperationException( + "ScalarSubQuery at inline() is unsupported! Sorry!"); + } + + // Very Internal (for Suppressing Warn about 'Not Use Import') + protected String getConditionBeanClassNameInternally() { + return GroupInfoCB.class.getName(); + } + protected String getConditionQueryClassNameInternally() { return GroupInfoCQ.class.getName(); } Modified: board/trunk/src/main/java/jp/sf/pal/board/db/cbean/cq/ciq/GroupMappingCIQ.java =================================================================== --- board/trunk/src/main/java/jp/sf/pal/board/db/cbean/cq/ciq/GroupMappingCIQ.java 2008-12-27 22:06:42 UTC (rev 1624) +++ board/trunk/src/main/java/jp/sf/pal/board/db/cbean/cq/ciq/GroupMappingCIQ.java 2008-12-27 22:09:08 UTC (rev 1625) @@ -5,6 +5,7 @@ import jp.sf.pal.board.db.allcommon.cbean.coption.ConditionOption; import jp.sf.pal.board.db.allcommon.cbean.cvalue.ConditionValue; import jp.sf.pal.board.db.allcommon.cbean.sqlclause.SqlClause; +import jp.sf.pal.board.db.cbean.GroupMappingCB; import jp.sf.pal.board.db.cbean.cq.GroupInfoCQ; import jp.sf.pal.board.db.cbean.cq.GroupMappingCQ; import jp.sf.pal.board.db.cbean.cq.UserInfoCQ; @@ -16,7 +17,6 @@ * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public class GroupMappingCIQ extends AbstractBsGroupMappingCQ { //========================================================================== @@ -112,6 +112,20 @@ return _myCQ.keepGroupId_InScopeSubQuery_GroupInfo(subQuery); } + //========================================================================== + // ========= + // Derived Query + // ============= + public String keepScalarSubQuery(GroupMappingCQ subQuery) { + throw new UnsupportedOperationException( + "ScalarSubQuery at inline() is unsupported! Sorry!"); + } + + // Very Internal (for Suppressing Warn about 'Not Use Import') + protected String getConditionBeanClassNameInternally() { + return GroupMappingCB.class.getName(); + } + protected String getConditionQueryClassNameInternally() { return GroupMappingCQ.class.getName(); } Modified: board/trunk/src/main/java/jp/sf/pal/board/db/cbean/cq/ciq/MessageAttachmentCIQ.java =================================================================== --- board/trunk/src/main/java/jp/sf/pal/board/db/cbean/cq/ciq/MessageAttachmentCIQ.java 2008-12-27 22:06:42 UTC (rev 1624) +++ board/trunk/src/main/java/jp/sf/pal/board/db/cbean/cq/ciq/MessageAttachmentCIQ.java 2008-12-27 22:09:08 UTC (rev 1625) @@ -5,6 +5,7 @@ import jp.sf.pal.board.db.allcommon.cbean.coption.ConditionOption; import jp.sf.pal.board.db.allcommon.cbean.cvalue.ConditionValue; import jp.sf.pal.board.db.allcommon.cbean.sqlclause.SqlClause; +import jp.sf.pal.board.db.cbean.MessageAttachmentCB; import jp.sf.pal.board.db.cbean.cq.AttachmentCQ; import jp.sf.pal.board.db.cbean.cq.MessageAttachmentCQ; import jp.sf.pal.board.db.cbean.cq.MessageCQ; @@ -16,7 +17,6 @@ * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public class MessageAttachmentCIQ extends AbstractBsMessageAttachmentCQ { //========================================================================== @@ -149,6 +149,20 @@ return _myCQ.getVersionno(); } + //========================================================================== + // ========= + // Derived Query + // ============= + public String keepScalarSubQuery(MessageAttachmentCQ subQuery) { + throw new UnsupportedOperationException( + "ScalarSubQuery at inline() is unsupported! Sorry!"); + } + + // Very Internal (for Suppressing Warn about 'Not Use Import') + protected String getConditionBeanClassNameInternally() { + return MessageAttachmentCB.class.getName(); + } + protected String getConditionQueryClassNameInternally() { return MessageAttachmentCQ.class.getName(); } Modified: board/trunk/src/main/java/jp/sf/pal/board/db/cbean/cq/ciq/MessageCIQ.java =================================================================== --- board/trunk/src/main/java/jp/sf/pal/board/db/cbean/cq/ciq/MessageCIQ.java 2008-12-27 22:06:42 UTC (rev 1624) +++ board/trunk/src/main/java/jp/sf/pal/board/db/cbean/cq/ciq/MessageCIQ.java 2008-12-27 22:09:08 UTC (rev 1625) @@ -5,6 +5,7 @@ import jp.sf.pal.board.db.allcommon.cbean.coption.ConditionOption; import jp.sf.pal.board.db.allcommon.cbean.cvalue.ConditionValue; import jp.sf.pal.board.db.allcommon.cbean.sqlclause.SqlClause; +import jp.sf.pal.board.db.cbean.MessageCB; import jp.sf.pal.board.db.cbean.cq.CategoryCQ; import jp.sf.pal.board.db.cbean.cq.MessageAttachmentCQ; import jp.sf.pal.board.db.cbean.cq.MessageCQ; @@ -18,7 +19,6 @@ * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public class MessageCIQ extends AbstractBsMessageCQ { //========================================================================== @@ -160,15 +160,15 @@ "NotExistsSubQuery at inline() is unsupported! Sorry!"); } - public String keepId_DeriveSubQuery_MessageAttachmentList( + public String keepId_DerivedReferrer_MessageAttachmentList( MessageAttachmentCQ subQuery) { throw new UnsupportedOperationException( - "DeriveSubQuery at inline() is unsupported! Sorry!"); + "DerivedReferrer at inline() is unsupported! Sorry!"); } - public String keepId_DeriveSubQuery_ReplyList(ReplyCQ subQuery) { + public String keepId_DerivedReferrer_ReplyList(ReplyCQ subQuery) { throw new UnsupportedOperationException( - "DeriveSubQuery at inline() is unsupported! Sorry!"); + "DerivedReferrer at inline() is unsupported! Sorry!"); } protected ConditionValue getCValueDisplayName() { @@ -231,6 +231,20 @@ return _myCQ.getVersionno(); } + //========================================================================== + // ========= + // Derived Query + // ============= + public String keepScalarSubQuery(MessageCQ subQuery) { + throw new UnsupportedOperationException( + "ScalarSubQuery at inline() is unsupported! Sorry!"); + } + + // Very Internal (for Suppressing Warn about 'Not Use Import') + protected String getConditionBeanClassNameInternally() { + return MessageCB.class.getName(); + } + protected String getConditionQueryClassNameInternally() { return MessageCQ.class.getName(); } Modified: board/trunk/src/main/java/jp/sf/pal/board/db/cbean/cq/ciq/MessageContentCIQ.java =================================================================== --- board/trunk/src/main/java/jp/sf/pal/board/db/cbean/cq/ciq/MessageContentCIQ.java 2008-12-27 22:06:42 UTC (rev 1624) +++ board/trunk/src/main/java/jp/sf/pal/board/db/cbean/cq/ciq/MessageContentCIQ.java 2008-12-27 22:09:08 UTC (rev 1625) @@ -5,6 +5,7 @@ import jp.sf.pal.board.db.allcommon.cbean.coption.ConditionOption; import jp.sf.pal.board.db.allcommon.cbean.cvalue.ConditionValue; import jp.sf.pal.board.db.allcommon.cbean.sqlclause.SqlClause; +import jp.sf.pal.board.db.cbean.MessageContentCB; import jp.sf.pal.board.db.cbean.cq.MessageCQ; import jp.sf.pal.board.db.cbean.cq.MessageContentCQ; import jp.sf.pal.board.db.cbean.cq.bs.AbstractBsMessageContentCQ; @@ -15,7 +16,6 @@ * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public class MessageContentCIQ extends AbstractBsMessageContentCQ { //========================================================================== @@ -103,6 +103,20 @@ return _myCQ.getContent(); } + //========================================================================== + // ========= + // Derived Query + // ============= + public String keepScalarSubQuery(MessageContentCQ subQuery) { + throw new UnsupportedOperationException( + "ScalarSubQuery at inline() is unsupported! Sorry!"); + } + + // Very Internal (for Suppressing Warn about 'Not Use Import') + protected String getConditionBeanClassNameInternally() { + return MessageContentCB.class.getName(); + } + protected String getConditionQueryClassNameInternally() { return MessageContentCQ.class.getName(); } Modified: board/trunk/src/main/java/jp/sf/pal/board/db/cbean/cq/ciq/ReplyCIQ.java =================================================================== --- board/trunk/src/main/java/jp/sf/pal/board/db/cbean/cq/ciq/ReplyCIQ.java 2008-12-27 22:06:42 UTC (rev 1624) +++ board/trunk/src/main/java/jp/sf/pal/board/db/cbean/cq/ciq/ReplyCIQ.java 2008-12-27 22:09:08 UTC (rev 1625) @@ -5,6 +5,7 @@ import jp.sf.pal.board.db.allcommon.cbean.coption.ConditionOption; import jp.sf.pal.board.db.allcommon.cbean.cvalue.ConditionValue; import jp.sf.pal.board.db.allcommon.cbean.sqlclause.SqlClause; +import jp.sf.pal.board.db.cbean.ReplyCB; import jp.sf.pal.board.db.cbean.cq.MessageCQ; import jp.sf.pal.board.db.cbean.cq.ReplyCQ; import jp.sf.pal.board.db.cbean.cq.bs.AbstractBsReplyCQ; @@ -15,7 +16,6 @@ * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public class ReplyCIQ extends AbstractBsReplyCQ { //========================================================================== @@ -127,6 +127,20 @@ return _myCQ.getDeletedBy(); } + //========================================================================== + // ========= + // Derived Query + // ============= + public String keepScalarSubQuery(ReplyCQ subQuery) { + throw new UnsupportedOperationException( + "ScalarSubQuery at inline() is unsupported! Sorry!"); + } + + // Very Internal (for Suppressing Warn about 'Not Use Import') + protected String getConditionBeanClassNameInternally() { + return ReplyCB.class.getName(); + } + protected String getConditionQueryClassNameInternally() { return ReplyCQ.class.getName(); } Modified: board/trunk/src/main/java/jp/sf/pal/board/db/cbean/cq/ciq/RoleInfoCIQ.java =================================================================== --- board/trunk/src/main/java/jp/sf/pal/board/db/cbean/cq/ciq/RoleInfoCIQ.java 2008-12-27 22:06:42 UTC (rev 1624) +++ board/trunk/src/main/java/jp/sf/pal/board/db/cbean/cq/ciq/RoleInfoCIQ.java 2008-12-27 22:09:08 UTC (rev 1625) @@ -5,6 +5,7 @@ import jp.sf.pal.board.db.allcommon.cbean.coption.ConditionOption; import jp.sf.pal.board.db.allcommon.cbean.cvalue.ConditionValue; import jp.sf.pal.board.db.allcommon.cbean.sqlclause.SqlClause; +import jp.sf.pal.board.db.cbean.RoleInfoCB; import jp.sf.pal.board.db.cbean.cq.RoleInfoCQ; import jp.sf.pal.board.db.cbean.cq.RoleMappingCQ; import jp.sf.pal.board.db.cbean.cq.UserInfoCQ; @@ -16,7 +17,6 @@ * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public class RoleInfoCIQ extends AbstractBsRoleInfoCQ { //========================================================================== @@ -136,15 +136,15 @@ "NotExistsSubQuery at inline() is unsupported! Sorry!"); } - public String keepRoleId_DeriveSubQuery_RoleMappingList( + public String keepRoleId_DerivedReferrer_RoleMappingList( RoleMappingCQ subQuery) { throw new UnsupportedOperationException( - "DeriveSubQuery at inline() is unsupported! Sorry!"); + "DerivedReferrer at inline() is unsupported! Sorry!"); } - public String keepRoleId_DeriveSubQuery_UserInfoList(UserInfoCQ subQuery) { + public String keepRoleId_DerivedReferrer_UserInfoList(UserInfoCQ subQuery) { throw new UnsupportedOperationException( - "DeriveSubQuery at inline() is unsupported! Sorry!"); + "DerivedReferrer at inline() is unsupported! Sorry!"); } protected ConditionValue getCValueName() { @@ -195,6 +195,20 @@ return _myCQ.getVersionno(); } + //========================================================================== + // ========= + // Derived Query + // ============= + public String keepScalarSubQuery(RoleInfoCQ subQuery) { + throw new UnsupportedOperationException( + "ScalarSubQuery at inline() is unsupported! Sorry!"); + } + + // Very Internal (for Suppressing Warn about 'Not Use Import') + protected String getConditionBeanClassNameInternally() { + return RoleInfoCB.class.getName(); + } + protected String getConditionQueryClassNameInternally() { return RoleInfoCQ.class.getName(); } Modified: board/trunk/src/main/java/jp/sf/pal/board/db/cbean/cq/ciq/RoleMappingCIQ.java =================================================================== --- board/trunk/src/main/java/jp/sf/pal/board/db/cbean/cq/ciq/RoleMappingCIQ.java 2008-12-27 22:06:42 UTC (rev 1624) +++ board/trunk/src/main/java/jp/sf/pal/board/db/cbean/cq/ciq/RoleMappingCIQ.java 2008-12-27 22:09:08 UTC (rev 1625) @@ -5,6 +5,7 @@ import jp.sf.pal.board.db.allcommon.cbean.coption.ConditionOption; import jp.sf.pal.board.db.allcommon.cbean.cvalue.ConditionValue; import jp.sf.pal.board.db.allcommon.cbean.sqlclause.SqlClause; +import jp.sf.pal.board.db.cbean.RoleMappingCB; import jp.sf.pal.board.db.cbean.cq.RoleInfoCQ; import jp.sf.pal.board.db.cbean.cq.RoleMappingCQ; import jp.sf.pal.board.db.cbean.cq.UserInfoCQ; @@ -16,7 +17,6 @@ * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public class RoleMappingCIQ extends AbstractBsRoleMappingCQ { //========================================================================== @@ -112,6 +112,20 @@ return _myCQ.keepRoleId_InScopeSubQuery_RoleInfo(subQuery); } + //========================================================================== + // ========= + // Derived Query + // ============= + public String keepScalarSubQuery(RoleMappingCQ subQuery) { + throw new UnsupportedOperationException( + "ScalarSubQuery at inline() is unsupported! Sorry!"); + } + + // Very Internal (for Suppressing Warn about 'Not Use Import') + protected String getConditionBeanClassNameInternally() { + return RoleMappingCB.class.getName(); + } + protected String getConditionQueryClassNameInternally() { return RoleMappingCQ.class.getName(); } Modified: board/trunk/src/main/java/jp/sf/pal/board/db/cbean/cq/ciq/UserInfoCIQ.java =================================================================== --- board/trunk/src/main/java/jp/sf/pal/board/db/cbean/cq/ciq/UserInfoCIQ.java 2008-12-27 22:06:42 UTC (rev 1624) +++ board/trunk/src/main/java/jp/sf/pal/board/db/cbean/cq/ciq/UserInfoCIQ.java 2008-12-27 22:09:08 UTC (rev 1625) @@ -5,6 +5,7 @@ import jp.sf.pal.board.db.allcommon.cbean.coption.ConditionOption; import jp.sf.pal.board.db.allcommon.cbean.cvalue.ConditionValue; import jp.sf.pal.board.db.allcommon.cbean.sqlclause.SqlClause; +import jp.sf.pal.board.db.cbean.UserInfoCB; import jp.sf.pal.board.db.cbean.cq.GroupInfoCQ; import jp.sf.pal.board.db.cbean.cq.GroupMappingCQ; import jp.sf.pal.board.db.cbean.cq.RoleInfoCQ; @@ -18,7 +19,6 @@ * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public class UserInfoCIQ extends AbstractBsUserInfoCQ { //========================================================================== @@ -142,16 +142,16 @@ "NotExistsSubQuery at inline() is unsupported! Sorry!"); } - public String keepUserId_DeriveSubQuery_GroupMappingList( + public String keepUserId_DerivedReferrer_GroupMappingList( GroupMappingCQ subQuery) { throw new UnsupportedOperationException( - "DeriveSubQuery at inline() is unsupported! Sorry!"); + "DerivedReferrer at inline() is unsupported! Sorry!"); } - public String keepUserId_DeriveSubQuery_RoleMappingList( + public String keepUserId_DerivedReferrer_RoleMappingList( RoleMappingCQ subQuery) { throw new UnsupportedOperationException( - "DeriveSubQuery at inline() is unsupported! Sorry!"); + "DerivedReferrer at inline() is unsupported! Sorry!"); } protected ConditionValue getCValueGivenName() { @@ -218,6 +218,10 @@ return _myCQ.keepGroupId_InScopeSubQuery_GroupInfo(subQuery); } + protected ConditionValue getCValueStatus() { + return _myCQ.getStatus(); + } + protected ConditionValue getCValueCreatedTime() { return _myCQ.getCreatedTime(); } @@ -246,6 +250,20 @@ return _myCQ.getVersionno(); } + //========================================================================== + // ========= + // Derived Query + // ============= + public String keepScalarSubQuery(UserInfoCQ subQuery) { + throw new UnsupportedOperationException( + "ScalarSubQuery at inline() is unsupported! Sorry!"); + } + + // Very Internal (for Suppressing Warn about 'Not Use Import') + protected String getConditionBeanClassNameInternally() { + return UserInfoCB.class.getName(); + } + protected String getConditionQueryClassNameInternally() { return UserInfoCQ.class.getName(); } Modified: board/trunk/src/main/java/jp/sf/pal/board/db/cbean/nss/AttachmentNss.java =================================================================== --- board/trunk/src/main/java/jp/sf/pal/board/db/cbean/nss/AttachmentNss.java 2008-12-27 22:06:42 UTC (rev 1624) +++ board/trunk/src/main/java/jp/sf/pal/board/db/cbean/nss/AttachmentNss.java 2008-12-27 22:09:08 UTC (rev 1625) @@ -7,7 +7,6 @@ * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public class AttachmentNss { protected AttachmentCQ _query; Modified: board/trunk/src/main/java/jp/sf/pal/board/db/cbean/nss/CategoryAccessNss.java =================================================================== --- board/trunk/src/main/java/jp/sf/pal/board/db/cbean/nss/CategoryAccessNss.java 2008-12-27 22:06:42 UTC (rev 1624) +++ board/trunk/src/main/java/jp/sf/pal/board/db/cbean/nss/CategoryAccessNss.java 2008-12-27 22:09:08 UTC (rev 1625) @@ -8,7 +8,6 @@ * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public class CategoryAccessNss { protected CategoryAccessCQ _query; Modified: board/trunk/src/main/java/jp/sf/pal/board/db/cbean/nss/CategoryNss.java =================================================================== --- board/trunk/src/main/java/jp/sf/pal/board/db/cbean/nss/CategoryNss.java 2008-12-27 22:06:42 UTC (rev 1624) +++ board/trunk/src/main/java/jp/sf/pal/board/db/cbean/nss/CategoryNss.java 2008-12-27 22:09:08 UTC (rev 1625) @@ -7,7 +7,6 @@ * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public class CategoryNss { protected CategoryCQ _query; Modified: board/trunk/src/main/java/jp/sf/pal/board/db/cbean/nss/GroupInfoNss.java =================================================================== --- board/trunk/src/main/java/jp/sf/pal/board/db/cbean/nss/GroupInfoNss.java 2008-12-27 22:06:42 UTC (rev 1624) +++ board/trunk/src/main/java/jp/sf/pal/board/db/cbean/nss/GroupInfoNss.java 2008-12-27 22:09:08 UTC (rev 1625) @@ -7,7 +7,6 @@ * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public class GroupInfoNss { protected GroupInfoCQ _query; Modified: board/trunk/src/main/java/jp/sf/pal/board/db/cbean/nss/GroupMappingNss.java =================================================================== --- board/trunk/src/main/java/jp/sf/pal/board/db/cbean/nss/GroupMappingNss.java 2008-12-27 22:06:42 UTC (rev 1624) +++ board/trunk/src/main/java/jp/sf/pal/board/db/cbean/nss/GroupMappingNss.java 2008-12-27 22:09:08 UTC (rev 1625) @@ -8,7 +8,6 @@ * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public class GroupMappingNss { protected GroupMappingCQ _query; Modified: board/trunk/src/main/java/jp/sf/pal/board/db/cbean/nss/MessageAttachmentNss.java =================================================================== --- board/trunk/src/main/java/jp/sf/pal/board/db/cbean/nss/MessageAttachmentNss.java 2008-12-27 22:06:42 UTC (rev 1624) +++ board/trunk/src/main/java/jp/sf/pal/board/db/cbean/nss/MessageAttachmentNss.java 2008-12-27 22:09:08 UTC (rev 1625) @@ -8,7 +8,6 @@ * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public class MessageAttachmentNss { protected MessageAttachmentCQ _query; Modified: board/trunk/src/main/java/jp/sf/pal/board/db/cbean/nss/MessageContentNss.java =================================================================== --- board/trunk/src/main/java/jp/sf/pal/board/db/cbean/nss/MessageContentNss.java 2008-12-27 22:06:42 UTC (rev 1624) +++ board/trunk/src/main/java/jp/sf/pal/board/db/cbean/nss/MessageContentNss.java 2008-12-27 22:09:08 UTC (rev 1625) @@ -8,7 +8,6 @@ * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public class MessageContentNss { protected MessageContentCQ _query; Modified: board/trunk/src/main/java/jp/sf/pal/board/db/cbean/nss/MessageNss.java =================================================================== --- board/trunk/src/main/java/jp/sf/pal/board/db/cbean/nss/MessageNss.java 2008-12-27 22:06:42 UTC (rev 1624) +++ board/trunk/src/main/java/jp/sf/pal/board/db/cbean/nss/MessageNss.java 2008-12-27 22:09:08 UTC (rev 1625) @@ -8,7 +8,6 @@ * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public class MessageNss { protected MessageCQ _query; Modified: board/trunk/src/main/java/jp/sf/pal/board/db/cbean/nss/ReplyNss.java =================================================================== --- board/trunk/src/main/java/jp/sf/pal/board/db/cbean/nss/ReplyNss.java 2008-12-27 22:06:42 UTC (rev 1624) +++ board/trunk/src/main/java/jp/sf/pal/board/db/cbean/nss/ReplyNss.java 2008-12-27 22:09:08 UTC (rev 1625) @@ -8,7 +8,6 @@ * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public class ReplyNss { protected ReplyCQ _query; Modified: board/trunk/src/main/java/jp/sf/pal/board/db/cbean/nss/RoleInfoNss.java =================================================================== --- board/trunk/src/main/java/jp/sf/pal/board/db/cbean/nss/RoleInfoNss.java 2008-12-27 22:06:42 UTC (rev 1624) +++ board/trunk/src/main/java/jp/sf/pal/board/db/cbean/nss/RoleInfoNss.java 2008-12-27 22:09:08 UTC (rev 1625) @@ -7,7 +7,6 @@ * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public class RoleInfoNss { protected RoleInfoCQ _query; Modified: board/trunk/src/main/java/jp/sf/pal/board/db/cbean/nss/RoleMappingNss.java =================================================================== --- board/trunk/src/main/java/jp/sf/pal/board/db/cbean/nss/RoleMappingNss.java 2008-12-27 22:06:42 UTC (rev 1624) +++ board/trunk/src/main/java/jp/sf/pal/board/db/cbean/nss/RoleMappingNss.java 2008-12-27 22:09:08 UTC (rev 1625) @@ -8,7 +8,6 @@ * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public class RoleMappingNss { protected RoleMappingCQ _query; Modified: board/trunk/src/main/java/jp/sf/pal/board/db/cbean/nss/UserInfoNss.java =================================================================== --- board/trunk/src/main/java/jp/sf/pal/board/db/cbean/nss/UserInfoNss.java 2008-12-27 22:06:42 UTC (rev 1624) +++ board/trunk/src/main/java/jp/sf/pal/board/db/cbean/nss/UserInfoNss.java 2008-12-27 22:09:08 UTC (rev 1625) @@ -8,7 +8,6 @@ * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public class UserInfoNss { protected UserInfoCQ _query; Modified: board/trunk/src/main/resources/dbflute.dicon =================================================================== --- board/trunk/src/main/resources/dbflute.dicon 2008-12-27 22:06:42 UTC (rev 1624) +++ board/trunk/src/main/resources/dbflute.dicon 2008-12-27 22:09:08 UTC (rev 1625) @@ -5,113 +5,44 @@ - - - "UTF-8" + + + + + + - + + + + + - - - - + + - - - - - - - - - - - - dbflute.interceptor - - - - - - dbflute.interceptor - - - - - dbflute.interceptor - - - - - dbflute.interceptor - - - - - dbflute.interceptor - - - - - dbflute.interceptor - - - - - dbflute.interceptor - - - - - dbflute.interceptor - - - - - dbflute.interceptor - - - - - dbflute.interceptor - - - - - dbflute.interceptor - - - - - dbflute.interceptor - - - - - dbflute.interceptor - Modified: board/trunk/src/main/webapp/WEB-INF/db/board.data.db =================================================================== (Binary files differ) From svnnotify ¡÷ sourceforge.jp Sun Dec 28 07:10:35 2008 From: svnnotify ¡÷ sourceforge.jp (svnnotify ¡÷ sourceforge.jp) Date: Sun, 28 Dec 2008 07:10:35 +0900 Subject: [pal-cvs 3891] [1626] forgot to add it.. Message-ID: <1230415835.791504.8960.nullmailer@users.sourceforge.jp> Revision: 1626 http://svn.sourceforge.jp/view?root=pal&view=rev&rev=1626 Author: shinsuke Date: 2008-12-28 07:10:35 +0900 (Sun, 28 Dec 2008) Log Message: ----------- forgot to add it.. Added Paths: ----------- board/trunk/src/main/webapp/WEB-INF/db/board.1.log.db -------------- next part -------------- Added: board/trunk/src/main/webapp/WEB-INF/db/board.1.log.db =================================================================== (Binary files differ) Property changes on: board/trunk/src/main/webapp/WEB-INF/db/board.1.log.db ___________________________________________________________________ Name: svn:mime-type + application/octet-stream From svnnotify ¡÷ sourceforge.jp Sun Dec 28 07:11:52 2008 From: svnnotify ¡÷ sourceforge.jp (svnnotify ¡÷ sourceforge.jp) Date: Sun, 28 Dec 2008 07:11:52 +0900 Subject: [pal-cvs 3892] [1627] added status column to userinfo table. Message-ID: <1230415912.023868.10279.nullmailer@users.sourceforge.jp> Revision: 1627 http://svn.sourceforge.jp/view?root=pal&view=rev&rev=1627 Author: shinsuke Date: 2008-12-28 07:11:51 +0900 (Sun, 28 Dec 2008) Log Message: ----------- added status column to userinfo table. replaced with dbflute 0.8.7. Modified Paths: -------------- bookmark/trunk/dbflute/_project.bat bookmark/trunk/dbflute/_project.sh bookmark/trunk/dbflute/build-bookmark.properties bookmark/trunk/mydbflute/README.txt bookmark/trunk/src/main/config/erd/bookmark.erd bookmark/trunk/src/main/config/sql/bookmark.ddl bookmark/trunk/src/main/config/sql/bookmark.dml bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/BehaviorSelector.java bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/CacheBehaviorSelector.java bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/DBFluteConfig.java bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/EntityDefinedCommonColumn.java bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/bhv/AbstractBehaviorReadable.java bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/bhv/AbstractBehaviorWritable.java bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/bhv/BehaviorReadable.java bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/bhv/BehaviorWritable.java bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/cbean/AbstractConditionBean.java bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/cbean/AbstractConditionQuery.java bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/cbean/ConditionBean.java bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/cbean/ConditionBeanContext.java bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/cbean/ConditionQuery.java bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/cbean/ckey/ConditionKey.java bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/cbean/coption/FromToOption.java bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/cbean/coption/LikeSearchOption.java bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/cbean/cvalue/ConditionValue.java bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/cbean/outsidesql/OutsideSqlContext.java bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/cbean/outsidesql/OutsideSqlOption.java bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/cbean/outsidesql/executor/OutsideSqlBasicExecutor.java bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/cbean/outsidesql/executor/OutsideSqlCursorExecutor.java bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/cbean/outsidesql/executor/OutsideSqlEntityExecutor.java bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/cbean/outsidesql/executor/OutsideSqlPagingExecutor.java bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/cbean/sqlclause/AbstractSqlClause.java bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/cbean/sqlclause/SqlClause.java bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/cbean/sqlclause/SqlClauseOracle.java bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/dbmeta/AbstractDBMeta.java bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/dbmeta/DBMeta.java bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/dbmeta/DBMetaInstanceHandler.java bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/dbmeta/hierarchy/HierarchyArranger.java bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/dbmeta/hierarchy/HierarchyRequest.java bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/dbmeta/hierarchy/HierarchyRequestElement.java bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/dbmeta/hierarchy/HierarchySourceColumn.java bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/dbmeta/hierarchy/HierarchySourceIterator.java bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/dbmeta/hierarchy/HierarchySourceRow.java bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/dbmeta/info/ColumnInfo.java bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/dbmeta/info/RelationInfo.java bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/helper/MapStringBuilderImpl.java bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/s2dao/FetchNarrowingResultSetWrapper.java bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/s2dao/internal/rshandler/InternalAbstractDtoMetaDataResultSetHandler.java bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/s2dao/internal/sqlcommand/InternalAbstractAutoStaticCommand.java bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/s2dao/internal/sqlcommand/InternalAbstractBatchAutoStaticCommand.java bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/s2dao/internal/sqlcommand/InternalAbstractDynamicCommand.java bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/s2dao/internal/sqlcommand/InternalAbstractSqlCommand.java bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/s2dao/internal/sqlcommand/InternalDeleteAutoStaticCommand.java bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/s2dao/internal/sqlcommand/InternalDeleteBatchAutoStaticCommand.java bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/s2dao/internal/sqlcommand/InternalDeleteQueryAutoDynamicCommand.java bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/s2dao/internal/sqlcommand/InternalInsertAutoDynamicCommand.java bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/s2dao/internal/sqlcommand/InternalInsertBatchAutoStaticCommand.java bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/s2dao/internal/sqlcommand/InternalProcedureCommand.java bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/s2dao/internal/sqlcommand/InternalUpdateAutoDynamicCommand.java bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/s2dao/internal/sqlcommand/InternalUpdateBatchAutoStaticCommand.java bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/s2dao/internal/sqlcommand/InternalUpdateDynamicCommand.java bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/s2dao/internal/sqlcommand/InternalUpdateQueryAutoDynamicCommand.java bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/s2dao/internal/sqlhandler/InternalAbstractAutoHandler.java bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/s2dao/internal/sqlhandler/InternalAbstractBatchAutoHandler.java bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/s2dao/internal/sqlhandler/InternalBasicHandler.java bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/s2dao/internal/sqlhandler/InternalBasicSelectHandler.java bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/s2dao/internal/sqlhandler/InternalBasicUpdateHandler.java bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/s2dao/internal/sqlhandler/InternalInsertAutoHandler.java bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/s2dao/internal/sqlhandler/InternalInsertBatchAutoHandler.java bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/s2dao/internal/sqlhandler/InternalProcedureHandler.java bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/s2dao/internal/sqlhandler/InternalUpdateAutoHandler.java bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/s2dao/internal/sqlparser/InternalSqlParser.java bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/s2dao/internal/various/InternalProcedureMetaDataFactory.java bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/util/SimpleAssertUtil.java bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/util/SimpleStringUtil.java bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/util/SimpleSystemUtil.java bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/bsbhv/BsBookmarkCategoryBhv.java bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/bsbhv/BsBookmarkLinkBhv.java bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/bsbhv/BsGroupInfoBhv.java bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/bsbhv/BsGroupMappingBhv.java bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/bsbhv/BsRoleInfoBhv.java bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/bsbhv/BsRoleMappingBhv.java bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/bsbhv/BsUserInfoBhv.java bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/bsentity/BsBookmarkCategory.java bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/bsentity/BsBookmarkLink.java bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/bsentity/BsGroupInfo.java bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/bsentity/BsGroupMapping.java bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/bsentity/BsRoleInfo.java bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/bsentity/BsRoleMapping.java bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/bsentity/BsUserInfo.java bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/bsentity/dbmeta/BookmarkCategoryDbm.java bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/bsentity/dbmeta/BookmarkLinkDbm.java bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/bsentity/dbmeta/GroupInfoDbm.java bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/bsentity/dbmeta/GroupMappingDbm.java bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/bsentity/dbmeta/RoleInfoDbm.java bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/bsentity/dbmeta/RoleMappingDbm.java bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/bsentity/dbmeta/UserInfoDbm.java bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/cbean/bs/BsBookmarkCategoryCB.java bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/cbean/bs/BsBookmarkLinkCB.java bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/cbean/bs/BsGroupInfoCB.java bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/cbean/bs/BsGroupMappingCB.java bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/cbean/bs/BsRoleInfoCB.java bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/cbean/bs/BsRoleMappingCB.java bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/cbean/bs/BsUserInfoCB.java bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/cbean/cq/bs/AbstractBsBookmarkCategoryCQ.java bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/cbean/cq/bs/AbstractBsBookmarkLinkCQ.java bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/cbean/cq/bs/AbstractBsGroupInfoCQ.java bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/cbean/cq/bs/AbstractBsGroupMappingCQ.java bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/cbean/cq/bs/AbstractBsRoleInfoCQ.java bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/cbean/cq/bs/AbstractBsRoleMappingCQ.java bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/cbean/cq/bs/AbstractBsUserInfoCQ.java bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/cbean/cq/bs/BsBookmarkCategoryCQ.java bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/cbean/cq/bs/BsBookmarkLinkCQ.java bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/cbean/cq/bs/BsGroupInfoCQ.java bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/cbean/cq/bs/BsGroupMappingCQ.java bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/cbean/cq/bs/BsRoleInfoCQ.java bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/cbean/cq/bs/BsRoleMappingCQ.java bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/cbean/cq/bs/BsUserInfoCQ.java bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/cbean/cq/ciq/BookmarkCategoryCIQ.java bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/cbean/cq/ciq/BookmarkLinkCIQ.java bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/cbean/cq/ciq/GroupInfoCIQ.java bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/cbean/cq/ciq/GroupMappingCIQ.java bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/cbean/cq/ciq/RoleInfoCIQ.java bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/cbean/cq/ciq/RoleMappingCIQ.java bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/cbean/cq/ciq/UserInfoCIQ.java bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/cbean/nss/BookmarkCategoryNss.java bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/cbean/nss/BookmarkLinkNss.java bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/cbean/nss/GroupInfoNss.java bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/cbean/nss/GroupMappingNss.java bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/cbean/nss/RoleInfoNss.java bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/cbean/nss/RoleMappingNss.java bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/cbean/nss/UserInfoNss.java bookmark/trunk/src/main/resources/dbflute.dicon bookmark/trunk/src/main/webapp/WEB-INF/db/bookmark.1.log.db bookmark/trunk/src/main/webapp/WEB-INF/db/bookmark.data.db Added Paths: ----------- bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/CommonColumnAutoSetupper.java bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/CommonColumnBasicAutoSetupper.java bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/DBDef.java bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/bhv/core/ bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/bhv/core/BehaviorCommand.java bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/bhv/core/BehaviorCommandComponentSetup.java bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/bhv/core/BehaviorCommandInvoker.java bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/bhv/core/BehaviorInitializer.java bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/bhv/core/SqlExecution.java bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/bhv/core/SqlExecutionCreator.java bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/bhv/core/command/ bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/bhv/core/command/AbstractBehaviorCommand.java bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/bhv/core/command/AbstractEntityCommand.java bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/bhv/core/command/AbstractListEntityCommand.java bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/bhv/core/command/AbstractOutsideSqlCommand.java bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/bhv/core/command/AbstractOutsideSqlSelectCommand.java bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/bhv/core/command/AbstractSelectCBCommand.java bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/bhv/core/command/BatchDeleteEntityCommand.java bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/bhv/core/command/BatchDeleteNonstrictEntityCommand.java bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/bhv/core/command/BatchInsertEntityCommand.java bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/bhv/core/command/BatchUpdateEntityCommand.java bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/bhv/core/command/BatchUpdateNonstrictEntityCommand.java bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/bhv/core/command/DeleteEntityCommand.java bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/bhv/core/command/DeleteNonstrictEntityCommand.java bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/bhv/core/command/InsertEntityCommand.java bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/bhv/core/command/OutsideSqlCallCommand.java bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/bhv/core/command/OutsideSqlExecuteCommand.java bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/bhv/core/command/OutsideSqlSelectCursorCommand.java bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/bhv/core/command/OutsideSqlSelectListCommand.java bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/bhv/core/command/QueryDeleteCBCommand.java bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/bhv/core/command/QueryUpdateEntityCBCommand.java bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/bhv/core/command/SelectCountCBCommand.java bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/bhv/core/command/SelectListCBCommand.java bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/bhv/core/command/SelectNextValCommand.java bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/bhv/core/command/SelectScalarCBCommand.java bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/bhv/core/command/UpdateEntityCommand.java bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/bhv/core/command/UpdateNonstrictEntityCommand.java bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/bhv/core/execution/ bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/bhv/core/execution/BasicSelectExecution.java bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/bhv/core/execution/OutsideSqlSelectExecution.java bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/bhv/core/execution/SelectCBExecution.java bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/cbean/ScalarQuery.java bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/cbean/ckey/ConditionKeyNotLikeSearch.java bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/helper/StringKeyMap.java bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/helper/StringSet.java bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/s2dao/BeanMetaDataFactoryExtension.java bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/s2dao/PropertyTypeFactoryBuilderExtension.java bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/s2dao/SqlLogRegistryLatestSqlProvider.java bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/s2dao/internal/various/InternalIdentifierAbstractGenerator.java bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/s2dao/internal/various/InternalIdentifierAssignedGenerator.java bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/s2dao/internal/various/InternalIdentifierGeneratorFactory.java bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/s2dao/internal/various/InternalIdentifierIdentityGenerator.java bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/s2dao/internal/various/InternalIdentifierSequenceGenerator.java bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/s2dao/internal/various/InternalStatementFactory.java bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/util/SimpleResourceUtil.java bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/util/SimpleTypeUtil.java Removed Paths: ------------- bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/BFinder.java bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/CacheDaoSelector.java bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/DaoReadable.java bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/DaoSelector.java bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/DaoWritable.java bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/GenMetaData.java bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/annotation/OutsideSql.java bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/cbean/SimpleOrderByBean.java bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/cbean/outsidesql/OutsideSqlDao.java bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/s2dao/FetchNarrowingResultSetFactory.java bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/s2dao/S2BeanMetaDataFactoryImpl.java bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/s2dao/S2DaoInterceptor.java bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/s2dao/S2DaoLatestSqlProvider.java bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/s2dao/S2DaoMetaDataExtension.java bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/s2dao/S2DaoMetaDataFactoryImpl.java bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/s2dao/S2DaoPropertyTypeFactoryBuilderExtension.java bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/s2dao/S2DaoSelectDynamicCommand.java bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/bsdao/ bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/exdao/ -------------- next part -------------- Modified: bookmark/trunk/dbflute/_project.bat =================================================================== --- bookmark/trunk/dbflute/_project.bat 2008-12-27 22:10:35 UTC (rev 1626) +++ bookmark/trunk/dbflute/_project.bat 2008-12-27 22:11:51 UTC (rev 1627) @@ -2,4 +2,4 @@ set MY_PROJECT_NAME=bookmark -set DBFLUTE_HOME=..\mydbflute\dbflute-0.8.2 +set DBFLUTE_HOME=..\mydbflute\dbflute-0.8.7 Modified: bookmark/trunk/dbflute/_project.sh =================================================================== --- bookmark/trunk/dbflute/_project.sh 2008-12-27 22:10:35 UTC (rev 1626) +++ bookmark/trunk/dbflute/_project.sh 2008-12-27 22:11:51 UTC (rev 1627) @@ -2,4 +2,4 @@ export MY_PROJECT_NAME=bookmark -export DBFLUTE_HOME=../mydbflute/dbflute-0.8.2 +export DBFLUTE_HOME=../mydbflute/dbflute-0.8.7 Modified: bookmark/trunk/dbflute/build-bookmark.properties =================================================================== --- bookmark/trunk/dbflute/build-bookmark.properties 2008-12-27 22:10:35 UTC (rev 1626) +++ bookmark/trunk/dbflute/build-bookmark.properties 2008-12-27 22:11:51 UTC (rev 1627) @@ -157,5 +157,5 @@ torque.additionalForeignKeyMap = map:{ \ } -#torque.isDeleteOldTableClass = true +torque.isDeleteOldTableClass = true Modified: bookmark/trunk/mydbflute/README.txt =================================================================== --- bookmark/trunk/mydbflute/README.txt 2008-12-27 22:10:35 UTC (rev 1626) +++ bookmark/trunk/mydbflute/README.txt 2008-12-27 22:11:51 UTC (rev 1627) @@ -1,3 +1,3 @@ -$ mkdir dbflute-0.8.2 -$ cd dbflute-0.8.2 -$ unzip ../dbflute-0.8.2.zip +$ mkdir dbflute-0.8.7 +$ cd dbflute-0.8.7 +$ unzip ../dbflute-0.8.7.zip Modified: bookmark/trunk/src/main/config/erd/bookmark.erd =================================================================== --- bookmark/trunk/src/main/config/erd/bookmark.erd 2008-12-27 22:10:35 UTC (rev 1626) +++ bookmark/trunk/src/main/config/erd/bookmark.erd 2008-12-27 22:11:51 UTC (rev 1627) @@ -204,6 +204,22 @@ + status + Status + + VARCHAR + String + true + 12 + + 1 + false + false + + false + + + created_time Created Time @@ -233,7 +249,7 @@ updated_time Updated Time - + 10 true false @@ -255,7 +271,7 @@ deleted_time Deleted Time - + 10 false false @@ -292,6 +308,11 @@ + + 255 + 255 + 206 + 441 738 @@ -384,7 +405,7 @@ created_time Created Time - + 10 true false @@ -406,7 +427,7 @@ updated_time Updated Time - + 10 true false @@ -428,7 +449,7 @@ deleted_time Deleted Time - + 10 false false @@ -450,7 +471,7 @@ versionNo Version No. - + 10 true false @@ -460,6 +481,11 @@ + + 255 + 255 + 206 + 40 1258 @@ -529,6 +555,11 @@ + + 255 + 255 + 206 + 44 408 @@ -686,7 +717,7 @@ created_time Created Time - + 10 true false @@ -708,7 +739,7 @@ updated_time Updated Time - + 10 true false @@ -730,7 +761,7 @@ deleted_time Deleted Time - + 10 false false @@ -752,7 +783,7 @@ versionNo Version No. - + 10 true false @@ -762,6 +793,11 @@ + + 255 + 255 + 206 + 620 1258 @@ -826,6 +862,11 @@ + + 255 + 255 + 206 + 628 408 @@ -1114,6 +1155,11 @@ + + 255 + 255 + 206 + 456 40 @@ -1309,6 +1355,11 @@ + + 255 + 255 + 206 + 305 408 Modified: bookmark/trunk/src/main/config/sql/bookmark.ddl =================================================================== --- bookmark/trunk/src/main/config/sql/bookmark.ddl 2008-12-27 22:10:35 UTC (rev 1626) +++ bookmark/trunk/src/main/config/sql/bookmark.ddl 2008-12-27 22:11:51 UTC (rev 1627) @@ -6,9 +6,9 @@ DROP TABLE role_info; DROP TABLE group_info; -/********************************** -Table Name: Group Information -**********************************/ +/**********************************/ +/* Table Name: Group Information */ +/**********************************/ CREATE TABLE group_info( group_id VARCHAR(255) NOT NULL PRIMARY KEY, name VARCHAR(100), @@ -25,9 +25,9 @@ versionNo INTEGER NOT NULL ); -/********************************** -Table Name: Role Information -**********************************/ +/**********************************/ +/* Table Name: Role Information */ +/**********************************/ CREATE TABLE role_info( role_id VARCHAR(255) NOT NULL PRIMARY KEY, name VARCHAR(100), @@ -44,9 +44,9 @@ versionNo INTEGER NOT NULL ); -/********************************** -Table Name: User Information -**********************************/ +/**********************************/ +/* Table Name: User Information */ +/**********************************/ CREATE TABLE user_info( user_id VARCHAR(255) NOT NULL PRIMARY KEY, given_name VARCHAR(100), @@ -63,6 +63,7 @@ locale VARCHAR(5), role_id VARCHAR(255), group_id VARCHAR(255), + status VARCHAR(1), created_time TIMESTAMP NOT NULL, created_by VARCHAR(255) NOT NULL, updated_time TIMESTAMP NOT NULL, @@ -74,9 +75,9 @@ FOREIGN KEY (role_id) REFERENCES role_info (role_id) ); -/********************************** -Table Name: Group Mapping -**********************************/ +/**********************************/ +/* Table Name: Group Mapping */ +/**********************************/ CREATE TABLE group_mapping( id INTEGER NOT NULL IDENTITY PRIMARY KEY, user_id VARCHAR(255) NOT NULL, @@ -85,9 +86,9 @@ FOREIGN KEY (group_id) REFERENCES group_info (group_id) ); -/********************************** -Table Name: Role Mapping -**********************************/ +/**********************************/ +/* Table Name: Role Mapping */ +/**********************************/ CREATE TABLE role_mapping( id INT NOT NULL IDENTITY PRIMARY KEY, user_id VARCHAR(255) NOT NULL, @@ -96,9 +97,9 @@ FOREIGN KEY (role_id) REFERENCES role_info (role_id) ); -/********************************** -Table Name: Bookmark Category -**********************************/ +/**********************************/ +/* Table Name: Bookmark Category */ +/**********************************/ CREATE TABLE bookmark_category( id INTEGER NOT NULL IDENTITY PRIMARY KEY, name VARCHAR(100) NOT NULL, @@ -116,9 +117,9 @@ FOREIGN KEY (updated_by) REFERENCES user_info (user_id) ); -/********************************** -Table Name: Bookmark Link -**********************************/ +/**********************************/ +/* Table Name: Bookmark Link */ +/**********************************/ CREATE TABLE bookmark_link( id BIGINT(20) NOT NULL IDENTITY PRIMARY KEY, name VARCHAR(100) NOT NULL, Modified: bookmark/trunk/src/main/config/sql/bookmark.dml =================================================================== --- bookmark/trunk/src/main/config/sql/bookmark.dml 2008-12-27 22:10:35 UTC (rev 1626) +++ bookmark/trunk/src/main/config/sql/bookmark.dml 2008-12-27 22:11:51 UTC (rev 1627) @@ -1,3 +1,3 @@ -insert into user_info (USER_ID, CREATED_TIME, CREATED_BY, UPDATED_TIME, UPDATED_BY, VERSIONNO) values ('admin', '2008-10-15 17:17:37', 'admin', '2008-10-15 17:17:37', 'admin', 0); +insert into user_info (USER_ID, CREATED_TIME, CREATED_BY, UPDATED_TIME, UPDATED_BY, VERSIONNO, STATUS) values ('admin', '2008-10-15 17:17:37', 'admin', '2008-10-15 17:17:37', 'admin', 0, 'A'); insert into BOOKMARK_CATEGORY (ID, NAME, CREATED_TIME, CREATED_BY, SORT_ORDER, UPDATED_TIME, UPDATED_BY, VERSIONNO, MEMO, TYPE) values (1, '(Unclassified)', '2008-10-15 17:17:37', 'admin', 1, '2008-10-15 17:17:37', 'admin', 0, '', 'P'); insert into BOOKMARK_CATEGORY (ID, NAME, CREATED_TIME, CREATED_BY, SORT_ORDER, UPDATED_TIME, UPDATED_BY, VERSIONNO, MEMO, TYPE) values (2, '(Shared)', '2008-10-15 17:17:37', 'admin', 1, '2008-10-15 17:17:37', 'admin', 0, '', 'P'); Deleted: bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/BFinder.java =================================================================== --- bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/BFinder.java 2008-12-27 22:10:35 UTC (rev 1626) +++ bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/BFinder.java 2008-12-27 22:11:51 UTC (rev 1627) @@ -1,110 +0,0 @@ -package jp.sf.pal.bookmark.db.allcommon; - -import jp.sf.pal.bookmark.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 find( - Class behaviorType) { - assertObjectNotNull("behaviorType", behaviorType); - if (!org.seasar.framework.container.factory.SingletonS2ContainerFactory - .hasContainer()) { - synchronized (BFinder.class) { - if (!org.seasar.framework.container.factory.SingletonS2ContainerFactory - .hasContainer()) { - final String configFile = _dbfluteDiconName; - if (org.seasar.framework.util.ResourceUtil - .isExist(configFile)) { - org.seasar.framework.container.factory.SingletonS2ContainerFactory - .setConfigPath(configFile); - org.seasar.framework.container.factory.SingletonS2ContainerFactory - .init(); - } else { - String msg = "S2Container is not initialized! Confirm your initializer and your dicon files."; - throw new IllegalStateException(msg); - } - } - } - } - final org.seasar.framework.container.S2Container container = org.seasar.framework.container.factory.SingletonS2ContainerFactory - .getContainer(); - final BEHAVIOR_TYPE behavior = (BEHAVIOR_TYPE) container - .getComponent(behaviorType); - return behavior; - } - - //========================================================================== - // ========= - // Accessor - // ======== - public static void setDBFluteDiconName(String dbfluteDiconName) { - _dbfluteDiconName = dbfluteDiconName; - } - - //========================================================================== - // ========= - // General Helper - // ============== - /** - * Assert that the object is not null. - * - * @param variableName Variable name. (NotNull) - * @param value Value. (NotNull) - * @exception IllegalArgumentException - */ - protected static void assertObjectNotNull(String variableName, Object value) { - if (variableName == null) { - String msg = "The value should not be null: variableName=" - + variableName + " value=" + value; - throw new IllegalArgumentException(msg); - } - if (value == null) { - String msg = "The value should not be null: variableName=" - + variableName; - throw new IllegalArgumentException(msg); - } - } - - // ---------------------------------------------------------------- - // Assert String - // ------------- - /** - * Assert that the entity is not null and not trimmed empty. - * - * @param variableName Variable name. (NotNull) - * @param value Value. (NotNull) - */ - protected void assertStringNotNullAndNotTrimmedEmpty(String variableName, - String value) { - assertObjectNotNull("variableName", variableName); - assertObjectNotNull("value", value); - if (value.trim().length() == 0) { - String msg = "The value should not be empty: variableName=" - + variableName + " value=" + value; - throw new IllegalArgumentException(msg); - } - } -} Modified: bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/BehaviorSelector.java =================================================================== --- bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/BehaviorSelector.java 2008-12-27 22:10:35 UTC (rev 1626) +++ bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/BehaviorSelector.java 2008-12-27 22:11:51 UTC (rev 1627) @@ -10,8 +10,7 @@ public interface BehaviorSelector { /** - * Initialize condition-bean meta data.
If you call this, Hot Deploy - * of OutsideSql becomes Cool! + * Initialize condition-bean meta data.
*/ public void initializeConditionBeanMetaData(); Modified: bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/CacheBehaviorSelector.java =================================================================== --- bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/CacheBehaviorSelector.java 2008-12-27 22:10:35 UTC (rev 1626) +++ bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/CacheBehaviorSelector.java 2008-12-27 22:11:51 UTC (rev 1627) @@ -1,8 +1,8 @@ package jp.sf.pal.bookmark.db.allcommon; import java.util.Collection; -import java.util.LinkedHashMap; import java.util.Map; +import java.util.concurrent.ConcurrentHashMap; import jp.sf.pal.bookmark.db.allcommon.bhv.BehaviorReadable; import jp.sf.pal.bookmark.db.allcommon.dbmeta.DBMeta; @@ -31,15 +31,14 @@ // Attribute // ========= /** The cache of behavior. (It's the generic hell!) */ - protected Map, BehaviorReadable> _behaviorCache = new LinkedHashMap, BehaviorReadable>(); + protected Map, BehaviorReadable> _behaviorCache = new ConcurrentHashMap, BehaviorReadable>(); //========================================================================== // ========= // Initialize // ========== /** - * Initialize condition-bean meta data.
If you call this, Hot Deploy - * of OutsideSql becomes Cool! + * Initialize condition-bean meta data.
*/ public void initializeConditionBeanMetaData() { final Map dbmetaMap = DBMetaInstanceHandler @@ -53,8 +52,7 @@ } for (DBMeta dbmeta : dbmetas) { final BehaviorReadable bhv = byName(dbmeta.getTableDbName()); - final DaoReadable dao = bhv.getDaoReadable(); - dao.initializeDaoMetaData("selectList"); + bhv.warmUpCommand(); } if (_log.isInfoEnabled()) { long after = System.currentTimeMillis(); Deleted: bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/CacheDaoSelector.java =================================================================== --- bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/CacheDaoSelector.java 2008-12-27 22:10:35 UTC (rev 1626) +++ bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/CacheDaoSelector.java 2008-12-27 22:11:51 UTC (rev 1627) @@ -1,66 +0,0 @@ -package jp.sf.pal.bookmark.db.allcommon; - -import jp.sf.pal.bookmark.db.allcommon.dbmeta.DBMeta; -import jp.sf.pal.bookmark.db.allcommon.dbmeta.DBMetaInstanceHandler; - -/** - * The implementation of DAO-selector. - * - *
- * 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.
- * 
- * - * @author DBFlute(AutoGenerator) - */ - ¡÷ SuppressWarnings("unchecked") -public class CacheDaoSelector extends CacheAbstractSelector implements - DaoSelector { - - //========================================================================== - // ========= - // Selector - // ======== - /** - * Select DAO. - * - * @param The type of DAO. - * @param daoType DAO type. (NotNull) - * @return DAO. (NotNull) - */ - public DAO select(Class 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 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 daoType; - try { - daoType = (Class) Class.forName(daoTypeName); - } catch (ClassNotFoundException e) { - throw new RuntimeException("The class does not exist: " - + daoTypeName, e); - } - return daoType; - } -} Added: bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/CommonColumnAutoSetupper.java =================================================================== --- bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/CommonColumnAutoSetupper.java (rev 0) +++ bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/CommonColumnAutoSetupper.java 2008-12-27 22:11:51 UTC (rev 1627) @@ -0,0 +1,25 @@ +package jp.sf.pal.bookmark.db.allcommon; + +/** + * The auto set-upper of common column. + * + * @author DBFlute(AutoGenerator) + */ +public interface CommonColumnAutoSetupper { + + /** + * Handle common columns of insert if it needs. + * + * @param targetEntity Target entity that the type is entity interface. + * (NotNull) + */ + public void handleCommonColumnOfInsertIfNeeds(Entity targetEntity); + + /** + * Handle common columns of update if it needs. + * + * @param targetEntity Target entity that the type is entity interface. + * (NotNull) + */ + public void handleCommonColumnOfUpdateIfNeeds(Entity targetEntity); +} Property changes on: bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/CommonColumnAutoSetupper.java ___________________________________________________________________ Name: svn:eol-style + native Added: bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/CommonColumnBasicAutoSetupper.java =================================================================== --- bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/CommonColumnBasicAutoSetupper.java (rev 0) +++ bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/CommonColumnBasicAutoSetupper.java 2008-12-27 22:11:51 UTC (rev 1627) @@ -0,0 +1,31 @@ +package jp.sf.pal.bookmark.db.allcommon; + +/** + * The basic implementation of the auto set-upper of common column. + * + * @author DBFlute(AutoGenerator) + */ +public class CommonColumnBasicAutoSetupper implements CommonColumnAutoSetupper { + + //========================================================================== + // =========== + // Set up + // ====== + /** + * Handle common columns of insert if it needs. + * + * @param targetEntity Target entity that the type is entity interface. + * (NotNull) + */ + public void handleCommonColumnOfInsertIfNeeds(Entity targetEntity) { + } + + /** + * Handle common columns of update if it needs. + * + * @param targetEntity Target entity that the type is entity interface. + * (NotNull) + */ + public void handleCommonColumnOfUpdateIfNeeds(Entity targetEntity) { + } +} Property changes on: bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/CommonColumnBasicAutoSetupper.java ___________________________________________________________________ Name: svn:eol-style + native Added: bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/DBDef.java =================================================================== --- bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/DBDef.java (rev 0) +++ bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/DBDef.java 2008-12-27 22:11:51 UTC (rev 1627) @@ -0,0 +1,179 @@ +package jp.sf.pal.bookmark.db.allcommon; + +import java.util.Collections; +import java.util.HashMap; +import java.util.Iterator; +import java.util.Map; +import java.util.Set; + +/** + * The definition of database. + * + * @author DBFlute(AutoGenerator) + */ +public enum DBDef { + + //========================================================================== + // ========= + // ENUM + // ==== + MySQL("mysql", null), PostgreSQL("postgresql", "postgre"), Oracle("oracle", + null), DB2("db2", null), SQLServer("sqlserver", "mssql"), FireBird( + "firebird", null), H2("h2", null), Derby("derby", null), MSAccess( + "msaccess", null), Unknown("unknown", null); + + //========================================================================== + // ========= + // Static Reference + // ================ + // ----------------------------------------------------- + // Code Value + // ---------- + private static final Map _codeValueMap = new HashMap(); + static { + for (DBDef value : values()) { + _codeValueMap.put(value.code().toLowerCase(), value); + } + } + + private static final Map _codeAliasValueMap = new HashMap(); + static { + for (DBDef value : values()) { + if (value.codeAlias() != null) { + _codeAliasValueMap.put(value.codeAlias().toLowerCase(), value); + } + } + } + + /** + * @param code The code of the DB. (Nullable: If the code is null, it + * returns null) + * @return The instance that has the code. (Nullable) + */ + public static DBDef codeOf(String code) { + if (code == null) { + return null; + } + final String lowerCaseCode = code.toLowerCase(); + DBDef def = _codeValueMap.get(lowerCaseCode); + if (def == null) { + def = _codeAliasValueMap.get(lowerCaseCode); + } + return def; + } + + // ----------------------------------------------------- + // Driver Hint + // ----------- + private static final Map _driverHintMap; + static { + final Map tmpMap = new HashMap(); + tmpMap.put("mysql", MySQL); + tmpMap.put("postgresql", PostgreSQL); + tmpMap.put("oracle", Oracle); + tmpMap.put("db2", DB2); + tmpMap.put("sqlserver", SQLServer); + tmpMap.put("firebird", FireBird); + tmpMap.put("org.h2", H2); + tmpMap.put("org.apache.derby", Derby); + _driverHintMap = Collections.unmodifiableMap(tmpMap); + } + + public static DBDef byDriverClassName(String driverClassName) { + final Set keySet = _driverHintMap.keySet(); + for (final Iterator ite = keySet.iterator(); ite.hasNext();) { + final String driverHint = ite.next(); + if (driverClassName.indexOf(driverHint) >= 0) { + final DBDef dbdef = _driverHintMap.get(driverHint); + if (dbdef != null) { + return dbdef; + } + } + } + return null; + } + + //========================================================================== + // ========= + // Current Definition + // ================== + /** The current definition of database. (NotNull, Default 'Unknown') */ + private static DBDef _currentDef; + static { + _currentDef = codeOf("H2"); + if (_currentDef == null) { + _currentDef = Unknown; + } + } + + /** + * @return The current definition of database. (NotNull) + */ + public static DBDef getCurrentDef() { + return _currentDef; + } + + /** + * @param currentDef The current definition of database. (NotNull) + */ + public static void setCurrentDef(DBDef currentDef) { + if (currentDef == null) { + String msg = "The argument 'currentDef' should not be null at DBDef.setCurrentDef()"; + throw new IllegalArgumentException(msg); + } + _currentDef = currentDef; + } + + /** + * @param dbdef The definition of database. (NotNull) + * @return Is the definition of database current? + */ + public static boolean isCurrentDef(DBDef dbdef) { + if (dbdef == null) { + String msg = "The argument 'dbdef' should not be null at DBDef.isCurrentDef()"; + throw new IllegalArgumentException(msg); + } + return _currentDef != null ? _currentDef.equals(dbdef) : false; + } + + //========================================================================== + // ========= + // Attribute + // ========= + /** The code of the DB. (NotNull) */ + private String _code; + + /** The code alias of the DB. (Nullable) */ + private String _codeAlias; + + //========================================================================== + // ========= + // Constructor + // =========== + /** + * @param code The code of the DB. (NotNull) + * @param codeAlias The code alias of the DB. (Nullable) + */ + private DBDef(String code, String codeAlias) { + _code = code; + _codeAlias = codeAlias; + } + + //========================================================================== + // ========= + // Accessor + // ======== + /** + * @return The code of the DB. (NotNull) + */ + public String code() { + return _code; + } + + /** + * @return The code alias of the DB. (Nullable) + */ + private String codeAlias() { + return _codeAlias; + } +} Property changes on: bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/DBDef.java ___________________________________________________________________ Name: svn:eol-style + native Modified: bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/DBFluteConfig.java =================================================================== --- bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/DBFluteConfig.java 2008-12-27 22:10:35 UTC (rev 1626) +++ bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/DBFluteConfig.java 2008-12-27 22:11:51 UTC (rev 1627) @@ -24,10 +24,6 @@ // ========= protected StatementConfig _defaultStatementConfig; - protected boolean _conditionBeanFormatSql = true;// This is for - - // compatibility! - protected boolean _queryLogLevelInfo; protected boolean _executeStatusLogLevelInfo; @@ -36,10 +32,6 @@ protected UniqueConstraintDeterminator _uniqueConstraintDeterminator; - protected boolean _sqlExceptionOldStyleHandling = false;// This is for - - // compatibility! - protected String _logDateFormat; protected String _logTimestampFormat; @@ -92,27 +84,6 @@ //========================================================================== // ========= - // ConditionBean Format Sql - // ======================== - public boolean isConditionBeanFormatSql() { - return _conditionBeanFormatSql; - } - - /** - * @param conditionBeanFormatSql The value of the config. - * @deprecated This is for compatibility! - */ - public void setConditionBeanFormatSql(boolean conditionBeanFormatSql) { - assertNotLocked(); - if (_log.isInfoEnabled()) { - _log.info("...Setting conditionBeanFormatSql: " - + conditionBeanFormatSql); - } - _conditionBeanFormatSql = conditionBeanFormatSql; - } - - //========================================================================== - // ========= // Query Log Level Info // ==================== public boolean isQueryLogLevelInfo() { @@ -184,31 +155,8 @@ public boolean isUniqueConstraintException(Throwable t); } - // [DBFlute-0.7.7] //========================================================================== // ========= - // SQL Exception Old Style - // ======================= - public boolean isSqlExceptionOldStyleHandling() { - return _sqlExceptionOldStyleHandling; - } - - /** - * @param sqlExceptionOldStyleHandling The value of the config. - * @deprecated This is for compatibility! - */ - public void setSqlExceptionOldStyleHandling( - boolean sqlExceptionOldStyleHandling) { - assertNotLocked(); - if (_log.isInfoEnabled()) { - _log.info("...Setting sqlExceptionOldStyleHandling: " - + sqlExceptionOldStyleHandling); - } - _sqlExceptionOldStyleHandling = sqlExceptionOldStyleHandling; - } - - //========================================================================== - // ========= // Log Format // ========== public String getLogDateFormat() { @@ -303,7 +251,6 @@ // ============ public void clear() { // the only properties that update OK while executing _defaultStatementConfig = null; - _conditionBeanFormatSql = true; // as default _queryLogLevelInfo = false; _executeStatusLogLevelInfo = false; _useSqlLogRegistry = false; Deleted: bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/DaoReadable.java =================================================================== --- bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/DaoReadable.java 2008-12-27 22:10:35 UTC (rev 1626) +++ bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/DaoReadable.java 2008-12-27 22:11:51 UTC (rev 1627) @@ -1,11 +0,0 @@ -package jp.sf.pal.bookmark.db.allcommon; - -/** - * The interface of dao-readable. - * - * @author DBFlute(AutoGenerator) - */ -public interface DaoReadable { - public void initializeDaoMetaData(String methodName);// Very Internal - // Method! -} Deleted: bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/DaoSelector.java =================================================================== --- bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/DaoSelector.java 2008-12-27 22:10:35 UTC (rev 1626) +++ bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/DaoSelector.java 2008-12-27 22:11:51 UTC (rev 1627) @@ -1,26 +0,0 @@ -package jp.sf.pal.bookmark.db.allcommon; - -/** - * The interface of DAO-selector. - * - * @author DBFlute(AutoGenerator) - */ -public interface DaoSelector { - - /** - * Select DAO. - * - * @param The type of DAO. - * @param daoType DAO type. (NotNull) - * @return Dao. (NotNull) - */ - public DAO select(Class daoType); - - /** - * Select DAO-readable by name. - * - * @param tableFlexibleName Table flexible name. (NotNull) - * @return DAO-readable. (NotNull) - */ - public DaoReadable byName(String tableFlexibleName); -} Deleted: bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/DaoWritable.java =================================================================== --- bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/DaoWritable.java 2008-12-27 22:10:35 UTC (rev 1626) +++ bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/DaoWritable.java 2008-12-27 22:11:51 UTC (rev 1627) @@ -1,70 +0,0 @@ -package jp.sf.pal.bookmark.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 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 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 entityList); -} Modified: bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/EntityDefinedCommonColumn.java =================================================================== --- bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/EntityDefinedCommonColumn.java 2008-12-27 22:10:35 UTC (rev 1626) +++ bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/EntityDefinedCommonColumn.java 2008-12-27 22:11:51 UTC (rev 1627) @@ -8,6 +8,12 @@ public interface EntityDefinedCommonColumn extends Entity { /** + * Enable common column auto set up. {for after disable because the default + * is enabled} + */ + public void enableCommonColumnAutoSetup(); + + /** * Disable common column auto set up. */ public void disableCommonColumnAutoSetup(); Deleted: bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/GenMetaData.java =================================================================== --- bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/GenMetaData.java 2008-12-27 22:10:35 UTC (rev 1626) +++ bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/GenMetaData.java 2008-12-27 22:11:51 UTC (rev 1627) @@ -1,258 +0,0 @@ -package jp.sf.pal.bookmark.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.bookmark.db.allcommon"; - } - - /** - * Get the property-value of baseBehaviorPackage. - * - * @return The property-value. - */ - public String getBaseBehaviorPackage() { - return "jp.sf.pal.bookmark.db.bsbhv"; - } - - /** - * Get the property-value of baseDaoPackage. - * - * @return The property-value. - */ - public String getBaseDaoPackage() { - return "jp.sf.pal.bookmark.db.bsdao"; - } - - /** - * Get the property-value of baseEntityPackage. - * - * @return The property-value. - */ - public String getBaseEntityPackage() { - return "jp.sf.pal.bookmark.db.bsentity"; - } - - /** - * Get the property-value of conditionBeanPackage. - * - * @return The property-value. - */ - public String getConditionBeanPackage() { - return "jp.sf.pal.bookmark.db.cbean"; - } - - /** - * Get the property-value of extendedDaoPackage. - * - * @return The property-value. - */ - public String getExtendedDaoPackage() { - return "jp.sf.pal.bookmark.db.exdao"; - } - - /** - * Get the property-value of extendedBehaviorPackage. - * - * @return The property-value. - */ - public String getExtendedBehaviorPackage() { - return "jp.sf.pal.bookmark.db.exbhv"; - } - - /** - * Get the property-value of extendedEntityPackage. - * - * @return The property-value. - */ - public String getExtendedEntityPackage() { - return "jp.sf.pal.bookmark.db.exentity"; - } - - //========================================================================== - // ========= - // Optimistic Lock - // =============== - /** - * Get the property-value of updateDateFieldName. - * - * @return The property-value. - */ - public String getUpdateDateFieldName() { - return ""; - } - - /** - * Get the property-value of versionNoFieldName. - * - * @return The property-value. - */ - public String getVersionNoFieldName() { - return ""; - } - - //========================================================================== - // ========= - // Extract - // ======= - /** - * Get the value of 'extractAcceptStartBrace'. - * - * @return The property-value. (NotNull) - */ - public String getExtractAcceptStartBrace() { - return "@{"; - } - - /** - * Get the value of 'extractAcceptEndBrace'. - * - * @return The property-value. (NotNull) - */ - public String getExtractAcceptEndBrace() { - return "@}"; - } - - /** - * Get the value of 'extractAcceptDelimiter'. - * - * @return The property-value. (NotNull) - */ - public String getExtractAcceptDelimiter() { - return "@;"; - } - - /** - * Get the value of 'extractAcceptEqual'. - * - * @return The property-value. (NotNull) - */ - public String getExtractAcceptEqual() { - return "@="; - } -} Deleted: bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/annotation/OutsideSql.java =================================================================== --- bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/annotation/OutsideSql.java 2008-12-27 22:10:35 UTC (rev 1626) +++ bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/annotation/OutsideSql.java 2008-12-27 22:11:51 UTC (rev 1627) @@ -1,18 +0,0 @@ -package jp.sf.pal.bookmark.db.allcommon.annotation; - -import java.lang.annotation.ElementType; -import java.lang.annotation.Inherited; -import java.lang.annotation.Retention; -import java.lang.annotation.RetentionPolicy; -import java.lang.annotation.Target; - - ¡÷ Inherited - ¡÷ Retention(RetentionPolicy.RUNTIME) - ¡÷ Target(ElementType.METHOD) -public @interface OutsideSql { - boolean dynamicBinding() default false; - - boolean offsetByCursor() default false; - - boolean limitByCursor() default false; -} Modified: bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/bhv/AbstractBehaviorReadable.java =================================================================== --- bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/bhv/AbstractBehaviorReadable.java 2008-12-27 22:10:35 UTC (rev 1626) +++ bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/bhv/AbstractBehaviorReadable.java 2008-12-27 22:11:51 UTC (rev 1627) @@ -11,10 +11,16 @@ import java.util.Set; import jp.sf.pal.bookmark.db.allcommon.BehaviorSelector; -import jp.sf.pal.bookmark.db.allcommon.DaoSelector; import jp.sf.pal.bookmark.db.allcommon.Entity; import jp.sf.pal.bookmark.db.allcommon.bhv.batch.TokenFileOutputOption; import jp.sf.pal.bookmark.db.allcommon.bhv.batch.TokenFileOutputResult; +import jp.sf.pal.bookmark.db.allcommon.bhv.core.BehaviorCommand; +import jp.sf.pal.bookmark.db.allcommon.bhv.core.BehaviorCommandInvoker; +import jp.sf.pal.bookmark.db.allcommon.bhv.core.command.AbstractBehaviorCommand; +import jp.sf.pal.bookmark.db.allcommon.bhv.core.command.SelectCountCBCommand; +import jp.sf.pal.bookmark.db.allcommon.bhv.core.command.SelectListCBCommand; +import jp.sf.pal.bookmark.db.allcommon.bhv.core.command.SelectNextValCommand; +import jp.sf.pal.bookmark.db.allcommon.bhv.core.command.SelectScalarCBCommand; import jp.sf.pal.bookmark.db.allcommon.bhv.load.LoadReferrerOption; import jp.sf.pal.bookmark.db.allcommon.bhv.setup.ValueLabelBox; import jp.sf.pal.bookmark.db.allcommon.bhv.setup.ValueLabelSetupper; @@ -25,8 +31,9 @@ import jp.sf.pal.bookmark.db.allcommon.cbean.PagingHandler; import jp.sf.pal.bookmark.db.allcommon.cbean.PagingInvoker; import jp.sf.pal.bookmark.db.allcommon.cbean.PagingResultBean; -import jp.sf.pal.bookmark.db.allcommon.cbean.outsidesql.OutsideSqlDao; +import jp.sf.pal.bookmark.db.allcommon.cbean.ScalarQuery; import jp.sf.pal.bookmark.db.allcommon.cbean.outsidesql.executor.OutsideSqlBasicExecutor; +import jp.sf.pal.bookmark.db.allcommon.cbean.sqlclause.SqlClause; import jp.sf.pal.bookmark.db.allcommon.dbmeta.info.ColumnInfo; import jp.sf.pal.bookmark.db.allcommon.helper.token.file.FileMakingHeaderInfo; import jp.sf.pal.bookmark.db.allcommon.helper.token.file.FileMakingOption; @@ -35,11 +42,10 @@ import jp.sf.pal.bookmark.db.allcommon.util.SimpleSystemUtil; /** - * The abstract class of behavior-readable. + * The abstract class of readable behavior. * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public abstract class AbstractBehaviorReadable implements BehaviorReadable { //========================================================================== @@ -50,13 +56,13 @@ * Behavior-selector instance. It's basically referred at loadReferrer. * (Required for loadReferrer) */ - protected BehaviorSelector _behaviorSelector; + protected BehaviorCommandInvoker _behaviorCommandInvoker; /** - * Dao-selector instance. It's basically referred at loadReferrer. (Required - * for OutsideSql) + * Behavior-selector instance. It's basically referred at loadReferrer. + * (Required for loadReferrer) */ - protected DaoSelector _daoSelector; + protected BehaviorSelector _behaviorSelector; //========================================================================== // =========== @@ -83,7 +89,7 @@ * @return Read count. (NotNull) */ public int readCount(ConditionBean cb) { - assertConditionBeanNotNull(cb); + assertCBNotNull(cb); return callReadCount(cb); } @@ -100,7 +106,7 @@ * When the entity has been duplicated. */ public Entity readEntity(ConditionBean cb) { - assertConditionBeanNotNull(cb); + assertCBNotNull(cb); final List ls = readList(cb); if (ls.isEmpty()) { return null; @@ -120,7 +126,7 @@ * When the entity has been duplicated. */ public Entity readEntityWithDeletedCheck(ConditionBean cb) { - assertConditionBeanNotNull(cb); + assertCBNotNull(cb); final List ls = readList(cb); assertEntityNotDeleted(ls, cb); assertEntitySelectedAsOne(ls, cb); @@ -133,7 +139,7 @@ // =========================== protected ENTITY helpSelectEntityInternally( CB cb, InternalSelectEntityCallback callback) { - assertConditionBeanNotNull(cb); + assertCBNotNull(cb); cb.checkSafetyResult(1); List ls = null; try { @@ -156,7 +162,7 @@ protected ENTITY helpSelectEntityWithDeletedCheckInternally( CB cb, InternalSelectEntityWithDeletedCheckCallback callback) { - assertConditionBeanNotNull(cb); + assertCBNotNull(cb); cb.checkSafetyResult(1); List ls = null; try { @@ -175,7 +181,7 @@ } //========================================================================== - // =========== + // ========= // List Read // ========= /** @@ -186,7 +192,7 @@ * list. (NotNull) */ public ListResultBean readList(ConditionBean cb) { - assertConditionBeanNotNull(cb); + assertCBNotNull(cb); return new jp.sf.pal.bookmark.db.allcommon.cbean.ResultBeanBuilder( getTableDbName()).buildListResultBean(cb, callReadList(cb)); } @@ -198,7 +204,7 @@ * @return Read page. (NotNull) */ public PagingResultBean readPage(final ConditionBean cb) { - assertConditionBeanNotNull(cb); + assertCBNotNull(cb); final PagingInvoker invoker = new PagingInvoker( getTableDbName()); final PagingHandler handler = new PagingHandler() { @@ -225,8 +231,7 @@ * @exception jp.sf.pal.bookmark.db.allcommon.exception.EntityAlreadyDeletedException * When the entity has already been deleted. */ - protected void assertEntityNotDeleted( - jp.sf.pal.bookmark.db.allcommon.Entity entity, Object searchKey4Log) { + protected void assertEntityNotDeleted(Entity entity, Object searchKey4Log) { if (entity == null) { throwEntityAlreadyDeletedException(searchKey4Log); } @@ -239,7 +244,8 @@ * @param searchKey4Log Search-key for Logging. (NotNull) * @exception jp.sf.pal.bookmark.db.allcommon.exception.EntityAlreadyDeletedException */ - protected void assertEntityNotDeleted(List ls, Object searchKey4Log) { + protected void assertEntityNotDeleted(List ls, + Object searchKey4Log) { if (ls == null || ls.isEmpty()) { throwEntityAlreadyDeletedException(searchKey4Log); } @@ -253,7 +259,8 @@ * @exception jp.sf.pal.bookmark.db.allcommon.exception.EntityAlreadyDeletedException * @exception jp.sf.pal.bookmark.db.allcommon.exception.EntityDuplicatedException */ - protected void assertEntitySelectedAsOne(List ls, Object searchKey4Log) { + protected void assertEntitySelectedAsOne(List ls, + Object searchKey4Log) { if (ls == null || ls.isEmpty()) { throwEntityAlreadyDeletedException(searchKey4Log); } @@ -274,49 +281,254 @@ //========================================================================== // ========= - // Various Select - // ============== - public OutsideSqlBasicExecutor outsideSql() { - assertDaoSelectorNotNull("outsideSql"); - final OutsideSqlDao outsideSqlDao = _daoSelector - .select(OutsideSqlDao.class); - return new OutsideSqlBasicExecutor(outsideSqlDao, getTableDbName()); - } + // Scalar Select + // ============= + /** + * The scalar function.
This is not static class because this uses + * the method 'invoke(BehaviorCommand)' + * + * @param The type of condition-bean. + * @param The type of result. + */ + public class SLFunction { // SL: ScaLar - private void assertDaoSelectorNotNull(String methodName) { - if (_daoSelector == null) { + /** The condition-bean for scalar select. (NotNull) */ + protected CB _conditionBean; + + /** The condition-bean for scalar select. (NotNull) */ + protected Class _resultType; + + /** + * @param conditionBean The condition-bean initialized only for scalar + * select. (NotNull) + * @param resultType The type os result. (NotNull) + */ + public SLFunction(CB conditionBean, Class resultType) { + _conditionBean = conditionBean; + _resultType = resultType; + } + + /** + * Select the maximum value.
+ * + *
+         * memberBhv.scalarSelect(Date.class).max(new ScalarQuery(MemberCB cb) {
+         *     cb.specify().columnMemberBirthday(); // the required specification of target column
+         *     cb.query().setMemberStatusCode_Equal_Formalized(); // query as you like it
+         * });
+         * 
+ * + * @param scalarQuery The query for scalar. (NotNull) + * @return The maximum value. (Nullable) + */ + public RESULT max(ScalarQuery scalarQuery) { + assertObjectNotNull("scalarQuery", scalarQuery); + return exec(scalarQuery, SqlClause.SelectClauseType.MAX); + } + + /** + * Select the minimum value.
+ * + *
+         * memberBhv.scalarSelect(Date.class).min(new ScalarQuery(MemberCB cb) {
+         *     cb.specify().columnMemberBirthday(); // the required specification of target column
+         *     cb.query().setMemberStatusCode_Equal_Formalized(); // query as you like it
+         * });
+         * 
+ * + * @param scalarQuery The query for scalar. (NotNull) + * @return The minimum value. (Nullable) + */ + public RESULT min(ScalarQuery scalarQuery) { + assertObjectNotNull("scalarQuery", scalarQuery); + return exec(scalarQuery, SqlClause.SelectClauseType.MIN); + } + + /** + * Select the summary value.
+ * + *
+         * purchaseBhv.scalarSelect(Integer.class).sum(new ScalarQuery(PurchaseCB cb) {
+         *     cb.specify().columnPurchaseCount(); // the required specification of target column
+         *     cb.query().setPurchaseDatetime_GreaterEqual(date); // query as you like it
+         * });
+         * 
+ * + * @param scalarQuery The query for scalar. (NotNull) + * @return The summary value. (Nullable) + */ + public RESULT sum(ScalarQuery scalarQuery) { + assertObjectNotNull("scalarQuery", scalarQuery); + return exec(scalarQuery, SqlClause.SelectClauseType.SUM); + } + + /** + * Select the average value.
+ * + *
+         * purchaseBhv.scalarSelect(Integer.class).avg(new ScalarQuery(PurchaseCB cb) {
+         *     cb.specify().columnPurchaseCount(); // the required specification of target column
+         *     cb.query().setPurchaseDatetime_GreaterEqual(date); // query as you like it
+         * });
+         * 
+ * + * @param scalarQuery The query for scalar. (NotNull) + * @return The average value. (Nullable) + */ + public RESULT avg(ScalarQuery scalarQuery) { + assertObjectNotNull("scalarQuery", scalarQuery); + return exec(scalarQuery, SqlClause.SelectClauseType.AVG); + } + + protected RESULT exec(ScalarQuery scalarQuery, + SqlClause.SelectClauseType selectClauseType) { + assertObjectNotNull("scalarQuery", scalarQuery); + assertObjectNotNull("selectClauseType", selectClauseType); + assertObjectNotNull("conditionBean", _conditionBean); + assertObjectNotNull("resultType", _resultType); + scalarQuery.query(_conditionBean); + assertScalarSelectRequiredSpecifyColumn(); + return invoke(createSelectScalarCBCommand(_conditionBean, + _resultType, selectClauseType)); + } + + protected void assertScalarSelectRequiredSpecifyColumn() { + final String columnName = _conditionBean.getSqlClause() + .getSpecifiedColumnNameAsOne(); + if (columnName == null) { + throwScalarSelectInvalidColumnSpecificationException(); + } + } + + protected void throwScalarSelectInvalidColumnSpecificationException() { String msg = "Look! Read the message below." + getLineSeparator(); msg = msg + "/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *" + getLineSeparator(); - msg = msg - + "Not found the selector of dao as behavior's attributed!" + msg = msg + "The specified column for scalar select was Invalid!" + getLineSeparator(); msg = msg + getLineSeparator(); msg = msg + "[Advice]" + getLineSeparator(); msg = msg - + "Please confirm the definition of the selector at your 'dbflute.dicon'." + + " You should call specify().column[TargetColumn]() only once." + getLineSeparator(); - msg = msg + "It is precondition that '" + methodName - + "()' needs the selector instance." + getLineSeparator(); - msg = msg + getLineSeparator(); - msg = msg + "[Your Behavior's Attributes]" + getLineSeparator(); - msg = msg + " _behaviorSelector : " + _behaviorSelector + msg = msg + " For example:" + getLineSeparator(); + msg = msg + " " + getLineSeparator(); + msg = msg + " [Wrong]" + getLineSeparator(); + msg = msg + " /- - - - - - - - - - - - - - - - - - - - " + getLineSeparator(); - msg = msg + " _daoSelector : " + _daoSelector + msg = msg + + " memberBhv.scalarSelect(Date.class).max(new ScalarQuery() {" + getLineSeparator(); - msg = msg + "* * * * * * * * * */" + getLineSeparator(); - throw new IllegalStateException(msg); + msg = msg + " public void query(MemberCB cb) {" + + getLineSeparator(); + msg = msg + " // *No! It's empty!" + getLineSeparator(); + msg = msg + " }" + getLineSeparator(); + msg = msg + " });" + getLineSeparator(); + msg = msg + " - - - - - - - - - -/" + getLineSeparator(); + msg = msg + " " + getLineSeparator(); + msg = msg + " [Wrong]" + getLineSeparator(); + msg = msg + " /- - - - - - - - - - - - - - - - - - - - " + + getLineSeparator(); + msg = msg + + " memberBhv.scalarSelect(Date.class).max(new ScalarQuery() {" + + getLineSeparator(); + msg = msg + " public void query(MemberCB cb) {" + + getLineSeparator(); + msg = msg + " cb.specify().columnMemberBirthday();" + + getLineSeparator(); + msg = msg + + " cb.specify().columnRegisterDatetime(); // *No! It's duplicated!" + + getLineSeparator(); + msg = msg + " }" + getLineSeparator(); + msg = msg + " });" + getLineSeparator(); + msg = msg + " - - - - - - - - - -/" + getLineSeparator(); + msg = msg + " " + getLineSeparator(); + msg = msg + " [Good!]" + getLineSeparator(); + msg = msg + " /- - - - - - - - - - - - - - - - - - - - " + + getLineSeparator(); + msg = msg + + " memberBhv.scalarSelect(Date.class).max(new ScalarQuery() {" + + getLineSeparator(); + msg = msg + " public void query(MemberCB cb) {" + + getLineSeparator(); + msg = msg + + " cb.specify().columnMemberBirthday(); // *Point!" + + getLineSeparator(); + msg = msg + " }" + getLineSeparator(); + msg = msg + " });" + getLineSeparator(); + msg = msg + " - - - - - - - - - -/" + getLineSeparator(); + msg = msg + getLineSeparator(); + msg = msg + "[ConditionBean Type]" + getLineSeparator() + + _conditionBean.getClass().getName() + getLineSeparator(); + msg = msg + getLineSeparator(); + msg = msg + "[Result Type]" + getLineSeparator() + + _resultType.getName() + getLineSeparator(); + msg = msg + "* * * * * * * * * */"; + throw new ScalarSelectInvalidColumnSpecificationException(msg); } } + public static class ScalarSelectInvalidColumnSpecificationException extends + RuntimeException { + private static final long serialVersionUID = 1L; + + public ScalarSelectInvalidColumnSpecificationException(String msg) { + super(msg); + } + } + + //========================================================================== + // ========= + // OutsideSql + // ========== /** - * Create value-label list. + * Get the basic executor of outside-SQL.
The invoker of behavior + * command should be not null when you call this method. * + *
+     * You can use the methods for outside-SQL are as follows:
+     * {Basic}
+     *   o selectList()
+     *   o execute()
+     *   o call()
+     * 
+     * {Entity}
+     *   o entityHandling().selectEntity()
+     *   o entityHandling().selectEntityWithDeletedCheck()
+     * 
+     * {Cursor}
+     *   o cursorHandling().selectCursor()
+     * 
+     * {Paging}
+     *   o autoPaging().selectList()
+     *   o autoPaging().selectPage()
+     *   o manualPaging().selectList()
+     *   o manualPaging().selectPage()
+     * 
+     * {Option -- Dynamic}
+     *   o dynamicBinding().selectList()
+     * 
+ * + * @return The basic executor of outside-SQL. (NotNull) + */ + public OutsideSqlBasicExecutor outsideSql() { + assertBehaviorCommandInvoker("outsideSql"); + return new OutsideSqlBasicExecutor(_behaviorCommandInvoker, + getTableDbName()); + } + + //========================================================================== + // ========= + // Various Select + // ============== + /** + * Create the list of value-label. + * * @param The type of entity. * @param entityList The list of entity. (NotNull) - * @param valueLabelSetupper Value-label-setupper. (NotNull) - * @return Value-label list. (NotNull) + * @param valueLabelSetupper The setupper of value-label. (NotNull) + * @return The list of value-label. (NotNull) */ public List> createValueLabelList( List entityList, @@ -362,10 +574,10 @@ } } - protected Object helpConvertingSequenceObject(Class resultClass, + protected Object helpConvertingSequenceObject(Class resultClass, Object sequenceObject) { try { - final Constructor constructor = resultClass + final Constructor constructor = resultClass .getConstructor(new Class[] { String.class }); return constructor.newInstance(new Object[] { sequenceObject .toString() }); @@ -534,6 +746,7 @@ * @param value The value of primary key. (Nullable) * @return The value of primary key. (Nullable) */ + @SuppressWarnings("unchecked") protected PK toLowerCasePrimaryKeyIfString(PK value) { return (PK) toLowerCaseIfString(value); } @@ -580,22 +793,22 @@ + "/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *" + getLineSeparator(); msg = msg - + "Not found the selector of behavior as behavior's attributed!" + + "Not found the selector of behavior as behavior's attribute!" + getLineSeparator(); msg = msg + getLineSeparator(); msg = msg + "[Advice]" + getLineSeparator(); msg = msg - + "Please confirm the definition of the selector at your 'dbflute.dicon'." + + "Please confirm the definition of the selector at your component configuration of DBFlute." + getLineSeparator(); msg = msg + "It is precondition that '" + methodName + "()' needs the selector instance." + getLineSeparator(); msg = msg + getLineSeparator(); msg = msg + "[Your Behavior's Attributes]" + getLineSeparator(); - msg = msg + " _behaviorSelector : " + _behaviorSelector + msg = msg + " _behaviorCommandInvoker : " + + _behaviorCommandInvoker + getLineSeparator(); + msg = msg + " _behaviorSelector : " + _behaviorSelector + getLineSeparator(); - msg = msg + " _daoSelector : " + _daoSelector - + getLineSeparator(); - msg = msg + "* * * * * * * * * */" + getLineSeparator(); + msg = msg + "* * * * * * * * * */"; throw new IllegalStateException(msg); } } @@ -648,14 +861,14 @@ public TokenFileOutputResult outputTokenFile(ConditionBean cb, String filename, TokenFileOutputOption tokenFileOutputOption) throws java.io.FileNotFoundException, java.io.IOException { - assertConditionBeanNotNull(cb); + assertCBNotNull(cb); assertStringNotNullAndNotTrimmedEmpty("filename", filename); assertObjectNotNull("tokenFileOutputOption", tokenFileOutputOption); final List ls = readList(cb); List> rowList = new ArrayList>(); - for (java.util.Iterator ite = ls.iterator(); ite.hasNext();) { - final Entity entity = (Entity) ite.next(); + for (java.util.Iterator ite = ls.iterator(); ite.hasNext();) { + final Entity entity = ite.next(); final List valueList = getDBMeta() .convertToColumnStringValueList(entity); rowList.add(valueList); @@ -665,9 +878,9 @@ .getFileMakingOption(); final FileMakingHeaderInfo fileMakingHeaderInfo = new FileMakingHeaderInfo(); final List columnDbNameList = new ArrayList(); - for (final java.util.Iterator ite = getDBMeta().getColumnInfoList() - .iterator(); ite.hasNext();) { - final ColumnInfo columnInfo = (ColumnInfo) ite.next(); + for (final java.util.Iterator ite = getDBMeta() + .getColumnInfoList().iterator(); ite.hasNext();) { + final ColumnInfo columnInfo = ite.next(); columnDbNameList.add(columnInfo.getColumnDbName()); } fileMakingHeaderInfo.setColumnNameList(columnDbNameList); @@ -690,7 +903,7 @@ * @return All count. */ protected int callGetCountAll() { - return readCount(newConditionBean()); + return callReadCount(newConditionBean()); } /** @@ -699,7 +912,7 @@ * @return All list. (NotNull) */ protected List callGetListAll() { - return readList(newConditionBean()); + return callReadList(newConditionBean()); } /** @@ -710,14 +923,12 @@ * @return Read count. (NotNull) */ protected int callReadCount(ConditionBean cb) { - assertConditionBeanNotNull(cb); - final Class[] types = new Class[] { cb.getClass() }; - final java.lang.reflect.Method mtd = getMethod(getDaoReadable() - .getClass(), "selectCount", types); - final Object result = invoke(mtd, getDaoReadable(), new Object[] { cb }); - return ((Integer) result).intValue(); + assertCBNotNull(cb); + return doCallReadCount(cb); } + protected abstract int doCallReadCount(ConditionBean cb); + /** * The implementation. * @@ -727,42 +938,110 @@ * (NotNull) */ protected List 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) result; + assertCBNotNull(cb); + return doCallReadList(cb); } - private Method getMethod(Class clazz, String methodName, Class[] argTypes) { - try { - return clazz.getMethod(methodName, argTypes); - } catch (NoSuchMethodException ex) { - String msg = "class=" + clazz + " method=" + methodName + "-" - + java.util.Arrays.asList(argTypes); - throw new RuntimeException(msg, ex); + protected abstract List doCallReadList(ConditionBean cb); + + //========================================================================== + // ========= + // Behavior Command + // ================ + public void warmUpCommand() { + { + SelectCountCBCommand cmd = createSelectCountCBCommand(newConditionBean()); + cmd.setInitializeOnly(true); + invoke(cmd); } + { + SelectListCBCommand cmd = createSelectListCBCommand( + newConditionBean(), getDBMeta().getEntityType()); + cmd.setInitializeOnly(true); + invoke(cmd); + } } - private Object invoke(Method method, Object target, Object[] args) { - try { - return method.invoke(target, args); - } catch (java.lang.reflect.InvocationTargetException ex) { - Throwable t = ex.getCause(); - if (t instanceof RuntimeException) { - throw (RuntimeException) t; - } - if (t instanceof Error) { - throw (Error) t; - } - String msg = "target=" + target + " method=" + method + "-" - + java.util.Arrays.asList(args); - throw new RuntimeException(msg, ex); - } catch (IllegalAccessException ex) { - String msg = "target=" + target + " method=" + method + "-" - + java.util.Arrays.asList(args); - throw new RuntimeException(msg, ex); + protected SelectCountCBCommand createSelectCountCBCommand(ConditionBean cb) { + assertBehaviorCommandInvoker("createSelectCountCBCommand"); + final SelectCountCBCommand command = xsetupSelectCommand(new SelectCountCBCommand()); + command.setConditionBeanType(cb.getClass()); + command.setConditionBean(cb); + return command; + } + + protected SelectListCBCommand createSelectListCBCommand( + ConditionBean cb, Class entityType) { + assertBehaviorCommandInvoker("createSelectListCBCommand"); + final SelectListCBCommand command = xsetupSelectCommand(new SelectListCBCommand()); + command.setConditionBeanType(cb.getClass()); + command.setConditionBean(cb); + command.setEntityType(entityType); + return command; + } + + protected SelectNextValCommand createSelectNextValCommand( + Class resultType) { + assertBehaviorCommandInvoker("createSelectNextValCommand"); + final SelectNextValCommand command = xsetupSelectCommand(new SelectNextValCommand()); + command.setResultType(resultType); + return command; + } + + protected SelectScalarCBCommand createSelectScalarCBCommand( + ConditionBean cb, Class resultType, + SqlClause.SelectClauseType selectClauseType) { + assertBehaviorCommandInvoker("createSelectScalarCBCommand"); + final SelectScalarCBCommand command = xsetupSelectCommand(new SelectScalarCBCommand()); + command.setConditionBeanType(cb.getClass()); + command.setConditionBean(cb); + command.setResultType(resultType); + command.setSelectClauseType(selectClauseType); + return command; + } + + private > COMMAND xsetupSelectCommand( + COMMAND command) { + command.setTableDbName(getTableDbName()); + _behaviorCommandInvoker.injectComponentProperty(command); + return command; + } + + /** + * Invoke the command of behavior. + * + * @param The type of result. + * @param behaviorCommand The command of behavior. (NotNull) + * @return The instance of result. (Nullable) + */ + protected RESULT invoke(BehaviorCommand behaviorCommand) { + return _behaviorCommandInvoker.invoke(behaviorCommand); + } + + protected void assertBehaviorCommandInvoker(String methodName) { + if (_behaviorCommandInvoker == null) { + String msg = "Look! Read the message below." + getLineSeparator(); + msg = msg + + "/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *" + + getLineSeparator(); + msg = msg + + "Not found the invoker of behavior command as behavior's attributed!" + + getLineSeparator(); + msg = msg + getLineSeparator(); + msg = msg + "[Advice]" + getLineSeparator(); + msg = msg + + "Please confirm the definition of the invoker at your 'dbflute.dicon'." + + getLineSeparator(); + msg = msg + "It is precondition that '" + methodName + + "()' needs the invoker instance." + getLineSeparator(); + msg = msg + getLineSeparator(); + msg = msg + "[Your Behavior's Attributes]" + getLineSeparator(); + msg = msg + " _behaviorCommandInvoker : " + + _behaviorCommandInvoker + getLineSeparator(); + msg = msg + " _behaviorSelector : " + _behaviorSelector + + getLineSeparator(); + msg = msg + "* * * * * * * * * */"; + throw new IllegalStateException(msg); } } @@ -800,6 +1079,7 @@ return SimpleSystemUtil.getLineSeparator(); } + @SuppressWarnings("unchecked") protected ENTITY helpDowncastInternally( Entity entity, Class clazz) { assertObjectNotNull("entity", entity); @@ -850,8 +1130,16 @@ * * @param cb Condition-bean. (NotNull) */ - protected void assertConditionBeanNotNull( - jp.sf.pal.bookmark.db.allcommon.cbean.ConditionBean cb) { + protected void assertConditionBeanNotNull(ConditionBean cb) { + assertCBNotNull(cb); + } + + /** + * Assert that the condition-bean is not null. + * + * @param cb Condition-bean. (NotNull) + */ + protected void assertCBNotNull(ConditionBean cb) { assertObjectNotNull("cb", cb); } @@ -896,7 +1184,7 @@ * * @param ls List. (NotNull) */ - protected void assertListNotNullAndEmpty(List ls) { + protected void assertListNotNullAndEmpty(List ls) { assertObjectNotNull("ls", ls); if (!ls.isEmpty()) { String msg = "The list should be empty: ls=" + ls.toString(); @@ -909,7 +1197,7 @@ * * @param ls List. (NotNull) */ - protected void assertListNotNullAndNotEmpty(List ls) { + protected void assertListNotNullAndNotEmpty(List ls) { assertObjectNotNull("ls", ls); if (ls.isEmpty()) { String msg = "The list should not be empty: ls=" + ls.toString(); @@ -922,7 +1210,7 @@ * * @param ls List. (NotNull) */ - protected void assertListNotNullAndHasOnlyOne(List ls) { + protected void assertListNotNullAndHasOnlyOne(List ls) { assertObjectNotNull("ls", ls); if (ls.size() != 1) { String msg = "The list should contain only one object: ls=" @@ -936,38 +1224,39 @@ // Accessor // ======== /** - * Get the selector of behavior. + * Get the invoker of behavior command. * - * @return The select of behavior. (Nullable: But normally NotNull) + * @return The invoker of behavior command. (Nullable: But normally NotNull) */ - protected BehaviorSelector getBehaviorSelector() { - return _behaviorSelector; + protected BehaviorCommandInvoker getBehaviorCommandInvoker() { + return _behaviorCommandInvoker; } /** - * Set the selector of behavior. + * Set the invoker of behavior command. * - * @param behaviorSelector The selector of behavior. (NotNull) + * @param behaviorCommandInvoker The invoker of behavior command. (NotNull) */ - public void setBehaviorSelector(BehaviorSelector behaviorSelector) { - this._behaviorSelector = behaviorSelector; + public void setBehaviorCommandInvoker( + BehaviorCommandInvoker behaviorCommandInvoker) { + this._behaviorCommandInvoker = behaviorCommandInvoker; } /** - * Get the selector of DAO. + * Get the selector of behavior. * - * @return The select of DAO. (Nullable: But normally NotNull) + * @return The select of behavior. (Nullable: But normally NotNull) */ - protected DaoSelector getDaoSelector() { - return _daoSelector; + protected BehaviorSelector getBehaviorSelector() { + return _behaviorSelector; } /** - * Set the selector of DAO. + * Set the selector of behavior. * - * @param daoSelector The selector of DAO. (NotNull) + * @param behaviorSelector The selector of behavior. (NotNull) */ - public void setDaoSelector(DaoSelector daoSelector) { - _daoSelector = daoSelector; + public void setBehaviorSelector(BehaviorSelector behaviorSelector) { + this._behaviorSelector = behaviorSelector; } } Modified: bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/bhv/AbstractBehaviorWritable.java =================================================================== --- bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/bhv/AbstractBehaviorWritable.java 2008-12-27 22:10:35 UTC (rev 1626) +++ bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/bhv/AbstractBehaviorWritable.java 2008-12-27 22:11:51 UTC (rev 1627) @@ -4,10 +4,25 @@ import java.util.Iterator; import java.util.List; +import jp.sf.pal.bookmark.db.allcommon.CommonColumnAutoSetupper; import jp.sf.pal.bookmark.db.allcommon.Entity; import jp.sf.pal.bookmark.db.allcommon.bhv.batch.TokenFileReflectionFailure; import jp.sf.pal.bookmark.db.allcommon.bhv.batch.TokenFileReflectionOption; import jp.sf.pal.bookmark.db.allcommon.bhv.batch.TokenFileReflectionResult; +import jp.sf.pal.bookmark.db.allcommon.bhv.core.command.AbstractEntityCommand; +import jp.sf.pal.bookmark.db.allcommon.bhv.core.command.AbstractListEntityCommand; +import jp.sf.pal.bookmark.db.allcommon.bhv.core.command.BatchDeleteEntityCommand; +import jp.sf.pal.bookmark.db.allcommon.bhv.core.command.BatchDeleteNonstrictEntityCommand; +import jp.sf.pal.bookmark.db.allcommon.bhv.core.command.BatchInsertEntityCommand; +import jp.sf.pal.bookmark.db.allcommon.bhv.core.command.BatchUpdateEntityCommand; +import jp.sf.pal.bookmark.db.allcommon.bhv.core.command.BatchUpdateNonstrictEntityCommand; +import jp.sf.pal.bookmark.db.allcommon.bhv.core.command.DeleteEntityCommand; +import jp.sf.pal.bookmark.db.allcommon.bhv.core.command.DeleteNonstrictEntityCommand; +import jp.sf.pal.bookmark.db.allcommon.bhv.core.command.InsertEntityCommand; +import jp.sf.pal.bookmark.db.allcommon.bhv.core.command.QueryDeleteCBCommand; +import jp.sf.pal.bookmark.db.allcommon.bhv.core.command.QueryUpdateEntityCBCommand; +import jp.sf.pal.bookmark.db.allcommon.bhv.core.command.UpdateEntityCommand; +import jp.sf.pal.bookmark.db.allcommon.bhv.core.command.UpdateNonstrictEntityCommand; import jp.sf.pal.bookmark.db.allcommon.cbean.ConditionBean; import jp.sf.pal.bookmark.db.allcommon.dbmeta.DBMeta; import jp.sf.pal.bookmark.db.allcommon.helper.MapStringBuilder; @@ -20,7 +35,7 @@ import jp.sf.pal.bookmark.db.allcommon.helper.token.file.impl.FileTokenImpl; /** - * The abstract class of behavior-writable. + * The abstract class of writable behavior. * * @author DBFlute(AutoGenerator) */ @@ -29,6 +44,31 @@ //========================================================================== // ========= + // Definition + // ========== + /** Map-string map-mark. */ + private static final String MAP_STRING_MAP_MARK = "map:"; + + /** Map-string start-brace. */ + private static final String MAP_STRING_START_BRACE = "@{"; + + /** Map-string end-brace. */ + private static final String MAP_STRING_END_BRACE = "@}"; + + /** Map-string delimiter. */ + private static final String MAP_STRING_DELIMITER = "@;"; + + /** Map-string equal. */ + private static final String MAP_STRING_EQUAL = "@="; + + //========================================================================== + // =========== + // Attribute + // ========= + protected CommonColumnAutoSetupper _commonColumnAutoSetupper; + + //========================================================================== + // ========= // Entity Update // ============= // ----------------------------------------------------- @@ -357,7 +397,7 @@ * @param entityList Entity list. (NotNull and NotEmpty) * @return The array of created count. */ - public int[] lumpCreate(java.util.List entityList) { + public int[] lumpCreate(List entityList) { assertListNotNullAndNotEmpty(entityList); return callCreateList(entityList); } @@ -370,7 +410,7 @@ * @exception jp.sf.pal.bookmark.db.allcommon.exception.EntityAlreadyUpdatedException * If s2dao's version is over 1.0.47 (contains 1.0.47). */ - public int[] lumpModify(java.util.List entityList) { + public int[] lumpModify(List entityList) { assertListNotNullAndNotEmpty(entityList); return callModifyList(entityList); } @@ -383,7 +423,7 @@ * @exception jp.sf.pal.bookmark.db.allcommon.exception.EntityAlreadyUpdatedException * If s2dao's version is over 1.0.47 (contains 1.0.47). */ - public int[] lumpRemove(java.util.List entityList) { + public int[] lumpRemove(List entityList) { assertListNotNullAndNotEmpty(entityList); return callRemoveList(entityList); } @@ -611,9 +651,11 @@ if (!processBeforeInsert(entity)) { return 1;/* as Normal End */ } - return getDaoWritable().create(entity); + return doCallCreate(entity); } + protected abstract int doCallCreate(Entity entity); + /** * Process before insert. * @@ -645,9 +687,11 @@ if (!processBeforeUpdate(entity)) { return 1;/* as Normal End */ } - return getDaoWritable().modifyModifiedOnly(entity); + return doCallModify(entity); } + protected abstract int doCallModify(Entity entity); + /** * Process before update. * @@ -678,9 +722,11 @@ if (!processBeforeDelete(entity)) { return 1;/* as Normal End */ } - return getDaoWritable().remove(entity); + return doCallRemove(entity); } + protected abstract int doCallRemove(Entity entity); + /** * Process before delete. * @@ -729,8 +775,38 @@ * (NotNull) */ protected void setupCommonColumnOfInsertIfNeeds(Entity targetEntity) { + final CommonColumnAutoSetupper setupper = getCommonColumnAutoSetupper(); + assertCommonColumnAutoSetupperNotNull(); + setupper.handleCommonColumnOfInsertIfNeeds(targetEntity); } + private void assertCommonColumnAutoSetupperNotNull() { + if (_commonColumnAutoSetupper == null) { + String msg = "Look! Read the message below." + getLineSeparator(); + msg = msg + + "/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *" + + getLineSeparator(); + msg = msg + + "Not found the auto set-upper of common column as behavior's attribute!" + + getLineSeparator(); + msg = msg + getLineSeparator(); + msg = msg + "[Advice]" + getLineSeparator(); + msg = msg + + "Please confirm the definition of the set-upper at your component configuration of DBFlute." + + getLineSeparator(); + msg = msg + getLineSeparator(); + msg = msg + "[Your Behavior's Attributes]" + getLineSeparator(); + msg = msg + " _behaviorCommandInvoker : " + + _behaviorCommandInvoker + getLineSeparator(); + msg = msg + " _behaviorSelector : " + _behaviorSelector + + getLineSeparator(); + msg = msg + " _commonColumnAutoSetupper : " + + _commonColumnAutoSetupper + getLineSeparator(); + msg = msg + "* * * * * * * * * */"; + throw new IllegalStateException(msg); + } + } + /** * Filter the entity of insert. * @@ -778,6 +854,9 @@ * (NotNull) */ protected void setupCommonColumnOfUpdateIfNeeds(Entity targetEntity) { + final CommonColumnAutoSetupper setupper = getCommonColumnAutoSetupper(); + assertCommonColumnAutoSetupperNotNull(); + setupper.handleCommonColumnOfUpdateIfNeeds(targetEntity); } /** @@ -843,12 +922,14 @@ * (NotNull) * @return Inserted count. */ - public int[] callCreateList(java.util.List entityList) { + public int[] callCreateList(List entityList) { assertObjectNotNull("entityList", entityList); helpFilterBeforeInsertInternally(entityList); - return getDaoWritable().createList(entityList); + return doCreateList(entityList); } + protected abstract int[] doCreateList(List entityList); + /** * The implementation. * @@ -856,12 +937,14 @@ * (NotNull) * @return Updated count. */ - public int[] callModifyList(java.util.List entityList) { + public int[] callModifyList(List entityList) { assertObjectNotNull("entityList", entityList); helpFilterBeforeUpdateInternally(entityList); - return getDaoWritable().modifyList(entityList); + return doModifyList(entityList); } + protected abstract int[] doModifyList(List entityList); + /** * The implementation. * @@ -869,12 +952,14 @@ * (NotNull) * @return Deleted count. */ - public int[] callRemoveList(java.util.List entityList) { + public int[] callRemoveList(List entityList) { assertObjectNotNull("entityList", entityList); helpFilterBeforeDeleteInternally(entityList); - return getDaoWritable().removeList(entityList); + return doRemoveList(entityList); } + protected abstract int[] doRemoveList(List entityList); + protected void assertEntityHasVersionNoValue(Entity entity) { if (!getDBMeta().hasVersionNo()) { return; @@ -994,4 +1079,148 @@ } return filteredList; } + + //========================================================================== + // ========= + // Behavior Command + // ================ + protected InsertEntityCommand createInsertEntityCommand(Entity entity) { + assertBehaviorCommandInvoker("createInsertEntityCommand"); + return xsetupEntityCommand(new InsertEntityCommand(), entity); + } + + protected UpdateEntityCommand createUpdateEntityCommand(Entity entity) { + assertBehaviorCommandInvoker("createUpdateEntityCommand"); + return xsetupEntityCommand(new UpdateEntityCommand(), entity); + } + + protected UpdateNonstrictEntityCommand createUpdateNonstrictEntityCommand( + Entity entity) { + assertBehaviorCommandInvoker("createUpdateNonstrictEntityCommand"); + return xsetupEntityCommand(new UpdateNonstrictEntityCommand(), entity); + } + + protected DeleteEntityCommand createDeleteEntityCommand(Entity entity) { + assertBehaviorCommandInvoker("createDeleteEntityCommand"); + return xsetupEntityCommand(new DeleteEntityCommand(), entity); + } + + protected DeleteNonstrictEntityCommand createDeleteNonstrictEntityCommand( + Entity entity) { + assertBehaviorCommandInvoker("createDeleteNonstrictEntityCommand"); + return xsetupEntityCommand(new DeleteNonstrictEntityCommand(), entity); + } + + private COMMAND xsetupEntityCommand( + COMMAND command, Entity entity) { + command.setTableDbName(getTableDbName()); + _behaviorCommandInvoker.injectComponentProperty(command); + command.setEntityType(entity.getClass()); + command.setEntity(entity); + return command; + } + + protected BatchInsertEntityCommand createBatchInsertEntityCommand( + List entityList) { + assertBehaviorCommandInvoker("createBatchInsertEntityCommand"); + return xsetupListEntityCommand(new BatchInsertEntityCommand(), + entityList); + } + + protected BatchUpdateEntityCommand createBatchUpdateEntityCommand( + List entityList) { + assertBehaviorCommandInvoker("createBatchUpdateEntityCommand"); + return xsetupListEntityCommand(new BatchUpdateEntityCommand(), + entityList); + } + + protected BatchUpdateNonstrictEntityCommand createBatchUpdateNonstrictEntityCommand( + List entityList) { + assertBehaviorCommandInvoker("createBatchUpdateNonstrictEntityCommand"); + return xsetupListEntityCommand(new BatchUpdateNonstrictEntityCommand(), + entityList); + } + + protected BatchDeleteEntityCommand createBatchDeleteEntityCommand( + List entityList) { + assertBehaviorCommandInvoker("createBatchDeleteEntityCommand"); + return xsetupListEntityCommand(new BatchDeleteEntityCommand(), + entityList); + } + + protected BatchDeleteNonstrictEntityCommand createBatchDeleteNonstrictEntityCommand( + List entityList) { + assertBehaviorCommandInvoker("createBatchDeleteNonstrictEntityCommand"); + return xsetupListEntityCommand(new BatchDeleteNonstrictEntityCommand(), + entityList); + } + + /** + * @param The type of behavior command for list entity. + * @param command The command of behavior. (NotNull) + * @param entityList The list of entity. (NotNull, NotEmpty) + * @return The command of behavior. (NotNull) + */ + private COMMAND xsetupListEntityCommand( + COMMAND command, List entityList) { + if (entityList.isEmpty()) { + String msg = "The argument 'entityList' should not be empty: " + + entityList; + throw new IllegalStateException(msg); + } + command.setTableDbName(getTableDbName()); + _behaviorCommandInvoker.injectComponentProperty(command); + command.setEntityType(entityList.get(0).getClass()); // *The list should + // not be empty! + command.setEntityList(entityList); + return command; + } + + protected QueryDeleteCBCommand createQueryDeleteCBCommand(ConditionBean cb) { + assertBehaviorCommandInvoker("createQueryDeleteCBCommand"); + final QueryDeleteCBCommand cmd = new QueryDeleteCBCommand(); + cmd.setTableDbName(getTableDbName()); + _behaviorCommandInvoker.injectComponentProperty(cmd); + cmd.setConditionBeanType(cb.getClass()); + cmd.setConditionBean(cb); + return cmd; + } + + protected QueryUpdateEntityCBCommand createQueryUpdateEntityCBCommand( + Entity entity, ConditionBean cb) { + assertBehaviorCommandInvoker("createQueryUpdateEntityCBCommand"); + final QueryUpdateEntityCBCommand cmd = new QueryUpdateEntityCBCommand(); + cmd.setTableDbName(getTableDbName()); + _behaviorCommandInvoker.injectComponentProperty(cmd); + cmd.setConditionBeanType(cb.getClass()); + cmd.setConditionBean(cb); + cmd.setEntityType(entity.getClass()); + cmd.setEntity(entity); + return cmd; + } + + //========================================================================== + // ========= + // Accessor + // ======== + /** + * Get the auto set-upper of common column. + * + * @return The auto set-upper of common column. (Nullable: But normally + * NotNull) + */ + protected CommonColumnAutoSetupper getCommonColumnAutoSetupper() { + return _commonColumnAutoSetupper; + } + + /** + * Set the auto set-upper of common column. + * + * @param commonColumnAutoSetupper The auto set-upper of common column. + * (NotNull) + */ + public void setCommonColumnAutoSetupper( + CommonColumnAutoSetupper commonColumnAutoSetupper) { + this._commonColumnAutoSetupper = commonColumnAutoSetupper; + } } Modified: bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/bhv/BehaviorReadable.java =================================================================== --- bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/bhv/BehaviorReadable.java 2008-12-27 22:10:35 UTC (rev 1626) +++ bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/bhv/BehaviorReadable.java 2008-12-27 22:11:51 UTC (rev 1627) @@ -1,6 +1,5 @@ package jp.sf.pal.bookmark.db.allcommon.bhv; -import jp.sf.pal.bookmark.db.allcommon.DaoReadable; import jp.sf.pal.bookmark.db.allcommon.Entity; import jp.sf.pal.bookmark.db.allcommon.cbean.ConditionBean; import jp.sf.pal.bookmark.db.allcommon.cbean.ListResultBean; @@ -16,34 +15,12 @@ //========================================================================== // ========= - // Definition - // ========== - /** Map-string map-mark. */ - public static final String MAP_STRING_MAP_MARK = "map:"; - - /** Map-string list-mark. */ - public static final String MAP_STRING_LIST_MARK = "list:"; - - /** Map-string start-brace. */ - public static final String MAP_STRING_START_BRACE = "@{"; - - /** Map-string end-brace. */ - public static final String MAP_STRING_END_BRACE = "@}"; - - /** Map-string delimiter. */ - public static final String MAP_STRING_DELIMITER = "@;"; - - /** Map-string equal. */ - public static final String MAP_STRING_EQUAL = "@="; - - //========================================================================== - // ========= // Table name // ========== /** - * Get table db-name. + * Get table DB name. * - * @return Table db-name. (NotNull) + * @return Table DB name. (NotNull) */ public String getTableDbName(); @@ -52,25 +29,14 @@ // DBMeta // ====== /** - * Get dbmeta. + * Get the instance of DBMeta. * - * @return DBMeta. (NotNull) + * @return The instance of DBMeta. (NotNull) */ public DBMeta getDBMeta(); //========================================================================== // ========= - // Dao Accessor - // ============ - /** - * Get dao-readable. - * - * @return Dao-readable. (NotNull) - */ - public DaoReadable getDaoReadable(); - - //========================================================================== - // ========= // New Instance // ============ /** @@ -173,4 +139,13 @@ * @return The value of sequence. (NotNull) */ public java.math.BigDecimal readNextVal(); + + //========================================================================== + // ========= + // Warm Up + // ======= + /** + * Warm up the command of behavior. + */ + public void warmUpCommand(); } Modified: bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/bhv/BehaviorWritable.java =================================================================== --- bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/bhv/BehaviorWritable.java 2008-12-27 22:10:35 UTC (rev 1626) +++ bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/bhv/BehaviorWritable.java 2008-12-27 22:11:51 UTC (rev 1627) @@ -1,6 +1,7 @@ package jp.sf.pal.bookmark.db.allcommon.bhv; -import jp.sf.pal.bookmark.db.allcommon.DaoWritable; +import java.util.List; + import jp.sf.pal.bookmark.db.allcommon.Entity; /** @@ -10,13 +11,6 @@ */ public interface BehaviorWritable extends BehaviorReadable { - /** - * Get dao-writable. - * - * @return Dao-writable. (NotNull) - */ - public DaoWritable getDaoWritable(); - //========================================================================== // =========== // Basic Entity Update @@ -116,15 +110,15 @@ /** * Lump create the list. * - * @param entityList Entity-list. (NotNull and NotEmpty) + * @param entityList The list of entity. (NotNull and NotEmpty) * @return The array of created count. */ - public int[] lumpCreate(java.util.List entityList); + public int[] lumpCreate(List entityList); /** - * Lump Modify the list. + * Lump modify the list. * - * @param entityList Entity-list. (NotNull and NotEmpty) + * @param entityList The list of entity. (NotNull and NotEmpty) * @return Modified count. * @exception jp.sf.pal.bookmark.db.allcommon.exception.EntityAlreadyUpdatedException * When the entity has already been updated. And Only when @@ -132,12 +126,12 @@ * @exception jp.sf.pal.bookmark.db.allcommon.exception.EntityDuplicatedException * When the entity has been duplicated. */ - public int[] lumpModify(java.util.List entityList); + public int[] lumpModify(List entityList); /** * Lump remove the list. * - * @param entityList Entity-list. (NotNull and NotEmpty) + * @param entityList The list of entity. (NotNull and NotEmpty) * @return Removed count. * @exception jp.sf.pal.bookmark.db.allcommon.exception.EntityAlreadyUpdatedException * When the entity has already been updated. And Only when @@ -145,5 +139,5 @@ * @exception jp.sf.pal.bookmark.db.allcommon.exception.EntityDuplicatedException * When the entity has been duplicated. */ - public int[] lumpRemove(java.util.List entityList); + public int[] lumpRemove(List entityList); } Added: bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/bhv/core/BehaviorCommand.java =================================================================== --- bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/bhv/core/BehaviorCommand.java (rev 0) +++ bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/bhv/core/BehaviorCommand.java 2008-12-27 22:11:51 UTC (rev 1627) @@ -0,0 +1,71 @@ +package jp.sf.pal.bookmark.db.allcommon.bhv.core; + +import jp.sf.pal.bookmark.db.allcommon.cbean.ConditionBean; +import jp.sf.pal.bookmark.db.allcommon.cbean.outsidesql.OutsideSqlOption; + +/** + * @author DBFlute(AutoGenerator) + * @param The type of result. + */ +public interface BehaviorCommand { + + //========================================================================== + // ========= + // Basic Information + // ================= + public String getTableDbName(); + + public String getCommandName(); + + /** + * Get the return type of command. This type is not related to generic type + * because this is for conversion and check only. + * + * @return The return type of command. (NotNull) + */ + public Class getCommandReturnType(); + + public boolean isInitializeOnly(); + + //========================================================================== + // ========= + // Detail Information + // ================== + public boolean isConditionBean(); + + public boolean isOutsideSql(); + + public boolean isProcedure(); + + public boolean isSelect(); + + public boolean isSelectCount(); + + //========================================================================== + // ========= + // Process Callback + // ================ + public void beforeGettingSqlExecution(); + + public void afterExecuting(); + + //========================================================================== + // ========= + // SqlExecution Handling + // ===================== + public String buildSqlExecutionKey(); + + public SqlExecutionCreator createSqlExecutionCreator(); + + public Object[] getSqlExecutionArgument(); + + //========================================================================== + // ========= + // Argument Information + // ==================== + public ConditionBean getConditionBean(); + + public String getOutsideSqlPath(); + + public OutsideSqlOption getOutsideSqlOption(); +} Property changes on: bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/bhv/core/BehaviorCommand.java ___________________________________________________________________ Name: svn:eol-style + native Added: bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/bhv/core/BehaviorCommandComponentSetup.java =================================================================== --- bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/bhv/core/BehaviorCommandComponentSetup.java (rev 0) +++ bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/bhv/core/BehaviorCommandComponentSetup.java 2008-12-27 22:11:51 UTC (rev 1627) @@ -0,0 +1,23 @@ +package jp.sf.pal.bookmark.db.allcommon.bhv.core; + +import javax.sql.DataSource; + +import org.seasar.dao.BeanMetaDataFactory; +import org.seasar.dao.ValueTypeFactory; +import org.seasar.extension.jdbc.StatementFactory; + +/** + * @author DBFlute(AutoGenerator) + */ +public interface BehaviorCommandComponentSetup { + + public void setDataSource(DataSource dataSource); + + public void setStatementFactory(StatementFactory statementFactory); + + public void setBeanMetaDataFactory(BeanMetaDataFactory beanMetaDataFactory); + + public void setValueTypeFactory(ValueTypeFactory valueTypeFactory); + + public void setSqlFileEncoding(String sqlFileEncoding); +} Property changes on: bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/bhv/core/BehaviorCommandComponentSetup.java ___________________________________________________________________ Name: svn:eol-style + native Added: bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/bhv/core/BehaviorCommandInvoker.java =================================================================== --- bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/bhv/core/BehaviorCommandInvoker.java (rev 0) +++ bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/bhv/core/BehaviorCommandInvoker.java 2008-12-27 22:11:51 UTC (rev 1627) @@ -0,0 +1,842 @@ +package jp.sf.pal.bookmark.db.allcommon.bhv.core; + +import java.util.Arrays; +import java.util.List; +import java.util.Map; +import java.util.concurrent.ConcurrentHashMap; + +import javax.sql.DataSource; + +import jp.sf.pal.bookmark.db.allcommon.DBFluteConfig; +import jp.sf.pal.bookmark.db.allcommon.Entity; +import jp.sf.pal.bookmark.db.allcommon.InternalMapContext; +import jp.sf.pal.bookmark.db.allcommon.XLog; +import jp.sf.pal.bookmark.db.allcommon.cbean.ConditionBeanContext; +import jp.sf.pal.bookmark.db.allcommon.cbean.FetchNarrowingBeanContext; +import jp.sf.pal.bookmark.db.allcommon.cbean.outsidesql.OutsideSqlContext; +import jp.sf.pal.bookmark.db.allcommon.dbmeta.DBMeta; +import jp.sf.pal.bookmark.db.allcommon.dbmeta.DBMetaInstanceHandler; +import jp.sf.pal.bookmark.db.allcommon.helper.stacktrace.InvokeNameExtractingResource; +import jp.sf.pal.bookmark.db.allcommon.helper.stacktrace.InvokeNameResult; +import jp.sf.pal.bookmark.db.allcommon.helper.stacktrace.impl.InvokeNameExtractorImpl; +import jp.sf.pal.bookmark.db.allcommon.jdbc.StatementConfig; +import jp.sf.pal.bookmark.db.allcommon.s2dao.internal.various.InternalStatementFactory; +import jp.sf.pal.bookmark.db.allcommon.util.SimpleSystemUtil; +import jp.sf.pal.bookmark.db.allcommon.util.SimpleTypeUtil; +import jp.sf.pal.bookmark.db.allcommon.util.TraceViewUtil; + +import org.seasar.dao.BeanMetaDataFactory; +import org.seasar.dao.ValueTypeFactory; +import org.seasar.extension.jdbc.StatementFactory; +import org.seasar.framework.util.Disposable; +import org.seasar.framework.util.DisposableUtil; + +/** + * The invoker of behavior command. + * + *
+ * public interface methods are as follows:
+ * 
+ *   o injectComponentProperty(BehaviorCommandComponentSetup behaviorCommand);
+ *   o invoke(BehaviorCommand behaviorCommand);
+ *   o isDisposable();
+ *   o isExecutionCacheEmpty();
+ * 
+ * + * @author DBFlute(AutoGenerator) + */ +public class BehaviorCommandInvoker implements Disposable { + + //========================================================================== + // ========= + // Attribute + // ========= + // ----------------------------------------------------- + // Injection Target + // ---------------- + protected DataSource _dataSource; + + protected BeanMetaDataFactory _beanMetaDataFactory; + + protected ValueTypeFactory _valueTypeFactory; + + // ----------------------------------------------------- + // Fixed Property + // -------------- + protected final StatementFactory _statementFactory = createStatememtFactory(); + + protected final Map _executionMap = new ConcurrentHashMap(); + + // ----------------------------------------------------- + // Dispose Status + // -------------- + protected boolean disposable; + + //========================================================================== + // ========= + // Constructor + // =========== + public BehaviorCommandInvoker() { + } + + //========================================================================== + // ========= + // Command Set up + // ============== + /** + * Inject the properties of component to the command of behavior. {Public + * Interface} + * + * @param behaviorCommand The command of behavior. (NotNull) + */ + public void injectComponentProperty( + BehaviorCommandComponentSetup behaviorCommand) { + behaviorCommand.setDataSource(_dataSource); + behaviorCommand.setStatementFactory(_statementFactory); + behaviorCommand.setBeanMetaDataFactory(_beanMetaDataFactory); + behaviorCommand.setValueTypeFactory(_valueTypeFactory); + behaviorCommand.setSqlFileEncoding(getSqlFileEncoding()); + } + + protected String getSqlFileEncoding() { + return "UTF-8"; // This value is set when generating. + } + + //========================================================================== + // ========= + // Command Invoke + // ============== + /** + * Invoke the command of behavior. {Public Interface} This method is an + * entry point! + * + * @param The type of result. + * @param behaviorCommand The command of behavior. (NotNull) + * @return The result object. (Nullable) + */ + public RESULT invoke(BehaviorCommand behaviorCommand) { + clearContext(); + try { + return doInvoke(behaviorCommand); + } finally { + clearContext(); + } + } + + /** + * @param The type of result. + * @param behaviorCommand The command of behavior. (NotNull) + * @return The result object. (Nullable) + */ + protected RESULT doInvoke(BehaviorCommand behaviorCommand) { + // - - - - - - - - - - - - - + // Initialize SQL Execution + // - - - - - - - - - - - - - + if (behaviorCommand.isInitializeOnly()) { + initializeSqlExecution(behaviorCommand); + return null; // The end! (Initialize Only) + } + behaviorCommand.beforeGettingSqlExecution(); + + SqlExecution execution = null; + try { + final String key = behaviorCommand.buildSqlExecutionKey(); + execution = getSqlExecution(key); + if (execution == null) { + long beforeCmd = 0; + if (isLogEnabled()) { + beforeCmd = System.currentTimeMillis(); + } + SqlExecutionCreator creator = behaviorCommand + .createSqlExecutionCreator(); + execution = getSqlExecution(key, creator); + if (isLogEnabled()) { + final long afterCmd = System.currentTimeMillis(); + if (beforeCmd != afterCmd) { + logSqlExecution(behaviorCommand, execution, beforeCmd, + afterCmd); + } + } + } + } finally { + if (isLogEnabled()) { + logInvocation(behaviorCommand); + } + } + + long before = 0; + if (isLogEnabled()) { + before = System.currentTimeMillis(); + } + + Object ret = null; + try { + final Object[] args = behaviorCommand.getSqlExecutionArgument(); + ret = executeSql(execution, args); + } finally { + behaviorCommand.afterExecuting(); + } + final Class retType = behaviorCommand.getCommandReturnType(); + assertRetType(retType, ret); + + if (isLogEnabled()) { + final long after = System.currentTimeMillis(); + logReturn(behaviorCommand, retType, ret, before, after); + } + + // - - - - - - - - - - + // Convert and Return! + // - - - - - - - - - - + if (retType.isPrimitive()) { + ret = convertPrimitiveWrapper(retType, ret); + } else if (Number.class.isAssignableFrom(retType)) { + ret = convertNumber(retType, ret); + } + @SuppressWarnings("unchecked") + final RESULT result = (RESULT) ret; + return result; + } + + //========================================================================== + // ========= + // SQL Execution + // ============= + protected void initializeSqlExecution( + BehaviorCommand behaviorCommand) { + final String key = behaviorCommand.buildSqlExecutionKey(); + SqlExecutionCreator creator = behaviorCommand + .createSqlExecutionCreator(); + getSqlExecution(key, creator); + } + + protected SqlExecution getSqlExecution(String key) { + return _executionMap.get(key); + } + + /** + * @param key The key of SQL execution. (NotNull) + * @param executionCreator The creator of SQL execution. (NotNull) + * @return The SQL execution that may be created then. (NotNull) + */ + protected SqlExecution getSqlExecution(String key, + SqlExecutionCreator executionCreator) { + SqlExecution execution = getSqlExecution(key); + if (execution == null) { + synchronized (_executionMap) { + execution = getSqlExecution(key); + if (execution == null) { + if (isLogEnabled()) { + log("...Initializing sqlExecution for the key '" + key + + "'"); + } + _executionMap.put(key, executionCreator + .createSqlExecution()); + } else { + if (isLogEnabled()) { + log("...Getting sqlExecution as cache because the previous thread have already initilized."); + } + } + } + execution = getSqlExecution(key); + if (execution == null) { + String msg = "sqlExecutionCreator.createSqlCommand() should not return null:"; + msg = msg + " sqlExecutionCreator=" + executionCreator + + " key=" + key; + throw new IllegalStateException(msg); + } + if (!disposable) { + synchronized (this) { + if (!disposable) { + toBeDisposable(); + } + } + } + } + return execution; + } + + protected Object executeSql(SqlExecution execution, Object[] args) { + return execution.execute(args); + } + + //========================================================================== + // ========= + // Log SqlCommand + // ============== + protected void logSqlExecution( + BehaviorCommand behaviorCommand, SqlExecution execution, + long beforeCmd, long afterCmd) { + log("SqlExecution Initialization Cost: [" + + TraceViewUtil.convertToPerformanceView(afterCmd - beforeCmd) + + "]"); + } + + //========================================================================== + // ========= + // Log Invocation + // ============== + protected void logInvocation( + BehaviorCommand behaviorCommand) { + final StackTraceElement[] stackTrace = new Exception().getStackTrace(); + final InvokeNameResult behaviorResult = extractBehaviorInvokeName(stackTrace); + filterBehaviorResult(behaviorCommand, behaviorResult); + + final String invokeClassName; + final String invokeMethodName; + if (!behaviorResult.isEmptyResult()) { + invokeClassName = behaviorResult.getSimpleClassName(); + invokeMethodName = behaviorResult.getMethodName(); + } else { + invokeClassName = behaviorCommand.getTableDbName(); + invokeMethodName = behaviorCommand.getCommandName(); + } + final String expWithoutKakko = buildInvocationExpressionWithoutKakko( + behaviorCommand, invokeClassName, invokeMethodName); + + // Save behavior invoke name for error message. + putObjectToMapContext("df:BehaviorInvokeName", expWithoutKakko + "()"); + + final String equalBorder = buildFitBorder("", "=", expWithoutKakko, + false); + final String callerExpression = expWithoutKakko + "()"; + + log("/=====================================================" + + equalBorder + "=="); + log(" " + + callerExpression); + log(" " + + equalBorder + "=/"); + + logPath(behaviorCommand, stackTrace, behaviorResult); + + if (behaviorCommand.isOutsideSql() && !behaviorCommand.isProcedure()) { + final OutsideSqlContext outsideSqlContext = getOutsideSqlContext(); + if (outsideSqlContext != null) { + log("path: " + behaviorCommand.getOutsideSqlPath()); + log("option: " + behaviorCommand.getOutsideSqlOption()); + } + } + } + + protected void filterBehaviorResult( + BehaviorCommand behaviorCommand, + InvokeNameResult behaviorResult) { + final String simpleClassName = behaviorResult.getSimpleClassName(); + if (simpleClassName == null) { + return; + } + if (simpleClassName.contains("Behavior") + && simpleClassName.endsWith("$SLFunction")) { + final String behaviorClassName = findBehaviorClassNameFromDBMeta(behaviorCommand + .getTableDbName()); + behaviorResult.setSimpleClassName(behaviorClassName); + behaviorResult.setMethodName("scalarSelect()." + + behaviorResult.getMethodName()); + } + } + + protected void logPath(BehaviorCommand behaviorCommand, + StackTraceElement[] stackTrace, InvokeNameResult behaviorResult) { + final int bhvNextIndex = behaviorResult.getNextStartIndex(); + final InvokeNameResult clientResult = extractClientInvokeName( + stackTrace, bhvNextIndex); + final int clientFirstIndex = clientResult.getFoundFirstIndex(); + final InvokeNameResult byPassResult = extractByPassInvokeName( + stackTrace, bhvNextIndex, clientFirstIndex - bhvNextIndex); + + final String clientInvokeName = clientResult.getInvokeName(); + final String byPassInvokeName = byPassResult.getInvokeName(); + final String behaviorInvokeName = behaviorResult.getInvokeName(); + if (clientInvokeName.trim().length() == 0 + && byPassInvokeName.trim().length() == 0) { + return; + } + + // Save client invoke name for error message. + if (!clientResult.isEmptyResult()) { + putObjectToMapContext("df:ClientInvokeName", clientInvokeName); + } + // Save by-pass invoke name for error message. + if (!byPassResult.isEmptyResult()) { + putObjectToMapContext("df:ByPassInvokeName", byPassInvokeName); + } + + log(clientInvokeName + byPassInvokeName + behaviorInvokeName + "..."); + } + + protected String buildInvocationExpressionWithoutKakko( + BehaviorCommand behaviorCommand, String invokeClassName, + String invokeMethodName) { + if (invokeClassName.contains("OutsideSql") + && invokeClassName.endsWith("Executor")) { // OutsideSql + // Executor Handling + try { + final String originalName = invokeClassName; + if (behaviorCommand.isOutsideSql()) { + final OutsideSqlContext outsideSqlContext = getOutsideSqlContext(); + final String tableDbName = outsideSqlContext + .getTableDbName(); + final String behaviorClassName = findBehaviorClassNameFromDBMeta(tableDbName); + invokeClassName = behaviorClassName + ".outsideSql()"; + if (originalName.endsWith("OutsideSqlEntityExecutor")) { + invokeClassName = invokeClassName + ".entityHandling()"; + } else if (originalName + .endsWith("OutsideSqlPagingExecutor")) { + if (outsideSqlContext.isAutoPagingLogging()) { + invokeClassName = invokeClassName + ".autoPaging()"; + } else { + invokeClassName = invokeClassName + + ".manualPaging()"; + } + } else if (originalName + .endsWith("OutsideSqlCursorExecutor")) { + invokeClassName = invokeClassName + ".cursorHandling()"; + } + } else { + invokeClassName = "OutsideSql"; + } + } catch (RuntimeException ignored) { + log("Ignored exception occurred: msg=" + ignored.getMessage()); + } + } + String callerExpressionWithoutKakko = invokeClassName + "." + + invokeMethodName; + if ("selectPage".equals(invokeMethodName)) { // Special Handling! + boolean resultTypeInteger = false; + if (behaviorCommand.isOutsideSql()) { + final OutsideSqlContext outsideSqlContext = getOutsideSqlContext(); + final Object resultTypeSpecification = outsideSqlContext + .getResultTypeSpecification(); + if (resultTypeSpecification != null + && resultTypeSpecification instanceof Class) { + final Class resultType = (Class) resultTypeSpecification; + if (Integer.class.isAssignableFrom(resultType)) { + resultTypeInteger = true; + } + } + } + if (resultTypeInteger || behaviorCommand.isSelectCount()) { + callerExpressionWithoutKakko = callerExpressionWithoutKakko + + "():count"; + } else { + callerExpressionWithoutKakko = callerExpressionWithoutKakko + + "():paging"; + } + } + return callerExpressionWithoutKakko; + } + + protected String buildFitBorder(String prefix, String element, + String lengthTargetString, boolean space) { + final int length = space ? lengthTargetString.length() / 2 + : lengthTargetString.length(); + final StringBuffer sb = new StringBuffer(); + sb.append(prefix); + for (int i = 0; i < length; i++) { + sb.append(element); + if (space) { + sb.append(" "); + } + } + if (space) { + sb.append(element); + } + return sb.toString(); + } + + protected InvokeNameResult extractClientInvokeName( + StackTraceElement[] stackTrace, final int startIndex) { + final List 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 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 suffixList = Arrays.asList(new String[] { "Bhv", + "BehaviorReadable", "BehaviorWritable", "PagingInvoker" }); + final List keywordList = Arrays.asList(new String[] { "Bhv$", + "BehaviorReadable$", "BehaviorWritable$" }); + final List ousideSql1List = Arrays + .asList(new String[] { "OutsideSql" }); + final List ousideSql2List = Arrays + .asList(new String[] { "Executor" }); + final List 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 suffixList) { + for (String suffix : suffixList) { + if (className.endsWith(suffix)) { + return true; + } + } + return false; + } + + protected boolean isClassNameContains(String className, + List keywordList) { + for (String keyword : keywordList) { + if (className.contains(keyword)) { + return true; + } + } + return false; + } + + /** + * @param resource the call-back resource for invoke-name-extracting. + * (NotNull) + * @param stackTrace Stack log. (NotNull) + * @return The result of invoke name. (NotNull: If not found, returns empty + * string.) + */ + protected InvokeNameResult extractInvokeName( + InvokeNameExtractingResource resource, + StackTraceElement[] stackTrace) { + final InvokeNameExtractorImpl extractor = new InvokeNameExtractorImpl(); + extractor.setStackTrace(stackTrace); + return extractor.extractInvokeName(resource); + } + + /** + * @param simpleClassName The simple class name. (NotNull) + * @return The simple class name removed the base prefix. (NotNull) + */ + protected String removeBasePrefixFromSimpleClassName(String simpleClassName) { + if (!simpleClassName.startsWith("Bs")) { + return simpleClassName; + } + final int prefixLength = "Bs".length(); + if (!Character.isUpperCase(simpleClassName.substring(prefixLength) + .charAt(0))) { + return simpleClassName; + } + if (simpleClassName.length() <= prefixLength) { + return simpleClassName; + } + return "" + simpleClassName.substring(prefixLength); + } + + protected String findBehaviorClassNameFromDBMeta(String tableDbName) { + final DBMeta dbmeta = DBMetaInstanceHandler.findDBMeta(tableDbName); + final String behaviorTypeName = dbmeta.getBehaviorTypeName(); + final String behaviorClassName = behaviorTypeName + .substring(behaviorTypeName.lastIndexOf(".") + ".".length()); + return removeBasePrefixFromSimpleClassName(behaviorClassName); + } + + //========================================================================== + // ========= + // Log Return + // ========== + protected void logReturn(BehaviorCommand behaviorCommand, + Class retType, Object ret, long before, long after) { + try { + final String daoResultPrefix = "===========/ [" + + TraceViewUtil.convertToPerformanceView(after - before) + + " - "; + if (List.class.isAssignableFrom(retType)) { + if (ret == null) { + log(daoResultPrefix + "Selected list: null]"); + } else { + final List ls = (java.util.List) ret; + if (ls.isEmpty()) { + log(daoResultPrefix + "Selected list: 0]"); + } else if (ls.size() == 1 && ls.get(0) instanceof Number) { + log(daoResultPrefix + "Selected count: " + ls.get(0) + + "]"); + } else { + log(daoResultPrefix + "Selected list: " + ls.size() + + " first=" + ls.get(0) + "]"); + } + } + } else if (Entity.class.isAssignableFrom(retType)) { + if (ret == null) { + log(daoResultPrefix + "Selected entity: null" + "]"); + } else { + final Entity entity = (Entity) ret; + log(daoResultPrefix + "Selected entity: " + entity + "]"); + } + } else if (Entity.class.isAssignableFrom(retType)) { + if (ret == null) { + log(daoResultPrefix + "Selected entity: null" + "]"); + } else { + final Entity entity = (Entity) ret; + log(daoResultPrefix + "Selected entity: " + entity + "]"); + } + } else if (int[].class.isAssignableFrom(retType)) { + if (ret == null) { + log(daoResultPrefix + "Selected entity: null" + "]"); + } else { + final int[] resultArray = (int[]) ret; + if (resultArray.length == 0) { + log(daoResultPrefix + "All updated count: 0]"); + } else { + final StringBuilder sb = new StringBuilder(); + boolean resultExpressionScope = true; + int resultCount = 0; + int loopCount = 0; + for (int element : resultArray) { + resultCount = resultCount + element; + if (resultExpressionScope) { + if (loopCount <= 10) { + if (sb.length() == 0) { + sb.append(element); + } else { + sb.append(",").append(element); + } + } else { + sb.append(",").append("..."); + resultExpressionScope = false; + } + } + ++loopCount; + } + sb.insert(0, "{").append("}"); + log(daoResultPrefix + "All updated count: " + + resultCount + " result=" + sb + "]"); + } + } + } else { + if (behaviorCommand.isSelectCount()) { + log(daoResultPrefix + "Selected count: " + ret + "]"); + } else { + log(daoResultPrefix + "Result: " + ret + "]"); + } + } + log(" "); + } catch (RuntimeException e) { + String msg = "Result object debug threw the exception: behaviorCommand="; + msg = msg + behaviorCommand + " retType=" + retType; + msg = msg + " ret=" + ret; + throw e; + } + } + + //========================================================================== + // ========= + // Context Helper + // ============== + protected OutsideSqlContext getOutsideSqlContext() { + if (!OutsideSqlContext.isExistOutsideSqlContextOnThread()) { + return null; + } + return OutsideSqlContext.getOutsideSqlContextOnThread(); + } + + protected void putObjectToMapContext(String key, Object value) { + InternalMapContext.setObject(key, value); + } + + protected void clearContext() { + if (OutsideSqlContext.isExistOutsideSqlContextOnThread()) { + OutsideSqlContext.clearOutsideSqlContextOnThread(); + } + if (FetchNarrowingBeanContext.isExistFetchNarrowingBeanOnThread()) { + // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + // - - - - - - - - - - - - - - - + // Because there is possible that fetch narrowing has been ignored + // for manualPaging of outsideSql. + // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + // - - - - - - - - - - - - - - - + FetchNarrowingBeanContext.getFetchNarrowingBeanOnThread() + .restoreIgnoredFetchNarrowing(); + + FetchNarrowingBeanContext.clearFetchNarrowingBeanOnThread(); + } + if (ConditionBeanContext.isExistConditionBeanOnThread()) { + ConditionBeanContext.clearConditionBeanOnThread(); + } + if (InternalMapContext.isExistInternalMapContextOnThread()) { + InternalMapContext.clearInternalMapContextOnThread(); + } + } + + //========================================================================== + // ========= + // Execute Status Log + // ================== + protected void log(String msg) { + XLog.log(msg); + } + + protected boolean isLogEnabled() { + return XLog.isLogEnabled(); + } + + protected StatementFactory createStatememtFactory() { + final StatementConfig defaultStatementConfig = DBFluteConfig + .getInstance().getDefaultStatementConfig(); + final boolean internalDebug = DBFluteConfig.getInstance() + .isInternalDebug(); + InternalStatementFactory factory = new InternalStatementFactory(); + factory.setDefaultStatementConfig(defaultStatementConfig); + factory.setInternalDebug(internalDebug); + return factory; + } + + //========================================================================== + // ========= + // Dispose + // ======= + public void toBeDisposable() { + DisposableUtil.add(this); + disposable = true; + } + + public void dispose() { + _executionMap.clear(); + disposable = false; + } + + public boolean isDisposable() { + return disposable; + } + + public boolean isExecutionCacheEmpty() { + return _executionMap.isEmpty(); + } + + //========================================================================== + // ========= + // Convert Helper + // ============== + protected Object convertPrimitiveWrapper(Class retType, Object ret) { + return SimpleTypeUtil.toWrapper(retType, ret); + } + + protected Object convertNumber(Class retType, Object ret) { + return SimpleTypeUtil.toNumber(retType, ret); + } + + //========================================================================== + // ========= + // Assert Helper + // ============= + protected void assertRetType(Class retType, Object ret) { + if (List.class.isAssignableFrom(retType)) { + if (ret != null && !(ret instanceof List)) { + String msg = "The retType is difference from actual return: "; + msg = msg + "retType=" + retType + " ret.getClass()=" + + ret.getClass() + " ref=" + ret; + throw new IllegalStateException(msg); + } + } else if (Entity.class.isAssignableFrom(retType)) { + if (ret != null && !(ret instanceof Entity)) { + String msg = "The retType is difference from actual return: "; + msg = msg + "retType=" + retType + " ret.getClass()=" + + ret.getClass() + " ref=" + ret; + throw new IllegalStateException(msg); + } + } + } + + //========================================================================== + // ========= + // General Helper + // ============== + protected String getLineSeparator() { + return SimpleSystemUtil.getLineSeparator(); + } + + //========================================================================== + // ========= + // Accessor + // ======== + public void setDataSource(DataSource dataSource) { + _dataSource = dataSource; + } + + public void setBeanMetaDataFactory(BeanMetaDataFactory beanMetaDataFactory) { + _beanMetaDataFactory = beanMetaDataFactory; + } + + public void setValueTypeFactory(ValueTypeFactory valueTypeFactory) { + _valueTypeFactory = valueTypeFactory; + } +} Property changes on: bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/bhv/core/BehaviorCommandInvoker.java ___________________________________________________________________ Name: svn:eol-style + native Added: bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/bhv/core/BehaviorInitializer.java =================================================================== --- bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/bhv/core/BehaviorInitializer.java (rev 0) +++ bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/bhv/core/BehaviorInitializer.java 2008-12-27 22:11:51 UTC (rev 1627) @@ -0,0 +1,177 @@ +package jp.sf.pal.bookmark.db.allcommon.bhv.core; + +import java.util.Collections; +import java.util.Map; +import java.util.concurrent.ConcurrentHashMap; + +import javax.sql.XADataSource; + +import jp.sf.pal.bookmark.db.allcommon.DBDef; +import jp.sf.pal.bookmark.db.allcommon.DBFluteConfig; +import jp.sf.pal.bookmark.db.allcommon.cbean.ConditionBeanContext; +import jp.sf.pal.bookmark.db.allcommon.dbmeta.DBMetaInstanceHandler; +import jp.sf.pal.bookmark.db.allcommon.s2dao.internal.sqllog.InternalSqlLogRegistry; +import jp.sf.pal.bookmark.db.allcommon.util.SimpleSystemUtil; + +import org.seasar.extension.dbcp.impl.XADataSourceImpl; + +/** + * @author DBFlute(AutoGenerator) + */ +public class BehaviorInitializer { + + //========================================================================== + // ========= + // Definition + // ========== + /** Log-instance. */ + private static final org.apache.commons.logging.Log _log = org.apache.commons.logging.LogFactory + .getLog(BehaviorInitializer.class); + + // ----------------------------------------------------- + // For DBMeta + // ---------- + /** + * The map of table DB name and class name for the handler of DB meta + * instance. + */ + protected static final Map _tableDbNameClassNameMap; + static { + final Map tmpMap = newConcurrentHashMap(); + tmpMap.put("BOOKMARK_CATEGORY", + "jp.sf.pal.bookmark.db.bsentity.dbmeta.BookmarkCategoryDbm"); + tmpMap.put("BOOKMARK_LINK", + "jp.sf.pal.bookmark.db.bsentity.dbmeta.BookmarkLinkDbm"); + tmpMap.put("GROUP_INFO", + "jp.sf.pal.bookmark.db.bsentity.dbmeta.GroupInfoDbm"); + tmpMap.put("GROUP_MAPPING", + "jp.sf.pal.bookmark.db.bsentity.dbmeta.GroupMappingDbm"); + tmpMap.put("ROLE_INFO", + "jp.sf.pal.bookmark.db.bsentity.dbmeta.RoleInfoDbm"); + tmpMap.put("ROLE_MAPPING", + "jp.sf.pal.bookmark.db.bsentity.dbmeta.RoleMappingDbm"); + tmpMap.put("USER_INFO", + "jp.sf.pal.bookmark.db.bsentity.dbmeta.UserInfoDbm"); + _tableDbNameClassNameMap = Collections.unmodifiableMap(tmpMap); + } + + protected static ConcurrentHashMap newConcurrentHashMap() { + return new ConcurrentHashMap(); + } + + //========================================================================== + // ========= + // Constructor + // =========== + /** + * Constructor. And initialize various components related behavior. + * + * @param xaDataSource The data source of XA. (Nullable) + */ + public BehaviorInitializer(XADataSource xaDataSource) { + _log + .info("/* * * * * * * * * * * * * * * * * * * * * * * * * * * * {DBFlute}"); + initializeDBMetaResource(); + handleSqlLogRegistry(); + loadCoolClasses(); + if (xaDataSource != null) { + showInformation(xaDataSource); + setupDBDefByDriverClassName(xaDataSource); + } + DBFluteConfig.getInstance().lock(); + _log.info("* * * * */"); + } + + //========================================================================== + // ========= + // DBMeta + // ====== + protected void initializeDBMetaResource() { + DBMetaInstanceHandler.setupDBMetaResource(_tableDbNameClassNameMap); + } + + //========================================================================== + // ========= + // Cool Classes + // ============ + protected void loadCoolClasses() { // for S2Container basically + ConditionBeanContext.loadCoolClasses(); // Against the ClassLoader + // Headache! + } + + //========================================================================== + // ========= + // Information + // =========== + protected void showInformation(XADataSource xaDataSource) { + if (xaDataSource != null && xaDataSource instanceof XADataSourceImpl) { + final StringBuilder sb = new StringBuilder(); + final XADataSourceImpl xaDataSourceImpl = (XADataSourceImpl) xaDataSource; + final String driverClassName = xaDataSourceImpl + .getDriverClassName(); + final String url = xaDataSourceImpl.getURL(); + final String user = xaDataSourceImpl.getUser(); + sb.append(" [XADataSource]:").append(getLineSeparator()); + sb.append(" driver = " + driverClassName).append( + getLineSeparator()); + sb.append(" url = " + url).append(getLineSeparator()); + sb.append(" user = " + user); + _log.info("{Injection Information}" + getLineSeparator() + sb); + } + } + + //========================================================================== + // ========= + // Database Product Name + // ===================== + protected void setupDBDefByDriverClassName(XADataSource xaDataSource) { + if (xaDataSource != null && xaDataSource instanceof XADataSourceImpl) { + final XADataSourceImpl xaDataSourceImpl = (XADataSourceImpl) xaDataSource; + final String driverClassName = xaDataSourceImpl + .getDriverClassName(); + final DBDef dbdef = DBDef.byDriverClassName(driverClassName); + if (dbdef != null) { + DBDef.setCurrentDef(dbdef); + return; + } + } + } + + //========================================================================== + // ========= + // SQL Log Registry + // ================ + protected void handleSqlLogRegistry() { + if (DBFluteConfig.getInstance().isUseSqlLogRegistry()) { + final StringBuilder sb = new StringBuilder(); + sb.append("{SqlLog Information}").append(getLineSeparator()); + sb.append(" [SqlLogRegistry]").append(getLineSeparator()); + if (InternalSqlLogRegistry.setupSqlLogRegistry()) { + sb + .append( + " ...Setting up SqlLogRegistry(org.seasar.extension.jdbc)!") + .append(getLineSeparator()); + sb + .append(" Because the property 'useSqlLogRegistry' of the config of DBFlute is true."); + } else { + sb + .append(" SqlLogRegistry(org.seasar.extension.jdbc) is not supported at the version!"); + } + _log.info(sb); + } else { + final Object sqlLogRegistry = InternalSqlLogRegistry + .findContainerSqlLogRegistry(); + if (sqlLogRegistry != null) { + InternalSqlLogRegistry.closeRegistration(); + } + } + } + + //========================================================================== + // ========= + // General Helper + // ============== + protected String getLineSeparator() { + return SimpleSystemUtil.getLineSeparator(); + } +} Property changes on: bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/bhv/core/BehaviorInitializer.java ___________________________________________________________________ Name: svn:eol-style + native Added: bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/bhv/core/SqlExecution.java =================================================================== --- bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/bhv/core/SqlExecution.java (rev 0) +++ bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/bhv/core/SqlExecution.java 2008-12-27 22:11:51 UTC (rev 1627) @@ -0,0 +1,9 @@ +package jp.sf.pal.bookmark.db.allcommon.bhv.core; + +/** + * @author DBFlute(AutoGenerator) + */ +public interface SqlExecution { + + public Object execute(Object[] args); +} Property changes on: bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/bhv/core/SqlExecution.java ___________________________________________________________________ Name: svn:eol-style + native Added: bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/bhv/core/SqlExecutionCreator.java =================================================================== --- bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/bhv/core/SqlExecutionCreator.java (rev 0) +++ bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/bhv/core/SqlExecutionCreator.java 2008-12-27 22:11:51 UTC (rev 1627) @@ -0,0 +1,9 @@ +package jp.sf.pal.bookmark.db.allcommon.bhv.core; + +/** + * @author DBFlute(AutoGenerator) + */ +public interface SqlExecutionCreator { + + SqlExecution createSqlExecution(); +} Property changes on: bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/bhv/core/SqlExecutionCreator.java ___________________________________________________________________ Name: svn:eol-style + native Added: bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/bhv/core/command/AbstractBehaviorCommand.java =================================================================== --- bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/bhv/core/command/AbstractBehaviorCommand.java (rev 0) +++ bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/bhv/core/command/AbstractBehaviorCommand.java 2008-12-27 22:11:51 UTC (rev 1627) @@ -0,0 +1,261 @@ +package jp.sf.pal.bookmark.db.allcommon.bhv.core.command; + +import java.sql.ResultSet; +import java.sql.SQLException; +import java.util.ArrayList; +import java.util.List; + +import javax.sql.DataSource; + +import jp.sf.pal.bookmark.db.allcommon.DBDef; +import jp.sf.pal.bookmark.db.allcommon.bhv.core.BehaviorCommand; +import jp.sf.pal.bookmark.db.allcommon.bhv.core.BehaviorCommandComponentSetup; +import jp.sf.pal.bookmark.db.allcommon.s2dao.internal.rshandler.InternalBeanListMetaDataResultSetHandler; +import jp.sf.pal.bookmark.db.allcommon.s2dao.internal.sqlcommand.InternalUpdateDynamicCommand; +import jp.sf.pal.bookmark.db.allcommon.s2dao.internal.various.InternalRelationRowCreator; +import jp.sf.pal.bookmark.db.allcommon.s2dao.internal.various.InternalRowCreator; + +import org.seasar.dao.BeanMetaData; +import org.seasar.dao.BeanMetaDataFactory; +import org.seasar.dao.ValueTypeFactory; +import org.seasar.extension.jdbc.ResultSetHandler; +import org.seasar.extension.jdbc.StatementFactory; +import org.seasar.extension.jdbc.ValueType; +import org.seasar.extension.jdbc.types.ValueTypes; + +/** + * @author DBFlute(AutoGenerator) + * @param The type of result. + */ +public abstract class AbstractBehaviorCommand implements + BehaviorCommand, BehaviorCommandComponentSetup { + + //========================================================================== + // ========= + // Attribute + // ========= + // ----------------------------------------------------- + // Basic Information + // ----------------- + /** The table DB name. (Required) */ + protected String _tableDbName; + + /** Is it initialize only? (Choice) */ + protected boolean _initializeOnly; + + // ----------------------------------------------------- + // Injection Component + // ------------------- + protected DataSource _dataSource; + + protected StatementFactory _statementFactory; + + protected BeanMetaDataFactory _beanMetaDataFactory; + + protected ValueTypeFactory _valueTypeFactory; + + protected String _sqlFileEncoding; + + //========================================================================== + // ========= + // Factory + // ======= + // ----------------------------------------------------- + // UpdateDynamicCommnd + // ------------------- + protected InternalUpdateDynamicCommand createUpdateDynamicCommand( + String[] argNames, Class[] argTypes, String sql) { + final InternalUpdateDynamicCommand cmd = new InternalUpdateDynamicCommand( + _dataSource, _statementFactory); + cmd.setArgNames(argNames); + cmd.setArgTypes(argTypes); + if (sql != null) { + cmd.setSql(sql); + } + return cmd; + } + + // ----------------------------------------------------- + // ResultSetHandler + // ---------------- + protected ResultSetHandler createBeanListMetaDataResultSetHandler( + BeanMetaData bmd) { + final InternalRowCreator rowCreator = createInternalRowCreator(bmd); + final InternalRelationRowCreator relationRowCreator = createInternalRelationRowCreator(bmd); + return new InternalBeanListMetaDataResultSetHandler(bmd, rowCreator, + relationRowCreator); + } + + protected ResultSetHandler createObjectResultSetHandler(Class objectType) { + final ValueType valueType = ValueTypes.getValueType(objectType); + return new InternalObjectResultSetHandler(valueType); + } + + protected ResultSetHandler createObjectListResultSetHandler( + Class objectType) { + final ValueType valueType = ValueTypes.getValueType(objectType); + return createObjectListResultSetHandler(valueType); + } + + protected ResultSetHandler createObjectListResultSetHandler( + ValueType valueType) { + return new InternalObjectListResultSetHandler(valueType); + } + + protected static class InternalObjectResultSetHandler implements + ResultSetHandler { + private ValueType valueType; + + public InternalObjectResultSetHandler(ValueType valueType) { + this.valueType = valueType; + } + + public Object handle(ResultSet rs) throws SQLException { + while (rs.next()) { + return valueType.getValue(rs, 1); + } + return null; + } + } + + protected static class InternalObjectListResultSetHandler implements + ResultSetHandler { + private ValueType valueType; + + public InternalObjectListResultSetHandler(ValueType valueType) { + this.valueType = valueType; + } + + public Object handle(ResultSet rs) throws SQLException { + final List ret = new ArrayList(); + while (rs.next()) { + ret.add(valueType.getValue(rs, 1)); + } + return ret; + } + } + + protected static class InternalNullResultSetHandler implements + ResultSetHandler { + public Object handle(ResultSet rs) throws SQLException { + return null; + } + } + + protected InternalRowCreator createInternalRowCreator(BeanMetaData bmd) { + final Class clazz = bmd != null ? bmd.getBeanClass() : null; + return InternalRowCreator.createInternalRowCreator(clazz); + } + + protected InternalRelationRowCreator createInternalRelationRowCreator( + BeanMetaData bmd) { + return new InternalRelationRowCreator(); // Not yet implemented about + // performance tuning! + } + + //========================================================================== + // ========= + // Assist Helper + // ============= + protected String buildDbmsSuffix() { + final String productName = DBDef.getCurrentDef().code(); + return (productName != null ? "_" + productName.toLowerCase() : ""); + } + + //========================================================================== + // ========= + // Assert Helper + // ============= + protected void assertBasicProperty(String methodName) { + if (_tableDbName == null) { + throw new IllegalStateException(buildAssertMessage("_tableDbName", + methodName)); + } + } + + protected void assertComponentProperty(String methodName) { + if (_dataSource == null) { + throw new IllegalStateException(buildAssertMessage("_dataSource", + methodName)); + } + if (_statementFactory == null) { + throw new IllegalStateException(buildAssertMessage( + "_statementFactory", methodName)); + } + if (_beanMetaDataFactory == null) { + throw new IllegalStateException(buildAssertMessage( + "_beanMetaDataFactory", methodName)); + } + if (_valueTypeFactory == null) { + throw new IllegalStateException(buildAssertMessage( + "_valueTypeFactory", methodName)); + } + if (_sqlFileEncoding == null) { + throw new IllegalStateException(buildAssertMessage( + "_sqlFileEncoding", methodName)); + } + } + + protected String buildAssertMessage(String propertyName, String methodName) { + propertyName = propertyName.startsWith("_") ? propertyName + .substring("_".length()) : propertyName; + String msg = "The property '" + propertyName + "' should not be null"; + msg = msg + " when you call " + methodName + "()."; + throw new IllegalStateException(msg); + } + + //========================================================================== + // ========= + // Basic Override + // ============== + @Override + public String toString() { + return getClass().getSimpleName() + ":{" + buildSqlExecutionKey() + "}"; + } + + //========================================================================== + // ========= + // Accessor + // ======== + // ----------------------------------------------------- + // Basic Information + // ----------------- + public String getTableDbName() { + return _tableDbName; + } + + public void setTableDbName(String tableDbName) { + _tableDbName = tableDbName; + } + + public void setInitializeOnly(boolean initializeOnly) { + _initializeOnly = initializeOnly; + } + + public boolean isInitializeOnly() { + return _initializeOnly; + } + + // ----------------------------------------------------- + // Injection Component + // ------------------- + public void setDataSource(DataSource dataSource) { + _dataSource = dataSource; + } + + public void setStatementFactory(StatementFactory statementFactory) { + _statementFactory = statementFactory; + } + + public void setBeanMetaDataFactory(BeanMetaDataFactory beanMetaDataFactory) { + _beanMetaDataFactory = beanMetaDataFactory; + } + + public void setValueTypeFactory(ValueTypeFactory valueTypeFactory) { + _valueTypeFactory = valueTypeFactory; + } + + public void setSqlFileEncoding(String sqlFileEncoding) { + _sqlFileEncoding = sqlFileEncoding; + } +} Property changes on: bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/bhv/core/command/AbstractBehaviorCommand.java ___________________________________________________________________ Name: svn:eol-style + native Added: bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/bhv/core/command/AbstractEntityCommand.java =================================================================== --- bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/bhv/core/command/AbstractEntityCommand.java (rev 0) +++ bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/bhv/core/command/AbstractEntityCommand.java 2008-12-27 22:11:51 UTC (rev 1627) @@ -0,0 +1,182 @@ +package jp.sf.pal.bookmark.db.allcommon.bhv.core.command; + +import java.util.ArrayList; +import java.util.List; + +import jp.sf.pal.bookmark.db.allcommon.Entity; +import jp.sf.pal.bookmark.db.allcommon.cbean.ConditionBean; +import jp.sf.pal.bookmark.db.allcommon.cbean.outsidesql.OutsideSqlOption; +import jp.sf.pal.bookmark.db.allcommon.dbmeta.DBMeta; + +import org.seasar.dao.BeanMetaData; +import org.seasar.extension.jdbc.PropertyType; + +/** + * @author DBFlute(AutoGenerator) + */ +public abstract class AbstractEntityCommand extends + AbstractBehaviorCommand { + + //========================================================================== + // ========= + // Attribute + // ========= + /** The type of entity. (Required) */ + protected Class _entityType; + + /** The instance of condition-bean. (Required) */ + protected Entity _entity; + + //========================================================================== + // ========= + // Basic Information + // ================= + public Class getCommandReturnType() { + return Integer.class; + } + + //========================================================================== + // ========= + // Detail Information + // ================== + public boolean isConditionBean() { + return false; + } + + public boolean isOutsideSql() { + return false; + } + + public boolean isProcedure() { + return false; + } + + public boolean isSelect() { + return false; + } + + public boolean isSelectCount() { + return false; + } + + //========================================================================== + // ========= + // Factory + // ======= + // ----------------------------------------------------- + // BeanMetaData + // ------------ + protected BeanMetaData createBeanMetaData() { + return _beanMetaDataFactory.createBeanMetaData(_entityType); + } + + //========================================================================== + // ========= + // Process Callback + // ================ + public void beforeGettingSqlExecution() { + } + + public void afterExecuting() { + } + + //========================================================================== + // ========= + // SqlExecution Handling + // ===================== + public String buildSqlExecutionKey() { + assertStatus("buildSqlExecutionKey"); + return _tableDbName + ":" + getCommandName() + "(" + + _entityType.getSimpleName() + ")"; + } + + public Object[] getSqlExecutionArgument() { + assertStatus("getSqlExecutionArgument"); + return new Object[] { _entity }; + } + + //========================================================================== + // ========= + // Argument Information + // ==================== + public ConditionBean getConditionBean() { + return null; + } + + public String getOutsideSqlPath() { + return null; + } + + public OutsideSqlOption getOutsideSqlOption() { + return null; + } + + //========================================================================== + // ========= + // Assist Helper + // ============= + protected DBMeta findDBMeta() { + // /- - - - - - - - - - - - - - - - - - - - - - - - - - - - + // Cannot use the handler of DBMeta instance + // because the customize-entity is contained to find here. + // - - - - - - - - - -/ + // DBMetaInstanceHandler.findDBMeta(_tableDbName); + + final Class beanType = _entityType; + if (beanType == null) { + return null; + } + if (!Entity.class.isAssignableFrom(beanType)) { + return null; + } + final Entity entity; + try { + entity = (Entity) beanType.newInstance(); + } catch (InstantiationException e) { + throw new IllegalStateException(e); + } catch (IllegalAccessException e) { + throw new IllegalStateException(e); + } + return entity.getDBMeta(); + } + + protected String[] getPersistentPropertyNames(BeanMetaData bmd) { + final List nameList = new ArrayList(); + for (int i = 0; i < bmd.getPropertyTypeSize(); ++i) { + final PropertyType pt = bmd.getPropertyType(i); + if (pt.isPersistent()) { + nameList.add(pt.getPropertyName()); + } + } + return nameList.toArray(new String[nameList.size()]); + } + + //========================================================================== + // ========= + // Assert Helper + // ============= + protected void assertStatus(String methodName) { + assertBasicProperty(methodName); + assertComponentProperty(methodName); + if (_entityType == null) { + throw new IllegalStateException(buildAssertMessage("_entityType", + methodName)); + } + if (_entity == null) { + throw new IllegalStateException(buildAssertMessage("_entity", + methodName)); + } + } + + //========================================================================== + // ========= + // Accessor + // ======== + public void setEntityType(Class entityType) { + _entityType = entityType; + } + + public void setEntity(Entity entity) { + _entity = entity; + } +} Property changes on: bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/bhv/core/command/AbstractEntityCommand.java ___________________________________________________________________ Name: svn:eol-style + native Added: bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/bhv/core/command/AbstractListEntityCommand.java =================================================================== --- bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/bhv/core/command/AbstractListEntityCommand.java (rev 0) +++ bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/bhv/core/command/AbstractListEntityCommand.java 2008-12-27 22:11:51 UTC (rev 1627) @@ -0,0 +1,182 @@ +package jp.sf.pal.bookmark.db.allcommon.bhv.core.command; + +import java.util.ArrayList; +import java.util.List; + +import jp.sf.pal.bookmark.db.allcommon.Entity; +import jp.sf.pal.bookmark.db.allcommon.cbean.ConditionBean; +import jp.sf.pal.bookmark.db.allcommon.cbean.outsidesql.OutsideSqlOption; +import jp.sf.pal.bookmark.db.allcommon.dbmeta.DBMeta; + +import org.seasar.dao.BeanMetaData; +import org.seasar.extension.jdbc.PropertyType; + +/** + * @author DBFlute(AutoGenerator) + */ +public abstract class AbstractListEntityCommand extends + AbstractBehaviorCommand { + + //========================================================================== + // ========= + // Attribute + // ========= + /** The type of entity. (Required) */ + protected Class _entityType; + + /** The instance of condition-bean. (Required) */ + protected List _entityList; + + //========================================================================== + // ========= + // Basic Information + // ================= + public Class getCommandReturnType() { + return int[].class; + } + + //========================================================================== + // ========= + // Detail Information + // ================== + public boolean isConditionBean() { + return false; + } + + public boolean isOutsideSql() { + return false; + } + + public boolean isProcedure() { + return false; + } + + public boolean isSelect() { + return false; + } + + public boolean isSelectCount() { + return false; + } + + //========================================================================== + // ========= + // Factory + // ======= + // ----------------------------------------------------- + // BeanMetaData + // ------------ + protected BeanMetaData createBeanMetaData() { + return _beanMetaDataFactory.createBeanMetaData(_entityType); + } + + //========================================================================== + // ========= + // Process Callback + // ================ + public void beforeGettingSqlExecution() { + } + + public void afterExecuting() { + } + + //========================================================================== + // ========= + // SqlExecution Handling + // ===================== + public String buildSqlExecutionKey() { + assertStatus("buildSqlExecutionKey"); + return _tableDbName + ":" + getCommandName() + "(List<" + + _entityType.getSimpleName() + ">)"; + } + + public Object[] getSqlExecutionArgument() { + assertStatus("getSqlExecutionArgument"); + return new Object[] { _entityList }; + } + + //========================================================================== + // ========= + // Argument Information + // ==================== + public ConditionBean getConditionBean() { + return null; + } + + public String getOutsideSqlPath() { + return null; + } + + public OutsideSqlOption getOutsideSqlOption() { + return null; + } + + //========================================================================== + // ========= + // Assist Helper + // ============= + protected DBMeta findDBMeta() { + // /- - - - - - - - - - - - - - - - - - - - - - - - - - - - + // Cannot use the handler of DBMeta instance + // because the customize-entity is contained to find here. + // - - - - - - - - - -/ + // DBMetaInstanceHandler.findDBMeta(_tableDbName); + + final Class beanType = _entityType; + if (beanType == null) { + return null; + } + if (!Entity.class.isAssignableFrom(beanType)) { + return null; + } + final Entity entity; + try { + entity = (Entity) beanType.newInstance(); + } catch (InstantiationException e) { + throw new IllegalStateException(e); + } catch (IllegalAccessException e) { + throw new IllegalStateException(e); + } + return entity.getDBMeta(); + } + + protected String[] getPersistentPropertyNames(BeanMetaData bmd) { + final List nameList = new ArrayList(); + for (int i = 0; i < bmd.getPropertyTypeSize(); ++i) { + final PropertyType pt = bmd.getPropertyType(i); + if (pt.isPersistent()) { + nameList.add(pt.getPropertyName()); + } + } + return nameList.toArray(new String[nameList.size()]); + } + + //========================================================================== + // ========= + // Assert Helper + // ============= + protected void assertStatus(String methodName) { + assertBasicProperty(methodName); + assertComponentProperty(methodName); + if (_entityType == null) { + throw new IllegalStateException(buildAssertMessage("_entityType", + methodName)); + } + if (_entityList == null) { + throw new IllegalStateException(buildAssertMessage("_entityList", + methodName)); + } + } + + //========================================================================== + // ========= + // Accessor + // ======== + public void setEntityType(Class entityType) { + _entityType = entityType; + } + + public void setEntityList(List entityList) { + _entityList = entityList; + } +} Property changes on: bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/bhv/core/command/AbstractListEntityCommand.java ___________________________________________________________________ Name: svn:eol-style + native Added: bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/bhv/core/command/AbstractOutsideSqlCommand.java =================================================================== --- bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/bhv/core/command/AbstractOutsideSqlCommand.java (rev 0) +++ bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/bhv/core/command/AbstractOutsideSqlCommand.java 2008-12-27 22:11:51 UTC (rev 1627) @@ -0,0 +1,93 @@ +package jp.sf.pal.bookmark.db.allcommon.bhv.core.command; + +import jp.sf.pal.bookmark.db.allcommon.cbean.ConditionBean; +import jp.sf.pal.bookmark.db.allcommon.cbean.outsidesql.OutsideSqlOption; + +/** + * @author DBFlute(AutoGenerator) + * @param The type of result. + */ +public abstract class AbstractOutsideSqlCommand extends + AbstractBehaviorCommand { + + //========================================================================== + // ========= + // Attribute + // ========= + // ----------------------------------------------------- + // Basic Information + // ----------------- + /** The path of outside-SQL. (Required) */ + protected String _outsideSqlPath; + + /** The parameter-bean. (Required to set, but Nullable) */ + protected Object _parameterBean; + + /** The option of outside-SQL. (Required) */ + protected OutsideSqlOption _outsideSqlOption; + + //========================================================================== + // ========= + // Detail Information + // ================== + public boolean isConditionBean() { + return false; // When the command is for outside-SQL, it always be + // false. + } + + public boolean isOutsideSql() { + return true; + } + + public boolean isSelectCount() { + return false; // When the command is for outside-SQL, it always be + // false. + } + + //========================================================================== + // ========= + // Argument Information + // ==================== + public ConditionBean getConditionBean() { + return null; + } + + public String getOutsideSqlPath() { + return _outsideSqlPath; + } + + public OutsideSqlOption getOutsideSqlOption() { + return _outsideSqlOption; + } + + //========================================================================== + // ========= + // Assert Helper + // ============= + protected void assertOutsideSqlBasic(String methodName) { + if (_outsideSqlPath == null) { + throw new IllegalStateException(buildAssertMessage( + "_outsideSqlPath", methodName)); + } + if (_outsideSqlOption == null) { + throw new IllegalStateException(buildAssertMessage( + "_outsideSqlOption", methodName)); + } + } + + //========================================================================== + // ========= + // Accessor + // ======== + public void setOutsideSqlPath(String outsideSqlPath) { + _outsideSqlPath = outsideSqlPath; + } + + public void setParameterBean(Object parameterBean) { + _parameterBean = parameterBean; + } + + public void setOutsideSqlOption(OutsideSqlOption outsideSqlOption) { + _outsideSqlOption = outsideSqlOption; + } +} Property changes on: bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/bhv/core/command/AbstractOutsideSqlCommand.java ___________________________________________________________________ Name: svn:eol-style + native Added: bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/bhv/core/command/AbstractOutsideSqlSelectCommand.java =================================================================== --- bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/bhv/core/command/AbstractOutsideSqlSelectCommand.java (rev 0) +++ bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/bhv/core/command/AbstractOutsideSqlSelectCommand.java 2008-12-27 22:11:51 UTC (rev 1627) @@ -0,0 +1,175 @@ +package jp.sf.pal.bookmark.db.allcommon.bhv.core.command; + +import jp.sf.pal.bookmark.db.allcommon.bhv.core.SqlExecution; +import jp.sf.pal.bookmark.db.allcommon.bhv.core.SqlExecutionCreator; +import jp.sf.pal.bookmark.db.allcommon.bhv.core.execution.OutsideSqlSelectExecution; +import jp.sf.pal.bookmark.db.allcommon.cbean.FetchNarrowingBean; +import jp.sf.pal.bookmark.db.allcommon.cbean.FetchNarrowingBeanContext; +import jp.sf.pal.bookmark.db.allcommon.cbean.outsidesql.OutsideSqlContext; +import jp.sf.pal.bookmark.db.allcommon.cbean.outsidesql.OutsideSqlOption; + +import org.seasar.extension.jdbc.ResultSetHandler; + +/** + * The abstract command for OutsideSql.selectSomething(). + * + * @author DBFlute(AutoGenerator) + * @param The type of result. + */ +public abstract class AbstractOutsideSqlSelectCommand extends + AbstractOutsideSqlCommand { + + //========================================================================== + // ========= + // Detail Information + // ================== + public boolean isProcedure() { + return false; + } + + public boolean isSelect() { + return true; + } + + //========================================================================== + // ========= + // Process Callback + // ================ + public void beforeGettingSqlExecution() { + assertStatus("beforeGettingSqlExecution"); + final String path = _outsideSqlPath; + final Object pmb = _parameterBean; + final OutsideSqlOption option = _outsideSqlOption; + final Object resultTypeSpecification = getResultTypeSpecification(); + final boolean autoPagingLogging = (option.isAutoPaging() || option + .isSourcePagingRequestTypeAuto()); + final OutsideSqlContext outsideSqlContext = new OutsideSqlContext(); + outsideSqlContext.setOutsideSqlPath(path); + outsideSqlContext.setParameterBean(pmb); + outsideSqlContext.setResultTypeSpecification(resultTypeSpecification); + outsideSqlContext.setMethodName(getCommandName()); + outsideSqlContext.setStatementConfig(option.getStatementConfig()); + outsideSqlContext.setTableDbName(option.getTableDbName()); + outsideSqlContext.setDynamicBinding(option.isDynamicBinding()); + outsideSqlContext.setOffsetByCursorForcedly(option.isAutoPaging()); + outsideSqlContext.setLimitByCursorForcedly(option.isAutoPaging()); + outsideSqlContext.setAutoPagingLogging(autoPagingLogging); // for + // logging + outsideSqlContext.setupBehaviorQueryPathIfNeeds(); + OutsideSqlContext.setOutsideSqlContextOnThread(outsideSqlContext); + + // Set up fetchNarrowingBean. + setupOutsideSqlFetchNarrowingBean(pmb, option); + } + + protected void setupOutsideSqlFetchNarrowingBean(Object pmb, + OutsideSqlOption option) { + if (pmb == null + || !FetchNarrowingBeanContext.isTheTypeFetchNarrowingBean(pmb + .getClass())) { + return; + } + final FetchNarrowingBean fetchNarrowingBean = (FetchNarrowingBean) pmb; + if (option.isManualPaging()) { + fetchNarrowingBean.ignoreFetchNarrowing(); + } + FetchNarrowingBeanContext + .setFetchNarrowingBeanOnThread(fetchNarrowingBean); + } + + public void afterExecuting() { + } + + //========================================================================== + // ========= + // SqlExecution Handling + // ===================== + public String buildSqlExecutionKey() { + assertStatus("buildSqlExecutionKey"); + return generateSpecifiedOutsideSqlUniqueKey(); + } + + protected String generateSpecifiedOutsideSqlUniqueKey() { + final String methodName = getCommandName(); + final String path = _outsideSqlPath; + final Object pmb = _parameterBean; + final OutsideSqlOption option = _outsideSqlOption; + final Object resultTypeSpecification = getResultTypeSpecification(); + return OutsideSqlContext.generateSpecifiedOutsideSqlUniqueKey( + methodName, path, pmb, option, resultTypeSpecification); + } + + public SqlExecutionCreator createSqlExecutionCreator() { + assertStatus("createSqlExecutionCreator"); + return new SqlExecutionCreator() { + public SqlExecution createSqlExecution() { + final OutsideSqlContext outsideSqlContext = OutsideSqlContext + .getOutsideSqlContextOnThread(); + return createOutsideSqlSelectExecution(outsideSqlContext); + } + }; + } + + protected SqlExecution createOutsideSqlSelectExecution( + OutsideSqlContext outsideSqlContext) { + // - - - - - - - - - - - - - - - - - - - - - - - + // The attribute of Specified-OutsideSqlContext. + // - - - - - - - - - - - - - - - - - - - - - - - + final String suffix = buildDbmsSuffix(); + final String sql = outsideSqlContext.readFilteredOutsideSql( + _sqlFileEncoding, suffix); + final Object pmb = outsideSqlContext.getParameterBean(); + + // - - - - - - - - - - - - - - - + // The attribute of SqlCommand. + // - - - - - - - - - - - - - - - + final String[] argNames = (pmb != null ? new String[] { "pmb" } + : new String[] {}); + final Class[] argTypes = (pmb != null ? new Class[] { pmb + .getClass() } : new Class[] {}); + + // - - - - - - - - - - - - - + // Create ResultSetHandler. + // - - - - - - - - - - - - - + final ResultSetHandler handler = createOutsideSqlSelectResultSetHandler(); + + // - - - - - - - - - - - + // Create SqlExecution. + // - - - - - - - - - - - + return createOutsideSqlSelectExecution(handler, argNames, argTypes, sql); + } + + protected OutsideSqlSelectExecution createOutsideSqlSelectExecution( + ResultSetHandler handler, String[] argNames, Class[] argTypes, + String sql) { + final OutsideSqlSelectExecution cmd = new OutsideSqlSelectExecution( + _dataSource, _statementFactory, handler); + cmd.setArgNames(argNames); + cmd.setArgTypes(argTypes); + cmd.setSql(sql); + return cmd; + } + + public Object[] getSqlExecutionArgument() { + assertStatus("getSqlExecutionArgument"); + return new Object[] { _parameterBean }; + } + + //========================================================================== + // ========= + // Extension Point + // =============== + protected abstract ResultSetHandler createOutsideSqlSelectResultSetHandler(); + + protected abstract Object getResultTypeSpecification(); + + //========================================================================== + // ========= + // Assert Helper + // ============= + protected void assertStatus(String methodName) { + assertBasicProperty(methodName); + assertComponentProperty(methodName); + assertOutsideSqlBasic(methodName); + } +} Property changes on: bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/bhv/core/command/AbstractOutsideSqlSelectCommand.java ___________________________________________________________________ Name: svn:eol-style + native Added: bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/bhv/core/command/AbstractSelectCBCommand.java =================================================================== --- bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/bhv/core/command/AbstractSelectCBCommand.java (rev 0) +++ bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/bhv/core/command/AbstractSelectCBCommand.java 2008-12-27 22:11:51 UTC (rev 1627) @@ -0,0 +1,122 @@ +package jp.sf.pal.bookmark.db.allcommon.bhv.core.command; + +import jp.sf.pal.bookmark.db.allcommon.bhv.core.SqlExecution; +import jp.sf.pal.bookmark.db.allcommon.bhv.core.execution.SelectCBExecution; +import jp.sf.pal.bookmark.db.allcommon.cbean.ConditionBean; +import jp.sf.pal.bookmark.db.allcommon.cbean.outsidesql.OutsideSqlOption; + +import org.seasar.extension.jdbc.ResultSetHandler; + +/** + * @author DBFlute(AutoGenerator) + * @param The type of result. + */ +public abstract class AbstractSelectCBCommand extends + AbstractBehaviorCommand { + + //========================================================================== + // ========= + // Attribute + // ========= + /** The type of condition-bean. (Derived from conditionBean) */ + protected Class _conditionBeanType; + + /** The instance of condition-bean. (Required) */ + protected ConditionBean _conditionBean; + + //========================================================================== + // ========= + // Detail Information + // ================== + public boolean isConditionBean() { + return true; + } + + public boolean isOutsideSql() { + return false; + } + + public boolean isProcedure() { + return false; + } + + public boolean isSelect() { + return true; + } + + //========================================================================== + // ========= + // SqlExecution Handling + // ===================== + public String buildSqlExecutionKey() { + assertStatus("buildSqlExecutionKey"); + return _tableDbName + ":" + getCommandName() + "(" + + _conditionBeanType.getSimpleName() + ")"; + } + + protected SqlExecution createSelectCBExecution( + Class cbType, ResultSetHandler handler) { + return createSelectCBExecution(handler, new String[] { "dto" }, + new Class[] { cbType }); + } + + protected SelectCBExecution createSelectCBExecution( + ResultSetHandler handler, String[] argNames, Class[] argTypes) { + final SelectCBExecution cmd = new SelectCBExecution(_dataSource, + _statementFactory, handler); + cmd.setArgNames(argNames); + cmd.setArgTypes(argTypes); + return cmd; + } + + public Object[] getSqlExecutionArgument() { + assertStatus("getSqlExecutionArgument"); + return new Object[] { _conditionBean }; + } + + //========================================================================== + // ========= + // Argument Information + // ==================== + public ConditionBean getConditionBean() { + return _conditionBean; + } + + public String getOutsideSqlPath() { + return null; + } + + public OutsideSqlOption getOutsideSqlOption() { + return null; + } + + //========================================================================== + // ========= + // Assert Helper + // ============= + protected void assertStatus(String methodName) { + assertBasicProperty(methodName); + assertComponentProperty(methodName); + if (_conditionBeanType == null) { + throw new IllegalStateException(buildAssertMessage( + "_conditionBeanType", methodName)); + } + if (_conditionBean == null) { + throw new IllegalStateException(buildAssertMessage( + "_conditionBean", methodName)); + } + } + + //========================================================================== + // ========= + // Accessor + // ======== + public void setConditionBeanType( + Class conditionBeanType) { + _conditionBeanType = conditionBeanType; + } + + public void setConditionBean(ConditionBean conditionBean) { + _conditionBean = conditionBean; + } +} Property changes on: bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/bhv/core/command/AbstractSelectCBCommand.java ___________________________________________________________________ Name: svn:eol-style + native Added: bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/bhv/core/command/BatchDeleteEntityCommand.java =================================================================== --- bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/bhv/core/command/BatchDeleteEntityCommand.java (rev 0) +++ bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/bhv/core/command/BatchDeleteEntityCommand.java 2008-12-27 22:11:51 UTC (rev 1627) @@ -0,0 +1,51 @@ +package jp.sf.pal.bookmark.db.allcommon.bhv.core.command; + +import jp.sf.pal.bookmark.db.allcommon.bhv.core.SqlExecution; +import jp.sf.pal.bookmark.db.allcommon.bhv.core.SqlExecutionCreator; +import jp.sf.pal.bookmark.db.allcommon.s2dao.internal.sqlcommand.InternalDeleteBatchAutoStaticCommand; + +import org.seasar.dao.BeanMetaData; + +/** + * @author DBFlute(AutoGenerator) + */ +public class BatchDeleteEntityCommand extends AbstractListEntityCommand { + + //========================================================================== + // ========= + // Basic Information + // ================= + public String getCommandName() { + return "batchDelete"; + } + + //========================================================================== + // ========= + // SqlExecution Handling + // ===================== + public SqlExecutionCreator createSqlExecutionCreator() { + assertStatus("createSqlExecutionCreator"); + return new SqlExecutionCreator() { + public SqlExecution createSqlExecution() { + final BeanMetaData bmd = createBeanMetaData(); + return createBatchDeleteEntitySqlExecution(bmd); + } + }; + } + + protected SqlExecution createBatchDeleteEntitySqlExecution(BeanMetaData bmd) { + final String[] propertyNames = getPersistentPropertyNames(bmd); + return createDeleteBatchAutoStaticCommand(bmd, propertyNames); + } + + protected InternalDeleteBatchAutoStaticCommand createDeleteBatchAutoStaticCommand( + BeanMetaData bmd, String[] propertyNames) { + boolean opt = isOptimisticLockHandling(); + return new InternalDeleteBatchAutoStaticCommand(_dataSource, + _statementFactory, bmd, propertyNames, opt); + } + + protected boolean isOptimisticLockHandling() { + return true; + } +} Property changes on: bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/bhv/core/command/BatchDeleteEntityCommand.java ___________________________________________________________________ Name: svn:eol-style + native Added: bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/bhv/core/command/BatchDeleteNonstrictEntityCommand.java =================================================================== --- bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/bhv/core/command/BatchDeleteNonstrictEntityCommand.java (rev 0) +++ bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/bhv/core/command/BatchDeleteNonstrictEntityCommand.java 2008-12-27 22:11:51 UTC (rev 1627) @@ -0,0 +1,25 @@ +package jp.sf.pal.bookmark.db.allcommon.bhv.core.command; + +/** + * @author DBFlute(AutoGenerator) + */ +public class BatchDeleteNonstrictEntityCommand extends BatchDeleteEntityCommand { + + //========================================================================== + // ========= + // Basic Information + // ================= + @Override + public String getCommandName() { + return "batchDeleteNonstrict"; + } + + //========================================================================== + // ========= + // SqlExecution Handling + // ===================== + @Override + protected boolean isOptimisticLockHandling() { + return false; + } +} Property changes on: bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/bhv/core/command/BatchDeleteNonstrictEntityCommand.java ___________________________________________________________________ Name: svn:eol-style + native Added: bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/bhv/core/command/BatchInsertEntityCommand.java =================================================================== --- bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/bhv/core/command/BatchInsertEntityCommand.java (rev 0) +++ bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/bhv/core/command/BatchInsertEntityCommand.java 2008-12-27 22:11:51 UTC (rev 1627) @@ -0,0 +1,46 @@ +package jp.sf.pal.bookmark.db.allcommon.bhv.core.command; + +import jp.sf.pal.bookmark.db.allcommon.bhv.core.SqlExecution; +import jp.sf.pal.bookmark.db.allcommon.bhv.core.SqlExecutionCreator; +import jp.sf.pal.bookmark.db.allcommon.s2dao.internal.sqlcommand.InternalInsertBatchAutoStaticCommand; + +import org.seasar.dao.BeanMetaData; + +/** + * @author DBFlute(AutoGenerator) + */ +public class BatchInsertEntityCommand extends AbstractListEntityCommand { + + //========================================================================== + // ========= + // Basic Information + // ================= + public String getCommandName() { + return "batchInsert"; + } + + //========================================================================== + // ========= + // SqlExecution Handling + // ===================== + public SqlExecutionCreator createSqlExecutionCreator() { + assertStatus("createSqlExecutionCreator"); + return new SqlExecutionCreator() { + public SqlExecution createSqlExecution() { + final BeanMetaData bmd = createBeanMetaData(); + return createBatchInsertEntitySqlExecution(bmd); + } + }; + } + + protected SqlExecution createBatchInsertEntitySqlExecution(BeanMetaData bmd) { + final String[] propertyNames = getPersistentPropertyNames(bmd); + return createInsertBatchAutoStaticCommand(bmd, propertyNames); + } + + protected InternalInsertBatchAutoStaticCommand createInsertBatchAutoStaticCommand( + BeanMetaData bmd, String[] propertyNames) { + return new InternalInsertBatchAutoStaticCommand(_dataSource, + _statementFactory, bmd, propertyNames); + } +} Property changes on: bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/bhv/core/command/BatchInsertEntityCommand.java ___________________________________________________________________ Name: svn:eol-style + native Added: bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/bhv/core/command/BatchUpdateEntityCommand.java =================================================================== --- bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/bhv/core/command/BatchUpdateEntityCommand.java (rev 0) +++ bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/bhv/core/command/BatchUpdateEntityCommand.java 2008-12-27 22:11:51 UTC (rev 1627) @@ -0,0 +1,51 @@ +package jp.sf.pal.bookmark.db.allcommon.bhv.core.command; + +import jp.sf.pal.bookmark.db.allcommon.bhv.core.SqlExecution; +import jp.sf.pal.bookmark.db.allcommon.bhv.core.SqlExecutionCreator; +import jp.sf.pal.bookmark.db.allcommon.s2dao.internal.sqlcommand.InternalUpdateBatchAutoStaticCommand; + +import org.seasar.dao.BeanMetaData; + +/** + * @author DBFlute(AutoGenerator) + */ +public class BatchUpdateEntityCommand extends AbstractListEntityCommand { + + //========================================================================== + // ========= + // Basic Information + // ================= + public String getCommandName() { + return "batchUpdate"; + } + + //========================================================================== + // ========= + // SqlExecution Handling + // ===================== + public SqlExecutionCreator createSqlExecutionCreator() { + assertStatus("createSqlExecutionCreator"); + return new SqlExecutionCreator() { + public SqlExecution createSqlExecution() { + final BeanMetaData bmd = createBeanMetaData(); + return createBatchUpdateEntitySqlExecution(bmd); + } + }; + } + + protected SqlExecution createBatchUpdateEntitySqlExecution(BeanMetaData bmd) { + final String[] propertyNames = getPersistentPropertyNames(bmd); + return createUpdateBatchAutoStaticCommand(bmd, propertyNames); + } + + protected InternalUpdateBatchAutoStaticCommand createUpdateBatchAutoStaticCommand( + BeanMetaData bmd, String[] propertyNames) { + boolean opt = isOptimisticLockHandling(); + return new InternalUpdateBatchAutoStaticCommand(_dataSource, + _statementFactory, bmd, propertyNames, opt, opt); + } + + protected boolean isOptimisticLockHandling() { + return true; + } +} Property changes on: bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/bhv/core/command/BatchUpdateEntityCommand.java ___________________________________________________________________ Name: svn:eol-style + native Added: bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/bhv/core/command/BatchUpdateNonstrictEntityCommand.java =================================================================== --- bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/bhv/core/command/BatchUpdateNonstrictEntityCommand.java (rev 0) +++ bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/bhv/core/command/BatchUpdateNonstrictEntityCommand.java 2008-12-27 22:11:51 UTC (rev 1627) @@ -0,0 +1,25 @@ +package jp.sf.pal.bookmark.db.allcommon.bhv.core.command; + +/** + * @author DBFlute(AutoGenerator) + */ +public class BatchUpdateNonstrictEntityCommand extends BatchUpdateEntityCommand { + + //========================================================================== + // ========= + // Basic Information + // ================= + @Override + public String getCommandName() { + return "batchUpdateNonstrict"; + } + + //========================================================================== + // ========= + // SqlExecution Handling + // ===================== + @Override + protected boolean isOptimisticLockHandling() { + return false; + } +} Property changes on: bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/bhv/core/command/BatchUpdateNonstrictEntityCommand.java ___________________________________________________________________ Name: svn:eol-style + native Added: bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/bhv/core/command/DeleteEntityCommand.java =================================================================== --- bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/bhv/core/command/DeleteEntityCommand.java (rev 0) +++ bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/bhv/core/command/DeleteEntityCommand.java 2008-12-27 22:11:51 UTC (rev 1627) @@ -0,0 +1,51 @@ +package jp.sf.pal.bookmark.db.allcommon.bhv.core.command; + +import jp.sf.pal.bookmark.db.allcommon.bhv.core.SqlExecution; +import jp.sf.pal.bookmark.db.allcommon.bhv.core.SqlExecutionCreator; +import jp.sf.pal.bookmark.db.allcommon.s2dao.internal.sqlcommand.InternalDeleteAutoStaticCommand; + +import org.seasar.dao.BeanMetaData; + +/** + * @author DBFlute(AutoGenerator) + */ +public class DeleteEntityCommand extends AbstractEntityCommand { + + //========================================================================== + // ========= + // Basic Information + // ================= + public String getCommandName() { + return "delete"; + } + + //========================================================================== + // ========= + // SqlExecution Handling + // ===================== + public SqlExecutionCreator createSqlExecutionCreator() { + assertStatus("createSqlExecutionCreator"); + return new SqlExecutionCreator() { + public SqlExecution createSqlExecution() { + final BeanMetaData bmd = createBeanMetaData(); + return createDeleteEntitySqlExecution(bmd); + } + }; + } + + protected SqlExecution createDeleteEntitySqlExecution(BeanMetaData bmd) { + final String[] propertyNames = getPersistentPropertyNames(bmd); + return createDeleteAutoStaticCommand(bmd, propertyNames); + } + + protected InternalDeleteAutoStaticCommand createDeleteAutoStaticCommand( + BeanMetaData bmd, String[] propertyNames) { + return new InternalDeleteAutoStaticCommand(_dataSource, + _statementFactory, bmd, propertyNames, + isOptimisticLockHandling()); + } + + protected boolean isOptimisticLockHandling() { + return true; + } +} Property changes on: bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/bhv/core/command/DeleteEntityCommand.java ___________________________________________________________________ Name: svn:eol-style + native Added: bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/bhv/core/command/DeleteNonstrictEntityCommand.java =================================================================== --- bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/bhv/core/command/DeleteNonstrictEntityCommand.java (rev 0) +++ bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/bhv/core/command/DeleteNonstrictEntityCommand.java 2008-12-27 22:11:51 UTC (rev 1627) @@ -0,0 +1,25 @@ +package jp.sf.pal.bookmark.db.allcommon.bhv.core.command; + +/** + * @author DBFlute(AutoGenerator) + */ +public class DeleteNonstrictEntityCommand extends DeleteEntityCommand { + + //========================================================================== + // ========= + // Basic Information + // ================= + @Override + public String getCommandName() { + return "deleteNonstrict"; + } + + //========================================================================== + // ========= + // SqlExecution Handling + // ===================== + @Override + protected boolean isOptimisticLockHandling() { + return false; + } +} Property changes on: bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/bhv/core/command/DeleteNonstrictEntityCommand.java ___________________________________________________________________ Name: svn:eol-style + native Added: bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/bhv/core/command/InsertEntityCommand.java =================================================================== --- bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/bhv/core/command/InsertEntityCommand.java (rev 0) +++ bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/bhv/core/command/InsertEntityCommand.java 2008-12-27 22:11:51 UTC (rev 1627) @@ -0,0 +1,86 @@ +package jp.sf.pal.bookmark.db.allcommon.bhv.core.command; + +import java.util.List; + +import jp.sf.pal.bookmark.db.allcommon.bhv.core.SqlExecution; +import jp.sf.pal.bookmark.db.allcommon.bhv.core.SqlExecutionCreator; +import jp.sf.pal.bookmark.db.allcommon.dbmeta.DBMeta; +import jp.sf.pal.bookmark.db.allcommon.dbmeta.info.ColumnInfo; +import jp.sf.pal.bookmark.db.allcommon.s2dao.internal.sqlcommand.InternalInsertAutoDynamicCommand; + +import org.seasar.dao.BeanMetaData; + +/** + * @author DBFlute(AutoGenerator) + */ +public class InsertEntityCommand extends AbstractEntityCommand { + + //========================================================================== + // ========= + // Basic Information + // ================= + public String getCommandName() { + return "insert"; + } + + //========================================================================== + // ========= + // SqlExecution Handling + // ===================== + public SqlExecutionCreator createSqlExecutionCreator() { + assertStatus("createSqlExecutionCreator"); + return new SqlExecutionCreator() { + public SqlExecution createSqlExecution() { + final BeanMetaData bmd = createBeanMetaData(); + return createInsertEntitySqlExecution(bmd); + } + }; + } + + protected SqlExecution createInsertEntitySqlExecution(BeanMetaData bmd) { + final SqlExecution nonPrimaryKeySqlExecution = createNonPrimaryInsertSqlExecution(bmd); + if (nonPrimaryKeySqlExecution != null) { + return nonPrimaryKeySqlExecution; + } + final String[] propertyNames = getPersistentPropertyNames(bmd); + return createInsertAutoDynamicCommand(bmd, propertyNames); + } + + protected InternalInsertAutoDynamicCommand createInsertAutoDynamicCommand( + BeanMetaData bmd, String[] propertyNames) { + final InternalInsertAutoDynamicCommand cmd = new InternalInsertAutoDynamicCommand(); + cmd.setBeanMetaData(bmd); + cmd.setDataSource(_dataSource); + cmd.setPropertyNames(propertyNames); + cmd.setStatementFactory(_statementFactory); + return cmd; + } + + /** + * @param bmd The meta data of bean. (NotNull) + * @return Whether the method is target. (For example if it has primary key, + * returns false.) + */ + protected SqlExecution createNonPrimaryInsertSqlExecution(BeanMetaData bmd) { + final DBMeta dbmeta = findDBMeta(); + if (dbmeta.hasPrimaryKey()) { + return null; + } + final List columnInfoList = dbmeta.getColumnInfoList(); + final StringBuilder columnDefSb = new StringBuilder(); + for (jp.sf.pal.bookmark.db.allcommon.dbmeta.info.ColumnInfo columnInfo : columnInfoList) { + columnDefSb.append(", ").append(columnInfo.getColumnDbName()); + } + columnDefSb.delete(0, ", ".length()).insert(0, "(").append(")"); + final StringBuilder columnValuesSb = new StringBuilder(); + for (jp.sf.pal.bookmark.db.allcommon.dbmeta.info.ColumnInfo columnInfo : columnInfoList) { + columnValuesSb.append(", /*dto.").append( + columnInfo.getPropertyName()).append("*/null"); + } + columnValuesSb.delete(0, ", ".length()).insert(0, "(").append(")"); + final String sql = "insert into " + dbmeta.getTableSqlName() + + columnDefSb + " values" + columnValuesSb; + return createUpdateDynamicCommand(new String[] { "dto" }, + new Class[] { _entityType }, sql); + } +} Property changes on: bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/bhv/core/command/InsertEntityCommand.java ___________________________________________________________________ Name: svn:eol-style + native Added: bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/bhv/core/command/OutsideSqlCallCommand.java =================================================================== --- bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/bhv/core/command/OutsideSqlCallCommand.java (rev 0) +++ bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/bhv/core/command/OutsideSqlCallCommand.java 2008-12-27 22:11:51 UTC (rev 1627) @@ -0,0 +1,152 @@ +package jp.sf.pal.bookmark.db.allcommon.bhv.core.command; + +import jp.sf.pal.bookmark.db.allcommon.bhv.core.SqlExecution; +import jp.sf.pal.bookmark.db.allcommon.bhv.core.SqlExecutionCreator; +import jp.sf.pal.bookmark.db.allcommon.cbean.outsidesql.OutsideSqlContext; +import jp.sf.pal.bookmark.db.allcommon.cbean.outsidesql.OutsideSqlOption; +import jp.sf.pal.bookmark.db.allcommon.s2dao.internal.sqlcommand.InternalProcedureCommand; +import jp.sf.pal.bookmark.db.allcommon.s2dao.internal.various.InternalProcedureMetaData; +import jp.sf.pal.bookmark.db.allcommon.s2dao.internal.various.InternalProcedureMetaDataFactory; + +import org.seasar.extension.jdbc.ResultSetHandler; + +/** + * The behavior command for OutsideSql.execute(). + * + * @author DBFlute(AutoGenerator) + */ +public class OutsideSqlCallCommand extends AbstractOutsideSqlCommand { + + //========================================================================== + // ========= + // Basic Information + // ================= + public String getCommandName() { + return "call"; + } + + public Class getCommandReturnType() { + return void.class; + } + + //========================================================================== + // ========= + // Detail Information + // ================== + public boolean isProcedure() { + return true; + } + + public boolean isSelect() { + return false; + } + + //========================================================================== + // ========= + // Process Callback + // ================ + public void beforeGettingSqlExecution() { + assertStatus("beforeGettingSqlExecution"); + final String path = _outsideSqlPath; + final Object pmb = _parameterBean; + final OutsideSqlOption option = _outsideSqlOption; + final OutsideSqlContext outsideSqlContext = new OutsideSqlContext(); + outsideSqlContext.setDynamicBinding(option.isDynamicBinding()); + outsideSqlContext.setOffsetByCursorForcedly(option.isAutoPaging()); + outsideSqlContext.setLimitByCursorForcedly(option.isAutoPaging()); + outsideSqlContext.setOutsideSqlPath(path); + outsideSqlContext.setParameterBean(pmb); + outsideSqlContext.setMethodName(getCommandName()); + outsideSqlContext.setStatementConfig(option.getStatementConfig()); + outsideSqlContext.setTableDbName(option.getTableDbName()); + outsideSqlContext.setupBehaviorQueryPathIfNeeds(); + OutsideSqlContext.setOutsideSqlContextOnThread(outsideSqlContext); + } + + public void afterExecuting() { + } + + //========================================================================== + // ========= + // SqlExecution Handling + // ===================== + public String buildSqlExecutionKey() { + assertStatus("buildSqlExecutionKey"); + return generateSpecifiedOutsideSqlUniqueKey(); + } + + protected String generateSpecifiedOutsideSqlUniqueKey() { + final String methodName = getCommandName(); + final String path = _outsideSqlPath; + final Object pmb = _parameterBean; + final OutsideSqlOption option = _outsideSqlOption; + return OutsideSqlContext.generateSpecifiedOutsideSqlUniqueKey( + methodName, path, pmb, option, null); + } + + public SqlExecutionCreator createSqlExecutionCreator() { + assertStatus("createSqlExecutionCreator"); + return new SqlExecutionCreator() { + public SqlExecution createSqlExecution() { + final OutsideSqlContext outsideSqlContext = OutsideSqlContext + .getOutsideSqlContextOnThread(); + return createOutsideSqlCallCommand(outsideSqlContext); + } + }; + } + + protected SqlExecution createOutsideSqlCallCommand( + OutsideSqlContext outsideSqlContext) { + // - - - - - - - - - - - - - - - - - - - - - - - + // The attribute of Specified-OutsideSqlContext. + // - - - - - - - - - - - - - - - - - - - - - - - + final Object pmb = outsideSqlContext.getParameterBean(); + final String procedureName = outsideSqlContext.getOutsideSqlPath(); + + // - - - - - - - - - - - - - - - + // The attribute of SqlCommand. + // - - - - - - - - - - - - - - - + final InternalProcedureMetaDataFactory factory = createProcedureMetaDataFactory(); + factory.setValueTypeFactory(_valueTypeFactory); + final Class pmbType = (pmb != null ? pmb.getClass() : null); + final InternalProcedureMetaData metaData = factory + .createProcedureMetaData(procedureName, pmbType); + return createProcedureCommand(metaData); + } + + protected InternalProcedureMetaDataFactory createProcedureMetaDataFactory() { + return new InternalProcedureMetaDataFactory(); + } + + protected InternalProcedureCommand createProcedureCommand( + InternalProcedureMetaData metaData) { + // Because a procedure command does not use result set handler. + final ResultSetHandler resultSetHandler = new InternalNullResultSetHandler(); + return new InternalProcedureCommand(_dataSource, resultSetHandler, + _statementFactory, metaData); + } + + // /- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + // - - + // InternalProcedureCommand switches argument so this is unnecessary + // actually! + // - - - - - - - - - -/ + public Object[] getSqlExecutionArgument() { + return new Object[] { _parameterBean }; + } + + //========================================================================== + // ========= + // Assert Helper + // ============= + protected void assertStatus(String methodName) { + assertBasicProperty(methodName); + assertComponentProperty(methodName); + assertOutsideSqlBasic(methodName); + if (_parameterBean == null) { + String msg = "The property 'parameterBean' should not be null"; + msg = msg + " when you call " + methodName + "()."; + throw new IllegalStateException(msg); + } + } +} Property changes on: bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/bhv/core/command/OutsideSqlCallCommand.java ___________________________________________________________________ Name: svn:eol-style + native Added: bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/bhv/core/command/OutsideSqlExecuteCommand.java =================================================================== --- bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/bhv/core/command/OutsideSqlExecuteCommand.java (rev 0) +++ bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/bhv/core/command/OutsideSqlExecuteCommand.java 2008-12-27 22:11:51 UTC (rev 1627) @@ -0,0 +1,128 @@ +package jp.sf.pal.bookmark.db.allcommon.bhv.core.command; + +import jp.sf.pal.bookmark.db.allcommon.bhv.core.SqlExecution; +import jp.sf.pal.bookmark.db.allcommon.bhv.core.SqlExecutionCreator; +import jp.sf.pal.bookmark.db.allcommon.cbean.outsidesql.OutsideSqlContext; +import jp.sf.pal.bookmark.db.allcommon.cbean.outsidesql.OutsideSqlOption; + +/** + * The behavior command for OutsideSql.execute(). + * + * @author DBFlute(AutoGenerator) + */ +public class OutsideSqlExecuteCommand extends + AbstractOutsideSqlCommand { + + //========================================================================== + // ========= + // Basic Information + // ================= + public String getCommandName() { + return "execute"; + } + + public Class getCommandReturnType() { + return Integer.class; + } + + //========================================================================== + // ========= + // Detail Information + // ================== + public boolean isProcedure() { + return false; + } + + public boolean isSelect() { + return false; + } + + //========================================================================== + // ========= + // Process Callback + // ================ + public void beforeGettingSqlExecution() { + assertStatus("beforeGettingSqlExecution"); + final String path = _outsideSqlPath; + final Object pmb = _parameterBean; + final OutsideSqlOption option = _outsideSqlOption; + final OutsideSqlContext outsideSqlContext = new OutsideSqlContext(); + outsideSqlContext.setDynamicBinding(option.isDynamicBinding()); + outsideSqlContext.setOffsetByCursorForcedly(option.isAutoPaging()); + outsideSqlContext.setLimitByCursorForcedly(option.isAutoPaging()); + outsideSqlContext.setOutsideSqlPath(path); + outsideSqlContext.setParameterBean(pmb); + outsideSqlContext.setMethodName(getCommandName()); + outsideSqlContext.setStatementConfig(option.getStatementConfig()); + outsideSqlContext.setTableDbName(option.getTableDbName()); + outsideSqlContext.setupBehaviorQueryPathIfNeeds(); + OutsideSqlContext.setOutsideSqlContextOnThread(outsideSqlContext); + } + + public void afterExecuting() { + } + + //========================================================================== + // ========= + // SqlExecution Handling + // ===================== + public String buildSqlExecutionKey() { + assertStatus("buildSqlExecutionKey"); + return generateSpecifiedOutsideSqlUniqueKey(); + } + + protected String generateSpecifiedOutsideSqlUniqueKey() { + final String methodName = getCommandName(); + final String path = _outsideSqlPath; + final Object pmb = _parameterBean; + final OutsideSqlOption option = _outsideSqlOption; + return OutsideSqlContext.generateSpecifiedOutsideSqlUniqueKey( + methodName, path, pmb, option, null); + } + + public SqlExecutionCreator createSqlExecutionCreator() { + assertStatus("createSqlExecutionCreator"); + return new SqlExecutionCreator() { + public SqlExecution createSqlExecution() { + final OutsideSqlContext outsideSqlContext = OutsideSqlContext + .getOutsideSqlContextOnThread(); + return createOutsideSqlExecuteExecution(outsideSqlContext); + } + }; + } + + protected SqlExecution createOutsideSqlExecuteExecution( + OutsideSqlContext outsideSqlContext) { + // - - - - - - - - - - - - - - - - - - - - - - - + // The attribute of Specified-OutsideSqlContext. + // - - - - - - - - - - - - - - - - - - - - - - - + final String suffix = buildDbmsSuffix(); + final String sql = outsideSqlContext.readFilteredOutsideSql( + _sqlFileEncoding, suffix); + final Object pmb = outsideSqlContext.getParameterBean(); + + // - - - - - - - - - - - - - - - + // The attribute of SqlCommand. + // - - - - - - - - - - - - - - - + final String[] argNames = (pmb != null ? new String[] { "pmb" } + : new String[] {}); + final Class[] argTypes = (pmb != null ? new Class[] { pmb + .getClass() } : new Class[] {}); + + return createUpdateDynamicCommand(argNames, argTypes, sql); + } + + public Object[] getSqlExecutionArgument() { + return new Object[] { _parameterBean }; + } + + //========================================================================== + // ========= + // Assert Helper + // ============= + protected void assertStatus(String methodName) { + assertBasicProperty(methodName); + assertComponentProperty(methodName); + assertOutsideSqlBasic(methodName); + } +} Property changes on: bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/bhv/core/command/OutsideSqlExecuteCommand.java ___________________________________________________________________ Name: svn:eol-style + native Added: bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/bhv/core/command/OutsideSqlSelectCursorCommand.java =================================================================== --- bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/bhv/core/command/OutsideSqlSelectCursorCommand.java (rev 0) +++ bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/bhv/core/command/OutsideSqlSelectCursorCommand.java 2008-12-27 22:11:51 UTC (rev 1627) @@ -0,0 +1,77 @@ +package jp.sf.pal.bookmark.db.allcommon.bhv.core.command; + +import java.sql.ResultSet; +import java.sql.SQLException; + +import jp.sf.pal.bookmark.db.allcommon.jdbc.CursorHandler; + +import org.seasar.extension.jdbc.ResultSetHandler; + +/** + * The behavior command for OutsideSql.selectList(). + * + * @author DBFlute(AutoGenerator) + */ +public class OutsideSqlSelectCursorCommand extends + AbstractOutsideSqlSelectCommand { + + //========================================================================== + // ========= + // Attribute + // ========= + /** The handler of cursor. (Required) */ + protected CursorHandler _cursorHandler; + + //========================================================================== + // ========= + // Basic Information + // ================= + public String getCommandName() { + return "selectCursor"; + } + + public Class getCommandReturnType() { + return Object.class; + } + + //========================================================================== + // ========= + // Extension Point + // =============== + @Override + protected ResultSetHandler createOutsideSqlSelectResultSetHandler() { + return new ResultSetHandler() { + public Object handle(ResultSet rs) throws SQLException { + return _cursorHandler.handle(rs); + } + }; + } + + @Override + protected Object getResultTypeSpecification() { + return _cursorHandler; + } + + //========================================================================== + // ========= + // Assert Helper + // ============= + @Override + protected void assertStatus(String methodName) { + assertBasicProperty(methodName); + assertComponentProperty(methodName); + assertOutsideSqlBasic(methodName); + if (_cursorHandler == null) { + throw new IllegalStateException(buildAssertMessage( + "_cursorHandler", methodName)); + } + } + + //========================================================================== + // ========= + // Accessor + // ======== + public void setCursorHandler(CursorHandler cursorHandler) { + _cursorHandler = cursorHandler; + } +} Property changes on: bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/bhv/core/command/OutsideSqlSelectCursorCommand.java ___________________________________________________________________ Name: svn:eol-style + native Added: bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/bhv/core/command/OutsideSqlSelectListCommand.java =================================================================== --- bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/bhv/core/command/OutsideSqlSelectListCommand.java (rev 0) +++ bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/bhv/core/command/OutsideSqlSelectListCommand.java 2008-12-27 22:11:51 UTC (rev 1627) @@ -0,0 +1,96 @@ +package jp.sf.pal.bookmark.db.allcommon.bhv.core.command; + +import java.util.List; + +import org.seasar.dao.BeanMetaData; +import org.seasar.extension.jdbc.ResultSetHandler; +import org.seasar.extension.jdbc.ValueType; +import org.seasar.extension.jdbc.types.ValueTypes; + +/** + * The behavior command for OutsideSql.selectList(). + * + * @author DBFlute(AutoGenerator) + * @param The type of entity. + */ +public class OutsideSqlSelectListCommand extends + AbstractOutsideSqlSelectCommand> { + + //========================================================================== + // ========= + // Attribute + // ========= + /** The type of entity. (Required) */ + protected Class _entityType; + + //========================================================================== + // ========= + // Basic Information + // ================= + public String getCommandName() { + return "selectList"; + } + + public Class getCommandReturnType() { + return List.class; + } + + //========================================================================== + // ========= + // Factory + // ======= + // ----------------------------------------------------- + // BeanMetaData + // ------------ + protected BeanMetaData createBeanMetaData() { + assertEntityType("createBeanMetaData"); + return _beanMetaDataFactory.createBeanMetaData(_entityType); + } + + // ----------------------------------------------------- + // ResultSetHandler + // ---------------- + protected ResultSetHandler createOutsideSqlBeanListResultSetHandler( + BeanMetaData bmd) { + final ValueType valueType = ValueTypes.getValueType(_entityType); + if (valueType == null || !valueType.equals(ValueTypes.OBJECT)) { + return createObjectListResultSetHandler(valueType); + } + return createBeanListMetaDataResultSetHandler(bmd); + } + + //========================================================================== + // ========= + // Extension Point + // =============== + @Override + protected ResultSetHandler createOutsideSqlSelectResultSetHandler() { + final BeanMetaData bmd = createBeanMetaData(); + final ResultSetHandler handler = createOutsideSqlBeanListResultSetHandler(bmd); + return handler; + } + + @Override + protected Object getResultTypeSpecification() { + return _entityType; + } + + //========================================================================== + // ========= + // Assert Helper + // ============= + protected void assertEntityType(String methodName) { + if (_entityType == null) { + throw new IllegalStateException(buildAssertMessage("_entityType", + methodName)); + } + } + + //========================================================================== + // ========= + // Accessor + // ======== + public void setEntityType(Class entityType) { + _entityType = entityType; + } +} Property changes on: bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/bhv/core/command/OutsideSqlSelectListCommand.java ___________________________________________________________________ Name: svn:eol-style + native Added: bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/bhv/core/command/QueryDeleteCBCommand.java =================================================================== --- bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/bhv/core/command/QueryDeleteCBCommand.java (rev 0) +++ bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/bhv/core/command/QueryDeleteCBCommand.java 2008-12-27 22:11:51 UTC (rev 1627) @@ -0,0 +1,151 @@ +package jp.sf.pal.bookmark.db.allcommon.bhv.core.command; + +import jp.sf.pal.bookmark.db.allcommon.bhv.core.SqlExecution; +import jp.sf.pal.bookmark.db.allcommon.bhv.core.SqlExecutionCreator; +import jp.sf.pal.bookmark.db.allcommon.cbean.ConditionBean; +import jp.sf.pal.bookmark.db.allcommon.cbean.ConditionBeanContext; +import jp.sf.pal.bookmark.db.allcommon.cbean.FetchNarrowingBeanContext; +import jp.sf.pal.bookmark.db.allcommon.cbean.outsidesql.OutsideSqlOption; +import jp.sf.pal.bookmark.db.allcommon.s2dao.internal.sqlcommand.InternalDeleteQueryAutoDynamicCommand; + +/** + * @author DBFlute(AutoGenerator) + */ +public class QueryDeleteCBCommand extends AbstractBehaviorCommand { + + //========================================================================== + // ========= + // Attribute + // ========= + /** The type of condition-bean. (Derived from conditionBean) */ + protected Class _conditionBeanType; + + /** The instance of condition-bean. (Required) */ + protected ConditionBean _conditionBean; + + //========================================================================== + // ========= + // Basic Information + // ================= + public String getCommandName() { + return "queryDelete"; + } + + public Class getCommandReturnType() { + return int.class; + } + + //========================================================================== + // ========= + // Detail Information + // ================== + public boolean isConditionBean() { + return true; + } + + public boolean isOutsideSql() { + return false; + } + + public boolean isProcedure() { + return false; + } + + public boolean isSelect() { + return false; + } + + public boolean isSelectCount() { + return false; + } + + //========================================================================== + // ========= + // Process Callback + // ================ + public void beforeGettingSqlExecution() { + assertStatus("beforeGettingSqlExecution"); + final ConditionBean cb = _conditionBean; + FetchNarrowingBeanContext.setFetchNarrowingBeanOnThread(cb); + ConditionBeanContext.setConditionBeanOnThread(cb); + } + + public void afterExecuting() { + } + + //========================================================================== + // ========= + // SqlExecution Handling + // ===================== + public String buildSqlExecutionKey() { + assertStatus("buildSqlExecutionKey"); + return _tableDbName + ":" + getCommandName() + "(" + + _conditionBeanType.getSimpleName() + ")"; + } + + public SqlExecutionCreator createSqlExecutionCreator() { + assertStatus("createSqlExecutionCreator"); + return new SqlExecutionCreator() { + public SqlExecution createSqlExecution() { + return createQueryDeleteCBExecution(_conditionBeanType); + } + }; + } + + protected SqlExecution createQueryDeleteCBExecution( + Class cbType) { + return new InternalDeleteQueryAutoDynamicCommand(_dataSource, + _statementFactory); + } + + public Object[] getSqlExecutionArgument() { + assertStatus("getSqlExecutionArgument"); + return new Object[] { _conditionBean }; + } + + //========================================================================== + // ========= + // Argument Information + // ==================== + public ConditionBean getConditionBean() { + return _conditionBean; + } + + public String getOutsideSqlPath() { + return null; + } + + public OutsideSqlOption getOutsideSqlOption() { + return null; + } + + //========================================================================== + // ========= + // Assert Helper + // ============= + protected void assertStatus(String methodName) { + assertBasicProperty(methodName); + assertComponentProperty(methodName); + if (_conditionBeanType == null) { + throw new IllegalStateException(buildAssertMessage( + "_conditionBeanType", methodName)); + } + if (_conditionBean == null) { + throw new IllegalStateException(buildAssertMessage( + "_conditionBean", methodName)); + } + } + + //========================================================================== + // ========= + // Accessor + // ======== + public void setConditionBeanType( + Class conditionBeanType) { + _conditionBeanType = conditionBeanType; + } + + public void setConditionBean(ConditionBean conditionBean) { + _conditionBean = conditionBean; + } +} Property changes on: bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/bhv/core/command/QueryDeleteCBCommand.java ___________________________________________________________________ Name: svn:eol-style + native Added: bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/bhv/core/command/QueryUpdateEntityCBCommand.java =================================================================== --- bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/bhv/core/command/QueryUpdateEntityCBCommand.java (rev 0) +++ bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/bhv/core/command/QueryUpdateEntityCBCommand.java 2008-12-27 22:11:51 UTC (rev 1627) @@ -0,0 +1,140 @@ +package jp.sf.pal.bookmark.db.allcommon.bhv.core.command; + +import jp.sf.pal.bookmark.db.allcommon.bhv.core.SqlExecution; +import jp.sf.pal.bookmark.db.allcommon.bhv.core.SqlExecutionCreator; +import jp.sf.pal.bookmark.db.allcommon.cbean.ConditionBean; +import jp.sf.pal.bookmark.db.allcommon.cbean.ConditionBeanContext; +import jp.sf.pal.bookmark.db.allcommon.cbean.FetchNarrowingBeanContext; +import jp.sf.pal.bookmark.db.allcommon.cbean.outsidesql.OutsideSqlOption; +import jp.sf.pal.bookmark.db.allcommon.s2dao.internal.sqlcommand.InternalUpdateQueryAutoDynamicCommand; + +/** + * @author DBFlute(AutoGenerator) + */ +public class QueryUpdateEntityCBCommand extends AbstractEntityCommand { + + //========================================================================== + // ========= + // Attribute + // ========= + /** The type of condition-bean. (Derived from conditionBean) */ + protected Class _conditionBeanType; + + /** The instance of condition-bean. (Required) */ + protected ConditionBean _conditionBean; + + //========================================================================== + // ========= + // Basic Information + // ================= + public String getCommandName() { + return "queryUpdate"; + } + + //========================================================================== + // ========= + // Detail Information + // ================== + @Override + public boolean isConditionBean() { + return true; + } + + //========================================================================== + // ========= + // Process Callback + // ================ + @Override + public void beforeGettingSqlExecution() { + assertStatus("beforeGettingSqlExecution"); + final ConditionBean cb = _conditionBean; + FetchNarrowingBeanContext.setFetchNarrowingBeanOnThread(cb); + ConditionBeanContext.setConditionBeanOnThread(cb); + } + + //========================================================================== + // ========= + // SqlExecution Handling + // ===================== + public String buildSqlExecutionKey() { + assertStatus("buildSqlExecutionKey"); + return _tableDbName + ":" + getCommandName() + "(" + + _entityType.getSimpleName() + ", " + + _conditionBeanType.getSimpleName() + ")"; + } + + public SqlExecutionCreator createSqlExecutionCreator() { + assertStatus("createSqlExecutionCreator"); + return new SqlExecutionCreator() { + public SqlExecution createSqlExecution() { + return createQueryUpdateEntityCBExecution(_conditionBeanType); + } + }; + } + + protected SqlExecution createQueryUpdateEntityCBExecution( + Class cbType) { + return new InternalUpdateQueryAutoDynamicCommand(_dataSource, + _statementFactory); + } + + public Object[] getSqlExecutionArgument() { + assertStatus("getSqlExecutionArgument"); + return new Object[] { _conditionBean, _entity }; + } + + //========================================================================== + // ========= + // Argument Information + // ==================== + public ConditionBean getConditionBean() { + return _conditionBean; + } + + public String getOutsideSqlPath() { + return null; + } + + public OutsideSqlOption getOutsideSqlOption() { + return null; + } + + //========================================================================== + // ========= + // Assert Helper + // ============= + @Override + protected void assertStatus(String methodName) { + assertBasicProperty(methodName); + assertComponentProperty(methodName); + if (_entityType == null) { + throw new IllegalStateException(buildAssertMessage("_entityType", + methodName)); + } + if (_entity == null) { + throw new IllegalStateException(buildAssertMessage("_entity", + methodName)); + } + if (_conditionBeanType == null) { + throw new IllegalStateException(buildAssertMessage( + "_conditionBeanType", methodName)); + } + if (_conditionBean == null) { + throw new IllegalStateException(buildAssertMessage( + "_conditionBean", methodName)); + } + } + + //========================================================================== + // ========= + // Accessor + // ======== + public void setConditionBeanType( + Class conditionBeanType) { + _conditionBeanType = conditionBeanType; + } + + public void setConditionBean(ConditionBean conditionBean) { + _conditionBean = conditionBean; + } +} Property changes on: bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/bhv/core/command/QueryUpdateEntityCBCommand.java ___________________________________________________________________ Name: svn:eol-style + native Added: bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/bhv/core/command/SelectCountCBCommand.java =================================================================== --- bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/bhv/core/command/SelectCountCBCommand.java (rev 0) +++ bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/bhv/core/command/SelectCountCBCommand.java 2008-12-27 22:11:51 UTC (rev 1627) @@ -0,0 +1,65 @@ +package jp.sf.pal.bookmark.db.allcommon.bhv.core.command; + +import jp.sf.pal.bookmark.db.allcommon.bhv.core.SqlExecution; +import jp.sf.pal.bookmark.db.allcommon.bhv.core.SqlExecutionCreator; +import jp.sf.pal.bookmark.db.allcommon.cbean.ConditionBean; +import jp.sf.pal.bookmark.db.allcommon.cbean.ConditionBeanContext; + +import org.seasar.extension.jdbc.ResultSetHandler; + +/** + * @author DBFlute(AutoGenerator) + */ +public class SelectCountCBCommand extends AbstractSelectCBCommand { + + //========================================================================== + // ========= + // Basic Information + // ================= + public String getCommandName() { + return "selectCount"; + } + + public Class getCommandReturnType() { + return Integer.class; + } + + //========================================================================== + // ========= + // Process Callback + // ================ + public void beforeGettingSqlExecution() { + assertStatus("beforeGettingSqlExecution"); + final ConditionBean cb = _conditionBean; + cb.xsetupSelectCountIgnoreFetchScope(); // *Point! + ConditionBeanContext.setConditionBeanOnThread(cb); + } + + public void afterExecuting() { + assertStatus("afterExecuting"); + final ConditionBean cb = _conditionBean; + cb.xafterCareSelectCountIgnoreFetchScope(); + } + + //========================================================================== + // ========= + // Detail Information + // ================== + public boolean isSelectCount() { + return true; + } + + //========================================================================== + // ========= + // SqlExecution Handling + // ===================== + public SqlExecutionCreator createSqlExecutionCreator() { + assertStatus("createSqlExecutionCreator"); + return new SqlExecutionCreator() { + public SqlExecution createSqlExecution() { + ResultSetHandler handler = createObjectResultSetHandler(getCommandReturnType()); + return createSelectCBExecution(_conditionBeanType, handler); + } + }; + } +} Property changes on: bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/bhv/core/command/SelectCountCBCommand.java ___________________________________________________________________ Name: svn:eol-style + native Added: bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/bhv/core/command/SelectListCBCommand.java =================================================================== --- bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/bhv/core/command/SelectListCBCommand.java (rev 0) +++ bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/bhv/core/command/SelectListCBCommand.java 2008-12-27 22:11:51 UTC (rev 1627) @@ -0,0 +1,103 @@ +package jp.sf.pal.bookmark.db.allcommon.bhv.core.command; + +import java.util.List; + +import jp.sf.pal.bookmark.db.allcommon.Entity; +import jp.sf.pal.bookmark.db.allcommon.bhv.core.SqlExecution; +import jp.sf.pal.bookmark.db.allcommon.bhv.core.SqlExecutionCreator; +import jp.sf.pal.bookmark.db.allcommon.cbean.ConditionBean; +import jp.sf.pal.bookmark.db.allcommon.cbean.ConditionBeanContext; +import jp.sf.pal.bookmark.db.allcommon.cbean.FetchNarrowingBeanContext; + +import org.seasar.dao.BeanMetaData; +import org.seasar.extension.jdbc.ResultSetHandler; + +/** + * @author DBFlute(AutoGenerator) + * @param The type of entity. + */ +public class SelectListCBCommand extends + AbstractSelectCBCommand> { + + //========================================================================== + // ========= + // Attribute + // ========= + /** The type of entity. (Required) */ + protected Class _entityType; + + //========================================================================== + // ========= + // Basic Information + // ================= + public String getCommandName() { + return "selectList"; + } + + public Class getCommandReturnType() { + return List.class; + } + + //========================================================================== + // ========= + // Detail Information + // ================== + public boolean isSelectCount() { + return false; + } + + //========================================================================== + // ========= + // Process Callback + // ================ + public void beforeGettingSqlExecution() { + assertStatus("beforeGettingSqlExecution"); + final ConditionBean cb = _conditionBean; + FetchNarrowingBeanContext.setFetchNarrowingBeanOnThread(cb); + ConditionBeanContext.setConditionBeanOnThread(cb); + } + + public void afterExecuting() { + assertStatus("afterExecuting"); + } + + //========================================================================== + // ========= + // SqlExecution Handling + // ===================== + public SqlExecutionCreator createSqlExecutionCreator() { + assertStatus("createSqlExecutionCreator"); + return new SqlExecutionCreator() { + public SqlExecution createSqlExecution() { + BeanMetaData bmd = createBeanMetaData(); + ResultSetHandler handler = createBeanListMetaDataResultSetHandler(bmd); + return createSelectCBExecution(_conditionBeanType, handler); + } + }; + } + + protected BeanMetaData createBeanMetaData() { + return _beanMetaDataFactory.createBeanMetaData(_entityType); + } + + //========================================================================== + // ========= + // Assert Helper + // ============= + @Override + protected void assertStatus(String methodName) { + super.assertStatus(methodName); + if (_entityType == null) { + throw new IllegalStateException(buildAssertMessage("_entityType", + methodName)); + } + } + + //========================================================================== + // ========= + // Accessor + // ======== + public void setEntityType(Class entityType) { + _entityType = entityType; + } +} Property changes on: bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/bhv/core/command/SelectListCBCommand.java ___________________________________________________________________ Name: svn:eol-style + native Added: bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/bhv/core/command/SelectNextValCommand.java =================================================================== --- bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/bhv/core/command/SelectNextValCommand.java (rev 0) +++ bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/bhv/core/command/SelectNextValCommand.java 2008-12-27 22:11:51 UTC (rev 1627) @@ -0,0 +1,162 @@ +package jp.sf.pal.bookmark.db.allcommon.bhv.core.command; + +import jp.sf.pal.bookmark.db.allcommon.bhv.core.SqlExecution; +import jp.sf.pal.bookmark.db.allcommon.bhv.core.SqlExecutionCreator; +import jp.sf.pal.bookmark.db.allcommon.bhv.core.execution.BasicSelectExecution; +import jp.sf.pal.bookmark.db.allcommon.cbean.ConditionBean; +import jp.sf.pal.bookmark.db.allcommon.cbean.outsidesql.OutsideSqlOption; +import jp.sf.pal.bookmark.db.allcommon.dbmeta.DBMeta; +import jp.sf.pal.bookmark.db.allcommon.dbmeta.DBMetaInstanceHandler; + +import org.seasar.extension.jdbc.ResultSetHandler; + +/** + * @author DBFlute(AutoGenerator) + * @param The type of result. + */ +public class SelectNextValCommand extends + AbstractBehaviorCommand { + + //========================================================================== + // ========= + // Attribute + // ========= + /** The type of result. (NotNull) */ + protected Class _resultType; + + //========================================================================== + // ========= + // Basic Information + // ================= + public String getCommandName() { + return "selectNextVal"; + } + + public Class getCommandReturnType() { + return _resultType; + } + + //========================================================================== + // ========= + // Detail Information + // ================== + public boolean isConditionBean() { + return false; + } + + public boolean isOutsideSql() { + return false; + } + + public boolean isProcedure() { + return false; + } + + public boolean isSelect() { + return true; + } + + public boolean isSelectCount() { + return false; + } + + //========================================================================== + // ========= + // Process Callback + // ================ + public void beforeGettingSqlExecution() { + } + + public void afterExecuting() { + } + + //========================================================================== + // ========= + // SqlExecution Handling + // ===================== + public String buildSqlExecutionKey() { + assertStatus("buildSqlExecutionKey"); + return _tableDbName + ":" + getCommandName() + "()"; + } + + public SqlExecutionCreator createSqlExecutionCreator() { + assertStatus("createSqlExecutionCreator"); + return new SqlExecutionCreator() { + public SqlExecution createSqlExecution() { + ResultSetHandler handler = createObjectResultSetHandler(_resultType); + return createSelectNextValExecution(handler); + } + }; + } + + protected SqlExecution createSelectNextValExecution(ResultSetHandler handler) { + final DBMeta dbmeta = findDBMeta(); + if (!dbmeta.hasSequence()) { + String msg = "If the method 'selectNextVal()' exists, DBMeta.hasSequence() should return true:"; + msg = msg + " dbmeta.hasSequence()=" + dbmeta.hasSequence(); + throw new IllegalStateException(msg); + } + final String nextValSql = dbmeta.getSequenceNextValSql(); + if (nextValSql == null) { + String msg = "If the method 'selectNextVal()' exists, DBMeta.getSequenceNextValSql() should not return null:"; + msg = msg + " dbmeta.getSequenceNextValSql()=" + + dbmeta.getSequenceNextValSql(); + throw new IllegalStateException(msg); + } + return createBasicSelectExecution(handler, new String[] {}, + new Class[] {}, nextValSql); + } + + protected BasicSelectExecution createBasicSelectExecution( + ResultSetHandler handler, String[] argNames, Class[] argTypes, + String sql) { + final BasicSelectExecution cmd = new BasicSelectExecution(_dataSource, + _statementFactory, handler); + cmd.setArgNames(argNames); + cmd.setArgTypes(argTypes); + cmd.setSql(sql); + return cmd; + } + + protected DBMeta findDBMeta() { + return DBMetaInstanceHandler.findDBMeta(_tableDbName); + } + + public Object[] getSqlExecutionArgument() { + assertStatus("getSqlExecutionArgument"); + return new Object[] {}; + } + + //========================================================================== + // ========= + // Argument Information + // ==================== + public ConditionBean getConditionBean() { + return null; + } + + public String getOutsideSqlPath() { + return null; + } + + public OutsideSqlOption getOutsideSqlOption() { + return null; + } + + //========================================================================== + // ========= + // Assert Helper + // ============= + protected void assertStatus(String methodName) { + assertBasicProperty(methodName); + assertComponentProperty(methodName); + } + + //========================================================================== + // ========= + // Accessor + // ======== + public void setResultType(Class resultType) { + _resultType = resultType; + } +} Property changes on: bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/bhv/core/command/SelectNextValCommand.java ___________________________________________________________________ Name: svn:eol-style + native Added: bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/bhv/core/command/SelectScalarCBCommand.java =================================================================== --- bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/bhv/core/command/SelectScalarCBCommand.java (rev 0) +++ bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/bhv/core/command/SelectScalarCBCommand.java 2008-12-27 22:11:51 UTC (rev 1627) @@ -0,0 +1,112 @@ +package jp.sf.pal.bookmark.db.allcommon.bhv.core.command; + +import jp.sf.pal.bookmark.db.allcommon.bhv.core.SqlExecution; +import jp.sf.pal.bookmark.db.allcommon.bhv.core.SqlExecutionCreator; +import jp.sf.pal.bookmark.db.allcommon.cbean.ConditionBean; +import jp.sf.pal.bookmark.db.allcommon.cbean.ConditionBeanContext; +import jp.sf.pal.bookmark.db.allcommon.cbean.sqlclause.SqlClause; + +import org.seasar.extension.jdbc.ResultSetHandler; + +/** + * @author DBFlute(AutoGenerator) + * @param The type of result. + */ +public class SelectScalarCBCommand extends + AbstractSelectCBCommand { + + //========================================================================== + // ========= + // Attribute + // ========= + /** The type of result. (NotNull) */ + protected Class _resultType; + + /** The type of select clause. (NotNull) */ + protected SqlClause.SelectClauseType _selectClauseType; + + //========================================================================== + // ========= + // Basic Information + // ================= + public String getCommandName() { + assertStatus("getCommandName"); + final String resultTypeName = _resultType.getSimpleName(); + final String scalarMethodName = _selectClauseType.toString() + .toLowerCase(); + return "scalarSelect(" + resultTypeName + ")." + scalarMethodName; + } + + public Class getCommandReturnType() { + assertStatus("getCommandReturnType"); + return _resultType; + } + + //========================================================================== + // ========= + // Detail Information + // ================== + public boolean isSelectCount() { + return false; + } + + //========================================================================== + // ========= + // Process Callback + // ================ + public void beforeGettingSqlExecution() { + assertStatus("beforeGettingSqlExecution"); + final ConditionBean cb = _conditionBean; + ConditionBeanContext.setConditionBeanOnThread(cb); + cb.getSqlClause().classifySelectClauseType(_selectClauseType); //*Point! + } + + public void afterExecuting() { + assertStatus("afterExecuting"); + final ConditionBean cb = _conditionBean; + cb.getSqlClause().rollbackSelectClauseType(); + } + + //========================================================================== + // ========= + // SqlExecution Handling + // ===================== + public SqlExecutionCreator createSqlExecutionCreator() { + assertStatus("createSqlExecutionCreator"); + return new SqlExecutionCreator() { + public SqlExecution createSqlExecution() { + ResultSetHandler handler = createObjectResultSetHandler(getCommandReturnType()); + return createSelectCBExecution(_conditionBeanType, handler); + } + }; + } + + //========================================================================== + // ========= + // Assert Helper + // ============= + @Override + protected void assertStatus(String methodName) { + super.assertStatus(methodName); + if (_resultType == null) { + throw new IllegalStateException(buildAssertMessage("_resultType", + methodName)); + } + if (_selectClauseType == null) { + throw new IllegalStateException(buildAssertMessage( + "_selectClauseType", methodName)); + } + } + + //========================================================================== + // ========= + // Accessor + // ======== + public void setResultType(Class resultType) { + _resultType = resultType; + } + + public void setSelectClauseType(SqlClause.SelectClauseType selectClauseType) { + _selectClauseType = selectClauseType; + } +} Property changes on: bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/bhv/core/command/SelectScalarCBCommand.java ___________________________________________________________________ Name: svn:eol-style + native Added: bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/bhv/core/command/UpdateEntityCommand.java =================================================================== --- bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/bhv/core/command/UpdateEntityCommand.java (rev 0) +++ bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/bhv/core/command/UpdateEntityCommand.java 2008-12-27 22:11:51 UTC (rev 1627) @@ -0,0 +1,55 @@ +package jp.sf.pal.bookmark.db.allcommon.bhv.core.command; + +import jp.sf.pal.bookmark.db.allcommon.bhv.core.SqlExecution; +import jp.sf.pal.bookmark.db.allcommon.bhv.core.SqlExecutionCreator; +import jp.sf.pal.bookmark.db.allcommon.s2dao.internal.sqlcommand.InternalUpdateModifiedOnlyCommand; + +import org.seasar.dao.BeanMetaData; + +/** + * @author DBFlute(AutoGenerator) + */ +public class UpdateEntityCommand extends AbstractEntityCommand { + + //========================================================================== + // ========= + // Basic Information + // ================= + public String getCommandName() { + return "update"; + } + + //========================================================================== + // ========= + // SqlExecution Handling + // ===================== + public SqlExecutionCreator createSqlExecutionCreator() { + assertStatus("createSqlExecutionCreator"); + return new SqlExecutionCreator() { + public SqlExecution createSqlExecution() { + final BeanMetaData bmd = createBeanMetaData(); + return createUpdateEntitySqlExecution(bmd); + } + }; + } + + protected SqlExecution createUpdateEntitySqlExecution(BeanMetaData bmd) { + final String[] propertyNames = getPersistentPropertyNames(bmd); + return createUpdateModifiedOnlyCommand(bmd, propertyNames); + } + + protected InternalUpdateModifiedOnlyCommand createUpdateModifiedOnlyCommand( + BeanMetaData bmd, String[] propertyNames) { + final InternalUpdateModifiedOnlyCommand cmd = new InternalUpdateModifiedOnlyCommand( + _dataSource, _statementFactory); + cmd.setBeanMetaData(bmd);// Extension Point! + cmd.setPropertyNames(propertyNames); + cmd.setOptimisticLockHandling(isOptimisticLockHandling()); + cmd.setVersionNoAutoIncrementOnMemory(isOptimisticLockHandling()); + return cmd; + } + + protected boolean isOptimisticLockHandling() { + return true; + } +} Property changes on: bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/bhv/core/command/UpdateEntityCommand.java ___________________________________________________________________ Name: svn:eol-style + native Added: bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/bhv/core/command/UpdateNonstrictEntityCommand.java =================================================================== --- bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/bhv/core/command/UpdateNonstrictEntityCommand.java (rev 0) +++ bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/bhv/core/command/UpdateNonstrictEntityCommand.java 2008-12-27 22:11:51 UTC (rev 1627) @@ -0,0 +1,25 @@ +package jp.sf.pal.bookmark.db.allcommon.bhv.core.command; + +/** + * @author DBFlute(AutoGenerator) + */ +public class UpdateNonstrictEntityCommand extends UpdateEntityCommand { + + //========================================================================== + // ========= + // Basic Information + // ================= + @Override + public String getCommandName() { + return "updateNonstrict"; + } + + //========================================================================== + // ========= + // SqlExecution Handling + // ===================== + @Override + protected boolean isOptimisticLockHandling() { + return false; + } +} Property changes on: bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/bhv/core/command/UpdateNonstrictEntityCommand.java ___________________________________________________________________ Name: svn:eol-style + native Added: bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/bhv/core/execution/BasicSelectExecution.java =================================================================== --- bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/bhv/core/execution/BasicSelectExecution.java (rev 0) +++ bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/bhv/core/execution/BasicSelectExecution.java 2008-12-27 22:11:51 UTC (rev 1627) @@ -0,0 +1,77 @@ +package jp.sf.pal.bookmark.db.allcommon.bhv.core.execution; + +import javax.sql.DataSource; + +import jp.sf.pal.bookmark.db.allcommon.s2dao.internal.sqlcommand.InternalAbstractDynamicCommand; +import jp.sf.pal.bookmark.db.allcommon.s2dao.internal.sqlhandler.InternalBasicSelectHandler; + +import org.seasar.dao.CommandContext; +import org.seasar.extension.jdbc.ResultSetHandler; +import org.seasar.extension.jdbc.StatementFactory; + +/** + * @author DBFlute(AutoGenerator) + */ +public class BasicSelectExecution extends InternalAbstractDynamicCommand { + + //========================================================================== + // ========= + // Attribute + // ========= + /** The handler of resultSet. */ + protected ResultSetHandler resultSetHandler; + + //========================================================================== + // ========= + // Constructor + // =========== + /** + * Constructor. + * + * @param dataSource Data source. + * @param statementFactory The factory of statement. + * @param resultSetHandler The handler of resultSet. + */ + public BasicSelectExecution(DataSource dataSource, + StatementFactory statementFactory, ResultSetHandler resultSetHandler) { + super(dataSource, statementFactory); + this.resultSetHandler = resultSetHandler; + } + + //========================================================================== + // ========= + // Execute + // ======= + /** + * @param args The array of argument. (Nullable) + * @return The object of execution result. (Nullable) + */ + public Object execute(Object[] args) { + final CommandContext ctx = apply(args); + final InternalBasicSelectHandler selectHandler = createBasicSelectHandler( + ctx.getSql(), this.resultSetHandler); + final Object[] bindVariableArray = ctx.getBindVariables(); + selectHandler.setLoggingMessageSqlArgs(bindVariableArray); + return selectHandler.execute(bindVariableArray, ctx + .getBindVariableTypes()); + } + + //========================================================================== + // ========= + // Select Handler + // ============== + protected InternalBasicSelectHandler createBasicSelectHandler( + String realSql, ResultSetHandler rsh) { + return new InternalBasicSelectHandler(getDataSource(), realSql, rsh, + getStatementFactory()); + } + + //========================================================================== + // ========= + // Parser Option + // ============= + @Override + protected boolean isBlockNullParameter() { + return true; // Because the SQL is select. + } +} Property changes on: bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/bhv/core/execution/BasicSelectExecution.java ___________________________________________________________________ Name: svn:eol-style + native Added: bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/bhv/core/execution/OutsideSqlSelectExecution.java =================================================================== --- bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/bhv/core/execution/OutsideSqlSelectExecution.java (rev 0) +++ bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/bhv/core/execution/OutsideSqlSelectExecution.java 2008-12-27 22:11:51 UTC (rev 1627) @@ -0,0 +1,225 @@ +package jp.sf.pal.bookmark.db.allcommon.bhv.core.execution; + +import java.util.ArrayList; +import java.util.List; + +import javax.sql.DataSource; + +import jp.sf.pal.bookmark.db.allcommon.cbean.outsidesql.OutsideSqlContext; +import jp.sf.pal.bookmark.db.allcommon.s2dao.internal.sqlcommand.InternalAbstractDynamicCommand; +import jp.sf.pal.bookmark.db.allcommon.s2dao.internal.sqlhandler.InternalBasicSelectHandler; +import jp.sf.pal.bookmark.db.allcommon.util.SimpleStringUtil; +import jp.sf.pal.bookmark.db.allcommon.util.SimpleSystemUtil; + +import org.seasar.dao.CommandContext; +import org.seasar.extension.jdbc.ResultSetHandler; +import org.seasar.extension.jdbc.StatementFactory; +import org.seasar.framework.beans.BeanDesc; +import org.seasar.framework.beans.PropertyDesc; +import org.seasar.framework.beans.factory.BeanDescFactory; + +/** + * @author DBFlute(AutoGenerator) + */ +public class OutsideSqlSelectExecution extends InternalAbstractDynamicCommand { + + //========================================================================== + // ========= + // Attribute + // ========= + /** The handler of resultSet. */ + protected ResultSetHandler resultSetHandler; + + //========================================================================== + // ========= + // Constructor + // =========== + /** + * Constructor. + * + * @param dataSource Data source. + * @param statementFactory The factory of statement. + * @param resultSetHandler The handler of resultSet. + */ + public OutsideSqlSelectExecution(DataSource dataSource, + StatementFactory statementFactory, ResultSetHandler resultSetHandler) { + super(dataSource, statementFactory); + this.resultSetHandler = resultSetHandler; + } + + //========================================================================== + // ========= + // Execute + // ======= + /** + * @param args The array of argument. (NotNull, The first element should be + * the instance of Pmb) + * @return The object of execution result. (Nullable) + */ + public Object execute(Object[] args) { + final OutsideSqlContext outsideSqlContext = OutsideSqlContext + .getOutsideSqlContextOnThread(); + if (outsideSqlContext.isDynamicBinding()) { + return executeOutsideSqlAsDynamic(args, outsideSqlContext); + } else { + return executeOutsideSqlAsStatic(args, outsideSqlContext); + } + } + + // ----------------------------------------------------- + // OutsideSql Execute + // ------------------ + /** + * Execute outside-SQL as Dynamic. + * + * @param args The array of argument. (NotNull, The first element should be + * the instance of Pmb) + * @param outsideSqlContext The context of outside-SQL. (NotNull) + * @return Result. (Nullable) + */ + protected Object executeOutsideSqlAsDynamic(Object[] args, + OutsideSqlContext outsideSqlContext) { + final Object firstArg = args[0]; + String staticSql = getSql(); + if (firstArg != null) { + final BeanDesc beanDesc = BeanDescFactory.getBeanDesc(firstArg + .getClass()); + + // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + // - - - - - - - + // Resolve embedded comment for parsing bind variable comment in + // embedded comment. + // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + // - - - - - - - + for (int i = 0; i < beanDesc.getPropertyDescSize(); i++) { + final PropertyDesc propertyDesc = beanDesc.getPropertyDesc(i); + final Class propertyType = propertyDesc.getPropertyType(); + if (!propertyType.equals(String.class)) { + continue; + } + final String outsideSqlPiece = (String) propertyDesc + .getValue(firstArg); + if (outsideSqlPiece == null) { + continue; + } + final String embeddedComment = "/*$pmb." + + propertyDesc.getPropertyName() + "*/"; + staticSql = replaceString(staticSql, embeddedComment, + outsideSqlPiece); + } + } + + final OutsideSqlSelectExecution outsideSqlCommand = createDynamicSqlFactory(); + outsideSqlCommand.setArgNames(getArgNames()); + outsideSqlCommand.setArgTypes(getArgTypes()); + outsideSqlCommand.setSql(staticSql); + + final CommandContext ctx = outsideSqlCommand.apply(args); + final List bindVariableList = new ArrayList(); + final List> bindVariableTypeList = new ArrayList>(); + addBindVariableInfo(ctx, bindVariableList, bindVariableTypeList); + final InternalBasicSelectHandler selectHandler = createBasicSelectHandler( + ctx.getSql(), this.resultSetHandler); + final Object[] bindVariableArray = bindVariableList.toArray(); + selectHandler.setLoggingMessageSqlArgs(bindVariableArray); + return selectHandler.execute(bindVariableArray, + toClassArray(bindVariableTypeList)); + } + + /** + * Execute outside-SQL as static. + * + * @param args The array of argument. (NotNull, The first element should be + * the instance of Pmb) + * @param outsideSqlContext The context of outside-SQL. (NotNull) + * @return Result. (Nullable) + */ + protected Object executeOutsideSqlAsStatic(Object[] args, + OutsideSqlContext outsideSqlContext) { + final CommandContext ctx = apply(args); + final InternalBasicSelectHandler selectHandler = createBasicSelectHandler( + ctx.getSql(), this.resultSetHandler); + final Object[] bindVariableArray = ctx.getBindVariables(); + selectHandler.setLoggingMessageSqlArgs(bindVariableArray); + return selectHandler.execute(bindVariableArray, ctx + .getBindVariableTypes()); + } + + //========================================================================== + // ========= + // Dynamic SQL Factory + // =================== + protected OutsideSqlSelectExecution createDynamicSqlFactory() { + return new OutsideSqlSelectExecution(getDataSource(), + getStatementFactory(), resultSetHandler); + } + + //========================================================================== + // ========= + // Select Handler + // ============== + protected InternalBasicSelectHandler createBasicSelectHandler( + String realSql, ResultSetHandler rsh) { + return new InternalBasicSelectHandler(getDataSource(), realSql, rsh, + getStatementFactory()); + } + + //========================================================================== + // ========= + // Parser Option + // ============= + @Override + protected boolean isBlockNullParameter() { + return true; // Because the SQL is select. + } + + //========================================================================== + // ========= + // Setup Helper + // ============ + protected Class[] toClassArray(List> 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 bindVariableList, List> bindVariableTypeList) { + final Object[] bindVariables = ctx.getBindVariables(); + addBindVariableList(bindVariableList, bindVariables); + final Class[] bindVariableTypes = ctx.getBindVariableTypes(); + addBindVariableTypeList(bindVariableTypeList, bindVariableTypes); + } + + protected void addBindVariableList(List bindVariableList, + Object[] bindVariables) { + for (int i = 0; i < bindVariables.length; i++) { + bindVariableList.add(bindVariables[i]); + } + } + + protected void addBindVariableTypeList(List> bindVariableTypeList, + Class[] bindVariableTypes) { + for (int i = 0; i < bindVariableTypes.length; i++) { + bindVariableTypeList.add(bindVariableTypes[i]); + } + } + + //========================================================================== + // ========= + // General Helper + // ============== + protected final String replaceString(String text, String fromText, + String toText) { + return SimpleStringUtil.replace(text, fromText, toText); + } + + protected String getLineSeparator() { + return SimpleSystemUtil.getLineSeparator(); + } +} Property changes on: bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/bhv/core/execution/OutsideSqlSelectExecution.java ___________________________________________________________________ Name: svn:eol-style + native Added: bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/bhv/core/execution/SelectCBExecution.java =================================================================== --- bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/bhv/core/execution/SelectCBExecution.java (rev 0) +++ bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/bhv/core/execution/SelectCBExecution.java 2008-12-27 22:11:51 UTC (rev 1627) @@ -0,0 +1,168 @@ +package jp.sf.pal.bookmark.db.allcommon.bhv.core.execution; + +import java.util.ArrayList; +import java.util.List; + +import javax.sql.DataSource; + +import jp.sf.pal.bookmark.db.allcommon.cbean.ConditionBean; +import jp.sf.pal.bookmark.db.allcommon.cbean.ConditionBeanContext; +import jp.sf.pal.bookmark.db.allcommon.s2dao.internal.sqlcommand.InternalAbstractDynamicCommand; +import jp.sf.pal.bookmark.db.allcommon.s2dao.internal.sqlhandler.InternalBasicSelectHandler; +import jp.sf.pal.bookmark.db.allcommon.util.SimpleStringUtil; +import jp.sf.pal.bookmark.db.allcommon.util.SimpleSystemUtil; + +import org.seasar.dao.CommandContext; +import org.seasar.extension.jdbc.ResultSetHandler; +import org.seasar.extension.jdbc.StatementFactory; + +/** + * @author DBFlute(AutoGenerator) + */ +public class SelectCBExecution extends InternalAbstractDynamicCommand { + + //========================================================================== + // ========= + // Attribute + // ========= + /** The handler of resultSet. */ + protected ResultSetHandler resultSetHandler; + + //========================================================================== + // ========= + // Constructor + // =========== + /** + * Constructor. + * + * @param dataSource Data source. + * @param statementFactory The factory of statement. + * @param resultSetHandler The handler of resultSet. + */ + public SelectCBExecution(DataSource dataSource, + StatementFactory statementFactory, ResultSetHandler resultSetHandler) { + super(dataSource, statementFactory); + this.resultSetHandler = resultSetHandler; + } + + //========================================================================== + // ========= + // Execute + // ======= + /** + * @param args The array of argument. (NotNull, The first element should be + * the instance of CB) + * @return The object of execution result. (Nullable) + */ + public Object execute(Object[] args) { + final List bindVariableList = new ArrayList(); + final List> bindVariableTypeList = new ArrayList>(); + + final String finalClause = setupRealClause(args, bindVariableList, + bindVariableTypeList); + final InternalBasicSelectHandler selectHandler = createBasicSelectHandler( + finalClause, this.resultSetHandler); + final Object[] bindVariableArray = bindVariableList.toArray(); + selectHandler.setLoggingMessageSqlArgs(bindVariableArray); + return selectHandler.execute(bindVariableArray, + toClassArray(bindVariableTypeList)); + } + + // ----------------------------------------------------- + // Setup Clause + // ------------ + protected String setupRealClause(Object[] args, + List bindVariableList, List> bindVariableTypeList) { + final ConditionBean cb = ConditionBeanContext + .getConditionBeanOnThread(); + final String realClause; + { + final SelectCBExecution dynamicSqlFactory = createDynamicSqlFactory(); + dynamicSqlFactory.setArgNames(getArgNames()); + dynamicSqlFactory.setArgTypes(getArgTypes()); + dynamicSqlFactory.setSql(cb.getSqlClause().getClause()); + final CommandContext ctx = dynamicSqlFactory.apply(args); + realClause = ctx.getSql(); + addBindVariableInfo(ctx, bindVariableList, bindVariableTypeList); + } + return realClause; + } + + //========================================================================== + // ========= + // Dynamic SQL Factory + // =================== + protected SelectCBExecution createDynamicSqlFactory() { + return new SelectCBExecution(getDataSource(), getStatementFactory(), + resultSetHandler); + } + + //========================================================================== + // ========= + // Select Handler + // ============== + protected InternalBasicSelectHandler createBasicSelectHandler( + String realSql, ResultSetHandler rsh) { + return new InternalBasicSelectHandler(getDataSource(), realSql, rsh, + getStatementFactory()); + } + + //========================================================================== + // ========= + // Parser Option + // ============= + @Override + protected boolean isBlockNullParameter() { + return true; // Because the SQL is select. + } + + //========================================================================== + // ========= + // Setup Helper + // ============ + protected Class[] toClassArray(List> 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 bindVariableList, List> bindVariableTypeList) { + final Object[] bindVariables = ctx.getBindVariables(); + addBindVariableList(bindVariableList, bindVariables); + final Class[] bindVariableTypes = ctx.getBindVariableTypes(); + addBindVariableTypeList(bindVariableTypeList, bindVariableTypes); + } + + protected void addBindVariableList(List bindVariableList, + Object[] bindVariables) { + for (int i = 0; i < bindVariables.length; i++) { + bindVariableList.add(bindVariables[i]); + } + } + + protected void addBindVariableTypeList(List> bindVariableTypeList, + Class[] bindVariableTypes) { + for (int i = 0; i < bindVariableTypes.length; i++) { + bindVariableTypeList.add(bindVariableTypes[i]); + } + } + + //========================================================================== + // ========= + // General Helper + // ============== + protected final String replaceString(String text, String fromText, + String toText) { + return SimpleStringUtil.replace(text, fromText, toText); + } + + protected String getLineSeparator() { + return SimpleSystemUtil.getLineSeparator(); + } +} Property changes on: bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/bhv/core/execution/SelectCBExecution.java ___________________________________________________________________ Name: svn:eol-style + native Modified: bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/cbean/AbstractConditionBean.java =================================================================== --- bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/cbean/AbstractConditionBean.java 2008-12-27 22:10:35 UTC (rev 1626) +++ bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/cbean/AbstractConditionBean.java 2008-12-27 22:11:51 UTC (rev 1627) @@ -24,6 +24,28 @@ public abstract class AbstractConditionBean implements ConditionBean { //========================================================================== + // =========== + // Definition + // ========== + /** Map-string map-mark. */ + private static final String MAP_STRING_MAP_MARK = "map:"; + + /** Map-string list-mark. */ + private static final String MAP_STRING_LIST_MARK = "list:"; + + /** Map-string start-brace. */ + private static final String MAP_STRING_START_BRACE = "@{"; + + /** Map-string end-brace. */ + private static final String MAP_STRING_END_BRACE = "@}"; + + /** Map-string delimiter. */ + private static final String MAP_STRING_DELIMITER = "@;"; + + /** Map-string equal. */ + private static final String MAP_STRING_EQUAL = "@="; + + //========================================================================== // ========= // Attribute // ========= @@ -41,8 +63,12 @@ // [DBFlute-0.7.4] @jflute -- At the future, I'll implement some check // logics by these purpose types. - protected boolean _forDeriveReferrer; + protected boolean _forDerivedReferrer; + protected boolean _forScalarSelect; + + protected boolean _forScalarSubQuery; + protected boolean _forUnion; protected boolean _forExistsSubQuery; @@ -73,27 +99,6 @@ //========================================================================== // ========= - // ConditionQuery - // ============== - /** - * Get condition query as interface. At the future, change public to - * protected. - * - * @return Instance of query as interface. (NotNull) - */ - abstract public ConditionQuery getConditionQueryAsInterface(); - - /** - * The implementation. - * - * @return The conditionQuery of the local table as interface. (NotNull) - */ - public ConditionQuery localCQ() { - return getConditionQueryAsInterface(); - } - - //========================================================================== - // ========= // Accept PrimaryKey // ================= /** @@ -498,42 +503,6 @@ //========================================================================== // ========= - // Limit Select - // ============ - /** Is limit-select PK only? */ - protected boolean _isLimitSelectPKOnly; - - /** - * Is limit-select PK only? - * - * @return Determination. - */ - public boolean isLimitSelect_PKOnly() { - return _isLimitSelectPKOnly; - } - - /** - * Limit select PK only. - * - * @return this. (NotNull) - */ - public ConditionBean limitSelect_PKOnly() { - _isLimitSelectPKOnly = true; - return this; - } - - /** - * Limit select off. - * - * @return this. (NotNull) - */ - public ConditionBean limitSelect_Off() { - _isLimitSelectPKOnly = false; - return this; - } - - //========================================================================== - // ========= // Lock Setting // ============ /** @@ -559,11 +528,8 @@ public ConditionBean xsetupSelectCountIgnoreFetchScope() { _isSelectCountIgnoreFetchScope = true; - // If the query uses union query, it needs included-select-column. - if (!hasUnionQueryOrUnionAllQuery()) { - getSqlClause().ignoreIncludedSelectColumn(); - } - + getSqlClause().classifySelectClauseType( + SqlClause.SelectClauseType.COUNT); getSqlClause().ignoreOrderBy(); getSqlClause().ignoreFetchScope(); return this; @@ -578,11 +544,7 @@ public ConditionBean xafterCareSelectCountIgnoreFetchScope() { _isSelectCountIgnoreFetchScope = false; - // If the query uses union query, it needs included-select-column. - if (!hasUnionQueryOrUnionAllQuery()) { - getSqlClause().makeIncludedSelectColumnEffective(); - } - + getSqlClause().rollbackSelectClauseType(); getSqlClause().makeOrderByEffective(); getSqlClause().makeFetchScopeEffective(); return this; @@ -613,20 +575,29 @@ protected CQ _query; - protected boolean _forDeriveReferrer; + protected boolean _forDerivedReferrer; - protected boolean alreadySpecifyRequiredColumn; + protected boolean _forScalarSelect; + protected boolean _forScalarSubQuery; + + protected boolean _alreadySpecifyRequiredColumn; + /** * @param baseCB The condition-bean of base level. (NotNull) - * @param qyCall The callback for condition-query. (NotNull) - * @param forDeriveReferrer Is this for derive referrer? + * @param qyCall The call-back for condition-query. (NotNull) + * @param forDerivedReferrer Is this for derive referrer? + * @param forScalarSelect Is this for scalar select? + * @param forScalarSubQuery Is this for scalar sub-query? */ protected AbstractSpecification(ConditionBean baseCB, - SpQyCall qyCall, boolean forDeriveReferrer) { + SpQyCall qyCall, boolean forDerivedReferrer, + boolean forScalarSelect, boolean forScalarSubQuery) { _baseCB = baseCB; _qyCall = qyCall; - _forDeriveReferrer = forDeriveReferrer; + _forDerivedReferrer = forDerivedReferrer; + _forScalarSelect = forScalarSelect; + _forScalarSubQuery = forScalarSubQuery; } protected void doColumn(String columnName) { @@ -634,8 +605,8 @@ if (_query == null) { _query = _qyCall.qy(); } - if (!_forDeriveReferrer && !alreadySpecifyRequiredColumn) { - alreadySpecifyRequiredColumn = true; + if (isRequiredColumnSpecificationEnabled()) { + _alreadySpecifyRequiredColumn = true; doSpecifyRequiredColumn(); } String relationPath = _query.getRelationPath() != null ? _query @@ -652,6 +623,11 @@ columnName); } + protected boolean isRequiredColumnSpecificationEnabled() { + return !_forDerivedReferrer && !_forScalarSelect + && !_forScalarSubQuery && !_alreadySpecifyRequiredColumn; + } + protected void assertColumn(String columnName) { if (_query == null && !_qyCall.has()) { throwSpecifyColumnNotSetupSelectColumnException(columnName); @@ -659,9 +635,15 @@ } protected void assertForeign(String foreignPropertyName) { - if (_forDeriveReferrer) { - throwDeriveReferrerInvalidForeignSpecificationException(foreignPropertyName); + if (_forDerivedReferrer) { + throwDerivedReferrerInvalidForeignSpecificationException(foreignPropertyName); } + if (_forScalarSelect) { + throwScalarSelectInvalidForeignSpecificationException(foreignPropertyName); + } + if (_forScalarSubQuery) { + throwScalarSubQueryInvalidForeignSpecificationException(foreignPropertyName); + } } protected abstract void doSpecifyRequiredColumn(); @@ -714,19 +696,19 @@ throw new SpecifyColumnNotSetupSelectColumnException(msg); } - protected void throwDeriveReferrerInvalidForeignSpecificationException( + protected void throwDerivedReferrerInvalidForeignSpecificationException( String foreignPropertyName) { String msg = "Look! Read the message below." + getLineSeparator(); msg = msg + "/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *" + getLineSeparator(); msg = msg - + "You specified a foreign table column in spite of derive-sub-query!" + + "You specified a foreign table column in spite of derived-referrer!" + getLineSeparator(); msg = msg + getLineSeparator(); msg = msg + "[Advice]" + getLineSeparator(); msg = msg - + "You should specified a local table column at condition-bean for derive-sub-query." + + "You should specified a local table column at condition-bean for derived-referrer." + getLineSeparator(); msg = msg + " For example:" + getLineSeparator(); msg = msg + " " + getLineSeparator(); @@ -736,7 +718,7 @@ msg = msg + " MemberCB cb = new MemberCB();" + getLineSeparator(); msg = msg - + " cb.specify().derivePurchaseList().max(new SubQuery() {" + + " cb.specify().derivedPurchaseList().max(new SubQuery() {" + getLineSeparator(); msg = msg + " public void query(PurchaseCB subCB) {" + getLineSeparator(); @@ -754,7 +736,7 @@ msg = msg + " MemberCB cb = new MemberCB();" + getLineSeparator(); msg = msg - + " cb.specify().derivePurchaseList().max(new SubQuery() {" + + " cb.specify().derivedPurchaseList().max(new SubQuery() {" + getLineSeparator(); msg = msg + " public void query(PurchaseCB subCB) {" + getLineSeparator(); @@ -769,9 +751,117 @@ msg = msg + "[Specified Foreign Property]" + getLineSeparator() + foreignPropertyName + getLineSeparator(); msg = msg + "* * * * * * * * * */"; - throw new DeriveReferrerInvalidForeignSpecificationException(msg); + throw new DerivedReferrerInvalidForeignSpecificationException(msg); } + protected void throwScalarSelectInvalidForeignSpecificationException( + String foreignPropertyName) { + String msg = "Look! Read the message below." + getLineSeparator(); + msg = msg + + "/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *" + + getLineSeparator(); + msg = msg + + "You specified a foreign table column in spite of scalar select!" + + getLineSeparator(); + msg = msg + getLineSeparator(); + msg = msg + "[Advice]" + getLineSeparator(); + msg = msg + + "You should specified a local table column at condition-bean for scalar select." + + getLineSeparator(); + msg = msg + " For example:" + getLineSeparator(); + msg = msg + " " + getLineSeparator(); + msg = msg + " [Wrong]" + getLineSeparator(); + msg = msg + " /- - - - - - - - - - - - - - - - - - - - " + + getLineSeparator(); + msg = msg + + " memberBhv.scalarSelect(Integer.class).max(new ScalarSelect() {" + + getLineSeparator(); + msg = msg + " public void query(MemberCB cb) {" + + getLineSeparator(); + msg = msg + + " cb.specify().specifyMemberStatus().columnDisplayOrder(); // *No!" + + getLineSeparator(); + msg = msg + " }" + getLineSeparator(); + msg = msg + " });" + getLineSeparator(); + msg = msg + " - - - - - - - - - -/" + getLineSeparator(); + msg = msg + " " + getLineSeparator(); + msg = msg + " [Good!]" + getLineSeparator(); + msg = msg + " /- - - - - - - - - - - - - - - - - - - - " + + getLineSeparator(); + msg = msg + + " memberBhv.scalarSelect(Date.class).max(new ScalarSelect() {" + + getLineSeparator(); + msg = msg + " public void query(MemberCB cb) {" + + getLineSeparator(); + msg = msg + + " cb.specify().columnMemberBirthday(); // *Point!" + + getLineSeparator(); + msg = msg + " }" + getLineSeparator(); + msg = msg + " });" + getLineSeparator(); + msg = msg + " - - - - - - - - - -/" + getLineSeparator(); + msg = msg + getLineSeparator(); + msg = msg + "[Specified Foreign Property]" + getLineSeparator() + + foreignPropertyName + getLineSeparator(); + msg = msg + "* * * * * * * * * */"; + throw new ScalarSelectInvalidForeignSpecificationException(msg); + } + + protected void throwScalarSubQueryInvalidForeignSpecificationException( + String foreignPropertyName) { + String msg = "Look! Read the message below." + getLineSeparator(); + msg = msg + + "/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *" + + getLineSeparator(); + msg = msg + + "You specified a foreign table column in spite of derived-query!" + + getLineSeparator(); + msg = msg + getLineSeparator(); + msg = msg + "[Advice]" + getLineSeparator(); + msg = msg + + "You should specified a local table column at condition-bean for derived-query." + + getLineSeparator(); + msg = msg + " For example:" + getLineSeparator(); + msg = msg + " " + getLineSeparator(); + msg = msg + " [Wrong]" + getLineSeparator(); + msg = msg + " /- - - - - - - - - - - - - - - - - - - - " + + getLineSeparator(); + msg = msg + " MemberCB cb = new MemberCB();" + + getLineSeparator(); + msg = msg + + " cb.query().scalar_Equal().max(new SubQuery() {" + + getLineSeparator(); + msg = msg + " public void query(MemberCB subCB) {" + + getLineSeparator(); + msg = msg + + " subCB.specify().specifyMemberStatusName().columnDisplayOrder(); // *No!" + + getLineSeparator(); + msg = msg + " }" + getLineSeparator(); + msg = msg + " });" + getLineSeparator(); + msg = msg + " - - - - - - - - - -/" + getLineSeparator(); + msg = msg + " " + getLineSeparator(); + msg = msg + " [Good!]" + getLineSeparator(); + msg = msg + " /- - - - - - - - - - - - - - - - - - - - " + + getLineSeparator(); + msg = msg + " MemberCB cb = new MemberCB();" + + getLineSeparator(); + msg = msg + + " cb.query().scalar_Equal().max(new SubQuery() {" + + getLineSeparator(); + msg = msg + " public void query(MemberCB subCB) {" + + getLineSeparator(); + msg = msg + + " subCB.specify().columnMemberBirthday();// *Point!" + + getLineSeparator(); + msg = msg + " }" + getLineSeparator(); + msg = msg + " });" + getLineSeparator(); + msg = msg + " - - - - - - - - - -/" + getLineSeparator(); + msg = msg + getLineSeparator(); + msg = msg + "[Specified Foreign Property]" + getLineSeparator() + + foreignPropertyName + getLineSeparator(); + msg = msg + "* * * * * * * * * */"; + throw new ScalarSubQueryInvalidForeignSpecificationException(msg); + } + protected String getLineSeparator() { return SimpleSystemUtil.getLineSeparator(); } @@ -792,15 +882,33 @@ } } - public static class DeriveReferrerInvalidForeignSpecificationException + public static class DerivedReferrerInvalidForeignSpecificationException extends RuntimeException { private static final long serialVersionUID = 1L; - public DeriveReferrerInvalidForeignSpecificationException(String msg) { + public DerivedReferrerInvalidForeignSpecificationException(String msg) { super(msg); } } + public static class ScalarSubQueryInvalidForeignSpecificationException + extends RuntimeException { + private static final long serialVersionUID = 1L; + + public ScalarSubQueryInvalidForeignSpecificationException(String msg) { + super(msg); + } + } + + public static class ScalarSelectInvalidForeignSpecificationException extends + RuntimeException { + private static final long serialVersionUID = 1L; + + public ScalarSelectInvalidForeignSpecificationException(String msg) { + super(msg); + } + } + public static class RAFunction { protected ConditionBean _baseCB; @@ -815,6 +923,18 @@ _querySetupper = querySetupper; } + public void count(SubQuery subQuery, String aliasName) { + assertAliasName(aliasName); + _querySetupper.setup("count", subQuery, _localCQ, aliasName.trim()); + } + + public void countDistinct(SubQuery subQuery, + String aliasName) { + assertAliasName(aliasName); + _querySetupper.setup("count(distinct", subQuery, _localCQ, + aliasName.trim()); + } + public void max(SubQuery subQuery, String aliasName) { assertAliasName(aliasName); _querySetupper.setup("max", subQuery, _localCQ, aliasName.trim()); @@ -835,14 +955,9 @@ _querySetupper.setup("avg", subQuery, _localCQ, aliasName.trim()); } - public void count(SubQuery subQuery, String aliasName) { - assertAliasName(aliasName); - _querySetupper.setup("count", subQuery, _localCQ, aliasName.trim()); - } - protected void assertAliasName(String aliasName) { if (aliasName == null || aliasName.trim().length() == 0) { - throwDeriveReferrerInvalidAliasNameException(); + throwDerivedReferrerInvalidAliasNameException(); } DBMeta dbmeta = DBMetaInstanceHandler.findDBMeta(_baseCB .getTableDbName()); @@ -860,17 +975,17 @@ } } if (!existsSetterMethod) { - throwDeriveReferrerEntityPropertyNotFoundException(aliasName, + throwDerivedReferrerEntityPropertyNotFoundException(aliasName, dbmeta.getEntityType()); } } - protected void throwDeriveReferrerInvalidAliasNameException() { + protected void throwDerivedReferrerInvalidAliasNameException() { String msg = "Look! Read the message below." + getLineSeparator(); msg = msg + "/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *" + getLineSeparator(); - msg = msg + "The alias name for derive-referrer was Invalid!" + msg = msg + "The alias name for derived-referrer was Invalid!" + getLineSeparator(); msg = msg + getLineSeparator(); msg = msg + "[Advice]" + getLineSeparator(); @@ -915,17 +1030,17 @@ msg = msg + "[Local Table]" + getLineSeparator() + _localCQ.getTableDbName() + getLineSeparator(); msg = msg + "* * * * * * * * * */"; - throw new DeriveReferrerInvalidAliasNameException(msg); + throw new DerivedReferrerInvalidAliasNameException(msg); } - protected void throwDeriveReferrerEntityPropertyNotFoundException( + protected void throwDerivedReferrerEntityPropertyNotFoundException( String aliasName, Class entityType) { String msg = "Look! Read the message below." + getLineSeparator(); msg = msg + "/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *" + getLineSeparator(); msg = msg - + "A property for derive-referrer was Not Found in the entity!" + + "A property for derived-referrer was Not Found in the entity!" + getLineSeparator(); msg = msg + getLineSeparator(); msg = msg + "[Advice]" + getLineSeparator(); @@ -981,7 +1096,7 @@ msg = msg + "[Target Entity]" + getLineSeparator() + entityType + getLineSeparator(); msg = msg + "* * * * * * * * * */"; - throw new DeriveReferrerEntityPropertyNotFoundException(msg); + throw new DerivedReferrerEntityPropertyNotFoundException(msg); } protected String replaceString(String text, String fromText, @@ -999,20 +1114,20 @@ LOCAL_CQ cq, String aliasName); } - public static class DeriveReferrerInvalidAliasNameException extends + public static class DerivedReferrerInvalidAliasNameException extends RuntimeException { private static final long serialVersionUID = 1L; - public DeriveReferrerInvalidAliasNameException(String msg) { + public DerivedReferrerInvalidAliasNameException(String msg) { super(msg); } } - public static class DeriveReferrerEntityPropertyNotFoundException extends + public static class DerivedReferrerEntityPropertyNotFoundException extends RuntimeException { private static final long serialVersionUID = 1L; - public DeriveReferrerEntityPropertyNotFoundException(String msg) { + public DerivedReferrerEntityPropertyNotFoundException(String msg) { super(msg); } } @@ -1042,7 +1157,6 @@ protected void doSetupSelect(SsCall callback) { String foreignPropertyName = callback.qf().getForeignPropertyName(); assertSetupSelectBeforeUnion(foreignPropertyName); - limitSelect_Off(); String foreignTableAliasName = callback.qf().getRealAliasName(); String localRelationPath = localCQ().getRelationPath(); getSqlClause().registerSelectedSelectColumn(foreignTableAliasName, @@ -1164,19 +1278,27 @@ // ========= // Purpose Type // ============ - public void xsetupForDeriveReferrer() { - _forDeriveReferrer = true; + public void xsetupForDerivedReferrer() { // Very Internal + _forDerivedReferrer = true; } - public void xsetupForUnion() { + public void xsetupForScalarSelect() { // Very Internal + _forScalarSelect = true; + } + + public void xsetupForScalarSubQuery() { // Very Internal + _forScalarSubQuery = true; + } + + public void xsetupForUnion() { // Very Internal _forUnion = true; } - public void xsetupForExistsSubQuery() { + public void xsetupForExistsSubQuery() { // Very Internal _forExistsSubQuery = true; } - public void xsetupForInScopeSubQuery() { + public void xsetupForInScopeSubQuery() { // Very Internal _forInScopeSubQuery = true; } Modified: bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/cbean/AbstractConditionQuery.java =================================================================== --- bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/cbean/AbstractConditionQuery.java 2008-12-27 22:10:35 UTC (rev 1626) +++ bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/cbean/AbstractConditionQuery.java 2008-12-27 22:11:51 UTC (rev 1627) @@ -48,12 +48,14 @@ protected static final ConditionKey CK_PS = ConditionKey.CK_PREFIX_SEARCH; - protected static final ConditionKey CK_LS = ConditionKey.CK_LIKE_SEARCH; - protected static final ConditionKey CK_INS = ConditionKey.CK_IN_SCOPE; protected static final ConditionKey CK_NINS = ConditionKey.CK_NOT_IN_SCOPE; + protected static final ConditionKey CK_LS = ConditionKey.CK_LIKE_SEARCH; + + protected static final ConditionKey CK_NLS = ConditionKey.CK_NOT_LIKE_SEARCH; + protected static final ConditionKey CK_ISN = ConditionKey.CK_IS_NULL; protected static final ConditionKey CK_ISNN = ConditionKey.CK_IS_NOT_NULL; @@ -351,15 +353,7 @@ String msg = "The argument[unionQuery] should not be null."; throw new IllegalArgumentException(msg); } - reflectRelationOnUnionQuery(this, unionQuery);// Reflect Relation! - getSqlClause().copyIncludedSelectColumn(unionQuery.getSqlClause());// Reflect - // IncludedSelectColumn - // ! - if (getSqlClause().isFormatClauseEffective()) { - unionQuery.getSqlClause().makeFormatClauseEffective();// Reflect - // FormatClause - // ! - } + reflectRelationOnUnionQuery(this, unionQuery); // Reflect Relation! String key = (unionAll ? "unionAllQuery" : "unionQuery") + unionQueryMap.size(); unionQueryMap.put(key, unionQuery); @@ -416,22 +410,6 @@ // Register // ======== // ----------------------------------------------------- - // Include-As-Mine - // --------------- - /** - * Register included-select-column. - * - * @param aliasName Alias name. This should not contain comma. (NotNull) - * @param realColumnName Real column name. This should not contain comma. - * (NotNull) - * @deprecated Unsupported! - */ - protected void registerIncludedSelectColumn(String aliasName, - String realColumnName) { - throw new UnsupportedOperationException(); - } - - // ----------------------------------------------------- // Query // ----- protected void registerQuery(ConditionKey key, Object value, @@ -488,6 +466,13 @@ // ----------------------------------------------------- // LikeSearch Query // ---------------- + protected void regLSQ(ConditionKey key, String value, + ConditionValue cvalue, String colName, String capPropName, + String uncapPropName, LikeSearchOption option) { + registerLikeSearchQuery(key, value, cvalue, colName, capPropName, + uncapPropName, option); + } + @SuppressWarnings("deprecation") protected void registerLikeSearchQuery(ConditionKey key, String value, ConditionValue cvalue, String colName, String capPropName, @@ -700,25 +685,20 @@ assertObjectNotNull("InScopeSubQyery(" + columnName + ")", subQuery); inScopeOption = inScopeOption != null ? inScopeOption + " " : ""; String realColumnName = getInScopeSubQueryRealColumnName(columnName); + xincrementLocalSubQueryLevelIfNeeds(subQuery); String subQueryClause = getInScopeSubQuerySql(subQuery, relatedColumnName, propertyName); - String clause = null; - if (getSqlClause().isFormatClauseEffective()) { - String ln = getLineSeparator(); - int subQueryLevel = subQuery.getSubQueryLevel(); - String subQueryIdentity = propertyName + "[" + subQueryLevel + "]"; - String beginMark = getSqlClause().resolveSubQueryBeginMark( - subQueryIdentity) - + ln; - String endMark = getSqlClause().resolveSubQueryEndMark( - subQueryIdentity); - String endIndent = " "; - clause = realColumnName + " " + inScopeOption + "in (" + beginMark - + subQueryClause + ln + endIndent + ")" + endMark; - } else { - clause = realColumnName + " " + inScopeOption + "in (" - + subQueryClause + ")"; - } + String ln = getLineSeparator(); + int subQueryLevel = subQuery.getSubQueryLevel(); + String subQueryIdentity = propertyName + "[" + subQueryLevel + "]"; + String beginMark = getSqlClause().resolveSubQueryBeginMark( + subQueryIdentity) + + ln; + String endMark = getSqlClause() + .resolveSubQueryEndMark(subQueryIdentity); + String endIndent = " "; + String clause = realColumnName + " " + inScopeOption + "in (" + + beginMark + subQueryClause + ln + endIndent + ")" + endMark; registerWhereClause(clause); } @@ -728,22 +708,11 @@ protected String getInScopeSubQuerySql(ConditionQuery subQuery, String relatedColumnName, String propertyName) { - String selectClause = "select " - + getSqlClause().getLocalTableAliasName() + "." + String tableAliasName = getSqlClause().getLocalTableAliasName(); + String selectClause = "select " + tableAliasName + "." + relatedColumnName; - String fromWhereClause = subQuery.getSqlClause() - .getClauseFromWhereWithUnionTemplate(); - fromWhereClause = replaceString(fromWhereClause, ".conditionQuery.", - "." + getLocationBase(propertyName) + ".");// Very Important! - - // Replace template marks. These are very important! - fromWhereClause = replaceString(fromWhereClause, getSqlClause() - .getUnionSelectClauseMark(), selectClause); - fromWhereClause = replaceString(fromWhereClause, getSqlClause() - .getUnionWhereClauseMark(), ""); - fromWhereClause = replaceString(fromWhereClause, getSqlClause() - .getUnionWhereFirstConditionMark(), ""); - + String fromWhereClause = buildPlainSubQueryFromWhereClause(subQuery, + relatedColumnName, propertyName, selectClause, tableAliasName); return selectClause + " " + fromWhereClause; } @@ -769,24 +738,20 @@ assertObjectNotNull("ExistsSubQyery(" + columnName + ")", subQuery); existsOption = existsOption != null ? existsOption + " " : ""; String realColumnName = getExistsSubQueryRealColumnName(columnName); + xincrementLocalSubQueryLevelIfNeeds(subQuery); String subQueryClause = getExistsSubQuerySql(subQuery, realColumnName, relatedColumnName, propertyName); - String clause = null; - if (getSqlClause().isFormatClauseEffective()) { - String ln = getLineSeparator(); - int subQueryLevel = subQuery.getSubQueryLevel(); - String subQueryIdentity = propertyName + "[" + subQueryLevel + "]"; - String beginMark = getSqlClause().resolveSubQueryBeginMark( - subQueryIdentity) - + ln; - String endMark = getSqlClause().resolveSubQueryEndMark( - subQueryIdentity); - String endIndent = " "; - clause = existsOption + "exists (" + beginMark + subQueryClause - + ln + endIndent + ")" + endMark; - } else { - clause = existsOption + "exists (" + subQueryClause + ")"; - } + String ln = getLineSeparator(); + int subQueryLevel = subQuery.getSubQueryLevel(); + String subQueryIdentity = propertyName + "[" + subQueryLevel + "]"; + String beginMark = getSqlClause().resolveSubQueryBeginMark( + subQueryIdentity) + + ln; + String endMark = getSqlClause() + .resolveSubQueryEndMark(subQueryIdentity); + String endIndent = " "; + String clause = existsOption + "exists (" + beginMark + subQueryClause + + ln + endIndent + ")" + endMark; registerWhereClause(clause); } @@ -801,134 +766,116 @@ protected String getExistsSubQuerySql(ConditionQuery subQuery, String realColumnName, String relatedColumnName, String propertyName) { int subQueryLevel = subQuery.getSubQueryLevel(); - if (_subQueryLevel <= subQueryLevel) { - _subQueryLevel = subQueryLevel + 1; - } String tableAliasName = "dfsublocal_" + subQueryLevel; String selectClause = "select " + tableAliasName + "." + relatedColumnName; - String fromWhereClause = subQuery.getSqlClause() - .getClauseFromWhereWithWhereUnionTemplate(); - fromWhereClause = replaceString(fromWhereClause, "dflocal", - tableAliasName);// Very Important! - fromWhereClause = replaceString(fromWhereClause, ".conditionQuery.", - "." + getLocationBase(propertyName) + ".");// Very Important! - - String joinCondition = tableAliasName + "." + relatedColumnName + " = " - + realColumnName; - String firstConditionAfter = " and "; - if (getSqlClause().isFormatClauseEffective()) { - firstConditionAfter = getLineSeparator() + " and "; - } - - // Replace template marks. These are very important! - fromWhereClause = replaceString(fromWhereClause, getSqlClause() - .getWhereClauseMark(), "where " + joinCondition); - fromWhereClause = replaceString(fromWhereClause, getSqlClause() - .getWhereFirstConditionMark(), joinCondition - + firstConditionAfter); - fromWhereClause = replaceString(fromWhereClause, getSqlClause() - .getUnionSelectClauseMark(), selectClause); - fromWhereClause = replaceString(fromWhereClause, getSqlClause() - .getUnionWhereClauseMark(), "where " + joinCondition); - fromWhereClause = replaceString(fromWhereClause, getSqlClause() - .getUnionWhereFirstConditionMark(), joinCondition - + firstConditionAfter); - + String fromWhereClause = buildCorrelationSubQueryFromWhereClause( + subQuery, relatedColumnName, propertyName, selectClause, + tableAliasName, realColumnName); return selectClause + " " + fromWhereClause; } // [DBFlute-0.7.4] // ----------------------------------------------------- - // DeriveSubQuery - // -------------- - protected void registerDeriveSubQuery(String function, + // DerivedReferrerSubQuery + // ----------------------- + protected void registerDerivedReferrerSubQuery(String function, ConditionQuery subQuery, String columnName, String relatedColumnName, String propertyName, String aliasName) { - assertObjectNotNull("DeriveSubQuery(" + columnName + ")", subQuery); - final String realColumnName = getDeriveSubQueryRealColumnName(columnName); - final String subQueryClause = getDeriveSubQuerySql(function, subQuery, - realColumnName, relatedColumnName, propertyName, aliasName); - final String clause; - if (getSqlClause().isFormatClauseEffective()) { - final String ln = getLineSeparator(); - final int subQueryLevel = subQuery.getSubQueryLevel(); - final String subQueryIdentity = propertyName + "[" + subQueryLevel - + "]"; - final String beginMark = getSqlClause().resolveSubQueryBeginMark( - subQueryIdentity) - + ln; - final String endMark = getSqlClause().resolveSubQueryEndMark( - subQueryIdentity); - final String endIndent = " "; - clause = "(" + beginMark + subQueryClause + ln + endIndent - + ") as " + aliasName + endMark; - } else { - clause = "(" + subQueryClause + ") as " + aliasName; - } + assertObjectNotNull("DerivedReferrerSubQuery(function)", function); + assertObjectNotNull("DerivedReferrerSubQuery(" + columnName + ")", + subQuery); + String realColumnName = getDerivedReferrerSubQueryRealColumnName(columnName); + xincrementLocalSubQueryLevelIfNeeds(subQuery); + String subQueryClause = getDerivedReferrerSubQuerySql(function, + subQuery, realColumnName, relatedColumnName, propertyName, + aliasName); + String ln = getLineSeparator(); + int subQueryLevel = subQuery.getSubQueryLevel(); + String subQueryIdentity = propertyName + "[" + subQueryLevel + "]"; + String beginMark = getSqlClause().resolveSubQueryBeginMark( + subQueryIdentity) + + ln; + String endMark = getSqlClause() + .resolveSubQueryEndMark(subQueryIdentity); + String endIndent = " "; + String clause = "(" + beginMark + subQueryClause + ln + endIndent + + ") " + aliasName + endMark; getSqlClause().specifyDeriveSubQuery(aliasName, clause); } - protected String getDeriveSubQueryRealColumnName(String columnName) { + protected String getDerivedReferrerSubQueryRealColumnName(String columnName) { return getRealColumnName(columnName); } - protected String getDeriveSubQuerySql(String function, + protected String getDerivedReferrerSubQuerySql(String function, ConditionQuery subQuery, String realColumnName, String relatedColumnName, String propertyName, String aliasName) { - final int subQueryLevel = subQuery.getSubQueryLevel(); - if (_subQueryLevel <= subQueryLevel) { - _subQueryLevel = subQueryLevel + 1; - } - final String tableAliasName = "dfsublocal_" + subQueryLevel; - final String deriveColumnName = subQuery.getSqlClause() + int subQueryLevel = subQuery.getSubQueryLevel(); + String tableAliasName = "dfsublocal_" + subQueryLevel; + String deriveColumnName = subQuery.getSqlClause() .getSpecifiedColumnNameAsOne(); if (deriveColumnName == null || deriveColumnName.trim().length() == 0) { - throwDeriveReferrerInvalidColumnSpecificationException(function, + throwDerivedReferrerInvalidColumnSpecificationException(function, aliasName); } - assertDeriveReferrerColumnType(function, subQuery, deriveColumnName); - subQuery.getSqlClause().clearSpecifiedSelectColumn(); - final String selectClause = "select " + function + "(" + tableAliasName - + "." + deriveColumnName + ")"; - String fromWhereClause = subQuery.getSqlClause() - .getClauseFromWhereWithWhereUnionTemplate(); - fromWhereClause = replaceString(fromWhereClause, "dflocal", - tableAliasName);// Very Important! - fromWhereClause = replaceString(fromWhereClause, ".conditionQuery.", - "." + getLocationBase(propertyName) + ".");// Very Important! - - final String joinCondition = tableAliasName + "." + relatedColumnName - + " = " + realColumnName; - String firstConditionAfter = " and "; - if (getSqlClause().isFormatClauseEffective()) { - firstConditionAfter = getLineSeparator() + " and "; + assertDerivedReferrerColumnType(function, subQuery, deriveColumnName); + subQuery.getSqlClause().clearSpecifiedSelectColumn(); // specified + // columns + // disappear at + // this timing + String connect = xbuildFunctionConnector(function); + if (subQuery.getSqlClause().hasUnionQuery()) { + String ln = getLineSeparator(); + String subQueryIdentity = propertyName + "[" + subQueryLevel + + ":subquerymain]"; + String beginMark = getSqlClause().resolveSubQueryBeginMark( + subQueryIdentity) + + ln; + String endMark = getSqlClause().resolveSubQueryEndMark( + subQueryIdentity); + DBMeta dbmeta = DBMetaInstanceHandler.findDBMeta(subQuery + .getTableDbName()); + if (!dbmeta.hasPrimaryKey() || dbmeta.hasTwoOrMorePrimaryKeys()) { + String msg = "The derived-referrer is unsupported when no primary key or two-or-more primary keys:"; + msg = msg + " table=" + subQuery.getTableDbName(); + throw new UnsupportedOperationException(msg); + } + String primaryKeyName = dbmeta.getPrimaryUniqueInfo() + .getFirstColumn().getColumnDbName(); + String selectClause = "select " + tableAliasName + "." + + primaryKeyName + ", " + tableAliasName + "." + + relatedColumnName + ", " + tableAliasName + "." + + deriveColumnName; + String fromWhereClause = buildPlainSubQueryFromWhereClause( + subQuery, relatedColumnName, propertyName, selectClause, + tableAliasName); + String mainSql = selectClause + " " + fromWhereClause; + String joinCondition = "dfsubquerymain." + relatedColumnName + + " = " + realColumnName; + return "select " + function + connect + "dfsubquerymain." + + deriveColumnName + ")" + ln + " from (" + beginMark + + mainSql + ln + " ) dfsubquerymain" + endMark + ln + + " where " + joinCondition; + } else { + String selectClause = "select " + function + connect + + tableAliasName + "." + deriveColumnName + ")"; + String fromWhereClause = buildCorrelationSubQueryFromWhereClause( + subQuery, relatedColumnName, propertyName, selectClause, + tableAliasName, realColumnName); + return selectClause + " " + fromWhereClause; } - - // Replace template marks. These are very important! - fromWhereClause = replaceString(fromWhereClause, getSqlClause() - .getWhereClauseMark(), "where " + joinCondition); - fromWhereClause = replaceString(fromWhereClause, getSqlClause() - .getWhereFirstConditionMark(), joinCondition - + firstConditionAfter); - fromWhereClause = replaceString(fromWhereClause, getSqlClause() - .getUnionSelectClauseMark(), selectClause); - fromWhereClause = replaceString(fromWhereClause, getSqlClause() - .getUnionWhereClauseMark(), "where " + joinCondition); - fromWhereClause = replaceString(fromWhereClause, getSqlClause() - .getUnionWhereFirstConditionMark(), joinCondition - + firstConditionAfter); - - return selectClause + " " + fromWhereClause; } - protected void throwDeriveReferrerInvalidColumnSpecificationException( + protected void throwDerivedReferrerInvalidColumnSpecificationException( String function, String aliasName) { + String method = xconvertFunctionToMethod(function); String msg = "Look! Read the message below." + getLineSeparator(); msg = msg + "/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *" + getLineSeparator(); - msg = msg + "The specified the column for derive-referrer was Invalid!" + msg = msg + + "The specified the column for derived-referrer was Invalid!" + getLineSeparator(); msg = msg + getLineSeparator(); msg = msg + "[Advice]" + getLineSeparator(); @@ -941,7 +888,7 @@ msg = msg + " /- - - - - - - - - - - - - - - - - - - - " + getLineSeparator(); msg = msg + " MemberCB cb = new MemberCB();" + getLineSeparator(); - msg = msg + " cb.specify().derivePurchaseList()." + function + msg = msg + " cb.specify().derivePurchaseList()." + method + "(new SubQuery() {" + getLineSeparator(); msg = msg + " public void query(PurchaseCB subCB) {" + getLineSeparator(); @@ -955,7 +902,7 @@ msg = msg + " /- - - - - - - - - - - - - - - - - - - - " + getLineSeparator(); msg = msg + " MemberCB cb = new MemberCB();" + getLineSeparator(); - msg = msg + " cb.specify().derivePurchaseList()." + function + msg = msg + " cb.specify().derivePurchaseList()." + method + "(new SubQuery() {" + getLineSeparator(); msg = msg + " public void query(PurchaseCB subCB) {" + getLineSeparator(); @@ -973,7 +920,7 @@ msg = msg + " /- - - - - - - - - - - - - - - - - - - - " + getLineSeparator(); msg = msg + " MemberCB cb = new MemberCB();" + getLineSeparator(); - msg = msg + " cb.specify().derivePurchaseList()." + function + msg = msg + " cb.specify().derivePurchaseList()." + method + "(new SubQuery() {" + getLineSeparator(); msg = msg + " public void query(PurchaseCB subCB) {" + getLineSeparator(); @@ -988,19 +935,19 @@ msg = msg + "[Alias Name]" + getLineSeparator() + aliasName + getLineSeparator(); msg = msg + "* * * * * * * * * */"; - throw new DeriveReferrerInvalidColumnSpecificationException(msg); + throw new DerivedReferrerInvalidColumnSpecificationException(msg); } - public static class DeriveReferrerInvalidColumnSpecificationException + public static class DerivedReferrerInvalidColumnSpecificationException extends RuntimeException { private static final long serialVersionUID = 1L; - public DeriveReferrerInvalidColumnSpecificationException(String msg) { + public DerivedReferrerInvalidColumnSpecificationException(String msg) { super(msg); } } - protected void assertDeriveReferrerColumnType(String function, + protected void assertDerivedReferrerColumnType(String function, ConditionQuery subQuery, String deriveColumnName) { final DBMeta dbmeta = DBMetaInstanceHandler.findDBMeta(subQuery .getTableDbName()); @@ -1009,13 +956,13 @@ if ("sum".equalsIgnoreCase(function) || "avg".equalsIgnoreCase(function)) { if (!Number.class.isAssignableFrom(deriveColumnType)) { - throwDeriveReferrerUnmatchedColumnTypeException(function, + throwDerivedReferrerUnmatchedColumnTypeException(function, deriveColumnName, deriveColumnType); } } } - protected void throwDeriveReferrerUnmatchedColumnTypeException( + protected void throwDerivedReferrerUnmatchedColumnTypeException( String function, String deriveColumnName, Class deriveColumnType) { String msg = "Look! Read the message below." + getLineSeparator(); msg = msg @@ -1040,19 +987,366 @@ msg = msg + "[Derive Column]" + getLineSeparator() + deriveColumnName + "(" + deriveColumnType.getName() + ")" + getLineSeparator(); msg = msg + "* * * * * * * * * */"; - throw new DeriveReferrerUnmatchedColumnTypeException(msg); + throw new DerivedReferrerUnmatchedColumnTypeException(msg); } - public static class DeriveReferrerUnmatchedColumnTypeException extends + public static class DerivedReferrerUnmatchedColumnTypeException extends RuntimeException { private static final long serialVersionUID = 1L; - public DeriveReferrerUnmatchedColumnTypeException(String msg) { + public DerivedReferrerUnmatchedColumnTypeException(String msg) { super(msg); } } + // [DBFlute-0.8.8] // ----------------------------------------------------- + // ScalarSubQuery + // -------------- + protected void registerScalarSubQuery(String function, + ConditionQuery subQuery, String propertyName, String operand) { + assertObjectNotNull("ScalarSubQuery(" + propertyName + ")", subQuery); + + // Get the specified column before it disappears at sub-query making. + String deriveRealColumnName; + { + String deriveColumnName = subQuery.getSqlClause() + .getSpecifiedColumnNameAsOne(); + if (deriveColumnName == null + || deriveColumnName.trim().length() == 0) { + throwScalarSubQueryInvalidColumnSpecificationException(function); + } + deriveRealColumnName = getScalarSubQueryRealColumnName(deriveColumnName); + } + + xincrementLocalSubQueryLevelIfNeeds(subQuery); + String subQueryClause = getScalarSubQuerySql(function, subQuery, + propertyName); + String ln = getLineSeparator(); + int subQueryLevel = subQuery.getSubQueryLevel(); + String subQueryIdentity = propertyName + "[" + subQueryLevel + "]"; + String beginMark = getSqlClause().resolveSubQueryBeginMark( + subQueryIdentity) + + ln; + String endMark = getSqlClause() + .resolveSubQueryEndMark(subQueryIdentity); + String endIndent = " "; + String clause = deriveRealColumnName + " " + operand + " (" + beginMark + + subQueryClause + ln + endIndent + ") " + endMark; + registerWhereClause(clause); + } + + protected String getScalarSubQueryRealColumnName(String columnName) { + return getRealColumnName(columnName); + } + + protected String getScalarSubQuerySql(String function, + ConditionQuery subQuery, String propertyName) { + int subQueryLevel = subQuery.getSubQueryLevel(); + String tableAliasName = "dfsublocal_" + subQueryLevel; + String deriveColumnName = subQuery.getSqlClause() + .getSpecifiedColumnNameAsOne(); + if (deriveColumnName == null || deriveColumnName.trim().length() == 0) { + throwScalarSubQueryInvalidColumnSpecificationException(function); + } + assertScalarSubQueryColumnType(function, subQuery, deriveColumnName); + subQuery.getSqlClause().clearSpecifiedSelectColumn(); // specified + // columns + // disappear at + // this timing + DBMeta dbmeta = DBMetaInstanceHandler.findDBMeta(subQuery + .getTableDbName()); + if (!dbmeta.hasPrimaryKey() || dbmeta.hasTwoOrMorePrimaryKeys()) { + String msg = "The scalar-sub-query is unsupported when no primary key or two-or-more primary keys:"; + msg = msg + " table=" + subQuery.getTableDbName(); + throw new UnsupportedOperationException(msg); + } + String primaryKeyName = dbmeta.getPrimaryUniqueInfo().getFirstColumn() + .getColumnDbName(); + if (subQuery.getSqlClause().hasUnionQuery()) { + String ln = getLineSeparator(); + String subQueryIdentity = propertyName + "[" + subQueryLevel + + ":subquerymain]"; + String beginMark = getSqlClause().resolveSubQueryBeginMark( + subQueryIdentity) + + ln; + String endMark = getSqlClause().resolveSubQueryEndMark( + subQueryIdentity); + String selectClause = "select " + tableAliasName + "." + + primaryKeyName + ", " + tableAliasName + "." + + deriveColumnName; + String fromWhereClause = buildPlainSubQueryFromWhereClause( + subQuery, primaryKeyName, propertyName, selectClause, + tableAliasName); + String mainSql = selectClause + " " + fromWhereClause; + return "select " + function + "(dfsubquerymain." + deriveColumnName + + ")" + ln + " from (" + beginMark + mainSql + ln + + " ) dfsubquerymain" + endMark; + } else { + String selectClause = "select " + function + "(" + tableAliasName + + "." + deriveColumnName + ")"; + String fromWhereClause = buildPlainSubQueryFromWhereClause( + subQuery, primaryKeyName, propertyName, selectClause, + tableAliasName); + return selectClause + " " + fromWhereClause; + } + } + + protected void throwScalarSubQueryInvalidColumnSpecificationException( + String function) { + String msg = "Look! Read the message below." + getLineSeparator(); + msg = msg + + "/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *" + + getLineSeparator(); + msg = msg + + "The specified the column for derived-referrer was Invalid!" + + getLineSeparator(); + msg = msg + getLineSeparator(); + msg = msg + "[Advice]" + getLineSeparator(); + msg = msg + + " You should call specify().column[TargetColumn]() only once." + + getLineSeparator(); + msg = msg + " For example:" + getLineSeparator(); + msg = msg + " " + getLineSeparator(); + msg = msg + " [Wrong]" + getLineSeparator(); + msg = msg + " /- - - - - - - - - - - - - - - - - - - - " + + getLineSeparator(); + msg = msg + " MemberCB cb = new MemberCB();" + getLineSeparator(); + msg = msg + " cb.query().scalar_Equal()." + function + + "(new SubQuery() {" + getLineSeparator(); + msg = msg + " public void query(MemberCB subCB) {" + + getLineSeparator(); + msg = msg + " // *No! It's empty!" + getLineSeparator(); + msg = msg + " }" + getLineSeparator(); + msg = msg + " });" + getLineSeparator(); + msg = msg + " - - - - - - - - - -/" + getLineSeparator(); + msg = msg + " " + getLineSeparator(); + msg = msg + " [Wrong]" + getLineSeparator(); + msg = msg + " /- - - - - - - - - - - - - - - - - - - - " + + getLineSeparator(); + msg = msg + " MemberCB cb = new MemberCB();" + getLineSeparator(); + msg = msg + " cb.query().scalar_Equal()." + function + + "(new SubQuery() {" + getLineSeparator(); + msg = msg + " public void query(MemberCB subCB) {" + + getLineSeparator(); + msg = msg + " subCB.specify().columnMemberBirthday();" + + getLineSeparator(); + msg = msg + + " subCB.specify().columnMemberName(); // *No! It's duplicated!" + + getLineSeparator(); + msg = msg + " }" + getLineSeparator(); + msg = msg + " });" + getLineSeparator(); + msg = msg + " - - - - - - - - - -/" + getLineSeparator(); + msg = msg + " " + getLineSeparator(); + msg = msg + " [Good!]" + getLineSeparator(); + msg = msg + " /- - - - - - - - - - - - - - - - - - - - " + + getLineSeparator(); + msg = msg + " MemberCB cb = new MemberCB();" + getLineSeparator(); + msg = msg + " cb.query().scalar_Equal()." + function + + "(new SubQuery() {" + getLineSeparator(); + msg = msg + " public void query(MemberCB subCB) {" + + getLineSeparator(); + msg = msg + + " subCB.specify().columnPurchaseDatetime(); // *Point!" + + getLineSeparator(); + msg = msg + " }" + getLineSeparator(); + msg = msg + " });" + getLineSeparator(); + msg = msg + " - - - - - - - - - -/" + getLineSeparator(); + msg = msg + "* * * * * * * * * */"; + throw new ScalarSubQueryInvalidColumnSpecificationException(msg); + } + + public static class ScalarSubQueryInvalidColumnSpecificationException + extends RuntimeException { + private static final long serialVersionUID = 1L; + + public ScalarSubQueryInvalidColumnSpecificationException(String msg) { + super(msg); + } + } + + protected void assertScalarSubQueryColumnType(String function, + ConditionQuery subQuery, String deriveColumnName) { + final DBMeta dbmeta = DBMetaInstanceHandler.findDBMeta(subQuery + .getTableDbName()); + final Class deriveColumnType = dbmeta.findColumnInfo( + deriveColumnName).getPropertyType(); + if ("sum".equalsIgnoreCase(function) + || "avg".equalsIgnoreCase(function)) { + if (!Number.class.isAssignableFrom(deriveColumnType)) { + throwScalarSubQueryUnmatchedColumnTypeException(function, + deriveColumnName, deriveColumnType); + } + } + } + + protected void throwScalarSubQueryUnmatchedColumnTypeException( + String function, String deriveColumnName, Class deriveColumnType) { + String msg = "Look! Read the message below." + getLineSeparator(); + msg = msg + + "/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *" + + getLineSeparator(); + msg = msg + + "The type of the specified the column unmatched with the function!" + + getLineSeparator(); + msg = msg + getLineSeparator(); + msg = msg + "[Advice]" + getLineSeparator(); + msg = msg + "You should confirm the list as follow:" + + getLineSeparator(); + msg = msg + " max() : String, Number, Date" + getLineSeparator(); + msg = msg + " min() : String, Number, Date" + getLineSeparator(); + msg = msg + " sum() : Number" + getLineSeparator(); + msg = msg + " avg() : Number" + getLineSeparator(); + msg = msg + getLineSeparator(); + msg = msg + "[Function]" + getLineSeparator() + function + + getLineSeparator(); + msg = msg + getLineSeparator(); + msg = msg + "[Derive Column]" + getLineSeparator() + deriveColumnName + + "(" + deriveColumnType.getName() + ")" + getLineSeparator(); + msg = msg + "* * * * * * * * * */"; + throw new ScalarSubQueryUnmatchedColumnTypeException(msg); + } + + public static class ScalarSubQueryUnmatchedColumnTypeException extends + RuntimeException { + private static final long serialVersionUID = 1L; + + public ScalarSubQueryUnmatchedColumnTypeException(String msg) { + super(msg); + } + } + + public static class SSQFunction { + protected SSQSetupper _setupper; + + public SSQFunction(SSQSetupper setupper) { + _setupper = setupper; + } + + public void max(SubQuery subQuery) { + _setupper.setup("max", subQuery); + } + + public void min(SubQuery subQuery) { + _setupper.setup("min", subQuery); + } + + public void sum(SubQuery subQuery) { + _setupper.setup("sum", subQuery); + } + + public void avg(SubQuery subQuery) { + _setupper.setup("avg", subQuery); + } + } + + protected static interface SSQSetupper { + public void setup(String function, SubQuery subQuery); + } + + // ----------------------------------------------------- + // SubQuery Common + // --------------- + protected String buildPlainSubQueryFromWhereClause(ConditionQuery subQuery, + String relatedColumnName, String propertyName, String selectClause, + String tableAliasName) { + String fromWhereClause = subQuery.getSqlClause() + .getClauseFromWhereWithUnionTemplate(); + + // Replace the alias names for local table with alias name of sub-query + // unique. + // However when it's inScope this replacement is unnecessary so comment + // out here. + // (Override base alias name at sub-query on SQL) + // So if the argument 'tableAliasName' is not null, replace it. + if (tableAliasName != null) { + fromWhereClause = replaceString(fromWhereClause, "dflocal", + tableAliasName); + } + + // Resolve the location path for the condition-query of sub-query. + fromWhereClause = replaceString(fromWhereClause, ".conditionQuery.", + "." + getLocationBase(propertyName) + "."); + + // Replace template marks. These are very important! + fromWhereClause = replaceString(fromWhereClause, getSqlClause() + .getUnionSelectClauseMark(), selectClause); + fromWhereClause = replaceString(fromWhereClause, getSqlClause() + .getUnionWhereClauseMark(), ""); + fromWhereClause = replaceString(fromWhereClause, getSqlClause() + .getUnionWhereFirstConditionMark(), ""); + return fromWhereClause; + } + + protected String buildCorrelationSubQueryFromWhereClause( + ConditionQuery subQuery, String relatedColumnName, + String propertyName, String selectClause, String tableAliasName, + String realColumnName) { + String fromWhereClause = subQuery.getSqlClause() + .getClauseFromWhereWithWhereUnionTemplate(); + + // Replace the alias names for local table with alias name of sub-query + // unique. + fromWhereClause = replaceString(fromWhereClause, "dflocal", + tableAliasName); + + // Resolve the location path for the condition-query of sub-query. + fromWhereClause = replaceString(fromWhereClause, ".conditionQuery.", + "." + getLocationBase(propertyName) + "."); + + String joinCondition = tableAliasName + "." + relatedColumnName + " = " + + realColumnName; + String firstConditionAfter = getLineSeparator() + " and "; + + // Replace template marks. These are very important! + fromWhereClause = replaceString(fromWhereClause, getSqlClause() + .getWhereClauseMark(), "where " + joinCondition); + fromWhereClause = replaceString(fromWhereClause, getSqlClause() + .getWhereFirstConditionMark(), joinCondition + + firstConditionAfter); + fromWhereClause = replaceString(fromWhereClause, getSqlClause() + .getUnionSelectClauseMark(), selectClause); + fromWhereClause = replaceString(fromWhereClause, getSqlClause() + .getUnionWhereClauseMark(), "where " + joinCondition); + fromWhereClause = replaceString(fromWhereClause, getSqlClause() + .getUnionWhereFirstConditionMark(), joinCondition + + firstConditionAfter); + return fromWhereClause; + } + + protected void xincrementLocalSubQueryLevelIfNeeds(ConditionQuery subQuery) { // Very + // Internal + int subQueryLevel = subQuery.getSubQueryLevel(); + if (_subQueryLevel <= subQueryLevel) { + _subQueryLevel = subQueryLevel + 1; + } + } + + protected String xbuildFunctionConnector(String function) { + if (function != null && function.endsWith("(distinct")) { // For example + // 'count(distinct' + return " "; + } else { + return "("; + } + } + + protected String xconvertFunctionToMethod(String function) { + if (function != null && function.contains("(")) { // For example + // 'count(distinct' + int index = function.indexOf("("); + String front = function.substring(0, index); + if (function.length() > front.length() + "(".length()) { + String rear = function.substring(index + "(".length()); + function = front + initCap(rear); + } else { + function = front; + } + } + return function; + } + + // ----------------------------------------------------- // Where Clause // ------------ protected void setupConditionValueAndRegisterWhereClause(ConditionKey key, @@ -1276,14 +1570,16 @@ // ========= // Fixed Condition // =============== - protected String prepareFixedCondition(String fixedCondition, - String localAliasName, String foreignAliasName) { + protected String ppFxCd(String fixedCondition, String localAliasName, + String foreignAliasName) { // prepareFixedCondition fixedCondition = replaceString(fixedCondition, "$$alias$$", foreignAliasName); fixedCondition = replaceString(fixedCondition, "$$foreignAlias$$", foreignAliasName); fixedCondition = replaceString(fixedCondition, "$$localAlias$$", localAliasName); + fixedCondition = replaceString(fixedCondition, "$$locationBase$$.", + "dto." + getLocationBase()); return fixedCondition; } @@ -1515,7 +1811,7 @@ return newList; } - public void doNss(NssCall callback) {// Very Internal + public void doNss(NssCall callback) { // Very Internal String foreignPropertyName = callback.qf().getForeignPropertyName(); String foreignTableAliasName = callback.qf().getRealAliasName(); getSqlClause().registerSelectedSelectColumn(foreignTableAliasName, @@ -1524,7 +1820,7 @@ callback.qf().getRelationPath(), foreignPropertyName); } - public static interface NssCall {// Very Internal + public static interface NssCall { // Very Internal public ConditionQuery qf(); } Modified: bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/cbean/ConditionBean.java =================================================================== --- bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/cbean/ConditionBean.java 2008-12-27 22:10:35 UTC (rev 1626) +++ bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/cbean/ConditionBean.java 2008-12-27 22:11:51 UTC (rev 1627) @@ -1,5 +1,7 @@ package jp.sf.pal.bookmark.db.allcommon.cbean; +import java.util.Map; + import jp.sf.pal.bookmark.db.allcommon.cbean.sqlclause.SqlClause; import jp.sf.pal.bookmark.db.allcommon.jdbc.StatementConfig; @@ -11,28 +13,6 @@ public interface ConditionBean extends PagingBean { //========================================================================== - // =========== - // Definition - // ========== - /** Map-string map-mark. */ - public static final String MAP_STRING_MAP_MARK = "map:"; - - /** Map-string list-mark. */ - public static final String MAP_STRING_LIST_MARK = "list:"; - - /** Map-string start-brace. */ - public static final String MAP_STRING_START_BRACE = "@{"; - - /** Map-string end-brace. */ - public static final String MAP_STRING_END_BRACE = "@}"; - - /** Map-string delimiter. */ - public static final String MAP_STRING_DELIMITER = "@;"; - - /** Map-string equal. */ - public static final String MAP_STRING_EQUAL = "@="; - - //========================================================================== // ========= // Table Name // ========== @@ -70,8 +50,7 @@ * * @param primaryKeyMap Primary-key map. (NotNull and NotEmpty) */ - public void acceptPrimaryKeyMap( - java.util.Map primaryKeyMap); + public void acceptPrimaryKeyMap(Map primaryKeyMap); /** * Accept primary-key map-string. Delimiter is at-mark and semicolon. @@ -105,14 +84,6 @@ // Query // ===== /** - * Get condition-query as interface. - * - * @return Instance of query as interface. (NotNull) - * @deprecated - */ - public ConditionQuery getConditionQueryAsInterface(); - - /** * Get the conditionQuery of the local table as interface. * * @return The conditionQuery of the local table as interface. (NotNull) @@ -131,32 +102,6 @@ public boolean hasUnionQueryOrUnionAllQuery(); //========================================================================== - // ========= - // Limit Select - // ============ - /** - * Limit select PK only. This is OLD style. You can do the same thing by - * specify(). - * - * @return this. (NotNull) - */ - public ConditionBean limitSelect_PKOnly(); - - /** - * Limit select off. - * - * @return this. (NotNull) - */ - public ConditionBean limitSelect_Off(); - - /** - * Is limit-select PK only? - * - * @return Determination. - */ - public boolean isLimitSelect_PKOnly(); - - //========================================================================== // =========== // Lock Setting // ============ Modified: bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/cbean/ConditionBeanContext.java =================================================================== --- bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/cbean/ConditionBeanContext.java 2008-12-27 22:10:35 UTC (rev 1626) +++ bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/cbean/ConditionBeanContext.java 2008-12-27 22:11:51 UTC (rev 1627) @@ -1,10 +1,6 @@ package jp.sf.pal.bookmark.db.allcommon.cbean; -import java.util.Collections; -import java.util.LinkedHashMap; -import java.util.Map; - -import jp.sf.pal.bookmark.db.allcommon.DBFluteConfig; +import jp.sf.pal.bookmark.db.allcommon.DBDef; import jp.sf.pal.bookmark.db.allcommon.cbean.sqlclause.SqlClause; import jp.sf.pal.bookmark.db.allcommon.cbean.sqlclause.SqlClauseDb2; import jp.sf.pal.bookmark.db.allcommon.cbean.sqlclause.SqlClauseDerby; @@ -78,11 +74,35 @@ //========================================================================== // ========= - // Initialize against the ClassLoader Headache - // =========================================== + // Type Determination + // ================== + /** + * Is the argument condition-bean? + * + * @param dtoInstance DTO instance. + * @return Determination. + */ + public static boolean isTheArgumentConditionBean(final Object dtoInstance) { + return dtoInstance instanceof ConditionBean; + } + + /** + * Is the type condition-bean? + * + * @param dtoClass DtoClass. + * @return Determination. + */ + public static boolean isTheTypeConditionBean(final Class dtoClass) { + return ConditionBean.class.isAssignableFrom(dtoClass); + } + + //========================================================================== + // ========= + // Cool Classes + // ============ @SuppressWarnings("unused") - public static void initialize() { - boolean debugEnabled = _log.isDebugEnabled(); + public static void loadCoolClasses() { + boolean debugEnabled = false; // If you watch the log, set this true. // Against the ClassLoader Headache! final StringBuilder sb = new StringBuilder(); { @@ -119,120 +139,6 @@ //========================================================================== // ========= - // Type Determination - // ================== - /** - * Is the argument condition-bean? - * - * @param dtoInstance DTO instance. - * @return Determination. - */ - public static boolean isTheArgumentConditionBean(final Object dtoInstance) { - if (dtoInstance instanceof ConditionBean) { - return true; - } else { - return false; - } - } - - /** - * Is the type condition-bean? - * - * @param dtoClass DtoClass. - * @return Determination. - */ - public static boolean isTheTypeConditionBean(final Class dtoClass) { - if (ConditionBean.class.isAssignableFrom(dtoClass)) { - return true; - } else { - return false; - } - } - - //========================================================================== - // ========= - // Product Name - // ============ - public static final String DB_NAME_DERBY = "derby"; - - public static final String DB_NAME_H2 = "h2"; - - public static final String DB_NAME_ORACLE = "oracle"; - - public static final String DB_NAME_MYSQL = "mysql"; - - public static final String DB_NAME_POSTGRESQL = "postgresql"; - - public static final String DB_NAME_FIREBIRD = "firebird"; - - public static final String DB_NAME_MSSQL = "mssql"; - - public static final String DB_NAME_SYBASE = "sybase"; - - public static final String DB_NAME_DB2 = "db2"; - - protected static final Map _driverHintDatabaseProductNameMap; - static { - final Map tmpMap = Collections - .synchronizedMap(new LinkedHashMap()); - 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 keySet = _driverHintDatabaseProductNameMap - .keySet(); - for (final java.util.Iterator ite = keySet.iterator(); ite - .hasNext();) { - final String driverHint = (String) ite.next(); - if (driverClassName.indexOf(driverHint) >= 0) { - final String databaseProductName = (String) _driverHintDatabaseProductNameMap - .get(driverHint); - setDatabaseProductName(databaseProductName); - return true; - } - } - return false; - } - - /** The database product name. */ - private static String _databaseProductName; - - /** - * Get database product name. - * - * @return Database product name. - */ - public static String getDatabaseProductName() { - return _databaseProductName; - } - - /** - * Set database product name. - * - * @param name Database product name. (NotNull) - */ - public static void setDatabaseProductName(String name) { - if (_databaseProductName != null) { - String msg = "Already set up: current=" + _databaseProductName - + " your=" + name; - throw new IllegalStateException(msg); - } - _databaseProductName = name; - } - - //========================================================================== - // ========= // SqlClause Creator // ================= /** @@ -244,9 +150,6 @@ public static SqlClause createSqlClause(ConditionBean cb) { final String tableSqlName = cb.getTableSqlName(); final SqlClause sqlClause = createSqlClause(tableSqlName); - if (DBFluteConfig.getInstance().isConditionBeanFormatSql()) { - sqlClause.makeFormatClauseEffective(); - } return sqlClause; } @@ -257,27 +160,22 @@ * @return SQL-clause. (NotNull) */ public static SqlClause createSqlClause(String tableDbName) { - final String databaseProductName = getDatabaseProductName(); - if (databaseProductName == null) { - return new SqlClauseH2(tableDbName); - } - final String name = databaseProductName.toLowerCase(); - if (name.equalsIgnoreCase(DB_NAME_DERBY)) { - return new SqlClauseDerby(tableDbName); - } else if (name.equalsIgnoreCase(DB_NAME_H2)) { - return new SqlClauseH2(tableDbName); - } else if (name.equalsIgnoreCase(DB_NAME_ORACLE)) { - return new SqlClauseOracle(tableDbName); - } else if (name.equalsIgnoreCase(DB_NAME_FIREBIRD)) { - return new SqlClauseFirebird(tableDbName); - } else if (name.equalsIgnoreCase(DB_NAME_MYSQL)) { + if (DBDef.isCurrentDef(DBDef.MySQL)) { return new SqlClauseMySql(tableDbName); - } else if (name.equalsIgnoreCase(DB_NAME_POSTGRESQL)) { + } else if (DBDef.isCurrentDef(DBDef.PostgreSQL)) { return new SqlClausePostgreSql(tableDbName); - } else if (name.equalsIgnoreCase(DB_NAME_MSSQL)) { - return new SqlClauseSqlServer(tableDbName); - } else if (name.equalsIgnoreCase(DB_NAME_DB2)) { + } else if (DBDef.isCurrentDef(DBDef.Oracle)) { + return new SqlClauseOracle(tableDbName); + } else if (DBDef.isCurrentDef(DBDef.DB2)) { return new SqlClauseDb2(tableDbName); + } else if (DBDef.isCurrentDef(DBDef.SQLServer)) { + return new SqlClauseSqlServer(tableDbName); + } else if (DBDef.isCurrentDef(DBDef.FireBird)) { + return new SqlClauseFirebird(tableDbName); + } else if (DBDef.isCurrentDef(DBDef.H2)) { + return new SqlClauseH2(tableDbName); + } else if (DBDef.isCurrentDef(DBDef.Derby)) { + return new SqlClauseDerby(tableDbName); } else { return new SqlClauseH2(tableDbName); } @@ -362,12 +260,7 @@ // Display SQL // =========== public static String convertConditionBean2DisplaySql(ConditionBean cb) { - final String twoWaySql; - if (cb.isLimitSelect_PKOnly()) { - twoWaySql = cb.getSqlClause().getClausePKOnly(); - } else { - twoWaySql = cb.getSqlClause().getClause(); - } + final String twoWaySql = cb.getSqlClause().getClause(); return InternalSqlParser.convertTwoWaySql2DisplaySql(twoWaySql, cb); } @@ -390,31 +283,8 @@ errorCode); } - // [DBFlute-0.7.8] //========================================================================== // ========= - // Database Type - // ============= - /** - * Is the database Oracle? - * - * @return Is the database Oracle? - */ - public static boolean isOracle() { - return createSqlClause("dummy") instanceof SqlClauseOracle; - } - - /** - * Is the database PostgreSQL? - * - * @return Is the database PostgreSQL? - */ - public static boolean isPostgreSql() { - return createSqlClause("dummy") instanceof SqlClausePostgreSql; - } - - //========================================================================== - // ========= // Helper // ====== /** Modified: bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/cbean/ConditionQuery.java =================================================================== --- bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/cbean/ConditionQuery.java 2008-12-27 22:10:35 UTC (rev 1626) +++ bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/cbean/ConditionQuery.java 2008-12-27 22:11:51 UTC (rev 1627) @@ -8,7 +8,6 @@ * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public interface ConditionQuery { //========================================================================== Added: bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/cbean/ScalarQuery.java =================================================================== --- bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/cbean/ScalarQuery.java (rev 0) +++ bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/cbean/ScalarQuery.java 2008-12-27 22:11:51 UTC (rev 1627) @@ -0,0 +1,5 @@ +package jp.sf.pal.bookmark.db.allcommon.cbean; + +public interface ScalarQuery { + public void query(CB cb); +} Property changes on: bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/cbean/ScalarQuery.java ___________________________________________________________________ Name: svn:eol-style + native Deleted: bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/cbean/SimpleOrderByBean.java =================================================================== --- bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/cbean/SimpleOrderByBean.java 2008-12-27 22:10:35 UTC (rev 1626) +++ bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/cbean/SimpleOrderByBean.java 2008-12-27 22:11:51 UTC (rev 1627) @@ -1,165 +0,0 @@ -package jp.sf.pal.bookmark.db.allcommon.cbean; - -import jp.sf.pal.bookmark.db.allcommon.cbean.sqlclause.OrderByClause; -import jp.sf.pal.bookmark.db.allcommon.cbean.sqlclause.SqlClause; - -/** - * @deprecated - */ -public class SimpleOrderByBean implements OrderByBean { - - //========================================================================== - // ========= - // Attribute - // ========= - /** SQL clause instance. */ - protected final SqlClause _sqlClause; - { - _sqlClause = ConditionBeanContext.createSqlClause("Dummy"); - } - - //========================================================================== - // ========= - // Constructor - // =========== - /** - * Constructor. - */ - public SimpleOrderByBean() { - } - - //========================================================================== - // ========= - // SqlClause - // ========= - /** - * Get sql-clause. - * - * @return Sql clause. (NotNull) - */ - protected SqlClause getSqlClause() { - return _sqlClause; - } - - //========================================================================== - // ========= - // Select Resource - // =============== - /** - * Check safety result. - * - * @param safetyMaxResultSize Safety max result size. (If zero or minus, - * ignore checking) - */ - public void checkSafetyResult(int safetyMaxResultSize) { - throw new UnsupportedOperationException(); - } - - //========================================================================== - // ========= - // OrderBy - // ======= - /** - * The implementation. - * - * @return Sql component of order-by clause. (NotNull) - */ - public OrderByClause getSqlComponentOfOrderByClause() { - return getSqlClause().getSqlComponentOfOrderByClause(); - } - - /** - * The implementation. - * - * @return Order-by clause. (NotNull) - */ - public String getOrderByClause() { - return getSqlClause().getOrderByClause(); - } - - /** - * The implementation. - * - * @return this. (NotNull) - */ - public OrderByBean clearOrderBy() { - getSqlClause().clearOrderBy(); - return this; - } - - /** - * The implementation. - * - * @return this. (NotNull) - */ - public OrderByBean ignoreOrderBy() { - getSqlClause().ignoreOrderBy(); - return this; - } - - /** - * The implementation. - * - * @return this. (NotNull) - */ - public OrderByBean makeOrderByEffective() { - getSqlClause().makeOrderByEffective(); - return this; - } - - /** - * Register order-by-asc. - * - * @param orderByProperty Order-by-property. - * 'aliasName.columnName/aliasName.columnName/...' (NotNull) - * @return this. (NotNull) - * @deprecated - */ - public OrderByBean registerOrderByAsc(String orderByProperty) { - getSqlClause().registerOrderBy(orderByProperty, orderByProperty, true); - return this; - } - - /** - * Register order-by-desc. - * - * @param orderByProperty Order-by-property. - * 'aliasName.columnName/aliasName.columnName/...' (NotNull) - * @return this. (NotNull) - * @deprecated - */ - public OrderByBean registerOrderByDesc(String orderByProperty) { - getSqlClause().registerOrderBy(orderByProperty, orderByProperty, false); - return this; - } - - /** - * Reverse order-by or Override order-by asc. - * - * @param orderByProperty Order-by-property. - * 'aliasName.columnName/aliasName.columnName/...' (NotNull) - * @return this. (NotNull) - * @deprecated - */ - public OrderByBean reverseOrderBy_Or_OverrideOrderByAsc( - String orderByProperty) { - getSqlClause().reverseOrderBy_Or_OverrideOrderBy(orderByProperty, - orderByProperty, true); - return this; - } - - /** - * Reverse order-by or Override order-by desc. - * - * @param orderByProperty Order-by-property. - * 'aliasName.columnName/aliasName.columnName/...' (NotNull) - * @return this. (NotNull) - * @deprecated - */ - public OrderByBean reverseOrderBy_Or_OverrideOrderByDesc( - String orderByProperty) { - getSqlClause().reverseOrderBy_Or_OverrideOrderBy(orderByProperty, - orderByProperty, false); - return this; - } -} Modified: bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/cbean/ckey/ConditionKey.java =================================================================== --- bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/cbean/ckey/ConditionKey.java 2008-12-27 22:10:35 UTC (rev 1626) +++ bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/cbean/ckey/ConditionKey.java 2008-12-27 22:11:51 UTC (rev 1627) @@ -12,6 +12,10 @@ */ public abstract class ConditionKey { + //========================================================================== + // ========= + // Definition + // ========== /** Mark of replaced value. */ public static final String MARK_OF_REPLACED_VALUE = "ReplacedValue"; @@ -36,15 +40,18 @@ /** The condition key of prefixSearch. */ public static final ConditionKey CK_PREFIX_SEARCH = new ConditionKeyPrefixSearch(); - /** The condition key of likeSearch. */ - public static final ConditionKey CK_LIKE_SEARCH = new ConditionKeyLikeSearch(); - /** The condition key of inScope. */ public static final ConditionKey CK_IN_SCOPE = new ConditionKeyInScope(); /** The condition key of notInScope. */ public static final ConditionKey CK_NOT_IN_SCOPE = new ConditionKeyNotInScope(); + /** The condition key of likeSearch. */ + public static final ConditionKey CK_LIKE_SEARCH = new ConditionKeyLikeSearch(); + + /** The condition key of notLikeSearch. */ + public static final ConditionKey CK_NOT_LIKE_SEARCH = new ConditionKeyNotLikeSearch(); + /** The condition key of isNull. */ public static final ConditionKey CK_IS_NULL = new ConditionKeyIsNull(); @@ -54,31 +61,21 @@ /** Dummy-object for IsNull and IsNotNull and so on... */ protected static final Object DUMMY_OBJECT = new Object(); + //========================================================================== + // ========= + // Attribute + // ========= /** Condition-key. */ protected String _conditionKey; /** Operand. */ protected String _operand; + //========================================================================== + // ========= + // Validation + // ========== /** - * Get condition-key. - * - * @return Condition-key. - */ - public String getConditionKey() { - return _conditionKey; - } - - /** - * Get operand. - * - * @return Operand. - */ - public String getOperand() { - return _operand; - } - - /** * Is valid registration? * * @param conditionValue Condition value. (NotNull) @@ -89,6 +86,10 @@ abstract public boolean isValidRegistration(ConditionValue conditionValue, Object value, String callerName); + //========================================================================== + // ========= + // Where Clause + // ============ /** * Add where clause. * @@ -149,6 +150,10 @@ abstract protected void doAddWhereClause(List conditionList, String columnName, ConditionValue value, ConditionOption option); + //========================================================================== + // ========= + // Condition Value + // =============== /** * Setup condition value. * @@ -210,6 +215,10 @@ ConditionValue conditionValue, Object value, String location, ConditionOption option); + //========================================================================== + // ========= + // Bind Clause + // =========== /** * Build bind clause. (for s2dao) * @@ -269,6 +278,10 @@ return "%"; } + //========================================================================== + // ========= + // Basic Override + // ============== /** * The override. Returns hash-code of this condition-key string. * @@ -304,4 +317,26 @@ return "ConditionKey: " + getConditionKey() + " " + getOperand() + " wild-card=[" + getWildCard() + "]"; } + + //========================================================================== + // ========= + // Accessor + // ======== + /** + * Get condition-key. + * + * @return Condition-key. + */ + public String getConditionKey() { + return _conditionKey; + } + + /** + * Get operand. + * + * @return Operand. + */ + public String getOperand() { + return _operand; + } } Added: bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/cbean/ckey/ConditionKeyNotLikeSearch.java =================================================================== --- bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/cbean/ckey/ConditionKeyNotLikeSearch.java (rev 0) +++ bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/cbean/ckey/ConditionKeyNotLikeSearch.java 2008-12-27 22:11:51 UTC (rev 1627) @@ -0,0 +1,104 @@ +package jp.sf.pal.bookmark.db.allcommon.cbean.ckey; + +import java.util.List; + +import jp.sf.pal.bookmark.db.allcommon.cbean.coption.ConditionOption; +import jp.sf.pal.bookmark.db.allcommon.cbean.coption.LikeSearchOption; +import jp.sf.pal.bookmark.db.allcommon.cbean.cvalue.ConditionValue; + +/** + * The condition-key of notLikeSearch. + * + * @author DBFlute(AutoGenerator) + */ +public class ConditionKeyNotLikeSearch extends ConditionKey { + + /** + * Constructor. + */ + protected ConditionKeyNotLikeSearch() { + _conditionKey = "notLikeSearch"; + _operand = "not like"; + } + + /** + * Is valid registration? + * + * @param conditionValue Condition value. (NotNull) + * @param value Value. (NotNull) + * @param callerName Caller name. (NotNull) + * @return Determination. + */ + public boolean isValidRegistration(ConditionValue conditionValue, + Object value, String callerName) { + if (value == null) { + return false; + } + return true; + } + + /** + * This method implements super#doAddWhereClause(). + * + * @param conditionList Condition list. (NotNull) + * @param columnName Column name. (NotNull) + * @param value Condition value. (NotNull) + */ + protected void doAddWhereClause(List 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 conditionList, + String columnName, ConditionValue value, ConditionOption option) { + if (option == null) { + String msg = "The argument[option] should not be null: columnName=" + + columnName + " value=" + value; + throw new IllegalArgumentException(msg); + } + if (!(option instanceof LikeSearchOption)) { + String msg = "The argument[option] should be LikeSearchOption: columnName=" + + columnName + " value=" + value; + throw new IllegalArgumentException(msg); + } + final LikeSearchOption myOption = (LikeSearchOption) option; + conditionList.add(buildBindClauseWithRearOption(columnName, value + .getNotLikeSearchLocation(), myOption.getRearOption())); + } + + /** + * This method implements super#doSetupConditionValue(). + * + * @param conditionValue Condition value. (NotNull) + * @param value Value. (NotNull) + * @param location Location. (NotNull) + */ + protected void doSetupConditionValue(ConditionValue conditionValue, + Object value, String location) { + throw new UnsupportedOperationException( + "doSetupConditionValue without condition-option is unsupported!!!"); + } + + /** + * This method implements super#doSetupConditionValue(). + * + * @param conditionValue Condition value. (NotNull) + * @param value Value. (NotNull) + * @param location Location. (NotNull) + * @param option Condition option. (NotNull) + */ + protected void doSetupConditionValue(ConditionValue conditionValue, + Object value, String location, ConditionOption option) { + conditionValue.setNotLikeSearch((String) value, + (LikeSearchOption) option).setNotLikeSearchLocation(location); + } +} Property changes on: bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/cbean/ckey/ConditionKeyNotLikeSearch.java ___________________________________________________________________ Name: svn:eol-style + native Modified: bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/cbean/coption/FromToOption.java =================================================================== --- bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/cbean/coption/FromToOption.java 2008-12-27 22:10:35 UTC (rev 1626) +++ bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/cbean/coption/FromToOption.java 2008-12-27 22:11:51 UTC (rev 1627) @@ -1,5 +1,10 @@ package jp.sf.pal.bookmark.db.allcommon.cbean.coption; +import java.util.Calendar; +import java.util.Date; + +import jp.sf.pal.bookmark.db.allcommon.cbean.ckey.ConditionKey; + /** * The option of from-to. * @@ -85,60 +90,84 @@ // ========= // Internal Main // ============= - public java.util.Date filterFromDate(java.util.Date fromDate) { + /** + * Filter the date as From. It requires this method is called before + * getFromDateConditionKey(). + * + * @param fromDate The date as From. (Nullable: If the value is null, it + * returns null) + * @return The filtered date as From. (Nullable) + */ + public Date filterFromDate(Date fromDate) { if (fromDate == null) { return null; } if (_compareAsDate) { - final java.util.Calendar cal = java.util.Calendar.getInstance(); + final Calendar cal = Calendar.getInstance(); cal.setTimeInMillis(fromDate.getTime()); clearCalendarHourMinuteSecondMilli(cal); - final java.util.Date cloneDate = (java.util.Date) fromDate.clone(); + final Date cloneDate = (Date) fromDate.clone(); cloneDate.setTime(cal.getTimeInMillis()); return cloneDate; } return fromDate; } - public java.util.Date filterToDate(java.util.Date toDate) { + /** + * Filter the date as To. It requires this method is called before + * getToDateConditionKey(). + * + * @param toDate The date as To. (Nullable: If the value is null, it returns + * null) + * @return The filtered date as To. (Nullable) + */ + public Date filterToDate(Date toDate) { if (toDate == null) { return null; } if (_compareAsDate) { - final java.util.Calendar cal = java.util.Calendar.getInstance(); + final Calendar cal = Calendar.getInstance(); cal.setTimeInMillis(toDate.getTime()); clearCalendarHourMinuteSecondMilli(cal); addCalendarNextDay(cal);// Key Point! - final java.util.Date cloneDate = (java.util.Date) toDate.clone(); + final Date cloneDate = (Date) toDate.clone(); cloneDate.setTime(cal.getTimeInMillis()); return cloneDate; } return toDate; } - public jp.sf.pal.bookmark.db.allcommon.cbean.ckey.ConditionKey getFromDateConditionKey() { + /** + * Get the condition-key of the from-date. It requires this method is called + * after filterFromDate(). + * + * @return The condition-key of the from-date. (NotNull) + */ + public ConditionKey getFromDateConditionKey() { if (_compareAsDate) { - return jp.sf.pal.bookmark.db.allcommon.cbean.ckey.ConditionKey.CK_GREATER_EQUAL; + return ConditionKey.CK_GREATER_EQUAL; } if (_fromDateGreaterThan) { - return jp.sf.pal.bookmark.db.allcommon.cbean.ckey.ConditionKey.CK_GREATER_THAN;// Default - // ! + return ConditionKey.CK_GREATER_THAN;// Default! } else { - return jp.sf.pal.bookmark.db.allcommon.cbean.ckey.ConditionKey.CK_GREATER_EQUAL;// Default - // ! + return ConditionKey.CK_GREATER_EQUAL;// Default! } } - public jp.sf.pal.bookmark.db.allcommon.cbean.ckey.ConditionKey getToDateConditionKey() { + /** + * Get the condition-key of the to-date. It requires this method is called + * after filterToDate(). + * + * @return The condition-key of the to-date. (NotNull) + */ + public ConditionKey getToDateConditionKey() { if (_compareAsDate) { - return jp.sf.pal.bookmark.db.allcommon.cbean.ckey.ConditionKey.CK_LESS_THAN; + return ConditionKey.CK_LESS_THAN; } if (_toDateLessThan) { - return jp.sf.pal.bookmark.db.allcommon.cbean.ckey.ConditionKey.CK_LESS_THAN;// Default - // ! + return ConditionKey.CK_LESS_THAN;// Default! } else { - return jp.sf.pal.bookmark.db.allcommon.cbean.ckey.ConditionKey.CK_LESS_EQUAL;// Default - // ! + return ConditionKey.CK_LESS_EQUAL;// Default! } } @@ -146,15 +175,15 @@ // ========= // Calendar Helper // =============== - protected void addCalendarNextDay(java.util.Calendar cal) { - cal.add(java.util.Calendar.DAY_OF_MONTH, 1); + protected void addCalendarNextDay(Calendar cal) { + cal.add(Calendar.DAY_OF_MONTH, 1); } - protected void clearCalendarHourMinuteSecondMilli(java.util.Calendar cal) { - cal.clear(java.util.Calendar.MILLISECOND); - cal.clear(java.util.Calendar.SECOND); - cal.clear(java.util.Calendar.MINUTE); - cal.set(java.util.Calendar.HOUR_OF_DAY, cal - .getActualMinimum(java.util.Calendar.HOUR_OF_DAY)); + protected void clearCalendarHourMinuteSecondMilli(Calendar cal) { + cal.clear(Calendar.MILLISECOND); + cal.clear(Calendar.SECOND); + cal.clear(Calendar.MINUTE); + cal.set(Calendar.HOUR_OF_DAY, cal + .getActualMinimum(Calendar.HOUR_OF_DAY)); } } Modified: bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/cbean/coption/LikeSearchOption.java =================================================================== --- bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/cbean/coption/LikeSearchOption.java 2008-12-27 22:10:35 UTC (rev 1626) +++ bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/cbean/coption/LikeSearchOption.java 2008-12-27 22:11:51 UTC (rev 1627) @@ -4,6 +4,7 @@ import java.util.Iterator; import java.util.List; +import jp.sf.pal.bookmark.db.allcommon.DBDef; import jp.sf.pal.bookmark.db.allcommon.cbean.coption.parts.local.JapaneseOptionPartsAgent; /** @@ -230,6 +231,10 @@ String tmp = replace(value, _escape, _escape + _escape); tmp = replace(tmp, "%", _escape + "%"); tmp = replace(tmp, "_", _escape + "_"); + if (DBDef.isCurrentDef(DBDef.Oracle)) { + tmp = replace(tmp, "\uff05", _escape + "\uff05"); + tmp = replace(tmp, "\uff3f", _escape + "\uff3f"); + } value = tmp; } final String wildCard = "%"; Modified: bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/cbean/cvalue/ConditionValue.java =================================================================== --- bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/cbean/cvalue/ConditionValue.java 2008-12-27 22:10:35 UTC (rev 1626) +++ bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/cbean/cvalue/ConditionValue.java 2008-12-27 22:11:51 UTC (rev 1627) @@ -6,9 +6,10 @@ import jp.sf.pal.bookmark.db.allcommon.cbean.coption.InScopeOption; import jp.sf.pal.bookmark.db.allcommon.cbean.coption.LikeSearchOption; +import jp.sf.pal.bookmark.db.allcommon.util.SimpleTypeUtil; /** - * Condition value. + * Condition-value. * * @author DBFlute(AutoGenerator) */ @@ -578,110 +579,9 @@ //========================================================================== // ========= - // Like Search - // =========== - /** Value of likeSearch. */ - protected List _likeSearch; - - /** Value of likeSearch for spare. */ - protected List _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(); - _likeSearch4Spare = new ArrayList(); - } - if (_likeSearch.isEmpty() && !_likeSearch4Spare.isEmpty()) { - for (int index = 0; index < _likeSearch4Spare.size(); index++) { - _likeSearch.add(_likeSearch4Spare.get(index)); - } - } - LikeSearchValue likeSearchValue = new LikeSearchValue(value, option); - _likeSearch.add(likeSearchValue); - _likeSearch4Spare.add(likeSearchValue); - return this; - } - - /** Location of likeSearch. */ - protected String _likeSearchLocation; - - /** - * Get the location of likeSearch. - * - * @return The location of likeSearch. (Nullable) - */ - public String getLikeSearchLocation() { - return _likeSearchLocation; - } - - /** - * Set the location of likeSearch. - * - * @param location The location of likeSearch. (Nullable) - * @return this. (NotNull) - */ - public ConditionValue setLikeSearchLocation(String location) { - _likeSearchLocation = location; - return this; - } - - protected static class LikeSearchValue { - protected String _value; - - protected LikeSearchOption _option; - - public LikeSearchValue(String value, LikeSearchOption option) { - _value = value; - _option = option; - } - - public String getValue() { - return _value; - } - - public LikeSearchOption getOption() { - return _option; - } - - public String generateRealValue() { - if (_option == null) { - return _value; - } - return _option.generateRealValue(_value); - } - } - - //========================================================================== - // ========= // In Scope // ======== - /** Value of inScope. */ + /** The value of inScope. */ protected List _inScope; protected InScopeOption _inScopeOption; @@ -774,7 +674,7 @@ // ========= // Not In Scope // ============ - /** Value of notInScope. */ + /** The value of notInScope. */ protected List _notInScope; /** @@ -852,6 +752,207 @@ //========================================================================== // ========= + // Like Search + // =========== + /** The value of likeSearch. */ + protected List _likeSearch; + + /** The value of likeSearch for spare. */ + protected List _likeSearch4Spare; + + /** + * Get the value of likeSearch. + * + * @return The value of likeSearch. (Nullable) + */ + public String getLikeSearch() { + if (_likeSearch == null) { + return null; + } + if (_likeSearch.isEmpty() && !_likeSearch4Spare.isEmpty()) { + for (int index = 0; index < _likeSearch4Spare.size(); index++) { + _likeSearch.add(_likeSearch4Spare.get(index)); + } + } + final LikeSearchValue likeSearchValue = _likeSearch.remove(0); + return (String) filterValue(likeSearchValue.generateRealValue()); + } + + /** + * Set the value of likeSearch. + * + * @param value The value of likeSearch. (Nullable) + * @param option The option of likeSearch. (Nullable) + * @return this. (NotNull) + */ + public ConditionValue setLikeSearch(String value, LikeSearchOption option) { + if (_likeSearch == null) { + _likeSearch = new ArrayList(); + _likeSearch4Spare = new ArrayList(); + } + if (_likeSearch.isEmpty() && !_likeSearch4Spare.isEmpty()) { + for (int index = 0; index < _likeSearch4Spare.size(); index++) { + _likeSearch.add(_likeSearch4Spare.get(index)); + } + } + LikeSearchValue likeSearchValue = new LikeSearchValue(value, option); + _likeSearch.add(likeSearchValue); + _likeSearch4Spare.add(likeSearchValue); + return this; + } + + /** Location of likeSearch. */ + protected String _likeSearchLocation; + + /** + * Get the location of likeSearch. + * + * @return The location of likeSearch. (Nullable) + */ + public String getLikeSearchLocation() { + return _likeSearchLocation; + } + + /** + * Set the location of likeSearch. + * + * @param location The location of likeSearch. (Nullable) + * @return this. (NotNull) + */ + public ConditionValue setLikeSearchLocation(String location) { + _likeSearchLocation = location; + return this; + } + + protected static class LikeSearchValue { + protected String _value; + + protected LikeSearchOption _option; + + public LikeSearchValue(String value, LikeSearchOption option) { + _value = value; + _option = option; + } + + public String getValue() { + return _value; + } + + public LikeSearchOption getOption() { + return _option; + } + + public String generateRealValue() { + if (_option == null) { + return _value; + } + return _option.generateRealValue(_value); + } + } + + //========================================================================== + // ========= + // Not Like Search + // =============== + /** The value of notLikeSearch. */ + protected List _notLikeSearch; + + /** The value of notLikeSearch for spare. */ + protected List _notLikeSearch4Spare; + + /** + * Get the value of notLikeSearch. + * + * @return The value of notLikeSearch. (Nullable) + */ + public String getNotLikeSearch() { + if (_notLikeSearch == null) { + return null; + } + if (_notLikeSearch.isEmpty() && !_notLikeSearch4Spare.isEmpty()) { + for (int index = 0; index < _notLikeSearch4Spare.size(); index++) { + _notLikeSearch.add(_notLikeSearch4Spare.get(index)); + } + } + final NotLikeSearchValue notLikeSearchValue = _notLikeSearch.remove(0); + return (String) filterValue(notLikeSearchValue.generateRealValue()); + } + + /** + * Set the value of notLikeSearch. + * + * @param value The value of notLikeSearch. (Nullable) + * @param option The option of notLikeSearch. (Nullable) + * @return this. (NotNull) + */ + public ConditionValue setNotLikeSearch(String value, LikeSearchOption option) { + if (_notLikeSearch == null) { + _notLikeSearch = new ArrayList(); + _notLikeSearch4Spare = new ArrayList(); + } + if (_notLikeSearch.isEmpty() && !_notLikeSearch4Spare.isEmpty()) { + for (int index = 0; index < _notLikeSearch4Spare.size(); index++) { + _notLikeSearch.add(_notLikeSearch4Spare.get(index)); + } + } + NotLikeSearchValue notLikeSearchValue = new NotLikeSearchValue(value, + option); + _notLikeSearch.add(notLikeSearchValue); + _notLikeSearch4Spare.add(notLikeSearchValue); + return this; + } + + /** Location of notLikeSearch. */ + protected String _notLikeSearchLocation; + + /** + * Get the location of notLikeSearch. + * + * @return The location of notLikeSearch. (Nullable) + */ + public String getNotLikeSearchLocation() { + return _notLikeSearchLocation; + } + + /** + * Set the location of notLikeSearch. + * + * @param location The location of notLikeSearch. (Nullable) + * @return this. (NotNull) + */ + public ConditionValue setNotLikeSearchLocation(String location) { + _notLikeSearchLocation = location; + return this; + } + + protected static class NotLikeSearchValue { + protected String _value; + + protected LikeSearchOption _option; + + public NotLikeSearchValue(String value, LikeSearchOption option) { + _value = value; + _option = option; + } + + public String getValue() { + return _value; + } + + public LikeSearchOption getOption() { + return _option; + } + + public String generateRealValue() { + if (_option == null) { + return _value; + } + return _option.generateRealValue(_value); + } + } + + //========================================================================== + // ========= // Is Null // ======= /** Value of isNull. */ @@ -976,8 +1077,8 @@ * Filter value. If the value is instance of java.util.Date or * java.util.Calendar, returns value as java.sql.Date. * - * @param value Value. (Nullable) - * @return Filtered value. (Nullable) + * @param value The value. (Nullable) + * @return The filtered value. (Nullable) */ protected Object filterValue(Object value) { if (value == null) { @@ -991,18 +1092,18 @@ } if (value instanceof java.util.Date || value instanceof java.util.Calendar) { - return SqlDateConversionUtil.toDate(value); + return SimpleTypeUtil.toSqlDate(value); } else { return value; } } /** - * Filter value. If the value is instance of java.util.Date or + * Filter the list of value. If the value is instance of java.util.Date or * java.util.Calendar, returns value as java.sql.Date. * - * @param valueList Value-list. (Nullable) - * @return Filtered value-list. (Nullable) + * @param valueList The list of value. (Nullable) + * @return The filtered list of value. (Nullable) */ protected List filterValue(List valueList) { if (valueList == null || valueList.isEmpty()) { @@ -1015,204 +1116,4 @@ } return resultList; } - - protected static class SqlDateConversionUtil { - - private SqlDateConversionUtil() { - } - - public static java.sql.Date toDate(Object o) { - return toDate(o, null); - } - - public static java.sql.Date toDate(Object o, String pattern) { - if (o instanceof java.sql.Date) { - return (java.sql.Date) o; - } - java.util.Date date = DateConversionUtil.toDate(o, pattern); - if (date != null) { - return new java.sql.Date(date.getTime()); - } - return null; - } - } - - protected static class DateConversionUtil { - - private DateConversionUtil() { - } - - public static java.util.Date toDate(Object o) { - return toDate(o, null); - } - - public static java.util.Date toDate(Object o, String pattern) { - if (o == null) { - return null; - } else if (o instanceof String) { - return toDate((String) o, pattern); - } else if (o instanceof java.util.Date) { - return (java.util.Date) o; - } else if (o instanceof java.util.Calendar) { - return ((java.util.Calendar) o).getTime(); - } else { - return toDate(o.toString(), pattern); - } - } - - public static java.util.Date toDate(String s, String pattern) { - return toDate(s, pattern, java.util.Locale.getDefault()); - } - - public static java.util.Date toDate(String s, String pattern, - java.util.Locale locale) { - java.text.SimpleDateFormat sdf = getDateFormat(s, pattern, locale); - try { - return sdf.parse(s); - } catch (java.text.ParseException ex) { - throw new RuntimeException(ex); - } - } - - public static java.text.SimpleDateFormat getDateFormat(String s, - String pattern, java.util.Locale locale) { - if (pattern != null) { - return new java.text.SimpleDateFormat(pattern); - } - return getDateFormat(s, locale); - } - - public static java.text.SimpleDateFormat getDateFormat(String s, - java.util.Locale locale) { - String pattern = getPattern(locale); - String shortPattern = removeDelimiter(pattern); - String delimitor = findDelimiter(s); - if (delimitor == null) { - if (s.length() == shortPattern.length()) { - return new java.text.SimpleDateFormat(shortPattern); - } - if (s.length() == shortPattern.length() + 2) { - return new java.text.SimpleDateFormat(InternalStringUtil - .replace(shortPattern, "yy", "yyyy")); - } - } else { - String[] array = InternalStringUtil.split(s, delimitor); - for (int i = 0; i < array.length; ++i) { - if (array[i].length() == 4) { - pattern = InternalStringUtil.replace(pattern, "yy", - "yyyy"); - break; - } - } - return new java.text.SimpleDateFormat(pattern); - } - return new java.text.SimpleDateFormat(); - } - - public static java.text.SimpleDateFormat getDateFormat( - java.util.Locale locale) { - return new java.text.SimpleDateFormat(getPattern(locale)); - } - - public static java.text.SimpleDateFormat getY4DateFormat( - java.util.Locale locale) { - return new java.text.SimpleDateFormat(getY4Pattern(locale)); - } - - public static String getY4Pattern(java.util.Locale locale) { - String pattern = getPattern(locale); - if (pattern.indexOf("yyyy") < 0) { - pattern = InternalStringUtil.replace(pattern, "yy", "yyyy"); - } - return pattern; - } - - public static String getPattern(java.util.Locale locale) { - java.text.SimpleDateFormat df = (java.text.SimpleDateFormat) java.text.DateFormat - .getDateInstance(java.text.DateFormat.SHORT, locale); - String pattern = df.toPattern(); - int index = pattern.indexOf(' '); - if (index > 0) { - pattern = pattern.substring(0, index); - } - if (pattern.indexOf("MM") < 0) { - pattern = InternalStringUtil.replace(pattern, "M", "MM"); - } - if (pattern.indexOf("dd") < 0) { - pattern = InternalStringUtil.replace(pattern, "d", "dd"); - } - return pattern; - } - - public static String findDelimiter(String value) { - for (int i = 0; i < value.length(); ++i) { - char c = value.charAt(i); - if (Character.isDigit(c)) { - continue; - } - return Character.toString(c); - } - return null; - } - - public static String removeDelimiter(String pattern) { - StringBuffer buf = new StringBuffer(); - for (int i = 0; i < pattern.length(); ++i) { - char c = pattern.charAt(i); - if (c == 'y' || c == 'M' || c == 'd') { - buf.append(c); - } - } - return buf.toString(); - } - } - - protected static class InternalStringUtil { - public static final String[] EMPTY_STRINGS = new String[0]; - - private InternalStringUtil() { - } - - public static final boolean isEmpty(String text) { - return text == null || text.length() == 0; - } - - public static final String replace(String text, String fromText, - String toText) { - if (text == null || fromText == null || toText == null) { - return null; - } - StringBuffer buf = new StringBuffer(100); - int pos = 0; - int pos2 = 0; - while (true) { - pos = text.indexOf(fromText, pos2); - if (pos == 0) { - buf.append(toText); - pos2 = fromText.length(); - } else if (pos > 0) { - buf.append(text.substring(pos2, pos)); - buf.append(toText); - pos2 = pos + fromText.length(); - } else { - buf.append(text.substring(pos2)); - break; - } - } - return buf.toString(); - } - - public static String[] split(String str, String delim) { - if (str == null) { - return EMPTY_STRINGS; - } - List list = new java.util.ArrayList(); - java.util.StringTokenizer st = new java.util.StringTokenizer(str, - delim); - while (st.hasMoreElements()) { - list.add(st.nextToken()); - } - return (String[]) list.toArray(new String[list.size()]); - } - } } Modified: bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/cbean/outsidesql/OutsideSqlContext.java =================================================================== --- bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/cbean/outsidesql/OutsideSqlContext.java 2008-12-27 22:10:35 UTC (rev 1626) +++ bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/cbean/outsidesql/OutsideSqlContext.java 2008-12-27 22:11:51 UTC (rev 1627) @@ -1,17 +1,21 @@ package jp.sf.pal.bookmark.db.allcommon.cbean.outsidesql; +import java.io.BufferedReader; +import java.io.IOException; +import java.io.InputStream; +import java.io.InputStreamReader; +import java.io.Reader; + import jp.sf.pal.bookmark.db.allcommon.DBFluteConfig; import jp.sf.pal.bookmark.db.allcommon.dbmeta.DBMeta; import jp.sf.pal.bookmark.db.allcommon.dbmeta.DBMetaInstanceHandler; import jp.sf.pal.bookmark.db.allcommon.jdbc.StatementConfig; +import jp.sf.pal.bookmark.db.allcommon.util.SimpleResourceUtil; import jp.sf.pal.bookmark.db.allcommon.util.SimpleStringUtil; import jp.sf.pal.bookmark.db.allcommon.util.SimpleSystemUtil; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; -import org.seasar.framework.util.InputStreamReaderUtil; -import org.seasar.framework.util.ReaderUtil; -import org.seasar.framework.util.ResourceUtil; /** * The context of outside-SQL. @@ -33,7 +37,7 @@ /** * Get outside-SQL context on thread. * - * @return Outside-SQL context. (Nullable) + * @return The context of outside-SQL. (Nullable) */ public static OutsideSqlContext getOutsideSqlContextOnThread() { return (OutsideSqlContext) _threadLocal.get(); @@ -42,7 +46,7 @@ /** * Set outside-SQL context on thread. * - * @param outsideSqlContext Outside-SQL context. (NotNull) + * @param outsideSqlContext The context of outside-SQL. (NotNull) */ public static void setOutsideSqlContextOnThread( OutsideSqlContext outsideSqlContext) { @@ -54,7 +58,7 @@ } /** - * Is existing outside-SQL context on thread? + * Is existing the context of outside-SQL on thread? * * @return Determination. */ @@ -63,7 +67,7 @@ } /** - * Clear outside-SQL context on thread. + * Clear the context of outside-SQL on thread. */ public static void clearOutsideSqlContextOnThread() { _threadLocal.set(null); @@ -77,12 +81,20 @@ String methodName, String path, Object pmb, OutsideSqlOption option, Object resultTypeSpecification) { final String pmbKey = (pmb != null ? pmb.getClass().getName() : "null"); - final String resultKey = (resultTypeSpecification != null ? ":" - + resultTypeSpecification : "null"); + final String resultKey; + if (resultTypeSpecification != null) { + if (resultTypeSpecification instanceof Class) { + resultKey = ((Class) resultTypeSpecification).getName(); + } else { + resultKey = resultTypeSpecification.toString(); + } + } else { + resultKey = "null"; + } final String tableDbName = option.getTableDbName(); final String generatedUniqueKey = option.generateUniqueKey(); - return methodName + "():" + tableDbName + ":" + path + ":" + pmbKey - + ":" + generatedUniqueKey + resultKey; + return tableDbName + ":" + methodName + "():" + path + ":" + pmbKey + + ":" + generatedUniqueKey + ":" + resultKey; } //========================================================================== @@ -116,18 +128,9 @@ // Attribute // ========= // ----------------------------------------------------- - // Common of OutsideSql - // -------------------- - protected boolean _dynamicBinding; - - protected boolean _offsetByCursorForcedly; - - protected boolean _limitByCursorForcedly; - - // ----------------------------------------------------- - // Specified OutsideSql - // -------------------- - /** The path of outside-sql. (The mark of Specified-OutsideSql) */ + // Basic + // ----- + /** The path of outside-SQL. (The mark of specified outside-SQL) */ protected String _outsideSqlPath; protected Object _parameterBean; @@ -136,12 +139,23 @@ protected String _methodName; - /** The config of statement. (Nullable) */ + /** The configuration of statement. (Nullable) */ protected StatementConfig _statementConfig; /** The DB name of table for using behavior-SQL-path. (Nullable) */ protected String _tableDbName; + // ----------------------------------------------------- + // Option + // ------ + protected boolean _dynamicBinding; + + protected boolean _offsetByCursorForcedly; + + protected boolean _limitByCursorForcedly; + + protected boolean _autoPagingLogging; // for logging + //========================================================================== // ========= // Read SQL @@ -200,7 +214,7 @@ } /** - * Read outside-sql path. Required attribute is 'outsideSqlPath'. + * Read outside-SQL path. Required attribute is 'outsideSqlPath'. * * @param sqlFileEncoding The encoding of SQL file. (NotNull) * @param dbmsSuffix The suffix of DBMS. (NotNull) @@ -214,6 +228,13 @@ String sql; if (isExistResource(dbmsPath)) { sql = readText(dbmsPath, sqlFileEncoding); + } else if ("_postgresql".equals(dbmsSuffix) + && isExistResource("_postgre")) { + sql = readText("_postgre", sqlFileEncoding); // Patch for name + // difference + } else if ("_sqlserver".equals(dbmsSuffix) && isExistResource("_mssql")) { + sql = readText("_mssql", sqlFileEncoding); // Patch for name + // difference } else if (isExistResource(standardPath)) { sql = readText(standardPath, sqlFileEncoding); } else { @@ -324,16 +345,46 @@ // General Helper // ============== protected boolean isExistResource(String path) { - return ResourceUtil.isExist(path); + return SimpleResourceUtil.isExist(path); } protected String readText(final String path, String sqlFileEncoding) { - final java.io.InputStream is = ResourceUtil.getResourceAsStream(path); - final java.io.Reader reader = InputStreamReaderUtil.create(is, - sqlFileEncoding); - return ReaderUtil.readText(reader); + final InputStream ins = SimpleResourceUtil.getResourceStream(path); + final Reader reader = createInputStreamReader(ins, sqlFileEncoding); + return readText(reader); } + protected Reader createInputStreamReader(InputStream ins, String encoding) { + try { + return new InputStreamReader(ins, encoding); + } catch (IOException e) { + String msg = "Failed to create the reader of the input stream:"; + msg = msg + " ins=" + ins + " encoding=" + encoding; + throw new IllegalStateException(msg, e); + } + } + + public String readText(Reader reader) { + final BufferedReader bfreader = new BufferedReader(reader); + final StringBuilder out = new StringBuilder(100); + try { + try { + final char[] buf = new char[8192]; + int n; + while ((n = bfreader.read(buf)) >= 0) { + out.append(buf, 0, n); + } + } finally { + bfreader.close(); + } + } catch (IOException e) { + String msg = "Failed to read the input stream:"; + msg = msg + " bfreader=" + bfreader + " reader=" + reader; + throw new IllegalStateException(msg, e); + } + return out.toString(); + } + protected static String replaceString(String text, String fromText, String toText) { return SimpleStringUtil.replace(text, fromText, toText); @@ -348,35 +399,8 @@ // Accessor // ======== // ----------------------------------------------------- - // Common of OutsideSql - // -------------------- - public boolean isDynamicBinding() { - return _dynamicBinding; - } - - public void setDynamicBinding(boolean dynamicBinding) { - this._dynamicBinding = dynamicBinding; - } - - public boolean isOffsetByCursorForcedly() { - return _offsetByCursorForcedly; - } - - public void setOffsetByCursorForcedly(boolean offsetByCursorForcedly) { - this._offsetByCursorForcedly = offsetByCursorForcedly; - } - - public boolean isLimitByCursorForcedly() { - return _limitByCursorForcedly; - } - - public void setLimitByCursorForcedly(boolean limitByCursorForcedly) { - this._limitByCursorForcedly = limitByCursorForcedly; - } - - // ----------------------------------------------------- - // Specified OutsideSql - // -------------------- + // Basic + // ----- public String getOutsideSqlPath() { return _outsideSqlPath; } @@ -424,4 +448,39 @@ public void setTableDbName(String tableDbName) { this._tableDbName = tableDbName; } + + // ----------------------------------------------------- + // Option + // ------ + public boolean isDynamicBinding() { + return _dynamicBinding; + } + + public void setDynamicBinding(boolean dynamicBinding) { + this._dynamicBinding = dynamicBinding; + } + + public boolean isOffsetByCursorForcedly() { + return _offsetByCursorForcedly; + } + + public void setOffsetByCursorForcedly(boolean offsetByCursorForcedly) { + this._offsetByCursorForcedly = offsetByCursorForcedly; + } + + public boolean isLimitByCursorForcedly() { + return _limitByCursorForcedly; + } + + public void setLimitByCursorForcedly(boolean limitByCursorForcedly) { + this._limitByCursorForcedly = limitByCursorForcedly; + } + + public boolean isAutoPagingLogging() { // for logging + return _autoPagingLogging; + } + + public void setAutoPagingLogging(boolean autoPagingLogging) { // for logging + this._autoPagingLogging = autoPagingLogging; + } } Deleted: bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/cbean/outsidesql/OutsideSqlDao.java =================================================================== --- bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/cbean/outsidesql/OutsideSqlDao.java 2008-12-27 22:10:35 UTC (rev 1626) +++ bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/cbean/outsidesql/OutsideSqlDao.java 2008-12-27 22:11:51 UTC (rev 1627) @@ -1,37 +0,0 @@ -package jp.sf.pal.bookmark.db.allcommon.cbean.outsidesql; - -import java.util.List; - -import jp.sf.pal.bookmark.db.allcommon.DaoReadable; -import jp.sf.pal.bookmark.db.allcommon.jdbc.CursorHandler; - -/** - * The dao of outside-sql. - * - * @author DBFlute(AutoGenerator) - */ -public interface OutsideSqlDao extends DaoReadable { - - //========================================================================== - // ========= - // Select - // ====== - List selectList(String path, Object pmb, - OutsideSqlOption option, Class entityType); - - Object selectCursor(String path, Object pmb, - OutsideSqlOption option, CursorHandler handler); - - //========================================================================== - // ========= - // Execute - // ======= - int execute(String path, Object pmb, OutsideSqlOption option); - - // [DBFlute-0.7.5] - //========================================================================== - // ========= - // Call - // ==== - void call(String path, Object pmb, OutsideSqlOption option); -} Modified: bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/cbean/outsidesql/OutsideSqlOption.java =================================================================== --- bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/cbean/outsidesql/OutsideSqlOption.java 2008-12-27 22:10:35 UTC (rev 1626) +++ bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/cbean/outsidesql/OutsideSqlOption.java 2008-12-27 22:11:51 UTC (rev 1627) @@ -16,6 +16,7 @@ // ----------------------------------------------------- // Option // ------ + /** The request type of paging. */ protected String _pagingRequestType = "non"; protected boolean _dynamicBinding; @@ -23,6 +24,8 @@ /** The configuration of statement. (Nullable) */ protected StatementConfig _statementConfig; + protected String _sourcePagingRequestType = "non"; + // ----------------------------------------------------- // Information // ----------- @@ -59,6 +62,7 @@ // ==== public OutsideSqlOption copyOptionWithoutPaging() { final OutsideSqlOption copyOption = new OutsideSqlOption(); + copyOption.setPagingSourceRequestType(_pagingRequestType); if (isDynamicBinding()) { copyOption.dynamicBinding(); } @@ -103,6 +107,15 @@ _statementConfig = statementConfig; } + protected void setPagingSourceRequestType(String sourcePagingRequestType) { // Very + // Internal + _sourcePagingRequestType = sourcePagingRequestType; + } + + public boolean isSourcePagingRequestTypeAuto() { // Very Internal + return "auto".equals(_sourcePagingRequestType); + } + // ----------------------------------------------------- // Information // ----------- Modified: bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/cbean/outsidesql/executor/OutsideSqlBasicExecutor.java =================================================================== --- bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/cbean/outsidesql/executor/OutsideSqlBasicExecutor.java 2008-12-27 22:10:35 UTC (rev 1626) +++ bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/cbean/outsidesql/executor/OutsideSqlBasicExecutor.java 2008-12-27 22:11:51 UTC (rev 1627) @@ -2,15 +2,20 @@ import java.util.List; +import jp.sf.pal.bookmark.db.allcommon.bhv.core.BehaviorCommand; +import jp.sf.pal.bookmark.db.allcommon.bhv.core.BehaviorCommandInvoker; +import jp.sf.pal.bookmark.db.allcommon.bhv.core.command.AbstractOutsideSqlCommand; +import jp.sf.pal.bookmark.db.allcommon.bhv.core.command.OutsideSqlCallCommand; +import jp.sf.pal.bookmark.db.allcommon.bhv.core.command.OutsideSqlExecuteCommand; +import jp.sf.pal.bookmark.db.allcommon.bhv.core.command.OutsideSqlSelectListCommand; import jp.sf.pal.bookmark.db.allcommon.cbean.ListResultBean; import jp.sf.pal.bookmark.db.allcommon.cbean.ResultBeanBuilder; -import jp.sf.pal.bookmark.db.allcommon.cbean.outsidesql.OutsideSqlDao; import jp.sf.pal.bookmark.db.allcommon.cbean.outsidesql.OutsideSqlOption; import jp.sf.pal.bookmark.db.allcommon.cbean.outsidesql.ProcedurePmb; import jp.sf.pal.bookmark.db.allcommon.jdbc.StatementConfig; /** - * The executor of outside-sql.
+ * The executor of outside-SQL.
* *
  * {Basic}
@@ -33,7 +38,6 @@
  * 
  * {Option -- Dynamic}
  *   o dynamicBinding().selectList()
- * 
  * 
* * @author DBFlute(AutoGenerator) @@ -44,8 +48,8 @@ // ========= // Attribute // ========= - /** The DAO of outside-sql. (NotNull) */ - protected final OutsideSqlDao _outsideSqlDao; + /** The invoker of behavior command. (NotNull) */ + protected final BehaviorCommandInvoker _behaviorCommandInvoker; /** Table DB name. (NotNull) */ protected final String _tableDbName; @@ -60,9 +64,9 @@ // ========= // Constructor // =========== - public OutsideSqlBasicExecutor(OutsideSqlDao outsideSqlDao, - String tableDbName) { - this._outsideSqlDao = outsideSqlDao; + public OutsideSqlBasicExecutor( + BehaviorCommandInvoker behaviorCommandInvoker, String tableDbName) { + this._behaviorCommandInvoker = behaviorCommandInvoker; this._tableDbName = tableDbName; } @@ -80,12 +84,12 @@ * @param entityType The element type of entity. (NotNull) * @return The result bean of selected list. (NotNull) * @exception jp.sf.pal.bookmark.db.allcommon.exception.OutsideSqlNotFoundException - * When the outside-sql is not found. + * When the outside-SQL is not found. */ public ListResultBean selectList(String path, Object pmb, Class entityType) { - List resultList = _outsideSqlDao.selectList(path, pmb, - createOutsideSqlOption(), entityType); + List resultList = invoke(createSelectListCommand(path, pmb, + entityType)); return new ResultBeanBuilder(_tableDbName) .buildListResultBean(resultList); } @@ -102,10 +106,10 @@ * object. (Nullable) * @return The count of execution. * @exception jp.sf.pal.bookmark.db.allcommon.exception.OutsideSqlNotFoundException - * When the outside-sql is not found. + * When the outside-SQL is not found. */ public int execute(String path, Object pmb) { - return _outsideSqlDao.execute(path, pmb, createOutsideSqlOption()); + return invoke(createExecuteCommand(path, pmb)); } // [DBFlute-0.7.5] @@ -123,12 +127,53 @@ throw new IllegalArgumentException( "The argument of call() 'pmb' should not be null!"); } - _outsideSqlDao.call(pmb.getProcedureName(), pmb, - createOutsideSqlOption()); + invoke(createCallCommand(pmb.getProcedureName(), pmb)); } //========================================================================== // ========= + // Behavior Command + // ================ + protected BehaviorCommand> createSelectListCommand( + String path, Object pmb, Class entityType) { + final OutsideSqlSelectListCommand cmd = xsetupCommand( + new OutsideSqlSelectListCommand(), path, pmb); + cmd.setEntityType(entityType); + return cmd; + } + + protected BehaviorCommand createExecuteCommand(String path, + Object pmb) { + return xsetupCommand(new OutsideSqlExecuteCommand(), path, pmb); + } + + protected BehaviorCommand createCallCommand(String path, Object pmb) { + return xsetupCommand(new OutsideSqlCallCommand(), path, pmb); + } + + private > COMMAND xsetupCommand( + COMMAND command, String path, Object pmb) { + command.setTableDbName(_tableDbName); + _behaviorCommandInvoker.injectComponentProperty(command); + command.setOutsideSqlPath(path); + command.setParameterBean(pmb); + command.setOutsideSqlOption(createOutsideSqlOption()); + return command; + } + + /** + * Invoke the command of behavior. + * + * @param The type of result. + * @param behaviorCommand The command of behavior. (NotNull) + * @return The instance of result. (Nullable) + */ + protected RESULT invoke(BehaviorCommand behaviorCommand) { + return _behaviorCommandInvoker.invoke(behaviorCommand); + } + + //========================================================================== + // ========= // Option // ====== // ----------------------------------------------------- @@ -144,11 +189,11 @@ * # * * - * @return The cursor executor of outside-sql. (NotNull) + * @return The cursor executor of outside-SQL. (NotNull) */ public OutsideSqlCursorExecutor cursorHandling() { - return new OutsideSqlCursorExecutor(_outsideSqlDao, - createOutsideSqlOption()); + return new OutsideSqlCursorExecutor(_behaviorCommandInvoker, + createOutsideSqlOption(), _tableDbName); } /** @@ -161,11 +206,11 @@ * # * * - * @return The cursor executor of outside-sql. (NotNull) + * @return The cursor executor of outside-SQL. (NotNull) */ public OutsideSqlEntityExecutor entityHandling() { - return new OutsideSqlEntityExecutor(_outsideSqlDao, - createOutsideSqlOption()); + return new OutsideSqlEntityExecutor(_behaviorCommandInvoker, + createOutsideSqlOption(), _tableDbName); } // ----------------------------------------------------- @@ -191,7 +236,7 @@ public OutsideSqlPagingExecutor autoPaging() { final OutsideSqlOption option = createOutsideSqlOption(); option.autoPaging(); - return new OutsideSqlPagingExecutor(_outsideSqlDao, option, + return new OutsideSqlPagingExecutor(_behaviorCommandInvoker, option, _tableDbName); } @@ -215,7 +260,7 @@ public OutsideSqlPagingExecutor manualPaging() { final OutsideSqlOption option = createOutsideSqlOption(); option.manualPaging(); - return new OutsideSqlPagingExecutor(_outsideSqlDao, option, + return new OutsideSqlPagingExecutor(_behaviorCommandInvoker, option, _tableDbName); } Modified: bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/cbean/outsidesql/executor/OutsideSqlCursorExecutor.java =================================================================== --- bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/cbean/outsidesql/executor/OutsideSqlCursorExecutor.java 2008-12-27 22:10:35 UTC (rev 1626) +++ bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/cbean/outsidesql/executor/OutsideSqlCursorExecutor.java 2008-12-27 22:11:51 UTC (rev 1627) @@ -1,12 +1,14 @@ package jp.sf.pal.bookmark.db.allcommon.cbean.outsidesql.executor; -import jp.sf.pal.bookmark.db.allcommon.cbean.outsidesql.OutsideSqlDao; +import jp.sf.pal.bookmark.db.allcommon.bhv.core.BehaviorCommand; +import jp.sf.pal.bookmark.db.allcommon.bhv.core.BehaviorCommandInvoker; +import jp.sf.pal.bookmark.db.allcommon.bhv.core.command.OutsideSqlSelectCursorCommand; import jp.sf.pal.bookmark.db.allcommon.cbean.outsidesql.OutsideSqlOption; import jp.sf.pal.bookmark.db.allcommon.jdbc.CursorHandler; import jp.sf.pal.bookmark.db.allcommon.jdbc.StatementConfig; /** - * The cursor executor of outside-sql. + * The cursor executor of outside-SQL. * * @param The type of parameter-bean. * @author DBFlute(AutoGenerator) @@ -17,18 +19,25 @@ // ========= // Attribute // ========= - protected final OutsideSqlDao _outsideSqlDao; + /** The invoker of behavior command. (NotNull) */ + protected final BehaviorCommandInvoker _behaviorCommandInvoker; + /** The option of outside-SQL. (NotNull) */ protected final OutsideSqlOption _outsideSqlOption; + /** The DB name of table. (NotNull) */ + protected final String _tableDbName; + //========================================================================== // ========= // Constructor // =========== - public OutsideSqlCursorExecutor(OutsideSqlDao outsideSqlDao, - OutsideSqlOption outsideSqlOption) { - this._outsideSqlDao = outsideSqlDao; + public OutsideSqlCursorExecutor( + BehaviorCommandInvoker behaviorCommandInvoker, + OutsideSqlOption outsideSqlOption, String tableDbName) { + this._behaviorCommandInvoker = behaviorCommandInvoker; this._outsideSqlOption = outsideSqlOption; + this._tableDbName = tableDbName; } //========================================================================== @@ -44,14 +53,46 @@ * @param handler The handler of cursor. (NotNull) * @return The result object that the cursor handler returns. (Nullable) * @exception jp.sf.pal.bookmark.db.allcommon.exception.OutsideSqlNotFoundException - * When the outside-sql is not found. + * When the outside-SQL is not found. */ public Object selectCursor(String path, PARAMETER_BEAN pmb, CursorHandler handler) { - return _outsideSqlDao.selectCursor(path, pmb, _outsideSqlOption, + return invoke(createSelectCursorCommand(path, pmb, handler)); + } + + //========================================================================== + // ========= + // Behavior Command + // ================ + protected BehaviorCommand createSelectCursorCommand(String path, + PARAMETER_BEAN pmb, CursorHandler handler) { + return xsetupCommand(new OutsideSqlSelectCursorCommand(), path, pmb, handler); } + private OutsideSqlSelectCursorCommand xsetupCommand( + OutsideSqlSelectCursorCommand command, String path, + PARAMETER_BEAN pmb, CursorHandler handler) { + command.setTableDbName(_tableDbName); + _behaviorCommandInvoker.injectComponentProperty(command); + command.setOutsideSqlPath(path); + command.setParameterBean(pmb); + command.setOutsideSqlOption(_outsideSqlOption); + command.setCursorHandler(handler); + return command; + } + + /** + * Invoke the command of behavior. + * + * @param The type of result. + * @param behaviorCommand The command of behavior. (NotNull) + * @return The instance of result. (Nullable) + */ + protected RESULT invoke(BehaviorCommand behaviorCommand) { + return _behaviorCommandInvoker.invoke(behaviorCommand); + } + //========================================================================== // ========= // Option Modified: bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/cbean/outsidesql/executor/OutsideSqlEntityExecutor.java =================================================================== --- bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/cbean/outsidesql/executor/OutsideSqlEntityExecutor.java 2008-12-27 22:10:35 UTC (rev 1626) +++ bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/cbean/outsidesql/executor/OutsideSqlEntityExecutor.java 2008-12-27 22:11:51 UTC (rev 1627) @@ -2,14 +2,16 @@ import java.util.List; +import jp.sf.pal.bookmark.db.allcommon.bhv.core.BehaviorCommand; +import jp.sf.pal.bookmark.db.allcommon.bhv.core.BehaviorCommandInvoker; +import jp.sf.pal.bookmark.db.allcommon.bhv.core.command.OutsideSqlSelectListCommand; import jp.sf.pal.bookmark.db.allcommon.cbean.ConditionBeanContext; -import jp.sf.pal.bookmark.db.allcommon.cbean.outsidesql.OutsideSqlDao; import jp.sf.pal.bookmark.db.allcommon.cbean.outsidesql.OutsideSqlOption; import jp.sf.pal.bookmark.db.allcommon.jdbc.StatementConfig; import jp.sf.pal.bookmark.db.allcommon.util.SimpleSystemUtil; /** - * The cursor executor of outside-sql. + * The cursor executor of outside-SQL. * * @param The type of parameter-bean. * @author DBFlute(AutoGenerator) @@ -20,18 +22,25 @@ // ========= // Attribute // ========= - protected final OutsideSqlDao _outsideSqlDao; + /** The invoker of behavior command. (NotNull) */ + protected final BehaviorCommandInvoker _behaviorCommandInvoker; + /** The option of outside-SQL. (NotNull) */ protected final OutsideSqlOption _outsideSqlOption; + /** The DB name of table. (NotNull) */ + protected final String _tableDbName; + //========================================================================== // ========= // Constructor // =========== - public OutsideSqlEntityExecutor(OutsideSqlDao outsideSqlDao, - OutsideSqlOption outsideSqlOption) { - this._outsideSqlDao = outsideSqlDao; + public OutsideSqlEntityExecutor( + BehaviorCommandInvoker behaviorCommandInvoker, + OutsideSqlOption outsideSqlOption, String tableDbName) { + this._behaviorCommandInvoker = behaviorCommandInvoker; this._outsideSqlOption = outsideSqlOption; + this._tableDbName = tableDbName; } //========================================================================== @@ -48,14 +57,14 @@ * @param entityType The type of entity. (NotNull) * @return The selected entity. (Nullable) * @exception jp.sf.pal.bookmark.db.allcommon.exception.OutsideSqlNotFoundException - * When the outside-sql is not found. + * When the outside-SQL is not found. * @exception jp.sf.pal.bookmark.db.allcommon.exception.EntityDuplicatedException * When the entity is duplicated. */ public ENTITY selectEntity(String path, PARAMETER_BEAN pmb, Class entityType) { - final List ls = _outsideSqlDao.selectList(path, pmb, - _outsideSqlOption, entityType); + final List ls = invoke(createSelectListCommand(path, pmb, + entityType)); if (ls.isEmpty()) { return null; } @@ -76,7 +85,7 @@ * @param entityType The type of entity. (NotNull) * @return The selected entity. (Nullable) * @exception jp.sf.pal.bookmark.db.allcommon.exception.OutsideSqlNotFoundException - * When the outside-sql is not found. + * When the outside-SQL is not found. * @exception jp.sf.pal.bookmark.db.allcommon.exception.EntityAlreadyDeletedException * When the entity has already been deleted(not found). * @exception jp.sf.pal.bookmark.db.allcommon.exception.EntityDuplicatedException @@ -84,8 +93,8 @@ */ public ENTITY selectEntityWithDeletedCheck(String path, PARAMETER_BEAN pmb, Class entityType) { - final List ls = _outsideSqlDao.selectList(path, pmb, - _outsideSqlOption, entityType); + final List ls = invoke(createSelectListCommand(path, pmb, + entityType)); if (ls == null || ls.isEmpty()) { throwEntityAlreadyDeletedException(buildSearch4LogString(path, pmb, entityType)); @@ -127,6 +136,39 @@ //========================================================================== // ========= + // Behavior Command + // ================ + protected BehaviorCommand> createSelectListCommand( + String path, PARAMETER_BEAN pmb, Class entityType) { + return xsetupCommand(new OutsideSqlSelectListCommand(), path, + pmb, entityType); + } + + private OutsideSqlSelectListCommand xsetupCommand( + OutsideSqlSelectListCommand command, String path, + PARAMETER_BEAN pmb, Class entityType) { + command.setTableDbName(_tableDbName); + _behaviorCommandInvoker.injectComponentProperty(command); + command.setOutsideSqlPath(path); + command.setParameterBean(pmb); + command.setOutsideSqlOption(_outsideSqlOption); + command.setEntityType(entityType); + return command; + } + + /** + * Invoke the command of behavior. + * + * @param The type of result. + * @param behaviorCommand The command of behavior. (NotNull) + * @return The instance of result. (Nullable) + */ + protected RESULT invoke(BehaviorCommand behaviorCommand) { + return _behaviorCommandInvoker.invoke(behaviorCommand); + } + + //========================================================================== + // ========= // Option // ====== public OutsideSqlEntityExecutor configure( Modified: bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/cbean/outsidesql/executor/OutsideSqlPagingExecutor.java =================================================================== --- bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/cbean/outsidesql/executor/OutsideSqlPagingExecutor.java 2008-12-27 22:10:35 UTC (rev 1626) +++ bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/cbean/outsidesql/executor/OutsideSqlPagingExecutor.java 2008-12-27 22:11:51 UTC (rev 1627) @@ -3,18 +3,20 @@ import java.util.List; import jp.sf.pal.bookmark.db.allcommon.DBFluteConfig; +import jp.sf.pal.bookmark.db.allcommon.bhv.core.BehaviorCommand; +import jp.sf.pal.bookmark.db.allcommon.bhv.core.BehaviorCommandInvoker; +import jp.sf.pal.bookmark.db.allcommon.bhv.core.command.OutsideSqlSelectListCommand; import jp.sf.pal.bookmark.db.allcommon.cbean.ListResultBean; import jp.sf.pal.bookmark.db.allcommon.cbean.PagingBean; import jp.sf.pal.bookmark.db.allcommon.cbean.PagingHandler; import jp.sf.pal.bookmark.db.allcommon.cbean.PagingInvoker; import jp.sf.pal.bookmark.db.allcommon.cbean.PagingResultBean; import jp.sf.pal.bookmark.db.allcommon.cbean.ResultBeanBuilder; -import jp.sf.pal.bookmark.db.allcommon.cbean.outsidesql.OutsideSqlDao; import jp.sf.pal.bookmark.db.allcommon.cbean.outsidesql.OutsideSqlOption; import jp.sf.pal.bookmark.db.allcommon.jdbc.StatementConfig; /** - * The paging executor of outsideSql. + * The paging executor of outside-SQL. * * @author DBFlute(AutoGenerator) */ @@ -24,10 +26,10 @@ // ========= // Attribute // ========= - /** The DAO of outsideSql. (NotNull) */ - protected final OutsideSqlDao _outsideSqlDao; + /** The invoker of behavior command. (NotNull) */ + protected final BehaviorCommandInvoker _behaviorCommandInvoker; - /** The option of outsideSql. (NotNull) */ + /** The option of outside-SQL. (NotNull) */ protected final OutsideSqlOption _outsideSqlOption; /** The DB name of table. (NotNull) */ @@ -37,9 +39,10 @@ // ========= // Constructor // =========== - public OutsideSqlPagingExecutor(OutsideSqlDao outsideSqlDao, + public OutsideSqlPagingExecutor( + BehaviorCommandInvoker behaviorCommandInvoker, OutsideSqlOption outsideSqlOption, String tableDbName) { - this._outsideSqlDao = outsideSqlDao; + this._behaviorCommandInvoker = behaviorCommandInvoker; this._outsideSqlOption = outsideSqlOption; this._tableDbName = tableDbName; } @@ -81,13 +84,13 @@ * @param entityType The type of result entity. (NotNull) * @return The result bean of paged list. (NotNull) * @exception com.example.dbflute.basic.dbflute.allcommon.exception.OutsideSqlNotFoundException - * When the outside-sql is not found. + * When the outside-SQL is not found. */ public ListResultBean selectList(String path, PagingBean pmb, Class entityType) { setupScrollableCursorIfNeeds(); - List resultList = _outsideSqlDao.selectList(path, pmb, - _outsideSqlOption, entityType); + List resultList = invoke(createSelectListCommand(path, pmb, + entityType)); return new ResultBeanBuilder(_tableDbName) .buildListResultBean(resultList); } @@ -141,7 +144,7 @@ * # -- ELSE select count(*) * # /[*]END[*]/ * # ... - * o It's S2Dao's restriction...Sorry + * o It's restriction...Sorry * * * @param The type of entity. @@ -150,14 +153,11 @@ * @param entityType The type of result entity. (NotNull) * @return The result bean of paging. (NotNull) * @exception jp.sf.pal.bookmark.db.allcommon.exception.OutsideSqlNotFoundException - * When the outside-sql is not found. + * When the outside-SQL is not found. */ public PagingResultBean selectPage(final String path, final PagingBean pmb, final Class entityType) { - final OutsideSqlOption countOption = _outsideSqlOption - .copyOptionWithoutPaging(); - final OutsideSqlEntityExecutor countExecutor = new OutsideSqlEntityExecutor( - _outsideSqlDao, countOption); + final OutsideSqlEntityExecutor countExecutor = createCountExecutor(); final PagingHandler handler = new PagingHandler() { public PagingBean getPagingBean() { return pmb; @@ -182,6 +182,13 @@ return invoker.invokePaging(handler); } + protected OutsideSqlEntityExecutor createCountExecutor() { + final OutsideSqlOption countOption = _outsideSqlOption + .copyOptionWithoutPaging(); + return new OutsideSqlEntityExecutor( + _behaviorCommandInvoker, countOption, _tableDbName); + } + protected void setupScrollableCursorIfNeeds() { if (!_outsideSqlOption.isAutoPaging()) { return; @@ -207,6 +214,39 @@ //========================================================================== // ========= + // Behavior Command + // ================ + protected BehaviorCommand> createSelectListCommand( + String path, Object pmb, Class entityType) { + return xsetupCommand(new OutsideSqlSelectListCommand(), path, + pmb, entityType); + } + + private OutsideSqlSelectListCommand xsetupCommand( + OutsideSqlSelectListCommand command, String path, + Object pmb, Class entityType) { + command.setTableDbName(_tableDbName); + _behaviorCommandInvoker.injectComponentProperty(command); + command.setOutsideSqlPath(path); + command.setParameterBean(pmb); + command.setOutsideSqlOption(_outsideSqlOption); + command.setEntityType(entityType); + return command; + } + + /** + * Invoke the command of behavior. + * + * @param The type of result. + * @param behaviorCommand The command of behavior. (NotNull) + * @return The instance of result. (Nullable) + */ + protected RESULT invoke(BehaviorCommand behaviorCommand) { + return _behaviorCommandInvoker.invoke(behaviorCommand); + } + + //========================================================================== + // ========= // Option // ====== public OutsideSqlPagingExecutor configure(StatementConfig statementConfig) { Modified: bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/cbean/sqlclause/AbstractSqlClause.java =================================================================== --- bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/cbean/sqlclause/AbstractSqlClause.java 2008-12-27 22:10:35 UTC (rev 1626) +++ bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/cbean/sqlclause/AbstractSqlClause.java 2008-12-27 22:11:51 UTC (rev 1627) @@ -17,23 +17,23 @@ import jp.sf.pal.bookmark.db.allcommon.dbmeta.DBMetaInstanceHandler; import jp.sf.pal.bookmark.db.allcommon.dbmeta.info.ColumnInfo; import jp.sf.pal.bookmark.db.allcommon.dbmeta.info.ForeignInfo; -import jp.sf.pal.bookmark.db.allcommon.dbmeta.info.UniqueInfo; import jp.sf.pal.bookmark.db.allcommon.util.SimpleAssertUtil; import jp.sf.pal.bookmark.db.allcommon.util.SimpleStringUtil; import jp.sf.pal.bookmark.db.allcommon.util.SimpleSystemUtil; /** - * The abstract class of SqlClause. + * The abstract class of SQL clause. * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public abstract class AbstractSqlClause implements SqlClause { //========================================================================== // ========= // Definition // ========== + protected static final SelectClauseType DEFAULT_SELECT_CLAUSE_TYPE = SelectClauseType.COLUMNS; + protected static final String SELECT_HINT = "/*$dto.selectHint*/"; //========================================================================== @@ -43,12 +43,16 @@ // ----------------------------------------------------- // Basic // ----- - /** Target table name. */ + /** The name of table. */ protected final String _tableName; // ----------------------------------------------------- // Clause Resource // --------------- + // /- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + // - + // The resources that are not often used to are lazy-loaded for performance. + // - - - - - - - - - -/ /** * Selected select column map. map:{tableAliasName : map:{columnName : * selectColumnInfo}} @@ -57,48 +61,48 @@ /** * Specified select column map. map:{ tableAliasName = map:{ columnName : - * null } } + * null } } (Nullable: This is lazy-loaded) */ - protected Map> _specifiedSelectColumnMap;// [ + protected Map> _specifiedSelectColumnMap; // [ // DBFlute // - - // 0.7.4 - // ] + // 0.7 + // .4] - /** Specified derive sub-query map. */ - protected Map _specifiedDeriveSubQueryMap;// [DBFlute-0.7.4] + /** Specified derive sub-query map. (Nullable: This is lazy-loaded) */ + protected Map _specifiedDeriveSubQueryMap; //[DBFlute-0.7.4] - /** Included select column map. */ - protected Map _includedSelectColumnMap = new LinkedHashMap(); - /** * The map of real column and alias of select clause. map:{realColumnName : * aliasName} */ - protected Map _selectClauseRealColumnAliasMap = new HashMap();// Without + protected Map _selectClauseRealColumnAliasMap = new HashMap(); // Without // linked // ! + /** The type of select clause. (NotNull) */ + protected SelectClauseType _selectClauseType = DEFAULT_SELECT_CLAUSE_TYPE; + + /** The previous type of select clause. (Nullable: The default is null) */ + protected SelectClauseType _previousSelectClauseType; + /** Outer join map. */ protected Map _outerJoinMap = new LinkedHashMap(); - /** Where list. */ + /** The list of where clause. */ protected List _whereList = new ArrayList(); /** Inline where list for BaseTable. */ protected List _baseTableInlineWhereList = new ArrayList(); - /** Order-by clause. */ + /** The clause of order-by. (NotNull) */ protected final OrderByClause _orderByClause = new OrderByClause(); - /** Union clause list. */ - protected List _unionQueryInfoList = new ArrayList(); + /** The list of union clause. (Nullable: This is lazy-loaded) */ + protected List _unionQueryInfoList; - /** Is included-select-column effective? Default value is false. */ - protected boolean _isIncludedSelectColumnEffective = false; - /** Is order-by effective? Default value is false. */ protected boolean _isOrderByEffective = false; @@ -138,7 +142,7 @@ // ----------------------------------------------------- // Optional Info // ------------- - protected boolean _formatClause; + protected boolean _formatClause = true; //========================================================================== // ========= @@ -163,28 +167,20 @@ StringBuilder sb = new StringBuilder(512); sb.append(getSelectClause()); sb.append(" "); - sb.append(buildClauseWithoutMainSelect(false)); + sb.append(buildClauseWithoutMainSelect()); String sql = sb.toString(); - return filterSubQueryIndent(sql); + sql = filterUnionCountOrScalar(sql); + sql = filterSubQueryIndent(sql); + return sql; } - public String getClausePKOnly() { + protected String buildClauseWithoutMainSelect() { StringBuilder sb = new StringBuilder(512); - sb.append(getSelectClausePKOnly()); - sb.append(" "); - sb.append(buildClauseWithoutMainSelect(true)); - String sql = sb.toString(); - return filterSubQueryIndent(sql); - } - - protected String buildClauseWithoutMainSelect(boolean pkonly) { - StringBuilder sb = new StringBuilder(512); sb.append(getFromClause()); sb.append(getFromHint()); sb.append(" "); sb.append(getWhereClause()); - String unionClause = buildUnionClause(pkonly ? getSelectClausePKOnly() - : getSelectClause()); + String unionClause = buildUnionClause(getSelectClause()); // Delete template mark! (At the future this will be unnecessary.) unionClause = replaceString(unionClause, getUnionWhereClauseMark(), "");// Required @@ -225,29 +221,45 @@ protected String buildUnionClause(String selectClause) { StringBuilder sb = new StringBuilder(); - for (final Iterator ite = _unionQueryInfoList - .iterator(); ite.hasNext();) { - final UnionQueryInfo unionQueryInfo = (UnionQueryInfo) ite.next(); - final String unionQueryClause = unionQueryInfo - .getUnionQueryClause(); - final boolean unionAll = unionQueryInfo.isUnionAll(); - if (isFormatClauseEffective()) { + if (hasUnionQuery()) { + for (Iterator ite = _unionQueryInfoList.iterator(); ite + .hasNext();) { + UnionQueryInfo unionQueryInfo = (UnionQueryInfo) ite.next(); + String unionQueryClause = unionQueryInfo.getUnionQueryClause(); + boolean unionAll = unionQueryInfo.isUnionAll(); sb.append(getLineSeparator()); - } - sb.append(unionAll ? " union all " : " union "); - if (isFormatClauseEffective()) { + sb.append(unionAll ? " union all " : " union "); sb.append(getLineSeparator()); + sb.append(selectClause).append(" ").append(unionQueryClause); } - sb.append(selectClause).append(" ").append(unionQueryClause); } return sb.toString(); } + protected String filterUnionCountOrScalar(String sql) { + if (!isSelectClauseTypeCountOrScalar() || !hasUnionQuery()) { + return sql; + } + String selectClause = buildSelectClauseCountOrScalar("dfmain"); + String ln = getLineSeparator(); + String beginMark = resolveSubQueryBeginMark("dfmain") + ln; + String endMark = resolveSubQueryEndMark("dfmain"); + return selectClause + ln + " from (" + beginMark + sql + ln + + " ) dfmain" + endMark; + } + //========================================================================== // ========= // Clause Parts // ============ public String getSelectClause() { + // [DBFlute-0.8.6] + if (isSelectClauseTypeCountOrScalar() && !hasUnionQuery()) { + return buildSelectClauseCountOrScalar("dflocal"); + } + // /- - - - - - - - - - - - - - - - - - - - - - - - + // The type of select clause is COLUMNS since here. + // - - - - - - - - - -/ StringBuilder sb = new StringBuilder(); DBMeta dbmeta = DBMetaInstanceHandler.findDBMeta(_tableName); List columnInfoList = dbmeta.getColumnInfoList(); @@ -265,7 +277,19 @@ // [DBFlute-0.7.4] if (existsSpecifiedLocal && !localSpecifiedMap.containsKey(columnName)) { - continue; + if (isSelectClauseTypeCountOrScalar() && hasUnionQuery()) { + // Here it must be with union query. + // So the primary Key is target for saving unique. + // But if it does not have primary keys, all column is + // target. + if (dbmeta.hasPrimaryKey()) { + if (!columnInfo.isPrimary()) { + continue; + } + } + } else { + continue; + } } if (sb.length() > 0) { @@ -307,10 +331,6 @@ selectColumnInfo.getColumnAliasName()); } } - if (_isIncludedSelectColumnEffective - && !_includedSelectColumnMap.isEmpty()) { - sb.append(getIncludedSelectColumnClause()); - } // [DBFlute-0.7.4] if (_specifiedDeriveSubQueryMap != null @@ -318,9 +338,7 @@ Collection deriveSubQuerySet = _specifiedDeriveSubQueryMap .values(); for (String deriveSubQuery : deriveSubQuerySet) { - if (isFormatClauseEffective()) { - sb.append(getLineSeparator()).append(" "); - } + sb.append(getLineSeparator()).append(" "); sb.append(", ").append(deriveSubQuery); } } @@ -328,67 +346,83 @@ return sb.toString(); } - public String getSelectClausePKOnly() { - StringBuilder sb = new StringBuilder(); - DBMeta dbmeta = DBMetaInstanceHandler.findDBMeta(_tableName); - UniqueInfo uniqueInfo = dbmeta.getPrimaryUniqueInfo(); - List columnInfoList = uniqueInfo.getUniqueColumnList(); - for (ColumnInfo columnInfo : columnInfoList) { - String columnName = columnInfo.getColumnDbName(); - if (sb.length() > 0) { - sb.append(", "); - } else { - sb.append("select").append(SELECT_HINT).append(" "); - } - String realColumnName = getLocalTableAliasName() + "." + columnName; - sb.append(realColumnName).append(" as ").append(columnName); - _selectClauseRealColumnAliasMap.put(realColumnName, columnName); + protected boolean isSelectClauseTypeCountOrScalar() { + if (_selectClauseType.equals(SelectClauseType.COUNT)) { + return true; + } else if (_selectClauseType.equals(SelectClauseType.MAX)) { + return true; + } else if (_selectClauseType.equals(SelectClauseType.MIN)) { + return true; + } else if (_selectClauseType.equals(SelectClauseType.SUM)) { + return true; + } else if (_selectClauseType.equals(SelectClauseType.AVG)) { + return true; } - if (_isIncludedSelectColumnEffective - && !_includedSelectColumnMap.isEmpty()) { - sb.append(getIncludedSelectColumnClause()); - } + return false; + } - // [DBFlute-0.7.4] - if (_specifiedDeriveSubQueryMap != null - && !_specifiedDeriveSubQueryMap.isEmpty()) { - Collection deriveSubQuerySet = _specifiedDeriveSubQueryMap - .values(); - for (String deriveSubQuery : deriveSubQuerySet) { - if (isFormatClauseEffective()) { - sb.append(getLineSeparator()).append(" "); - } - sb.append(", ").append(deriveSubQuery); - } + protected String buildSelectClauseCountOrScalar(String aliasName) { + if (_selectClauseType.equals(SelectClauseType.COUNT)) { + return buildSelectClauseCount(); + } else if (_selectClauseType.equals(SelectClauseType.MAX)) { + return buildSelectClauseMax(aliasName); + } else if (_selectClauseType.equals(SelectClauseType.MIN)) { + return buildSelectClauseMin(aliasName); + } else if (_selectClauseType.equals(SelectClauseType.SUM)) { + return buildSelectClauseSum(aliasName); + } else if (_selectClauseType.equals(SelectClauseType.AVG)) { + return buildSelectClauseAvg(aliasName); } + String msg = "The type of select clause is not for scalar:"; + msg = msg + " type=" + _selectClauseType; + throw new IllegalStateException(msg); + } - return sb.toString(); + protected String buildSelectClauseCount() { + return "select count(*)"; } - public String getSelectHint() { - return createSelectHint(); + protected String buildSelectClauseMax(String aliasName) { + String columnName = getSpecifiedColumnNameAsOne(); + assertScalarSelectSpecifiedColumnOnlyOne(columnName); + return "select max(" + aliasName + "." + columnName + ")"; } - public String getIncludedSelectColumnClause() { - StringBuilder sb = new StringBuilder(); - int count = 0; - for (Iterator ite = _includedSelectColumnMap.keySet() - .iterator(); ite.hasNext(); count++) { - String aliasName = ite.next(); - String realColumnName = (String) _includedSelectColumnMap - .get(aliasName); - sb.append(", ").append(realColumnName).append(" as ").append( - aliasName); - _selectClauseRealColumnAliasMap.put(realColumnName, aliasName); + protected String buildSelectClauseMin(String aliasName) { + String columnName = getSpecifiedColumnNameAsOne(); + assertScalarSelectSpecifiedColumnOnlyOne(columnName); + return "select min(" + aliasName + "." + columnName + ")"; + } + + protected String buildSelectClauseSum(String aliasName) { + String columnName = getSpecifiedColumnNameAsOne(); + assertScalarSelectSpecifiedColumnOnlyOne(columnName); + return "select sum(" + aliasName + "." + columnName + ")"; + } + + protected String buildSelectClauseAvg(String aliasName) { + String columnName = getSpecifiedColumnNameAsOne(); + assertScalarSelectSpecifiedColumnOnlyOne(columnName); + return "select avg(" + aliasName + "." + columnName + ")"; + } + + protected void assertScalarSelectSpecifiedColumnOnlyOne(String columnName) { + if (columnName != null) { + return; } - return sb.toString(); + String msg = "The specified column exists one"; + msg = msg + " when the type of select clause is for scalar:"; + msg = msg + " specifiedSelectColumnMap=" + _specifiedSelectColumnMap; + throw new IllegalStateException(msg); } + public String getSelectHint() { + return createSelectHint(); + } + public String getFromClause() { StringBuilder sb = new StringBuilder(); - if (isFormatClauseEffective()) { - sb.append(getLineSeparator()).append(" "); - } + sb.append(getLineSeparator()).append(" "); sb.append("from "); if (_baseTableInlineWhereList.isEmpty()) { sb.append(_tableName).append(" dflocal"); @@ -417,9 +451,7 @@ Map joinOnMap = joinInfo.getJoinOnMap(); assertJoinOnMapNotEmpty(joinOnMap, aliasName); - if (isFormatClauseEffective()) { - sb.append(getLineSeparator()).append(" "); - } + sb.append(getLineSeparator()).append(" "); sb.append(" left outer join "); if (inlineWhereClauseList.isEmpty()) { sb.append(joinTableName); @@ -489,16 +521,12 @@ String clauseElement = (String) ite.next(); clauseElement = filterWhereClauseSimply(clauseElement); if (count == 0) { - if (isFormatClauseEffective()) { - sb.append(getLineSeparator()).append(" "); - } + sb.append(getLineSeparator()).append(" "); sb.append("where ").append( template ? getWhereFirstConditionMark() : "").append( clauseElement); } else { - if (isFormatClauseEffective()) { - sb.append(getLineSeparator()).append(" "); - } + sb.append(getLineSeparator()).append(" "); sb.append(" and ").append(clauseElement); } } @@ -510,7 +538,7 @@ public String getOrderByClause() { String orderByClause = null; - if (!_unionQueryInfoList.isEmpty()) { + if (hasUnionQuery()) { if (_selectClauseRealColumnAliasMap == null || _selectClauseRealColumnAliasMap.isEmpty()) { String msg = "The selectClauseColumnAliasMap should not be null or empty when union query exists: " @@ -522,8 +550,7 @@ } else { orderByClause = _orderByClause.getOrderByClause(); } - if (isFormatClauseEffective() && orderByClause != null - && orderByClause.trim().length() > 0) { + if (orderByClause != null && orderByClause.trim().length() > 0) { return getLineSeparator() + " " + orderByClause; } else { return orderByClause; @@ -532,8 +559,7 @@ public String getSqlSuffix() { String sqlSuffix = createSqlSuffix(); - if (isFormatClauseEffective() && sqlSuffix != null - && sqlSuffix.trim().length() > 0) { + if (sqlSuffix != null && sqlSuffix.trim().length() > 0) { return getLineSeparator() + sqlSuffix; } else { return sqlSuffix; @@ -542,20 +568,6 @@ //========================================================================== // ========= - // Copy Parts - // ========== - public void copyIncludedSelectColumn(SqlClause sqlClause) { - Set keySet = _includedSelectColumnMap.keySet(); - for (Iterator ite = keySet.iterator(); ite.hasNext();) { - String aliasName = ite.next(); - String realColumnName = (String) _includedSelectColumnMap - .get(aliasName); - sqlClause.registerIncludedSelectColumn(aliasName, realColumnName); - } - } - - //========================================================================== - // ========= // SelectedSelectColumn // ==================== /** @@ -644,26 +656,6 @@ //========================================================================== // ========= - // IncludedSelectColumn - // ==================== - public void ignoreIncludedSelectColumn() { - _isIncludedSelectColumnEffective = false; - } - - public void makeIncludedSelectColumnEffective() { - if (!_includedSelectColumnMap.isEmpty()) { - _isIncludedSelectColumnEffective = true; - } - } - - public void registerIncludedSelectColumn(String aliasName, - String realColumnName) { - _isIncludedSelectColumnEffective = true; - _includedSelectColumnMap.put(aliasName, realColumnName); - } - - //========================================================================== - // ========= // OuterJoin // ========= public void registerOuterJoin(String joinTableName, String aliasName, @@ -1079,12 +1071,23 @@ public void registerUnionQuery(String unionQueryClause, boolean unionAll) { assertStringNotNullAndNotTrimmedEmpty("unionQueryClause", unionQueryClause); - final UnionQueryInfo unionQueryInfo = new UnionQueryInfo(); + UnionQueryInfo unionQueryInfo = new UnionQueryInfo(); unionQueryInfo.setUnionQueryClause(unionQueryClause); unionQueryInfo.setUnionAll(unionAll); + addUnionQueryInfo(unionQueryInfo); + } + + protected void addUnionQueryInfo(UnionQueryInfo unionQueryInfo) { + if (_unionQueryInfoList == null) { + _unionQueryInfoList = new ArrayList(); + } _unionQueryInfoList.add(unionQueryInfo); } + public boolean hasUnionQuery() { + return _unionQueryInfoList != null && !_unionQueryInfoList.isEmpty(); + } + protected static class UnionQueryInfo { protected String _unionQueryClause; @@ -1425,18 +1428,6 @@ //========================================================================== // ========= - // Format Clause - // ============= - public boolean isFormatClauseEffective() { - return _formatClause; - } - - public void makeFormatClauseEffective() { - _formatClause = true; - } - - //========================================================================== - // ========= // Sub Query Indent // ================ public String resolveSubQueryBeginMark(String subQueryIdentity) { @@ -1462,13 +1453,11 @@ } public String filterSubQueryIndent(String sql) { - return isFormatClauseEffective() ? filterSubQueryIndent(sql, "") : sql; + return filterSubQueryIndent(sql, "", sql); } - protected String filterSubQueryIndent(String sql, String preIndent) { - if (!isFormatClauseEffective()) { - return sql; - } + protected String filterSubQueryIndent(String sql, String preIndent, + String originalSql) { final String lineSeparator = getLineSeparator(); if (!sql.contains(getSubQueryBeginMarkPrefix())) { return sql; @@ -1509,7 +1498,8 @@ // - - - - - - - - // In begin to end // - - - - - - - - - if (line.contains(endMarkPrefix + subQueryIdentity)) {// The end + if (line.contains(endMarkPrefix + subQueryIdentity)) { // The + // end final int markIndex = line.indexOf(endMarkPrefix); final int terminalIndex = line.indexOf(identityTerminal); if (terminalIndex < 0) { @@ -1521,7 +1511,7 @@ + line.substring(terminalIndex + terminalLength); subSb.append(clause).append(getLineSeparator()); final String currentSql = filterSubQueryIndent(subSb - .toString(), preIndent + indent); + .toString(), preIndent + indent, originalSql); mainSb.append(currentSql); throughBegin = false; throughBeginFirst = false; @@ -1544,10 +1534,11 @@ + getLineSeparator(); msg = msg + subQueryIdentity + getLineSeparator(); msg = msg + getLineSeparator() + "[Before Filter]" - + getLineSeparator(); - msg = msg + sql + getLineSeparator(); + + getLineSeparator() + sql; msg = msg + getLineSeparator() + "[After Filter]" + getLineSeparator() + filteredSql; + msg = msg + getLineSeparator() + "[Original SQL]" + + getLineSeparator() + originalSql; throw new SubQueryIndentFailureException(msg); } if (filteredSql.contains(beginMarkPrefix)) { @@ -1556,10 +1547,11 @@ + getLineSeparator(); msg = msg + subQueryIdentity + getLineSeparator(); msg = msg + getLineSeparator() + "[Before Filter]" - + getLineSeparator(); - msg = msg + sql + getLineSeparator(); + + getLineSeparator() + sql; msg = msg + getLineSeparator() + "[After Filter]" + getLineSeparator() + filteredSql; + msg = msg + getLineSeparator() + "[Original SQL]" + + getLineSeparator() + originalSql; throw new SubQueryIndentFailureException(msg); } return filteredSql; @@ -1592,7 +1584,7 @@ } if (!_specifiedSelectColumnMap.containsKey(tableAliasName)) { _specifiedSelectColumnMap.put(tableAliasName, - new HashMap()); + new LinkedHashMap()); } Map elementMap = _specifiedSelectColumnMap .get(tableAliasName); @@ -1666,10 +1658,7 @@ getUnionWhereFirstConditionMark(), ""); final StringBuilder sb = new StringBuilder(); - String ln = ""; - if (isFormatClauseEffective()) { - ln = getLineSeparator(); - } + String ln = getLineSeparator(); sb.append("update ").append(_tableName).append(ln); int index = 0; // It is guaranteed that the map has one or more elements. @@ -1728,10 +1717,7 @@ final String subQuery = filterSubQueryIndent(selectClause + " " + fromWhereClause); final StringBuilder sb = new StringBuilder(); - String ln = ""; - if (isFormatClauseEffective()) { - ln = getLineSeparator(); - } + String ln = getLineSeparator(); sb.append("delete from ").append(_tableName).append(ln); sb.append(" where ").append(primaryKeyName); sb.append(" in (").append(ln).append(subQuery).append(ln).append( @@ -1760,6 +1746,29 @@ return false; } + // [DBFlute-0.8.6] + //========================================================================== + // ========= + // Select Clause Type + // ================== + public void classifySelectClauseType(SelectClauseType selectClauseType) { + changeSelectClauseType(selectClauseType); + } + + protected void changeSelectClauseType(SelectClauseType selectClauseType) { + savePreviousSelectClauseType(); + _selectClauseType = selectClauseType; + } + + protected void savePreviousSelectClauseType() { + _previousSelectClauseType = _selectClauseType; + } + + public void rollbackSelectClauseType() { + _selectClauseType = _previousSelectClauseType != null ? _previousSelectClauseType + : DEFAULT_SELECT_CLAUSE_TYPE; + } + // [DBFlute-0.7.5] //========================================================================== // ========= Modified: bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/cbean/sqlclause/SqlClause.java =================================================================== --- bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/cbean/sqlclause/SqlClause.java 2008-12-27 22:10:35 UTC (rev 1626) +++ bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/cbean/sqlclause/SqlClause.java 2008-12-27 22:11:51 UTC (rev 1627) @@ -7,7 +7,7 @@ import jp.sf.pal.bookmark.db.allcommon.cbean.cvalue.ConditionValue; /** - * The interface of SQL-clause. + * The interface of SQL clause. * * @author DBFlute(AutoGenerator) */ @@ -35,21 +35,6 @@ */ public String getClause(); - /** - * Get clause of all parts as PK-only. - * - *
-     * # 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
-     * 
- * - * @return The clause of all parts as PK-Only. (NotNull) - */ - public String getClausePKOnly(); - // ----------------------------------------------------- // Fragment Clause // --------------- @@ -92,14 +77,6 @@ public String getSelectClause(); /** - * Get The clause of 'select' as PK-only. This is an internal method. - * - * @return The clause of select PK-only. {[select ...] from table...} - * (NotNull) - */ - public String getSelectClausePKOnly(); - - /** * Get the hint of 'select'. This is an internal method. * * @return The hint of 'select'. {select [select-hint] * from table...} @@ -108,14 +85,6 @@ public String getSelectHint(); /** - * Get the clause of included-select-column. This is an internal method. - * - * @return The clause of included-select-column. {select ... , - * [included-select-column clause] from table...} (NotNull) - */ - public String getIncludedSelectColumnClause(); - - /** * Get the clause of 'from'. This is an internal method. * * @return The clause of 'from'. (NotNull) @@ -162,17 +131,6 @@ //========================================================================== // ========= - // Copy Parts - // ========== - /** - * Copy included-select-column. - * - * @param sqlClause SQL-clause. (NotNull) - */ - public void copyIncludedSelectColumn(SqlClause sqlClause); - - //========================================================================== - // ========= // SelectedSelectColumn // ==================== /** @@ -189,30 +147,6 @@ //========================================================================== // ========= - // IncludedSelectColumn - // ==================== - /** - * Ignore included-select-column. - */ - public void ignoreIncludedSelectColumn(); - - /** - * Make included-select-column effective. - */ - public void makeIncludedSelectColumnEffective(); - - /** - * Register included-select-column. - * - * @param aliasName The alias name of the included-select-column. (NotNull) - * @param realColumnName The real column name of the included-select-column. - * (NotNull) - */ - public void registerIncludedSelectColumn(String aliasName, - String realColumnName); - - //========================================================================== - // ========= // OuterJoin // ========= /** @@ -340,6 +274,8 @@ // ===== public void registerUnionQuery(String unionClause, boolean unionAll); + public boolean hasUnionQuery(); + //========================================================================== // ========= // FetchScope @@ -561,14 +497,6 @@ //========================================================================== // ========= - // Format Clause - // ============= - public boolean isFormatClauseEffective(); - - public void makeFormatClauseEffective(); - - //========================================================================== - // ========= // Sub Query Indent // ================ public String resolveSubQueryBeginMark(String subQueryIdentity); @@ -588,8 +516,17 @@ public boolean hasSpecifiedDeriveSubQuery(String aliasName); + /** + * Get the name of only one specified column. + * + * @return The name of only one specified column. (Nullable: If it's not + * found or duplicated, it returns null) + */ public String getSpecifiedColumnNameAsOne(); + /** + * Clear specified select columns. + */ public void clearSpecifiedSelectColumn(); // [DBFlute-0.7.5] @@ -621,4 +558,29 @@ */ public boolean isUniqueConstraintException(String sqlState, Integer errorCode); + + // [DBFlute-0.8.6] + //========================================================================== + // ========= + // Select Clause Type + // ================== + /** + * Classify the type of select clause into specified type. + * + * @param selectClauseType The type of select clause. (NotNull) + */ + public void classifySelectClauseType(SelectClauseType selectClauseType); + + /** + * Roll-back the type of select clause into previous one. If it has no + * change, classify its type into default type. + */ + public void rollbackSelectClauseType(); + + /** + * The type of select clause. + */ + public static enum SelectClauseType { + COLUMNS, COUNT, MAX, MIN, SUM, AVG + } } Modified: bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/cbean/sqlclause/SqlClauseOracle.java =================================================================== --- bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/cbean/sqlclause/SqlClauseOracle.java 2008-12-27 22:10:35 UTC (rev 1626) +++ bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/cbean/sqlclause/SqlClauseOracle.java 2008-12-27 22:11:51 UTC (rev 1627) @@ -71,12 +71,7 @@ if (!isFetchStartIndexSupported() && !isFetchSizeSupported()) { return; } - String ln = null; - if (isFormatClauseEffective()) { - ln = getLineSeparator(); - } else { - ln = ""; - } + String ln = getLineSeparator(); _fetchScopeSelectHint = " * from (select base.*, rownum as rn from (" + ln + "select"; _fetchScopeSqlSuffix = ""; Modified: bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/dbmeta/AbstractDBMeta.java =================================================================== --- bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/dbmeta/AbstractDBMeta.java 2008-12-27 22:10:35 UTC (rev 1626) +++ bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/dbmeta/AbstractDBMeta.java 2008-12-27 22:11:51 UTC (rev 1627) @@ -5,12 +5,11 @@ import java.util.Collection; import java.util.Collections; import java.util.HashMap; -import java.util.HashSet; import java.util.Iterator; import java.util.LinkedHashMap; import java.util.List; import java.util.Map; -import java.util.Set; +import java.util.concurrent.ConcurrentHashMap; import jp.sf.pal.bookmark.db.allcommon.Entity; import jp.sf.pal.bookmark.db.allcommon.dbmeta.info.ColumnInfo; @@ -22,6 +21,7 @@ import jp.sf.pal.bookmark.db.allcommon.helper.MapListStringImpl; import jp.sf.pal.bookmark.db.allcommon.helper.MapStringBuilder; import jp.sf.pal.bookmark.db.allcommon.helper.MapStringBuilderImpl; +import jp.sf.pal.bookmark.db.allcommon.helper.StringKeyMap; import jp.sf.pal.bookmark.db.allcommon.util.SimpleAssertUtil; import jp.sf.pal.bookmark.db.allcommon.util.SimpleStringUtil; import jp.sf.pal.bookmark.db.allcommon.util.SimpleSystemUtil; @@ -31,68 +31,113 @@ * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public abstract class AbstractDBMeta implements DBMeta { //========================================================================== // ========= + // Definition + // ========== + protected static final Object DUMMY_VALUE = new Object(); + + //========================================================================== + // ========= // Attribute // ========= - protected List _columnInfoList; + // ----------------------------------------------------- + // Information Resource + // -------------------- + // Initialized at its getter. + private StringKeyMap _tableDbNameFlexibleMap; + private StringKeyMap _tablePropertyNameFlexibleMap; + + private List _columnInfoList; + + private StringKeyMap _columnInfoFlexibleMap; + + // Initialized at hasMethod(). + private Map _methodNameMap = newConcurrentHashMap(); + //========================================================================== // ========= + // Table Info + // ========== + /** + * Get the flexible map of table DB name. + * + * @return The flexible map of table DB name. (NotNull, NotEmpty) + */ + protected Map getTableDbNameFlexibleMap() { + if (_tableDbNameFlexibleMap != null) { + return _tableDbNameFlexibleMap; + } + synchronized (this) { + if (_tableDbNameFlexibleMap != null) { + return _tableDbNameFlexibleMap; + } + _tableDbNameFlexibleMap = StringKeyMap.createAsFlexibleConcurrent(); + _tableDbNameFlexibleMap.put(getTableDbName(), getTableDbName()); + return _tableDbNameFlexibleMap; + } + } + + /** + * Get the flexible map of table property name. + * + * @return The flexible map of table property name. (NotNull, NotEmpty) + */ + protected Map getTablePropertyNameFlexibleMap() { + if (_tablePropertyNameFlexibleMap != null) { + return _tablePropertyNameFlexibleMap; + } + synchronized (this) { + if (_tablePropertyNameFlexibleMap != null) { + return _tablePropertyNameFlexibleMap; + } + _tablePropertyNameFlexibleMap = StringKeyMap + .createAsFlexibleConcurrent(); + _tablePropertyNameFlexibleMap.put(getTableDbName(), + getTablePropertyName()); + return _tableDbNameFlexibleMap; + } + } + + //========================================================================== + // ========= // Column Info // =========== /** * The implementation. * - * @param columnFlexibleName The flexible name of the column. (NotNull) + * @param columnFlexibleName The flexible name(IgnoreCase, IgnoreUnderscore) + * of the column. (NotNull, NotEmpty) * @return Determination. */ public boolean hasColumn(String columnFlexibleName) { - if (!hasFlexibleName(columnFlexibleName)) { - return false; - } - final String propertyName = findPropertyName(columnFlexibleName); - return hasMethod("column" + initCap(propertyName)); + assertStringNotNullAndNotTrimmedEmpty("columnFlexibleName", + columnFlexibleName); + return getColumnInfoFlexibleMap().containsKey(columnFlexibleName); } /** * The implementation. * - * @param columnFlexibleName The flexible name of the column. (NotNull and - * NotEmpty) + * @param columnFlexibleName The flexible name(IgnoreCase, IgnoreUnderscore) + * of the column. (NotNull, NotEmpty) * @return The information of the column. (NotNull) */ public ColumnInfo findColumnInfo(String columnFlexibleName) { assertStringNotNullAndNotTrimmedEmpty("columnFlexibleName", columnFlexibleName); - if (!hasColumn(columnFlexibleName)) { + final ColumnInfo columnInfo = getColumnInfoFlexibleMap().get( + columnFlexibleName); + if (columnInfo == null) { String msg = "Not found column by columnFlexibleName: " + columnFlexibleName; msg = msg + " tableName=" + getTableDbName(); throw new IllegalArgumentException(msg); } - String methodName = "column" - + initCap(findPropertyName(columnFlexibleName)); - Method method = null; - try { - method = this.getClass().getMethod(methodName, new Class[] {}); - } catch (NoSuchMethodException e) { - String msg = "Not found column by columnFlexibleName: " - + columnFlexibleName; - msg = msg + " tableName=" + getTableDbName() + " methodName=" - + methodName; - throw new RuntimeException(msg, e); - } - try { - return (ColumnInfo) method.invoke(this, new Object[] {}); - } catch (IllegalAccessException e) { - throw new RuntimeException(e); - } catch (java.lang.reflect.InvocationTargetException e) { - throw new RuntimeException(e.getCause()); - } + return columnInfo; } protected ColumnInfo cci(String columnDbName, String propertyName, @@ -114,7 +159,7 @@ /** * The implementation. * - * @return The list of columns. (NotNull and NotEmpty) + * @return The list of columns. (NotNull, NotEmpty) */ public List getColumnInfoList() { if (_columnInfoList != null) { @@ -144,79 +189,118 @@ } } - protected void initializeColumnInfoList() { - getColumnInfoList();// Ignore return value because of initialization - // only! + /** + * Get the flexible map of column information. + * + * @return The flexible map of column information. (NotNull, NotEmpty) + */ + protected Map getColumnInfoFlexibleMap() { + if (_columnInfoFlexibleMap != null) { + return _columnInfoFlexibleMap; + } + final List columnInfoList = getColumnInfoList(); + synchronized (this) { + if (_columnInfoFlexibleMap != null) { + return _columnInfoFlexibleMap; + } + _columnInfoFlexibleMap = StringKeyMap.createAsFlexibleConcurrent(); + for (ColumnInfo columnInfo : columnInfoList) { + _columnInfoFlexibleMap.put(columnInfo.getColumnDbName(), + columnInfo); + } + return _columnInfoFlexibleMap; + } } //========================================================================== - // =========== + // ========= + // Resource Initialization + // ======================= + protected void initializeInformationResource() { // for instance initializer + // of subclass. + // Initialize the flexible map of table DB name. + getTableDbNameFlexibleMap(); + + // Initialize the flexible map of table property name. + getTablePropertyNameFlexibleMap(); + + // Initialize the list of column information. + getColumnInfoList(); + + // Initialize the flexible map of column information. + getColumnInfoFlexibleMap(); + + // Initialize the map of (public)method name. + hasMethod("dummy"); + } + + //========================================================================== + // ========= // Name Handling // ============= /** * The implementation. * - * @param flexibleName Flexible-name(IgnoreCase). (NotNull and NotEmpty) + * @param flexibleName The flexible name(IgnoreCase, IgnoreUnderscore). + * (NotNull, NotEmpty) * @return Determination. */ public boolean hasFlexibleName(String flexibleName) { - final String key = flexibleName.toLowerCase(); - if (getDbNamePropertyNameKeyToLowerMap().containsKey(key)) { - return true; - } - if (getPropertyNameDbNameKeyToLowerMap().containsKey(key)) { - return true; - } - return false; + assertStringNotNullAndNotTrimmedEmpty("flexibleName", flexibleName); + + // It uses column before table because column is used much more than + // table. + // This is the same consideration at other methods. + return getColumnInfoFlexibleMap().containsKey(flexibleName) + || getTableDbNameFlexibleMap().containsKey(flexibleName); } /** * The implementation. * - * @param flexibleName Flexible-name(IgnoreCase). (NotNull and NotEmpty) - * @return DB name. (NotNull and NotEmpty) + * @param flexibleName The flexible name(IgnoreCase, IgnoreUnderscore). + * (NotNull, NotEmpty) + * @return DB name. (NotNull, NotEmpty) */ public String findDbName(String flexibleName) { - final String key = flexibleName.toLowerCase(); - if (getPropertyNameDbNameKeyToLowerMap().containsKey(key)) { - return (String) getPropertyNameDbNameKeyToLowerMap().get(key); + assertStringNotNullAndNotTrimmedEmpty("flexibleName", flexibleName); + final ColumnInfo columnInfoMap = getColumnInfoFlexibleMap().get( + flexibleName); + if (columnInfoMap != null) { + return columnInfoMap.getColumnDbName(); } - if (getDbNamePropertyNameKeyToLowerMap().containsKey(key)) { - final String dbNameKeyToLower = ((String) getDbNamePropertyNameKeyToLowerMap() - .get(key)).toLowerCase(); - if (getPropertyNameDbNameKeyToLowerMap().containsKey( - dbNameKeyToLower)) { - return (String) getPropertyNameDbNameKeyToLowerMap().get( - dbNameKeyToLower); - } + final String tableDbName = getTableDbNameFlexibleMap() + .get(flexibleName); + if (tableDbName != null) { + return tableDbName; } - String msg = "Not found object by the flexible name: flexibleName=" + String msg = "Not found DB name by the flexible name: flexibleName=" + flexibleName; - throw new IllegalStateException(msg); + throw new IllegalArgumentException(msg); } /** * The implementation. * - * @param flexibleName Flexible-name(IgnoreCase). (NotNull and NotEmpty) - * @return DB name. (NotNull and NotEmpty) + * @param flexibleName The flexible name(IgnoreCase, IgnoreUnderscore). + * (NotNull, NotEmpty) + * @return DB name. (NotNull, NotEmpty) */ public String findPropertyName(String flexibleName) { - final String key = flexibleName.toLowerCase(); - if (getDbNamePropertyNameKeyToLowerMap().containsKey(key)) { - return (String) getDbNamePropertyNameKeyToLowerMap().get(key); + assertStringNotNullAndNotTrimmedEmpty("flexibleName", flexibleName); + final ColumnInfo columnInfoMap = getColumnInfoFlexibleMap().get( + flexibleName); + if (columnInfoMap != null) { + return columnInfoMap.getPropertyName(); } - if (getPropertyNameDbNameKeyToLowerMap().containsKey(key)) { - final String dbNameToLower = ((String) getPropertyNameDbNameKeyToLowerMap() - .get(key)).toLowerCase(); - if (getDbNamePropertyNameKeyToLowerMap().containsKey(dbNameToLower)) { - return (String) getDbNamePropertyNameKeyToLowerMap().get( - dbNameToLower); - } + final String tablePropertyName = getTablePropertyNameFlexibleMap().get( + flexibleName); + if (tablePropertyName != null) { + return tablePropertyName; } - String msg = "Not found object by the flexible name: flexibleName=" + String msg = "Not found property name by the flexible name: flexibleName=" + flexibleName; - throw new IllegalStateException(msg); + throw new IllegalArgumentException(msg); } //========================================================================== @@ -735,10 +819,8 @@ protected void registerEntityPropertySetupper( String columnName, String propertyName, Eps setupper, Map> entityPropertySetupperMap) { + // Only column name is registered because the map must be flexible map. entityPropertySetupperMap.put(columnName, setupper); - entityPropertySetupperMap.put(propertyName, setupper); - entityPropertySetupperMap.put(columnName.toLowerCase(), setupper); - entityPropertySetupperMap.put(propertyName.toLowerCase(), setupper); } protected Eps findEps( @@ -945,6 +1027,7 @@ /** * This class is for Internal. Don't use this! */ + @SuppressWarnings("unchecked") protected static class MapStringValueAnalyzer { protected java.util.Map _valueMap; @@ -1072,6 +1155,7 @@ // ========= // Assist Helper // ============= + @SuppressWarnings("unchecked") protected ENTITY downcast(Entity entity) { checkDowncast(entity); return (ENTITY) entity; @@ -1118,10 +1202,10 @@ protected Map setupKeyToLowerMap(boolean dbNameKey) { final Map map; if (dbNameKey) { - map = newLinkedHashMap(getTableDbName().toLowerCase(), + map = newConcurrentHashMap(getTableDbName().toLowerCase(), getTablePropertyName()); } else { - map = newLinkedHashMap(getTablePropertyName().toLowerCase(), + map = newConcurrentHashMap(getTablePropertyName().toLowerCase(), getTableDbName()); } Method[] methods = this.getClass().getMethods(); @@ -1178,6 +1262,17 @@ return new HashMap(); } + protected ConcurrentHashMap newConcurrentHashMap() { + return new ConcurrentHashMap(); + } + + protected ConcurrentHashMap newConcurrentHashMap( + KEY key, VALUE value) { + ConcurrentHashMap map = newConcurrentHashMap(); + map.put(key, value); + return map; + } + protected LinkedHashMap newLinkedHashMap() { return new LinkedHashMap(); } @@ -1201,23 +1296,26 @@ // ----------------------------------------------------- // Reflection Handling // ------------------- - private Set _cachedMethodNames = new HashSet(); // for - - // performance - + /** + * Does it have the method? + * + * @param methodName The name of method. (NotNull, NotEmpty, + * PublicMethodOnly) + * @return Determination. + */ protected boolean hasMethod(String methodName) { assertStringNotNullAndNotTrimmedEmpty("methodName", methodName); - if (_cachedMethodNames.isEmpty()) { - synchronized (_cachedMethodNames) { - if (_cachedMethodNames.isEmpty()) { + if (_methodNameMap.isEmpty()) { + synchronized (_methodNameMap) { + if (_methodNameMap.isEmpty()) { final Method[] methods = this.getClass().getMethods(); for (Method method : methods) { - _cachedMethodNames.add(method.getName()); + _methodNameMap.put(method.getName(), DUMMY_VALUE); } } } } - return _cachedMethodNames.contains(methodName); + return _methodNameMap.containsKey(methodName); } // ----------------------------------------------------- Modified: bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/dbmeta/DBMeta.java =================================================================== --- bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/dbmeta/DBMeta.java 2008-12-27 22:10:35 UTC (rev 1626) +++ bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/dbmeta/DBMeta.java 2008-12-27 22:11:51 UTC (rev 1627) @@ -17,23 +17,22 @@ * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public interface DBMeta { //========================================================================== // ========= // Definition // ========== - /** Map-string map-mark. */ + /** Map-string map mark. */ public static final String MAP_STRING_MAP_MARK = "map:"; - /** Map-string list-mark. */ + /** Map-string list mark. */ public static final String MAP_STRING_LIST_MARK = "list:"; - /** Map-string start-brace. */ + /** Map-string start brace. */ public static final String MAP_STRING_START_BRACE = "@{"; - /** Map-string end-brace. */ + /** Map-string end brace. */ public static final String MAP_STRING_END_BRACE = "@}"; /** Map-string delimiter. */ @@ -47,23 +46,23 @@ // Table Info // ========== /** - * Get table db-name. + * Get table DB name. * - * @return Table db-name. (NotNull) + * @return Table DB name. (NotNull) */ public String getTableDbName(); /** - * Get table property-name(JavaBeansRule). + * Get table property name(JavaBeansRule). * - * @return Table property-name(JavaBeansRule). (NotNull) + * @return Table property name(JavaBeansRule). (NotNull) */ public String getTablePropertyName(); /** - * Get table SQL-name. + * Get table SQL name. * - * @return Table SQL-name. (NotNull) + * @return Table SQL name. (NotNull) */ public String getTableSqlName(); @@ -80,10 +79,10 @@ public boolean hasFlexibleName(String flexibleName); /** - * Find db name by flexible name. {Target objects are TABLE and COLUMN} + * Find DB name by flexible name. {Target objects are TABLE and COLUMN} * * @param flexibleName The flexible name. (NotNull and NotEmpty) - * @return Db name. (NotNull and NotEmpty) + * @return The DB name of anything. (NotNull and NotEmpty) */ public String findDbName(String flexibleName); @@ -92,60 +91,40 @@ * TABLE and COLUMN} * * @param flexibleName The flexible name. (NotNull and NotEmpty) - * @return Db name. (NotNull and NotEmpty) + * @return The DB name of anything. (NotNull and NotEmpty) */ public String findPropertyName(String flexibleName); //========================================================================== // ========= - // Name Map - // ======== - /** - * Get the key-to-lower map of DB name(lower) and property name. - * - * @return The key-to-lower map of DB name(lower) and property name. - * (NotNull) - */ - public Map 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 getPropertyNameDbNameKeyToLowerMap(); - - //========================================================================== - // ========= // Type Name // ========= /** - * Get the type-name of entity. + * Get the type name of entity. * - * @return The type-name of entity. (NotNull) + * @return The type name of entity. (NotNull) */ public String getEntityTypeName(); /** - * Get the type-name of condition-bean. + * Get the type name of condition-bean. * - * @return The type-name of condition-bean. (Nullable: If the condition-bean + * @return The type name of condition-bean. (Nullable: If the condition-bean * does not exist) */ public String getConditionBeanTypeName(); /** - * Get the type-name of dao. + * Get the type name of DAO. * - * @return The type-name of dao. (Nullable: If the dao does not exist) + * @return The type name of DAO. (Nullable: If the DAO does not exist) */ public String getDaoTypeName(); /** - * Get the type-name of behavior. + * Get the type name of behavior. * - * @return The type-name of behavior. (Nullable: If the behavior does not + * @return The type name of behavior. (Nullable: If the behavior does not * exist) */ public String getBehaviorTypeName(); Modified: bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/dbmeta/DBMetaInstanceHandler.java =================================================================== --- bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/dbmeta/DBMetaInstanceHandler.java 2008-12-27 22:10:35 UTC (rev 1626) +++ bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/dbmeta/DBMetaInstanceHandler.java 2008-12-27 22:11:51 UTC (rev 1627) @@ -1,98 +1,85 @@ package jp.sf.pal.bookmark.db.allcommon.dbmeta; -import java.util.Collections; -import java.util.LinkedHashMap; +import java.lang.reflect.Method; import java.util.Map; import java.util.Set; +import java.util.concurrent.ConcurrentHashMap; +import jp.sf.pal.bookmark.db.allcommon.helper.StringKeyMap; import jp.sf.pal.bookmark.db.allcommon.util.SimpleAssertUtil; /** - * DBMeta instance handler. + * The instance handler of DB meta. * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public class DBMetaInstanceHandler { //========================================================================== // ========= // Definition // ========== + /** Log-instance. */ + private static final org.apache.commons.logging.Log _log = org.apache.commons.logging.LogFactory + .getLog(DBMetaInstanceHandler.class); + + //========================================================================== + // ========= + // Resource Map + // ============ /** Table DB-name instance map. */ - protected static final Map _tableDbNameInstanceMap = new LinkedHashMap(); + protected static final Map _tableDbNameInstanceMap = newConcurrentHashMap(); - /** The map of table DB-name and class name. */ - protected static final Map _tableDbNameClassNameMap; - static { - Map tmpMap = new LinkedHashMap(); + /** The map of table DB name and class name. This is for initialization. */ + protected static final Map _tableDbNameClassNameMap = newConcurrentHashMap(); - tmpMap.put("BOOKMARK_CATEGORY", - "jp.sf.pal.bookmark.db.bsentity.dbmeta.BookmarkCategoryDbm"); - tmpMap.put("BOOKMARK_LINK", - "jp.sf.pal.bookmark.db.bsentity.dbmeta.BookmarkLinkDbm"); - tmpMap.put("GROUP_INFO", - "jp.sf.pal.bookmark.db.bsentity.dbmeta.GroupInfoDbm"); - tmpMap.put("GROUP_MAPPING", - "jp.sf.pal.bookmark.db.bsentity.dbmeta.GroupMappingDbm"); - tmpMap.put("ROLE_INFO", - "jp.sf.pal.bookmark.db.bsentity.dbmeta.RoleInfoDbm"); - tmpMap.put("ROLE_MAPPING", - "jp.sf.pal.bookmark.db.bsentity.dbmeta.RoleMappingDbm"); - tmpMap.put("USER_INFO", - "jp.sf.pal.bookmark.db.bsentity.dbmeta.UserInfoDbm"); + /** The flexible map of table DB name. This is for conversion at finding. */ + protected static final Map _tableDbNameFlexibleMap = StringKeyMap + .createAsFlexibleConcurrent(); - _tableDbNameClassNameMap = Collections.unmodifiableMap(tmpMap); - } + /** The count of setting up resources of DB meta for internal information. */ + protected static int setupCount = 0; - /** The key-to-lower map of DB-name and property-name for table. */ - protected static final Map _tableDbNamePropertyNameKeyToLowerMap; - static { - Map tmpMap = new LinkedHashMap(); - - tmpMap.put("BOOKMARK_CATEGORY".toLowerCase(), "bookmarkCategory"); - tmpMap.put("BOOKMARK_LINK".toLowerCase(), "bookmarkLink"); - 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("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 _tablePropertyNameDbNameKeyToLowerMap; - static { - Map tmpMap = new LinkedHashMap(); - - tmpMap.put("bookmarkCategory".toLowerCase(), "BOOKMARK_CATEGORY"); - tmpMap.put("bookmarkLink".toLowerCase(), "BOOKMARK_LINK"); - 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("userInfo".toLowerCase(), "USER_INFO"); - - _tablePropertyNameDbNameKeyToLowerMap = Collections - .unmodifiableMap(tmpMap); - } - - protected static DBMeta getDBMeta(String className) { - try { - Class clazz = Class.forName(className); - java.lang.reflect.Method methoz = clazz.getMethod("getInstance", - (Class[]) null); - Object result = methoz.invoke(null, (Object[]) null); - return (DBMeta) result; - } catch (Exception e) { - throw new RuntimeException(e); + /** + * Set up the resource of DBMeta. Lock this class. + * + * @param tableDbNameClassNameMap The map of table DB name and class name. + * (NotNull) + */ + public static synchronized void setupDBMetaResource( + Map tableDbNameClassNameMap) { + if (tableDbNameClassNameMap == null) { + String msg = "The argument 'tableDbNameClassNameMap' should not be null"; + msg = msg + " at DBMetaInstanceHandler.setupDBMetaResource()"; + throw new IllegalArgumentException(msg); } + if (tableDbNameClassNameMap.isEmpty()) { + String msg = "The argument 'tableDbNameClassNameMap' should not be empty"; + msg = msg + " at DBMetaInstanceHandler.setupDBMetaResource()"; + throw new IllegalArgumentException(msg); + } + final String firstMsg = "...Setting up resources of DB meta"; + final int tableCount = tableDbNameClassNameMap.size(); + if (setupCount == 0) { + _log.info(firstMsg + ": tables=" + tableCount); // basically here + } else { + _log.info(firstMsg + " AGAIN(" + (setupCount + 1) + + " times): tables=" + tableCount); + } + _tableDbNameInstanceMap.clear(); + _tableDbNameClassNameMap.clear(); + _tableDbNameFlexibleMap.clear(); + final Set tableDbNameSet = tableDbNameClassNameMap.keySet(); + for (String tableDbName : tableDbNameSet) { + final String className = tableDbNameClassNameMap.get(tableDbName); + _tableDbNameClassNameMap.put(tableDbName, className); + _tableDbNameFlexibleMap.put(tableDbName, tableDbName); + } + ++setupCount; } /** - * @return The initialized map that contains all instances of dbmeta. + * @return The initialized map that contains all instances of DB meta. * (NotNull & NotEmpty) */ public static Map getDBMetaMap() { @@ -125,45 +112,31 @@ // Main Method // =========== /** - * Find dbmeta by table flexible-name. + * Find DB meta by table flexible name. * *
-     * If the table name is 'ORDER_DETAIL', you can find the dbmeta by ...(as follows)
+     * If the table name is 'ORDER_DETAIL', you can find the DB meta by ...(as follows)
      *     'ORDER_DETAIL', 'ORDer_DeTAiL', 'order_detail'
      *     , 'OrderDetail', 'orderdetail', 'oRderDetaIl'
      * 
* - * @param tableFlexibleName Table flexible-name. (NotNull) - * @return The instance of dbmeta. (NotNull) - * @exception DBMetaNotFoundException When the dbmeta is not found. + * @param tableFlexibleName The flexible name of table. (NotNull) + * @return The instance of DB meta. (NotNull) + * @exception DBMetaNotFoundException When the DB meta is not found. */ public static DBMeta findDBMeta(String tableFlexibleName) { assertStringNotNullAndNotTrimmedEmpty("tableFlexibleName", tableFlexibleName); - if (_tableDbNameInstanceMap.containsKey(tableFlexibleName)) { - return byTableDbName(tableFlexibleName); - } - String toLowerKey = tableFlexibleName.toLowerCase(); - if (_tableDbNamePropertyNameKeyToLowerMap.containsKey(toLowerKey)) { - String propertyName = (String) _tableDbNamePropertyNameKeyToLowerMap - .get(toLowerKey); - String dbName = (String) _tablePropertyNameDbNameKeyToLowerMap - .get(propertyName.toLowerCase()); - return byTableDbName(dbName); - } - if (_tablePropertyNameDbNameKeyToLowerMap.containsKey(toLowerKey)) { - String dbName = (String) _tablePropertyNameDbNameKeyToLowerMap - .get(toLowerKey); - return byTableDbName(dbName); - } final int dotLastIndex = tableFlexibleName.lastIndexOf("."); if (dotLastIndex >= 0) { - try { - return findDBMeta(tableFlexibleName.substring(dotLastIndex + 1)); - } catch (DBMetaNotFoundException e) { - // Nothing - } + tableFlexibleName = tableFlexibleName.substring(dotLastIndex + + ".".length()); } + final String tableDbName = _tableDbNameFlexibleMap + .get(tableFlexibleName); + if (tableDbName != null) { + return byTableDbName(tableDbName); + } String msg = "The instance map returned null by the key: key=" + tableFlexibleName + " instanceMap=" + _tableDbNameInstanceMap; throw new DBMetaNotFoundException(msg); @@ -187,8 +160,9 @@ assertStringNotNullAndNotTrimmedEmpty("tableDbName", tableDbName); DBMeta instance = getCachedDBMeta(tableDbName); if (instance == null) { - String msg = "The instance map returned null by the key: key=" - + tableDbName + " instanceMap=" + _tableDbNameInstanceMap; + String msg = "The instance map returned null by the key:"; + msg = msg + " key=" + tableDbName + " instanceMap=" + + _tableDbNameInstanceMap; throw new DBMetaNotFoundException(msg); } return instance; @@ -210,10 +184,25 @@ return _tableDbNameInstanceMap.get(tableName); } + protected static DBMeta getDBMeta(String className) { + try { + Class clazz = Class.forName(className); + Method methoz = clazz.getMethod("getInstance", (Class[]) null); + Object result = methoz.invoke(null, (Object[]) null); + return (DBMeta) result; + } catch (Exception e) { + throw new RuntimeException(e); + } + } + //========================================================================== // ========= // General Helper // ============== + protected static ConcurrentHashMap newConcurrentHashMap() { + return new ConcurrentHashMap(); + } + // ----------------------------------------------------- // Assert Object // ------------- Modified: bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/dbmeta/hierarchy/HierarchyArranger.java =================================================================== --- bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/dbmeta/hierarchy/HierarchyArranger.java 2008-12-27 22:10:35 UTC (rev 1626) +++ bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/dbmeta/hierarchy/HierarchyArranger.java 2008-12-27 22:11:51 UTC (rev 1627) @@ -222,7 +222,6 @@ * @author DBFlute(AutoGenerator) * @param The type of local entity extends Entity */ - ¡÷ SuppressWarnings("unchecked") public class HierarchyArranger { //========================================================================== @@ -457,9 +456,9 @@ List referrerList = extractReferrerList(localEntity, referrerInfo); if (referrerList == null) { - String msg = "The referrer list should not be null: localEntity=" - + localEntity + " referrerInfo=" + referrerInfo; - throw new IllegalStateException(msg); + // Initialize the list of referrer and inject it. + referrerList = new ArrayList(); + injectReferrerList(localEntity, referrerInfo, referrerList); } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -765,8 +764,8 @@ return capPropReferrerName; } - private java.lang.reflect.Method findMethod(Class clazz, String methodName, - Class[] argTypes) { + private java.lang.reflect.Method findMethod(Class clazz, + String methodName, Class[] argTypes) { try { return clazz.getMethod(methodName, argTypes); } catch (NoSuchMethodException ex) { @@ -852,10 +851,10 @@ return sb.toString(); } - private String createTypeViewFromTypeArray(Class[] array) { + private String createTypeViewFromTypeArray(Class[] array) { final StringBuffer sb = new StringBuffer(); for (int i = 0; i < array.length; i++) { - final Class type = array[i]; + final Class type = array[i]; if (sb.length() == 0) { sb.append(type.getSimpleName()); } else { Modified: bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/dbmeta/hierarchy/HierarchyRequest.java =================================================================== --- bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/dbmeta/hierarchy/HierarchyRequest.java 2008-12-27 22:10:35 UTC (rev 1626) +++ bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/dbmeta/hierarchy/HierarchyRequest.java 2008-12-27 22:11:51 UTC (rev 1627) @@ -16,7 +16,6 @@ * @author DBFlute(AutoGenerator) * @param The type of local entity. */ - ¡÷ SuppressWarnings("unchecked") public class HierarchyRequest { //========================================================================== Modified: bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/dbmeta/hierarchy/HierarchyRequestElement.java =================================================================== --- bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/dbmeta/hierarchy/HierarchyRequestElement.java 2008-12-27 22:10:35 UTC (rev 1626) +++ bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/dbmeta/hierarchy/HierarchyRequestElement.java 2008-12-27 22:11:51 UTC (rev 1627) @@ -9,7 +9,6 @@ /** * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public class HierarchyRequestElement { //========================================================================== Modified: bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/dbmeta/hierarchy/HierarchySourceColumn.java =================================================================== --- bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/dbmeta/hierarchy/HierarchySourceColumn.java 2008-12-27 22:10:35 UTC (rev 1626) +++ bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/dbmeta/hierarchy/HierarchySourceColumn.java 2008-12-27 22:11:51 UTC (rev 1627) @@ -3,7 +3,6 @@ /** * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public interface HierarchySourceColumn { public String getColumnName(); Modified: bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/dbmeta/hierarchy/HierarchySourceIterator.java =================================================================== --- bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/dbmeta/hierarchy/HierarchySourceIterator.java 2008-12-27 22:10:35 UTC (rev 1626) +++ bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/dbmeta/hierarchy/HierarchySourceIterator.java 2008-12-27 22:11:51 UTC (rev 1627) @@ -3,7 +3,6 @@ /** * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public interface HierarchySourceIterator { public boolean hasNext(); Modified: bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/dbmeta/hierarchy/HierarchySourceRow.java =================================================================== --- bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/dbmeta/hierarchy/HierarchySourceRow.java 2008-12-27 22:10:35 UTC (rev 1626) +++ bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/dbmeta/hierarchy/HierarchySourceRow.java 2008-12-27 22:11:51 UTC (rev 1627) @@ -3,7 +3,6 @@ /** * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public interface HierarchySourceRow { public Object extractColumnValue(HierarchySourceColumn columnInfo); Modified: bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/dbmeta/info/ColumnInfo.java =================================================================== --- bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/dbmeta/info/ColumnInfo.java 2008-12-27 22:10:35 UTC (rev 1626) +++ bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/dbmeta/info/ColumnInfo.java 2008-12-27 22:11:51 UTC (rev 1627) @@ -8,7 +8,6 @@ * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public class ColumnInfo { //========================================================================== Modified: bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/dbmeta/info/RelationInfo.java =================================================================== --- bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/dbmeta/info/RelationInfo.java 2008-12-27 22:10:35 UTC (rev 1626) +++ bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/dbmeta/info/RelationInfo.java 2008-12-27 22:11:51 UTC (rev 1627) @@ -1,13 +1,14 @@ package jp.sf.pal.bookmark.db.allcommon.dbmeta.info; +import java.util.Map; + import jp.sf.pal.bookmark.db.allcommon.dbmeta.DBMeta; /** - * The class of referer information. + * The class of referrer information. * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public interface RelationInfo { public String getRelationPropertyName(); @@ -16,7 +17,7 @@ public DBMeta getTargetDBMeta(); - public java.util.Map getLocalTargetColumnInfoMap(); + public Map getLocalTargetColumnInfoMap(); public boolean isOneToOne(); Modified: bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/helper/MapStringBuilderImpl.java =================================================================== --- bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/helper/MapStringBuilderImpl.java 2008-12-27 22:10:35 UTC (rev 1626) +++ bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/helper/MapStringBuilderImpl.java 2008-12-27 22:11:51 UTC (rev 1627) @@ -1,17 +1,20 @@ package jp.sf.pal.bookmark.db.allcommon.helper; +import java.util.Arrays; +import java.util.List; + import jp.sf.pal.bookmark.db.allcommon.helper.token.line.LineToken; import jp.sf.pal.bookmark.db.allcommon.helper.token.line.LineTokenizingOption; import jp.sf.pal.bookmark.db.allcommon.helper.token.line.impl.LineTokenImpl; /** - * The implementation of map-string-builder. + * The implementation of map-string builder. * * @author DBFlute(AutoGenerator) */ public class MapStringBuilderImpl implements MapStringBuilder { - protected java.util.List _columnNameList; + protected List _columnNameList; protected String _msMapMark; @@ -26,10 +29,10 @@ protected boolean _trimDoubleQuotation; public void setColumnNames(String[] columnNames) { - _columnNameList = java.util.Arrays.asList(columnNames); + _columnNameList = Arrays.asList(columnNames); } - public void setColumnNameList(java.util.List columnNameList) { + public void setColumnNameList(List columnNameList) { _columnNameList = columnNameList; } @@ -83,7 +86,7 @@ return sb.toString(); } - public String buildFromList(java.util.List valueList) { + public String buildFromList(List valueList) { if (valueList == null) { String msg = "The argument[valueList] should not be null."; throw new IllegalArgumentException(msg); @@ -103,7 +106,7 @@ return sb.toString(); } - protected java.util.List tokenize(String value, String delimiter) { + protected List tokenize(String value, String delimiter) { final LineToken lineToken = new LineTokenImpl(); final LineTokenizingOption lineTokenizingOption = new LineTokenizingOption(); lineTokenizingOption.setDelimiter(delimiter); @@ -144,8 +147,8 @@ } } - protected void assertColumnValueList(java.util.List columnNameList, - java.util.List valueList) { + protected void assertColumnValueList(List columnNameList, + List valueList) { if (columnNameList.size() != valueList.size()) { String msg = "The length of columnNameList and valueList are difference. (" + columnNameList.size() + ", " + valueList.size() + ")"; Added: bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/helper/StringKeyMap.java =================================================================== --- bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/helper/StringKeyMap.java (rev 0) +++ bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/helper/StringKeyMap.java 2008-12-27 22:11:51 UTC (rev 1627) @@ -0,0 +1,201 @@ +package jp.sf.pal.bookmark.db.allcommon.helper; + +import java.util.Collection; +import java.util.HashMap; +import java.util.Map; +import java.util.Set; +import java.util.concurrent.ConcurrentHashMap; + +/** + * @author DBFlute(AutoGenerator) + * @param The type of value. + */ +public class StringKeyMap implements Map { + + //========================================================================== + // ========= + // Attribute + // ========= + protected final Map _internalMap; + + protected boolean _removeUnderscore; + + //========================================================================== + // ========= + // Constructor + // =========== + protected StringKeyMap(boolean removeUnderscore, boolean concurrent) { + _removeUnderscore = removeUnderscore; + if (concurrent) { + _internalMap = newConcurrentHashMap(); + } else { + _internalMap = newHashMap(); + } + } + + public static StringKeyMap createAsFlexible() { + return new StringKeyMap(true, false); + } + + public static StringKeyMap createAsFlexibleConcurrent() { + return new StringKeyMap(true, true); + } + + public static StringKeyMap createAsCaseInsensitive() { + return new StringKeyMap(false, false); + } + + public static StringKeyMap createAsCaseInsensitiveConcurrent() { + return new StringKeyMap(false, true); + } + + //========================================================================== + // ========= + // Map Emulator + // ============ + // ----------------------------------------------------- + // Key Related + // ----------- + public VALUE get(Object key) { + final String stringKey = convertStringKey(key); + if (stringKey != null) { + return _internalMap.get(stringKey); + } + return null; + } + + public VALUE put(String key, VALUE value) { + final String stringKey = convertStringKey(key); + if (stringKey != null) { + return _internalMap.put(stringKey, value); + } + return null; + } + + public VALUE remove(Object key) { + final String stringKey = convertStringKey(key); + if (stringKey != null) { + return _internalMap.remove(stringKey); + } + return null; + } + + public final void putAll(Map map) { + final Set keySet = map.keySet(); + for (String key : keySet) { + put(key, map.get(key)); + } + } + + public boolean containsKey(Object key) { + return get(key) != null; + } + + // ----------------------------------------------------- + // Delegate + // -------- + public void clear() { + _internalMap.clear(); + } + + public int size() { + return _internalMap.size(); + } + + public boolean isEmpty() { + return _internalMap.isEmpty(); + } + + public Set keySet() { + return _internalMap.keySet(); + } + + public Collection values() { + return _internalMap.values(); + } + + public boolean containsValue(Object obj) { + return _internalMap.containsValue(obj); + } + + public Set> entrySet() { + return _internalMap.entrySet(); + } + + //========================================================================== + // ========= + // Key Converter + // ============= + protected String convertStringKey(Object key) { + if (!(key instanceof String)) { + return null; + } + return toLowerCase(removeUnderscore((String) key)); + } + + protected String removeUnderscore(String value) { + if (_removeUnderscore) { + return replace(value, "_", ""); + } + return value; + } + + protected String toLowerCase(String value) { + return value.toLowerCase(); + } + + //========================================================================== + // ========= + // General Helper + // ============== + protected static String replace(String text, String fromText, String toText) { + if (text == null || fromText == null || toText == null) { + return null; + } + StringBuilder sb = new StringBuilder(100); + int pos = 0; + int pos2 = 0; + while (true) { + pos = text.indexOf(fromText, pos2); + if (pos == 0) { + sb.append(toText); + pos2 = fromText.length(); + } else if (pos > 0) { + sb.append(text.substring(pos2, pos)); + sb.append(toText); + pos2 = pos + fromText.length(); + } else { + sb.append(text.substring(pos2)); + break; + } + } + return sb.toString(); + } + + protected static ConcurrentHashMap newConcurrentHashMap() { + return new ConcurrentHashMap(); + } + + protected static HashMap newHashMap() { + return new HashMap(); + } + + //========================================================================== + // ========= + // Basic Override + // ============== + @Override + public boolean equals(Object obj) { + return _internalMap.equals(obj); + } + + @Override + public int hashCode() { + return _internalMap.hashCode(); + } + + @Override + public String toString() { + return _internalMap.toString(); + } +} \ No newline at end of file Property changes on: bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/helper/StringKeyMap.java ___________________________________________________________________ Name: svn:eol-style + native Added: bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/helper/StringSet.java =================================================================== --- bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/helper/StringSet.java (rev 0) +++ bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/helper/StringSet.java 2008-12-27 22:11:51 UTC (rev 1627) @@ -0,0 +1,233 @@ +package jp.sf.pal.bookmark.db.allcommon.helper; + +import java.util.Collection; +import java.util.HashMap; +import java.util.Iterator; +import java.util.Map; +import java.util.Set; +import java.util.concurrent.ConcurrentHashMap; + +/** + * @author DBFlute(AutoGenerator) + */ +public class StringSet implements Set { + + //========================================================================== + // ========= + // Definition + // ========== + protected static final Object DUMMY_VALUE = new Object(); + + //========================================================================== + // ========= + // Attribute + // ========= + protected final Map _internalMap; + + protected boolean _removeUnderscore; + + //========================================================================== + // ========= + // Constructor + // =========== + protected StringSet(boolean removeUnderscore, boolean concurrent) { + _removeUnderscore = removeUnderscore; + if (concurrent) { + _internalMap = newConcurrentHashMap(); + } else { + _internalMap = newHashMap(); + } + } + + public static StringSet createAsFlexible() { + return new StringSet(true, false); + } + + public static StringSet createAsFlexibleConcurrent() { + return new StringSet(true, true); + } + + public static StringSet createAsCaseInsensitive() { + return new StringSet(false, false); + } + + public static StringSet createAsCaseInsensitiveConcurrent() { + return new StringSet(false, true); + } + + //========================================================================== + // ========= + // Map Emulator + // ============ + // ----------------------------------------------------- + // Key Related + // ----------- + public boolean add(String value) { + final String stringValue = convertStringKey(value); + if (stringValue != null) { + return _internalMap.put(stringValue, DUMMY_VALUE) != null; + } + return false; + } + + public boolean remove(Object value) { + final String stringValue = convertStringKey(value); + if (stringValue != null) { + return _internalMap.remove(stringValue) != null; + } + return false; + } + + public boolean contains(Object value) { + final String stringValue = convertStringKey(value); + if (stringValue != null) { + return _internalMap.containsKey(stringValue); + } + return false; + } + + // ----------------------------------------------------- + // Delegate + // -------- + public void clear() { + _internalMap.clear(); + } + + public int size() { + return _internalMap.size(); + } + + public boolean isEmpty() { + return _internalMap.isEmpty(); + } + + public boolean addAll(Collection c) { + boolean success = false; + for (String s : c) { + if (add(s)) { + success = true; + } + } + return success; + } + + public boolean removeAll(Collection c) { + boolean success = false; + for (Object s : c) { + if (remove(s)) { + success = true; + } + } + return success; + } + + public boolean containsAll(Collection c) { + for (Object s : c) { + if (contains(s)) { + return true; + } + } + return false; + } + + public Iterator iterator() { + return _internalMap.keySet().iterator(); + } + + public boolean retainAll(Collection c) { + boolean success = false; + for (Object s : c) { + if (!contains(s)) { + if (remove(s)) { + success = true; + } + } + } + return success; + } + + public Object[] toArray() { + return _internalMap.keySet().toArray(); + } + + public T[] toArray(T[] a) { + return _internalMap.keySet().toArray(a); + } + + //========================================================================== + // ========= + // Key Converter + // ============= + protected String convertStringKey(Object value) { + if (!(value instanceof String)) { + return null; + } + return toLowerCase(removeUnderscore((String) value)); + } + + protected String removeUnderscore(String value) { + if (_removeUnderscore) { + return replace(value, "_", ""); + } + return value; + } + + protected String toLowerCase(String value) { + return value.toLowerCase(); + } + + //========================================================================== + // ========= + // General Helper + // ============== + protected static String replace(String text, String fromText, String toText) { + if (text == null || fromText == null || toText == null) { + return null; + } + StringBuilder sb = new StringBuilder(100); + int pos = 0; + int pos2 = 0; + while (true) { + pos = text.indexOf(fromText, pos2); + if (pos == 0) { + sb.append(toText); + pos2 = fromText.length(); + } else if (pos > 0) { + sb.append(text.substring(pos2, pos)); + sb.append(toText); + pos2 = pos + fromText.length(); + } else { + sb.append(text.substring(pos2)); + break; + } + } + return sb.toString(); + } + + protected static ConcurrentHashMap newConcurrentHashMap() { + return new ConcurrentHashMap(); + } + + protected static HashMap newHashMap() { + return new HashMap(); + } + + //========================================================================== + // ========= + // Basic Override + // ============== + @Override + public boolean equals(Object obj) { + return _internalMap.keySet().equals(obj); + } + + @Override + public int hashCode() { + return _internalMap.keySet().hashCode(); + } + + @Override + public String toString() { + return _internalMap.keySet().toString(); + } +} \ No newline at end of file Property changes on: bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/helper/StringSet.java ___________________________________________________________________ Name: svn:eol-style + native Added: bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/s2dao/BeanMetaDataFactoryExtension.java =================================================================== --- bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/s2dao/BeanMetaDataFactoryExtension.java (rev 0) +++ bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/s2dao/BeanMetaDataFactoryExtension.java 2008-12-27 22:11:51 UTC (rev 1627) @@ -0,0 +1,213 @@ +package jp.sf.pal.bookmark.db.allcommon.s2dao; + +import java.sql.DatabaseMetaData; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.concurrent.ConcurrentHashMap; + +import jp.sf.pal.bookmark.db.allcommon.Entity; +import jp.sf.pal.bookmark.db.allcommon.s2dao.internal.various.InternalIdentifierGeneratorFactory; + +import org.seasar.dao.BeanMetaData; +import org.seasar.dao.IdentifierGenerator; +import org.seasar.dao.impl.BeanMetaDataFactoryImpl; +import org.seasar.dao.impl.BeanMetaDataImpl; +import org.seasar.extension.jdbc.PropertyType; +import org.seasar.framework.beans.PropertyDesc; + +/** + * BeanMetaDataFactoryImpl for DBFlute. + * + * @author DBFlute(AutoGenerator) + */ + ¡÷ SuppressWarnings("unchecked") +public class BeanMetaDataFactoryExtension extends BeanMetaDataFactoryImpl { + + //========================================================================== + // ========= + // Attribute + // ========= + /** The map of bean meta data for cache. */ + protected Map, BeanMetaData> _metaMap = newConcurrentHashMap(); + + //========================================================================== + // ========= + // Override for Cache + // ================== + @Override + public BeanMetaData createBeanMetaData(Class beanClass) { + final BeanMetaData cachedMeta = findCachedMeta(beanClass); + if (cachedMeta != null) { + return cachedMeta; + } else { + return super.createBeanMetaData(beanClass); + } + } + + @Override + public BeanMetaData createBeanMetaData(Class beanClass, + int relationNestLevel) { + final BeanMetaData cachedMeta = findCachedMeta(beanClass); + if (cachedMeta != null) { + return cachedMeta; + } else { + return super.createBeanMetaData(beanClass, relationNestLevel); + } + } + + @Override + public BeanMetaData createBeanMetaData(DatabaseMetaData dbMetaData, + Class beanClass, int relationNestLevel) { + final BeanMetaData cachedMeta = findOrCreateCachedMetaIfNeeds( + dbMetaData, beanClass, relationNestLevel); + if (cachedMeta != null) { + return cachedMeta; + } else { + return super.createBeanMetaData(dbMetaData, beanClass, + relationNestLevel); + } + } + + protected BeanMetaData findCachedMeta(Class beanClass) { + if (isDBFluteEntity(beanClass)) { + final BeanMetaData cachedMeta = getMetaFromCache(beanClass); + if (cachedMeta != null) { + return cachedMeta; + } + } + return null; + } + + protected BeanMetaData findOrCreateCachedMetaIfNeeds( + DatabaseMetaData dbMetaData, Class beanClass, int relationNestLevel) { + if (isDBFluteEntity(beanClass)) { + final BeanMetaData cachedMeta = getMetaFromCache(beanClass); + if (cachedMeta != null) { + return cachedMeta; + } else { + return super.createBeanMetaData(dbMetaData, beanClass, 0); + } + } + return null; + } + + //========================================================================== + // ========= + // BeanMetaData Creation + // ===================== + @Override + protected BeanMetaDataImpl createBeanMetaDataImpl() { + // /= = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = + // = = + // for ConditionBean and insert() and update() and delete() and so on... + // = = = = = = = = = =/ + return new BeanMetaDataImpl() { + protected List _internalIdentifierGeneratorList = new ArrayList(); + + protected Map _internalIdentifierGeneratorsByPropertyName = newConcurrentHashMap(); + + // /= = = = = = = + // for cache + // = = = = =/ + @Override + public void initialize() { // for Cache + final Class myBeanClass = getBeanClass(); + if (isDBFluteEntity(myBeanClass)) { + final BeanMetaData cachedMeta = getMetaFromCache(myBeanClass); + if (cachedMeta == null) { + _metaMap.put(myBeanClass, this); + } + } + super.initialize(); + } + + // /= = = = = = = + // for insert() + // = = = = =/ + // The attributes 'identifierGenerators' and + // 'identifierGeneratorsByPropertyName' + // of super class are unused. It prepares original atributes here. + @Override + protected void setupIdentifierGenerator(PropertyType propertyType) { + final PropertyDesc pd = propertyType.getPropertyDesc(); + final String propertyName = propertyType.getPropertyName(); + final String idType = beanAnnotationReader.getId(pd, getDbms()); + final IdentifierGenerator generator = createInternalIdentifierGenerator( + propertyType, idType); + _internalIdentifierGeneratorList.add(generator); + _internalIdentifierGeneratorsByPropertyName.put(propertyName, + generator); + } + + protected IdentifierGenerator createInternalIdentifierGenerator( + PropertyType propertyType, String idType) { + return InternalIdentifierGeneratorFactory + .createIdentifierGenerator(propertyType, getDbms(), + idType); + } + + @Override + public IdentifierGenerator getIdentifierGenerator(int index) { + return _internalIdentifierGeneratorList.get(index); + } + + @Override + public int getIdentifierGeneratorSize() { + return _internalIdentifierGeneratorList.size(); + } + + @Override + public IdentifierGenerator getIdentifierGenerator( + String propertyName) { + return _internalIdentifierGeneratorsByPropertyName + .get(propertyName); + } + }; + } + + // /= = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = + // Other extension points about BeanMetaDataImpl is as follows: + // + // S2DaoMetaDataExtension.createNonConcurrencyBmdFactory() + // --> for NonConcurrency (updateNonstrict() and deleteNonstrict() and so + // on...) + // + // S2DaoMetaDataExtension.createOutsideSqlCustomizeBeanMetaDataFactory() + // --> for OutsideSql but it overrides nothing. + // = = = = = = = = = =/ + + //========================================================================== + // ========= + // Relation Next Level + // =================== + /** + * Get the limit nest level of relation. + * + * @return The limit nest level of relation. + */ + @Override + protected int getLimitRelationNestLevel() { + return 2; // for Compatible to old version DBFlute + } + + //========================================================================== + // ========= + // General Helper + // ============== + protected ConcurrentHashMap newConcurrentHashMap() { + return new ConcurrentHashMap(); + } + + //========================================================================== + // ========= + // Assist Helper + // ============= + protected boolean isDBFluteEntity(Class beanClass) { + return Entity.class.isAssignableFrom(beanClass); + } + + protected BeanMetaData getMetaFromCache(Class beanClass) { + return _metaMap.get(beanClass); + } +} \ No newline at end of file Property changes on: bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/s2dao/BeanMetaDataFactoryExtension.java ___________________________________________________________________ Name: svn:eol-style + native Deleted: bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/s2dao/FetchNarrowingResultSetFactory.java =================================================================== --- bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/s2dao/FetchNarrowingResultSetFactory.java 2008-12-27 22:10:35 UTC (rev 1626) +++ bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/s2dao/FetchNarrowingResultSetFactory.java 2008-12-27 22:11:51 UTC (rev 1627) @@ -1,125 +0,0 @@ -package jp.sf.pal.bookmark.db.allcommon.s2dao; - -import java.sql.PreparedStatement; -import java.sql.ResultSet; -import java.sql.SQLException; -import java.sql.Statement; - -import jp.sf.pal.bookmark.db.allcommon.s2dao.internal.sqlhandler.InternalBasicHandler.SQLExceptionHandler; - -import org.seasar.extension.jdbc.ResultSetFactory; - -/** - * This is unused in DBFlute so this is very NORMAL result-set-factory for - * S2Dao. - * - * @author DBFlute(AutoGenerator) - */ -public class FetchNarrowingResultSetFactory implements ResultSetFactory { - - //========================================================================== - // ========= - // Constructor - // =========== - /** - * Constructor. - */ - public FetchNarrowingResultSetFactory() { - } - - //========================================================================== - // ========= - // Main - // ==== - /** - * Get result set. - * - * @param statement Statement. (NotNull) - * @return Result set for procedure executing of s2dao. (NotNull) - */ - public ResultSet getResultSet(Statement statement) { // Unused in DBFlute - return doGetResultSet(statement); - } - - /** - * Create result set. - * - * @param ps Prepared statement. (NotNull) - * @return Result set. (NotNull) - */ - public ResultSet createResultSet(PreparedStatement ps) { // Unused in - // DBFlute - return executeQuery(ps); - - // *Move to InternalBasicSelectHandler - // if (!FetchNarrowingBeanContext.isExistFetchNarrowingBeanOnThread()) { - // return resultSet; - // } - // final FetchNarrowingBean cb = - // FetchNarrowingBeanContext.getFetchNarrowingBeanOnThread(); - // if (!isUseFetchNarrowingResultSetWrapper(cb)) { - // return resultSet; - // } - // final FetchNarrowingResultSetWrapper wrapper; - // if (OutsideSqlContext.isExistOutsideSqlContextOnThread()) { - // final OutsideSqlContext outsideSqlContext = - // OutsideSqlContext.getOutsideSqlContextOnThread(); - // wrapper = new FetchNarrowingResultSetWrapper(resultSet, cb, - // outsideSqlContext.isOffsetByCursorForcedly(), - // outsideSqlContext.isLimitByCursorForcedly()); - // } else { - // wrapper = new FetchNarrowingResultSetWrapper(resultSet, cb, false, - // false); - // } - // return wrapper; - } - - // protected boolean isUseFetchNarrowingResultSetWrapper(FetchNarrowingBean - // cb) { - // if (cb.getSafetyMaxResultSize() > 0) { - // return true; - // } - // if (!cb.isFetchNarrowingEffective()) { - // return false;// It is not necessary to control. - // } - // if (OutsideSqlContext.isExistOutsideSqlContextOnThread()) { - // final OutsideSqlContext outsideSqlContext = - // OutsideSqlContext.getOutsideSqlContextOnThread(); - // if (outsideSqlContext.isOffsetByCursorForcedly() || - // outsideSqlContext.isLimitByCursorForcedly()) { - // return true; - // } - // } - // if (cb.isFetchNarrowingSkipStartIndexEffective() || - // cb.isFetchNarrowingLoopCountEffective()) { - // return true; - // } - // return false; - // } - - //========================================================================== - // ========= - // JDBC Delegator - // ============== - protected ResultSet doGetResultSet(Statement statement) { - try { - return statement.getResultSet(); - } catch (SQLException e) { - handleSQLException(e, statement); - return null;// Unreachable! - } - } - - protected ResultSet executeQuery(PreparedStatement ps) { - try { - return ps.executeQuery(); - } catch (SQLException e) { - handleSQLException(e, ps); - return null;// Unreachable! - } - } - - protected void handleSQLException(SQLException e, Statement statement) { - new SQLExceptionHandler().handleSQLException(e, statement); - } -} Modified: bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/s2dao/FetchNarrowingResultSetWrapper.java =================================================================== --- bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/s2dao/FetchNarrowingResultSetWrapper.java 2008-12-27 22:10:35 UTC (rev 1626) +++ bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/s2dao/FetchNarrowingResultSetWrapper.java 2008-12-27 22:11:51 UTC (rev 1627) @@ -4,6 +4,7 @@ import java.sql.SQLException; import java.sql.Statement; +import jp.sf.pal.bookmark.db.allcommon.DBDef; import jp.sf.pal.bookmark.db.allcommon.cbean.FetchNarrowingBean; import jp.sf.pal.bookmark.db.allcommon.s2dao.internal.sqlhandler.InternalBasicHandler.SQLExceptionHandler; @@ -41,6 +42,9 @@ /** Does it skip to cursor end? */ protected boolean _skipToCursorEnd; + /** Is the database DB2? */ + protected final boolean _db2 = DBDef.isCurrentDef(DBDef.DB2); + //========================================================================== // ========= // Constructor @@ -71,7 +75,7 @@ // Skip // ==== /** - * Skip to start-index. + * Skip to the point at start index. */ protected void skip() { if (!isAvailableSkipRecord()) { @@ -125,12 +129,15 @@ // Next // ==== /** - * Next. + * Move to the next record. * * @return Does the result set have next record? * @throws SQLException */ public boolean next() throws SQLException { + if (_db2 && _skipToCursorEnd) { // [DBFLUTE-243] + return false; + } final boolean hasNext = super.next(); ++_requestCounter; if (!isAvailableLimitLoopCount()) { Added: bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/s2dao/PropertyTypeFactoryBuilderExtension.java =================================================================== --- bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/s2dao/PropertyTypeFactoryBuilderExtension.java (rev 0) +++ bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/s2dao/PropertyTypeFactoryBuilderExtension.java 2008-12-27 22:11:51 UTC (rev 1627) @@ -0,0 +1,215 @@ +package jp.sf.pal.bookmark.db.allcommon.s2dao; + +import java.sql.DatabaseMetaData; +import java.util.ArrayList; +import java.util.List; + +import jp.sf.pal.bookmark.db.allcommon.Entity; +import jp.sf.pal.bookmark.db.allcommon.dbmeta.DBMeta; + +import org.seasar.dao.BeanAnnotationReader; +import org.seasar.dao.ColumnNaming; +import org.seasar.dao.Dbms; +import org.seasar.dao.PropertyTypeFactory; +import org.seasar.dao.PropertyTypeFactoryBuilder; +import org.seasar.dao.ValueTypeFactory; +import org.seasar.dao.impl.AbstractPropertyTypeFactory; +import org.seasar.extension.jdbc.PropertyType; +import org.seasar.framework.beans.BeanDesc; +import org.seasar.framework.beans.PropertyDesc; + +/** + * The factory builder of property type for S2Dao. {Since S2Dao-1.0.47} + * + * @author DBFlute(AutoGenerator) + */ + ¡÷ SuppressWarnings("unchecked") +public class PropertyTypeFactoryBuilderExtension implements + PropertyTypeFactoryBuilder { + + //========================================================================== + // ========= + // Attribute + // ========= + protected ValueTypeFactory valueTypeFactory; + + protected ColumnNaming columnNaming; + + //========================================================================== + // ========= + // Build + // ===== + public PropertyTypeFactory build(Class beanClass, + BeanAnnotationReader beanAnnotationReader) { + return new FastPropertyTypeFactoryExtension(beanClass, + beanAnnotationReader, valueTypeFactory, columnNaming); + } + + public PropertyTypeFactory build(Class beanClass, + BeanAnnotationReader beanAnnotationReader, Dbms dbms, + DatabaseMetaData databaseMetaData) { + return new FastPropertyTypeFactoryExtension(beanClass, + beanAnnotationReader, valueTypeFactory, columnNaming, dbms); + } + + //========================================================================== + // ========= + // Extension Class + // =============== + protected static class FastPropertyTypeFactoryExtension extends + AbstractPropertyTypeFactory { + + protected DBMeta _dbmeta; + + protected String[] _noPersisteneProps; + + public FastPropertyTypeFactoryExtension(Class beanClass, + BeanAnnotationReader beanAnnotationReader, + ValueTypeFactory valueTypeFactory, ColumnNaming columnNaming) { + super(beanClass, beanAnnotationReader, valueTypeFactory, + columnNaming); + initializeResources(); + } + + public FastPropertyTypeFactoryExtension(Class beanClass, + BeanAnnotationReader beanAnnotationReader, + ValueTypeFactory valueTypeFactory, ColumnNaming columnNaming, + Dbms dbms) { + super(beanClass, beanAnnotationReader, valueTypeFactory, + columnNaming, dbms); + initializeResources(); + } + + protected void initializeResources() { + if (isEntity()) { + _dbmeta = findDBMeta(); + } + _noPersisteneProps = beanAnnotationReader.getNoPersisteneProps(); + } + + protected boolean isEntity() { + return Entity.class.isAssignableFrom(beanClass); + } + + protected boolean hasDBMeta() { + return _dbmeta != null; + } + + protected DBMeta findDBMeta() { + try { + final Entity entity = (Entity) beanClass.newInstance(); + return entity.getDBMeta(); + } catch (Exception e) { + String msg = "beanClass.newInstance() threw the exception: beanClass=" + + beanClass; + throw new RuntimeException(msg, e); + } + } + + public PropertyType[] createBeanPropertyTypes(String tableName) { + final List list = new ArrayList(); + final BeanDesc beanDesc = getBeanDesc(); + for (int i = 0; i < beanDesc.getPropertyDescSize(); ++i) { + final PropertyDesc pd = beanDesc.getPropertyDesc(i); + + // Read-only property is unnecessary! + if (!pd.hasWriteMethod()) { + continue; + } + + // Relation property is unnecessary! + if (isRelation(pd)) { + continue; + } + + final PropertyType pt = createPropertyType(pd); + pt.setPrimaryKey(isPrimaryKey(pd)); + pt.setPersistent(isPersistent(pt)); + list.add(pt); + } + return list.toArray(new PropertyType[list.size()]); + } + + @Override + protected boolean isRelation(PropertyDesc propertyDesc) { + final String propertyName = propertyDesc.getPropertyName(); + if (hasDBMeta() + && (_dbmeta.hasForeign(propertyName) || _dbmeta + .hasReferrer(propertyName))) { + return true; + } + return hasRelationNoAnnotation(propertyDesc); + } + + protected boolean hasRelationNoAnnotation(PropertyDesc propertyDesc) { + return beanAnnotationReader.hasRelationNo(propertyDesc); + } + + @Override + protected boolean isPrimaryKey(PropertyDesc propertyDesc) { + final String propertyName = propertyDesc.getPropertyName(); + if (hasDBMeta() && _dbmeta.hasPrimaryKey() + && _dbmeta.hasColumn(propertyName)) { + if (_dbmeta.findColumnInfo(propertyName).isPrimary()) { + return true; + } + } + return hasIdAnnotation(propertyDesc); + } + + protected boolean hasIdAnnotation(PropertyDesc propertyDesc) { + final Dbms dbms = getDbms(); + return beanAnnotationReader.getId(propertyDesc, dbms) != null; + } + + @Override + protected boolean isPersistent(PropertyType propertyType) { + final String propertyName = propertyType.getPropertyName(); + final PropertyDesc propertyDesc = propertyType.getPropertyDesc(); + if ((hasDBMeta() && _dbmeta.hasColumn(propertyName)) + || hasColumnAnnotation(propertyDesc)) { + if (!isElementOfNoPersistentProps(propertyDesc)) { + return true; + } + } + return false; + } + + protected boolean hasColumnAnnotation(PropertyDesc propertyDesc) { + return beanAnnotationReader.getColumnAnnotation(propertyDesc) != null; + } + + protected boolean isElementOfNoPersistentProps(PropertyDesc propertyDesc) { + final String propertyName = propertyDesc.getPropertyName(); + final String[] props = _noPersisteneProps; + if (props != null && props.length >= 0) { + for (int i = 0; i < props.length; ++i) { + if (props[i].equals(propertyName)) { + return true; + } + } + } + return false; + } + } + + //========================================================================== + // ========= + // Accessor + // ======== + public ValueTypeFactory getValueTypeFactory() { + return valueTypeFactory; + } + + public void setValueTypeFactory(ValueTypeFactory valueTypeFactory) { + this.valueTypeFactory = valueTypeFactory; + } + + public ColumnNaming getColumnNaming() { + return columnNaming; + } + + public void setColumnNaming(ColumnNaming columnNaming) { + this.columnNaming = columnNaming; + } +} Deleted: bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/s2dao/S2BeanMetaDataFactoryImpl.java =================================================================== --- bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/s2dao/S2BeanMetaDataFactoryImpl.java 2008-12-27 22:10:35 UTC (rev 1626) +++ bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/s2dao/S2BeanMetaDataFactoryImpl.java 2008-12-27 22:11:51 UTC (rev 1627) @@ -1,116 +0,0 @@ -package jp.sf.pal.bookmark.db.allcommon.s2dao; - -import java.sql.DatabaseMetaData; -import java.util.Collections; -import java.util.HashMap; -import java.util.Map; - -import jp.sf.pal.bookmark.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, BeanMetaData> _metaMap = Collections - .synchronizedMap(new HashMap, BeanMetaData>()); - - @Override - public BeanMetaData createBeanMetaData(Class beanClass) { - final BeanMetaData cachedMeta = findCachedMeta(beanClass); - if (cachedMeta != null) { - return cachedMeta; - } else { - return super.createBeanMetaData(beanClass); - } - } - - @Override - public BeanMetaData createBeanMetaData(Class beanClass, - int relationNestLevel) { - final BeanMetaData cachedMeta = findCachedMeta(beanClass); - if (cachedMeta != null) { - return cachedMeta; - } else { - return super.createBeanMetaData(beanClass, relationNestLevel); - } - } - - @Override - public BeanMetaData createBeanMetaData(DatabaseMetaData dbMetaData, - Class beanClass, int relationNestLevel) { - final BeanMetaData cachedMeta = findOrCreateCachedMetaIfNeeds( - dbMetaData, beanClass, relationNestLevel); - if (cachedMeta != null) { - return cachedMeta; - } else { - return super.createBeanMetaData(dbMetaData, beanClass, - relationNestLevel); - } - } - - protected BeanMetaData findCachedMeta(Class beanClass) { - if (isDBFluteEntity(beanClass)) { - final BeanMetaData cachedMeta = getMetaFromCache(beanClass); - if (cachedMeta != null) { - return cachedMeta; - } - } - return null; - } - - protected BeanMetaData findOrCreateCachedMetaIfNeeds( - DatabaseMetaData dbMetaData, Class beanClass, int relationNestLevel) { - if (isDBFluteEntity(beanClass)) { - final BeanMetaData cachedMeta = getMetaFromCache(beanClass); - if (cachedMeta != null) { - return cachedMeta; - } else { - return super.createBeanMetaData(dbMetaData, beanClass, 0); - } - } - return null; - } - - @Override - protected BeanMetaDataImpl createBeanMetaDataImpl() { - return new BeanMetaDataImpl() { - @Override - public void initialize() { - final Class myBeanClass = getBeanClass(); - if (isDBFluteEntity(myBeanClass)) { - final BeanMetaData cachedMeta = getMetaFromCache(myBeanClass); - if (cachedMeta == null) { - _metaMap.put(myBeanClass, this); - } - } - super.initialize(); - } - }; - } - - protected boolean isDBFluteEntity(Class beanClass) { - return Entity.class.isAssignableFrom(beanClass); - } - - protected BeanMetaData getMetaFromCache(Class beanClass) { - return _metaMap.get(beanClass); - } - - /** - * Get the limit nest level of relation. - * - * @return The limit nest level of relation. - */ - @Override - protected int getLimitRelationNestLevel() { - return 2;// for Compatible to old version DBFlute - } -} \ No newline at end of file Deleted: bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/s2dao/S2DaoInterceptor.java =================================================================== --- bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/s2dao/S2DaoInterceptor.java 2008-12-27 22:10:35 UTC (rev 1626) +++ bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/s2dao/S2DaoInterceptor.java 2008-12-27 22:11:51 UTC (rev 1627) @@ -1,1027 +0,0 @@ -package jp.sf.pal.bookmark.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.bookmark.db.allcommon.Entity; -import jp.sf.pal.bookmark.db.allcommon.InternalMapContext; -import jp.sf.pal.bookmark.db.allcommon.XLog; -import jp.sf.pal.bookmark.db.allcommon.cbean.ConditionBean; -import jp.sf.pal.bookmark.db.allcommon.cbean.ConditionBeanContext; -import jp.sf.pal.bookmark.db.allcommon.cbean.FetchNarrowingBean; -import jp.sf.pal.bookmark.db.allcommon.cbean.FetchNarrowingBeanContext; -import jp.sf.pal.bookmark.db.allcommon.cbean.outsidesql.OutsideSqlContext; -import jp.sf.pal.bookmark.db.allcommon.cbean.outsidesql.OutsideSqlDao; -import jp.sf.pal.bookmark.db.allcommon.cbean.outsidesql.OutsideSqlOption; -import jp.sf.pal.bookmark.db.allcommon.dbmeta.DBMeta; -import jp.sf.pal.bookmark.db.allcommon.dbmeta.DBMetaInstanceHandler; -import jp.sf.pal.bookmark.db.allcommon.exception.EntityAlreadyUpdatedException; -import jp.sf.pal.bookmark.db.allcommon.helper.stacktrace.InvokeNameExtractingResource; -import jp.sf.pal.bookmark.db.allcommon.helper.stacktrace.InvokeNameResult; -import jp.sf.pal.bookmark.db.allcommon.helper.stacktrace.impl.InvokeNameExtractorImpl; -import jp.sf.pal.bookmark.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 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 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 suffixList = Arrays.asList(new String[] { "Bhv", - "BehaviorReadable", "BehaviorWritable", "PagingInvoker" }); - final List keywordList = Arrays.asList(new String[] { "Bhv$", - "BehaviorReadable$", "BehaviorWritable$" }); - final List ousideSql1List = Arrays - .asList(new String[] { "OutsideSql" }); - final List ousideSql2List = Arrays - .asList(new String[] { "Executor" }); - final List 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 suffixList) { - for (String suffix : suffixList) { - if (className.endsWith(suffix)) { - return true; - } - } - return false; - } - - protected boolean isClassNameContains(String className, - List 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 outsideSqlType = jp.sf.pal.bookmark.db.allcommon.annotation.OutsideSql.class; - final jp.sf.pal.bookmark.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. - *

- * If this method is condition bean select target, make dynamic SQL. Else - * nothing. - * - * @param invocation Method invocation. (NotNull) - * @return ConditionBean. (Nullable) - */ - protected ConditionBean preprocessConditionBean(MethodInvocation invocation) { - final OutsideSqlContext outsideSqlContext = getOutsideSqlContext(); - if (outsideSqlContext != null) { - return null; // Because it has already finished setting up - // fetchNarrowingBean for outsideSql here. - } - - final ConditionBean cb; - { - final Object[] args = invocation.getArguments(); - if (args == null || args.length == 0) { - return null; - } - final Object arg0 = args[0]; - if (arg0 == null) { - return null; - } - if (!ConditionBeanContext.isTheTypeConditionBean(arg0.getClass())) {// The - // argument - // is - // not - // condition - // - - // bean - // ... - if (FetchNarrowingBeanContext.isTheTypeFetchNarrowingBean(arg0 - .getClass()) - && !isSelectCountIgnoreFetchScopeMethod(invocation)) { - // Fetch-narrowing-bean and Not select count! - FetchNarrowingBeanContext - .setFetchNarrowingBeanOnThread((FetchNarrowingBean) arg0); - } - return null; - } - cb = (ConditionBean) arg0; - } - - if (isSelectCountIgnoreFetchScopeMethod(invocation)) { - cb.xsetupSelectCountIgnoreFetchScope(); - } else { - FetchNarrowingBeanContext.setFetchNarrowingBeanOnThread(cb); - } - - ConditionBeanContext.setConditionBeanOnThread(cb); - return cb; - } - - /** - * Post-process condition-bean. - * - * @param invocation Method invocation. (NotNull) - * @param cb Condition-bean. (Nullable) - */ - protected void postprocessConditionBean(MethodInvocation invocation, - ConditionBean cb) { - if (cb == null) { - return; - } - if (isSelectCountIgnoreFetchScopeMethod(invocation)) { - cb.xafterCareSelectCountIgnoreFetchScope(); - } - } - - // ----------------------------------------------------- - // Clear Thread Local - // ------------------ - protected void clearThreadLocal() { - if (OutsideSqlContext.isExistOutsideSqlContextOnThread()) { - OutsideSqlContext.clearOutsideSqlContextOnThread(); - } - if (FetchNarrowingBeanContext.isExistFetchNarrowingBeanOnThread()) { - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - // Because there is possible that fetch narrowing has been ignored - // for manualPaging of outsideSql. - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - FetchNarrowingBeanContext.getFetchNarrowingBeanOnThread() - .restoreIgnoredFetchNarrowing(); - - FetchNarrowingBeanContext.clearFetchNarrowingBeanOnThread(); - } - if (ConditionBeanContext.isExistConditionBeanOnThread()) { - ConditionBeanContext.clearConditionBeanOnThread(); - } - if (InternalMapContext.isExistInternalMapContextOnThread()) { - InternalMapContext.clearInternalMapContextOnThread(); - } - } - - //========================================================================== - // ========= - // Context Helper - // ============== - protected OutsideSqlContext getOutsideSqlContext() { - if (!OutsideSqlContext.isExistOutsideSqlContextOnThread()) { - return null; - } - return OutsideSqlContext.getOutsideSqlContextOnThread(); - } - - protected boolean isSpecifiedOutsideSql() { - final OutsideSqlContext outsideSqlContext = getOutsideSqlContext(); - return outsideSqlContext != null - && outsideSqlContext.isSpecifiedOutsideSql(); - } - - protected void putObjectToMapContext(String key, Object value) { - InternalMapContext.setObject(key, value); - } - - //========================================================================== - // ========= - // Determination - // ============= - /** - * Is select count ignore-fetch-scope method? - * - * @param invocation Method invocation. (NotNull) - * @return Determination. - */ - protected boolean isSelectCountIgnoreFetchScopeMethod( - MethodInvocation invocation) { - final String name = invocation.getMethod().getName(); - return name.startsWith("readCount") || name.startsWith("selectCount"); - } - - //========================================================================== - // ========= - // General Helper - // ============== - /** - * Is the method abstract? - * - * @param method Method. (NotNull) - * @return Determination. (NotNull) - */ - public boolean isAbstract(Method method) { - final int mod = method.getModifiers(); - return Modifier.isAbstract(mod); - } - - /** - * Get the value of line separator. - * - * @return The value of line separator. (NotNull) - */ - protected String getLineSeparator() { - return System.getProperty("line.separator"); - } -} \ No newline at end of file Deleted: bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/s2dao/S2DaoLatestSqlProvider.java =================================================================== --- bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/s2dao/S2DaoLatestSqlProvider.java 2008-12-27 22:10:35 UTC (rev 1626) +++ bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/s2dao/S2DaoLatestSqlProvider.java 2008-12-27 22:11:51 UTC (rev 1627) @@ -1,20 +0,0 @@ -package jp.sf.pal.bookmark.db.allcommon.s2dao; - -import jp.sf.pal.bookmark.db.allcommon.jdbc.LatestSqlProvider; -import jp.sf.pal.bookmark.db.allcommon.s2dao.internal.sqllog.InternalSqlLogRegistry; - -/** - * The provider of latest SQL as S2Dao. This instance should be singleton. - * - * @author DBFlute(AutoGenerator) - */ -public class S2DaoLatestSqlProvider implements LatestSqlProvider { - - public String getDisplaySql() { - return InternalSqlLogRegistry.peekCompleteSql(); - } - - public void clearSqlCache() { - InternalSqlLogRegistry.clearSqlLogRegistry(); - } -} Deleted: bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/s2dao/S2DaoMetaDataExtension.java =================================================================== --- bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/s2dao/S2DaoMetaDataExtension.java 2008-12-27 22:10:35 UTC (rev 1626) +++ bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/s2dao/S2DaoMetaDataExtension.java 2008-12-27 22:11:51 UTC (rev 1627) @@ -1,1460 +0,0 @@ -package jp.sf.pal.bookmark.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.bookmark.db.allcommon.BehaviorSelector; -import jp.sf.pal.bookmark.db.allcommon.Entity; -import jp.sf.pal.bookmark.db.allcommon.annotation.OutsideSql; -import jp.sf.pal.bookmark.db.allcommon.cbean.ConditionBean; -import jp.sf.pal.bookmark.db.allcommon.cbean.ConditionBeanContext; -import jp.sf.pal.bookmark.db.allcommon.cbean.outsidesql.OutsideSqlContext; -import jp.sf.pal.bookmark.db.allcommon.dbmeta.DBMeta; -import jp.sf.pal.bookmark.db.allcommon.exception.BatchEntityAlreadyUpdatedException; -import jp.sf.pal.bookmark.db.allcommon.exception.EntityAlreadyDeletedException; -import jp.sf.pal.bookmark.db.allcommon.exception.EntityDuplicatedException; -import jp.sf.pal.bookmark.db.allcommon.jdbc.CursorHandler; -import jp.sf.pal.bookmark.db.allcommon.s2dao.internal.rshandler.InternalBeanArrayMetaDataResultSetHandler; -import jp.sf.pal.bookmark.db.allcommon.s2dao.internal.rshandler.InternalBeanListMetaDataResultSetHandler; -import jp.sf.pal.bookmark.db.allcommon.s2dao.internal.sqlcommand.InternalDeleteAutoStaticCommand; -import jp.sf.pal.bookmark.db.allcommon.s2dao.internal.sqlcommand.InternalDeleteBatchAutoStaticCommand; -import jp.sf.pal.bookmark.db.allcommon.s2dao.internal.sqlcommand.InternalDeleteQueryAutoDynamicCommand; -import jp.sf.pal.bookmark.db.allcommon.s2dao.internal.sqlcommand.InternalInsertAutoDynamicCommand; -import jp.sf.pal.bookmark.db.allcommon.s2dao.internal.sqlcommand.InternalInsertBatchAutoStaticCommand; -import jp.sf.pal.bookmark.db.allcommon.s2dao.internal.sqlcommand.InternalProcedureCommand; -import jp.sf.pal.bookmark.db.allcommon.s2dao.internal.sqlcommand.InternalUpdateAutoDynamicCommand; -import jp.sf.pal.bookmark.db.allcommon.s2dao.internal.sqlcommand.InternalUpdateBatchAutoStaticCommand; -import jp.sf.pal.bookmark.db.allcommon.s2dao.internal.sqlcommand.InternalUpdateDynamicCommand; -import jp.sf.pal.bookmark.db.allcommon.s2dao.internal.sqlcommand.InternalUpdateModifiedOnlyCommand; -import jp.sf.pal.bookmark.db.allcommon.s2dao.internal.sqlcommand.InternalUpdateQueryAutoDynamicCommand; -import jp.sf.pal.bookmark.db.allcommon.s2dao.internal.sqlhandler.InternalDeleteBatchAutoHandler; -import jp.sf.pal.bookmark.db.allcommon.s2dao.internal.sqlhandler.InternalUpdateBatchAutoHandler; -import jp.sf.pal.bookmark.db.allcommon.s2dao.internal.sqlhandler.InternalBasicHandler.SQLExceptionHandler; -import jp.sf.pal.bookmark.db.allcommon.s2dao.internal.various.InternalProcedureMetaData; -import jp.sf.pal.bookmark.db.allcommon.s2dao.internal.various.InternalProcedureMetaDataFactory; -import jp.sf.pal.bookmark.db.allcommon.s2dao.internal.various.InternalRelationRowCreator; -import jp.sf.pal.bookmark.db.allcommon.s2dao.internal.various.InternalRowCreator; -import jp.sf.pal.bookmark.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 ret = new ArrayList(); - while (rs.next()) { - ret.add(valueType.getValue(rs, 1)); - } - return ret; - } - } - - protected BeanMetaData createSpecifiedOutsideSqlCursorBeanMetaData( - Method method) { - return createOutsideSqlCustomizeBeanMetaDataFactory() - .createBeanMetaData(getOutsideSqlDefaultBeanClass(method)); - } - - protected ResultSetHandler createSpecifiedOutsideSqlCursorResultSetHandler( - BeanMetaData specifiedBeanMetaData) { - return new org.seasar.extension.jdbc.impl.ObjectResultSetHandler();// This - // is - // dummy - // for - // cursor - // handling - // ! - } - - // - - - - - - - - - - - - - // Execute - // - - - - - protected void setupSpecifiedOutsideSqlExecuteCommand(String sqlCommandKey, - Method method, OutsideSqlContext outsideSqlContext) { - // - - - - - - - - - - - - - - - - - - - - - - - - // The attribute of Specified-OutsideSqlContext. - // - - - - - - - - - - - - - - - - - - - - - - - - final String sql = outsideSqlContext.readFilteredOutsideSql( - getSqlFileEncoding(), dbms.getSuffix()); - final Object pmb = outsideSqlContext.getParameterBean(); - - // - - - - - - - - - - - - - - - - // The attribute of SqlCommand. - // - - - - - - - - - - - - - - - - final String[] argNames = (pmb != null ? new String[] { "pmb" } - : new String[] {}); - final Class[] argTypes = (pmb != null ? new Class[] { pmb - .getClass() } : new Class[] {}); - - final InternalUpdateDynamicCommand cmd = new InternalUpdateDynamicCommand( - dataSource, statementFactory) { - @Override - public Object execute(Object[] args) { - if (args.length != 3) { - String msg = "Internal Error! OutsideSqlDao.execute() should have 3 arguements: args.length=" - + args.length; - throw new IllegalStateException(msg); - } - Object arg = args[1]; - return super.execute(new Object[] { arg }); - } - }; - - // It is unnecessary for DBFlute! - // cmd.setNotSingleRowUpdatedExceptionClass( - // getNotSingleRowUpdatedExceptionClass(method)); - - registerSqlCommand(sqlCommandKey, method, sql, argNames, argTypes, cmd); - } - - // - - - - - - - - - - - - - // Call Procedure - // - - - - - - - - protected void setupSpecifiedOutsideSqlCallCommand(String sqlCommandKey, - Method method, OutsideSqlContext outsideSqlContext) { - // - - - - - - - - - - - - - - - - - - - - - - - - // The attribute of Specified-OutsideSqlContext. - // - - - - - - - - - - - - - - - - - - - - - - - - final Object pmb = outsideSqlContext.getParameterBean(); - final String procedureName = outsideSqlContext.getOutsideSqlPath(); - - // - - - - - - - - - - - - - - - - // The attribute of SqlCommand. - // - - - - - - - - - - - - - - - - final InternalProcedureMetaDataFactory factory = createInternalProcedureMetaDataFactory(); - factory.setValueTypeFactory(valueTypeFactory); - final Class pmbType = pmb != null ? pmb.getClass() : null; - final InternalProcedureMetaData metaData = factory - .createProcedureMetaData(procedureName, pmbType); - final InternalProcedureCommand cmd = createInternalProcedureCommand( - method, metaData); - putSqlCommand(sqlCommandKey, cmd); - } - - protected InternalProcedureMetaDataFactory createInternalProcedureMetaDataFactory() { - return new InternalProcedureMetaDataFactory(); - } - - protected InternalProcedureCommand createInternalProcedureCommand( - Method method, InternalProcedureMetaData metaData) { - final ResultSetHandler resultSetHandler = createResultSetHandler(method); - return new InternalProcedureCommand(dataSource, resultSetHandler, - statementFactory, metaData); - } - - // ----------------------------------------------------- - // Common of OutsideSql - // -------------------- - protected BeanMetaDataFactory createOutsideSqlCustomizeBeanMetaDataFactory() { - final S2BeanMetaDataFactoryImpl originalBmdFactory = new S2BeanMetaDataFactoryImpl() { - protected BeanMetaDataImpl createBeanMetaDataImpl() { - return newOutsideSqlCustomizeBeanMetaDataImpl(); - } - }; - originalBmdFactory - .setAnnotationReaderFactory(this.annotationReaderFactory); - originalBmdFactory - .setPropertyTypeFactoryBuilder(createOutsideSqlPropertyTypeFactoryBuilder()); - originalBmdFactory - .setRelationPropertyTypeFactoryBuilder(this.relationPropertyTypeFactoryBuilder); - originalBmdFactory.setTableNaming(this.tableNaming); - originalBmdFactory.setDataSource(this.dataSource); - originalBmdFactory.setDaoNamingConvention(this.daoNamingConvention); - originalBmdFactory.setBeanEnhancer(this.beanEnhancer); - return originalBmdFactory; - } - - protected BeanMetaDataImpl newOutsideSqlCustomizeBeanMetaDataImpl() { - return new OutsideSqlCustomizeBeanMetaDataImpl(); - } - - protected static class OutsideSqlCustomizeBeanMetaDataImpl extends - BeanMetaDataImpl { - // Though nothing to override, it uses original class just in case. - } - - protected S2DaoPropertyTypeFactoryBuilderExtension createOutsideSqlPropertyTypeFactoryBuilder() { - final S2DaoPropertyTypeFactoryBuilderExtension impl = new S2DaoPropertyTypeFactoryBuilderExtension(); - if (columnNaming == null) { - String msg = "Internal Error! The columnNaming should not be null! {Failed to Injection!}"; - throw new IllegalStateException(msg); - } - impl.setColumnNaming(columnNaming); - impl.setValueTypeFactory(valueTypeFactory); - return impl; - } - - protected Class getOutsideSqlDefaultBeanClass(Method method) { - final Class retType = method.getReturnType(); - if (java.util.List.class.isAssignableFrom(retType)) { - final Class elementType = InternalMethodUtil - .getElementTypeOfListFromReturnMethod(method); - if (elementType != null) { - return elementType; - } else { - return getBeanClass(); - } - } else if (retType.isArray()) { - return retType.getComponentType(); - } else if (retType.isPrimitive() - || !ValueTypes.getValueType(retType).equals(ValueTypes.OBJECT)) { - return getBeanClass(); - } else { - return retType; - } - } - - protected void registerSqlCommand(String sqlCommandKey, Method method, - String sql, String[] argNames, Class[] argTypes, - BeanMetaData myBeanMetaData) { - registerSqlCommand(sqlCommandKey, method, sql, argNames, argTypes, - createResultSetHandler(myBeanMetaData, method)); - } - - protected void registerSqlCommand(String sqlCommandKey, Method method, - String sql, String[] argNames, Class[] argTypes, - ResultSetHandler myResultSetHandler) { - final S2DaoSelectDynamicCommand cmd = createCustomizeSelectDynamicCommand(myResultSetHandler); - registerSqlCommand(sqlCommandKey, method, sql, argNames, argTypes, cmd); - } - - protected void registerSqlCommand(String sqlCommandKey, Method method, - String sql, String[] argNames, Class[] argTypes, - S2DaoSelectDynamicCommand cmd) { - cmd.setSql(sql); - cmd.setArgNames(argNames); - cmd.setArgTypes(argTypes); - this.sqlCommands.put(sqlCommandKey, cmd); - } - - protected void registerSqlCommand(String sqlCommandKey, Method method, - String sql, String[] argNames, Class[] argTypes, - InternalUpdateDynamicCommand cmd) { - cmd.setSql(sql); - cmd.setArgNames(argNames); - cmd.setArgTypes(argTypes); - this.sqlCommands.put(sqlCommandKey, cmd); - } - - //========================================================================== - // ========= - // Common Handlnig - // =============== - @Override - protected void putSqlCommand(String methodName, SqlCommand cmd) { - sqlCommands.put(methodName, cmd); - } - - protected boolean isCheckSingleRowUpdate(Method method) { - return checkSingleRowUpdateForAll - & daoAnnotationReader.isCheckSingleRowUpdate(method); - } - - //========================================================================== - // ========= - // Customize SelectDynamicCommand Creation - // ======================================= - /** - * Create the customize select dynamic command that is for all select SQL on - * DBFlute. - * - * @param handler The handler of result set. (NotNull) - * @return The customize select dynamic command. (NotNull) - */ - protected S2DaoSelectDynamicCommand createCustomizeSelectDynamicCommand( - ResultSetHandler handler) { - return new S2DaoSelectDynamicCommand(dataSource, statementFactory, - handler); - } - - //========================================================================== - // ========= - // ResultSetHandler Override - // ========================= - @Override - protected ResultSetHandler createResultSetHandler(Method method) { - return this.resultSetHandlerFactory.getResultSetHandler( - daoAnnotationReader, beanMetaData, method); - } - - protected ResultSetHandler createResultSetHandler( - BeanMetaData specifiedBeanMetaData, Method method) {// For specified - // BeanMetaData - return this.resultSetHandlerFactory.getResultSetHandler( - daoAnnotationReader, specifiedBeanMetaData, method); - } - - //========================================================================== - // ========= - // JDBC Delegator - // ============== - protected Connection getConnection() { - if (dataSource == null) { - throw new IllegalStateException( - "The dataSource should not be null!"); - } - try { - return dataSource.getConnection(); - } catch (SQLException e) { - handleSQLException(e, null); - return null;// Unreachable! - } - } - - protected DatabaseMetaData getMetaData(Connection conn) { - try { - return conn.getMetaData(); - } catch (SQLException e) { - handleSQLException(e, null); - return null;// Unreachable! - } - } - - protected String getDatabaseProductName(DatabaseMetaData dbMetaData) { - try { - return dbMetaData.getDatabaseProductName(); - } catch (SQLException e) { - handleSQLException(e, null); - return null;// Unreachable! - } - } - - protected void close(Connection conn) { - if (conn == null) { - return; - } - try { - conn.close(); - } catch (SQLException e) { - handleSQLException(e, null); - } - } - - //========================================================================== - // ========= - // Exception Handlnig - // ================== - protected void handleSQLException(SQLException e, Statement statement) { - new SQLExceptionHandler().handleSQLException(e, statement); - } - - //========================================================================== - // ========= - // ResultSetHandlerFactoryImpl Extension - // ===================================== - public static class ResultSetHandlerFactoryExtension extends - ResultSetHandlerFactoryImpl { - public ResultSetHandlerFactoryExtension() { - super(); - } - - @Override - protected RowCreator createRowCreator() { // [DAO-118] (2007/08/25) - return createInternalRowCreator(null); - } - - @Override - protected RelationRowCreator createRelationRowCreator() { - return createInternalRelationRowCreator(null); - } - - @Override - protected ResultSetHandler createBeanListMetaDataResultSetHandler( - BeanMetaData bmd) { // DBFlute Target - final InternalRowCreator rowCreator = createInternalRowCreator(bmd); - final InternalRelationRowCreator relationRowCreator = createInternalRelationRowCreator(bmd); - return new InternalBeanListMetaDataResultSetHandler(bmd, - rowCreator, relationRowCreator); - } - - @Override - protected ResultSetHandler createBeanArrayMetaDataResultSetHandler( - BeanMetaData bmd) { // DBFlute Target - final InternalRowCreator rowCreator = createInternalRowCreator(bmd); - final InternalRelationRowCreator relationRowCreator = createInternalRelationRowCreator(bmd); - return new InternalBeanArrayMetaDataResultSetHandler(bmd, - rowCreator, relationRowCreator); - } - - protected InternalRowCreator createInternalRowCreator(BeanMetaData bmd) { - final Class clazz = bmd != null ? bmd.getBeanClass() : null; - return InternalRowCreator.createInternalRowCreator(clazz); - } - - protected InternalRelationRowCreator createInternalRelationRowCreator( - BeanMetaData bmd) { - return new InternalRelationRowCreator(); // Not yet implemented - // about performance - // tuning! - } - } - - //========================================================================== - // ========= - // Vert Internal - // ============= - protected static class InternalMethodUtil { - public static Class getElementTypeOfListFromReturnMethod(Method method) { - return InternalReflectionUtil - .getElementTypeOfListFromReturnType(method); - } - } - - protected static class InternalReflectionUtil { - public static Class getElementTypeOfList(final Type parameterizedList) { - if (!(parameterizedList instanceof ParameterizedType)) { - return null; - } - final ParameterizedType parameterizedType = ParameterizedType.class - .cast(parameterizedList); - final Type rawType = parameterizedType.getRawType(); - if (!(rawType instanceof Class)) { - return null; - } - final Class rawClass = Class.class.cast(rawType); - if (!rawClass.isAssignableFrom(List.class)) { - return null; - } - final Type[] actualTypeArgument = parameterizedType - .getActualTypeArguments(); - if (actualTypeArgument == null || actualTypeArgument.length != 1) { - return null; - } - if (!(actualTypeArgument[0] instanceof Class)) { - return null; - } - return Class.class.cast(actualTypeArgument[0]); - } - - public static Class getElementTypeOfListFromParameterType( - final Method method, final int parameterPosition) { - final Type[] pmbTypes = method.getGenericParameterTypes(); - return getElementTypeOfList(pmbTypes[parameterPosition]); - } - - public static Class getElementTypeOfListFromReturnType( - final Method method) { - return getElementTypeOfList(method.getGenericReturnType()); - } - } - - //========================================================================== - // ========= - // Assist Helper - // ============= - protected DBMeta findDBMeta() { - final Class beanType = getBeanClass(); - if (beanType == null) { - return null; - } - if (!Entity.class.isAssignableFrom(beanType)) { - return null; - } - final Entity entity; - try { - entity = (Entity) beanType.newInstance(); - } catch (InstantiationException e) { - throw new IllegalStateException(e); - } catch (IllegalAccessException e) { - throw new IllegalStateException(e); - } - return entity.getDBMeta(); - } - - //========================================================================== - // ========= - // General Helper - // ============== - protected String getLineSeparator() { - return SimpleSystemUtil.getLineSeparator(); - } - - //========================================================================== - // ========= - // Accessor - // ======== - // ----------------------------------------------------- - // Sql File Encoding - // ----------------- - public String getSqlFileEncoding() { - return sqlFileEncoding; - } - - // ----------------------------------------------------- - // Bean Enhancer - // ------------- - public BeanEnhancer getBeanEnhancer() { - return beanEnhancer; - } - - public void setBeanEnhancer(final BeanEnhancer beanEnhancer) { - this.beanEnhancer = beanEnhancer; - } - - // ----------------------------------------------------- - // Annotation Reader Factory - // ------------------------- - public void setAnnotationReaderFactory( - org.seasar.dao.AnnotationReaderFactory annotationReaderFactory) { - this.annotationReaderFactory = annotationReaderFactory; - } - - // ----------------------------------------------------- - // Version After 1.0.47 - // -------------------- - public ColumnNaming getColumnNaming() { - return columnNaming; - } - - public void setColumnNaming(final ColumnNaming columnNaming) { - this.columnNaming = columnNaming; - } - - public PropertyTypeFactoryBuilder getPropertyTypeFactoryBuilder() { - return propertyTypeFactoryBuilder; - } - - public void setPropertyTypeFactoryBuilder( - final PropertyTypeFactoryBuilder propertyTypeFactoryBuilder) { - this.propertyTypeFactoryBuilder = propertyTypeFactoryBuilder; - } - - public RelationPropertyTypeFactoryBuilder getRelationPropertyTypeFactoryBuilder() { - return relationPropertyTypeFactoryBuilder; - } - - public void setRelationPropertyTypeFactoryBuilder( - final RelationPropertyTypeFactoryBuilder relationPropertyTypeFactoryBuilder) { - this.relationPropertyTypeFactoryBuilder = relationPropertyTypeFactoryBuilder; - } - - public TableNaming getTableNaming() { - return tableNaming; - } - - public void setTableNaming(final TableNaming tableNaming) { - this.tableNaming = tableNaming; - } - - // ----------------------------------------------------- - // DBFlute Extension - // ----------------- - public BehaviorSelector getBehaviorSelector() { - return _behaviorSelector; - } - - public void setBehaviorSelector(final BehaviorSelector behaviorSelector) { - this._behaviorSelector = behaviorSelector; - } - - public boolean isInternalDebug() { - return _internalDebug; - } - - public void setInternalDebug(final boolean internalDebug) { - this._internalDebug = internalDebug; - } -} Deleted: bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/s2dao/S2DaoMetaDataFactoryImpl.java =================================================================== --- bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/s2dao/S2DaoMetaDataFactoryImpl.java 2008-12-27 22:10:35 UTC (rev 1626) +++ bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/s2dao/S2DaoMetaDataFactoryImpl.java 2008-12-27 22:11:51 UTC (rev 1627) @@ -1,655 +0,0 @@ -package jp.sf.pal.bookmark.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.bookmark.db.allcommon.DBFluteConfig; -import jp.sf.pal.bookmark.db.allcommon.cbean.ConditionBean; -import jp.sf.pal.bookmark.db.allcommon.cbean.ConditionBeanContext; -import jp.sf.pal.bookmark.db.allcommon.cbean.outsidesql.OutsideSqlContext; -import jp.sf.pal.bookmark.db.allcommon.jdbc.StatementConfig; -import jp.sf.pal.bookmark.db.allcommon.s2dao.internal.sqlhandler.InternalBasicHandler.SQLExceptionHandler; -import jp.sf.pal.bookmark.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 daoMetaDataCache = new HashMap(); - - protected boolean initialized; - - protected boolean useDaoClassForLog; - - protected String sqlFileEncoding; - - protected BeanEnhancer beanEnhancer; - - // ----------------------------------------------------- - // Version After 1.0.47 - // -------------------- - /** The naming of column. {After S2Dao-1.0.47} */ - protected ColumnNaming columnNaming; - - /** The builder of property type factory. {After S2Dao-1.0.47} */ - protected PropertyTypeFactoryBuilder propertyTypeFactoryBuilder; - - /** The builder of relation property type factory. {After S2Dao-1.0.47} */ - protected RelationPropertyTypeFactoryBuilder relationPropertyTypeFactoryBuilder; - - /** The builder of table naming. {After S2Dao-1.0.47} */ - protected TableNaming tableNaming; - - // ----------------------------------------------------- - // DBFlute Extension - // ----------------- - /** The lock monitor of DAO meta data initialization. */ - protected Object _daoMetaDataInitializationLockMonitor = new Object(); - - //========================================================================== - // ========= - // Constructor - // =========== - public S2DaoMetaDataFactoryImpl(DataSource dataSource, - AnnotationReaderFactory annotationReaderFactory, - XADataSource xaDataSource) { - this.dataSource = dataSource; - this.annotationReaderFactory = annotationReaderFactory; - - _log - .info("/* * * * * * * * * * * * * * * * * * * * * * * * * * * * {DBFlute}"); - showInformation(dataSource, xaDataSource); - - // Stop the LinkageError! - ConditionBeanContext.initialize(); - - initializeDatabaseProductNameOfContext(xaDataSource); - - handleSqlLogRegistry(); - - DBFluteConfig.getInstance().lock(); - _log.info("* * * * */"); - } - - protected void showInformation(javax.sql.DataSource dataSource, - javax.sql.XADataSource xaDataSource) { - final StringBuilder sb = new StringBuilder(); - if (xaDataSource != null - && xaDataSource instanceof org.seasar.extension.dbcp.impl.XADataSourceImpl) { - final org.seasar.extension.dbcp.impl.XADataSourceImpl xaDataSourceImpl = (org.seasar.extension.dbcp.impl.XADataSourceImpl) xaDataSource; - final String driverClassName = xaDataSourceImpl - .getDriverClassName(); - final String url = xaDataSourceImpl.getURL(); - final String user = xaDataSourceImpl.getUser(); - sb.append(" [XADataSource]:").append(getLineSeparator()); - sb.append(" driver = " + driverClassName).append( - getLineSeparator()); - sb.append(" url = " + url).append(getLineSeparator()); - sb.append(" user = " + user); - } - _log.info("{Injection Information}" + getLineSeparator() + sb); - } - - protected void handleSqlLogRegistry() { - final StringBuilder sb = new StringBuilder(); - sb.append("{SqlLog Information}").append(getLineSeparator()); - sb.append(" [SqlLogRegistry]").append(getLineSeparator()); - if (DBFluteConfig.getInstance().isUseSqlLogRegistry()) { - if (InternalSqlLogRegistry.setupSqlLogRegistry()) { - sb - .append( - " ...Setting up SqlLogRegistry(org.seasar.extension.jdbc)!") - .append(getLineSeparator()); - sb - .append(" Because the property 'useSqlLogRegistry' of the config of DBFlute is true."); - } else { - sb - .append(" SqlLogRegistry(org.seasar.extension.jdbc) is not supported at the version!"); - } - } else { - final Object sqlLogRegistry = InternalSqlLogRegistry - .findContainerSqlLogRegistry(); - if (sqlLogRegistry != null) { - InternalSqlLogRegistry.closeRegistration(); - sb - .append( - " SqlLogRegistry(org.seasar.extension.jdbc) is close! It's default for DBFlute.") - .append(getLineSeparator()); - sb - .append(" If you want to use this, set SqlLogRegistry to SqlLogRegistryLocator at yourself."); - } else { - sb - .append(" SqlLogRegistry(org.seasar.extension.jdbc) is not available!"); - } - } - _log.info(sb); - } - - // ----------------------------------------------------- - // Database Product Name - // --------------------- - protected void initializeDatabaseProductNameOfContext( - javax.sql.XADataSource xaDataSource) { - if (getDatabaseProductNameFromContext() != null) { - return; - } - - // From JDBC Driver! - if (xaDataSource != null - && xaDataSource instanceof org.seasar.extension.dbcp.impl.XADataSourceImpl) { - final org.seasar.extension.dbcp.impl.XADataSourceImpl xaDataSourceImpl = (org.seasar.extension.dbcp.impl.XADataSourceImpl) xaDataSource; - final String driverClassName = xaDataSourceImpl - .getDriverClassName(); - if (driverClassName != null) { - if (setupDatabaseProductNameByDriverClassName(driverClassName)) { - _log - .info("...Initializing database product name from driverClassName: " - + getDatabaseProductNameFromContext()); - return; - } - } - } - - _log.info("...Initializing database product name as default: H2"); - setDatabaseProductNameToContext("H2"); - } - - protected String getDatabaseProductNameFromContext() { - return ConditionBeanContext.getDatabaseProductName(); - } - - protected void setDatabaseProductNameToContext(String name) { - ConditionBeanContext.setDatabaseProductName(name); - } - - protected boolean setupDatabaseProductNameByDriverClassName( - String driverClassName) { - return ConditionBeanContext - .setupDatabaseProductNameByDriverClassName(driverClassName); - } - - //========================================================================== - // ========= - // Implementation - // ============== - @SuppressWarnings("unchecked") - public DaoMetaData getDaoMetaData(final Class daoClass) { - if (!initialized) { - DisposableUtil.add(this); - initialized = true; - } - final String key = daoClass.getName(); - - // [A] - DaoMetaData dmd = getSynchronizedDaoMetaDataCache(key); - - // [B] - if (dmd != null) { - return dmd; - } - - // [C] - synchronized (_daoMetaDataInitializationLockMonitor) {// One Thread Only - // Entered - // [D] - dmd = getSynchronizedDaoMetaDataCache(key); - // [E] - if (dmd != null) { - // The second thread that stops at [C] can find - // because the first thread have already initialized. - if (_log.isDebugEnabled()) { - _log - .debug("...Getting daoMetaData as cache because the previous thread have already initilized."); - } - return dmd; - } - // [F] - if (_log.isDebugEnabled()) { - _log.debug("...Creating daoMetaData for " - + daoClass.getSimpleName() + "."); - } - final DaoMetaData dmdi = createDaoMetaData(daoClass); - putSynchronizedDaoMetaDataCache(key, dmdi); - } - // [G] - dmd = getSynchronizedDaoMetaDataCache(key); - if (dmd != null) { - return dmd; - } - String msg = "The cache should have data meta data here: key=" + key - + " cache=" + daoMetaDataCache; - throw new IllegalStateException(msg); - } - - @SuppressWarnings("unchecked") - protected void putSynchronizedDaoMetaDataCache(String key, DaoMetaData dmd) { - synchronized (daoMetaDataCache) { - daoMetaDataCache.put(key, dmd); - } - } - - protected DaoMetaData getSynchronizedDaoMetaDataCache(String key) { - DaoMetaData dmd = null; - synchronized (daoMetaDataCache) { - dmd = (DaoMetaData) daoMetaDataCache.get(key); - } - return dmd; - } - - //========================================================================== - // ========= - // DataMetaData Creation - // ===================== - protected DaoMetaData createDaoMetaData(final Class daoClass) { - final BeanDesc daoBeanDesc = BeanDescFactory.getBeanDesc(daoClass); - final DaoAnnotationReader daoAnnotationReader = annotationReaderFactory - .createDaoAnnotationReader(daoBeanDesc); - - final DaoMetaDataImpl daoMetaData = createDaoMetaDataExtension(); - daoMetaData.setDaoClass(daoClass); - daoMetaData.setDataSource(dataSource); - daoMetaData.setStatementFactory(createCustomizeStatememtFactory()); - daoMetaData.setResultSetFactory(createCustomizeResultSetFactory()); - daoMetaData.setValueTypeFactory(valueTypeFactory); - daoMetaData.setBeanMetaDataFactory(getBeanMetaDataFactory()); - daoMetaData.setDaoNamingConvention(getDaoNamingConvention()); - daoMetaData.setUseDaoClassForLog(useDaoClassForLog); - daoMetaData.setDaoAnnotationReader(daoAnnotationReader); - daoMetaData.setProcedureMetaDataFactory(procedureMetaDataFactory); - daoMetaData.setDtoMetaDataFactory(dtoMetaDataFactory); - daoMetaData.setResultSetHandlerFactory(resultSetHandlerFactory); - if (sqlFileEncoding != null) { - daoMetaData.setSqlFileEncoding(sqlFileEncoding); - } - if (pagingSqlRewriter != null) { - daoMetaData.setPagingSQLRewriter(pagingSqlRewriter); - } - daoMetaData.initialize(); - return daoMetaData; - } - - protected S2DaoMetaDataExtension createDaoMetaDataExtension() { - final S2DaoMetaDataExtension dmdExtension = newDaoMetaDataExtension(); - dmdExtension.setBeanEnhancer(beanEnhancer); - dmdExtension.setAnnotationReaderFactory(this.annotationReaderFactory); - dmdExtension.setColumnNaming(this.columnNaming); - dmdExtension - .setPropertyTypeFactoryBuilder(this.propertyTypeFactoryBuilder); - dmdExtension - .setRelationPropertyTypeFactoryBuilder(this.relationPropertyTypeFactoryBuilder); - dmdExtension.setTableNaming(tableNaming); - dmdExtension.setInternalDebug(DBFluteConfig.getInstance() - .isInternalDebug()); - return dmdExtension; - } - - protected S2DaoMetaDataExtension newDaoMetaDataExtension() { - return new S2DaoMetaDataExtension(); - } - - //========================================================================== - // ========= - // Result Set Factory - // ================== - /** - * Create the customize result set factory that is for all SQL on DBFlute. - * - * @return The customize statement factory. (NotNull) - */ - protected ResultSetFactory createCustomizeResultSetFactory() { - return new FetchNarrowingResultSetFactory(); - } - - //========================================================================== - // ========= - // Statement Factory - // ================= - /** - * Create the customize statement factory that is for all SQL on DBFlute. - * - * @return The customize statement factory. (NotNull) - */ - protected StatementFactory createCustomizeStatememtFactory() { - final StatementConfig defaultStatementConfig = DBFluteConfig - .getInstance().getDefaultStatementConfig(); - final boolean internalDebug = DBFluteConfig.getInstance() - .isInternalDebug(); - return new StatementFactory() { - public PreparedStatement createPreparedStatement(Connection con, - String sql) { - try { - final StatementConfig config = findStatementConfigOnThread(); - ; - final int resultSetType; - if (config != null && config.hasResultSetType()) { - resultSetType = config.getResultSetType(); - } else if (defaultStatementConfig != null - && defaultStatementConfig.hasResultSetType()) { - resultSetType = defaultStatementConfig - .getResultSetType(); - } else { - resultSetType = java.sql.ResultSet.TYPE_FORWARD_ONLY; - } - final int resultSetConcurrency = java.sql.ResultSet.CONCUR_READ_ONLY; - if (internalDebug) { - _log.debug("...Creating prepareStatement(sql, " - + resultSetType + ", " + resultSetConcurrency - + ")"); - } - final PreparedStatement ps = con.prepareStatement(sql, - resultSetType, resultSetConcurrency); - if (config != null && config.hasStatementOptions()) { - if (internalDebug) { - _log - .debug("...Setting statement config as request: " - + config); - } - reflectStatementOptions(config, ps); - } else { - reflectDefaultOptionsToStatementIfNeeds(ps); - } - return ps; - } catch (SQLException e) { - handleSQLException(e, null); - return null;// Unreachable! - } - } - - public CallableStatement createCallableStatement(Connection conn, - String sql) { - return prepareCall(conn, sql); - } - - protected StatementConfig findStatementConfigOnThread() { - final StatementConfig config; - if (ConditionBeanContext.isExistConditionBeanOnThread()) { - final ConditionBean cb = ConditionBeanContext - .getConditionBeanOnThread(); - config = cb.getStatementConfig(); - } else if (OutsideSqlContext.isExistOutsideSqlContextOnThread()) { - final OutsideSqlContext context = OutsideSqlContext - .getOutsideSqlContextOnThread(); - config = context.getStatementConfig(); - } else { - config = null; - } - return config; - } - - protected void reflectDefaultOptionsToStatementIfNeeds( - PreparedStatement ps) { - if (defaultStatementConfig != null - && defaultStatementConfig.hasStatementOptions()) { - if (internalDebug) { - _log.debug("...Setting statement config as default: " - + defaultStatementConfig); - } - reflectStatementOptions(defaultStatementConfig, ps); - return; - } - } - - protected void reflectStatementOptions(StatementConfig config, - PreparedStatement ps) { - try { - if (config.hasQueryTimeout()) { - ps.setQueryTimeout(config.getQueryTimeout()); - } - if (config.hasFetchSize()) { - ps.setFetchSize(config.getFetchSize()); - } - if (config.hasMaxRows()) { - ps.setMaxRows(config.getMaxRows()); - } - } catch (SQLException e) { - handleSQLException(e, ps); - } - } - - protected CallableStatement prepareCall(Connection conn, String sql) { - try { - return conn.prepareCall(sql); - } catch (SQLException e) { - handleSQLException(e, null); - return null;// Unreachable! - } - } - - protected void handleSQLException(SQLException e, - Statement statement) { - new SQLExceptionHandler().handleSQLException(e, statement); - } - }; - } - - //========================================================================== - // ========= - // Dispose - // ======= - public synchronized void dispose() { - daoMetaDataCache.clear(); - initialized = false; - } - - //========================================================================== - // ========= - // Helper - // ====== - /** - * Get the value of line separator. - * - * @return The value of line separator. (NotNull) - */ - protected static String getLineSeparator() { - return System.getProperty("line.separator"); - } - - //========================================================================== - // ========= - // Accessor - // ======== - // ----------------------------------------------------- - // Factory Basic - // ------------- - public void setValueTypeFactory(final ValueTypeFactory valueTypeFactory) { - this.valueTypeFactory = valueTypeFactory; - } - - protected BeanMetaDataFactory getBeanMetaDataFactory() { - return beanMetaDataFactory; - } - - public void setBeanMetaDataFactory( - final BeanMetaDataFactory beanMetaDataFactory) { - this.beanMetaDataFactory = beanMetaDataFactory; - } - - public DaoNamingConvention getDaoNamingConvention() { - return daoNamingConvention; - } - - public void setDaoNamingConvention( - final DaoNamingConvention daoNamingConvention) { - this.daoNamingConvention = daoNamingConvention; - } - - public void setAnnotationReaderFactory( - final AnnotationReaderFactory annotationReaderFactory) { - this.annotationReaderFactory = annotationReaderFactory; - } - - public void setDataSource(final DataSource dataSource) { - this.dataSource = dataSource; - } - - public void setUseDaoClassForLog(final boolean userDaoClassForLog) { - useDaoClassForLog = userDaoClassForLog; - } - - public void setResultSetHandlerFactory( - final ResultSetHandlerFactory resultSetHandlerFactory) { - this.resultSetHandlerFactory = resultSetHandlerFactory; - } - - public void setDtoMetaDataFactory( - final DtoMetaDataFactory dtoMetaDataFactory) { - this.dtoMetaDataFactory = dtoMetaDataFactory; - } - - public void setProcedureMetaDataFactory( - ProcedureMetaDataFactory procedureMetaDataFactory) { - this.procedureMetaDataFactory = procedureMetaDataFactory; - } - - public void setPagingSQLRewriter(final PagingSqlRewriter pagingSqlRewriter) { - this.pagingSqlRewriter = pagingSqlRewriter; - } - - public String getSqlFileEncoding() { - return sqlFileEncoding; - } - - public void setSqlFileEncoding(final String encoding) { - sqlFileEncoding = encoding; - } - - public BeanEnhancer getBeanEnhancer() { - return beanEnhancer; - } - - public void setBeanEnhancer(final BeanEnhancer beanEnhancer) { - this.beanEnhancer = beanEnhancer; - } - - // ----------------------------------------------------- - // Version After 1.0.47 - // -------------------- - public ColumnNaming getColumnNaming() { - return columnNaming; - } - - public void setColumnNaming(final ColumnNaming columnNaming) { - this.columnNaming = columnNaming; - } - - public PropertyTypeFactoryBuilder getPropertyTypeFactoryBuilder() { - return propertyTypeFactoryBuilder; - } - - public void setPropertyTypeFactoryBuilder( - final PropertyTypeFactoryBuilder propertyTypeFactoryBuilder) { - this.propertyTypeFactoryBuilder = propertyTypeFactoryBuilder; - } - - public RelationPropertyTypeFactoryBuilder getRelationPropertyTypeFactoryBuilder() { - return relationPropertyTypeFactoryBuilder; - } - - public void setRelationPropertyTypeFactoryBuilder( - final RelationPropertyTypeFactoryBuilder relationPropertyTypeFactoryBuilder) { - this.relationPropertyTypeFactoryBuilder = relationPropertyTypeFactoryBuilder; - } - - public TableNaming getTableNaming() { - return tableNaming; - } - - public void setTableNaming(final TableNaming tableNaming) { - this.tableNaming = tableNaming; - } -} \ No newline at end of file Deleted: bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/s2dao/S2DaoPropertyTypeFactoryBuilderExtension.java =================================================================== --- bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/s2dao/S2DaoPropertyTypeFactoryBuilderExtension.java 2008-12-27 22:10:35 UTC (rev 1626) +++ bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/s2dao/S2DaoPropertyTypeFactoryBuilderExtension.java 2008-12-27 22:11:51 UTC (rev 1627) @@ -1,215 +0,0 @@ -package jp.sf.pal.bookmark.db.allcommon.s2dao; - -import java.sql.DatabaseMetaData; -import java.util.ArrayList; -import java.util.List; - -import jp.sf.pal.bookmark.db.allcommon.Entity; -import jp.sf.pal.bookmark.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 list = new ArrayList(); - final BeanDesc beanDesc = getBeanDesc(); - for (int i = 0; i < beanDesc.getPropertyDescSize(); ++i) { - final PropertyDesc pd = beanDesc.getPropertyDesc(i); - - // Read-only property is unnecessary! - if (!pd.hasWriteMethod()) { - continue; - } - - // Relation property is unnecessary! - if (isRelation(pd)) { - continue; - } - - final PropertyType pt = createPropertyType(pd); - pt.setPrimaryKey(isPrimaryKey(pd)); - pt.setPersistent(isPersistent(pt)); - list.add(pt); - } - return list.toArray(new PropertyType[list.size()]); - } - - @Override - protected boolean isRelation(PropertyDesc propertyDesc) { - final String propertyName = propertyDesc.getPropertyName(); - if (hasDBMeta() - && (_dbmeta.hasForeign(propertyName) || _dbmeta - .hasReferrer(propertyName))) { - return true; - } - return hasRelationNoAnnotation(propertyDesc); - } - - protected boolean hasRelationNoAnnotation(PropertyDesc propertyDesc) { - return beanAnnotationReader.hasRelationNo(propertyDesc); - } - - @Override - protected boolean isPrimaryKey(PropertyDesc propertyDesc) { - final String propertyName = propertyDesc.getPropertyName(); - if (hasDBMeta() && _dbmeta.hasPrimaryKey() - && _dbmeta.hasColumn(propertyName)) { - if (_dbmeta.findColumnInfo(propertyName).isPrimary()) { - return true; - } - } - return hasIdAnnotation(propertyDesc); - } - - protected boolean hasIdAnnotation(PropertyDesc propertyDesc) { - final Dbms dbms = getDbms(); - return beanAnnotationReader.getId(propertyDesc, dbms) != null; - } - - @Override - protected boolean isPersistent(PropertyType propertyType) { - final String propertyName = propertyType.getPropertyName(); - final PropertyDesc propertyDesc = propertyType.getPropertyDesc(); - if ((hasDBMeta() && _dbmeta.hasColumn(propertyName)) - || hasColumnAnnotation(propertyDesc)) { - if (!isElementOfNoPersistentProps(propertyDesc)) { - return true; - } - } - return false; - } - - protected boolean hasColumnAnnotation(PropertyDesc propertyDesc) { - return beanAnnotationReader.getColumnAnnotation(propertyDesc) != null; - } - - protected boolean isElementOfNoPersistentProps(PropertyDesc propertyDesc) { - final String propertyName = propertyDesc.getPropertyName(); - final String[] props = _noPersisteneProps; - if (props != null && props.length >= 0) { - for (int i = 0; i < props.length; ++i) { - if (props[i].equals(propertyName)) { - return true; - } - } - } - return false; - } - } - - //========================================================================== - // ========= - // Accessor - // ======== - public ValueTypeFactory getValueTypeFactory() { - return valueTypeFactory; - } - - public void setValueTypeFactory(ValueTypeFactory valueTypeFactory) { - this.valueTypeFactory = valueTypeFactory; - } - - public ColumnNaming getColumnNaming() { - return columnNaming; - } - - public void setColumnNaming(ColumnNaming columnNaming) { - this.columnNaming = columnNaming; - } -} Deleted: bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/s2dao/S2DaoSelectDynamicCommand.java =================================================================== --- bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/s2dao/S2DaoSelectDynamicCommand.java 2008-12-27 22:10:35 UTC (rev 1626) +++ bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/s2dao/S2DaoSelectDynamicCommand.java 2008-12-27 22:11:51 UTC (rev 1627) @@ -1,491 +0,0 @@ -package jp.sf.pal.bookmark.db.allcommon.s2dao; - -import java.util.ArrayList; -import java.util.List; - -import javax.sql.DataSource; - -import jp.sf.pal.bookmark.db.allcommon.cbean.ConditionBean; -import jp.sf.pal.bookmark.db.allcommon.cbean.ConditionBeanContext; -import jp.sf.pal.bookmark.db.allcommon.cbean.outsidesql.OutsideSqlContext; -import jp.sf.pal.bookmark.db.allcommon.s2dao.internal.sqlcommand.InternalAbstractDynamicCommand; -import jp.sf.pal.bookmark.db.allcommon.s2dao.internal.sqlhandler.InternalBasicSelectHandler; -import jp.sf.pal.bookmark.db.allcommon.util.SimpleStringUtil; -import jp.sf.pal.bookmark.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 bindVariableList = new ArrayList(4); - final List bindVariableTypeList = new ArrayList(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 bindVariableList = new java.util.ArrayList(); - final java.util.List bindVariableTypeList = new java.util.ArrayList(); - 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.bookmark.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.bookmark.db.allcommon.jdbc.CursorHandler) { - final jp.sf.pal.bookmark.db.allcommon.jdbc.CursorHandler cursorHandler = (jp.sf.pal.bookmark.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 bindVariableList, List 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 bindVariableList, List 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 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 bindVariableList, List bindVariableTypeList) { - final Object[] bindVariables = ctx.getBindVariables(); - addBindVariableList(bindVariableList, bindVariables); - final Class[] bindVariableTypes = ctx.getBindVariableTypes(); - addBindVariableTypeList(bindVariableTypeList, bindVariableTypes); - } - - protected void addBindVariableList(List bindVariableList, - Object[] bindVariables) { - for (int i = 0; i < bindVariables.length; i++) { - bindVariableList.add(bindVariables[i]); - } - } - - protected void addBindVariableTypeList(List bindVariableTypeList, - Class[] bindVariableTypes) { - for (int i = 0; i < bindVariableTypes.length; i++) { - bindVariableTypeList.add(bindVariableTypes[i]); - } - } - - //========================================================================== - // ========= - // General Helper - // ============== - protected final String replaceString(String text, String fromText, - String toText) { - return SimpleStringUtil.replace(text, fromText, toText); - } - - protected String getLineSeparator() { - return SimpleSystemUtil.getLineSeparator(); - } -} \ No newline at end of file Added: bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/s2dao/SqlLogRegistryLatestSqlProvider.java =================================================================== --- bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/s2dao/SqlLogRegistryLatestSqlProvider.java (rev 0) +++ bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/s2dao/SqlLogRegistryLatestSqlProvider.java 2008-12-27 22:11:51 UTC (rev 1627) @@ -0,0 +1,21 @@ +package jp.sf.pal.bookmark.db.allcommon.s2dao; + +import jp.sf.pal.bookmark.db.allcommon.jdbc.LatestSqlProvider; +import jp.sf.pal.bookmark.db.allcommon.s2dao.internal.sqllog.InternalSqlLogRegistry; + +/** + * The provider of latest SQL using SqlLogRegistry. This instance should be + * singleton. + * + * @author DBFlute(AutoGenerator) + */ +public class SqlLogRegistryLatestSqlProvider implements LatestSqlProvider { + + public String getDisplaySql() { + return InternalSqlLogRegistry.peekCompleteSql(); + } + + public void clearSqlCache() { + InternalSqlLogRegistry.clearSqlLogRegistry(); + } +} Property changes on: bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/s2dao/SqlLogRegistryLatestSqlProvider.java ___________________________________________________________________ Name: svn:eol-style + native Modified: bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/s2dao/internal/rshandler/InternalAbstractDtoMetaDataResultSetHandler.java =================================================================== --- bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/s2dao/internal/rshandler/InternalAbstractDtoMetaDataResultSetHandler.java 2008-12-27 22:10:35 UTC (rev 1626) +++ bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/s2dao/internal/rshandler/InternalAbstractDtoMetaDataResultSetHandler.java 2008-12-27 22:11:51 UTC (rev 1627) @@ -6,10 +6,11 @@ import java.util.Map; import java.util.Set; +import jp.sf.pal.bookmark.db.allcommon.helper.StringSet; + import org.seasar.dao.DtoMetaData; import org.seasar.dao.RowCreator; import org.seasar.extension.jdbc.ResultSetHandler; -import org.seasar.framework.util.CaseInsensitiveSet; /** * @author DBFlute(AutoGenerator) @@ -67,10 +68,10 @@ return rowCreator.createRow(rs, propertyCache, beanClass); } - protected Set createColumnNames(final ResultSetMetaData rsmd) + protected Set createColumnNames(final ResultSetMetaData rsmd) throws SQLException { final int count = rsmd.getColumnCount(); - final Set columnNames = new CaseInsensitiveSet(); + final Set columnNames = StringSet.createAsCaseInsensitive(); for (int i = 0; i < count; ++i) { final String columnName = rsmd.getColumnLabel(i + 1); final int pos = columnName.lastIndexOf('.'); // [DAO-41] Modified: bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/s2dao/internal/sqlcommand/InternalAbstractAutoStaticCommand.java =================================================================== --- bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/s2dao/internal/sqlcommand/InternalAbstractAutoStaticCommand.java 2008-12-27 22:10:35 UTC (rev 1626) +++ bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/s2dao/internal/sqlcommand/InternalAbstractAutoStaticCommand.java 2008-12-27 22:11:51 UTC (rev 1627) @@ -10,7 +10,6 @@ import org.seasar.dao.BeanMetaData; import org.seasar.dao.IdentifierGenerator; -import org.seasar.dao.NotSingleRowUpdatedRuntimeException; import org.seasar.dao.PrimaryKeyNotFoundRuntimeException; import org.seasar.extension.jdbc.PropertyType; import org.seasar.extension.jdbc.StatementFactory; @@ -24,19 +23,13 @@ //========================================================================== // ========= - // Definition - // ========== - protected static final boolean DEFAULT_VERSION_NO_AUTO_INCREMENT_ON_MEMORY = true; - - //========================================================================== - // ========= // Attribute // ========= private PropertyType[] propertyTypes; - private boolean checkSingleRowUpdate = true; + protected boolean optimisticLockHandling; - protected boolean versionNoAutoIncrementOnMemory = DEFAULT_VERSION_NO_AUTO_INCREMENT_ON_MEMORY; + protected boolean versionNoAutoIncrementOnMemory; //========================================================================== // ========= @@ -44,15 +37,10 @@ // =========== public InternalAbstractAutoStaticCommand(DataSource dataSource, StatementFactory statementFactory, BeanMetaData beanMetaData, - String[] propertyNames) { - this(dataSource, statementFactory, beanMetaData, propertyNames, - DEFAULT_VERSION_NO_AUTO_INCREMENT_ON_MEMORY); - } - - public InternalAbstractAutoStaticCommand(DataSource dataSource, - StatementFactory statementFactory, BeanMetaData beanMetaData, - String[] propertyNames, boolean versionNoAutoIncrementOnMemory) { + String[] propertyNames, boolean optimisticLockHandling, + boolean versionNoAutoIncrementOnMemory) { super(dataSource, statementFactory, beanMetaData); + this.optimisticLockHandling = optimisticLockHandling; this.versionNoAutoIncrementOnMemory = versionNoAutoIncrementOnMemory; setupPropertyTypes(propertyNames); setupSql(); @@ -62,26 +50,19 @@ // ========= // Execute // ======= - public Object execute(Object[] args) { + public Object execute(Object[] args) { // NOT for Batch. Batch should + // override. InternalAbstractAutoHandler handler = createAutoHandler(); + handler.setOptimisticLockHandling(optimisticLockHandling); + handler + .setVersionNoAutoIncrementOnMemory(versionNoAutoIncrementOnMemory); handler.setSql(getSql()); handler.setLoggingMessageSqlArgs(args); int rows = handler.execute(args); - if (isCheckSingleRowUpdate() && rows != 1) { - throw createNotSingleRowUpdatedRuntimeException(args[0], rows); - } return new Integer(rows); } - public boolean isCheckSingleRowUpdate() { - return checkSingleRowUpdate; - } - - public void setCheckSingleRowUpdate(boolean checkSingleRowUpdate) { - this.checkSingleRowUpdate = checkSingleRowUpdate; - } - - protected NotSingleRowUpdatedRuntimeException createNotSingleRowUpdatedRuntimeException( + protected EntityAlreadyUpdatedException createEntityAlreadyUpdatedException( Object bean, int rows) { return new EntityAlreadyUpdatedException(bean, rows); } @@ -194,7 +175,7 @@ protected void setupDeleteSql() { checkPrimaryKey(); - StringBuilder sb = new StringBuilder(100); + final StringBuilder sb = new StringBuilder(100); sb.append("delete from "); sb.append(getBeanMetaData().getTableName()); setupUpdateWhere(sb); @@ -215,11 +196,11 @@ sb.append(bmd.getPrimaryKey(i)).append(" = ? and "); } sb.setLength(sb.length() - 5); - if (bmd.hasVersionNoPropertyType()) { + if (optimisticLockHandling && bmd.hasVersionNoPropertyType()) { PropertyType pt = bmd.getVersionNoPropertyType(); sb.append(" and ").append(pt.getColumnName()).append(" = ?"); } - if (bmd.hasTimestampPropertyType()) { + if (optimisticLockHandling && bmd.hasTimestampPropertyType()) { PropertyType pt = bmd.getTimestampPropertyType(); sb.append(" and ").append(pt.getColumnName()).append(" = ?"); } Modified: bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/s2dao/internal/sqlcommand/InternalAbstractBatchAutoStaticCommand.java =================================================================== --- bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/s2dao/internal/sqlcommand/InternalAbstractBatchAutoStaticCommand.java 2008-12-27 22:10:35 UTC (rev 1626) +++ bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/s2dao/internal/sqlcommand/InternalAbstractBatchAutoStaticCommand.java 2008-12-27 22:11:51 UTC (rev 1627) @@ -15,49 +15,30 @@ //========================================================================== // ========= - // Attribute - // ========= - protected final boolean returningRows; - - //========================================================================== - // ========= // Constructor // =========== public InternalAbstractBatchAutoStaticCommand(DataSource dataSource, StatementFactory statementFactory, BeanMetaData beanMetaData, - String[] propertyNames, boolean returningRows) { - this(dataSource, statementFactory, beanMetaData, propertyNames, - returningRows, DEFAULT_VERSION_NO_AUTO_INCREMENT_ON_MEMORY); - } - - public InternalAbstractBatchAutoStaticCommand(DataSource dataSource, - StatementFactory statementFactory, BeanMetaData beanMetaData, - String[] propertyNames, boolean returningRows, + String[] propertyNames, boolean optimisticLockHandling, boolean versionNoAutoIncrementOnMemory) { super(dataSource, statementFactory, beanMetaData, propertyNames, - versionNoAutoIncrementOnMemory); - this.returningRows = returningRows; + optimisticLockHandling, versionNoAutoIncrementOnMemory); } //========================================================================== // ========= // Execute // ======= + @Override public Object execute(Object[] args) { final InternalAbstractBatchAutoHandler handler = createBatchAutoHandler(); - - // It is unnecessary! - // injectDaoClass(handler); - + handler.setOptimisticLockHandling(optimisticLockHandling); + handler + .setVersionNoAutoIncrementOnMemory(versionNoAutoIncrementOnMemory); handler.setSql(getSql()); // The logging message SQL of procedure is unnecessary. // handler.setLoggingMessageSqlArgs(args); - if (this.returningRows) { - return handler.executeBatch(args); - } else { - final int updatedRows = handler.execute(args); - return new Integer(updatedRows); - } + return handler.executeBatch(args); } protected abstract InternalAbstractBatchAutoHandler createBatchAutoHandler(); Modified: bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/s2dao/internal/sqlcommand/InternalAbstractDynamicCommand.java =================================================================== --- bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/s2dao/internal/sqlcommand/InternalAbstractDynamicCommand.java 2008-12-27 22:10:35 UTC (rev 1626) +++ bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/s2dao/internal/sqlcommand/InternalAbstractDynamicCommand.java 2008-12-27 22:11:51 UTC (rev 1627) @@ -44,10 +44,15 @@ } protected InternalSqlParser createInternalSqlParser(String sql) { - return new InternalSqlParser(sql); + return new InternalSqlParser(sql, isBlockNullParameter()); } - public CommandContext apply(Object[] args) {// It is necessary to be public! + protected boolean isBlockNullParameter() { // Extension Point! + return false; + } + + public CommandContext apply(Object[] args) { // It is necessary to be + // public! final CommandContext ctx = createCommandContext(args); rootNode.accept(ctx); return ctx; Modified: bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/s2dao/internal/sqlcommand/InternalAbstractSqlCommand.java =================================================================== --- bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/s2dao/internal/sqlcommand/InternalAbstractSqlCommand.java 2008-12-27 22:10:35 UTC (rev 1626) +++ bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/s2dao/internal/sqlcommand/InternalAbstractSqlCommand.java 2008-12-27 22:11:51 UTC (rev 1627) @@ -2,13 +2,16 @@ import javax.sql.DataSource; +import jp.sf.pal.bookmark.db.allcommon.bhv.core.SqlExecution; + import org.seasar.dao.SqlCommand; import org.seasar.extension.jdbc.StatementFactory; /** * @author DBFlute(AutoGenerator) */ -public abstract class InternalAbstractSqlCommand implements SqlCommand { +public abstract class InternalAbstractSqlCommand implements SqlCommand, + SqlExecution { //========================================================================== // ========= Modified: bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/s2dao/internal/sqlcommand/InternalDeleteAutoStaticCommand.java =================================================================== --- bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/s2dao/internal/sqlcommand/InternalDeleteAutoStaticCommand.java 2008-12-27 22:10:35 UTC (rev 1626) +++ bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/s2dao/internal/sqlcommand/InternalDeleteAutoStaticCommand.java 2008-12-27 22:11:51 UTC (rev 1627) @@ -20,8 +20,9 @@ // =========== public InternalDeleteAutoStaticCommand(DataSource dataSource, StatementFactory statementFactory, BeanMetaData beanMetaData, - String[] propertyNames) { - super(dataSource, statementFactory, beanMetaData, propertyNames); + String[] propertyNames, boolean optimisticLockHandling) { + super(dataSource, statementFactory, beanMetaData, propertyNames, + optimisticLockHandling, false); } //========================================================================== Modified: bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/s2dao/internal/sqlcommand/InternalDeleteBatchAutoStaticCommand.java =================================================================== --- bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/s2dao/internal/sqlcommand/InternalDeleteBatchAutoStaticCommand.java 2008-12-27 22:10:35 UTC (rev 1626) +++ bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/s2dao/internal/sqlcommand/InternalDeleteBatchAutoStaticCommand.java 2008-12-27 22:11:51 UTC (rev 1627) @@ -21,9 +21,9 @@ // =========== public InternalDeleteBatchAutoStaticCommand(DataSource dataSource, StatementFactory statementFactory, BeanMetaData beanMetaData, - String[] propertyNames, boolean returningRows) { + String[] propertyNames, boolean optimisticLockHandling) { super(dataSource, statementFactory, beanMetaData, propertyNames, - returningRows); + optimisticLockHandling, false); } //========================================================================== Modified: bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/s2dao/internal/sqlcommand/InternalDeleteQueryAutoDynamicCommand.java =================================================================== --- bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/s2dao/internal/sqlcommand/InternalDeleteQueryAutoDynamicCommand.java 2008-12-27 22:10:35 UTC (rev 1626) +++ bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/s2dao/internal/sqlcommand/InternalDeleteQueryAutoDynamicCommand.java 2008-12-27 22:11:51 UTC (rev 1627) @@ -2,6 +2,7 @@ import javax.sql.DataSource; +import jp.sf.pal.bookmark.db.allcommon.bhv.core.SqlExecution; import jp.sf.pal.bookmark.db.allcommon.cbean.ConditionBean; import jp.sf.pal.bookmark.db.allcommon.s2dao.internal.sqlhandler.InternalCommandContextHandler; import jp.sf.pal.bookmark.db.allcommon.s2dao.internal.sqlparser.InternalCommandContextCreator; @@ -16,7 +17,8 @@ /** * @author DBFlute(AutoGenerator) */ -public class InternalDeleteQueryAutoDynamicCommand implements SqlCommand { +public class InternalDeleteQueryAutoDynamicCommand implements SqlCommand, + SqlExecution { //========================================================================== // ========= @@ -83,7 +85,7 @@ String[] argNames, Class[] argTypes, Object[] args) { CommandContext context; { - InternalSqlParser parser = new InternalSqlParser(twoWaySql); + InternalSqlParser parser = new InternalSqlParser(twoWaySql, true); Node node = parser.parse(); InternalCommandContextCreator creator = new InternalCommandContextCreator( argNames, argTypes); Modified: bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/s2dao/internal/sqlcommand/InternalInsertAutoDynamicCommand.java =================================================================== --- bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/s2dao/internal/sqlcommand/InternalInsertAutoDynamicCommand.java 2008-12-27 22:10:35 UTC (rev 1626) +++ bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/s2dao/internal/sqlcommand/InternalInsertAutoDynamicCommand.java 2008-12-27 22:11:51 UTC (rev 1627) @@ -5,11 +5,11 @@ import javax.sql.DataSource; +import jp.sf.pal.bookmark.db.allcommon.bhv.core.SqlExecution; import jp.sf.pal.bookmark.db.allcommon.s2dao.internal.sqlhandler.InternalInsertAutoHandler; import org.seasar.dao.BeanMetaData; import org.seasar.dao.IdentifierGenerator; -import org.seasar.dao.NotSingleRowUpdatedRuntimeException; import org.seasar.dao.SqlCommand; import org.seasar.extension.jdbc.PropertyType; import org.seasar.extension.jdbc.StatementFactory; @@ -18,7 +18,8 @@ /** * @author DBFlute(AutoGenerator) */ -public class InternalInsertAutoDynamicCommand implements SqlCommand { +public class InternalInsertAutoDynamicCommand implements SqlCommand, + SqlExecution { //========================================================================== // ========= @@ -32,8 +33,6 @@ protected String[] propertyNames; - protected boolean checkSingleRowUpdate = true; - //========================================================================== // ========= // Constructor @@ -56,9 +55,6 @@ handler.setSql(sql); handler.setLoggingMessageSqlArgs(args); final int rows = handler.execute(args); - if (isCheckSingleRowUpdate() && rows != 1) { - throw new NotSingleRowUpdatedRuntimeException(args[0], rows); - } return new Integer(rows); } @@ -161,12 +157,4 @@ public void setPropertyNames(String[] propertyNames) { this.propertyNames = propertyNames; } - - public boolean isCheckSingleRowUpdate() { - return checkSingleRowUpdate; - } - - public void setCheckSingleRowUpdate(boolean checkSingleRowUpdate) { - this.checkSingleRowUpdate = checkSingleRowUpdate; - } } Modified: bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/s2dao/internal/sqlcommand/InternalInsertBatchAutoStaticCommand.java =================================================================== --- bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/s2dao/internal/sqlcommand/InternalInsertBatchAutoStaticCommand.java 2008-12-27 22:10:35 UTC (rev 1626) +++ bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/s2dao/internal/sqlcommand/InternalInsertBatchAutoStaticCommand.java 2008-12-27 22:11:51 UTC (rev 1627) @@ -21,9 +21,9 @@ // =========== public InternalInsertBatchAutoStaticCommand(DataSource dataSource, StatementFactory statementFactory, BeanMetaData beanMetaData, - String[] propertyNames, boolean returningRows) { - super(dataSource, statementFactory, beanMetaData, propertyNames, - returningRows); + String[] propertyNames) { + super(dataSource, statementFactory, beanMetaData, propertyNames, false, + false); } //========================================================================== Modified: bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/s2dao/internal/sqlcommand/InternalProcedureCommand.java =================================================================== --- bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/s2dao/internal/sqlcommand/InternalProcedureCommand.java 2008-12-27 22:10:35 UTC (rev 1626) +++ bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/s2dao/internal/sqlcommand/InternalProcedureCommand.java 2008-12-27 22:11:51 UTC (rev 1627) @@ -2,6 +2,7 @@ import javax.sql.DataSource; +import jp.sf.pal.bookmark.db.allcommon.bhv.core.SqlExecution; import jp.sf.pal.bookmark.db.allcommon.cbean.outsidesql.OutsideSqlContext; import jp.sf.pal.bookmark.db.allcommon.s2dao.internal.sqlhandler.InternalProcedureHandler; import jp.sf.pal.bookmark.db.allcommon.s2dao.internal.various.InternalProcedureMetaData; @@ -13,7 +14,7 @@ /** * @author DBFlute(AutoGenerator) */ -public class InternalProcedureCommand implements SqlCommand { +public class InternalProcedureCommand implements SqlCommand, SqlExecution { //========================================================================== // ========= Modified: bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/s2dao/internal/sqlcommand/InternalUpdateAutoDynamicCommand.java =================================================================== --- bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/s2dao/internal/sqlcommand/InternalUpdateAutoDynamicCommand.java 2008-12-27 22:10:35 UTC (rev 1626) +++ bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/s2dao/internal/sqlcommand/InternalUpdateAutoDynamicCommand.java 2008-12-27 22:11:51 UTC (rev 1627) @@ -5,29 +5,27 @@ import javax.sql.DataSource; +import jp.sf.pal.bookmark.db.allcommon.XLog; import jp.sf.pal.bookmark.db.allcommon.s2dao.internal.sqlhandler.InternalUpdateAutoHandler; import org.seasar.dao.BeanMetaData; import org.seasar.dao.NoUpdatePropertyTypeRuntimeException; -import org.seasar.dao.impl.AbstractSqlCommand; import org.seasar.extension.jdbc.PropertyType; import org.seasar.extension.jdbc.StatementFactory; /** * @author DBFlute(AutoGenerator) */ -public class InternalUpdateAutoDynamicCommand extends AbstractSqlCommand { +public class InternalUpdateAutoDynamicCommand extends + InternalAbstractSqlCommand { //========================================================================== // ========= // Definition // ========== - /** Log instance. */ - private static final org.apache.commons.logging.Log _log = org.apache.commons.logging.LogFactory - .getLog(InternalUpdateAutoDynamicCommand.class); + /** The result for no update as normal execution. */ + private static final Integer NO_UPDATE = new Integer(1); - private static final Integer NO_UPDATE = new Integer(0); - //========================================================================== // ========= // Attribute @@ -36,9 +34,9 @@ private String[] propertyNames; - private boolean checkSingleRowUpdate = true; + private boolean optimisticLockHandling; - private boolean versionNoAutoIncrementOnMemory = true; + private boolean versionNoAutoIncrementOnMemory; //========================================================================== // ========= @@ -59,8 +57,8 @@ final PropertyType[] propertyTypes = createUpdatePropertyTypes(bmd, bean, getPropertyNames()); if (propertyTypes.length == 0) { - if (_log.isDebugEnabled()) { - _log.debug(createNoUpdateLogMessage(bean, bmd)); + if (isLogEnabled()) { + log(createNoUpdateLogMessage(bean, bmd)); } return NO_UPDATE; } @@ -83,10 +81,10 @@ BeanMetaData bmd, PropertyType[] propertyTypes) { InternalUpdateAutoHandler handler = new InternalUpdateAutoHandler( getDataSource(), getStatementFactory(), bmd, propertyTypes); + handler.setOptimisticLockHandling(optimisticLockHandling); //[DBFlute-0.8 + // .0] handler .setVersionNoAutoIncrementOnMemory(versionNoAutoIncrementOnMemory); - handler.setCheckSingleRowUpdate(isCheckSingleRowUpdate()); //[DBFlute-0.8 - // .0] return handler; } @@ -182,17 +180,33 @@ sb.append(bmd.getPrimaryKey(i)).append(" = ? and "); } sb.setLength(sb.length() - 5); - if (bmd.hasVersionNoPropertyType()) { + if (optimisticLockHandling && bmd.hasVersionNoPropertyType()) { PropertyType pt = bmd.getVersionNoPropertyType(); sb.append(" and ").append(pt.getColumnName()).append(" = ?"); } - if (bmd.hasTimestampPropertyType()) { + if (optimisticLockHandling && bmd.hasTimestampPropertyType()) { PropertyType pt = bmd.getTimestampPropertyType(); sb.append(" and ").append(pt.getColumnName()).append(" = ?"); } return sb.toString(); } + //========================================================================== + // ========= + // Execute Status Log + // ================== + protected void log(String msg) { + XLog.log(msg); + } + + protected boolean isLogEnabled() { + return XLog.isLogEnabled(); + } + + //========================================================================== + // ========= + // Accessor + // ======== protected boolean isVersionNoAutoIncrementOnMemory() { return versionNoAutoIncrementOnMemory; } @@ -223,11 +237,7 @@ this.propertyNames = propertyNames; } - public boolean isCheckSingleRowUpdate() { - return checkSingleRowUpdate; + public void setOptimisticLockHandling(boolean optimisticLockHandling) { + this.optimisticLockHandling = optimisticLockHandling; } - - public void setCheckSingleRowUpdate(boolean resultCheck) { - this.checkSingleRowUpdate = resultCheck; - } } Modified: bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/s2dao/internal/sqlcommand/InternalUpdateBatchAutoStaticCommand.java =================================================================== --- bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/s2dao/internal/sqlcommand/InternalUpdateBatchAutoStaticCommand.java 2008-12-27 22:10:35 UTC (rev 1626) +++ bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/s2dao/internal/sqlcommand/InternalUpdateBatchAutoStaticCommand.java 2008-12-27 22:11:51 UTC (rev 1627) @@ -21,10 +21,10 @@ // =========== public InternalUpdateBatchAutoStaticCommand(DataSource dataSource, StatementFactory statementFactory, BeanMetaData beanMetaData, - String[] propertyNames, boolean returningRows, + String[] propertyNames, boolean optimisticLockHandling, boolean versionNoAutoIncrementOnMemory) { super(dataSource, statementFactory, beanMetaData, propertyNames, - returningRows, versionNoAutoIncrementOnMemory); + optimisticLockHandling, versionNoAutoIncrementOnMemory); } //========================================================================== Modified: bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/s2dao/internal/sqlcommand/InternalUpdateDynamicCommand.java =================================================================== --- bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/s2dao/internal/sqlcommand/InternalUpdateDynamicCommand.java 2008-12-27 22:10:35 UTC (rev 1626) +++ bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/s2dao/internal/sqlcommand/InternalUpdateDynamicCommand.java 2008-12-27 22:11:51 UTC (rev 1627) @@ -28,11 +28,16 @@ // ======= public Object execute(Object args[]) { final CommandContext ctx = apply(args); - final InternalBasicUpdateHandler updateHandler = new InternalBasicUpdateHandler( - getDataSource(), ctx.getSql(), getStatementFactory()); - Object[] bindVariables = ctx.getBindVariables(); + final InternalBasicUpdateHandler updateHandler = createBasicUpdateHandler(ctx); + final Object[] bindVariables = ctx.getBindVariables(); updateHandler.setLoggingMessageSqlArgs(bindVariables); return new Integer(updateHandler.execute(bindVariables, ctx .getBindVariableTypes())); } + + protected InternalBasicUpdateHandler createBasicUpdateHandler( + CommandContext ctx) { + return new InternalBasicUpdateHandler(getDataSource(), ctx.getSql(), + getStatementFactory()); + } } Modified: bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/s2dao/internal/sqlcommand/InternalUpdateQueryAutoDynamicCommand.java =================================================================== --- bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/s2dao/internal/sqlcommand/InternalUpdateQueryAutoDynamicCommand.java 2008-12-27 22:10:35 UTC (rev 1626) +++ bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/s2dao/internal/sqlcommand/InternalUpdateQueryAutoDynamicCommand.java 2008-12-27 22:11:51 UTC (rev 1627) @@ -10,6 +10,7 @@ import javax.sql.DataSource; import jp.sf.pal.bookmark.db.allcommon.Entity; +import jp.sf.pal.bookmark.db.allcommon.bhv.core.SqlExecution; import jp.sf.pal.bookmark.db.allcommon.cbean.ConditionBean; import jp.sf.pal.bookmark.db.allcommon.dbmeta.DBMeta; import jp.sf.pal.bookmark.db.allcommon.dbmeta.DBMetaInstanceHandler; @@ -27,7 +28,8 @@ /** * @author DBFlute(AutoGenerator) */ -public class InternalUpdateQueryAutoDynamicCommand implements SqlCommand { +public class InternalUpdateQueryAutoDynamicCommand implements SqlCommand, + SqlExecution { //========================================================================== // ========= @@ -209,7 +211,7 @@ String[] argNames, Class[] argTypes, Object[] args) { CommandContext context; { - InternalSqlParser parser = new InternalSqlParser(twoWaySql); + InternalSqlParser parser = new InternalSqlParser(twoWaySql, true); Node node = parser.parse(); InternalCommandContextCreator creator = new InternalCommandContextCreator( argNames, argTypes); Modified: bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/s2dao/internal/sqlhandler/InternalAbstractAutoHandler.java =================================================================== --- bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/s2dao/internal/sqlhandler/InternalAbstractAutoHandler.java 2008-12-27 22:10:35 UTC (rev 1626) +++ bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/s2dao/internal/sqlhandler/InternalAbstractAutoHandler.java 2008-12-27 22:11:51 UTC (rev 1627) @@ -10,12 +10,14 @@ import javax.sql.DataSource; +import jp.sf.pal.bookmark.db.allcommon.exception.EntityAlreadyUpdatedException; +import jp.sf.pal.bookmark.db.allcommon.util.SimpleTypeUtil; + import org.seasar.dao.BeanMetaData; import org.seasar.extension.jdbc.PropertyType; import org.seasar.extension.jdbc.StatementFactory; import org.seasar.extension.jdbc.ValueType; import org.seasar.framework.beans.PropertyDesc; -import org.seasar.framework.util.IntegerConversionUtil; /** * @author DBFlute(AutoGenerator) @@ -38,8 +40,10 @@ protected PropertyType[] propertyTypes; - protected boolean versionNoAutoIncrementOnMemory = true; + protected boolean optimisticLockHandling; + protected boolean versionNoAutoIncrementOnMemory; + //========================================================================== // ========= // Constructor @@ -52,6 +56,10 @@ this.propertyTypes = propertyTypes; } + //========================================================================== + // ========= + // Execute + // ======= public int execute(Object[] args) { Connection connection = getConnection(); try { @@ -77,6 +85,9 @@ } finally { close(ps); } + if (optimisticLockHandling && ret != 1) { + throw createEntityAlreadyUpdatedException(bean, ret); + } postUpdateBean(bean, ret); return ret; } @@ -96,12 +107,25 @@ } } + protected EntityAlreadyUpdatedException createEntityAlreadyUpdatedException( + Object bean, int rows) { + return new EntityAlreadyUpdatedException(bean, rows); + } + + //========================================================================== + // ========= + // Pre/Post Bean + // ============= protected void preUpdateBean(Object bean) { } protected void postUpdateBean(Object bean, int ret) { } + //========================================================================== + // ========= + // Bind Setupper + // ============= protected abstract void setupBindVariables(Object bean); protected void setupInsertBindVariables(Object bean) { @@ -149,7 +173,7 @@ if (value == null) { continue;// because of 'VERSION_NO = VERSION_NO + 1' } - int intValue = IntegerConversionUtil.toPrimitiveInt(value) + 1; + int intValue = SimpleTypeUtil.toPrimitiveInt(value) + 1; setVersionNo(new Integer(intValue)); varList.add(getVersionNo()); } else { @@ -182,13 +206,13 @@ varList.add(pd.getValue(bean)); varValueTypeList.add(pt.getValueType()); } - if (bmd.hasVersionNoPropertyType()) { + if (optimisticLockHandling && bmd.hasVersionNoPropertyType()) { PropertyType pt = bmd.getVersionNoPropertyType(); PropertyDesc pd = pt.getPropertyDesc(); varList.add(pd.getValue(bean)); varValueTypeList.add(pt.getValueType()); } - if (bmd.hasTimestampPropertyType()) { + if (optimisticLockHandling && bmd.hasTimestampPropertyType()) { PropertyType pt = bmd.getTimestampPropertyType(); PropertyDesc pd = pt.getPropertyDesc(); varList.add(pd.getValue(bean)); @@ -260,6 +284,14 @@ this.propertyTypes = propertyTypes; } + public boolean isOptimisticLockHandling() { + return optimisticLockHandling; + } + + public void setOptimisticLockHandling(boolean optimisticLockHandling) { + this.optimisticLockHandling = optimisticLockHandling; + } + protected boolean isVersionNoAutoIncrementOnMemory() { return versionNoAutoIncrementOnMemory; } Modified: bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/s2dao/internal/sqlhandler/InternalAbstractBatchAutoHandler.java =================================================================== --- bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/s2dao/internal/sqlhandler/InternalAbstractBatchAutoHandler.java 2008-12-27 22:10:35 UTC (rev 1626) +++ bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/s2dao/internal/sqlhandler/InternalAbstractBatchAutoHandler.java 2008-12-27 22:11:51 UTC (rev 1627) @@ -9,6 +9,11 @@ import javax.sql.DataSource; +import jp.sf.pal.bookmark.db.allcommon.DBDef; +import jp.sf.pal.bookmark.db.allcommon.exception.BatchEntityAlreadyUpdatedException; +import jp.sf.pal.bookmark.db.allcommon.exception.EntityAlreadyDeletedException; +import jp.sf.pal.bookmark.db.allcommon.exception.EntityDuplicatedException; + import org.seasar.dao.BeanMetaData; import org.seasar.extension.jdbc.PropertyType; import org.seasar.extension.jdbc.StatementFactory; @@ -41,6 +46,39 @@ // ========= // Execute // ======= + public int execute(Object[] args) { + List list = null; + if (args[0] instanceof Object[]) { + list = Arrays.asList((Object[]) args[0]); + } else if (args[0] instanceof List) { + list = (List) args[0]; + } + if (list == null) { + throw new IllegalArgumentException("args[0]"); + } + int[] ret = execute(list); + int updatedRow = 0; + for (int i = 0; i < ret.length; i++) { + if (ret[i] > 0) { + updatedRow += ret[i]; + } + } + return updatedRow; + } + + public int[] executeBatch(Object[] args) { + List list = null; + if (args[0] instanceof Object[]) { + list = Arrays.asList((Object[]) args[0]); + } else if (args[0] instanceof List) { + list = (List) args[0]; + } + if (list == null) { + throw new IllegalArgumentException("args[0]"); + } + return execute(list); + } + public int[] execute(List list, Class[] argTypes) { return execute(list); } @@ -63,7 +101,9 @@ final Object bean = (Object) iter.next(); prepareBatchElement(ps, bean); } - return executeBatch(ps, list); + final int[] result = executeBatch(ps, list); + handleBatchUpdateResultWithOptimisticLock(ps, list, result); + return result; } finally { close(ps); } @@ -74,46 +114,100 @@ // postBatchUpdateBean(...); } - public int execute(Object[] args) { - List list = null; - if (args[0] instanceof Object[]) { - list = Arrays.asList((Object[]) args[0]); - } else if (args[0] instanceof List) { - list = (List) args[0]; + protected void prepareBatchElement(PreparedStatement ps, Object bean) { + setupBindVariables(bean); + logSql(getBindVariables(), getArgTypes(getBindVariables())); + bindArgs(ps, getBindVariables(), getBindVariableValueTypes()); + addBatch(ps); + } + + //========================================================================== + // ========= + // Optimistic Lock + // =============== + protected void handleBatchUpdateResultWithOptimisticLock( + PreparedStatement ps, List list, int[] result) { + if (DBDef.isCurrentDef(DBDef.Oracle)) { + final int updateCount; + try { + updateCount = ps.getUpdateCount(); + } catch (SQLException e) { + handleSQLException(e, ps); + return; // Unreachable! + } + handleBatchUpdateResultWithOptimisticLockByUpdateCount(list, + updateCount); + } else { + handleBatchUpdateResultWithOptimisticLockByResult(list, result); } - if (list == null) { - throw new IllegalArgumentException("args[0]"); + } + + protected void handleBatchUpdateResultWithOptimisticLockByUpdateCount( + List list, int updateCount) { + if (list.isEmpty()) { + return;// for Safety! } - int[] ret = execute(list); - int updatedRow = 0; - for (int i = 0; i < ret.length; i++) { - if (ret[i] > 0) { - updatedRow += ret[i]; + if (updateCount < 0) { + return;// for Safety! + } + final int entityCount = list.size(); + if (updateCount < entityCount) { + if (isOptimisticLockHandling()) { + throw new BatchEntityAlreadyUpdatedException(list.get(0), 0, + updateCount); + } else { + String msg = "The entity have already deleted:"; + msg = msg + " updateCount=" + updateCount; + msg = msg + " entityCount=" + entityCount; + msg = msg + " allEntities=" + list; + throw new EntityAlreadyDeletedException(msg); } } - return updatedRow; } - public int[] executeBatch(Object[] args) { - List list = null; - if (args[0] instanceof Object[]) { - list = Arrays.asList((Object[]) args[0]); - } else if (args[0] instanceof List) { - list = (List) args[0]; + protected void handleBatchUpdateResultWithOptimisticLockByResult( + List list, int[] result) { + if (list.isEmpty()) { + return;// for Safety! } - if (list == null) { - throw new IllegalArgumentException("args[0]"); + final int[] updatedCountArray = result; + final int entityCount = list.size(); + int index = 0; + boolean alreadyUpdated = false; + for (int oneUpdateCount : updatedCountArray) { + if (entityCount <= index) { + break;// for Safety! + } + if (oneUpdateCount == 0) { + alreadyUpdated = true; + break; + } else if (oneUpdateCount > 1) { + String msg = "The entity updated two or more records in batch update:"; + msg = msg + " entity=" + list.get(index); + msg = msg + " updatedCount=" + oneUpdateCount; + msg = msg + " allEntities=" + list; + throw new EntityDuplicatedException(msg); + } + ++index; } - return execute(list); + if (alreadyUpdated) { + int updateCount = 0; + for (int oneUpdateCount : updatedCountArray) { + updateCount = updateCount + oneUpdateCount; + } + if (isOptimisticLockHandling()) { + throw new BatchEntityAlreadyUpdatedException(list.get(index), + 0, updateCount); + } else { + String msg = "The entity have already deleted:"; + msg = msg + " entity=" + list.get(index); + msg = msg + " updateCount=" + updateCount; + msg = msg + " allEntities=" + list; + throw new EntityAlreadyDeletedException(msg); + } + } } - protected void prepareBatchElement(PreparedStatement ps, Object bean) { - setupBindVariables(bean); - logSql(getBindVariables(), getArgTypes(getBindVariables())); - bindArgs(ps, getBindVariables(), getBindVariableValueTypes()); - addBatch(ps); - } - //========================================================================== // ========= // JDBC Delegator Modified: bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/s2dao/internal/sqlhandler/InternalBasicHandler.java =================================================================== --- bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/s2dao/internal/sqlhandler/InternalBasicHandler.java 2008-12-27 22:10:35 UTC (rev 1626) +++ bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/s2dao/internal/sqlhandler/InternalBasicHandler.java 2008-12-27 22:11:51 UTC (rev 1627) @@ -9,6 +9,7 @@ import javax.sql.DataSource; import jp.sf.pal.bookmark.db.allcommon.CallbackContext; +import jp.sf.pal.bookmark.db.allcommon.DBDef; import jp.sf.pal.bookmark.db.allcommon.DBFluteConfig; import jp.sf.pal.bookmark.db.allcommon.InternalMapContext; import jp.sf.pal.bookmark.db.allcommon.QLog; @@ -25,7 +26,6 @@ import org.seasar.extension.jdbc.StatementFactory; import org.seasar.extension.jdbc.ValueType; import org.seasar.extension.jdbc.types.ValueTypes; -import org.seasar.framework.exception.SQLRuntimeException; /** * @author DBFlute(AutoGenerator) @@ -73,7 +73,7 @@ return; } for (int i = 0; i < args.length; ++i) { - ValueType valueType = getValueType(argTypes[i]); + final ValueType valueType = findValueType(args[i], argTypes[i]); try { valueType.bindValue(ps, i + 1, args[i]); } catch (SQLException e) { @@ -82,6 +82,19 @@ } } + protected ValueType findValueType(Object arg, Class argType) { + ValueType valueType = ValueTypes.getValueType(arg); + if (valueType != null) { + return valueType; + } + valueType = ValueTypes.getValueType(argType); + if (valueType != null) { + return valueType; + } + String msg = "Unknown type¡§argType=" + argType + " args=" + arg; + throw new IllegalStateException(msg); + } + protected Class[] getArgTypes(Object[] args) { if (args == null) { return null; @@ -151,10 +164,6 @@ return InternalBindVariableUtil.getBindVariableText(bindVariable); } - protected ValueType getValueType(Class clazz) { - return ValueTypes.getValueType(clazz); - } - //========================================================================== // ========= // Exception Handler @@ -194,9 +203,6 @@ public void handleSQLException(SQLException e, Statement statement, boolean uniqueConstraintValid, String completeSql) { - if (isSqlExceptionOldStyleHandling()) { - throw new SQLRuntimeException(e); - } if (uniqueConstraintValid && isUniqueConstraintException(e)) { throwEntityAlreadyExistsException(e, statement, completeSql); } @@ -217,10 +223,6 @@ .getUniqueConstraintDeterminator(); } - protected boolean isSqlExceptionOldStyleHandling() { - return DBFluteConfig.getInstance().isSqlExceptionOldStyleHandling(); - } - protected void throwEntityAlreadyExistsException(SQLException e, Statement statement, String completeSql) { String msg = "Look! Read the message below." + getLineSeparator(); @@ -560,7 +562,7 @@ // ========= // Assist Helper // ============= - // It needs this method if the target database doest not support line + // It needs this method if the target database does not support line // comment. protected String removeLineComment(final String sql) { // With removing CR! if (sql == null || sql.trim().length() == 0) { @@ -578,7 +580,8 @@ } sb.append(line).append("\n"); } - return sb.toString(); + final String filteredSql = sb.toString(); + return filteredSql.substring(0, filteredSql.lastIndexOf("\n")); } //========================================================================== @@ -606,9 +609,17 @@ } public void setSql(String sql) { + if (isRemoveLineCommentFromSql()) { + sql = removeLineComment(sql); + } this.sql = sql; } + protected boolean isRemoveLineCommentFromSql() { + // Because the MS-Access does not support line comments. + return DBDef.isCurrentDef(DBDef.MSAccess); + } + public StatementFactory getStatementFactory() { return statementFactory; } Modified: bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/s2dao/internal/sqlhandler/InternalBasicSelectHandler.java =================================================================== --- bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/s2dao/internal/sqlhandler/InternalBasicSelectHandler.java 2008-12-27 22:10:35 UTC (rev 1626) +++ bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/s2dao/internal/sqlhandler/InternalBasicSelectHandler.java 2008-12-27 22:11:51 UTC (rev 1627) @@ -45,8 +45,7 @@ return execute(args, getArgTypes(args)); } - @SuppressWarnings("unchecked") - public Object execute(Object[] args, Class[] argTypes) { + public Object execute(Object[] args, Class[] argTypes) { Connection conn = getConnection(); try { return execute(conn, args, argTypes); @@ -55,8 +54,7 @@ } } - @SuppressWarnings("unchecked") - public Object execute(Connection conn, Object[] args, Class[] argTypes) { + public Object execute(Connection conn, Object[] args, Class[] argTypes) { logSql(args, argTypes); PreparedStatement ps = null; try { Modified: bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/s2dao/internal/sqlhandler/InternalBasicUpdateHandler.java =================================================================== --- bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/s2dao/internal/sqlhandler/InternalBasicUpdateHandler.java 2008-12-27 22:10:35 UTC (rev 1626) +++ bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/s2dao/internal/sqlhandler/InternalBasicUpdateHandler.java 2008-12-27 22:11:51 UTC (rev 1627) @@ -29,8 +29,7 @@ return execute(args, getArgTypes(args)); } - @SuppressWarnings("unchecked") - public int execute(Object[] args, Class[] argTypes) { + public int execute(Object[] args, Class[] argTypes) { Connection connection = getConnection(); try { return execute(connection, args, argTypes); @@ -39,8 +38,7 @@ } } - @SuppressWarnings("unchecked") - public int execute(Connection connection, Object[] args, Class[] argTypes) { + public int execute(Connection connection, Object[] args, Class[] argTypes) { logSql(args, argTypes); PreparedStatement ps = prepareStatement(connection); try { Modified: bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/s2dao/internal/sqlhandler/InternalInsertAutoHandler.java =================================================================== --- bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/s2dao/internal/sqlhandler/InternalInsertAutoHandler.java 2008-12-27 22:10:35 UTC (rev 1626) +++ bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/s2dao/internal/sqlhandler/InternalInsertAutoHandler.java 2008-12-27 22:11:51 UTC (rev 1627) @@ -20,6 +20,7 @@ StatementFactory statementFactory, BeanMetaData beanMetaData, PropertyType[] propertyTypes) { super(dataSource, statementFactory, beanMetaData, propertyTypes); + setOptimisticLockHandling(false); } //========================================================================== Modified: bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/s2dao/internal/sqlhandler/InternalInsertBatchAutoHandler.java =================================================================== --- bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/s2dao/internal/sqlhandler/InternalInsertBatchAutoHandler.java 2008-12-27 22:10:35 UTC (rev 1626) +++ bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/s2dao/internal/sqlhandler/InternalInsertBatchAutoHandler.java 2008-12-27 22:11:51 UTC (rev 1627) @@ -19,8 +19,8 @@ public InternalInsertBatchAutoHandler(DataSource dataSource, StatementFactory statementFactory, BeanMetaData beanMetaData, PropertyType[] propertyTypes) { - super(dataSource, statementFactory, beanMetaData, propertyTypes); + setOptimisticLockHandling(false); } //========================================================================== Modified: bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/s2dao/internal/sqlhandler/InternalProcedureHandler.java =================================================================== --- bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/s2dao/internal/sqlhandler/InternalProcedureHandler.java 2008-12-27 22:10:35 UTC (rev 1626) +++ bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/s2dao/internal/sqlhandler/InternalProcedureHandler.java 2008-12-27 22:11:51 UTC (rev 1627) @@ -12,6 +12,7 @@ import javax.sql.DataSource; +import jp.sf.pal.bookmark.db.allcommon.helper.StringKeyMap; import jp.sf.pal.bookmark.db.allcommon.s2dao.internal.various.InternalProcedureMetaData; import jp.sf.pal.bookmark.db.allcommon.s2dao.internal.various.InternalProcedureParameterType; @@ -21,7 +22,6 @@ import org.seasar.extension.jdbc.ValueType; import org.seasar.extension.jdbc.impl.PropertyTypeImpl; import org.seasar.extension.jdbc.types.ValueTypes; -import org.seasar.framework.util.CaseInsensitiveMap; /** * @author DBFlute(AutoGenerator) @@ -220,10 +220,9 @@ protected static abstract class InternalAbstractMapResultSetHandler implements ResultSetHandler { - @SuppressWarnings("unchecked") protected Map createRow(ResultSet rs, PropertyType[] propertyTypes) throws SQLException { - Map row = new CaseInsensitiveMap(); + Map row = StringKeyMap.createAsFlexible(); for (int i = 0; i < propertyTypes.length; ++i) { Object value = propertyTypes[i].getValueType().getValue(rs, i + 1); Modified: bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/s2dao/internal/sqlhandler/InternalUpdateAutoHandler.java =================================================================== --- bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/s2dao/internal/sqlhandler/InternalUpdateAutoHandler.java 2008-12-27 22:10:35 UTC (rev 1626) +++ bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/s2dao/internal/sqlhandler/InternalUpdateAutoHandler.java 2008-12-27 22:11:51 UTC (rev 1627) @@ -2,8 +2,6 @@ import javax.sql.DataSource; -import jp.sf.pal.bookmark.db.allcommon.exception.EntityAlreadyUpdatedException; - import org.seasar.dao.BeanMetaData; import org.seasar.extension.jdbc.PropertyType; import org.seasar.extension.jdbc.StatementFactory; @@ -17,12 +15,6 @@ // ========= // Constructor // =========== - private boolean checkSingleRowUpdate = true; - - //========================================================================== - // ========= - // Constructor - // =========== public InternalUpdateAutoHandler(DataSource dataSource, StatementFactory statementFactory, BeanMetaData beanMetaData, PropertyType[] propertyTypes) { @@ -41,27 +33,7 @@ @Override protected void postUpdateBean(Object bean, int ret) { - if (isCheckSingleRowUpdate() && ret < 1) { - throw createEntityAlreadyUpdatedException(bean, ret); - } updateVersionNoIfNeed(bean); updateTimestampIfNeed(bean); } - - protected EntityAlreadyUpdatedException createEntityAlreadyUpdatedException( - Object bean, int rows) { - return new EntityAlreadyUpdatedException(bean, rows); - } - - //========================================================================== - // ========= - // Accessor - // ======== - public boolean isCheckSingleRowUpdate() { - return checkSingleRowUpdate; - } - - public void setCheckSingleRowUpdate(boolean resultCheck) { - this.checkSingleRowUpdate = resultCheck; - } } Modified: bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/s2dao/internal/sqlparser/InternalSqlParser.java =================================================================== --- bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/s2dao/internal/sqlparser/InternalSqlParser.java 2008-12-27 22:10:35 UTC (rev 1626) +++ bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/s2dao/internal/sqlparser/InternalSqlParser.java 2008-12-27 22:11:51 UTC (rev 1627) @@ -45,22 +45,25 @@ // ========= // Attribute // ========= + protected String specifiedSql; + + protected boolean blockNullParameter; + protected InternalSqlTokenizer tokenizer; protected Stack nodeStack = new Stack(); - protected String specifiedSql;// Extension! - //========================================================================== // ========= // Constructor // =========== - public InternalSqlParser(String sql) { + public InternalSqlParser(String sql, boolean blockNullParameter) { sql = sql.trim(); if (sql.endsWith(";")) { sql = sql.substring(0, sql.length() - 1); } - specifiedSql = sql;// Extension! + specifiedSql = sql; + this.blockNullParameter = blockNullParameter; tokenizer = new InternalSqlTokenizer(sql); } @@ -303,12 +306,14 @@ protected AbstractNode createBindVariableNode(String expr, String testValue) {// Extension // ! - return new InternalBindVariableNode(expr, testValue, specifiedSql); + return new InternalBindVariableNode(expr, testValue, specifiedSql, + blockNullParameter); } protected AbstractNode createEmbeddedValueNode(String expr, String testValue) {// Extension // ! - return new InternalEmbeddedValueNode(expr, testValue, specifiedSql); + return new InternalEmbeddedValueNode(expr, testValue, specifiedSql, + blockNullParameter); } protected ContainerNode createIfNode(String expr) {// Extension! @@ -344,12 +349,15 @@ protected String _specifiedSql; + protected boolean _blockNullParameter; + public InternalBindVariableNode(String expression, String testValue, - String specifiedSql) { + String specifiedSql, boolean blockNullParameter) { this._expression = expression; this._testValue = testValue; this._names = InternalStringUtil.split(expression, "."); this._specifiedSql = specifiedSql; + this._blockNullParameter = blockNullParameter; } public void accept(CommandContext ctx) { @@ -360,7 +368,7 @@ valueAndType.setTargetType(clazz); setupValueAndType(valueAndType); - if (valueAndType.getTargetValue() == null) { + if (_blockNullParameter && valueAndType.getTargetValue() == null) { throwBindOrEmbeddedParameterNullValueException(valueAndType); } if (!isInScope()) { @@ -462,12 +470,15 @@ protected String _specifiedSql; + protected boolean _blockNullParameter; + public InternalEmbeddedValueNode(String expression, String testValue, - String specifiedSql) { + String specifiedSql, boolean blockNullParameter) { this._expression = expression; this._testValue = testValue; this._names = InternalStringUtil.split(expression, "."); this._specifiedSql = specifiedSql; + this._blockNullParameter = blockNullParameter; } public void accept(CommandContext ctx) { @@ -478,7 +489,7 @@ valueAndType.setTargetType(clazz); setupValueAndType(valueAndType); - if (valueAndType.getTargetValue() == null) { + if (_blockNullParameter && valueAndType.getTargetValue() == null) { throwBindOrEmbeddedParameterNullValueException(valueAndType); } if (!isInScope()) { @@ -1276,7 +1287,8 @@ String[] argNames, Class[] argTypes, Object[] args) { final CommandContext context; { - final InternalSqlParser parser = new InternalSqlParser(twoWaySql); + final InternalSqlParser parser = new InternalSqlParser(twoWaySql, + false); final Node node = parser.parse(); final InternalCommandContextCreator creator = new InternalCommandContextCreator( argNames, argTypes); Added: bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/s2dao/internal/various/InternalIdentifierAbstractGenerator.java =================================================================== --- bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/s2dao/internal/various/InternalIdentifierAbstractGenerator.java (rev 0) +++ bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/s2dao/internal/various/InternalIdentifierAbstractGenerator.java 2008-12-27 22:11:51 UTC (rev 1627) @@ -0,0 +1,146 @@ +package jp.sf.pal.bookmark.db.allcommon.s2dao.internal.various; + +import java.sql.CallableStatement; +import java.sql.Connection; +import java.sql.PreparedStatement; +import java.sql.ResultSet; +import java.sql.SQLException; +import java.sql.Statement; + +import javax.sql.DataSource; + +import jp.sf.pal.bookmark.db.allcommon.s2dao.internal.sqlhandler.InternalBasicSelectHandler; +import jp.sf.pal.bookmark.db.allcommon.s2dao.internal.sqlhandler.InternalBasicHandler.SQLExceptionHandler; + +import org.seasar.dao.Dbms; +import org.seasar.dao.IdentifierGenerator; +import org.seasar.extension.jdbc.PropertyType; +import org.seasar.extension.jdbc.ResultSetHandler; +import org.seasar.extension.jdbc.StatementFactory; +import org.seasar.extension.jdbc.ValueType; +import org.seasar.framework.beans.PropertyDesc; + +/** + * @author DBFlute(AutoGenerator) + */ +public abstract class InternalIdentifierAbstractGenerator implements + IdentifierGenerator { + + //========================================================================== + // ========= + // Attribute + // ========= + protected PropertyType propertyType; + + protected Dbms dbms; + + protected ResultSetHandler resultSetHandler; + + //========================================================================== + // ========= + // Constructor + // =========== + public InternalIdentifierAbstractGenerator(PropertyType propertyType, + Dbms dbms) { + this.propertyType = propertyType; + this.dbms = dbms; + resultSetHandler = new InternalIdentifierResultSetHandler(propertyType + .getValueType()); + } + + //========================================================================== + // ========= + // Assist Helper + // ============= + protected Object executeSql(DataSource ds, String sql, Object[] args) { + InternalBasicSelectHandler selectHandler = createSelectHandler(ds, sql); + if (args != null) { + selectHandler.setLoggingMessageSqlArgs(args); + } + return selectHandler.execute(args); + } + + protected InternalBasicSelectHandler createSelectHandler(DataSource ds, + String sql) { + // Use original statement factory for identifier generator. + return new InternalBasicSelectHandler(ds, sql, resultSetHandler, + createStatementFactory(ds, sql)); + } + + protected StatementFactory createStatementFactory(DataSource ds, String sql) { + return new InternalIdentifierGeneratorStatementFactory(); + } + + protected void reflectIdentifier(Object bean, Object value) { + if (propertyType == null) { + String msg = "The arguement[propertyType] should not be null: value=" + + value; + throw new IllegalArgumentException(msg); + } + PropertyDesc pd = propertyType.getPropertyDesc(); + pd.setValue(bean, value); + } + + //========================================================================== + // ========= + // Result Set Handler + // ================== + protected static class InternalIdentifierResultSetHandler implements + ResultSetHandler { + private ValueType valueType; + + public InternalIdentifierResultSetHandler(ValueType valueType) { + this.valueType = valueType; + } + + public Object handle(ResultSet rs) throws SQLException { + if (rs.next()) { + return valueType.getValue(rs, 1); + } + return null; + } + } + + //========================================================================== + // ========= + // Statement Factory + // ================= + protected static class InternalIdentifierGeneratorStatementFactory + implements StatementFactory { + public PreparedStatement createPreparedStatement(Connection conn, + String sql) { + try { + return conn.prepareStatement(sql); + } catch (SQLException e) { + handleSQLException(e, null); + return null; // Unreachable! + } + } + + public CallableStatement createCallableStatement(Connection conn, + String sql) { + try { + return conn.prepareCall(sql); + } catch (SQLException e) { + handleSQLException(e, null); + return null; // Unreachable! + } + } + + protected void handleSQLException(SQLException e, Statement statement) { + new SQLExceptionHandler().handleSQLException(e, statement); + } + } + + //========================================================================== + // ========= + // Accessor + // ======== + public String getPropertyName() { + return propertyType.getPropertyName(); + } + + public Dbms getDbms() { + return dbms; + } +} Property changes on: bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/s2dao/internal/various/InternalIdentifierAbstractGenerator.java ___________________________________________________________________ Name: svn:eol-style + native Added: bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/s2dao/internal/various/InternalIdentifierAssignedGenerator.java =================================================================== --- bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/s2dao/internal/various/InternalIdentifierAssignedGenerator.java (rev 0) +++ bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/s2dao/internal/various/InternalIdentifierAssignedGenerator.java 2008-12-27 22:11:51 UTC (rev 1627) @@ -0,0 +1,33 @@ +package jp.sf.pal.bookmark.db.allcommon.s2dao.internal.various; + +import javax.sql.DataSource; + +import org.seasar.dao.Dbms; +import org.seasar.extension.jdbc.PropertyType; + +/** + * @author DBFlute(AutoGenerator) + */ +public class InternalIdentifierAssignedGenerator extends + InternalIdentifierAbstractGenerator { + + //========================================================================== + // ========= + // Constructor + // =========== + public InternalIdentifierAssignedGenerator(PropertyType propertyType, + Dbms dbms) { + super(propertyType, dbms); + } + + //========================================================================== + // ========= + // Implementation + // ============== + public void setIdentifier(Object bean, DataSource ds) { + } + + public boolean isSelfGenerate() { + return true; + } +} Property changes on: bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/s2dao/internal/various/InternalIdentifierAssignedGenerator.java ___________________________________________________________________ Name: svn:eol-style + native Added: bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/s2dao/internal/various/InternalIdentifierGeneratorFactory.java =================================================================== --- bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/s2dao/internal/various/InternalIdentifierGeneratorFactory.java (rev 0) +++ bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/s2dao/internal/various/InternalIdentifierGeneratorFactory.java 2008-12-27 22:11:51 UTC (rev 1627) @@ -0,0 +1,105 @@ +package jp.sf.pal.bookmark.db.allcommon.s2dao.internal.various; + +import java.lang.reflect.Constructor; +import java.util.HashMap; +import java.util.Map; + +import jp.sf.pal.bookmark.db.allcommon.util.SimpleStringUtil; + +import org.seasar.dao.Dbms; +import org.seasar.dao.IdentifierGenerator; +import org.seasar.extension.jdbc.PropertyType; +import org.seasar.framework.beans.BeanDesc; +import org.seasar.framework.beans.PropertyDesc; +import org.seasar.framework.beans.factory.BeanDescFactory; +import org.seasar.framework.util.ClassUtil; +import org.seasar.framework.util.ConstructorUtil; + +/** + * @author DBFlute(AutoGenerator) + */ +public class InternalIdentifierGeneratorFactory { + + //========================================================================== + // ========= + // Attribute + // ========= + private static Map> generatorClasses = new HashMap>(); + + static { + addIdentifierGeneratorClass("assigned", + InternalIdentifierAssignedGenerator.class); + addIdentifierGeneratorClass("identity", + InternalIdentifierIdentityGenerator.class); + addIdentifierGeneratorClass("sequence", + InternalIdentifierSequenceGenerator.class); + } + + //========================================================================== + // ========= + // Constructor + // =========== + private InternalIdentifierGeneratorFactory() { + } + + //========================================================================== + // ========= + // Identifier Generator + // ==================== + public static void addIdentifierGeneratorClass(String name, Class clazz) { + generatorClasses.put(name, clazz); + } + + public static IdentifierGenerator createIdentifierGenerator( + PropertyType propertyType, Dbms dbms) { + return createIdentifierGenerator(propertyType, dbms, null); + } + + public static IdentifierGenerator createIdentifierGenerator( + PropertyType propertyType, Dbms dbms, String annotation) { + if (propertyType == null) { + String msg = "The argument[propertyType] should not be null: dbms=" + + dbms + " annotation=" + annotation; + throw new IllegalArgumentException(msg); + } + if (dbms == null) { + String msg = "The argument[dbms] should not be null: propertyType=" + + propertyType + " annotation=" + annotation; + throw new IllegalArgumentException(msg); + } + if (annotation == null) { + return new InternalIdentifierAssignedGenerator(propertyType, dbms); + } + String[] array = SimpleStringUtil.split(annotation, "=, "); + Class clazz = getGeneratorClass(array[0]); + IdentifierGenerator generator = createIdentifierGenerator(clazz, + propertyType, dbms); + for (int i = 1; i < array.length; i += 2) { + setProperty(generator, array[i].trim(), array[i + 1].trim()); + } + return generator; + } + + protected static Class getGeneratorClass(String name) { + Class clazz = generatorClasses.get(name); + if (clazz != null) { + return clazz; + } + return ClassUtil.forName(name); + } + + protected static IdentifierGenerator createIdentifierGenerator( + Class clazz, PropertyType propertyType, Dbms dbms) { + Constructor constructor = ClassUtil.getConstructor(clazz, + new Class[] { PropertyType.class, Dbms.class }); + return (IdentifierGenerator) ConstructorUtil.newInstance(constructor, + new Object[] { propertyType, dbms }); + } + + protected static void setProperty(IdentifierGenerator generator, + String propertyName, String value) { + BeanDesc beanDesc = BeanDescFactory.getBeanDesc(generator.getClass()); + PropertyDesc pd = beanDesc.getPropertyDesc(propertyName); + pd.setValue(generator, value); + } +} Property changes on: bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/s2dao/internal/various/InternalIdentifierGeneratorFactory.java ___________________________________________________________________ Name: svn:eol-style + native Added: bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/s2dao/internal/various/InternalIdentifierIdentityGenerator.java =================================================================== --- bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/s2dao/internal/various/InternalIdentifierIdentityGenerator.java (rev 0) +++ bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/s2dao/internal/various/InternalIdentifierIdentityGenerator.java 2008-12-27 22:11:51 UTC (rev 1627) @@ -0,0 +1,35 @@ +package jp.sf.pal.bookmark.db.allcommon.s2dao.internal.various; + +import javax.sql.DataSource; + +import org.seasar.dao.Dbms; +import org.seasar.extension.jdbc.PropertyType; + +/** + * @author DBFlute(AutoGenerator) + */ +public class InternalIdentifierIdentityGenerator extends + InternalIdentifierAbstractGenerator { + + //========================================================================== + // ========= + // Constructor + // =========== + public InternalIdentifierIdentityGenerator(PropertyType propertyType, + Dbms dbms) { + super(propertyType, dbms); + } + + //========================================================================== + // ========= + // Implementation + // ============== + public void setIdentifier(Object bean, DataSource ds) { + Object value = executeSql(ds, getDbms().getIdentitySelectString(), null); + reflectIdentifier(bean, value); + } + + public boolean isSelfGenerate() { + return false; + } +} Property changes on: bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/s2dao/internal/various/InternalIdentifierIdentityGenerator.java ___________________________________________________________________ Name: svn:eol-style + native Added: bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/s2dao/internal/various/InternalIdentifierSequenceGenerator.java =================================================================== --- bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/s2dao/internal/various/InternalIdentifierSequenceGenerator.java (rev 0) +++ bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/s2dao/internal/various/InternalIdentifierSequenceGenerator.java 2008-12-27 22:11:51 UTC (rev 1627) @@ -0,0 +1,116 @@ +package jp.sf.pal.bookmark.db.allcommon.s2dao.internal.various; + +import java.util.HashMap; + +import javax.sql.DataSource; + +import jp.sf.pal.bookmark.db.allcommon.util.SimpleTypeUtil; + +import org.seasar.dao.Dbms; +import org.seasar.extension.jdbc.PropertyType; + +/** + * @author DBFlute(AutoGenerator) + */ +public class InternalIdentifierSequenceGenerator extends + InternalIdentifierAbstractGenerator { + + // - - - - - - - - - - + // [Unused on DBFlute] + // - - - - - - - - - - + + //========================================================================== + // ========= + // Attribute + // ========= + private String sequenceName; + + private long allocationSize = 0; + + private HashMap idContextMap = new HashMap(); + + //========================================================================== + // ========= + // Constructor + // =========== + public InternalIdentifierSequenceGenerator(PropertyType propertyType, + Dbms dbms) { + super(propertyType, dbms); + } + + //========================================================================== + // ========= + // Implementation + // ============== + public void setIdentifier(Object bean, DataSource ds) { + reflectIdentifier(bean, getNextValue(ds)); + } + + public boolean isSelfGenerate() { + return getDbms().isSelfGenerate(); + } + + //========================================================================== + // ========= + // Next Value + // ========== + protected Object getNextValue(DataSource ds) { + if (allocationSize > 0) { + long value = getIdContext(ds).getNextValue(ds); + return new Long(value); + } + return getNewInitialValue(ds); + } + + protected Object getNewInitialValue(DataSource ds) { + return executeSql(ds, getDbms().getSequenceNextValString(sequenceName), + null); + } + + protected IdContext getIdContext(DataSource ds) { + synchronized (idContextMap) { + IdContext context = idContextMap.get(ds); + if (context == null) { + context = new IdContext(); + idContextMap.put(ds, context); + } + return context; + } + } + + public class IdContext { + protected long initialValue; + + protected long allocated = Long.MAX_VALUE; + + public synchronized long getNextValue(DataSource ds) { + if (allocated < allocationSize) { + return initialValue + allocated++; + } + initialValue = SimpleTypeUtil + .toPrimitiveLong(getNewInitialValue(ds)); + allocated = 1; + return initialValue; + } + } + + //========================================================================== + // ========= + // Accessor + // ======== + public String getSequenceName() { + return sequenceName; + } + + public void setSequenceName(String sequenceName) { + this.sequenceName = sequenceName; + } + + public long getAllocationSize() { + return allocationSize; + } + + public void setAllocationSize(long allocationSize) { + this.allocationSize = allocationSize; + } +} Property changes on: bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/s2dao/internal/various/InternalIdentifierSequenceGenerator.java ___________________________________________________________________ Name: svn:eol-style + native Modified: bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/s2dao/internal/various/InternalProcedureMetaDataFactory.java =================================================================== --- bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/s2dao/internal/various/InternalProcedureMetaDataFactory.java 2008-12-27 22:10:35 UTC (rev 1626) +++ bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/s2dao/internal/various/InternalProcedureMetaDataFactory.java 2008-12-27 22:11:51 UTC (rev 1627) @@ -7,7 +7,7 @@ import java.util.Map; import java.util.Stack; -import jp.sf.pal.bookmark.db.allcommon.cbean.ConditionBeanContext; +import jp.sf.pal.bookmark.db.allcommon.DBDef; import org.seasar.dao.ValueTypeFactory; import org.seasar.dao.util.TypeUtil; @@ -146,9 +146,9 @@ } final Class type = field.getType(); if (List.class.isAssignableFrom(type)) {// is for out parameter cursor. - if (ConditionBeanContext.isOracle()) { + if (DBDef.isCurrentDef(DBDef.Oracle)) { return ValueTypes.ORACLE_RESULT_SET; - } else if (ConditionBeanContext.isPostgreSql()) { + } else if (DBDef.isCurrentDef(DBDef.PostgreSQL)) { return ValueTypes.POSTGRE_RESULT_SET; } else { return ValueTypes.SERIALIZABLE_BYTE_ARRAY; Added: bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/s2dao/internal/various/InternalStatementFactory.java =================================================================== --- bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/s2dao/internal/various/InternalStatementFactory.java (rev 0) +++ bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/s2dao/internal/various/InternalStatementFactory.java 2008-12-27 22:11:51 UTC (rev 1627) @@ -0,0 +1,158 @@ +package jp.sf.pal.bookmark.db.allcommon.s2dao.internal.various; + +import java.sql.CallableStatement; +import java.sql.Connection; +import java.sql.PreparedStatement; +import java.sql.SQLException; +import java.sql.Statement; + +import jp.sf.pal.bookmark.db.allcommon.cbean.ConditionBean; +import jp.sf.pal.bookmark.db.allcommon.cbean.ConditionBeanContext; +import jp.sf.pal.bookmark.db.allcommon.cbean.outsidesql.OutsideSqlContext; +import jp.sf.pal.bookmark.db.allcommon.jdbc.StatementConfig; +import jp.sf.pal.bookmark.db.allcommon.s2dao.internal.sqlhandler.InternalBasicHandler.SQLExceptionHandler; + +import org.seasar.extension.jdbc.StatementFactory; + +/** + * @author DBFlute(AutoGenerator) + */ +public class InternalStatementFactory implements StatementFactory { + + //========================================================================== + // ========= + // Definition + // ========== + /** Log-instance. */ + private static final org.apache.commons.logging.Log _log = org.apache.commons.logging.LogFactory + .getLog(InternalStatementFactory.class); + + //========================================================================== + // ========= + // Attribute + // ========= + protected StatementConfig defaultStatementConfig; + + protected boolean internalDebug; + + //========================================================================== + // ========= + // Constructor + // =========== + public InternalStatementFactory() { + } + + //========================================================================== + // ========= + // Implementation + // ============== + public PreparedStatement createPreparedStatement(Connection conn, String sql) { + try { + final StatementConfig config = findStatementConfigOnThread(); + ; + final int resultSetType; + if (config != null && config.hasResultSetType()) { + resultSetType = config.getResultSetType(); + } else if (defaultStatementConfig != null + && defaultStatementConfig.hasResultSetType()) { + resultSetType = defaultStatementConfig.getResultSetType(); + } else { + resultSetType = java.sql.ResultSet.TYPE_FORWARD_ONLY; + } + final int resultSetConcurrency = java.sql.ResultSet.CONCUR_READ_ONLY; + if (internalDebug) { + _log.debug("...Creating prepareStatement(sql, " + resultSetType + + ", " + resultSetConcurrency + ")"); + } + final PreparedStatement ps = conn.prepareStatement(sql, + resultSetType, resultSetConcurrency); + if (config != null && config.hasStatementOptions()) { + if (internalDebug) { + _log.debug("...Setting statement config as request: " + + config); + } + reflectStatementOptions(config, ps); + } else { + reflectDefaultOptionsToStatementIfNeeds(ps); + } + return ps; + } catch (SQLException e) { + handleSQLException(e, null); + return null;// Unreachable! + } + } + + public CallableStatement createCallableStatement(Connection conn, String sql) { + return prepareCall(conn, sql); + } + + protected StatementConfig findStatementConfigOnThread() { + final StatementConfig config; + if (ConditionBeanContext.isExistConditionBeanOnThread()) { + final ConditionBean cb = ConditionBeanContext + .getConditionBeanOnThread(); + config = cb.getStatementConfig(); + } else if (OutsideSqlContext.isExistOutsideSqlContextOnThread()) { + final OutsideSqlContext context = OutsideSqlContext + .getOutsideSqlContextOnThread(); + config = context.getStatementConfig(); + } else { + config = null; + } + return config; + } + + protected void reflectDefaultOptionsToStatementIfNeeds(PreparedStatement ps) { + if (defaultStatementConfig != null + && defaultStatementConfig.hasStatementOptions()) { + if (internalDebug) { + _log.debug("...Setting statement config as default: " + + defaultStatementConfig); + } + reflectStatementOptions(defaultStatementConfig, ps); + return; + } + } + + protected void reflectStatementOptions(StatementConfig config, + PreparedStatement ps) { + try { + if (config.hasQueryTimeout()) { + ps.setQueryTimeout(config.getQueryTimeout()); + } + if (config.hasFetchSize()) { + ps.setFetchSize(config.getFetchSize()); + } + if (config.hasMaxRows()) { + ps.setMaxRows(config.getMaxRows()); + } + } catch (SQLException e) { + handleSQLException(e, ps); + } + } + + protected CallableStatement prepareCall(Connection conn, String sql) { + try { + return conn.prepareCall(sql); + } catch (SQLException e) { + handleSQLException(e, null); + return null;// Unreachable! + } + } + + protected void handleSQLException(SQLException e, Statement statement) { + new SQLExceptionHandler().handleSQLException(e, statement); + } + + //========================================================================== + // ========= + // Accessor + // ======== + public void setDefaultStatementConfig(StatementConfig defaultStatementConfig) { + this.defaultStatementConfig = defaultStatementConfig; + } + + public void setInternalDebug(boolean internalDebug) { + this.internalDebug = internalDebug; + } +} Property changes on: bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/s2dao/internal/various/InternalStatementFactory.java ___________________________________________________________________ Name: svn:eol-style + native Modified: bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/util/SimpleAssertUtil.java =================================================================== --- bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/util/SimpleAssertUtil.java 2008-12-27 22:10:35 UTC (rev 1626) +++ bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/util/SimpleAssertUtil.java 2008-12-27 22:11:51 UTC (rev 1627) @@ -7,11 +7,8 @@ //========================================================================== // ========= - // Assert + // Object // ====== - // ----------------------------------------------------- - // Assert Object - // ------------- /** * Assert that the object is not null. * @@ -32,9 +29,10 @@ } } - // ----------------------------------------------------- - // Assert String - // ------------- + //========================================================================== + // ========= + // String + // ====== /** * Assert that the entity is not null and not trimmed empty. * Added: bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/util/SimpleResourceUtil.java =================================================================== --- bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/util/SimpleResourceUtil.java (rev 0) +++ bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/util/SimpleResourceUtil.java 2008-12-27 22:11:51 UTC (rev 1627) @@ -0,0 +1,117 @@ +package jp.sf.pal.bookmark.db.allcommon.util; + +import java.io.IOException; +import java.io.InputStream; +import java.net.URL; +import java.net.URLConnection; + +/** + * @author DBFlute(AutoGenerator) + */ +public class SimpleResourceUtil { + + //========================================================================== + // ========= + // Resource Path + // ============= + public static String getResourcePath(String path, String extension) { + if (extension == null) { + return path; + } + extension = "." + extension; + if (path.endsWith(extension)) { + return path; + } + return path.replace('.', '/') + extension; + } + + public static String getResourcePath(Class clazz) { + return clazz.getName().replace('.', '/') + ".class"; + } + + //========================================================================== + // ========= + // Resource URL + // ============ + public static URL getResourceUrl(String path) { + return getResourceUrl(path, null); + } + + public static URL getResourceUrl(String path, String extension) { + return getResourceUrl(path, extension, Thread.currentThread() + .getContextClassLoader()); + } + + public static URL getResourceUrl(String path, String extension, + ClassLoader loader) { + if (path == null || loader == null) { + return null; + } + path = getResourcePath(path, extension); + return loader.getResource(path); + } + + //========================================================================== + // ========= + // Resource Stream + // =============== + public static InputStream getResourceStream(String path) { + return getResourceStream(path, null); + } + + public static InputStream getResourceStream(String path, String extension) { + final URL url = getResourceUrl(path, extension); + return url != null ? openStream(url) : null; + } + + //========================================================================== + // ========= + // Resource Existence + // ================== + public static boolean isExist(String path) { + return getResourceUrl(path) != null; + } + + //========================================================================== + // ========= + // Assist Helper + // ============= + protected static ClassLoader getClassLoader() { + return Thread.currentThread().getContextClassLoader(); + } + + protected static InputStream openStream(URL url) { + try { + URLConnection connection = url.openConnection(); + connection.setUseCaches(false); + return connection.getInputStream(); + } catch (IOException e) { + String msg = "Failed to open the stream: url=" + url; + throw new IllegalStateException(msg, e); + } + } + + //========================================================================== + // ========= + // Assert Helper + // ============= + /** + * Assert that the object is not null. + * + * @param variableName Variable name. (NotNull) + * @param value Value. (NotNull) + * @exception IllegalArgumentException + */ + protected static void assertObjectNotNull(String variableName, Object value) { + if (variableName == null) { + String msg = "The value should not be null: variableName=" + + variableName + " value=" + value; + throw new IllegalArgumentException(msg); + } + if (value == null) { + String msg = "The value should not be null: variableName=" + + variableName; + throw new IllegalArgumentException(msg); + } + } +} Property changes on: bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/util/SimpleResourceUtil.java ___________________________________________________________________ Name: svn:eol-style + native Modified: bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/util/SimpleStringUtil.java =================================================================== --- bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/util/SimpleStringUtil.java 2008-12-27 22:10:35 UTC (rev 1626) +++ bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/util/SimpleStringUtil.java 2008-12-27 22:11:51 UTC (rev 1627) @@ -1,14 +1,20 @@ package jp.sf.pal.bookmark.db.allcommon.util; +import java.util.ArrayList; +import java.util.List; +import java.util.StringTokenizer; + /** * @author DBFlute(AutoGenerator) */ public class SimpleStringUtil { + protected static final String[] EMPTY_STRINGS = new String[0]; + //========================================================================== // ========= - // String - // ====== + // Replace + // ======= public static String replace(String text, String fromText, String toText) { if (text == null || fromText == null || toText == null) { return null; @@ -32,6 +38,26 @@ } while (true); } + //========================================================================== + // ========= + // Split + // ===== + public static String[] split(final String str, final String delimiter) { + if (str == null || str.trim().length() == 0) { + return EMPTY_STRINGS; + } + final List list = new ArrayList(); + final StringTokenizer st = new StringTokenizer(str, delimiter); + while (st.hasMoreElements()) { + list.add(st.nextToken()); + } + return (String[]) list.toArray(new String[list.size()]); + } + + //========================================================================== + // ========= + // Initial Convert + // =============== public static String initCap(String str) { assertObjectNotNull("str", str); return str.substring(0, 1).toUpperCase() + str.substring(1); @@ -42,9 +68,10 @@ return str.substring(0, 1).toLowerCase() + str.substring(1); } - // ----------------------------------------------------- - // Assert Object - // ------------- + //========================================================================== + // ========= + // Assert Helper + // ============= /** * Assert that the object is not null. * Modified: bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/util/SimpleSystemUtil.java =================================================================== --- bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/util/SimpleSystemUtil.java 2008-12-27 22:10:35 UTC (rev 1626) +++ bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/util/SimpleSystemUtil.java 2008-12-27 22:11:51 UTC (rev 1627) @@ -7,8 +7,8 @@ //========================================================================== // ========= - // System - // ====== + // Line Separator + // ============== public static String getLineSeparator() { // /- - - - - - - - - - - - - - - - - - - - - - // Because 'CR + LF' caused many trouble! Added: bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/util/SimpleTypeUtil.java =================================================================== --- bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/util/SimpleTypeUtil.java (rev 0) +++ bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/util/SimpleTypeUtil.java 2008-12-27 22:11:51 UTC (rev 1627) @@ -0,0 +1,692 @@ +package jp.sf.pal.bookmark.db.allcommon.util; + +import java.math.BigDecimal; +import java.math.BigInteger; +import java.text.DateFormat; +import java.text.DecimalFormatSymbols; +import java.text.ParseException; +import java.text.SimpleDateFormat; +import java.util.ArrayList; +import java.util.Calendar; +import java.util.Date; +import java.util.List; +import java.util.Locale; +import java.util.Map; +import java.util.StringTokenizer; +import java.util.concurrent.ConcurrentHashMap; + +/** + * {Refers to S2Container's utility and Extends it} + * + * @author DBFlute(AutoGenerator) + */ +public class SimpleTypeUtil { + + //========================================================================== + // ========= + // Convert To + // ========== + // ----------------------------------------------------- + // Boolean + // ------- + public static Boolean toBoolean(Object o) { + if (o == null) { + return null; + } else if (o instanceof Boolean) { + return (Boolean) o; + } else if (o instanceof Number) { + int num = ((Number) o).intValue(); + return Boolean.valueOf(num != 0); + } else if (o instanceof String) { + String s = (String) o; + if ("true".equalsIgnoreCase(s)) { + return Boolean.TRUE; + } else if ("false".equalsIgnoreCase(s)) { + return Boolean.FALSE; + } else if (s.equals("0")) { + return Boolean.FALSE; + } else { + return Boolean.TRUE; + } + } else { + return Boolean.TRUE; + } + } + + // ----------------------------------------------------- + // Integer + // ------- + public static Integer toInteger(Object o) { + return toInteger(o, null); + } + + public static Integer toInteger(Object o, String pattern) { + if (o == null) { + return null; + } else if (o instanceof Integer) { + return (Integer) o; + } else if (o instanceof Number) { + return new Integer(((Number) o).intValue()); + } else if (o instanceof String) { + return toInteger((String) o); + } else if (o instanceof java.util.Date) { + if (pattern != null) { + return new Integer(new SimpleDateFormat(pattern).format(o)); + } + return new Integer((int) ((java.util.Date) o).getTime()); + } else if (o instanceof Boolean) { + return ((Boolean) o).booleanValue() ? new Integer(1) : new Integer( + 0); + } else { + return toInteger(o.toString()); + } + } + + protected static Integer toInteger(String s) { + if (s == null || s.trim().length() == 0) { + return null; + } + return new Integer(normalize(s)); + } + + public static int toPrimitiveInt(Object o) { + return toPrimitiveInt(o, null); + } + + public static int toPrimitiveInt(Object o, String pattern) { + if (o == null) { + return 0; + } else if (o instanceof Number) { + return ((Number) o).intValue(); + } else if (o instanceof String) { + return toPrimitiveInt((String) o); + } else if (o instanceof java.util.Date) { + if (pattern != null) { + return Integer + .parseInt(new SimpleDateFormat(pattern).format(o)); + } + return (int) ((java.util.Date) o).getTime(); + } else if (o instanceof Boolean) { + return ((Boolean) o).booleanValue() ? 1 : 0; + } else { + return toPrimitiveInt(o.toString()); + } + } + + protected static int toPrimitiveInt(String s) { + if (s == null || s.trim().length() == 0) { + return 0; + } + return Integer.parseInt(normalize(s)); + } + + // ----------------------------------------------------- + // BigDecimal + // ---------- + public static BigDecimal toBigDecimal(Object o) { + return toBigDecimal(o, null); + } + + public static BigDecimal toBigDecimal(Object o, String pattern) { + if (o == null) { + return null; + } else if (o instanceof BigDecimal) { + return (BigDecimal) o; + } else if (o instanceof java.util.Date) { + if (pattern != null) { + return new BigDecimal(new SimpleDateFormat(pattern).format(o)); + } + return new BigDecimal(Long.toString(((java.util.Date) o).getTime())); + } else if (o instanceof String) { + String s = (String) o; + if (s == null || s.trim().length() == 0) { + return null; + } + return new BigDecimal(new BigDecimal(s).toPlainString()); + } else { + return new BigDecimal(new BigDecimal(o.toString()).toPlainString()); + } + } + + // ----------------------------------------------------- + // Double + // ------ + public static Double toDouble(Object o) { + return toDouble(o, null); + } + + public static Double toDouble(Object o, String pattern) { + if (o == null) { + return null; + } else if (o instanceof Double) { + return (Double) o; + } else if (o instanceof Number) { + return new Double(((Number) o).doubleValue()); + } else if (o instanceof String) { + return toDouble((String) o); + } else if (o instanceof java.util.Date) { + if (pattern != null) { + return new Double(new SimpleDateFormat(pattern).format(o)); + } + return new Double(((java.util.Date) o).getTime()); + } else { + return toDouble(o.toString()); + } + } + + protected static Double toDouble(String s) { + if (s == null || s.trim().length() == 0) { + return null; + } + return new Double(normalize(s)); + } + + // ----------------------------------------------------- + // Long + // ---- + public static Long toLong(Object o) { + return toLong(o, null); + } + + public static Long toLong(Object o, String pattern) { + if (o == null) { + return null; + } else if (o instanceof Long) { + return (Long) o; + } else if (o instanceof Number) { + return new Long(((Number) o).longValue()); + } else if (o instanceof String) { + return toLong((String) o); + } else if (o instanceof java.util.Date) { + if (pattern != null) { + return new Long(new SimpleDateFormat(pattern).format(o)); + } + return new Long(((java.util.Date) o).getTime()); + } else if (o instanceof Boolean) { + return ((Boolean) o).booleanValue() ? new Long(1) : new Long(0); + } else { + return toLong(o.toString()); + } + } + + protected static Long toLong(String s) { + if (s == null || s.trim().length() == 0) { + return null; + } + return new Long(normalize(s)); + } + + public static long toPrimitiveLong(Object o) { + return toPrimitiveLong(o, null); + } + + public static long toPrimitiveLong(Object o, String pattern) { + if (o == null) { + return 0; + } else if (o instanceof Number) { + return ((Number) o).longValue(); + } else if (o instanceof String) { + return toPrimitiveLong((String) o); + } else if (o instanceof java.util.Date) { + if (pattern != null) { + return Long.parseLong(new SimpleDateFormat(pattern).format(o)); + } + return ((java.util.Date) o).getTime(); + } else if (o instanceof Boolean) { + return ((Boolean) o).booleanValue() ? 1 : 0; + } else { + return toPrimitiveLong(o.toString()); + } + } + + protected static long toPrimitiveLong(String s) { + if (s == null || s.trim().length() == 0) { + return 0; + } + return Long.parseLong(normalize(s)); + } + + // ----------------------------------------------------- + // Float + // ----- + public static Float toFloat(Object o) { + return toFloat(o, null); + } + + public static Float toFloat(Object o, String pattern) { + if (o == null) { + return null; + } else if (o instanceof Float) { + return (Float) o; + } else if (o instanceof Number) { + return new Float(((Number) o).floatValue()); + } else if (o instanceof String) { + return toFloat((String) o); + } else if (o instanceof java.util.Date) { + if (pattern != null) { + return new Float(new SimpleDateFormat(pattern).format(o)); + } + return new Float(((java.util.Date) o).getTime()); + } else { + return toFloat(o.toString()); + } + } + + protected static Float toFloat(String s) { + if (s == null || s.trim().length() == 0) { + return null; + } + return new Float(normalize(s)); + } + + // ----------------------------------------------------- + // Short + // ----- + public static Short toShort(Object o) { + return toShort(o, null); + } + + public static Short toShort(Object o, String pattern) { + if (o == null) { + return null; + } else if (o instanceof Short) { + return (Short) o; + } else if (o instanceof Number) { + return new Short(((Number) o).shortValue()); + } else if (o instanceof String) { + return toShort((String) o); + } else if (o instanceof java.util.Date) { + if (pattern != null) { + return new Short(new SimpleDateFormat(pattern).format(o)); + } + return new Short((short) ((java.util.Date) o).getTime()); + } else if (o instanceof Boolean) { + return ((Boolean) o).booleanValue() ? new Short((short) 1) + : new Short((short) 0); + } else { + return toShort(o.toString()); + } + } + + protected static Short toShort(String s) { + if (s == null || s.trim().length() == 0) { + return null; + } + return new Short(normalize(s)); + } + + // ----------------------------------------------------- + // BigInteger + // ---------- + public static BigInteger toBigInteger(Object o) { + return toBigInteger(o, null); + } + + public static BigInteger toBigInteger(Object o, String pattern) { + if (o == null) { + return null; + } else if (o instanceof BigInteger) { + return (BigInteger) o; + } else { + Long l = toLong(o, pattern); + if (l == null) { + return null; + } + return BigInteger.valueOf(l.longValue()); + } + } + + // ----------------------------------------------------- + // Byte + // ---- + public static Byte toByte(Object o) { + return toByte(o, null); + } + + public static Byte toByte(Object o, String pattern) { + if (o == null) { + return null; + } else if (o instanceof Byte) { + return (Byte) o; + } else if (o instanceof Number) { + return new Byte(((Number) o).byteValue()); + } else if (o instanceof String) { + return toByte((String) o); + } else if (o instanceof java.util.Date) { + if (pattern != null) { + return new Byte(new SimpleDateFormat(pattern).format(o)); + } + return new Byte((byte) ((java.util.Date) o).getTime()); + } else if (o instanceof Boolean) { + return ((Boolean) o).booleanValue() ? new Byte((byte) 1) + : new Byte((byte) 0); + } else { + return toByte(o.toString()); + } + } + + protected static Byte toByte(String s) { + if (s == null || s.trim().length() == 0) { + return null; + } + return new Byte(normalize(s)); + } + + // ----------------------------------------------------- + // Date + // ---- + public static Date toDate(Object o) { + return toDate(o, null); + } + + public static Date toDate(Object o, String pattern) { + if (o == null) { + return null; + } else if (o instanceof String) { + return toDate((String) o, pattern); + } else if (o instanceof Date) { + return (Date) o; + } else if (o instanceof Calendar) { + return ((Calendar) o).getTime(); + } else { + return toDate(o.toString(), pattern); + } + } + + protected static Date toDate(String s, String pattern) { + return toDate(s, pattern, Locale.getDefault()); + } + + protected static Date toDate(String s, String pattern, Locale locale) { + if (s == null || s.trim().length() == 0) { + return null; + } + SimpleDateFormat sdf = getDateFormat(s, pattern, locale); + try { + return sdf.parse(s); + } catch (ParseException e) { + String msg = "Failed to parse the string to date: "; + msg = msg + " string=" + s + " format=" + sdf + " locale=" + locale; + throw new IllegalStateException(msg, e); + } + } + + public static java.sql.Date toSqlDate(Object o) { + return toSqlDate(o, null); + } + + public static java.sql.Date toSqlDate(Object o, String pattern) { + if (o instanceof java.sql.Date) { + return (java.sql.Date) o; + } + java.util.Date date = toDate(o, pattern); + if (date != null) { + return new java.sql.Date(date.getTime()); + } + return null; + } + + // ----------------------------------------------------- + // Number + // ------ + public static Object toNumber(Class type, Object o) { + if (type == Integer.class) { + return toInteger(o); + } else if (type == BigDecimal.class) { + return toBigDecimal(o); + } else if (type == Double.class) { + return toDouble(o); + } else if (type == Long.class) { + return toLong(o); + } else if (type == Float.class) { + return toFloat(o); + } else if (type == Short.class) { + return toShort(o); + } else if (type == BigInteger.class) { + return toBigInteger(o); + } else if (type == Byte.class) { + return toByte(o); + } + return o; + } + + // ----------------------------------------------------- + // Wrapper + // ------- + public static Object toWrapper(Class type, Object o) { + if (type == int.class) { + Integer i = toInteger(o); + if (i != null) { + return i; + } + return new Integer(0); + } else if (type == double.class) { + Double d = toDouble(o); + if (d != null) { + return d; + } + return new Double(0); + } else if (type == long.class) { + Long l = toLong(o); + if (l != null) { + return l; + } + return new Long(0); + } else if (type == float.class) { + Float f = toFloat(o); + if (f != null) { + return f; + } + return new Float(0); + } else if (type == short.class) { + Short s = toShort(o); + if (s != null) { + return s; + } + return new Short((short) 0); + } else if (type == boolean.class) { + Boolean b = toBoolean(o); + if (b != null) { + return b; + } + return Boolean.FALSE; + } else if (type == byte.class) { + Byte b = toByte(o); + if (b != null) { + return b; + } + return new Byte((byte) 0); + } + return o; + } + + //========================================================================== + // ========= + // Normalize + // ========= + protected static String normalize(String s) { + return normalize(s, Locale.getDefault()); + } + + protected static String normalize(String s, Locale locale) { + if (s == null) { + return null; + } + DecimalFormatSymbols symbols = getDecimalFormatSymbols(locale); + char decimalSep = symbols.getDecimalSeparator(); + char groupingSep = symbols.getGroupingSeparator(); + StringBuilder sb = new StringBuilder(20); + for (int i = 0; i < s.length(); ++i) { + char c = s.charAt(i); + if (c == groupingSep) { + continue; + } else if (c == decimalSep) { + c = '.'; + } + sb.append(c); + } + return sb.toString(); + } + + //========================================================================== + // ========= + // Assist Helper + // ============= + + // ----------------------------------------------------- + // DateFormat + // ---------- + protected static SimpleDateFormat getDateFormat(String s, String pattern, + Locale locale) { + if (pattern != null) { + return new SimpleDateFormat(pattern); + } + return getDateFormat(s, locale); + } + + protected static SimpleDateFormat getDateFormat(String s, Locale locale) { + String pattern = getDateFormatPattern(locale); + String shortPattern = removeDateDelimiter(pattern); + String delimitor = findDateDelimiter(s); + if (delimitor == null) { + if (s.length() == shortPattern.length()) { + return new SimpleDateFormat(shortPattern); + } + if (s.length() == shortPattern.length() + 2) { + return new SimpleDateFormat(replace(shortPattern, "yy", "yyyy")); + } + } else { + String[] array = split(s, delimitor); + for (int i = 0; i < array.length; ++i) { + if (array[i].length() == 4) { + pattern = replace(pattern, "yy", "yyyy"); + break; + } + } + return new SimpleDateFormat(pattern); + } + return new SimpleDateFormat(); + } + + protected static String getDateFormatPattern(Locale locale) { + SimpleDateFormat df = (SimpleDateFormat) DateFormat.getDateInstance( + DateFormat.SHORT, locale); + String pattern = df.toPattern(); + int index = pattern.indexOf(' '); + if (index > 0) { + pattern = pattern.substring(0, index); + } + if (pattern.indexOf("MM") < 0) { + pattern = replace(pattern, "M", "MM"); + } + if (pattern.indexOf("dd") < 0) { + pattern = replace(pattern, "d", "dd"); + } + return pattern; + } + + protected static String removeDateDelimiter(String pattern) { + StringBuilder sb = new StringBuilder(); + for (int i = 0; i < pattern.length(); ++i) { + char c = pattern.charAt(i); + if (c == 'y' || c == 'M' || c == 'd') { + sb.append(c); + } + } + return sb.toString(); + } + + protected static String findDateDelimiter(String value) { + for (int i = 0; i < value.length(); ++i) { + char c = value.charAt(i); + if (Character.isDigit(c)) { + continue; + } + return Character.toString(c); + } + return null; + } + + // ----------------------------------------------------- + // DecimalFormatSymbols + // -------------------- + protected static Map symbolsCache = new ConcurrentHashMap(); + + protected static DecimalFormatSymbols getDecimalFormatSymbols() { + return getDecimalFormatSymbols(Locale.getDefault()); + } + + protected static DecimalFormatSymbols getDecimalFormatSymbols(Locale locale) { + DecimalFormatSymbols symbols = (DecimalFormatSymbols) symbolsCache + .get(locale); + if (symbols == null) { + symbols = new DecimalFormatSymbols(locale); + symbolsCache.put(locale, symbols); + } + return symbols; + } + + // ----------------------------------------------------- + // String + // ------ + protected static String replace(String text, String fromText, String toText) { + if (text == null || fromText == null || toText == null) { + return null; + } + StringBuilder sb = new StringBuilder(); + int pos = 0; + int pos2 = 0; + do { + pos = text.indexOf(fromText, pos2); + if (pos == 0) { + sb.append(toText); + pos2 = fromText.length(); + } else if (pos > 0) { + sb.append(text.substring(pos2, pos)); + sb.append(toText); + pos2 = pos + fromText.length(); + } else { + sb.append(text.substring(pos2)); + return sb.toString(); + } + } while (true); + } + + protected static final String[] EMPTY_STRINGS = new String[0]; + + protected static String[] split(final String str, final String delimiter) { + if (str == null || str.trim().length() == 0) { + return EMPTY_STRINGS; + } + final List list = new ArrayList(); + final StringTokenizer st = new StringTokenizer(str, delimiter); + while (st.hasMoreElements()) { + list.add(st.nextToken()); + } + return (String[]) list.toArray(new String[list.size()]); + } + + //========================================================================== + // ========= + // Assert Helper + // ============= + /** + * Assert that the object is not null. + * + * @param variableName Variable name. (NotNull) + * @param value Value. (NotNull) + * @exception IllegalArgumentException + */ + protected static void assertObjectNotNull(String variableName, Object value) { + if (variableName == null) { + String msg = "The value should not be null: variableName=" + + variableName + " value=" + value; + throw new IllegalArgumentException(msg); + } + if (value == null) { + String msg = "The value should not be null: variableName=" + + variableName; + throw new IllegalArgumentException(msg); + } + } +} Property changes on: bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/allcommon/util/SimpleTypeUtil.java ___________________________________________________________________ Name: svn:eol-style + native Modified: bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/bsbhv/BsBookmarkCategoryBhv.java =================================================================== --- bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/bsbhv/BsBookmarkCategoryBhv.java 2008-12-27 22:10:35 UTC (rev 1626) +++ bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/bsbhv/BsBookmarkCategoryBhv.java 2008-12-27 22:11:51 UTC (rev 1627) @@ -1,9 +1,8 @@ package jp.sf.pal.bookmark.db.bsbhv; import java.util.List; +import java.util.Map; -import jp.sf.pal.bookmark.db.allcommon.DaoReadable; -import jp.sf.pal.bookmark.db.allcommon.DaoWritable; import jp.sf.pal.bookmark.db.allcommon.Entity; import jp.sf.pal.bookmark.db.allcommon.bhv.load.LoadReferrerOption; import jp.sf.pal.bookmark.db.allcommon.bhv.setup.ConditionBeanSetupper; @@ -20,13 +19,12 @@ import jp.sf.pal.bookmark.db.cbean.BookmarkCategoryCB; import jp.sf.pal.bookmark.db.cbean.BookmarkLinkCB; import jp.sf.pal.bookmark.db.exbhv.BookmarkLinkBhv; -import jp.sf.pal.bookmark.db.exdao.BookmarkCategoryDao; import jp.sf.pal.bookmark.db.exentity.BookmarkCategory; import jp.sf.pal.bookmark.db.exentity.BookmarkLink; import jp.sf.pal.bookmark.db.exentity.UserInfo; /** - * The behavior of BOOKMARK_CATEGORY. + * The behavior of BOOKMARK_CATEGORY that the type is TABLE.
* *
  * [primary-key]
@@ -71,12 +69,6 @@
 
     //==========================================================================
     // =========
-    // Attribute
-    // =========
-    protected BookmarkCategoryDao _dao;
-
-    //==========================================================================
-    // =========
     // Table name
     // ==========
     /** @return The name on database of table. (NotNull) */
@@ -88,39 +80,18 @@
     // =========
     // DBMeta
     // ======
-    /** @return The meta data of the database. (NotNull) */
+    /** @return The instance of DBMeta. (NotNull) */
     public DBMeta getDBMeta() {
         return BookmarkCategoryDbm.getInstance();
     }
 
-    /** @return The meta data of the database as my table type. (NotNull) */
+    /** @return The instance of DBMeta as my table type. (NotNull) */
     public BookmarkCategoryDbm getMyDBMeta() {
         return BookmarkCategoryDbm.getInstance();
     }
 
     //==========================================================================
     // =========
-    // Dao Accessor
-    // ============
-    public BookmarkCategoryDao getMyDao() {
-        return _dao;
-    }
-
-    public void setMyDao(BookmarkCategoryDao dao) {
-        assertObjectNotNull("dao", dao);
-        _dao = dao;
-    }
-
-    public DaoReadable getDaoReadable() {
-        return getMyDao();
-    }
-
-    public DaoWritable getDaoWritable() {
-        return getMyDao();
-    }
-
-    //==========================================================================
-    // =========
     // New Instance
     // ============
     public Entity newEntity() {
@@ -150,7 +121,7 @@
      * @return The selected count.
      */
     public int selectCount(BookmarkCategoryCB cb) {
-        assertConditionBeanNotNull(cb);
+        assertCBNotNull(cb);
         return delegateSelectCount(cb);
     }
 
@@ -231,7 +202,7 @@
      * @return The result bean of selected list. (NotNull)
      */
     public ListResultBean selectList(BookmarkCategoryCB cb) {
-        assertConditionBeanNotNull(cb);
+        assertCBNotNull(cb);
         return new ResultBeanBuilder(getTableDbName())
                 .buildListResultBean(cb, delegateSelectList(cb));
     }
@@ -248,7 +219,7 @@
      */
     public PagingResultBean selectPage(
             final BookmarkCategoryCB cb) {
-        assertConditionBeanNotNull(cb);
+        assertCBNotNull(cb);
         final PagingInvoker invoker = new PagingInvoker(
                 getTableDbName());
         final PagingHandler handler = new PagingHandler() {
@@ -269,6 +240,32 @@
 
     //==========================================================================
     // =========
+    // Scalar Select
+    // =============
+    /**
+     * Select the scalar value derived by a function. 
Call a function + * method after this method called like as follows: + * + *
+     * bookmarkCategoryBhv.scalarSelect(Date.class).max(new ScalarQuery(BookmarkCategoryCB cb) {
+     *     cb.specify().columnXxxDatetime(); // the required specification of target column
+     *     cb.query().setXxxName_PrefixSearch("S"); // query as you like it
+     * });
+     * 
+ * + * @param The type of result. + * @param resultType The type of result. (NotNull) + * @return The scalar value derived by a function. (Nullable) + */ + public SLFunction scalarSelect( + Class resultType) { + BookmarkCategoryCB cb = newMyConditionBean(); + cb.xsetupForScalarSelect(); + return new SLFunction(cb, resultType); + } + + //========================================================================== + // ========= // Various Select // ============== /** @@ -278,7 +275,7 @@ * @param valueLabelSetupper The setupper of value-label. (NotNull) * @return The list of value-label. (NotNull) */ - public List> selectValueLabelList( + public List> selectValueLabelList( BookmarkCategoryCB cb, ValueLabelSetupper valueLabelSetupper) { return createValueLabelList(selectList(cb), valueLabelSetupper); @@ -389,8 +386,8 @@ //========================================================================== // ========= - // Pullout Foreign - // =============== + // Pull out Foreign + // ================ /** * Pull out the list of foreign table 'UserInfo'. * @@ -730,11 +727,11 @@ public int queryUpdate(BookmarkCategory bookmarkCategory, BookmarkCategoryCB cb) { assertObjectNotNull("bookmarkCategory", bookmarkCategory); - assertConditionBeanNotNull(cb); + assertCBNotNull(cb); setupCommonColumnOfUpdateIfNeeds(bookmarkCategory); filterEntityOfUpdate(bookmarkCategory); assertEntityOfUpdate(bookmarkCategory); - return getMyDao().updateByQuery(cb, bookmarkCategory); + return invoke(createQueryUpdateEntityCBCommand(bookmarkCategory, cb)); } /** @@ -744,8 +741,8 @@ * @return The deleted count. */ public int queryDelete(BookmarkCategoryCB cb) { - assertConditionBeanNotNull(cb); - return getMyDao().deleteByQuery(cb); + assertCBNotNull(cb); + return invoke(createQueryDeleteCBCommand(cb)); } //========================================================================== @@ -757,19 +754,27 @@ // ========= // Delegate Method // =============== + // [Behavior Command] // ----------------------------------------------------- // Select // ------ protected int delegateSelectCount(BookmarkCategoryCB cb) { - assertConditionBeanNotNull(cb); - return getMyDao().selectCount(cb); + return invoke(createSelectCountCBCommand(cb)); } + protected int doCallReadCount(ConditionBean cb) { + return delegateSelectCount((BookmarkCategoryCB) cb); + } + protected List delegateSelectList(BookmarkCategoryCB cb) { - assertConditionBeanNotNull(cb); - return getMyDao().selectList(cb); + return invoke(createSelectListCBCommand(cb, BookmarkCategory.class)); } + @SuppressWarnings("unchecked") + protected List doCallReadList(ConditionBean cb) { + return (List) delegateSelectList((BookmarkCategoryCB) cb); + } + // ----------------------------------------------------- // Update // ------ @@ -777,62 +782,97 @@ if (!processBeforeInsert(e)) { return 1; } - return getMyDao().insert(e); + return invoke(createInsertEntityCommand(e)); } + protected int doCallCreate(Entity entity) { + return delegateInsert(downcast(entity)); + } + protected int delegateUpdate(BookmarkCategory e) { if (!processBeforeUpdate(e)) { return 1; } - return getMyDao().updateModifiedOnly(e); + return invoke(createUpdateEntityCommand(e)); } + protected int doCallModify(Entity entity) { + return delegateUpdate(downcast(entity)); + } + protected int delegateUpdateNonstrict(BookmarkCategory e) { if (!processBeforeUpdate(e)) { return 1; } - return getMyDao().updateNonstrictModifiedOnly(e); + return invoke(createUpdateNonstrictEntityCommand(e)); } protected int delegateDelete(BookmarkCategory e) { if (!processBeforeDelete(e)) { return 1; } - return getMyDao().delete(e); + return invoke(createDeleteEntityCommand(e)); } + protected int doCallRemove(Entity entity) { + return delegateDelete(downcast(entity)); + } + protected int delegateDeleteNonstrict(BookmarkCategory e) { if (!processBeforeDelete(e)) { return 1; } - return getMyDao().deleteNonstrict(e); + return invoke(createDeleteNonstrictEntityCommand(e)); } protected int[] delegateInsertList(List ls) { - assertObjectNotNull("bookmarkCategoryList", ls); - return getMyDao().insertList(helpFilterBeforeInsertInternally(ls)); + if (ls.isEmpty()) { + return new int[] {}; + } + return invoke(createBatchInsertEntityCommand(helpFilterBeforeInsertInternally(ls))); } + @SuppressWarnings("unchecked") + protected int[] doCreateList(List ls) { + return delegateInsertList((List) ls); + } + protected int[] delegateUpdateList(List ls) { - assertObjectNotNull("bookmarkCategoryList", ls); - return getMyDao().updateList(helpFilterBeforeUpdateInternally(ls)); + if (ls.isEmpty()) { + return new int[] {}; + } + return invoke(createBatchUpdateEntityCommand(helpFilterBeforeUpdateInternally(ls))); } + @SuppressWarnings("unchecked") + protected int[] doModifyList(List ls) { + return delegateUpdateList((List) ls); + } + protected int[] delegateUpdateListNonstrict(List ls) { - assertObjectNotNull("bookmarkCategoryList", ls); - return getMyDao().updateListNonstrict( - helpFilterBeforeUpdateInternally(ls)); + if (ls.isEmpty()) { + return new int[] {}; + } + return invoke(createBatchUpdateNonstrictEntityCommand(helpFilterBeforeUpdateInternally(ls))); } protected int[] delegateDeleteList(List ls) { - assertObjectNotNull("bookmarkCategoryList", ls); - return getMyDao().deleteList(helpFilterBeforeDeleteInternally(ls)); + if (ls.isEmpty()) { + return new int[] {}; + } + return invoke(createBatchDeleteEntityCommand(helpFilterBeforeDeleteInternally(ls))); } + @SuppressWarnings("unchecked") + protected int[] doRemoveList(List ls) { + return delegateDeleteList((List) ls); + } + protected int[] delegateDeleteListNonstrict(List ls) { - assertObjectNotNull("bookmarkCategoryList", ls); - return getMyDao().deleteListNonstrict( - helpFilterBeforeDeleteInternally(ls)); + if (ls.isEmpty()) { + return new int[] {}; + } + return invoke(createBatchDeleteNonstrictEntityCommand(helpFilterBeforeDeleteInternally(ls))); } //========================================================================== Modified: bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/bsbhv/BsBookmarkLinkBhv.java =================================================================== --- bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/bsbhv/BsBookmarkLinkBhv.java 2008-12-27 22:10:35 UTC (rev 1626) +++ bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/bsbhv/BsBookmarkLinkBhv.java 2008-12-27 22:11:51 UTC (rev 1627) @@ -1,9 +1,8 @@ package jp.sf.pal.bookmark.db.bsbhv; import java.util.List; +import java.util.Map; -import jp.sf.pal.bookmark.db.allcommon.DaoReadable; -import jp.sf.pal.bookmark.db.allcommon.DaoWritable; import jp.sf.pal.bookmark.db.allcommon.Entity; import jp.sf.pal.bookmark.db.allcommon.bhv.setup.ValueLabelSetupper; import jp.sf.pal.bookmark.db.allcommon.cbean.ConditionBean; @@ -16,13 +15,12 @@ import jp.sf.pal.bookmark.db.allcommon.dbmeta.DBMeta; import jp.sf.pal.bookmark.db.bsentity.dbmeta.BookmarkLinkDbm; import jp.sf.pal.bookmark.db.cbean.BookmarkLinkCB; -import jp.sf.pal.bookmark.db.exdao.BookmarkLinkDao; import jp.sf.pal.bookmark.db.exentity.BookmarkCategory; import jp.sf.pal.bookmark.db.exentity.BookmarkLink; import jp.sf.pal.bookmark.db.exentity.UserInfo; /** - * The behavior of BOOKMARK_LINK. + * The behavior of BOOKMARK_LINK that the type is TABLE.
* *
  * [primary-key]
@@ -67,12 +65,6 @@
 
     //==========================================================================
     // =========
-    // Attribute
-    // =========
-    protected BookmarkLinkDao _dao;
-
-    //==========================================================================
-    // =========
     // Table name
     // ==========
     /** @return The name on database of table. (NotNull) */
@@ -84,39 +76,18 @@
     // =========
     // DBMeta
     // ======
-    /** @return The meta data of the database. (NotNull) */
+    /** @return The instance of DBMeta. (NotNull) */
     public DBMeta getDBMeta() {
         return BookmarkLinkDbm.getInstance();
     }
 
-    /** @return The meta data of the database as my table type. (NotNull) */
+    /** @return The instance of DBMeta as my table type. (NotNull) */
     public BookmarkLinkDbm getMyDBMeta() {
         return BookmarkLinkDbm.getInstance();
     }
 
     //==========================================================================
     // =========
-    // Dao Accessor
-    // ============
-    public BookmarkLinkDao getMyDao() {
-        return _dao;
-    }
-
-    public void setMyDao(BookmarkLinkDao dao) {
-        assertObjectNotNull("dao", dao);
-        _dao = dao;
-    }
-
-    public DaoReadable getDaoReadable() {
-        return getMyDao();
-    }
-
-    public DaoWritable getDaoWritable() {
-        return getMyDao();
-    }
-
-    //==========================================================================
-    // =========
     // New Instance
     // ============
     public Entity newEntity() {
@@ -146,7 +117,7 @@
      * @return The selected count.
      */
     public int selectCount(BookmarkLinkCB cb) {
-        assertConditionBeanNotNull(cb);
+        assertCBNotNull(cb);
         return delegateSelectCount(cb);
     }
 
@@ -226,7 +197,7 @@
      * @return The result bean of selected list. (NotNull)
      */
     public ListResultBean selectList(BookmarkLinkCB cb) {
-        assertConditionBeanNotNull(cb);
+        assertCBNotNull(cb);
         return new ResultBeanBuilder(getTableDbName())
                 .buildListResultBean(cb, delegateSelectList(cb));
     }
@@ -242,7 +213,7 @@
      * @return The result bean of selected page. (NotNull)
      */
     public PagingResultBean selectPage(final BookmarkLinkCB cb) {
-        assertConditionBeanNotNull(cb);
+        assertCBNotNull(cb);
         final PagingInvoker invoker = new PagingInvoker(
                 getTableDbName());
         final PagingHandler handler = new PagingHandler() {
@@ -263,6 +234,32 @@
 
     //==========================================================================
     // =========
+    // Scalar Select
+    // =============
+    /**
+     * Select the scalar value derived by a function. 
Call a function + * method after this method called like as follows: + * + *
+     * bookmarkLinkBhv.scalarSelect(Date.class).max(new ScalarQuery(BookmarkLinkCB cb) {
+     *     cb.specify().columnXxxDatetime(); // the required specification of target column
+     *     cb.query().setXxxName_PrefixSearch("S"); // query as you like it
+     * });
+     * 
+ * + * @param The type of result. + * @param resultType The type of result. (NotNull) + * @return The scalar value derived by a function. (Nullable) + */ + public SLFunction scalarSelect( + Class resultType) { + BookmarkLinkCB cb = newMyConditionBean(); + cb.xsetupForScalarSelect(); + return new SLFunction(cb, resultType); + } + + //========================================================================== + // ========= // Various Select // ============== /** @@ -272,8 +269,7 @@ * @param valueLabelSetupper The setupper of value-label. (NotNull) * @return The list of value-label. (NotNull) */ - public List> selectValueLabelList( - BookmarkLinkCB cb, + public List> selectValueLabelList(BookmarkLinkCB cb, ValueLabelSetupper valueLabelSetupper) { return createValueLabelList(selectList(cb), valueLabelSetupper); } @@ -285,8 +281,8 @@ //========================================================================== // ========= - // Pullout Foreign - // =============== + // Pull out Foreign + // ================ /** * Pull out the list of foreign table 'BookmarkCategory'. * @@ -637,11 +633,11 @@ */ public int queryUpdate(BookmarkLink bookmarkLink, BookmarkLinkCB cb) { assertObjectNotNull("bookmarkLink", bookmarkLink); - assertConditionBeanNotNull(cb); + assertCBNotNull(cb); setupCommonColumnOfUpdateIfNeeds(bookmarkLink); filterEntityOfUpdate(bookmarkLink); assertEntityOfUpdate(bookmarkLink); - return getMyDao().updateByQuery(cb, bookmarkLink); + return invoke(createQueryUpdateEntityCBCommand(bookmarkLink, cb)); } /** @@ -651,8 +647,8 @@ * @return The deleted count. */ public int queryDelete(BookmarkLinkCB cb) { - assertConditionBeanNotNull(cb); - return getMyDao().deleteByQuery(cb); + assertCBNotNull(cb); + return invoke(createQueryDeleteCBCommand(cb)); } //========================================================================== @@ -664,19 +660,27 @@ // ========= // Delegate Method // =============== + // [Behavior Command] // ----------------------------------------------------- // Select // ------ protected int delegateSelectCount(BookmarkLinkCB cb) { - assertConditionBeanNotNull(cb); - return getMyDao().selectCount(cb); + return invoke(createSelectCountCBCommand(cb)); } + protected int doCallReadCount(ConditionBean cb) { + return delegateSelectCount((BookmarkLinkCB) cb); + } + protected List delegateSelectList(BookmarkLinkCB cb) { - assertConditionBeanNotNull(cb); - return getMyDao().selectList(cb); + return invoke(createSelectListCBCommand(cb, BookmarkLink.class)); } + @SuppressWarnings("unchecked") + protected List doCallReadList(ConditionBean cb) { + return (List) delegateSelectList((BookmarkLinkCB) cb); + } + // ----------------------------------------------------- // Update // ------ @@ -684,62 +688,97 @@ if (!processBeforeInsert(e)) { return 1; } - return getMyDao().insert(e); + return invoke(createInsertEntityCommand(e)); } + protected int doCallCreate(Entity entity) { + return delegateInsert(downcast(entity)); + } + protected int delegateUpdate(BookmarkLink e) { if (!processBeforeUpdate(e)) { return 1; } - return getMyDao().updateModifiedOnly(e); + return invoke(createUpdateEntityCommand(e)); } + protected int doCallModify(Entity entity) { + return delegateUpdate(downcast(entity)); + } + protected int delegateUpdateNonstrict(BookmarkLink e) { if (!processBeforeUpdate(e)) { return 1; } - return getMyDao().updateNonstrictModifiedOnly(e); + return invoke(createUpdateNonstrictEntityCommand(e)); } protected int delegateDelete(BookmarkLink e) { if (!processBeforeDelete(e)) { return 1; } - return getMyDao().delete(e); + return invoke(createDeleteEntityCommand(e)); } + protected int doCallRemove(Entity entity) { + return delegateDelete(downcast(entity)); + } + protected int delegateDeleteNonstrict(BookmarkLink e) { if (!processBeforeDelete(e)) { return 1; } - return getMyDao().deleteNonstrict(e); + return invoke(createDeleteNonstrictEntityCommand(e)); } protected int[] delegateInsertList(List ls) { - assertObjectNotNull("bookmarkLinkList", ls); - return getMyDao().insertList(helpFilterBeforeInsertInternally(ls)); + if (ls.isEmpty()) { + return new int[] {}; + } + return invoke(createBatchInsertEntityCommand(helpFilterBeforeInsertInternally(ls))); } + @SuppressWarnings("unchecked") + protected int[] doCreateList(List ls) { + return delegateInsertList((List) ls); + } + protected int[] delegateUpdateList(List ls) { - assertObjectNotNull("bookmarkLinkList", ls); - return getMyDao().updateList(helpFilterBeforeUpdateInternally(ls)); + if (ls.isEmpty()) { + return new int[] {}; + } + return invoke(createBatchUpdateEntityCommand(helpFilterBeforeUpdateInternally(ls))); } + @SuppressWarnings("unchecked") + protected int[] doModifyList(List ls) { + return delegateUpdateList((List) ls); + } + protected int[] delegateUpdateListNonstrict(List ls) { - assertObjectNotNull("bookmarkLinkList", ls); - return getMyDao().updateListNonstrict( - helpFilterBeforeUpdateInternally(ls)); + if (ls.isEmpty()) { + return new int[] {}; + } + return invoke(createBatchUpdateNonstrictEntityCommand(helpFilterBeforeUpdateInternally(ls))); } protected int[] delegateDeleteList(List ls) { - assertObjectNotNull("bookmarkLinkList", ls); - return getMyDao().deleteList(helpFilterBeforeDeleteInternally(ls)); + if (ls.isEmpty()) { + return new int[] {}; + } + return invoke(createBatchDeleteEntityCommand(helpFilterBeforeDeleteInternally(ls))); } + @SuppressWarnings("unchecked") + protected int[] doRemoveList(List ls) { + return delegateDeleteList((List) ls); + } + protected int[] delegateDeleteListNonstrict(List ls) { - assertObjectNotNull("bookmarkLinkList", ls); - return getMyDao().deleteListNonstrict( - helpFilterBeforeDeleteInternally(ls)); + if (ls.isEmpty()) { + return new int[] {}; + } + return invoke(createBatchDeleteNonstrictEntityCommand(helpFilterBeforeDeleteInternally(ls))); } //========================================================================== Modified: bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/bsbhv/BsGroupInfoBhv.java =================================================================== --- bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/bsbhv/BsGroupInfoBhv.java 2008-12-27 22:10:35 UTC (rev 1626) +++ bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/bsbhv/BsGroupInfoBhv.java 2008-12-27 22:11:51 UTC (rev 1627) @@ -1,9 +1,8 @@ package jp.sf.pal.bookmark.db.bsbhv; import java.util.List; +import java.util.Map; -import jp.sf.pal.bookmark.db.allcommon.DaoReadable; -import jp.sf.pal.bookmark.db.allcommon.DaoWritable; import jp.sf.pal.bookmark.db.allcommon.Entity; import jp.sf.pal.bookmark.db.allcommon.bhv.load.LoadReferrerOption; import jp.sf.pal.bookmark.db.allcommon.bhv.setup.ConditionBeanSetupper; @@ -22,13 +21,12 @@ import jp.sf.pal.bookmark.db.cbean.UserInfoCB; import jp.sf.pal.bookmark.db.exbhv.GroupMappingBhv; import jp.sf.pal.bookmark.db.exbhv.UserInfoBhv; -import jp.sf.pal.bookmark.db.exdao.GroupInfoDao; import jp.sf.pal.bookmark.db.exentity.GroupInfo; import jp.sf.pal.bookmark.db.exentity.GroupMapping; import jp.sf.pal.bookmark.db.exentity.UserInfo; /** - * The behavior of GROUP_INFO. + * The behavior of GROUP_INFO that the type is TABLE.
* *
  * [primary-key]
@@ -73,12 +71,6 @@
 
     //==========================================================================
     // =========
-    // Attribute
-    // =========
-    protected GroupInfoDao _dao;
-
-    //==========================================================================
-    // =========
     // Table name
     // ==========
     /** @return The name on database of table. (NotNull) */
@@ -90,39 +82,18 @@
     // =========
     // DBMeta
     // ======
-    /** @return The meta data of the database. (NotNull) */
+    /** @return The instance of DBMeta. (NotNull) */
     public DBMeta getDBMeta() {
         return GroupInfoDbm.getInstance();
     }
 
-    /** @return The meta data of the database as my table type. (NotNull) */
+    /** @return The instance of DBMeta as my table type. (NotNull) */
     public GroupInfoDbm getMyDBMeta() {
         return GroupInfoDbm.getInstance();
     }
 
     //==========================================================================
     // =========
-    // Dao Accessor
-    // ============
-    public GroupInfoDao getMyDao() {
-        return _dao;
-    }
-
-    public void setMyDao(GroupInfoDao dao) {
-        assertObjectNotNull("dao", dao);
-        _dao = dao;
-    }
-
-    public DaoReadable getDaoReadable() {
-        return getMyDao();
-    }
-
-    public DaoWritable getDaoWritable() {
-        return getMyDao();
-    }
-
-    //==========================================================================
-    // =========
     // New Instance
     // ============
     public Entity newEntity() {
@@ -152,7 +123,7 @@
      * @return The selected count.
      */
     public int selectCount(GroupInfoCB cb) {
-        assertConditionBeanNotNull(cb);
+        assertCBNotNull(cb);
         return delegateSelectCount(cb);
     }
 
@@ -229,7 +200,7 @@
      * @return The result bean of selected list. (NotNull)
      */
     public ListResultBean selectList(GroupInfoCB cb) {
-        assertConditionBeanNotNull(cb);
+        assertCBNotNull(cb);
         return new ResultBeanBuilder(getTableDbName())
                 .buildListResultBean(cb, delegateSelectList(cb));
     }
@@ -245,7 +216,7 @@
      * @return The result bean of selected page. (NotNull)
      */
     public PagingResultBean selectPage(final GroupInfoCB cb) {
-        assertConditionBeanNotNull(cb);
+        assertCBNotNull(cb);
         final PagingInvoker invoker = new PagingInvoker(
                 getTableDbName());
         final PagingHandler handler = new PagingHandler() {
@@ -266,6 +237,32 @@
 
     //==========================================================================
     // =========
+    // Scalar Select
+    // =============
+    /**
+     * Select the scalar value derived by a function. 
Call a function + * method after this method called like as follows: + * + *
+     * groupInfoBhv.scalarSelect(Date.class).max(new ScalarQuery(GroupInfoCB cb) {
+     *     cb.specify().columnXxxDatetime(); // the required specification of target column
+     *     cb.query().setXxxName_PrefixSearch("S"); // query as you like it
+     * });
+     * 
+ * + * @param The type of result. + * @param resultType The type of result. (NotNull) + * @return The scalar value derived by a function. (Nullable) + */ + public SLFunction scalarSelect( + Class resultType) { + GroupInfoCB cb = newMyConditionBean(); + cb.xsetupForScalarSelect(); + return new SLFunction(cb, resultType); + } + + //========================================================================== + // ========= // Various Select // ============== /** @@ -275,8 +272,8 @@ * @param valueLabelSetupper The setupper of value-label. (NotNull) * @return The list of value-label. (NotNull) */ - public List> selectValueLabelList( - GroupInfoCB cb, ValueLabelSetupper valueLabelSetupper) { + public List> selectValueLabelList(GroupInfoCB cb, + ValueLabelSetupper valueLabelSetupper) { return createValueLabelList(selectList(cb), valueLabelSetupper); } @@ -467,8 +464,8 @@ //========================================================================== // ========= - // Pullout Foreign - // =============== + // Pull out Foreign + // ================ //========================================================================== // ========= @@ -766,11 +763,11 @@ */ public int queryUpdate(GroupInfo groupInfo, GroupInfoCB cb) { assertObjectNotNull("groupInfo", groupInfo); - assertConditionBeanNotNull(cb); + assertCBNotNull(cb); setupCommonColumnOfUpdateIfNeeds(groupInfo); filterEntityOfUpdate(groupInfo); assertEntityOfUpdate(groupInfo); - return getMyDao().updateByQuery(cb, groupInfo); + return invoke(createQueryUpdateEntityCBCommand(groupInfo, cb)); } /** @@ -780,8 +777,8 @@ * @return The deleted count. */ public int queryDelete(GroupInfoCB cb) { - assertConditionBeanNotNull(cb); - return getMyDao().deleteByQuery(cb); + assertCBNotNull(cb); + return invoke(createQueryDeleteCBCommand(cb)); } //========================================================================== @@ -793,19 +790,27 @@ // ========= // Delegate Method // =============== + // [Behavior Command] // ----------------------------------------------------- // Select // ------ protected int delegateSelectCount(GroupInfoCB cb) { - assertConditionBeanNotNull(cb); - return getMyDao().selectCount(cb); + return invoke(createSelectCountCBCommand(cb)); } + protected int doCallReadCount(ConditionBean cb) { + return delegateSelectCount((GroupInfoCB) cb); + } + protected List delegateSelectList(GroupInfoCB cb) { - assertConditionBeanNotNull(cb); - return getMyDao().selectList(cb); + return invoke(createSelectListCBCommand(cb, GroupInfo.class)); } + @SuppressWarnings("unchecked") + protected List doCallReadList(ConditionBean cb) { + return (List) delegateSelectList((GroupInfoCB) cb); + } + // ----------------------------------------------------- // Update // ------ @@ -813,62 +818,97 @@ if (!processBeforeInsert(e)) { return 1; } - return getMyDao().insert(e); + return invoke(createInsertEntityCommand(e)); } + protected int doCallCreate(Entity entity) { + return delegateInsert(downcast(entity)); + } + protected int delegateUpdate(GroupInfo e) { if (!processBeforeUpdate(e)) { return 1; } - return getMyDao().updateModifiedOnly(e); + return invoke(createUpdateEntityCommand(e)); } + protected int doCallModify(Entity entity) { + return delegateUpdate(downcast(entity)); + } + protected int delegateUpdateNonstrict(GroupInfo e) { if (!processBeforeUpdate(e)) { return 1; } - return getMyDao().updateNonstrictModifiedOnly(e); + return invoke(createUpdateNonstrictEntityCommand(e)); } protected int delegateDelete(GroupInfo e) { if (!processBeforeDelete(e)) { return 1; } - return getMyDao().delete(e); + return invoke(createDeleteEntityCommand(e)); } + protected int doCallRemove(Entity entity) { + return delegateDelete(downcast(entity)); + } + protected int delegateDeleteNonstrict(GroupInfo e) { if (!processBeforeDelete(e)) { return 1; } - return getMyDao().deleteNonstrict(e); + return invoke(createDeleteNonstrictEntityCommand(e)); } protected int[] delegateInsertList(List ls) { - assertObjectNotNull("groupInfoList", ls); - return getMyDao().insertList(helpFilterBeforeInsertInternally(ls)); + if (ls.isEmpty()) { + return new int[] {}; + } + return invoke(createBatchInsertEntityCommand(helpFilterBeforeInsertInternally(ls))); } + @SuppressWarnings("unchecked") + protected int[] doCreateList(List ls) { + return delegateInsertList((List) ls); + } + protected int[] delegateUpdateList(List ls) { - assertObjectNotNull("groupInfoList", ls); - return getMyDao().updateList(helpFilterBeforeUpdateInternally(ls)); + if (ls.isEmpty()) { + return new int[] {}; + } + return invoke(createBatchUpdateEntityCommand(helpFilterBeforeUpdateInternally(ls))); } + @SuppressWarnings("unchecked") + protected int[] doModifyList(List ls) { + return delegateUpdateList((List) ls); + } + protected int[] delegateUpdateListNonstrict(List ls) { - assertObjectNotNull("groupInfoList", ls); - return getMyDao().updateListNonstrict( - helpFilterBeforeUpdateInternally(ls)); + if (ls.isEmpty()) { + return new int[] {}; + } + return invoke(createBatchUpdateNonstrictEntityCommand(helpFilterBeforeUpdateInternally(ls))); } protected int[] delegateDeleteList(List ls) { - assertObjectNotNull("groupInfoList", ls); - return getMyDao().deleteList(helpFilterBeforeDeleteInternally(ls)); + if (ls.isEmpty()) { + return new int[] {}; + } + return invoke(createBatchDeleteEntityCommand(helpFilterBeforeDeleteInternally(ls))); } + @SuppressWarnings("unchecked") + protected int[] doRemoveList(List ls) { + return delegateDeleteList((List) ls); + } + protected int[] delegateDeleteListNonstrict(List ls) { - assertObjectNotNull("groupInfoList", ls); - return getMyDao().deleteListNonstrict( - helpFilterBeforeDeleteInternally(ls)); + if (ls.isEmpty()) { + return new int[] {}; + } + return invoke(createBatchDeleteNonstrictEntityCommand(helpFilterBeforeDeleteInternally(ls))); } //========================================================================== Modified: bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/bsbhv/BsGroupMappingBhv.java =================================================================== --- bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/bsbhv/BsGroupMappingBhv.java 2008-12-27 22:10:35 UTC (rev 1626) +++ bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/bsbhv/BsGroupMappingBhv.java 2008-12-27 22:11:51 UTC (rev 1627) @@ -1,9 +1,8 @@ package jp.sf.pal.bookmark.db.bsbhv; import java.util.List; +import java.util.Map; -import jp.sf.pal.bookmark.db.allcommon.DaoReadable; -import jp.sf.pal.bookmark.db.allcommon.DaoWritable; import jp.sf.pal.bookmark.db.allcommon.Entity; import jp.sf.pal.bookmark.db.allcommon.bhv.setup.ValueLabelSetupper; import jp.sf.pal.bookmark.db.allcommon.cbean.ConditionBean; @@ -16,13 +15,12 @@ import jp.sf.pal.bookmark.db.allcommon.dbmeta.DBMeta; import jp.sf.pal.bookmark.db.bsentity.dbmeta.GroupMappingDbm; import jp.sf.pal.bookmark.db.cbean.GroupMappingCB; -import jp.sf.pal.bookmark.db.exdao.GroupMappingDao; import jp.sf.pal.bookmark.db.exentity.GroupInfo; import jp.sf.pal.bookmark.db.exentity.GroupMapping; import jp.sf.pal.bookmark.db.exentity.UserInfo; /** - * The behavior of GROUP_MAPPING. + * The behavior of GROUP_MAPPING that the type is TABLE.
* *
  * [primary-key]
@@ -67,12 +65,6 @@
 
     //==========================================================================
     // =========
-    // Attribute
-    // =========
-    protected GroupMappingDao _dao;
-
-    //==========================================================================
-    // =========
     // Table name
     // ==========
     /** @return The name on database of table. (NotNull) */
@@ -84,39 +76,18 @@
     // =========
     // DBMeta
     // ======
-    /** @return The meta data of the database. (NotNull) */
+    /** @return The instance of DBMeta. (NotNull) */
     public DBMeta getDBMeta() {
         return GroupMappingDbm.getInstance();
     }
 
-    /** @return The meta data of the database as my table type. (NotNull) */
+    /** @return The instance of DBMeta as my table type. (NotNull) */
     public GroupMappingDbm getMyDBMeta() {
         return GroupMappingDbm.getInstance();
     }
 
     //==========================================================================
     // =========
-    // Dao Accessor
-    // ============
-    public GroupMappingDao getMyDao() {
-        return _dao;
-    }
-
-    public void setMyDao(GroupMappingDao dao) {
-        assertObjectNotNull("dao", dao);
-        _dao = dao;
-    }
-
-    public DaoReadable getDaoReadable() {
-        return getMyDao();
-    }
-
-    public DaoWritable getDaoWritable() {
-        return getMyDao();
-    }
-
-    //==========================================================================
-    // =========
     // New Instance
     // ============
     public Entity newEntity() {
@@ -146,7 +117,7 @@
      * @return The selected count.
      */
     public int selectCount(GroupMappingCB cb) {
-        assertConditionBeanNotNull(cb);
+        assertCBNotNull(cb);
         return delegateSelectCount(cb);
     }
 
@@ -226,7 +197,7 @@
      * @return The result bean of selected list. (NotNull)
      */
     public ListResultBean selectList(GroupMappingCB cb) {
-        assertConditionBeanNotNull(cb);
+        assertCBNotNull(cb);
         return new ResultBeanBuilder(getTableDbName())
                 .buildListResultBean(cb, delegateSelectList(cb));
     }
@@ -242,7 +213,7 @@
      * @return The result bean of selected page. (NotNull)
      */
     public PagingResultBean selectPage(final GroupMappingCB cb) {
-        assertConditionBeanNotNull(cb);
+        assertCBNotNull(cb);
         final PagingInvoker invoker = new PagingInvoker(
                 getTableDbName());
         final PagingHandler handler = new PagingHandler() {
@@ -263,6 +234,32 @@
 
     //==========================================================================
     // =========
+    // Scalar Select
+    // =============
+    /**
+     * Select the scalar value derived by a function. 
Call a function + * method after this method called like as follows: + * + *
+     * groupMappingBhv.scalarSelect(Date.class).max(new ScalarQuery(GroupMappingCB cb) {
+     *     cb.specify().columnXxxDatetime(); // the required specification of target column
+     *     cb.query().setXxxName_PrefixSearch("S"); // query as you like it
+     * });
+     * 
+ * + * @param The type of result. + * @param resultType The type of result. (NotNull) + * @return The scalar value derived by a function. (Nullable) + */ + public SLFunction scalarSelect( + Class resultType) { + GroupMappingCB cb = newMyConditionBean(); + cb.xsetupForScalarSelect(); + return new SLFunction(cb, resultType); + } + + //========================================================================== + // ========= // Various Select // ============== /** @@ -272,8 +269,7 @@ * @param valueLabelSetupper The setupper of value-label. (NotNull) * @return The list of value-label. (NotNull) */ - public List> selectValueLabelList( - GroupMappingCB cb, + public List> selectValueLabelList(GroupMappingCB cb, ValueLabelSetupper valueLabelSetupper) { return createValueLabelList(selectList(cb), valueLabelSetupper); } @@ -285,8 +281,8 @@ //========================================================================== // ========= - // Pullout Foreign - // =============== + // Pull out Foreign + // ================ /** * Pull out the list of foreign table 'GroupInfo'. * @@ -499,11 +495,11 @@ */ public int queryUpdate(GroupMapping groupMapping, GroupMappingCB cb) { assertObjectNotNull("groupMapping", groupMapping); - assertConditionBeanNotNull(cb); + assertCBNotNull(cb); setupCommonColumnOfUpdateIfNeeds(groupMapping); filterEntityOfUpdate(groupMapping); assertEntityOfUpdate(groupMapping); - return getMyDao().updateByQuery(cb, groupMapping); + return invoke(createQueryUpdateEntityCBCommand(groupMapping, cb)); } /** @@ -513,8 +509,8 @@ * @return The deleted count. */ public int queryDelete(GroupMappingCB cb) { - assertConditionBeanNotNull(cb); - return getMyDao().deleteByQuery(cb); + assertCBNotNull(cb); + return invoke(createQueryDeleteCBCommand(cb)); } //========================================================================== @@ -526,19 +522,27 @@ // ========= // Delegate Method // =============== + // [Behavior Command] // ----------------------------------------------------- // Select // ------ protected int delegateSelectCount(GroupMappingCB cb) { - assertConditionBeanNotNull(cb); - return getMyDao().selectCount(cb); + return invoke(createSelectCountCBCommand(cb)); } + protected int doCallReadCount(ConditionBean cb) { + return delegateSelectCount((GroupMappingCB) cb); + } + protected List delegateSelectList(GroupMappingCB cb) { - assertConditionBeanNotNull(cb); - return getMyDao().selectList(cb); + return invoke(createSelectListCBCommand(cb, GroupMapping.class)); } + @SuppressWarnings("unchecked") + protected List doCallReadList(ConditionBean cb) { + return (List) delegateSelectList((GroupMappingCB) cb); + } + // ----------------------------------------------------- // Update // ------ @@ -546,38 +550,71 @@ if (!processBeforeInsert(e)) { return 1; } - return getMyDao().insert(e); + return invoke(createInsertEntityCommand(e)); } + protected int doCallCreate(Entity entity) { + return delegateInsert(downcast(entity)); + } + protected int delegateUpdate(GroupMapping e) { if (!processBeforeUpdate(e)) { return 1; } - return getMyDao().updateModifiedOnly(e); + return invoke(createUpdateEntityCommand(e)); } + protected int doCallModify(Entity entity) { + return delegateUpdate(downcast(entity)); + } + protected int delegateDelete(GroupMapping e) { if (!processBeforeDelete(e)) { return 1; } - return getMyDao().delete(e); + return invoke(createDeleteEntityCommand(e)); } + protected int doCallRemove(Entity entity) { + return delegateDelete(downcast(entity)); + } + protected int[] delegateInsertList(List ls) { - assertObjectNotNull("groupMappingList", ls); - return getMyDao().insertList(helpFilterBeforeInsertInternally(ls)); + if (ls.isEmpty()) { + return new int[] {}; + } + return invoke(createBatchInsertEntityCommand(helpFilterBeforeInsertInternally(ls))); } + @SuppressWarnings("unchecked") + protected int[] doCreateList(List ls) { + return delegateInsertList((List) ls); + } + protected int[] delegateUpdateList(List ls) { - assertObjectNotNull("groupMappingList", ls); - return getMyDao().updateList(helpFilterBeforeUpdateInternally(ls)); + if (ls.isEmpty()) { + return new int[] {}; + } + return invoke(createBatchUpdateEntityCommand(helpFilterBeforeUpdateInternally(ls))); } + @SuppressWarnings("unchecked") + protected int[] doModifyList(List ls) { + return delegateUpdateList((List) ls); + } + protected int[] delegateDeleteList(List ls) { - assertObjectNotNull("groupMappingList", ls); - return getMyDao().deleteList(helpFilterBeforeDeleteInternally(ls)); + if (ls.isEmpty()) { + return new int[] {}; + } + return invoke(createBatchDeleteEntityCommand(helpFilterBeforeDeleteInternally(ls))); } + @SuppressWarnings("unchecked") + protected int[] doRemoveList(List ls) { + return delegateDeleteList((List) ls); + } + //========================================================================== // ========= // Optimistic Lock Info Modified: bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/bsbhv/BsRoleInfoBhv.java =================================================================== --- bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/bsbhv/BsRoleInfoBhv.java 2008-12-27 22:10:35 UTC (rev 1626) +++ bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/bsbhv/BsRoleInfoBhv.java 2008-12-27 22:11:51 UTC (rev 1627) @@ -1,9 +1,8 @@ package jp.sf.pal.bookmark.db.bsbhv; import java.util.List; +import java.util.Map; -import jp.sf.pal.bookmark.db.allcommon.DaoReadable; -import jp.sf.pal.bookmark.db.allcommon.DaoWritable; import jp.sf.pal.bookmark.db.allcommon.Entity; import jp.sf.pal.bookmark.db.allcommon.bhv.load.LoadReferrerOption; import jp.sf.pal.bookmark.db.allcommon.bhv.setup.ConditionBeanSetupper; @@ -22,13 +21,12 @@ import jp.sf.pal.bookmark.db.cbean.UserInfoCB; import jp.sf.pal.bookmark.db.exbhv.RoleMappingBhv; import jp.sf.pal.bookmark.db.exbhv.UserInfoBhv; -import jp.sf.pal.bookmark.db.exdao.RoleInfoDao; import jp.sf.pal.bookmark.db.exentity.RoleInfo; import jp.sf.pal.bookmark.db.exentity.RoleMapping; import jp.sf.pal.bookmark.db.exentity.UserInfo; /** - * The behavior of ROLE_INFO. + * The behavior of ROLE_INFO that the type is TABLE.
* *
  * [primary-key]
@@ -73,12 +71,6 @@
 
     //==========================================================================
     // =========
-    // Attribute
-    // =========
-    protected RoleInfoDao _dao;
-
-    //==========================================================================
-    // =========
     // Table name
     // ==========
     /** @return The name on database of table. (NotNull) */
@@ -90,39 +82,18 @@
     // =========
     // DBMeta
     // ======
-    /** @return The meta data of the database. (NotNull) */
+    /** @return The instance of DBMeta. (NotNull) */
     public DBMeta getDBMeta() {
         return RoleInfoDbm.getInstance();
     }
 
-    /** @return The meta data of the database as my table type. (NotNull) */
+    /** @return The instance of DBMeta as my table type. (NotNull) */
     public RoleInfoDbm getMyDBMeta() {
         return RoleInfoDbm.getInstance();
     }
 
     //==========================================================================
     // =========
-    // Dao Accessor
-    // ============
-    public RoleInfoDao getMyDao() {
-        return _dao;
-    }
-
-    public void setMyDao(RoleInfoDao dao) {
-        assertObjectNotNull("dao", dao);
-        _dao = dao;
-    }
-
-    public DaoReadable getDaoReadable() {
-        return getMyDao();
-    }
-
-    public DaoWritable getDaoWritable() {
-        return getMyDao();
-    }
-
-    //==========================================================================
-    // =========
     // New Instance
     // ============
     public Entity newEntity() {
@@ -152,7 +123,7 @@
      * @return The selected count.
      */
     public int selectCount(RoleInfoCB cb) {
-        assertConditionBeanNotNull(cb);
+        assertCBNotNull(cb);
         return delegateSelectCount(cb);
     }
 
@@ -229,7 +200,7 @@
      * @return The result bean of selected list. (NotNull)
      */
     public ListResultBean selectList(RoleInfoCB cb) {
-        assertConditionBeanNotNull(cb);
+        assertCBNotNull(cb);
         return new ResultBeanBuilder(getTableDbName())
                 .buildListResultBean(cb, delegateSelectList(cb));
     }
@@ -245,7 +216,7 @@
      * @return The result bean of selected page. (NotNull)
      */
     public PagingResultBean selectPage(final RoleInfoCB cb) {
-        assertConditionBeanNotNull(cb);
+        assertCBNotNull(cb);
         final PagingInvoker invoker = new PagingInvoker(
                 getTableDbName());
         final PagingHandler handler = new PagingHandler() {
@@ -266,6 +237,32 @@
 
     //==========================================================================
     // =========
+    // Scalar Select
+    // =============
+    /**
+     * Select the scalar value derived by a function. 
Call a function + * method after this method called like as follows: + * + *
+     * roleInfoBhv.scalarSelect(Date.class).max(new ScalarQuery(RoleInfoCB cb) {
+     *     cb.specify().columnXxxDatetime(); // the required specification of target column
+     *     cb.query().setXxxName_PrefixSearch("S"); // query as you like it
+     * });
+     * 
+ * + * @param The type of result. + * @param resultType The type of result. (NotNull) + * @return The scalar value derived by a function. (Nullable) + */ + public SLFunction scalarSelect( + Class resultType) { + RoleInfoCB cb = newMyConditionBean(); + cb.xsetupForScalarSelect(); + return new SLFunction(cb, resultType); + } + + //========================================================================== + // ========= // Various Select // ============== /** @@ -275,8 +272,8 @@ * @param valueLabelSetupper The setupper of value-label. (NotNull) * @return The list of value-label. (NotNull) */ - public List> selectValueLabelList( - RoleInfoCB cb, ValueLabelSetupper valueLabelSetupper) { + public List> selectValueLabelList(RoleInfoCB cb, + ValueLabelSetupper valueLabelSetupper) { return createValueLabelList(selectList(cb), valueLabelSetupper); } @@ -467,8 +464,8 @@ //========================================================================== // ========= - // Pullout Foreign - // =============== + // Pull out Foreign + // ================ //========================================================================== // ========= @@ -764,11 +761,11 @@ */ public int queryUpdate(RoleInfo roleInfo, RoleInfoCB cb) { assertObjectNotNull("roleInfo", roleInfo); - assertConditionBeanNotNull(cb); + assertCBNotNull(cb); setupCommonColumnOfUpdateIfNeeds(roleInfo); filterEntityOfUpdate(roleInfo); assertEntityOfUpdate(roleInfo); - return getMyDao().updateByQuery(cb, roleInfo); + return invoke(createQueryUpdateEntityCBCommand(roleInfo, cb)); } /** @@ -778,8 +775,8 @@ * @return The deleted count. */ public int queryDelete(RoleInfoCB cb) { - assertConditionBeanNotNull(cb); - return getMyDao().deleteByQuery(cb); + assertCBNotNull(cb); + return invoke(createQueryDeleteCBCommand(cb)); } //========================================================================== @@ -791,19 +788,27 @@ // ========= // Delegate Method // =============== + // [Behavior Command] // ----------------------------------------------------- // Select // ------ protected int delegateSelectCount(RoleInfoCB cb) { - assertConditionBeanNotNull(cb); - return getMyDao().selectCount(cb); + return invoke(createSelectCountCBCommand(cb)); } + protected int doCallReadCount(ConditionBean cb) { + return delegateSelectCount((RoleInfoCB) cb); + } + protected List delegateSelectList(RoleInfoCB cb) { - assertConditionBeanNotNull(cb); - return getMyDao().selectList(cb); + return invoke(createSelectListCBCommand(cb, RoleInfo.class)); } + @SuppressWarnings("unchecked") + protected List doCallReadList(ConditionBean cb) { + return (List) delegateSelectList((RoleInfoCB) cb); + } + // ----------------------------------------------------- // Update // ------ @@ -811,62 +816,97 @@ if (!processBeforeInsert(e)) { return 1; } - return getMyDao().insert(e); + return invoke(createInsertEntityCommand(e)); } + protected int doCallCreate(Entity entity) { + return delegateInsert(downcast(entity)); + } + protected int delegateUpdate(RoleInfo e) { if (!processBeforeUpdate(e)) { return 1; } - return getMyDao().updateModifiedOnly(e); + return invoke(createUpdateEntityCommand(e)); } + protected int doCallModify(Entity entity) { + return delegateUpdate(downcast(entity)); + } + protected int delegateUpdateNonstrict(RoleInfo e) { if (!processBeforeUpdate(e)) { return 1; } - return getMyDao().updateNonstrictModifiedOnly(e); + return invoke(createUpdateNonstrictEntityCommand(e)); } protected int delegateDelete(RoleInfo e) { if (!processBeforeDelete(e)) { return 1; } - return getMyDao().delete(e); + return invoke(createDeleteEntityCommand(e)); } + protected int doCallRemove(Entity entity) { + return delegateDelete(downcast(entity)); + } + protected int delegateDeleteNonstrict(RoleInfo e) { if (!processBeforeDelete(e)) { return 1; } - return getMyDao().deleteNonstrict(e); + return invoke(createDeleteNonstrictEntityCommand(e)); } protected int[] delegateInsertList(List ls) { - assertObjectNotNull("roleInfoList", ls); - return getMyDao().insertList(helpFilterBeforeInsertInternally(ls)); + if (ls.isEmpty()) { + return new int[] {}; + } + return invoke(createBatchInsertEntityCommand(helpFilterBeforeInsertInternally(ls))); } + @SuppressWarnings("unchecked") + protected int[] doCreateList(List ls) { + return delegateInsertList((List) ls); + } + protected int[] delegateUpdateList(List ls) { - assertObjectNotNull("roleInfoList", ls); - return getMyDao().updateList(helpFilterBeforeUpdateInternally(ls)); + if (ls.isEmpty()) { + return new int[] {}; + } + return invoke(createBatchUpdateEntityCommand(helpFilterBeforeUpdateInternally(ls))); } + @SuppressWarnings("unchecked") + protected int[] doModifyList(List ls) { + return delegateUpdateList((List) ls); + } + protected int[] delegateUpdateListNonstrict(List ls) { - assertObjectNotNull("roleInfoList", ls); - return getMyDao().updateListNonstrict( - helpFilterBeforeUpdateInternally(ls)); + if (ls.isEmpty()) { + return new int[] {}; + } + return invoke(createBatchUpdateNonstrictEntityCommand(helpFilterBeforeUpdateInternally(ls))); } protected int[] delegateDeleteList(List ls) { - assertObjectNotNull("roleInfoList", ls); - return getMyDao().deleteList(helpFilterBeforeDeleteInternally(ls)); + if (ls.isEmpty()) { + return new int[] {}; + } + return invoke(createBatchDeleteEntityCommand(helpFilterBeforeDeleteInternally(ls))); } + @SuppressWarnings("unchecked") + protected int[] doRemoveList(List ls) { + return delegateDeleteList((List) ls); + } + protected int[] delegateDeleteListNonstrict(List ls) { - assertObjectNotNull("roleInfoList", ls); - return getMyDao().deleteListNonstrict( - helpFilterBeforeDeleteInternally(ls)); + if (ls.isEmpty()) { + return new int[] {}; + } + return invoke(createBatchDeleteNonstrictEntityCommand(helpFilterBeforeDeleteInternally(ls))); } //========================================================================== Modified: bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/bsbhv/BsRoleMappingBhv.java =================================================================== --- bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/bsbhv/BsRoleMappingBhv.java 2008-12-27 22:10:35 UTC (rev 1626) +++ bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/bsbhv/BsRoleMappingBhv.java 2008-12-27 22:11:51 UTC (rev 1627) @@ -1,9 +1,8 @@ package jp.sf.pal.bookmark.db.bsbhv; import java.util.List; +import java.util.Map; -import jp.sf.pal.bookmark.db.allcommon.DaoReadable; -import jp.sf.pal.bookmark.db.allcommon.DaoWritable; import jp.sf.pal.bookmark.db.allcommon.Entity; import jp.sf.pal.bookmark.db.allcommon.bhv.setup.ValueLabelSetupper; import jp.sf.pal.bookmark.db.allcommon.cbean.ConditionBean; @@ -16,13 +15,12 @@ import jp.sf.pal.bookmark.db.allcommon.dbmeta.DBMeta; import jp.sf.pal.bookmark.db.bsentity.dbmeta.RoleMappingDbm; import jp.sf.pal.bookmark.db.cbean.RoleMappingCB; -import jp.sf.pal.bookmark.db.exdao.RoleMappingDao; import jp.sf.pal.bookmark.db.exentity.RoleInfo; import jp.sf.pal.bookmark.db.exentity.RoleMapping; import jp.sf.pal.bookmark.db.exentity.UserInfo; /** - * The behavior of ROLE_MAPPING. + * The behavior of ROLE_MAPPING that the type is TABLE.
* *
  * [primary-key]
@@ -67,12 +65,6 @@
 
     //==========================================================================
     // =========
-    // Attribute
-    // =========
-    protected RoleMappingDao _dao;
-
-    //==========================================================================
-    // =========
     // Table name
     // ==========
     /** @return The name on database of table. (NotNull) */
@@ -84,39 +76,18 @@
     // =========
     // DBMeta
     // ======
-    /** @return The meta data of the database. (NotNull) */
+    /** @return The instance of DBMeta. (NotNull) */
     public DBMeta getDBMeta() {
         return RoleMappingDbm.getInstance();
     }
 
-    /** @return The meta data of the database as my table type. (NotNull) */
+    /** @return The instance of DBMeta as my table type. (NotNull) */
     public RoleMappingDbm getMyDBMeta() {
         return RoleMappingDbm.getInstance();
     }
 
     //==========================================================================
     // =========
-    // Dao Accessor
-    // ============
-    public RoleMappingDao getMyDao() {
-        return _dao;
-    }
-
-    public void setMyDao(RoleMappingDao dao) {
-        assertObjectNotNull("dao", dao);
-        _dao = dao;
-    }
-
-    public DaoReadable getDaoReadable() {
-        return getMyDao();
-    }
-
-    public DaoWritable getDaoWritable() {
-        return getMyDao();
-    }
-
-    //==========================================================================
-    // =========
     // New Instance
     // ============
     public Entity newEntity() {
@@ -146,7 +117,7 @@
      * @return The selected count.
      */
     public int selectCount(RoleMappingCB cb) {
-        assertConditionBeanNotNull(cb);
+        assertCBNotNull(cb);
         return delegateSelectCount(cb);
     }
 
@@ -223,7 +194,7 @@
      * @return The result bean of selected list. (NotNull)
      */
     public ListResultBean selectList(RoleMappingCB cb) {
-        assertConditionBeanNotNull(cb);
+        assertCBNotNull(cb);
         return new ResultBeanBuilder(getTableDbName())
                 .buildListResultBean(cb, delegateSelectList(cb));
     }
@@ -239,7 +210,7 @@
      * @return The result bean of selected page. (NotNull)
      */
     public PagingResultBean selectPage(final RoleMappingCB cb) {
-        assertConditionBeanNotNull(cb);
+        assertCBNotNull(cb);
         final PagingInvoker invoker = new PagingInvoker(
                 getTableDbName());
         final PagingHandler handler = new PagingHandler() {
@@ -260,6 +231,32 @@
 
     //==========================================================================
     // =========
+    // Scalar Select
+    // =============
+    /**
+     * Select the scalar value derived by a function. 
Call a function + * method after this method called like as follows: + * + *
+     * roleMappingBhv.scalarSelect(Date.class).max(new ScalarQuery(RoleMappingCB cb) {
+     *     cb.specify().columnXxxDatetime(); // the required specification of target column
+     *     cb.query().setXxxName_PrefixSearch("S"); // query as you like it
+     * });
+     * 
+ * + * @param The type of result. + * @param resultType The type of result. (NotNull) + * @return The scalar value derived by a function. (Nullable) + */ + public SLFunction scalarSelect( + Class resultType) { + RoleMappingCB cb = newMyConditionBean(); + cb.xsetupForScalarSelect(); + return new SLFunction(cb, resultType); + } + + //========================================================================== + // ========= // Various Select // ============== /** @@ -269,8 +266,8 @@ * @param valueLabelSetupper The setupper of value-label. (NotNull) * @return The list of value-label. (NotNull) */ - public List> selectValueLabelList( - RoleMappingCB cb, ValueLabelSetupper valueLabelSetupper) { + public List> selectValueLabelList(RoleMappingCB cb, + ValueLabelSetupper valueLabelSetupper) { return createValueLabelList(selectList(cb), valueLabelSetupper); } @@ -281,8 +278,8 @@ //========================================================================== // ========= - // Pullout Foreign - // =============== + // Pull out Foreign + // ================ /** * Pull out the list of foreign table 'RoleInfo'. * @@ -494,11 +491,11 @@ */ public int queryUpdate(RoleMapping roleMapping, RoleMappingCB cb) { assertObjectNotNull("roleMapping", roleMapping); - assertConditionBeanNotNull(cb); + assertCBNotNull(cb); setupCommonColumnOfUpdateIfNeeds(roleMapping); filterEntityOfUpdate(roleMapping); assertEntityOfUpdate(roleMapping); - return getMyDao().updateByQuery(cb, roleMapping); + return invoke(createQueryUpdateEntityCBCommand(roleMapping, cb)); } /** @@ -508,8 +505,8 @@ * @return The deleted count. */ public int queryDelete(RoleMappingCB cb) { - assertConditionBeanNotNull(cb); - return getMyDao().deleteByQuery(cb); + assertCBNotNull(cb); + return invoke(createQueryDeleteCBCommand(cb)); } //========================================================================== @@ -521,19 +518,27 @@ // ========= // Delegate Method // =============== + // [Behavior Command] // ----------------------------------------------------- // Select // ------ protected int delegateSelectCount(RoleMappingCB cb) { - assertConditionBeanNotNull(cb); - return getMyDao().selectCount(cb); + return invoke(createSelectCountCBCommand(cb)); } + protected int doCallReadCount(ConditionBean cb) { + return delegateSelectCount((RoleMappingCB) cb); + } + protected List delegateSelectList(RoleMappingCB cb) { - assertConditionBeanNotNull(cb); - return getMyDao().selectList(cb); + return invoke(createSelectListCBCommand(cb, RoleMapping.class)); } + @SuppressWarnings("unchecked") + protected List doCallReadList(ConditionBean cb) { + return (List) delegateSelectList((RoleMappingCB) cb); + } + // ----------------------------------------------------- // Update // ------ @@ -541,38 +546,71 @@ if (!processBeforeInsert(e)) { return 1; } - return getMyDao().insert(e); + return invoke(createInsertEntityCommand(e)); } + protected int doCallCreate(Entity entity) { + return delegateInsert(downcast(entity)); + } + protected int delegateUpdate(RoleMapping e) { if (!processBeforeUpdate(e)) { return 1; } - return getMyDao().updateModifiedOnly(e); + return invoke(createUpdateEntityCommand(e)); } + protected int doCallModify(Entity entity) { + return delegateUpdate(downcast(entity)); + } + protected int delegateDelete(RoleMapping e) { if (!processBeforeDelete(e)) { return 1; } - return getMyDao().delete(e); + return invoke(createDeleteEntityCommand(e)); } + protected int doCallRemove(Entity entity) { + return delegateDelete(downcast(entity)); + } + protected int[] delegateInsertList(List ls) { - assertObjectNotNull("roleMappingList", ls); - return getMyDao().insertList(helpFilterBeforeInsertInternally(ls)); + if (ls.isEmpty()) { + return new int[] {}; + } + return invoke(createBatchInsertEntityCommand(helpFilterBeforeInsertInternally(ls))); } + @SuppressWarnings("unchecked") + protected int[] doCreateList(List ls) { + return delegateInsertList((List) ls); + } + protected int[] delegateUpdateList(List ls) { - assertObjectNotNull("roleMappingList", ls); - return getMyDao().updateList(helpFilterBeforeUpdateInternally(ls)); + if (ls.isEmpty()) { + return new int[] {}; + } + return invoke(createBatchUpdateEntityCommand(helpFilterBeforeUpdateInternally(ls))); } + @SuppressWarnings("unchecked") + protected int[] doModifyList(List ls) { + return delegateUpdateList((List) ls); + } + protected int[] delegateDeleteList(List ls) { - assertObjectNotNull("roleMappingList", ls); - return getMyDao().deleteList(helpFilterBeforeDeleteInternally(ls)); + if (ls.isEmpty()) { + return new int[] {}; + } + return invoke(createBatchDeleteEntityCommand(helpFilterBeforeDeleteInternally(ls))); } + @SuppressWarnings("unchecked") + protected int[] doRemoveList(List ls) { + return delegateDeleteList((List) ls); + } + //========================================================================== // ========= // Optimistic Lock Info Modified: bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/bsbhv/BsUserInfoBhv.java =================================================================== --- bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/bsbhv/BsUserInfoBhv.java 2008-12-27 22:10:35 UTC (rev 1626) +++ bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/bsbhv/BsUserInfoBhv.java 2008-12-27 22:11:51 UTC (rev 1627) @@ -1,9 +1,8 @@ package jp.sf.pal.bookmark.db.bsbhv; import java.util.List; +import java.util.Map; -import jp.sf.pal.bookmark.db.allcommon.DaoReadable; -import jp.sf.pal.bookmark.db.allcommon.DaoWritable; import jp.sf.pal.bookmark.db.allcommon.Entity; import jp.sf.pal.bookmark.db.allcommon.bhv.load.LoadReferrerOption; import jp.sf.pal.bookmark.db.allcommon.bhv.setup.ConditionBeanSetupper; @@ -26,7 +25,6 @@ import jp.sf.pal.bookmark.db.exbhv.BookmarkLinkBhv; import jp.sf.pal.bookmark.db.exbhv.GroupMappingBhv; import jp.sf.pal.bookmark.db.exbhv.RoleMappingBhv; -import jp.sf.pal.bookmark.db.exdao.UserInfoDao; import jp.sf.pal.bookmark.db.exentity.BookmarkCategory; import jp.sf.pal.bookmark.db.exentity.BookmarkLink; import jp.sf.pal.bookmark.db.exentity.GroupInfo; @@ -36,14 +34,14 @@ import jp.sf.pal.bookmark.db.exentity.UserInfo; /** - * The behavior of USER_INFO. + * The behavior of USER_INFO that the type is TABLE.
* *
  * [primary-key]
  *     USER_ID
  * 
  * [column]
- *     USER_ID, GIVEN_NAME, FAMILY_NAME, MIDDLE_NAME, GIVEN_NAME_DESC, FAMILY_NAME_DESC, NICKNAME, GENDER, BIRTH_DATE, EMAIL, URL, TELEPHONE, LOCALE, ROLE_ID, GROUP_ID, CREATED_TIME, CREATED_BY, UPDATED_TIME, UPDATED_BY, DELETED_TIME, DELETED_BY, VERSIONNO
+ *     USER_ID, GIVEN_NAME, FAMILY_NAME, MIDDLE_NAME, GIVEN_NAME_DESC, FAMILY_NAME_DESC, NICKNAME, GENDER, BIRTH_DATE, EMAIL, URL, TELEPHONE, LOCALE, ROLE_ID, GROUP_ID, STATUS, CREATED_TIME, CREATED_BY, UPDATED_TIME, UPDATED_BY, DELETED_TIME, DELETED_BY, VERSIONNO
  * 
  * [sequence]
  *     
@@ -81,12 +79,6 @@
 
     //==========================================================================
     // =========
-    // Attribute
-    // =========
-    protected UserInfoDao _dao;
-
-    //==========================================================================
-    // =========
     // Table name
     // ==========
     /** @return The name on database of table. (NotNull) */
@@ -98,39 +90,18 @@
     // =========
     // DBMeta
     // ======
-    /** @return The meta data of the database. (NotNull) */
+    /** @return The instance of DBMeta. (NotNull) */
     public DBMeta getDBMeta() {
         return UserInfoDbm.getInstance();
     }
 
-    /** @return The meta data of the database as my table type. (NotNull) */
+    /** @return The instance of DBMeta as my table type. (NotNull) */
     public UserInfoDbm getMyDBMeta() {
         return UserInfoDbm.getInstance();
     }
 
     //==========================================================================
     // =========
-    // Dao Accessor
-    // ============
-    public UserInfoDao getMyDao() {
-        return _dao;
-    }
-
-    public void setMyDao(UserInfoDao dao) {
-        assertObjectNotNull("dao", dao);
-        _dao = dao;
-    }
-
-    public DaoReadable getDaoReadable() {
-        return getMyDao();
-    }
-
-    public DaoWritable getDaoWritable() {
-        return getMyDao();
-    }
-
-    //==========================================================================
-    // =========
     // New Instance
     // ============
     public Entity newEntity() {
@@ -160,7 +131,7 @@
      * @return The selected count.
      */
     public int selectCount(UserInfoCB cb) {
-        assertConditionBeanNotNull(cb);
+        assertCBNotNull(cb);
         return delegateSelectCount(cb);
     }
 
@@ -237,7 +208,7 @@
      * @return The result bean of selected list. (NotNull)
      */
     public ListResultBean selectList(UserInfoCB cb) {
-        assertConditionBeanNotNull(cb);
+        assertCBNotNull(cb);
         return new ResultBeanBuilder(getTableDbName())
                 .buildListResultBean(cb, delegateSelectList(cb));
     }
@@ -253,7 +224,7 @@
      * @return The result bean of selected page. (NotNull)
      */
     public PagingResultBean selectPage(final UserInfoCB cb) {
-        assertConditionBeanNotNull(cb);
+        assertCBNotNull(cb);
         final PagingInvoker invoker = new PagingInvoker(
                 getTableDbName());
         final PagingHandler handler = new PagingHandler() {
@@ -274,6 +245,32 @@
 
     //==========================================================================
     // =========
+    // Scalar Select
+    // =============
+    /**
+     * Select the scalar value derived by a function. 
Call a function + * method after this method called like as follows: + * + *
+     * userInfoBhv.scalarSelect(Date.class).max(new ScalarQuery(UserInfoCB cb) {
+     *     cb.specify().columnXxxDatetime(); // the required specification of target column
+     *     cb.query().setXxxName_PrefixSearch("S"); // query as you like it
+     * });
+     * 
+ * + * @param The type of result. + * @param resultType The type of result. (NotNull) + * @return The scalar value derived by a function. (Nullable) + */ + public SLFunction scalarSelect( + Class resultType) { + UserInfoCB cb = newMyConditionBean(); + cb.xsetupForScalarSelect(); + return new SLFunction(cb, resultType); + } + + //========================================================================== + // ========= // Various Select // ============== /** @@ -283,8 +280,8 @@ * @param valueLabelSetupper The setupper of value-label. (NotNull) * @return The list of value-label. (NotNull) */ - public List> selectValueLabelList( - UserInfoCB cb, ValueLabelSetupper valueLabelSetupper) { + public List> selectValueLabelList(UserInfoCB cb, + ValueLabelSetupper valueLabelSetupper) { return createValueLabelList(selectList(cb), valueLabelSetupper); } @@ -846,8 +843,8 @@ //========================================================================== // ========= - // Pullout Foreign - // =============== + // Pull out Foreign + // ================ /** * Pull out the list of foreign table 'GroupInfo'. * @@ -1172,11 +1169,11 @@ */ public int queryUpdate(UserInfo userInfo, UserInfoCB cb) { assertObjectNotNull("userInfo", userInfo); - assertConditionBeanNotNull(cb); + assertCBNotNull(cb); setupCommonColumnOfUpdateIfNeeds(userInfo); filterEntityOfUpdate(userInfo); assertEntityOfUpdate(userInfo); - return getMyDao().updateByQuery(cb, userInfo); + return invoke(createQueryUpdateEntityCBCommand(userInfo, cb)); } /** @@ -1186,8 +1183,8 @@ * @return The deleted count. */ public int queryDelete(UserInfoCB cb) { - assertConditionBeanNotNull(cb); - return getMyDao().deleteByQuery(cb); + assertCBNotNull(cb); + return invoke(createQueryDeleteCBCommand(cb)); } //========================================================================== @@ -1199,19 +1196,27 @@ // ========= // Delegate Method // =============== + // [Behavior Command] // ----------------------------------------------------- // Select // ------ protected int delegateSelectCount(UserInfoCB cb) { - assertConditionBeanNotNull(cb); - return getMyDao().selectCount(cb); + return invoke(createSelectCountCBCommand(cb)); } + protected int doCallReadCount(ConditionBean cb) { + return delegateSelectCount((UserInfoCB) cb); + } + protected List delegateSelectList(UserInfoCB cb) { - assertConditionBeanNotNull(cb); - return getMyDao().selectList(cb); + return invoke(createSelectListCBCommand(cb, UserInfo.class)); } + @SuppressWarnings("unchecked") + protected List doCallReadList(ConditionBean cb) { + return (List) delegateSelectList((UserInfoCB) cb); + } + // ----------------------------------------------------- // Update // ------ @@ -1219,62 +1224,97 @@ if (!processBeforeInsert(e)) { return 1; } - return getMyDao().insert(e); + return invoke(createInsertEntityCommand(e)); } + protected int doCallCreate(Entity entity) { + return delegateInsert(downcast(entity)); + } + protected int delegateUpdate(UserInfo e) { if (!processBeforeUpdate(e)) { return 1; } - return getMyDao().updateModifiedOnly(e); + return invoke(createUpdateEntityCommand(e)); } + protected int doCallModify(Entity entity) { + return delegateUpdate(downcast(entity)); + } + protected int delegateUpdateNonstrict(UserInfo e) { if (!processBeforeUpdate(e)) { return 1; } - return getMyDao().updateNonstrictModifiedOnly(e); + return invoke(createUpdateNonstrictEntityCommand(e)); } protected int delegateDelete(UserInfo e) { if (!processBeforeDelete(e)) { return 1; } - return getMyDao().delete(e); + return invoke(createDeleteEntityCommand(e)); } + protected int doCallRemove(Entity entity) { + return delegateDelete(downcast(entity)); + } + protected int delegateDeleteNonstrict(UserInfo e) { if (!processBeforeDelete(e)) { return 1; } - return getMyDao().deleteNonstrict(e); + return invoke(createDeleteNonstrictEntityCommand(e)); } protected int[] delegateInsertList(List ls) { - assertObjectNotNull("userInfoList", ls); - return getMyDao().insertList(helpFilterBeforeInsertInternally(ls)); + if (ls.isEmpty()) { + return new int[] {}; + } + return invoke(createBatchInsertEntityCommand(helpFilterBeforeInsertInternally(ls))); } + @SuppressWarnings("unchecked") + protected int[] doCreateList(List ls) { + return delegateInsertList((List) ls); + } + protected int[] delegateUpdateList(List ls) { - assertObjectNotNull("userInfoList", ls); - return getMyDao().updateList(helpFilterBeforeUpdateInternally(ls)); + if (ls.isEmpty()) { + return new int[] {}; + } + return invoke(createBatchUpdateEntityCommand(helpFilterBeforeUpdateInternally(ls))); } + @SuppressWarnings("unchecked") + protected int[] doModifyList(List ls) { + return delegateUpdateList((List) ls); + } + protected int[] delegateUpdateListNonstrict(List ls) { - assertObjectNotNull("userInfoList", ls); - return getMyDao().updateListNonstrict( - helpFilterBeforeUpdateInternally(ls)); + if (ls.isEmpty()) { + return new int[] {}; + } + return invoke(createBatchUpdateNonstrictEntityCommand(helpFilterBeforeUpdateInternally(ls))); } protected int[] delegateDeleteList(List ls) { - assertObjectNotNull("userInfoList", ls); - return getMyDao().deleteList(helpFilterBeforeDeleteInternally(ls)); + if (ls.isEmpty()) { + return new int[] {}; + } + return invoke(createBatchDeleteEntityCommand(helpFilterBeforeDeleteInternally(ls))); } + @SuppressWarnings("unchecked") + protected int[] doRemoveList(List ls) { + return delegateDeleteList((List) ls); + } + protected int[] delegateDeleteListNonstrict(List ls) { - assertObjectNotNull("userInfoList", ls); - return getMyDao().deleteListNonstrict( - helpFilterBeforeDeleteInternally(ls)); + if (ls.isEmpty()) { + return new int[] {}; + } + return invoke(createBatchDeleteNonstrictEntityCommand(helpFilterBeforeDeleteInternally(ls))); } //========================================================================== Modified: bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/bsentity/BsBookmarkCategory.java =================================================================== --- bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/bsentity/BsBookmarkCategory.java 2008-12-27 22:10:35 UTC (rev 1626) +++ bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/bsentity/BsBookmarkCategory.java 2008-12-27 22:11:51 UTC (rev 1627) @@ -44,7 +44,6 @@ * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public abstract class BsBookmarkCategory implements Entity, java.io.Serializable { Modified: bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/bsentity/BsBookmarkLink.java =================================================================== --- bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/bsentity/BsBookmarkLink.java 2008-12-27 22:10:35 UTC (rev 1626) +++ bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/bsentity/BsBookmarkLink.java 2008-12-27 22:11:51 UTC (rev 1627) @@ -42,7 +42,6 @@ * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public abstract class BsBookmarkLink implements Entity, java.io.Serializable { //========================================================================== Modified: bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/bsentity/BsGroupInfo.java =================================================================== --- bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/bsentity/BsGroupInfo.java 2008-12-27 22:10:35 UTC (rev 1626) +++ bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/bsentity/BsGroupInfo.java 2008-12-27 22:11:51 UTC (rev 1627) @@ -44,7 +44,6 @@ * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public abstract class BsGroupInfo implements Entity, java.io.Serializable { //========================================================================== Modified: bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/bsentity/BsGroupMapping.java =================================================================== --- bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/bsentity/BsGroupMapping.java 2008-12-27 22:10:35 UTC (rev 1626) +++ bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/bsentity/BsGroupMapping.java 2008-12-27 22:11:51 UTC (rev 1627) @@ -42,7 +42,6 @@ * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public abstract class BsGroupMapping implements Entity, java.io.Serializable { //========================================================================== Modified: bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/bsentity/BsRoleInfo.java =================================================================== --- bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/bsentity/BsRoleInfo.java 2008-12-27 22:10:35 UTC (rev 1626) +++ bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/bsentity/BsRoleInfo.java 2008-12-27 22:11:51 UTC (rev 1627) @@ -44,7 +44,6 @@ * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public abstract class BsRoleInfo implements Entity, java.io.Serializable { //========================================================================== Modified: bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/bsentity/BsRoleMapping.java =================================================================== --- bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/bsentity/BsRoleMapping.java 2008-12-27 22:10:35 UTC (rev 1626) +++ bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/bsentity/BsRoleMapping.java 2008-12-27 22:11:51 UTC (rev 1627) @@ -42,7 +42,6 @@ * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public abstract class BsRoleMapping implements Entity, java.io.Serializable { //========================================================================== Modified: bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/bsentity/BsUserInfo.java =================================================================== --- bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/bsentity/BsUserInfo.java 2008-12-27 22:10:35 UTC (rev 1626) +++ bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/bsentity/BsUserInfo.java 2008-12-27 22:11:51 UTC (rev 1627) @@ -22,7 +22,7 @@ * USER_ID * * [column] - * USER_ID, GIVEN_NAME, FAMILY_NAME, MIDDLE_NAME, GIVEN_NAME_DESC, FAMILY_NAME_DESC, NICKNAME, GENDER, BIRTH_DATE, EMAIL, URL, TELEPHONE, LOCALE, ROLE_ID, GROUP_ID, CREATED_TIME, CREATED_BY, UPDATED_TIME, UPDATED_BY, DELETED_TIME, DELETED_BY, VERSIONNO + * USER_ID, GIVEN_NAME, FAMILY_NAME, MIDDLE_NAME, GIVEN_NAME_DESC, FAMILY_NAME_DESC, NICKNAME, GENDER, BIRTH_DATE, EMAIL, URL, TELEPHONE, LOCALE, ROLE_ID, GROUP_ID, STATUS, CREATED_TIME, CREATED_BY, UPDATED_TIME, UPDATED_BY, DELETED_TIME, DELETED_BY, VERSIONNO * * [sequence] * @@ -48,7 +48,6 @@ * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public abstract class BsUserInfo implements Entity, java.io.Serializable { //========================================================================== @@ -116,6 +115,9 @@ /** GROUP_ID: {VARCHAR(255) : FK to GROUP_INFO} */ protected String _groupId; + /** STATUS: {VARCHAR(1)} */ + protected String _status; + /** CREATED_TIME: {NotNull : TIMESTAMP} */ protected java.sql.Timestamp _createdTime; @@ -535,6 +537,7 @@ sb.append(delimiter).append(getLocale()); sb.append(delimiter).append(getRoleId()); sb.append(delimiter).append(getGroupId()); + sb.append(delimiter).append(getStatus()); sb.append(delimiter).append(getCreatedTime()); sb.append(delimiter).append(getCreatedBy()); sb.append(delimiter).append(getUpdatedTime()); @@ -886,6 +889,28 @@ this._groupId = groupId; } + /** The column annotation for S2Dao. {VARCHAR(1)} */ + public static final String status_COLUMN = "STATUS"; + + /** + * STATUS: {VARCHAR(1)}
+ * + * @return The value of the column 'STATUS'. (Nullable) + */ + public String getStatus() { + return _status; + } + + /** + * STATUS: {VARCHAR(1)}
+ * + * @param status The value of the column 'STATUS'. (Nullable) + */ + public void setStatus(String status) { + _modifiedProperties.addPropertyName("status"); + this._status = status; + } + /** The column annotation for S2Dao. {NotNull : TIMESTAMP} */ public static final String createdTime_COLUMN = "CREATED_TIME"; Modified: bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/bsentity/dbmeta/BookmarkCategoryDbm.java =================================================================== --- bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/bsentity/dbmeta/BookmarkCategoryDbm.java 2008-12-27 22:10:35 UTC (rev 1626) +++ bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/bsentity/dbmeta/BookmarkCategoryDbm.java 2008-12-27 22:11:51 UTC (rev 1627) @@ -9,6 +9,7 @@ import jp.sf.pal.bookmark.db.allcommon.dbmeta.info.ForeignInfo; import jp.sf.pal.bookmark.db.allcommon.dbmeta.info.ReferrerInfo; import jp.sf.pal.bookmark.db.allcommon.dbmeta.info.UniqueInfo; +import jp.sf.pal.bookmark.db.allcommon.helper.StringKeyMap; import jp.sf.pal.bookmark.db.exentity.BookmarkCategory; /** @@ -16,7 +17,6 @@ * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public class BookmarkCategoryDbm extends AbstractDBMeta { private static final BookmarkCategoryDbm _instance = new BookmarkCategoryDbm(); @@ -132,40 +132,14 @@ return _columnVersionno; } - { - initializeColumnInfoList(); - } - //========================================================================== // ========= - // Name Map - // ======== - public Map getDbNamePropertyNameKeyToLowerMap() { - return createDbNamePropertyNameKeyToLowerMap(); + // Resource Initialization + // ======================= + { + initializeInformationResource(); } - public Map getPropertyNameDbNameKeyToLowerMap() { - return createPropertyNameDbNameKeyToLowerMap(); - } - - protected static Map _dbNamePropertyNameKeyToLowerMap; - - protected Map createDbNamePropertyNameKeyToLowerMap() { - if (_dbNamePropertyNameKeyToLowerMap == null) { - _dbNamePropertyNameKeyToLowerMap = setupKeyToLowerMap(true); - } - return _dbNamePropertyNameKeyToLowerMap; - } - - protected static Map _propertyNameDbNameKeyToLowerMap; - - protected Map createPropertyNameDbNameKeyToLowerMap() { - if (_propertyNameDbNameKeyToLowerMap == null) { - _propertyNameDbNameKeyToLowerMap = setupKeyToLowerMap(false); - } - return _propertyNameDbNameKeyToLowerMap; - } - //========================================================================== // ========= // Type Name @@ -343,7 +317,8 @@ // Entity Property Setup // ===================== // It's very INTERNAL! - protected Map> _epsMap = newHashMap(); + protected Map> _epsMap = StringKeyMap + .createAsFlexibleConcurrent(); { setupEps(_epsMap, new EpsId(), columnId()); setupEps(_epsMap, new EpsName(), columnName()); Modified: bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/bsentity/dbmeta/BookmarkLinkDbm.java =================================================================== --- bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/bsentity/dbmeta/BookmarkLinkDbm.java 2008-12-27 22:10:35 UTC (rev 1626) +++ bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/bsentity/dbmeta/BookmarkLinkDbm.java 2008-12-27 22:11:51 UTC (rev 1627) @@ -8,6 +8,7 @@ import jp.sf.pal.bookmark.db.allcommon.dbmeta.info.ColumnInfo; import jp.sf.pal.bookmark.db.allcommon.dbmeta.info.ForeignInfo; import jp.sf.pal.bookmark.db.allcommon.dbmeta.info.UniqueInfo; +import jp.sf.pal.bookmark.db.allcommon.helper.StringKeyMap; import jp.sf.pal.bookmark.db.exentity.BookmarkLink; /** @@ -15,7 +16,6 @@ * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public class BookmarkLinkDbm extends AbstractDBMeta { private static final BookmarkLinkDbm _instance = new BookmarkLinkDbm(); @@ -145,40 +145,14 @@ return _columnVersionno; } - { - initializeColumnInfoList(); - } - //========================================================================== // ========= - // Name Map - // ======== - public Map getDbNamePropertyNameKeyToLowerMap() { - return createDbNamePropertyNameKeyToLowerMap(); + // Resource Initialization + // ======================= + { + initializeInformationResource(); } - public Map getPropertyNameDbNameKeyToLowerMap() { - return createPropertyNameDbNameKeyToLowerMap(); - } - - protected static Map _dbNamePropertyNameKeyToLowerMap; - - protected Map createDbNamePropertyNameKeyToLowerMap() { - if (_dbNamePropertyNameKeyToLowerMap == null) { - _dbNamePropertyNameKeyToLowerMap = setupKeyToLowerMap(true); - } - return _dbNamePropertyNameKeyToLowerMap; - } - - protected static Map _propertyNameDbNameKeyToLowerMap; - - protected Map createPropertyNameDbNameKeyToLowerMap() { - if (_propertyNameDbNameKeyToLowerMap == null) { - _propertyNameDbNameKeyToLowerMap = setupKeyToLowerMap(false); - } - return _propertyNameDbNameKeyToLowerMap; - } - //========================================================================== // ========= // Type Name @@ -356,7 +330,8 @@ // Entity Property Setup // ===================== // It's very INTERNAL! - protected Map> _epsMap = newHashMap(); + protected Map> _epsMap = StringKeyMap + .createAsFlexibleConcurrent(); { setupEps(_epsMap, new EpsId(), columnId()); setupEps(_epsMap, new EpsName(), columnName()); Modified: bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/bsentity/dbmeta/GroupInfoDbm.java =================================================================== --- bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/bsentity/dbmeta/GroupInfoDbm.java 2008-12-27 22:10:35 UTC (rev 1626) +++ bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/bsentity/dbmeta/GroupInfoDbm.java 2008-12-27 22:11:51 UTC (rev 1627) @@ -8,6 +8,7 @@ import jp.sf.pal.bookmark.db.allcommon.dbmeta.info.ColumnInfo; import jp.sf.pal.bookmark.db.allcommon.dbmeta.info.ReferrerInfo; import jp.sf.pal.bookmark.db.allcommon.dbmeta.info.UniqueInfo; +import jp.sf.pal.bookmark.db.allcommon.helper.StringKeyMap; import jp.sf.pal.bookmark.db.exentity.GroupInfo; /** @@ -15,7 +16,6 @@ * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public class GroupInfoDbm extends AbstractDBMeta { private static final GroupInfoDbm _instance = new GroupInfoDbm(); @@ -138,40 +138,14 @@ return _columnVersionno; } - { - initializeColumnInfoList(); - } - //========================================================================== // ========= - // Name Map - // ======== - public Map getDbNamePropertyNameKeyToLowerMap() { - return createDbNamePropertyNameKeyToLowerMap(); + // Resource Initialization + // ======================= + { + initializeInformationResource(); } - public Map getPropertyNameDbNameKeyToLowerMap() { - return createPropertyNameDbNameKeyToLowerMap(); - } - - protected static Map _dbNamePropertyNameKeyToLowerMap; - - protected Map createDbNamePropertyNameKeyToLowerMap() { - if (_dbNamePropertyNameKeyToLowerMap == null) { - _dbNamePropertyNameKeyToLowerMap = setupKeyToLowerMap(true); - } - return _dbNamePropertyNameKeyToLowerMap; - } - - protected static Map _propertyNameDbNameKeyToLowerMap; - - protected Map createPropertyNameDbNameKeyToLowerMap() { - if (_propertyNameDbNameKeyToLowerMap == null) { - _propertyNameDbNameKeyToLowerMap = setupKeyToLowerMap(false); - } - return _propertyNameDbNameKeyToLowerMap; - } - //========================================================================== // ========= // Type Name @@ -341,7 +315,8 @@ // Entity Property Setup // ===================== // It's very INTERNAL! - protected Map> _epsMap = newHashMap(); + protected Map> _epsMap = StringKeyMap + .createAsFlexibleConcurrent(); { setupEps(_epsMap, new EpsGroupId(), columnGroupId()); setupEps(_epsMap, new EpsName(), columnName()); Modified: bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/bsentity/dbmeta/GroupMappingDbm.java =================================================================== --- bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/bsentity/dbmeta/GroupMappingDbm.java 2008-12-27 22:10:35 UTC (rev 1626) +++ bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/bsentity/dbmeta/GroupMappingDbm.java 2008-12-27 22:11:51 UTC (rev 1627) @@ -8,6 +8,7 @@ import jp.sf.pal.bookmark.db.allcommon.dbmeta.info.ColumnInfo; import jp.sf.pal.bookmark.db.allcommon.dbmeta.info.ForeignInfo; import jp.sf.pal.bookmark.db.allcommon.dbmeta.info.UniqueInfo; +import jp.sf.pal.bookmark.db.allcommon.helper.StringKeyMap; import jp.sf.pal.bookmark.db.exentity.GroupMapping; /** @@ -15,7 +16,6 @@ * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public class GroupMappingDbm extends AbstractDBMeta { private static final GroupMappingDbm _instance = new GroupMappingDbm(); @@ -68,40 +68,14 @@ return _columnGroupId; } - { - initializeColumnInfoList(); - } - //========================================================================== // ========= - // Name Map - // ======== - public Map getDbNamePropertyNameKeyToLowerMap() { - return createDbNamePropertyNameKeyToLowerMap(); + // Resource Initialization + // ======================= + { + initializeInformationResource(); } - public Map getPropertyNameDbNameKeyToLowerMap() { - return createPropertyNameDbNameKeyToLowerMap(); - } - - protected static Map _dbNamePropertyNameKeyToLowerMap; - - protected Map createDbNamePropertyNameKeyToLowerMap() { - if (_dbNamePropertyNameKeyToLowerMap == null) { - _dbNamePropertyNameKeyToLowerMap = setupKeyToLowerMap(true); - } - return _dbNamePropertyNameKeyToLowerMap; - } - - protected static Map _propertyNameDbNameKeyToLowerMap; - - protected Map createPropertyNameDbNameKeyToLowerMap() { - if (_propertyNameDbNameKeyToLowerMap == null) { - _propertyNameDbNameKeyToLowerMap = setupKeyToLowerMap(false); - } - return _propertyNameDbNameKeyToLowerMap; - } - //========================================================================== // ========= // Type Name @@ -263,7 +237,8 @@ // Entity Property Setup // ===================== // It's very INTERNAL! - protected Map> _epsMap = newHashMap(); + protected Map> _epsMap = StringKeyMap + .createAsFlexibleConcurrent(); { setupEps(_epsMap, new EpsId(), columnId()); setupEps(_epsMap, new EpsUserId(), columnUserId()); Modified: bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/bsentity/dbmeta/RoleInfoDbm.java =================================================================== --- bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/bsentity/dbmeta/RoleInfoDbm.java 2008-12-27 22:10:35 UTC (rev 1626) +++ bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/bsentity/dbmeta/RoleInfoDbm.java 2008-12-27 22:11:51 UTC (rev 1627) @@ -8,6 +8,7 @@ import jp.sf.pal.bookmark.db.allcommon.dbmeta.info.ColumnInfo; import jp.sf.pal.bookmark.db.allcommon.dbmeta.info.ReferrerInfo; import jp.sf.pal.bookmark.db.allcommon.dbmeta.info.UniqueInfo; +import jp.sf.pal.bookmark.db.allcommon.helper.StringKeyMap; import jp.sf.pal.bookmark.db.exentity.RoleInfo; /** @@ -15,7 +16,6 @@ * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public class RoleInfoDbm extends AbstractDBMeta { private static final RoleInfoDbm _instance = new RoleInfoDbm(); @@ -138,40 +138,14 @@ return _columnVersionno; } - { - initializeColumnInfoList(); - } - //========================================================================== // ========= - // Name Map - // ======== - public Map getDbNamePropertyNameKeyToLowerMap() { - return createDbNamePropertyNameKeyToLowerMap(); + // Resource Initialization + // ======================= + { + initializeInformationResource(); } - public Map getPropertyNameDbNameKeyToLowerMap() { - return createPropertyNameDbNameKeyToLowerMap(); - } - - protected static Map _dbNamePropertyNameKeyToLowerMap; - - protected Map createDbNamePropertyNameKeyToLowerMap() { - if (_dbNamePropertyNameKeyToLowerMap == null) { - _dbNamePropertyNameKeyToLowerMap = setupKeyToLowerMap(true); - } - return _dbNamePropertyNameKeyToLowerMap; - } - - protected static Map _propertyNameDbNameKeyToLowerMap; - - protected Map createPropertyNameDbNameKeyToLowerMap() { - if (_propertyNameDbNameKeyToLowerMap == null) { - _propertyNameDbNameKeyToLowerMap = setupKeyToLowerMap(false); - } - return _propertyNameDbNameKeyToLowerMap; - } - //========================================================================== // ========= // Type Name @@ -341,7 +315,8 @@ // Entity Property Setup // ===================== // It's very INTERNAL! - protected Map> _epsMap = newHashMap(); + protected Map> _epsMap = StringKeyMap + .createAsFlexibleConcurrent(); { setupEps(_epsMap, new EpsRoleId(), columnRoleId()); setupEps(_epsMap, new EpsName(), columnName()); Modified: bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/bsentity/dbmeta/RoleMappingDbm.java =================================================================== --- bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/bsentity/dbmeta/RoleMappingDbm.java 2008-12-27 22:10:35 UTC (rev 1626) +++ bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/bsentity/dbmeta/RoleMappingDbm.java 2008-12-27 22:11:51 UTC (rev 1627) @@ -8,6 +8,7 @@ import jp.sf.pal.bookmark.db.allcommon.dbmeta.info.ColumnInfo; import jp.sf.pal.bookmark.db.allcommon.dbmeta.info.ForeignInfo; import jp.sf.pal.bookmark.db.allcommon.dbmeta.info.UniqueInfo; +import jp.sf.pal.bookmark.db.allcommon.helper.StringKeyMap; import jp.sf.pal.bookmark.db.exentity.RoleMapping; /** @@ -15,7 +16,6 @@ * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public class RoleMappingDbm extends AbstractDBMeta { private static final RoleMappingDbm _instance = new RoleMappingDbm(); @@ -68,40 +68,14 @@ return _columnRoleId; } - { - initializeColumnInfoList(); - } - //========================================================================== // ========= - // Name Map - // ======== - public Map getDbNamePropertyNameKeyToLowerMap() { - return createDbNamePropertyNameKeyToLowerMap(); + // Resource Initialization + // ======================= + { + initializeInformationResource(); } - public Map getPropertyNameDbNameKeyToLowerMap() { - return createPropertyNameDbNameKeyToLowerMap(); - } - - protected static Map _dbNamePropertyNameKeyToLowerMap; - - protected Map createDbNamePropertyNameKeyToLowerMap() { - if (_dbNamePropertyNameKeyToLowerMap == null) { - _dbNamePropertyNameKeyToLowerMap = setupKeyToLowerMap(true); - } - return _dbNamePropertyNameKeyToLowerMap; - } - - protected static Map _propertyNameDbNameKeyToLowerMap; - - protected Map createPropertyNameDbNameKeyToLowerMap() { - if (_propertyNameDbNameKeyToLowerMap == null) { - _propertyNameDbNameKeyToLowerMap = setupKeyToLowerMap(false); - } - return _propertyNameDbNameKeyToLowerMap; - } - //========================================================================== // ========= // Type Name @@ -263,7 +237,8 @@ // Entity Property Setup // ===================== // It's very INTERNAL! - protected Map> _epsMap = newHashMap(); + protected Map> _epsMap = StringKeyMap + .createAsFlexibleConcurrent(); { setupEps(_epsMap, new EpsId(), columnId()); setupEps(_epsMap, new EpsUserId(), columnUserId()); Modified: bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/bsentity/dbmeta/UserInfoDbm.java =================================================================== --- bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/bsentity/dbmeta/UserInfoDbm.java 2008-12-27 22:10:35 UTC (rev 1626) +++ bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/bsentity/dbmeta/UserInfoDbm.java 2008-12-27 22:11:51 UTC (rev 1627) @@ -9,6 +9,7 @@ import jp.sf.pal.bookmark.db.allcommon.dbmeta.info.ForeignInfo; import jp.sf.pal.bookmark.db.allcommon.dbmeta.info.ReferrerInfo; import jp.sf.pal.bookmark.db.allcommon.dbmeta.info.UniqueInfo; +import jp.sf.pal.bookmark.db.allcommon.helper.StringKeyMap; import jp.sf.pal.bookmark.db.exentity.UserInfo; /** @@ -16,7 +17,6 @@ * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public class UserInfoDbm extends AbstractDBMeta { private static final UserInfoDbm _instance = new UserInfoDbm(); @@ -93,6 +93,9 @@ protected ColumnInfo _columnGroupId = cci("GROUP_ID", "groupId", String.class, false, 255, 0); + protected ColumnInfo _columnStatus = cci("STATUS", "status", String.class, + false, 1, 0); + protected ColumnInfo _columnCreatedTime = cci("CREATED_TIME", "createdTime", java.sql.Timestamp.class, false, null, null); @@ -174,6 +177,10 @@ return _columnGroupId; } + public ColumnInfo columnStatus() { + return _columnStatus; + } + public ColumnInfo columnCreatedTime() { return _columnCreatedTime; } @@ -202,40 +209,14 @@ return _columnVersionno; } - { - initializeColumnInfoList(); - } - //========================================================================== // ========= - // Name Map - // ======== - public Map getDbNamePropertyNameKeyToLowerMap() { - return createDbNamePropertyNameKeyToLowerMap(); + // Resource Initialization + // ======================= + { + initializeInformationResource(); } - public Map getPropertyNameDbNameKeyToLowerMap() { - return createPropertyNameDbNameKeyToLowerMap(); - } - - protected static Map _dbNamePropertyNameKeyToLowerMap; - - protected Map createDbNamePropertyNameKeyToLowerMap() { - if (_dbNamePropertyNameKeyToLowerMap == null) { - _dbNamePropertyNameKeyToLowerMap = setupKeyToLowerMap(true); - } - return _dbNamePropertyNameKeyToLowerMap; - } - - protected static Map _propertyNameDbNameKeyToLowerMap; - - protected Map createPropertyNameDbNameKeyToLowerMap() { - if (_propertyNameDbNameKeyToLowerMap == null) { - _propertyNameDbNameKeyToLowerMap = setupKeyToLowerMap(false); - } - return _propertyNameDbNameKeyToLowerMap; - } - //========================================================================== // ========= // Type Name @@ -445,7 +426,8 @@ // Entity Property Setup // ===================== // It's very INTERNAL! - protected Map> _epsMap = newHashMap(); + protected Map> _epsMap = StringKeyMap + .createAsFlexibleConcurrent(); { setupEps(_epsMap, new EpsUserId(), columnUserId()); setupEps(_epsMap, new EpsGivenName(), columnGivenName()); @@ -462,6 +444,7 @@ setupEps(_epsMap, new EpsLocale(), columnLocale()); setupEps(_epsMap, new EpsRoleId(), columnRoleId()); setupEps(_epsMap, new EpsGroupId(), columnGroupId()); + setupEps(_epsMap, new EpsStatus(), columnStatus()); setupEps(_epsMap, new EpsCreatedTime(), columnCreatedTime()); setupEps(_epsMap, new EpsCreatedBy(), columnCreatedBy()); setupEps(_epsMap, new EpsUpdatedTime(), columnUpdatedTime()); @@ -570,6 +553,12 @@ } } + public static class EpsStatus implements Eps { + public void setup(UserInfo e, Object v) { + e.setStatus((String) v); + } + } + public static class EpsCreatedTime implements Eps { public void setup(UserInfo e, Object v) { e.setCreatedTime((java.sql.Timestamp) v); Modified: bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/cbean/bs/BsBookmarkCategoryCB.java =================================================================== --- bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/cbean/bs/BsBookmarkCategoryCB.java 2008-12-27 22:10:35 UTC (rev 1626) +++ bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/cbean/bs/BsBookmarkCategoryCB.java 2008-12-27 22:11:51 UTC (rev 1627) @@ -19,7 +19,6 @@ * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public class BsBookmarkCategoryCB extends AbstractConditionBean { //========================================================================== @@ -87,7 +86,12 @@ return _conditionQuery; } - public ConditionQuery getConditionQueryAsInterface() { + /** + * The implementation. + * + * @return The conditionQuery of the local table as interface. (NotNull) + */ + public ConditionQuery localCQ() { return getConditionQuery(); } @@ -137,24 +141,6 @@ query().xsetUnionAllQuery(cq); } - /** - * @param unionQuery The query of 'union'. (NotNull) - * @deprecated Sorry! Please use union(UnionQuery - * unionQuery). - */ - public void union(BookmarkCategoryCQ unionQuery) { - query().xsetUnionQuery(unionQuery); - } - - /** - * @param unionQuery The query of 'union'. (NotNull) - * @deprecated Sorry! Please use unionAll(UnionQuery - * unionQuery). - */ - public void unionAll(BookmarkCategoryCQ unionQuery) { - query().xsetUnionAllQuery(unionQuery); - } - public boolean hasUnionQueryOrUnionAllQuery() { return query().hasUnionQueryOrUnionAllQuery(); } @@ -163,7 +149,6 @@ // ========= // Setup Select // ============ - protected UserInfoNss _nssUserInfoByCreatedBy; public UserInfoNss getNssUserInfoByCreatedBy() { @@ -228,7 +213,8 @@ public BookmarkCategoryCQ qy() { return query(); } - }, _forDeriveReferrer); + }, _forDerivedReferrer, _forScalarSelect, + _forScalarSubQuery); } return _specification; } @@ -242,8 +228,10 @@ protected UserInfoCB.Specification _userInfoByUpdatedBy; public Specification(ConditionBean baseCB, - SpQyCall qyCall, boolean forDeriveReferrer) { - super(baseCB, qyCall, forDeriveReferrer); + SpQyCall qyCall, boolean forDeriveReferrer, + boolean forScalarSelect, boolean forScalarSubQuery) { + super(baseCB, qyCall, forDeriveReferrer, forScalarSelect, + forScalarSubQuery); _myQyCall = qyCall; } @@ -312,7 +300,8 @@ public UserInfoCB.Specification specifyUserInfoByCreatedBy() { assertForeign("userInfoByCreatedBy"); if (_userInfoByCreatedBy == null) { - _userInfoByCreatedBy = new UserInfoCB.Specification(_baseCB, + _userInfoByCreatedBy = new UserInfoCB.Specification( + _baseCB, new SpQyCall() { public boolean has() { return _myQyCall.has() @@ -325,7 +314,8 @@ return _myQyCall.qy() .queryUserInfoByCreatedBy(); } - }, _forDeriveReferrer); + }, _forDerivedReferrer, _forScalarSelect, + _forScalarSubQuery); } return _userInfoByCreatedBy; } @@ -333,7 +323,8 @@ public UserInfoCB.Specification specifyUserInfoByUpdatedBy() { assertForeign("userInfoByUpdatedBy"); if (_userInfoByUpdatedBy == null) { - _userInfoByUpdatedBy = new UserInfoCB.Specification(_baseCB, + _userInfoByUpdatedBy = new UserInfoCB.Specification( + _baseCB, new SpQyCall() { public boolean has() { return _myQyCall.has() @@ -346,7 +337,8 @@ return _myQyCall.qy() .queryUserInfoByUpdatedBy(); } - }, _forDeriveReferrer); + }, _forDerivedReferrer, _forScalarSelect, + _forScalarSubQuery); } return _userInfoByUpdatedBy; } Modified: bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/cbean/bs/BsBookmarkLinkCB.java =================================================================== --- bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/cbean/bs/BsBookmarkLinkCB.java 2008-12-27 22:10:35 UTC (rev 1626) +++ bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/cbean/bs/BsBookmarkLinkCB.java 2008-12-27 22:11:51 UTC (rev 1627) @@ -21,7 +21,6 @@ * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public class BsBookmarkLinkCB extends AbstractConditionBean { //========================================================================== @@ -89,7 +88,12 @@ return _conditionQuery; } - public ConditionQuery getConditionQueryAsInterface() { + /** + * The implementation. + * + * @return The conditionQuery of the local table as interface. (NotNull) + */ + public ConditionQuery localCQ() { return getConditionQuery(); } @@ -139,24 +143,6 @@ query().xsetUnionAllQuery(cq); } - /** - * @param unionQuery The query of 'union'. (NotNull) - * @deprecated Sorry! Please use union(UnionQuery - * unionQuery). - */ - public void union(BookmarkLinkCQ unionQuery) { - query().xsetUnionQuery(unionQuery); - } - - /** - * @param unionQuery The query of 'union'. (NotNull) - * @deprecated Sorry! Please use unionAll(UnionQuery - * unionQuery). - */ - public void unionAll(BookmarkLinkCQ unionQuery) { - query().xsetUnionAllQuery(unionQuery); - } - public boolean hasUnionQueryOrUnionAllQuery() { return query().hasUnionQueryOrUnionAllQuery(); } @@ -165,7 +151,6 @@ // ========= // Setup Select // ============ - protected BookmarkCategoryNss _nssBookmarkCategory; public BookmarkCategoryNss getNssBookmarkCategory() { @@ -253,7 +238,8 @@ public BookmarkLinkCQ qy() { return query(); } - }, _forDeriveReferrer); + }, _forDerivedReferrer, _forScalarSelect, + _forScalarSubQuery); } return _specification; } @@ -269,8 +255,10 @@ protected UserInfoCB.Specification _userInfoByUpdatedBy; public Specification(ConditionBean baseCB, - SpQyCall qyCall, boolean forDeriveReferrer) { - super(baseCB, qyCall, forDeriveReferrer); + SpQyCall qyCall, boolean forDeriveReferrer, + boolean forScalarSelect, boolean forScalarSubQuery) { + super(baseCB, qyCall, forDeriveReferrer, forScalarSelect, + forScalarSubQuery); _myQyCall = qyCall; } @@ -351,7 +339,8 @@ assertForeign("bookmarkCategory"); if (_bookmarkCategory == null) { _bookmarkCategory = new BookmarkCategoryCB.Specification( - _baseCB, new SpQyCall() { + _baseCB, + new SpQyCall() { public boolean has() { return _myQyCall.has() && _myQyCall @@ -362,7 +351,8 @@ public BookmarkCategoryCQ qy() { return _myQyCall.qy().queryBookmarkCategory(); } - }, _forDeriveReferrer); + }, _forDerivedReferrer, _forScalarSelect, + _forScalarSubQuery); } return _bookmarkCategory; } @@ -370,7 +360,8 @@ public UserInfoCB.Specification specifyUserInfoByCreatedBy() { assertForeign("userInfoByCreatedBy"); if (_userInfoByCreatedBy == null) { - _userInfoByCreatedBy = new UserInfoCB.Specification(_baseCB, + _userInfoByCreatedBy = new UserInfoCB.Specification( + _baseCB, new SpQyCall() { public boolean has() { return _myQyCall.has() @@ -383,7 +374,8 @@ return _myQyCall.qy() .queryUserInfoByCreatedBy(); } - }, _forDeriveReferrer); + }, _forDerivedReferrer, _forScalarSelect, + _forScalarSubQuery); } return _userInfoByCreatedBy; } @@ -391,7 +383,8 @@ public UserInfoCB.Specification specifyUserInfoByUpdatedBy() { assertForeign("userInfoByUpdatedBy"); if (_userInfoByUpdatedBy == null) { - _userInfoByUpdatedBy = new UserInfoCB.Specification(_baseCB, + _userInfoByUpdatedBy = new UserInfoCB.Specification( + _baseCB, new SpQyCall() { public boolean has() { return _myQyCall.has() @@ -404,7 +397,8 @@ return _myQyCall.qy() .queryUserInfoByUpdatedBy(); } - }, _forDeriveReferrer); + }, _forDerivedReferrer, _forScalarSelect, + _forScalarSubQuery); } return _userInfoByUpdatedBy; } Modified: bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/cbean/bs/BsGroupInfoCB.java =================================================================== --- bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/cbean/bs/BsGroupInfoCB.java 2008-12-27 22:10:35 UTC (rev 1626) +++ bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/cbean/bs/BsGroupInfoCB.java 2008-12-27 22:11:51 UTC (rev 1627) @@ -17,7 +17,6 @@ * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public class BsGroupInfoCB extends AbstractConditionBean { //========================================================================== @@ -86,7 +85,12 @@ return _conditionQuery; } - public ConditionQuery getConditionQueryAsInterface() { + /** + * The implementation. + * + * @return The conditionQuery of the local table as interface. (NotNull) + */ + public ConditionQuery localCQ() { return getConditionQuery(); } @@ -136,23 +140,6 @@ query().xsetUnionAllQuery(cq); } - /** - * @param unionQuery The query of 'union'. (NotNull) - * @deprecated Sorry! Please use union(UnionQuery unionQuery). - */ - public void union(GroupInfoCQ unionQuery) { - query().xsetUnionQuery(unionQuery); - } - - /** - * @param unionQuery The query of 'union'. (NotNull) - * @deprecated Sorry! Please use unionAll(UnionQuery - * unionQuery). - */ - public void unionAll(GroupInfoCQ unionQuery) { - query().xsetUnionAllQuery(unionQuery); - } - public boolean hasUnionQueryOrUnionAllQuery() { return query().hasUnionQueryOrUnionAllQuery(); } @@ -180,7 +167,8 @@ public GroupInfoCQ qy() { return query(); } - }, _forDeriveReferrer); + }, _forDerivedReferrer, _forScalarSelect, + _forScalarSubQuery); } return _specification; } @@ -190,8 +178,10 @@ protected SpQyCall _myQyCall; public Specification(ConditionBean baseCB, - SpQyCall qyCall, boolean forDeriveReferrer) { - super(baseCB, qyCall, forDeriveReferrer); + SpQyCall qyCall, boolean forDeriveReferrer, + boolean forScalarSelect, boolean forScalarSubQuery) { + super(baseCB, qyCall, forDeriveReferrer, forScalarSelect, + forScalarSubQuery); _myQyCall = qyCall; } Modified: bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/cbean/bs/BsGroupMappingCB.java =================================================================== --- bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/cbean/bs/BsGroupMappingCB.java 2008-12-27 22:10:35 UTC (rev 1626) +++ bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/cbean/bs/BsGroupMappingCB.java 2008-12-27 22:11:51 UTC (rev 1627) @@ -21,7 +21,6 @@ * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public class BsGroupMappingCB extends AbstractConditionBean { //========================================================================== @@ -89,7 +88,12 @@ return _conditionQuery; } - public ConditionQuery getConditionQueryAsInterface() { + /** + * The implementation. + * + * @return The conditionQuery of the local table as interface. (NotNull) + */ + public ConditionQuery localCQ() { return getConditionQuery(); } @@ -139,24 +143,6 @@ query().xsetUnionAllQuery(cq); } - /** - * @param unionQuery The query of 'union'. (NotNull) - * @deprecated Sorry! Please use union(UnionQuery - * unionQuery). - */ - public void union(GroupMappingCQ unionQuery) { - query().xsetUnionQuery(unionQuery); - } - - /** - * @param unionQuery The query of 'union'. (NotNull) - * @deprecated Sorry! Please use unionAll(UnionQuery - * unionQuery). - */ - public void unionAll(GroupMappingCQ unionQuery) { - query().xsetUnionAllQuery(unionQuery); - } - public boolean hasUnionQueryOrUnionAllQuery() { return query().hasUnionQueryOrUnionAllQuery(); } @@ -165,7 +151,6 @@ // ========= // Setup Select // ============ - protected GroupInfoNss _nssGroupInfo; public GroupInfoNss getNssGroupInfo() { @@ -226,7 +211,8 @@ public GroupMappingCQ qy() { return query(); } - }, _forDeriveReferrer); + }, _forDerivedReferrer, _forScalarSelect, + _forScalarSubQuery); } return _specification; } @@ -240,8 +226,10 @@ protected UserInfoCB.Specification _userInfo; public Specification(ConditionBean baseCB, - SpQyCall qyCall, boolean forDeriveReferrer) { - super(baseCB, qyCall, forDeriveReferrer); + SpQyCall qyCall, boolean forDeriveReferrer, + boolean forScalarSelect, boolean forScalarSubQuery) { + super(baseCB, qyCall, forDeriveReferrer, forScalarSelect, + forScalarSubQuery); _myQyCall = qyCall; } @@ -285,7 +273,8 @@ public GroupInfoCQ qy() { return _myQyCall.qy().queryGroupInfo(); } - }, _forDeriveReferrer); + }, _forDerivedReferrer, _forScalarSelect, + _forScalarSubQuery); } return _groupInfo; } @@ -304,7 +293,8 @@ public UserInfoCQ qy() { return _myQyCall.qy().queryUserInfo(); } - }, _forDeriveReferrer); + }, _forDerivedReferrer, _forScalarSelect, + _forScalarSubQuery); } return _userInfo; } Modified: bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/cbean/bs/BsRoleInfoCB.java =================================================================== --- bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/cbean/bs/BsRoleInfoCB.java 2008-12-27 22:10:35 UTC (rev 1626) +++ bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/cbean/bs/BsRoleInfoCB.java 2008-12-27 22:11:51 UTC (rev 1627) @@ -17,7 +17,6 @@ * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public class BsRoleInfoCB extends AbstractConditionBean { //========================================================================== @@ -86,7 +85,12 @@ return _conditionQuery; } - public ConditionQuery getConditionQueryAsInterface() { + /** + * The implementation. + * + * @return The conditionQuery of the local table as interface. (NotNull) + */ + public ConditionQuery localCQ() { return getConditionQuery(); } @@ -136,23 +140,6 @@ query().xsetUnionAllQuery(cq); } - /** - * @param unionQuery The query of 'union'. (NotNull) - * @deprecated Sorry! Please use union(UnionQuery unionQuery). - */ - public void union(RoleInfoCQ unionQuery) { - query().xsetUnionQuery(unionQuery); - } - - /** - * @param unionQuery The query of 'union'. (NotNull) - * @deprecated Sorry! Please use unionAll(UnionQuery - * unionQuery). - */ - public void unionAll(RoleInfoCQ unionQuery) { - query().xsetUnionAllQuery(unionQuery); - } - public boolean hasUnionQueryOrUnionAllQuery() { return query().hasUnionQueryOrUnionAllQuery(); } @@ -180,7 +167,8 @@ public RoleInfoCQ qy() { return query(); } - }, _forDeriveReferrer); + }, _forDerivedReferrer, _forScalarSelect, + _forScalarSubQuery); } return _specification; } @@ -189,8 +177,10 @@ protected SpQyCall _myQyCall; public Specification(ConditionBean baseCB, SpQyCall qyCall, - boolean forDeriveReferrer) { - super(baseCB, qyCall, forDeriveReferrer); + boolean forDeriveReferrer, boolean forScalarSelect, + boolean forScalarSubQuery) { + super(baseCB, qyCall, forDeriveReferrer, forScalarSelect, + forScalarSubQuery); _myQyCall = qyCall; } Modified: bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/cbean/bs/BsRoleMappingCB.java =================================================================== --- bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/cbean/bs/BsRoleMappingCB.java 2008-12-27 22:10:35 UTC (rev 1626) +++ bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/cbean/bs/BsRoleMappingCB.java 2008-12-27 22:11:51 UTC (rev 1627) @@ -21,7 +21,6 @@ * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public class BsRoleMappingCB extends AbstractConditionBean { //========================================================================== @@ -89,7 +88,12 @@ return _conditionQuery; } - public ConditionQuery getConditionQueryAsInterface() { + /** + * The implementation. + * + * @return The conditionQuery of the local table as interface. (NotNull) + */ + public ConditionQuery localCQ() { return getConditionQuery(); } @@ -139,24 +143,6 @@ query().xsetUnionAllQuery(cq); } - /** - * @param unionQuery The query of 'union'. (NotNull) - * @deprecated Sorry! Please use union(UnionQuery - * unionQuery). - */ - public void union(RoleMappingCQ unionQuery) { - query().xsetUnionQuery(unionQuery); - } - - /** - * @param unionQuery The query of 'union'. (NotNull) - * @deprecated Sorry! Please use unionAll(UnionQuery - * unionQuery). - */ - public void unionAll(RoleMappingCQ unionQuery) { - query().xsetUnionAllQuery(unionQuery); - } - public boolean hasUnionQueryOrUnionAllQuery() { return query().hasUnionQueryOrUnionAllQuery(); } @@ -165,7 +151,6 @@ // ========= // Setup Select // ============ - protected RoleInfoNss _nssRoleInfo; public RoleInfoNss getNssRoleInfo() { @@ -226,7 +211,8 @@ public RoleMappingCQ qy() { return query(); } - }, _forDeriveReferrer); + }, _forDerivedReferrer, _forScalarSelect, + _forScalarSubQuery); } return _specification; } @@ -240,8 +226,10 @@ protected UserInfoCB.Specification _userInfo; public Specification(ConditionBean baseCB, - SpQyCall qyCall, boolean forDeriveReferrer) { - super(baseCB, qyCall, forDeriveReferrer); + SpQyCall qyCall, boolean forDeriveReferrer, + boolean forScalarSelect, boolean forScalarSubQuery) { + super(baseCB, qyCall, forDeriveReferrer, forScalarSelect, + forScalarSubQuery); _myQyCall = qyCall; } @@ -285,7 +273,8 @@ public RoleInfoCQ qy() { return _myQyCall.qy().queryRoleInfo(); } - }, _forDeriveReferrer); + }, _forDerivedReferrer, _forScalarSelect, + _forScalarSubQuery); } return _roleInfo; } @@ -304,7 +293,8 @@ public UserInfoCQ qy() { return _myQyCall.qy().queryUserInfo(); } - }, _forDeriveReferrer); + }, _forDerivedReferrer, _forScalarSelect, + _forScalarSubQuery); } return _userInfo; } Modified: bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/cbean/bs/BsUserInfoCB.java =================================================================== --- bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/cbean/bs/BsUserInfoCB.java 2008-12-27 22:10:35 UTC (rev 1626) +++ bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/cbean/bs/BsUserInfoCB.java 2008-12-27 22:11:51 UTC (rev 1627) @@ -25,7 +25,6 @@ * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public class BsUserInfoCB extends AbstractConditionBean { //========================================================================== @@ -94,7 +93,12 @@ return _conditionQuery; } - public ConditionQuery getConditionQueryAsInterface() { + /** + * The implementation. + * + * @return The conditionQuery of the local table as interface. (NotNull) + */ + public ConditionQuery localCQ() { return getConditionQuery(); } @@ -144,23 +148,6 @@ query().xsetUnionAllQuery(cq); } - /** - * @param unionQuery The query of 'union'. (NotNull) - * @deprecated Sorry! Please use union(UnionQuery unionQuery). - */ - public void union(UserInfoCQ unionQuery) { - query().xsetUnionQuery(unionQuery); - } - - /** - * @param unionQuery The query of 'union'. (NotNull) - * @deprecated Sorry! Please use unionAll(UnionQuery - * unionQuery). - */ - public void unionAll(UserInfoCQ unionQuery) { - query().xsetUnionAllQuery(unionQuery); - } - public boolean hasUnionQueryOrUnionAllQuery() { return query().hasUnionQueryOrUnionAllQuery(); } @@ -169,7 +156,6 @@ // ========= // Setup Select // ============ - protected GroupInfoNss _nssGroupInfo; public GroupInfoNss getNssGroupInfo() { @@ -230,7 +216,8 @@ public UserInfoCQ qy() { return query(); } - }, _forDeriveReferrer); + }, _forDerivedReferrer, _forScalarSelect, + _forScalarSubQuery); } return _specification; } @@ -243,8 +230,10 @@ protected RoleInfoCB.Specification _roleInfo; public Specification(ConditionBean baseCB, SpQyCall qyCall, - boolean forDeriveReferrer) { - super(baseCB, qyCall, forDeriveReferrer); + boolean forDeriveReferrer, boolean forScalarSelect, + boolean forScalarSubQuery) { + super(baseCB, qyCall, forDeriveReferrer, forScalarSelect, + forScalarSubQuery); _myQyCall = qyCall; } @@ -308,6 +297,10 @@ doColumn("GROUP_ID"); } + public void columnStatus() { + doColumn("STATUS"); + } + public void columnCreatedTime() { doColumn("CREATED_TIME"); } @@ -364,7 +357,8 @@ public GroupInfoCQ qy() { return _myQyCall.qy().queryGroupInfo(); } - }, _forDeriveReferrer); + }, _forDerivedReferrer, _forScalarSelect, + _forScalarSubQuery); } return _groupInfo; } @@ -383,7 +377,8 @@ public RoleInfoCQ qy() { return _myQyCall.qy().queryRoleInfo(); } - }, _forDeriveReferrer); + }, _forDerivedReferrer, _forScalarSelect, + _forScalarSubQuery); } return _roleInfo; } Modified: bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/cbean/cq/bs/AbstractBsBookmarkCategoryCQ.java =================================================================== --- bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/cbean/cq/bs/AbstractBsBookmarkCategoryCQ.java 2008-12-27 22:10:35 UTC (rev 1626) +++ bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/cbean/cq/bs/AbstractBsBookmarkCategoryCQ.java 2008-12-27 22:11:51 UTC (rev 1627) @@ -13,14 +13,12 @@ import jp.sf.pal.bookmark.db.cbean.UserInfoCB; import jp.sf.pal.bookmark.db.cbean.cq.BookmarkCategoryCQ; import jp.sf.pal.bookmark.db.cbean.cq.BookmarkLinkCQ; -import jp.sf.pal.bookmark.db.cbean.cq.UserInfoCQ; /** * The abstract condition-query of BOOKMARK_CATEGORY. * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public abstract class AbstractBsBookmarkCategoryCQ extends AbstractConditionQuery { @@ -51,7 +49,8 @@ // ===== /** - * Equal(=). And NullIgnored, OnceRegistered. {PK : ID : NotNull : INTEGER} + * Equal(=). And NullIgnored, OnlyOnceRegistered. {PK : ID : NotNull : + * INTEGER} * * @param id The value of id as equal. */ @@ -60,7 +59,7 @@ } /** - * NotEqual(!=). And NullIgnored, OnceRegistered. + * NotEqual(!=). And NullIgnored, OnlyOnceRegistered. * * @param id The value of id as notEqual. */ @@ -69,7 +68,7 @@ } /** - * GreaterThan(>). And NullIgnored, OnceRegistered. + * GreaterThan(>). And NullIgnored, OnlyOnceRegistered. * * @param id The value of id as greaterThan. */ @@ -78,7 +77,7 @@ } /** - * LessThan(<). And NullIgnored, OnceRegistered. + * LessThan(<). And NullIgnored, OnlyOnceRegistered. * * @param id The value of id as lessThan. */ @@ -87,7 +86,7 @@ } /** - * GreaterEqual(>=). And NullIgnored, OnceRegistered. + * GreaterEqual(>=). And NullIgnored, OnlyOnceRegistered. * * @param id The value of id as greaterEqual. */ @@ -96,7 +95,7 @@ } /** - * LessEqual(<=). And NullIgnored, OnceRegistered. + * LessEqual(<=). And NullIgnored, OnlyOnceRegistered. * * @param id The value of id as lessEqual. */ @@ -124,34 +123,18 @@ regId(CK_NINS, cTL(idList)); } - /** - * @param bookmarkLinkCBquery Query. - * @deprecated Please use inScopeBookmarkLinkList(subQuery) method. - */ - public void setId_InScopeSubQuery_BookmarkLinkList( - BookmarkLinkCQ bookmarkLinkCBquery) { - String subQueryPropertyName = keepId_InScopeSubQuery_BookmarkLinkList(bookmarkLinkCBquery);// for - // saving - // query - // - - // value - // . - registerInScopeSubQuery(bookmarkLinkCBquery, "ID", "CATEGORY_ID", - subQueryPropertyName); - } - public void inScopeBookmarkLinkList(SubQuery subQuery) { assertObjectNotNull("subQuery", subQuery); BookmarkLinkCB cb = new BookmarkLinkCB(); cb.xsetupForInScopeSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepId_InScopeSubQuery_BookmarkLinkList(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerInScopeSubQuery(cb.query(), "ID", "CATEGORY_ID", subQueryPropertyName); } - abstract public String keepId_InScopeSubQuery_BookmarkLinkList( + public abstract String keepId_InScopeSubQuery_BookmarkLinkList( BookmarkLinkCQ subQuery); public void notInScopeBookmarkLinkList(SubQuery subQuery) { @@ -160,31 +143,15 @@ cb.xsetupForInScopeSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepId_NotInScopeSubQuery_BookmarkLinkList(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerNotInScopeSubQuery(cb.query(), "ID", "CATEGORY_ID", subQueryPropertyName); } - abstract public String keepId_NotInScopeSubQuery_BookmarkLinkList( + public abstract String keepId_NotInScopeSubQuery_BookmarkLinkList( BookmarkLinkCQ subQuery); /** - * @param bookmarkLinkCBquery Query. - * @deprecated Please use existsBookmarkLinkList(subQuery) method. - */ - public void setId_ExistsSubQuery_BookmarkLinkList( - BookmarkLinkCQ bookmarkLinkCBquery) { - String subQueryPropertyName = keepId_ExistsSubQuery_BookmarkLinkList(bookmarkLinkCBquery);// for - // saving - // query - // - - // value - // . - registerExistsSubQuery(bookmarkLinkCBquery, "ID", "CATEGORY_ID", - subQueryPropertyName); - } - - /** * Set up 'exists' sub-query. {exists (select CATEGORY_ID from BOOKMARK_LINK * where ...)} * @@ -197,12 +164,12 @@ cb.xsetupForExistsSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepId_ExistsSubQuery_BookmarkLinkList(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerExistsSubQuery(cb.query(), "ID", "CATEGORY_ID", subQueryPropertyName); } - abstract public String keepId_ExistsSubQuery_BookmarkLinkList( + public abstract String keepId_ExistsSubQuery_BookmarkLinkList( BookmarkLinkCQ subQuery); /** @@ -218,38 +185,38 @@ cb.xsetupForExistsSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepId_NotExistsSubQuery_BookmarkLinkList(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerNotExistsSubQuery(cb.query(), "ID", "CATEGORY_ID", subQueryPropertyName); } - abstract public String keepId_NotExistsSubQuery_BookmarkLinkList( + public abstract String keepId_NotExistsSubQuery_BookmarkLinkList( BookmarkLinkCQ subQuery); public void xderiveBookmarkLinkList(String function, SubQuery subQuery, String aliasName) { assertObjectNotNull("subQuery", subQuery); BookmarkLinkCB cb = new BookmarkLinkCB(); - cb.xsetupForDeriveReferrer(); + cb.xsetupForDerivedReferrer(); subQuery.query(cb); - String subQueryPropertyName = keepId_DeriveSubQuery_BookmarkLinkList(cb - .query());// for saving query-value. - registerDeriveSubQuery(function, cb.query(), "ID", "CATEGORY_ID", - subQueryPropertyName, aliasName); + String subQueryPropertyName = keepId_DerivedReferrer_BookmarkLinkList(cb + .query()); // for saving query-value. + registerDerivedReferrerSubQuery(function, cb.query(), "ID", + "CATEGORY_ID", subQueryPropertyName, aliasName); } - abstract public String keepId_DeriveSubQuery_BookmarkLinkList( + public abstract String keepId_DerivedReferrer_BookmarkLinkList( BookmarkLinkCQ subQuery); /** - * IsNull(is null). And OnceRegistered. + * IsNull(is null). And OnlyOnceRegistered. */ public void setId_IsNull() { regId(CK_ISN, DUMMY_OBJECT); } /** - * IsNotNull(is not null). And OnceRegistered. + * IsNotNull(is not null). And OnlyOnceRegistered. */ public void setId_IsNotNull() { regId(CK_ISNN, DUMMY_OBJECT); @@ -266,7 +233,7 @@ abstract protected ConditionValue getCValueId(); /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {NotNull : + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {NotNull : * VARCHAR(100)} * * @param name The value of name as equal. @@ -276,7 +243,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param name The value of name as notEqual. */ @@ -285,7 +252,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param name The value of name as greaterThan. */ @@ -294,7 +261,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param name The value of name as lessThan. */ @@ -303,7 +270,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param name The value of name as greaterEqual. */ @@ -312,7 +279,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param name The value of name as lessEqual. */ @@ -321,7 +288,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param name The value of name as prefixSearch. */ @@ -330,20 +297,6 @@ } /** - * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, - * SeveralRegistered. - * - * @param name The value of name as likeSearch. - * @param likeSearchOption The option of like-search. (NotNull) - */ - public void setName_LikeSearch( - String name, - jp.sf.pal.bookmark.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { - registerLikeSearchQuery(CK_LS, fRES(name), getCValueName(), "NAME", - "Name", "name", likeSearchOption); - } - - /** * InScope(in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * @@ -354,27 +307,41 @@ } /** - * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * - * @param name The collection of name as inScope. - * @param inScopeOption The option of in-scope. (NotNull) + * @param nameList The collection of name as notInScope. */ - public void setName_InScope( + public void setName_NotInScope(Collection nameList) { + regName(CK_NINS, cTL(nameList)); + } + + /** + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param name The value of name as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) + */ + public void setName_LikeSearch( String name, - jp.sf.pal.bookmark.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(name), getCValueName(), "NAME", - "Name", "name", inScopeOption); + jp.sf.pal.bookmark.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(name), getCValueName(), "NAME", "Name", "name", + likeSearchOption); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param nameList The collection of name as notInScope. + * @param name The value of name as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setName_NotInScope(Collection nameList) { - regName(CK_NINS, cTL(nameList)); + public void setName_NotLikeSearch( + String name, + jp.sf.pal.bookmark.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(name), getCValueName(), "NAME", "Name", "name", + likeSearchOption); } protected void regName(ConditionKey key, Object value) { @@ -388,7 +355,7 @@ abstract protected ConditionValue getCValueName(); /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {VARCHAR(200)} + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {VARCHAR(200)} * * @param memo The value of memo as equal. */ @@ -397,7 +364,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param memo The value of memo as notEqual. */ @@ -406,7 +373,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param memo The value of memo as greaterThan. */ @@ -415,7 +382,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param memo The value of memo as lessThan. */ @@ -424,7 +391,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param memo The value of memo as greaterEqual. */ @@ -433,7 +400,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param memo The value of memo as lessEqual. */ @@ -442,7 +409,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param memo The value of memo as prefixSearch. */ @@ -451,20 +418,6 @@ } /** - * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, - * SeveralRegistered. - * - * @param memo The value of memo as likeSearch. - * @param likeSearchOption The option of like-search. (NotNull) - */ - public void setMemo_LikeSearch( - String memo, - jp.sf.pal.bookmark.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { - registerLikeSearchQuery(CK_LS, fRES(memo), getCValueMemo(), "MEMO", - "Memo", "memo", likeSearchOption); - } - - /** * InScope(in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * @@ -475,38 +428,52 @@ } /** - * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * - * @param memo The collection of memo as inScope. - * @param inScopeOption The option of in-scope. (NotNull) + * @param memoList The collection of memo as notInScope. */ - public void setMemo_InScope( + public void setMemo_NotInScope(Collection memoList) { + regMemo(CK_NINS, cTL(memoList)); + } + + /** + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param memo The value of memo as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) + */ + public void setMemo_LikeSearch( String memo, - jp.sf.pal.bookmark.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(memo), getCValueMemo(), "MEMO", - "Memo", "memo", inScopeOption); + jp.sf.pal.bookmark.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(memo), getCValueMemo(), "MEMO", "Memo", "memo", + likeSearchOption); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param memoList The collection of memo as notInScope. + * @param memo The value of memo as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setMemo_NotInScope(Collection memoList) { - regMemo(CK_NINS, cTL(memoList)); + public void setMemo_NotLikeSearch( + String memo, + jp.sf.pal.bookmark.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(memo), getCValueMemo(), "MEMO", "Memo", "memo", + likeSearchOption); } /** - * IsNull(is null). And OnceRegistered. + * IsNull(is null). And OnlyOnceRegistered. */ public void setMemo_IsNull() { regMemo(CK_ISN, DUMMY_OBJECT); } /** - * IsNotNull(is not null). And OnceRegistered. + * IsNotNull(is not null). And OnlyOnceRegistered. */ public void setMemo_IsNotNull() { regMemo(CK_ISNN, DUMMY_OBJECT); @@ -523,8 +490,8 @@ abstract protected ConditionValue getCValueMemo(); /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {NotNull : VARCHAR(1) : - * Default=[P]} + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {NotNull : + * VARCHAR(1) : Default=[P]} * * @param type The value of type as equal. */ @@ -533,7 +500,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param type The value of type as notEqual. */ @@ -542,7 +509,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param type The value of type as greaterThan. */ @@ -551,7 +518,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param type The value of type as lessThan. */ @@ -560,7 +527,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param type The value of type as greaterEqual. */ @@ -569,7 +536,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param type The value of type as lessEqual. */ @@ -578,7 +545,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param type The value of type as prefixSearch. */ @@ -587,20 +554,6 @@ } /** - * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, - * SeveralRegistered. - * - * @param type The value of type as likeSearch. - * @param likeSearchOption The option of like-search. (NotNull) - */ - public void setType_LikeSearch( - String type, - jp.sf.pal.bookmark.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { - registerLikeSearchQuery(CK_LS, fRES(type), getCValueType(), "TYPE", - "Type", "type", likeSearchOption); - } - - /** * InScope(in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * @@ -611,27 +564,41 @@ } /** - * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * - * @param type The collection of type as inScope. - * @param inScopeOption The option of in-scope. (NotNull) + * @param typeList The collection of type as notInScope. */ - public void setType_InScope( + public void setType_NotInScope(Collection typeList) { + regType(CK_NINS, cTL(typeList)); + } + + /** + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param type The value of type as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) + */ + public void setType_LikeSearch( String type, - jp.sf.pal.bookmark.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(type), getCValueType(), "TYPE", - "Type", "type", inScopeOption); + jp.sf.pal.bookmark.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(type), getCValueType(), "TYPE", "Type", "type", + likeSearchOption); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param typeList The collection of type as notInScope. + * @param type The value of type as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setType_NotInScope(Collection typeList) { - regType(CK_NINS, cTL(typeList)); + public void setType_NotLikeSearch( + String type, + jp.sf.pal.bookmark.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(type), getCValueType(), "TYPE", "Type", "type", + likeSearchOption); } protected void regType(ConditionKey key, Object value) { @@ -645,7 +612,7 @@ abstract protected ConditionValue getCValueType(); /** - * Equal(=). And NullIgnored, OnceRegistered. {NotNull : INTEGER : + * Equal(=). And NullIgnored, OnlyOnceRegistered. {NotNull : INTEGER : * Default=[0]} * * @param sortOrder The value of sortOrder as equal. @@ -655,7 +622,7 @@ } /** - * NotEqual(!=). And NullIgnored, OnceRegistered. + * NotEqual(!=). And NullIgnored, OnlyOnceRegistered. * * @param sortOrder The value of sortOrder as notEqual. */ @@ -664,7 +631,7 @@ } /** - * GreaterThan(>). And NullIgnored, OnceRegistered. + * GreaterThan(>). And NullIgnored, OnlyOnceRegistered. * * @param sortOrder The value of sortOrder as greaterThan. */ @@ -673,7 +640,7 @@ } /** - * LessThan(<). And NullIgnored, OnceRegistered. + * LessThan(<). And NullIgnored, OnlyOnceRegistered. * * @param sortOrder The value of sortOrder as lessThan. */ @@ -682,7 +649,7 @@ } /** - * GreaterEqual(>=). And NullIgnored, OnceRegistered. + * GreaterEqual(>=). And NullIgnored, OnlyOnceRegistered. * * @param sortOrder The value of sortOrder as greaterEqual. */ @@ -691,7 +658,7 @@ } /** - * LessEqual(<=). And NullIgnored, OnceRegistered. + * LessEqual(<=). And NullIgnored, OnlyOnceRegistered. * * @param sortOrder The value of sortOrder as lessEqual. */ @@ -732,7 +699,7 @@ abstract protected ConditionValue getCValueSortOrder(); /** - * Equal(=). And NullIgnored, OnceRegistered. {NotNull : TIMESTAMP} + * Equal(=). And NullIgnored, OnlyOnceRegistered. {NotNull : TIMESTAMP} * * @param createdTime The value of createdTime as equal. */ @@ -741,7 +708,7 @@ } /** - * NotEqual(!=). And NullIgnored, OnceRegistered. + * NotEqual(!=). And NullIgnored, OnlyOnceRegistered. * * @param createdTime The value of createdTime as notEqual. */ @@ -750,7 +717,7 @@ } /** - * GreaterThan(>). And NullIgnored, OnceRegistered. + * GreaterThan(>). And NullIgnored, OnlyOnceRegistered. * * @param createdTime The value of createdTime as greaterThan. */ @@ -759,7 +726,7 @@ } /** - * LessThan(>). And NullIgnored, OnceRegistered. + * LessThan(>). And NullIgnored, OnlyOnceRegistered. * * @param createdTime The value of createdTime as lessThan. */ @@ -768,7 +735,7 @@ } /** - * GreaterEqual(>). And NullIgnored, OnceRegistered. + * GreaterEqual(>). And NullIgnored, OnlyOnceRegistered. * * @param createdTime The value of createdTime as greaterEqual. */ @@ -777,7 +744,7 @@ } /** - * LessEqual(>). And NullIgnored, OnceRegistered. + * LessEqual(>). And NullIgnored, OnlyOnceRegistered. * * @param createdTime The value of createdTime as lessEqual. */ @@ -787,7 +754,7 @@ /** * FromTo($fromDate <= COLUMN_NAME <= $toDate). And NullIgnored, - * OnceRegistered. {NotNull : TIMESTAMP} + * OnlyOnceRegistered. {NotNull : TIMESTAMP} * * @param fromDate The from-date of createdTime. (Nullable) * @param toDate The to-date of createdTime. (Nullable) @@ -805,7 +772,7 @@ /** * FromTo($fromDate <= COLUMN_NAME < $toDate + 1). And NullIgnored, - * OnceRegistered. {NotNull : TIMESTAMP} + * OnlyOnceRegistered. {NotNull : TIMESTAMP} * * @param fromDate The from-date of createdTime. (Nullable) * @param toDate The to-date of createdTime. (Nullable) @@ -831,8 +798,8 @@ abstract protected ConditionValue getCValueCreatedTime(); /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {NotNull : VARCHAR(255) - * : FK to USER_INFO} + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {NotNull : + * VARCHAR(255) : FK to USER_INFO} * * @param createdBy The value of createdBy as equal. */ @@ -841,7 +808,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param createdBy The value of createdBy as notEqual. */ @@ -850,7 +817,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param createdBy The value of createdBy as greaterThan. */ @@ -859,7 +826,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param createdBy The value of createdBy as lessThan. */ @@ -868,7 +835,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param createdBy The value of createdBy as greaterEqual. */ @@ -877,7 +844,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param createdBy The value of createdBy as lessEqual. */ @@ -886,7 +853,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param createdBy The value of createdBy as prefixSearch. */ @@ -895,20 +862,6 @@ } /** - * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, - * SeveralRegistered. - * - * @param createdBy The value of createdBy as likeSearch. - * @param likeSearchOption The option of like-search. (NotNull) - */ - public void setCreatedBy_LikeSearch( - String createdBy, - jp.sf.pal.bookmark.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. * @@ -919,43 +872,41 @@ } /** - * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * - * @param createdBy The collection of createdBy as inScope. - * @param inScopeOption The option of in-scope. (NotNull) + * @param createdByList The collection of createdBy as notInScope. */ - public void setCreatedBy_InScope( - String createdBy, - jp.sf.pal.bookmark.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(createdBy), getCValueCreatedBy(), - "CREATED_BY", "CreatedBy", "createdBy", inScopeOption); + public void setCreatedBy_NotInScope(Collection createdByList) { + regCreatedBy(CK_NINS, cTL(createdByList)); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param createdByList The collection of createdBy as notInScope. + * @param createdBy The value of createdBy as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) */ - public void setCreatedBy_NotInScope(Collection createdByList) { - regCreatedBy(CK_NINS, cTL(createdByList)); + public void setCreatedBy_LikeSearch( + String createdBy, + jp.sf.pal.bookmark.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(createdBy), getCValueCreatedBy(), "CREATED_BY", + "CreatedBy", "createdBy", likeSearchOption); } /** - * @param userInfoCBquery Query. - * @deprecated Please use inScopeUserInfoByCreatedBy(subQuery) method. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param createdBy The value of createdBy as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setCreatedBy_InScopeSubQuery_UserInfoByCreatedBy( - UserInfoCQ userInfoCBquery) { - String subQueryPropertyName = keepCreatedBy_InScopeSubQuery_UserInfoByCreatedBy(userInfoCBquery);// for - // saving - // query - // - - // value - // . - registerInScopeSubQuery(userInfoCBquery, "CREATED_BY", "USER_ID", - subQueryPropertyName); + public void setCreatedBy_NotLikeSearch( + String createdBy, + jp.sf.pal.bookmark.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(createdBy), getCValueCreatedBy(), "CREATED_BY", + "CreatedBy", "createdBy", likeSearchOption); } public void inScopeUserInfoByCreatedBy(SubQuery subQuery) { @@ -964,12 +915,12 @@ cb.xsetupForInScopeSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepCreatedBy_InScopeSubQuery_UserInfoByCreatedBy(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerInScopeSubQuery(cb.query(), "CREATED_BY", "USER_ID", subQueryPropertyName); } - abstract public String keepCreatedBy_InScopeSubQuery_UserInfoByCreatedBy( + public abstract String keepCreatedBy_InScopeSubQuery_UserInfoByCreatedBy( jp.sf.pal.bookmark.db.cbean.cq.UserInfoCQ subQuery); protected void regCreatedBy(ConditionKey key, Object value) { @@ -985,7 +936,7 @@ abstract protected ConditionValue getCValueCreatedBy(); /** - * Equal(=). And NullIgnored, OnceRegistered. {NotNull : TIMESTAMP} + * Equal(=). And NullIgnored, OnlyOnceRegistered. {NotNull : TIMESTAMP} * * @param updatedTime The value of updatedTime as equal. */ @@ -994,7 +945,7 @@ } /** - * NotEqual(!=). And NullIgnored, OnceRegistered. + * NotEqual(!=). And NullIgnored, OnlyOnceRegistered. * * @param updatedTime The value of updatedTime as notEqual. */ @@ -1003,7 +954,7 @@ } /** - * GreaterThan(>). And NullIgnored, OnceRegistered. + * GreaterThan(>). And NullIgnored, OnlyOnceRegistered. * * @param updatedTime The value of updatedTime as greaterThan. */ @@ -1012,7 +963,7 @@ } /** - * LessThan(>). And NullIgnored, OnceRegistered. + * LessThan(>). And NullIgnored, OnlyOnceRegistered. * * @param updatedTime The value of updatedTime as lessThan. */ @@ -1021,7 +972,7 @@ } /** - * GreaterEqual(>). And NullIgnored, OnceRegistered. + * GreaterEqual(>). And NullIgnored, OnlyOnceRegistered. * * @param updatedTime The value of updatedTime as greaterEqual. */ @@ -1030,7 +981,7 @@ } /** - * LessEqual(>). And NullIgnored, OnceRegistered. + * LessEqual(>). And NullIgnored, OnlyOnceRegistered. * * @param updatedTime The value of updatedTime as lessEqual. */ @@ -1040,7 +991,7 @@ /** * FromTo($fromDate <= COLUMN_NAME <= $toDate). And NullIgnored, - * OnceRegistered. {NotNull : TIMESTAMP} + * OnlyOnceRegistered. {NotNull : TIMESTAMP} * * @param fromDate The from-date of updatedTime. (Nullable) * @param toDate The to-date of updatedTime. (Nullable) @@ -1058,7 +1009,7 @@ /** * FromTo($fromDate <= COLUMN_NAME < $toDate + 1). And NullIgnored, - * OnceRegistered. {NotNull : TIMESTAMP} + * OnlyOnceRegistered. {NotNull : TIMESTAMP} * * @param fromDate The from-date of updatedTime. (Nullable) * @param toDate The to-date of updatedTime. (Nullable) @@ -1084,8 +1035,8 @@ abstract protected ConditionValue getCValueUpdatedTime(); /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {NotNull : VARCHAR(255) - * : FK to USER_INFO} + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {NotNull : + * VARCHAR(255) : FK to USER_INFO} * * @param updatedBy The value of updatedBy as equal. */ @@ -1094,7 +1045,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param updatedBy The value of updatedBy as notEqual. */ @@ -1103,7 +1054,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param updatedBy The value of updatedBy as greaterThan. */ @@ -1112,7 +1063,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param updatedBy The value of updatedBy as lessThan. */ @@ -1121,7 +1072,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param updatedBy The value of updatedBy as greaterEqual. */ @@ -1130,7 +1081,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param updatedBy The value of updatedBy as lessEqual. */ @@ -1139,7 +1090,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param updatedBy The value of updatedBy as prefixSearch. */ @@ -1148,20 +1099,6 @@ } /** - * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, - * SeveralRegistered. - * - * @param updatedBy The value of updatedBy as likeSearch. - * @param likeSearchOption The option of like-search. (NotNull) - */ - public void setUpdatedBy_LikeSearch( - String updatedBy, - jp.sf.pal.bookmark.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. * @@ -1172,43 +1109,41 @@ } /** - * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * - * @param updatedBy The collection of updatedBy as inScope. - * @param inScopeOption The option of in-scope. (NotNull) + * @param updatedByList The collection of updatedBy as notInScope. */ - public void setUpdatedBy_InScope( - String updatedBy, - jp.sf.pal.bookmark.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(updatedBy), getCValueUpdatedBy(), - "UPDATED_BY", "UpdatedBy", "updatedBy", inScopeOption); + public void setUpdatedBy_NotInScope(Collection updatedByList) { + regUpdatedBy(CK_NINS, cTL(updatedByList)); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param updatedByList The collection of updatedBy as notInScope. + * @param updatedBy The value of updatedBy as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) */ - public void setUpdatedBy_NotInScope(Collection updatedByList) { - regUpdatedBy(CK_NINS, cTL(updatedByList)); + public void setUpdatedBy_LikeSearch( + String updatedBy, + jp.sf.pal.bookmark.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(updatedBy), getCValueUpdatedBy(), "UPDATED_BY", + "UpdatedBy", "updatedBy", likeSearchOption); } /** - * @param userInfoCBquery Query. - * @deprecated Please use inScopeUserInfoByUpdatedBy(subQuery) method. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param updatedBy The value of updatedBy as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setUpdatedBy_InScopeSubQuery_UserInfoByUpdatedBy( - UserInfoCQ userInfoCBquery) { - String subQueryPropertyName = keepUpdatedBy_InScopeSubQuery_UserInfoByUpdatedBy(userInfoCBquery);// for - // saving - // query - // - - // value - // . - registerInScopeSubQuery(userInfoCBquery, "UPDATED_BY", "USER_ID", - subQueryPropertyName); + public void setUpdatedBy_NotLikeSearch( + String updatedBy, + jp.sf.pal.bookmark.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(updatedBy), getCValueUpdatedBy(), "UPDATED_BY", + "UpdatedBy", "updatedBy", likeSearchOption); } public void inScopeUserInfoByUpdatedBy(SubQuery subQuery) { @@ -1217,12 +1152,12 @@ cb.xsetupForInScopeSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepUpdatedBy_InScopeSubQuery_UserInfoByUpdatedBy(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerInScopeSubQuery(cb.query(), "UPDATED_BY", "USER_ID", subQueryPropertyName); } - abstract public String keepUpdatedBy_InScopeSubQuery_UserInfoByUpdatedBy( + public abstract String keepUpdatedBy_InScopeSubQuery_UserInfoByUpdatedBy( jp.sf.pal.bookmark.db.cbean.cq.UserInfoCQ subQuery); protected void regUpdatedBy(ConditionKey key, Object value) { @@ -1238,7 +1173,7 @@ abstract protected ConditionValue getCValueUpdatedBy(); /** - * Equal(=). And NullIgnored, OnceRegistered. {TIMESTAMP} + * Equal(=). And NullIgnored, OnlyOnceRegistered. {TIMESTAMP} * * @param deletedTime The value of deletedTime as equal. */ @@ -1247,7 +1182,7 @@ } /** - * NotEqual(!=). And NullIgnored, OnceRegistered. + * NotEqual(!=). And NullIgnored, OnlyOnceRegistered. * * @param deletedTime The value of deletedTime as notEqual. */ @@ -1256,7 +1191,7 @@ } /** - * GreaterThan(>). And NullIgnored, OnceRegistered. + * GreaterThan(>). And NullIgnored, OnlyOnceRegistered. * * @param deletedTime The value of deletedTime as greaterThan. */ @@ -1265,7 +1200,7 @@ } /** - * LessThan(>). And NullIgnored, OnceRegistered. + * LessThan(>). And NullIgnored, OnlyOnceRegistered. * * @param deletedTime The value of deletedTime as lessThan. */ @@ -1274,7 +1209,7 @@ } /** - * GreaterEqual(>). And NullIgnored, OnceRegistered. + * GreaterEqual(>). And NullIgnored, OnlyOnceRegistered. * * @param deletedTime The value of deletedTime as greaterEqual. */ @@ -1283,7 +1218,7 @@ } /** - * LessEqual(>). And NullIgnored, OnceRegistered. + * LessEqual(>). And NullIgnored, OnlyOnceRegistered. * * @param deletedTime The value of deletedTime as lessEqual. */ @@ -1293,7 +1228,7 @@ /** * FromTo($fromDate <= COLUMN_NAME <= $toDate). And NullIgnored, - * OnceRegistered. {TIMESTAMP} + * OnlyOnceRegistered. {TIMESTAMP} * * @param fromDate The from-date of deletedTime. (Nullable) * @param toDate The to-date of deletedTime. (Nullable) @@ -1311,7 +1246,7 @@ /** * FromTo($fromDate <= COLUMN_NAME < $toDate + 1). And NullIgnored, - * OnceRegistered. {TIMESTAMP} + * OnlyOnceRegistered. {TIMESTAMP} * * @param fromDate The from-date of deletedTime. (Nullable) * @param toDate The to-date of deletedTime. (Nullable) @@ -1325,14 +1260,14 @@ } /** - * IsNull(is null). And OnceRegistered. + * IsNull(is null). And OnlyOnceRegistered. */ public void setDeletedTime_IsNull() { regDeletedTime(CK_ISN, DUMMY_OBJECT); } /** - * IsNotNull(is not null). And OnceRegistered. + * IsNotNull(is not null). And OnlyOnceRegistered. */ public void setDeletedTime_IsNotNull() { regDeletedTime(CK_ISNN, DUMMY_OBJECT); @@ -1351,7 +1286,7 @@ abstract protected ConditionValue getCValueDeletedTime(); /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {VARCHAR(255)} + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {VARCHAR(255)} * * @param deletedBy The value of deletedBy as equal. */ @@ -1360,7 +1295,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param deletedBy The value of deletedBy as notEqual. */ @@ -1369,7 +1304,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param deletedBy The value of deletedBy as greaterThan. */ @@ -1378,7 +1313,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param deletedBy The value of deletedBy as lessThan. */ @@ -1387,7 +1322,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param deletedBy The value of deletedBy as greaterEqual. */ @@ -1396,7 +1331,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param deletedBy The value of deletedBy as lessEqual. */ @@ -1405,7 +1340,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param deletedBy The value of deletedBy as prefixSearch. */ @@ -1414,20 +1349,6 @@ } /** - * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, - * SeveralRegistered. - * - * @param deletedBy The value of deletedBy as likeSearch. - * @param likeSearchOption The option of like-search. (NotNull) - */ - public void setDeletedBy_LikeSearch( - String deletedBy, - jp.sf.pal.bookmark.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. * @@ -1438,38 +1359,52 @@ } /** - * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * - * @param deletedBy The collection of deletedBy as inScope. - * @param inScopeOption The option of in-scope. (NotNull) + * @param deletedByList The collection of deletedBy as notInScope. */ - public void setDeletedBy_InScope( + public void setDeletedBy_NotInScope(Collection deletedByList) { + regDeletedBy(CK_NINS, cTL(deletedByList)); + } + + /** + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param deletedBy The value of deletedBy as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) + */ + public void setDeletedBy_LikeSearch( String deletedBy, - jp.sf.pal.bookmark.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(deletedBy), getCValueDeletedBy(), - "DELETED_BY", "DeletedBy", "deletedBy", inScopeOption); + jp.sf.pal.bookmark.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(deletedBy), getCValueDeletedBy(), "DELETED_BY", + "DeletedBy", "deletedBy", likeSearchOption); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param deletedByList The collection of deletedBy as notInScope. + * @param deletedBy The value of deletedBy as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setDeletedBy_NotInScope(Collection deletedByList) { - regDeletedBy(CK_NINS, cTL(deletedByList)); + public void setDeletedBy_NotLikeSearch( + String deletedBy, + jp.sf.pal.bookmark.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(deletedBy), getCValueDeletedBy(), "DELETED_BY", + "DeletedBy", "deletedBy", likeSearchOption); } /** - * IsNull(is null). And OnceRegistered. + * IsNull(is null). And OnlyOnceRegistered. */ public void setDeletedBy_IsNull() { regDeletedBy(CK_ISN, DUMMY_OBJECT); } /** - * IsNotNull(is not null). And OnceRegistered. + * IsNotNull(is not null). And OnlyOnceRegistered. */ public void setDeletedBy_IsNotNull() { regDeletedBy(CK_ISNN, DUMMY_OBJECT); @@ -1488,7 +1423,7 @@ abstract protected ConditionValue getCValueDeletedBy(); /** - * Equal(=). And NullIgnored, OnceRegistered. {NotNull : INTEGER : + * Equal(=). And NullIgnored, OnlyOnceRegistered. {NotNull : INTEGER : * Default=[0]} * * @param versionno The value of versionno as equal. @@ -1498,7 +1433,7 @@ } /** - * NotEqual(!=). And NullIgnored, OnceRegistered. + * NotEqual(!=). And NullIgnored, OnlyOnceRegistered. * * @param versionno The value of versionno as notEqual. */ @@ -1507,7 +1442,7 @@ } /** - * GreaterThan(>). And NullIgnored, OnceRegistered. + * GreaterThan(>). And NullIgnored, OnlyOnceRegistered. * * @param versionno The value of versionno as greaterThan. */ @@ -1516,7 +1451,7 @@ } /** - * LessThan(<). And NullIgnored, OnceRegistered. + * LessThan(<). And NullIgnored, OnlyOnceRegistered. * * @param versionno The value of versionno as lessThan. */ @@ -1525,7 +1460,7 @@ } /** - * GreaterEqual(>=). And NullIgnored, OnceRegistered. + * GreaterEqual(>=). And NullIgnored, OnlyOnceRegistered. * * @param versionno The value of versionno as greaterEqual. */ @@ -1534,7 +1469,7 @@ } /** - * LessEqual(<=). And NullIgnored, OnceRegistered. + * LessEqual(<=). And NullIgnored, OnlyOnceRegistered. * * @param versionno The value of versionno as lessEqual. */ @@ -1574,6 +1509,53 @@ abstract protected ConditionValue getCValueVersionno(); + public SSQFunction scalar_Equal() { + return xcreateSSQFunction("="); + } + + public SSQFunction scalar_GreaterEqual() { + return xcreateSSQFunction(">="); + } + + public SSQFunction scalar_GreaterThan() { + return xcreateSSQFunction(">"); + } + + public SSQFunction scalar_LessEqual() { + return xcreateSSQFunction("<="); + } + + public SSQFunction scalar_LessThan() { + return xcreateSSQFunction("<"); + } + + protected SSQFunction xcreateSSQFunction( + final String operand) { + return new SSQFunction( + new SSQSetupper() { + public void setup(String function, + SubQuery subQuery) { + xscalarSubQuery(function, subQuery, operand); + } + }); + } + + protected void xscalarSubQuery(String function, + SubQuery subQuery, String operand) { + assertObjectNotNull("subQuery", subQuery); + BookmarkCategoryCB cb = new BookmarkCategoryCB(); + cb.xsetupForScalarSubQuery(); + subQuery.query(cb); + String subQueryPropertyName = keepScalarSubQuery(cb.query()); // for + // saving + // query + // -value. + registerScalarSubQuery(function, cb.query(), subQueryPropertyName, + operand); + } + + public abstract String keepScalarSubQuery(BookmarkCategoryCQ subQuery); + // Very Internal (for Suppressing Warn about 'Not Use Import') protected String getConditionBeanClassNameInternally() { return BookmarkCategoryCB.class.getName(); Modified: bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/cbean/cq/bs/AbstractBsBookmarkLinkCQ.java =================================================================== --- bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/cbean/cq/bs/AbstractBsBookmarkLinkCQ.java 2008-12-27 22:10:35 UTC (rev 1626) +++ bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/cbean/cq/bs/AbstractBsBookmarkLinkCQ.java 2008-12-27 22:11:51 UTC (rev 1627) @@ -13,14 +13,12 @@ import jp.sf.pal.bookmark.db.cbean.UserInfoCB; import jp.sf.pal.bookmark.db.cbean.cq.BookmarkCategoryCQ; import jp.sf.pal.bookmark.db.cbean.cq.BookmarkLinkCQ; -import jp.sf.pal.bookmark.db.cbean.cq.UserInfoCQ; /** * The abstract condition-query of BOOKMARK_LINK. * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public abstract class AbstractBsBookmarkLinkCQ extends AbstractConditionQuery { //========================================================================== @@ -50,7 +48,8 @@ // ===== /** - * Equal(=). And NullIgnored, OnceRegistered. {PK : ID : NotNull : BIGINT} + * Equal(=). And NullIgnored, OnlyOnceRegistered. {PK : ID : NotNull : + * BIGINT} * * @param id The value of id as equal. */ @@ -59,7 +58,7 @@ } /** - * NotEqual(!=). And NullIgnored, OnceRegistered. + * NotEqual(!=). And NullIgnored, OnlyOnceRegistered. * * @param id The value of id as notEqual. */ @@ -68,7 +67,7 @@ } /** - * GreaterThan(>). And NullIgnored, OnceRegistered. + * GreaterThan(>). And NullIgnored, OnlyOnceRegistered. * * @param id The value of id as greaterThan. */ @@ -77,7 +76,7 @@ } /** - * LessThan(<). And NullIgnored, OnceRegistered. + * LessThan(<). And NullIgnored, OnlyOnceRegistered. * * @param id The value of id as lessThan. */ @@ -86,7 +85,7 @@ } /** - * GreaterEqual(>=). And NullIgnored, OnceRegistered. + * GreaterEqual(>=). And NullIgnored, OnlyOnceRegistered. * * @param id The value of id as greaterEqual. */ @@ -95,7 +94,7 @@ } /** - * LessEqual(<=). And NullIgnored, OnceRegistered. + * LessEqual(<=). And NullIgnored, OnlyOnceRegistered. * * @param id The value of id as lessEqual. */ @@ -124,14 +123,14 @@ } /** - * IsNull(is null). And OnceRegistered. + * IsNull(is null). And OnlyOnceRegistered. */ public void setId_IsNull() { regId(CK_ISN, DUMMY_OBJECT); } /** - * IsNotNull(is not null). And OnceRegistered. + * IsNotNull(is not null). And OnlyOnceRegistered. */ public void setId_IsNotNull() { regId(CK_ISNN, DUMMY_OBJECT); @@ -148,7 +147,7 @@ abstract protected ConditionValue getCValueId(); /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {NotNull : + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {NotNull : * VARCHAR(100)} * * @param name The value of name as equal. @@ -158,7 +157,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param name The value of name as notEqual. */ @@ -167,7 +166,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param name The value of name as greaterThan. */ @@ -176,7 +175,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param name The value of name as lessThan. */ @@ -185,7 +184,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param name The value of name as greaterEqual. */ @@ -194,7 +193,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param name The value of name as lessEqual. */ @@ -203,7 +202,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param name The value of name as prefixSearch. */ @@ -212,20 +211,6 @@ } /** - * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, - * SeveralRegistered. - * - * @param name The value of name as likeSearch. - * @param likeSearchOption The option of like-search. (NotNull) - */ - public void setName_LikeSearch( - String name, - jp.sf.pal.bookmark.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { - registerLikeSearchQuery(CK_LS, fRES(name), getCValueName(), "NAME", - "Name", "name", likeSearchOption); - } - - /** * InScope(in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * @@ -236,27 +221,41 @@ } /** - * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * - * @param name The collection of name as inScope. - * @param inScopeOption The option of in-scope. (NotNull) + * @param nameList The collection of name as notInScope. */ - public void setName_InScope( + public void setName_NotInScope(Collection nameList) { + regName(CK_NINS, cTL(nameList)); + } + + /** + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param name The value of name as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) + */ + public void setName_LikeSearch( String name, - jp.sf.pal.bookmark.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(name), getCValueName(), "NAME", - "Name", "name", inScopeOption); + jp.sf.pal.bookmark.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(name), getCValueName(), "NAME", "Name", "name", + likeSearchOption); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param nameList The collection of name as notInScope. + * @param name The value of name as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setName_NotInScope(Collection nameList) { - regName(CK_NINS, cTL(nameList)); + public void setName_NotLikeSearch( + String name, + jp.sf.pal.bookmark.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(name), getCValueName(), "NAME", "Name", "name", + likeSearchOption); } protected void regName(ConditionKey key, Object value) { @@ -270,7 +269,7 @@ abstract protected ConditionValue getCValueName(); /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {VARCHAR(200)} + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {VARCHAR(200)} * * @param memo The value of memo as equal. */ @@ -279,7 +278,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param memo The value of memo as notEqual. */ @@ -288,7 +287,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param memo The value of memo as greaterThan. */ @@ -297,7 +296,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param memo The value of memo as lessThan. */ @@ -306,7 +305,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param memo The value of memo as greaterEqual. */ @@ -315,7 +314,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param memo The value of memo as lessEqual. */ @@ -324,7 +323,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param memo The value of memo as prefixSearch. */ @@ -333,20 +332,6 @@ } /** - * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, - * SeveralRegistered. - * - * @param memo The value of memo as likeSearch. - * @param likeSearchOption The option of like-search. (NotNull) - */ - public void setMemo_LikeSearch( - String memo, - jp.sf.pal.bookmark.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { - registerLikeSearchQuery(CK_LS, fRES(memo), getCValueMemo(), "MEMO", - "Memo", "memo", likeSearchOption); - } - - /** * InScope(in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * @@ -357,38 +342,52 @@ } /** - * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * - * @param memo The collection of memo as inScope. - * @param inScopeOption The option of in-scope. (NotNull) + * @param memoList The collection of memo as notInScope. */ - public void setMemo_InScope( + public void setMemo_NotInScope(Collection memoList) { + regMemo(CK_NINS, cTL(memoList)); + } + + /** + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param memo The value of memo as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) + */ + public void setMemo_LikeSearch( String memo, - jp.sf.pal.bookmark.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(memo), getCValueMemo(), "MEMO", - "Memo", "memo", inScopeOption); + jp.sf.pal.bookmark.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(memo), getCValueMemo(), "MEMO", "Memo", "memo", + likeSearchOption); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param memoList The collection of memo as notInScope. + * @param memo The value of memo as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setMemo_NotInScope(Collection memoList) { - regMemo(CK_NINS, cTL(memoList)); + public void setMemo_NotLikeSearch( + String memo, + jp.sf.pal.bookmark.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(memo), getCValueMemo(), "MEMO", "Memo", "memo", + likeSearchOption); } /** - * IsNull(is null). And OnceRegistered. + * IsNull(is null). And OnlyOnceRegistered. */ public void setMemo_IsNull() { regMemo(CK_ISN, DUMMY_OBJECT); } /** - * IsNotNull(is not null). And OnceRegistered. + * IsNotNull(is not null). And OnlyOnceRegistered. */ public void setMemo_IsNotNull() { regMemo(CK_ISNN, DUMMY_OBJECT); @@ -405,8 +404,8 @@ abstract protected ConditionValue getCValueMemo(); /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {NotNull : VARCHAR(255) - * : Default=[E]} + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {NotNull : + * VARCHAR(255) : Default=[E]} * * @param url The value of url as equal. */ @@ -415,7 +414,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param url The value of url as notEqual. */ @@ -424,7 +423,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param url The value of url as greaterThan. */ @@ -433,7 +432,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param url The value of url as lessThan. */ @@ -442,7 +441,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param url The value of url as greaterEqual. */ @@ -451,7 +450,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param url The value of url as lessEqual. */ @@ -460,7 +459,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param url The value of url as prefixSearch. */ @@ -469,20 +468,6 @@ } /** - * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, - * SeveralRegistered. - * - * @param url The value of url as likeSearch. - * @param likeSearchOption The option of like-search. (NotNull) - */ - public void setUrl_LikeSearch( - String url, - jp.sf.pal.bookmark.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { - registerLikeSearchQuery(CK_LS, fRES(url), getCValueUrl(), "URL", "Url", - "url", likeSearchOption); - } - - /** * InScope(in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * @@ -493,27 +478,41 @@ } /** - * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * - * @param url The collection of url as inScope. - * @param inScopeOption The option of in-scope. (NotNull) + * @param urlList The collection of url as notInScope. */ - public void setUrl_InScope( + public void setUrl_NotInScope(Collection urlList) { + regUrl(CK_NINS, cTL(urlList)); + } + + /** + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param url The value of url as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) + */ + public void setUrl_LikeSearch( String url, - jp.sf.pal.bookmark.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(url), getCValueUrl(), "URL", "Url", - "url", inScopeOption); + jp.sf.pal.bookmark.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(url), getCValueUrl(), "URL", "Url", "url", + likeSearchOption); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param urlList The collection of url as notInScope. + * @param url The value of url as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setUrl_NotInScope(Collection urlList) { - regUrl(CK_NINS, cTL(urlList)); + public void setUrl_NotLikeSearch( + String url, + jp.sf.pal.bookmark.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(url), getCValueUrl(), "URL", "Url", "url", + likeSearchOption); } protected void regUrl(ConditionKey key, Object value) { @@ -527,7 +526,8 @@ abstract protected ConditionValue getCValueUrl(); /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {NotNull : VARCHAR(1)} + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {NotNull : + * VARCHAR(1)} * * @param type The value of type as equal. */ @@ -536,7 +536,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param type The value of type as notEqual. */ @@ -545,7 +545,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param type The value of type as greaterThan. */ @@ -554,7 +554,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param type The value of type as lessThan. */ @@ -563,7 +563,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param type The value of type as greaterEqual. */ @@ -572,7 +572,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param type The value of type as lessEqual. */ @@ -581,7 +581,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param type The value of type as prefixSearch. */ @@ -590,20 +590,6 @@ } /** - * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, - * SeveralRegistered. - * - * @param type The value of type as likeSearch. - * @param likeSearchOption The option of like-search. (NotNull) - */ - public void setType_LikeSearch( - String type, - jp.sf.pal.bookmark.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { - registerLikeSearchQuery(CK_LS, fRES(type), getCValueType(), "TYPE", - "Type", "type", likeSearchOption); - } - - /** * InScope(in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * @@ -614,27 +600,41 @@ } /** - * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * - * @param type The collection of type as inScope. - * @param inScopeOption The option of in-scope. (NotNull) + * @param typeList The collection of type as notInScope. */ - public void setType_InScope( + public void setType_NotInScope(Collection typeList) { + regType(CK_NINS, cTL(typeList)); + } + + /** + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param type The value of type as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) + */ + public void setType_LikeSearch( String type, - jp.sf.pal.bookmark.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(type), getCValueType(), "TYPE", - "Type", "type", inScopeOption); + jp.sf.pal.bookmark.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(type), getCValueType(), "TYPE", "Type", "type", + likeSearchOption); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param typeList The collection of type as notInScope. + * @param type The value of type as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setType_NotInScope(Collection typeList) { - regType(CK_NINS, cTL(typeList)); + public void setType_NotLikeSearch( + String type, + jp.sf.pal.bookmark.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(type), getCValueType(), "TYPE", "Type", "type", + likeSearchOption); } protected void regType(ConditionKey key, Object value) { @@ -648,7 +648,7 @@ abstract protected ConditionValue getCValueType(); /** - * Equal(=). And NullIgnored, OnceRegistered. {NotNull : INTEGER : + * Equal(=). And NullIgnored, OnlyOnceRegistered. {NotNull : INTEGER : * Default=[0]} * * @param sortOrder The value of sortOrder as equal. @@ -658,7 +658,7 @@ } /** - * NotEqual(!=). And NullIgnored, OnceRegistered. + * NotEqual(!=). And NullIgnored, OnlyOnceRegistered. * * @param sortOrder The value of sortOrder as notEqual. */ @@ -667,7 +667,7 @@ } /** - * GreaterThan(>). And NullIgnored, OnceRegistered. + * GreaterThan(>). And NullIgnored, OnlyOnceRegistered. * * @param sortOrder The value of sortOrder as greaterThan. */ @@ -676,7 +676,7 @@ } /** - * LessThan(<). And NullIgnored, OnceRegistered. + * LessThan(<). And NullIgnored, OnlyOnceRegistered. * * @param sortOrder The value of sortOrder as lessThan. */ @@ -685,7 +685,7 @@ } /** - * GreaterEqual(>=). And NullIgnored, OnceRegistered. + * GreaterEqual(>=). And NullIgnored, OnlyOnceRegistered. * * @param sortOrder The value of sortOrder as greaterEqual. */ @@ -694,7 +694,7 @@ } /** - * LessEqual(<=). And NullIgnored, OnceRegistered. + * LessEqual(<=). And NullIgnored, OnlyOnceRegistered. * * @param sortOrder The value of sortOrder as lessEqual. */ @@ -735,8 +735,8 @@ abstract protected ConditionValue getCValueSortOrder(); /** - * Equal(=). And NullIgnored, OnceRegistered. {INTEGER : Default=[0] : FK to - * BOOKMARK_CATEGORY} + * Equal(=). And NullIgnored, OnlyOnceRegistered. {INTEGER : Default=[0] : + * FK to BOOKMARK_CATEGORY} * * @param categoryId The value of categoryId as equal. */ @@ -745,7 +745,7 @@ } /** - * NotEqual(!=). And NullIgnored, OnceRegistered. + * NotEqual(!=). And NullIgnored, OnlyOnceRegistered. * * @param categoryId The value of categoryId as notEqual. */ @@ -754,7 +754,7 @@ } /** - * GreaterThan(>). And NullIgnored, OnceRegistered. + * GreaterThan(>). And NullIgnored, OnlyOnceRegistered. * * @param categoryId The value of categoryId as greaterThan. */ @@ -763,7 +763,7 @@ } /** - * LessThan(<). And NullIgnored, OnceRegistered. + * LessThan(<). And NullIgnored, OnlyOnceRegistered. * * @param categoryId The value of categoryId as lessThan. */ @@ -772,7 +772,7 @@ } /** - * GreaterEqual(>=). And NullIgnored, OnceRegistered. + * GreaterEqual(>=). And NullIgnored, OnlyOnceRegistered. * * @param categoryId The value of categoryId as greaterEqual. */ @@ -781,7 +781,7 @@ } /** - * LessEqual(<=). And NullIgnored, OnceRegistered. + * LessEqual(<=). And NullIgnored, OnlyOnceRegistered. * * @param categoryId The value of categoryId as lessEqual. */ @@ -809,45 +809,29 @@ regCategoryId(CK_NINS, cTL(categoryIdList)); } - /** - * @param bookmarkCategoryCBquery Query. - * @deprecated Please use inScopeBookmarkCategory(subQuery) method. - */ - public void setCategoryId_InScopeSubQuery_BookmarkCategory( - BookmarkCategoryCQ bookmarkCategoryCBquery) { - String subQueryPropertyName = keepCategoryId_InScopeSubQuery_BookmarkCategory(bookmarkCategoryCBquery);// for - // saving - // query - // - - // value - // . - registerInScopeSubQuery(bookmarkCategoryCBquery, "CATEGORY_ID", "ID", - subQueryPropertyName); - } - public void inScopeBookmarkCategory(SubQuery subQuery) { assertObjectNotNull("subQuery", subQuery); BookmarkCategoryCB cb = new BookmarkCategoryCB(); cb.xsetupForInScopeSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepCategoryId_InScopeSubQuery_BookmarkCategory(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerInScopeSubQuery(cb.query(), "CATEGORY_ID", "ID", subQueryPropertyName); } - abstract public String keepCategoryId_InScopeSubQuery_BookmarkCategory( + public abstract String keepCategoryId_InScopeSubQuery_BookmarkCategory( BookmarkCategoryCQ subQuery); /** - * IsNull(is null). And OnceRegistered. + * IsNull(is null). And OnlyOnceRegistered. */ public void setCategoryId_IsNull() { regCategoryId(CK_ISN, DUMMY_OBJECT); } /** - * IsNotNull(is not null). And OnceRegistered. + * IsNotNull(is not null). And OnlyOnceRegistered. */ public void setCategoryId_IsNotNull() { regCategoryId(CK_ISNN, DUMMY_OBJECT); @@ -866,7 +850,7 @@ abstract protected ConditionValue getCValueCategoryId(); /** - * Equal(=). And NullIgnored, OnceRegistered. {NotNull : TIMESTAMP} + * Equal(=). And NullIgnored, OnlyOnceRegistered. {NotNull : TIMESTAMP} * * @param createdTime The value of createdTime as equal. */ @@ -875,7 +859,7 @@ } /** - * NotEqual(!=). And NullIgnored, OnceRegistered. + * NotEqual(!=). And NullIgnored, OnlyOnceRegistered. * * @param createdTime The value of createdTime as notEqual. */ @@ -884,7 +868,7 @@ } /** - * GreaterThan(>). And NullIgnored, OnceRegistered. + * GreaterThan(>). And NullIgnored, OnlyOnceRegistered. * * @param createdTime The value of createdTime as greaterThan. */ @@ -893,7 +877,7 @@ } /** - * LessThan(>). And NullIgnored, OnceRegistered. + * LessThan(>). And NullIgnored, OnlyOnceRegistered. * * @param createdTime The value of createdTime as lessThan. */ @@ -902,7 +886,7 @@ } /** - * GreaterEqual(>). And NullIgnored, OnceRegistered. + * GreaterEqual(>). And NullIgnored, OnlyOnceRegistered. * * @param createdTime The value of createdTime as greaterEqual. */ @@ -911,7 +895,7 @@ } /** - * LessEqual(>). And NullIgnored, OnceRegistered. + * LessEqual(>). And NullIgnored, OnlyOnceRegistered. * * @param createdTime The value of createdTime as lessEqual. */ @@ -921,7 +905,7 @@ /** * FromTo($fromDate <= COLUMN_NAME <= $toDate). And NullIgnored, - * OnceRegistered. {NotNull : TIMESTAMP} + * OnlyOnceRegistered. {NotNull : TIMESTAMP} * * @param fromDate The from-date of createdTime. (Nullable) * @param toDate The to-date of createdTime. (Nullable) @@ -939,7 +923,7 @@ /** * FromTo($fromDate <= COLUMN_NAME < $toDate + 1). And NullIgnored, - * OnceRegistered. {NotNull : TIMESTAMP} + * OnlyOnceRegistered. {NotNull : TIMESTAMP} * * @param fromDate The from-date of createdTime. (Nullable) * @param toDate The to-date of createdTime. (Nullable) @@ -965,8 +949,8 @@ abstract protected ConditionValue getCValueCreatedTime(); /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {NotNull : VARCHAR(255) - * : FK to USER_INFO} + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {NotNull : + * VARCHAR(255) : FK to USER_INFO} * * @param createdBy The value of createdBy as equal. */ @@ -975,7 +959,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param createdBy The value of createdBy as notEqual. */ @@ -984,7 +968,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param createdBy The value of createdBy as greaterThan. */ @@ -993,7 +977,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param createdBy The value of createdBy as lessThan. */ @@ -1002,7 +986,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param createdBy The value of createdBy as greaterEqual. */ @@ -1011,7 +995,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param createdBy The value of createdBy as lessEqual. */ @@ -1020,7 +1004,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param createdBy The value of createdBy as prefixSearch. */ @@ -1029,20 +1013,6 @@ } /** - * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, - * SeveralRegistered. - * - * @param createdBy The value of createdBy as likeSearch. - * @param likeSearchOption The option of like-search. (NotNull) - */ - public void setCreatedBy_LikeSearch( - String createdBy, - jp.sf.pal.bookmark.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. * @@ -1053,43 +1023,41 @@ } /** - * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * - * @param createdBy The collection of createdBy as inScope. - * @param inScopeOption The option of in-scope. (NotNull) + * @param createdByList The collection of createdBy as notInScope. */ - public void setCreatedBy_InScope( - String createdBy, - jp.sf.pal.bookmark.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(createdBy), getCValueCreatedBy(), - "CREATED_BY", "CreatedBy", "createdBy", inScopeOption); + public void setCreatedBy_NotInScope(Collection createdByList) { + regCreatedBy(CK_NINS, cTL(createdByList)); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param createdByList The collection of createdBy as notInScope. + * @param createdBy The value of createdBy as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) */ - public void setCreatedBy_NotInScope(Collection createdByList) { - regCreatedBy(CK_NINS, cTL(createdByList)); + public void setCreatedBy_LikeSearch( + String createdBy, + jp.sf.pal.bookmark.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(createdBy), getCValueCreatedBy(), "CREATED_BY", + "CreatedBy", "createdBy", likeSearchOption); } /** - * @param userInfoCBquery Query. - * @deprecated Please use inScopeUserInfoByCreatedBy(subQuery) method. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param createdBy The value of createdBy as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setCreatedBy_InScopeSubQuery_UserInfoByCreatedBy( - UserInfoCQ userInfoCBquery) { - String subQueryPropertyName = keepCreatedBy_InScopeSubQuery_UserInfoByCreatedBy(userInfoCBquery);// for - // saving - // query - // - - // value - // . - registerInScopeSubQuery(userInfoCBquery, "CREATED_BY", "USER_ID", - subQueryPropertyName); + public void setCreatedBy_NotLikeSearch( + String createdBy, + jp.sf.pal.bookmark.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(createdBy), getCValueCreatedBy(), "CREATED_BY", + "CreatedBy", "createdBy", likeSearchOption); } public void inScopeUserInfoByCreatedBy(SubQuery subQuery) { @@ -1098,12 +1066,12 @@ cb.xsetupForInScopeSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepCreatedBy_InScopeSubQuery_UserInfoByCreatedBy(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerInScopeSubQuery(cb.query(), "CREATED_BY", "USER_ID", subQueryPropertyName); } - abstract public String keepCreatedBy_InScopeSubQuery_UserInfoByCreatedBy( + public abstract String keepCreatedBy_InScopeSubQuery_UserInfoByCreatedBy( jp.sf.pal.bookmark.db.cbean.cq.UserInfoCQ subQuery); protected void regCreatedBy(ConditionKey key, Object value) { @@ -1119,7 +1087,7 @@ abstract protected ConditionValue getCValueCreatedBy(); /** - * Equal(=). And NullIgnored, OnceRegistered. {NotNull : TIMESTAMP} + * Equal(=). And NullIgnored, OnlyOnceRegistered. {NotNull : TIMESTAMP} * * @param updatedTime The value of updatedTime as equal. */ @@ -1128,7 +1096,7 @@ } /** - * NotEqual(!=). And NullIgnored, OnceRegistered. + * NotEqual(!=). And NullIgnored, OnlyOnceRegistered. * * @param updatedTime The value of updatedTime as notEqual. */ @@ -1137,7 +1105,7 @@ } /** - * GreaterThan(>). And NullIgnored, OnceRegistered. + * GreaterThan(>). And NullIgnored, OnlyOnceRegistered. * * @param updatedTime The value of updatedTime as greaterThan. */ @@ -1146,7 +1114,7 @@ } /** - * LessThan(>). And NullIgnored, OnceRegistered. + * LessThan(>). And NullIgnored, OnlyOnceRegistered. * * @param updatedTime The value of updatedTime as lessThan. */ @@ -1155,7 +1123,7 @@ } /** - * GreaterEqual(>). And NullIgnored, OnceRegistered. + * GreaterEqual(>). And NullIgnored, OnlyOnceRegistered. * * @param updatedTime The value of updatedTime as greaterEqual. */ @@ -1164,7 +1132,7 @@ } /** - * LessEqual(>). And NullIgnored, OnceRegistered. + * LessEqual(>). And NullIgnored, OnlyOnceRegistered. * * @param updatedTime The value of updatedTime as lessEqual. */ @@ -1174,7 +1142,7 @@ /** * FromTo($fromDate <= COLUMN_NAME <= $toDate). And NullIgnored, - * OnceRegistered. {NotNull : TIMESTAMP} + * OnlyOnceRegistered. {NotNull : TIMESTAMP} * * @param fromDate The from-date of updatedTime. (Nullable) * @param toDate The to-date of updatedTime. (Nullable) @@ -1192,7 +1160,7 @@ /** * FromTo($fromDate <= COLUMN_NAME < $toDate + 1). And NullIgnored, - * OnceRegistered. {NotNull : TIMESTAMP} + * OnlyOnceRegistered. {NotNull : TIMESTAMP} * * @param fromDate The from-date of updatedTime. (Nullable) * @param toDate The to-date of updatedTime. (Nullable) @@ -1218,8 +1186,8 @@ abstract protected ConditionValue getCValueUpdatedTime(); /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {NotNull : VARCHAR(255) - * : FK to USER_INFO} + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {NotNull : + * VARCHAR(255) : FK to USER_INFO} * * @param updatedBy The value of updatedBy as equal. */ @@ -1228,7 +1196,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param updatedBy The value of updatedBy as notEqual. */ @@ -1237,7 +1205,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param updatedBy The value of updatedBy as greaterThan. */ @@ -1246,7 +1214,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param updatedBy The value of updatedBy as lessThan. */ @@ -1255,7 +1223,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param updatedBy The value of updatedBy as greaterEqual. */ @@ -1264,7 +1232,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param updatedBy The value of updatedBy as lessEqual. */ @@ -1273,7 +1241,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param updatedBy The value of updatedBy as prefixSearch. */ @@ -1282,20 +1250,6 @@ } /** - * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, - * SeveralRegistered. - * - * @param updatedBy The value of updatedBy as likeSearch. - * @param likeSearchOption The option of like-search. (NotNull) - */ - public void setUpdatedBy_LikeSearch( - String updatedBy, - jp.sf.pal.bookmark.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. * @@ -1306,43 +1260,41 @@ } /** - * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * - * @param updatedBy The collection of updatedBy as inScope. - * @param inScopeOption The option of in-scope. (NotNull) + * @param updatedByList The collection of updatedBy as notInScope. */ - public void setUpdatedBy_InScope( - String updatedBy, - jp.sf.pal.bookmark.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(updatedBy), getCValueUpdatedBy(), - "UPDATED_BY", "UpdatedBy", "updatedBy", inScopeOption); + public void setUpdatedBy_NotInScope(Collection updatedByList) { + regUpdatedBy(CK_NINS, cTL(updatedByList)); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param updatedByList The collection of updatedBy as notInScope. + * @param updatedBy The value of updatedBy as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) */ - public void setUpdatedBy_NotInScope(Collection updatedByList) { - regUpdatedBy(CK_NINS, cTL(updatedByList)); + public void setUpdatedBy_LikeSearch( + String updatedBy, + jp.sf.pal.bookmark.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(updatedBy), getCValueUpdatedBy(), "UPDATED_BY", + "UpdatedBy", "updatedBy", likeSearchOption); } /** - * @param userInfoCBquery Query. - * @deprecated Please use inScopeUserInfoByUpdatedBy(subQuery) method. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param updatedBy The value of updatedBy as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setUpdatedBy_InScopeSubQuery_UserInfoByUpdatedBy( - UserInfoCQ userInfoCBquery) { - String subQueryPropertyName = keepUpdatedBy_InScopeSubQuery_UserInfoByUpdatedBy(userInfoCBquery);// for - // saving - // query - // - - // value - // . - registerInScopeSubQuery(userInfoCBquery, "UPDATED_BY", "USER_ID", - subQueryPropertyName); + public void setUpdatedBy_NotLikeSearch( + String updatedBy, + jp.sf.pal.bookmark.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(updatedBy), getCValueUpdatedBy(), "UPDATED_BY", + "UpdatedBy", "updatedBy", likeSearchOption); } public void inScopeUserInfoByUpdatedBy(SubQuery subQuery) { @@ -1351,12 +1303,12 @@ cb.xsetupForInScopeSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepUpdatedBy_InScopeSubQuery_UserInfoByUpdatedBy(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerInScopeSubQuery(cb.query(), "UPDATED_BY", "USER_ID", subQueryPropertyName); } - abstract public String keepUpdatedBy_InScopeSubQuery_UserInfoByUpdatedBy( + public abstract String keepUpdatedBy_InScopeSubQuery_UserInfoByUpdatedBy( jp.sf.pal.bookmark.db.cbean.cq.UserInfoCQ subQuery); protected void regUpdatedBy(ConditionKey key, Object value) { @@ -1372,7 +1324,7 @@ abstract protected ConditionValue getCValueUpdatedBy(); /** - * Equal(=). And NullIgnored, OnceRegistered. {TIMESTAMP} + * Equal(=). And NullIgnored, OnlyOnceRegistered. {TIMESTAMP} * * @param deletedTime The value of deletedTime as equal. */ @@ -1381,7 +1333,7 @@ } /** - * NotEqual(!=). And NullIgnored, OnceRegistered. + * NotEqual(!=). And NullIgnored, OnlyOnceRegistered. * * @param deletedTime The value of deletedTime as notEqual. */ @@ -1390,7 +1342,7 @@ } /** - * GreaterThan(>). And NullIgnored, OnceRegistered. + * GreaterThan(>). And NullIgnored, OnlyOnceRegistered. * * @param deletedTime The value of deletedTime as greaterThan. */ @@ -1399,7 +1351,7 @@ } /** - * LessThan(>). And NullIgnored, OnceRegistered. + * LessThan(>). And NullIgnored, OnlyOnceRegistered. * * @param deletedTime The value of deletedTime as lessThan. */ @@ -1408,7 +1360,7 @@ } /** - * GreaterEqual(>). And NullIgnored, OnceRegistered. + * GreaterEqual(>). And NullIgnored, OnlyOnceRegistered. * * @param deletedTime The value of deletedTime as greaterEqual. */ @@ -1417,7 +1369,7 @@ } /** - * LessEqual(>). And NullIgnored, OnceRegistered. + * LessEqual(>). And NullIgnored, OnlyOnceRegistered. * * @param deletedTime The value of deletedTime as lessEqual. */ @@ -1427,7 +1379,7 @@ /** * FromTo($fromDate <= COLUMN_NAME <= $toDate). And NullIgnored, - * OnceRegistered. {TIMESTAMP} + * OnlyOnceRegistered. {TIMESTAMP} * * @param fromDate The from-date of deletedTime. (Nullable) * @param toDate The to-date of deletedTime. (Nullable) @@ -1445,7 +1397,7 @@ /** * FromTo($fromDate <= COLUMN_NAME < $toDate + 1). And NullIgnored, - * OnceRegistered. {TIMESTAMP} + * OnlyOnceRegistered. {TIMESTAMP} * * @param fromDate The from-date of deletedTime. (Nullable) * @param toDate The to-date of deletedTime. (Nullable) @@ -1459,14 +1411,14 @@ } /** - * IsNull(is null). And OnceRegistered. + * IsNull(is null). And OnlyOnceRegistered. */ public void setDeletedTime_IsNull() { regDeletedTime(CK_ISN, DUMMY_OBJECT); } /** - * IsNotNull(is not null). And OnceRegistered. + * IsNotNull(is not null). And OnlyOnceRegistered. */ public void setDeletedTime_IsNotNull() { regDeletedTime(CK_ISNN, DUMMY_OBJECT); @@ -1485,7 +1437,7 @@ abstract protected ConditionValue getCValueDeletedTime(); /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {VARCHAR(255)} + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {VARCHAR(255)} * * @param deletedBy The value of deletedBy as equal. */ @@ -1494,7 +1446,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param deletedBy The value of deletedBy as notEqual. */ @@ -1503,7 +1455,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param deletedBy The value of deletedBy as greaterThan. */ @@ -1512,7 +1464,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param deletedBy The value of deletedBy as lessThan. */ @@ -1521,7 +1473,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param deletedBy The value of deletedBy as greaterEqual. */ @@ -1530,7 +1482,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param deletedBy The value of deletedBy as lessEqual. */ @@ -1539,7 +1491,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param deletedBy The value of deletedBy as prefixSearch. */ @@ -1548,20 +1500,6 @@ } /** - * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, - * SeveralRegistered. - * - * @param deletedBy The value of deletedBy as likeSearch. - * @param likeSearchOption The option of like-search. (NotNull) - */ - public void setDeletedBy_LikeSearch( - String deletedBy, - jp.sf.pal.bookmark.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. * @@ -1572,38 +1510,52 @@ } /** - * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * - * @param deletedBy The collection of deletedBy as inScope. - * @param inScopeOption The option of in-scope. (NotNull) + * @param deletedByList The collection of deletedBy as notInScope. */ - public void setDeletedBy_InScope( + public void setDeletedBy_NotInScope(Collection deletedByList) { + regDeletedBy(CK_NINS, cTL(deletedByList)); + } + + /** + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param deletedBy The value of deletedBy as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) + */ + public void setDeletedBy_LikeSearch( String deletedBy, - jp.sf.pal.bookmark.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(deletedBy), getCValueDeletedBy(), - "DELETED_BY", "DeletedBy", "deletedBy", inScopeOption); + jp.sf.pal.bookmark.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(deletedBy), getCValueDeletedBy(), "DELETED_BY", + "DeletedBy", "deletedBy", likeSearchOption); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param deletedByList The collection of deletedBy as notInScope. + * @param deletedBy The value of deletedBy as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setDeletedBy_NotInScope(Collection deletedByList) { - regDeletedBy(CK_NINS, cTL(deletedByList)); + public void setDeletedBy_NotLikeSearch( + String deletedBy, + jp.sf.pal.bookmark.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(deletedBy), getCValueDeletedBy(), "DELETED_BY", + "DeletedBy", "deletedBy", likeSearchOption); } /** - * IsNull(is null). And OnceRegistered. + * IsNull(is null). And OnlyOnceRegistered. */ public void setDeletedBy_IsNull() { regDeletedBy(CK_ISN, DUMMY_OBJECT); } /** - * IsNotNull(is not null). And OnceRegistered. + * IsNotNull(is not null). And OnlyOnceRegistered. */ public void setDeletedBy_IsNotNull() { regDeletedBy(CK_ISNN, DUMMY_OBJECT); @@ -1622,7 +1574,7 @@ abstract protected ConditionValue getCValueDeletedBy(); /** - * Equal(=). And NullIgnored, OnceRegistered. {NotNull : INTEGER : + * Equal(=). And NullIgnored, OnlyOnceRegistered. {NotNull : INTEGER : * Default=[0]} * * @param versionno The value of versionno as equal. @@ -1632,7 +1584,7 @@ } /** - * NotEqual(!=). And NullIgnored, OnceRegistered. + * NotEqual(!=). And NullIgnored, OnlyOnceRegistered. * * @param versionno The value of versionno as notEqual. */ @@ -1641,7 +1593,7 @@ } /** - * GreaterThan(>). And NullIgnored, OnceRegistered. + * GreaterThan(>). And NullIgnored, OnlyOnceRegistered. * * @param versionno The value of versionno as greaterThan. */ @@ -1650,7 +1602,7 @@ } /** - * LessThan(<). And NullIgnored, OnceRegistered. + * LessThan(<). And NullIgnored, OnlyOnceRegistered. * * @param versionno The value of versionno as lessThan. */ @@ -1659,7 +1611,7 @@ } /** - * GreaterEqual(>=). And NullIgnored, OnceRegistered. + * GreaterEqual(>=). And NullIgnored, OnlyOnceRegistered. * * @param versionno The value of versionno as greaterEqual. */ @@ -1668,7 +1620,7 @@ } /** - * LessEqual(<=). And NullIgnored, OnceRegistered. + * LessEqual(<=). And NullIgnored, OnlyOnceRegistered. * * @param versionno The value of versionno as lessEqual. */ @@ -1708,6 +1660,53 @@ abstract protected ConditionValue getCValueVersionno(); + public SSQFunction scalar_Equal() { + return xcreateSSQFunction("="); + } + + public SSQFunction scalar_GreaterEqual() { + return xcreateSSQFunction(">="); + } + + public SSQFunction scalar_GreaterThan() { + return xcreateSSQFunction(">"); + } + + public SSQFunction scalar_LessEqual() { + return xcreateSSQFunction("<="); + } + + public SSQFunction scalar_LessThan() { + return xcreateSSQFunction("<"); + } + + protected SSQFunction xcreateSSQFunction( + final String operand) { + return new SSQFunction( + new SSQSetupper() { + public void setup(String function, + SubQuery subQuery) { + xscalarSubQuery(function, subQuery, operand); + } + }); + } + + protected void xscalarSubQuery(String function, + SubQuery subQuery, String operand) { + assertObjectNotNull("subQuery", subQuery); + BookmarkLinkCB cb = new BookmarkLinkCB(); + cb.xsetupForScalarSubQuery(); + subQuery.query(cb); + String subQueryPropertyName = keepScalarSubQuery(cb.query()); // for + // saving + // query + // -value. + registerScalarSubQuery(function, cb.query(), subQueryPropertyName, + operand); + } + + public abstract String keepScalarSubQuery(BookmarkLinkCQ subQuery); + // Very Internal (for Suppressing Warn about 'Not Use Import') protected String getConditionBeanClassNameInternally() { return BookmarkLinkCB.class.getName(); Modified: bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/cbean/cq/bs/AbstractBsGroupInfoCQ.java =================================================================== --- bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/cbean/cq/bs/AbstractBsGroupInfoCQ.java 2008-12-27 22:10:35 UTC (rev 1626) +++ bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/cbean/cq/bs/AbstractBsGroupInfoCQ.java 2008-12-27 22:11:51 UTC (rev 1627) @@ -20,7 +20,6 @@ * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public abstract class AbstractBsGroupInfoCQ extends AbstractConditionQuery { //========================================================================== @@ -50,7 +49,7 @@ // ===== /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {PK : NotNull : + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {PK : NotNull : * VARCHAR(255)} * * @param groupId The value of groupId as equal. @@ -60,7 +59,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param groupId The value of groupId as notEqual. */ @@ -69,7 +68,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param groupId The value of groupId as greaterThan. */ @@ -78,7 +77,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param groupId The value of groupId as lessThan. */ @@ -87,7 +86,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param groupId The value of groupId as greaterEqual. */ @@ -96,7 +95,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param groupId The value of groupId as lessEqual. */ @@ -105,7 +104,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param groupId The value of groupId as prefixSearch. */ @@ -114,20 +113,6 @@ } /** - * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, - * SeveralRegistered. - * - * @param groupId The value of groupId as likeSearch. - * @param likeSearchOption The option of like-search. (NotNull) - */ - public void setGroupId_LikeSearch( - String groupId, - jp.sf.pal.bookmark.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { - registerLikeSearchQuery(CK_LS, fRES(groupId), getCValueGroupId(), - "GROUP_ID", "GroupId", "groupId", likeSearchOption); - } - - /** * InScope(in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * @@ -138,43 +123,41 @@ } /** - * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * - * @param groupId The collection of groupId as inScope. - * @param inScopeOption The option of in-scope. (NotNull) + * @param groupIdList The collection of groupId as notInScope. */ - public void setGroupId_InScope( - String groupId, - jp.sf.pal.bookmark.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(groupId), getCValueGroupId(), - "GROUP_ID", "GroupId", "groupId", inScopeOption); + public void setGroupId_NotInScope(Collection groupIdList) { + regGroupId(CK_NINS, cTL(groupIdList)); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param groupIdList The collection of groupId as notInScope. + * @param groupId The value of groupId as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) */ - public void setGroupId_NotInScope(Collection groupIdList) { - regGroupId(CK_NINS, cTL(groupIdList)); + public void setGroupId_LikeSearch( + String groupId, + jp.sf.pal.bookmark.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(groupId), getCValueGroupId(), "GROUP_ID", "GroupId", + "groupId", likeSearchOption); } /** - * @param groupMappingCBquery Query. - * @deprecated Please use inScopeGroupMappingList(subQuery) method. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param groupId The value of groupId as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setGroupId_InScopeSubQuery_GroupMappingList( - GroupMappingCQ groupMappingCBquery) { - String subQueryPropertyName = keepGroupId_InScopeSubQuery_GroupMappingList(groupMappingCBquery);// for - // saving - // query - // - - // value - // . - registerInScopeSubQuery(groupMappingCBquery, "GROUP_ID", "GROUP_ID", - subQueryPropertyName); + public void setGroupId_NotLikeSearch( + String groupId, + jp.sf.pal.bookmark.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(groupId), getCValueGroupId(), "GROUP_ID", + "GroupId", "groupId", likeSearchOption); } public void inScopeGroupMappingList(SubQuery subQuery) { @@ -183,42 +166,26 @@ cb.xsetupForInScopeSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepGroupId_InScopeSubQuery_GroupMappingList(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerInScopeSubQuery(cb.query(), "GROUP_ID", "GROUP_ID", subQueryPropertyName); } - abstract public String keepGroupId_InScopeSubQuery_GroupMappingList( + public abstract String keepGroupId_InScopeSubQuery_GroupMappingList( GroupMappingCQ subQuery); - /** - * @param userInfoCBquery Query. - * @deprecated Please use inScopeUserInfoList(subQuery) method. - */ - public void setGroupId_InScopeSubQuery_UserInfoList( - UserInfoCQ userInfoCBquery) { - String subQueryPropertyName = keepGroupId_InScopeSubQuery_UserInfoList(userInfoCBquery);// for - // saving - // query - // - - // value - // . - registerInScopeSubQuery(userInfoCBquery, "GROUP_ID", "GROUP_ID", - subQueryPropertyName); - } - public void inScopeUserInfoList(SubQuery subQuery) { assertObjectNotNull("subQuery", subQuery); UserInfoCB cb = new UserInfoCB(); cb.xsetupForInScopeSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepGroupId_InScopeSubQuery_UserInfoList(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerInScopeSubQuery(cb.query(), "GROUP_ID", "GROUP_ID", subQueryPropertyName); } - abstract public String keepGroupId_InScopeSubQuery_UserInfoList( + public abstract String keepGroupId_InScopeSubQuery_UserInfoList( UserInfoCQ subQuery); public void notInScopeGroupMappingList(SubQuery subQuery) { @@ -227,12 +194,12 @@ cb.xsetupForInScopeSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepGroupId_NotInScopeSubQuery_GroupMappingList(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerNotInScopeSubQuery(cb.query(), "GROUP_ID", "GROUP_ID", subQueryPropertyName); } - abstract public String keepGroupId_NotInScopeSubQuery_GroupMappingList( + public abstract String keepGroupId_NotInScopeSubQuery_GroupMappingList( GroupMappingCQ subQuery); public void notInScopeUserInfoList(SubQuery subQuery) { @@ -241,31 +208,15 @@ cb.xsetupForInScopeSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepGroupId_NotInScopeSubQuery_UserInfoList(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerNotInScopeSubQuery(cb.query(), "GROUP_ID", "GROUP_ID", subQueryPropertyName); } - abstract public String keepGroupId_NotInScopeSubQuery_UserInfoList( + public abstract String keepGroupId_NotInScopeSubQuery_UserInfoList( UserInfoCQ subQuery); /** - * @param groupMappingCBquery Query. - * @deprecated Please use existsGroupMappingList(subQuery) method. - */ - public void setGroupId_ExistsSubQuery_GroupMappingList( - GroupMappingCQ groupMappingCBquery) { - String subQueryPropertyName = keepGroupId_ExistsSubQuery_GroupMappingList(groupMappingCBquery);// for - // saving - // query - // - - // value - // . - registerExistsSubQuery(groupMappingCBquery, "GROUP_ID", "GROUP_ID", - subQueryPropertyName); - } - - /** * Set up 'exists' sub-query. {exists (select GROUP_ID from GROUP_MAPPING * where ...)} * @@ -278,31 +229,15 @@ cb.xsetupForExistsSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepGroupId_ExistsSubQuery_GroupMappingList(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerExistsSubQuery(cb.query(), "GROUP_ID", "GROUP_ID", subQueryPropertyName); } - abstract public String keepGroupId_ExistsSubQuery_GroupMappingList( + public abstract String keepGroupId_ExistsSubQuery_GroupMappingList( GroupMappingCQ subQuery); /** - * @param userInfoCBquery Query. - * @deprecated Please use existsUserInfoList(subQuery) method. - */ - public void setGroupId_ExistsSubQuery_UserInfoList( - UserInfoCQ userInfoCBquery) { - String subQueryPropertyName = keepGroupId_ExistsSubQuery_UserInfoList(userInfoCBquery);// for - // saving - // query - // - - // value - // . - registerExistsSubQuery(userInfoCBquery, "GROUP_ID", "GROUP_ID", - subQueryPropertyName); - } - - /** * Set up 'exists' sub-query. {exists (select GROUP_ID from USER_INFO where * ...)} * @@ -315,12 +250,12 @@ cb.xsetupForExistsSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepGroupId_ExistsSubQuery_UserInfoList(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerExistsSubQuery(cb.query(), "GROUP_ID", "GROUP_ID", subQueryPropertyName); } - abstract public String keepGroupId_ExistsSubQuery_UserInfoList( + public abstract String keepGroupId_ExistsSubQuery_UserInfoList( UserInfoCQ subQuery); /** @@ -337,12 +272,12 @@ cb.xsetupForExistsSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepGroupId_NotExistsSubQuery_GroupMappingList(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerNotExistsSubQuery(cb.query(), "GROUP_ID", "GROUP_ID", subQueryPropertyName); } - abstract public String keepGroupId_NotExistsSubQuery_GroupMappingList( + public abstract String keepGroupId_NotExistsSubQuery_GroupMappingList( GroupMappingCQ subQuery); /** @@ -358,53 +293,53 @@ cb.xsetupForExistsSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepGroupId_NotExistsSubQuery_UserInfoList(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerNotExistsSubQuery(cb.query(), "GROUP_ID", "GROUP_ID", subQueryPropertyName); } - abstract public String keepGroupId_NotExistsSubQuery_UserInfoList( + public abstract String keepGroupId_NotExistsSubQuery_UserInfoList( UserInfoCQ subQuery); public void xderiveGroupMappingList(String function, SubQuery subQuery, String aliasName) { assertObjectNotNull("subQuery", subQuery); GroupMappingCB cb = new GroupMappingCB(); - cb.xsetupForDeriveReferrer(); + cb.xsetupForDerivedReferrer(); subQuery.query(cb); - String subQueryPropertyName = keepGroupId_DeriveSubQuery_GroupMappingList(cb - .query());// for saving query-value. - registerDeriveSubQuery(function, cb.query(), "GROUP_ID", "GROUP_ID", - subQueryPropertyName, aliasName); + String subQueryPropertyName = keepGroupId_DerivedReferrer_GroupMappingList(cb + .query()); // for saving query-value. + registerDerivedReferrerSubQuery(function, cb.query(), "GROUP_ID", + "GROUP_ID", subQueryPropertyName, aliasName); } - abstract public String keepGroupId_DeriveSubQuery_GroupMappingList( + public abstract String keepGroupId_DerivedReferrer_GroupMappingList( GroupMappingCQ subQuery); public void xderiveUserInfoList(String function, SubQuery subQuery, String aliasName) { assertObjectNotNull("subQuery", subQuery); UserInfoCB cb = new UserInfoCB(); - cb.xsetupForDeriveReferrer(); + cb.xsetupForDerivedReferrer(); subQuery.query(cb); - String subQueryPropertyName = keepGroupId_DeriveSubQuery_UserInfoList(cb - .query());// for saving query-value. - registerDeriveSubQuery(function, cb.query(), "GROUP_ID", "GROUP_ID", - subQueryPropertyName, aliasName); + String subQueryPropertyName = keepGroupId_DerivedReferrer_UserInfoList(cb + .query()); // for saving query-value. + registerDerivedReferrerSubQuery(function, cb.query(), "GROUP_ID", + "GROUP_ID", subQueryPropertyName, aliasName); } - abstract public String keepGroupId_DeriveSubQuery_UserInfoList( + public abstract String keepGroupId_DerivedReferrer_UserInfoList( UserInfoCQ subQuery); /** - * IsNull(is null). And OnceRegistered. + * IsNull(is null). And OnlyOnceRegistered. */ public void setGroupId_IsNull() { regGroupId(CK_ISN, DUMMY_OBJECT); } /** - * IsNotNull(is not null). And OnceRegistered. + * IsNotNull(is not null). And OnlyOnceRegistered. */ public void setGroupId_IsNotNull() { regGroupId(CK_ISNN, DUMMY_OBJECT); @@ -423,7 +358,7 @@ abstract protected ConditionValue getCValueGroupId(); /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {VARCHAR(100)} + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {VARCHAR(100)} * * @param name The value of name as equal. */ @@ -432,7 +367,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param name The value of name as notEqual. */ @@ -441,7 +376,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param name The value of name as greaterThan. */ @@ -450,7 +385,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param name The value of name as lessThan. */ @@ -459,7 +394,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param name The value of name as greaterEqual. */ @@ -468,7 +403,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param name The value of name as lessEqual. */ @@ -477,7 +412,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param name The value of name as prefixSearch. */ @@ -486,20 +421,6 @@ } /** - * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, - * SeveralRegistered. - * - * @param name The value of name as likeSearch. - * @param likeSearchOption The option of like-search. (NotNull) - */ - public void setName_LikeSearch( - String name, - jp.sf.pal.bookmark.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { - registerLikeSearchQuery(CK_LS, fRES(name), getCValueName(), "NAME", - "Name", "name", likeSearchOption); - } - - /** * InScope(in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * @@ -510,38 +431,52 @@ } /** - * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * - * @param name The collection of name as inScope. - * @param inScopeOption The option of in-scope. (NotNull) + * @param nameList The collection of name as notInScope. */ - public void setName_InScope( + public void setName_NotInScope(Collection nameList) { + regName(CK_NINS, cTL(nameList)); + } + + /** + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param name The value of name as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) + */ + public void setName_LikeSearch( String name, - jp.sf.pal.bookmark.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(name), getCValueName(), "NAME", - "Name", "name", inScopeOption); + jp.sf.pal.bookmark.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(name), getCValueName(), "NAME", "Name", "name", + likeSearchOption); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param nameList The collection of name as notInScope. + * @param name The value of name as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setName_NotInScope(Collection nameList) { - regName(CK_NINS, cTL(nameList)); + public void setName_NotLikeSearch( + String name, + jp.sf.pal.bookmark.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(name), getCValueName(), "NAME", "Name", "name", + likeSearchOption); } /** - * IsNull(is null). And OnceRegistered. + * IsNull(is null). And OnlyOnceRegistered. */ public void setName_IsNull() { regName(CK_ISN, DUMMY_OBJECT); } /** - * IsNotNull(is not null). And OnceRegistered. + * IsNotNull(is not null). And OnlyOnceRegistered. */ public void setName_IsNotNull() { regName(CK_ISNN, DUMMY_OBJECT); @@ -558,7 +493,7 @@ abstract protected ConditionValue getCValueName(); /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {VARCHAR(255)} + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {VARCHAR(255)} * * @param description The value of description as equal. */ @@ -567,7 +502,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param description The value of description as notEqual. */ @@ -576,7 +511,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param description The value of description as greaterThan. */ @@ -585,7 +520,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param description The value of description as lessThan. */ @@ -594,7 +529,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param description The value of description as greaterEqual. */ @@ -603,7 +538,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param description The value of description as lessEqual. */ @@ -612,7 +547,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param description The value of description as prefixSearch. */ @@ -621,21 +556,6 @@ } /** - * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, - * SeveralRegistered. - * - * @param description The value of description as likeSearch. - * @param likeSearchOption The option of like-search. (NotNull) - */ - public void setDescription_LikeSearch( - String description, - jp.sf.pal.bookmark.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { - registerLikeSearchQuery(CK_LS, fRES(description), - getCValueDescription(), "DESCRIPTION", "Description", - "description", likeSearchOption); - } - - /** * InScope(in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * @@ -646,38 +566,52 @@ } /** - * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * - * @param description The collection of description as inScope. - * @param inScopeOption The option of in-scope. (NotNull) + * @param descriptionList The collection of description as notInScope. */ - public void setDescription_InScope( + public void setDescription_NotInScope(Collection descriptionList) { + regDescription(CK_NINS, cTL(descriptionList)); + } + + /** + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param description The value of description as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) + */ + public void setDescription_LikeSearch( String description, - jp.sf.pal.bookmark.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(description), getCValueDescription(), - "DESCRIPTION", "Description", "description", inScopeOption); + jp.sf.pal.bookmark.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(description), getCValueDescription(), "DESCRIPTION", + "Description", "description", likeSearchOption); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param descriptionList The collection of description as notInScope. + * @param description The value of description as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setDescription_NotInScope(Collection descriptionList) { - regDescription(CK_NINS, cTL(descriptionList)); + public void setDescription_NotLikeSearch( + String description, + jp.sf.pal.bookmark.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(description), getCValueDescription(), + "DESCRIPTION", "Description", "description", likeSearchOption); } /** - * IsNull(is null). And OnceRegistered. + * IsNull(is null). And OnlyOnceRegistered. */ public void setDescription_IsNull() { regDescription(CK_ISN, DUMMY_OBJECT); } /** - * IsNotNull(is not null). And OnceRegistered. + * IsNotNull(is not null). And OnlyOnceRegistered. */ public void setDescription_IsNotNull() { regDescription(CK_ISNN, DUMMY_OBJECT); @@ -696,7 +630,7 @@ abstract protected ConditionValue getCValueDescription(); /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {VARCHAR(255)} + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {VARCHAR(255)} * * @param email The value of email as equal. */ @@ -705,7 +639,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param email The value of email as notEqual. */ @@ -714,7 +648,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param email The value of email as greaterThan. */ @@ -723,7 +657,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param email The value of email as lessThan. */ @@ -732,7 +666,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param email The value of email as greaterEqual. */ @@ -741,7 +675,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param email The value of email as lessEqual. */ @@ -750,7 +684,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param email The value of email as prefixSearch. */ @@ -759,20 +693,6 @@ } /** - * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, - * SeveralRegistered. - * - * @param email The value of email as likeSearch. - * @param likeSearchOption The option of like-search. (NotNull) - */ - public void setEmail_LikeSearch( - String email, - jp.sf.pal.bookmark.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { - registerLikeSearchQuery(CK_LS, fRES(email), getCValueEmail(), "EMAIL", - "Email", "email", likeSearchOption); - } - - /** * InScope(in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * @@ -783,38 +703,52 @@ } /** - * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * - * @param email The collection of email as inScope. - * @param inScopeOption The option of in-scope. (NotNull) + * @param emailList The collection of email as notInScope. */ - public void setEmail_InScope( + public void setEmail_NotInScope(Collection emailList) { + regEmail(CK_NINS, cTL(emailList)); + } + + /** + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param email The value of email as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) + */ + public void setEmail_LikeSearch( String email, - jp.sf.pal.bookmark.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(email), getCValueEmail(), "EMAIL", - "Email", "email", inScopeOption); + jp.sf.pal.bookmark.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(email), getCValueEmail(), "EMAIL", "Email", "email", + likeSearchOption); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param emailList The collection of email as notInScope. + * @param email The value of email as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setEmail_NotInScope(Collection emailList) { - regEmail(CK_NINS, cTL(emailList)); + public void setEmail_NotLikeSearch( + String email, + jp.sf.pal.bookmark.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(email), getCValueEmail(), "EMAIL", "Email", + "email", likeSearchOption); } /** - * IsNull(is null). And OnceRegistered. + * IsNull(is null). And OnlyOnceRegistered. */ public void setEmail_IsNull() { regEmail(CK_ISN, DUMMY_OBJECT); } /** - * IsNotNull(is not null). And OnceRegistered. + * IsNotNull(is not null). And OnlyOnceRegistered. */ public void setEmail_IsNotNull() { regEmail(CK_ISNN, DUMMY_OBJECT); @@ -832,7 +766,7 @@ abstract protected ConditionValue getCValueEmail(); /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {VARCHAR(255)} + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {VARCHAR(255)} * * @param url The value of url as equal. */ @@ -841,7 +775,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param url The value of url as notEqual. */ @@ -850,7 +784,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param url The value of url as greaterThan. */ @@ -859,7 +793,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param url The value of url as lessThan. */ @@ -868,7 +802,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param url The value of url as greaterEqual. */ @@ -877,7 +811,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param url The value of url as lessEqual. */ @@ -886,7 +820,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param url The value of url as prefixSearch. */ @@ -895,20 +829,6 @@ } /** - * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, - * SeveralRegistered. - * - * @param url The value of url as likeSearch. - * @param likeSearchOption The option of like-search. (NotNull) - */ - public void setUrl_LikeSearch( - String url, - jp.sf.pal.bookmark.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { - registerLikeSearchQuery(CK_LS, fRES(url), getCValueUrl(), "URL", "Url", - "url", likeSearchOption); - } - - /** * InScope(in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * @@ -919,38 +839,52 @@ } /** - * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * - * @param url The collection of url as inScope. - * @param inScopeOption The option of in-scope. (NotNull) + * @param urlList The collection of url as notInScope. */ - public void setUrl_InScope( + public void setUrl_NotInScope(Collection urlList) { + regUrl(CK_NINS, cTL(urlList)); + } + + /** + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param url The value of url as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) + */ + public void setUrl_LikeSearch( String url, - jp.sf.pal.bookmark.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(url), getCValueUrl(), "URL", "Url", - "url", inScopeOption); + jp.sf.pal.bookmark.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(url), getCValueUrl(), "URL", "Url", "url", + likeSearchOption); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param urlList The collection of url as notInScope. + * @param url The value of url as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setUrl_NotInScope(Collection urlList) { - regUrl(CK_NINS, cTL(urlList)); + public void setUrl_NotLikeSearch( + String url, + jp.sf.pal.bookmark.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(url), getCValueUrl(), "URL", "Url", "url", + likeSearchOption); } /** - * IsNull(is null). And OnceRegistered. + * IsNull(is null). And OnlyOnceRegistered. */ public void setUrl_IsNull() { regUrl(CK_ISN, DUMMY_OBJECT); } /** - * IsNotNull(is not null). And OnceRegistered. + * IsNotNull(is not null). And OnlyOnceRegistered. */ public void setUrl_IsNotNull() { regUrl(CK_ISNN, DUMMY_OBJECT); @@ -967,7 +901,7 @@ abstract protected ConditionValue getCValueUrl(); /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {VARCHAR(40)} + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {VARCHAR(40)} * * @param telephone The value of telephone as equal. */ @@ -976,7 +910,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param telephone The value of telephone as notEqual. */ @@ -985,7 +919,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param telephone The value of telephone as greaterThan. */ @@ -994,7 +928,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param telephone The value of telephone as lessThan. */ @@ -1003,7 +937,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param telephone The value of telephone as greaterEqual. */ @@ -1012,7 +946,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param telephone The value of telephone as lessEqual. */ @@ -1021,7 +955,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param telephone The value of telephone as prefixSearch. */ @@ -1030,20 +964,6 @@ } /** - * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, - * SeveralRegistered. - * - * @param telephone The value of telephone as likeSearch. - * @param likeSearchOption The option of like-search. (NotNull) - */ - public void setTelephone_LikeSearch( - String telephone, - jp.sf.pal.bookmark.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { - registerLikeSearchQuery(CK_LS, fRES(telephone), getCValueTelephone(), - "TELEPHONE", "Telephone", "telephone", likeSearchOption); - } - - /** * InScope(in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * @@ -1054,38 +974,52 @@ } /** - * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * - * @param telephone The collection of telephone as inScope. - * @param inScopeOption The option of in-scope. (NotNull) + * @param telephoneList The collection of telephone as notInScope. */ - public void setTelephone_InScope( + public void setTelephone_NotInScope(Collection telephoneList) { + regTelephone(CK_NINS, cTL(telephoneList)); + } + + /** + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param telephone The value of telephone as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) + */ + public void setTelephone_LikeSearch( String telephone, - jp.sf.pal.bookmark.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(telephone), getCValueTelephone(), - "TELEPHONE", "Telephone", "telephone", inScopeOption); + jp.sf.pal.bookmark.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(telephone), getCValueTelephone(), "TELEPHONE", + "Telephone", "telephone", likeSearchOption); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param telephoneList The collection of telephone as notInScope. + * @param telephone The value of telephone as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setTelephone_NotInScope(Collection telephoneList) { - regTelephone(CK_NINS, cTL(telephoneList)); + public void setTelephone_NotLikeSearch( + String telephone, + jp.sf.pal.bookmark.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(telephone), getCValueTelephone(), "TELEPHONE", + "Telephone", "telephone", likeSearchOption); } /** - * IsNull(is null). And OnceRegistered. + * IsNull(is null). And OnlyOnceRegistered. */ public void setTelephone_IsNull() { regTelephone(CK_ISN, DUMMY_OBJECT); } /** - * IsNotNull(is not null). And OnceRegistered. + * IsNotNull(is not null). And OnlyOnceRegistered. */ public void setTelephone_IsNotNull() { regTelephone(CK_ISNN, DUMMY_OBJECT); @@ -1104,7 +1038,7 @@ abstract protected ConditionValue getCValueTelephone(); /** - * Equal(=). And NullIgnored, OnceRegistered. {NotNull : TIMESTAMP} + * Equal(=). And NullIgnored, OnlyOnceRegistered. {NotNull : TIMESTAMP} * * @param createdTime The value of createdTime as equal. */ @@ -1113,7 +1047,7 @@ } /** - * NotEqual(!=). And NullIgnored, OnceRegistered. + * NotEqual(!=). And NullIgnored, OnlyOnceRegistered. * * @param createdTime The value of createdTime as notEqual. */ @@ -1122,7 +1056,7 @@ } /** - * GreaterThan(>). And NullIgnored, OnceRegistered. + * GreaterThan(>). And NullIgnored, OnlyOnceRegistered. * * @param createdTime The value of createdTime as greaterThan. */ @@ -1131,7 +1065,7 @@ } /** - * LessThan(>). And NullIgnored, OnceRegistered. + * LessThan(>). And NullIgnored, OnlyOnceRegistered. * * @param createdTime The value of createdTime as lessThan. */ @@ -1140,7 +1074,7 @@ } /** - * GreaterEqual(>). And NullIgnored, OnceRegistered. + * GreaterEqual(>). And NullIgnored, OnlyOnceRegistered. * * @param createdTime The value of createdTime as greaterEqual. */ @@ -1149,7 +1083,7 @@ } /** - * LessEqual(>). And NullIgnored, OnceRegistered. + * LessEqual(>). And NullIgnored, OnlyOnceRegistered. * * @param createdTime The value of createdTime as lessEqual. */ @@ -1159,7 +1093,7 @@ /** * FromTo($fromDate <= COLUMN_NAME <= $toDate). And NullIgnored, - * OnceRegistered. {NotNull : TIMESTAMP} + * OnlyOnceRegistered. {NotNull : TIMESTAMP} * * @param fromDate The from-date of createdTime. (Nullable) * @param toDate The to-date of createdTime. (Nullable) @@ -1177,7 +1111,7 @@ /** * FromTo($fromDate <= COLUMN_NAME < $toDate + 1). And NullIgnored, - * OnceRegistered. {NotNull : TIMESTAMP} + * OnlyOnceRegistered. {NotNull : TIMESTAMP} * * @param fromDate The from-date of createdTime. (Nullable) * @param toDate The to-date of createdTime. (Nullable) @@ -1203,7 +1137,7 @@ abstract protected ConditionValue getCValueCreatedTime(); /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {NotNull : + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {NotNull : * VARCHAR(255)} * * @param createdBy The value of createdBy as equal. @@ -1213,7 +1147,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param createdBy The value of createdBy as notEqual. */ @@ -1222,7 +1156,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param createdBy The value of createdBy as greaterThan. */ @@ -1231,7 +1165,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param createdBy The value of createdBy as lessThan. */ @@ -1240,7 +1174,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param createdBy The value of createdBy as greaterEqual. */ @@ -1249,7 +1183,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param createdBy The value of createdBy as lessEqual. */ @@ -1258,7 +1192,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param createdBy The value of createdBy as prefixSearch. */ @@ -1267,20 +1201,6 @@ } /** - * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, - * SeveralRegistered. - * - * @param createdBy The value of createdBy as likeSearch. - * @param likeSearchOption The option of like-search. (NotNull) - */ - public void setCreatedBy_LikeSearch( - String createdBy, - jp.sf.pal.bookmark.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { - registerLikeSearchQuery(CK_LS, fRES(createdBy), getCValueCreatedBy(), - "CREATED_BY", "CreatedBy", "createdBy", likeSearchOption); - } - - /** * InScope(in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * @@ -1291,27 +1211,41 @@ } /** - * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * - * @param createdBy The collection of createdBy as inScope. - * @param inScopeOption The option of in-scope. (NotNull) + * @param createdByList The collection of createdBy as notInScope. */ - public void setCreatedBy_InScope( + public void setCreatedBy_NotInScope(Collection createdByList) { + regCreatedBy(CK_NINS, cTL(createdByList)); + } + + /** + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param createdBy The value of createdBy as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) + */ + public void setCreatedBy_LikeSearch( String createdBy, - jp.sf.pal.bookmark.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(createdBy), getCValueCreatedBy(), - "CREATED_BY", "CreatedBy", "createdBy", inScopeOption); + jp.sf.pal.bookmark.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(createdBy), getCValueCreatedBy(), "CREATED_BY", + "CreatedBy", "createdBy", likeSearchOption); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param createdByList The collection of createdBy as notInScope. + * @param createdBy The value of createdBy as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setCreatedBy_NotInScope(Collection createdByList) { - regCreatedBy(CK_NINS, cTL(createdByList)); + public void setCreatedBy_NotLikeSearch( + String createdBy, + jp.sf.pal.bookmark.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(createdBy), getCValueCreatedBy(), "CREATED_BY", + "CreatedBy", "createdBy", likeSearchOption); } protected void regCreatedBy(ConditionKey key, Object value) { @@ -1327,7 +1261,7 @@ abstract protected ConditionValue getCValueCreatedBy(); /** - * Equal(=). And NullIgnored, OnceRegistered. {NotNull : TIMESTAMP} + * Equal(=). And NullIgnored, OnlyOnceRegistered. {NotNull : TIMESTAMP} * * @param updatedTime The value of updatedTime as equal. */ @@ -1336,7 +1270,7 @@ } /** - * NotEqual(!=). And NullIgnored, OnceRegistered. + * NotEqual(!=). And NullIgnored, OnlyOnceRegistered. * * @param updatedTime The value of updatedTime as notEqual. */ @@ -1345,7 +1279,7 @@ } /** - * GreaterThan(>). And NullIgnored, OnceRegistered. + * GreaterThan(>). And NullIgnored, OnlyOnceRegistered. * * @param updatedTime The value of updatedTime as greaterThan. */ @@ -1354,7 +1288,7 @@ } /** - * LessThan(>). And NullIgnored, OnceRegistered. + * LessThan(>). And NullIgnored, OnlyOnceRegistered. * * @param updatedTime The value of updatedTime as lessThan. */ @@ -1363,7 +1297,7 @@ } /** - * GreaterEqual(>). And NullIgnored, OnceRegistered. + * GreaterEqual(>). And NullIgnored, OnlyOnceRegistered. * * @param updatedTime The value of updatedTime as greaterEqual. */ @@ -1372,7 +1306,7 @@ } /** - * LessEqual(>). And NullIgnored, OnceRegistered. + * LessEqual(>). And NullIgnored, OnlyOnceRegistered. * * @param updatedTime The value of updatedTime as lessEqual. */ @@ -1382,7 +1316,7 @@ /** * FromTo($fromDate <= COLUMN_NAME <= $toDate). And NullIgnored, - * OnceRegistered. {NotNull : TIMESTAMP} + * OnlyOnceRegistered. {NotNull : TIMESTAMP} * * @param fromDate The from-date of updatedTime. (Nullable) * @param toDate The to-date of updatedTime. (Nullable) @@ -1400,7 +1334,7 @@ /** * FromTo($fromDate <= COLUMN_NAME < $toDate + 1). And NullIgnored, - * OnceRegistered. {NotNull : TIMESTAMP} + * OnlyOnceRegistered. {NotNull : TIMESTAMP} * * @param fromDate The from-date of updatedTime. (Nullable) * @param toDate The to-date of updatedTime. (Nullable) @@ -1426,7 +1360,7 @@ abstract protected ConditionValue getCValueUpdatedTime(); /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {NotNull : + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {NotNull : * VARCHAR(255)} * * @param updatedBy The value of updatedBy as equal. @@ -1436,7 +1370,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param updatedBy The value of updatedBy as notEqual. */ @@ -1445,7 +1379,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param updatedBy The value of updatedBy as greaterThan. */ @@ -1454,7 +1388,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param updatedBy The value of updatedBy as lessThan. */ @@ -1463,7 +1397,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param updatedBy The value of updatedBy as greaterEqual. */ @@ -1472,7 +1406,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param updatedBy The value of updatedBy as lessEqual. */ @@ -1481,7 +1415,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param updatedBy The value of updatedBy as prefixSearch. */ @@ -1490,20 +1424,6 @@ } /** - * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, - * SeveralRegistered. - * - * @param updatedBy The value of updatedBy as likeSearch. - * @param likeSearchOption The option of like-search. (NotNull) - */ - public void setUpdatedBy_LikeSearch( - String updatedBy, - jp.sf.pal.bookmark.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { - registerLikeSearchQuery(CK_LS, fRES(updatedBy), getCValueUpdatedBy(), - "UPDATED_BY", "UpdatedBy", "updatedBy", likeSearchOption); - } - - /** * InScope(in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * @@ -1514,27 +1434,41 @@ } /** - * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * - * @param updatedBy The collection of updatedBy as inScope. - * @param inScopeOption The option of in-scope. (NotNull) + * @param updatedByList The collection of updatedBy as notInScope. */ - public void setUpdatedBy_InScope( + public void setUpdatedBy_NotInScope(Collection updatedByList) { + regUpdatedBy(CK_NINS, cTL(updatedByList)); + } + + /** + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param updatedBy The value of updatedBy as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) + */ + public void setUpdatedBy_LikeSearch( String updatedBy, - jp.sf.pal.bookmark.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(updatedBy), getCValueUpdatedBy(), - "UPDATED_BY", "UpdatedBy", "updatedBy", inScopeOption); + jp.sf.pal.bookmark.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(updatedBy), getCValueUpdatedBy(), "UPDATED_BY", + "UpdatedBy", "updatedBy", likeSearchOption); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param updatedByList The collection of updatedBy as notInScope. + * @param updatedBy The value of updatedBy as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setUpdatedBy_NotInScope(Collection updatedByList) { - regUpdatedBy(CK_NINS, cTL(updatedByList)); + public void setUpdatedBy_NotLikeSearch( + String updatedBy, + jp.sf.pal.bookmark.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(updatedBy), getCValueUpdatedBy(), "UPDATED_BY", + "UpdatedBy", "updatedBy", likeSearchOption); } protected void regUpdatedBy(ConditionKey key, Object value) { @@ -1550,7 +1484,7 @@ abstract protected ConditionValue getCValueUpdatedBy(); /** - * Equal(=). And NullIgnored, OnceRegistered. {TIMESTAMP} + * Equal(=). And NullIgnored, OnlyOnceRegistered. {TIMESTAMP} * * @param deletedTime The value of deletedTime as equal. */ @@ -1559,7 +1493,7 @@ } /** - * NotEqual(!=). And NullIgnored, OnceRegistered. + * NotEqual(!=). And NullIgnored, OnlyOnceRegistered. * * @param deletedTime The value of deletedTime as notEqual. */ @@ -1568,7 +1502,7 @@ } /** - * GreaterThan(>). And NullIgnored, OnceRegistered. + * GreaterThan(>). And NullIgnored, OnlyOnceRegistered. * * @param deletedTime The value of deletedTime as greaterThan. */ @@ -1577,7 +1511,7 @@ } /** - * LessThan(>). And NullIgnored, OnceRegistered. + * LessThan(>). And NullIgnored, OnlyOnceRegistered. * * @param deletedTime The value of deletedTime as lessThan. */ @@ -1586,7 +1520,7 @@ } /** - * GreaterEqual(>). And NullIgnored, OnceRegistered. + * GreaterEqual(>). And NullIgnored, OnlyOnceRegistered. * * @param deletedTime The value of deletedTime as greaterEqual. */ @@ -1595,7 +1529,7 @@ } /** - * LessEqual(>). And NullIgnored, OnceRegistered. + * LessEqual(>). And NullIgnored, OnlyOnceRegistered. * * @param deletedTime The value of deletedTime as lessEqual. */ @@ -1605,7 +1539,7 @@ /** * FromTo($fromDate <= COLUMN_NAME <= $toDate). And NullIgnored, - * OnceRegistered. {TIMESTAMP} + * OnlyOnceRegistered. {TIMESTAMP} * * @param fromDate The from-date of deletedTime. (Nullable) * @param toDate The to-date of deletedTime. (Nullable) @@ -1623,7 +1557,7 @@ /** * FromTo($fromDate <= COLUMN_NAME < $toDate + 1). And NullIgnored, - * OnceRegistered. {TIMESTAMP} + * OnlyOnceRegistered. {TIMESTAMP} * * @param fromDate The from-date of deletedTime. (Nullable) * @param toDate The to-date of deletedTime. (Nullable) @@ -1637,14 +1571,14 @@ } /** - * IsNull(is null). And OnceRegistered. + * IsNull(is null). And OnlyOnceRegistered. */ public void setDeletedTime_IsNull() { regDeletedTime(CK_ISN, DUMMY_OBJECT); } /** - * IsNotNull(is not null). And OnceRegistered. + * IsNotNull(is not null). And OnlyOnceRegistered. */ public void setDeletedTime_IsNotNull() { regDeletedTime(CK_ISNN, DUMMY_OBJECT); @@ -1663,7 +1597,7 @@ abstract protected ConditionValue getCValueDeletedTime(); /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {VARCHAR(255)} + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {VARCHAR(255)} * * @param deletedBy The value of deletedBy as equal. */ @@ -1672,7 +1606,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param deletedBy The value of deletedBy as notEqual. */ @@ -1681,7 +1615,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param deletedBy The value of deletedBy as greaterThan. */ @@ -1690,7 +1624,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param deletedBy The value of deletedBy as lessThan. */ @@ -1699,7 +1633,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param deletedBy The value of deletedBy as greaterEqual. */ @@ -1708,7 +1642,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param deletedBy The value of deletedBy as lessEqual. */ @@ -1717,7 +1651,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param deletedBy The value of deletedBy as prefixSearch. */ @@ -1726,20 +1660,6 @@ } /** - * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, - * SeveralRegistered. - * - * @param deletedBy The value of deletedBy as likeSearch. - * @param likeSearchOption The option of like-search. (NotNull) - */ - public void setDeletedBy_LikeSearch( - String deletedBy, - jp.sf.pal.bookmark.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { - registerLikeSearchQuery(CK_LS, fRES(deletedBy), getCValueDeletedBy(), - "DELETED_BY", "DeletedBy", "deletedBy", likeSearchOption); - } - - /** * InScope(in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * @@ -1750,38 +1670,52 @@ } /** - * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * - * @param deletedBy The collection of deletedBy as inScope. - * @param inScopeOption The option of in-scope. (NotNull) + * @param deletedByList The collection of deletedBy as notInScope. */ - public void setDeletedBy_InScope( + public void setDeletedBy_NotInScope(Collection deletedByList) { + regDeletedBy(CK_NINS, cTL(deletedByList)); + } + + /** + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param deletedBy The value of deletedBy as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) + */ + public void setDeletedBy_LikeSearch( String deletedBy, - jp.sf.pal.bookmark.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(deletedBy), getCValueDeletedBy(), - "DELETED_BY", "DeletedBy", "deletedBy", inScopeOption); + jp.sf.pal.bookmark.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(deletedBy), getCValueDeletedBy(), "DELETED_BY", + "DeletedBy", "deletedBy", likeSearchOption); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param deletedByList The collection of deletedBy as notInScope. + * @param deletedBy The value of deletedBy as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setDeletedBy_NotInScope(Collection deletedByList) { - regDeletedBy(CK_NINS, cTL(deletedByList)); + public void setDeletedBy_NotLikeSearch( + String deletedBy, + jp.sf.pal.bookmark.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(deletedBy), getCValueDeletedBy(), "DELETED_BY", + "DeletedBy", "deletedBy", likeSearchOption); } /** - * IsNull(is null). And OnceRegistered. + * IsNull(is null). And OnlyOnceRegistered. */ public void setDeletedBy_IsNull() { regDeletedBy(CK_ISN, DUMMY_OBJECT); } /** - * IsNotNull(is not null). And OnceRegistered. + * IsNotNull(is not null). And OnlyOnceRegistered. */ public void setDeletedBy_IsNotNull() { regDeletedBy(CK_ISNN, DUMMY_OBJECT); @@ -1800,7 +1734,7 @@ abstract protected ConditionValue getCValueDeletedBy(); /** - * Equal(=). And NullIgnored, OnceRegistered. {NotNull : INTEGER} + * Equal(=). And NullIgnored, OnlyOnceRegistered. {NotNull : INTEGER} * * @param versionno The value of versionno as equal. */ @@ -1809,7 +1743,7 @@ } /** - * NotEqual(!=). And NullIgnored, OnceRegistered. + * NotEqual(!=). And NullIgnored, OnlyOnceRegistered. * * @param versionno The value of versionno as notEqual. */ @@ -1818,7 +1752,7 @@ } /** - * GreaterThan(>). And NullIgnored, OnceRegistered. + * GreaterThan(>). And NullIgnored, OnlyOnceRegistered. * * @param versionno The value of versionno as greaterThan. */ @@ -1827,7 +1761,7 @@ } /** - * LessThan(<). And NullIgnored, OnceRegistered. + * LessThan(<). And NullIgnored, OnlyOnceRegistered. * * @param versionno The value of versionno as lessThan. */ @@ -1836,7 +1770,7 @@ } /** - * GreaterEqual(>=). And NullIgnored, OnceRegistered. + * GreaterEqual(>=). And NullIgnored, OnlyOnceRegistered. * * @param versionno The value of versionno as greaterEqual. */ @@ -1845,7 +1779,7 @@ } /** - * LessEqual(<=). And NullIgnored, OnceRegistered. + * LessEqual(<=). And NullIgnored, OnlyOnceRegistered. * * @param versionno The value of versionno as lessEqual. */ @@ -1885,6 +1819,50 @@ abstract protected ConditionValue getCValueVersionno(); + public SSQFunction scalar_Equal() { + return xcreateSSQFunction("="); + } + + public SSQFunction scalar_GreaterEqual() { + return xcreateSSQFunction(">="); + } + + public SSQFunction scalar_GreaterThan() { + return xcreateSSQFunction(">"); + } + + public SSQFunction scalar_LessEqual() { + return xcreateSSQFunction("<="); + } + + public SSQFunction scalar_LessThan() { + return xcreateSSQFunction("<"); + } + + protected SSQFunction xcreateSSQFunction(final String operand) { + return new SSQFunction(new SSQSetupper() { + public void setup(String function, SubQuery subQuery) { + xscalarSubQuery(function, subQuery, operand); + } + }); + } + + protected void xscalarSubQuery(String function, + SubQuery subQuery, String operand) { + assertObjectNotNull("subQuery", subQuery); + GroupInfoCB cb = new GroupInfoCB(); + cb.xsetupForScalarSubQuery(); + subQuery.query(cb); + String subQueryPropertyName = keepScalarSubQuery(cb.query()); // for + // saving + // query + // -value. + registerScalarSubQuery(function, cb.query(), subQueryPropertyName, + operand); + } + + public abstract String keepScalarSubQuery(GroupInfoCQ subQuery); + // Very Internal (for Suppressing Warn about 'Not Use Import') protected String getConditionBeanClassNameInternally() { return GroupInfoCB.class.getName(); Modified: bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/cbean/cq/bs/AbstractBsGroupMappingCQ.java =================================================================== --- bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/cbean/cq/bs/AbstractBsGroupMappingCQ.java 2008-12-27 22:10:35 UTC (rev 1626) +++ bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/cbean/cq/bs/AbstractBsGroupMappingCQ.java 2008-12-27 22:11:51 UTC (rev 1627) @@ -11,16 +11,13 @@ import jp.sf.pal.bookmark.db.cbean.GroupInfoCB; import jp.sf.pal.bookmark.db.cbean.GroupMappingCB; import jp.sf.pal.bookmark.db.cbean.UserInfoCB; -import jp.sf.pal.bookmark.db.cbean.cq.GroupInfoCQ; import jp.sf.pal.bookmark.db.cbean.cq.GroupMappingCQ; -import jp.sf.pal.bookmark.db.cbean.cq.UserInfoCQ; /** * The abstract condition-query of GROUP_MAPPING. * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public abstract class AbstractBsGroupMappingCQ extends AbstractConditionQuery { //========================================================================== @@ -50,7 +47,8 @@ // ===== /** - * Equal(=). And NullIgnored, OnceRegistered. {PK : ID : NotNull : INTEGER} + * Equal(=). And NullIgnored, OnlyOnceRegistered. {PK : ID : NotNull : + * INTEGER} * * @param id The value of id as equal. */ @@ -59,7 +57,7 @@ } /** - * NotEqual(!=). And NullIgnored, OnceRegistered. + * NotEqual(!=). And NullIgnored, OnlyOnceRegistered. * * @param id The value of id as notEqual. */ @@ -68,7 +66,7 @@ } /** - * GreaterThan(>). And NullIgnored, OnceRegistered. + * GreaterThan(>). And NullIgnored, OnlyOnceRegistered. * * @param id The value of id as greaterThan. */ @@ -77,7 +75,7 @@ } /** - * LessThan(<). And NullIgnored, OnceRegistered. + * LessThan(<). And NullIgnored, OnlyOnceRegistered. * * @param id The value of id as lessThan. */ @@ -86,7 +84,7 @@ } /** - * GreaterEqual(>=). And NullIgnored, OnceRegistered. + * GreaterEqual(>=). And NullIgnored, OnlyOnceRegistered. * * @param id The value of id as greaterEqual. */ @@ -95,7 +93,7 @@ } /** - * LessEqual(<=). And NullIgnored, OnceRegistered. + * LessEqual(<=). And NullIgnored, OnlyOnceRegistered. * * @param id The value of id as lessEqual. */ @@ -124,14 +122,14 @@ } /** - * IsNull(is null). And OnceRegistered. + * IsNull(is null). And OnlyOnceRegistered. */ public void setId_IsNull() { regId(CK_ISN, DUMMY_OBJECT); } /** - * IsNotNull(is not null). And OnceRegistered. + * IsNotNull(is not null). And OnlyOnceRegistered. */ public void setId_IsNotNull() { regId(CK_ISNN, DUMMY_OBJECT); @@ -148,8 +146,8 @@ abstract protected ConditionValue getCValueId(); /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {NotNull : VARCHAR(255) - * : FK to USER_INFO} + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {NotNull : + * VARCHAR(255) : FK to USER_INFO} * * @param userId The value of userId as equal. */ @@ -158,7 +156,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param userId The value of userId as notEqual. */ @@ -167,7 +165,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param userId The value of userId as greaterThan. */ @@ -176,7 +174,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param userId The value of userId as lessThan. */ @@ -185,7 +183,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param userId The value of userId as greaterEqual. */ @@ -194,7 +192,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param userId The value of userId as lessEqual. */ @@ -203,7 +201,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param userId The value of userId as prefixSearch. */ @@ -212,20 +210,6 @@ } /** - * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, - * SeveralRegistered. - * - * @param userId The value of userId as likeSearch. - * @param likeSearchOption The option of like-search. (NotNull) - */ - public void setUserId_LikeSearch( - String userId, - jp.sf.pal.bookmark.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { - registerLikeSearchQuery(CK_LS, fRES(userId), getCValueUserId(), - "USER_ID", "UserId", "userId", likeSearchOption); - } - - /** * InScope(in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * @@ -236,42 +220,41 @@ } /** - * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * - * @param userId The collection of userId as inScope. - * @param inScopeOption The option of in-scope. (NotNull) + * @param userIdList The collection of userId as notInScope. */ - public void setUserId_InScope( - String userId, - jp.sf.pal.bookmark.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(userId), getCValueUserId(), - "USER_ID", "UserId", "userId", inScopeOption); + public void setUserId_NotInScope(Collection userIdList) { + regUserId(CK_NINS, cTL(userIdList)); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param userIdList The collection of userId as notInScope. + * @param userId The value of userId as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) */ - public void setUserId_NotInScope(Collection userIdList) { - regUserId(CK_NINS, cTL(userIdList)); + public void setUserId_LikeSearch( + String userId, + jp.sf.pal.bookmark.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(userId), getCValueUserId(), "USER_ID", "UserId", + "userId", likeSearchOption); } /** - * @param userInfoCBquery Query. - * @deprecated Please use inScopeUserInfo(subQuery) method. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param userId The value of userId as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setUserId_InScopeSubQuery_UserInfo(UserInfoCQ userInfoCBquery) { - String subQueryPropertyName = keepUserId_InScopeSubQuery_UserInfo(userInfoCBquery);// for - // saving - // query - // - - // value - // . - registerInScopeSubQuery(userInfoCBquery, "USER_ID", "USER_ID", - subQueryPropertyName); + public void setUserId_NotLikeSearch( + String userId, + jp.sf.pal.bookmark.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(userId), getCValueUserId(), "USER_ID", "UserId", + "userId", likeSearchOption); } public void inScopeUserInfo(SubQuery subQuery) { @@ -280,12 +263,12 @@ cb.xsetupForInScopeSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepUserId_InScopeSubQuery_UserInfo(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerInScopeSubQuery(cb.query(), "USER_ID", "USER_ID", subQueryPropertyName); } - abstract public String keepUserId_InScopeSubQuery_UserInfo( + public abstract String keepUserId_InScopeSubQuery_UserInfo( jp.sf.pal.bookmark.db.cbean.cq.UserInfoCQ subQuery); protected void regUserId(ConditionKey key, Object value) { @@ -301,8 +284,8 @@ abstract protected ConditionValue getCValueUserId(); /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {NotNull : VARCHAR(255) - * : FK to GROUP_INFO} + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {NotNull : + * VARCHAR(255) : FK to GROUP_INFO} * * @param groupId The value of groupId as equal. */ @@ -311,7 +294,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param groupId The value of groupId as notEqual. */ @@ -320,7 +303,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param groupId The value of groupId as greaterThan. */ @@ -329,7 +312,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param groupId The value of groupId as lessThan. */ @@ -338,7 +321,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param groupId The value of groupId as greaterEqual. */ @@ -347,7 +330,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param groupId The value of groupId as lessEqual. */ @@ -356,7 +339,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param groupId The value of groupId as prefixSearch. */ @@ -365,20 +348,6 @@ } /** - * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, - * SeveralRegistered. - * - * @param groupId The value of groupId as likeSearch. - * @param likeSearchOption The option of like-search. (NotNull) - */ - public void setGroupId_LikeSearch( - String groupId, - jp.sf.pal.bookmark.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { - registerLikeSearchQuery(CK_LS, fRES(groupId), getCValueGroupId(), - "GROUP_ID", "GroupId", "groupId", likeSearchOption); - } - - /** * InScope(in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * @@ -389,43 +358,41 @@ } /** - * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * - * @param groupId The collection of groupId as inScope. - * @param inScopeOption The option of in-scope. (NotNull) + * @param groupIdList The collection of groupId as notInScope. */ - public void setGroupId_InScope( - String groupId, - jp.sf.pal.bookmark.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(groupId), getCValueGroupId(), - "GROUP_ID", "GroupId", "groupId", inScopeOption); + public void setGroupId_NotInScope(Collection groupIdList) { + regGroupId(CK_NINS, cTL(groupIdList)); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param groupIdList The collection of groupId as notInScope. + * @param groupId The value of groupId as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) */ - public void setGroupId_NotInScope(Collection groupIdList) { - regGroupId(CK_NINS, cTL(groupIdList)); + public void setGroupId_LikeSearch( + String groupId, + jp.sf.pal.bookmark.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(groupId), getCValueGroupId(), "GROUP_ID", "GroupId", + "groupId", likeSearchOption); } /** - * @param groupInfoCBquery Query. - * @deprecated Please use inScopeGroupInfo(subQuery) method. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param groupId The value of groupId as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setGroupId_InScopeSubQuery_GroupInfo( - GroupInfoCQ groupInfoCBquery) { - String subQueryPropertyName = keepGroupId_InScopeSubQuery_GroupInfo(groupInfoCBquery);// for - // saving - // query - // - - // value - // . - registerInScopeSubQuery(groupInfoCBquery, "GROUP_ID", "GROUP_ID", - subQueryPropertyName); + public void setGroupId_NotLikeSearch( + String groupId, + jp.sf.pal.bookmark.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(groupId), getCValueGroupId(), "GROUP_ID", + "GroupId", "groupId", likeSearchOption); } public void inScopeGroupInfo(SubQuery subQuery) { @@ -434,12 +401,12 @@ cb.xsetupForInScopeSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepGroupId_InScopeSubQuery_GroupInfo(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerInScopeSubQuery(cb.query(), "GROUP_ID", "GROUP_ID", subQueryPropertyName); } - abstract public String keepGroupId_InScopeSubQuery_GroupInfo( + public abstract String keepGroupId_InScopeSubQuery_GroupInfo( jp.sf.pal.bookmark.db.cbean.cq.GroupInfoCQ subQuery); protected void regGroupId(ConditionKey key, Object value) { @@ -454,6 +421,53 @@ abstract protected ConditionValue getCValueGroupId(); + public SSQFunction scalar_Equal() { + return xcreateSSQFunction("="); + } + + public SSQFunction scalar_GreaterEqual() { + return xcreateSSQFunction(">="); + } + + public SSQFunction scalar_GreaterThan() { + return xcreateSSQFunction(">"); + } + + public SSQFunction scalar_LessEqual() { + return xcreateSSQFunction("<="); + } + + public SSQFunction scalar_LessThan() { + return xcreateSSQFunction("<"); + } + + protected SSQFunction xcreateSSQFunction( + final String operand) { + return new SSQFunction( + new SSQSetupper() { + public void setup(String function, + SubQuery subQuery) { + xscalarSubQuery(function, subQuery, operand); + } + }); + } + + protected void xscalarSubQuery(String function, + SubQuery subQuery, String operand) { + assertObjectNotNull("subQuery", subQuery); + GroupMappingCB cb = new GroupMappingCB(); + cb.xsetupForScalarSubQuery(); + subQuery.query(cb); + String subQueryPropertyName = keepScalarSubQuery(cb.query()); // for + // saving + // query + // -value. + registerScalarSubQuery(function, cb.query(), subQueryPropertyName, + operand); + } + + public abstract String keepScalarSubQuery(GroupMappingCQ subQuery); + // Very Internal (for Suppressing Warn about 'Not Use Import') protected String getConditionBeanClassNameInternally() { return GroupMappingCB.class.getName(); Modified: bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/cbean/cq/bs/AbstractBsRoleInfoCQ.java =================================================================== --- bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/cbean/cq/bs/AbstractBsRoleInfoCQ.java 2008-12-27 22:10:35 UTC (rev 1626) +++ bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/cbean/cq/bs/AbstractBsRoleInfoCQ.java 2008-12-27 22:11:51 UTC (rev 1627) @@ -20,7 +20,6 @@ * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public abstract class AbstractBsRoleInfoCQ extends AbstractConditionQuery { //========================================================================== @@ -50,7 +49,7 @@ // ===== /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {PK : NotNull : + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {PK : NotNull : * VARCHAR(255)} * * @param roleId The value of roleId as equal. @@ -60,7 +59,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param roleId The value of roleId as notEqual. */ @@ -69,7 +68,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param roleId The value of roleId as greaterThan. */ @@ -78,7 +77,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param roleId The value of roleId as lessThan. */ @@ -87,7 +86,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param roleId The value of roleId as greaterEqual. */ @@ -96,7 +95,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param roleId The value of roleId as lessEqual. */ @@ -105,7 +104,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param roleId The value of roleId as prefixSearch. */ @@ -114,20 +113,6 @@ } /** - * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, - * SeveralRegistered. - * - * @param roleId The value of roleId as likeSearch. - * @param likeSearchOption The option of like-search. (NotNull) - */ - public void setRoleId_LikeSearch( - String roleId, - jp.sf.pal.bookmark.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { - registerLikeSearchQuery(CK_LS, fRES(roleId), getCValueRoleId(), - "ROLE_ID", "RoleId", "roleId", likeSearchOption); - } - - /** * InScope(in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * @@ -138,43 +123,41 @@ } /** - * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * - * @param roleId The collection of roleId as inScope. - * @param inScopeOption The option of in-scope. (NotNull) + * @param roleIdList The collection of roleId as notInScope. */ - public void setRoleId_InScope( - String roleId, - jp.sf.pal.bookmark.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(roleId), getCValueRoleId(), - "ROLE_ID", "RoleId", "roleId", inScopeOption); + public void setRoleId_NotInScope(Collection roleIdList) { + regRoleId(CK_NINS, cTL(roleIdList)); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param roleIdList The collection of roleId as notInScope. + * @param roleId The value of roleId as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) */ - public void setRoleId_NotInScope(Collection roleIdList) { - regRoleId(CK_NINS, cTL(roleIdList)); + public void setRoleId_LikeSearch( + String roleId, + jp.sf.pal.bookmark.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(roleId), getCValueRoleId(), "ROLE_ID", "RoleId", + "roleId", likeSearchOption); } /** - * @param roleMappingCBquery Query. - * @deprecated Please use inScopeRoleMappingList(subQuery) method. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param roleId The value of roleId as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setRoleId_InScopeSubQuery_RoleMappingList( - RoleMappingCQ roleMappingCBquery) { - String subQueryPropertyName = keepRoleId_InScopeSubQuery_RoleMappingList(roleMappingCBquery);// for - // saving - // query - // - - // value - // . - registerInScopeSubQuery(roleMappingCBquery, "ROLE_ID", "ROLE_ID", - subQueryPropertyName); + public void setRoleId_NotLikeSearch( + String roleId, + jp.sf.pal.bookmark.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(roleId), getCValueRoleId(), "ROLE_ID", "RoleId", + "roleId", likeSearchOption); } public void inScopeRoleMappingList(SubQuery subQuery) { @@ -183,42 +166,26 @@ cb.xsetupForInScopeSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepRoleId_InScopeSubQuery_RoleMappingList(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerInScopeSubQuery(cb.query(), "ROLE_ID", "ROLE_ID", subQueryPropertyName); } - abstract public String keepRoleId_InScopeSubQuery_RoleMappingList( + public abstract String keepRoleId_InScopeSubQuery_RoleMappingList( RoleMappingCQ subQuery); - /** - * @param userInfoCBquery Query. - * @deprecated Please use inScopeUserInfoList(subQuery) method. - */ - public void setRoleId_InScopeSubQuery_UserInfoList( - UserInfoCQ userInfoCBquery) { - String subQueryPropertyName = keepRoleId_InScopeSubQuery_UserInfoList(userInfoCBquery);// for - // saving - // query - // - - // value - // . - registerInScopeSubQuery(userInfoCBquery, "ROLE_ID", "ROLE_ID", - subQueryPropertyName); - } - public void inScopeUserInfoList(SubQuery subQuery) { assertObjectNotNull("subQuery", subQuery); UserInfoCB cb = new UserInfoCB(); cb.xsetupForInScopeSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepRoleId_InScopeSubQuery_UserInfoList(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerInScopeSubQuery(cb.query(), "ROLE_ID", "ROLE_ID", subQueryPropertyName); } - abstract public String keepRoleId_InScopeSubQuery_UserInfoList( + public abstract String keepRoleId_InScopeSubQuery_UserInfoList( UserInfoCQ subQuery); public void notInScopeRoleMappingList(SubQuery subQuery) { @@ -227,12 +194,12 @@ cb.xsetupForInScopeSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepRoleId_NotInScopeSubQuery_RoleMappingList(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerNotInScopeSubQuery(cb.query(), "ROLE_ID", "ROLE_ID", subQueryPropertyName); } - abstract public String keepRoleId_NotInScopeSubQuery_RoleMappingList( + public abstract String keepRoleId_NotInScopeSubQuery_RoleMappingList( RoleMappingCQ subQuery); public void notInScopeUserInfoList(SubQuery subQuery) { @@ -241,31 +208,15 @@ cb.xsetupForInScopeSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepRoleId_NotInScopeSubQuery_UserInfoList(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerNotInScopeSubQuery(cb.query(), "ROLE_ID", "ROLE_ID", subQueryPropertyName); } - abstract public String keepRoleId_NotInScopeSubQuery_UserInfoList( + public abstract String keepRoleId_NotInScopeSubQuery_UserInfoList( UserInfoCQ subQuery); /** - * @param roleMappingCBquery Query. - * @deprecated Please use existsRoleMappingList(subQuery) method. - */ - public void setRoleId_ExistsSubQuery_RoleMappingList( - RoleMappingCQ roleMappingCBquery) { - String subQueryPropertyName = keepRoleId_ExistsSubQuery_RoleMappingList(roleMappingCBquery);// for - // saving - // query - // - - // value - // . - registerExistsSubQuery(roleMappingCBquery, "ROLE_ID", "ROLE_ID", - subQueryPropertyName); - } - - /** * Set up 'exists' sub-query. {exists (select ROLE_ID from ROLE_MAPPING * where ...)} * @@ -278,30 +229,15 @@ cb.xsetupForExistsSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepRoleId_ExistsSubQuery_RoleMappingList(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerExistsSubQuery(cb.query(), "ROLE_ID", "ROLE_ID", subQueryPropertyName); } - abstract public String keepRoleId_ExistsSubQuery_RoleMappingList( + public abstract String keepRoleId_ExistsSubQuery_RoleMappingList( RoleMappingCQ subQuery); /** - * @param userInfoCBquery Query. - * @deprecated Please use existsUserInfoList(subQuery) method. - */ - public void setRoleId_ExistsSubQuery_UserInfoList(UserInfoCQ userInfoCBquery) { - String subQueryPropertyName = keepRoleId_ExistsSubQuery_UserInfoList(userInfoCBquery);// for - // saving - // query - // - - // value - // . - registerExistsSubQuery(userInfoCBquery, "ROLE_ID", "ROLE_ID", - subQueryPropertyName); - } - - /** * Set up 'exists' sub-query. {exists (select ROLE_ID from USER_INFO where * ...)} * @@ -314,12 +250,12 @@ cb.xsetupForExistsSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepRoleId_ExistsSubQuery_UserInfoList(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerExistsSubQuery(cb.query(), "ROLE_ID", "ROLE_ID", subQueryPropertyName); } - abstract public String keepRoleId_ExistsSubQuery_UserInfoList( + public abstract String keepRoleId_ExistsSubQuery_UserInfoList( UserInfoCQ subQuery); /** @@ -335,12 +271,12 @@ cb.xsetupForExistsSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepRoleId_NotExistsSubQuery_RoleMappingList(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerNotExistsSubQuery(cb.query(), "ROLE_ID", "ROLE_ID", subQueryPropertyName); } - abstract public String keepRoleId_NotExistsSubQuery_RoleMappingList( + public abstract String keepRoleId_NotExistsSubQuery_RoleMappingList( RoleMappingCQ subQuery); /** @@ -356,53 +292,53 @@ cb.xsetupForExistsSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepRoleId_NotExistsSubQuery_UserInfoList(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerNotExistsSubQuery(cb.query(), "ROLE_ID", "ROLE_ID", subQueryPropertyName); } - abstract public String keepRoleId_NotExistsSubQuery_UserInfoList( + public abstract String keepRoleId_NotExistsSubQuery_UserInfoList( UserInfoCQ subQuery); public void xderiveRoleMappingList(String function, SubQuery subQuery, String aliasName) { assertObjectNotNull("subQuery", subQuery); RoleMappingCB cb = new RoleMappingCB(); - cb.xsetupForDeriveReferrer(); + cb.xsetupForDerivedReferrer(); subQuery.query(cb); - String subQueryPropertyName = keepRoleId_DeriveSubQuery_RoleMappingList(cb - .query());// for saving query-value. - registerDeriveSubQuery(function, cb.query(), "ROLE_ID", "ROLE_ID", - subQueryPropertyName, aliasName); + String subQueryPropertyName = keepRoleId_DerivedReferrer_RoleMappingList(cb + .query()); // for saving query-value. + registerDerivedReferrerSubQuery(function, cb.query(), "ROLE_ID", + "ROLE_ID", subQueryPropertyName, aliasName); } - abstract public String keepRoleId_DeriveSubQuery_RoleMappingList( + public abstract String keepRoleId_DerivedReferrer_RoleMappingList( RoleMappingCQ subQuery); public void xderiveUserInfoList(String function, SubQuery subQuery, String aliasName) { assertObjectNotNull("subQuery", subQuery); UserInfoCB cb = new UserInfoCB(); - cb.xsetupForDeriveReferrer(); + cb.xsetupForDerivedReferrer(); subQuery.query(cb); - String subQueryPropertyName = keepRoleId_DeriveSubQuery_UserInfoList(cb - .query());// for saving query-value. - registerDeriveSubQuery(function, cb.query(), "ROLE_ID", "ROLE_ID", - subQueryPropertyName, aliasName); + String subQueryPropertyName = keepRoleId_DerivedReferrer_UserInfoList(cb + .query()); // for saving query-value. + registerDerivedReferrerSubQuery(function, cb.query(), "ROLE_ID", + "ROLE_ID", subQueryPropertyName, aliasName); } - abstract public String keepRoleId_DeriveSubQuery_UserInfoList( + public abstract String keepRoleId_DerivedReferrer_UserInfoList( UserInfoCQ subQuery); /** - * IsNull(is null). And OnceRegistered. + * IsNull(is null). And OnlyOnceRegistered. */ public void setRoleId_IsNull() { regRoleId(CK_ISN, DUMMY_OBJECT); } /** - * IsNotNull(is not null). And OnceRegistered. + * IsNotNull(is not null). And OnlyOnceRegistered. */ public void setRoleId_IsNotNull() { regRoleId(CK_ISNN, DUMMY_OBJECT); @@ -421,7 +357,7 @@ abstract protected ConditionValue getCValueRoleId(); /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {VARCHAR(100)} + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {VARCHAR(100)} * * @param name The value of name as equal. */ @@ -430,7 +366,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param name The value of name as notEqual. */ @@ -439,7 +375,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param name The value of name as greaterThan. */ @@ -448,7 +384,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param name The value of name as lessThan. */ @@ -457,7 +393,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param name The value of name as greaterEqual. */ @@ -466,7 +402,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param name The value of name as lessEqual. */ @@ -475,7 +411,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param name The value of name as prefixSearch. */ @@ -484,20 +420,6 @@ } /** - * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, - * SeveralRegistered. - * - * @param name The value of name as likeSearch. - * @param likeSearchOption The option of like-search. (NotNull) - */ - public void setName_LikeSearch( - String name, - jp.sf.pal.bookmark.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { - registerLikeSearchQuery(CK_LS, fRES(name), getCValueName(), "NAME", - "Name", "name", likeSearchOption); - } - - /** * InScope(in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * @@ -508,38 +430,52 @@ } /** - * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * - * @param name The collection of name as inScope. - * @param inScopeOption The option of in-scope. (NotNull) + * @param nameList The collection of name as notInScope. */ - public void setName_InScope( + public void setName_NotInScope(Collection nameList) { + regName(CK_NINS, cTL(nameList)); + } + + /** + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param name The value of name as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) + */ + public void setName_LikeSearch( String name, - jp.sf.pal.bookmark.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(name), getCValueName(), "NAME", - "Name", "name", inScopeOption); + jp.sf.pal.bookmark.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(name), getCValueName(), "NAME", "Name", "name", + likeSearchOption); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param nameList The collection of name as notInScope. + * @param name The value of name as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setName_NotInScope(Collection nameList) { - regName(CK_NINS, cTL(nameList)); + public void setName_NotLikeSearch( + String name, + jp.sf.pal.bookmark.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(name), getCValueName(), "NAME", "Name", "name", + likeSearchOption); } /** - * IsNull(is null). And OnceRegistered. + * IsNull(is null). And OnlyOnceRegistered. */ public void setName_IsNull() { regName(CK_ISN, DUMMY_OBJECT); } /** - * IsNotNull(is not null). And OnceRegistered. + * IsNotNull(is not null). And OnlyOnceRegistered. */ public void setName_IsNotNull() { regName(CK_ISNN, DUMMY_OBJECT); @@ -556,7 +492,7 @@ abstract protected ConditionValue getCValueName(); /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {VARCHAR(255)} + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {VARCHAR(255)} * * @param description The value of description as equal. */ @@ -565,7 +501,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param description The value of description as notEqual. */ @@ -574,7 +510,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param description The value of description as greaterThan. */ @@ -583,7 +519,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param description The value of description as lessThan. */ @@ -592,7 +528,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param description The value of description as greaterEqual. */ @@ -601,7 +537,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param description The value of description as lessEqual. */ @@ -610,7 +546,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param description The value of description as prefixSearch. */ @@ -619,21 +555,6 @@ } /** - * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, - * SeveralRegistered. - * - * @param description The value of description as likeSearch. - * @param likeSearchOption The option of like-search. (NotNull) - */ - public void setDescription_LikeSearch( - String description, - jp.sf.pal.bookmark.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { - registerLikeSearchQuery(CK_LS, fRES(description), - getCValueDescription(), "DESCRIPTION", "Description", - "description", likeSearchOption); - } - - /** * InScope(in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * @@ -644,38 +565,52 @@ } /** - * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * - * @param description The collection of description as inScope. - * @param inScopeOption The option of in-scope. (NotNull) + * @param descriptionList The collection of description as notInScope. */ - public void setDescription_InScope( + public void setDescription_NotInScope(Collection descriptionList) { + regDescription(CK_NINS, cTL(descriptionList)); + } + + /** + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param description The value of description as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) + */ + public void setDescription_LikeSearch( String description, - jp.sf.pal.bookmark.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(description), getCValueDescription(), - "DESCRIPTION", "Description", "description", inScopeOption); + jp.sf.pal.bookmark.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(description), getCValueDescription(), "DESCRIPTION", + "Description", "description", likeSearchOption); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param descriptionList The collection of description as notInScope. + * @param description The value of description as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setDescription_NotInScope(Collection descriptionList) { - regDescription(CK_NINS, cTL(descriptionList)); + public void setDescription_NotLikeSearch( + String description, + jp.sf.pal.bookmark.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(description), getCValueDescription(), + "DESCRIPTION", "Description", "description", likeSearchOption); } /** - * IsNull(is null). And OnceRegistered. + * IsNull(is null). And OnlyOnceRegistered. */ public void setDescription_IsNull() { regDescription(CK_ISN, DUMMY_OBJECT); } /** - * IsNotNull(is not null). And OnceRegistered. + * IsNotNull(is not null). And OnlyOnceRegistered. */ public void setDescription_IsNotNull() { regDescription(CK_ISNN, DUMMY_OBJECT); @@ -694,7 +629,7 @@ abstract protected ConditionValue getCValueDescription(); /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {VARCHAR(255)} + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {VARCHAR(255)} * * @param email The value of email as equal. */ @@ -703,7 +638,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param email The value of email as notEqual. */ @@ -712,7 +647,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param email The value of email as greaterThan. */ @@ -721,7 +656,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param email The value of email as lessThan. */ @@ -730,7 +665,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param email The value of email as greaterEqual. */ @@ -739,7 +674,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param email The value of email as lessEqual. */ @@ -748,7 +683,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param email The value of email as prefixSearch. */ @@ -757,20 +692,6 @@ } /** - * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, - * SeveralRegistered. - * - * @param email The value of email as likeSearch. - * @param likeSearchOption The option of like-search. (NotNull) - */ - public void setEmail_LikeSearch( - String email, - jp.sf.pal.bookmark.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { - registerLikeSearchQuery(CK_LS, fRES(email), getCValueEmail(), "EMAIL", - "Email", "email", likeSearchOption); - } - - /** * InScope(in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * @@ -781,38 +702,52 @@ } /** - * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * - * @param email The collection of email as inScope. - * @param inScopeOption The option of in-scope. (NotNull) + * @param emailList The collection of email as notInScope. */ - public void setEmail_InScope( + public void setEmail_NotInScope(Collection emailList) { + regEmail(CK_NINS, cTL(emailList)); + } + + /** + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param email The value of email as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) + */ + public void setEmail_LikeSearch( String email, - jp.sf.pal.bookmark.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(email), getCValueEmail(), "EMAIL", - "Email", "email", inScopeOption); + jp.sf.pal.bookmark.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(email), getCValueEmail(), "EMAIL", "Email", "email", + likeSearchOption); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param emailList The collection of email as notInScope. + * @param email The value of email as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setEmail_NotInScope(Collection emailList) { - regEmail(CK_NINS, cTL(emailList)); + public void setEmail_NotLikeSearch( + String email, + jp.sf.pal.bookmark.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(email), getCValueEmail(), "EMAIL", "Email", + "email", likeSearchOption); } /** - * IsNull(is null). And OnceRegistered. + * IsNull(is null). And OnlyOnceRegistered. */ public void setEmail_IsNull() { regEmail(CK_ISN, DUMMY_OBJECT); } /** - * IsNotNull(is not null). And OnceRegistered. + * IsNotNull(is not null). And OnlyOnceRegistered. */ public void setEmail_IsNotNull() { regEmail(CK_ISNN, DUMMY_OBJECT); @@ -830,7 +765,7 @@ abstract protected ConditionValue getCValueEmail(); /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {VARCHAR(255)} + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {VARCHAR(255)} * * @param url The value of url as equal. */ @@ -839,7 +774,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param url The value of url as notEqual. */ @@ -848,7 +783,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param url The value of url as greaterThan. */ @@ -857,7 +792,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param url The value of url as lessThan. */ @@ -866,7 +801,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param url The value of url as greaterEqual. */ @@ -875,7 +810,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param url The value of url as lessEqual. */ @@ -884,7 +819,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param url The value of url as prefixSearch. */ @@ -893,20 +828,6 @@ } /** - * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, - * SeveralRegistered. - * - * @param url The value of url as likeSearch. - * @param likeSearchOption The option of like-search. (NotNull) - */ - public void setUrl_LikeSearch( - String url, - jp.sf.pal.bookmark.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { - registerLikeSearchQuery(CK_LS, fRES(url), getCValueUrl(), "URL", "Url", - "url", likeSearchOption); - } - - /** * InScope(in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * @@ -917,38 +838,52 @@ } /** - * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * - * @param url The collection of url as inScope. - * @param inScopeOption The option of in-scope. (NotNull) + * @param urlList The collection of url as notInScope. */ - public void setUrl_InScope( + public void setUrl_NotInScope(Collection urlList) { + regUrl(CK_NINS, cTL(urlList)); + } + + /** + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param url The value of url as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) + */ + public void setUrl_LikeSearch( String url, - jp.sf.pal.bookmark.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(url), getCValueUrl(), "URL", "Url", - "url", inScopeOption); + jp.sf.pal.bookmark.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(url), getCValueUrl(), "URL", "Url", "url", + likeSearchOption); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param urlList The collection of url as notInScope. + * @param url The value of url as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setUrl_NotInScope(Collection urlList) { - regUrl(CK_NINS, cTL(urlList)); + public void setUrl_NotLikeSearch( + String url, + jp.sf.pal.bookmark.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(url), getCValueUrl(), "URL", "Url", "url", + likeSearchOption); } /** - * IsNull(is null). And OnceRegistered. + * IsNull(is null). And OnlyOnceRegistered. */ public void setUrl_IsNull() { regUrl(CK_ISN, DUMMY_OBJECT); } /** - * IsNotNull(is not null). And OnceRegistered. + * IsNotNull(is not null). And OnlyOnceRegistered. */ public void setUrl_IsNotNull() { regUrl(CK_ISNN, DUMMY_OBJECT); @@ -965,7 +900,7 @@ abstract protected ConditionValue getCValueUrl(); /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {VARCHAR(40)} + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {VARCHAR(40)} * * @param telephone The value of telephone as equal. */ @@ -974,7 +909,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param telephone The value of telephone as notEqual. */ @@ -983,7 +918,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param telephone The value of telephone as greaterThan. */ @@ -992,7 +927,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param telephone The value of telephone as lessThan. */ @@ -1001,7 +936,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param telephone The value of telephone as greaterEqual. */ @@ -1010,7 +945,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param telephone The value of telephone as lessEqual. */ @@ -1019,7 +954,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param telephone The value of telephone as prefixSearch. */ @@ -1028,20 +963,6 @@ } /** - * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, - * SeveralRegistered. - * - * @param telephone The value of telephone as likeSearch. - * @param likeSearchOption The option of like-search. (NotNull) - */ - public void setTelephone_LikeSearch( - String telephone, - jp.sf.pal.bookmark.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { - registerLikeSearchQuery(CK_LS, fRES(telephone), getCValueTelephone(), - "TELEPHONE", "Telephone", "telephone", likeSearchOption); - } - - /** * InScope(in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * @@ -1052,38 +973,52 @@ } /** - * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * - * @param telephone The collection of telephone as inScope. - * @param inScopeOption The option of in-scope. (NotNull) + * @param telephoneList The collection of telephone as notInScope. */ - public void setTelephone_InScope( + public void setTelephone_NotInScope(Collection telephoneList) { + regTelephone(CK_NINS, cTL(telephoneList)); + } + + /** + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param telephone The value of telephone as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) + */ + public void setTelephone_LikeSearch( String telephone, - jp.sf.pal.bookmark.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(telephone), getCValueTelephone(), - "TELEPHONE", "Telephone", "telephone", inScopeOption); + jp.sf.pal.bookmark.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(telephone), getCValueTelephone(), "TELEPHONE", + "Telephone", "telephone", likeSearchOption); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param telephoneList The collection of telephone as notInScope. + * @param telephone The value of telephone as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setTelephone_NotInScope(Collection telephoneList) { - regTelephone(CK_NINS, cTL(telephoneList)); + public void setTelephone_NotLikeSearch( + String telephone, + jp.sf.pal.bookmark.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(telephone), getCValueTelephone(), "TELEPHONE", + "Telephone", "telephone", likeSearchOption); } /** - * IsNull(is null). And OnceRegistered. + * IsNull(is null). And OnlyOnceRegistered. */ public void setTelephone_IsNull() { regTelephone(CK_ISN, DUMMY_OBJECT); } /** - * IsNotNull(is not null). And OnceRegistered. + * IsNotNull(is not null). And OnlyOnceRegistered. */ public void setTelephone_IsNotNull() { regTelephone(CK_ISNN, DUMMY_OBJECT); @@ -1102,7 +1037,7 @@ abstract protected ConditionValue getCValueTelephone(); /** - * Equal(=). And NullIgnored, OnceRegistered. {NotNull : TIMESTAMP} + * Equal(=). And NullIgnored, OnlyOnceRegistered. {NotNull : TIMESTAMP} * * @param createdTime The value of createdTime as equal. */ @@ -1111,7 +1046,7 @@ } /** - * NotEqual(!=). And NullIgnored, OnceRegistered. + * NotEqual(!=). And NullIgnored, OnlyOnceRegistered. * * @param createdTime The value of createdTime as notEqual. */ @@ -1120,7 +1055,7 @@ } /** - * GreaterThan(>). And NullIgnored, OnceRegistered. + * GreaterThan(>). And NullIgnored, OnlyOnceRegistered. * * @param createdTime The value of createdTime as greaterThan. */ @@ -1129,7 +1064,7 @@ } /** - * LessThan(>). And NullIgnored, OnceRegistered. + * LessThan(>). And NullIgnored, OnlyOnceRegistered. * * @param createdTime The value of createdTime as lessThan. */ @@ -1138,7 +1073,7 @@ } /** - * GreaterEqual(>). And NullIgnored, OnceRegistered. + * GreaterEqual(>). And NullIgnored, OnlyOnceRegistered. * * @param createdTime The value of createdTime as greaterEqual. */ @@ -1147,7 +1082,7 @@ } /** - * LessEqual(>). And NullIgnored, OnceRegistered. + * LessEqual(>). And NullIgnored, OnlyOnceRegistered. * * @param createdTime The value of createdTime as lessEqual. */ @@ -1157,7 +1092,7 @@ /** * FromTo($fromDate <= COLUMN_NAME <= $toDate). And NullIgnored, - * OnceRegistered. {NotNull : TIMESTAMP} + * OnlyOnceRegistered. {NotNull : TIMESTAMP} * * @param fromDate The from-date of createdTime. (Nullable) * @param toDate The to-date of createdTime. (Nullable) @@ -1175,7 +1110,7 @@ /** * FromTo($fromDate <= COLUMN_NAME < $toDate + 1). And NullIgnored, - * OnceRegistered. {NotNull : TIMESTAMP} + * OnlyOnceRegistered. {NotNull : TIMESTAMP} * * @param fromDate The from-date of createdTime. (Nullable) * @param toDate The to-date of createdTime. (Nullable) @@ -1201,7 +1136,7 @@ abstract protected ConditionValue getCValueCreatedTime(); /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {NotNull : + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {NotNull : * VARCHAR(255)} * * @param createdBy The value of createdBy as equal. @@ -1211,7 +1146,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param createdBy The value of createdBy as notEqual. */ @@ -1220,7 +1155,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param createdBy The value of createdBy as greaterThan. */ @@ -1229,7 +1164,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param createdBy The value of createdBy as lessThan. */ @@ -1238,7 +1173,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param createdBy The value of createdBy as greaterEqual. */ @@ -1247,7 +1182,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param createdBy The value of createdBy as lessEqual. */ @@ -1256,7 +1191,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param createdBy The value of createdBy as prefixSearch. */ @@ -1265,20 +1200,6 @@ } /** - * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, - * SeveralRegistered. - * - * @param createdBy The value of createdBy as likeSearch. - * @param likeSearchOption The option of like-search. (NotNull) - */ - public void setCreatedBy_LikeSearch( - String createdBy, - jp.sf.pal.bookmark.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { - registerLikeSearchQuery(CK_LS, fRES(createdBy), getCValueCreatedBy(), - "CREATED_BY", "CreatedBy", "createdBy", likeSearchOption); - } - - /** * InScope(in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * @@ -1289,27 +1210,41 @@ } /** - * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * - * @param createdBy The collection of createdBy as inScope. - * @param inScopeOption The option of in-scope. (NotNull) + * @param createdByList The collection of createdBy as notInScope. */ - public void setCreatedBy_InScope( + public void setCreatedBy_NotInScope(Collection createdByList) { + regCreatedBy(CK_NINS, cTL(createdByList)); + } + + /** + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param createdBy The value of createdBy as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) + */ + public void setCreatedBy_LikeSearch( String createdBy, - jp.sf.pal.bookmark.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(createdBy), getCValueCreatedBy(), - "CREATED_BY", "CreatedBy", "createdBy", inScopeOption); + jp.sf.pal.bookmark.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(createdBy), getCValueCreatedBy(), "CREATED_BY", + "CreatedBy", "createdBy", likeSearchOption); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param createdByList The collection of createdBy as notInScope. + * @param createdBy The value of createdBy as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setCreatedBy_NotInScope(Collection createdByList) { - regCreatedBy(CK_NINS, cTL(createdByList)); + public void setCreatedBy_NotLikeSearch( + String createdBy, + jp.sf.pal.bookmark.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(createdBy), getCValueCreatedBy(), "CREATED_BY", + "CreatedBy", "createdBy", likeSearchOption); } protected void regCreatedBy(ConditionKey key, Object value) { @@ -1325,7 +1260,7 @@ abstract protected ConditionValue getCValueCreatedBy(); /** - * Equal(=). And NullIgnored, OnceRegistered. {NotNull : TIMESTAMP} + * Equal(=). And NullIgnored, OnlyOnceRegistered. {NotNull : TIMESTAMP} * * @param updatedTime The value of updatedTime as equal. */ @@ -1334,7 +1269,7 @@ } /** - * NotEqual(!=). And NullIgnored, OnceRegistered. + * NotEqual(!=). And NullIgnored, OnlyOnceRegistered. * * @param updatedTime The value of updatedTime as notEqual. */ @@ -1343,7 +1278,7 @@ } /** - * GreaterThan(>). And NullIgnored, OnceRegistered. + * GreaterThan(>). And NullIgnored, OnlyOnceRegistered. * * @param updatedTime The value of updatedTime as greaterThan. */ @@ -1352,7 +1287,7 @@ } /** - * LessThan(>). And NullIgnored, OnceRegistered. + * LessThan(>). And NullIgnored, OnlyOnceRegistered. * * @param updatedTime The value of updatedTime as lessThan. */ @@ -1361,7 +1296,7 @@ } /** - * GreaterEqual(>). And NullIgnored, OnceRegistered. + * GreaterEqual(>). And NullIgnored, OnlyOnceRegistered. * * @param updatedTime The value of updatedTime as greaterEqual. */ @@ -1370,7 +1305,7 @@ } /** - * LessEqual(>). And NullIgnored, OnceRegistered. + * LessEqual(>). And NullIgnored, OnlyOnceRegistered. * * @param updatedTime The value of updatedTime as lessEqual. */ @@ -1380,7 +1315,7 @@ /** * FromTo($fromDate <= COLUMN_NAME <= $toDate). And NullIgnored, - * OnceRegistered. {NotNull : TIMESTAMP} + * OnlyOnceRegistered. {NotNull : TIMESTAMP} * * @param fromDate The from-date of updatedTime. (Nullable) * @param toDate The to-date of updatedTime. (Nullable) @@ -1398,7 +1333,7 @@ /** * FromTo($fromDate <= COLUMN_NAME < $toDate + 1). And NullIgnored, - * OnceRegistered. {NotNull : TIMESTAMP} + * OnlyOnceRegistered. {NotNull : TIMESTAMP} * * @param fromDate The from-date of updatedTime. (Nullable) * @param toDate The to-date of updatedTime. (Nullable) @@ -1424,7 +1359,7 @@ abstract protected ConditionValue getCValueUpdatedTime(); /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {NotNull : + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {NotNull : * VARCHAR(255)} * * @param updatedBy The value of updatedBy as equal. @@ -1434,7 +1369,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param updatedBy The value of updatedBy as notEqual. */ @@ -1443,7 +1378,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param updatedBy The value of updatedBy as greaterThan. */ @@ -1452,7 +1387,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param updatedBy The value of updatedBy as lessThan. */ @@ -1461,7 +1396,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param updatedBy The value of updatedBy as greaterEqual. */ @@ -1470,7 +1405,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param updatedBy The value of updatedBy as lessEqual. */ @@ -1479,7 +1414,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param updatedBy The value of updatedBy as prefixSearch. */ @@ -1488,20 +1423,6 @@ } /** - * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, - * SeveralRegistered. - * - * @param updatedBy The value of updatedBy as likeSearch. - * @param likeSearchOption The option of like-search. (NotNull) - */ - public void setUpdatedBy_LikeSearch( - String updatedBy, - jp.sf.pal.bookmark.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { - registerLikeSearchQuery(CK_LS, fRES(updatedBy), getCValueUpdatedBy(), - "UPDATED_BY", "UpdatedBy", "updatedBy", likeSearchOption); - } - - /** * InScope(in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * @@ -1512,27 +1433,41 @@ } /** - * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * - * @param updatedBy The collection of updatedBy as inScope. - * @param inScopeOption The option of in-scope. (NotNull) + * @param updatedByList The collection of updatedBy as notInScope. */ - public void setUpdatedBy_InScope( + public void setUpdatedBy_NotInScope(Collection updatedByList) { + regUpdatedBy(CK_NINS, cTL(updatedByList)); + } + + /** + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param updatedBy The value of updatedBy as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) + */ + public void setUpdatedBy_LikeSearch( String updatedBy, - jp.sf.pal.bookmark.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(updatedBy), getCValueUpdatedBy(), - "UPDATED_BY", "UpdatedBy", "updatedBy", inScopeOption); + jp.sf.pal.bookmark.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(updatedBy), getCValueUpdatedBy(), "UPDATED_BY", + "UpdatedBy", "updatedBy", likeSearchOption); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param updatedByList The collection of updatedBy as notInScope. + * @param updatedBy The value of updatedBy as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setUpdatedBy_NotInScope(Collection updatedByList) { - regUpdatedBy(CK_NINS, cTL(updatedByList)); + public void setUpdatedBy_NotLikeSearch( + String updatedBy, + jp.sf.pal.bookmark.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(updatedBy), getCValueUpdatedBy(), "UPDATED_BY", + "UpdatedBy", "updatedBy", likeSearchOption); } protected void regUpdatedBy(ConditionKey key, Object value) { @@ -1548,7 +1483,7 @@ abstract protected ConditionValue getCValueUpdatedBy(); /** - * Equal(=). And NullIgnored, OnceRegistered. {TIMESTAMP} + * Equal(=). And NullIgnored, OnlyOnceRegistered. {TIMESTAMP} * * @param deletedTime The value of deletedTime as equal. */ @@ -1557,7 +1492,7 @@ } /** - * NotEqual(!=). And NullIgnored, OnceRegistered. + * NotEqual(!=). And NullIgnored, OnlyOnceRegistered. * * @param deletedTime The value of deletedTime as notEqual. */ @@ -1566,7 +1501,7 @@ } /** - * GreaterThan(>). And NullIgnored, OnceRegistered. + * GreaterThan(>). And NullIgnored, OnlyOnceRegistered. * * @param deletedTime The value of deletedTime as greaterThan. */ @@ -1575,7 +1510,7 @@ } /** - * LessThan(>). And NullIgnored, OnceRegistered. + * LessThan(>). And NullIgnored, OnlyOnceRegistered. * * @param deletedTime The value of deletedTime as lessThan. */ @@ -1584,7 +1519,7 @@ } /** - * GreaterEqual(>). And NullIgnored, OnceRegistered. + * GreaterEqual(>). And NullIgnored, OnlyOnceRegistered. * * @param deletedTime The value of deletedTime as greaterEqual. */ @@ -1593,7 +1528,7 @@ } /** - * LessEqual(>). And NullIgnored, OnceRegistered. + * LessEqual(>). And NullIgnored, OnlyOnceRegistered. * * @param deletedTime The value of deletedTime as lessEqual. */ @@ -1603,7 +1538,7 @@ /** * FromTo($fromDate <= COLUMN_NAME <= $toDate). And NullIgnored, - * OnceRegistered. {TIMESTAMP} + * OnlyOnceRegistered. {TIMESTAMP} * * @param fromDate The from-date of deletedTime. (Nullable) * @param toDate The to-date of deletedTime. (Nullable) @@ -1621,7 +1556,7 @@ /** * FromTo($fromDate <= COLUMN_NAME < $toDate + 1). And NullIgnored, - * OnceRegistered. {TIMESTAMP} + * OnlyOnceRegistered. {TIMESTAMP} * * @param fromDate The from-date of deletedTime. (Nullable) * @param toDate The to-date of deletedTime. (Nullable) @@ -1635,14 +1570,14 @@ } /** - * IsNull(is null). And OnceRegistered. + * IsNull(is null). And OnlyOnceRegistered. */ public void setDeletedTime_IsNull() { regDeletedTime(CK_ISN, DUMMY_OBJECT); } /** - * IsNotNull(is not null). And OnceRegistered. + * IsNotNull(is not null). And OnlyOnceRegistered. */ public void setDeletedTime_IsNotNull() { regDeletedTime(CK_ISNN, DUMMY_OBJECT); @@ -1661,7 +1596,7 @@ abstract protected ConditionValue getCValueDeletedTime(); /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {VARCHAR(255)} + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {VARCHAR(255)} * * @param deletedBy The value of deletedBy as equal. */ @@ -1670,7 +1605,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param deletedBy The value of deletedBy as notEqual. */ @@ -1679,7 +1614,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param deletedBy The value of deletedBy as greaterThan. */ @@ -1688,7 +1623,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param deletedBy The value of deletedBy as lessThan. */ @@ -1697,7 +1632,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param deletedBy The value of deletedBy as greaterEqual. */ @@ -1706,7 +1641,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param deletedBy The value of deletedBy as lessEqual. */ @@ -1715,7 +1650,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param deletedBy The value of deletedBy as prefixSearch. */ @@ -1724,20 +1659,6 @@ } /** - * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, - * SeveralRegistered. - * - * @param deletedBy The value of deletedBy as likeSearch. - * @param likeSearchOption The option of like-search. (NotNull) - */ - public void setDeletedBy_LikeSearch( - String deletedBy, - jp.sf.pal.bookmark.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { - registerLikeSearchQuery(CK_LS, fRES(deletedBy), getCValueDeletedBy(), - "DELETED_BY", "DeletedBy", "deletedBy", likeSearchOption); - } - - /** * InScope(in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * @@ -1748,38 +1669,52 @@ } /** - * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * - * @param deletedBy The collection of deletedBy as inScope. - * @param inScopeOption The option of in-scope. (NotNull) + * @param deletedByList The collection of deletedBy as notInScope. */ - public void setDeletedBy_InScope( + public void setDeletedBy_NotInScope(Collection deletedByList) { + regDeletedBy(CK_NINS, cTL(deletedByList)); + } + + /** + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param deletedBy The value of deletedBy as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) + */ + public void setDeletedBy_LikeSearch( String deletedBy, - jp.sf.pal.bookmark.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(deletedBy), getCValueDeletedBy(), - "DELETED_BY", "DeletedBy", "deletedBy", inScopeOption); + jp.sf.pal.bookmark.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(deletedBy), getCValueDeletedBy(), "DELETED_BY", + "DeletedBy", "deletedBy", likeSearchOption); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param deletedByList The collection of deletedBy as notInScope. + * @param deletedBy The value of deletedBy as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setDeletedBy_NotInScope(Collection deletedByList) { - regDeletedBy(CK_NINS, cTL(deletedByList)); + public void setDeletedBy_NotLikeSearch( + String deletedBy, + jp.sf.pal.bookmark.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(deletedBy), getCValueDeletedBy(), "DELETED_BY", + "DeletedBy", "deletedBy", likeSearchOption); } /** - * IsNull(is null). And OnceRegistered. + * IsNull(is null). And OnlyOnceRegistered. */ public void setDeletedBy_IsNull() { regDeletedBy(CK_ISN, DUMMY_OBJECT); } /** - * IsNotNull(is not null). And OnceRegistered. + * IsNotNull(is not null). And OnlyOnceRegistered. */ public void setDeletedBy_IsNotNull() { regDeletedBy(CK_ISNN, DUMMY_OBJECT); @@ -1798,7 +1733,7 @@ abstract protected ConditionValue getCValueDeletedBy(); /** - * Equal(=). And NullIgnored, OnceRegistered. {NotNull : INTEGER} + * Equal(=). And NullIgnored, OnlyOnceRegistered. {NotNull : INTEGER} * * @param versionno The value of versionno as equal. */ @@ -1807,7 +1742,7 @@ } /** - * NotEqual(!=). And NullIgnored, OnceRegistered. + * NotEqual(!=). And NullIgnored, OnlyOnceRegistered. * * @param versionno The value of versionno as notEqual. */ @@ -1816,7 +1751,7 @@ } /** - * GreaterThan(>). And NullIgnored, OnceRegistered. + * GreaterThan(>). And NullIgnored, OnlyOnceRegistered. * * @param versionno The value of versionno as greaterThan. */ @@ -1825,7 +1760,7 @@ } /** - * LessThan(<). And NullIgnored, OnceRegistered. + * LessThan(<). And NullIgnored, OnlyOnceRegistered. * * @param versionno The value of versionno as lessThan. */ @@ -1834,7 +1769,7 @@ } /** - * GreaterEqual(>=). And NullIgnored, OnceRegistered. + * GreaterEqual(>=). And NullIgnored, OnlyOnceRegistered. * * @param versionno The value of versionno as greaterEqual. */ @@ -1843,7 +1778,7 @@ } /** - * LessEqual(<=). And NullIgnored, OnceRegistered. + * LessEqual(<=). And NullIgnored, OnlyOnceRegistered. * * @param versionno The value of versionno as lessEqual. */ @@ -1883,6 +1818,50 @@ abstract protected ConditionValue getCValueVersionno(); + public SSQFunction scalar_Equal() { + return xcreateSSQFunction("="); + } + + public SSQFunction scalar_GreaterEqual() { + return xcreateSSQFunction(">="); + } + + public SSQFunction scalar_GreaterThan() { + return xcreateSSQFunction(">"); + } + + public SSQFunction scalar_LessEqual() { + return xcreateSSQFunction("<="); + } + + public SSQFunction scalar_LessThan() { + return xcreateSSQFunction("<"); + } + + protected SSQFunction xcreateSSQFunction(final String operand) { + return new SSQFunction(new SSQSetupper() { + public void setup(String function, SubQuery subQuery) { + xscalarSubQuery(function, subQuery, operand); + } + }); + } + + protected void xscalarSubQuery(String function, + SubQuery subQuery, String operand) { + assertObjectNotNull("subQuery", subQuery); + RoleInfoCB cb = new RoleInfoCB(); + cb.xsetupForScalarSubQuery(); + subQuery.query(cb); + String subQueryPropertyName = keepScalarSubQuery(cb.query()); // for + // saving + // query + // -value. + registerScalarSubQuery(function, cb.query(), subQueryPropertyName, + operand); + } + + public abstract String keepScalarSubQuery(RoleInfoCQ subQuery); + // Very Internal (for Suppressing Warn about 'Not Use Import') protected String getConditionBeanClassNameInternally() { return RoleInfoCB.class.getName(); Modified: bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/cbean/cq/bs/AbstractBsRoleMappingCQ.java =================================================================== --- bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/cbean/cq/bs/AbstractBsRoleMappingCQ.java 2008-12-27 22:10:35 UTC (rev 1626) +++ bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/cbean/cq/bs/AbstractBsRoleMappingCQ.java 2008-12-27 22:11:51 UTC (rev 1627) @@ -11,16 +11,13 @@ import jp.sf.pal.bookmark.db.cbean.RoleInfoCB; import jp.sf.pal.bookmark.db.cbean.RoleMappingCB; import jp.sf.pal.bookmark.db.cbean.UserInfoCB; -import jp.sf.pal.bookmark.db.cbean.cq.RoleInfoCQ; import jp.sf.pal.bookmark.db.cbean.cq.RoleMappingCQ; -import jp.sf.pal.bookmark.db.cbean.cq.UserInfoCQ; /** * The abstract condition-query of ROLE_MAPPING. * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public abstract class AbstractBsRoleMappingCQ extends AbstractConditionQuery { //========================================================================== @@ -50,7 +47,8 @@ // ===== /** - * Equal(=). And NullIgnored, OnceRegistered. {PK : ID : NotNull : INTEGER} + * Equal(=). And NullIgnored, OnlyOnceRegistered. {PK : ID : NotNull : + * INTEGER} * * @param id The value of id as equal. */ @@ -59,7 +57,7 @@ } /** - * NotEqual(!=). And NullIgnored, OnceRegistered. + * NotEqual(!=). And NullIgnored, OnlyOnceRegistered. * * @param id The value of id as notEqual. */ @@ -68,7 +66,7 @@ } /** - * GreaterThan(>). And NullIgnored, OnceRegistered. + * GreaterThan(>). And NullIgnored, OnlyOnceRegistered. * * @param id The value of id as greaterThan. */ @@ -77,7 +75,7 @@ } /** - * LessThan(<). And NullIgnored, OnceRegistered. + * LessThan(<). And NullIgnored, OnlyOnceRegistered. * * @param id The value of id as lessThan. */ @@ -86,7 +84,7 @@ } /** - * GreaterEqual(>=). And NullIgnored, OnceRegistered. + * GreaterEqual(>=). And NullIgnored, OnlyOnceRegistered. * * @param id The value of id as greaterEqual. */ @@ -95,7 +93,7 @@ } /** - * LessEqual(<=). And NullIgnored, OnceRegistered. + * LessEqual(<=). And NullIgnored, OnlyOnceRegistered. * * @param id The value of id as lessEqual. */ @@ -124,14 +122,14 @@ } /** - * IsNull(is null). And OnceRegistered. + * IsNull(is null). And OnlyOnceRegistered. */ public void setId_IsNull() { regId(CK_ISN, DUMMY_OBJECT); } /** - * IsNotNull(is not null). And OnceRegistered. + * IsNotNull(is not null). And OnlyOnceRegistered. */ public void setId_IsNotNull() { regId(CK_ISNN, DUMMY_OBJECT); @@ -148,8 +146,8 @@ abstract protected ConditionValue getCValueId(); /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {NotNull : VARCHAR(255) - * : FK to USER_INFO} + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {NotNull : + * VARCHAR(255) : FK to USER_INFO} * * @param userId The value of userId as equal. */ @@ -158,7 +156,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param userId The value of userId as notEqual. */ @@ -167,7 +165,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param userId The value of userId as greaterThan. */ @@ -176,7 +174,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param userId The value of userId as lessThan. */ @@ -185,7 +183,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param userId The value of userId as greaterEqual. */ @@ -194,7 +192,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param userId The value of userId as lessEqual. */ @@ -203,7 +201,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param userId The value of userId as prefixSearch. */ @@ -212,20 +210,6 @@ } /** - * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, - * SeveralRegistered. - * - * @param userId The value of userId as likeSearch. - * @param likeSearchOption The option of like-search. (NotNull) - */ - public void setUserId_LikeSearch( - String userId, - jp.sf.pal.bookmark.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { - registerLikeSearchQuery(CK_LS, fRES(userId), getCValueUserId(), - "USER_ID", "UserId", "userId", likeSearchOption); - } - - /** * InScope(in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * @@ -236,42 +220,41 @@ } /** - * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * - * @param userId The collection of userId as inScope. - * @param inScopeOption The option of in-scope. (NotNull) + * @param userIdList The collection of userId as notInScope. */ - public void setUserId_InScope( - String userId, - jp.sf.pal.bookmark.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(userId), getCValueUserId(), - "USER_ID", "UserId", "userId", inScopeOption); + public void setUserId_NotInScope(Collection userIdList) { + regUserId(CK_NINS, cTL(userIdList)); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param userIdList The collection of userId as notInScope. + * @param userId The value of userId as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) */ - public void setUserId_NotInScope(Collection userIdList) { - regUserId(CK_NINS, cTL(userIdList)); + public void setUserId_LikeSearch( + String userId, + jp.sf.pal.bookmark.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(userId), getCValueUserId(), "USER_ID", "UserId", + "userId", likeSearchOption); } /** - * @param userInfoCBquery Query. - * @deprecated Please use inScopeUserInfo(subQuery) method. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param userId The value of userId as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setUserId_InScopeSubQuery_UserInfo(UserInfoCQ userInfoCBquery) { - String subQueryPropertyName = keepUserId_InScopeSubQuery_UserInfo(userInfoCBquery);// for - // saving - // query - // - - // value - // . - registerInScopeSubQuery(userInfoCBquery, "USER_ID", "USER_ID", - subQueryPropertyName); + public void setUserId_NotLikeSearch( + String userId, + jp.sf.pal.bookmark.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(userId), getCValueUserId(), "USER_ID", "UserId", + "userId", likeSearchOption); } public void inScopeUserInfo(SubQuery subQuery) { @@ -280,12 +263,12 @@ cb.xsetupForInScopeSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepUserId_InScopeSubQuery_UserInfo(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerInScopeSubQuery(cb.query(), "USER_ID", "USER_ID", subQueryPropertyName); } - abstract public String keepUserId_InScopeSubQuery_UserInfo( + public abstract String keepUserId_InScopeSubQuery_UserInfo( jp.sf.pal.bookmark.db.cbean.cq.UserInfoCQ subQuery); protected void regUserId(ConditionKey key, Object value) { @@ -301,8 +284,8 @@ abstract protected ConditionValue getCValueUserId(); /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {NotNull : VARCHAR(255) - * : FK to ROLE_INFO} + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {NotNull : + * VARCHAR(255) : FK to ROLE_INFO} * * @param roleId The value of roleId as equal. */ @@ -311,7 +294,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param roleId The value of roleId as notEqual. */ @@ -320,7 +303,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param roleId The value of roleId as greaterThan. */ @@ -329,7 +312,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param roleId The value of roleId as lessThan. */ @@ -338,7 +321,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param roleId The value of roleId as greaterEqual. */ @@ -347,7 +330,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param roleId The value of roleId as lessEqual. */ @@ -356,7 +339,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param roleId The value of roleId as prefixSearch. */ @@ -365,20 +348,6 @@ } /** - * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, - * SeveralRegistered. - * - * @param roleId The value of roleId as likeSearch. - * @param likeSearchOption The option of like-search. (NotNull) - */ - public void setRoleId_LikeSearch( - String roleId, - jp.sf.pal.bookmark.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { - registerLikeSearchQuery(CK_LS, fRES(roleId), getCValueRoleId(), - "ROLE_ID", "RoleId", "roleId", likeSearchOption); - } - - /** * InScope(in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * @@ -389,42 +358,41 @@ } /** - * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * - * @param roleId The collection of roleId as inScope. - * @param inScopeOption The option of in-scope. (NotNull) + * @param roleIdList The collection of roleId as notInScope. */ - public void setRoleId_InScope( - String roleId, - jp.sf.pal.bookmark.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(roleId), getCValueRoleId(), - "ROLE_ID", "RoleId", "roleId", inScopeOption); + public void setRoleId_NotInScope(Collection roleIdList) { + regRoleId(CK_NINS, cTL(roleIdList)); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param roleIdList The collection of roleId as notInScope. + * @param roleId The value of roleId as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) */ - public void setRoleId_NotInScope(Collection roleIdList) { - regRoleId(CK_NINS, cTL(roleIdList)); + public void setRoleId_LikeSearch( + String roleId, + jp.sf.pal.bookmark.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(roleId), getCValueRoleId(), "ROLE_ID", "RoleId", + "roleId", likeSearchOption); } /** - * @param roleInfoCBquery Query. - * @deprecated Please use inScopeRoleInfo(subQuery) method. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param roleId The value of roleId as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setRoleId_InScopeSubQuery_RoleInfo(RoleInfoCQ roleInfoCBquery) { - String subQueryPropertyName = keepRoleId_InScopeSubQuery_RoleInfo(roleInfoCBquery);// for - // saving - // query - // - - // value - // . - registerInScopeSubQuery(roleInfoCBquery, "ROLE_ID", "ROLE_ID", - subQueryPropertyName); + public void setRoleId_NotLikeSearch( + String roleId, + jp.sf.pal.bookmark.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(roleId), getCValueRoleId(), "ROLE_ID", "RoleId", + "roleId", likeSearchOption); } public void inScopeRoleInfo(SubQuery subQuery) { @@ -433,12 +401,12 @@ cb.xsetupForInScopeSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepRoleId_InScopeSubQuery_RoleInfo(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerInScopeSubQuery(cb.query(), "ROLE_ID", "ROLE_ID", subQueryPropertyName); } - abstract public String keepRoleId_InScopeSubQuery_RoleInfo( + public abstract String keepRoleId_InScopeSubQuery_RoleInfo( jp.sf.pal.bookmark.db.cbean.cq.RoleInfoCQ subQuery); protected void regRoleId(ConditionKey key, Object value) { @@ -453,6 +421,50 @@ abstract protected ConditionValue getCValueRoleId(); + public SSQFunction scalar_Equal() { + return xcreateSSQFunction("="); + } + + public SSQFunction scalar_GreaterEqual() { + return xcreateSSQFunction(">="); + } + + public SSQFunction scalar_GreaterThan() { + return xcreateSSQFunction(">"); + } + + public SSQFunction scalar_LessEqual() { + return xcreateSSQFunction("<="); + } + + public SSQFunction scalar_LessThan() { + return xcreateSSQFunction("<"); + } + + protected SSQFunction xcreateSSQFunction(final String operand) { + return new SSQFunction(new SSQSetupper() { + public void setup(String function, SubQuery subQuery) { + xscalarSubQuery(function, subQuery, operand); + } + }); + } + + protected void xscalarSubQuery(String function, + SubQuery subQuery, String operand) { + assertObjectNotNull("subQuery", subQuery); + RoleMappingCB cb = new RoleMappingCB(); + cb.xsetupForScalarSubQuery(); + subQuery.query(cb); + String subQueryPropertyName = keepScalarSubQuery(cb.query()); // for + // saving + // query + // -value. + registerScalarSubQuery(function, cb.query(), subQueryPropertyName, + operand); + } + + public abstract String keepScalarSubQuery(RoleMappingCQ subQuery); + // Very Internal (for Suppressing Warn about 'Not Use Import') protected String getConditionBeanClassNameInternally() { return RoleMappingCB.class.getName(); Modified: bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/cbean/cq/bs/AbstractBsUserInfoCQ.java =================================================================== --- bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/cbean/cq/bs/AbstractBsUserInfoCQ.java 2008-12-27 22:10:35 UTC (rev 1626) +++ bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/cbean/cq/bs/AbstractBsUserInfoCQ.java 2008-12-27 22:11:51 UTC (rev 1627) @@ -17,9 +17,7 @@ import jp.sf.pal.bookmark.db.cbean.UserInfoCB; import jp.sf.pal.bookmark.db.cbean.cq.BookmarkCategoryCQ; import jp.sf.pal.bookmark.db.cbean.cq.BookmarkLinkCQ; -import jp.sf.pal.bookmark.db.cbean.cq.GroupInfoCQ; import jp.sf.pal.bookmark.db.cbean.cq.GroupMappingCQ; -import jp.sf.pal.bookmark.db.cbean.cq.RoleInfoCQ; import jp.sf.pal.bookmark.db.cbean.cq.RoleMappingCQ; import jp.sf.pal.bookmark.db.cbean.cq.UserInfoCQ; @@ -28,7 +26,6 @@ * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public abstract class AbstractBsUserInfoCQ extends AbstractConditionQuery { //========================================================================== @@ -58,7 +55,7 @@ // ===== /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {PK : NotNull : + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {PK : NotNull : * VARCHAR(255)} * * @param userId The value of userId as equal. @@ -68,7 +65,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param userId The value of userId as notEqual. */ @@ -77,7 +74,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param userId The value of userId as greaterThan. */ @@ -86,7 +83,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param userId The value of userId as lessThan. */ @@ -95,7 +92,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param userId The value of userId as greaterEqual. */ @@ -104,7 +101,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param userId The value of userId as lessEqual. */ @@ -113,7 +110,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param userId The value of userId as prefixSearch. */ @@ -122,20 +119,6 @@ } /** - * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, - * SeveralRegistered. - * - * @param userId The value of userId as likeSearch. - * @param likeSearchOption The option of like-search. (NotNull) - */ - public void setUserId_LikeSearch( - String userId, - jp.sf.pal.bookmark.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { - registerLikeSearchQuery(CK_LS, fRES(userId), getCValueUserId(), - "USER_ID", "UserId", "userId", likeSearchOption); - } - - /** * InScope(in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * @@ -146,44 +129,41 @@ } /** - * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * - * @param userId The collection of userId as inScope. - * @param inScopeOption The option of in-scope. (NotNull) + * @param userIdList The collection of userId as notInScope. */ - public void setUserId_InScope( - String userId, - jp.sf.pal.bookmark.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(userId), getCValueUserId(), - "USER_ID", "UserId", "userId", inScopeOption); + public void setUserId_NotInScope(Collection userIdList) { + regUserId(CK_NINS, cTL(userIdList)); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param userIdList The collection of userId as notInScope. + * @param userId The value of userId as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) */ - public void setUserId_NotInScope(Collection userIdList) { - regUserId(CK_NINS, cTL(userIdList)); + public void setUserId_LikeSearch( + String userId, + jp.sf.pal.bookmark.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(userId), getCValueUserId(), "USER_ID", "UserId", + "userId", likeSearchOption); } /** - * @param bookmarkCategoryCBquery Query. - * @deprecated Please use inScopeBookmarkCategoryByCreatedByList(subQuery) - * method. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param userId The value of userId as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setUserId_InScopeSubQuery_BookmarkCategoryByCreatedByList( - BookmarkCategoryCQ bookmarkCategoryCBquery) { - String subQueryPropertyName = keepUserId_InScopeSubQuery_BookmarkCategoryByCreatedByList(bookmarkCategoryCBquery);// for - // saving - // query - // - - // value - // . - registerInScopeSubQuery(bookmarkCategoryCBquery, "USER_ID", - "CREATED_BY", subQueryPropertyName); + public void setUserId_NotLikeSearch( + String userId, + jp.sf.pal.bookmark.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(userId), getCValueUserId(), "USER_ID", "UserId", + "userId", likeSearchOption); } public void inScopeBookmarkCategoryByCreatedByList( @@ -193,31 +173,14 @@ cb.xsetupForInScopeSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepUserId_InScopeSubQuery_BookmarkCategoryByCreatedByList(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerInScopeSubQuery(cb.query(), "USER_ID", "CREATED_BY", subQueryPropertyName); } - abstract public String keepUserId_InScopeSubQuery_BookmarkCategoryByCreatedByList( + public abstract String keepUserId_InScopeSubQuery_BookmarkCategoryByCreatedByList( BookmarkCategoryCQ subQuery); - /** - * @param bookmarkCategoryCBquery Query. - * @deprecated Please use inScopeBookmarkCategoryByUpdatedByList(subQuery) - * method. - */ - public void setUserId_InScopeSubQuery_BookmarkCategoryByUpdatedByList( - BookmarkCategoryCQ bookmarkCategoryCBquery) { - String subQueryPropertyName = keepUserId_InScopeSubQuery_BookmarkCategoryByUpdatedByList(bookmarkCategoryCBquery);// for - // saving - // query - // - - // value - // . - registerInScopeSubQuery(bookmarkCategoryCBquery, "USER_ID", - "UPDATED_BY", subQueryPropertyName); - } - public void inScopeBookmarkCategoryByUpdatedByList( SubQuery subQuery) { assertObjectNotNull("subQuery", subQuery); @@ -225,31 +188,14 @@ cb.xsetupForInScopeSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepUserId_InScopeSubQuery_BookmarkCategoryByUpdatedByList(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerInScopeSubQuery(cb.query(), "USER_ID", "UPDATED_BY", subQueryPropertyName); } - abstract public String keepUserId_InScopeSubQuery_BookmarkCategoryByUpdatedByList( + public abstract String keepUserId_InScopeSubQuery_BookmarkCategoryByUpdatedByList( BookmarkCategoryCQ subQuery); - /** - * @param bookmarkLinkCBquery Query. - * @deprecated Please use inScopeBookmarkLinkByCreatedByList(subQuery) - * method. - */ - public void setUserId_InScopeSubQuery_BookmarkLinkByCreatedByList( - BookmarkLinkCQ bookmarkLinkCBquery) { - String subQueryPropertyName = keepUserId_InScopeSubQuery_BookmarkLinkByCreatedByList(bookmarkLinkCBquery);// for - // saving - // query - // - - // value - // . - registerInScopeSubQuery(bookmarkLinkCBquery, "USER_ID", "CREATED_BY", - subQueryPropertyName); - } - public void inScopeBookmarkLinkByCreatedByList( SubQuery subQuery) { assertObjectNotNull("subQuery", subQuery); @@ -257,31 +203,14 @@ cb.xsetupForInScopeSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepUserId_InScopeSubQuery_BookmarkLinkByCreatedByList(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerInScopeSubQuery(cb.query(), "USER_ID", "CREATED_BY", subQueryPropertyName); } - abstract public String keepUserId_InScopeSubQuery_BookmarkLinkByCreatedByList( + public abstract String keepUserId_InScopeSubQuery_BookmarkLinkByCreatedByList( BookmarkLinkCQ subQuery); - /** - * @param bookmarkLinkCBquery Query. - * @deprecated Please use inScopeBookmarkLinkByUpdatedByList(subQuery) - * method. - */ - public void setUserId_InScopeSubQuery_BookmarkLinkByUpdatedByList( - BookmarkLinkCQ bookmarkLinkCBquery) { - String subQueryPropertyName = keepUserId_InScopeSubQuery_BookmarkLinkByUpdatedByList(bookmarkLinkCBquery);// for - // saving - // query - // - - // value - // . - registerInScopeSubQuery(bookmarkLinkCBquery, "USER_ID", "UPDATED_BY", - subQueryPropertyName); - } - public void inScopeBookmarkLinkByUpdatedByList( SubQuery subQuery) { assertObjectNotNull("subQuery", subQuery); @@ -289,72 +218,40 @@ cb.xsetupForInScopeSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepUserId_InScopeSubQuery_BookmarkLinkByUpdatedByList(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerInScopeSubQuery(cb.query(), "USER_ID", "UPDATED_BY", subQueryPropertyName); } - abstract public String keepUserId_InScopeSubQuery_BookmarkLinkByUpdatedByList( + public abstract String keepUserId_InScopeSubQuery_BookmarkLinkByUpdatedByList( BookmarkLinkCQ subQuery); - /** - * @param groupMappingCBquery Query. - * @deprecated Please use inScopeGroupMappingList(subQuery) method. - */ - public void setUserId_InScopeSubQuery_GroupMappingList( - GroupMappingCQ groupMappingCBquery) { - String subQueryPropertyName = keepUserId_InScopeSubQuery_GroupMappingList(groupMappingCBquery);// for - // saving - // query - // - - // value - // . - registerInScopeSubQuery(groupMappingCBquery, "USER_ID", "USER_ID", - subQueryPropertyName); - } - public void inScopeGroupMappingList(SubQuery subQuery) { assertObjectNotNull("subQuery", subQuery); GroupMappingCB cb = new GroupMappingCB(); cb.xsetupForInScopeSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepUserId_InScopeSubQuery_GroupMappingList(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerInScopeSubQuery(cb.query(), "USER_ID", "USER_ID", subQueryPropertyName); } - abstract public String keepUserId_InScopeSubQuery_GroupMappingList( + public abstract String keepUserId_InScopeSubQuery_GroupMappingList( GroupMappingCQ subQuery); - /** - * @param roleMappingCBquery Query. - * @deprecated Please use inScopeRoleMappingList(subQuery) method. - */ - public void setUserId_InScopeSubQuery_RoleMappingList( - RoleMappingCQ roleMappingCBquery) { - String subQueryPropertyName = keepUserId_InScopeSubQuery_RoleMappingList(roleMappingCBquery);// for - // saving - // query - // - - // value - // . - registerInScopeSubQuery(roleMappingCBquery, "USER_ID", "USER_ID", - subQueryPropertyName); - } - public void inScopeRoleMappingList(SubQuery subQuery) { assertObjectNotNull("subQuery", subQuery); RoleMappingCB cb = new RoleMappingCB(); cb.xsetupForInScopeSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepUserId_InScopeSubQuery_RoleMappingList(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerInScopeSubQuery(cb.query(), "USER_ID", "USER_ID", subQueryPropertyName); } - abstract public String keepUserId_InScopeSubQuery_RoleMappingList( + public abstract String keepUserId_InScopeSubQuery_RoleMappingList( RoleMappingCQ subQuery); public void notInScopeBookmarkCategoryByCreatedByList( @@ -364,12 +261,12 @@ cb.xsetupForInScopeSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepUserId_NotInScopeSubQuery_BookmarkCategoryByCreatedByList(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerNotInScopeSubQuery(cb.query(), "USER_ID", "CREATED_BY", subQueryPropertyName); } - abstract public String keepUserId_NotInScopeSubQuery_BookmarkCategoryByCreatedByList( + public abstract String keepUserId_NotInScopeSubQuery_BookmarkCategoryByCreatedByList( BookmarkCategoryCQ subQuery); public void notInScopeBookmarkCategoryByUpdatedByList( @@ -379,12 +276,12 @@ cb.xsetupForInScopeSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepUserId_NotInScopeSubQuery_BookmarkCategoryByUpdatedByList(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerNotInScopeSubQuery(cb.query(), "USER_ID", "UPDATED_BY", subQueryPropertyName); } - abstract public String keepUserId_NotInScopeSubQuery_BookmarkCategoryByUpdatedByList( + public abstract String keepUserId_NotInScopeSubQuery_BookmarkCategoryByUpdatedByList( BookmarkCategoryCQ subQuery); public void notInScopeBookmarkLinkByCreatedByList( @@ -394,12 +291,12 @@ cb.xsetupForInScopeSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepUserId_NotInScopeSubQuery_BookmarkLinkByCreatedByList(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerNotInScopeSubQuery(cb.query(), "USER_ID", "CREATED_BY", subQueryPropertyName); } - abstract public String keepUserId_NotInScopeSubQuery_BookmarkLinkByCreatedByList( + public abstract String keepUserId_NotInScopeSubQuery_BookmarkLinkByCreatedByList( BookmarkLinkCQ subQuery); public void notInScopeBookmarkLinkByUpdatedByList( @@ -409,12 +306,12 @@ cb.xsetupForInScopeSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepUserId_NotInScopeSubQuery_BookmarkLinkByUpdatedByList(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerNotInScopeSubQuery(cb.query(), "USER_ID", "UPDATED_BY", subQueryPropertyName); } - abstract public String keepUserId_NotInScopeSubQuery_BookmarkLinkByUpdatedByList( + public abstract String keepUserId_NotInScopeSubQuery_BookmarkLinkByUpdatedByList( BookmarkLinkCQ subQuery); public void notInScopeGroupMappingList(SubQuery subQuery) { @@ -423,12 +320,12 @@ cb.xsetupForInScopeSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepUserId_NotInScopeSubQuery_GroupMappingList(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerNotInScopeSubQuery(cb.query(), "USER_ID", "USER_ID", subQueryPropertyName); } - abstract public String keepUserId_NotInScopeSubQuery_GroupMappingList( + public abstract String keepUserId_NotInScopeSubQuery_GroupMappingList( GroupMappingCQ subQuery); public void notInScopeRoleMappingList(SubQuery subQuery) { @@ -437,32 +334,15 @@ cb.xsetupForInScopeSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepUserId_NotInScopeSubQuery_RoleMappingList(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerNotInScopeSubQuery(cb.query(), "USER_ID", "USER_ID", subQueryPropertyName); } - abstract public String keepUserId_NotInScopeSubQuery_RoleMappingList( + public abstract String keepUserId_NotInScopeSubQuery_RoleMappingList( RoleMappingCQ subQuery); /** - * @param bookmarkCategoryCBquery Query. - * @deprecated Please use existsBookmarkCategoryByCreatedByList(subQuery) - * method. - */ - public void setUserId_ExistsSubQuery_BookmarkCategoryByCreatedByList( - BookmarkCategoryCQ bookmarkCategoryCBquery) { - String subQueryPropertyName = keepUserId_ExistsSubQuery_BookmarkCategoryByCreatedByList(bookmarkCategoryCBquery);// for - // saving - // query - // - - // value - // . - registerExistsSubQuery(bookmarkCategoryCBquery, "USER_ID", - "CREATED_BY", subQueryPropertyName); - } - - /** * Set up 'exists' sub-query. {exists (select CREATED_BY from * BOOKMARK_CATEGORY where ...)} * @@ -477,32 +357,15 @@ cb.xsetupForExistsSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepUserId_ExistsSubQuery_BookmarkCategoryByCreatedByList(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerExistsSubQuery(cb.query(), "USER_ID", "CREATED_BY", subQueryPropertyName); } - abstract public String keepUserId_ExistsSubQuery_BookmarkCategoryByCreatedByList( + public abstract String keepUserId_ExistsSubQuery_BookmarkCategoryByCreatedByList( BookmarkCategoryCQ subQuery); /** - * @param bookmarkCategoryCBquery Query. - * @deprecated Please use existsBookmarkCategoryByUpdatedByList(subQuery) - * method. - */ - public void setUserId_ExistsSubQuery_BookmarkCategoryByUpdatedByList( - BookmarkCategoryCQ bookmarkCategoryCBquery) { - String subQueryPropertyName = keepUserId_ExistsSubQuery_BookmarkCategoryByUpdatedByList(bookmarkCategoryCBquery);// for - // saving - // query - // - - // value - // . - registerExistsSubQuery(bookmarkCategoryCBquery, "USER_ID", - "UPDATED_BY", subQueryPropertyName); - } - - /** * Set up 'exists' sub-query. {exists (select UPDATED_BY from * BOOKMARK_CATEGORY where ...)} * @@ -517,32 +380,15 @@ cb.xsetupForExistsSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepUserId_ExistsSubQuery_BookmarkCategoryByUpdatedByList(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerExistsSubQuery(cb.query(), "USER_ID", "UPDATED_BY", subQueryPropertyName); } - abstract public String keepUserId_ExistsSubQuery_BookmarkCategoryByUpdatedByList( + public abstract String keepUserId_ExistsSubQuery_BookmarkCategoryByUpdatedByList( BookmarkCategoryCQ subQuery); /** - * @param bookmarkLinkCBquery Query. - * @deprecated Please use existsBookmarkLinkByCreatedByList(subQuery) - * method. - */ - public void setUserId_ExistsSubQuery_BookmarkLinkByCreatedByList( - BookmarkLinkCQ bookmarkLinkCBquery) { - String subQueryPropertyName = keepUserId_ExistsSubQuery_BookmarkLinkByCreatedByList(bookmarkLinkCBquery);// for - // saving - // query - // - - // value - // . - registerExistsSubQuery(bookmarkLinkCBquery, "USER_ID", "CREATED_BY", - subQueryPropertyName); - } - - /** * Set up 'exists' sub-query. {exists (select CREATED_BY from BOOKMARK_LINK * where ...)} * @@ -557,32 +403,15 @@ cb.xsetupForExistsSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepUserId_ExistsSubQuery_BookmarkLinkByCreatedByList(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerExistsSubQuery(cb.query(), "USER_ID", "CREATED_BY", subQueryPropertyName); } - abstract public String keepUserId_ExistsSubQuery_BookmarkLinkByCreatedByList( + public abstract String keepUserId_ExistsSubQuery_BookmarkLinkByCreatedByList( BookmarkLinkCQ subQuery); /** - * @param bookmarkLinkCBquery Query. - * @deprecated Please use existsBookmarkLinkByUpdatedByList(subQuery) - * method. - */ - public void setUserId_ExistsSubQuery_BookmarkLinkByUpdatedByList( - BookmarkLinkCQ bookmarkLinkCBquery) { - String subQueryPropertyName = keepUserId_ExistsSubQuery_BookmarkLinkByUpdatedByList(bookmarkLinkCBquery);// for - // saving - // query - // - - // value - // . - registerExistsSubQuery(bookmarkLinkCBquery, "USER_ID", "UPDATED_BY", - subQueryPropertyName); - } - - /** * Set up 'exists' sub-query. {exists (select UPDATED_BY from BOOKMARK_LINK * where ...)} * @@ -597,31 +426,15 @@ cb.xsetupForExistsSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepUserId_ExistsSubQuery_BookmarkLinkByUpdatedByList(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerExistsSubQuery(cb.query(), "USER_ID", "UPDATED_BY", subQueryPropertyName); } - abstract public String keepUserId_ExistsSubQuery_BookmarkLinkByUpdatedByList( + public abstract String keepUserId_ExistsSubQuery_BookmarkLinkByUpdatedByList( BookmarkLinkCQ 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 ...)} * @@ -634,31 +447,15 @@ cb.xsetupForExistsSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepUserId_ExistsSubQuery_GroupMappingList(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerExistsSubQuery(cb.query(), "USER_ID", "USER_ID", subQueryPropertyName); } - abstract public String keepUserId_ExistsSubQuery_GroupMappingList( + public abstract String keepUserId_ExistsSubQuery_GroupMappingList( GroupMappingCQ subQuery); /** - * @param roleMappingCBquery Query. - * @deprecated Please use existsRoleMappingList(subQuery) method. - */ - public void setUserId_ExistsSubQuery_RoleMappingList( - RoleMappingCQ roleMappingCBquery) { - String subQueryPropertyName = keepUserId_ExistsSubQuery_RoleMappingList(roleMappingCBquery);// for - // saving - // query - // - - // value - // . - registerExistsSubQuery(roleMappingCBquery, "USER_ID", "USER_ID", - subQueryPropertyName); - } - - /** * Set up 'exists' sub-query. {exists (select USER_ID from ROLE_MAPPING * where ...)} * @@ -671,12 +468,12 @@ cb.xsetupForExistsSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepUserId_ExistsSubQuery_RoleMappingList(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerExistsSubQuery(cb.query(), "USER_ID", "USER_ID", subQueryPropertyName); } - abstract public String keepUserId_ExistsSubQuery_RoleMappingList( + public abstract String keepUserId_ExistsSubQuery_RoleMappingList( RoleMappingCQ subQuery); /** @@ -694,12 +491,12 @@ cb.xsetupForExistsSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepUserId_NotExistsSubQuery_BookmarkCategoryByCreatedByList(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerNotExistsSubQuery(cb.query(), "USER_ID", "CREATED_BY", subQueryPropertyName); } - abstract public String keepUserId_NotExistsSubQuery_BookmarkCategoryByCreatedByList( + public abstract String keepUserId_NotExistsSubQuery_BookmarkCategoryByCreatedByList( BookmarkCategoryCQ subQuery); /** @@ -717,12 +514,12 @@ cb.xsetupForExistsSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepUserId_NotExistsSubQuery_BookmarkCategoryByUpdatedByList(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerNotExistsSubQuery(cb.query(), "USER_ID", "UPDATED_BY", subQueryPropertyName); } - abstract public String keepUserId_NotExistsSubQuery_BookmarkCategoryByUpdatedByList( + public abstract String keepUserId_NotExistsSubQuery_BookmarkCategoryByUpdatedByList( BookmarkCategoryCQ subQuery); /** @@ -740,12 +537,12 @@ cb.xsetupForExistsSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepUserId_NotExistsSubQuery_BookmarkLinkByCreatedByList(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerNotExistsSubQuery(cb.query(), "USER_ID", "CREATED_BY", subQueryPropertyName); } - abstract public String keepUserId_NotExistsSubQuery_BookmarkLinkByCreatedByList( + public abstract String keepUserId_NotExistsSubQuery_BookmarkLinkByCreatedByList( BookmarkLinkCQ subQuery); /** @@ -763,12 +560,12 @@ cb.xsetupForExistsSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepUserId_NotExistsSubQuery_BookmarkLinkByUpdatedByList(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerNotExistsSubQuery(cb.query(), "USER_ID", "UPDATED_BY", subQueryPropertyName); } - abstract public String keepUserId_NotExistsSubQuery_BookmarkLinkByUpdatedByList( + public abstract String keepUserId_NotExistsSubQuery_BookmarkLinkByUpdatedByList( BookmarkLinkCQ subQuery); /** @@ -785,12 +582,12 @@ cb.xsetupForExistsSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepUserId_NotExistsSubQuery_GroupMappingList(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerNotExistsSubQuery(cb.query(), "USER_ID", "USER_ID", subQueryPropertyName); } - abstract public String keepUserId_NotExistsSubQuery_GroupMappingList( + public abstract String keepUserId_NotExistsSubQuery_GroupMappingList( GroupMappingCQ subQuery); /** @@ -806,113 +603,113 @@ cb.xsetupForExistsSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepUserId_NotExistsSubQuery_RoleMappingList(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerNotExistsSubQuery(cb.query(), "USER_ID", "USER_ID", subQueryPropertyName); } - abstract public String keepUserId_NotExistsSubQuery_RoleMappingList( + public abstract String keepUserId_NotExistsSubQuery_RoleMappingList( RoleMappingCQ subQuery); public void xderiveBookmarkCategoryByCreatedByList(String function, SubQuery subQuery, String aliasName) { assertObjectNotNull("subQuery", subQuery); BookmarkCategoryCB cb = new BookmarkCategoryCB(); - cb.xsetupForDeriveReferrer(); + cb.xsetupForDerivedReferrer(); subQuery.query(cb); - String subQueryPropertyName = keepUserId_DeriveSubQuery_BookmarkCategoryByCreatedByList(cb - .query());// for saving query-value. - registerDeriveSubQuery(function, cb.query(), "USER_ID", "CREATED_BY", - subQueryPropertyName, aliasName); + String subQueryPropertyName = keepUserId_DerivedReferrer_BookmarkCategoryByCreatedByList(cb + .query()); // for saving query-value. + registerDerivedReferrerSubQuery(function, cb.query(), "USER_ID", + "CREATED_BY", subQueryPropertyName, aliasName); } - abstract public String keepUserId_DeriveSubQuery_BookmarkCategoryByCreatedByList( + public abstract String keepUserId_DerivedReferrer_BookmarkCategoryByCreatedByList( BookmarkCategoryCQ subQuery); public void xderiveBookmarkCategoryByUpdatedByList(String function, SubQuery subQuery, String aliasName) { assertObjectNotNull("subQuery", subQuery); BookmarkCategoryCB cb = new BookmarkCategoryCB(); - cb.xsetupForDeriveReferrer(); + cb.xsetupForDerivedReferrer(); subQuery.query(cb); - String subQueryPropertyName = keepUserId_DeriveSubQuery_BookmarkCategoryByUpdatedByList(cb - .query());// for saving query-value. - registerDeriveSubQuery(function, cb.query(), "USER_ID", "UPDATED_BY", - subQueryPropertyName, aliasName); + String subQueryPropertyName = keepUserId_DerivedReferrer_BookmarkCategoryByUpdatedByList(cb + .query()); // for saving query-value. + registerDerivedReferrerSubQuery(function, cb.query(), "USER_ID", + "UPDATED_BY", subQueryPropertyName, aliasName); } - abstract public String keepUserId_DeriveSubQuery_BookmarkCategoryByUpdatedByList( + public abstract String keepUserId_DerivedReferrer_BookmarkCategoryByUpdatedByList( BookmarkCategoryCQ subQuery); public void xderiveBookmarkLinkByCreatedByList(String function, SubQuery subQuery, String aliasName) { assertObjectNotNull("subQuery", subQuery); BookmarkLinkCB cb = new BookmarkLinkCB(); - cb.xsetupForDeriveReferrer(); + cb.xsetupForDerivedReferrer(); subQuery.query(cb); - String subQueryPropertyName = keepUserId_DeriveSubQuery_BookmarkLinkByCreatedByList(cb - .query());// for saving query-value. - registerDeriveSubQuery(function, cb.query(), "USER_ID", "CREATED_BY", - subQueryPropertyName, aliasName); + String subQueryPropertyName = keepUserId_DerivedReferrer_BookmarkLinkByCreatedByList(cb + .query()); // for saving query-value. + registerDerivedReferrerSubQuery(function, cb.query(), "USER_ID", + "CREATED_BY", subQueryPropertyName, aliasName); } - abstract public String keepUserId_DeriveSubQuery_BookmarkLinkByCreatedByList( + public abstract String keepUserId_DerivedReferrer_BookmarkLinkByCreatedByList( BookmarkLinkCQ subQuery); public void xderiveBookmarkLinkByUpdatedByList(String function, SubQuery subQuery, String aliasName) { assertObjectNotNull("subQuery", subQuery); BookmarkLinkCB cb = new BookmarkLinkCB(); - cb.xsetupForDeriveReferrer(); + cb.xsetupForDerivedReferrer(); subQuery.query(cb); - String subQueryPropertyName = keepUserId_DeriveSubQuery_BookmarkLinkByUpdatedByList(cb - .query());// for saving query-value. - registerDeriveSubQuery(function, cb.query(), "USER_ID", "UPDATED_BY", - subQueryPropertyName, aliasName); + String subQueryPropertyName = keepUserId_DerivedReferrer_BookmarkLinkByUpdatedByList(cb + .query()); // for saving query-value. + registerDerivedReferrerSubQuery(function, cb.query(), "USER_ID", + "UPDATED_BY", subQueryPropertyName, aliasName); } - abstract public String keepUserId_DeriveSubQuery_BookmarkLinkByUpdatedByList( + public abstract String keepUserId_DerivedReferrer_BookmarkLinkByUpdatedByList( BookmarkLinkCQ subQuery); public void xderiveGroupMappingList(String function, SubQuery subQuery, String aliasName) { assertObjectNotNull("subQuery", subQuery); GroupMappingCB cb = new GroupMappingCB(); - cb.xsetupForDeriveReferrer(); + cb.xsetupForDerivedReferrer(); subQuery.query(cb); - String subQueryPropertyName = keepUserId_DeriveSubQuery_GroupMappingList(cb - .query());// for saving query-value. - registerDeriveSubQuery(function, cb.query(), "USER_ID", "USER_ID", - subQueryPropertyName, aliasName); + String subQueryPropertyName = keepUserId_DerivedReferrer_GroupMappingList(cb + .query()); // for saving query-value. + registerDerivedReferrerSubQuery(function, cb.query(), "USER_ID", + "USER_ID", subQueryPropertyName, aliasName); } - abstract public String keepUserId_DeriveSubQuery_GroupMappingList( + public abstract String keepUserId_DerivedReferrer_GroupMappingList( GroupMappingCQ subQuery); public void xderiveRoleMappingList(String function, SubQuery subQuery, String aliasName) { assertObjectNotNull("subQuery", subQuery); RoleMappingCB cb = new RoleMappingCB(); - cb.xsetupForDeriveReferrer(); + cb.xsetupForDerivedReferrer(); subQuery.query(cb); - String subQueryPropertyName = keepUserId_DeriveSubQuery_RoleMappingList(cb - .query());// for saving query-value. - registerDeriveSubQuery(function, cb.query(), "USER_ID", "USER_ID", - subQueryPropertyName, aliasName); + String subQueryPropertyName = keepUserId_DerivedReferrer_RoleMappingList(cb + .query()); // for saving query-value. + registerDerivedReferrerSubQuery(function, cb.query(), "USER_ID", + "USER_ID", subQueryPropertyName, aliasName); } - abstract public String keepUserId_DeriveSubQuery_RoleMappingList( + public abstract String keepUserId_DerivedReferrer_RoleMappingList( RoleMappingCQ subQuery); /** - * IsNull(is null). And OnceRegistered. + * IsNull(is null). And OnlyOnceRegistered. */ public void setUserId_IsNull() { regUserId(CK_ISN, DUMMY_OBJECT); } /** - * IsNotNull(is not null). And OnceRegistered. + * IsNotNull(is not null). And OnlyOnceRegistered. */ public void setUserId_IsNotNull() { regUserId(CK_ISNN, DUMMY_OBJECT); @@ -931,7 +728,7 @@ abstract protected ConditionValue getCValueUserId(); /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {VARCHAR(100)} + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {VARCHAR(100)} * * @param givenName The value of givenName as equal. */ @@ -940,7 +737,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param givenName The value of givenName as notEqual. */ @@ -949,7 +746,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param givenName The value of givenName as greaterThan. */ @@ -958,7 +755,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param givenName The value of givenName as lessThan. */ @@ -967,7 +764,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param givenName The value of givenName as greaterEqual. */ @@ -976,7 +773,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param givenName The value of givenName as lessEqual. */ @@ -985,7 +782,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param givenName The value of givenName as prefixSearch. */ @@ -994,20 +791,6 @@ } /** - * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, - * SeveralRegistered. - * - * @param givenName The value of givenName as likeSearch. - * @param likeSearchOption The option of like-search. (NotNull) - */ - public void setGivenName_LikeSearch( - String givenName, - jp.sf.pal.bookmark.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. * @@ -1018,38 +801,52 @@ } /** - * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * - * @param givenName The collection of givenName as inScope. - * @param inScopeOption The option of in-scope. (NotNull) + * @param givenNameList The collection of givenName as notInScope. */ - public void setGivenName_InScope( + public void setGivenName_NotInScope(Collection givenNameList) { + regGivenName(CK_NINS, cTL(givenNameList)); + } + + /** + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param givenName The value of givenName as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) + */ + public void setGivenName_LikeSearch( String givenName, - jp.sf.pal.bookmark.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(givenName), getCValueGivenName(), - "GIVEN_NAME", "GivenName", "givenName", inScopeOption); + jp.sf.pal.bookmark.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(givenName), getCValueGivenName(), "GIVEN_NAME", + "GivenName", "givenName", likeSearchOption); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param givenNameList The collection of givenName as notInScope. + * @param givenName The value of givenName as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setGivenName_NotInScope(Collection givenNameList) { - regGivenName(CK_NINS, cTL(givenNameList)); + public void setGivenName_NotLikeSearch( + String givenName, + jp.sf.pal.bookmark.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(givenName), getCValueGivenName(), "GIVEN_NAME", + "GivenName", "givenName", likeSearchOption); } /** - * IsNull(is null). And OnceRegistered. + * IsNull(is null). And OnlyOnceRegistered. */ public void setGivenName_IsNull() { regGivenName(CK_ISN, DUMMY_OBJECT); } /** - * IsNotNull(is not null). And OnceRegistered. + * IsNotNull(is not null). And OnlyOnceRegistered. */ public void setGivenName_IsNotNull() { regGivenName(CK_ISNN, DUMMY_OBJECT); @@ -1068,7 +865,7 @@ abstract protected ConditionValue getCValueGivenName(); /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {VARCHAR(100)} + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {VARCHAR(100)} * * @param familyName The value of familyName as equal. */ @@ -1077,7 +874,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param familyName The value of familyName as notEqual. */ @@ -1086,7 +883,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param familyName The value of familyName as greaterThan. */ @@ -1095,7 +892,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param familyName The value of familyName as lessThan. */ @@ -1104,7 +901,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param familyName The value of familyName as greaterEqual. */ @@ -1113,7 +910,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param familyName The value of familyName as lessEqual. */ @@ -1122,7 +919,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param familyName The value of familyName as prefixSearch. */ @@ -1131,20 +928,6 @@ } /** - * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, - * SeveralRegistered. - * - * @param familyName The value of familyName as likeSearch. - * @param likeSearchOption The option of like-search. (NotNull) - */ - public void setFamilyName_LikeSearch( - String familyName, - jp.sf.pal.bookmark.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. * @@ -1155,38 +938,52 @@ } /** - * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * - * @param familyName The collection of familyName as inScope. - * @param inScopeOption The option of in-scope. (NotNull) + * @param familyNameList The collection of familyName as notInScope. */ - public void setFamilyName_InScope( + public void setFamilyName_NotInScope(Collection familyNameList) { + regFamilyName(CK_NINS, cTL(familyNameList)); + } + + /** + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param familyName The value of familyName as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) + */ + public void setFamilyName_LikeSearch( String familyName, - jp.sf.pal.bookmark.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(familyName), getCValueFamilyName(), - "FAMILY_NAME", "FamilyName", "familyName", inScopeOption); + jp.sf.pal.bookmark.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(familyName), getCValueFamilyName(), "FAMILY_NAME", + "FamilyName", "familyName", likeSearchOption); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param familyNameList The collection of familyName as notInScope. + * @param familyName The value of familyName as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setFamilyName_NotInScope(Collection familyNameList) { - regFamilyName(CK_NINS, cTL(familyNameList)); + public void setFamilyName_NotLikeSearch( + String familyName, + jp.sf.pal.bookmark.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(familyName), getCValueFamilyName(), "FAMILY_NAME", + "FamilyName", "familyName", likeSearchOption); } /** - * IsNull(is null). And OnceRegistered. + * IsNull(is null). And OnlyOnceRegistered. */ public void setFamilyName_IsNull() { regFamilyName(CK_ISN, DUMMY_OBJECT); } /** - * IsNotNull(is not null). And OnceRegistered. + * IsNotNull(is not null). And OnlyOnceRegistered. */ public void setFamilyName_IsNotNull() { regFamilyName(CK_ISNN, DUMMY_OBJECT); @@ -1205,7 +1002,7 @@ abstract protected ConditionValue getCValueFamilyName(); /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {VARCHAR(50)} + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {VARCHAR(50)} * * @param middleName The value of middleName as equal. */ @@ -1214,7 +1011,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param middleName The value of middleName as notEqual. */ @@ -1223,7 +1020,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param middleName The value of middleName as greaterThan. */ @@ -1232,7 +1029,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param middleName The value of middleName as lessThan. */ @@ -1241,7 +1038,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param middleName The value of middleName as greaterEqual. */ @@ -1250,7 +1047,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param middleName The value of middleName as lessEqual. */ @@ -1259,7 +1056,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param middleName The value of middleName as prefixSearch. */ @@ -1268,20 +1065,6 @@ } /** - * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, - * SeveralRegistered. - * - * @param middleName The value of middleName as likeSearch. - * @param likeSearchOption The option of like-search. (NotNull) - */ - public void setMiddleName_LikeSearch( - String middleName, - jp.sf.pal.bookmark.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. * @@ -1292,38 +1075,52 @@ } /** - * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * - * @param middleName The collection of middleName as inScope. - * @param inScopeOption The option of in-scope. (NotNull) + * @param middleNameList The collection of middleName as notInScope. */ - public void setMiddleName_InScope( + public void setMiddleName_NotInScope(Collection middleNameList) { + regMiddleName(CK_NINS, cTL(middleNameList)); + } + + /** + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param middleName The value of middleName as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) + */ + public void setMiddleName_LikeSearch( String middleName, - jp.sf.pal.bookmark.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(middleName), getCValueMiddleName(), - "MIDDLE_NAME", "MiddleName", "middleName", inScopeOption); + jp.sf.pal.bookmark.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(middleName), getCValueMiddleName(), "MIDDLE_NAME", + "MiddleName", "middleName", likeSearchOption); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param middleNameList The collection of middleName as notInScope. + * @param middleName The value of middleName as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setMiddleName_NotInScope(Collection middleNameList) { - regMiddleName(CK_NINS, cTL(middleNameList)); + public void setMiddleName_NotLikeSearch( + String middleName, + jp.sf.pal.bookmark.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(middleName), getCValueMiddleName(), "MIDDLE_NAME", + "MiddleName", "middleName", likeSearchOption); } /** - * IsNull(is null). And OnceRegistered. + * IsNull(is null). And OnlyOnceRegistered. */ public void setMiddleName_IsNull() { regMiddleName(CK_ISN, DUMMY_OBJECT); } /** - * IsNotNull(is not null). And OnceRegistered. + * IsNotNull(is not null). And OnlyOnceRegistered. */ public void setMiddleName_IsNotNull() { regMiddleName(CK_ISNN, DUMMY_OBJECT); @@ -1342,7 +1139,7 @@ abstract protected ConditionValue getCValueMiddleName(); /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {VARCHAR(100)} + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {VARCHAR(100)} * * @param givenNameDesc The value of givenNameDesc as equal. */ @@ -1351,7 +1148,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param givenNameDesc The value of givenNameDesc as notEqual. */ @@ -1360,7 +1157,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param givenNameDesc The value of givenNameDesc as greaterThan. */ @@ -1369,7 +1166,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param givenNameDesc The value of givenNameDesc as lessThan. */ @@ -1378,7 +1175,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param givenNameDesc The value of givenNameDesc as greaterEqual. */ @@ -1387,7 +1184,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param givenNameDesc The value of givenNameDesc as lessEqual. */ @@ -1396,7 +1193,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param givenNameDesc The value of givenNameDesc as prefixSearch. */ @@ -1405,21 +1202,6 @@ } /** - * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, - * SeveralRegistered. - * - * @param givenNameDesc The value of givenNameDesc as likeSearch. - * @param likeSearchOption The option of like-search. (NotNull) - */ - public void setGivenNameDesc_LikeSearch( - String givenNameDesc, - jp.sf.pal.bookmark.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. * @@ -1430,39 +1212,54 @@ } /** - * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * - * @param givenNameDesc The collection of givenNameDesc as inScope. - * @param inScopeOption The option of in-scope. (NotNull) + * @param givenNameDescList The collection of givenNameDesc as notInScope. */ - public void setGivenNameDesc_InScope( + public void setGivenNameDesc_NotInScope(Collection givenNameDescList) { + regGivenNameDesc(CK_NINS, cTL(givenNameDescList)); + } + + /** + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param givenNameDesc The value of givenNameDesc as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) + */ + public void setGivenNameDesc_LikeSearch( String givenNameDesc, - jp.sf.pal.bookmark.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(givenNameDesc), - getCValueGivenNameDesc(), "GIVEN_NAME_DESC", "GivenNameDesc", - "givenNameDesc", inScopeOption); + jp.sf.pal.bookmark.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(givenNameDesc), getCValueGivenNameDesc(), + "GIVEN_NAME_DESC", "GivenNameDesc", "givenNameDesc", + likeSearchOption); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param givenNameDescList The collection of givenNameDesc as notInScope. + * @param givenNameDesc The value of givenNameDesc as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setGivenNameDesc_NotInScope(Collection givenNameDescList) { - regGivenNameDesc(CK_NINS, cTL(givenNameDescList)); + public void setGivenNameDesc_NotLikeSearch( + String givenNameDesc, + jp.sf.pal.bookmark.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(givenNameDesc), getCValueGivenNameDesc(), + "GIVEN_NAME_DESC", "GivenNameDesc", "givenNameDesc", + likeSearchOption); } /** - * IsNull(is null). And OnceRegistered. + * IsNull(is null). And OnlyOnceRegistered. */ public void setGivenNameDesc_IsNull() { regGivenNameDesc(CK_ISN, DUMMY_OBJECT); } /** - * IsNotNull(is not null). And OnceRegistered. + * IsNotNull(is not null). And OnlyOnceRegistered. */ public void setGivenNameDesc_IsNotNull() { regGivenNameDesc(CK_ISNN, DUMMY_OBJECT); @@ -1481,7 +1278,7 @@ abstract protected ConditionValue getCValueGivenNameDesc(); /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {VARCHAR(100)} + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {VARCHAR(100)} * * @param familyNameDesc The value of familyNameDesc as equal. */ @@ -1490,7 +1287,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param familyNameDesc The value of familyNameDesc as notEqual. */ @@ -1499,7 +1296,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param familyNameDesc The value of familyNameDesc as greaterThan. */ @@ -1508,7 +1305,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param familyNameDesc The value of familyNameDesc as lessThan. */ @@ -1517,7 +1314,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param familyNameDesc The value of familyNameDesc as greaterEqual. */ @@ -1526,7 +1323,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param familyNameDesc The value of familyNameDesc as lessEqual. */ @@ -1535,7 +1332,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param familyNameDesc The value of familyNameDesc as prefixSearch. */ @@ -1544,21 +1341,6 @@ } /** - * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, - * SeveralRegistered. - * - * @param familyNameDesc The value of familyNameDesc as likeSearch. - * @param likeSearchOption The option of like-search. (NotNull) - */ - public void setFamilyNameDesc_LikeSearch( - String familyNameDesc, - jp.sf.pal.bookmark.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. * @@ -1569,40 +1351,55 @@ } /** - * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * - * @param familyNameDesc The collection of familyNameDesc as inScope. - * @param inScopeOption The option of in-scope. (NotNull) + * @param familyNameDescList The collection of familyNameDesc as notInScope. */ - public void setFamilyNameDesc_InScope( + public void setFamilyNameDesc_NotInScope( + Collection familyNameDescList) { + regFamilyNameDesc(CK_NINS, cTL(familyNameDescList)); + } + + /** + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param familyNameDesc The value of familyNameDesc as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) + */ + public void setFamilyNameDesc_LikeSearch( String familyNameDesc, - jp.sf.pal.bookmark.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(familyNameDesc), - getCValueFamilyNameDesc(), "FAMILY_NAME_DESC", - "FamilyNameDesc", "familyNameDesc", inScopeOption); + jp.sf.pal.bookmark.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(familyNameDesc), getCValueFamilyNameDesc(), + "FAMILY_NAME_DESC", "FamilyNameDesc", "familyNameDesc", + likeSearchOption); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param familyNameDescList The collection of familyNameDesc as notInScope. + * @param familyNameDesc The value of familyNameDesc as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setFamilyNameDesc_NotInScope( - Collection familyNameDescList) { - regFamilyNameDesc(CK_NINS, cTL(familyNameDescList)); + public void setFamilyNameDesc_NotLikeSearch( + String familyNameDesc, + jp.sf.pal.bookmark.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(familyNameDesc), getCValueFamilyNameDesc(), + "FAMILY_NAME_DESC", "FamilyNameDesc", "familyNameDesc", + likeSearchOption); } /** - * IsNull(is null). And OnceRegistered. + * IsNull(is null). And OnlyOnceRegistered. */ public void setFamilyNameDesc_IsNull() { regFamilyNameDesc(CK_ISN, DUMMY_OBJECT); } /** - * IsNotNull(is not null). And OnceRegistered. + * IsNotNull(is not null). And OnlyOnceRegistered. */ public void setFamilyNameDesc_IsNotNull() { regFamilyNameDesc(CK_ISNN, DUMMY_OBJECT); @@ -1621,7 +1418,7 @@ abstract protected ConditionValue getCValueFamilyNameDesc(); /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {VARCHAR(100)} + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {VARCHAR(100)} * * @param nickname The value of nickname as equal. */ @@ -1630,7 +1427,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param nickname The value of nickname as notEqual. */ @@ -1639,7 +1436,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param nickname The value of nickname as greaterThan. */ @@ -1648,7 +1445,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param nickname The value of nickname as lessThan. */ @@ -1657,7 +1454,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param nickname The value of nickname as greaterEqual. */ @@ -1666,7 +1463,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param nickname The value of nickname as lessEqual. */ @@ -1675,7 +1472,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param nickname The value of nickname as prefixSearch. */ @@ -1684,20 +1481,6 @@ } /** - * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, - * SeveralRegistered. - * - * @param nickname The value of nickname as likeSearch. - * @param likeSearchOption The option of like-search. (NotNull) - */ - public void setNickname_LikeSearch( - String nickname, - jp.sf.pal.bookmark.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { - registerLikeSearchQuery(CK_LS, fRES(nickname), getCValueNickname(), - "NICKNAME", "Nickname", "nickname", likeSearchOption); - } - - /** * InScope(in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * @@ -1708,38 +1491,52 @@ } /** - * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * - * @param nickname The collection of nickname as inScope. - * @param inScopeOption The option of in-scope. (NotNull) + * @param nicknameList The collection of nickname as notInScope. */ - public void setNickname_InScope( + public void setNickname_NotInScope(Collection nicknameList) { + regNickname(CK_NINS, cTL(nicknameList)); + } + + /** + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param nickname The value of nickname as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) + */ + public void setNickname_LikeSearch( String nickname, - jp.sf.pal.bookmark.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(nickname), getCValueNickname(), - "NICKNAME", "Nickname", "nickname", inScopeOption); + jp.sf.pal.bookmark.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(nickname), getCValueNickname(), "NICKNAME", + "Nickname", "nickname", likeSearchOption); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param nicknameList The collection of nickname as notInScope. + * @param nickname The value of nickname as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setNickname_NotInScope(Collection nicknameList) { - regNickname(CK_NINS, cTL(nicknameList)); + public void setNickname_NotLikeSearch( + String nickname, + jp.sf.pal.bookmark.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(nickname), getCValueNickname(), "NICKNAME", + "Nickname", "nickname", likeSearchOption); } /** - * IsNull(is null). And OnceRegistered. + * IsNull(is null). And OnlyOnceRegistered. */ public void setNickname_IsNull() { regNickname(CK_ISN, DUMMY_OBJECT); } /** - * IsNotNull(is not null). And OnceRegistered. + * IsNotNull(is not null). And OnlyOnceRegistered. */ public void setNickname_IsNotNull() { regNickname(CK_ISNN, DUMMY_OBJECT); @@ -1758,7 +1555,7 @@ abstract protected ConditionValue getCValueNickname(); /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {VARCHAR(1)} + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {VARCHAR(1)} * * @param gender The value of gender as equal. */ @@ -1767,7 +1564,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param gender The value of gender as notEqual. */ @@ -1776,7 +1573,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param gender The value of gender as greaterThan. */ @@ -1785,7 +1582,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param gender The value of gender as lessThan. */ @@ -1794,7 +1591,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param gender The value of gender as greaterEqual. */ @@ -1803,7 +1600,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param gender The value of gender as lessEqual. */ @@ -1812,7 +1609,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param gender The value of gender as prefixSearch. */ @@ -1821,20 +1618,6 @@ } /** - * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, - * SeveralRegistered. - * - * @param gender The value of gender as likeSearch. - * @param likeSearchOption The option of like-search. (NotNull) - */ - public void setGender_LikeSearch( - String gender, - jp.sf.pal.bookmark.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { - registerLikeSearchQuery(CK_LS, fRES(gender), getCValueGender(), - "GENDER", "Gender", "gender", likeSearchOption); - } - - /** * InScope(in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * @@ -1845,38 +1628,52 @@ } /** - * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * - * @param gender The collection of gender as inScope. - * @param inScopeOption The option of in-scope. (NotNull) + * @param genderList The collection of gender as notInScope. */ - public void setGender_InScope( + public void setGender_NotInScope(Collection genderList) { + regGender(CK_NINS, cTL(genderList)); + } + + /** + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param gender The value of gender as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) + */ + public void setGender_LikeSearch( String gender, - jp.sf.pal.bookmark.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(gender), getCValueGender(), "GENDER", - "Gender", "gender", inScopeOption); + jp.sf.pal.bookmark.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(gender), getCValueGender(), "GENDER", "Gender", + "gender", likeSearchOption); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param genderList The collection of gender as notInScope. + * @param gender The value of gender as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setGender_NotInScope(Collection genderList) { - regGender(CK_NINS, cTL(genderList)); + public void setGender_NotLikeSearch( + String gender, + jp.sf.pal.bookmark.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(gender), getCValueGender(), "GENDER", "Gender", + "gender", likeSearchOption); } /** - * IsNull(is null). And OnceRegistered. + * IsNull(is null). And OnlyOnceRegistered. */ public void setGender_IsNull() { regGender(CK_ISN, DUMMY_OBJECT); } /** - * IsNotNull(is not null). And OnceRegistered. + * IsNotNull(is not null). And OnlyOnceRegistered. */ public void setGender_IsNotNull() { regGender(CK_ISNN, DUMMY_OBJECT); @@ -1895,7 +1692,7 @@ abstract protected ConditionValue getCValueGender(); /** - * Equal(=). And NullIgnored, OnceRegistered. {DATE} + * Equal(=). And NullIgnored, OnlyOnceRegistered. {DATE} * * @param birthDate The value of birthDate as equal. */ @@ -1904,7 +1701,7 @@ } /** - * NotEqual(!=). And NullIgnored, OnceRegistered. + * NotEqual(!=). And NullIgnored, OnlyOnceRegistered. * * @param birthDate The value of birthDate as notEqual. */ @@ -1913,7 +1710,7 @@ } /** - * GreaterThan(>). And NullIgnored, OnceRegistered. + * GreaterThan(>). And NullIgnored, OnlyOnceRegistered. * * @param birthDate The value of birthDate as greaterThan. */ @@ -1922,7 +1719,7 @@ } /** - * LessThan(>). And NullIgnored, OnceRegistered. + * LessThan(>). And NullIgnored, OnlyOnceRegistered. * * @param birthDate The value of birthDate as lessThan. */ @@ -1931,7 +1728,7 @@ } /** - * GreaterEqual(>). And NullIgnored, OnceRegistered. + * GreaterEqual(>). And NullIgnored, OnlyOnceRegistered. * * @param birthDate The value of birthDate as greaterEqual. */ @@ -1940,7 +1737,7 @@ } /** - * LessEqual(>). And NullIgnored, OnceRegistered. + * LessEqual(>). And NullIgnored, OnlyOnceRegistered. * * @param birthDate The value of birthDate as lessEqual. */ @@ -1950,7 +1747,7 @@ /** * FromTo($fromDate <= COLUMN_NAME <= $toDate). And NullIgnored, - * OnceRegistered. {DATE} + * OnlyOnceRegistered. {DATE} * * @param fromDate The from-date of birthDate. (Nullable) * @param toDate The to-date of birthDate. (Nullable) @@ -1966,7 +1763,7 @@ /** * FromTo($fromDate <= COLUMN_NAME < $toDate + 1). And NullIgnored, - * OnceRegistered. {DATE} + * OnlyOnceRegistered. {DATE} * * @param fromDate The from-date of birthDate. (Nullable) * @param toDate The to-date of birthDate. (Nullable) @@ -1980,14 +1777,14 @@ } /** - * IsNull(is null). And OnceRegistered. + * IsNull(is null). And OnlyOnceRegistered. */ public void setBirthDate_IsNull() { regBirthDate(CK_ISN, DUMMY_OBJECT); } /** - * IsNotNull(is not null). And OnceRegistered. + * IsNotNull(is not null). And OnlyOnceRegistered. */ public void setBirthDate_IsNotNull() { regBirthDate(CK_ISNN, DUMMY_OBJECT); @@ -2006,7 +1803,7 @@ abstract protected ConditionValue getCValueBirthDate(); /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {VARCHAR(255)} + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {VARCHAR(255)} * * @param email The value of email as equal. */ @@ -2015,7 +1812,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param email The value of email as notEqual. */ @@ -2024,7 +1821,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param email The value of email as greaterThan. */ @@ -2033,7 +1830,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param email The value of email as lessThan. */ @@ -2042,7 +1839,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param email The value of email as greaterEqual. */ @@ -2051,7 +1848,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param email The value of email as lessEqual. */ @@ -2060,7 +1857,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param email The value of email as prefixSearch. */ @@ -2069,20 +1866,6 @@ } /** - * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, - * SeveralRegistered. - * - * @param email The value of email as likeSearch. - * @param likeSearchOption The option of like-search. (NotNull) - */ - public void setEmail_LikeSearch( - String email, - jp.sf.pal.bookmark.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { - registerLikeSearchQuery(CK_LS, fRES(email), getCValueEmail(), "EMAIL", - "Email", "email", likeSearchOption); - } - - /** * InScope(in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * @@ -2093,38 +1876,52 @@ } /** - * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * - * @param email The collection of email as inScope. - * @param inScopeOption The option of in-scope. (NotNull) + * @param emailList The collection of email as notInScope. */ - public void setEmail_InScope( + public void setEmail_NotInScope(Collection emailList) { + regEmail(CK_NINS, cTL(emailList)); + } + + /** + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param email The value of email as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) + */ + public void setEmail_LikeSearch( String email, - jp.sf.pal.bookmark.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(email), getCValueEmail(), "EMAIL", - "Email", "email", inScopeOption); + jp.sf.pal.bookmark.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(email), getCValueEmail(), "EMAIL", "Email", "email", + likeSearchOption); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param emailList The collection of email as notInScope. + * @param email The value of email as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setEmail_NotInScope(Collection emailList) { - regEmail(CK_NINS, cTL(emailList)); + public void setEmail_NotLikeSearch( + String email, + jp.sf.pal.bookmark.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(email), getCValueEmail(), "EMAIL", "Email", + "email", likeSearchOption); } /** - * IsNull(is null). And OnceRegistered. + * IsNull(is null). And OnlyOnceRegistered. */ public void setEmail_IsNull() { regEmail(CK_ISN, DUMMY_OBJECT); } /** - * IsNotNull(is not null). And OnceRegistered. + * IsNotNull(is not null). And OnlyOnceRegistered. */ public void setEmail_IsNotNull() { regEmail(CK_ISNN, DUMMY_OBJECT); @@ -2142,7 +1939,7 @@ abstract protected ConditionValue getCValueEmail(); /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {VARCHAR(255)} + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {VARCHAR(255)} * * @param url The value of url as equal. */ @@ -2151,7 +1948,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param url The value of url as notEqual. */ @@ -2160,7 +1957,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param url The value of url as greaterThan. */ @@ -2169,7 +1966,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param url The value of url as lessThan. */ @@ -2178,7 +1975,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param url The value of url as greaterEqual. */ @@ -2187,7 +1984,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param url The value of url as lessEqual. */ @@ -2196,7 +1993,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param url The value of url as prefixSearch. */ @@ -2205,20 +2002,6 @@ } /** - * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, - * SeveralRegistered. - * - * @param url The value of url as likeSearch. - * @param likeSearchOption The option of like-search. (NotNull) - */ - public void setUrl_LikeSearch( - String url, - jp.sf.pal.bookmark.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { - registerLikeSearchQuery(CK_LS, fRES(url), getCValueUrl(), "URL", "Url", - "url", likeSearchOption); - } - - /** * InScope(in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * @@ -2229,38 +2012,52 @@ } /** - * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * - * @param url The collection of url as inScope. - * @param inScopeOption The option of in-scope. (NotNull) + * @param urlList The collection of url as notInScope. */ - public void setUrl_InScope( + public void setUrl_NotInScope(Collection urlList) { + regUrl(CK_NINS, cTL(urlList)); + } + + /** + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param url The value of url as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) + */ + public void setUrl_LikeSearch( String url, - jp.sf.pal.bookmark.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(url), getCValueUrl(), "URL", "Url", - "url", inScopeOption); + jp.sf.pal.bookmark.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(url), getCValueUrl(), "URL", "Url", "url", + likeSearchOption); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param urlList The collection of url as notInScope. + * @param url The value of url as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setUrl_NotInScope(Collection urlList) { - regUrl(CK_NINS, cTL(urlList)); + public void setUrl_NotLikeSearch( + String url, + jp.sf.pal.bookmark.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(url), getCValueUrl(), "URL", "Url", "url", + likeSearchOption); } /** - * IsNull(is null). And OnceRegistered. + * IsNull(is null). And OnlyOnceRegistered. */ public void setUrl_IsNull() { regUrl(CK_ISN, DUMMY_OBJECT); } /** - * IsNotNull(is not null). And OnceRegistered. + * IsNotNull(is not null). And OnlyOnceRegistered. */ public void setUrl_IsNotNull() { regUrl(CK_ISNN, DUMMY_OBJECT); @@ -2277,7 +2074,7 @@ abstract protected ConditionValue getCValueUrl(); /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {VARCHAR(40)} + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {VARCHAR(40)} * * @param telephone The value of telephone as equal. */ @@ -2286,7 +2083,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param telephone The value of telephone as notEqual. */ @@ -2295,7 +2092,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param telephone The value of telephone as greaterThan. */ @@ -2304,7 +2101,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param telephone The value of telephone as lessThan. */ @@ -2313,7 +2110,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param telephone The value of telephone as greaterEqual. */ @@ -2322,7 +2119,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param telephone The value of telephone as lessEqual. */ @@ -2331,7 +2128,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param telephone The value of telephone as prefixSearch. */ @@ -2340,20 +2137,6 @@ } /** - * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, - * SeveralRegistered. - * - * @param telephone The value of telephone as likeSearch. - * @param likeSearchOption The option of like-search. (NotNull) - */ - public void setTelephone_LikeSearch( - String telephone, - jp.sf.pal.bookmark.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { - registerLikeSearchQuery(CK_LS, fRES(telephone), getCValueTelephone(), - "TELEPHONE", "Telephone", "telephone", likeSearchOption); - } - - /** * InScope(in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * @@ -2364,38 +2147,52 @@ } /** - * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * - * @param telephone The collection of telephone as inScope. - * @param inScopeOption The option of in-scope. (NotNull) + * @param telephoneList The collection of telephone as notInScope. */ - public void setTelephone_InScope( + public void setTelephone_NotInScope(Collection telephoneList) { + regTelephone(CK_NINS, cTL(telephoneList)); + } + + /** + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param telephone The value of telephone as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) + */ + public void setTelephone_LikeSearch( String telephone, - jp.sf.pal.bookmark.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(telephone), getCValueTelephone(), - "TELEPHONE", "Telephone", "telephone", inScopeOption); + jp.sf.pal.bookmark.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(telephone), getCValueTelephone(), "TELEPHONE", + "Telephone", "telephone", likeSearchOption); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param telephoneList The collection of telephone as notInScope. + * @param telephone The value of telephone as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setTelephone_NotInScope(Collection telephoneList) { - regTelephone(CK_NINS, cTL(telephoneList)); + public void setTelephone_NotLikeSearch( + String telephone, + jp.sf.pal.bookmark.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(telephone), getCValueTelephone(), "TELEPHONE", + "Telephone", "telephone", likeSearchOption); } /** - * IsNull(is null). And OnceRegistered. + * IsNull(is null). And OnlyOnceRegistered. */ public void setTelephone_IsNull() { regTelephone(CK_ISN, DUMMY_OBJECT); } /** - * IsNotNull(is not null). And OnceRegistered. + * IsNotNull(is not null). And OnlyOnceRegistered. */ public void setTelephone_IsNotNull() { regTelephone(CK_ISNN, DUMMY_OBJECT); @@ -2414,7 +2211,7 @@ abstract protected ConditionValue getCValueTelephone(); /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {VARCHAR(5)} + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {VARCHAR(5)} * * @param locale The value of locale as equal. */ @@ -2423,7 +2220,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param locale The value of locale as notEqual. */ @@ -2432,7 +2229,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param locale The value of locale as greaterThan. */ @@ -2441,7 +2238,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param locale The value of locale as lessThan. */ @@ -2450,7 +2247,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param locale The value of locale as greaterEqual. */ @@ -2459,7 +2256,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param locale The value of locale as lessEqual. */ @@ -2468,7 +2265,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param locale The value of locale as prefixSearch. */ @@ -2477,20 +2274,6 @@ } /** - * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, - * SeveralRegistered. - * - * @param locale The value of locale as likeSearch. - * @param likeSearchOption The option of like-search. (NotNull) - */ - public void setLocale_LikeSearch( - String locale, - jp.sf.pal.bookmark.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { - registerLikeSearchQuery(CK_LS, fRES(locale), getCValueLocale(), - "LOCALE", "Locale", "locale", likeSearchOption); - } - - /** * InScope(in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * @@ -2501,38 +2284,52 @@ } /** - * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * - * @param locale The collection of locale as inScope. - * @param inScopeOption The option of in-scope. (NotNull) + * @param localeList The collection of locale as notInScope. */ - public void setLocale_InScope( + public void setLocale_NotInScope(Collection localeList) { + regLocale(CK_NINS, cTL(localeList)); + } + + /** + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param locale The value of locale as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) + */ + public void setLocale_LikeSearch( String locale, - jp.sf.pal.bookmark.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(locale), getCValueLocale(), "LOCALE", - "Locale", "locale", inScopeOption); + jp.sf.pal.bookmark.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(locale), getCValueLocale(), "LOCALE", "Locale", + "locale", likeSearchOption); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param localeList The collection of locale as notInScope. + * @param locale The value of locale as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setLocale_NotInScope(Collection localeList) { - regLocale(CK_NINS, cTL(localeList)); + public void setLocale_NotLikeSearch( + String locale, + jp.sf.pal.bookmark.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(locale), getCValueLocale(), "LOCALE", "Locale", + "locale", likeSearchOption); } /** - * IsNull(is null). And OnceRegistered. + * IsNull(is null). And OnlyOnceRegistered. */ public void setLocale_IsNull() { regLocale(CK_ISN, DUMMY_OBJECT); } /** - * IsNotNull(is not null). And OnceRegistered. + * IsNotNull(is not null). And OnlyOnceRegistered. */ public void setLocale_IsNotNull() { regLocale(CK_ISNN, DUMMY_OBJECT); @@ -2551,8 +2348,8 @@ abstract protected ConditionValue getCValueLocale(); /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {VARCHAR(255) : FK to - * ROLE_INFO} + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {VARCHAR(255) : FK + * to ROLE_INFO} * * @param roleId The value of roleId as equal. */ @@ -2561,7 +2358,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param roleId The value of roleId as notEqual. */ @@ -2570,7 +2367,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param roleId The value of roleId as greaterThan. */ @@ -2579,7 +2376,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param roleId The value of roleId as lessThan. */ @@ -2588,7 +2385,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param roleId The value of roleId as greaterEqual. */ @@ -2597,7 +2394,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param roleId The value of roleId as lessEqual. */ @@ -2606,7 +2403,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param roleId The value of roleId as prefixSearch. */ @@ -2615,20 +2412,6 @@ } /** - * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, - * SeveralRegistered. - * - * @param roleId The value of roleId as likeSearch. - * @param likeSearchOption The option of like-search. (NotNull) - */ - public void setRoleId_LikeSearch( - String roleId, - jp.sf.pal.bookmark.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. * @@ -2639,42 +2422,41 @@ } /** - * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * - * @param roleId The collection of roleId as inScope. - * @param inScopeOption The option of in-scope. (NotNull) + * @param roleIdList The collection of roleId as notInScope. */ - public void setRoleId_InScope( - String roleId, - jp.sf.pal.bookmark.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(roleId), getCValueRoleId(), - "ROLE_ID", "RoleId", "roleId", inScopeOption); + public void setRoleId_NotInScope(Collection roleIdList) { + regRoleId(CK_NINS, cTL(roleIdList)); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param roleIdList The collection of roleId as notInScope. + * @param roleId The value of roleId as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) */ - public void setRoleId_NotInScope(Collection roleIdList) { - regRoleId(CK_NINS, cTL(roleIdList)); + public void setRoleId_LikeSearch( + String roleId, + jp.sf.pal.bookmark.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(roleId), getCValueRoleId(), "ROLE_ID", "RoleId", + "roleId", likeSearchOption); } /** - * @param roleInfoCBquery Query. - * @deprecated Please use inScopeRoleInfo(subQuery) method. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param roleId The value of roleId as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setRoleId_InScopeSubQuery_RoleInfo(RoleInfoCQ roleInfoCBquery) { - String subQueryPropertyName = keepRoleId_InScopeSubQuery_RoleInfo(roleInfoCBquery);// for - // saving - // query - // - - // value - // . - registerInScopeSubQuery(roleInfoCBquery, "ROLE_ID", "ROLE_ID", - subQueryPropertyName); + public void setRoleId_NotLikeSearch( + String roleId, + jp.sf.pal.bookmark.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(roleId), getCValueRoleId(), "ROLE_ID", "RoleId", + "roleId", likeSearchOption); } public void inScopeRoleInfo(SubQuery subQuery) { @@ -2683,23 +2465,23 @@ cb.xsetupForInScopeSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepRoleId_InScopeSubQuery_RoleInfo(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerInScopeSubQuery(cb.query(), "ROLE_ID", "ROLE_ID", subQueryPropertyName); } - abstract public String keepRoleId_InScopeSubQuery_RoleInfo( + public abstract String keepRoleId_InScopeSubQuery_RoleInfo( jp.sf.pal.bookmark.db.cbean.cq.RoleInfoCQ subQuery); /** - * IsNull(is null). And OnceRegistered. + * IsNull(is null). And OnlyOnceRegistered. */ public void setRoleId_IsNull() { regRoleId(CK_ISN, DUMMY_OBJECT); } /** - * IsNotNull(is not null). And OnceRegistered. + * IsNotNull(is not null). And OnlyOnceRegistered. */ public void setRoleId_IsNotNull() { regRoleId(CK_ISNN, DUMMY_OBJECT); @@ -2718,8 +2500,8 @@ abstract protected ConditionValue getCValueRoleId(); /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {VARCHAR(255) : FK to - * GROUP_INFO} + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {VARCHAR(255) : FK + * to GROUP_INFO} * * @param groupId The value of groupId as equal. */ @@ -2728,7 +2510,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param groupId The value of groupId as notEqual. */ @@ -2737,7 +2519,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param groupId The value of groupId as greaterThan. */ @@ -2746,7 +2528,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param groupId The value of groupId as lessThan. */ @@ -2755,7 +2537,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param groupId The value of groupId as greaterEqual. */ @@ -2764,7 +2546,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param groupId The value of groupId as lessEqual. */ @@ -2773,7 +2555,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param groupId The value of groupId as prefixSearch. */ @@ -2782,20 +2564,6 @@ } /** - * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, - * SeveralRegistered. - * - * @param groupId The value of groupId as likeSearch. - * @param likeSearchOption The option of like-search. (NotNull) - */ - public void setGroupId_LikeSearch( - String groupId, - jp.sf.pal.bookmark.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. * @@ -2806,43 +2574,41 @@ } /** - * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * - * @param groupId The collection of groupId as inScope. - * @param inScopeOption The option of in-scope. (NotNull) + * @param groupIdList The collection of groupId as notInScope. */ - public void setGroupId_InScope( - String groupId, - jp.sf.pal.bookmark.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(groupId), getCValueGroupId(), - "GROUP_ID", "GroupId", "groupId", inScopeOption); + public void setGroupId_NotInScope(Collection groupIdList) { + regGroupId(CK_NINS, cTL(groupIdList)); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param groupIdList The collection of groupId as notInScope. + * @param groupId The value of groupId as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) */ - public void setGroupId_NotInScope(Collection groupIdList) { - regGroupId(CK_NINS, cTL(groupIdList)); + public void setGroupId_LikeSearch( + String groupId, + jp.sf.pal.bookmark.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(groupId), getCValueGroupId(), "GROUP_ID", "GroupId", + "groupId", likeSearchOption); } /** - * @param groupInfoCBquery Query. - * @deprecated Please use inScopeGroupInfo(subQuery) method. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param groupId The value of groupId as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setGroupId_InScopeSubQuery_GroupInfo( - GroupInfoCQ groupInfoCBquery) { - String subQueryPropertyName = keepGroupId_InScopeSubQuery_GroupInfo(groupInfoCBquery);// for - // saving - // query - // - - // value - // . - registerInScopeSubQuery(groupInfoCBquery, "GROUP_ID", "GROUP_ID", - subQueryPropertyName); + public void setGroupId_NotLikeSearch( + String groupId, + jp.sf.pal.bookmark.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(groupId), getCValueGroupId(), "GROUP_ID", + "GroupId", "groupId", likeSearchOption); } public void inScopeGroupInfo(SubQuery subQuery) { @@ -2851,23 +2617,23 @@ cb.xsetupForInScopeSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepGroupId_InScopeSubQuery_GroupInfo(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerInScopeSubQuery(cb.query(), "GROUP_ID", "GROUP_ID", subQueryPropertyName); } - abstract public String keepGroupId_InScopeSubQuery_GroupInfo( + public abstract String keepGroupId_InScopeSubQuery_GroupInfo( jp.sf.pal.bookmark.db.cbean.cq.GroupInfoCQ subQuery); /** - * IsNull(is null). And OnceRegistered. + * IsNull(is null). And OnlyOnceRegistered. */ public void setGroupId_IsNull() { regGroupId(CK_ISN, DUMMY_OBJECT); } /** - * IsNotNull(is not null). And OnceRegistered. + * IsNotNull(is not null). And OnlyOnceRegistered. */ public void setGroupId_IsNotNull() { regGroupId(CK_ISNN, DUMMY_OBJECT); @@ -2886,8 +2652,145 @@ abstract protected ConditionValue getCValueGroupId(); /** - * Equal(=). And NullIgnored, OnceRegistered. {NotNull : TIMESTAMP} + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {VARCHAR(1)} * + * @param status The value of status as equal. + */ + public void setStatus_Equal(String status) { + regStatus(CK_EQ, fRES(status)); + } + + /** + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. + * + * @param status The value of status as notEqual. + */ + public void setStatus_NotEqual(String status) { + regStatus(CK_NE, fRES(status)); + } + + /** + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. + * + * @param status The value of status as greaterThan. + */ + public void setStatus_GreaterThan(String status) { + regStatus(CK_GT, fRES(status)); + } + + /** + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. + * + * @param status The value of status as lessThan. + */ + public void setStatus_LessThan(String status) { + regStatus(CK_LT, fRES(status)); + } + + /** + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. + * + * @param status The value of status as greaterEqual. + */ + public void setStatus_GreaterEqual(String status) { + regStatus(CK_GE, fRES(status)); + } + + /** + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. + * + * @param status The value of status as lessEqual. + */ + public void setStatus_LessEqual(String status) { + regStatus(CK_LE, fRES(status)); + } + + /** + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. + * + * @param status The value of status as prefixSearch. + */ + public void setStatus_PrefixSearch(String status) { + regStatus(CK_PS, fRES(status)); + } + + /** + * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NullOrEmptyElementIgnored, SeveralRegistered. + * + * @param statusList The collection of status as inScope. + */ + public void setStatus_InScope(Collection statusList) { + regStatus(CK_INS, cTL(statusList)); + } + + /** + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, + * NullOrEmptyElementIgnored, SeveralRegistered. + * + * @param statusList The collection of status as notInScope. + */ + public void setStatus_NotInScope(Collection statusList) { + regStatus(CK_NINS, cTL(statusList)); + } + + /** + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param status The value of status as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) + */ + public void setStatus_LikeSearch( + String status, + jp.sf.pal.bookmark.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(status), getCValueStatus(), "STATUS", "Status", + "status", likeSearchOption); + } + + /** + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param status The value of status as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) + */ + public void setStatus_NotLikeSearch( + String status, + jp.sf.pal.bookmark.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(status), getCValueStatus(), "STATUS", "Status", + "status", likeSearchOption); + } + + /** + * IsNull(is null). And OnlyOnceRegistered. + */ + public void setStatus_IsNull() { + regStatus(CK_ISN, DUMMY_OBJECT); + } + + /** + * IsNotNull(is not null). And OnlyOnceRegistered. + */ + public void setStatus_IsNotNull() { + regStatus(CK_ISNN, DUMMY_OBJECT); + } + + protected void regStatus(ConditionKey key, Object value) { + registerQuery(key, value, getCValueStatus(), "STATUS", "Status", + "status"); + } + + protected void registerInlineStatus(ConditionKey key, Object value) { + registerInlineQuery(key, value, getCValueStatus(), "STATUS", "Status", + "status"); + } + + abstract protected ConditionValue getCValueStatus(); + + /** + * Equal(=). And NullIgnored, OnlyOnceRegistered. {NotNull : TIMESTAMP} + * * @param createdTime The value of createdTime as equal. */ public void setCreatedTime_Equal(java.sql.Timestamp createdTime) { @@ -2895,7 +2798,7 @@ } /** - * NotEqual(!=). And NullIgnored, OnceRegistered. + * NotEqual(!=). And NullIgnored, OnlyOnceRegistered. * * @param createdTime The value of createdTime as notEqual. */ @@ -2904,7 +2807,7 @@ } /** - * GreaterThan(>). And NullIgnored, OnceRegistered. + * GreaterThan(>). And NullIgnored, OnlyOnceRegistered. * * @param createdTime The value of createdTime as greaterThan. */ @@ -2913,7 +2816,7 @@ } /** - * LessThan(>). And NullIgnored, OnceRegistered. + * LessThan(>). And NullIgnored, OnlyOnceRegistered. * * @param createdTime The value of createdTime as lessThan. */ @@ -2922,7 +2825,7 @@ } /** - * GreaterEqual(>). And NullIgnored, OnceRegistered. + * GreaterEqual(>). And NullIgnored, OnlyOnceRegistered. * * @param createdTime The value of createdTime as greaterEqual. */ @@ -2931,7 +2834,7 @@ } /** - * LessEqual(>). And NullIgnored, OnceRegistered. + * LessEqual(>). And NullIgnored, OnlyOnceRegistered. * * @param createdTime The value of createdTime as lessEqual. */ @@ -2941,7 +2844,7 @@ /** * FromTo($fromDate <= COLUMN_NAME <= $toDate). And NullIgnored, - * OnceRegistered. {NotNull : TIMESTAMP} + * OnlyOnceRegistered. {NotNull : TIMESTAMP} * * @param fromDate The from-date of createdTime. (Nullable) * @param toDate The to-date of createdTime. (Nullable) @@ -2959,7 +2862,7 @@ /** * FromTo($fromDate <= COLUMN_NAME < $toDate + 1). And NullIgnored, - * OnceRegistered. {NotNull : TIMESTAMP} + * OnlyOnceRegistered. {NotNull : TIMESTAMP} * * @param fromDate The from-date of createdTime. (Nullable) * @param toDate The to-date of createdTime. (Nullable) @@ -2985,7 +2888,7 @@ abstract protected ConditionValue getCValueCreatedTime(); /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {NotNull : + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {NotNull : * VARCHAR(255)} * * @param createdBy The value of createdBy as equal. @@ -2995,7 +2898,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param createdBy The value of createdBy as notEqual. */ @@ -3004,7 +2907,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param createdBy The value of createdBy as greaterThan. */ @@ -3013,7 +2916,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param createdBy The value of createdBy as lessThan. */ @@ -3022,7 +2925,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param createdBy The value of createdBy as greaterEqual. */ @@ -3031,7 +2934,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param createdBy The value of createdBy as lessEqual. */ @@ -3040,7 +2943,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param createdBy The value of createdBy as prefixSearch. */ @@ -3049,20 +2952,6 @@ } /** - * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, - * SeveralRegistered. - * - * @param createdBy The value of createdBy as likeSearch. - * @param likeSearchOption The option of like-search. (NotNull) - */ - public void setCreatedBy_LikeSearch( - String createdBy, - jp.sf.pal.bookmark.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. * @@ -3073,27 +2962,41 @@ } /** - * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * - * @param createdBy The collection of createdBy as inScope. - * @param inScopeOption The option of in-scope. (NotNull) + * @param createdByList The collection of createdBy as notInScope. */ - public void setCreatedBy_InScope( + public void setCreatedBy_NotInScope(Collection createdByList) { + regCreatedBy(CK_NINS, cTL(createdByList)); + } + + /** + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param createdBy The value of createdBy as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) + */ + public void setCreatedBy_LikeSearch( String createdBy, - jp.sf.pal.bookmark.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(createdBy), getCValueCreatedBy(), - "CREATED_BY", "CreatedBy", "createdBy", inScopeOption); + jp.sf.pal.bookmark.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(createdBy), getCValueCreatedBy(), "CREATED_BY", + "CreatedBy", "createdBy", likeSearchOption); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param createdByList The collection of createdBy as notInScope. + * @param createdBy The value of createdBy as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setCreatedBy_NotInScope(Collection createdByList) { - regCreatedBy(CK_NINS, cTL(createdByList)); + public void setCreatedBy_NotLikeSearch( + String createdBy, + jp.sf.pal.bookmark.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(createdBy), getCValueCreatedBy(), "CREATED_BY", + "CreatedBy", "createdBy", likeSearchOption); } protected void regCreatedBy(ConditionKey key, Object value) { @@ -3109,7 +3012,7 @@ abstract protected ConditionValue getCValueCreatedBy(); /** - * Equal(=). And NullIgnored, OnceRegistered. {NotNull : TIMESTAMP} + * Equal(=). And NullIgnored, OnlyOnceRegistered. {NotNull : TIMESTAMP} * * @param updatedTime The value of updatedTime as equal. */ @@ -3118,7 +3021,7 @@ } /** - * NotEqual(!=). And NullIgnored, OnceRegistered. + * NotEqual(!=). And NullIgnored, OnlyOnceRegistered. * * @param updatedTime The value of updatedTime as notEqual. */ @@ -3127,7 +3030,7 @@ } /** - * GreaterThan(>). And NullIgnored, OnceRegistered. + * GreaterThan(>). And NullIgnored, OnlyOnceRegistered. * * @param updatedTime The value of updatedTime as greaterThan. */ @@ -3136,7 +3039,7 @@ } /** - * LessThan(>). And NullIgnored, OnceRegistered. + * LessThan(>). And NullIgnored, OnlyOnceRegistered. * * @param updatedTime The value of updatedTime as lessThan. */ @@ -3145,7 +3048,7 @@ } /** - * GreaterEqual(>). And NullIgnored, OnceRegistered. + * GreaterEqual(>). And NullIgnored, OnlyOnceRegistered. * * @param updatedTime The value of updatedTime as greaterEqual. */ @@ -3154,7 +3057,7 @@ } /** - * LessEqual(>). And NullIgnored, OnceRegistered. + * LessEqual(>). And NullIgnored, OnlyOnceRegistered. * * @param updatedTime The value of updatedTime as lessEqual. */ @@ -3164,7 +3067,7 @@ /** * FromTo($fromDate <= COLUMN_NAME <= $toDate). And NullIgnored, - * OnceRegistered. {NotNull : TIMESTAMP} + * OnlyOnceRegistered. {NotNull : TIMESTAMP} * * @param fromDate The from-date of updatedTime. (Nullable) * @param toDate The to-date of updatedTime. (Nullable) @@ -3182,7 +3085,7 @@ /** * FromTo($fromDate <= COLUMN_NAME < $toDate + 1). And NullIgnored, - * OnceRegistered. {NotNull : TIMESTAMP} + * OnlyOnceRegistered. {NotNull : TIMESTAMP} * * @param fromDate The from-date of updatedTime. (Nullable) * @param toDate The to-date of updatedTime. (Nullable) @@ -3208,7 +3111,7 @@ abstract protected ConditionValue getCValueUpdatedTime(); /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {NotNull : + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {NotNull : * VARCHAR(255)} * * @param updatedBy The value of updatedBy as equal. @@ -3218,7 +3121,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param updatedBy The value of updatedBy as notEqual. */ @@ -3227,7 +3130,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param updatedBy The value of updatedBy as greaterThan. */ @@ -3236,7 +3139,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param updatedBy The value of updatedBy as lessThan. */ @@ -3245,7 +3148,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param updatedBy The value of updatedBy as greaterEqual. */ @@ -3254,7 +3157,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param updatedBy The value of updatedBy as lessEqual. */ @@ -3263,7 +3166,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param updatedBy The value of updatedBy as prefixSearch. */ @@ -3272,20 +3175,6 @@ } /** - * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, - * SeveralRegistered. - * - * @param updatedBy The value of updatedBy as likeSearch. - * @param likeSearchOption The option of like-search. (NotNull) - */ - public void setUpdatedBy_LikeSearch( - String updatedBy, - jp.sf.pal.bookmark.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. * @@ -3296,27 +3185,41 @@ } /** - * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * - * @param updatedBy The collection of updatedBy as inScope. - * @param inScopeOption The option of in-scope. (NotNull) + * @param updatedByList The collection of updatedBy as notInScope. */ - public void setUpdatedBy_InScope( + public void setUpdatedBy_NotInScope(Collection updatedByList) { + regUpdatedBy(CK_NINS, cTL(updatedByList)); + } + + /** + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param updatedBy The value of updatedBy as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) + */ + public void setUpdatedBy_LikeSearch( String updatedBy, - jp.sf.pal.bookmark.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(updatedBy), getCValueUpdatedBy(), - "UPDATED_BY", "UpdatedBy", "updatedBy", inScopeOption); + jp.sf.pal.bookmark.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(updatedBy), getCValueUpdatedBy(), "UPDATED_BY", + "UpdatedBy", "updatedBy", likeSearchOption); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param updatedByList The collection of updatedBy as notInScope. + * @param updatedBy The value of updatedBy as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setUpdatedBy_NotInScope(Collection updatedByList) { - regUpdatedBy(CK_NINS, cTL(updatedByList)); + public void setUpdatedBy_NotLikeSearch( + String updatedBy, + jp.sf.pal.bookmark.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(updatedBy), getCValueUpdatedBy(), "UPDATED_BY", + "UpdatedBy", "updatedBy", likeSearchOption); } protected void regUpdatedBy(ConditionKey key, Object value) { @@ -3332,7 +3235,7 @@ abstract protected ConditionValue getCValueUpdatedBy(); /** - * Equal(=). And NullIgnored, OnceRegistered. {TIMESTAMP} + * Equal(=). And NullIgnored, OnlyOnceRegistered. {TIMESTAMP} * * @param deletedTime The value of deletedTime as equal. */ @@ -3341,7 +3244,7 @@ } /** - * NotEqual(!=). And NullIgnored, OnceRegistered. + * NotEqual(!=). And NullIgnored, OnlyOnceRegistered. * * @param deletedTime The value of deletedTime as notEqual. */ @@ -3350,7 +3253,7 @@ } /** - * GreaterThan(>). And NullIgnored, OnceRegistered. + * GreaterThan(>). And NullIgnored, OnlyOnceRegistered. * * @param deletedTime The value of deletedTime as greaterThan. */ @@ -3359,7 +3262,7 @@ } /** - * LessThan(>). And NullIgnored, OnceRegistered. + * LessThan(>). And NullIgnored, OnlyOnceRegistered. * * @param deletedTime The value of deletedTime as lessThan. */ @@ -3368,7 +3271,7 @@ } /** - * GreaterEqual(>). And NullIgnored, OnceRegistered. + * GreaterEqual(>). And NullIgnored, OnlyOnceRegistered. * * @param deletedTime The value of deletedTime as greaterEqual. */ @@ -3377,7 +3280,7 @@ } /** - * LessEqual(>). And NullIgnored, OnceRegistered. + * LessEqual(>). And NullIgnored, OnlyOnceRegistered. * * @param deletedTime The value of deletedTime as lessEqual. */ @@ -3387,7 +3290,7 @@ /** * FromTo($fromDate <= COLUMN_NAME <= $toDate). And NullIgnored, - * OnceRegistered. {TIMESTAMP} + * OnlyOnceRegistered. {TIMESTAMP} * * @param fromDate The from-date of deletedTime. (Nullable) * @param toDate The to-date of deletedTime. (Nullable) @@ -3405,7 +3308,7 @@ /** * FromTo($fromDate <= COLUMN_NAME < $toDate + 1). And NullIgnored, - * OnceRegistered. {TIMESTAMP} + * OnlyOnceRegistered. {TIMESTAMP} * * @param fromDate The from-date of deletedTime. (Nullable) * @param toDate The to-date of deletedTime. (Nullable) @@ -3419,14 +3322,14 @@ } /** - * IsNull(is null). And OnceRegistered. + * IsNull(is null). And OnlyOnceRegistered. */ public void setDeletedTime_IsNull() { regDeletedTime(CK_ISN, DUMMY_OBJECT); } /** - * IsNotNull(is not null). And OnceRegistered. + * IsNotNull(is not null). And OnlyOnceRegistered. */ public void setDeletedTime_IsNotNull() { regDeletedTime(CK_ISNN, DUMMY_OBJECT); @@ -3445,7 +3348,7 @@ abstract protected ConditionValue getCValueDeletedTime(); /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {VARCHAR(255)} + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {VARCHAR(255)} * * @param deletedBy The value of deletedBy as equal. */ @@ -3454,7 +3357,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param deletedBy The value of deletedBy as notEqual. */ @@ -3463,7 +3366,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param deletedBy The value of deletedBy as greaterThan. */ @@ -3472,7 +3375,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param deletedBy The value of deletedBy as lessThan. */ @@ -3481,7 +3384,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param deletedBy The value of deletedBy as greaterEqual. */ @@ -3490,7 +3393,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param deletedBy The value of deletedBy as lessEqual. */ @@ -3499,7 +3402,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param deletedBy The value of deletedBy as prefixSearch. */ @@ -3508,20 +3411,6 @@ } /** - * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, - * SeveralRegistered. - * - * @param deletedBy The value of deletedBy as likeSearch. - * @param likeSearchOption The option of like-search. (NotNull) - */ - public void setDeletedBy_LikeSearch( - String deletedBy, - jp.sf.pal.bookmark.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. * @@ -3532,38 +3421,52 @@ } /** - * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * - * @param deletedBy The collection of deletedBy as inScope. - * @param inScopeOption The option of in-scope. (NotNull) + * @param deletedByList The collection of deletedBy as notInScope. */ - public void setDeletedBy_InScope( + public void setDeletedBy_NotInScope(Collection deletedByList) { + regDeletedBy(CK_NINS, cTL(deletedByList)); + } + + /** + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param deletedBy The value of deletedBy as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) + */ + public void setDeletedBy_LikeSearch( String deletedBy, - jp.sf.pal.bookmark.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(deletedBy), getCValueDeletedBy(), - "DELETED_BY", "DeletedBy", "deletedBy", inScopeOption); + jp.sf.pal.bookmark.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(deletedBy), getCValueDeletedBy(), "DELETED_BY", + "DeletedBy", "deletedBy", likeSearchOption); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param deletedByList The collection of deletedBy as notInScope. + * @param deletedBy The value of deletedBy as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setDeletedBy_NotInScope(Collection deletedByList) { - regDeletedBy(CK_NINS, cTL(deletedByList)); + public void setDeletedBy_NotLikeSearch( + String deletedBy, + jp.sf.pal.bookmark.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(deletedBy), getCValueDeletedBy(), "DELETED_BY", + "DeletedBy", "deletedBy", likeSearchOption); } /** - * IsNull(is null). And OnceRegistered. + * IsNull(is null). And OnlyOnceRegistered. */ public void setDeletedBy_IsNull() { regDeletedBy(CK_ISN, DUMMY_OBJECT); } /** - * IsNotNull(is not null). And OnceRegistered. + * IsNotNull(is not null). And OnlyOnceRegistered. */ public void setDeletedBy_IsNotNull() { regDeletedBy(CK_ISNN, DUMMY_OBJECT); @@ -3582,7 +3485,7 @@ abstract protected ConditionValue getCValueDeletedBy(); /** - * Equal(=). And NullIgnored, OnceRegistered. {NotNull : INTEGER} + * Equal(=). And NullIgnored, OnlyOnceRegistered. {NotNull : INTEGER} * * @param versionno The value of versionno as equal. */ @@ -3591,7 +3494,7 @@ } /** - * NotEqual(!=). And NullIgnored, OnceRegistered. + * NotEqual(!=). And NullIgnored, OnlyOnceRegistered. * * @param versionno The value of versionno as notEqual. */ @@ -3600,7 +3503,7 @@ } /** - * GreaterThan(>). And NullIgnored, OnceRegistered. + * GreaterThan(>). And NullIgnored, OnlyOnceRegistered. * * @param versionno The value of versionno as greaterThan. */ @@ -3609,7 +3512,7 @@ } /** - * LessThan(<). And NullIgnored, OnceRegistered. + * LessThan(<). And NullIgnored, OnlyOnceRegistered. * * @param versionno The value of versionno as lessThan. */ @@ -3618,7 +3521,7 @@ } /** - * GreaterEqual(>=). And NullIgnored, OnceRegistered. + * GreaterEqual(>=). And NullIgnored, OnlyOnceRegistered. * * @param versionno The value of versionno as greaterEqual. */ @@ -3627,7 +3530,7 @@ } /** - * LessEqual(<=). And NullIgnored, OnceRegistered. + * LessEqual(<=). And NullIgnored, OnlyOnceRegistered. * * @param versionno The value of versionno as lessEqual. */ @@ -3667,6 +3570,50 @@ abstract protected ConditionValue getCValueVersionno(); + public SSQFunction scalar_Equal() { + return xcreateSSQFunction("="); + } + + public SSQFunction scalar_GreaterEqual() { + return xcreateSSQFunction(">="); + } + + public SSQFunction scalar_GreaterThan() { + return xcreateSSQFunction(">"); + } + + public SSQFunction scalar_LessEqual() { + return xcreateSSQFunction("<="); + } + + public SSQFunction scalar_LessThan() { + return xcreateSSQFunction("<"); + } + + protected SSQFunction xcreateSSQFunction(final String operand) { + return new SSQFunction(new SSQSetupper() { + public void setup(String function, SubQuery subQuery) { + xscalarSubQuery(function, subQuery, operand); + } + }); + } + + protected void xscalarSubQuery(String function, + SubQuery subQuery, String operand) { + assertObjectNotNull("subQuery", subQuery); + UserInfoCB cb = new UserInfoCB(); + cb.xsetupForScalarSubQuery(); + subQuery.query(cb); + String subQueryPropertyName = keepScalarSubQuery(cb.query()); // for + // saving + // query + // -value. + registerScalarSubQuery(function, cb.query(), subQueryPropertyName, + operand); + } + + public abstract String keepScalarSubQuery(UserInfoCQ subQuery); + // Very Internal (for Suppressing Warn about 'Not Use Import') protected String getConditionBeanClassNameInternally() { return UserInfoCB.class.getName(); Modified: bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/cbean/cq/bs/BsBookmarkCategoryCQ.java =================================================================== --- bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/cbean/cq/bs/BsBookmarkCategoryCQ.java 2008-12-27 22:10:35 UTC (rev 1626) +++ bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/cbean/cq/bs/BsBookmarkCategoryCQ.java 2008-12-27 22:11:51 UTC (rev 1627) @@ -5,6 +5,7 @@ import jp.sf.pal.bookmark.db.allcommon.cbean.ConditionQuery; import jp.sf.pal.bookmark.db.allcommon.cbean.cvalue.ConditionValue; import jp.sf.pal.bookmark.db.allcommon.cbean.sqlclause.SqlClause; +import jp.sf.pal.bookmark.db.cbean.BookmarkCategoryCB; import jp.sf.pal.bookmark.db.cbean.cq.BookmarkCategoryCQ; import jp.sf.pal.bookmark.db.cbean.cq.BookmarkLinkCQ; import jp.sf.pal.bookmark.db.cbean.cq.UserInfoCQ; @@ -15,7 +16,6 @@ * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public class BsBookmarkCategoryCQ extends AbstractBsBookmarkCategoryCQ { //========================================================================== @@ -61,7 +61,7 @@ public BookmarkCategoryCIQ on() { if (isBaseQuery(this)) { throw new UnsupportedOperationException( - "Unsupported onClause of Base Table!"); + "Unsupported on-clause for local table!"); } BookmarkCategoryCIQ inlineQuery = inline(); inlineQuery.xsetOnClauseInline(true); @@ -153,20 +153,21 @@ return "id_NotExistsSubQuery_BookmarkLinkList." + key; } - protected Map _id_DeriveSubQuery_BookmarkLinkListMap; + protected Map _id_DerivedReferrer_BookmarkLinkListMap; - public Map getId_DeriveSubQuery_BookmarkLinkList() { - return _id_DeriveSubQuery_BookmarkLinkListMap; + public Map getId_DerivedReferrer_BookmarkLinkList() { + return _id_DerivedReferrer_BookmarkLinkListMap; } - public String keepId_DeriveSubQuery_BookmarkLinkList(BookmarkLinkCQ subQuery) { - if (_id_DeriveSubQuery_BookmarkLinkListMap == null) { - _id_DeriveSubQuery_BookmarkLinkListMap = newLinkedHashMap(); + public String keepId_DerivedReferrer_BookmarkLinkList( + BookmarkLinkCQ subQuery) { + if (_id_DerivedReferrer_BookmarkLinkListMap == null) { + _id_DerivedReferrer_BookmarkLinkListMap = newLinkedHashMap(); } String key = "subQueryMapKey" - + (_id_DeriveSubQuery_BookmarkLinkListMap.size() + 1); - _id_DeriveSubQuery_BookmarkLinkListMap.put(key, subQuery); - return "id_DeriveSubQuery_BookmarkLinkList." + key; + + (_id_DerivedReferrer_BookmarkLinkListMap.size() + 1); + _id_DerivedReferrer_BookmarkLinkListMap.put(key, subQuery); + return "id_DerivedReferrer_BookmarkLinkList." + key; } public BsBookmarkCategoryCQ addOrderBy_Id_Asc() { @@ -504,7 +505,6 @@ // ========= // Foreign Query // ============= - public UserInfoCQ queryUserInfoByCreatedBy() { return getConditionQueryUserInfoByCreatedBy(); } @@ -513,21 +513,13 @@ public UserInfoCQ getConditionQueryUserInfoByCreatedBy() { if (_conditionQueryUserInfoByCreatedBy == null) { - _conditionQueryUserInfoByCreatedBy = createQueryUserInfoByCreatedBy(); - setupOuterJoin_UserInfoByCreatedBy(); + _conditionQueryUserInfoByCreatedBy = xcreateQueryUserInfoByCreatedBy(); + xsetupOuterJoinUserInfoByCreatedBy(); } return _conditionQueryUserInfoByCreatedBy; } - protected void setupOuterJoin_UserInfoByCreatedBy() { - Map joinOnMap = newLinkedHashMap(); - joinOnMap.put(getRealColumnName("CREATED_BY"), - getConditionQueryUserInfoByCreatedBy().getRealColumnName( - "USER_ID")); - registerOuterJoin(getConditionQueryUserInfoByCreatedBy(), joinOnMap); - } - - protected UserInfoCQ createQueryUserInfoByCreatedBy() { + protected UserInfoCQ xcreateQueryUserInfoByCreatedBy() { String nrp = resolveNextRelationPath("BOOKMARK_CATEGORY", "userInfoByCreatedBy"); String jan = resolveJoinAliasName(nrp, getNextNestLevel()); @@ -538,6 +530,14 @@ return cq; } + protected void xsetupOuterJoinUserInfoByCreatedBy() { + UserInfoCQ cq = getConditionQueryUserInfoByCreatedBy(); + Map joinOnMap = newLinkedHashMap(); + joinOnMap.put(getRealColumnName("CREATED_BY"), cq + .getRealColumnName("USER_ID")); + registerOuterJoin(cq, joinOnMap); + } + public boolean hasConditionQueryUserInfoByCreatedBy() { return _conditionQueryUserInfoByCreatedBy != null; } @@ -550,21 +550,13 @@ public UserInfoCQ getConditionQueryUserInfoByUpdatedBy() { if (_conditionQueryUserInfoByUpdatedBy == null) { - _conditionQueryUserInfoByUpdatedBy = createQueryUserInfoByUpdatedBy(); - setupOuterJoin_UserInfoByUpdatedBy(); + _conditionQueryUserInfoByUpdatedBy = xcreateQueryUserInfoByUpdatedBy(); + xsetupOuterJoinUserInfoByUpdatedBy(); } return _conditionQueryUserInfoByUpdatedBy; } - protected void setupOuterJoin_UserInfoByUpdatedBy() { - Map joinOnMap = newLinkedHashMap(); - joinOnMap.put(getRealColumnName("UPDATED_BY"), - getConditionQueryUserInfoByUpdatedBy().getRealColumnName( - "USER_ID")); - registerOuterJoin(getConditionQueryUserInfoByUpdatedBy(), joinOnMap); - } - - protected UserInfoCQ createQueryUserInfoByUpdatedBy() { + protected UserInfoCQ xcreateQueryUserInfoByUpdatedBy() { String nrp = resolveNextRelationPath("BOOKMARK_CATEGORY", "userInfoByUpdatedBy"); String jan = resolveJoinAliasName(nrp, getNextNestLevel()); @@ -575,10 +567,42 @@ return cq; } + protected void xsetupOuterJoinUserInfoByUpdatedBy() { + UserInfoCQ cq = getConditionQueryUserInfoByUpdatedBy(); + Map joinOnMap = newLinkedHashMap(); + joinOnMap.put(getRealColumnName("UPDATED_BY"), cq + .getRealColumnName("USER_ID")); + registerOuterJoin(cq, joinOnMap); + } + public boolean hasConditionQueryUserInfoByUpdatedBy() { return _conditionQueryUserInfoByUpdatedBy != null; } + //========================================================================== + // ========= + // Derived Query + // ============= + protected Map _scalarSubQueryMap; + + public Map getScalarSubQuery() { + return _scalarSubQueryMap; + } + + public String keepScalarSubQuery(BookmarkCategoryCQ subQuery) { + if (_scalarSubQueryMap == null) { + _scalarSubQueryMap = newLinkedHashMap(); + } + String key = "subQueryMapKey" + (_scalarSubQueryMap.size() + 1); + _scalarSubQueryMap.put(key, subQuery); + return "scalarSubQuery." + key; + } + + // Very Internal (for Suppressing Warn about 'Not Use Import') + protected String getConditionBeanClassNameInternally() { + return BookmarkCategoryCB.class.getName(); + } + protected String getConditionQueryClassNameInternally() { return BookmarkCategoryCQ.class.getName(); } Modified: bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/cbean/cq/bs/BsBookmarkLinkCQ.java =================================================================== --- bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/cbean/cq/bs/BsBookmarkLinkCQ.java 2008-12-27 22:10:35 UTC (rev 1626) +++ bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/cbean/cq/bs/BsBookmarkLinkCQ.java 2008-12-27 22:11:51 UTC (rev 1627) @@ -5,6 +5,7 @@ import jp.sf.pal.bookmark.db.allcommon.cbean.ConditionQuery; import jp.sf.pal.bookmark.db.allcommon.cbean.cvalue.ConditionValue; import jp.sf.pal.bookmark.db.allcommon.cbean.sqlclause.SqlClause; +import jp.sf.pal.bookmark.db.cbean.BookmarkLinkCB; import jp.sf.pal.bookmark.db.cbean.cq.BookmarkCategoryCQ; import jp.sf.pal.bookmark.db.cbean.cq.BookmarkLinkCQ; import jp.sf.pal.bookmark.db.cbean.cq.UserInfoCQ; @@ -15,7 +16,6 @@ * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public class BsBookmarkLinkCQ extends AbstractBsBookmarkLinkCQ { //========================================================================== @@ -61,7 +61,7 @@ public BookmarkLinkCIQ on() { if (isBaseQuery(this)) { throw new UnsupportedOperationException( - "Unsupported onClause of Base Table!"); + "Unsupported on-clause for local table!"); } BookmarkLinkCIQ inlineQuery = inline(); inlineQuery.xsetOnClauseInline(true); @@ -489,7 +489,6 @@ // ========= // Foreign Query // ============= - public BookmarkCategoryCQ queryBookmarkCategory() { return getConditionQueryBookmarkCategory(); } @@ -498,20 +497,13 @@ public BookmarkCategoryCQ getConditionQueryBookmarkCategory() { if (_conditionQueryBookmarkCategory == null) { - _conditionQueryBookmarkCategory = createQueryBookmarkCategory(); - setupOuterJoin_BookmarkCategory(); + _conditionQueryBookmarkCategory = xcreateQueryBookmarkCategory(); + xsetupOuterJoinBookmarkCategory(); } return _conditionQueryBookmarkCategory; } - protected void setupOuterJoin_BookmarkCategory() { - Map joinOnMap = newLinkedHashMap(); - joinOnMap.put(getRealColumnName("CATEGORY_ID"), - getConditionQueryBookmarkCategory().getRealColumnName("ID")); - registerOuterJoin(getConditionQueryBookmarkCategory(), joinOnMap); - } - - protected BookmarkCategoryCQ createQueryBookmarkCategory() { + protected BookmarkCategoryCQ xcreateQueryBookmarkCategory() { String nrp = resolveNextRelationPath("BOOKMARK_LINK", "bookmarkCategory"); String jan = resolveJoinAliasName(nrp, getNextNestLevel()); @@ -522,6 +514,14 @@ return cq; } + protected void xsetupOuterJoinBookmarkCategory() { + BookmarkCategoryCQ cq = getConditionQueryBookmarkCategory(); + Map joinOnMap = newLinkedHashMap(); + joinOnMap.put(getRealColumnName("CATEGORY_ID"), cq + .getRealColumnName("ID")); + registerOuterJoin(cq, joinOnMap); + } + public boolean hasConditionQueryBookmarkCategory() { return _conditionQueryBookmarkCategory != null; } @@ -534,21 +534,13 @@ public UserInfoCQ getConditionQueryUserInfoByCreatedBy() { if (_conditionQueryUserInfoByCreatedBy == null) { - _conditionQueryUserInfoByCreatedBy = createQueryUserInfoByCreatedBy(); - setupOuterJoin_UserInfoByCreatedBy(); + _conditionQueryUserInfoByCreatedBy = xcreateQueryUserInfoByCreatedBy(); + xsetupOuterJoinUserInfoByCreatedBy(); } return _conditionQueryUserInfoByCreatedBy; } - protected void setupOuterJoin_UserInfoByCreatedBy() { - Map joinOnMap = newLinkedHashMap(); - joinOnMap.put(getRealColumnName("CREATED_BY"), - getConditionQueryUserInfoByCreatedBy().getRealColumnName( - "USER_ID")); - registerOuterJoin(getConditionQueryUserInfoByCreatedBy(), joinOnMap); - } - - protected UserInfoCQ createQueryUserInfoByCreatedBy() { + protected UserInfoCQ xcreateQueryUserInfoByCreatedBy() { String nrp = resolveNextRelationPath("BOOKMARK_LINK", "userInfoByCreatedBy"); String jan = resolveJoinAliasName(nrp, getNextNestLevel()); @@ -559,6 +551,14 @@ return cq; } + protected void xsetupOuterJoinUserInfoByCreatedBy() { + UserInfoCQ cq = getConditionQueryUserInfoByCreatedBy(); + Map joinOnMap = newLinkedHashMap(); + joinOnMap.put(getRealColumnName("CREATED_BY"), cq + .getRealColumnName("USER_ID")); + registerOuterJoin(cq, joinOnMap); + } + public boolean hasConditionQueryUserInfoByCreatedBy() { return _conditionQueryUserInfoByCreatedBy != null; } @@ -571,21 +571,13 @@ public UserInfoCQ getConditionQueryUserInfoByUpdatedBy() { if (_conditionQueryUserInfoByUpdatedBy == null) { - _conditionQueryUserInfoByUpdatedBy = createQueryUserInfoByUpdatedBy(); - setupOuterJoin_UserInfoByUpdatedBy(); + _conditionQueryUserInfoByUpdatedBy = xcreateQueryUserInfoByUpdatedBy(); + xsetupOuterJoinUserInfoByUpdatedBy(); } return _conditionQueryUserInfoByUpdatedBy; } - protected void setupOuterJoin_UserInfoByUpdatedBy() { - Map joinOnMap = newLinkedHashMap(); - joinOnMap.put(getRealColumnName("UPDATED_BY"), - getConditionQueryUserInfoByUpdatedBy().getRealColumnName( - "USER_ID")); - registerOuterJoin(getConditionQueryUserInfoByUpdatedBy(), joinOnMap); - } - - protected UserInfoCQ createQueryUserInfoByUpdatedBy() { + protected UserInfoCQ xcreateQueryUserInfoByUpdatedBy() { String nrp = resolveNextRelationPath("BOOKMARK_LINK", "userInfoByUpdatedBy"); String jan = resolveJoinAliasName(nrp, getNextNestLevel()); @@ -596,10 +588,42 @@ return cq; } + protected void xsetupOuterJoinUserInfoByUpdatedBy() { + UserInfoCQ cq = getConditionQueryUserInfoByUpdatedBy(); + Map joinOnMap = newLinkedHashMap(); + joinOnMap.put(getRealColumnName("UPDATED_BY"), cq + .getRealColumnName("USER_ID")); + registerOuterJoin(cq, joinOnMap); + } + public boolean hasConditionQueryUserInfoByUpdatedBy() { return _conditionQueryUserInfoByUpdatedBy != null; } + //========================================================================== + // ========= + // Derived Query + // ============= + protected Map _scalarSubQueryMap; + + public Map getScalarSubQuery() { + return _scalarSubQueryMap; + } + + public String keepScalarSubQuery(BookmarkLinkCQ subQuery) { + if (_scalarSubQueryMap == null) { + _scalarSubQueryMap = newLinkedHashMap(); + } + String key = "subQueryMapKey" + (_scalarSubQueryMap.size() + 1); + _scalarSubQueryMap.put(key, subQuery); + return "scalarSubQuery." + key; + } + + // Very Internal (for Suppressing Warn about 'Not Use Import') + protected String getConditionBeanClassNameInternally() { + return BookmarkLinkCB.class.getName(); + } + protected String getConditionQueryClassNameInternally() { return BookmarkLinkCQ.class.getName(); } Modified: bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/cbean/cq/bs/BsGroupInfoCQ.java =================================================================== --- bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/cbean/cq/bs/BsGroupInfoCQ.java 2008-12-27 22:10:35 UTC (rev 1626) +++ bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/cbean/cq/bs/BsGroupInfoCQ.java 2008-12-27 22:11:51 UTC (rev 1627) @@ -5,6 +5,7 @@ import jp.sf.pal.bookmark.db.allcommon.cbean.ConditionQuery; import jp.sf.pal.bookmark.db.allcommon.cbean.cvalue.ConditionValue; import jp.sf.pal.bookmark.db.allcommon.cbean.sqlclause.SqlClause; +import jp.sf.pal.bookmark.db.cbean.GroupInfoCB; import jp.sf.pal.bookmark.db.cbean.cq.GroupInfoCQ; import jp.sf.pal.bookmark.db.cbean.cq.GroupMappingCQ; import jp.sf.pal.bookmark.db.cbean.cq.UserInfoCQ; @@ -15,7 +16,6 @@ * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public class BsGroupInfoCQ extends AbstractBsGroupInfoCQ { //========================================================================== @@ -61,7 +61,7 @@ public GroupInfoCIQ on() { if (isBaseQuery(this)) { throw new UnsupportedOperationException( - "Unsupported onClause of Base Table!"); + "Unsupported on-clause for local table!"); } GroupInfoCIQ inlineQuery = inline(); inlineQuery.xsetOnClauseInline(true); @@ -219,37 +219,37 @@ return "groupId_NotExistsSubQuery_UserInfoList." + key; } - protected Map _groupId_DeriveSubQuery_GroupMappingListMap; + protected Map _groupId_DerivedReferrer_GroupMappingListMap; - public Map getGroupId_DeriveSubQuery_GroupMappingList() { - return _groupId_DeriveSubQuery_GroupMappingListMap; + public Map getGroupId_DerivedReferrer_GroupMappingList() { + return _groupId_DerivedReferrer_GroupMappingListMap; } - public String keepGroupId_DeriveSubQuery_GroupMappingList( + public String keepGroupId_DerivedReferrer_GroupMappingList( GroupMappingCQ subQuery) { - if (_groupId_DeriveSubQuery_GroupMappingListMap == null) { - _groupId_DeriveSubQuery_GroupMappingListMap = newLinkedHashMap(); + if (_groupId_DerivedReferrer_GroupMappingListMap == null) { + _groupId_DerivedReferrer_GroupMappingListMap = newLinkedHashMap(); } String key = "subQueryMapKey" - + (_groupId_DeriveSubQuery_GroupMappingListMap.size() + 1); - _groupId_DeriveSubQuery_GroupMappingListMap.put(key, subQuery); - return "groupId_DeriveSubQuery_GroupMappingList." + key; + + (_groupId_DerivedReferrer_GroupMappingListMap.size() + 1); + _groupId_DerivedReferrer_GroupMappingListMap.put(key, subQuery); + return "groupId_DerivedReferrer_GroupMappingList." + key; } - protected Map _groupId_DeriveSubQuery_UserInfoListMap; + protected Map _groupId_DerivedReferrer_UserInfoListMap; - public Map getGroupId_DeriveSubQuery_UserInfoList() { - return _groupId_DeriveSubQuery_UserInfoListMap; + public Map getGroupId_DerivedReferrer_UserInfoList() { + return _groupId_DerivedReferrer_UserInfoListMap; } - public String keepGroupId_DeriveSubQuery_UserInfoList(UserInfoCQ subQuery) { - if (_groupId_DeriveSubQuery_UserInfoListMap == null) { - _groupId_DeriveSubQuery_UserInfoListMap = newLinkedHashMap(); + public String keepGroupId_DerivedReferrer_UserInfoList(UserInfoCQ subQuery) { + if (_groupId_DerivedReferrer_UserInfoListMap == null) { + _groupId_DerivedReferrer_UserInfoListMap = newLinkedHashMap(); } String key = "subQueryMapKey" - + (_groupId_DeriveSubQuery_UserInfoListMap.size() + 1); - _groupId_DeriveSubQuery_UserInfoListMap.put(key, subQuery); - return "groupId_DeriveSubQuery_UserInfoList." + key; + + (_groupId_DerivedReferrer_UserInfoListMap.size() + 1); + _groupId_DerivedReferrer_UserInfoListMap.put(key, subQuery); + return "groupId_DerivedReferrer_UserInfoList." + key; } public BsGroupInfoCQ addOrderBy_GroupId_Asc() { @@ -564,7 +564,30 @@ // ========= // Foreign Query // ============= + //========================================================================== + // ========= + // Derived Query + // ============= + protected Map _scalarSubQueryMap; + public Map getScalarSubQuery() { + return _scalarSubQueryMap; + } + + public String keepScalarSubQuery(GroupInfoCQ subQuery) { + if (_scalarSubQueryMap == null) { + _scalarSubQueryMap = newLinkedHashMap(); + } + String key = "subQueryMapKey" + (_scalarSubQueryMap.size() + 1); + _scalarSubQueryMap.put(key, subQuery); + return "scalarSubQuery." + key; + } + + // Very Internal (for Suppressing Warn about 'Not Use Import') + protected String getConditionBeanClassNameInternally() { + return GroupInfoCB.class.getName(); + } + protected String getConditionQueryClassNameInternally() { return GroupInfoCQ.class.getName(); } Modified: bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/cbean/cq/bs/BsGroupMappingCQ.java =================================================================== --- bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/cbean/cq/bs/BsGroupMappingCQ.java 2008-12-27 22:10:35 UTC (rev 1626) +++ bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/cbean/cq/bs/BsGroupMappingCQ.java 2008-12-27 22:11:51 UTC (rev 1627) @@ -5,6 +5,7 @@ import jp.sf.pal.bookmark.db.allcommon.cbean.ConditionQuery; import jp.sf.pal.bookmark.db.allcommon.cbean.cvalue.ConditionValue; import jp.sf.pal.bookmark.db.allcommon.cbean.sqlclause.SqlClause; +import jp.sf.pal.bookmark.db.cbean.GroupMappingCB; import jp.sf.pal.bookmark.db.cbean.cq.GroupInfoCQ; import jp.sf.pal.bookmark.db.cbean.cq.GroupMappingCQ; import jp.sf.pal.bookmark.db.cbean.cq.UserInfoCQ; @@ -15,7 +16,6 @@ * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public class BsGroupMappingCQ extends AbstractBsGroupMappingCQ { //========================================================================== @@ -61,7 +61,7 @@ public GroupMappingCIQ on() { if (isBaseQuery(this)) { throw new UnsupportedOperationException( - "Unsupported onClause of Base Table!"); + "Unsupported on-clause for local table!"); } GroupMappingCIQ inlineQuery = inline(); inlineQuery.xsetOnClauseInline(true); @@ -210,7 +210,6 @@ // ========= // Foreign Query // ============= - public GroupInfoCQ queryGroupInfo() { return getConditionQueryGroupInfo(); } @@ -219,20 +218,13 @@ public GroupInfoCQ getConditionQueryGroupInfo() { if (_conditionQueryGroupInfo == null) { - _conditionQueryGroupInfo = createQueryGroupInfo(); - setupOuterJoin_GroupInfo(); + _conditionQueryGroupInfo = xcreateQueryGroupInfo(); + xsetupOuterJoinGroupInfo(); } return _conditionQueryGroupInfo; } - protected void setupOuterJoin_GroupInfo() { - Map joinOnMap = newLinkedHashMap(); - joinOnMap.put(getRealColumnName("GROUP_ID"), - getConditionQueryGroupInfo().getRealColumnName("GROUP_ID")); - registerOuterJoin(getConditionQueryGroupInfo(), joinOnMap); - } - - protected GroupInfoCQ createQueryGroupInfo() { + protected GroupInfoCQ xcreateQueryGroupInfo() { String nrp = resolveNextRelationPath("GROUP_MAPPING", "groupInfo"); String jan = resolveJoinAliasName(nrp, getNextNestLevel()); GroupInfoCQ cq = new GroupInfoCQ(this, getSqlClause(), jan, @@ -242,6 +234,14 @@ return cq; } + protected void xsetupOuterJoinGroupInfo() { + GroupInfoCQ cq = getConditionQueryGroupInfo(); + Map joinOnMap = newLinkedHashMap(); + joinOnMap.put(getRealColumnName("GROUP_ID"), cq + .getRealColumnName("GROUP_ID")); + registerOuterJoin(cq, joinOnMap); + } + public boolean hasConditionQueryGroupInfo() { return _conditionQueryGroupInfo != null; } @@ -254,20 +254,13 @@ public UserInfoCQ getConditionQueryUserInfo() { if (_conditionQueryUserInfo == null) { - _conditionQueryUserInfo = createQueryUserInfo(); - setupOuterJoin_UserInfo(); + _conditionQueryUserInfo = xcreateQueryUserInfo(); + xsetupOuterJoinUserInfo(); } return _conditionQueryUserInfo; } - protected void setupOuterJoin_UserInfo() { - Map joinOnMap = newLinkedHashMap(); - joinOnMap.put(getRealColumnName("USER_ID"), getConditionQueryUserInfo() - .getRealColumnName("USER_ID")); - registerOuterJoin(getConditionQueryUserInfo(), joinOnMap); - } - - protected UserInfoCQ createQueryUserInfo() { + protected UserInfoCQ xcreateQueryUserInfo() { String nrp = resolveNextRelationPath("GROUP_MAPPING", "userInfo"); String jan = resolveJoinAliasName(nrp, getNextNestLevel()); UserInfoCQ cq = new UserInfoCQ(this, getSqlClause(), jan, @@ -277,10 +270,42 @@ return cq; } + protected void xsetupOuterJoinUserInfo() { + UserInfoCQ cq = getConditionQueryUserInfo(); + Map joinOnMap = newLinkedHashMap(); + joinOnMap.put(getRealColumnName("USER_ID"), cq + .getRealColumnName("USER_ID")); + registerOuterJoin(cq, joinOnMap); + } + public boolean hasConditionQueryUserInfo() { return _conditionQueryUserInfo != null; } + //========================================================================== + // ========= + // Derived Query + // ============= + protected Map _scalarSubQueryMap; + + public Map getScalarSubQuery() { + return _scalarSubQueryMap; + } + + public String keepScalarSubQuery(GroupMappingCQ subQuery) { + if (_scalarSubQueryMap == null) { + _scalarSubQueryMap = newLinkedHashMap(); + } + String key = "subQueryMapKey" + (_scalarSubQueryMap.size() + 1); + _scalarSubQueryMap.put(key, subQuery); + return "scalarSubQuery." + key; + } + + // Very Internal (for Suppressing Warn about 'Not Use Import') + protected String getConditionBeanClassNameInternally() { + return GroupMappingCB.class.getName(); + } + protected String getConditionQueryClassNameInternally() { return GroupMappingCQ.class.getName(); } Modified: bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/cbean/cq/bs/BsRoleInfoCQ.java =================================================================== --- bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/cbean/cq/bs/BsRoleInfoCQ.java 2008-12-27 22:10:35 UTC (rev 1626) +++ bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/cbean/cq/bs/BsRoleInfoCQ.java 2008-12-27 22:11:51 UTC (rev 1627) @@ -5,6 +5,7 @@ import jp.sf.pal.bookmark.db.allcommon.cbean.ConditionQuery; import jp.sf.pal.bookmark.db.allcommon.cbean.cvalue.ConditionValue; import jp.sf.pal.bookmark.db.allcommon.cbean.sqlclause.SqlClause; +import jp.sf.pal.bookmark.db.cbean.RoleInfoCB; import jp.sf.pal.bookmark.db.cbean.cq.RoleInfoCQ; import jp.sf.pal.bookmark.db.cbean.cq.RoleMappingCQ; import jp.sf.pal.bookmark.db.cbean.cq.UserInfoCQ; @@ -15,7 +16,6 @@ * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public class BsRoleInfoCQ extends AbstractBsRoleInfoCQ { //========================================================================== @@ -61,7 +61,7 @@ public RoleInfoCIQ on() { if (isBaseQuery(this)) { throw new UnsupportedOperationException( - "Unsupported onClause of Base Table!"); + "Unsupported on-clause for local table!"); } RoleInfoCIQ inlineQuery = inline(); inlineQuery.xsetOnClauseInline(true); @@ -218,37 +218,37 @@ return "roleId_NotExistsSubQuery_UserInfoList." + key; } - protected Map _roleId_DeriveSubQuery_RoleMappingListMap; + protected Map _roleId_DerivedReferrer_RoleMappingListMap; - public Map getRoleId_DeriveSubQuery_RoleMappingList() { - return _roleId_DeriveSubQuery_RoleMappingListMap; + public Map getRoleId_DerivedReferrer_RoleMappingList() { + return _roleId_DerivedReferrer_RoleMappingListMap; } - public String keepRoleId_DeriveSubQuery_RoleMappingList( + public String keepRoleId_DerivedReferrer_RoleMappingList( RoleMappingCQ subQuery) { - if (_roleId_DeriveSubQuery_RoleMappingListMap == null) { - _roleId_DeriveSubQuery_RoleMappingListMap = newLinkedHashMap(); + if (_roleId_DerivedReferrer_RoleMappingListMap == null) { + _roleId_DerivedReferrer_RoleMappingListMap = newLinkedHashMap(); } String key = "subQueryMapKey" - + (_roleId_DeriveSubQuery_RoleMappingListMap.size() + 1); - _roleId_DeriveSubQuery_RoleMappingListMap.put(key, subQuery); - return "roleId_DeriveSubQuery_RoleMappingList." + key; + + (_roleId_DerivedReferrer_RoleMappingListMap.size() + 1); + _roleId_DerivedReferrer_RoleMappingListMap.put(key, subQuery); + return "roleId_DerivedReferrer_RoleMappingList." + key; } - protected Map _roleId_DeriveSubQuery_UserInfoListMap; + protected Map _roleId_DerivedReferrer_UserInfoListMap; - public Map getRoleId_DeriveSubQuery_UserInfoList() { - return _roleId_DeriveSubQuery_UserInfoListMap; + public Map getRoleId_DerivedReferrer_UserInfoList() { + return _roleId_DerivedReferrer_UserInfoListMap; } - public String keepRoleId_DeriveSubQuery_UserInfoList(UserInfoCQ subQuery) { - if (_roleId_DeriveSubQuery_UserInfoListMap == null) { - _roleId_DeriveSubQuery_UserInfoListMap = newLinkedHashMap(); + public String keepRoleId_DerivedReferrer_UserInfoList(UserInfoCQ subQuery) { + if (_roleId_DerivedReferrer_UserInfoListMap == null) { + _roleId_DerivedReferrer_UserInfoListMap = newLinkedHashMap(); } String key = "subQueryMapKey" - + (_roleId_DeriveSubQuery_UserInfoListMap.size() + 1); - _roleId_DeriveSubQuery_UserInfoListMap.put(key, subQuery); - return "roleId_DeriveSubQuery_UserInfoList." + key; + + (_roleId_DerivedReferrer_UserInfoListMap.size() + 1); + _roleId_DerivedReferrer_UserInfoListMap.put(key, subQuery); + return "roleId_DerivedReferrer_UserInfoList." + key; } public BsRoleInfoCQ addOrderBy_RoleId_Asc() { @@ -563,7 +563,30 @@ // ========= // Foreign Query // ============= + //========================================================================== + // ========= + // Derived Query + // ============= + protected Map _scalarSubQueryMap; + public Map getScalarSubQuery() { + return _scalarSubQueryMap; + } + + public String keepScalarSubQuery(RoleInfoCQ subQuery) { + if (_scalarSubQueryMap == null) { + _scalarSubQueryMap = newLinkedHashMap(); + } + String key = "subQueryMapKey" + (_scalarSubQueryMap.size() + 1); + _scalarSubQueryMap.put(key, subQuery); + return "scalarSubQuery." + key; + } + + // Very Internal (for Suppressing Warn about 'Not Use Import') + protected String getConditionBeanClassNameInternally() { + return RoleInfoCB.class.getName(); + } + protected String getConditionQueryClassNameInternally() { return RoleInfoCQ.class.getName(); } Modified: bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/cbean/cq/bs/BsRoleMappingCQ.java =================================================================== --- bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/cbean/cq/bs/BsRoleMappingCQ.java 2008-12-27 22:10:35 UTC (rev 1626) +++ bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/cbean/cq/bs/BsRoleMappingCQ.java 2008-12-27 22:11:51 UTC (rev 1627) @@ -5,6 +5,7 @@ import jp.sf.pal.bookmark.db.allcommon.cbean.ConditionQuery; import jp.sf.pal.bookmark.db.allcommon.cbean.cvalue.ConditionValue; import jp.sf.pal.bookmark.db.allcommon.cbean.sqlclause.SqlClause; +import jp.sf.pal.bookmark.db.cbean.RoleMappingCB; import jp.sf.pal.bookmark.db.cbean.cq.RoleInfoCQ; import jp.sf.pal.bookmark.db.cbean.cq.RoleMappingCQ; import jp.sf.pal.bookmark.db.cbean.cq.UserInfoCQ; @@ -15,7 +16,6 @@ * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public class BsRoleMappingCQ extends AbstractBsRoleMappingCQ { //========================================================================== @@ -61,7 +61,7 @@ public RoleMappingCIQ on() { if (isBaseQuery(this)) { throw new UnsupportedOperationException( - "Unsupported onClause of Base Table!"); + "Unsupported on-clause for local table!"); } RoleMappingCIQ inlineQuery = inline(); inlineQuery.xsetOnClauseInline(true); @@ -210,7 +210,6 @@ // ========= // Foreign Query // ============= - public RoleInfoCQ queryRoleInfo() { return getConditionQueryRoleInfo(); } @@ -219,20 +218,13 @@ public RoleInfoCQ getConditionQueryRoleInfo() { if (_conditionQueryRoleInfo == null) { - _conditionQueryRoleInfo = createQueryRoleInfo(); - setupOuterJoin_RoleInfo(); + _conditionQueryRoleInfo = xcreateQueryRoleInfo(); + xsetupOuterJoinRoleInfo(); } return _conditionQueryRoleInfo; } - protected void setupOuterJoin_RoleInfo() { - Map joinOnMap = newLinkedHashMap(); - joinOnMap.put(getRealColumnName("ROLE_ID"), getConditionQueryRoleInfo() - .getRealColumnName("ROLE_ID")); - registerOuterJoin(getConditionQueryRoleInfo(), joinOnMap); - } - - protected RoleInfoCQ createQueryRoleInfo() { + protected RoleInfoCQ xcreateQueryRoleInfo() { String nrp = resolveNextRelationPath("ROLE_MAPPING", "roleInfo"); String jan = resolveJoinAliasName(nrp, getNextNestLevel()); RoleInfoCQ cq = new RoleInfoCQ(this, getSqlClause(), jan, @@ -242,6 +234,14 @@ return cq; } + protected void xsetupOuterJoinRoleInfo() { + RoleInfoCQ cq = getConditionQueryRoleInfo(); + Map joinOnMap = newLinkedHashMap(); + joinOnMap.put(getRealColumnName("ROLE_ID"), cq + .getRealColumnName("ROLE_ID")); + registerOuterJoin(cq, joinOnMap); + } + public boolean hasConditionQueryRoleInfo() { return _conditionQueryRoleInfo != null; } @@ -254,20 +254,13 @@ public UserInfoCQ getConditionQueryUserInfo() { if (_conditionQueryUserInfo == null) { - _conditionQueryUserInfo = createQueryUserInfo(); - setupOuterJoin_UserInfo(); + _conditionQueryUserInfo = xcreateQueryUserInfo(); + xsetupOuterJoinUserInfo(); } return _conditionQueryUserInfo; } - protected void setupOuterJoin_UserInfo() { - Map joinOnMap = newLinkedHashMap(); - joinOnMap.put(getRealColumnName("USER_ID"), getConditionQueryUserInfo() - .getRealColumnName("USER_ID")); - registerOuterJoin(getConditionQueryUserInfo(), joinOnMap); - } - - protected UserInfoCQ createQueryUserInfo() { + protected UserInfoCQ xcreateQueryUserInfo() { String nrp = resolveNextRelationPath("ROLE_MAPPING", "userInfo"); String jan = resolveJoinAliasName(nrp, getNextNestLevel()); UserInfoCQ cq = new UserInfoCQ(this, getSqlClause(), jan, @@ -277,10 +270,42 @@ return cq; } + protected void xsetupOuterJoinUserInfo() { + UserInfoCQ cq = getConditionQueryUserInfo(); + Map joinOnMap = newLinkedHashMap(); + joinOnMap.put(getRealColumnName("USER_ID"), cq + .getRealColumnName("USER_ID")); + registerOuterJoin(cq, joinOnMap); + } + public boolean hasConditionQueryUserInfo() { return _conditionQueryUserInfo != null; } + //========================================================================== + // ========= + // Derived Query + // ============= + protected Map _scalarSubQueryMap; + + public Map getScalarSubQuery() { + return _scalarSubQueryMap; + } + + public String keepScalarSubQuery(RoleMappingCQ subQuery) { + if (_scalarSubQueryMap == null) { + _scalarSubQueryMap = newLinkedHashMap(); + } + String key = "subQueryMapKey" + (_scalarSubQueryMap.size() + 1); + _scalarSubQueryMap.put(key, subQuery); + return "scalarSubQuery." + key; + } + + // Very Internal (for Suppressing Warn about 'Not Use Import') + protected String getConditionBeanClassNameInternally() { + return RoleMappingCB.class.getName(); + } + protected String getConditionQueryClassNameInternally() { return RoleMappingCQ.class.getName(); } Modified: bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/cbean/cq/bs/BsUserInfoCQ.java =================================================================== --- bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/cbean/cq/bs/BsUserInfoCQ.java 2008-12-27 22:10:35 UTC (rev 1626) +++ bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/cbean/cq/bs/BsUserInfoCQ.java 2008-12-27 22:11:51 UTC (rev 1627) @@ -5,6 +5,7 @@ import jp.sf.pal.bookmark.db.allcommon.cbean.ConditionQuery; import jp.sf.pal.bookmark.db.allcommon.cbean.cvalue.ConditionValue; import jp.sf.pal.bookmark.db.allcommon.cbean.sqlclause.SqlClause; +import jp.sf.pal.bookmark.db.cbean.UserInfoCB; import jp.sf.pal.bookmark.db.cbean.cq.BookmarkCategoryCQ; import jp.sf.pal.bookmark.db.cbean.cq.BookmarkLinkCQ; import jp.sf.pal.bookmark.db.cbean.cq.GroupInfoCQ; @@ -19,7 +20,6 @@ * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public class BsUserInfoCQ extends AbstractBsUserInfoCQ { //========================================================================== @@ -65,7 +65,7 @@ public UserInfoCIQ on() { if (isBaseQuery(this)) { throw new UnsupportedOperationException( - "Unsupported onClause of Base Table!"); + "Unsupported on-clause for local table!"); } UserInfoCIQ inlineQuery = inline(); inlineQuery.xsetOnClauseInline(true); @@ -532,112 +532,114 @@ return "userId_NotExistsSubQuery_RoleMappingList." + key; } - protected Map _userId_DeriveSubQuery_BookmarkCategoryByCreatedByListMap; + protected Map _userId_DerivedReferrer_BookmarkCategoryByCreatedByListMap; - public Map getUserId_DeriveSubQuery_BookmarkCategoryByCreatedByList() { - return _userId_DeriveSubQuery_BookmarkCategoryByCreatedByListMap; + public Map getUserId_DerivedReferrer_BookmarkCategoryByCreatedByList() { + return _userId_DerivedReferrer_BookmarkCategoryByCreatedByListMap; } - public String keepUserId_DeriveSubQuery_BookmarkCategoryByCreatedByList( + public String keepUserId_DerivedReferrer_BookmarkCategoryByCreatedByList( BookmarkCategoryCQ subQuery) { - if (_userId_DeriveSubQuery_BookmarkCategoryByCreatedByListMap == null) { - _userId_DeriveSubQuery_BookmarkCategoryByCreatedByListMap = newLinkedHashMap(); + if (_userId_DerivedReferrer_BookmarkCategoryByCreatedByListMap == null) { + _userId_DerivedReferrer_BookmarkCategoryByCreatedByListMap = newLinkedHashMap(); } String key = "subQueryMapKey" - + (_userId_DeriveSubQuery_BookmarkCategoryByCreatedByListMap + + (_userId_DerivedReferrer_BookmarkCategoryByCreatedByListMap .size() + 1); - _userId_DeriveSubQuery_BookmarkCategoryByCreatedByListMap.put(key, + _userId_DerivedReferrer_BookmarkCategoryByCreatedByListMap.put(key, subQuery); - return "userId_DeriveSubQuery_BookmarkCategoryByCreatedByList." + key; + return "userId_DerivedReferrer_BookmarkCategoryByCreatedByList." + key; } - protected Map _userId_DeriveSubQuery_BookmarkCategoryByUpdatedByListMap; + protected Map _userId_DerivedReferrer_BookmarkCategoryByUpdatedByListMap; - public Map getUserId_DeriveSubQuery_BookmarkCategoryByUpdatedByList() { - return _userId_DeriveSubQuery_BookmarkCategoryByUpdatedByListMap; + public Map getUserId_DerivedReferrer_BookmarkCategoryByUpdatedByList() { + return _userId_DerivedReferrer_BookmarkCategoryByUpdatedByListMap; } - public String keepUserId_DeriveSubQuery_BookmarkCategoryByUpdatedByList( + public String keepUserId_DerivedReferrer_BookmarkCategoryByUpdatedByList( BookmarkCategoryCQ subQuery) { - if (_userId_DeriveSubQuery_BookmarkCategoryByUpdatedByListMap == null) { - _userId_DeriveSubQuery_BookmarkCategoryByUpdatedByListMap = newLinkedHashMap(); + if (_userId_DerivedReferrer_BookmarkCategoryByUpdatedByListMap == null) { + _userId_DerivedReferrer_BookmarkCategoryByUpdatedByListMap = newLinkedHashMap(); } String key = "subQueryMapKey" - + (_userId_DeriveSubQuery_BookmarkCategoryByUpdatedByListMap + + (_userId_DerivedReferrer_BookmarkCategoryByUpdatedByListMap .size() + 1); - _userId_DeriveSubQuery_BookmarkCategoryByUpdatedByListMap.put(key, + _userId_DerivedReferrer_BookmarkCategoryByUpdatedByListMap.put(key, subQuery); - return "userId_DeriveSubQuery_BookmarkCategoryByUpdatedByList." + key; + return "userId_DerivedReferrer_BookmarkCategoryByUpdatedByList." + key; } - protected Map _userId_DeriveSubQuery_BookmarkLinkByCreatedByListMap; + protected Map _userId_DerivedReferrer_BookmarkLinkByCreatedByListMap; - public Map getUserId_DeriveSubQuery_BookmarkLinkByCreatedByList() { - return _userId_DeriveSubQuery_BookmarkLinkByCreatedByListMap; + public Map getUserId_DerivedReferrer_BookmarkLinkByCreatedByList() { + return _userId_DerivedReferrer_BookmarkLinkByCreatedByListMap; } - public String keepUserId_DeriveSubQuery_BookmarkLinkByCreatedByList( + public String keepUserId_DerivedReferrer_BookmarkLinkByCreatedByList( BookmarkLinkCQ subQuery) { - if (_userId_DeriveSubQuery_BookmarkLinkByCreatedByListMap == null) { - _userId_DeriveSubQuery_BookmarkLinkByCreatedByListMap = newLinkedHashMap(); + if (_userId_DerivedReferrer_BookmarkLinkByCreatedByListMap == null) { + _userId_DerivedReferrer_BookmarkLinkByCreatedByListMap = newLinkedHashMap(); } String key = "subQueryMapKey" - + (_userId_DeriveSubQuery_BookmarkLinkByCreatedByListMap.size() + 1); - _userId_DeriveSubQuery_BookmarkLinkByCreatedByListMap - .put(key, subQuery); - return "userId_DeriveSubQuery_BookmarkLinkByCreatedByList." + key; + + (_userId_DerivedReferrer_BookmarkLinkByCreatedByListMap + .size() + 1); + _userId_DerivedReferrer_BookmarkLinkByCreatedByListMap.put(key, + subQuery); + return "userId_DerivedReferrer_BookmarkLinkByCreatedByList." + key; } - protected Map _userId_DeriveSubQuery_BookmarkLinkByUpdatedByListMap; + protected Map _userId_DerivedReferrer_BookmarkLinkByUpdatedByListMap; - public Map getUserId_DeriveSubQuery_BookmarkLinkByUpdatedByList() { - return _userId_DeriveSubQuery_BookmarkLinkByUpdatedByListMap; + public Map getUserId_DerivedReferrer_BookmarkLinkByUpdatedByList() { + return _userId_DerivedReferrer_BookmarkLinkByUpdatedByListMap; } - public String keepUserId_DeriveSubQuery_BookmarkLinkByUpdatedByList( + public String keepUserId_DerivedReferrer_BookmarkLinkByUpdatedByList( BookmarkLinkCQ subQuery) { - if (_userId_DeriveSubQuery_BookmarkLinkByUpdatedByListMap == null) { - _userId_DeriveSubQuery_BookmarkLinkByUpdatedByListMap = newLinkedHashMap(); + if (_userId_DerivedReferrer_BookmarkLinkByUpdatedByListMap == null) { + _userId_DerivedReferrer_BookmarkLinkByUpdatedByListMap = newLinkedHashMap(); } String key = "subQueryMapKey" - + (_userId_DeriveSubQuery_BookmarkLinkByUpdatedByListMap.size() + 1); - _userId_DeriveSubQuery_BookmarkLinkByUpdatedByListMap - .put(key, subQuery); - return "userId_DeriveSubQuery_BookmarkLinkByUpdatedByList." + key; + + (_userId_DerivedReferrer_BookmarkLinkByUpdatedByListMap + .size() + 1); + _userId_DerivedReferrer_BookmarkLinkByUpdatedByListMap.put(key, + subQuery); + return "userId_DerivedReferrer_BookmarkLinkByUpdatedByList." + key; } - protected Map _userId_DeriveSubQuery_GroupMappingListMap; + protected Map _userId_DerivedReferrer_GroupMappingListMap; - public Map getUserId_DeriveSubQuery_GroupMappingList() { - return _userId_DeriveSubQuery_GroupMappingListMap; + public Map getUserId_DerivedReferrer_GroupMappingList() { + return _userId_DerivedReferrer_GroupMappingListMap; } - public String keepUserId_DeriveSubQuery_GroupMappingList( + public String keepUserId_DerivedReferrer_GroupMappingList( GroupMappingCQ subQuery) { - if (_userId_DeriveSubQuery_GroupMappingListMap == null) { - _userId_DeriveSubQuery_GroupMappingListMap = newLinkedHashMap(); + if (_userId_DerivedReferrer_GroupMappingListMap == null) { + _userId_DerivedReferrer_GroupMappingListMap = newLinkedHashMap(); } String key = "subQueryMapKey" - + (_userId_DeriveSubQuery_GroupMappingListMap.size() + 1); - _userId_DeriveSubQuery_GroupMappingListMap.put(key, subQuery); - return "userId_DeriveSubQuery_GroupMappingList." + key; + + (_userId_DerivedReferrer_GroupMappingListMap.size() + 1); + _userId_DerivedReferrer_GroupMappingListMap.put(key, subQuery); + return "userId_DerivedReferrer_GroupMappingList." + key; } - protected Map _userId_DeriveSubQuery_RoleMappingListMap; + protected Map _userId_DerivedReferrer_RoleMappingListMap; - public Map getUserId_DeriveSubQuery_RoleMappingList() { - return _userId_DeriveSubQuery_RoleMappingListMap; + public Map getUserId_DerivedReferrer_RoleMappingList() { + return _userId_DerivedReferrer_RoleMappingListMap; } - public String keepUserId_DeriveSubQuery_RoleMappingList( + public String keepUserId_DerivedReferrer_RoleMappingList( RoleMappingCQ subQuery) { - if (_userId_DeriveSubQuery_RoleMappingListMap == null) { - _userId_DeriveSubQuery_RoleMappingListMap = newLinkedHashMap(); + if (_userId_DerivedReferrer_RoleMappingListMap == null) { + _userId_DerivedReferrer_RoleMappingListMap = newLinkedHashMap(); } String key = "subQueryMapKey" - + (_userId_DeriveSubQuery_RoleMappingListMap.size() + 1); - _userId_DeriveSubQuery_RoleMappingListMap.put(key, subQuery); - return "userId_DeriveSubQuery_RoleMappingList." + key; + + (_userId_DerivedReferrer_RoleMappingListMap.size() + 1); + _userId_DerivedReferrer_RoleMappingListMap.put(key, subQuery); + return "userId_DerivedReferrer_RoleMappingList." + key; } public BsUserInfoCQ addOrderBy_UserId_Asc() { @@ -1004,6 +1006,29 @@ return this; } + protected ConditionValue _status; + + public ConditionValue getStatus() { + if (_status == null) { + _status = new ConditionValue(); + } + return _status; + } + + protected ConditionValue getCValueStatus() { + return getStatus(); + } + + public BsUserInfoCQ addOrderBy_Status_Asc() { + regOBA("STATUS"); + return this; + } + + public BsUserInfoCQ addOrderBy_Status_Desc() { + regOBD("STATUS"); + return this; + } + protected ConditionValue _createdTime; public ConditionValue getCreatedTime() { @@ -1201,7 +1226,6 @@ // ========= // Foreign Query // ============= - public GroupInfoCQ queryGroupInfo() { return getConditionQueryGroupInfo(); } @@ -1210,20 +1234,13 @@ public GroupInfoCQ getConditionQueryGroupInfo() { if (_conditionQueryGroupInfo == null) { - _conditionQueryGroupInfo = createQueryGroupInfo(); - setupOuterJoin_GroupInfo(); + _conditionQueryGroupInfo = xcreateQueryGroupInfo(); + xsetupOuterJoinGroupInfo(); } return _conditionQueryGroupInfo; } - protected void setupOuterJoin_GroupInfo() { - Map joinOnMap = newLinkedHashMap(); - joinOnMap.put(getRealColumnName("GROUP_ID"), - getConditionQueryGroupInfo().getRealColumnName("GROUP_ID")); - registerOuterJoin(getConditionQueryGroupInfo(), joinOnMap); - } - - protected GroupInfoCQ createQueryGroupInfo() { + protected GroupInfoCQ xcreateQueryGroupInfo() { String nrp = resolveNextRelationPath("USER_INFO", "groupInfo"); String jan = resolveJoinAliasName(nrp, getNextNestLevel()); GroupInfoCQ cq = new GroupInfoCQ(this, getSqlClause(), jan, @@ -1233,6 +1250,14 @@ return cq; } + protected void xsetupOuterJoinGroupInfo() { + GroupInfoCQ cq = getConditionQueryGroupInfo(); + Map joinOnMap = newLinkedHashMap(); + joinOnMap.put(getRealColumnName("GROUP_ID"), cq + .getRealColumnName("GROUP_ID")); + registerOuterJoin(cq, joinOnMap); + } + public boolean hasConditionQueryGroupInfo() { return _conditionQueryGroupInfo != null; } @@ -1245,20 +1270,13 @@ public RoleInfoCQ getConditionQueryRoleInfo() { if (_conditionQueryRoleInfo == null) { - _conditionQueryRoleInfo = createQueryRoleInfo(); - setupOuterJoin_RoleInfo(); + _conditionQueryRoleInfo = xcreateQueryRoleInfo(); + xsetupOuterJoinRoleInfo(); } return _conditionQueryRoleInfo; } - protected void setupOuterJoin_RoleInfo() { - Map joinOnMap = newLinkedHashMap(); - joinOnMap.put(getRealColumnName("ROLE_ID"), getConditionQueryRoleInfo() - .getRealColumnName("ROLE_ID")); - registerOuterJoin(getConditionQueryRoleInfo(), joinOnMap); - } - - protected RoleInfoCQ createQueryRoleInfo() { + protected RoleInfoCQ xcreateQueryRoleInfo() { String nrp = resolveNextRelationPath("USER_INFO", "roleInfo"); String jan = resolveJoinAliasName(nrp, getNextNestLevel()); RoleInfoCQ cq = new RoleInfoCQ(this, getSqlClause(), jan, @@ -1268,10 +1286,42 @@ return cq; } + protected void xsetupOuterJoinRoleInfo() { + RoleInfoCQ cq = getConditionQueryRoleInfo(); + Map joinOnMap = newLinkedHashMap(); + joinOnMap.put(getRealColumnName("ROLE_ID"), cq + .getRealColumnName("ROLE_ID")); + registerOuterJoin(cq, joinOnMap); + } + public boolean hasConditionQueryRoleInfo() { return _conditionQueryRoleInfo != null; } + //========================================================================== + // ========= + // Derived Query + // ============= + protected Map _scalarSubQueryMap; + + public Map getScalarSubQuery() { + return _scalarSubQueryMap; + } + + public String keepScalarSubQuery(UserInfoCQ subQuery) { + if (_scalarSubQueryMap == null) { + _scalarSubQueryMap = newLinkedHashMap(); + } + String key = "subQueryMapKey" + (_scalarSubQueryMap.size() + 1); + _scalarSubQueryMap.put(key, subQuery); + return "scalarSubQuery." + key; + } + + // Very Internal (for Suppressing Warn about 'Not Use Import') + protected String getConditionBeanClassNameInternally() { + return UserInfoCB.class.getName(); + } + protected String getConditionQueryClassNameInternally() { return UserInfoCQ.class.getName(); } Modified: bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/cbean/cq/ciq/BookmarkCategoryCIQ.java =================================================================== --- bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/cbean/cq/ciq/BookmarkCategoryCIQ.java 2008-12-27 22:10:35 UTC (rev 1626) +++ bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/cbean/cq/ciq/BookmarkCategoryCIQ.java 2008-12-27 22:11:51 UTC (rev 1627) @@ -5,6 +5,7 @@ import jp.sf.pal.bookmark.db.allcommon.cbean.coption.ConditionOption; import jp.sf.pal.bookmark.db.allcommon.cbean.cvalue.ConditionValue; import jp.sf.pal.bookmark.db.allcommon.cbean.sqlclause.SqlClause; +import jp.sf.pal.bookmark.db.cbean.BookmarkCategoryCB; import jp.sf.pal.bookmark.db.cbean.cq.BookmarkCategoryCQ; import jp.sf.pal.bookmark.db.cbean.cq.BookmarkLinkCQ; import jp.sf.pal.bookmark.db.cbean.cq.UserInfoCQ; @@ -16,7 +17,6 @@ * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public class BookmarkCategoryCIQ extends AbstractBsBookmarkCategoryCQ { //========================================================================== @@ -117,9 +117,10 @@ "NotExistsSubQuery at inline() is unsupported! Sorry!"); } - public String keepId_DeriveSubQuery_BookmarkLinkList(BookmarkLinkCQ subQuery) { + public String keepId_DerivedReferrer_BookmarkLinkList( + BookmarkLinkCQ subQuery) { throw new UnsupportedOperationException( - "DeriveSubQuery at inline() is unsupported! Sorry!"); + "DerivedReferrer at inline() is unsupported! Sorry!"); } protected ConditionValue getCValueName() { @@ -178,6 +179,20 @@ return _myCQ.getVersionno(); } + //========================================================================== + // ========= + // Derived Query + // ============= + public String keepScalarSubQuery(BookmarkCategoryCQ subQuery) { + throw new UnsupportedOperationException( + "ScalarSubQuery at inline() is unsupported! Sorry!"); + } + + // Very Internal (for Suppressing Warn about 'Not Use Import') + protected String getConditionBeanClassNameInternally() { + return BookmarkCategoryCB.class.getName(); + } + protected String getConditionQueryClassNameInternally() { return BookmarkCategoryCQ.class.getName(); } Modified: bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/cbean/cq/ciq/BookmarkLinkCIQ.java =================================================================== --- bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/cbean/cq/ciq/BookmarkLinkCIQ.java 2008-12-27 22:10:35 UTC (rev 1626) +++ bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/cbean/cq/ciq/BookmarkLinkCIQ.java 2008-12-27 22:11:51 UTC (rev 1627) @@ -5,6 +5,7 @@ import jp.sf.pal.bookmark.db.allcommon.cbean.coption.ConditionOption; import jp.sf.pal.bookmark.db.allcommon.cbean.cvalue.ConditionValue; import jp.sf.pal.bookmark.db.allcommon.cbean.sqlclause.SqlClause; +import jp.sf.pal.bookmark.db.cbean.BookmarkLinkCB; import jp.sf.pal.bookmark.db.cbean.cq.BookmarkCategoryCQ; import jp.sf.pal.bookmark.db.cbean.cq.BookmarkLinkCQ; import jp.sf.pal.bookmark.db.cbean.cq.UserInfoCQ; @@ -16,7 +17,6 @@ * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public class BookmarkLinkCIQ extends AbstractBsBookmarkLinkCQ { //========================================================================== @@ -165,6 +165,20 @@ return _myCQ.getVersionno(); } + //========================================================================== + // ========= + // Derived Query + // ============= + public String keepScalarSubQuery(BookmarkLinkCQ subQuery) { + throw new UnsupportedOperationException( + "ScalarSubQuery at inline() is unsupported! Sorry!"); + } + + // Very Internal (for Suppressing Warn about 'Not Use Import') + protected String getConditionBeanClassNameInternally() { + return BookmarkLinkCB.class.getName(); + } + protected String getConditionQueryClassNameInternally() { return BookmarkLinkCQ.class.getName(); } Modified: bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/cbean/cq/ciq/GroupInfoCIQ.java =================================================================== --- bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/cbean/cq/ciq/GroupInfoCIQ.java 2008-12-27 22:10:35 UTC (rev 1626) +++ bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/cbean/cq/ciq/GroupInfoCIQ.java 2008-12-27 22:11:51 UTC (rev 1627) @@ -5,6 +5,7 @@ import jp.sf.pal.bookmark.db.allcommon.cbean.coption.ConditionOption; import jp.sf.pal.bookmark.db.allcommon.cbean.cvalue.ConditionValue; import jp.sf.pal.bookmark.db.allcommon.cbean.sqlclause.SqlClause; +import jp.sf.pal.bookmark.db.cbean.GroupInfoCB; import jp.sf.pal.bookmark.db.cbean.cq.GroupInfoCQ; import jp.sf.pal.bookmark.db.cbean.cq.GroupMappingCQ; import jp.sf.pal.bookmark.db.cbean.cq.UserInfoCQ; @@ -16,7 +17,6 @@ * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public class GroupInfoCIQ extends AbstractBsGroupInfoCQ { //========================================================================== @@ -137,15 +137,15 @@ "NotExistsSubQuery at inline() is unsupported! Sorry!"); } - public String keepGroupId_DeriveSubQuery_GroupMappingList( + public String keepGroupId_DerivedReferrer_GroupMappingList( GroupMappingCQ subQuery) { throw new UnsupportedOperationException( - "DeriveSubQuery at inline() is unsupported! Sorry!"); + "DerivedReferrer at inline() is unsupported! Sorry!"); } - public String keepGroupId_DeriveSubQuery_UserInfoList(UserInfoCQ subQuery) { + public String keepGroupId_DerivedReferrer_UserInfoList(UserInfoCQ subQuery) { throw new UnsupportedOperationException( - "DeriveSubQuery at inline() is unsupported! Sorry!"); + "DerivedReferrer at inline() is unsupported! Sorry!"); } protected ConditionValue getCValueName() { @@ -196,6 +196,20 @@ return _myCQ.getVersionno(); } + //========================================================================== + // ========= + // Derived Query + // ============= + public String keepScalarSubQuery(GroupInfoCQ subQuery) { + throw new UnsupportedOperationException( + "ScalarSubQuery at inline() is unsupported! Sorry!"); + } + + // Very Internal (for Suppressing Warn about 'Not Use Import') + protected String getConditionBeanClassNameInternally() { + return GroupInfoCB.class.getName(); + } + protected String getConditionQueryClassNameInternally() { return GroupInfoCQ.class.getName(); } Modified: bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/cbean/cq/ciq/GroupMappingCIQ.java =================================================================== --- bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/cbean/cq/ciq/GroupMappingCIQ.java 2008-12-27 22:10:35 UTC (rev 1626) +++ bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/cbean/cq/ciq/GroupMappingCIQ.java 2008-12-27 22:11:51 UTC (rev 1627) @@ -5,6 +5,7 @@ import jp.sf.pal.bookmark.db.allcommon.cbean.coption.ConditionOption; import jp.sf.pal.bookmark.db.allcommon.cbean.cvalue.ConditionValue; import jp.sf.pal.bookmark.db.allcommon.cbean.sqlclause.SqlClause; +import jp.sf.pal.bookmark.db.cbean.GroupMappingCB; import jp.sf.pal.bookmark.db.cbean.cq.GroupInfoCQ; import jp.sf.pal.bookmark.db.cbean.cq.GroupMappingCQ; import jp.sf.pal.bookmark.db.cbean.cq.UserInfoCQ; @@ -16,7 +17,6 @@ * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public class GroupMappingCIQ extends AbstractBsGroupMappingCQ { //========================================================================== @@ -112,6 +112,20 @@ return _myCQ.keepGroupId_InScopeSubQuery_GroupInfo(subQuery); } + //========================================================================== + // ========= + // Derived Query + // ============= + public String keepScalarSubQuery(GroupMappingCQ subQuery) { + throw new UnsupportedOperationException( + "ScalarSubQuery at inline() is unsupported! Sorry!"); + } + + // Very Internal (for Suppressing Warn about 'Not Use Import') + protected String getConditionBeanClassNameInternally() { + return GroupMappingCB.class.getName(); + } + protected String getConditionQueryClassNameInternally() { return GroupMappingCQ.class.getName(); } Modified: bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/cbean/cq/ciq/RoleInfoCIQ.java =================================================================== --- bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/cbean/cq/ciq/RoleInfoCIQ.java 2008-12-27 22:10:35 UTC (rev 1626) +++ bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/cbean/cq/ciq/RoleInfoCIQ.java 2008-12-27 22:11:51 UTC (rev 1627) @@ -5,6 +5,7 @@ import jp.sf.pal.bookmark.db.allcommon.cbean.coption.ConditionOption; import jp.sf.pal.bookmark.db.allcommon.cbean.cvalue.ConditionValue; import jp.sf.pal.bookmark.db.allcommon.cbean.sqlclause.SqlClause; +import jp.sf.pal.bookmark.db.cbean.RoleInfoCB; import jp.sf.pal.bookmark.db.cbean.cq.RoleInfoCQ; import jp.sf.pal.bookmark.db.cbean.cq.RoleMappingCQ; import jp.sf.pal.bookmark.db.cbean.cq.UserInfoCQ; @@ -16,7 +17,6 @@ * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public class RoleInfoCIQ extends AbstractBsRoleInfoCQ { //========================================================================== @@ -136,15 +136,15 @@ "NotExistsSubQuery at inline() is unsupported! Sorry!"); } - public String keepRoleId_DeriveSubQuery_RoleMappingList( + public String keepRoleId_DerivedReferrer_RoleMappingList( RoleMappingCQ subQuery) { throw new UnsupportedOperationException( - "DeriveSubQuery at inline() is unsupported! Sorry!"); + "DerivedReferrer at inline() is unsupported! Sorry!"); } - public String keepRoleId_DeriveSubQuery_UserInfoList(UserInfoCQ subQuery) { + public String keepRoleId_DerivedReferrer_UserInfoList(UserInfoCQ subQuery) { throw new UnsupportedOperationException( - "DeriveSubQuery at inline() is unsupported! Sorry!"); + "DerivedReferrer at inline() is unsupported! Sorry!"); } protected ConditionValue getCValueName() { @@ -195,6 +195,20 @@ return _myCQ.getVersionno(); } + //========================================================================== + // ========= + // Derived Query + // ============= + public String keepScalarSubQuery(RoleInfoCQ subQuery) { + throw new UnsupportedOperationException( + "ScalarSubQuery at inline() is unsupported! Sorry!"); + } + + // Very Internal (for Suppressing Warn about 'Not Use Import') + protected String getConditionBeanClassNameInternally() { + return RoleInfoCB.class.getName(); + } + protected String getConditionQueryClassNameInternally() { return RoleInfoCQ.class.getName(); } Modified: bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/cbean/cq/ciq/RoleMappingCIQ.java =================================================================== --- bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/cbean/cq/ciq/RoleMappingCIQ.java 2008-12-27 22:10:35 UTC (rev 1626) +++ bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/cbean/cq/ciq/RoleMappingCIQ.java 2008-12-27 22:11:51 UTC (rev 1627) @@ -5,6 +5,7 @@ import jp.sf.pal.bookmark.db.allcommon.cbean.coption.ConditionOption; import jp.sf.pal.bookmark.db.allcommon.cbean.cvalue.ConditionValue; import jp.sf.pal.bookmark.db.allcommon.cbean.sqlclause.SqlClause; +import jp.sf.pal.bookmark.db.cbean.RoleMappingCB; import jp.sf.pal.bookmark.db.cbean.cq.RoleInfoCQ; import jp.sf.pal.bookmark.db.cbean.cq.RoleMappingCQ; import jp.sf.pal.bookmark.db.cbean.cq.UserInfoCQ; @@ -16,7 +17,6 @@ * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public class RoleMappingCIQ extends AbstractBsRoleMappingCQ { //========================================================================== @@ -112,6 +112,20 @@ return _myCQ.keepRoleId_InScopeSubQuery_RoleInfo(subQuery); } + //========================================================================== + // ========= + // Derived Query + // ============= + public String keepScalarSubQuery(RoleMappingCQ subQuery) { + throw new UnsupportedOperationException( + "ScalarSubQuery at inline() is unsupported! Sorry!"); + } + + // Very Internal (for Suppressing Warn about 'Not Use Import') + protected String getConditionBeanClassNameInternally() { + return RoleMappingCB.class.getName(); + } + protected String getConditionQueryClassNameInternally() { return RoleMappingCQ.class.getName(); } Modified: bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/cbean/cq/ciq/UserInfoCIQ.java =================================================================== --- bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/cbean/cq/ciq/UserInfoCIQ.java 2008-12-27 22:10:35 UTC (rev 1626) +++ bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/cbean/cq/ciq/UserInfoCIQ.java 2008-12-27 22:11:51 UTC (rev 1627) @@ -5,6 +5,7 @@ import jp.sf.pal.bookmark.db.allcommon.cbean.coption.ConditionOption; import jp.sf.pal.bookmark.db.allcommon.cbean.cvalue.ConditionValue; import jp.sf.pal.bookmark.db.allcommon.cbean.sqlclause.SqlClause; +import jp.sf.pal.bookmark.db.cbean.UserInfoCB; import jp.sf.pal.bookmark.db.cbean.cq.BookmarkCategoryCQ; import jp.sf.pal.bookmark.db.cbean.cq.BookmarkLinkCQ; import jp.sf.pal.bookmark.db.cbean.cq.GroupInfoCQ; @@ -20,7 +21,6 @@ * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public class UserInfoCIQ extends AbstractBsUserInfoCQ { //========================================================================== @@ -240,40 +240,40 @@ "NotExistsSubQuery at inline() is unsupported! Sorry!"); } - public String keepUserId_DeriveSubQuery_BookmarkCategoryByCreatedByList( + public String keepUserId_DerivedReferrer_BookmarkCategoryByCreatedByList( BookmarkCategoryCQ subQuery) { throw new UnsupportedOperationException( - "DeriveSubQuery at inline() is unsupported! Sorry!"); + "DerivedReferrer at inline() is unsupported! Sorry!"); } - public String keepUserId_DeriveSubQuery_BookmarkCategoryByUpdatedByList( + public String keepUserId_DerivedReferrer_BookmarkCategoryByUpdatedByList( BookmarkCategoryCQ subQuery) { throw new UnsupportedOperationException( - "DeriveSubQuery at inline() is unsupported! Sorry!"); + "DerivedReferrer at inline() is unsupported! Sorry!"); } - public String keepUserId_DeriveSubQuery_BookmarkLinkByCreatedByList( + public String keepUserId_DerivedReferrer_BookmarkLinkByCreatedByList( BookmarkLinkCQ subQuery) { throw new UnsupportedOperationException( - "DeriveSubQuery at inline() is unsupported! Sorry!"); + "DerivedReferrer at inline() is unsupported! Sorry!"); } - public String keepUserId_DeriveSubQuery_BookmarkLinkByUpdatedByList( + public String keepUserId_DerivedReferrer_BookmarkLinkByUpdatedByList( BookmarkLinkCQ subQuery) { throw new UnsupportedOperationException( - "DeriveSubQuery at inline() is unsupported! Sorry!"); + "DerivedReferrer at inline() is unsupported! Sorry!"); } - public String keepUserId_DeriveSubQuery_GroupMappingList( + public String keepUserId_DerivedReferrer_GroupMappingList( GroupMappingCQ subQuery) { throw new UnsupportedOperationException( - "DeriveSubQuery at inline() is unsupported! Sorry!"); + "DerivedReferrer at inline() is unsupported! Sorry!"); } - public String keepUserId_DeriveSubQuery_RoleMappingList( + public String keepUserId_DerivedReferrer_RoleMappingList( RoleMappingCQ subQuery) { throw new UnsupportedOperationException( - "DeriveSubQuery at inline() is unsupported! Sorry!"); + "DerivedReferrer at inline() is unsupported! Sorry!"); } protected ConditionValue getCValueGivenName() { @@ -340,6 +340,10 @@ return _myCQ.keepGroupId_InScopeSubQuery_GroupInfo(subQuery); } + protected ConditionValue getCValueStatus() { + return _myCQ.getStatus(); + } + protected ConditionValue getCValueCreatedTime() { return _myCQ.getCreatedTime(); } @@ -368,6 +372,20 @@ return _myCQ.getVersionno(); } + //========================================================================== + // ========= + // Derived Query + // ============= + public String keepScalarSubQuery(UserInfoCQ subQuery) { + throw new UnsupportedOperationException( + "ScalarSubQuery at inline() is unsupported! Sorry!"); + } + + // Very Internal (for Suppressing Warn about 'Not Use Import') + protected String getConditionBeanClassNameInternally() { + return UserInfoCB.class.getName(); + } + protected String getConditionQueryClassNameInternally() { return UserInfoCQ.class.getName(); } Modified: bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/cbean/nss/BookmarkCategoryNss.java =================================================================== --- bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/cbean/nss/BookmarkCategoryNss.java 2008-12-27 22:10:35 UTC (rev 1626) +++ bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/cbean/nss/BookmarkCategoryNss.java 2008-12-27 22:11:51 UTC (rev 1627) @@ -8,7 +8,6 @@ * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public class BookmarkCategoryNss { protected BookmarkCategoryCQ _query; Modified: bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/cbean/nss/BookmarkLinkNss.java =================================================================== --- bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/cbean/nss/BookmarkLinkNss.java 2008-12-27 22:10:35 UTC (rev 1626) +++ bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/cbean/nss/BookmarkLinkNss.java 2008-12-27 22:11:51 UTC (rev 1627) @@ -8,7 +8,6 @@ * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public class BookmarkLinkNss { protected BookmarkLinkCQ _query; Modified: bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/cbean/nss/GroupInfoNss.java =================================================================== --- bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/cbean/nss/GroupInfoNss.java 2008-12-27 22:10:35 UTC (rev 1626) +++ bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/cbean/nss/GroupInfoNss.java 2008-12-27 22:11:51 UTC (rev 1627) @@ -7,7 +7,6 @@ * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public class GroupInfoNss { protected GroupInfoCQ _query; Modified: bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/cbean/nss/GroupMappingNss.java =================================================================== --- bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/cbean/nss/GroupMappingNss.java 2008-12-27 22:10:35 UTC (rev 1626) +++ bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/cbean/nss/GroupMappingNss.java 2008-12-27 22:11:51 UTC (rev 1627) @@ -8,7 +8,6 @@ * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public class GroupMappingNss { protected GroupMappingCQ _query; Modified: bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/cbean/nss/RoleInfoNss.java =================================================================== --- bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/cbean/nss/RoleInfoNss.java 2008-12-27 22:10:35 UTC (rev 1626) +++ bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/cbean/nss/RoleInfoNss.java 2008-12-27 22:11:51 UTC (rev 1627) @@ -7,7 +7,6 @@ * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public class RoleInfoNss { protected RoleInfoCQ _query; Modified: bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/cbean/nss/RoleMappingNss.java =================================================================== --- bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/cbean/nss/RoleMappingNss.java 2008-12-27 22:10:35 UTC (rev 1626) +++ bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/cbean/nss/RoleMappingNss.java 2008-12-27 22:11:51 UTC (rev 1627) @@ -8,7 +8,6 @@ * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public class RoleMappingNss { protected RoleMappingCQ _query; Modified: bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/cbean/nss/UserInfoNss.java =================================================================== --- bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/cbean/nss/UserInfoNss.java 2008-12-27 22:10:35 UTC (rev 1626) +++ bookmark/trunk/src/main/java/jp/sf/pal/bookmark/db/cbean/nss/UserInfoNss.java 2008-12-27 22:11:51 UTC (rev 1627) @@ -8,7 +8,6 @@ * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public class UserInfoNss { protected UserInfoCQ _query; Modified: bookmark/trunk/src/main/resources/dbflute.dicon =================================================================== --- bookmark/trunk/src/main/resources/dbflute.dicon 2008-12-27 22:10:35 UTC (rev 1626) +++ bookmark/trunk/src/main/resources/dbflute.dicon 2008-12-27 22:11:51 UTC (rev 1627) @@ -5,83 +5,39 @@ - - - "UTF-8" + + + + + + - + + + + + - - - - + + - - - - - - - - - - - - dbflute.interceptor - - - - - - dbflute.interceptor - - - - - dbflute.interceptor - - - - - dbflute.interceptor - - - - - dbflute.interceptor - - - - - dbflute.interceptor - - - - - dbflute.interceptor - - - - - dbflute.interceptor - Modified: bookmark/trunk/src/main/webapp/WEB-INF/db/bookmark.1.log.db =================================================================== (Binary files differ) Modified: bookmark/trunk/src/main/webapp/WEB-INF/db/bookmark.data.db =================================================================== (Binary files differ) From svnnotify ¡÷ sourceforge.jp Sun Dec 28 07:13:37 2008 From: svnnotify ¡÷ sourceforge.jp (svnnotify ¡÷ sourceforge.jp) Date: Sun, 28 Dec 2008 07:13:37 +0900 Subject: [pal-cvs 3893] [1628] added status column to userinfo table. Message-ID: <1230416017.585129.11663.nullmailer@users.sourceforge.jp> Revision: 1628 http://svn.sourceforge.jp/view?root=pal&view=rev&rev=1628 Author: shinsuke Date: 2008-12-28 07:13:37 +0900 (Sun, 28 Dec 2008) Log Message: ----------- added status column to userinfo table. replaced with dbflute 0.8.7. Modified Paths: -------------- notepad/trunk/dbflute/_project.bat notepad/trunk/dbflute/_project.sh notepad/trunk/dbflute/build-notepad.properties notepad/trunk/mydbflute/README.txt notepad/trunk/src/main/config/erd/notepad.erd notepad/trunk/src/main/config/sql/notepad.ddl notepad/trunk/src/main/config/sql/notepad.dml notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/BehaviorSelector.java notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/CacheBehaviorSelector.java notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/DBFluteConfig.java notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/EntityDefinedCommonColumn.java notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/bhv/AbstractBehaviorReadable.java notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/bhv/AbstractBehaviorWritable.java notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/bhv/BehaviorReadable.java notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/bhv/BehaviorWritable.java notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/cbean/AbstractConditionBean.java notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/cbean/AbstractConditionQuery.java notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/cbean/ConditionBean.java notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/cbean/ConditionBeanContext.java notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/cbean/ConditionQuery.java notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/cbean/ckey/ConditionKey.java notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/cbean/coption/FromToOption.java notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/cbean/coption/LikeSearchOption.java notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/cbean/cvalue/ConditionValue.java notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/cbean/outsidesql/OutsideSqlContext.java notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/cbean/outsidesql/OutsideSqlOption.java notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/cbean/outsidesql/executor/OutsideSqlBasicExecutor.java notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/cbean/outsidesql/executor/OutsideSqlCursorExecutor.java notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/cbean/outsidesql/executor/OutsideSqlEntityExecutor.java notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/cbean/outsidesql/executor/OutsideSqlPagingExecutor.java notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/cbean/sqlclause/AbstractSqlClause.java notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/cbean/sqlclause/SqlClause.java notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/cbean/sqlclause/SqlClauseOracle.java notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/dbmeta/AbstractDBMeta.java notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/dbmeta/DBMeta.java notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/dbmeta/DBMetaInstanceHandler.java notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/dbmeta/hierarchy/HierarchyArranger.java notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/dbmeta/hierarchy/HierarchyRequest.java notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/dbmeta/hierarchy/HierarchyRequestElement.java notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/dbmeta/hierarchy/HierarchySourceColumn.java notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/dbmeta/hierarchy/HierarchySourceIterator.java notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/dbmeta/hierarchy/HierarchySourceRow.java notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/dbmeta/info/ColumnInfo.java notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/dbmeta/info/RelationInfo.java notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/helper/MapStringBuilderImpl.java notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/s2dao/FetchNarrowingResultSetWrapper.java notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/s2dao/internal/rshandler/InternalAbstractDtoMetaDataResultSetHandler.java notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/s2dao/internal/sqlcommand/InternalAbstractAutoStaticCommand.java notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/s2dao/internal/sqlcommand/InternalAbstractBatchAutoStaticCommand.java notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/s2dao/internal/sqlcommand/InternalAbstractDynamicCommand.java notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/s2dao/internal/sqlcommand/InternalAbstractSqlCommand.java notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/s2dao/internal/sqlcommand/InternalDeleteAutoStaticCommand.java notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/s2dao/internal/sqlcommand/InternalDeleteBatchAutoStaticCommand.java notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/s2dao/internal/sqlcommand/InternalDeleteQueryAutoDynamicCommand.java notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/s2dao/internal/sqlcommand/InternalInsertAutoDynamicCommand.java notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/s2dao/internal/sqlcommand/InternalInsertBatchAutoStaticCommand.java notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/s2dao/internal/sqlcommand/InternalProcedureCommand.java notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/s2dao/internal/sqlcommand/InternalUpdateAutoDynamicCommand.java notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/s2dao/internal/sqlcommand/InternalUpdateBatchAutoStaticCommand.java notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/s2dao/internal/sqlcommand/InternalUpdateDynamicCommand.java notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/s2dao/internal/sqlcommand/InternalUpdateQueryAutoDynamicCommand.java notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/s2dao/internal/sqlhandler/InternalAbstractAutoHandler.java notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/s2dao/internal/sqlhandler/InternalAbstractBatchAutoHandler.java notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/s2dao/internal/sqlhandler/InternalBasicHandler.java notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/s2dao/internal/sqlhandler/InternalBasicSelectHandler.java notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/s2dao/internal/sqlhandler/InternalBasicUpdateHandler.java notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/s2dao/internal/sqlhandler/InternalInsertAutoHandler.java notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/s2dao/internal/sqlhandler/InternalInsertBatchAutoHandler.java notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/s2dao/internal/sqlhandler/InternalProcedureHandler.java notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/s2dao/internal/sqlhandler/InternalUpdateAutoHandler.java notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/s2dao/internal/sqlparser/InternalSqlParser.java notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/s2dao/internal/various/InternalProcedureMetaDataFactory.java notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/util/SimpleAssertUtil.java notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/util/SimpleStringUtil.java notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/util/SimpleSystemUtil.java notepad/trunk/src/main/java/jp/sf/pal/notepad/db/bsbhv/BsGroupInfoBhv.java notepad/trunk/src/main/java/jp/sf/pal/notepad/db/bsbhv/BsGroupMappingBhv.java notepad/trunk/src/main/java/jp/sf/pal/notepad/db/bsbhv/BsNotepadBhv.java notepad/trunk/src/main/java/jp/sf/pal/notepad/db/bsbhv/BsNotepadCategoryBhv.java notepad/trunk/src/main/java/jp/sf/pal/notepad/db/bsbhv/BsNotepadContentBhv.java notepad/trunk/src/main/java/jp/sf/pal/notepad/db/bsbhv/BsRoleInfoBhv.java notepad/trunk/src/main/java/jp/sf/pal/notepad/db/bsbhv/BsRoleMappingBhv.java notepad/trunk/src/main/java/jp/sf/pal/notepad/db/bsbhv/BsUserInfoBhv.java notepad/trunk/src/main/java/jp/sf/pal/notepad/db/bsentity/BsGroupInfo.java notepad/trunk/src/main/java/jp/sf/pal/notepad/db/bsentity/BsGroupMapping.java notepad/trunk/src/main/java/jp/sf/pal/notepad/db/bsentity/BsNotepad.java notepad/trunk/src/main/java/jp/sf/pal/notepad/db/bsentity/BsNotepadCategory.java notepad/trunk/src/main/java/jp/sf/pal/notepad/db/bsentity/BsNotepadContent.java notepad/trunk/src/main/java/jp/sf/pal/notepad/db/bsentity/BsRoleInfo.java notepad/trunk/src/main/java/jp/sf/pal/notepad/db/bsentity/BsRoleMapping.java notepad/trunk/src/main/java/jp/sf/pal/notepad/db/bsentity/BsUserInfo.java notepad/trunk/src/main/java/jp/sf/pal/notepad/db/bsentity/dbmeta/GroupInfoDbm.java notepad/trunk/src/main/java/jp/sf/pal/notepad/db/bsentity/dbmeta/GroupMappingDbm.java notepad/trunk/src/main/java/jp/sf/pal/notepad/db/bsentity/dbmeta/NotepadCategoryDbm.java notepad/trunk/src/main/java/jp/sf/pal/notepad/db/bsentity/dbmeta/NotepadContentDbm.java notepad/trunk/src/main/java/jp/sf/pal/notepad/db/bsentity/dbmeta/NotepadDbm.java notepad/trunk/src/main/java/jp/sf/pal/notepad/db/bsentity/dbmeta/RoleInfoDbm.java notepad/trunk/src/main/java/jp/sf/pal/notepad/db/bsentity/dbmeta/RoleMappingDbm.java notepad/trunk/src/main/java/jp/sf/pal/notepad/db/bsentity/dbmeta/UserInfoDbm.java notepad/trunk/src/main/java/jp/sf/pal/notepad/db/cbean/bs/BsGroupInfoCB.java notepad/trunk/src/main/java/jp/sf/pal/notepad/db/cbean/bs/BsGroupMappingCB.java notepad/trunk/src/main/java/jp/sf/pal/notepad/db/cbean/bs/BsNotepadCB.java notepad/trunk/src/main/java/jp/sf/pal/notepad/db/cbean/bs/BsNotepadCategoryCB.java notepad/trunk/src/main/java/jp/sf/pal/notepad/db/cbean/bs/BsNotepadContentCB.java notepad/trunk/src/main/java/jp/sf/pal/notepad/db/cbean/bs/BsRoleInfoCB.java notepad/trunk/src/main/java/jp/sf/pal/notepad/db/cbean/bs/BsRoleMappingCB.java notepad/trunk/src/main/java/jp/sf/pal/notepad/db/cbean/bs/BsUserInfoCB.java notepad/trunk/src/main/java/jp/sf/pal/notepad/db/cbean/cq/bs/AbstractBsGroupInfoCQ.java notepad/trunk/src/main/java/jp/sf/pal/notepad/db/cbean/cq/bs/AbstractBsGroupMappingCQ.java notepad/trunk/src/main/java/jp/sf/pal/notepad/db/cbean/cq/bs/AbstractBsNotepadCQ.java notepad/trunk/src/main/java/jp/sf/pal/notepad/db/cbean/cq/bs/AbstractBsNotepadCategoryCQ.java notepad/trunk/src/main/java/jp/sf/pal/notepad/db/cbean/cq/bs/AbstractBsNotepadContentCQ.java notepad/trunk/src/main/java/jp/sf/pal/notepad/db/cbean/cq/bs/AbstractBsRoleInfoCQ.java notepad/trunk/src/main/java/jp/sf/pal/notepad/db/cbean/cq/bs/AbstractBsRoleMappingCQ.java notepad/trunk/src/main/java/jp/sf/pal/notepad/db/cbean/cq/bs/AbstractBsUserInfoCQ.java notepad/trunk/src/main/java/jp/sf/pal/notepad/db/cbean/cq/bs/BsGroupInfoCQ.java notepad/trunk/src/main/java/jp/sf/pal/notepad/db/cbean/cq/bs/BsGroupMappingCQ.java notepad/trunk/src/main/java/jp/sf/pal/notepad/db/cbean/cq/bs/BsNotepadCQ.java notepad/trunk/src/main/java/jp/sf/pal/notepad/db/cbean/cq/bs/BsNotepadCategoryCQ.java notepad/trunk/src/main/java/jp/sf/pal/notepad/db/cbean/cq/bs/BsNotepadContentCQ.java notepad/trunk/src/main/java/jp/sf/pal/notepad/db/cbean/cq/bs/BsRoleInfoCQ.java notepad/trunk/src/main/java/jp/sf/pal/notepad/db/cbean/cq/bs/BsRoleMappingCQ.java notepad/trunk/src/main/java/jp/sf/pal/notepad/db/cbean/cq/bs/BsUserInfoCQ.java notepad/trunk/src/main/java/jp/sf/pal/notepad/db/cbean/cq/ciq/GroupInfoCIQ.java notepad/trunk/src/main/java/jp/sf/pal/notepad/db/cbean/cq/ciq/GroupMappingCIQ.java notepad/trunk/src/main/java/jp/sf/pal/notepad/db/cbean/cq/ciq/NotepadCIQ.java notepad/trunk/src/main/java/jp/sf/pal/notepad/db/cbean/cq/ciq/NotepadCategoryCIQ.java notepad/trunk/src/main/java/jp/sf/pal/notepad/db/cbean/cq/ciq/NotepadContentCIQ.java notepad/trunk/src/main/java/jp/sf/pal/notepad/db/cbean/cq/ciq/RoleInfoCIQ.java notepad/trunk/src/main/java/jp/sf/pal/notepad/db/cbean/cq/ciq/RoleMappingCIQ.java notepad/trunk/src/main/java/jp/sf/pal/notepad/db/cbean/cq/ciq/UserInfoCIQ.java notepad/trunk/src/main/java/jp/sf/pal/notepad/db/cbean/nss/GroupInfoNss.java notepad/trunk/src/main/java/jp/sf/pal/notepad/db/cbean/nss/GroupMappingNss.java notepad/trunk/src/main/java/jp/sf/pal/notepad/db/cbean/nss/NotepadCategoryNss.java notepad/trunk/src/main/java/jp/sf/pal/notepad/db/cbean/nss/NotepadContentNss.java notepad/trunk/src/main/java/jp/sf/pal/notepad/db/cbean/nss/NotepadNss.java notepad/trunk/src/main/java/jp/sf/pal/notepad/db/cbean/nss/RoleInfoNss.java notepad/trunk/src/main/java/jp/sf/pal/notepad/db/cbean/nss/RoleMappingNss.java notepad/trunk/src/main/java/jp/sf/pal/notepad/db/cbean/nss/UserInfoNss.java notepad/trunk/src/main/resources/dbflute.dicon notepad/trunk/src/main/webapp/WEB-INF/db/notepad.1.log.db notepad/trunk/src/main/webapp/WEB-INF/db/notepad.data.db Added Paths: ----------- notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/CommonColumnAutoSetupper.java notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/CommonColumnBasicAutoSetupper.java notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/DBDef.java notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/bhv/core/ notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/bhv/core/BehaviorCommand.java notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/bhv/core/BehaviorCommandComponentSetup.java notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/bhv/core/BehaviorCommandInvoker.java notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/bhv/core/BehaviorInitializer.java notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/bhv/core/SqlExecution.java notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/bhv/core/SqlExecutionCreator.java notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/bhv/core/command/ notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/bhv/core/command/AbstractBehaviorCommand.java notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/bhv/core/command/AbstractEntityCommand.java notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/bhv/core/command/AbstractListEntityCommand.java notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/bhv/core/command/AbstractOutsideSqlCommand.java notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/bhv/core/command/AbstractOutsideSqlSelectCommand.java notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/bhv/core/command/AbstractSelectCBCommand.java notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/bhv/core/command/BatchDeleteEntityCommand.java notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/bhv/core/command/BatchDeleteNonstrictEntityCommand.java notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/bhv/core/command/BatchInsertEntityCommand.java notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/bhv/core/command/BatchUpdateEntityCommand.java notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/bhv/core/command/BatchUpdateNonstrictEntityCommand.java notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/bhv/core/command/DeleteEntityCommand.java notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/bhv/core/command/DeleteNonstrictEntityCommand.java notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/bhv/core/command/InsertEntityCommand.java notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/bhv/core/command/OutsideSqlCallCommand.java notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/bhv/core/command/OutsideSqlExecuteCommand.java notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/bhv/core/command/OutsideSqlSelectCursorCommand.java notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/bhv/core/command/OutsideSqlSelectListCommand.java notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/bhv/core/command/QueryDeleteCBCommand.java notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/bhv/core/command/QueryUpdateEntityCBCommand.java notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/bhv/core/command/SelectCountCBCommand.java notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/bhv/core/command/SelectListCBCommand.java notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/bhv/core/command/SelectNextValCommand.java notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/bhv/core/command/SelectScalarCBCommand.java notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/bhv/core/command/UpdateEntityCommand.java notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/bhv/core/command/UpdateNonstrictEntityCommand.java notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/bhv/core/execution/ notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/bhv/core/execution/BasicSelectExecution.java notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/bhv/core/execution/OutsideSqlSelectExecution.java notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/bhv/core/execution/SelectCBExecution.java notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/cbean/ScalarQuery.java notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/cbean/ckey/ConditionKeyNotLikeSearch.java notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/helper/StringKeyMap.java notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/helper/StringSet.java notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/s2dao/BeanMetaDataFactoryExtension.java notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/s2dao/PropertyTypeFactoryBuilderExtension.java notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/s2dao/SqlLogRegistryLatestSqlProvider.java notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/s2dao/internal/various/InternalIdentifierAbstractGenerator.java notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/s2dao/internal/various/InternalIdentifierAssignedGenerator.java notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/s2dao/internal/various/InternalIdentifierGeneratorFactory.java notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/s2dao/internal/various/InternalIdentifierIdentityGenerator.java notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/s2dao/internal/various/InternalIdentifierSequenceGenerator.java notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/s2dao/internal/various/InternalStatementFactory.java notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/util/SimpleResourceUtil.java notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/util/SimpleTypeUtil.java Removed Paths: ------------- notepad/trunk/src/main/java/jp/sf/pal/notepad/db/bsdao/ notepad/trunk/src/main/java/jp/sf/pal/notepad/db/exdao/ -------------- next part -------------- Modified: notepad/trunk/dbflute/_project.bat =================================================================== --- notepad/trunk/dbflute/_project.bat 2008-12-27 22:11:51 UTC (rev 1627) +++ notepad/trunk/dbflute/_project.bat 2008-12-27 22:13:37 UTC (rev 1628) @@ -2,4 +2,4 @@ set MY_PROJECT_NAME=notepad -set DBFLUTE_HOME=..\mydbflute\dbflute-0.8.2 +set DBFLUTE_HOME=..\mydbflute\dbflute-0.8.7 Modified: notepad/trunk/dbflute/_project.sh =================================================================== --- notepad/trunk/dbflute/_project.sh 2008-12-27 22:11:51 UTC (rev 1627) +++ notepad/trunk/dbflute/_project.sh 2008-12-27 22:13:37 UTC (rev 1628) @@ -2,4 +2,4 @@ export MY_PROJECT_NAME=notepad -export DBFLUTE_HOME=../mydbflute/dbflute-0.8.2 +export DBFLUTE_HOME=../mydbflute/dbflute-0.8.7 Modified: notepad/trunk/dbflute/build-notepad.properties =================================================================== --- notepad/trunk/dbflute/build-notepad.properties 2008-12-27 22:11:51 UTC (rev 1627) +++ notepad/trunk/dbflute/build-notepad.properties 2008-12-27 22:13:37 UTC (rev 1628) @@ -157,5 +157,5 @@ torque.additionalForeignKeyMap = map:{ \ } -#torque.isDeleteOldTableClass = true +torque.isDeleteOldTableClass = true Modified: notepad/trunk/mydbflute/README.txt =================================================================== --- notepad/trunk/mydbflute/README.txt 2008-12-27 22:11:51 UTC (rev 1627) +++ notepad/trunk/mydbflute/README.txt 2008-12-27 22:13:37 UTC (rev 1628) @@ -1,3 +1,3 @@ -$ mkdir dbflute-0.8.2 -$ cd dbflute-0.8.2 -$ unzip ../dbflute-0.8.2.zip +$ mkdir dbflute-0.8.7 +$ cd dbflute-0.8.7 +$ unzip ../dbflute-0.8.7.zip Modified: notepad/trunk/src/main/config/erd/notepad.erd =================================================================== --- notepad/trunk/src/main/config/erd/notepad.erd 2008-12-27 22:11:51 UTC (rev 1627) +++ notepad/trunk/src/main/config/erd/notepad.erd 2008-12-27 22:13:37 UTC (rev 1628) @@ -204,6 +204,22 @@ + status + Status + + VARCHAR + String + true + 12 + + 1 + false + false + + false + + + created_time Created Time @@ -233,7 +249,7 @@ updated_time Updated Time - + 10 true false @@ -255,7 +271,7 @@ deleted_time Deleted Time - + 10 false false @@ -292,6 +308,11 @@ + + 255 + 255 + 206 + 441 802 @@ -384,7 +405,7 @@ created_time Created Time - + 10 true false @@ -406,7 +427,7 @@ updated_time Updated Time - + 10 true false @@ -428,7 +449,7 @@ deleted_time Deleted Time - + 10 false false @@ -450,7 +471,7 @@ versionNo Version No. - + 10 true false @@ -460,6 +481,11 @@ + + 255 + 255 + 206 + 40 1322 @@ -529,6 +555,11 @@ + + 255 + 255 + 206 + 44 491 @@ -686,7 +717,7 @@ created_time Created Time - + 10 true false @@ -708,7 +739,7 @@ updated_time Updated Time - + 10 true false @@ -730,7 +761,7 @@ deleted_time Deleted Time - + 10 false false @@ -752,7 +783,7 @@ versionNo Version No. - + 10 true false @@ -762,6 +793,11 @@ + + 255 + 255 + 206 + 620 1322 @@ -826,6 +862,11 @@ + + 255 + 255 + 206 + 628 491 @@ -1081,6 +1122,11 @@ + + 255 + 255 + 206 + 456 180 @@ -1265,6 +1311,11 @@ + + 255 + 255 + 206 + 305 491 @@ -1403,6 +1454,11 @@ + + 255 + 255 + 206 + 478 40 Modified: notepad/trunk/src/main/config/sql/notepad.ddl =================================================================== --- notepad/trunk/src/main/config/sql/notepad.ddl 2008-12-27 22:11:51 UTC (rev 1627) +++ notepad/trunk/src/main/config/sql/notepad.ddl 2008-12-27 22:13:37 UTC (rev 1628) @@ -7,9 +7,9 @@ DROP TABLE role_info; DROP TABLE group_info; -/********************************** -Table Name: Group Information -**********************************/ +/**********************************/ +/* Table Name: Group Information */ +/**********************************/ CREATE TABLE group_info( group_id VARCHAR(255) NOT NULL PRIMARY KEY, name VARCHAR(100), @@ -26,9 +26,9 @@ versionNo INTEGER NOT NULL ); -/********************************** -Table Name: Role Information -**********************************/ +/**********************************/ +/* Table Name: Role Information */ +/**********************************/ CREATE TABLE role_info( role_id VARCHAR(255) NOT NULL PRIMARY KEY, name VARCHAR(100), @@ -45,9 +45,9 @@ versionNo INTEGER NOT NULL ); -/********************************** -Table Name: User Information -**********************************/ +/**********************************/ +/* Table Name: User Information */ +/**********************************/ CREATE TABLE user_info( user_id VARCHAR(255) NOT NULL PRIMARY KEY, given_name VARCHAR(100), @@ -64,6 +64,7 @@ locale VARCHAR(5), role_id VARCHAR(255), group_id VARCHAR(255), + status VARCHAR(1), created_time TIMESTAMP NOT NULL, created_by VARCHAR(255) NOT NULL, updated_time TIMESTAMP NOT NULL, @@ -75,9 +76,9 @@ FOREIGN KEY (role_id) REFERENCES role_info (role_id) ); -/********************************** -Table Name: Group Mapping -**********************************/ +/**********************************/ +/* Table Name: Group Mapping */ +/**********************************/ CREATE TABLE group_mapping( id INTEGER NOT NULL IDENTITY PRIMARY KEY, user_id VARCHAR(255) NOT NULL, @@ -86,9 +87,9 @@ FOREIGN KEY (group_id) REFERENCES group_info (group_id) ); -/********************************** -Table Name: Role Mapping -**********************************/ +/**********************************/ +/* Table Name: Role Mapping */ +/**********************************/ CREATE TABLE role_mapping( id INT NOT NULL IDENTITY PRIMARY KEY, user_id VARCHAR(255) NOT NULL, @@ -97,9 +98,9 @@ FOREIGN KEY (role_id) REFERENCES role_info (role_id) ); -/********************************** -Table Name: Notepad Category -**********************************/ +/**********************************/ +/* Table Name: Notepad Category */ +/**********************************/ CREATE TABLE notepad_category( id INTEGER NOT NULL IDENTITY PRIMARY KEY, name VARCHAR(100) NOT NULL, @@ -116,9 +117,9 @@ FOREIGN KEY (updated_by) REFERENCES user_info (user_id) ); -/********************************** -Table Name: Notepad -**********************************/ +/**********************************/ +/* Table Name: Notepad */ +/**********************************/ CREATE TABLE notepad( id BIGINT(20) NOT NULL IDENTITY PRIMARY KEY, title VARCHAR(100) NOT NULL, @@ -136,9 +137,9 @@ FOREIGN KEY (updated_by) REFERENCES user_info (user_id) ); -/********************************** -Table Name: Notepad Content -**********************************/ +/**********************************/ +/* Table Name: Notepad Content */ +/**********************************/ CREATE TABLE notepad_content( id BIGINT(20) NOT NULL PRIMARY KEY, content VARCHAR(4000), Modified: notepad/trunk/src/main/config/sql/notepad.dml =================================================================== --- notepad/trunk/src/main/config/sql/notepad.dml 2008-12-27 22:11:51 UTC (rev 1627) +++ notepad/trunk/src/main/config/sql/notepad.dml 2008-12-27 22:13:37 UTC (rev 1628) @@ -1,3 +1,3 @@ -insert into user_info (USER_ID, CREATED_TIME, CREATED_BY, UPDATED_TIME, UPDATED_BY, VERSIONNO) values ('admin', '2008-10-15 17:17:37', 'admin', '2008-10-15 17:17:37', 'admin', 0); +insert into user_info (USER_ID, CREATED_TIME, CREATED_BY, UPDATED_TIME, UPDATED_BY, VERSIONNO, STATUS) values ('admin', '2008-10-15 17:17:37', 'admin', '2008-10-15 17:17:37', 'admin', 0, 'A'); insert into NOTEPAD_CATEGORY (ID, NAME, CREATED_TIME, CREATED_BY, SORT_ORDER, UPDATED_TIME, UPDATED_BY, VERSIONNO, TYPE) values (1, '(Unclassified)', '2008-10-15 17:17:37', 'admin', 1, '2008-10-15 17:17:37', 'admin', 0, 'P'); insert into NOTEPAD_CATEGORY (ID, NAME, CREATED_TIME, CREATED_BY, SORT_ORDER, UPDATED_TIME, UPDATED_BY, VERSIONNO, TYPE) values (2, '(Shared)', '2008-10-15 17:17:37', 'admin', 1, '2008-10-15 17:17:37', 'admin', 0, 'P'); Modified: notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/BehaviorSelector.java =================================================================== --- notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/BehaviorSelector.java 2008-12-27 22:11:51 UTC (rev 1627) +++ notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/BehaviorSelector.java 2008-12-27 22:13:37 UTC (rev 1628) @@ -10,8 +10,7 @@ public interface BehaviorSelector { /** - * Initialize condition-bean meta data.
If you call this, Hot Deploy - * of OutsideSql becomes Cool! + * Initialize condition-bean meta data.
*/ public void initializeConditionBeanMetaData(); Modified: notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/CacheBehaviorSelector.java =================================================================== --- notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/CacheBehaviorSelector.java 2008-12-27 22:11:51 UTC (rev 1627) +++ notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/CacheBehaviorSelector.java 2008-12-27 22:13:37 UTC (rev 1628) @@ -1,8 +1,8 @@ package jp.sf.pal.notepad.db.allcommon; import java.util.Collection; -import java.util.LinkedHashMap; import java.util.Map; +import java.util.concurrent.ConcurrentHashMap; import jp.sf.pal.notepad.db.allcommon.bhv.BehaviorReadable; import jp.sf.pal.notepad.db.allcommon.dbmeta.DBMeta; @@ -31,15 +31,14 @@ // Attribute // ========= /** The cache of behavior. (It's the generic hell!) */ - protected Map, BehaviorReadable> _behaviorCache = new LinkedHashMap, BehaviorReadable>(); + protected Map, BehaviorReadable> _behaviorCache = new ConcurrentHashMap, BehaviorReadable>(); //========================================================================== // ========= // Initialize // ========== /** - * Initialize condition-bean meta data.
If you call this, Hot Deploy - * of OutsideSql becomes Cool! + * Initialize condition-bean meta data.
*/ public void initializeConditionBeanMetaData() { final Map dbmetaMap = DBMetaInstanceHandler @@ -53,8 +52,7 @@ } for (DBMeta dbmeta : dbmetas) { final BehaviorReadable bhv = byName(dbmeta.getTableDbName()); - final DaoReadable dao = bhv.getDaoReadable(); - dao.initializeDaoMetaData("selectList"); + bhv.warmUpCommand(); } if (_log.isInfoEnabled()) { long after = System.currentTimeMillis(); Added: notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/CommonColumnAutoSetupper.java =================================================================== --- notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/CommonColumnAutoSetupper.java (rev 0) +++ notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/CommonColumnAutoSetupper.java 2008-12-27 22:13:37 UTC (rev 1628) @@ -0,0 +1,25 @@ +package jp.sf.pal.notepad.db.allcommon; + +/** + * The auto set-upper of common column. + * + * @author DBFlute(AutoGenerator) + */ +public interface CommonColumnAutoSetupper { + + /** + * Handle common columns of insert if it needs. + * + * @param targetEntity Target entity that the type is entity interface. + * (NotNull) + */ + public void handleCommonColumnOfInsertIfNeeds(Entity targetEntity); + + /** + * Handle common columns of update if it needs. + * + * @param targetEntity Target entity that the type is entity interface. + * (NotNull) + */ + public void handleCommonColumnOfUpdateIfNeeds(Entity targetEntity); +} Property changes on: notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/CommonColumnAutoSetupper.java ___________________________________________________________________ Name: svn:eol-style + native Added: notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/CommonColumnBasicAutoSetupper.java =================================================================== --- notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/CommonColumnBasicAutoSetupper.java (rev 0) +++ notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/CommonColumnBasicAutoSetupper.java 2008-12-27 22:13:37 UTC (rev 1628) @@ -0,0 +1,31 @@ +package jp.sf.pal.notepad.db.allcommon; + +/** + * The basic implementation of the auto set-upper of common column. + * + * @author DBFlute(AutoGenerator) + */ +public class CommonColumnBasicAutoSetupper implements CommonColumnAutoSetupper { + + //========================================================================== + // =========== + // Set up + // ====== + /** + * Handle common columns of insert if it needs. + * + * @param targetEntity Target entity that the type is entity interface. + * (NotNull) + */ + public void handleCommonColumnOfInsertIfNeeds(Entity targetEntity) { + } + + /** + * Handle common columns of update if it needs. + * + * @param targetEntity Target entity that the type is entity interface. + * (NotNull) + */ + public void handleCommonColumnOfUpdateIfNeeds(Entity targetEntity) { + } +} Property changes on: notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/CommonColumnBasicAutoSetupper.java ___________________________________________________________________ Name: svn:eol-style + native Added: notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/DBDef.java =================================================================== --- notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/DBDef.java (rev 0) +++ notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/DBDef.java 2008-12-27 22:13:37 UTC (rev 1628) @@ -0,0 +1,179 @@ +package jp.sf.pal.notepad.db.allcommon; + +import java.util.Collections; +import java.util.HashMap; +import java.util.Iterator; +import java.util.Map; +import java.util.Set; + +/** + * The definition of database. + * + * @author DBFlute(AutoGenerator) + */ +public enum DBDef { + + //========================================================================== + // ========= + // ENUM + // ==== + MySQL("mysql", null), PostgreSQL("postgresql", "postgre"), Oracle("oracle", + null), DB2("db2", null), SQLServer("sqlserver", "mssql"), FireBird( + "firebird", null), H2("h2", null), Derby("derby", null), MSAccess( + "msaccess", null), Unknown("unknown", null); + + //========================================================================== + // ========= + // Static Reference + // ================ + // ----------------------------------------------------- + // Code Value + // ---------- + private static final Map _codeValueMap = new HashMap(); + static { + for (DBDef value : values()) { + _codeValueMap.put(value.code().toLowerCase(), value); + } + } + + private static final Map _codeAliasValueMap = new HashMap(); + static { + for (DBDef value : values()) { + if (value.codeAlias() != null) { + _codeAliasValueMap.put(value.codeAlias().toLowerCase(), value); + } + } + } + + /** + * @param code The code of the DB. (Nullable: If the code is null, it + * returns null) + * @return The instance that has the code. (Nullable) + */ + public static DBDef codeOf(String code) { + if (code == null) { + return null; + } + final String lowerCaseCode = code.toLowerCase(); + DBDef def = _codeValueMap.get(lowerCaseCode); + if (def == null) { + def = _codeAliasValueMap.get(lowerCaseCode); + } + return def; + } + + // ----------------------------------------------------- + // Driver Hint + // ----------- + private static final Map _driverHintMap; + static { + final Map tmpMap = new HashMap(); + tmpMap.put("mysql", MySQL); + tmpMap.put("postgresql", PostgreSQL); + tmpMap.put("oracle", Oracle); + tmpMap.put("db2", DB2); + tmpMap.put("sqlserver", SQLServer); + tmpMap.put("firebird", FireBird); + tmpMap.put("org.h2", H2); + tmpMap.put("org.apache.derby", Derby); + _driverHintMap = Collections.unmodifiableMap(tmpMap); + } + + public static DBDef byDriverClassName(String driverClassName) { + final Set keySet = _driverHintMap.keySet(); + for (final Iterator ite = keySet.iterator(); ite.hasNext();) { + final String driverHint = ite.next(); + if (driverClassName.indexOf(driverHint) >= 0) { + final DBDef dbdef = _driverHintMap.get(driverHint); + if (dbdef != null) { + return dbdef; + } + } + } + return null; + } + + //========================================================================== + // ========= + // Current Definition + // ================== + /** The current definition of database. (NotNull, Default 'Unknown') */ + private static DBDef _currentDef; + static { + _currentDef = codeOf("H2"); + if (_currentDef == null) { + _currentDef = Unknown; + } + } + + /** + * @return The current definition of database. (NotNull) + */ + public static DBDef getCurrentDef() { + return _currentDef; + } + + /** + * @param currentDef The current definition of database. (NotNull) + */ + public static void setCurrentDef(DBDef currentDef) { + if (currentDef == null) { + String msg = "The argument 'currentDef' should not be null at DBDef.setCurrentDef()"; + throw new IllegalArgumentException(msg); + } + _currentDef = currentDef; + } + + /** + * @param dbdef The definition of database. (NotNull) + * @return Is the definition of database current? + */ + public static boolean isCurrentDef(DBDef dbdef) { + if (dbdef == null) { + String msg = "The argument 'dbdef' should not be null at DBDef.isCurrentDef()"; + throw new IllegalArgumentException(msg); + } + return _currentDef != null ? _currentDef.equals(dbdef) : false; + } + + //========================================================================== + // ========= + // Attribute + // ========= + /** The code of the DB. (NotNull) */ + private String _code; + + /** The code alias of the DB. (Nullable) */ + private String _codeAlias; + + //========================================================================== + // ========= + // Constructor + // =========== + /** + * @param code The code of the DB. (NotNull) + * @param codeAlias The code alias of the DB. (Nullable) + */ + private DBDef(String code, String codeAlias) { + _code = code; + _codeAlias = codeAlias; + } + + //========================================================================== + // ========= + // Accessor + // ======== + /** + * @return The code of the DB. (NotNull) + */ + public String code() { + return _code; + } + + /** + * @return The code alias of the DB. (Nullable) + */ + private String codeAlias() { + return _codeAlias; + } +} Property changes on: notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/DBDef.java ___________________________________________________________________ Name: svn:eol-style + native Modified: notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/DBFluteConfig.java =================================================================== --- notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/DBFluteConfig.java 2008-12-27 22:11:51 UTC (rev 1627) +++ notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/DBFluteConfig.java 2008-12-27 22:13:37 UTC (rev 1628) @@ -24,10 +24,6 @@ // ========= protected StatementConfig _defaultStatementConfig; - protected boolean _conditionBeanFormatSql = true;// This is for - - // compatibility! - protected boolean _queryLogLevelInfo; protected boolean _executeStatusLogLevelInfo; @@ -36,10 +32,6 @@ protected UniqueConstraintDeterminator _uniqueConstraintDeterminator; - protected boolean _sqlExceptionOldStyleHandling = false;// This is for - - // compatibility! - protected String _logDateFormat; protected String _logTimestampFormat; @@ -92,27 +84,6 @@ //========================================================================== // ========= - // ConditionBean Format Sql - // ======================== - public boolean isConditionBeanFormatSql() { - return _conditionBeanFormatSql; - } - - /** - * @param conditionBeanFormatSql The value of the config. - * @deprecated This is for compatibility! - */ - public void setConditionBeanFormatSql(boolean conditionBeanFormatSql) { - assertNotLocked(); - if (_log.isInfoEnabled()) { - _log.info("...Setting conditionBeanFormatSql: " - + conditionBeanFormatSql); - } - _conditionBeanFormatSql = conditionBeanFormatSql; - } - - //========================================================================== - // ========= // Query Log Level Info // ==================== public boolean isQueryLogLevelInfo() { @@ -184,31 +155,8 @@ public boolean isUniqueConstraintException(Throwable t); } - // [DBFlute-0.7.7] //========================================================================== // ========= - // SQL Exception Old Style - // ======================= - public boolean isSqlExceptionOldStyleHandling() { - return _sqlExceptionOldStyleHandling; - } - - /** - * @param sqlExceptionOldStyleHandling The value of the config. - * @deprecated This is for compatibility! - */ - public void setSqlExceptionOldStyleHandling( - boolean sqlExceptionOldStyleHandling) { - assertNotLocked(); - if (_log.isInfoEnabled()) { - _log.info("...Setting sqlExceptionOldStyleHandling: " - + sqlExceptionOldStyleHandling); - } - _sqlExceptionOldStyleHandling = sqlExceptionOldStyleHandling; - } - - //========================================================================== - // ========= // Log Format // ========== public String getLogDateFormat() { @@ -303,7 +251,6 @@ // ============ public void clear() { // the only properties that update OK while executing _defaultStatementConfig = null; - _conditionBeanFormatSql = true; // as default _queryLogLevelInfo = false; _executeStatusLogLevelInfo = false; _useSqlLogRegistry = false; Modified: notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/EntityDefinedCommonColumn.java =================================================================== --- notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/EntityDefinedCommonColumn.java 2008-12-27 22:11:51 UTC (rev 1627) +++ notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/EntityDefinedCommonColumn.java 2008-12-27 22:13:37 UTC (rev 1628) @@ -8,6 +8,12 @@ public interface EntityDefinedCommonColumn extends Entity { /** + * Enable common column auto set up. {for after disable because the default + * is enabled} + */ + public void enableCommonColumnAutoSetup(); + + /** * Disable common column auto set up. */ public void disableCommonColumnAutoSetup(); Modified: notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/bhv/AbstractBehaviorReadable.java =================================================================== --- notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/bhv/AbstractBehaviorReadable.java 2008-12-27 22:11:51 UTC (rev 1627) +++ notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/bhv/AbstractBehaviorReadable.java 2008-12-27 22:13:37 UTC (rev 1628) @@ -11,10 +11,16 @@ import java.util.Set; import jp.sf.pal.notepad.db.allcommon.BehaviorSelector; -import jp.sf.pal.notepad.db.allcommon.DaoSelector; import jp.sf.pal.notepad.db.allcommon.Entity; import jp.sf.pal.notepad.db.allcommon.bhv.batch.TokenFileOutputOption; import jp.sf.pal.notepad.db.allcommon.bhv.batch.TokenFileOutputResult; +import jp.sf.pal.notepad.db.allcommon.bhv.core.BehaviorCommand; +import jp.sf.pal.notepad.db.allcommon.bhv.core.BehaviorCommandInvoker; +import jp.sf.pal.notepad.db.allcommon.bhv.core.command.AbstractBehaviorCommand; +import jp.sf.pal.notepad.db.allcommon.bhv.core.command.SelectCountCBCommand; +import jp.sf.pal.notepad.db.allcommon.bhv.core.command.SelectListCBCommand; +import jp.sf.pal.notepad.db.allcommon.bhv.core.command.SelectNextValCommand; +import jp.sf.pal.notepad.db.allcommon.bhv.core.command.SelectScalarCBCommand; import jp.sf.pal.notepad.db.allcommon.bhv.load.LoadReferrerOption; import jp.sf.pal.notepad.db.allcommon.bhv.setup.ValueLabelBox; import jp.sf.pal.notepad.db.allcommon.bhv.setup.ValueLabelSetupper; @@ -25,8 +31,9 @@ import jp.sf.pal.notepad.db.allcommon.cbean.PagingHandler; import jp.sf.pal.notepad.db.allcommon.cbean.PagingInvoker; import jp.sf.pal.notepad.db.allcommon.cbean.PagingResultBean; -import jp.sf.pal.notepad.db.allcommon.cbean.outsidesql.OutsideSqlDao; +import jp.sf.pal.notepad.db.allcommon.cbean.ScalarQuery; import jp.sf.pal.notepad.db.allcommon.cbean.outsidesql.executor.OutsideSqlBasicExecutor; +import jp.sf.pal.notepad.db.allcommon.cbean.sqlclause.SqlClause; import jp.sf.pal.notepad.db.allcommon.dbmeta.info.ColumnInfo; import jp.sf.pal.notepad.db.allcommon.helper.token.file.FileMakingHeaderInfo; import jp.sf.pal.notepad.db.allcommon.helper.token.file.FileMakingOption; @@ -35,11 +42,10 @@ import jp.sf.pal.notepad.db.allcommon.util.SimpleSystemUtil; /** - * The abstract class of behavior-readable. + * The abstract class of readable behavior. * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public abstract class AbstractBehaviorReadable implements BehaviorReadable { //========================================================================== @@ -50,13 +56,13 @@ * Behavior-selector instance. It's basically referred at loadReferrer. * (Required for loadReferrer) */ - protected BehaviorSelector _behaviorSelector; + protected BehaviorCommandInvoker _behaviorCommandInvoker; /** - * Dao-selector instance. It's basically referred at loadReferrer. (Required - * for OutsideSql) + * Behavior-selector instance. It's basically referred at loadReferrer. + * (Required for loadReferrer) */ - protected DaoSelector _daoSelector; + protected BehaviorSelector _behaviorSelector; //========================================================================== // =========== @@ -83,7 +89,7 @@ * @return Read count. (NotNull) */ public int readCount(ConditionBean cb) { - assertConditionBeanNotNull(cb); + assertCBNotNull(cb); return callReadCount(cb); } @@ -100,7 +106,7 @@ * When the entity has been duplicated. */ public Entity readEntity(ConditionBean cb) { - assertConditionBeanNotNull(cb); + assertCBNotNull(cb); final List ls = readList(cb); if (ls.isEmpty()) { return null; @@ -120,7 +126,7 @@ * When the entity has been duplicated. */ public Entity readEntityWithDeletedCheck(ConditionBean cb) { - assertConditionBeanNotNull(cb); + assertCBNotNull(cb); final List ls = readList(cb); assertEntityNotDeleted(ls, cb); assertEntitySelectedAsOne(ls, cb); @@ -133,7 +139,7 @@ // =========================== protected ENTITY helpSelectEntityInternally( CB cb, InternalSelectEntityCallback callback) { - assertConditionBeanNotNull(cb); + assertCBNotNull(cb); cb.checkSafetyResult(1); List ls = null; try { @@ -156,7 +162,7 @@ protected ENTITY helpSelectEntityWithDeletedCheckInternally( CB cb, InternalSelectEntityWithDeletedCheckCallback callback) { - assertConditionBeanNotNull(cb); + assertCBNotNull(cb); cb.checkSafetyResult(1); List ls = null; try { @@ -175,7 +181,7 @@ } //========================================================================== - // =========== + // ========= // List Read // ========= /** @@ -186,7 +192,7 @@ * list. (NotNull) */ public ListResultBean readList(ConditionBean cb) { - assertConditionBeanNotNull(cb); + assertCBNotNull(cb); return new jp.sf.pal.notepad.db.allcommon.cbean.ResultBeanBuilder( getTableDbName()).buildListResultBean(cb, callReadList(cb)); } @@ -198,7 +204,7 @@ * @return Read page. (NotNull) */ public PagingResultBean readPage(final ConditionBean cb) { - assertConditionBeanNotNull(cb); + assertCBNotNull(cb); final PagingInvoker invoker = new PagingInvoker( getTableDbName()); final PagingHandler handler = new PagingHandler() { @@ -225,8 +231,7 @@ * @exception jp.sf.pal.notepad.db.allcommon.exception.EntityAlreadyDeletedException * When the entity has already been deleted. */ - protected void assertEntityNotDeleted( - jp.sf.pal.notepad.db.allcommon.Entity entity, Object searchKey4Log) { + protected void assertEntityNotDeleted(Entity entity, Object searchKey4Log) { if (entity == null) { throwEntityAlreadyDeletedException(searchKey4Log); } @@ -239,7 +244,8 @@ * @param searchKey4Log Search-key for Logging. (NotNull) * @exception jp.sf.pal.notepad.db.allcommon.exception.EntityAlreadyDeletedException */ - protected void assertEntityNotDeleted(List ls, Object searchKey4Log) { + protected void assertEntityNotDeleted(List ls, + Object searchKey4Log) { if (ls == null || ls.isEmpty()) { throwEntityAlreadyDeletedException(searchKey4Log); } @@ -253,7 +259,8 @@ * @exception jp.sf.pal.notepad.db.allcommon.exception.EntityAlreadyDeletedException * @exception jp.sf.pal.notepad.db.allcommon.exception.EntityDuplicatedException */ - protected void assertEntitySelectedAsOne(List ls, Object searchKey4Log) { + protected void assertEntitySelectedAsOne(List ls, + Object searchKey4Log) { if (ls == null || ls.isEmpty()) { throwEntityAlreadyDeletedException(searchKey4Log); } @@ -274,49 +281,254 @@ //========================================================================== // ========= - // Various Select - // ============== - public OutsideSqlBasicExecutor outsideSql() { - assertDaoSelectorNotNull("outsideSql"); - final OutsideSqlDao outsideSqlDao = _daoSelector - .select(OutsideSqlDao.class); - return new OutsideSqlBasicExecutor(outsideSqlDao, getTableDbName()); - } + // Scalar Select + // ============= + /** + * The scalar function.
This is not static class because this uses + * the method 'invoke(BehaviorCommand)' + * + * @param The type of condition-bean. + * @param The type of result. + */ + public class SLFunction { // SL: ScaLar - private void assertDaoSelectorNotNull(String methodName) { - if (_daoSelector == null) { + /** The condition-bean for scalar select. (NotNull) */ + protected CB _conditionBean; + + /** The condition-bean for scalar select. (NotNull) */ + protected Class _resultType; + + /** + * @param conditionBean The condition-bean initialized only for scalar + * select. (NotNull) + * @param resultType The type os result. (NotNull) + */ + public SLFunction(CB conditionBean, Class resultType) { + _conditionBean = conditionBean; + _resultType = resultType; + } + + /** + * Select the maximum value.
+ * + *
+         * memberBhv.scalarSelect(Date.class).max(new ScalarQuery(MemberCB cb) {
+         *     cb.specify().columnMemberBirthday(); // the required specification of target column
+         *     cb.query().setMemberStatusCode_Equal_Formalized(); // query as you like it
+         * });
+         * 
+ * + * @param scalarQuery The query for scalar. (NotNull) + * @return The maximum value. (Nullable) + */ + public RESULT max(ScalarQuery scalarQuery) { + assertObjectNotNull("scalarQuery", scalarQuery); + return exec(scalarQuery, SqlClause.SelectClauseType.MAX); + } + + /** + * Select the minimum value.
+ * + *
+         * memberBhv.scalarSelect(Date.class).min(new ScalarQuery(MemberCB cb) {
+         *     cb.specify().columnMemberBirthday(); // the required specification of target column
+         *     cb.query().setMemberStatusCode_Equal_Formalized(); // query as you like it
+         * });
+         * 
+ * + * @param scalarQuery The query for scalar. (NotNull) + * @return The minimum value. (Nullable) + */ + public RESULT min(ScalarQuery scalarQuery) { + assertObjectNotNull("scalarQuery", scalarQuery); + return exec(scalarQuery, SqlClause.SelectClauseType.MIN); + } + + /** + * Select the summary value.
+ * + *
+         * purchaseBhv.scalarSelect(Integer.class).sum(new ScalarQuery(PurchaseCB cb) {
+         *     cb.specify().columnPurchaseCount(); // the required specification of target column
+         *     cb.query().setPurchaseDatetime_GreaterEqual(date); // query as you like it
+         * });
+         * 
+ * + * @param scalarQuery The query for scalar. (NotNull) + * @return The summary value. (Nullable) + */ + public RESULT sum(ScalarQuery scalarQuery) { + assertObjectNotNull("scalarQuery", scalarQuery); + return exec(scalarQuery, SqlClause.SelectClauseType.SUM); + } + + /** + * Select the average value.
+ * + *
+         * purchaseBhv.scalarSelect(Integer.class).avg(new ScalarQuery(PurchaseCB cb) {
+         *     cb.specify().columnPurchaseCount(); // the required specification of target column
+         *     cb.query().setPurchaseDatetime_GreaterEqual(date); // query as you like it
+         * });
+         * 
+ * + * @param scalarQuery The query for scalar. (NotNull) + * @return The average value. (Nullable) + */ + public RESULT avg(ScalarQuery scalarQuery) { + assertObjectNotNull("scalarQuery", scalarQuery); + return exec(scalarQuery, SqlClause.SelectClauseType.AVG); + } + + protected RESULT exec(ScalarQuery scalarQuery, + SqlClause.SelectClauseType selectClauseType) { + assertObjectNotNull("scalarQuery", scalarQuery); + assertObjectNotNull("selectClauseType", selectClauseType); + assertObjectNotNull("conditionBean", _conditionBean); + assertObjectNotNull("resultType", _resultType); + scalarQuery.query(_conditionBean); + assertScalarSelectRequiredSpecifyColumn(); + return invoke(createSelectScalarCBCommand(_conditionBean, + _resultType, selectClauseType)); + } + + protected void assertScalarSelectRequiredSpecifyColumn() { + final String columnName = _conditionBean.getSqlClause() + .getSpecifiedColumnNameAsOne(); + if (columnName == null) { + throwScalarSelectInvalidColumnSpecificationException(); + } + } + + protected void throwScalarSelectInvalidColumnSpecificationException() { String msg = "Look! Read the message below." + getLineSeparator(); msg = msg + "/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *" + getLineSeparator(); - msg = msg - + "Not found the selector of dao as behavior's attributed!" + msg = msg + "The specified column for scalar select was Invalid!" + getLineSeparator(); msg = msg + getLineSeparator(); msg = msg + "[Advice]" + getLineSeparator(); msg = msg - + "Please confirm the definition of the selector at your 'dbflute.dicon'." + + " You should call specify().column[TargetColumn]() only once." + getLineSeparator(); - msg = msg + "It is precondition that '" + methodName - + "()' needs the selector instance." + getLineSeparator(); - msg = msg + getLineSeparator(); - msg = msg + "[Your Behavior's Attributes]" + getLineSeparator(); - msg = msg + " _behaviorSelector : " + _behaviorSelector + msg = msg + " For example:" + getLineSeparator(); + msg = msg + " " + getLineSeparator(); + msg = msg + " [Wrong]" + getLineSeparator(); + msg = msg + " /- - - - - - - - - - - - - - - - - - - - " + getLineSeparator(); - msg = msg + " _daoSelector : " + _daoSelector + msg = msg + + " memberBhv.scalarSelect(Date.class).max(new ScalarQuery() {" + getLineSeparator(); - msg = msg + "* * * * * * * * * */" + getLineSeparator(); - throw new IllegalStateException(msg); + msg = msg + " public void query(MemberCB cb) {" + + getLineSeparator(); + msg = msg + " // *No! It's empty!" + getLineSeparator(); + msg = msg + " }" + getLineSeparator(); + msg = msg + " });" + getLineSeparator(); + msg = msg + " - - - - - - - - - -/" + getLineSeparator(); + msg = msg + " " + getLineSeparator(); + msg = msg + " [Wrong]" + getLineSeparator(); + msg = msg + " /- - - - - - - - - - - - - - - - - - - - " + + getLineSeparator(); + msg = msg + + " memberBhv.scalarSelect(Date.class).max(new ScalarQuery() {" + + getLineSeparator(); + msg = msg + " public void query(MemberCB cb) {" + + getLineSeparator(); + msg = msg + " cb.specify().columnMemberBirthday();" + + getLineSeparator(); + msg = msg + + " cb.specify().columnRegisterDatetime(); // *No! It's duplicated!" + + getLineSeparator(); + msg = msg + " }" + getLineSeparator(); + msg = msg + " });" + getLineSeparator(); + msg = msg + " - - - - - - - - - -/" + getLineSeparator(); + msg = msg + " " + getLineSeparator(); + msg = msg + " [Good!]" + getLineSeparator(); + msg = msg + " /- - - - - - - - - - - - - - - - - - - - " + + getLineSeparator(); + msg = msg + + " memberBhv.scalarSelect(Date.class).max(new ScalarQuery() {" + + getLineSeparator(); + msg = msg + " public void query(MemberCB cb) {" + + getLineSeparator(); + msg = msg + + " cb.specify().columnMemberBirthday(); // *Point!" + + getLineSeparator(); + msg = msg + " }" + getLineSeparator(); + msg = msg + " });" + getLineSeparator(); + msg = msg + " - - - - - - - - - -/" + getLineSeparator(); + msg = msg + getLineSeparator(); + msg = msg + "[ConditionBean Type]" + getLineSeparator() + + _conditionBean.getClass().getName() + getLineSeparator(); + msg = msg + getLineSeparator(); + msg = msg + "[Result Type]" + getLineSeparator() + + _resultType.getName() + getLineSeparator(); + msg = msg + "* * * * * * * * * */"; + throw new ScalarSelectInvalidColumnSpecificationException(msg); } } + public static class ScalarSelectInvalidColumnSpecificationException extends + RuntimeException { + private static final long serialVersionUID = 1L; + + public ScalarSelectInvalidColumnSpecificationException(String msg) { + super(msg); + } + } + + //========================================================================== + // ========= + // OutsideSql + // ========== /** - * Create value-label list. + * Get the basic executor of outside-SQL.
The invoker of behavior + * command should be not null when you call this method. * + *
+     * You can use the methods for outside-SQL are as follows:
+     * {Basic}
+     *   o selectList()
+     *   o execute()
+     *   o call()
+     * 
+     * {Entity}
+     *   o entityHandling().selectEntity()
+     *   o entityHandling().selectEntityWithDeletedCheck()
+     * 
+     * {Cursor}
+     *   o cursorHandling().selectCursor()
+     * 
+     * {Paging}
+     *   o autoPaging().selectList()
+     *   o autoPaging().selectPage()
+     *   o manualPaging().selectList()
+     *   o manualPaging().selectPage()
+     * 
+     * {Option -- Dynamic}
+     *   o dynamicBinding().selectList()
+     * 
+ * + * @return The basic executor of outside-SQL. (NotNull) + */ + public OutsideSqlBasicExecutor outsideSql() { + assertBehaviorCommandInvoker("outsideSql"); + return new OutsideSqlBasicExecutor(_behaviorCommandInvoker, + getTableDbName()); + } + + //========================================================================== + // ========= + // Various Select + // ============== + /** + * Create the list of value-label. + * * @param The type of entity. * @param entityList The list of entity. (NotNull) - * @param valueLabelSetupper Value-label-setupper. (NotNull) - * @return Value-label list. (NotNull) + * @param valueLabelSetupper The setupper of value-label. (NotNull) + * @return The list of value-label. (NotNull) */ public List> createValueLabelList( List entityList, @@ -362,10 +574,10 @@ } } - protected Object helpConvertingSequenceObject(Class resultClass, + protected Object helpConvertingSequenceObject(Class resultClass, Object sequenceObject) { try { - final Constructor constructor = resultClass + final Constructor constructor = resultClass .getConstructor(new Class[] { String.class }); return constructor.newInstance(new Object[] { sequenceObject .toString() }); @@ -534,6 +746,7 @@ * @param value The value of primary key. (Nullable) * @return The value of primary key. (Nullable) */ + @SuppressWarnings("unchecked") protected PK toLowerCasePrimaryKeyIfString(PK value) { return (PK) toLowerCaseIfString(value); } @@ -580,22 +793,22 @@ + "/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *" + getLineSeparator(); msg = msg - + "Not found the selector of behavior as behavior's attributed!" + + "Not found the selector of behavior as behavior's attribute!" + getLineSeparator(); msg = msg + getLineSeparator(); msg = msg + "[Advice]" + getLineSeparator(); msg = msg - + "Please confirm the definition of the selector at your 'dbflute.dicon'." + + "Please confirm the definition of the selector at your component configuration of DBFlute." + getLineSeparator(); msg = msg + "It is precondition that '" + methodName + "()' needs the selector instance." + getLineSeparator(); msg = msg + getLineSeparator(); msg = msg + "[Your Behavior's Attributes]" + getLineSeparator(); - msg = msg + " _behaviorSelector : " + _behaviorSelector + msg = msg + " _behaviorCommandInvoker : " + + _behaviorCommandInvoker + getLineSeparator(); + msg = msg + " _behaviorSelector : " + _behaviorSelector + getLineSeparator(); - msg = msg + " _daoSelector : " + _daoSelector - + getLineSeparator(); - msg = msg + "* * * * * * * * * */" + getLineSeparator(); + msg = msg + "* * * * * * * * * */"; throw new IllegalStateException(msg); } } @@ -648,14 +861,14 @@ public TokenFileOutputResult outputTokenFile(ConditionBean cb, String filename, TokenFileOutputOption tokenFileOutputOption) throws java.io.FileNotFoundException, java.io.IOException { - assertConditionBeanNotNull(cb); + assertCBNotNull(cb); assertStringNotNullAndNotTrimmedEmpty("filename", filename); assertObjectNotNull("tokenFileOutputOption", tokenFileOutputOption); final List ls = readList(cb); List> rowList = new ArrayList>(); - for (java.util.Iterator ite = ls.iterator(); ite.hasNext();) { - final Entity entity = (Entity) ite.next(); + for (java.util.Iterator ite = ls.iterator(); ite.hasNext();) { + final Entity entity = ite.next(); final List valueList = getDBMeta() .convertToColumnStringValueList(entity); rowList.add(valueList); @@ -665,9 +878,9 @@ .getFileMakingOption(); final FileMakingHeaderInfo fileMakingHeaderInfo = new FileMakingHeaderInfo(); final List columnDbNameList = new ArrayList(); - for (final java.util.Iterator ite = getDBMeta().getColumnInfoList() - .iterator(); ite.hasNext();) { - final ColumnInfo columnInfo = (ColumnInfo) ite.next(); + for (final java.util.Iterator ite = getDBMeta() + .getColumnInfoList().iterator(); ite.hasNext();) { + final ColumnInfo columnInfo = ite.next(); columnDbNameList.add(columnInfo.getColumnDbName()); } fileMakingHeaderInfo.setColumnNameList(columnDbNameList); @@ -690,7 +903,7 @@ * @return All count. */ protected int callGetCountAll() { - return readCount(newConditionBean()); + return callReadCount(newConditionBean()); } /** @@ -699,7 +912,7 @@ * @return All list. (NotNull) */ protected List callGetListAll() { - return readList(newConditionBean()); + return callReadList(newConditionBean()); } /** @@ -710,14 +923,12 @@ * @return Read count. (NotNull) */ protected int callReadCount(ConditionBean cb) { - assertConditionBeanNotNull(cb); - final Class[] types = new Class[] { cb.getClass() }; - final java.lang.reflect.Method mtd = getMethod(getDaoReadable() - .getClass(), "selectCount", types); - final Object result = invoke(mtd, getDaoReadable(), new Object[] { cb }); - return ((Integer) result).intValue(); + assertCBNotNull(cb); + return doCallReadCount(cb); } + protected abstract int doCallReadCount(ConditionBean cb); + /** * The implementation. * @@ -727,42 +938,110 @@ * (NotNull) */ protected List 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) result; + assertCBNotNull(cb); + return doCallReadList(cb); } - private Method getMethod(Class clazz, String methodName, Class[] argTypes) { - try { - return clazz.getMethod(methodName, argTypes); - } catch (NoSuchMethodException ex) { - String msg = "class=" + clazz + " method=" + methodName + "-" - + java.util.Arrays.asList(argTypes); - throw new RuntimeException(msg, ex); + protected abstract List doCallReadList(ConditionBean cb); + + //========================================================================== + // ========= + // Behavior Command + // ================ + public void warmUpCommand() { + { + SelectCountCBCommand cmd = createSelectCountCBCommand(newConditionBean()); + cmd.setInitializeOnly(true); + invoke(cmd); } + { + SelectListCBCommand cmd = createSelectListCBCommand( + newConditionBean(), getDBMeta().getEntityType()); + cmd.setInitializeOnly(true); + invoke(cmd); + } } - private Object invoke(Method method, Object target, Object[] args) { - try { - return method.invoke(target, args); - } catch (java.lang.reflect.InvocationTargetException ex) { - Throwable t = ex.getCause(); - if (t instanceof RuntimeException) { - throw (RuntimeException) t; - } - if (t instanceof Error) { - throw (Error) t; - } - String msg = "target=" + target + " method=" + method + "-" - + java.util.Arrays.asList(args); - throw new RuntimeException(msg, ex); - } catch (IllegalAccessException ex) { - String msg = "target=" + target + " method=" + method + "-" - + java.util.Arrays.asList(args); - throw new RuntimeException(msg, ex); + protected SelectCountCBCommand createSelectCountCBCommand(ConditionBean cb) { + assertBehaviorCommandInvoker("createSelectCountCBCommand"); + final SelectCountCBCommand command = xsetupSelectCommand(new SelectCountCBCommand()); + command.setConditionBeanType(cb.getClass()); + command.setConditionBean(cb); + return command; + } + + protected SelectListCBCommand createSelectListCBCommand( + ConditionBean cb, Class entityType) { + assertBehaviorCommandInvoker("createSelectListCBCommand"); + final SelectListCBCommand command = xsetupSelectCommand(new SelectListCBCommand()); + command.setConditionBeanType(cb.getClass()); + command.setConditionBean(cb); + command.setEntityType(entityType); + return command; + } + + protected SelectNextValCommand createSelectNextValCommand( + Class resultType) { + assertBehaviorCommandInvoker("createSelectNextValCommand"); + final SelectNextValCommand command = xsetupSelectCommand(new SelectNextValCommand()); + command.setResultType(resultType); + return command; + } + + protected SelectScalarCBCommand createSelectScalarCBCommand( + ConditionBean cb, Class resultType, + SqlClause.SelectClauseType selectClauseType) { + assertBehaviorCommandInvoker("createSelectScalarCBCommand"); + final SelectScalarCBCommand command = xsetupSelectCommand(new SelectScalarCBCommand()); + command.setConditionBeanType(cb.getClass()); + command.setConditionBean(cb); + command.setResultType(resultType); + command.setSelectClauseType(selectClauseType); + return command; + } + + private > COMMAND xsetupSelectCommand( + COMMAND command) { + command.setTableDbName(getTableDbName()); + _behaviorCommandInvoker.injectComponentProperty(command); + return command; + } + + /** + * Invoke the command of behavior. + * + * @param The type of result. + * @param behaviorCommand The command of behavior. (NotNull) + * @return The instance of result. (Nullable) + */ + protected RESULT invoke(BehaviorCommand behaviorCommand) { + return _behaviorCommandInvoker.invoke(behaviorCommand); + } + + protected void assertBehaviorCommandInvoker(String methodName) { + if (_behaviorCommandInvoker == null) { + String msg = "Look! Read the message below." + getLineSeparator(); + msg = msg + + "/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *" + + getLineSeparator(); + msg = msg + + "Not found the invoker of behavior command as behavior's attributed!" + + getLineSeparator(); + msg = msg + getLineSeparator(); + msg = msg + "[Advice]" + getLineSeparator(); + msg = msg + + "Please confirm the definition of the invoker at your 'dbflute.dicon'." + + getLineSeparator(); + msg = msg + "It is precondition that '" + methodName + + "()' needs the invoker instance." + getLineSeparator(); + msg = msg + getLineSeparator(); + msg = msg + "[Your Behavior's Attributes]" + getLineSeparator(); + msg = msg + " _behaviorCommandInvoker : " + + _behaviorCommandInvoker + getLineSeparator(); + msg = msg + " _behaviorSelector : " + _behaviorSelector + + getLineSeparator(); + msg = msg + "* * * * * * * * * */"; + throw new IllegalStateException(msg); } } @@ -800,6 +1079,7 @@ return SimpleSystemUtil.getLineSeparator(); } + @SuppressWarnings("unchecked") protected ENTITY helpDowncastInternally( Entity entity, Class clazz) { assertObjectNotNull("entity", entity); @@ -850,8 +1130,16 @@ * * @param cb Condition-bean. (NotNull) */ - protected void assertConditionBeanNotNull( - jp.sf.pal.notepad.db.allcommon.cbean.ConditionBean cb) { + protected void assertConditionBeanNotNull(ConditionBean cb) { + assertCBNotNull(cb); + } + + /** + * Assert that the condition-bean is not null. + * + * @param cb Condition-bean. (NotNull) + */ + protected void assertCBNotNull(ConditionBean cb) { assertObjectNotNull("cb", cb); } @@ -896,7 +1184,7 @@ * * @param ls List. (NotNull) */ - protected void assertListNotNullAndEmpty(List ls) { + protected void assertListNotNullAndEmpty(List ls) { assertObjectNotNull("ls", ls); if (!ls.isEmpty()) { String msg = "The list should be empty: ls=" + ls.toString(); @@ -909,7 +1197,7 @@ * * @param ls List. (NotNull) */ - protected void assertListNotNullAndNotEmpty(List ls) { + protected void assertListNotNullAndNotEmpty(List ls) { assertObjectNotNull("ls", ls); if (ls.isEmpty()) { String msg = "The list should not be empty: ls=" + ls.toString(); @@ -922,7 +1210,7 @@ * * @param ls List. (NotNull) */ - protected void assertListNotNullAndHasOnlyOne(List ls) { + protected void assertListNotNullAndHasOnlyOne(List ls) { assertObjectNotNull("ls", ls); if (ls.size() != 1) { String msg = "The list should contain only one object: ls=" @@ -936,38 +1224,39 @@ // Accessor // ======== /** - * Get the selector of behavior. + * Get the invoker of behavior command. * - * @return The select of behavior. (Nullable: But normally NotNull) + * @return The invoker of behavior command. (Nullable: But normally NotNull) */ - protected BehaviorSelector getBehaviorSelector() { - return _behaviorSelector; + protected BehaviorCommandInvoker getBehaviorCommandInvoker() { + return _behaviorCommandInvoker; } /** - * Set the selector of behavior. + * Set the invoker of behavior command. * - * @param behaviorSelector The selector of behavior. (NotNull) + * @param behaviorCommandInvoker The invoker of behavior command. (NotNull) */ - public void setBehaviorSelector(BehaviorSelector behaviorSelector) { - this._behaviorSelector = behaviorSelector; + public void setBehaviorCommandInvoker( + BehaviorCommandInvoker behaviorCommandInvoker) { + this._behaviorCommandInvoker = behaviorCommandInvoker; } /** - * Get the selector of DAO. + * Get the selector of behavior. * - * @return The select of DAO. (Nullable: But normally NotNull) + * @return The select of behavior. (Nullable: But normally NotNull) */ - protected DaoSelector getDaoSelector() { - return _daoSelector; + protected BehaviorSelector getBehaviorSelector() { + return _behaviorSelector; } /** - * Set the selector of DAO. + * Set the selector of behavior. * - * @param daoSelector The selector of DAO. (NotNull) + * @param behaviorSelector The selector of behavior. (NotNull) */ - public void setDaoSelector(DaoSelector daoSelector) { - _daoSelector = daoSelector; + public void setBehaviorSelector(BehaviorSelector behaviorSelector) { + this._behaviorSelector = behaviorSelector; } } Modified: notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/bhv/AbstractBehaviorWritable.java =================================================================== --- notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/bhv/AbstractBehaviorWritable.java 2008-12-27 22:11:51 UTC (rev 1627) +++ notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/bhv/AbstractBehaviorWritable.java 2008-12-27 22:13:37 UTC (rev 1628) @@ -4,10 +4,25 @@ import java.util.Iterator; import java.util.List; +import jp.sf.pal.notepad.db.allcommon.CommonColumnAutoSetupper; import jp.sf.pal.notepad.db.allcommon.Entity; import jp.sf.pal.notepad.db.allcommon.bhv.batch.TokenFileReflectionFailure; import jp.sf.pal.notepad.db.allcommon.bhv.batch.TokenFileReflectionOption; import jp.sf.pal.notepad.db.allcommon.bhv.batch.TokenFileReflectionResult; +import jp.sf.pal.notepad.db.allcommon.bhv.core.command.AbstractEntityCommand; +import jp.sf.pal.notepad.db.allcommon.bhv.core.command.AbstractListEntityCommand; +import jp.sf.pal.notepad.db.allcommon.bhv.core.command.BatchDeleteEntityCommand; +import jp.sf.pal.notepad.db.allcommon.bhv.core.command.BatchDeleteNonstrictEntityCommand; +import jp.sf.pal.notepad.db.allcommon.bhv.core.command.BatchInsertEntityCommand; +import jp.sf.pal.notepad.db.allcommon.bhv.core.command.BatchUpdateEntityCommand; +import jp.sf.pal.notepad.db.allcommon.bhv.core.command.BatchUpdateNonstrictEntityCommand; +import jp.sf.pal.notepad.db.allcommon.bhv.core.command.DeleteEntityCommand; +import jp.sf.pal.notepad.db.allcommon.bhv.core.command.DeleteNonstrictEntityCommand; +import jp.sf.pal.notepad.db.allcommon.bhv.core.command.InsertEntityCommand; +import jp.sf.pal.notepad.db.allcommon.bhv.core.command.QueryDeleteCBCommand; +import jp.sf.pal.notepad.db.allcommon.bhv.core.command.QueryUpdateEntityCBCommand; +import jp.sf.pal.notepad.db.allcommon.bhv.core.command.UpdateEntityCommand; +import jp.sf.pal.notepad.db.allcommon.bhv.core.command.UpdateNonstrictEntityCommand; import jp.sf.pal.notepad.db.allcommon.cbean.ConditionBean; import jp.sf.pal.notepad.db.allcommon.dbmeta.DBMeta; import jp.sf.pal.notepad.db.allcommon.helper.MapStringBuilder; @@ -20,7 +35,7 @@ import jp.sf.pal.notepad.db.allcommon.helper.token.file.impl.FileTokenImpl; /** - * The abstract class of behavior-writable. + * The abstract class of writable behavior. * * @author DBFlute(AutoGenerator) */ @@ -29,6 +44,31 @@ //========================================================================== // ========= + // Definition + // ========== + /** Map-string map-mark. */ + private static final String MAP_STRING_MAP_MARK = "map:"; + + /** Map-string start-brace. */ + private static final String MAP_STRING_START_BRACE = "@{"; + + /** Map-string end-brace. */ + private static final String MAP_STRING_END_BRACE = "@}"; + + /** Map-string delimiter. */ + private static final String MAP_STRING_DELIMITER = "@;"; + + /** Map-string equal. */ + private static final String MAP_STRING_EQUAL = "@="; + + //========================================================================== + // =========== + // Attribute + // ========= + protected CommonColumnAutoSetupper _commonColumnAutoSetupper; + + //========================================================================== + // ========= // Entity Update // ============= // ----------------------------------------------------- @@ -357,7 +397,7 @@ * @param entityList Entity list. (NotNull and NotEmpty) * @return The array of created count. */ - public int[] lumpCreate(java.util.List entityList) { + public int[] lumpCreate(List entityList) { assertListNotNullAndNotEmpty(entityList); return callCreateList(entityList); } @@ -370,7 +410,7 @@ * @exception jp.sf.pal.notepad.db.allcommon.exception.EntityAlreadyUpdatedException * If s2dao's version is over 1.0.47 (contains 1.0.47). */ - public int[] lumpModify(java.util.List entityList) { + public int[] lumpModify(List entityList) { assertListNotNullAndNotEmpty(entityList); return callModifyList(entityList); } @@ -383,7 +423,7 @@ * @exception jp.sf.pal.notepad.db.allcommon.exception.EntityAlreadyUpdatedException * If s2dao's version is over 1.0.47 (contains 1.0.47). */ - public int[] lumpRemove(java.util.List entityList) { + public int[] lumpRemove(List entityList) { assertListNotNullAndNotEmpty(entityList); return callRemoveList(entityList); } @@ -611,9 +651,11 @@ if (!processBeforeInsert(entity)) { return 1;/* as Normal End */ } - return getDaoWritable().create(entity); + return doCallCreate(entity); } + protected abstract int doCallCreate(Entity entity); + /** * Process before insert. * @@ -645,9 +687,11 @@ if (!processBeforeUpdate(entity)) { return 1;/* as Normal End */ } - return getDaoWritable().modifyModifiedOnly(entity); + return doCallModify(entity); } + protected abstract int doCallModify(Entity entity); + /** * Process before update. * @@ -678,9 +722,11 @@ if (!processBeforeDelete(entity)) { return 1;/* as Normal End */ } - return getDaoWritable().remove(entity); + return doCallRemove(entity); } + protected abstract int doCallRemove(Entity entity); + /** * Process before delete. * @@ -729,8 +775,38 @@ * (NotNull) */ protected void setupCommonColumnOfInsertIfNeeds(Entity targetEntity) { + final CommonColumnAutoSetupper setupper = getCommonColumnAutoSetupper(); + assertCommonColumnAutoSetupperNotNull(); + setupper.handleCommonColumnOfInsertIfNeeds(targetEntity); } + private void assertCommonColumnAutoSetupperNotNull() { + if (_commonColumnAutoSetupper == null) { + String msg = "Look! Read the message below." + getLineSeparator(); + msg = msg + + "/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *" + + getLineSeparator(); + msg = msg + + "Not found the auto set-upper of common column as behavior's attribute!" + + getLineSeparator(); + msg = msg + getLineSeparator(); + msg = msg + "[Advice]" + getLineSeparator(); + msg = msg + + "Please confirm the definition of the set-upper at your component configuration of DBFlute." + + getLineSeparator(); + msg = msg + getLineSeparator(); + msg = msg + "[Your Behavior's Attributes]" + getLineSeparator(); + msg = msg + " _behaviorCommandInvoker : " + + _behaviorCommandInvoker + getLineSeparator(); + msg = msg + " _behaviorSelector : " + _behaviorSelector + + getLineSeparator(); + msg = msg + " _commonColumnAutoSetupper : " + + _commonColumnAutoSetupper + getLineSeparator(); + msg = msg + "* * * * * * * * * */"; + throw new IllegalStateException(msg); + } + } + /** * Filter the entity of insert. * @@ -778,6 +854,9 @@ * (NotNull) */ protected void setupCommonColumnOfUpdateIfNeeds(Entity targetEntity) { + final CommonColumnAutoSetupper setupper = getCommonColumnAutoSetupper(); + assertCommonColumnAutoSetupperNotNull(); + setupper.handleCommonColumnOfUpdateIfNeeds(targetEntity); } /** @@ -843,12 +922,14 @@ * (NotNull) * @return Inserted count. */ - public int[] callCreateList(java.util.List entityList) { + public int[] callCreateList(List entityList) { assertObjectNotNull("entityList", entityList); helpFilterBeforeInsertInternally(entityList); - return getDaoWritable().createList(entityList); + return doCreateList(entityList); } + protected abstract int[] doCreateList(List entityList); + /** * The implementation. * @@ -856,12 +937,14 @@ * (NotNull) * @return Updated count. */ - public int[] callModifyList(java.util.List entityList) { + public int[] callModifyList(List entityList) { assertObjectNotNull("entityList", entityList); helpFilterBeforeUpdateInternally(entityList); - return getDaoWritable().modifyList(entityList); + return doModifyList(entityList); } + protected abstract int[] doModifyList(List entityList); + /** * The implementation. * @@ -869,12 +952,14 @@ * (NotNull) * @return Deleted count. */ - public int[] callRemoveList(java.util.List entityList) { + public int[] callRemoveList(List entityList) { assertObjectNotNull("entityList", entityList); helpFilterBeforeDeleteInternally(entityList); - return getDaoWritable().removeList(entityList); + return doRemoveList(entityList); } + protected abstract int[] doRemoveList(List entityList); + protected void assertEntityHasVersionNoValue(Entity entity) { if (!getDBMeta().hasVersionNo()) { return; @@ -994,4 +1079,148 @@ } return filteredList; } + + //========================================================================== + // ========= + // Behavior Command + // ================ + protected InsertEntityCommand createInsertEntityCommand(Entity entity) { + assertBehaviorCommandInvoker("createInsertEntityCommand"); + return xsetupEntityCommand(new InsertEntityCommand(), entity); + } + + protected UpdateEntityCommand createUpdateEntityCommand(Entity entity) { + assertBehaviorCommandInvoker("createUpdateEntityCommand"); + return xsetupEntityCommand(new UpdateEntityCommand(), entity); + } + + protected UpdateNonstrictEntityCommand createUpdateNonstrictEntityCommand( + Entity entity) { + assertBehaviorCommandInvoker("createUpdateNonstrictEntityCommand"); + return xsetupEntityCommand(new UpdateNonstrictEntityCommand(), entity); + } + + protected DeleteEntityCommand createDeleteEntityCommand(Entity entity) { + assertBehaviorCommandInvoker("createDeleteEntityCommand"); + return xsetupEntityCommand(new DeleteEntityCommand(), entity); + } + + protected DeleteNonstrictEntityCommand createDeleteNonstrictEntityCommand( + Entity entity) { + assertBehaviorCommandInvoker("createDeleteNonstrictEntityCommand"); + return xsetupEntityCommand(new DeleteNonstrictEntityCommand(), entity); + } + + private COMMAND xsetupEntityCommand( + COMMAND command, Entity entity) { + command.setTableDbName(getTableDbName()); + _behaviorCommandInvoker.injectComponentProperty(command); + command.setEntityType(entity.getClass()); + command.setEntity(entity); + return command; + } + + protected BatchInsertEntityCommand createBatchInsertEntityCommand( + List entityList) { + assertBehaviorCommandInvoker("createBatchInsertEntityCommand"); + return xsetupListEntityCommand(new BatchInsertEntityCommand(), + entityList); + } + + protected BatchUpdateEntityCommand createBatchUpdateEntityCommand( + List entityList) { + assertBehaviorCommandInvoker("createBatchUpdateEntityCommand"); + return xsetupListEntityCommand(new BatchUpdateEntityCommand(), + entityList); + } + + protected BatchUpdateNonstrictEntityCommand createBatchUpdateNonstrictEntityCommand( + List entityList) { + assertBehaviorCommandInvoker("createBatchUpdateNonstrictEntityCommand"); + return xsetupListEntityCommand(new BatchUpdateNonstrictEntityCommand(), + entityList); + } + + protected BatchDeleteEntityCommand createBatchDeleteEntityCommand( + List entityList) { + assertBehaviorCommandInvoker("createBatchDeleteEntityCommand"); + return xsetupListEntityCommand(new BatchDeleteEntityCommand(), + entityList); + } + + protected BatchDeleteNonstrictEntityCommand createBatchDeleteNonstrictEntityCommand( + List entityList) { + assertBehaviorCommandInvoker("createBatchDeleteNonstrictEntityCommand"); + return xsetupListEntityCommand(new BatchDeleteNonstrictEntityCommand(), + entityList); + } + + /** + * @param The type of behavior command for list entity. + * @param command The command of behavior. (NotNull) + * @param entityList The list of entity. (NotNull, NotEmpty) + * @return The command of behavior. (NotNull) + */ + private COMMAND xsetupListEntityCommand( + COMMAND command, List entityList) { + if (entityList.isEmpty()) { + String msg = "The argument 'entityList' should not be empty: " + + entityList; + throw new IllegalStateException(msg); + } + command.setTableDbName(getTableDbName()); + _behaviorCommandInvoker.injectComponentProperty(command); + command.setEntityType(entityList.get(0).getClass()); // *The list should + // not be empty! + command.setEntityList(entityList); + return command; + } + + protected QueryDeleteCBCommand createQueryDeleteCBCommand(ConditionBean cb) { + assertBehaviorCommandInvoker("createQueryDeleteCBCommand"); + final QueryDeleteCBCommand cmd = new QueryDeleteCBCommand(); + cmd.setTableDbName(getTableDbName()); + _behaviorCommandInvoker.injectComponentProperty(cmd); + cmd.setConditionBeanType(cb.getClass()); + cmd.setConditionBean(cb); + return cmd; + } + + protected QueryUpdateEntityCBCommand createQueryUpdateEntityCBCommand( + Entity entity, ConditionBean cb) { + assertBehaviorCommandInvoker("createQueryUpdateEntityCBCommand"); + final QueryUpdateEntityCBCommand cmd = new QueryUpdateEntityCBCommand(); + cmd.setTableDbName(getTableDbName()); + _behaviorCommandInvoker.injectComponentProperty(cmd); + cmd.setConditionBeanType(cb.getClass()); + cmd.setConditionBean(cb); + cmd.setEntityType(entity.getClass()); + cmd.setEntity(entity); + return cmd; + } + + //========================================================================== + // ========= + // Accessor + // ======== + /** + * Get the auto set-upper of common column. + * + * @return The auto set-upper of common column. (Nullable: But normally + * NotNull) + */ + protected CommonColumnAutoSetupper getCommonColumnAutoSetupper() { + return _commonColumnAutoSetupper; + } + + /** + * Set the auto set-upper of common column. + * + * @param commonColumnAutoSetupper The auto set-upper of common column. + * (NotNull) + */ + public void setCommonColumnAutoSetupper( + CommonColumnAutoSetupper commonColumnAutoSetupper) { + this._commonColumnAutoSetupper = commonColumnAutoSetupper; + } } Modified: notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/bhv/BehaviorReadable.java =================================================================== --- notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/bhv/BehaviorReadable.java 2008-12-27 22:11:51 UTC (rev 1627) +++ notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/bhv/BehaviorReadable.java 2008-12-27 22:13:37 UTC (rev 1628) @@ -1,6 +1,5 @@ package jp.sf.pal.notepad.db.allcommon.bhv; -import jp.sf.pal.notepad.db.allcommon.DaoReadable; import jp.sf.pal.notepad.db.allcommon.Entity; import jp.sf.pal.notepad.db.allcommon.cbean.ConditionBean; import jp.sf.pal.notepad.db.allcommon.cbean.ListResultBean; @@ -16,34 +15,12 @@ //========================================================================== // ========= - // Definition - // ========== - /** Map-string map-mark. */ - public static final String MAP_STRING_MAP_MARK = "map:"; - - /** Map-string list-mark. */ - public static final String MAP_STRING_LIST_MARK = "list:"; - - /** Map-string start-brace. */ - public static final String MAP_STRING_START_BRACE = "@{"; - - /** Map-string end-brace. */ - public static final String MAP_STRING_END_BRACE = "@}"; - - /** Map-string delimiter. */ - public static final String MAP_STRING_DELIMITER = "@;"; - - /** Map-string equal. */ - public static final String MAP_STRING_EQUAL = "@="; - - //========================================================================== - // ========= // Table name // ========== /** - * Get table db-name. + * Get table DB name. * - * @return Table db-name. (NotNull) + * @return Table DB name. (NotNull) */ public String getTableDbName(); @@ -52,25 +29,14 @@ // DBMeta // ====== /** - * Get dbmeta. + * Get the instance of DBMeta. * - * @return DBMeta. (NotNull) + * @return The instance of DBMeta. (NotNull) */ public DBMeta getDBMeta(); //========================================================================== // ========= - // Dao Accessor - // ============ - /** - * Get dao-readable. - * - * @return Dao-readable. (NotNull) - */ - public DaoReadable getDaoReadable(); - - //========================================================================== - // ========= // New Instance // ============ /** @@ -173,4 +139,13 @@ * @return The value of sequence. (NotNull) */ public java.math.BigDecimal readNextVal(); + + //========================================================================== + // ========= + // Warm Up + // ======= + /** + * Warm up the command of behavior. + */ + public void warmUpCommand(); } Modified: notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/bhv/BehaviorWritable.java =================================================================== --- notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/bhv/BehaviorWritable.java 2008-12-27 22:11:51 UTC (rev 1627) +++ notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/bhv/BehaviorWritable.java 2008-12-27 22:13:37 UTC (rev 1628) @@ -1,6 +1,7 @@ package jp.sf.pal.notepad.db.allcommon.bhv; -import jp.sf.pal.notepad.db.allcommon.DaoWritable; +import java.util.List; + import jp.sf.pal.notepad.db.allcommon.Entity; /** @@ -10,13 +11,6 @@ */ public interface BehaviorWritable extends BehaviorReadable { - /** - * Get dao-writable. - * - * @return Dao-writable. (NotNull) - */ - public DaoWritable getDaoWritable(); - //========================================================================== // =========== // Basic Entity Update @@ -116,15 +110,15 @@ /** * Lump create the list. * - * @param entityList Entity-list. (NotNull and NotEmpty) + * @param entityList The list of entity. (NotNull and NotEmpty) * @return The array of created count. */ - public int[] lumpCreate(java.util.List entityList); + public int[] lumpCreate(List entityList); /** - * Lump Modify the list. + * Lump modify the list. * - * @param entityList Entity-list. (NotNull and NotEmpty) + * @param entityList The list of entity. (NotNull and NotEmpty) * @return Modified count. * @exception jp.sf.pal.notepad.db.allcommon.exception.EntityAlreadyUpdatedException * When the entity has already been updated. And Only when @@ -132,12 +126,12 @@ * @exception jp.sf.pal.notepad.db.allcommon.exception.EntityDuplicatedException * When the entity has been duplicated. */ - public int[] lumpModify(java.util.List entityList); + public int[] lumpModify(List entityList); /** * Lump remove the list. * - * @param entityList Entity-list. (NotNull and NotEmpty) + * @param entityList The list of entity. (NotNull and NotEmpty) * @return Removed count. * @exception jp.sf.pal.notepad.db.allcommon.exception.EntityAlreadyUpdatedException * When the entity has already been updated. And Only when @@ -145,5 +139,5 @@ * @exception jp.sf.pal.notepad.db.allcommon.exception.EntityDuplicatedException * When the entity has been duplicated. */ - public int[] lumpRemove(java.util.List entityList); + public int[] lumpRemove(List entityList); } Added: notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/bhv/core/BehaviorCommand.java =================================================================== --- notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/bhv/core/BehaviorCommand.java (rev 0) +++ notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/bhv/core/BehaviorCommand.java 2008-12-27 22:13:37 UTC (rev 1628) @@ -0,0 +1,71 @@ +package jp.sf.pal.notepad.db.allcommon.bhv.core; + +import jp.sf.pal.notepad.db.allcommon.cbean.ConditionBean; +import jp.sf.pal.notepad.db.allcommon.cbean.outsidesql.OutsideSqlOption; + +/** + * @author DBFlute(AutoGenerator) + * @param The type of result. + */ +public interface BehaviorCommand { + + //========================================================================== + // ========= + // Basic Information + // ================= + public String getTableDbName(); + + public String getCommandName(); + + /** + * Get the return type of command. This type is not related to generic type + * because this is for conversion and check only. + * + * @return The return type of command. (NotNull) + */ + public Class getCommandReturnType(); + + public boolean isInitializeOnly(); + + //========================================================================== + // ========= + // Detail Information + // ================== + public boolean isConditionBean(); + + public boolean isOutsideSql(); + + public boolean isProcedure(); + + public boolean isSelect(); + + public boolean isSelectCount(); + + //========================================================================== + // ========= + // Process Callback + // ================ + public void beforeGettingSqlExecution(); + + public void afterExecuting(); + + //========================================================================== + // ========= + // SqlExecution Handling + // ===================== + public String buildSqlExecutionKey(); + + public SqlExecutionCreator createSqlExecutionCreator(); + + public Object[] getSqlExecutionArgument(); + + //========================================================================== + // ========= + // Argument Information + // ==================== + public ConditionBean getConditionBean(); + + public String getOutsideSqlPath(); + + public OutsideSqlOption getOutsideSqlOption(); +} Property changes on: notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/bhv/core/BehaviorCommand.java ___________________________________________________________________ Name: svn:eol-style + native Added: notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/bhv/core/BehaviorCommandComponentSetup.java =================================================================== --- notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/bhv/core/BehaviorCommandComponentSetup.java (rev 0) +++ notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/bhv/core/BehaviorCommandComponentSetup.java 2008-12-27 22:13:37 UTC (rev 1628) @@ -0,0 +1,23 @@ +package jp.sf.pal.notepad.db.allcommon.bhv.core; + +import javax.sql.DataSource; + +import org.seasar.dao.BeanMetaDataFactory; +import org.seasar.dao.ValueTypeFactory; +import org.seasar.extension.jdbc.StatementFactory; + +/** + * @author DBFlute(AutoGenerator) + */ +public interface BehaviorCommandComponentSetup { + + public void setDataSource(DataSource dataSource); + + public void setStatementFactory(StatementFactory statementFactory); + + public void setBeanMetaDataFactory(BeanMetaDataFactory beanMetaDataFactory); + + public void setValueTypeFactory(ValueTypeFactory valueTypeFactory); + + public void setSqlFileEncoding(String sqlFileEncoding); +} Property changes on: notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/bhv/core/BehaviorCommandComponentSetup.java ___________________________________________________________________ Name: svn:eol-style + native Added: notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/bhv/core/BehaviorCommandInvoker.java =================================================================== --- notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/bhv/core/BehaviorCommandInvoker.java (rev 0) +++ notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/bhv/core/BehaviorCommandInvoker.java 2008-12-27 22:13:37 UTC (rev 1628) @@ -0,0 +1,842 @@ +package jp.sf.pal.notepad.db.allcommon.bhv.core; + +import java.util.Arrays; +import java.util.List; +import java.util.Map; +import java.util.concurrent.ConcurrentHashMap; + +import javax.sql.DataSource; + +import jp.sf.pal.notepad.db.allcommon.DBFluteConfig; +import jp.sf.pal.notepad.db.allcommon.Entity; +import jp.sf.pal.notepad.db.allcommon.InternalMapContext; +import jp.sf.pal.notepad.db.allcommon.XLog; +import jp.sf.pal.notepad.db.allcommon.cbean.ConditionBeanContext; +import jp.sf.pal.notepad.db.allcommon.cbean.FetchNarrowingBeanContext; +import jp.sf.pal.notepad.db.allcommon.cbean.outsidesql.OutsideSqlContext; +import jp.sf.pal.notepad.db.allcommon.dbmeta.DBMeta; +import jp.sf.pal.notepad.db.allcommon.dbmeta.DBMetaInstanceHandler; +import jp.sf.pal.notepad.db.allcommon.helper.stacktrace.InvokeNameExtractingResource; +import jp.sf.pal.notepad.db.allcommon.helper.stacktrace.InvokeNameResult; +import jp.sf.pal.notepad.db.allcommon.helper.stacktrace.impl.InvokeNameExtractorImpl; +import jp.sf.pal.notepad.db.allcommon.jdbc.StatementConfig; +import jp.sf.pal.notepad.db.allcommon.s2dao.internal.various.InternalStatementFactory; +import jp.sf.pal.notepad.db.allcommon.util.SimpleSystemUtil; +import jp.sf.pal.notepad.db.allcommon.util.SimpleTypeUtil; +import jp.sf.pal.notepad.db.allcommon.util.TraceViewUtil; + +import org.seasar.dao.BeanMetaDataFactory; +import org.seasar.dao.ValueTypeFactory; +import org.seasar.extension.jdbc.StatementFactory; +import org.seasar.framework.util.Disposable; +import org.seasar.framework.util.DisposableUtil; + +/** + * The invoker of behavior command. + * + *
+ * public interface methods are as follows:
+ * 
+ *   o injectComponentProperty(BehaviorCommandComponentSetup behaviorCommand);
+ *   o invoke(BehaviorCommand behaviorCommand);
+ *   o isDisposable();
+ *   o isExecutionCacheEmpty();
+ * 
+ * + * @author DBFlute(AutoGenerator) + */ +public class BehaviorCommandInvoker implements Disposable { + + //========================================================================== + // ========= + // Attribute + // ========= + // ----------------------------------------------------- + // Injection Target + // ---------------- + protected DataSource _dataSource; + + protected BeanMetaDataFactory _beanMetaDataFactory; + + protected ValueTypeFactory _valueTypeFactory; + + // ----------------------------------------------------- + // Fixed Property + // -------------- + protected final StatementFactory _statementFactory = createStatememtFactory(); + + protected final Map _executionMap = new ConcurrentHashMap(); + + // ----------------------------------------------------- + // Dispose Status + // -------------- + protected boolean disposable; + + //========================================================================== + // ========= + // Constructor + // =========== + public BehaviorCommandInvoker() { + } + + //========================================================================== + // ========= + // Command Set up + // ============== + /** + * Inject the properties of component to the command of behavior. {Public + * Interface} + * + * @param behaviorCommand The command of behavior. (NotNull) + */ + public void injectComponentProperty( + BehaviorCommandComponentSetup behaviorCommand) { + behaviorCommand.setDataSource(_dataSource); + behaviorCommand.setStatementFactory(_statementFactory); + behaviorCommand.setBeanMetaDataFactory(_beanMetaDataFactory); + behaviorCommand.setValueTypeFactory(_valueTypeFactory); + behaviorCommand.setSqlFileEncoding(getSqlFileEncoding()); + } + + protected String getSqlFileEncoding() { + return "UTF-8"; // This value is set when generating. + } + + //========================================================================== + // ========= + // Command Invoke + // ============== + /** + * Invoke the command of behavior. {Public Interface} This method is an + * entry point! + * + * @param The type of result. + * @param behaviorCommand The command of behavior. (NotNull) + * @return The result object. (Nullable) + */ + public RESULT invoke(BehaviorCommand behaviorCommand) { + clearContext(); + try { + return doInvoke(behaviorCommand); + } finally { + clearContext(); + } + } + + /** + * @param The type of result. + * @param behaviorCommand The command of behavior. (NotNull) + * @return The result object. (Nullable) + */ + protected RESULT doInvoke(BehaviorCommand behaviorCommand) { + // - - - - - - - - - - - - - + // Initialize SQL Execution + // - - - - - - - - - - - - - + if (behaviorCommand.isInitializeOnly()) { + initializeSqlExecution(behaviorCommand); + return null; // The end! (Initialize Only) + } + behaviorCommand.beforeGettingSqlExecution(); + + SqlExecution execution = null; + try { + final String key = behaviorCommand.buildSqlExecutionKey(); + execution = getSqlExecution(key); + if (execution == null) { + long beforeCmd = 0; + if (isLogEnabled()) { + beforeCmd = System.currentTimeMillis(); + } + SqlExecutionCreator creator = behaviorCommand + .createSqlExecutionCreator(); + execution = getSqlExecution(key, creator); + if (isLogEnabled()) { + final long afterCmd = System.currentTimeMillis(); + if (beforeCmd != afterCmd) { + logSqlExecution(behaviorCommand, execution, beforeCmd, + afterCmd); + } + } + } + } finally { + if (isLogEnabled()) { + logInvocation(behaviorCommand); + } + } + + long before = 0; + if (isLogEnabled()) { + before = System.currentTimeMillis(); + } + + Object ret = null; + try { + final Object[] args = behaviorCommand.getSqlExecutionArgument(); + ret = executeSql(execution, args); + } finally { + behaviorCommand.afterExecuting(); + } + final Class retType = behaviorCommand.getCommandReturnType(); + assertRetType(retType, ret); + + if (isLogEnabled()) { + final long after = System.currentTimeMillis(); + logReturn(behaviorCommand, retType, ret, before, after); + } + + // - - - - - - - - - - + // Convert and Return! + // - - - - - - - - - - + if (retType.isPrimitive()) { + ret = convertPrimitiveWrapper(retType, ret); + } else if (Number.class.isAssignableFrom(retType)) { + ret = convertNumber(retType, ret); + } + @SuppressWarnings("unchecked") + final RESULT result = (RESULT) ret; + return result; + } + + //========================================================================== + // ========= + // SQL Execution + // ============= + protected void initializeSqlExecution( + BehaviorCommand behaviorCommand) { + final String key = behaviorCommand.buildSqlExecutionKey(); + SqlExecutionCreator creator = behaviorCommand + .createSqlExecutionCreator(); + getSqlExecution(key, creator); + } + + protected SqlExecution getSqlExecution(String key) { + return _executionMap.get(key); + } + + /** + * @param key The key of SQL execution. (NotNull) + * @param executionCreator The creator of SQL execution. (NotNull) + * @return The SQL execution that may be created then. (NotNull) + */ + protected SqlExecution getSqlExecution(String key, + SqlExecutionCreator executionCreator) { + SqlExecution execution = getSqlExecution(key); + if (execution == null) { + synchronized (_executionMap) { + execution = getSqlExecution(key); + if (execution == null) { + if (isLogEnabled()) { + log("...Initializing sqlExecution for the key '" + key + + "'"); + } + _executionMap.put(key, executionCreator + .createSqlExecution()); + } else { + if (isLogEnabled()) { + log("...Getting sqlExecution as cache because the previous thread have already initilized."); + } + } + } + execution = getSqlExecution(key); + if (execution == null) { + String msg = "sqlExecutionCreator.createSqlCommand() should not return null:"; + msg = msg + " sqlExecutionCreator=" + executionCreator + + " key=" + key; + throw new IllegalStateException(msg); + } + if (!disposable) { + synchronized (this) { + if (!disposable) { + toBeDisposable(); + } + } + } + } + return execution; + } + + protected Object executeSql(SqlExecution execution, Object[] args) { + return execution.execute(args); + } + + //========================================================================== + // ========= + // Log SqlCommand + // ============== + protected void logSqlExecution( + BehaviorCommand behaviorCommand, SqlExecution execution, + long beforeCmd, long afterCmd) { + log("SqlExecution Initialization Cost: [" + + TraceViewUtil.convertToPerformanceView(afterCmd - beforeCmd) + + "]"); + } + + //========================================================================== + // ========= + // Log Invocation + // ============== + protected void logInvocation( + BehaviorCommand behaviorCommand) { + final StackTraceElement[] stackTrace = new Exception().getStackTrace(); + final InvokeNameResult behaviorResult = extractBehaviorInvokeName(stackTrace); + filterBehaviorResult(behaviorCommand, behaviorResult); + + final String invokeClassName; + final String invokeMethodName; + if (!behaviorResult.isEmptyResult()) { + invokeClassName = behaviorResult.getSimpleClassName(); + invokeMethodName = behaviorResult.getMethodName(); + } else { + invokeClassName = behaviorCommand.getTableDbName(); + invokeMethodName = behaviorCommand.getCommandName(); + } + final String expWithoutKakko = buildInvocationExpressionWithoutKakko( + behaviorCommand, invokeClassName, invokeMethodName); + + // Save behavior invoke name for error message. + putObjectToMapContext("df:BehaviorInvokeName", expWithoutKakko + "()"); + + final String equalBorder = buildFitBorder("", "=", expWithoutKakko, + false); + final String callerExpression = expWithoutKakko + "()"; + + log("/=====================================================" + + equalBorder + "=="); + log(" " + + callerExpression); + log(" " + + equalBorder + "=/"); + + logPath(behaviorCommand, stackTrace, behaviorResult); + + if (behaviorCommand.isOutsideSql() && !behaviorCommand.isProcedure()) { + final OutsideSqlContext outsideSqlContext = getOutsideSqlContext(); + if (outsideSqlContext != null) { + log("path: " + behaviorCommand.getOutsideSqlPath()); + log("option: " + behaviorCommand.getOutsideSqlOption()); + } + } + } + + protected void filterBehaviorResult( + BehaviorCommand behaviorCommand, + InvokeNameResult behaviorResult) { + final String simpleClassName = behaviorResult.getSimpleClassName(); + if (simpleClassName == null) { + return; + } + if (simpleClassName.contains("Behavior") + && simpleClassName.endsWith("$SLFunction")) { + final String behaviorClassName = findBehaviorClassNameFromDBMeta(behaviorCommand + .getTableDbName()); + behaviorResult.setSimpleClassName(behaviorClassName); + behaviorResult.setMethodName("scalarSelect()." + + behaviorResult.getMethodName()); + } + } + + protected void logPath(BehaviorCommand behaviorCommand, + StackTraceElement[] stackTrace, InvokeNameResult behaviorResult) { + final int bhvNextIndex = behaviorResult.getNextStartIndex(); + final InvokeNameResult clientResult = extractClientInvokeName( + stackTrace, bhvNextIndex); + final int clientFirstIndex = clientResult.getFoundFirstIndex(); + final InvokeNameResult byPassResult = extractByPassInvokeName( + stackTrace, bhvNextIndex, clientFirstIndex - bhvNextIndex); + + final String clientInvokeName = clientResult.getInvokeName(); + final String byPassInvokeName = byPassResult.getInvokeName(); + final String behaviorInvokeName = behaviorResult.getInvokeName(); + if (clientInvokeName.trim().length() == 0 + && byPassInvokeName.trim().length() == 0) { + return; + } + + // Save client invoke name for error message. + if (!clientResult.isEmptyResult()) { + putObjectToMapContext("df:ClientInvokeName", clientInvokeName); + } + // Save by-pass invoke name for error message. + if (!byPassResult.isEmptyResult()) { + putObjectToMapContext("df:ByPassInvokeName", byPassInvokeName); + } + + log(clientInvokeName + byPassInvokeName + behaviorInvokeName + "..."); + } + + protected String buildInvocationExpressionWithoutKakko( + BehaviorCommand behaviorCommand, String invokeClassName, + String invokeMethodName) { + if (invokeClassName.contains("OutsideSql") + && invokeClassName.endsWith("Executor")) { // OutsideSql + // Executor Handling + try { + final String originalName = invokeClassName; + if (behaviorCommand.isOutsideSql()) { + final OutsideSqlContext outsideSqlContext = getOutsideSqlContext(); + final String tableDbName = outsideSqlContext + .getTableDbName(); + final String behaviorClassName = findBehaviorClassNameFromDBMeta(tableDbName); + invokeClassName = behaviorClassName + ".outsideSql()"; + if (originalName.endsWith("OutsideSqlEntityExecutor")) { + invokeClassName = invokeClassName + ".entityHandling()"; + } else if (originalName + .endsWith("OutsideSqlPagingExecutor")) { + if (outsideSqlContext.isAutoPagingLogging()) { + invokeClassName = invokeClassName + ".autoPaging()"; + } else { + invokeClassName = invokeClassName + + ".manualPaging()"; + } + } else if (originalName + .endsWith("OutsideSqlCursorExecutor")) { + invokeClassName = invokeClassName + ".cursorHandling()"; + } + } else { + invokeClassName = "OutsideSql"; + } + } catch (RuntimeException ignored) { + log("Ignored exception occurred: msg=" + ignored.getMessage()); + } + } + String callerExpressionWithoutKakko = invokeClassName + "." + + invokeMethodName; + if ("selectPage".equals(invokeMethodName)) { // Special Handling! + boolean resultTypeInteger = false; + if (behaviorCommand.isOutsideSql()) { + final OutsideSqlContext outsideSqlContext = getOutsideSqlContext(); + final Object resultTypeSpecification = outsideSqlContext + .getResultTypeSpecification(); + if (resultTypeSpecification != null + && resultTypeSpecification instanceof Class) { + final Class resultType = (Class) resultTypeSpecification; + if (Integer.class.isAssignableFrom(resultType)) { + resultTypeInteger = true; + } + } + } + if (resultTypeInteger || behaviorCommand.isSelectCount()) { + callerExpressionWithoutKakko = callerExpressionWithoutKakko + + "():count"; + } else { + callerExpressionWithoutKakko = callerExpressionWithoutKakko + + "():paging"; + } + } + return callerExpressionWithoutKakko; + } + + protected String buildFitBorder(String prefix, String element, + String lengthTargetString, boolean space) { + final int length = space ? lengthTargetString.length() / 2 + : lengthTargetString.length(); + final StringBuffer sb = new StringBuffer(); + sb.append(prefix); + for (int i = 0; i < length; i++) { + sb.append(element); + if (space) { + sb.append(" "); + } + } + if (space) { + sb.append(element); + } + return sb.toString(); + } + + protected InvokeNameResult extractClientInvokeName( + StackTraceElement[] stackTrace, final int startIndex) { + final List 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 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 suffixList = Arrays.asList(new String[] { "Bhv", + "BehaviorReadable", "BehaviorWritable", "PagingInvoker" }); + final List keywordList = Arrays.asList(new String[] { "Bhv$", + "BehaviorReadable$", "BehaviorWritable$" }); + final List ousideSql1List = Arrays + .asList(new String[] { "OutsideSql" }); + final List ousideSql2List = Arrays + .asList(new String[] { "Executor" }); + final List 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 suffixList) { + for (String suffix : suffixList) { + if (className.endsWith(suffix)) { + return true; + } + } + return false; + } + + protected boolean isClassNameContains(String className, + List keywordList) { + for (String keyword : keywordList) { + if (className.contains(keyword)) { + return true; + } + } + return false; + } + + /** + * @param resource the call-back resource for invoke-name-extracting. + * (NotNull) + * @param stackTrace Stack log. (NotNull) + * @return The result of invoke name. (NotNull: If not found, returns empty + * string.) + */ + protected InvokeNameResult extractInvokeName( + InvokeNameExtractingResource resource, + StackTraceElement[] stackTrace) { + final InvokeNameExtractorImpl extractor = new InvokeNameExtractorImpl(); + extractor.setStackTrace(stackTrace); + return extractor.extractInvokeName(resource); + } + + /** + * @param simpleClassName The simple class name. (NotNull) + * @return The simple class name removed the base prefix. (NotNull) + */ + protected String removeBasePrefixFromSimpleClassName(String simpleClassName) { + if (!simpleClassName.startsWith("Bs")) { + return simpleClassName; + } + final int prefixLength = "Bs".length(); + if (!Character.isUpperCase(simpleClassName.substring(prefixLength) + .charAt(0))) { + return simpleClassName; + } + if (simpleClassName.length() <= prefixLength) { + return simpleClassName; + } + return "" + simpleClassName.substring(prefixLength); + } + + protected String findBehaviorClassNameFromDBMeta(String tableDbName) { + final DBMeta dbmeta = DBMetaInstanceHandler.findDBMeta(tableDbName); + final String behaviorTypeName = dbmeta.getBehaviorTypeName(); + final String behaviorClassName = behaviorTypeName + .substring(behaviorTypeName.lastIndexOf(".") + ".".length()); + return removeBasePrefixFromSimpleClassName(behaviorClassName); + } + + //========================================================================== + // ========= + // Log Return + // ========== + protected void logReturn(BehaviorCommand behaviorCommand, + Class retType, Object ret, long before, long after) { + try { + final String daoResultPrefix = "===========/ [" + + TraceViewUtil.convertToPerformanceView(after - before) + + " - "; + if (List.class.isAssignableFrom(retType)) { + if (ret == null) { + log(daoResultPrefix + "Selected list: null]"); + } else { + final List ls = (java.util.List) ret; + if (ls.isEmpty()) { + log(daoResultPrefix + "Selected list: 0]"); + } else if (ls.size() == 1 && ls.get(0) instanceof Number) { + log(daoResultPrefix + "Selected count: " + ls.get(0) + + "]"); + } else { + log(daoResultPrefix + "Selected list: " + ls.size() + + " first=" + ls.get(0) + "]"); + } + } + } else if (Entity.class.isAssignableFrom(retType)) { + if (ret == null) { + log(daoResultPrefix + "Selected entity: null" + "]"); + } else { + final Entity entity = (Entity) ret; + log(daoResultPrefix + "Selected entity: " + entity + "]"); + } + } else if (Entity.class.isAssignableFrom(retType)) { + if (ret == null) { + log(daoResultPrefix + "Selected entity: null" + "]"); + } else { + final Entity entity = (Entity) ret; + log(daoResultPrefix + "Selected entity: " + entity + "]"); + } + } else if (int[].class.isAssignableFrom(retType)) { + if (ret == null) { + log(daoResultPrefix + "Selected entity: null" + "]"); + } else { + final int[] resultArray = (int[]) ret; + if (resultArray.length == 0) { + log(daoResultPrefix + "All updated count: 0]"); + } else { + final StringBuilder sb = new StringBuilder(); + boolean resultExpressionScope = true; + int resultCount = 0; + int loopCount = 0; + for (int element : resultArray) { + resultCount = resultCount + element; + if (resultExpressionScope) { + if (loopCount <= 10) { + if (sb.length() == 0) { + sb.append(element); + } else { + sb.append(",").append(element); + } + } else { + sb.append(",").append("..."); + resultExpressionScope = false; + } + } + ++loopCount; + } + sb.insert(0, "{").append("}"); + log(daoResultPrefix + "All updated count: " + + resultCount + " result=" + sb + "]"); + } + } + } else { + if (behaviorCommand.isSelectCount()) { + log(daoResultPrefix + "Selected count: " + ret + "]"); + } else { + log(daoResultPrefix + "Result: " + ret + "]"); + } + } + log(" "); + } catch (RuntimeException e) { + String msg = "Result object debug threw the exception: behaviorCommand="; + msg = msg + behaviorCommand + " retType=" + retType; + msg = msg + " ret=" + ret; + throw e; + } + } + + //========================================================================== + // ========= + // Context Helper + // ============== + protected OutsideSqlContext getOutsideSqlContext() { + if (!OutsideSqlContext.isExistOutsideSqlContextOnThread()) { + return null; + } + return OutsideSqlContext.getOutsideSqlContextOnThread(); + } + + protected void putObjectToMapContext(String key, Object value) { + InternalMapContext.setObject(key, value); + } + + protected void clearContext() { + if (OutsideSqlContext.isExistOutsideSqlContextOnThread()) { + OutsideSqlContext.clearOutsideSqlContextOnThread(); + } + if (FetchNarrowingBeanContext.isExistFetchNarrowingBeanOnThread()) { + // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + // - - - - - - - - - - - - - - - + // Because there is possible that fetch narrowing has been ignored + // for manualPaging of outsideSql. + // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + // - - - - - - - - - - - - - - - + FetchNarrowingBeanContext.getFetchNarrowingBeanOnThread() + .restoreIgnoredFetchNarrowing(); + + FetchNarrowingBeanContext.clearFetchNarrowingBeanOnThread(); + } + if (ConditionBeanContext.isExistConditionBeanOnThread()) { + ConditionBeanContext.clearConditionBeanOnThread(); + } + if (InternalMapContext.isExistInternalMapContextOnThread()) { + InternalMapContext.clearInternalMapContextOnThread(); + } + } + + //========================================================================== + // ========= + // Execute Status Log + // ================== + protected void log(String msg) { + XLog.log(msg); + } + + protected boolean isLogEnabled() { + return XLog.isLogEnabled(); + } + + protected StatementFactory createStatememtFactory() { + final StatementConfig defaultStatementConfig = DBFluteConfig + .getInstance().getDefaultStatementConfig(); + final boolean internalDebug = DBFluteConfig.getInstance() + .isInternalDebug(); + InternalStatementFactory factory = new InternalStatementFactory(); + factory.setDefaultStatementConfig(defaultStatementConfig); + factory.setInternalDebug(internalDebug); + return factory; + } + + //========================================================================== + // ========= + // Dispose + // ======= + public void toBeDisposable() { + DisposableUtil.add(this); + disposable = true; + } + + public void dispose() { + _executionMap.clear(); + disposable = false; + } + + public boolean isDisposable() { + return disposable; + } + + public boolean isExecutionCacheEmpty() { + return _executionMap.isEmpty(); + } + + //========================================================================== + // ========= + // Convert Helper + // ============== + protected Object convertPrimitiveWrapper(Class retType, Object ret) { + return SimpleTypeUtil.toWrapper(retType, ret); + } + + protected Object convertNumber(Class retType, Object ret) { + return SimpleTypeUtil.toNumber(retType, ret); + } + + //========================================================================== + // ========= + // Assert Helper + // ============= + protected void assertRetType(Class retType, Object ret) { + if (List.class.isAssignableFrom(retType)) { + if (ret != null && !(ret instanceof List)) { + String msg = "The retType is difference from actual return: "; + msg = msg + "retType=" + retType + " ret.getClass()=" + + ret.getClass() + " ref=" + ret; + throw new IllegalStateException(msg); + } + } else if (Entity.class.isAssignableFrom(retType)) { + if (ret != null && !(ret instanceof Entity)) { + String msg = "The retType is difference from actual return: "; + msg = msg + "retType=" + retType + " ret.getClass()=" + + ret.getClass() + " ref=" + ret; + throw new IllegalStateException(msg); + } + } + } + + //========================================================================== + // ========= + // General Helper + // ============== + protected String getLineSeparator() { + return SimpleSystemUtil.getLineSeparator(); + } + + //========================================================================== + // ========= + // Accessor + // ======== + public void setDataSource(DataSource dataSource) { + _dataSource = dataSource; + } + + public void setBeanMetaDataFactory(BeanMetaDataFactory beanMetaDataFactory) { + _beanMetaDataFactory = beanMetaDataFactory; + } + + public void setValueTypeFactory(ValueTypeFactory valueTypeFactory) { + _valueTypeFactory = valueTypeFactory; + } +} Property changes on: notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/bhv/core/BehaviorCommandInvoker.java ___________________________________________________________________ Name: svn:eol-style + native Added: notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/bhv/core/BehaviorInitializer.java =================================================================== --- notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/bhv/core/BehaviorInitializer.java (rev 0) +++ notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/bhv/core/BehaviorInitializer.java 2008-12-27 22:13:37 UTC (rev 1628) @@ -0,0 +1,180 @@ +package jp.sf.pal.notepad.db.allcommon.bhv.core; + +import java.util.Collections; +import java.util.Map; +import java.util.concurrent.ConcurrentHashMap; + +import javax.sql.XADataSource; + +import jp.sf.pal.notepad.db.allcommon.DBDef; +import jp.sf.pal.notepad.db.allcommon.DBFluteConfig; +import jp.sf.pal.notepad.db.allcommon.cbean.ConditionBeanContext; +import jp.sf.pal.notepad.db.allcommon.dbmeta.DBMetaInstanceHandler; +import jp.sf.pal.notepad.db.allcommon.s2dao.internal.sqllog.InternalSqlLogRegistry; +import jp.sf.pal.notepad.db.allcommon.util.SimpleSystemUtil; + +import org.seasar.extension.dbcp.impl.XADataSourceImpl; + +/** + * @author DBFlute(AutoGenerator) + */ +public class BehaviorInitializer { + + //========================================================================== + // ========= + // Definition + // ========== + /** Log-instance. */ + private static final org.apache.commons.logging.Log _log = org.apache.commons.logging.LogFactory + .getLog(BehaviorInitializer.class); + + // ----------------------------------------------------- + // For DBMeta + // ---------- + /** + * The map of table DB name and class name for the handler of DB meta + * instance. + */ + protected static final Map _tableDbNameClassNameMap; + static { + final Map tmpMap = newConcurrentHashMap(); + tmpMap.put("GROUP_INFO", + "jp.sf.pal.notepad.db.bsentity.dbmeta.GroupInfoDbm"); + tmpMap.put("GROUP_MAPPING", + "jp.sf.pal.notepad.db.bsentity.dbmeta.GroupMappingDbm"); + tmpMap + .put("NOTEPAD", + "jp.sf.pal.notepad.db.bsentity.dbmeta.NotepadDbm"); + tmpMap.put("NOTEPAD_CATEGORY", + "jp.sf.pal.notepad.db.bsentity.dbmeta.NotepadCategoryDbm"); + tmpMap.put("NOTEPAD_CONTENT", + "jp.sf.pal.notepad.db.bsentity.dbmeta.NotepadContentDbm"); + tmpMap.put("ROLE_INFO", + "jp.sf.pal.notepad.db.bsentity.dbmeta.RoleInfoDbm"); + tmpMap.put("ROLE_MAPPING", + "jp.sf.pal.notepad.db.bsentity.dbmeta.RoleMappingDbm"); + tmpMap.put("USER_INFO", + "jp.sf.pal.notepad.db.bsentity.dbmeta.UserInfoDbm"); + _tableDbNameClassNameMap = Collections.unmodifiableMap(tmpMap); + } + + protected static ConcurrentHashMap newConcurrentHashMap() { + return new ConcurrentHashMap(); + } + + //========================================================================== + // ========= + // Constructor + // =========== + /** + * Constructor. And initialize various components related behavior. + * + * @param xaDataSource The data source of XA. (Nullable) + */ + public BehaviorInitializer(XADataSource xaDataSource) { + _log + .info("/* * * * * * * * * * * * * * * * * * * * * * * * * * * * {DBFlute}"); + initializeDBMetaResource(); + handleSqlLogRegistry(); + loadCoolClasses(); + if (xaDataSource != null) { + showInformation(xaDataSource); + setupDBDefByDriverClassName(xaDataSource); + } + DBFluteConfig.getInstance().lock(); + _log.info("* * * * */"); + } + + //========================================================================== + // ========= + // DBMeta + // ====== + protected void initializeDBMetaResource() { + DBMetaInstanceHandler.setupDBMetaResource(_tableDbNameClassNameMap); + } + + //========================================================================== + // ========= + // Cool Classes + // ============ + protected void loadCoolClasses() { // for S2Container basically + ConditionBeanContext.loadCoolClasses(); // Against the ClassLoader + // Headache! + } + + //========================================================================== + // ========= + // Information + // =========== + protected void showInformation(XADataSource xaDataSource) { + if (xaDataSource != null && xaDataSource instanceof XADataSourceImpl) { + final StringBuilder sb = new StringBuilder(); + final XADataSourceImpl xaDataSourceImpl = (XADataSourceImpl) xaDataSource; + final String driverClassName = xaDataSourceImpl + .getDriverClassName(); + final String url = xaDataSourceImpl.getURL(); + final String user = xaDataSourceImpl.getUser(); + sb.append(" [XADataSource]:").append(getLineSeparator()); + sb.append(" driver = " + driverClassName).append( + getLineSeparator()); + sb.append(" url = " + url).append(getLineSeparator()); + sb.append(" user = " + user); + _log.info("{Injection Information}" + getLineSeparator() + sb); + } + } + + //========================================================================== + // ========= + // Database Product Name + // ===================== + protected void setupDBDefByDriverClassName(XADataSource xaDataSource) { + if (xaDataSource != null && xaDataSource instanceof XADataSourceImpl) { + final XADataSourceImpl xaDataSourceImpl = (XADataSourceImpl) xaDataSource; + final String driverClassName = xaDataSourceImpl + .getDriverClassName(); + final DBDef dbdef = DBDef.byDriverClassName(driverClassName); + if (dbdef != null) { + DBDef.setCurrentDef(dbdef); + return; + } + } + } + + //========================================================================== + // ========= + // SQL Log Registry + // ================ + protected void handleSqlLogRegistry() { + if (DBFluteConfig.getInstance().isUseSqlLogRegistry()) { + final StringBuilder sb = new StringBuilder(); + sb.append("{SqlLog Information}").append(getLineSeparator()); + sb.append(" [SqlLogRegistry]").append(getLineSeparator()); + if (InternalSqlLogRegistry.setupSqlLogRegistry()) { + sb + .append( + " ...Setting up SqlLogRegistry(org.seasar.extension.jdbc)!") + .append(getLineSeparator()); + sb + .append(" Because the property 'useSqlLogRegistry' of the config of DBFlute is true."); + } else { + sb + .append(" SqlLogRegistry(org.seasar.extension.jdbc) is not supported at the version!"); + } + _log.info(sb); + } else { + final Object sqlLogRegistry = InternalSqlLogRegistry + .findContainerSqlLogRegistry(); + if (sqlLogRegistry != null) { + InternalSqlLogRegistry.closeRegistration(); + } + } + } + + //========================================================================== + // ========= + // General Helper + // ============== + protected String getLineSeparator() { + return SimpleSystemUtil.getLineSeparator(); + } +} Property changes on: notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/bhv/core/BehaviorInitializer.java ___________________________________________________________________ Name: svn:eol-style + native Added: notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/bhv/core/SqlExecution.java =================================================================== --- notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/bhv/core/SqlExecution.java (rev 0) +++ notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/bhv/core/SqlExecution.java 2008-12-27 22:13:37 UTC (rev 1628) @@ -0,0 +1,9 @@ +package jp.sf.pal.notepad.db.allcommon.bhv.core; + +/** + * @author DBFlute(AutoGenerator) + */ +public interface SqlExecution { + + public Object execute(Object[] args); +} Property changes on: notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/bhv/core/SqlExecution.java ___________________________________________________________________ Name: svn:eol-style + native Added: notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/bhv/core/SqlExecutionCreator.java =================================================================== --- notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/bhv/core/SqlExecutionCreator.java (rev 0) +++ notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/bhv/core/SqlExecutionCreator.java 2008-12-27 22:13:37 UTC (rev 1628) @@ -0,0 +1,9 @@ +package jp.sf.pal.notepad.db.allcommon.bhv.core; + +/** + * @author DBFlute(AutoGenerator) + */ +public interface SqlExecutionCreator { + + SqlExecution createSqlExecution(); +} Property changes on: notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/bhv/core/SqlExecutionCreator.java ___________________________________________________________________ Name: svn:eol-style + native Added: notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/bhv/core/command/AbstractBehaviorCommand.java =================================================================== --- notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/bhv/core/command/AbstractBehaviorCommand.java (rev 0) +++ notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/bhv/core/command/AbstractBehaviorCommand.java 2008-12-27 22:13:37 UTC (rev 1628) @@ -0,0 +1,261 @@ +package jp.sf.pal.notepad.db.allcommon.bhv.core.command; + +import java.sql.ResultSet; +import java.sql.SQLException; +import java.util.ArrayList; +import java.util.List; + +import javax.sql.DataSource; + +import jp.sf.pal.notepad.db.allcommon.DBDef; +import jp.sf.pal.notepad.db.allcommon.bhv.core.BehaviorCommand; +import jp.sf.pal.notepad.db.allcommon.bhv.core.BehaviorCommandComponentSetup; +import jp.sf.pal.notepad.db.allcommon.s2dao.internal.rshandler.InternalBeanListMetaDataResultSetHandler; +import jp.sf.pal.notepad.db.allcommon.s2dao.internal.sqlcommand.InternalUpdateDynamicCommand; +import jp.sf.pal.notepad.db.allcommon.s2dao.internal.various.InternalRelationRowCreator; +import jp.sf.pal.notepad.db.allcommon.s2dao.internal.various.InternalRowCreator; + +import org.seasar.dao.BeanMetaData; +import org.seasar.dao.BeanMetaDataFactory; +import org.seasar.dao.ValueTypeFactory; +import org.seasar.extension.jdbc.ResultSetHandler; +import org.seasar.extension.jdbc.StatementFactory; +import org.seasar.extension.jdbc.ValueType; +import org.seasar.extension.jdbc.types.ValueTypes; + +/** + * @author DBFlute(AutoGenerator) + * @param The type of result. + */ +public abstract class AbstractBehaviorCommand implements + BehaviorCommand, BehaviorCommandComponentSetup { + + //========================================================================== + // ========= + // Attribute + // ========= + // ----------------------------------------------------- + // Basic Information + // ----------------- + /** The table DB name. (Required) */ + protected String _tableDbName; + + /** Is it initialize only? (Choice) */ + protected boolean _initializeOnly; + + // ----------------------------------------------------- + // Injection Component + // ------------------- + protected DataSource _dataSource; + + protected StatementFactory _statementFactory; + + protected BeanMetaDataFactory _beanMetaDataFactory; + + protected ValueTypeFactory _valueTypeFactory; + + protected String _sqlFileEncoding; + + //========================================================================== + // ========= + // Factory + // ======= + // ----------------------------------------------------- + // UpdateDynamicCommnd + // ------------------- + protected InternalUpdateDynamicCommand createUpdateDynamicCommand( + String[] argNames, Class[] argTypes, String sql) { + final InternalUpdateDynamicCommand cmd = new InternalUpdateDynamicCommand( + _dataSource, _statementFactory); + cmd.setArgNames(argNames); + cmd.setArgTypes(argTypes); + if (sql != null) { + cmd.setSql(sql); + } + return cmd; + } + + // ----------------------------------------------------- + // ResultSetHandler + // ---------------- + protected ResultSetHandler createBeanListMetaDataResultSetHandler( + BeanMetaData bmd) { + final InternalRowCreator rowCreator = createInternalRowCreator(bmd); + final InternalRelationRowCreator relationRowCreator = createInternalRelationRowCreator(bmd); + return new InternalBeanListMetaDataResultSetHandler(bmd, rowCreator, + relationRowCreator); + } + + protected ResultSetHandler createObjectResultSetHandler(Class objectType) { + final ValueType valueType = ValueTypes.getValueType(objectType); + return new InternalObjectResultSetHandler(valueType); + } + + protected ResultSetHandler createObjectListResultSetHandler( + Class objectType) { + final ValueType valueType = ValueTypes.getValueType(objectType); + return createObjectListResultSetHandler(valueType); + } + + protected ResultSetHandler createObjectListResultSetHandler( + ValueType valueType) { + return new InternalObjectListResultSetHandler(valueType); + } + + protected static class InternalObjectResultSetHandler implements + ResultSetHandler { + private ValueType valueType; + + public InternalObjectResultSetHandler(ValueType valueType) { + this.valueType = valueType; + } + + public Object handle(ResultSet rs) throws SQLException { + while (rs.next()) { + return valueType.getValue(rs, 1); + } + return null; + } + } + + protected static class InternalObjectListResultSetHandler implements + ResultSetHandler { + private ValueType valueType; + + public InternalObjectListResultSetHandler(ValueType valueType) { + this.valueType = valueType; + } + + public Object handle(ResultSet rs) throws SQLException { + final List ret = new ArrayList(); + while (rs.next()) { + ret.add(valueType.getValue(rs, 1)); + } + return ret; + } + } + + protected static class InternalNullResultSetHandler implements + ResultSetHandler { + public Object handle(ResultSet rs) throws SQLException { + return null; + } + } + + protected InternalRowCreator createInternalRowCreator(BeanMetaData bmd) { + final Class clazz = bmd != null ? bmd.getBeanClass() : null; + return InternalRowCreator.createInternalRowCreator(clazz); + } + + protected InternalRelationRowCreator createInternalRelationRowCreator( + BeanMetaData bmd) { + return new InternalRelationRowCreator(); // Not yet implemented about + // performance tuning! + } + + //========================================================================== + // ========= + // Assist Helper + // ============= + protected String buildDbmsSuffix() { + final String productName = DBDef.getCurrentDef().code(); + return (productName != null ? "_" + productName.toLowerCase() : ""); + } + + //========================================================================== + // ========= + // Assert Helper + // ============= + protected void assertBasicProperty(String methodName) { + if (_tableDbName == null) { + throw new IllegalStateException(buildAssertMessage("_tableDbName", + methodName)); + } + } + + protected void assertComponentProperty(String methodName) { + if (_dataSource == null) { + throw new IllegalStateException(buildAssertMessage("_dataSource", + methodName)); + } + if (_statementFactory == null) { + throw new IllegalStateException(buildAssertMessage( + "_statementFactory", methodName)); + } + if (_beanMetaDataFactory == null) { + throw new IllegalStateException(buildAssertMessage( + "_beanMetaDataFactory", methodName)); + } + if (_valueTypeFactory == null) { + throw new IllegalStateException(buildAssertMessage( + "_valueTypeFactory", methodName)); + } + if (_sqlFileEncoding == null) { + throw new IllegalStateException(buildAssertMessage( + "_sqlFileEncoding", methodName)); + } + } + + protected String buildAssertMessage(String propertyName, String methodName) { + propertyName = propertyName.startsWith("_") ? propertyName + .substring("_".length()) : propertyName; + String msg = "The property '" + propertyName + "' should not be null"; + msg = msg + " when you call " + methodName + "()."; + throw new IllegalStateException(msg); + } + + //========================================================================== + // ========= + // Basic Override + // ============== + @Override + public String toString() { + return getClass().getSimpleName() + ":{" + buildSqlExecutionKey() + "}"; + } + + //========================================================================== + // ========= + // Accessor + // ======== + // ----------------------------------------------------- + // Basic Information + // ----------------- + public String getTableDbName() { + return _tableDbName; + } + + public void setTableDbName(String tableDbName) { + _tableDbName = tableDbName; + } + + public void setInitializeOnly(boolean initializeOnly) { + _initializeOnly = initializeOnly; + } + + public boolean isInitializeOnly() { + return _initializeOnly; + } + + // ----------------------------------------------------- + // Injection Component + // ------------------- + public void setDataSource(DataSource dataSource) { + _dataSource = dataSource; + } + + public void setStatementFactory(StatementFactory statementFactory) { + _statementFactory = statementFactory; + } + + public void setBeanMetaDataFactory(BeanMetaDataFactory beanMetaDataFactory) { + _beanMetaDataFactory = beanMetaDataFactory; + } + + public void setValueTypeFactory(ValueTypeFactory valueTypeFactory) { + _valueTypeFactory = valueTypeFactory; + } + + public void setSqlFileEncoding(String sqlFileEncoding) { + _sqlFileEncoding = sqlFileEncoding; + } +} Property changes on: notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/bhv/core/command/AbstractBehaviorCommand.java ___________________________________________________________________ Name: svn:eol-style + native Added: notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/bhv/core/command/AbstractEntityCommand.java =================================================================== --- notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/bhv/core/command/AbstractEntityCommand.java (rev 0) +++ notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/bhv/core/command/AbstractEntityCommand.java 2008-12-27 22:13:37 UTC (rev 1628) @@ -0,0 +1,182 @@ +package jp.sf.pal.notepad.db.allcommon.bhv.core.command; + +import java.util.ArrayList; +import java.util.List; + +import jp.sf.pal.notepad.db.allcommon.Entity; +import jp.sf.pal.notepad.db.allcommon.cbean.ConditionBean; +import jp.sf.pal.notepad.db.allcommon.cbean.outsidesql.OutsideSqlOption; +import jp.sf.pal.notepad.db.allcommon.dbmeta.DBMeta; + +import org.seasar.dao.BeanMetaData; +import org.seasar.extension.jdbc.PropertyType; + +/** + * @author DBFlute(AutoGenerator) + */ +public abstract class AbstractEntityCommand extends + AbstractBehaviorCommand { + + //========================================================================== + // ========= + // Attribute + // ========= + /** The type of entity. (Required) */ + protected Class _entityType; + + /** The instance of condition-bean. (Required) */ + protected Entity _entity; + + //========================================================================== + // ========= + // Basic Information + // ================= + public Class getCommandReturnType() { + return Integer.class; + } + + //========================================================================== + // ========= + // Detail Information + // ================== + public boolean isConditionBean() { + return false; + } + + public boolean isOutsideSql() { + return false; + } + + public boolean isProcedure() { + return false; + } + + public boolean isSelect() { + return false; + } + + public boolean isSelectCount() { + return false; + } + + //========================================================================== + // ========= + // Factory + // ======= + // ----------------------------------------------------- + // BeanMetaData + // ------------ + protected BeanMetaData createBeanMetaData() { + return _beanMetaDataFactory.createBeanMetaData(_entityType); + } + + //========================================================================== + // ========= + // Process Callback + // ================ + public void beforeGettingSqlExecution() { + } + + public void afterExecuting() { + } + + //========================================================================== + // ========= + // SqlExecution Handling + // ===================== + public String buildSqlExecutionKey() { + assertStatus("buildSqlExecutionKey"); + return _tableDbName + ":" + getCommandName() + "(" + + _entityType.getSimpleName() + ")"; + } + + public Object[] getSqlExecutionArgument() { + assertStatus("getSqlExecutionArgument"); + return new Object[] { _entity }; + } + + //========================================================================== + // ========= + // Argument Information + // ==================== + public ConditionBean getConditionBean() { + return null; + } + + public String getOutsideSqlPath() { + return null; + } + + public OutsideSqlOption getOutsideSqlOption() { + return null; + } + + //========================================================================== + // ========= + // Assist Helper + // ============= + protected DBMeta findDBMeta() { + // /- - - - - - - - - - - - - - - - - - - - - - - - - - - - + // Cannot use the handler of DBMeta instance + // because the customize-entity is contained to find here. + // - - - - - - - - - -/ + // DBMetaInstanceHandler.findDBMeta(_tableDbName); + + final Class beanType = _entityType; + if (beanType == null) { + return null; + } + if (!Entity.class.isAssignableFrom(beanType)) { + return null; + } + final Entity entity; + try { + entity = (Entity) beanType.newInstance(); + } catch (InstantiationException e) { + throw new IllegalStateException(e); + } catch (IllegalAccessException e) { + throw new IllegalStateException(e); + } + return entity.getDBMeta(); + } + + protected String[] getPersistentPropertyNames(BeanMetaData bmd) { + final List nameList = new ArrayList(); + for (int i = 0; i < bmd.getPropertyTypeSize(); ++i) { + final PropertyType pt = bmd.getPropertyType(i); + if (pt.isPersistent()) { + nameList.add(pt.getPropertyName()); + } + } + return nameList.toArray(new String[nameList.size()]); + } + + //========================================================================== + // ========= + // Assert Helper + // ============= + protected void assertStatus(String methodName) { + assertBasicProperty(methodName); + assertComponentProperty(methodName); + if (_entityType == null) { + throw new IllegalStateException(buildAssertMessage("_entityType", + methodName)); + } + if (_entity == null) { + throw new IllegalStateException(buildAssertMessage("_entity", + methodName)); + } + } + + //========================================================================== + // ========= + // Accessor + // ======== + public void setEntityType(Class entityType) { + _entityType = entityType; + } + + public void setEntity(Entity entity) { + _entity = entity; + } +} Property changes on: notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/bhv/core/command/AbstractEntityCommand.java ___________________________________________________________________ Name: svn:eol-style + native Added: notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/bhv/core/command/AbstractListEntityCommand.java =================================================================== --- notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/bhv/core/command/AbstractListEntityCommand.java (rev 0) +++ notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/bhv/core/command/AbstractListEntityCommand.java 2008-12-27 22:13:37 UTC (rev 1628) @@ -0,0 +1,182 @@ +package jp.sf.pal.notepad.db.allcommon.bhv.core.command; + +import java.util.ArrayList; +import java.util.List; + +import jp.sf.pal.notepad.db.allcommon.Entity; +import jp.sf.pal.notepad.db.allcommon.cbean.ConditionBean; +import jp.sf.pal.notepad.db.allcommon.cbean.outsidesql.OutsideSqlOption; +import jp.sf.pal.notepad.db.allcommon.dbmeta.DBMeta; + +import org.seasar.dao.BeanMetaData; +import org.seasar.extension.jdbc.PropertyType; + +/** + * @author DBFlute(AutoGenerator) + */ +public abstract class AbstractListEntityCommand extends + AbstractBehaviorCommand { + + //========================================================================== + // ========= + // Attribute + // ========= + /** The type of entity. (Required) */ + protected Class _entityType; + + /** The instance of condition-bean. (Required) */ + protected List _entityList; + + //========================================================================== + // ========= + // Basic Information + // ================= + public Class getCommandReturnType() { + return int[].class; + } + + //========================================================================== + // ========= + // Detail Information + // ================== + public boolean isConditionBean() { + return false; + } + + public boolean isOutsideSql() { + return false; + } + + public boolean isProcedure() { + return false; + } + + public boolean isSelect() { + return false; + } + + public boolean isSelectCount() { + return false; + } + + //========================================================================== + // ========= + // Factory + // ======= + // ----------------------------------------------------- + // BeanMetaData + // ------------ + protected BeanMetaData createBeanMetaData() { + return _beanMetaDataFactory.createBeanMetaData(_entityType); + } + + //========================================================================== + // ========= + // Process Callback + // ================ + public void beforeGettingSqlExecution() { + } + + public void afterExecuting() { + } + + //========================================================================== + // ========= + // SqlExecution Handling + // ===================== + public String buildSqlExecutionKey() { + assertStatus("buildSqlExecutionKey"); + return _tableDbName + ":" + getCommandName() + "(List<" + + _entityType.getSimpleName() + ">)"; + } + + public Object[] getSqlExecutionArgument() { + assertStatus("getSqlExecutionArgument"); + return new Object[] { _entityList }; + } + + //========================================================================== + // ========= + // Argument Information + // ==================== + public ConditionBean getConditionBean() { + return null; + } + + public String getOutsideSqlPath() { + return null; + } + + public OutsideSqlOption getOutsideSqlOption() { + return null; + } + + //========================================================================== + // ========= + // Assist Helper + // ============= + protected DBMeta findDBMeta() { + // /- - - - - - - - - - - - - - - - - - - - - - - - - - - - + // Cannot use the handler of DBMeta instance + // because the customize-entity is contained to find here. + // - - - - - - - - - -/ + // DBMetaInstanceHandler.findDBMeta(_tableDbName); + + final Class beanType = _entityType; + if (beanType == null) { + return null; + } + if (!Entity.class.isAssignableFrom(beanType)) { + return null; + } + final Entity entity; + try { + entity = (Entity) beanType.newInstance(); + } catch (InstantiationException e) { + throw new IllegalStateException(e); + } catch (IllegalAccessException e) { + throw new IllegalStateException(e); + } + return entity.getDBMeta(); + } + + protected String[] getPersistentPropertyNames(BeanMetaData bmd) { + final List nameList = new ArrayList(); + for (int i = 0; i < bmd.getPropertyTypeSize(); ++i) { + final PropertyType pt = bmd.getPropertyType(i); + if (pt.isPersistent()) { + nameList.add(pt.getPropertyName()); + } + } + return nameList.toArray(new String[nameList.size()]); + } + + //========================================================================== + // ========= + // Assert Helper + // ============= + protected void assertStatus(String methodName) { + assertBasicProperty(methodName); + assertComponentProperty(methodName); + if (_entityType == null) { + throw new IllegalStateException(buildAssertMessage("_entityType", + methodName)); + } + if (_entityList == null) { + throw new IllegalStateException(buildAssertMessage("_entityList", + methodName)); + } + } + + //========================================================================== + // ========= + // Accessor + // ======== + public void setEntityType(Class entityType) { + _entityType = entityType; + } + + public void setEntityList(List entityList) { + _entityList = entityList; + } +} Property changes on: notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/bhv/core/command/AbstractListEntityCommand.java ___________________________________________________________________ Name: svn:eol-style + native Added: notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/bhv/core/command/AbstractOutsideSqlCommand.java =================================================================== --- notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/bhv/core/command/AbstractOutsideSqlCommand.java (rev 0) +++ notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/bhv/core/command/AbstractOutsideSqlCommand.java 2008-12-27 22:13:37 UTC (rev 1628) @@ -0,0 +1,93 @@ +package jp.sf.pal.notepad.db.allcommon.bhv.core.command; + +import jp.sf.pal.notepad.db.allcommon.cbean.ConditionBean; +import jp.sf.pal.notepad.db.allcommon.cbean.outsidesql.OutsideSqlOption; + +/** + * @author DBFlute(AutoGenerator) + * @param The type of result. + */ +public abstract class AbstractOutsideSqlCommand extends + AbstractBehaviorCommand { + + //========================================================================== + // ========= + // Attribute + // ========= + // ----------------------------------------------------- + // Basic Information + // ----------------- + /** The path of outside-SQL. (Required) */ + protected String _outsideSqlPath; + + /** The parameter-bean. (Required to set, but Nullable) */ + protected Object _parameterBean; + + /** The option of outside-SQL. (Required) */ + protected OutsideSqlOption _outsideSqlOption; + + //========================================================================== + // ========= + // Detail Information + // ================== + public boolean isConditionBean() { + return false; // When the command is for outside-SQL, it always be + // false. + } + + public boolean isOutsideSql() { + return true; + } + + public boolean isSelectCount() { + return false; // When the command is for outside-SQL, it always be + // false. + } + + //========================================================================== + // ========= + // Argument Information + // ==================== + public ConditionBean getConditionBean() { + return null; + } + + public String getOutsideSqlPath() { + return _outsideSqlPath; + } + + public OutsideSqlOption getOutsideSqlOption() { + return _outsideSqlOption; + } + + //========================================================================== + // ========= + // Assert Helper + // ============= + protected void assertOutsideSqlBasic(String methodName) { + if (_outsideSqlPath == null) { + throw new IllegalStateException(buildAssertMessage( + "_outsideSqlPath", methodName)); + } + if (_outsideSqlOption == null) { + throw new IllegalStateException(buildAssertMessage( + "_outsideSqlOption", methodName)); + } + } + + //========================================================================== + // ========= + // Accessor + // ======== + public void setOutsideSqlPath(String outsideSqlPath) { + _outsideSqlPath = outsideSqlPath; + } + + public void setParameterBean(Object parameterBean) { + _parameterBean = parameterBean; + } + + public void setOutsideSqlOption(OutsideSqlOption outsideSqlOption) { + _outsideSqlOption = outsideSqlOption; + } +} Property changes on: notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/bhv/core/command/AbstractOutsideSqlCommand.java ___________________________________________________________________ Name: svn:eol-style + native Added: notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/bhv/core/command/AbstractOutsideSqlSelectCommand.java =================================================================== --- notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/bhv/core/command/AbstractOutsideSqlSelectCommand.java (rev 0) +++ notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/bhv/core/command/AbstractOutsideSqlSelectCommand.java 2008-12-27 22:13:37 UTC (rev 1628) @@ -0,0 +1,175 @@ +package jp.sf.pal.notepad.db.allcommon.bhv.core.command; + +import jp.sf.pal.notepad.db.allcommon.bhv.core.SqlExecution; +import jp.sf.pal.notepad.db.allcommon.bhv.core.SqlExecutionCreator; +import jp.sf.pal.notepad.db.allcommon.bhv.core.execution.OutsideSqlSelectExecution; +import jp.sf.pal.notepad.db.allcommon.cbean.FetchNarrowingBean; +import jp.sf.pal.notepad.db.allcommon.cbean.FetchNarrowingBeanContext; +import jp.sf.pal.notepad.db.allcommon.cbean.outsidesql.OutsideSqlContext; +import jp.sf.pal.notepad.db.allcommon.cbean.outsidesql.OutsideSqlOption; + +import org.seasar.extension.jdbc.ResultSetHandler; + +/** + * The abstract command for OutsideSql.selectSomething(). + * + * @author DBFlute(AutoGenerator) + * @param The type of result. + */ +public abstract class AbstractOutsideSqlSelectCommand extends + AbstractOutsideSqlCommand { + + //========================================================================== + // ========= + // Detail Information + // ================== + public boolean isProcedure() { + return false; + } + + public boolean isSelect() { + return true; + } + + //========================================================================== + // ========= + // Process Callback + // ================ + public void beforeGettingSqlExecution() { + assertStatus("beforeGettingSqlExecution"); + final String path = _outsideSqlPath; + final Object pmb = _parameterBean; + final OutsideSqlOption option = _outsideSqlOption; + final Object resultTypeSpecification = getResultTypeSpecification(); + final boolean autoPagingLogging = (option.isAutoPaging() || option + .isSourcePagingRequestTypeAuto()); + final OutsideSqlContext outsideSqlContext = new OutsideSqlContext(); + outsideSqlContext.setOutsideSqlPath(path); + outsideSqlContext.setParameterBean(pmb); + outsideSqlContext.setResultTypeSpecification(resultTypeSpecification); + outsideSqlContext.setMethodName(getCommandName()); + outsideSqlContext.setStatementConfig(option.getStatementConfig()); + outsideSqlContext.setTableDbName(option.getTableDbName()); + outsideSqlContext.setDynamicBinding(option.isDynamicBinding()); + outsideSqlContext.setOffsetByCursorForcedly(option.isAutoPaging()); + outsideSqlContext.setLimitByCursorForcedly(option.isAutoPaging()); + outsideSqlContext.setAutoPagingLogging(autoPagingLogging); // for + // logging + outsideSqlContext.setupBehaviorQueryPathIfNeeds(); + OutsideSqlContext.setOutsideSqlContextOnThread(outsideSqlContext); + + // Set up fetchNarrowingBean. + setupOutsideSqlFetchNarrowingBean(pmb, option); + } + + protected void setupOutsideSqlFetchNarrowingBean(Object pmb, + OutsideSqlOption option) { + if (pmb == null + || !FetchNarrowingBeanContext.isTheTypeFetchNarrowingBean(pmb + .getClass())) { + return; + } + final FetchNarrowingBean fetchNarrowingBean = (FetchNarrowingBean) pmb; + if (option.isManualPaging()) { + fetchNarrowingBean.ignoreFetchNarrowing(); + } + FetchNarrowingBeanContext + .setFetchNarrowingBeanOnThread(fetchNarrowingBean); + } + + public void afterExecuting() { + } + + //========================================================================== + // ========= + // SqlExecution Handling + // ===================== + public String buildSqlExecutionKey() { + assertStatus("buildSqlExecutionKey"); + return generateSpecifiedOutsideSqlUniqueKey(); + } + + protected String generateSpecifiedOutsideSqlUniqueKey() { + final String methodName = getCommandName(); + final String path = _outsideSqlPath; + final Object pmb = _parameterBean; + final OutsideSqlOption option = _outsideSqlOption; + final Object resultTypeSpecification = getResultTypeSpecification(); + return OutsideSqlContext.generateSpecifiedOutsideSqlUniqueKey( + methodName, path, pmb, option, resultTypeSpecification); + } + + public SqlExecutionCreator createSqlExecutionCreator() { + assertStatus("createSqlExecutionCreator"); + return new SqlExecutionCreator() { + public SqlExecution createSqlExecution() { + final OutsideSqlContext outsideSqlContext = OutsideSqlContext + .getOutsideSqlContextOnThread(); + return createOutsideSqlSelectExecution(outsideSqlContext); + } + }; + } + + protected SqlExecution createOutsideSqlSelectExecution( + OutsideSqlContext outsideSqlContext) { + // - - - - - - - - - - - - - - - - - - - - - - - + // The attribute of Specified-OutsideSqlContext. + // - - - - - - - - - - - - - - - - - - - - - - - + final String suffix = buildDbmsSuffix(); + final String sql = outsideSqlContext.readFilteredOutsideSql( + _sqlFileEncoding, suffix); + final Object pmb = outsideSqlContext.getParameterBean(); + + // - - - - - - - - - - - - - - - + // The attribute of SqlCommand. + // - - - - - - - - - - - - - - - + final String[] argNames = (pmb != null ? new String[] { "pmb" } + : new String[] {}); + final Class[] argTypes = (pmb != null ? new Class[] { pmb + .getClass() } : new Class[] {}); + + // - - - - - - - - - - - - - + // Create ResultSetHandler. + // - - - - - - - - - - - - - + final ResultSetHandler handler = createOutsideSqlSelectResultSetHandler(); + + // - - - - - - - - - - - + // Create SqlExecution. + // - - - - - - - - - - - + return createOutsideSqlSelectExecution(handler, argNames, argTypes, sql); + } + + protected OutsideSqlSelectExecution createOutsideSqlSelectExecution( + ResultSetHandler handler, String[] argNames, Class[] argTypes, + String sql) { + final OutsideSqlSelectExecution cmd = new OutsideSqlSelectExecution( + _dataSource, _statementFactory, handler); + cmd.setArgNames(argNames); + cmd.setArgTypes(argTypes); + cmd.setSql(sql); + return cmd; + } + + public Object[] getSqlExecutionArgument() { + assertStatus("getSqlExecutionArgument"); + return new Object[] { _parameterBean }; + } + + //========================================================================== + // ========= + // Extension Point + // =============== + protected abstract ResultSetHandler createOutsideSqlSelectResultSetHandler(); + + protected abstract Object getResultTypeSpecification(); + + //========================================================================== + // ========= + // Assert Helper + // ============= + protected void assertStatus(String methodName) { + assertBasicProperty(methodName); + assertComponentProperty(methodName); + assertOutsideSqlBasic(methodName); + } +} Property changes on: notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/bhv/core/command/AbstractOutsideSqlSelectCommand.java ___________________________________________________________________ Name: svn:eol-style + native Added: notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/bhv/core/command/AbstractSelectCBCommand.java =================================================================== --- notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/bhv/core/command/AbstractSelectCBCommand.java (rev 0) +++ notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/bhv/core/command/AbstractSelectCBCommand.java 2008-12-27 22:13:37 UTC (rev 1628) @@ -0,0 +1,122 @@ +package jp.sf.pal.notepad.db.allcommon.bhv.core.command; + +import jp.sf.pal.notepad.db.allcommon.bhv.core.SqlExecution; +import jp.sf.pal.notepad.db.allcommon.bhv.core.execution.SelectCBExecution; +import jp.sf.pal.notepad.db.allcommon.cbean.ConditionBean; +import jp.sf.pal.notepad.db.allcommon.cbean.outsidesql.OutsideSqlOption; + +import org.seasar.extension.jdbc.ResultSetHandler; + +/** + * @author DBFlute(AutoGenerator) + * @param The type of result. + */ +public abstract class AbstractSelectCBCommand extends + AbstractBehaviorCommand { + + //========================================================================== + // ========= + // Attribute + // ========= + /** The type of condition-bean. (Derived from conditionBean) */ + protected Class _conditionBeanType; + + /** The instance of condition-bean. (Required) */ + protected ConditionBean _conditionBean; + + //========================================================================== + // ========= + // Detail Information + // ================== + public boolean isConditionBean() { + return true; + } + + public boolean isOutsideSql() { + return false; + } + + public boolean isProcedure() { + return false; + } + + public boolean isSelect() { + return true; + } + + //========================================================================== + // ========= + // SqlExecution Handling + // ===================== + public String buildSqlExecutionKey() { + assertStatus("buildSqlExecutionKey"); + return _tableDbName + ":" + getCommandName() + "(" + + _conditionBeanType.getSimpleName() + ")"; + } + + protected SqlExecution createSelectCBExecution( + Class cbType, ResultSetHandler handler) { + return createSelectCBExecution(handler, new String[] { "dto" }, + new Class[] { cbType }); + } + + protected SelectCBExecution createSelectCBExecution( + ResultSetHandler handler, String[] argNames, Class[] argTypes) { + final SelectCBExecution cmd = new SelectCBExecution(_dataSource, + _statementFactory, handler); + cmd.setArgNames(argNames); + cmd.setArgTypes(argTypes); + return cmd; + } + + public Object[] getSqlExecutionArgument() { + assertStatus("getSqlExecutionArgument"); + return new Object[] { _conditionBean }; + } + + //========================================================================== + // ========= + // Argument Information + // ==================== + public ConditionBean getConditionBean() { + return _conditionBean; + } + + public String getOutsideSqlPath() { + return null; + } + + public OutsideSqlOption getOutsideSqlOption() { + return null; + } + + //========================================================================== + // ========= + // Assert Helper + // ============= + protected void assertStatus(String methodName) { + assertBasicProperty(methodName); + assertComponentProperty(methodName); + if (_conditionBeanType == null) { + throw new IllegalStateException(buildAssertMessage( + "_conditionBeanType", methodName)); + } + if (_conditionBean == null) { + throw new IllegalStateException(buildAssertMessage( + "_conditionBean", methodName)); + } + } + + //========================================================================== + // ========= + // Accessor + // ======== + public void setConditionBeanType( + Class conditionBeanType) { + _conditionBeanType = conditionBeanType; + } + + public void setConditionBean(ConditionBean conditionBean) { + _conditionBean = conditionBean; + } +} Property changes on: notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/bhv/core/command/AbstractSelectCBCommand.java ___________________________________________________________________ Name: svn:eol-style + native Added: notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/bhv/core/command/BatchDeleteEntityCommand.java =================================================================== --- notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/bhv/core/command/BatchDeleteEntityCommand.java (rev 0) +++ notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/bhv/core/command/BatchDeleteEntityCommand.java 2008-12-27 22:13:37 UTC (rev 1628) @@ -0,0 +1,51 @@ +package jp.sf.pal.notepad.db.allcommon.bhv.core.command; + +import jp.sf.pal.notepad.db.allcommon.bhv.core.SqlExecution; +import jp.sf.pal.notepad.db.allcommon.bhv.core.SqlExecutionCreator; +import jp.sf.pal.notepad.db.allcommon.s2dao.internal.sqlcommand.InternalDeleteBatchAutoStaticCommand; + +import org.seasar.dao.BeanMetaData; + +/** + * @author DBFlute(AutoGenerator) + */ +public class BatchDeleteEntityCommand extends AbstractListEntityCommand { + + //========================================================================== + // ========= + // Basic Information + // ================= + public String getCommandName() { + return "batchDelete"; + } + + //========================================================================== + // ========= + // SqlExecution Handling + // ===================== + public SqlExecutionCreator createSqlExecutionCreator() { + assertStatus("createSqlExecutionCreator"); + return new SqlExecutionCreator() { + public SqlExecution createSqlExecution() { + final BeanMetaData bmd = createBeanMetaData(); + return createBatchDeleteEntitySqlExecution(bmd); + } + }; + } + + protected SqlExecution createBatchDeleteEntitySqlExecution(BeanMetaData bmd) { + final String[] propertyNames = getPersistentPropertyNames(bmd); + return createDeleteBatchAutoStaticCommand(bmd, propertyNames); + } + + protected InternalDeleteBatchAutoStaticCommand createDeleteBatchAutoStaticCommand( + BeanMetaData bmd, String[] propertyNames) { + boolean opt = isOptimisticLockHandling(); + return new InternalDeleteBatchAutoStaticCommand(_dataSource, + _statementFactory, bmd, propertyNames, opt); + } + + protected boolean isOptimisticLockHandling() { + return true; + } +} Property changes on: notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/bhv/core/command/BatchDeleteEntityCommand.java ___________________________________________________________________ Name: svn:eol-style + native Added: notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/bhv/core/command/BatchDeleteNonstrictEntityCommand.java =================================================================== --- notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/bhv/core/command/BatchDeleteNonstrictEntityCommand.java (rev 0) +++ notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/bhv/core/command/BatchDeleteNonstrictEntityCommand.java 2008-12-27 22:13:37 UTC (rev 1628) @@ -0,0 +1,25 @@ +package jp.sf.pal.notepad.db.allcommon.bhv.core.command; + +/** + * @author DBFlute(AutoGenerator) + */ +public class BatchDeleteNonstrictEntityCommand extends BatchDeleteEntityCommand { + + //========================================================================== + // ========= + // Basic Information + // ================= + @Override + public String getCommandName() { + return "batchDeleteNonstrict"; + } + + //========================================================================== + // ========= + // SqlExecution Handling + // ===================== + @Override + protected boolean isOptimisticLockHandling() { + return false; + } +} Property changes on: notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/bhv/core/command/BatchDeleteNonstrictEntityCommand.java ___________________________________________________________________ Name: svn:eol-style + native Added: notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/bhv/core/command/BatchInsertEntityCommand.java =================================================================== --- notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/bhv/core/command/BatchInsertEntityCommand.java (rev 0) +++ notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/bhv/core/command/BatchInsertEntityCommand.java 2008-12-27 22:13:37 UTC (rev 1628) @@ -0,0 +1,46 @@ +package jp.sf.pal.notepad.db.allcommon.bhv.core.command; + +import jp.sf.pal.notepad.db.allcommon.bhv.core.SqlExecution; +import jp.sf.pal.notepad.db.allcommon.bhv.core.SqlExecutionCreator; +import jp.sf.pal.notepad.db.allcommon.s2dao.internal.sqlcommand.InternalInsertBatchAutoStaticCommand; + +import org.seasar.dao.BeanMetaData; + +/** + * @author DBFlute(AutoGenerator) + */ +public class BatchInsertEntityCommand extends AbstractListEntityCommand { + + //========================================================================== + // ========= + // Basic Information + // ================= + public String getCommandName() { + return "batchInsert"; + } + + //========================================================================== + // ========= + // SqlExecution Handling + // ===================== + public SqlExecutionCreator createSqlExecutionCreator() { + assertStatus("createSqlExecutionCreator"); + return new SqlExecutionCreator() { + public SqlExecution createSqlExecution() { + final BeanMetaData bmd = createBeanMetaData(); + return createBatchInsertEntitySqlExecution(bmd); + } + }; + } + + protected SqlExecution createBatchInsertEntitySqlExecution(BeanMetaData bmd) { + final String[] propertyNames = getPersistentPropertyNames(bmd); + return createInsertBatchAutoStaticCommand(bmd, propertyNames); + } + + protected InternalInsertBatchAutoStaticCommand createInsertBatchAutoStaticCommand( + BeanMetaData bmd, String[] propertyNames) { + return new InternalInsertBatchAutoStaticCommand(_dataSource, + _statementFactory, bmd, propertyNames); + } +} Property changes on: notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/bhv/core/command/BatchInsertEntityCommand.java ___________________________________________________________________ Name: svn:eol-style + native Added: notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/bhv/core/command/BatchUpdateEntityCommand.java =================================================================== --- notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/bhv/core/command/BatchUpdateEntityCommand.java (rev 0) +++ notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/bhv/core/command/BatchUpdateEntityCommand.java 2008-12-27 22:13:37 UTC (rev 1628) @@ -0,0 +1,51 @@ +package jp.sf.pal.notepad.db.allcommon.bhv.core.command; + +import jp.sf.pal.notepad.db.allcommon.bhv.core.SqlExecution; +import jp.sf.pal.notepad.db.allcommon.bhv.core.SqlExecutionCreator; +import jp.sf.pal.notepad.db.allcommon.s2dao.internal.sqlcommand.InternalUpdateBatchAutoStaticCommand; + +import org.seasar.dao.BeanMetaData; + +/** + * @author DBFlute(AutoGenerator) + */ +public class BatchUpdateEntityCommand extends AbstractListEntityCommand { + + //========================================================================== + // ========= + // Basic Information + // ================= + public String getCommandName() { + return "batchUpdate"; + } + + //========================================================================== + // ========= + // SqlExecution Handling + // ===================== + public SqlExecutionCreator createSqlExecutionCreator() { + assertStatus("createSqlExecutionCreator"); + return new SqlExecutionCreator() { + public SqlExecution createSqlExecution() { + final BeanMetaData bmd = createBeanMetaData(); + return createBatchUpdateEntitySqlExecution(bmd); + } + }; + } + + protected SqlExecution createBatchUpdateEntitySqlExecution(BeanMetaData bmd) { + final String[] propertyNames = getPersistentPropertyNames(bmd); + return createUpdateBatchAutoStaticCommand(bmd, propertyNames); + } + + protected InternalUpdateBatchAutoStaticCommand createUpdateBatchAutoStaticCommand( + BeanMetaData bmd, String[] propertyNames) { + boolean opt = isOptimisticLockHandling(); + return new InternalUpdateBatchAutoStaticCommand(_dataSource, + _statementFactory, bmd, propertyNames, opt, opt); + } + + protected boolean isOptimisticLockHandling() { + return true; + } +} Property changes on: notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/bhv/core/command/BatchUpdateEntityCommand.java ___________________________________________________________________ Name: svn:eol-style + native Added: notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/bhv/core/command/BatchUpdateNonstrictEntityCommand.java =================================================================== --- notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/bhv/core/command/BatchUpdateNonstrictEntityCommand.java (rev 0) +++ notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/bhv/core/command/BatchUpdateNonstrictEntityCommand.java 2008-12-27 22:13:37 UTC (rev 1628) @@ -0,0 +1,25 @@ +package jp.sf.pal.notepad.db.allcommon.bhv.core.command; + +/** + * @author DBFlute(AutoGenerator) + */ +public class BatchUpdateNonstrictEntityCommand extends BatchUpdateEntityCommand { + + //========================================================================== + // ========= + // Basic Information + // ================= + @Override + public String getCommandName() { + return "batchUpdateNonstrict"; + } + + //========================================================================== + // ========= + // SqlExecution Handling + // ===================== + @Override + protected boolean isOptimisticLockHandling() { + return false; + } +} Property changes on: notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/bhv/core/command/BatchUpdateNonstrictEntityCommand.java ___________________________________________________________________ Name: svn:eol-style + native Added: notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/bhv/core/command/DeleteEntityCommand.java =================================================================== --- notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/bhv/core/command/DeleteEntityCommand.java (rev 0) +++ notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/bhv/core/command/DeleteEntityCommand.java 2008-12-27 22:13:37 UTC (rev 1628) @@ -0,0 +1,51 @@ +package jp.sf.pal.notepad.db.allcommon.bhv.core.command; + +import jp.sf.pal.notepad.db.allcommon.bhv.core.SqlExecution; +import jp.sf.pal.notepad.db.allcommon.bhv.core.SqlExecutionCreator; +import jp.sf.pal.notepad.db.allcommon.s2dao.internal.sqlcommand.InternalDeleteAutoStaticCommand; + +import org.seasar.dao.BeanMetaData; + +/** + * @author DBFlute(AutoGenerator) + */ +public class DeleteEntityCommand extends AbstractEntityCommand { + + //========================================================================== + // ========= + // Basic Information + // ================= + public String getCommandName() { + return "delete"; + } + + //========================================================================== + // ========= + // SqlExecution Handling + // ===================== + public SqlExecutionCreator createSqlExecutionCreator() { + assertStatus("createSqlExecutionCreator"); + return new SqlExecutionCreator() { + public SqlExecution createSqlExecution() { + final BeanMetaData bmd = createBeanMetaData(); + return createDeleteEntitySqlExecution(bmd); + } + }; + } + + protected SqlExecution createDeleteEntitySqlExecution(BeanMetaData bmd) { + final String[] propertyNames = getPersistentPropertyNames(bmd); + return createDeleteAutoStaticCommand(bmd, propertyNames); + } + + protected InternalDeleteAutoStaticCommand createDeleteAutoStaticCommand( + BeanMetaData bmd, String[] propertyNames) { + return new InternalDeleteAutoStaticCommand(_dataSource, + _statementFactory, bmd, propertyNames, + isOptimisticLockHandling()); + } + + protected boolean isOptimisticLockHandling() { + return true; + } +} Property changes on: notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/bhv/core/command/DeleteEntityCommand.java ___________________________________________________________________ Name: svn:eol-style + native Added: notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/bhv/core/command/DeleteNonstrictEntityCommand.java =================================================================== --- notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/bhv/core/command/DeleteNonstrictEntityCommand.java (rev 0) +++ notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/bhv/core/command/DeleteNonstrictEntityCommand.java 2008-12-27 22:13:37 UTC (rev 1628) @@ -0,0 +1,25 @@ +package jp.sf.pal.notepad.db.allcommon.bhv.core.command; + +/** + * @author DBFlute(AutoGenerator) + */ +public class DeleteNonstrictEntityCommand extends DeleteEntityCommand { + + //========================================================================== + // ========= + // Basic Information + // ================= + @Override + public String getCommandName() { + return "deleteNonstrict"; + } + + //========================================================================== + // ========= + // SqlExecution Handling + // ===================== + @Override + protected boolean isOptimisticLockHandling() { + return false; + } +} Property changes on: notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/bhv/core/command/DeleteNonstrictEntityCommand.java ___________________________________________________________________ Name: svn:eol-style + native Added: notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/bhv/core/command/InsertEntityCommand.java =================================================================== --- notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/bhv/core/command/InsertEntityCommand.java (rev 0) +++ notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/bhv/core/command/InsertEntityCommand.java 2008-12-27 22:13:37 UTC (rev 1628) @@ -0,0 +1,86 @@ +package jp.sf.pal.notepad.db.allcommon.bhv.core.command; + +import java.util.List; + +import jp.sf.pal.notepad.db.allcommon.bhv.core.SqlExecution; +import jp.sf.pal.notepad.db.allcommon.bhv.core.SqlExecutionCreator; +import jp.sf.pal.notepad.db.allcommon.dbmeta.DBMeta; +import jp.sf.pal.notepad.db.allcommon.dbmeta.info.ColumnInfo; +import jp.sf.pal.notepad.db.allcommon.s2dao.internal.sqlcommand.InternalInsertAutoDynamicCommand; + +import org.seasar.dao.BeanMetaData; + +/** + * @author DBFlute(AutoGenerator) + */ +public class InsertEntityCommand extends AbstractEntityCommand { + + //========================================================================== + // ========= + // Basic Information + // ================= + public String getCommandName() { + return "insert"; + } + + //========================================================================== + // ========= + // SqlExecution Handling + // ===================== + public SqlExecutionCreator createSqlExecutionCreator() { + assertStatus("createSqlExecutionCreator"); + return new SqlExecutionCreator() { + public SqlExecution createSqlExecution() { + final BeanMetaData bmd = createBeanMetaData(); + return createInsertEntitySqlExecution(bmd); + } + }; + } + + protected SqlExecution createInsertEntitySqlExecution(BeanMetaData bmd) { + final SqlExecution nonPrimaryKeySqlExecution = createNonPrimaryInsertSqlExecution(bmd); + if (nonPrimaryKeySqlExecution != null) { + return nonPrimaryKeySqlExecution; + } + final String[] propertyNames = getPersistentPropertyNames(bmd); + return createInsertAutoDynamicCommand(bmd, propertyNames); + } + + protected InternalInsertAutoDynamicCommand createInsertAutoDynamicCommand( + BeanMetaData bmd, String[] propertyNames) { + final InternalInsertAutoDynamicCommand cmd = new InternalInsertAutoDynamicCommand(); + cmd.setBeanMetaData(bmd); + cmd.setDataSource(_dataSource); + cmd.setPropertyNames(propertyNames); + cmd.setStatementFactory(_statementFactory); + return cmd; + } + + /** + * @param bmd The meta data of bean. (NotNull) + * @return Whether the method is target. (For example if it has primary key, + * returns false.) + */ + protected SqlExecution createNonPrimaryInsertSqlExecution(BeanMetaData bmd) { + final DBMeta dbmeta = findDBMeta(); + if (dbmeta.hasPrimaryKey()) { + return null; + } + final List columnInfoList = dbmeta.getColumnInfoList(); + final StringBuilder columnDefSb = new StringBuilder(); + for (jp.sf.pal.notepad.db.allcommon.dbmeta.info.ColumnInfo columnInfo : columnInfoList) { + columnDefSb.append(", ").append(columnInfo.getColumnDbName()); + } + columnDefSb.delete(0, ", ".length()).insert(0, "(").append(")"); + final StringBuilder columnValuesSb = new StringBuilder(); + for (jp.sf.pal.notepad.db.allcommon.dbmeta.info.ColumnInfo columnInfo : columnInfoList) { + columnValuesSb.append(", /*dto.").append( + columnInfo.getPropertyName()).append("*/null"); + } + columnValuesSb.delete(0, ", ".length()).insert(0, "(").append(")"); + final String sql = "insert into " + dbmeta.getTableSqlName() + + columnDefSb + " values" + columnValuesSb; + return createUpdateDynamicCommand(new String[] { "dto" }, + new Class[] { _entityType }, sql); + } +} Property changes on: notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/bhv/core/command/InsertEntityCommand.java ___________________________________________________________________ Name: svn:eol-style + native Added: notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/bhv/core/command/OutsideSqlCallCommand.java =================================================================== --- notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/bhv/core/command/OutsideSqlCallCommand.java (rev 0) +++ notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/bhv/core/command/OutsideSqlCallCommand.java 2008-12-27 22:13:37 UTC (rev 1628) @@ -0,0 +1,152 @@ +package jp.sf.pal.notepad.db.allcommon.bhv.core.command; + +import jp.sf.pal.notepad.db.allcommon.bhv.core.SqlExecution; +import jp.sf.pal.notepad.db.allcommon.bhv.core.SqlExecutionCreator; +import jp.sf.pal.notepad.db.allcommon.cbean.outsidesql.OutsideSqlContext; +import jp.sf.pal.notepad.db.allcommon.cbean.outsidesql.OutsideSqlOption; +import jp.sf.pal.notepad.db.allcommon.s2dao.internal.sqlcommand.InternalProcedureCommand; +import jp.sf.pal.notepad.db.allcommon.s2dao.internal.various.InternalProcedureMetaData; +import jp.sf.pal.notepad.db.allcommon.s2dao.internal.various.InternalProcedureMetaDataFactory; + +import org.seasar.extension.jdbc.ResultSetHandler; + +/** + * The behavior command for OutsideSql.execute(). + * + * @author DBFlute(AutoGenerator) + */ +public class OutsideSqlCallCommand extends AbstractOutsideSqlCommand { + + //========================================================================== + // ========= + // Basic Information + // ================= + public String getCommandName() { + return "call"; + } + + public Class getCommandReturnType() { + return void.class; + } + + //========================================================================== + // ========= + // Detail Information + // ================== + public boolean isProcedure() { + return true; + } + + public boolean isSelect() { + return false; + } + + //========================================================================== + // ========= + // Process Callback + // ================ + public void beforeGettingSqlExecution() { + assertStatus("beforeGettingSqlExecution"); + final String path = _outsideSqlPath; + final Object pmb = _parameterBean; + final OutsideSqlOption option = _outsideSqlOption; + final OutsideSqlContext outsideSqlContext = new OutsideSqlContext(); + outsideSqlContext.setDynamicBinding(option.isDynamicBinding()); + outsideSqlContext.setOffsetByCursorForcedly(option.isAutoPaging()); + outsideSqlContext.setLimitByCursorForcedly(option.isAutoPaging()); + outsideSqlContext.setOutsideSqlPath(path); + outsideSqlContext.setParameterBean(pmb); + outsideSqlContext.setMethodName(getCommandName()); + outsideSqlContext.setStatementConfig(option.getStatementConfig()); + outsideSqlContext.setTableDbName(option.getTableDbName()); + outsideSqlContext.setupBehaviorQueryPathIfNeeds(); + OutsideSqlContext.setOutsideSqlContextOnThread(outsideSqlContext); + } + + public void afterExecuting() { + } + + //========================================================================== + // ========= + // SqlExecution Handling + // ===================== + public String buildSqlExecutionKey() { + assertStatus("buildSqlExecutionKey"); + return generateSpecifiedOutsideSqlUniqueKey(); + } + + protected String generateSpecifiedOutsideSqlUniqueKey() { + final String methodName = getCommandName(); + final String path = _outsideSqlPath; + final Object pmb = _parameterBean; + final OutsideSqlOption option = _outsideSqlOption; + return OutsideSqlContext.generateSpecifiedOutsideSqlUniqueKey( + methodName, path, pmb, option, null); + } + + public SqlExecutionCreator createSqlExecutionCreator() { + assertStatus("createSqlExecutionCreator"); + return new SqlExecutionCreator() { + public SqlExecution createSqlExecution() { + final OutsideSqlContext outsideSqlContext = OutsideSqlContext + .getOutsideSqlContextOnThread(); + return createOutsideSqlCallCommand(outsideSqlContext); + } + }; + } + + protected SqlExecution createOutsideSqlCallCommand( + OutsideSqlContext outsideSqlContext) { + // - - - - - - - - - - - - - - - - - - - - - - - + // The attribute of Specified-OutsideSqlContext. + // - - - - - - - - - - - - - - - - - - - - - - - + final Object pmb = outsideSqlContext.getParameterBean(); + final String procedureName = outsideSqlContext.getOutsideSqlPath(); + + // - - - - - - - - - - - - - - - + // The attribute of SqlCommand. + // - - - - - - - - - - - - - - - + final InternalProcedureMetaDataFactory factory = createProcedureMetaDataFactory(); + factory.setValueTypeFactory(_valueTypeFactory); + final Class pmbType = (pmb != null ? pmb.getClass() : null); + final InternalProcedureMetaData metaData = factory + .createProcedureMetaData(procedureName, pmbType); + return createProcedureCommand(metaData); + } + + protected InternalProcedureMetaDataFactory createProcedureMetaDataFactory() { + return new InternalProcedureMetaDataFactory(); + } + + protected InternalProcedureCommand createProcedureCommand( + InternalProcedureMetaData metaData) { + // Because a procedure command does not use result set handler. + final ResultSetHandler resultSetHandler = new InternalNullResultSetHandler(); + return new InternalProcedureCommand(_dataSource, resultSetHandler, + _statementFactory, metaData); + } + + // /- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + // - - + // InternalProcedureCommand switches argument so this is unnecessary + // actually! + // - - - - - - - - - -/ + public Object[] getSqlExecutionArgument() { + return new Object[] { _parameterBean }; + } + + //========================================================================== + // ========= + // Assert Helper + // ============= + protected void assertStatus(String methodName) { + assertBasicProperty(methodName); + assertComponentProperty(methodName); + assertOutsideSqlBasic(methodName); + if (_parameterBean == null) { + String msg = "The property 'parameterBean' should not be null"; + msg = msg + " when you call " + methodName + "()."; + throw new IllegalStateException(msg); + } + } +} Property changes on: notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/bhv/core/command/OutsideSqlCallCommand.java ___________________________________________________________________ Name: svn:eol-style + native Added: notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/bhv/core/command/OutsideSqlExecuteCommand.java =================================================================== --- notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/bhv/core/command/OutsideSqlExecuteCommand.java (rev 0) +++ notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/bhv/core/command/OutsideSqlExecuteCommand.java 2008-12-27 22:13:37 UTC (rev 1628) @@ -0,0 +1,128 @@ +package jp.sf.pal.notepad.db.allcommon.bhv.core.command; + +import jp.sf.pal.notepad.db.allcommon.bhv.core.SqlExecution; +import jp.sf.pal.notepad.db.allcommon.bhv.core.SqlExecutionCreator; +import jp.sf.pal.notepad.db.allcommon.cbean.outsidesql.OutsideSqlContext; +import jp.sf.pal.notepad.db.allcommon.cbean.outsidesql.OutsideSqlOption; + +/** + * The behavior command for OutsideSql.execute(). + * + * @author DBFlute(AutoGenerator) + */ +public class OutsideSqlExecuteCommand extends + AbstractOutsideSqlCommand { + + //========================================================================== + // ========= + // Basic Information + // ================= + public String getCommandName() { + return "execute"; + } + + public Class getCommandReturnType() { + return Integer.class; + } + + //========================================================================== + // ========= + // Detail Information + // ================== + public boolean isProcedure() { + return false; + } + + public boolean isSelect() { + return false; + } + + //========================================================================== + // ========= + // Process Callback + // ================ + public void beforeGettingSqlExecution() { + assertStatus("beforeGettingSqlExecution"); + final String path = _outsideSqlPath; + final Object pmb = _parameterBean; + final OutsideSqlOption option = _outsideSqlOption; + final OutsideSqlContext outsideSqlContext = new OutsideSqlContext(); + outsideSqlContext.setDynamicBinding(option.isDynamicBinding()); + outsideSqlContext.setOffsetByCursorForcedly(option.isAutoPaging()); + outsideSqlContext.setLimitByCursorForcedly(option.isAutoPaging()); + outsideSqlContext.setOutsideSqlPath(path); + outsideSqlContext.setParameterBean(pmb); + outsideSqlContext.setMethodName(getCommandName()); + outsideSqlContext.setStatementConfig(option.getStatementConfig()); + outsideSqlContext.setTableDbName(option.getTableDbName()); + outsideSqlContext.setupBehaviorQueryPathIfNeeds(); + OutsideSqlContext.setOutsideSqlContextOnThread(outsideSqlContext); + } + + public void afterExecuting() { + } + + //========================================================================== + // ========= + // SqlExecution Handling + // ===================== + public String buildSqlExecutionKey() { + assertStatus("buildSqlExecutionKey"); + return generateSpecifiedOutsideSqlUniqueKey(); + } + + protected String generateSpecifiedOutsideSqlUniqueKey() { + final String methodName = getCommandName(); + final String path = _outsideSqlPath; + final Object pmb = _parameterBean; + final OutsideSqlOption option = _outsideSqlOption; + return OutsideSqlContext.generateSpecifiedOutsideSqlUniqueKey( + methodName, path, pmb, option, null); + } + + public SqlExecutionCreator createSqlExecutionCreator() { + assertStatus("createSqlExecutionCreator"); + return new SqlExecutionCreator() { + public SqlExecution createSqlExecution() { + final OutsideSqlContext outsideSqlContext = OutsideSqlContext + .getOutsideSqlContextOnThread(); + return createOutsideSqlExecuteExecution(outsideSqlContext); + } + }; + } + + protected SqlExecution createOutsideSqlExecuteExecution( + OutsideSqlContext outsideSqlContext) { + // - - - - - - - - - - - - - - - - - - - - - - - + // The attribute of Specified-OutsideSqlContext. + // - - - - - - - - - - - - - - - - - - - - - - - + final String suffix = buildDbmsSuffix(); + final String sql = outsideSqlContext.readFilteredOutsideSql( + _sqlFileEncoding, suffix); + final Object pmb = outsideSqlContext.getParameterBean(); + + // - - - - - - - - - - - - - - - + // The attribute of SqlCommand. + // - - - - - - - - - - - - - - - + final String[] argNames = (pmb != null ? new String[] { "pmb" } + : new String[] {}); + final Class[] argTypes = (pmb != null ? new Class[] { pmb + .getClass() } : new Class[] {}); + + return createUpdateDynamicCommand(argNames, argTypes, sql); + } + + public Object[] getSqlExecutionArgument() { + return new Object[] { _parameterBean }; + } + + //========================================================================== + // ========= + // Assert Helper + // ============= + protected void assertStatus(String methodName) { + assertBasicProperty(methodName); + assertComponentProperty(methodName); + assertOutsideSqlBasic(methodName); + } +} Property changes on: notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/bhv/core/command/OutsideSqlExecuteCommand.java ___________________________________________________________________ Name: svn:eol-style + native Added: notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/bhv/core/command/OutsideSqlSelectCursorCommand.java =================================================================== --- notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/bhv/core/command/OutsideSqlSelectCursorCommand.java (rev 0) +++ notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/bhv/core/command/OutsideSqlSelectCursorCommand.java 2008-12-27 22:13:37 UTC (rev 1628) @@ -0,0 +1,77 @@ +package jp.sf.pal.notepad.db.allcommon.bhv.core.command; + +import java.sql.ResultSet; +import java.sql.SQLException; + +import jp.sf.pal.notepad.db.allcommon.jdbc.CursorHandler; + +import org.seasar.extension.jdbc.ResultSetHandler; + +/** + * The behavior command for OutsideSql.selectList(). + * + * @author DBFlute(AutoGenerator) + */ +public class OutsideSqlSelectCursorCommand extends + AbstractOutsideSqlSelectCommand { + + //========================================================================== + // ========= + // Attribute + // ========= + /** The handler of cursor. (Required) */ + protected CursorHandler _cursorHandler; + + //========================================================================== + // ========= + // Basic Information + // ================= + public String getCommandName() { + return "selectCursor"; + } + + public Class getCommandReturnType() { + return Object.class; + } + + //========================================================================== + // ========= + // Extension Point + // =============== + @Override + protected ResultSetHandler createOutsideSqlSelectResultSetHandler() { + return new ResultSetHandler() { + public Object handle(ResultSet rs) throws SQLException { + return _cursorHandler.handle(rs); + } + }; + } + + @Override + protected Object getResultTypeSpecification() { + return _cursorHandler; + } + + //========================================================================== + // ========= + // Assert Helper + // ============= + @Override + protected void assertStatus(String methodName) { + assertBasicProperty(methodName); + assertComponentProperty(methodName); + assertOutsideSqlBasic(methodName); + if (_cursorHandler == null) { + throw new IllegalStateException(buildAssertMessage( + "_cursorHandler", methodName)); + } + } + + //========================================================================== + // ========= + // Accessor + // ======== + public void setCursorHandler(CursorHandler cursorHandler) { + _cursorHandler = cursorHandler; + } +} Property changes on: notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/bhv/core/command/OutsideSqlSelectCursorCommand.java ___________________________________________________________________ Name: svn:eol-style + native Added: notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/bhv/core/command/OutsideSqlSelectListCommand.java =================================================================== --- notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/bhv/core/command/OutsideSqlSelectListCommand.java (rev 0) +++ notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/bhv/core/command/OutsideSqlSelectListCommand.java 2008-12-27 22:13:37 UTC (rev 1628) @@ -0,0 +1,96 @@ +package jp.sf.pal.notepad.db.allcommon.bhv.core.command; + +import java.util.List; + +import org.seasar.dao.BeanMetaData; +import org.seasar.extension.jdbc.ResultSetHandler; +import org.seasar.extension.jdbc.ValueType; +import org.seasar.extension.jdbc.types.ValueTypes; + +/** + * The behavior command for OutsideSql.selectList(). + * + * @author DBFlute(AutoGenerator) + * @param The type of entity. + */ +public class OutsideSqlSelectListCommand extends + AbstractOutsideSqlSelectCommand> { + + //========================================================================== + // ========= + // Attribute + // ========= + /** The type of entity. (Required) */ + protected Class _entityType; + + //========================================================================== + // ========= + // Basic Information + // ================= + public String getCommandName() { + return "selectList"; + } + + public Class getCommandReturnType() { + return List.class; + } + + //========================================================================== + // ========= + // Factory + // ======= + // ----------------------------------------------------- + // BeanMetaData + // ------------ + protected BeanMetaData createBeanMetaData() { + assertEntityType("createBeanMetaData"); + return _beanMetaDataFactory.createBeanMetaData(_entityType); + } + + // ----------------------------------------------------- + // ResultSetHandler + // ---------------- + protected ResultSetHandler createOutsideSqlBeanListResultSetHandler( + BeanMetaData bmd) { + final ValueType valueType = ValueTypes.getValueType(_entityType); + if (valueType == null || !valueType.equals(ValueTypes.OBJECT)) { + return createObjectListResultSetHandler(valueType); + } + return createBeanListMetaDataResultSetHandler(bmd); + } + + //========================================================================== + // ========= + // Extension Point + // =============== + @Override + protected ResultSetHandler createOutsideSqlSelectResultSetHandler() { + final BeanMetaData bmd = createBeanMetaData(); + final ResultSetHandler handler = createOutsideSqlBeanListResultSetHandler(bmd); + return handler; + } + + @Override + protected Object getResultTypeSpecification() { + return _entityType; + } + + //========================================================================== + // ========= + // Assert Helper + // ============= + protected void assertEntityType(String methodName) { + if (_entityType == null) { + throw new IllegalStateException(buildAssertMessage("_entityType", + methodName)); + } + } + + //========================================================================== + // ========= + // Accessor + // ======== + public void setEntityType(Class entityType) { + _entityType = entityType; + } +} Property changes on: notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/bhv/core/command/OutsideSqlSelectListCommand.java ___________________________________________________________________ Name: svn:eol-style + native Added: notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/bhv/core/command/QueryDeleteCBCommand.java =================================================================== --- notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/bhv/core/command/QueryDeleteCBCommand.java (rev 0) +++ notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/bhv/core/command/QueryDeleteCBCommand.java 2008-12-27 22:13:37 UTC (rev 1628) @@ -0,0 +1,151 @@ +package jp.sf.pal.notepad.db.allcommon.bhv.core.command; + +import jp.sf.pal.notepad.db.allcommon.bhv.core.SqlExecution; +import jp.sf.pal.notepad.db.allcommon.bhv.core.SqlExecutionCreator; +import jp.sf.pal.notepad.db.allcommon.cbean.ConditionBean; +import jp.sf.pal.notepad.db.allcommon.cbean.ConditionBeanContext; +import jp.sf.pal.notepad.db.allcommon.cbean.FetchNarrowingBeanContext; +import jp.sf.pal.notepad.db.allcommon.cbean.outsidesql.OutsideSqlOption; +import jp.sf.pal.notepad.db.allcommon.s2dao.internal.sqlcommand.InternalDeleteQueryAutoDynamicCommand; + +/** + * @author DBFlute(AutoGenerator) + */ +public class QueryDeleteCBCommand extends AbstractBehaviorCommand { + + //========================================================================== + // ========= + // Attribute + // ========= + /** The type of condition-bean. (Derived from conditionBean) */ + protected Class _conditionBeanType; + + /** The instance of condition-bean. (Required) */ + protected ConditionBean _conditionBean; + + //========================================================================== + // ========= + // Basic Information + // ================= + public String getCommandName() { + return "queryDelete"; + } + + public Class getCommandReturnType() { + return int.class; + } + + //========================================================================== + // ========= + // Detail Information + // ================== + public boolean isConditionBean() { + return true; + } + + public boolean isOutsideSql() { + return false; + } + + public boolean isProcedure() { + return false; + } + + public boolean isSelect() { + return false; + } + + public boolean isSelectCount() { + return false; + } + + //========================================================================== + // ========= + // Process Callback + // ================ + public void beforeGettingSqlExecution() { + assertStatus("beforeGettingSqlExecution"); + final ConditionBean cb = _conditionBean; + FetchNarrowingBeanContext.setFetchNarrowingBeanOnThread(cb); + ConditionBeanContext.setConditionBeanOnThread(cb); + } + + public void afterExecuting() { + } + + //========================================================================== + // ========= + // SqlExecution Handling + // ===================== + public String buildSqlExecutionKey() { + assertStatus("buildSqlExecutionKey"); + return _tableDbName + ":" + getCommandName() + "(" + + _conditionBeanType.getSimpleName() + ")"; + } + + public SqlExecutionCreator createSqlExecutionCreator() { + assertStatus("createSqlExecutionCreator"); + return new SqlExecutionCreator() { + public SqlExecution createSqlExecution() { + return createQueryDeleteCBExecution(_conditionBeanType); + } + }; + } + + protected SqlExecution createQueryDeleteCBExecution( + Class cbType) { + return new InternalDeleteQueryAutoDynamicCommand(_dataSource, + _statementFactory); + } + + public Object[] getSqlExecutionArgument() { + assertStatus("getSqlExecutionArgument"); + return new Object[] { _conditionBean }; + } + + //========================================================================== + // ========= + // Argument Information + // ==================== + public ConditionBean getConditionBean() { + return _conditionBean; + } + + public String getOutsideSqlPath() { + return null; + } + + public OutsideSqlOption getOutsideSqlOption() { + return null; + } + + //========================================================================== + // ========= + // Assert Helper + // ============= + protected void assertStatus(String methodName) { + assertBasicProperty(methodName); + assertComponentProperty(methodName); + if (_conditionBeanType == null) { + throw new IllegalStateException(buildAssertMessage( + "_conditionBeanType", methodName)); + } + if (_conditionBean == null) { + throw new IllegalStateException(buildAssertMessage( + "_conditionBean", methodName)); + } + } + + //========================================================================== + // ========= + // Accessor + // ======== + public void setConditionBeanType( + Class conditionBeanType) { + _conditionBeanType = conditionBeanType; + } + + public void setConditionBean(ConditionBean conditionBean) { + _conditionBean = conditionBean; + } +} Property changes on: notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/bhv/core/command/QueryDeleteCBCommand.java ___________________________________________________________________ Name: svn:eol-style + native Added: notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/bhv/core/command/QueryUpdateEntityCBCommand.java =================================================================== --- notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/bhv/core/command/QueryUpdateEntityCBCommand.java (rev 0) +++ notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/bhv/core/command/QueryUpdateEntityCBCommand.java 2008-12-27 22:13:37 UTC (rev 1628) @@ -0,0 +1,140 @@ +package jp.sf.pal.notepad.db.allcommon.bhv.core.command; + +import jp.sf.pal.notepad.db.allcommon.bhv.core.SqlExecution; +import jp.sf.pal.notepad.db.allcommon.bhv.core.SqlExecutionCreator; +import jp.sf.pal.notepad.db.allcommon.cbean.ConditionBean; +import jp.sf.pal.notepad.db.allcommon.cbean.ConditionBeanContext; +import jp.sf.pal.notepad.db.allcommon.cbean.FetchNarrowingBeanContext; +import jp.sf.pal.notepad.db.allcommon.cbean.outsidesql.OutsideSqlOption; +import jp.sf.pal.notepad.db.allcommon.s2dao.internal.sqlcommand.InternalUpdateQueryAutoDynamicCommand; + +/** + * @author DBFlute(AutoGenerator) + */ +public class QueryUpdateEntityCBCommand extends AbstractEntityCommand { + + //========================================================================== + // ========= + // Attribute + // ========= + /** The type of condition-bean. (Derived from conditionBean) */ + protected Class _conditionBeanType; + + /** The instance of condition-bean. (Required) */ + protected ConditionBean _conditionBean; + + //========================================================================== + // ========= + // Basic Information + // ================= + public String getCommandName() { + return "queryUpdate"; + } + + //========================================================================== + // ========= + // Detail Information + // ================== + @Override + public boolean isConditionBean() { + return true; + } + + //========================================================================== + // ========= + // Process Callback + // ================ + @Override + public void beforeGettingSqlExecution() { + assertStatus("beforeGettingSqlExecution"); + final ConditionBean cb = _conditionBean; + FetchNarrowingBeanContext.setFetchNarrowingBeanOnThread(cb); + ConditionBeanContext.setConditionBeanOnThread(cb); + } + + //========================================================================== + // ========= + // SqlExecution Handling + // ===================== + public String buildSqlExecutionKey() { + assertStatus("buildSqlExecutionKey"); + return _tableDbName + ":" + getCommandName() + "(" + + _entityType.getSimpleName() + ", " + + _conditionBeanType.getSimpleName() + ")"; + } + + public SqlExecutionCreator createSqlExecutionCreator() { + assertStatus("createSqlExecutionCreator"); + return new SqlExecutionCreator() { + public SqlExecution createSqlExecution() { + return createQueryUpdateEntityCBExecution(_conditionBeanType); + } + }; + } + + protected SqlExecution createQueryUpdateEntityCBExecution( + Class cbType) { + return new InternalUpdateQueryAutoDynamicCommand(_dataSource, + _statementFactory); + } + + public Object[] getSqlExecutionArgument() { + assertStatus("getSqlExecutionArgument"); + return new Object[] { _conditionBean, _entity }; + } + + //========================================================================== + // ========= + // Argument Information + // ==================== + public ConditionBean getConditionBean() { + return _conditionBean; + } + + public String getOutsideSqlPath() { + return null; + } + + public OutsideSqlOption getOutsideSqlOption() { + return null; + } + + //========================================================================== + // ========= + // Assert Helper + // ============= + @Override + protected void assertStatus(String methodName) { + assertBasicProperty(methodName); + assertComponentProperty(methodName); + if (_entityType == null) { + throw new IllegalStateException(buildAssertMessage("_entityType", + methodName)); + } + if (_entity == null) { + throw new IllegalStateException(buildAssertMessage("_entity", + methodName)); + } + if (_conditionBeanType == null) { + throw new IllegalStateException(buildAssertMessage( + "_conditionBeanType", methodName)); + } + if (_conditionBean == null) { + throw new IllegalStateException(buildAssertMessage( + "_conditionBean", methodName)); + } + } + + //========================================================================== + // ========= + // Accessor + // ======== + public void setConditionBeanType( + Class conditionBeanType) { + _conditionBeanType = conditionBeanType; + } + + public void setConditionBean(ConditionBean conditionBean) { + _conditionBean = conditionBean; + } +} Property changes on: notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/bhv/core/command/QueryUpdateEntityCBCommand.java ___________________________________________________________________ Name: svn:eol-style + native Added: notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/bhv/core/command/SelectCountCBCommand.java =================================================================== --- notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/bhv/core/command/SelectCountCBCommand.java (rev 0) +++ notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/bhv/core/command/SelectCountCBCommand.java 2008-12-27 22:13:37 UTC (rev 1628) @@ -0,0 +1,65 @@ +package jp.sf.pal.notepad.db.allcommon.bhv.core.command; + +import jp.sf.pal.notepad.db.allcommon.bhv.core.SqlExecution; +import jp.sf.pal.notepad.db.allcommon.bhv.core.SqlExecutionCreator; +import jp.sf.pal.notepad.db.allcommon.cbean.ConditionBean; +import jp.sf.pal.notepad.db.allcommon.cbean.ConditionBeanContext; + +import org.seasar.extension.jdbc.ResultSetHandler; + +/** + * @author DBFlute(AutoGenerator) + */ +public class SelectCountCBCommand extends AbstractSelectCBCommand { + + //========================================================================== + // ========= + // Basic Information + // ================= + public String getCommandName() { + return "selectCount"; + } + + public Class getCommandReturnType() { + return Integer.class; + } + + //========================================================================== + // ========= + // Process Callback + // ================ + public void beforeGettingSqlExecution() { + assertStatus("beforeGettingSqlExecution"); + final ConditionBean cb = _conditionBean; + cb.xsetupSelectCountIgnoreFetchScope(); // *Point! + ConditionBeanContext.setConditionBeanOnThread(cb); + } + + public void afterExecuting() { + assertStatus("afterExecuting"); + final ConditionBean cb = _conditionBean; + cb.xafterCareSelectCountIgnoreFetchScope(); + } + + //========================================================================== + // ========= + // Detail Information + // ================== + public boolean isSelectCount() { + return true; + } + + //========================================================================== + // ========= + // SqlExecution Handling + // ===================== + public SqlExecutionCreator createSqlExecutionCreator() { + assertStatus("createSqlExecutionCreator"); + return new SqlExecutionCreator() { + public SqlExecution createSqlExecution() { + ResultSetHandler handler = createObjectResultSetHandler(getCommandReturnType()); + return createSelectCBExecution(_conditionBeanType, handler); + } + }; + } +} Property changes on: notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/bhv/core/command/SelectCountCBCommand.java ___________________________________________________________________ Name: svn:eol-style + native Added: notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/bhv/core/command/SelectListCBCommand.java =================================================================== --- notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/bhv/core/command/SelectListCBCommand.java (rev 0) +++ notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/bhv/core/command/SelectListCBCommand.java 2008-12-27 22:13:37 UTC (rev 1628) @@ -0,0 +1,103 @@ +package jp.sf.pal.notepad.db.allcommon.bhv.core.command; + +import java.util.List; + +import jp.sf.pal.notepad.db.allcommon.Entity; +import jp.sf.pal.notepad.db.allcommon.bhv.core.SqlExecution; +import jp.sf.pal.notepad.db.allcommon.bhv.core.SqlExecutionCreator; +import jp.sf.pal.notepad.db.allcommon.cbean.ConditionBean; +import jp.sf.pal.notepad.db.allcommon.cbean.ConditionBeanContext; +import jp.sf.pal.notepad.db.allcommon.cbean.FetchNarrowingBeanContext; + +import org.seasar.dao.BeanMetaData; +import org.seasar.extension.jdbc.ResultSetHandler; + +/** + * @author DBFlute(AutoGenerator) + * @param The type of entity. + */ +public class SelectListCBCommand extends + AbstractSelectCBCommand> { + + //========================================================================== + // ========= + // Attribute + // ========= + /** The type of entity. (Required) */ + protected Class _entityType; + + //========================================================================== + // ========= + // Basic Information + // ================= + public String getCommandName() { + return "selectList"; + } + + public Class getCommandReturnType() { + return List.class; + } + + //========================================================================== + // ========= + // Detail Information + // ================== + public boolean isSelectCount() { + return false; + } + + //========================================================================== + // ========= + // Process Callback + // ================ + public void beforeGettingSqlExecution() { + assertStatus("beforeGettingSqlExecution"); + final ConditionBean cb = _conditionBean; + FetchNarrowingBeanContext.setFetchNarrowingBeanOnThread(cb); + ConditionBeanContext.setConditionBeanOnThread(cb); + } + + public void afterExecuting() { + assertStatus("afterExecuting"); + } + + //========================================================================== + // ========= + // SqlExecution Handling + // ===================== + public SqlExecutionCreator createSqlExecutionCreator() { + assertStatus("createSqlExecutionCreator"); + return new SqlExecutionCreator() { + public SqlExecution createSqlExecution() { + BeanMetaData bmd = createBeanMetaData(); + ResultSetHandler handler = createBeanListMetaDataResultSetHandler(bmd); + return createSelectCBExecution(_conditionBeanType, handler); + } + }; + } + + protected BeanMetaData createBeanMetaData() { + return _beanMetaDataFactory.createBeanMetaData(_entityType); + } + + //========================================================================== + // ========= + // Assert Helper + // ============= + @Override + protected void assertStatus(String methodName) { + super.assertStatus(methodName); + if (_entityType == null) { + throw new IllegalStateException(buildAssertMessage("_entityType", + methodName)); + } + } + + //========================================================================== + // ========= + // Accessor + // ======== + public void setEntityType(Class entityType) { + _entityType = entityType; + } +} Property changes on: notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/bhv/core/command/SelectListCBCommand.java ___________________________________________________________________ Name: svn:eol-style + native Added: notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/bhv/core/command/SelectNextValCommand.java =================================================================== --- notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/bhv/core/command/SelectNextValCommand.java (rev 0) +++ notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/bhv/core/command/SelectNextValCommand.java 2008-12-27 22:13:37 UTC (rev 1628) @@ -0,0 +1,162 @@ +package jp.sf.pal.notepad.db.allcommon.bhv.core.command; + +import jp.sf.pal.notepad.db.allcommon.bhv.core.SqlExecution; +import jp.sf.pal.notepad.db.allcommon.bhv.core.SqlExecutionCreator; +import jp.sf.pal.notepad.db.allcommon.bhv.core.execution.BasicSelectExecution; +import jp.sf.pal.notepad.db.allcommon.cbean.ConditionBean; +import jp.sf.pal.notepad.db.allcommon.cbean.outsidesql.OutsideSqlOption; +import jp.sf.pal.notepad.db.allcommon.dbmeta.DBMeta; +import jp.sf.pal.notepad.db.allcommon.dbmeta.DBMetaInstanceHandler; + +import org.seasar.extension.jdbc.ResultSetHandler; + +/** + * @author DBFlute(AutoGenerator) + * @param The type of result. + */ +public class SelectNextValCommand extends + AbstractBehaviorCommand { + + //========================================================================== + // ========= + // Attribute + // ========= + /** The type of result. (NotNull) */ + protected Class _resultType; + + //========================================================================== + // ========= + // Basic Information + // ================= + public String getCommandName() { + return "selectNextVal"; + } + + public Class getCommandReturnType() { + return _resultType; + } + + //========================================================================== + // ========= + // Detail Information + // ================== + public boolean isConditionBean() { + return false; + } + + public boolean isOutsideSql() { + return false; + } + + public boolean isProcedure() { + return false; + } + + public boolean isSelect() { + return true; + } + + public boolean isSelectCount() { + return false; + } + + //========================================================================== + // ========= + // Process Callback + // ================ + public void beforeGettingSqlExecution() { + } + + public void afterExecuting() { + } + + //========================================================================== + // ========= + // SqlExecution Handling + // ===================== + public String buildSqlExecutionKey() { + assertStatus("buildSqlExecutionKey"); + return _tableDbName + ":" + getCommandName() + "()"; + } + + public SqlExecutionCreator createSqlExecutionCreator() { + assertStatus("createSqlExecutionCreator"); + return new SqlExecutionCreator() { + public SqlExecution createSqlExecution() { + ResultSetHandler handler = createObjectResultSetHandler(_resultType); + return createSelectNextValExecution(handler); + } + }; + } + + protected SqlExecution createSelectNextValExecution(ResultSetHandler handler) { + final DBMeta dbmeta = findDBMeta(); + if (!dbmeta.hasSequence()) { + String msg = "If the method 'selectNextVal()' exists, DBMeta.hasSequence() should return true:"; + msg = msg + " dbmeta.hasSequence()=" + dbmeta.hasSequence(); + throw new IllegalStateException(msg); + } + final String nextValSql = dbmeta.getSequenceNextValSql(); + if (nextValSql == null) { + String msg = "If the method 'selectNextVal()' exists, DBMeta.getSequenceNextValSql() should not return null:"; + msg = msg + " dbmeta.getSequenceNextValSql()=" + + dbmeta.getSequenceNextValSql(); + throw new IllegalStateException(msg); + } + return createBasicSelectExecution(handler, new String[] {}, + new Class[] {}, nextValSql); + } + + protected BasicSelectExecution createBasicSelectExecution( + ResultSetHandler handler, String[] argNames, Class[] argTypes, + String sql) { + final BasicSelectExecution cmd = new BasicSelectExecution(_dataSource, + _statementFactory, handler); + cmd.setArgNames(argNames); + cmd.setArgTypes(argTypes); + cmd.setSql(sql); + return cmd; + } + + protected DBMeta findDBMeta() { + return DBMetaInstanceHandler.findDBMeta(_tableDbName); + } + + public Object[] getSqlExecutionArgument() { + assertStatus("getSqlExecutionArgument"); + return new Object[] {}; + } + + //========================================================================== + // ========= + // Argument Information + // ==================== + public ConditionBean getConditionBean() { + return null; + } + + public String getOutsideSqlPath() { + return null; + } + + public OutsideSqlOption getOutsideSqlOption() { + return null; + } + + //========================================================================== + // ========= + // Assert Helper + // ============= + protected void assertStatus(String methodName) { + assertBasicProperty(methodName); + assertComponentProperty(methodName); + } + + //========================================================================== + // ========= + // Accessor + // ======== + public void setResultType(Class resultType) { + _resultType = resultType; + } +} Property changes on: notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/bhv/core/command/SelectNextValCommand.java ___________________________________________________________________ Name: svn:eol-style + native Added: notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/bhv/core/command/SelectScalarCBCommand.java =================================================================== --- notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/bhv/core/command/SelectScalarCBCommand.java (rev 0) +++ notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/bhv/core/command/SelectScalarCBCommand.java 2008-12-27 22:13:37 UTC (rev 1628) @@ -0,0 +1,112 @@ +package jp.sf.pal.notepad.db.allcommon.bhv.core.command; + +import jp.sf.pal.notepad.db.allcommon.bhv.core.SqlExecution; +import jp.sf.pal.notepad.db.allcommon.bhv.core.SqlExecutionCreator; +import jp.sf.pal.notepad.db.allcommon.cbean.ConditionBean; +import jp.sf.pal.notepad.db.allcommon.cbean.ConditionBeanContext; +import jp.sf.pal.notepad.db.allcommon.cbean.sqlclause.SqlClause; + +import org.seasar.extension.jdbc.ResultSetHandler; + +/** + * @author DBFlute(AutoGenerator) + * @param The type of result. + */ +public class SelectScalarCBCommand extends + AbstractSelectCBCommand { + + //========================================================================== + // ========= + // Attribute + // ========= + /** The type of result. (NotNull) */ + protected Class _resultType; + + /** The type of select clause. (NotNull) */ + protected SqlClause.SelectClauseType _selectClauseType; + + //========================================================================== + // ========= + // Basic Information + // ================= + public String getCommandName() { + assertStatus("getCommandName"); + final String resultTypeName = _resultType.getSimpleName(); + final String scalarMethodName = _selectClauseType.toString() + .toLowerCase(); + return "scalarSelect(" + resultTypeName + ")." + scalarMethodName; + } + + public Class getCommandReturnType() { + assertStatus("getCommandReturnType"); + return _resultType; + } + + //========================================================================== + // ========= + // Detail Information + // ================== + public boolean isSelectCount() { + return false; + } + + //========================================================================== + // ========= + // Process Callback + // ================ + public void beforeGettingSqlExecution() { + assertStatus("beforeGettingSqlExecution"); + final ConditionBean cb = _conditionBean; + ConditionBeanContext.setConditionBeanOnThread(cb); + cb.getSqlClause().classifySelectClauseType(_selectClauseType); //*Point! + } + + public void afterExecuting() { + assertStatus("afterExecuting"); + final ConditionBean cb = _conditionBean; + cb.getSqlClause().rollbackSelectClauseType(); + } + + //========================================================================== + // ========= + // SqlExecution Handling + // ===================== + public SqlExecutionCreator createSqlExecutionCreator() { + assertStatus("createSqlExecutionCreator"); + return new SqlExecutionCreator() { + public SqlExecution createSqlExecution() { + ResultSetHandler handler = createObjectResultSetHandler(getCommandReturnType()); + return createSelectCBExecution(_conditionBeanType, handler); + } + }; + } + + //========================================================================== + // ========= + // Assert Helper + // ============= + @Override + protected void assertStatus(String methodName) { + super.assertStatus(methodName); + if (_resultType == null) { + throw new IllegalStateException(buildAssertMessage("_resultType", + methodName)); + } + if (_selectClauseType == null) { + throw new IllegalStateException(buildAssertMessage( + "_selectClauseType", methodName)); + } + } + + //========================================================================== + // ========= + // Accessor + // ======== + public void setResultType(Class resultType) { + _resultType = resultType; + } + + public void setSelectClauseType(SqlClause.SelectClauseType selectClauseType) { + _selectClauseType = selectClauseType; + } +} Property changes on: notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/bhv/core/command/SelectScalarCBCommand.java ___________________________________________________________________ Name: svn:eol-style + native Added: notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/bhv/core/command/UpdateEntityCommand.java =================================================================== --- notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/bhv/core/command/UpdateEntityCommand.java (rev 0) +++ notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/bhv/core/command/UpdateEntityCommand.java 2008-12-27 22:13:37 UTC (rev 1628) @@ -0,0 +1,55 @@ +package jp.sf.pal.notepad.db.allcommon.bhv.core.command; + +import jp.sf.pal.notepad.db.allcommon.bhv.core.SqlExecution; +import jp.sf.pal.notepad.db.allcommon.bhv.core.SqlExecutionCreator; +import jp.sf.pal.notepad.db.allcommon.s2dao.internal.sqlcommand.InternalUpdateModifiedOnlyCommand; + +import org.seasar.dao.BeanMetaData; + +/** + * @author DBFlute(AutoGenerator) + */ +public class UpdateEntityCommand extends AbstractEntityCommand { + + //========================================================================== + // ========= + // Basic Information + // ================= + public String getCommandName() { + return "update"; + } + + //========================================================================== + // ========= + // SqlExecution Handling + // ===================== + public SqlExecutionCreator createSqlExecutionCreator() { + assertStatus("createSqlExecutionCreator"); + return new SqlExecutionCreator() { + public SqlExecution createSqlExecution() { + final BeanMetaData bmd = createBeanMetaData(); + return createUpdateEntitySqlExecution(bmd); + } + }; + } + + protected SqlExecution createUpdateEntitySqlExecution(BeanMetaData bmd) { + final String[] propertyNames = getPersistentPropertyNames(bmd); + return createUpdateModifiedOnlyCommand(bmd, propertyNames); + } + + protected InternalUpdateModifiedOnlyCommand createUpdateModifiedOnlyCommand( + BeanMetaData bmd, String[] propertyNames) { + final InternalUpdateModifiedOnlyCommand cmd = new InternalUpdateModifiedOnlyCommand( + _dataSource, _statementFactory); + cmd.setBeanMetaData(bmd);// Extension Point! + cmd.setPropertyNames(propertyNames); + cmd.setOptimisticLockHandling(isOptimisticLockHandling()); + cmd.setVersionNoAutoIncrementOnMemory(isOptimisticLockHandling()); + return cmd; + } + + protected boolean isOptimisticLockHandling() { + return true; + } +} Property changes on: notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/bhv/core/command/UpdateEntityCommand.java ___________________________________________________________________ Name: svn:eol-style + native Added: notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/bhv/core/command/UpdateNonstrictEntityCommand.java =================================================================== --- notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/bhv/core/command/UpdateNonstrictEntityCommand.java (rev 0) +++ notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/bhv/core/command/UpdateNonstrictEntityCommand.java 2008-12-27 22:13:37 UTC (rev 1628) @@ -0,0 +1,25 @@ +package jp.sf.pal.notepad.db.allcommon.bhv.core.command; + +/** + * @author DBFlute(AutoGenerator) + */ +public class UpdateNonstrictEntityCommand extends UpdateEntityCommand { + + //========================================================================== + // ========= + // Basic Information + // ================= + @Override + public String getCommandName() { + return "updateNonstrict"; + } + + //========================================================================== + // ========= + // SqlExecution Handling + // ===================== + @Override + protected boolean isOptimisticLockHandling() { + return false; + } +} Property changes on: notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/bhv/core/command/UpdateNonstrictEntityCommand.java ___________________________________________________________________ Name: svn:eol-style + native Added: notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/bhv/core/execution/BasicSelectExecution.java =================================================================== --- notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/bhv/core/execution/BasicSelectExecution.java (rev 0) +++ notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/bhv/core/execution/BasicSelectExecution.java 2008-12-27 22:13:37 UTC (rev 1628) @@ -0,0 +1,77 @@ +package jp.sf.pal.notepad.db.allcommon.bhv.core.execution; + +import javax.sql.DataSource; + +import jp.sf.pal.notepad.db.allcommon.s2dao.internal.sqlcommand.InternalAbstractDynamicCommand; +import jp.sf.pal.notepad.db.allcommon.s2dao.internal.sqlhandler.InternalBasicSelectHandler; + +import org.seasar.dao.CommandContext; +import org.seasar.extension.jdbc.ResultSetHandler; +import org.seasar.extension.jdbc.StatementFactory; + +/** + * @author DBFlute(AutoGenerator) + */ +public class BasicSelectExecution extends InternalAbstractDynamicCommand { + + //========================================================================== + // ========= + // Attribute + // ========= + /** The handler of resultSet. */ + protected ResultSetHandler resultSetHandler; + + //========================================================================== + // ========= + // Constructor + // =========== + /** + * Constructor. + * + * @param dataSource Data source. + * @param statementFactory The factory of statement. + * @param resultSetHandler The handler of resultSet. + */ + public BasicSelectExecution(DataSource dataSource, + StatementFactory statementFactory, ResultSetHandler resultSetHandler) { + super(dataSource, statementFactory); + this.resultSetHandler = resultSetHandler; + } + + //========================================================================== + // ========= + // Execute + // ======= + /** + * @param args The array of argument. (Nullable) + * @return The object of execution result. (Nullable) + */ + public Object execute(Object[] args) { + final CommandContext ctx = apply(args); + final InternalBasicSelectHandler selectHandler = createBasicSelectHandler( + ctx.getSql(), this.resultSetHandler); + final Object[] bindVariableArray = ctx.getBindVariables(); + selectHandler.setLoggingMessageSqlArgs(bindVariableArray); + return selectHandler.execute(bindVariableArray, ctx + .getBindVariableTypes()); + } + + //========================================================================== + // ========= + // Select Handler + // ============== + protected InternalBasicSelectHandler createBasicSelectHandler( + String realSql, ResultSetHandler rsh) { + return new InternalBasicSelectHandler(getDataSource(), realSql, rsh, + getStatementFactory()); + } + + //========================================================================== + // ========= + // Parser Option + // ============= + @Override + protected boolean isBlockNullParameter() { + return true; // Because the SQL is select. + } +} Property changes on: notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/bhv/core/execution/BasicSelectExecution.java ___________________________________________________________________ Name: svn:eol-style + native Added: notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/bhv/core/execution/OutsideSqlSelectExecution.java =================================================================== --- notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/bhv/core/execution/OutsideSqlSelectExecution.java (rev 0) +++ notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/bhv/core/execution/OutsideSqlSelectExecution.java 2008-12-27 22:13:37 UTC (rev 1628) @@ -0,0 +1,225 @@ +package jp.sf.pal.notepad.db.allcommon.bhv.core.execution; + +import java.util.ArrayList; +import java.util.List; + +import javax.sql.DataSource; + +import jp.sf.pal.notepad.db.allcommon.cbean.outsidesql.OutsideSqlContext; +import jp.sf.pal.notepad.db.allcommon.s2dao.internal.sqlcommand.InternalAbstractDynamicCommand; +import jp.sf.pal.notepad.db.allcommon.s2dao.internal.sqlhandler.InternalBasicSelectHandler; +import jp.sf.pal.notepad.db.allcommon.util.SimpleStringUtil; +import jp.sf.pal.notepad.db.allcommon.util.SimpleSystemUtil; + +import org.seasar.dao.CommandContext; +import org.seasar.extension.jdbc.ResultSetHandler; +import org.seasar.extension.jdbc.StatementFactory; +import org.seasar.framework.beans.BeanDesc; +import org.seasar.framework.beans.PropertyDesc; +import org.seasar.framework.beans.factory.BeanDescFactory; + +/** + * @author DBFlute(AutoGenerator) + */ +public class OutsideSqlSelectExecution extends InternalAbstractDynamicCommand { + + //========================================================================== + // ========= + // Attribute + // ========= + /** The handler of resultSet. */ + protected ResultSetHandler resultSetHandler; + + //========================================================================== + // ========= + // Constructor + // =========== + /** + * Constructor. + * + * @param dataSource Data source. + * @param statementFactory The factory of statement. + * @param resultSetHandler The handler of resultSet. + */ + public OutsideSqlSelectExecution(DataSource dataSource, + StatementFactory statementFactory, ResultSetHandler resultSetHandler) { + super(dataSource, statementFactory); + this.resultSetHandler = resultSetHandler; + } + + //========================================================================== + // ========= + // Execute + // ======= + /** + * @param args The array of argument. (NotNull, The first element should be + * the instance of Pmb) + * @return The object of execution result. (Nullable) + */ + public Object execute(Object[] args) { + final OutsideSqlContext outsideSqlContext = OutsideSqlContext + .getOutsideSqlContextOnThread(); + if (outsideSqlContext.isDynamicBinding()) { + return executeOutsideSqlAsDynamic(args, outsideSqlContext); + } else { + return executeOutsideSqlAsStatic(args, outsideSqlContext); + } + } + + // ----------------------------------------------------- + // OutsideSql Execute + // ------------------ + /** + * Execute outside-SQL as Dynamic. + * + * @param args The array of argument. (NotNull, The first element should be + * the instance of Pmb) + * @param outsideSqlContext The context of outside-SQL. (NotNull) + * @return Result. (Nullable) + */ + protected Object executeOutsideSqlAsDynamic(Object[] args, + OutsideSqlContext outsideSqlContext) { + final Object firstArg = args[0]; + String staticSql = getSql(); + if (firstArg != null) { + final BeanDesc beanDesc = BeanDescFactory.getBeanDesc(firstArg + .getClass()); + + // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + // - - - - - - - + // Resolve embedded comment for parsing bind variable comment in + // embedded comment. + // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + // - - - - - - - + for (int i = 0; i < beanDesc.getPropertyDescSize(); i++) { + final PropertyDesc propertyDesc = beanDesc.getPropertyDesc(i); + final Class propertyType = propertyDesc.getPropertyType(); + if (!propertyType.equals(String.class)) { + continue; + } + final String outsideSqlPiece = (String) propertyDesc + .getValue(firstArg); + if (outsideSqlPiece == null) { + continue; + } + final String embeddedComment = "/*$pmb." + + propertyDesc.getPropertyName() + "*/"; + staticSql = replaceString(staticSql, embeddedComment, + outsideSqlPiece); + } + } + + final OutsideSqlSelectExecution outsideSqlCommand = createDynamicSqlFactory(); + outsideSqlCommand.setArgNames(getArgNames()); + outsideSqlCommand.setArgTypes(getArgTypes()); + outsideSqlCommand.setSql(staticSql); + + final CommandContext ctx = outsideSqlCommand.apply(args); + final List bindVariableList = new ArrayList(); + final List> bindVariableTypeList = new ArrayList>(); + addBindVariableInfo(ctx, bindVariableList, bindVariableTypeList); + final InternalBasicSelectHandler selectHandler = createBasicSelectHandler( + ctx.getSql(), this.resultSetHandler); + final Object[] bindVariableArray = bindVariableList.toArray(); + selectHandler.setLoggingMessageSqlArgs(bindVariableArray); + return selectHandler.execute(bindVariableArray, + toClassArray(bindVariableTypeList)); + } + + /** + * Execute outside-SQL as static. + * + * @param args The array of argument. (NotNull, The first element should be + * the instance of Pmb) + * @param outsideSqlContext The context of outside-SQL. (NotNull) + * @return Result. (Nullable) + */ + protected Object executeOutsideSqlAsStatic(Object[] args, + OutsideSqlContext outsideSqlContext) { + final CommandContext ctx = apply(args); + final InternalBasicSelectHandler selectHandler = createBasicSelectHandler( + ctx.getSql(), this.resultSetHandler); + final Object[] bindVariableArray = ctx.getBindVariables(); + selectHandler.setLoggingMessageSqlArgs(bindVariableArray); + return selectHandler.execute(bindVariableArray, ctx + .getBindVariableTypes()); + } + + //========================================================================== + // ========= + // Dynamic SQL Factory + // =================== + protected OutsideSqlSelectExecution createDynamicSqlFactory() { + return new OutsideSqlSelectExecution(getDataSource(), + getStatementFactory(), resultSetHandler); + } + + //========================================================================== + // ========= + // Select Handler + // ============== + protected InternalBasicSelectHandler createBasicSelectHandler( + String realSql, ResultSetHandler rsh) { + return new InternalBasicSelectHandler(getDataSource(), realSql, rsh, + getStatementFactory()); + } + + //========================================================================== + // ========= + // Parser Option + // ============= + @Override + protected boolean isBlockNullParameter() { + return true; // Because the SQL is select. + } + + //========================================================================== + // ========= + // Setup Helper + // ============ + protected Class[] toClassArray(List> 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 bindVariableList, List> bindVariableTypeList) { + final Object[] bindVariables = ctx.getBindVariables(); + addBindVariableList(bindVariableList, bindVariables); + final Class[] bindVariableTypes = ctx.getBindVariableTypes(); + addBindVariableTypeList(bindVariableTypeList, bindVariableTypes); + } + + protected void addBindVariableList(List bindVariableList, + Object[] bindVariables) { + for (int i = 0; i < bindVariables.length; i++) { + bindVariableList.add(bindVariables[i]); + } + } + + protected void addBindVariableTypeList(List> bindVariableTypeList, + Class[] bindVariableTypes) { + for (int i = 0; i < bindVariableTypes.length; i++) { + bindVariableTypeList.add(bindVariableTypes[i]); + } + } + + //========================================================================== + // ========= + // General Helper + // ============== + protected final String replaceString(String text, String fromText, + String toText) { + return SimpleStringUtil.replace(text, fromText, toText); + } + + protected String getLineSeparator() { + return SimpleSystemUtil.getLineSeparator(); + } +} Property changes on: notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/bhv/core/execution/OutsideSqlSelectExecution.java ___________________________________________________________________ Name: svn:eol-style + native Added: notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/bhv/core/execution/SelectCBExecution.java =================================================================== --- notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/bhv/core/execution/SelectCBExecution.java (rev 0) +++ notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/bhv/core/execution/SelectCBExecution.java 2008-12-27 22:13:37 UTC (rev 1628) @@ -0,0 +1,168 @@ +package jp.sf.pal.notepad.db.allcommon.bhv.core.execution; + +import java.util.ArrayList; +import java.util.List; + +import javax.sql.DataSource; + +import jp.sf.pal.notepad.db.allcommon.cbean.ConditionBean; +import jp.sf.pal.notepad.db.allcommon.cbean.ConditionBeanContext; +import jp.sf.pal.notepad.db.allcommon.s2dao.internal.sqlcommand.InternalAbstractDynamicCommand; +import jp.sf.pal.notepad.db.allcommon.s2dao.internal.sqlhandler.InternalBasicSelectHandler; +import jp.sf.pal.notepad.db.allcommon.util.SimpleStringUtil; +import jp.sf.pal.notepad.db.allcommon.util.SimpleSystemUtil; + +import org.seasar.dao.CommandContext; +import org.seasar.extension.jdbc.ResultSetHandler; +import org.seasar.extension.jdbc.StatementFactory; + +/** + * @author DBFlute(AutoGenerator) + */ +public class SelectCBExecution extends InternalAbstractDynamicCommand { + + //========================================================================== + // ========= + // Attribute + // ========= + /** The handler of resultSet. */ + protected ResultSetHandler resultSetHandler; + + //========================================================================== + // ========= + // Constructor + // =========== + /** + * Constructor. + * + * @param dataSource Data source. + * @param statementFactory The factory of statement. + * @param resultSetHandler The handler of resultSet. + */ + public SelectCBExecution(DataSource dataSource, + StatementFactory statementFactory, ResultSetHandler resultSetHandler) { + super(dataSource, statementFactory); + this.resultSetHandler = resultSetHandler; + } + + //========================================================================== + // ========= + // Execute + // ======= + /** + * @param args The array of argument. (NotNull, The first element should be + * the instance of CB) + * @return The object of execution result. (Nullable) + */ + public Object execute(Object[] args) { + final List bindVariableList = new ArrayList(); + final List> bindVariableTypeList = new ArrayList>(); + + final String finalClause = setupRealClause(args, bindVariableList, + bindVariableTypeList); + final InternalBasicSelectHandler selectHandler = createBasicSelectHandler( + finalClause, this.resultSetHandler); + final Object[] bindVariableArray = bindVariableList.toArray(); + selectHandler.setLoggingMessageSqlArgs(bindVariableArray); + return selectHandler.execute(bindVariableArray, + toClassArray(bindVariableTypeList)); + } + + // ----------------------------------------------------- + // Setup Clause + // ------------ + protected String setupRealClause(Object[] args, + List bindVariableList, List> bindVariableTypeList) { + final ConditionBean cb = ConditionBeanContext + .getConditionBeanOnThread(); + final String realClause; + { + final SelectCBExecution dynamicSqlFactory = createDynamicSqlFactory(); + dynamicSqlFactory.setArgNames(getArgNames()); + dynamicSqlFactory.setArgTypes(getArgTypes()); + dynamicSqlFactory.setSql(cb.getSqlClause().getClause()); + final CommandContext ctx = dynamicSqlFactory.apply(args); + realClause = ctx.getSql(); + addBindVariableInfo(ctx, bindVariableList, bindVariableTypeList); + } + return realClause; + } + + //========================================================================== + // ========= + // Dynamic SQL Factory + // =================== + protected SelectCBExecution createDynamicSqlFactory() { + return new SelectCBExecution(getDataSource(), getStatementFactory(), + resultSetHandler); + } + + //========================================================================== + // ========= + // Select Handler + // ============== + protected InternalBasicSelectHandler createBasicSelectHandler( + String realSql, ResultSetHandler rsh) { + return new InternalBasicSelectHandler(getDataSource(), realSql, rsh, + getStatementFactory()); + } + + //========================================================================== + // ========= + // Parser Option + // ============= + @Override + protected boolean isBlockNullParameter() { + return true; // Because the SQL is select. + } + + //========================================================================== + // ========= + // Setup Helper + // ============ + protected Class[] toClassArray(List> 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 bindVariableList, List> bindVariableTypeList) { + final Object[] bindVariables = ctx.getBindVariables(); + addBindVariableList(bindVariableList, bindVariables); + final Class[] bindVariableTypes = ctx.getBindVariableTypes(); + addBindVariableTypeList(bindVariableTypeList, bindVariableTypes); + } + + protected void addBindVariableList(List bindVariableList, + Object[] bindVariables) { + for (int i = 0; i < bindVariables.length; i++) { + bindVariableList.add(bindVariables[i]); + } + } + + protected void addBindVariableTypeList(List> bindVariableTypeList, + Class[] bindVariableTypes) { + for (int i = 0; i < bindVariableTypes.length; i++) { + bindVariableTypeList.add(bindVariableTypes[i]); + } + } + + //========================================================================== + // ========= + // General Helper + // ============== + protected final String replaceString(String text, String fromText, + String toText) { + return SimpleStringUtil.replace(text, fromText, toText); + } + + protected String getLineSeparator() { + return SimpleSystemUtil.getLineSeparator(); + } +} Property changes on: notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/bhv/core/execution/SelectCBExecution.java ___________________________________________________________________ Name: svn:eol-style + native Modified: notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/cbean/AbstractConditionBean.java =================================================================== --- notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/cbean/AbstractConditionBean.java 2008-12-27 22:11:51 UTC (rev 1627) +++ notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/cbean/AbstractConditionBean.java 2008-12-27 22:13:37 UTC (rev 1628) @@ -24,6 +24,28 @@ public abstract class AbstractConditionBean implements ConditionBean { //========================================================================== + // =========== + // Definition + // ========== + /** Map-string map-mark. */ + private static final String MAP_STRING_MAP_MARK = "map:"; + + /** Map-string list-mark. */ + private static final String MAP_STRING_LIST_MARK = "list:"; + + /** Map-string start-brace. */ + private static final String MAP_STRING_START_BRACE = "@{"; + + /** Map-string end-brace. */ + private static final String MAP_STRING_END_BRACE = "@}"; + + /** Map-string delimiter. */ + private static final String MAP_STRING_DELIMITER = "@;"; + + /** Map-string equal. */ + private static final String MAP_STRING_EQUAL = "@="; + + //========================================================================== // ========= // Attribute // ========= @@ -41,8 +63,12 @@ // [DBFlute-0.7.4] @jflute -- At the future, I'll implement some check // logics by these purpose types. - protected boolean _forDeriveReferrer; + protected boolean _forDerivedReferrer; + protected boolean _forScalarSelect; + + protected boolean _forScalarSubQuery; + protected boolean _forUnion; protected boolean _forExistsSubQuery; @@ -73,27 +99,6 @@ //========================================================================== // ========= - // ConditionQuery - // ============== - /** - * Get condition query as interface. At the future, change public to - * protected. - * - * @return Instance of query as interface. (NotNull) - */ - abstract public ConditionQuery getConditionQueryAsInterface(); - - /** - * The implementation. - * - * @return The conditionQuery of the local table as interface. (NotNull) - */ - public ConditionQuery localCQ() { - return getConditionQueryAsInterface(); - } - - //========================================================================== - // ========= // Accept PrimaryKey // ================= /** @@ -498,42 +503,6 @@ //========================================================================== // ========= - // Limit Select - // ============ - /** Is limit-select PK only? */ - protected boolean _isLimitSelectPKOnly; - - /** - * Is limit-select PK only? - * - * @return Determination. - */ - public boolean isLimitSelect_PKOnly() { - return _isLimitSelectPKOnly; - } - - /** - * Limit select PK only. - * - * @return this. (NotNull) - */ - public ConditionBean limitSelect_PKOnly() { - _isLimitSelectPKOnly = true; - return this; - } - - /** - * Limit select off. - * - * @return this. (NotNull) - */ - public ConditionBean limitSelect_Off() { - _isLimitSelectPKOnly = false; - return this; - } - - //========================================================================== - // ========= // Lock Setting // ============ /** @@ -559,11 +528,8 @@ public ConditionBean xsetupSelectCountIgnoreFetchScope() { _isSelectCountIgnoreFetchScope = true; - // If the query uses union query, it needs included-select-column. - if (!hasUnionQueryOrUnionAllQuery()) { - getSqlClause().ignoreIncludedSelectColumn(); - } - + getSqlClause().classifySelectClauseType( + SqlClause.SelectClauseType.COUNT); getSqlClause().ignoreOrderBy(); getSqlClause().ignoreFetchScope(); return this; @@ -578,11 +544,7 @@ public ConditionBean xafterCareSelectCountIgnoreFetchScope() { _isSelectCountIgnoreFetchScope = false; - // If the query uses union query, it needs included-select-column. - if (!hasUnionQueryOrUnionAllQuery()) { - getSqlClause().makeIncludedSelectColumnEffective(); - } - + getSqlClause().rollbackSelectClauseType(); getSqlClause().makeOrderByEffective(); getSqlClause().makeFetchScopeEffective(); return this; @@ -613,20 +575,29 @@ protected CQ _query; - protected boolean _forDeriveReferrer; + protected boolean _forDerivedReferrer; - protected boolean alreadySpecifyRequiredColumn; + protected boolean _forScalarSelect; + protected boolean _forScalarSubQuery; + + protected boolean _alreadySpecifyRequiredColumn; + /** * @param baseCB The condition-bean of base level. (NotNull) - * @param qyCall The callback for condition-query. (NotNull) - * @param forDeriveReferrer Is this for derive referrer? + * @param qyCall The call-back for condition-query. (NotNull) + * @param forDerivedReferrer Is this for derive referrer? + * @param forScalarSelect Is this for scalar select? + * @param forScalarSubQuery Is this for scalar sub-query? */ protected AbstractSpecification(ConditionBean baseCB, - SpQyCall qyCall, boolean forDeriveReferrer) { + SpQyCall qyCall, boolean forDerivedReferrer, + boolean forScalarSelect, boolean forScalarSubQuery) { _baseCB = baseCB; _qyCall = qyCall; - _forDeriveReferrer = forDeriveReferrer; + _forDerivedReferrer = forDerivedReferrer; + _forScalarSelect = forScalarSelect; + _forScalarSubQuery = forScalarSubQuery; } protected void doColumn(String columnName) { @@ -634,8 +605,8 @@ if (_query == null) { _query = _qyCall.qy(); } - if (!_forDeriveReferrer && !alreadySpecifyRequiredColumn) { - alreadySpecifyRequiredColumn = true; + if (isRequiredColumnSpecificationEnabled()) { + _alreadySpecifyRequiredColumn = true; doSpecifyRequiredColumn(); } String relationPath = _query.getRelationPath() != null ? _query @@ -652,6 +623,11 @@ columnName); } + protected boolean isRequiredColumnSpecificationEnabled() { + return !_forDerivedReferrer && !_forScalarSelect + && !_forScalarSubQuery && !_alreadySpecifyRequiredColumn; + } + protected void assertColumn(String columnName) { if (_query == null && !_qyCall.has()) { throwSpecifyColumnNotSetupSelectColumnException(columnName); @@ -659,9 +635,15 @@ } protected void assertForeign(String foreignPropertyName) { - if (_forDeriveReferrer) { - throwDeriveReferrerInvalidForeignSpecificationException(foreignPropertyName); + if (_forDerivedReferrer) { + throwDerivedReferrerInvalidForeignSpecificationException(foreignPropertyName); } + if (_forScalarSelect) { + throwScalarSelectInvalidForeignSpecificationException(foreignPropertyName); + } + if (_forScalarSubQuery) { + throwScalarSubQueryInvalidForeignSpecificationException(foreignPropertyName); + } } protected abstract void doSpecifyRequiredColumn(); @@ -714,19 +696,19 @@ throw new SpecifyColumnNotSetupSelectColumnException(msg); } - protected void throwDeriveReferrerInvalidForeignSpecificationException( + protected void throwDerivedReferrerInvalidForeignSpecificationException( String foreignPropertyName) { String msg = "Look! Read the message below." + getLineSeparator(); msg = msg + "/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *" + getLineSeparator(); msg = msg - + "You specified a foreign table column in spite of derive-sub-query!" + + "You specified a foreign table column in spite of derived-referrer!" + getLineSeparator(); msg = msg + getLineSeparator(); msg = msg + "[Advice]" + getLineSeparator(); msg = msg - + "You should specified a local table column at condition-bean for derive-sub-query." + + "You should specified a local table column at condition-bean for derived-referrer." + getLineSeparator(); msg = msg + " For example:" + getLineSeparator(); msg = msg + " " + getLineSeparator(); @@ -736,7 +718,7 @@ msg = msg + " MemberCB cb = new MemberCB();" + getLineSeparator(); msg = msg - + " cb.specify().derivePurchaseList().max(new SubQuery() {" + + " cb.specify().derivedPurchaseList().max(new SubQuery() {" + getLineSeparator(); msg = msg + " public void query(PurchaseCB subCB) {" + getLineSeparator(); @@ -754,7 +736,7 @@ msg = msg + " MemberCB cb = new MemberCB();" + getLineSeparator(); msg = msg - + " cb.specify().derivePurchaseList().max(new SubQuery() {" + + " cb.specify().derivedPurchaseList().max(new SubQuery() {" + getLineSeparator(); msg = msg + " public void query(PurchaseCB subCB) {" + getLineSeparator(); @@ -769,9 +751,117 @@ msg = msg + "[Specified Foreign Property]" + getLineSeparator() + foreignPropertyName + getLineSeparator(); msg = msg + "* * * * * * * * * */"; - throw new DeriveReferrerInvalidForeignSpecificationException(msg); + throw new DerivedReferrerInvalidForeignSpecificationException(msg); } + protected void throwScalarSelectInvalidForeignSpecificationException( + String foreignPropertyName) { + String msg = "Look! Read the message below." + getLineSeparator(); + msg = msg + + "/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *" + + getLineSeparator(); + msg = msg + + "You specified a foreign table column in spite of scalar select!" + + getLineSeparator(); + msg = msg + getLineSeparator(); + msg = msg + "[Advice]" + getLineSeparator(); + msg = msg + + "You should specified a local table column at condition-bean for scalar select." + + getLineSeparator(); + msg = msg + " For example:" + getLineSeparator(); + msg = msg + " " + getLineSeparator(); + msg = msg + " [Wrong]" + getLineSeparator(); + msg = msg + " /- - - - - - - - - - - - - - - - - - - - " + + getLineSeparator(); + msg = msg + + " memberBhv.scalarSelect(Integer.class).max(new ScalarSelect() {" + + getLineSeparator(); + msg = msg + " public void query(MemberCB cb) {" + + getLineSeparator(); + msg = msg + + " cb.specify().specifyMemberStatus().columnDisplayOrder(); // *No!" + + getLineSeparator(); + msg = msg + " }" + getLineSeparator(); + msg = msg + " });" + getLineSeparator(); + msg = msg + " - - - - - - - - - -/" + getLineSeparator(); + msg = msg + " " + getLineSeparator(); + msg = msg + " [Good!]" + getLineSeparator(); + msg = msg + " /- - - - - - - - - - - - - - - - - - - - " + + getLineSeparator(); + msg = msg + + " memberBhv.scalarSelect(Date.class).max(new ScalarSelect() {" + + getLineSeparator(); + msg = msg + " public void query(MemberCB cb) {" + + getLineSeparator(); + msg = msg + + " cb.specify().columnMemberBirthday(); // *Point!" + + getLineSeparator(); + msg = msg + " }" + getLineSeparator(); + msg = msg + " });" + getLineSeparator(); + msg = msg + " - - - - - - - - - -/" + getLineSeparator(); + msg = msg + getLineSeparator(); + msg = msg + "[Specified Foreign Property]" + getLineSeparator() + + foreignPropertyName + getLineSeparator(); + msg = msg + "* * * * * * * * * */"; + throw new ScalarSelectInvalidForeignSpecificationException(msg); + } + + protected void throwScalarSubQueryInvalidForeignSpecificationException( + String foreignPropertyName) { + String msg = "Look! Read the message below." + getLineSeparator(); + msg = msg + + "/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *" + + getLineSeparator(); + msg = msg + + "You specified a foreign table column in spite of derived-query!" + + getLineSeparator(); + msg = msg + getLineSeparator(); + msg = msg + "[Advice]" + getLineSeparator(); + msg = msg + + "You should specified a local table column at condition-bean for derived-query." + + getLineSeparator(); + msg = msg + " For example:" + getLineSeparator(); + msg = msg + " " + getLineSeparator(); + msg = msg + " [Wrong]" + getLineSeparator(); + msg = msg + " /- - - - - - - - - - - - - - - - - - - - " + + getLineSeparator(); + msg = msg + " MemberCB cb = new MemberCB();" + + getLineSeparator(); + msg = msg + + " cb.query().scalar_Equal().max(new SubQuery() {" + + getLineSeparator(); + msg = msg + " public void query(MemberCB subCB) {" + + getLineSeparator(); + msg = msg + + " subCB.specify().specifyMemberStatusName().columnDisplayOrder(); // *No!" + + getLineSeparator(); + msg = msg + " }" + getLineSeparator(); + msg = msg + " });" + getLineSeparator(); + msg = msg + " - - - - - - - - - -/" + getLineSeparator(); + msg = msg + " " + getLineSeparator(); + msg = msg + " [Good!]" + getLineSeparator(); + msg = msg + " /- - - - - - - - - - - - - - - - - - - - " + + getLineSeparator(); + msg = msg + " MemberCB cb = new MemberCB();" + + getLineSeparator(); + msg = msg + + " cb.query().scalar_Equal().max(new SubQuery() {" + + getLineSeparator(); + msg = msg + " public void query(MemberCB subCB) {" + + getLineSeparator(); + msg = msg + + " subCB.specify().columnMemberBirthday();// *Point!" + + getLineSeparator(); + msg = msg + " }" + getLineSeparator(); + msg = msg + " });" + getLineSeparator(); + msg = msg + " - - - - - - - - - -/" + getLineSeparator(); + msg = msg + getLineSeparator(); + msg = msg + "[Specified Foreign Property]" + getLineSeparator() + + foreignPropertyName + getLineSeparator(); + msg = msg + "* * * * * * * * * */"; + throw new ScalarSubQueryInvalidForeignSpecificationException(msg); + } + protected String getLineSeparator() { return SimpleSystemUtil.getLineSeparator(); } @@ -792,15 +882,33 @@ } } - public static class DeriveReferrerInvalidForeignSpecificationException + public static class DerivedReferrerInvalidForeignSpecificationException extends RuntimeException { private static final long serialVersionUID = 1L; - public DeriveReferrerInvalidForeignSpecificationException(String msg) { + public DerivedReferrerInvalidForeignSpecificationException(String msg) { super(msg); } } + public static class ScalarSubQueryInvalidForeignSpecificationException + extends RuntimeException { + private static final long serialVersionUID = 1L; + + public ScalarSubQueryInvalidForeignSpecificationException(String msg) { + super(msg); + } + } + + public static class ScalarSelectInvalidForeignSpecificationException extends + RuntimeException { + private static final long serialVersionUID = 1L; + + public ScalarSelectInvalidForeignSpecificationException(String msg) { + super(msg); + } + } + public static class RAFunction { protected ConditionBean _baseCB; @@ -815,6 +923,18 @@ _querySetupper = querySetupper; } + public void count(SubQuery subQuery, String aliasName) { + assertAliasName(aliasName); + _querySetupper.setup("count", subQuery, _localCQ, aliasName.trim()); + } + + public void countDistinct(SubQuery subQuery, + String aliasName) { + assertAliasName(aliasName); + _querySetupper.setup("count(distinct", subQuery, _localCQ, + aliasName.trim()); + } + public void max(SubQuery subQuery, String aliasName) { assertAliasName(aliasName); _querySetupper.setup("max", subQuery, _localCQ, aliasName.trim()); @@ -835,14 +955,9 @@ _querySetupper.setup("avg", subQuery, _localCQ, aliasName.trim()); } - public void count(SubQuery subQuery, String aliasName) { - assertAliasName(aliasName); - _querySetupper.setup("count", subQuery, _localCQ, aliasName.trim()); - } - protected void assertAliasName(String aliasName) { if (aliasName == null || aliasName.trim().length() == 0) { - throwDeriveReferrerInvalidAliasNameException(); + throwDerivedReferrerInvalidAliasNameException(); } DBMeta dbmeta = DBMetaInstanceHandler.findDBMeta(_baseCB .getTableDbName()); @@ -860,17 +975,17 @@ } } if (!existsSetterMethod) { - throwDeriveReferrerEntityPropertyNotFoundException(aliasName, + throwDerivedReferrerEntityPropertyNotFoundException(aliasName, dbmeta.getEntityType()); } } - protected void throwDeriveReferrerInvalidAliasNameException() { + protected void throwDerivedReferrerInvalidAliasNameException() { String msg = "Look! Read the message below." + getLineSeparator(); msg = msg + "/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *" + getLineSeparator(); - msg = msg + "The alias name for derive-referrer was Invalid!" + msg = msg + "The alias name for derived-referrer was Invalid!" + getLineSeparator(); msg = msg + getLineSeparator(); msg = msg + "[Advice]" + getLineSeparator(); @@ -915,17 +1030,17 @@ msg = msg + "[Local Table]" + getLineSeparator() + _localCQ.getTableDbName() + getLineSeparator(); msg = msg + "* * * * * * * * * */"; - throw new DeriveReferrerInvalidAliasNameException(msg); + throw new DerivedReferrerInvalidAliasNameException(msg); } - protected void throwDeriveReferrerEntityPropertyNotFoundException( + protected void throwDerivedReferrerEntityPropertyNotFoundException( String aliasName, Class entityType) { String msg = "Look! Read the message below." + getLineSeparator(); msg = msg + "/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *" + getLineSeparator(); msg = msg - + "A property for derive-referrer was Not Found in the entity!" + + "A property for derived-referrer was Not Found in the entity!" + getLineSeparator(); msg = msg + getLineSeparator(); msg = msg + "[Advice]" + getLineSeparator(); @@ -981,7 +1096,7 @@ msg = msg + "[Target Entity]" + getLineSeparator() + entityType + getLineSeparator(); msg = msg + "* * * * * * * * * */"; - throw new DeriveReferrerEntityPropertyNotFoundException(msg); + throw new DerivedReferrerEntityPropertyNotFoundException(msg); } protected String replaceString(String text, String fromText, @@ -999,20 +1114,20 @@ LOCAL_CQ cq, String aliasName); } - public static class DeriveReferrerInvalidAliasNameException extends + public static class DerivedReferrerInvalidAliasNameException extends RuntimeException { private static final long serialVersionUID = 1L; - public DeriveReferrerInvalidAliasNameException(String msg) { + public DerivedReferrerInvalidAliasNameException(String msg) { super(msg); } } - public static class DeriveReferrerEntityPropertyNotFoundException extends + public static class DerivedReferrerEntityPropertyNotFoundException extends RuntimeException { private static final long serialVersionUID = 1L; - public DeriveReferrerEntityPropertyNotFoundException(String msg) { + public DerivedReferrerEntityPropertyNotFoundException(String msg) { super(msg); } } @@ -1042,7 +1157,6 @@ protected void doSetupSelect(SsCall callback) { String foreignPropertyName = callback.qf().getForeignPropertyName(); assertSetupSelectBeforeUnion(foreignPropertyName); - limitSelect_Off(); String foreignTableAliasName = callback.qf().getRealAliasName(); String localRelationPath = localCQ().getRelationPath(); getSqlClause().registerSelectedSelectColumn(foreignTableAliasName, @@ -1164,19 +1278,27 @@ // ========= // Purpose Type // ============ - public void xsetupForDeriveReferrer() { - _forDeriveReferrer = true; + public void xsetupForDerivedReferrer() { // Very Internal + _forDerivedReferrer = true; } - public void xsetupForUnion() { + public void xsetupForScalarSelect() { // Very Internal + _forScalarSelect = true; + } + + public void xsetupForScalarSubQuery() { // Very Internal + _forScalarSubQuery = true; + } + + public void xsetupForUnion() { // Very Internal _forUnion = true; } - public void xsetupForExistsSubQuery() { + public void xsetupForExistsSubQuery() { // Very Internal _forExistsSubQuery = true; } - public void xsetupForInScopeSubQuery() { + public void xsetupForInScopeSubQuery() { // Very Internal _forInScopeSubQuery = true; } Modified: notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/cbean/AbstractConditionQuery.java =================================================================== --- notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/cbean/AbstractConditionQuery.java 2008-12-27 22:11:51 UTC (rev 1627) +++ notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/cbean/AbstractConditionQuery.java 2008-12-27 22:13:37 UTC (rev 1628) @@ -48,12 +48,14 @@ protected static final ConditionKey CK_PS = ConditionKey.CK_PREFIX_SEARCH; - protected static final ConditionKey CK_LS = ConditionKey.CK_LIKE_SEARCH; - protected static final ConditionKey CK_INS = ConditionKey.CK_IN_SCOPE; protected static final ConditionKey CK_NINS = ConditionKey.CK_NOT_IN_SCOPE; + protected static final ConditionKey CK_LS = ConditionKey.CK_LIKE_SEARCH; + + protected static final ConditionKey CK_NLS = ConditionKey.CK_NOT_LIKE_SEARCH; + protected static final ConditionKey CK_ISN = ConditionKey.CK_IS_NULL; protected static final ConditionKey CK_ISNN = ConditionKey.CK_IS_NOT_NULL; @@ -351,15 +353,7 @@ String msg = "The argument[unionQuery] should not be null."; throw new IllegalArgumentException(msg); } - reflectRelationOnUnionQuery(this, unionQuery);// Reflect Relation! - getSqlClause().copyIncludedSelectColumn(unionQuery.getSqlClause());// Reflect - // IncludedSelectColumn - // ! - if (getSqlClause().isFormatClauseEffective()) { - unionQuery.getSqlClause().makeFormatClauseEffective();// Reflect - // FormatClause - // ! - } + reflectRelationOnUnionQuery(this, unionQuery); // Reflect Relation! String key = (unionAll ? "unionAllQuery" : "unionQuery") + unionQueryMap.size(); unionQueryMap.put(key, unionQuery); @@ -416,22 +410,6 @@ // Register // ======== // ----------------------------------------------------- - // Include-As-Mine - // --------------- - /** - * Register included-select-column. - * - * @param aliasName Alias name. This should not contain comma. (NotNull) - * @param realColumnName Real column name. This should not contain comma. - * (NotNull) - * @deprecated Unsupported! - */ - protected void registerIncludedSelectColumn(String aliasName, - String realColumnName) { - throw new UnsupportedOperationException(); - } - - // ----------------------------------------------------- // Query // ----- protected void registerQuery(ConditionKey key, Object value, @@ -488,6 +466,13 @@ // ----------------------------------------------------- // LikeSearch Query // ---------------- + protected void regLSQ(ConditionKey key, String value, + ConditionValue cvalue, String colName, String capPropName, + String uncapPropName, LikeSearchOption option) { + registerLikeSearchQuery(key, value, cvalue, colName, capPropName, + uncapPropName, option); + } + @SuppressWarnings("deprecation") protected void registerLikeSearchQuery(ConditionKey key, String value, ConditionValue cvalue, String colName, String capPropName, @@ -700,25 +685,20 @@ assertObjectNotNull("InScopeSubQyery(" + columnName + ")", subQuery); inScopeOption = inScopeOption != null ? inScopeOption + " " : ""; String realColumnName = getInScopeSubQueryRealColumnName(columnName); + xincrementLocalSubQueryLevelIfNeeds(subQuery); String subQueryClause = getInScopeSubQuerySql(subQuery, relatedColumnName, propertyName); - String clause = null; - if (getSqlClause().isFormatClauseEffective()) { - String ln = getLineSeparator(); - int subQueryLevel = subQuery.getSubQueryLevel(); - String subQueryIdentity = propertyName + "[" + subQueryLevel + "]"; - String beginMark = getSqlClause().resolveSubQueryBeginMark( - subQueryIdentity) - + ln; - String endMark = getSqlClause().resolveSubQueryEndMark( - subQueryIdentity); - String endIndent = " "; - clause = realColumnName + " " + inScopeOption + "in (" + beginMark - + subQueryClause + ln + endIndent + ")" + endMark; - } else { - clause = realColumnName + " " + inScopeOption + "in (" - + subQueryClause + ")"; - } + String ln = getLineSeparator(); + int subQueryLevel = subQuery.getSubQueryLevel(); + String subQueryIdentity = propertyName + "[" + subQueryLevel + "]"; + String beginMark = getSqlClause().resolveSubQueryBeginMark( + subQueryIdentity) + + ln; + String endMark = getSqlClause() + .resolveSubQueryEndMark(subQueryIdentity); + String endIndent = " "; + String clause = realColumnName + " " + inScopeOption + "in (" + + beginMark + subQueryClause + ln + endIndent + ")" + endMark; registerWhereClause(clause); } @@ -728,22 +708,11 @@ protected String getInScopeSubQuerySql(ConditionQuery subQuery, String relatedColumnName, String propertyName) { - String selectClause = "select " - + getSqlClause().getLocalTableAliasName() + "." + String tableAliasName = getSqlClause().getLocalTableAliasName(); + String selectClause = "select " + tableAliasName + "." + relatedColumnName; - String fromWhereClause = subQuery.getSqlClause() - .getClauseFromWhereWithUnionTemplate(); - fromWhereClause = replaceString(fromWhereClause, ".conditionQuery.", - "." + getLocationBase(propertyName) + ".");// Very Important! - - // Replace template marks. These are very important! - fromWhereClause = replaceString(fromWhereClause, getSqlClause() - .getUnionSelectClauseMark(), selectClause); - fromWhereClause = replaceString(fromWhereClause, getSqlClause() - .getUnionWhereClauseMark(), ""); - fromWhereClause = replaceString(fromWhereClause, getSqlClause() - .getUnionWhereFirstConditionMark(), ""); - + String fromWhereClause = buildPlainSubQueryFromWhereClause(subQuery, + relatedColumnName, propertyName, selectClause, tableAliasName); return selectClause + " " + fromWhereClause; } @@ -769,24 +738,20 @@ assertObjectNotNull("ExistsSubQyery(" + columnName + ")", subQuery); existsOption = existsOption != null ? existsOption + " " : ""; String realColumnName = getExistsSubQueryRealColumnName(columnName); + xincrementLocalSubQueryLevelIfNeeds(subQuery); String subQueryClause = getExistsSubQuerySql(subQuery, realColumnName, relatedColumnName, propertyName); - String clause = null; - if (getSqlClause().isFormatClauseEffective()) { - String ln = getLineSeparator(); - int subQueryLevel = subQuery.getSubQueryLevel(); - String subQueryIdentity = propertyName + "[" + subQueryLevel + "]"; - String beginMark = getSqlClause().resolveSubQueryBeginMark( - subQueryIdentity) - + ln; - String endMark = getSqlClause().resolveSubQueryEndMark( - subQueryIdentity); - String endIndent = " "; - clause = existsOption + "exists (" + beginMark + subQueryClause - + ln + endIndent + ")" + endMark; - } else { - clause = existsOption + "exists (" + subQueryClause + ")"; - } + String ln = getLineSeparator(); + int subQueryLevel = subQuery.getSubQueryLevel(); + String subQueryIdentity = propertyName + "[" + subQueryLevel + "]"; + String beginMark = getSqlClause().resolveSubQueryBeginMark( + subQueryIdentity) + + ln; + String endMark = getSqlClause() + .resolveSubQueryEndMark(subQueryIdentity); + String endIndent = " "; + String clause = existsOption + "exists (" + beginMark + subQueryClause + + ln + endIndent + ")" + endMark; registerWhereClause(clause); } @@ -801,134 +766,116 @@ protected String getExistsSubQuerySql(ConditionQuery subQuery, String realColumnName, String relatedColumnName, String propertyName) { int subQueryLevel = subQuery.getSubQueryLevel(); - if (_subQueryLevel <= subQueryLevel) { - _subQueryLevel = subQueryLevel + 1; - } String tableAliasName = "dfsublocal_" + subQueryLevel; String selectClause = "select " + tableAliasName + "." + relatedColumnName; - String fromWhereClause = subQuery.getSqlClause() - .getClauseFromWhereWithWhereUnionTemplate(); - fromWhereClause = replaceString(fromWhereClause, "dflocal", - tableAliasName);// Very Important! - fromWhereClause = replaceString(fromWhereClause, ".conditionQuery.", - "." + getLocationBase(propertyName) + ".");// Very Important! - - String joinCondition = tableAliasName + "." + relatedColumnName + " = " - + realColumnName; - String firstConditionAfter = " and "; - if (getSqlClause().isFormatClauseEffective()) { - firstConditionAfter = getLineSeparator() + " and "; - } - - // Replace template marks. These are very important! - fromWhereClause = replaceString(fromWhereClause, getSqlClause() - .getWhereClauseMark(), "where " + joinCondition); - fromWhereClause = replaceString(fromWhereClause, getSqlClause() - .getWhereFirstConditionMark(), joinCondition - + firstConditionAfter); - fromWhereClause = replaceString(fromWhereClause, getSqlClause() - .getUnionSelectClauseMark(), selectClause); - fromWhereClause = replaceString(fromWhereClause, getSqlClause() - .getUnionWhereClauseMark(), "where " + joinCondition); - fromWhereClause = replaceString(fromWhereClause, getSqlClause() - .getUnionWhereFirstConditionMark(), joinCondition - + firstConditionAfter); - + String fromWhereClause = buildCorrelationSubQueryFromWhereClause( + subQuery, relatedColumnName, propertyName, selectClause, + tableAliasName, realColumnName); return selectClause + " " + fromWhereClause; } // [DBFlute-0.7.4] // ----------------------------------------------------- - // DeriveSubQuery - // -------------- - protected void registerDeriveSubQuery(String function, + // DerivedReferrerSubQuery + // ----------------------- + protected void registerDerivedReferrerSubQuery(String function, ConditionQuery subQuery, String columnName, String relatedColumnName, String propertyName, String aliasName) { - assertObjectNotNull("DeriveSubQuery(" + columnName + ")", subQuery); - final String realColumnName = getDeriveSubQueryRealColumnName(columnName); - final String subQueryClause = getDeriveSubQuerySql(function, subQuery, - realColumnName, relatedColumnName, propertyName, aliasName); - final String clause; - if (getSqlClause().isFormatClauseEffective()) { - final String ln = getLineSeparator(); - final int subQueryLevel = subQuery.getSubQueryLevel(); - final String subQueryIdentity = propertyName + "[" + subQueryLevel - + "]"; - final String beginMark = getSqlClause().resolveSubQueryBeginMark( - subQueryIdentity) - + ln; - final String endMark = getSqlClause().resolveSubQueryEndMark( - subQueryIdentity); - final String endIndent = " "; - clause = "(" + beginMark + subQueryClause + ln + endIndent - + ") as " + aliasName + endMark; - } else { - clause = "(" + subQueryClause + ") as " + aliasName; - } + assertObjectNotNull("DerivedReferrerSubQuery(function)", function); + assertObjectNotNull("DerivedReferrerSubQuery(" + columnName + ")", + subQuery); + String realColumnName = getDerivedReferrerSubQueryRealColumnName(columnName); + xincrementLocalSubQueryLevelIfNeeds(subQuery); + String subQueryClause = getDerivedReferrerSubQuerySql(function, + subQuery, realColumnName, relatedColumnName, propertyName, + aliasName); + String ln = getLineSeparator(); + int subQueryLevel = subQuery.getSubQueryLevel(); + String subQueryIdentity = propertyName + "[" + subQueryLevel + "]"; + String beginMark = getSqlClause().resolveSubQueryBeginMark( + subQueryIdentity) + + ln; + String endMark = getSqlClause() + .resolveSubQueryEndMark(subQueryIdentity); + String endIndent = " "; + String clause = "(" + beginMark + subQueryClause + ln + endIndent + + ") " + aliasName + endMark; getSqlClause().specifyDeriveSubQuery(aliasName, clause); } - protected String getDeriveSubQueryRealColumnName(String columnName) { + protected String getDerivedReferrerSubQueryRealColumnName(String columnName) { return getRealColumnName(columnName); } - protected String getDeriveSubQuerySql(String function, + protected String getDerivedReferrerSubQuerySql(String function, ConditionQuery subQuery, String realColumnName, String relatedColumnName, String propertyName, String aliasName) { - final int subQueryLevel = subQuery.getSubQueryLevel(); - if (_subQueryLevel <= subQueryLevel) { - _subQueryLevel = subQueryLevel + 1; - } - final String tableAliasName = "dfsublocal_" + subQueryLevel; - final String deriveColumnName = subQuery.getSqlClause() + int subQueryLevel = subQuery.getSubQueryLevel(); + String tableAliasName = "dfsublocal_" + subQueryLevel; + String deriveColumnName = subQuery.getSqlClause() .getSpecifiedColumnNameAsOne(); if (deriveColumnName == null || deriveColumnName.trim().length() == 0) { - throwDeriveReferrerInvalidColumnSpecificationException(function, + throwDerivedReferrerInvalidColumnSpecificationException(function, aliasName); } - assertDeriveReferrerColumnType(function, subQuery, deriveColumnName); - subQuery.getSqlClause().clearSpecifiedSelectColumn(); - final String selectClause = "select " + function + "(" + tableAliasName - + "." + deriveColumnName + ")"; - String fromWhereClause = subQuery.getSqlClause() - .getClauseFromWhereWithWhereUnionTemplate(); - fromWhereClause = replaceString(fromWhereClause, "dflocal", - tableAliasName);// Very Important! - fromWhereClause = replaceString(fromWhereClause, ".conditionQuery.", - "." + getLocationBase(propertyName) + ".");// Very Important! - - final String joinCondition = tableAliasName + "." + relatedColumnName - + " = " + realColumnName; - String firstConditionAfter = " and "; - if (getSqlClause().isFormatClauseEffective()) { - firstConditionAfter = getLineSeparator() + " and "; + assertDerivedReferrerColumnType(function, subQuery, deriveColumnName); + subQuery.getSqlClause().clearSpecifiedSelectColumn(); // specified + // columns + // disappear at + // this timing + String connect = xbuildFunctionConnector(function); + if (subQuery.getSqlClause().hasUnionQuery()) { + String ln = getLineSeparator(); + String subQueryIdentity = propertyName + "[" + subQueryLevel + + ":subquerymain]"; + String beginMark = getSqlClause().resolveSubQueryBeginMark( + subQueryIdentity) + + ln; + String endMark = getSqlClause().resolveSubQueryEndMark( + subQueryIdentity); + DBMeta dbmeta = DBMetaInstanceHandler.findDBMeta(subQuery + .getTableDbName()); + if (!dbmeta.hasPrimaryKey() || dbmeta.hasTwoOrMorePrimaryKeys()) { + String msg = "The derived-referrer is unsupported when no primary key or two-or-more primary keys:"; + msg = msg + " table=" + subQuery.getTableDbName(); + throw new UnsupportedOperationException(msg); + } + String primaryKeyName = dbmeta.getPrimaryUniqueInfo() + .getFirstColumn().getColumnDbName(); + String selectClause = "select " + tableAliasName + "." + + primaryKeyName + ", " + tableAliasName + "." + + relatedColumnName + ", " + tableAliasName + "." + + deriveColumnName; + String fromWhereClause = buildPlainSubQueryFromWhereClause( + subQuery, relatedColumnName, propertyName, selectClause, + tableAliasName); + String mainSql = selectClause + " " + fromWhereClause; + String joinCondition = "dfsubquerymain." + relatedColumnName + + " = " + realColumnName; + return "select " + function + connect + "dfsubquerymain." + + deriveColumnName + ")" + ln + " from (" + beginMark + + mainSql + ln + " ) dfsubquerymain" + endMark + ln + + " where " + joinCondition; + } else { + String selectClause = "select " + function + connect + + tableAliasName + "." + deriveColumnName + ")"; + String fromWhereClause = buildCorrelationSubQueryFromWhereClause( + subQuery, relatedColumnName, propertyName, selectClause, + tableAliasName, realColumnName); + return selectClause + " " + fromWhereClause; } - - // Replace template marks. These are very important! - fromWhereClause = replaceString(fromWhereClause, getSqlClause() - .getWhereClauseMark(), "where " + joinCondition); - fromWhereClause = replaceString(fromWhereClause, getSqlClause() - .getWhereFirstConditionMark(), joinCondition - + firstConditionAfter); - fromWhereClause = replaceString(fromWhereClause, getSqlClause() - .getUnionSelectClauseMark(), selectClause); - fromWhereClause = replaceString(fromWhereClause, getSqlClause() - .getUnionWhereClauseMark(), "where " + joinCondition); - fromWhereClause = replaceString(fromWhereClause, getSqlClause() - .getUnionWhereFirstConditionMark(), joinCondition - + firstConditionAfter); - - return selectClause + " " + fromWhereClause; } - protected void throwDeriveReferrerInvalidColumnSpecificationException( + protected void throwDerivedReferrerInvalidColumnSpecificationException( String function, String aliasName) { + String method = xconvertFunctionToMethod(function); String msg = "Look! Read the message below." + getLineSeparator(); msg = msg + "/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *" + getLineSeparator(); - msg = msg + "The specified the column for derive-referrer was Invalid!" + msg = msg + + "The specified the column for derived-referrer was Invalid!" + getLineSeparator(); msg = msg + getLineSeparator(); msg = msg + "[Advice]" + getLineSeparator(); @@ -941,7 +888,7 @@ msg = msg + " /- - - - - - - - - - - - - - - - - - - - " + getLineSeparator(); msg = msg + " MemberCB cb = new MemberCB();" + getLineSeparator(); - msg = msg + " cb.specify().derivePurchaseList()." + function + msg = msg + " cb.specify().derivePurchaseList()." + method + "(new SubQuery() {" + getLineSeparator(); msg = msg + " public void query(PurchaseCB subCB) {" + getLineSeparator(); @@ -955,7 +902,7 @@ msg = msg + " /- - - - - - - - - - - - - - - - - - - - " + getLineSeparator(); msg = msg + " MemberCB cb = new MemberCB();" + getLineSeparator(); - msg = msg + " cb.specify().derivePurchaseList()." + function + msg = msg + " cb.specify().derivePurchaseList()." + method + "(new SubQuery() {" + getLineSeparator(); msg = msg + " public void query(PurchaseCB subCB) {" + getLineSeparator(); @@ -973,7 +920,7 @@ msg = msg + " /- - - - - - - - - - - - - - - - - - - - " + getLineSeparator(); msg = msg + " MemberCB cb = new MemberCB();" + getLineSeparator(); - msg = msg + " cb.specify().derivePurchaseList()." + function + msg = msg + " cb.specify().derivePurchaseList()." + method + "(new SubQuery() {" + getLineSeparator(); msg = msg + " public void query(PurchaseCB subCB) {" + getLineSeparator(); @@ -988,19 +935,19 @@ msg = msg + "[Alias Name]" + getLineSeparator() + aliasName + getLineSeparator(); msg = msg + "* * * * * * * * * */"; - throw new DeriveReferrerInvalidColumnSpecificationException(msg); + throw new DerivedReferrerInvalidColumnSpecificationException(msg); } - public static class DeriveReferrerInvalidColumnSpecificationException + public static class DerivedReferrerInvalidColumnSpecificationException extends RuntimeException { private static final long serialVersionUID = 1L; - public DeriveReferrerInvalidColumnSpecificationException(String msg) { + public DerivedReferrerInvalidColumnSpecificationException(String msg) { super(msg); } } - protected void assertDeriveReferrerColumnType(String function, + protected void assertDerivedReferrerColumnType(String function, ConditionQuery subQuery, String deriveColumnName) { final DBMeta dbmeta = DBMetaInstanceHandler.findDBMeta(subQuery .getTableDbName()); @@ -1009,13 +956,13 @@ if ("sum".equalsIgnoreCase(function) || "avg".equalsIgnoreCase(function)) { if (!Number.class.isAssignableFrom(deriveColumnType)) { - throwDeriveReferrerUnmatchedColumnTypeException(function, + throwDerivedReferrerUnmatchedColumnTypeException(function, deriveColumnName, deriveColumnType); } } } - protected void throwDeriveReferrerUnmatchedColumnTypeException( + protected void throwDerivedReferrerUnmatchedColumnTypeException( String function, String deriveColumnName, Class deriveColumnType) { String msg = "Look! Read the message below." + getLineSeparator(); msg = msg @@ -1040,19 +987,366 @@ msg = msg + "[Derive Column]" + getLineSeparator() + deriveColumnName + "(" + deriveColumnType.getName() + ")" + getLineSeparator(); msg = msg + "* * * * * * * * * */"; - throw new DeriveReferrerUnmatchedColumnTypeException(msg); + throw new DerivedReferrerUnmatchedColumnTypeException(msg); } - public static class DeriveReferrerUnmatchedColumnTypeException extends + public static class DerivedReferrerUnmatchedColumnTypeException extends RuntimeException { private static final long serialVersionUID = 1L; - public DeriveReferrerUnmatchedColumnTypeException(String msg) { + public DerivedReferrerUnmatchedColumnTypeException(String msg) { super(msg); } } + // [DBFlute-0.8.8] // ----------------------------------------------------- + // ScalarSubQuery + // -------------- + protected void registerScalarSubQuery(String function, + ConditionQuery subQuery, String propertyName, String operand) { + assertObjectNotNull("ScalarSubQuery(" + propertyName + ")", subQuery); + + // Get the specified column before it disappears at sub-query making. + String deriveRealColumnName; + { + String deriveColumnName = subQuery.getSqlClause() + .getSpecifiedColumnNameAsOne(); + if (deriveColumnName == null + || deriveColumnName.trim().length() == 0) { + throwScalarSubQueryInvalidColumnSpecificationException(function); + } + deriveRealColumnName = getScalarSubQueryRealColumnName(deriveColumnName); + } + + xincrementLocalSubQueryLevelIfNeeds(subQuery); + String subQueryClause = getScalarSubQuerySql(function, subQuery, + propertyName); + String ln = getLineSeparator(); + int subQueryLevel = subQuery.getSubQueryLevel(); + String subQueryIdentity = propertyName + "[" + subQueryLevel + "]"; + String beginMark = getSqlClause().resolveSubQueryBeginMark( + subQueryIdentity) + + ln; + String endMark = getSqlClause() + .resolveSubQueryEndMark(subQueryIdentity); + String endIndent = " "; + String clause = deriveRealColumnName + " " + operand + " (" + beginMark + + subQueryClause + ln + endIndent + ") " + endMark; + registerWhereClause(clause); + } + + protected String getScalarSubQueryRealColumnName(String columnName) { + return getRealColumnName(columnName); + } + + protected String getScalarSubQuerySql(String function, + ConditionQuery subQuery, String propertyName) { + int subQueryLevel = subQuery.getSubQueryLevel(); + String tableAliasName = "dfsublocal_" + subQueryLevel; + String deriveColumnName = subQuery.getSqlClause() + .getSpecifiedColumnNameAsOne(); + if (deriveColumnName == null || deriveColumnName.trim().length() == 0) { + throwScalarSubQueryInvalidColumnSpecificationException(function); + } + assertScalarSubQueryColumnType(function, subQuery, deriveColumnName); + subQuery.getSqlClause().clearSpecifiedSelectColumn(); // specified + // columns + // disappear at + // this timing + DBMeta dbmeta = DBMetaInstanceHandler.findDBMeta(subQuery + .getTableDbName()); + if (!dbmeta.hasPrimaryKey() || dbmeta.hasTwoOrMorePrimaryKeys()) { + String msg = "The scalar-sub-query is unsupported when no primary key or two-or-more primary keys:"; + msg = msg + " table=" + subQuery.getTableDbName(); + throw new UnsupportedOperationException(msg); + } + String primaryKeyName = dbmeta.getPrimaryUniqueInfo().getFirstColumn() + .getColumnDbName(); + if (subQuery.getSqlClause().hasUnionQuery()) { + String ln = getLineSeparator(); + String subQueryIdentity = propertyName + "[" + subQueryLevel + + ":subquerymain]"; + String beginMark = getSqlClause().resolveSubQueryBeginMark( + subQueryIdentity) + + ln; + String endMark = getSqlClause().resolveSubQueryEndMark( + subQueryIdentity); + String selectClause = "select " + tableAliasName + "." + + primaryKeyName + ", " + tableAliasName + "." + + deriveColumnName; + String fromWhereClause = buildPlainSubQueryFromWhereClause( + subQuery, primaryKeyName, propertyName, selectClause, + tableAliasName); + String mainSql = selectClause + " " + fromWhereClause; + return "select " + function + "(dfsubquerymain." + deriveColumnName + + ")" + ln + " from (" + beginMark + mainSql + ln + + " ) dfsubquerymain" + endMark; + } else { + String selectClause = "select " + function + "(" + tableAliasName + + "." + deriveColumnName + ")"; + String fromWhereClause = buildPlainSubQueryFromWhereClause( + subQuery, primaryKeyName, propertyName, selectClause, + tableAliasName); + return selectClause + " " + fromWhereClause; + } + } + + protected void throwScalarSubQueryInvalidColumnSpecificationException( + String function) { + String msg = "Look! Read the message below." + getLineSeparator(); + msg = msg + + "/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *" + + getLineSeparator(); + msg = msg + + "The specified the column for derived-referrer was Invalid!" + + getLineSeparator(); + msg = msg + getLineSeparator(); + msg = msg + "[Advice]" + getLineSeparator(); + msg = msg + + " You should call specify().column[TargetColumn]() only once." + + getLineSeparator(); + msg = msg + " For example:" + getLineSeparator(); + msg = msg + " " + getLineSeparator(); + msg = msg + " [Wrong]" + getLineSeparator(); + msg = msg + " /- - - - - - - - - - - - - - - - - - - - " + + getLineSeparator(); + msg = msg + " MemberCB cb = new MemberCB();" + getLineSeparator(); + msg = msg + " cb.query().scalar_Equal()." + function + + "(new SubQuery() {" + getLineSeparator(); + msg = msg + " public void query(MemberCB subCB) {" + + getLineSeparator(); + msg = msg + " // *No! It's empty!" + getLineSeparator(); + msg = msg + " }" + getLineSeparator(); + msg = msg + " });" + getLineSeparator(); + msg = msg + " - - - - - - - - - -/" + getLineSeparator(); + msg = msg + " " + getLineSeparator(); + msg = msg + " [Wrong]" + getLineSeparator(); + msg = msg + " /- - - - - - - - - - - - - - - - - - - - " + + getLineSeparator(); + msg = msg + " MemberCB cb = new MemberCB();" + getLineSeparator(); + msg = msg + " cb.query().scalar_Equal()." + function + + "(new SubQuery() {" + getLineSeparator(); + msg = msg + " public void query(MemberCB subCB) {" + + getLineSeparator(); + msg = msg + " subCB.specify().columnMemberBirthday();" + + getLineSeparator(); + msg = msg + + " subCB.specify().columnMemberName(); // *No! It's duplicated!" + + getLineSeparator(); + msg = msg + " }" + getLineSeparator(); + msg = msg + " });" + getLineSeparator(); + msg = msg + " - - - - - - - - - -/" + getLineSeparator(); + msg = msg + " " + getLineSeparator(); + msg = msg + " [Good!]" + getLineSeparator(); + msg = msg + " /- - - - - - - - - - - - - - - - - - - - " + + getLineSeparator(); + msg = msg + " MemberCB cb = new MemberCB();" + getLineSeparator(); + msg = msg + " cb.query().scalar_Equal()." + function + + "(new SubQuery() {" + getLineSeparator(); + msg = msg + " public void query(MemberCB subCB) {" + + getLineSeparator(); + msg = msg + + " subCB.specify().columnPurchaseDatetime(); // *Point!" + + getLineSeparator(); + msg = msg + " }" + getLineSeparator(); + msg = msg + " });" + getLineSeparator(); + msg = msg + " - - - - - - - - - -/" + getLineSeparator(); + msg = msg + "* * * * * * * * * */"; + throw new ScalarSubQueryInvalidColumnSpecificationException(msg); + } + + public static class ScalarSubQueryInvalidColumnSpecificationException + extends RuntimeException { + private static final long serialVersionUID = 1L; + + public ScalarSubQueryInvalidColumnSpecificationException(String msg) { + super(msg); + } + } + + protected void assertScalarSubQueryColumnType(String function, + ConditionQuery subQuery, String deriveColumnName) { + final DBMeta dbmeta = DBMetaInstanceHandler.findDBMeta(subQuery + .getTableDbName()); + final Class deriveColumnType = dbmeta.findColumnInfo( + deriveColumnName).getPropertyType(); + if ("sum".equalsIgnoreCase(function) + || "avg".equalsIgnoreCase(function)) { + if (!Number.class.isAssignableFrom(deriveColumnType)) { + throwScalarSubQueryUnmatchedColumnTypeException(function, + deriveColumnName, deriveColumnType); + } + } + } + + protected void throwScalarSubQueryUnmatchedColumnTypeException( + String function, String deriveColumnName, Class deriveColumnType) { + String msg = "Look! Read the message below." + getLineSeparator(); + msg = msg + + "/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *" + + getLineSeparator(); + msg = msg + + "The type of the specified the column unmatched with the function!" + + getLineSeparator(); + msg = msg + getLineSeparator(); + msg = msg + "[Advice]" + getLineSeparator(); + msg = msg + "You should confirm the list as follow:" + + getLineSeparator(); + msg = msg + " max() : String, Number, Date" + getLineSeparator(); + msg = msg + " min() : String, Number, Date" + getLineSeparator(); + msg = msg + " sum() : Number" + getLineSeparator(); + msg = msg + " avg() : Number" + getLineSeparator(); + msg = msg + getLineSeparator(); + msg = msg + "[Function]" + getLineSeparator() + function + + getLineSeparator(); + msg = msg + getLineSeparator(); + msg = msg + "[Derive Column]" + getLineSeparator() + deriveColumnName + + "(" + deriveColumnType.getName() + ")" + getLineSeparator(); + msg = msg + "* * * * * * * * * */"; + throw new ScalarSubQueryUnmatchedColumnTypeException(msg); + } + + public static class ScalarSubQueryUnmatchedColumnTypeException extends + RuntimeException { + private static final long serialVersionUID = 1L; + + public ScalarSubQueryUnmatchedColumnTypeException(String msg) { + super(msg); + } + } + + public static class SSQFunction { + protected SSQSetupper _setupper; + + public SSQFunction(SSQSetupper setupper) { + _setupper = setupper; + } + + public void max(SubQuery subQuery) { + _setupper.setup("max", subQuery); + } + + public void min(SubQuery subQuery) { + _setupper.setup("min", subQuery); + } + + public void sum(SubQuery subQuery) { + _setupper.setup("sum", subQuery); + } + + public void avg(SubQuery subQuery) { + _setupper.setup("avg", subQuery); + } + } + + protected static interface SSQSetupper { + public void setup(String function, SubQuery subQuery); + } + + // ----------------------------------------------------- + // SubQuery Common + // --------------- + protected String buildPlainSubQueryFromWhereClause(ConditionQuery subQuery, + String relatedColumnName, String propertyName, String selectClause, + String tableAliasName) { + String fromWhereClause = subQuery.getSqlClause() + .getClauseFromWhereWithUnionTemplate(); + + // Replace the alias names for local table with alias name of sub-query + // unique. + // However when it's inScope this replacement is unnecessary so comment + // out here. + // (Override base alias name at sub-query on SQL) + // So if the argument 'tableAliasName' is not null, replace it. + if (tableAliasName != null) { + fromWhereClause = replaceString(fromWhereClause, "dflocal", + tableAliasName); + } + + // Resolve the location path for the condition-query of sub-query. + fromWhereClause = replaceString(fromWhereClause, ".conditionQuery.", + "." + getLocationBase(propertyName) + "."); + + // Replace template marks. These are very important! + fromWhereClause = replaceString(fromWhereClause, getSqlClause() + .getUnionSelectClauseMark(), selectClause); + fromWhereClause = replaceString(fromWhereClause, getSqlClause() + .getUnionWhereClauseMark(), ""); + fromWhereClause = replaceString(fromWhereClause, getSqlClause() + .getUnionWhereFirstConditionMark(), ""); + return fromWhereClause; + } + + protected String buildCorrelationSubQueryFromWhereClause( + ConditionQuery subQuery, String relatedColumnName, + String propertyName, String selectClause, String tableAliasName, + String realColumnName) { + String fromWhereClause = subQuery.getSqlClause() + .getClauseFromWhereWithWhereUnionTemplate(); + + // Replace the alias names for local table with alias name of sub-query + // unique. + fromWhereClause = replaceString(fromWhereClause, "dflocal", + tableAliasName); + + // Resolve the location path for the condition-query of sub-query. + fromWhereClause = replaceString(fromWhereClause, ".conditionQuery.", + "." + getLocationBase(propertyName) + "."); + + String joinCondition = tableAliasName + "." + relatedColumnName + " = " + + realColumnName; + String firstConditionAfter = getLineSeparator() + " and "; + + // Replace template marks. These are very important! + fromWhereClause = replaceString(fromWhereClause, getSqlClause() + .getWhereClauseMark(), "where " + joinCondition); + fromWhereClause = replaceString(fromWhereClause, getSqlClause() + .getWhereFirstConditionMark(), joinCondition + + firstConditionAfter); + fromWhereClause = replaceString(fromWhereClause, getSqlClause() + .getUnionSelectClauseMark(), selectClause); + fromWhereClause = replaceString(fromWhereClause, getSqlClause() + .getUnionWhereClauseMark(), "where " + joinCondition); + fromWhereClause = replaceString(fromWhereClause, getSqlClause() + .getUnionWhereFirstConditionMark(), joinCondition + + firstConditionAfter); + return fromWhereClause; + } + + protected void xincrementLocalSubQueryLevelIfNeeds(ConditionQuery subQuery) { // Very + // Internal + int subQueryLevel = subQuery.getSubQueryLevel(); + if (_subQueryLevel <= subQueryLevel) { + _subQueryLevel = subQueryLevel + 1; + } + } + + protected String xbuildFunctionConnector(String function) { + if (function != null && function.endsWith("(distinct")) { // For example + // 'count(distinct' + return " "; + } else { + return "("; + } + } + + protected String xconvertFunctionToMethod(String function) { + if (function != null && function.contains("(")) { // For example + // 'count(distinct' + int index = function.indexOf("("); + String front = function.substring(0, index); + if (function.length() > front.length() + "(".length()) { + String rear = function.substring(index + "(".length()); + function = front + initCap(rear); + } else { + function = front; + } + } + return function; + } + + // ----------------------------------------------------- // Where Clause // ------------ protected void setupConditionValueAndRegisterWhereClause(ConditionKey key, @@ -1276,14 +1570,16 @@ // ========= // Fixed Condition // =============== - protected String prepareFixedCondition(String fixedCondition, - String localAliasName, String foreignAliasName) { + protected String ppFxCd(String fixedCondition, String localAliasName, + String foreignAliasName) { // prepareFixedCondition fixedCondition = replaceString(fixedCondition, "$$alias$$", foreignAliasName); fixedCondition = replaceString(fixedCondition, "$$foreignAlias$$", foreignAliasName); fixedCondition = replaceString(fixedCondition, "$$localAlias$$", localAliasName); + fixedCondition = replaceString(fixedCondition, "$$locationBase$$.", + "dto." + getLocationBase()); return fixedCondition; } @@ -1515,7 +1811,7 @@ return newList; } - public void doNss(NssCall callback) {// Very Internal + public void doNss(NssCall callback) { // Very Internal String foreignPropertyName = callback.qf().getForeignPropertyName(); String foreignTableAliasName = callback.qf().getRealAliasName(); getSqlClause().registerSelectedSelectColumn(foreignTableAliasName, @@ -1524,7 +1820,7 @@ callback.qf().getRelationPath(), foreignPropertyName); } - public static interface NssCall {// Very Internal + public static interface NssCall { // Very Internal public ConditionQuery qf(); } Modified: notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/cbean/ConditionBean.java =================================================================== --- notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/cbean/ConditionBean.java 2008-12-27 22:11:51 UTC (rev 1627) +++ notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/cbean/ConditionBean.java 2008-12-27 22:13:37 UTC (rev 1628) @@ -1,5 +1,7 @@ package jp.sf.pal.notepad.db.allcommon.cbean; +import java.util.Map; + import jp.sf.pal.notepad.db.allcommon.cbean.sqlclause.SqlClause; import jp.sf.pal.notepad.db.allcommon.jdbc.StatementConfig; @@ -11,28 +13,6 @@ public interface ConditionBean extends PagingBean { //========================================================================== - // =========== - // Definition - // ========== - /** Map-string map-mark. */ - public static final String MAP_STRING_MAP_MARK = "map:"; - - /** Map-string list-mark. */ - public static final String MAP_STRING_LIST_MARK = "list:"; - - /** Map-string start-brace. */ - public static final String MAP_STRING_START_BRACE = "@{"; - - /** Map-string end-brace. */ - public static final String MAP_STRING_END_BRACE = "@}"; - - /** Map-string delimiter. */ - public static final String MAP_STRING_DELIMITER = "@;"; - - /** Map-string equal. */ - public static final String MAP_STRING_EQUAL = "@="; - - //========================================================================== // ========= // Table Name // ========== @@ -70,8 +50,7 @@ * * @param primaryKeyMap Primary-key map. (NotNull and NotEmpty) */ - public void acceptPrimaryKeyMap( - java.util.Map primaryKeyMap); + public void acceptPrimaryKeyMap(Map primaryKeyMap); /** * Accept primary-key map-string. Delimiter is at-mark and semicolon. @@ -105,14 +84,6 @@ // Query // ===== /** - * Get condition-query as interface. - * - * @return Instance of query as interface. (NotNull) - * @deprecated - */ - public ConditionQuery getConditionQueryAsInterface(); - - /** * Get the conditionQuery of the local table as interface. * * @return The conditionQuery of the local table as interface. (NotNull) @@ -131,32 +102,6 @@ public boolean hasUnionQueryOrUnionAllQuery(); //========================================================================== - // ========= - // Limit Select - // ============ - /** - * Limit select PK only. This is OLD style. You can do the same thing by - * specify(). - * - * @return this. (NotNull) - */ - public ConditionBean limitSelect_PKOnly(); - - /** - * Limit select off. - * - * @return this. (NotNull) - */ - public ConditionBean limitSelect_Off(); - - /** - * Is limit-select PK only? - * - * @return Determination. - */ - public boolean isLimitSelect_PKOnly(); - - //========================================================================== // =========== // Lock Setting // ============ Modified: notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/cbean/ConditionBeanContext.java =================================================================== --- notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/cbean/ConditionBeanContext.java 2008-12-27 22:11:51 UTC (rev 1627) +++ notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/cbean/ConditionBeanContext.java 2008-12-27 22:13:37 UTC (rev 1628) @@ -1,10 +1,6 @@ package jp.sf.pal.notepad.db.allcommon.cbean; -import java.util.Collections; -import java.util.LinkedHashMap; -import java.util.Map; - -import jp.sf.pal.notepad.db.allcommon.DBFluteConfig; +import jp.sf.pal.notepad.db.allcommon.DBDef; import jp.sf.pal.notepad.db.allcommon.cbean.sqlclause.SqlClause; import jp.sf.pal.notepad.db.allcommon.cbean.sqlclause.SqlClauseDb2; import jp.sf.pal.notepad.db.allcommon.cbean.sqlclause.SqlClauseDerby; @@ -78,11 +74,35 @@ //========================================================================== // ========= - // Initialize against the ClassLoader Headache - // =========================================== + // Type Determination + // ================== + /** + * Is the argument condition-bean? + * + * @param dtoInstance DTO instance. + * @return Determination. + */ + public static boolean isTheArgumentConditionBean(final Object dtoInstance) { + return dtoInstance instanceof ConditionBean; + } + + /** + * Is the type condition-bean? + * + * @param dtoClass DtoClass. + * @return Determination. + */ + public static boolean isTheTypeConditionBean(final Class dtoClass) { + return ConditionBean.class.isAssignableFrom(dtoClass); + } + + //========================================================================== + // ========= + // Cool Classes + // ============ @SuppressWarnings("unused") - public static void initialize() { - boolean debugEnabled = _log.isDebugEnabled(); + public static void loadCoolClasses() { + boolean debugEnabled = false; // If you watch the log, set this true. // Against the ClassLoader Headache! final StringBuilder sb = new StringBuilder(); { @@ -119,120 +139,6 @@ //========================================================================== // ========= - // Type Determination - // ================== - /** - * Is the argument condition-bean? - * - * @param dtoInstance DTO instance. - * @return Determination. - */ - public static boolean isTheArgumentConditionBean(final Object dtoInstance) { - if (dtoInstance instanceof ConditionBean) { - return true; - } else { - return false; - } - } - - /** - * Is the type condition-bean? - * - * @param dtoClass DtoClass. - * @return Determination. - */ - public static boolean isTheTypeConditionBean(final Class dtoClass) { - if (ConditionBean.class.isAssignableFrom(dtoClass)) { - return true; - } else { - return false; - } - } - - //========================================================================== - // ========= - // Product Name - // ============ - public static final String DB_NAME_DERBY = "derby"; - - public static final String DB_NAME_H2 = "h2"; - - public static final String DB_NAME_ORACLE = "oracle"; - - public static final String DB_NAME_MYSQL = "mysql"; - - public static final String DB_NAME_POSTGRESQL = "postgresql"; - - public static final String DB_NAME_FIREBIRD = "firebird"; - - public static final String DB_NAME_MSSQL = "mssql"; - - public static final String DB_NAME_SYBASE = "sybase"; - - public static final String DB_NAME_DB2 = "db2"; - - protected static final Map _driverHintDatabaseProductNameMap; - static { - final Map tmpMap = Collections - .synchronizedMap(new LinkedHashMap()); - 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 keySet = _driverHintDatabaseProductNameMap - .keySet(); - for (final java.util.Iterator ite = keySet.iterator(); ite - .hasNext();) { - final String driverHint = (String) ite.next(); - if (driverClassName.indexOf(driverHint) >= 0) { - final String databaseProductName = (String) _driverHintDatabaseProductNameMap - .get(driverHint); - setDatabaseProductName(databaseProductName); - return true; - } - } - return false; - } - - /** The database product name. */ - private static String _databaseProductName; - - /** - * Get database product name. - * - * @return Database product name. - */ - public static String getDatabaseProductName() { - return _databaseProductName; - } - - /** - * Set database product name. - * - * @param name Database product name. (NotNull) - */ - public static void setDatabaseProductName(String name) { - if (_databaseProductName != null) { - String msg = "Already set up: current=" + _databaseProductName - + " your=" + name; - throw new IllegalStateException(msg); - } - _databaseProductName = name; - } - - //========================================================================== - // ========= // SqlClause Creator // ================= /** @@ -244,9 +150,6 @@ public static SqlClause createSqlClause(ConditionBean cb) { final String tableSqlName = cb.getTableSqlName(); final SqlClause sqlClause = createSqlClause(tableSqlName); - if (DBFluteConfig.getInstance().isConditionBeanFormatSql()) { - sqlClause.makeFormatClauseEffective(); - } return sqlClause; } @@ -257,27 +160,22 @@ * @return SQL-clause. (NotNull) */ public static SqlClause createSqlClause(String tableDbName) { - final String databaseProductName = getDatabaseProductName(); - if (databaseProductName == null) { - return new SqlClauseH2(tableDbName); - } - final String name = databaseProductName.toLowerCase(); - if (name.equalsIgnoreCase(DB_NAME_DERBY)) { - return new SqlClauseDerby(tableDbName); - } else if (name.equalsIgnoreCase(DB_NAME_H2)) { - return new SqlClauseH2(tableDbName); - } else if (name.equalsIgnoreCase(DB_NAME_ORACLE)) { - return new SqlClauseOracle(tableDbName); - } else if (name.equalsIgnoreCase(DB_NAME_FIREBIRD)) { - return new SqlClauseFirebird(tableDbName); - } else if (name.equalsIgnoreCase(DB_NAME_MYSQL)) { + if (DBDef.isCurrentDef(DBDef.MySQL)) { return new SqlClauseMySql(tableDbName); - } else if (name.equalsIgnoreCase(DB_NAME_POSTGRESQL)) { + } else if (DBDef.isCurrentDef(DBDef.PostgreSQL)) { return new SqlClausePostgreSql(tableDbName); - } else if (name.equalsIgnoreCase(DB_NAME_MSSQL)) { - return new SqlClauseSqlServer(tableDbName); - } else if (name.equalsIgnoreCase(DB_NAME_DB2)) { + } else if (DBDef.isCurrentDef(DBDef.Oracle)) { + return new SqlClauseOracle(tableDbName); + } else if (DBDef.isCurrentDef(DBDef.DB2)) { return new SqlClauseDb2(tableDbName); + } else if (DBDef.isCurrentDef(DBDef.SQLServer)) { + return new SqlClauseSqlServer(tableDbName); + } else if (DBDef.isCurrentDef(DBDef.FireBird)) { + return new SqlClauseFirebird(tableDbName); + } else if (DBDef.isCurrentDef(DBDef.H2)) { + return new SqlClauseH2(tableDbName); + } else if (DBDef.isCurrentDef(DBDef.Derby)) { + return new SqlClauseDerby(tableDbName); } else { return new SqlClauseH2(tableDbName); } @@ -362,12 +260,7 @@ // Display SQL // =========== public static String convertConditionBean2DisplaySql(ConditionBean cb) { - final String twoWaySql; - if (cb.isLimitSelect_PKOnly()) { - twoWaySql = cb.getSqlClause().getClausePKOnly(); - } else { - twoWaySql = cb.getSqlClause().getClause(); - } + final String twoWaySql = cb.getSqlClause().getClause(); return InternalSqlParser.convertTwoWaySql2DisplaySql(twoWaySql, cb); } @@ -390,31 +283,8 @@ errorCode); } - // [DBFlute-0.7.8] //========================================================================== // ========= - // Database Type - // ============= - /** - * Is the database Oracle? - * - * @return Is the database Oracle? - */ - public static boolean isOracle() { - return createSqlClause("dummy") instanceof SqlClauseOracle; - } - - /** - * Is the database PostgreSQL? - * - * @return Is the database PostgreSQL? - */ - public static boolean isPostgreSql() { - return createSqlClause("dummy") instanceof SqlClausePostgreSql; - } - - //========================================================================== - // ========= // Helper // ====== /** Modified: notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/cbean/ConditionQuery.java =================================================================== --- notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/cbean/ConditionQuery.java 2008-12-27 22:11:51 UTC (rev 1627) +++ notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/cbean/ConditionQuery.java 2008-12-27 22:13:37 UTC (rev 1628) @@ -8,7 +8,6 @@ * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public interface ConditionQuery { //========================================================================== Added: notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/cbean/ScalarQuery.java =================================================================== --- notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/cbean/ScalarQuery.java (rev 0) +++ notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/cbean/ScalarQuery.java 2008-12-27 22:13:37 UTC (rev 1628) @@ -0,0 +1,5 @@ +package jp.sf.pal.notepad.db.allcommon.cbean; + +public interface ScalarQuery { + public void query(CB cb); +} Property changes on: notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/cbean/ScalarQuery.java ___________________________________________________________________ Name: svn:eol-style + native Modified: notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/cbean/ckey/ConditionKey.java =================================================================== --- notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/cbean/ckey/ConditionKey.java 2008-12-27 22:11:51 UTC (rev 1627) +++ notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/cbean/ckey/ConditionKey.java 2008-12-27 22:13:37 UTC (rev 1628) @@ -12,6 +12,10 @@ */ public abstract class ConditionKey { + //========================================================================== + // ========= + // Definition + // ========== /** Mark of replaced value. */ public static final String MARK_OF_REPLACED_VALUE = "ReplacedValue"; @@ -36,15 +40,18 @@ /** The condition key of prefixSearch. */ public static final ConditionKey CK_PREFIX_SEARCH = new ConditionKeyPrefixSearch(); - /** The condition key of likeSearch. */ - public static final ConditionKey CK_LIKE_SEARCH = new ConditionKeyLikeSearch(); - /** The condition key of inScope. */ public static final ConditionKey CK_IN_SCOPE = new ConditionKeyInScope(); /** The condition key of notInScope. */ public static final ConditionKey CK_NOT_IN_SCOPE = new ConditionKeyNotInScope(); + /** The condition key of likeSearch. */ + public static final ConditionKey CK_LIKE_SEARCH = new ConditionKeyLikeSearch(); + + /** The condition key of notLikeSearch. */ + public static final ConditionKey CK_NOT_LIKE_SEARCH = new ConditionKeyNotLikeSearch(); + /** The condition key of isNull. */ public static final ConditionKey CK_IS_NULL = new ConditionKeyIsNull(); @@ -54,31 +61,21 @@ /** Dummy-object for IsNull and IsNotNull and so on... */ protected static final Object DUMMY_OBJECT = new Object(); + //========================================================================== + // ========= + // Attribute + // ========= /** Condition-key. */ protected String _conditionKey; /** Operand. */ protected String _operand; + //========================================================================== + // ========= + // Validation + // ========== /** - * Get condition-key. - * - * @return Condition-key. - */ - public String getConditionKey() { - return _conditionKey; - } - - /** - * Get operand. - * - * @return Operand. - */ - public String getOperand() { - return _operand; - } - - /** * Is valid registration? * * @param conditionValue Condition value. (NotNull) @@ -89,6 +86,10 @@ abstract public boolean isValidRegistration(ConditionValue conditionValue, Object value, String callerName); + //========================================================================== + // ========= + // Where Clause + // ============ /** * Add where clause. * @@ -149,6 +150,10 @@ abstract protected void doAddWhereClause(List conditionList, String columnName, ConditionValue value, ConditionOption option); + //========================================================================== + // ========= + // Condition Value + // =============== /** * Setup condition value. * @@ -210,6 +215,10 @@ ConditionValue conditionValue, Object value, String location, ConditionOption option); + //========================================================================== + // ========= + // Bind Clause + // =========== /** * Build bind clause. (for s2dao) * @@ -269,6 +278,10 @@ return "%"; } + //========================================================================== + // ========= + // Basic Override + // ============== /** * The override. Returns hash-code of this condition-key string. * @@ -304,4 +317,26 @@ return "ConditionKey: " + getConditionKey() + " " + getOperand() + " wild-card=[" + getWildCard() + "]"; } + + //========================================================================== + // ========= + // Accessor + // ======== + /** + * Get condition-key. + * + * @return Condition-key. + */ + public String getConditionKey() { + return _conditionKey; + } + + /** + * Get operand. + * + * @return Operand. + */ + public String getOperand() { + return _operand; + } } Added: notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/cbean/ckey/ConditionKeyNotLikeSearch.java =================================================================== --- notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/cbean/ckey/ConditionKeyNotLikeSearch.java (rev 0) +++ notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/cbean/ckey/ConditionKeyNotLikeSearch.java 2008-12-27 22:13:37 UTC (rev 1628) @@ -0,0 +1,104 @@ +package jp.sf.pal.notepad.db.allcommon.cbean.ckey; + +import java.util.List; + +import jp.sf.pal.notepad.db.allcommon.cbean.coption.ConditionOption; +import jp.sf.pal.notepad.db.allcommon.cbean.coption.LikeSearchOption; +import jp.sf.pal.notepad.db.allcommon.cbean.cvalue.ConditionValue; + +/** + * The condition-key of notLikeSearch. + * + * @author DBFlute(AutoGenerator) + */ +public class ConditionKeyNotLikeSearch extends ConditionKey { + + /** + * Constructor. + */ + protected ConditionKeyNotLikeSearch() { + _conditionKey = "notLikeSearch"; + _operand = "not like"; + } + + /** + * Is valid registration? + * + * @param conditionValue Condition value. (NotNull) + * @param value Value. (NotNull) + * @param callerName Caller name. (NotNull) + * @return Determination. + */ + public boolean isValidRegistration(ConditionValue conditionValue, + Object value, String callerName) { + if (value == null) { + return false; + } + return true; + } + + /** + * This method implements super#doAddWhereClause(). + * + * @param conditionList Condition list. (NotNull) + * @param columnName Column name. (NotNull) + * @param value Condition value. (NotNull) + */ + protected void doAddWhereClause(List 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 conditionList, + String columnName, ConditionValue value, ConditionOption option) { + if (option == null) { + String msg = "The argument[option] should not be null: columnName=" + + columnName + " value=" + value; + throw new IllegalArgumentException(msg); + } + if (!(option instanceof LikeSearchOption)) { + String msg = "The argument[option] should be LikeSearchOption: columnName=" + + columnName + " value=" + value; + throw new IllegalArgumentException(msg); + } + final LikeSearchOption myOption = (LikeSearchOption) option; + conditionList.add(buildBindClauseWithRearOption(columnName, value + .getNotLikeSearchLocation(), myOption.getRearOption())); + } + + /** + * This method implements super#doSetupConditionValue(). + * + * @param conditionValue Condition value. (NotNull) + * @param value Value. (NotNull) + * @param location Location. (NotNull) + */ + protected void doSetupConditionValue(ConditionValue conditionValue, + Object value, String location) { + throw new UnsupportedOperationException( + "doSetupConditionValue without condition-option is unsupported!!!"); + } + + /** + * This method implements super#doSetupConditionValue(). + * + * @param conditionValue Condition value. (NotNull) + * @param value Value. (NotNull) + * @param location Location. (NotNull) + * @param option Condition option. (NotNull) + */ + protected void doSetupConditionValue(ConditionValue conditionValue, + Object value, String location, ConditionOption option) { + conditionValue.setNotLikeSearch((String) value, + (LikeSearchOption) option).setNotLikeSearchLocation(location); + } +} Property changes on: notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/cbean/ckey/ConditionKeyNotLikeSearch.java ___________________________________________________________________ Name: svn:eol-style + native Modified: notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/cbean/coption/FromToOption.java =================================================================== --- notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/cbean/coption/FromToOption.java 2008-12-27 22:11:51 UTC (rev 1627) +++ notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/cbean/coption/FromToOption.java 2008-12-27 22:13:37 UTC (rev 1628) @@ -1,5 +1,10 @@ package jp.sf.pal.notepad.db.allcommon.cbean.coption; +import java.util.Calendar; +import java.util.Date; + +import jp.sf.pal.notepad.db.allcommon.cbean.ckey.ConditionKey; + /** * The option of from-to. * @@ -85,60 +90,84 @@ // ========= // Internal Main // ============= - public java.util.Date filterFromDate(java.util.Date fromDate) { + /** + * Filter the date as From. It requires this method is called before + * getFromDateConditionKey(). + * + * @param fromDate The date as From. (Nullable: If the value is null, it + * returns null) + * @return The filtered date as From. (Nullable) + */ + public Date filterFromDate(Date fromDate) { if (fromDate == null) { return null; } if (_compareAsDate) { - final java.util.Calendar cal = java.util.Calendar.getInstance(); + final Calendar cal = Calendar.getInstance(); cal.setTimeInMillis(fromDate.getTime()); clearCalendarHourMinuteSecondMilli(cal); - final java.util.Date cloneDate = (java.util.Date) fromDate.clone(); + final Date cloneDate = (Date) fromDate.clone(); cloneDate.setTime(cal.getTimeInMillis()); return cloneDate; } return fromDate; } - public java.util.Date filterToDate(java.util.Date toDate) { + /** + * Filter the date as To. It requires this method is called before + * getToDateConditionKey(). + * + * @param toDate The date as To. (Nullable: If the value is null, it returns + * null) + * @return The filtered date as To. (Nullable) + */ + public Date filterToDate(Date toDate) { if (toDate == null) { return null; } if (_compareAsDate) { - final java.util.Calendar cal = java.util.Calendar.getInstance(); + final Calendar cal = Calendar.getInstance(); cal.setTimeInMillis(toDate.getTime()); clearCalendarHourMinuteSecondMilli(cal); addCalendarNextDay(cal);// Key Point! - final java.util.Date cloneDate = (java.util.Date) toDate.clone(); + final Date cloneDate = (Date) toDate.clone(); cloneDate.setTime(cal.getTimeInMillis()); return cloneDate; } return toDate; } - public jp.sf.pal.notepad.db.allcommon.cbean.ckey.ConditionKey getFromDateConditionKey() { + /** + * Get the condition-key of the from-date. It requires this method is called + * after filterFromDate(). + * + * @return The condition-key of the from-date. (NotNull) + */ + public ConditionKey getFromDateConditionKey() { if (_compareAsDate) { - return jp.sf.pal.notepad.db.allcommon.cbean.ckey.ConditionKey.CK_GREATER_EQUAL; + return ConditionKey.CK_GREATER_EQUAL; } if (_fromDateGreaterThan) { - return jp.sf.pal.notepad.db.allcommon.cbean.ckey.ConditionKey.CK_GREATER_THAN;// Default - // ! + return ConditionKey.CK_GREATER_THAN;// Default! } else { - return jp.sf.pal.notepad.db.allcommon.cbean.ckey.ConditionKey.CK_GREATER_EQUAL;// Default - // ! + return ConditionKey.CK_GREATER_EQUAL;// Default! } } - public jp.sf.pal.notepad.db.allcommon.cbean.ckey.ConditionKey getToDateConditionKey() { + /** + * Get the condition-key of the to-date. It requires this method is called + * after filterToDate(). + * + * @return The condition-key of the to-date. (NotNull) + */ + public ConditionKey getToDateConditionKey() { if (_compareAsDate) { - return jp.sf.pal.notepad.db.allcommon.cbean.ckey.ConditionKey.CK_LESS_THAN; + return ConditionKey.CK_LESS_THAN; } if (_toDateLessThan) { - return jp.sf.pal.notepad.db.allcommon.cbean.ckey.ConditionKey.CK_LESS_THAN;// Default - // ! + return ConditionKey.CK_LESS_THAN;// Default! } else { - return jp.sf.pal.notepad.db.allcommon.cbean.ckey.ConditionKey.CK_LESS_EQUAL;// Default - // ! + return ConditionKey.CK_LESS_EQUAL;// Default! } } @@ -146,15 +175,15 @@ // ========= // Calendar Helper // =============== - protected void addCalendarNextDay(java.util.Calendar cal) { - cal.add(java.util.Calendar.DAY_OF_MONTH, 1); + protected void addCalendarNextDay(Calendar cal) { + cal.add(Calendar.DAY_OF_MONTH, 1); } - protected void clearCalendarHourMinuteSecondMilli(java.util.Calendar cal) { - cal.clear(java.util.Calendar.MILLISECOND); - cal.clear(java.util.Calendar.SECOND); - cal.clear(java.util.Calendar.MINUTE); - cal.set(java.util.Calendar.HOUR_OF_DAY, cal - .getActualMinimum(java.util.Calendar.HOUR_OF_DAY)); + protected void clearCalendarHourMinuteSecondMilli(Calendar cal) { + cal.clear(Calendar.MILLISECOND); + cal.clear(Calendar.SECOND); + cal.clear(Calendar.MINUTE); + cal.set(Calendar.HOUR_OF_DAY, cal + .getActualMinimum(Calendar.HOUR_OF_DAY)); } } Modified: notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/cbean/coption/LikeSearchOption.java =================================================================== --- notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/cbean/coption/LikeSearchOption.java 2008-12-27 22:11:51 UTC (rev 1627) +++ notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/cbean/coption/LikeSearchOption.java 2008-12-27 22:13:37 UTC (rev 1628) @@ -4,6 +4,7 @@ import java.util.Iterator; import java.util.List; +import jp.sf.pal.notepad.db.allcommon.DBDef; import jp.sf.pal.notepad.db.allcommon.cbean.coption.parts.local.JapaneseOptionPartsAgent; /** @@ -230,6 +231,10 @@ String tmp = replace(value, _escape, _escape + _escape); tmp = replace(tmp, "%", _escape + "%"); tmp = replace(tmp, "_", _escape + "_"); + if (DBDef.isCurrentDef(DBDef.Oracle)) { + tmp = replace(tmp, "\uff05", _escape + "\uff05"); + tmp = replace(tmp, "\uff3f", _escape + "\uff3f"); + } value = tmp; } final String wildCard = "%"; Modified: notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/cbean/cvalue/ConditionValue.java =================================================================== --- notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/cbean/cvalue/ConditionValue.java 2008-12-27 22:11:51 UTC (rev 1627) +++ notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/cbean/cvalue/ConditionValue.java 2008-12-27 22:13:37 UTC (rev 1628) @@ -6,9 +6,10 @@ import jp.sf.pal.notepad.db.allcommon.cbean.coption.InScopeOption; import jp.sf.pal.notepad.db.allcommon.cbean.coption.LikeSearchOption; +import jp.sf.pal.notepad.db.allcommon.util.SimpleTypeUtil; /** - * Condition value. + * Condition-value. * * @author DBFlute(AutoGenerator) */ @@ -578,110 +579,9 @@ //========================================================================== // ========= - // Like Search - // =========== - /** Value of likeSearch. */ - protected List _likeSearch; - - /** Value of likeSearch for spare. */ - protected List _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(); - _likeSearch4Spare = new ArrayList(); - } - if (_likeSearch.isEmpty() && !_likeSearch4Spare.isEmpty()) { - for (int index = 0; index < _likeSearch4Spare.size(); index++) { - _likeSearch.add(_likeSearch4Spare.get(index)); - } - } - LikeSearchValue likeSearchValue = new LikeSearchValue(value, option); - _likeSearch.add(likeSearchValue); - _likeSearch4Spare.add(likeSearchValue); - return this; - } - - /** Location of likeSearch. */ - protected String _likeSearchLocation; - - /** - * Get the location of likeSearch. - * - * @return The location of likeSearch. (Nullable) - */ - public String getLikeSearchLocation() { - return _likeSearchLocation; - } - - /** - * Set the location of likeSearch. - * - * @param location The location of likeSearch. (Nullable) - * @return this. (NotNull) - */ - public ConditionValue setLikeSearchLocation(String location) { - _likeSearchLocation = location; - return this; - } - - protected static class LikeSearchValue { - protected String _value; - - protected LikeSearchOption _option; - - public LikeSearchValue(String value, LikeSearchOption option) { - _value = value; - _option = option; - } - - public String getValue() { - return _value; - } - - public LikeSearchOption getOption() { - return _option; - } - - public String generateRealValue() { - if (_option == null) { - return _value; - } - return _option.generateRealValue(_value); - } - } - - //========================================================================== - // ========= // In Scope // ======== - /** Value of inScope. */ + /** The value of inScope. */ protected List _inScope; protected InScopeOption _inScopeOption; @@ -774,7 +674,7 @@ // ========= // Not In Scope // ============ - /** Value of notInScope. */ + /** The value of notInScope. */ protected List _notInScope; /** @@ -852,6 +752,207 @@ //========================================================================== // ========= + // Like Search + // =========== + /** The value of likeSearch. */ + protected List _likeSearch; + + /** The value of likeSearch for spare. */ + protected List _likeSearch4Spare; + + /** + * Get the value of likeSearch. + * + * @return The value of likeSearch. (Nullable) + */ + public String getLikeSearch() { + if (_likeSearch == null) { + return null; + } + if (_likeSearch.isEmpty() && !_likeSearch4Spare.isEmpty()) { + for (int index = 0; index < _likeSearch4Spare.size(); index++) { + _likeSearch.add(_likeSearch4Spare.get(index)); + } + } + final LikeSearchValue likeSearchValue = _likeSearch.remove(0); + return (String) filterValue(likeSearchValue.generateRealValue()); + } + + /** + * Set the value of likeSearch. + * + * @param value The value of likeSearch. (Nullable) + * @param option The option of likeSearch. (Nullable) + * @return this. (NotNull) + */ + public ConditionValue setLikeSearch(String value, LikeSearchOption option) { + if (_likeSearch == null) { + _likeSearch = new ArrayList(); + _likeSearch4Spare = new ArrayList(); + } + if (_likeSearch.isEmpty() && !_likeSearch4Spare.isEmpty()) { + for (int index = 0; index < _likeSearch4Spare.size(); index++) { + _likeSearch.add(_likeSearch4Spare.get(index)); + } + } + LikeSearchValue likeSearchValue = new LikeSearchValue(value, option); + _likeSearch.add(likeSearchValue); + _likeSearch4Spare.add(likeSearchValue); + return this; + } + + /** Location of likeSearch. */ + protected String _likeSearchLocation; + + /** + * Get the location of likeSearch. + * + * @return The location of likeSearch. (Nullable) + */ + public String getLikeSearchLocation() { + return _likeSearchLocation; + } + + /** + * Set the location of likeSearch. + * + * @param location The location of likeSearch. (Nullable) + * @return this. (NotNull) + */ + public ConditionValue setLikeSearchLocation(String location) { + _likeSearchLocation = location; + return this; + } + + protected static class LikeSearchValue { + protected String _value; + + protected LikeSearchOption _option; + + public LikeSearchValue(String value, LikeSearchOption option) { + _value = value; + _option = option; + } + + public String getValue() { + return _value; + } + + public LikeSearchOption getOption() { + return _option; + } + + public String generateRealValue() { + if (_option == null) { + return _value; + } + return _option.generateRealValue(_value); + } + } + + //========================================================================== + // ========= + // Not Like Search + // =============== + /** The value of notLikeSearch. */ + protected List _notLikeSearch; + + /** The value of notLikeSearch for spare. */ + protected List _notLikeSearch4Spare; + + /** + * Get the value of notLikeSearch. + * + * @return The value of notLikeSearch. (Nullable) + */ + public String getNotLikeSearch() { + if (_notLikeSearch == null) { + return null; + } + if (_notLikeSearch.isEmpty() && !_notLikeSearch4Spare.isEmpty()) { + for (int index = 0; index < _notLikeSearch4Spare.size(); index++) { + _notLikeSearch.add(_notLikeSearch4Spare.get(index)); + } + } + final NotLikeSearchValue notLikeSearchValue = _notLikeSearch.remove(0); + return (String) filterValue(notLikeSearchValue.generateRealValue()); + } + + /** + * Set the value of notLikeSearch. + * + * @param value The value of notLikeSearch. (Nullable) + * @param option The option of notLikeSearch. (Nullable) + * @return this. (NotNull) + */ + public ConditionValue setNotLikeSearch(String value, LikeSearchOption option) { + if (_notLikeSearch == null) { + _notLikeSearch = new ArrayList(); + _notLikeSearch4Spare = new ArrayList(); + } + if (_notLikeSearch.isEmpty() && !_notLikeSearch4Spare.isEmpty()) { + for (int index = 0; index < _notLikeSearch4Spare.size(); index++) { + _notLikeSearch.add(_notLikeSearch4Spare.get(index)); + } + } + NotLikeSearchValue notLikeSearchValue = new NotLikeSearchValue(value, + option); + _notLikeSearch.add(notLikeSearchValue); + _notLikeSearch4Spare.add(notLikeSearchValue); + return this; + } + + /** Location of notLikeSearch. */ + protected String _notLikeSearchLocation; + + /** + * Get the location of notLikeSearch. + * + * @return The location of notLikeSearch. (Nullable) + */ + public String getNotLikeSearchLocation() { + return _notLikeSearchLocation; + } + + /** + * Set the location of notLikeSearch. + * + * @param location The location of notLikeSearch. (Nullable) + * @return this. (NotNull) + */ + public ConditionValue setNotLikeSearchLocation(String location) { + _notLikeSearchLocation = location; + return this; + } + + protected static class NotLikeSearchValue { + protected String _value; + + protected LikeSearchOption _option; + + public NotLikeSearchValue(String value, LikeSearchOption option) { + _value = value; + _option = option; + } + + public String getValue() { + return _value; + } + + public LikeSearchOption getOption() { + return _option; + } + + public String generateRealValue() { + if (_option == null) { + return _value; + } + return _option.generateRealValue(_value); + } + } + + //========================================================================== + // ========= // Is Null // ======= /** Value of isNull. */ @@ -976,8 +1077,8 @@ * Filter value. If the value is instance of java.util.Date or * java.util.Calendar, returns value as java.sql.Date. * - * @param value Value. (Nullable) - * @return Filtered value. (Nullable) + * @param value The value. (Nullable) + * @return The filtered value. (Nullable) */ protected Object filterValue(Object value) { if (value == null) { @@ -991,18 +1092,18 @@ } if (value instanceof java.util.Date || value instanceof java.util.Calendar) { - return SqlDateConversionUtil.toDate(value); + return SimpleTypeUtil.toSqlDate(value); } else { return value; } } /** - * Filter value. If the value is instance of java.util.Date or + * Filter the list of value. If the value is instance of java.util.Date or * java.util.Calendar, returns value as java.sql.Date. * - * @param valueList Value-list. (Nullable) - * @return Filtered value-list. (Nullable) + * @param valueList The list of value. (Nullable) + * @return The filtered list of value. (Nullable) */ protected List filterValue(List valueList) { if (valueList == null || valueList.isEmpty()) { @@ -1015,204 +1116,4 @@ } return resultList; } - - protected static class SqlDateConversionUtil { - - private SqlDateConversionUtil() { - } - - public static java.sql.Date toDate(Object o) { - return toDate(o, null); - } - - public static java.sql.Date toDate(Object o, String pattern) { - if (o instanceof java.sql.Date) { - return (java.sql.Date) o; - } - java.util.Date date = DateConversionUtil.toDate(o, pattern); - if (date != null) { - return new java.sql.Date(date.getTime()); - } - return null; - } - } - - protected static class DateConversionUtil { - - private DateConversionUtil() { - } - - public static java.util.Date toDate(Object o) { - return toDate(o, null); - } - - public static java.util.Date toDate(Object o, String pattern) { - if (o == null) { - return null; - } else if (o instanceof String) { - return toDate((String) o, pattern); - } else if (o instanceof java.util.Date) { - return (java.util.Date) o; - } else if (o instanceof java.util.Calendar) { - return ((java.util.Calendar) o).getTime(); - } else { - return toDate(o.toString(), pattern); - } - } - - public static java.util.Date toDate(String s, String pattern) { - return toDate(s, pattern, java.util.Locale.getDefault()); - } - - public static java.util.Date toDate(String s, String pattern, - java.util.Locale locale) { - java.text.SimpleDateFormat sdf = getDateFormat(s, pattern, locale); - try { - return sdf.parse(s); - } catch (java.text.ParseException ex) { - throw new RuntimeException(ex); - } - } - - public static java.text.SimpleDateFormat getDateFormat(String s, - String pattern, java.util.Locale locale) { - if (pattern != null) { - return new java.text.SimpleDateFormat(pattern); - } - return getDateFormat(s, locale); - } - - public static java.text.SimpleDateFormat getDateFormat(String s, - java.util.Locale locale) { - String pattern = getPattern(locale); - String shortPattern = removeDelimiter(pattern); - String delimitor = findDelimiter(s); - if (delimitor == null) { - if (s.length() == shortPattern.length()) { - return new java.text.SimpleDateFormat(shortPattern); - } - if (s.length() == shortPattern.length() + 2) { - return new java.text.SimpleDateFormat(InternalStringUtil - .replace(shortPattern, "yy", "yyyy")); - } - } else { - String[] array = InternalStringUtil.split(s, delimitor); - for (int i = 0; i < array.length; ++i) { - if (array[i].length() == 4) { - pattern = InternalStringUtil.replace(pattern, "yy", - "yyyy"); - break; - } - } - return new java.text.SimpleDateFormat(pattern); - } - return new java.text.SimpleDateFormat(); - } - - public static java.text.SimpleDateFormat getDateFormat( - java.util.Locale locale) { - return new java.text.SimpleDateFormat(getPattern(locale)); - } - - public static java.text.SimpleDateFormat getY4DateFormat( - java.util.Locale locale) { - return new java.text.SimpleDateFormat(getY4Pattern(locale)); - } - - public static String getY4Pattern(java.util.Locale locale) { - String pattern = getPattern(locale); - if (pattern.indexOf("yyyy") < 0) { - pattern = InternalStringUtil.replace(pattern, "yy", "yyyy"); - } - return pattern; - } - - public static String getPattern(java.util.Locale locale) { - java.text.SimpleDateFormat df = (java.text.SimpleDateFormat) java.text.DateFormat - .getDateInstance(java.text.DateFormat.SHORT, locale); - String pattern = df.toPattern(); - int index = pattern.indexOf(' '); - if (index > 0) { - pattern = pattern.substring(0, index); - } - if (pattern.indexOf("MM") < 0) { - pattern = InternalStringUtil.replace(pattern, "M", "MM"); - } - if (pattern.indexOf("dd") < 0) { - pattern = InternalStringUtil.replace(pattern, "d", "dd"); - } - return pattern; - } - - public static String findDelimiter(String value) { - for (int i = 0; i < value.length(); ++i) { - char c = value.charAt(i); - if (Character.isDigit(c)) { - continue; - } - return Character.toString(c); - } - return null; - } - - public static String removeDelimiter(String pattern) { - StringBuffer buf = new StringBuffer(); - for (int i = 0; i < pattern.length(); ++i) { - char c = pattern.charAt(i); - if (c == 'y' || c == 'M' || c == 'd') { - buf.append(c); - } - } - return buf.toString(); - } - } - - protected static class InternalStringUtil { - public static final String[] EMPTY_STRINGS = new String[0]; - - private InternalStringUtil() { - } - - public static final boolean isEmpty(String text) { - return text == null || text.length() == 0; - } - - public static final String replace(String text, String fromText, - String toText) { - if (text == null || fromText == null || toText == null) { - return null; - } - StringBuffer buf = new StringBuffer(100); - int pos = 0; - int pos2 = 0; - while (true) { - pos = text.indexOf(fromText, pos2); - if (pos == 0) { - buf.append(toText); - pos2 = fromText.length(); - } else if (pos > 0) { - buf.append(text.substring(pos2, pos)); - buf.append(toText); - pos2 = pos + fromText.length(); - } else { - buf.append(text.substring(pos2)); - break; - } - } - return buf.toString(); - } - - public static String[] split(String str, String delim) { - if (str == null) { - return EMPTY_STRINGS; - } - List list = new java.util.ArrayList(); - java.util.StringTokenizer st = new java.util.StringTokenizer(str, - delim); - while (st.hasMoreElements()) { - list.add(st.nextToken()); - } - return (String[]) list.toArray(new String[list.size()]); - } - } } Modified: notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/cbean/outsidesql/OutsideSqlContext.java =================================================================== --- notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/cbean/outsidesql/OutsideSqlContext.java 2008-12-27 22:11:51 UTC (rev 1627) +++ notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/cbean/outsidesql/OutsideSqlContext.java 2008-12-27 22:13:37 UTC (rev 1628) @@ -1,17 +1,21 @@ package jp.sf.pal.notepad.db.allcommon.cbean.outsidesql; +import java.io.BufferedReader; +import java.io.IOException; +import java.io.InputStream; +import java.io.InputStreamReader; +import java.io.Reader; + import jp.sf.pal.notepad.db.allcommon.DBFluteConfig; import jp.sf.pal.notepad.db.allcommon.dbmeta.DBMeta; import jp.sf.pal.notepad.db.allcommon.dbmeta.DBMetaInstanceHandler; import jp.sf.pal.notepad.db.allcommon.jdbc.StatementConfig; +import jp.sf.pal.notepad.db.allcommon.util.SimpleResourceUtil; import jp.sf.pal.notepad.db.allcommon.util.SimpleStringUtil; import jp.sf.pal.notepad.db.allcommon.util.SimpleSystemUtil; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; -import org.seasar.framework.util.InputStreamReaderUtil; -import org.seasar.framework.util.ReaderUtil; -import org.seasar.framework.util.ResourceUtil; /** * The context of outside-SQL. @@ -33,7 +37,7 @@ /** * Get outside-SQL context on thread. * - * @return Outside-SQL context. (Nullable) + * @return The context of outside-SQL. (Nullable) */ public static OutsideSqlContext getOutsideSqlContextOnThread() { return (OutsideSqlContext) _threadLocal.get(); @@ -42,7 +46,7 @@ /** * Set outside-SQL context on thread. * - * @param outsideSqlContext Outside-SQL context. (NotNull) + * @param outsideSqlContext The context of outside-SQL. (NotNull) */ public static void setOutsideSqlContextOnThread( OutsideSqlContext outsideSqlContext) { @@ -54,7 +58,7 @@ } /** - * Is existing outside-SQL context on thread? + * Is existing the context of outside-SQL on thread? * * @return Determination. */ @@ -63,7 +67,7 @@ } /** - * Clear outside-SQL context on thread. + * Clear the context of outside-SQL on thread. */ public static void clearOutsideSqlContextOnThread() { _threadLocal.set(null); @@ -77,12 +81,20 @@ String methodName, String path, Object pmb, OutsideSqlOption option, Object resultTypeSpecification) { final String pmbKey = (pmb != null ? pmb.getClass().getName() : "null"); - final String resultKey = (resultTypeSpecification != null ? ":" - + resultTypeSpecification : "null"); + final String resultKey; + if (resultTypeSpecification != null) { + if (resultTypeSpecification instanceof Class) { + resultKey = ((Class) resultTypeSpecification).getName(); + } else { + resultKey = resultTypeSpecification.toString(); + } + } else { + resultKey = "null"; + } final String tableDbName = option.getTableDbName(); final String generatedUniqueKey = option.generateUniqueKey(); - return methodName + "():" + tableDbName + ":" + path + ":" + pmbKey - + ":" + generatedUniqueKey + resultKey; + return tableDbName + ":" + methodName + "():" + path + ":" + pmbKey + + ":" + generatedUniqueKey + ":" + resultKey; } //========================================================================== @@ -116,18 +128,9 @@ // Attribute // ========= // ----------------------------------------------------- - // Common of OutsideSql - // -------------------- - protected boolean _dynamicBinding; - - protected boolean _offsetByCursorForcedly; - - protected boolean _limitByCursorForcedly; - - // ----------------------------------------------------- - // Specified OutsideSql - // -------------------- - /** The path of outside-sql. (The mark of Specified-OutsideSql) */ + // Basic + // ----- + /** The path of outside-SQL. (The mark of specified outside-SQL) */ protected String _outsideSqlPath; protected Object _parameterBean; @@ -136,12 +139,23 @@ protected String _methodName; - /** The config of statement. (Nullable) */ + /** The configuration of statement. (Nullable) */ protected StatementConfig _statementConfig; /** The DB name of table for using behavior-SQL-path. (Nullable) */ protected String _tableDbName; + // ----------------------------------------------------- + // Option + // ------ + protected boolean _dynamicBinding; + + protected boolean _offsetByCursorForcedly; + + protected boolean _limitByCursorForcedly; + + protected boolean _autoPagingLogging; // for logging + //========================================================================== // ========= // Read SQL @@ -200,7 +214,7 @@ } /** - * Read outside-sql path. Required attribute is 'outsideSqlPath'. + * Read outside-SQL path. Required attribute is 'outsideSqlPath'. * * @param sqlFileEncoding The encoding of SQL file. (NotNull) * @param dbmsSuffix The suffix of DBMS. (NotNull) @@ -214,6 +228,13 @@ String sql; if (isExistResource(dbmsPath)) { sql = readText(dbmsPath, sqlFileEncoding); + } else if ("_postgresql".equals(dbmsSuffix) + && isExistResource("_postgre")) { + sql = readText("_postgre", sqlFileEncoding); // Patch for name + // difference + } else if ("_sqlserver".equals(dbmsSuffix) && isExistResource("_mssql")) { + sql = readText("_mssql", sqlFileEncoding); // Patch for name + // difference } else if (isExistResource(standardPath)) { sql = readText(standardPath, sqlFileEncoding); } else { @@ -324,16 +345,46 @@ // General Helper // ============== protected boolean isExistResource(String path) { - return ResourceUtil.isExist(path); + return SimpleResourceUtil.isExist(path); } protected String readText(final String path, String sqlFileEncoding) { - final java.io.InputStream is = ResourceUtil.getResourceAsStream(path); - final java.io.Reader reader = InputStreamReaderUtil.create(is, - sqlFileEncoding); - return ReaderUtil.readText(reader); + final InputStream ins = SimpleResourceUtil.getResourceStream(path); + final Reader reader = createInputStreamReader(ins, sqlFileEncoding); + return readText(reader); } + protected Reader createInputStreamReader(InputStream ins, String encoding) { + try { + return new InputStreamReader(ins, encoding); + } catch (IOException e) { + String msg = "Failed to create the reader of the input stream:"; + msg = msg + " ins=" + ins + " encoding=" + encoding; + throw new IllegalStateException(msg, e); + } + } + + public String readText(Reader reader) { + final BufferedReader bfreader = new BufferedReader(reader); + final StringBuilder out = new StringBuilder(100); + try { + try { + final char[] buf = new char[8192]; + int n; + while ((n = bfreader.read(buf)) >= 0) { + out.append(buf, 0, n); + } + } finally { + bfreader.close(); + } + } catch (IOException e) { + String msg = "Failed to read the input stream:"; + msg = msg + " bfreader=" + bfreader + " reader=" + reader; + throw new IllegalStateException(msg, e); + } + return out.toString(); + } + protected static String replaceString(String text, String fromText, String toText) { return SimpleStringUtil.replace(text, fromText, toText); @@ -348,35 +399,8 @@ // Accessor // ======== // ----------------------------------------------------- - // Common of OutsideSql - // -------------------- - public boolean isDynamicBinding() { - return _dynamicBinding; - } - - public void setDynamicBinding(boolean dynamicBinding) { - this._dynamicBinding = dynamicBinding; - } - - public boolean isOffsetByCursorForcedly() { - return _offsetByCursorForcedly; - } - - public void setOffsetByCursorForcedly(boolean offsetByCursorForcedly) { - this._offsetByCursorForcedly = offsetByCursorForcedly; - } - - public boolean isLimitByCursorForcedly() { - return _limitByCursorForcedly; - } - - public void setLimitByCursorForcedly(boolean limitByCursorForcedly) { - this._limitByCursorForcedly = limitByCursorForcedly; - } - - // ----------------------------------------------------- - // Specified OutsideSql - // -------------------- + // Basic + // ----- public String getOutsideSqlPath() { return _outsideSqlPath; } @@ -424,4 +448,39 @@ public void setTableDbName(String tableDbName) { this._tableDbName = tableDbName; } + + // ----------------------------------------------------- + // Option + // ------ + public boolean isDynamicBinding() { + return _dynamicBinding; + } + + public void setDynamicBinding(boolean dynamicBinding) { + this._dynamicBinding = dynamicBinding; + } + + public boolean isOffsetByCursorForcedly() { + return _offsetByCursorForcedly; + } + + public void setOffsetByCursorForcedly(boolean offsetByCursorForcedly) { + this._offsetByCursorForcedly = offsetByCursorForcedly; + } + + public boolean isLimitByCursorForcedly() { + return _limitByCursorForcedly; + } + + public void setLimitByCursorForcedly(boolean limitByCursorForcedly) { + this._limitByCursorForcedly = limitByCursorForcedly; + } + + public boolean isAutoPagingLogging() { // for logging + return _autoPagingLogging; + } + + public void setAutoPagingLogging(boolean autoPagingLogging) { // for logging + this._autoPagingLogging = autoPagingLogging; + } } Modified: notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/cbean/outsidesql/OutsideSqlOption.java =================================================================== --- notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/cbean/outsidesql/OutsideSqlOption.java 2008-12-27 22:11:51 UTC (rev 1627) +++ notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/cbean/outsidesql/OutsideSqlOption.java 2008-12-27 22:13:37 UTC (rev 1628) @@ -16,6 +16,7 @@ // ----------------------------------------------------- // Option // ------ + /** The request type of paging. */ protected String _pagingRequestType = "non"; protected boolean _dynamicBinding; @@ -23,6 +24,8 @@ /** The configuration of statement. (Nullable) */ protected StatementConfig _statementConfig; + protected String _sourcePagingRequestType = "non"; + // ----------------------------------------------------- // Information // ----------- @@ -59,6 +62,7 @@ // ==== public OutsideSqlOption copyOptionWithoutPaging() { final OutsideSqlOption copyOption = new OutsideSqlOption(); + copyOption.setPagingSourceRequestType(_pagingRequestType); if (isDynamicBinding()) { copyOption.dynamicBinding(); } @@ -103,6 +107,15 @@ _statementConfig = statementConfig; } + protected void setPagingSourceRequestType(String sourcePagingRequestType) { // Very + // Internal + _sourcePagingRequestType = sourcePagingRequestType; + } + + public boolean isSourcePagingRequestTypeAuto() { // Very Internal + return "auto".equals(_sourcePagingRequestType); + } + // ----------------------------------------------------- // Information // ----------- Modified: notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/cbean/outsidesql/executor/OutsideSqlBasicExecutor.java =================================================================== --- notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/cbean/outsidesql/executor/OutsideSqlBasicExecutor.java 2008-12-27 22:11:51 UTC (rev 1627) +++ notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/cbean/outsidesql/executor/OutsideSqlBasicExecutor.java 2008-12-27 22:13:37 UTC (rev 1628) @@ -2,15 +2,20 @@ import java.util.List; +import jp.sf.pal.notepad.db.allcommon.bhv.core.BehaviorCommand; +import jp.sf.pal.notepad.db.allcommon.bhv.core.BehaviorCommandInvoker; +import jp.sf.pal.notepad.db.allcommon.bhv.core.command.AbstractOutsideSqlCommand; +import jp.sf.pal.notepad.db.allcommon.bhv.core.command.OutsideSqlCallCommand; +import jp.sf.pal.notepad.db.allcommon.bhv.core.command.OutsideSqlExecuteCommand; +import jp.sf.pal.notepad.db.allcommon.bhv.core.command.OutsideSqlSelectListCommand; import jp.sf.pal.notepad.db.allcommon.cbean.ListResultBean; import jp.sf.pal.notepad.db.allcommon.cbean.ResultBeanBuilder; -import jp.sf.pal.notepad.db.allcommon.cbean.outsidesql.OutsideSqlDao; import jp.sf.pal.notepad.db.allcommon.cbean.outsidesql.OutsideSqlOption; import jp.sf.pal.notepad.db.allcommon.cbean.outsidesql.ProcedurePmb; import jp.sf.pal.notepad.db.allcommon.jdbc.StatementConfig; /** - * The executor of outside-sql.
+ * The executor of outside-SQL.
* *
  * {Basic}
@@ -33,7 +38,6 @@
  * 
  * {Option -- Dynamic}
  *   o dynamicBinding().selectList()
- * 
  * 
* * @author DBFlute(AutoGenerator) @@ -44,8 +48,8 @@ // ========= // Attribute // ========= - /** The DAO of outside-sql. (NotNull) */ - protected final OutsideSqlDao _outsideSqlDao; + /** The invoker of behavior command. (NotNull) */ + protected final BehaviorCommandInvoker _behaviorCommandInvoker; /** Table DB name. (NotNull) */ protected final String _tableDbName; @@ -60,9 +64,9 @@ // ========= // Constructor // =========== - public OutsideSqlBasicExecutor(OutsideSqlDao outsideSqlDao, - String tableDbName) { - this._outsideSqlDao = outsideSqlDao; + public OutsideSqlBasicExecutor( + BehaviorCommandInvoker behaviorCommandInvoker, String tableDbName) { + this._behaviorCommandInvoker = behaviorCommandInvoker; this._tableDbName = tableDbName; } @@ -80,12 +84,12 @@ * @param entityType The element type of entity. (NotNull) * @return The result bean of selected list. (NotNull) * @exception jp.sf.pal.notepad.db.allcommon.exception.OutsideSqlNotFoundException - * When the outside-sql is not found. + * When the outside-SQL is not found. */ public ListResultBean selectList(String path, Object pmb, Class entityType) { - List resultList = _outsideSqlDao.selectList(path, pmb, - createOutsideSqlOption(), entityType); + List resultList = invoke(createSelectListCommand(path, pmb, + entityType)); return new ResultBeanBuilder(_tableDbName) .buildListResultBean(resultList); } @@ -102,10 +106,10 @@ * object. (Nullable) * @return The count of execution. * @exception jp.sf.pal.notepad.db.allcommon.exception.OutsideSqlNotFoundException - * When the outside-sql is not found. + * When the outside-SQL is not found. */ public int execute(String path, Object pmb) { - return _outsideSqlDao.execute(path, pmb, createOutsideSqlOption()); + return invoke(createExecuteCommand(path, pmb)); } // [DBFlute-0.7.5] @@ -123,12 +127,53 @@ throw new IllegalArgumentException( "The argument of call() 'pmb' should not be null!"); } - _outsideSqlDao.call(pmb.getProcedureName(), pmb, - createOutsideSqlOption()); + invoke(createCallCommand(pmb.getProcedureName(), pmb)); } //========================================================================== // ========= + // Behavior Command + // ================ + protected BehaviorCommand> createSelectListCommand( + String path, Object pmb, Class entityType) { + final OutsideSqlSelectListCommand cmd = xsetupCommand( + new OutsideSqlSelectListCommand(), path, pmb); + cmd.setEntityType(entityType); + return cmd; + } + + protected BehaviorCommand createExecuteCommand(String path, + Object pmb) { + return xsetupCommand(new OutsideSqlExecuteCommand(), path, pmb); + } + + protected BehaviorCommand createCallCommand(String path, Object pmb) { + return xsetupCommand(new OutsideSqlCallCommand(), path, pmb); + } + + private > COMMAND xsetupCommand( + COMMAND command, String path, Object pmb) { + command.setTableDbName(_tableDbName); + _behaviorCommandInvoker.injectComponentProperty(command); + command.setOutsideSqlPath(path); + command.setParameterBean(pmb); + command.setOutsideSqlOption(createOutsideSqlOption()); + return command; + } + + /** + * Invoke the command of behavior. + * + * @param The type of result. + * @param behaviorCommand The command of behavior. (NotNull) + * @return The instance of result. (Nullable) + */ + protected RESULT invoke(BehaviorCommand behaviorCommand) { + return _behaviorCommandInvoker.invoke(behaviorCommand); + } + + //========================================================================== + // ========= // Option // ====== // ----------------------------------------------------- @@ -144,11 +189,11 @@ * # * * - * @return The cursor executor of outside-sql. (NotNull) + * @return The cursor executor of outside-SQL. (NotNull) */ public OutsideSqlCursorExecutor cursorHandling() { - return new OutsideSqlCursorExecutor(_outsideSqlDao, - createOutsideSqlOption()); + return new OutsideSqlCursorExecutor(_behaviorCommandInvoker, + createOutsideSqlOption(), _tableDbName); } /** @@ -161,11 +206,11 @@ * # * * - * @return The cursor executor of outside-sql. (NotNull) + * @return The cursor executor of outside-SQL. (NotNull) */ public OutsideSqlEntityExecutor entityHandling() { - return new OutsideSqlEntityExecutor(_outsideSqlDao, - createOutsideSqlOption()); + return new OutsideSqlEntityExecutor(_behaviorCommandInvoker, + createOutsideSqlOption(), _tableDbName); } // ----------------------------------------------------- @@ -191,7 +236,7 @@ public OutsideSqlPagingExecutor autoPaging() { final OutsideSqlOption option = createOutsideSqlOption(); option.autoPaging(); - return new OutsideSqlPagingExecutor(_outsideSqlDao, option, + return new OutsideSqlPagingExecutor(_behaviorCommandInvoker, option, _tableDbName); } @@ -215,7 +260,7 @@ public OutsideSqlPagingExecutor manualPaging() { final OutsideSqlOption option = createOutsideSqlOption(); option.manualPaging(); - return new OutsideSqlPagingExecutor(_outsideSqlDao, option, + return new OutsideSqlPagingExecutor(_behaviorCommandInvoker, option, _tableDbName); } Modified: notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/cbean/outsidesql/executor/OutsideSqlCursorExecutor.java =================================================================== --- notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/cbean/outsidesql/executor/OutsideSqlCursorExecutor.java 2008-12-27 22:11:51 UTC (rev 1627) +++ notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/cbean/outsidesql/executor/OutsideSqlCursorExecutor.java 2008-12-27 22:13:37 UTC (rev 1628) @@ -1,12 +1,14 @@ package jp.sf.pal.notepad.db.allcommon.cbean.outsidesql.executor; -import jp.sf.pal.notepad.db.allcommon.cbean.outsidesql.OutsideSqlDao; +import jp.sf.pal.notepad.db.allcommon.bhv.core.BehaviorCommand; +import jp.sf.pal.notepad.db.allcommon.bhv.core.BehaviorCommandInvoker; +import jp.sf.pal.notepad.db.allcommon.bhv.core.command.OutsideSqlSelectCursorCommand; import jp.sf.pal.notepad.db.allcommon.cbean.outsidesql.OutsideSqlOption; import jp.sf.pal.notepad.db.allcommon.jdbc.CursorHandler; import jp.sf.pal.notepad.db.allcommon.jdbc.StatementConfig; /** - * The cursor executor of outside-sql. + * The cursor executor of outside-SQL. * * @param The type of parameter-bean. * @author DBFlute(AutoGenerator) @@ -17,18 +19,25 @@ // ========= // Attribute // ========= - protected final OutsideSqlDao _outsideSqlDao; + /** The invoker of behavior command. (NotNull) */ + protected final BehaviorCommandInvoker _behaviorCommandInvoker; + /** The option of outside-SQL. (NotNull) */ protected final OutsideSqlOption _outsideSqlOption; + /** The DB name of table. (NotNull) */ + protected final String _tableDbName; + //========================================================================== // ========= // Constructor // =========== - public OutsideSqlCursorExecutor(OutsideSqlDao outsideSqlDao, - OutsideSqlOption outsideSqlOption) { - this._outsideSqlDao = outsideSqlDao; + public OutsideSqlCursorExecutor( + BehaviorCommandInvoker behaviorCommandInvoker, + OutsideSqlOption outsideSqlOption, String tableDbName) { + this._behaviorCommandInvoker = behaviorCommandInvoker; this._outsideSqlOption = outsideSqlOption; + this._tableDbName = tableDbName; } //========================================================================== @@ -44,14 +53,46 @@ * @param handler The handler of cursor. (NotNull) * @return The result object that the cursor handler returns. (Nullable) * @exception jp.sf.pal.notepad.db.allcommon.exception.OutsideSqlNotFoundException - * When the outside-sql is not found. + * When the outside-SQL is not found. */ public Object selectCursor(String path, PARAMETER_BEAN pmb, CursorHandler handler) { - return _outsideSqlDao.selectCursor(path, pmb, _outsideSqlOption, + return invoke(createSelectCursorCommand(path, pmb, handler)); + } + + //========================================================================== + // ========= + // Behavior Command + // ================ + protected BehaviorCommand createSelectCursorCommand(String path, + PARAMETER_BEAN pmb, CursorHandler handler) { + return xsetupCommand(new OutsideSqlSelectCursorCommand(), path, pmb, handler); } + private OutsideSqlSelectCursorCommand xsetupCommand( + OutsideSqlSelectCursorCommand command, String path, + PARAMETER_BEAN pmb, CursorHandler handler) { + command.setTableDbName(_tableDbName); + _behaviorCommandInvoker.injectComponentProperty(command); + command.setOutsideSqlPath(path); + command.setParameterBean(pmb); + command.setOutsideSqlOption(_outsideSqlOption); + command.setCursorHandler(handler); + return command; + } + + /** + * Invoke the command of behavior. + * + * @param The type of result. + * @param behaviorCommand The command of behavior. (NotNull) + * @return The instance of result. (Nullable) + */ + protected RESULT invoke(BehaviorCommand behaviorCommand) { + return _behaviorCommandInvoker.invoke(behaviorCommand); + } + //========================================================================== // ========= // Option Modified: notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/cbean/outsidesql/executor/OutsideSqlEntityExecutor.java =================================================================== --- notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/cbean/outsidesql/executor/OutsideSqlEntityExecutor.java 2008-12-27 22:11:51 UTC (rev 1627) +++ notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/cbean/outsidesql/executor/OutsideSqlEntityExecutor.java 2008-12-27 22:13:37 UTC (rev 1628) @@ -2,14 +2,16 @@ import java.util.List; +import jp.sf.pal.notepad.db.allcommon.bhv.core.BehaviorCommand; +import jp.sf.pal.notepad.db.allcommon.bhv.core.BehaviorCommandInvoker; +import jp.sf.pal.notepad.db.allcommon.bhv.core.command.OutsideSqlSelectListCommand; import jp.sf.pal.notepad.db.allcommon.cbean.ConditionBeanContext; -import jp.sf.pal.notepad.db.allcommon.cbean.outsidesql.OutsideSqlDao; import jp.sf.pal.notepad.db.allcommon.cbean.outsidesql.OutsideSqlOption; import jp.sf.pal.notepad.db.allcommon.jdbc.StatementConfig; import jp.sf.pal.notepad.db.allcommon.util.SimpleSystemUtil; /** - * The cursor executor of outside-sql. + * The cursor executor of outside-SQL. * * @param The type of parameter-bean. * @author DBFlute(AutoGenerator) @@ -20,18 +22,25 @@ // ========= // Attribute // ========= - protected final OutsideSqlDao _outsideSqlDao; + /** The invoker of behavior command. (NotNull) */ + protected final BehaviorCommandInvoker _behaviorCommandInvoker; + /** The option of outside-SQL. (NotNull) */ protected final OutsideSqlOption _outsideSqlOption; + /** The DB name of table. (NotNull) */ + protected final String _tableDbName; + //========================================================================== // ========= // Constructor // =========== - public OutsideSqlEntityExecutor(OutsideSqlDao outsideSqlDao, - OutsideSqlOption outsideSqlOption) { - this._outsideSqlDao = outsideSqlDao; + public OutsideSqlEntityExecutor( + BehaviorCommandInvoker behaviorCommandInvoker, + OutsideSqlOption outsideSqlOption, String tableDbName) { + this._behaviorCommandInvoker = behaviorCommandInvoker; this._outsideSqlOption = outsideSqlOption; + this._tableDbName = tableDbName; } //========================================================================== @@ -48,14 +57,14 @@ * @param entityType The type of entity. (NotNull) * @return The selected entity. (Nullable) * @exception jp.sf.pal.notepad.db.allcommon.exception.OutsideSqlNotFoundException - * When the outside-sql is not found. + * When the outside-SQL is not found. * @exception jp.sf.pal.notepad.db.allcommon.exception.EntityDuplicatedException * When the entity is duplicated. */ public ENTITY selectEntity(String path, PARAMETER_BEAN pmb, Class entityType) { - final List ls = _outsideSqlDao.selectList(path, pmb, - _outsideSqlOption, entityType); + final List ls = invoke(createSelectListCommand(path, pmb, + entityType)); if (ls.isEmpty()) { return null; } @@ -76,7 +85,7 @@ * @param entityType The type of entity. (NotNull) * @return The selected entity. (Nullable) * @exception jp.sf.pal.notepad.db.allcommon.exception.OutsideSqlNotFoundException - * When the outside-sql is not found. + * When the outside-SQL is not found. * @exception jp.sf.pal.notepad.db.allcommon.exception.EntityAlreadyDeletedException * When the entity has already been deleted(not found). * @exception jp.sf.pal.notepad.db.allcommon.exception.EntityDuplicatedException @@ -84,8 +93,8 @@ */ public ENTITY selectEntityWithDeletedCheck(String path, PARAMETER_BEAN pmb, Class entityType) { - final List ls = _outsideSqlDao.selectList(path, pmb, - _outsideSqlOption, entityType); + final List ls = invoke(createSelectListCommand(path, pmb, + entityType)); if (ls == null || ls.isEmpty()) { throwEntityAlreadyDeletedException(buildSearch4LogString(path, pmb, entityType)); @@ -127,6 +136,39 @@ //========================================================================== // ========= + // Behavior Command + // ================ + protected BehaviorCommand> createSelectListCommand( + String path, PARAMETER_BEAN pmb, Class entityType) { + return xsetupCommand(new OutsideSqlSelectListCommand(), path, + pmb, entityType); + } + + private OutsideSqlSelectListCommand xsetupCommand( + OutsideSqlSelectListCommand command, String path, + PARAMETER_BEAN pmb, Class entityType) { + command.setTableDbName(_tableDbName); + _behaviorCommandInvoker.injectComponentProperty(command); + command.setOutsideSqlPath(path); + command.setParameterBean(pmb); + command.setOutsideSqlOption(_outsideSqlOption); + command.setEntityType(entityType); + return command; + } + + /** + * Invoke the command of behavior. + * + * @param The type of result. + * @param behaviorCommand The command of behavior. (NotNull) + * @return The instance of result. (Nullable) + */ + protected RESULT invoke(BehaviorCommand behaviorCommand) { + return _behaviorCommandInvoker.invoke(behaviorCommand); + } + + //========================================================================== + // ========= // Option // ====== public OutsideSqlEntityExecutor configure( Modified: notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/cbean/outsidesql/executor/OutsideSqlPagingExecutor.java =================================================================== --- notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/cbean/outsidesql/executor/OutsideSqlPagingExecutor.java 2008-12-27 22:11:51 UTC (rev 1627) +++ notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/cbean/outsidesql/executor/OutsideSqlPagingExecutor.java 2008-12-27 22:13:37 UTC (rev 1628) @@ -3,18 +3,20 @@ import java.util.List; import jp.sf.pal.notepad.db.allcommon.DBFluteConfig; +import jp.sf.pal.notepad.db.allcommon.bhv.core.BehaviorCommand; +import jp.sf.pal.notepad.db.allcommon.bhv.core.BehaviorCommandInvoker; +import jp.sf.pal.notepad.db.allcommon.bhv.core.command.OutsideSqlSelectListCommand; import jp.sf.pal.notepad.db.allcommon.cbean.ListResultBean; import jp.sf.pal.notepad.db.allcommon.cbean.PagingBean; import jp.sf.pal.notepad.db.allcommon.cbean.PagingHandler; import jp.sf.pal.notepad.db.allcommon.cbean.PagingInvoker; import jp.sf.pal.notepad.db.allcommon.cbean.PagingResultBean; import jp.sf.pal.notepad.db.allcommon.cbean.ResultBeanBuilder; -import jp.sf.pal.notepad.db.allcommon.cbean.outsidesql.OutsideSqlDao; import jp.sf.pal.notepad.db.allcommon.cbean.outsidesql.OutsideSqlOption; import jp.sf.pal.notepad.db.allcommon.jdbc.StatementConfig; /** - * The paging executor of outsideSql. + * The paging executor of outside-SQL. * * @author DBFlute(AutoGenerator) */ @@ -24,10 +26,10 @@ // ========= // Attribute // ========= - /** The DAO of outsideSql. (NotNull) */ - protected final OutsideSqlDao _outsideSqlDao; + /** The invoker of behavior command. (NotNull) */ + protected final BehaviorCommandInvoker _behaviorCommandInvoker; - /** The option of outsideSql. (NotNull) */ + /** The option of outside-SQL. (NotNull) */ protected final OutsideSqlOption _outsideSqlOption; /** The DB name of table. (NotNull) */ @@ -37,9 +39,10 @@ // ========= // Constructor // =========== - public OutsideSqlPagingExecutor(OutsideSqlDao outsideSqlDao, + public OutsideSqlPagingExecutor( + BehaviorCommandInvoker behaviorCommandInvoker, OutsideSqlOption outsideSqlOption, String tableDbName) { - this._outsideSqlDao = outsideSqlDao; + this._behaviorCommandInvoker = behaviorCommandInvoker; this._outsideSqlOption = outsideSqlOption; this._tableDbName = tableDbName; } @@ -81,13 +84,13 @@ * @param entityType The type of result entity. (NotNull) * @return The result bean of paged list. (NotNull) * @exception com.example.dbflute.basic.dbflute.allcommon.exception.OutsideSqlNotFoundException - * When the outside-sql is not found. + * When the outside-SQL is not found. */ public ListResultBean selectList(String path, PagingBean pmb, Class entityType) { setupScrollableCursorIfNeeds(); - List resultList = _outsideSqlDao.selectList(path, pmb, - _outsideSqlOption, entityType); + List resultList = invoke(createSelectListCommand(path, pmb, + entityType)); return new ResultBeanBuilder(_tableDbName) .buildListResultBean(resultList); } @@ -141,7 +144,7 @@ * # -- ELSE select count(*) * # /[*]END[*]/ * # ... - * o It's S2Dao's restriction...Sorry + * o It's restriction...Sorry * * * @param The type of entity. @@ -150,14 +153,11 @@ * @param entityType The type of result entity. (NotNull) * @return The result bean of paging. (NotNull) * @exception jp.sf.pal.notepad.db.allcommon.exception.OutsideSqlNotFoundException - * When the outside-sql is not found. + * When the outside-SQL is not found. */ public PagingResultBean selectPage(final String path, final PagingBean pmb, final Class entityType) { - final OutsideSqlOption countOption = _outsideSqlOption - .copyOptionWithoutPaging(); - final OutsideSqlEntityExecutor countExecutor = new OutsideSqlEntityExecutor( - _outsideSqlDao, countOption); + final OutsideSqlEntityExecutor countExecutor = createCountExecutor(); final PagingHandler handler = new PagingHandler() { public PagingBean getPagingBean() { return pmb; @@ -182,6 +182,13 @@ return invoker.invokePaging(handler); } + protected OutsideSqlEntityExecutor createCountExecutor() { + final OutsideSqlOption countOption = _outsideSqlOption + .copyOptionWithoutPaging(); + return new OutsideSqlEntityExecutor( + _behaviorCommandInvoker, countOption, _tableDbName); + } + protected void setupScrollableCursorIfNeeds() { if (!_outsideSqlOption.isAutoPaging()) { return; @@ -207,6 +214,39 @@ //========================================================================== // ========= + // Behavior Command + // ================ + protected BehaviorCommand> createSelectListCommand( + String path, Object pmb, Class entityType) { + return xsetupCommand(new OutsideSqlSelectListCommand(), path, + pmb, entityType); + } + + private OutsideSqlSelectListCommand xsetupCommand( + OutsideSqlSelectListCommand command, String path, + Object pmb, Class entityType) { + command.setTableDbName(_tableDbName); + _behaviorCommandInvoker.injectComponentProperty(command); + command.setOutsideSqlPath(path); + command.setParameterBean(pmb); + command.setOutsideSqlOption(_outsideSqlOption); + command.setEntityType(entityType); + return command; + } + + /** + * Invoke the command of behavior. + * + * @param The type of result. + * @param behaviorCommand The command of behavior. (NotNull) + * @return The instance of result. (Nullable) + */ + protected RESULT invoke(BehaviorCommand behaviorCommand) { + return _behaviorCommandInvoker.invoke(behaviorCommand); + } + + //========================================================================== + // ========= // Option // ====== public OutsideSqlPagingExecutor configure(StatementConfig statementConfig) { Modified: notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/cbean/sqlclause/AbstractSqlClause.java =================================================================== --- notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/cbean/sqlclause/AbstractSqlClause.java 2008-12-27 22:11:51 UTC (rev 1627) +++ notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/cbean/sqlclause/AbstractSqlClause.java 2008-12-27 22:13:37 UTC (rev 1628) @@ -17,23 +17,23 @@ import jp.sf.pal.notepad.db.allcommon.dbmeta.DBMetaInstanceHandler; import jp.sf.pal.notepad.db.allcommon.dbmeta.info.ColumnInfo; import jp.sf.pal.notepad.db.allcommon.dbmeta.info.ForeignInfo; -import jp.sf.pal.notepad.db.allcommon.dbmeta.info.UniqueInfo; import jp.sf.pal.notepad.db.allcommon.util.SimpleAssertUtil; import jp.sf.pal.notepad.db.allcommon.util.SimpleStringUtil; import jp.sf.pal.notepad.db.allcommon.util.SimpleSystemUtil; /** - * The abstract class of SqlClause. + * The abstract class of SQL clause. * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public abstract class AbstractSqlClause implements SqlClause { //========================================================================== // ========= // Definition // ========== + protected static final SelectClauseType DEFAULT_SELECT_CLAUSE_TYPE = SelectClauseType.COLUMNS; + protected static final String SELECT_HINT = "/*$dto.selectHint*/"; //========================================================================== @@ -43,12 +43,16 @@ // ----------------------------------------------------- // Basic // ----- - /** Target table name. */ + /** The name of table. */ protected final String _tableName; // ----------------------------------------------------- // Clause Resource // --------------- + // /- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + // - + // The resources that are not often used to are lazy-loaded for performance. + // - - - - - - - - - -/ /** * Selected select column map. map:{tableAliasName : map:{columnName : * selectColumnInfo}} @@ -57,48 +61,48 @@ /** * Specified select column map. map:{ tableAliasName = map:{ columnName : - * null } } + * null } } (Nullable: This is lazy-loaded) */ - protected Map> _specifiedSelectColumnMap;// [ + protected Map> _specifiedSelectColumnMap; // [ // DBFlute // - - // 0.7.4 - // ] + // 0.7 + // .4] - /** Specified derive sub-query map. */ - protected Map _specifiedDeriveSubQueryMap;// [DBFlute-0.7.4] + /** Specified derive sub-query map. (Nullable: This is lazy-loaded) */ + protected Map _specifiedDeriveSubQueryMap; //[DBFlute-0.7.4] - /** Included select column map. */ - protected Map _includedSelectColumnMap = new LinkedHashMap(); - /** * The map of real column and alias of select clause. map:{realColumnName : * aliasName} */ - protected Map _selectClauseRealColumnAliasMap = new HashMap();// Without + protected Map _selectClauseRealColumnAliasMap = new HashMap(); // Without // linked // ! + /** The type of select clause. (NotNull) */ + protected SelectClauseType _selectClauseType = DEFAULT_SELECT_CLAUSE_TYPE; + + /** The previous type of select clause. (Nullable: The default is null) */ + protected SelectClauseType _previousSelectClauseType; + /** Outer join map. */ protected Map _outerJoinMap = new LinkedHashMap(); - /** Where list. */ + /** The list of where clause. */ protected List _whereList = new ArrayList(); /** Inline where list for BaseTable. */ protected List _baseTableInlineWhereList = new ArrayList(); - /** Order-by clause. */ + /** The clause of order-by. (NotNull) */ protected final OrderByClause _orderByClause = new OrderByClause(); - /** Union clause list. */ - protected List _unionQueryInfoList = new ArrayList(); + /** The list of union clause. (Nullable: This is lazy-loaded) */ + protected List _unionQueryInfoList; - /** Is included-select-column effective? Default value is false. */ - protected boolean _isIncludedSelectColumnEffective = false; - /** Is order-by effective? Default value is false. */ protected boolean _isOrderByEffective = false; @@ -138,7 +142,7 @@ // ----------------------------------------------------- // Optional Info // ------------- - protected boolean _formatClause; + protected boolean _formatClause = true; //========================================================================== // ========= @@ -163,28 +167,20 @@ StringBuilder sb = new StringBuilder(512); sb.append(getSelectClause()); sb.append(" "); - sb.append(buildClauseWithoutMainSelect(false)); + sb.append(buildClauseWithoutMainSelect()); String sql = sb.toString(); - return filterSubQueryIndent(sql); + sql = filterUnionCountOrScalar(sql); + sql = filterSubQueryIndent(sql); + return sql; } - public String getClausePKOnly() { + protected String buildClauseWithoutMainSelect() { StringBuilder sb = new StringBuilder(512); - sb.append(getSelectClausePKOnly()); - sb.append(" "); - sb.append(buildClauseWithoutMainSelect(true)); - String sql = sb.toString(); - return filterSubQueryIndent(sql); - } - - protected String buildClauseWithoutMainSelect(boolean pkonly) { - StringBuilder sb = new StringBuilder(512); sb.append(getFromClause()); sb.append(getFromHint()); sb.append(" "); sb.append(getWhereClause()); - String unionClause = buildUnionClause(pkonly ? getSelectClausePKOnly() - : getSelectClause()); + String unionClause = buildUnionClause(getSelectClause()); // Delete template mark! (At the future this will be unnecessary.) unionClause = replaceString(unionClause, getUnionWhereClauseMark(), "");// Required @@ -225,29 +221,45 @@ protected String buildUnionClause(String selectClause) { StringBuilder sb = new StringBuilder(); - for (final Iterator ite = _unionQueryInfoList - .iterator(); ite.hasNext();) { - final UnionQueryInfo unionQueryInfo = (UnionQueryInfo) ite.next(); - final String unionQueryClause = unionQueryInfo - .getUnionQueryClause(); - final boolean unionAll = unionQueryInfo.isUnionAll(); - if (isFormatClauseEffective()) { + if (hasUnionQuery()) { + for (Iterator ite = _unionQueryInfoList.iterator(); ite + .hasNext();) { + UnionQueryInfo unionQueryInfo = (UnionQueryInfo) ite.next(); + String unionQueryClause = unionQueryInfo.getUnionQueryClause(); + boolean unionAll = unionQueryInfo.isUnionAll(); sb.append(getLineSeparator()); - } - sb.append(unionAll ? " union all " : " union "); - if (isFormatClauseEffective()) { + sb.append(unionAll ? " union all " : " union "); sb.append(getLineSeparator()); + sb.append(selectClause).append(" ").append(unionQueryClause); } - sb.append(selectClause).append(" ").append(unionQueryClause); } return sb.toString(); } + protected String filterUnionCountOrScalar(String sql) { + if (!isSelectClauseTypeCountOrScalar() || !hasUnionQuery()) { + return sql; + } + String selectClause = buildSelectClauseCountOrScalar("dfmain"); + String ln = getLineSeparator(); + String beginMark = resolveSubQueryBeginMark("dfmain") + ln; + String endMark = resolveSubQueryEndMark("dfmain"); + return selectClause + ln + " from (" + beginMark + sql + ln + + " ) dfmain" + endMark; + } + //========================================================================== // ========= // Clause Parts // ============ public String getSelectClause() { + // [DBFlute-0.8.6] + if (isSelectClauseTypeCountOrScalar() && !hasUnionQuery()) { + return buildSelectClauseCountOrScalar("dflocal"); + } + // /- - - - - - - - - - - - - - - - - - - - - - - - + // The type of select clause is COLUMNS since here. + // - - - - - - - - - -/ StringBuilder sb = new StringBuilder(); DBMeta dbmeta = DBMetaInstanceHandler.findDBMeta(_tableName); List columnInfoList = dbmeta.getColumnInfoList(); @@ -265,7 +277,19 @@ // [DBFlute-0.7.4] if (existsSpecifiedLocal && !localSpecifiedMap.containsKey(columnName)) { - continue; + if (isSelectClauseTypeCountOrScalar() && hasUnionQuery()) { + // Here it must be with union query. + // So the primary Key is target for saving unique. + // But if it does not have primary keys, all column is + // target. + if (dbmeta.hasPrimaryKey()) { + if (!columnInfo.isPrimary()) { + continue; + } + } + } else { + continue; + } } if (sb.length() > 0) { @@ -307,10 +331,6 @@ selectColumnInfo.getColumnAliasName()); } } - if (_isIncludedSelectColumnEffective - && !_includedSelectColumnMap.isEmpty()) { - sb.append(getIncludedSelectColumnClause()); - } // [DBFlute-0.7.4] if (_specifiedDeriveSubQueryMap != null @@ -318,9 +338,7 @@ Collection deriveSubQuerySet = _specifiedDeriveSubQueryMap .values(); for (String deriveSubQuery : deriveSubQuerySet) { - if (isFormatClauseEffective()) { - sb.append(getLineSeparator()).append(" "); - } + sb.append(getLineSeparator()).append(" "); sb.append(", ").append(deriveSubQuery); } } @@ -328,67 +346,83 @@ return sb.toString(); } - public String getSelectClausePKOnly() { - StringBuilder sb = new StringBuilder(); - DBMeta dbmeta = DBMetaInstanceHandler.findDBMeta(_tableName); - UniqueInfo uniqueInfo = dbmeta.getPrimaryUniqueInfo(); - List columnInfoList = uniqueInfo.getUniqueColumnList(); - for (ColumnInfo columnInfo : columnInfoList) { - String columnName = columnInfo.getColumnDbName(); - if (sb.length() > 0) { - sb.append(", "); - } else { - sb.append("select").append(SELECT_HINT).append(" "); - } - String realColumnName = getLocalTableAliasName() + "." + columnName; - sb.append(realColumnName).append(" as ").append(columnName); - _selectClauseRealColumnAliasMap.put(realColumnName, columnName); + protected boolean isSelectClauseTypeCountOrScalar() { + if (_selectClauseType.equals(SelectClauseType.COUNT)) { + return true; + } else if (_selectClauseType.equals(SelectClauseType.MAX)) { + return true; + } else if (_selectClauseType.equals(SelectClauseType.MIN)) { + return true; + } else if (_selectClauseType.equals(SelectClauseType.SUM)) { + return true; + } else if (_selectClauseType.equals(SelectClauseType.AVG)) { + return true; } - if (_isIncludedSelectColumnEffective - && !_includedSelectColumnMap.isEmpty()) { - sb.append(getIncludedSelectColumnClause()); - } + return false; + } - // [DBFlute-0.7.4] - if (_specifiedDeriveSubQueryMap != null - && !_specifiedDeriveSubQueryMap.isEmpty()) { - Collection deriveSubQuerySet = _specifiedDeriveSubQueryMap - .values(); - for (String deriveSubQuery : deriveSubQuerySet) { - if (isFormatClauseEffective()) { - sb.append(getLineSeparator()).append(" "); - } - sb.append(", ").append(deriveSubQuery); - } + protected String buildSelectClauseCountOrScalar(String aliasName) { + if (_selectClauseType.equals(SelectClauseType.COUNT)) { + return buildSelectClauseCount(); + } else if (_selectClauseType.equals(SelectClauseType.MAX)) { + return buildSelectClauseMax(aliasName); + } else if (_selectClauseType.equals(SelectClauseType.MIN)) { + return buildSelectClauseMin(aliasName); + } else if (_selectClauseType.equals(SelectClauseType.SUM)) { + return buildSelectClauseSum(aliasName); + } else if (_selectClauseType.equals(SelectClauseType.AVG)) { + return buildSelectClauseAvg(aliasName); } + String msg = "The type of select clause is not for scalar:"; + msg = msg + " type=" + _selectClauseType; + throw new IllegalStateException(msg); + } - return sb.toString(); + protected String buildSelectClauseCount() { + return "select count(*)"; } - public String getSelectHint() { - return createSelectHint(); + protected String buildSelectClauseMax(String aliasName) { + String columnName = getSpecifiedColumnNameAsOne(); + assertScalarSelectSpecifiedColumnOnlyOne(columnName); + return "select max(" + aliasName + "." + columnName + ")"; } - public String getIncludedSelectColumnClause() { - StringBuilder sb = new StringBuilder(); - int count = 0; - for (Iterator ite = _includedSelectColumnMap.keySet() - .iterator(); ite.hasNext(); count++) { - String aliasName = ite.next(); - String realColumnName = (String) _includedSelectColumnMap - .get(aliasName); - sb.append(", ").append(realColumnName).append(" as ").append( - aliasName); - _selectClauseRealColumnAliasMap.put(realColumnName, aliasName); + protected String buildSelectClauseMin(String aliasName) { + String columnName = getSpecifiedColumnNameAsOne(); + assertScalarSelectSpecifiedColumnOnlyOne(columnName); + return "select min(" + aliasName + "." + columnName + ")"; + } + + protected String buildSelectClauseSum(String aliasName) { + String columnName = getSpecifiedColumnNameAsOne(); + assertScalarSelectSpecifiedColumnOnlyOne(columnName); + return "select sum(" + aliasName + "." + columnName + ")"; + } + + protected String buildSelectClauseAvg(String aliasName) { + String columnName = getSpecifiedColumnNameAsOne(); + assertScalarSelectSpecifiedColumnOnlyOne(columnName); + return "select avg(" + aliasName + "." + columnName + ")"; + } + + protected void assertScalarSelectSpecifiedColumnOnlyOne(String columnName) { + if (columnName != null) { + return; } - return sb.toString(); + String msg = "The specified column exists one"; + msg = msg + " when the type of select clause is for scalar:"; + msg = msg + " specifiedSelectColumnMap=" + _specifiedSelectColumnMap; + throw new IllegalStateException(msg); } + public String getSelectHint() { + return createSelectHint(); + } + public String getFromClause() { StringBuilder sb = new StringBuilder(); - if (isFormatClauseEffective()) { - sb.append(getLineSeparator()).append(" "); - } + sb.append(getLineSeparator()).append(" "); sb.append("from "); if (_baseTableInlineWhereList.isEmpty()) { sb.append(_tableName).append(" dflocal"); @@ -417,9 +451,7 @@ Map joinOnMap = joinInfo.getJoinOnMap(); assertJoinOnMapNotEmpty(joinOnMap, aliasName); - if (isFormatClauseEffective()) { - sb.append(getLineSeparator()).append(" "); - } + sb.append(getLineSeparator()).append(" "); sb.append(" left outer join "); if (inlineWhereClauseList.isEmpty()) { sb.append(joinTableName); @@ -489,16 +521,12 @@ String clauseElement = (String) ite.next(); clauseElement = filterWhereClauseSimply(clauseElement); if (count == 0) { - if (isFormatClauseEffective()) { - sb.append(getLineSeparator()).append(" "); - } + sb.append(getLineSeparator()).append(" "); sb.append("where ").append( template ? getWhereFirstConditionMark() : "").append( clauseElement); } else { - if (isFormatClauseEffective()) { - sb.append(getLineSeparator()).append(" "); - } + sb.append(getLineSeparator()).append(" "); sb.append(" and ").append(clauseElement); } } @@ -510,7 +538,7 @@ public String getOrderByClause() { String orderByClause = null; - if (!_unionQueryInfoList.isEmpty()) { + if (hasUnionQuery()) { if (_selectClauseRealColumnAliasMap == null || _selectClauseRealColumnAliasMap.isEmpty()) { String msg = "The selectClauseColumnAliasMap should not be null or empty when union query exists: " @@ -522,8 +550,7 @@ } else { orderByClause = _orderByClause.getOrderByClause(); } - if (isFormatClauseEffective() && orderByClause != null - && orderByClause.trim().length() > 0) { + if (orderByClause != null && orderByClause.trim().length() > 0) { return getLineSeparator() + " " + orderByClause; } else { return orderByClause; @@ -532,8 +559,7 @@ public String getSqlSuffix() { String sqlSuffix = createSqlSuffix(); - if (isFormatClauseEffective() && sqlSuffix != null - && sqlSuffix.trim().length() > 0) { + if (sqlSuffix != null && sqlSuffix.trim().length() > 0) { return getLineSeparator() + sqlSuffix; } else { return sqlSuffix; @@ -542,20 +568,6 @@ //========================================================================== // ========= - // Copy Parts - // ========== - public void copyIncludedSelectColumn(SqlClause sqlClause) { - Set keySet = _includedSelectColumnMap.keySet(); - for (Iterator ite = keySet.iterator(); ite.hasNext();) { - String aliasName = ite.next(); - String realColumnName = (String) _includedSelectColumnMap - .get(aliasName); - sqlClause.registerIncludedSelectColumn(aliasName, realColumnName); - } - } - - //========================================================================== - // ========= // SelectedSelectColumn // ==================== /** @@ -644,26 +656,6 @@ //========================================================================== // ========= - // IncludedSelectColumn - // ==================== - public void ignoreIncludedSelectColumn() { - _isIncludedSelectColumnEffective = false; - } - - public void makeIncludedSelectColumnEffective() { - if (!_includedSelectColumnMap.isEmpty()) { - _isIncludedSelectColumnEffective = true; - } - } - - public void registerIncludedSelectColumn(String aliasName, - String realColumnName) { - _isIncludedSelectColumnEffective = true; - _includedSelectColumnMap.put(aliasName, realColumnName); - } - - //========================================================================== - // ========= // OuterJoin // ========= public void registerOuterJoin(String joinTableName, String aliasName, @@ -1079,12 +1071,23 @@ public void registerUnionQuery(String unionQueryClause, boolean unionAll) { assertStringNotNullAndNotTrimmedEmpty("unionQueryClause", unionQueryClause); - final UnionQueryInfo unionQueryInfo = new UnionQueryInfo(); + UnionQueryInfo unionQueryInfo = new UnionQueryInfo(); unionQueryInfo.setUnionQueryClause(unionQueryClause); unionQueryInfo.setUnionAll(unionAll); + addUnionQueryInfo(unionQueryInfo); + } + + protected void addUnionQueryInfo(UnionQueryInfo unionQueryInfo) { + if (_unionQueryInfoList == null) { + _unionQueryInfoList = new ArrayList(); + } _unionQueryInfoList.add(unionQueryInfo); } + public boolean hasUnionQuery() { + return _unionQueryInfoList != null && !_unionQueryInfoList.isEmpty(); + } + protected static class UnionQueryInfo { protected String _unionQueryClause; @@ -1425,18 +1428,6 @@ //========================================================================== // ========= - // Format Clause - // ============= - public boolean isFormatClauseEffective() { - return _formatClause; - } - - public void makeFormatClauseEffective() { - _formatClause = true; - } - - //========================================================================== - // ========= // Sub Query Indent // ================ public String resolveSubQueryBeginMark(String subQueryIdentity) { @@ -1462,13 +1453,11 @@ } public String filterSubQueryIndent(String sql) { - return isFormatClauseEffective() ? filterSubQueryIndent(sql, "") : sql; + return filterSubQueryIndent(sql, "", sql); } - protected String filterSubQueryIndent(String sql, String preIndent) { - if (!isFormatClauseEffective()) { - return sql; - } + protected String filterSubQueryIndent(String sql, String preIndent, + String originalSql) { final String lineSeparator = getLineSeparator(); if (!sql.contains(getSubQueryBeginMarkPrefix())) { return sql; @@ -1509,7 +1498,8 @@ // - - - - - - - - // In begin to end // - - - - - - - - - if (line.contains(endMarkPrefix + subQueryIdentity)) {// The end + if (line.contains(endMarkPrefix + subQueryIdentity)) { // The + // end final int markIndex = line.indexOf(endMarkPrefix); final int terminalIndex = line.indexOf(identityTerminal); if (terminalIndex < 0) { @@ -1521,7 +1511,7 @@ + line.substring(terminalIndex + terminalLength); subSb.append(clause).append(getLineSeparator()); final String currentSql = filterSubQueryIndent(subSb - .toString(), preIndent + indent); + .toString(), preIndent + indent, originalSql); mainSb.append(currentSql); throughBegin = false; throughBeginFirst = false; @@ -1544,10 +1534,11 @@ + getLineSeparator(); msg = msg + subQueryIdentity + getLineSeparator(); msg = msg + getLineSeparator() + "[Before Filter]" - + getLineSeparator(); - msg = msg + sql + getLineSeparator(); + + getLineSeparator() + sql; msg = msg + getLineSeparator() + "[After Filter]" + getLineSeparator() + filteredSql; + msg = msg + getLineSeparator() + "[Original SQL]" + + getLineSeparator() + originalSql; throw new SubQueryIndentFailureException(msg); } if (filteredSql.contains(beginMarkPrefix)) { @@ -1556,10 +1547,11 @@ + getLineSeparator(); msg = msg + subQueryIdentity + getLineSeparator(); msg = msg + getLineSeparator() + "[Before Filter]" - + getLineSeparator(); - msg = msg + sql + getLineSeparator(); + + getLineSeparator() + sql; msg = msg + getLineSeparator() + "[After Filter]" + getLineSeparator() + filteredSql; + msg = msg + getLineSeparator() + "[Original SQL]" + + getLineSeparator() + originalSql; throw new SubQueryIndentFailureException(msg); } return filteredSql; @@ -1592,7 +1584,7 @@ } if (!_specifiedSelectColumnMap.containsKey(tableAliasName)) { _specifiedSelectColumnMap.put(tableAliasName, - new HashMap()); + new LinkedHashMap()); } Map elementMap = _specifiedSelectColumnMap .get(tableAliasName); @@ -1666,10 +1658,7 @@ getUnionWhereFirstConditionMark(), ""); final StringBuilder sb = new StringBuilder(); - String ln = ""; - if (isFormatClauseEffective()) { - ln = getLineSeparator(); - } + String ln = getLineSeparator(); sb.append("update ").append(_tableName).append(ln); int index = 0; // It is guaranteed that the map has one or more elements. @@ -1728,10 +1717,7 @@ final String subQuery = filterSubQueryIndent(selectClause + " " + fromWhereClause); final StringBuilder sb = new StringBuilder(); - String ln = ""; - if (isFormatClauseEffective()) { - ln = getLineSeparator(); - } + String ln = getLineSeparator(); sb.append("delete from ").append(_tableName).append(ln); sb.append(" where ").append(primaryKeyName); sb.append(" in (").append(ln).append(subQuery).append(ln).append( @@ -1760,6 +1746,29 @@ return false; } + // [DBFlute-0.8.6] + //========================================================================== + // ========= + // Select Clause Type + // ================== + public void classifySelectClauseType(SelectClauseType selectClauseType) { + changeSelectClauseType(selectClauseType); + } + + protected void changeSelectClauseType(SelectClauseType selectClauseType) { + savePreviousSelectClauseType(); + _selectClauseType = selectClauseType; + } + + protected void savePreviousSelectClauseType() { + _previousSelectClauseType = _selectClauseType; + } + + public void rollbackSelectClauseType() { + _selectClauseType = _previousSelectClauseType != null ? _previousSelectClauseType + : DEFAULT_SELECT_CLAUSE_TYPE; + } + // [DBFlute-0.7.5] //========================================================================== // ========= Modified: notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/cbean/sqlclause/SqlClause.java =================================================================== --- notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/cbean/sqlclause/SqlClause.java 2008-12-27 22:11:51 UTC (rev 1627) +++ notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/cbean/sqlclause/SqlClause.java 2008-12-27 22:13:37 UTC (rev 1628) @@ -7,7 +7,7 @@ import jp.sf.pal.notepad.db.allcommon.cbean.cvalue.ConditionValue; /** - * The interface of SQL-clause. + * The interface of SQL clause. * * @author DBFlute(AutoGenerator) */ @@ -35,21 +35,6 @@ */ public String getClause(); - /** - * Get clause of all parts as PK-only. - * - *
-     * # 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
-     * 
- * - * @return The clause of all parts as PK-Only. (NotNull) - */ - public String getClausePKOnly(); - // ----------------------------------------------------- // Fragment Clause // --------------- @@ -92,14 +77,6 @@ public String getSelectClause(); /** - * Get The clause of 'select' as PK-only. This is an internal method. - * - * @return The clause of select PK-only. {[select ...] from table...} - * (NotNull) - */ - public String getSelectClausePKOnly(); - - /** * Get the hint of 'select'. This is an internal method. * * @return The hint of 'select'. {select [select-hint] * from table...} @@ -108,14 +85,6 @@ public String getSelectHint(); /** - * Get the clause of included-select-column. This is an internal method. - * - * @return The clause of included-select-column. {select ... , - * [included-select-column clause] from table...} (NotNull) - */ - public String getIncludedSelectColumnClause(); - - /** * Get the clause of 'from'. This is an internal method. * * @return The clause of 'from'. (NotNull) @@ -162,17 +131,6 @@ //========================================================================== // ========= - // Copy Parts - // ========== - /** - * Copy included-select-column. - * - * @param sqlClause SQL-clause. (NotNull) - */ - public void copyIncludedSelectColumn(SqlClause sqlClause); - - //========================================================================== - // ========= // SelectedSelectColumn // ==================== /** @@ -189,30 +147,6 @@ //========================================================================== // ========= - // IncludedSelectColumn - // ==================== - /** - * Ignore included-select-column. - */ - public void ignoreIncludedSelectColumn(); - - /** - * Make included-select-column effective. - */ - public void makeIncludedSelectColumnEffective(); - - /** - * Register included-select-column. - * - * @param aliasName The alias name of the included-select-column. (NotNull) - * @param realColumnName The real column name of the included-select-column. - * (NotNull) - */ - public void registerIncludedSelectColumn(String aliasName, - String realColumnName); - - //========================================================================== - // ========= // OuterJoin // ========= /** @@ -340,6 +274,8 @@ // ===== public void registerUnionQuery(String unionClause, boolean unionAll); + public boolean hasUnionQuery(); + //========================================================================== // ========= // FetchScope @@ -561,14 +497,6 @@ //========================================================================== // ========= - // Format Clause - // ============= - public boolean isFormatClauseEffective(); - - public void makeFormatClauseEffective(); - - //========================================================================== - // ========= // Sub Query Indent // ================ public String resolveSubQueryBeginMark(String subQueryIdentity); @@ -588,8 +516,17 @@ public boolean hasSpecifiedDeriveSubQuery(String aliasName); + /** + * Get the name of only one specified column. + * + * @return The name of only one specified column. (Nullable: If it's not + * found or duplicated, it returns null) + */ public String getSpecifiedColumnNameAsOne(); + /** + * Clear specified select columns. + */ public void clearSpecifiedSelectColumn(); // [DBFlute-0.7.5] @@ -621,4 +558,29 @@ */ public boolean isUniqueConstraintException(String sqlState, Integer errorCode); + + // [DBFlute-0.8.6] + //========================================================================== + // ========= + // Select Clause Type + // ================== + /** + * Classify the type of select clause into specified type. + * + * @param selectClauseType The type of select clause. (NotNull) + */ + public void classifySelectClauseType(SelectClauseType selectClauseType); + + /** + * Roll-back the type of select clause into previous one. If it has no + * change, classify its type into default type. + */ + public void rollbackSelectClauseType(); + + /** + * The type of select clause. + */ + public static enum SelectClauseType { + COLUMNS, COUNT, MAX, MIN, SUM, AVG + } } Modified: notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/cbean/sqlclause/SqlClauseOracle.java =================================================================== --- notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/cbean/sqlclause/SqlClauseOracle.java 2008-12-27 22:11:51 UTC (rev 1627) +++ notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/cbean/sqlclause/SqlClauseOracle.java 2008-12-27 22:13:37 UTC (rev 1628) @@ -71,12 +71,7 @@ if (!isFetchStartIndexSupported() && !isFetchSizeSupported()) { return; } - String ln = null; - if (isFormatClauseEffective()) { - ln = getLineSeparator(); - } else { - ln = ""; - } + String ln = getLineSeparator(); _fetchScopeSelectHint = " * from (select base.*, rownum as rn from (" + ln + "select"; _fetchScopeSqlSuffix = ""; Modified: notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/dbmeta/AbstractDBMeta.java =================================================================== --- notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/dbmeta/AbstractDBMeta.java 2008-12-27 22:11:51 UTC (rev 1627) +++ notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/dbmeta/AbstractDBMeta.java 2008-12-27 22:13:37 UTC (rev 1628) @@ -5,12 +5,11 @@ import java.util.Collection; import java.util.Collections; import java.util.HashMap; -import java.util.HashSet; import java.util.Iterator; import java.util.LinkedHashMap; import java.util.List; import java.util.Map; -import java.util.Set; +import java.util.concurrent.ConcurrentHashMap; import jp.sf.pal.notepad.db.allcommon.Entity; import jp.sf.pal.notepad.db.allcommon.dbmeta.info.ColumnInfo; @@ -22,6 +21,7 @@ import jp.sf.pal.notepad.db.allcommon.helper.MapListStringImpl; import jp.sf.pal.notepad.db.allcommon.helper.MapStringBuilder; import jp.sf.pal.notepad.db.allcommon.helper.MapStringBuilderImpl; +import jp.sf.pal.notepad.db.allcommon.helper.StringKeyMap; import jp.sf.pal.notepad.db.allcommon.util.SimpleAssertUtil; import jp.sf.pal.notepad.db.allcommon.util.SimpleStringUtil; import jp.sf.pal.notepad.db.allcommon.util.SimpleSystemUtil; @@ -31,68 +31,113 @@ * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public abstract class AbstractDBMeta implements DBMeta { //========================================================================== // ========= + // Definition + // ========== + protected static final Object DUMMY_VALUE = new Object(); + + //========================================================================== + // ========= // Attribute // ========= - protected List _columnInfoList; + // ----------------------------------------------------- + // Information Resource + // -------------------- + // Initialized at its getter. + private StringKeyMap _tableDbNameFlexibleMap; + private StringKeyMap _tablePropertyNameFlexibleMap; + + private List _columnInfoList; + + private StringKeyMap _columnInfoFlexibleMap; + + // Initialized at hasMethod(). + private Map _methodNameMap = newConcurrentHashMap(); + //========================================================================== // ========= + // Table Info + // ========== + /** + * Get the flexible map of table DB name. + * + * @return The flexible map of table DB name. (NotNull, NotEmpty) + */ + protected Map getTableDbNameFlexibleMap() { + if (_tableDbNameFlexibleMap != null) { + return _tableDbNameFlexibleMap; + } + synchronized (this) { + if (_tableDbNameFlexibleMap != null) { + return _tableDbNameFlexibleMap; + } + _tableDbNameFlexibleMap = StringKeyMap.createAsFlexibleConcurrent(); + _tableDbNameFlexibleMap.put(getTableDbName(), getTableDbName()); + return _tableDbNameFlexibleMap; + } + } + + /** + * Get the flexible map of table property name. + * + * @return The flexible map of table property name. (NotNull, NotEmpty) + */ + protected Map getTablePropertyNameFlexibleMap() { + if (_tablePropertyNameFlexibleMap != null) { + return _tablePropertyNameFlexibleMap; + } + synchronized (this) { + if (_tablePropertyNameFlexibleMap != null) { + return _tablePropertyNameFlexibleMap; + } + _tablePropertyNameFlexibleMap = StringKeyMap + .createAsFlexibleConcurrent(); + _tablePropertyNameFlexibleMap.put(getTableDbName(), + getTablePropertyName()); + return _tableDbNameFlexibleMap; + } + } + + //========================================================================== + // ========= // Column Info // =========== /** * The implementation. * - * @param columnFlexibleName The flexible name of the column. (NotNull) + * @param columnFlexibleName The flexible name(IgnoreCase, IgnoreUnderscore) + * of the column. (NotNull, NotEmpty) * @return Determination. */ public boolean hasColumn(String columnFlexibleName) { - if (!hasFlexibleName(columnFlexibleName)) { - return false; - } - final String propertyName = findPropertyName(columnFlexibleName); - return hasMethod("column" + initCap(propertyName)); + assertStringNotNullAndNotTrimmedEmpty("columnFlexibleName", + columnFlexibleName); + return getColumnInfoFlexibleMap().containsKey(columnFlexibleName); } /** * The implementation. * - * @param columnFlexibleName The flexible name of the column. (NotNull and - * NotEmpty) + * @param columnFlexibleName The flexible name(IgnoreCase, IgnoreUnderscore) + * of the column. (NotNull, NotEmpty) * @return The information of the column. (NotNull) */ public ColumnInfo findColumnInfo(String columnFlexibleName) { assertStringNotNullAndNotTrimmedEmpty("columnFlexibleName", columnFlexibleName); - if (!hasColumn(columnFlexibleName)) { + final ColumnInfo columnInfo = getColumnInfoFlexibleMap().get( + columnFlexibleName); + if (columnInfo == null) { String msg = "Not found column by columnFlexibleName: " + columnFlexibleName; msg = msg + " tableName=" + getTableDbName(); throw new IllegalArgumentException(msg); } - String methodName = "column" - + initCap(findPropertyName(columnFlexibleName)); - Method method = null; - try { - method = this.getClass().getMethod(methodName, new Class[] {}); - } catch (NoSuchMethodException e) { - String msg = "Not found column by columnFlexibleName: " - + columnFlexibleName; - msg = msg + " tableName=" + getTableDbName() + " methodName=" - + methodName; - throw new RuntimeException(msg, e); - } - try { - return (ColumnInfo) method.invoke(this, new Object[] {}); - } catch (IllegalAccessException e) { - throw new RuntimeException(e); - } catch (java.lang.reflect.InvocationTargetException e) { - throw new RuntimeException(e.getCause()); - } + return columnInfo; } protected ColumnInfo cci(String columnDbName, String propertyName, @@ -114,7 +159,7 @@ /** * The implementation. * - * @return The list of columns. (NotNull and NotEmpty) + * @return The list of columns. (NotNull, NotEmpty) */ public List getColumnInfoList() { if (_columnInfoList != null) { @@ -144,79 +189,118 @@ } } - protected void initializeColumnInfoList() { - getColumnInfoList();// Ignore return value because of initialization - // only! + /** + * Get the flexible map of column information. + * + * @return The flexible map of column information. (NotNull, NotEmpty) + */ + protected Map getColumnInfoFlexibleMap() { + if (_columnInfoFlexibleMap != null) { + return _columnInfoFlexibleMap; + } + final List columnInfoList = getColumnInfoList(); + synchronized (this) { + if (_columnInfoFlexibleMap != null) { + return _columnInfoFlexibleMap; + } + _columnInfoFlexibleMap = StringKeyMap.createAsFlexibleConcurrent(); + for (ColumnInfo columnInfo : columnInfoList) { + _columnInfoFlexibleMap.put(columnInfo.getColumnDbName(), + columnInfo); + } + return _columnInfoFlexibleMap; + } } //========================================================================== - // =========== + // ========= + // Resource Initialization + // ======================= + protected void initializeInformationResource() { // for instance initializer + // of subclass. + // Initialize the flexible map of table DB name. + getTableDbNameFlexibleMap(); + + // Initialize the flexible map of table property name. + getTablePropertyNameFlexibleMap(); + + // Initialize the list of column information. + getColumnInfoList(); + + // Initialize the flexible map of column information. + getColumnInfoFlexibleMap(); + + // Initialize the map of (public)method name. + hasMethod("dummy"); + } + + //========================================================================== + // ========= // Name Handling // ============= /** * The implementation. * - * @param flexibleName Flexible-name(IgnoreCase). (NotNull and NotEmpty) + * @param flexibleName The flexible name(IgnoreCase, IgnoreUnderscore). + * (NotNull, NotEmpty) * @return Determination. */ public boolean hasFlexibleName(String flexibleName) { - final String key = flexibleName.toLowerCase(); - if (getDbNamePropertyNameKeyToLowerMap().containsKey(key)) { - return true; - } - if (getPropertyNameDbNameKeyToLowerMap().containsKey(key)) { - return true; - } - return false; + assertStringNotNullAndNotTrimmedEmpty("flexibleName", flexibleName); + + // It uses column before table because column is used much more than + // table. + // This is the same consideration at other methods. + return getColumnInfoFlexibleMap().containsKey(flexibleName) + || getTableDbNameFlexibleMap().containsKey(flexibleName); } /** * The implementation. * - * @param flexibleName Flexible-name(IgnoreCase). (NotNull and NotEmpty) - * @return DB name. (NotNull and NotEmpty) + * @param flexibleName The flexible name(IgnoreCase, IgnoreUnderscore). + * (NotNull, NotEmpty) + * @return DB name. (NotNull, NotEmpty) */ public String findDbName(String flexibleName) { - final String key = flexibleName.toLowerCase(); - if (getPropertyNameDbNameKeyToLowerMap().containsKey(key)) { - return (String) getPropertyNameDbNameKeyToLowerMap().get(key); + assertStringNotNullAndNotTrimmedEmpty("flexibleName", flexibleName); + final ColumnInfo columnInfoMap = getColumnInfoFlexibleMap().get( + flexibleName); + if (columnInfoMap != null) { + return columnInfoMap.getColumnDbName(); } - if (getDbNamePropertyNameKeyToLowerMap().containsKey(key)) { - final String dbNameKeyToLower = ((String) getDbNamePropertyNameKeyToLowerMap() - .get(key)).toLowerCase(); - if (getPropertyNameDbNameKeyToLowerMap().containsKey( - dbNameKeyToLower)) { - return (String) getPropertyNameDbNameKeyToLowerMap().get( - dbNameKeyToLower); - } + final String tableDbName = getTableDbNameFlexibleMap() + .get(flexibleName); + if (tableDbName != null) { + return tableDbName; } - String msg = "Not found object by the flexible name: flexibleName=" + String msg = "Not found DB name by the flexible name: flexibleName=" + flexibleName; - throw new IllegalStateException(msg); + throw new IllegalArgumentException(msg); } /** * The implementation. * - * @param flexibleName Flexible-name(IgnoreCase). (NotNull and NotEmpty) - * @return DB name. (NotNull and NotEmpty) + * @param flexibleName The flexible name(IgnoreCase, IgnoreUnderscore). + * (NotNull, NotEmpty) + * @return DB name. (NotNull, NotEmpty) */ public String findPropertyName(String flexibleName) { - final String key = flexibleName.toLowerCase(); - if (getDbNamePropertyNameKeyToLowerMap().containsKey(key)) { - return (String) getDbNamePropertyNameKeyToLowerMap().get(key); + assertStringNotNullAndNotTrimmedEmpty("flexibleName", flexibleName); + final ColumnInfo columnInfoMap = getColumnInfoFlexibleMap().get( + flexibleName); + if (columnInfoMap != null) { + return columnInfoMap.getPropertyName(); } - if (getPropertyNameDbNameKeyToLowerMap().containsKey(key)) { - final String dbNameToLower = ((String) getPropertyNameDbNameKeyToLowerMap() - .get(key)).toLowerCase(); - if (getDbNamePropertyNameKeyToLowerMap().containsKey(dbNameToLower)) { - return (String) getDbNamePropertyNameKeyToLowerMap().get( - dbNameToLower); - } + final String tablePropertyName = getTablePropertyNameFlexibleMap().get( + flexibleName); + if (tablePropertyName != null) { + return tablePropertyName; } - String msg = "Not found object by the flexible name: flexibleName=" + String msg = "Not found property name by the flexible name: flexibleName=" + flexibleName; - throw new IllegalStateException(msg); + throw new IllegalArgumentException(msg); } //========================================================================== @@ -735,10 +819,8 @@ protected void registerEntityPropertySetupper( String columnName, String propertyName, Eps setupper, Map> entityPropertySetupperMap) { + // Only column name is registered because the map must be flexible map. entityPropertySetupperMap.put(columnName, setupper); - entityPropertySetupperMap.put(propertyName, setupper); - entityPropertySetupperMap.put(columnName.toLowerCase(), setupper); - entityPropertySetupperMap.put(propertyName.toLowerCase(), setupper); } protected Eps findEps( @@ -945,6 +1027,7 @@ /** * This class is for Internal. Don't use this! */ + @SuppressWarnings("unchecked") protected static class MapStringValueAnalyzer { protected java.util.Map _valueMap; @@ -1072,6 +1155,7 @@ // ========= // Assist Helper // ============= + @SuppressWarnings("unchecked") protected ENTITY downcast(Entity entity) { checkDowncast(entity); return (ENTITY) entity; @@ -1118,10 +1202,10 @@ protected Map setupKeyToLowerMap(boolean dbNameKey) { final Map map; if (dbNameKey) { - map = newLinkedHashMap(getTableDbName().toLowerCase(), + map = newConcurrentHashMap(getTableDbName().toLowerCase(), getTablePropertyName()); } else { - map = newLinkedHashMap(getTablePropertyName().toLowerCase(), + map = newConcurrentHashMap(getTablePropertyName().toLowerCase(), getTableDbName()); } Method[] methods = this.getClass().getMethods(); @@ -1178,6 +1262,17 @@ return new HashMap(); } + protected ConcurrentHashMap newConcurrentHashMap() { + return new ConcurrentHashMap(); + } + + protected ConcurrentHashMap newConcurrentHashMap( + KEY key, VALUE value) { + ConcurrentHashMap map = newConcurrentHashMap(); + map.put(key, value); + return map; + } + protected LinkedHashMap newLinkedHashMap() { return new LinkedHashMap(); } @@ -1201,23 +1296,26 @@ // ----------------------------------------------------- // Reflection Handling // ------------------- - private Set _cachedMethodNames = new HashSet(); // for - - // performance - + /** + * Does it have the method? + * + * @param methodName The name of method. (NotNull, NotEmpty, + * PublicMethodOnly) + * @return Determination. + */ protected boolean hasMethod(String methodName) { assertStringNotNullAndNotTrimmedEmpty("methodName", methodName); - if (_cachedMethodNames.isEmpty()) { - synchronized (_cachedMethodNames) { - if (_cachedMethodNames.isEmpty()) { + if (_methodNameMap.isEmpty()) { + synchronized (_methodNameMap) { + if (_methodNameMap.isEmpty()) { final Method[] methods = this.getClass().getMethods(); for (Method method : methods) { - _cachedMethodNames.add(method.getName()); + _methodNameMap.put(method.getName(), DUMMY_VALUE); } } } } - return _cachedMethodNames.contains(methodName); + return _methodNameMap.containsKey(methodName); } // ----------------------------------------------------- Modified: notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/dbmeta/DBMeta.java =================================================================== --- notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/dbmeta/DBMeta.java 2008-12-27 22:11:51 UTC (rev 1627) +++ notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/dbmeta/DBMeta.java 2008-12-27 22:13:37 UTC (rev 1628) @@ -17,23 +17,22 @@ * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public interface DBMeta { //========================================================================== // ========= // Definition // ========== - /** Map-string map-mark. */ + /** Map-string map mark. */ public static final String MAP_STRING_MAP_MARK = "map:"; - /** Map-string list-mark. */ + /** Map-string list mark. */ public static final String MAP_STRING_LIST_MARK = "list:"; - /** Map-string start-brace. */ + /** Map-string start brace. */ public static final String MAP_STRING_START_BRACE = "@{"; - /** Map-string end-brace. */ + /** Map-string end brace. */ public static final String MAP_STRING_END_BRACE = "@}"; /** Map-string delimiter. */ @@ -47,23 +46,23 @@ // Table Info // ========== /** - * Get table db-name. + * Get table DB name. * - * @return Table db-name. (NotNull) + * @return Table DB name. (NotNull) */ public String getTableDbName(); /** - * Get table property-name(JavaBeansRule). + * Get table property name(JavaBeansRule). * - * @return Table property-name(JavaBeansRule). (NotNull) + * @return Table property name(JavaBeansRule). (NotNull) */ public String getTablePropertyName(); /** - * Get table SQL-name. + * Get table SQL name. * - * @return Table SQL-name. (NotNull) + * @return Table SQL name. (NotNull) */ public String getTableSqlName(); @@ -80,10 +79,10 @@ public boolean hasFlexibleName(String flexibleName); /** - * Find db name by flexible name. {Target objects are TABLE and COLUMN} + * Find DB name by flexible name. {Target objects are TABLE and COLUMN} * * @param flexibleName The flexible name. (NotNull and NotEmpty) - * @return Db name. (NotNull and NotEmpty) + * @return The DB name of anything. (NotNull and NotEmpty) */ public String findDbName(String flexibleName); @@ -92,60 +91,40 @@ * TABLE and COLUMN} * * @param flexibleName The flexible name. (NotNull and NotEmpty) - * @return Db name. (NotNull and NotEmpty) + * @return The DB name of anything. (NotNull and NotEmpty) */ public String findPropertyName(String flexibleName); //========================================================================== // ========= - // Name Map - // ======== - /** - * Get the key-to-lower map of DB name(lower) and property name. - * - * @return The key-to-lower map of DB name(lower) and property name. - * (NotNull) - */ - public Map 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 getPropertyNameDbNameKeyToLowerMap(); - - //========================================================================== - // ========= // Type Name // ========= /** - * Get the type-name of entity. + * Get the type name of entity. * - * @return The type-name of entity. (NotNull) + * @return The type name of entity. (NotNull) */ public String getEntityTypeName(); /** - * Get the type-name of condition-bean. + * Get the type name of condition-bean. * - * @return The type-name of condition-bean. (Nullable: If the condition-bean + * @return The type name of condition-bean. (Nullable: If the condition-bean * does not exist) */ public String getConditionBeanTypeName(); /** - * Get the type-name of dao. + * Get the type name of DAO. * - * @return The type-name of dao. (Nullable: If the dao does not exist) + * @return The type name of DAO. (Nullable: If the DAO does not exist) */ public String getDaoTypeName(); /** - * Get the type-name of behavior. + * Get the type name of behavior. * - * @return The type-name of behavior. (Nullable: If the behavior does not + * @return The type name of behavior. (Nullable: If the behavior does not * exist) */ public String getBehaviorTypeName(); Modified: notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/dbmeta/DBMetaInstanceHandler.java =================================================================== --- notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/dbmeta/DBMetaInstanceHandler.java 2008-12-27 22:11:51 UTC (rev 1627) +++ notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/dbmeta/DBMetaInstanceHandler.java 2008-12-27 22:13:37 UTC (rev 1628) @@ -1,103 +1,85 @@ package jp.sf.pal.notepad.db.allcommon.dbmeta; -import java.util.Collections; -import java.util.LinkedHashMap; +import java.lang.reflect.Method; import java.util.Map; import java.util.Set; +import java.util.concurrent.ConcurrentHashMap; +import jp.sf.pal.notepad.db.allcommon.helper.StringKeyMap; import jp.sf.pal.notepad.db.allcommon.util.SimpleAssertUtil; /** - * DBMeta instance handler. + * The instance handler of DB meta. * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public class DBMetaInstanceHandler { //========================================================================== // ========= // Definition // ========== + /** Log-instance. */ + private static final org.apache.commons.logging.Log _log = org.apache.commons.logging.LogFactory + .getLog(DBMetaInstanceHandler.class); + + //========================================================================== + // ========= + // Resource Map + // ============ /** Table DB-name instance map. */ - protected static final Map _tableDbNameInstanceMap = new LinkedHashMap(); + protected static final Map _tableDbNameInstanceMap = newConcurrentHashMap(); - /** The map of table DB-name and class name. */ - protected static final Map _tableDbNameClassNameMap; - static { - Map tmpMap = new LinkedHashMap(); + /** The map of table DB name and class name. This is for initialization. */ + protected static final Map _tableDbNameClassNameMap = newConcurrentHashMap(); - tmpMap.put("GROUP_INFO", - "jp.sf.pal.notepad.db.bsentity.dbmeta.GroupInfoDbm"); - tmpMap.put("GROUP_MAPPING", - "jp.sf.pal.notepad.db.bsentity.dbmeta.GroupMappingDbm"); - tmpMap - .put("NOTEPAD", - "jp.sf.pal.notepad.db.bsentity.dbmeta.NotepadDbm"); - tmpMap.put("NOTEPAD_CATEGORY", - "jp.sf.pal.notepad.db.bsentity.dbmeta.NotepadCategoryDbm"); - tmpMap.put("NOTEPAD_CONTENT", - "jp.sf.pal.notepad.db.bsentity.dbmeta.NotepadContentDbm"); - tmpMap.put("ROLE_INFO", - "jp.sf.pal.notepad.db.bsentity.dbmeta.RoleInfoDbm"); - tmpMap.put("ROLE_MAPPING", - "jp.sf.pal.notepad.db.bsentity.dbmeta.RoleMappingDbm"); - tmpMap.put("USER_INFO", - "jp.sf.pal.notepad.db.bsentity.dbmeta.UserInfoDbm"); + /** The flexible map of table DB name. This is for conversion at finding. */ + protected static final Map _tableDbNameFlexibleMap = StringKeyMap + .createAsFlexibleConcurrent(); - _tableDbNameClassNameMap = Collections.unmodifiableMap(tmpMap); - } + /** The count of setting up resources of DB meta for internal information. */ + protected static int setupCount = 0; - /** The key-to-lower map of DB-name and property-name for table. */ - protected static final Map _tableDbNamePropertyNameKeyToLowerMap; - static { - Map tmpMap = new LinkedHashMap(); - - tmpMap.put("GROUP_INFO".toLowerCase(), "groupInfo"); - tmpMap.put("GROUP_MAPPING".toLowerCase(), "groupMapping"); - tmpMap.put("NOTEPAD".toLowerCase(), "notepad"); - tmpMap.put("NOTEPAD_CATEGORY".toLowerCase(), "notepadCategory"); - tmpMap.put("NOTEPAD_CONTENT".toLowerCase(), "notepadContent"); - tmpMap.put("ROLE_INFO".toLowerCase(), "roleInfo"); - tmpMap.put("ROLE_MAPPING".toLowerCase(), "roleMapping"); - tmpMap.put("USER_INFO".toLowerCase(), "userInfo"); - - _tableDbNamePropertyNameKeyToLowerMap = Collections - .unmodifiableMap(tmpMap); - } - - /** The key-to-lower map of property-name and DB-name for table. */ - protected static final Map _tablePropertyNameDbNameKeyToLowerMap; - static { - Map tmpMap = new LinkedHashMap(); - - tmpMap.put("groupInfo".toLowerCase(), "GROUP_INFO"); - tmpMap.put("groupMapping".toLowerCase(), "GROUP_MAPPING"); - tmpMap.put("notepad".toLowerCase(), "NOTEPAD"); - tmpMap.put("notepadCategory".toLowerCase(), "NOTEPAD_CATEGORY"); - tmpMap.put("notepadContent".toLowerCase(), "NOTEPAD_CONTENT"); - tmpMap.put("roleInfo".toLowerCase(), "ROLE_INFO"); - tmpMap.put("roleMapping".toLowerCase(), "ROLE_MAPPING"); - tmpMap.put("userInfo".toLowerCase(), "USER_INFO"); - - _tablePropertyNameDbNameKeyToLowerMap = Collections - .unmodifiableMap(tmpMap); - } - - protected static DBMeta getDBMeta(String className) { - try { - Class clazz = Class.forName(className); - java.lang.reflect.Method methoz = clazz.getMethod("getInstance", - (Class[]) null); - Object result = methoz.invoke(null, (Object[]) null); - return (DBMeta) result; - } catch (Exception e) { - throw new RuntimeException(e); + /** + * Set up the resource of DBMeta. Lock this class. + * + * @param tableDbNameClassNameMap The map of table DB name and class name. + * (NotNull) + */ + public static synchronized void setupDBMetaResource( + Map tableDbNameClassNameMap) { + if (tableDbNameClassNameMap == null) { + String msg = "The argument 'tableDbNameClassNameMap' should not be null"; + msg = msg + " at DBMetaInstanceHandler.setupDBMetaResource()"; + throw new IllegalArgumentException(msg); } + if (tableDbNameClassNameMap.isEmpty()) { + String msg = "The argument 'tableDbNameClassNameMap' should not be empty"; + msg = msg + " at DBMetaInstanceHandler.setupDBMetaResource()"; + throw new IllegalArgumentException(msg); + } + final String firstMsg = "...Setting up resources of DB meta"; + final int tableCount = tableDbNameClassNameMap.size(); + if (setupCount == 0) { + _log.info(firstMsg + ": tables=" + tableCount); // basically here + } else { + _log.info(firstMsg + " AGAIN(" + (setupCount + 1) + + " times): tables=" + tableCount); + } + _tableDbNameInstanceMap.clear(); + _tableDbNameClassNameMap.clear(); + _tableDbNameFlexibleMap.clear(); + final Set tableDbNameSet = tableDbNameClassNameMap.keySet(); + for (String tableDbName : tableDbNameSet) { + final String className = tableDbNameClassNameMap.get(tableDbName); + _tableDbNameClassNameMap.put(tableDbName, className); + _tableDbNameFlexibleMap.put(tableDbName, tableDbName); + } + ++setupCount; } /** - * @return The initialized map that contains all instances of dbmeta. + * @return The initialized map that contains all instances of DB meta. * (NotNull & NotEmpty) */ public static Map getDBMetaMap() { @@ -130,45 +112,31 @@ // Main Method // =========== /** - * Find dbmeta by table flexible-name. + * Find DB meta by table flexible name. * *
-     * If the table name is 'ORDER_DETAIL', you can find the dbmeta by ...(as follows)
+     * If the table name is 'ORDER_DETAIL', you can find the DB meta by ...(as follows)
      *     'ORDER_DETAIL', 'ORDer_DeTAiL', 'order_detail'
      *     , 'OrderDetail', 'orderdetail', 'oRderDetaIl'
      * 
* - * @param tableFlexibleName Table flexible-name. (NotNull) - * @return The instance of dbmeta. (NotNull) - * @exception DBMetaNotFoundException When the dbmeta is not found. + * @param tableFlexibleName The flexible name of table. (NotNull) + * @return The instance of DB meta. (NotNull) + * @exception DBMetaNotFoundException When the DB meta is not found. */ public static DBMeta findDBMeta(String tableFlexibleName) { assertStringNotNullAndNotTrimmedEmpty("tableFlexibleName", tableFlexibleName); - if (_tableDbNameInstanceMap.containsKey(tableFlexibleName)) { - return byTableDbName(tableFlexibleName); - } - String toLowerKey = tableFlexibleName.toLowerCase(); - if (_tableDbNamePropertyNameKeyToLowerMap.containsKey(toLowerKey)) { - String propertyName = (String) _tableDbNamePropertyNameKeyToLowerMap - .get(toLowerKey); - String dbName = (String) _tablePropertyNameDbNameKeyToLowerMap - .get(propertyName.toLowerCase()); - return byTableDbName(dbName); - } - if (_tablePropertyNameDbNameKeyToLowerMap.containsKey(toLowerKey)) { - String dbName = (String) _tablePropertyNameDbNameKeyToLowerMap - .get(toLowerKey); - return byTableDbName(dbName); - } final int dotLastIndex = tableFlexibleName.lastIndexOf("."); if (dotLastIndex >= 0) { - try { - return findDBMeta(tableFlexibleName.substring(dotLastIndex + 1)); - } catch (DBMetaNotFoundException e) { - // Nothing - } + tableFlexibleName = tableFlexibleName.substring(dotLastIndex + + ".".length()); } + final String tableDbName = _tableDbNameFlexibleMap + .get(tableFlexibleName); + if (tableDbName != null) { + return byTableDbName(tableDbName); + } String msg = "The instance map returned null by the key: key=" + tableFlexibleName + " instanceMap=" + _tableDbNameInstanceMap; throw new DBMetaNotFoundException(msg); @@ -192,8 +160,9 @@ assertStringNotNullAndNotTrimmedEmpty("tableDbName", tableDbName); DBMeta instance = getCachedDBMeta(tableDbName); if (instance == null) { - String msg = "The instance map returned null by the key: key=" - + tableDbName + " instanceMap=" + _tableDbNameInstanceMap; + String msg = "The instance map returned null by the key:"; + msg = msg + " key=" + tableDbName + " instanceMap=" + + _tableDbNameInstanceMap; throw new DBMetaNotFoundException(msg); } return instance; @@ -215,10 +184,25 @@ return _tableDbNameInstanceMap.get(tableName); } + protected static DBMeta getDBMeta(String className) { + try { + Class clazz = Class.forName(className); + Method methoz = clazz.getMethod("getInstance", (Class[]) null); + Object result = methoz.invoke(null, (Object[]) null); + return (DBMeta) result; + } catch (Exception e) { + throw new RuntimeException(e); + } + } + //========================================================================== // ========= // General Helper // ============== + protected static ConcurrentHashMap newConcurrentHashMap() { + return new ConcurrentHashMap(); + } + // ----------------------------------------------------- // Assert Object // ------------- Modified: notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/dbmeta/hierarchy/HierarchyArranger.java =================================================================== --- notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/dbmeta/hierarchy/HierarchyArranger.java 2008-12-27 22:11:51 UTC (rev 1627) +++ notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/dbmeta/hierarchy/HierarchyArranger.java 2008-12-27 22:13:37 UTC (rev 1628) @@ -222,7 +222,6 @@ * @author DBFlute(AutoGenerator) * @param The type of local entity extends Entity */ - ¡÷ SuppressWarnings("unchecked") public class HierarchyArranger { //========================================================================== @@ -457,9 +456,9 @@ List referrerList = extractReferrerList(localEntity, referrerInfo); if (referrerList == null) { - String msg = "The referrer list should not be null: localEntity=" - + localEntity + " referrerInfo=" + referrerInfo; - throw new IllegalStateException(msg); + // Initialize the list of referrer and inject it. + referrerList = new ArrayList(); + injectReferrerList(localEntity, referrerInfo, referrerList); } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -765,8 +764,8 @@ return capPropReferrerName; } - private java.lang.reflect.Method findMethod(Class clazz, String methodName, - Class[] argTypes) { + private java.lang.reflect.Method findMethod(Class clazz, + String methodName, Class[] argTypes) { try { return clazz.getMethod(methodName, argTypes); } catch (NoSuchMethodException ex) { @@ -852,10 +851,10 @@ return sb.toString(); } - private String createTypeViewFromTypeArray(Class[] array) { + private String createTypeViewFromTypeArray(Class[] array) { final StringBuffer sb = new StringBuffer(); for (int i = 0; i < array.length; i++) { - final Class type = array[i]; + final Class type = array[i]; if (sb.length() == 0) { sb.append(type.getSimpleName()); } else { Modified: notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/dbmeta/hierarchy/HierarchyRequest.java =================================================================== --- notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/dbmeta/hierarchy/HierarchyRequest.java 2008-12-27 22:11:51 UTC (rev 1627) +++ notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/dbmeta/hierarchy/HierarchyRequest.java 2008-12-27 22:13:37 UTC (rev 1628) @@ -16,7 +16,6 @@ * @author DBFlute(AutoGenerator) * @param The type of local entity. */ - ¡÷ SuppressWarnings("unchecked") public class HierarchyRequest { //========================================================================== Modified: notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/dbmeta/hierarchy/HierarchyRequestElement.java =================================================================== --- notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/dbmeta/hierarchy/HierarchyRequestElement.java 2008-12-27 22:11:51 UTC (rev 1627) +++ notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/dbmeta/hierarchy/HierarchyRequestElement.java 2008-12-27 22:13:37 UTC (rev 1628) @@ -9,7 +9,6 @@ /** * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public class HierarchyRequestElement { //========================================================================== Modified: notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/dbmeta/hierarchy/HierarchySourceColumn.java =================================================================== --- notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/dbmeta/hierarchy/HierarchySourceColumn.java 2008-12-27 22:11:51 UTC (rev 1627) +++ notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/dbmeta/hierarchy/HierarchySourceColumn.java 2008-12-27 22:13:37 UTC (rev 1628) @@ -3,7 +3,6 @@ /** * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public interface HierarchySourceColumn { public String getColumnName(); Modified: notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/dbmeta/hierarchy/HierarchySourceIterator.java =================================================================== --- notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/dbmeta/hierarchy/HierarchySourceIterator.java 2008-12-27 22:11:51 UTC (rev 1627) +++ notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/dbmeta/hierarchy/HierarchySourceIterator.java 2008-12-27 22:13:37 UTC (rev 1628) @@ -3,7 +3,6 @@ /** * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public interface HierarchySourceIterator { public boolean hasNext(); Modified: notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/dbmeta/hierarchy/HierarchySourceRow.java =================================================================== --- notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/dbmeta/hierarchy/HierarchySourceRow.java 2008-12-27 22:11:51 UTC (rev 1627) +++ notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/dbmeta/hierarchy/HierarchySourceRow.java 2008-12-27 22:13:37 UTC (rev 1628) @@ -3,7 +3,6 @@ /** * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public interface HierarchySourceRow { public Object extractColumnValue(HierarchySourceColumn columnInfo); Modified: notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/dbmeta/info/ColumnInfo.java =================================================================== --- notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/dbmeta/info/ColumnInfo.java 2008-12-27 22:11:51 UTC (rev 1627) +++ notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/dbmeta/info/ColumnInfo.java 2008-12-27 22:13:37 UTC (rev 1628) @@ -8,7 +8,6 @@ * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public class ColumnInfo { //========================================================================== Modified: notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/dbmeta/info/RelationInfo.java =================================================================== --- notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/dbmeta/info/RelationInfo.java 2008-12-27 22:11:51 UTC (rev 1627) +++ notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/dbmeta/info/RelationInfo.java 2008-12-27 22:13:37 UTC (rev 1628) @@ -1,13 +1,14 @@ package jp.sf.pal.notepad.db.allcommon.dbmeta.info; +import java.util.Map; + import jp.sf.pal.notepad.db.allcommon.dbmeta.DBMeta; /** - * The class of referer information. + * The class of referrer information. * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public interface RelationInfo { public String getRelationPropertyName(); @@ -16,7 +17,7 @@ public DBMeta getTargetDBMeta(); - public java.util.Map getLocalTargetColumnInfoMap(); + public Map getLocalTargetColumnInfoMap(); public boolean isOneToOne(); Modified: notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/helper/MapStringBuilderImpl.java =================================================================== --- notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/helper/MapStringBuilderImpl.java 2008-12-27 22:11:51 UTC (rev 1627) +++ notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/helper/MapStringBuilderImpl.java 2008-12-27 22:13:37 UTC (rev 1628) @@ -1,17 +1,20 @@ package jp.sf.pal.notepad.db.allcommon.helper; +import java.util.Arrays; +import java.util.List; + import jp.sf.pal.notepad.db.allcommon.helper.token.line.LineToken; import jp.sf.pal.notepad.db.allcommon.helper.token.line.LineTokenizingOption; import jp.sf.pal.notepad.db.allcommon.helper.token.line.impl.LineTokenImpl; /** - * The implementation of map-string-builder. + * The implementation of map-string builder. * * @author DBFlute(AutoGenerator) */ public class MapStringBuilderImpl implements MapStringBuilder { - protected java.util.List _columnNameList; + protected List _columnNameList; protected String _msMapMark; @@ -26,10 +29,10 @@ protected boolean _trimDoubleQuotation; public void setColumnNames(String[] columnNames) { - _columnNameList = java.util.Arrays.asList(columnNames); + _columnNameList = Arrays.asList(columnNames); } - public void setColumnNameList(java.util.List columnNameList) { + public void setColumnNameList(List columnNameList) { _columnNameList = columnNameList; } @@ -83,7 +86,7 @@ return sb.toString(); } - public String buildFromList(java.util.List valueList) { + public String buildFromList(List valueList) { if (valueList == null) { String msg = "The argument[valueList] should not be null."; throw new IllegalArgumentException(msg); @@ -103,7 +106,7 @@ return sb.toString(); } - protected java.util.List tokenize(String value, String delimiter) { + protected List tokenize(String value, String delimiter) { final LineToken lineToken = new LineTokenImpl(); final LineTokenizingOption lineTokenizingOption = new LineTokenizingOption(); lineTokenizingOption.setDelimiter(delimiter); @@ -144,8 +147,8 @@ } } - protected void assertColumnValueList(java.util.List columnNameList, - java.util.List valueList) { + protected void assertColumnValueList(List columnNameList, + List valueList) { if (columnNameList.size() != valueList.size()) { String msg = "The length of columnNameList and valueList are difference. (" + columnNameList.size() + ", " + valueList.size() + ")"; Added: notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/helper/StringKeyMap.java =================================================================== --- notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/helper/StringKeyMap.java (rev 0) +++ notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/helper/StringKeyMap.java 2008-12-27 22:13:37 UTC (rev 1628) @@ -0,0 +1,201 @@ +package jp.sf.pal.notepad.db.allcommon.helper; + +import java.util.Collection; +import java.util.HashMap; +import java.util.Map; +import java.util.Set; +import java.util.concurrent.ConcurrentHashMap; + +/** + * @author DBFlute(AutoGenerator) + * @param The type of value. + */ +public class StringKeyMap implements Map { + + //========================================================================== + // ========= + // Attribute + // ========= + protected final Map _internalMap; + + protected boolean _removeUnderscore; + + //========================================================================== + // ========= + // Constructor + // =========== + protected StringKeyMap(boolean removeUnderscore, boolean concurrent) { + _removeUnderscore = removeUnderscore; + if (concurrent) { + _internalMap = newConcurrentHashMap(); + } else { + _internalMap = newHashMap(); + } + } + + public static StringKeyMap createAsFlexible() { + return new StringKeyMap(true, false); + } + + public static StringKeyMap createAsFlexibleConcurrent() { + return new StringKeyMap(true, true); + } + + public static StringKeyMap createAsCaseInsensitive() { + return new StringKeyMap(false, false); + } + + public static StringKeyMap createAsCaseInsensitiveConcurrent() { + return new StringKeyMap(false, true); + } + + //========================================================================== + // ========= + // Map Emulator + // ============ + // ----------------------------------------------------- + // Key Related + // ----------- + public VALUE get(Object key) { + final String stringKey = convertStringKey(key); + if (stringKey != null) { + return _internalMap.get(stringKey); + } + return null; + } + + public VALUE put(String key, VALUE value) { + final String stringKey = convertStringKey(key); + if (stringKey != null) { + return _internalMap.put(stringKey, value); + } + return null; + } + + public VALUE remove(Object key) { + final String stringKey = convertStringKey(key); + if (stringKey != null) { + return _internalMap.remove(stringKey); + } + return null; + } + + public final void putAll(Map map) { + final Set keySet = map.keySet(); + for (String key : keySet) { + put(key, map.get(key)); + } + } + + public boolean containsKey(Object key) { + return get(key) != null; + } + + // ----------------------------------------------------- + // Delegate + // -------- + public void clear() { + _internalMap.clear(); + } + + public int size() { + return _internalMap.size(); + } + + public boolean isEmpty() { + return _internalMap.isEmpty(); + } + + public Set keySet() { + return _internalMap.keySet(); + } + + public Collection values() { + return _internalMap.values(); + } + + public boolean containsValue(Object obj) { + return _internalMap.containsValue(obj); + } + + public Set> entrySet() { + return _internalMap.entrySet(); + } + + //========================================================================== + // ========= + // Key Converter + // ============= + protected String convertStringKey(Object key) { + if (!(key instanceof String)) { + return null; + } + return toLowerCase(removeUnderscore((String) key)); + } + + protected String removeUnderscore(String value) { + if (_removeUnderscore) { + return replace(value, "_", ""); + } + return value; + } + + protected String toLowerCase(String value) { + return value.toLowerCase(); + } + + //========================================================================== + // ========= + // General Helper + // ============== + protected static String replace(String text, String fromText, String toText) { + if (text == null || fromText == null || toText == null) { + return null; + } + StringBuilder sb = new StringBuilder(100); + int pos = 0; + int pos2 = 0; + while (true) { + pos = text.indexOf(fromText, pos2); + if (pos == 0) { + sb.append(toText); + pos2 = fromText.length(); + } else if (pos > 0) { + sb.append(text.substring(pos2, pos)); + sb.append(toText); + pos2 = pos + fromText.length(); + } else { + sb.append(text.substring(pos2)); + break; + } + } + return sb.toString(); + } + + protected static ConcurrentHashMap newConcurrentHashMap() { + return new ConcurrentHashMap(); + } + + protected static HashMap newHashMap() { + return new HashMap(); + } + + //========================================================================== + // ========= + // Basic Override + // ============== + @Override + public boolean equals(Object obj) { + return _internalMap.equals(obj); + } + + @Override + public int hashCode() { + return _internalMap.hashCode(); + } + + @Override + public String toString() { + return _internalMap.toString(); + } +} \ No newline at end of file Property changes on: notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/helper/StringKeyMap.java ___________________________________________________________________ Name: svn:eol-style + native Added: notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/helper/StringSet.java =================================================================== --- notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/helper/StringSet.java (rev 0) +++ notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/helper/StringSet.java 2008-12-27 22:13:37 UTC (rev 1628) @@ -0,0 +1,233 @@ +package jp.sf.pal.notepad.db.allcommon.helper; + +import java.util.Collection; +import java.util.HashMap; +import java.util.Iterator; +import java.util.Map; +import java.util.Set; +import java.util.concurrent.ConcurrentHashMap; + +/** + * @author DBFlute(AutoGenerator) + */ +public class StringSet implements Set { + + //========================================================================== + // ========= + // Definition + // ========== + protected static final Object DUMMY_VALUE = new Object(); + + //========================================================================== + // ========= + // Attribute + // ========= + protected final Map _internalMap; + + protected boolean _removeUnderscore; + + //========================================================================== + // ========= + // Constructor + // =========== + protected StringSet(boolean removeUnderscore, boolean concurrent) { + _removeUnderscore = removeUnderscore; + if (concurrent) { + _internalMap = newConcurrentHashMap(); + } else { + _internalMap = newHashMap(); + } + } + + public static StringSet createAsFlexible() { + return new StringSet(true, false); + } + + public static StringSet createAsFlexibleConcurrent() { + return new StringSet(true, true); + } + + public static StringSet createAsCaseInsensitive() { + return new StringSet(false, false); + } + + public static StringSet createAsCaseInsensitiveConcurrent() { + return new StringSet(false, true); + } + + //========================================================================== + // ========= + // Map Emulator + // ============ + // ----------------------------------------------------- + // Key Related + // ----------- + public boolean add(String value) { + final String stringValue = convertStringKey(value); + if (stringValue != null) { + return _internalMap.put(stringValue, DUMMY_VALUE) != null; + } + return false; + } + + public boolean remove(Object value) { + final String stringValue = convertStringKey(value); + if (stringValue != null) { + return _internalMap.remove(stringValue) != null; + } + return false; + } + + public boolean contains(Object value) { + final String stringValue = convertStringKey(value); + if (stringValue != null) { + return _internalMap.containsKey(stringValue); + } + return false; + } + + // ----------------------------------------------------- + // Delegate + // -------- + public void clear() { + _internalMap.clear(); + } + + public int size() { + return _internalMap.size(); + } + + public boolean isEmpty() { + return _internalMap.isEmpty(); + } + + public boolean addAll(Collection c) { + boolean success = false; + for (String s : c) { + if (add(s)) { + success = true; + } + } + return success; + } + + public boolean removeAll(Collection c) { + boolean success = false; + for (Object s : c) { + if (remove(s)) { + success = true; + } + } + return success; + } + + public boolean containsAll(Collection c) { + for (Object s : c) { + if (contains(s)) { + return true; + } + } + return false; + } + + public Iterator iterator() { + return _internalMap.keySet().iterator(); + } + + public boolean retainAll(Collection c) { + boolean success = false; + for (Object s : c) { + if (!contains(s)) { + if (remove(s)) { + success = true; + } + } + } + return success; + } + + public Object[] toArray() { + return _internalMap.keySet().toArray(); + } + + public T[] toArray(T[] a) { + return _internalMap.keySet().toArray(a); + } + + //========================================================================== + // ========= + // Key Converter + // ============= + protected String convertStringKey(Object value) { + if (!(value instanceof String)) { + return null; + } + return toLowerCase(removeUnderscore((String) value)); + } + + protected String removeUnderscore(String value) { + if (_removeUnderscore) { + return replace(value, "_", ""); + } + return value; + } + + protected String toLowerCase(String value) { + return value.toLowerCase(); + } + + //========================================================================== + // ========= + // General Helper + // ============== + protected static String replace(String text, String fromText, String toText) { + if (text == null || fromText == null || toText == null) { + return null; + } + StringBuilder sb = new StringBuilder(100); + int pos = 0; + int pos2 = 0; + while (true) { + pos = text.indexOf(fromText, pos2); + if (pos == 0) { + sb.append(toText); + pos2 = fromText.length(); + } else if (pos > 0) { + sb.append(text.substring(pos2, pos)); + sb.append(toText); + pos2 = pos + fromText.length(); + } else { + sb.append(text.substring(pos2)); + break; + } + } + return sb.toString(); + } + + protected static ConcurrentHashMap newConcurrentHashMap() { + return new ConcurrentHashMap(); + } + + protected static HashMap newHashMap() { + return new HashMap(); + } + + //========================================================================== + // ========= + // Basic Override + // ============== + @Override + public boolean equals(Object obj) { + return _internalMap.keySet().equals(obj); + } + + @Override + public int hashCode() { + return _internalMap.keySet().hashCode(); + } + + @Override + public String toString() { + return _internalMap.keySet().toString(); + } +} \ No newline at end of file Property changes on: notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/helper/StringSet.java ___________________________________________________________________ Name: svn:eol-style + native Added: notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/s2dao/BeanMetaDataFactoryExtension.java =================================================================== --- notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/s2dao/BeanMetaDataFactoryExtension.java (rev 0) +++ notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/s2dao/BeanMetaDataFactoryExtension.java 2008-12-27 22:13:37 UTC (rev 1628) @@ -0,0 +1,213 @@ +package jp.sf.pal.notepad.db.allcommon.s2dao; + +import java.sql.DatabaseMetaData; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.concurrent.ConcurrentHashMap; + +import jp.sf.pal.notepad.db.allcommon.Entity; +import jp.sf.pal.notepad.db.allcommon.s2dao.internal.various.InternalIdentifierGeneratorFactory; + +import org.seasar.dao.BeanMetaData; +import org.seasar.dao.IdentifierGenerator; +import org.seasar.dao.impl.BeanMetaDataFactoryImpl; +import org.seasar.dao.impl.BeanMetaDataImpl; +import org.seasar.extension.jdbc.PropertyType; +import org.seasar.framework.beans.PropertyDesc; + +/** + * BeanMetaDataFactoryImpl for DBFlute. + * + * @author DBFlute(AutoGenerator) + */ + ¡÷ SuppressWarnings("unchecked") +public class BeanMetaDataFactoryExtension extends BeanMetaDataFactoryImpl { + + //========================================================================== + // ========= + // Attribute + // ========= + /** The map of bean meta data for cache. */ + protected Map, BeanMetaData> _metaMap = newConcurrentHashMap(); + + //========================================================================== + // ========= + // Override for Cache + // ================== + @Override + public BeanMetaData createBeanMetaData(Class beanClass) { + final BeanMetaData cachedMeta = findCachedMeta(beanClass); + if (cachedMeta != null) { + return cachedMeta; + } else { + return super.createBeanMetaData(beanClass); + } + } + + @Override + public BeanMetaData createBeanMetaData(Class beanClass, + int relationNestLevel) { + final BeanMetaData cachedMeta = findCachedMeta(beanClass); + if (cachedMeta != null) { + return cachedMeta; + } else { + return super.createBeanMetaData(beanClass, relationNestLevel); + } + } + + @Override + public BeanMetaData createBeanMetaData(DatabaseMetaData dbMetaData, + Class beanClass, int relationNestLevel) { + final BeanMetaData cachedMeta = findOrCreateCachedMetaIfNeeds( + dbMetaData, beanClass, relationNestLevel); + if (cachedMeta != null) { + return cachedMeta; + } else { + return super.createBeanMetaData(dbMetaData, beanClass, + relationNestLevel); + } + } + + protected BeanMetaData findCachedMeta(Class beanClass) { + if (isDBFluteEntity(beanClass)) { + final BeanMetaData cachedMeta = getMetaFromCache(beanClass); + if (cachedMeta != null) { + return cachedMeta; + } + } + return null; + } + + protected BeanMetaData findOrCreateCachedMetaIfNeeds( + DatabaseMetaData dbMetaData, Class beanClass, int relationNestLevel) { + if (isDBFluteEntity(beanClass)) { + final BeanMetaData cachedMeta = getMetaFromCache(beanClass); + if (cachedMeta != null) { + return cachedMeta; + } else { + return super.createBeanMetaData(dbMetaData, beanClass, 0); + } + } + return null; + } + + //========================================================================== + // ========= + // BeanMetaData Creation + // ===================== + @Override + protected BeanMetaDataImpl createBeanMetaDataImpl() { + // /= = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = + // = = + // for ConditionBean and insert() and update() and delete() and so on... + // = = = = = = = = = =/ + return new BeanMetaDataImpl() { + protected List _internalIdentifierGeneratorList = new ArrayList(); + + protected Map _internalIdentifierGeneratorsByPropertyName = newConcurrentHashMap(); + + // /= = = = = = = + // for cache + // = = = = =/ + @Override + public void initialize() { // for Cache + final Class myBeanClass = getBeanClass(); + if (isDBFluteEntity(myBeanClass)) { + final BeanMetaData cachedMeta = getMetaFromCache(myBeanClass); + if (cachedMeta == null) { + _metaMap.put(myBeanClass, this); + } + } + super.initialize(); + } + + // /= = = = = = = + // for insert() + // = = = = =/ + // The attributes 'identifierGenerators' and + // 'identifierGeneratorsByPropertyName' + // of super class are unused. It prepares original atributes here. + @Override + protected void setupIdentifierGenerator(PropertyType propertyType) { + final PropertyDesc pd = propertyType.getPropertyDesc(); + final String propertyName = propertyType.getPropertyName(); + final String idType = beanAnnotationReader.getId(pd, getDbms()); + final IdentifierGenerator generator = createInternalIdentifierGenerator( + propertyType, idType); + _internalIdentifierGeneratorList.add(generator); + _internalIdentifierGeneratorsByPropertyName.put(propertyName, + generator); + } + + protected IdentifierGenerator createInternalIdentifierGenerator( + PropertyType propertyType, String idType) { + return InternalIdentifierGeneratorFactory + .createIdentifierGenerator(propertyType, getDbms(), + idType); + } + + @Override + public IdentifierGenerator getIdentifierGenerator(int index) { + return _internalIdentifierGeneratorList.get(index); + } + + @Override + public int getIdentifierGeneratorSize() { + return _internalIdentifierGeneratorList.size(); + } + + @Override + public IdentifierGenerator getIdentifierGenerator( + String propertyName) { + return _internalIdentifierGeneratorsByPropertyName + .get(propertyName); + } + }; + } + + // /= = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = + // Other extension points about BeanMetaDataImpl is as follows: + // + // S2DaoMetaDataExtension.createNonConcurrencyBmdFactory() + // --> for NonConcurrency (updateNonstrict() and deleteNonstrict() and so + // on...) + // + // S2DaoMetaDataExtension.createOutsideSqlCustomizeBeanMetaDataFactory() + // --> for OutsideSql but it overrides nothing. + // = = = = = = = = = =/ + + //========================================================================== + // ========= + // Relation Next Level + // =================== + /** + * Get the limit nest level of relation. + * + * @return The limit nest level of relation. + */ + @Override + protected int getLimitRelationNestLevel() { + return 2; // for Compatible to old version DBFlute + } + + //========================================================================== + // ========= + // General Helper + // ============== + protected ConcurrentHashMap newConcurrentHashMap() { + return new ConcurrentHashMap(); + } + + //========================================================================== + // ========= + // Assist Helper + // ============= + protected boolean isDBFluteEntity(Class beanClass) { + return Entity.class.isAssignableFrom(beanClass); + } + + protected BeanMetaData getMetaFromCache(Class beanClass) { + return _metaMap.get(beanClass); + } +} \ No newline at end of file Property changes on: notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/s2dao/BeanMetaDataFactoryExtension.java ___________________________________________________________________ Name: svn:eol-style + native Modified: notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/s2dao/FetchNarrowingResultSetWrapper.java =================================================================== --- notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/s2dao/FetchNarrowingResultSetWrapper.java 2008-12-27 22:11:51 UTC (rev 1627) +++ notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/s2dao/FetchNarrowingResultSetWrapper.java 2008-12-27 22:13:37 UTC (rev 1628) @@ -4,6 +4,7 @@ import java.sql.SQLException; import java.sql.Statement; +import jp.sf.pal.notepad.db.allcommon.DBDef; import jp.sf.pal.notepad.db.allcommon.cbean.FetchNarrowingBean; import jp.sf.pal.notepad.db.allcommon.s2dao.internal.sqlhandler.InternalBasicHandler.SQLExceptionHandler; @@ -41,6 +42,9 @@ /** Does it skip to cursor end? */ protected boolean _skipToCursorEnd; + /** Is the database DB2? */ + protected final boolean _db2 = DBDef.isCurrentDef(DBDef.DB2); + //========================================================================== // ========= // Constructor @@ -71,7 +75,7 @@ // Skip // ==== /** - * Skip to start-index. + * Skip to the point at start index. */ protected void skip() { if (!isAvailableSkipRecord()) { @@ -125,12 +129,15 @@ // Next // ==== /** - * Next. + * Move to the next record. * * @return Does the result set have next record? * @throws SQLException */ public boolean next() throws SQLException { + if (_db2 && _skipToCursorEnd) { // [DBFLUTE-243] + return false; + } final boolean hasNext = super.next(); ++_requestCounter; if (!isAvailableLimitLoopCount()) { Added: notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/s2dao/PropertyTypeFactoryBuilderExtension.java =================================================================== --- notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/s2dao/PropertyTypeFactoryBuilderExtension.java (rev 0) +++ notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/s2dao/PropertyTypeFactoryBuilderExtension.java 2008-12-27 22:13:37 UTC (rev 1628) @@ -0,0 +1,215 @@ +package jp.sf.pal.notepad.db.allcommon.s2dao; + +import java.sql.DatabaseMetaData; +import java.util.ArrayList; +import java.util.List; + +import jp.sf.pal.notepad.db.allcommon.Entity; +import jp.sf.pal.notepad.db.allcommon.dbmeta.DBMeta; + +import org.seasar.dao.BeanAnnotationReader; +import org.seasar.dao.ColumnNaming; +import org.seasar.dao.Dbms; +import org.seasar.dao.PropertyTypeFactory; +import org.seasar.dao.PropertyTypeFactoryBuilder; +import org.seasar.dao.ValueTypeFactory; +import org.seasar.dao.impl.AbstractPropertyTypeFactory; +import org.seasar.extension.jdbc.PropertyType; +import org.seasar.framework.beans.BeanDesc; +import org.seasar.framework.beans.PropertyDesc; + +/** + * The factory builder of property type for S2Dao. {Since S2Dao-1.0.47} + * + * @author DBFlute(AutoGenerator) + */ + ¡÷ SuppressWarnings("unchecked") +public class PropertyTypeFactoryBuilderExtension implements + PropertyTypeFactoryBuilder { + + //========================================================================== + // ========= + // Attribute + // ========= + protected ValueTypeFactory valueTypeFactory; + + protected ColumnNaming columnNaming; + + //========================================================================== + // ========= + // Build + // ===== + public PropertyTypeFactory build(Class beanClass, + BeanAnnotationReader beanAnnotationReader) { + return new FastPropertyTypeFactoryExtension(beanClass, + beanAnnotationReader, valueTypeFactory, columnNaming); + } + + public PropertyTypeFactory build(Class beanClass, + BeanAnnotationReader beanAnnotationReader, Dbms dbms, + DatabaseMetaData databaseMetaData) { + return new FastPropertyTypeFactoryExtension(beanClass, + beanAnnotationReader, valueTypeFactory, columnNaming, dbms); + } + + //========================================================================== + // ========= + // Extension Class + // =============== + protected static class FastPropertyTypeFactoryExtension extends + AbstractPropertyTypeFactory { + + protected DBMeta _dbmeta; + + protected String[] _noPersisteneProps; + + public FastPropertyTypeFactoryExtension(Class beanClass, + BeanAnnotationReader beanAnnotationReader, + ValueTypeFactory valueTypeFactory, ColumnNaming columnNaming) { + super(beanClass, beanAnnotationReader, valueTypeFactory, + columnNaming); + initializeResources(); + } + + public FastPropertyTypeFactoryExtension(Class beanClass, + BeanAnnotationReader beanAnnotationReader, + ValueTypeFactory valueTypeFactory, ColumnNaming columnNaming, + Dbms dbms) { + super(beanClass, beanAnnotationReader, valueTypeFactory, + columnNaming, dbms); + initializeResources(); + } + + protected void initializeResources() { + if (isEntity()) { + _dbmeta = findDBMeta(); + } + _noPersisteneProps = beanAnnotationReader.getNoPersisteneProps(); + } + + protected boolean isEntity() { + return Entity.class.isAssignableFrom(beanClass); + } + + protected boolean hasDBMeta() { + return _dbmeta != null; + } + + protected DBMeta findDBMeta() { + try { + final Entity entity = (Entity) beanClass.newInstance(); + return entity.getDBMeta(); + } catch (Exception e) { + String msg = "beanClass.newInstance() threw the exception: beanClass=" + + beanClass; + throw new RuntimeException(msg, e); + } + } + + public PropertyType[] createBeanPropertyTypes(String tableName) { + final List list = new ArrayList(); + final BeanDesc beanDesc = getBeanDesc(); + for (int i = 0; i < beanDesc.getPropertyDescSize(); ++i) { + final PropertyDesc pd = beanDesc.getPropertyDesc(i); + + // Read-only property is unnecessary! + if (!pd.hasWriteMethod()) { + continue; + } + + // Relation property is unnecessary! + if (isRelation(pd)) { + continue; + } + + final PropertyType pt = createPropertyType(pd); + pt.setPrimaryKey(isPrimaryKey(pd)); + pt.setPersistent(isPersistent(pt)); + list.add(pt); + } + return list.toArray(new PropertyType[list.size()]); + } + + @Override + protected boolean isRelation(PropertyDesc propertyDesc) { + final String propertyName = propertyDesc.getPropertyName(); + if (hasDBMeta() + && (_dbmeta.hasForeign(propertyName) || _dbmeta + .hasReferrer(propertyName))) { + return true; + } + return hasRelationNoAnnotation(propertyDesc); + } + + protected boolean hasRelationNoAnnotation(PropertyDesc propertyDesc) { + return beanAnnotationReader.hasRelationNo(propertyDesc); + } + + @Override + protected boolean isPrimaryKey(PropertyDesc propertyDesc) { + final String propertyName = propertyDesc.getPropertyName(); + if (hasDBMeta() && _dbmeta.hasPrimaryKey() + && _dbmeta.hasColumn(propertyName)) { + if (_dbmeta.findColumnInfo(propertyName).isPrimary()) { + return true; + } + } + return hasIdAnnotation(propertyDesc); + } + + protected boolean hasIdAnnotation(PropertyDesc propertyDesc) { + final Dbms dbms = getDbms(); + return beanAnnotationReader.getId(propertyDesc, dbms) != null; + } + + @Override + protected boolean isPersistent(PropertyType propertyType) { + final String propertyName = propertyType.getPropertyName(); + final PropertyDesc propertyDesc = propertyType.getPropertyDesc(); + if ((hasDBMeta() && _dbmeta.hasColumn(propertyName)) + || hasColumnAnnotation(propertyDesc)) { + if (!isElementOfNoPersistentProps(propertyDesc)) { + return true; + } + } + return false; + } + + protected boolean hasColumnAnnotation(PropertyDesc propertyDesc) { + return beanAnnotationReader.getColumnAnnotation(propertyDesc) != null; + } + + protected boolean isElementOfNoPersistentProps(PropertyDesc propertyDesc) { + final String propertyName = propertyDesc.getPropertyName(); + final String[] props = _noPersisteneProps; + if (props != null && props.length >= 0) { + for (int i = 0; i < props.length; ++i) { + if (props[i].equals(propertyName)) { + return true; + } + } + } + return false; + } + } + + //========================================================================== + // ========= + // Accessor + // ======== + public ValueTypeFactory getValueTypeFactory() { + return valueTypeFactory; + } + + public void setValueTypeFactory(ValueTypeFactory valueTypeFactory) { + this.valueTypeFactory = valueTypeFactory; + } + + public ColumnNaming getColumnNaming() { + return columnNaming; + } + + public void setColumnNaming(ColumnNaming columnNaming) { + this.columnNaming = columnNaming; + } +} Added: notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/s2dao/SqlLogRegistryLatestSqlProvider.java =================================================================== --- notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/s2dao/SqlLogRegistryLatestSqlProvider.java (rev 0) +++ notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/s2dao/SqlLogRegistryLatestSqlProvider.java 2008-12-27 22:13:37 UTC (rev 1628) @@ -0,0 +1,21 @@ +package jp.sf.pal.notepad.db.allcommon.s2dao; + +import jp.sf.pal.notepad.db.allcommon.jdbc.LatestSqlProvider; +import jp.sf.pal.notepad.db.allcommon.s2dao.internal.sqllog.InternalSqlLogRegistry; + +/** + * The provider of latest SQL using SqlLogRegistry. This instance should be + * singleton. + * + * @author DBFlute(AutoGenerator) + */ +public class SqlLogRegistryLatestSqlProvider implements LatestSqlProvider { + + public String getDisplaySql() { + return InternalSqlLogRegistry.peekCompleteSql(); + } + + public void clearSqlCache() { + InternalSqlLogRegistry.clearSqlLogRegistry(); + } +} Property changes on: notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/s2dao/SqlLogRegistryLatestSqlProvider.java ___________________________________________________________________ Name: svn:eol-style + native Modified: notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/s2dao/internal/rshandler/InternalAbstractDtoMetaDataResultSetHandler.java =================================================================== --- notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/s2dao/internal/rshandler/InternalAbstractDtoMetaDataResultSetHandler.java 2008-12-27 22:11:51 UTC (rev 1627) +++ notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/s2dao/internal/rshandler/InternalAbstractDtoMetaDataResultSetHandler.java 2008-12-27 22:13:37 UTC (rev 1628) @@ -6,10 +6,11 @@ import java.util.Map; import java.util.Set; +import jp.sf.pal.notepad.db.allcommon.helper.StringSet; + import org.seasar.dao.DtoMetaData; import org.seasar.dao.RowCreator; import org.seasar.extension.jdbc.ResultSetHandler; -import org.seasar.framework.util.CaseInsensitiveSet; /** * @author DBFlute(AutoGenerator) @@ -67,10 +68,10 @@ return rowCreator.createRow(rs, propertyCache, beanClass); } - protected Set createColumnNames(final ResultSetMetaData rsmd) + protected Set createColumnNames(final ResultSetMetaData rsmd) throws SQLException { final int count = rsmd.getColumnCount(); - final Set columnNames = new CaseInsensitiveSet(); + final Set columnNames = StringSet.createAsCaseInsensitive(); for (int i = 0; i < count; ++i) { final String columnName = rsmd.getColumnLabel(i + 1); final int pos = columnName.lastIndexOf('.'); // [DAO-41] Modified: notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/s2dao/internal/sqlcommand/InternalAbstractAutoStaticCommand.java =================================================================== --- notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/s2dao/internal/sqlcommand/InternalAbstractAutoStaticCommand.java 2008-12-27 22:11:51 UTC (rev 1627) +++ notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/s2dao/internal/sqlcommand/InternalAbstractAutoStaticCommand.java 2008-12-27 22:13:37 UTC (rev 1628) @@ -10,7 +10,6 @@ import org.seasar.dao.BeanMetaData; import org.seasar.dao.IdentifierGenerator; -import org.seasar.dao.NotSingleRowUpdatedRuntimeException; import org.seasar.dao.PrimaryKeyNotFoundRuntimeException; import org.seasar.extension.jdbc.PropertyType; import org.seasar.extension.jdbc.StatementFactory; @@ -24,19 +23,13 @@ //========================================================================== // ========= - // Definition - // ========== - protected static final boolean DEFAULT_VERSION_NO_AUTO_INCREMENT_ON_MEMORY = true; - - //========================================================================== - // ========= // Attribute // ========= private PropertyType[] propertyTypes; - private boolean checkSingleRowUpdate = true; + protected boolean optimisticLockHandling; - protected boolean versionNoAutoIncrementOnMemory = DEFAULT_VERSION_NO_AUTO_INCREMENT_ON_MEMORY; + protected boolean versionNoAutoIncrementOnMemory; //========================================================================== // ========= @@ -44,15 +37,10 @@ // =========== public InternalAbstractAutoStaticCommand(DataSource dataSource, StatementFactory statementFactory, BeanMetaData beanMetaData, - String[] propertyNames) { - this(dataSource, statementFactory, beanMetaData, propertyNames, - DEFAULT_VERSION_NO_AUTO_INCREMENT_ON_MEMORY); - } - - public InternalAbstractAutoStaticCommand(DataSource dataSource, - StatementFactory statementFactory, BeanMetaData beanMetaData, - String[] propertyNames, boolean versionNoAutoIncrementOnMemory) { + String[] propertyNames, boolean optimisticLockHandling, + boolean versionNoAutoIncrementOnMemory) { super(dataSource, statementFactory, beanMetaData); + this.optimisticLockHandling = optimisticLockHandling; this.versionNoAutoIncrementOnMemory = versionNoAutoIncrementOnMemory; setupPropertyTypes(propertyNames); setupSql(); @@ -62,26 +50,19 @@ // ========= // Execute // ======= - public Object execute(Object[] args) { + public Object execute(Object[] args) { // NOT for Batch. Batch should + // override. InternalAbstractAutoHandler handler = createAutoHandler(); + handler.setOptimisticLockHandling(optimisticLockHandling); + handler + .setVersionNoAutoIncrementOnMemory(versionNoAutoIncrementOnMemory); handler.setSql(getSql()); handler.setLoggingMessageSqlArgs(args); int rows = handler.execute(args); - if (isCheckSingleRowUpdate() && rows != 1) { - throw createNotSingleRowUpdatedRuntimeException(args[0], rows); - } return new Integer(rows); } - public boolean isCheckSingleRowUpdate() { - return checkSingleRowUpdate; - } - - public void setCheckSingleRowUpdate(boolean checkSingleRowUpdate) { - this.checkSingleRowUpdate = checkSingleRowUpdate; - } - - protected NotSingleRowUpdatedRuntimeException createNotSingleRowUpdatedRuntimeException( + protected EntityAlreadyUpdatedException createEntityAlreadyUpdatedException( Object bean, int rows) { return new EntityAlreadyUpdatedException(bean, rows); } @@ -194,7 +175,7 @@ protected void setupDeleteSql() { checkPrimaryKey(); - StringBuilder sb = new StringBuilder(100); + final StringBuilder sb = new StringBuilder(100); sb.append("delete from "); sb.append(getBeanMetaData().getTableName()); setupUpdateWhere(sb); @@ -215,11 +196,11 @@ sb.append(bmd.getPrimaryKey(i)).append(" = ? and "); } sb.setLength(sb.length() - 5); - if (bmd.hasVersionNoPropertyType()) { + if (optimisticLockHandling && bmd.hasVersionNoPropertyType()) { PropertyType pt = bmd.getVersionNoPropertyType(); sb.append(" and ").append(pt.getColumnName()).append(" = ?"); } - if (bmd.hasTimestampPropertyType()) { + if (optimisticLockHandling && bmd.hasTimestampPropertyType()) { PropertyType pt = bmd.getTimestampPropertyType(); sb.append(" and ").append(pt.getColumnName()).append(" = ?"); } Modified: notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/s2dao/internal/sqlcommand/InternalAbstractBatchAutoStaticCommand.java =================================================================== --- notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/s2dao/internal/sqlcommand/InternalAbstractBatchAutoStaticCommand.java 2008-12-27 22:11:51 UTC (rev 1627) +++ notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/s2dao/internal/sqlcommand/InternalAbstractBatchAutoStaticCommand.java 2008-12-27 22:13:37 UTC (rev 1628) @@ -15,49 +15,30 @@ //========================================================================== // ========= - // Attribute - // ========= - protected final boolean returningRows; - - //========================================================================== - // ========= // Constructor // =========== public InternalAbstractBatchAutoStaticCommand(DataSource dataSource, StatementFactory statementFactory, BeanMetaData beanMetaData, - String[] propertyNames, boolean returningRows) { - this(dataSource, statementFactory, beanMetaData, propertyNames, - returningRows, DEFAULT_VERSION_NO_AUTO_INCREMENT_ON_MEMORY); - } - - public InternalAbstractBatchAutoStaticCommand(DataSource dataSource, - StatementFactory statementFactory, BeanMetaData beanMetaData, - String[] propertyNames, boolean returningRows, + String[] propertyNames, boolean optimisticLockHandling, boolean versionNoAutoIncrementOnMemory) { super(dataSource, statementFactory, beanMetaData, propertyNames, - versionNoAutoIncrementOnMemory); - this.returningRows = returningRows; + optimisticLockHandling, versionNoAutoIncrementOnMemory); } //========================================================================== // ========= // Execute // ======= + @Override public Object execute(Object[] args) { final InternalAbstractBatchAutoHandler handler = createBatchAutoHandler(); - - // It is unnecessary! - // injectDaoClass(handler); - + handler.setOptimisticLockHandling(optimisticLockHandling); + handler + .setVersionNoAutoIncrementOnMemory(versionNoAutoIncrementOnMemory); handler.setSql(getSql()); // The logging message SQL of procedure is unnecessary. // handler.setLoggingMessageSqlArgs(args); - if (this.returningRows) { - return handler.executeBatch(args); - } else { - final int updatedRows = handler.execute(args); - return new Integer(updatedRows); - } + return handler.executeBatch(args); } protected abstract InternalAbstractBatchAutoHandler createBatchAutoHandler(); Modified: notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/s2dao/internal/sqlcommand/InternalAbstractDynamicCommand.java =================================================================== --- notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/s2dao/internal/sqlcommand/InternalAbstractDynamicCommand.java 2008-12-27 22:11:51 UTC (rev 1627) +++ notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/s2dao/internal/sqlcommand/InternalAbstractDynamicCommand.java 2008-12-27 22:13:37 UTC (rev 1628) @@ -44,10 +44,15 @@ } protected InternalSqlParser createInternalSqlParser(String sql) { - return new InternalSqlParser(sql); + return new InternalSqlParser(sql, isBlockNullParameter()); } - public CommandContext apply(Object[] args) {// It is necessary to be public! + protected boolean isBlockNullParameter() { // Extension Point! + return false; + } + + public CommandContext apply(Object[] args) { // It is necessary to be + // public! final CommandContext ctx = createCommandContext(args); rootNode.accept(ctx); return ctx; Modified: notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/s2dao/internal/sqlcommand/InternalAbstractSqlCommand.java =================================================================== --- notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/s2dao/internal/sqlcommand/InternalAbstractSqlCommand.java 2008-12-27 22:11:51 UTC (rev 1627) +++ notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/s2dao/internal/sqlcommand/InternalAbstractSqlCommand.java 2008-12-27 22:13:37 UTC (rev 1628) @@ -2,13 +2,16 @@ import javax.sql.DataSource; +import jp.sf.pal.notepad.db.allcommon.bhv.core.SqlExecution; + import org.seasar.dao.SqlCommand; import org.seasar.extension.jdbc.StatementFactory; /** * @author DBFlute(AutoGenerator) */ -public abstract class InternalAbstractSqlCommand implements SqlCommand { +public abstract class InternalAbstractSqlCommand implements SqlCommand, + SqlExecution { //========================================================================== // ========= Modified: notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/s2dao/internal/sqlcommand/InternalDeleteAutoStaticCommand.java =================================================================== --- notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/s2dao/internal/sqlcommand/InternalDeleteAutoStaticCommand.java 2008-12-27 22:11:51 UTC (rev 1627) +++ notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/s2dao/internal/sqlcommand/InternalDeleteAutoStaticCommand.java 2008-12-27 22:13:37 UTC (rev 1628) @@ -20,8 +20,9 @@ // =========== public InternalDeleteAutoStaticCommand(DataSource dataSource, StatementFactory statementFactory, BeanMetaData beanMetaData, - String[] propertyNames) { - super(dataSource, statementFactory, beanMetaData, propertyNames); + String[] propertyNames, boolean optimisticLockHandling) { + super(dataSource, statementFactory, beanMetaData, propertyNames, + optimisticLockHandling, false); } //========================================================================== Modified: notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/s2dao/internal/sqlcommand/InternalDeleteBatchAutoStaticCommand.java =================================================================== --- notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/s2dao/internal/sqlcommand/InternalDeleteBatchAutoStaticCommand.java 2008-12-27 22:11:51 UTC (rev 1627) +++ notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/s2dao/internal/sqlcommand/InternalDeleteBatchAutoStaticCommand.java 2008-12-27 22:13:37 UTC (rev 1628) @@ -21,9 +21,9 @@ // =========== public InternalDeleteBatchAutoStaticCommand(DataSource dataSource, StatementFactory statementFactory, BeanMetaData beanMetaData, - String[] propertyNames, boolean returningRows) { + String[] propertyNames, boolean optimisticLockHandling) { super(dataSource, statementFactory, beanMetaData, propertyNames, - returningRows); + optimisticLockHandling, false); } //========================================================================== Modified: notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/s2dao/internal/sqlcommand/InternalDeleteQueryAutoDynamicCommand.java =================================================================== --- notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/s2dao/internal/sqlcommand/InternalDeleteQueryAutoDynamicCommand.java 2008-12-27 22:11:51 UTC (rev 1627) +++ notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/s2dao/internal/sqlcommand/InternalDeleteQueryAutoDynamicCommand.java 2008-12-27 22:13:37 UTC (rev 1628) @@ -2,6 +2,7 @@ import javax.sql.DataSource; +import jp.sf.pal.notepad.db.allcommon.bhv.core.SqlExecution; import jp.sf.pal.notepad.db.allcommon.cbean.ConditionBean; import jp.sf.pal.notepad.db.allcommon.s2dao.internal.sqlhandler.InternalCommandContextHandler; import jp.sf.pal.notepad.db.allcommon.s2dao.internal.sqlparser.InternalCommandContextCreator; @@ -16,7 +17,8 @@ /** * @author DBFlute(AutoGenerator) */ -public class InternalDeleteQueryAutoDynamicCommand implements SqlCommand { +public class InternalDeleteQueryAutoDynamicCommand implements SqlCommand, + SqlExecution { //========================================================================== // ========= @@ -83,7 +85,7 @@ String[] argNames, Class[] argTypes, Object[] args) { CommandContext context; { - InternalSqlParser parser = new InternalSqlParser(twoWaySql); + InternalSqlParser parser = new InternalSqlParser(twoWaySql, true); Node node = parser.parse(); InternalCommandContextCreator creator = new InternalCommandContextCreator( argNames, argTypes); Modified: notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/s2dao/internal/sqlcommand/InternalInsertAutoDynamicCommand.java =================================================================== --- notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/s2dao/internal/sqlcommand/InternalInsertAutoDynamicCommand.java 2008-12-27 22:11:51 UTC (rev 1627) +++ notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/s2dao/internal/sqlcommand/InternalInsertAutoDynamicCommand.java 2008-12-27 22:13:37 UTC (rev 1628) @@ -5,11 +5,11 @@ import javax.sql.DataSource; +import jp.sf.pal.notepad.db.allcommon.bhv.core.SqlExecution; import jp.sf.pal.notepad.db.allcommon.s2dao.internal.sqlhandler.InternalInsertAutoHandler; import org.seasar.dao.BeanMetaData; import org.seasar.dao.IdentifierGenerator; -import org.seasar.dao.NotSingleRowUpdatedRuntimeException; import org.seasar.dao.SqlCommand; import org.seasar.extension.jdbc.PropertyType; import org.seasar.extension.jdbc.StatementFactory; @@ -18,7 +18,8 @@ /** * @author DBFlute(AutoGenerator) */ -public class InternalInsertAutoDynamicCommand implements SqlCommand { +public class InternalInsertAutoDynamicCommand implements SqlCommand, + SqlExecution { //========================================================================== // ========= @@ -32,8 +33,6 @@ protected String[] propertyNames; - protected boolean checkSingleRowUpdate = true; - //========================================================================== // ========= // Constructor @@ -56,9 +55,6 @@ handler.setSql(sql); handler.setLoggingMessageSqlArgs(args); final int rows = handler.execute(args); - if (isCheckSingleRowUpdate() && rows != 1) { - throw new NotSingleRowUpdatedRuntimeException(args[0], rows); - } return new Integer(rows); } @@ -161,12 +157,4 @@ public void setPropertyNames(String[] propertyNames) { this.propertyNames = propertyNames; } - - public boolean isCheckSingleRowUpdate() { - return checkSingleRowUpdate; - } - - public void setCheckSingleRowUpdate(boolean checkSingleRowUpdate) { - this.checkSingleRowUpdate = checkSingleRowUpdate; - } } Modified: notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/s2dao/internal/sqlcommand/InternalInsertBatchAutoStaticCommand.java =================================================================== --- notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/s2dao/internal/sqlcommand/InternalInsertBatchAutoStaticCommand.java 2008-12-27 22:11:51 UTC (rev 1627) +++ notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/s2dao/internal/sqlcommand/InternalInsertBatchAutoStaticCommand.java 2008-12-27 22:13:37 UTC (rev 1628) @@ -21,9 +21,9 @@ // =========== public InternalInsertBatchAutoStaticCommand(DataSource dataSource, StatementFactory statementFactory, BeanMetaData beanMetaData, - String[] propertyNames, boolean returningRows) { - super(dataSource, statementFactory, beanMetaData, propertyNames, - returningRows); + String[] propertyNames) { + super(dataSource, statementFactory, beanMetaData, propertyNames, false, + false); } //========================================================================== Modified: notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/s2dao/internal/sqlcommand/InternalProcedureCommand.java =================================================================== --- notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/s2dao/internal/sqlcommand/InternalProcedureCommand.java 2008-12-27 22:11:51 UTC (rev 1627) +++ notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/s2dao/internal/sqlcommand/InternalProcedureCommand.java 2008-12-27 22:13:37 UTC (rev 1628) @@ -2,6 +2,7 @@ import javax.sql.DataSource; +import jp.sf.pal.notepad.db.allcommon.bhv.core.SqlExecution; import jp.sf.pal.notepad.db.allcommon.cbean.outsidesql.OutsideSqlContext; import jp.sf.pal.notepad.db.allcommon.s2dao.internal.sqlhandler.InternalProcedureHandler; import jp.sf.pal.notepad.db.allcommon.s2dao.internal.various.InternalProcedureMetaData; @@ -13,7 +14,7 @@ /** * @author DBFlute(AutoGenerator) */ -public class InternalProcedureCommand implements SqlCommand { +public class InternalProcedureCommand implements SqlCommand, SqlExecution { //========================================================================== // ========= Modified: notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/s2dao/internal/sqlcommand/InternalUpdateAutoDynamicCommand.java =================================================================== --- notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/s2dao/internal/sqlcommand/InternalUpdateAutoDynamicCommand.java 2008-12-27 22:11:51 UTC (rev 1627) +++ notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/s2dao/internal/sqlcommand/InternalUpdateAutoDynamicCommand.java 2008-12-27 22:13:37 UTC (rev 1628) @@ -5,29 +5,27 @@ import javax.sql.DataSource; +import jp.sf.pal.notepad.db.allcommon.XLog; import jp.sf.pal.notepad.db.allcommon.s2dao.internal.sqlhandler.InternalUpdateAutoHandler; import org.seasar.dao.BeanMetaData; import org.seasar.dao.NoUpdatePropertyTypeRuntimeException; -import org.seasar.dao.impl.AbstractSqlCommand; import org.seasar.extension.jdbc.PropertyType; import org.seasar.extension.jdbc.StatementFactory; /** * @author DBFlute(AutoGenerator) */ -public class InternalUpdateAutoDynamicCommand extends AbstractSqlCommand { +public class InternalUpdateAutoDynamicCommand extends + InternalAbstractSqlCommand { //========================================================================== // ========= // Definition // ========== - /** Log instance. */ - private static final org.apache.commons.logging.Log _log = org.apache.commons.logging.LogFactory - .getLog(InternalUpdateAutoDynamicCommand.class); + /** The result for no update as normal execution. */ + private static final Integer NO_UPDATE = new Integer(1); - private static final Integer NO_UPDATE = new Integer(0); - //========================================================================== // ========= // Attribute @@ -36,9 +34,9 @@ private String[] propertyNames; - private boolean checkSingleRowUpdate = true; + private boolean optimisticLockHandling; - private boolean versionNoAutoIncrementOnMemory = true; + private boolean versionNoAutoIncrementOnMemory; //========================================================================== // ========= @@ -59,8 +57,8 @@ final PropertyType[] propertyTypes = createUpdatePropertyTypes(bmd, bean, getPropertyNames()); if (propertyTypes.length == 0) { - if (_log.isDebugEnabled()) { - _log.debug(createNoUpdateLogMessage(bean, bmd)); + if (isLogEnabled()) { + log(createNoUpdateLogMessage(bean, bmd)); } return NO_UPDATE; } @@ -83,10 +81,10 @@ BeanMetaData bmd, PropertyType[] propertyTypes) { InternalUpdateAutoHandler handler = new InternalUpdateAutoHandler( getDataSource(), getStatementFactory(), bmd, propertyTypes); + handler.setOptimisticLockHandling(optimisticLockHandling); //[DBFlute-0.8 + // .0] handler .setVersionNoAutoIncrementOnMemory(versionNoAutoIncrementOnMemory); - handler.setCheckSingleRowUpdate(isCheckSingleRowUpdate()); //[DBFlute-0.8 - // .0] return handler; } @@ -182,17 +180,33 @@ sb.append(bmd.getPrimaryKey(i)).append(" = ? and "); } sb.setLength(sb.length() - 5); - if (bmd.hasVersionNoPropertyType()) { + if (optimisticLockHandling && bmd.hasVersionNoPropertyType()) { PropertyType pt = bmd.getVersionNoPropertyType(); sb.append(" and ").append(pt.getColumnName()).append(" = ?"); } - if (bmd.hasTimestampPropertyType()) { + if (optimisticLockHandling && bmd.hasTimestampPropertyType()) { PropertyType pt = bmd.getTimestampPropertyType(); sb.append(" and ").append(pt.getColumnName()).append(" = ?"); } return sb.toString(); } + //========================================================================== + // ========= + // Execute Status Log + // ================== + protected void log(String msg) { + XLog.log(msg); + } + + protected boolean isLogEnabled() { + return XLog.isLogEnabled(); + } + + //========================================================================== + // ========= + // Accessor + // ======== protected boolean isVersionNoAutoIncrementOnMemory() { return versionNoAutoIncrementOnMemory; } @@ -223,11 +237,7 @@ this.propertyNames = propertyNames; } - public boolean isCheckSingleRowUpdate() { - return checkSingleRowUpdate; + public void setOptimisticLockHandling(boolean optimisticLockHandling) { + this.optimisticLockHandling = optimisticLockHandling; } - - public void setCheckSingleRowUpdate(boolean resultCheck) { - this.checkSingleRowUpdate = resultCheck; - } } Modified: notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/s2dao/internal/sqlcommand/InternalUpdateBatchAutoStaticCommand.java =================================================================== --- notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/s2dao/internal/sqlcommand/InternalUpdateBatchAutoStaticCommand.java 2008-12-27 22:11:51 UTC (rev 1627) +++ notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/s2dao/internal/sqlcommand/InternalUpdateBatchAutoStaticCommand.java 2008-12-27 22:13:37 UTC (rev 1628) @@ -21,10 +21,10 @@ // =========== public InternalUpdateBatchAutoStaticCommand(DataSource dataSource, StatementFactory statementFactory, BeanMetaData beanMetaData, - String[] propertyNames, boolean returningRows, + String[] propertyNames, boolean optimisticLockHandling, boolean versionNoAutoIncrementOnMemory) { super(dataSource, statementFactory, beanMetaData, propertyNames, - returningRows, versionNoAutoIncrementOnMemory); + optimisticLockHandling, versionNoAutoIncrementOnMemory); } //========================================================================== Modified: notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/s2dao/internal/sqlcommand/InternalUpdateDynamicCommand.java =================================================================== --- notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/s2dao/internal/sqlcommand/InternalUpdateDynamicCommand.java 2008-12-27 22:11:51 UTC (rev 1627) +++ notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/s2dao/internal/sqlcommand/InternalUpdateDynamicCommand.java 2008-12-27 22:13:37 UTC (rev 1628) @@ -28,11 +28,16 @@ // ======= public Object execute(Object args[]) { final CommandContext ctx = apply(args); - final InternalBasicUpdateHandler updateHandler = new InternalBasicUpdateHandler( - getDataSource(), ctx.getSql(), getStatementFactory()); - Object[] bindVariables = ctx.getBindVariables(); + final InternalBasicUpdateHandler updateHandler = createBasicUpdateHandler(ctx); + final Object[] bindVariables = ctx.getBindVariables(); updateHandler.setLoggingMessageSqlArgs(bindVariables); return new Integer(updateHandler.execute(bindVariables, ctx .getBindVariableTypes())); } + + protected InternalBasicUpdateHandler createBasicUpdateHandler( + CommandContext ctx) { + return new InternalBasicUpdateHandler(getDataSource(), ctx.getSql(), + getStatementFactory()); + } } Modified: notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/s2dao/internal/sqlcommand/InternalUpdateQueryAutoDynamicCommand.java =================================================================== --- notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/s2dao/internal/sqlcommand/InternalUpdateQueryAutoDynamicCommand.java 2008-12-27 22:11:51 UTC (rev 1627) +++ notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/s2dao/internal/sqlcommand/InternalUpdateQueryAutoDynamicCommand.java 2008-12-27 22:13:37 UTC (rev 1628) @@ -10,6 +10,7 @@ import javax.sql.DataSource; import jp.sf.pal.notepad.db.allcommon.Entity; +import jp.sf.pal.notepad.db.allcommon.bhv.core.SqlExecution; import jp.sf.pal.notepad.db.allcommon.cbean.ConditionBean; import jp.sf.pal.notepad.db.allcommon.dbmeta.DBMeta; import jp.sf.pal.notepad.db.allcommon.dbmeta.DBMetaInstanceHandler; @@ -27,7 +28,8 @@ /** * @author DBFlute(AutoGenerator) */ -public class InternalUpdateQueryAutoDynamicCommand implements SqlCommand { +public class InternalUpdateQueryAutoDynamicCommand implements SqlCommand, + SqlExecution { //========================================================================== // ========= @@ -209,7 +211,7 @@ String[] argNames, Class[] argTypes, Object[] args) { CommandContext context; { - InternalSqlParser parser = new InternalSqlParser(twoWaySql); + InternalSqlParser parser = new InternalSqlParser(twoWaySql, true); Node node = parser.parse(); InternalCommandContextCreator creator = new InternalCommandContextCreator( argNames, argTypes); Modified: notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/s2dao/internal/sqlhandler/InternalAbstractAutoHandler.java =================================================================== --- notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/s2dao/internal/sqlhandler/InternalAbstractAutoHandler.java 2008-12-27 22:11:51 UTC (rev 1627) +++ notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/s2dao/internal/sqlhandler/InternalAbstractAutoHandler.java 2008-12-27 22:13:37 UTC (rev 1628) @@ -10,12 +10,14 @@ import javax.sql.DataSource; +import jp.sf.pal.notepad.db.allcommon.exception.EntityAlreadyUpdatedException; +import jp.sf.pal.notepad.db.allcommon.util.SimpleTypeUtil; + import org.seasar.dao.BeanMetaData; import org.seasar.extension.jdbc.PropertyType; import org.seasar.extension.jdbc.StatementFactory; import org.seasar.extension.jdbc.ValueType; import org.seasar.framework.beans.PropertyDesc; -import org.seasar.framework.util.IntegerConversionUtil; /** * @author DBFlute(AutoGenerator) @@ -38,8 +40,10 @@ protected PropertyType[] propertyTypes; - protected boolean versionNoAutoIncrementOnMemory = true; + protected boolean optimisticLockHandling; + protected boolean versionNoAutoIncrementOnMemory; + //========================================================================== // ========= // Constructor @@ -52,6 +56,10 @@ this.propertyTypes = propertyTypes; } + //========================================================================== + // ========= + // Execute + // ======= public int execute(Object[] args) { Connection connection = getConnection(); try { @@ -77,6 +85,9 @@ } finally { close(ps); } + if (optimisticLockHandling && ret != 1) { + throw createEntityAlreadyUpdatedException(bean, ret); + } postUpdateBean(bean, ret); return ret; } @@ -96,12 +107,25 @@ } } + protected EntityAlreadyUpdatedException createEntityAlreadyUpdatedException( + Object bean, int rows) { + return new EntityAlreadyUpdatedException(bean, rows); + } + + //========================================================================== + // ========= + // Pre/Post Bean + // ============= protected void preUpdateBean(Object bean) { } protected void postUpdateBean(Object bean, int ret) { } + //========================================================================== + // ========= + // Bind Setupper + // ============= protected abstract void setupBindVariables(Object bean); protected void setupInsertBindVariables(Object bean) { @@ -149,7 +173,7 @@ if (value == null) { continue;// because of 'VERSION_NO = VERSION_NO + 1' } - int intValue = IntegerConversionUtil.toPrimitiveInt(value) + 1; + int intValue = SimpleTypeUtil.toPrimitiveInt(value) + 1; setVersionNo(new Integer(intValue)); varList.add(getVersionNo()); } else { @@ -182,13 +206,13 @@ varList.add(pd.getValue(bean)); varValueTypeList.add(pt.getValueType()); } - if (bmd.hasVersionNoPropertyType()) { + if (optimisticLockHandling && bmd.hasVersionNoPropertyType()) { PropertyType pt = bmd.getVersionNoPropertyType(); PropertyDesc pd = pt.getPropertyDesc(); varList.add(pd.getValue(bean)); varValueTypeList.add(pt.getValueType()); } - if (bmd.hasTimestampPropertyType()) { + if (optimisticLockHandling && bmd.hasTimestampPropertyType()) { PropertyType pt = bmd.getTimestampPropertyType(); PropertyDesc pd = pt.getPropertyDesc(); varList.add(pd.getValue(bean)); @@ -260,6 +284,14 @@ this.propertyTypes = propertyTypes; } + public boolean isOptimisticLockHandling() { + return optimisticLockHandling; + } + + public void setOptimisticLockHandling(boolean optimisticLockHandling) { + this.optimisticLockHandling = optimisticLockHandling; + } + protected boolean isVersionNoAutoIncrementOnMemory() { return versionNoAutoIncrementOnMemory; } Modified: notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/s2dao/internal/sqlhandler/InternalAbstractBatchAutoHandler.java =================================================================== --- notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/s2dao/internal/sqlhandler/InternalAbstractBatchAutoHandler.java 2008-12-27 22:11:51 UTC (rev 1627) +++ notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/s2dao/internal/sqlhandler/InternalAbstractBatchAutoHandler.java 2008-12-27 22:13:37 UTC (rev 1628) @@ -9,6 +9,11 @@ import javax.sql.DataSource; +import jp.sf.pal.notepad.db.allcommon.DBDef; +import jp.sf.pal.notepad.db.allcommon.exception.BatchEntityAlreadyUpdatedException; +import jp.sf.pal.notepad.db.allcommon.exception.EntityAlreadyDeletedException; +import jp.sf.pal.notepad.db.allcommon.exception.EntityDuplicatedException; + import org.seasar.dao.BeanMetaData; import org.seasar.extension.jdbc.PropertyType; import org.seasar.extension.jdbc.StatementFactory; @@ -41,6 +46,39 @@ // ========= // Execute // ======= + public int execute(Object[] args) { + List list = null; + if (args[0] instanceof Object[]) { + list = Arrays.asList((Object[]) args[0]); + } else if (args[0] instanceof List) { + list = (List) args[0]; + } + if (list == null) { + throw new IllegalArgumentException("args[0]"); + } + int[] ret = execute(list); + int updatedRow = 0; + for (int i = 0; i < ret.length; i++) { + if (ret[i] > 0) { + updatedRow += ret[i]; + } + } + return updatedRow; + } + + public int[] executeBatch(Object[] args) { + List list = null; + if (args[0] instanceof Object[]) { + list = Arrays.asList((Object[]) args[0]); + } else if (args[0] instanceof List) { + list = (List) args[0]; + } + if (list == null) { + throw new IllegalArgumentException("args[0]"); + } + return execute(list); + } + public int[] execute(List list, Class[] argTypes) { return execute(list); } @@ -63,7 +101,9 @@ final Object bean = (Object) iter.next(); prepareBatchElement(ps, bean); } - return executeBatch(ps, list); + final int[] result = executeBatch(ps, list); + handleBatchUpdateResultWithOptimisticLock(ps, list, result); + return result; } finally { close(ps); } @@ -74,46 +114,100 @@ // postBatchUpdateBean(...); } - public int execute(Object[] args) { - List list = null; - if (args[0] instanceof Object[]) { - list = Arrays.asList((Object[]) args[0]); - } else if (args[0] instanceof List) { - list = (List) args[0]; + protected void prepareBatchElement(PreparedStatement ps, Object bean) { + setupBindVariables(bean); + logSql(getBindVariables(), getArgTypes(getBindVariables())); + bindArgs(ps, getBindVariables(), getBindVariableValueTypes()); + addBatch(ps); + } + + //========================================================================== + // ========= + // Optimistic Lock + // =============== + protected void handleBatchUpdateResultWithOptimisticLock( + PreparedStatement ps, List list, int[] result) { + if (DBDef.isCurrentDef(DBDef.Oracle)) { + final int updateCount; + try { + updateCount = ps.getUpdateCount(); + } catch (SQLException e) { + handleSQLException(e, ps); + return; // Unreachable! + } + handleBatchUpdateResultWithOptimisticLockByUpdateCount(list, + updateCount); + } else { + handleBatchUpdateResultWithOptimisticLockByResult(list, result); } - if (list == null) { - throw new IllegalArgumentException("args[0]"); + } + + protected void handleBatchUpdateResultWithOptimisticLockByUpdateCount( + List list, int updateCount) { + if (list.isEmpty()) { + return;// for Safety! } - int[] ret = execute(list); - int updatedRow = 0; - for (int i = 0; i < ret.length; i++) { - if (ret[i] > 0) { - updatedRow += ret[i]; + if (updateCount < 0) { + return;// for Safety! + } + final int entityCount = list.size(); + if (updateCount < entityCount) { + if (isOptimisticLockHandling()) { + throw new BatchEntityAlreadyUpdatedException(list.get(0), 0, + updateCount); + } else { + String msg = "The entity have already deleted:"; + msg = msg + " updateCount=" + updateCount; + msg = msg + " entityCount=" + entityCount; + msg = msg + " allEntities=" + list; + throw new EntityAlreadyDeletedException(msg); } } - return updatedRow; } - public int[] executeBatch(Object[] args) { - List list = null; - if (args[0] instanceof Object[]) { - list = Arrays.asList((Object[]) args[0]); - } else if (args[0] instanceof List) { - list = (List) args[0]; + protected void handleBatchUpdateResultWithOptimisticLockByResult( + List list, int[] result) { + if (list.isEmpty()) { + return;// for Safety! } - if (list == null) { - throw new IllegalArgumentException("args[0]"); + final int[] updatedCountArray = result; + final int entityCount = list.size(); + int index = 0; + boolean alreadyUpdated = false; + for (int oneUpdateCount : updatedCountArray) { + if (entityCount <= index) { + break;// for Safety! + } + if (oneUpdateCount == 0) { + alreadyUpdated = true; + break; + } else if (oneUpdateCount > 1) { + String msg = "The entity updated two or more records in batch update:"; + msg = msg + " entity=" + list.get(index); + msg = msg + " updatedCount=" + oneUpdateCount; + msg = msg + " allEntities=" + list; + throw new EntityDuplicatedException(msg); + } + ++index; } - return execute(list); + if (alreadyUpdated) { + int updateCount = 0; + for (int oneUpdateCount : updatedCountArray) { + updateCount = updateCount + oneUpdateCount; + } + if (isOptimisticLockHandling()) { + throw new BatchEntityAlreadyUpdatedException(list.get(index), + 0, updateCount); + } else { + String msg = "The entity have already deleted:"; + msg = msg + " entity=" + list.get(index); + msg = msg + " updateCount=" + updateCount; + msg = msg + " allEntities=" + list; + throw new EntityAlreadyDeletedException(msg); + } + } } - protected void prepareBatchElement(PreparedStatement ps, Object bean) { - setupBindVariables(bean); - logSql(getBindVariables(), getArgTypes(getBindVariables())); - bindArgs(ps, getBindVariables(), getBindVariableValueTypes()); - addBatch(ps); - } - //========================================================================== // ========= // JDBC Delegator Modified: notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/s2dao/internal/sqlhandler/InternalBasicHandler.java =================================================================== --- notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/s2dao/internal/sqlhandler/InternalBasicHandler.java 2008-12-27 22:11:51 UTC (rev 1627) +++ notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/s2dao/internal/sqlhandler/InternalBasicHandler.java 2008-12-27 22:13:37 UTC (rev 1628) @@ -9,6 +9,7 @@ import javax.sql.DataSource; import jp.sf.pal.notepad.db.allcommon.CallbackContext; +import jp.sf.pal.notepad.db.allcommon.DBDef; import jp.sf.pal.notepad.db.allcommon.DBFluteConfig; import jp.sf.pal.notepad.db.allcommon.InternalMapContext; import jp.sf.pal.notepad.db.allcommon.QLog; @@ -25,7 +26,6 @@ import org.seasar.extension.jdbc.StatementFactory; import org.seasar.extension.jdbc.ValueType; import org.seasar.extension.jdbc.types.ValueTypes; -import org.seasar.framework.exception.SQLRuntimeException; /** * @author DBFlute(AutoGenerator) @@ -73,7 +73,7 @@ return; } for (int i = 0; i < args.length; ++i) { - ValueType valueType = getValueType(argTypes[i]); + final ValueType valueType = findValueType(args[i], argTypes[i]); try { valueType.bindValue(ps, i + 1, args[i]); } catch (SQLException e) { @@ -82,6 +82,19 @@ } } + protected ValueType findValueType(Object arg, Class argType) { + ValueType valueType = ValueTypes.getValueType(arg); + if (valueType != null) { + return valueType; + } + valueType = ValueTypes.getValueType(argType); + if (valueType != null) { + return valueType; + } + String msg = "Unknown type¡§argType=" + argType + " args=" + arg; + throw new IllegalStateException(msg); + } + protected Class[] getArgTypes(Object[] args) { if (args == null) { return null; @@ -151,10 +164,6 @@ return InternalBindVariableUtil.getBindVariableText(bindVariable); } - protected ValueType getValueType(Class clazz) { - return ValueTypes.getValueType(clazz); - } - //========================================================================== // ========= // Exception Handler @@ -194,9 +203,6 @@ public void handleSQLException(SQLException e, Statement statement, boolean uniqueConstraintValid, String completeSql) { - if (isSqlExceptionOldStyleHandling()) { - throw new SQLRuntimeException(e); - } if (uniqueConstraintValid && isUniqueConstraintException(e)) { throwEntityAlreadyExistsException(e, statement, completeSql); } @@ -217,10 +223,6 @@ .getUniqueConstraintDeterminator(); } - protected boolean isSqlExceptionOldStyleHandling() { - return DBFluteConfig.getInstance().isSqlExceptionOldStyleHandling(); - } - protected void throwEntityAlreadyExistsException(SQLException e, Statement statement, String completeSql) { String msg = "Look! Read the message below." + getLineSeparator(); @@ -560,7 +562,7 @@ // ========= // Assist Helper // ============= - // It needs this method if the target database doest not support line + // It needs this method if the target database does not support line // comment. protected String removeLineComment(final String sql) { // With removing CR! if (sql == null || sql.trim().length() == 0) { @@ -578,7 +580,8 @@ } sb.append(line).append("\n"); } - return sb.toString(); + final String filteredSql = sb.toString(); + return filteredSql.substring(0, filteredSql.lastIndexOf("\n")); } //========================================================================== @@ -606,9 +609,17 @@ } public void setSql(String sql) { + if (isRemoveLineCommentFromSql()) { + sql = removeLineComment(sql); + } this.sql = sql; } + protected boolean isRemoveLineCommentFromSql() { + // Because the MS-Access does not support line comments. + return DBDef.isCurrentDef(DBDef.MSAccess); + } + public StatementFactory getStatementFactory() { return statementFactory; } Modified: notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/s2dao/internal/sqlhandler/InternalBasicSelectHandler.java =================================================================== --- notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/s2dao/internal/sqlhandler/InternalBasicSelectHandler.java 2008-12-27 22:11:51 UTC (rev 1627) +++ notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/s2dao/internal/sqlhandler/InternalBasicSelectHandler.java 2008-12-27 22:13:37 UTC (rev 1628) @@ -45,8 +45,7 @@ return execute(args, getArgTypes(args)); } - @SuppressWarnings("unchecked") - public Object execute(Object[] args, Class[] argTypes) { + public Object execute(Object[] args, Class[] argTypes) { Connection conn = getConnection(); try { return execute(conn, args, argTypes); @@ -55,8 +54,7 @@ } } - @SuppressWarnings("unchecked") - public Object execute(Connection conn, Object[] args, Class[] argTypes) { + public Object execute(Connection conn, Object[] args, Class[] argTypes) { logSql(args, argTypes); PreparedStatement ps = null; try { Modified: notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/s2dao/internal/sqlhandler/InternalBasicUpdateHandler.java =================================================================== --- notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/s2dao/internal/sqlhandler/InternalBasicUpdateHandler.java 2008-12-27 22:11:51 UTC (rev 1627) +++ notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/s2dao/internal/sqlhandler/InternalBasicUpdateHandler.java 2008-12-27 22:13:37 UTC (rev 1628) @@ -29,8 +29,7 @@ return execute(args, getArgTypes(args)); } - @SuppressWarnings("unchecked") - public int execute(Object[] args, Class[] argTypes) { + public int execute(Object[] args, Class[] argTypes) { Connection connection = getConnection(); try { return execute(connection, args, argTypes); @@ -39,8 +38,7 @@ } } - @SuppressWarnings("unchecked") - public int execute(Connection connection, Object[] args, Class[] argTypes) { + public int execute(Connection connection, Object[] args, Class[] argTypes) { logSql(args, argTypes); PreparedStatement ps = prepareStatement(connection); try { Modified: notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/s2dao/internal/sqlhandler/InternalInsertAutoHandler.java =================================================================== --- notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/s2dao/internal/sqlhandler/InternalInsertAutoHandler.java 2008-12-27 22:11:51 UTC (rev 1627) +++ notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/s2dao/internal/sqlhandler/InternalInsertAutoHandler.java 2008-12-27 22:13:37 UTC (rev 1628) @@ -20,6 +20,7 @@ StatementFactory statementFactory, BeanMetaData beanMetaData, PropertyType[] propertyTypes) { super(dataSource, statementFactory, beanMetaData, propertyTypes); + setOptimisticLockHandling(false); } //========================================================================== Modified: notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/s2dao/internal/sqlhandler/InternalInsertBatchAutoHandler.java =================================================================== --- notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/s2dao/internal/sqlhandler/InternalInsertBatchAutoHandler.java 2008-12-27 22:11:51 UTC (rev 1627) +++ notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/s2dao/internal/sqlhandler/InternalInsertBatchAutoHandler.java 2008-12-27 22:13:37 UTC (rev 1628) @@ -19,8 +19,8 @@ public InternalInsertBatchAutoHandler(DataSource dataSource, StatementFactory statementFactory, BeanMetaData beanMetaData, PropertyType[] propertyTypes) { - super(dataSource, statementFactory, beanMetaData, propertyTypes); + setOptimisticLockHandling(false); } //========================================================================== Modified: notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/s2dao/internal/sqlhandler/InternalProcedureHandler.java =================================================================== --- notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/s2dao/internal/sqlhandler/InternalProcedureHandler.java 2008-12-27 22:11:51 UTC (rev 1627) +++ notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/s2dao/internal/sqlhandler/InternalProcedureHandler.java 2008-12-27 22:13:37 UTC (rev 1628) @@ -12,6 +12,7 @@ import javax.sql.DataSource; +import jp.sf.pal.notepad.db.allcommon.helper.StringKeyMap; import jp.sf.pal.notepad.db.allcommon.s2dao.internal.various.InternalProcedureMetaData; import jp.sf.pal.notepad.db.allcommon.s2dao.internal.various.InternalProcedureParameterType; @@ -21,7 +22,6 @@ import org.seasar.extension.jdbc.ValueType; import org.seasar.extension.jdbc.impl.PropertyTypeImpl; import org.seasar.extension.jdbc.types.ValueTypes; -import org.seasar.framework.util.CaseInsensitiveMap; /** * @author DBFlute(AutoGenerator) @@ -220,10 +220,9 @@ protected static abstract class InternalAbstractMapResultSetHandler implements ResultSetHandler { - @SuppressWarnings("unchecked") protected Map createRow(ResultSet rs, PropertyType[] propertyTypes) throws SQLException { - Map row = new CaseInsensitiveMap(); + Map row = StringKeyMap.createAsFlexible(); for (int i = 0; i < propertyTypes.length; ++i) { Object value = propertyTypes[i].getValueType().getValue(rs, i + 1); Modified: notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/s2dao/internal/sqlhandler/InternalUpdateAutoHandler.java =================================================================== --- notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/s2dao/internal/sqlhandler/InternalUpdateAutoHandler.java 2008-12-27 22:11:51 UTC (rev 1627) +++ notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/s2dao/internal/sqlhandler/InternalUpdateAutoHandler.java 2008-12-27 22:13:37 UTC (rev 1628) @@ -2,8 +2,6 @@ import javax.sql.DataSource; -import jp.sf.pal.notepad.db.allcommon.exception.EntityAlreadyUpdatedException; - import org.seasar.dao.BeanMetaData; import org.seasar.extension.jdbc.PropertyType; import org.seasar.extension.jdbc.StatementFactory; @@ -17,12 +15,6 @@ // ========= // Constructor // =========== - private boolean checkSingleRowUpdate = true; - - //========================================================================== - // ========= - // Constructor - // =========== public InternalUpdateAutoHandler(DataSource dataSource, StatementFactory statementFactory, BeanMetaData beanMetaData, PropertyType[] propertyTypes) { @@ -41,27 +33,7 @@ @Override protected void postUpdateBean(Object bean, int ret) { - if (isCheckSingleRowUpdate() && ret < 1) { - throw createEntityAlreadyUpdatedException(bean, ret); - } updateVersionNoIfNeed(bean); updateTimestampIfNeed(bean); } - - protected EntityAlreadyUpdatedException createEntityAlreadyUpdatedException( - Object bean, int rows) { - return new EntityAlreadyUpdatedException(bean, rows); - } - - //========================================================================== - // ========= - // Accessor - // ======== - public boolean isCheckSingleRowUpdate() { - return checkSingleRowUpdate; - } - - public void setCheckSingleRowUpdate(boolean resultCheck) { - this.checkSingleRowUpdate = resultCheck; - } } Modified: notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/s2dao/internal/sqlparser/InternalSqlParser.java =================================================================== --- notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/s2dao/internal/sqlparser/InternalSqlParser.java 2008-12-27 22:11:51 UTC (rev 1627) +++ notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/s2dao/internal/sqlparser/InternalSqlParser.java 2008-12-27 22:13:37 UTC (rev 1628) @@ -45,22 +45,25 @@ // ========= // Attribute // ========= + protected String specifiedSql; + + protected boolean blockNullParameter; + protected InternalSqlTokenizer tokenizer; protected Stack nodeStack = new Stack(); - protected String specifiedSql;// Extension! - //========================================================================== // ========= // Constructor // =========== - public InternalSqlParser(String sql) { + public InternalSqlParser(String sql, boolean blockNullParameter) { sql = sql.trim(); if (sql.endsWith(";")) { sql = sql.substring(0, sql.length() - 1); } - specifiedSql = sql;// Extension! + specifiedSql = sql; + this.blockNullParameter = blockNullParameter; tokenizer = new InternalSqlTokenizer(sql); } @@ -303,12 +306,14 @@ protected AbstractNode createBindVariableNode(String expr, String testValue) {// Extension // ! - return new InternalBindVariableNode(expr, testValue, specifiedSql); + return new InternalBindVariableNode(expr, testValue, specifiedSql, + blockNullParameter); } protected AbstractNode createEmbeddedValueNode(String expr, String testValue) {// Extension // ! - return new InternalEmbeddedValueNode(expr, testValue, specifiedSql); + return new InternalEmbeddedValueNode(expr, testValue, specifiedSql, + blockNullParameter); } protected ContainerNode createIfNode(String expr) {// Extension! @@ -344,12 +349,15 @@ protected String _specifiedSql; + protected boolean _blockNullParameter; + public InternalBindVariableNode(String expression, String testValue, - String specifiedSql) { + String specifiedSql, boolean blockNullParameter) { this._expression = expression; this._testValue = testValue; this._names = InternalStringUtil.split(expression, "."); this._specifiedSql = specifiedSql; + this._blockNullParameter = blockNullParameter; } public void accept(CommandContext ctx) { @@ -360,7 +368,7 @@ valueAndType.setTargetType(clazz); setupValueAndType(valueAndType); - if (valueAndType.getTargetValue() == null) { + if (_blockNullParameter && valueAndType.getTargetValue() == null) { throwBindOrEmbeddedParameterNullValueException(valueAndType); } if (!isInScope()) { @@ -462,12 +470,15 @@ protected String _specifiedSql; + protected boolean _blockNullParameter; + public InternalEmbeddedValueNode(String expression, String testValue, - String specifiedSql) { + String specifiedSql, boolean blockNullParameter) { this._expression = expression; this._testValue = testValue; this._names = InternalStringUtil.split(expression, "."); this._specifiedSql = specifiedSql; + this._blockNullParameter = blockNullParameter; } public void accept(CommandContext ctx) { @@ -478,7 +489,7 @@ valueAndType.setTargetType(clazz); setupValueAndType(valueAndType); - if (valueAndType.getTargetValue() == null) { + if (_blockNullParameter && valueAndType.getTargetValue() == null) { throwBindOrEmbeddedParameterNullValueException(valueAndType); } if (!isInScope()) { @@ -1276,7 +1287,8 @@ String[] argNames, Class[] argTypes, Object[] args) { final CommandContext context; { - final InternalSqlParser parser = new InternalSqlParser(twoWaySql); + final InternalSqlParser parser = new InternalSqlParser(twoWaySql, + false); final Node node = parser.parse(); final InternalCommandContextCreator creator = new InternalCommandContextCreator( argNames, argTypes); Added: notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/s2dao/internal/various/InternalIdentifierAbstractGenerator.java =================================================================== --- notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/s2dao/internal/various/InternalIdentifierAbstractGenerator.java (rev 0) +++ notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/s2dao/internal/various/InternalIdentifierAbstractGenerator.java 2008-12-27 22:13:37 UTC (rev 1628) @@ -0,0 +1,146 @@ +package jp.sf.pal.notepad.db.allcommon.s2dao.internal.various; + +import java.sql.CallableStatement; +import java.sql.Connection; +import java.sql.PreparedStatement; +import java.sql.ResultSet; +import java.sql.SQLException; +import java.sql.Statement; + +import javax.sql.DataSource; + +import jp.sf.pal.notepad.db.allcommon.s2dao.internal.sqlhandler.InternalBasicSelectHandler; +import jp.sf.pal.notepad.db.allcommon.s2dao.internal.sqlhandler.InternalBasicHandler.SQLExceptionHandler; + +import org.seasar.dao.Dbms; +import org.seasar.dao.IdentifierGenerator; +import org.seasar.extension.jdbc.PropertyType; +import org.seasar.extension.jdbc.ResultSetHandler; +import org.seasar.extension.jdbc.StatementFactory; +import org.seasar.extension.jdbc.ValueType; +import org.seasar.framework.beans.PropertyDesc; + +/** + * @author DBFlute(AutoGenerator) + */ +public abstract class InternalIdentifierAbstractGenerator implements + IdentifierGenerator { + + //========================================================================== + // ========= + // Attribute + // ========= + protected PropertyType propertyType; + + protected Dbms dbms; + + protected ResultSetHandler resultSetHandler; + + //========================================================================== + // ========= + // Constructor + // =========== + public InternalIdentifierAbstractGenerator(PropertyType propertyType, + Dbms dbms) { + this.propertyType = propertyType; + this.dbms = dbms; + resultSetHandler = new InternalIdentifierResultSetHandler(propertyType + .getValueType()); + } + + //========================================================================== + // ========= + // Assist Helper + // ============= + protected Object executeSql(DataSource ds, String sql, Object[] args) { + InternalBasicSelectHandler selectHandler = createSelectHandler(ds, sql); + if (args != null) { + selectHandler.setLoggingMessageSqlArgs(args); + } + return selectHandler.execute(args); + } + + protected InternalBasicSelectHandler createSelectHandler(DataSource ds, + String sql) { + // Use original statement factory for identifier generator. + return new InternalBasicSelectHandler(ds, sql, resultSetHandler, + createStatementFactory(ds, sql)); + } + + protected StatementFactory createStatementFactory(DataSource ds, String sql) { + return new InternalIdentifierGeneratorStatementFactory(); + } + + protected void reflectIdentifier(Object bean, Object value) { + if (propertyType == null) { + String msg = "The arguement[propertyType] should not be null: value=" + + value; + throw new IllegalArgumentException(msg); + } + PropertyDesc pd = propertyType.getPropertyDesc(); + pd.setValue(bean, value); + } + + //========================================================================== + // ========= + // Result Set Handler + // ================== + protected static class InternalIdentifierResultSetHandler implements + ResultSetHandler { + private ValueType valueType; + + public InternalIdentifierResultSetHandler(ValueType valueType) { + this.valueType = valueType; + } + + public Object handle(ResultSet rs) throws SQLException { + if (rs.next()) { + return valueType.getValue(rs, 1); + } + return null; + } + } + + //========================================================================== + // ========= + // Statement Factory + // ================= + protected static class InternalIdentifierGeneratorStatementFactory + implements StatementFactory { + public PreparedStatement createPreparedStatement(Connection conn, + String sql) { + try { + return conn.prepareStatement(sql); + } catch (SQLException e) { + handleSQLException(e, null); + return null; // Unreachable! + } + } + + public CallableStatement createCallableStatement(Connection conn, + String sql) { + try { + return conn.prepareCall(sql); + } catch (SQLException e) { + handleSQLException(e, null); + return null; // Unreachable! + } + } + + protected void handleSQLException(SQLException e, Statement statement) { + new SQLExceptionHandler().handleSQLException(e, statement); + } + } + + //========================================================================== + // ========= + // Accessor + // ======== + public String getPropertyName() { + return propertyType.getPropertyName(); + } + + public Dbms getDbms() { + return dbms; + } +} Property changes on: notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/s2dao/internal/various/InternalIdentifierAbstractGenerator.java ___________________________________________________________________ Name: svn:eol-style + native Added: notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/s2dao/internal/various/InternalIdentifierAssignedGenerator.java =================================================================== --- notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/s2dao/internal/various/InternalIdentifierAssignedGenerator.java (rev 0) +++ notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/s2dao/internal/various/InternalIdentifierAssignedGenerator.java 2008-12-27 22:13:37 UTC (rev 1628) @@ -0,0 +1,33 @@ +package jp.sf.pal.notepad.db.allcommon.s2dao.internal.various; + +import javax.sql.DataSource; + +import org.seasar.dao.Dbms; +import org.seasar.extension.jdbc.PropertyType; + +/** + * @author DBFlute(AutoGenerator) + */ +public class InternalIdentifierAssignedGenerator extends + InternalIdentifierAbstractGenerator { + + //========================================================================== + // ========= + // Constructor + // =========== + public InternalIdentifierAssignedGenerator(PropertyType propertyType, + Dbms dbms) { + super(propertyType, dbms); + } + + //========================================================================== + // ========= + // Implementation + // ============== + public void setIdentifier(Object bean, DataSource ds) { + } + + public boolean isSelfGenerate() { + return true; + } +} Property changes on: notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/s2dao/internal/various/InternalIdentifierAssignedGenerator.java ___________________________________________________________________ Name: svn:eol-style + native Added: notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/s2dao/internal/various/InternalIdentifierGeneratorFactory.java =================================================================== --- notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/s2dao/internal/various/InternalIdentifierGeneratorFactory.java (rev 0) +++ notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/s2dao/internal/various/InternalIdentifierGeneratorFactory.java 2008-12-27 22:13:37 UTC (rev 1628) @@ -0,0 +1,105 @@ +package jp.sf.pal.notepad.db.allcommon.s2dao.internal.various; + +import java.lang.reflect.Constructor; +import java.util.HashMap; +import java.util.Map; + +import jp.sf.pal.notepad.db.allcommon.util.SimpleStringUtil; + +import org.seasar.dao.Dbms; +import org.seasar.dao.IdentifierGenerator; +import org.seasar.extension.jdbc.PropertyType; +import org.seasar.framework.beans.BeanDesc; +import org.seasar.framework.beans.PropertyDesc; +import org.seasar.framework.beans.factory.BeanDescFactory; +import org.seasar.framework.util.ClassUtil; +import org.seasar.framework.util.ConstructorUtil; + +/** + * @author DBFlute(AutoGenerator) + */ +public class InternalIdentifierGeneratorFactory { + + //========================================================================== + // ========= + // Attribute + // ========= + private static Map> generatorClasses = new HashMap>(); + + static { + addIdentifierGeneratorClass("assigned", + InternalIdentifierAssignedGenerator.class); + addIdentifierGeneratorClass("identity", + InternalIdentifierIdentityGenerator.class); + addIdentifierGeneratorClass("sequence", + InternalIdentifierSequenceGenerator.class); + } + + //========================================================================== + // ========= + // Constructor + // =========== + private InternalIdentifierGeneratorFactory() { + } + + //========================================================================== + // ========= + // Identifier Generator + // ==================== + public static void addIdentifierGeneratorClass(String name, Class clazz) { + generatorClasses.put(name, clazz); + } + + public static IdentifierGenerator createIdentifierGenerator( + PropertyType propertyType, Dbms dbms) { + return createIdentifierGenerator(propertyType, dbms, null); + } + + public static IdentifierGenerator createIdentifierGenerator( + PropertyType propertyType, Dbms dbms, String annotation) { + if (propertyType == null) { + String msg = "The argument[propertyType] should not be null: dbms=" + + dbms + " annotation=" + annotation; + throw new IllegalArgumentException(msg); + } + if (dbms == null) { + String msg = "The argument[dbms] should not be null: propertyType=" + + propertyType + " annotation=" + annotation; + throw new IllegalArgumentException(msg); + } + if (annotation == null) { + return new InternalIdentifierAssignedGenerator(propertyType, dbms); + } + String[] array = SimpleStringUtil.split(annotation, "=, "); + Class clazz = getGeneratorClass(array[0]); + IdentifierGenerator generator = createIdentifierGenerator(clazz, + propertyType, dbms); + for (int i = 1; i < array.length; i += 2) { + setProperty(generator, array[i].trim(), array[i + 1].trim()); + } + return generator; + } + + protected static Class getGeneratorClass(String name) { + Class clazz = generatorClasses.get(name); + if (clazz != null) { + return clazz; + } + return ClassUtil.forName(name); + } + + protected static IdentifierGenerator createIdentifierGenerator( + Class clazz, PropertyType propertyType, Dbms dbms) { + Constructor constructor = ClassUtil.getConstructor(clazz, + new Class[] { PropertyType.class, Dbms.class }); + return (IdentifierGenerator) ConstructorUtil.newInstance(constructor, + new Object[] { propertyType, dbms }); + } + + protected static void setProperty(IdentifierGenerator generator, + String propertyName, String value) { + BeanDesc beanDesc = BeanDescFactory.getBeanDesc(generator.getClass()); + PropertyDesc pd = beanDesc.getPropertyDesc(propertyName); + pd.setValue(generator, value); + } +} Property changes on: notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/s2dao/internal/various/InternalIdentifierGeneratorFactory.java ___________________________________________________________________ Name: svn:eol-style + native Added: notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/s2dao/internal/various/InternalIdentifierIdentityGenerator.java =================================================================== --- notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/s2dao/internal/various/InternalIdentifierIdentityGenerator.java (rev 0) +++ notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/s2dao/internal/various/InternalIdentifierIdentityGenerator.java 2008-12-27 22:13:37 UTC (rev 1628) @@ -0,0 +1,35 @@ +package jp.sf.pal.notepad.db.allcommon.s2dao.internal.various; + +import javax.sql.DataSource; + +import org.seasar.dao.Dbms; +import org.seasar.extension.jdbc.PropertyType; + +/** + * @author DBFlute(AutoGenerator) + */ +public class InternalIdentifierIdentityGenerator extends + InternalIdentifierAbstractGenerator { + + //========================================================================== + // ========= + // Constructor + // =========== + public InternalIdentifierIdentityGenerator(PropertyType propertyType, + Dbms dbms) { + super(propertyType, dbms); + } + + //========================================================================== + // ========= + // Implementation + // ============== + public void setIdentifier(Object bean, DataSource ds) { + Object value = executeSql(ds, getDbms().getIdentitySelectString(), null); + reflectIdentifier(bean, value); + } + + public boolean isSelfGenerate() { + return false; + } +} Property changes on: notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/s2dao/internal/various/InternalIdentifierIdentityGenerator.java ___________________________________________________________________ Name: svn:eol-style + native Added: notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/s2dao/internal/various/InternalIdentifierSequenceGenerator.java =================================================================== --- notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/s2dao/internal/various/InternalIdentifierSequenceGenerator.java (rev 0) +++ notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/s2dao/internal/various/InternalIdentifierSequenceGenerator.java 2008-12-27 22:13:37 UTC (rev 1628) @@ -0,0 +1,116 @@ +package jp.sf.pal.notepad.db.allcommon.s2dao.internal.various; + +import java.util.HashMap; + +import javax.sql.DataSource; + +import jp.sf.pal.notepad.db.allcommon.util.SimpleTypeUtil; + +import org.seasar.dao.Dbms; +import org.seasar.extension.jdbc.PropertyType; + +/** + * @author DBFlute(AutoGenerator) + */ +public class InternalIdentifierSequenceGenerator extends + InternalIdentifierAbstractGenerator { + + // - - - - - - - - - - + // [Unused on DBFlute] + // - - - - - - - - - - + + //========================================================================== + // ========= + // Attribute + // ========= + private String sequenceName; + + private long allocationSize = 0; + + private HashMap idContextMap = new HashMap(); + + //========================================================================== + // ========= + // Constructor + // =========== + public InternalIdentifierSequenceGenerator(PropertyType propertyType, + Dbms dbms) { + super(propertyType, dbms); + } + + //========================================================================== + // ========= + // Implementation + // ============== + public void setIdentifier(Object bean, DataSource ds) { + reflectIdentifier(bean, getNextValue(ds)); + } + + public boolean isSelfGenerate() { + return getDbms().isSelfGenerate(); + } + + //========================================================================== + // ========= + // Next Value + // ========== + protected Object getNextValue(DataSource ds) { + if (allocationSize > 0) { + long value = getIdContext(ds).getNextValue(ds); + return new Long(value); + } + return getNewInitialValue(ds); + } + + protected Object getNewInitialValue(DataSource ds) { + return executeSql(ds, getDbms().getSequenceNextValString(sequenceName), + null); + } + + protected IdContext getIdContext(DataSource ds) { + synchronized (idContextMap) { + IdContext context = idContextMap.get(ds); + if (context == null) { + context = new IdContext(); + idContextMap.put(ds, context); + } + return context; + } + } + + public class IdContext { + protected long initialValue; + + protected long allocated = Long.MAX_VALUE; + + public synchronized long getNextValue(DataSource ds) { + if (allocated < allocationSize) { + return initialValue + allocated++; + } + initialValue = SimpleTypeUtil + .toPrimitiveLong(getNewInitialValue(ds)); + allocated = 1; + return initialValue; + } + } + + //========================================================================== + // ========= + // Accessor + // ======== + public String getSequenceName() { + return sequenceName; + } + + public void setSequenceName(String sequenceName) { + this.sequenceName = sequenceName; + } + + public long getAllocationSize() { + return allocationSize; + } + + public void setAllocationSize(long allocationSize) { + this.allocationSize = allocationSize; + } +} Property changes on: notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/s2dao/internal/various/InternalIdentifierSequenceGenerator.java ___________________________________________________________________ Name: svn:eol-style + native Modified: notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/s2dao/internal/various/InternalProcedureMetaDataFactory.java =================================================================== --- notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/s2dao/internal/various/InternalProcedureMetaDataFactory.java 2008-12-27 22:11:51 UTC (rev 1627) +++ notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/s2dao/internal/various/InternalProcedureMetaDataFactory.java 2008-12-27 22:13:37 UTC (rev 1628) @@ -7,7 +7,7 @@ import java.util.Map; import java.util.Stack; -import jp.sf.pal.notepad.db.allcommon.cbean.ConditionBeanContext; +import jp.sf.pal.notepad.db.allcommon.DBDef; import org.seasar.dao.ValueTypeFactory; import org.seasar.dao.util.TypeUtil; @@ -146,9 +146,9 @@ } final Class type = field.getType(); if (List.class.isAssignableFrom(type)) {// is for out parameter cursor. - if (ConditionBeanContext.isOracle()) { + if (DBDef.isCurrentDef(DBDef.Oracle)) { return ValueTypes.ORACLE_RESULT_SET; - } else if (ConditionBeanContext.isPostgreSql()) { + } else if (DBDef.isCurrentDef(DBDef.PostgreSQL)) { return ValueTypes.POSTGRE_RESULT_SET; } else { return ValueTypes.SERIALIZABLE_BYTE_ARRAY; Added: notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/s2dao/internal/various/InternalStatementFactory.java =================================================================== --- notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/s2dao/internal/various/InternalStatementFactory.java (rev 0) +++ notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/s2dao/internal/various/InternalStatementFactory.java 2008-12-27 22:13:37 UTC (rev 1628) @@ -0,0 +1,158 @@ +package jp.sf.pal.notepad.db.allcommon.s2dao.internal.various; + +import java.sql.CallableStatement; +import java.sql.Connection; +import java.sql.PreparedStatement; +import java.sql.SQLException; +import java.sql.Statement; + +import jp.sf.pal.notepad.db.allcommon.cbean.ConditionBean; +import jp.sf.pal.notepad.db.allcommon.cbean.ConditionBeanContext; +import jp.sf.pal.notepad.db.allcommon.cbean.outsidesql.OutsideSqlContext; +import jp.sf.pal.notepad.db.allcommon.jdbc.StatementConfig; +import jp.sf.pal.notepad.db.allcommon.s2dao.internal.sqlhandler.InternalBasicHandler.SQLExceptionHandler; + +import org.seasar.extension.jdbc.StatementFactory; + +/** + * @author DBFlute(AutoGenerator) + */ +public class InternalStatementFactory implements StatementFactory { + + //========================================================================== + // ========= + // Definition + // ========== + /** Log-instance. */ + private static final org.apache.commons.logging.Log _log = org.apache.commons.logging.LogFactory + .getLog(InternalStatementFactory.class); + + //========================================================================== + // ========= + // Attribute + // ========= + protected StatementConfig defaultStatementConfig; + + protected boolean internalDebug; + + //========================================================================== + // ========= + // Constructor + // =========== + public InternalStatementFactory() { + } + + //========================================================================== + // ========= + // Implementation + // ============== + public PreparedStatement createPreparedStatement(Connection conn, String sql) { + try { + final StatementConfig config = findStatementConfigOnThread(); + ; + final int resultSetType; + if (config != null && config.hasResultSetType()) { + resultSetType = config.getResultSetType(); + } else if (defaultStatementConfig != null + && defaultStatementConfig.hasResultSetType()) { + resultSetType = defaultStatementConfig.getResultSetType(); + } else { + resultSetType = java.sql.ResultSet.TYPE_FORWARD_ONLY; + } + final int resultSetConcurrency = java.sql.ResultSet.CONCUR_READ_ONLY; + if (internalDebug) { + _log.debug("...Creating prepareStatement(sql, " + resultSetType + + ", " + resultSetConcurrency + ")"); + } + final PreparedStatement ps = conn.prepareStatement(sql, + resultSetType, resultSetConcurrency); + if (config != null && config.hasStatementOptions()) { + if (internalDebug) { + _log.debug("...Setting statement config as request: " + + config); + } + reflectStatementOptions(config, ps); + } else { + reflectDefaultOptionsToStatementIfNeeds(ps); + } + return ps; + } catch (SQLException e) { + handleSQLException(e, null); + return null;// Unreachable! + } + } + + public CallableStatement createCallableStatement(Connection conn, String sql) { + return prepareCall(conn, sql); + } + + protected StatementConfig findStatementConfigOnThread() { + final StatementConfig config; + if (ConditionBeanContext.isExistConditionBeanOnThread()) { + final ConditionBean cb = ConditionBeanContext + .getConditionBeanOnThread(); + config = cb.getStatementConfig(); + } else if (OutsideSqlContext.isExistOutsideSqlContextOnThread()) { + final OutsideSqlContext context = OutsideSqlContext + .getOutsideSqlContextOnThread(); + config = context.getStatementConfig(); + } else { + config = null; + } + return config; + } + + protected void reflectDefaultOptionsToStatementIfNeeds(PreparedStatement ps) { + if (defaultStatementConfig != null + && defaultStatementConfig.hasStatementOptions()) { + if (internalDebug) { + _log.debug("...Setting statement config as default: " + + defaultStatementConfig); + } + reflectStatementOptions(defaultStatementConfig, ps); + return; + } + } + + protected void reflectStatementOptions(StatementConfig config, + PreparedStatement ps) { + try { + if (config.hasQueryTimeout()) { + ps.setQueryTimeout(config.getQueryTimeout()); + } + if (config.hasFetchSize()) { + ps.setFetchSize(config.getFetchSize()); + } + if (config.hasMaxRows()) { + ps.setMaxRows(config.getMaxRows()); + } + } catch (SQLException e) { + handleSQLException(e, ps); + } + } + + protected CallableStatement prepareCall(Connection conn, String sql) { + try { + return conn.prepareCall(sql); + } catch (SQLException e) { + handleSQLException(e, null); + return null;// Unreachable! + } + } + + protected void handleSQLException(SQLException e, Statement statement) { + new SQLExceptionHandler().handleSQLException(e, statement); + } + + //========================================================================== + // ========= + // Accessor + // ======== + public void setDefaultStatementConfig(StatementConfig defaultStatementConfig) { + this.defaultStatementConfig = defaultStatementConfig; + } + + public void setInternalDebug(boolean internalDebug) { + this.internalDebug = internalDebug; + } +} Property changes on: notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/s2dao/internal/various/InternalStatementFactory.java ___________________________________________________________________ Name: svn:eol-style + native Modified: notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/util/SimpleAssertUtil.java =================================================================== --- notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/util/SimpleAssertUtil.java 2008-12-27 22:11:51 UTC (rev 1627) +++ notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/util/SimpleAssertUtil.java 2008-12-27 22:13:37 UTC (rev 1628) @@ -7,11 +7,8 @@ //========================================================================== // ========= - // Assert + // Object // ====== - // ----------------------------------------------------- - // Assert Object - // ------------- /** * Assert that the object is not null. * @@ -32,9 +29,10 @@ } } - // ----------------------------------------------------- - // Assert String - // ------------- + //========================================================================== + // ========= + // String + // ====== /** * Assert that the entity is not null and not trimmed empty. * Added: notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/util/SimpleResourceUtil.java =================================================================== --- notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/util/SimpleResourceUtil.java (rev 0) +++ notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/util/SimpleResourceUtil.java 2008-12-27 22:13:37 UTC (rev 1628) @@ -0,0 +1,117 @@ +package jp.sf.pal.notepad.db.allcommon.util; + +import java.io.IOException; +import java.io.InputStream; +import java.net.URL; +import java.net.URLConnection; + +/** + * @author DBFlute(AutoGenerator) + */ +public class SimpleResourceUtil { + + //========================================================================== + // ========= + // Resource Path + // ============= + public static String getResourcePath(String path, String extension) { + if (extension == null) { + return path; + } + extension = "." + extension; + if (path.endsWith(extension)) { + return path; + } + return path.replace('.', '/') + extension; + } + + public static String getResourcePath(Class clazz) { + return clazz.getName().replace('.', '/') + ".class"; + } + + //========================================================================== + // ========= + // Resource URL + // ============ + public static URL getResourceUrl(String path) { + return getResourceUrl(path, null); + } + + public static URL getResourceUrl(String path, String extension) { + return getResourceUrl(path, extension, Thread.currentThread() + .getContextClassLoader()); + } + + public static URL getResourceUrl(String path, String extension, + ClassLoader loader) { + if (path == null || loader == null) { + return null; + } + path = getResourcePath(path, extension); + return loader.getResource(path); + } + + //========================================================================== + // ========= + // Resource Stream + // =============== + public static InputStream getResourceStream(String path) { + return getResourceStream(path, null); + } + + public static InputStream getResourceStream(String path, String extension) { + final URL url = getResourceUrl(path, extension); + return url != null ? openStream(url) : null; + } + + //========================================================================== + // ========= + // Resource Existence + // ================== + public static boolean isExist(String path) { + return getResourceUrl(path) != null; + } + + //========================================================================== + // ========= + // Assist Helper + // ============= + protected static ClassLoader getClassLoader() { + return Thread.currentThread().getContextClassLoader(); + } + + protected static InputStream openStream(URL url) { + try { + URLConnection connection = url.openConnection(); + connection.setUseCaches(false); + return connection.getInputStream(); + } catch (IOException e) { + String msg = "Failed to open the stream: url=" + url; + throw new IllegalStateException(msg, e); + } + } + + //========================================================================== + // ========= + // Assert Helper + // ============= + /** + * Assert that the object is not null. + * + * @param variableName Variable name. (NotNull) + * @param value Value. (NotNull) + * @exception IllegalArgumentException + */ + protected static void assertObjectNotNull(String variableName, Object value) { + if (variableName == null) { + String msg = "The value should not be null: variableName=" + + variableName + " value=" + value; + throw new IllegalArgumentException(msg); + } + if (value == null) { + String msg = "The value should not be null: variableName=" + + variableName; + throw new IllegalArgumentException(msg); + } + } +} Property changes on: notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/util/SimpleResourceUtil.java ___________________________________________________________________ Name: svn:eol-style + native Modified: notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/util/SimpleStringUtil.java =================================================================== --- notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/util/SimpleStringUtil.java 2008-12-27 22:11:51 UTC (rev 1627) +++ notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/util/SimpleStringUtil.java 2008-12-27 22:13:37 UTC (rev 1628) @@ -1,14 +1,20 @@ package jp.sf.pal.notepad.db.allcommon.util; +import java.util.ArrayList; +import java.util.List; +import java.util.StringTokenizer; + /** * @author DBFlute(AutoGenerator) */ public class SimpleStringUtil { + protected static final String[] EMPTY_STRINGS = new String[0]; + //========================================================================== // ========= - // String - // ====== + // Replace + // ======= public static String replace(String text, String fromText, String toText) { if (text == null || fromText == null || toText == null) { return null; @@ -32,6 +38,26 @@ } while (true); } + //========================================================================== + // ========= + // Split + // ===== + public static String[] split(final String str, final String delimiter) { + if (str == null || str.trim().length() == 0) { + return EMPTY_STRINGS; + } + final List list = new ArrayList(); + final StringTokenizer st = new StringTokenizer(str, delimiter); + while (st.hasMoreElements()) { + list.add(st.nextToken()); + } + return (String[]) list.toArray(new String[list.size()]); + } + + //========================================================================== + // ========= + // Initial Convert + // =============== public static String initCap(String str) { assertObjectNotNull("str", str); return str.substring(0, 1).toUpperCase() + str.substring(1); @@ -42,9 +68,10 @@ return str.substring(0, 1).toLowerCase() + str.substring(1); } - // ----------------------------------------------------- - // Assert Object - // ------------- + //========================================================================== + // ========= + // Assert Helper + // ============= /** * Assert that the object is not null. * Modified: notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/util/SimpleSystemUtil.java =================================================================== --- notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/util/SimpleSystemUtil.java 2008-12-27 22:11:51 UTC (rev 1627) +++ notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/util/SimpleSystemUtil.java 2008-12-27 22:13:37 UTC (rev 1628) @@ -7,8 +7,8 @@ //========================================================================== // ========= - // System - // ====== + // Line Separator + // ============== public static String getLineSeparator() { // /- - - - - - - - - - - - - - - - - - - - - - // Because 'CR + LF' caused many trouble! Added: notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/util/SimpleTypeUtil.java =================================================================== --- notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/util/SimpleTypeUtil.java (rev 0) +++ notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/util/SimpleTypeUtil.java 2008-12-27 22:13:37 UTC (rev 1628) @@ -0,0 +1,692 @@ +package jp.sf.pal.notepad.db.allcommon.util; + +import java.math.BigDecimal; +import java.math.BigInteger; +import java.text.DateFormat; +import java.text.DecimalFormatSymbols; +import java.text.ParseException; +import java.text.SimpleDateFormat; +import java.util.ArrayList; +import java.util.Calendar; +import java.util.Date; +import java.util.List; +import java.util.Locale; +import java.util.Map; +import java.util.StringTokenizer; +import java.util.concurrent.ConcurrentHashMap; + +/** + * {Refers to S2Container's utility and Extends it} + * + * @author DBFlute(AutoGenerator) + */ +public class SimpleTypeUtil { + + //========================================================================== + // ========= + // Convert To + // ========== + // ----------------------------------------------------- + // Boolean + // ------- + public static Boolean toBoolean(Object o) { + if (o == null) { + return null; + } else if (o instanceof Boolean) { + return (Boolean) o; + } else if (o instanceof Number) { + int num = ((Number) o).intValue(); + return Boolean.valueOf(num != 0); + } else if (o instanceof String) { + String s = (String) o; + if ("true".equalsIgnoreCase(s)) { + return Boolean.TRUE; + } else if ("false".equalsIgnoreCase(s)) { + return Boolean.FALSE; + } else if (s.equals("0")) { + return Boolean.FALSE; + } else { + return Boolean.TRUE; + } + } else { + return Boolean.TRUE; + } + } + + // ----------------------------------------------------- + // Integer + // ------- + public static Integer toInteger(Object o) { + return toInteger(o, null); + } + + public static Integer toInteger(Object o, String pattern) { + if (o == null) { + return null; + } else if (o instanceof Integer) { + return (Integer) o; + } else if (o instanceof Number) { + return new Integer(((Number) o).intValue()); + } else if (o instanceof String) { + return toInteger((String) o); + } else if (o instanceof java.util.Date) { + if (pattern != null) { + return new Integer(new SimpleDateFormat(pattern).format(o)); + } + return new Integer((int) ((java.util.Date) o).getTime()); + } else if (o instanceof Boolean) { + return ((Boolean) o).booleanValue() ? new Integer(1) : new Integer( + 0); + } else { + return toInteger(o.toString()); + } + } + + protected static Integer toInteger(String s) { + if (s == null || s.trim().length() == 0) { + return null; + } + return new Integer(normalize(s)); + } + + public static int toPrimitiveInt(Object o) { + return toPrimitiveInt(o, null); + } + + public static int toPrimitiveInt(Object o, String pattern) { + if (o == null) { + return 0; + } else if (o instanceof Number) { + return ((Number) o).intValue(); + } else if (o instanceof String) { + return toPrimitiveInt((String) o); + } else if (o instanceof java.util.Date) { + if (pattern != null) { + return Integer + .parseInt(new SimpleDateFormat(pattern).format(o)); + } + return (int) ((java.util.Date) o).getTime(); + } else if (o instanceof Boolean) { + return ((Boolean) o).booleanValue() ? 1 : 0; + } else { + return toPrimitiveInt(o.toString()); + } + } + + protected static int toPrimitiveInt(String s) { + if (s == null || s.trim().length() == 0) { + return 0; + } + return Integer.parseInt(normalize(s)); + } + + // ----------------------------------------------------- + // BigDecimal + // ---------- + public static BigDecimal toBigDecimal(Object o) { + return toBigDecimal(o, null); + } + + public static BigDecimal toBigDecimal(Object o, String pattern) { + if (o == null) { + return null; + } else if (o instanceof BigDecimal) { + return (BigDecimal) o; + } else if (o instanceof java.util.Date) { + if (pattern != null) { + return new BigDecimal(new SimpleDateFormat(pattern).format(o)); + } + return new BigDecimal(Long.toString(((java.util.Date) o).getTime())); + } else if (o instanceof String) { + String s = (String) o; + if (s == null || s.trim().length() == 0) { + return null; + } + return new BigDecimal(new BigDecimal(s).toPlainString()); + } else { + return new BigDecimal(new BigDecimal(o.toString()).toPlainString()); + } + } + + // ----------------------------------------------------- + // Double + // ------ + public static Double toDouble(Object o) { + return toDouble(o, null); + } + + public static Double toDouble(Object o, String pattern) { + if (o == null) { + return null; + } else if (o instanceof Double) { + return (Double) o; + } else if (o instanceof Number) { + return new Double(((Number) o).doubleValue()); + } else if (o instanceof String) { + return toDouble((String) o); + } else if (o instanceof java.util.Date) { + if (pattern != null) { + return new Double(new SimpleDateFormat(pattern).format(o)); + } + return new Double(((java.util.Date) o).getTime()); + } else { + return toDouble(o.toString()); + } + } + + protected static Double toDouble(String s) { + if (s == null || s.trim().length() == 0) { + return null; + } + return new Double(normalize(s)); + } + + // ----------------------------------------------------- + // Long + // ---- + public static Long toLong(Object o) { + return toLong(o, null); + } + + public static Long toLong(Object o, String pattern) { + if (o == null) { + return null; + } else if (o instanceof Long) { + return (Long) o; + } else if (o instanceof Number) { + return new Long(((Number) o).longValue()); + } else if (o instanceof String) { + return toLong((String) o); + } else if (o instanceof java.util.Date) { + if (pattern != null) { + return new Long(new SimpleDateFormat(pattern).format(o)); + } + return new Long(((java.util.Date) o).getTime()); + } else if (o instanceof Boolean) { + return ((Boolean) o).booleanValue() ? new Long(1) : new Long(0); + } else { + return toLong(o.toString()); + } + } + + protected static Long toLong(String s) { + if (s == null || s.trim().length() == 0) { + return null; + } + return new Long(normalize(s)); + } + + public static long toPrimitiveLong(Object o) { + return toPrimitiveLong(o, null); + } + + public static long toPrimitiveLong(Object o, String pattern) { + if (o == null) { + return 0; + } else if (o instanceof Number) { + return ((Number) o).longValue(); + } else if (o instanceof String) { + return toPrimitiveLong((String) o); + } else if (o instanceof java.util.Date) { + if (pattern != null) { + return Long.parseLong(new SimpleDateFormat(pattern).format(o)); + } + return ((java.util.Date) o).getTime(); + } else if (o instanceof Boolean) { + return ((Boolean) o).booleanValue() ? 1 : 0; + } else { + return toPrimitiveLong(o.toString()); + } + } + + protected static long toPrimitiveLong(String s) { + if (s == null || s.trim().length() == 0) { + return 0; + } + return Long.parseLong(normalize(s)); + } + + // ----------------------------------------------------- + // Float + // ----- + public static Float toFloat(Object o) { + return toFloat(o, null); + } + + public static Float toFloat(Object o, String pattern) { + if (o == null) { + return null; + } else if (o instanceof Float) { + return (Float) o; + } else if (o instanceof Number) { + return new Float(((Number) o).floatValue()); + } else if (o instanceof String) { + return toFloat((String) o); + } else if (o instanceof java.util.Date) { + if (pattern != null) { + return new Float(new SimpleDateFormat(pattern).format(o)); + } + return new Float(((java.util.Date) o).getTime()); + } else { + return toFloat(o.toString()); + } + } + + protected static Float toFloat(String s) { + if (s == null || s.trim().length() == 0) { + return null; + } + return new Float(normalize(s)); + } + + // ----------------------------------------------------- + // Short + // ----- + public static Short toShort(Object o) { + return toShort(o, null); + } + + public static Short toShort(Object o, String pattern) { + if (o == null) { + return null; + } else if (o instanceof Short) { + return (Short) o; + } else if (o instanceof Number) { + return new Short(((Number) o).shortValue()); + } else if (o instanceof String) { + return toShort((String) o); + } else if (o instanceof java.util.Date) { + if (pattern != null) { + return new Short(new SimpleDateFormat(pattern).format(o)); + } + return new Short((short) ((java.util.Date) o).getTime()); + } else if (o instanceof Boolean) { + return ((Boolean) o).booleanValue() ? new Short((short) 1) + : new Short((short) 0); + } else { + return toShort(o.toString()); + } + } + + protected static Short toShort(String s) { + if (s == null || s.trim().length() == 0) { + return null; + } + return new Short(normalize(s)); + } + + // ----------------------------------------------------- + // BigInteger + // ---------- + public static BigInteger toBigInteger(Object o) { + return toBigInteger(o, null); + } + + public static BigInteger toBigInteger(Object o, String pattern) { + if (o == null) { + return null; + } else if (o instanceof BigInteger) { + return (BigInteger) o; + } else { + Long l = toLong(o, pattern); + if (l == null) { + return null; + } + return BigInteger.valueOf(l.longValue()); + } + } + + // ----------------------------------------------------- + // Byte + // ---- + public static Byte toByte(Object o) { + return toByte(o, null); + } + + public static Byte toByte(Object o, String pattern) { + if (o == null) { + return null; + } else if (o instanceof Byte) { + return (Byte) o; + } else if (o instanceof Number) { + return new Byte(((Number) o).byteValue()); + } else if (o instanceof String) { + return toByte((String) o); + } else if (o instanceof java.util.Date) { + if (pattern != null) { + return new Byte(new SimpleDateFormat(pattern).format(o)); + } + return new Byte((byte) ((java.util.Date) o).getTime()); + } else if (o instanceof Boolean) { + return ((Boolean) o).booleanValue() ? new Byte((byte) 1) + : new Byte((byte) 0); + } else { + return toByte(o.toString()); + } + } + + protected static Byte toByte(String s) { + if (s == null || s.trim().length() == 0) { + return null; + } + return new Byte(normalize(s)); + } + + // ----------------------------------------------------- + // Date + // ---- + public static Date toDate(Object o) { + return toDate(o, null); + } + + public static Date toDate(Object o, String pattern) { + if (o == null) { + return null; + } else if (o instanceof String) { + return toDate((String) o, pattern); + } else if (o instanceof Date) { + return (Date) o; + } else if (o instanceof Calendar) { + return ((Calendar) o).getTime(); + } else { + return toDate(o.toString(), pattern); + } + } + + protected static Date toDate(String s, String pattern) { + return toDate(s, pattern, Locale.getDefault()); + } + + protected static Date toDate(String s, String pattern, Locale locale) { + if (s == null || s.trim().length() == 0) { + return null; + } + SimpleDateFormat sdf = getDateFormat(s, pattern, locale); + try { + return sdf.parse(s); + } catch (ParseException e) { + String msg = "Failed to parse the string to date: "; + msg = msg + " string=" + s + " format=" + sdf + " locale=" + locale; + throw new IllegalStateException(msg, e); + } + } + + public static java.sql.Date toSqlDate(Object o) { + return toSqlDate(o, null); + } + + public static java.sql.Date toSqlDate(Object o, String pattern) { + if (o instanceof java.sql.Date) { + return (java.sql.Date) o; + } + java.util.Date date = toDate(o, pattern); + if (date != null) { + return new java.sql.Date(date.getTime()); + } + return null; + } + + // ----------------------------------------------------- + // Number + // ------ + public static Object toNumber(Class type, Object o) { + if (type == Integer.class) { + return toInteger(o); + } else if (type == BigDecimal.class) { + return toBigDecimal(o); + } else if (type == Double.class) { + return toDouble(o); + } else if (type == Long.class) { + return toLong(o); + } else if (type == Float.class) { + return toFloat(o); + } else if (type == Short.class) { + return toShort(o); + } else if (type == BigInteger.class) { + return toBigInteger(o); + } else if (type == Byte.class) { + return toByte(o); + } + return o; + } + + // ----------------------------------------------------- + // Wrapper + // ------- + public static Object toWrapper(Class type, Object o) { + if (type == int.class) { + Integer i = toInteger(o); + if (i != null) { + return i; + } + return new Integer(0); + } else if (type == double.class) { + Double d = toDouble(o); + if (d != null) { + return d; + } + return new Double(0); + } else if (type == long.class) { + Long l = toLong(o); + if (l != null) { + return l; + } + return new Long(0); + } else if (type == float.class) { + Float f = toFloat(o); + if (f != null) { + return f; + } + return new Float(0); + } else if (type == short.class) { + Short s = toShort(o); + if (s != null) { + return s; + } + return new Short((short) 0); + } else if (type == boolean.class) { + Boolean b = toBoolean(o); + if (b != null) { + return b; + } + return Boolean.FALSE; + } else if (type == byte.class) { + Byte b = toByte(o); + if (b != null) { + return b; + } + return new Byte((byte) 0); + } + return o; + } + + //========================================================================== + // ========= + // Normalize + // ========= + protected static String normalize(String s) { + return normalize(s, Locale.getDefault()); + } + + protected static String normalize(String s, Locale locale) { + if (s == null) { + return null; + } + DecimalFormatSymbols symbols = getDecimalFormatSymbols(locale); + char decimalSep = symbols.getDecimalSeparator(); + char groupingSep = symbols.getGroupingSeparator(); + StringBuilder sb = new StringBuilder(20); + for (int i = 0; i < s.length(); ++i) { + char c = s.charAt(i); + if (c == groupingSep) { + continue; + } else if (c == decimalSep) { + c = '.'; + } + sb.append(c); + } + return sb.toString(); + } + + //========================================================================== + // ========= + // Assist Helper + // ============= + + // ----------------------------------------------------- + // DateFormat + // ---------- + protected static SimpleDateFormat getDateFormat(String s, String pattern, + Locale locale) { + if (pattern != null) { + return new SimpleDateFormat(pattern); + } + return getDateFormat(s, locale); + } + + protected static SimpleDateFormat getDateFormat(String s, Locale locale) { + String pattern = getDateFormatPattern(locale); + String shortPattern = removeDateDelimiter(pattern); + String delimitor = findDateDelimiter(s); + if (delimitor == null) { + if (s.length() == shortPattern.length()) { + return new SimpleDateFormat(shortPattern); + } + if (s.length() == shortPattern.length() + 2) { + return new SimpleDateFormat(replace(shortPattern, "yy", "yyyy")); + } + } else { + String[] array = split(s, delimitor); + for (int i = 0; i < array.length; ++i) { + if (array[i].length() == 4) { + pattern = replace(pattern, "yy", "yyyy"); + break; + } + } + return new SimpleDateFormat(pattern); + } + return new SimpleDateFormat(); + } + + protected static String getDateFormatPattern(Locale locale) { + SimpleDateFormat df = (SimpleDateFormat) DateFormat.getDateInstance( + DateFormat.SHORT, locale); + String pattern = df.toPattern(); + int index = pattern.indexOf(' '); + if (index > 0) { + pattern = pattern.substring(0, index); + } + if (pattern.indexOf("MM") < 0) { + pattern = replace(pattern, "M", "MM"); + } + if (pattern.indexOf("dd") < 0) { + pattern = replace(pattern, "d", "dd"); + } + return pattern; + } + + protected static String removeDateDelimiter(String pattern) { + StringBuilder sb = new StringBuilder(); + for (int i = 0; i < pattern.length(); ++i) { + char c = pattern.charAt(i); + if (c == 'y' || c == 'M' || c == 'd') { + sb.append(c); + } + } + return sb.toString(); + } + + protected static String findDateDelimiter(String value) { + for (int i = 0; i < value.length(); ++i) { + char c = value.charAt(i); + if (Character.isDigit(c)) { + continue; + } + return Character.toString(c); + } + return null; + } + + // ----------------------------------------------------- + // DecimalFormatSymbols + // -------------------- + protected static Map symbolsCache = new ConcurrentHashMap(); + + protected static DecimalFormatSymbols getDecimalFormatSymbols() { + return getDecimalFormatSymbols(Locale.getDefault()); + } + + protected static DecimalFormatSymbols getDecimalFormatSymbols(Locale locale) { + DecimalFormatSymbols symbols = (DecimalFormatSymbols) symbolsCache + .get(locale); + if (symbols == null) { + symbols = new DecimalFormatSymbols(locale); + symbolsCache.put(locale, symbols); + } + return symbols; + } + + // ----------------------------------------------------- + // String + // ------ + protected static String replace(String text, String fromText, String toText) { + if (text == null || fromText == null || toText == null) { + return null; + } + StringBuilder sb = new StringBuilder(); + int pos = 0; + int pos2 = 0; + do { + pos = text.indexOf(fromText, pos2); + if (pos == 0) { + sb.append(toText); + pos2 = fromText.length(); + } else if (pos > 0) { + sb.append(text.substring(pos2, pos)); + sb.append(toText); + pos2 = pos + fromText.length(); + } else { + sb.append(text.substring(pos2)); + return sb.toString(); + } + } while (true); + } + + protected static final String[] EMPTY_STRINGS = new String[0]; + + protected static String[] split(final String str, final String delimiter) { + if (str == null || str.trim().length() == 0) { + return EMPTY_STRINGS; + } + final List list = new ArrayList(); + final StringTokenizer st = new StringTokenizer(str, delimiter); + while (st.hasMoreElements()) { + list.add(st.nextToken()); + } + return (String[]) list.toArray(new String[list.size()]); + } + + //========================================================================== + // ========= + // Assert Helper + // ============= + /** + * Assert that the object is not null. + * + * @param variableName Variable name. (NotNull) + * @param value Value. (NotNull) + * @exception IllegalArgumentException + */ + protected static void assertObjectNotNull(String variableName, Object value) { + if (variableName == null) { + String msg = "The value should not be null: variableName=" + + variableName + " value=" + value; + throw new IllegalArgumentException(msg); + } + if (value == null) { + String msg = "The value should not be null: variableName=" + + variableName; + throw new IllegalArgumentException(msg); + } + } +} Property changes on: notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/util/SimpleTypeUtil.java ___________________________________________________________________ Name: svn:eol-style + native Modified: notepad/trunk/src/main/java/jp/sf/pal/notepad/db/bsbhv/BsGroupInfoBhv.java =================================================================== --- notepad/trunk/src/main/java/jp/sf/pal/notepad/db/bsbhv/BsGroupInfoBhv.java 2008-12-27 22:11:51 UTC (rev 1627) +++ notepad/trunk/src/main/java/jp/sf/pal/notepad/db/bsbhv/BsGroupInfoBhv.java 2008-12-27 22:13:37 UTC (rev 1628) @@ -1,9 +1,8 @@ package jp.sf.pal.notepad.db.bsbhv; import java.util.List; +import java.util.Map; -import jp.sf.pal.notepad.db.allcommon.DaoReadable; -import jp.sf.pal.notepad.db.allcommon.DaoWritable; import jp.sf.pal.notepad.db.allcommon.Entity; import jp.sf.pal.notepad.db.allcommon.bhv.load.LoadReferrerOption; import jp.sf.pal.notepad.db.allcommon.bhv.setup.ConditionBeanSetupper; @@ -22,13 +21,12 @@ import jp.sf.pal.notepad.db.cbean.UserInfoCB; import jp.sf.pal.notepad.db.exbhv.GroupMappingBhv; import jp.sf.pal.notepad.db.exbhv.UserInfoBhv; -import jp.sf.pal.notepad.db.exdao.GroupInfoDao; import jp.sf.pal.notepad.db.exentity.GroupInfo; import jp.sf.pal.notepad.db.exentity.GroupMapping; import jp.sf.pal.notepad.db.exentity.UserInfo; /** - * The behavior of GROUP_INFO. + * The behavior of GROUP_INFO that the type is TABLE.
* *
  * [primary-key]
@@ -73,12 +71,6 @@
 
     //==========================================================================
     // =========
-    // Attribute
-    // =========
-    protected GroupInfoDao _dao;
-
-    //==========================================================================
-    // =========
     // Table name
     // ==========
     /** @return The name on database of table. (NotNull) */
@@ -90,39 +82,18 @@
     // =========
     // DBMeta
     // ======
-    /** @return The meta data of the database. (NotNull) */
+    /** @return The instance of DBMeta. (NotNull) */
     public DBMeta getDBMeta() {
         return GroupInfoDbm.getInstance();
     }
 
-    /** @return The meta data of the database as my table type. (NotNull) */
+    /** @return The instance of DBMeta as my table type. (NotNull) */
     public GroupInfoDbm getMyDBMeta() {
         return GroupInfoDbm.getInstance();
     }
 
     //==========================================================================
     // =========
-    // Dao Accessor
-    // ============
-    public GroupInfoDao getMyDao() {
-        return _dao;
-    }
-
-    public void setMyDao(GroupInfoDao dao) {
-        assertObjectNotNull("dao", dao);
-        _dao = dao;
-    }
-
-    public DaoReadable getDaoReadable() {
-        return getMyDao();
-    }
-
-    public DaoWritable getDaoWritable() {
-        return getMyDao();
-    }
-
-    //==========================================================================
-    // =========
     // New Instance
     // ============
     public Entity newEntity() {
@@ -152,7 +123,7 @@
      * @return The selected count.
      */
     public int selectCount(GroupInfoCB cb) {
-        assertConditionBeanNotNull(cb);
+        assertCBNotNull(cb);
         return delegateSelectCount(cb);
     }
 
@@ -229,7 +200,7 @@
      * @return The result bean of selected list. (NotNull)
      */
     public ListResultBean selectList(GroupInfoCB cb) {
-        assertConditionBeanNotNull(cb);
+        assertCBNotNull(cb);
         return new ResultBeanBuilder(getTableDbName())
                 .buildListResultBean(cb, delegateSelectList(cb));
     }
@@ -245,7 +216,7 @@
      * @return The result bean of selected page. (NotNull)
      */
     public PagingResultBean selectPage(final GroupInfoCB cb) {
-        assertConditionBeanNotNull(cb);
+        assertCBNotNull(cb);
         final PagingInvoker invoker = new PagingInvoker(
                 getTableDbName());
         final PagingHandler handler = new PagingHandler() {
@@ -266,6 +237,32 @@
 
     //==========================================================================
     // =========
+    // Scalar Select
+    // =============
+    /**
+     * Select the scalar value derived by a function. 
Call a function + * method after this method called like as follows: + * + *
+     * groupInfoBhv.scalarSelect(Date.class).max(new ScalarQuery(GroupInfoCB cb) {
+     *     cb.specify().columnXxxDatetime(); // the required specification of target column
+     *     cb.query().setXxxName_PrefixSearch("S"); // query as you like it
+     * });
+     * 
+ * + * @param The type of result. + * @param resultType The type of result. (NotNull) + * @return The scalar value derived by a function. (Nullable) + */ + public SLFunction scalarSelect( + Class resultType) { + GroupInfoCB cb = newMyConditionBean(); + cb.xsetupForScalarSelect(); + return new SLFunction(cb, resultType); + } + + //========================================================================== + // ========= // Various Select // ============== /** @@ -275,8 +272,8 @@ * @param valueLabelSetupper The setupper of value-label. (NotNull) * @return The list of value-label. (NotNull) */ - public List> selectValueLabelList( - GroupInfoCB cb, ValueLabelSetupper valueLabelSetupper) { + public List> selectValueLabelList(GroupInfoCB cb, + ValueLabelSetupper valueLabelSetupper) { return createValueLabelList(selectList(cb), valueLabelSetupper); } @@ -467,8 +464,8 @@ //========================================================================== // ========= - // Pullout Foreign - // =============== + // Pull out Foreign + // ================ //========================================================================== // ========= @@ -766,11 +763,11 @@ */ public int queryUpdate(GroupInfo groupInfo, GroupInfoCB cb) { assertObjectNotNull("groupInfo", groupInfo); - assertConditionBeanNotNull(cb); + assertCBNotNull(cb); setupCommonColumnOfUpdateIfNeeds(groupInfo); filterEntityOfUpdate(groupInfo); assertEntityOfUpdate(groupInfo); - return getMyDao().updateByQuery(cb, groupInfo); + return invoke(createQueryUpdateEntityCBCommand(groupInfo, cb)); } /** @@ -780,8 +777,8 @@ * @return The deleted count. */ public int queryDelete(GroupInfoCB cb) { - assertConditionBeanNotNull(cb); - return getMyDao().deleteByQuery(cb); + assertCBNotNull(cb); + return invoke(createQueryDeleteCBCommand(cb)); } //========================================================================== @@ -793,19 +790,27 @@ // ========= // Delegate Method // =============== + // [Behavior Command] // ----------------------------------------------------- // Select // ------ protected int delegateSelectCount(GroupInfoCB cb) { - assertConditionBeanNotNull(cb); - return getMyDao().selectCount(cb); + return invoke(createSelectCountCBCommand(cb)); } + protected int doCallReadCount(ConditionBean cb) { + return delegateSelectCount((GroupInfoCB) cb); + } + protected List delegateSelectList(GroupInfoCB cb) { - assertConditionBeanNotNull(cb); - return getMyDao().selectList(cb); + return invoke(createSelectListCBCommand(cb, GroupInfo.class)); } + @SuppressWarnings("unchecked") + protected List doCallReadList(ConditionBean cb) { + return (List) delegateSelectList((GroupInfoCB) cb); + } + // ----------------------------------------------------- // Update // ------ @@ -813,62 +818,97 @@ if (!processBeforeInsert(e)) { return 1; } - return getMyDao().insert(e); + return invoke(createInsertEntityCommand(e)); } + protected int doCallCreate(Entity entity) { + return delegateInsert(downcast(entity)); + } + protected int delegateUpdate(GroupInfo e) { if (!processBeforeUpdate(e)) { return 1; } - return getMyDao().updateModifiedOnly(e); + return invoke(createUpdateEntityCommand(e)); } + protected int doCallModify(Entity entity) { + return delegateUpdate(downcast(entity)); + } + protected int delegateUpdateNonstrict(GroupInfo e) { if (!processBeforeUpdate(e)) { return 1; } - return getMyDao().updateNonstrictModifiedOnly(e); + return invoke(createUpdateNonstrictEntityCommand(e)); } protected int delegateDelete(GroupInfo e) { if (!processBeforeDelete(e)) { return 1; } - return getMyDao().delete(e); + return invoke(createDeleteEntityCommand(e)); } + protected int doCallRemove(Entity entity) { + return delegateDelete(downcast(entity)); + } + protected int delegateDeleteNonstrict(GroupInfo e) { if (!processBeforeDelete(e)) { return 1; } - return getMyDao().deleteNonstrict(e); + return invoke(createDeleteNonstrictEntityCommand(e)); } protected int[] delegateInsertList(List ls) { - assertObjectNotNull("groupInfoList", ls); - return getMyDao().insertList(helpFilterBeforeInsertInternally(ls)); + if (ls.isEmpty()) { + return new int[] {}; + } + return invoke(createBatchInsertEntityCommand(helpFilterBeforeInsertInternally(ls))); } + @SuppressWarnings("unchecked") + protected int[] doCreateList(List ls) { + return delegateInsertList((List) ls); + } + protected int[] delegateUpdateList(List ls) { - assertObjectNotNull("groupInfoList", ls); - return getMyDao().updateList(helpFilterBeforeUpdateInternally(ls)); + if (ls.isEmpty()) { + return new int[] {}; + } + return invoke(createBatchUpdateEntityCommand(helpFilterBeforeUpdateInternally(ls))); } + @SuppressWarnings("unchecked") + protected int[] doModifyList(List ls) { + return delegateUpdateList((List) ls); + } + protected int[] delegateUpdateListNonstrict(List ls) { - assertObjectNotNull("groupInfoList", ls); - return getMyDao().updateListNonstrict( - helpFilterBeforeUpdateInternally(ls)); + if (ls.isEmpty()) { + return new int[] {}; + } + return invoke(createBatchUpdateNonstrictEntityCommand(helpFilterBeforeUpdateInternally(ls))); } protected int[] delegateDeleteList(List ls) { - assertObjectNotNull("groupInfoList", ls); - return getMyDao().deleteList(helpFilterBeforeDeleteInternally(ls)); + if (ls.isEmpty()) { + return new int[] {}; + } + return invoke(createBatchDeleteEntityCommand(helpFilterBeforeDeleteInternally(ls))); } + @SuppressWarnings("unchecked") + protected int[] doRemoveList(List ls) { + return delegateDeleteList((List) ls); + } + protected int[] delegateDeleteListNonstrict(List ls) { - assertObjectNotNull("groupInfoList", ls); - return getMyDao().deleteListNonstrict( - helpFilterBeforeDeleteInternally(ls)); + if (ls.isEmpty()) { + return new int[] {}; + } + return invoke(createBatchDeleteNonstrictEntityCommand(helpFilterBeforeDeleteInternally(ls))); } //========================================================================== Modified: notepad/trunk/src/main/java/jp/sf/pal/notepad/db/bsbhv/BsGroupMappingBhv.java =================================================================== --- notepad/trunk/src/main/java/jp/sf/pal/notepad/db/bsbhv/BsGroupMappingBhv.java 2008-12-27 22:11:51 UTC (rev 1627) +++ notepad/trunk/src/main/java/jp/sf/pal/notepad/db/bsbhv/BsGroupMappingBhv.java 2008-12-27 22:13:37 UTC (rev 1628) @@ -1,9 +1,8 @@ package jp.sf.pal.notepad.db.bsbhv; import java.util.List; +import java.util.Map; -import jp.sf.pal.notepad.db.allcommon.DaoReadable; -import jp.sf.pal.notepad.db.allcommon.DaoWritable; import jp.sf.pal.notepad.db.allcommon.Entity; import jp.sf.pal.notepad.db.allcommon.bhv.setup.ValueLabelSetupper; import jp.sf.pal.notepad.db.allcommon.cbean.ConditionBean; @@ -16,13 +15,12 @@ import jp.sf.pal.notepad.db.allcommon.dbmeta.DBMeta; import jp.sf.pal.notepad.db.bsentity.dbmeta.GroupMappingDbm; import jp.sf.pal.notepad.db.cbean.GroupMappingCB; -import jp.sf.pal.notepad.db.exdao.GroupMappingDao; import jp.sf.pal.notepad.db.exentity.GroupInfo; import jp.sf.pal.notepad.db.exentity.GroupMapping; import jp.sf.pal.notepad.db.exentity.UserInfo; /** - * The behavior of GROUP_MAPPING. + * The behavior of GROUP_MAPPING that the type is TABLE.
* *
  * [primary-key]
@@ -67,12 +65,6 @@
 
     //==========================================================================
     // =========
-    // Attribute
-    // =========
-    protected GroupMappingDao _dao;
-
-    //==========================================================================
-    // =========
     // Table name
     // ==========
     /** @return The name on database of table. (NotNull) */
@@ -84,39 +76,18 @@
     // =========
     // DBMeta
     // ======
-    /** @return The meta data of the database. (NotNull) */
+    /** @return The instance of DBMeta. (NotNull) */
     public DBMeta getDBMeta() {
         return GroupMappingDbm.getInstance();
     }
 
-    /** @return The meta data of the database as my table type. (NotNull) */
+    /** @return The instance of DBMeta as my table type. (NotNull) */
     public GroupMappingDbm getMyDBMeta() {
         return GroupMappingDbm.getInstance();
     }
 
     //==========================================================================
     // =========
-    // Dao Accessor
-    // ============
-    public GroupMappingDao getMyDao() {
-        return _dao;
-    }
-
-    public void setMyDao(GroupMappingDao dao) {
-        assertObjectNotNull("dao", dao);
-        _dao = dao;
-    }
-
-    public DaoReadable getDaoReadable() {
-        return getMyDao();
-    }
-
-    public DaoWritable getDaoWritable() {
-        return getMyDao();
-    }
-
-    //==========================================================================
-    // =========
     // New Instance
     // ============
     public Entity newEntity() {
@@ -146,7 +117,7 @@
      * @return The selected count.
      */
     public int selectCount(GroupMappingCB cb) {
-        assertConditionBeanNotNull(cb);
+        assertCBNotNull(cb);
         return delegateSelectCount(cb);
     }
 
@@ -226,7 +197,7 @@
      * @return The result bean of selected list. (NotNull)
      */
     public ListResultBean selectList(GroupMappingCB cb) {
-        assertConditionBeanNotNull(cb);
+        assertCBNotNull(cb);
         return new ResultBeanBuilder(getTableDbName())
                 .buildListResultBean(cb, delegateSelectList(cb));
     }
@@ -242,7 +213,7 @@
      * @return The result bean of selected page. (NotNull)
      */
     public PagingResultBean selectPage(final GroupMappingCB cb) {
-        assertConditionBeanNotNull(cb);
+        assertCBNotNull(cb);
         final PagingInvoker invoker = new PagingInvoker(
                 getTableDbName());
         final PagingHandler handler = new PagingHandler() {
@@ -263,6 +234,32 @@
 
     //==========================================================================
     // =========
+    // Scalar Select
+    // =============
+    /**
+     * Select the scalar value derived by a function. 
Call a function + * method after this method called like as follows: + * + *
+     * groupMappingBhv.scalarSelect(Date.class).max(new ScalarQuery(GroupMappingCB cb) {
+     *     cb.specify().columnXxxDatetime(); // the required specification of target column
+     *     cb.query().setXxxName_PrefixSearch("S"); // query as you like it
+     * });
+     * 
+ * + * @param The type of result. + * @param resultType The type of result. (NotNull) + * @return The scalar value derived by a function. (Nullable) + */ + public SLFunction scalarSelect( + Class resultType) { + GroupMappingCB cb = newMyConditionBean(); + cb.xsetupForScalarSelect(); + return new SLFunction(cb, resultType); + } + + //========================================================================== + // ========= // Various Select // ============== /** @@ -272,8 +269,7 @@ * @param valueLabelSetupper The setupper of value-label. (NotNull) * @return The list of value-label. (NotNull) */ - public List> selectValueLabelList( - GroupMappingCB cb, + public List> selectValueLabelList(GroupMappingCB cb, ValueLabelSetupper valueLabelSetupper) { return createValueLabelList(selectList(cb), valueLabelSetupper); } @@ -285,8 +281,8 @@ //========================================================================== // ========= - // Pullout Foreign - // =============== + // Pull out Foreign + // ================ /** * Pull out the list of foreign table 'GroupInfo'. * @@ -499,11 +495,11 @@ */ public int queryUpdate(GroupMapping groupMapping, GroupMappingCB cb) { assertObjectNotNull("groupMapping", groupMapping); - assertConditionBeanNotNull(cb); + assertCBNotNull(cb); setupCommonColumnOfUpdateIfNeeds(groupMapping); filterEntityOfUpdate(groupMapping); assertEntityOfUpdate(groupMapping); - return getMyDao().updateByQuery(cb, groupMapping); + return invoke(createQueryUpdateEntityCBCommand(groupMapping, cb)); } /** @@ -513,8 +509,8 @@ * @return The deleted count. */ public int queryDelete(GroupMappingCB cb) { - assertConditionBeanNotNull(cb); - return getMyDao().deleteByQuery(cb); + assertCBNotNull(cb); + return invoke(createQueryDeleteCBCommand(cb)); } //========================================================================== @@ -526,19 +522,27 @@ // ========= // Delegate Method // =============== + // [Behavior Command] // ----------------------------------------------------- // Select // ------ protected int delegateSelectCount(GroupMappingCB cb) { - assertConditionBeanNotNull(cb); - return getMyDao().selectCount(cb); + return invoke(createSelectCountCBCommand(cb)); } + protected int doCallReadCount(ConditionBean cb) { + return delegateSelectCount((GroupMappingCB) cb); + } + protected List delegateSelectList(GroupMappingCB cb) { - assertConditionBeanNotNull(cb); - return getMyDao().selectList(cb); + return invoke(createSelectListCBCommand(cb, GroupMapping.class)); } + @SuppressWarnings("unchecked") + protected List doCallReadList(ConditionBean cb) { + return (List) delegateSelectList((GroupMappingCB) cb); + } + // ----------------------------------------------------- // Update // ------ @@ -546,38 +550,71 @@ if (!processBeforeInsert(e)) { return 1; } - return getMyDao().insert(e); + return invoke(createInsertEntityCommand(e)); } + protected int doCallCreate(Entity entity) { + return delegateInsert(downcast(entity)); + } + protected int delegateUpdate(GroupMapping e) { if (!processBeforeUpdate(e)) { return 1; } - return getMyDao().updateModifiedOnly(e); + return invoke(createUpdateEntityCommand(e)); } + protected int doCallModify(Entity entity) { + return delegateUpdate(downcast(entity)); + } + protected int delegateDelete(GroupMapping e) { if (!processBeforeDelete(e)) { return 1; } - return getMyDao().delete(e); + return invoke(createDeleteEntityCommand(e)); } + protected int doCallRemove(Entity entity) { + return delegateDelete(downcast(entity)); + } + protected int[] delegateInsertList(List ls) { - assertObjectNotNull("groupMappingList", ls); - return getMyDao().insertList(helpFilterBeforeInsertInternally(ls)); + if (ls.isEmpty()) { + return new int[] {}; + } + return invoke(createBatchInsertEntityCommand(helpFilterBeforeInsertInternally(ls))); } + @SuppressWarnings("unchecked") + protected int[] doCreateList(List ls) { + return delegateInsertList((List) ls); + } + protected int[] delegateUpdateList(List ls) { - assertObjectNotNull("groupMappingList", ls); - return getMyDao().updateList(helpFilterBeforeUpdateInternally(ls)); + if (ls.isEmpty()) { + return new int[] {}; + } + return invoke(createBatchUpdateEntityCommand(helpFilterBeforeUpdateInternally(ls))); } + @SuppressWarnings("unchecked") + protected int[] doModifyList(List ls) { + return delegateUpdateList((List) ls); + } + protected int[] delegateDeleteList(List ls) { - assertObjectNotNull("groupMappingList", ls); - return getMyDao().deleteList(helpFilterBeforeDeleteInternally(ls)); + if (ls.isEmpty()) { + return new int[] {}; + } + return invoke(createBatchDeleteEntityCommand(helpFilterBeforeDeleteInternally(ls))); } + @SuppressWarnings("unchecked") + protected int[] doRemoveList(List ls) { + return delegateDeleteList((List) ls); + } + //========================================================================== // ========= // Optimistic Lock Info Modified: notepad/trunk/src/main/java/jp/sf/pal/notepad/db/bsbhv/BsNotepadBhv.java =================================================================== --- notepad/trunk/src/main/java/jp/sf/pal/notepad/db/bsbhv/BsNotepadBhv.java 2008-12-27 22:11:51 UTC (rev 1627) +++ notepad/trunk/src/main/java/jp/sf/pal/notepad/db/bsbhv/BsNotepadBhv.java 2008-12-27 22:13:37 UTC (rev 1628) @@ -1,9 +1,8 @@ package jp.sf.pal.notepad.db.bsbhv; import java.util.List; +import java.util.Map; -import jp.sf.pal.notepad.db.allcommon.DaoReadable; -import jp.sf.pal.notepad.db.allcommon.DaoWritable; import jp.sf.pal.notepad.db.allcommon.Entity; import jp.sf.pal.notepad.db.allcommon.bhv.setup.ValueLabelSetupper; import jp.sf.pal.notepad.db.allcommon.cbean.ConditionBean; @@ -16,14 +15,13 @@ import jp.sf.pal.notepad.db.allcommon.dbmeta.DBMeta; import jp.sf.pal.notepad.db.bsentity.dbmeta.NotepadDbm; import jp.sf.pal.notepad.db.cbean.NotepadCB; -import jp.sf.pal.notepad.db.exdao.NotepadDao; import jp.sf.pal.notepad.db.exentity.Notepad; import jp.sf.pal.notepad.db.exentity.NotepadCategory; import jp.sf.pal.notepad.db.exentity.NotepadContent; import jp.sf.pal.notepad.db.exentity.UserInfo; /** - * The behavior of NOTEPAD. + * The behavior of NOTEPAD that the type is TABLE.
* *
  * [primary-key]
@@ -68,12 +66,6 @@
 
     //==========================================================================
     // =========
-    // Attribute
-    // =========
-    protected NotepadDao _dao;
-
-    //==========================================================================
-    // =========
     // Table name
     // ==========
     /** @return The name on database of table. (NotNull) */
@@ -85,39 +77,18 @@
     // =========
     // DBMeta
     // ======
-    /** @return The meta data of the database. (NotNull) */
+    /** @return The instance of DBMeta. (NotNull) */
     public DBMeta getDBMeta() {
         return NotepadDbm.getInstance();
     }
 
-    /** @return The meta data of the database as my table type. (NotNull) */
+    /** @return The instance of DBMeta as my table type. (NotNull) */
     public NotepadDbm getMyDBMeta() {
         return NotepadDbm.getInstance();
     }
 
     //==========================================================================
     // =========
-    // Dao Accessor
-    // ============
-    public NotepadDao getMyDao() {
-        return _dao;
-    }
-
-    public void setMyDao(NotepadDao dao) {
-        assertObjectNotNull("dao", dao);
-        _dao = dao;
-    }
-
-    public DaoReadable getDaoReadable() {
-        return getMyDao();
-    }
-
-    public DaoWritable getDaoWritable() {
-        return getMyDao();
-    }
-
-    //==========================================================================
-    // =========
     // New Instance
     // ============
     public Entity newEntity() {
@@ -147,7 +118,7 @@
      * @return The selected count.
      */
     public int selectCount(NotepadCB cb) {
-        assertConditionBeanNotNull(cb);
+        assertCBNotNull(cb);
         return delegateSelectCount(cb);
     }
 
@@ -224,7 +195,7 @@
      * @return The result bean of selected list. (NotNull)
      */
     public ListResultBean selectList(NotepadCB cb) {
-        assertConditionBeanNotNull(cb);
+        assertCBNotNull(cb);
         return new ResultBeanBuilder(getTableDbName())
                 .buildListResultBean(cb, delegateSelectList(cb));
     }
@@ -240,7 +211,7 @@
      * @return The result bean of selected page. (NotNull)
      */
     public PagingResultBean selectPage(final NotepadCB cb) {
-        assertConditionBeanNotNull(cb);
+        assertCBNotNull(cb);
         final PagingInvoker invoker = new PagingInvoker(
                 getTableDbName());
         final PagingHandler handler = new PagingHandler() {
@@ -261,6 +232,32 @@
 
     //==========================================================================
     // =========
+    // Scalar Select
+    // =============
+    /**
+     * Select the scalar value derived by a function. 
Call a function + * method after this method called like as follows: + * + *
+     * notepadBhv.scalarSelect(Date.class).max(new ScalarQuery(NotepadCB cb) {
+     *     cb.specify().columnXxxDatetime(); // the required specification of target column
+     *     cb.query().setXxxName_PrefixSearch("S"); // query as you like it
+     * });
+     * 
+ * + * @param The type of result. + * @param resultType The type of result. (NotNull) + * @return The scalar value derived by a function. (Nullable) + */ + public SLFunction scalarSelect( + Class resultType) { + NotepadCB cb = newMyConditionBean(); + cb.xsetupForScalarSelect(); + return new SLFunction(cb, resultType); + } + + //========================================================================== + // ========= // Various Select // ============== /** @@ -270,8 +267,8 @@ * @param valueLabelSetupper The setupper of value-label. (NotNull) * @return The list of value-label. (NotNull) */ - public List> selectValueLabelList( - NotepadCB cb, ValueLabelSetupper valueLabelSetupper) { + public List> selectValueLabelList(NotepadCB cb, + ValueLabelSetupper valueLabelSetupper) { return createValueLabelList(selectList(cb), valueLabelSetupper); } @@ -282,8 +279,8 @@ //========================================================================== // ========= - // Pullout Foreign - // =============== + // Pull out Foreign + // ================ /** * Pull out the list of foreign table 'NotepadCategory'. * @@ -642,11 +639,11 @@ */ public int queryUpdate(Notepad notepad, NotepadCB cb) { assertObjectNotNull("notepad", notepad); - assertConditionBeanNotNull(cb); + assertCBNotNull(cb); setupCommonColumnOfUpdateIfNeeds(notepad); filterEntityOfUpdate(notepad); assertEntityOfUpdate(notepad); - return getMyDao().updateByQuery(cb, notepad); + return invoke(createQueryUpdateEntityCBCommand(notepad, cb)); } /** @@ -656,8 +653,8 @@ * @return The deleted count. */ public int queryDelete(NotepadCB cb) { - assertConditionBeanNotNull(cb); - return getMyDao().deleteByQuery(cb); + assertCBNotNull(cb); + return invoke(createQueryDeleteCBCommand(cb)); } //========================================================================== @@ -669,19 +666,27 @@ // ========= // Delegate Method // =============== + // [Behavior Command] // ----------------------------------------------------- // Select // ------ protected int delegateSelectCount(NotepadCB cb) { - assertConditionBeanNotNull(cb); - return getMyDao().selectCount(cb); + return invoke(createSelectCountCBCommand(cb)); } + protected int doCallReadCount(ConditionBean cb) { + return delegateSelectCount((NotepadCB) cb); + } + protected List delegateSelectList(NotepadCB cb) { - assertConditionBeanNotNull(cb); - return getMyDao().selectList(cb); + return invoke(createSelectListCBCommand(cb, Notepad.class)); } + @SuppressWarnings("unchecked") + protected List doCallReadList(ConditionBean cb) { + return (List) delegateSelectList((NotepadCB) cb); + } + // ----------------------------------------------------- // Update // ------ @@ -689,62 +694,97 @@ if (!processBeforeInsert(e)) { return 1; } - return getMyDao().insert(e); + return invoke(createInsertEntityCommand(e)); } + protected int doCallCreate(Entity entity) { + return delegateInsert(downcast(entity)); + } + protected int delegateUpdate(Notepad e) { if (!processBeforeUpdate(e)) { return 1; } - return getMyDao().updateModifiedOnly(e); + return invoke(createUpdateEntityCommand(e)); } + protected int doCallModify(Entity entity) { + return delegateUpdate(downcast(entity)); + } + protected int delegateUpdateNonstrict(Notepad e) { if (!processBeforeUpdate(e)) { return 1; } - return getMyDao().updateNonstrictModifiedOnly(e); + return invoke(createUpdateNonstrictEntityCommand(e)); } protected int delegateDelete(Notepad e) { if (!processBeforeDelete(e)) { return 1; } - return getMyDao().delete(e); + return invoke(createDeleteEntityCommand(e)); } + protected int doCallRemove(Entity entity) { + return delegateDelete(downcast(entity)); + } + protected int delegateDeleteNonstrict(Notepad e) { if (!processBeforeDelete(e)) { return 1; } - return getMyDao().deleteNonstrict(e); + return invoke(createDeleteNonstrictEntityCommand(e)); } protected int[] delegateInsertList(List ls) { - assertObjectNotNull("notepadList", ls); - return getMyDao().insertList(helpFilterBeforeInsertInternally(ls)); + if (ls.isEmpty()) { + return new int[] {}; + } + return invoke(createBatchInsertEntityCommand(helpFilterBeforeInsertInternally(ls))); } + @SuppressWarnings("unchecked") + protected int[] doCreateList(List ls) { + return delegateInsertList((List) ls); + } + protected int[] delegateUpdateList(List ls) { - assertObjectNotNull("notepadList", ls); - return getMyDao().updateList(helpFilterBeforeUpdateInternally(ls)); + if (ls.isEmpty()) { + return new int[] {}; + } + return invoke(createBatchUpdateEntityCommand(helpFilterBeforeUpdateInternally(ls))); } + @SuppressWarnings("unchecked") + protected int[] doModifyList(List ls) { + return delegateUpdateList((List) ls); + } + protected int[] delegateUpdateListNonstrict(List ls) { - assertObjectNotNull("notepadList", ls); - return getMyDao().updateListNonstrict( - helpFilterBeforeUpdateInternally(ls)); + if (ls.isEmpty()) { + return new int[] {}; + } + return invoke(createBatchUpdateNonstrictEntityCommand(helpFilterBeforeUpdateInternally(ls))); } protected int[] delegateDeleteList(List ls) { - assertObjectNotNull("notepadList", ls); - return getMyDao().deleteList(helpFilterBeforeDeleteInternally(ls)); + if (ls.isEmpty()) { + return new int[] {}; + } + return invoke(createBatchDeleteEntityCommand(helpFilterBeforeDeleteInternally(ls))); } + @SuppressWarnings("unchecked") + protected int[] doRemoveList(List ls) { + return delegateDeleteList((List) ls); + } + protected int[] delegateDeleteListNonstrict(List ls) { - assertObjectNotNull("notepadList", ls); - return getMyDao().deleteListNonstrict( - helpFilterBeforeDeleteInternally(ls)); + if (ls.isEmpty()) { + return new int[] {}; + } + return invoke(createBatchDeleteNonstrictEntityCommand(helpFilterBeforeDeleteInternally(ls))); } //========================================================================== Modified: notepad/trunk/src/main/java/jp/sf/pal/notepad/db/bsbhv/BsNotepadCategoryBhv.java =================================================================== --- notepad/trunk/src/main/java/jp/sf/pal/notepad/db/bsbhv/BsNotepadCategoryBhv.java 2008-12-27 22:11:51 UTC (rev 1627) +++ notepad/trunk/src/main/java/jp/sf/pal/notepad/db/bsbhv/BsNotepadCategoryBhv.java 2008-12-27 22:13:37 UTC (rev 1628) @@ -1,9 +1,8 @@ package jp.sf.pal.notepad.db.bsbhv; import java.util.List; +import java.util.Map; -import jp.sf.pal.notepad.db.allcommon.DaoReadable; -import jp.sf.pal.notepad.db.allcommon.DaoWritable; import jp.sf.pal.notepad.db.allcommon.Entity; import jp.sf.pal.notepad.db.allcommon.bhv.load.LoadReferrerOption; import jp.sf.pal.notepad.db.allcommon.bhv.setup.ConditionBeanSetupper; @@ -20,13 +19,12 @@ import jp.sf.pal.notepad.db.cbean.NotepadCB; import jp.sf.pal.notepad.db.cbean.NotepadCategoryCB; import jp.sf.pal.notepad.db.exbhv.NotepadBhv; -import jp.sf.pal.notepad.db.exdao.NotepadCategoryDao; import jp.sf.pal.notepad.db.exentity.Notepad; import jp.sf.pal.notepad.db.exentity.NotepadCategory; import jp.sf.pal.notepad.db.exentity.UserInfo; /** - * The behavior of NOTEPAD_CATEGORY. + * The behavior of NOTEPAD_CATEGORY that the type is TABLE.
* *
  * [primary-key]
@@ -71,12 +69,6 @@
 
     //==========================================================================
     // =========
-    // Attribute
-    // =========
-    protected NotepadCategoryDao _dao;
-
-    //==========================================================================
-    // =========
     // Table name
     // ==========
     /** @return The name on database of table. (NotNull) */
@@ -88,39 +80,18 @@
     // =========
     // DBMeta
     // ======
-    /** @return The meta data of the database. (NotNull) */
+    /** @return The instance of DBMeta. (NotNull) */
     public DBMeta getDBMeta() {
         return NotepadCategoryDbm.getInstance();
     }
 
-    /** @return The meta data of the database as my table type. (NotNull) */
+    /** @return The instance of DBMeta as my table type. (NotNull) */
     public NotepadCategoryDbm getMyDBMeta() {
         return NotepadCategoryDbm.getInstance();
     }
 
     //==========================================================================
     // =========
-    // Dao Accessor
-    // ============
-    public NotepadCategoryDao getMyDao() {
-        return _dao;
-    }
-
-    public void setMyDao(NotepadCategoryDao dao) {
-        assertObjectNotNull("dao", dao);
-        _dao = dao;
-    }
-
-    public DaoReadable getDaoReadable() {
-        return getMyDao();
-    }
-
-    public DaoWritable getDaoWritable() {
-        return getMyDao();
-    }
-
-    //==========================================================================
-    // =========
     // New Instance
     // ============
     public Entity newEntity() {
@@ -150,7 +121,7 @@
      * @return The selected count.
      */
     public int selectCount(NotepadCategoryCB cb) {
-        assertConditionBeanNotNull(cb);
+        assertCBNotNull(cb);
         return delegateSelectCount(cb);
     }
 
@@ -231,7 +202,7 @@
      * @return The result bean of selected list. (NotNull)
      */
     public ListResultBean selectList(NotepadCategoryCB cb) {
-        assertConditionBeanNotNull(cb);
+        assertCBNotNull(cb);
         return new ResultBeanBuilder(getTableDbName())
                 .buildListResultBean(cb, delegateSelectList(cb));
     }
@@ -248,7 +219,7 @@
      */
     public PagingResultBean selectPage(
             final NotepadCategoryCB cb) {
-        assertConditionBeanNotNull(cb);
+        assertCBNotNull(cb);
         final PagingInvoker invoker = new PagingInvoker(
                 getTableDbName());
         final PagingHandler handler = new PagingHandler() {
@@ -269,6 +240,32 @@
 
     //==========================================================================
     // =========
+    // Scalar Select
+    // =============
+    /**
+     * Select the scalar value derived by a function. 
Call a function + * method after this method called like as follows: + * + *
+     * notepadCategoryBhv.scalarSelect(Date.class).max(new ScalarQuery(NotepadCategoryCB cb) {
+     *     cb.specify().columnXxxDatetime(); // the required specification of target column
+     *     cb.query().setXxxName_PrefixSearch("S"); // query as you like it
+     * });
+     * 
+ * + * @param The type of result. + * @param resultType The type of result. (NotNull) + * @return The scalar value derived by a function. (Nullable) + */ + public SLFunction scalarSelect( + Class resultType) { + NotepadCategoryCB cb = newMyConditionBean(); + cb.xsetupForScalarSelect(); + return new SLFunction(cb, resultType); + } + + //========================================================================== + // ========= // Various Select // ============== /** @@ -278,8 +275,7 @@ * @param valueLabelSetupper The setupper of value-label. (NotNull) * @return The list of value-label. (NotNull) */ - public List> selectValueLabelList( - NotepadCategoryCB cb, + public List> selectValueLabelList(NotepadCategoryCB cb, ValueLabelSetupper valueLabelSetupper) { return createValueLabelList(selectList(cb), valueLabelSetupper); } @@ -382,8 +378,8 @@ //========================================================================== // ========= - // Pullout Foreign - // =============== + // Pull out Foreign + // ================ /** * Pull out the list of foreign table 'UserInfo'. * @@ -719,11 +715,11 @@ */ public int queryUpdate(NotepadCategory notepadCategory, NotepadCategoryCB cb) { assertObjectNotNull("notepadCategory", notepadCategory); - assertConditionBeanNotNull(cb); + assertCBNotNull(cb); setupCommonColumnOfUpdateIfNeeds(notepadCategory); filterEntityOfUpdate(notepadCategory); assertEntityOfUpdate(notepadCategory); - return getMyDao().updateByQuery(cb, notepadCategory); + return invoke(createQueryUpdateEntityCBCommand(notepadCategory, cb)); } /** @@ -733,8 +729,8 @@ * @return The deleted count. */ public int queryDelete(NotepadCategoryCB cb) { - assertConditionBeanNotNull(cb); - return getMyDao().deleteByQuery(cb); + assertCBNotNull(cb); + return invoke(createQueryDeleteCBCommand(cb)); } //========================================================================== @@ -746,19 +742,27 @@ // ========= // Delegate Method // =============== + // [Behavior Command] // ----------------------------------------------------- // Select // ------ protected int delegateSelectCount(NotepadCategoryCB cb) { - assertConditionBeanNotNull(cb); - return getMyDao().selectCount(cb); + return invoke(createSelectCountCBCommand(cb)); } + protected int doCallReadCount(ConditionBean cb) { + return delegateSelectCount((NotepadCategoryCB) cb); + } + protected List delegateSelectList(NotepadCategoryCB cb) { - assertConditionBeanNotNull(cb); - return getMyDao().selectList(cb); + return invoke(createSelectListCBCommand(cb, NotepadCategory.class)); } + @SuppressWarnings("unchecked") + protected List doCallReadList(ConditionBean cb) { + return (List) delegateSelectList((NotepadCategoryCB) cb); + } + // ----------------------------------------------------- // Update // ------ @@ -766,62 +770,97 @@ if (!processBeforeInsert(e)) { return 1; } - return getMyDao().insert(e); + return invoke(createInsertEntityCommand(e)); } + protected int doCallCreate(Entity entity) { + return delegateInsert(downcast(entity)); + } + protected int delegateUpdate(NotepadCategory e) { if (!processBeforeUpdate(e)) { return 1; } - return getMyDao().updateModifiedOnly(e); + return invoke(createUpdateEntityCommand(e)); } + protected int doCallModify(Entity entity) { + return delegateUpdate(downcast(entity)); + } + protected int delegateUpdateNonstrict(NotepadCategory e) { if (!processBeforeUpdate(e)) { return 1; } - return getMyDao().updateNonstrictModifiedOnly(e); + return invoke(createUpdateNonstrictEntityCommand(e)); } protected int delegateDelete(NotepadCategory e) { if (!processBeforeDelete(e)) { return 1; } - return getMyDao().delete(e); + return invoke(createDeleteEntityCommand(e)); } + protected int doCallRemove(Entity entity) { + return delegateDelete(downcast(entity)); + } + protected int delegateDeleteNonstrict(NotepadCategory e) { if (!processBeforeDelete(e)) { return 1; } - return getMyDao().deleteNonstrict(e); + return invoke(createDeleteNonstrictEntityCommand(e)); } protected int[] delegateInsertList(List ls) { - assertObjectNotNull("notepadCategoryList", ls); - return getMyDao().insertList(helpFilterBeforeInsertInternally(ls)); + if (ls.isEmpty()) { + return new int[] {}; + } + return invoke(createBatchInsertEntityCommand(helpFilterBeforeInsertInternally(ls))); } + @SuppressWarnings("unchecked") + protected int[] doCreateList(List ls) { + return delegateInsertList((List) ls); + } + protected int[] delegateUpdateList(List ls) { - assertObjectNotNull("notepadCategoryList", ls); - return getMyDao().updateList(helpFilterBeforeUpdateInternally(ls)); + if (ls.isEmpty()) { + return new int[] {}; + } + return invoke(createBatchUpdateEntityCommand(helpFilterBeforeUpdateInternally(ls))); } + @SuppressWarnings("unchecked") + protected int[] doModifyList(List ls) { + return delegateUpdateList((List) ls); + } + protected int[] delegateUpdateListNonstrict(List ls) { - assertObjectNotNull("notepadCategoryList", ls); - return getMyDao().updateListNonstrict( - helpFilterBeforeUpdateInternally(ls)); + if (ls.isEmpty()) { + return new int[] {}; + } + return invoke(createBatchUpdateNonstrictEntityCommand(helpFilterBeforeUpdateInternally(ls))); } protected int[] delegateDeleteList(List ls) { - assertObjectNotNull("notepadCategoryList", ls); - return getMyDao().deleteList(helpFilterBeforeDeleteInternally(ls)); + if (ls.isEmpty()) { + return new int[] {}; + } + return invoke(createBatchDeleteEntityCommand(helpFilterBeforeDeleteInternally(ls))); } + @SuppressWarnings("unchecked") + protected int[] doRemoveList(List ls) { + return delegateDeleteList((List) ls); + } + protected int[] delegateDeleteListNonstrict(List ls) { - assertObjectNotNull("notepadCategoryList", ls); - return getMyDao().deleteListNonstrict( - helpFilterBeforeDeleteInternally(ls)); + if (ls.isEmpty()) { + return new int[] {}; + } + return invoke(createBatchDeleteNonstrictEntityCommand(helpFilterBeforeDeleteInternally(ls))); } //========================================================================== Modified: notepad/trunk/src/main/java/jp/sf/pal/notepad/db/bsbhv/BsNotepadContentBhv.java =================================================================== --- notepad/trunk/src/main/java/jp/sf/pal/notepad/db/bsbhv/BsNotepadContentBhv.java 2008-12-27 22:11:51 UTC (rev 1627) +++ notepad/trunk/src/main/java/jp/sf/pal/notepad/db/bsbhv/BsNotepadContentBhv.java 2008-12-27 22:13:37 UTC (rev 1628) @@ -1,9 +1,8 @@ package jp.sf.pal.notepad.db.bsbhv; import java.util.List; +import java.util.Map; -import jp.sf.pal.notepad.db.allcommon.DaoReadable; -import jp.sf.pal.notepad.db.allcommon.DaoWritable; import jp.sf.pal.notepad.db.allcommon.Entity; import jp.sf.pal.notepad.db.allcommon.bhv.setup.ValueLabelSetupper; import jp.sf.pal.notepad.db.allcommon.cbean.ConditionBean; @@ -16,12 +15,11 @@ import jp.sf.pal.notepad.db.allcommon.dbmeta.DBMeta; import jp.sf.pal.notepad.db.bsentity.dbmeta.NotepadContentDbm; import jp.sf.pal.notepad.db.cbean.NotepadContentCB; -import jp.sf.pal.notepad.db.exdao.NotepadContentDao; import jp.sf.pal.notepad.db.exentity.Notepad; import jp.sf.pal.notepad.db.exentity.NotepadContent; /** - * The behavior of NOTEPAD_CONTENT. + * The behavior of NOTEPAD_CONTENT that the type is TABLE.
* *
  * [primary-key]
@@ -66,12 +64,6 @@
 
     //==========================================================================
     // =========
-    // Attribute
-    // =========
-    protected NotepadContentDao _dao;
-
-    //==========================================================================
-    // =========
     // Table name
     // ==========
     /** @return The name on database of table. (NotNull) */
@@ -83,39 +75,18 @@
     // =========
     // DBMeta
     // ======
-    /** @return The meta data of the database. (NotNull) */
+    /** @return The instance of DBMeta. (NotNull) */
     public DBMeta getDBMeta() {
         return NotepadContentDbm.getInstance();
     }
 
-    /** @return The meta data of the database as my table type. (NotNull) */
+    /** @return The instance of DBMeta as my table type. (NotNull) */
     public NotepadContentDbm getMyDBMeta() {
         return NotepadContentDbm.getInstance();
     }
 
     //==========================================================================
     // =========
-    // Dao Accessor
-    // ============
-    public NotepadContentDao getMyDao() {
-        return _dao;
-    }
-
-    public void setMyDao(NotepadContentDao dao) {
-        assertObjectNotNull("dao", dao);
-        _dao = dao;
-    }
-
-    public DaoReadable getDaoReadable() {
-        return getMyDao();
-    }
-
-    public DaoWritable getDaoWritable() {
-        return getMyDao();
-    }
-
-    //==========================================================================
-    // =========
     // New Instance
     // ============
     public Entity newEntity() {
@@ -145,7 +116,7 @@
      * @return The selected count.
      */
     public int selectCount(NotepadContentCB cb) {
-        assertConditionBeanNotNull(cb);
+        assertCBNotNull(cb);
         return delegateSelectCount(cb);
     }
 
@@ -225,7 +196,7 @@
      * @return The result bean of selected list. (NotNull)
      */
     public ListResultBean selectList(NotepadContentCB cb) {
-        assertConditionBeanNotNull(cb);
+        assertCBNotNull(cb);
         return new ResultBeanBuilder(getTableDbName())
                 .buildListResultBean(cb, delegateSelectList(cb));
     }
@@ -241,7 +212,7 @@
      * @return The result bean of selected page. (NotNull)
      */
     public PagingResultBean selectPage(final NotepadContentCB cb) {
-        assertConditionBeanNotNull(cb);
+        assertCBNotNull(cb);
         final PagingInvoker invoker = new PagingInvoker(
                 getTableDbName());
         final PagingHandler handler = new PagingHandler() {
@@ -262,6 +233,32 @@
 
     //==========================================================================
     // =========
+    // Scalar Select
+    // =============
+    /**
+     * Select the scalar value derived by a function. 
Call a function + * method after this method called like as follows: + * + *
+     * notepadContentBhv.scalarSelect(Date.class).max(new ScalarQuery(NotepadContentCB cb) {
+     *     cb.specify().columnXxxDatetime(); // the required specification of target column
+     *     cb.query().setXxxName_PrefixSearch("S"); // query as you like it
+     * });
+     * 
+ * + * @param The type of result. + * @param resultType The type of result. (NotNull) + * @return The scalar value derived by a function. (Nullable) + */ + public SLFunction scalarSelect( + Class resultType) { + NotepadContentCB cb = newMyConditionBean(); + cb.xsetupForScalarSelect(); + return new SLFunction(cb, resultType); + } + + //========================================================================== + // ========= // Various Select // ============== /** @@ -271,8 +268,7 @@ * @param valueLabelSetupper The setupper of value-label. (NotNull) * @return The list of value-label. (NotNull) */ - public List> selectValueLabelList( - NotepadContentCB cb, + public List> selectValueLabelList(NotepadContentCB cb, ValueLabelSetupper valueLabelSetupper) { return createValueLabelList(selectList(cb), valueLabelSetupper); } @@ -284,8 +280,8 @@ //========================================================================== // ========= - // Pullout Foreign - // =============== + // Pull out Foreign + // ================ /** * Pull out the list of foreign table 'Notepad'. * @@ -483,11 +479,11 @@ */ public int queryUpdate(NotepadContent notepadContent, NotepadContentCB cb) { assertObjectNotNull("notepadContent", notepadContent); - assertConditionBeanNotNull(cb); + assertCBNotNull(cb); setupCommonColumnOfUpdateIfNeeds(notepadContent); filterEntityOfUpdate(notepadContent); assertEntityOfUpdate(notepadContent); - return getMyDao().updateByQuery(cb, notepadContent); + return invoke(createQueryUpdateEntityCBCommand(notepadContent, cb)); } /** @@ -497,8 +493,8 @@ * @return The deleted count. */ public int queryDelete(NotepadContentCB cb) { - assertConditionBeanNotNull(cb); - return getMyDao().deleteByQuery(cb); + assertCBNotNull(cb); + return invoke(createQueryDeleteCBCommand(cb)); } //========================================================================== @@ -510,19 +506,27 @@ // ========= // Delegate Method // =============== + // [Behavior Command] // ----------------------------------------------------- // Select // ------ protected int delegateSelectCount(NotepadContentCB cb) { - assertConditionBeanNotNull(cb); - return getMyDao().selectCount(cb); + return invoke(createSelectCountCBCommand(cb)); } + protected int doCallReadCount(ConditionBean cb) { + return delegateSelectCount((NotepadContentCB) cb); + } + protected List delegateSelectList(NotepadContentCB cb) { - assertConditionBeanNotNull(cb); - return getMyDao().selectList(cb); + return invoke(createSelectListCBCommand(cb, NotepadContent.class)); } + @SuppressWarnings("unchecked") + protected List doCallReadList(ConditionBean cb) { + return (List) delegateSelectList((NotepadContentCB) cb); + } + // ----------------------------------------------------- // Update // ------ @@ -530,38 +534,71 @@ if (!processBeforeInsert(e)) { return 1; } - return getMyDao().insert(e); + return invoke(createInsertEntityCommand(e)); } + protected int doCallCreate(Entity entity) { + return delegateInsert(downcast(entity)); + } + protected int delegateUpdate(NotepadContent e) { if (!processBeforeUpdate(e)) { return 1; } - return getMyDao().updateModifiedOnly(e); + return invoke(createUpdateEntityCommand(e)); } + protected int doCallModify(Entity entity) { + return delegateUpdate(downcast(entity)); + } + protected int delegateDelete(NotepadContent e) { if (!processBeforeDelete(e)) { return 1; } - return getMyDao().delete(e); + return invoke(createDeleteEntityCommand(e)); } + protected int doCallRemove(Entity entity) { + return delegateDelete(downcast(entity)); + } + protected int[] delegateInsertList(List ls) { - assertObjectNotNull("notepadContentList", ls); - return getMyDao().insertList(helpFilterBeforeInsertInternally(ls)); + if (ls.isEmpty()) { + return new int[] {}; + } + return invoke(createBatchInsertEntityCommand(helpFilterBeforeInsertInternally(ls))); } + @SuppressWarnings("unchecked") + protected int[] doCreateList(List ls) { + return delegateInsertList((List) ls); + } + protected int[] delegateUpdateList(List ls) { - assertObjectNotNull("notepadContentList", ls); - return getMyDao().updateList(helpFilterBeforeUpdateInternally(ls)); + if (ls.isEmpty()) { + return new int[] {}; + } + return invoke(createBatchUpdateEntityCommand(helpFilterBeforeUpdateInternally(ls))); } + @SuppressWarnings("unchecked") + protected int[] doModifyList(List ls) { + return delegateUpdateList((List) ls); + } + protected int[] delegateDeleteList(List ls) { - assertObjectNotNull("notepadContentList", ls); - return getMyDao().deleteList(helpFilterBeforeDeleteInternally(ls)); + if (ls.isEmpty()) { + return new int[] {}; + } + return invoke(createBatchDeleteEntityCommand(helpFilterBeforeDeleteInternally(ls))); } + @SuppressWarnings("unchecked") + protected int[] doRemoveList(List ls) { + return delegateDeleteList((List) ls); + } + //========================================================================== // ========= // Optimistic Lock Info Modified: notepad/trunk/src/main/java/jp/sf/pal/notepad/db/bsbhv/BsRoleInfoBhv.java =================================================================== --- notepad/trunk/src/main/java/jp/sf/pal/notepad/db/bsbhv/BsRoleInfoBhv.java 2008-12-27 22:11:51 UTC (rev 1627) +++ notepad/trunk/src/main/java/jp/sf/pal/notepad/db/bsbhv/BsRoleInfoBhv.java 2008-12-27 22:13:37 UTC (rev 1628) @@ -1,9 +1,8 @@ package jp.sf.pal.notepad.db.bsbhv; import java.util.List; +import java.util.Map; -import jp.sf.pal.notepad.db.allcommon.DaoReadable; -import jp.sf.pal.notepad.db.allcommon.DaoWritable; import jp.sf.pal.notepad.db.allcommon.Entity; import jp.sf.pal.notepad.db.allcommon.bhv.load.LoadReferrerOption; import jp.sf.pal.notepad.db.allcommon.bhv.setup.ConditionBeanSetupper; @@ -22,13 +21,12 @@ import jp.sf.pal.notepad.db.cbean.UserInfoCB; import jp.sf.pal.notepad.db.exbhv.RoleMappingBhv; import jp.sf.pal.notepad.db.exbhv.UserInfoBhv; -import jp.sf.pal.notepad.db.exdao.RoleInfoDao; import jp.sf.pal.notepad.db.exentity.RoleInfo; import jp.sf.pal.notepad.db.exentity.RoleMapping; import jp.sf.pal.notepad.db.exentity.UserInfo; /** - * The behavior of ROLE_INFO. + * The behavior of ROLE_INFO that the type is TABLE.
* *
  * [primary-key]
@@ -73,12 +71,6 @@
 
     //==========================================================================
     // =========
-    // Attribute
-    // =========
-    protected RoleInfoDao _dao;
-
-    //==========================================================================
-    // =========
     // Table name
     // ==========
     /** @return The name on database of table. (NotNull) */
@@ -90,39 +82,18 @@
     // =========
     // DBMeta
     // ======
-    /** @return The meta data of the database. (NotNull) */
+    /** @return The instance of DBMeta. (NotNull) */
     public DBMeta getDBMeta() {
         return RoleInfoDbm.getInstance();
     }
 
-    /** @return The meta data of the database as my table type. (NotNull) */
+    /** @return The instance of DBMeta as my table type. (NotNull) */
     public RoleInfoDbm getMyDBMeta() {
         return RoleInfoDbm.getInstance();
     }
 
     //==========================================================================
     // =========
-    // Dao Accessor
-    // ============
-    public RoleInfoDao getMyDao() {
-        return _dao;
-    }
-
-    public void setMyDao(RoleInfoDao dao) {
-        assertObjectNotNull("dao", dao);
-        _dao = dao;
-    }
-
-    public DaoReadable getDaoReadable() {
-        return getMyDao();
-    }
-
-    public DaoWritable getDaoWritable() {
-        return getMyDao();
-    }
-
-    //==========================================================================
-    // =========
     // New Instance
     // ============
     public Entity newEntity() {
@@ -152,7 +123,7 @@
      * @return The selected count.
      */
     public int selectCount(RoleInfoCB cb) {
-        assertConditionBeanNotNull(cb);
+        assertCBNotNull(cb);
         return delegateSelectCount(cb);
     }
 
@@ -229,7 +200,7 @@
      * @return The result bean of selected list. (NotNull)
      */
     public ListResultBean selectList(RoleInfoCB cb) {
-        assertConditionBeanNotNull(cb);
+        assertCBNotNull(cb);
         return new ResultBeanBuilder(getTableDbName())
                 .buildListResultBean(cb, delegateSelectList(cb));
     }
@@ -245,7 +216,7 @@
      * @return The result bean of selected page. (NotNull)
      */
     public PagingResultBean selectPage(final RoleInfoCB cb) {
-        assertConditionBeanNotNull(cb);
+        assertCBNotNull(cb);
         final PagingInvoker invoker = new PagingInvoker(
                 getTableDbName());
         final PagingHandler handler = new PagingHandler() {
@@ -266,6 +237,32 @@
 
     //==========================================================================
     // =========
+    // Scalar Select
+    // =============
+    /**
+     * Select the scalar value derived by a function. 
Call a function + * method after this method called like as follows: + * + *
+     * roleInfoBhv.scalarSelect(Date.class).max(new ScalarQuery(RoleInfoCB cb) {
+     *     cb.specify().columnXxxDatetime(); // the required specification of target column
+     *     cb.query().setXxxName_PrefixSearch("S"); // query as you like it
+     * });
+     * 
+ * + * @param The type of result. + * @param resultType The type of result. (NotNull) + * @return The scalar value derived by a function. (Nullable) + */ + public SLFunction scalarSelect( + Class resultType) { + RoleInfoCB cb = newMyConditionBean(); + cb.xsetupForScalarSelect(); + return new SLFunction(cb, resultType); + } + + //========================================================================== + // ========= // Various Select // ============== /** @@ -275,8 +272,8 @@ * @param valueLabelSetupper The setupper of value-label. (NotNull) * @return The list of value-label. (NotNull) */ - public List> selectValueLabelList( - RoleInfoCB cb, ValueLabelSetupper valueLabelSetupper) { + public List> selectValueLabelList(RoleInfoCB cb, + ValueLabelSetupper valueLabelSetupper) { return createValueLabelList(selectList(cb), valueLabelSetupper); } @@ -467,8 +464,8 @@ //========================================================================== // ========= - // Pullout Foreign - // =============== + // Pull out Foreign + // ================ //========================================================================== // ========= @@ -764,11 +761,11 @@ */ public int queryUpdate(RoleInfo roleInfo, RoleInfoCB cb) { assertObjectNotNull("roleInfo", roleInfo); - assertConditionBeanNotNull(cb); + assertCBNotNull(cb); setupCommonColumnOfUpdateIfNeeds(roleInfo); filterEntityOfUpdate(roleInfo); assertEntityOfUpdate(roleInfo); - return getMyDao().updateByQuery(cb, roleInfo); + return invoke(createQueryUpdateEntityCBCommand(roleInfo, cb)); } /** @@ -778,8 +775,8 @@ * @return The deleted count. */ public int queryDelete(RoleInfoCB cb) { - assertConditionBeanNotNull(cb); - return getMyDao().deleteByQuery(cb); + assertCBNotNull(cb); + return invoke(createQueryDeleteCBCommand(cb)); } //========================================================================== @@ -791,19 +788,27 @@ // ========= // Delegate Method // =============== + // [Behavior Command] // ----------------------------------------------------- // Select // ------ protected int delegateSelectCount(RoleInfoCB cb) { - assertConditionBeanNotNull(cb); - return getMyDao().selectCount(cb); + return invoke(createSelectCountCBCommand(cb)); } + protected int doCallReadCount(ConditionBean cb) { + return delegateSelectCount((RoleInfoCB) cb); + } + protected List delegateSelectList(RoleInfoCB cb) { - assertConditionBeanNotNull(cb); - return getMyDao().selectList(cb); + return invoke(createSelectListCBCommand(cb, RoleInfo.class)); } + @SuppressWarnings("unchecked") + protected List doCallReadList(ConditionBean cb) { + return (List) delegateSelectList((RoleInfoCB) cb); + } + // ----------------------------------------------------- // Update // ------ @@ -811,62 +816,97 @@ if (!processBeforeInsert(e)) { return 1; } - return getMyDao().insert(e); + return invoke(createInsertEntityCommand(e)); } + protected int doCallCreate(Entity entity) { + return delegateInsert(downcast(entity)); + } + protected int delegateUpdate(RoleInfo e) { if (!processBeforeUpdate(e)) { return 1; } - return getMyDao().updateModifiedOnly(e); + return invoke(createUpdateEntityCommand(e)); } + protected int doCallModify(Entity entity) { + return delegateUpdate(downcast(entity)); + } + protected int delegateUpdateNonstrict(RoleInfo e) { if (!processBeforeUpdate(e)) { return 1; } - return getMyDao().updateNonstrictModifiedOnly(e); + return invoke(createUpdateNonstrictEntityCommand(e)); } protected int delegateDelete(RoleInfo e) { if (!processBeforeDelete(e)) { return 1; } - return getMyDao().delete(e); + return invoke(createDeleteEntityCommand(e)); } + protected int doCallRemove(Entity entity) { + return delegateDelete(downcast(entity)); + } + protected int delegateDeleteNonstrict(RoleInfo e) { if (!processBeforeDelete(e)) { return 1; } - return getMyDao().deleteNonstrict(e); + return invoke(createDeleteNonstrictEntityCommand(e)); } protected int[] delegateInsertList(List ls) { - assertObjectNotNull("roleInfoList", ls); - return getMyDao().insertList(helpFilterBeforeInsertInternally(ls)); + if (ls.isEmpty()) { + return new int[] {}; + } + return invoke(createBatchInsertEntityCommand(helpFilterBeforeInsertInternally(ls))); } + @SuppressWarnings("unchecked") + protected int[] doCreateList(List ls) { + return delegateInsertList((List) ls); + } + protected int[] delegateUpdateList(List ls) { - assertObjectNotNull("roleInfoList", ls); - return getMyDao().updateList(helpFilterBeforeUpdateInternally(ls)); + if (ls.isEmpty()) { + return new int[] {}; + } + return invoke(createBatchUpdateEntityCommand(helpFilterBeforeUpdateInternally(ls))); } + @SuppressWarnings("unchecked") + protected int[] doModifyList(List ls) { + return delegateUpdateList((List) ls); + } + protected int[] delegateUpdateListNonstrict(List ls) { - assertObjectNotNull("roleInfoList", ls); - return getMyDao().updateListNonstrict( - helpFilterBeforeUpdateInternally(ls)); + if (ls.isEmpty()) { + return new int[] {}; + } + return invoke(createBatchUpdateNonstrictEntityCommand(helpFilterBeforeUpdateInternally(ls))); } protected int[] delegateDeleteList(List ls) { - assertObjectNotNull("roleInfoList", ls); - return getMyDao().deleteList(helpFilterBeforeDeleteInternally(ls)); + if (ls.isEmpty()) { + return new int[] {}; + } + return invoke(createBatchDeleteEntityCommand(helpFilterBeforeDeleteInternally(ls))); } + @SuppressWarnings("unchecked") + protected int[] doRemoveList(List ls) { + return delegateDeleteList((List) ls); + } + protected int[] delegateDeleteListNonstrict(List ls) { - assertObjectNotNull("roleInfoList", ls); - return getMyDao().deleteListNonstrict( - helpFilterBeforeDeleteInternally(ls)); + if (ls.isEmpty()) { + return new int[] {}; + } + return invoke(createBatchDeleteNonstrictEntityCommand(helpFilterBeforeDeleteInternally(ls))); } //========================================================================== Modified: notepad/trunk/src/main/java/jp/sf/pal/notepad/db/bsbhv/BsRoleMappingBhv.java =================================================================== --- notepad/trunk/src/main/java/jp/sf/pal/notepad/db/bsbhv/BsRoleMappingBhv.java 2008-12-27 22:11:51 UTC (rev 1627) +++ notepad/trunk/src/main/java/jp/sf/pal/notepad/db/bsbhv/BsRoleMappingBhv.java 2008-12-27 22:13:37 UTC (rev 1628) @@ -1,9 +1,8 @@ package jp.sf.pal.notepad.db.bsbhv; import java.util.List; +import java.util.Map; -import jp.sf.pal.notepad.db.allcommon.DaoReadable; -import jp.sf.pal.notepad.db.allcommon.DaoWritable; import jp.sf.pal.notepad.db.allcommon.Entity; import jp.sf.pal.notepad.db.allcommon.bhv.setup.ValueLabelSetupper; import jp.sf.pal.notepad.db.allcommon.cbean.ConditionBean; @@ -16,13 +15,12 @@ import jp.sf.pal.notepad.db.allcommon.dbmeta.DBMeta; import jp.sf.pal.notepad.db.bsentity.dbmeta.RoleMappingDbm; import jp.sf.pal.notepad.db.cbean.RoleMappingCB; -import jp.sf.pal.notepad.db.exdao.RoleMappingDao; import jp.sf.pal.notepad.db.exentity.RoleInfo; import jp.sf.pal.notepad.db.exentity.RoleMapping; import jp.sf.pal.notepad.db.exentity.UserInfo; /** - * The behavior of ROLE_MAPPING. + * The behavior of ROLE_MAPPING that the type is TABLE.
* *
  * [primary-key]
@@ -67,12 +65,6 @@
 
     //==========================================================================
     // =========
-    // Attribute
-    // =========
-    protected RoleMappingDao _dao;
-
-    //==========================================================================
-    // =========
     // Table name
     // ==========
     /** @return The name on database of table. (NotNull) */
@@ -84,39 +76,18 @@
     // =========
     // DBMeta
     // ======
-    /** @return The meta data of the database. (NotNull) */
+    /** @return The instance of DBMeta. (NotNull) */
     public DBMeta getDBMeta() {
         return RoleMappingDbm.getInstance();
     }
 
-    /** @return The meta data of the database as my table type. (NotNull) */
+    /** @return The instance of DBMeta as my table type. (NotNull) */
     public RoleMappingDbm getMyDBMeta() {
         return RoleMappingDbm.getInstance();
     }
 
     //==========================================================================
     // =========
-    // Dao Accessor
-    // ============
-    public RoleMappingDao getMyDao() {
-        return _dao;
-    }
-
-    public void setMyDao(RoleMappingDao dao) {
-        assertObjectNotNull("dao", dao);
-        _dao = dao;
-    }
-
-    public DaoReadable getDaoReadable() {
-        return getMyDao();
-    }
-
-    public DaoWritable getDaoWritable() {
-        return getMyDao();
-    }
-
-    //==========================================================================
-    // =========
     // New Instance
     // ============
     public Entity newEntity() {
@@ -146,7 +117,7 @@
      * @return The selected count.
      */
     public int selectCount(RoleMappingCB cb) {
-        assertConditionBeanNotNull(cb);
+        assertCBNotNull(cb);
         return delegateSelectCount(cb);
     }
 
@@ -223,7 +194,7 @@
      * @return The result bean of selected list. (NotNull)
      */
     public ListResultBean selectList(RoleMappingCB cb) {
-        assertConditionBeanNotNull(cb);
+        assertCBNotNull(cb);
         return new ResultBeanBuilder(getTableDbName())
                 .buildListResultBean(cb, delegateSelectList(cb));
     }
@@ -239,7 +210,7 @@
      * @return The result bean of selected page. (NotNull)
      */
     public PagingResultBean selectPage(final RoleMappingCB cb) {
-        assertConditionBeanNotNull(cb);
+        assertCBNotNull(cb);
         final PagingInvoker invoker = new PagingInvoker(
                 getTableDbName());
         final PagingHandler handler = new PagingHandler() {
@@ -260,6 +231,32 @@
 
     //==========================================================================
     // =========
+    // Scalar Select
+    // =============
+    /**
+     * Select the scalar value derived by a function. 
Call a function + * method after this method called like as follows: + * + *
+     * roleMappingBhv.scalarSelect(Date.class).max(new ScalarQuery(RoleMappingCB cb) {
+     *     cb.specify().columnXxxDatetime(); // the required specification of target column
+     *     cb.query().setXxxName_PrefixSearch("S"); // query as you like it
+     * });
+     * 
+ * + * @param The type of result. + * @param resultType The type of result. (NotNull) + * @return The scalar value derived by a function. (Nullable) + */ + public SLFunction scalarSelect( + Class resultType) { + RoleMappingCB cb = newMyConditionBean(); + cb.xsetupForScalarSelect(); + return new SLFunction(cb, resultType); + } + + //========================================================================== + // ========= // Various Select // ============== /** @@ -269,8 +266,8 @@ * @param valueLabelSetupper The setupper of value-label. (NotNull) * @return The list of value-label. (NotNull) */ - public List> selectValueLabelList( - RoleMappingCB cb, ValueLabelSetupper valueLabelSetupper) { + public List> selectValueLabelList(RoleMappingCB cb, + ValueLabelSetupper valueLabelSetupper) { return createValueLabelList(selectList(cb), valueLabelSetupper); } @@ -281,8 +278,8 @@ //========================================================================== // ========= - // Pullout Foreign - // =============== + // Pull out Foreign + // ================ /** * Pull out the list of foreign table 'RoleInfo'. * @@ -494,11 +491,11 @@ */ public int queryUpdate(RoleMapping roleMapping, RoleMappingCB cb) { assertObjectNotNull("roleMapping", roleMapping); - assertConditionBeanNotNull(cb); + assertCBNotNull(cb); setupCommonColumnOfUpdateIfNeeds(roleMapping); filterEntityOfUpdate(roleMapping); assertEntityOfUpdate(roleMapping); - return getMyDao().updateByQuery(cb, roleMapping); + return invoke(createQueryUpdateEntityCBCommand(roleMapping, cb)); } /** @@ -508,8 +505,8 @@ * @return The deleted count. */ public int queryDelete(RoleMappingCB cb) { - assertConditionBeanNotNull(cb); - return getMyDao().deleteByQuery(cb); + assertCBNotNull(cb); + return invoke(createQueryDeleteCBCommand(cb)); } //========================================================================== @@ -521,19 +518,27 @@ // ========= // Delegate Method // =============== + // [Behavior Command] // ----------------------------------------------------- // Select // ------ protected int delegateSelectCount(RoleMappingCB cb) { - assertConditionBeanNotNull(cb); - return getMyDao().selectCount(cb); + return invoke(createSelectCountCBCommand(cb)); } + protected int doCallReadCount(ConditionBean cb) { + return delegateSelectCount((RoleMappingCB) cb); + } + protected List delegateSelectList(RoleMappingCB cb) { - assertConditionBeanNotNull(cb); - return getMyDao().selectList(cb); + return invoke(createSelectListCBCommand(cb, RoleMapping.class)); } + @SuppressWarnings("unchecked") + protected List doCallReadList(ConditionBean cb) { + return (List) delegateSelectList((RoleMappingCB) cb); + } + // ----------------------------------------------------- // Update // ------ @@ -541,38 +546,71 @@ if (!processBeforeInsert(e)) { return 1; } - return getMyDao().insert(e); + return invoke(createInsertEntityCommand(e)); } + protected int doCallCreate(Entity entity) { + return delegateInsert(downcast(entity)); + } + protected int delegateUpdate(RoleMapping e) { if (!processBeforeUpdate(e)) { return 1; } - return getMyDao().updateModifiedOnly(e); + return invoke(createUpdateEntityCommand(e)); } + protected int doCallModify(Entity entity) { + return delegateUpdate(downcast(entity)); + } + protected int delegateDelete(RoleMapping e) { if (!processBeforeDelete(e)) { return 1; } - return getMyDao().delete(e); + return invoke(createDeleteEntityCommand(e)); } + protected int doCallRemove(Entity entity) { + return delegateDelete(downcast(entity)); + } + protected int[] delegateInsertList(List ls) { - assertObjectNotNull("roleMappingList", ls); - return getMyDao().insertList(helpFilterBeforeInsertInternally(ls)); + if (ls.isEmpty()) { + return new int[] {}; + } + return invoke(createBatchInsertEntityCommand(helpFilterBeforeInsertInternally(ls))); } + @SuppressWarnings("unchecked") + protected int[] doCreateList(List ls) { + return delegateInsertList((List) ls); + } + protected int[] delegateUpdateList(List ls) { - assertObjectNotNull("roleMappingList", ls); - return getMyDao().updateList(helpFilterBeforeUpdateInternally(ls)); + if (ls.isEmpty()) { + return new int[] {}; + } + return invoke(createBatchUpdateEntityCommand(helpFilterBeforeUpdateInternally(ls))); } + @SuppressWarnings("unchecked") + protected int[] doModifyList(List ls) { + return delegateUpdateList((List) ls); + } + protected int[] delegateDeleteList(List ls) { - assertObjectNotNull("roleMappingList", ls); - return getMyDao().deleteList(helpFilterBeforeDeleteInternally(ls)); + if (ls.isEmpty()) { + return new int[] {}; + } + return invoke(createBatchDeleteEntityCommand(helpFilterBeforeDeleteInternally(ls))); } + @SuppressWarnings("unchecked") + protected int[] doRemoveList(List ls) { + return delegateDeleteList((List) ls); + } + //========================================================================== // ========= // Optimistic Lock Info Modified: notepad/trunk/src/main/java/jp/sf/pal/notepad/db/bsbhv/BsUserInfoBhv.java =================================================================== --- notepad/trunk/src/main/java/jp/sf/pal/notepad/db/bsbhv/BsUserInfoBhv.java 2008-12-27 22:11:51 UTC (rev 1627) +++ notepad/trunk/src/main/java/jp/sf/pal/notepad/db/bsbhv/BsUserInfoBhv.java 2008-12-27 22:13:37 UTC (rev 1628) @@ -1,9 +1,8 @@ package jp.sf.pal.notepad.db.bsbhv; import java.util.List; +import java.util.Map; -import jp.sf.pal.notepad.db.allcommon.DaoReadable; -import jp.sf.pal.notepad.db.allcommon.DaoWritable; import jp.sf.pal.notepad.db.allcommon.Entity; import jp.sf.pal.notepad.db.allcommon.bhv.load.LoadReferrerOption; import jp.sf.pal.notepad.db.allcommon.bhv.setup.ConditionBeanSetupper; @@ -26,7 +25,6 @@ import jp.sf.pal.notepad.db.exbhv.NotepadBhv; import jp.sf.pal.notepad.db.exbhv.NotepadCategoryBhv; import jp.sf.pal.notepad.db.exbhv.RoleMappingBhv; -import jp.sf.pal.notepad.db.exdao.UserInfoDao; import jp.sf.pal.notepad.db.exentity.GroupInfo; import jp.sf.pal.notepad.db.exentity.GroupMapping; import jp.sf.pal.notepad.db.exentity.Notepad; @@ -36,14 +34,14 @@ import jp.sf.pal.notepad.db.exentity.UserInfo; /** - * The behavior of USER_INFO. + * The behavior of USER_INFO that the type is TABLE.
* *
  * [primary-key]
  *     USER_ID
  * 
  * [column]
- *     USER_ID, GIVEN_NAME, FAMILY_NAME, MIDDLE_NAME, GIVEN_NAME_DESC, FAMILY_NAME_DESC, NICKNAME, GENDER, BIRTH_DATE, EMAIL, URL, TELEPHONE, LOCALE, ROLE_ID, GROUP_ID, CREATED_TIME, CREATED_BY, UPDATED_TIME, UPDATED_BY, DELETED_TIME, DELETED_BY, VERSIONNO
+ *     USER_ID, GIVEN_NAME, FAMILY_NAME, MIDDLE_NAME, GIVEN_NAME_DESC, FAMILY_NAME_DESC, NICKNAME, GENDER, BIRTH_DATE, EMAIL, URL, TELEPHONE, LOCALE, ROLE_ID, GROUP_ID, STATUS, CREATED_TIME, CREATED_BY, UPDATED_TIME, UPDATED_BY, DELETED_TIME, DELETED_BY, VERSIONNO
  * 
  * [sequence]
  *     
@@ -81,12 +79,6 @@
 
     //==========================================================================
     // =========
-    // Attribute
-    // =========
-    protected UserInfoDao _dao;
-
-    //==========================================================================
-    // =========
     // Table name
     // ==========
     /** @return The name on database of table. (NotNull) */
@@ -98,39 +90,18 @@
     // =========
     // DBMeta
     // ======
-    /** @return The meta data of the database. (NotNull) */
+    /** @return The instance of DBMeta. (NotNull) */
     public DBMeta getDBMeta() {
         return UserInfoDbm.getInstance();
     }
 
-    /** @return The meta data of the database as my table type. (NotNull) */
+    /** @return The instance of DBMeta as my table type. (NotNull) */
     public UserInfoDbm getMyDBMeta() {
         return UserInfoDbm.getInstance();
     }
 
     //==========================================================================
     // =========
-    // Dao Accessor
-    // ============
-    public UserInfoDao getMyDao() {
-        return _dao;
-    }
-
-    public void setMyDao(UserInfoDao dao) {
-        assertObjectNotNull("dao", dao);
-        _dao = dao;
-    }
-
-    public DaoReadable getDaoReadable() {
-        return getMyDao();
-    }
-
-    public DaoWritable getDaoWritable() {
-        return getMyDao();
-    }
-
-    //==========================================================================
-    // =========
     // New Instance
     // ============
     public Entity newEntity() {
@@ -160,7 +131,7 @@
      * @return The selected count.
      */
     public int selectCount(UserInfoCB cb) {
-        assertConditionBeanNotNull(cb);
+        assertCBNotNull(cb);
         return delegateSelectCount(cb);
     }
 
@@ -237,7 +208,7 @@
      * @return The result bean of selected list. (NotNull)
      */
     public ListResultBean selectList(UserInfoCB cb) {
-        assertConditionBeanNotNull(cb);
+        assertCBNotNull(cb);
         return new ResultBeanBuilder(getTableDbName())
                 .buildListResultBean(cb, delegateSelectList(cb));
     }
@@ -253,7 +224,7 @@
      * @return The result bean of selected page. (NotNull)
      */
     public PagingResultBean selectPage(final UserInfoCB cb) {
-        assertConditionBeanNotNull(cb);
+        assertCBNotNull(cb);
         final PagingInvoker invoker = new PagingInvoker(
                 getTableDbName());
         final PagingHandler handler = new PagingHandler() {
@@ -274,6 +245,32 @@
 
     //==========================================================================
     // =========
+    // Scalar Select
+    // =============
+    /**
+     * Select the scalar value derived by a function. 
Call a function + * method after this method called like as follows: + * + *
+     * userInfoBhv.scalarSelect(Date.class).max(new ScalarQuery(UserInfoCB cb) {
+     *     cb.specify().columnXxxDatetime(); // the required specification of target column
+     *     cb.query().setXxxName_PrefixSearch("S"); // query as you like it
+     * });
+     * 
+ * + * @param The type of result. + * @param resultType The type of result. (NotNull) + * @return The scalar value derived by a function. (Nullable) + */ + public SLFunction scalarSelect( + Class resultType) { + UserInfoCB cb = newMyConditionBean(); + cb.xsetupForScalarSelect(); + return new SLFunction(cb, resultType); + } + + //========================================================================== + // ========= // Various Select // ============== /** @@ -283,8 +280,8 @@ * @param valueLabelSetupper The setupper of value-label. (NotNull) * @return The list of value-label. (NotNull) */ - public List> selectValueLabelList( - UserInfoCB cb, ValueLabelSetupper valueLabelSetupper) { + public List> selectValueLabelList(UserInfoCB cb, + ValueLabelSetupper valueLabelSetupper) { return createValueLabelList(selectList(cb), valueLabelSetupper); } @@ -842,8 +839,8 @@ //========================================================================== // ========= - // Pullout Foreign - // =============== + // Pull out Foreign + // ================ /** * Pull out the list of foreign table 'GroupInfo'. * @@ -1168,11 +1165,11 @@ */ public int queryUpdate(UserInfo userInfo, UserInfoCB cb) { assertObjectNotNull("userInfo", userInfo); - assertConditionBeanNotNull(cb); + assertCBNotNull(cb); setupCommonColumnOfUpdateIfNeeds(userInfo); filterEntityOfUpdate(userInfo); assertEntityOfUpdate(userInfo); - return getMyDao().updateByQuery(cb, userInfo); + return invoke(createQueryUpdateEntityCBCommand(userInfo, cb)); } /** @@ -1182,8 +1179,8 @@ * @return The deleted count. */ public int queryDelete(UserInfoCB cb) { - assertConditionBeanNotNull(cb); - return getMyDao().deleteByQuery(cb); + assertCBNotNull(cb); + return invoke(createQueryDeleteCBCommand(cb)); } //========================================================================== @@ -1195,19 +1192,27 @@ // ========= // Delegate Method // =============== + // [Behavior Command] // ----------------------------------------------------- // Select // ------ protected int delegateSelectCount(UserInfoCB cb) { - assertConditionBeanNotNull(cb); - return getMyDao().selectCount(cb); + return invoke(createSelectCountCBCommand(cb)); } + protected int doCallReadCount(ConditionBean cb) { + return delegateSelectCount((UserInfoCB) cb); + } + protected List delegateSelectList(UserInfoCB cb) { - assertConditionBeanNotNull(cb); - return getMyDao().selectList(cb); + return invoke(createSelectListCBCommand(cb, UserInfo.class)); } + @SuppressWarnings("unchecked") + protected List doCallReadList(ConditionBean cb) { + return (List) delegateSelectList((UserInfoCB) cb); + } + // ----------------------------------------------------- // Update // ------ @@ -1215,62 +1220,97 @@ if (!processBeforeInsert(e)) { return 1; } - return getMyDao().insert(e); + return invoke(createInsertEntityCommand(e)); } + protected int doCallCreate(Entity entity) { + return delegateInsert(downcast(entity)); + } + protected int delegateUpdate(UserInfo e) { if (!processBeforeUpdate(e)) { return 1; } - return getMyDao().updateModifiedOnly(e); + return invoke(createUpdateEntityCommand(e)); } + protected int doCallModify(Entity entity) { + return delegateUpdate(downcast(entity)); + } + protected int delegateUpdateNonstrict(UserInfo e) { if (!processBeforeUpdate(e)) { return 1; } - return getMyDao().updateNonstrictModifiedOnly(e); + return invoke(createUpdateNonstrictEntityCommand(e)); } protected int delegateDelete(UserInfo e) { if (!processBeforeDelete(e)) { return 1; } - return getMyDao().delete(e); + return invoke(createDeleteEntityCommand(e)); } + protected int doCallRemove(Entity entity) { + return delegateDelete(downcast(entity)); + } + protected int delegateDeleteNonstrict(UserInfo e) { if (!processBeforeDelete(e)) { return 1; } - return getMyDao().deleteNonstrict(e); + return invoke(createDeleteNonstrictEntityCommand(e)); } protected int[] delegateInsertList(List ls) { - assertObjectNotNull("userInfoList", ls); - return getMyDao().insertList(helpFilterBeforeInsertInternally(ls)); + if (ls.isEmpty()) { + return new int[] {}; + } + return invoke(createBatchInsertEntityCommand(helpFilterBeforeInsertInternally(ls))); } + @SuppressWarnings("unchecked") + protected int[] doCreateList(List ls) { + return delegateInsertList((List) ls); + } + protected int[] delegateUpdateList(List ls) { - assertObjectNotNull("userInfoList", ls); - return getMyDao().updateList(helpFilterBeforeUpdateInternally(ls)); + if (ls.isEmpty()) { + return new int[] {}; + } + return invoke(createBatchUpdateEntityCommand(helpFilterBeforeUpdateInternally(ls))); } + @SuppressWarnings("unchecked") + protected int[] doModifyList(List ls) { + return delegateUpdateList((List) ls); + } + protected int[] delegateUpdateListNonstrict(List ls) { - assertObjectNotNull("userInfoList", ls); - return getMyDao().updateListNonstrict( - helpFilterBeforeUpdateInternally(ls)); + if (ls.isEmpty()) { + return new int[] {}; + } + return invoke(createBatchUpdateNonstrictEntityCommand(helpFilterBeforeUpdateInternally(ls))); } protected int[] delegateDeleteList(List ls) { - assertObjectNotNull("userInfoList", ls); - return getMyDao().deleteList(helpFilterBeforeDeleteInternally(ls)); + if (ls.isEmpty()) { + return new int[] {}; + } + return invoke(createBatchDeleteEntityCommand(helpFilterBeforeDeleteInternally(ls))); } + @SuppressWarnings("unchecked") + protected int[] doRemoveList(List ls) { + return delegateDeleteList((List) ls); + } + protected int[] delegateDeleteListNonstrict(List ls) { - assertObjectNotNull("userInfoList", ls); - return getMyDao().deleteListNonstrict( - helpFilterBeforeDeleteInternally(ls)); + if (ls.isEmpty()) { + return new int[] {}; + } + return invoke(createBatchDeleteNonstrictEntityCommand(helpFilterBeforeDeleteInternally(ls))); } //========================================================================== Modified: notepad/trunk/src/main/java/jp/sf/pal/notepad/db/bsentity/BsGroupInfo.java =================================================================== --- notepad/trunk/src/main/java/jp/sf/pal/notepad/db/bsentity/BsGroupInfo.java 2008-12-27 22:11:51 UTC (rev 1627) +++ notepad/trunk/src/main/java/jp/sf/pal/notepad/db/bsentity/BsGroupInfo.java 2008-12-27 22:13:37 UTC (rev 1628) @@ -44,7 +44,6 @@ * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public abstract class BsGroupInfo implements Entity, java.io.Serializable { //========================================================================== Modified: notepad/trunk/src/main/java/jp/sf/pal/notepad/db/bsentity/BsGroupMapping.java =================================================================== --- notepad/trunk/src/main/java/jp/sf/pal/notepad/db/bsentity/BsGroupMapping.java 2008-12-27 22:11:51 UTC (rev 1627) +++ notepad/trunk/src/main/java/jp/sf/pal/notepad/db/bsentity/BsGroupMapping.java 2008-12-27 22:13:37 UTC (rev 1628) @@ -42,7 +42,6 @@ * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public abstract class BsGroupMapping implements Entity, java.io.Serializable { //========================================================================== Modified: notepad/trunk/src/main/java/jp/sf/pal/notepad/db/bsentity/BsNotepad.java =================================================================== --- notepad/trunk/src/main/java/jp/sf/pal/notepad/db/bsentity/BsNotepad.java 2008-12-27 22:11:51 UTC (rev 1627) +++ notepad/trunk/src/main/java/jp/sf/pal/notepad/db/bsentity/BsNotepad.java 2008-12-27 22:13:37 UTC (rev 1628) @@ -43,7 +43,6 @@ * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public abstract class BsNotepad implements Entity, java.io.Serializable { //========================================================================== Modified: notepad/trunk/src/main/java/jp/sf/pal/notepad/db/bsentity/BsNotepadCategory.java =================================================================== --- notepad/trunk/src/main/java/jp/sf/pal/notepad/db/bsentity/BsNotepadCategory.java 2008-12-27 22:11:51 UTC (rev 1627) +++ notepad/trunk/src/main/java/jp/sf/pal/notepad/db/bsentity/BsNotepadCategory.java 2008-12-27 22:13:37 UTC (rev 1628) @@ -44,7 +44,6 @@ * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public abstract class BsNotepadCategory implements Entity, java.io.Serializable { //========================================================================== Modified: notepad/trunk/src/main/java/jp/sf/pal/notepad/db/bsentity/BsNotepadContent.java =================================================================== --- notepad/trunk/src/main/java/jp/sf/pal/notepad/db/bsentity/BsNotepadContent.java 2008-12-27 22:11:51 UTC (rev 1627) +++ notepad/trunk/src/main/java/jp/sf/pal/notepad/db/bsentity/BsNotepadContent.java 2008-12-27 22:13:37 UTC (rev 1628) @@ -41,7 +41,6 @@ * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public abstract class BsNotepadContent implements Entity, java.io.Serializable { //========================================================================== Modified: notepad/trunk/src/main/java/jp/sf/pal/notepad/db/bsentity/BsRoleInfo.java =================================================================== --- notepad/trunk/src/main/java/jp/sf/pal/notepad/db/bsentity/BsRoleInfo.java 2008-12-27 22:11:51 UTC (rev 1627) +++ notepad/trunk/src/main/java/jp/sf/pal/notepad/db/bsentity/BsRoleInfo.java 2008-12-27 22:13:37 UTC (rev 1628) @@ -44,7 +44,6 @@ * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public abstract class BsRoleInfo implements Entity, java.io.Serializable { //========================================================================== Modified: notepad/trunk/src/main/java/jp/sf/pal/notepad/db/bsentity/BsRoleMapping.java =================================================================== --- notepad/trunk/src/main/java/jp/sf/pal/notepad/db/bsentity/BsRoleMapping.java 2008-12-27 22:11:51 UTC (rev 1627) +++ notepad/trunk/src/main/java/jp/sf/pal/notepad/db/bsentity/BsRoleMapping.java 2008-12-27 22:13:37 UTC (rev 1628) @@ -42,7 +42,6 @@ * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public abstract class BsRoleMapping implements Entity, java.io.Serializable { //========================================================================== Modified: notepad/trunk/src/main/java/jp/sf/pal/notepad/db/bsentity/BsUserInfo.java =================================================================== --- notepad/trunk/src/main/java/jp/sf/pal/notepad/db/bsentity/BsUserInfo.java 2008-12-27 22:11:51 UTC (rev 1627) +++ notepad/trunk/src/main/java/jp/sf/pal/notepad/db/bsentity/BsUserInfo.java 2008-12-27 22:13:37 UTC (rev 1628) @@ -22,7 +22,7 @@ * USER_ID * * [column] - * USER_ID, GIVEN_NAME, FAMILY_NAME, MIDDLE_NAME, GIVEN_NAME_DESC, FAMILY_NAME_DESC, NICKNAME, GENDER, BIRTH_DATE, EMAIL, URL, TELEPHONE, LOCALE, ROLE_ID, GROUP_ID, CREATED_TIME, CREATED_BY, UPDATED_TIME, UPDATED_BY, DELETED_TIME, DELETED_BY, VERSIONNO + * USER_ID, GIVEN_NAME, FAMILY_NAME, MIDDLE_NAME, GIVEN_NAME_DESC, FAMILY_NAME_DESC, NICKNAME, GENDER, BIRTH_DATE, EMAIL, URL, TELEPHONE, LOCALE, ROLE_ID, GROUP_ID, STATUS, CREATED_TIME, CREATED_BY, UPDATED_TIME, UPDATED_BY, DELETED_TIME, DELETED_BY, VERSIONNO * * [sequence] * @@ -48,7 +48,6 @@ * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public abstract class BsUserInfo implements Entity, java.io.Serializable { //========================================================================== @@ -116,6 +115,9 @@ /** GROUP_ID: {VARCHAR(255) : FK to GROUP_INFO} */ protected String _groupId; + /** STATUS: {VARCHAR(1)} */ + protected String _status; + /** CREATED_TIME: {NotNull : TIMESTAMP} */ protected java.sql.Timestamp _createdTime; @@ -529,6 +531,7 @@ sb.append(delimiter).append(getLocale()); sb.append(delimiter).append(getRoleId()); sb.append(delimiter).append(getGroupId()); + sb.append(delimiter).append(getStatus()); sb.append(delimiter).append(getCreatedTime()); sb.append(delimiter).append(getCreatedBy()); sb.append(delimiter).append(getUpdatedTime()); @@ -880,6 +883,28 @@ this._groupId = groupId; } + /** The column annotation for S2Dao. {VARCHAR(1)} */ + public static final String status_COLUMN = "STATUS"; + + /** + * STATUS: {VARCHAR(1)}
+ * + * @return The value of the column 'STATUS'. (Nullable) + */ + public String getStatus() { + return _status; + } + + /** + * STATUS: {VARCHAR(1)}
+ * + * @param status The value of the column 'STATUS'. (Nullable) + */ + public void setStatus(String status) { + _modifiedProperties.addPropertyName("status"); + this._status = status; + } + /** The column annotation for S2Dao. {NotNull : TIMESTAMP} */ public static final String createdTime_COLUMN = "CREATED_TIME"; Modified: notepad/trunk/src/main/java/jp/sf/pal/notepad/db/bsentity/dbmeta/GroupInfoDbm.java =================================================================== --- notepad/trunk/src/main/java/jp/sf/pal/notepad/db/bsentity/dbmeta/GroupInfoDbm.java 2008-12-27 22:11:51 UTC (rev 1627) +++ notepad/trunk/src/main/java/jp/sf/pal/notepad/db/bsentity/dbmeta/GroupInfoDbm.java 2008-12-27 22:13:37 UTC (rev 1628) @@ -8,6 +8,7 @@ import jp.sf.pal.notepad.db.allcommon.dbmeta.info.ColumnInfo; import jp.sf.pal.notepad.db.allcommon.dbmeta.info.ReferrerInfo; import jp.sf.pal.notepad.db.allcommon.dbmeta.info.UniqueInfo; +import jp.sf.pal.notepad.db.allcommon.helper.StringKeyMap; import jp.sf.pal.notepad.db.exentity.GroupInfo; /** @@ -15,7 +16,6 @@ * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public class GroupInfoDbm extends AbstractDBMeta { private static final GroupInfoDbm _instance = new GroupInfoDbm(); @@ -138,40 +138,14 @@ return _columnVersionno; } - { - initializeColumnInfoList(); - } - //========================================================================== // ========= - // Name Map - // ======== - public Map getDbNamePropertyNameKeyToLowerMap() { - return createDbNamePropertyNameKeyToLowerMap(); + // Resource Initialization + // ======================= + { + initializeInformationResource(); } - public Map getPropertyNameDbNameKeyToLowerMap() { - return createPropertyNameDbNameKeyToLowerMap(); - } - - protected static Map _dbNamePropertyNameKeyToLowerMap; - - protected Map createDbNamePropertyNameKeyToLowerMap() { - if (_dbNamePropertyNameKeyToLowerMap == null) { - _dbNamePropertyNameKeyToLowerMap = setupKeyToLowerMap(true); - } - return _dbNamePropertyNameKeyToLowerMap; - } - - protected static Map _propertyNameDbNameKeyToLowerMap; - - protected Map createPropertyNameDbNameKeyToLowerMap() { - if (_propertyNameDbNameKeyToLowerMap == null) { - _propertyNameDbNameKeyToLowerMap = setupKeyToLowerMap(false); - } - return _propertyNameDbNameKeyToLowerMap; - } - //========================================================================== // ========= // Type Name @@ -341,7 +315,8 @@ // Entity Property Setup // ===================== // It's very INTERNAL! - protected Map> _epsMap = newHashMap(); + protected Map> _epsMap = StringKeyMap + .createAsFlexibleConcurrent(); { setupEps(_epsMap, new EpsGroupId(), columnGroupId()); setupEps(_epsMap, new EpsName(), columnName()); Modified: notepad/trunk/src/main/java/jp/sf/pal/notepad/db/bsentity/dbmeta/GroupMappingDbm.java =================================================================== --- notepad/trunk/src/main/java/jp/sf/pal/notepad/db/bsentity/dbmeta/GroupMappingDbm.java 2008-12-27 22:11:51 UTC (rev 1627) +++ notepad/trunk/src/main/java/jp/sf/pal/notepad/db/bsentity/dbmeta/GroupMappingDbm.java 2008-12-27 22:13:37 UTC (rev 1628) @@ -8,6 +8,7 @@ import jp.sf.pal.notepad.db.allcommon.dbmeta.info.ColumnInfo; import jp.sf.pal.notepad.db.allcommon.dbmeta.info.ForeignInfo; import jp.sf.pal.notepad.db.allcommon.dbmeta.info.UniqueInfo; +import jp.sf.pal.notepad.db.allcommon.helper.StringKeyMap; import jp.sf.pal.notepad.db.exentity.GroupMapping; /** @@ -15,7 +16,6 @@ * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public class GroupMappingDbm extends AbstractDBMeta { private static final GroupMappingDbm _instance = new GroupMappingDbm(); @@ -68,40 +68,14 @@ return _columnGroupId; } - { - initializeColumnInfoList(); - } - //========================================================================== // ========= - // Name Map - // ======== - public Map getDbNamePropertyNameKeyToLowerMap() { - return createDbNamePropertyNameKeyToLowerMap(); + // Resource Initialization + // ======================= + { + initializeInformationResource(); } - public Map getPropertyNameDbNameKeyToLowerMap() { - return createPropertyNameDbNameKeyToLowerMap(); - } - - protected static Map _dbNamePropertyNameKeyToLowerMap; - - protected Map createDbNamePropertyNameKeyToLowerMap() { - if (_dbNamePropertyNameKeyToLowerMap == null) { - _dbNamePropertyNameKeyToLowerMap = setupKeyToLowerMap(true); - } - return _dbNamePropertyNameKeyToLowerMap; - } - - protected static Map _propertyNameDbNameKeyToLowerMap; - - protected Map createPropertyNameDbNameKeyToLowerMap() { - if (_propertyNameDbNameKeyToLowerMap == null) { - _propertyNameDbNameKeyToLowerMap = setupKeyToLowerMap(false); - } - return _propertyNameDbNameKeyToLowerMap; - } - //========================================================================== // ========= // Type Name @@ -263,7 +237,8 @@ // Entity Property Setup // ===================== // It's very INTERNAL! - protected Map> _epsMap = newHashMap(); + protected Map> _epsMap = StringKeyMap + .createAsFlexibleConcurrent(); { setupEps(_epsMap, new EpsId(), columnId()); setupEps(_epsMap, new EpsUserId(), columnUserId()); Modified: notepad/trunk/src/main/java/jp/sf/pal/notepad/db/bsentity/dbmeta/NotepadCategoryDbm.java =================================================================== --- notepad/trunk/src/main/java/jp/sf/pal/notepad/db/bsentity/dbmeta/NotepadCategoryDbm.java 2008-12-27 22:11:51 UTC (rev 1627) +++ notepad/trunk/src/main/java/jp/sf/pal/notepad/db/bsentity/dbmeta/NotepadCategoryDbm.java 2008-12-27 22:13:37 UTC (rev 1628) @@ -9,6 +9,7 @@ import jp.sf.pal.notepad.db.allcommon.dbmeta.info.ForeignInfo; import jp.sf.pal.notepad.db.allcommon.dbmeta.info.ReferrerInfo; import jp.sf.pal.notepad.db.allcommon.dbmeta.info.UniqueInfo; +import jp.sf.pal.notepad.db.allcommon.helper.StringKeyMap; import jp.sf.pal.notepad.db.exentity.NotepadCategory; /** @@ -16,7 +17,6 @@ * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public class NotepadCategoryDbm extends AbstractDBMeta { private static final NotepadCategoryDbm _instance = new NotepadCategoryDbm(); @@ -125,40 +125,14 @@ return _columnVersionno; } - { - initializeColumnInfoList(); - } - //========================================================================== // ========= - // Name Map - // ======== - public Map getDbNamePropertyNameKeyToLowerMap() { - return createDbNamePropertyNameKeyToLowerMap(); + // Resource Initialization + // ======================= + { + initializeInformationResource(); } - public Map getPropertyNameDbNameKeyToLowerMap() { - return createPropertyNameDbNameKeyToLowerMap(); - } - - protected static Map _dbNamePropertyNameKeyToLowerMap; - - protected Map createDbNamePropertyNameKeyToLowerMap() { - if (_dbNamePropertyNameKeyToLowerMap == null) { - _dbNamePropertyNameKeyToLowerMap = setupKeyToLowerMap(true); - } - return _dbNamePropertyNameKeyToLowerMap; - } - - protected static Map _propertyNameDbNameKeyToLowerMap; - - protected Map createPropertyNameDbNameKeyToLowerMap() { - if (_propertyNameDbNameKeyToLowerMap == null) { - _propertyNameDbNameKeyToLowerMap = setupKeyToLowerMap(false); - } - return _propertyNameDbNameKeyToLowerMap; - } - //========================================================================== // ========= // Type Name @@ -335,7 +309,8 @@ // Entity Property Setup // ===================== // It's very INTERNAL! - protected Map> _epsMap = newHashMap(); + protected Map> _epsMap = StringKeyMap + .createAsFlexibleConcurrent(); { setupEps(_epsMap, new EpsId(), columnId()); setupEps(_epsMap, new EpsName(), columnName()); Modified: notepad/trunk/src/main/java/jp/sf/pal/notepad/db/bsentity/dbmeta/NotepadContentDbm.java =================================================================== --- notepad/trunk/src/main/java/jp/sf/pal/notepad/db/bsentity/dbmeta/NotepadContentDbm.java 2008-12-27 22:11:51 UTC (rev 1627) +++ notepad/trunk/src/main/java/jp/sf/pal/notepad/db/bsentity/dbmeta/NotepadContentDbm.java 2008-12-27 22:13:37 UTC (rev 1628) @@ -8,6 +8,7 @@ import jp.sf.pal.notepad.db.allcommon.dbmeta.info.ColumnInfo; import jp.sf.pal.notepad.db.allcommon.dbmeta.info.ForeignInfo; import jp.sf.pal.notepad.db.allcommon.dbmeta.info.UniqueInfo; +import jp.sf.pal.notepad.db.allcommon.helper.StringKeyMap; import jp.sf.pal.notepad.db.exentity.NotepadContent; /** @@ -15,7 +16,6 @@ * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public class NotepadContentDbm extends AbstractDBMeta { private static final NotepadContentDbm _instance = new NotepadContentDbm(); @@ -61,40 +61,14 @@ return _columnContent; } - { - initializeColumnInfoList(); - } - //========================================================================== // ========= - // Name Map - // ======== - public Map getDbNamePropertyNameKeyToLowerMap() { - return createDbNamePropertyNameKeyToLowerMap(); + // Resource Initialization + // ======================= + { + initializeInformationResource(); } - public Map getPropertyNameDbNameKeyToLowerMap() { - return createPropertyNameDbNameKeyToLowerMap(); - } - - protected static Map _dbNamePropertyNameKeyToLowerMap; - - protected Map createDbNamePropertyNameKeyToLowerMap() { - if (_dbNamePropertyNameKeyToLowerMap == null) { - _dbNamePropertyNameKeyToLowerMap = setupKeyToLowerMap(true); - } - return _dbNamePropertyNameKeyToLowerMap; - } - - protected static Map _propertyNameDbNameKeyToLowerMap; - - protected Map createPropertyNameDbNameKeyToLowerMap() { - if (_propertyNameDbNameKeyToLowerMap == null) { - _propertyNameDbNameKeyToLowerMap = setupKeyToLowerMap(false); - } - return _propertyNameDbNameKeyToLowerMap; - } - //========================================================================== // ========= // Type Name @@ -250,7 +224,8 @@ // Entity Property Setup // ===================== // It's very INTERNAL! - protected Map> _epsMap = newHashMap(); + protected Map> _epsMap = StringKeyMap + .createAsFlexibleConcurrent(); { setupEps(_epsMap, new EpsId(), columnId()); setupEps(_epsMap, new EpsContent(), columnContent()); Modified: notepad/trunk/src/main/java/jp/sf/pal/notepad/db/bsentity/dbmeta/NotepadDbm.java =================================================================== --- notepad/trunk/src/main/java/jp/sf/pal/notepad/db/bsentity/dbmeta/NotepadDbm.java 2008-12-27 22:11:51 UTC (rev 1627) +++ notepad/trunk/src/main/java/jp/sf/pal/notepad/db/bsentity/dbmeta/NotepadDbm.java 2008-12-27 22:13:37 UTC (rev 1628) @@ -8,6 +8,7 @@ import jp.sf.pal.notepad.db.allcommon.dbmeta.info.ColumnInfo; import jp.sf.pal.notepad.db.allcommon.dbmeta.info.ForeignInfo; import jp.sf.pal.notepad.db.allcommon.dbmeta.info.UniqueInfo; +import jp.sf.pal.notepad.db.allcommon.helper.StringKeyMap; import jp.sf.pal.notepad.db.exentity.Notepad; /** @@ -15,7 +16,6 @@ * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public class NotepadDbm extends AbstractDBMeta { private static final NotepadDbm _instance = new NotepadDbm(); @@ -124,40 +124,14 @@ return _columnVersionno; } - { - initializeColumnInfoList(); - } - //========================================================================== // ========= - // Name Map - // ======== - public Map getDbNamePropertyNameKeyToLowerMap() { - return createDbNamePropertyNameKeyToLowerMap(); + // Resource Initialization + // ======================= + { + initializeInformationResource(); } - public Map getPropertyNameDbNameKeyToLowerMap() { - return createPropertyNameDbNameKeyToLowerMap(); - } - - protected static Map _dbNamePropertyNameKeyToLowerMap; - - protected Map createDbNamePropertyNameKeyToLowerMap() { - if (_dbNamePropertyNameKeyToLowerMap == null) { - _dbNamePropertyNameKeyToLowerMap = setupKeyToLowerMap(true); - } - return _dbNamePropertyNameKeyToLowerMap; - } - - protected static Map _propertyNameDbNameKeyToLowerMap; - - protected Map createPropertyNameDbNameKeyToLowerMap() { - if (_propertyNameDbNameKeyToLowerMap == null) { - _propertyNameDbNameKeyToLowerMap = setupKeyToLowerMap(false); - } - return _propertyNameDbNameKeyToLowerMap; - } - //========================================================================== // ========= // Type Name @@ -342,7 +316,8 @@ // Entity Property Setup // ===================== // It's very INTERNAL! - protected Map> _epsMap = newHashMap(); + protected Map> _epsMap = StringKeyMap + .createAsFlexibleConcurrent(); { setupEps(_epsMap, new EpsId(), columnId()); setupEps(_epsMap, new EpsTitle(), columnTitle()); Modified: notepad/trunk/src/main/java/jp/sf/pal/notepad/db/bsentity/dbmeta/RoleInfoDbm.java =================================================================== --- notepad/trunk/src/main/java/jp/sf/pal/notepad/db/bsentity/dbmeta/RoleInfoDbm.java 2008-12-27 22:11:51 UTC (rev 1627) +++ notepad/trunk/src/main/java/jp/sf/pal/notepad/db/bsentity/dbmeta/RoleInfoDbm.java 2008-12-27 22:13:37 UTC (rev 1628) @@ -8,6 +8,7 @@ import jp.sf.pal.notepad.db.allcommon.dbmeta.info.ColumnInfo; import jp.sf.pal.notepad.db.allcommon.dbmeta.info.ReferrerInfo; import jp.sf.pal.notepad.db.allcommon.dbmeta.info.UniqueInfo; +import jp.sf.pal.notepad.db.allcommon.helper.StringKeyMap; import jp.sf.pal.notepad.db.exentity.RoleInfo; /** @@ -15,7 +16,6 @@ * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public class RoleInfoDbm extends AbstractDBMeta { private static final RoleInfoDbm _instance = new RoleInfoDbm(); @@ -138,40 +138,14 @@ return _columnVersionno; } - { - initializeColumnInfoList(); - } - //========================================================================== // ========= - // Name Map - // ======== - public Map getDbNamePropertyNameKeyToLowerMap() { - return createDbNamePropertyNameKeyToLowerMap(); + // Resource Initialization + // ======================= + { + initializeInformationResource(); } - public Map getPropertyNameDbNameKeyToLowerMap() { - return createPropertyNameDbNameKeyToLowerMap(); - } - - protected static Map _dbNamePropertyNameKeyToLowerMap; - - protected Map createDbNamePropertyNameKeyToLowerMap() { - if (_dbNamePropertyNameKeyToLowerMap == null) { - _dbNamePropertyNameKeyToLowerMap = setupKeyToLowerMap(true); - } - return _dbNamePropertyNameKeyToLowerMap; - } - - protected static Map _propertyNameDbNameKeyToLowerMap; - - protected Map createPropertyNameDbNameKeyToLowerMap() { - if (_propertyNameDbNameKeyToLowerMap == null) { - _propertyNameDbNameKeyToLowerMap = setupKeyToLowerMap(false); - } - return _propertyNameDbNameKeyToLowerMap; - } - //========================================================================== // ========= // Type Name @@ -341,7 +315,8 @@ // Entity Property Setup // ===================== // It's very INTERNAL! - protected Map> _epsMap = newHashMap(); + protected Map> _epsMap = StringKeyMap + .createAsFlexibleConcurrent(); { setupEps(_epsMap, new EpsRoleId(), columnRoleId()); setupEps(_epsMap, new EpsName(), columnName()); Modified: notepad/trunk/src/main/java/jp/sf/pal/notepad/db/bsentity/dbmeta/RoleMappingDbm.java =================================================================== --- notepad/trunk/src/main/java/jp/sf/pal/notepad/db/bsentity/dbmeta/RoleMappingDbm.java 2008-12-27 22:11:51 UTC (rev 1627) +++ notepad/trunk/src/main/java/jp/sf/pal/notepad/db/bsentity/dbmeta/RoleMappingDbm.java 2008-12-27 22:13:37 UTC (rev 1628) @@ -8,6 +8,7 @@ import jp.sf.pal.notepad.db.allcommon.dbmeta.info.ColumnInfo; import jp.sf.pal.notepad.db.allcommon.dbmeta.info.ForeignInfo; import jp.sf.pal.notepad.db.allcommon.dbmeta.info.UniqueInfo; +import jp.sf.pal.notepad.db.allcommon.helper.StringKeyMap; import jp.sf.pal.notepad.db.exentity.RoleMapping; /** @@ -15,7 +16,6 @@ * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public class RoleMappingDbm extends AbstractDBMeta { private static final RoleMappingDbm _instance = new RoleMappingDbm(); @@ -68,40 +68,14 @@ return _columnRoleId; } - { - initializeColumnInfoList(); - } - //========================================================================== // ========= - // Name Map - // ======== - public Map getDbNamePropertyNameKeyToLowerMap() { - return createDbNamePropertyNameKeyToLowerMap(); + // Resource Initialization + // ======================= + { + initializeInformationResource(); } - public Map getPropertyNameDbNameKeyToLowerMap() { - return createPropertyNameDbNameKeyToLowerMap(); - } - - protected static Map _dbNamePropertyNameKeyToLowerMap; - - protected Map createDbNamePropertyNameKeyToLowerMap() { - if (_dbNamePropertyNameKeyToLowerMap == null) { - _dbNamePropertyNameKeyToLowerMap = setupKeyToLowerMap(true); - } - return _dbNamePropertyNameKeyToLowerMap; - } - - protected static Map _propertyNameDbNameKeyToLowerMap; - - protected Map createPropertyNameDbNameKeyToLowerMap() { - if (_propertyNameDbNameKeyToLowerMap == null) { - _propertyNameDbNameKeyToLowerMap = setupKeyToLowerMap(false); - } - return _propertyNameDbNameKeyToLowerMap; - } - //========================================================================== // ========= // Type Name @@ -263,7 +237,8 @@ // Entity Property Setup // ===================== // It's very INTERNAL! - protected Map> _epsMap = newHashMap(); + protected Map> _epsMap = StringKeyMap + .createAsFlexibleConcurrent(); { setupEps(_epsMap, new EpsId(), columnId()); setupEps(_epsMap, new EpsUserId(), columnUserId()); Modified: notepad/trunk/src/main/java/jp/sf/pal/notepad/db/bsentity/dbmeta/UserInfoDbm.java =================================================================== --- notepad/trunk/src/main/java/jp/sf/pal/notepad/db/bsentity/dbmeta/UserInfoDbm.java 2008-12-27 22:11:51 UTC (rev 1627) +++ notepad/trunk/src/main/java/jp/sf/pal/notepad/db/bsentity/dbmeta/UserInfoDbm.java 2008-12-27 22:13:37 UTC (rev 1628) @@ -9,6 +9,7 @@ import jp.sf.pal.notepad.db.allcommon.dbmeta.info.ForeignInfo; import jp.sf.pal.notepad.db.allcommon.dbmeta.info.ReferrerInfo; import jp.sf.pal.notepad.db.allcommon.dbmeta.info.UniqueInfo; +import jp.sf.pal.notepad.db.allcommon.helper.StringKeyMap; import jp.sf.pal.notepad.db.exentity.UserInfo; /** @@ -16,7 +17,6 @@ * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public class UserInfoDbm extends AbstractDBMeta { private static final UserInfoDbm _instance = new UserInfoDbm(); @@ -93,6 +93,9 @@ protected ColumnInfo _columnGroupId = cci("GROUP_ID", "groupId", String.class, false, 255, 0); + protected ColumnInfo _columnStatus = cci("STATUS", "status", String.class, + false, 1, 0); + protected ColumnInfo _columnCreatedTime = cci("CREATED_TIME", "createdTime", java.sql.Timestamp.class, false, null, null); @@ -174,6 +177,10 @@ return _columnGroupId; } + public ColumnInfo columnStatus() { + return _columnStatus; + } + public ColumnInfo columnCreatedTime() { return _columnCreatedTime; } @@ -202,40 +209,14 @@ return _columnVersionno; } - { - initializeColumnInfoList(); - } - //========================================================================== // ========= - // Name Map - // ======== - public Map getDbNamePropertyNameKeyToLowerMap() { - return createDbNamePropertyNameKeyToLowerMap(); + // Resource Initialization + // ======================= + { + initializeInformationResource(); } - public Map getPropertyNameDbNameKeyToLowerMap() { - return createPropertyNameDbNameKeyToLowerMap(); - } - - protected static Map _dbNamePropertyNameKeyToLowerMap; - - protected Map createDbNamePropertyNameKeyToLowerMap() { - if (_dbNamePropertyNameKeyToLowerMap == null) { - _dbNamePropertyNameKeyToLowerMap = setupKeyToLowerMap(true); - } - return _dbNamePropertyNameKeyToLowerMap; - } - - protected static Map _propertyNameDbNameKeyToLowerMap; - - protected Map createPropertyNameDbNameKeyToLowerMap() { - if (_propertyNameDbNameKeyToLowerMap == null) { - _propertyNameDbNameKeyToLowerMap = setupKeyToLowerMap(false); - } - return _propertyNameDbNameKeyToLowerMap; - } - //========================================================================== // ========= // Type Name @@ -445,7 +426,8 @@ // Entity Property Setup // ===================== // It's very INTERNAL! - protected Map> _epsMap = newHashMap(); + protected Map> _epsMap = StringKeyMap + .createAsFlexibleConcurrent(); { setupEps(_epsMap, new EpsUserId(), columnUserId()); setupEps(_epsMap, new EpsGivenName(), columnGivenName()); @@ -462,6 +444,7 @@ setupEps(_epsMap, new EpsLocale(), columnLocale()); setupEps(_epsMap, new EpsRoleId(), columnRoleId()); setupEps(_epsMap, new EpsGroupId(), columnGroupId()); + setupEps(_epsMap, new EpsStatus(), columnStatus()); setupEps(_epsMap, new EpsCreatedTime(), columnCreatedTime()); setupEps(_epsMap, new EpsCreatedBy(), columnCreatedBy()); setupEps(_epsMap, new EpsUpdatedTime(), columnUpdatedTime()); @@ -570,6 +553,12 @@ } } + public static class EpsStatus implements Eps { + public void setup(UserInfo e, Object v) { + e.setStatus((String) v); + } + } + public static class EpsCreatedTime implements Eps { public void setup(UserInfo e, Object v) { e.setCreatedTime((java.sql.Timestamp) v); Modified: notepad/trunk/src/main/java/jp/sf/pal/notepad/db/cbean/bs/BsGroupInfoCB.java =================================================================== --- notepad/trunk/src/main/java/jp/sf/pal/notepad/db/cbean/bs/BsGroupInfoCB.java 2008-12-27 22:11:51 UTC (rev 1627) +++ notepad/trunk/src/main/java/jp/sf/pal/notepad/db/cbean/bs/BsGroupInfoCB.java 2008-12-27 22:13:37 UTC (rev 1628) @@ -17,7 +17,6 @@ * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public class BsGroupInfoCB extends AbstractConditionBean { //========================================================================== @@ -86,7 +85,12 @@ return _conditionQuery; } - public ConditionQuery getConditionQueryAsInterface() { + /** + * The implementation. + * + * @return The conditionQuery of the local table as interface. (NotNull) + */ + public ConditionQuery localCQ() { return getConditionQuery(); } @@ -136,23 +140,6 @@ query().xsetUnionAllQuery(cq); } - /** - * @param unionQuery The query of 'union'. (NotNull) - * @deprecated Sorry! Please use union(UnionQuery unionQuery). - */ - public void union(GroupInfoCQ unionQuery) { - query().xsetUnionQuery(unionQuery); - } - - /** - * @param unionQuery The query of 'union'. (NotNull) - * @deprecated Sorry! Please use unionAll(UnionQuery - * unionQuery). - */ - public void unionAll(GroupInfoCQ unionQuery) { - query().xsetUnionAllQuery(unionQuery); - } - public boolean hasUnionQueryOrUnionAllQuery() { return query().hasUnionQueryOrUnionAllQuery(); } @@ -180,7 +167,8 @@ public GroupInfoCQ qy() { return query(); } - }, _forDeriveReferrer); + }, _forDerivedReferrer, _forScalarSelect, + _forScalarSubQuery); } return _specification; } @@ -190,8 +178,10 @@ protected SpQyCall _myQyCall; public Specification(ConditionBean baseCB, - SpQyCall qyCall, boolean forDeriveReferrer) { - super(baseCB, qyCall, forDeriveReferrer); + SpQyCall qyCall, boolean forDeriveReferrer, + boolean forScalarSelect, boolean forScalarSubQuery) { + super(baseCB, qyCall, forDeriveReferrer, forScalarSelect, + forScalarSubQuery); _myQyCall = qyCall; } Modified: notepad/trunk/src/main/java/jp/sf/pal/notepad/db/cbean/bs/BsGroupMappingCB.java =================================================================== --- notepad/trunk/src/main/java/jp/sf/pal/notepad/db/cbean/bs/BsGroupMappingCB.java 2008-12-27 22:11:51 UTC (rev 1627) +++ notepad/trunk/src/main/java/jp/sf/pal/notepad/db/cbean/bs/BsGroupMappingCB.java 2008-12-27 22:13:37 UTC (rev 1628) @@ -21,7 +21,6 @@ * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public class BsGroupMappingCB extends AbstractConditionBean { //========================================================================== @@ -89,7 +88,12 @@ return _conditionQuery; } - public ConditionQuery getConditionQueryAsInterface() { + /** + * The implementation. + * + * @return The conditionQuery of the local table as interface. (NotNull) + */ + public ConditionQuery localCQ() { return getConditionQuery(); } @@ -139,24 +143,6 @@ query().xsetUnionAllQuery(cq); } - /** - * @param unionQuery The query of 'union'. (NotNull) - * @deprecated Sorry! Please use union(UnionQuery - * unionQuery). - */ - public void union(GroupMappingCQ unionQuery) { - query().xsetUnionQuery(unionQuery); - } - - /** - * @param unionQuery The query of 'union'. (NotNull) - * @deprecated Sorry! Please use unionAll(UnionQuery - * unionQuery). - */ - public void unionAll(GroupMappingCQ unionQuery) { - query().xsetUnionAllQuery(unionQuery); - } - public boolean hasUnionQueryOrUnionAllQuery() { return query().hasUnionQueryOrUnionAllQuery(); } @@ -165,7 +151,6 @@ // ========= // Setup Select // ============ - protected GroupInfoNss _nssGroupInfo; public GroupInfoNss getNssGroupInfo() { @@ -226,7 +211,8 @@ public GroupMappingCQ qy() { return query(); } - }, _forDeriveReferrer); + }, _forDerivedReferrer, _forScalarSelect, + _forScalarSubQuery); } return _specification; } @@ -240,8 +226,10 @@ protected UserInfoCB.Specification _userInfo; public Specification(ConditionBean baseCB, - SpQyCall qyCall, boolean forDeriveReferrer) { - super(baseCB, qyCall, forDeriveReferrer); + SpQyCall qyCall, boolean forDeriveReferrer, + boolean forScalarSelect, boolean forScalarSubQuery) { + super(baseCB, qyCall, forDeriveReferrer, forScalarSelect, + forScalarSubQuery); _myQyCall = qyCall; } @@ -285,7 +273,8 @@ public GroupInfoCQ qy() { return _myQyCall.qy().queryGroupInfo(); } - }, _forDeriveReferrer); + }, _forDerivedReferrer, _forScalarSelect, + _forScalarSubQuery); } return _groupInfo; } @@ -304,7 +293,8 @@ public UserInfoCQ qy() { return _myQyCall.qy().queryUserInfo(); } - }, _forDeriveReferrer); + }, _forDerivedReferrer, _forScalarSelect, + _forScalarSubQuery); } return _userInfo; } Modified: notepad/trunk/src/main/java/jp/sf/pal/notepad/db/cbean/bs/BsNotepadCB.java =================================================================== --- notepad/trunk/src/main/java/jp/sf/pal/notepad/db/cbean/bs/BsNotepadCB.java 2008-12-27 22:11:51 UTC (rev 1627) +++ notepad/trunk/src/main/java/jp/sf/pal/notepad/db/cbean/bs/BsNotepadCB.java 2008-12-27 22:13:37 UTC (rev 1628) @@ -24,7 +24,6 @@ * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public class BsNotepadCB extends AbstractConditionBean { //========================================================================== @@ -92,7 +91,12 @@ return _conditionQuery; } - public ConditionQuery getConditionQueryAsInterface() { + /** + * The implementation. + * + * @return The conditionQuery of the local table as interface. (NotNull) + */ + public ConditionQuery localCQ() { return getConditionQuery(); } @@ -142,22 +146,6 @@ query().xsetUnionAllQuery(cq); } - /** - * @param unionQuery The query of 'union'. (NotNull) - * @deprecated Sorry! Please use union(UnionQuery unionQuery). - */ - public void union(NotepadCQ unionQuery) { - query().xsetUnionQuery(unionQuery); - } - - /** - * @param unionQuery The query of 'union'. (NotNull) - * @deprecated Sorry! Please use unionAll(UnionQuery unionQuery). - */ - public void unionAll(NotepadCQ unionQuery) { - query().xsetUnionAllQuery(unionQuery); - } - public boolean hasUnionQueryOrUnionAllQuery() { return query().hasUnionQueryOrUnionAllQuery(); } @@ -166,7 +154,6 @@ // ========= // Setup Select // ============ - protected NotepadCategoryNss _nssNotepadCategory; public NotepadCategoryNss getNssNotepadCategory() { @@ -276,7 +263,7 @@ public NotepadCQ qy() { return query(); } - }, _forDeriveReferrer); + }, _forDerivedReferrer, _forScalarSelect, _forScalarSubQuery); } return _specification; } @@ -293,8 +280,10 @@ protected NotepadContentCB.Specification _notepadContentAsOne; public Specification(ConditionBean baseCB, SpQyCall qyCall, - boolean forDeriveReferrer) { - super(baseCB, qyCall, forDeriveReferrer); + boolean forDeriveReferrer, boolean forScalarSelect, + boolean forScalarSubQuery) { + super(baseCB, qyCall, forDeriveReferrer, forScalarSelect, + forScalarSubQuery); _myQyCall = qyCall; } @@ -362,7 +351,8 @@ public NotepadCategoryCB.Specification specifyNotepadCategory() { assertForeign("notepadCategory"); if (_notepadCategory == null) { - _notepadCategory = new NotepadCategoryCB.Specification(_baseCB, + _notepadCategory = new NotepadCategoryCB.Specification( + _baseCB, new SpQyCall() { public boolean has() { return _myQyCall.has() @@ -374,7 +364,8 @@ public NotepadCategoryCQ qy() { return _myQyCall.qy().queryNotepadCategory(); } - }, _forDeriveReferrer); + }, _forDerivedReferrer, _forScalarSelect, + _forScalarSubQuery); } return _notepadCategory; } @@ -382,7 +373,8 @@ public UserInfoCB.Specification specifyUserInfoByCreatedBy() { assertForeign("userInfoByCreatedBy"); if (_userInfoByCreatedBy == null) { - _userInfoByCreatedBy = new UserInfoCB.Specification(_baseCB, + _userInfoByCreatedBy = new UserInfoCB.Specification( + _baseCB, new SpQyCall() { public boolean has() { return _myQyCall.has() @@ -395,7 +387,8 @@ return _myQyCall.qy() .queryUserInfoByCreatedBy(); } - }, _forDeriveReferrer); + }, _forDerivedReferrer, _forScalarSelect, + _forScalarSubQuery); } return _userInfoByCreatedBy; } @@ -403,7 +396,8 @@ public UserInfoCB.Specification specifyUserInfoByUpdatedBy() { assertForeign("userInfoByUpdatedBy"); if (_userInfoByUpdatedBy == null) { - _userInfoByUpdatedBy = new UserInfoCB.Specification(_baseCB, + _userInfoByUpdatedBy = new UserInfoCB.Specification( + _baseCB, new SpQyCall() { public boolean has() { return _myQyCall.has() @@ -416,7 +410,8 @@ return _myQyCall.qy() .queryUserInfoByUpdatedBy(); } - }, _forDeriveReferrer); + }, _forDerivedReferrer, _forScalarSelect, + _forScalarSubQuery); } return _userInfoByUpdatedBy; } @@ -425,7 +420,8 @@ assertForeign("notepadContentAsOne"); if (_notepadContentAsOne == null) { _notepadContentAsOne = new NotepadContentCB.Specification( - _baseCB, new SpQyCall() { + _baseCB, + new SpQyCall() { public boolean has() { return _myQyCall.has() && _myQyCall @@ -437,7 +433,8 @@ return _myQyCall.qy() .queryNotepadContentAsOne(); } - }, _forDeriveReferrer); + }, _forDerivedReferrer, _forScalarSelect, + _forScalarSubQuery); } return _notepadContentAsOne; } Modified: notepad/trunk/src/main/java/jp/sf/pal/notepad/db/cbean/bs/BsNotepadCategoryCB.java =================================================================== --- notepad/trunk/src/main/java/jp/sf/pal/notepad/db/cbean/bs/BsNotepadCategoryCB.java 2008-12-27 22:11:51 UTC (rev 1627) +++ notepad/trunk/src/main/java/jp/sf/pal/notepad/db/cbean/bs/BsNotepadCategoryCB.java 2008-12-27 22:13:37 UTC (rev 1628) @@ -19,7 +19,6 @@ * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public class BsNotepadCategoryCB extends AbstractConditionBean { //========================================================================== @@ -87,7 +86,12 @@ return _conditionQuery; } - public ConditionQuery getConditionQueryAsInterface() { + /** + * The implementation. + * + * @return The conditionQuery of the local table as interface. (NotNull) + */ + public ConditionQuery localCQ() { return getConditionQuery(); } @@ -137,24 +141,6 @@ query().xsetUnionAllQuery(cq); } - /** - * @param unionQuery The query of 'union'. (NotNull) - * @deprecated Sorry! Please use union(UnionQuery - * unionQuery). - */ - public void union(NotepadCategoryCQ unionQuery) { - query().xsetUnionQuery(unionQuery); - } - - /** - * @param unionQuery The query of 'union'. (NotNull) - * @deprecated Sorry! Please use unionAll(UnionQuery - * unionQuery). - */ - public void unionAll(NotepadCategoryCQ unionQuery) { - query().xsetUnionAllQuery(unionQuery); - } - public boolean hasUnionQueryOrUnionAllQuery() { return query().hasUnionQueryOrUnionAllQuery(); } @@ -163,7 +149,6 @@ // ========= // Setup Select // ============ - protected UserInfoNss _nssUserInfoByCreatedBy; public UserInfoNss getNssUserInfoByCreatedBy() { @@ -228,7 +213,8 @@ public NotepadCategoryCQ qy() { return query(); } - }, _forDeriveReferrer); + }, _forDerivedReferrer, _forScalarSelect, + _forScalarSubQuery); } return _specification; } @@ -242,8 +228,10 @@ protected UserInfoCB.Specification _userInfoByUpdatedBy; public Specification(ConditionBean baseCB, - SpQyCall qyCall, boolean forDeriveReferrer) { - super(baseCB, qyCall, forDeriveReferrer); + SpQyCall qyCall, boolean forDeriveReferrer, + boolean forScalarSelect, boolean forScalarSubQuery) { + super(baseCB, qyCall, forDeriveReferrer, forScalarSelect, + forScalarSubQuery); _myQyCall = qyCall; } @@ -308,7 +296,8 @@ public UserInfoCB.Specification specifyUserInfoByCreatedBy() { assertForeign("userInfoByCreatedBy"); if (_userInfoByCreatedBy == null) { - _userInfoByCreatedBy = new UserInfoCB.Specification(_baseCB, + _userInfoByCreatedBy = new UserInfoCB.Specification( + _baseCB, new SpQyCall() { public boolean has() { return _myQyCall.has() @@ -321,7 +310,8 @@ return _myQyCall.qy() .queryUserInfoByCreatedBy(); } - }, _forDeriveReferrer); + }, _forDerivedReferrer, _forScalarSelect, + _forScalarSubQuery); } return _userInfoByCreatedBy; } @@ -329,7 +319,8 @@ public UserInfoCB.Specification specifyUserInfoByUpdatedBy() { assertForeign("userInfoByUpdatedBy"); if (_userInfoByUpdatedBy == null) { - _userInfoByUpdatedBy = new UserInfoCB.Specification(_baseCB, + _userInfoByUpdatedBy = new UserInfoCB.Specification( + _baseCB, new SpQyCall() { public boolean has() { return _myQyCall.has() @@ -342,7 +333,8 @@ return _myQyCall.qy() .queryUserInfoByUpdatedBy(); } - }, _forDeriveReferrer); + }, _forDerivedReferrer, _forScalarSelect, + _forScalarSubQuery); } return _userInfoByUpdatedBy; } Modified: notepad/trunk/src/main/java/jp/sf/pal/notepad/db/cbean/bs/BsNotepadContentCB.java =================================================================== --- notepad/trunk/src/main/java/jp/sf/pal/notepad/db/cbean/bs/BsNotepadContentCB.java 2008-12-27 22:11:51 UTC (rev 1627) +++ notepad/trunk/src/main/java/jp/sf/pal/notepad/db/cbean/bs/BsNotepadContentCB.java 2008-12-27 22:13:37 UTC (rev 1628) @@ -18,7 +18,6 @@ * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public class BsNotepadContentCB extends AbstractConditionBean { //========================================================================== @@ -86,7 +85,12 @@ return _conditionQuery; } - public ConditionQuery getConditionQueryAsInterface() { + /** + * The implementation. + * + * @return The conditionQuery of the local table as interface. (NotNull) + */ + public ConditionQuery localCQ() { return getConditionQuery(); } @@ -136,24 +140,6 @@ query().xsetUnionAllQuery(cq); } - /** - * @param unionQuery The query of 'union'. (NotNull) - * @deprecated Sorry! Please use union(UnionQuery - * unionQuery). - */ - public void union(NotepadContentCQ unionQuery) { - query().xsetUnionQuery(unionQuery); - } - - /** - * @param unionQuery The query of 'union'. (NotNull) - * @deprecated Sorry! Please use unionAll(UnionQuery - * unionQuery). - */ - public void unionAll(NotepadContentCQ unionQuery) { - query().xsetUnionAllQuery(unionQuery); - } - public boolean hasUnionQueryOrUnionAllQuery() { return query().hasUnionQueryOrUnionAllQuery(); } @@ -162,7 +148,6 @@ // ========= // Setup Select // ============ - protected NotepadNss _nssNotepad; public NotepadNss getNssNotepad() { @@ -202,7 +187,8 @@ public NotepadContentCQ qy() { return query(); } - }, _forDeriveReferrer); + }, _forDerivedReferrer, _forScalarSelect, + _forScalarSubQuery); } return _specification; } @@ -214,8 +200,10 @@ protected NotepadCB.Specification _notepad; public Specification(ConditionBean baseCB, - SpQyCall qyCall, boolean forDeriveReferrer) { - super(baseCB, qyCall, forDeriveReferrer); + SpQyCall qyCall, boolean forDeriveReferrer, + boolean forScalarSelect, boolean forScalarSubQuery) { + super(baseCB, qyCall, forDeriveReferrer, forScalarSelect, + forScalarSubQuery); _myQyCall = qyCall; } @@ -251,7 +239,8 @@ public NotepadCQ qy() { return _myQyCall.qy().queryNotepad(); } - }, _forDeriveReferrer); + }, _forDerivedReferrer, _forScalarSelect, + _forScalarSubQuery); } return _notepad; } Modified: notepad/trunk/src/main/java/jp/sf/pal/notepad/db/cbean/bs/BsRoleInfoCB.java =================================================================== --- notepad/trunk/src/main/java/jp/sf/pal/notepad/db/cbean/bs/BsRoleInfoCB.java 2008-12-27 22:11:51 UTC (rev 1627) +++ notepad/trunk/src/main/java/jp/sf/pal/notepad/db/cbean/bs/BsRoleInfoCB.java 2008-12-27 22:13:37 UTC (rev 1628) @@ -17,7 +17,6 @@ * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public class BsRoleInfoCB extends AbstractConditionBean { //========================================================================== @@ -86,7 +85,12 @@ return _conditionQuery; } - public ConditionQuery getConditionQueryAsInterface() { + /** + * The implementation. + * + * @return The conditionQuery of the local table as interface. (NotNull) + */ + public ConditionQuery localCQ() { return getConditionQuery(); } @@ -136,23 +140,6 @@ query().xsetUnionAllQuery(cq); } - /** - * @param unionQuery The query of 'union'. (NotNull) - * @deprecated Sorry! Please use union(UnionQuery unionQuery). - */ - public void union(RoleInfoCQ unionQuery) { - query().xsetUnionQuery(unionQuery); - } - - /** - * @param unionQuery The query of 'union'. (NotNull) - * @deprecated Sorry! Please use unionAll(UnionQuery - * unionQuery). - */ - public void unionAll(RoleInfoCQ unionQuery) { - query().xsetUnionAllQuery(unionQuery); - } - public boolean hasUnionQueryOrUnionAllQuery() { return query().hasUnionQueryOrUnionAllQuery(); } @@ -180,7 +167,8 @@ public RoleInfoCQ qy() { return query(); } - }, _forDeriveReferrer); + }, _forDerivedReferrer, _forScalarSelect, + _forScalarSubQuery); } return _specification; } @@ -189,8 +177,10 @@ protected SpQyCall _myQyCall; public Specification(ConditionBean baseCB, SpQyCall qyCall, - boolean forDeriveReferrer) { - super(baseCB, qyCall, forDeriveReferrer); + boolean forDeriveReferrer, boolean forScalarSelect, + boolean forScalarSubQuery) { + super(baseCB, qyCall, forDeriveReferrer, forScalarSelect, + forScalarSubQuery); _myQyCall = qyCall; } Modified: notepad/trunk/src/main/java/jp/sf/pal/notepad/db/cbean/bs/BsRoleMappingCB.java =================================================================== --- notepad/trunk/src/main/java/jp/sf/pal/notepad/db/cbean/bs/BsRoleMappingCB.java 2008-12-27 22:11:51 UTC (rev 1627) +++ notepad/trunk/src/main/java/jp/sf/pal/notepad/db/cbean/bs/BsRoleMappingCB.java 2008-12-27 22:13:37 UTC (rev 1628) @@ -21,7 +21,6 @@ * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public class BsRoleMappingCB extends AbstractConditionBean { //========================================================================== @@ -89,7 +88,12 @@ return _conditionQuery; } - public ConditionQuery getConditionQueryAsInterface() { + /** + * The implementation. + * + * @return The conditionQuery of the local table as interface. (NotNull) + */ + public ConditionQuery localCQ() { return getConditionQuery(); } @@ -139,24 +143,6 @@ query().xsetUnionAllQuery(cq); } - /** - * @param unionQuery The query of 'union'. (NotNull) - * @deprecated Sorry! Please use union(UnionQuery - * unionQuery). - */ - public void union(RoleMappingCQ unionQuery) { - query().xsetUnionQuery(unionQuery); - } - - /** - * @param unionQuery The query of 'union'. (NotNull) - * @deprecated Sorry! Please use unionAll(UnionQuery - * unionQuery). - */ - public void unionAll(RoleMappingCQ unionQuery) { - query().xsetUnionAllQuery(unionQuery); - } - public boolean hasUnionQueryOrUnionAllQuery() { return query().hasUnionQueryOrUnionAllQuery(); } @@ -165,7 +151,6 @@ // ========= // Setup Select // ============ - protected RoleInfoNss _nssRoleInfo; public RoleInfoNss getNssRoleInfo() { @@ -226,7 +211,8 @@ public RoleMappingCQ qy() { return query(); } - }, _forDeriveReferrer); + }, _forDerivedReferrer, _forScalarSelect, + _forScalarSubQuery); } return _specification; } @@ -240,8 +226,10 @@ protected UserInfoCB.Specification _userInfo; public Specification(ConditionBean baseCB, - SpQyCall qyCall, boolean forDeriveReferrer) { - super(baseCB, qyCall, forDeriveReferrer); + SpQyCall qyCall, boolean forDeriveReferrer, + boolean forScalarSelect, boolean forScalarSubQuery) { + super(baseCB, qyCall, forDeriveReferrer, forScalarSelect, + forScalarSubQuery); _myQyCall = qyCall; } @@ -285,7 +273,8 @@ public RoleInfoCQ qy() { return _myQyCall.qy().queryRoleInfo(); } - }, _forDeriveReferrer); + }, _forDerivedReferrer, _forScalarSelect, + _forScalarSubQuery); } return _roleInfo; } @@ -304,7 +293,8 @@ public UserInfoCQ qy() { return _myQyCall.qy().queryUserInfo(); } - }, _forDeriveReferrer); + }, _forDerivedReferrer, _forScalarSelect, + _forScalarSubQuery); } return _userInfo; } Modified: notepad/trunk/src/main/java/jp/sf/pal/notepad/db/cbean/bs/BsUserInfoCB.java =================================================================== --- notepad/trunk/src/main/java/jp/sf/pal/notepad/db/cbean/bs/BsUserInfoCB.java 2008-12-27 22:11:51 UTC (rev 1627) +++ notepad/trunk/src/main/java/jp/sf/pal/notepad/db/cbean/bs/BsUserInfoCB.java 2008-12-27 22:13:37 UTC (rev 1628) @@ -25,7 +25,6 @@ * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public class BsUserInfoCB extends AbstractConditionBean { //========================================================================== @@ -94,7 +93,12 @@ return _conditionQuery; } - public ConditionQuery getConditionQueryAsInterface() { + /** + * The implementation. + * + * @return The conditionQuery of the local table as interface. (NotNull) + */ + public ConditionQuery localCQ() { return getConditionQuery(); } @@ -144,23 +148,6 @@ query().xsetUnionAllQuery(cq); } - /** - * @param unionQuery The query of 'union'. (NotNull) - * @deprecated Sorry! Please use union(UnionQuery unionQuery). - */ - public void union(UserInfoCQ unionQuery) { - query().xsetUnionQuery(unionQuery); - } - - /** - * @param unionQuery The query of 'union'. (NotNull) - * @deprecated Sorry! Please use unionAll(UnionQuery - * unionQuery). - */ - public void unionAll(UserInfoCQ unionQuery) { - query().xsetUnionAllQuery(unionQuery); - } - public boolean hasUnionQueryOrUnionAllQuery() { return query().hasUnionQueryOrUnionAllQuery(); } @@ -169,7 +156,6 @@ // ========= // Setup Select // ============ - protected GroupInfoNss _nssGroupInfo; public GroupInfoNss getNssGroupInfo() { @@ -230,7 +216,8 @@ public UserInfoCQ qy() { return query(); } - }, _forDeriveReferrer); + }, _forDerivedReferrer, _forScalarSelect, + _forScalarSubQuery); } return _specification; } @@ -243,8 +230,10 @@ protected RoleInfoCB.Specification _roleInfo; public Specification(ConditionBean baseCB, SpQyCall qyCall, - boolean forDeriveReferrer) { - super(baseCB, qyCall, forDeriveReferrer); + boolean forDeriveReferrer, boolean forScalarSelect, + boolean forScalarSubQuery) { + super(baseCB, qyCall, forDeriveReferrer, forScalarSelect, + forScalarSubQuery); _myQyCall = qyCall; } @@ -308,6 +297,10 @@ doColumn("GROUP_ID"); } + public void columnStatus() { + doColumn("STATUS"); + } + public void columnCreatedTime() { doColumn("CREATED_TIME"); } @@ -364,7 +357,8 @@ public GroupInfoCQ qy() { return _myQyCall.qy().queryGroupInfo(); } - }, _forDeriveReferrer); + }, _forDerivedReferrer, _forScalarSelect, + _forScalarSubQuery); } return _groupInfo; } @@ -383,7 +377,8 @@ public RoleInfoCQ qy() { return _myQyCall.qy().queryRoleInfo(); } - }, _forDeriveReferrer); + }, _forDerivedReferrer, _forScalarSelect, + _forScalarSubQuery); } return _roleInfo; } Modified: notepad/trunk/src/main/java/jp/sf/pal/notepad/db/cbean/cq/bs/AbstractBsGroupInfoCQ.java =================================================================== --- notepad/trunk/src/main/java/jp/sf/pal/notepad/db/cbean/cq/bs/AbstractBsGroupInfoCQ.java 2008-12-27 22:11:51 UTC (rev 1627) +++ notepad/trunk/src/main/java/jp/sf/pal/notepad/db/cbean/cq/bs/AbstractBsGroupInfoCQ.java 2008-12-27 22:13:37 UTC (rev 1628) @@ -20,7 +20,6 @@ * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public abstract class AbstractBsGroupInfoCQ extends AbstractConditionQuery { //========================================================================== @@ -50,7 +49,7 @@ // ===== /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {PK : NotNull : + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {PK : NotNull : * VARCHAR(255)} * * @param groupId The value of groupId as equal. @@ -60,7 +59,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param groupId The value of groupId as notEqual. */ @@ -69,7 +68,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param groupId The value of groupId as greaterThan. */ @@ -78,7 +77,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param groupId The value of groupId as lessThan. */ @@ -87,7 +86,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param groupId The value of groupId as greaterEqual. */ @@ -96,7 +95,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param groupId The value of groupId as lessEqual. */ @@ -105,7 +104,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param groupId The value of groupId as prefixSearch. */ @@ -114,20 +113,6 @@ } /** - * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, - * SeveralRegistered. - * - * @param groupId The value of groupId as likeSearch. - * @param likeSearchOption The option of like-search. (NotNull) - */ - public void setGroupId_LikeSearch( - String groupId, - jp.sf.pal.notepad.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { - registerLikeSearchQuery(CK_LS, fRES(groupId), getCValueGroupId(), - "GROUP_ID", "GroupId", "groupId", likeSearchOption); - } - - /** * InScope(in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * @@ -138,43 +123,41 @@ } /** - * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * - * @param groupId The collection of groupId as inScope. - * @param inScopeOption The option of in-scope. (NotNull) + * @param groupIdList The collection of groupId as notInScope. */ - public void setGroupId_InScope( - String groupId, - jp.sf.pal.notepad.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(groupId), getCValueGroupId(), - "GROUP_ID", "GroupId", "groupId", inScopeOption); + public void setGroupId_NotInScope(Collection groupIdList) { + regGroupId(CK_NINS, cTL(groupIdList)); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param groupIdList The collection of groupId as notInScope. + * @param groupId The value of groupId as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) */ - public void setGroupId_NotInScope(Collection groupIdList) { - regGroupId(CK_NINS, cTL(groupIdList)); + public void setGroupId_LikeSearch( + String groupId, + jp.sf.pal.notepad.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(groupId), getCValueGroupId(), "GROUP_ID", "GroupId", + "groupId", likeSearchOption); } /** - * @param groupMappingCBquery Query. - * @deprecated Please use inScopeGroupMappingList(subQuery) method. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param groupId The value of groupId as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setGroupId_InScopeSubQuery_GroupMappingList( - GroupMappingCQ groupMappingCBquery) { - String subQueryPropertyName = keepGroupId_InScopeSubQuery_GroupMappingList(groupMappingCBquery);// for - // saving - // query - // - - // value - // . - registerInScopeSubQuery(groupMappingCBquery, "GROUP_ID", "GROUP_ID", - subQueryPropertyName); + public void setGroupId_NotLikeSearch( + String groupId, + jp.sf.pal.notepad.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(groupId), getCValueGroupId(), "GROUP_ID", + "GroupId", "groupId", likeSearchOption); } public void inScopeGroupMappingList(SubQuery subQuery) { @@ -183,42 +166,26 @@ cb.xsetupForInScopeSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepGroupId_InScopeSubQuery_GroupMappingList(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerInScopeSubQuery(cb.query(), "GROUP_ID", "GROUP_ID", subQueryPropertyName); } - abstract public String keepGroupId_InScopeSubQuery_GroupMappingList( + public abstract String keepGroupId_InScopeSubQuery_GroupMappingList( GroupMappingCQ subQuery); - /** - * @param userInfoCBquery Query. - * @deprecated Please use inScopeUserInfoList(subQuery) method. - */ - public void setGroupId_InScopeSubQuery_UserInfoList( - UserInfoCQ userInfoCBquery) { - String subQueryPropertyName = keepGroupId_InScopeSubQuery_UserInfoList(userInfoCBquery);// for - // saving - // query - // - - // value - // . - registerInScopeSubQuery(userInfoCBquery, "GROUP_ID", "GROUP_ID", - subQueryPropertyName); - } - public void inScopeUserInfoList(SubQuery subQuery) { assertObjectNotNull("subQuery", subQuery); UserInfoCB cb = new UserInfoCB(); cb.xsetupForInScopeSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepGroupId_InScopeSubQuery_UserInfoList(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerInScopeSubQuery(cb.query(), "GROUP_ID", "GROUP_ID", subQueryPropertyName); } - abstract public String keepGroupId_InScopeSubQuery_UserInfoList( + public abstract String keepGroupId_InScopeSubQuery_UserInfoList( UserInfoCQ subQuery); public void notInScopeGroupMappingList(SubQuery subQuery) { @@ -227,12 +194,12 @@ cb.xsetupForInScopeSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepGroupId_NotInScopeSubQuery_GroupMappingList(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerNotInScopeSubQuery(cb.query(), "GROUP_ID", "GROUP_ID", subQueryPropertyName); } - abstract public String keepGroupId_NotInScopeSubQuery_GroupMappingList( + public abstract String keepGroupId_NotInScopeSubQuery_GroupMappingList( GroupMappingCQ subQuery); public void notInScopeUserInfoList(SubQuery subQuery) { @@ -241,31 +208,15 @@ cb.xsetupForInScopeSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepGroupId_NotInScopeSubQuery_UserInfoList(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerNotInScopeSubQuery(cb.query(), "GROUP_ID", "GROUP_ID", subQueryPropertyName); } - abstract public String keepGroupId_NotInScopeSubQuery_UserInfoList( + public abstract String keepGroupId_NotInScopeSubQuery_UserInfoList( UserInfoCQ subQuery); /** - * @param groupMappingCBquery Query. - * @deprecated Please use existsGroupMappingList(subQuery) method. - */ - public void setGroupId_ExistsSubQuery_GroupMappingList( - GroupMappingCQ groupMappingCBquery) { - String subQueryPropertyName = keepGroupId_ExistsSubQuery_GroupMappingList(groupMappingCBquery);// for - // saving - // query - // - - // value - // . - registerExistsSubQuery(groupMappingCBquery, "GROUP_ID", "GROUP_ID", - subQueryPropertyName); - } - - /** * Set up 'exists' sub-query. {exists (select GROUP_ID from GROUP_MAPPING * where ...)} * @@ -278,31 +229,15 @@ cb.xsetupForExistsSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepGroupId_ExistsSubQuery_GroupMappingList(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerExistsSubQuery(cb.query(), "GROUP_ID", "GROUP_ID", subQueryPropertyName); } - abstract public String keepGroupId_ExistsSubQuery_GroupMappingList( + public abstract String keepGroupId_ExistsSubQuery_GroupMappingList( GroupMappingCQ subQuery); /** - * @param userInfoCBquery Query. - * @deprecated Please use existsUserInfoList(subQuery) method. - */ - public void setGroupId_ExistsSubQuery_UserInfoList( - UserInfoCQ userInfoCBquery) { - String subQueryPropertyName = keepGroupId_ExistsSubQuery_UserInfoList(userInfoCBquery);// for - // saving - // query - // - - // value - // . - registerExistsSubQuery(userInfoCBquery, "GROUP_ID", "GROUP_ID", - subQueryPropertyName); - } - - /** * Set up 'exists' sub-query. {exists (select GROUP_ID from USER_INFO where * ...)} * @@ -315,12 +250,12 @@ cb.xsetupForExistsSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepGroupId_ExistsSubQuery_UserInfoList(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerExistsSubQuery(cb.query(), "GROUP_ID", "GROUP_ID", subQueryPropertyName); } - abstract public String keepGroupId_ExistsSubQuery_UserInfoList( + public abstract String keepGroupId_ExistsSubQuery_UserInfoList( UserInfoCQ subQuery); /** @@ -337,12 +272,12 @@ cb.xsetupForExistsSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepGroupId_NotExistsSubQuery_GroupMappingList(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerNotExistsSubQuery(cb.query(), "GROUP_ID", "GROUP_ID", subQueryPropertyName); } - abstract public String keepGroupId_NotExistsSubQuery_GroupMappingList( + public abstract String keepGroupId_NotExistsSubQuery_GroupMappingList( GroupMappingCQ subQuery); /** @@ -358,53 +293,53 @@ cb.xsetupForExistsSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepGroupId_NotExistsSubQuery_UserInfoList(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerNotExistsSubQuery(cb.query(), "GROUP_ID", "GROUP_ID", subQueryPropertyName); } - abstract public String keepGroupId_NotExistsSubQuery_UserInfoList( + public abstract String keepGroupId_NotExistsSubQuery_UserInfoList( UserInfoCQ subQuery); public void xderiveGroupMappingList(String function, SubQuery subQuery, String aliasName) { assertObjectNotNull("subQuery", subQuery); GroupMappingCB cb = new GroupMappingCB(); - cb.xsetupForDeriveReferrer(); + cb.xsetupForDerivedReferrer(); subQuery.query(cb); - String subQueryPropertyName = keepGroupId_DeriveSubQuery_GroupMappingList(cb - .query());// for saving query-value. - registerDeriveSubQuery(function, cb.query(), "GROUP_ID", "GROUP_ID", - subQueryPropertyName, aliasName); + String subQueryPropertyName = keepGroupId_DerivedReferrer_GroupMappingList(cb + .query()); // for saving query-value. + registerDerivedReferrerSubQuery(function, cb.query(), "GROUP_ID", + "GROUP_ID", subQueryPropertyName, aliasName); } - abstract public String keepGroupId_DeriveSubQuery_GroupMappingList( + public abstract String keepGroupId_DerivedReferrer_GroupMappingList( GroupMappingCQ subQuery); public void xderiveUserInfoList(String function, SubQuery subQuery, String aliasName) { assertObjectNotNull("subQuery", subQuery); UserInfoCB cb = new UserInfoCB(); - cb.xsetupForDeriveReferrer(); + cb.xsetupForDerivedReferrer(); subQuery.query(cb); - String subQueryPropertyName = keepGroupId_DeriveSubQuery_UserInfoList(cb - .query());// for saving query-value. - registerDeriveSubQuery(function, cb.query(), "GROUP_ID", "GROUP_ID", - subQueryPropertyName, aliasName); + String subQueryPropertyName = keepGroupId_DerivedReferrer_UserInfoList(cb + .query()); // for saving query-value. + registerDerivedReferrerSubQuery(function, cb.query(), "GROUP_ID", + "GROUP_ID", subQueryPropertyName, aliasName); } - abstract public String keepGroupId_DeriveSubQuery_UserInfoList( + public abstract String keepGroupId_DerivedReferrer_UserInfoList( UserInfoCQ subQuery); /** - * IsNull(is null). And OnceRegistered. + * IsNull(is null). And OnlyOnceRegistered. */ public void setGroupId_IsNull() { regGroupId(CK_ISN, DUMMY_OBJECT); } /** - * IsNotNull(is not null). And OnceRegistered. + * IsNotNull(is not null). And OnlyOnceRegistered. */ public void setGroupId_IsNotNull() { regGroupId(CK_ISNN, DUMMY_OBJECT); @@ -423,7 +358,7 @@ abstract protected ConditionValue getCValueGroupId(); /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {VARCHAR(100)} + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {VARCHAR(100)} * * @param name The value of name as equal. */ @@ -432,7 +367,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param name The value of name as notEqual. */ @@ -441,7 +376,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param name The value of name as greaterThan. */ @@ -450,7 +385,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param name The value of name as lessThan. */ @@ -459,7 +394,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param name The value of name as greaterEqual. */ @@ -468,7 +403,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param name The value of name as lessEqual. */ @@ -477,7 +412,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param name The value of name as prefixSearch. */ @@ -486,20 +421,6 @@ } /** - * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, - * SeveralRegistered. - * - * @param name The value of name as likeSearch. - * @param likeSearchOption The option of like-search. (NotNull) - */ - public void setName_LikeSearch( - String name, - jp.sf.pal.notepad.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { - registerLikeSearchQuery(CK_LS, fRES(name), getCValueName(), "NAME", - "Name", "name", likeSearchOption); - } - - /** * InScope(in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * @@ -510,38 +431,52 @@ } /** - * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * - * @param name The collection of name as inScope. - * @param inScopeOption The option of in-scope. (NotNull) + * @param nameList The collection of name as notInScope. */ - public void setName_InScope( + public void setName_NotInScope(Collection nameList) { + regName(CK_NINS, cTL(nameList)); + } + + /** + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param name The value of name as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) + */ + public void setName_LikeSearch( String name, - jp.sf.pal.notepad.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(name), getCValueName(), "NAME", - "Name", "name", inScopeOption); + jp.sf.pal.notepad.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(name), getCValueName(), "NAME", "Name", "name", + likeSearchOption); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param nameList The collection of name as notInScope. + * @param name The value of name as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setName_NotInScope(Collection nameList) { - regName(CK_NINS, cTL(nameList)); + public void setName_NotLikeSearch( + String name, + jp.sf.pal.notepad.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(name), getCValueName(), "NAME", "Name", "name", + likeSearchOption); } /** - * IsNull(is null). And OnceRegistered. + * IsNull(is null). And OnlyOnceRegistered. */ public void setName_IsNull() { regName(CK_ISN, DUMMY_OBJECT); } /** - * IsNotNull(is not null). And OnceRegistered. + * IsNotNull(is not null). And OnlyOnceRegistered. */ public void setName_IsNotNull() { regName(CK_ISNN, DUMMY_OBJECT); @@ -558,7 +493,7 @@ abstract protected ConditionValue getCValueName(); /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {VARCHAR(255)} + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {VARCHAR(255)} * * @param description The value of description as equal. */ @@ -567,7 +502,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param description The value of description as notEqual. */ @@ -576,7 +511,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param description The value of description as greaterThan. */ @@ -585,7 +520,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param description The value of description as lessThan. */ @@ -594,7 +529,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param description The value of description as greaterEqual. */ @@ -603,7 +538,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param description The value of description as lessEqual. */ @@ -612,7 +547,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param description The value of description as prefixSearch. */ @@ -621,21 +556,6 @@ } /** - * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, - * SeveralRegistered. - * - * @param description The value of description as likeSearch. - * @param likeSearchOption The option of like-search. (NotNull) - */ - public void setDescription_LikeSearch( - String description, - jp.sf.pal.notepad.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { - registerLikeSearchQuery(CK_LS, fRES(description), - getCValueDescription(), "DESCRIPTION", "Description", - "description", likeSearchOption); - } - - /** * InScope(in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * @@ -646,38 +566,52 @@ } /** - * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * - * @param description The collection of description as inScope. - * @param inScopeOption The option of in-scope. (NotNull) + * @param descriptionList The collection of description as notInScope. */ - public void setDescription_InScope( + public void setDescription_NotInScope(Collection descriptionList) { + regDescription(CK_NINS, cTL(descriptionList)); + } + + /** + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param description The value of description as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) + */ + public void setDescription_LikeSearch( String description, - jp.sf.pal.notepad.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(description), getCValueDescription(), - "DESCRIPTION", "Description", "description", inScopeOption); + jp.sf.pal.notepad.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(description), getCValueDescription(), "DESCRIPTION", + "Description", "description", likeSearchOption); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param descriptionList The collection of description as notInScope. + * @param description The value of description as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setDescription_NotInScope(Collection descriptionList) { - regDescription(CK_NINS, cTL(descriptionList)); + public void setDescription_NotLikeSearch( + String description, + jp.sf.pal.notepad.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(description), getCValueDescription(), + "DESCRIPTION", "Description", "description", likeSearchOption); } /** - * IsNull(is null). And OnceRegistered. + * IsNull(is null). And OnlyOnceRegistered. */ public void setDescription_IsNull() { regDescription(CK_ISN, DUMMY_OBJECT); } /** - * IsNotNull(is not null). And OnceRegistered. + * IsNotNull(is not null). And OnlyOnceRegistered. */ public void setDescription_IsNotNull() { regDescription(CK_ISNN, DUMMY_OBJECT); @@ -696,7 +630,7 @@ abstract protected ConditionValue getCValueDescription(); /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {VARCHAR(255)} + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {VARCHAR(255)} * * @param email The value of email as equal. */ @@ -705,7 +639,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param email The value of email as notEqual. */ @@ -714,7 +648,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param email The value of email as greaterThan. */ @@ -723,7 +657,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param email The value of email as lessThan. */ @@ -732,7 +666,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param email The value of email as greaterEqual. */ @@ -741,7 +675,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param email The value of email as lessEqual. */ @@ -750,7 +684,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param email The value of email as prefixSearch. */ @@ -759,20 +693,6 @@ } /** - * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, - * SeveralRegistered. - * - * @param email The value of email as likeSearch. - * @param likeSearchOption The option of like-search. (NotNull) - */ - public void setEmail_LikeSearch( - String email, - jp.sf.pal.notepad.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { - registerLikeSearchQuery(CK_LS, fRES(email), getCValueEmail(), "EMAIL", - "Email", "email", likeSearchOption); - } - - /** * InScope(in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * @@ -783,38 +703,52 @@ } /** - * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * - * @param email The collection of email as inScope. - * @param inScopeOption The option of in-scope. (NotNull) + * @param emailList The collection of email as notInScope. */ - public void setEmail_InScope( + public void setEmail_NotInScope(Collection emailList) { + regEmail(CK_NINS, cTL(emailList)); + } + + /** + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param email The value of email as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) + */ + public void setEmail_LikeSearch( String email, - jp.sf.pal.notepad.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(email), getCValueEmail(), "EMAIL", - "Email", "email", inScopeOption); + jp.sf.pal.notepad.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(email), getCValueEmail(), "EMAIL", "Email", "email", + likeSearchOption); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param emailList The collection of email as notInScope. + * @param email The value of email as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setEmail_NotInScope(Collection emailList) { - regEmail(CK_NINS, cTL(emailList)); + public void setEmail_NotLikeSearch( + String email, + jp.sf.pal.notepad.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(email), getCValueEmail(), "EMAIL", "Email", + "email", likeSearchOption); } /** - * IsNull(is null). And OnceRegistered. + * IsNull(is null). And OnlyOnceRegistered. */ public void setEmail_IsNull() { regEmail(CK_ISN, DUMMY_OBJECT); } /** - * IsNotNull(is not null). And OnceRegistered. + * IsNotNull(is not null). And OnlyOnceRegistered. */ public void setEmail_IsNotNull() { regEmail(CK_ISNN, DUMMY_OBJECT); @@ -832,7 +766,7 @@ abstract protected ConditionValue getCValueEmail(); /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {VARCHAR(255)} + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {VARCHAR(255)} * * @param url The value of url as equal. */ @@ -841,7 +775,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param url The value of url as notEqual. */ @@ -850,7 +784,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param url The value of url as greaterThan. */ @@ -859,7 +793,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param url The value of url as lessThan. */ @@ -868,7 +802,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param url The value of url as greaterEqual. */ @@ -877,7 +811,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param url The value of url as lessEqual. */ @@ -886,7 +820,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param url The value of url as prefixSearch. */ @@ -895,20 +829,6 @@ } /** - * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, - * SeveralRegistered. - * - * @param url The value of url as likeSearch. - * @param likeSearchOption The option of like-search. (NotNull) - */ - public void setUrl_LikeSearch( - String url, - jp.sf.pal.notepad.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { - registerLikeSearchQuery(CK_LS, fRES(url), getCValueUrl(), "URL", "Url", - "url", likeSearchOption); - } - - /** * InScope(in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * @@ -919,38 +839,52 @@ } /** - * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * - * @param url The collection of url as inScope. - * @param inScopeOption The option of in-scope. (NotNull) + * @param urlList The collection of url as notInScope. */ - public void setUrl_InScope( + public void setUrl_NotInScope(Collection urlList) { + regUrl(CK_NINS, cTL(urlList)); + } + + /** + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param url The value of url as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) + */ + public void setUrl_LikeSearch( String url, - jp.sf.pal.notepad.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(url), getCValueUrl(), "URL", "Url", - "url", inScopeOption); + jp.sf.pal.notepad.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(url), getCValueUrl(), "URL", "Url", "url", + likeSearchOption); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param urlList The collection of url as notInScope. + * @param url The value of url as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setUrl_NotInScope(Collection urlList) { - regUrl(CK_NINS, cTL(urlList)); + public void setUrl_NotLikeSearch( + String url, + jp.sf.pal.notepad.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(url), getCValueUrl(), "URL", "Url", "url", + likeSearchOption); } /** - * IsNull(is null). And OnceRegistered. + * IsNull(is null). And OnlyOnceRegistered. */ public void setUrl_IsNull() { regUrl(CK_ISN, DUMMY_OBJECT); } /** - * IsNotNull(is not null). And OnceRegistered. + * IsNotNull(is not null). And OnlyOnceRegistered. */ public void setUrl_IsNotNull() { regUrl(CK_ISNN, DUMMY_OBJECT); @@ -967,7 +901,7 @@ abstract protected ConditionValue getCValueUrl(); /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {VARCHAR(40)} + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {VARCHAR(40)} * * @param telephone The value of telephone as equal. */ @@ -976,7 +910,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param telephone The value of telephone as notEqual. */ @@ -985,7 +919,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param telephone The value of telephone as greaterThan. */ @@ -994,7 +928,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param telephone The value of telephone as lessThan. */ @@ -1003,7 +937,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param telephone The value of telephone as greaterEqual. */ @@ -1012,7 +946,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param telephone The value of telephone as lessEqual. */ @@ -1021,7 +955,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param telephone The value of telephone as prefixSearch. */ @@ -1030,20 +964,6 @@ } /** - * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, - * SeveralRegistered. - * - * @param telephone The value of telephone as likeSearch. - * @param likeSearchOption The option of like-search. (NotNull) - */ - public void setTelephone_LikeSearch( - String telephone, - jp.sf.pal.notepad.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { - registerLikeSearchQuery(CK_LS, fRES(telephone), getCValueTelephone(), - "TELEPHONE", "Telephone", "telephone", likeSearchOption); - } - - /** * InScope(in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * @@ -1054,38 +974,52 @@ } /** - * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * - * @param telephone The collection of telephone as inScope. - * @param inScopeOption The option of in-scope. (NotNull) + * @param telephoneList The collection of telephone as notInScope. */ - public void setTelephone_InScope( + public void setTelephone_NotInScope(Collection telephoneList) { + regTelephone(CK_NINS, cTL(telephoneList)); + } + + /** + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param telephone The value of telephone as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) + */ + public void setTelephone_LikeSearch( String telephone, - jp.sf.pal.notepad.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(telephone), getCValueTelephone(), - "TELEPHONE", "Telephone", "telephone", inScopeOption); + jp.sf.pal.notepad.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(telephone), getCValueTelephone(), "TELEPHONE", + "Telephone", "telephone", likeSearchOption); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param telephoneList The collection of telephone as notInScope. + * @param telephone The value of telephone as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setTelephone_NotInScope(Collection telephoneList) { - regTelephone(CK_NINS, cTL(telephoneList)); + public void setTelephone_NotLikeSearch( + String telephone, + jp.sf.pal.notepad.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(telephone), getCValueTelephone(), "TELEPHONE", + "Telephone", "telephone", likeSearchOption); } /** - * IsNull(is null). And OnceRegistered. + * IsNull(is null). And OnlyOnceRegistered. */ public void setTelephone_IsNull() { regTelephone(CK_ISN, DUMMY_OBJECT); } /** - * IsNotNull(is not null). And OnceRegistered. + * IsNotNull(is not null). And OnlyOnceRegistered. */ public void setTelephone_IsNotNull() { regTelephone(CK_ISNN, DUMMY_OBJECT); @@ -1104,7 +1038,7 @@ abstract protected ConditionValue getCValueTelephone(); /** - * Equal(=). And NullIgnored, OnceRegistered. {NotNull : TIMESTAMP} + * Equal(=). And NullIgnored, OnlyOnceRegistered. {NotNull : TIMESTAMP} * * @param createdTime The value of createdTime as equal. */ @@ -1113,7 +1047,7 @@ } /** - * NotEqual(!=). And NullIgnored, OnceRegistered. + * NotEqual(!=). And NullIgnored, OnlyOnceRegistered. * * @param createdTime The value of createdTime as notEqual. */ @@ -1122,7 +1056,7 @@ } /** - * GreaterThan(>). And NullIgnored, OnceRegistered. + * GreaterThan(>). And NullIgnored, OnlyOnceRegistered. * * @param createdTime The value of createdTime as greaterThan. */ @@ -1131,7 +1065,7 @@ } /** - * LessThan(>). And NullIgnored, OnceRegistered. + * LessThan(>). And NullIgnored, OnlyOnceRegistered. * * @param createdTime The value of createdTime as lessThan. */ @@ -1140,7 +1074,7 @@ } /** - * GreaterEqual(>). And NullIgnored, OnceRegistered. + * GreaterEqual(>). And NullIgnored, OnlyOnceRegistered. * * @param createdTime The value of createdTime as greaterEqual. */ @@ -1149,7 +1083,7 @@ } /** - * LessEqual(>). And NullIgnored, OnceRegistered. + * LessEqual(>). And NullIgnored, OnlyOnceRegistered. * * @param createdTime The value of createdTime as lessEqual. */ @@ -1159,7 +1093,7 @@ /** * FromTo($fromDate <= COLUMN_NAME <= $toDate). And NullIgnored, - * OnceRegistered. {NotNull : TIMESTAMP} + * OnlyOnceRegistered. {NotNull : TIMESTAMP} * * @param fromDate The from-date of createdTime. (Nullable) * @param toDate The to-date of createdTime. (Nullable) @@ -1177,7 +1111,7 @@ /** * FromTo($fromDate <= COLUMN_NAME < $toDate + 1). And NullIgnored, - * OnceRegistered. {NotNull : TIMESTAMP} + * OnlyOnceRegistered. {NotNull : TIMESTAMP} * * @param fromDate The from-date of createdTime. (Nullable) * @param toDate The to-date of createdTime. (Nullable) @@ -1203,7 +1137,7 @@ abstract protected ConditionValue getCValueCreatedTime(); /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {NotNull : + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {NotNull : * VARCHAR(255)} * * @param createdBy The value of createdBy as equal. @@ -1213,7 +1147,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param createdBy The value of createdBy as notEqual. */ @@ -1222,7 +1156,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param createdBy The value of createdBy as greaterThan. */ @@ -1231,7 +1165,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param createdBy The value of createdBy as lessThan. */ @@ -1240,7 +1174,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param createdBy The value of createdBy as greaterEqual. */ @@ -1249,7 +1183,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param createdBy The value of createdBy as lessEqual. */ @@ -1258,7 +1192,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param createdBy The value of createdBy as prefixSearch. */ @@ -1267,20 +1201,6 @@ } /** - * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, - * SeveralRegistered. - * - * @param createdBy The value of createdBy as likeSearch. - * @param likeSearchOption The option of like-search. (NotNull) - */ - public void setCreatedBy_LikeSearch( - String createdBy, - jp.sf.pal.notepad.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { - registerLikeSearchQuery(CK_LS, fRES(createdBy), getCValueCreatedBy(), - "CREATED_BY", "CreatedBy", "createdBy", likeSearchOption); - } - - /** * InScope(in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * @@ -1291,27 +1211,41 @@ } /** - * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * - * @param createdBy The collection of createdBy as inScope. - * @param inScopeOption The option of in-scope. (NotNull) + * @param createdByList The collection of createdBy as notInScope. */ - public void setCreatedBy_InScope( + public void setCreatedBy_NotInScope(Collection createdByList) { + regCreatedBy(CK_NINS, cTL(createdByList)); + } + + /** + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param createdBy The value of createdBy as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) + */ + public void setCreatedBy_LikeSearch( String createdBy, - jp.sf.pal.notepad.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(createdBy), getCValueCreatedBy(), - "CREATED_BY", "CreatedBy", "createdBy", inScopeOption); + jp.sf.pal.notepad.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(createdBy), getCValueCreatedBy(), "CREATED_BY", + "CreatedBy", "createdBy", likeSearchOption); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param createdByList The collection of createdBy as notInScope. + * @param createdBy The value of createdBy as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setCreatedBy_NotInScope(Collection createdByList) { - regCreatedBy(CK_NINS, cTL(createdByList)); + public void setCreatedBy_NotLikeSearch( + String createdBy, + jp.sf.pal.notepad.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(createdBy), getCValueCreatedBy(), "CREATED_BY", + "CreatedBy", "createdBy", likeSearchOption); } protected void regCreatedBy(ConditionKey key, Object value) { @@ -1327,7 +1261,7 @@ abstract protected ConditionValue getCValueCreatedBy(); /** - * Equal(=). And NullIgnored, OnceRegistered. {NotNull : TIMESTAMP} + * Equal(=). And NullIgnored, OnlyOnceRegistered. {NotNull : TIMESTAMP} * * @param updatedTime The value of updatedTime as equal. */ @@ -1336,7 +1270,7 @@ } /** - * NotEqual(!=). And NullIgnored, OnceRegistered. + * NotEqual(!=). And NullIgnored, OnlyOnceRegistered. * * @param updatedTime The value of updatedTime as notEqual. */ @@ -1345,7 +1279,7 @@ } /** - * GreaterThan(>). And NullIgnored, OnceRegistered. + * GreaterThan(>). And NullIgnored, OnlyOnceRegistered. * * @param updatedTime The value of updatedTime as greaterThan. */ @@ -1354,7 +1288,7 @@ } /** - * LessThan(>). And NullIgnored, OnceRegistered. + * LessThan(>). And NullIgnored, OnlyOnceRegistered. * * @param updatedTime The value of updatedTime as lessThan. */ @@ -1363,7 +1297,7 @@ } /** - * GreaterEqual(>). And NullIgnored, OnceRegistered. + * GreaterEqual(>). And NullIgnored, OnlyOnceRegistered. * * @param updatedTime The value of updatedTime as greaterEqual. */ @@ -1372,7 +1306,7 @@ } /** - * LessEqual(>). And NullIgnored, OnceRegistered. + * LessEqual(>). And NullIgnored, OnlyOnceRegistered. * * @param updatedTime The value of updatedTime as lessEqual. */ @@ -1382,7 +1316,7 @@ /** * FromTo($fromDate <= COLUMN_NAME <= $toDate). And NullIgnored, - * OnceRegistered. {NotNull : TIMESTAMP} + * OnlyOnceRegistered. {NotNull : TIMESTAMP} * * @param fromDate The from-date of updatedTime. (Nullable) * @param toDate The to-date of updatedTime. (Nullable) @@ -1400,7 +1334,7 @@ /** * FromTo($fromDate <= COLUMN_NAME < $toDate + 1). And NullIgnored, - * OnceRegistered. {NotNull : TIMESTAMP} + * OnlyOnceRegistered. {NotNull : TIMESTAMP} * * @param fromDate The from-date of updatedTime. (Nullable) * @param toDate The to-date of updatedTime. (Nullable) @@ -1426,7 +1360,7 @@ abstract protected ConditionValue getCValueUpdatedTime(); /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {NotNull : + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {NotNull : * VARCHAR(255)} * * @param updatedBy The value of updatedBy as equal. @@ -1436,7 +1370,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param updatedBy The value of updatedBy as notEqual. */ @@ -1445,7 +1379,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param updatedBy The value of updatedBy as greaterThan. */ @@ -1454,7 +1388,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param updatedBy The value of updatedBy as lessThan. */ @@ -1463,7 +1397,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param updatedBy The value of updatedBy as greaterEqual. */ @@ -1472,7 +1406,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param updatedBy The value of updatedBy as lessEqual. */ @@ -1481,7 +1415,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param updatedBy The value of updatedBy as prefixSearch. */ @@ -1490,20 +1424,6 @@ } /** - * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, - * SeveralRegistered. - * - * @param updatedBy The value of updatedBy as likeSearch. - * @param likeSearchOption The option of like-search. (NotNull) - */ - public void setUpdatedBy_LikeSearch( - String updatedBy, - jp.sf.pal.notepad.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { - registerLikeSearchQuery(CK_LS, fRES(updatedBy), getCValueUpdatedBy(), - "UPDATED_BY", "UpdatedBy", "updatedBy", likeSearchOption); - } - - /** * InScope(in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * @@ -1514,27 +1434,41 @@ } /** - * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * - * @param updatedBy The collection of updatedBy as inScope. - * @param inScopeOption The option of in-scope. (NotNull) + * @param updatedByList The collection of updatedBy as notInScope. */ - public void setUpdatedBy_InScope( + public void setUpdatedBy_NotInScope(Collection updatedByList) { + regUpdatedBy(CK_NINS, cTL(updatedByList)); + } + + /** + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param updatedBy The value of updatedBy as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) + */ + public void setUpdatedBy_LikeSearch( String updatedBy, - jp.sf.pal.notepad.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(updatedBy), getCValueUpdatedBy(), - "UPDATED_BY", "UpdatedBy", "updatedBy", inScopeOption); + jp.sf.pal.notepad.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(updatedBy), getCValueUpdatedBy(), "UPDATED_BY", + "UpdatedBy", "updatedBy", likeSearchOption); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param updatedByList The collection of updatedBy as notInScope. + * @param updatedBy The value of updatedBy as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setUpdatedBy_NotInScope(Collection updatedByList) { - regUpdatedBy(CK_NINS, cTL(updatedByList)); + public void setUpdatedBy_NotLikeSearch( + String updatedBy, + jp.sf.pal.notepad.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(updatedBy), getCValueUpdatedBy(), "UPDATED_BY", + "UpdatedBy", "updatedBy", likeSearchOption); } protected void regUpdatedBy(ConditionKey key, Object value) { @@ -1550,7 +1484,7 @@ abstract protected ConditionValue getCValueUpdatedBy(); /** - * Equal(=). And NullIgnored, OnceRegistered. {TIMESTAMP} + * Equal(=). And NullIgnored, OnlyOnceRegistered. {TIMESTAMP} * * @param deletedTime The value of deletedTime as equal. */ @@ -1559,7 +1493,7 @@ } /** - * NotEqual(!=). And NullIgnored, OnceRegistered. + * NotEqual(!=). And NullIgnored, OnlyOnceRegistered. * * @param deletedTime The value of deletedTime as notEqual. */ @@ -1568,7 +1502,7 @@ } /** - * GreaterThan(>). And NullIgnored, OnceRegistered. + * GreaterThan(>). And NullIgnored, OnlyOnceRegistered. * * @param deletedTime The value of deletedTime as greaterThan. */ @@ -1577,7 +1511,7 @@ } /** - * LessThan(>). And NullIgnored, OnceRegistered. + * LessThan(>). And NullIgnored, OnlyOnceRegistered. * * @param deletedTime The value of deletedTime as lessThan. */ @@ -1586,7 +1520,7 @@ } /** - * GreaterEqual(>). And NullIgnored, OnceRegistered. + * GreaterEqual(>). And NullIgnored, OnlyOnceRegistered. * * @param deletedTime The value of deletedTime as greaterEqual. */ @@ -1595,7 +1529,7 @@ } /** - * LessEqual(>). And NullIgnored, OnceRegistered. + * LessEqual(>). And NullIgnored, OnlyOnceRegistered. * * @param deletedTime The value of deletedTime as lessEqual. */ @@ -1605,7 +1539,7 @@ /** * FromTo($fromDate <= COLUMN_NAME <= $toDate). And NullIgnored, - * OnceRegistered. {TIMESTAMP} + * OnlyOnceRegistered. {TIMESTAMP} * * @param fromDate The from-date of deletedTime. (Nullable) * @param toDate The to-date of deletedTime. (Nullable) @@ -1623,7 +1557,7 @@ /** * FromTo($fromDate <= COLUMN_NAME < $toDate + 1). And NullIgnored, - * OnceRegistered. {TIMESTAMP} + * OnlyOnceRegistered. {TIMESTAMP} * * @param fromDate The from-date of deletedTime. (Nullable) * @param toDate The to-date of deletedTime. (Nullable) @@ -1637,14 +1571,14 @@ } /** - * IsNull(is null). And OnceRegistered. + * IsNull(is null). And OnlyOnceRegistered. */ public void setDeletedTime_IsNull() { regDeletedTime(CK_ISN, DUMMY_OBJECT); } /** - * IsNotNull(is not null). And OnceRegistered. + * IsNotNull(is not null). And OnlyOnceRegistered. */ public void setDeletedTime_IsNotNull() { regDeletedTime(CK_ISNN, DUMMY_OBJECT); @@ -1663,7 +1597,7 @@ abstract protected ConditionValue getCValueDeletedTime(); /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {VARCHAR(255)} + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {VARCHAR(255)} * * @param deletedBy The value of deletedBy as equal. */ @@ -1672,7 +1606,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param deletedBy The value of deletedBy as notEqual. */ @@ -1681,7 +1615,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param deletedBy The value of deletedBy as greaterThan. */ @@ -1690,7 +1624,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param deletedBy The value of deletedBy as lessThan. */ @@ -1699,7 +1633,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param deletedBy The value of deletedBy as greaterEqual. */ @@ -1708,7 +1642,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param deletedBy The value of deletedBy as lessEqual. */ @@ -1717,7 +1651,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param deletedBy The value of deletedBy as prefixSearch. */ @@ -1726,20 +1660,6 @@ } /** - * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, - * SeveralRegistered. - * - * @param deletedBy The value of deletedBy as likeSearch. - * @param likeSearchOption The option of like-search. (NotNull) - */ - public void setDeletedBy_LikeSearch( - String deletedBy, - jp.sf.pal.notepad.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { - registerLikeSearchQuery(CK_LS, fRES(deletedBy), getCValueDeletedBy(), - "DELETED_BY", "DeletedBy", "deletedBy", likeSearchOption); - } - - /** * InScope(in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * @@ -1750,38 +1670,52 @@ } /** - * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * - * @param deletedBy The collection of deletedBy as inScope. - * @param inScopeOption The option of in-scope. (NotNull) + * @param deletedByList The collection of deletedBy as notInScope. */ - public void setDeletedBy_InScope( + public void setDeletedBy_NotInScope(Collection deletedByList) { + regDeletedBy(CK_NINS, cTL(deletedByList)); + } + + /** + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param deletedBy The value of deletedBy as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) + */ + public void setDeletedBy_LikeSearch( String deletedBy, - jp.sf.pal.notepad.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(deletedBy), getCValueDeletedBy(), - "DELETED_BY", "DeletedBy", "deletedBy", inScopeOption); + jp.sf.pal.notepad.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(deletedBy), getCValueDeletedBy(), "DELETED_BY", + "DeletedBy", "deletedBy", likeSearchOption); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param deletedByList The collection of deletedBy as notInScope. + * @param deletedBy The value of deletedBy as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setDeletedBy_NotInScope(Collection deletedByList) { - regDeletedBy(CK_NINS, cTL(deletedByList)); + public void setDeletedBy_NotLikeSearch( + String deletedBy, + jp.sf.pal.notepad.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(deletedBy), getCValueDeletedBy(), "DELETED_BY", + "DeletedBy", "deletedBy", likeSearchOption); } /** - * IsNull(is null). And OnceRegistered. + * IsNull(is null). And OnlyOnceRegistered. */ public void setDeletedBy_IsNull() { regDeletedBy(CK_ISN, DUMMY_OBJECT); } /** - * IsNotNull(is not null). And OnceRegistered. + * IsNotNull(is not null). And OnlyOnceRegistered. */ public void setDeletedBy_IsNotNull() { regDeletedBy(CK_ISNN, DUMMY_OBJECT); @@ -1800,7 +1734,7 @@ abstract protected ConditionValue getCValueDeletedBy(); /** - * Equal(=). And NullIgnored, OnceRegistered. {NotNull : INTEGER} + * Equal(=). And NullIgnored, OnlyOnceRegistered. {NotNull : INTEGER} * * @param versionno The value of versionno as equal. */ @@ -1809,7 +1743,7 @@ } /** - * NotEqual(!=). And NullIgnored, OnceRegistered. + * NotEqual(!=). And NullIgnored, OnlyOnceRegistered. * * @param versionno The value of versionno as notEqual. */ @@ -1818,7 +1752,7 @@ } /** - * GreaterThan(>). And NullIgnored, OnceRegistered. + * GreaterThan(>). And NullIgnored, OnlyOnceRegistered. * * @param versionno The value of versionno as greaterThan. */ @@ -1827,7 +1761,7 @@ } /** - * LessThan(<). And NullIgnored, OnceRegistered. + * LessThan(<). And NullIgnored, OnlyOnceRegistered. * * @param versionno The value of versionno as lessThan. */ @@ -1836,7 +1770,7 @@ } /** - * GreaterEqual(>=). And NullIgnored, OnceRegistered. + * GreaterEqual(>=). And NullIgnored, OnlyOnceRegistered. * * @param versionno The value of versionno as greaterEqual. */ @@ -1845,7 +1779,7 @@ } /** - * LessEqual(<=). And NullIgnored, OnceRegistered. + * LessEqual(<=). And NullIgnored, OnlyOnceRegistered. * * @param versionno The value of versionno as lessEqual. */ @@ -1885,6 +1819,50 @@ abstract protected ConditionValue getCValueVersionno(); + public SSQFunction scalar_Equal() { + return xcreateSSQFunction("="); + } + + public SSQFunction scalar_GreaterEqual() { + return xcreateSSQFunction(">="); + } + + public SSQFunction scalar_GreaterThan() { + return xcreateSSQFunction(">"); + } + + public SSQFunction scalar_LessEqual() { + return xcreateSSQFunction("<="); + } + + public SSQFunction scalar_LessThan() { + return xcreateSSQFunction("<"); + } + + protected SSQFunction xcreateSSQFunction(final String operand) { + return new SSQFunction(new SSQSetupper() { + public void setup(String function, SubQuery subQuery) { + xscalarSubQuery(function, subQuery, operand); + } + }); + } + + protected void xscalarSubQuery(String function, + SubQuery subQuery, String operand) { + assertObjectNotNull("subQuery", subQuery); + GroupInfoCB cb = new GroupInfoCB(); + cb.xsetupForScalarSubQuery(); + subQuery.query(cb); + String subQueryPropertyName = keepScalarSubQuery(cb.query()); // for + // saving + // query + // -value. + registerScalarSubQuery(function, cb.query(), subQueryPropertyName, + operand); + } + + public abstract String keepScalarSubQuery(GroupInfoCQ subQuery); + // Very Internal (for Suppressing Warn about 'Not Use Import') protected String getConditionBeanClassNameInternally() { return GroupInfoCB.class.getName(); Modified: notepad/trunk/src/main/java/jp/sf/pal/notepad/db/cbean/cq/bs/AbstractBsGroupMappingCQ.java =================================================================== --- notepad/trunk/src/main/java/jp/sf/pal/notepad/db/cbean/cq/bs/AbstractBsGroupMappingCQ.java 2008-12-27 22:11:51 UTC (rev 1627) +++ notepad/trunk/src/main/java/jp/sf/pal/notepad/db/cbean/cq/bs/AbstractBsGroupMappingCQ.java 2008-12-27 22:13:37 UTC (rev 1628) @@ -11,16 +11,13 @@ import jp.sf.pal.notepad.db.cbean.GroupInfoCB; import jp.sf.pal.notepad.db.cbean.GroupMappingCB; import jp.sf.pal.notepad.db.cbean.UserInfoCB; -import jp.sf.pal.notepad.db.cbean.cq.GroupInfoCQ; import jp.sf.pal.notepad.db.cbean.cq.GroupMappingCQ; -import jp.sf.pal.notepad.db.cbean.cq.UserInfoCQ; /** * The abstract condition-query of GROUP_MAPPING. * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public abstract class AbstractBsGroupMappingCQ extends AbstractConditionQuery { //========================================================================== @@ -50,7 +47,8 @@ // ===== /** - * Equal(=). And NullIgnored, OnceRegistered. {PK : ID : NotNull : INTEGER} + * Equal(=). And NullIgnored, OnlyOnceRegistered. {PK : ID : NotNull : + * INTEGER} * * @param id The value of id as equal. */ @@ -59,7 +57,7 @@ } /** - * NotEqual(!=). And NullIgnored, OnceRegistered. + * NotEqual(!=). And NullIgnored, OnlyOnceRegistered. * * @param id The value of id as notEqual. */ @@ -68,7 +66,7 @@ } /** - * GreaterThan(>). And NullIgnored, OnceRegistered. + * GreaterThan(>). And NullIgnored, OnlyOnceRegistered. * * @param id The value of id as greaterThan. */ @@ -77,7 +75,7 @@ } /** - * LessThan(<). And NullIgnored, OnceRegistered. + * LessThan(<). And NullIgnored, OnlyOnceRegistered. * * @param id The value of id as lessThan. */ @@ -86,7 +84,7 @@ } /** - * GreaterEqual(>=). And NullIgnored, OnceRegistered. + * GreaterEqual(>=). And NullIgnored, OnlyOnceRegistered. * * @param id The value of id as greaterEqual. */ @@ -95,7 +93,7 @@ } /** - * LessEqual(<=). And NullIgnored, OnceRegistered. + * LessEqual(<=). And NullIgnored, OnlyOnceRegistered. * * @param id The value of id as lessEqual. */ @@ -124,14 +122,14 @@ } /** - * IsNull(is null). And OnceRegistered. + * IsNull(is null). And OnlyOnceRegistered. */ public void setId_IsNull() { regId(CK_ISN, DUMMY_OBJECT); } /** - * IsNotNull(is not null). And OnceRegistered. + * IsNotNull(is not null). And OnlyOnceRegistered. */ public void setId_IsNotNull() { regId(CK_ISNN, DUMMY_OBJECT); @@ -148,8 +146,8 @@ abstract protected ConditionValue getCValueId(); /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {NotNull : VARCHAR(255) - * : FK to USER_INFO} + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {NotNull : + * VARCHAR(255) : FK to USER_INFO} * * @param userId The value of userId as equal. */ @@ -158,7 +156,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param userId The value of userId as notEqual. */ @@ -167,7 +165,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param userId The value of userId as greaterThan. */ @@ -176,7 +174,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param userId The value of userId as lessThan. */ @@ -185,7 +183,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param userId The value of userId as greaterEqual. */ @@ -194,7 +192,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param userId The value of userId as lessEqual. */ @@ -203,7 +201,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param userId The value of userId as prefixSearch. */ @@ -212,20 +210,6 @@ } /** - * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, - * SeveralRegistered. - * - * @param userId The value of userId as likeSearch. - * @param likeSearchOption The option of like-search. (NotNull) - */ - public void setUserId_LikeSearch( - String userId, - jp.sf.pal.notepad.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { - registerLikeSearchQuery(CK_LS, fRES(userId), getCValueUserId(), - "USER_ID", "UserId", "userId", likeSearchOption); - } - - /** * InScope(in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * @@ -236,42 +220,41 @@ } /** - * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * - * @param userId The collection of userId as inScope. - * @param inScopeOption The option of in-scope. (NotNull) + * @param userIdList The collection of userId as notInScope. */ - public void setUserId_InScope( - String userId, - jp.sf.pal.notepad.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(userId), getCValueUserId(), - "USER_ID", "UserId", "userId", inScopeOption); + public void setUserId_NotInScope(Collection userIdList) { + regUserId(CK_NINS, cTL(userIdList)); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param userIdList The collection of userId as notInScope. + * @param userId The value of userId as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) */ - public void setUserId_NotInScope(Collection userIdList) { - regUserId(CK_NINS, cTL(userIdList)); + public void setUserId_LikeSearch( + String userId, + jp.sf.pal.notepad.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(userId), getCValueUserId(), "USER_ID", "UserId", + "userId", likeSearchOption); } /** - * @param userInfoCBquery Query. - * @deprecated Please use inScopeUserInfo(subQuery) method. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param userId The value of userId as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setUserId_InScopeSubQuery_UserInfo(UserInfoCQ userInfoCBquery) { - String subQueryPropertyName = keepUserId_InScopeSubQuery_UserInfo(userInfoCBquery);// for - // saving - // query - // - - // value - // . - registerInScopeSubQuery(userInfoCBquery, "USER_ID", "USER_ID", - subQueryPropertyName); + public void setUserId_NotLikeSearch( + String userId, + jp.sf.pal.notepad.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(userId), getCValueUserId(), "USER_ID", "UserId", + "userId", likeSearchOption); } public void inScopeUserInfo(SubQuery subQuery) { @@ -280,12 +263,12 @@ cb.xsetupForInScopeSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepUserId_InScopeSubQuery_UserInfo(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerInScopeSubQuery(cb.query(), "USER_ID", "USER_ID", subQueryPropertyName); } - abstract public String keepUserId_InScopeSubQuery_UserInfo( + public abstract String keepUserId_InScopeSubQuery_UserInfo( jp.sf.pal.notepad.db.cbean.cq.UserInfoCQ subQuery); protected void regUserId(ConditionKey key, Object value) { @@ -301,8 +284,8 @@ abstract protected ConditionValue getCValueUserId(); /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {NotNull : VARCHAR(255) - * : FK to GROUP_INFO} + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {NotNull : + * VARCHAR(255) : FK to GROUP_INFO} * * @param groupId The value of groupId as equal. */ @@ -311,7 +294,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param groupId The value of groupId as notEqual. */ @@ -320,7 +303,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param groupId The value of groupId as greaterThan. */ @@ -329,7 +312,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param groupId The value of groupId as lessThan. */ @@ -338,7 +321,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param groupId The value of groupId as greaterEqual. */ @@ -347,7 +330,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param groupId The value of groupId as lessEqual. */ @@ -356,7 +339,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param groupId The value of groupId as prefixSearch. */ @@ -365,20 +348,6 @@ } /** - * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, - * SeveralRegistered. - * - * @param groupId The value of groupId as likeSearch. - * @param likeSearchOption The option of like-search. (NotNull) - */ - public void setGroupId_LikeSearch( - String groupId, - jp.sf.pal.notepad.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { - registerLikeSearchQuery(CK_LS, fRES(groupId), getCValueGroupId(), - "GROUP_ID", "GroupId", "groupId", likeSearchOption); - } - - /** * InScope(in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * @@ -389,43 +358,41 @@ } /** - * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * - * @param groupId The collection of groupId as inScope. - * @param inScopeOption The option of in-scope. (NotNull) + * @param groupIdList The collection of groupId as notInScope. */ - public void setGroupId_InScope( - String groupId, - jp.sf.pal.notepad.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(groupId), getCValueGroupId(), - "GROUP_ID", "GroupId", "groupId", inScopeOption); + public void setGroupId_NotInScope(Collection groupIdList) { + regGroupId(CK_NINS, cTL(groupIdList)); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param groupIdList The collection of groupId as notInScope. + * @param groupId The value of groupId as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) */ - public void setGroupId_NotInScope(Collection groupIdList) { - regGroupId(CK_NINS, cTL(groupIdList)); + public void setGroupId_LikeSearch( + String groupId, + jp.sf.pal.notepad.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(groupId), getCValueGroupId(), "GROUP_ID", "GroupId", + "groupId", likeSearchOption); } /** - * @param groupInfoCBquery Query. - * @deprecated Please use inScopeGroupInfo(subQuery) method. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param groupId The value of groupId as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setGroupId_InScopeSubQuery_GroupInfo( - GroupInfoCQ groupInfoCBquery) { - String subQueryPropertyName = keepGroupId_InScopeSubQuery_GroupInfo(groupInfoCBquery);// for - // saving - // query - // - - // value - // . - registerInScopeSubQuery(groupInfoCBquery, "GROUP_ID", "GROUP_ID", - subQueryPropertyName); + public void setGroupId_NotLikeSearch( + String groupId, + jp.sf.pal.notepad.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(groupId), getCValueGroupId(), "GROUP_ID", + "GroupId", "groupId", likeSearchOption); } public void inScopeGroupInfo(SubQuery subQuery) { @@ -434,12 +401,12 @@ cb.xsetupForInScopeSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepGroupId_InScopeSubQuery_GroupInfo(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerInScopeSubQuery(cb.query(), "GROUP_ID", "GROUP_ID", subQueryPropertyName); } - abstract public String keepGroupId_InScopeSubQuery_GroupInfo( + public abstract String keepGroupId_InScopeSubQuery_GroupInfo( jp.sf.pal.notepad.db.cbean.cq.GroupInfoCQ subQuery); protected void regGroupId(ConditionKey key, Object value) { @@ -454,6 +421,53 @@ abstract protected ConditionValue getCValueGroupId(); + public SSQFunction scalar_Equal() { + return xcreateSSQFunction("="); + } + + public SSQFunction scalar_GreaterEqual() { + return xcreateSSQFunction(">="); + } + + public SSQFunction scalar_GreaterThan() { + return xcreateSSQFunction(">"); + } + + public SSQFunction scalar_LessEqual() { + return xcreateSSQFunction("<="); + } + + public SSQFunction scalar_LessThan() { + return xcreateSSQFunction("<"); + } + + protected SSQFunction xcreateSSQFunction( + final String operand) { + return new SSQFunction( + new SSQSetupper() { + public void setup(String function, + SubQuery subQuery) { + xscalarSubQuery(function, subQuery, operand); + } + }); + } + + protected void xscalarSubQuery(String function, + SubQuery subQuery, String operand) { + assertObjectNotNull("subQuery", subQuery); + GroupMappingCB cb = new GroupMappingCB(); + cb.xsetupForScalarSubQuery(); + subQuery.query(cb); + String subQueryPropertyName = keepScalarSubQuery(cb.query()); // for + // saving + // query + // -value. + registerScalarSubQuery(function, cb.query(), subQueryPropertyName, + operand); + } + + public abstract String keepScalarSubQuery(GroupMappingCQ subQuery); + // Very Internal (for Suppressing Warn about 'Not Use Import') protected String getConditionBeanClassNameInternally() { return GroupMappingCB.class.getName(); Modified: notepad/trunk/src/main/java/jp/sf/pal/notepad/db/cbean/cq/bs/AbstractBsNotepadCQ.java =================================================================== --- notepad/trunk/src/main/java/jp/sf/pal/notepad/db/cbean/cq/bs/AbstractBsNotepadCQ.java 2008-12-27 22:11:51 UTC (rev 1627) +++ notepad/trunk/src/main/java/jp/sf/pal/notepad/db/cbean/cq/bs/AbstractBsNotepadCQ.java 2008-12-27 22:13:37 UTC (rev 1628) @@ -15,14 +15,12 @@ import jp.sf.pal.notepad.db.cbean.cq.NotepadCQ; import jp.sf.pal.notepad.db.cbean.cq.NotepadCategoryCQ; import jp.sf.pal.notepad.db.cbean.cq.NotepadContentCQ; -import jp.sf.pal.notepad.db.cbean.cq.UserInfoCQ; /** * The abstract condition-query of NOTEPAD. * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public abstract class AbstractBsNotepadCQ extends AbstractConditionQuery { //========================================================================== @@ -52,7 +50,8 @@ // ===== /** - * Equal(=). And NullIgnored, OnceRegistered. {PK : ID : NotNull : BIGINT} + * Equal(=). And NullIgnored, OnlyOnceRegistered. {PK : ID : NotNull : + * BIGINT} * * @param id The value of id as equal. */ @@ -61,7 +60,7 @@ } /** - * NotEqual(!=). And NullIgnored, OnceRegistered. + * NotEqual(!=). And NullIgnored, OnlyOnceRegistered. * * @param id The value of id as notEqual. */ @@ -70,7 +69,7 @@ } /** - * GreaterThan(>). And NullIgnored, OnceRegistered. + * GreaterThan(>). And NullIgnored, OnlyOnceRegistered. * * @param id The value of id as greaterThan. */ @@ -79,7 +78,7 @@ } /** - * LessThan(<). And NullIgnored, OnceRegistered. + * LessThan(<). And NullIgnored, OnlyOnceRegistered. * * @param id The value of id as lessThan. */ @@ -88,7 +87,7 @@ } /** - * GreaterEqual(>=). And NullIgnored, OnceRegistered. + * GreaterEqual(>=). And NullIgnored, OnlyOnceRegistered. * * @param id The value of id as greaterEqual. */ @@ -97,7 +96,7 @@ } /** - * LessEqual(<=). And NullIgnored, OnceRegistered. + * LessEqual(<=). And NullIgnored, OnlyOnceRegistered. * * @param id The value of id as lessEqual. */ @@ -125,33 +124,17 @@ regId(CK_NINS, cTL(idList)); } - /** - * @param notepadContentCBquery Query. - * @deprecated Please use inScopeNotepadContentAsOne(subQuery) method. - */ - public void setId_InScopeSubQuery_NotepadContentAsOne( - NotepadContentCQ notepadContentCBquery) { - String subQueryPropertyName = keepId_InScopeSubQuery_NotepadContentAsOne(notepadContentCBquery);// for - // saving - // query - // - - // value - // . - registerInScopeSubQuery(notepadContentCBquery, "ID", "ID", - subQueryPropertyName); - } - public void inScopeNotepadContentAsOne(SubQuery subQuery) { assertObjectNotNull("subQuery", subQuery); NotepadContentCB cb = new NotepadContentCB(); cb.xsetupForInScopeSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepId_InScopeSubQuery_NotepadContentAsOne(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerInScopeSubQuery(cb.query(), "ID", "ID", subQueryPropertyName); } - abstract public String keepId_InScopeSubQuery_NotepadContentAsOne( + public abstract String keepId_InScopeSubQuery_NotepadContentAsOne( NotepadContentCQ subQuery); public void notInScopeNotepadContentAsOne( @@ -161,30 +144,14 @@ cb.xsetupForInScopeSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepId_NotInScopeSubQuery_NotepadContentAsOne(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerNotInScopeSubQuery(cb.query(), "ID", "ID", subQueryPropertyName); } - abstract public String keepId_NotInScopeSubQuery_NotepadContentAsOne( + public abstract String keepId_NotInScopeSubQuery_NotepadContentAsOne( NotepadContentCQ subQuery); /** - * @param notepadContentCBquery Query. - * @deprecated Please use existsNotepadContentAsOne(subQuery) method. - */ - public void setId_ExistsSubQuery_NotepadContentAsOne( - NotepadContentCQ notepadContentCBquery) { - String subQueryPropertyName = keepId_ExistsSubQuery_NotepadContentAsOne(notepadContentCBquery);// for - // saving - // query - // - - // value - // . - registerExistsSubQuery(notepadContentCBquery, "ID", "ID", - subQueryPropertyName); - } - - /** * Set up 'exists' sub-query. {exists (select ID from NOTEPAD_CONTENT where * ...)} * @@ -197,11 +164,11 @@ cb.xsetupForExistsSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepId_ExistsSubQuery_NotepadContentAsOne(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerExistsSubQuery(cb.query(), "ID", "ID", subQueryPropertyName); } - abstract public String keepId_ExistsSubQuery_NotepadContentAsOne( + public abstract String keepId_ExistsSubQuery_NotepadContentAsOne( NotepadContentCQ subQuery); /** @@ -217,22 +184,22 @@ cb.xsetupForExistsSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepId_NotExistsSubQuery_NotepadContentAsOne(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerNotExistsSubQuery(cb.query(), "ID", "ID", subQueryPropertyName); } - abstract public String keepId_NotExistsSubQuery_NotepadContentAsOne( + public abstract String keepId_NotExistsSubQuery_NotepadContentAsOne( NotepadContentCQ subQuery); /** - * IsNull(is null). And OnceRegistered. + * IsNull(is null). And OnlyOnceRegistered. */ public void setId_IsNull() { regId(CK_ISN, DUMMY_OBJECT); } /** - * IsNotNull(is not null). And OnceRegistered. + * IsNotNull(is not null). And OnlyOnceRegistered. */ public void setId_IsNotNull() { regId(CK_ISNN, DUMMY_OBJECT); @@ -249,7 +216,7 @@ abstract protected ConditionValue getCValueId(); /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {NotNull : + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {NotNull : * VARCHAR(100)} * * @param title The value of title as equal. @@ -259,7 +226,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param title The value of title as notEqual. */ @@ -268,7 +235,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param title The value of title as greaterThan. */ @@ -277,7 +244,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param title The value of title as lessThan. */ @@ -286,7 +253,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param title The value of title as greaterEqual. */ @@ -295,7 +262,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param title The value of title as lessEqual. */ @@ -304,7 +271,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param title The value of title as prefixSearch. */ @@ -313,20 +280,6 @@ } /** - * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, - * SeveralRegistered. - * - * @param title The value of title as likeSearch. - * @param likeSearchOption The option of like-search. (NotNull) - */ - public void setTitle_LikeSearch( - String title, - jp.sf.pal.notepad.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { - registerLikeSearchQuery(CK_LS, fRES(title), getCValueTitle(), "TITLE", - "Title", "title", likeSearchOption); - } - - /** * InScope(in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * @@ -337,27 +290,41 @@ } /** - * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * - * @param title The collection of title as inScope. - * @param inScopeOption The option of in-scope. (NotNull) + * @param titleList The collection of title as notInScope. */ - public void setTitle_InScope( + public void setTitle_NotInScope(Collection titleList) { + regTitle(CK_NINS, cTL(titleList)); + } + + /** + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param title The value of title as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) + */ + public void setTitle_LikeSearch( String title, - jp.sf.pal.notepad.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(title), getCValueTitle(), "TITLE", - "Title", "title", inScopeOption); + jp.sf.pal.notepad.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(title), getCValueTitle(), "TITLE", "Title", "title", + likeSearchOption); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param titleList The collection of title as notInScope. + * @param title The value of title as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setTitle_NotInScope(Collection titleList) { - regTitle(CK_NINS, cTL(titleList)); + public void setTitle_NotLikeSearch( + String title, + jp.sf.pal.notepad.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(title), getCValueTitle(), "TITLE", "Title", + "title", likeSearchOption); } protected void regTitle(ConditionKey key, Object value) { @@ -372,7 +339,7 @@ abstract protected ConditionValue getCValueTitle(); /** - * Equal(=). And NullIgnored, OnceRegistered. {NotNull : INTEGER : + * Equal(=). And NullIgnored, OnlyOnceRegistered. {NotNull : INTEGER : * Default=[0]} * * @param sortOrder The value of sortOrder as equal. @@ -382,7 +349,7 @@ } /** - * NotEqual(!=). And NullIgnored, OnceRegistered. + * NotEqual(!=). And NullIgnored, OnlyOnceRegistered. * * @param sortOrder The value of sortOrder as notEqual. */ @@ -391,7 +358,7 @@ } /** - * GreaterThan(>). And NullIgnored, OnceRegistered. + * GreaterThan(>). And NullIgnored, OnlyOnceRegistered. * * @param sortOrder The value of sortOrder as greaterThan. */ @@ -400,7 +367,7 @@ } /** - * LessThan(<). And NullIgnored, OnceRegistered. + * LessThan(<). And NullIgnored, OnlyOnceRegistered. * * @param sortOrder The value of sortOrder as lessThan. */ @@ -409,7 +376,7 @@ } /** - * GreaterEqual(>=). And NullIgnored, OnceRegistered. + * GreaterEqual(>=). And NullIgnored, OnlyOnceRegistered. * * @param sortOrder The value of sortOrder as greaterEqual. */ @@ -418,7 +385,7 @@ } /** - * LessEqual(<=). And NullIgnored, OnceRegistered. + * LessEqual(<=). And NullIgnored, OnlyOnceRegistered. * * @param sortOrder The value of sortOrder as lessEqual. */ @@ -459,8 +426,8 @@ abstract protected ConditionValue getCValueSortOrder(); /** - * Equal(=). And NullIgnored, OnceRegistered. {INTEGER : Default=[0] : FK to - * NOTEPAD_CATEGORY} + * Equal(=). And NullIgnored, OnlyOnceRegistered. {INTEGER : Default=[0] : + * FK to NOTEPAD_CATEGORY} * * @param categoryId The value of categoryId as equal. */ @@ -469,7 +436,7 @@ } /** - * NotEqual(!=). And NullIgnored, OnceRegistered. + * NotEqual(!=). And NullIgnored, OnlyOnceRegistered. * * @param categoryId The value of categoryId as notEqual. */ @@ -478,7 +445,7 @@ } /** - * GreaterThan(>). And NullIgnored, OnceRegistered. + * GreaterThan(>). And NullIgnored, OnlyOnceRegistered. * * @param categoryId The value of categoryId as greaterThan. */ @@ -487,7 +454,7 @@ } /** - * LessThan(<). And NullIgnored, OnceRegistered. + * LessThan(<). And NullIgnored, OnlyOnceRegistered. * * @param categoryId The value of categoryId as lessThan. */ @@ -496,7 +463,7 @@ } /** - * GreaterEqual(>=). And NullIgnored, OnceRegistered. + * GreaterEqual(>=). And NullIgnored, OnlyOnceRegistered. * * @param categoryId The value of categoryId as greaterEqual. */ @@ -505,7 +472,7 @@ } /** - * LessEqual(<=). And NullIgnored, OnceRegistered. + * LessEqual(<=). And NullIgnored, OnlyOnceRegistered. * * @param categoryId The value of categoryId as lessEqual. */ @@ -533,45 +500,29 @@ regCategoryId(CK_NINS, cTL(categoryIdList)); } - /** - * @param notepadCategoryCBquery Query. - * @deprecated Please use inScopeNotepadCategory(subQuery) method. - */ - public void setCategoryId_InScopeSubQuery_NotepadCategory( - NotepadCategoryCQ notepadCategoryCBquery) { - String subQueryPropertyName = keepCategoryId_InScopeSubQuery_NotepadCategory(notepadCategoryCBquery);// for - // saving - // query - // - - // value - // . - registerInScopeSubQuery(notepadCategoryCBquery, "CATEGORY_ID", "ID", - subQueryPropertyName); - } - public void inScopeNotepadCategory(SubQuery subQuery) { assertObjectNotNull("subQuery", subQuery); NotepadCategoryCB cb = new NotepadCategoryCB(); cb.xsetupForInScopeSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepCategoryId_InScopeSubQuery_NotepadCategory(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerInScopeSubQuery(cb.query(), "CATEGORY_ID", "ID", subQueryPropertyName); } - abstract public String keepCategoryId_InScopeSubQuery_NotepadCategory( + public abstract String keepCategoryId_InScopeSubQuery_NotepadCategory( NotepadCategoryCQ subQuery); /** - * IsNull(is null). And OnceRegistered. + * IsNull(is null). And OnlyOnceRegistered. */ public void setCategoryId_IsNull() { regCategoryId(CK_ISN, DUMMY_OBJECT); } /** - * IsNotNull(is not null). And OnceRegistered. + * IsNotNull(is not null). And OnlyOnceRegistered. */ public void setCategoryId_IsNotNull() { regCategoryId(CK_ISNN, DUMMY_OBJECT); @@ -590,7 +541,7 @@ abstract protected ConditionValue getCValueCategoryId(); /** - * Equal(=). And NullIgnored, OnceRegistered. {NotNull : TIMESTAMP} + * Equal(=). And NullIgnored, OnlyOnceRegistered. {NotNull : TIMESTAMP} * * @param createdTime The value of createdTime as equal. */ @@ -599,7 +550,7 @@ } /** - * NotEqual(!=). And NullIgnored, OnceRegistered. + * NotEqual(!=). And NullIgnored, OnlyOnceRegistered. * * @param createdTime The value of createdTime as notEqual. */ @@ -608,7 +559,7 @@ } /** - * GreaterThan(>). And NullIgnored, OnceRegistered. + * GreaterThan(>). And NullIgnored, OnlyOnceRegistered. * * @param createdTime The value of createdTime as greaterThan. */ @@ -617,7 +568,7 @@ } /** - * LessThan(>). And NullIgnored, OnceRegistered. + * LessThan(>). And NullIgnored, OnlyOnceRegistered. * * @param createdTime The value of createdTime as lessThan. */ @@ -626,7 +577,7 @@ } /** - * GreaterEqual(>). And NullIgnored, OnceRegistered. + * GreaterEqual(>). And NullIgnored, OnlyOnceRegistered. * * @param createdTime The value of createdTime as greaterEqual. */ @@ -635,7 +586,7 @@ } /** - * LessEqual(>). And NullIgnored, OnceRegistered. + * LessEqual(>). And NullIgnored, OnlyOnceRegistered. * * @param createdTime The value of createdTime as lessEqual. */ @@ -645,7 +596,7 @@ /** * FromTo($fromDate <= COLUMN_NAME <= $toDate). And NullIgnored, - * OnceRegistered. {NotNull : TIMESTAMP} + * OnlyOnceRegistered. {NotNull : TIMESTAMP} * * @param fromDate The from-date of createdTime. (Nullable) * @param toDate The to-date of createdTime. (Nullable) @@ -663,7 +614,7 @@ /** * FromTo($fromDate <= COLUMN_NAME < $toDate + 1). And NullIgnored, - * OnceRegistered. {NotNull : TIMESTAMP} + * OnlyOnceRegistered. {NotNull : TIMESTAMP} * * @param fromDate The from-date of createdTime. (Nullable) * @param toDate The to-date of createdTime. (Nullable) @@ -689,8 +640,8 @@ abstract protected ConditionValue getCValueCreatedTime(); /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {NotNull : VARCHAR(255) - * : FK to USER_INFO} + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {NotNull : + * VARCHAR(255) : FK to USER_INFO} * * @param createdBy The value of createdBy as equal. */ @@ -699,7 +650,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param createdBy The value of createdBy as notEqual. */ @@ -708,7 +659,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param createdBy The value of createdBy as greaterThan. */ @@ -717,7 +668,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param createdBy The value of createdBy as lessThan. */ @@ -726,7 +677,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param createdBy The value of createdBy as greaterEqual. */ @@ -735,7 +686,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param createdBy The value of createdBy as lessEqual. */ @@ -744,7 +695,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param createdBy The value of createdBy as prefixSearch. */ @@ -753,20 +704,6 @@ } /** - * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, - * SeveralRegistered. - * - * @param createdBy The value of createdBy as likeSearch. - * @param likeSearchOption The option of like-search. (NotNull) - */ - public void setCreatedBy_LikeSearch( - String createdBy, - jp.sf.pal.notepad.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { - registerLikeSearchQuery(CK_LS, fRES(createdBy), getCValueCreatedBy(), - "CREATED_BY", "CreatedBy", "createdBy", likeSearchOption); - } - - /** * InScope(in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * @@ -777,43 +714,41 @@ } /** - * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * - * @param createdBy The collection of createdBy as inScope. - * @param inScopeOption The option of in-scope. (NotNull) + * @param createdByList The collection of createdBy as notInScope. */ - public void setCreatedBy_InScope( - String createdBy, - jp.sf.pal.notepad.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(createdBy), getCValueCreatedBy(), - "CREATED_BY", "CreatedBy", "createdBy", inScopeOption); + public void setCreatedBy_NotInScope(Collection createdByList) { + regCreatedBy(CK_NINS, cTL(createdByList)); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param createdByList The collection of createdBy as notInScope. + * @param createdBy The value of createdBy as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) */ - public void setCreatedBy_NotInScope(Collection createdByList) { - regCreatedBy(CK_NINS, cTL(createdByList)); + public void setCreatedBy_LikeSearch( + String createdBy, + jp.sf.pal.notepad.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(createdBy), getCValueCreatedBy(), "CREATED_BY", + "CreatedBy", "createdBy", likeSearchOption); } /** - * @param userInfoCBquery Query. - * @deprecated Please use inScopeUserInfoByCreatedBy(subQuery) method. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param createdBy The value of createdBy as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setCreatedBy_InScopeSubQuery_UserInfoByCreatedBy( - UserInfoCQ userInfoCBquery) { - String subQueryPropertyName = keepCreatedBy_InScopeSubQuery_UserInfoByCreatedBy(userInfoCBquery);// for - // saving - // query - // - - // value - // . - registerInScopeSubQuery(userInfoCBquery, "CREATED_BY", "USER_ID", - subQueryPropertyName); + public void setCreatedBy_NotLikeSearch( + String createdBy, + jp.sf.pal.notepad.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(createdBy), getCValueCreatedBy(), "CREATED_BY", + "CreatedBy", "createdBy", likeSearchOption); } public void inScopeUserInfoByCreatedBy(SubQuery subQuery) { @@ -822,12 +757,12 @@ cb.xsetupForInScopeSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepCreatedBy_InScopeSubQuery_UserInfoByCreatedBy(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerInScopeSubQuery(cb.query(), "CREATED_BY", "USER_ID", subQueryPropertyName); } - abstract public String keepCreatedBy_InScopeSubQuery_UserInfoByCreatedBy( + public abstract String keepCreatedBy_InScopeSubQuery_UserInfoByCreatedBy( jp.sf.pal.notepad.db.cbean.cq.UserInfoCQ subQuery); protected void regCreatedBy(ConditionKey key, Object value) { @@ -843,7 +778,7 @@ abstract protected ConditionValue getCValueCreatedBy(); /** - * Equal(=). And NullIgnored, OnceRegistered. {NotNull : TIMESTAMP} + * Equal(=). And NullIgnored, OnlyOnceRegistered. {NotNull : TIMESTAMP} * * @param updatedTime The value of updatedTime as equal. */ @@ -852,7 +787,7 @@ } /** - * NotEqual(!=). And NullIgnored, OnceRegistered. + * NotEqual(!=). And NullIgnored, OnlyOnceRegistered. * * @param updatedTime The value of updatedTime as notEqual. */ @@ -861,7 +796,7 @@ } /** - * GreaterThan(>). And NullIgnored, OnceRegistered. + * GreaterThan(>). And NullIgnored, OnlyOnceRegistered. * * @param updatedTime The value of updatedTime as greaterThan. */ @@ -870,7 +805,7 @@ } /** - * LessThan(>). And NullIgnored, OnceRegistered. + * LessThan(>). And NullIgnored, OnlyOnceRegistered. * * @param updatedTime The value of updatedTime as lessThan. */ @@ -879,7 +814,7 @@ } /** - * GreaterEqual(>). And NullIgnored, OnceRegistered. + * GreaterEqual(>). And NullIgnored, OnlyOnceRegistered. * * @param updatedTime The value of updatedTime as greaterEqual. */ @@ -888,7 +823,7 @@ } /** - * LessEqual(>). And NullIgnored, OnceRegistered. + * LessEqual(>). And NullIgnored, OnlyOnceRegistered. * * @param updatedTime The value of updatedTime as lessEqual. */ @@ -898,7 +833,7 @@ /** * FromTo($fromDate <= COLUMN_NAME <= $toDate). And NullIgnored, - * OnceRegistered. {NotNull : TIMESTAMP} + * OnlyOnceRegistered. {NotNull : TIMESTAMP} * * @param fromDate The from-date of updatedTime. (Nullable) * @param toDate The to-date of updatedTime. (Nullable) @@ -916,7 +851,7 @@ /** * FromTo($fromDate <= COLUMN_NAME < $toDate + 1). And NullIgnored, - * OnceRegistered. {NotNull : TIMESTAMP} + * OnlyOnceRegistered. {NotNull : TIMESTAMP} * * @param fromDate The from-date of updatedTime. (Nullable) * @param toDate The to-date of updatedTime. (Nullable) @@ -942,8 +877,8 @@ abstract protected ConditionValue getCValueUpdatedTime(); /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {NotNull : VARCHAR(255) - * : FK to USER_INFO} + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {NotNull : + * VARCHAR(255) : FK to USER_INFO} * * @param updatedBy The value of updatedBy as equal. */ @@ -952,7 +887,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param updatedBy The value of updatedBy as notEqual. */ @@ -961,7 +896,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param updatedBy The value of updatedBy as greaterThan. */ @@ -970,7 +905,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param updatedBy The value of updatedBy as lessThan. */ @@ -979,7 +914,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param updatedBy The value of updatedBy as greaterEqual. */ @@ -988,7 +923,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param updatedBy The value of updatedBy as lessEqual. */ @@ -997,7 +932,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param updatedBy The value of updatedBy as prefixSearch. */ @@ -1006,20 +941,6 @@ } /** - * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, - * SeveralRegistered. - * - * @param updatedBy The value of updatedBy as likeSearch. - * @param likeSearchOption The option of like-search. (NotNull) - */ - public void setUpdatedBy_LikeSearch( - String updatedBy, - jp.sf.pal.notepad.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { - registerLikeSearchQuery(CK_LS, fRES(updatedBy), getCValueUpdatedBy(), - "UPDATED_BY", "UpdatedBy", "updatedBy", likeSearchOption); - } - - /** * InScope(in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * @@ -1030,43 +951,41 @@ } /** - * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * - * @param updatedBy The collection of updatedBy as inScope. - * @param inScopeOption The option of in-scope. (NotNull) + * @param updatedByList The collection of updatedBy as notInScope. */ - public void setUpdatedBy_InScope( - String updatedBy, - jp.sf.pal.notepad.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(updatedBy), getCValueUpdatedBy(), - "UPDATED_BY", "UpdatedBy", "updatedBy", inScopeOption); + public void setUpdatedBy_NotInScope(Collection updatedByList) { + regUpdatedBy(CK_NINS, cTL(updatedByList)); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param updatedByList The collection of updatedBy as notInScope. + * @param updatedBy The value of updatedBy as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) */ - public void setUpdatedBy_NotInScope(Collection updatedByList) { - regUpdatedBy(CK_NINS, cTL(updatedByList)); + public void setUpdatedBy_LikeSearch( + String updatedBy, + jp.sf.pal.notepad.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(updatedBy), getCValueUpdatedBy(), "UPDATED_BY", + "UpdatedBy", "updatedBy", likeSearchOption); } /** - * @param userInfoCBquery Query. - * @deprecated Please use inScopeUserInfoByUpdatedBy(subQuery) method. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param updatedBy The value of updatedBy as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setUpdatedBy_InScopeSubQuery_UserInfoByUpdatedBy( - UserInfoCQ userInfoCBquery) { - String subQueryPropertyName = keepUpdatedBy_InScopeSubQuery_UserInfoByUpdatedBy(userInfoCBquery);// for - // saving - // query - // - - // value - // . - registerInScopeSubQuery(userInfoCBquery, "UPDATED_BY", "USER_ID", - subQueryPropertyName); + public void setUpdatedBy_NotLikeSearch( + String updatedBy, + jp.sf.pal.notepad.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(updatedBy), getCValueUpdatedBy(), "UPDATED_BY", + "UpdatedBy", "updatedBy", likeSearchOption); } public void inScopeUserInfoByUpdatedBy(SubQuery subQuery) { @@ -1075,12 +994,12 @@ cb.xsetupForInScopeSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepUpdatedBy_InScopeSubQuery_UserInfoByUpdatedBy(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerInScopeSubQuery(cb.query(), "UPDATED_BY", "USER_ID", subQueryPropertyName); } - abstract public String keepUpdatedBy_InScopeSubQuery_UserInfoByUpdatedBy( + public abstract String keepUpdatedBy_InScopeSubQuery_UserInfoByUpdatedBy( jp.sf.pal.notepad.db.cbean.cq.UserInfoCQ subQuery); protected void regUpdatedBy(ConditionKey key, Object value) { @@ -1096,7 +1015,7 @@ abstract protected ConditionValue getCValueUpdatedBy(); /** - * Equal(=). And NullIgnored, OnceRegistered. {TIMESTAMP} + * Equal(=). And NullIgnored, OnlyOnceRegistered. {TIMESTAMP} * * @param deletedTime The value of deletedTime as equal. */ @@ -1105,7 +1024,7 @@ } /** - * NotEqual(!=). And NullIgnored, OnceRegistered. + * NotEqual(!=). And NullIgnored, OnlyOnceRegistered. * * @param deletedTime The value of deletedTime as notEqual. */ @@ -1114,7 +1033,7 @@ } /** - * GreaterThan(>). And NullIgnored, OnceRegistered. + * GreaterThan(>). And NullIgnored, OnlyOnceRegistered. * * @param deletedTime The value of deletedTime as greaterThan. */ @@ -1123,7 +1042,7 @@ } /** - * LessThan(>). And NullIgnored, OnceRegistered. + * LessThan(>). And NullIgnored, OnlyOnceRegistered. * * @param deletedTime The value of deletedTime as lessThan. */ @@ -1132,7 +1051,7 @@ } /** - * GreaterEqual(>). And NullIgnored, OnceRegistered. + * GreaterEqual(>). And NullIgnored, OnlyOnceRegistered. * * @param deletedTime The value of deletedTime as greaterEqual. */ @@ -1141,7 +1060,7 @@ } /** - * LessEqual(>). And NullIgnored, OnceRegistered. + * LessEqual(>). And NullIgnored, OnlyOnceRegistered. * * @param deletedTime The value of deletedTime as lessEqual. */ @@ -1151,7 +1070,7 @@ /** * FromTo($fromDate <= COLUMN_NAME <= $toDate). And NullIgnored, - * OnceRegistered. {TIMESTAMP} + * OnlyOnceRegistered. {TIMESTAMP} * * @param fromDate The from-date of deletedTime. (Nullable) * @param toDate The to-date of deletedTime. (Nullable) @@ -1169,7 +1088,7 @@ /** * FromTo($fromDate <= COLUMN_NAME < $toDate + 1). And NullIgnored, - * OnceRegistered. {TIMESTAMP} + * OnlyOnceRegistered. {TIMESTAMP} * * @param fromDate The from-date of deletedTime. (Nullable) * @param toDate The to-date of deletedTime. (Nullable) @@ -1183,14 +1102,14 @@ } /** - * IsNull(is null). And OnceRegistered. + * IsNull(is null). And OnlyOnceRegistered. */ public void setDeletedTime_IsNull() { regDeletedTime(CK_ISN, DUMMY_OBJECT); } /** - * IsNotNull(is not null). And OnceRegistered. + * IsNotNull(is not null). And OnlyOnceRegistered. */ public void setDeletedTime_IsNotNull() { regDeletedTime(CK_ISNN, DUMMY_OBJECT); @@ -1209,7 +1128,7 @@ abstract protected ConditionValue getCValueDeletedTime(); /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {VARCHAR(255)} + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {VARCHAR(255)} * * @param deletedBy The value of deletedBy as equal. */ @@ -1218,7 +1137,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param deletedBy The value of deletedBy as notEqual. */ @@ -1227,7 +1146,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param deletedBy The value of deletedBy as greaterThan. */ @@ -1236,7 +1155,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param deletedBy The value of deletedBy as lessThan. */ @@ -1245,7 +1164,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param deletedBy The value of deletedBy as greaterEqual. */ @@ -1254,7 +1173,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param deletedBy The value of deletedBy as lessEqual. */ @@ -1263,7 +1182,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param deletedBy The value of deletedBy as prefixSearch. */ @@ -1272,20 +1191,6 @@ } /** - * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, - * SeveralRegistered. - * - * @param deletedBy The value of deletedBy as likeSearch. - * @param likeSearchOption The option of like-search. (NotNull) - */ - public void setDeletedBy_LikeSearch( - String deletedBy, - jp.sf.pal.notepad.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { - registerLikeSearchQuery(CK_LS, fRES(deletedBy), getCValueDeletedBy(), - "DELETED_BY", "DeletedBy", "deletedBy", likeSearchOption); - } - - /** * InScope(in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * @@ -1296,38 +1201,52 @@ } /** - * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * - * @param deletedBy The collection of deletedBy as inScope. - * @param inScopeOption The option of in-scope. (NotNull) + * @param deletedByList The collection of deletedBy as notInScope. */ - public void setDeletedBy_InScope( + public void setDeletedBy_NotInScope(Collection deletedByList) { + regDeletedBy(CK_NINS, cTL(deletedByList)); + } + + /** + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param deletedBy The value of deletedBy as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) + */ + public void setDeletedBy_LikeSearch( String deletedBy, - jp.sf.pal.notepad.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(deletedBy), getCValueDeletedBy(), - "DELETED_BY", "DeletedBy", "deletedBy", inScopeOption); + jp.sf.pal.notepad.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(deletedBy), getCValueDeletedBy(), "DELETED_BY", + "DeletedBy", "deletedBy", likeSearchOption); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param deletedByList The collection of deletedBy as notInScope. + * @param deletedBy The value of deletedBy as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setDeletedBy_NotInScope(Collection deletedByList) { - regDeletedBy(CK_NINS, cTL(deletedByList)); + public void setDeletedBy_NotLikeSearch( + String deletedBy, + jp.sf.pal.notepad.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(deletedBy), getCValueDeletedBy(), "DELETED_BY", + "DeletedBy", "deletedBy", likeSearchOption); } /** - * IsNull(is null). And OnceRegistered. + * IsNull(is null). And OnlyOnceRegistered. */ public void setDeletedBy_IsNull() { regDeletedBy(CK_ISN, DUMMY_OBJECT); } /** - * IsNotNull(is not null). And OnceRegistered. + * IsNotNull(is not null). And OnlyOnceRegistered. */ public void setDeletedBy_IsNotNull() { regDeletedBy(CK_ISNN, DUMMY_OBJECT); @@ -1346,7 +1265,7 @@ abstract protected ConditionValue getCValueDeletedBy(); /** - * Equal(=). And NullIgnored, OnceRegistered. {NotNull : INTEGER : + * Equal(=). And NullIgnored, OnlyOnceRegistered. {NotNull : INTEGER : * Default=[0]} * * @param versionno The value of versionno as equal. @@ -1356,7 +1275,7 @@ } /** - * NotEqual(!=). And NullIgnored, OnceRegistered. + * NotEqual(!=). And NullIgnored, OnlyOnceRegistered. * * @param versionno The value of versionno as notEqual. */ @@ -1365,7 +1284,7 @@ } /** - * GreaterThan(>). And NullIgnored, OnceRegistered. + * GreaterThan(>). And NullIgnored, OnlyOnceRegistered. * * @param versionno The value of versionno as greaterThan. */ @@ -1374,7 +1293,7 @@ } /** - * LessThan(<). And NullIgnored, OnceRegistered. + * LessThan(<). And NullIgnored, OnlyOnceRegistered. * * @param versionno The value of versionno as lessThan. */ @@ -1383,7 +1302,7 @@ } /** - * GreaterEqual(>=). And NullIgnored, OnceRegistered. + * GreaterEqual(>=). And NullIgnored, OnlyOnceRegistered. * * @param versionno The value of versionno as greaterEqual. */ @@ -1392,7 +1311,7 @@ } /** - * LessEqual(<=). And NullIgnored, OnceRegistered. + * LessEqual(<=). And NullIgnored, OnlyOnceRegistered. * * @param versionno The value of versionno as lessEqual. */ @@ -1432,6 +1351,50 @@ abstract protected ConditionValue getCValueVersionno(); + public SSQFunction scalar_Equal() { + return xcreateSSQFunction("="); + } + + public SSQFunction scalar_GreaterEqual() { + return xcreateSSQFunction(">="); + } + + public SSQFunction scalar_GreaterThan() { + return xcreateSSQFunction(">"); + } + + public SSQFunction scalar_LessEqual() { + return xcreateSSQFunction("<="); + } + + public SSQFunction scalar_LessThan() { + return xcreateSSQFunction("<"); + } + + protected SSQFunction xcreateSSQFunction(final String operand) { + return new SSQFunction(new SSQSetupper() { + public void setup(String function, SubQuery subQuery) { + xscalarSubQuery(function, subQuery, operand); + } + }); + } + + protected void xscalarSubQuery(String function, + SubQuery subQuery, String operand) { + assertObjectNotNull("subQuery", subQuery); + NotepadCB cb = new NotepadCB(); + cb.xsetupForScalarSubQuery(); + subQuery.query(cb); + String subQueryPropertyName = keepScalarSubQuery(cb.query()); // for + // saving + // query + // -value. + registerScalarSubQuery(function, cb.query(), subQueryPropertyName, + operand); + } + + public abstract String keepScalarSubQuery(NotepadCQ subQuery); + // Very Internal (for Suppressing Warn about 'Not Use Import') protected String getConditionBeanClassNameInternally() { return NotepadCB.class.getName(); Modified: notepad/trunk/src/main/java/jp/sf/pal/notepad/db/cbean/cq/bs/AbstractBsNotepadCategoryCQ.java =================================================================== --- notepad/trunk/src/main/java/jp/sf/pal/notepad/db/cbean/cq/bs/AbstractBsNotepadCategoryCQ.java 2008-12-27 22:11:51 UTC (rev 1627) +++ notepad/trunk/src/main/java/jp/sf/pal/notepad/db/cbean/cq/bs/AbstractBsNotepadCategoryCQ.java 2008-12-27 22:13:37 UTC (rev 1628) @@ -13,14 +13,12 @@ import jp.sf.pal.notepad.db.cbean.UserInfoCB; import jp.sf.pal.notepad.db.cbean.cq.NotepadCQ; import jp.sf.pal.notepad.db.cbean.cq.NotepadCategoryCQ; -import jp.sf.pal.notepad.db.cbean.cq.UserInfoCQ; /** * The abstract condition-query of NOTEPAD_CATEGORY. * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public abstract class AbstractBsNotepadCategoryCQ extends AbstractConditionQuery { @@ -51,7 +49,8 @@ // ===== /** - * Equal(=). And NullIgnored, OnceRegistered. {PK : ID : NotNull : INTEGER} + * Equal(=). And NullIgnored, OnlyOnceRegistered. {PK : ID : NotNull : + * INTEGER} * * @param id The value of id as equal. */ @@ -60,7 +59,7 @@ } /** - * NotEqual(!=). And NullIgnored, OnceRegistered. + * NotEqual(!=). And NullIgnored, OnlyOnceRegistered. * * @param id The value of id as notEqual. */ @@ -69,7 +68,7 @@ } /** - * GreaterThan(>). And NullIgnored, OnceRegistered. + * GreaterThan(>). And NullIgnored, OnlyOnceRegistered. * * @param id The value of id as greaterThan. */ @@ -78,7 +77,7 @@ } /** - * LessThan(<). And NullIgnored, OnceRegistered. + * LessThan(<). And NullIgnored, OnlyOnceRegistered. * * @param id The value of id as lessThan. */ @@ -87,7 +86,7 @@ } /** - * GreaterEqual(>=). And NullIgnored, OnceRegistered. + * GreaterEqual(>=). And NullIgnored, OnlyOnceRegistered. * * @param id The value of id as greaterEqual. */ @@ -96,7 +95,7 @@ } /** - * LessEqual(<=). And NullIgnored, OnceRegistered. + * LessEqual(<=). And NullIgnored, OnlyOnceRegistered. * * @param id The value of id as lessEqual. */ @@ -124,33 +123,18 @@ regId(CK_NINS, cTL(idList)); } - /** - * @param notepadCBquery Query. - * @deprecated Please use inScopeNotepadList(subQuery) method. - */ - public void setId_InScopeSubQuery_NotepadList(NotepadCQ notepadCBquery) { - String subQueryPropertyName = keepId_InScopeSubQuery_NotepadList(notepadCBquery);// for - // saving - // query - // - - // value - // . - registerInScopeSubQuery(notepadCBquery, "ID", "CATEGORY_ID", - subQueryPropertyName); - } - public void inScopeNotepadList(SubQuery subQuery) { assertObjectNotNull("subQuery", subQuery); NotepadCB cb = new NotepadCB(); cb.xsetupForInScopeSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepId_InScopeSubQuery_NotepadList(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerInScopeSubQuery(cb.query(), "ID", "CATEGORY_ID", subQueryPropertyName); } - abstract public String keepId_InScopeSubQuery_NotepadList(NotepadCQ subQuery); + public abstract String keepId_InScopeSubQuery_NotepadList(NotepadCQ subQuery); public void notInScopeNotepadList(SubQuery subQuery) { assertObjectNotNull("subQuery", subQuery); @@ -158,30 +142,15 @@ cb.xsetupForInScopeSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepId_NotInScopeSubQuery_NotepadList(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerNotInScopeSubQuery(cb.query(), "ID", "CATEGORY_ID", subQueryPropertyName); } - abstract public String keepId_NotInScopeSubQuery_NotepadList( + public abstract String keepId_NotInScopeSubQuery_NotepadList( NotepadCQ subQuery); /** - * @param notepadCBquery Query. - * @deprecated Please use existsNotepadList(subQuery) method. - */ - public void setId_ExistsSubQuery_NotepadList(NotepadCQ notepadCBquery) { - String subQueryPropertyName = keepId_ExistsSubQuery_NotepadList(notepadCBquery);// for - // saving - // query - // - - // value - // . - registerExistsSubQuery(notepadCBquery, "ID", "CATEGORY_ID", - subQueryPropertyName); - } - - /** * Set up 'exists' sub-query. {exists (select CATEGORY_ID from NOTEPAD where * ...)} * @@ -194,12 +163,12 @@ cb.xsetupForExistsSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepId_ExistsSubQuery_NotepadList(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerExistsSubQuery(cb.query(), "ID", "CATEGORY_ID", subQueryPropertyName); } - abstract public String keepId_ExistsSubQuery_NotepadList(NotepadCQ subQuery); + public abstract String keepId_ExistsSubQuery_NotepadList(NotepadCQ subQuery); /** * Set up 'not exists' sub-query. {not exists (select CATEGORY_ID from @@ -214,37 +183,37 @@ cb.xsetupForExistsSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepId_NotExistsSubQuery_NotepadList(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerNotExistsSubQuery(cb.query(), "ID", "CATEGORY_ID", subQueryPropertyName); } - abstract public String keepId_NotExistsSubQuery_NotepadList( + public abstract String keepId_NotExistsSubQuery_NotepadList( NotepadCQ subQuery); public void xderiveNotepadList(String function, SubQuery subQuery, String aliasName) { assertObjectNotNull("subQuery", subQuery); NotepadCB cb = new NotepadCB(); - cb.xsetupForDeriveReferrer(); + cb.xsetupForDerivedReferrer(); subQuery.query(cb); - String subQueryPropertyName = keepId_DeriveSubQuery_NotepadList(cb - .query());// for saving query-value. - registerDeriveSubQuery(function, cb.query(), "ID", "CATEGORY_ID", - subQueryPropertyName, aliasName); + String subQueryPropertyName = keepId_DerivedReferrer_NotepadList(cb + .query()); // for saving query-value. + registerDerivedReferrerSubQuery(function, cb.query(), "ID", + "CATEGORY_ID", subQueryPropertyName, aliasName); } - abstract public String keepId_DeriveSubQuery_NotepadList(NotepadCQ subQuery); + public abstract String keepId_DerivedReferrer_NotepadList(NotepadCQ subQuery); /** - * IsNull(is null). And OnceRegistered. + * IsNull(is null). And OnlyOnceRegistered. */ public void setId_IsNull() { regId(CK_ISN, DUMMY_OBJECT); } /** - * IsNotNull(is not null). And OnceRegistered. + * IsNotNull(is not null). And OnlyOnceRegistered. */ public void setId_IsNotNull() { regId(CK_ISNN, DUMMY_OBJECT); @@ -261,7 +230,7 @@ abstract protected ConditionValue getCValueId(); /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {NotNull : + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {NotNull : * VARCHAR(100)} * * @param name The value of name as equal. @@ -271,7 +240,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param name The value of name as notEqual. */ @@ -280,7 +249,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param name The value of name as greaterThan. */ @@ -289,7 +258,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param name The value of name as lessThan. */ @@ -298,7 +267,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param name The value of name as greaterEqual. */ @@ -307,7 +276,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param name The value of name as lessEqual. */ @@ -316,7 +285,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param name The value of name as prefixSearch. */ @@ -325,20 +294,6 @@ } /** - * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, - * SeveralRegistered. - * - * @param name The value of name as likeSearch. - * @param likeSearchOption The option of like-search. (NotNull) - */ - public void setName_LikeSearch( - String name, - jp.sf.pal.notepad.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { - registerLikeSearchQuery(CK_LS, fRES(name), getCValueName(), "NAME", - "Name", "name", likeSearchOption); - } - - /** * InScope(in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * @@ -349,27 +304,41 @@ } /** - * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * - * @param name The collection of name as inScope. - * @param inScopeOption The option of in-scope. (NotNull) + * @param nameList The collection of name as notInScope. */ - public void setName_InScope( + public void setName_NotInScope(Collection nameList) { + regName(CK_NINS, cTL(nameList)); + } + + /** + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param name The value of name as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) + */ + public void setName_LikeSearch( String name, - jp.sf.pal.notepad.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(name), getCValueName(), "NAME", - "Name", "name", inScopeOption); + jp.sf.pal.notepad.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(name), getCValueName(), "NAME", "Name", "name", + likeSearchOption); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param nameList The collection of name as notInScope. + * @param name The value of name as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setName_NotInScope(Collection nameList) { - regName(CK_NINS, cTL(nameList)); + public void setName_NotLikeSearch( + String name, + jp.sf.pal.notepad.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(name), getCValueName(), "NAME", "Name", "name", + likeSearchOption); } protected void regName(ConditionKey key, Object value) { @@ -383,8 +352,8 @@ abstract protected ConditionValue getCValueName(); /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {NotNull : VARCHAR(1) : - * Default=[P]} + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {NotNull : + * VARCHAR(1) : Default=[P]} * * @param type The value of type as equal. */ @@ -393,7 +362,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param type The value of type as notEqual. */ @@ -402,7 +371,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param type The value of type as greaterThan. */ @@ -411,7 +380,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param type The value of type as lessThan. */ @@ -420,7 +389,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param type The value of type as greaterEqual. */ @@ -429,7 +398,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param type The value of type as lessEqual. */ @@ -438,7 +407,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param type The value of type as prefixSearch. */ @@ -447,20 +416,6 @@ } /** - * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, - * SeveralRegistered. - * - * @param type The value of type as likeSearch. - * @param likeSearchOption The option of like-search. (NotNull) - */ - public void setType_LikeSearch( - String type, - jp.sf.pal.notepad.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { - registerLikeSearchQuery(CK_LS, fRES(type), getCValueType(), "TYPE", - "Type", "type", likeSearchOption); - } - - /** * InScope(in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * @@ -471,27 +426,41 @@ } /** - * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * - * @param type The collection of type as inScope. - * @param inScopeOption The option of in-scope. (NotNull) + * @param typeList The collection of type as notInScope. */ - public void setType_InScope( + public void setType_NotInScope(Collection typeList) { + regType(CK_NINS, cTL(typeList)); + } + + /** + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param type The value of type as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) + */ + public void setType_LikeSearch( String type, - jp.sf.pal.notepad.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(type), getCValueType(), "TYPE", - "Type", "type", inScopeOption); + jp.sf.pal.notepad.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(type), getCValueType(), "TYPE", "Type", "type", + likeSearchOption); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param typeList The collection of type as notInScope. + * @param type The value of type as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setType_NotInScope(Collection typeList) { - regType(CK_NINS, cTL(typeList)); + public void setType_NotLikeSearch( + String type, + jp.sf.pal.notepad.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(type), getCValueType(), "TYPE", "Type", "type", + likeSearchOption); } protected void regType(ConditionKey key, Object value) { @@ -505,7 +474,7 @@ abstract protected ConditionValue getCValueType(); /** - * Equal(=). And NullIgnored, OnceRegistered. {NotNull : INTEGER : + * Equal(=). And NullIgnored, OnlyOnceRegistered. {NotNull : INTEGER : * Default=[0]} * * @param sortOrder The value of sortOrder as equal. @@ -515,7 +484,7 @@ } /** - * NotEqual(!=). And NullIgnored, OnceRegistered. + * NotEqual(!=). And NullIgnored, OnlyOnceRegistered. * * @param sortOrder The value of sortOrder as notEqual. */ @@ -524,7 +493,7 @@ } /** - * GreaterThan(>). And NullIgnored, OnceRegistered. + * GreaterThan(>). And NullIgnored, OnlyOnceRegistered. * * @param sortOrder The value of sortOrder as greaterThan. */ @@ -533,7 +502,7 @@ } /** - * LessThan(<). And NullIgnored, OnceRegistered. + * LessThan(<). And NullIgnored, OnlyOnceRegistered. * * @param sortOrder The value of sortOrder as lessThan. */ @@ -542,7 +511,7 @@ } /** - * GreaterEqual(>=). And NullIgnored, OnceRegistered. + * GreaterEqual(>=). And NullIgnored, OnlyOnceRegistered. * * @param sortOrder The value of sortOrder as greaterEqual. */ @@ -551,7 +520,7 @@ } /** - * LessEqual(<=). And NullIgnored, OnceRegistered. + * LessEqual(<=). And NullIgnored, OnlyOnceRegistered. * * @param sortOrder The value of sortOrder as lessEqual. */ @@ -592,7 +561,7 @@ abstract protected ConditionValue getCValueSortOrder(); /** - * Equal(=). And NullIgnored, OnceRegistered. {NotNull : TIMESTAMP} + * Equal(=). And NullIgnored, OnlyOnceRegistered. {NotNull : TIMESTAMP} * * @param createdTime The value of createdTime as equal. */ @@ -601,7 +570,7 @@ } /** - * NotEqual(!=). And NullIgnored, OnceRegistered. + * NotEqual(!=). And NullIgnored, OnlyOnceRegistered. * * @param createdTime The value of createdTime as notEqual. */ @@ -610,7 +579,7 @@ } /** - * GreaterThan(>). And NullIgnored, OnceRegistered. + * GreaterThan(>). And NullIgnored, OnlyOnceRegistered. * * @param createdTime The value of createdTime as greaterThan. */ @@ -619,7 +588,7 @@ } /** - * LessThan(>). And NullIgnored, OnceRegistered. + * LessThan(>). And NullIgnored, OnlyOnceRegistered. * * @param createdTime The value of createdTime as lessThan. */ @@ -628,7 +597,7 @@ } /** - * GreaterEqual(>). And NullIgnored, OnceRegistered. + * GreaterEqual(>). And NullIgnored, OnlyOnceRegistered. * * @param createdTime The value of createdTime as greaterEqual. */ @@ -637,7 +606,7 @@ } /** - * LessEqual(>). And NullIgnored, OnceRegistered. + * LessEqual(>). And NullIgnored, OnlyOnceRegistered. * * @param createdTime The value of createdTime as lessEqual. */ @@ -647,7 +616,7 @@ /** * FromTo($fromDate <= COLUMN_NAME <= $toDate). And NullIgnored, - * OnceRegistered. {NotNull : TIMESTAMP} + * OnlyOnceRegistered. {NotNull : TIMESTAMP} * * @param fromDate The from-date of createdTime. (Nullable) * @param toDate The to-date of createdTime. (Nullable) @@ -665,7 +634,7 @@ /** * FromTo($fromDate <= COLUMN_NAME < $toDate + 1). And NullIgnored, - * OnceRegistered. {NotNull : TIMESTAMP} + * OnlyOnceRegistered. {NotNull : TIMESTAMP} * * @param fromDate The from-date of createdTime. (Nullable) * @param toDate The to-date of createdTime. (Nullable) @@ -691,8 +660,8 @@ abstract protected ConditionValue getCValueCreatedTime(); /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {NotNull : VARCHAR(255) - * : FK to USER_INFO} + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {NotNull : + * VARCHAR(255) : FK to USER_INFO} * * @param createdBy The value of createdBy as equal. */ @@ -701,7 +670,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param createdBy The value of createdBy as notEqual. */ @@ -710,7 +679,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param createdBy The value of createdBy as greaterThan. */ @@ -719,7 +688,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param createdBy The value of createdBy as lessThan. */ @@ -728,7 +697,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param createdBy The value of createdBy as greaterEqual. */ @@ -737,7 +706,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param createdBy The value of createdBy as lessEqual. */ @@ -746,7 +715,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param createdBy The value of createdBy as prefixSearch. */ @@ -755,20 +724,6 @@ } /** - * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, - * SeveralRegistered. - * - * @param createdBy The value of createdBy as likeSearch. - * @param likeSearchOption The option of like-search. (NotNull) - */ - public void setCreatedBy_LikeSearch( - String createdBy, - jp.sf.pal.notepad.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { - registerLikeSearchQuery(CK_LS, fRES(createdBy), getCValueCreatedBy(), - "CREATED_BY", "CreatedBy", "createdBy", likeSearchOption); - } - - /** * InScope(in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * @@ -779,43 +734,41 @@ } /** - * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * - * @param createdBy The collection of createdBy as inScope. - * @param inScopeOption The option of in-scope. (NotNull) + * @param createdByList The collection of createdBy as notInScope. */ - public void setCreatedBy_InScope( - String createdBy, - jp.sf.pal.notepad.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(createdBy), getCValueCreatedBy(), - "CREATED_BY", "CreatedBy", "createdBy", inScopeOption); + public void setCreatedBy_NotInScope(Collection createdByList) { + regCreatedBy(CK_NINS, cTL(createdByList)); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param createdByList The collection of createdBy as notInScope. + * @param createdBy The value of createdBy as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) */ - public void setCreatedBy_NotInScope(Collection createdByList) { - regCreatedBy(CK_NINS, cTL(createdByList)); + public void setCreatedBy_LikeSearch( + String createdBy, + jp.sf.pal.notepad.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(createdBy), getCValueCreatedBy(), "CREATED_BY", + "CreatedBy", "createdBy", likeSearchOption); } /** - * @param userInfoCBquery Query. - * @deprecated Please use inScopeUserInfoByCreatedBy(subQuery) method. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param createdBy The value of createdBy as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setCreatedBy_InScopeSubQuery_UserInfoByCreatedBy( - UserInfoCQ userInfoCBquery) { - String subQueryPropertyName = keepCreatedBy_InScopeSubQuery_UserInfoByCreatedBy(userInfoCBquery);// for - // saving - // query - // - - // value - // . - registerInScopeSubQuery(userInfoCBquery, "CREATED_BY", "USER_ID", - subQueryPropertyName); + public void setCreatedBy_NotLikeSearch( + String createdBy, + jp.sf.pal.notepad.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(createdBy), getCValueCreatedBy(), "CREATED_BY", + "CreatedBy", "createdBy", likeSearchOption); } public void inScopeUserInfoByCreatedBy(SubQuery subQuery) { @@ -824,12 +777,12 @@ cb.xsetupForInScopeSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepCreatedBy_InScopeSubQuery_UserInfoByCreatedBy(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerInScopeSubQuery(cb.query(), "CREATED_BY", "USER_ID", subQueryPropertyName); } - abstract public String keepCreatedBy_InScopeSubQuery_UserInfoByCreatedBy( + public abstract String keepCreatedBy_InScopeSubQuery_UserInfoByCreatedBy( jp.sf.pal.notepad.db.cbean.cq.UserInfoCQ subQuery); protected void regCreatedBy(ConditionKey key, Object value) { @@ -845,7 +798,7 @@ abstract protected ConditionValue getCValueCreatedBy(); /** - * Equal(=). And NullIgnored, OnceRegistered. {NotNull : TIMESTAMP} + * Equal(=). And NullIgnored, OnlyOnceRegistered. {NotNull : TIMESTAMP} * * @param updatedTime The value of updatedTime as equal. */ @@ -854,7 +807,7 @@ } /** - * NotEqual(!=). And NullIgnored, OnceRegistered. + * NotEqual(!=). And NullIgnored, OnlyOnceRegistered. * * @param updatedTime The value of updatedTime as notEqual. */ @@ -863,7 +816,7 @@ } /** - * GreaterThan(>). And NullIgnored, OnceRegistered. + * GreaterThan(>). And NullIgnored, OnlyOnceRegistered. * * @param updatedTime The value of updatedTime as greaterThan. */ @@ -872,7 +825,7 @@ } /** - * LessThan(>). And NullIgnored, OnceRegistered. + * LessThan(>). And NullIgnored, OnlyOnceRegistered. * * @param updatedTime The value of updatedTime as lessThan. */ @@ -881,7 +834,7 @@ } /** - * GreaterEqual(>). And NullIgnored, OnceRegistered. + * GreaterEqual(>). And NullIgnored, OnlyOnceRegistered. * * @param updatedTime The value of updatedTime as greaterEqual. */ @@ -890,7 +843,7 @@ } /** - * LessEqual(>). And NullIgnored, OnceRegistered. + * LessEqual(>). And NullIgnored, OnlyOnceRegistered. * * @param updatedTime The value of updatedTime as lessEqual. */ @@ -900,7 +853,7 @@ /** * FromTo($fromDate <= COLUMN_NAME <= $toDate). And NullIgnored, - * OnceRegistered. {NotNull : TIMESTAMP} + * OnlyOnceRegistered. {NotNull : TIMESTAMP} * * @param fromDate The from-date of updatedTime. (Nullable) * @param toDate The to-date of updatedTime. (Nullable) @@ -918,7 +871,7 @@ /** * FromTo($fromDate <= COLUMN_NAME < $toDate + 1). And NullIgnored, - * OnceRegistered. {NotNull : TIMESTAMP} + * OnlyOnceRegistered. {NotNull : TIMESTAMP} * * @param fromDate The from-date of updatedTime. (Nullable) * @param toDate The to-date of updatedTime. (Nullable) @@ -944,8 +897,8 @@ abstract protected ConditionValue getCValueUpdatedTime(); /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {NotNull : VARCHAR(255) - * : FK to USER_INFO} + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {NotNull : + * VARCHAR(255) : FK to USER_INFO} * * @param updatedBy The value of updatedBy as equal. */ @@ -954,7 +907,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param updatedBy The value of updatedBy as notEqual. */ @@ -963,7 +916,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param updatedBy The value of updatedBy as greaterThan. */ @@ -972,7 +925,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param updatedBy The value of updatedBy as lessThan. */ @@ -981,7 +934,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param updatedBy The value of updatedBy as greaterEqual. */ @@ -990,7 +943,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param updatedBy The value of updatedBy as lessEqual. */ @@ -999,7 +952,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param updatedBy The value of updatedBy as prefixSearch. */ @@ -1008,20 +961,6 @@ } /** - * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, - * SeveralRegistered. - * - * @param updatedBy The value of updatedBy as likeSearch. - * @param likeSearchOption The option of like-search. (NotNull) - */ - public void setUpdatedBy_LikeSearch( - String updatedBy, - jp.sf.pal.notepad.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { - registerLikeSearchQuery(CK_LS, fRES(updatedBy), getCValueUpdatedBy(), - "UPDATED_BY", "UpdatedBy", "updatedBy", likeSearchOption); - } - - /** * InScope(in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * @@ -1032,43 +971,41 @@ } /** - * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * - * @param updatedBy The collection of updatedBy as inScope. - * @param inScopeOption The option of in-scope. (NotNull) + * @param updatedByList The collection of updatedBy as notInScope. */ - public void setUpdatedBy_InScope( - String updatedBy, - jp.sf.pal.notepad.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(updatedBy), getCValueUpdatedBy(), - "UPDATED_BY", "UpdatedBy", "updatedBy", inScopeOption); + public void setUpdatedBy_NotInScope(Collection updatedByList) { + regUpdatedBy(CK_NINS, cTL(updatedByList)); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param updatedByList The collection of updatedBy as notInScope. + * @param updatedBy The value of updatedBy as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) */ - public void setUpdatedBy_NotInScope(Collection updatedByList) { - regUpdatedBy(CK_NINS, cTL(updatedByList)); + public void setUpdatedBy_LikeSearch( + String updatedBy, + jp.sf.pal.notepad.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(updatedBy), getCValueUpdatedBy(), "UPDATED_BY", + "UpdatedBy", "updatedBy", likeSearchOption); } /** - * @param userInfoCBquery Query. - * @deprecated Please use inScopeUserInfoByUpdatedBy(subQuery) method. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param updatedBy The value of updatedBy as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setUpdatedBy_InScopeSubQuery_UserInfoByUpdatedBy( - UserInfoCQ userInfoCBquery) { - String subQueryPropertyName = keepUpdatedBy_InScopeSubQuery_UserInfoByUpdatedBy(userInfoCBquery);// for - // saving - // query - // - - // value - // . - registerInScopeSubQuery(userInfoCBquery, "UPDATED_BY", "USER_ID", - subQueryPropertyName); + public void setUpdatedBy_NotLikeSearch( + String updatedBy, + jp.sf.pal.notepad.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(updatedBy), getCValueUpdatedBy(), "UPDATED_BY", + "UpdatedBy", "updatedBy", likeSearchOption); } public void inScopeUserInfoByUpdatedBy(SubQuery subQuery) { @@ -1077,12 +1014,12 @@ cb.xsetupForInScopeSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepUpdatedBy_InScopeSubQuery_UserInfoByUpdatedBy(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerInScopeSubQuery(cb.query(), "UPDATED_BY", "USER_ID", subQueryPropertyName); } - abstract public String keepUpdatedBy_InScopeSubQuery_UserInfoByUpdatedBy( + public abstract String keepUpdatedBy_InScopeSubQuery_UserInfoByUpdatedBy( jp.sf.pal.notepad.db.cbean.cq.UserInfoCQ subQuery); protected void regUpdatedBy(ConditionKey key, Object value) { @@ -1098,7 +1035,7 @@ abstract protected ConditionValue getCValueUpdatedBy(); /** - * Equal(=). And NullIgnored, OnceRegistered. {TIMESTAMP} + * Equal(=). And NullIgnored, OnlyOnceRegistered. {TIMESTAMP} * * @param deletedTime The value of deletedTime as equal. */ @@ -1107,7 +1044,7 @@ } /** - * NotEqual(!=). And NullIgnored, OnceRegistered. + * NotEqual(!=). And NullIgnored, OnlyOnceRegistered. * * @param deletedTime The value of deletedTime as notEqual. */ @@ -1116,7 +1053,7 @@ } /** - * GreaterThan(>). And NullIgnored, OnceRegistered. + * GreaterThan(>). And NullIgnored, OnlyOnceRegistered. * * @param deletedTime The value of deletedTime as greaterThan. */ @@ -1125,7 +1062,7 @@ } /** - * LessThan(>). And NullIgnored, OnceRegistered. + * LessThan(>). And NullIgnored, OnlyOnceRegistered. * * @param deletedTime The value of deletedTime as lessThan. */ @@ -1134,7 +1071,7 @@ } /** - * GreaterEqual(>). And NullIgnored, OnceRegistered. + * GreaterEqual(>). And NullIgnored, OnlyOnceRegistered. * * @param deletedTime The value of deletedTime as greaterEqual. */ @@ -1143,7 +1080,7 @@ } /** - * LessEqual(>). And NullIgnored, OnceRegistered. + * LessEqual(>). And NullIgnored, OnlyOnceRegistered. * * @param deletedTime The value of deletedTime as lessEqual. */ @@ -1153,7 +1090,7 @@ /** * FromTo($fromDate <= COLUMN_NAME <= $toDate). And NullIgnored, - * OnceRegistered. {TIMESTAMP} + * OnlyOnceRegistered. {TIMESTAMP} * * @param fromDate The from-date of deletedTime. (Nullable) * @param toDate The to-date of deletedTime. (Nullable) @@ -1171,7 +1108,7 @@ /** * FromTo($fromDate <= COLUMN_NAME < $toDate + 1). And NullIgnored, - * OnceRegistered. {TIMESTAMP} + * OnlyOnceRegistered. {TIMESTAMP} * * @param fromDate The from-date of deletedTime. (Nullable) * @param toDate The to-date of deletedTime. (Nullable) @@ -1185,14 +1122,14 @@ } /** - * IsNull(is null). And OnceRegistered. + * IsNull(is null). And OnlyOnceRegistered. */ public void setDeletedTime_IsNull() { regDeletedTime(CK_ISN, DUMMY_OBJECT); } /** - * IsNotNull(is not null). And OnceRegistered. + * IsNotNull(is not null). And OnlyOnceRegistered. */ public void setDeletedTime_IsNotNull() { regDeletedTime(CK_ISNN, DUMMY_OBJECT); @@ -1211,7 +1148,7 @@ abstract protected ConditionValue getCValueDeletedTime(); /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {VARCHAR(255)} + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {VARCHAR(255)} * * @param deletedBy The value of deletedBy as equal. */ @@ -1220,7 +1157,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param deletedBy The value of deletedBy as notEqual. */ @@ -1229,7 +1166,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param deletedBy The value of deletedBy as greaterThan. */ @@ -1238,7 +1175,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param deletedBy The value of deletedBy as lessThan. */ @@ -1247,7 +1184,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param deletedBy The value of deletedBy as greaterEqual. */ @@ -1256,7 +1193,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param deletedBy The value of deletedBy as lessEqual. */ @@ -1265,7 +1202,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param deletedBy The value of deletedBy as prefixSearch. */ @@ -1274,20 +1211,6 @@ } /** - * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, - * SeveralRegistered. - * - * @param deletedBy The value of deletedBy as likeSearch. - * @param likeSearchOption The option of like-search. (NotNull) - */ - public void setDeletedBy_LikeSearch( - String deletedBy, - jp.sf.pal.notepad.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { - registerLikeSearchQuery(CK_LS, fRES(deletedBy), getCValueDeletedBy(), - "DELETED_BY", "DeletedBy", "deletedBy", likeSearchOption); - } - - /** * InScope(in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * @@ -1298,38 +1221,52 @@ } /** - * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * - * @param deletedBy The collection of deletedBy as inScope. - * @param inScopeOption The option of in-scope. (NotNull) + * @param deletedByList The collection of deletedBy as notInScope. */ - public void setDeletedBy_InScope( + public void setDeletedBy_NotInScope(Collection deletedByList) { + regDeletedBy(CK_NINS, cTL(deletedByList)); + } + + /** + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param deletedBy The value of deletedBy as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) + */ + public void setDeletedBy_LikeSearch( String deletedBy, - jp.sf.pal.notepad.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(deletedBy), getCValueDeletedBy(), - "DELETED_BY", "DeletedBy", "deletedBy", inScopeOption); + jp.sf.pal.notepad.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(deletedBy), getCValueDeletedBy(), "DELETED_BY", + "DeletedBy", "deletedBy", likeSearchOption); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param deletedByList The collection of deletedBy as notInScope. + * @param deletedBy The value of deletedBy as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setDeletedBy_NotInScope(Collection deletedByList) { - regDeletedBy(CK_NINS, cTL(deletedByList)); + public void setDeletedBy_NotLikeSearch( + String deletedBy, + jp.sf.pal.notepad.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(deletedBy), getCValueDeletedBy(), "DELETED_BY", + "DeletedBy", "deletedBy", likeSearchOption); } /** - * IsNull(is null). And OnceRegistered. + * IsNull(is null). And OnlyOnceRegistered. */ public void setDeletedBy_IsNull() { regDeletedBy(CK_ISN, DUMMY_OBJECT); } /** - * IsNotNull(is not null). And OnceRegistered. + * IsNotNull(is not null). And OnlyOnceRegistered. */ public void setDeletedBy_IsNotNull() { regDeletedBy(CK_ISNN, DUMMY_OBJECT); @@ -1348,7 +1285,7 @@ abstract protected ConditionValue getCValueDeletedBy(); /** - * Equal(=). And NullIgnored, OnceRegistered. {NotNull : INTEGER : + * Equal(=). And NullIgnored, OnlyOnceRegistered. {NotNull : INTEGER : * Default=[0]} * * @param versionno The value of versionno as equal. @@ -1358,7 +1295,7 @@ } /** - * NotEqual(!=). And NullIgnored, OnceRegistered. + * NotEqual(!=). And NullIgnored, OnlyOnceRegistered. * * @param versionno The value of versionno as notEqual. */ @@ -1367,7 +1304,7 @@ } /** - * GreaterThan(>). And NullIgnored, OnceRegistered. + * GreaterThan(>). And NullIgnored, OnlyOnceRegistered. * * @param versionno The value of versionno as greaterThan. */ @@ -1376,7 +1313,7 @@ } /** - * LessThan(<). And NullIgnored, OnceRegistered. + * LessThan(<). And NullIgnored, OnlyOnceRegistered. * * @param versionno The value of versionno as lessThan. */ @@ -1385,7 +1322,7 @@ } /** - * GreaterEqual(>=). And NullIgnored, OnceRegistered. + * GreaterEqual(>=). And NullIgnored, OnlyOnceRegistered. * * @param versionno The value of versionno as greaterEqual. */ @@ -1394,7 +1331,7 @@ } /** - * LessEqual(<=). And NullIgnored, OnceRegistered. + * LessEqual(<=). And NullIgnored, OnlyOnceRegistered. * * @param versionno The value of versionno as lessEqual. */ @@ -1434,6 +1371,53 @@ abstract protected ConditionValue getCValueVersionno(); + public SSQFunction scalar_Equal() { + return xcreateSSQFunction("="); + } + + public SSQFunction scalar_GreaterEqual() { + return xcreateSSQFunction(">="); + } + + public SSQFunction scalar_GreaterThan() { + return xcreateSSQFunction(">"); + } + + public SSQFunction scalar_LessEqual() { + return xcreateSSQFunction("<="); + } + + public SSQFunction scalar_LessThan() { + return xcreateSSQFunction("<"); + } + + protected SSQFunction xcreateSSQFunction( + final String operand) { + return new SSQFunction( + new SSQSetupper() { + public void setup(String function, + SubQuery subQuery) { + xscalarSubQuery(function, subQuery, operand); + } + }); + } + + protected void xscalarSubQuery(String function, + SubQuery subQuery, String operand) { + assertObjectNotNull("subQuery", subQuery); + NotepadCategoryCB cb = new NotepadCategoryCB(); + cb.xsetupForScalarSubQuery(); + subQuery.query(cb); + String subQueryPropertyName = keepScalarSubQuery(cb.query()); // for + // saving + // query + // -value. + registerScalarSubQuery(function, cb.query(), subQueryPropertyName, + operand); + } + + public abstract String keepScalarSubQuery(NotepadCategoryCQ subQuery); + // Very Internal (for Suppressing Warn about 'Not Use Import') protected String getConditionBeanClassNameInternally() { return NotepadCategoryCB.class.getName(); Modified: notepad/trunk/src/main/java/jp/sf/pal/notepad/db/cbean/cq/bs/AbstractBsNotepadContentCQ.java =================================================================== --- notepad/trunk/src/main/java/jp/sf/pal/notepad/db/cbean/cq/bs/AbstractBsNotepadContentCQ.java 2008-12-27 22:11:51 UTC (rev 1627) +++ notepad/trunk/src/main/java/jp/sf/pal/notepad/db/cbean/cq/bs/AbstractBsNotepadContentCQ.java 2008-12-27 22:13:37 UTC (rev 1628) @@ -18,7 +18,6 @@ * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public abstract class AbstractBsNotepadContentCQ extends AbstractConditionQuery { //========================================================================== @@ -48,8 +47,8 @@ // ===== /** - * Equal(=). And NullIgnored, OnceRegistered. {PK : NotNull : BIGINT : FK to - * NOTEPAD} + * Equal(=). And NullIgnored, OnlyOnceRegistered. {PK : NotNull : BIGINT : + * FK to NOTEPAD} * * @param id The value of id as equal. */ @@ -58,7 +57,7 @@ } /** - * NotEqual(!=). And NullIgnored, OnceRegistered. + * NotEqual(!=). And NullIgnored, OnlyOnceRegistered. * * @param id The value of id as notEqual. */ @@ -67,7 +66,7 @@ } /** - * GreaterThan(>). And NullIgnored, OnceRegistered. + * GreaterThan(>). And NullIgnored, OnlyOnceRegistered. * * @param id The value of id as greaterThan. */ @@ -76,7 +75,7 @@ } /** - * LessThan(<). And NullIgnored, OnceRegistered. + * LessThan(<). And NullIgnored, OnlyOnceRegistered. * * @param id The value of id as lessThan. */ @@ -85,7 +84,7 @@ } /** - * GreaterEqual(>=). And NullIgnored, OnceRegistered. + * GreaterEqual(>=). And NullIgnored, OnlyOnceRegistered. * * @param id The value of id as greaterEqual. */ @@ -94,7 +93,7 @@ } /** - * LessEqual(<=). And NullIgnored, OnceRegistered. + * LessEqual(<=). And NullIgnored, OnlyOnceRegistered. * * @param id The value of id as lessEqual. */ @@ -122,27 +121,12 @@ regId(CK_NINS, cTL(idList)); } - /** - * @param notepadCBquery Query. - * @deprecated Please use inScopeNotepad(subQuery) method. - */ - public void setId_InScopeSubQuery_Notepad(NotepadCQ notepadCBquery) { - String subQueryPropertyName = keepId_InScopeSubQuery_Notepad(notepadCBquery);// for - // saving - // query - // - - // value - // . - registerInScopeSubQuery(notepadCBquery, "ID", "ID", - subQueryPropertyName); - } - public void inScopeNotepad(SubQuery subQuery) { assertObjectNotNull("subQuery", subQuery); NotepadCB cb = new NotepadCB(); cb.xsetupForInScopeSubQuery(); subQuery.query(cb); - String subQueryPropertyName = keepId_InScopeSubQuery_Notepad(cb.query());// for + String subQueryPropertyName = keepId_InScopeSubQuery_Notepad(cb.query()); // for // saving // query // - @@ -151,17 +135,17 @@ registerInScopeSubQuery(cb.query(), "ID", "ID", subQueryPropertyName); } - abstract public String keepId_InScopeSubQuery_Notepad(NotepadCQ subQuery); + public abstract String keepId_InScopeSubQuery_Notepad(NotepadCQ subQuery); /** - * IsNull(is null). And OnceRegistered. + * IsNull(is null). And OnlyOnceRegistered. */ public void setId_IsNull() { regId(CK_ISN, DUMMY_OBJECT); } /** - * IsNotNull(is not null). And OnceRegistered. + * IsNotNull(is not null). And OnlyOnceRegistered. */ public void setId_IsNotNull() { regId(CK_ISNN, DUMMY_OBJECT); @@ -178,7 +162,7 @@ abstract protected ConditionValue getCValueId(); /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {VARCHAR(4000)} + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {VARCHAR(4000)} * * @param content The value of content as equal. */ @@ -187,7 +171,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param content The value of content as notEqual. */ @@ -196,7 +180,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param content The value of content as greaterThan. */ @@ -205,7 +189,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param content The value of content as lessThan. */ @@ -214,7 +198,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param content The value of content as greaterEqual. */ @@ -223,7 +207,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param content The value of content as lessEqual. */ @@ -232,7 +216,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param content The value of content as prefixSearch. */ @@ -241,20 +225,6 @@ } /** - * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, - * SeveralRegistered. - * - * @param content The value of content as likeSearch. - * @param likeSearchOption The option of like-search. (NotNull) - */ - public void setContent_LikeSearch( - String content, - jp.sf.pal.notepad.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { - registerLikeSearchQuery(CK_LS, fRES(content), getCValueContent(), - "CONTENT", "Content", "content", likeSearchOption); - } - - /** * InScope(in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * @@ -265,38 +235,52 @@ } /** - * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * - * @param content The collection of content as inScope. - * @param inScopeOption The option of in-scope. (NotNull) + * @param contentList The collection of content as notInScope. */ - public void setContent_InScope( + public void setContent_NotInScope(Collection contentList) { + regContent(CK_NINS, cTL(contentList)); + } + + /** + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param content The value of content as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) + */ + public void setContent_LikeSearch( String content, - jp.sf.pal.notepad.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(content), getCValueContent(), - "CONTENT", "Content", "content", inScopeOption); + jp.sf.pal.notepad.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(content), getCValueContent(), "CONTENT", "Content", + "content", likeSearchOption); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param contentList The collection of content as notInScope. + * @param content The value of content as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setContent_NotInScope(Collection contentList) { - regContent(CK_NINS, cTL(contentList)); + public void setContent_NotLikeSearch( + String content, + jp.sf.pal.notepad.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(content), getCValueContent(), "CONTENT", "Content", + "content", likeSearchOption); } /** - * IsNull(is null). And OnceRegistered. + * IsNull(is null). And OnlyOnceRegistered. */ public void setContent_IsNull() { regContent(CK_ISN, DUMMY_OBJECT); } /** - * IsNotNull(is not null). And OnceRegistered. + * IsNotNull(is not null). And OnlyOnceRegistered. */ public void setContent_IsNotNull() { regContent(CK_ISNN, DUMMY_OBJECT); @@ -314,6 +298,53 @@ abstract protected ConditionValue getCValueContent(); + public SSQFunction scalar_Equal() { + return xcreateSSQFunction("="); + } + + public SSQFunction scalar_GreaterEqual() { + return xcreateSSQFunction(">="); + } + + public SSQFunction scalar_GreaterThan() { + return xcreateSSQFunction(">"); + } + + public SSQFunction scalar_LessEqual() { + return xcreateSSQFunction("<="); + } + + public SSQFunction scalar_LessThan() { + return xcreateSSQFunction("<"); + } + + protected SSQFunction xcreateSSQFunction( + final String operand) { + return new SSQFunction( + new SSQSetupper() { + public void setup(String function, + SubQuery subQuery) { + xscalarSubQuery(function, subQuery, operand); + } + }); + } + + protected void xscalarSubQuery(String function, + SubQuery subQuery, String operand) { + assertObjectNotNull("subQuery", subQuery); + NotepadContentCB cb = new NotepadContentCB(); + cb.xsetupForScalarSubQuery(); + subQuery.query(cb); + String subQueryPropertyName = keepScalarSubQuery(cb.query()); // for + // saving + // query + // -value. + registerScalarSubQuery(function, cb.query(), subQueryPropertyName, + operand); + } + + public abstract String keepScalarSubQuery(NotepadContentCQ subQuery); + // Very Internal (for Suppressing Warn about 'Not Use Import') protected String getConditionBeanClassNameInternally() { return NotepadContentCB.class.getName(); Modified: notepad/trunk/src/main/java/jp/sf/pal/notepad/db/cbean/cq/bs/AbstractBsRoleInfoCQ.java =================================================================== --- notepad/trunk/src/main/java/jp/sf/pal/notepad/db/cbean/cq/bs/AbstractBsRoleInfoCQ.java 2008-12-27 22:11:51 UTC (rev 1627) +++ notepad/trunk/src/main/java/jp/sf/pal/notepad/db/cbean/cq/bs/AbstractBsRoleInfoCQ.java 2008-12-27 22:13:37 UTC (rev 1628) @@ -20,7 +20,6 @@ * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public abstract class AbstractBsRoleInfoCQ extends AbstractConditionQuery { //========================================================================== @@ -50,7 +49,7 @@ // ===== /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {PK : NotNull : + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {PK : NotNull : * VARCHAR(255)} * * @param roleId The value of roleId as equal. @@ -60,7 +59,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param roleId The value of roleId as notEqual. */ @@ -69,7 +68,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param roleId The value of roleId as greaterThan. */ @@ -78,7 +77,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param roleId The value of roleId as lessThan. */ @@ -87,7 +86,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param roleId The value of roleId as greaterEqual. */ @@ -96,7 +95,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param roleId The value of roleId as lessEqual. */ @@ -105,7 +104,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param roleId The value of roleId as prefixSearch. */ @@ -114,20 +113,6 @@ } /** - * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, - * SeveralRegistered. - * - * @param roleId The value of roleId as likeSearch. - * @param likeSearchOption The option of like-search. (NotNull) - */ - public void setRoleId_LikeSearch( - String roleId, - jp.sf.pal.notepad.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { - registerLikeSearchQuery(CK_LS, fRES(roleId), getCValueRoleId(), - "ROLE_ID", "RoleId", "roleId", likeSearchOption); - } - - /** * InScope(in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * @@ -138,43 +123,41 @@ } /** - * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * - * @param roleId The collection of roleId as inScope. - * @param inScopeOption The option of in-scope. (NotNull) + * @param roleIdList The collection of roleId as notInScope. */ - public void setRoleId_InScope( - String roleId, - jp.sf.pal.notepad.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(roleId), getCValueRoleId(), - "ROLE_ID", "RoleId", "roleId", inScopeOption); + public void setRoleId_NotInScope(Collection roleIdList) { + regRoleId(CK_NINS, cTL(roleIdList)); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param roleIdList The collection of roleId as notInScope. + * @param roleId The value of roleId as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) */ - public void setRoleId_NotInScope(Collection roleIdList) { - regRoleId(CK_NINS, cTL(roleIdList)); + public void setRoleId_LikeSearch( + String roleId, + jp.sf.pal.notepad.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(roleId), getCValueRoleId(), "ROLE_ID", "RoleId", + "roleId", likeSearchOption); } /** - * @param roleMappingCBquery Query. - * @deprecated Please use inScopeRoleMappingList(subQuery) method. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param roleId The value of roleId as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setRoleId_InScopeSubQuery_RoleMappingList( - RoleMappingCQ roleMappingCBquery) { - String subQueryPropertyName = keepRoleId_InScopeSubQuery_RoleMappingList(roleMappingCBquery);// for - // saving - // query - // - - // value - // . - registerInScopeSubQuery(roleMappingCBquery, "ROLE_ID", "ROLE_ID", - subQueryPropertyName); + public void setRoleId_NotLikeSearch( + String roleId, + jp.sf.pal.notepad.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(roleId), getCValueRoleId(), "ROLE_ID", "RoleId", + "roleId", likeSearchOption); } public void inScopeRoleMappingList(SubQuery subQuery) { @@ -183,42 +166,26 @@ cb.xsetupForInScopeSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepRoleId_InScopeSubQuery_RoleMappingList(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerInScopeSubQuery(cb.query(), "ROLE_ID", "ROLE_ID", subQueryPropertyName); } - abstract public String keepRoleId_InScopeSubQuery_RoleMappingList( + public abstract String keepRoleId_InScopeSubQuery_RoleMappingList( RoleMappingCQ subQuery); - /** - * @param userInfoCBquery Query. - * @deprecated Please use inScopeUserInfoList(subQuery) method. - */ - public void setRoleId_InScopeSubQuery_UserInfoList( - UserInfoCQ userInfoCBquery) { - String subQueryPropertyName = keepRoleId_InScopeSubQuery_UserInfoList(userInfoCBquery);// for - // saving - // query - // - - // value - // . - registerInScopeSubQuery(userInfoCBquery, "ROLE_ID", "ROLE_ID", - subQueryPropertyName); - } - public void inScopeUserInfoList(SubQuery subQuery) { assertObjectNotNull("subQuery", subQuery); UserInfoCB cb = new UserInfoCB(); cb.xsetupForInScopeSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepRoleId_InScopeSubQuery_UserInfoList(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerInScopeSubQuery(cb.query(), "ROLE_ID", "ROLE_ID", subQueryPropertyName); } - abstract public String keepRoleId_InScopeSubQuery_UserInfoList( + public abstract String keepRoleId_InScopeSubQuery_UserInfoList( UserInfoCQ subQuery); public void notInScopeRoleMappingList(SubQuery subQuery) { @@ -227,12 +194,12 @@ cb.xsetupForInScopeSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepRoleId_NotInScopeSubQuery_RoleMappingList(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerNotInScopeSubQuery(cb.query(), "ROLE_ID", "ROLE_ID", subQueryPropertyName); } - abstract public String keepRoleId_NotInScopeSubQuery_RoleMappingList( + public abstract String keepRoleId_NotInScopeSubQuery_RoleMappingList( RoleMappingCQ subQuery); public void notInScopeUserInfoList(SubQuery subQuery) { @@ -241,31 +208,15 @@ cb.xsetupForInScopeSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepRoleId_NotInScopeSubQuery_UserInfoList(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerNotInScopeSubQuery(cb.query(), "ROLE_ID", "ROLE_ID", subQueryPropertyName); } - abstract public String keepRoleId_NotInScopeSubQuery_UserInfoList( + public abstract String keepRoleId_NotInScopeSubQuery_UserInfoList( UserInfoCQ subQuery); /** - * @param roleMappingCBquery Query. - * @deprecated Please use existsRoleMappingList(subQuery) method. - */ - public void setRoleId_ExistsSubQuery_RoleMappingList( - RoleMappingCQ roleMappingCBquery) { - String subQueryPropertyName = keepRoleId_ExistsSubQuery_RoleMappingList(roleMappingCBquery);// for - // saving - // query - // - - // value - // . - registerExistsSubQuery(roleMappingCBquery, "ROLE_ID", "ROLE_ID", - subQueryPropertyName); - } - - /** * Set up 'exists' sub-query. {exists (select ROLE_ID from ROLE_MAPPING * where ...)} * @@ -278,30 +229,15 @@ cb.xsetupForExistsSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepRoleId_ExistsSubQuery_RoleMappingList(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerExistsSubQuery(cb.query(), "ROLE_ID", "ROLE_ID", subQueryPropertyName); } - abstract public String keepRoleId_ExistsSubQuery_RoleMappingList( + public abstract String keepRoleId_ExistsSubQuery_RoleMappingList( RoleMappingCQ subQuery); /** - * @param userInfoCBquery Query. - * @deprecated Please use existsUserInfoList(subQuery) method. - */ - public void setRoleId_ExistsSubQuery_UserInfoList(UserInfoCQ userInfoCBquery) { - String subQueryPropertyName = keepRoleId_ExistsSubQuery_UserInfoList(userInfoCBquery);// for - // saving - // query - // - - // value - // . - registerExistsSubQuery(userInfoCBquery, "ROLE_ID", "ROLE_ID", - subQueryPropertyName); - } - - /** * Set up 'exists' sub-query. {exists (select ROLE_ID from USER_INFO where * ...)} * @@ -314,12 +250,12 @@ cb.xsetupForExistsSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepRoleId_ExistsSubQuery_UserInfoList(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerExistsSubQuery(cb.query(), "ROLE_ID", "ROLE_ID", subQueryPropertyName); } - abstract public String keepRoleId_ExistsSubQuery_UserInfoList( + public abstract String keepRoleId_ExistsSubQuery_UserInfoList( UserInfoCQ subQuery); /** @@ -335,12 +271,12 @@ cb.xsetupForExistsSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepRoleId_NotExistsSubQuery_RoleMappingList(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerNotExistsSubQuery(cb.query(), "ROLE_ID", "ROLE_ID", subQueryPropertyName); } - abstract public String keepRoleId_NotExistsSubQuery_RoleMappingList( + public abstract String keepRoleId_NotExistsSubQuery_RoleMappingList( RoleMappingCQ subQuery); /** @@ -356,53 +292,53 @@ cb.xsetupForExistsSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepRoleId_NotExistsSubQuery_UserInfoList(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerNotExistsSubQuery(cb.query(), "ROLE_ID", "ROLE_ID", subQueryPropertyName); } - abstract public String keepRoleId_NotExistsSubQuery_UserInfoList( + public abstract String keepRoleId_NotExistsSubQuery_UserInfoList( UserInfoCQ subQuery); public void xderiveRoleMappingList(String function, SubQuery subQuery, String aliasName) { assertObjectNotNull("subQuery", subQuery); RoleMappingCB cb = new RoleMappingCB(); - cb.xsetupForDeriveReferrer(); + cb.xsetupForDerivedReferrer(); subQuery.query(cb); - String subQueryPropertyName = keepRoleId_DeriveSubQuery_RoleMappingList(cb - .query());// for saving query-value. - registerDeriveSubQuery(function, cb.query(), "ROLE_ID", "ROLE_ID", - subQueryPropertyName, aliasName); + String subQueryPropertyName = keepRoleId_DerivedReferrer_RoleMappingList(cb + .query()); // for saving query-value. + registerDerivedReferrerSubQuery(function, cb.query(), "ROLE_ID", + "ROLE_ID", subQueryPropertyName, aliasName); } - abstract public String keepRoleId_DeriveSubQuery_RoleMappingList( + public abstract String keepRoleId_DerivedReferrer_RoleMappingList( RoleMappingCQ subQuery); public void xderiveUserInfoList(String function, SubQuery subQuery, String aliasName) { assertObjectNotNull("subQuery", subQuery); UserInfoCB cb = new UserInfoCB(); - cb.xsetupForDeriveReferrer(); + cb.xsetupForDerivedReferrer(); subQuery.query(cb); - String subQueryPropertyName = keepRoleId_DeriveSubQuery_UserInfoList(cb - .query());// for saving query-value. - registerDeriveSubQuery(function, cb.query(), "ROLE_ID", "ROLE_ID", - subQueryPropertyName, aliasName); + String subQueryPropertyName = keepRoleId_DerivedReferrer_UserInfoList(cb + .query()); // for saving query-value. + registerDerivedReferrerSubQuery(function, cb.query(), "ROLE_ID", + "ROLE_ID", subQueryPropertyName, aliasName); } - abstract public String keepRoleId_DeriveSubQuery_UserInfoList( + public abstract String keepRoleId_DerivedReferrer_UserInfoList( UserInfoCQ subQuery); /** - * IsNull(is null). And OnceRegistered. + * IsNull(is null). And OnlyOnceRegistered. */ public void setRoleId_IsNull() { regRoleId(CK_ISN, DUMMY_OBJECT); } /** - * IsNotNull(is not null). And OnceRegistered. + * IsNotNull(is not null). And OnlyOnceRegistered. */ public void setRoleId_IsNotNull() { regRoleId(CK_ISNN, DUMMY_OBJECT); @@ -421,7 +357,7 @@ abstract protected ConditionValue getCValueRoleId(); /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {VARCHAR(100)} + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {VARCHAR(100)} * * @param name The value of name as equal. */ @@ -430,7 +366,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param name The value of name as notEqual. */ @@ -439,7 +375,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param name The value of name as greaterThan. */ @@ -448,7 +384,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param name The value of name as lessThan. */ @@ -457,7 +393,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param name The value of name as greaterEqual. */ @@ -466,7 +402,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param name The value of name as lessEqual. */ @@ -475,7 +411,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param name The value of name as prefixSearch. */ @@ -484,20 +420,6 @@ } /** - * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, - * SeveralRegistered. - * - * @param name The value of name as likeSearch. - * @param likeSearchOption The option of like-search. (NotNull) - */ - public void setName_LikeSearch( - String name, - jp.sf.pal.notepad.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { - registerLikeSearchQuery(CK_LS, fRES(name), getCValueName(), "NAME", - "Name", "name", likeSearchOption); - } - - /** * InScope(in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * @@ -508,38 +430,52 @@ } /** - * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * - * @param name The collection of name as inScope. - * @param inScopeOption The option of in-scope. (NotNull) + * @param nameList The collection of name as notInScope. */ - public void setName_InScope( + public void setName_NotInScope(Collection nameList) { + regName(CK_NINS, cTL(nameList)); + } + + /** + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param name The value of name as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) + */ + public void setName_LikeSearch( String name, - jp.sf.pal.notepad.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(name), getCValueName(), "NAME", - "Name", "name", inScopeOption); + jp.sf.pal.notepad.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(name), getCValueName(), "NAME", "Name", "name", + likeSearchOption); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param nameList The collection of name as notInScope. + * @param name The value of name as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setName_NotInScope(Collection nameList) { - regName(CK_NINS, cTL(nameList)); + public void setName_NotLikeSearch( + String name, + jp.sf.pal.notepad.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(name), getCValueName(), "NAME", "Name", "name", + likeSearchOption); } /** - * IsNull(is null). And OnceRegistered. + * IsNull(is null). And OnlyOnceRegistered. */ public void setName_IsNull() { regName(CK_ISN, DUMMY_OBJECT); } /** - * IsNotNull(is not null). And OnceRegistered. + * IsNotNull(is not null). And OnlyOnceRegistered. */ public void setName_IsNotNull() { regName(CK_ISNN, DUMMY_OBJECT); @@ -556,7 +492,7 @@ abstract protected ConditionValue getCValueName(); /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {VARCHAR(255)} + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {VARCHAR(255)} * * @param description The value of description as equal. */ @@ -565,7 +501,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param description The value of description as notEqual. */ @@ -574,7 +510,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param description The value of description as greaterThan. */ @@ -583,7 +519,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param description The value of description as lessThan. */ @@ -592,7 +528,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param description The value of description as greaterEqual. */ @@ -601,7 +537,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param description The value of description as lessEqual. */ @@ -610,7 +546,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param description The value of description as prefixSearch. */ @@ -619,21 +555,6 @@ } /** - * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, - * SeveralRegistered. - * - * @param description The value of description as likeSearch. - * @param likeSearchOption The option of like-search. (NotNull) - */ - public void setDescription_LikeSearch( - String description, - jp.sf.pal.notepad.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { - registerLikeSearchQuery(CK_LS, fRES(description), - getCValueDescription(), "DESCRIPTION", "Description", - "description", likeSearchOption); - } - - /** * InScope(in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * @@ -644,38 +565,52 @@ } /** - * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * - * @param description The collection of description as inScope. - * @param inScopeOption The option of in-scope. (NotNull) + * @param descriptionList The collection of description as notInScope. */ - public void setDescription_InScope( + public void setDescription_NotInScope(Collection descriptionList) { + regDescription(CK_NINS, cTL(descriptionList)); + } + + /** + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param description The value of description as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) + */ + public void setDescription_LikeSearch( String description, - jp.sf.pal.notepad.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(description), getCValueDescription(), - "DESCRIPTION", "Description", "description", inScopeOption); + jp.sf.pal.notepad.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(description), getCValueDescription(), "DESCRIPTION", + "Description", "description", likeSearchOption); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param descriptionList The collection of description as notInScope. + * @param description The value of description as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setDescription_NotInScope(Collection descriptionList) { - regDescription(CK_NINS, cTL(descriptionList)); + public void setDescription_NotLikeSearch( + String description, + jp.sf.pal.notepad.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(description), getCValueDescription(), + "DESCRIPTION", "Description", "description", likeSearchOption); } /** - * IsNull(is null). And OnceRegistered. + * IsNull(is null). And OnlyOnceRegistered. */ public void setDescription_IsNull() { regDescription(CK_ISN, DUMMY_OBJECT); } /** - * IsNotNull(is not null). And OnceRegistered. + * IsNotNull(is not null). And OnlyOnceRegistered. */ public void setDescription_IsNotNull() { regDescription(CK_ISNN, DUMMY_OBJECT); @@ -694,7 +629,7 @@ abstract protected ConditionValue getCValueDescription(); /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {VARCHAR(255)} + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {VARCHAR(255)} * * @param email The value of email as equal. */ @@ -703,7 +638,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param email The value of email as notEqual. */ @@ -712,7 +647,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param email The value of email as greaterThan. */ @@ -721,7 +656,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param email The value of email as lessThan. */ @@ -730,7 +665,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param email The value of email as greaterEqual. */ @@ -739,7 +674,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param email The value of email as lessEqual. */ @@ -748,7 +683,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param email The value of email as prefixSearch. */ @@ -757,20 +692,6 @@ } /** - * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, - * SeveralRegistered. - * - * @param email The value of email as likeSearch. - * @param likeSearchOption The option of like-search. (NotNull) - */ - public void setEmail_LikeSearch( - String email, - jp.sf.pal.notepad.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { - registerLikeSearchQuery(CK_LS, fRES(email), getCValueEmail(), "EMAIL", - "Email", "email", likeSearchOption); - } - - /** * InScope(in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * @@ -781,38 +702,52 @@ } /** - * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * - * @param email The collection of email as inScope. - * @param inScopeOption The option of in-scope. (NotNull) + * @param emailList The collection of email as notInScope. */ - public void setEmail_InScope( + public void setEmail_NotInScope(Collection emailList) { + regEmail(CK_NINS, cTL(emailList)); + } + + /** + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param email The value of email as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) + */ + public void setEmail_LikeSearch( String email, - jp.sf.pal.notepad.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(email), getCValueEmail(), "EMAIL", - "Email", "email", inScopeOption); + jp.sf.pal.notepad.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(email), getCValueEmail(), "EMAIL", "Email", "email", + likeSearchOption); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param emailList The collection of email as notInScope. + * @param email The value of email as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setEmail_NotInScope(Collection emailList) { - regEmail(CK_NINS, cTL(emailList)); + public void setEmail_NotLikeSearch( + String email, + jp.sf.pal.notepad.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(email), getCValueEmail(), "EMAIL", "Email", + "email", likeSearchOption); } /** - * IsNull(is null). And OnceRegistered. + * IsNull(is null). And OnlyOnceRegistered. */ public void setEmail_IsNull() { regEmail(CK_ISN, DUMMY_OBJECT); } /** - * IsNotNull(is not null). And OnceRegistered. + * IsNotNull(is not null). And OnlyOnceRegistered. */ public void setEmail_IsNotNull() { regEmail(CK_ISNN, DUMMY_OBJECT); @@ -830,7 +765,7 @@ abstract protected ConditionValue getCValueEmail(); /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {VARCHAR(255)} + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {VARCHAR(255)} * * @param url The value of url as equal. */ @@ -839,7 +774,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param url The value of url as notEqual. */ @@ -848,7 +783,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param url The value of url as greaterThan. */ @@ -857,7 +792,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param url The value of url as lessThan. */ @@ -866,7 +801,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param url The value of url as greaterEqual. */ @@ -875,7 +810,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param url The value of url as lessEqual. */ @@ -884,7 +819,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param url The value of url as prefixSearch. */ @@ -893,20 +828,6 @@ } /** - * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, - * SeveralRegistered. - * - * @param url The value of url as likeSearch. - * @param likeSearchOption The option of like-search. (NotNull) - */ - public void setUrl_LikeSearch( - String url, - jp.sf.pal.notepad.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { - registerLikeSearchQuery(CK_LS, fRES(url), getCValueUrl(), "URL", "Url", - "url", likeSearchOption); - } - - /** * InScope(in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * @@ -917,38 +838,52 @@ } /** - * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * - * @param url The collection of url as inScope. - * @param inScopeOption The option of in-scope. (NotNull) + * @param urlList The collection of url as notInScope. */ - public void setUrl_InScope( + public void setUrl_NotInScope(Collection urlList) { + regUrl(CK_NINS, cTL(urlList)); + } + + /** + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param url The value of url as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) + */ + public void setUrl_LikeSearch( String url, - jp.sf.pal.notepad.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(url), getCValueUrl(), "URL", "Url", - "url", inScopeOption); + jp.sf.pal.notepad.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(url), getCValueUrl(), "URL", "Url", "url", + likeSearchOption); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param urlList The collection of url as notInScope. + * @param url The value of url as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setUrl_NotInScope(Collection urlList) { - regUrl(CK_NINS, cTL(urlList)); + public void setUrl_NotLikeSearch( + String url, + jp.sf.pal.notepad.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(url), getCValueUrl(), "URL", "Url", "url", + likeSearchOption); } /** - * IsNull(is null). And OnceRegistered. + * IsNull(is null). And OnlyOnceRegistered. */ public void setUrl_IsNull() { regUrl(CK_ISN, DUMMY_OBJECT); } /** - * IsNotNull(is not null). And OnceRegistered. + * IsNotNull(is not null). And OnlyOnceRegistered. */ public void setUrl_IsNotNull() { regUrl(CK_ISNN, DUMMY_OBJECT); @@ -965,7 +900,7 @@ abstract protected ConditionValue getCValueUrl(); /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {VARCHAR(40)} + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {VARCHAR(40)} * * @param telephone The value of telephone as equal. */ @@ -974,7 +909,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param telephone The value of telephone as notEqual. */ @@ -983,7 +918,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param telephone The value of telephone as greaterThan. */ @@ -992,7 +927,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param telephone The value of telephone as lessThan. */ @@ -1001,7 +936,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param telephone The value of telephone as greaterEqual. */ @@ -1010,7 +945,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param telephone The value of telephone as lessEqual. */ @@ -1019,7 +954,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param telephone The value of telephone as prefixSearch. */ @@ -1028,20 +963,6 @@ } /** - * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, - * SeveralRegistered. - * - * @param telephone The value of telephone as likeSearch. - * @param likeSearchOption The option of like-search. (NotNull) - */ - public void setTelephone_LikeSearch( - String telephone, - jp.sf.pal.notepad.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { - registerLikeSearchQuery(CK_LS, fRES(telephone), getCValueTelephone(), - "TELEPHONE", "Telephone", "telephone", likeSearchOption); - } - - /** * InScope(in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * @@ -1052,38 +973,52 @@ } /** - * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * - * @param telephone The collection of telephone as inScope. - * @param inScopeOption The option of in-scope. (NotNull) + * @param telephoneList The collection of telephone as notInScope. */ - public void setTelephone_InScope( + public void setTelephone_NotInScope(Collection telephoneList) { + regTelephone(CK_NINS, cTL(telephoneList)); + } + + /** + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param telephone The value of telephone as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) + */ + public void setTelephone_LikeSearch( String telephone, - jp.sf.pal.notepad.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(telephone), getCValueTelephone(), - "TELEPHONE", "Telephone", "telephone", inScopeOption); + jp.sf.pal.notepad.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(telephone), getCValueTelephone(), "TELEPHONE", + "Telephone", "telephone", likeSearchOption); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param telephoneList The collection of telephone as notInScope. + * @param telephone The value of telephone as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setTelephone_NotInScope(Collection telephoneList) { - regTelephone(CK_NINS, cTL(telephoneList)); + public void setTelephone_NotLikeSearch( + String telephone, + jp.sf.pal.notepad.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(telephone), getCValueTelephone(), "TELEPHONE", + "Telephone", "telephone", likeSearchOption); } /** - * IsNull(is null). And OnceRegistered. + * IsNull(is null). And OnlyOnceRegistered. */ public void setTelephone_IsNull() { regTelephone(CK_ISN, DUMMY_OBJECT); } /** - * IsNotNull(is not null). And OnceRegistered. + * IsNotNull(is not null). And OnlyOnceRegistered. */ public void setTelephone_IsNotNull() { regTelephone(CK_ISNN, DUMMY_OBJECT); @@ -1102,7 +1037,7 @@ abstract protected ConditionValue getCValueTelephone(); /** - * Equal(=). And NullIgnored, OnceRegistered. {NotNull : TIMESTAMP} + * Equal(=). And NullIgnored, OnlyOnceRegistered. {NotNull : TIMESTAMP} * * @param createdTime The value of createdTime as equal. */ @@ -1111,7 +1046,7 @@ } /** - * NotEqual(!=). And NullIgnored, OnceRegistered. + * NotEqual(!=). And NullIgnored, OnlyOnceRegistered. * * @param createdTime The value of createdTime as notEqual. */ @@ -1120,7 +1055,7 @@ } /** - * GreaterThan(>). And NullIgnored, OnceRegistered. + * GreaterThan(>). And NullIgnored, OnlyOnceRegistered. * * @param createdTime The value of createdTime as greaterThan. */ @@ -1129,7 +1064,7 @@ } /** - * LessThan(>). And NullIgnored, OnceRegistered. + * LessThan(>). And NullIgnored, OnlyOnceRegistered. * * @param createdTime The value of createdTime as lessThan. */ @@ -1138,7 +1073,7 @@ } /** - * GreaterEqual(>). And NullIgnored, OnceRegistered. + * GreaterEqual(>). And NullIgnored, OnlyOnceRegistered. * * @param createdTime The value of createdTime as greaterEqual. */ @@ -1147,7 +1082,7 @@ } /** - * LessEqual(>). And NullIgnored, OnceRegistered. + * LessEqual(>). And NullIgnored, OnlyOnceRegistered. * * @param createdTime The value of createdTime as lessEqual. */ @@ -1157,7 +1092,7 @@ /** * FromTo($fromDate <= COLUMN_NAME <= $toDate). And NullIgnored, - * OnceRegistered. {NotNull : TIMESTAMP} + * OnlyOnceRegistered. {NotNull : TIMESTAMP} * * @param fromDate The from-date of createdTime. (Nullable) * @param toDate The to-date of createdTime. (Nullable) @@ -1175,7 +1110,7 @@ /** * FromTo($fromDate <= COLUMN_NAME < $toDate + 1). And NullIgnored, - * OnceRegistered. {NotNull : TIMESTAMP} + * OnlyOnceRegistered. {NotNull : TIMESTAMP} * * @param fromDate The from-date of createdTime. (Nullable) * @param toDate The to-date of createdTime. (Nullable) @@ -1201,7 +1136,7 @@ abstract protected ConditionValue getCValueCreatedTime(); /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {NotNull : + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {NotNull : * VARCHAR(255)} * * @param createdBy The value of createdBy as equal. @@ -1211,7 +1146,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param createdBy The value of createdBy as notEqual. */ @@ -1220,7 +1155,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param createdBy The value of createdBy as greaterThan. */ @@ -1229,7 +1164,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param createdBy The value of createdBy as lessThan. */ @@ -1238,7 +1173,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param createdBy The value of createdBy as greaterEqual. */ @@ -1247,7 +1182,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param createdBy The value of createdBy as lessEqual. */ @@ -1256,7 +1191,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param createdBy The value of createdBy as prefixSearch. */ @@ -1265,20 +1200,6 @@ } /** - * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, - * SeveralRegistered. - * - * @param createdBy The value of createdBy as likeSearch. - * @param likeSearchOption The option of like-search. (NotNull) - */ - public void setCreatedBy_LikeSearch( - String createdBy, - jp.sf.pal.notepad.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { - registerLikeSearchQuery(CK_LS, fRES(createdBy), getCValueCreatedBy(), - "CREATED_BY", "CreatedBy", "createdBy", likeSearchOption); - } - - /** * InScope(in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * @@ -1289,27 +1210,41 @@ } /** - * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * - * @param createdBy The collection of createdBy as inScope. - * @param inScopeOption The option of in-scope. (NotNull) + * @param createdByList The collection of createdBy as notInScope. */ - public void setCreatedBy_InScope( + public void setCreatedBy_NotInScope(Collection createdByList) { + regCreatedBy(CK_NINS, cTL(createdByList)); + } + + /** + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param createdBy The value of createdBy as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) + */ + public void setCreatedBy_LikeSearch( String createdBy, - jp.sf.pal.notepad.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(createdBy), getCValueCreatedBy(), - "CREATED_BY", "CreatedBy", "createdBy", inScopeOption); + jp.sf.pal.notepad.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(createdBy), getCValueCreatedBy(), "CREATED_BY", + "CreatedBy", "createdBy", likeSearchOption); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param createdByList The collection of createdBy as notInScope. + * @param createdBy The value of createdBy as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setCreatedBy_NotInScope(Collection createdByList) { - regCreatedBy(CK_NINS, cTL(createdByList)); + public void setCreatedBy_NotLikeSearch( + String createdBy, + jp.sf.pal.notepad.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(createdBy), getCValueCreatedBy(), "CREATED_BY", + "CreatedBy", "createdBy", likeSearchOption); } protected void regCreatedBy(ConditionKey key, Object value) { @@ -1325,7 +1260,7 @@ abstract protected ConditionValue getCValueCreatedBy(); /** - * Equal(=). And NullIgnored, OnceRegistered. {NotNull : TIMESTAMP} + * Equal(=). And NullIgnored, OnlyOnceRegistered. {NotNull : TIMESTAMP} * * @param updatedTime The value of updatedTime as equal. */ @@ -1334,7 +1269,7 @@ } /** - * NotEqual(!=). And NullIgnored, OnceRegistered. + * NotEqual(!=). And NullIgnored, OnlyOnceRegistered. * * @param updatedTime The value of updatedTime as notEqual. */ @@ -1343,7 +1278,7 @@ } /** - * GreaterThan(>). And NullIgnored, OnceRegistered. + * GreaterThan(>). And NullIgnored, OnlyOnceRegistered. * * @param updatedTime The value of updatedTime as greaterThan. */ @@ -1352,7 +1287,7 @@ } /** - * LessThan(>). And NullIgnored, OnceRegistered. + * LessThan(>). And NullIgnored, OnlyOnceRegistered. * * @param updatedTime The value of updatedTime as lessThan. */ @@ -1361,7 +1296,7 @@ } /** - * GreaterEqual(>). And NullIgnored, OnceRegistered. + * GreaterEqual(>). And NullIgnored, OnlyOnceRegistered. * * @param updatedTime The value of updatedTime as greaterEqual. */ @@ -1370,7 +1305,7 @@ } /** - * LessEqual(>). And NullIgnored, OnceRegistered. + * LessEqual(>). And NullIgnored, OnlyOnceRegistered. * * @param updatedTime The value of updatedTime as lessEqual. */ @@ -1380,7 +1315,7 @@ /** * FromTo($fromDate <= COLUMN_NAME <= $toDate). And NullIgnored, - * OnceRegistered. {NotNull : TIMESTAMP} + * OnlyOnceRegistered. {NotNull : TIMESTAMP} * * @param fromDate The from-date of updatedTime. (Nullable) * @param toDate The to-date of updatedTime. (Nullable) @@ -1398,7 +1333,7 @@ /** * FromTo($fromDate <= COLUMN_NAME < $toDate + 1). And NullIgnored, - * OnceRegistered. {NotNull : TIMESTAMP} + * OnlyOnceRegistered. {NotNull : TIMESTAMP} * * @param fromDate The from-date of updatedTime. (Nullable) * @param toDate The to-date of updatedTime. (Nullable) @@ -1424,7 +1359,7 @@ abstract protected ConditionValue getCValueUpdatedTime(); /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {NotNull : + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {NotNull : * VARCHAR(255)} * * @param updatedBy The value of updatedBy as equal. @@ -1434,7 +1369,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param updatedBy The value of updatedBy as notEqual. */ @@ -1443,7 +1378,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param updatedBy The value of updatedBy as greaterThan. */ @@ -1452,7 +1387,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param updatedBy The value of updatedBy as lessThan. */ @@ -1461,7 +1396,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param updatedBy The value of updatedBy as greaterEqual. */ @@ -1470,7 +1405,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param updatedBy The value of updatedBy as lessEqual. */ @@ -1479,7 +1414,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param updatedBy The value of updatedBy as prefixSearch. */ @@ -1488,20 +1423,6 @@ } /** - * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, - * SeveralRegistered. - * - * @param updatedBy The value of updatedBy as likeSearch. - * @param likeSearchOption The option of like-search. (NotNull) - */ - public void setUpdatedBy_LikeSearch( - String updatedBy, - jp.sf.pal.notepad.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { - registerLikeSearchQuery(CK_LS, fRES(updatedBy), getCValueUpdatedBy(), - "UPDATED_BY", "UpdatedBy", "updatedBy", likeSearchOption); - } - - /** * InScope(in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * @@ -1512,27 +1433,41 @@ } /** - * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * - * @param updatedBy The collection of updatedBy as inScope. - * @param inScopeOption The option of in-scope. (NotNull) + * @param updatedByList The collection of updatedBy as notInScope. */ - public void setUpdatedBy_InScope( + public void setUpdatedBy_NotInScope(Collection updatedByList) { + regUpdatedBy(CK_NINS, cTL(updatedByList)); + } + + /** + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param updatedBy The value of updatedBy as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) + */ + public void setUpdatedBy_LikeSearch( String updatedBy, - jp.sf.pal.notepad.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(updatedBy), getCValueUpdatedBy(), - "UPDATED_BY", "UpdatedBy", "updatedBy", inScopeOption); + jp.sf.pal.notepad.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(updatedBy), getCValueUpdatedBy(), "UPDATED_BY", + "UpdatedBy", "updatedBy", likeSearchOption); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param updatedByList The collection of updatedBy as notInScope. + * @param updatedBy The value of updatedBy as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setUpdatedBy_NotInScope(Collection updatedByList) { - regUpdatedBy(CK_NINS, cTL(updatedByList)); + public void setUpdatedBy_NotLikeSearch( + String updatedBy, + jp.sf.pal.notepad.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(updatedBy), getCValueUpdatedBy(), "UPDATED_BY", + "UpdatedBy", "updatedBy", likeSearchOption); } protected void regUpdatedBy(ConditionKey key, Object value) { @@ -1548,7 +1483,7 @@ abstract protected ConditionValue getCValueUpdatedBy(); /** - * Equal(=). And NullIgnored, OnceRegistered. {TIMESTAMP} + * Equal(=). And NullIgnored, OnlyOnceRegistered. {TIMESTAMP} * * @param deletedTime The value of deletedTime as equal. */ @@ -1557,7 +1492,7 @@ } /** - * NotEqual(!=). And NullIgnored, OnceRegistered. + * NotEqual(!=). And NullIgnored, OnlyOnceRegistered. * * @param deletedTime The value of deletedTime as notEqual. */ @@ -1566,7 +1501,7 @@ } /** - * GreaterThan(>). And NullIgnored, OnceRegistered. + * GreaterThan(>). And NullIgnored, OnlyOnceRegistered. * * @param deletedTime The value of deletedTime as greaterThan. */ @@ -1575,7 +1510,7 @@ } /** - * LessThan(>). And NullIgnored, OnceRegistered. + * LessThan(>). And NullIgnored, OnlyOnceRegistered. * * @param deletedTime The value of deletedTime as lessThan. */ @@ -1584,7 +1519,7 @@ } /** - * GreaterEqual(>). And NullIgnored, OnceRegistered. + * GreaterEqual(>). And NullIgnored, OnlyOnceRegistered. * * @param deletedTime The value of deletedTime as greaterEqual. */ @@ -1593,7 +1528,7 @@ } /** - * LessEqual(>). And NullIgnored, OnceRegistered. + * LessEqual(>). And NullIgnored, OnlyOnceRegistered. * * @param deletedTime The value of deletedTime as lessEqual. */ @@ -1603,7 +1538,7 @@ /** * FromTo($fromDate <= COLUMN_NAME <= $toDate). And NullIgnored, - * OnceRegistered. {TIMESTAMP} + * OnlyOnceRegistered. {TIMESTAMP} * * @param fromDate The from-date of deletedTime. (Nullable) * @param toDate The to-date of deletedTime. (Nullable) @@ -1621,7 +1556,7 @@ /** * FromTo($fromDate <= COLUMN_NAME < $toDate + 1). And NullIgnored, - * OnceRegistered. {TIMESTAMP} + * OnlyOnceRegistered. {TIMESTAMP} * * @param fromDate The from-date of deletedTime. (Nullable) * @param toDate The to-date of deletedTime. (Nullable) @@ -1635,14 +1570,14 @@ } /** - * IsNull(is null). And OnceRegistered. + * IsNull(is null). And OnlyOnceRegistered. */ public void setDeletedTime_IsNull() { regDeletedTime(CK_ISN, DUMMY_OBJECT); } /** - * IsNotNull(is not null). And OnceRegistered. + * IsNotNull(is not null). And OnlyOnceRegistered. */ public void setDeletedTime_IsNotNull() { regDeletedTime(CK_ISNN, DUMMY_OBJECT); @@ -1661,7 +1596,7 @@ abstract protected ConditionValue getCValueDeletedTime(); /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {VARCHAR(255)} + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {VARCHAR(255)} * * @param deletedBy The value of deletedBy as equal. */ @@ -1670,7 +1605,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param deletedBy The value of deletedBy as notEqual. */ @@ -1679,7 +1614,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param deletedBy The value of deletedBy as greaterThan. */ @@ -1688,7 +1623,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param deletedBy The value of deletedBy as lessThan. */ @@ -1697,7 +1632,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param deletedBy The value of deletedBy as greaterEqual. */ @@ -1706,7 +1641,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param deletedBy The value of deletedBy as lessEqual. */ @@ -1715,7 +1650,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param deletedBy The value of deletedBy as prefixSearch. */ @@ -1724,20 +1659,6 @@ } /** - * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, - * SeveralRegistered. - * - * @param deletedBy The value of deletedBy as likeSearch. - * @param likeSearchOption The option of like-search. (NotNull) - */ - public void setDeletedBy_LikeSearch( - String deletedBy, - jp.sf.pal.notepad.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { - registerLikeSearchQuery(CK_LS, fRES(deletedBy), getCValueDeletedBy(), - "DELETED_BY", "DeletedBy", "deletedBy", likeSearchOption); - } - - /** * InScope(in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * @@ -1748,38 +1669,52 @@ } /** - * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * - * @param deletedBy The collection of deletedBy as inScope. - * @param inScopeOption The option of in-scope. (NotNull) + * @param deletedByList The collection of deletedBy as notInScope. */ - public void setDeletedBy_InScope( + public void setDeletedBy_NotInScope(Collection deletedByList) { + regDeletedBy(CK_NINS, cTL(deletedByList)); + } + + /** + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param deletedBy The value of deletedBy as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) + */ + public void setDeletedBy_LikeSearch( String deletedBy, - jp.sf.pal.notepad.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(deletedBy), getCValueDeletedBy(), - "DELETED_BY", "DeletedBy", "deletedBy", inScopeOption); + jp.sf.pal.notepad.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(deletedBy), getCValueDeletedBy(), "DELETED_BY", + "DeletedBy", "deletedBy", likeSearchOption); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param deletedByList The collection of deletedBy as notInScope. + * @param deletedBy The value of deletedBy as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setDeletedBy_NotInScope(Collection deletedByList) { - regDeletedBy(CK_NINS, cTL(deletedByList)); + public void setDeletedBy_NotLikeSearch( + String deletedBy, + jp.sf.pal.notepad.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(deletedBy), getCValueDeletedBy(), "DELETED_BY", + "DeletedBy", "deletedBy", likeSearchOption); } /** - * IsNull(is null). And OnceRegistered. + * IsNull(is null). And OnlyOnceRegistered. */ public void setDeletedBy_IsNull() { regDeletedBy(CK_ISN, DUMMY_OBJECT); } /** - * IsNotNull(is not null). And OnceRegistered. + * IsNotNull(is not null). And OnlyOnceRegistered. */ public void setDeletedBy_IsNotNull() { regDeletedBy(CK_ISNN, DUMMY_OBJECT); @@ -1798,7 +1733,7 @@ abstract protected ConditionValue getCValueDeletedBy(); /** - * Equal(=). And NullIgnored, OnceRegistered. {NotNull : INTEGER} + * Equal(=). And NullIgnored, OnlyOnceRegistered. {NotNull : INTEGER} * * @param versionno The value of versionno as equal. */ @@ -1807,7 +1742,7 @@ } /** - * NotEqual(!=). And NullIgnored, OnceRegistered. + * NotEqual(!=). And NullIgnored, OnlyOnceRegistered. * * @param versionno The value of versionno as notEqual. */ @@ -1816,7 +1751,7 @@ } /** - * GreaterThan(>). And NullIgnored, OnceRegistered. + * GreaterThan(>). And NullIgnored, OnlyOnceRegistered. * * @param versionno The value of versionno as greaterThan. */ @@ -1825,7 +1760,7 @@ } /** - * LessThan(<). And NullIgnored, OnceRegistered. + * LessThan(<). And NullIgnored, OnlyOnceRegistered. * * @param versionno The value of versionno as lessThan. */ @@ -1834,7 +1769,7 @@ } /** - * GreaterEqual(>=). And NullIgnored, OnceRegistered. + * GreaterEqual(>=). And NullIgnored, OnlyOnceRegistered. * * @param versionno The value of versionno as greaterEqual. */ @@ -1843,7 +1778,7 @@ } /** - * LessEqual(<=). And NullIgnored, OnceRegistered. + * LessEqual(<=). And NullIgnored, OnlyOnceRegistered. * * @param versionno The value of versionno as lessEqual. */ @@ -1883,6 +1818,50 @@ abstract protected ConditionValue getCValueVersionno(); + public SSQFunction scalar_Equal() { + return xcreateSSQFunction("="); + } + + public SSQFunction scalar_GreaterEqual() { + return xcreateSSQFunction(">="); + } + + public SSQFunction scalar_GreaterThan() { + return xcreateSSQFunction(">"); + } + + public SSQFunction scalar_LessEqual() { + return xcreateSSQFunction("<="); + } + + public SSQFunction scalar_LessThan() { + return xcreateSSQFunction("<"); + } + + protected SSQFunction xcreateSSQFunction(final String operand) { + return new SSQFunction(new SSQSetupper() { + public void setup(String function, SubQuery subQuery) { + xscalarSubQuery(function, subQuery, operand); + } + }); + } + + protected void xscalarSubQuery(String function, + SubQuery subQuery, String operand) { + assertObjectNotNull("subQuery", subQuery); + RoleInfoCB cb = new RoleInfoCB(); + cb.xsetupForScalarSubQuery(); + subQuery.query(cb); + String subQueryPropertyName = keepScalarSubQuery(cb.query()); // for + // saving + // query + // -value. + registerScalarSubQuery(function, cb.query(), subQueryPropertyName, + operand); + } + + public abstract String keepScalarSubQuery(RoleInfoCQ subQuery); + // Very Internal (for Suppressing Warn about 'Not Use Import') protected String getConditionBeanClassNameInternally() { return RoleInfoCB.class.getName(); Modified: notepad/trunk/src/main/java/jp/sf/pal/notepad/db/cbean/cq/bs/AbstractBsRoleMappingCQ.java =================================================================== --- notepad/trunk/src/main/java/jp/sf/pal/notepad/db/cbean/cq/bs/AbstractBsRoleMappingCQ.java 2008-12-27 22:11:51 UTC (rev 1627) +++ notepad/trunk/src/main/java/jp/sf/pal/notepad/db/cbean/cq/bs/AbstractBsRoleMappingCQ.java 2008-12-27 22:13:37 UTC (rev 1628) @@ -11,16 +11,13 @@ import jp.sf.pal.notepad.db.cbean.RoleInfoCB; import jp.sf.pal.notepad.db.cbean.RoleMappingCB; import jp.sf.pal.notepad.db.cbean.UserInfoCB; -import jp.sf.pal.notepad.db.cbean.cq.RoleInfoCQ; import jp.sf.pal.notepad.db.cbean.cq.RoleMappingCQ; -import jp.sf.pal.notepad.db.cbean.cq.UserInfoCQ; /** * The abstract condition-query of ROLE_MAPPING. * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public abstract class AbstractBsRoleMappingCQ extends AbstractConditionQuery { //========================================================================== @@ -50,7 +47,8 @@ // ===== /** - * Equal(=). And NullIgnored, OnceRegistered. {PK : ID : NotNull : INTEGER} + * Equal(=). And NullIgnored, OnlyOnceRegistered. {PK : ID : NotNull : + * INTEGER} * * @param id The value of id as equal. */ @@ -59,7 +57,7 @@ } /** - * NotEqual(!=). And NullIgnored, OnceRegistered. + * NotEqual(!=). And NullIgnored, OnlyOnceRegistered. * * @param id The value of id as notEqual. */ @@ -68,7 +66,7 @@ } /** - * GreaterThan(>). And NullIgnored, OnceRegistered. + * GreaterThan(>). And NullIgnored, OnlyOnceRegistered. * * @param id The value of id as greaterThan. */ @@ -77,7 +75,7 @@ } /** - * LessThan(<). And NullIgnored, OnceRegistered. + * LessThan(<). And NullIgnored, OnlyOnceRegistered. * * @param id The value of id as lessThan. */ @@ -86,7 +84,7 @@ } /** - * GreaterEqual(>=). And NullIgnored, OnceRegistered. + * GreaterEqual(>=). And NullIgnored, OnlyOnceRegistered. * * @param id The value of id as greaterEqual. */ @@ -95,7 +93,7 @@ } /** - * LessEqual(<=). And NullIgnored, OnceRegistered. + * LessEqual(<=). And NullIgnored, OnlyOnceRegistered. * * @param id The value of id as lessEqual. */ @@ -124,14 +122,14 @@ } /** - * IsNull(is null). And OnceRegistered. + * IsNull(is null). And OnlyOnceRegistered. */ public void setId_IsNull() { regId(CK_ISN, DUMMY_OBJECT); } /** - * IsNotNull(is not null). And OnceRegistered. + * IsNotNull(is not null). And OnlyOnceRegistered. */ public void setId_IsNotNull() { regId(CK_ISNN, DUMMY_OBJECT); @@ -148,8 +146,8 @@ abstract protected ConditionValue getCValueId(); /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {NotNull : VARCHAR(255) - * : FK to USER_INFO} + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {NotNull : + * VARCHAR(255) : FK to USER_INFO} * * @param userId The value of userId as equal. */ @@ -158,7 +156,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param userId The value of userId as notEqual. */ @@ -167,7 +165,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param userId The value of userId as greaterThan. */ @@ -176,7 +174,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param userId The value of userId as lessThan. */ @@ -185,7 +183,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param userId The value of userId as greaterEqual. */ @@ -194,7 +192,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param userId The value of userId as lessEqual. */ @@ -203,7 +201,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param userId The value of userId as prefixSearch. */ @@ -212,20 +210,6 @@ } /** - * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, - * SeveralRegistered. - * - * @param userId The value of userId as likeSearch. - * @param likeSearchOption The option of like-search. (NotNull) - */ - public void setUserId_LikeSearch( - String userId, - jp.sf.pal.notepad.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { - registerLikeSearchQuery(CK_LS, fRES(userId), getCValueUserId(), - "USER_ID", "UserId", "userId", likeSearchOption); - } - - /** * InScope(in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * @@ -236,42 +220,41 @@ } /** - * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * - * @param userId The collection of userId as inScope. - * @param inScopeOption The option of in-scope. (NotNull) + * @param userIdList The collection of userId as notInScope. */ - public void setUserId_InScope( - String userId, - jp.sf.pal.notepad.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(userId), getCValueUserId(), - "USER_ID", "UserId", "userId", inScopeOption); + public void setUserId_NotInScope(Collection userIdList) { + regUserId(CK_NINS, cTL(userIdList)); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param userIdList The collection of userId as notInScope. + * @param userId The value of userId as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) */ - public void setUserId_NotInScope(Collection userIdList) { - regUserId(CK_NINS, cTL(userIdList)); + public void setUserId_LikeSearch( + String userId, + jp.sf.pal.notepad.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(userId), getCValueUserId(), "USER_ID", "UserId", + "userId", likeSearchOption); } /** - * @param userInfoCBquery Query. - * @deprecated Please use inScopeUserInfo(subQuery) method. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param userId The value of userId as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setUserId_InScopeSubQuery_UserInfo(UserInfoCQ userInfoCBquery) { - String subQueryPropertyName = keepUserId_InScopeSubQuery_UserInfo(userInfoCBquery);// for - // saving - // query - // - - // value - // . - registerInScopeSubQuery(userInfoCBquery, "USER_ID", "USER_ID", - subQueryPropertyName); + public void setUserId_NotLikeSearch( + String userId, + jp.sf.pal.notepad.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(userId), getCValueUserId(), "USER_ID", "UserId", + "userId", likeSearchOption); } public void inScopeUserInfo(SubQuery subQuery) { @@ -280,12 +263,12 @@ cb.xsetupForInScopeSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepUserId_InScopeSubQuery_UserInfo(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerInScopeSubQuery(cb.query(), "USER_ID", "USER_ID", subQueryPropertyName); } - abstract public String keepUserId_InScopeSubQuery_UserInfo( + public abstract String keepUserId_InScopeSubQuery_UserInfo( jp.sf.pal.notepad.db.cbean.cq.UserInfoCQ subQuery); protected void regUserId(ConditionKey key, Object value) { @@ -301,8 +284,8 @@ abstract protected ConditionValue getCValueUserId(); /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {NotNull : VARCHAR(255) - * : FK to ROLE_INFO} + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {NotNull : + * VARCHAR(255) : FK to ROLE_INFO} * * @param roleId The value of roleId as equal. */ @@ -311,7 +294,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param roleId The value of roleId as notEqual. */ @@ -320,7 +303,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param roleId The value of roleId as greaterThan. */ @@ -329,7 +312,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param roleId The value of roleId as lessThan. */ @@ -338,7 +321,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param roleId The value of roleId as greaterEqual. */ @@ -347,7 +330,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param roleId The value of roleId as lessEqual. */ @@ -356,7 +339,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param roleId The value of roleId as prefixSearch. */ @@ -365,20 +348,6 @@ } /** - * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, - * SeveralRegistered. - * - * @param roleId The value of roleId as likeSearch. - * @param likeSearchOption The option of like-search. (NotNull) - */ - public void setRoleId_LikeSearch( - String roleId, - jp.sf.pal.notepad.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { - registerLikeSearchQuery(CK_LS, fRES(roleId), getCValueRoleId(), - "ROLE_ID", "RoleId", "roleId", likeSearchOption); - } - - /** * InScope(in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * @@ -389,42 +358,41 @@ } /** - * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * - * @param roleId The collection of roleId as inScope. - * @param inScopeOption The option of in-scope. (NotNull) + * @param roleIdList The collection of roleId as notInScope. */ - public void setRoleId_InScope( - String roleId, - jp.sf.pal.notepad.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(roleId), getCValueRoleId(), - "ROLE_ID", "RoleId", "roleId", inScopeOption); + public void setRoleId_NotInScope(Collection roleIdList) { + regRoleId(CK_NINS, cTL(roleIdList)); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param roleIdList The collection of roleId as notInScope. + * @param roleId The value of roleId as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) */ - public void setRoleId_NotInScope(Collection roleIdList) { - regRoleId(CK_NINS, cTL(roleIdList)); + public void setRoleId_LikeSearch( + String roleId, + jp.sf.pal.notepad.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(roleId), getCValueRoleId(), "ROLE_ID", "RoleId", + "roleId", likeSearchOption); } /** - * @param roleInfoCBquery Query. - * @deprecated Please use inScopeRoleInfo(subQuery) method. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param roleId The value of roleId as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setRoleId_InScopeSubQuery_RoleInfo(RoleInfoCQ roleInfoCBquery) { - String subQueryPropertyName = keepRoleId_InScopeSubQuery_RoleInfo(roleInfoCBquery);// for - // saving - // query - // - - // value - // . - registerInScopeSubQuery(roleInfoCBquery, "ROLE_ID", "ROLE_ID", - subQueryPropertyName); + public void setRoleId_NotLikeSearch( + String roleId, + jp.sf.pal.notepad.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(roleId), getCValueRoleId(), "ROLE_ID", "RoleId", + "roleId", likeSearchOption); } public void inScopeRoleInfo(SubQuery subQuery) { @@ -433,12 +401,12 @@ cb.xsetupForInScopeSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepRoleId_InScopeSubQuery_RoleInfo(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerInScopeSubQuery(cb.query(), "ROLE_ID", "ROLE_ID", subQueryPropertyName); } - abstract public String keepRoleId_InScopeSubQuery_RoleInfo( + public abstract String keepRoleId_InScopeSubQuery_RoleInfo( jp.sf.pal.notepad.db.cbean.cq.RoleInfoCQ subQuery); protected void regRoleId(ConditionKey key, Object value) { @@ -453,6 +421,50 @@ abstract protected ConditionValue getCValueRoleId(); + public SSQFunction scalar_Equal() { + return xcreateSSQFunction("="); + } + + public SSQFunction scalar_GreaterEqual() { + return xcreateSSQFunction(">="); + } + + public SSQFunction scalar_GreaterThan() { + return xcreateSSQFunction(">"); + } + + public SSQFunction scalar_LessEqual() { + return xcreateSSQFunction("<="); + } + + public SSQFunction scalar_LessThan() { + return xcreateSSQFunction("<"); + } + + protected SSQFunction xcreateSSQFunction(final String operand) { + return new SSQFunction(new SSQSetupper() { + public void setup(String function, SubQuery subQuery) { + xscalarSubQuery(function, subQuery, operand); + } + }); + } + + protected void xscalarSubQuery(String function, + SubQuery subQuery, String operand) { + assertObjectNotNull("subQuery", subQuery); + RoleMappingCB cb = new RoleMappingCB(); + cb.xsetupForScalarSubQuery(); + subQuery.query(cb); + String subQueryPropertyName = keepScalarSubQuery(cb.query()); // for + // saving + // query + // -value. + registerScalarSubQuery(function, cb.query(), subQueryPropertyName, + operand); + } + + public abstract String keepScalarSubQuery(RoleMappingCQ subQuery); + // Very Internal (for Suppressing Warn about 'Not Use Import') protected String getConditionBeanClassNameInternally() { return RoleMappingCB.class.getName(); Modified: notepad/trunk/src/main/java/jp/sf/pal/notepad/db/cbean/cq/bs/AbstractBsUserInfoCQ.java =================================================================== --- notepad/trunk/src/main/java/jp/sf/pal/notepad/db/cbean/cq/bs/AbstractBsUserInfoCQ.java 2008-12-27 22:11:51 UTC (rev 1627) +++ notepad/trunk/src/main/java/jp/sf/pal/notepad/db/cbean/cq/bs/AbstractBsUserInfoCQ.java 2008-12-27 22:13:37 UTC (rev 1628) @@ -15,11 +15,9 @@ import jp.sf.pal.notepad.db.cbean.RoleInfoCB; import jp.sf.pal.notepad.db.cbean.RoleMappingCB; import jp.sf.pal.notepad.db.cbean.UserInfoCB; -import jp.sf.pal.notepad.db.cbean.cq.GroupInfoCQ; import jp.sf.pal.notepad.db.cbean.cq.GroupMappingCQ; import jp.sf.pal.notepad.db.cbean.cq.NotepadCQ; import jp.sf.pal.notepad.db.cbean.cq.NotepadCategoryCQ; -import jp.sf.pal.notepad.db.cbean.cq.RoleInfoCQ; import jp.sf.pal.notepad.db.cbean.cq.RoleMappingCQ; import jp.sf.pal.notepad.db.cbean.cq.UserInfoCQ; @@ -28,7 +26,6 @@ * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public abstract class AbstractBsUserInfoCQ extends AbstractConditionQuery { //========================================================================== @@ -58,7 +55,7 @@ // ===== /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {PK : NotNull : + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {PK : NotNull : * VARCHAR(255)} * * @param userId The value of userId as equal. @@ -68,7 +65,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param userId The value of userId as notEqual. */ @@ -77,7 +74,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param userId The value of userId as greaterThan. */ @@ -86,7 +83,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param userId The value of userId as lessThan. */ @@ -95,7 +92,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param userId The value of userId as greaterEqual. */ @@ -104,7 +101,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param userId The value of userId as lessEqual. */ @@ -113,7 +110,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param userId The value of userId as prefixSearch. */ @@ -122,20 +119,6 @@ } /** - * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, - * SeveralRegistered. - * - * @param userId The value of userId as likeSearch. - * @param likeSearchOption The option of like-search. (NotNull) - */ - public void setUserId_LikeSearch( - String userId, - jp.sf.pal.notepad.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { - registerLikeSearchQuery(CK_LS, fRES(userId), getCValueUserId(), - "USER_ID", "UserId", "userId", likeSearchOption); - } - - /** * InScope(in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * @@ -146,43 +129,41 @@ } /** - * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * - * @param userId The collection of userId as inScope. - * @param inScopeOption The option of in-scope. (NotNull) + * @param userIdList The collection of userId as notInScope. */ - public void setUserId_InScope( - String userId, - jp.sf.pal.notepad.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(userId), getCValueUserId(), - "USER_ID", "UserId", "userId", inScopeOption); + public void setUserId_NotInScope(Collection userIdList) { + regUserId(CK_NINS, cTL(userIdList)); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param userIdList The collection of userId as notInScope. + * @param userId The value of userId as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) */ - public void setUserId_NotInScope(Collection userIdList) { - regUserId(CK_NINS, cTL(userIdList)); + public void setUserId_LikeSearch( + String userId, + jp.sf.pal.notepad.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(userId), getCValueUserId(), "USER_ID", "UserId", + "userId", likeSearchOption); } /** - * @param groupMappingCBquery Query. - * @deprecated Please use inScopeGroupMappingList(subQuery) method. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param userId The value of userId as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setUserId_InScopeSubQuery_GroupMappingList( - GroupMappingCQ groupMappingCBquery) { - String subQueryPropertyName = keepUserId_InScopeSubQuery_GroupMappingList(groupMappingCBquery);// for - // saving - // query - // - - // value - // . - registerInScopeSubQuery(groupMappingCBquery, "USER_ID", "USER_ID", - subQueryPropertyName); + public void setUserId_NotLikeSearch( + String userId, + jp.sf.pal.notepad.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(userId), getCValueUserId(), "USER_ID", "UserId", + "userId", likeSearchOption); } public void inScopeGroupMappingList(SubQuery subQuery) { @@ -191,91 +172,42 @@ cb.xsetupForInScopeSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepUserId_InScopeSubQuery_GroupMappingList(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerInScopeSubQuery(cb.query(), "USER_ID", "USER_ID", subQueryPropertyName); } - abstract public String keepUserId_InScopeSubQuery_GroupMappingList( + public abstract String keepUserId_InScopeSubQuery_GroupMappingList( GroupMappingCQ subQuery); - /** - * @param notepadCBquery Query. - * @deprecated Please use inScopeNotepadByCreatedByList(subQuery) method. - */ - public void setUserId_InScopeSubQuery_NotepadByCreatedByList( - NotepadCQ notepadCBquery) { - String subQueryPropertyName = keepUserId_InScopeSubQuery_NotepadByCreatedByList(notepadCBquery);// for - // saving - // query - // - - // value - // . - registerInScopeSubQuery(notepadCBquery, "USER_ID", "CREATED_BY", - subQueryPropertyName); - } - public void inScopeNotepadByCreatedByList(SubQuery subQuery) { assertObjectNotNull("subQuery", subQuery); NotepadCB cb = new NotepadCB(); cb.xsetupForInScopeSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepUserId_InScopeSubQuery_NotepadByCreatedByList(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerInScopeSubQuery(cb.query(), "USER_ID", "CREATED_BY", subQueryPropertyName); } - abstract public String keepUserId_InScopeSubQuery_NotepadByCreatedByList( + public abstract String keepUserId_InScopeSubQuery_NotepadByCreatedByList( NotepadCQ subQuery); - /** - * @param notepadCBquery Query. - * @deprecated Please use inScopeNotepadByUpdatedByList(subQuery) method. - */ - public void setUserId_InScopeSubQuery_NotepadByUpdatedByList( - NotepadCQ notepadCBquery) { - String subQueryPropertyName = keepUserId_InScopeSubQuery_NotepadByUpdatedByList(notepadCBquery);// for - // saving - // query - // - - // value - // . - registerInScopeSubQuery(notepadCBquery, "USER_ID", "UPDATED_BY", - subQueryPropertyName); - } - public void inScopeNotepadByUpdatedByList(SubQuery subQuery) { assertObjectNotNull("subQuery", subQuery); NotepadCB cb = new NotepadCB(); cb.xsetupForInScopeSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepUserId_InScopeSubQuery_NotepadByUpdatedByList(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerInScopeSubQuery(cb.query(), "USER_ID", "UPDATED_BY", subQueryPropertyName); } - abstract public String keepUserId_InScopeSubQuery_NotepadByUpdatedByList( + public abstract String keepUserId_InScopeSubQuery_NotepadByUpdatedByList( NotepadCQ subQuery); - /** - * @param notepadCategoryCBquery Query. - * @deprecated Please use inScopeNotepadCategoryByCreatedByList(subQuery) - * method. - */ - public void setUserId_InScopeSubQuery_NotepadCategoryByCreatedByList( - NotepadCategoryCQ notepadCategoryCBquery) { - String subQueryPropertyName = keepUserId_InScopeSubQuery_NotepadCategoryByCreatedByList(notepadCategoryCBquery);// for - // saving - // query - // - - // value - // . - registerInScopeSubQuery(notepadCategoryCBquery, "USER_ID", - "CREATED_BY", subQueryPropertyName); - } - public void inScopeNotepadCategoryByCreatedByList( SubQuery subQuery) { assertObjectNotNull("subQuery", subQuery); @@ -283,31 +215,14 @@ cb.xsetupForInScopeSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepUserId_InScopeSubQuery_NotepadCategoryByCreatedByList(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerInScopeSubQuery(cb.query(), "USER_ID", "CREATED_BY", subQueryPropertyName); } - abstract public String keepUserId_InScopeSubQuery_NotepadCategoryByCreatedByList( + public abstract String keepUserId_InScopeSubQuery_NotepadCategoryByCreatedByList( NotepadCategoryCQ subQuery); - /** - * @param notepadCategoryCBquery Query. - * @deprecated Please use inScopeNotepadCategoryByUpdatedByList(subQuery) - * method. - */ - public void setUserId_InScopeSubQuery_NotepadCategoryByUpdatedByList( - NotepadCategoryCQ notepadCategoryCBquery) { - String subQueryPropertyName = keepUserId_InScopeSubQuery_NotepadCategoryByUpdatedByList(notepadCategoryCBquery);// for - // saving - // query - // - - // value - // . - registerInScopeSubQuery(notepadCategoryCBquery, "USER_ID", - "UPDATED_BY", subQueryPropertyName); - } - public void inScopeNotepadCategoryByUpdatedByList( SubQuery subQuery) { assertObjectNotNull("subQuery", subQuery); @@ -315,42 +230,26 @@ cb.xsetupForInScopeSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepUserId_InScopeSubQuery_NotepadCategoryByUpdatedByList(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerInScopeSubQuery(cb.query(), "USER_ID", "UPDATED_BY", subQueryPropertyName); } - abstract public String keepUserId_InScopeSubQuery_NotepadCategoryByUpdatedByList( + public abstract String keepUserId_InScopeSubQuery_NotepadCategoryByUpdatedByList( NotepadCategoryCQ subQuery); - /** - * @param roleMappingCBquery Query. - * @deprecated Please use inScopeRoleMappingList(subQuery) method. - */ - public void setUserId_InScopeSubQuery_RoleMappingList( - RoleMappingCQ roleMappingCBquery) { - String subQueryPropertyName = keepUserId_InScopeSubQuery_RoleMappingList(roleMappingCBquery);// for - // saving - // query - // - - // value - // . - registerInScopeSubQuery(roleMappingCBquery, "USER_ID", "USER_ID", - subQueryPropertyName); - } - public void inScopeRoleMappingList(SubQuery subQuery) { assertObjectNotNull("subQuery", subQuery); RoleMappingCB cb = new RoleMappingCB(); cb.xsetupForInScopeSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepUserId_InScopeSubQuery_RoleMappingList(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerInScopeSubQuery(cb.query(), "USER_ID", "USER_ID", subQueryPropertyName); } - abstract public String keepUserId_InScopeSubQuery_RoleMappingList( + public abstract String keepUserId_InScopeSubQuery_RoleMappingList( RoleMappingCQ subQuery); public void notInScopeGroupMappingList(SubQuery subQuery) { @@ -359,12 +258,12 @@ cb.xsetupForInScopeSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepUserId_NotInScopeSubQuery_GroupMappingList(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerNotInScopeSubQuery(cb.query(), "USER_ID", "USER_ID", subQueryPropertyName); } - abstract public String keepUserId_NotInScopeSubQuery_GroupMappingList( + public abstract String keepUserId_NotInScopeSubQuery_GroupMappingList( GroupMappingCQ subQuery); public void notInScopeNotepadByCreatedByList(SubQuery subQuery) { @@ -373,12 +272,12 @@ cb.xsetupForInScopeSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepUserId_NotInScopeSubQuery_NotepadByCreatedByList(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerNotInScopeSubQuery(cb.query(), "USER_ID", "CREATED_BY", subQueryPropertyName); } - abstract public String keepUserId_NotInScopeSubQuery_NotepadByCreatedByList( + public abstract String keepUserId_NotInScopeSubQuery_NotepadByCreatedByList( NotepadCQ subQuery); public void notInScopeNotepadByUpdatedByList(SubQuery subQuery) { @@ -387,12 +286,12 @@ cb.xsetupForInScopeSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepUserId_NotInScopeSubQuery_NotepadByUpdatedByList(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerNotInScopeSubQuery(cb.query(), "USER_ID", "UPDATED_BY", subQueryPropertyName); } - abstract public String keepUserId_NotInScopeSubQuery_NotepadByUpdatedByList( + public abstract String keepUserId_NotInScopeSubQuery_NotepadByUpdatedByList( NotepadCQ subQuery); public void notInScopeNotepadCategoryByCreatedByList( @@ -402,12 +301,12 @@ cb.xsetupForInScopeSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepUserId_NotInScopeSubQuery_NotepadCategoryByCreatedByList(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerNotInScopeSubQuery(cb.query(), "USER_ID", "CREATED_BY", subQueryPropertyName); } - abstract public String keepUserId_NotInScopeSubQuery_NotepadCategoryByCreatedByList( + public abstract String keepUserId_NotInScopeSubQuery_NotepadCategoryByCreatedByList( NotepadCategoryCQ subQuery); public void notInScopeNotepadCategoryByUpdatedByList( @@ -417,12 +316,12 @@ cb.xsetupForInScopeSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepUserId_NotInScopeSubQuery_NotepadCategoryByUpdatedByList(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerNotInScopeSubQuery(cb.query(), "USER_ID", "UPDATED_BY", subQueryPropertyName); } - abstract public String keepUserId_NotInScopeSubQuery_NotepadCategoryByUpdatedByList( + public abstract String keepUserId_NotInScopeSubQuery_NotepadCategoryByUpdatedByList( NotepadCategoryCQ subQuery); public void notInScopeRoleMappingList(SubQuery subQuery) { @@ -431,31 +330,15 @@ cb.xsetupForInScopeSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepUserId_NotInScopeSubQuery_RoleMappingList(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerNotInScopeSubQuery(cb.query(), "USER_ID", "USER_ID", subQueryPropertyName); } - abstract public String keepUserId_NotInScopeSubQuery_RoleMappingList( + public abstract String keepUserId_NotInScopeSubQuery_RoleMappingList( RoleMappingCQ subQuery); /** - * @param groupMappingCBquery Query. - * @deprecated Please use existsGroupMappingList(subQuery) method. - */ - public void setUserId_ExistsSubQuery_GroupMappingList( - GroupMappingCQ groupMappingCBquery) { - String subQueryPropertyName = keepUserId_ExistsSubQuery_GroupMappingList(groupMappingCBquery);// for - // saving - // query - // - - // value - // . - registerExistsSubQuery(groupMappingCBquery, "USER_ID", "USER_ID", - subQueryPropertyName); - } - - /** * Set up 'exists' sub-query. {exists (select USER_ID from GROUP_MAPPING * where ...)} * @@ -468,31 +351,15 @@ cb.xsetupForExistsSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepUserId_ExistsSubQuery_GroupMappingList(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerExistsSubQuery(cb.query(), "USER_ID", "USER_ID", subQueryPropertyName); } - abstract public String keepUserId_ExistsSubQuery_GroupMappingList( + public abstract String keepUserId_ExistsSubQuery_GroupMappingList( GroupMappingCQ subQuery); /** - * @param notepadCBquery Query. - * @deprecated Please use existsNotepadByCreatedByList(subQuery) method. - */ - public void setUserId_ExistsSubQuery_NotepadByCreatedByList( - NotepadCQ notepadCBquery) { - String subQueryPropertyName = keepUserId_ExistsSubQuery_NotepadByCreatedByList(notepadCBquery);// for - // saving - // query - // - - // value - // . - registerExistsSubQuery(notepadCBquery, "USER_ID", "CREATED_BY", - subQueryPropertyName); - } - - /** * Set up 'exists' sub-query. {exists (select CREATED_BY from NOTEPAD where * ...)} * @@ -506,31 +373,15 @@ cb.xsetupForExistsSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepUserId_ExistsSubQuery_NotepadByCreatedByList(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerExistsSubQuery(cb.query(), "USER_ID", "CREATED_BY", subQueryPropertyName); } - abstract public String keepUserId_ExistsSubQuery_NotepadByCreatedByList( + public abstract String keepUserId_ExistsSubQuery_NotepadByCreatedByList( NotepadCQ subQuery); /** - * @param notepadCBquery Query. - * @deprecated Please use existsNotepadByUpdatedByList(subQuery) method. - */ - public void setUserId_ExistsSubQuery_NotepadByUpdatedByList( - NotepadCQ notepadCBquery) { - String subQueryPropertyName = keepUserId_ExistsSubQuery_NotepadByUpdatedByList(notepadCBquery);// for - // saving - // query - // - - // value - // . - registerExistsSubQuery(notepadCBquery, "USER_ID", "UPDATED_BY", - subQueryPropertyName); - } - - /** * Set up 'exists' sub-query. {exists (select UPDATED_BY from NOTEPAD where * ...)} * @@ -544,32 +395,15 @@ cb.xsetupForExistsSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepUserId_ExistsSubQuery_NotepadByUpdatedByList(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerExistsSubQuery(cb.query(), "USER_ID", "UPDATED_BY", subQueryPropertyName); } - abstract public String keepUserId_ExistsSubQuery_NotepadByUpdatedByList( + public abstract String keepUserId_ExistsSubQuery_NotepadByUpdatedByList( NotepadCQ subQuery); /** - * @param notepadCategoryCBquery Query. - * @deprecated Please use existsNotepadCategoryByCreatedByList(subQuery) - * method. - */ - public void setUserId_ExistsSubQuery_NotepadCategoryByCreatedByList( - NotepadCategoryCQ notepadCategoryCBquery) { - String subQueryPropertyName = keepUserId_ExistsSubQuery_NotepadCategoryByCreatedByList(notepadCategoryCBquery);// for - // saving - // query - // - - // value - // . - registerExistsSubQuery(notepadCategoryCBquery, "USER_ID", "CREATED_BY", - subQueryPropertyName); - } - - /** * Set up 'exists' sub-query. {exists (select CREATED_BY from * NOTEPAD_CATEGORY where ...)} * @@ -584,32 +418,15 @@ cb.xsetupForExistsSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepUserId_ExistsSubQuery_NotepadCategoryByCreatedByList(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerExistsSubQuery(cb.query(), "USER_ID", "CREATED_BY", subQueryPropertyName); } - abstract public String keepUserId_ExistsSubQuery_NotepadCategoryByCreatedByList( + public abstract String keepUserId_ExistsSubQuery_NotepadCategoryByCreatedByList( NotepadCategoryCQ subQuery); /** - * @param notepadCategoryCBquery Query. - * @deprecated Please use existsNotepadCategoryByUpdatedByList(subQuery) - * method. - */ - public void setUserId_ExistsSubQuery_NotepadCategoryByUpdatedByList( - NotepadCategoryCQ notepadCategoryCBquery) { - String subQueryPropertyName = keepUserId_ExistsSubQuery_NotepadCategoryByUpdatedByList(notepadCategoryCBquery);// for - // saving - // query - // - - // value - // . - registerExistsSubQuery(notepadCategoryCBquery, "USER_ID", "UPDATED_BY", - subQueryPropertyName); - } - - /** * Set up 'exists' sub-query. {exists (select UPDATED_BY from * NOTEPAD_CATEGORY where ...)} * @@ -624,31 +441,15 @@ cb.xsetupForExistsSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepUserId_ExistsSubQuery_NotepadCategoryByUpdatedByList(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerExistsSubQuery(cb.query(), "USER_ID", "UPDATED_BY", subQueryPropertyName); } - abstract public String keepUserId_ExistsSubQuery_NotepadCategoryByUpdatedByList( + public abstract String keepUserId_ExistsSubQuery_NotepadCategoryByUpdatedByList( NotepadCategoryCQ subQuery); /** - * @param roleMappingCBquery Query. - * @deprecated Please use existsRoleMappingList(subQuery) method. - */ - public void setUserId_ExistsSubQuery_RoleMappingList( - RoleMappingCQ roleMappingCBquery) { - String subQueryPropertyName = keepUserId_ExistsSubQuery_RoleMappingList(roleMappingCBquery);// for - // saving - // query - // - - // value - // . - registerExistsSubQuery(roleMappingCBquery, "USER_ID", "USER_ID", - subQueryPropertyName); - } - - /** * Set up 'exists' sub-query. {exists (select USER_ID from ROLE_MAPPING * where ...)} * @@ -661,12 +462,12 @@ cb.xsetupForExistsSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepUserId_ExistsSubQuery_RoleMappingList(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerExistsSubQuery(cb.query(), "USER_ID", "USER_ID", subQueryPropertyName); } - abstract public String keepUserId_ExistsSubQuery_RoleMappingList( + public abstract String keepUserId_ExistsSubQuery_RoleMappingList( RoleMappingCQ subQuery); /** @@ -683,12 +484,12 @@ cb.xsetupForExistsSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepUserId_NotExistsSubQuery_GroupMappingList(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerNotExistsSubQuery(cb.query(), "USER_ID", "USER_ID", subQueryPropertyName); } - abstract public String keepUserId_NotExistsSubQuery_GroupMappingList( + public abstract String keepUserId_NotExistsSubQuery_GroupMappingList( GroupMappingCQ subQuery); /** @@ -705,12 +506,12 @@ cb.xsetupForExistsSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepUserId_NotExistsSubQuery_NotepadByCreatedByList(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerNotExistsSubQuery(cb.query(), "USER_ID", "CREATED_BY", subQueryPropertyName); } - abstract public String keepUserId_NotExistsSubQuery_NotepadByCreatedByList( + public abstract String keepUserId_NotExistsSubQuery_NotepadByCreatedByList( NotepadCQ subQuery); /** @@ -727,12 +528,12 @@ cb.xsetupForExistsSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepUserId_NotExistsSubQuery_NotepadByUpdatedByList(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerNotExistsSubQuery(cb.query(), "USER_ID", "UPDATED_BY", subQueryPropertyName); } - abstract public String keepUserId_NotExistsSubQuery_NotepadByUpdatedByList( + public abstract String keepUserId_NotExistsSubQuery_NotepadByUpdatedByList( NotepadCQ subQuery); /** @@ -750,12 +551,12 @@ cb.xsetupForExistsSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepUserId_NotExistsSubQuery_NotepadCategoryByCreatedByList(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerNotExistsSubQuery(cb.query(), "USER_ID", "CREATED_BY", subQueryPropertyName); } - abstract public String keepUserId_NotExistsSubQuery_NotepadCategoryByCreatedByList( + public abstract String keepUserId_NotExistsSubQuery_NotepadCategoryByCreatedByList( NotepadCategoryCQ subQuery); /** @@ -773,12 +574,12 @@ cb.xsetupForExistsSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepUserId_NotExistsSubQuery_NotepadCategoryByUpdatedByList(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerNotExistsSubQuery(cb.query(), "USER_ID", "UPDATED_BY", subQueryPropertyName); } - abstract public String keepUserId_NotExistsSubQuery_NotepadCategoryByUpdatedByList( + public abstract String keepUserId_NotExistsSubQuery_NotepadCategoryByUpdatedByList( NotepadCategoryCQ subQuery); /** @@ -794,113 +595,113 @@ cb.xsetupForExistsSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepUserId_NotExistsSubQuery_RoleMappingList(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerNotExistsSubQuery(cb.query(), "USER_ID", "USER_ID", subQueryPropertyName); } - abstract public String keepUserId_NotExistsSubQuery_RoleMappingList( + public abstract String keepUserId_NotExistsSubQuery_RoleMappingList( RoleMappingCQ subQuery); public void xderiveGroupMappingList(String function, SubQuery subQuery, String aliasName) { assertObjectNotNull("subQuery", subQuery); GroupMappingCB cb = new GroupMappingCB(); - cb.xsetupForDeriveReferrer(); + cb.xsetupForDerivedReferrer(); subQuery.query(cb); - String subQueryPropertyName = keepUserId_DeriveSubQuery_GroupMappingList(cb - .query());// for saving query-value. - registerDeriveSubQuery(function, cb.query(), "USER_ID", "USER_ID", - subQueryPropertyName, aliasName); + String subQueryPropertyName = keepUserId_DerivedReferrer_GroupMappingList(cb + .query()); // for saving query-value. + registerDerivedReferrerSubQuery(function, cb.query(), "USER_ID", + "USER_ID", subQueryPropertyName, aliasName); } - abstract public String keepUserId_DeriveSubQuery_GroupMappingList( + public abstract String keepUserId_DerivedReferrer_GroupMappingList( GroupMappingCQ subQuery); public void xderiveNotepadByCreatedByList(String function, SubQuery subQuery, String aliasName) { assertObjectNotNull("subQuery", subQuery); NotepadCB cb = new NotepadCB(); - cb.xsetupForDeriveReferrer(); + cb.xsetupForDerivedReferrer(); subQuery.query(cb); - String subQueryPropertyName = keepUserId_DeriveSubQuery_NotepadByCreatedByList(cb - .query());// for saving query-value. - registerDeriveSubQuery(function, cb.query(), "USER_ID", "CREATED_BY", - subQueryPropertyName, aliasName); + String subQueryPropertyName = keepUserId_DerivedReferrer_NotepadByCreatedByList(cb + .query()); // for saving query-value. + registerDerivedReferrerSubQuery(function, cb.query(), "USER_ID", + "CREATED_BY", subQueryPropertyName, aliasName); } - abstract public String keepUserId_DeriveSubQuery_NotepadByCreatedByList( + public abstract String keepUserId_DerivedReferrer_NotepadByCreatedByList( NotepadCQ subQuery); public void xderiveNotepadByUpdatedByList(String function, SubQuery subQuery, String aliasName) { assertObjectNotNull("subQuery", subQuery); NotepadCB cb = new NotepadCB(); - cb.xsetupForDeriveReferrer(); + cb.xsetupForDerivedReferrer(); subQuery.query(cb); - String subQueryPropertyName = keepUserId_DeriveSubQuery_NotepadByUpdatedByList(cb - .query());// for saving query-value. - registerDeriveSubQuery(function, cb.query(), "USER_ID", "UPDATED_BY", - subQueryPropertyName, aliasName); + String subQueryPropertyName = keepUserId_DerivedReferrer_NotepadByUpdatedByList(cb + .query()); // for saving query-value. + registerDerivedReferrerSubQuery(function, cb.query(), "USER_ID", + "UPDATED_BY", subQueryPropertyName, aliasName); } - abstract public String keepUserId_DeriveSubQuery_NotepadByUpdatedByList( + public abstract String keepUserId_DerivedReferrer_NotepadByUpdatedByList( NotepadCQ subQuery); public void xderiveNotepadCategoryByCreatedByList(String function, SubQuery subQuery, String aliasName) { assertObjectNotNull("subQuery", subQuery); NotepadCategoryCB cb = new NotepadCategoryCB(); - cb.xsetupForDeriveReferrer(); + cb.xsetupForDerivedReferrer(); subQuery.query(cb); - String subQueryPropertyName = keepUserId_DeriveSubQuery_NotepadCategoryByCreatedByList(cb - .query());// for saving query-value. - registerDeriveSubQuery(function, cb.query(), "USER_ID", "CREATED_BY", - subQueryPropertyName, aliasName); + String subQueryPropertyName = keepUserId_DerivedReferrer_NotepadCategoryByCreatedByList(cb + .query()); // for saving query-value. + registerDerivedReferrerSubQuery(function, cb.query(), "USER_ID", + "CREATED_BY", subQueryPropertyName, aliasName); } - abstract public String keepUserId_DeriveSubQuery_NotepadCategoryByCreatedByList( + public abstract String keepUserId_DerivedReferrer_NotepadCategoryByCreatedByList( NotepadCategoryCQ subQuery); public void xderiveNotepadCategoryByUpdatedByList(String function, SubQuery subQuery, String aliasName) { assertObjectNotNull("subQuery", subQuery); NotepadCategoryCB cb = new NotepadCategoryCB(); - cb.xsetupForDeriveReferrer(); + cb.xsetupForDerivedReferrer(); subQuery.query(cb); - String subQueryPropertyName = keepUserId_DeriveSubQuery_NotepadCategoryByUpdatedByList(cb - .query());// for saving query-value. - registerDeriveSubQuery(function, cb.query(), "USER_ID", "UPDATED_BY", - subQueryPropertyName, aliasName); + String subQueryPropertyName = keepUserId_DerivedReferrer_NotepadCategoryByUpdatedByList(cb + .query()); // for saving query-value. + registerDerivedReferrerSubQuery(function, cb.query(), "USER_ID", + "UPDATED_BY", subQueryPropertyName, aliasName); } - abstract public String keepUserId_DeriveSubQuery_NotepadCategoryByUpdatedByList( + public abstract String keepUserId_DerivedReferrer_NotepadCategoryByUpdatedByList( NotepadCategoryCQ subQuery); public void xderiveRoleMappingList(String function, SubQuery subQuery, String aliasName) { assertObjectNotNull("subQuery", subQuery); RoleMappingCB cb = new RoleMappingCB(); - cb.xsetupForDeriveReferrer(); + cb.xsetupForDerivedReferrer(); subQuery.query(cb); - String subQueryPropertyName = keepUserId_DeriveSubQuery_RoleMappingList(cb - .query());// for saving query-value. - registerDeriveSubQuery(function, cb.query(), "USER_ID", "USER_ID", - subQueryPropertyName, aliasName); + String subQueryPropertyName = keepUserId_DerivedReferrer_RoleMappingList(cb + .query()); // for saving query-value. + registerDerivedReferrerSubQuery(function, cb.query(), "USER_ID", + "USER_ID", subQueryPropertyName, aliasName); } - abstract public String keepUserId_DeriveSubQuery_RoleMappingList( + public abstract String keepUserId_DerivedReferrer_RoleMappingList( RoleMappingCQ subQuery); /** - * IsNull(is null). And OnceRegistered. + * IsNull(is null). And OnlyOnceRegistered. */ public void setUserId_IsNull() { regUserId(CK_ISN, DUMMY_OBJECT); } /** - * IsNotNull(is not null). And OnceRegistered. + * IsNotNull(is not null). And OnlyOnceRegistered. */ public void setUserId_IsNotNull() { regUserId(CK_ISNN, DUMMY_OBJECT); @@ -919,7 +720,7 @@ abstract protected ConditionValue getCValueUserId(); /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {VARCHAR(100)} + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {VARCHAR(100)} * * @param givenName The value of givenName as equal. */ @@ -928,7 +729,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param givenName The value of givenName as notEqual. */ @@ -937,7 +738,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param givenName The value of givenName as greaterThan. */ @@ -946,7 +747,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param givenName The value of givenName as lessThan. */ @@ -955,7 +756,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param givenName The value of givenName as greaterEqual. */ @@ -964,7 +765,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param givenName The value of givenName as lessEqual. */ @@ -973,7 +774,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param givenName The value of givenName as prefixSearch. */ @@ -982,20 +783,6 @@ } /** - * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, - * SeveralRegistered. - * - * @param givenName The value of givenName as likeSearch. - * @param likeSearchOption The option of like-search. (NotNull) - */ - public void setGivenName_LikeSearch( - String givenName, - jp.sf.pal.notepad.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { - registerLikeSearchQuery(CK_LS, fRES(givenName), getCValueGivenName(), - "GIVEN_NAME", "GivenName", "givenName", likeSearchOption); - } - - /** * InScope(in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * @@ -1006,38 +793,52 @@ } /** - * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * - * @param givenName The collection of givenName as inScope. - * @param inScopeOption The option of in-scope. (NotNull) + * @param givenNameList The collection of givenName as notInScope. */ - public void setGivenName_InScope( + public void setGivenName_NotInScope(Collection givenNameList) { + regGivenName(CK_NINS, cTL(givenNameList)); + } + + /** + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param givenName The value of givenName as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) + */ + public void setGivenName_LikeSearch( String givenName, - jp.sf.pal.notepad.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(givenName), getCValueGivenName(), - "GIVEN_NAME", "GivenName", "givenName", inScopeOption); + jp.sf.pal.notepad.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(givenName), getCValueGivenName(), "GIVEN_NAME", + "GivenName", "givenName", likeSearchOption); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param givenNameList The collection of givenName as notInScope. + * @param givenName The value of givenName as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setGivenName_NotInScope(Collection givenNameList) { - regGivenName(CK_NINS, cTL(givenNameList)); + public void setGivenName_NotLikeSearch( + String givenName, + jp.sf.pal.notepad.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(givenName), getCValueGivenName(), "GIVEN_NAME", + "GivenName", "givenName", likeSearchOption); } /** - * IsNull(is null). And OnceRegistered. + * IsNull(is null). And OnlyOnceRegistered. */ public void setGivenName_IsNull() { regGivenName(CK_ISN, DUMMY_OBJECT); } /** - * IsNotNull(is not null). And OnceRegistered. + * IsNotNull(is not null). And OnlyOnceRegistered. */ public void setGivenName_IsNotNull() { regGivenName(CK_ISNN, DUMMY_OBJECT); @@ -1056,7 +857,7 @@ abstract protected ConditionValue getCValueGivenName(); /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {VARCHAR(100)} + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {VARCHAR(100)} * * @param familyName The value of familyName as equal. */ @@ -1065,7 +866,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param familyName The value of familyName as notEqual. */ @@ -1074,7 +875,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param familyName The value of familyName as greaterThan. */ @@ -1083,7 +884,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param familyName The value of familyName as lessThan. */ @@ -1092,7 +893,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param familyName The value of familyName as greaterEqual. */ @@ -1101,7 +902,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param familyName The value of familyName as lessEqual. */ @@ -1110,7 +911,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param familyName The value of familyName as prefixSearch. */ @@ -1119,20 +920,6 @@ } /** - * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, - * SeveralRegistered. - * - * @param familyName The value of familyName as likeSearch. - * @param likeSearchOption The option of like-search. (NotNull) - */ - public void setFamilyName_LikeSearch( - String familyName, - jp.sf.pal.notepad.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { - registerLikeSearchQuery(CK_LS, fRES(familyName), getCValueFamilyName(), - "FAMILY_NAME", "FamilyName", "familyName", likeSearchOption); - } - - /** * InScope(in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * @@ -1143,38 +930,52 @@ } /** - * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * - * @param familyName The collection of familyName as inScope. - * @param inScopeOption The option of in-scope. (NotNull) + * @param familyNameList The collection of familyName as notInScope. */ - public void setFamilyName_InScope( + public void setFamilyName_NotInScope(Collection familyNameList) { + regFamilyName(CK_NINS, cTL(familyNameList)); + } + + /** + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param familyName The value of familyName as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) + */ + public void setFamilyName_LikeSearch( String familyName, - jp.sf.pal.notepad.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(familyName), getCValueFamilyName(), - "FAMILY_NAME", "FamilyName", "familyName", inScopeOption); + jp.sf.pal.notepad.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(familyName), getCValueFamilyName(), "FAMILY_NAME", + "FamilyName", "familyName", likeSearchOption); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param familyNameList The collection of familyName as notInScope. + * @param familyName The value of familyName as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setFamilyName_NotInScope(Collection familyNameList) { - regFamilyName(CK_NINS, cTL(familyNameList)); + public void setFamilyName_NotLikeSearch( + String familyName, + jp.sf.pal.notepad.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(familyName), getCValueFamilyName(), "FAMILY_NAME", + "FamilyName", "familyName", likeSearchOption); } /** - * IsNull(is null). And OnceRegistered. + * IsNull(is null). And OnlyOnceRegistered. */ public void setFamilyName_IsNull() { regFamilyName(CK_ISN, DUMMY_OBJECT); } /** - * IsNotNull(is not null). And OnceRegistered. + * IsNotNull(is not null). And OnlyOnceRegistered. */ public void setFamilyName_IsNotNull() { regFamilyName(CK_ISNN, DUMMY_OBJECT); @@ -1193,7 +994,7 @@ abstract protected ConditionValue getCValueFamilyName(); /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {VARCHAR(50)} + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {VARCHAR(50)} * * @param middleName The value of middleName as equal. */ @@ -1202,7 +1003,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param middleName The value of middleName as notEqual. */ @@ -1211,7 +1012,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param middleName The value of middleName as greaterThan. */ @@ -1220,7 +1021,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param middleName The value of middleName as lessThan. */ @@ -1229,7 +1030,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param middleName The value of middleName as greaterEqual. */ @@ -1238,7 +1039,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param middleName The value of middleName as lessEqual. */ @@ -1247,7 +1048,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param middleName The value of middleName as prefixSearch. */ @@ -1256,20 +1057,6 @@ } /** - * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, - * SeveralRegistered. - * - * @param middleName The value of middleName as likeSearch. - * @param likeSearchOption The option of like-search. (NotNull) - */ - public void setMiddleName_LikeSearch( - String middleName, - jp.sf.pal.notepad.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { - registerLikeSearchQuery(CK_LS, fRES(middleName), getCValueMiddleName(), - "MIDDLE_NAME", "MiddleName", "middleName", likeSearchOption); - } - - /** * InScope(in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * @@ -1280,38 +1067,52 @@ } /** - * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * - * @param middleName The collection of middleName as inScope. - * @param inScopeOption The option of in-scope. (NotNull) + * @param middleNameList The collection of middleName as notInScope. */ - public void setMiddleName_InScope( + public void setMiddleName_NotInScope(Collection middleNameList) { + regMiddleName(CK_NINS, cTL(middleNameList)); + } + + /** + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param middleName The value of middleName as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) + */ + public void setMiddleName_LikeSearch( String middleName, - jp.sf.pal.notepad.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(middleName), getCValueMiddleName(), - "MIDDLE_NAME", "MiddleName", "middleName", inScopeOption); + jp.sf.pal.notepad.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(middleName), getCValueMiddleName(), "MIDDLE_NAME", + "MiddleName", "middleName", likeSearchOption); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param middleNameList The collection of middleName as notInScope. + * @param middleName The value of middleName as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setMiddleName_NotInScope(Collection middleNameList) { - regMiddleName(CK_NINS, cTL(middleNameList)); + public void setMiddleName_NotLikeSearch( + String middleName, + jp.sf.pal.notepad.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(middleName), getCValueMiddleName(), "MIDDLE_NAME", + "MiddleName", "middleName", likeSearchOption); } /** - * IsNull(is null). And OnceRegistered. + * IsNull(is null). And OnlyOnceRegistered. */ public void setMiddleName_IsNull() { regMiddleName(CK_ISN, DUMMY_OBJECT); } /** - * IsNotNull(is not null). And OnceRegistered. + * IsNotNull(is not null). And OnlyOnceRegistered. */ public void setMiddleName_IsNotNull() { regMiddleName(CK_ISNN, DUMMY_OBJECT); @@ -1330,7 +1131,7 @@ abstract protected ConditionValue getCValueMiddleName(); /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {VARCHAR(100)} + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {VARCHAR(100)} * * @param givenNameDesc The value of givenNameDesc as equal. */ @@ -1339,7 +1140,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param givenNameDesc The value of givenNameDesc as notEqual. */ @@ -1348,7 +1149,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param givenNameDesc The value of givenNameDesc as greaterThan. */ @@ -1357,7 +1158,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param givenNameDesc The value of givenNameDesc as lessThan. */ @@ -1366,7 +1167,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param givenNameDesc The value of givenNameDesc as greaterEqual. */ @@ -1375,7 +1176,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param givenNameDesc The value of givenNameDesc as lessEqual. */ @@ -1384,7 +1185,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param givenNameDesc The value of givenNameDesc as prefixSearch. */ @@ -1393,21 +1194,6 @@ } /** - * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, - * SeveralRegistered. - * - * @param givenNameDesc The value of givenNameDesc as likeSearch. - * @param likeSearchOption The option of like-search. (NotNull) - */ - public void setGivenNameDesc_LikeSearch( - String givenNameDesc, - jp.sf.pal.notepad.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { - registerLikeSearchQuery(CK_LS, fRES(givenNameDesc), - getCValueGivenNameDesc(), "GIVEN_NAME_DESC", "GivenNameDesc", - "givenNameDesc", likeSearchOption); - } - - /** * InScope(in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * @@ -1418,39 +1204,54 @@ } /** - * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * - * @param givenNameDesc The collection of givenNameDesc as inScope. - * @param inScopeOption The option of in-scope. (NotNull) + * @param givenNameDescList The collection of givenNameDesc as notInScope. */ - public void setGivenNameDesc_InScope( + public void setGivenNameDesc_NotInScope(Collection givenNameDescList) { + regGivenNameDesc(CK_NINS, cTL(givenNameDescList)); + } + + /** + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param givenNameDesc The value of givenNameDesc as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) + */ + public void setGivenNameDesc_LikeSearch( String givenNameDesc, - jp.sf.pal.notepad.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(givenNameDesc), - getCValueGivenNameDesc(), "GIVEN_NAME_DESC", "GivenNameDesc", - "givenNameDesc", inScopeOption); + jp.sf.pal.notepad.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(givenNameDesc), getCValueGivenNameDesc(), + "GIVEN_NAME_DESC", "GivenNameDesc", "givenNameDesc", + likeSearchOption); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param givenNameDescList The collection of givenNameDesc as notInScope. + * @param givenNameDesc The value of givenNameDesc as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setGivenNameDesc_NotInScope(Collection givenNameDescList) { - regGivenNameDesc(CK_NINS, cTL(givenNameDescList)); + public void setGivenNameDesc_NotLikeSearch( + String givenNameDesc, + jp.sf.pal.notepad.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(givenNameDesc), getCValueGivenNameDesc(), + "GIVEN_NAME_DESC", "GivenNameDesc", "givenNameDesc", + likeSearchOption); } /** - * IsNull(is null). And OnceRegistered. + * IsNull(is null). And OnlyOnceRegistered. */ public void setGivenNameDesc_IsNull() { regGivenNameDesc(CK_ISN, DUMMY_OBJECT); } /** - * IsNotNull(is not null). And OnceRegistered. + * IsNotNull(is not null). And OnlyOnceRegistered. */ public void setGivenNameDesc_IsNotNull() { regGivenNameDesc(CK_ISNN, DUMMY_OBJECT); @@ -1469,7 +1270,7 @@ abstract protected ConditionValue getCValueGivenNameDesc(); /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {VARCHAR(100)} + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {VARCHAR(100)} * * @param familyNameDesc The value of familyNameDesc as equal. */ @@ -1478,7 +1279,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param familyNameDesc The value of familyNameDesc as notEqual. */ @@ -1487,7 +1288,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param familyNameDesc The value of familyNameDesc as greaterThan. */ @@ -1496,7 +1297,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param familyNameDesc The value of familyNameDesc as lessThan. */ @@ -1505,7 +1306,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param familyNameDesc The value of familyNameDesc as greaterEqual. */ @@ -1514,7 +1315,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param familyNameDesc The value of familyNameDesc as lessEqual. */ @@ -1523,7 +1324,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param familyNameDesc The value of familyNameDesc as prefixSearch. */ @@ -1532,21 +1333,6 @@ } /** - * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, - * SeveralRegistered. - * - * @param familyNameDesc The value of familyNameDesc as likeSearch. - * @param likeSearchOption The option of like-search. (NotNull) - */ - public void setFamilyNameDesc_LikeSearch( - String familyNameDesc, - jp.sf.pal.notepad.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { - registerLikeSearchQuery(CK_LS, fRES(familyNameDesc), - getCValueFamilyNameDesc(), "FAMILY_NAME_DESC", - "FamilyNameDesc", "familyNameDesc", likeSearchOption); - } - - /** * InScope(in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * @@ -1557,40 +1343,55 @@ } /** - * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * - * @param familyNameDesc The collection of familyNameDesc as inScope. - * @param inScopeOption The option of in-scope. (NotNull) + * @param familyNameDescList The collection of familyNameDesc as notInScope. */ - public void setFamilyNameDesc_InScope( + public void setFamilyNameDesc_NotInScope( + Collection familyNameDescList) { + regFamilyNameDesc(CK_NINS, cTL(familyNameDescList)); + } + + /** + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param familyNameDesc The value of familyNameDesc as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) + */ + public void setFamilyNameDesc_LikeSearch( String familyNameDesc, - jp.sf.pal.notepad.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(familyNameDesc), - getCValueFamilyNameDesc(), "FAMILY_NAME_DESC", - "FamilyNameDesc", "familyNameDesc", inScopeOption); + jp.sf.pal.notepad.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(familyNameDesc), getCValueFamilyNameDesc(), + "FAMILY_NAME_DESC", "FamilyNameDesc", "familyNameDesc", + likeSearchOption); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param familyNameDescList The collection of familyNameDesc as notInScope. + * @param familyNameDesc The value of familyNameDesc as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setFamilyNameDesc_NotInScope( - Collection familyNameDescList) { - regFamilyNameDesc(CK_NINS, cTL(familyNameDescList)); + public void setFamilyNameDesc_NotLikeSearch( + String familyNameDesc, + jp.sf.pal.notepad.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(familyNameDesc), getCValueFamilyNameDesc(), + "FAMILY_NAME_DESC", "FamilyNameDesc", "familyNameDesc", + likeSearchOption); } /** - * IsNull(is null). And OnceRegistered. + * IsNull(is null). And OnlyOnceRegistered. */ public void setFamilyNameDesc_IsNull() { regFamilyNameDesc(CK_ISN, DUMMY_OBJECT); } /** - * IsNotNull(is not null). And OnceRegistered. + * IsNotNull(is not null). And OnlyOnceRegistered. */ public void setFamilyNameDesc_IsNotNull() { regFamilyNameDesc(CK_ISNN, DUMMY_OBJECT); @@ -1609,7 +1410,7 @@ abstract protected ConditionValue getCValueFamilyNameDesc(); /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {VARCHAR(100)} + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {VARCHAR(100)} * * @param nickname The value of nickname as equal. */ @@ -1618,7 +1419,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param nickname The value of nickname as notEqual. */ @@ -1627,7 +1428,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param nickname The value of nickname as greaterThan. */ @@ -1636,7 +1437,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param nickname The value of nickname as lessThan. */ @@ -1645,7 +1446,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param nickname The value of nickname as greaterEqual. */ @@ -1654,7 +1455,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param nickname The value of nickname as lessEqual. */ @@ -1663,7 +1464,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param nickname The value of nickname as prefixSearch. */ @@ -1672,20 +1473,6 @@ } /** - * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, - * SeveralRegistered. - * - * @param nickname The value of nickname as likeSearch. - * @param likeSearchOption The option of like-search. (NotNull) - */ - public void setNickname_LikeSearch( - String nickname, - jp.sf.pal.notepad.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { - registerLikeSearchQuery(CK_LS, fRES(nickname), getCValueNickname(), - "NICKNAME", "Nickname", "nickname", likeSearchOption); - } - - /** * InScope(in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * @@ -1696,38 +1483,52 @@ } /** - * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * - * @param nickname The collection of nickname as inScope. - * @param inScopeOption The option of in-scope. (NotNull) + * @param nicknameList The collection of nickname as notInScope. */ - public void setNickname_InScope( + public void setNickname_NotInScope(Collection nicknameList) { + regNickname(CK_NINS, cTL(nicknameList)); + } + + /** + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param nickname The value of nickname as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) + */ + public void setNickname_LikeSearch( String nickname, - jp.sf.pal.notepad.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(nickname), getCValueNickname(), - "NICKNAME", "Nickname", "nickname", inScopeOption); + jp.sf.pal.notepad.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(nickname), getCValueNickname(), "NICKNAME", + "Nickname", "nickname", likeSearchOption); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param nicknameList The collection of nickname as notInScope. + * @param nickname The value of nickname as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setNickname_NotInScope(Collection nicknameList) { - regNickname(CK_NINS, cTL(nicknameList)); + public void setNickname_NotLikeSearch( + String nickname, + jp.sf.pal.notepad.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(nickname), getCValueNickname(), "NICKNAME", + "Nickname", "nickname", likeSearchOption); } /** - * IsNull(is null). And OnceRegistered. + * IsNull(is null). And OnlyOnceRegistered. */ public void setNickname_IsNull() { regNickname(CK_ISN, DUMMY_OBJECT); } /** - * IsNotNull(is not null). And OnceRegistered. + * IsNotNull(is not null). And OnlyOnceRegistered. */ public void setNickname_IsNotNull() { regNickname(CK_ISNN, DUMMY_OBJECT); @@ -1746,7 +1547,7 @@ abstract protected ConditionValue getCValueNickname(); /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {VARCHAR(1)} + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {VARCHAR(1)} * * @param gender The value of gender as equal. */ @@ -1755,7 +1556,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param gender The value of gender as notEqual. */ @@ -1764,7 +1565,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param gender The value of gender as greaterThan. */ @@ -1773,7 +1574,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param gender The value of gender as lessThan. */ @@ -1782,7 +1583,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param gender The value of gender as greaterEqual. */ @@ -1791,7 +1592,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param gender The value of gender as lessEqual. */ @@ -1800,7 +1601,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param gender The value of gender as prefixSearch. */ @@ -1809,20 +1610,6 @@ } /** - * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, - * SeveralRegistered. - * - * @param gender The value of gender as likeSearch. - * @param likeSearchOption The option of like-search. (NotNull) - */ - public void setGender_LikeSearch( - String gender, - jp.sf.pal.notepad.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { - registerLikeSearchQuery(CK_LS, fRES(gender), getCValueGender(), - "GENDER", "Gender", "gender", likeSearchOption); - } - - /** * InScope(in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * @@ -1833,38 +1620,52 @@ } /** - * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * - * @param gender The collection of gender as inScope. - * @param inScopeOption The option of in-scope. (NotNull) + * @param genderList The collection of gender as notInScope. */ - public void setGender_InScope( + public void setGender_NotInScope(Collection genderList) { + regGender(CK_NINS, cTL(genderList)); + } + + /** + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param gender The value of gender as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) + */ + public void setGender_LikeSearch( String gender, - jp.sf.pal.notepad.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(gender), getCValueGender(), "GENDER", - "Gender", "gender", inScopeOption); + jp.sf.pal.notepad.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(gender), getCValueGender(), "GENDER", "Gender", + "gender", likeSearchOption); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param genderList The collection of gender as notInScope. + * @param gender The value of gender as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setGender_NotInScope(Collection genderList) { - regGender(CK_NINS, cTL(genderList)); + public void setGender_NotLikeSearch( + String gender, + jp.sf.pal.notepad.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(gender), getCValueGender(), "GENDER", "Gender", + "gender", likeSearchOption); } /** - * IsNull(is null). And OnceRegistered. + * IsNull(is null). And OnlyOnceRegistered. */ public void setGender_IsNull() { regGender(CK_ISN, DUMMY_OBJECT); } /** - * IsNotNull(is not null). And OnceRegistered. + * IsNotNull(is not null). And OnlyOnceRegistered. */ public void setGender_IsNotNull() { regGender(CK_ISNN, DUMMY_OBJECT); @@ -1883,7 +1684,7 @@ abstract protected ConditionValue getCValueGender(); /** - * Equal(=). And NullIgnored, OnceRegistered. {DATE} + * Equal(=). And NullIgnored, OnlyOnceRegistered. {DATE} * * @param birthDate The value of birthDate as equal. */ @@ -1892,7 +1693,7 @@ } /** - * NotEqual(!=). And NullIgnored, OnceRegistered. + * NotEqual(!=). And NullIgnored, OnlyOnceRegistered. * * @param birthDate The value of birthDate as notEqual. */ @@ -1901,7 +1702,7 @@ } /** - * GreaterThan(>). And NullIgnored, OnceRegistered. + * GreaterThan(>). And NullIgnored, OnlyOnceRegistered. * * @param birthDate The value of birthDate as greaterThan. */ @@ -1910,7 +1711,7 @@ } /** - * LessThan(>). And NullIgnored, OnceRegistered. + * LessThan(>). And NullIgnored, OnlyOnceRegistered. * * @param birthDate The value of birthDate as lessThan. */ @@ -1919,7 +1720,7 @@ } /** - * GreaterEqual(>). And NullIgnored, OnceRegistered. + * GreaterEqual(>). And NullIgnored, OnlyOnceRegistered. * * @param birthDate The value of birthDate as greaterEqual. */ @@ -1928,7 +1729,7 @@ } /** - * LessEqual(>). And NullIgnored, OnceRegistered. + * LessEqual(>). And NullIgnored, OnlyOnceRegistered. * * @param birthDate The value of birthDate as lessEqual. */ @@ -1938,7 +1739,7 @@ /** * FromTo($fromDate <= COLUMN_NAME <= $toDate). And NullIgnored, - * OnceRegistered. {DATE} + * OnlyOnceRegistered. {DATE} * * @param fromDate The from-date of birthDate. (Nullable) * @param toDate The to-date of birthDate. (Nullable) @@ -1954,7 +1755,7 @@ /** * FromTo($fromDate <= COLUMN_NAME < $toDate + 1). And NullIgnored, - * OnceRegistered. {DATE} + * OnlyOnceRegistered. {DATE} * * @param fromDate The from-date of birthDate. (Nullable) * @param toDate The to-date of birthDate. (Nullable) @@ -1968,14 +1769,14 @@ } /** - * IsNull(is null). And OnceRegistered. + * IsNull(is null). And OnlyOnceRegistered. */ public void setBirthDate_IsNull() { regBirthDate(CK_ISN, DUMMY_OBJECT); } /** - * IsNotNull(is not null). And OnceRegistered. + * IsNotNull(is not null). And OnlyOnceRegistered. */ public void setBirthDate_IsNotNull() { regBirthDate(CK_ISNN, DUMMY_OBJECT); @@ -1994,7 +1795,7 @@ abstract protected ConditionValue getCValueBirthDate(); /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {VARCHAR(255)} + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {VARCHAR(255)} * * @param email The value of email as equal. */ @@ -2003,7 +1804,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param email The value of email as notEqual. */ @@ -2012,7 +1813,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param email The value of email as greaterThan. */ @@ -2021,7 +1822,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param email The value of email as lessThan. */ @@ -2030,7 +1831,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param email The value of email as greaterEqual. */ @@ -2039,7 +1840,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param email The value of email as lessEqual. */ @@ -2048,7 +1849,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param email The value of email as prefixSearch. */ @@ -2057,20 +1858,6 @@ } /** - * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, - * SeveralRegistered. - * - * @param email The value of email as likeSearch. - * @param likeSearchOption The option of like-search. (NotNull) - */ - public void setEmail_LikeSearch( - String email, - jp.sf.pal.notepad.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { - registerLikeSearchQuery(CK_LS, fRES(email), getCValueEmail(), "EMAIL", - "Email", "email", likeSearchOption); - } - - /** * InScope(in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * @@ -2081,38 +1868,52 @@ } /** - * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * - * @param email The collection of email as inScope. - * @param inScopeOption The option of in-scope. (NotNull) + * @param emailList The collection of email as notInScope. */ - public void setEmail_InScope( + public void setEmail_NotInScope(Collection emailList) { + regEmail(CK_NINS, cTL(emailList)); + } + + /** + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param email The value of email as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) + */ + public void setEmail_LikeSearch( String email, - jp.sf.pal.notepad.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(email), getCValueEmail(), "EMAIL", - "Email", "email", inScopeOption); + jp.sf.pal.notepad.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(email), getCValueEmail(), "EMAIL", "Email", "email", + likeSearchOption); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param emailList The collection of email as notInScope. + * @param email The value of email as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setEmail_NotInScope(Collection emailList) { - regEmail(CK_NINS, cTL(emailList)); + public void setEmail_NotLikeSearch( + String email, + jp.sf.pal.notepad.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(email), getCValueEmail(), "EMAIL", "Email", + "email", likeSearchOption); } /** - * IsNull(is null). And OnceRegistered. + * IsNull(is null). And OnlyOnceRegistered. */ public void setEmail_IsNull() { regEmail(CK_ISN, DUMMY_OBJECT); } /** - * IsNotNull(is not null). And OnceRegistered. + * IsNotNull(is not null). And OnlyOnceRegistered. */ public void setEmail_IsNotNull() { regEmail(CK_ISNN, DUMMY_OBJECT); @@ -2130,7 +1931,7 @@ abstract protected ConditionValue getCValueEmail(); /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {VARCHAR(255)} + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {VARCHAR(255)} * * @param url The value of url as equal. */ @@ -2139,7 +1940,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param url The value of url as notEqual. */ @@ -2148,7 +1949,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param url The value of url as greaterThan. */ @@ -2157,7 +1958,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param url The value of url as lessThan. */ @@ -2166,7 +1967,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param url The value of url as greaterEqual. */ @@ -2175,7 +1976,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param url The value of url as lessEqual. */ @@ -2184,7 +1985,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param url The value of url as prefixSearch. */ @@ -2193,20 +1994,6 @@ } /** - * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, - * SeveralRegistered. - * - * @param url The value of url as likeSearch. - * @param likeSearchOption The option of like-search. (NotNull) - */ - public void setUrl_LikeSearch( - String url, - jp.sf.pal.notepad.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { - registerLikeSearchQuery(CK_LS, fRES(url), getCValueUrl(), "URL", "Url", - "url", likeSearchOption); - } - - /** * InScope(in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * @@ -2217,38 +2004,52 @@ } /** - * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * - * @param url The collection of url as inScope. - * @param inScopeOption The option of in-scope. (NotNull) + * @param urlList The collection of url as notInScope. */ - public void setUrl_InScope( + public void setUrl_NotInScope(Collection urlList) { + regUrl(CK_NINS, cTL(urlList)); + } + + /** + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param url The value of url as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) + */ + public void setUrl_LikeSearch( String url, - jp.sf.pal.notepad.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(url), getCValueUrl(), "URL", "Url", - "url", inScopeOption); + jp.sf.pal.notepad.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(url), getCValueUrl(), "URL", "Url", "url", + likeSearchOption); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param urlList The collection of url as notInScope. + * @param url The value of url as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setUrl_NotInScope(Collection urlList) { - regUrl(CK_NINS, cTL(urlList)); + public void setUrl_NotLikeSearch( + String url, + jp.sf.pal.notepad.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(url), getCValueUrl(), "URL", "Url", "url", + likeSearchOption); } /** - * IsNull(is null). And OnceRegistered. + * IsNull(is null). And OnlyOnceRegistered. */ public void setUrl_IsNull() { regUrl(CK_ISN, DUMMY_OBJECT); } /** - * IsNotNull(is not null). And OnceRegistered. + * IsNotNull(is not null). And OnlyOnceRegistered. */ public void setUrl_IsNotNull() { regUrl(CK_ISNN, DUMMY_OBJECT); @@ -2265,7 +2066,7 @@ abstract protected ConditionValue getCValueUrl(); /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {VARCHAR(40)} + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {VARCHAR(40)} * * @param telephone The value of telephone as equal. */ @@ -2274,7 +2075,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param telephone The value of telephone as notEqual. */ @@ -2283,7 +2084,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param telephone The value of telephone as greaterThan. */ @@ -2292,7 +2093,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param telephone The value of telephone as lessThan. */ @@ -2301,7 +2102,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param telephone The value of telephone as greaterEqual. */ @@ -2310,7 +2111,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param telephone The value of telephone as lessEqual. */ @@ -2319,7 +2120,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param telephone The value of telephone as prefixSearch. */ @@ -2328,20 +2129,6 @@ } /** - * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, - * SeveralRegistered. - * - * @param telephone The value of telephone as likeSearch. - * @param likeSearchOption The option of like-search. (NotNull) - */ - public void setTelephone_LikeSearch( - String telephone, - jp.sf.pal.notepad.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { - registerLikeSearchQuery(CK_LS, fRES(telephone), getCValueTelephone(), - "TELEPHONE", "Telephone", "telephone", likeSearchOption); - } - - /** * InScope(in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * @@ -2352,38 +2139,52 @@ } /** - * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * - * @param telephone The collection of telephone as inScope. - * @param inScopeOption The option of in-scope. (NotNull) + * @param telephoneList The collection of telephone as notInScope. */ - public void setTelephone_InScope( + public void setTelephone_NotInScope(Collection telephoneList) { + regTelephone(CK_NINS, cTL(telephoneList)); + } + + /** + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param telephone The value of telephone as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) + */ + public void setTelephone_LikeSearch( String telephone, - jp.sf.pal.notepad.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(telephone), getCValueTelephone(), - "TELEPHONE", "Telephone", "telephone", inScopeOption); + jp.sf.pal.notepad.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(telephone), getCValueTelephone(), "TELEPHONE", + "Telephone", "telephone", likeSearchOption); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param telephoneList The collection of telephone as notInScope. + * @param telephone The value of telephone as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setTelephone_NotInScope(Collection telephoneList) { - regTelephone(CK_NINS, cTL(telephoneList)); + public void setTelephone_NotLikeSearch( + String telephone, + jp.sf.pal.notepad.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(telephone), getCValueTelephone(), "TELEPHONE", + "Telephone", "telephone", likeSearchOption); } /** - * IsNull(is null). And OnceRegistered. + * IsNull(is null). And OnlyOnceRegistered. */ public void setTelephone_IsNull() { regTelephone(CK_ISN, DUMMY_OBJECT); } /** - * IsNotNull(is not null). And OnceRegistered. + * IsNotNull(is not null). And OnlyOnceRegistered. */ public void setTelephone_IsNotNull() { regTelephone(CK_ISNN, DUMMY_OBJECT); @@ -2402,7 +2203,7 @@ abstract protected ConditionValue getCValueTelephone(); /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {VARCHAR(5)} + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {VARCHAR(5)} * * @param locale The value of locale as equal. */ @@ -2411,7 +2212,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param locale The value of locale as notEqual. */ @@ -2420,7 +2221,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param locale The value of locale as greaterThan. */ @@ -2429,7 +2230,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param locale The value of locale as lessThan. */ @@ -2438,7 +2239,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param locale The value of locale as greaterEqual. */ @@ -2447,7 +2248,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param locale The value of locale as lessEqual. */ @@ -2456,7 +2257,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param locale The value of locale as prefixSearch. */ @@ -2465,20 +2266,6 @@ } /** - * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, - * SeveralRegistered. - * - * @param locale The value of locale as likeSearch. - * @param likeSearchOption The option of like-search. (NotNull) - */ - public void setLocale_LikeSearch( - String locale, - jp.sf.pal.notepad.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { - registerLikeSearchQuery(CK_LS, fRES(locale), getCValueLocale(), - "LOCALE", "Locale", "locale", likeSearchOption); - } - - /** * InScope(in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * @@ -2489,38 +2276,52 @@ } /** - * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * - * @param locale The collection of locale as inScope. - * @param inScopeOption The option of in-scope. (NotNull) + * @param localeList The collection of locale as notInScope. */ - public void setLocale_InScope( + public void setLocale_NotInScope(Collection localeList) { + regLocale(CK_NINS, cTL(localeList)); + } + + /** + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param locale The value of locale as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) + */ + public void setLocale_LikeSearch( String locale, - jp.sf.pal.notepad.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(locale), getCValueLocale(), "LOCALE", - "Locale", "locale", inScopeOption); + jp.sf.pal.notepad.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(locale), getCValueLocale(), "LOCALE", "Locale", + "locale", likeSearchOption); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param localeList The collection of locale as notInScope. + * @param locale The value of locale as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setLocale_NotInScope(Collection localeList) { - regLocale(CK_NINS, cTL(localeList)); + public void setLocale_NotLikeSearch( + String locale, + jp.sf.pal.notepad.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(locale), getCValueLocale(), "LOCALE", "Locale", + "locale", likeSearchOption); } /** - * IsNull(is null). And OnceRegistered. + * IsNull(is null). And OnlyOnceRegistered. */ public void setLocale_IsNull() { regLocale(CK_ISN, DUMMY_OBJECT); } /** - * IsNotNull(is not null). And OnceRegistered. + * IsNotNull(is not null). And OnlyOnceRegistered. */ public void setLocale_IsNotNull() { regLocale(CK_ISNN, DUMMY_OBJECT); @@ -2539,8 +2340,8 @@ abstract protected ConditionValue getCValueLocale(); /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {VARCHAR(255) : FK to - * ROLE_INFO} + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {VARCHAR(255) : FK + * to ROLE_INFO} * * @param roleId The value of roleId as equal. */ @@ -2549,7 +2350,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param roleId The value of roleId as notEqual. */ @@ -2558,7 +2359,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param roleId The value of roleId as greaterThan. */ @@ -2567,7 +2368,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param roleId The value of roleId as lessThan. */ @@ -2576,7 +2377,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param roleId The value of roleId as greaterEqual. */ @@ -2585,7 +2386,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param roleId The value of roleId as lessEqual. */ @@ -2594,7 +2395,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param roleId The value of roleId as prefixSearch. */ @@ -2603,20 +2404,6 @@ } /** - * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, - * SeveralRegistered. - * - * @param roleId The value of roleId as likeSearch. - * @param likeSearchOption The option of like-search. (NotNull) - */ - public void setRoleId_LikeSearch( - String roleId, - jp.sf.pal.notepad.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { - registerLikeSearchQuery(CK_LS, fRES(roleId), getCValueRoleId(), - "ROLE_ID", "RoleId", "roleId", likeSearchOption); - } - - /** * InScope(in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * @@ -2627,42 +2414,41 @@ } /** - * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * - * @param roleId The collection of roleId as inScope. - * @param inScopeOption The option of in-scope. (NotNull) + * @param roleIdList The collection of roleId as notInScope. */ - public void setRoleId_InScope( - String roleId, - jp.sf.pal.notepad.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(roleId), getCValueRoleId(), - "ROLE_ID", "RoleId", "roleId", inScopeOption); + public void setRoleId_NotInScope(Collection roleIdList) { + regRoleId(CK_NINS, cTL(roleIdList)); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param roleIdList The collection of roleId as notInScope. + * @param roleId The value of roleId as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) */ - public void setRoleId_NotInScope(Collection roleIdList) { - regRoleId(CK_NINS, cTL(roleIdList)); + public void setRoleId_LikeSearch( + String roleId, + jp.sf.pal.notepad.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(roleId), getCValueRoleId(), "ROLE_ID", "RoleId", + "roleId", likeSearchOption); } /** - * @param roleInfoCBquery Query. - * @deprecated Please use inScopeRoleInfo(subQuery) method. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param roleId The value of roleId as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setRoleId_InScopeSubQuery_RoleInfo(RoleInfoCQ roleInfoCBquery) { - String subQueryPropertyName = keepRoleId_InScopeSubQuery_RoleInfo(roleInfoCBquery);// for - // saving - // query - // - - // value - // . - registerInScopeSubQuery(roleInfoCBquery, "ROLE_ID", "ROLE_ID", - subQueryPropertyName); + public void setRoleId_NotLikeSearch( + String roleId, + jp.sf.pal.notepad.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(roleId), getCValueRoleId(), "ROLE_ID", "RoleId", + "roleId", likeSearchOption); } public void inScopeRoleInfo(SubQuery subQuery) { @@ -2671,23 +2457,23 @@ cb.xsetupForInScopeSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepRoleId_InScopeSubQuery_RoleInfo(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerInScopeSubQuery(cb.query(), "ROLE_ID", "ROLE_ID", subQueryPropertyName); } - abstract public String keepRoleId_InScopeSubQuery_RoleInfo( + public abstract String keepRoleId_InScopeSubQuery_RoleInfo( jp.sf.pal.notepad.db.cbean.cq.RoleInfoCQ subQuery); /** - * IsNull(is null). And OnceRegistered. + * IsNull(is null). And OnlyOnceRegistered. */ public void setRoleId_IsNull() { regRoleId(CK_ISN, DUMMY_OBJECT); } /** - * IsNotNull(is not null). And OnceRegistered. + * IsNotNull(is not null). And OnlyOnceRegistered. */ public void setRoleId_IsNotNull() { regRoleId(CK_ISNN, DUMMY_OBJECT); @@ -2706,8 +2492,8 @@ abstract protected ConditionValue getCValueRoleId(); /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {VARCHAR(255) : FK to - * GROUP_INFO} + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {VARCHAR(255) : FK + * to GROUP_INFO} * * @param groupId The value of groupId as equal. */ @@ -2716,7 +2502,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param groupId The value of groupId as notEqual. */ @@ -2725,7 +2511,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param groupId The value of groupId as greaterThan. */ @@ -2734,7 +2520,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param groupId The value of groupId as lessThan. */ @@ -2743,7 +2529,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param groupId The value of groupId as greaterEqual. */ @@ -2752,7 +2538,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param groupId The value of groupId as lessEqual. */ @@ -2761,7 +2547,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param groupId The value of groupId as prefixSearch. */ @@ -2770,20 +2556,6 @@ } /** - * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, - * SeveralRegistered. - * - * @param groupId The value of groupId as likeSearch. - * @param likeSearchOption The option of like-search. (NotNull) - */ - public void setGroupId_LikeSearch( - String groupId, - jp.sf.pal.notepad.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { - registerLikeSearchQuery(CK_LS, fRES(groupId), getCValueGroupId(), - "GROUP_ID", "GroupId", "groupId", likeSearchOption); - } - - /** * InScope(in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * @@ -2794,43 +2566,41 @@ } /** - * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * - * @param groupId The collection of groupId as inScope. - * @param inScopeOption The option of in-scope. (NotNull) + * @param groupIdList The collection of groupId as notInScope. */ - public void setGroupId_InScope( - String groupId, - jp.sf.pal.notepad.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(groupId), getCValueGroupId(), - "GROUP_ID", "GroupId", "groupId", inScopeOption); + public void setGroupId_NotInScope(Collection groupIdList) { + regGroupId(CK_NINS, cTL(groupIdList)); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param groupIdList The collection of groupId as notInScope. + * @param groupId The value of groupId as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) */ - public void setGroupId_NotInScope(Collection groupIdList) { - regGroupId(CK_NINS, cTL(groupIdList)); + public void setGroupId_LikeSearch( + String groupId, + jp.sf.pal.notepad.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(groupId), getCValueGroupId(), "GROUP_ID", "GroupId", + "groupId", likeSearchOption); } /** - * @param groupInfoCBquery Query. - * @deprecated Please use inScopeGroupInfo(subQuery) method. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param groupId The value of groupId as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setGroupId_InScopeSubQuery_GroupInfo( - GroupInfoCQ groupInfoCBquery) { - String subQueryPropertyName = keepGroupId_InScopeSubQuery_GroupInfo(groupInfoCBquery);// for - // saving - // query - // - - // value - // . - registerInScopeSubQuery(groupInfoCBquery, "GROUP_ID", "GROUP_ID", - subQueryPropertyName); + public void setGroupId_NotLikeSearch( + String groupId, + jp.sf.pal.notepad.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(groupId), getCValueGroupId(), "GROUP_ID", + "GroupId", "groupId", likeSearchOption); } public void inScopeGroupInfo(SubQuery subQuery) { @@ -2839,23 +2609,23 @@ cb.xsetupForInScopeSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepGroupId_InScopeSubQuery_GroupInfo(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerInScopeSubQuery(cb.query(), "GROUP_ID", "GROUP_ID", subQueryPropertyName); } - abstract public String keepGroupId_InScopeSubQuery_GroupInfo( + public abstract String keepGroupId_InScopeSubQuery_GroupInfo( jp.sf.pal.notepad.db.cbean.cq.GroupInfoCQ subQuery); /** - * IsNull(is null). And OnceRegistered. + * IsNull(is null). And OnlyOnceRegistered. */ public void setGroupId_IsNull() { regGroupId(CK_ISN, DUMMY_OBJECT); } /** - * IsNotNull(is not null). And OnceRegistered. + * IsNotNull(is not null). And OnlyOnceRegistered. */ public void setGroupId_IsNotNull() { regGroupId(CK_ISNN, DUMMY_OBJECT); @@ -2874,8 +2644,145 @@ abstract protected ConditionValue getCValueGroupId(); /** - * Equal(=). And NullIgnored, OnceRegistered. {NotNull : TIMESTAMP} + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {VARCHAR(1)} * + * @param status The value of status as equal. + */ + public void setStatus_Equal(String status) { + regStatus(CK_EQ, fRES(status)); + } + + /** + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. + * + * @param status The value of status as notEqual. + */ + public void setStatus_NotEqual(String status) { + regStatus(CK_NE, fRES(status)); + } + + /** + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. + * + * @param status The value of status as greaterThan. + */ + public void setStatus_GreaterThan(String status) { + regStatus(CK_GT, fRES(status)); + } + + /** + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. + * + * @param status The value of status as lessThan. + */ + public void setStatus_LessThan(String status) { + regStatus(CK_LT, fRES(status)); + } + + /** + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. + * + * @param status The value of status as greaterEqual. + */ + public void setStatus_GreaterEqual(String status) { + regStatus(CK_GE, fRES(status)); + } + + /** + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. + * + * @param status The value of status as lessEqual. + */ + public void setStatus_LessEqual(String status) { + regStatus(CK_LE, fRES(status)); + } + + /** + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. + * + * @param status The value of status as prefixSearch. + */ + public void setStatus_PrefixSearch(String status) { + regStatus(CK_PS, fRES(status)); + } + + /** + * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NullOrEmptyElementIgnored, SeveralRegistered. + * + * @param statusList The collection of status as inScope. + */ + public void setStatus_InScope(Collection statusList) { + regStatus(CK_INS, cTL(statusList)); + } + + /** + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, + * NullOrEmptyElementIgnored, SeveralRegistered. + * + * @param statusList The collection of status as notInScope. + */ + public void setStatus_NotInScope(Collection statusList) { + regStatus(CK_NINS, cTL(statusList)); + } + + /** + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param status The value of status as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) + */ + public void setStatus_LikeSearch( + String status, + jp.sf.pal.notepad.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(status), getCValueStatus(), "STATUS", "Status", + "status", likeSearchOption); + } + + /** + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param status The value of status as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) + */ + public void setStatus_NotLikeSearch( + String status, + jp.sf.pal.notepad.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(status), getCValueStatus(), "STATUS", "Status", + "status", likeSearchOption); + } + + /** + * IsNull(is null). And OnlyOnceRegistered. + */ + public void setStatus_IsNull() { + regStatus(CK_ISN, DUMMY_OBJECT); + } + + /** + * IsNotNull(is not null). And OnlyOnceRegistered. + */ + public void setStatus_IsNotNull() { + regStatus(CK_ISNN, DUMMY_OBJECT); + } + + protected void regStatus(ConditionKey key, Object value) { + registerQuery(key, value, getCValueStatus(), "STATUS", "Status", + "status"); + } + + protected void registerInlineStatus(ConditionKey key, Object value) { + registerInlineQuery(key, value, getCValueStatus(), "STATUS", "Status", + "status"); + } + + abstract protected ConditionValue getCValueStatus(); + + /** + * Equal(=). And NullIgnored, OnlyOnceRegistered. {NotNull : TIMESTAMP} + * * @param createdTime The value of createdTime as equal. */ public void setCreatedTime_Equal(java.sql.Timestamp createdTime) { @@ -2883,7 +2790,7 @@ } /** - * NotEqual(!=). And NullIgnored, OnceRegistered. + * NotEqual(!=). And NullIgnored, OnlyOnceRegistered. * * @param createdTime The value of createdTime as notEqual. */ @@ -2892,7 +2799,7 @@ } /** - * GreaterThan(>). And NullIgnored, OnceRegistered. + * GreaterThan(>). And NullIgnored, OnlyOnceRegistered. * * @param createdTime The value of createdTime as greaterThan. */ @@ -2901,7 +2808,7 @@ } /** - * LessThan(>). And NullIgnored, OnceRegistered. + * LessThan(>). And NullIgnored, OnlyOnceRegistered. * * @param createdTime The value of createdTime as lessThan. */ @@ -2910,7 +2817,7 @@ } /** - * GreaterEqual(>). And NullIgnored, OnceRegistered. + * GreaterEqual(>). And NullIgnored, OnlyOnceRegistered. * * @param createdTime The value of createdTime as greaterEqual. */ @@ -2919,7 +2826,7 @@ } /** - * LessEqual(>). And NullIgnored, OnceRegistered. + * LessEqual(>). And NullIgnored, OnlyOnceRegistered. * * @param createdTime The value of createdTime as lessEqual. */ @@ -2929,7 +2836,7 @@ /** * FromTo($fromDate <= COLUMN_NAME <= $toDate). And NullIgnored, - * OnceRegistered. {NotNull : TIMESTAMP} + * OnlyOnceRegistered. {NotNull : TIMESTAMP} * * @param fromDate The from-date of createdTime. (Nullable) * @param toDate The to-date of createdTime. (Nullable) @@ -2947,7 +2854,7 @@ /** * FromTo($fromDate <= COLUMN_NAME < $toDate + 1). And NullIgnored, - * OnceRegistered. {NotNull : TIMESTAMP} + * OnlyOnceRegistered. {NotNull : TIMESTAMP} * * @param fromDate The from-date of createdTime. (Nullable) * @param toDate The to-date of createdTime. (Nullable) @@ -2973,7 +2880,7 @@ abstract protected ConditionValue getCValueCreatedTime(); /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {NotNull : + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {NotNull : * VARCHAR(255)} * * @param createdBy The value of createdBy as equal. @@ -2983,7 +2890,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param createdBy The value of createdBy as notEqual. */ @@ -2992,7 +2899,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param createdBy The value of createdBy as greaterThan. */ @@ -3001,7 +2908,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param createdBy The value of createdBy as lessThan. */ @@ -3010,7 +2917,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param createdBy The value of createdBy as greaterEqual. */ @@ -3019,7 +2926,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param createdBy The value of createdBy as lessEqual. */ @@ -3028,7 +2935,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param createdBy The value of createdBy as prefixSearch. */ @@ -3037,20 +2944,6 @@ } /** - * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, - * SeveralRegistered. - * - * @param createdBy The value of createdBy as likeSearch. - * @param likeSearchOption The option of like-search. (NotNull) - */ - public void setCreatedBy_LikeSearch( - String createdBy, - jp.sf.pal.notepad.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { - registerLikeSearchQuery(CK_LS, fRES(createdBy), getCValueCreatedBy(), - "CREATED_BY", "CreatedBy", "createdBy", likeSearchOption); - } - - /** * InScope(in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * @@ -3061,27 +2954,41 @@ } /** - * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * - * @param createdBy The collection of createdBy as inScope. - * @param inScopeOption The option of in-scope. (NotNull) + * @param createdByList The collection of createdBy as notInScope. */ - public void setCreatedBy_InScope( + public void setCreatedBy_NotInScope(Collection createdByList) { + regCreatedBy(CK_NINS, cTL(createdByList)); + } + + /** + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param createdBy The value of createdBy as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) + */ + public void setCreatedBy_LikeSearch( String createdBy, - jp.sf.pal.notepad.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(createdBy), getCValueCreatedBy(), - "CREATED_BY", "CreatedBy", "createdBy", inScopeOption); + jp.sf.pal.notepad.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(createdBy), getCValueCreatedBy(), "CREATED_BY", + "CreatedBy", "createdBy", likeSearchOption); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param createdByList The collection of createdBy as notInScope. + * @param createdBy The value of createdBy as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setCreatedBy_NotInScope(Collection createdByList) { - regCreatedBy(CK_NINS, cTL(createdByList)); + public void setCreatedBy_NotLikeSearch( + String createdBy, + jp.sf.pal.notepad.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(createdBy), getCValueCreatedBy(), "CREATED_BY", + "CreatedBy", "createdBy", likeSearchOption); } protected void regCreatedBy(ConditionKey key, Object value) { @@ -3097,7 +3004,7 @@ abstract protected ConditionValue getCValueCreatedBy(); /** - * Equal(=). And NullIgnored, OnceRegistered. {NotNull : TIMESTAMP} + * Equal(=). And NullIgnored, OnlyOnceRegistered. {NotNull : TIMESTAMP} * * @param updatedTime The value of updatedTime as equal. */ @@ -3106,7 +3013,7 @@ } /** - * NotEqual(!=). And NullIgnored, OnceRegistered. + * NotEqual(!=). And NullIgnored, OnlyOnceRegistered. * * @param updatedTime The value of updatedTime as notEqual. */ @@ -3115,7 +3022,7 @@ } /** - * GreaterThan(>). And NullIgnored, OnceRegistered. + * GreaterThan(>). And NullIgnored, OnlyOnceRegistered. * * @param updatedTime The value of updatedTime as greaterThan. */ @@ -3124,7 +3031,7 @@ } /** - * LessThan(>). And NullIgnored, OnceRegistered. + * LessThan(>). And NullIgnored, OnlyOnceRegistered. * * @param updatedTime The value of updatedTime as lessThan. */ @@ -3133,7 +3040,7 @@ } /** - * GreaterEqual(>). And NullIgnored, OnceRegistered. + * GreaterEqual(>). And NullIgnored, OnlyOnceRegistered. * * @param updatedTime The value of updatedTime as greaterEqual. */ @@ -3142,7 +3049,7 @@ } /** - * LessEqual(>). And NullIgnored, OnceRegistered. + * LessEqual(>). And NullIgnored, OnlyOnceRegistered. * * @param updatedTime The value of updatedTime as lessEqual. */ @@ -3152,7 +3059,7 @@ /** * FromTo($fromDate <= COLUMN_NAME <= $toDate). And NullIgnored, - * OnceRegistered. {NotNull : TIMESTAMP} + * OnlyOnceRegistered. {NotNull : TIMESTAMP} * * @param fromDate The from-date of updatedTime. (Nullable) * @param toDate The to-date of updatedTime. (Nullable) @@ -3170,7 +3077,7 @@ /** * FromTo($fromDate <= COLUMN_NAME < $toDate + 1). And NullIgnored, - * OnceRegistered. {NotNull : TIMESTAMP} + * OnlyOnceRegistered. {NotNull : TIMESTAMP} * * @param fromDate The from-date of updatedTime. (Nullable) * @param toDate The to-date of updatedTime. (Nullable) @@ -3196,7 +3103,7 @@ abstract protected ConditionValue getCValueUpdatedTime(); /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {NotNull : + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {NotNull : * VARCHAR(255)} * * @param updatedBy The value of updatedBy as equal. @@ -3206,7 +3113,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param updatedBy The value of updatedBy as notEqual. */ @@ -3215,7 +3122,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param updatedBy The value of updatedBy as greaterThan. */ @@ -3224,7 +3131,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param updatedBy The value of updatedBy as lessThan. */ @@ -3233,7 +3140,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param updatedBy The value of updatedBy as greaterEqual. */ @@ -3242,7 +3149,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param updatedBy The value of updatedBy as lessEqual. */ @@ -3251,7 +3158,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param updatedBy The value of updatedBy as prefixSearch. */ @@ -3260,20 +3167,6 @@ } /** - * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, - * SeveralRegistered. - * - * @param updatedBy The value of updatedBy as likeSearch. - * @param likeSearchOption The option of like-search. (NotNull) - */ - public void setUpdatedBy_LikeSearch( - String updatedBy, - jp.sf.pal.notepad.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { - registerLikeSearchQuery(CK_LS, fRES(updatedBy), getCValueUpdatedBy(), - "UPDATED_BY", "UpdatedBy", "updatedBy", likeSearchOption); - } - - /** * InScope(in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * @@ -3284,27 +3177,41 @@ } /** - * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * - * @param updatedBy The collection of updatedBy as inScope. - * @param inScopeOption The option of in-scope. (NotNull) + * @param updatedByList The collection of updatedBy as notInScope. */ - public void setUpdatedBy_InScope( + public void setUpdatedBy_NotInScope(Collection updatedByList) { + regUpdatedBy(CK_NINS, cTL(updatedByList)); + } + + /** + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param updatedBy The value of updatedBy as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) + */ + public void setUpdatedBy_LikeSearch( String updatedBy, - jp.sf.pal.notepad.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(updatedBy), getCValueUpdatedBy(), - "UPDATED_BY", "UpdatedBy", "updatedBy", inScopeOption); + jp.sf.pal.notepad.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(updatedBy), getCValueUpdatedBy(), "UPDATED_BY", + "UpdatedBy", "updatedBy", likeSearchOption); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param updatedByList The collection of updatedBy as notInScope. + * @param updatedBy The value of updatedBy as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setUpdatedBy_NotInScope(Collection updatedByList) { - regUpdatedBy(CK_NINS, cTL(updatedByList)); + public void setUpdatedBy_NotLikeSearch( + String updatedBy, + jp.sf.pal.notepad.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(updatedBy), getCValueUpdatedBy(), "UPDATED_BY", + "UpdatedBy", "updatedBy", likeSearchOption); } protected void regUpdatedBy(ConditionKey key, Object value) { @@ -3320,7 +3227,7 @@ abstract protected ConditionValue getCValueUpdatedBy(); /** - * Equal(=). And NullIgnored, OnceRegistered. {TIMESTAMP} + * Equal(=). And NullIgnored, OnlyOnceRegistered. {TIMESTAMP} * * @param deletedTime The value of deletedTime as equal. */ @@ -3329,7 +3236,7 @@ } /** - * NotEqual(!=). And NullIgnored, OnceRegistered. + * NotEqual(!=). And NullIgnored, OnlyOnceRegistered. * * @param deletedTime The value of deletedTime as notEqual. */ @@ -3338,7 +3245,7 @@ } /** - * GreaterThan(>). And NullIgnored, OnceRegistered. + * GreaterThan(>). And NullIgnored, OnlyOnceRegistered. * * @param deletedTime The value of deletedTime as greaterThan. */ @@ -3347,7 +3254,7 @@ } /** - * LessThan(>). And NullIgnored, OnceRegistered. + * LessThan(>). And NullIgnored, OnlyOnceRegistered. * * @param deletedTime The value of deletedTime as lessThan. */ @@ -3356,7 +3263,7 @@ } /** - * GreaterEqual(>). And NullIgnored, OnceRegistered. + * GreaterEqual(>). And NullIgnored, OnlyOnceRegistered. * * @param deletedTime The value of deletedTime as greaterEqual. */ @@ -3365,7 +3272,7 @@ } /** - * LessEqual(>). And NullIgnored, OnceRegistered. + * LessEqual(>). And NullIgnored, OnlyOnceRegistered. * * @param deletedTime The value of deletedTime as lessEqual. */ @@ -3375,7 +3282,7 @@ /** * FromTo($fromDate <= COLUMN_NAME <= $toDate). And NullIgnored, - * OnceRegistered. {TIMESTAMP} + * OnlyOnceRegistered. {TIMESTAMP} * * @param fromDate The from-date of deletedTime. (Nullable) * @param toDate The to-date of deletedTime. (Nullable) @@ -3393,7 +3300,7 @@ /** * FromTo($fromDate <= COLUMN_NAME < $toDate + 1). And NullIgnored, - * OnceRegistered. {TIMESTAMP} + * OnlyOnceRegistered. {TIMESTAMP} * * @param fromDate The from-date of deletedTime. (Nullable) * @param toDate The to-date of deletedTime. (Nullable) @@ -3407,14 +3314,14 @@ } /** - * IsNull(is null). And OnceRegistered. + * IsNull(is null). And OnlyOnceRegistered. */ public void setDeletedTime_IsNull() { regDeletedTime(CK_ISN, DUMMY_OBJECT); } /** - * IsNotNull(is not null). And OnceRegistered. + * IsNotNull(is not null). And OnlyOnceRegistered. */ public void setDeletedTime_IsNotNull() { regDeletedTime(CK_ISNN, DUMMY_OBJECT); @@ -3433,7 +3340,7 @@ abstract protected ConditionValue getCValueDeletedTime(); /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {VARCHAR(255)} + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {VARCHAR(255)} * * @param deletedBy The value of deletedBy as equal. */ @@ -3442,7 +3349,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param deletedBy The value of deletedBy as notEqual. */ @@ -3451,7 +3358,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param deletedBy The value of deletedBy as greaterThan. */ @@ -3460,7 +3367,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param deletedBy The value of deletedBy as lessThan. */ @@ -3469,7 +3376,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param deletedBy The value of deletedBy as greaterEqual. */ @@ -3478,7 +3385,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param deletedBy The value of deletedBy as lessEqual. */ @@ -3487,7 +3394,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param deletedBy The value of deletedBy as prefixSearch. */ @@ -3496,20 +3403,6 @@ } /** - * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, - * SeveralRegistered. - * - * @param deletedBy The value of deletedBy as likeSearch. - * @param likeSearchOption The option of like-search. (NotNull) - */ - public void setDeletedBy_LikeSearch( - String deletedBy, - jp.sf.pal.notepad.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { - registerLikeSearchQuery(CK_LS, fRES(deletedBy), getCValueDeletedBy(), - "DELETED_BY", "DeletedBy", "deletedBy", likeSearchOption); - } - - /** * InScope(in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * @@ -3520,38 +3413,52 @@ } /** - * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * - * @param deletedBy The collection of deletedBy as inScope. - * @param inScopeOption The option of in-scope. (NotNull) + * @param deletedByList The collection of deletedBy as notInScope. */ - public void setDeletedBy_InScope( + public void setDeletedBy_NotInScope(Collection deletedByList) { + regDeletedBy(CK_NINS, cTL(deletedByList)); + } + + /** + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param deletedBy The value of deletedBy as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) + */ + public void setDeletedBy_LikeSearch( String deletedBy, - jp.sf.pal.notepad.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(deletedBy), getCValueDeletedBy(), - "DELETED_BY", "DeletedBy", "deletedBy", inScopeOption); + jp.sf.pal.notepad.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(deletedBy), getCValueDeletedBy(), "DELETED_BY", + "DeletedBy", "deletedBy", likeSearchOption); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param deletedByList The collection of deletedBy as notInScope. + * @param deletedBy The value of deletedBy as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setDeletedBy_NotInScope(Collection deletedByList) { - regDeletedBy(CK_NINS, cTL(deletedByList)); + public void setDeletedBy_NotLikeSearch( + String deletedBy, + jp.sf.pal.notepad.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(deletedBy), getCValueDeletedBy(), "DELETED_BY", + "DeletedBy", "deletedBy", likeSearchOption); } /** - * IsNull(is null). And OnceRegistered. + * IsNull(is null). And OnlyOnceRegistered. */ public void setDeletedBy_IsNull() { regDeletedBy(CK_ISN, DUMMY_OBJECT); } /** - * IsNotNull(is not null). And OnceRegistered. + * IsNotNull(is not null). And OnlyOnceRegistered. */ public void setDeletedBy_IsNotNull() { regDeletedBy(CK_ISNN, DUMMY_OBJECT); @@ -3570,7 +3477,7 @@ abstract protected ConditionValue getCValueDeletedBy(); /** - * Equal(=). And NullIgnored, OnceRegistered. {NotNull : INTEGER} + * Equal(=). And NullIgnored, OnlyOnceRegistered. {NotNull : INTEGER} * * @param versionno The value of versionno as equal. */ @@ -3579,7 +3486,7 @@ } /** - * NotEqual(!=). And NullIgnored, OnceRegistered. + * NotEqual(!=). And NullIgnored, OnlyOnceRegistered. * * @param versionno The value of versionno as notEqual. */ @@ -3588,7 +3495,7 @@ } /** - * GreaterThan(>). And NullIgnored, OnceRegistered. + * GreaterThan(>). And NullIgnored, OnlyOnceRegistered. * * @param versionno The value of versionno as greaterThan. */ @@ -3597,7 +3504,7 @@ } /** - * LessThan(<). And NullIgnored, OnceRegistered. + * LessThan(<). And NullIgnored, OnlyOnceRegistered. * * @param versionno The value of versionno as lessThan. */ @@ -3606,7 +3513,7 @@ } /** - * GreaterEqual(>=). And NullIgnored, OnceRegistered. + * GreaterEqual(>=). And NullIgnored, OnlyOnceRegistered. * * @param versionno The value of versionno as greaterEqual. */ @@ -3615,7 +3522,7 @@ } /** - * LessEqual(<=). And NullIgnored, OnceRegistered. + * LessEqual(<=). And NullIgnored, OnlyOnceRegistered. * * @param versionno The value of versionno as lessEqual. */ @@ -3655,6 +3562,50 @@ abstract protected ConditionValue getCValueVersionno(); + public SSQFunction scalar_Equal() { + return xcreateSSQFunction("="); + } + + public SSQFunction scalar_GreaterEqual() { + return xcreateSSQFunction(">="); + } + + public SSQFunction scalar_GreaterThan() { + return xcreateSSQFunction(">"); + } + + public SSQFunction scalar_LessEqual() { + return xcreateSSQFunction("<="); + } + + public SSQFunction scalar_LessThan() { + return xcreateSSQFunction("<"); + } + + protected SSQFunction xcreateSSQFunction(final String operand) { + return new SSQFunction(new SSQSetupper() { + public void setup(String function, SubQuery subQuery) { + xscalarSubQuery(function, subQuery, operand); + } + }); + } + + protected void xscalarSubQuery(String function, + SubQuery subQuery, String operand) { + assertObjectNotNull("subQuery", subQuery); + UserInfoCB cb = new UserInfoCB(); + cb.xsetupForScalarSubQuery(); + subQuery.query(cb); + String subQueryPropertyName = keepScalarSubQuery(cb.query()); // for + // saving + // query + // -value. + registerScalarSubQuery(function, cb.query(), subQueryPropertyName, + operand); + } + + public abstract String keepScalarSubQuery(UserInfoCQ subQuery); + // Very Internal (for Suppressing Warn about 'Not Use Import') protected String getConditionBeanClassNameInternally() { return UserInfoCB.class.getName(); Modified: notepad/trunk/src/main/java/jp/sf/pal/notepad/db/cbean/cq/bs/BsGroupInfoCQ.java =================================================================== --- notepad/trunk/src/main/java/jp/sf/pal/notepad/db/cbean/cq/bs/BsGroupInfoCQ.java 2008-12-27 22:11:51 UTC (rev 1627) +++ notepad/trunk/src/main/java/jp/sf/pal/notepad/db/cbean/cq/bs/BsGroupInfoCQ.java 2008-12-27 22:13:37 UTC (rev 1628) @@ -5,6 +5,7 @@ import jp.sf.pal.notepad.db.allcommon.cbean.ConditionQuery; import jp.sf.pal.notepad.db.allcommon.cbean.cvalue.ConditionValue; import jp.sf.pal.notepad.db.allcommon.cbean.sqlclause.SqlClause; +import jp.sf.pal.notepad.db.cbean.GroupInfoCB; import jp.sf.pal.notepad.db.cbean.cq.GroupInfoCQ; import jp.sf.pal.notepad.db.cbean.cq.GroupMappingCQ; import jp.sf.pal.notepad.db.cbean.cq.UserInfoCQ; @@ -15,7 +16,6 @@ * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public class BsGroupInfoCQ extends AbstractBsGroupInfoCQ { //========================================================================== @@ -61,7 +61,7 @@ public GroupInfoCIQ on() { if (isBaseQuery(this)) { throw new UnsupportedOperationException( - "Unsupported onClause of Base Table!"); + "Unsupported on-clause for local table!"); } GroupInfoCIQ inlineQuery = inline(); inlineQuery.xsetOnClauseInline(true); @@ -219,37 +219,37 @@ return "groupId_NotExistsSubQuery_UserInfoList." + key; } - protected Map _groupId_DeriveSubQuery_GroupMappingListMap; + protected Map _groupId_DerivedReferrer_GroupMappingListMap; - public Map getGroupId_DeriveSubQuery_GroupMappingList() { - return _groupId_DeriveSubQuery_GroupMappingListMap; + public Map getGroupId_DerivedReferrer_GroupMappingList() { + return _groupId_DerivedReferrer_GroupMappingListMap; } - public String keepGroupId_DeriveSubQuery_GroupMappingList( + public String keepGroupId_DerivedReferrer_GroupMappingList( GroupMappingCQ subQuery) { - if (_groupId_DeriveSubQuery_GroupMappingListMap == null) { - _groupId_DeriveSubQuery_GroupMappingListMap = newLinkedHashMap(); + if (_groupId_DerivedReferrer_GroupMappingListMap == null) { + _groupId_DerivedReferrer_GroupMappingListMap = newLinkedHashMap(); } String key = "subQueryMapKey" - + (_groupId_DeriveSubQuery_GroupMappingListMap.size() + 1); - _groupId_DeriveSubQuery_GroupMappingListMap.put(key, subQuery); - return "groupId_DeriveSubQuery_GroupMappingList." + key; + + (_groupId_DerivedReferrer_GroupMappingListMap.size() + 1); + _groupId_DerivedReferrer_GroupMappingListMap.put(key, subQuery); + return "groupId_DerivedReferrer_GroupMappingList." + key; } - protected Map _groupId_DeriveSubQuery_UserInfoListMap; + protected Map _groupId_DerivedReferrer_UserInfoListMap; - public Map getGroupId_DeriveSubQuery_UserInfoList() { - return _groupId_DeriveSubQuery_UserInfoListMap; + public Map getGroupId_DerivedReferrer_UserInfoList() { + return _groupId_DerivedReferrer_UserInfoListMap; } - public String keepGroupId_DeriveSubQuery_UserInfoList(UserInfoCQ subQuery) { - if (_groupId_DeriveSubQuery_UserInfoListMap == null) { - _groupId_DeriveSubQuery_UserInfoListMap = newLinkedHashMap(); + public String keepGroupId_DerivedReferrer_UserInfoList(UserInfoCQ subQuery) { + if (_groupId_DerivedReferrer_UserInfoListMap == null) { + _groupId_DerivedReferrer_UserInfoListMap = newLinkedHashMap(); } String key = "subQueryMapKey" - + (_groupId_DeriveSubQuery_UserInfoListMap.size() + 1); - _groupId_DeriveSubQuery_UserInfoListMap.put(key, subQuery); - return "groupId_DeriveSubQuery_UserInfoList." + key; + + (_groupId_DerivedReferrer_UserInfoListMap.size() + 1); + _groupId_DerivedReferrer_UserInfoListMap.put(key, subQuery); + return "groupId_DerivedReferrer_UserInfoList." + key; } public BsGroupInfoCQ addOrderBy_GroupId_Asc() { @@ -564,7 +564,30 @@ // ========= // Foreign Query // ============= + //========================================================================== + // ========= + // Derived Query + // ============= + protected Map _scalarSubQueryMap; + public Map getScalarSubQuery() { + return _scalarSubQueryMap; + } + + public String keepScalarSubQuery(GroupInfoCQ subQuery) { + if (_scalarSubQueryMap == null) { + _scalarSubQueryMap = newLinkedHashMap(); + } + String key = "subQueryMapKey" + (_scalarSubQueryMap.size() + 1); + _scalarSubQueryMap.put(key, subQuery); + return "scalarSubQuery." + key; + } + + // Very Internal (for Suppressing Warn about 'Not Use Import') + protected String getConditionBeanClassNameInternally() { + return GroupInfoCB.class.getName(); + } + protected String getConditionQueryClassNameInternally() { return GroupInfoCQ.class.getName(); } Modified: notepad/trunk/src/main/java/jp/sf/pal/notepad/db/cbean/cq/bs/BsGroupMappingCQ.java =================================================================== --- notepad/trunk/src/main/java/jp/sf/pal/notepad/db/cbean/cq/bs/BsGroupMappingCQ.java 2008-12-27 22:11:51 UTC (rev 1627) +++ notepad/trunk/src/main/java/jp/sf/pal/notepad/db/cbean/cq/bs/BsGroupMappingCQ.java 2008-12-27 22:13:37 UTC (rev 1628) @@ -5,6 +5,7 @@ import jp.sf.pal.notepad.db.allcommon.cbean.ConditionQuery; import jp.sf.pal.notepad.db.allcommon.cbean.cvalue.ConditionValue; import jp.sf.pal.notepad.db.allcommon.cbean.sqlclause.SqlClause; +import jp.sf.pal.notepad.db.cbean.GroupMappingCB; import jp.sf.pal.notepad.db.cbean.cq.GroupInfoCQ; import jp.sf.pal.notepad.db.cbean.cq.GroupMappingCQ; import jp.sf.pal.notepad.db.cbean.cq.UserInfoCQ; @@ -15,7 +16,6 @@ * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public class BsGroupMappingCQ extends AbstractBsGroupMappingCQ { //========================================================================== @@ -61,7 +61,7 @@ public GroupMappingCIQ on() { if (isBaseQuery(this)) { throw new UnsupportedOperationException( - "Unsupported onClause of Base Table!"); + "Unsupported on-clause for local table!"); } GroupMappingCIQ inlineQuery = inline(); inlineQuery.xsetOnClauseInline(true); @@ -210,7 +210,6 @@ // ========= // Foreign Query // ============= - public GroupInfoCQ queryGroupInfo() { return getConditionQueryGroupInfo(); } @@ -219,20 +218,13 @@ public GroupInfoCQ getConditionQueryGroupInfo() { if (_conditionQueryGroupInfo == null) { - _conditionQueryGroupInfo = createQueryGroupInfo(); - setupOuterJoin_GroupInfo(); + _conditionQueryGroupInfo = xcreateQueryGroupInfo(); + xsetupOuterJoinGroupInfo(); } return _conditionQueryGroupInfo; } - protected void setupOuterJoin_GroupInfo() { - Map joinOnMap = newLinkedHashMap(); - joinOnMap.put(getRealColumnName("GROUP_ID"), - getConditionQueryGroupInfo().getRealColumnName("GROUP_ID")); - registerOuterJoin(getConditionQueryGroupInfo(), joinOnMap); - } - - protected GroupInfoCQ createQueryGroupInfo() { + protected GroupInfoCQ xcreateQueryGroupInfo() { String nrp = resolveNextRelationPath("GROUP_MAPPING", "groupInfo"); String jan = resolveJoinAliasName(nrp, getNextNestLevel()); GroupInfoCQ cq = new GroupInfoCQ(this, getSqlClause(), jan, @@ -242,6 +234,14 @@ return cq; } + protected void xsetupOuterJoinGroupInfo() { + GroupInfoCQ cq = getConditionQueryGroupInfo(); + Map joinOnMap = newLinkedHashMap(); + joinOnMap.put(getRealColumnName("GROUP_ID"), cq + .getRealColumnName("GROUP_ID")); + registerOuterJoin(cq, joinOnMap); + } + public boolean hasConditionQueryGroupInfo() { return _conditionQueryGroupInfo != null; } @@ -254,20 +254,13 @@ public UserInfoCQ getConditionQueryUserInfo() { if (_conditionQueryUserInfo == null) { - _conditionQueryUserInfo = createQueryUserInfo(); - setupOuterJoin_UserInfo(); + _conditionQueryUserInfo = xcreateQueryUserInfo(); + xsetupOuterJoinUserInfo(); } return _conditionQueryUserInfo; } - protected void setupOuterJoin_UserInfo() { - Map joinOnMap = newLinkedHashMap(); - joinOnMap.put(getRealColumnName("USER_ID"), getConditionQueryUserInfo() - .getRealColumnName("USER_ID")); - registerOuterJoin(getConditionQueryUserInfo(), joinOnMap); - } - - protected UserInfoCQ createQueryUserInfo() { + protected UserInfoCQ xcreateQueryUserInfo() { String nrp = resolveNextRelationPath("GROUP_MAPPING", "userInfo"); String jan = resolveJoinAliasName(nrp, getNextNestLevel()); UserInfoCQ cq = new UserInfoCQ(this, getSqlClause(), jan, @@ -277,10 +270,42 @@ return cq; } + protected void xsetupOuterJoinUserInfo() { + UserInfoCQ cq = getConditionQueryUserInfo(); + Map joinOnMap = newLinkedHashMap(); + joinOnMap.put(getRealColumnName("USER_ID"), cq + .getRealColumnName("USER_ID")); + registerOuterJoin(cq, joinOnMap); + } + public boolean hasConditionQueryUserInfo() { return _conditionQueryUserInfo != null; } + //========================================================================== + // ========= + // Derived Query + // ============= + protected Map _scalarSubQueryMap; + + public Map getScalarSubQuery() { + return _scalarSubQueryMap; + } + + public String keepScalarSubQuery(GroupMappingCQ subQuery) { + if (_scalarSubQueryMap == null) { + _scalarSubQueryMap = newLinkedHashMap(); + } + String key = "subQueryMapKey" + (_scalarSubQueryMap.size() + 1); + _scalarSubQueryMap.put(key, subQuery); + return "scalarSubQuery." + key; + } + + // Very Internal (for Suppressing Warn about 'Not Use Import') + protected String getConditionBeanClassNameInternally() { + return GroupMappingCB.class.getName(); + } + protected String getConditionQueryClassNameInternally() { return GroupMappingCQ.class.getName(); } Modified: notepad/trunk/src/main/java/jp/sf/pal/notepad/db/cbean/cq/bs/BsNotepadCQ.java =================================================================== --- notepad/trunk/src/main/java/jp/sf/pal/notepad/db/cbean/cq/bs/BsNotepadCQ.java 2008-12-27 22:11:51 UTC (rev 1627) +++ notepad/trunk/src/main/java/jp/sf/pal/notepad/db/cbean/cq/bs/BsNotepadCQ.java 2008-12-27 22:13:37 UTC (rev 1628) @@ -5,6 +5,7 @@ import jp.sf.pal.notepad.db.allcommon.cbean.ConditionQuery; import jp.sf.pal.notepad.db.allcommon.cbean.cvalue.ConditionValue; import jp.sf.pal.notepad.db.allcommon.cbean.sqlclause.SqlClause; +import jp.sf.pal.notepad.db.cbean.NotepadCB; import jp.sf.pal.notepad.db.cbean.cq.NotepadCQ; import jp.sf.pal.notepad.db.cbean.cq.NotepadCategoryCQ; import jp.sf.pal.notepad.db.cbean.cq.NotepadContentCQ; @@ -16,7 +17,6 @@ * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public class BsNotepadCQ extends AbstractBsNotepadCQ { //========================================================================== @@ -62,7 +62,7 @@ public NotepadCIQ on() { if (isBaseQuery(this)) { throw new UnsupportedOperationException( - "Unsupported onClause of Base Table!"); + "Unsupported on-clause for local table!"); } NotepadCIQ inlineQuery = inline(); inlineQuery.xsetOnClauseInline(true); @@ -494,7 +494,6 @@ // ========= // Foreign Query // ============= - public NotepadCategoryCQ queryNotepadCategory() { return getConditionQueryNotepadCategory(); } @@ -503,20 +502,13 @@ public NotepadCategoryCQ getConditionQueryNotepadCategory() { if (_conditionQueryNotepadCategory == null) { - _conditionQueryNotepadCategory = createQueryNotepadCategory(); - setupOuterJoin_NotepadCategory(); + _conditionQueryNotepadCategory = xcreateQueryNotepadCategory(); + xsetupOuterJoinNotepadCategory(); } return _conditionQueryNotepadCategory; } - protected void setupOuterJoin_NotepadCategory() { - Map joinOnMap = newLinkedHashMap(); - joinOnMap.put(getRealColumnName("CATEGORY_ID"), - getConditionQueryNotepadCategory().getRealColumnName("ID")); - registerOuterJoin(getConditionQueryNotepadCategory(), joinOnMap); - } - - protected NotepadCategoryCQ createQueryNotepadCategory() { + protected NotepadCategoryCQ xcreateQueryNotepadCategory() { String nrp = resolveNextRelationPath("NOTEPAD", "notepadCategory"); String jan = resolveJoinAliasName(nrp, getNextNestLevel()); NotepadCategoryCQ cq = new NotepadCategoryCQ(this, getSqlClause(), jan, @@ -526,6 +518,14 @@ return cq; } + protected void xsetupOuterJoinNotepadCategory() { + NotepadCategoryCQ cq = getConditionQueryNotepadCategory(); + Map joinOnMap = newLinkedHashMap(); + joinOnMap.put(getRealColumnName("CATEGORY_ID"), cq + .getRealColumnName("ID")); + registerOuterJoin(cq, joinOnMap); + } + public boolean hasConditionQueryNotepadCategory() { return _conditionQueryNotepadCategory != null; } @@ -538,21 +538,13 @@ public UserInfoCQ getConditionQueryUserInfoByCreatedBy() { if (_conditionQueryUserInfoByCreatedBy == null) { - _conditionQueryUserInfoByCreatedBy = createQueryUserInfoByCreatedBy(); - setupOuterJoin_UserInfoByCreatedBy(); + _conditionQueryUserInfoByCreatedBy = xcreateQueryUserInfoByCreatedBy(); + xsetupOuterJoinUserInfoByCreatedBy(); } return _conditionQueryUserInfoByCreatedBy; } - protected void setupOuterJoin_UserInfoByCreatedBy() { - Map joinOnMap = newLinkedHashMap(); - joinOnMap.put(getRealColumnName("CREATED_BY"), - getConditionQueryUserInfoByCreatedBy().getRealColumnName( - "USER_ID")); - registerOuterJoin(getConditionQueryUserInfoByCreatedBy(), joinOnMap); - } - - protected UserInfoCQ createQueryUserInfoByCreatedBy() { + protected UserInfoCQ xcreateQueryUserInfoByCreatedBy() { String nrp = resolveNextRelationPath("NOTEPAD", "userInfoByCreatedBy"); String jan = resolveJoinAliasName(nrp, getNextNestLevel()); UserInfoCQ cq = new UserInfoCQ(this, getSqlClause(), jan, @@ -562,6 +554,14 @@ return cq; } + protected void xsetupOuterJoinUserInfoByCreatedBy() { + UserInfoCQ cq = getConditionQueryUserInfoByCreatedBy(); + Map joinOnMap = newLinkedHashMap(); + joinOnMap.put(getRealColumnName("CREATED_BY"), cq + .getRealColumnName("USER_ID")); + registerOuterJoin(cq, joinOnMap); + } + public boolean hasConditionQueryUserInfoByCreatedBy() { return _conditionQueryUserInfoByCreatedBy != null; } @@ -574,21 +574,13 @@ public UserInfoCQ getConditionQueryUserInfoByUpdatedBy() { if (_conditionQueryUserInfoByUpdatedBy == null) { - _conditionQueryUserInfoByUpdatedBy = createQueryUserInfoByUpdatedBy(); - setupOuterJoin_UserInfoByUpdatedBy(); + _conditionQueryUserInfoByUpdatedBy = xcreateQueryUserInfoByUpdatedBy(); + xsetupOuterJoinUserInfoByUpdatedBy(); } return _conditionQueryUserInfoByUpdatedBy; } - protected void setupOuterJoin_UserInfoByUpdatedBy() { - Map joinOnMap = newLinkedHashMap(); - joinOnMap.put(getRealColumnName("UPDATED_BY"), - getConditionQueryUserInfoByUpdatedBy().getRealColumnName( - "USER_ID")); - registerOuterJoin(getConditionQueryUserInfoByUpdatedBy(), joinOnMap); - } - - protected UserInfoCQ createQueryUserInfoByUpdatedBy() { + protected UserInfoCQ xcreateQueryUserInfoByUpdatedBy() { String nrp = resolveNextRelationPath("NOTEPAD", "userInfoByUpdatedBy"); String jan = resolveJoinAliasName(nrp, getNextNestLevel()); UserInfoCQ cq = new UserInfoCQ(this, getSqlClause(), jan, @@ -598,6 +590,14 @@ return cq; } + protected void xsetupOuterJoinUserInfoByUpdatedBy() { + UserInfoCQ cq = getConditionQueryUserInfoByUpdatedBy(); + Map joinOnMap = newLinkedHashMap(); + joinOnMap.put(getRealColumnName("UPDATED_BY"), cq + .getRealColumnName("USER_ID")); + registerOuterJoin(cq, joinOnMap); + } + public boolean hasConditionQueryUserInfoByUpdatedBy() { return _conditionQueryUserInfoByUpdatedBy != null; } @@ -610,20 +610,13 @@ public NotepadContentCQ getConditionQueryNotepadContentAsOne() { if (_conditionQueryNotepadContentAsOne == null) { - _conditionQueryNotepadContentAsOne = createQueryNotepadContentAsOne(); - setupOuterJoin_NotepadContentAsOne(); + _conditionQueryNotepadContentAsOne = xcreateQueryNotepadContentAsOne(); + xsetupOuterJoinNotepadContentAsOne(); } return _conditionQueryNotepadContentAsOne; } - protected void setupOuterJoin_NotepadContentAsOne() { - Map joinOnMap = newLinkedHashMap(); - joinOnMap.put(getRealColumnName("ID"), - getConditionQueryNotepadContentAsOne().getRealColumnName("ID")); - registerOuterJoin(getConditionQueryNotepadContentAsOne(), joinOnMap); - } - - protected NotepadContentCQ createQueryNotepadContentAsOne() { + protected NotepadContentCQ xcreateQueryNotepadContentAsOne() { String nrp = resolveNextRelationPath("NOTEPAD", "notepadContentAsOne"); String jan = resolveJoinAliasName(nrp, getNextNestLevel()); NotepadContentCQ cq = new NotepadContentCQ(this, getSqlClause(), jan, @@ -633,10 +626,41 @@ return cq; } + protected void xsetupOuterJoinNotepadContentAsOne() { + NotepadContentCQ cq = getConditionQueryNotepadContentAsOne(); + Map joinOnMap = newLinkedHashMap(); + joinOnMap.put(getRealColumnName("ID"), cq.getRealColumnName("ID")); + registerOuterJoin(cq, joinOnMap); + } + public boolean hasConditionQueryNotepadContentAsOne() { return _conditionQueryNotepadContentAsOne != null; } + //========================================================================== + // ========= + // Derived Query + // ============= + protected Map _scalarSubQueryMap; + + public Map getScalarSubQuery() { + return _scalarSubQueryMap; + } + + public String keepScalarSubQuery(NotepadCQ subQuery) { + if (_scalarSubQueryMap == null) { + _scalarSubQueryMap = newLinkedHashMap(); + } + String key = "subQueryMapKey" + (_scalarSubQueryMap.size() + 1); + _scalarSubQueryMap.put(key, subQuery); + return "scalarSubQuery." + key; + } + + // Very Internal (for Suppressing Warn about 'Not Use Import') + protected String getConditionBeanClassNameInternally() { + return NotepadCB.class.getName(); + } + protected String getConditionQueryClassNameInternally() { return NotepadCQ.class.getName(); } Modified: notepad/trunk/src/main/java/jp/sf/pal/notepad/db/cbean/cq/bs/BsNotepadCategoryCQ.java =================================================================== --- notepad/trunk/src/main/java/jp/sf/pal/notepad/db/cbean/cq/bs/BsNotepadCategoryCQ.java 2008-12-27 22:11:51 UTC (rev 1627) +++ notepad/trunk/src/main/java/jp/sf/pal/notepad/db/cbean/cq/bs/BsNotepadCategoryCQ.java 2008-12-27 22:13:37 UTC (rev 1628) @@ -5,6 +5,7 @@ import jp.sf.pal.notepad.db.allcommon.cbean.ConditionQuery; import jp.sf.pal.notepad.db.allcommon.cbean.cvalue.ConditionValue; import jp.sf.pal.notepad.db.allcommon.cbean.sqlclause.SqlClause; +import jp.sf.pal.notepad.db.cbean.NotepadCategoryCB; import jp.sf.pal.notepad.db.cbean.cq.NotepadCQ; import jp.sf.pal.notepad.db.cbean.cq.NotepadCategoryCQ; import jp.sf.pal.notepad.db.cbean.cq.UserInfoCQ; @@ -15,7 +16,6 @@ * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public class BsNotepadCategoryCQ extends AbstractBsNotepadCategoryCQ { //========================================================================== @@ -61,7 +61,7 @@ public NotepadCategoryCIQ on() { if (isBaseQuery(this)) { throw new UnsupportedOperationException( - "Unsupported onClause of Base Table!"); + "Unsupported on-clause for local table!"); } NotepadCategoryCIQ inlineQuery = inline(); inlineQuery.xsetOnClauseInline(true); @@ -150,20 +150,20 @@ return "id_NotExistsSubQuery_NotepadList." + key; } - protected Map _id_DeriveSubQuery_NotepadListMap; + protected Map _id_DerivedReferrer_NotepadListMap; - public Map getId_DeriveSubQuery_NotepadList() { - return _id_DeriveSubQuery_NotepadListMap; + public Map getId_DerivedReferrer_NotepadList() { + return _id_DerivedReferrer_NotepadListMap; } - public String keepId_DeriveSubQuery_NotepadList(NotepadCQ subQuery) { - if (_id_DeriveSubQuery_NotepadListMap == null) { - _id_DeriveSubQuery_NotepadListMap = newLinkedHashMap(); + public String keepId_DerivedReferrer_NotepadList(NotepadCQ subQuery) { + if (_id_DerivedReferrer_NotepadListMap == null) { + _id_DerivedReferrer_NotepadListMap = newLinkedHashMap(); } String key = "subQueryMapKey" - + (_id_DeriveSubQuery_NotepadListMap.size() + 1); - _id_DeriveSubQuery_NotepadListMap.put(key, subQuery); - return "id_DeriveSubQuery_NotepadList." + key; + + (_id_DerivedReferrer_NotepadListMap.size() + 1); + _id_DerivedReferrer_NotepadListMap.put(key, subQuery); + return "id_DerivedReferrer_NotepadList." + key; } public BsNotepadCategoryCQ addOrderBy_Id_Asc() { @@ -478,7 +478,6 @@ // ========= // Foreign Query // ============= - public UserInfoCQ queryUserInfoByCreatedBy() { return getConditionQueryUserInfoByCreatedBy(); } @@ -487,21 +486,13 @@ public UserInfoCQ getConditionQueryUserInfoByCreatedBy() { if (_conditionQueryUserInfoByCreatedBy == null) { - _conditionQueryUserInfoByCreatedBy = createQueryUserInfoByCreatedBy(); - setupOuterJoin_UserInfoByCreatedBy(); + _conditionQueryUserInfoByCreatedBy = xcreateQueryUserInfoByCreatedBy(); + xsetupOuterJoinUserInfoByCreatedBy(); } return _conditionQueryUserInfoByCreatedBy; } - protected void setupOuterJoin_UserInfoByCreatedBy() { - Map joinOnMap = newLinkedHashMap(); - joinOnMap.put(getRealColumnName("CREATED_BY"), - getConditionQueryUserInfoByCreatedBy().getRealColumnName( - "USER_ID")); - registerOuterJoin(getConditionQueryUserInfoByCreatedBy(), joinOnMap); - } - - protected UserInfoCQ createQueryUserInfoByCreatedBy() { + protected UserInfoCQ xcreateQueryUserInfoByCreatedBy() { String nrp = resolveNextRelationPath("NOTEPAD_CATEGORY", "userInfoByCreatedBy"); String jan = resolveJoinAliasName(nrp, getNextNestLevel()); @@ -512,6 +503,14 @@ return cq; } + protected void xsetupOuterJoinUserInfoByCreatedBy() { + UserInfoCQ cq = getConditionQueryUserInfoByCreatedBy(); + Map joinOnMap = newLinkedHashMap(); + joinOnMap.put(getRealColumnName("CREATED_BY"), cq + .getRealColumnName("USER_ID")); + registerOuterJoin(cq, joinOnMap); + } + public boolean hasConditionQueryUserInfoByCreatedBy() { return _conditionQueryUserInfoByCreatedBy != null; } @@ -524,21 +523,13 @@ public UserInfoCQ getConditionQueryUserInfoByUpdatedBy() { if (_conditionQueryUserInfoByUpdatedBy == null) { - _conditionQueryUserInfoByUpdatedBy = createQueryUserInfoByUpdatedBy(); - setupOuterJoin_UserInfoByUpdatedBy(); + _conditionQueryUserInfoByUpdatedBy = xcreateQueryUserInfoByUpdatedBy(); + xsetupOuterJoinUserInfoByUpdatedBy(); } return _conditionQueryUserInfoByUpdatedBy; } - protected void setupOuterJoin_UserInfoByUpdatedBy() { - Map joinOnMap = newLinkedHashMap(); - joinOnMap.put(getRealColumnName("UPDATED_BY"), - getConditionQueryUserInfoByUpdatedBy().getRealColumnName( - "USER_ID")); - registerOuterJoin(getConditionQueryUserInfoByUpdatedBy(), joinOnMap); - } - - protected UserInfoCQ createQueryUserInfoByUpdatedBy() { + protected UserInfoCQ xcreateQueryUserInfoByUpdatedBy() { String nrp = resolveNextRelationPath("NOTEPAD_CATEGORY", "userInfoByUpdatedBy"); String jan = resolveJoinAliasName(nrp, getNextNestLevel()); @@ -549,10 +540,42 @@ return cq; } + protected void xsetupOuterJoinUserInfoByUpdatedBy() { + UserInfoCQ cq = getConditionQueryUserInfoByUpdatedBy(); + Map joinOnMap = newLinkedHashMap(); + joinOnMap.put(getRealColumnName("UPDATED_BY"), cq + .getRealColumnName("USER_ID")); + registerOuterJoin(cq, joinOnMap); + } + public boolean hasConditionQueryUserInfoByUpdatedBy() { return _conditionQueryUserInfoByUpdatedBy != null; } + //========================================================================== + // ========= + // Derived Query + // ============= + protected Map _scalarSubQueryMap; + + public Map getScalarSubQuery() { + return _scalarSubQueryMap; + } + + public String keepScalarSubQuery(NotepadCategoryCQ subQuery) { + if (_scalarSubQueryMap == null) { + _scalarSubQueryMap = newLinkedHashMap(); + } + String key = "subQueryMapKey" + (_scalarSubQueryMap.size() + 1); + _scalarSubQueryMap.put(key, subQuery); + return "scalarSubQuery." + key; + } + + // Very Internal (for Suppressing Warn about 'Not Use Import') + protected String getConditionBeanClassNameInternally() { + return NotepadCategoryCB.class.getName(); + } + protected String getConditionQueryClassNameInternally() { return NotepadCategoryCQ.class.getName(); } Modified: notepad/trunk/src/main/java/jp/sf/pal/notepad/db/cbean/cq/bs/BsNotepadContentCQ.java =================================================================== --- notepad/trunk/src/main/java/jp/sf/pal/notepad/db/cbean/cq/bs/BsNotepadContentCQ.java 2008-12-27 22:11:51 UTC (rev 1627) +++ notepad/trunk/src/main/java/jp/sf/pal/notepad/db/cbean/cq/bs/BsNotepadContentCQ.java 2008-12-27 22:13:37 UTC (rev 1628) @@ -5,6 +5,7 @@ import jp.sf.pal.notepad.db.allcommon.cbean.ConditionQuery; import jp.sf.pal.notepad.db.allcommon.cbean.cvalue.ConditionValue; import jp.sf.pal.notepad.db.allcommon.cbean.sqlclause.SqlClause; +import jp.sf.pal.notepad.db.cbean.NotepadContentCB; import jp.sf.pal.notepad.db.cbean.cq.NotepadCQ; import jp.sf.pal.notepad.db.cbean.cq.NotepadContentCQ; import jp.sf.pal.notepad.db.cbean.cq.ciq.NotepadContentCIQ; @@ -14,7 +15,6 @@ * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public class BsNotepadContentCQ extends AbstractBsNotepadContentCQ { //========================================================================== @@ -60,7 +60,7 @@ public NotepadContentCIQ on() { if (isBaseQuery(this)) { throw new UnsupportedOperationException( - "Unsupported onClause of Base Table!"); + "Unsupported on-clause for local table!"); } NotepadContentCIQ inlineQuery = inline(); inlineQuery.xsetOnClauseInline(true); @@ -166,7 +166,6 @@ // ========= // Foreign Query // ============= - public NotepadCQ queryNotepad() { return getConditionQueryNotepad(); } @@ -175,20 +174,13 @@ public NotepadCQ getConditionQueryNotepad() { if (_conditionQueryNotepad == null) { - _conditionQueryNotepad = createQueryNotepad(); - setupOuterJoin_Notepad(); + _conditionQueryNotepad = xcreateQueryNotepad(); + xsetupOuterJoinNotepad(); } return _conditionQueryNotepad; } - protected void setupOuterJoin_Notepad() { - Map joinOnMap = newLinkedHashMap(); - joinOnMap.put(getRealColumnName("ID"), getConditionQueryNotepad() - .getRealColumnName("ID")); - registerOuterJoin(getConditionQueryNotepad(), joinOnMap); - } - - protected NotepadCQ createQueryNotepad() { + protected NotepadCQ xcreateQueryNotepad() { String nrp = resolveNextRelationPath("NOTEPAD_CONTENT", "notepad"); String jan = resolveJoinAliasName(nrp, getNextNestLevel()); NotepadCQ cq = new NotepadCQ(this, getSqlClause(), jan, @@ -198,10 +190,41 @@ return cq; } + protected void xsetupOuterJoinNotepad() { + NotepadCQ cq = getConditionQueryNotepad(); + Map joinOnMap = newLinkedHashMap(); + joinOnMap.put(getRealColumnName("ID"), cq.getRealColumnName("ID")); + registerOuterJoin(cq, joinOnMap); + } + public boolean hasConditionQueryNotepad() { return _conditionQueryNotepad != null; } + //========================================================================== + // ========= + // Derived Query + // ============= + protected Map _scalarSubQueryMap; + + public Map getScalarSubQuery() { + return _scalarSubQueryMap; + } + + public String keepScalarSubQuery(NotepadContentCQ subQuery) { + if (_scalarSubQueryMap == null) { + _scalarSubQueryMap = newLinkedHashMap(); + } + String key = "subQueryMapKey" + (_scalarSubQueryMap.size() + 1); + _scalarSubQueryMap.put(key, subQuery); + return "scalarSubQuery." + key; + } + + // Very Internal (for Suppressing Warn about 'Not Use Import') + protected String getConditionBeanClassNameInternally() { + return NotepadContentCB.class.getName(); + } + protected String getConditionQueryClassNameInternally() { return NotepadContentCQ.class.getName(); } Modified: notepad/trunk/src/main/java/jp/sf/pal/notepad/db/cbean/cq/bs/BsRoleInfoCQ.java =================================================================== --- notepad/trunk/src/main/java/jp/sf/pal/notepad/db/cbean/cq/bs/BsRoleInfoCQ.java 2008-12-27 22:11:51 UTC (rev 1627) +++ notepad/trunk/src/main/java/jp/sf/pal/notepad/db/cbean/cq/bs/BsRoleInfoCQ.java 2008-12-27 22:13:37 UTC (rev 1628) @@ -5,6 +5,7 @@ import jp.sf.pal.notepad.db.allcommon.cbean.ConditionQuery; import jp.sf.pal.notepad.db.allcommon.cbean.cvalue.ConditionValue; import jp.sf.pal.notepad.db.allcommon.cbean.sqlclause.SqlClause; +import jp.sf.pal.notepad.db.cbean.RoleInfoCB; import jp.sf.pal.notepad.db.cbean.cq.RoleInfoCQ; import jp.sf.pal.notepad.db.cbean.cq.RoleMappingCQ; import jp.sf.pal.notepad.db.cbean.cq.UserInfoCQ; @@ -15,7 +16,6 @@ * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public class BsRoleInfoCQ extends AbstractBsRoleInfoCQ { //========================================================================== @@ -61,7 +61,7 @@ public RoleInfoCIQ on() { if (isBaseQuery(this)) { throw new UnsupportedOperationException( - "Unsupported onClause of Base Table!"); + "Unsupported on-clause for local table!"); } RoleInfoCIQ inlineQuery = inline(); inlineQuery.xsetOnClauseInline(true); @@ -218,37 +218,37 @@ return "roleId_NotExistsSubQuery_UserInfoList." + key; } - protected Map _roleId_DeriveSubQuery_RoleMappingListMap; + protected Map _roleId_DerivedReferrer_RoleMappingListMap; - public Map getRoleId_DeriveSubQuery_RoleMappingList() { - return _roleId_DeriveSubQuery_RoleMappingListMap; + public Map getRoleId_DerivedReferrer_RoleMappingList() { + return _roleId_DerivedReferrer_RoleMappingListMap; } - public String keepRoleId_DeriveSubQuery_RoleMappingList( + public String keepRoleId_DerivedReferrer_RoleMappingList( RoleMappingCQ subQuery) { - if (_roleId_DeriveSubQuery_RoleMappingListMap == null) { - _roleId_DeriveSubQuery_RoleMappingListMap = newLinkedHashMap(); + if (_roleId_DerivedReferrer_RoleMappingListMap == null) { + _roleId_DerivedReferrer_RoleMappingListMap = newLinkedHashMap(); } String key = "subQueryMapKey" - + (_roleId_DeriveSubQuery_RoleMappingListMap.size() + 1); - _roleId_DeriveSubQuery_RoleMappingListMap.put(key, subQuery); - return "roleId_DeriveSubQuery_RoleMappingList." + key; + + (_roleId_DerivedReferrer_RoleMappingListMap.size() + 1); + _roleId_DerivedReferrer_RoleMappingListMap.put(key, subQuery); + return "roleId_DerivedReferrer_RoleMappingList." + key; } - protected Map _roleId_DeriveSubQuery_UserInfoListMap; + protected Map _roleId_DerivedReferrer_UserInfoListMap; - public Map getRoleId_DeriveSubQuery_UserInfoList() { - return _roleId_DeriveSubQuery_UserInfoListMap; + public Map getRoleId_DerivedReferrer_UserInfoList() { + return _roleId_DerivedReferrer_UserInfoListMap; } - public String keepRoleId_DeriveSubQuery_UserInfoList(UserInfoCQ subQuery) { - if (_roleId_DeriveSubQuery_UserInfoListMap == null) { - _roleId_DeriveSubQuery_UserInfoListMap = newLinkedHashMap(); + public String keepRoleId_DerivedReferrer_UserInfoList(UserInfoCQ subQuery) { + if (_roleId_DerivedReferrer_UserInfoListMap == null) { + _roleId_DerivedReferrer_UserInfoListMap = newLinkedHashMap(); } String key = "subQueryMapKey" - + (_roleId_DeriveSubQuery_UserInfoListMap.size() + 1); - _roleId_DeriveSubQuery_UserInfoListMap.put(key, subQuery); - return "roleId_DeriveSubQuery_UserInfoList." + key; + + (_roleId_DerivedReferrer_UserInfoListMap.size() + 1); + _roleId_DerivedReferrer_UserInfoListMap.put(key, subQuery); + return "roleId_DerivedReferrer_UserInfoList." + key; } public BsRoleInfoCQ addOrderBy_RoleId_Asc() { @@ -563,7 +563,30 @@ // ========= // Foreign Query // ============= + //========================================================================== + // ========= + // Derived Query + // ============= + protected Map _scalarSubQueryMap; + public Map getScalarSubQuery() { + return _scalarSubQueryMap; + } + + public String keepScalarSubQuery(RoleInfoCQ subQuery) { + if (_scalarSubQueryMap == null) { + _scalarSubQueryMap = newLinkedHashMap(); + } + String key = "subQueryMapKey" + (_scalarSubQueryMap.size() + 1); + _scalarSubQueryMap.put(key, subQuery); + return "scalarSubQuery." + key; + } + + // Very Internal (for Suppressing Warn about 'Not Use Import') + protected String getConditionBeanClassNameInternally() { + return RoleInfoCB.class.getName(); + } + protected String getConditionQueryClassNameInternally() { return RoleInfoCQ.class.getName(); } Modified: notepad/trunk/src/main/java/jp/sf/pal/notepad/db/cbean/cq/bs/BsRoleMappingCQ.java =================================================================== --- notepad/trunk/src/main/java/jp/sf/pal/notepad/db/cbean/cq/bs/BsRoleMappingCQ.java 2008-12-27 22:11:51 UTC (rev 1627) +++ notepad/trunk/src/main/java/jp/sf/pal/notepad/db/cbean/cq/bs/BsRoleMappingCQ.java 2008-12-27 22:13:37 UTC (rev 1628) @@ -5,6 +5,7 @@ import jp.sf.pal.notepad.db.allcommon.cbean.ConditionQuery; import jp.sf.pal.notepad.db.allcommon.cbean.cvalue.ConditionValue; import jp.sf.pal.notepad.db.allcommon.cbean.sqlclause.SqlClause; +import jp.sf.pal.notepad.db.cbean.RoleMappingCB; import jp.sf.pal.notepad.db.cbean.cq.RoleInfoCQ; import jp.sf.pal.notepad.db.cbean.cq.RoleMappingCQ; import jp.sf.pal.notepad.db.cbean.cq.UserInfoCQ; @@ -15,7 +16,6 @@ * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public class BsRoleMappingCQ extends AbstractBsRoleMappingCQ { //========================================================================== @@ -61,7 +61,7 @@ public RoleMappingCIQ on() { if (isBaseQuery(this)) { throw new UnsupportedOperationException( - "Unsupported onClause of Base Table!"); + "Unsupported on-clause for local table!"); } RoleMappingCIQ inlineQuery = inline(); inlineQuery.xsetOnClauseInline(true); @@ -210,7 +210,6 @@ // ========= // Foreign Query // ============= - public RoleInfoCQ queryRoleInfo() { return getConditionQueryRoleInfo(); } @@ -219,20 +218,13 @@ public RoleInfoCQ getConditionQueryRoleInfo() { if (_conditionQueryRoleInfo == null) { - _conditionQueryRoleInfo = createQueryRoleInfo(); - setupOuterJoin_RoleInfo(); + _conditionQueryRoleInfo = xcreateQueryRoleInfo(); + xsetupOuterJoinRoleInfo(); } return _conditionQueryRoleInfo; } - protected void setupOuterJoin_RoleInfo() { - Map joinOnMap = newLinkedHashMap(); - joinOnMap.put(getRealColumnName("ROLE_ID"), getConditionQueryRoleInfo() - .getRealColumnName("ROLE_ID")); - registerOuterJoin(getConditionQueryRoleInfo(), joinOnMap); - } - - protected RoleInfoCQ createQueryRoleInfo() { + protected RoleInfoCQ xcreateQueryRoleInfo() { String nrp = resolveNextRelationPath("ROLE_MAPPING", "roleInfo"); String jan = resolveJoinAliasName(nrp, getNextNestLevel()); RoleInfoCQ cq = new RoleInfoCQ(this, getSqlClause(), jan, @@ -242,6 +234,14 @@ return cq; } + protected void xsetupOuterJoinRoleInfo() { + RoleInfoCQ cq = getConditionQueryRoleInfo(); + Map joinOnMap = newLinkedHashMap(); + joinOnMap.put(getRealColumnName("ROLE_ID"), cq + .getRealColumnName("ROLE_ID")); + registerOuterJoin(cq, joinOnMap); + } + public boolean hasConditionQueryRoleInfo() { return _conditionQueryRoleInfo != null; } @@ -254,20 +254,13 @@ public UserInfoCQ getConditionQueryUserInfo() { if (_conditionQueryUserInfo == null) { - _conditionQueryUserInfo = createQueryUserInfo(); - setupOuterJoin_UserInfo(); + _conditionQueryUserInfo = xcreateQueryUserInfo(); + xsetupOuterJoinUserInfo(); } return _conditionQueryUserInfo; } - protected void setupOuterJoin_UserInfo() { - Map joinOnMap = newLinkedHashMap(); - joinOnMap.put(getRealColumnName("USER_ID"), getConditionQueryUserInfo() - .getRealColumnName("USER_ID")); - registerOuterJoin(getConditionQueryUserInfo(), joinOnMap); - } - - protected UserInfoCQ createQueryUserInfo() { + protected UserInfoCQ xcreateQueryUserInfo() { String nrp = resolveNextRelationPath("ROLE_MAPPING", "userInfo"); String jan = resolveJoinAliasName(nrp, getNextNestLevel()); UserInfoCQ cq = new UserInfoCQ(this, getSqlClause(), jan, @@ -277,10 +270,42 @@ return cq; } + protected void xsetupOuterJoinUserInfo() { + UserInfoCQ cq = getConditionQueryUserInfo(); + Map joinOnMap = newLinkedHashMap(); + joinOnMap.put(getRealColumnName("USER_ID"), cq + .getRealColumnName("USER_ID")); + registerOuterJoin(cq, joinOnMap); + } + public boolean hasConditionQueryUserInfo() { return _conditionQueryUserInfo != null; } + //========================================================================== + // ========= + // Derived Query + // ============= + protected Map _scalarSubQueryMap; + + public Map getScalarSubQuery() { + return _scalarSubQueryMap; + } + + public String keepScalarSubQuery(RoleMappingCQ subQuery) { + if (_scalarSubQueryMap == null) { + _scalarSubQueryMap = newLinkedHashMap(); + } + String key = "subQueryMapKey" + (_scalarSubQueryMap.size() + 1); + _scalarSubQueryMap.put(key, subQuery); + return "scalarSubQuery." + key; + } + + // Very Internal (for Suppressing Warn about 'Not Use Import') + protected String getConditionBeanClassNameInternally() { + return RoleMappingCB.class.getName(); + } + protected String getConditionQueryClassNameInternally() { return RoleMappingCQ.class.getName(); } Modified: notepad/trunk/src/main/java/jp/sf/pal/notepad/db/cbean/cq/bs/BsUserInfoCQ.java =================================================================== --- notepad/trunk/src/main/java/jp/sf/pal/notepad/db/cbean/cq/bs/BsUserInfoCQ.java 2008-12-27 22:11:51 UTC (rev 1627) +++ notepad/trunk/src/main/java/jp/sf/pal/notepad/db/cbean/cq/bs/BsUserInfoCQ.java 2008-12-27 22:13:37 UTC (rev 1628) @@ -5,6 +5,7 @@ import jp.sf.pal.notepad.db.allcommon.cbean.ConditionQuery; import jp.sf.pal.notepad.db.allcommon.cbean.cvalue.ConditionValue; import jp.sf.pal.notepad.db.allcommon.cbean.sqlclause.SqlClause; +import jp.sf.pal.notepad.db.cbean.UserInfoCB; import jp.sf.pal.notepad.db.cbean.cq.GroupInfoCQ; import jp.sf.pal.notepad.db.cbean.cq.GroupMappingCQ; import jp.sf.pal.notepad.db.cbean.cq.NotepadCQ; @@ -19,7 +20,6 @@ * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public class BsUserInfoCQ extends AbstractBsUserInfoCQ { //========================================================================== @@ -65,7 +65,7 @@ public UserInfoCIQ on() { if (isBaseQuery(this)) { throw new UnsupportedOperationException( - "Unsupported onClause of Base Table!"); + "Unsupported on-clause for local table!"); } UserInfoCIQ inlineQuery = inline(); inlineQuery.xsetOnClauseInline(true); @@ -516,110 +516,110 @@ return "userId_NotExistsSubQuery_RoleMappingList." + key; } - protected Map _userId_DeriveSubQuery_GroupMappingListMap; + protected Map _userId_DerivedReferrer_GroupMappingListMap; - public Map getUserId_DeriveSubQuery_GroupMappingList() { - return _userId_DeriveSubQuery_GroupMappingListMap; + public Map getUserId_DerivedReferrer_GroupMappingList() { + return _userId_DerivedReferrer_GroupMappingListMap; } - public String keepUserId_DeriveSubQuery_GroupMappingList( + public String keepUserId_DerivedReferrer_GroupMappingList( GroupMappingCQ subQuery) { - if (_userId_DeriveSubQuery_GroupMappingListMap == null) { - _userId_DeriveSubQuery_GroupMappingListMap = newLinkedHashMap(); + if (_userId_DerivedReferrer_GroupMappingListMap == null) { + _userId_DerivedReferrer_GroupMappingListMap = newLinkedHashMap(); } String key = "subQueryMapKey" - + (_userId_DeriveSubQuery_GroupMappingListMap.size() + 1); - _userId_DeriveSubQuery_GroupMappingListMap.put(key, subQuery); - return "userId_DeriveSubQuery_GroupMappingList." + key; + + (_userId_DerivedReferrer_GroupMappingListMap.size() + 1); + _userId_DerivedReferrer_GroupMappingListMap.put(key, subQuery); + return "userId_DerivedReferrer_GroupMappingList." + key; } - protected Map _userId_DeriveSubQuery_NotepadByCreatedByListMap; + protected Map _userId_DerivedReferrer_NotepadByCreatedByListMap; - public Map getUserId_DeriveSubQuery_NotepadByCreatedByList() { - return _userId_DeriveSubQuery_NotepadByCreatedByListMap; + public Map getUserId_DerivedReferrer_NotepadByCreatedByList() { + return _userId_DerivedReferrer_NotepadByCreatedByListMap; } - public String keepUserId_DeriveSubQuery_NotepadByCreatedByList( + public String keepUserId_DerivedReferrer_NotepadByCreatedByList( NotepadCQ subQuery) { - if (_userId_DeriveSubQuery_NotepadByCreatedByListMap == null) { - _userId_DeriveSubQuery_NotepadByCreatedByListMap = newLinkedHashMap(); + if (_userId_DerivedReferrer_NotepadByCreatedByListMap == null) { + _userId_DerivedReferrer_NotepadByCreatedByListMap = newLinkedHashMap(); } String key = "subQueryMapKey" - + (_userId_DeriveSubQuery_NotepadByCreatedByListMap.size() + 1); - _userId_DeriveSubQuery_NotepadByCreatedByListMap.put(key, subQuery); - return "userId_DeriveSubQuery_NotepadByCreatedByList." + key; + + (_userId_DerivedReferrer_NotepadByCreatedByListMap.size() + 1); + _userId_DerivedReferrer_NotepadByCreatedByListMap.put(key, subQuery); + return "userId_DerivedReferrer_NotepadByCreatedByList." + key; } - protected Map _userId_DeriveSubQuery_NotepadByUpdatedByListMap; + protected Map _userId_DerivedReferrer_NotepadByUpdatedByListMap; - public Map getUserId_DeriveSubQuery_NotepadByUpdatedByList() { - return _userId_DeriveSubQuery_NotepadByUpdatedByListMap; + public Map getUserId_DerivedReferrer_NotepadByUpdatedByList() { + return _userId_DerivedReferrer_NotepadByUpdatedByListMap; } - public String keepUserId_DeriveSubQuery_NotepadByUpdatedByList( + public String keepUserId_DerivedReferrer_NotepadByUpdatedByList( NotepadCQ subQuery) { - if (_userId_DeriveSubQuery_NotepadByUpdatedByListMap == null) { - _userId_DeriveSubQuery_NotepadByUpdatedByListMap = newLinkedHashMap(); + if (_userId_DerivedReferrer_NotepadByUpdatedByListMap == null) { + _userId_DerivedReferrer_NotepadByUpdatedByListMap = newLinkedHashMap(); } String key = "subQueryMapKey" - + (_userId_DeriveSubQuery_NotepadByUpdatedByListMap.size() + 1); - _userId_DeriveSubQuery_NotepadByUpdatedByListMap.put(key, subQuery); - return "userId_DeriveSubQuery_NotepadByUpdatedByList." + key; + + (_userId_DerivedReferrer_NotepadByUpdatedByListMap.size() + 1); + _userId_DerivedReferrer_NotepadByUpdatedByListMap.put(key, subQuery); + return "userId_DerivedReferrer_NotepadByUpdatedByList." + key; } - protected Map _userId_DeriveSubQuery_NotepadCategoryByCreatedByListMap; + protected Map _userId_DerivedReferrer_NotepadCategoryByCreatedByListMap; - public Map getUserId_DeriveSubQuery_NotepadCategoryByCreatedByList() { - return _userId_DeriveSubQuery_NotepadCategoryByCreatedByListMap; + public Map getUserId_DerivedReferrer_NotepadCategoryByCreatedByList() { + return _userId_DerivedReferrer_NotepadCategoryByCreatedByListMap; } - public String keepUserId_DeriveSubQuery_NotepadCategoryByCreatedByList( + public String keepUserId_DerivedReferrer_NotepadCategoryByCreatedByList( NotepadCategoryCQ subQuery) { - if (_userId_DeriveSubQuery_NotepadCategoryByCreatedByListMap == null) { - _userId_DeriveSubQuery_NotepadCategoryByCreatedByListMap = newLinkedHashMap(); + if (_userId_DerivedReferrer_NotepadCategoryByCreatedByListMap == null) { + _userId_DerivedReferrer_NotepadCategoryByCreatedByListMap = newLinkedHashMap(); } String key = "subQueryMapKey" - + (_userId_DeriveSubQuery_NotepadCategoryByCreatedByListMap + + (_userId_DerivedReferrer_NotepadCategoryByCreatedByListMap .size() + 1); - _userId_DeriveSubQuery_NotepadCategoryByCreatedByListMap.put(key, + _userId_DerivedReferrer_NotepadCategoryByCreatedByListMap.put(key, subQuery); - return "userId_DeriveSubQuery_NotepadCategoryByCreatedByList." + key; + return "userId_DerivedReferrer_NotepadCategoryByCreatedByList." + key; } - protected Map _userId_DeriveSubQuery_NotepadCategoryByUpdatedByListMap; + protected Map _userId_DerivedReferrer_NotepadCategoryByUpdatedByListMap; - public Map getUserId_DeriveSubQuery_NotepadCategoryByUpdatedByList() { - return _userId_DeriveSubQuery_NotepadCategoryByUpdatedByListMap; + public Map getUserId_DerivedReferrer_NotepadCategoryByUpdatedByList() { + return _userId_DerivedReferrer_NotepadCategoryByUpdatedByListMap; } - public String keepUserId_DeriveSubQuery_NotepadCategoryByUpdatedByList( + public String keepUserId_DerivedReferrer_NotepadCategoryByUpdatedByList( NotepadCategoryCQ subQuery) { - if (_userId_DeriveSubQuery_NotepadCategoryByUpdatedByListMap == null) { - _userId_DeriveSubQuery_NotepadCategoryByUpdatedByListMap = newLinkedHashMap(); + if (_userId_DerivedReferrer_NotepadCategoryByUpdatedByListMap == null) { + _userId_DerivedReferrer_NotepadCategoryByUpdatedByListMap = newLinkedHashMap(); } String key = "subQueryMapKey" - + (_userId_DeriveSubQuery_NotepadCategoryByUpdatedByListMap + + (_userId_DerivedReferrer_NotepadCategoryByUpdatedByListMap .size() + 1); - _userId_DeriveSubQuery_NotepadCategoryByUpdatedByListMap.put(key, + _userId_DerivedReferrer_NotepadCategoryByUpdatedByListMap.put(key, subQuery); - return "userId_DeriveSubQuery_NotepadCategoryByUpdatedByList." + key; + return "userId_DerivedReferrer_NotepadCategoryByUpdatedByList." + key; } - protected Map _userId_DeriveSubQuery_RoleMappingListMap; + protected Map _userId_DerivedReferrer_RoleMappingListMap; - public Map getUserId_DeriveSubQuery_RoleMappingList() { - return _userId_DeriveSubQuery_RoleMappingListMap; + public Map getUserId_DerivedReferrer_RoleMappingList() { + return _userId_DerivedReferrer_RoleMappingListMap; } - public String keepUserId_DeriveSubQuery_RoleMappingList( + public String keepUserId_DerivedReferrer_RoleMappingList( RoleMappingCQ subQuery) { - if (_userId_DeriveSubQuery_RoleMappingListMap == null) { - _userId_DeriveSubQuery_RoleMappingListMap = newLinkedHashMap(); + if (_userId_DerivedReferrer_RoleMappingListMap == null) { + _userId_DerivedReferrer_RoleMappingListMap = newLinkedHashMap(); } String key = "subQueryMapKey" - + (_userId_DeriveSubQuery_RoleMappingListMap.size() + 1); - _userId_DeriveSubQuery_RoleMappingListMap.put(key, subQuery); - return "userId_DeriveSubQuery_RoleMappingList." + key; + + (_userId_DerivedReferrer_RoleMappingListMap.size() + 1); + _userId_DerivedReferrer_RoleMappingListMap.put(key, subQuery); + return "userId_DerivedReferrer_RoleMappingList." + key; } public BsUserInfoCQ addOrderBy_UserId_Asc() { @@ -986,6 +986,29 @@ return this; } + protected ConditionValue _status; + + public ConditionValue getStatus() { + if (_status == null) { + _status = new ConditionValue(); + } + return _status; + } + + protected ConditionValue getCValueStatus() { + return getStatus(); + } + + public BsUserInfoCQ addOrderBy_Status_Asc() { + regOBA("STATUS"); + return this; + } + + public BsUserInfoCQ addOrderBy_Status_Desc() { + regOBD("STATUS"); + return this; + } + protected ConditionValue _createdTime; public ConditionValue getCreatedTime() { @@ -1183,7 +1206,6 @@ // ========= // Foreign Query // ============= - public GroupInfoCQ queryGroupInfo() { return getConditionQueryGroupInfo(); } @@ -1192,20 +1214,13 @@ public GroupInfoCQ getConditionQueryGroupInfo() { if (_conditionQueryGroupInfo == null) { - _conditionQueryGroupInfo = createQueryGroupInfo(); - setupOuterJoin_GroupInfo(); + _conditionQueryGroupInfo = xcreateQueryGroupInfo(); + xsetupOuterJoinGroupInfo(); } return _conditionQueryGroupInfo; } - protected void setupOuterJoin_GroupInfo() { - Map joinOnMap = newLinkedHashMap(); - joinOnMap.put(getRealColumnName("GROUP_ID"), - getConditionQueryGroupInfo().getRealColumnName("GROUP_ID")); - registerOuterJoin(getConditionQueryGroupInfo(), joinOnMap); - } - - protected GroupInfoCQ createQueryGroupInfo() { + protected GroupInfoCQ xcreateQueryGroupInfo() { String nrp = resolveNextRelationPath("USER_INFO", "groupInfo"); String jan = resolveJoinAliasName(nrp, getNextNestLevel()); GroupInfoCQ cq = new GroupInfoCQ(this, getSqlClause(), jan, @@ -1215,6 +1230,14 @@ return cq; } + protected void xsetupOuterJoinGroupInfo() { + GroupInfoCQ cq = getConditionQueryGroupInfo(); + Map joinOnMap = newLinkedHashMap(); + joinOnMap.put(getRealColumnName("GROUP_ID"), cq + .getRealColumnName("GROUP_ID")); + registerOuterJoin(cq, joinOnMap); + } + public boolean hasConditionQueryGroupInfo() { return _conditionQueryGroupInfo != null; } @@ -1227,20 +1250,13 @@ public RoleInfoCQ getConditionQueryRoleInfo() { if (_conditionQueryRoleInfo == null) { - _conditionQueryRoleInfo = createQueryRoleInfo(); - setupOuterJoin_RoleInfo(); + _conditionQueryRoleInfo = xcreateQueryRoleInfo(); + xsetupOuterJoinRoleInfo(); } return _conditionQueryRoleInfo; } - protected void setupOuterJoin_RoleInfo() { - Map joinOnMap = newLinkedHashMap(); - joinOnMap.put(getRealColumnName("ROLE_ID"), getConditionQueryRoleInfo() - .getRealColumnName("ROLE_ID")); - registerOuterJoin(getConditionQueryRoleInfo(), joinOnMap); - } - - protected RoleInfoCQ createQueryRoleInfo() { + protected RoleInfoCQ xcreateQueryRoleInfo() { String nrp = resolveNextRelationPath("USER_INFO", "roleInfo"); String jan = resolveJoinAliasName(nrp, getNextNestLevel()); RoleInfoCQ cq = new RoleInfoCQ(this, getSqlClause(), jan, @@ -1250,10 +1266,42 @@ return cq; } + protected void xsetupOuterJoinRoleInfo() { + RoleInfoCQ cq = getConditionQueryRoleInfo(); + Map joinOnMap = newLinkedHashMap(); + joinOnMap.put(getRealColumnName("ROLE_ID"), cq + .getRealColumnName("ROLE_ID")); + registerOuterJoin(cq, joinOnMap); + } + public boolean hasConditionQueryRoleInfo() { return _conditionQueryRoleInfo != null; } + //========================================================================== + // ========= + // Derived Query + // ============= + protected Map _scalarSubQueryMap; + + public Map getScalarSubQuery() { + return _scalarSubQueryMap; + } + + public String keepScalarSubQuery(UserInfoCQ subQuery) { + if (_scalarSubQueryMap == null) { + _scalarSubQueryMap = newLinkedHashMap(); + } + String key = "subQueryMapKey" + (_scalarSubQueryMap.size() + 1); + _scalarSubQueryMap.put(key, subQuery); + return "scalarSubQuery." + key; + } + + // Very Internal (for Suppressing Warn about 'Not Use Import') + protected String getConditionBeanClassNameInternally() { + return UserInfoCB.class.getName(); + } + protected String getConditionQueryClassNameInternally() { return UserInfoCQ.class.getName(); } Modified: notepad/trunk/src/main/java/jp/sf/pal/notepad/db/cbean/cq/ciq/GroupInfoCIQ.java =================================================================== --- notepad/trunk/src/main/java/jp/sf/pal/notepad/db/cbean/cq/ciq/GroupInfoCIQ.java 2008-12-27 22:11:51 UTC (rev 1627) +++ notepad/trunk/src/main/java/jp/sf/pal/notepad/db/cbean/cq/ciq/GroupInfoCIQ.java 2008-12-27 22:13:37 UTC (rev 1628) @@ -5,6 +5,7 @@ import jp.sf.pal.notepad.db.allcommon.cbean.coption.ConditionOption; import jp.sf.pal.notepad.db.allcommon.cbean.cvalue.ConditionValue; import jp.sf.pal.notepad.db.allcommon.cbean.sqlclause.SqlClause; +import jp.sf.pal.notepad.db.cbean.GroupInfoCB; import jp.sf.pal.notepad.db.cbean.cq.GroupInfoCQ; import jp.sf.pal.notepad.db.cbean.cq.GroupMappingCQ; import jp.sf.pal.notepad.db.cbean.cq.UserInfoCQ; @@ -16,7 +17,6 @@ * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public class GroupInfoCIQ extends AbstractBsGroupInfoCQ { //========================================================================== @@ -137,15 +137,15 @@ "NotExistsSubQuery at inline() is unsupported! Sorry!"); } - public String keepGroupId_DeriveSubQuery_GroupMappingList( + public String keepGroupId_DerivedReferrer_GroupMappingList( GroupMappingCQ subQuery) { throw new UnsupportedOperationException( - "DeriveSubQuery at inline() is unsupported! Sorry!"); + "DerivedReferrer at inline() is unsupported! Sorry!"); } - public String keepGroupId_DeriveSubQuery_UserInfoList(UserInfoCQ subQuery) { + public String keepGroupId_DerivedReferrer_UserInfoList(UserInfoCQ subQuery) { throw new UnsupportedOperationException( - "DeriveSubQuery at inline() is unsupported! Sorry!"); + "DerivedReferrer at inline() is unsupported! Sorry!"); } protected ConditionValue getCValueName() { @@ -196,6 +196,20 @@ return _myCQ.getVersionno(); } + //========================================================================== + // ========= + // Derived Query + // ============= + public String keepScalarSubQuery(GroupInfoCQ subQuery) { + throw new UnsupportedOperationException( + "ScalarSubQuery at inline() is unsupported! Sorry!"); + } + + // Very Internal (for Suppressing Warn about 'Not Use Import') + protected String getConditionBeanClassNameInternally() { + return GroupInfoCB.class.getName(); + } + protected String getConditionQueryClassNameInternally() { return GroupInfoCQ.class.getName(); } Modified: notepad/trunk/src/main/java/jp/sf/pal/notepad/db/cbean/cq/ciq/GroupMappingCIQ.java =================================================================== --- notepad/trunk/src/main/java/jp/sf/pal/notepad/db/cbean/cq/ciq/GroupMappingCIQ.java 2008-12-27 22:11:51 UTC (rev 1627) +++ notepad/trunk/src/main/java/jp/sf/pal/notepad/db/cbean/cq/ciq/GroupMappingCIQ.java 2008-12-27 22:13:37 UTC (rev 1628) @@ -5,6 +5,7 @@ import jp.sf.pal.notepad.db.allcommon.cbean.coption.ConditionOption; import jp.sf.pal.notepad.db.allcommon.cbean.cvalue.ConditionValue; import jp.sf.pal.notepad.db.allcommon.cbean.sqlclause.SqlClause; +import jp.sf.pal.notepad.db.cbean.GroupMappingCB; import jp.sf.pal.notepad.db.cbean.cq.GroupInfoCQ; import jp.sf.pal.notepad.db.cbean.cq.GroupMappingCQ; import jp.sf.pal.notepad.db.cbean.cq.UserInfoCQ; @@ -16,7 +17,6 @@ * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public class GroupMappingCIQ extends AbstractBsGroupMappingCQ { //========================================================================== @@ -112,6 +112,20 @@ return _myCQ.keepGroupId_InScopeSubQuery_GroupInfo(subQuery); } + //========================================================================== + // ========= + // Derived Query + // ============= + public String keepScalarSubQuery(GroupMappingCQ subQuery) { + throw new UnsupportedOperationException( + "ScalarSubQuery at inline() is unsupported! Sorry!"); + } + + // Very Internal (for Suppressing Warn about 'Not Use Import') + protected String getConditionBeanClassNameInternally() { + return GroupMappingCB.class.getName(); + } + protected String getConditionQueryClassNameInternally() { return GroupMappingCQ.class.getName(); } Modified: notepad/trunk/src/main/java/jp/sf/pal/notepad/db/cbean/cq/ciq/NotepadCIQ.java =================================================================== --- notepad/trunk/src/main/java/jp/sf/pal/notepad/db/cbean/cq/ciq/NotepadCIQ.java 2008-12-27 22:11:51 UTC (rev 1627) +++ notepad/trunk/src/main/java/jp/sf/pal/notepad/db/cbean/cq/ciq/NotepadCIQ.java 2008-12-27 22:13:37 UTC (rev 1628) @@ -5,6 +5,7 @@ import jp.sf.pal.notepad.db.allcommon.cbean.coption.ConditionOption; import jp.sf.pal.notepad.db.allcommon.cbean.cvalue.ConditionValue; import jp.sf.pal.notepad.db.allcommon.cbean.sqlclause.SqlClause; +import jp.sf.pal.notepad.db.cbean.NotepadCB; import jp.sf.pal.notepad.db.cbean.cq.NotepadCQ; import jp.sf.pal.notepad.db.cbean.cq.NotepadCategoryCQ; import jp.sf.pal.notepad.db.cbean.cq.NotepadContentCQ; @@ -17,7 +18,6 @@ * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public class NotepadCIQ extends AbstractBsNotepadCQ { //========================================================================== @@ -176,6 +176,20 @@ return _myCQ.getVersionno(); } + //========================================================================== + // ========= + // Derived Query + // ============= + public String keepScalarSubQuery(NotepadCQ subQuery) { + throw new UnsupportedOperationException( + "ScalarSubQuery at inline() is unsupported! Sorry!"); + } + + // Very Internal (for Suppressing Warn about 'Not Use Import') + protected String getConditionBeanClassNameInternally() { + return NotepadCB.class.getName(); + } + protected String getConditionQueryClassNameInternally() { return NotepadCQ.class.getName(); } Modified: notepad/trunk/src/main/java/jp/sf/pal/notepad/db/cbean/cq/ciq/NotepadCategoryCIQ.java =================================================================== --- notepad/trunk/src/main/java/jp/sf/pal/notepad/db/cbean/cq/ciq/NotepadCategoryCIQ.java 2008-12-27 22:11:51 UTC (rev 1627) +++ notepad/trunk/src/main/java/jp/sf/pal/notepad/db/cbean/cq/ciq/NotepadCategoryCIQ.java 2008-12-27 22:13:37 UTC (rev 1628) @@ -5,6 +5,7 @@ import jp.sf.pal.notepad.db.allcommon.cbean.coption.ConditionOption; import jp.sf.pal.notepad.db.allcommon.cbean.cvalue.ConditionValue; import jp.sf.pal.notepad.db.allcommon.cbean.sqlclause.SqlClause; +import jp.sf.pal.notepad.db.cbean.NotepadCategoryCB; import jp.sf.pal.notepad.db.cbean.cq.NotepadCQ; import jp.sf.pal.notepad.db.cbean.cq.NotepadCategoryCQ; import jp.sf.pal.notepad.db.cbean.cq.UserInfoCQ; @@ -16,7 +17,6 @@ * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public class NotepadCategoryCIQ extends AbstractBsNotepadCategoryCQ { //========================================================================== @@ -114,9 +114,9 @@ "NotExistsSubQuery at inline() is unsupported! Sorry!"); } - public String keepId_DeriveSubQuery_NotepadList(NotepadCQ subQuery) { + public String keepId_DerivedReferrer_NotepadList(NotepadCQ subQuery) { throw new UnsupportedOperationException( - "DeriveSubQuery at inline() is unsupported! Sorry!"); + "DerivedReferrer at inline() is unsupported! Sorry!"); } protected ConditionValue getCValueName() { @@ -171,6 +171,20 @@ return _myCQ.getVersionno(); } + //========================================================================== + // ========= + // Derived Query + // ============= + public String keepScalarSubQuery(NotepadCategoryCQ subQuery) { + throw new UnsupportedOperationException( + "ScalarSubQuery at inline() is unsupported! Sorry!"); + } + + // Very Internal (for Suppressing Warn about 'Not Use Import') + protected String getConditionBeanClassNameInternally() { + return NotepadCategoryCB.class.getName(); + } + protected String getConditionQueryClassNameInternally() { return NotepadCategoryCQ.class.getName(); } Modified: notepad/trunk/src/main/java/jp/sf/pal/notepad/db/cbean/cq/ciq/NotepadContentCIQ.java =================================================================== --- notepad/trunk/src/main/java/jp/sf/pal/notepad/db/cbean/cq/ciq/NotepadContentCIQ.java 2008-12-27 22:11:51 UTC (rev 1627) +++ notepad/trunk/src/main/java/jp/sf/pal/notepad/db/cbean/cq/ciq/NotepadContentCIQ.java 2008-12-27 22:13:37 UTC (rev 1628) @@ -5,6 +5,7 @@ import jp.sf.pal.notepad.db.allcommon.cbean.coption.ConditionOption; import jp.sf.pal.notepad.db.allcommon.cbean.cvalue.ConditionValue; import jp.sf.pal.notepad.db.allcommon.cbean.sqlclause.SqlClause; +import jp.sf.pal.notepad.db.cbean.NotepadContentCB; import jp.sf.pal.notepad.db.cbean.cq.NotepadCQ; import jp.sf.pal.notepad.db.cbean.cq.NotepadContentCQ; import jp.sf.pal.notepad.db.cbean.cq.bs.AbstractBsNotepadContentCQ; @@ -15,7 +16,6 @@ * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public class NotepadContentCIQ extends AbstractBsNotepadContentCQ { //========================================================================== @@ -103,6 +103,20 @@ return _myCQ.getContent(); } + //========================================================================== + // ========= + // Derived Query + // ============= + public String keepScalarSubQuery(NotepadContentCQ subQuery) { + throw new UnsupportedOperationException( + "ScalarSubQuery at inline() is unsupported! Sorry!"); + } + + // Very Internal (for Suppressing Warn about 'Not Use Import') + protected String getConditionBeanClassNameInternally() { + return NotepadContentCB.class.getName(); + } + protected String getConditionQueryClassNameInternally() { return NotepadContentCQ.class.getName(); } Modified: notepad/trunk/src/main/java/jp/sf/pal/notepad/db/cbean/cq/ciq/RoleInfoCIQ.java =================================================================== --- notepad/trunk/src/main/java/jp/sf/pal/notepad/db/cbean/cq/ciq/RoleInfoCIQ.java 2008-12-27 22:11:51 UTC (rev 1627) +++ notepad/trunk/src/main/java/jp/sf/pal/notepad/db/cbean/cq/ciq/RoleInfoCIQ.java 2008-12-27 22:13:37 UTC (rev 1628) @@ -5,6 +5,7 @@ import jp.sf.pal.notepad.db.allcommon.cbean.coption.ConditionOption; import jp.sf.pal.notepad.db.allcommon.cbean.cvalue.ConditionValue; import jp.sf.pal.notepad.db.allcommon.cbean.sqlclause.SqlClause; +import jp.sf.pal.notepad.db.cbean.RoleInfoCB; import jp.sf.pal.notepad.db.cbean.cq.RoleInfoCQ; import jp.sf.pal.notepad.db.cbean.cq.RoleMappingCQ; import jp.sf.pal.notepad.db.cbean.cq.UserInfoCQ; @@ -16,7 +17,6 @@ * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public class RoleInfoCIQ extends AbstractBsRoleInfoCQ { //========================================================================== @@ -136,15 +136,15 @@ "NotExistsSubQuery at inline() is unsupported! Sorry!"); } - public String keepRoleId_DeriveSubQuery_RoleMappingList( + public String keepRoleId_DerivedReferrer_RoleMappingList( RoleMappingCQ subQuery) { throw new UnsupportedOperationException( - "DeriveSubQuery at inline() is unsupported! Sorry!"); + "DerivedReferrer at inline() is unsupported! Sorry!"); } - public String keepRoleId_DeriveSubQuery_UserInfoList(UserInfoCQ subQuery) { + public String keepRoleId_DerivedReferrer_UserInfoList(UserInfoCQ subQuery) { throw new UnsupportedOperationException( - "DeriveSubQuery at inline() is unsupported! Sorry!"); + "DerivedReferrer at inline() is unsupported! Sorry!"); } protected ConditionValue getCValueName() { @@ -195,6 +195,20 @@ return _myCQ.getVersionno(); } + //========================================================================== + // ========= + // Derived Query + // ============= + public String keepScalarSubQuery(RoleInfoCQ subQuery) { + throw new UnsupportedOperationException( + "ScalarSubQuery at inline() is unsupported! Sorry!"); + } + + // Very Internal (for Suppressing Warn about 'Not Use Import') + protected String getConditionBeanClassNameInternally() { + return RoleInfoCB.class.getName(); + } + protected String getConditionQueryClassNameInternally() { return RoleInfoCQ.class.getName(); } Modified: notepad/trunk/src/main/java/jp/sf/pal/notepad/db/cbean/cq/ciq/RoleMappingCIQ.java =================================================================== --- notepad/trunk/src/main/java/jp/sf/pal/notepad/db/cbean/cq/ciq/RoleMappingCIQ.java 2008-12-27 22:11:51 UTC (rev 1627) +++ notepad/trunk/src/main/java/jp/sf/pal/notepad/db/cbean/cq/ciq/RoleMappingCIQ.java 2008-12-27 22:13:37 UTC (rev 1628) @@ -5,6 +5,7 @@ import jp.sf.pal.notepad.db.allcommon.cbean.coption.ConditionOption; import jp.sf.pal.notepad.db.allcommon.cbean.cvalue.ConditionValue; import jp.sf.pal.notepad.db.allcommon.cbean.sqlclause.SqlClause; +import jp.sf.pal.notepad.db.cbean.RoleMappingCB; import jp.sf.pal.notepad.db.cbean.cq.RoleInfoCQ; import jp.sf.pal.notepad.db.cbean.cq.RoleMappingCQ; import jp.sf.pal.notepad.db.cbean.cq.UserInfoCQ; @@ -16,7 +17,6 @@ * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public class RoleMappingCIQ extends AbstractBsRoleMappingCQ { //========================================================================== @@ -112,6 +112,20 @@ return _myCQ.keepRoleId_InScopeSubQuery_RoleInfo(subQuery); } + //========================================================================== + // ========= + // Derived Query + // ============= + public String keepScalarSubQuery(RoleMappingCQ subQuery) { + throw new UnsupportedOperationException( + "ScalarSubQuery at inline() is unsupported! Sorry!"); + } + + // Very Internal (for Suppressing Warn about 'Not Use Import') + protected String getConditionBeanClassNameInternally() { + return RoleMappingCB.class.getName(); + } + protected String getConditionQueryClassNameInternally() { return RoleMappingCQ.class.getName(); } Modified: notepad/trunk/src/main/java/jp/sf/pal/notepad/db/cbean/cq/ciq/UserInfoCIQ.java =================================================================== --- notepad/trunk/src/main/java/jp/sf/pal/notepad/db/cbean/cq/ciq/UserInfoCIQ.java 2008-12-27 22:11:51 UTC (rev 1627) +++ notepad/trunk/src/main/java/jp/sf/pal/notepad/db/cbean/cq/ciq/UserInfoCIQ.java 2008-12-27 22:13:37 UTC (rev 1628) @@ -5,6 +5,7 @@ import jp.sf.pal.notepad.db.allcommon.cbean.coption.ConditionOption; import jp.sf.pal.notepad.db.allcommon.cbean.cvalue.ConditionValue; import jp.sf.pal.notepad.db.allcommon.cbean.sqlclause.SqlClause; +import jp.sf.pal.notepad.db.cbean.UserInfoCB; import jp.sf.pal.notepad.db.cbean.cq.GroupInfoCQ; import jp.sf.pal.notepad.db.cbean.cq.GroupMappingCQ; import jp.sf.pal.notepad.db.cbean.cq.NotepadCQ; @@ -20,7 +21,6 @@ * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public class UserInfoCIQ extends AbstractBsUserInfoCQ { //========================================================================== @@ -240,40 +240,40 @@ "NotExistsSubQuery at inline() is unsupported! Sorry!"); } - public String keepUserId_DeriveSubQuery_GroupMappingList( + public String keepUserId_DerivedReferrer_GroupMappingList( GroupMappingCQ subQuery) { throw new UnsupportedOperationException( - "DeriveSubQuery at inline() is unsupported! Sorry!"); + "DerivedReferrer at inline() is unsupported! Sorry!"); } - public String keepUserId_DeriveSubQuery_NotepadByCreatedByList( + public String keepUserId_DerivedReferrer_NotepadByCreatedByList( NotepadCQ subQuery) { throw new UnsupportedOperationException( - "DeriveSubQuery at inline() is unsupported! Sorry!"); + "DerivedReferrer at inline() is unsupported! Sorry!"); } - public String keepUserId_DeriveSubQuery_NotepadByUpdatedByList( + public String keepUserId_DerivedReferrer_NotepadByUpdatedByList( NotepadCQ subQuery) { throw new UnsupportedOperationException( - "DeriveSubQuery at inline() is unsupported! Sorry!"); + "DerivedReferrer at inline() is unsupported! Sorry!"); } - public String keepUserId_DeriveSubQuery_NotepadCategoryByCreatedByList( + public String keepUserId_DerivedReferrer_NotepadCategoryByCreatedByList( NotepadCategoryCQ subQuery) { throw new UnsupportedOperationException( - "DeriveSubQuery at inline() is unsupported! Sorry!"); + "DerivedReferrer at inline() is unsupported! Sorry!"); } - public String keepUserId_DeriveSubQuery_NotepadCategoryByUpdatedByList( + public String keepUserId_DerivedReferrer_NotepadCategoryByUpdatedByList( NotepadCategoryCQ subQuery) { throw new UnsupportedOperationException( - "DeriveSubQuery at inline() is unsupported! Sorry!"); + "DerivedReferrer at inline() is unsupported! Sorry!"); } - public String keepUserId_DeriveSubQuery_RoleMappingList( + public String keepUserId_DerivedReferrer_RoleMappingList( RoleMappingCQ subQuery) { throw new UnsupportedOperationException( - "DeriveSubQuery at inline() is unsupported! Sorry!"); + "DerivedReferrer at inline() is unsupported! Sorry!"); } protected ConditionValue getCValueGivenName() { @@ -340,6 +340,10 @@ return _myCQ.keepGroupId_InScopeSubQuery_GroupInfo(subQuery); } + protected ConditionValue getCValueStatus() { + return _myCQ.getStatus(); + } + protected ConditionValue getCValueCreatedTime() { return _myCQ.getCreatedTime(); } @@ -368,6 +372,20 @@ return _myCQ.getVersionno(); } + //========================================================================== + // ========= + // Derived Query + // ============= + public String keepScalarSubQuery(UserInfoCQ subQuery) { + throw new UnsupportedOperationException( + "ScalarSubQuery at inline() is unsupported! Sorry!"); + } + + // Very Internal (for Suppressing Warn about 'Not Use Import') + protected String getConditionBeanClassNameInternally() { + return UserInfoCB.class.getName(); + } + protected String getConditionQueryClassNameInternally() { return UserInfoCQ.class.getName(); } Modified: notepad/trunk/src/main/java/jp/sf/pal/notepad/db/cbean/nss/GroupInfoNss.java =================================================================== --- notepad/trunk/src/main/java/jp/sf/pal/notepad/db/cbean/nss/GroupInfoNss.java 2008-12-27 22:11:51 UTC (rev 1627) +++ notepad/trunk/src/main/java/jp/sf/pal/notepad/db/cbean/nss/GroupInfoNss.java 2008-12-27 22:13:37 UTC (rev 1628) @@ -7,7 +7,6 @@ * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public class GroupInfoNss { protected GroupInfoCQ _query; Modified: notepad/trunk/src/main/java/jp/sf/pal/notepad/db/cbean/nss/GroupMappingNss.java =================================================================== --- notepad/trunk/src/main/java/jp/sf/pal/notepad/db/cbean/nss/GroupMappingNss.java 2008-12-27 22:11:51 UTC (rev 1627) +++ notepad/trunk/src/main/java/jp/sf/pal/notepad/db/cbean/nss/GroupMappingNss.java 2008-12-27 22:13:37 UTC (rev 1628) @@ -8,7 +8,6 @@ * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public class GroupMappingNss { protected GroupMappingCQ _query; Modified: notepad/trunk/src/main/java/jp/sf/pal/notepad/db/cbean/nss/NotepadCategoryNss.java =================================================================== --- notepad/trunk/src/main/java/jp/sf/pal/notepad/db/cbean/nss/NotepadCategoryNss.java 2008-12-27 22:11:51 UTC (rev 1627) +++ notepad/trunk/src/main/java/jp/sf/pal/notepad/db/cbean/nss/NotepadCategoryNss.java 2008-12-27 22:13:37 UTC (rev 1628) @@ -8,7 +8,6 @@ * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public class NotepadCategoryNss { protected NotepadCategoryCQ _query; Modified: notepad/trunk/src/main/java/jp/sf/pal/notepad/db/cbean/nss/NotepadContentNss.java =================================================================== --- notepad/trunk/src/main/java/jp/sf/pal/notepad/db/cbean/nss/NotepadContentNss.java 2008-12-27 22:11:51 UTC (rev 1627) +++ notepad/trunk/src/main/java/jp/sf/pal/notepad/db/cbean/nss/NotepadContentNss.java 2008-12-27 22:13:37 UTC (rev 1628) @@ -8,7 +8,6 @@ * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public class NotepadContentNss { protected NotepadContentCQ _query; Modified: notepad/trunk/src/main/java/jp/sf/pal/notepad/db/cbean/nss/NotepadNss.java =================================================================== --- notepad/trunk/src/main/java/jp/sf/pal/notepad/db/cbean/nss/NotepadNss.java 2008-12-27 22:11:51 UTC (rev 1627) +++ notepad/trunk/src/main/java/jp/sf/pal/notepad/db/cbean/nss/NotepadNss.java 2008-12-27 22:13:37 UTC (rev 1628) @@ -8,7 +8,6 @@ * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public class NotepadNss { protected NotepadCQ _query; Modified: notepad/trunk/src/main/java/jp/sf/pal/notepad/db/cbean/nss/RoleInfoNss.java =================================================================== --- notepad/trunk/src/main/java/jp/sf/pal/notepad/db/cbean/nss/RoleInfoNss.java 2008-12-27 22:11:51 UTC (rev 1627) +++ notepad/trunk/src/main/java/jp/sf/pal/notepad/db/cbean/nss/RoleInfoNss.java 2008-12-27 22:13:37 UTC (rev 1628) @@ -7,7 +7,6 @@ * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public class RoleInfoNss { protected RoleInfoCQ _query; Modified: notepad/trunk/src/main/java/jp/sf/pal/notepad/db/cbean/nss/RoleMappingNss.java =================================================================== --- notepad/trunk/src/main/java/jp/sf/pal/notepad/db/cbean/nss/RoleMappingNss.java 2008-12-27 22:11:51 UTC (rev 1627) +++ notepad/trunk/src/main/java/jp/sf/pal/notepad/db/cbean/nss/RoleMappingNss.java 2008-12-27 22:13:37 UTC (rev 1628) @@ -8,7 +8,6 @@ * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public class RoleMappingNss { protected RoleMappingCQ _query; Modified: notepad/trunk/src/main/java/jp/sf/pal/notepad/db/cbean/nss/UserInfoNss.java =================================================================== --- notepad/trunk/src/main/java/jp/sf/pal/notepad/db/cbean/nss/UserInfoNss.java 2008-12-27 22:11:51 UTC (rev 1627) +++ notepad/trunk/src/main/java/jp/sf/pal/notepad/db/cbean/nss/UserInfoNss.java 2008-12-27 22:13:37 UTC (rev 1628) @@ -8,7 +8,6 @@ * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public class UserInfoNss { protected UserInfoCQ _query; Modified: notepad/trunk/src/main/resources/dbflute.dicon =================================================================== --- notepad/trunk/src/main/resources/dbflute.dicon 2008-12-27 22:11:51 UTC (rev 1627) +++ notepad/trunk/src/main/resources/dbflute.dicon 2008-12-27 22:13:37 UTC (rev 1628) @@ -5,89 +5,40 @@ - - - "UTF-8" + + + + + + - + + + + + - - - - + + - - - - - - - - - - - - dbflute.interceptor - - - - - - dbflute.interceptor - - - - - dbflute.interceptor - - - - - dbflute.interceptor - - - - - dbflute.interceptor - - - - - dbflute.interceptor - - - - - dbflute.interceptor - - - - - dbflute.interceptor - - - - - dbflute.interceptor - Modified: notepad/trunk/src/main/webapp/WEB-INF/db/notepad.1.log.db =================================================================== (Binary files differ) Modified: notepad/trunk/src/main/webapp/WEB-INF/db/notepad.data.db =================================================================== (Binary files differ) From svnnotify ¡÷ sourceforge.jp Sun Dec 28 07:14:41 2008 From: svnnotify ¡÷ sourceforge.jp (svnnotify ¡÷ sourceforge.jp) Date: Sun, 28 Dec 2008 07:14:41 +0900 Subject: [pal-cvs 3894] [1629] added status column to userinfo table. Message-ID: <1230416081.971538.12902.nullmailer@users.sourceforge.jp> Revision: 1629 http://svn.sourceforge.jp/view?root=pal&view=rev&rev=1629 Author: shinsuke Date: 2008-12-28 07:14:41 +0900 (Sun, 28 Dec 2008) Log Message: ----------- added status column to userinfo table. replaced with dbflute 0.8.7. Removed Paths: ------------- notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/BFinder.java notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/CacheDaoSelector.java notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/DaoReadable.java notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/DaoSelector.java notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/DaoWritable.java notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/GenMetaData.java notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/annotation/OutsideSql.java notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/cbean/SimpleOrderByBean.java notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/cbean/outsidesql/OutsideSqlDao.java notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/s2dao/FetchNarrowingResultSetFactory.java notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/s2dao/S2BeanMetaDataFactoryImpl.java notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/s2dao/S2DaoInterceptor.java notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/s2dao/S2DaoLatestSqlProvider.java notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/s2dao/S2DaoMetaDataExtension.java notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/s2dao/S2DaoMetaDataFactoryImpl.java notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/s2dao/S2DaoPropertyTypeFactoryBuilderExtension.java notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/s2dao/S2DaoSelectDynamicCommand.java -------------- next part -------------- Deleted: notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/BFinder.java =================================================================== --- notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/BFinder.java 2008-12-27 22:13:37 UTC (rev 1628) +++ notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/BFinder.java 2008-12-27 22:14:41 UTC (rev 1629) @@ -1,110 +0,0 @@ -package jp.sf.pal.notepad.db.allcommon; - -import jp.sf.pal.notepad.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 find( - Class 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); - } - } -} Deleted: notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/CacheDaoSelector.java =================================================================== --- notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/CacheDaoSelector.java 2008-12-27 22:13:37 UTC (rev 1628) +++ notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/CacheDaoSelector.java 2008-12-27 22:14:41 UTC (rev 1629) @@ -1,66 +0,0 @@ -package jp.sf.pal.notepad.db.allcommon; - -import jp.sf.pal.notepad.db.allcommon.dbmeta.DBMeta; -import jp.sf.pal.notepad.db.allcommon.dbmeta.DBMetaInstanceHandler; - -/** - * The implementation of DAO-selector. - * - *
- * 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.
- * 
- * - * @author DBFlute(AutoGenerator) - */ - ¡÷ SuppressWarnings("unchecked") -public class CacheDaoSelector extends CacheAbstractSelector implements - DaoSelector { - - //========================================================================== - // ========= - // Selector - // ======== - /** - * Select DAO. - * - * @param The type of DAO. - * @param daoType DAO type. (NotNull) - * @return DAO. (NotNull) - */ - public DAO select(Class 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 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 daoType; - try { - daoType = (Class) Class.forName(daoTypeName); - } catch (ClassNotFoundException e) { - throw new RuntimeException("The class does not exist: " - + daoTypeName, e); - } - return daoType; - } -} Deleted: notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/DaoReadable.java =================================================================== --- notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/DaoReadable.java 2008-12-27 22:13:37 UTC (rev 1628) +++ notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/DaoReadable.java 2008-12-27 22:14:41 UTC (rev 1629) @@ -1,11 +0,0 @@ -package jp.sf.pal.notepad.db.allcommon; - -/** - * The interface of dao-readable. - * - * @author DBFlute(AutoGenerator) - */ -public interface DaoReadable { - public void initializeDaoMetaData(String methodName);// Very Internal - // Method! -} Deleted: notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/DaoSelector.java =================================================================== --- notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/DaoSelector.java 2008-12-27 22:13:37 UTC (rev 1628) +++ notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/DaoSelector.java 2008-12-27 22:14:41 UTC (rev 1629) @@ -1,26 +0,0 @@ -package jp.sf.pal.notepad.db.allcommon; - -/** - * The interface of DAO-selector. - * - * @author DBFlute(AutoGenerator) - */ -public interface DaoSelector { - - /** - * Select DAO. - * - * @param The type of DAO. - * @param daoType DAO type. (NotNull) - * @return Dao. (NotNull) - */ - public DAO select(Class daoType); - - /** - * Select DAO-readable by name. - * - * @param tableFlexibleName Table flexible name. (NotNull) - * @return DAO-readable. (NotNull) - */ - public DaoReadable byName(String tableFlexibleName); -} Deleted: notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/DaoWritable.java =================================================================== --- notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/DaoWritable.java 2008-12-27 22:13:37 UTC (rev 1628) +++ notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/DaoWritable.java 2008-12-27 22:14:41 UTC (rev 1629) @@ -1,70 +0,0 @@ -package jp.sf.pal.notepad.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 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 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 entityList); -} Deleted: notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/GenMetaData.java =================================================================== --- notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/GenMetaData.java 2008-12-27 22:13:37 UTC (rev 1628) +++ notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/GenMetaData.java 2008-12-27 22:14:41 UTC (rev 1629) @@ -1,258 +0,0 @@ -package jp.sf.pal.notepad.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.notepad.db.allcommon"; - } - - /** - * Get the property-value of baseBehaviorPackage. - * - * @return The property-value. - */ - public String getBaseBehaviorPackage() { - return "jp.sf.pal.notepad.db.bsbhv"; - } - - /** - * Get the property-value of baseDaoPackage. - * - * @return The property-value. - */ - public String getBaseDaoPackage() { - return "jp.sf.pal.notepad.db.bsdao"; - } - - /** - * Get the property-value of baseEntityPackage. - * - * @return The property-value. - */ - public String getBaseEntityPackage() { - return "jp.sf.pal.notepad.db.bsentity"; - } - - /** - * Get the property-value of conditionBeanPackage. - * - * @return The property-value. - */ - public String getConditionBeanPackage() { - return "jp.sf.pal.notepad.db.cbean"; - } - - /** - * Get the property-value of extendedDaoPackage. - * - * @return The property-value. - */ - public String getExtendedDaoPackage() { - return "jp.sf.pal.notepad.db.exdao"; - } - - /** - * Get the property-value of extendedBehaviorPackage. - * - * @return The property-value. - */ - public String getExtendedBehaviorPackage() { - return "jp.sf.pal.notepad.db.exbhv"; - } - - /** - * Get the property-value of extendedEntityPackage. - * - * @return The property-value. - */ - public String getExtendedEntityPackage() { - return "jp.sf.pal.notepad.db.exentity"; - } - - //========================================================================== - // ========= - // Optimistic Lock - // =============== - /** - * Get the property-value of updateDateFieldName. - * - * @return The property-value. - */ - public String getUpdateDateFieldName() { - return ""; - } - - /** - * Get the property-value of versionNoFieldName. - * - * @return The property-value. - */ - public String getVersionNoFieldName() { - return ""; - } - - //========================================================================== - // ========= - // Extract - // ======= - /** - * Get the value of 'extractAcceptStartBrace'. - * - * @return The property-value. (NotNull) - */ - public String getExtractAcceptStartBrace() { - return "@{"; - } - - /** - * Get the value of 'extractAcceptEndBrace'. - * - * @return The property-value. (NotNull) - */ - public String getExtractAcceptEndBrace() { - return "@}"; - } - - /** - * Get the value of 'extractAcceptDelimiter'. - * - * @return The property-value. (NotNull) - */ - public String getExtractAcceptDelimiter() { - return "@;"; - } - - /** - * Get the value of 'extractAcceptEqual'. - * - * @return The property-value. (NotNull) - */ - public String getExtractAcceptEqual() { - return "@="; - } -} Deleted: notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/annotation/OutsideSql.java =================================================================== --- notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/annotation/OutsideSql.java 2008-12-27 22:13:37 UTC (rev 1628) +++ notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/annotation/OutsideSql.java 2008-12-27 22:14:41 UTC (rev 1629) @@ -1,18 +0,0 @@ -package jp.sf.pal.notepad.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; -} Deleted: notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/cbean/SimpleOrderByBean.java =================================================================== --- notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/cbean/SimpleOrderByBean.java 2008-12-27 22:13:37 UTC (rev 1628) +++ notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/cbean/SimpleOrderByBean.java 2008-12-27 22:14:41 UTC (rev 1629) @@ -1,165 +0,0 @@ -package jp.sf.pal.notepad.db.allcommon.cbean; - -import jp.sf.pal.notepad.db.allcommon.cbean.sqlclause.OrderByClause; -import jp.sf.pal.notepad.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; - } -} Deleted: notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/cbean/outsidesql/OutsideSqlDao.java =================================================================== --- notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/cbean/outsidesql/OutsideSqlDao.java 2008-12-27 22:13:37 UTC (rev 1628) +++ notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/cbean/outsidesql/OutsideSqlDao.java 2008-12-27 22:14:41 UTC (rev 1629) @@ -1,37 +0,0 @@ -package jp.sf.pal.notepad.db.allcommon.cbean.outsidesql; - -import java.util.List; - -import jp.sf.pal.notepad.db.allcommon.DaoReadable; -import jp.sf.pal.notepad.db.allcommon.jdbc.CursorHandler; - -/** - * The dao of outside-sql. - * - * @author DBFlute(AutoGenerator) - */ -public interface OutsideSqlDao extends DaoReadable { - - //========================================================================== - // ========= - // Select - // ====== - List selectList(String path, Object pmb, - OutsideSqlOption option, Class entityType); - - 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); -} Deleted: notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/s2dao/FetchNarrowingResultSetFactory.java =================================================================== --- notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/s2dao/FetchNarrowingResultSetFactory.java 2008-12-27 22:13:37 UTC (rev 1628) +++ notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/s2dao/FetchNarrowingResultSetFactory.java 2008-12-27 22:14:41 UTC (rev 1629) @@ -1,125 +0,0 @@ -package jp.sf.pal.notepad.db.allcommon.s2dao; - -import java.sql.PreparedStatement; -import java.sql.ResultSet; -import java.sql.SQLException; -import java.sql.Statement; - -import jp.sf.pal.notepad.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); - } -} Deleted: notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/s2dao/S2BeanMetaDataFactoryImpl.java =================================================================== --- notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/s2dao/S2BeanMetaDataFactoryImpl.java 2008-12-27 22:13:37 UTC (rev 1628) +++ notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/s2dao/S2BeanMetaDataFactoryImpl.java 2008-12-27 22:14:41 UTC (rev 1629) @@ -1,116 +0,0 @@ -package jp.sf.pal.notepad.db.allcommon.s2dao; - -import java.sql.DatabaseMetaData; -import java.util.Collections; -import java.util.HashMap; -import java.util.Map; - -import jp.sf.pal.notepad.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, BeanMetaData> _metaMap = Collections - .synchronizedMap(new HashMap, BeanMetaData>()); - - @Override - public BeanMetaData createBeanMetaData(Class beanClass) { - final BeanMetaData cachedMeta = findCachedMeta(beanClass); - if (cachedMeta != null) { - return cachedMeta; - } else { - return super.createBeanMetaData(beanClass); - } - } - - @Override - public BeanMetaData createBeanMetaData(Class beanClass, - int relationNestLevel) { - final BeanMetaData cachedMeta = findCachedMeta(beanClass); - if (cachedMeta != null) { - return cachedMeta; - } else { - return super.createBeanMetaData(beanClass, relationNestLevel); - } - } - - @Override - public BeanMetaData createBeanMetaData(DatabaseMetaData dbMetaData, - Class beanClass, int relationNestLevel) { - final BeanMetaData cachedMeta = findOrCreateCachedMetaIfNeeds( - dbMetaData, beanClass, relationNestLevel); - if (cachedMeta != null) { - return cachedMeta; - } else { - return super.createBeanMetaData(dbMetaData, beanClass, - relationNestLevel); - } - } - - protected BeanMetaData findCachedMeta(Class beanClass) { - if (isDBFluteEntity(beanClass)) { - final BeanMetaData cachedMeta = getMetaFromCache(beanClass); - if (cachedMeta != null) { - return cachedMeta; - } - } - return null; - } - - protected BeanMetaData findOrCreateCachedMetaIfNeeds( - DatabaseMetaData dbMetaData, Class beanClass, int relationNestLevel) { - if (isDBFluteEntity(beanClass)) { - final BeanMetaData cachedMeta = getMetaFromCache(beanClass); - if (cachedMeta != null) { - return cachedMeta; - } else { - return super.createBeanMetaData(dbMetaData, beanClass, 0); - } - } - return null; - } - - @Override - protected BeanMetaDataImpl createBeanMetaDataImpl() { - return new BeanMetaDataImpl() { - @Override - public void initialize() { - final Class myBeanClass = getBeanClass(); - if (isDBFluteEntity(myBeanClass)) { - final BeanMetaData cachedMeta = getMetaFromCache(myBeanClass); - if (cachedMeta == null) { - _metaMap.put(myBeanClass, this); - } - } - super.initialize(); - } - }; - } - - protected boolean isDBFluteEntity(Class beanClass) { - return Entity.class.isAssignableFrom(beanClass); - } - - protected BeanMetaData getMetaFromCache(Class beanClass) { - return _metaMap.get(beanClass); - } - - /** - * Get the limit nest level of relation. - * - * @return The limit nest level of relation. - */ - @Override - protected int getLimitRelationNestLevel() { - return 2;// for Compatible to old version DBFlute - } -} \ No newline at end of file Deleted: notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/s2dao/S2DaoInterceptor.java =================================================================== --- notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/s2dao/S2DaoInterceptor.java 2008-12-27 22:13:37 UTC (rev 1628) +++ notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/s2dao/S2DaoInterceptor.java 2008-12-27 22:14:41 UTC (rev 1629) @@ -1,1027 +0,0 @@ -package jp.sf.pal.notepad.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.notepad.db.allcommon.Entity; -import jp.sf.pal.notepad.db.allcommon.InternalMapContext; -import jp.sf.pal.notepad.db.allcommon.XLog; -import jp.sf.pal.notepad.db.allcommon.cbean.ConditionBean; -import jp.sf.pal.notepad.db.allcommon.cbean.ConditionBeanContext; -import jp.sf.pal.notepad.db.allcommon.cbean.FetchNarrowingBean; -import jp.sf.pal.notepad.db.allcommon.cbean.FetchNarrowingBeanContext; -import jp.sf.pal.notepad.db.allcommon.cbean.outsidesql.OutsideSqlContext; -import jp.sf.pal.notepad.db.allcommon.cbean.outsidesql.OutsideSqlDao; -import jp.sf.pal.notepad.db.allcommon.cbean.outsidesql.OutsideSqlOption; -import jp.sf.pal.notepad.db.allcommon.dbmeta.DBMeta; -import jp.sf.pal.notepad.db.allcommon.dbmeta.DBMetaInstanceHandler; -import jp.sf.pal.notepad.db.allcommon.exception.EntityAlreadyUpdatedException; -import jp.sf.pal.notepad.db.allcommon.helper.stacktrace.InvokeNameExtractingResource; -import jp.sf.pal.notepad.db.allcommon.helper.stacktrace.InvokeNameResult; -import jp.sf.pal.notepad.db.allcommon.helper.stacktrace.impl.InvokeNameExtractorImpl; -import jp.sf.pal.notepad.db.allcommon.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 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 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 suffixList = Arrays.asList(new String[] { "Bhv", - "BehaviorReadable", "BehaviorWritable", "PagingInvoker" }); - final List keywordList = Arrays.asList(new String[] { "Bhv$", - "BehaviorReadable$", "BehaviorWritable$" }); - final List ousideSql1List = Arrays - .asList(new String[] { "OutsideSql" }); - final List ousideSql2List = Arrays - .asList(new String[] { "Executor" }); - final List 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 suffixList) { - for (String suffix : suffixList) { - if (className.endsWith(suffix)) { - return true; - } - } - return false; - } - - protected boolean isClassNameContains(String className, - List 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 outsideSqlType = jp.sf.pal.notepad.db.allcommon.annotation.OutsideSql.class; - final jp.sf.pal.notepad.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. - *

- * If this method is condition bean select target, make dynamic SQL. Else - * nothing. - * - * @param invocation Method invocation. (NotNull) - * @return ConditionBean. (Nullable) - */ - protected ConditionBean preprocessConditionBean(MethodInvocation invocation) { - final OutsideSqlContext outsideSqlContext = getOutsideSqlContext(); - if (outsideSqlContext != null) { - return null; // Because it has already finished setting up - // fetchNarrowingBean for outsideSql here. - } - - final ConditionBean cb; - { - final Object[] args = invocation.getArguments(); - if (args == null || args.length == 0) { - return null; - } - final Object arg0 = args[0]; - if (arg0 == null) { - return null; - } - if (!ConditionBeanContext.isTheTypeConditionBean(arg0.getClass())) {// The - // argument - // is - // not - // condition - // - - // bean - // ... - if (FetchNarrowingBeanContext.isTheTypeFetchNarrowingBean(arg0 - .getClass()) - && !isSelectCountIgnoreFetchScopeMethod(invocation)) { - // Fetch-narrowing-bean and Not select count! - FetchNarrowingBeanContext - .setFetchNarrowingBeanOnThread((FetchNarrowingBean) arg0); - } - return null; - } - cb = (ConditionBean) arg0; - } - - if (isSelectCountIgnoreFetchScopeMethod(invocation)) { - cb.xsetupSelectCountIgnoreFetchScope(); - } else { - FetchNarrowingBeanContext.setFetchNarrowingBeanOnThread(cb); - } - - ConditionBeanContext.setConditionBeanOnThread(cb); - return cb; - } - - /** - * Post-process condition-bean. - * - * @param invocation Method invocation. (NotNull) - * @param cb Condition-bean. (Nullable) - */ - protected void postprocessConditionBean(MethodInvocation invocation, - ConditionBean cb) { - if (cb == null) { - return; - } - if (isSelectCountIgnoreFetchScopeMethod(invocation)) { - cb.xafterCareSelectCountIgnoreFetchScope(); - } - } - - // ----------------------------------------------------- - // Clear Thread Local - // ------------------ - protected void clearThreadLocal() { - if (OutsideSqlContext.isExistOutsideSqlContextOnThread()) { - OutsideSqlContext.clearOutsideSqlContextOnThread(); - } - if (FetchNarrowingBeanContext.isExistFetchNarrowingBeanOnThread()) { - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - // Because there is possible that fetch narrowing has been ignored - // for manualPaging of outsideSql. - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - FetchNarrowingBeanContext.getFetchNarrowingBeanOnThread() - .restoreIgnoredFetchNarrowing(); - - FetchNarrowingBeanContext.clearFetchNarrowingBeanOnThread(); - } - if (ConditionBeanContext.isExistConditionBeanOnThread()) { - ConditionBeanContext.clearConditionBeanOnThread(); - } - if (InternalMapContext.isExistInternalMapContextOnThread()) { - InternalMapContext.clearInternalMapContextOnThread(); - } - } - - //========================================================================== - // ========= - // Context Helper - // ============== - protected OutsideSqlContext getOutsideSqlContext() { - if (!OutsideSqlContext.isExistOutsideSqlContextOnThread()) { - return null; - } - return OutsideSqlContext.getOutsideSqlContextOnThread(); - } - - protected boolean isSpecifiedOutsideSql() { - final OutsideSqlContext outsideSqlContext = getOutsideSqlContext(); - return outsideSqlContext != null - && outsideSqlContext.isSpecifiedOutsideSql(); - } - - protected void putObjectToMapContext(String key, Object value) { - InternalMapContext.setObject(key, value); - } - - //========================================================================== - // ========= - // Determination - // ============= - /** - * Is select count ignore-fetch-scope method? - * - * @param invocation Method invocation. (NotNull) - * @return Determination. - */ - protected boolean isSelectCountIgnoreFetchScopeMethod( - MethodInvocation invocation) { - final String name = invocation.getMethod().getName(); - return name.startsWith("readCount") || name.startsWith("selectCount"); - } - - //========================================================================== - // ========= - // General Helper - // ============== - /** - * Is the method abstract? - * - * @param method Method. (NotNull) - * @return Determination. (NotNull) - */ - public boolean isAbstract(Method method) { - final int mod = method.getModifiers(); - return Modifier.isAbstract(mod); - } - - /** - * Get the value of line separator. - * - * @return The value of line separator. (NotNull) - */ - protected String getLineSeparator() { - return System.getProperty("line.separator"); - } -} \ No newline at end of file Deleted: notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/s2dao/S2DaoLatestSqlProvider.java =================================================================== --- notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/s2dao/S2DaoLatestSqlProvider.java 2008-12-27 22:13:37 UTC (rev 1628) +++ notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/s2dao/S2DaoLatestSqlProvider.java 2008-12-27 22:14:41 UTC (rev 1629) @@ -1,20 +0,0 @@ -package jp.sf.pal.notepad.db.allcommon.s2dao; - -import jp.sf.pal.notepad.db.allcommon.jdbc.LatestSqlProvider; -import jp.sf.pal.notepad.db.allcommon.s2dao.internal.sqllog.InternalSqlLogRegistry; - -/** - * The provider of latest SQL as S2Dao. This instance should be singleton. - * - * @author DBFlute(AutoGenerator) - */ -public class S2DaoLatestSqlProvider implements LatestSqlProvider { - - public String getDisplaySql() { - return InternalSqlLogRegistry.peekCompleteSql(); - } - - public void clearSqlCache() { - InternalSqlLogRegistry.clearSqlLogRegistry(); - } -} Deleted: notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/s2dao/S2DaoMetaDataExtension.java =================================================================== --- notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/s2dao/S2DaoMetaDataExtension.java 2008-12-27 22:13:37 UTC (rev 1628) +++ notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/s2dao/S2DaoMetaDataExtension.java 2008-12-27 22:14:41 UTC (rev 1629) @@ -1,1460 +0,0 @@ -package jp.sf.pal.notepad.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.notepad.db.allcommon.BehaviorSelector; -import jp.sf.pal.notepad.db.allcommon.Entity; -import jp.sf.pal.notepad.db.allcommon.annotation.OutsideSql; -import jp.sf.pal.notepad.db.allcommon.cbean.ConditionBean; -import jp.sf.pal.notepad.db.allcommon.cbean.ConditionBeanContext; -import jp.sf.pal.notepad.db.allcommon.cbean.outsidesql.OutsideSqlContext; -import jp.sf.pal.notepad.db.allcommon.dbmeta.DBMeta; -import jp.sf.pal.notepad.db.allcommon.exception.BatchEntityAlreadyUpdatedException; -import jp.sf.pal.notepad.db.allcommon.exception.EntityAlreadyDeletedException; -import jp.sf.pal.notepad.db.allcommon.exception.EntityDuplicatedException; -import jp.sf.pal.notepad.db.allcommon.jdbc.CursorHandler; -import jp.sf.pal.notepad.db.allcommon.s2dao.internal.rshandler.InternalBeanArrayMetaDataResultSetHandler; -import jp.sf.pal.notepad.db.allcommon.s2dao.internal.rshandler.InternalBeanListMetaDataResultSetHandler; -import jp.sf.pal.notepad.db.allcommon.s2dao.internal.sqlcommand.InternalDeleteAutoStaticCommand; -import jp.sf.pal.notepad.db.allcommon.s2dao.internal.sqlcommand.InternalDeleteBatchAutoStaticCommand; -import jp.sf.pal.notepad.db.allcommon.s2dao.internal.sqlcommand.InternalDeleteQueryAutoDynamicCommand; -import jp.sf.pal.notepad.db.allcommon.s2dao.internal.sqlcommand.InternalInsertAutoDynamicCommand; -import jp.sf.pal.notepad.db.allcommon.s2dao.internal.sqlcommand.InternalInsertBatchAutoStaticCommand; -import jp.sf.pal.notepad.db.allcommon.s2dao.internal.sqlcommand.InternalProcedureCommand; -import jp.sf.pal.notepad.db.allcommon.s2dao.internal.sqlcommand.InternalUpdateAutoDynamicCommand; -import jp.sf.pal.notepad.db.allcommon.s2dao.internal.sqlcommand.InternalUpdateBatchAutoStaticCommand; -import jp.sf.pal.notepad.db.allcommon.s2dao.internal.sqlcommand.InternalUpdateDynamicCommand; -import jp.sf.pal.notepad.db.allcommon.s2dao.internal.sqlcommand.InternalUpdateModifiedOnlyCommand; -import jp.sf.pal.notepad.db.allcommon.s2dao.internal.sqlcommand.InternalUpdateQueryAutoDynamicCommand; -import jp.sf.pal.notepad.db.allcommon.s2dao.internal.sqlhandler.InternalDeleteBatchAutoHandler; -import jp.sf.pal.notepad.db.allcommon.s2dao.internal.sqlhandler.InternalUpdateBatchAutoHandler; -import jp.sf.pal.notepad.db.allcommon.s2dao.internal.sqlhandler.InternalBasicHandler.SQLExceptionHandler; -import jp.sf.pal.notepad.db.allcommon.s2dao.internal.various.InternalProcedureMetaData; -import jp.sf.pal.notepad.db.allcommon.s2dao.internal.various.InternalProcedureMetaDataFactory; -import jp.sf.pal.notepad.db.allcommon.s2dao.internal.various.InternalRelationRowCreator; -import jp.sf.pal.notepad.db.allcommon.s2dao.internal.various.InternalRowCreator; -import jp.sf.pal.notepad.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 ret = new ArrayList(); - while (rs.next()) { - ret.add(valueType.getValue(rs, 1)); - } - return ret; - } - } - - protected BeanMetaData createSpecifiedOutsideSqlCursorBeanMetaData( - Method method) { - return createOutsideSqlCustomizeBeanMetaDataFactory() - .createBeanMetaData(getOutsideSqlDefaultBeanClass(method)); - } - - protected ResultSetHandler createSpecifiedOutsideSqlCursorResultSetHandler( - BeanMetaData specifiedBeanMetaData) { - return new org.seasar.extension.jdbc.impl.ObjectResultSetHandler();// This - // is - // dummy - // for - // cursor - // handling - // ! - } - - // - - - - - - - - - - - - - // Execute - // - - - - - protected void setupSpecifiedOutsideSqlExecuteCommand(String sqlCommandKey, - Method method, OutsideSqlContext outsideSqlContext) { - // - - - - - - - - - - - - - - - - - - - - - - - - // The attribute of Specified-OutsideSqlContext. - // - - - - - - - - - - - - - - - - - - - - - - - - final String sql = outsideSqlContext.readFilteredOutsideSql( - getSqlFileEncoding(), dbms.getSuffix()); - final Object pmb = outsideSqlContext.getParameterBean(); - - // - - - - - - - - - - - - - - - - // The attribute of SqlCommand. - // - - - - - - - - - - - - - - - - final String[] argNames = (pmb != null ? new String[] { "pmb" } - : new String[] {}); - final Class[] argTypes = (pmb != null ? new Class[] { pmb - .getClass() } : new Class[] {}); - - final InternalUpdateDynamicCommand cmd = new InternalUpdateDynamicCommand( - dataSource, statementFactory) { - @Override - public Object execute(Object[] args) { - if (args.length != 3) { - String msg = "Internal Error! OutsideSqlDao.execute() should have 3 arguements: args.length=" - + args.length; - throw new IllegalStateException(msg); - } - Object arg = args[1]; - return super.execute(new Object[] { arg }); - } - }; - - // It is unnecessary for DBFlute! - // cmd.setNotSingleRowUpdatedExceptionClass( - // getNotSingleRowUpdatedExceptionClass(method)); - - registerSqlCommand(sqlCommandKey, method, sql, argNames, argTypes, cmd); - } - - // - - - - - - - - - - - - - // Call Procedure - // - - - - - - - - protected void setupSpecifiedOutsideSqlCallCommand(String sqlCommandKey, - Method method, OutsideSqlContext outsideSqlContext) { - // - - - - - - - - - - - - - - - - - - - - - - - - // The attribute of Specified-OutsideSqlContext. - // - - - - - - - - - - - - - - - - - - - - - - - - final Object pmb = outsideSqlContext.getParameterBean(); - final String procedureName = outsideSqlContext.getOutsideSqlPath(); - - // - - - - - - - - - - - - - - - - // The attribute of SqlCommand. - // - - - - - - - - - - - - - - - - final InternalProcedureMetaDataFactory factory = createInternalProcedureMetaDataFactory(); - factory.setValueTypeFactory(valueTypeFactory); - final Class pmbType = pmb != null ? pmb.getClass() : null; - final InternalProcedureMetaData metaData = factory - .createProcedureMetaData(procedureName, pmbType); - final InternalProcedureCommand cmd = createInternalProcedureCommand( - method, metaData); - putSqlCommand(sqlCommandKey, cmd); - } - - protected InternalProcedureMetaDataFactory createInternalProcedureMetaDataFactory() { - return new InternalProcedureMetaDataFactory(); - } - - protected InternalProcedureCommand createInternalProcedureCommand( - Method method, InternalProcedureMetaData metaData) { - final ResultSetHandler resultSetHandler = createResultSetHandler(method); - return new InternalProcedureCommand(dataSource, resultSetHandler, - statementFactory, metaData); - } - - // ----------------------------------------------------- - // Common of OutsideSql - // -------------------- - protected BeanMetaDataFactory createOutsideSqlCustomizeBeanMetaDataFactory() { - final S2BeanMetaDataFactoryImpl originalBmdFactory = new S2BeanMetaDataFactoryImpl() { - protected BeanMetaDataImpl createBeanMetaDataImpl() { - return newOutsideSqlCustomizeBeanMetaDataImpl(); - } - }; - originalBmdFactory - .setAnnotationReaderFactory(this.annotationReaderFactory); - originalBmdFactory - .setPropertyTypeFactoryBuilder(createOutsideSqlPropertyTypeFactoryBuilder()); - originalBmdFactory - .setRelationPropertyTypeFactoryBuilder(this.relationPropertyTypeFactoryBuilder); - originalBmdFactory.setTableNaming(this.tableNaming); - originalBmdFactory.setDataSource(this.dataSource); - originalBmdFactory.setDaoNamingConvention(this.daoNamingConvention); - originalBmdFactory.setBeanEnhancer(this.beanEnhancer); - return originalBmdFactory; - } - - protected BeanMetaDataImpl newOutsideSqlCustomizeBeanMetaDataImpl() { - return new OutsideSqlCustomizeBeanMetaDataImpl(); - } - - protected static class OutsideSqlCustomizeBeanMetaDataImpl extends - BeanMetaDataImpl { - // Though nothing to override, it uses original class just in case. - } - - protected S2DaoPropertyTypeFactoryBuilderExtension createOutsideSqlPropertyTypeFactoryBuilder() { - final S2DaoPropertyTypeFactoryBuilderExtension impl = new S2DaoPropertyTypeFactoryBuilderExtension(); - if (columnNaming == null) { - String msg = "Internal Error! The columnNaming should not be null! {Failed to Injection!}"; - throw new IllegalStateException(msg); - } - impl.setColumnNaming(columnNaming); - impl.setValueTypeFactory(valueTypeFactory); - return impl; - } - - protected Class getOutsideSqlDefaultBeanClass(Method method) { - final Class retType = method.getReturnType(); - if (java.util.List.class.isAssignableFrom(retType)) { - final Class elementType = InternalMethodUtil - .getElementTypeOfListFromReturnMethod(method); - if (elementType != null) { - return elementType; - } else { - return getBeanClass(); - } - } else if (retType.isArray()) { - return retType.getComponentType(); - } else if (retType.isPrimitive() - || !ValueTypes.getValueType(retType).equals(ValueTypes.OBJECT)) { - return getBeanClass(); - } else { - return retType; - } - } - - protected void registerSqlCommand(String sqlCommandKey, Method method, - String sql, String[] argNames, Class[] argTypes, - BeanMetaData myBeanMetaData) { - registerSqlCommand(sqlCommandKey, method, sql, argNames, argTypes, - createResultSetHandler(myBeanMetaData, method)); - } - - protected void registerSqlCommand(String sqlCommandKey, Method method, - String sql, String[] argNames, Class[] argTypes, - ResultSetHandler myResultSetHandler) { - final S2DaoSelectDynamicCommand cmd = createCustomizeSelectDynamicCommand(myResultSetHandler); - registerSqlCommand(sqlCommandKey, method, sql, argNames, argTypes, cmd); - } - - protected void registerSqlCommand(String sqlCommandKey, Method method, - String sql, String[] argNames, Class[] argTypes, - S2DaoSelectDynamicCommand cmd) { - cmd.setSql(sql); - cmd.setArgNames(argNames); - cmd.setArgTypes(argTypes); - this.sqlCommands.put(sqlCommandKey, cmd); - } - - protected void registerSqlCommand(String sqlCommandKey, Method method, - String sql, String[] argNames, Class[] argTypes, - InternalUpdateDynamicCommand cmd) { - cmd.setSql(sql); - cmd.setArgNames(argNames); - cmd.setArgTypes(argTypes); - this.sqlCommands.put(sqlCommandKey, cmd); - } - - //========================================================================== - // ========= - // Common Handlnig - // =============== - @Override - protected void putSqlCommand(String methodName, SqlCommand cmd) { - sqlCommands.put(methodName, cmd); - } - - protected boolean isCheckSingleRowUpdate(Method method) { - return checkSingleRowUpdateForAll - & daoAnnotationReader.isCheckSingleRowUpdate(method); - } - - //========================================================================== - // ========= - // Customize SelectDynamicCommand Creation - // ======================================= - /** - * Create the customize select dynamic command that is for all select SQL on - * DBFlute. - * - * @param handler The handler of result set. (NotNull) - * @return The customize select dynamic command. (NotNull) - */ - protected S2DaoSelectDynamicCommand createCustomizeSelectDynamicCommand( - ResultSetHandler handler) { - return new S2DaoSelectDynamicCommand(dataSource, statementFactory, - handler); - } - - //========================================================================== - // ========= - // ResultSetHandler Override - // ========================= - @Override - protected ResultSetHandler createResultSetHandler(Method method) { - return this.resultSetHandlerFactory.getResultSetHandler( - daoAnnotationReader, beanMetaData, method); - } - - protected ResultSetHandler createResultSetHandler( - BeanMetaData specifiedBeanMetaData, Method method) {// For specified - // BeanMetaData - return this.resultSetHandlerFactory.getResultSetHandler( - daoAnnotationReader, specifiedBeanMetaData, method); - } - - //========================================================================== - // ========= - // JDBC Delegator - // ============== - protected Connection getConnection() { - if (dataSource == null) { - throw new IllegalStateException( - "The dataSource should not be null!"); - } - try { - return dataSource.getConnection(); - } catch (SQLException e) { - handleSQLException(e, null); - return null;// Unreachable! - } - } - - protected DatabaseMetaData getMetaData(Connection conn) { - try { - return conn.getMetaData(); - } catch (SQLException e) { - handleSQLException(e, null); - return null;// Unreachable! - } - } - - protected String getDatabaseProductName(DatabaseMetaData dbMetaData) { - try { - return dbMetaData.getDatabaseProductName(); - } catch (SQLException e) { - handleSQLException(e, null); - return null;// Unreachable! - } - } - - protected void close(Connection conn) { - if (conn == null) { - return; - } - try { - conn.close(); - } catch (SQLException e) { - handleSQLException(e, null); - } - } - - //========================================================================== - // ========= - // Exception Handlnig - // ================== - protected void handleSQLException(SQLException e, Statement statement) { - new SQLExceptionHandler().handleSQLException(e, statement); - } - - //========================================================================== - // ========= - // ResultSetHandlerFactoryImpl Extension - // ===================================== - public static class ResultSetHandlerFactoryExtension extends - ResultSetHandlerFactoryImpl { - public ResultSetHandlerFactoryExtension() { - super(); - } - - @Override - protected RowCreator createRowCreator() { // [DAO-118] (2007/08/25) - return createInternalRowCreator(null); - } - - @Override - protected RelationRowCreator createRelationRowCreator() { - return createInternalRelationRowCreator(null); - } - - @Override - protected ResultSetHandler createBeanListMetaDataResultSetHandler( - BeanMetaData bmd) { // DBFlute Target - final InternalRowCreator rowCreator = createInternalRowCreator(bmd); - final InternalRelationRowCreator relationRowCreator = createInternalRelationRowCreator(bmd); - return new InternalBeanListMetaDataResultSetHandler(bmd, - rowCreator, relationRowCreator); - } - - @Override - protected ResultSetHandler createBeanArrayMetaDataResultSetHandler( - BeanMetaData bmd) { // DBFlute Target - final InternalRowCreator rowCreator = createInternalRowCreator(bmd); - final InternalRelationRowCreator relationRowCreator = createInternalRelationRowCreator(bmd); - return new InternalBeanArrayMetaDataResultSetHandler(bmd, - rowCreator, relationRowCreator); - } - - protected InternalRowCreator createInternalRowCreator(BeanMetaData bmd) { - final Class clazz = bmd != null ? bmd.getBeanClass() : null; - return InternalRowCreator.createInternalRowCreator(clazz); - } - - protected InternalRelationRowCreator createInternalRelationRowCreator( - BeanMetaData bmd) { - return new InternalRelationRowCreator(); // Not yet implemented - // about performance - // tuning! - } - } - - //========================================================================== - // ========= - // Vert Internal - // ============= - protected static class InternalMethodUtil { - public static Class getElementTypeOfListFromReturnMethod(Method method) { - return InternalReflectionUtil - .getElementTypeOfListFromReturnType(method); - } - } - - protected static class InternalReflectionUtil { - public static Class getElementTypeOfList(final Type parameterizedList) { - if (!(parameterizedList instanceof ParameterizedType)) { - return null; - } - final ParameterizedType parameterizedType = ParameterizedType.class - .cast(parameterizedList); - final Type rawType = parameterizedType.getRawType(); - if (!(rawType instanceof Class)) { - return null; - } - final Class rawClass = Class.class.cast(rawType); - if (!rawClass.isAssignableFrom(List.class)) { - return null; - } - final Type[] actualTypeArgument = parameterizedType - .getActualTypeArguments(); - if (actualTypeArgument == null || actualTypeArgument.length != 1) { - return null; - } - if (!(actualTypeArgument[0] instanceof Class)) { - return null; - } - return Class.class.cast(actualTypeArgument[0]); - } - - public static Class getElementTypeOfListFromParameterType( - final Method method, final int parameterPosition) { - final Type[] pmbTypes = method.getGenericParameterTypes(); - return getElementTypeOfList(pmbTypes[parameterPosition]); - } - - public static Class getElementTypeOfListFromReturnType( - final Method method) { - return getElementTypeOfList(method.getGenericReturnType()); - } - } - - //========================================================================== - // ========= - // Assist Helper - // ============= - protected DBMeta findDBMeta() { - final Class beanType = getBeanClass(); - if (beanType == null) { - return null; - } - if (!Entity.class.isAssignableFrom(beanType)) { - return null; - } - final Entity entity; - try { - entity = (Entity) beanType.newInstance(); - } catch (InstantiationException e) { - throw new IllegalStateException(e); - } catch (IllegalAccessException e) { - throw new IllegalStateException(e); - } - return entity.getDBMeta(); - } - - //========================================================================== - // ========= - // General Helper - // ============== - protected String getLineSeparator() { - return SimpleSystemUtil.getLineSeparator(); - } - - //========================================================================== - // ========= - // Accessor - // ======== - // ----------------------------------------------------- - // Sql File Encoding - // ----------------- - public String getSqlFileEncoding() { - return sqlFileEncoding; - } - - // ----------------------------------------------------- - // Bean Enhancer - // ------------- - public BeanEnhancer getBeanEnhancer() { - return beanEnhancer; - } - - public void setBeanEnhancer(final BeanEnhancer beanEnhancer) { - this.beanEnhancer = beanEnhancer; - } - - // ----------------------------------------------------- - // Annotation Reader Factory - // ------------------------- - public void setAnnotationReaderFactory( - org.seasar.dao.AnnotationReaderFactory annotationReaderFactory) { - this.annotationReaderFactory = annotationReaderFactory; - } - - // ----------------------------------------------------- - // Version After 1.0.47 - // -------------------- - public ColumnNaming getColumnNaming() { - return columnNaming; - } - - public void setColumnNaming(final ColumnNaming columnNaming) { - this.columnNaming = columnNaming; - } - - public PropertyTypeFactoryBuilder getPropertyTypeFactoryBuilder() { - return propertyTypeFactoryBuilder; - } - - public void setPropertyTypeFactoryBuilder( - final PropertyTypeFactoryBuilder propertyTypeFactoryBuilder) { - this.propertyTypeFactoryBuilder = propertyTypeFactoryBuilder; - } - - public RelationPropertyTypeFactoryBuilder getRelationPropertyTypeFactoryBuilder() { - return relationPropertyTypeFactoryBuilder; - } - - public void setRelationPropertyTypeFactoryBuilder( - final RelationPropertyTypeFactoryBuilder relationPropertyTypeFactoryBuilder) { - this.relationPropertyTypeFactoryBuilder = relationPropertyTypeFactoryBuilder; - } - - public TableNaming getTableNaming() { - return tableNaming; - } - - public void setTableNaming(final TableNaming tableNaming) { - this.tableNaming = tableNaming; - } - - // ----------------------------------------------------- - // DBFlute Extension - // ----------------- - public BehaviorSelector getBehaviorSelector() { - return _behaviorSelector; - } - - public void setBehaviorSelector(final BehaviorSelector behaviorSelector) { - this._behaviorSelector = behaviorSelector; - } - - public boolean isInternalDebug() { - return _internalDebug; - } - - public void setInternalDebug(final boolean internalDebug) { - this._internalDebug = internalDebug; - } -} Deleted: notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/s2dao/S2DaoMetaDataFactoryImpl.java =================================================================== --- notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/s2dao/S2DaoMetaDataFactoryImpl.java 2008-12-27 22:13:37 UTC (rev 1628) +++ notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/s2dao/S2DaoMetaDataFactoryImpl.java 2008-12-27 22:14:41 UTC (rev 1629) @@ -1,655 +0,0 @@ -package jp.sf.pal.notepad.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.notepad.db.allcommon.DBFluteConfig; -import jp.sf.pal.notepad.db.allcommon.cbean.ConditionBean; -import jp.sf.pal.notepad.db.allcommon.cbean.ConditionBeanContext; -import jp.sf.pal.notepad.db.allcommon.cbean.outsidesql.OutsideSqlContext; -import jp.sf.pal.notepad.db.allcommon.jdbc.StatementConfig; -import jp.sf.pal.notepad.db.allcommon.s2dao.internal.sqlhandler.InternalBasicHandler.SQLExceptionHandler; -import jp.sf.pal.notepad.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 daoMetaDataCache = new HashMap(); - - protected boolean initialized; - - protected boolean useDaoClassForLog; - - protected String sqlFileEncoding; - - protected BeanEnhancer beanEnhancer; - - // ----------------------------------------------------- - // Version After 1.0.47 - // -------------------- - /** The naming of column. {After S2Dao-1.0.47} */ - protected ColumnNaming columnNaming; - - /** The builder of property type factory. {After S2Dao-1.0.47} */ - protected PropertyTypeFactoryBuilder propertyTypeFactoryBuilder; - - /** The builder of relation property type factory. {After S2Dao-1.0.47} */ - protected RelationPropertyTypeFactoryBuilder relationPropertyTypeFactoryBuilder; - - /** The builder of table naming. {After S2Dao-1.0.47} */ - protected TableNaming tableNaming; - - // ----------------------------------------------------- - // DBFlute Extension - // ----------------- - /** The lock monitor of DAO meta data initialization. */ - protected Object _daoMetaDataInitializationLockMonitor = new Object(); - - //========================================================================== - // ========= - // Constructor - // =========== - public S2DaoMetaDataFactoryImpl(DataSource dataSource, - AnnotationReaderFactory annotationReaderFactory, - XADataSource xaDataSource) { - this.dataSource = dataSource; - this.annotationReaderFactory = annotationReaderFactory; - - _log - .info("/* * * * * * * * * * * * * * * * * * * * * * * * * * * * {DBFlute}"); - showInformation(dataSource, xaDataSource); - - // Stop the LinkageError! - ConditionBeanContext.initialize(); - - initializeDatabaseProductNameOfContext(xaDataSource); - - handleSqlLogRegistry(); - - DBFluteConfig.getInstance().lock(); - _log.info("* * * * */"); - } - - protected void showInformation(javax.sql.DataSource dataSource, - javax.sql.XADataSource xaDataSource) { - final StringBuilder sb = new StringBuilder(); - if (xaDataSource != null - && xaDataSource instanceof org.seasar.extension.dbcp.impl.XADataSourceImpl) { - final org.seasar.extension.dbcp.impl.XADataSourceImpl xaDataSourceImpl = (org.seasar.extension.dbcp.impl.XADataSourceImpl) xaDataSource; - final String driverClassName = xaDataSourceImpl - .getDriverClassName(); - final String url = xaDataSourceImpl.getURL(); - final String user = xaDataSourceImpl.getUser(); - sb.append(" [XADataSource]:").append(getLineSeparator()); - sb.append(" driver = " + driverClassName).append( - getLineSeparator()); - sb.append(" url = " + url).append(getLineSeparator()); - sb.append(" user = " + user); - } - _log.info("{Injection Information}" + getLineSeparator() + sb); - } - - protected void handleSqlLogRegistry() { - final StringBuilder sb = new StringBuilder(); - sb.append("{SqlLog Information}").append(getLineSeparator()); - sb.append(" [SqlLogRegistry]").append(getLineSeparator()); - if (DBFluteConfig.getInstance().isUseSqlLogRegistry()) { - if (InternalSqlLogRegistry.setupSqlLogRegistry()) { - sb - .append( - " ...Setting up SqlLogRegistry(org.seasar.extension.jdbc)!") - .append(getLineSeparator()); - sb - .append(" Because the property 'useSqlLogRegistry' of the config of DBFlute is true."); - } else { - sb - .append(" SqlLogRegistry(org.seasar.extension.jdbc) is not supported at the version!"); - } - } else { - final Object sqlLogRegistry = InternalSqlLogRegistry - .findContainerSqlLogRegistry(); - if (sqlLogRegistry != null) { - InternalSqlLogRegistry.closeRegistration(); - sb - .append( - " SqlLogRegistry(org.seasar.extension.jdbc) is close! It's default for DBFlute.") - .append(getLineSeparator()); - sb - .append(" If you want to use this, set SqlLogRegistry to SqlLogRegistryLocator at yourself."); - } else { - sb - .append(" SqlLogRegistry(org.seasar.extension.jdbc) is not available!"); - } - } - _log.info(sb); - } - - // ----------------------------------------------------- - // Database Product Name - // --------------------- - protected void initializeDatabaseProductNameOfContext( - javax.sql.XADataSource xaDataSource) { - if (getDatabaseProductNameFromContext() != null) { - return; - } - - // From JDBC Driver! - if (xaDataSource != null - && xaDataSource instanceof org.seasar.extension.dbcp.impl.XADataSourceImpl) { - final org.seasar.extension.dbcp.impl.XADataSourceImpl xaDataSourceImpl = (org.seasar.extension.dbcp.impl.XADataSourceImpl) xaDataSource; - final String driverClassName = xaDataSourceImpl - .getDriverClassName(); - if (driverClassName != null) { - if (setupDatabaseProductNameByDriverClassName(driverClassName)) { - _log - .info("...Initializing database product name from driverClassName: " - + getDatabaseProductNameFromContext()); - return; - } - } - } - - _log.info("...Initializing database product name as default: H2"); - setDatabaseProductNameToContext("H2"); - } - - protected String getDatabaseProductNameFromContext() { - return ConditionBeanContext.getDatabaseProductName(); - } - - protected void setDatabaseProductNameToContext(String name) { - ConditionBeanContext.setDatabaseProductName(name); - } - - protected boolean setupDatabaseProductNameByDriverClassName( - String driverClassName) { - return ConditionBeanContext - .setupDatabaseProductNameByDriverClassName(driverClassName); - } - - //========================================================================== - // ========= - // Implementation - // ============== - @SuppressWarnings("unchecked") - public DaoMetaData getDaoMetaData(final Class daoClass) { - if (!initialized) { - DisposableUtil.add(this); - initialized = true; - } - final String key = daoClass.getName(); - - // [A] - DaoMetaData dmd = getSynchronizedDaoMetaDataCache(key); - - // [B] - if (dmd != null) { - return dmd; - } - - // [C] - synchronized (_daoMetaDataInitializationLockMonitor) {// One Thread Only - // Entered - // [D] - dmd = getSynchronizedDaoMetaDataCache(key); - // [E] - if (dmd != null) { - // The second thread that stops at [C] can find - // because the first thread have already initialized. - if (_log.isDebugEnabled()) { - _log - .debug("...Getting daoMetaData as cache because the previous thread have already initilized."); - } - return dmd; - } - // [F] - if (_log.isDebugEnabled()) { - _log.debug("...Creating daoMetaData for " - + daoClass.getSimpleName() + "."); - } - final DaoMetaData dmdi = createDaoMetaData(daoClass); - putSynchronizedDaoMetaDataCache(key, dmdi); - } - // [G] - dmd = getSynchronizedDaoMetaDataCache(key); - if (dmd != null) { - return dmd; - } - String msg = "The cache should have data meta data here: key=" + key - + " cache=" + daoMetaDataCache; - throw new IllegalStateException(msg); - } - - @SuppressWarnings("unchecked") - protected void putSynchronizedDaoMetaDataCache(String key, DaoMetaData dmd) { - synchronized (daoMetaDataCache) { - daoMetaDataCache.put(key, dmd); - } - } - - protected DaoMetaData getSynchronizedDaoMetaDataCache(String key) { - DaoMetaData dmd = null; - synchronized (daoMetaDataCache) { - dmd = (DaoMetaData) daoMetaDataCache.get(key); - } - return dmd; - } - - //========================================================================== - // ========= - // DataMetaData Creation - // ===================== - protected DaoMetaData createDaoMetaData(final Class daoClass) { - final BeanDesc daoBeanDesc = BeanDescFactory.getBeanDesc(daoClass); - final DaoAnnotationReader daoAnnotationReader = annotationReaderFactory - .createDaoAnnotationReader(daoBeanDesc); - - final DaoMetaDataImpl daoMetaData = createDaoMetaDataExtension(); - daoMetaData.setDaoClass(daoClass); - daoMetaData.setDataSource(dataSource); - daoMetaData.setStatementFactory(createCustomizeStatememtFactory()); - daoMetaData.setResultSetFactory(createCustomizeResultSetFactory()); - daoMetaData.setValueTypeFactory(valueTypeFactory); - daoMetaData.setBeanMetaDataFactory(getBeanMetaDataFactory()); - daoMetaData.setDaoNamingConvention(getDaoNamingConvention()); - daoMetaData.setUseDaoClassForLog(useDaoClassForLog); - daoMetaData.setDaoAnnotationReader(daoAnnotationReader); - daoMetaData.setProcedureMetaDataFactory(procedureMetaDataFactory); - daoMetaData.setDtoMetaDataFactory(dtoMetaDataFactory); - daoMetaData.setResultSetHandlerFactory(resultSetHandlerFactory); - if (sqlFileEncoding != null) { - daoMetaData.setSqlFileEncoding(sqlFileEncoding); - } - if (pagingSqlRewriter != null) { - daoMetaData.setPagingSQLRewriter(pagingSqlRewriter); - } - daoMetaData.initialize(); - return daoMetaData; - } - - protected S2DaoMetaDataExtension createDaoMetaDataExtension() { - final S2DaoMetaDataExtension dmdExtension = newDaoMetaDataExtension(); - dmdExtension.setBeanEnhancer(beanEnhancer); - dmdExtension.setAnnotationReaderFactory(this.annotationReaderFactory); - dmdExtension.setColumnNaming(this.columnNaming); - dmdExtension - .setPropertyTypeFactoryBuilder(this.propertyTypeFactoryBuilder); - dmdExtension - .setRelationPropertyTypeFactoryBuilder(this.relationPropertyTypeFactoryBuilder); - dmdExtension.setTableNaming(tableNaming); - dmdExtension.setInternalDebug(DBFluteConfig.getInstance() - .isInternalDebug()); - return dmdExtension; - } - - protected S2DaoMetaDataExtension newDaoMetaDataExtension() { - return new S2DaoMetaDataExtension(); - } - - //========================================================================== - // ========= - // Result Set Factory - // ================== - /** - * Create the customize result set factory that is for all SQL on DBFlute. - * - * @return The customize statement factory. (NotNull) - */ - protected ResultSetFactory createCustomizeResultSetFactory() { - return new FetchNarrowingResultSetFactory(); - } - - //========================================================================== - // ========= - // Statement Factory - // ================= - /** - * Create the customize statement factory that is for all SQL on DBFlute. - * - * @return The customize statement factory. (NotNull) - */ - protected StatementFactory createCustomizeStatememtFactory() { - final StatementConfig defaultStatementConfig = DBFluteConfig - .getInstance().getDefaultStatementConfig(); - final boolean internalDebug = DBFluteConfig.getInstance() - .isInternalDebug(); - return new StatementFactory() { - public PreparedStatement createPreparedStatement(Connection con, - String sql) { - try { - final StatementConfig config = findStatementConfigOnThread(); - ; - final int resultSetType; - if (config != null && config.hasResultSetType()) { - resultSetType = config.getResultSetType(); - } else if (defaultStatementConfig != null - && defaultStatementConfig.hasResultSetType()) { - resultSetType = defaultStatementConfig - .getResultSetType(); - } else { - resultSetType = java.sql.ResultSet.TYPE_FORWARD_ONLY; - } - final int resultSetConcurrency = java.sql.ResultSet.CONCUR_READ_ONLY; - if (internalDebug) { - _log.debug("...Creating prepareStatement(sql, " - + resultSetType + ", " + resultSetConcurrency - + ")"); - } - final PreparedStatement ps = con.prepareStatement(sql, - resultSetType, resultSetConcurrency); - if (config != null && config.hasStatementOptions()) { - if (internalDebug) { - _log - .debug("...Setting statement config as request: " - + config); - } - reflectStatementOptions(config, ps); - } else { - reflectDefaultOptionsToStatementIfNeeds(ps); - } - return ps; - } catch (SQLException e) { - handleSQLException(e, null); - return null;// Unreachable! - } - } - - public CallableStatement createCallableStatement(Connection conn, - String sql) { - return prepareCall(conn, sql); - } - - protected StatementConfig findStatementConfigOnThread() { - final StatementConfig config; - if (ConditionBeanContext.isExistConditionBeanOnThread()) { - final ConditionBean cb = ConditionBeanContext - .getConditionBeanOnThread(); - config = cb.getStatementConfig(); - } else if (OutsideSqlContext.isExistOutsideSqlContextOnThread()) { - final OutsideSqlContext context = OutsideSqlContext - .getOutsideSqlContextOnThread(); - config = context.getStatementConfig(); - } else { - config = null; - } - return config; - } - - protected void reflectDefaultOptionsToStatementIfNeeds( - PreparedStatement ps) { - if (defaultStatementConfig != null - && defaultStatementConfig.hasStatementOptions()) { - if (internalDebug) { - _log.debug("...Setting statement config as default: " - + defaultStatementConfig); - } - reflectStatementOptions(defaultStatementConfig, ps); - return; - } - } - - protected void reflectStatementOptions(StatementConfig config, - PreparedStatement ps) { - try { - if (config.hasQueryTimeout()) { - ps.setQueryTimeout(config.getQueryTimeout()); - } - if (config.hasFetchSize()) { - ps.setFetchSize(config.getFetchSize()); - } - if (config.hasMaxRows()) { - ps.setMaxRows(config.getMaxRows()); - } - } catch (SQLException e) { - handleSQLException(e, ps); - } - } - - protected CallableStatement prepareCall(Connection conn, String sql) { - try { - return conn.prepareCall(sql); - } catch (SQLException e) { - handleSQLException(e, null); - return null;// Unreachable! - } - } - - protected void handleSQLException(SQLException e, - Statement statement) { - new SQLExceptionHandler().handleSQLException(e, statement); - } - }; - } - - //========================================================================== - // ========= - // Dispose - // ======= - public synchronized void dispose() { - daoMetaDataCache.clear(); - initialized = false; - } - - //========================================================================== - // ========= - // Helper - // ====== - /** - * Get the value of line separator. - * - * @return The value of line separator. (NotNull) - */ - protected static String getLineSeparator() { - return System.getProperty("line.separator"); - } - - //========================================================================== - // ========= - // Accessor - // ======== - // ----------------------------------------------------- - // Factory Basic - // ------------- - public void setValueTypeFactory(final ValueTypeFactory valueTypeFactory) { - this.valueTypeFactory = valueTypeFactory; - } - - protected BeanMetaDataFactory getBeanMetaDataFactory() { - return beanMetaDataFactory; - } - - public void setBeanMetaDataFactory( - final BeanMetaDataFactory beanMetaDataFactory) { - this.beanMetaDataFactory = beanMetaDataFactory; - } - - public DaoNamingConvention getDaoNamingConvention() { - return daoNamingConvention; - } - - public void setDaoNamingConvention( - final DaoNamingConvention daoNamingConvention) { - this.daoNamingConvention = daoNamingConvention; - } - - public void setAnnotationReaderFactory( - final AnnotationReaderFactory annotationReaderFactory) { - this.annotationReaderFactory = annotationReaderFactory; - } - - public void setDataSource(final DataSource dataSource) { - this.dataSource = dataSource; - } - - public void setUseDaoClassForLog(final boolean userDaoClassForLog) { - useDaoClassForLog = userDaoClassForLog; - } - - public void setResultSetHandlerFactory( - final ResultSetHandlerFactory resultSetHandlerFactory) { - this.resultSetHandlerFactory = resultSetHandlerFactory; - } - - public void setDtoMetaDataFactory( - final DtoMetaDataFactory dtoMetaDataFactory) { - this.dtoMetaDataFactory = dtoMetaDataFactory; - } - - public void setProcedureMetaDataFactory( - ProcedureMetaDataFactory procedureMetaDataFactory) { - this.procedureMetaDataFactory = procedureMetaDataFactory; - } - - public void setPagingSQLRewriter(final PagingSqlRewriter pagingSqlRewriter) { - this.pagingSqlRewriter = pagingSqlRewriter; - } - - public String getSqlFileEncoding() { - return sqlFileEncoding; - } - - public void setSqlFileEncoding(final String encoding) { - sqlFileEncoding = encoding; - } - - public BeanEnhancer getBeanEnhancer() { - return beanEnhancer; - } - - public void setBeanEnhancer(final BeanEnhancer beanEnhancer) { - this.beanEnhancer = beanEnhancer; - } - - // ----------------------------------------------------- - // Version After 1.0.47 - // -------------------- - public ColumnNaming getColumnNaming() { - return columnNaming; - } - - public void setColumnNaming(final ColumnNaming columnNaming) { - this.columnNaming = columnNaming; - } - - public PropertyTypeFactoryBuilder getPropertyTypeFactoryBuilder() { - return propertyTypeFactoryBuilder; - } - - public void setPropertyTypeFactoryBuilder( - final PropertyTypeFactoryBuilder propertyTypeFactoryBuilder) { - this.propertyTypeFactoryBuilder = propertyTypeFactoryBuilder; - } - - public RelationPropertyTypeFactoryBuilder getRelationPropertyTypeFactoryBuilder() { - return relationPropertyTypeFactoryBuilder; - } - - public void setRelationPropertyTypeFactoryBuilder( - final RelationPropertyTypeFactoryBuilder relationPropertyTypeFactoryBuilder) { - this.relationPropertyTypeFactoryBuilder = relationPropertyTypeFactoryBuilder; - } - - public TableNaming getTableNaming() { - return tableNaming; - } - - public void setTableNaming(final TableNaming tableNaming) { - this.tableNaming = tableNaming; - } -} \ No newline at end of file Deleted: notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/s2dao/S2DaoPropertyTypeFactoryBuilderExtension.java =================================================================== --- notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/s2dao/S2DaoPropertyTypeFactoryBuilderExtension.java 2008-12-27 22:13:37 UTC (rev 1628) +++ notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/s2dao/S2DaoPropertyTypeFactoryBuilderExtension.java 2008-12-27 22:14:41 UTC (rev 1629) @@ -1,215 +0,0 @@ -package jp.sf.pal.notepad.db.allcommon.s2dao; - -import java.sql.DatabaseMetaData; -import java.util.ArrayList; -import java.util.List; - -import jp.sf.pal.notepad.db.allcommon.Entity; -import jp.sf.pal.notepad.db.allcommon.dbmeta.DBMeta; - -import org.seasar.dao.BeanAnnotationReader; -import org.seasar.dao.ColumnNaming; -import org.seasar.dao.Dbms; -import org.seasar.dao.PropertyTypeFactory; -import org.seasar.dao.PropertyTypeFactoryBuilder; -import org.seasar.dao.ValueTypeFactory; -import org.seasar.dao.impl.AbstractPropertyTypeFactory; -import org.seasar.extension.jdbc.PropertyType; -import org.seasar.framework.beans.BeanDesc; -import org.seasar.framework.beans.PropertyDesc; - -/** - * The factory builder of property type for S2Dao. {Since S2Dao-1.0.47} - * - * @author DBFlute(AutoGenerator) - */ - ¡÷ SuppressWarnings("unchecked") -public class 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 list = new ArrayList(); - final BeanDesc beanDesc = getBeanDesc(); - for (int i = 0; i < beanDesc.getPropertyDescSize(); ++i) { - final PropertyDesc pd = beanDesc.getPropertyDesc(i); - - // Read-only property is unnecessary! - if (!pd.hasWriteMethod()) { - continue; - } - - // Relation property is unnecessary! - if (isRelation(pd)) { - continue; - } - - final PropertyType pt = createPropertyType(pd); - pt.setPrimaryKey(isPrimaryKey(pd)); - pt.setPersistent(isPersistent(pt)); - list.add(pt); - } - return list.toArray(new PropertyType[list.size()]); - } - - @Override - protected boolean isRelation(PropertyDesc propertyDesc) { - final String propertyName = propertyDesc.getPropertyName(); - if (hasDBMeta() - && (_dbmeta.hasForeign(propertyName) || _dbmeta - .hasReferrer(propertyName))) { - return true; - } - return hasRelationNoAnnotation(propertyDesc); - } - - protected boolean hasRelationNoAnnotation(PropertyDesc propertyDesc) { - return beanAnnotationReader.hasRelationNo(propertyDesc); - } - - @Override - protected boolean isPrimaryKey(PropertyDesc propertyDesc) { - final String propertyName = propertyDesc.getPropertyName(); - if (hasDBMeta() && _dbmeta.hasPrimaryKey() - && _dbmeta.hasColumn(propertyName)) { - if (_dbmeta.findColumnInfo(propertyName).isPrimary()) { - return true; - } - } - return hasIdAnnotation(propertyDesc); - } - - protected boolean hasIdAnnotation(PropertyDesc propertyDesc) { - final Dbms dbms = getDbms(); - return beanAnnotationReader.getId(propertyDesc, dbms) != null; - } - - @Override - protected boolean isPersistent(PropertyType propertyType) { - final String propertyName = propertyType.getPropertyName(); - final PropertyDesc propertyDesc = propertyType.getPropertyDesc(); - if ((hasDBMeta() && _dbmeta.hasColumn(propertyName)) - || hasColumnAnnotation(propertyDesc)) { - if (!isElementOfNoPersistentProps(propertyDesc)) { - return true; - } - } - return false; - } - - protected boolean hasColumnAnnotation(PropertyDesc propertyDesc) { - return beanAnnotationReader.getColumnAnnotation(propertyDesc) != null; - } - - protected boolean isElementOfNoPersistentProps(PropertyDesc propertyDesc) { - final String propertyName = propertyDesc.getPropertyName(); - final String[] props = _noPersisteneProps; - if (props != null && props.length >= 0) { - for (int i = 0; i < props.length; ++i) { - if (props[i].equals(propertyName)) { - return true; - } - } - } - return false; - } - } - - //========================================================================== - // ========= - // Accessor - // ======== - public ValueTypeFactory getValueTypeFactory() { - return valueTypeFactory; - } - - public void setValueTypeFactory(ValueTypeFactory valueTypeFactory) { - this.valueTypeFactory = valueTypeFactory; - } - - public ColumnNaming getColumnNaming() { - return columnNaming; - } - - public void setColumnNaming(ColumnNaming columnNaming) { - this.columnNaming = columnNaming; - } -} Deleted: notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/s2dao/S2DaoSelectDynamicCommand.java =================================================================== --- notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/s2dao/S2DaoSelectDynamicCommand.java 2008-12-27 22:13:37 UTC (rev 1628) +++ notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/s2dao/S2DaoSelectDynamicCommand.java 2008-12-27 22:14:41 UTC (rev 1629) @@ -1,491 +0,0 @@ -package jp.sf.pal.notepad.db.allcommon.s2dao; - -import java.util.ArrayList; -import java.util.List; - -import javax.sql.DataSource; - -import jp.sf.pal.notepad.db.allcommon.cbean.ConditionBean; -import jp.sf.pal.notepad.db.allcommon.cbean.ConditionBeanContext; -import jp.sf.pal.notepad.db.allcommon.cbean.outsidesql.OutsideSqlContext; -import jp.sf.pal.notepad.db.allcommon.s2dao.internal.sqlcommand.InternalAbstractDynamicCommand; -import jp.sf.pal.notepad.db.allcommon.s2dao.internal.sqlhandler.InternalBasicSelectHandler; -import jp.sf.pal.notepad.db.allcommon.util.SimpleStringUtil; -import jp.sf.pal.notepad.db.allcommon.util.SimpleSystemUtil; - -import org.seasar.dao.CommandContext; -import org.seasar.extension.jdbc.ResultSetHandler; -import org.seasar.extension.jdbc.StatementFactory; -import org.seasar.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 bindVariableList = new ArrayList(4); - final List bindVariableTypeList = new ArrayList(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 bindVariableList = new java.util.ArrayList(); - final java.util.List bindVariableTypeList = new java.util.ArrayList(); - 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.notepad.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.notepad.db.allcommon.jdbc.CursorHandler) { - final jp.sf.pal.notepad.db.allcommon.jdbc.CursorHandler cursorHandler = (jp.sf.pal.notepad.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 bindVariableList, List 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 bindVariableList, List 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 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 bindVariableList, List bindVariableTypeList) { - final Object[] bindVariables = ctx.getBindVariables(); - addBindVariableList(bindVariableList, bindVariables); - final Class[] bindVariableTypes = ctx.getBindVariableTypes(); - addBindVariableTypeList(bindVariableTypeList, bindVariableTypes); - } - - protected void addBindVariableList(List bindVariableList, - Object[] bindVariables) { - for (int i = 0; i < bindVariables.length; i++) { - bindVariableList.add(bindVariables[i]); - } - } - - protected void addBindVariableTypeList(List 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 From svnnotify ¡÷ sourceforge.jp Sun Dec 28 07:18:30 2008 From: svnnotify ¡÷ sourceforge.jp (svnnotify ¡÷ sourceforge.jp) Date: Sun, 28 Dec 2008 07:18:30 +0900 Subject: [pal-cvs 3895] [1630] added status column to userinfo table. Message-ID: <1230416310.333628.16385.nullmailer@users.sourceforge.jp> Revision: 1630 http://svn.sourceforge.jp/view?root=pal&view=rev&rev=1630 Author: shinsuke Date: 2008-12-28 07:18:30 +0900 (Sun, 28 Dec 2008) Log Message: ----------- added status column to userinfo table. replaced with dbflute 0.8.7. Modified Paths: -------------- scheduler/trunk/dbflute/_project.bat scheduler/trunk/dbflute/_project.sh scheduler/trunk/dbflute/build-scheduler.properties scheduler/trunk/mydbflute/README.txt scheduler/trunk/src/main/config/erd/scheduler.erd scheduler/trunk/src/main/config/sql/scheduler.ddl scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/BehaviorSelector.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/DBFluteConfig.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/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/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/ckey/ConditionKey.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/LikeSearchOption.java 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/outsidesql/OutsideSqlContext.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/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/sqlclause/AbstractSqlClause.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/SqlClauseOracle.java 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/HierarchyArranger.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/info/ColumnInfo.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/helper/MapStringBuilderImpl.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/internal/rshandler/InternalAbstractDtoMetaDataResultSetHandler.java 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/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/InternalUpdateQueryAutoDynamicCommand.java 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/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/sqlparser/InternalSqlParser.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/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/bsbhv/BsEventScheduleBhv.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/bsbhv/BsEventScheduleContentBhv.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/bsbhv/BsEventScheduleMappingBhv.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/bsbhv/BsFacilityBhv.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/bsbhv/BsFacilityContentBhv.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/bsbhv/BsFacilityGroupBhv.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/bsbhv/BsFacilityScheduleMappingBhv.java 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/BsUserInfoBhv.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/bsentity/BsEventSchedule.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/bsentity/BsEventScheduleContent.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/bsentity/BsEventScheduleMapping.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/bsentity/BsFacility.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/bsentity/BsFacilityContent.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/bsentity/BsFacilityGroup.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/bsentity/BsFacilityScheduleMapping.java 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/BsUserInfo.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/bsentity/dbmeta/EventScheduleContentDbm.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/bsentity/dbmeta/EventScheduleDbm.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/bsentity/dbmeta/EventScheduleMappingDbm.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/bsentity/dbmeta/FacilityContentDbm.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/bsentity/dbmeta/FacilityDbm.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/bsentity/dbmeta/FacilityGroupDbm.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/bsentity/dbmeta/FacilityScheduleMappingDbm.java 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/UserInfoDbm.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/bs/BsEventScheduleCB.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/bs/BsEventScheduleContentCB.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/bs/BsEventScheduleMappingCB.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/bs/BsFacilityCB.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/bs/BsFacilityContentCB.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/bs/BsFacilityGroupCB.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/bs/BsFacilityScheduleMappingCB.java 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/BsUserInfoCB.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/cq/bs/AbstractBsEventScheduleCQ.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/cq/bs/AbstractBsEventScheduleContentCQ.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/cq/bs/AbstractBsEventScheduleMappingCQ.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/cq/bs/AbstractBsFacilityCQ.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/cq/bs/AbstractBsFacilityContentCQ.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/cq/bs/AbstractBsFacilityGroupCQ.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/cq/bs/AbstractBsFacilityScheduleMappingCQ.java 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/AbstractBsUserInfoCQ.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/cq/bs/BsEventScheduleCQ.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/cq/bs/BsEventScheduleContentCQ.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/cq/bs/BsEventScheduleMappingCQ.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/cq/bs/BsFacilityCQ.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/cq/bs/BsFacilityContentCQ.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/cq/bs/BsFacilityGroupCQ.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/cq/bs/BsFacilityScheduleMappingCQ.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/BsUserInfoCQ.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/cq/ciq/EventScheduleCIQ.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/cq/ciq/EventScheduleContentCIQ.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/cq/ciq/EventScheduleMappingCIQ.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/cq/ciq/FacilityCIQ.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/cq/ciq/FacilityContentCIQ.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/cq/ciq/FacilityGroupCIQ.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/cq/ciq/FacilityScheduleMappingCIQ.java 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/UserInfoCIQ.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/nss/EventScheduleContentNss.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/nss/EventScheduleMappingNss.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/nss/EventScheduleNss.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/nss/FacilityContentNss.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/nss/FacilityGroupNss.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/nss/FacilityNss.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/nss/FacilityScheduleMappingNss.java 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/UserInfoNss.java scheduler/trunk/src/main/resources/dbflute.dicon scheduler/trunk/src/main/webapp/WEB-INF/db/scheduler.1.log.db scheduler/trunk/src/main/webapp/WEB-INF/db/scheduler.data.db Added Paths: ----------- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/CommonColumnAutoSetupper.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/CommonColumnBasicAutoSetupper.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/DBDef.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/bhv/core/ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/bhv/core/BehaviorCommand.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/bhv/core/BehaviorCommandComponentSetup.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/bhv/core/BehaviorCommandInvoker.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/bhv/core/BehaviorInitializer.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/bhv/core/SqlExecution.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/bhv/core/SqlExecutionCreator.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/bhv/core/command/ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/bhv/core/command/AbstractBehaviorCommand.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/bhv/core/command/AbstractEntityCommand.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/bhv/core/command/AbstractListEntityCommand.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/bhv/core/command/AbstractOutsideSqlCommand.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/bhv/core/command/AbstractOutsideSqlSelectCommand.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/bhv/core/command/AbstractSelectCBCommand.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/bhv/core/command/BatchDeleteEntityCommand.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/bhv/core/command/BatchDeleteNonstrictEntityCommand.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/bhv/core/command/BatchInsertEntityCommand.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/bhv/core/command/BatchUpdateEntityCommand.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/bhv/core/command/BatchUpdateNonstrictEntityCommand.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/bhv/core/command/DeleteEntityCommand.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/bhv/core/command/DeleteNonstrictEntityCommand.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/bhv/core/command/InsertEntityCommand.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/bhv/core/command/OutsideSqlCallCommand.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/bhv/core/command/OutsideSqlExecuteCommand.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/bhv/core/command/OutsideSqlSelectCursorCommand.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/bhv/core/command/OutsideSqlSelectListCommand.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/bhv/core/command/QueryDeleteCBCommand.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/bhv/core/command/QueryUpdateEntityCBCommand.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/bhv/core/command/SelectCountCBCommand.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/bhv/core/command/SelectListCBCommand.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/bhv/core/command/SelectNextValCommand.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/bhv/core/command/SelectScalarCBCommand.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/bhv/core/command/UpdateEntityCommand.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/bhv/core/command/UpdateNonstrictEntityCommand.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/bhv/core/execution/ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/bhv/core/execution/BasicSelectExecution.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/bhv/core/execution/OutsideSqlSelectExecution.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/bhv/core/execution/SelectCBExecution.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/cbean/ScalarQuery.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/cbean/ckey/ConditionKeyNotLikeSearch.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/helper/StringKeyMap.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/helper/StringSet.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/s2dao/BeanMetaDataFactoryExtension.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/s2dao/PropertyTypeFactoryBuilderExtension.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/s2dao/SqlLogRegistryLatestSqlProvider.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/s2dao/internal/various/InternalIdentifierAbstractGenerator.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/s2dao/internal/various/InternalIdentifierAssignedGenerator.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/s2dao/internal/various/InternalIdentifierGeneratorFactory.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/s2dao/internal/various/InternalIdentifierIdentityGenerator.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/s2dao/internal/various/InternalIdentifierSequenceGenerator.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/s2dao/internal/various/InternalStatementFactory.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/util/SimpleResourceUtil.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/util/SimpleTypeUtil.java Removed Paths: ------------- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/BFinder.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/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/GenMetaData.java 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/cbean/SimpleOrderByBean.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/s2dao/FetchNarrowingResultSetFactory.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/bsdao/ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/exdao/ -------------- next part -------------- Modified: scheduler/trunk/dbflute/_project.bat =================================================================== --- scheduler/trunk/dbflute/_project.bat 2008-12-27 22:14:41 UTC (rev 1629) +++ scheduler/trunk/dbflute/_project.bat 2008-12-27 22:18:30 UTC (rev 1630) @@ -2,4 +2,4 @@ set MY_PROJECT_NAME=scheduler -set DBFLUTE_HOME=..\mydbflute\dbflute-0.8.2 +set DBFLUTE_HOME=..\mydbflute\dbflute-0.8.7 Modified: scheduler/trunk/dbflute/_project.sh =================================================================== --- scheduler/trunk/dbflute/_project.sh 2008-12-27 22:14:41 UTC (rev 1629) +++ scheduler/trunk/dbflute/_project.sh 2008-12-27 22:18:30 UTC (rev 1630) @@ -2,4 +2,4 @@ export MY_PROJECT_NAME=scheduler -export DBFLUTE_HOME=../mydbflute/dbflute-0.8.2 +export DBFLUTE_HOME=../mydbflute/dbflute-0.8.7 Modified: scheduler/trunk/dbflute/build-scheduler.properties =================================================================== --- scheduler/trunk/dbflute/build-scheduler.properties 2008-12-27 22:14:41 UTC (rev 1629) +++ scheduler/trunk/dbflute/build-scheduler.properties 2008-12-27 22:18:30 UTC (rev 1630) @@ -157,5 +157,5 @@ torque.additionalForeignKeyMap = map:{ \ } -#torque.isDeleteOldTableClass = true +torque.isDeleteOldTableClass = true Modified: scheduler/trunk/mydbflute/README.txt =================================================================== --- scheduler/trunk/mydbflute/README.txt 2008-12-27 22:14:41 UTC (rev 1629) +++ scheduler/trunk/mydbflute/README.txt 2008-12-27 22:18:30 UTC (rev 1630) @@ -1,3 +1,3 @@ -$ mkdir dbflute-0.8.2 -$ cd dbflute-0.8.2 -$ unzip ../dbflute-0.8.2.zip +$ mkdir dbflute-0.8.7 +$ cd dbflute-0.8.7 +$ unzip ../dbflute-0.8.7.zip Modified: scheduler/trunk/src/main/config/erd/scheduler.erd =================================================================== --- scheduler/trunk/src/main/config/erd/scheduler.erd 2008-12-27 22:14:41 UTC (rev 1629) +++ scheduler/trunk/src/main/config/erd/scheduler.erd 2008-12-27 22:18:30 UTC (rev 1630) @@ -204,6 +204,22 @@ + status + Status + + VARCHAR + String + true + 12 + + 1 + false + false + + false + + + created_time Created Time @@ -233,7 +249,7 @@ updated_time Updated Time - + 10 true false @@ -255,7 +271,7 @@ deleted_time Deleted Time - + 10 false false @@ -292,6 +308,11 @@ + + 255 + 255 + 206 + 185 199 @@ -384,7 +405,7 @@ created_time Created Time - + 10 true false @@ -406,7 +427,7 @@ updated_time Updated Time - + 10 true false @@ -428,7 +449,7 @@ deleted_time Deleted Time - + 10 false false @@ -450,7 +471,7 @@ versionNo Version No. - + 10 true false @@ -460,6 +481,11 @@ + + 255 + 255 + 206 + 40 719 @@ -529,6 +555,11 @@ + + 255 + 255 + 206 + 44 40 @@ -686,7 +717,7 @@ created_time Created Time - + 10 true false @@ -708,7 +739,7 @@ updated_time Updated Time - + 10 true false @@ -730,7 +761,7 @@ deleted_time Deleted Time - + 10 false false @@ -752,7 +783,7 @@ versionNo Version No. - + 10 true false @@ -762,6 +793,11 @@ + + 255 + 255 + 206 + 364 719 @@ -826,6 +862,11 @@ + + 255 + 255 + 206 + 305 40 @@ -962,6 +1003,11 @@ + + 255 + 255 + 206 + 557 40 @@ -1194,6 +1240,11 @@ + + 255 + 255 + 206 + 1091 199 @@ -1242,6 +1293,11 @@ + + 255 + 255 + 206 + 1332 40 @@ -1333,6 +1389,11 @@ + + 255 + 255 + 206 + 1076 40 @@ -1495,6 +1556,11 @@ + + 255 + 255 + 206 + 823 199 @@ -1630,6 +1696,11 @@ + + 255 + 255 + 206 + 823 719 @@ -1701,6 +1772,11 @@ + + 255 + 255 + 206 + 839 40 Modified: scheduler/trunk/src/main/config/sql/scheduler.ddl =================================================================== --- scheduler/trunk/src/main/config/sql/scheduler.ddl 2008-12-27 22:14:41 UTC (rev 1629) +++ scheduler/trunk/src/main/config/sql/scheduler.ddl 2008-12-27 22:18:30 UTC (rev 1630) @@ -11,9 +11,9 @@ DROP TABLE role_info; DROP TABLE group_info; -/********************************** -Table Name: Group Information -**********************************/ +/**********************************/ +/* Table Name: Group Information */ +/**********************************/ CREATE TABLE group_info( group_id VARCHAR(255) NOT NULL PRIMARY KEY, name VARCHAR(100), @@ -30,9 +30,9 @@ versionNo INTEGER NOT NULL ); -/********************************** -Table Name: Role Information -**********************************/ +/**********************************/ +/* Table Name: Role Information */ +/**********************************/ CREATE TABLE role_info( role_id VARCHAR(255) NOT NULL PRIMARY KEY, name VARCHAR(100), @@ -49,9 +49,9 @@ versionNo INTEGER NOT NULL ); -/********************************** -Table Name: User Information -**********************************/ +/**********************************/ +/* Table Name: User Information */ +/**********************************/ CREATE TABLE user_info( user_id VARCHAR(255) NOT NULL PRIMARY KEY, given_name VARCHAR(100), @@ -68,6 +68,7 @@ locale VARCHAR(5), role_id VARCHAR(255), group_id VARCHAR(255), + status VARCHAR(1), created_time TIMESTAMP NOT NULL, created_by VARCHAR(255) NOT NULL, updated_time TIMESTAMP NOT NULL, @@ -79,9 +80,9 @@ FOREIGN KEY (role_id) REFERENCES role_info (role_id) ); -/********************************** -Table Name: Group Mapping -**********************************/ +/**********************************/ +/* Table Name: Group Mapping */ +/**********************************/ CREATE TABLE group_mapping( id INTEGER NOT NULL IDENTITY PRIMARY KEY, user_id VARCHAR(255) NOT NULL, @@ -90,9 +91,9 @@ FOREIGN KEY (group_id) REFERENCES group_info (group_id) ); -/********************************** -Table Name: Role Mapping -**********************************/ +/**********************************/ +/* Table Name: Role Mapping */ +/**********************************/ CREATE TABLE role_mapping( id INT NOT NULL IDENTITY PRIMARY KEY, user_id VARCHAR(255) NOT NULL, @@ -101,9 +102,9 @@ FOREIGN KEY (role_id) REFERENCES role_info (role_id) ); -/********************************** -Table Name: Event Schedule -**********************************/ +/**********************************/ +/* Table Name: Event Schedule */ +/**********************************/ CREATE TABLE event_schedule( id BIGINT(20) NOT NULL IDENTITY PRIMARY KEY, title VARCHAR(100) NOT NULL, @@ -123,9 +124,9 @@ versionNo INTEGER NOT NULL ); -/********************************** -Table Name: Event Schedule Mapping -**********************************/ +/**********************************/ +/* Table Name: Event Schedule Mapping */ +/**********************************/ CREATE TABLE event_schedule_mapping( id BIGINT(20) NOT NULL IDENTITY PRIMARY KEY, schedule_id BIGINT(20) NOT NULL, @@ -134,18 +135,18 @@ FOREIGN KEY (schedule_id) REFERENCES event_schedule (id) ); -/********************************** -Table Name: Event Schedule Content -**********************************/ +/**********************************/ +/* Table Name: Event Schedule Content */ +/**********************************/ CREATE TABLE event_schedule_content( id BIGINT(20) NOT NULL PRIMARY KEY, content VARCHAR(1000), FOREIGN KEY (id) REFERENCES event_schedule (id) ); -/********************************** -Table Name: Facility Group -**********************************/ +/**********************************/ +/* Table Name: Facility Group */ +/**********************************/ CREATE TABLE facility_group( id INTEGER NOT NULL IDENTITY PRIMARY KEY, name VARCHAR(100) NOT NULL, @@ -159,9 +160,9 @@ versionNo INTEGER DEFAULT 0 NOT NULL ); -/********************************** -Table Name: Facility -**********************************/ +/**********************************/ +/* Table Name: Facility */ +/**********************************/ CREATE TABLE facility( id INTEGER NOT NULL IDENTITY PRIMARY KEY, name VARCHAR(100) NOT NULL, @@ -177,18 +178,18 @@ FOREIGN KEY (group_id) REFERENCES facility_group (id) ); -/********************************** -Table Name: Facility Content -**********************************/ +/**********************************/ +/* Table Name: Facility Content */ +/**********************************/ CREATE TABLE facility_content( id INTEGER NOT NULL PRIMARY KEY, content VARCHAR(1000), FOREIGN KEY (id) REFERENCES facility (id) ); -/********************************** -Table Name: Facility Schedule Mapping -**********************************/ +/**********************************/ +/* Table Name: Facility Schedule Mapping */ +/**********************************/ CREATE TABLE facility_schedule_mapping( id BIGINT(20) NOT NULL IDENTITY PRIMARY KEY, schedule_id BIGINT(20) NOT NULL, Deleted: 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 2008-12-27 22:14:41 UTC (rev 1629) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/BFinder.java 2008-12-27 22:18:30 UTC (rev 1630) @@ -1,110 +0,0 @@ -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 find( - Class behaviorType) { - assertObjectNotNull("behaviorType", behaviorType); - if (!org.seasar.framework.container.factory.SingletonS2ContainerFactory - .hasContainer()) { - synchronized (BFinder.class) { - if (!org.seasar.framework.container.factory.SingletonS2ContainerFactory - .hasContainer()) { - final String configFile = _dbfluteDiconName; - if (org.seasar.framework.util.ResourceUtil - .isExist(configFile)) { - org.seasar.framework.container.factory.SingletonS2ContainerFactory - .setConfigPath(configFile); - org.seasar.framework.container.factory.SingletonS2ContainerFactory - .init(); - } else { - String msg = "S2Container is not initialized! Confirm your initializer and your dicon files."; - throw new IllegalStateException(msg); - } - } - } - } - final org.seasar.framework.container.S2Container container = org.seasar.framework.container.factory.SingletonS2ContainerFactory - .getContainer(); - final BEHAVIOR_TYPE behavior = (BEHAVIOR_TYPE) container - .getComponent(behaviorType); - return behavior; - } - - //========================================================================== - // ========= - // Accessor - // ======== - public static void setDBFluteDiconName(String dbfluteDiconName) { - _dbfluteDiconName = dbfluteDiconName; - } - - //========================================================================== - // ========= - // General Helper - // ============== - /** - * Assert that the object is not null. - * - * @param variableName Variable name. (NotNull) - * @param value Value. (NotNull) - * @exception IllegalArgumentException - */ - protected static void assertObjectNotNull(String variableName, Object value) { - if (variableName == null) { - String msg = "The value should not be null: variableName=" - + variableName + " value=" + value; - throw new IllegalArgumentException(msg); - } - if (value == null) { - String msg = "The value should not be null: variableName=" - + variableName; - throw new IllegalArgumentException(msg); - } - } - - // ---------------------------------------------------------------- - // Assert String - // ------------- - /** - * Assert that the entity is not null and not trimmed empty. - * - * @param variableName Variable name. (NotNull) - * @param value Value. (NotNull) - */ - protected void assertStringNotNullAndNotTrimmedEmpty(String variableName, - String value) { - assertObjectNotNull("variableName", variableName); - assertObjectNotNull("value", value); - if (value.trim().length() == 0) { - String msg = "The value should not be empty: variableName=" - + variableName + " value=" + value; - throw new IllegalArgumentException(msg); - } - } -} Modified: 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 2008-12-27 22:14:41 UTC (rev 1629) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/BehaviorSelector.java 2008-12-27 22:18:30 UTC (rev 1630) @@ -10,8 +10,7 @@ public interface BehaviorSelector { /** - * Initialize condition-bean meta data.
If you call this, Hot Deploy - * of OutsideSql becomes Cool! + * Initialize condition-bean meta data.
*/ public void initializeConditionBeanMetaData(); Modified: 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 2008-12-27 22:14:41 UTC (rev 1629) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/CacheBehaviorSelector.java 2008-12-27 22:18:30 UTC (rev 1630) @@ -1,8 +1,8 @@ package jp.sf.pal.scheduler.db.allcommon; import java.util.Collection; -import java.util.LinkedHashMap; import java.util.Map; +import java.util.concurrent.ConcurrentHashMap; import jp.sf.pal.scheduler.db.allcommon.bhv.BehaviorReadable; import jp.sf.pal.scheduler.db.allcommon.dbmeta.DBMeta; @@ -31,15 +31,14 @@ // Attribute // ========= /** The cache of behavior. (It's the generic hell!) */ - protected Map, BehaviorReadable> _behaviorCache = new LinkedHashMap, BehaviorReadable>(); + protected Map, BehaviorReadable> _behaviorCache = new ConcurrentHashMap, BehaviorReadable>(); //========================================================================== // ========= // Initialize // ========== /** - * Initialize condition-bean meta data.
If you call this, Hot Deploy - * of OutsideSql becomes Cool! + * Initialize condition-bean meta data.
*/ public void initializeConditionBeanMetaData() { final Map dbmetaMap = DBMetaInstanceHandler @@ -53,8 +52,7 @@ } for (DBMeta dbmeta : dbmetas) { final BehaviorReadable bhv = byName(dbmeta.getTableDbName()); - final DaoReadable dao = bhv.getDaoReadable(); - dao.initializeDaoMetaData("selectList"); + bhv.warmUpCommand(); } if (_log.isInfoEnabled()) { long after = System.currentTimeMillis(); Deleted: 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 2008-12-27 22:14:41 UTC (rev 1629) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/CacheDaoSelector.java 2008-12-27 22:18:30 UTC (rev 1630) @@ -1,66 +0,0 @@ -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. - * - *
- * 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.
- * 
- * - * @author DBFlute(AutoGenerator) - */ - ¡÷ SuppressWarnings("unchecked") -public class CacheDaoSelector extends CacheAbstractSelector implements - DaoSelector { - - //========================================================================== - // ========= - // Selector - // ======== - /** - * Select DAO. - * - * @param The type of DAO. - * @param daoType DAO type. (NotNull) - * @return DAO. (NotNull) - */ - public DAO select(Class 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 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 daoType; - try { - daoType = (Class) Class.forName(daoTypeName); - } catch (ClassNotFoundException e) { - throw new RuntimeException("The class does not exist: " - + daoTypeName, e); - } - return daoType; - } -} Added: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/CommonColumnAutoSetupper.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/CommonColumnAutoSetupper.java (rev 0) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/CommonColumnAutoSetupper.java 2008-12-27 22:18:30 UTC (rev 1630) @@ -0,0 +1,25 @@ +package jp.sf.pal.scheduler.db.allcommon; + +/** + * The auto set-upper of common column. + * + * @author DBFlute(AutoGenerator) + */ +public interface CommonColumnAutoSetupper { + + /** + * Handle common columns of insert if it needs. + * + * @param targetEntity Target entity that the type is entity interface. + * (NotNull) + */ + public void handleCommonColumnOfInsertIfNeeds(Entity targetEntity); + + /** + * Handle common columns of update if it needs. + * + * @param targetEntity Target entity that the type is entity interface. + * (NotNull) + */ + public void handleCommonColumnOfUpdateIfNeeds(Entity targetEntity); +} Property changes on: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/CommonColumnAutoSetupper.java ___________________________________________________________________ Name: svn:eol-style + native Added: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/CommonColumnBasicAutoSetupper.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/CommonColumnBasicAutoSetupper.java (rev 0) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/CommonColumnBasicAutoSetupper.java 2008-12-27 22:18:30 UTC (rev 1630) @@ -0,0 +1,31 @@ +package jp.sf.pal.scheduler.db.allcommon; + +/** + * The basic implementation of the auto set-upper of common column. + * + * @author DBFlute(AutoGenerator) + */ +public class CommonColumnBasicAutoSetupper implements CommonColumnAutoSetupper { + + //========================================================================== + // =========== + // Set up + // ====== + /** + * Handle common columns of insert if it needs. + * + * @param targetEntity Target entity that the type is entity interface. + * (NotNull) + */ + public void handleCommonColumnOfInsertIfNeeds(Entity targetEntity) { + } + + /** + * Handle common columns of update if it needs. + * + * @param targetEntity Target entity that the type is entity interface. + * (NotNull) + */ + public void handleCommonColumnOfUpdateIfNeeds(Entity targetEntity) { + } +} Property changes on: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/CommonColumnBasicAutoSetupper.java ___________________________________________________________________ Name: svn:eol-style + native Added: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/DBDef.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/DBDef.java (rev 0) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/DBDef.java 2008-12-27 22:18:30 UTC (rev 1630) @@ -0,0 +1,179 @@ +package jp.sf.pal.scheduler.db.allcommon; + +import java.util.Collections; +import java.util.HashMap; +import java.util.Iterator; +import java.util.Map; +import java.util.Set; + +/** + * The definition of database. + * + * @author DBFlute(AutoGenerator) + */ +public enum DBDef { + + //========================================================================== + // ========= + // ENUM + // ==== + MySQL("mysql", null), PostgreSQL("postgresql", "postgre"), Oracle("oracle", + null), DB2("db2", null), SQLServer("sqlserver", "mssql"), FireBird( + "firebird", null), H2("h2", null), Derby("derby", null), MSAccess( + "msaccess", null), Unknown("unknown", null); + + //========================================================================== + // ========= + // Static Reference + // ================ + // ----------------------------------------------------- + // Code Value + // ---------- + private static final Map _codeValueMap = new HashMap(); + static { + for (DBDef value : values()) { + _codeValueMap.put(value.code().toLowerCase(), value); + } + } + + private static final Map _codeAliasValueMap = new HashMap(); + static { + for (DBDef value : values()) { + if (value.codeAlias() != null) { + _codeAliasValueMap.put(value.codeAlias().toLowerCase(), value); + } + } + } + + /** + * @param code The code of the DB. (Nullable: If the code is null, it + * returns null) + * @return The instance that has the code. (Nullable) + */ + public static DBDef codeOf(String code) { + if (code == null) { + return null; + } + final String lowerCaseCode = code.toLowerCase(); + DBDef def = _codeValueMap.get(lowerCaseCode); + if (def == null) { + def = _codeAliasValueMap.get(lowerCaseCode); + } + return def; + } + + // ----------------------------------------------------- + // Driver Hint + // ----------- + private static final Map _driverHintMap; + static { + final Map tmpMap = new HashMap(); + tmpMap.put("mysql", MySQL); + tmpMap.put("postgresql", PostgreSQL); + tmpMap.put("oracle", Oracle); + tmpMap.put("db2", DB2); + tmpMap.put("sqlserver", SQLServer); + tmpMap.put("firebird", FireBird); + tmpMap.put("org.h2", H2); + tmpMap.put("org.apache.derby", Derby); + _driverHintMap = Collections.unmodifiableMap(tmpMap); + } + + public static DBDef byDriverClassName(String driverClassName) { + final Set keySet = _driverHintMap.keySet(); + for (final Iterator ite = keySet.iterator(); ite.hasNext();) { + final String driverHint = ite.next(); + if (driverClassName.indexOf(driverHint) >= 0) { + final DBDef dbdef = _driverHintMap.get(driverHint); + if (dbdef != null) { + return dbdef; + } + } + } + return null; + } + + //========================================================================== + // ========= + // Current Definition + // ================== + /** The current definition of database. (NotNull, Default 'Unknown') */ + private static DBDef _currentDef; + static { + _currentDef = codeOf("H2"); + if (_currentDef == null) { + _currentDef = Unknown; + } + } + + /** + * @return The current definition of database. (NotNull) + */ + public static DBDef getCurrentDef() { + return _currentDef; + } + + /** + * @param currentDef The current definition of database. (NotNull) + */ + public static void setCurrentDef(DBDef currentDef) { + if (currentDef == null) { + String msg = "The argument 'currentDef' should not be null at DBDef.setCurrentDef()"; + throw new IllegalArgumentException(msg); + } + _currentDef = currentDef; + } + + /** + * @param dbdef The definition of database. (NotNull) + * @return Is the definition of database current? + */ + public static boolean isCurrentDef(DBDef dbdef) { + if (dbdef == null) { + String msg = "The argument 'dbdef' should not be null at DBDef.isCurrentDef()"; + throw new IllegalArgumentException(msg); + } + return _currentDef != null ? _currentDef.equals(dbdef) : false; + } + + //========================================================================== + // ========= + // Attribute + // ========= + /** The code of the DB. (NotNull) */ + private String _code; + + /** The code alias of the DB. (Nullable) */ + private String _codeAlias; + + //========================================================================== + // ========= + // Constructor + // =========== + /** + * @param code The code of the DB. (NotNull) + * @param codeAlias The code alias of the DB. (Nullable) + */ + private DBDef(String code, String codeAlias) { + _code = code; + _codeAlias = codeAlias; + } + + //========================================================================== + // ========= + // Accessor + // ======== + /** + * @return The code of the DB. (NotNull) + */ + public String code() { + return _code; + } + + /** + * @return The code alias of the DB. (Nullable) + */ + private String codeAlias() { + return _codeAlias; + } +} Property changes on: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/DBDef.java ___________________________________________________________________ Name: svn:eol-style + native Modified: 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 2008-12-27 22:14:41 UTC (rev 1629) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/DBFluteConfig.java 2008-12-27 22:18:30 UTC (rev 1630) @@ -24,10 +24,6 @@ // ========= protected StatementConfig _defaultStatementConfig; - protected boolean _conditionBeanFormatSql = true;// This is for - - // compatibility! - protected boolean _queryLogLevelInfo; protected boolean _executeStatusLogLevelInfo; @@ -36,10 +32,6 @@ protected UniqueConstraintDeterminator _uniqueConstraintDeterminator; - protected boolean _sqlExceptionOldStyleHandling = false;// This is for - - // compatibility! - protected String _logDateFormat; protected String _logTimestampFormat; @@ -92,27 +84,6 @@ //========================================================================== // ========= - // ConditionBean Format Sql - // ======================== - public boolean isConditionBeanFormatSql() { - return _conditionBeanFormatSql; - } - - /** - * @param conditionBeanFormatSql The value of the config. - * @deprecated This is for compatibility! - */ - public void setConditionBeanFormatSql(boolean conditionBeanFormatSql) { - assertNotLocked(); - if (_log.isInfoEnabled()) { - _log.info("...Setting conditionBeanFormatSql: " - + conditionBeanFormatSql); - } - _conditionBeanFormatSql = conditionBeanFormatSql; - } - - //========================================================================== - // ========= // Query Log Level Info // ==================== public boolean isQueryLogLevelInfo() { @@ -184,31 +155,8 @@ public boolean isUniqueConstraintException(Throwable t); } - // [DBFlute-0.7.7] //========================================================================== // ========= - // SQL Exception Old Style - // ======================= - public boolean isSqlExceptionOldStyleHandling() { - return _sqlExceptionOldStyleHandling; - } - - /** - * @param sqlExceptionOldStyleHandling The value of the config. - * @deprecated This is for compatibility! - */ - public void setSqlExceptionOldStyleHandling( - boolean sqlExceptionOldStyleHandling) { - assertNotLocked(); - if (_log.isInfoEnabled()) { - _log.info("...Setting sqlExceptionOldStyleHandling: " - + sqlExceptionOldStyleHandling); - } - _sqlExceptionOldStyleHandling = sqlExceptionOldStyleHandling; - } - - //========================================================================== - // ========= // Log Format // ========== public String getLogDateFormat() { @@ -303,7 +251,6 @@ // ============ public void clear() { // the only properties that update OK while executing _defaultStatementConfig = null; - _conditionBeanFormatSql = true; // as default _queryLogLevelInfo = false; _executeStatusLogLevelInfo = false; _useSqlLogRegistry = false; Deleted: 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 2008-12-27 22:14:41 UTC (rev 1629) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/DaoReadable.java 2008-12-27 22:18:30 UTC (rev 1630) @@ -1,11 +0,0 @@ -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! -} Deleted: 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 2008-12-27 22:14:41 UTC (rev 1629) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/DaoSelector.java 2008-12-27 22:18:30 UTC (rev 1630) @@ -1,26 +0,0 @@ -package jp.sf.pal.scheduler.db.allcommon; - -/** - * The interface of DAO-selector. - * - * @author DBFlute(AutoGenerator) - */ -public interface DaoSelector { - - /** - * Select DAO. - * - * @param The type of DAO. - * @param daoType DAO type. (NotNull) - * @return Dao. (NotNull) - */ - public DAO select(Class daoType); - - /** - * Select DAO-readable by name. - * - * @param tableFlexibleName Table flexible name. (NotNull) - * @return DAO-readable. (NotNull) - */ - public DaoReadable byName(String tableFlexibleName); -} Deleted: 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 2008-12-27 22:14:41 UTC (rev 1629) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/DaoWritable.java 2008-12-27 22:18:30 UTC (rev 1630) @@ -1,70 +0,0 @@ -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 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 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 entityList); -} Modified: 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 2008-12-27 22:14:41 UTC (rev 1629) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/EntityDefinedCommonColumn.java 2008-12-27 22:18:30 UTC (rev 1630) @@ -8,6 +8,12 @@ public interface EntityDefinedCommonColumn extends Entity { /** + * Enable common column auto set up. {for after disable because the default + * is enabled} + */ + public void enableCommonColumnAutoSetup(); + + /** * Disable common column auto set up. */ public void disableCommonColumnAutoSetup(); Deleted: 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 2008-12-27 22:14:41 UTC (rev 1629) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/GenMetaData.java 2008-12-27 22:18:30 UTC (rev 1630) @@ -1,258 +0,0 @@ -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 "@="; - } -} Deleted: 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 2008-12-27 22:14:41 UTC (rev 1629) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/annotation/OutsideSql.java 2008-12-27 22:18:30 UTC (rev 1630) @@ -1,18 +0,0 @@ -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; -} Modified: 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 2008-12-27 22:14:41 UTC (rev 1629) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/bhv/AbstractBehaviorReadable.java 2008-12-27 22:18:30 UTC (rev 1630) @@ -11,10 +11,16 @@ 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.core.BehaviorCommand; +import jp.sf.pal.scheduler.db.allcommon.bhv.core.BehaviorCommandInvoker; +import jp.sf.pal.scheduler.db.allcommon.bhv.core.command.AbstractBehaviorCommand; +import jp.sf.pal.scheduler.db.allcommon.bhv.core.command.SelectCountCBCommand; +import jp.sf.pal.scheduler.db.allcommon.bhv.core.command.SelectListCBCommand; +import jp.sf.pal.scheduler.db.allcommon.bhv.core.command.SelectNextValCommand; +import jp.sf.pal.scheduler.db.allcommon.bhv.core.command.SelectScalarCBCommand; 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; @@ -25,8 +31,9 @@ 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.ScalarQuery; import jp.sf.pal.scheduler.db.allcommon.cbean.outsidesql.executor.OutsideSqlBasicExecutor; +import jp.sf.pal.scheduler.db.allcommon.cbean.sqlclause.SqlClause; 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; @@ -35,11 +42,10 @@ import jp.sf.pal.scheduler.db.allcommon.util.SimpleSystemUtil; /** - * The abstract class of behavior-readable. + * The abstract class of readable behavior. * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public abstract class AbstractBehaviorReadable implements BehaviorReadable { //========================================================================== @@ -50,13 +56,13 @@ * Behavior-selector instance. It's basically referred at loadReferrer. * (Required for loadReferrer) */ - protected BehaviorSelector _behaviorSelector; + protected BehaviorCommandInvoker _behaviorCommandInvoker; /** - * Dao-selector instance. It's basically referred at loadReferrer. (Required - * for OutsideSql) + * Behavior-selector instance. It's basically referred at loadReferrer. + * (Required for loadReferrer) */ - protected DaoSelector _daoSelector; + protected BehaviorSelector _behaviorSelector; //========================================================================== // =========== @@ -83,7 +89,7 @@ * @return Read count. (NotNull) */ public int readCount(ConditionBean cb) { - assertConditionBeanNotNull(cb); + assertCBNotNull(cb); return callReadCount(cb); } @@ -100,7 +106,7 @@ * When the entity has been duplicated. */ public Entity readEntity(ConditionBean cb) { - assertConditionBeanNotNull(cb); + assertCBNotNull(cb); final List ls = readList(cb); if (ls.isEmpty()) { return null; @@ -120,7 +126,7 @@ * When the entity has been duplicated. */ public Entity readEntityWithDeletedCheck(ConditionBean cb) { - assertConditionBeanNotNull(cb); + assertCBNotNull(cb); final List ls = readList(cb); assertEntityNotDeleted(ls, cb); assertEntitySelectedAsOne(ls, cb); @@ -133,7 +139,7 @@ // =========================== protected ENTITY helpSelectEntityInternally( CB cb, InternalSelectEntityCallback callback) { - assertConditionBeanNotNull(cb); + assertCBNotNull(cb); cb.checkSafetyResult(1); List ls = null; try { @@ -156,7 +162,7 @@ protected ENTITY helpSelectEntityWithDeletedCheckInternally( CB cb, InternalSelectEntityWithDeletedCheckCallback callback) { - assertConditionBeanNotNull(cb); + assertCBNotNull(cb); cb.checkSafetyResult(1); List ls = null; try { @@ -175,7 +181,7 @@ } //========================================================================== - // =========== + // ========= // List Read // ========= /** @@ -186,7 +192,7 @@ * list. (NotNull) */ public ListResultBean readList(ConditionBean cb) { - assertConditionBeanNotNull(cb); + assertCBNotNull(cb); return new jp.sf.pal.scheduler.db.allcommon.cbean.ResultBeanBuilder( getTableDbName()).buildListResultBean(cb, callReadList(cb)); } @@ -198,7 +204,7 @@ * @return Read page. (NotNull) */ public PagingResultBean readPage(final ConditionBean cb) { - assertConditionBeanNotNull(cb); + assertCBNotNull(cb); final PagingInvoker invoker = new PagingInvoker( getTableDbName()); final PagingHandler handler = new PagingHandler() { @@ -225,8 +231,7 @@ * @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) { + protected void assertEntityNotDeleted(Entity entity, Object searchKey4Log) { if (entity == null) { throwEntityAlreadyDeletedException(searchKey4Log); } @@ -239,7 +244,8 @@ * @param searchKey4Log Search-key for Logging. (NotNull) * @exception jp.sf.pal.scheduler.db.allcommon.exception.EntityAlreadyDeletedException */ - protected void assertEntityNotDeleted(List ls, Object searchKey4Log) { + protected void assertEntityNotDeleted(List ls, + Object searchKey4Log) { if (ls == null || ls.isEmpty()) { throwEntityAlreadyDeletedException(searchKey4Log); } @@ -253,7 +259,8 @@ * @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) { + protected void assertEntitySelectedAsOne(List ls, + Object searchKey4Log) { if (ls == null || ls.isEmpty()) { throwEntityAlreadyDeletedException(searchKey4Log); } @@ -274,49 +281,254 @@ //========================================================================== // ========= - // Various Select - // ============== - public OutsideSqlBasicExecutor outsideSql() { - assertDaoSelectorNotNull("outsideSql"); - final OutsideSqlDao outsideSqlDao = _daoSelector - .select(OutsideSqlDao.class); - return new OutsideSqlBasicExecutor(outsideSqlDao, getTableDbName()); - } + // Scalar Select + // ============= + /** + * The scalar function.
This is not static class because this uses + * the method 'invoke(BehaviorCommand)' + * + * @param The type of condition-bean. + * @param The type of result. + */ + public class SLFunction { // SL: ScaLar - private void assertDaoSelectorNotNull(String methodName) { - if (_daoSelector == null) { + /** The condition-bean for scalar select. (NotNull) */ + protected CB _conditionBean; + + /** The condition-bean for scalar select. (NotNull) */ + protected Class _resultType; + + /** + * @param conditionBean The condition-bean initialized only for scalar + * select. (NotNull) + * @param resultType The type os result. (NotNull) + */ + public SLFunction(CB conditionBean, Class resultType) { + _conditionBean = conditionBean; + _resultType = resultType; + } + + /** + * Select the maximum value.
+ * + *
+         * memberBhv.scalarSelect(Date.class).max(new ScalarQuery(MemberCB cb) {
+         *     cb.specify().columnMemberBirthday(); // the required specification of target column
+         *     cb.query().setMemberStatusCode_Equal_Formalized(); // query as you like it
+         * });
+         * 
+ * + * @param scalarQuery The query for scalar. (NotNull) + * @return The maximum value. (Nullable) + */ + public RESULT max(ScalarQuery scalarQuery) { + assertObjectNotNull("scalarQuery", scalarQuery); + return exec(scalarQuery, SqlClause.SelectClauseType.MAX); + } + + /** + * Select the minimum value.
+ * + *
+         * memberBhv.scalarSelect(Date.class).min(new ScalarQuery(MemberCB cb) {
+         *     cb.specify().columnMemberBirthday(); // the required specification of target column
+         *     cb.query().setMemberStatusCode_Equal_Formalized(); // query as you like it
+         * });
+         * 
+ * + * @param scalarQuery The query for scalar. (NotNull) + * @return The minimum value. (Nullable) + */ + public RESULT min(ScalarQuery scalarQuery) { + assertObjectNotNull("scalarQuery", scalarQuery); + return exec(scalarQuery, SqlClause.SelectClauseType.MIN); + } + + /** + * Select the summary value.
+ * + *
+         * purchaseBhv.scalarSelect(Integer.class).sum(new ScalarQuery(PurchaseCB cb) {
+         *     cb.specify().columnPurchaseCount(); // the required specification of target column
+         *     cb.query().setPurchaseDatetime_GreaterEqual(date); // query as you like it
+         * });
+         * 
+ * + * @param scalarQuery The query for scalar. (NotNull) + * @return The summary value. (Nullable) + */ + public RESULT sum(ScalarQuery scalarQuery) { + assertObjectNotNull("scalarQuery", scalarQuery); + return exec(scalarQuery, SqlClause.SelectClauseType.SUM); + } + + /** + * Select the average value.
+ * + *
+         * purchaseBhv.scalarSelect(Integer.class).avg(new ScalarQuery(PurchaseCB cb) {
+         *     cb.specify().columnPurchaseCount(); // the required specification of target column
+         *     cb.query().setPurchaseDatetime_GreaterEqual(date); // query as you like it
+         * });
+         * 
+ * + * @param scalarQuery The query for scalar. (NotNull) + * @return The average value. (Nullable) + */ + public RESULT avg(ScalarQuery scalarQuery) { + assertObjectNotNull("scalarQuery", scalarQuery); + return exec(scalarQuery, SqlClause.SelectClauseType.AVG); + } + + protected RESULT exec(ScalarQuery scalarQuery, + SqlClause.SelectClauseType selectClauseType) { + assertObjectNotNull("scalarQuery", scalarQuery); + assertObjectNotNull("selectClauseType", selectClauseType); + assertObjectNotNull("conditionBean", _conditionBean); + assertObjectNotNull("resultType", _resultType); + scalarQuery.query(_conditionBean); + assertScalarSelectRequiredSpecifyColumn(); + return invoke(createSelectScalarCBCommand(_conditionBean, + _resultType, selectClauseType)); + } + + protected void assertScalarSelectRequiredSpecifyColumn() { + final String columnName = _conditionBean.getSqlClause() + .getSpecifiedColumnNameAsOne(); + if (columnName == null) { + throwScalarSelectInvalidColumnSpecificationException(); + } + } + + protected void throwScalarSelectInvalidColumnSpecificationException() { String msg = "Look! Read the message below." + getLineSeparator(); msg = msg + "/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *" + getLineSeparator(); - msg = msg - + "Not found the selector of dao as behavior's attributed!" + msg = msg + "The specified column for scalar select was Invalid!" + getLineSeparator(); msg = msg + getLineSeparator(); msg = msg + "[Advice]" + getLineSeparator(); msg = msg - + "Please confirm the definition of the selector at your 'dbflute.dicon'." + + " You should call specify().column[TargetColumn]() only once." + getLineSeparator(); - msg = msg + "It is precondition that '" + methodName - + "()' needs the selector instance." + getLineSeparator(); - msg = msg + getLineSeparator(); - msg = msg + "[Your Behavior's Attributes]" + getLineSeparator(); - msg = msg + " _behaviorSelector : " + _behaviorSelector + msg = msg + " For example:" + getLineSeparator(); + msg = msg + " " + getLineSeparator(); + msg = msg + " [Wrong]" + getLineSeparator(); + msg = msg + " /- - - - - - - - - - - - - - - - - - - - " + getLineSeparator(); - msg = msg + " _daoSelector : " + _daoSelector + msg = msg + + " memberBhv.scalarSelect(Date.class).max(new ScalarQuery() {" + getLineSeparator(); - msg = msg + "* * * * * * * * * */" + getLineSeparator(); - throw new IllegalStateException(msg); + msg = msg + " public void query(MemberCB cb) {" + + getLineSeparator(); + msg = msg + " // *No! It's empty!" + getLineSeparator(); + msg = msg + " }" + getLineSeparator(); + msg = msg + " });" + getLineSeparator(); + msg = msg + " - - - - - - - - - -/" + getLineSeparator(); + msg = msg + " " + getLineSeparator(); + msg = msg + " [Wrong]" + getLineSeparator(); + msg = msg + " /- - - - - - - - - - - - - - - - - - - - " + + getLineSeparator(); + msg = msg + + " memberBhv.scalarSelect(Date.class).max(new ScalarQuery() {" + + getLineSeparator(); + msg = msg + " public void query(MemberCB cb) {" + + getLineSeparator(); + msg = msg + " cb.specify().columnMemberBirthday();" + + getLineSeparator(); + msg = msg + + " cb.specify().columnRegisterDatetime(); // *No! It's duplicated!" + + getLineSeparator(); + msg = msg + " }" + getLineSeparator(); + msg = msg + " });" + getLineSeparator(); + msg = msg + " - - - - - - - - - -/" + getLineSeparator(); + msg = msg + " " + getLineSeparator(); + msg = msg + " [Good!]" + getLineSeparator(); + msg = msg + " /- - - - - - - - - - - - - - - - - - - - " + + getLineSeparator(); + msg = msg + + " memberBhv.scalarSelect(Date.class).max(new ScalarQuery() {" + + getLineSeparator(); + msg = msg + " public void query(MemberCB cb) {" + + getLineSeparator(); + msg = msg + + " cb.specify().columnMemberBirthday(); // *Point!" + + getLineSeparator(); + msg = msg + " }" + getLineSeparator(); + msg = msg + " });" + getLineSeparator(); + msg = msg + " - - - - - - - - - -/" + getLineSeparator(); + msg = msg + getLineSeparator(); + msg = msg + "[ConditionBean Type]" + getLineSeparator() + + _conditionBean.getClass().getName() + getLineSeparator(); + msg = msg + getLineSeparator(); + msg = msg + "[Result Type]" + getLineSeparator() + + _resultType.getName() + getLineSeparator(); + msg = msg + "* * * * * * * * * */"; + throw new ScalarSelectInvalidColumnSpecificationException(msg); } } + public static class ScalarSelectInvalidColumnSpecificationException extends + RuntimeException { + private static final long serialVersionUID = 1L; + + public ScalarSelectInvalidColumnSpecificationException(String msg) { + super(msg); + } + } + + //========================================================================== + // ========= + // OutsideSql + // ========== /** - * Create value-label list. + * Get the basic executor of outside-SQL.
The invoker of behavior + * command should be not null when you call this method. * + *
+     * You can use the methods for outside-SQL are as follows:
+     * {Basic}
+     *   o selectList()
+     *   o execute()
+     *   o call()
+     * 
+     * {Entity}
+     *   o entityHandling().selectEntity()
+     *   o entityHandling().selectEntityWithDeletedCheck()
+     * 
+     * {Cursor}
+     *   o cursorHandling().selectCursor()
+     * 
+     * {Paging}
+     *   o autoPaging().selectList()
+     *   o autoPaging().selectPage()
+     *   o manualPaging().selectList()
+     *   o manualPaging().selectPage()
+     * 
+     * {Option -- Dynamic}
+     *   o dynamicBinding().selectList()
+     * 
+ * + * @return The basic executor of outside-SQL. (NotNull) + */ + public OutsideSqlBasicExecutor outsideSql() { + assertBehaviorCommandInvoker("outsideSql"); + return new OutsideSqlBasicExecutor(_behaviorCommandInvoker, + getTableDbName()); + } + + //========================================================================== + // ========= + // Various Select + // ============== + /** + * Create the list of value-label. + * * @param The type of entity. * @param entityList The list of entity. (NotNull) - * @param valueLabelSetupper Value-label-setupper. (NotNull) - * @return Value-label list. (NotNull) + * @param valueLabelSetupper The setupper of value-label. (NotNull) + * @return The list of value-label. (NotNull) */ public List> createValueLabelList( List entityList, @@ -362,10 +574,10 @@ } } - protected Object helpConvertingSequenceObject(Class resultClass, + protected Object helpConvertingSequenceObject(Class resultClass, Object sequenceObject) { try { - final Constructor constructor = resultClass + final Constructor constructor = resultClass .getConstructor(new Class[] { String.class }); return constructor.newInstance(new Object[] { sequenceObject .toString() }); @@ -534,6 +746,7 @@ * @param value The value of primary key. (Nullable) * @return The value of primary key. (Nullable) */ + @SuppressWarnings("unchecked") protected PK toLowerCasePrimaryKeyIfString(PK value) { return (PK) toLowerCaseIfString(value); } @@ -580,22 +793,22 @@ + "/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *" + getLineSeparator(); msg = msg - + "Not found the selector of behavior as behavior's attributed!" + + "Not found the selector of behavior as behavior's attribute!" + getLineSeparator(); msg = msg + getLineSeparator(); msg = msg + "[Advice]" + getLineSeparator(); msg = msg - + "Please confirm the definition of the selector at your 'dbflute.dicon'." + + "Please confirm the definition of the selector at your component configuration of DBFlute." + getLineSeparator(); msg = msg + "It is precondition that '" + methodName + "()' needs the selector instance." + getLineSeparator(); msg = msg + getLineSeparator(); msg = msg + "[Your Behavior's Attributes]" + getLineSeparator(); - msg = msg + " _behaviorSelector : " + _behaviorSelector + msg = msg + " _behaviorCommandInvoker : " + + _behaviorCommandInvoker + getLineSeparator(); + msg = msg + " _behaviorSelector : " + _behaviorSelector + getLineSeparator(); - msg = msg + " _daoSelector : " + _daoSelector - + getLineSeparator(); - msg = msg + "* * * * * * * * * */" + getLineSeparator(); + msg = msg + "* * * * * * * * * */"; throw new IllegalStateException(msg); } } @@ -648,14 +861,14 @@ public TokenFileOutputResult outputTokenFile(ConditionBean cb, String filename, TokenFileOutputOption tokenFileOutputOption) throws java.io.FileNotFoundException, java.io.IOException { - assertConditionBeanNotNull(cb); + assertCBNotNull(cb); assertStringNotNullAndNotTrimmedEmpty("filename", filename); assertObjectNotNull("tokenFileOutputOption", tokenFileOutputOption); final List ls = readList(cb); List> rowList = new ArrayList>(); - for (java.util.Iterator ite = ls.iterator(); ite.hasNext();) { - final Entity entity = (Entity) ite.next(); + for (java.util.Iterator ite = ls.iterator(); ite.hasNext();) { + final Entity entity = ite.next(); final List valueList = getDBMeta() .convertToColumnStringValueList(entity); rowList.add(valueList); @@ -665,9 +878,9 @@ .getFileMakingOption(); final FileMakingHeaderInfo fileMakingHeaderInfo = new FileMakingHeaderInfo(); final List columnDbNameList = new ArrayList(); - for (final java.util.Iterator ite = getDBMeta().getColumnInfoList() - .iterator(); ite.hasNext();) { - final ColumnInfo columnInfo = (ColumnInfo) ite.next(); + for (final java.util.Iterator ite = getDBMeta() + .getColumnInfoList().iterator(); ite.hasNext();) { + final ColumnInfo columnInfo = ite.next(); columnDbNameList.add(columnInfo.getColumnDbName()); } fileMakingHeaderInfo.setColumnNameList(columnDbNameList); @@ -690,7 +903,7 @@ * @return All count. */ protected int callGetCountAll() { - return readCount(newConditionBean()); + return callReadCount(newConditionBean()); } /** @@ -699,7 +912,7 @@ * @return All list. (NotNull) */ protected List callGetListAll() { - return readList(newConditionBean()); + return callReadList(newConditionBean()); } /** @@ -710,14 +923,12 @@ * @return Read count. (NotNull) */ protected int callReadCount(ConditionBean cb) { - assertConditionBeanNotNull(cb); - final Class[] types = new Class[] { cb.getClass() }; - final java.lang.reflect.Method mtd = getMethod(getDaoReadable() - .getClass(), "selectCount", types); - final Object result = invoke(mtd, getDaoReadable(), new Object[] { cb }); - return ((Integer) result).intValue(); + assertCBNotNull(cb); + return doCallReadCount(cb); } + protected abstract int doCallReadCount(ConditionBean cb); + /** * The implementation. * @@ -727,42 +938,110 @@ * (NotNull) */ protected List 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) result; + assertCBNotNull(cb); + return doCallReadList(cb); } - private Method getMethod(Class clazz, String methodName, Class[] argTypes) { - try { - return clazz.getMethod(methodName, argTypes); - } catch (NoSuchMethodException ex) { - String msg = "class=" + clazz + " method=" + methodName + "-" - + java.util.Arrays.asList(argTypes); - throw new RuntimeException(msg, ex); + protected abstract List doCallReadList(ConditionBean cb); + + //========================================================================== + // ========= + // Behavior Command + // ================ + public void warmUpCommand() { + { + SelectCountCBCommand cmd = createSelectCountCBCommand(newConditionBean()); + cmd.setInitializeOnly(true); + invoke(cmd); } + { + SelectListCBCommand cmd = createSelectListCBCommand( + newConditionBean(), getDBMeta().getEntityType()); + cmd.setInitializeOnly(true); + invoke(cmd); + } } - private Object invoke(Method method, Object target, Object[] args) { - try { - return method.invoke(target, args); - } catch (java.lang.reflect.InvocationTargetException ex) { - Throwable t = ex.getCause(); - if (t instanceof RuntimeException) { - throw (RuntimeException) t; - } - if (t instanceof Error) { - throw (Error) t; - } - String msg = "target=" + target + " method=" + method + "-" - + java.util.Arrays.asList(args); - throw new RuntimeException(msg, ex); - } catch (IllegalAccessException ex) { - String msg = "target=" + target + " method=" + method + "-" - + java.util.Arrays.asList(args); - throw new RuntimeException(msg, ex); + protected SelectCountCBCommand createSelectCountCBCommand(ConditionBean cb) { + assertBehaviorCommandInvoker("createSelectCountCBCommand"); + final SelectCountCBCommand command = xsetupSelectCommand(new SelectCountCBCommand()); + command.setConditionBeanType(cb.getClass()); + command.setConditionBean(cb); + return command; + } + + protected SelectListCBCommand createSelectListCBCommand( + ConditionBean cb, Class entityType) { + assertBehaviorCommandInvoker("createSelectListCBCommand"); + final SelectListCBCommand command = xsetupSelectCommand(new SelectListCBCommand()); + command.setConditionBeanType(cb.getClass()); + command.setConditionBean(cb); + command.setEntityType(entityType); + return command; + } + + protected SelectNextValCommand createSelectNextValCommand( + Class resultType) { + assertBehaviorCommandInvoker("createSelectNextValCommand"); + final SelectNextValCommand command = xsetupSelectCommand(new SelectNextValCommand()); + command.setResultType(resultType); + return command; + } + + protected SelectScalarCBCommand createSelectScalarCBCommand( + ConditionBean cb, Class resultType, + SqlClause.SelectClauseType selectClauseType) { + assertBehaviorCommandInvoker("createSelectScalarCBCommand"); + final SelectScalarCBCommand command = xsetupSelectCommand(new SelectScalarCBCommand()); + command.setConditionBeanType(cb.getClass()); + command.setConditionBean(cb); + command.setResultType(resultType); + command.setSelectClauseType(selectClauseType); + return command; + } + + private > COMMAND xsetupSelectCommand( + COMMAND command) { + command.setTableDbName(getTableDbName()); + _behaviorCommandInvoker.injectComponentProperty(command); + return command; + } + + /** + * Invoke the command of behavior. + * + * @param The type of result. + * @param behaviorCommand The command of behavior. (NotNull) + * @return The instance of result. (Nullable) + */ + protected RESULT invoke(BehaviorCommand behaviorCommand) { + return _behaviorCommandInvoker.invoke(behaviorCommand); + } + + protected void assertBehaviorCommandInvoker(String methodName) { + if (_behaviorCommandInvoker == null) { + String msg = "Look! Read the message below." + getLineSeparator(); + msg = msg + + "/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *" + + getLineSeparator(); + msg = msg + + "Not found the invoker of behavior command as behavior's attributed!" + + getLineSeparator(); + msg = msg + getLineSeparator(); + msg = msg + "[Advice]" + getLineSeparator(); + msg = msg + + "Please confirm the definition of the invoker at your 'dbflute.dicon'." + + getLineSeparator(); + msg = msg + "It is precondition that '" + methodName + + "()' needs the invoker instance." + getLineSeparator(); + msg = msg + getLineSeparator(); + msg = msg + "[Your Behavior's Attributes]" + getLineSeparator(); + msg = msg + " _behaviorCommandInvoker : " + + _behaviorCommandInvoker + getLineSeparator(); + msg = msg + " _behaviorSelector : " + _behaviorSelector + + getLineSeparator(); + msg = msg + "* * * * * * * * * */"; + throw new IllegalStateException(msg); } } @@ -800,6 +1079,7 @@ return SimpleSystemUtil.getLineSeparator(); } + @SuppressWarnings("unchecked") protected ENTITY helpDowncastInternally( Entity entity, Class clazz) { assertObjectNotNull("entity", entity); @@ -850,8 +1130,16 @@ * * @param cb Condition-bean. (NotNull) */ - protected void assertConditionBeanNotNull( - jp.sf.pal.scheduler.db.allcommon.cbean.ConditionBean cb) { + protected void assertConditionBeanNotNull(ConditionBean cb) { + assertCBNotNull(cb); + } + + /** + * Assert that the condition-bean is not null. + * + * @param cb Condition-bean. (NotNull) + */ + protected void assertCBNotNull(ConditionBean cb) { assertObjectNotNull("cb", cb); } @@ -896,7 +1184,7 @@ * * @param ls List. (NotNull) */ - protected void assertListNotNullAndEmpty(List ls) { + protected void assertListNotNullAndEmpty(List ls) { assertObjectNotNull("ls", ls); if (!ls.isEmpty()) { String msg = "The list should be empty: ls=" + ls.toString(); @@ -909,7 +1197,7 @@ * * @param ls List. (NotNull) */ - protected void assertListNotNullAndNotEmpty(List ls) { + protected void assertListNotNullAndNotEmpty(List ls) { assertObjectNotNull("ls", ls); if (ls.isEmpty()) { String msg = "The list should not be empty: ls=" + ls.toString(); @@ -922,7 +1210,7 @@ * * @param ls List. (NotNull) */ - protected void assertListNotNullAndHasOnlyOne(List ls) { + protected void assertListNotNullAndHasOnlyOne(List ls) { assertObjectNotNull("ls", ls); if (ls.size() != 1) { String msg = "The list should contain only one object: ls=" @@ -936,38 +1224,39 @@ // Accessor // ======== /** - * Get the selector of behavior. + * Get the invoker of behavior command. * - * @return The select of behavior. (Nullable: But normally NotNull) + * @return The invoker of behavior command. (Nullable: But normally NotNull) */ - protected BehaviorSelector getBehaviorSelector() { - return _behaviorSelector; + protected BehaviorCommandInvoker getBehaviorCommandInvoker() { + return _behaviorCommandInvoker; } /** - * Set the selector of behavior. + * Set the invoker of behavior command. * - * @param behaviorSelector The selector of behavior. (NotNull) + * @param behaviorCommandInvoker The invoker of behavior command. (NotNull) */ - public void setBehaviorSelector(BehaviorSelector behaviorSelector) { - this._behaviorSelector = behaviorSelector; + public void setBehaviorCommandInvoker( + BehaviorCommandInvoker behaviorCommandInvoker) { + this._behaviorCommandInvoker = behaviorCommandInvoker; } /** - * Get the selector of DAO. + * Get the selector of behavior. * - * @return The select of DAO. (Nullable: But normally NotNull) + * @return The select of behavior. (Nullable: But normally NotNull) */ - protected DaoSelector getDaoSelector() { - return _daoSelector; + protected BehaviorSelector getBehaviorSelector() { + return _behaviorSelector; } /** - * Set the selector of DAO. + * Set the selector of behavior. * - * @param daoSelector The selector of DAO. (NotNull) + * @param behaviorSelector The selector of behavior. (NotNull) */ - public void setDaoSelector(DaoSelector daoSelector) { - _daoSelector = daoSelector; + public void setBehaviorSelector(BehaviorSelector behaviorSelector) { + this._behaviorSelector = behaviorSelector; } } Modified: 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 2008-12-27 22:14:41 UTC (rev 1629) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/bhv/AbstractBehaviorWritable.java 2008-12-27 22:18:30 UTC (rev 1630) @@ -4,10 +4,25 @@ import java.util.Iterator; import java.util.List; +import jp.sf.pal.scheduler.db.allcommon.CommonColumnAutoSetupper; 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.bhv.core.command.AbstractEntityCommand; +import jp.sf.pal.scheduler.db.allcommon.bhv.core.command.AbstractListEntityCommand; +import jp.sf.pal.scheduler.db.allcommon.bhv.core.command.BatchDeleteEntityCommand; +import jp.sf.pal.scheduler.db.allcommon.bhv.core.command.BatchDeleteNonstrictEntityCommand; +import jp.sf.pal.scheduler.db.allcommon.bhv.core.command.BatchInsertEntityCommand; +import jp.sf.pal.scheduler.db.allcommon.bhv.core.command.BatchUpdateEntityCommand; +import jp.sf.pal.scheduler.db.allcommon.bhv.core.command.BatchUpdateNonstrictEntityCommand; +import jp.sf.pal.scheduler.db.allcommon.bhv.core.command.DeleteEntityCommand; +import jp.sf.pal.scheduler.db.allcommon.bhv.core.command.DeleteNonstrictEntityCommand; +import jp.sf.pal.scheduler.db.allcommon.bhv.core.command.InsertEntityCommand; +import jp.sf.pal.scheduler.db.allcommon.bhv.core.command.QueryDeleteCBCommand; +import jp.sf.pal.scheduler.db.allcommon.bhv.core.command.QueryUpdateEntityCBCommand; +import jp.sf.pal.scheduler.db.allcommon.bhv.core.command.UpdateEntityCommand; +import jp.sf.pal.scheduler.db.allcommon.bhv.core.command.UpdateNonstrictEntityCommand; 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; @@ -20,7 +35,7 @@ import jp.sf.pal.scheduler.db.allcommon.helper.token.file.impl.FileTokenImpl; /** - * The abstract class of behavior-writable. + * The abstract class of writable behavior. * * @author DBFlute(AutoGenerator) */ @@ -29,6 +44,31 @@ //========================================================================== // ========= + // Definition + // ========== + /** Map-string map-mark. */ + private static final String MAP_STRING_MAP_MARK = "map:"; + + /** Map-string start-brace. */ + private static final String MAP_STRING_START_BRACE = "@{"; + + /** Map-string end-brace. */ + private static final String MAP_STRING_END_BRACE = "@}"; + + /** Map-string delimiter. */ + private static final String MAP_STRING_DELIMITER = "@;"; + + /** Map-string equal. */ + private static final String MAP_STRING_EQUAL = "@="; + + //========================================================================== + // =========== + // Attribute + // ========= + protected CommonColumnAutoSetupper _commonColumnAutoSetupper; + + //========================================================================== + // ========= // Entity Update // ============= // ----------------------------------------------------- @@ -357,7 +397,7 @@ * @param entityList Entity list. (NotNull and NotEmpty) * @return The array of created count. */ - public int[] lumpCreate(java.util.List entityList) { + public int[] lumpCreate(List entityList) { assertListNotNullAndNotEmpty(entityList); return callCreateList(entityList); } @@ -370,7 +410,7 @@ * @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 entityList) { + public int[] lumpModify(List entityList) { assertListNotNullAndNotEmpty(entityList); return callModifyList(entityList); } @@ -383,7 +423,7 @@ * @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 entityList) { + public int[] lumpRemove(List entityList) { assertListNotNullAndNotEmpty(entityList); return callRemoveList(entityList); } @@ -611,9 +651,11 @@ if (!processBeforeInsert(entity)) { return 1;/* as Normal End */ } - return getDaoWritable().create(entity); + return doCallCreate(entity); } + protected abstract int doCallCreate(Entity entity); + /** * Process before insert. * @@ -645,9 +687,11 @@ if (!processBeforeUpdate(entity)) { return 1;/* as Normal End */ } - return getDaoWritable().modifyModifiedOnly(entity); + return doCallModify(entity); } + protected abstract int doCallModify(Entity entity); + /** * Process before update. * @@ -678,9 +722,11 @@ if (!processBeforeDelete(entity)) { return 1;/* as Normal End */ } - return getDaoWritable().remove(entity); + return doCallRemove(entity); } + protected abstract int doCallRemove(Entity entity); + /** * Process before delete. * @@ -729,8 +775,38 @@ * (NotNull) */ protected void setupCommonColumnOfInsertIfNeeds(Entity targetEntity) { + final CommonColumnAutoSetupper setupper = getCommonColumnAutoSetupper(); + assertCommonColumnAutoSetupperNotNull(); + setupper.handleCommonColumnOfInsertIfNeeds(targetEntity); } + private void assertCommonColumnAutoSetupperNotNull() { + if (_commonColumnAutoSetupper == null) { + String msg = "Look! Read the message below." + getLineSeparator(); + msg = msg + + "/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *" + + getLineSeparator(); + msg = msg + + "Not found the auto set-upper of common column as behavior's attribute!" + + getLineSeparator(); + msg = msg + getLineSeparator(); + msg = msg + "[Advice]" + getLineSeparator(); + msg = msg + + "Please confirm the definition of the set-upper at your component configuration of DBFlute." + + getLineSeparator(); + msg = msg + getLineSeparator(); + msg = msg + "[Your Behavior's Attributes]" + getLineSeparator(); + msg = msg + " _behaviorCommandInvoker : " + + _behaviorCommandInvoker + getLineSeparator(); + msg = msg + " _behaviorSelector : " + _behaviorSelector + + getLineSeparator(); + msg = msg + " _commonColumnAutoSetupper : " + + _commonColumnAutoSetupper + getLineSeparator(); + msg = msg + "* * * * * * * * * */"; + throw new IllegalStateException(msg); + } + } + /** * Filter the entity of insert. * @@ -778,6 +854,9 @@ * (NotNull) */ protected void setupCommonColumnOfUpdateIfNeeds(Entity targetEntity) { + final CommonColumnAutoSetupper setupper = getCommonColumnAutoSetupper(); + assertCommonColumnAutoSetupperNotNull(); + setupper.handleCommonColumnOfUpdateIfNeeds(targetEntity); } /** @@ -843,12 +922,14 @@ * (NotNull) * @return Inserted count. */ - public int[] callCreateList(java.util.List entityList) { + public int[] callCreateList(List entityList) { assertObjectNotNull("entityList", entityList); helpFilterBeforeInsertInternally(entityList); - return getDaoWritable().createList(entityList); + return doCreateList(entityList); } + protected abstract int[] doCreateList(List entityList); + /** * The implementation. * @@ -856,12 +937,14 @@ * (NotNull) * @return Updated count. */ - public int[] callModifyList(java.util.List entityList) { + public int[] callModifyList(List entityList) { assertObjectNotNull("entityList", entityList); helpFilterBeforeUpdateInternally(entityList); - return getDaoWritable().modifyList(entityList); + return doModifyList(entityList); } + protected abstract int[] doModifyList(List entityList); + /** * The implementation. * @@ -869,12 +952,14 @@ * (NotNull) * @return Deleted count. */ - public int[] callRemoveList(java.util.List entityList) { + public int[] callRemoveList(List entityList) { assertObjectNotNull("entityList", entityList); helpFilterBeforeDeleteInternally(entityList); - return getDaoWritable().removeList(entityList); + return doRemoveList(entityList); } + protected abstract int[] doRemoveList(List entityList); + protected void assertEntityHasVersionNoValue(Entity entity) { if (!getDBMeta().hasVersionNo()) { return; @@ -994,4 +1079,148 @@ } return filteredList; } + + //========================================================================== + // ========= + // Behavior Command + // ================ + protected InsertEntityCommand createInsertEntityCommand(Entity entity) { + assertBehaviorCommandInvoker("createInsertEntityCommand"); + return xsetupEntityCommand(new InsertEntityCommand(), entity); + } + + protected UpdateEntityCommand createUpdateEntityCommand(Entity entity) { + assertBehaviorCommandInvoker("createUpdateEntityCommand"); + return xsetupEntityCommand(new UpdateEntityCommand(), entity); + } + + protected UpdateNonstrictEntityCommand createUpdateNonstrictEntityCommand( + Entity entity) { + assertBehaviorCommandInvoker("createUpdateNonstrictEntityCommand"); + return xsetupEntityCommand(new UpdateNonstrictEntityCommand(), entity); + } + + protected DeleteEntityCommand createDeleteEntityCommand(Entity entity) { + assertBehaviorCommandInvoker("createDeleteEntityCommand"); + return xsetupEntityCommand(new DeleteEntityCommand(), entity); + } + + protected DeleteNonstrictEntityCommand createDeleteNonstrictEntityCommand( + Entity entity) { + assertBehaviorCommandInvoker("createDeleteNonstrictEntityCommand"); + return xsetupEntityCommand(new DeleteNonstrictEntityCommand(), entity); + } + + private COMMAND xsetupEntityCommand( + COMMAND command, Entity entity) { + command.setTableDbName(getTableDbName()); + _behaviorCommandInvoker.injectComponentProperty(command); + command.setEntityType(entity.getClass()); + command.setEntity(entity); + return command; + } + + protected BatchInsertEntityCommand createBatchInsertEntityCommand( + List entityList) { + assertBehaviorCommandInvoker("createBatchInsertEntityCommand"); + return xsetupListEntityCommand(new BatchInsertEntityCommand(), + entityList); + } + + protected BatchUpdateEntityCommand createBatchUpdateEntityCommand( + List entityList) { + assertBehaviorCommandInvoker("createBatchUpdateEntityCommand"); + return xsetupListEntityCommand(new BatchUpdateEntityCommand(), + entityList); + } + + protected BatchUpdateNonstrictEntityCommand createBatchUpdateNonstrictEntityCommand( + List entityList) { + assertBehaviorCommandInvoker("createBatchUpdateNonstrictEntityCommand"); + return xsetupListEntityCommand(new BatchUpdateNonstrictEntityCommand(), + entityList); + } + + protected BatchDeleteEntityCommand createBatchDeleteEntityCommand( + List entityList) { + assertBehaviorCommandInvoker("createBatchDeleteEntityCommand"); + return xsetupListEntityCommand(new BatchDeleteEntityCommand(), + entityList); + } + + protected BatchDeleteNonstrictEntityCommand createBatchDeleteNonstrictEntityCommand( + List entityList) { + assertBehaviorCommandInvoker("createBatchDeleteNonstrictEntityCommand"); + return xsetupListEntityCommand(new BatchDeleteNonstrictEntityCommand(), + entityList); + } + + /** + * @param The type of behavior command for list entity. + * @param command The command of behavior. (NotNull) + * @param entityList The list of entity. (NotNull, NotEmpty) + * @return The command of behavior. (NotNull) + */ + private COMMAND xsetupListEntityCommand( + COMMAND command, List entityList) { + if (entityList.isEmpty()) { + String msg = "The argument 'entityList' should not be empty: " + + entityList; + throw new IllegalStateException(msg); + } + command.setTableDbName(getTableDbName()); + _behaviorCommandInvoker.injectComponentProperty(command); + command.setEntityType(entityList.get(0).getClass()); // *The list should + // not be empty! + command.setEntityList(entityList); + return command; + } + + protected QueryDeleteCBCommand createQueryDeleteCBCommand(ConditionBean cb) { + assertBehaviorCommandInvoker("createQueryDeleteCBCommand"); + final QueryDeleteCBCommand cmd = new QueryDeleteCBCommand(); + cmd.setTableDbName(getTableDbName()); + _behaviorCommandInvoker.injectComponentProperty(cmd); + cmd.setConditionBeanType(cb.getClass()); + cmd.setConditionBean(cb); + return cmd; + } + + protected QueryUpdateEntityCBCommand createQueryUpdateEntityCBCommand( + Entity entity, ConditionBean cb) { + assertBehaviorCommandInvoker("createQueryUpdateEntityCBCommand"); + final QueryUpdateEntityCBCommand cmd = new QueryUpdateEntityCBCommand(); + cmd.setTableDbName(getTableDbName()); + _behaviorCommandInvoker.injectComponentProperty(cmd); + cmd.setConditionBeanType(cb.getClass()); + cmd.setConditionBean(cb); + cmd.setEntityType(entity.getClass()); + cmd.setEntity(entity); + return cmd; + } + + //========================================================================== + // ========= + // Accessor + // ======== + /** + * Get the auto set-upper of common column. + * + * @return The auto set-upper of common column. (Nullable: But normally + * NotNull) + */ + protected CommonColumnAutoSetupper getCommonColumnAutoSetupper() { + return _commonColumnAutoSetupper; + } + + /** + * Set the auto set-upper of common column. + * + * @param commonColumnAutoSetupper The auto set-upper of common column. + * (NotNull) + */ + public void setCommonColumnAutoSetupper( + CommonColumnAutoSetupper commonColumnAutoSetupper) { + this._commonColumnAutoSetupper = commonColumnAutoSetupper; + } } Modified: 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 2008-12-27 22:14:41 UTC (rev 1629) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/bhv/BehaviorReadable.java 2008-12-27 22:18:30 UTC (rev 1630) @@ -1,6 +1,5 @@ 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; @@ -16,34 +15,12 @@ //========================================================================== // ========= - // Definition - // ========== - /** Map-string map-mark. */ - public static final String MAP_STRING_MAP_MARK = "map:"; - - /** Map-string list-mark. */ - public static final String MAP_STRING_LIST_MARK = "list:"; - - /** Map-string start-brace. */ - public static final String MAP_STRING_START_BRACE = "@{"; - - /** Map-string end-brace. */ - public static final String MAP_STRING_END_BRACE = "@}"; - - /** Map-string delimiter. */ - public static final String MAP_STRING_DELIMITER = "@;"; - - /** Map-string equal. */ - public static final String MAP_STRING_EQUAL = "@="; - - //========================================================================== - // ========= // Table name // ========== /** - * Get table db-name. + * Get table DB name. * - * @return Table db-name. (NotNull) + * @return Table DB name. (NotNull) */ public String getTableDbName(); @@ -52,25 +29,14 @@ // DBMeta // ====== /** - * Get dbmeta. + * Get the instance of DBMeta. * - * @return DBMeta. (NotNull) + * @return The instance of DBMeta. (NotNull) */ public DBMeta getDBMeta(); //========================================================================== // ========= - // Dao Accessor - // ============ - /** - * Get dao-readable. - * - * @return Dao-readable. (NotNull) - */ - public DaoReadable getDaoReadable(); - - //========================================================================== - // ========= // New Instance // ============ /** @@ -173,4 +139,13 @@ * @return The value of sequence. (NotNull) */ public java.math.BigDecimal readNextVal(); + + //========================================================================== + // ========= + // Warm Up + // ======= + /** + * Warm up the command of behavior. + */ + public void warmUpCommand(); } Modified: 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 2008-12-27 22:14:41 UTC (rev 1629) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/bhv/BehaviorWritable.java 2008-12-27 22:18:30 UTC (rev 1630) @@ -1,6 +1,7 @@ package jp.sf.pal.scheduler.db.allcommon.bhv; -import jp.sf.pal.scheduler.db.allcommon.DaoWritable; +import java.util.List; + import jp.sf.pal.scheduler.db.allcommon.Entity; /** @@ -10,13 +11,6 @@ */ public interface BehaviorWritable extends BehaviorReadable { - /** - * Get dao-writable. - * - * @return Dao-writable. (NotNull) - */ - public DaoWritable getDaoWritable(); - //========================================================================== // =========== // Basic Entity Update @@ -116,15 +110,15 @@ /** * Lump create the list. * - * @param entityList Entity-list. (NotNull and NotEmpty) + * @param entityList The list of entity. (NotNull and NotEmpty) * @return The array of created count. */ - public int[] lumpCreate(java.util.List entityList); + public int[] lumpCreate(List entityList); /** - * Lump Modify the list. + * Lump modify the list. * - * @param entityList Entity-list. (NotNull and NotEmpty) + * @param entityList The list of entity. (NotNull and NotEmpty) * @return Modified count. * @exception jp.sf.pal.scheduler.db.allcommon.exception.EntityAlreadyUpdatedException * When the entity has already been updated. And Only when @@ -132,12 +126,12 @@ * @exception jp.sf.pal.scheduler.db.allcommon.exception.EntityDuplicatedException * When the entity has been duplicated. */ - public int[] lumpModify(java.util.List entityList); + public int[] lumpModify(List entityList); /** * Lump remove the list. * - * @param entityList Entity-list. (NotNull and NotEmpty) + * @param entityList The list of entity. (NotNull and NotEmpty) * @return Removed count. * @exception jp.sf.pal.scheduler.db.allcommon.exception.EntityAlreadyUpdatedException * When the entity has already been updated. And Only when @@ -145,5 +139,5 @@ * @exception jp.sf.pal.scheduler.db.allcommon.exception.EntityDuplicatedException * When the entity has been duplicated. */ - public int[] lumpRemove(java.util.List entityList); + public int[] lumpRemove(List entityList); } Added: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/bhv/core/BehaviorCommand.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/bhv/core/BehaviorCommand.java (rev 0) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/bhv/core/BehaviorCommand.java 2008-12-27 22:18:30 UTC (rev 1630) @@ -0,0 +1,71 @@ +package jp.sf.pal.scheduler.db.allcommon.bhv.core; + +import jp.sf.pal.scheduler.db.allcommon.cbean.ConditionBean; +import jp.sf.pal.scheduler.db.allcommon.cbean.outsidesql.OutsideSqlOption; + +/** + * @author DBFlute(AutoGenerator) + * @param The type of result. + */ +public interface BehaviorCommand { + + //========================================================================== + // ========= + // Basic Information + // ================= + public String getTableDbName(); + + public String getCommandName(); + + /** + * Get the return type of command. This type is not related to generic type + * because this is for conversion and check only. + * + * @return The return type of command. (NotNull) + */ + public Class getCommandReturnType(); + + public boolean isInitializeOnly(); + + //========================================================================== + // ========= + // Detail Information + // ================== + public boolean isConditionBean(); + + public boolean isOutsideSql(); + + public boolean isProcedure(); + + public boolean isSelect(); + + public boolean isSelectCount(); + + //========================================================================== + // ========= + // Process Callback + // ================ + public void beforeGettingSqlExecution(); + + public void afterExecuting(); + + //========================================================================== + // ========= + // SqlExecution Handling + // ===================== + public String buildSqlExecutionKey(); + + public SqlExecutionCreator createSqlExecutionCreator(); + + public Object[] getSqlExecutionArgument(); + + //========================================================================== + // ========= + // Argument Information + // ==================== + public ConditionBean getConditionBean(); + + public String getOutsideSqlPath(); + + public OutsideSqlOption getOutsideSqlOption(); +} Property changes on: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/bhv/core/BehaviorCommand.java ___________________________________________________________________ Name: svn:eol-style + native Added: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/bhv/core/BehaviorCommandComponentSetup.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/bhv/core/BehaviorCommandComponentSetup.java (rev 0) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/bhv/core/BehaviorCommandComponentSetup.java 2008-12-27 22:18:30 UTC (rev 1630) @@ -0,0 +1,23 @@ +package jp.sf.pal.scheduler.db.allcommon.bhv.core; + +import javax.sql.DataSource; + +import org.seasar.dao.BeanMetaDataFactory; +import org.seasar.dao.ValueTypeFactory; +import org.seasar.extension.jdbc.StatementFactory; + +/** + * @author DBFlute(AutoGenerator) + */ +public interface BehaviorCommandComponentSetup { + + public void setDataSource(DataSource dataSource); + + public void setStatementFactory(StatementFactory statementFactory); + + public void setBeanMetaDataFactory(BeanMetaDataFactory beanMetaDataFactory); + + public void setValueTypeFactory(ValueTypeFactory valueTypeFactory); + + public void setSqlFileEncoding(String sqlFileEncoding); +} Property changes on: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/bhv/core/BehaviorCommandComponentSetup.java ___________________________________________________________________ Name: svn:eol-style + native Added: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/bhv/core/BehaviorCommandInvoker.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/bhv/core/BehaviorCommandInvoker.java (rev 0) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/bhv/core/BehaviorCommandInvoker.java 2008-12-27 22:18:30 UTC (rev 1630) @@ -0,0 +1,842 @@ +package jp.sf.pal.scheduler.db.allcommon.bhv.core; + +import java.util.Arrays; +import java.util.List; +import java.util.Map; +import java.util.concurrent.ConcurrentHashMap; + +import javax.sql.DataSource; + +import jp.sf.pal.scheduler.db.allcommon.DBFluteConfig; +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.ConditionBeanContext; +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.dbmeta.DBMeta; +import jp.sf.pal.scheduler.db.allcommon.dbmeta.DBMetaInstanceHandler; +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.jdbc.StatementConfig; +import jp.sf.pal.scheduler.db.allcommon.s2dao.internal.various.InternalStatementFactory; +import jp.sf.pal.scheduler.db.allcommon.util.SimpleSystemUtil; +import jp.sf.pal.scheduler.db.allcommon.util.SimpleTypeUtil; +import jp.sf.pal.scheduler.db.allcommon.util.TraceViewUtil; + +import org.seasar.dao.BeanMetaDataFactory; +import org.seasar.dao.ValueTypeFactory; +import org.seasar.extension.jdbc.StatementFactory; +import org.seasar.framework.util.Disposable; +import org.seasar.framework.util.DisposableUtil; + +/** + * The invoker of behavior command. + * + *
+ * public interface methods are as follows:
+ * 
+ *   o injectComponentProperty(BehaviorCommandComponentSetup behaviorCommand);
+ *   o invoke(BehaviorCommand behaviorCommand);
+ *   o isDisposable();
+ *   o isExecutionCacheEmpty();
+ * 
+ * + * @author DBFlute(AutoGenerator) + */ +public class BehaviorCommandInvoker implements Disposable { + + //========================================================================== + // ========= + // Attribute + // ========= + // ----------------------------------------------------- + // Injection Target + // ---------------- + protected DataSource _dataSource; + + protected BeanMetaDataFactory _beanMetaDataFactory; + + protected ValueTypeFactory _valueTypeFactory; + + // ----------------------------------------------------- + // Fixed Property + // -------------- + protected final StatementFactory _statementFactory = createStatememtFactory(); + + protected final Map _executionMap = new ConcurrentHashMap(); + + // ----------------------------------------------------- + // Dispose Status + // -------------- + protected boolean disposable; + + //========================================================================== + // ========= + // Constructor + // =========== + public BehaviorCommandInvoker() { + } + + //========================================================================== + // ========= + // Command Set up + // ============== + /** + * Inject the properties of component to the command of behavior. {Public + * Interface} + * + * @param behaviorCommand The command of behavior. (NotNull) + */ + public void injectComponentProperty( + BehaviorCommandComponentSetup behaviorCommand) { + behaviorCommand.setDataSource(_dataSource); + behaviorCommand.setStatementFactory(_statementFactory); + behaviorCommand.setBeanMetaDataFactory(_beanMetaDataFactory); + behaviorCommand.setValueTypeFactory(_valueTypeFactory); + behaviorCommand.setSqlFileEncoding(getSqlFileEncoding()); + } + + protected String getSqlFileEncoding() { + return "UTF-8"; // This value is set when generating. + } + + //========================================================================== + // ========= + // Command Invoke + // ============== + /** + * Invoke the command of behavior. {Public Interface} This method is an + * entry point! + * + * @param The type of result. + * @param behaviorCommand The command of behavior. (NotNull) + * @return The result object. (Nullable) + */ + public RESULT invoke(BehaviorCommand behaviorCommand) { + clearContext(); + try { + return doInvoke(behaviorCommand); + } finally { + clearContext(); + } + } + + /** + * @param The type of result. + * @param behaviorCommand The command of behavior. (NotNull) + * @return The result object. (Nullable) + */ + protected RESULT doInvoke(BehaviorCommand behaviorCommand) { + // - - - - - - - - - - - - - + // Initialize SQL Execution + // - - - - - - - - - - - - - + if (behaviorCommand.isInitializeOnly()) { + initializeSqlExecution(behaviorCommand); + return null; // The end! (Initialize Only) + } + behaviorCommand.beforeGettingSqlExecution(); + + SqlExecution execution = null; + try { + final String key = behaviorCommand.buildSqlExecutionKey(); + execution = getSqlExecution(key); + if (execution == null) { + long beforeCmd = 0; + if (isLogEnabled()) { + beforeCmd = System.currentTimeMillis(); + } + SqlExecutionCreator creator = behaviorCommand + .createSqlExecutionCreator(); + execution = getSqlExecution(key, creator); + if (isLogEnabled()) { + final long afterCmd = System.currentTimeMillis(); + if (beforeCmd != afterCmd) { + logSqlExecution(behaviorCommand, execution, beforeCmd, + afterCmd); + } + } + } + } finally { + if (isLogEnabled()) { + logInvocation(behaviorCommand); + } + } + + long before = 0; + if (isLogEnabled()) { + before = System.currentTimeMillis(); + } + + Object ret = null; + try { + final Object[] args = behaviorCommand.getSqlExecutionArgument(); + ret = executeSql(execution, args); + } finally { + behaviorCommand.afterExecuting(); + } + final Class retType = behaviorCommand.getCommandReturnType(); + assertRetType(retType, ret); + + if (isLogEnabled()) { + final long after = System.currentTimeMillis(); + logReturn(behaviorCommand, retType, ret, before, after); + } + + // - - - - - - - - - - + // Convert and Return! + // - - - - - - - - - - + if (retType.isPrimitive()) { + ret = convertPrimitiveWrapper(retType, ret); + } else if (Number.class.isAssignableFrom(retType)) { + ret = convertNumber(retType, ret); + } + @SuppressWarnings("unchecked") + final RESULT result = (RESULT) ret; + return result; + } + + //========================================================================== + // ========= + // SQL Execution + // ============= + protected void initializeSqlExecution( + BehaviorCommand behaviorCommand) { + final String key = behaviorCommand.buildSqlExecutionKey(); + SqlExecutionCreator creator = behaviorCommand + .createSqlExecutionCreator(); + getSqlExecution(key, creator); + } + + protected SqlExecution getSqlExecution(String key) { + return _executionMap.get(key); + } + + /** + * @param key The key of SQL execution. (NotNull) + * @param executionCreator The creator of SQL execution. (NotNull) + * @return The SQL execution that may be created then. (NotNull) + */ + protected SqlExecution getSqlExecution(String key, + SqlExecutionCreator executionCreator) { + SqlExecution execution = getSqlExecution(key); + if (execution == null) { + synchronized (_executionMap) { + execution = getSqlExecution(key); + if (execution == null) { + if (isLogEnabled()) { + log("...Initializing sqlExecution for the key '" + key + + "'"); + } + _executionMap.put(key, executionCreator + .createSqlExecution()); + } else { + if (isLogEnabled()) { + log("...Getting sqlExecution as cache because the previous thread have already initilized."); + } + } + } + execution = getSqlExecution(key); + if (execution == null) { + String msg = "sqlExecutionCreator.createSqlCommand() should not return null:"; + msg = msg + " sqlExecutionCreator=" + executionCreator + + " key=" + key; + throw new IllegalStateException(msg); + } + if (!disposable) { + synchronized (this) { + if (!disposable) { + toBeDisposable(); + } + } + } + } + return execution; + } + + protected Object executeSql(SqlExecution execution, Object[] args) { + return execution.execute(args); + } + + //========================================================================== + // ========= + // Log SqlCommand + // ============== + protected void logSqlExecution( + BehaviorCommand behaviorCommand, SqlExecution execution, + long beforeCmd, long afterCmd) { + log("SqlExecution Initialization Cost: [" + + TraceViewUtil.convertToPerformanceView(afterCmd - beforeCmd) + + "]"); + } + + //========================================================================== + // ========= + // Log Invocation + // ============== + protected void logInvocation( + BehaviorCommand behaviorCommand) { + final StackTraceElement[] stackTrace = new Exception().getStackTrace(); + final InvokeNameResult behaviorResult = extractBehaviorInvokeName(stackTrace); + filterBehaviorResult(behaviorCommand, behaviorResult); + + final String invokeClassName; + final String invokeMethodName; + if (!behaviorResult.isEmptyResult()) { + invokeClassName = behaviorResult.getSimpleClassName(); + invokeMethodName = behaviorResult.getMethodName(); + } else { + invokeClassName = behaviorCommand.getTableDbName(); + invokeMethodName = behaviorCommand.getCommandName(); + } + final String expWithoutKakko = buildInvocationExpressionWithoutKakko( + behaviorCommand, invokeClassName, invokeMethodName); + + // Save behavior invoke name for error message. + putObjectToMapContext("df:BehaviorInvokeName", expWithoutKakko + "()"); + + final String equalBorder = buildFitBorder("", "=", expWithoutKakko, + false); + final String callerExpression = expWithoutKakko + "()"; + + log("/=====================================================" + + equalBorder + "=="); + log(" " + + callerExpression); + log(" " + + equalBorder + "=/"); + + logPath(behaviorCommand, stackTrace, behaviorResult); + + if (behaviorCommand.isOutsideSql() && !behaviorCommand.isProcedure()) { + final OutsideSqlContext outsideSqlContext = getOutsideSqlContext(); + if (outsideSqlContext != null) { + log("path: " + behaviorCommand.getOutsideSqlPath()); + log("option: " + behaviorCommand.getOutsideSqlOption()); + } + } + } + + protected void filterBehaviorResult( + BehaviorCommand behaviorCommand, + InvokeNameResult behaviorResult) { + final String simpleClassName = behaviorResult.getSimpleClassName(); + if (simpleClassName == null) { + return; + } + if (simpleClassName.contains("Behavior") + && simpleClassName.endsWith("$SLFunction")) { + final String behaviorClassName = findBehaviorClassNameFromDBMeta(behaviorCommand + .getTableDbName()); + behaviorResult.setSimpleClassName(behaviorClassName); + behaviorResult.setMethodName("scalarSelect()." + + behaviorResult.getMethodName()); + } + } + + protected void logPath(BehaviorCommand behaviorCommand, + StackTraceElement[] stackTrace, InvokeNameResult behaviorResult) { + final int bhvNextIndex = behaviorResult.getNextStartIndex(); + final InvokeNameResult clientResult = extractClientInvokeName( + stackTrace, bhvNextIndex); + final int clientFirstIndex = clientResult.getFoundFirstIndex(); + final InvokeNameResult byPassResult = extractByPassInvokeName( + stackTrace, bhvNextIndex, clientFirstIndex - bhvNextIndex); + + final String clientInvokeName = clientResult.getInvokeName(); + final String byPassInvokeName = byPassResult.getInvokeName(); + final String behaviorInvokeName = behaviorResult.getInvokeName(); + if (clientInvokeName.trim().length() == 0 + && byPassInvokeName.trim().length() == 0) { + return; + } + + // Save client invoke name for error message. + if (!clientResult.isEmptyResult()) { + putObjectToMapContext("df:ClientInvokeName", clientInvokeName); + } + // Save by-pass invoke name for error message. + if (!byPassResult.isEmptyResult()) { + putObjectToMapContext("df:ByPassInvokeName", byPassInvokeName); + } + + log(clientInvokeName + byPassInvokeName + behaviorInvokeName + "..."); + } + + protected String buildInvocationExpressionWithoutKakko( + BehaviorCommand behaviorCommand, String invokeClassName, + String invokeMethodName) { + if (invokeClassName.contains("OutsideSql") + && invokeClassName.endsWith("Executor")) { // OutsideSql + // Executor Handling + try { + final String originalName = invokeClassName; + if (behaviorCommand.isOutsideSql()) { + final OutsideSqlContext outsideSqlContext = getOutsideSqlContext(); + final String tableDbName = outsideSqlContext + .getTableDbName(); + final String behaviorClassName = findBehaviorClassNameFromDBMeta(tableDbName); + invokeClassName = behaviorClassName + ".outsideSql()"; + if (originalName.endsWith("OutsideSqlEntityExecutor")) { + invokeClassName = invokeClassName + ".entityHandling()"; + } else if (originalName + .endsWith("OutsideSqlPagingExecutor")) { + if (outsideSqlContext.isAutoPagingLogging()) { + invokeClassName = invokeClassName + ".autoPaging()"; + } else { + invokeClassName = invokeClassName + + ".manualPaging()"; + } + } else if (originalName + .endsWith("OutsideSqlCursorExecutor")) { + invokeClassName = invokeClassName + ".cursorHandling()"; + } + } else { + invokeClassName = "OutsideSql"; + } + } catch (RuntimeException ignored) { + log("Ignored exception occurred: msg=" + ignored.getMessage()); + } + } + String callerExpressionWithoutKakko = invokeClassName + "." + + invokeMethodName; + if ("selectPage".equals(invokeMethodName)) { // Special Handling! + boolean resultTypeInteger = false; + if (behaviorCommand.isOutsideSql()) { + final OutsideSqlContext outsideSqlContext = getOutsideSqlContext(); + final Object resultTypeSpecification = outsideSqlContext + .getResultTypeSpecification(); + if (resultTypeSpecification != null + && resultTypeSpecification instanceof Class) { + final Class resultType = (Class) resultTypeSpecification; + if (Integer.class.isAssignableFrom(resultType)) { + resultTypeInteger = true; + } + } + } + if (resultTypeInteger || behaviorCommand.isSelectCount()) { + callerExpressionWithoutKakko = callerExpressionWithoutKakko + + "():count"; + } else { + callerExpressionWithoutKakko = callerExpressionWithoutKakko + + "():paging"; + } + } + return callerExpressionWithoutKakko; + } + + protected String buildFitBorder(String prefix, String element, + String lengthTargetString, boolean space) { + final int length = space ? lengthTargetString.length() / 2 + : lengthTargetString.length(); + final StringBuffer sb = new StringBuffer(); + sb.append(prefix); + for (int i = 0; i < length; i++) { + sb.append(element); + if (space) { + sb.append(" "); + } + } + if (space) { + sb.append(element); + } + return sb.toString(); + } + + protected InvokeNameResult extractClientInvokeName( + StackTraceElement[] stackTrace, final int startIndex) { + final List 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 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 suffixList = Arrays.asList(new String[] { "Bhv", + "BehaviorReadable", "BehaviorWritable", "PagingInvoker" }); + final List keywordList = Arrays.asList(new String[] { "Bhv$", + "BehaviorReadable$", "BehaviorWritable$" }); + final List ousideSql1List = Arrays + .asList(new String[] { "OutsideSql" }); + final List ousideSql2List = Arrays + .asList(new String[] { "Executor" }); + final List 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 suffixList) { + for (String suffix : suffixList) { + if (className.endsWith(suffix)) { + return true; + } + } + return false; + } + + protected boolean isClassNameContains(String className, + List keywordList) { + for (String keyword : keywordList) { + if (className.contains(keyword)) { + return true; + } + } + return false; + } + + /** + * @param resource the call-back resource for invoke-name-extracting. + * (NotNull) + * @param stackTrace Stack log. (NotNull) + * @return The result of invoke name. (NotNull: If not found, returns empty + * string.) + */ + protected InvokeNameResult extractInvokeName( + InvokeNameExtractingResource resource, + StackTraceElement[] stackTrace) { + final InvokeNameExtractorImpl extractor = new InvokeNameExtractorImpl(); + extractor.setStackTrace(stackTrace); + return extractor.extractInvokeName(resource); + } + + /** + * @param simpleClassName The simple class name. (NotNull) + * @return The simple class name removed the base prefix. (NotNull) + */ + protected String removeBasePrefixFromSimpleClassName(String simpleClassName) { + if (!simpleClassName.startsWith("Bs")) { + return simpleClassName; + } + final int prefixLength = "Bs".length(); + if (!Character.isUpperCase(simpleClassName.substring(prefixLength) + .charAt(0))) { + return simpleClassName; + } + if (simpleClassName.length() <= prefixLength) { + return simpleClassName; + } + return "" + simpleClassName.substring(prefixLength); + } + + protected String findBehaviorClassNameFromDBMeta(String tableDbName) { + final DBMeta dbmeta = DBMetaInstanceHandler.findDBMeta(tableDbName); + final String behaviorTypeName = dbmeta.getBehaviorTypeName(); + final String behaviorClassName = behaviorTypeName + .substring(behaviorTypeName.lastIndexOf(".") + ".".length()); + return removeBasePrefixFromSimpleClassName(behaviorClassName); + } + + //========================================================================== + // ========= + // Log Return + // ========== + protected void logReturn(BehaviorCommand behaviorCommand, + Class retType, Object ret, long before, long after) { + try { + final String daoResultPrefix = "===========/ [" + + TraceViewUtil.convertToPerformanceView(after - before) + + " - "; + if (List.class.isAssignableFrom(retType)) { + if (ret == null) { + log(daoResultPrefix + "Selected list: null]"); + } else { + final List ls = (java.util.List) ret; + if (ls.isEmpty()) { + log(daoResultPrefix + "Selected list: 0]"); + } else if (ls.size() == 1 && ls.get(0) instanceof Number) { + log(daoResultPrefix + "Selected count: " + ls.get(0) + + "]"); + } else { + log(daoResultPrefix + "Selected list: " + ls.size() + + " first=" + ls.get(0) + "]"); + } + } + } else if (Entity.class.isAssignableFrom(retType)) { + if (ret == null) { + log(daoResultPrefix + "Selected entity: null" + "]"); + } else { + final Entity entity = (Entity) ret; + log(daoResultPrefix + "Selected entity: " + entity + "]"); + } + } else if (Entity.class.isAssignableFrom(retType)) { + if (ret == null) { + log(daoResultPrefix + "Selected entity: null" + "]"); + } else { + final Entity entity = (Entity) ret; + log(daoResultPrefix + "Selected entity: " + entity + "]"); + } + } else if (int[].class.isAssignableFrom(retType)) { + if (ret == null) { + log(daoResultPrefix + "Selected entity: null" + "]"); + } else { + final int[] resultArray = (int[]) ret; + if (resultArray.length == 0) { + log(daoResultPrefix + "All updated count: 0]"); + } else { + final StringBuilder sb = new StringBuilder(); + boolean resultExpressionScope = true; + int resultCount = 0; + int loopCount = 0; + for (int element : resultArray) { + resultCount = resultCount + element; + if (resultExpressionScope) { + if (loopCount <= 10) { + if (sb.length() == 0) { + sb.append(element); + } else { + sb.append(",").append(element); + } + } else { + sb.append(",").append("..."); + resultExpressionScope = false; + } + } + ++loopCount; + } + sb.insert(0, "{").append("}"); + log(daoResultPrefix + "All updated count: " + + resultCount + " result=" + sb + "]"); + } + } + } else { + if (behaviorCommand.isSelectCount()) { + log(daoResultPrefix + "Selected count: " + ret + "]"); + } else { + log(daoResultPrefix + "Result: " + ret + "]"); + } + } + log(" "); + } catch (RuntimeException e) { + String msg = "Result object debug threw the exception: behaviorCommand="; + msg = msg + behaviorCommand + " retType=" + retType; + msg = msg + " ret=" + ret; + throw e; + } + } + + //========================================================================== + // ========= + // Context Helper + // ============== + protected OutsideSqlContext getOutsideSqlContext() { + if (!OutsideSqlContext.isExistOutsideSqlContextOnThread()) { + return null; + } + return OutsideSqlContext.getOutsideSqlContextOnThread(); + } + + protected void putObjectToMapContext(String key, Object value) { + InternalMapContext.setObject(key, value); + } + + protected void clearContext() { + if (OutsideSqlContext.isExistOutsideSqlContextOnThread()) { + OutsideSqlContext.clearOutsideSqlContextOnThread(); + } + if (FetchNarrowingBeanContext.isExistFetchNarrowingBeanOnThread()) { + // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + // - - - - - - - - - - - - - - - + // Because there is possible that fetch narrowing has been ignored + // for manualPaging of outsideSql. + // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + // - - - - - - - - - - - - - - - + FetchNarrowingBeanContext.getFetchNarrowingBeanOnThread() + .restoreIgnoredFetchNarrowing(); + + FetchNarrowingBeanContext.clearFetchNarrowingBeanOnThread(); + } + if (ConditionBeanContext.isExistConditionBeanOnThread()) { + ConditionBeanContext.clearConditionBeanOnThread(); + } + if (InternalMapContext.isExistInternalMapContextOnThread()) { + InternalMapContext.clearInternalMapContextOnThread(); + } + } + + //========================================================================== + // ========= + // Execute Status Log + // ================== + protected void log(String msg) { + XLog.log(msg); + } + + protected boolean isLogEnabled() { + return XLog.isLogEnabled(); + } + + protected StatementFactory createStatememtFactory() { + final StatementConfig defaultStatementConfig = DBFluteConfig + .getInstance().getDefaultStatementConfig(); + final boolean internalDebug = DBFluteConfig.getInstance() + .isInternalDebug(); + InternalStatementFactory factory = new InternalStatementFactory(); + factory.setDefaultStatementConfig(defaultStatementConfig); + factory.setInternalDebug(internalDebug); + return factory; + } + + //========================================================================== + // ========= + // Dispose + // ======= + public void toBeDisposable() { + DisposableUtil.add(this); + disposable = true; + } + + public void dispose() { + _executionMap.clear(); + disposable = false; + } + + public boolean isDisposable() { + return disposable; + } + + public boolean isExecutionCacheEmpty() { + return _executionMap.isEmpty(); + } + + //========================================================================== + // ========= + // Convert Helper + // ============== + protected Object convertPrimitiveWrapper(Class retType, Object ret) { + return SimpleTypeUtil.toWrapper(retType, ret); + } + + protected Object convertNumber(Class retType, Object ret) { + return SimpleTypeUtil.toNumber(retType, ret); + } + + //========================================================================== + // ========= + // Assert Helper + // ============= + protected void assertRetType(Class retType, Object ret) { + if (List.class.isAssignableFrom(retType)) { + if (ret != null && !(ret instanceof List)) { + String msg = "The retType is difference from actual return: "; + msg = msg + "retType=" + retType + " ret.getClass()=" + + ret.getClass() + " ref=" + ret; + throw new IllegalStateException(msg); + } + } else if (Entity.class.isAssignableFrom(retType)) { + if (ret != null && !(ret instanceof Entity)) { + String msg = "The retType is difference from actual return: "; + msg = msg + "retType=" + retType + " ret.getClass()=" + + ret.getClass() + " ref=" + ret; + throw new IllegalStateException(msg); + } + } + } + + //========================================================================== + // ========= + // General Helper + // ============== + protected String getLineSeparator() { + return SimpleSystemUtil.getLineSeparator(); + } + + //========================================================================== + // ========= + // Accessor + // ======== + public void setDataSource(DataSource dataSource) { + _dataSource = dataSource; + } + + public void setBeanMetaDataFactory(BeanMetaDataFactory beanMetaDataFactory) { + _beanMetaDataFactory = beanMetaDataFactory; + } + + public void setValueTypeFactory(ValueTypeFactory valueTypeFactory) { + _valueTypeFactory = valueTypeFactory; + } +} Property changes on: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/bhv/core/BehaviorCommandInvoker.java ___________________________________________________________________ Name: svn:eol-style + native Added: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/bhv/core/BehaviorInitializer.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/bhv/core/BehaviorInitializer.java (rev 0) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/bhv/core/BehaviorInitializer.java 2008-12-27 22:18:30 UTC (rev 1630) @@ -0,0 +1,190 @@ +package jp.sf.pal.scheduler.db.allcommon.bhv.core; + +import java.util.Collections; +import java.util.Map; +import java.util.concurrent.ConcurrentHashMap; + +import javax.sql.XADataSource; + +import jp.sf.pal.scheduler.db.allcommon.DBDef; +import jp.sf.pal.scheduler.db.allcommon.DBFluteConfig; +import jp.sf.pal.scheduler.db.allcommon.cbean.ConditionBeanContext; +import jp.sf.pal.scheduler.db.allcommon.dbmeta.DBMetaInstanceHandler; +import jp.sf.pal.scheduler.db.allcommon.s2dao.internal.sqllog.InternalSqlLogRegistry; +import jp.sf.pal.scheduler.db.allcommon.util.SimpleSystemUtil; + +import org.seasar.extension.dbcp.impl.XADataSourceImpl; + +/** + * @author DBFlute(AutoGenerator) + */ +public class BehaviorInitializer { + + //========================================================================== + // ========= + // Definition + // ========== + /** Log-instance. */ + private static final org.apache.commons.logging.Log _log = org.apache.commons.logging.LogFactory + .getLog(BehaviorInitializer.class); + + // ----------------------------------------------------- + // For DBMeta + // ---------- + /** + * The map of table DB name and class name for the handler of DB meta + * instance. + */ + protected static final Map _tableDbNameClassNameMap; + static { + final Map tmpMap = newConcurrentHashMap(); + tmpMap.put("EVENT_SCHEDULE", + "jp.sf.pal.scheduler.db.bsentity.dbmeta.EventScheduleDbm"); + tmpMap + .put("EVENT_SCHEDULE_CONTENT", + "jp.sf.pal.scheduler.db.bsentity.dbmeta.EventScheduleContentDbm"); + tmpMap + .put("EVENT_SCHEDULE_MAPPING", + "jp.sf.pal.scheduler.db.bsentity.dbmeta.EventScheduleMappingDbm"); + tmpMap.put("FACILITY", + "jp.sf.pal.scheduler.db.bsentity.dbmeta.FacilityDbm"); + tmpMap.put("FACILITY_CONTENT", + "jp.sf.pal.scheduler.db.bsentity.dbmeta.FacilityContentDbm"); + tmpMap.put("FACILITY_GROUP", + "jp.sf.pal.scheduler.db.bsentity.dbmeta.FacilityGroupDbm"); + tmpMap + .put("FACILITY_SCHEDULE_MAPPING", + "jp.sf.pal.scheduler.db.bsentity.dbmeta.FacilityScheduleMappingDbm"); + 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("USER_INFO", + "jp.sf.pal.scheduler.db.bsentity.dbmeta.UserInfoDbm"); + _tableDbNameClassNameMap = Collections.unmodifiableMap(tmpMap); + } + + protected static ConcurrentHashMap newConcurrentHashMap() { + return new ConcurrentHashMap(); + } + + //========================================================================== + // ========= + // Constructor + // =========== + /** + * Constructor. And initialize various components related behavior. + * + * @param xaDataSource The data source of XA. (Nullable) + */ + public BehaviorInitializer(XADataSource xaDataSource) { + _log + .info("/* * * * * * * * * * * * * * * * * * * * * * * * * * * * {DBFlute}"); + initializeDBMetaResource(); + handleSqlLogRegistry(); + loadCoolClasses(); + if (xaDataSource != null) { + showInformation(xaDataSource); + setupDBDefByDriverClassName(xaDataSource); + } + DBFluteConfig.getInstance().lock(); + _log.info("* * * * */"); + } + + //========================================================================== + // ========= + // DBMeta + // ====== + protected void initializeDBMetaResource() { + DBMetaInstanceHandler.setupDBMetaResource(_tableDbNameClassNameMap); + } + + //========================================================================== + // ========= + // Cool Classes + // ============ + protected void loadCoolClasses() { // for S2Container basically + ConditionBeanContext.loadCoolClasses(); // Against the ClassLoader + // Headache! + } + + //========================================================================== + // ========= + // Information + // =========== + protected void showInformation(XADataSource xaDataSource) { + if (xaDataSource != null && xaDataSource instanceof XADataSourceImpl) { + final StringBuilder sb = new StringBuilder(); + final XADataSourceImpl xaDataSourceImpl = (XADataSourceImpl) xaDataSource; + final String driverClassName = xaDataSourceImpl + .getDriverClassName(); + final String url = xaDataSourceImpl.getURL(); + final String user = xaDataSourceImpl.getUser(); + sb.append(" [XADataSource]:").append(getLineSeparator()); + sb.append(" driver = " + driverClassName).append( + getLineSeparator()); + sb.append(" url = " + url).append(getLineSeparator()); + sb.append(" user = " + user); + _log.info("{Injection Information}" + getLineSeparator() + sb); + } + } + + //========================================================================== + // ========= + // Database Product Name + // ===================== + protected void setupDBDefByDriverClassName(XADataSource xaDataSource) { + if (xaDataSource != null && xaDataSource instanceof XADataSourceImpl) { + final XADataSourceImpl xaDataSourceImpl = (XADataSourceImpl) xaDataSource; + final String driverClassName = xaDataSourceImpl + .getDriverClassName(); + final DBDef dbdef = DBDef.byDriverClassName(driverClassName); + if (dbdef != null) { + DBDef.setCurrentDef(dbdef); + return; + } + } + } + + //========================================================================== + // ========= + // SQL Log Registry + // ================ + protected void handleSqlLogRegistry() { + if (DBFluteConfig.getInstance().isUseSqlLogRegistry()) { + final StringBuilder sb = new StringBuilder(); + sb.append("{SqlLog Information}").append(getLineSeparator()); + sb.append(" [SqlLogRegistry]").append(getLineSeparator()); + if (InternalSqlLogRegistry.setupSqlLogRegistry()) { + sb + .append( + " ...Setting up SqlLogRegistry(org.seasar.extension.jdbc)!") + .append(getLineSeparator()); + sb + .append(" Because the property 'useSqlLogRegistry' of the config of DBFlute is true."); + } else { + sb + .append(" SqlLogRegistry(org.seasar.extension.jdbc) is not supported at the version!"); + } + _log.info(sb); + } else { + final Object sqlLogRegistry = InternalSqlLogRegistry + .findContainerSqlLogRegistry(); + if (sqlLogRegistry != null) { + InternalSqlLogRegistry.closeRegistration(); + } + } + } + + //========================================================================== + // ========= + // General Helper + // ============== + protected String getLineSeparator() { + return SimpleSystemUtil.getLineSeparator(); + } +} Property changes on: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/bhv/core/BehaviorInitializer.java ___________________________________________________________________ Name: svn:eol-style + native Added: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/bhv/core/SqlExecution.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/bhv/core/SqlExecution.java (rev 0) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/bhv/core/SqlExecution.java 2008-12-27 22:18:30 UTC (rev 1630) @@ -0,0 +1,9 @@ +package jp.sf.pal.scheduler.db.allcommon.bhv.core; + +/** + * @author DBFlute(AutoGenerator) + */ +public interface SqlExecution { + + public Object execute(Object[] args); +} Property changes on: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/bhv/core/SqlExecution.java ___________________________________________________________________ Name: svn:eol-style + native Added: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/bhv/core/SqlExecutionCreator.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/bhv/core/SqlExecutionCreator.java (rev 0) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/bhv/core/SqlExecutionCreator.java 2008-12-27 22:18:30 UTC (rev 1630) @@ -0,0 +1,9 @@ +package jp.sf.pal.scheduler.db.allcommon.bhv.core; + +/** + * @author DBFlute(AutoGenerator) + */ +public interface SqlExecutionCreator { + + SqlExecution createSqlExecution(); +} Property changes on: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/bhv/core/SqlExecutionCreator.java ___________________________________________________________________ Name: svn:eol-style + native Added: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/bhv/core/command/AbstractBehaviorCommand.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/bhv/core/command/AbstractBehaviorCommand.java (rev 0) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/bhv/core/command/AbstractBehaviorCommand.java 2008-12-27 22:18:30 UTC (rev 1630) @@ -0,0 +1,261 @@ +package jp.sf.pal.scheduler.db.allcommon.bhv.core.command; + +import java.sql.ResultSet; +import java.sql.SQLException; +import java.util.ArrayList; +import java.util.List; + +import javax.sql.DataSource; + +import jp.sf.pal.scheduler.db.allcommon.DBDef; +import jp.sf.pal.scheduler.db.allcommon.bhv.core.BehaviorCommand; +import jp.sf.pal.scheduler.db.allcommon.bhv.core.BehaviorCommandComponentSetup; +import jp.sf.pal.scheduler.db.allcommon.s2dao.internal.rshandler.InternalBeanListMetaDataResultSetHandler; +import jp.sf.pal.scheduler.db.allcommon.s2dao.internal.sqlcommand.InternalUpdateDynamicCommand; +import jp.sf.pal.scheduler.db.allcommon.s2dao.internal.various.InternalRelationRowCreator; +import jp.sf.pal.scheduler.db.allcommon.s2dao.internal.various.InternalRowCreator; + +import org.seasar.dao.BeanMetaData; +import org.seasar.dao.BeanMetaDataFactory; +import org.seasar.dao.ValueTypeFactory; +import org.seasar.extension.jdbc.ResultSetHandler; +import org.seasar.extension.jdbc.StatementFactory; +import org.seasar.extension.jdbc.ValueType; +import org.seasar.extension.jdbc.types.ValueTypes; + +/** + * @author DBFlute(AutoGenerator) + * @param The type of result. + */ +public abstract class AbstractBehaviorCommand implements + BehaviorCommand, BehaviorCommandComponentSetup { + + //========================================================================== + // ========= + // Attribute + // ========= + // ----------------------------------------------------- + // Basic Information + // ----------------- + /** The table DB name. (Required) */ + protected String _tableDbName; + + /** Is it initialize only? (Choice) */ + protected boolean _initializeOnly; + + // ----------------------------------------------------- + // Injection Component + // ------------------- + protected DataSource _dataSource; + + protected StatementFactory _statementFactory; + + protected BeanMetaDataFactory _beanMetaDataFactory; + + protected ValueTypeFactory _valueTypeFactory; + + protected String _sqlFileEncoding; + + //========================================================================== + // ========= + // Factory + // ======= + // ----------------------------------------------------- + // UpdateDynamicCommnd + // ------------------- + protected InternalUpdateDynamicCommand createUpdateDynamicCommand( + String[] argNames, Class[] argTypes, String sql) { + final InternalUpdateDynamicCommand cmd = new InternalUpdateDynamicCommand( + _dataSource, _statementFactory); + cmd.setArgNames(argNames); + cmd.setArgTypes(argTypes); + if (sql != null) { + cmd.setSql(sql); + } + return cmd; + } + + // ----------------------------------------------------- + // ResultSetHandler + // ---------------- + protected ResultSetHandler createBeanListMetaDataResultSetHandler( + BeanMetaData bmd) { + final InternalRowCreator rowCreator = createInternalRowCreator(bmd); + final InternalRelationRowCreator relationRowCreator = createInternalRelationRowCreator(bmd); + return new InternalBeanListMetaDataResultSetHandler(bmd, rowCreator, + relationRowCreator); + } + + protected ResultSetHandler createObjectResultSetHandler(Class objectType) { + final ValueType valueType = ValueTypes.getValueType(objectType); + return new InternalObjectResultSetHandler(valueType); + } + + protected ResultSetHandler createObjectListResultSetHandler( + Class objectType) { + final ValueType valueType = ValueTypes.getValueType(objectType); + return createObjectListResultSetHandler(valueType); + } + + protected ResultSetHandler createObjectListResultSetHandler( + ValueType valueType) { + return new InternalObjectListResultSetHandler(valueType); + } + + protected static class InternalObjectResultSetHandler implements + ResultSetHandler { + private ValueType valueType; + + public InternalObjectResultSetHandler(ValueType valueType) { + this.valueType = valueType; + } + + public Object handle(ResultSet rs) throws SQLException { + while (rs.next()) { + return valueType.getValue(rs, 1); + } + return null; + } + } + + protected static class InternalObjectListResultSetHandler implements + ResultSetHandler { + private ValueType valueType; + + public InternalObjectListResultSetHandler(ValueType valueType) { + this.valueType = valueType; + } + + public Object handle(ResultSet rs) throws SQLException { + final List ret = new ArrayList(); + while (rs.next()) { + ret.add(valueType.getValue(rs, 1)); + } + return ret; + } + } + + protected static class InternalNullResultSetHandler implements + ResultSetHandler { + public Object handle(ResultSet rs) throws SQLException { + return null; + } + } + + protected InternalRowCreator createInternalRowCreator(BeanMetaData bmd) { + final Class clazz = bmd != null ? bmd.getBeanClass() : null; + return InternalRowCreator.createInternalRowCreator(clazz); + } + + protected InternalRelationRowCreator createInternalRelationRowCreator( + BeanMetaData bmd) { + return new InternalRelationRowCreator(); // Not yet implemented about + // performance tuning! + } + + //========================================================================== + // ========= + // Assist Helper + // ============= + protected String buildDbmsSuffix() { + final String productName = DBDef.getCurrentDef().code(); + return (productName != null ? "_" + productName.toLowerCase() : ""); + } + + //========================================================================== + // ========= + // Assert Helper + // ============= + protected void assertBasicProperty(String methodName) { + if (_tableDbName == null) { + throw new IllegalStateException(buildAssertMessage("_tableDbName", + methodName)); + } + } + + protected void assertComponentProperty(String methodName) { + if (_dataSource == null) { + throw new IllegalStateException(buildAssertMessage("_dataSource", + methodName)); + } + if (_statementFactory == null) { + throw new IllegalStateException(buildAssertMessage( + "_statementFactory", methodName)); + } + if (_beanMetaDataFactory == null) { + throw new IllegalStateException(buildAssertMessage( + "_beanMetaDataFactory", methodName)); + } + if (_valueTypeFactory == null) { + throw new IllegalStateException(buildAssertMessage( + "_valueTypeFactory", methodName)); + } + if (_sqlFileEncoding == null) { + throw new IllegalStateException(buildAssertMessage( + "_sqlFileEncoding", methodName)); + } + } + + protected String buildAssertMessage(String propertyName, String methodName) { + propertyName = propertyName.startsWith("_") ? propertyName + .substring("_".length()) : propertyName; + String msg = "The property '" + propertyName + "' should not be null"; + msg = msg + " when you call " + methodName + "()."; + throw new IllegalStateException(msg); + } + + //========================================================================== + // ========= + // Basic Override + // ============== + @Override + public String toString() { + return getClass().getSimpleName() + ":{" + buildSqlExecutionKey() + "}"; + } + + //========================================================================== + // ========= + // Accessor + // ======== + // ----------------------------------------------------- + // Basic Information + // ----------------- + public String getTableDbName() { + return _tableDbName; + } + + public void setTableDbName(String tableDbName) { + _tableDbName = tableDbName; + } + + public void setInitializeOnly(boolean initializeOnly) { + _initializeOnly = initializeOnly; + } + + public boolean isInitializeOnly() { + return _initializeOnly; + } + + // ----------------------------------------------------- + // Injection Component + // ------------------- + public void setDataSource(DataSource dataSource) { + _dataSource = dataSource; + } + + public void setStatementFactory(StatementFactory statementFactory) { + _statementFactory = statementFactory; + } + + public void setBeanMetaDataFactory(BeanMetaDataFactory beanMetaDataFactory) { + _beanMetaDataFactory = beanMetaDataFactory; + } + + public void setValueTypeFactory(ValueTypeFactory valueTypeFactory) { + _valueTypeFactory = valueTypeFactory; + } + + public void setSqlFileEncoding(String sqlFileEncoding) { + _sqlFileEncoding = sqlFileEncoding; + } +} Property changes on: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/bhv/core/command/AbstractBehaviorCommand.java ___________________________________________________________________ Name: svn:eol-style + native Added: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/bhv/core/command/AbstractEntityCommand.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/bhv/core/command/AbstractEntityCommand.java (rev 0) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/bhv/core/command/AbstractEntityCommand.java 2008-12-27 22:18:30 UTC (rev 1630) @@ -0,0 +1,182 @@ +package jp.sf.pal.scheduler.db.allcommon.bhv.core.command; + +import java.util.ArrayList; +import java.util.List; + +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.outsidesql.OutsideSqlOption; +import jp.sf.pal.scheduler.db.allcommon.dbmeta.DBMeta; + +import org.seasar.dao.BeanMetaData; +import org.seasar.extension.jdbc.PropertyType; + +/** + * @author DBFlute(AutoGenerator) + */ +public abstract class AbstractEntityCommand extends + AbstractBehaviorCommand { + + //========================================================================== + // ========= + // Attribute + // ========= + /** The type of entity. (Required) */ + protected Class _entityType; + + /** The instance of condition-bean. (Required) */ + protected Entity _entity; + + //========================================================================== + // ========= + // Basic Information + // ================= + public Class getCommandReturnType() { + return Integer.class; + } + + //========================================================================== + // ========= + // Detail Information + // ================== + public boolean isConditionBean() { + return false; + } + + public boolean isOutsideSql() { + return false; + } + + public boolean isProcedure() { + return false; + } + + public boolean isSelect() { + return false; + } + + public boolean isSelectCount() { + return false; + } + + //========================================================================== + // ========= + // Factory + // ======= + // ----------------------------------------------------- + // BeanMetaData + // ------------ + protected BeanMetaData createBeanMetaData() { + return _beanMetaDataFactory.createBeanMetaData(_entityType); + } + + //========================================================================== + // ========= + // Process Callback + // ================ + public void beforeGettingSqlExecution() { + } + + public void afterExecuting() { + } + + //========================================================================== + // ========= + // SqlExecution Handling + // ===================== + public String buildSqlExecutionKey() { + assertStatus("buildSqlExecutionKey"); + return _tableDbName + ":" + getCommandName() + "(" + + _entityType.getSimpleName() + ")"; + } + + public Object[] getSqlExecutionArgument() { + assertStatus("getSqlExecutionArgument"); + return new Object[] { _entity }; + } + + //========================================================================== + // ========= + // Argument Information + // ==================== + public ConditionBean getConditionBean() { + return null; + } + + public String getOutsideSqlPath() { + return null; + } + + public OutsideSqlOption getOutsideSqlOption() { + return null; + } + + //========================================================================== + // ========= + // Assist Helper + // ============= + protected DBMeta findDBMeta() { + // /- - - - - - - - - - - - - - - - - - - - - - - - - - - - + // Cannot use the handler of DBMeta instance + // because the customize-entity is contained to find here. + // - - - - - - - - - -/ + // DBMetaInstanceHandler.findDBMeta(_tableDbName); + + final Class beanType = _entityType; + if (beanType == null) { + return null; + } + if (!Entity.class.isAssignableFrom(beanType)) { + return null; + } + final Entity entity; + try { + entity = (Entity) beanType.newInstance(); + } catch (InstantiationException e) { + throw new IllegalStateException(e); + } catch (IllegalAccessException e) { + throw new IllegalStateException(e); + } + return entity.getDBMeta(); + } + + protected String[] getPersistentPropertyNames(BeanMetaData bmd) { + final List nameList = new ArrayList(); + for (int i = 0; i < bmd.getPropertyTypeSize(); ++i) { + final PropertyType pt = bmd.getPropertyType(i); + if (pt.isPersistent()) { + nameList.add(pt.getPropertyName()); + } + } + return nameList.toArray(new String[nameList.size()]); + } + + //========================================================================== + // ========= + // Assert Helper + // ============= + protected void assertStatus(String methodName) { + assertBasicProperty(methodName); + assertComponentProperty(methodName); + if (_entityType == null) { + throw new IllegalStateException(buildAssertMessage("_entityType", + methodName)); + } + if (_entity == null) { + throw new IllegalStateException(buildAssertMessage("_entity", + methodName)); + } + } + + //========================================================================== + // ========= + // Accessor + // ======== + public void setEntityType(Class entityType) { + _entityType = entityType; + } + + public void setEntity(Entity entity) { + _entity = entity; + } +} Property changes on: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/bhv/core/command/AbstractEntityCommand.java ___________________________________________________________________ Name: svn:eol-style + native Added: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/bhv/core/command/AbstractListEntityCommand.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/bhv/core/command/AbstractListEntityCommand.java (rev 0) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/bhv/core/command/AbstractListEntityCommand.java 2008-12-27 22:18:30 UTC (rev 1630) @@ -0,0 +1,182 @@ +package jp.sf.pal.scheduler.db.allcommon.bhv.core.command; + +import java.util.ArrayList; +import java.util.List; + +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.outsidesql.OutsideSqlOption; +import jp.sf.pal.scheduler.db.allcommon.dbmeta.DBMeta; + +import org.seasar.dao.BeanMetaData; +import org.seasar.extension.jdbc.PropertyType; + +/** + * @author DBFlute(AutoGenerator) + */ +public abstract class AbstractListEntityCommand extends + AbstractBehaviorCommand { + + //========================================================================== + // ========= + // Attribute + // ========= + /** The type of entity. (Required) */ + protected Class _entityType; + + /** The instance of condition-bean. (Required) */ + protected List _entityList; + + //========================================================================== + // ========= + // Basic Information + // ================= + public Class getCommandReturnType() { + return int[].class; + } + + //========================================================================== + // ========= + // Detail Information + // ================== + public boolean isConditionBean() { + return false; + } + + public boolean isOutsideSql() { + return false; + } + + public boolean isProcedure() { + return false; + } + + public boolean isSelect() { + return false; + } + + public boolean isSelectCount() { + return false; + } + + //========================================================================== + // ========= + // Factory + // ======= + // ----------------------------------------------------- + // BeanMetaData + // ------------ + protected BeanMetaData createBeanMetaData() { + return _beanMetaDataFactory.createBeanMetaData(_entityType); + } + + //========================================================================== + // ========= + // Process Callback + // ================ + public void beforeGettingSqlExecution() { + } + + public void afterExecuting() { + } + + //========================================================================== + // ========= + // SqlExecution Handling + // ===================== + public String buildSqlExecutionKey() { + assertStatus("buildSqlExecutionKey"); + return _tableDbName + ":" + getCommandName() + "(List<" + + _entityType.getSimpleName() + ">)"; + } + + public Object[] getSqlExecutionArgument() { + assertStatus("getSqlExecutionArgument"); + return new Object[] { _entityList }; + } + + //========================================================================== + // ========= + // Argument Information + // ==================== + public ConditionBean getConditionBean() { + return null; + } + + public String getOutsideSqlPath() { + return null; + } + + public OutsideSqlOption getOutsideSqlOption() { + return null; + } + + //========================================================================== + // ========= + // Assist Helper + // ============= + protected DBMeta findDBMeta() { + // /- - - - - - - - - - - - - - - - - - - - - - - - - - - - + // Cannot use the handler of DBMeta instance + // because the customize-entity is contained to find here. + // - - - - - - - - - -/ + // DBMetaInstanceHandler.findDBMeta(_tableDbName); + + final Class beanType = _entityType; + if (beanType == null) { + return null; + } + if (!Entity.class.isAssignableFrom(beanType)) { + return null; + } + final Entity entity; + try { + entity = (Entity) beanType.newInstance(); + } catch (InstantiationException e) { + throw new IllegalStateException(e); + } catch (IllegalAccessException e) { + throw new IllegalStateException(e); + } + return entity.getDBMeta(); + } + + protected String[] getPersistentPropertyNames(BeanMetaData bmd) { + final List nameList = new ArrayList(); + for (int i = 0; i < bmd.getPropertyTypeSize(); ++i) { + final PropertyType pt = bmd.getPropertyType(i); + if (pt.isPersistent()) { + nameList.add(pt.getPropertyName()); + } + } + return nameList.toArray(new String[nameList.size()]); + } + + //========================================================================== + // ========= + // Assert Helper + // ============= + protected void assertStatus(String methodName) { + assertBasicProperty(methodName); + assertComponentProperty(methodName); + if (_entityType == null) { + throw new IllegalStateException(buildAssertMessage("_entityType", + methodName)); + } + if (_entityList == null) { + throw new IllegalStateException(buildAssertMessage("_entityList", + methodName)); + } + } + + //========================================================================== + // ========= + // Accessor + // ======== + public void setEntityType(Class entityType) { + _entityType = entityType; + } + + public void setEntityList(List entityList) { + _entityList = entityList; + } +} Property changes on: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/bhv/core/command/AbstractListEntityCommand.java ___________________________________________________________________ Name: svn:eol-style + native Added: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/bhv/core/command/AbstractOutsideSqlCommand.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/bhv/core/command/AbstractOutsideSqlCommand.java (rev 0) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/bhv/core/command/AbstractOutsideSqlCommand.java 2008-12-27 22:18:30 UTC (rev 1630) @@ -0,0 +1,93 @@ +package jp.sf.pal.scheduler.db.allcommon.bhv.core.command; + +import jp.sf.pal.scheduler.db.allcommon.cbean.ConditionBean; +import jp.sf.pal.scheduler.db.allcommon.cbean.outsidesql.OutsideSqlOption; + +/** + * @author DBFlute(AutoGenerator) + * @param The type of result. + */ +public abstract class AbstractOutsideSqlCommand extends + AbstractBehaviorCommand { + + //========================================================================== + // ========= + // Attribute + // ========= + // ----------------------------------------------------- + // Basic Information + // ----------------- + /** The path of outside-SQL. (Required) */ + protected String _outsideSqlPath; + + /** The parameter-bean. (Required to set, but Nullable) */ + protected Object _parameterBean; + + /** The option of outside-SQL. (Required) */ + protected OutsideSqlOption _outsideSqlOption; + + //========================================================================== + // ========= + // Detail Information + // ================== + public boolean isConditionBean() { + return false; // When the command is for outside-SQL, it always be + // false. + } + + public boolean isOutsideSql() { + return true; + } + + public boolean isSelectCount() { + return false; // When the command is for outside-SQL, it always be + // false. + } + + //========================================================================== + // ========= + // Argument Information + // ==================== + public ConditionBean getConditionBean() { + return null; + } + + public String getOutsideSqlPath() { + return _outsideSqlPath; + } + + public OutsideSqlOption getOutsideSqlOption() { + return _outsideSqlOption; + } + + //========================================================================== + // ========= + // Assert Helper + // ============= + protected void assertOutsideSqlBasic(String methodName) { + if (_outsideSqlPath == null) { + throw new IllegalStateException(buildAssertMessage( + "_outsideSqlPath", methodName)); + } + if (_outsideSqlOption == null) { + throw new IllegalStateException(buildAssertMessage( + "_outsideSqlOption", methodName)); + } + } + + //========================================================================== + // ========= + // Accessor + // ======== + public void setOutsideSqlPath(String outsideSqlPath) { + _outsideSqlPath = outsideSqlPath; + } + + public void setParameterBean(Object parameterBean) { + _parameterBean = parameterBean; + } + + public void setOutsideSqlOption(OutsideSqlOption outsideSqlOption) { + _outsideSqlOption = outsideSqlOption; + } +} Property changes on: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/bhv/core/command/AbstractOutsideSqlCommand.java ___________________________________________________________________ Name: svn:eol-style + native Added: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/bhv/core/command/AbstractOutsideSqlSelectCommand.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/bhv/core/command/AbstractOutsideSqlSelectCommand.java (rev 0) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/bhv/core/command/AbstractOutsideSqlSelectCommand.java 2008-12-27 22:18:30 UTC (rev 1630) @@ -0,0 +1,175 @@ +package jp.sf.pal.scheduler.db.allcommon.bhv.core.command; + +import jp.sf.pal.scheduler.db.allcommon.bhv.core.SqlExecution; +import jp.sf.pal.scheduler.db.allcommon.bhv.core.SqlExecutionCreator; +import jp.sf.pal.scheduler.db.allcommon.bhv.core.execution.OutsideSqlSelectExecution; +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.OutsideSqlOption; + +import org.seasar.extension.jdbc.ResultSetHandler; + +/** + * The abstract command for OutsideSql.selectSomething(). + * + * @author DBFlute(AutoGenerator) + * @param The type of result. + */ +public abstract class AbstractOutsideSqlSelectCommand extends + AbstractOutsideSqlCommand { + + //========================================================================== + // ========= + // Detail Information + // ================== + public boolean isProcedure() { + return false; + } + + public boolean isSelect() { + return true; + } + + //========================================================================== + // ========= + // Process Callback + // ================ + public void beforeGettingSqlExecution() { + assertStatus("beforeGettingSqlExecution"); + final String path = _outsideSqlPath; + final Object pmb = _parameterBean; + final OutsideSqlOption option = _outsideSqlOption; + final Object resultTypeSpecification = getResultTypeSpecification(); + final boolean autoPagingLogging = (option.isAutoPaging() || option + .isSourcePagingRequestTypeAuto()); + final OutsideSqlContext outsideSqlContext = new OutsideSqlContext(); + outsideSqlContext.setOutsideSqlPath(path); + outsideSqlContext.setParameterBean(pmb); + outsideSqlContext.setResultTypeSpecification(resultTypeSpecification); + outsideSqlContext.setMethodName(getCommandName()); + outsideSqlContext.setStatementConfig(option.getStatementConfig()); + outsideSqlContext.setTableDbName(option.getTableDbName()); + outsideSqlContext.setDynamicBinding(option.isDynamicBinding()); + outsideSqlContext.setOffsetByCursorForcedly(option.isAutoPaging()); + outsideSqlContext.setLimitByCursorForcedly(option.isAutoPaging()); + outsideSqlContext.setAutoPagingLogging(autoPagingLogging); // for + // logging + outsideSqlContext.setupBehaviorQueryPathIfNeeds(); + OutsideSqlContext.setOutsideSqlContextOnThread(outsideSqlContext); + + // Set up fetchNarrowingBean. + setupOutsideSqlFetchNarrowingBean(pmb, option); + } + + protected void setupOutsideSqlFetchNarrowingBean(Object pmb, + OutsideSqlOption option) { + if (pmb == null + || !FetchNarrowingBeanContext.isTheTypeFetchNarrowingBean(pmb + .getClass())) { + return; + } + final FetchNarrowingBean fetchNarrowingBean = (FetchNarrowingBean) pmb; + if (option.isManualPaging()) { + fetchNarrowingBean.ignoreFetchNarrowing(); + } + FetchNarrowingBeanContext + .setFetchNarrowingBeanOnThread(fetchNarrowingBean); + } + + public void afterExecuting() { + } + + //========================================================================== + // ========= + // SqlExecution Handling + // ===================== + public String buildSqlExecutionKey() { + assertStatus("buildSqlExecutionKey"); + return generateSpecifiedOutsideSqlUniqueKey(); + } + + protected String generateSpecifiedOutsideSqlUniqueKey() { + final String methodName = getCommandName(); + final String path = _outsideSqlPath; + final Object pmb = _parameterBean; + final OutsideSqlOption option = _outsideSqlOption; + final Object resultTypeSpecification = getResultTypeSpecification(); + return OutsideSqlContext.generateSpecifiedOutsideSqlUniqueKey( + methodName, path, pmb, option, resultTypeSpecification); + } + + public SqlExecutionCreator createSqlExecutionCreator() { + assertStatus("createSqlExecutionCreator"); + return new SqlExecutionCreator() { + public SqlExecution createSqlExecution() { + final OutsideSqlContext outsideSqlContext = OutsideSqlContext + .getOutsideSqlContextOnThread(); + return createOutsideSqlSelectExecution(outsideSqlContext); + } + }; + } + + protected SqlExecution createOutsideSqlSelectExecution( + OutsideSqlContext outsideSqlContext) { + // - - - - - - - - - - - - - - - - - - - - - - - + // The attribute of Specified-OutsideSqlContext. + // - - - - - - - - - - - - - - - - - - - - - - - + final String suffix = buildDbmsSuffix(); + final String sql = outsideSqlContext.readFilteredOutsideSql( + _sqlFileEncoding, suffix); + final Object pmb = outsideSqlContext.getParameterBean(); + + // - - - - - - - - - - - - - - - + // The attribute of SqlCommand. + // - - - - - - - - - - - - - - - + final String[] argNames = (pmb != null ? new String[] { "pmb" } + : new String[] {}); + final Class[] argTypes = (pmb != null ? new Class[] { pmb + .getClass() } : new Class[] {}); + + // - - - - - - - - - - - - - + // Create ResultSetHandler. + // - - - - - - - - - - - - - + final ResultSetHandler handler = createOutsideSqlSelectResultSetHandler(); + + // - - - - - - - - - - - + // Create SqlExecution. + // - - - - - - - - - - - + return createOutsideSqlSelectExecution(handler, argNames, argTypes, sql); + } + + protected OutsideSqlSelectExecution createOutsideSqlSelectExecution( + ResultSetHandler handler, String[] argNames, Class[] argTypes, + String sql) { + final OutsideSqlSelectExecution cmd = new OutsideSqlSelectExecution( + _dataSource, _statementFactory, handler); + cmd.setArgNames(argNames); + cmd.setArgTypes(argTypes); + cmd.setSql(sql); + return cmd; + } + + public Object[] getSqlExecutionArgument() { + assertStatus("getSqlExecutionArgument"); + return new Object[] { _parameterBean }; + } + + //========================================================================== + // ========= + // Extension Point + // =============== + protected abstract ResultSetHandler createOutsideSqlSelectResultSetHandler(); + + protected abstract Object getResultTypeSpecification(); + + //========================================================================== + // ========= + // Assert Helper + // ============= + protected void assertStatus(String methodName) { + assertBasicProperty(methodName); + assertComponentProperty(methodName); + assertOutsideSqlBasic(methodName); + } +} Property changes on: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/bhv/core/command/AbstractOutsideSqlSelectCommand.java ___________________________________________________________________ Name: svn:eol-style + native Added: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/bhv/core/command/AbstractSelectCBCommand.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/bhv/core/command/AbstractSelectCBCommand.java (rev 0) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/bhv/core/command/AbstractSelectCBCommand.java 2008-12-27 22:18:30 UTC (rev 1630) @@ -0,0 +1,122 @@ +package jp.sf.pal.scheduler.db.allcommon.bhv.core.command; + +import jp.sf.pal.scheduler.db.allcommon.bhv.core.SqlExecution; +import jp.sf.pal.scheduler.db.allcommon.bhv.core.execution.SelectCBExecution; +import jp.sf.pal.scheduler.db.allcommon.cbean.ConditionBean; +import jp.sf.pal.scheduler.db.allcommon.cbean.outsidesql.OutsideSqlOption; + +import org.seasar.extension.jdbc.ResultSetHandler; + +/** + * @author DBFlute(AutoGenerator) + * @param The type of result. + */ +public abstract class AbstractSelectCBCommand extends + AbstractBehaviorCommand { + + //========================================================================== + // ========= + // Attribute + // ========= + /** The type of condition-bean. (Derived from conditionBean) */ + protected Class _conditionBeanType; + + /** The instance of condition-bean. (Required) */ + protected ConditionBean _conditionBean; + + //========================================================================== + // ========= + // Detail Information + // ================== + public boolean isConditionBean() { + return true; + } + + public boolean isOutsideSql() { + return false; + } + + public boolean isProcedure() { + return false; + } + + public boolean isSelect() { + return true; + } + + //========================================================================== + // ========= + // SqlExecution Handling + // ===================== + public String buildSqlExecutionKey() { + assertStatus("buildSqlExecutionKey"); + return _tableDbName + ":" + getCommandName() + "(" + + _conditionBeanType.getSimpleName() + ")"; + } + + protected SqlExecution createSelectCBExecution( + Class cbType, ResultSetHandler handler) { + return createSelectCBExecution(handler, new String[] { "dto" }, + new Class[] { cbType }); + } + + protected SelectCBExecution createSelectCBExecution( + ResultSetHandler handler, String[] argNames, Class[] argTypes) { + final SelectCBExecution cmd = new SelectCBExecution(_dataSource, + _statementFactory, handler); + cmd.setArgNames(argNames); + cmd.setArgTypes(argTypes); + return cmd; + } + + public Object[] getSqlExecutionArgument() { + assertStatus("getSqlExecutionArgument"); + return new Object[] { _conditionBean }; + } + + //========================================================================== + // ========= + // Argument Information + // ==================== + public ConditionBean getConditionBean() { + return _conditionBean; + } + + public String getOutsideSqlPath() { + return null; + } + + public OutsideSqlOption getOutsideSqlOption() { + return null; + } + + //========================================================================== + // ========= + // Assert Helper + // ============= + protected void assertStatus(String methodName) { + assertBasicProperty(methodName); + assertComponentProperty(methodName); + if (_conditionBeanType == null) { + throw new IllegalStateException(buildAssertMessage( + "_conditionBeanType", methodName)); + } + if (_conditionBean == null) { + throw new IllegalStateException(buildAssertMessage( + "_conditionBean", methodName)); + } + } + + //========================================================================== + // ========= + // Accessor + // ======== + public void setConditionBeanType( + Class conditionBeanType) { + _conditionBeanType = conditionBeanType; + } + + public void setConditionBean(ConditionBean conditionBean) { + _conditionBean = conditionBean; + } +} Property changes on: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/bhv/core/command/AbstractSelectCBCommand.java ___________________________________________________________________ Name: svn:eol-style + native Added: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/bhv/core/command/BatchDeleteEntityCommand.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/bhv/core/command/BatchDeleteEntityCommand.java (rev 0) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/bhv/core/command/BatchDeleteEntityCommand.java 2008-12-27 22:18:30 UTC (rev 1630) @@ -0,0 +1,51 @@ +package jp.sf.pal.scheduler.db.allcommon.bhv.core.command; + +import jp.sf.pal.scheduler.db.allcommon.bhv.core.SqlExecution; +import jp.sf.pal.scheduler.db.allcommon.bhv.core.SqlExecutionCreator; +import jp.sf.pal.scheduler.db.allcommon.s2dao.internal.sqlcommand.InternalDeleteBatchAutoStaticCommand; + +import org.seasar.dao.BeanMetaData; + +/** + * @author DBFlute(AutoGenerator) + */ +public class BatchDeleteEntityCommand extends AbstractListEntityCommand { + + //========================================================================== + // ========= + // Basic Information + // ================= + public String getCommandName() { + return "batchDelete"; + } + + //========================================================================== + // ========= + // SqlExecution Handling + // ===================== + public SqlExecutionCreator createSqlExecutionCreator() { + assertStatus("createSqlExecutionCreator"); + return new SqlExecutionCreator() { + public SqlExecution createSqlExecution() { + final BeanMetaData bmd = createBeanMetaData(); + return createBatchDeleteEntitySqlExecution(bmd); + } + }; + } + + protected SqlExecution createBatchDeleteEntitySqlExecution(BeanMetaData bmd) { + final String[] propertyNames = getPersistentPropertyNames(bmd); + return createDeleteBatchAutoStaticCommand(bmd, propertyNames); + } + + protected InternalDeleteBatchAutoStaticCommand createDeleteBatchAutoStaticCommand( + BeanMetaData bmd, String[] propertyNames) { + boolean opt = isOptimisticLockHandling(); + return new InternalDeleteBatchAutoStaticCommand(_dataSource, + _statementFactory, bmd, propertyNames, opt); + } + + protected boolean isOptimisticLockHandling() { + return true; + } +} Property changes on: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/bhv/core/command/BatchDeleteEntityCommand.java ___________________________________________________________________ Name: svn:eol-style + native Added: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/bhv/core/command/BatchDeleteNonstrictEntityCommand.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/bhv/core/command/BatchDeleteNonstrictEntityCommand.java (rev 0) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/bhv/core/command/BatchDeleteNonstrictEntityCommand.java 2008-12-27 22:18:30 UTC (rev 1630) @@ -0,0 +1,25 @@ +package jp.sf.pal.scheduler.db.allcommon.bhv.core.command; + +/** + * @author DBFlute(AutoGenerator) + */ +public class BatchDeleteNonstrictEntityCommand extends BatchDeleteEntityCommand { + + //========================================================================== + // ========= + // Basic Information + // ================= + @Override + public String getCommandName() { + return "batchDeleteNonstrict"; + } + + //========================================================================== + // ========= + // SqlExecution Handling + // ===================== + @Override + protected boolean isOptimisticLockHandling() { + return false; + } +} Property changes on: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/bhv/core/command/BatchDeleteNonstrictEntityCommand.java ___________________________________________________________________ Name: svn:eol-style + native Added: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/bhv/core/command/BatchInsertEntityCommand.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/bhv/core/command/BatchInsertEntityCommand.java (rev 0) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/bhv/core/command/BatchInsertEntityCommand.java 2008-12-27 22:18:30 UTC (rev 1630) @@ -0,0 +1,46 @@ +package jp.sf.pal.scheduler.db.allcommon.bhv.core.command; + +import jp.sf.pal.scheduler.db.allcommon.bhv.core.SqlExecution; +import jp.sf.pal.scheduler.db.allcommon.bhv.core.SqlExecutionCreator; +import jp.sf.pal.scheduler.db.allcommon.s2dao.internal.sqlcommand.InternalInsertBatchAutoStaticCommand; + +import org.seasar.dao.BeanMetaData; + +/** + * @author DBFlute(AutoGenerator) + */ +public class BatchInsertEntityCommand extends AbstractListEntityCommand { + + //========================================================================== + // ========= + // Basic Information + // ================= + public String getCommandName() { + return "batchInsert"; + } + + //========================================================================== + // ========= + // SqlExecution Handling + // ===================== + public SqlExecutionCreator createSqlExecutionCreator() { + assertStatus("createSqlExecutionCreator"); + return new SqlExecutionCreator() { + public SqlExecution createSqlExecution() { + final BeanMetaData bmd = createBeanMetaData(); + return createBatchInsertEntitySqlExecution(bmd); + } + }; + } + + protected SqlExecution createBatchInsertEntitySqlExecution(BeanMetaData bmd) { + final String[] propertyNames = getPersistentPropertyNames(bmd); + return createInsertBatchAutoStaticCommand(bmd, propertyNames); + } + + protected InternalInsertBatchAutoStaticCommand createInsertBatchAutoStaticCommand( + BeanMetaData bmd, String[] propertyNames) { + return new InternalInsertBatchAutoStaticCommand(_dataSource, + _statementFactory, bmd, propertyNames); + } +} Property changes on: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/bhv/core/command/BatchInsertEntityCommand.java ___________________________________________________________________ Name: svn:eol-style + native Added: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/bhv/core/command/BatchUpdateEntityCommand.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/bhv/core/command/BatchUpdateEntityCommand.java (rev 0) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/bhv/core/command/BatchUpdateEntityCommand.java 2008-12-27 22:18:30 UTC (rev 1630) @@ -0,0 +1,51 @@ +package jp.sf.pal.scheduler.db.allcommon.bhv.core.command; + +import jp.sf.pal.scheduler.db.allcommon.bhv.core.SqlExecution; +import jp.sf.pal.scheduler.db.allcommon.bhv.core.SqlExecutionCreator; +import jp.sf.pal.scheduler.db.allcommon.s2dao.internal.sqlcommand.InternalUpdateBatchAutoStaticCommand; + +import org.seasar.dao.BeanMetaData; + +/** + * @author DBFlute(AutoGenerator) + */ +public class BatchUpdateEntityCommand extends AbstractListEntityCommand { + + //========================================================================== + // ========= + // Basic Information + // ================= + public String getCommandName() { + return "batchUpdate"; + } + + //========================================================================== + // ========= + // SqlExecution Handling + // ===================== + public SqlExecutionCreator createSqlExecutionCreator() { + assertStatus("createSqlExecutionCreator"); + return new SqlExecutionCreator() { + public SqlExecution createSqlExecution() { + final BeanMetaData bmd = createBeanMetaData(); + return createBatchUpdateEntitySqlExecution(bmd); + } + }; + } + + protected SqlExecution createBatchUpdateEntitySqlExecution(BeanMetaData bmd) { + final String[] propertyNames = getPersistentPropertyNames(bmd); + return createUpdateBatchAutoStaticCommand(bmd, propertyNames); + } + + protected InternalUpdateBatchAutoStaticCommand createUpdateBatchAutoStaticCommand( + BeanMetaData bmd, String[] propertyNames) { + boolean opt = isOptimisticLockHandling(); + return new InternalUpdateBatchAutoStaticCommand(_dataSource, + _statementFactory, bmd, propertyNames, opt, opt); + } + + protected boolean isOptimisticLockHandling() { + return true; + } +} Property changes on: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/bhv/core/command/BatchUpdateEntityCommand.java ___________________________________________________________________ Name: svn:eol-style + native Added: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/bhv/core/command/BatchUpdateNonstrictEntityCommand.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/bhv/core/command/BatchUpdateNonstrictEntityCommand.java (rev 0) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/bhv/core/command/BatchUpdateNonstrictEntityCommand.java 2008-12-27 22:18:30 UTC (rev 1630) @@ -0,0 +1,25 @@ +package jp.sf.pal.scheduler.db.allcommon.bhv.core.command; + +/** + * @author DBFlute(AutoGenerator) + */ +public class BatchUpdateNonstrictEntityCommand extends BatchUpdateEntityCommand { + + //========================================================================== + // ========= + // Basic Information + // ================= + @Override + public String getCommandName() { + return "batchUpdateNonstrict"; + } + + //========================================================================== + // ========= + // SqlExecution Handling + // ===================== + @Override + protected boolean isOptimisticLockHandling() { + return false; + } +} Property changes on: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/bhv/core/command/BatchUpdateNonstrictEntityCommand.java ___________________________________________________________________ Name: svn:eol-style + native Added: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/bhv/core/command/DeleteEntityCommand.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/bhv/core/command/DeleteEntityCommand.java (rev 0) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/bhv/core/command/DeleteEntityCommand.java 2008-12-27 22:18:30 UTC (rev 1630) @@ -0,0 +1,51 @@ +package jp.sf.pal.scheduler.db.allcommon.bhv.core.command; + +import jp.sf.pal.scheduler.db.allcommon.bhv.core.SqlExecution; +import jp.sf.pal.scheduler.db.allcommon.bhv.core.SqlExecutionCreator; +import jp.sf.pal.scheduler.db.allcommon.s2dao.internal.sqlcommand.InternalDeleteAutoStaticCommand; + +import org.seasar.dao.BeanMetaData; + +/** + * @author DBFlute(AutoGenerator) + */ +public class DeleteEntityCommand extends AbstractEntityCommand { + + //========================================================================== + // ========= + // Basic Information + // ================= + public String getCommandName() { + return "delete"; + } + + //========================================================================== + // ========= + // SqlExecution Handling + // ===================== + public SqlExecutionCreator createSqlExecutionCreator() { + assertStatus("createSqlExecutionCreator"); + return new SqlExecutionCreator() { + public SqlExecution createSqlExecution() { + final BeanMetaData bmd = createBeanMetaData(); + return createDeleteEntitySqlExecution(bmd); + } + }; + } + + protected SqlExecution createDeleteEntitySqlExecution(BeanMetaData bmd) { + final String[] propertyNames = getPersistentPropertyNames(bmd); + return createDeleteAutoStaticCommand(bmd, propertyNames); + } + + protected InternalDeleteAutoStaticCommand createDeleteAutoStaticCommand( + BeanMetaData bmd, String[] propertyNames) { + return new InternalDeleteAutoStaticCommand(_dataSource, + _statementFactory, bmd, propertyNames, + isOptimisticLockHandling()); + } + + protected boolean isOptimisticLockHandling() { + return true; + } +} Property changes on: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/bhv/core/command/DeleteEntityCommand.java ___________________________________________________________________ Name: svn:eol-style + native Added: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/bhv/core/command/DeleteNonstrictEntityCommand.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/bhv/core/command/DeleteNonstrictEntityCommand.java (rev 0) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/bhv/core/command/DeleteNonstrictEntityCommand.java 2008-12-27 22:18:30 UTC (rev 1630) @@ -0,0 +1,25 @@ +package jp.sf.pal.scheduler.db.allcommon.bhv.core.command; + +/** + * @author DBFlute(AutoGenerator) + */ +public class DeleteNonstrictEntityCommand extends DeleteEntityCommand { + + //========================================================================== + // ========= + // Basic Information + // ================= + @Override + public String getCommandName() { + return "deleteNonstrict"; + } + + //========================================================================== + // ========= + // SqlExecution Handling + // ===================== + @Override + protected boolean isOptimisticLockHandling() { + return false; + } +} Property changes on: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/bhv/core/command/DeleteNonstrictEntityCommand.java ___________________________________________________________________ Name: svn:eol-style + native Added: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/bhv/core/command/InsertEntityCommand.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/bhv/core/command/InsertEntityCommand.java (rev 0) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/bhv/core/command/InsertEntityCommand.java 2008-12-27 22:18:30 UTC (rev 1630) @@ -0,0 +1,86 @@ +package jp.sf.pal.scheduler.db.allcommon.bhv.core.command; + +import java.util.List; + +import jp.sf.pal.scheduler.db.allcommon.bhv.core.SqlExecution; +import jp.sf.pal.scheduler.db.allcommon.bhv.core.SqlExecutionCreator; +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.s2dao.internal.sqlcommand.InternalInsertAutoDynamicCommand; + +import org.seasar.dao.BeanMetaData; + +/** + * @author DBFlute(AutoGenerator) + */ +public class InsertEntityCommand extends AbstractEntityCommand { + + //========================================================================== + // ========= + // Basic Information + // ================= + public String getCommandName() { + return "insert"; + } + + //========================================================================== + // ========= + // SqlExecution Handling + // ===================== + public SqlExecutionCreator createSqlExecutionCreator() { + assertStatus("createSqlExecutionCreator"); + return new SqlExecutionCreator() { + public SqlExecution createSqlExecution() { + final BeanMetaData bmd = createBeanMetaData(); + return createInsertEntitySqlExecution(bmd); + } + }; + } + + protected SqlExecution createInsertEntitySqlExecution(BeanMetaData bmd) { + final SqlExecution nonPrimaryKeySqlExecution = createNonPrimaryInsertSqlExecution(bmd); + if (nonPrimaryKeySqlExecution != null) { + return nonPrimaryKeySqlExecution; + } + final String[] propertyNames = getPersistentPropertyNames(bmd); + return createInsertAutoDynamicCommand(bmd, propertyNames); + } + + protected InternalInsertAutoDynamicCommand createInsertAutoDynamicCommand( + BeanMetaData bmd, String[] propertyNames) { + final InternalInsertAutoDynamicCommand cmd = new InternalInsertAutoDynamicCommand(); + cmd.setBeanMetaData(bmd); + cmd.setDataSource(_dataSource); + cmd.setPropertyNames(propertyNames); + cmd.setStatementFactory(_statementFactory); + return cmd; + } + + /** + * @param bmd The meta data of bean. (NotNull) + * @return Whether the method is target. (For example if it has primary key, + * returns false.) + */ + protected SqlExecution createNonPrimaryInsertSqlExecution(BeanMetaData bmd) { + final DBMeta dbmeta = findDBMeta(); + if (dbmeta.hasPrimaryKey()) { + return null; + } + final List columnInfoList = dbmeta.getColumnInfoList(); + final StringBuilder columnDefSb = new StringBuilder(); + for (jp.sf.pal.scheduler.db.allcommon.dbmeta.info.ColumnInfo columnInfo : columnInfoList) { + columnDefSb.append(", ").append(columnInfo.getColumnDbName()); + } + columnDefSb.delete(0, ", ".length()).insert(0, "(").append(")"); + final StringBuilder columnValuesSb = new StringBuilder(); + for (jp.sf.pal.scheduler.db.allcommon.dbmeta.info.ColumnInfo columnInfo : columnInfoList) { + columnValuesSb.append(", /*dto.").append( + columnInfo.getPropertyName()).append("*/null"); + } + columnValuesSb.delete(0, ", ".length()).insert(0, "(").append(")"); + final String sql = "insert into " + dbmeta.getTableSqlName() + + columnDefSb + " values" + columnValuesSb; + return createUpdateDynamicCommand(new String[] { "dto" }, + new Class[] { _entityType }, sql); + } +} Property changes on: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/bhv/core/command/InsertEntityCommand.java ___________________________________________________________________ Name: svn:eol-style + native Added: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/bhv/core/command/OutsideSqlCallCommand.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/bhv/core/command/OutsideSqlCallCommand.java (rev 0) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/bhv/core/command/OutsideSqlCallCommand.java 2008-12-27 22:18:30 UTC (rev 1630) @@ -0,0 +1,152 @@ +package jp.sf.pal.scheduler.db.allcommon.bhv.core.command; + +import jp.sf.pal.scheduler.db.allcommon.bhv.core.SqlExecution; +import jp.sf.pal.scheduler.db.allcommon.bhv.core.SqlExecutionCreator; +import jp.sf.pal.scheduler.db.allcommon.cbean.outsidesql.OutsideSqlContext; +import jp.sf.pal.scheduler.db.allcommon.cbean.outsidesql.OutsideSqlOption; +import jp.sf.pal.scheduler.db.allcommon.s2dao.internal.sqlcommand.InternalProcedureCommand; +import jp.sf.pal.scheduler.db.allcommon.s2dao.internal.various.InternalProcedureMetaData; +import jp.sf.pal.scheduler.db.allcommon.s2dao.internal.various.InternalProcedureMetaDataFactory; + +import org.seasar.extension.jdbc.ResultSetHandler; + +/** + * The behavior command for OutsideSql.execute(). + * + * @author DBFlute(AutoGenerator) + */ +public class OutsideSqlCallCommand extends AbstractOutsideSqlCommand { + + //========================================================================== + // ========= + // Basic Information + // ================= + public String getCommandName() { + return "call"; + } + + public Class getCommandReturnType() { + return void.class; + } + + //========================================================================== + // ========= + // Detail Information + // ================== + public boolean isProcedure() { + return true; + } + + public boolean isSelect() { + return false; + } + + //========================================================================== + // ========= + // Process Callback + // ================ + public void beforeGettingSqlExecution() { + assertStatus("beforeGettingSqlExecution"); + final String path = _outsideSqlPath; + final Object pmb = _parameterBean; + final OutsideSqlOption option = _outsideSqlOption; + final OutsideSqlContext outsideSqlContext = new OutsideSqlContext(); + outsideSqlContext.setDynamicBinding(option.isDynamicBinding()); + outsideSqlContext.setOffsetByCursorForcedly(option.isAutoPaging()); + outsideSqlContext.setLimitByCursorForcedly(option.isAutoPaging()); + outsideSqlContext.setOutsideSqlPath(path); + outsideSqlContext.setParameterBean(pmb); + outsideSqlContext.setMethodName(getCommandName()); + outsideSqlContext.setStatementConfig(option.getStatementConfig()); + outsideSqlContext.setTableDbName(option.getTableDbName()); + outsideSqlContext.setupBehaviorQueryPathIfNeeds(); + OutsideSqlContext.setOutsideSqlContextOnThread(outsideSqlContext); + } + + public void afterExecuting() { + } + + //========================================================================== + // ========= + // SqlExecution Handling + // ===================== + public String buildSqlExecutionKey() { + assertStatus("buildSqlExecutionKey"); + return generateSpecifiedOutsideSqlUniqueKey(); + } + + protected String generateSpecifiedOutsideSqlUniqueKey() { + final String methodName = getCommandName(); + final String path = _outsideSqlPath; + final Object pmb = _parameterBean; + final OutsideSqlOption option = _outsideSqlOption; + return OutsideSqlContext.generateSpecifiedOutsideSqlUniqueKey( + methodName, path, pmb, option, null); + } + + public SqlExecutionCreator createSqlExecutionCreator() { + assertStatus("createSqlExecutionCreator"); + return new SqlExecutionCreator() { + public SqlExecution createSqlExecution() { + final OutsideSqlContext outsideSqlContext = OutsideSqlContext + .getOutsideSqlContextOnThread(); + return createOutsideSqlCallCommand(outsideSqlContext); + } + }; + } + + protected SqlExecution createOutsideSqlCallCommand( + OutsideSqlContext outsideSqlContext) { + // - - - - - - - - - - - - - - - - - - - - - - - + // The attribute of Specified-OutsideSqlContext. + // - - - - - - - - - - - - - - - - - - - - - - - + final Object pmb = outsideSqlContext.getParameterBean(); + final String procedureName = outsideSqlContext.getOutsideSqlPath(); + + // - - - - - - - - - - - - - - - + // The attribute of SqlCommand. + // - - - - - - - - - - - - - - - + final InternalProcedureMetaDataFactory factory = createProcedureMetaDataFactory(); + factory.setValueTypeFactory(_valueTypeFactory); + final Class pmbType = (pmb != null ? pmb.getClass() : null); + final InternalProcedureMetaData metaData = factory + .createProcedureMetaData(procedureName, pmbType); + return createProcedureCommand(metaData); + } + + protected InternalProcedureMetaDataFactory createProcedureMetaDataFactory() { + return new InternalProcedureMetaDataFactory(); + } + + protected InternalProcedureCommand createProcedureCommand( + InternalProcedureMetaData metaData) { + // Because a procedure command does not use result set handler. + final ResultSetHandler resultSetHandler = new InternalNullResultSetHandler(); + return new InternalProcedureCommand(_dataSource, resultSetHandler, + _statementFactory, metaData); + } + + // /- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + // - - + // InternalProcedureCommand switches argument so this is unnecessary + // actually! + // - - - - - - - - - -/ + public Object[] getSqlExecutionArgument() { + return new Object[] { _parameterBean }; + } + + //========================================================================== + // ========= + // Assert Helper + // ============= + protected void assertStatus(String methodName) { + assertBasicProperty(methodName); + assertComponentProperty(methodName); + assertOutsideSqlBasic(methodName); + if (_parameterBean == null) { + String msg = "The property 'parameterBean' should not be null"; + msg = msg + " when you call " + methodName + "()."; + throw new IllegalStateException(msg); + } + } +} Property changes on: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/bhv/core/command/OutsideSqlCallCommand.java ___________________________________________________________________ Name: svn:eol-style + native Added: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/bhv/core/command/OutsideSqlExecuteCommand.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/bhv/core/command/OutsideSqlExecuteCommand.java (rev 0) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/bhv/core/command/OutsideSqlExecuteCommand.java 2008-12-27 22:18:30 UTC (rev 1630) @@ -0,0 +1,128 @@ +package jp.sf.pal.scheduler.db.allcommon.bhv.core.command; + +import jp.sf.pal.scheduler.db.allcommon.bhv.core.SqlExecution; +import jp.sf.pal.scheduler.db.allcommon.bhv.core.SqlExecutionCreator; +import jp.sf.pal.scheduler.db.allcommon.cbean.outsidesql.OutsideSqlContext; +import jp.sf.pal.scheduler.db.allcommon.cbean.outsidesql.OutsideSqlOption; + +/** + * The behavior command for OutsideSql.execute(). + * + * @author DBFlute(AutoGenerator) + */ +public class OutsideSqlExecuteCommand extends + AbstractOutsideSqlCommand { + + //========================================================================== + // ========= + // Basic Information + // ================= + public String getCommandName() { + return "execute"; + } + + public Class getCommandReturnType() { + return Integer.class; + } + + //========================================================================== + // ========= + // Detail Information + // ================== + public boolean isProcedure() { + return false; + } + + public boolean isSelect() { + return false; + } + + //========================================================================== + // ========= + // Process Callback + // ================ + public void beforeGettingSqlExecution() { + assertStatus("beforeGettingSqlExecution"); + final String path = _outsideSqlPath; + final Object pmb = _parameterBean; + final OutsideSqlOption option = _outsideSqlOption; + final OutsideSqlContext outsideSqlContext = new OutsideSqlContext(); + outsideSqlContext.setDynamicBinding(option.isDynamicBinding()); + outsideSqlContext.setOffsetByCursorForcedly(option.isAutoPaging()); + outsideSqlContext.setLimitByCursorForcedly(option.isAutoPaging()); + outsideSqlContext.setOutsideSqlPath(path); + outsideSqlContext.setParameterBean(pmb); + outsideSqlContext.setMethodName(getCommandName()); + outsideSqlContext.setStatementConfig(option.getStatementConfig()); + outsideSqlContext.setTableDbName(option.getTableDbName()); + outsideSqlContext.setupBehaviorQueryPathIfNeeds(); + OutsideSqlContext.setOutsideSqlContextOnThread(outsideSqlContext); + } + + public void afterExecuting() { + } + + //========================================================================== + // ========= + // SqlExecution Handling + // ===================== + public String buildSqlExecutionKey() { + assertStatus("buildSqlExecutionKey"); + return generateSpecifiedOutsideSqlUniqueKey(); + } + + protected String generateSpecifiedOutsideSqlUniqueKey() { + final String methodName = getCommandName(); + final String path = _outsideSqlPath; + final Object pmb = _parameterBean; + final OutsideSqlOption option = _outsideSqlOption; + return OutsideSqlContext.generateSpecifiedOutsideSqlUniqueKey( + methodName, path, pmb, option, null); + } + + public SqlExecutionCreator createSqlExecutionCreator() { + assertStatus("createSqlExecutionCreator"); + return new SqlExecutionCreator() { + public SqlExecution createSqlExecution() { + final OutsideSqlContext outsideSqlContext = OutsideSqlContext + .getOutsideSqlContextOnThread(); + return createOutsideSqlExecuteExecution(outsideSqlContext); + } + }; + } + + protected SqlExecution createOutsideSqlExecuteExecution( + OutsideSqlContext outsideSqlContext) { + // - - - - - - - - - - - - - - - - - - - - - - - + // The attribute of Specified-OutsideSqlContext. + // - - - - - - - - - - - - - - - - - - - - - - - + final String suffix = buildDbmsSuffix(); + final String sql = outsideSqlContext.readFilteredOutsideSql( + _sqlFileEncoding, suffix); + final Object pmb = outsideSqlContext.getParameterBean(); + + // - - - - - - - - - - - - - - - + // The attribute of SqlCommand. + // - - - - - - - - - - - - - - - + final String[] argNames = (pmb != null ? new String[] { "pmb" } + : new String[] {}); + final Class[] argTypes = (pmb != null ? new Class[] { pmb + .getClass() } : new Class[] {}); + + return createUpdateDynamicCommand(argNames, argTypes, sql); + } + + public Object[] getSqlExecutionArgument() { + return new Object[] { _parameterBean }; + } + + //========================================================================== + // ========= + // Assert Helper + // ============= + protected void assertStatus(String methodName) { + assertBasicProperty(methodName); + assertComponentProperty(methodName); + assertOutsideSqlBasic(methodName); + } +} Property changes on: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/bhv/core/command/OutsideSqlExecuteCommand.java ___________________________________________________________________ Name: svn:eol-style + native Added: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/bhv/core/command/OutsideSqlSelectCursorCommand.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/bhv/core/command/OutsideSqlSelectCursorCommand.java (rev 0) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/bhv/core/command/OutsideSqlSelectCursorCommand.java 2008-12-27 22:18:30 UTC (rev 1630) @@ -0,0 +1,77 @@ +package jp.sf.pal.scheduler.db.allcommon.bhv.core.command; + +import java.sql.ResultSet; +import java.sql.SQLException; + +import jp.sf.pal.scheduler.db.allcommon.jdbc.CursorHandler; + +import org.seasar.extension.jdbc.ResultSetHandler; + +/** + * The behavior command for OutsideSql.selectList(). + * + * @author DBFlute(AutoGenerator) + */ +public class OutsideSqlSelectCursorCommand extends + AbstractOutsideSqlSelectCommand { + + //========================================================================== + // ========= + // Attribute + // ========= + /** The handler of cursor. (Required) */ + protected CursorHandler _cursorHandler; + + //========================================================================== + // ========= + // Basic Information + // ================= + public String getCommandName() { + return "selectCursor"; + } + + public Class getCommandReturnType() { + return Object.class; + } + + //========================================================================== + // ========= + // Extension Point + // =============== + @Override + protected ResultSetHandler createOutsideSqlSelectResultSetHandler() { + return new ResultSetHandler() { + public Object handle(ResultSet rs) throws SQLException { + return _cursorHandler.handle(rs); + } + }; + } + + @Override + protected Object getResultTypeSpecification() { + return _cursorHandler; + } + + //========================================================================== + // ========= + // Assert Helper + // ============= + @Override + protected void assertStatus(String methodName) { + assertBasicProperty(methodName); + assertComponentProperty(methodName); + assertOutsideSqlBasic(methodName); + if (_cursorHandler == null) { + throw new IllegalStateException(buildAssertMessage( + "_cursorHandler", methodName)); + } + } + + //========================================================================== + // ========= + // Accessor + // ======== + public void setCursorHandler(CursorHandler cursorHandler) { + _cursorHandler = cursorHandler; + } +} Property changes on: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/bhv/core/command/OutsideSqlSelectCursorCommand.java ___________________________________________________________________ Name: svn:eol-style + native Added: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/bhv/core/command/OutsideSqlSelectListCommand.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/bhv/core/command/OutsideSqlSelectListCommand.java (rev 0) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/bhv/core/command/OutsideSqlSelectListCommand.java 2008-12-27 22:18:30 UTC (rev 1630) @@ -0,0 +1,96 @@ +package jp.sf.pal.scheduler.db.allcommon.bhv.core.command; + +import java.util.List; + +import org.seasar.dao.BeanMetaData; +import org.seasar.extension.jdbc.ResultSetHandler; +import org.seasar.extension.jdbc.ValueType; +import org.seasar.extension.jdbc.types.ValueTypes; + +/** + * The behavior command for OutsideSql.selectList(). + * + * @author DBFlute(AutoGenerator) + * @param The type of entity. + */ +public class OutsideSqlSelectListCommand extends + AbstractOutsideSqlSelectCommand> { + + //========================================================================== + // ========= + // Attribute + // ========= + /** The type of entity. (Required) */ + protected Class _entityType; + + //========================================================================== + // ========= + // Basic Information + // ================= + public String getCommandName() { + return "selectList"; + } + + public Class getCommandReturnType() { + return List.class; + } + + //========================================================================== + // ========= + // Factory + // ======= + // ----------------------------------------------------- + // BeanMetaData + // ------------ + protected BeanMetaData createBeanMetaData() { + assertEntityType("createBeanMetaData"); + return _beanMetaDataFactory.createBeanMetaData(_entityType); + } + + // ----------------------------------------------------- + // ResultSetHandler + // ---------------- + protected ResultSetHandler createOutsideSqlBeanListResultSetHandler( + BeanMetaData bmd) { + final ValueType valueType = ValueTypes.getValueType(_entityType); + if (valueType == null || !valueType.equals(ValueTypes.OBJECT)) { + return createObjectListResultSetHandler(valueType); + } + return createBeanListMetaDataResultSetHandler(bmd); + } + + //========================================================================== + // ========= + // Extension Point + // =============== + @Override + protected ResultSetHandler createOutsideSqlSelectResultSetHandler() { + final BeanMetaData bmd = createBeanMetaData(); + final ResultSetHandler handler = createOutsideSqlBeanListResultSetHandler(bmd); + return handler; + } + + @Override + protected Object getResultTypeSpecification() { + return _entityType; + } + + //========================================================================== + // ========= + // Assert Helper + // ============= + protected void assertEntityType(String methodName) { + if (_entityType == null) { + throw new IllegalStateException(buildAssertMessage("_entityType", + methodName)); + } + } + + //========================================================================== + // ========= + // Accessor + // ======== + public void setEntityType(Class entityType) { + _entityType = entityType; + } +} Property changes on: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/bhv/core/command/OutsideSqlSelectListCommand.java ___________________________________________________________________ Name: svn:eol-style + native Added: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/bhv/core/command/QueryDeleteCBCommand.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/bhv/core/command/QueryDeleteCBCommand.java (rev 0) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/bhv/core/command/QueryDeleteCBCommand.java 2008-12-27 22:18:30 UTC (rev 1630) @@ -0,0 +1,151 @@ +package jp.sf.pal.scheduler.db.allcommon.bhv.core.command; + +import jp.sf.pal.scheduler.db.allcommon.bhv.core.SqlExecution; +import jp.sf.pal.scheduler.db.allcommon.bhv.core.SqlExecutionCreator; +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.FetchNarrowingBeanContext; +import jp.sf.pal.scheduler.db.allcommon.cbean.outsidesql.OutsideSqlOption; +import jp.sf.pal.scheduler.db.allcommon.s2dao.internal.sqlcommand.InternalDeleteQueryAutoDynamicCommand; + +/** + * @author DBFlute(AutoGenerator) + */ +public class QueryDeleteCBCommand extends AbstractBehaviorCommand { + + //========================================================================== + // ========= + // Attribute + // ========= + /** The type of condition-bean. (Derived from conditionBean) */ + protected Class _conditionBeanType; + + /** The instance of condition-bean. (Required) */ + protected ConditionBean _conditionBean; + + //========================================================================== + // ========= + // Basic Information + // ================= + public String getCommandName() { + return "queryDelete"; + } + + public Class getCommandReturnType() { + return int.class; + } + + //========================================================================== + // ========= + // Detail Information + // ================== + public boolean isConditionBean() { + return true; + } + + public boolean isOutsideSql() { + return false; + } + + public boolean isProcedure() { + return false; + } + + public boolean isSelect() { + return false; + } + + public boolean isSelectCount() { + return false; + } + + //========================================================================== + // ========= + // Process Callback + // ================ + public void beforeGettingSqlExecution() { + assertStatus("beforeGettingSqlExecution"); + final ConditionBean cb = _conditionBean; + FetchNarrowingBeanContext.setFetchNarrowingBeanOnThread(cb); + ConditionBeanContext.setConditionBeanOnThread(cb); + } + + public void afterExecuting() { + } + + //========================================================================== + // ========= + // SqlExecution Handling + // ===================== + public String buildSqlExecutionKey() { + assertStatus("buildSqlExecutionKey"); + return _tableDbName + ":" + getCommandName() + "(" + + _conditionBeanType.getSimpleName() + ")"; + } + + public SqlExecutionCreator createSqlExecutionCreator() { + assertStatus("createSqlExecutionCreator"); + return new SqlExecutionCreator() { + public SqlExecution createSqlExecution() { + return createQueryDeleteCBExecution(_conditionBeanType); + } + }; + } + + protected SqlExecution createQueryDeleteCBExecution( + Class cbType) { + return new InternalDeleteQueryAutoDynamicCommand(_dataSource, + _statementFactory); + } + + public Object[] getSqlExecutionArgument() { + assertStatus("getSqlExecutionArgument"); + return new Object[] { _conditionBean }; + } + + //========================================================================== + // ========= + // Argument Information + // ==================== + public ConditionBean getConditionBean() { + return _conditionBean; + } + + public String getOutsideSqlPath() { + return null; + } + + public OutsideSqlOption getOutsideSqlOption() { + return null; + } + + //========================================================================== + // ========= + // Assert Helper + // ============= + protected void assertStatus(String methodName) { + assertBasicProperty(methodName); + assertComponentProperty(methodName); + if (_conditionBeanType == null) { + throw new IllegalStateException(buildAssertMessage( + "_conditionBeanType", methodName)); + } + if (_conditionBean == null) { + throw new IllegalStateException(buildAssertMessage( + "_conditionBean", methodName)); + } + } + + //========================================================================== + // ========= + // Accessor + // ======== + public void setConditionBeanType( + Class conditionBeanType) { + _conditionBeanType = conditionBeanType; + } + + public void setConditionBean(ConditionBean conditionBean) { + _conditionBean = conditionBean; + } +} Property changes on: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/bhv/core/command/QueryDeleteCBCommand.java ___________________________________________________________________ Name: svn:eol-style + native Added: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/bhv/core/command/QueryUpdateEntityCBCommand.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/bhv/core/command/QueryUpdateEntityCBCommand.java (rev 0) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/bhv/core/command/QueryUpdateEntityCBCommand.java 2008-12-27 22:18:30 UTC (rev 1630) @@ -0,0 +1,140 @@ +package jp.sf.pal.scheduler.db.allcommon.bhv.core.command; + +import jp.sf.pal.scheduler.db.allcommon.bhv.core.SqlExecution; +import jp.sf.pal.scheduler.db.allcommon.bhv.core.SqlExecutionCreator; +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.FetchNarrowingBeanContext; +import jp.sf.pal.scheduler.db.allcommon.cbean.outsidesql.OutsideSqlOption; +import jp.sf.pal.scheduler.db.allcommon.s2dao.internal.sqlcommand.InternalUpdateQueryAutoDynamicCommand; + +/** + * @author DBFlute(AutoGenerator) + */ +public class QueryUpdateEntityCBCommand extends AbstractEntityCommand { + + //========================================================================== + // ========= + // Attribute + // ========= + /** The type of condition-bean. (Derived from conditionBean) */ + protected Class _conditionBeanType; + + /** The instance of condition-bean. (Required) */ + protected ConditionBean _conditionBean; + + //========================================================================== + // ========= + // Basic Information + // ================= + public String getCommandName() { + return "queryUpdate"; + } + + //========================================================================== + // ========= + // Detail Information + // ================== + @Override + public boolean isConditionBean() { + return true; + } + + //========================================================================== + // ========= + // Process Callback + // ================ + @Override + public void beforeGettingSqlExecution() { + assertStatus("beforeGettingSqlExecution"); + final ConditionBean cb = _conditionBean; + FetchNarrowingBeanContext.setFetchNarrowingBeanOnThread(cb); + ConditionBeanContext.setConditionBeanOnThread(cb); + } + + //========================================================================== + // ========= + // SqlExecution Handling + // ===================== + public String buildSqlExecutionKey() { + assertStatus("buildSqlExecutionKey"); + return _tableDbName + ":" + getCommandName() + "(" + + _entityType.getSimpleName() + ", " + + _conditionBeanType.getSimpleName() + ")"; + } + + public SqlExecutionCreator createSqlExecutionCreator() { + assertStatus("createSqlExecutionCreator"); + return new SqlExecutionCreator() { + public SqlExecution createSqlExecution() { + return createQueryUpdateEntityCBExecution(_conditionBeanType); + } + }; + } + + protected SqlExecution createQueryUpdateEntityCBExecution( + Class cbType) { + return new InternalUpdateQueryAutoDynamicCommand(_dataSource, + _statementFactory); + } + + public Object[] getSqlExecutionArgument() { + assertStatus("getSqlExecutionArgument"); + return new Object[] { _conditionBean, _entity }; + } + + //========================================================================== + // ========= + // Argument Information + // ==================== + public ConditionBean getConditionBean() { + return _conditionBean; + } + + public String getOutsideSqlPath() { + return null; + } + + public OutsideSqlOption getOutsideSqlOption() { + return null; + } + + //========================================================================== + // ========= + // Assert Helper + // ============= + @Override + protected void assertStatus(String methodName) { + assertBasicProperty(methodName); + assertComponentProperty(methodName); + if (_entityType == null) { + throw new IllegalStateException(buildAssertMessage("_entityType", + methodName)); + } + if (_entity == null) { + throw new IllegalStateException(buildAssertMessage("_entity", + methodName)); + } + if (_conditionBeanType == null) { + throw new IllegalStateException(buildAssertMessage( + "_conditionBeanType", methodName)); + } + if (_conditionBean == null) { + throw new IllegalStateException(buildAssertMessage( + "_conditionBean", methodName)); + } + } + + //========================================================================== + // ========= + // Accessor + // ======== + public void setConditionBeanType( + Class conditionBeanType) { + _conditionBeanType = conditionBeanType; + } + + public void setConditionBean(ConditionBean conditionBean) { + _conditionBean = conditionBean; + } +} Property changes on: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/bhv/core/command/QueryUpdateEntityCBCommand.java ___________________________________________________________________ Name: svn:eol-style + native Added: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/bhv/core/command/SelectCountCBCommand.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/bhv/core/command/SelectCountCBCommand.java (rev 0) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/bhv/core/command/SelectCountCBCommand.java 2008-12-27 22:18:30 UTC (rev 1630) @@ -0,0 +1,65 @@ +package jp.sf.pal.scheduler.db.allcommon.bhv.core.command; + +import jp.sf.pal.scheduler.db.allcommon.bhv.core.SqlExecution; +import jp.sf.pal.scheduler.db.allcommon.bhv.core.SqlExecutionCreator; +import jp.sf.pal.scheduler.db.allcommon.cbean.ConditionBean; +import jp.sf.pal.scheduler.db.allcommon.cbean.ConditionBeanContext; + +import org.seasar.extension.jdbc.ResultSetHandler; + +/** + * @author DBFlute(AutoGenerator) + */ +public class SelectCountCBCommand extends AbstractSelectCBCommand { + + //========================================================================== + // ========= + // Basic Information + // ================= + public String getCommandName() { + return "selectCount"; + } + + public Class getCommandReturnType() { + return Integer.class; + } + + //========================================================================== + // ========= + // Process Callback + // ================ + public void beforeGettingSqlExecution() { + assertStatus("beforeGettingSqlExecution"); + final ConditionBean cb = _conditionBean; + cb.xsetupSelectCountIgnoreFetchScope(); // *Point! + ConditionBeanContext.setConditionBeanOnThread(cb); + } + + public void afterExecuting() { + assertStatus("afterExecuting"); + final ConditionBean cb = _conditionBean; + cb.xafterCareSelectCountIgnoreFetchScope(); + } + + //========================================================================== + // ========= + // Detail Information + // ================== + public boolean isSelectCount() { + return true; + } + + //========================================================================== + // ========= + // SqlExecution Handling + // ===================== + public SqlExecutionCreator createSqlExecutionCreator() { + assertStatus("createSqlExecutionCreator"); + return new SqlExecutionCreator() { + public SqlExecution createSqlExecution() { + ResultSetHandler handler = createObjectResultSetHandler(getCommandReturnType()); + return createSelectCBExecution(_conditionBeanType, handler); + } + }; + } +} Property changes on: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/bhv/core/command/SelectCountCBCommand.java ___________________________________________________________________ Name: svn:eol-style + native Added: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/bhv/core/command/SelectListCBCommand.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/bhv/core/command/SelectListCBCommand.java (rev 0) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/bhv/core/command/SelectListCBCommand.java 2008-12-27 22:18:30 UTC (rev 1630) @@ -0,0 +1,103 @@ +package jp.sf.pal.scheduler.db.allcommon.bhv.core.command; + +import java.util.List; + +import jp.sf.pal.scheduler.db.allcommon.Entity; +import jp.sf.pal.scheduler.db.allcommon.bhv.core.SqlExecution; +import jp.sf.pal.scheduler.db.allcommon.bhv.core.SqlExecutionCreator; +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.FetchNarrowingBeanContext; + +import org.seasar.dao.BeanMetaData; +import org.seasar.extension.jdbc.ResultSetHandler; + +/** + * @author DBFlute(AutoGenerator) + * @param The type of entity. + */ +public class SelectListCBCommand extends + AbstractSelectCBCommand> { + + //========================================================================== + // ========= + // Attribute + // ========= + /** The type of entity. (Required) */ + protected Class _entityType; + + //========================================================================== + // ========= + // Basic Information + // ================= + public String getCommandName() { + return "selectList"; + } + + public Class getCommandReturnType() { + return List.class; + } + + //========================================================================== + // ========= + // Detail Information + // ================== + public boolean isSelectCount() { + return false; + } + + //========================================================================== + // ========= + // Process Callback + // ================ + public void beforeGettingSqlExecution() { + assertStatus("beforeGettingSqlExecution"); + final ConditionBean cb = _conditionBean; + FetchNarrowingBeanContext.setFetchNarrowingBeanOnThread(cb); + ConditionBeanContext.setConditionBeanOnThread(cb); + } + + public void afterExecuting() { + assertStatus("afterExecuting"); + } + + //========================================================================== + // ========= + // SqlExecution Handling + // ===================== + public SqlExecutionCreator createSqlExecutionCreator() { + assertStatus("createSqlExecutionCreator"); + return new SqlExecutionCreator() { + public SqlExecution createSqlExecution() { + BeanMetaData bmd = createBeanMetaData(); + ResultSetHandler handler = createBeanListMetaDataResultSetHandler(bmd); + return createSelectCBExecution(_conditionBeanType, handler); + } + }; + } + + protected BeanMetaData createBeanMetaData() { + return _beanMetaDataFactory.createBeanMetaData(_entityType); + } + + //========================================================================== + // ========= + // Assert Helper + // ============= + @Override + protected void assertStatus(String methodName) { + super.assertStatus(methodName); + if (_entityType == null) { + throw new IllegalStateException(buildAssertMessage("_entityType", + methodName)); + } + } + + //========================================================================== + // ========= + // Accessor + // ======== + public void setEntityType(Class entityType) { + _entityType = entityType; + } +} Property changes on: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/bhv/core/command/SelectListCBCommand.java ___________________________________________________________________ Name: svn:eol-style + native Added: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/bhv/core/command/SelectNextValCommand.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/bhv/core/command/SelectNextValCommand.java (rev 0) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/bhv/core/command/SelectNextValCommand.java 2008-12-27 22:18:30 UTC (rev 1630) @@ -0,0 +1,162 @@ +package jp.sf.pal.scheduler.db.allcommon.bhv.core.command; + +import jp.sf.pal.scheduler.db.allcommon.bhv.core.SqlExecution; +import jp.sf.pal.scheduler.db.allcommon.bhv.core.SqlExecutionCreator; +import jp.sf.pal.scheduler.db.allcommon.bhv.core.execution.BasicSelectExecution; +import jp.sf.pal.scheduler.db.allcommon.cbean.ConditionBean; +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 org.seasar.extension.jdbc.ResultSetHandler; + +/** + * @author DBFlute(AutoGenerator) + * @param The type of result. + */ +public class SelectNextValCommand extends + AbstractBehaviorCommand { + + //========================================================================== + // ========= + // Attribute + // ========= + /** The type of result. (NotNull) */ + protected Class _resultType; + + //========================================================================== + // ========= + // Basic Information + // ================= + public String getCommandName() { + return "selectNextVal"; + } + + public Class getCommandReturnType() { + return _resultType; + } + + //========================================================================== + // ========= + // Detail Information + // ================== + public boolean isConditionBean() { + return false; + } + + public boolean isOutsideSql() { + return false; + } + + public boolean isProcedure() { + return false; + } + + public boolean isSelect() { + return true; + } + + public boolean isSelectCount() { + return false; + } + + //========================================================================== + // ========= + // Process Callback + // ================ + public void beforeGettingSqlExecution() { + } + + public void afterExecuting() { + } + + //========================================================================== + // ========= + // SqlExecution Handling + // ===================== + public String buildSqlExecutionKey() { + assertStatus("buildSqlExecutionKey"); + return _tableDbName + ":" + getCommandName() + "()"; + } + + public SqlExecutionCreator createSqlExecutionCreator() { + assertStatus("createSqlExecutionCreator"); + return new SqlExecutionCreator() { + public SqlExecution createSqlExecution() { + ResultSetHandler handler = createObjectResultSetHandler(_resultType); + return createSelectNextValExecution(handler); + } + }; + } + + protected SqlExecution createSelectNextValExecution(ResultSetHandler handler) { + final DBMeta dbmeta = findDBMeta(); + if (!dbmeta.hasSequence()) { + String msg = "If the method 'selectNextVal()' exists, DBMeta.hasSequence() should return true:"; + msg = msg + " dbmeta.hasSequence()=" + dbmeta.hasSequence(); + throw new IllegalStateException(msg); + } + final String nextValSql = dbmeta.getSequenceNextValSql(); + if (nextValSql == null) { + String msg = "If the method 'selectNextVal()' exists, DBMeta.getSequenceNextValSql() should not return null:"; + msg = msg + " dbmeta.getSequenceNextValSql()=" + + dbmeta.getSequenceNextValSql(); + throw new IllegalStateException(msg); + } + return createBasicSelectExecution(handler, new String[] {}, + new Class[] {}, nextValSql); + } + + protected BasicSelectExecution createBasicSelectExecution( + ResultSetHandler handler, String[] argNames, Class[] argTypes, + String sql) { + final BasicSelectExecution cmd = new BasicSelectExecution(_dataSource, + _statementFactory, handler); + cmd.setArgNames(argNames); + cmd.setArgTypes(argTypes); + cmd.setSql(sql); + return cmd; + } + + protected DBMeta findDBMeta() { + return DBMetaInstanceHandler.findDBMeta(_tableDbName); + } + + public Object[] getSqlExecutionArgument() { + assertStatus("getSqlExecutionArgument"); + return new Object[] {}; + } + + //========================================================================== + // ========= + // Argument Information + // ==================== + public ConditionBean getConditionBean() { + return null; + } + + public String getOutsideSqlPath() { + return null; + } + + public OutsideSqlOption getOutsideSqlOption() { + return null; + } + + //========================================================================== + // ========= + // Assert Helper + // ============= + protected void assertStatus(String methodName) { + assertBasicProperty(methodName); + assertComponentProperty(methodName); + } + + //========================================================================== + // ========= + // Accessor + // ======== + public void setResultType(Class resultType) { + _resultType = resultType; + } +} Property changes on: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/bhv/core/command/SelectNextValCommand.java ___________________________________________________________________ Name: svn:eol-style + native Added: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/bhv/core/command/SelectScalarCBCommand.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/bhv/core/command/SelectScalarCBCommand.java (rev 0) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/bhv/core/command/SelectScalarCBCommand.java 2008-12-27 22:18:30 UTC (rev 1630) @@ -0,0 +1,112 @@ +package jp.sf.pal.scheduler.db.allcommon.bhv.core.command; + +import jp.sf.pal.scheduler.db.allcommon.bhv.core.SqlExecution; +import jp.sf.pal.scheduler.db.allcommon.bhv.core.SqlExecutionCreator; +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.sqlclause.SqlClause; + +import org.seasar.extension.jdbc.ResultSetHandler; + +/** + * @author DBFlute(AutoGenerator) + * @param The type of result. + */ +public class SelectScalarCBCommand extends + AbstractSelectCBCommand { + + //========================================================================== + // ========= + // Attribute + // ========= + /** The type of result. (NotNull) */ + protected Class _resultType; + + /** The type of select clause. (NotNull) */ + protected SqlClause.SelectClauseType _selectClauseType; + + //========================================================================== + // ========= + // Basic Information + // ================= + public String getCommandName() { + assertStatus("getCommandName"); + final String resultTypeName = _resultType.getSimpleName(); + final String scalarMethodName = _selectClauseType.toString() + .toLowerCase(); + return "scalarSelect(" + resultTypeName + ")." + scalarMethodName; + } + + public Class getCommandReturnType() { + assertStatus("getCommandReturnType"); + return _resultType; + } + + //========================================================================== + // ========= + // Detail Information + // ================== + public boolean isSelectCount() { + return false; + } + + //========================================================================== + // ========= + // Process Callback + // ================ + public void beforeGettingSqlExecution() { + assertStatus("beforeGettingSqlExecution"); + final ConditionBean cb = _conditionBean; + ConditionBeanContext.setConditionBeanOnThread(cb); + cb.getSqlClause().classifySelectClauseType(_selectClauseType); //*Point! + } + + public void afterExecuting() { + assertStatus("afterExecuting"); + final ConditionBean cb = _conditionBean; + cb.getSqlClause().rollbackSelectClauseType(); + } + + //========================================================================== + // ========= + // SqlExecution Handling + // ===================== + public SqlExecutionCreator createSqlExecutionCreator() { + assertStatus("createSqlExecutionCreator"); + return new SqlExecutionCreator() { + public SqlExecution createSqlExecution() { + ResultSetHandler handler = createObjectResultSetHandler(getCommandReturnType()); + return createSelectCBExecution(_conditionBeanType, handler); + } + }; + } + + //========================================================================== + // ========= + // Assert Helper + // ============= + @Override + protected void assertStatus(String methodName) { + super.assertStatus(methodName); + if (_resultType == null) { + throw new IllegalStateException(buildAssertMessage("_resultType", + methodName)); + } + if (_selectClauseType == null) { + throw new IllegalStateException(buildAssertMessage( + "_selectClauseType", methodName)); + } + } + + //========================================================================== + // ========= + // Accessor + // ======== + public void setResultType(Class resultType) { + _resultType = resultType; + } + + public void setSelectClauseType(SqlClause.SelectClauseType selectClauseType) { + _selectClauseType = selectClauseType; + } +} Property changes on: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/bhv/core/command/SelectScalarCBCommand.java ___________________________________________________________________ Name: svn:eol-style + native Added: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/bhv/core/command/UpdateEntityCommand.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/bhv/core/command/UpdateEntityCommand.java (rev 0) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/bhv/core/command/UpdateEntityCommand.java 2008-12-27 22:18:30 UTC (rev 1630) @@ -0,0 +1,55 @@ +package jp.sf.pal.scheduler.db.allcommon.bhv.core.command; + +import jp.sf.pal.scheduler.db.allcommon.bhv.core.SqlExecution; +import jp.sf.pal.scheduler.db.allcommon.bhv.core.SqlExecutionCreator; +import jp.sf.pal.scheduler.db.allcommon.s2dao.internal.sqlcommand.InternalUpdateModifiedOnlyCommand; + +import org.seasar.dao.BeanMetaData; + +/** + * @author DBFlute(AutoGenerator) + */ +public class UpdateEntityCommand extends AbstractEntityCommand { + + //========================================================================== + // ========= + // Basic Information + // ================= + public String getCommandName() { + return "update"; + } + + //========================================================================== + // ========= + // SqlExecution Handling + // ===================== + public SqlExecutionCreator createSqlExecutionCreator() { + assertStatus("createSqlExecutionCreator"); + return new SqlExecutionCreator() { + public SqlExecution createSqlExecution() { + final BeanMetaData bmd = createBeanMetaData(); + return createUpdateEntitySqlExecution(bmd); + } + }; + } + + protected SqlExecution createUpdateEntitySqlExecution(BeanMetaData bmd) { + final String[] propertyNames = getPersistentPropertyNames(bmd); + return createUpdateModifiedOnlyCommand(bmd, propertyNames); + } + + protected InternalUpdateModifiedOnlyCommand createUpdateModifiedOnlyCommand( + BeanMetaData bmd, String[] propertyNames) { + final InternalUpdateModifiedOnlyCommand cmd = new InternalUpdateModifiedOnlyCommand( + _dataSource, _statementFactory); + cmd.setBeanMetaData(bmd);// Extension Point! + cmd.setPropertyNames(propertyNames); + cmd.setOptimisticLockHandling(isOptimisticLockHandling()); + cmd.setVersionNoAutoIncrementOnMemory(isOptimisticLockHandling()); + return cmd; + } + + protected boolean isOptimisticLockHandling() { + return true; + } +} Property changes on: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/bhv/core/command/UpdateEntityCommand.java ___________________________________________________________________ Name: svn:eol-style + native Added: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/bhv/core/command/UpdateNonstrictEntityCommand.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/bhv/core/command/UpdateNonstrictEntityCommand.java (rev 0) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/bhv/core/command/UpdateNonstrictEntityCommand.java 2008-12-27 22:18:30 UTC (rev 1630) @@ -0,0 +1,25 @@ +package jp.sf.pal.scheduler.db.allcommon.bhv.core.command; + +/** + * @author DBFlute(AutoGenerator) + */ +public class UpdateNonstrictEntityCommand extends UpdateEntityCommand { + + //========================================================================== + // ========= + // Basic Information + // ================= + @Override + public String getCommandName() { + return "updateNonstrict"; + } + + //========================================================================== + // ========= + // SqlExecution Handling + // ===================== + @Override + protected boolean isOptimisticLockHandling() { + return false; + } +} Property changes on: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/bhv/core/command/UpdateNonstrictEntityCommand.java ___________________________________________________________________ Name: svn:eol-style + native Added: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/bhv/core/execution/BasicSelectExecution.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/bhv/core/execution/BasicSelectExecution.java (rev 0) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/bhv/core/execution/BasicSelectExecution.java 2008-12-27 22:18:30 UTC (rev 1630) @@ -0,0 +1,77 @@ +package jp.sf.pal.scheduler.db.allcommon.bhv.core.execution; + +import javax.sql.DataSource; + +import jp.sf.pal.scheduler.db.allcommon.s2dao.internal.sqlcommand.InternalAbstractDynamicCommand; +import jp.sf.pal.scheduler.db.allcommon.s2dao.internal.sqlhandler.InternalBasicSelectHandler; + +import org.seasar.dao.CommandContext; +import org.seasar.extension.jdbc.ResultSetHandler; +import org.seasar.extension.jdbc.StatementFactory; + +/** + * @author DBFlute(AutoGenerator) + */ +public class BasicSelectExecution extends InternalAbstractDynamicCommand { + + //========================================================================== + // ========= + // Attribute + // ========= + /** The handler of resultSet. */ + protected ResultSetHandler resultSetHandler; + + //========================================================================== + // ========= + // Constructor + // =========== + /** + * Constructor. + * + * @param dataSource Data source. + * @param statementFactory The factory of statement. + * @param resultSetHandler The handler of resultSet. + */ + public BasicSelectExecution(DataSource dataSource, + StatementFactory statementFactory, ResultSetHandler resultSetHandler) { + super(dataSource, statementFactory); + this.resultSetHandler = resultSetHandler; + } + + //========================================================================== + // ========= + // Execute + // ======= + /** + * @param args The array of argument. (Nullable) + * @return The object of execution result. (Nullable) + */ + public Object execute(Object[] args) { + final CommandContext ctx = apply(args); + final InternalBasicSelectHandler selectHandler = createBasicSelectHandler( + ctx.getSql(), this.resultSetHandler); + final Object[] bindVariableArray = ctx.getBindVariables(); + selectHandler.setLoggingMessageSqlArgs(bindVariableArray); + return selectHandler.execute(bindVariableArray, ctx + .getBindVariableTypes()); + } + + //========================================================================== + // ========= + // Select Handler + // ============== + protected InternalBasicSelectHandler createBasicSelectHandler( + String realSql, ResultSetHandler rsh) { + return new InternalBasicSelectHandler(getDataSource(), realSql, rsh, + getStatementFactory()); + } + + //========================================================================== + // ========= + // Parser Option + // ============= + @Override + protected boolean isBlockNullParameter() { + return true; // Because the SQL is select. + } +} Property changes on: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/bhv/core/execution/BasicSelectExecution.java ___________________________________________________________________ Name: svn:eol-style + native Added: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/bhv/core/execution/OutsideSqlSelectExecution.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/bhv/core/execution/OutsideSqlSelectExecution.java (rev 0) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/bhv/core/execution/OutsideSqlSelectExecution.java 2008-12-27 22:18:30 UTC (rev 1630) @@ -0,0 +1,225 @@ +package jp.sf.pal.scheduler.db.allcommon.bhv.core.execution; + +import java.util.ArrayList; +import java.util.List; + +import javax.sql.DataSource; + +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.framework.beans.BeanDesc; +import org.seasar.framework.beans.PropertyDesc; +import org.seasar.framework.beans.factory.BeanDescFactory; + +/** + * @author DBFlute(AutoGenerator) + */ +public class OutsideSqlSelectExecution extends InternalAbstractDynamicCommand { + + //========================================================================== + // ========= + // Attribute + // ========= + /** The handler of resultSet. */ + protected ResultSetHandler resultSetHandler; + + //========================================================================== + // ========= + // Constructor + // =========== + /** + * Constructor. + * + * @param dataSource Data source. + * @param statementFactory The factory of statement. + * @param resultSetHandler The handler of resultSet. + */ + public OutsideSqlSelectExecution(DataSource dataSource, + StatementFactory statementFactory, ResultSetHandler resultSetHandler) { + super(dataSource, statementFactory); + this.resultSetHandler = resultSetHandler; + } + + //========================================================================== + // ========= + // Execute + // ======= + /** + * @param args The array of argument. (NotNull, The first element should be + * the instance of Pmb) + * @return The object of execution result. (Nullable) + */ + public Object execute(Object[] args) { + final OutsideSqlContext outsideSqlContext = OutsideSqlContext + .getOutsideSqlContextOnThread(); + if (outsideSqlContext.isDynamicBinding()) { + return executeOutsideSqlAsDynamic(args, outsideSqlContext); + } else { + return executeOutsideSqlAsStatic(args, outsideSqlContext); + } + } + + // ----------------------------------------------------- + // OutsideSql Execute + // ------------------ + /** + * Execute outside-SQL as Dynamic. + * + * @param args The array of argument. (NotNull, The first element should be + * the instance of Pmb) + * @param outsideSqlContext The context of outside-SQL. (NotNull) + * @return Result. (Nullable) + */ + protected Object executeOutsideSqlAsDynamic(Object[] args, + OutsideSqlContext outsideSqlContext) { + final Object firstArg = args[0]; + String staticSql = getSql(); + if (firstArg != null) { + final BeanDesc beanDesc = BeanDescFactory.getBeanDesc(firstArg + .getClass()); + + // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + // - - - - - - - + // Resolve embedded comment for parsing bind variable comment in + // embedded comment. + // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + // - - - - - - - + for (int i = 0; i < beanDesc.getPropertyDescSize(); i++) { + final PropertyDesc propertyDesc = beanDesc.getPropertyDesc(i); + final Class propertyType = propertyDesc.getPropertyType(); + if (!propertyType.equals(String.class)) { + continue; + } + final String outsideSqlPiece = (String) propertyDesc + .getValue(firstArg); + if (outsideSqlPiece == null) { + continue; + } + final String embeddedComment = "/*$pmb." + + propertyDesc.getPropertyName() + "*/"; + staticSql = replaceString(staticSql, embeddedComment, + outsideSqlPiece); + } + } + + final OutsideSqlSelectExecution outsideSqlCommand = createDynamicSqlFactory(); + outsideSqlCommand.setArgNames(getArgNames()); + outsideSqlCommand.setArgTypes(getArgTypes()); + outsideSqlCommand.setSql(staticSql); + + final CommandContext ctx = outsideSqlCommand.apply(args); + final List bindVariableList = new ArrayList(); + final List> bindVariableTypeList = new ArrayList>(); + addBindVariableInfo(ctx, bindVariableList, bindVariableTypeList); + final InternalBasicSelectHandler selectHandler = createBasicSelectHandler( + ctx.getSql(), this.resultSetHandler); + final Object[] bindVariableArray = bindVariableList.toArray(); + selectHandler.setLoggingMessageSqlArgs(bindVariableArray); + return selectHandler.execute(bindVariableArray, + toClassArray(bindVariableTypeList)); + } + + /** + * Execute outside-SQL as static. + * + * @param args The array of argument. (NotNull, The first element should be + * the instance of Pmb) + * @param outsideSqlContext The context of outside-SQL. (NotNull) + * @return Result. (Nullable) + */ + protected Object executeOutsideSqlAsStatic(Object[] args, + OutsideSqlContext outsideSqlContext) { + final CommandContext ctx = apply(args); + final InternalBasicSelectHandler selectHandler = createBasicSelectHandler( + ctx.getSql(), this.resultSetHandler); + final Object[] bindVariableArray = ctx.getBindVariables(); + selectHandler.setLoggingMessageSqlArgs(bindVariableArray); + return selectHandler.execute(bindVariableArray, ctx + .getBindVariableTypes()); + } + + //========================================================================== + // ========= + // Dynamic SQL Factory + // =================== + protected OutsideSqlSelectExecution createDynamicSqlFactory() { + return new OutsideSqlSelectExecution(getDataSource(), + getStatementFactory(), resultSetHandler); + } + + //========================================================================== + // ========= + // Select Handler + // ============== + protected InternalBasicSelectHandler createBasicSelectHandler( + String realSql, ResultSetHandler rsh) { + return new InternalBasicSelectHandler(getDataSource(), realSql, rsh, + getStatementFactory()); + } + + //========================================================================== + // ========= + // Parser Option + // ============= + @Override + protected boolean isBlockNullParameter() { + return true; // Because the SQL is select. + } + + //========================================================================== + // ========= + // Setup Helper + // ============ + protected Class[] toClassArray(List> 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 bindVariableList, List> bindVariableTypeList) { + final Object[] bindVariables = ctx.getBindVariables(); + addBindVariableList(bindVariableList, bindVariables); + final Class[] bindVariableTypes = ctx.getBindVariableTypes(); + addBindVariableTypeList(bindVariableTypeList, bindVariableTypes); + } + + protected void addBindVariableList(List bindVariableList, + Object[] bindVariables) { + for (int i = 0; i < bindVariables.length; i++) { + bindVariableList.add(bindVariables[i]); + } + } + + protected void addBindVariableTypeList(List> bindVariableTypeList, + Class[] bindVariableTypes) { + for (int i = 0; i < bindVariableTypes.length; i++) { + bindVariableTypeList.add(bindVariableTypes[i]); + } + } + + //========================================================================== + // ========= + // General Helper + // ============== + protected final String replaceString(String text, String fromText, + String toText) { + return SimpleStringUtil.replace(text, fromText, toText); + } + + protected String getLineSeparator() { + return SimpleSystemUtil.getLineSeparator(); + } +} Property changes on: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/bhv/core/execution/OutsideSqlSelectExecution.java ___________________________________________________________________ Name: svn:eol-style + native Added: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/bhv/core/execution/SelectCBExecution.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/bhv/core/execution/SelectCBExecution.java (rev 0) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/bhv/core/execution/SelectCBExecution.java 2008-12-27 22:18:30 UTC (rev 1630) @@ -0,0 +1,168 @@ +package jp.sf.pal.scheduler.db.allcommon.bhv.core.execution; + +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.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; + +/** + * @author DBFlute(AutoGenerator) + */ +public class SelectCBExecution extends InternalAbstractDynamicCommand { + + //========================================================================== + // ========= + // Attribute + // ========= + /** The handler of resultSet. */ + protected ResultSetHandler resultSetHandler; + + //========================================================================== + // ========= + // Constructor + // =========== + /** + * Constructor. + * + * @param dataSource Data source. + * @param statementFactory The factory of statement. + * @param resultSetHandler The handler of resultSet. + */ + public SelectCBExecution(DataSource dataSource, + StatementFactory statementFactory, ResultSetHandler resultSetHandler) { + super(dataSource, statementFactory); + this.resultSetHandler = resultSetHandler; + } + + //========================================================================== + // ========= + // Execute + // ======= + /** + * @param args The array of argument. (NotNull, The first element should be + * the instance of CB) + * @return The object of execution result. (Nullable) + */ + public Object execute(Object[] args) { + final List bindVariableList = new ArrayList(); + final List> bindVariableTypeList = new ArrayList>(); + + final String finalClause = setupRealClause(args, bindVariableList, + bindVariableTypeList); + final InternalBasicSelectHandler selectHandler = createBasicSelectHandler( + finalClause, this.resultSetHandler); + final Object[] bindVariableArray = bindVariableList.toArray(); + selectHandler.setLoggingMessageSqlArgs(bindVariableArray); + return selectHandler.execute(bindVariableArray, + toClassArray(bindVariableTypeList)); + } + + // ----------------------------------------------------- + // Setup Clause + // ------------ + protected String setupRealClause(Object[] args, + List bindVariableList, List> bindVariableTypeList) { + final ConditionBean cb = ConditionBeanContext + .getConditionBeanOnThread(); + final String realClause; + { + final SelectCBExecution dynamicSqlFactory = createDynamicSqlFactory(); + dynamicSqlFactory.setArgNames(getArgNames()); + dynamicSqlFactory.setArgTypes(getArgTypes()); + dynamicSqlFactory.setSql(cb.getSqlClause().getClause()); + final CommandContext ctx = dynamicSqlFactory.apply(args); + realClause = ctx.getSql(); + addBindVariableInfo(ctx, bindVariableList, bindVariableTypeList); + } + return realClause; + } + + //========================================================================== + // ========= + // Dynamic SQL Factory + // =================== + protected SelectCBExecution createDynamicSqlFactory() { + return new SelectCBExecution(getDataSource(), getStatementFactory(), + resultSetHandler); + } + + //========================================================================== + // ========= + // Select Handler + // ============== + protected InternalBasicSelectHandler createBasicSelectHandler( + String realSql, ResultSetHandler rsh) { + return new InternalBasicSelectHandler(getDataSource(), realSql, rsh, + getStatementFactory()); + } + + //========================================================================== + // ========= + // Parser Option + // ============= + @Override + protected boolean isBlockNullParameter() { + return true; // Because the SQL is select. + } + + //========================================================================== + // ========= + // Setup Helper + // ============ + protected Class[] toClassArray(List> 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 bindVariableList, List> bindVariableTypeList) { + final Object[] bindVariables = ctx.getBindVariables(); + addBindVariableList(bindVariableList, bindVariables); + final Class[] bindVariableTypes = ctx.getBindVariableTypes(); + addBindVariableTypeList(bindVariableTypeList, bindVariableTypes); + } + + protected void addBindVariableList(List bindVariableList, + Object[] bindVariables) { + for (int i = 0; i < bindVariables.length; i++) { + bindVariableList.add(bindVariables[i]); + } + } + + protected void addBindVariableTypeList(List> bindVariableTypeList, + Class[] bindVariableTypes) { + for (int i = 0; i < bindVariableTypes.length; i++) { + bindVariableTypeList.add(bindVariableTypes[i]); + } + } + + //========================================================================== + // ========= + // General Helper + // ============== + protected final String replaceString(String text, String fromText, + String toText) { + return SimpleStringUtil.replace(text, fromText, toText); + } + + protected String getLineSeparator() { + return SimpleSystemUtil.getLineSeparator(); + } +} Property changes on: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/bhv/core/execution/SelectCBExecution.java ___________________________________________________________________ Name: svn:eol-style + native Modified: 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 2008-12-27 22:14:41 UTC (rev 1629) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/cbean/AbstractConditionBean.java 2008-12-27 22:18:30 UTC (rev 1630) @@ -24,6 +24,28 @@ public abstract class AbstractConditionBean implements ConditionBean { //========================================================================== + // =========== + // Definition + // ========== + /** Map-string map-mark. */ + private static final String MAP_STRING_MAP_MARK = "map:"; + + /** Map-string list-mark. */ + private static final String MAP_STRING_LIST_MARK = "list:"; + + /** Map-string start-brace. */ + private static final String MAP_STRING_START_BRACE = "@{"; + + /** Map-string end-brace. */ + private static final String MAP_STRING_END_BRACE = "@}"; + + /** Map-string delimiter. */ + private static final String MAP_STRING_DELIMITER = "@;"; + + /** Map-string equal. */ + private static final String MAP_STRING_EQUAL = "@="; + + //========================================================================== // ========= // Attribute // ========= @@ -41,8 +63,12 @@ // [DBFlute-0.7.4] @jflute -- At the future, I'll implement some check // logics by these purpose types. - protected boolean _forDeriveReferrer; + protected boolean _forDerivedReferrer; + protected boolean _forScalarSelect; + + protected boolean _forScalarSubQuery; + protected boolean _forUnion; protected boolean _forExistsSubQuery; @@ -73,27 +99,6 @@ //========================================================================== // ========= - // ConditionQuery - // ============== - /** - * Get condition query as interface. At the future, change public to - * protected. - * - * @return Instance of query as interface. (NotNull) - */ - abstract public ConditionQuery getConditionQueryAsInterface(); - - /** - * The implementation. - * - * @return The conditionQuery of the local table as interface. (NotNull) - */ - public ConditionQuery localCQ() { - return getConditionQueryAsInterface(); - } - - //========================================================================== - // ========= // Accept PrimaryKey // ================= /** @@ -498,42 +503,6 @@ //========================================================================== // ========= - // Limit Select - // ============ - /** Is limit-select PK only? */ - protected boolean _isLimitSelectPKOnly; - - /** - * Is limit-select PK only? - * - * @return Determination. - */ - public boolean isLimitSelect_PKOnly() { - return _isLimitSelectPKOnly; - } - - /** - * Limit select PK only. - * - * @return this. (NotNull) - */ - public ConditionBean limitSelect_PKOnly() { - _isLimitSelectPKOnly = true; - return this; - } - - /** - * Limit select off. - * - * @return this. (NotNull) - */ - public ConditionBean limitSelect_Off() { - _isLimitSelectPKOnly = false; - return this; - } - - //========================================================================== - // ========= // Lock Setting // ============ /** @@ -559,11 +528,8 @@ public ConditionBean xsetupSelectCountIgnoreFetchScope() { _isSelectCountIgnoreFetchScope = true; - // If the query uses union query, it needs included-select-column. - if (!hasUnionQueryOrUnionAllQuery()) { - getSqlClause().ignoreIncludedSelectColumn(); - } - + getSqlClause().classifySelectClauseType( + SqlClause.SelectClauseType.COUNT); getSqlClause().ignoreOrderBy(); getSqlClause().ignoreFetchScope(); return this; @@ -578,11 +544,7 @@ public ConditionBean xafterCareSelectCountIgnoreFetchScope() { _isSelectCountIgnoreFetchScope = false; - // If the query uses union query, it needs included-select-column. - if (!hasUnionQueryOrUnionAllQuery()) { - getSqlClause().makeIncludedSelectColumnEffective(); - } - + getSqlClause().rollbackSelectClauseType(); getSqlClause().makeOrderByEffective(); getSqlClause().makeFetchScopeEffective(); return this; @@ -613,20 +575,29 @@ protected CQ _query; - protected boolean _forDeriveReferrer; + protected boolean _forDerivedReferrer; - protected boolean alreadySpecifyRequiredColumn; + protected boolean _forScalarSelect; + protected boolean _forScalarSubQuery; + + protected boolean _alreadySpecifyRequiredColumn; + /** * @param baseCB The condition-bean of base level. (NotNull) - * @param qyCall The callback for condition-query. (NotNull) - * @param forDeriveReferrer Is this for derive referrer? + * @param qyCall The call-back for condition-query. (NotNull) + * @param forDerivedReferrer Is this for derive referrer? + * @param forScalarSelect Is this for scalar select? + * @param forScalarSubQuery Is this for scalar sub-query? */ protected AbstractSpecification(ConditionBean baseCB, - SpQyCall qyCall, boolean forDeriveReferrer) { + SpQyCall qyCall, boolean forDerivedReferrer, + boolean forScalarSelect, boolean forScalarSubQuery) { _baseCB = baseCB; _qyCall = qyCall; - _forDeriveReferrer = forDeriveReferrer; + _forDerivedReferrer = forDerivedReferrer; + _forScalarSelect = forScalarSelect; + _forScalarSubQuery = forScalarSubQuery; } protected void doColumn(String columnName) { @@ -634,8 +605,8 @@ if (_query == null) { _query = _qyCall.qy(); } - if (!_forDeriveReferrer && !alreadySpecifyRequiredColumn) { - alreadySpecifyRequiredColumn = true; + if (isRequiredColumnSpecificationEnabled()) { + _alreadySpecifyRequiredColumn = true; doSpecifyRequiredColumn(); } String relationPath = _query.getRelationPath() != null ? _query @@ -652,6 +623,11 @@ columnName); } + protected boolean isRequiredColumnSpecificationEnabled() { + return !_forDerivedReferrer && !_forScalarSelect + && !_forScalarSubQuery && !_alreadySpecifyRequiredColumn; + } + protected void assertColumn(String columnName) { if (_query == null && !_qyCall.has()) { throwSpecifyColumnNotSetupSelectColumnException(columnName); @@ -659,9 +635,15 @@ } protected void assertForeign(String foreignPropertyName) { - if (_forDeriveReferrer) { - throwDeriveReferrerInvalidForeignSpecificationException(foreignPropertyName); + if (_forDerivedReferrer) { + throwDerivedReferrerInvalidForeignSpecificationException(foreignPropertyName); } + if (_forScalarSelect) { + throwScalarSelectInvalidForeignSpecificationException(foreignPropertyName); + } + if (_forScalarSubQuery) { + throwScalarSubQueryInvalidForeignSpecificationException(foreignPropertyName); + } } protected abstract void doSpecifyRequiredColumn(); @@ -714,19 +696,19 @@ throw new SpecifyColumnNotSetupSelectColumnException(msg); } - protected void throwDeriveReferrerInvalidForeignSpecificationException( + protected void throwDerivedReferrerInvalidForeignSpecificationException( String foreignPropertyName) { String msg = "Look! Read the message below." + getLineSeparator(); msg = msg + "/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *" + getLineSeparator(); msg = msg - + "You specified a foreign table column in spite of derive-sub-query!" + + "You specified a foreign table column in spite of derived-referrer!" + getLineSeparator(); msg = msg + getLineSeparator(); msg = msg + "[Advice]" + getLineSeparator(); msg = msg - + "You should specified a local table column at condition-bean for derive-sub-query." + + "You should specified a local table column at condition-bean for derived-referrer." + getLineSeparator(); msg = msg + " For example:" + getLineSeparator(); msg = msg + " " + getLineSeparator(); @@ -736,7 +718,7 @@ msg = msg + " MemberCB cb = new MemberCB();" + getLineSeparator(); msg = msg - + " cb.specify().derivePurchaseList().max(new SubQuery() {" + + " cb.specify().derivedPurchaseList().max(new SubQuery() {" + getLineSeparator(); msg = msg + " public void query(PurchaseCB subCB) {" + getLineSeparator(); @@ -754,7 +736,7 @@ msg = msg + " MemberCB cb = new MemberCB();" + getLineSeparator(); msg = msg - + " cb.specify().derivePurchaseList().max(new SubQuery() {" + + " cb.specify().derivedPurchaseList().max(new SubQuery() {" + getLineSeparator(); msg = msg + " public void query(PurchaseCB subCB) {" + getLineSeparator(); @@ -769,9 +751,117 @@ msg = msg + "[Specified Foreign Property]" + getLineSeparator() + foreignPropertyName + getLineSeparator(); msg = msg + "* * * * * * * * * */"; - throw new DeriveReferrerInvalidForeignSpecificationException(msg); + throw new DerivedReferrerInvalidForeignSpecificationException(msg); } + protected void throwScalarSelectInvalidForeignSpecificationException( + String foreignPropertyName) { + String msg = "Look! Read the message below." + getLineSeparator(); + msg = msg + + "/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *" + + getLineSeparator(); + msg = msg + + "You specified a foreign table column in spite of scalar select!" + + getLineSeparator(); + msg = msg + getLineSeparator(); + msg = msg + "[Advice]" + getLineSeparator(); + msg = msg + + "You should specified a local table column at condition-bean for scalar select." + + getLineSeparator(); + msg = msg + " For example:" + getLineSeparator(); + msg = msg + " " + getLineSeparator(); + msg = msg + " [Wrong]" + getLineSeparator(); + msg = msg + " /- - - - - - - - - - - - - - - - - - - - " + + getLineSeparator(); + msg = msg + + " memberBhv.scalarSelect(Integer.class).max(new ScalarSelect() {" + + getLineSeparator(); + msg = msg + " public void query(MemberCB cb) {" + + getLineSeparator(); + msg = msg + + " cb.specify().specifyMemberStatus().columnDisplayOrder(); // *No!" + + getLineSeparator(); + msg = msg + " }" + getLineSeparator(); + msg = msg + " });" + getLineSeparator(); + msg = msg + " - - - - - - - - - -/" + getLineSeparator(); + msg = msg + " " + getLineSeparator(); + msg = msg + " [Good!]" + getLineSeparator(); + msg = msg + " /- - - - - - - - - - - - - - - - - - - - " + + getLineSeparator(); + msg = msg + + " memberBhv.scalarSelect(Date.class).max(new ScalarSelect() {" + + getLineSeparator(); + msg = msg + " public void query(MemberCB cb) {" + + getLineSeparator(); + msg = msg + + " cb.specify().columnMemberBirthday(); // *Point!" + + getLineSeparator(); + msg = msg + " }" + getLineSeparator(); + msg = msg + " });" + getLineSeparator(); + msg = msg + " - - - - - - - - - -/" + getLineSeparator(); + msg = msg + getLineSeparator(); + msg = msg + "[Specified Foreign Property]" + getLineSeparator() + + foreignPropertyName + getLineSeparator(); + msg = msg + "* * * * * * * * * */"; + throw new ScalarSelectInvalidForeignSpecificationException(msg); + } + + protected void throwScalarSubQueryInvalidForeignSpecificationException( + String foreignPropertyName) { + String msg = "Look! Read the message below." + getLineSeparator(); + msg = msg + + "/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *" + + getLineSeparator(); + msg = msg + + "You specified a foreign table column in spite of derived-query!" + + getLineSeparator(); + msg = msg + getLineSeparator(); + msg = msg + "[Advice]" + getLineSeparator(); + msg = msg + + "You should specified a local table column at condition-bean for derived-query." + + getLineSeparator(); + msg = msg + " For example:" + getLineSeparator(); + msg = msg + " " + getLineSeparator(); + msg = msg + " [Wrong]" + getLineSeparator(); + msg = msg + " /- - - - - - - - - - - - - - - - - - - - " + + getLineSeparator(); + msg = msg + " MemberCB cb = new MemberCB();" + + getLineSeparator(); + msg = msg + + " cb.query().scalar_Equal().max(new SubQuery() {" + + getLineSeparator(); + msg = msg + " public void query(MemberCB subCB) {" + + getLineSeparator(); + msg = msg + + " subCB.specify().specifyMemberStatusName().columnDisplayOrder(); // *No!" + + getLineSeparator(); + msg = msg + " }" + getLineSeparator(); + msg = msg + " });" + getLineSeparator(); + msg = msg + " - - - - - - - - - -/" + getLineSeparator(); + msg = msg + " " + getLineSeparator(); + msg = msg + " [Good!]" + getLineSeparator(); + msg = msg + " /- - - - - - - - - - - - - - - - - - - - " + + getLineSeparator(); + msg = msg + " MemberCB cb = new MemberCB();" + + getLineSeparator(); + msg = msg + + " cb.query().scalar_Equal().max(new SubQuery() {" + + getLineSeparator(); + msg = msg + " public void query(MemberCB subCB) {" + + getLineSeparator(); + msg = msg + + " subCB.specify().columnMemberBirthday();// *Point!" + + getLineSeparator(); + msg = msg + " }" + getLineSeparator(); + msg = msg + " });" + getLineSeparator(); + msg = msg + " - - - - - - - - - -/" + getLineSeparator(); + msg = msg + getLineSeparator(); + msg = msg + "[Specified Foreign Property]" + getLineSeparator() + + foreignPropertyName + getLineSeparator(); + msg = msg + "* * * * * * * * * */"; + throw new ScalarSubQueryInvalidForeignSpecificationException(msg); + } + protected String getLineSeparator() { return SimpleSystemUtil.getLineSeparator(); } @@ -792,15 +882,33 @@ } } - public static class DeriveReferrerInvalidForeignSpecificationException + public static class DerivedReferrerInvalidForeignSpecificationException extends RuntimeException { private static final long serialVersionUID = 1L; - public DeriveReferrerInvalidForeignSpecificationException(String msg) { + public DerivedReferrerInvalidForeignSpecificationException(String msg) { super(msg); } } + public static class ScalarSubQueryInvalidForeignSpecificationException + extends RuntimeException { + private static final long serialVersionUID = 1L; + + public ScalarSubQueryInvalidForeignSpecificationException(String msg) { + super(msg); + } + } + + public static class ScalarSelectInvalidForeignSpecificationException extends + RuntimeException { + private static final long serialVersionUID = 1L; + + public ScalarSelectInvalidForeignSpecificationException(String msg) { + super(msg); + } + } + public static class RAFunction { protected ConditionBean _baseCB; @@ -815,6 +923,18 @@ _querySetupper = querySetupper; } + public void count(SubQuery subQuery, String aliasName) { + assertAliasName(aliasName); + _querySetupper.setup("count", subQuery, _localCQ, aliasName.trim()); + } + + public void countDistinct(SubQuery subQuery, + String aliasName) { + assertAliasName(aliasName); + _querySetupper.setup("count(distinct", subQuery, _localCQ, + aliasName.trim()); + } + public void max(SubQuery subQuery, String aliasName) { assertAliasName(aliasName); _querySetupper.setup("max", subQuery, _localCQ, aliasName.trim()); @@ -835,14 +955,9 @@ _querySetupper.setup("avg", subQuery, _localCQ, aliasName.trim()); } - public void count(SubQuery subQuery, String aliasName) { - assertAliasName(aliasName); - _querySetupper.setup("count", subQuery, _localCQ, aliasName.trim()); - } - protected void assertAliasName(String aliasName) { if (aliasName == null || aliasName.trim().length() == 0) { - throwDeriveReferrerInvalidAliasNameException(); + throwDerivedReferrerInvalidAliasNameException(); } DBMeta dbmeta = DBMetaInstanceHandler.findDBMeta(_baseCB .getTableDbName()); @@ -860,17 +975,17 @@ } } if (!existsSetterMethod) { - throwDeriveReferrerEntityPropertyNotFoundException(aliasName, + throwDerivedReferrerEntityPropertyNotFoundException(aliasName, dbmeta.getEntityType()); } } - protected void throwDeriveReferrerInvalidAliasNameException() { + protected void throwDerivedReferrerInvalidAliasNameException() { String msg = "Look! Read the message below." + getLineSeparator(); msg = msg + "/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *" + getLineSeparator(); - msg = msg + "The alias name for derive-referrer was Invalid!" + msg = msg + "The alias name for derived-referrer was Invalid!" + getLineSeparator(); msg = msg + getLineSeparator(); msg = msg + "[Advice]" + getLineSeparator(); @@ -915,17 +1030,17 @@ msg = msg + "[Local Table]" + getLineSeparator() + _localCQ.getTableDbName() + getLineSeparator(); msg = msg + "* * * * * * * * * */"; - throw new DeriveReferrerInvalidAliasNameException(msg); + throw new DerivedReferrerInvalidAliasNameException(msg); } - protected void throwDeriveReferrerEntityPropertyNotFoundException( + protected void throwDerivedReferrerEntityPropertyNotFoundException( String aliasName, Class entityType) { String msg = "Look! Read the message below." + getLineSeparator(); msg = msg + "/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *" + getLineSeparator(); msg = msg - + "A property for derive-referrer was Not Found in the entity!" + + "A property for derived-referrer was Not Found in the entity!" + getLineSeparator(); msg = msg + getLineSeparator(); msg = msg + "[Advice]" + getLineSeparator(); @@ -981,7 +1096,7 @@ msg = msg + "[Target Entity]" + getLineSeparator() + entityType + getLineSeparator(); msg = msg + "* * * * * * * * * */"; - throw new DeriveReferrerEntityPropertyNotFoundException(msg); + throw new DerivedReferrerEntityPropertyNotFoundException(msg); } protected String replaceString(String text, String fromText, @@ -999,20 +1114,20 @@ LOCAL_CQ cq, String aliasName); } - public static class DeriveReferrerInvalidAliasNameException extends + public static class DerivedReferrerInvalidAliasNameException extends RuntimeException { private static final long serialVersionUID = 1L; - public DeriveReferrerInvalidAliasNameException(String msg) { + public DerivedReferrerInvalidAliasNameException(String msg) { super(msg); } } - public static class DeriveReferrerEntityPropertyNotFoundException extends + public static class DerivedReferrerEntityPropertyNotFoundException extends RuntimeException { private static final long serialVersionUID = 1L; - public DeriveReferrerEntityPropertyNotFoundException(String msg) { + public DerivedReferrerEntityPropertyNotFoundException(String msg) { super(msg); } } @@ -1042,7 +1157,6 @@ protected void doSetupSelect(SsCall callback) { String foreignPropertyName = callback.qf().getForeignPropertyName(); assertSetupSelectBeforeUnion(foreignPropertyName); - limitSelect_Off(); String foreignTableAliasName = callback.qf().getRealAliasName(); String localRelationPath = localCQ().getRelationPath(); getSqlClause().registerSelectedSelectColumn(foreignTableAliasName, @@ -1164,19 +1278,27 @@ // ========= // Purpose Type // ============ - public void xsetupForDeriveReferrer() { - _forDeriveReferrer = true; + public void xsetupForDerivedReferrer() { // Very Internal + _forDerivedReferrer = true; } - public void xsetupForUnion() { + public void xsetupForScalarSelect() { // Very Internal + _forScalarSelect = true; + } + + public void xsetupForScalarSubQuery() { // Very Internal + _forScalarSubQuery = true; + } + + public void xsetupForUnion() { // Very Internal _forUnion = true; } - public void xsetupForExistsSubQuery() { + public void xsetupForExistsSubQuery() { // Very Internal _forExistsSubQuery = true; } - public void xsetupForInScopeSubQuery() { + public void xsetupForInScopeSubQuery() { // Very Internal _forInScopeSubQuery = true; } Modified: 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 2008-12-27 22:14:41 UTC (rev 1629) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/cbean/AbstractConditionQuery.java 2008-12-27 22:18:30 UTC (rev 1630) @@ -48,12 +48,14 @@ protected static final ConditionKey CK_PS = ConditionKey.CK_PREFIX_SEARCH; - protected static final ConditionKey CK_LS = ConditionKey.CK_LIKE_SEARCH; - protected static final ConditionKey CK_INS = ConditionKey.CK_IN_SCOPE; protected static final ConditionKey CK_NINS = ConditionKey.CK_NOT_IN_SCOPE; + protected static final ConditionKey CK_LS = ConditionKey.CK_LIKE_SEARCH; + + protected static final ConditionKey CK_NLS = ConditionKey.CK_NOT_LIKE_SEARCH; + protected static final ConditionKey CK_ISN = ConditionKey.CK_IS_NULL; protected static final ConditionKey CK_ISNN = ConditionKey.CK_IS_NOT_NULL; @@ -351,15 +353,7 @@ String msg = "The argument[unionQuery] should not be null."; throw new IllegalArgumentException(msg); } - reflectRelationOnUnionQuery(this, unionQuery);// Reflect Relation! - getSqlClause().copyIncludedSelectColumn(unionQuery.getSqlClause());// Reflect - // IncludedSelectColumn - // ! - if (getSqlClause().isFormatClauseEffective()) { - unionQuery.getSqlClause().makeFormatClauseEffective();// Reflect - // FormatClause - // ! - } + reflectRelationOnUnionQuery(this, unionQuery); // Reflect Relation! String key = (unionAll ? "unionAllQuery" : "unionQuery") + unionQueryMap.size(); unionQueryMap.put(key, unionQuery); @@ -416,22 +410,6 @@ // Register // ======== // ----------------------------------------------------- - // Include-As-Mine - // --------------- - /** - * Register included-select-column. - * - * @param aliasName Alias name. This should not contain comma. (NotNull) - * @param realColumnName Real column name. This should not contain comma. - * (NotNull) - * @deprecated Unsupported! - */ - protected void registerIncludedSelectColumn(String aliasName, - String realColumnName) { - throw new UnsupportedOperationException(); - } - - // ----------------------------------------------------- // Query // ----- protected void registerQuery(ConditionKey key, Object value, @@ -488,6 +466,13 @@ // ----------------------------------------------------- // LikeSearch Query // ---------------- + protected void regLSQ(ConditionKey key, String value, + ConditionValue cvalue, String colName, String capPropName, + String uncapPropName, LikeSearchOption option) { + registerLikeSearchQuery(key, value, cvalue, colName, capPropName, + uncapPropName, option); + } + @SuppressWarnings("deprecation") protected void registerLikeSearchQuery(ConditionKey key, String value, ConditionValue cvalue, String colName, String capPropName, @@ -700,25 +685,20 @@ assertObjectNotNull("InScopeSubQyery(" + columnName + ")", subQuery); inScopeOption = inScopeOption != null ? inScopeOption + " " : ""; String realColumnName = getInScopeSubQueryRealColumnName(columnName); + xincrementLocalSubQueryLevelIfNeeds(subQuery); String subQueryClause = getInScopeSubQuerySql(subQuery, relatedColumnName, propertyName); - String clause = null; - if (getSqlClause().isFormatClauseEffective()) { - String ln = getLineSeparator(); - int subQueryLevel = subQuery.getSubQueryLevel(); - String subQueryIdentity = propertyName + "[" + subQueryLevel + "]"; - String beginMark = getSqlClause().resolveSubQueryBeginMark( - subQueryIdentity) - + ln; - String endMark = getSqlClause().resolveSubQueryEndMark( - subQueryIdentity); - String endIndent = " "; - clause = realColumnName + " " + inScopeOption + "in (" + beginMark - + subQueryClause + ln + endIndent + ")" + endMark; - } else { - clause = realColumnName + " " + inScopeOption + "in (" - + subQueryClause + ")"; - } + String ln = getLineSeparator(); + int subQueryLevel = subQuery.getSubQueryLevel(); + String subQueryIdentity = propertyName + "[" + subQueryLevel + "]"; + String beginMark = getSqlClause().resolveSubQueryBeginMark( + subQueryIdentity) + + ln; + String endMark = getSqlClause() + .resolveSubQueryEndMark(subQueryIdentity); + String endIndent = " "; + String clause = realColumnName + " " + inScopeOption + "in (" + + beginMark + subQueryClause + ln + endIndent + ")" + endMark; registerWhereClause(clause); } @@ -728,22 +708,11 @@ protected String getInScopeSubQuerySql(ConditionQuery subQuery, String relatedColumnName, String propertyName) { - String selectClause = "select " - + getSqlClause().getLocalTableAliasName() + "." + String tableAliasName = getSqlClause().getLocalTableAliasName(); + String selectClause = "select " + tableAliasName + "." + relatedColumnName; - String fromWhereClause = subQuery.getSqlClause() - .getClauseFromWhereWithUnionTemplate(); - fromWhereClause = replaceString(fromWhereClause, ".conditionQuery.", - "." + getLocationBase(propertyName) + ".");// Very Important! - - // Replace template marks. These are very important! - fromWhereClause = replaceString(fromWhereClause, getSqlClause() - .getUnionSelectClauseMark(), selectClause); - fromWhereClause = replaceString(fromWhereClause, getSqlClause() - .getUnionWhereClauseMark(), ""); - fromWhereClause = replaceString(fromWhereClause, getSqlClause() - .getUnionWhereFirstConditionMark(), ""); - + String fromWhereClause = buildPlainSubQueryFromWhereClause(subQuery, + relatedColumnName, propertyName, selectClause, tableAliasName); return selectClause + " " + fromWhereClause; } @@ -769,24 +738,20 @@ assertObjectNotNull("ExistsSubQyery(" + columnName + ")", subQuery); existsOption = existsOption != null ? existsOption + " " : ""; String realColumnName = getExistsSubQueryRealColumnName(columnName); + xincrementLocalSubQueryLevelIfNeeds(subQuery); String subQueryClause = getExistsSubQuerySql(subQuery, realColumnName, relatedColumnName, propertyName); - String clause = null; - if (getSqlClause().isFormatClauseEffective()) { - String ln = getLineSeparator(); - int subQueryLevel = subQuery.getSubQueryLevel(); - String subQueryIdentity = propertyName + "[" + subQueryLevel + "]"; - String beginMark = getSqlClause().resolveSubQueryBeginMark( - subQueryIdentity) - + ln; - String endMark = getSqlClause().resolveSubQueryEndMark( - subQueryIdentity); - String endIndent = " "; - clause = existsOption + "exists (" + beginMark + subQueryClause - + ln + endIndent + ")" + endMark; - } else { - clause = existsOption + "exists (" + subQueryClause + ")"; - } + String ln = getLineSeparator(); + int subQueryLevel = subQuery.getSubQueryLevel(); + String subQueryIdentity = propertyName + "[" + subQueryLevel + "]"; + String beginMark = getSqlClause().resolveSubQueryBeginMark( + subQueryIdentity) + + ln; + String endMark = getSqlClause() + .resolveSubQueryEndMark(subQueryIdentity); + String endIndent = " "; + String clause = existsOption + "exists (" + beginMark + subQueryClause + + ln + endIndent + ")" + endMark; registerWhereClause(clause); } @@ -801,134 +766,116 @@ protected String getExistsSubQuerySql(ConditionQuery subQuery, String realColumnName, String relatedColumnName, String propertyName) { int subQueryLevel = subQuery.getSubQueryLevel(); - if (_subQueryLevel <= subQueryLevel) { - _subQueryLevel = subQueryLevel + 1; - } String tableAliasName = "dfsublocal_" + subQueryLevel; String selectClause = "select " + tableAliasName + "." + relatedColumnName; - String fromWhereClause = subQuery.getSqlClause() - .getClauseFromWhereWithWhereUnionTemplate(); - fromWhereClause = replaceString(fromWhereClause, "dflocal", - tableAliasName);// Very Important! - fromWhereClause = replaceString(fromWhereClause, ".conditionQuery.", - "." + getLocationBase(propertyName) + ".");// Very Important! - - String joinCondition = tableAliasName + "." + relatedColumnName + " = " - + realColumnName; - String firstConditionAfter = " and "; - if (getSqlClause().isFormatClauseEffective()) { - firstConditionAfter = getLineSeparator() + " and "; - } - - // Replace template marks. These are very important! - fromWhereClause = replaceString(fromWhereClause, getSqlClause() - .getWhereClauseMark(), "where " + joinCondition); - fromWhereClause = replaceString(fromWhereClause, getSqlClause() - .getWhereFirstConditionMark(), joinCondition - + firstConditionAfter); - fromWhereClause = replaceString(fromWhereClause, getSqlClause() - .getUnionSelectClauseMark(), selectClause); - fromWhereClause = replaceString(fromWhereClause, getSqlClause() - .getUnionWhereClauseMark(), "where " + joinCondition); - fromWhereClause = replaceString(fromWhereClause, getSqlClause() - .getUnionWhereFirstConditionMark(), joinCondition - + firstConditionAfter); - + String fromWhereClause = buildCorrelationSubQueryFromWhereClause( + subQuery, relatedColumnName, propertyName, selectClause, + tableAliasName, realColumnName); return selectClause + " " + fromWhereClause; } // [DBFlute-0.7.4] // ----------------------------------------------------- - // DeriveSubQuery - // -------------- - protected void registerDeriveSubQuery(String function, + // DerivedReferrerSubQuery + // ----------------------- + protected void registerDerivedReferrerSubQuery(String function, ConditionQuery subQuery, String columnName, String relatedColumnName, String propertyName, String aliasName) { - assertObjectNotNull("DeriveSubQuery(" + columnName + ")", subQuery); - final String realColumnName = getDeriveSubQueryRealColumnName(columnName); - final String subQueryClause = getDeriveSubQuerySql(function, subQuery, - realColumnName, relatedColumnName, propertyName, aliasName); - final String clause; - if (getSqlClause().isFormatClauseEffective()) { - final String ln = getLineSeparator(); - final int subQueryLevel = subQuery.getSubQueryLevel(); - final String subQueryIdentity = propertyName + "[" + subQueryLevel - + "]"; - final String beginMark = getSqlClause().resolveSubQueryBeginMark( - subQueryIdentity) - + ln; - final String endMark = getSqlClause().resolveSubQueryEndMark( - subQueryIdentity); - final String endIndent = " "; - clause = "(" + beginMark + subQueryClause + ln + endIndent - + ") as " + aliasName + endMark; - } else { - clause = "(" + subQueryClause + ") as " + aliasName; - } + assertObjectNotNull("DerivedReferrerSubQuery(function)", function); + assertObjectNotNull("DerivedReferrerSubQuery(" + columnName + ")", + subQuery); + String realColumnName = getDerivedReferrerSubQueryRealColumnName(columnName); + xincrementLocalSubQueryLevelIfNeeds(subQuery); + String subQueryClause = getDerivedReferrerSubQuerySql(function, + subQuery, realColumnName, relatedColumnName, propertyName, + aliasName); + String ln = getLineSeparator(); + int subQueryLevel = subQuery.getSubQueryLevel(); + String subQueryIdentity = propertyName + "[" + subQueryLevel + "]"; + String beginMark = getSqlClause().resolveSubQueryBeginMark( + subQueryIdentity) + + ln; + String endMark = getSqlClause() + .resolveSubQueryEndMark(subQueryIdentity); + String endIndent = " "; + String clause = "(" + beginMark + subQueryClause + ln + endIndent + + ") " + aliasName + endMark; getSqlClause().specifyDeriveSubQuery(aliasName, clause); } - protected String getDeriveSubQueryRealColumnName(String columnName) { + protected String getDerivedReferrerSubQueryRealColumnName(String columnName) { return getRealColumnName(columnName); } - protected String getDeriveSubQuerySql(String function, + protected String getDerivedReferrerSubQuerySql(String function, ConditionQuery subQuery, String realColumnName, String relatedColumnName, String propertyName, String aliasName) { - final int subQueryLevel = subQuery.getSubQueryLevel(); - if (_subQueryLevel <= subQueryLevel) { - _subQueryLevel = subQueryLevel + 1; - } - final String tableAliasName = "dfsublocal_" + subQueryLevel; - final String deriveColumnName = subQuery.getSqlClause() + int subQueryLevel = subQuery.getSubQueryLevel(); + String tableAliasName = "dfsublocal_" + subQueryLevel; + String deriveColumnName = subQuery.getSqlClause() .getSpecifiedColumnNameAsOne(); if (deriveColumnName == null || deriveColumnName.trim().length() == 0) { - throwDeriveReferrerInvalidColumnSpecificationException(function, + throwDerivedReferrerInvalidColumnSpecificationException(function, aliasName); } - assertDeriveReferrerColumnType(function, subQuery, deriveColumnName); - subQuery.getSqlClause().clearSpecifiedSelectColumn(); - final String selectClause = "select " + function + "(" + tableAliasName - + "." + deriveColumnName + ")"; - String fromWhereClause = subQuery.getSqlClause() - .getClauseFromWhereWithWhereUnionTemplate(); - fromWhereClause = replaceString(fromWhereClause, "dflocal", - tableAliasName);// Very Important! - fromWhereClause = replaceString(fromWhereClause, ".conditionQuery.", - "." + getLocationBase(propertyName) + ".");// Very Important! - - final String joinCondition = tableAliasName + "." + relatedColumnName - + " = " + realColumnName; - String firstConditionAfter = " and "; - if (getSqlClause().isFormatClauseEffective()) { - firstConditionAfter = getLineSeparator() + " and "; + assertDerivedReferrerColumnType(function, subQuery, deriveColumnName); + subQuery.getSqlClause().clearSpecifiedSelectColumn(); // specified + // columns + // disappear at + // this timing + String connect = xbuildFunctionConnector(function); + if (subQuery.getSqlClause().hasUnionQuery()) { + String ln = getLineSeparator(); + String subQueryIdentity = propertyName + "[" + subQueryLevel + + ":subquerymain]"; + String beginMark = getSqlClause().resolveSubQueryBeginMark( + subQueryIdentity) + + ln; + String endMark = getSqlClause().resolveSubQueryEndMark( + subQueryIdentity); + DBMeta dbmeta = DBMetaInstanceHandler.findDBMeta(subQuery + .getTableDbName()); + if (!dbmeta.hasPrimaryKey() || dbmeta.hasTwoOrMorePrimaryKeys()) { + String msg = "The derived-referrer is unsupported when no primary key or two-or-more primary keys:"; + msg = msg + " table=" + subQuery.getTableDbName(); + throw new UnsupportedOperationException(msg); + } + String primaryKeyName = dbmeta.getPrimaryUniqueInfo() + .getFirstColumn().getColumnDbName(); + String selectClause = "select " + tableAliasName + "." + + primaryKeyName + ", " + tableAliasName + "." + + relatedColumnName + ", " + tableAliasName + "." + + deriveColumnName; + String fromWhereClause = buildPlainSubQueryFromWhereClause( + subQuery, relatedColumnName, propertyName, selectClause, + tableAliasName); + String mainSql = selectClause + " " + fromWhereClause; + String joinCondition = "dfsubquerymain." + relatedColumnName + + " = " + realColumnName; + return "select " + function + connect + "dfsubquerymain." + + deriveColumnName + ")" + ln + " from (" + beginMark + + mainSql + ln + " ) dfsubquerymain" + endMark + ln + + " where " + joinCondition; + } else { + String selectClause = "select " + function + connect + + tableAliasName + "." + deriveColumnName + ")"; + String fromWhereClause = buildCorrelationSubQueryFromWhereClause( + subQuery, relatedColumnName, propertyName, selectClause, + tableAliasName, realColumnName); + return selectClause + " " + fromWhereClause; } - - // Replace template marks. These are very important! - fromWhereClause = replaceString(fromWhereClause, getSqlClause() - .getWhereClauseMark(), "where " + joinCondition); - fromWhereClause = replaceString(fromWhereClause, getSqlClause() - .getWhereFirstConditionMark(), joinCondition - + firstConditionAfter); - fromWhereClause = replaceString(fromWhereClause, getSqlClause() - .getUnionSelectClauseMark(), selectClause); - fromWhereClause = replaceString(fromWhereClause, getSqlClause() - .getUnionWhereClauseMark(), "where " + joinCondition); - fromWhereClause = replaceString(fromWhereClause, getSqlClause() - .getUnionWhereFirstConditionMark(), joinCondition - + firstConditionAfter); - - return selectClause + " " + fromWhereClause; } - protected void throwDeriveReferrerInvalidColumnSpecificationException( + protected void throwDerivedReferrerInvalidColumnSpecificationException( String function, String aliasName) { + String method = xconvertFunctionToMethod(function); String msg = "Look! Read the message below." + getLineSeparator(); msg = msg + "/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *" + getLineSeparator(); - msg = msg + "The specified the column for derive-referrer was Invalid!" + msg = msg + + "The specified the column for derived-referrer was Invalid!" + getLineSeparator(); msg = msg + getLineSeparator(); msg = msg + "[Advice]" + getLineSeparator(); @@ -941,7 +888,7 @@ msg = msg + " /- - - - - - - - - - - - - - - - - - - - " + getLineSeparator(); msg = msg + " MemberCB cb = new MemberCB();" + getLineSeparator(); - msg = msg + " cb.specify().derivePurchaseList()." + function + msg = msg + " cb.specify().derivePurchaseList()." + method + "(new SubQuery() {" + getLineSeparator(); msg = msg + " public void query(PurchaseCB subCB) {" + getLineSeparator(); @@ -955,7 +902,7 @@ msg = msg + " /- - - - - - - - - - - - - - - - - - - - " + getLineSeparator(); msg = msg + " MemberCB cb = new MemberCB();" + getLineSeparator(); - msg = msg + " cb.specify().derivePurchaseList()." + function + msg = msg + " cb.specify().derivePurchaseList()." + method + "(new SubQuery() {" + getLineSeparator(); msg = msg + " public void query(PurchaseCB subCB) {" + getLineSeparator(); @@ -973,7 +920,7 @@ msg = msg + " /- - - - - - - - - - - - - - - - - - - - " + getLineSeparator(); msg = msg + " MemberCB cb = new MemberCB();" + getLineSeparator(); - msg = msg + " cb.specify().derivePurchaseList()." + function + msg = msg + " cb.specify().derivePurchaseList()." + method + "(new SubQuery() {" + getLineSeparator(); msg = msg + " public void query(PurchaseCB subCB) {" + getLineSeparator(); @@ -988,19 +935,19 @@ msg = msg + "[Alias Name]" + getLineSeparator() + aliasName + getLineSeparator(); msg = msg + "* * * * * * * * * */"; - throw new DeriveReferrerInvalidColumnSpecificationException(msg); + throw new DerivedReferrerInvalidColumnSpecificationException(msg); } - public static class DeriveReferrerInvalidColumnSpecificationException + public static class DerivedReferrerInvalidColumnSpecificationException extends RuntimeException { private static final long serialVersionUID = 1L; - public DeriveReferrerInvalidColumnSpecificationException(String msg) { + public DerivedReferrerInvalidColumnSpecificationException(String msg) { super(msg); } } - protected void assertDeriveReferrerColumnType(String function, + protected void assertDerivedReferrerColumnType(String function, ConditionQuery subQuery, String deriveColumnName) { final DBMeta dbmeta = DBMetaInstanceHandler.findDBMeta(subQuery .getTableDbName()); @@ -1009,13 +956,13 @@ if ("sum".equalsIgnoreCase(function) || "avg".equalsIgnoreCase(function)) { if (!Number.class.isAssignableFrom(deriveColumnType)) { - throwDeriveReferrerUnmatchedColumnTypeException(function, + throwDerivedReferrerUnmatchedColumnTypeException(function, deriveColumnName, deriveColumnType); } } } - protected void throwDeriveReferrerUnmatchedColumnTypeException( + protected void throwDerivedReferrerUnmatchedColumnTypeException( String function, String deriveColumnName, Class deriveColumnType) { String msg = "Look! Read the message below." + getLineSeparator(); msg = msg @@ -1040,19 +987,366 @@ msg = msg + "[Derive Column]" + getLineSeparator() + deriveColumnName + "(" + deriveColumnType.getName() + ")" + getLineSeparator(); msg = msg + "* * * * * * * * * */"; - throw new DeriveReferrerUnmatchedColumnTypeException(msg); + throw new DerivedReferrerUnmatchedColumnTypeException(msg); } - public static class DeriveReferrerUnmatchedColumnTypeException extends + public static class DerivedReferrerUnmatchedColumnTypeException extends RuntimeException { private static final long serialVersionUID = 1L; - public DeriveReferrerUnmatchedColumnTypeException(String msg) { + public DerivedReferrerUnmatchedColumnTypeException(String msg) { super(msg); } } + // [DBFlute-0.8.8] // ----------------------------------------------------- + // ScalarSubQuery + // -------------- + protected void registerScalarSubQuery(String function, + ConditionQuery subQuery, String propertyName, String operand) { + assertObjectNotNull("ScalarSubQuery(" + propertyName + ")", subQuery); + + // Get the specified column before it disappears at sub-query making. + String deriveRealColumnName; + { + String deriveColumnName = subQuery.getSqlClause() + .getSpecifiedColumnNameAsOne(); + if (deriveColumnName == null + || deriveColumnName.trim().length() == 0) { + throwScalarSubQueryInvalidColumnSpecificationException(function); + } + deriveRealColumnName = getScalarSubQueryRealColumnName(deriveColumnName); + } + + xincrementLocalSubQueryLevelIfNeeds(subQuery); + String subQueryClause = getScalarSubQuerySql(function, subQuery, + propertyName); + String ln = getLineSeparator(); + int subQueryLevel = subQuery.getSubQueryLevel(); + String subQueryIdentity = propertyName + "[" + subQueryLevel + "]"; + String beginMark = getSqlClause().resolveSubQueryBeginMark( + subQueryIdentity) + + ln; + String endMark = getSqlClause() + .resolveSubQueryEndMark(subQueryIdentity); + String endIndent = " "; + String clause = deriveRealColumnName + " " + operand + " (" + beginMark + + subQueryClause + ln + endIndent + ") " + endMark; + registerWhereClause(clause); + } + + protected String getScalarSubQueryRealColumnName(String columnName) { + return getRealColumnName(columnName); + } + + protected String getScalarSubQuerySql(String function, + ConditionQuery subQuery, String propertyName) { + int subQueryLevel = subQuery.getSubQueryLevel(); + String tableAliasName = "dfsublocal_" + subQueryLevel; + String deriveColumnName = subQuery.getSqlClause() + .getSpecifiedColumnNameAsOne(); + if (deriveColumnName == null || deriveColumnName.trim().length() == 0) { + throwScalarSubQueryInvalidColumnSpecificationException(function); + } + assertScalarSubQueryColumnType(function, subQuery, deriveColumnName); + subQuery.getSqlClause().clearSpecifiedSelectColumn(); // specified + // columns + // disappear at + // this timing + DBMeta dbmeta = DBMetaInstanceHandler.findDBMeta(subQuery + .getTableDbName()); + if (!dbmeta.hasPrimaryKey() || dbmeta.hasTwoOrMorePrimaryKeys()) { + String msg = "The scalar-sub-query is unsupported when no primary key or two-or-more primary keys:"; + msg = msg + " table=" + subQuery.getTableDbName(); + throw new UnsupportedOperationException(msg); + } + String primaryKeyName = dbmeta.getPrimaryUniqueInfo().getFirstColumn() + .getColumnDbName(); + if (subQuery.getSqlClause().hasUnionQuery()) { + String ln = getLineSeparator(); + String subQueryIdentity = propertyName + "[" + subQueryLevel + + ":subquerymain]"; + String beginMark = getSqlClause().resolveSubQueryBeginMark( + subQueryIdentity) + + ln; + String endMark = getSqlClause().resolveSubQueryEndMark( + subQueryIdentity); + String selectClause = "select " + tableAliasName + "." + + primaryKeyName + ", " + tableAliasName + "." + + deriveColumnName; + String fromWhereClause = buildPlainSubQueryFromWhereClause( + subQuery, primaryKeyName, propertyName, selectClause, + tableAliasName); + String mainSql = selectClause + " " + fromWhereClause; + return "select " + function + "(dfsubquerymain." + deriveColumnName + + ")" + ln + " from (" + beginMark + mainSql + ln + + " ) dfsubquerymain" + endMark; + } else { + String selectClause = "select " + function + "(" + tableAliasName + + "." + deriveColumnName + ")"; + String fromWhereClause = buildPlainSubQueryFromWhereClause( + subQuery, primaryKeyName, propertyName, selectClause, + tableAliasName); + return selectClause + " " + fromWhereClause; + } + } + + protected void throwScalarSubQueryInvalidColumnSpecificationException( + String function) { + String msg = "Look! Read the message below." + getLineSeparator(); + msg = msg + + "/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *" + + getLineSeparator(); + msg = msg + + "The specified the column for derived-referrer was Invalid!" + + getLineSeparator(); + msg = msg + getLineSeparator(); + msg = msg + "[Advice]" + getLineSeparator(); + msg = msg + + " You should call specify().column[TargetColumn]() only once." + + getLineSeparator(); + msg = msg + " For example:" + getLineSeparator(); + msg = msg + " " + getLineSeparator(); + msg = msg + " [Wrong]" + getLineSeparator(); + msg = msg + " /- - - - - - - - - - - - - - - - - - - - " + + getLineSeparator(); + msg = msg + " MemberCB cb = new MemberCB();" + getLineSeparator(); + msg = msg + " cb.query().scalar_Equal()." + function + + "(new SubQuery() {" + getLineSeparator(); + msg = msg + " public void query(MemberCB subCB) {" + + getLineSeparator(); + msg = msg + " // *No! It's empty!" + getLineSeparator(); + msg = msg + " }" + getLineSeparator(); + msg = msg + " });" + getLineSeparator(); + msg = msg + " - - - - - - - - - -/" + getLineSeparator(); + msg = msg + " " + getLineSeparator(); + msg = msg + " [Wrong]" + getLineSeparator(); + msg = msg + " /- - - - - - - - - - - - - - - - - - - - " + + getLineSeparator(); + msg = msg + " MemberCB cb = new MemberCB();" + getLineSeparator(); + msg = msg + " cb.query().scalar_Equal()." + function + + "(new SubQuery() {" + getLineSeparator(); + msg = msg + " public void query(MemberCB subCB) {" + + getLineSeparator(); + msg = msg + " subCB.specify().columnMemberBirthday();" + + getLineSeparator(); + msg = msg + + " subCB.specify().columnMemberName(); // *No! It's duplicated!" + + getLineSeparator(); + msg = msg + " }" + getLineSeparator(); + msg = msg + " });" + getLineSeparator(); + msg = msg + " - - - - - - - - - -/" + getLineSeparator(); + msg = msg + " " + getLineSeparator(); + msg = msg + " [Good!]" + getLineSeparator(); + msg = msg + " /- - - - - - - - - - - - - - - - - - - - " + + getLineSeparator(); + msg = msg + " MemberCB cb = new MemberCB();" + getLineSeparator(); + msg = msg + " cb.query().scalar_Equal()." + function + + "(new SubQuery() {" + getLineSeparator(); + msg = msg + " public void query(MemberCB subCB) {" + + getLineSeparator(); + msg = msg + + " subCB.specify().columnPurchaseDatetime(); // *Point!" + + getLineSeparator(); + msg = msg + " }" + getLineSeparator(); + msg = msg + " });" + getLineSeparator(); + msg = msg + " - - - - - - - - - -/" + getLineSeparator(); + msg = msg + "* * * * * * * * * */"; + throw new ScalarSubQueryInvalidColumnSpecificationException(msg); + } + + public static class ScalarSubQueryInvalidColumnSpecificationException + extends RuntimeException { + private static final long serialVersionUID = 1L; + + public ScalarSubQueryInvalidColumnSpecificationException(String msg) { + super(msg); + } + } + + protected void assertScalarSubQueryColumnType(String function, + ConditionQuery subQuery, String deriveColumnName) { + final DBMeta dbmeta = DBMetaInstanceHandler.findDBMeta(subQuery + .getTableDbName()); + final Class deriveColumnType = dbmeta.findColumnInfo( + deriveColumnName).getPropertyType(); + if ("sum".equalsIgnoreCase(function) + || "avg".equalsIgnoreCase(function)) { + if (!Number.class.isAssignableFrom(deriveColumnType)) { + throwScalarSubQueryUnmatchedColumnTypeException(function, + deriveColumnName, deriveColumnType); + } + } + } + + protected void throwScalarSubQueryUnmatchedColumnTypeException( + String function, String deriveColumnName, Class deriveColumnType) { + String msg = "Look! Read the message below." + getLineSeparator(); + msg = msg + + "/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *" + + getLineSeparator(); + msg = msg + + "The type of the specified the column unmatched with the function!" + + getLineSeparator(); + msg = msg + getLineSeparator(); + msg = msg + "[Advice]" + getLineSeparator(); + msg = msg + "You should confirm the list as follow:" + + getLineSeparator(); + msg = msg + " max() : String, Number, Date" + getLineSeparator(); + msg = msg + " min() : String, Number, Date" + getLineSeparator(); + msg = msg + " sum() : Number" + getLineSeparator(); + msg = msg + " avg() : Number" + getLineSeparator(); + msg = msg + getLineSeparator(); + msg = msg + "[Function]" + getLineSeparator() + function + + getLineSeparator(); + msg = msg + getLineSeparator(); + msg = msg + "[Derive Column]" + getLineSeparator() + deriveColumnName + + "(" + deriveColumnType.getName() + ")" + getLineSeparator(); + msg = msg + "* * * * * * * * * */"; + throw new ScalarSubQueryUnmatchedColumnTypeException(msg); + } + + public static class ScalarSubQueryUnmatchedColumnTypeException extends + RuntimeException { + private static final long serialVersionUID = 1L; + + public ScalarSubQueryUnmatchedColumnTypeException(String msg) { + super(msg); + } + } + + public static class SSQFunction { + protected SSQSetupper _setupper; + + public SSQFunction(SSQSetupper setupper) { + _setupper = setupper; + } + + public void max(SubQuery subQuery) { + _setupper.setup("max", subQuery); + } + + public void min(SubQuery subQuery) { + _setupper.setup("min", subQuery); + } + + public void sum(SubQuery subQuery) { + _setupper.setup("sum", subQuery); + } + + public void avg(SubQuery subQuery) { + _setupper.setup("avg", subQuery); + } + } + + protected static interface SSQSetupper { + public void setup(String function, SubQuery subQuery); + } + + // ----------------------------------------------------- + // SubQuery Common + // --------------- + protected String buildPlainSubQueryFromWhereClause(ConditionQuery subQuery, + String relatedColumnName, String propertyName, String selectClause, + String tableAliasName) { + String fromWhereClause = subQuery.getSqlClause() + .getClauseFromWhereWithUnionTemplate(); + + // Replace the alias names for local table with alias name of sub-query + // unique. + // However when it's inScope this replacement is unnecessary so comment + // out here. + // (Override base alias name at sub-query on SQL) + // So if the argument 'tableAliasName' is not null, replace it. + if (tableAliasName != null) { + fromWhereClause = replaceString(fromWhereClause, "dflocal", + tableAliasName); + } + + // Resolve the location path for the condition-query of sub-query. + fromWhereClause = replaceString(fromWhereClause, ".conditionQuery.", + "." + getLocationBase(propertyName) + "."); + + // Replace template marks. These are very important! + fromWhereClause = replaceString(fromWhereClause, getSqlClause() + .getUnionSelectClauseMark(), selectClause); + fromWhereClause = replaceString(fromWhereClause, getSqlClause() + .getUnionWhereClauseMark(), ""); + fromWhereClause = replaceString(fromWhereClause, getSqlClause() + .getUnionWhereFirstConditionMark(), ""); + return fromWhereClause; + } + + protected String buildCorrelationSubQueryFromWhereClause( + ConditionQuery subQuery, String relatedColumnName, + String propertyName, String selectClause, String tableAliasName, + String realColumnName) { + String fromWhereClause = subQuery.getSqlClause() + .getClauseFromWhereWithWhereUnionTemplate(); + + // Replace the alias names for local table with alias name of sub-query + // unique. + fromWhereClause = replaceString(fromWhereClause, "dflocal", + tableAliasName); + + // Resolve the location path for the condition-query of sub-query. + fromWhereClause = replaceString(fromWhereClause, ".conditionQuery.", + "." + getLocationBase(propertyName) + "."); + + String joinCondition = tableAliasName + "." + relatedColumnName + " = " + + realColumnName; + String firstConditionAfter = getLineSeparator() + " and "; + + // Replace template marks. These are very important! + fromWhereClause = replaceString(fromWhereClause, getSqlClause() + .getWhereClauseMark(), "where " + joinCondition); + fromWhereClause = replaceString(fromWhereClause, getSqlClause() + .getWhereFirstConditionMark(), joinCondition + + firstConditionAfter); + fromWhereClause = replaceString(fromWhereClause, getSqlClause() + .getUnionSelectClauseMark(), selectClause); + fromWhereClause = replaceString(fromWhereClause, getSqlClause() + .getUnionWhereClauseMark(), "where " + joinCondition); + fromWhereClause = replaceString(fromWhereClause, getSqlClause() + .getUnionWhereFirstConditionMark(), joinCondition + + firstConditionAfter); + return fromWhereClause; + } + + protected void xincrementLocalSubQueryLevelIfNeeds(ConditionQuery subQuery) { // Very + // Internal + int subQueryLevel = subQuery.getSubQueryLevel(); + if (_subQueryLevel <= subQueryLevel) { + _subQueryLevel = subQueryLevel + 1; + } + } + + protected String xbuildFunctionConnector(String function) { + if (function != null && function.endsWith("(distinct")) { // For example + // 'count(distinct' + return " "; + } else { + return "("; + } + } + + protected String xconvertFunctionToMethod(String function) { + if (function != null && function.contains("(")) { // For example + // 'count(distinct' + int index = function.indexOf("("); + String front = function.substring(0, index); + if (function.length() > front.length() + "(".length()) { + String rear = function.substring(index + "(".length()); + function = front + initCap(rear); + } else { + function = front; + } + } + return function; + } + + // ----------------------------------------------------- // Where Clause // ------------ protected void setupConditionValueAndRegisterWhereClause(ConditionKey key, @@ -1276,14 +1570,16 @@ // ========= // Fixed Condition // =============== - protected String prepareFixedCondition(String fixedCondition, - String localAliasName, String foreignAliasName) { + protected String ppFxCd(String fixedCondition, String localAliasName, + String foreignAliasName) { // prepareFixedCondition fixedCondition = replaceString(fixedCondition, "$$alias$$", foreignAliasName); fixedCondition = replaceString(fixedCondition, "$$foreignAlias$$", foreignAliasName); fixedCondition = replaceString(fixedCondition, "$$localAlias$$", localAliasName); + fixedCondition = replaceString(fixedCondition, "$$locationBase$$.", + "dto." + getLocationBase()); return fixedCondition; } @@ -1515,7 +1811,7 @@ return newList; } - public void doNss(NssCall callback) {// Very Internal + public void doNss(NssCall callback) { // Very Internal String foreignPropertyName = callback.qf().getForeignPropertyName(); String foreignTableAliasName = callback.qf().getRealAliasName(); getSqlClause().registerSelectedSelectColumn(foreignTableAliasName, @@ -1524,7 +1820,7 @@ callback.qf().getRelationPath(), foreignPropertyName); } - public static interface NssCall {// Very Internal + public static interface NssCall { // Very Internal public ConditionQuery qf(); } Modified: 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 2008-12-27 22:14:41 UTC (rev 1629) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/cbean/ConditionBean.java 2008-12-27 22:18:30 UTC (rev 1630) @@ -1,5 +1,7 @@ package jp.sf.pal.scheduler.db.allcommon.cbean; +import java.util.Map; + import jp.sf.pal.scheduler.db.allcommon.cbean.sqlclause.SqlClause; import jp.sf.pal.scheduler.db.allcommon.jdbc.StatementConfig; @@ -11,28 +13,6 @@ public interface ConditionBean extends PagingBean { //========================================================================== - // =========== - // Definition - // ========== - /** Map-string map-mark. */ - public static final String MAP_STRING_MAP_MARK = "map:"; - - /** Map-string list-mark. */ - public static final String MAP_STRING_LIST_MARK = "list:"; - - /** Map-string start-brace. */ - public static final String MAP_STRING_START_BRACE = "@{"; - - /** Map-string end-brace. */ - public static final String MAP_STRING_END_BRACE = "@}"; - - /** Map-string delimiter. */ - public static final String MAP_STRING_DELIMITER = "@;"; - - /** Map-string equal. */ - public static final String MAP_STRING_EQUAL = "@="; - - //========================================================================== // ========= // Table Name // ========== @@ -70,8 +50,7 @@ * * @param primaryKeyMap Primary-key map. (NotNull and NotEmpty) */ - public void acceptPrimaryKeyMap( - java.util.Map primaryKeyMap); + public void acceptPrimaryKeyMap(Map primaryKeyMap); /** * Accept primary-key map-string. Delimiter is at-mark and semicolon. @@ -105,14 +84,6 @@ // Query // ===== /** - * Get condition-query as interface. - * - * @return Instance of query as interface. (NotNull) - * @deprecated - */ - public ConditionQuery getConditionQueryAsInterface(); - - /** * Get the conditionQuery of the local table as interface. * * @return The conditionQuery of the local table as interface. (NotNull) @@ -131,32 +102,6 @@ public boolean hasUnionQueryOrUnionAllQuery(); //========================================================================== - // ========= - // Limit Select - // ============ - /** - * Limit select PK only. This is OLD style. You can do the same thing by - * specify(). - * - * @return this. (NotNull) - */ - public ConditionBean limitSelect_PKOnly(); - - /** - * Limit select off. - * - * @return this. (NotNull) - */ - public ConditionBean limitSelect_Off(); - - /** - * Is limit-select PK only? - * - * @return Determination. - */ - public boolean isLimitSelect_PKOnly(); - - //========================================================================== // =========== // Lock Setting // ============ Modified: 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 2008-12-27 22:14:41 UTC (rev 1629) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/cbean/ConditionBeanContext.java 2008-12-27 22:18:30 UTC (rev 1630) @@ -1,10 +1,6 @@ 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.DBDef; 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; @@ -78,11 +74,35 @@ //========================================================================== // ========= - // Initialize against the ClassLoader Headache - // =========================================== + // Type Determination + // ================== + /** + * Is the argument condition-bean? + * + * @param dtoInstance DTO instance. + * @return Determination. + */ + public static boolean isTheArgumentConditionBean(final Object dtoInstance) { + return dtoInstance instanceof ConditionBean; + } + + /** + * Is the type condition-bean? + * + * @param dtoClass DtoClass. + * @return Determination. + */ + public static boolean isTheTypeConditionBean(final Class dtoClass) { + return ConditionBean.class.isAssignableFrom(dtoClass); + } + + //========================================================================== + // ========= + // Cool Classes + // ============ @SuppressWarnings("unused") - public static void initialize() { - boolean debugEnabled = _log.isDebugEnabled(); + public static void loadCoolClasses() { + boolean debugEnabled = false; // If you watch the log, set this true. // Against the ClassLoader Headache! final StringBuilder sb = new StringBuilder(); { @@ -119,120 +139,6 @@ //========================================================================== // ========= - // Type Determination - // ================== - /** - * Is the argument condition-bean? - * - * @param dtoInstance DTO instance. - * @return Determination. - */ - public static boolean isTheArgumentConditionBean(final Object dtoInstance) { - if (dtoInstance instanceof ConditionBean) { - return true; - } else { - return false; - } - } - - /** - * Is the type condition-bean? - * - * @param dtoClass DtoClass. - * @return Determination. - */ - public static boolean isTheTypeConditionBean(final Class dtoClass) { - if (ConditionBean.class.isAssignableFrom(dtoClass)) { - return true; - } else { - return false; - } - } - - //========================================================================== - // ========= - // Product Name - // ============ - public static final String DB_NAME_DERBY = "derby"; - - public static final String DB_NAME_H2 = "h2"; - - public static final String DB_NAME_ORACLE = "oracle"; - - public static final String DB_NAME_MYSQL = "mysql"; - - public static final String DB_NAME_POSTGRESQL = "postgresql"; - - public static final String DB_NAME_FIREBIRD = "firebird"; - - public static final String DB_NAME_MSSQL = "mssql"; - - public static final String DB_NAME_SYBASE = "sybase"; - - public static final String DB_NAME_DB2 = "db2"; - - protected static final Map _driverHintDatabaseProductNameMap; - static { - final Map tmpMap = Collections - .synchronizedMap(new LinkedHashMap()); - 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 keySet = _driverHintDatabaseProductNameMap - .keySet(); - for (final java.util.Iterator ite = keySet.iterator(); ite - .hasNext();) { - final String driverHint = (String) ite.next(); - if (driverClassName.indexOf(driverHint) >= 0) { - final String databaseProductName = (String) _driverHintDatabaseProductNameMap - .get(driverHint); - setDatabaseProductName(databaseProductName); - return true; - } - } - return false; - } - - /** The database product name. */ - private static String _databaseProductName; - - /** - * Get database product name. - * - * @return Database product name. - */ - public static String getDatabaseProductName() { - return _databaseProductName; - } - - /** - * Set database product name. - * - * @param name Database product name. (NotNull) - */ - public static void setDatabaseProductName(String name) { - if (_databaseProductName != null) { - String msg = "Already set up: current=" + _databaseProductName - + " your=" + name; - throw new IllegalStateException(msg); - } - _databaseProductName = name; - } - - //========================================================================== - // ========= // SqlClause Creator // ================= /** @@ -244,9 +150,6 @@ public static SqlClause createSqlClause(ConditionBean cb) { final String tableSqlName = cb.getTableSqlName(); final SqlClause sqlClause = createSqlClause(tableSqlName); - if (DBFluteConfig.getInstance().isConditionBeanFormatSql()) { - sqlClause.makeFormatClauseEffective(); - } return sqlClause; } @@ -257,27 +160,22 @@ * @return SQL-clause. (NotNull) */ public static SqlClause createSqlClause(String tableDbName) { - final String databaseProductName = getDatabaseProductName(); - if (databaseProductName == null) { - return new SqlClauseH2(tableDbName); - } - final String name = databaseProductName.toLowerCase(); - if (name.equalsIgnoreCase(DB_NAME_DERBY)) { - return new SqlClauseDerby(tableDbName); - } else if (name.equalsIgnoreCase(DB_NAME_H2)) { - return new SqlClauseH2(tableDbName); - } else if (name.equalsIgnoreCase(DB_NAME_ORACLE)) { - return new SqlClauseOracle(tableDbName); - } else if (name.equalsIgnoreCase(DB_NAME_FIREBIRD)) { - return new SqlClauseFirebird(tableDbName); - } else if (name.equalsIgnoreCase(DB_NAME_MYSQL)) { + if (DBDef.isCurrentDef(DBDef.MySQL)) { return new SqlClauseMySql(tableDbName); - } else if (name.equalsIgnoreCase(DB_NAME_POSTGRESQL)) { + } else if (DBDef.isCurrentDef(DBDef.PostgreSQL)) { return new SqlClausePostgreSql(tableDbName); - } else if (name.equalsIgnoreCase(DB_NAME_MSSQL)) { - return new SqlClauseSqlServer(tableDbName); - } else if (name.equalsIgnoreCase(DB_NAME_DB2)) { + } else if (DBDef.isCurrentDef(DBDef.Oracle)) { + return new SqlClauseOracle(tableDbName); + } else if (DBDef.isCurrentDef(DBDef.DB2)) { return new SqlClauseDb2(tableDbName); + } else if (DBDef.isCurrentDef(DBDef.SQLServer)) { + return new SqlClauseSqlServer(tableDbName); + } else if (DBDef.isCurrentDef(DBDef.FireBird)) { + return new SqlClauseFirebird(tableDbName); + } else if (DBDef.isCurrentDef(DBDef.H2)) { + return new SqlClauseH2(tableDbName); + } else if (DBDef.isCurrentDef(DBDef.Derby)) { + return new SqlClauseDerby(tableDbName); } else { return new SqlClauseH2(tableDbName); } @@ -362,12 +260,7 @@ // Display SQL // =========== public static String convertConditionBean2DisplaySql(ConditionBean cb) { - final String twoWaySql; - if (cb.isLimitSelect_PKOnly()) { - twoWaySql = cb.getSqlClause().getClausePKOnly(); - } else { - twoWaySql = cb.getSqlClause().getClause(); - } + final String twoWaySql = cb.getSqlClause().getClause(); return InternalSqlParser.convertTwoWaySql2DisplaySql(twoWaySql, cb); } @@ -390,31 +283,8 @@ errorCode); } - // [DBFlute-0.7.8] //========================================================================== // ========= - // Database Type - // ============= - /** - * Is the database Oracle? - * - * @return Is the database Oracle? - */ - public static boolean isOracle() { - return createSqlClause("dummy") instanceof SqlClauseOracle; - } - - /** - * Is the database PostgreSQL? - * - * @return Is the database PostgreSQL? - */ - public static boolean isPostgreSql() { - return createSqlClause("dummy") instanceof SqlClausePostgreSql; - } - - //========================================================================== - // ========= // Helper // ====== /** Modified: 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 2008-12-27 22:14:41 UTC (rev 1629) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/cbean/ConditionQuery.java 2008-12-27 22:18:30 UTC (rev 1630) @@ -8,7 +8,6 @@ * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public interface ConditionQuery { //========================================================================== Added: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/cbean/ScalarQuery.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/cbean/ScalarQuery.java (rev 0) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/cbean/ScalarQuery.java 2008-12-27 22:18:30 UTC (rev 1630) @@ -0,0 +1,5 @@ +package jp.sf.pal.scheduler.db.allcommon.cbean; + +public interface ScalarQuery { + public void query(CB cb); +} Property changes on: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/cbean/ScalarQuery.java ___________________________________________________________________ Name: svn:eol-style + native Deleted: 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 2008-12-27 22:14:41 UTC (rev 1629) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/cbean/SimpleOrderByBean.java 2008-12-27 22:18:30 UTC (rev 1630) @@ -1,165 +0,0 @@ -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; - } -} Modified: 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 2008-12-27 22:14:41 UTC (rev 1629) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/cbean/ckey/ConditionKey.java 2008-12-27 22:18:30 UTC (rev 1630) @@ -12,6 +12,10 @@ */ public abstract class ConditionKey { + //========================================================================== + // ========= + // Definition + // ========== /** Mark of replaced value. */ public static final String MARK_OF_REPLACED_VALUE = "ReplacedValue"; @@ -36,15 +40,18 @@ /** The condition key of prefixSearch. */ public static final ConditionKey CK_PREFIX_SEARCH = new ConditionKeyPrefixSearch(); - /** The condition key of likeSearch. */ - public static final ConditionKey CK_LIKE_SEARCH = new ConditionKeyLikeSearch(); - /** The condition key of inScope. */ public static final ConditionKey CK_IN_SCOPE = new ConditionKeyInScope(); /** The condition key of notInScope. */ public static final ConditionKey CK_NOT_IN_SCOPE = new ConditionKeyNotInScope(); + /** The condition key of likeSearch. */ + public static final ConditionKey CK_LIKE_SEARCH = new ConditionKeyLikeSearch(); + + /** The condition key of notLikeSearch. */ + public static final ConditionKey CK_NOT_LIKE_SEARCH = new ConditionKeyNotLikeSearch(); + /** The condition key of isNull. */ public static final ConditionKey CK_IS_NULL = new ConditionKeyIsNull(); @@ -54,31 +61,21 @@ /** Dummy-object for IsNull and IsNotNull and so on... */ protected static final Object DUMMY_OBJECT = new Object(); + //========================================================================== + // ========= + // Attribute + // ========= /** Condition-key. */ protected String _conditionKey; /** Operand. */ protected String _operand; + //========================================================================== + // ========= + // Validation + // ========== /** - * Get condition-key. - * - * @return Condition-key. - */ - public String getConditionKey() { - return _conditionKey; - } - - /** - * Get operand. - * - * @return Operand. - */ - public String getOperand() { - return _operand; - } - - /** * Is valid registration? * * @param conditionValue Condition value. (NotNull) @@ -89,6 +86,10 @@ abstract public boolean isValidRegistration(ConditionValue conditionValue, Object value, String callerName); + //========================================================================== + // ========= + // Where Clause + // ============ /** * Add where clause. * @@ -149,6 +150,10 @@ abstract protected void doAddWhereClause(List conditionList, String columnName, ConditionValue value, ConditionOption option); + //========================================================================== + // ========= + // Condition Value + // =============== /** * Setup condition value. * @@ -210,6 +215,10 @@ ConditionValue conditionValue, Object value, String location, ConditionOption option); + //========================================================================== + // ========= + // Bind Clause + // =========== /** * Build bind clause. (for s2dao) * @@ -269,6 +278,10 @@ return "%"; } + //========================================================================== + // ========= + // Basic Override + // ============== /** * The override. Returns hash-code of this condition-key string. * @@ -304,4 +317,26 @@ return "ConditionKey: " + getConditionKey() + " " + getOperand() + " wild-card=[" + getWildCard() + "]"; } + + //========================================================================== + // ========= + // Accessor + // ======== + /** + * Get condition-key. + * + * @return Condition-key. + */ + public String getConditionKey() { + return _conditionKey; + } + + /** + * Get operand. + * + * @return Operand. + */ + public String getOperand() { + return _operand; + } } Added: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/cbean/ckey/ConditionKeyNotLikeSearch.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/cbean/ckey/ConditionKeyNotLikeSearch.java (rev 0) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/cbean/ckey/ConditionKeyNotLikeSearch.java 2008-12-27 22:18:30 UTC (rev 1630) @@ -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 notLikeSearch. + * + * @author DBFlute(AutoGenerator) + */ +public class ConditionKeyNotLikeSearch extends ConditionKey { + + /** + * Constructor. + */ + protected ConditionKeyNotLikeSearch() { + _conditionKey = "notLikeSearch"; + _operand = "not like"; + } + + /** + * Is valid registration? + * + * @param conditionValue Condition value. (NotNull) + * @param value Value. (NotNull) + * @param callerName Caller name. (NotNull) + * @return Determination. + */ + public boolean isValidRegistration(ConditionValue conditionValue, + Object value, String callerName) { + if (value == null) { + return false; + } + return true; + } + + /** + * This method implements super#doAddWhereClause(). + * + * @param conditionList Condition list. (NotNull) + * @param columnName Column name. (NotNull) + * @param value Condition value. (NotNull) + */ + protected void doAddWhereClause(List 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 conditionList, + String columnName, ConditionValue value, ConditionOption option) { + if (option == null) { + String msg = "The argument[option] should not be null: columnName=" + + columnName + " value=" + value; + throw new IllegalArgumentException(msg); + } + if (!(option instanceof LikeSearchOption)) { + String msg = "The argument[option] should be LikeSearchOption: columnName=" + + columnName + " value=" + value; + throw new IllegalArgumentException(msg); + } + final LikeSearchOption myOption = (LikeSearchOption) option; + conditionList.add(buildBindClauseWithRearOption(columnName, value + .getNotLikeSearchLocation(), myOption.getRearOption())); + } + + /** + * This method implements super#doSetupConditionValue(). + * + * @param conditionValue Condition value. (NotNull) + * @param value Value. (NotNull) + * @param location Location. (NotNull) + */ + protected void doSetupConditionValue(ConditionValue conditionValue, + Object value, String location) { + throw new UnsupportedOperationException( + "doSetupConditionValue without condition-option is unsupported!!!"); + } + + /** + * This method implements super#doSetupConditionValue(). + * + * @param conditionValue Condition value. (NotNull) + * @param value Value. (NotNull) + * @param location Location. (NotNull) + * @param option Condition option. (NotNull) + */ + protected void doSetupConditionValue(ConditionValue conditionValue, + Object value, String location, ConditionOption option) { + conditionValue.setNotLikeSearch((String) value, + (LikeSearchOption) option).setNotLikeSearchLocation(location); + } +} Property changes on: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/cbean/ckey/ConditionKeyNotLikeSearch.java ___________________________________________________________________ Name: svn:eol-style + native Modified: 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 2008-12-27 22:14:41 UTC (rev 1629) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/cbean/coption/FromToOption.java 2008-12-27 22:18:30 UTC (rev 1630) @@ -1,5 +1,10 @@ package jp.sf.pal.scheduler.db.allcommon.cbean.coption; +import java.util.Calendar; +import java.util.Date; + +import jp.sf.pal.scheduler.db.allcommon.cbean.ckey.ConditionKey; + /** * The option of from-to. * @@ -85,60 +90,84 @@ // ========= // Internal Main // ============= - public java.util.Date filterFromDate(java.util.Date fromDate) { + /** + * Filter the date as From. It requires this method is called before + * getFromDateConditionKey(). + * + * @param fromDate The date as From. (Nullable: If the value is null, it + * returns null) + * @return The filtered date as From. (Nullable) + */ + public Date filterFromDate(Date fromDate) { if (fromDate == null) { return null; } if (_compareAsDate) { - final java.util.Calendar cal = java.util.Calendar.getInstance(); + final Calendar cal = Calendar.getInstance(); cal.setTimeInMillis(fromDate.getTime()); clearCalendarHourMinuteSecondMilli(cal); - final java.util.Date cloneDate = (java.util.Date) fromDate.clone(); + final Date cloneDate = (Date) fromDate.clone(); cloneDate.setTime(cal.getTimeInMillis()); return cloneDate; } return fromDate; } - public java.util.Date filterToDate(java.util.Date toDate) { + /** + * Filter the date as To. It requires this method is called before + * getToDateConditionKey(). + * + * @param toDate The date as To. (Nullable: If the value is null, it returns + * null) + * @return The filtered date as To. (Nullable) + */ + public Date filterToDate(Date toDate) { if (toDate == null) { return null; } if (_compareAsDate) { - final java.util.Calendar cal = java.util.Calendar.getInstance(); + final Calendar cal = Calendar.getInstance(); cal.setTimeInMillis(toDate.getTime()); clearCalendarHourMinuteSecondMilli(cal); addCalendarNextDay(cal);// Key Point! - final java.util.Date cloneDate = (java.util.Date) toDate.clone(); + final Date cloneDate = (Date) toDate.clone(); cloneDate.setTime(cal.getTimeInMillis()); return cloneDate; } return toDate; } - public jp.sf.pal.scheduler.db.allcommon.cbean.ckey.ConditionKey getFromDateConditionKey() { + /** + * Get the condition-key of the from-date. It requires this method is called + * after filterFromDate(). + * + * @return The condition-key of the from-date. (NotNull) + */ + public ConditionKey getFromDateConditionKey() { if (_compareAsDate) { - return jp.sf.pal.scheduler.db.allcommon.cbean.ckey.ConditionKey.CK_GREATER_EQUAL; + return ConditionKey.CK_GREATER_EQUAL; } if (_fromDateGreaterThan) { - return jp.sf.pal.scheduler.db.allcommon.cbean.ckey.ConditionKey.CK_GREATER_THAN;// Default - // ! + return ConditionKey.CK_GREATER_THAN;// Default! } else { - return jp.sf.pal.scheduler.db.allcommon.cbean.ckey.ConditionKey.CK_GREATER_EQUAL;// Default - // ! + return ConditionKey.CK_GREATER_EQUAL;// Default! } } - public jp.sf.pal.scheduler.db.allcommon.cbean.ckey.ConditionKey getToDateConditionKey() { + /** + * Get the condition-key of the to-date. It requires this method is called + * after filterToDate(). + * + * @return The condition-key of the to-date. (NotNull) + */ + public ConditionKey getToDateConditionKey() { if (_compareAsDate) { - return jp.sf.pal.scheduler.db.allcommon.cbean.ckey.ConditionKey.CK_LESS_THAN; + return ConditionKey.CK_LESS_THAN; } if (_toDateLessThan) { - return jp.sf.pal.scheduler.db.allcommon.cbean.ckey.ConditionKey.CK_LESS_THAN;// Default - // ! + return ConditionKey.CK_LESS_THAN;// Default! } else { - return jp.sf.pal.scheduler.db.allcommon.cbean.ckey.ConditionKey.CK_LESS_EQUAL;// Default - // ! + return ConditionKey.CK_LESS_EQUAL;// Default! } } @@ -146,15 +175,15 @@ // ========= // Calendar Helper // =============== - protected void addCalendarNextDay(java.util.Calendar cal) { - cal.add(java.util.Calendar.DAY_OF_MONTH, 1); + protected void addCalendarNextDay(Calendar cal) { + cal.add(Calendar.DAY_OF_MONTH, 1); } - protected void clearCalendarHourMinuteSecondMilli(java.util.Calendar cal) { - cal.clear(java.util.Calendar.MILLISECOND); - cal.clear(java.util.Calendar.SECOND); - cal.clear(java.util.Calendar.MINUTE); - cal.set(java.util.Calendar.HOUR_OF_DAY, cal - .getActualMinimum(java.util.Calendar.HOUR_OF_DAY)); + protected void clearCalendarHourMinuteSecondMilli(Calendar cal) { + cal.clear(Calendar.MILLISECOND); + cal.clear(Calendar.SECOND); + cal.clear(Calendar.MINUTE); + cal.set(Calendar.HOUR_OF_DAY, cal + .getActualMinimum(Calendar.HOUR_OF_DAY)); } } Modified: 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 2008-12-27 22:14:41 UTC (rev 1629) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/cbean/coption/LikeSearchOption.java 2008-12-27 22:18:30 UTC (rev 1630) @@ -4,6 +4,7 @@ import java.util.Iterator; import java.util.List; +import jp.sf.pal.scheduler.db.allcommon.DBDef; import jp.sf.pal.scheduler.db.allcommon.cbean.coption.parts.local.JapaneseOptionPartsAgent; /** @@ -230,6 +231,10 @@ String tmp = replace(value, _escape, _escape + _escape); tmp = replace(tmp, "%", _escape + "%"); tmp = replace(tmp, "_", _escape + "_"); + if (DBDef.isCurrentDef(DBDef.Oracle)) { + tmp = replace(tmp, "\uff05", _escape + "\uff05"); + tmp = replace(tmp, "\uff3f", _escape + "\uff3f"); + } value = tmp; } final String wildCard = "%"; Modified: 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 2008-12-27 22:14:41 UTC (rev 1629) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/cbean/cvalue/ConditionValue.java 2008-12-27 22:18:30 UTC (rev 1630) @@ -6,9 +6,10 @@ 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.util.SimpleTypeUtil; /** - * Condition value. + * Condition-value. * * @author DBFlute(AutoGenerator) */ @@ -578,110 +579,9 @@ //========================================================================== // ========= - // Like Search - // =========== - /** Value of likeSearch. */ - protected List _likeSearch; - - /** Value of likeSearch for spare. */ - protected List _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(); - _likeSearch4Spare = new ArrayList(); - } - if (_likeSearch.isEmpty() && !_likeSearch4Spare.isEmpty()) { - for (int index = 0; index < _likeSearch4Spare.size(); index++) { - _likeSearch.add(_likeSearch4Spare.get(index)); - } - } - LikeSearchValue likeSearchValue = new LikeSearchValue(value, option); - _likeSearch.add(likeSearchValue); - _likeSearch4Spare.add(likeSearchValue); - return this; - } - - /** Location of likeSearch. */ - protected String _likeSearchLocation; - - /** - * Get the location of likeSearch. - * - * @return The location of likeSearch. (Nullable) - */ - public String getLikeSearchLocation() { - return _likeSearchLocation; - } - - /** - * Set the location of likeSearch. - * - * @param location The location of likeSearch. (Nullable) - * @return this. (NotNull) - */ - public ConditionValue setLikeSearchLocation(String location) { - _likeSearchLocation = location; - return this; - } - - protected static class LikeSearchValue { - protected String _value; - - protected LikeSearchOption _option; - - public LikeSearchValue(String value, LikeSearchOption option) { - _value = value; - _option = option; - } - - public String getValue() { - return _value; - } - - public LikeSearchOption getOption() { - return _option; - } - - public String generateRealValue() { - if (_option == null) { - return _value; - } - return _option.generateRealValue(_value); - } - } - - //========================================================================== - // ========= // In Scope // ======== - /** Value of inScope. */ + /** The value of inScope. */ protected List _inScope; protected InScopeOption _inScopeOption; @@ -774,7 +674,7 @@ // ========= // Not In Scope // ============ - /** Value of notInScope. */ + /** The value of notInScope. */ protected List _notInScope; /** @@ -852,6 +752,207 @@ //========================================================================== // ========= + // Like Search + // =========== + /** The value of likeSearch. */ + protected List _likeSearch; + + /** The value of likeSearch for spare. */ + protected List _likeSearch4Spare; + + /** + * Get the value of likeSearch. + * + * @return The value of likeSearch. (Nullable) + */ + public String getLikeSearch() { + if (_likeSearch == null) { + return null; + } + if (_likeSearch.isEmpty() && !_likeSearch4Spare.isEmpty()) { + for (int index = 0; index < _likeSearch4Spare.size(); index++) { + _likeSearch.add(_likeSearch4Spare.get(index)); + } + } + final LikeSearchValue likeSearchValue = _likeSearch.remove(0); + return (String) filterValue(likeSearchValue.generateRealValue()); + } + + /** + * Set the value of likeSearch. + * + * @param value The value of likeSearch. (Nullable) + * @param option The option of likeSearch. (Nullable) + * @return this. (NotNull) + */ + public ConditionValue setLikeSearch(String value, LikeSearchOption option) { + if (_likeSearch == null) { + _likeSearch = new ArrayList(); + _likeSearch4Spare = new ArrayList(); + } + if (_likeSearch.isEmpty() && !_likeSearch4Spare.isEmpty()) { + for (int index = 0; index < _likeSearch4Spare.size(); index++) { + _likeSearch.add(_likeSearch4Spare.get(index)); + } + } + LikeSearchValue likeSearchValue = new LikeSearchValue(value, option); + _likeSearch.add(likeSearchValue); + _likeSearch4Spare.add(likeSearchValue); + return this; + } + + /** Location of likeSearch. */ + protected String _likeSearchLocation; + + /** + * Get the location of likeSearch. + * + * @return The location of likeSearch. (Nullable) + */ + public String getLikeSearchLocation() { + return _likeSearchLocation; + } + + /** + * Set the location of likeSearch. + * + * @param location The location of likeSearch. (Nullable) + * @return this. (NotNull) + */ + public ConditionValue setLikeSearchLocation(String location) { + _likeSearchLocation = location; + return this; + } + + protected static class LikeSearchValue { + protected String _value; + + protected LikeSearchOption _option; + + public LikeSearchValue(String value, LikeSearchOption option) { + _value = value; + _option = option; + } + + public String getValue() { + return _value; + } + + public LikeSearchOption getOption() { + return _option; + } + + public String generateRealValue() { + if (_option == null) { + return _value; + } + return _option.generateRealValue(_value); + } + } + + //========================================================================== + // ========= + // Not Like Search + // =============== + /** The value of notLikeSearch. */ + protected List _notLikeSearch; + + /** The value of notLikeSearch for spare. */ + protected List _notLikeSearch4Spare; + + /** + * Get the value of notLikeSearch. + * + * @return The value of notLikeSearch. (Nullable) + */ + public String getNotLikeSearch() { + if (_notLikeSearch == null) { + return null; + } + if (_notLikeSearch.isEmpty() && !_notLikeSearch4Spare.isEmpty()) { + for (int index = 0; index < _notLikeSearch4Spare.size(); index++) { + _notLikeSearch.add(_notLikeSearch4Spare.get(index)); + } + } + final NotLikeSearchValue notLikeSearchValue = _notLikeSearch.remove(0); + return (String) filterValue(notLikeSearchValue.generateRealValue()); + } + + /** + * Set the value of notLikeSearch. + * + * @param value The value of notLikeSearch. (Nullable) + * @param option The option of notLikeSearch. (Nullable) + * @return this. (NotNull) + */ + public ConditionValue setNotLikeSearch(String value, LikeSearchOption option) { + if (_notLikeSearch == null) { + _notLikeSearch = new ArrayList(); + _notLikeSearch4Spare = new ArrayList(); + } + if (_notLikeSearch.isEmpty() && !_notLikeSearch4Spare.isEmpty()) { + for (int index = 0; index < _notLikeSearch4Spare.size(); index++) { + _notLikeSearch.add(_notLikeSearch4Spare.get(index)); + } + } + NotLikeSearchValue notLikeSearchValue = new NotLikeSearchValue(value, + option); + _notLikeSearch.add(notLikeSearchValue); + _notLikeSearch4Spare.add(notLikeSearchValue); + return this; + } + + /** Location of notLikeSearch. */ + protected String _notLikeSearchLocation; + + /** + * Get the location of notLikeSearch. + * + * @return The location of notLikeSearch. (Nullable) + */ + public String getNotLikeSearchLocation() { + return _notLikeSearchLocation; + } + + /** + * Set the location of notLikeSearch. + * + * @param location The location of notLikeSearch. (Nullable) + * @return this. (NotNull) + */ + public ConditionValue setNotLikeSearchLocation(String location) { + _notLikeSearchLocation = location; + return this; + } + + protected static class NotLikeSearchValue { + protected String _value; + + protected LikeSearchOption _option; + + public NotLikeSearchValue(String value, LikeSearchOption option) { + _value = value; + _option = option; + } + + public String getValue() { + return _value; + } + + public LikeSearchOption getOption() { + return _option; + } + + public String generateRealValue() { + if (_option == null) { + return _value; + } + return _option.generateRealValue(_value); + } + } + + //========================================================================== + // ========= // Is Null // ======= /** Value of isNull. */ @@ -976,8 +1077,8 @@ * Filter value. If the value is instance of java.util.Date or * java.util.Calendar, returns value as java.sql.Date. * - * @param value Value. (Nullable) - * @return Filtered value. (Nullable) + * @param value The value. (Nullable) + * @return The filtered value. (Nullable) */ protected Object filterValue(Object value) { if (value == null) { @@ -991,18 +1092,18 @@ } if (value instanceof java.util.Date || value instanceof java.util.Calendar) { - return SqlDateConversionUtil.toDate(value); + return SimpleTypeUtil.toSqlDate(value); } else { return value; } } /** - * Filter value. If the value is instance of java.util.Date or + * Filter the list of value. If the value is instance of java.util.Date or * java.util.Calendar, returns value as java.sql.Date. * - * @param valueList Value-list. (Nullable) - * @return Filtered value-list. (Nullable) + * @param valueList The list of value. (Nullable) + * @return The filtered list of value. (Nullable) */ protected List filterValue(List valueList) { if (valueList == null || valueList.isEmpty()) { @@ -1015,204 +1116,4 @@ } return resultList; } - - protected static class SqlDateConversionUtil { - - private SqlDateConversionUtil() { - } - - public static java.sql.Date toDate(Object o) { - return toDate(o, null); - } - - public static java.sql.Date toDate(Object o, String pattern) { - if (o instanceof java.sql.Date) { - return (java.sql.Date) o; - } - java.util.Date date = DateConversionUtil.toDate(o, pattern); - if (date != null) { - return new java.sql.Date(date.getTime()); - } - return null; - } - } - - protected static class DateConversionUtil { - - private DateConversionUtil() { - } - - public static java.util.Date toDate(Object o) { - return toDate(o, null); - } - - public static java.util.Date toDate(Object o, String pattern) { - if (o == null) { - return null; - } else if (o instanceof String) { - return toDate((String) o, pattern); - } else if (o instanceof java.util.Date) { - return (java.util.Date) o; - } else if (o instanceof java.util.Calendar) { - return ((java.util.Calendar) o).getTime(); - } else { - return toDate(o.toString(), pattern); - } - } - - public static java.util.Date toDate(String s, String pattern) { - return toDate(s, pattern, java.util.Locale.getDefault()); - } - - public static java.util.Date toDate(String s, String pattern, - java.util.Locale locale) { - java.text.SimpleDateFormat sdf = getDateFormat(s, pattern, locale); - try { - return sdf.parse(s); - } catch (java.text.ParseException ex) { - throw new RuntimeException(ex); - } - } - - public static java.text.SimpleDateFormat getDateFormat(String s, - String pattern, java.util.Locale locale) { - if (pattern != null) { - return new java.text.SimpleDateFormat(pattern); - } - return getDateFormat(s, locale); - } - - public static java.text.SimpleDateFormat getDateFormat(String s, - java.util.Locale locale) { - String pattern = getPattern(locale); - String shortPattern = removeDelimiter(pattern); - String delimitor = findDelimiter(s); - if (delimitor == null) { - if (s.length() == shortPattern.length()) { - return new java.text.SimpleDateFormat(shortPattern); - } - if (s.length() == shortPattern.length() + 2) { - return new java.text.SimpleDateFormat(InternalStringUtil - .replace(shortPattern, "yy", "yyyy")); - } - } else { - String[] array = InternalStringUtil.split(s, delimitor); - for (int i = 0; i < array.length; ++i) { - if (array[i].length() == 4) { - pattern = InternalStringUtil.replace(pattern, "yy", - "yyyy"); - break; - } - } - return new java.text.SimpleDateFormat(pattern); - } - return new java.text.SimpleDateFormat(); - } - - public static java.text.SimpleDateFormat getDateFormat( - java.util.Locale locale) { - return new java.text.SimpleDateFormat(getPattern(locale)); - } - - public static java.text.SimpleDateFormat getY4DateFormat( - java.util.Locale locale) { - return new java.text.SimpleDateFormat(getY4Pattern(locale)); - } - - public static String getY4Pattern(java.util.Locale locale) { - String pattern = getPattern(locale); - if (pattern.indexOf("yyyy") < 0) { - pattern = InternalStringUtil.replace(pattern, "yy", "yyyy"); - } - return pattern; - } - - public static String getPattern(java.util.Locale locale) { - java.text.SimpleDateFormat df = (java.text.SimpleDateFormat) java.text.DateFormat - .getDateInstance(java.text.DateFormat.SHORT, locale); - String pattern = df.toPattern(); - int index = pattern.indexOf(' '); - if (index > 0) { - pattern = pattern.substring(0, index); - } - if (pattern.indexOf("MM") < 0) { - pattern = InternalStringUtil.replace(pattern, "M", "MM"); - } - if (pattern.indexOf("dd") < 0) { - pattern = InternalStringUtil.replace(pattern, "d", "dd"); - } - return pattern; - } - - public static String findDelimiter(String value) { - for (int i = 0; i < value.length(); ++i) { - char c = value.charAt(i); - if (Character.isDigit(c)) { - continue; - } - return Character.toString(c); - } - return null; - } - - public static String removeDelimiter(String pattern) { - StringBuffer buf = new StringBuffer(); - for (int i = 0; i < pattern.length(); ++i) { - char c = pattern.charAt(i); - if (c == 'y' || c == 'M' || c == 'd') { - buf.append(c); - } - } - return buf.toString(); - } - } - - protected static class InternalStringUtil { - public static final String[] EMPTY_STRINGS = new String[0]; - - private InternalStringUtil() { - } - - public static final boolean isEmpty(String text) { - return text == null || text.length() == 0; - } - - public static final String replace(String text, String fromText, - String toText) { - if (text == null || fromText == null || toText == null) { - return null; - } - StringBuffer buf = new StringBuffer(100); - int pos = 0; - int pos2 = 0; - while (true) { - pos = text.indexOf(fromText, pos2); - if (pos == 0) { - buf.append(toText); - pos2 = fromText.length(); - } else if (pos > 0) { - buf.append(text.substring(pos2, pos)); - buf.append(toText); - pos2 = pos + fromText.length(); - } else { - buf.append(text.substring(pos2)); - break; - } - } - return buf.toString(); - } - - public static String[] split(String str, String delim) { - if (str == null) { - return EMPTY_STRINGS; - } - List list = new java.util.ArrayList(); - java.util.StringTokenizer st = new java.util.StringTokenizer(str, - delim); - while (st.hasMoreElements()) { - list.add(st.nextToken()); - } - return (String[]) list.toArray(new String[list.size()]); - } - } } Modified: 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 2008-12-27 22:14:41 UTC (rev 1629) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/cbean/outsidesql/OutsideSqlContext.java 2008-12-27 22:18:30 UTC (rev 1630) @@ -1,17 +1,21 @@ package jp.sf.pal.scheduler.db.allcommon.cbean.outsidesql; +import java.io.BufferedReader; +import java.io.IOException; +import java.io.InputStream; +import java.io.InputStreamReader; +import java.io.Reader; + import jp.sf.pal.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.SimpleResourceUtil; 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. @@ -33,7 +37,7 @@ /** * Get outside-SQL context on thread. * - * @return Outside-SQL context. (Nullable) + * @return The context of outside-SQL. (Nullable) */ public static OutsideSqlContext getOutsideSqlContextOnThread() { return (OutsideSqlContext) _threadLocal.get(); @@ -42,7 +46,7 @@ /** * Set outside-SQL context on thread. * - * @param outsideSqlContext Outside-SQL context. (NotNull) + * @param outsideSqlContext The context of outside-SQL. (NotNull) */ public static void setOutsideSqlContextOnThread( OutsideSqlContext outsideSqlContext) { @@ -54,7 +58,7 @@ } /** - * Is existing outside-SQL context on thread? + * Is existing the context of outside-SQL on thread? * * @return Determination. */ @@ -63,7 +67,7 @@ } /** - * Clear outside-SQL context on thread. + * Clear the context of outside-SQL on thread. */ public static void clearOutsideSqlContextOnThread() { _threadLocal.set(null); @@ -77,12 +81,20 @@ String methodName, String path, Object pmb, OutsideSqlOption option, Object resultTypeSpecification) { final String pmbKey = (pmb != null ? pmb.getClass().getName() : "null"); - final String resultKey = (resultTypeSpecification != null ? ":" - + resultTypeSpecification : "null"); + final String resultKey; + if (resultTypeSpecification != null) { + if (resultTypeSpecification instanceof Class) { + resultKey = ((Class) resultTypeSpecification).getName(); + } else { + resultKey = resultTypeSpecification.toString(); + } + } else { + resultKey = "null"; + } final String tableDbName = option.getTableDbName(); final String generatedUniqueKey = option.generateUniqueKey(); - return methodName + "():" + tableDbName + ":" + path + ":" + pmbKey - + ":" + generatedUniqueKey + resultKey; + return tableDbName + ":" + methodName + "():" + path + ":" + pmbKey + + ":" + generatedUniqueKey + ":" + resultKey; } //========================================================================== @@ -116,18 +128,9 @@ // Attribute // ========= // ----------------------------------------------------- - // Common of OutsideSql - // -------------------- - protected boolean _dynamicBinding; - - protected boolean _offsetByCursorForcedly; - - protected boolean _limitByCursorForcedly; - - // ----------------------------------------------------- - // Specified OutsideSql - // -------------------- - /** The path of outside-sql. (The mark of Specified-OutsideSql) */ + // Basic + // ----- + /** The path of outside-SQL. (The mark of specified outside-SQL) */ protected String _outsideSqlPath; protected Object _parameterBean; @@ -136,12 +139,23 @@ protected String _methodName; - /** The config of statement. (Nullable) */ + /** The configuration of statement. (Nullable) */ protected StatementConfig _statementConfig; /** The DB name of table for using behavior-SQL-path. (Nullable) */ protected String _tableDbName; + // ----------------------------------------------------- + // Option + // ------ + protected boolean _dynamicBinding; + + protected boolean _offsetByCursorForcedly; + + protected boolean _limitByCursorForcedly; + + protected boolean _autoPagingLogging; // for logging + //========================================================================== // ========= // Read SQL @@ -200,7 +214,7 @@ } /** - * Read outside-sql path. Required attribute is 'outsideSqlPath'. + * Read outside-SQL path. Required attribute is 'outsideSqlPath'. * * @param sqlFileEncoding The encoding of SQL file. (NotNull) * @param dbmsSuffix The suffix of DBMS. (NotNull) @@ -214,6 +228,13 @@ String sql; if (isExistResource(dbmsPath)) { sql = readText(dbmsPath, sqlFileEncoding); + } else if ("_postgresql".equals(dbmsSuffix) + && isExistResource("_postgre")) { + sql = readText("_postgre", sqlFileEncoding); // Patch for name + // difference + } else if ("_sqlserver".equals(dbmsSuffix) && isExistResource("_mssql")) { + sql = readText("_mssql", sqlFileEncoding); // Patch for name + // difference } else if (isExistResource(standardPath)) { sql = readText(standardPath, sqlFileEncoding); } else { @@ -324,16 +345,46 @@ // General Helper // ============== protected boolean isExistResource(String path) { - return ResourceUtil.isExist(path); + return SimpleResourceUtil.isExist(path); } protected String readText(final String path, String sqlFileEncoding) { - final java.io.InputStream is = ResourceUtil.getResourceAsStream(path); - final java.io.Reader reader = InputStreamReaderUtil.create(is, - sqlFileEncoding); - return ReaderUtil.readText(reader); + final InputStream ins = SimpleResourceUtil.getResourceStream(path); + final Reader reader = createInputStreamReader(ins, sqlFileEncoding); + return readText(reader); } + protected Reader createInputStreamReader(InputStream ins, String encoding) { + try { + return new InputStreamReader(ins, encoding); + } catch (IOException e) { + String msg = "Failed to create the reader of the input stream:"; + msg = msg + " ins=" + ins + " encoding=" + encoding; + throw new IllegalStateException(msg, e); + } + } + + public String readText(Reader reader) { + final BufferedReader bfreader = new BufferedReader(reader); + final StringBuilder out = new StringBuilder(100); + try { + try { + final char[] buf = new char[8192]; + int n; + while ((n = bfreader.read(buf)) >= 0) { + out.append(buf, 0, n); + } + } finally { + bfreader.close(); + } + } catch (IOException e) { + String msg = "Failed to read the input stream:"; + msg = msg + " bfreader=" + bfreader + " reader=" + reader; + throw new IllegalStateException(msg, e); + } + return out.toString(); + } + protected static String replaceString(String text, String fromText, String toText) { return SimpleStringUtil.replace(text, fromText, toText); @@ -348,35 +399,8 @@ // Accessor // ======== // ----------------------------------------------------- - // Common of OutsideSql - // -------------------- - public boolean isDynamicBinding() { - return _dynamicBinding; - } - - public void setDynamicBinding(boolean dynamicBinding) { - this._dynamicBinding = dynamicBinding; - } - - public boolean isOffsetByCursorForcedly() { - return _offsetByCursorForcedly; - } - - public void setOffsetByCursorForcedly(boolean offsetByCursorForcedly) { - this._offsetByCursorForcedly = offsetByCursorForcedly; - } - - public boolean isLimitByCursorForcedly() { - return _limitByCursorForcedly; - } - - public void setLimitByCursorForcedly(boolean limitByCursorForcedly) { - this._limitByCursorForcedly = limitByCursorForcedly; - } - - // ----------------------------------------------------- - // Specified OutsideSql - // -------------------- + // Basic + // ----- public String getOutsideSqlPath() { return _outsideSqlPath; } @@ -424,4 +448,39 @@ public void setTableDbName(String tableDbName) { this._tableDbName = tableDbName; } + + // ----------------------------------------------------- + // Option + // ------ + public boolean isDynamicBinding() { + return _dynamicBinding; + } + + public void setDynamicBinding(boolean dynamicBinding) { + this._dynamicBinding = dynamicBinding; + } + + public boolean isOffsetByCursorForcedly() { + return _offsetByCursorForcedly; + } + + public void setOffsetByCursorForcedly(boolean offsetByCursorForcedly) { + this._offsetByCursorForcedly = offsetByCursorForcedly; + } + + public boolean isLimitByCursorForcedly() { + return _limitByCursorForcedly; + } + + public void setLimitByCursorForcedly(boolean limitByCursorForcedly) { + this._limitByCursorForcedly = limitByCursorForcedly; + } + + public boolean isAutoPagingLogging() { // for logging + return _autoPagingLogging; + } + + public void setAutoPagingLogging(boolean autoPagingLogging) { // for logging + this._autoPagingLogging = autoPagingLogging; + } } Deleted: 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 2008-12-27 22:14:41 UTC (rev 1629) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/cbean/outsidesql/OutsideSqlDao.java 2008-12-27 22:18:30 UTC (rev 1630) @@ -1,37 +0,0 @@ -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 - // ====== - List selectList(String path, Object pmb, - OutsideSqlOption option, Class entityType); - - Object selectCursor(String path, Object pmb, - OutsideSqlOption option, CursorHandler handler); - - //========================================================================== - // ========= - // Execute - // ======= - int execute(String path, Object pmb, OutsideSqlOption option); - - // [DBFlute-0.7.5] - //========================================================================== - // ========= - // Call - // ==== - void call(String path, Object pmb, OutsideSqlOption option); -} Modified: 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 2008-12-27 22:14:41 UTC (rev 1629) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/cbean/outsidesql/OutsideSqlOption.java 2008-12-27 22:18:30 UTC (rev 1630) @@ -16,6 +16,7 @@ // ----------------------------------------------------- // Option // ------ + /** The request type of paging. */ protected String _pagingRequestType = "non"; protected boolean _dynamicBinding; @@ -23,6 +24,8 @@ /** The configuration of statement. (Nullable) */ protected StatementConfig _statementConfig; + protected String _sourcePagingRequestType = "non"; + // ----------------------------------------------------- // Information // ----------- @@ -59,6 +62,7 @@ // ==== public OutsideSqlOption copyOptionWithoutPaging() { final OutsideSqlOption copyOption = new OutsideSqlOption(); + copyOption.setPagingSourceRequestType(_pagingRequestType); if (isDynamicBinding()) { copyOption.dynamicBinding(); } @@ -103,6 +107,15 @@ _statementConfig = statementConfig; } + protected void setPagingSourceRequestType(String sourcePagingRequestType) { // Very + // Internal + _sourcePagingRequestType = sourcePagingRequestType; + } + + public boolean isSourcePagingRequestTypeAuto() { // Very Internal + return "auto".equals(_sourcePagingRequestType); + } + // ----------------------------------------------------- // Information // ----------- Modified: 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 2008-12-27 22:14:41 UTC (rev 1629) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/cbean/outsidesql/executor/OutsideSqlBasicExecutor.java 2008-12-27 22:18:30 UTC (rev 1630) @@ -2,15 +2,20 @@ import java.util.List; +import jp.sf.pal.scheduler.db.allcommon.bhv.core.BehaviorCommand; +import jp.sf.pal.scheduler.db.allcommon.bhv.core.BehaviorCommandInvoker; +import jp.sf.pal.scheduler.db.allcommon.bhv.core.command.AbstractOutsideSqlCommand; +import jp.sf.pal.scheduler.db.allcommon.bhv.core.command.OutsideSqlCallCommand; +import jp.sf.pal.scheduler.db.allcommon.bhv.core.command.OutsideSqlExecuteCommand; +import jp.sf.pal.scheduler.db.allcommon.bhv.core.command.OutsideSqlSelectListCommand; 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.
+ * The executor of outside-SQL.
* *
  * {Basic}
@@ -33,7 +38,6 @@
  * 
  * {Option -- Dynamic}
  *   o dynamicBinding().selectList()
- * 
  * 
* * @author DBFlute(AutoGenerator) @@ -44,8 +48,8 @@ // ========= // Attribute // ========= - /** The DAO of outside-sql. (NotNull) */ - protected final OutsideSqlDao _outsideSqlDao; + /** The invoker of behavior command. (NotNull) */ + protected final BehaviorCommandInvoker _behaviorCommandInvoker; /** Table DB name. (NotNull) */ protected final String _tableDbName; @@ -60,9 +64,9 @@ // ========= // Constructor // =========== - public OutsideSqlBasicExecutor(OutsideSqlDao outsideSqlDao, - String tableDbName) { - this._outsideSqlDao = outsideSqlDao; + public OutsideSqlBasicExecutor( + BehaviorCommandInvoker behaviorCommandInvoker, String tableDbName) { + this._behaviorCommandInvoker = behaviorCommandInvoker; this._tableDbName = tableDbName; } @@ -80,12 +84,12 @@ * @param entityType The element type of entity. (NotNull) * @return The result bean of selected list. (NotNull) * @exception jp.sf.pal.scheduler.db.allcommon.exception.OutsideSqlNotFoundException - * When the outside-sql is not found. + * When the outside-SQL is not found. */ public ListResultBean selectList(String path, Object pmb, Class entityType) { - List resultList = _outsideSqlDao.selectList(path, pmb, - createOutsideSqlOption(), entityType); + List resultList = invoke(createSelectListCommand(path, pmb, + entityType)); return new ResultBeanBuilder(_tableDbName) .buildListResultBean(resultList); } @@ -102,10 +106,10 @@ * object. (Nullable) * @return The count of execution. * @exception jp.sf.pal.scheduler.db.allcommon.exception.OutsideSqlNotFoundException - * When the outside-sql is not found. + * When the outside-SQL is not found. */ public int execute(String path, Object pmb) { - return _outsideSqlDao.execute(path, pmb, createOutsideSqlOption()); + return invoke(createExecuteCommand(path, pmb)); } // [DBFlute-0.7.5] @@ -123,12 +127,53 @@ throw new IllegalArgumentException( "The argument of call() 'pmb' should not be null!"); } - _outsideSqlDao.call(pmb.getProcedureName(), pmb, - createOutsideSqlOption()); + invoke(createCallCommand(pmb.getProcedureName(), pmb)); } //========================================================================== // ========= + // Behavior Command + // ================ + protected BehaviorCommand> createSelectListCommand( + String path, Object pmb, Class entityType) { + final OutsideSqlSelectListCommand cmd = xsetupCommand( + new OutsideSqlSelectListCommand(), path, pmb); + cmd.setEntityType(entityType); + return cmd; + } + + protected BehaviorCommand createExecuteCommand(String path, + Object pmb) { + return xsetupCommand(new OutsideSqlExecuteCommand(), path, pmb); + } + + protected BehaviorCommand createCallCommand(String path, Object pmb) { + return xsetupCommand(new OutsideSqlCallCommand(), path, pmb); + } + + private > COMMAND xsetupCommand( + COMMAND command, String path, Object pmb) { + command.setTableDbName(_tableDbName); + _behaviorCommandInvoker.injectComponentProperty(command); + command.setOutsideSqlPath(path); + command.setParameterBean(pmb); + command.setOutsideSqlOption(createOutsideSqlOption()); + return command; + } + + /** + * Invoke the command of behavior. + * + * @param The type of result. + * @param behaviorCommand The command of behavior. (NotNull) + * @return The instance of result. (Nullable) + */ + protected RESULT invoke(BehaviorCommand behaviorCommand) { + return _behaviorCommandInvoker.invoke(behaviorCommand); + } + + //========================================================================== + // ========= // Option // ====== // ----------------------------------------------------- @@ -144,11 +189,11 @@ * # * * - * @return The cursor executor of outside-sql. (NotNull) + * @return The cursor executor of outside-SQL. (NotNull) */ public OutsideSqlCursorExecutor cursorHandling() { - return new OutsideSqlCursorExecutor(_outsideSqlDao, - createOutsideSqlOption()); + return new OutsideSqlCursorExecutor(_behaviorCommandInvoker, + createOutsideSqlOption(), _tableDbName); } /** @@ -161,11 +206,11 @@ * # * * - * @return The cursor executor of outside-sql. (NotNull) + * @return The cursor executor of outside-SQL. (NotNull) */ public OutsideSqlEntityExecutor entityHandling() { - return new OutsideSqlEntityExecutor(_outsideSqlDao, - createOutsideSqlOption()); + return new OutsideSqlEntityExecutor(_behaviorCommandInvoker, + createOutsideSqlOption(), _tableDbName); } // ----------------------------------------------------- @@ -191,7 +236,7 @@ public OutsideSqlPagingExecutor autoPaging() { final OutsideSqlOption option = createOutsideSqlOption(); option.autoPaging(); - return new OutsideSqlPagingExecutor(_outsideSqlDao, option, + return new OutsideSqlPagingExecutor(_behaviorCommandInvoker, option, _tableDbName); } @@ -215,7 +260,7 @@ public OutsideSqlPagingExecutor manualPaging() { final OutsideSqlOption option = createOutsideSqlOption(); option.manualPaging(); - return new OutsideSqlPagingExecutor(_outsideSqlDao, option, + return new OutsideSqlPagingExecutor(_behaviorCommandInvoker, option, _tableDbName); } Modified: 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 2008-12-27 22:14:41 UTC (rev 1629) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/cbean/outsidesql/executor/OutsideSqlCursorExecutor.java 2008-12-27 22:18:30 UTC (rev 1630) @@ -1,12 +1,14 @@ 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.bhv.core.BehaviorCommand; +import jp.sf.pal.scheduler.db.allcommon.bhv.core.BehaviorCommandInvoker; +import jp.sf.pal.scheduler.db.allcommon.bhv.core.command.OutsideSqlSelectCursorCommand; 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. + * The cursor executor of outside-SQL. * * @param The type of parameter-bean. * @author DBFlute(AutoGenerator) @@ -17,18 +19,25 @@ // ========= // Attribute // ========= - protected final OutsideSqlDao _outsideSqlDao; + /** The invoker of behavior command. (NotNull) */ + protected final BehaviorCommandInvoker _behaviorCommandInvoker; + /** The option of outside-SQL. (NotNull) */ protected final OutsideSqlOption _outsideSqlOption; + /** The DB name of table. (NotNull) */ + protected final String _tableDbName; + //========================================================================== // ========= // Constructor // =========== - public OutsideSqlCursorExecutor(OutsideSqlDao outsideSqlDao, - OutsideSqlOption outsideSqlOption) { - this._outsideSqlDao = outsideSqlDao; + public OutsideSqlCursorExecutor( + BehaviorCommandInvoker behaviorCommandInvoker, + OutsideSqlOption outsideSqlOption, String tableDbName) { + this._behaviorCommandInvoker = behaviorCommandInvoker; this._outsideSqlOption = outsideSqlOption; + this._tableDbName = tableDbName; } //========================================================================== @@ -44,14 +53,46 @@ * @param handler The handler of cursor. (NotNull) * @return The result object that the cursor handler returns. (Nullable) * @exception jp.sf.pal.scheduler.db.allcommon.exception.OutsideSqlNotFoundException - * When the outside-sql is not found. + * When the outside-SQL is not found. */ public Object selectCursor(String path, PARAMETER_BEAN pmb, CursorHandler handler) { - return _outsideSqlDao.selectCursor(path, pmb, _outsideSqlOption, + return invoke(createSelectCursorCommand(path, pmb, handler)); + } + + //========================================================================== + // ========= + // Behavior Command + // ================ + protected BehaviorCommand createSelectCursorCommand(String path, + PARAMETER_BEAN pmb, CursorHandler handler) { + return xsetupCommand(new OutsideSqlSelectCursorCommand(), path, pmb, handler); } + private OutsideSqlSelectCursorCommand xsetupCommand( + OutsideSqlSelectCursorCommand command, String path, + PARAMETER_BEAN pmb, CursorHandler handler) { + command.setTableDbName(_tableDbName); + _behaviorCommandInvoker.injectComponentProperty(command); + command.setOutsideSqlPath(path); + command.setParameterBean(pmb); + command.setOutsideSqlOption(_outsideSqlOption); + command.setCursorHandler(handler); + return command; + } + + /** + * Invoke the command of behavior. + * + * @param The type of result. + * @param behaviorCommand The command of behavior. (NotNull) + * @return The instance of result. (Nullable) + */ + protected RESULT invoke(BehaviorCommand behaviorCommand) { + return _behaviorCommandInvoker.invoke(behaviorCommand); + } + //========================================================================== // ========= // Option Modified: 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 2008-12-27 22:14:41 UTC (rev 1629) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/cbean/outsidesql/executor/OutsideSqlEntityExecutor.java 2008-12-27 22:18:30 UTC (rev 1630) @@ -2,14 +2,16 @@ import java.util.List; +import jp.sf.pal.scheduler.db.allcommon.bhv.core.BehaviorCommand; +import jp.sf.pal.scheduler.db.allcommon.bhv.core.BehaviorCommandInvoker; +import jp.sf.pal.scheduler.db.allcommon.bhv.core.command.OutsideSqlSelectListCommand; 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. + * The cursor executor of outside-SQL. * * @param The type of parameter-bean. * @author DBFlute(AutoGenerator) @@ -20,18 +22,25 @@ // ========= // Attribute // ========= - protected final OutsideSqlDao _outsideSqlDao; + /** The invoker of behavior command. (NotNull) */ + protected final BehaviorCommandInvoker _behaviorCommandInvoker; + /** The option of outside-SQL. (NotNull) */ protected final OutsideSqlOption _outsideSqlOption; + /** The DB name of table. (NotNull) */ + protected final String _tableDbName; + //========================================================================== // ========= // Constructor // =========== - public OutsideSqlEntityExecutor(OutsideSqlDao outsideSqlDao, - OutsideSqlOption outsideSqlOption) { - this._outsideSqlDao = outsideSqlDao; + public OutsideSqlEntityExecutor( + BehaviorCommandInvoker behaviorCommandInvoker, + OutsideSqlOption outsideSqlOption, String tableDbName) { + this._behaviorCommandInvoker = behaviorCommandInvoker; this._outsideSqlOption = outsideSqlOption; + this._tableDbName = tableDbName; } //========================================================================== @@ -48,14 +57,14 @@ * @param entityType The type of entity. (NotNull) * @return The selected entity. (Nullable) * @exception jp.sf.pal.scheduler.db.allcommon.exception.OutsideSqlNotFoundException - * When the outside-sql is not found. + * When the outside-SQL is not found. * @exception jp.sf.pal.scheduler.db.allcommon.exception.EntityDuplicatedException * When the entity is duplicated. */ public ENTITY selectEntity(String path, PARAMETER_BEAN pmb, Class entityType) { - final List ls = _outsideSqlDao.selectList(path, pmb, - _outsideSqlOption, entityType); + final List ls = invoke(createSelectListCommand(path, pmb, + entityType)); if (ls.isEmpty()) { return null; } @@ -76,7 +85,7 @@ * @param entityType The type of entity. (NotNull) * @return The selected entity. (Nullable) * @exception jp.sf.pal.scheduler.db.allcommon.exception.OutsideSqlNotFoundException - * When the outside-sql is not found. + * 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 @@ -84,8 +93,8 @@ */ public ENTITY selectEntityWithDeletedCheck(String path, PARAMETER_BEAN pmb, Class entityType) { - final List ls = _outsideSqlDao.selectList(path, pmb, - _outsideSqlOption, entityType); + final List ls = invoke(createSelectListCommand(path, pmb, + entityType)); if (ls == null || ls.isEmpty()) { throwEntityAlreadyDeletedException(buildSearch4LogString(path, pmb, entityType)); @@ -127,6 +136,39 @@ //========================================================================== // ========= + // Behavior Command + // ================ + protected BehaviorCommand> createSelectListCommand( + String path, PARAMETER_BEAN pmb, Class entityType) { + return xsetupCommand(new OutsideSqlSelectListCommand(), path, + pmb, entityType); + } + + private OutsideSqlSelectListCommand xsetupCommand( + OutsideSqlSelectListCommand command, String path, + PARAMETER_BEAN pmb, Class entityType) { + command.setTableDbName(_tableDbName); + _behaviorCommandInvoker.injectComponentProperty(command); + command.setOutsideSqlPath(path); + command.setParameterBean(pmb); + command.setOutsideSqlOption(_outsideSqlOption); + command.setEntityType(entityType); + return command; + } + + /** + * Invoke the command of behavior. + * + * @param The type of result. + * @param behaviorCommand The command of behavior. (NotNull) + * @return The instance of result. (Nullable) + */ + protected RESULT invoke(BehaviorCommand behaviorCommand) { + return _behaviorCommandInvoker.invoke(behaviorCommand); + } + + //========================================================================== + // ========= // Option // ====== public OutsideSqlEntityExecutor configure( Modified: 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 2008-12-27 22:14:41 UTC (rev 1629) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/cbean/outsidesql/executor/OutsideSqlPagingExecutor.java 2008-12-27 22:18:30 UTC (rev 1630) @@ -3,18 +3,20 @@ import java.util.List; import jp.sf.pal.scheduler.db.allcommon.DBFluteConfig; +import jp.sf.pal.scheduler.db.allcommon.bhv.core.BehaviorCommand; +import jp.sf.pal.scheduler.db.allcommon.bhv.core.BehaviorCommandInvoker; +import jp.sf.pal.scheduler.db.allcommon.bhv.core.command.OutsideSqlSelectListCommand; 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. + * The paging executor of outside-SQL. * * @author DBFlute(AutoGenerator) */ @@ -24,10 +26,10 @@ // ========= // Attribute // ========= - /** The DAO of outsideSql. (NotNull) */ - protected final OutsideSqlDao _outsideSqlDao; + /** The invoker of behavior command. (NotNull) */ + protected final BehaviorCommandInvoker _behaviorCommandInvoker; - /** The option of outsideSql. (NotNull) */ + /** The option of outside-SQL. (NotNull) */ protected final OutsideSqlOption _outsideSqlOption; /** The DB name of table. (NotNull) */ @@ -37,9 +39,10 @@ // ========= // Constructor // =========== - public OutsideSqlPagingExecutor(OutsideSqlDao outsideSqlDao, + public OutsideSqlPagingExecutor( + BehaviorCommandInvoker behaviorCommandInvoker, OutsideSqlOption outsideSqlOption, String tableDbName) { - this._outsideSqlDao = outsideSqlDao; + this._behaviorCommandInvoker = behaviorCommandInvoker; this._outsideSqlOption = outsideSqlOption; this._tableDbName = tableDbName; } @@ -81,13 +84,13 @@ * @param entityType The type of result entity. (NotNull) * @return The result bean of paged list. (NotNull) * @exception com.example.dbflute.basic.dbflute.allcommon.exception.OutsideSqlNotFoundException - * When the outside-sql is not found. + * When the outside-SQL is not found. */ public ListResultBean selectList(String path, PagingBean pmb, Class entityType) { setupScrollableCursorIfNeeds(); - List resultList = _outsideSqlDao.selectList(path, pmb, - _outsideSqlOption, entityType); + List resultList = invoke(createSelectListCommand(path, pmb, + entityType)); return new ResultBeanBuilder(_tableDbName) .buildListResultBean(resultList); } @@ -141,7 +144,7 @@ * # -- ELSE select count(*) * # /[*]END[*]/ * # ... - * o It's S2Dao's restriction...Sorry + * o It's restriction...Sorry * * * @param The type of entity. @@ -150,14 +153,11 @@ * @param entityType The type of result entity. (NotNull) * @return The result bean of paging. (NotNull) * @exception jp.sf.pal.scheduler.db.allcommon.exception.OutsideSqlNotFoundException - * When the outside-sql is not found. + * When the outside-SQL is not found. */ public PagingResultBean selectPage(final String path, final PagingBean pmb, final Class entityType) { - final OutsideSqlOption countOption = _outsideSqlOption - .copyOptionWithoutPaging(); - final OutsideSqlEntityExecutor countExecutor = new OutsideSqlEntityExecutor( - _outsideSqlDao, countOption); + final OutsideSqlEntityExecutor countExecutor = createCountExecutor(); final PagingHandler handler = new PagingHandler() { public PagingBean getPagingBean() { return pmb; @@ -182,6 +182,13 @@ return invoker.invokePaging(handler); } + protected OutsideSqlEntityExecutor createCountExecutor() { + final OutsideSqlOption countOption = _outsideSqlOption + .copyOptionWithoutPaging(); + return new OutsideSqlEntityExecutor( + _behaviorCommandInvoker, countOption, _tableDbName); + } + protected void setupScrollableCursorIfNeeds() { if (!_outsideSqlOption.isAutoPaging()) { return; @@ -207,6 +214,39 @@ //========================================================================== // ========= + // Behavior Command + // ================ + protected BehaviorCommand> createSelectListCommand( + String path, Object pmb, Class entityType) { + return xsetupCommand(new OutsideSqlSelectListCommand(), path, + pmb, entityType); + } + + private OutsideSqlSelectListCommand xsetupCommand( + OutsideSqlSelectListCommand command, String path, + Object pmb, Class entityType) { + command.setTableDbName(_tableDbName); + _behaviorCommandInvoker.injectComponentProperty(command); + command.setOutsideSqlPath(path); + command.setParameterBean(pmb); + command.setOutsideSqlOption(_outsideSqlOption); + command.setEntityType(entityType); + return command; + } + + /** + * Invoke the command of behavior. + * + * @param The type of result. + * @param behaviorCommand The command of behavior. (NotNull) + * @return The instance of result. (Nullable) + */ + protected RESULT invoke(BehaviorCommand behaviorCommand) { + return _behaviorCommandInvoker.invoke(behaviorCommand); + } + + //========================================================================== + // ========= // Option // ====== public OutsideSqlPagingExecutor configure(StatementConfig statementConfig) { Modified: 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 2008-12-27 22:14:41 UTC (rev 1629) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/cbean/sqlclause/AbstractSqlClause.java 2008-12-27 22:18:30 UTC (rev 1630) @@ -17,23 +17,23 @@ 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. + * The abstract class of SQL clause. * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public abstract class AbstractSqlClause implements SqlClause { //========================================================================== // ========= // Definition // ========== + protected static final SelectClauseType DEFAULT_SELECT_CLAUSE_TYPE = SelectClauseType.COLUMNS; + protected static final String SELECT_HINT = "/*$dto.selectHint*/"; //========================================================================== @@ -43,12 +43,16 @@ // ----------------------------------------------------- // Basic // ----- - /** Target table name. */ + /** The name of table. */ protected final String _tableName; // ----------------------------------------------------- // Clause Resource // --------------- + // /- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + // - + // The resources that are not often used to are lazy-loaded for performance. + // - - - - - - - - - -/ /** * Selected select column map. map:{tableAliasName : map:{columnName : * selectColumnInfo}} @@ -57,48 +61,48 @@ /** * Specified select column map. map:{ tableAliasName = map:{ columnName : - * null } } + * null } } (Nullable: This is lazy-loaded) */ - protected Map> _specifiedSelectColumnMap;// [ + protected Map> _specifiedSelectColumnMap; // [ // DBFlute // - - // 0.7.4 - // ] + // 0.7 + // .4] - /** Specified derive sub-query map. */ - protected Map _specifiedDeriveSubQueryMap;// [DBFlute-0.7.4] + /** Specified derive sub-query map. (Nullable: This is lazy-loaded) */ + protected Map _specifiedDeriveSubQueryMap; //[DBFlute-0.7.4] - /** Included select column map. */ - protected Map _includedSelectColumnMap = new LinkedHashMap(); - /** * The map of real column and alias of select clause. map:{realColumnName : * aliasName} */ - protected Map _selectClauseRealColumnAliasMap = new HashMap();// Without + protected Map _selectClauseRealColumnAliasMap = new HashMap(); // Without // linked // ! + /** The type of select clause. (NotNull) */ + protected SelectClauseType _selectClauseType = DEFAULT_SELECT_CLAUSE_TYPE; + + /** The previous type of select clause. (Nullable: The default is null) */ + protected SelectClauseType _previousSelectClauseType; + /** Outer join map. */ protected Map _outerJoinMap = new LinkedHashMap(); - /** Where list. */ + /** The list of where clause. */ protected List _whereList = new ArrayList(); /** Inline where list for BaseTable. */ protected List _baseTableInlineWhereList = new ArrayList(); - /** Order-by clause. */ + /** The clause of order-by. (NotNull) */ protected final OrderByClause _orderByClause = new OrderByClause(); - /** Union clause list. */ - protected List _unionQueryInfoList = new ArrayList(); + /** The list of union clause. (Nullable: This is lazy-loaded) */ + protected List _unionQueryInfoList; - /** Is included-select-column effective? Default value is false. */ - protected boolean _isIncludedSelectColumnEffective = false; - /** Is order-by effective? Default value is false. */ protected boolean _isOrderByEffective = false; @@ -138,7 +142,7 @@ // ----------------------------------------------------- // Optional Info // ------------- - protected boolean _formatClause; + protected boolean _formatClause = true; //========================================================================== // ========= @@ -163,28 +167,20 @@ StringBuilder sb = new StringBuilder(512); sb.append(getSelectClause()); sb.append(" "); - sb.append(buildClauseWithoutMainSelect(false)); + sb.append(buildClauseWithoutMainSelect()); String sql = sb.toString(); - return filterSubQueryIndent(sql); + sql = filterUnionCountOrScalar(sql); + sql = filterSubQueryIndent(sql); + return sql; } - public String getClausePKOnly() { + protected String buildClauseWithoutMainSelect() { StringBuilder sb = new StringBuilder(512); - sb.append(getSelectClausePKOnly()); - sb.append(" "); - sb.append(buildClauseWithoutMainSelect(true)); - String sql = sb.toString(); - return filterSubQueryIndent(sql); - } - - protected String buildClauseWithoutMainSelect(boolean pkonly) { - StringBuilder sb = new StringBuilder(512); sb.append(getFromClause()); sb.append(getFromHint()); sb.append(" "); sb.append(getWhereClause()); - String unionClause = buildUnionClause(pkonly ? getSelectClausePKOnly() - : getSelectClause()); + String unionClause = buildUnionClause(getSelectClause()); // Delete template mark! (At the future this will be unnecessary.) unionClause = replaceString(unionClause, getUnionWhereClauseMark(), "");// Required @@ -225,29 +221,45 @@ protected String buildUnionClause(String selectClause) { StringBuilder sb = new StringBuilder(); - for (final Iterator ite = _unionQueryInfoList - .iterator(); ite.hasNext();) { - final UnionQueryInfo unionQueryInfo = (UnionQueryInfo) ite.next(); - final String unionQueryClause = unionQueryInfo - .getUnionQueryClause(); - final boolean unionAll = unionQueryInfo.isUnionAll(); - if (isFormatClauseEffective()) { + if (hasUnionQuery()) { + for (Iterator ite = _unionQueryInfoList.iterator(); ite + .hasNext();) { + UnionQueryInfo unionQueryInfo = (UnionQueryInfo) ite.next(); + String unionQueryClause = unionQueryInfo.getUnionQueryClause(); + boolean unionAll = unionQueryInfo.isUnionAll(); sb.append(getLineSeparator()); - } - sb.append(unionAll ? " union all " : " union "); - if (isFormatClauseEffective()) { + sb.append(unionAll ? " union all " : " union "); sb.append(getLineSeparator()); + sb.append(selectClause).append(" ").append(unionQueryClause); } - sb.append(selectClause).append(" ").append(unionQueryClause); } return sb.toString(); } + protected String filterUnionCountOrScalar(String sql) { + if (!isSelectClauseTypeCountOrScalar() || !hasUnionQuery()) { + return sql; + } + String selectClause = buildSelectClauseCountOrScalar("dfmain"); + String ln = getLineSeparator(); + String beginMark = resolveSubQueryBeginMark("dfmain") + ln; + String endMark = resolveSubQueryEndMark("dfmain"); + return selectClause + ln + " from (" + beginMark + sql + ln + + " ) dfmain" + endMark; + } + //========================================================================== // ========= // Clause Parts // ============ public String getSelectClause() { + // [DBFlute-0.8.6] + if (isSelectClauseTypeCountOrScalar() && !hasUnionQuery()) { + return buildSelectClauseCountOrScalar("dflocal"); + } + // /- - - - - - - - - - - - - - - - - - - - - - - - + // The type of select clause is COLUMNS since here. + // - - - - - - - - - -/ StringBuilder sb = new StringBuilder(); DBMeta dbmeta = DBMetaInstanceHandler.findDBMeta(_tableName); List columnInfoList = dbmeta.getColumnInfoList(); @@ -265,7 +277,19 @@ // [DBFlute-0.7.4] if (existsSpecifiedLocal && !localSpecifiedMap.containsKey(columnName)) { - continue; + if (isSelectClauseTypeCountOrScalar() && hasUnionQuery()) { + // Here it must be with union query. + // So the primary Key is target for saving unique. + // But if it does not have primary keys, all column is + // target. + if (dbmeta.hasPrimaryKey()) { + if (!columnInfo.isPrimary()) { + continue; + } + } + } else { + continue; + } } if (sb.length() > 0) { @@ -307,10 +331,6 @@ selectColumnInfo.getColumnAliasName()); } } - if (_isIncludedSelectColumnEffective - && !_includedSelectColumnMap.isEmpty()) { - sb.append(getIncludedSelectColumnClause()); - } // [DBFlute-0.7.4] if (_specifiedDeriveSubQueryMap != null @@ -318,9 +338,7 @@ Collection deriveSubQuerySet = _specifiedDeriveSubQueryMap .values(); for (String deriveSubQuery : deriveSubQuerySet) { - if (isFormatClauseEffective()) { - sb.append(getLineSeparator()).append(" "); - } + sb.append(getLineSeparator()).append(" "); sb.append(", ").append(deriveSubQuery); } } @@ -328,67 +346,83 @@ return sb.toString(); } - public String getSelectClausePKOnly() { - StringBuilder sb = new StringBuilder(); - DBMeta dbmeta = DBMetaInstanceHandler.findDBMeta(_tableName); - UniqueInfo uniqueInfo = dbmeta.getPrimaryUniqueInfo(); - List columnInfoList = uniqueInfo.getUniqueColumnList(); - for (ColumnInfo columnInfo : columnInfoList) { - String columnName = columnInfo.getColumnDbName(); - if (sb.length() > 0) { - sb.append(", "); - } else { - sb.append("select").append(SELECT_HINT).append(" "); - } - String realColumnName = getLocalTableAliasName() + "." + columnName; - sb.append(realColumnName).append(" as ").append(columnName); - _selectClauseRealColumnAliasMap.put(realColumnName, columnName); + protected boolean isSelectClauseTypeCountOrScalar() { + if (_selectClauseType.equals(SelectClauseType.COUNT)) { + return true; + } else if (_selectClauseType.equals(SelectClauseType.MAX)) { + return true; + } else if (_selectClauseType.equals(SelectClauseType.MIN)) { + return true; + } else if (_selectClauseType.equals(SelectClauseType.SUM)) { + return true; + } else if (_selectClauseType.equals(SelectClauseType.AVG)) { + return true; } - if (_isIncludedSelectColumnEffective - && !_includedSelectColumnMap.isEmpty()) { - sb.append(getIncludedSelectColumnClause()); - } + return false; + } - // [DBFlute-0.7.4] - if (_specifiedDeriveSubQueryMap != null - && !_specifiedDeriveSubQueryMap.isEmpty()) { - Collection deriveSubQuerySet = _specifiedDeriveSubQueryMap - .values(); - for (String deriveSubQuery : deriveSubQuerySet) { - if (isFormatClauseEffective()) { - sb.append(getLineSeparator()).append(" "); - } - sb.append(", ").append(deriveSubQuery); - } + protected String buildSelectClauseCountOrScalar(String aliasName) { + if (_selectClauseType.equals(SelectClauseType.COUNT)) { + return buildSelectClauseCount(); + } else if (_selectClauseType.equals(SelectClauseType.MAX)) { + return buildSelectClauseMax(aliasName); + } else if (_selectClauseType.equals(SelectClauseType.MIN)) { + return buildSelectClauseMin(aliasName); + } else if (_selectClauseType.equals(SelectClauseType.SUM)) { + return buildSelectClauseSum(aliasName); + } else if (_selectClauseType.equals(SelectClauseType.AVG)) { + return buildSelectClauseAvg(aliasName); } + String msg = "The type of select clause is not for scalar:"; + msg = msg + " type=" + _selectClauseType; + throw new IllegalStateException(msg); + } - return sb.toString(); + protected String buildSelectClauseCount() { + return "select count(*)"; } - public String getSelectHint() { - return createSelectHint(); + protected String buildSelectClauseMax(String aliasName) { + String columnName = getSpecifiedColumnNameAsOne(); + assertScalarSelectSpecifiedColumnOnlyOne(columnName); + return "select max(" + aliasName + "." + columnName + ")"; } - public String getIncludedSelectColumnClause() { - StringBuilder sb = new StringBuilder(); - int count = 0; - for (Iterator ite = _includedSelectColumnMap.keySet() - .iterator(); ite.hasNext(); count++) { - String aliasName = ite.next(); - String realColumnName = (String) _includedSelectColumnMap - .get(aliasName); - sb.append(", ").append(realColumnName).append(" as ").append( - aliasName); - _selectClauseRealColumnAliasMap.put(realColumnName, aliasName); + protected String buildSelectClauseMin(String aliasName) { + String columnName = getSpecifiedColumnNameAsOne(); + assertScalarSelectSpecifiedColumnOnlyOne(columnName); + return "select min(" + aliasName + "." + columnName + ")"; + } + + protected String buildSelectClauseSum(String aliasName) { + String columnName = getSpecifiedColumnNameAsOne(); + assertScalarSelectSpecifiedColumnOnlyOne(columnName); + return "select sum(" + aliasName + "." + columnName + ")"; + } + + protected String buildSelectClauseAvg(String aliasName) { + String columnName = getSpecifiedColumnNameAsOne(); + assertScalarSelectSpecifiedColumnOnlyOne(columnName); + return "select avg(" + aliasName + "." + columnName + ")"; + } + + protected void assertScalarSelectSpecifiedColumnOnlyOne(String columnName) { + if (columnName != null) { + return; } - return sb.toString(); + String msg = "The specified column exists one"; + msg = msg + " when the type of select clause is for scalar:"; + msg = msg + " specifiedSelectColumnMap=" + _specifiedSelectColumnMap; + throw new IllegalStateException(msg); } + public String getSelectHint() { + return createSelectHint(); + } + public String getFromClause() { StringBuilder sb = new StringBuilder(); - if (isFormatClauseEffective()) { - sb.append(getLineSeparator()).append(" "); - } + sb.append(getLineSeparator()).append(" "); sb.append("from "); if (_baseTableInlineWhereList.isEmpty()) { sb.append(_tableName).append(" dflocal"); @@ -417,9 +451,7 @@ Map joinOnMap = joinInfo.getJoinOnMap(); assertJoinOnMapNotEmpty(joinOnMap, aliasName); - if (isFormatClauseEffective()) { - sb.append(getLineSeparator()).append(" "); - } + sb.append(getLineSeparator()).append(" "); sb.append(" left outer join "); if (inlineWhereClauseList.isEmpty()) { sb.append(joinTableName); @@ -489,16 +521,12 @@ String clauseElement = (String) ite.next(); clauseElement = filterWhereClauseSimply(clauseElement); if (count == 0) { - if (isFormatClauseEffective()) { - sb.append(getLineSeparator()).append(" "); - } + sb.append(getLineSeparator()).append(" "); sb.append("where ").append( template ? getWhereFirstConditionMark() : "").append( clauseElement); } else { - if (isFormatClauseEffective()) { - sb.append(getLineSeparator()).append(" "); - } + sb.append(getLineSeparator()).append(" "); sb.append(" and ").append(clauseElement); } } @@ -510,7 +538,7 @@ public String getOrderByClause() { String orderByClause = null; - if (!_unionQueryInfoList.isEmpty()) { + if (hasUnionQuery()) { if (_selectClauseRealColumnAliasMap == null || _selectClauseRealColumnAliasMap.isEmpty()) { String msg = "The selectClauseColumnAliasMap should not be null or empty when union query exists: " @@ -522,8 +550,7 @@ } else { orderByClause = _orderByClause.getOrderByClause(); } - if (isFormatClauseEffective() && orderByClause != null - && orderByClause.trim().length() > 0) { + if (orderByClause != null && orderByClause.trim().length() > 0) { return getLineSeparator() + " " + orderByClause; } else { return orderByClause; @@ -532,8 +559,7 @@ public String getSqlSuffix() { String sqlSuffix = createSqlSuffix(); - if (isFormatClauseEffective() && sqlSuffix != null - && sqlSuffix.trim().length() > 0) { + if (sqlSuffix != null && sqlSuffix.trim().length() > 0) { return getLineSeparator() + sqlSuffix; } else { return sqlSuffix; @@ -542,20 +568,6 @@ //========================================================================== // ========= - // Copy Parts - // ========== - public void copyIncludedSelectColumn(SqlClause sqlClause) { - Set keySet = _includedSelectColumnMap.keySet(); - for (Iterator ite = keySet.iterator(); ite.hasNext();) { - String aliasName = ite.next(); - String realColumnName = (String) _includedSelectColumnMap - .get(aliasName); - sqlClause.registerIncludedSelectColumn(aliasName, realColumnName); - } - } - - //========================================================================== - // ========= // SelectedSelectColumn // ==================== /** @@ -644,26 +656,6 @@ //========================================================================== // ========= - // IncludedSelectColumn - // ==================== - public void ignoreIncludedSelectColumn() { - _isIncludedSelectColumnEffective = false; - } - - public void makeIncludedSelectColumnEffective() { - if (!_includedSelectColumnMap.isEmpty()) { - _isIncludedSelectColumnEffective = true; - } - } - - public void registerIncludedSelectColumn(String aliasName, - String realColumnName) { - _isIncludedSelectColumnEffective = true; - _includedSelectColumnMap.put(aliasName, realColumnName); - } - - //========================================================================== - // ========= // OuterJoin // ========= public void registerOuterJoin(String joinTableName, String aliasName, @@ -1079,12 +1071,23 @@ public void registerUnionQuery(String unionQueryClause, boolean unionAll) { assertStringNotNullAndNotTrimmedEmpty("unionQueryClause", unionQueryClause); - final UnionQueryInfo unionQueryInfo = new UnionQueryInfo(); + UnionQueryInfo unionQueryInfo = new UnionQueryInfo(); unionQueryInfo.setUnionQueryClause(unionQueryClause); unionQueryInfo.setUnionAll(unionAll); + addUnionQueryInfo(unionQueryInfo); + } + + protected void addUnionQueryInfo(UnionQueryInfo unionQueryInfo) { + if (_unionQueryInfoList == null) { + _unionQueryInfoList = new ArrayList(); + } _unionQueryInfoList.add(unionQueryInfo); } + public boolean hasUnionQuery() { + return _unionQueryInfoList != null && !_unionQueryInfoList.isEmpty(); + } + protected static class UnionQueryInfo { protected String _unionQueryClause; @@ -1425,18 +1428,6 @@ //========================================================================== // ========= - // Format Clause - // ============= - public boolean isFormatClauseEffective() { - return _formatClause; - } - - public void makeFormatClauseEffective() { - _formatClause = true; - } - - //========================================================================== - // ========= // Sub Query Indent // ================ public String resolveSubQueryBeginMark(String subQueryIdentity) { @@ -1462,13 +1453,11 @@ } public String filterSubQueryIndent(String sql) { - return isFormatClauseEffective() ? filterSubQueryIndent(sql, "") : sql; + return filterSubQueryIndent(sql, "", sql); } - protected String filterSubQueryIndent(String sql, String preIndent) { - if (!isFormatClauseEffective()) { - return sql; - } + protected String filterSubQueryIndent(String sql, String preIndent, + String originalSql) { final String lineSeparator = getLineSeparator(); if (!sql.contains(getSubQueryBeginMarkPrefix())) { return sql; @@ -1509,7 +1498,8 @@ // - - - - - - - - // In begin to end // - - - - - - - - - if (line.contains(endMarkPrefix + subQueryIdentity)) {// The end + if (line.contains(endMarkPrefix + subQueryIdentity)) { // The + // end final int markIndex = line.indexOf(endMarkPrefix); final int terminalIndex = line.indexOf(identityTerminal); if (terminalIndex < 0) { @@ -1521,7 +1511,7 @@ + line.substring(terminalIndex + terminalLength); subSb.append(clause).append(getLineSeparator()); final String currentSql = filterSubQueryIndent(subSb - .toString(), preIndent + indent); + .toString(), preIndent + indent, originalSql); mainSb.append(currentSql); throughBegin = false; throughBeginFirst = false; @@ -1544,10 +1534,11 @@ + getLineSeparator(); msg = msg + subQueryIdentity + getLineSeparator(); msg = msg + getLineSeparator() + "[Before Filter]" - + getLineSeparator(); - msg = msg + sql + getLineSeparator(); + + getLineSeparator() + sql; msg = msg + getLineSeparator() + "[After Filter]" + getLineSeparator() + filteredSql; + msg = msg + getLineSeparator() + "[Original SQL]" + + getLineSeparator() + originalSql; throw new SubQueryIndentFailureException(msg); } if (filteredSql.contains(beginMarkPrefix)) { @@ -1556,10 +1547,11 @@ + getLineSeparator(); msg = msg + subQueryIdentity + getLineSeparator(); msg = msg + getLineSeparator() + "[Before Filter]" - + getLineSeparator(); - msg = msg + sql + getLineSeparator(); + + getLineSeparator() + sql; msg = msg + getLineSeparator() + "[After Filter]" + getLineSeparator() + filteredSql; + msg = msg + getLineSeparator() + "[Original SQL]" + + getLineSeparator() + originalSql; throw new SubQueryIndentFailureException(msg); } return filteredSql; @@ -1592,7 +1584,7 @@ } if (!_specifiedSelectColumnMap.containsKey(tableAliasName)) { _specifiedSelectColumnMap.put(tableAliasName, - new HashMap()); + new LinkedHashMap()); } Map elementMap = _specifiedSelectColumnMap .get(tableAliasName); @@ -1666,10 +1658,7 @@ getUnionWhereFirstConditionMark(), ""); final StringBuilder sb = new StringBuilder(); - String ln = ""; - if (isFormatClauseEffective()) { - ln = getLineSeparator(); - } + String ln = getLineSeparator(); sb.append("update ").append(_tableName).append(ln); int index = 0; // It is guaranteed that the map has one or more elements. @@ -1728,10 +1717,7 @@ final String subQuery = filterSubQueryIndent(selectClause + " " + fromWhereClause); final StringBuilder sb = new StringBuilder(); - String ln = ""; - if (isFormatClauseEffective()) { - ln = getLineSeparator(); - } + String ln = getLineSeparator(); sb.append("delete from ").append(_tableName).append(ln); sb.append(" where ").append(primaryKeyName); sb.append(" in (").append(ln).append(subQuery).append(ln).append( @@ -1760,6 +1746,29 @@ return false; } + // [DBFlute-0.8.6] + //========================================================================== + // ========= + // Select Clause Type + // ================== + public void classifySelectClauseType(SelectClauseType selectClauseType) { + changeSelectClauseType(selectClauseType); + } + + protected void changeSelectClauseType(SelectClauseType selectClauseType) { + savePreviousSelectClauseType(); + _selectClauseType = selectClauseType; + } + + protected void savePreviousSelectClauseType() { + _previousSelectClauseType = _selectClauseType; + } + + public void rollbackSelectClauseType() { + _selectClauseType = _previousSelectClauseType != null ? _previousSelectClauseType + : DEFAULT_SELECT_CLAUSE_TYPE; + } + // [DBFlute-0.7.5] //========================================================================== // ========= Modified: 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 2008-12-27 22:14:41 UTC (rev 1629) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/cbean/sqlclause/SqlClause.java 2008-12-27 22:18:30 UTC (rev 1630) @@ -7,7 +7,7 @@ import jp.sf.pal.scheduler.db.allcommon.cbean.cvalue.ConditionValue; /** - * The interface of SQL-clause. + * The interface of SQL clause. * * @author DBFlute(AutoGenerator) */ @@ -35,21 +35,6 @@ */ public String getClause(); - /** - * Get clause of all parts as PK-only. - * - *
-     * # 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
-     * 
- * - * @return The clause of all parts as PK-Only. (NotNull) - */ - public String getClausePKOnly(); - // ----------------------------------------------------- // Fragment Clause // --------------- @@ -92,14 +77,6 @@ public String getSelectClause(); /** - * Get The clause of 'select' as PK-only. This is an internal method. - * - * @return The clause of select PK-only. {[select ...] from table...} - * (NotNull) - */ - public String getSelectClausePKOnly(); - - /** * Get the hint of 'select'. This is an internal method. * * @return The hint of 'select'. {select [select-hint] * from table...} @@ -108,14 +85,6 @@ public String getSelectHint(); /** - * Get the clause of included-select-column. This is an internal method. - * - * @return The clause of included-select-column. {select ... , - * [included-select-column clause] from table...} (NotNull) - */ - public String getIncludedSelectColumnClause(); - - /** * Get the clause of 'from'. This is an internal method. * * @return The clause of 'from'. (NotNull) @@ -162,17 +131,6 @@ //========================================================================== // ========= - // Copy Parts - // ========== - /** - * Copy included-select-column. - * - * @param sqlClause SQL-clause. (NotNull) - */ - public void copyIncludedSelectColumn(SqlClause sqlClause); - - //========================================================================== - // ========= // SelectedSelectColumn // ==================== /** @@ -189,30 +147,6 @@ //========================================================================== // ========= - // IncludedSelectColumn - // ==================== - /** - * Ignore included-select-column. - */ - public void ignoreIncludedSelectColumn(); - - /** - * Make included-select-column effective. - */ - public void makeIncludedSelectColumnEffective(); - - /** - * Register included-select-column. - * - * @param aliasName The alias name of the included-select-column. (NotNull) - * @param realColumnName The real column name of the included-select-column. - * (NotNull) - */ - public void registerIncludedSelectColumn(String aliasName, - String realColumnName); - - //========================================================================== - // ========= // OuterJoin // ========= /** @@ -340,6 +274,8 @@ // ===== public void registerUnionQuery(String unionClause, boolean unionAll); + public boolean hasUnionQuery(); + //========================================================================== // ========= // FetchScope @@ -561,14 +497,6 @@ //========================================================================== // ========= - // Format Clause - // ============= - public boolean isFormatClauseEffective(); - - public void makeFormatClauseEffective(); - - //========================================================================== - // ========= // Sub Query Indent // ================ public String resolveSubQueryBeginMark(String subQueryIdentity); @@ -588,8 +516,17 @@ public boolean hasSpecifiedDeriveSubQuery(String aliasName); + /** + * Get the name of only one specified column. + * + * @return The name of only one specified column. (Nullable: If it's not + * found or duplicated, it returns null) + */ public String getSpecifiedColumnNameAsOne(); + /** + * Clear specified select columns. + */ public void clearSpecifiedSelectColumn(); // [DBFlute-0.7.5] @@ -621,4 +558,29 @@ */ public boolean isUniqueConstraintException(String sqlState, Integer errorCode); + + // [DBFlute-0.8.6] + //========================================================================== + // ========= + // Select Clause Type + // ================== + /** + * Classify the type of select clause into specified type. + * + * @param selectClauseType The type of select clause. (NotNull) + */ + public void classifySelectClauseType(SelectClauseType selectClauseType); + + /** + * Roll-back the type of select clause into previous one. If it has no + * change, classify its type into default type. + */ + public void rollbackSelectClauseType(); + + /** + * The type of select clause. + */ + public static enum SelectClauseType { + COLUMNS, COUNT, MAX, MIN, SUM, AVG + } } Modified: 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 2008-12-27 22:14:41 UTC (rev 1629) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/cbean/sqlclause/SqlClauseOracle.java 2008-12-27 22:18:30 UTC (rev 1630) @@ -71,12 +71,7 @@ if (!isFetchStartIndexSupported() && !isFetchSizeSupported()) { return; } - String ln = null; - if (isFormatClauseEffective()) { - ln = getLineSeparator(); - } else { - ln = ""; - } + String ln = getLineSeparator(); _fetchScopeSelectHint = " * from (select base.*, rownum as rn from (" + ln + "select"; _fetchScopeSqlSuffix = ""; Modified: 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 2008-12-27 22:14:41 UTC (rev 1629) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/dbmeta/AbstractDBMeta.java 2008-12-27 22:18:30 UTC (rev 1630) @@ -5,12 +5,11 @@ import java.util.Collection; import java.util.Collections; import java.util.HashMap; -import java.util.HashSet; import java.util.Iterator; import java.util.LinkedHashMap; import java.util.List; import java.util.Map; -import java.util.Set; +import java.util.concurrent.ConcurrentHashMap; import jp.sf.pal.scheduler.db.allcommon.Entity; import jp.sf.pal.scheduler.db.allcommon.dbmeta.info.ColumnInfo; @@ -22,6 +21,7 @@ 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.helper.StringKeyMap; 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; @@ -31,68 +31,113 @@ * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public abstract class AbstractDBMeta implements DBMeta { //========================================================================== // ========= + // Definition + // ========== + protected static final Object DUMMY_VALUE = new Object(); + + //========================================================================== + // ========= // Attribute // ========= - protected List _columnInfoList; + // ----------------------------------------------------- + // Information Resource + // -------------------- + // Initialized at its getter. + private StringKeyMap _tableDbNameFlexibleMap; + private StringKeyMap _tablePropertyNameFlexibleMap; + + private List _columnInfoList; + + private StringKeyMap _columnInfoFlexibleMap; + + // Initialized at hasMethod(). + private Map _methodNameMap = newConcurrentHashMap(); + //========================================================================== // ========= + // Table Info + // ========== + /** + * Get the flexible map of table DB name. + * + * @return The flexible map of table DB name. (NotNull, NotEmpty) + */ + protected Map getTableDbNameFlexibleMap() { + if (_tableDbNameFlexibleMap != null) { + return _tableDbNameFlexibleMap; + } + synchronized (this) { + if (_tableDbNameFlexibleMap != null) { + return _tableDbNameFlexibleMap; + } + _tableDbNameFlexibleMap = StringKeyMap.createAsFlexibleConcurrent(); + _tableDbNameFlexibleMap.put(getTableDbName(), getTableDbName()); + return _tableDbNameFlexibleMap; + } + } + + /** + * Get the flexible map of table property name. + * + * @return The flexible map of table property name. (NotNull, NotEmpty) + */ + protected Map getTablePropertyNameFlexibleMap() { + if (_tablePropertyNameFlexibleMap != null) { + return _tablePropertyNameFlexibleMap; + } + synchronized (this) { + if (_tablePropertyNameFlexibleMap != null) { + return _tablePropertyNameFlexibleMap; + } + _tablePropertyNameFlexibleMap = StringKeyMap + .createAsFlexibleConcurrent(); + _tablePropertyNameFlexibleMap.put(getTableDbName(), + getTablePropertyName()); + return _tableDbNameFlexibleMap; + } + } + + //========================================================================== + // ========= // Column Info // =========== /** * The implementation. * - * @param columnFlexibleName The flexible name of the column. (NotNull) + * @param columnFlexibleName The flexible name(IgnoreCase, IgnoreUnderscore) + * of the column. (NotNull, NotEmpty) * @return Determination. */ public boolean hasColumn(String columnFlexibleName) { - if (!hasFlexibleName(columnFlexibleName)) { - return false; - } - final String propertyName = findPropertyName(columnFlexibleName); - return hasMethod("column" + initCap(propertyName)); + assertStringNotNullAndNotTrimmedEmpty("columnFlexibleName", + columnFlexibleName); + return getColumnInfoFlexibleMap().containsKey(columnFlexibleName); } /** * The implementation. * - * @param columnFlexibleName The flexible name of the column. (NotNull and - * NotEmpty) + * @param columnFlexibleName The flexible name(IgnoreCase, IgnoreUnderscore) + * of the column. (NotNull, NotEmpty) * @return The information of the column. (NotNull) */ public ColumnInfo findColumnInfo(String columnFlexibleName) { assertStringNotNullAndNotTrimmedEmpty("columnFlexibleName", columnFlexibleName); - if (!hasColumn(columnFlexibleName)) { + final ColumnInfo columnInfo = getColumnInfoFlexibleMap().get( + columnFlexibleName); + if (columnInfo == null) { String msg = "Not found column by columnFlexibleName: " + columnFlexibleName; msg = msg + " tableName=" + getTableDbName(); throw new IllegalArgumentException(msg); } - String methodName = "column" - + initCap(findPropertyName(columnFlexibleName)); - Method method = null; - try { - method = this.getClass().getMethod(methodName, new Class[] {}); - } catch (NoSuchMethodException e) { - String msg = "Not found column by columnFlexibleName: " - + columnFlexibleName; - msg = msg + " tableName=" + getTableDbName() + " methodName=" - + methodName; - throw new RuntimeException(msg, e); - } - try { - return (ColumnInfo) method.invoke(this, new Object[] {}); - } catch (IllegalAccessException e) { - throw new RuntimeException(e); - } catch (java.lang.reflect.InvocationTargetException e) { - throw new RuntimeException(e.getCause()); - } + return columnInfo; } protected ColumnInfo cci(String columnDbName, String propertyName, @@ -114,7 +159,7 @@ /** * The implementation. * - * @return The list of columns. (NotNull and NotEmpty) + * @return The list of columns. (NotNull, NotEmpty) */ public List getColumnInfoList() { if (_columnInfoList != null) { @@ -144,79 +189,118 @@ } } - protected void initializeColumnInfoList() { - getColumnInfoList();// Ignore return value because of initialization - // only! + /** + * Get the flexible map of column information. + * + * @return The flexible map of column information. (NotNull, NotEmpty) + */ + protected Map getColumnInfoFlexibleMap() { + if (_columnInfoFlexibleMap != null) { + return _columnInfoFlexibleMap; + } + final List columnInfoList = getColumnInfoList(); + synchronized (this) { + if (_columnInfoFlexibleMap != null) { + return _columnInfoFlexibleMap; + } + _columnInfoFlexibleMap = StringKeyMap.createAsFlexibleConcurrent(); + for (ColumnInfo columnInfo : columnInfoList) { + _columnInfoFlexibleMap.put(columnInfo.getColumnDbName(), + columnInfo); + } + return _columnInfoFlexibleMap; + } } //========================================================================== - // =========== + // ========= + // Resource Initialization + // ======================= + protected void initializeInformationResource() { // for instance initializer + // of subclass. + // Initialize the flexible map of table DB name. + getTableDbNameFlexibleMap(); + + // Initialize the flexible map of table property name. + getTablePropertyNameFlexibleMap(); + + // Initialize the list of column information. + getColumnInfoList(); + + // Initialize the flexible map of column information. + getColumnInfoFlexibleMap(); + + // Initialize the map of (public)method name. + hasMethod("dummy"); + } + + //========================================================================== + // ========= // Name Handling // ============= /** * The implementation. * - * @param flexibleName Flexible-name(IgnoreCase). (NotNull and NotEmpty) + * @param flexibleName The flexible name(IgnoreCase, IgnoreUnderscore). + * (NotNull, NotEmpty) * @return Determination. */ public boolean hasFlexibleName(String flexibleName) { - final String key = flexibleName.toLowerCase(); - if (getDbNamePropertyNameKeyToLowerMap().containsKey(key)) { - return true; - } - if (getPropertyNameDbNameKeyToLowerMap().containsKey(key)) { - return true; - } - return false; + assertStringNotNullAndNotTrimmedEmpty("flexibleName", flexibleName); + + // It uses column before table because column is used much more than + // table. + // This is the same consideration at other methods. + return getColumnInfoFlexibleMap().containsKey(flexibleName) + || getTableDbNameFlexibleMap().containsKey(flexibleName); } /** * The implementation. * - * @param flexibleName Flexible-name(IgnoreCase). (NotNull and NotEmpty) - * @return DB name. (NotNull and NotEmpty) + * @param flexibleName The flexible name(IgnoreCase, IgnoreUnderscore). + * (NotNull, NotEmpty) + * @return DB name. (NotNull, NotEmpty) */ public String findDbName(String flexibleName) { - final String key = flexibleName.toLowerCase(); - if (getPropertyNameDbNameKeyToLowerMap().containsKey(key)) { - return (String) getPropertyNameDbNameKeyToLowerMap().get(key); + assertStringNotNullAndNotTrimmedEmpty("flexibleName", flexibleName); + final ColumnInfo columnInfoMap = getColumnInfoFlexibleMap().get( + flexibleName); + if (columnInfoMap != null) { + return columnInfoMap.getColumnDbName(); } - if (getDbNamePropertyNameKeyToLowerMap().containsKey(key)) { - final String dbNameKeyToLower = ((String) getDbNamePropertyNameKeyToLowerMap() - .get(key)).toLowerCase(); - if (getPropertyNameDbNameKeyToLowerMap().containsKey( - dbNameKeyToLower)) { - return (String) getPropertyNameDbNameKeyToLowerMap().get( - dbNameKeyToLower); - } + final String tableDbName = getTableDbNameFlexibleMap() + .get(flexibleName); + if (tableDbName != null) { + return tableDbName; } - String msg = "Not found object by the flexible name: flexibleName=" + String msg = "Not found DB name by the flexible name: flexibleName=" + flexibleName; - throw new IllegalStateException(msg); + throw new IllegalArgumentException(msg); } /** * The implementation. * - * @param flexibleName Flexible-name(IgnoreCase). (NotNull and NotEmpty) - * @return DB name. (NotNull and NotEmpty) + * @param flexibleName The flexible name(IgnoreCase, IgnoreUnderscore). + * (NotNull, NotEmpty) + * @return DB name. (NotNull, NotEmpty) */ public String findPropertyName(String flexibleName) { - final String key = flexibleName.toLowerCase(); - if (getDbNamePropertyNameKeyToLowerMap().containsKey(key)) { - return (String) getDbNamePropertyNameKeyToLowerMap().get(key); + assertStringNotNullAndNotTrimmedEmpty("flexibleName", flexibleName); + final ColumnInfo columnInfoMap = getColumnInfoFlexibleMap().get( + flexibleName); + if (columnInfoMap != null) { + return columnInfoMap.getPropertyName(); } - if (getPropertyNameDbNameKeyToLowerMap().containsKey(key)) { - final String dbNameToLower = ((String) getPropertyNameDbNameKeyToLowerMap() - .get(key)).toLowerCase(); - if (getDbNamePropertyNameKeyToLowerMap().containsKey(dbNameToLower)) { - return (String) getDbNamePropertyNameKeyToLowerMap().get( - dbNameToLower); - } + final String tablePropertyName = getTablePropertyNameFlexibleMap().get( + flexibleName); + if (tablePropertyName != null) { + return tablePropertyName; } - String msg = "Not found object by the flexible name: flexibleName=" + String msg = "Not found property name by the flexible name: flexibleName=" + flexibleName; - throw new IllegalStateException(msg); + throw new IllegalArgumentException(msg); } //========================================================================== @@ -735,10 +819,8 @@ protected void registerEntityPropertySetupper( String columnName, String propertyName, Eps setupper, Map> entityPropertySetupperMap) { + // Only column name is registered because the map must be flexible map. entityPropertySetupperMap.put(columnName, setupper); - entityPropertySetupperMap.put(propertyName, setupper); - entityPropertySetupperMap.put(columnName.toLowerCase(), setupper); - entityPropertySetupperMap.put(propertyName.toLowerCase(), setupper); } protected Eps findEps( @@ -945,6 +1027,7 @@ /** * This class is for Internal. Don't use this! */ + @SuppressWarnings("unchecked") protected static class MapStringValueAnalyzer { protected java.util.Map _valueMap; @@ -1072,6 +1155,7 @@ // ========= // Assist Helper // ============= + @SuppressWarnings("unchecked") protected ENTITY downcast(Entity entity) { checkDowncast(entity); return (ENTITY) entity; @@ -1118,10 +1202,10 @@ protected Map setupKeyToLowerMap(boolean dbNameKey) { final Map map; if (dbNameKey) { - map = newLinkedHashMap(getTableDbName().toLowerCase(), + map = newConcurrentHashMap(getTableDbName().toLowerCase(), getTablePropertyName()); } else { - map = newLinkedHashMap(getTablePropertyName().toLowerCase(), + map = newConcurrentHashMap(getTablePropertyName().toLowerCase(), getTableDbName()); } Method[] methods = this.getClass().getMethods(); @@ -1178,6 +1262,17 @@ return new HashMap(); } + protected ConcurrentHashMap newConcurrentHashMap() { + return new ConcurrentHashMap(); + } + + protected ConcurrentHashMap newConcurrentHashMap( + KEY key, VALUE value) { + ConcurrentHashMap map = newConcurrentHashMap(); + map.put(key, value); + return map; + } + protected LinkedHashMap newLinkedHashMap() { return new LinkedHashMap(); } @@ -1201,23 +1296,26 @@ // ----------------------------------------------------- // Reflection Handling // ------------------- - private Set _cachedMethodNames = new HashSet(); // for - - // performance - + /** + * Does it have the method? + * + * @param methodName The name of method. (NotNull, NotEmpty, + * PublicMethodOnly) + * @return Determination. + */ protected boolean hasMethod(String methodName) { assertStringNotNullAndNotTrimmedEmpty("methodName", methodName); - if (_cachedMethodNames.isEmpty()) { - synchronized (_cachedMethodNames) { - if (_cachedMethodNames.isEmpty()) { + if (_methodNameMap.isEmpty()) { + synchronized (_methodNameMap) { + if (_methodNameMap.isEmpty()) { final Method[] methods = this.getClass().getMethods(); for (Method method : methods) { - _cachedMethodNames.add(method.getName()); + _methodNameMap.put(method.getName(), DUMMY_VALUE); } } } } - return _cachedMethodNames.contains(methodName); + return _methodNameMap.containsKey(methodName); } // ----------------------------------------------------- Modified: 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 2008-12-27 22:14:41 UTC (rev 1629) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/dbmeta/DBMeta.java 2008-12-27 22:18:30 UTC (rev 1630) @@ -17,23 +17,22 @@ * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public interface DBMeta { //========================================================================== // ========= // Definition // ========== - /** Map-string map-mark. */ + /** Map-string map mark. */ public static final String MAP_STRING_MAP_MARK = "map:"; - /** Map-string list-mark. */ + /** Map-string list mark. */ public static final String MAP_STRING_LIST_MARK = "list:"; - /** Map-string start-brace. */ + /** Map-string start brace. */ public static final String MAP_STRING_START_BRACE = "@{"; - /** Map-string end-brace. */ + /** Map-string end brace. */ public static final String MAP_STRING_END_BRACE = "@}"; /** Map-string delimiter. */ @@ -47,23 +46,23 @@ // Table Info // ========== /** - * Get table db-name. + * Get table DB name. * - * @return Table db-name. (NotNull) + * @return Table DB name. (NotNull) */ public String getTableDbName(); /** - * Get table property-name(JavaBeansRule). + * Get table property name(JavaBeansRule). * - * @return Table property-name(JavaBeansRule). (NotNull) + * @return Table property name(JavaBeansRule). (NotNull) */ public String getTablePropertyName(); /** - * Get table SQL-name. + * Get table SQL name. * - * @return Table SQL-name. (NotNull) + * @return Table SQL name. (NotNull) */ public String getTableSqlName(); @@ -80,10 +79,10 @@ public boolean hasFlexibleName(String flexibleName); /** - * Find db name by flexible name. {Target objects are TABLE and COLUMN} + * Find DB name by flexible name. {Target objects are TABLE and COLUMN} * * @param flexibleName The flexible name. (NotNull and NotEmpty) - * @return Db name. (NotNull and NotEmpty) + * @return The DB name of anything. (NotNull and NotEmpty) */ public String findDbName(String flexibleName); @@ -92,60 +91,40 @@ * TABLE and COLUMN} * * @param flexibleName The flexible name. (NotNull and NotEmpty) - * @return Db name. (NotNull and NotEmpty) + * @return The DB name of anything. (NotNull and NotEmpty) */ public String findPropertyName(String flexibleName); //========================================================================== // ========= - // Name Map - // ======== - /** - * Get the key-to-lower map of DB name(lower) and property name. - * - * @return The key-to-lower map of DB name(lower) and property name. - * (NotNull) - */ - public Map 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 getPropertyNameDbNameKeyToLowerMap(); - - //========================================================================== - // ========= // Type Name // ========= /** - * Get the type-name of entity. + * Get the type name of entity. * - * @return The type-name of entity. (NotNull) + * @return The type name of entity. (NotNull) */ public String getEntityTypeName(); /** - * Get the type-name of condition-bean. + * Get the type name of condition-bean. * - * @return The type-name of condition-bean. (Nullable: If the condition-bean + * @return The type name of condition-bean. (Nullable: If the condition-bean * does not exist) */ public String getConditionBeanTypeName(); /** - * Get the type-name of dao. + * Get the type name of DAO. * - * @return The type-name of dao. (Nullable: If the dao does not exist) + * @return The type name of DAO. (Nullable: If the DAO does not exist) */ public String getDaoTypeName(); /** - * Get the type-name of behavior. + * Get the type name of behavior. * - * @return The type-name of behavior. (Nullable: If the behavior does not + * @return The type name of behavior. (Nullable: If the behavior does not * exist) */ public String getBehaviorTypeName(); Modified: 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 2008-12-27 22:14:41 UTC (rev 1629) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/dbmeta/DBMetaInstanceHandler.java 2008-12-27 22:18:30 UTC (rev 1630) @@ -1,127 +1,85 @@ package jp.sf.pal.scheduler.db.allcommon.dbmeta; -import java.util.Collections; -import java.util.LinkedHashMap; +import java.lang.reflect.Method; import java.util.Map; import java.util.Set; +import java.util.concurrent.ConcurrentHashMap; +import jp.sf.pal.scheduler.db.allcommon.helper.StringKeyMap; import jp.sf.pal.scheduler.db.allcommon.util.SimpleAssertUtil; /** - * DBMeta instance handler. + * The instance handler of DB meta. * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public class DBMetaInstanceHandler { //========================================================================== // ========= // Definition // ========== + /** Log-instance. */ + private static final org.apache.commons.logging.Log _log = org.apache.commons.logging.LogFactory + .getLog(DBMetaInstanceHandler.class); + + //========================================================================== + // ========= + // Resource Map + // ============ /** Table DB-name instance map. */ - protected static final Map _tableDbNameInstanceMap = new LinkedHashMap(); + protected static final Map _tableDbNameInstanceMap = newConcurrentHashMap(); - /** The map of table DB-name and class name. */ - protected static final Map _tableDbNameClassNameMap; - static { - Map tmpMap = new LinkedHashMap(); + /** The map of table DB name and class name. This is for initialization. */ + protected static final Map _tableDbNameClassNameMap = newConcurrentHashMap(); - tmpMap.put("EVENT_SCHEDULE", - "jp.sf.pal.scheduler.db.bsentity.dbmeta.EventScheduleDbm"); - tmpMap - .put("EVENT_SCHEDULE_CONTENT", - "jp.sf.pal.scheduler.db.bsentity.dbmeta.EventScheduleContentDbm"); - tmpMap - .put("EVENT_SCHEDULE_MAPPING", - "jp.sf.pal.scheduler.db.bsentity.dbmeta.EventScheduleMappingDbm"); - tmpMap.put("FACILITY", - "jp.sf.pal.scheduler.db.bsentity.dbmeta.FacilityDbm"); - tmpMap.put("FACILITY_CONTENT", - "jp.sf.pal.scheduler.db.bsentity.dbmeta.FacilityContentDbm"); - tmpMap.put("FACILITY_GROUP", - "jp.sf.pal.scheduler.db.bsentity.dbmeta.FacilityGroupDbm"); - tmpMap - .put("FACILITY_SCHEDULE_MAPPING", - "jp.sf.pal.scheduler.db.bsentity.dbmeta.FacilityScheduleMappingDbm"); - 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("USER_INFO", - "jp.sf.pal.scheduler.db.bsentity.dbmeta.UserInfoDbm"); + /** The flexible map of table DB name. This is for conversion at finding. */ + protected static final Map _tableDbNameFlexibleMap = StringKeyMap + .createAsFlexibleConcurrent(); - _tableDbNameClassNameMap = Collections.unmodifiableMap(tmpMap); - } + /** The count of setting up resources of DB meta for internal information. */ + protected static int setupCount = 0; - /** The key-to-lower map of DB-name and property-name for table. */ - protected static final Map _tableDbNamePropertyNameKeyToLowerMap; - static { - Map tmpMap = new LinkedHashMap(); - - tmpMap.put("EVENT_SCHEDULE".toLowerCase(), "eventSchedule"); - tmpMap.put("EVENT_SCHEDULE_CONTENT".toLowerCase(), - "eventScheduleContent"); - tmpMap.put("EVENT_SCHEDULE_MAPPING".toLowerCase(), - "eventScheduleMapping"); - tmpMap.put("FACILITY".toLowerCase(), "facility"); - tmpMap.put("FACILITY_CONTENT".toLowerCase(), "facilityContent"); - tmpMap.put("FACILITY_GROUP".toLowerCase(), "facilityGroup"); - tmpMap.put("FACILITY_SCHEDULE_MAPPING".toLowerCase(), - "facilityScheduleMapping"); - 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("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 _tablePropertyNameDbNameKeyToLowerMap; - static { - Map tmpMap = new LinkedHashMap(); - - tmpMap.put("eventSchedule".toLowerCase(), "EVENT_SCHEDULE"); - tmpMap.put("eventScheduleContent".toLowerCase(), - "EVENT_SCHEDULE_CONTENT"); - tmpMap.put("eventScheduleMapping".toLowerCase(), - "EVENT_SCHEDULE_MAPPING"); - tmpMap.put("facility".toLowerCase(), "FACILITY"); - tmpMap.put("facilityContent".toLowerCase(), "FACILITY_CONTENT"); - tmpMap.put("facilityGroup".toLowerCase(), "FACILITY_GROUP"); - tmpMap.put("facilityScheduleMapping".toLowerCase(), - "FACILITY_SCHEDULE_MAPPING"); - 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("userInfo".toLowerCase(), "USER_INFO"); - - _tablePropertyNameDbNameKeyToLowerMap = Collections - .unmodifiableMap(tmpMap); - } - - protected static DBMeta getDBMeta(String className) { - try { - Class clazz = Class.forName(className); - java.lang.reflect.Method methoz = clazz.getMethod("getInstance", - (Class[]) null); - Object result = methoz.invoke(null, (Object[]) null); - return (DBMeta) result; - } catch (Exception e) { - throw new RuntimeException(e); + /** + * Set up the resource of DBMeta. Lock this class. + * + * @param tableDbNameClassNameMap The map of table DB name and class name. + * (NotNull) + */ + public static synchronized void setupDBMetaResource( + Map tableDbNameClassNameMap) { + if (tableDbNameClassNameMap == null) { + String msg = "The argument 'tableDbNameClassNameMap' should not be null"; + msg = msg + " at DBMetaInstanceHandler.setupDBMetaResource()"; + throw new IllegalArgumentException(msg); } + if (tableDbNameClassNameMap.isEmpty()) { + String msg = "The argument 'tableDbNameClassNameMap' should not be empty"; + msg = msg + " at DBMetaInstanceHandler.setupDBMetaResource()"; + throw new IllegalArgumentException(msg); + } + final String firstMsg = "...Setting up resources of DB meta"; + final int tableCount = tableDbNameClassNameMap.size(); + if (setupCount == 0) { + _log.info(firstMsg + ": tables=" + tableCount); // basically here + } else { + _log.info(firstMsg + " AGAIN(" + (setupCount + 1) + + " times): tables=" + tableCount); + } + _tableDbNameInstanceMap.clear(); + _tableDbNameClassNameMap.clear(); + _tableDbNameFlexibleMap.clear(); + final Set tableDbNameSet = tableDbNameClassNameMap.keySet(); + for (String tableDbName : tableDbNameSet) { + final String className = tableDbNameClassNameMap.get(tableDbName); + _tableDbNameClassNameMap.put(tableDbName, className); + _tableDbNameFlexibleMap.put(tableDbName, tableDbName); + } + ++setupCount; } /** - * @return The initialized map that contains all instances of dbmeta. + * @return The initialized map that contains all instances of DB meta. * (NotNull & NotEmpty) */ public static Map getDBMetaMap() { @@ -154,45 +112,31 @@ // Main Method // =========== /** - * Find dbmeta by table flexible-name. + * Find DB meta by table flexible name. * *
-     * If the table name is 'ORDER_DETAIL', you can find the dbmeta by ...(as follows)
+     * If the table name is 'ORDER_DETAIL', you can find the DB meta by ...(as follows)
      *     'ORDER_DETAIL', 'ORDer_DeTAiL', 'order_detail'
      *     , 'OrderDetail', 'orderdetail', 'oRderDetaIl'
      * 
* - * @param tableFlexibleName Table flexible-name. (NotNull) - * @return The instance of dbmeta. (NotNull) - * @exception DBMetaNotFoundException When the dbmeta is not found. + * @param tableFlexibleName The flexible name of table. (NotNull) + * @return The instance of DB meta. (NotNull) + * @exception DBMetaNotFoundException When the DB meta is not found. */ public static DBMeta findDBMeta(String tableFlexibleName) { assertStringNotNullAndNotTrimmedEmpty("tableFlexibleName", tableFlexibleName); - if (_tableDbNameInstanceMap.containsKey(tableFlexibleName)) { - return byTableDbName(tableFlexibleName); - } - String toLowerKey = tableFlexibleName.toLowerCase(); - if (_tableDbNamePropertyNameKeyToLowerMap.containsKey(toLowerKey)) { - String propertyName = (String) _tableDbNamePropertyNameKeyToLowerMap - .get(toLowerKey); - String dbName = (String) _tablePropertyNameDbNameKeyToLowerMap - .get(propertyName.toLowerCase()); - return byTableDbName(dbName); - } - if (_tablePropertyNameDbNameKeyToLowerMap.containsKey(toLowerKey)) { - String dbName = (String) _tablePropertyNameDbNameKeyToLowerMap - .get(toLowerKey); - return byTableDbName(dbName); - } final int dotLastIndex = tableFlexibleName.lastIndexOf("."); if (dotLastIndex >= 0) { - try { - return findDBMeta(tableFlexibleName.substring(dotLastIndex + 1)); - } catch (DBMetaNotFoundException e) { - // Nothing - } + tableFlexibleName = tableFlexibleName.substring(dotLastIndex + + ".".length()); } + final String tableDbName = _tableDbNameFlexibleMap + .get(tableFlexibleName); + if (tableDbName != null) { + return byTableDbName(tableDbName); + } String msg = "The instance map returned null by the key: key=" + tableFlexibleName + " instanceMap=" + _tableDbNameInstanceMap; throw new DBMetaNotFoundException(msg); @@ -216,8 +160,9 @@ assertStringNotNullAndNotTrimmedEmpty("tableDbName", tableDbName); DBMeta instance = getCachedDBMeta(tableDbName); if (instance == null) { - String msg = "The instance map returned null by the key: key=" - + tableDbName + " instanceMap=" + _tableDbNameInstanceMap; + String msg = "The instance map returned null by the key:"; + msg = msg + " key=" + tableDbName + " instanceMap=" + + _tableDbNameInstanceMap; throw new DBMetaNotFoundException(msg); } return instance; @@ -239,10 +184,25 @@ return _tableDbNameInstanceMap.get(tableName); } + protected static DBMeta getDBMeta(String className) { + try { + Class clazz = Class.forName(className); + Method methoz = clazz.getMethod("getInstance", (Class[]) null); + Object result = methoz.invoke(null, (Object[]) null); + return (DBMeta) result; + } catch (Exception e) { + throw new RuntimeException(e); + } + } + //========================================================================== // ========= // General Helper // ============== + protected static ConcurrentHashMap newConcurrentHashMap() { + return new ConcurrentHashMap(); + } + // ----------------------------------------------------- // Assert Object // ------------- Modified: 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 2008-12-27 22:14:41 UTC (rev 1629) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/dbmeta/hierarchy/HierarchyArranger.java 2008-12-27 22:18:30 UTC (rev 1630) @@ -222,7 +222,6 @@ * @author DBFlute(AutoGenerator) * @param The type of local entity extends Entity */ - ¡÷ SuppressWarnings("unchecked") public class HierarchyArranger { //========================================================================== @@ -457,9 +456,9 @@ List referrerList = extractReferrerList(localEntity, referrerInfo); if (referrerList == null) { - String msg = "The referrer list should not be null: localEntity=" - + localEntity + " referrerInfo=" + referrerInfo; - throw new IllegalStateException(msg); + // Initialize the list of referrer and inject it. + referrerList = new ArrayList(); + injectReferrerList(localEntity, referrerInfo, referrerList); } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -765,8 +764,8 @@ return capPropReferrerName; } - private java.lang.reflect.Method findMethod(Class clazz, String methodName, - Class[] argTypes) { + private java.lang.reflect.Method findMethod(Class clazz, + String methodName, Class[] argTypes) { try { return clazz.getMethod(methodName, argTypes); } catch (NoSuchMethodException ex) { @@ -852,10 +851,10 @@ return sb.toString(); } - private String createTypeViewFromTypeArray(Class[] array) { + private String createTypeViewFromTypeArray(Class[] array) { final StringBuffer sb = new StringBuffer(); for (int i = 0; i < array.length; i++) { - final Class type = array[i]; + final Class type = array[i]; if (sb.length() == 0) { sb.append(type.getSimpleName()); } else { Modified: 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 2008-12-27 22:14:41 UTC (rev 1629) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/dbmeta/hierarchy/HierarchyRequest.java 2008-12-27 22:18:30 UTC (rev 1630) @@ -16,7 +16,6 @@ * @author DBFlute(AutoGenerator) * @param The type of local entity. */ - ¡÷ SuppressWarnings("unchecked") public class HierarchyRequest { //========================================================================== Modified: 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 2008-12-27 22:14:41 UTC (rev 1629) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/dbmeta/hierarchy/HierarchyRequestElement.java 2008-12-27 22:18:30 UTC (rev 1630) @@ -9,7 +9,6 @@ /** * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public class HierarchyRequestElement { //========================================================================== Modified: 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 2008-12-27 22:14:41 UTC (rev 1629) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/dbmeta/hierarchy/HierarchySourceColumn.java 2008-12-27 22:18:30 UTC (rev 1630) @@ -3,7 +3,6 @@ /** * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public interface HierarchySourceColumn { public String getColumnName(); Modified: 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 2008-12-27 22:14:41 UTC (rev 1629) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/dbmeta/hierarchy/HierarchySourceIterator.java 2008-12-27 22:18:30 UTC (rev 1630) @@ -3,7 +3,6 @@ /** * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public interface HierarchySourceIterator { public boolean hasNext(); Modified: 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 2008-12-27 22:14:41 UTC (rev 1629) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/dbmeta/hierarchy/HierarchySourceRow.java 2008-12-27 22:18:30 UTC (rev 1630) @@ -3,7 +3,6 @@ /** * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public interface HierarchySourceRow { public Object extractColumnValue(HierarchySourceColumn columnInfo); Modified: 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 2008-12-27 22:14:41 UTC (rev 1629) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/dbmeta/info/ColumnInfo.java 2008-12-27 22:18:30 UTC (rev 1630) @@ -8,7 +8,6 @@ * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public class ColumnInfo { //========================================================================== Modified: 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 2008-12-27 22:14:41 UTC (rev 1629) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/dbmeta/info/RelationInfo.java 2008-12-27 22:18:30 UTC (rev 1630) @@ -1,13 +1,14 @@ package jp.sf.pal.scheduler.db.allcommon.dbmeta.info; +import java.util.Map; + import jp.sf.pal.scheduler.db.allcommon.dbmeta.DBMeta; /** - * The class of referer information. + * The class of referrer information. * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public interface RelationInfo { public String getRelationPropertyName(); @@ -16,7 +17,7 @@ public DBMeta getTargetDBMeta(); - public java.util.Map getLocalTargetColumnInfoMap(); + public Map getLocalTargetColumnInfoMap(); public boolean isOneToOne(); Modified: 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 2008-12-27 22:14:41 UTC (rev 1629) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/helper/MapStringBuilderImpl.java 2008-12-27 22:18:30 UTC (rev 1630) @@ -1,17 +1,20 @@ package jp.sf.pal.scheduler.db.allcommon.helper; +import java.util.Arrays; +import java.util.List; + 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. + * The implementation of map-string builder. * * @author DBFlute(AutoGenerator) */ public class MapStringBuilderImpl implements MapStringBuilder { - protected java.util.List _columnNameList; + protected List _columnNameList; protected String _msMapMark; @@ -26,10 +29,10 @@ protected boolean _trimDoubleQuotation; public void setColumnNames(String[] columnNames) { - _columnNameList = java.util.Arrays.asList(columnNames); + _columnNameList = Arrays.asList(columnNames); } - public void setColumnNameList(java.util.List columnNameList) { + public void setColumnNameList(List columnNameList) { _columnNameList = columnNameList; } @@ -83,7 +86,7 @@ return sb.toString(); } - public String buildFromList(java.util.List valueList) { + public String buildFromList(List valueList) { if (valueList == null) { String msg = "The argument[valueList] should not be null."; throw new IllegalArgumentException(msg); @@ -103,7 +106,7 @@ return sb.toString(); } - protected java.util.List tokenize(String value, String delimiter) { + protected List tokenize(String value, String delimiter) { final LineToken lineToken = new LineTokenImpl(); final LineTokenizingOption lineTokenizingOption = new LineTokenizingOption(); lineTokenizingOption.setDelimiter(delimiter); @@ -144,8 +147,8 @@ } } - protected void assertColumnValueList(java.util.List columnNameList, - java.util.List valueList) { + protected void assertColumnValueList(List columnNameList, + List valueList) { if (columnNameList.size() != valueList.size()) { String msg = "The length of columnNameList and valueList are difference. (" + columnNameList.size() + ", " + valueList.size() + ")"; Added: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/helper/StringKeyMap.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/helper/StringKeyMap.java (rev 0) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/helper/StringKeyMap.java 2008-12-27 22:18:30 UTC (rev 1630) @@ -0,0 +1,201 @@ +package jp.sf.pal.scheduler.db.allcommon.helper; + +import java.util.Collection; +import java.util.HashMap; +import java.util.Map; +import java.util.Set; +import java.util.concurrent.ConcurrentHashMap; + +/** + * @author DBFlute(AutoGenerator) + * @param The type of value. + */ +public class StringKeyMap implements Map { + + //========================================================================== + // ========= + // Attribute + // ========= + protected final Map _internalMap; + + protected boolean _removeUnderscore; + + //========================================================================== + // ========= + // Constructor + // =========== + protected StringKeyMap(boolean removeUnderscore, boolean concurrent) { + _removeUnderscore = removeUnderscore; + if (concurrent) { + _internalMap = newConcurrentHashMap(); + } else { + _internalMap = newHashMap(); + } + } + + public static StringKeyMap createAsFlexible() { + return new StringKeyMap(true, false); + } + + public static StringKeyMap createAsFlexibleConcurrent() { + return new StringKeyMap(true, true); + } + + public static StringKeyMap createAsCaseInsensitive() { + return new StringKeyMap(false, false); + } + + public static StringKeyMap createAsCaseInsensitiveConcurrent() { + return new StringKeyMap(false, true); + } + + //========================================================================== + // ========= + // Map Emulator + // ============ + // ----------------------------------------------------- + // Key Related + // ----------- + public VALUE get(Object key) { + final String stringKey = convertStringKey(key); + if (stringKey != null) { + return _internalMap.get(stringKey); + } + return null; + } + + public VALUE put(String key, VALUE value) { + final String stringKey = convertStringKey(key); + if (stringKey != null) { + return _internalMap.put(stringKey, value); + } + return null; + } + + public VALUE remove(Object key) { + final String stringKey = convertStringKey(key); + if (stringKey != null) { + return _internalMap.remove(stringKey); + } + return null; + } + + public final void putAll(Map map) { + final Set keySet = map.keySet(); + for (String key : keySet) { + put(key, map.get(key)); + } + } + + public boolean containsKey(Object key) { + return get(key) != null; + } + + // ----------------------------------------------------- + // Delegate + // -------- + public void clear() { + _internalMap.clear(); + } + + public int size() { + return _internalMap.size(); + } + + public boolean isEmpty() { + return _internalMap.isEmpty(); + } + + public Set keySet() { + return _internalMap.keySet(); + } + + public Collection values() { + return _internalMap.values(); + } + + public boolean containsValue(Object obj) { + return _internalMap.containsValue(obj); + } + + public Set> entrySet() { + return _internalMap.entrySet(); + } + + //========================================================================== + // ========= + // Key Converter + // ============= + protected String convertStringKey(Object key) { + if (!(key instanceof String)) { + return null; + } + return toLowerCase(removeUnderscore((String) key)); + } + + protected String removeUnderscore(String value) { + if (_removeUnderscore) { + return replace(value, "_", ""); + } + return value; + } + + protected String toLowerCase(String value) { + return value.toLowerCase(); + } + + //========================================================================== + // ========= + // General Helper + // ============== + protected static String replace(String text, String fromText, String toText) { + if (text == null || fromText == null || toText == null) { + return null; + } + StringBuilder sb = new StringBuilder(100); + int pos = 0; + int pos2 = 0; + while (true) { + pos = text.indexOf(fromText, pos2); + if (pos == 0) { + sb.append(toText); + pos2 = fromText.length(); + } else if (pos > 0) { + sb.append(text.substring(pos2, pos)); + sb.append(toText); + pos2 = pos + fromText.length(); + } else { + sb.append(text.substring(pos2)); + break; + } + } + return sb.toString(); + } + + protected static ConcurrentHashMap newConcurrentHashMap() { + return new ConcurrentHashMap(); + } + + protected static HashMap newHashMap() { + return new HashMap(); + } + + //========================================================================== + // ========= + // Basic Override + // ============== + @Override + public boolean equals(Object obj) { + return _internalMap.equals(obj); + } + + @Override + public int hashCode() { + return _internalMap.hashCode(); + } + + @Override + public String toString() { + return _internalMap.toString(); + } +} \ No newline at end of file Property changes on: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/helper/StringKeyMap.java ___________________________________________________________________ Name: svn:eol-style + native Added: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/helper/StringSet.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/helper/StringSet.java (rev 0) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/helper/StringSet.java 2008-12-27 22:18:30 UTC (rev 1630) @@ -0,0 +1,233 @@ +package jp.sf.pal.scheduler.db.allcommon.helper; + +import java.util.Collection; +import java.util.HashMap; +import java.util.Iterator; +import java.util.Map; +import java.util.Set; +import java.util.concurrent.ConcurrentHashMap; + +/** + * @author DBFlute(AutoGenerator) + */ +public class StringSet implements Set { + + //========================================================================== + // ========= + // Definition + // ========== + protected static final Object DUMMY_VALUE = new Object(); + + //========================================================================== + // ========= + // Attribute + // ========= + protected final Map _internalMap; + + protected boolean _removeUnderscore; + + //========================================================================== + // ========= + // Constructor + // =========== + protected StringSet(boolean removeUnderscore, boolean concurrent) { + _removeUnderscore = removeUnderscore; + if (concurrent) { + _internalMap = newConcurrentHashMap(); + } else { + _internalMap = newHashMap(); + } + } + + public static StringSet createAsFlexible() { + return new StringSet(true, false); + } + + public static StringSet createAsFlexibleConcurrent() { + return new StringSet(true, true); + } + + public static StringSet createAsCaseInsensitive() { + return new StringSet(false, false); + } + + public static StringSet createAsCaseInsensitiveConcurrent() { + return new StringSet(false, true); + } + + //========================================================================== + // ========= + // Map Emulator + // ============ + // ----------------------------------------------------- + // Key Related + // ----------- + public boolean add(String value) { + final String stringValue = convertStringKey(value); + if (stringValue != null) { + return _internalMap.put(stringValue, DUMMY_VALUE) != null; + } + return false; + } + + public boolean remove(Object value) { + final String stringValue = convertStringKey(value); + if (stringValue != null) { + return _internalMap.remove(stringValue) != null; + } + return false; + } + + public boolean contains(Object value) { + final String stringValue = convertStringKey(value); + if (stringValue != null) { + return _internalMap.containsKey(stringValue); + } + return false; + } + + // ----------------------------------------------------- + // Delegate + // -------- + public void clear() { + _internalMap.clear(); + } + + public int size() { + return _internalMap.size(); + } + + public boolean isEmpty() { + return _internalMap.isEmpty(); + } + + public boolean addAll(Collection c) { + boolean success = false; + for (String s : c) { + if (add(s)) { + success = true; + } + } + return success; + } + + public boolean removeAll(Collection c) { + boolean success = false; + for (Object s : c) { + if (remove(s)) { + success = true; + } + } + return success; + } + + public boolean containsAll(Collection c) { + for (Object s : c) { + if (contains(s)) { + return true; + } + } + return false; + } + + public Iterator iterator() { + return _internalMap.keySet().iterator(); + } + + public boolean retainAll(Collection c) { + boolean success = false; + for (Object s : c) { + if (!contains(s)) { + if (remove(s)) { + success = true; + } + } + } + return success; + } + + public Object[] toArray() { + return _internalMap.keySet().toArray(); + } + + public T[] toArray(T[] a) { + return _internalMap.keySet().toArray(a); + } + + //========================================================================== + // ========= + // Key Converter + // ============= + protected String convertStringKey(Object value) { + if (!(value instanceof String)) { + return null; + } + return toLowerCase(removeUnderscore((String) value)); + } + + protected String removeUnderscore(String value) { + if (_removeUnderscore) { + return replace(value, "_", ""); + } + return value; + } + + protected String toLowerCase(String value) { + return value.toLowerCase(); + } + + //========================================================================== + // ========= + // General Helper + // ============== + protected static String replace(String text, String fromText, String toText) { + if (text == null || fromText == null || toText == null) { + return null; + } + StringBuilder sb = new StringBuilder(100); + int pos = 0; + int pos2 = 0; + while (true) { + pos = text.indexOf(fromText, pos2); + if (pos == 0) { + sb.append(toText); + pos2 = fromText.length(); + } else if (pos > 0) { + sb.append(text.substring(pos2, pos)); + sb.append(toText); + pos2 = pos + fromText.length(); + } else { + sb.append(text.substring(pos2)); + break; + } + } + return sb.toString(); + } + + protected static ConcurrentHashMap newConcurrentHashMap() { + return new ConcurrentHashMap(); + } + + protected static HashMap newHashMap() { + return new HashMap(); + } + + //========================================================================== + // ========= + // Basic Override + // ============== + @Override + public boolean equals(Object obj) { + return _internalMap.keySet().equals(obj); + } + + @Override + public int hashCode() { + return _internalMap.keySet().hashCode(); + } + + @Override + public String toString() { + return _internalMap.keySet().toString(); + } +} \ No newline at end of file Property changes on: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/helper/StringSet.java ___________________________________________________________________ Name: svn:eol-style + native Added: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/s2dao/BeanMetaDataFactoryExtension.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/s2dao/BeanMetaDataFactoryExtension.java (rev 0) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/s2dao/BeanMetaDataFactoryExtension.java 2008-12-27 22:18:30 UTC (rev 1630) @@ -0,0 +1,213 @@ +package jp.sf.pal.scheduler.db.allcommon.s2dao; + +import java.sql.DatabaseMetaData; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.concurrent.ConcurrentHashMap; + +import jp.sf.pal.scheduler.db.allcommon.Entity; +import jp.sf.pal.scheduler.db.allcommon.s2dao.internal.various.InternalIdentifierGeneratorFactory; + +import org.seasar.dao.BeanMetaData; +import org.seasar.dao.IdentifierGenerator; +import org.seasar.dao.impl.BeanMetaDataFactoryImpl; +import org.seasar.dao.impl.BeanMetaDataImpl; +import org.seasar.extension.jdbc.PropertyType; +import org.seasar.framework.beans.PropertyDesc; + +/** + * BeanMetaDataFactoryImpl for DBFlute. + * + * @author DBFlute(AutoGenerator) + */ + ¡÷ SuppressWarnings("unchecked") +public class BeanMetaDataFactoryExtension extends BeanMetaDataFactoryImpl { + + //========================================================================== + // ========= + // Attribute + // ========= + /** The map of bean meta data for cache. */ + protected Map, BeanMetaData> _metaMap = newConcurrentHashMap(); + + //========================================================================== + // ========= + // Override for Cache + // ================== + @Override + public BeanMetaData createBeanMetaData(Class beanClass) { + final BeanMetaData cachedMeta = findCachedMeta(beanClass); + if (cachedMeta != null) { + return cachedMeta; + } else { + return super.createBeanMetaData(beanClass); + } + } + + @Override + public BeanMetaData createBeanMetaData(Class beanClass, + int relationNestLevel) { + final BeanMetaData cachedMeta = findCachedMeta(beanClass); + if (cachedMeta != null) { + return cachedMeta; + } else { + return super.createBeanMetaData(beanClass, relationNestLevel); + } + } + + @Override + public BeanMetaData createBeanMetaData(DatabaseMetaData dbMetaData, + Class beanClass, int relationNestLevel) { + final BeanMetaData cachedMeta = findOrCreateCachedMetaIfNeeds( + dbMetaData, beanClass, relationNestLevel); + if (cachedMeta != null) { + return cachedMeta; + } else { + return super.createBeanMetaData(dbMetaData, beanClass, + relationNestLevel); + } + } + + protected BeanMetaData findCachedMeta(Class beanClass) { + if (isDBFluteEntity(beanClass)) { + final BeanMetaData cachedMeta = getMetaFromCache(beanClass); + if (cachedMeta != null) { + return cachedMeta; + } + } + return null; + } + + protected BeanMetaData findOrCreateCachedMetaIfNeeds( + DatabaseMetaData dbMetaData, Class beanClass, int relationNestLevel) { + if (isDBFluteEntity(beanClass)) { + final BeanMetaData cachedMeta = getMetaFromCache(beanClass); + if (cachedMeta != null) { + return cachedMeta; + } else { + return super.createBeanMetaData(dbMetaData, beanClass, 0); + } + } + return null; + } + + //========================================================================== + // ========= + // BeanMetaData Creation + // ===================== + @Override + protected BeanMetaDataImpl createBeanMetaDataImpl() { + // /= = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = + // = = + // for ConditionBean and insert() and update() and delete() and so on... + // = = = = = = = = = =/ + return new BeanMetaDataImpl() { + protected List _internalIdentifierGeneratorList = new ArrayList(); + + protected Map _internalIdentifierGeneratorsByPropertyName = newConcurrentHashMap(); + + // /= = = = = = = + // for cache + // = = = = =/ + @Override + public void initialize() { // for Cache + final Class myBeanClass = getBeanClass(); + if (isDBFluteEntity(myBeanClass)) { + final BeanMetaData cachedMeta = getMetaFromCache(myBeanClass); + if (cachedMeta == null) { + _metaMap.put(myBeanClass, this); + } + } + super.initialize(); + } + + // /= = = = = = = + // for insert() + // = = = = =/ + // The attributes 'identifierGenerators' and + // 'identifierGeneratorsByPropertyName' + // of super class are unused. It prepares original atributes here. + @Override + protected void setupIdentifierGenerator(PropertyType propertyType) { + final PropertyDesc pd = propertyType.getPropertyDesc(); + final String propertyName = propertyType.getPropertyName(); + final String idType = beanAnnotationReader.getId(pd, getDbms()); + final IdentifierGenerator generator = createInternalIdentifierGenerator( + propertyType, idType); + _internalIdentifierGeneratorList.add(generator); + _internalIdentifierGeneratorsByPropertyName.put(propertyName, + generator); + } + + protected IdentifierGenerator createInternalIdentifierGenerator( + PropertyType propertyType, String idType) { + return InternalIdentifierGeneratorFactory + .createIdentifierGenerator(propertyType, getDbms(), + idType); + } + + @Override + public IdentifierGenerator getIdentifierGenerator(int index) { + return _internalIdentifierGeneratorList.get(index); + } + + @Override + public int getIdentifierGeneratorSize() { + return _internalIdentifierGeneratorList.size(); + } + + @Override + public IdentifierGenerator getIdentifierGenerator( + String propertyName) { + return _internalIdentifierGeneratorsByPropertyName + .get(propertyName); + } + }; + } + + // /= = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = + // Other extension points about BeanMetaDataImpl is as follows: + // + // S2DaoMetaDataExtension.createNonConcurrencyBmdFactory() + // --> for NonConcurrency (updateNonstrict() and deleteNonstrict() and so + // on...) + // + // S2DaoMetaDataExtension.createOutsideSqlCustomizeBeanMetaDataFactory() + // --> for OutsideSql but it overrides nothing. + // = = = = = = = = = =/ + + //========================================================================== + // ========= + // Relation Next Level + // =================== + /** + * Get the limit nest level of relation. + * + * @return The limit nest level of relation. + */ + @Override + protected int getLimitRelationNestLevel() { + return 2; // for Compatible to old version DBFlute + } + + //========================================================================== + // ========= + // General Helper + // ============== + protected ConcurrentHashMap newConcurrentHashMap() { + return new ConcurrentHashMap(); + } + + //========================================================================== + // ========= + // Assist Helper + // ============= + protected boolean isDBFluteEntity(Class beanClass) { + return Entity.class.isAssignableFrom(beanClass); + } + + protected BeanMetaData getMetaFromCache(Class beanClass) { + return _metaMap.get(beanClass); + } +} \ No newline at end of file Property changes on: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/s2dao/BeanMetaDataFactoryExtension.java ___________________________________________________________________ Name: svn:eol-style + native Deleted: 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 2008-12-27 22:14:41 UTC (rev 1629) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/s2dao/FetchNarrowingResultSetFactory.java 2008-12-27 22:18:30 UTC (rev 1630) @@ -1,125 +0,0 @@ -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); - } -} Modified: 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 2008-12-27 22:14:41 UTC (rev 1629) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/s2dao/FetchNarrowingResultSetWrapper.java 2008-12-27 22:18:30 UTC (rev 1630) @@ -4,6 +4,7 @@ import java.sql.SQLException; import java.sql.Statement; +import jp.sf.pal.scheduler.db.allcommon.DBDef; import jp.sf.pal.scheduler.db.allcommon.cbean.FetchNarrowingBean; import jp.sf.pal.scheduler.db.allcommon.s2dao.internal.sqlhandler.InternalBasicHandler.SQLExceptionHandler; @@ -41,6 +42,9 @@ /** Does it skip to cursor end? */ protected boolean _skipToCursorEnd; + /** Is the database DB2? */ + protected final boolean _db2 = DBDef.isCurrentDef(DBDef.DB2); + //========================================================================== // ========= // Constructor @@ -71,7 +75,7 @@ // Skip // ==== /** - * Skip to start-index. + * Skip to the point at start index. */ protected void skip() { if (!isAvailableSkipRecord()) { @@ -125,12 +129,15 @@ // Next // ==== /** - * Next. + * Move to the next record. * * @return Does the result set have next record? * @throws SQLException */ public boolean next() throws SQLException { + if (_db2 && _skipToCursorEnd) { // [DBFLUTE-243] + return false; + } final boolean hasNext = super.next(); ++_requestCounter; if (!isAvailableLimitLoopCount()) { Added: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/s2dao/PropertyTypeFactoryBuilderExtension.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/s2dao/PropertyTypeFactoryBuilderExtension.java (rev 0) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/s2dao/PropertyTypeFactoryBuilderExtension.java 2008-12-27 22:18:30 UTC (rev 1630) @@ -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 PropertyTypeFactoryBuilderExtension implements + PropertyTypeFactoryBuilder { + + //========================================================================== + // ========= + // Attribute + // ========= + protected ValueTypeFactory valueTypeFactory; + + protected ColumnNaming columnNaming; + + //========================================================================== + // ========= + // Build + // ===== + public PropertyTypeFactory build(Class beanClass, + BeanAnnotationReader beanAnnotationReader) { + return new FastPropertyTypeFactoryExtension(beanClass, + beanAnnotationReader, valueTypeFactory, columnNaming); + } + + public PropertyTypeFactory build(Class beanClass, + BeanAnnotationReader beanAnnotationReader, Dbms dbms, + DatabaseMetaData databaseMetaData) { + return new FastPropertyTypeFactoryExtension(beanClass, + beanAnnotationReader, valueTypeFactory, columnNaming, dbms); + } + + //========================================================================== + // ========= + // Extension Class + // =============== + protected static class FastPropertyTypeFactoryExtension extends + AbstractPropertyTypeFactory { + + protected DBMeta _dbmeta; + + protected String[] _noPersisteneProps; + + public FastPropertyTypeFactoryExtension(Class beanClass, + BeanAnnotationReader beanAnnotationReader, + ValueTypeFactory valueTypeFactory, ColumnNaming columnNaming) { + super(beanClass, beanAnnotationReader, valueTypeFactory, + columnNaming); + initializeResources(); + } + + public FastPropertyTypeFactoryExtension(Class beanClass, + BeanAnnotationReader beanAnnotationReader, + ValueTypeFactory valueTypeFactory, ColumnNaming columnNaming, + Dbms dbms) { + super(beanClass, beanAnnotationReader, valueTypeFactory, + columnNaming, dbms); + initializeResources(); + } + + protected void initializeResources() { + if (isEntity()) { + _dbmeta = findDBMeta(); + } + _noPersisteneProps = beanAnnotationReader.getNoPersisteneProps(); + } + + protected boolean isEntity() { + return Entity.class.isAssignableFrom(beanClass); + } + + protected boolean hasDBMeta() { + return _dbmeta != null; + } + + protected DBMeta findDBMeta() { + try { + final Entity entity = (Entity) beanClass.newInstance(); + return entity.getDBMeta(); + } catch (Exception e) { + String msg = "beanClass.newInstance() threw the exception: beanClass=" + + beanClass; + throw new RuntimeException(msg, e); + } + } + + public PropertyType[] createBeanPropertyTypes(String tableName) { + final List list = new ArrayList(); + final BeanDesc beanDesc = getBeanDesc(); + for (int i = 0; i < beanDesc.getPropertyDescSize(); ++i) { + final PropertyDesc pd = beanDesc.getPropertyDesc(i); + + // Read-only property is unnecessary! + if (!pd.hasWriteMethod()) { + continue; + } + + // Relation property is unnecessary! + if (isRelation(pd)) { + continue; + } + + final PropertyType pt = createPropertyType(pd); + pt.setPrimaryKey(isPrimaryKey(pd)); + pt.setPersistent(isPersistent(pt)); + list.add(pt); + } + return list.toArray(new PropertyType[list.size()]); + } + + @Override + protected boolean isRelation(PropertyDesc propertyDesc) { + final String propertyName = propertyDesc.getPropertyName(); + if (hasDBMeta() + && (_dbmeta.hasForeign(propertyName) || _dbmeta + .hasReferrer(propertyName))) { + return true; + } + return hasRelationNoAnnotation(propertyDesc); + } + + protected boolean hasRelationNoAnnotation(PropertyDesc propertyDesc) { + return beanAnnotationReader.hasRelationNo(propertyDesc); + } + + @Override + protected boolean isPrimaryKey(PropertyDesc propertyDesc) { + final String propertyName = propertyDesc.getPropertyName(); + if (hasDBMeta() && _dbmeta.hasPrimaryKey() + && _dbmeta.hasColumn(propertyName)) { + if (_dbmeta.findColumnInfo(propertyName).isPrimary()) { + return true; + } + } + return hasIdAnnotation(propertyDesc); + } + + protected boolean hasIdAnnotation(PropertyDesc propertyDesc) { + final Dbms dbms = getDbms(); + return beanAnnotationReader.getId(propertyDesc, dbms) != null; + } + + @Override + protected boolean isPersistent(PropertyType propertyType) { + final String propertyName = propertyType.getPropertyName(); + final PropertyDesc propertyDesc = propertyType.getPropertyDesc(); + if ((hasDBMeta() && _dbmeta.hasColumn(propertyName)) + || hasColumnAnnotation(propertyDesc)) { + if (!isElementOfNoPersistentProps(propertyDesc)) { + return true; + } + } + return false; + } + + protected boolean hasColumnAnnotation(PropertyDesc propertyDesc) { + return beanAnnotationReader.getColumnAnnotation(propertyDesc) != null; + } + + protected boolean isElementOfNoPersistentProps(PropertyDesc propertyDesc) { + final String propertyName = propertyDesc.getPropertyName(); + final String[] props = _noPersisteneProps; + if (props != null && props.length >= 0) { + for (int i = 0; i < props.length; ++i) { + if (props[i].equals(propertyName)) { + return true; + } + } + } + return false; + } + } + + //========================================================================== + // ========= + // Accessor + // ======== + public ValueTypeFactory getValueTypeFactory() { + return valueTypeFactory; + } + + public void setValueTypeFactory(ValueTypeFactory valueTypeFactory) { + this.valueTypeFactory = valueTypeFactory; + } + + public ColumnNaming getColumnNaming() { + return columnNaming; + } + + public void setColumnNaming(ColumnNaming columnNaming) { + this.columnNaming = columnNaming; + } +} Deleted: 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 2008-12-27 22:14:41 UTC (rev 1629) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/s2dao/S2BeanMetaDataFactoryImpl.java 2008-12-27 22:18:30 UTC (rev 1630) @@ -1,116 +0,0 @@ -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, BeanMetaData> _metaMap = Collections - .synchronizedMap(new HashMap, BeanMetaData>()); - - @Override - public BeanMetaData createBeanMetaData(Class beanClass) { - final BeanMetaData cachedMeta = findCachedMeta(beanClass); - if (cachedMeta != null) { - return cachedMeta; - } else { - return super.createBeanMetaData(beanClass); - } - } - - @Override - public BeanMetaData createBeanMetaData(Class beanClass, - int relationNestLevel) { - final BeanMetaData cachedMeta = findCachedMeta(beanClass); - if (cachedMeta != null) { - return cachedMeta; - } else { - return super.createBeanMetaData(beanClass, relationNestLevel); - } - } - - @Override - public BeanMetaData createBeanMetaData(DatabaseMetaData dbMetaData, - Class beanClass, int relationNestLevel) { - final BeanMetaData cachedMeta = findOrCreateCachedMetaIfNeeds( - dbMetaData, beanClass, relationNestLevel); - if (cachedMeta != null) { - return cachedMeta; - } else { - return super.createBeanMetaData(dbMetaData, beanClass, - relationNestLevel); - } - } - - protected BeanMetaData findCachedMeta(Class beanClass) { - if (isDBFluteEntity(beanClass)) { - final BeanMetaData cachedMeta = getMetaFromCache(beanClass); - if (cachedMeta != null) { - return cachedMeta; - } - } - return null; - } - - protected BeanMetaData findOrCreateCachedMetaIfNeeds( - DatabaseMetaData dbMetaData, Class beanClass, int relationNestLevel) { - if (isDBFluteEntity(beanClass)) { - final BeanMetaData cachedMeta = getMetaFromCache(beanClass); - if (cachedMeta != null) { - return cachedMeta; - } else { - return super.createBeanMetaData(dbMetaData, beanClass, 0); - } - } - return null; - } - - @Override - protected BeanMetaDataImpl createBeanMetaDataImpl() { - return new BeanMetaDataImpl() { - @Override - public void initialize() { - final Class myBeanClass = getBeanClass(); - if (isDBFluteEntity(myBeanClass)) { - final BeanMetaData cachedMeta = getMetaFromCache(myBeanClass); - if (cachedMeta == null) { - _metaMap.put(myBeanClass, this); - } - } - super.initialize(); - } - }; - } - - protected boolean isDBFluteEntity(Class beanClass) { - return Entity.class.isAssignableFrom(beanClass); - } - - protected BeanMetaData getMetaFromCache(Class beanClass) { - return _metaMap.get(beanClass); - } - - /** - * Get the limit nest level of relation. - * - * @return The limit nest level of relation. - */ - @Override - protected int getLimitRelationNestLevel() { - return 2;// for Compatible to old version DBFlute - } -} \ No newline at end of file Deleted: 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 2008-12-27 22:14:41 UTC (rev 1629) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/s2dao/S2DaoInterceptor.java 2008-12-27 22:18:30 UTC (rev 1630) @@ -1,1027 +0,0 @@ -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 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 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 suffixList = Arrays.asList(new String[] { "Bhv", - "BehaviorReadable", "BehaviorWritable", "PagingInvoker" }); - final List keywordList = Arrays.asList(new String[] { "Bhv$", - "BehaviorReadable$", "BehaviorWritable$" }); - final List ousideSql1List = Arrays - .asList(new String[] { "OutsideSql" }); - final List ousideSql2List = Arrays - .asList(new String[] { "Executor" }); - final List 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 suffixList) { - for (String suffix : suffixList) { - if (className.endsWith(suffix)) { - return true; - } - } - return false; - } - - protected boolean isClassNameContains(String className, - List 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 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. - *

- * If this method is condition bean select target, make dynamic SQL. Else - * nothing. - * - * @param invocation Method invocation. (NotNull) - * @return ConditionBean. (Nullable) - */ - protected ConditionBean preprocessConditionBean(MethodInvocation invocation) { - final OutsideSqlContext outsideSqlContext = getOutsideSqlContext(); - if (outsideSqlContext != null) { - return null; // Because it has already finished setting up - // fetchNarrowingBean for outsideSql here. - } - - final ConditionBean cb; - { - final Object[] args = invocation.getArguments(); - if (args == null || args.length == 0) { - return null; - } - final Object arg0 = args[0]; - if (arg0 == null) { - return null; - } - if (!ConditionBeanContext.isTheTypeConditionBean(arg0.getClass())) {// The - // argument - // is - // not - // condition - // - - // bean - // ... - if (FetchNarrowingBeanContext.isTheTypeFetchNarrowingBean(arg0 - .getClass()) - && !isSelectCountIgnoreFetchScopeMethod(invocation)) { - // Fetch-narrowing-bean and Not select count! - FetchNarrowingBeanContext - .setFetchNarrowingBeanOnThread((FetchNarrowingBean) arg0); - } - return null; - } - cb = (ConditionBean) arg0; - } - - if (isSelectCountIgnoreFetchScopeMethod(invocation)) { - cb.xsetupSelectCountIgnoreFetchScope(); - } else { - FetchNarrowingBeanContext.setFetchNarrowingBeanOnThread(cb); - } - - ConditionBeanContext.setConditionBeanOnThread(cb); - return cb; - } - - /** - * Post-process condition-bean. - * - * @param invocation Method invocation. (NotNull) - * @param cb Condition-bean. (Nullable) - */ - protected void postprocessConditionBean(MethodInvocation invocation, - ConditionBean cb) { - if (cb == null) { - return; - } - if (isSelectCountIgnoreFetchScopeMethod(invocation)) { - cb.xafterCareSelectCountIgnoreFetchScope(); - } - } - - // ----------------------------------------------------- - // Clear Thread Local - // ------------------ - protected void clearThreadLocal() { - if (OutsideSqlContext.isExistOutsideSqlContextOnThread()) { - OutsideSqlContext.clearOutsideSqlContextOnThread(); - } - if (FetchNarrowingBeanContext.isExistFetchNarrowingBeanOnThread()) { - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - // Because there is possible that fetch narrowing has been ignored - // for manualPaging of outsideSql. - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - FetchNarrowingBeanContext.getFetchNarrowingBeanOnThread() - .restoreIgnoredFetchNarrowing(); - - FetchNarrowingBeanContext.clearFetchNarrowingBeanOnThread(); - } - if (ConditionBeanContext.isExistConditionBeanOnThread()) { - ConditionBeanContext.clearConditionBeanOnThread(); - } - if (InternalMapContext.isExistInternalMapContextOnThread()) { - InternalMapContext.clearInternalMapContextOnThread(); - } - } - - //========================================================================== - // ========= - // Context Helper - // ============== - protected OutsideSqlContext getOutsideSqlContext() { - if (!OutsideSqlContext.isExistOutsideSqlContextOnThread()) { - return null; - } - return OutsideSqlContext.getOutsideSqlContextOnThread(); - } - - protected boolean isSpecifiedOutsideSql() { - final OutsideSqlContext outsideSqlContext = getOutsideSqlContext(); - return outsideSqlContext != null - && outsideSqlContext.isSpecifiedOutsideSql(); - } - - protected void putObjectToMapContext(String key, Object value) { - InternalMapContext.setObject(key, value); - } - - //========================================================================== - // ========= - // Determination - // ============= - /** - * Is select count ignore-fetch-scope method? - * - * @param invocation Method invocation. (NotNull) - * @return Determination. - */ - protected boolean isSelectCountIgnoreFetchScopeMethod( - MethodInvocation invocation) { - final String name = invocation.getMethod().getName(); - return name.startsWith("readCount") || name.startsWith("selectCount"); - } - - //========================================================================== - // ========= - // General Helper - // ============== - /** - * Is the method abstract? - * - * @param method Method. (NotNull) - * @return Determination. (NotNull) - */ - public boolean isAbstract(Method method) { - final int mod = method.getModifiers(); - return Modifier.isAbstract(mod); - } - - /** - * Get the value of line separator. - * - * @return The value of line separator. (NotNull) - */ - protected String getLineSeparator() { - return System.getProperty("line.separator"); - } -} \ No newline at end of file Deleted: 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 2008-12-27 22:14:41 UTC (rev 1629) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/s2dao/S2DaoLatestSqlProvider.java 2008-12-27 22:18:30 UTC (rev 1630) @@ -1,20 +0,0 @@ -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(); - } -} Deleted: 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 2008-12-27 22:14:41 UTC (rev 1629) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/s2dao/S2DaoMetaDataExtension.java 2008-12-27 22:18:30 UTC (rev 1630) @@ -1,1460 +0,0 @@ -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 ret = new ArrayList(); - while (rs.next()) { - ret.add(valueType.getValue(rs, 1)); - } - return ret; - } - } - - protected BeanMetaData createSpecifiedOutsideSqlCursorBeanMetaData( - Method method) { - return createOutsideSqlCustomizeBeanMetaDataFactory() - .createBeanMetaData(getOutsideSqlDefaultBeanClass(method)); - } - - protected ResultSetHandler createSpecifiedOutsideSqlCursorResultSetHandler( - BeanMetaData specifiedBeanMetaData) { - return new org.seasar.extension.jdbc.impl.ObjectResultSetHandler();// This - // is - // dummy - // for - // cursor - // handling - // ! - } - - // - - - - - - - - - - - - - // Execute - // - - - - - protected void setupSpecifiedOutsideSqlExecuteCommand(String sqlCommandKey, - Method method, OutsideSqlContext outsideSqlContext) { - // - - - - - - - - - - - - - - - - - - - - - - - - // The attribute of Specified-OutsideSqlContext. - // - - - - - - - - - - - - - - - - - - - - - - - - final String sql = outsideSqlContext.readFilteredOutsideSql( - getSqlFileEncoding(), dbms.getSuffix()); - final Object pmb = outsideSqlContext.getParameterBean(); - - // - - - - - - - - - - - - - - - - // The attribute of SqlCommand. - // - - - - - - - - - - - - - - - - final String[] argNames = (pmb != null ? new String[] { "pmb" } - : new String[] {}); - final Class[] argTypes = (pmb != null ? new Class[] { pmb - .getClass() } : new Class[] {}); - - final InternalUpdateDynamicCommand cmd = new InternalUpdateDynamicCommand( - dataSource, statementFactory) { - @Override - public Object execute(Object[] args) { - if (args.length != 3) { - String msg = "Internal Error! OutsideSqlDao.execute() should have 3 arguements: args.length=" - + args.length; - throw new IllegalStateException(msg); - } - Object arg = args[1]; - return super.execute(new Object[] { arg }); - } - }; - - // It is unnecessary for DBFlute! - // cmd.setNotSingleRowUpdatedExceptionClass( - // getNotSingleRowUpdatedExceptionClass(method)); - - registerSqlCommand(sqlCommandKey, method, sql, argNames, argTypes, cmd); - } - - // - - - - - - - - - - - - - // Call Procedure - // - - - - - - - - protected void setupSpecifiedOutsideSqlCallCommand(String sqlCommandKey, - Method method, OutsideSqlContext outsideSqlContext) { - // - - - - - - - - - - - - - - - - - - - - - - - - // The attribute of Specified-OutsideSqlContext. - // - - - - - - - - - - - - - - - - - - - - - - - - final Object pmb = outsideSqlContext.getParameterBean(); - final String procedureName = outsideSqlContext.getOutsideSqlPath(); - - // - - - - - - - - - - - - - - - - // The attribute of SqlCommand. - // - - - - - - - - - - - - - - - - final InternalProcedureMetaDataFactory factory = createInternalProcedureMetaDataFactory(); - factory.setValueTypeFactory(valueTypeFactory); - final Class pmbType = pmb != null ? pmb.getClass() : null; - final InternalProcedureMetaData metaData = factory - .createProcedureMetaData(procedureName, pmbType); - final InternalProcedureCommand cmd = createInternalProcedureCommand( - method, metaData); - putSqlCommand(sqlCommandKey, cmd); - } - - protected InternalProcedureMetaDataFactory createInternalProcedureMetaDataFactory() { - return new InternalProcedureMetaDataFactory(); - } - - protected InternalProcedureCommand createInternalProcedureCommand( - Method method, InternalProcedureMetaData metaData) { - final ResultSetHandler resultSetHandler = createResultSetHandler(method); - return new InternalProcedureCommand(dataSource, resultSetHandler, - statementFactory, metaData); - } - - // ----------------------------------------------------- - // Common of OutsideSql - // -------------------- - protected BeanMetaDataFactory createOutsideSqlCustomizeBeanMetaDataFactory() { - final S2BeanMetaDataFactoryImpl originalBmdFactory = new S2BeanMetaDataFactoryImpl() { - protected BeanMetaDataImpl createBeanMetaDataImpl() { - return newOutsideSqlCustomizeBeanMetaDataImpl(); - } - }; - originalBmdFactory - .setAnnotationReaderFactory(this.annotationReaderFactory); - originalBmdFactory - .setPropertyTypeFactoryBuilder(createOutsideSqlPropertyTypeFactoryBuilder()); - originalBmdFactory - .setRelationPropertyTypeFactoryBuilder(this.relationPropertyTypeFactoryBuilder); - originalBmdFactory.setTableNaming(this.tableNaming); - originalBmdFactory.setDataSource(this.dataSource); - originalBmdFactory.setDaoNamingConvention(this.daoNamingConvention); - originalBmdFactory.setBeanEnhancer(this.beanEnhancer); - return originalBmdFactory; - } - - protected BeanMetaDataImpl newOutsideSqlCustomizeBeanMetaDataImpl() { - return new OutsideSqlCustomizeBeanMetaDataImpl(); - } - - protected static class OutsideSqlCustomizeBeanMetaDataImpl extends - BeanMetaDataImpl { - // Though nothing to override, it uses original class just in case. - } - - protected S2DaoPropertyTypeFactoryBuilderExtension createOutsideSqlPropertyTypeFactoryBuilder() { - final S2DaoPropertyTypeFactoryBuilderExtension impl = new S2DaoPropertyTypeFactoryBuilderExtension(); - if (columnNaming == null) { - String msg = "Internal Error! The columnNaming should not be null! {Failed to Injection!}"; - throw new IllegalStateException(msg); - } - impl.setColumnNaming(columnNaming); - impl.setValueTypeFactory(valueTypeFactory); - return impl; - } - - protected Class getOutsideSqlDefaultBeanClass(Method method) { - final Class retType = method.getReturnType(); - if (java.util.List.class.isAssignableFrom(retType)) { - final Class elementType = InternalMethodUtil - .getElementTypeOfListFromReturnMethod(method); - if (elementType != null) { - return elementType; - } else { - return getBeanClass(); - } - } else if (retType.isArray()) { - return retType.getComponentType(); - } else if (retType.isPrimitive() - || !ValueTypes.getValueType(retType).equals(ValueTypes.OBJECT)) { - return getBeanClass(); - } else { - return retType; - } - } - - protected void registerSqlCommand(String sqlCommandKey, Method method, - String sql, String[] argNames, Class[] argTypes, - BeanMetaData myBeanMetaData) { - registerSqlCommand(sqlCommandKey, method, sql, argNames, argTypes, - createResultSetHandler(myBeanMetaData, method)); - } - - protected void registerSqlCommand(String sqlCommandKey, Method method, - String sql, String[] argNames, Class[] argTypes, - ResultSetHandler myResultSetHandler) { - final S2DaoSelectDynamicCommand cmd = createCustomizeSelectDynamicCommand(myResultSetHandler); - registerSqlCommand(sqlCommandKey, method, sql, argNames, argTypes, cmd); - } - - protected void registerSqlCommand(String sqlCommandKey, Method method, - String sql, String[] argNames, Class[] argTypes, - S2DaoSelectDynamicCommand cmd) { - cmd.setSql(sql); - cmd.setArgNames(argNames); - cmd.setArgTypes(argTypes); - this.sqlCommands.put(sqlCommandKey, cmd); - } - - protected void registerSqlCommand(String sqlCommandKey, Method method, - String sql, String[] argNames, Class[] argTypes, - InternalUpdateDynamicCommand cmd) { - cmd.setSql(sql); - cmd.setArgNames(argNames); - cmd.setArgTypes(argTypes); - this.sqlCommands.put(sqlCommandKey, cmd); - } - - //========================================================================== - // ========= - // Common Handlnig - // =============== - @Override - protected void putSqlCommand(String methodName, SqlCommand cmd) { - sqlCommands.put(methodName, cmd); - } - - protected boolean isCheckSingleRowUpdate(Method method) { - return checkSingleRowUpdateForAll - & daoAnnotationReader.isCheckSingleRowUpdate(method); - } - - //========================================================================== - // ========= - // Customize SelectDynamicCommand Creation - // ======================================= - /** - * Create the customize select dynamic command that is for all select SQL on - * DBFlute. - * - * @param handler The handler of result set. (NotNull) - * @return The customize select dynamic command. (NotNull) - */ - protected S2DaoSelectDynamicCommand createCustomizeSelectDynamicCommand( - ResultSetHandler handler) { - return new S2DaoSelectDynamicCommand(dataSource, statementFactory, - handler); - } - - //========================================================================== - // ========= - // ResultSetHandler Override - // ========================= - @Override - protected ResultSetHandler createResultSetHandler(Method method) { - return this.resultSetHandlerFactory.getResultSetHandler( - daoAnnotationReader, beanMetaData, method); - } - - protected ResultSetHandler createResultSetHandler( - BeanMetaData specifiedBeanMetaData, Method method) {// For specified - // BeanMetaData - return this.resultSetHandlerFactory.getResultSetHandler( - daoAnnotationReader, specifiedBeanMetaData, method); - } - - //========================================================================== - // ========= - // JDBC Delegator - // ============== - protected Connection getConnection() { - if (dataSource == null) { - throw new IllegalStateException( - "The dataSource should not be null!"); - } - try { - return dataSource.getConnection(); - } catch (SQLException e) { - handleSQLException(e, null); - return null;// Unreachable! - } - } - - protected DatabaseMetaData getMetaData(Connection conn) { - try { - return conn.getMetaData(); - } catch (SQLException e) { - handleSQLException(e, null); - return null;// Unreachable! - } - } - - protected String getDatabaseProductName(DatabaseMetaData dbMetaData) { - try { - return dbMetaData.getDatabaseProductName(); - } catch (SQLException e) { - handleSQLException(e, null); - return null;// Unreachable! - } - } - - protected void close(Connection conn) { - if (conn == null) { - return; - } - try { - conn.close(); - } catch (SQLException e) { - handleSQLException(e, null); - } - } - - //========================================================================== - // ========= - // Exception Handlnig - // ================== - protected void handleSQLException(SQLException e, Statement statement) { - new SQLExceptionHandler().handleSQLException(e, statement); - } - - //========================================================================== - // ========= - // ResultSetHandlerFactoryImpl Extension - // ===================================== - public static class ResultSetHandlerFactoryExtension extends - ResultSetHandlerFactoryImpl { - public ResultSetHandlerFactoryExtension() { - super(); - } - - @Override - protected RowCreator createRowCreator() { // [DAO-118] (2007/08/25) - return createInternalRowCreator(null); - } - - @Override - protected RelationRowCreator createRelationRowCreator() { - return createInternalRelationRowCreator(null); - } - - @Override - protected ResultSetHandler createBeanListMetaDataResultSetHandler( - BeanMetaData bmd) { // DBFlute Target - final InternalRowCreator rowCreator = createInternalRowCreator(bmd); - final InternalRelationRowCreator relationRowCreator = createInternalRelationRowCreator(bmd); - return new InternalBeanListMetaDataResultSetHandler(bmd, - rowCreator, relationRowCreator); - } - - @Override - protected ResultSetHandler createBeanArrayMetaDataResultSetHandler( - BeanMetaData bmd) { // DBFlute Target - final InternalRowCreator rowCreator = createInternalRowCreator(bmd); - final InternalRelationRowCreator relationRowCreator = createInternalRelationRowCreator(bmd); - return new InternalBeanArrayMetaDataResultSetHandler(bmd, - rowCreator, relationRowCreator); - } - - protected InternalRowCreator createInternalRowCreator(BeanMetaData bmd) { - final Class clazz = bmd != null ? bmd.getBeanClass() : null; - return InternalRowCreator.createInternalRowCreator(clazz); - } - - protected InternalRelationRowCreator createInternalRelationRowCreator( - BeanMetaData bmd) { - return new InternalRelationRowCreator(); // Not yet implemented - // about performance - // tuning! - } - } - - //========================================================================== - // ========= - // Vert Internal - // ============= - protected static class InternalMethodUtil { - public static Class getElementTypeOfListFromReturnMethod(Method method) { - return InternalReflectionUtil - .getElementTypeOfListFromReturnType(method); - } - } - - protected static class InternalReflectionUtil { - public static Class getElementTypeOfList(final Type parameterizedList) { - if (!(parameterizedList instanceof ParameterizedType)) { - return null; - } - final ParameterizedType parameterizedType = ParameterizedType.class - .cast(parameterizedList); - final Type rawType = parameterizedType.getRawType(); - if (!(rawType instanceof Class)) { - return null; - } - final Class rawClass = Class.class.cast(rawType); - if (!rawClass.isAssignableFrom(List.class)) { - return null; - } - final Type[] actualTypeArgument = parameterizedType - .getActualTypeArguments(); - if (actualTypeArgument == null || actualTypeArgument.length != 1) { - return null; - } - if (!(actualTypeArgument[0] instanceof Class)) { - return null; - } - return Class.class.cast(actualTypeArgument[0]); - } - - public static Class getElementTypeOfListFromParameterType( - final Method method, final int parameterPosition) { - final Type[] pmbTypes = method.getGenericParameterTypes(); - return getElementTypeOfList(pmbTypes[parameterPosition]); - } - - public static Class getElementTypeOfListFromReturnType( - final Method method) { - return getElementTypeOfList(method.getGenericReturnType()); - } - } - - //========================================================================== - // ========= - // Assist Helper - // ============= - protected DBMeta findDBMeta() { - final Class beanType = getBeanClass(); - if (beanType == null) { - return null; - } - if (!Entity.class.isAssignableFrom(beanType)) { - return null; - } - final Entity entity; - try { - entity = (Entity) beanType.newInstance(); - } catch (InstantiationException e) { - throw new IllegalStateException(e); - } catch (IllegalAccessException e) { - throw new IllegalStateException(e); - } - return entity.getDBMeta(); - } - - //========================================================================== - // ========= - // General Helper - // ============== - protected String getLineSeparator() { - return SimpleSystemUtil.getLineSeparator(); - } - - //========================================================================== - // ========= - // Accessor - // ======== - // ----------------------------------------------------- - // Sql File Encoding - // ----------------- - public String getSqlFileEncoding() { - return sqlFileEncoding; - } - - // ----------------------------------------------------- - // Bean Enhancer - // ------------- - public BeanEnhancer getBeanEnhancer() { - return beanEnhancer; - } - - public void setBeanEnhancer(final BeanEnhancer beanEnhancer) { - this.beanEnhancer = beanEnhancer; - } - - // ----------------------------------------------------- - // Annotation Reader Factory - // ------------------------- - public void setAnnotationReaderFactory( - org.seasar.dao.AnnotationReaderFactory annotationReaderFactory) { - this.annotationReaderFactory = annotationReaderFactory; - } - - // ----------------------------------------------------- - // Version After 1.0.47 - // -------------------- - public ColumnNaming getColumnNaming() { - return columnNaming; - } - - public void setColumnNaming(final ColumnNaming columnNaming) { - this.columnNaming = columnNaming; - } - - public PropertyTypeFactoryBuilder getPropertyTypeFactoryBuilder() { - return propertyTypeFactoryBuilder; - } - - public void setPropertyTypeFactoryBuilder( - final PropertyTypeFactoryBuilder propertyTypeFactoryBuilder) { - this.propertyTypeFactoryBuilder = propertyTypeFactoryBuilder; - } - - public RelationPropertyTypeFactoryBuilder getRelationPropertyTypeFactoryBuilder() { - return relationPropertyTypeFactoryBuilder; - } - - public void setRelationPropertyTypeFactoryBuilder( - final RelationPropertyTypeFactoryBuilder relationPropertyTypeFactoryBuilder) { - this.relationPropertyTypeFactoryBuilder = relationPropertyTypeFactoryBuilder; - } - - public TableNaming getTableNaming() { - return tableNaming; - } - - public void setTableNaming(final TableNaming tableNaming) { - this.tableNaming = tableNaming; - } - - // ----------------------------------------------------- - // DBFlute Extension - // ----------------- - public BehaviorSelector getBehaviorSelector() { - return _behaviorSelector; - } - - public void setBehaviorSelector(final BehaviorSelector behaviorSelector) { - this._behaviorSelector = behaviorSelector; - } - - public boolean isInternalDebug() { - return _internalDebug; - } - - public void setInternalDebug(final boolean internalDebug) { - this._internalDebug = internalDebug; - } -} Deleted: 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 2008-12-27 22:14:41 UTC (rev 1629) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/s2dao/S2DaoMetaDataFactoryImpl.java 2008-12-27 22:18:30 UTC (rev 1630) @@ -1,655 +0,0 @@ -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 daoMetaDataCache = new HashMap(); - - protected boolean initialized; - - protected boolean useDaoClassForLog; - - protected String sqlFileEncoding; - - protected BeanEnhancer beanEnhancer; - - // ----------------------------------------------------- - // Version After 1.0.47 - // -------------------- - /** The naming of column. {After S2Dao-1.0.47} */ - protected ColumnNaming columnNaming; - - /** The builder of property type factory. {After S2Dao-1.0.47} */ - protected PropertyTypeFactoryBuilder propertyTypeFactoryBuilder; - - /** The builder of relation property type factory. {After S2Dao-1.0.47} */ - protected RelationPropertyTypeFactoryBuilder relationPropertyTypeFactoryBuilder; - - /** The builder of table naming. {After S2Dao-1.0.47} */ - protected TableNaming tableNaming; - - // ----------------------------------------------------- - // DBFlute Extension - // ----------------- - /** The lock monitor of DAO meta data initialization. */ - protected Object _daoMetaDataInitializationLockMonitor = new Object(); - - //========================================================================== - // ========= - // Constructor - // =========== - public S2DaoMetaDataFactoryImpl(DataSource dataSource, - AnnotationReaderFactory annotationReaderFactory, - XADataSource xaDataSource) { - this.dataSource = dataSource; - this.annotationReaderFactory = annotationReaderFactory; - - _log - .info("/* * * * * * * * * * * * * * * * * * * * * * * * * * * * {DBFlute}"); - showInformation(dataSource, xaDataSource); - - // Stop the LinkageError! - ConditionBeanContext.initialize(); - - initializeDatabaseProductNameOfContext(xaDataSource); - - handleSqlLogRegistry(); - - DBFluteConfig.getInstance().lock(); - _log.info("* * * * */"); - } - - protected void showInformation(javax.sql.DataSource dataSource, - javax.sql.XADataSource xaDataSource) { - final StringBuilder sb = new StringBuilder(); - if (xaDataSource != null - && xaDataSource instanceof org.seasar.extension.dbcp.impl.XADataSourceImpl) { - final org.seasar.extension.dbcp.impl.XADataSourceImpl xaDataSourceImpl = (org.seasar.extension.dbcp.impl.XADataSourceImpl) xaDataSource; - final String driverClassName = xaDataSourceImpl - .getDriverClassName(); - final String url = xaDataSourceImpl.getURL(); - final String user = xaDataSourceImpl.getUser(); - sb.append(" [XADataSource]:").append(getLineSeparator()); - sb.append(" driver = " + driverClassName).append( - getLineSeparator()); - sb.append(" url = " + url).append(getLineSeparator()); - sb.append(" user = " + user); - } - _log.info("{Injection Information}" + getLineSeparator() + sb); - } - - protected void handleSqlLogRegistry() { - final StringBuilder sb = new StringBuilder(); - sb.append("{SqlLog Information}").append(getLineSeparator()); - sb.append(" [SqlLogRegistry]").append(getLineSeparator()); - if (DBFluteConfig.getInstance().isUseSqlLogRegistry()) { - if (InternalSqlLogRegistry.setupSqlLogRegistry()) { - sb - .append( - " ...Setting up SqlLogRegistry(org.seasar.extension.jdbc)!") - .append(getLineSeparator()); - sb - .append(" Because the property 'useSqlLogRegistry' of the config of DBFlute is true."); - } else { - sb - .append(" SqlLogRegistry(org.seasar.extension.jdbc) is not supported at the version!"); - } - } else { - final Object sqlLogRegistry = InternalSqlLogRegistry - .findContainerSqlLogRegistry(); - if (sqlLogRegistry != null) { - InternalSqlLogRegistry.closeRegistration(); - sb - .append( - " SqlLogRegistry(org.seasar.extension.jdbc) is close! It's default for DBFlute.") - .append(getLineSeparator()); - sb - .append(" If you want to use this, set SqlLogRegistry to SqlLogRegistryLocator at yourself."); - } else { - sb - .append(" SqlLogRegistry(org.seasar.extension.jdbc) is not available!"); - } - } - _log.info(sb); - } - - // ----------------------------------------------------- - // Database Product Name - // --------------------- - protected void initializeDatabaseProductNameOfContext( - javax.sql.XADataSource xaDataSource) { - if (getDatabaseProductNameFromContext() != null) { - return; - } - - // From JDBC Driver! - if (xaDataSource != null - && xaDataSource instanceof org.seasar.extension.dbcp.impl.XADataSourceImpl) { - final org.seasar.extension.dbcp.impl.XADataSourceImpl xaDataSourceImpl = (org.seasar.extension.dbcp.impl.XADataSourceImpl) xaDataSource; - final String driverClassName = xaDataSourceImpl - .getDriverClassName(); - if (driverClassName != null) { - if (setupDatabaseProductNameByDriverClassName(driverClassName)) { - _log - .info("...Initializing database product name from driverClassName: " - + getDatabaseProductNameFromContext()); - return; - } - } - } - - _log.info("...Initializing database product name as default: H2"); - setDatabaseProductNameToContext("H2"); - } - - protected String getDatabaseProductNameFromContext() { - return ConditionBeanContext.getDatabaseProductName(); - } - - protected void setDatabaseProductNameToContext(String name) { - ConditionBeanContext.setDatabaseProductName(name); - } - - protected boolean setupDatabaseProductNameByDriverClassName( - String driverClassName) { - return ConditionBeanContext - .setupDatabaseProductNameByDriverClassName(driverClassName); - } - - //========================================================================== - // ========= - // Implementation - // ============== - @SuppressWarnings("unchecked") - public DaoMetaData getDaoMetaData(final Class daoClass) { - if (!initialized) { - DisposableUtil.add(this); - initialized = true; - } - final String key = daoClass.getName(); - - // [A] - DaoMetaData dmd = getSynchronizedDaoMetaDataCache(key); - - // [B] - if (dmd != null) { - return dmd; - } - - // [C] - synchronized (_daoMetaDataInitializationLockMonitor) {// One Thread Only - // Entered - // [D] - dmd = getSynchronizedDaoMetaDataCache(key); - // [E] - if (dmd != null) { - // The second thread that stops at [C] can find - // because the first thread have already initialized. - if (_log.isDebugEnabled()) { - _log - .debug("...Getting daoMetaData as cache because the previous thread have already initilized."); - } - return dmd; - } - // [F] - if (_log.isDebugEnabled()) { - _log.debug("...Creating daoMetaData for " - + daoClass.getSimpleName() + "."); - } - final DaoMetaData dmdi = createDaoMetaData(daoClass); - putSynchronizedDaoMetaDataCache(key, dmdi); - } - // [G] - dmd = getSynchronizedDaoMetaDataCache(key); - if (dmd != null) { - return dmd; - } - String msg = "The cache should have data meta data here: key=" + key - + " cache=" + daoMetaDataCache; - throw new IllegalStateException(msg); - } - - @SuppressWarnings("unchecked") - protected void putSynchronizedDaoMetaDataCache(String key, DaoMetaData dmd) { - synchronized (daoMetaDataCache) { - daoMetaDataCache.put(key, dmd); - } - } - - protected DaoMetaData getSynchronizedDaoMetaDataCache(String key) { - DaoMetaData dmd = null; - synchronized (daoMetaDataCache) { - dmd = (DaoMetaData) daoMetaDataCache.get(key); - } - return dmd; - } - - //========================================================================== - // ========= - // DataMetaData Creation - // ===================== - protected DaoMetaData createDaoMetaData(final Class daoClass) { - final BeanDesc daoBeanDesc = BeanDescFactory.getBeanDesc(daoClass); - final DaoAnnotationReader daoAnnotationReader = annotationReaderFactory - .createDaoAnnotationReader(daoBeanDesc); - - final DaoMetaDataImpl daoMetaData = createDaoMetaDataExtension(); - daoMetaData.setDaoClass(daoClass); - daoMetaData.setDataSource(dataSource); - daoMetaData.setStatementFactory(createCustomizeStatememtFactory()); - daoMetaData.setResultSetFactory(createCustomizeResultSetFactory()); - daoMetaData.setValueTypeFactory(valueTypeFactory); - daoMetaData.setBeanMetaDataFactory(getBeanMetaDataFactory()); - daoMetaData.setDaoNamingConvention(getDaoNamingConvention()); - daoMetaData.setUseDaoClassForLog(useDaoClassForLog); - daoMetaData.setDaoAnnotationReader(daoAnnotationReader); - daoMetaData.setProcedureMetaDataFactory(procedureMetaDataFactory); - daoMetaData.setDtoMetaDataFactory(dtoMetaDataFactory); - daoMetaData.setResultSetHandlerFactory(resultSetHandlerFactory); - if (sqlFileEncoding != null) { - daoMetaData.setSqlFileEncoding(sqlFileEncoding); - } - if (pagingSqlRewriter != null) { - daoMetaData.setPagingSQLRewriter(pagingSqlRewriter); - } - daoMetaData.initialize(); - return daoMetaData; - } - - protected S2DaoMetaDataExtension createDaoMetaDataExtension() { - final S2DaoMetaDataExtension dmdExtension = newDaoMetaDataExtension(); - dmdExtension.setBeanEnhancer(beanEnhancer); - dmdExtension.setAnnotationReaderFactory(this.annotationReaderFactory); - dmdExtension.setColumnNaming(this.columnNaming); - dmdExtension - .setPropertyTypeFactoryBuilder(this.propertyTypeFactoryBuilder); - dmdExtension - .setRelationPropertyTypeFactoryBuilder(this.relationPropertyTypeFactoryBuilder); - dmdExtension.setTableNaming(tableNaming); - dmdExtension.setInternalDebug(DBFluteConfig.getInstance() - .isInternalDebug()); - return dmdExtension; - } - - protected S2DaoMetaDataExtension newDaoMetaDataExtension() { - return new S2DaoMetaDataExtension(); - } - - //========================================================================== - // ========= - // Result Set Factory - // ================== - /** - * Create the customize result set factory that is for all SQL on DBFlute. - * - * @return The customize statement factory. (NotNull) - */ - protected ResultSetFactory createCustomizeResultSetFactory() { - return new FetchNarrowingResultSetFactory(); - } - - //========================================================================== - // ========= - // Statement Factory - // ================= - /** - * Create the customize statement factory that is for all SQL on DBFlute. - * - * @return The customize statement factory. (NotNull) - */ - protected StatementFactory createCustomizeStatememtFactory() { - final StatementConfig defaultStatementConfig = DBFluteConfig - .getInstance().getDefaultStatementConfig(); - final boolean internalDebug = DBFluteConfig.getInstance() - .isInternalDebug(); - return new StatementFactory() { - public PreparedStatement createPreparedStatement(Connection con, - String sql) { - try { - final StatementConfig config = findStatementConfigOnThread(); - ; - final int resultSetType; - if (config != null && config.hasResultSetType()) { - resultSetType = config.getResultSetType(); - } else if (defaultStatementConfig != null - && defaultStatementConfig.hasResultSetType()) { - resultSetType = defaultStatementConfig - .getResultSetType(); - } else { - resultSetType = java.sql.ResultSet.TYPE_FORWARD_ONLY; - } - final int resultSetConcurrency = java.sql.ResultSet.CONCUR_READ_ONLY; - if (internalDebug) { - _log.debug("...Creating prepareStatement(sql, " - + resultSetType + ", " + resultSetConcurrency - + ")"); - } - final PreparedStatement ps = con.prepareStatement(sql, - resultSetType, resultSetConcurrency); - if (config != null && config.hasStatementOptions()) { - if (internalDebug) { - _log - .debug("...Setting statement config as request: " - + config); - } - reflectStatementOptions(config, ps); - } else { - reflectDefaultOptionsToStatementIfNeeds(ps); - } - return ps; - } catch (SQLException e) { - handleSQLException(e, null); - return null;// Unreachable! - } - } - - public CallableStatement createCallableStatement(Connection conn, - String sql) { - return prepareCall(conn, sql); - } - - protected StatementConfig findStatementConfigOnThread() { - final StatementConfig config; - if (ConditionBeanContext.isExistConditionBeanOnThread()) { - final ConditionBean cb = ConditionBeanContext - .getConditionBeanOnThread(); - config = cb.getStatementConfig(); - } else if (OutsideSqlContext.isExistOutsideSqlContextOnThread()) { - final OutsideSqlContext context = OutsideSqlContext - .getOutsideSqlContextOnThread(); - config = context.getStatementConfig(); - } else { - config = null; - } - return config; - } - - protected void reflectDefaultOptionsToStatementIfNeeds( - PreparedStatement ps) { - if (defaultStatementConfig != null - && defaultStatementConfig.hasStatementOptions()) { - if (internalDebug) { - _log.debug("...Setting statement config as default: " - + defaultStatementConfig); - } - reflectStatementOptions(defaultStatementConfig, ps); - return; - } - } - - protected void reflectStatementOptions(StatementConfig config, - PreparedStatement ps) { - try { - if (config.hasQueryTimeout()) { - ps.setQueryTimeout(config.getQueryTimeout()); - } - if (config.hasFetchSize()) { - ps.setFetchSize(config.getFetchSize()); - } - if (config.hasMaxRows()) { - ps.setMaxRows(config.getMaxRows()); - } - } catch (SQLException e) { - handleSQLException(e, ps); - } - } - - protected CallableStatement prepareCall(Connection conn, String sql) { - try { - return conn.prepareCall(sql); - } catch (SQLException e) { - handleSQLException(e, null); - return null;// Unreachable! - } - } - - protected void handleSQLException(SQLException e, - Statement statement) { - new SQLExceptionHandler().handleSQLException(e, statement); - } - }; - } - - //========================================================================== - // ========= - // Dispose - // ======= - public synchronized void dispose() { - daoMetaDataCache.clear(); - initialized = false; - } - - //========================================================================== - // ========= - // Helper - // ====== - /** - * Get the value of line separator. - * - * @return The value of line separator. (NotNull) - */ - protected static String getLineSeparator() { - return System.getProperty("line.separator"); - } - - //========================================================================== - // ========= - // Accessor - // ======== - // ----------------------------------------------------- - // Factory Basic - // ------------- - public void setValueTypeFactory(final ValueTypeFactory valueTypeFactory) { - this.valueTypeFactory = valueTypeFactory; - } - - protected BeanMetaDataFactory getBeanMetaDataFactory() { - return beanMetaDataFactory; - } - - public void setBeanMetaDataFactory( - final BeanMetaDataFactory beanMetaDataFactory) { - this.beanMetaDataFactory = beanMetaDataFactory; - } - - public DaoNamingConvention getDaoNamingConvention() { - return daoNamingConvention; - } - - public void setDaoNamingConvention( - final DaoNamingConvention daoNamingConvention) { - this.daoNamingConvention = daoNamingConvention; - } - - public void setAnnotationReaderFactory( - final AnnotationReaderFactory annotationReaderFactory) { - this.annotationReaderFactory = annotationReaderFactory; - } - - public void setDataSource(final DataSource dataSource) { - this.dataSource = dataSource; - } - - public void setUseDaoClassForLog(final boolean userDaoClassForLog) { - useDaoClassForLog = userDaoClassForLog; - } - - public void setResultSetHandlerFactory( - final ResultSetHandlerFactory resultSetHandlerFactory) { - this.resultSetHandlerFactory = resultSetHandlerFactory; - } - - public void setDtoMetaDataFactory( - final DtoMetaDataFactory dtoMetaDataFactory) { - this.dtoMetaDataFactory = dtoMetaDataFactory; - } - - public void setProcedureMetaDataFactory( - ProcedureMetaDataFactory procedureMetaDataFactory) { - this.procedureMetaDataFactory = procedureMetaDataFactory; - } - - public void setPagingSQLRewriter(final PagingSqlRewriter pagingSqlRewriter) { - this.pagingSqlRewriter = pagingSqlRewriter; - } - - public String getSqlFileEncoding() { - return sqlFileEncoding; - } - - public void setSqlFileEncoding(final String encoding) { - sqlFileEncoding = encoding; - } - - public BeanEnhancer getBeanEnhancer() { - return beanEnhancer; - } - - public void setBeanEnhancer(final BeanEnhancer beanEnhancer) { - this.beanEnhancer = beanEnhancer; - } - - // ----------------------------------------------------- - // Version After 1.0.47 - // -------------------- - public ColumnNaming getColumnNaming() { - return columnNaming; - } - - public void setColumnNaming(final ColumnNaming columnNaming) { - this.columnNaming = columnNaming; - } - - public PropertyTypeFactoryBuilder getPropertyTypeFactoryBuilder() { - return propertyTypeFactoryBuilder; - } - - public void setPropertyTypeFactoryBuilder( - final PropertyTypeFactoryBuilder propertyTypeFactoryBuilder) { - this.propertyTypeFactoryBuilder = propertyTypeFactoryBuilder; - } - - public RelationPropertyTypeFactoryBuilder getRelationPropertyTypeFactoryBuilder() { - return relationPropertyTypeFactoryBuilder; - } - - public void setRelationPropertyTypeFactoryBuilder( - final RelationPropertyTypeFactoryBuilder relationPropertyTypeFactoryBuilder) { - this.relationPropertyTypeFactoryBuilder = relationPropertyTypeFactoryBuilder; - } - - public TableNaming getTableNaming() { - return tableNaming; - } - - public void setTableNaming(final TableNaming tableNaming) { - this.tableNaming = tableNaming; - } -} \ No newline at end of file Deleted: 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 2008-12-27 22:14:41 UTC (rev 1629) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/s2dao/S2DaoPropertyTypeFactoryBuilderExtension.java 2008-12-27 22:18:30 UTC (rev 1630) @@ -1,215 +0,0 @@ -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 list = new ArrayList(); - final BeanDesc beanDesc = getBeanDesc(); - for (int i = 0; i < beanDesc.getPropertyDescSize(); ++i) { - final PropertyDesc pd = beanDesc.getPropertyDesc(i); - - // Read-only property is unnecessary! - if (!pd.hasWriteMethod()) { - continue; - } - - // Relation property is unnecessary! - if (isRelation(pd)) { - continue; - } - - final PropertyType pt = createPropertyType(pd); - pt.setPrimaryKey(isPrimaryKey(pd)); - pt.setPersistent(isPersistent(pt)); - list.add(pt); - } - return list.toArray(new PropertyType[list.size()]); - } - - @Override - protected boolean isRelation(PropertyDesc propertyDesc) { - final String propertyName = propertyDesc.getPropertyName(); - if (hasDBMeta() - && (_dbmeta.hasForeign(propertyName) || _dbmeta - .hasReferrer(propertyName))) { - return true; - } - return hasRelationNoAnnotation(propertyDesc); - } - - protected boolean hasRelationNoAnnotation(PropertyDesc propertyDesc) { - return beanAnnotationReader.hasRelationNo(propertyDesc); - } - - @Override - protected boolean isPrimaryKey(PropertyDesc propertyDesc) { - final String propertyName = propertyDesc.getPropertyName(); - if (hasDBMeta() && _dbmeta.hasPrimaryKey() - && _dbmeta.hasColumn(propertyName)) { - if (_dbmeta.findColumnInfo(propertyName).isPrimary()) { - return true; - } - } - return hasIdAnnotation(propertyDesc); - } - - protected boolean hasIdAnnotation(PropertyDesc propertyDesc) { - final Dbms dbms = getDbms(); - return beanAnnotationReader.getId(propertyDesc, dbms) != null; - } - - @Override - protected boolean isPersistent(PropertyType propertyType) { - final String propertyName = propertyType.getPropertyName(); - final PropertyDesc propertyDesc = propertyType.getPropertyDesc(); - if ((hasDBMeta() && _dbmeta.hasColumn(propertyName)) - || hasColumnAnnotation(propertyDesc)) { - if (!isElementOfNoPersistentProps(propertyDesc)) { - return true; - } - } - return false; - } - - protected boolean hasColumnAnnotation(PropertyDesc propertyDesc) { - return beanAnnotationReader.getColumnAnnotation(propertyDesc) != null; - } - - protected boolean isElementOfNoPersistentProps(PropertyDesc propertyDesc) { - final String propertyName = propertyDesc.getPropertyName(); - final String[] props = _noPersisteneProps; - if (props != null && props.length >= 0) { - for (int i = 0; i < props.length; ++i) { - if (props[i].equals(propertyName)) { - return true; - } - } - } - return false; - } - } - - //========================================================================== - // ========= - // Accessor - // ======== - public ValueTypeFactory getValueTypeFactory() { - return valueTypeFactory; - } - - public void setValueTypeFactory(ValueTypeFactory valueTypeFactory) { - this.valueTypeFactory = valueTypeFactory; - } - - public ColumnNaming getColumnNaming() { - return columnNaming; - } - - public void setColumnNaming(ColumnNaming columnNaming) { - this.columnNaming = columnNaming; - } -} Deleted: 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 2008-12-27 22:14:41 UTC (rev 1629) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/s2dao/S2DaoSelectDynamicCommand.java 2008-12-27 22:18:30 UTC (rev 1630) @@ -1,491 +0,0 @@ -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 bindVariableList = new ArrayList(4); - final List bindVariableTypeList = new ArrayList(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 bindVariableList = new java.util.ArrayList(); - final java.util.List bindVariableTypeList = new java.util.ArrayList(); - 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 bindVariableList, List 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 bindVariableList, List 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 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 bindVariableList, List bindVariableTypeList) { - final Object[] bindVariables = ctx.getBindVariables(); - addBindVariableList(bindVariableList, bindVariables); - final Class[] bindVariableTypes = ctx.getBindVariableTypes(); - addBindVariableTypeList(bindVariableTypeList, bindVariableTypes); - } - - protected void addBindVariableList(List bindVariableList, - Object[] bindVariables) { - for (int i = 0; i < bindVariables.length; i++) { - bindVariableList.add(bindVariables[i]); - } - } - - protected void addBindVariableTypeList(List bindVariableTypeList, - Class[] bindVariableTypes) { - for (int i = 0; i < bindVariableTypes.length; i++) { - bindVariableTypeList.add(bindVariableTypes[i]); - } - } - - //========================================================================== - // ========= - // General Helper - // ============== - protected final String replaceString(String text, String fromText, - String toText) { - return SimpleStringUtil.replace(text, fromText, toText); - } - - protected String getLineSeparator() { - return SimpleSystemUtil.getLineSeparator(); - } -} \ No newline at end of file Added: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/s2dao/SqlLogRegistryLatestSqlProvider.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/s2dao/SqlLogRegistryLatestSqlProvider.java (rev 0) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/s2dao/SqlLogRegistryLatestSqlProvider.java 2008-12-27 22:18:30 UTC (rev 1630) @@ -0,0 +1,21 @@ +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 using SqlLogRegistry. This instance should be + * singleton. + * + * @author DBFlute(AutoGenerator) + */ +public class SqlLogRegistryLatestSqlProvider implements LatestSqlProvider { + + public String getDisplaySql() { + return InternalSqlLogRegistry.peekCompleteSql(); + } + + public void clearSqlCache() { + InternalSqlLogRegistry.clearSqlLogRegistry(); + } +} Property changes on: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/s2dao/SqlLogRegistryLatestSqlProvider.java ___________________________________________________________________ Name: svn:eol-style + native Modified: 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 2008-12-27 22:14:41 UTC (rev 1629) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/s2dao/internal/rshandler/InternalAbstractDtoMetaDataResultSetHandler.java 2008-12-27 22:18:30 UTC (rev 1630) @@ -6,10 +6,11 @@ import java.util.Map; import java.util.Set; +import jp.sf.pal.scheduler.db.allcommon.helper.StringSet; + import org.seasar.dao.DtoMetaData; import org.seasar.dao.RowCreator; import org.seasar.extension.jdbc.ResultSetHandler; -import org.seasar.framework.util.CaseInsensitiveSet; /** * @author DBFlute(AutoGenerator) @@ -67,10 +68,10 @@ return rowCreator.createRow(rs, propertyCache, beanClass); } - protected Set createColumnNames(final ResultSetMetaData rsmd) + protected Set createColumnNames(final ResultSetMetaData rsmd) throws SQLException { final int count = rsmd.getColumnCount(); - final Set columnNames = new CaseInsensitiveSet(); + final Set columnNames = StringSet.createAsCaseInsensitive(); for (int i = 0; i < count; ++i) { final String columnName = rsmd.getColumnLabel(i + 1); final int pos = columnName.lastIndexOf('.'); // [DAO-41] Modified: 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 2008-12-27 22:14:41 UTC (rev 1629) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/s2dao/internal/sqlcommand/InternalAbstractAutoStaticCommand.java 2008-12-27 22:18:30 UTC (rev 1630) @@ -10,7 +10,6 @@ import org.seasar.dao.BeanMetaData; import org.seasar.dao.IdentifierGenerator; -import org.seasar.dao.NotSingleRowUpdatedRuntimeException; import org.seasar.dao.PrimaryKeyNotFoundRuntimeException; import org.seasar.extension.jdbc.PropertyType; import org.seasar.extension.jdbc.StatementFactory; @@ -24,19 +23,13 @@ //========================================================================== // ========= - // Definition - // ========== - protected static final boolean DEFAULT_VERSION_NO_AUTO_INCREMENT_ON_MEMORY = true; - - //========================================================================== - // ========= // Attribute // ========= private PropertyType[] propertyTypes; - private boolean checkSingleRowUpdate = true; + protected boolean optimisticLockHandling; - protected boolean versionNoAutoIncrementOnMemory = DEFAULT_VERSION_NO_AUTO_INCREMENT_ON_MEMORY; + protected boolean versionNoAutoIncrementOnMemory; //========================================================================== // ========= @@ -44,15 +37,10 @@ // =========== public InternalAbstractAutoStaticCommand(DataSource dataSource, StatementFactory statementFactory, BeanMetaData beanMetaData, - String[] propertyNames) { - this(dataSource, statementFactory, beanMetaData, propertyNames, - DEFAULT_VERSION_NO_AUTO_INCREMENT_ON_MEMORY); - } - - public InternalAbstractAutoStaticCommand(DataSource dataSource, - StatementFactory statementFactory, BeanMetaData beanMetaData, - String[] propertyNames, boolean versionNoAutoIncrementOnMemory) { + String[] propertyNames, boolean optimisticLockHandling, + boolean versionNoAutoIncrementOnMemory) { super(dataSource, statementFactory, beanMetaData); + this.optimisticLockHandling = optimisticLockHandling; this.versionNoAutoIncrementOnMemory = versionNoAutoIncrementOnMemory; setupPropertyTypes(propertyNames); setupSql(); @@ -62,26 +50,19 @@ // ========= // Execute // ======= - public Object execute(Object[] args) { + public Object execute(Object[] args) { // NOT for Batch. Batch should + // override. InternalAbstractAutoHandler handler = createAutoHandler(); + handler.setOptimisticLockHandling(optimisticLockHandling); + handler + .setVersionNoAutoIncrementOnMemory(versionNoAutoIncrementOnMemory); handler.setSql(getSql()); handler.setLoggingMessageSqlArgs(args); int rows = handler.execute(args); - if (isCheckSingleRowUpdate() && rows != 1) { - throw createNotSingleRowUpdatedRuntimeException(args[0], rows); - } return new Integer(rows); } - public boolean isCheckSingleRowUpdate() { - return checkSingleRowUpdate; - } - - public void setCheckSingleRowUpdate(boolean checkSingleRowUpdate) { - this.checkSingleRowUpdate = checkSingleRowUpdate; - } - - protected NotSingleRowUpdatedRuntimeException createNotSingleRowUpdatedRuntimeException( + protected EntityAlreadyUpdatedException createEntityAlreadyUpdatedException( Object bean, int rows) { return new EntityAlreadyUpdatedException(bean, rows); } @@ -194,7 +175,7 @@ protected void setupDeleteSql() { checkPrimaryKey(); - StringBuilder sb = new StringBuilder(100); + final StringBuilder sb = new StringBuilder(100); sb.append("delete from "); sb.append(getBeanMetaData().getTableName()); setupUpdateWhere(sb); @@ -215,11 +196,11 @@ sb.append(bmd.getPrimaryKey(i)).append(" = ? and "); } sb.setLength(sb.length() - 5); - if (bmd.hasVersionNoPropertyType()) { + if (optimisticLockHandling && bmd.hasVersionNoPropertyType()) { PropertyType pt = bmd.getVersionNoPropertyType(); sb.append(" and ").append(pt.getColumnName()).append(" = ?"); } - if (bmd.hasTimestampPropertyType()) { + if (optimisticLockHandling && bmd.hasTimestampPropertyType()) { PropertyType pt = bmd.getTimestampPropertyType(); sb.append(" and ").append(pt.getColumnName()).append(" = ?"); } Modified: 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 2008-12-27 22:14:41 UTC (rev 1629) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/s2dao/internal/sqlcommand/InternalAbstractBatchAutoStaticCommand.java 2008-12-27 22:18:30 UTC (rev 1630) @@ -15,49 +15,30 @@ //========================================================================== // ========= - // Attribute - // ========= - protected final boolean returningRows; - - //========================================================================== - // ========= // Constructor // =========== public InternalAbstractBatchAutoStaticCommand(DataSource dataSource, StatementFactory statementFactory, BeanMetaData beanMetaData, - String[] propertyNames, boolean returningRows) { - this(dataSource, statementFactory, beanMetaData, propertyNames, - returningRows, DEFAULT_VERSION_NO_AUTO_INCREMENT_ON_MEMORY); - } - - public InternalAbstractBatchAutoStaticCommand(DataSource dataSource, - StatementFactory statementFactory, BeanMetaData beanMetaData, - String[] propertyNames, boolean returningRows, + String[] propertyNames, boolean optimisticLockHandling, boolean versionNoAutoIncrementOnMemory) { super(dataSource, statementFactory, beanMetaData, propertyNames, - versionNoAutoIncrementOnMemory); - this.returningRows = returningRows; + optimisticLockHandling, versionNoAutoIncrementOnMemory); } //========================================================================== // ========= // Execute // ======= + @Override public Object execute(Object[] args) { final InternalAbstractBatchAutoHandler handler = createBatchAutoHandler(); - - // It is unnecessary! - // injectDaoClass(handler); - + handler.setOptimisticLockHandling(optimisticLockHandling); + handler + .setVersionNoAutoIncrementOnMemory(versionNoAutoIncrementOnMemory); handler.setSql(getSql()); // The logging message SQL of procedure is unnecessary. // handler.setLoggingMessageSqlArgs(args); - if (this.returningRows) { - return handler.executeBatch(args); - } else { - final int updatedRows = handler.execute(args); - return new Integer(updatedRows); - } + return handler.executeBatch(args); } protected abstract InternalAbstractBatchAutoHandler createBatchAutoHandler(); Modified: 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 2008-12-27 22:14:41 UTC (rev 1629) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/s2dao/internal/sqlcommand/InternalAbstractDynamicCommand.java 2008-12-27 22:18:30 UTC (rev 1630) @@ -44,10 +44,15 @@ } protected InternalSqlParser createInternalSqlParser(String sql) { - return new InternalSqlParser(sql); + return new InternalSqlParser(sql, isBlockNullParameter()); } - public CommandContext apply(Object[] args) {// It is necessary to be public! + protected boolean isBlockNullParameter() { // Extension Point! + return false; + } + + public CommandContext apply(Object[] args) { // It is necessary to be + // public! final CommandContext ctx = createCommandContext(args); rootNode.accept(ctx); return ctx; Modified: 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 2008-12-27 22:14:41 UTC (rev 1629) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/s2dao/internal/sqlcommand/InternalAbstractSqlCommand.java 2008-12-27 22:18:30 UTC (rev 1630) @@ -2,13 +2,16 @@ import javax.sql.DataSource; +import jp.sf.pal.scheduler.db.allcommon.bhv.core.SqlExecution; + import org.seasar.dao.SqlCommand; import org.seasar.extension.jdbc.StatementFactory; /** * @author DBFlute(AutoGenerator) */ -public abstract class InternalAbstractSqlCommand implements SqlCommand { +public abstract class InternalAbstractSqlCommand implements SqlCommand, + SqlExecution { //========================================================================== // ========= Modified: 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 2008-12-27 22:14:41 UTC (rev 1629) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/s2dao/internal/sqlcommand/InternalDeleteAutoStaticCommand.java 2008-12-27 22:18:30 UTC (rev 1630) @@ -20,8 +20,9 @@ // =========== public InternalDeleteAutoStaticCommand(DataSource dataSource, StatementFactory statementFactory, BeanMetaData beanMetaData, - String[] propertyNames) { - super(dataSource, statementFactory, beanMetaData, propertyNames); + String[] propertyNames, boolean optimisticLockHandling) { + super(dataSource, statementFactory, beanMetaData, propertyNames, + optimisticLockHandling, false); } //========================================================================== Modified: 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 2008-12-27 22:14:41 UTC (rev 1629) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/s2dao/internal/sqlcommand/InternalDeleteBatchAutoStaticCommand.java 2008-12-27 22:18:30 UTC (rev 1630) @@ -21,9 +21,9 @@ // =========== public InternalDeleteBatchAutoStaticCommand(DataSource dataSource, StatementFactory statementFactory, BeanMetaData beanMetaData, - String[] propertyNames, boolean returningRows) { + String[] propertyNames, boolean optimisticLockHandling) { super(dataSource, statementFactory, beanMetaData, propertyNames, - returningRows); + optimisticLockHandling, false); } //========================================================================== Modified: 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 2008-12-27 22:14:41 UTC (rev 1629) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/s2dao/internal/sqlcommand/InternalDeleteQueryAutoDynamicCommand.java 2008-12-27 22:18:30 UTC (rev 1630) @@ -2,6 +2,7 @@ import javax.sql.DataSource; +import jp.sf.pal.scheduler.db.allcommon.bhv.core.SqlExecution; 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; @@ -16,7 +17,8 @@ /** * @author DBFlute(AutoGenerator) */ -public class InternalDeleteQueryAutoDynamicCommand implements SqlCommand { +public class InternalDeleteQueryAutoDynamicCommand implements SqlCommand, + SqlExecution { //========================================================================== // ========= @@ -83,7 +85,7 @@ String[] argNames, Class[] argTypes, Object[] args) { CommandContext context; { - InternalSqlParser parser = new InternalSqlParser(twoWaySql); + InternalSqlParser parser = new InternalSqlParser(twoWaySql, true); Node node = parser.parse(); InternalCommandContextCreator creator = new InternalCommandContextCreator( argNames, argTypes); Modified: 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 2008-12-27 22:14:41 UTC (rev 1629) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/s2dao/internal/sqlcommand/InternalInsertAutoDynamicCommand.java 2008-12-27 22:18:30 UTC (rev 1630) @@ -5,11 +5,11 @@ import javax.sql.DataSource; +import jp.sf.pal.scheduler.db.allcommon.bhv.core.SqlExecution; 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; @@ -18,7 +18,8 @@ /** * @author DBFlute(AutoGenerator) */ -public class InternalInsertAutoDynamicCommand implements SqlCommand { +public class InternalInsertAutoDynamicCommand implements SqlCommand, + SqlExecution { //========================================================================== // ========= @@ -32,8 +33,6 @@ protected String[] propertyNames; - protected boolean checkSingleRowUpdate = true; - //========================================================================== // ========= // Constructor @@ -56,9 +55,6 @@ handler.setSql(sql); handler.setLoggingMessageSqlArgs(args); final int rows = handler.execute(args); - if (isCheckSingleRowUpdate() && rows != 1) { - throw new NotSingleRowUpdatedRuntimeException(args[0], rows); - } return new Integer(rows); } @@ -161,12 +157,4 @@ public void setPropertyNames(String[] propertyNames) { this.propertyNames = propertyNames; } - - public boolean isCheckSingleRowUpdate() { - return checkSingleRowUpdate; - } - - public void setCheckSingleRowUpdate(boolean checkSingleRowUpdate) { - this.checkSingleRowUpdate = checkSingleRowUpdate; - } } Modified: 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 2008-12-27 22:14:41 UTC (rev 1629) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/s2dao/internal/sqlcommand/InternalInsertBatchAutoStaticCommand.java 2008-12-27 22:18:30 UTC (rev 1630) @@ -21,9 +21,9 @@ // =========== public InternalInsertBatchAutoStaticCommand(DataSource dataSource, StatementFactory statementFactory, BeanMetaData beanMetaData, - String[] propertyNames, boolean returningRows) { - super(dataSource, statementFactory, beanMetaData, propertyNames, - returningRows); + String[] propertyNames) { + super(dataSource, statementFactory, beanMetaData, propertyNames, false, + false); } //========================================================================== Modified: 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 2008-12-27 22:14:41 UTC (rev 1629) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/s2dao/internal/sqlcommand/InternalProcedureCommand.java 2008-12-27 22:18:30 UTC (rev 1630) @@ -2,6 +2,7 @@ import javax.sql.DataSource; +import jp.sf.pal.scheduler.db.allcommon.bhv.core.SqlExecution; 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; @@ -13,7 +14,7 @@ /** * @author DBFlute(AutoGenerator) */ -public class InternalProcedureCommand implements SqlCommand { +public class InternalProcedureCommand implements SqlCommand, SqlExecution { //========================================================================== // ========= Modified: 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 2008-12-27 22:14:41 UTC (rev 1629) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/s2dao/internal/sqlcommand/InternalUpdateAutoDynamicCommand.java 2008-12-27 22:18:30 UTC (rev 1630) @@ -5,29 +5,27 @@ import javax.sql.DataSource; +import jp.sf.pal.scheduler.db.allcommon.XLog; 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 { +public class InternalUpdateAutoDynamicCommand extends + InternalAbstractSqlCommand { //========================================================================== // ========= // Definition // ========== - /** Log instance. */ - private static final org.apache.commons.logging.Log _log = org.apache.commons.logging.LogFactory - .getLog(InternalUpdateAutoDynamicCommand.class); + /** The result for no update as normal execution. */ + private static final Integer NO_UPDATE = new Integer(1); - private static final Integer NO_UPDATE = new Integer(0); - //========================================================================== // ========= // Attribute @@ -36,9 +34,9 @@ private String[] propertyNames; - private boolean checkSingleRowUpdate = true; + private boolean optimisticLockHandling; - private boolean versionNoAutoIncrementOnMemory = true; + private boolean versionNoAutoIncrementOnMemory; //========================================================================== // ========= @@ -59,8 +57,8 @@ final PropertyType[] propertyTypes = createUpdatePropertyTypes(bmd, bean, getPropertyNames()); if (propertyTypes.length == 0) { - if (_log.isDebugEnabled()) { - _log.debug(createNoUpdateLogMessage(bean, bmd)); + if (isLogEnabled()) { + log(createNoUpdateLogMessage(bean, bmd)); } return NO_UPDATE; } @@ -83,10 +81,10 @@ BeanMetaData bmd, PropertyType[] propertyTypes) { InternalUpdateAutoHandler handler = new InternalUpdateAutoHandler( getDataSource(), getStatementFactory(), bmd, propertyTypes); + handler.setOptimisticLockHandling(optimisticLockHandling); //[DBFlute-0.8 + // .0] handler .setVersionNoAutoIncrementOnMemory(versionNoAutoIncrementOnMemory); - handler.setCheckSingleRowUpdate(isCheckSingleRowUpdate()); //[DBFlute-0.8 - // .0] return handler; } @@ -182,17 +180,33 @@ sb.append(bmd.getPrimaryKey(i)).append(" = ? and "); } sb.setLength(sb.length() - 5); - if (bmd.hasVersionNoPropertyType()) { + if (optimisticLockHandling && bmd.hasVersionNoPropertyType()) { PropertyType pt = bmd.getVersionNoPropertyType(); sb.append(" and ").append(pt.getColumnName()).append(" = ?"); } - if (bmd.hasTimestampPropertyType()) { + if (optimisticLockHandling && bmd.hasTimestampPropertyType()) { PropertyType pt = bmd.getTimestampPropertyType(); sb.append(" and ").append(pt.getColumnName()).append(" = ?"); } return sb.toString(); } + //========================================================================== + // ========= + // Execute Status Log + // ================== + protected void log(String msg) { + XLog.log(msg); + } + + protected boolean isLogEnabled() { + return XLog.isLogEnabled(); + } + + //========================================================================== + // ========= + // Accessor + // ======== protected boolean isVersionNoAutoIncrementOnMemory() { return versionNoAutoIncrementOnMemory; } @@ -223,11 +237,7 @@ this.propertyNames = propertyNames; } - public boolean isCheckSingleRowUpdate() { - return checkSingleRowUpdate; + public void setOptimisticLockHandling(boolean optimisticLockHandling) { + this.optimisticLockHandling = optimisticLockHandling; } - - public void setCheckSingleRowUpdate(boolean resultCheck) { - this.checkSingleRowUpdate = resultCheck; - } } Modified: 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 2008-12-27 22:14:41 UTC (rev 1629) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/s2dao/internal/sqlcommand/InternalUpdateBatchAutoStaticCommand.java 2008-12-27 22:18:30 UTC (rev 1630) @@ -21,10 +21,10 @@ // =========== public InternalUpdateBatchAutoStaticCommand(DataSource dataSource, StatementFactory statementFactory, BeanMetaData beanMetaData, - String[] propertyNames, boolean returningRows, + String[] propertyNames, boolean optimisticLockHandling, boolean versionNoAutoIncrementOnMemory) { super(dataSource, statementFactory, beanMetaData, propertyNames, - returningRows, versionNoAutoIncrementOnMemory); + optimisticLockHandling, versionNoAutoIncrementOnMemory); } //========================================================================== Modified: 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 2008-12-27 22:14:41 UTC (rev 1629) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/s2dao/internal/sqlcommand/InternalUpdateDynamicCommand.java 2008-12-27 22:18:30 UTC (rev 1630) @@ -28,11 +28,16 @@ // ======= public Object execute(Object args[]) { final CommandContext ctx = apply(args); - final InternalBasicUpdateHandler updateHandler = new InternalBasicUpdateHandler( - getDataSource(), ctx.getSql(), getStatementFactory()); - Object[] bindVariables = ctx.getBindVariables(); + final InternalBasicUpdateHandler updateHandler = createBasicUpdateHandler(ctx); + final Object[] bindVariables = ctx.getBindVariables(); updateHandler.setLoggingMessageSqlArgs(bindVariables); return new Integer(updateHandler.execute(bindVariables, ctx .getBindVariableTypes())); } + + protected InternalBasicUpdateHandler createBasicUpdateHandler( + CommandContext ctx) { + return new InternalBasicUpdateHandler(getDataSource(), ctx.getSql(), + getStatementFactory()); + } } Modified: 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 2008-12-27 22:14:41 UTC (rev 1629) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/s2dao/internal/sqlcommand/InternalUpdateQueryAutoDynamicCommand.java 2008-12-27 22:18:30 UTC (rev 1630) @@ -10,6 +10,7 @@ import javax.sql.DataSource; import jp.sf.pal.scheduler.db.allcommon.Entity; +import jp.sf.pal.scheduler.db.allcommon.bhv.core.SqlExecution; 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; @@ -27,7 +28,8 @@ /** * @author DBFlute(AutoGenerator) */ -public class InternalUpdateQueryAutoDynamicCommand implements SqlCommand { +public class InternalUpdateQueryAutoDynamicCommand implements SqlCommand, + SqlExecution { //========================================================================== // ========= @@ -209,7 +211,7 @@ String[] argNames, Class[] argTypes, Object[] args) { CommandContext context; { - InternalSqlParser parser = new InternalSqlParser(twoWaySql); + InternalSqlParser parser = new InternalSqlParser(twoWaySql, true); Node node = parser.parse(); InternalCommandContextCreator creator = new InternalCommandContextCreator( argNames, argTypes); Modified: 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 2008-12-27 22:14:41 UTC (rev 1629) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/s2dao/internal/sqlhandler/InternalAbstractAutoHandler.java 2008-12-27 22:18:30 UTC (rev 1630) @@ -10,12 +10,14 @@ import javax.sql.DataSource; +import jp.sf.pal.scheduler.db.allcommon.exception.EntityAlreadyUpdatedException; +import jp.sf.pal.scheduler.db.allcommon.util.SimpleTypeUtil; + import org.seasar.dao.BeanMetaData; import org.seasar.extension.jdbc.PropertyType; import org.seasar.extension.jdbc.StatementFactory; import org.seasar.extension.jdbc.ValueType; import org.seasar.framework.beans.PropertyDesc; -import org.seasar.framework.util.IntegerConversionUtil; /** * @author DBFlute(AutoGenerator) @@ -38,8 +40,10 @@ protected PropertyType[] propertyTypes; - protected boolean versionNoAutoIncrementOnMemory = true; + protected boolean optimisticLockHandling; + protected boolean versionNoAutoIncrementOnMemory; + //========================================================================== // ========= // Constructor @@ -52,6 +56,10 @@ this.propertyTypes = propertyTypes; } + //========================================================================== + // ========= + // Execute + // ======= public int execute(Object[] args) { Connection connection = getConnection(); try { @@ -77,6 +85,9 @@ } finally { close(ps); } + if (optimisticLockHandling && ret != 1) { + throw createEntityAlreadyUpdatedException(bean, ret); + } postUpdateBean(bean, ret); return ret; } @@ -96,12 +107,25 @@ } } + protected EntityAlreadyUpdatedException createEntityAlreadyUpdatedException( + Object bean, int rows) { + return new EntityAlreadyUpdatedException(bean, rows); + } + + //========================================================================== + // ========= + // Pre/Post Bean + // ============= protected void preUpdateBean(Object bean) { } protected void postUpdateBean(Object bean, int ret) { } + //========================================================================== + // ========= + // Bind Setupper + // ============= protected abstract void setupBindVariables(Object bean); protected void setupInsertBindVariables(Object bean) { @@ -149,7 +173,7 @@ if (value == null) { continue;// because of 'VERSION_NO = VERSION_NO + 1' } - int intValue = IntegerConversionUtil.toPrimitiveInt(value) + 1; + int intValue = SimpleTypeUtil.toPrimitiveInt(value) + 1; setVersionNo(new Integer(intValue)); varList.add(getVersionNo()); } else { @@ -182,13 +206,13 @@ varList.add(pd.getValue(bean)); varValueTypeList.add(pt.getValueType()); } - if (bmd.hasVersionNoPropertyType()) { + if (optimisticLockHandling && bmd.hasVersionNoPropertyType()) { PropertyType pt = bmd.getVersionNoPropertyType(); PropertyDesc pd = pt.getPropertyDesc(); varList.add(pd.getValue(bean)); varValueTypeList.add(pt.getValueType()); } - if (bmd.hasTimestampPropertyType()) { + if (optimisticLockHandling && bmd.hasTimestampPropertyType()) { PropertyType pt = bmd.getTimestampPropertyType(); PropertyDesc pd = pt.getPropertyDesc(); varList.add(pd.getValue(bean)); @@ -260,6 +284,14 @@ this.propertyTypes = propertyTypes; } + public boolean isOptimisticLockHandling() { + return optimisticLockHandling; + } + + public void setOptimisticLockHandling(boolean optimisticLockHandling) { + this.optimisticLockHandling = optimisticLockHandling; + } + protected boolean isVersionNoAutoIncrementOnMemory() { return versionNoAutoIncrementOnMemory; } Modified: 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 2008-12-27 22:14:41 UTC (rev 1629) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/s2dao/internal/sqlhandler/InternalAbstractBatchAutoHandler.java 2008-12-27 22:18:30 UTC (rev 1630) @@ -9,6 +9,11 @@ import javax.sql.DataSource; +import jp.sf.pal.scheduler.db.allcommon.DBDef; +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 org.seasar.dao.BeanMetaData; import org.seasar.extension.jdbc.PropertyType; import org.seasar.extension.jdbc.StatementFactory; @@ -41,6 +46,39 @@ // ========= // Execute // ======= + public int execute(Object[] args) { + List list = null; + if (args[0] instanceof Object[]) { + list = Arrays.asList((Object[]) args[0]); + } else if (args[0] instanceof List) { + list = (List) args[0]; + } + if (list == null) { + throw new IllegalArgumentException("args[0]"); + } + int[] ret = execute(list); + int updatedRow = 0; + for (int i = 0; i < ret.length; i++) { + if (ret[i] > 0) { + updatedRow += ret[i]; + } + } + return updatedRow; + } + + public int[] executeBatch(Object[] args) { + List list = null; + if (args[0] instanceof Object[]) { + list = Arrays.asList((Object[]) args[0]); + } else if (args[0] instanceof List) { + list = (List) args[0]; + } + if (list == null) { + throw new IllegalArgumentException("args[0]"); + } + return execute(list); + } + public int[] execute(List list, Class[] argTypes) { return execute(list); } @@ -63,7 +101,9 @@ final Object bean = (Object) iter.next(); prepareBatchElement(ps, bean); } - return executeBatch(ps, list); + final int[] result = executeBatch(ps, list); + handleBatchUpdateResultWithOptimisticLock(ps, list, result); + return result; } finally { close(ps); } @@ -74,46 +114,100 @@ // postBatchUpdateBean(...); } - public int execute(Object[] args) { - List list = null; - if (args[0] instanceof Object[]) { - list = Arrays.asList((Object[]) args[0]); - } else if (args[0] instanceof List) { - list = (List) args[0]; + protected void prepareBatchElement(PreparedStatement ps, Object bean) { + setupBindVariables(bean); + logSql(getBindVariables(), getArgTypes(getBindVariables())); + bindArgs(ps, getBindVariables(), getBindVariableValueTypes()); + addBatch(ps); + } + + //========================================================================== + // ========= + // Optimistic Lock + // =============== + protected void handleBatchUpdateResultWithOptimisticLock( + PreparedStatement ps, List list, int[] result) { + if (DBDef.isCurrentDef(DBDef.Oracle)) { + final int updateCount; + try { + updateCount = ps.getUpdateCount(); + } catch (SQLException e) { + handleSQLException(e, ps); + return; // Unreachable! + } + handleBatchUpdateResultWithOptimisticLockByUpdateCount(list, + updateCount); + } else { + handleBatchUpdateResultWithOptimisticLockByResult(list, result); } - if (list == null) { - throw new IllegalArgumentException("args[0]"); + } + + protected void handleBatchUpdateResultWithOptimisticLockByUpdateCount( + List list, int updateCount) { + if (list.isEmpty()) { + return;// for Safety! } - int[] ret = execute(list); - int updatedRow = 0; - for (int i = 0; i < ret.length; i++) { - if (ret[i] > 0) { - updatedRow += ret[i]; + if (updateCount < 0) { + return;// for Safety! + } + final int entityCount = list.size(); + if (updateCount < entityCount) { + if (isOptimisticLockHandling()) { + throw new BatchEntityAlreadyUpdatedException(list.get(0), 0, + updateCount); + } else { + String msg = "The entity have already deleted:"; + msg = msg + " updateCount=" + updateCount; + msg = msg + " entityCount=" + entityCount; + msg = msg + " allEntities=" + list; + throw new EntityAlreadyDeletedException(msg); } } - return updatedRow; } - public int[] executeBatch(Object[] args) { - List list = null; - if (args[0] instanceof Object[]) { - list = Arrays.asList((Object[]) args[0]); - } else if (args[0] instanceof List) { - list = (List) args[0]; + protected void handleBatchUpdateResultWithOptimisticLockByResult( + List list, int[] result) { + if (list.isEmpty()) { + return;// for Safety! } - if (list == null) { - throw new IllegalArgumentException("args[0]"); + final int[] updatedCountArray = result; + final int entityCount = list.size(); + int index = 0; + boolean alreadyUpdated = false; + for (int oneUpdateCount : updatedCountArray) { + if (entityCount <= index) { + break;// for Safety! + } + if (oneUpdateCount == 0) { + alreadyUpdated = true; + break; + } else if (oneUpdateCount > 1) { + String msg = "The entity updated two or more records in batch update:"; + msg = msg + " entity=" + list.get(index); + msg = msg + " updatedCount=" + oneUpdateCount; + msg = msg + " allEntities=" + list; + throw new EntityDuplicatedException(msg); + } + ++index; } - return execute(list); + if (alreadyUpdated) { + int updateCount = 0; + for (int oneUpdateCount : updatedCountArray) { + updateCount = updateCount + oneUpdateCount; + } + if (isOptimisticLockHandling()) { + throw new BatchEntityAlreadyUpdatedException(list.get(index), + 0, updateCount); + } else { + String msg = "The entity have already deleted:"; + msg = msg + " entity=" + list.get(index); + msg = msg + " updateCount=" + updateCount; + msg = msg + " allEntities=" + list; + throw new EntityAlreadyDeletedException(msg); + } + } } - protected void prepareBatchElement(PreparedStatement ps, Object bean) { - setupBindVariables(bean); - logSql(getBindVariables(), getArgTypes(getBindVariables())); - bindArgs(ps, getBindVariables(), getBindVariableValueTypes()); - addBatch(ps); - } - //========================================================================== // ========= // JDBC Delegator Modified: 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 2008-12-27 22:14:41 UTC (rev 1629) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/s2dao/internal/sqlhandler/InternalBasicHandler.java 2008-12-27 22:18:30 UTC (rev 1630) @@ -9,6 +9,7 @@ import javax.sql.DataSource; import jp.sf.pal.scheduler.db.allcommon.CallbackContext; +import jp.sf.pal.scheduler.db.allcommon.DBDef; import jp.sf.pal.scheduler.db.allcommon.DBFluteConfig; import jp.sf.pal.scheduler.db.allcommon.InternalMapContext; import jp.sf.pal.scheduler.db.allcommon.QLog; @@ -25,7 +26,6 @@ import org.seasar.extension.jdbc.StatementFactory; import org.seasar.extension.jdbc.ValueType; import org.seasar.extension.jdbc.types.ValueTypes; -import org.seasar.framework.exception.SQLRuntimeException; /** * @author DBFlute(AutoGenerator) @@ -73,7 +73,7 @@ return; } for (int i = 0; i < args.length; ++i) { - ValueType valueType = getValueType(argTypes[i]); + final ValueType valueType = findValueType(args[i], argTypes[i]); try { valueType.bindValue(ps, i + 1, args[i]); } catch (SQLException e) { @@ -82,6 +82,19 @@ } } + protected ValueType findValueType(Object arg, Class argType) { + ValueType valueType = ValueTypes.getValueType(arg); + if (valueType != null) { + return valueType; + } + valueType = ValueTypes.getValueType(argType); + if (valueType != null) { + return valueType; + } + String msg = "Unknown type¡§argType=" + argType + " args=" + arg; + throw new IllegalStateException(msg); + } + protected Class[] getArgTypes(Object[] args) { if (args == null) { return null; @@ -151,10 +164,6 @@ return InternalBindVariableUtil.getBindVariableText(bindVariable); } - protected ValueType getValueType(Class clazz) { - return ValueTypes.getValueType(clazz); - } - //========================================================================== // ========= // Exception Handler @@ -194,9 +203,6 @@ public void handleSQLException(SQLException e, Statement statement, boolean uniqueConstraintValid, String completeSql) { - if (isSqlExceptionOldStyleHandling()) { - throw new SQLRuntimeException(e); - } if (uniqueConstraintValid && isUniqueConstraintException(e)) { throwEntityAlreadyExistsException(e, statement, completeSql); } @@ -217,10 +223,6 @@ .getUniqueConstraintDeterminator(); } - protected boolean isSqlExceptionOldStyleHandling() { - return DBFluteConfig.getInstance().isSqlExceptionOldStyleHandling(); - } - protected void throwEntityAlreadyExistsException(SQLException e, Statement statement, String completeSql) { String msg = "Look! Read the message below." + getLineSeparator(); @@ -560,7 +562,7 @@ // ========= // Assist Helper // ============= - // It needs this method if the target database doest not support line + // It needs this method if the target database does not support line // comment. protected String removeLineComment(final String sql) { // With removing CR! if (sql == null || sql.trim().length() == 0) { @@ -578,7 +580,8 @@ } sb.append(line).append("\n"); } - return sb.toString(); + final String filteredSql = sb.toString(); + return filteredSql.substring(0, filteredSql.lastIndexOf("\n")); } //========================================================================== @@ -606,9 +609,17 @@ } public void setSql(String sql) { + if (isRemoveLineCommentFromSql()) { + sql = removeLineComment(sql); + } this.sql = sql; } + protected boolean isRemoveLineCommentFromSql() { + // Because the MS-Access does not support line comments. + return DBDef.isCurrentDef(DBDef.MSAccess); + } + public StatementFactory getStatementFactory() { return statementFactory; } Modified: 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 2008-12-27 22:14:41 UTC (rev 1629) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/s2dao/internal/sqlhandler/InternalBasicSelectHandler.java 2008-12-27 22:18:30 UTC (rev 1630) @@ -45,8 +45,7 @@ return execute(args, getArgTypes(args)); } - @SuppressWarnings("unchecked") - public Object execute(Object[] args, Class[] argTypes) { + public Object execute(Object[] args, Class[] argTypes) { Connection conn = getConnection(); try { return execute(conn, args, argTypes); @@ -55,8 +54,7 @@ } } - @SuppressWarnings("unchecked") - public Object execute(Connection conn, Object[] args, Class[] argTypes) { + public Object execute(Connection conn, Object[] args, Class[] argTypes) { logSql(args, argTypes); PreparedStatement ps = null; try { Modified: 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 2008-12-27 22:14:41 UTC (rev 1629) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/s2dao/internal/sqlhandler/InternalBasicUpdateHandler.java 2008-12-27 22:18:30 UTC (rev 1630) @@ -29,8 +29,7 @@ return execute(args, getArgTypes(args)); } - @SuppressWarnings("unchecked") - public int execute(Object[] args, Class[] argTypes) { + public int execute(Object[] args, Class[] argTypes) { Connection connection = getConnection(); try { return execute(connection, args, argTypes); @@ -39,8 +38,7 @@ } } - @SuppressWarnings("unchecked") - public int execute(Connection connection, Object[] args, Class[] argTypes) { + public int execute(Connection connection, Object[] args, Class[] argTypes) { logSql(args, argTypes); PreparedStatement ps = prepareStatement(connection); try { Modified: 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 2008-12-27 22:14:41 UTC (rev 1629) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/s2dao/internal/sqlhandler/InternalInsertAutoHandler.java 2008-12-27 22:18:30 UTC (rev 1630) @@ -20,6 +20,7 @@ StatementFactory statementFactory, BeanMetaData beanMetaData, PropertyType[] propertyTypes) { super(dataSource, statementFactory, beanMetaData, propertyTypes); + setOptimisticLockHandling(false); } //========================================================================== Modified: 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 2008-12-27 22:14:41 UTC (rev 1629) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/s2dao/internal/sqlhandler/InternalInsertBatchAutoHandler.java 2008-12-27 22:18:30 UTC (rev 1630) @@ -19,8 +19,8 @@ public InternalInsertBatchAutoHandler(DataSource dataSource, StatementFactory statementFactory, BeanMetaData beanMetaData, PropertyType[] propertyTypes) { - super(dataSource, statementFactory, beanMetaData, propertyTypes); + setOptimisticLockHandling(false); } //========================================================================== Modified: 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 2008-12-27 22:14:41 UTC (rev 1629) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/s2dao/internal/sqlhandler/InternalProcedureHandler.java 2008-12-27 22:18:30 UTC (rev 1630) @@ -12,6 +12,7 @@ import javax.sql.DataSource; +import jp.sf.pal.scheduler.db.allcommon.helper.StringKeyMap; import jp.sf.pal.scheduler.db.allcommon.s2dao.internal.various.InternalProcedureMetaData; import jp.sf.pal.scheduler.db.allcommon.s2dao.internal.various.InternalProcedureParameterType; @@ -21,7 +22,6 @@ import org.seasar.extension.jdbc.ValueType; import org.seasar.extension.jdbc.impl.PropertyTypeImpl; import org.seasar.extension.jdbc.types.ValueTypes; -import org.seasar.framework.util.CaseInsensitiveMap; /** * @author DBFlute(AutoGenerator) @@ -220,10 +220,9 @@ protected static abstract class InternalAbstractMapResultSetHandler implements ResultSetHandler { - @SuppressWarnings("unchecked") protected Map createRow(ResultSet rs, PropertyType[] propertyTypes) throws SQLException { - Map row = new CaseInsensitiveMap(); + Map row = StringKeyMap.createAsFlexible(); for (int i = 0; i < propertyTypes.length; ++i) { Object value = propertyTypes[i].getValueType().getValue(rs, i + 1); Modified: 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 2008-12-27 22:14:41 UTC (rev 1629) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/s2dao/internal/sqlhandler/InternalUpdateAutoHandler.java 2008-12-27 22:18:30 UTC (rev 1630) @@ -2,8 +2,6 @@ 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; @@ -17,12 +15,6 @@ // ========= // Constructor // =========== - private boolean checkSingleRowUpdate = true; - - //========================================================================== - // ========= - // Constructor - // =========== public InternalUpdateAutoHandler(DataSource dataSource, StatementFactory statementFactory, BeanMetaData beanMetaData, PropertyType[] propertyTypes) { @@ -41,27 +33,7 @@ @Override protected void postUpdateBean(Object bean, int ret) { - if (isCheckSingleRowUpdate() && ret < 1) { - throw createEntityAlreadyUpdatedException(bean, ret); - } updateVersionNoIfNeed(bean); updateTimestampIfNeed(bean); } - - protected EntityAlreadyUpdatedException createEntityAlreadyUpdatedException( - Object bean, int rows) { - return new EntityAlreadyUpdatedException(bean, rows); - } - - //========================================================================== - // ========= - // Accessor - // ======== - public boolean isCheckSingleRowUpdate() { - return checkSingleRowUpdate; - } - - public void setCheckSingleRowUpdate(boolean resultCheck) { - this.checkSingleRowUpdate = resultCheck; - } } Modified: 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 2008-12-27 22:14:41 UTC (rev 1629) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/s2dao/internal/sqlparser/InternalSqlParser.java 2008-12-27 22:18:30 UTC (rev 1630) @@ -45,22 +45,25 @@ // ========= // Attribute // ========= + protected String specifiedSql; + + protected boolean blockNullParameter; + protected InternalSqlTokenizer tokenizer; protected Stack nodeStack = new Stack(); - protected String specifiedSql;// Extension! - //========================================================================== // ========= // Constructor // =========== - public InternalSqlParser(String sql) { + public InternalSqlParser(String sql, boolean blockNullParameter) { sql = sql.trim(); if (sql.endsWith(";")) { sql = sql.substring(0, sql.length() - 1); } - specifiedSql = sql;// Extension! + specifiedSql = sql; + this.blockNullParameter = blockNullParameter; tokenizer = new InternalSqlTokenizer(sql); } @@ -303,12 +306,14 @@ protected AbstractNode createBindVariableNode(String expr, String testValue) {// Extension // ! - return new InternalBindVariableNode(expr, testValue, specifiedSql); + return new InternalBindVariableNode(expr, testValue, specifiedSql, + blockNullParameter); } protected AbstractNode createEmbeddedValueNode(String expr, String testValue) {// Extension // ! - return new InternalEmbeddedValueNode(expr, testValue, specifiedSql); + return new InternalEmbeddedValueNode(expr, testValue, specifiedSql, + blockNullParameter); } protected ContainerNode createIfNode(String expr) {// Extension! @@ -344,12 +349,15 @@ protected String _specifiedSql; + protected boolean _blockNullParameter; + public InternalBindVariableNode(String expression, String testValue, - String specifiedSql) { + String specifiedSql, boolean blockNullParameter) { this._expression = expression; this._testValue = testValue; this._names = InternalStringUtil.split(expression, "."); this._specifiedSql = specifiedSql; + this._blockNullParameter = blockNullParameter; } public void accept(CommandContext ctx) { @@ -360,7 +368,7 @@ valueAndType.setTargetType(clazz); setupValueAndType(valueAndType); - if (valueAndType.getTargetValue() == null) { + if (_blockNullParameter && valueAndType.getTargetValue() == null) { throwBindOrEmbeddedParameterNullValueException(valueAndType); } if (!isInScope()) { @@ -462,12 +470,15 @@ protected String _specifiedSql; + protected boolean _blockNullParameter; + public InternalEmbeddedValueNode(String expression, String testValue, - String specifiedSql) { + String specifiedSql, boolean blockNullParameter) { this._expression = expression; this._testValue = testValue; this._names = InternalStringUtil.split(expression, "."); this._specifiedSql = specifiedSql; + this._blockNullParameter = blockNullParameter; } public void accept(CommandContext ctx) { @@ -478,7 +489,7 @@ valueAndType.setTargetType(clazz); setupValueAndType(valueAndType); - if (valueAndType.getTargetValue() == null) { + if (_blockNullParameter && valueAndType.getTargetValue() == null) { throwBindOrEmbeddedParameterNullValueException(valueAndType); } if (!isInScope()) { @@ -1276,7 +1287,8 @@ String[] argNames, Class[] argTypes, Object[] args) { final CommandContext context; { - final InternalSqlParser parser = new InternalSqlParser(twoWaySql); + final InternalSqlParser parser = new InternalSqlParser(twoWaySql, + false); final Node node = parser.parse(); final InternalCommandContextCreator creator = new InternalCommandContextCreator( argNames, argTypes); Added: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/s2dao/internal/various/InternalIdentifierAbstractGenerator.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/s2dao/internal/various/InternalIdentifierAbstractGenerator.java (rev 0) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/s2dao/internal/various/InternalIdentifierAbstractGenerator.java 2008-12-27 22:18:30 UTC (rev 1630) @@ -0,0 +1,146 @@ +package jp.sf.pal.scheduler.db.allcommon.s2dao.internal.various; + +import java.sql.CallableStatement; +import java.sql.Connection; +import java.sql.PreparedStatement; +import java.sql.ResultSet; +import java.sql.SQLException; +import java.sql.Statement; + +import javax.sql.DataSource; + +import jp.sf.pal.scheduler.db.allcommon.s2dao.internal.sqlhandler.InternalBasicSelectHandler; +import jp.sf.pal.scheduler.db.allcommon.s2dao.internal.sqlhandler.InternalBasicHandler.SQLExceptionHandler; + +import org.seasar.dao.Dbms; +import org.seasar.dao.IdentifierGenerator; +import org.seasar.extension.jdbc.PropertyType; +import org.seasar.extension.jdbc.ResultSetHandler; +import org.seasar.extension.jdbc.StatementFactory; +import org.seasar.extension.jdbc.ValueType; +import org.seasar.framework.beans.PropertyDesc; + +/** + * @author DBFlute(AutoGenerator) + */ +public abstract class InternalIdentifierAbstractGenerator implements + IdentifierGenerator { + + //========================================================================== + // ========= + // Attribute + // ========= + protected PropertyType propertyType; + + protected Dbms dbms; + + protected ResultSetHandler resultSetHandler; + + //========================================================================== + // ========= + // Constructor + // =========== + public InternalIdentifierAbstractGenerator(PropertyType propertyType, + Dbms dbms) { + this.propertyType = propertyType; + this.dbms = dbms; + resultSetHandler = new InternalIdentifierResultSetHandler(propertyType + .getValueType()); + } + + //========================================================================== + // ========= + // Assist Helper + // ============= + protected Object executeSql(DataSource ds, String sql, Object[] args) { + InternalBasicSelectHandler selectHandler = createSelectHandler(ds, sql); + if (args != null) { + selectHandler.setLoggingMessageSqlArgs(args); + } + return selectHandler.execute(args); + } + + protected InternalBasicSelectHandler createSelectHandler(DataSource ds, + String sql) { + // Use original statement factory for identifier generator. + return new InternalBasicSelectHandler(ds, sql, resultSetHandler, + createStatementFactory(ds, sql)); + } + + protected StatementFactory createStatementFactory(DataSource ds, String sql) { + return new InternalIdentifierGeneratorStatementFactory(); + } + + protected void reflectIdentifier(Object bean, Object value) { + if (propertyType == null) { + String msg = "The arguement[propertyType] should not be null: value=" + + value; + throw new IllegalArgumentException(msg); + } + PropertyDesc pd = propertyType.getPropertyDesc(); + pd.setValue(bean, value); + } + + //========================================================================== + // ========= + // Result Set Handler + // ================== + protected static class InternalIdentifierResultSetHandler implements + ResultSetHandler { + private ValueType valueType; + + public InternalIdentifierResultSetHandler(ValueType valueType) { + this.valueType = valueType; + } + + public Object handle(ResultSet rs) throws SQLException { + if (rs.next()) { + return valueType.getValue(rs, 1); + } + return null; + } + } + + //========================================================================== + // ========= + // Statement Factory + // ================= + protected static class InternalIdentifierGeneratorStatementFactory + implements StatementFactory { + public PreparedStatement createPreparedStatement(Connection conn, + String sql) { + try { + return conn.prepareStatement(sql); + } catch (SQLException e) { + handleSQLException(e, null); + return null; // Unreachable! + } + } + + public CallableStatement createCallableStatement(Connection conn, + String sql) { + try { + return conn.prepareCall(sql); + } catch (SQLException e) { + handleSQLException(e, null); + return null; // Unreachable! + } + } + + protected void handleSQLException(SQLException e, Statement statement) { + new SQLExceptionHandler().handleSQLException(e, statement); + } + } + + //========================================================================== + // ========= + // Accessor + // ======== + public String getPropertyName() { + return propertyType.getPropertyName(); + } + + public Dbms getDbms() { + return dbms; + } +} Property changes on: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/s2dao/internal/various/InternalIdentifierAbstractGenerator.java ___________________________________________________________________ Name: svn:eol-style + native Added: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/s2dao/internal/various/InternalIdentifierAssignedGenerator.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/s2dao/internal/various/InternalIdentifierAssignedGenerator.java (rev 0) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/s2dao/internal/various/InternalIdentifierAssignedGenerator.java 2008-12-27 22:18:30 UTC (rev 1630) @@ -0,0 +1,33 @@ +package jp.sf.pal.scheduler.db.allcommon.s2dao.internal.various; + +import javax.sql.DataSource; + +import org.seasar.dao.Dbms; +import org.seasar.extension.jdbc.PropertyType; + +/** + * @author DBFlute(AutoGenerator) + */ +public class InternalIdentifierAssignedGenerator extends + InternalIdentifierAbstractGenerator { + + //========================================================================== + // ========= + // Constructor + // =========== + public InternalIdentifierAssignedGenerator(PropertyType propertyType, + Dbms dbms) { + super(propertyType, dbms); + } + + //========================================================================== + // ========= + // Implementation + // ============== + public void setIdentifier(Object bean, DataSource ds) { + } + + public boolean isSelfGenerate() { + return true; + } +} Property changes on: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/s2dao/internal/various/InternalIdentifierAssignedGenerator.java ___________________________________________________________________ Name: svn:eol-style + native Added: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/s2dao/internal/various/InternalIdentifierGeneratorFactory.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/s2dao/internal/various/InternalIdentifierGeneratorFactory.java (rev 0) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/s2dao/internal/various/InternalIdentifierGeneratorFactory.java 2008-12-27 22:18:30 UTC (rev 1630) @@ -0,0 +1,105 @@ +package jp.sf.pal.scheduler.db.allcommon.s2dao.internal.various; + +import java.lang.reflect.Constructor; +import java.util.HashMap; +import java.util.Map; + +import jp.sf.pal.scheduler.db.allcommon.util.SimpleStringUtil; + +import org.seasar.dao.Dbms; +import org.seasar.dao.IdentifierGenerator; +import org.seasar.extension.jdbc.PropertyType; +import org.seasar.framework.beans.BeanDesc; +import org.seasar.framework.beans.PropertyDesc; +import org.seasar.framework.beans.factory.BeanDescFactory; +import org.seasar.framework.util.ClassUtil; +import org.seasar.framework.util.ConstructorUtil; + +/** + * @author DBFlute(AutoGenerator) + */ +public class InternalIdentifierGeneratorFactory { + + //========================================================================== + // ========= + // Attribute + // ========= + private static Map> generatorClasses = new HashMap>(); + + static { + addIdentifierGeneratorClass("assigned", + InternalIdentifierAssignedGenerator.class); + addIdentifierGeneratorClass("identity", + InternalIdentifierIdentityGenerator.class); + addIdentifierGeneratorClass("sequence", + InternalIdentifierSequenceGenerator.class); + } + + //========================================================================== + // ========= + // Constructor + // =========== + private InternalIdentifierGeneratorFactory() { + } + + //========================================================================== + // ========= + // Identifier Generator + // ==================== + public static void addIdentifierGeneratorClass(String name, Class clazz) { + generatorClasses.put(name, clazz); + } + + public static IdentifierGenerator createIdentifierGenerator( + PropertyType propertyType, Dbms dbms) { + return createIdentifierGenerator(propertyType, dbms, null); + } + + public static IdentifierGenerator createIdentifierGenerator( + PropertyType propertyType, Dbms dbms, String annotation) { + if (propertyType == null) { + String msg = "The argument[propertyType] should not be null: dbms=" + + dbms + " annotation=" + annotation; + throw new IllegalArgumentException(msg); + } + if (dbms == null) { + String msg = "The argument[dbms] should not be null: propertyType=" + + propertyType + " annotation=" + annotation; + throw new IllegalArgumentException(msg); + } + if (annotation == null) { + return new InternalIdentifierAssignedGenerator(propertyType, dbms); + } + String[] array = SimpleStringUtil.split(annotation, "=, "); + Class clazz = getGeneratorClass(array[0]); + IdentifierGenerator generator = createIdentifierGenerator(clazz, + propertyType, dbms); + for (int i = 1; i < array.length; i += 2) { + setProperty(generator, array[i].trim(), array[i + 1].trim()); + } + return generator; + } + + protected static Class getGeneratorClass(String name) { + Class clazz = generatorClasses.get(name); + if (clazz != null) { + return clazz; + } + return ClassUtil.forName(name); + } + + protected static IdentifierGenerator createIdentifierGenerator( + Class clazz, PropertyType propertyType, Dbms dbms) { + Constructor constructor = ClassUtil.getConstructor(clazz, + new Class[] { PropertyType.class, Dbms.class }); + return (IdentifierGenerator) ConstructorUtil.newInstance(constructor, + new Object[] { propertyType, dbms }); + } + + protected static void setProperty(IdentifierGenerator generator, + String propertyName, String value) { + BeanDesc beanDesc = BeanDescFactory.getBeanDesc(generator.getClass()); + PropertyDesc pd = beanDesc.getPropertyDesc(propertyName); + pd.setValue(generator, value); + } +} Property changes on: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/s2dao/internal/various/InternalIdentifierGeneratorFactory.java ___________________________________________________________________ Name: svn:eol-style + native Added: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/s2dao/internal/various/InternalIdentifierIdentityGenerator.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/s2dao/internal/various/InternalIdentifierIdentityGenerator.java (rev 0) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/s2dao/internal/various/InternalIdentifierIdentityGenerator.java 2008-12-27 22:18:30 UTC (rev 1630) @@ -0,0 +1,35 @@ +package jp.sf.pal.scheduler.db.allcommon.s2dao.internal.various; + +import javax.sql.DataSource; + +import org.seasar.dao.Dbms; +import org.seasar.extension.jdbc.PropertyType; + +/** + * @author DBFlute(AutoGenerator) + */ +public class InternalIdentifierIdentityGenerator extends + InternalIdentifierAbstractGenerator { + + //========================================================================== + // ========= + // Constructor + // =========== + public InternalIdentifierIdentityGenerator(PropertyType propertyType, + Dbms dbms) { + super(propertyType, dbms); + } + + //========================================================================== + // ========= + // Implementation + // ============== + public void setIdentifier(Object bean, DataSource ds) { + Object value = executeSql(ds, getDbms().getIdentitySelectString(), null); + reflectIdentifier(bean, value); + } + + public boolean isSelfGenerate() { + return false; + } +} Property changes on: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/s2dao/internal/various/InternalIdentifierIdentityGenerator.java ___________________________________________________________________ Name: svn:eol-style + native Added: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/s2dao/internal/various/InternalIdentifierSequenceGenerator.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/s2dao/internal/various/InternalIdentifierSequenceGenerator.java (rev 0) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/s2dao/internal/various/InternalIdentifierSequenceGenerator.java 2008-12-27 22:18:30 UTC (rev 1630) @@ -0,0 +1,116 @@ +package jp.sf.pal.scheduler.db.allcommon.s2dao.internal.various; + +import java.util.HashMap; + +import javax.sql.DataSource; + +import jp.sf.pal.scheduler.db.allcommon.util.SimpleTypeUtil; + +import org.seasar.dao.Dbms; +import org.seasar.extension.jdbc.PropertyType; + +/** + * @author DBFlute(AutoGenerator) + */ +public class InternalIdentifierSequenceGenerator extends + InternalIdentifierAbstractGenerator { + + // - - - - - - - - - - + // [Unused on DBFlute] + // - - - - - - - - - - + + //========================================================================== + // ========= + // Attribute + // ========= + private String sequenceName; + + private long allocationSize = 0; + + private HashMap idContextMap = new HashMap(); + + //========================================================================== + // ========= + // Constructor + // =========== + public InternalIdentifierSequenceGenerator(PropertyType propertyType, + Dbms dbms) { + super(propertyType, dbms); + } + + //========================================================================== + // ========= + // Implementation + // ============== + public void setIdentifier(Object bean, DataSource ds) { + reflectIdentifier(bean, getNextValue(ds)); + } + + public boolean isSelfGenerate() { + return getDbms().isSelfGenerate(); + } + + //========================================================================== + // ========= + // Next Value + // ========== + protected Object getNextValue(DataSource ds) { + if (allocationSize > 0) { + long value = getIdContext(ds).getNextValue(ds); + return new Long(value); + } + return getNewInitialValue(ds); + } + + protected Object getNewInitialValue(DataSource ds) { + return executeSql(ds, getDbms().getSequenceNextValString(sequenceName), + null); + } + + protected IdContext getIdContext(DataSource ds) { + synchronized (idContextMap) { + IdContext context = idContextMap.get(ds); + if (context == null) { + context = new IdContext(); + idContextMap.put(ds, context); + } + return context; + } + } + + public class IdContext { + protected long initialValue; + + protected long allocated = Long.MAX_VALUE; + + public synchronized long getNextValue(DataSource ds) { + if (allocated < allocationSize) { + return initialValue + allocated++; + } + initialValue = SimpleTypeUtil + .toPrimitiveLong(getNewInitialValue(ds)); + allocated = 1; + return initialValue; + } + } + + //========================================================================== + // ========= + // Accessor + // ======== + public String getSequenceName() { + return sequenceName; + } + + public void setSequenceName(String sequenceName) { + this.sequenceName = sequenceName; + } + + public long getAllocationSize() { + return allocationSize; + } + + public void setAllocationSize(long allocationSize) { + this.allocationSize = allocationSize; + } +} Property changes on: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/s2dao/internal/various/InternalIdentifierSequenceGenerator.java ___________________________________________________________________ Name: svn:eol-style + native Modified: 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 2008-12-27 22:14:41 UTC (rev 1629) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/s2dao/internal/various/InternalProcedureMetaDataFactory.java 2008-12-27 22:18:30 UTC (rev 1630) @@ -7,7 +7,7 @@ import java.util.Map; import java.util.Stack; -import jp.sf.pal.scheduler.db.allcommon.cbean.ConditionBeanContext; +import jp.sf.pal.scheduler.db.allcommon.DBDef; import org.seasar.dao.ValueTypeFactory; import org.seasar.dao.util.TypeUtil; @@ -146,9 +146,9 @@ } final Class type = field.getType(); if (List.class.isAssignableFrom(type)) {// is for out parameter cursor. - if (ConditionBeanContext.isOracle()) { + if (DBDef.isCurrentDef(DBDef.Oracle)) { return ValueTypes.ORACLE_RESULT_SET; - } else if (ConditionBeanContext.isPostgreSql()) { + } else if (DBDef.isCurrentDef(DBDef.PostgreSQL)) { return ValueTypes.POSTGRE_RESULT_SET; } else { return ValueTypes.SERIALIZABLE_BYTE_ARRAY; Added: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/s2dao/internal/various/InternalStatementFactory.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/s2dao/internal/various/InternalStatementFactory.java (rev 0) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/s2dao/internal/various/InternalStatementFactory.java 2008-12-27 22:18:30 UTC (rev 1630) @@ -0,0 +1,158 @@ +package jp.sf.pal.scheduler.db.allcommon.s2dao.internal.various; + +import java.sql.CallableStatement; +import java.sql.Connection; +import java.sql.PreparedStatement; +import java.sql.SQLException; +import java.sql.Statement; + +import jp.sf.pal.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 org.seasar.extension.jdbc.StatementFactory; + +/** + * @author DBFlute(AutoGenerator) + */ +public class InternalStatementFactory implements StatementFactory { + + //========================================================================== + // ========= + // Definition + // ========== + /** Log-instance. */ + private static final org.apache.commons.logging.Log _log = org.apache.commons.logging.LogFactory + .getLog(InternalStatementFactory.class); + + //========================================================================== + // ========= + // Attribute + // ========= + protected StatementConfig defaultStatementConfig; + + protected boolean internalDebug; + + //========================================================================== + // ========= + // Constructor + // =========== + public InternalStatementFactory() { + } + + //========================================================================== + // ========= + // Implementation + // ============== + public PreparedStatement createPreparedStatement(Connection conn, String sql) { + try { + final StatementConfig config = findStatementConfigOnThread(); + ; + final int resultSetType; + if (config != null && config.hasResultSetType()) { + resultSetType = config.getResultSetType(); + } else if (defaultStatementConfig != null + && defaultStatementConfig.hasResultSetType()) { + resultSetType = defaultStatementConfig.getResultSetType(); + } else { + resultSetType = java.sql.ResultSet.TYPE_FORWARD_ONLY; + } + final int resultSetConcurrency = java.sql.ResultSet.CONCUR_READ_ONLY; + if (internalDebug) { + _log.debug("...Creating prepareStatement(sql, " + resultSetType + + ", " + resultSetConcurrency + ")"); + } + final PreparedStatement ps = conn.prepareStatement(sql, + resultSetType, resultSetConcurrency); + if (config != null && config.hasStatementOptions()) { + if (internalDebug) { + _log.debug("...Setting statement config as request: " + + config); + } + reflectStatementOptions(config, ps); + } else { + reflectDefaultOptionsToStatementIfNeeds(ps); + } + return ps; + } catch (SQLException e) { + handleSQLException(e, null); + return null;// Unreachable! + } + } + + public CallableStatement createCallableStatement(Connection conn, String sql) { + return prepareCall(conn, sql); + } + + protected StatementConfig findStatementConfigOnThread() { + final StatementConfig config; + if (ConditionBeanContext.isExistConditionBeanOnThread()) { + final ConditionBean cb = ConditionBeanContext + .getConditionBeanOnThread(); + config = cb.getStatementConfig(); + } else if (OutsideSqlContext.isExistOutsideSqlContextOnThread()) { + final OutsideSqlContext context = OutsideSqlContext + .getOutsideSqlContextOnThread(); + config = context.getStatementConfig(); + } else { + config = null; + } + return config; + } + + protected void reflectDefaultOptionsToStatementIfNeeds(PreparedStatement ps) { + if (defaultStatementConfig != null + && defaultStatementConfig.hasStatementOptions()) { + if (internalDebug) { + _log.debug("...Setting statement config as default: " + + defaultStatementConfig); + } + reflectStatementOptions(defaultStatementConfig, ps); + return; + } + } + + protected void reflectStatementOptions(StatementConfig config, + PreparedStatement ps) { + try { + if (config.hasQueryTimeout()) { + ps.setQueryTimeout(config.getQueryTimeout()); + } + if (config.hasFetchSize()) { + ps.setFetchSize(config.getFetchSize()); + } + if (config.hasMaxRows()) { + ps.setMaxRows(config.getMaxRows()); + } + } catch (SQLException e) { + handleSQLException(e, ps); + } + } + + protected CallableStatement prepareCall(Connection conn, String sql) { + try { + return conn.prepareCall(sql); + } catch (SQLException e) { + handleSQLException(e, null); + return null;// Unreachable! + } + } + + protected void handleSQLException(SQLException e, Statement statement) { + new SQLExceptionHandler().handleSQLException(e, statement); + } + + //========================================================================== + // ========= + // Accessor + // ======== + public void setDefaultStatementConfig(StatementConfig defaultStatementConfig) { + this.defaultStatementConfig = defaultStatementConfig; + } + + public void setInternalDebug(boolean internalDebug) { + this.internalDebug = internalDebug; + } +} Property changes on: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/s2dao/internal/various/InternalStatementFactory.java ___________________________________________________________________ Name: svn:eol-style + native Modified: 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 2008-12-27 22:14:41 UTC (rev 1629) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/util/SimpleAssertUtil.java 2008-12-27 22:18:30 UTC (rev 1630) @@ -7,11 +7,8 @@ //========================================================================== // ========= - // Assert + // Object // ====== - // ----------------------------------------------------- - // Assert Object - // ------------- /** * Assert that the object is not null. * @@ -32,9 +29,10 @@ } } - // ----------------------------------------------------- - // Assert String - // ------------- + //========================================================================== + // ========= + // String + // ====== /** * Assert that the entity is not null and not trimmed empty. * Added: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/util/SimpleResourceUtil.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/util/SimpleResourceUtil.java (rev 0) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/util/SimpleResourceUtil.java 2008-12-27 22:18:30 UTC (rev 1630) @@ -0,0 +1,117 @@ +package jp.sf.pal.scheduler.db.allcommon.util; + +import java.io.IOException; +import java.io.InputStream; +import java.net.URL; +import java.net.URLConnection; + +/** + * @author DBFlute(AutoGenerator) + */ +public class SimpleResourceUtil { + + //========================================================================== + // ========= + // Resource Path + // ============= + public static String getResourcePath(String path, String extension) { + if (extension == null) { + return path; + } + extension = "." + extension; + if (path.endsWith(extension)) { + return path; + } + return path.replace('.', '/') + extension; + } + + public static String getResourcePath(Class clazz) { + return clazz.getName().replace('.', '/') + ".class"; + } + + //========================================================================== + // ========= + // Resource URL + // ============ + public static URL getResourceUrl(String path) { + return getResourceUrl(path, null); + } + + public static URL getResourceUrl(String path, String extension) { + return getResourceUrl(path, extension, Thread.currentThread() + .getContextClassLoader()); + } + + public static URL getResourceUrl(String path, String extension, + ClassLoader loader) { + if (path == null || loader == null) { + return null; + } + path = getResourcePath(path, extension); + return loader.getResource(path); + } + + //========================================================================== + // ========= + // Resource Stream + // =============== + public static InputStream getResourceStream(String path) { + return getResourceStream(path, null); + } + + public static InputStream getResourceStream(String path, String extension) { + final URL url = getResourceUrl(path, extension); + return url != null ? openStream(url) : null; + } + + //========================================================================== + // ========= + // Resource Existence + // ================== + public static boolean isExist(String path) { + return getResourceUrl(path) != null; + } + + //========================================================================== + // ========= + // Assist Helper + // ============= + protected static ClassLoader getClassLoader() { + return Thread.currentThread().getContextClassLoader(); + } + + protected static InputStream openStream(URL url) { + try { + URLConnection connection = url.openConnection(); + connection.setUseCaches(false); + return connection.getInputStream(); + } catch (IOException e) { + String msg = "Failed to open the stream: url=" + url; + throw new IllegalStateException(msg, e); + } + } + + //========================================================================== + // ========= + // Assert Helper + // ============= + /** + * Assert that the object is not null. + * + * @param variableName Variable name. (NotNull) + * @param value Value. (NotNull) + * @exception IllegalArgumentException + */ + protected static void assertObjectNotNull(String variableName, Object value) { + if (variableName == null) { + String msg = "The value should not be null: variableName=" + + variableName + " value=" + value; + throw new IllegalArgumentException(msg); + } + if (value == null) { + String msg = "The value should not be null: variableName=" + + variableName; + throw new IllegalArgumentException(msg); + } + } +} Property changes on: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/util/SimpleResourceUtil.java ___________________________________________________________________ Name: svn:eol-style + native Modified: 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 2008-12-27 22:14:41 UTC (rev 1629) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/util/SimpleStringUtil.java 2008-12-27 22:18:30 UTC (rev 1630) @@ -1,14 +1,20 @@ package jp.sf.pal.scheduler.db.allcommon.util; +import java.util.ArrayList; +import java.util.List; +import java.util.StringTokenizer; + /** * @author DBFlute(AutoGenerator) */ public class SimpleStringUtil { + protected static final String[] EMPTY_STRINGS = new String[0]; + //========================================================================== // ========= - // String - // ====== + // Replace + // ======= public static String replace(String text, String fromText, String toText) { if (text == null || fromText == null || toText == null) { return null; @@ -32,6 +38,26 @@ } while (true); } + //========================================================================== + // ========= + // Split + // ===== + public static String[] split(final String str, final String delimiter) { + if (str == null || str.trim().length() == 0) { + return EMPTY_STRINGS; + } + final List list = new ArrayList(); + final StringTokenizer st = new StringTokenizer(str, delimiter); + while (st.hasMoreElements()) { + list.add(st.nextToken()); + } + return (String[]) list.toArray(new String[list.size()]); + } + + //========================================================================== + // ========= + // Initial Convert + // =============== public static String initCap(String str) { assertObjectNotNull("str", str); return str.substring(0, 1).toUpperCase() + str.substring(1); @@ -42,9 +68,10 @@ return str.substring(0, 1).toLowerCase() + str.substring(1); } - // ----------------------------------------------------- - // Assert Object - // ------------- + //========================================================================== + // ========= + // Assert Helper + // ============= /** * Assert that the object is not null. * Modified: 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 2008-12-27 22:14:41 UTC (rev 1629) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/util/SimpleSystemUtil.java 2008-12-27 22:18:30 UTC (rev 1630) @@ -7,8 +7,8 @@ //========================================================================== // ========= - // System - // ====== + // Line Separator + // ============== public static String getLineSeparator() { // /- - - - - - - - - - - - - - - - - - - - - - // Because 'CR + LF' caused many trouble! Added: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/util/SimpleTypeUtil.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/util/SimpleTypeUtil.java (rev 0) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/util/SimpleTypeUtil.java 2008-12-27 22:18:30 UTC (rev 1630) @@ -0,0 +1,692 @@ +package jp.sf.pal.scheduler.db.allcommon.util; + +import java.math.BigDecimal; +import java.math.BigInteger; +import java.text.DateFormat; +import java.text.DecimalFormatSymbols; +import java.text.ParseException; +import java.text.SimpleDateFormat; +import java.util.ArrayList; +import java.util.Calendar; +import java.util.Date; +import java.util.List; +import java.util.Locale; +import java.util.Map; +import java.util.StringTokenizer; +import java.util.concurrent.ConcurrentHashMap; + +/** + * {Refers to S2Container's utility and Extends it} + * + * @author DBFlute(AutoGenerator) + */ +public class SimpleTypeUtil { + + //========================================================================== + // ========= + // Convert To + // ========== + // ----------------------------------------------------- + // Boolean + // ------- + public static Boolean toBoolean(Object o) { + if (o == null) { + return null; + } else if (o instanceof Boolean) { + return (Boolean) o; + } else if (o instanceof Number) { + int num = ((Number) o).intValue(); + return Boolean.valueOf(num != 0); + } else if (o instanceof String) { + String s = (String) o; + if ("true".equalsIgnoreCase(s)) { + return Boolean.TRUE; + } else if ("false".equalsIgnoreCase(s)) { + return Boolean.FALSE; + } else if (s.equals("0")) { + return Boolean.FALSE; + } else { + return Boolean.TRUE; + } + } else { + return Boolean.TRUE; + } + } + + // ----------------------------------------------------- + // Integer + // ------- + public static Integer toInteger(Object o) { + return toInteger(o, null); + } + + public static Integer toInteger(Object o, String pattern) { + if (o == null) { + return null; + } else if (o instanceof Integer) { + return (Integer) o; + } else if (o instanceof Number) { + return new Integer(((Number) o).intValue()); + } else if (o instanceof String) { + return toInteger((String) o); + } else if (o instanceof java.util.Date) { + if (pattern != null) { + return new Integer(new SimpleDateFormat(pattern).format(o)); + } + return new Integer((int) ((java.util.Date) o).getTime()); + } else if (o instanceof Boolean) { + return ((Boolean) o).booleanValue() ? new Integer(1) : new Integer( + 0); + } else { + return toInteger(o.toString()); + } + } + + protected static Integer toInteger(String s) { + if (s == null || s.trim().length() == 0) { + return null; + } + return new Integer(normalize(s)); + } + + public static int toPrimitiveInt(Object o) { + return toPrimitiveInt(o, null); + } + + public static int toPrimitiveInt(Object o, String pattern) { + if (o == null) { + return 0; + } else if (o instanceof Number) { + return ((Number) o).intValue(); + } else if (o instanceof String) { + return toPrimitiveInt((String) o); + } else if (o instanceof java.util.Date) { + if (pattern != null) { + return Integer + .parseInt(new SimpleDateFormat(pattern).format(o)); + } + return (int) ((java.util.Date) o).getTime(); + } else if (o instanceof Boolean) { + return ((Boolean) o).booleanValue() ? 1 : 0; + } else { + return toPrimitiveInt(o.toString()); + } + } + + protected static int toPrimitiveInt(String s) { + if (s == null || s.trim().length() == 0) { + return 0; + } + return Integer.parseInt(normalize(s)); + } + + // ----------------------------------------------------- + // BigDecimal + // ---------- + public static BigDecimal toBigDecimal(Object o) { + return toBigDecimal(o, null); + } + + public static BigDecimal toBigDecimal(Object o, String pattern) { + if (o == null) { + return null; + } else if (o instanceof BigDecimal) { + return (BigDecimal) o; + } else if (o instanceof java.util.Date) { + if (pattern != null) { + return new BigDecimal(new SimpleDateFormat(pattern).format(o)); + } + return new BigDecimal(Long.toString(((java.util.Date) o).getTime())); + } else if (o instanceof String) { + String s = (String) o; + if (s == null || s.trim().length() == 0) { + return null; + } + return new BigDecimal(new BigDecimal(s).toPlainString()); + } else { + return new BigDecimal(new BigDecimal(o.toString()).toPlainString()); + } + } + + // ----------------------------------------------------- + // Double + // ------ + public static Double toDouble(Object o) { + return toDouble(o, null); + } + + public static Double toDouble(Object o, String pattern) { + if (o == null) { + return null; + } else if (o instanceof Double) { + return (Double) o; + } else if (o instanceof Number) { + return new Double(((Number) o).doubleValue()); + } else if (o instanceof String) { + return toDouble((String) o); + } else if (o instanceof java.util.Date) { + if (pattern != null) { + return new Double(new SimpleDateFormat(pattern).format(o)); + } + return new Double(((java.util.Date) o).getTime()); + } else { + return toDouble(o.toString()); + } + } + + protected static Double toDouble(String s) { + if (s == null || s.trim().length() == 0) { + return null; + } + return new Double(normalize(s)); + } + + // ----------------------------------------------------- + // Long + // ---- + public static Long toLong(Object o) { + return toLong(o, null); + } + + public static Long toLong(Object o, String pattern) { + if (o == null) { + return null; + } else if (o instanceof Long) { + return (Long) o; + } else if (o instanceof Number) { + return new Long(((Number) o).longValue()); + } else if (o instanceof String) { + return toLong((String) o); + } else if (o instanceof java.util.Date) { + if (pattern != null) { + return new Long(new SimpleDateFormat(pattern).format(o)); + } + return new Long(((java.util.Date) o).getTime()); + } else if (o instanceof Boolean) { + return ((Boolean) o).booleanValue() ? new Long(1) : new Long(0); + } else { + return toLong(o.toString()); + } + } + + protected static Long toLong(String s) { + if (s == null || s.trim().length() == 0) { + return null; + } + return new Long(normalize(s)); + } + + public static long toPrimitiveLong(Object o) { + return toPrimitiveLong(o, null); + } + + public static long toPrimitiveLong(Object o, String pattern) { + if (o == null) { + return 0; + } else if (o instanceof Number) { + return ((Number) o).longValue(); + } else if (o instanceof String) { + return toPrimitiveLong((String) o); + } else if (o instanceof java.util.Date) { + if (pattern != null) { + return Long.parseLong(new SimpleDateFormat(pattern).format(o)); + } + return ((java.util.Date) o).getTime(); + } else if (o instanceof Boolean) { + return ((Boolean) o).booleanValue() ? 1 : 0; + } else { + return toPrimitiveLong(o.toString()); + } + } + + protected static long toPrimitiveLong(String s) { + if (s == null || s.trim().length() == 0) { + return 0; + } + return Long.parseLong(normalize(s)); + } + + // ----------------------------------------------------- + // Float + // ----- + public static Float toFloat(Object o) { + return toFloat(o, null); + } + + public static Float toFloat(Object o, String pattern) { + if (o == null) { + return null; + } else if (o instanceof Float) { + return (Float) o; + } else if (o instanceof Number) { + return new Float(((Number) o).floatValue()); + } else if (o instanceof String) { + return toFloat((String) o); + } else if (o instanceof java.util.Date) { + if (pattern != null) { + return new Float(new SimpleDateFormat(pattern).format(o)); + } + return new Float(((java.util.Date) o).getTime()); + } else { + return toFloat(o.toString()); + } + } + + protected static Float toFloat(String s) { + if (s == null || s.trim().length() == 0) { + return null; + } + return new Float(normalize(s)); + } + + // ----------------------------------------------------- + // Short + // ----- + public static Short toShort(Object o) { + return toShort(o, null); + } + + public static Short toShort(Object o, String pattern) { + if (o == null) { + return null; + } else if (o instanceof Short) { + return (Short) o; + } else if (o instanceof Number) { + return new Short(((Number) o).shortValue()); + } else if (o instanceof String) { + return toShort((String) o); + } else if (o instanceof java.util.Date) { + if (pattern != null) { + return new Short(new SimpleDateFormat(pattern).format(o)); + } + return new Short((short) ((java.util.Date) o).getTime()); + } else if (o instanceof Boolean) { + return ((Boolean) o).booleanValue() ? new Short((short) 1) + : new Short((short) 0); + } else { + return toShort(o.toString()); + } + } + + protected static Short toShort(String s) { + if (s == null || s.trim().length() == 0) { + return null; + } + return new Short(normalize(s)); + } + + // ----------------------------------------------------- + // BigInteger + // ---------- + public static BigInteger toBigInteger(Object o) { + return toBigInteger(o, null); + } + + public static BigInteger toBigInteger(Object o, String pattern) { + if (o == null) { + return null; + } else if (o instanceof BigInteger) { + return (BigInteger) o; + } else { + Long l = toLong(o, pattern); + if (l == null) { + return null; + } + return BigInteger.valueOf(l.longValue()); + } + } + + // ----------------------------------------------------- + // Byte + // ---- + public static Byte toByte(Object o) { + return toByte(o, null); + } + + public static Byte toByte(Object o, String pattern) { + if (o == null) { + return null; + } else if (o instanceof Byte) { + return (Byte) o; + } else if (o instanceof Number) { + return new Byte(((Number) o).byteValue()); + } else if (o instanceof String) { + return toByte((String) o); + } else if (o instanceof java.util.Date) { + if (pattern != null) { + return new Byte(new SimpleDateFormat(pattern).format(o)); + } + return new Byte((byte) ((java.util.Date) o).getTime()); + } else if (o instanceof Boolean) { + return ((Boolean) o).booleanValue() ? new Byte((byte) 1) + : new Byte((byte) 0); + } else { + return toByte(o.toString()); + } + } + + protected static Byte toByte(String s) { + if (s == null || s.trim().length() == 0) { + return null; + } + return new Byte(normalize(s)); + } + + // ----------------------------------------------------- + // Date + // ---- + public static Date toDate(Object o) { + return toDate(o, null); + } + + public static Date toDate(Object o, String pattern) { + if (o == null) { + return null; + } else if (o instanceof String) { + return toDate((String) o, pattern); + } else if (o instanceof Date) { + return (Date) o; + } else if (o instanceof Calendar) { + return ((Calendar) o).getTime(); + } else { + return toDate(o.toString(), pattern); + } + } + + protected static Date toDate(String s, String pattern) { + return toDate(s, pattern, Locale.getDefault()); + } + + protected static Date toDate(String s, String pattern, Locale locale) { + if (s == null || s.trim().length() == 0) { + return null; + } + SimpleDateFormat sdf = getDateFormat(s, pattern, locale); + try { + return sdf.parse(s); + } catch (ParseException e) { + String msg = "Failed to parse the string to date: "; + msg = msg + " string=" + s + " format=" + sdf + " locale=" + locale; + throw new IllegalStateException(msg, e); + } + } + + public static java.sql.Date toSqlDate(Object o) { + return toSqlDate(o, null); + } + + public static java.sql.Date toSqlDate(Object o, String pattern) { + if (o instanceof java.sql.Date) { + return (java.sql.Date) o; + } + java.util.Date date = toDate(o, pattern); + if (date != null) { + return new java.sql.Date(date.getTime()); + } + return null; + } + + // ----------------------------------------------------- + // Number + // ------ + public static Object toNumber(Class type, Object o) { + if (type == Integer.class) { + return toInteger(o); + } else if (type == BigDecimal.class) { + return toBigDecimal(o); + } else if (type == Double.class) { + return toDouble(o); + } else if (type == Long.class) { + return toLong(o); + } else if (type == Float.class) { + return toFloat(o); + } else if (type == Short.class) { + return toShort(o); + } else if (type == BigInteger.class) { + return toBigInteger(o); + } else if (type == Byte.class) { + return toByte(o); + } + return o; + } + + // ----------------------------------------------------- + // Wrapper + // ------- + public static Object toWrapper(Class type, Object o) { + if (type == int.class) { + Integer i = toInteger(o); + if (i != null) { + return i; + } + return new Integer(0); + } else if (type == double.class) { + Double d = toDouble(o); + if (d != null) { + return d; + } + return new Double(0); + } else if (type == long.class) { + Long l = toLong(o); + if (l != null) { + return l; + } + return new Long(0); + } else if (type == float.class) { + Float f = toFloat(o); + if (f != null) { + return f; + } + return new Float(0); + } else if (type == short.class) { + Short s = toShort(o); + if (s != null) { + return s; + } + return new Short((short) 0); + } else if (type == boolean.class) { + Boolean b = toBoolean(o); + if (b != null) { + return b; + } + return Boolean.FALSE; + } else if (type == byte.class) { + Byte b = toByte(o); + if (b != null) { + return b; + } + return new Byte((byte) 0); + } + return o; + } + + //========================================================================== + // ========= + // Normalize + // ========= + protected static String normalize(String s) { + return normalize(s, Locale.getDefault()); + } + + protected static String normalize(String s, Locale locale) { + if (s == null) { + return null; + } + DecimalFormatSymbols symbols = getDecimalFormatSymbols(locale); + char decimalSep = symbols.getDecimalSeparator(); + char groupingSep = symbols.getGroupingSeparator(); + StringBuilder sb = new StringBuilder(20); + for (int i = 0; i < s.length(); ++i) { + char c = s.charAt(i); + if (c == groupingSep) { + continue; + } else if (c == decimalSep) { + c = '.'; + } + sb.append(c); + } + return sb.toString(); + } + + //========================================================================== + // ========= + // Assist Helper + // ============= + + // ----------------------------------------------------- + // DateFormat + // ---------- + protected static SimpleDateFormat getDateFormat(String s, String pattern, + Locale locale) { + if (pattern != null) { + return new SimpleDateFormat(pattern); + } + return getDateFormat(s, locale); + } + + protected static SimpleDateFormat getDateFormat(String s, Locale locale) { + String pattern = getDateFormatPattern(locale); + String shortPattern = removeDateDelimiter(pattern); + String delimitor = findDateDelimiter(s); + if (delimitor == null) { + if (s.length() == shortPattern.length()) { + return new SimpleDateFormat(shortPattern); + } + if (s.length() == shortPattern.length() + 2) { + return new SimpleDateFormat(replace(shortPattern, "yy", "yyyy")); + } + } else { + String[] array = split(s, delimitor); + for (int i = 0; i < array.length; ++i) { + if (array[i].length() == 4) { + pattern = replace(pattern, "yy", "yyyy"); + break; + } + } + return new SimpleDateFormat(pattern); + } + return new SimpleDateFormat(); + } + + protected static String getDateFormatPattern(Locale locale) { + SimpleDateFormat df = (SimpleDateFormat) DateFormat.getDateInstance( + DateFormat.SHORT, locale); + String pattern = df.toPattern(); + int index = pattern.indexOf(' '); + if (index > 0) { + pattern = pattern.substring(0, index); + } + if (pattern.indexOf("MM") < 0) { + pattern = replace(pattern, "M", "MM"); + } + if (pattern.indexOf("dd") < 0) { + pattern = replace(pattern, "d", "dd"); + } + return pattern; + } + + protected static String removeDateDelimiter(String pattern) { + StringBuilder sb = new StringBuilder(); + for (int i = 0; i < pattern.length(); ++i) { + char c = pattern.charAt(i); + if (c == 'y' || c == 'M' || c == 'd') { + sb.append(c); + } + } + return sb.toString(); + } + + protected static String findDateDelimiter(String value) { + for (int i = 0; i < value.length(); ++i) { + char c = value.charAt(i); + if (Character.isDigit(c)) { + continue; + } + return Character.toString(c); + } + return null; + } + + // ----------------------------------------------------- + // DecimalFormatSymbols + // -------------------- + protected static Map symbolsCache = new ConcurrentHashMap(); + + protected static DecimalFormatSymbols getDecimalFormatSymbols() { + return getDecimalFormatSymbols(Locale.getDefault()); + } + + protected static DecimalFormatSymbols getDecimalFormatSymbols(Locale locale) { + DecimalFormatSymbols symbols = (DecimalFormatSymbols) symbolsCache + .get(locale); + if (symbols == null) { + symbols = new DecimalFormatSymbols(locale); + symbolsCache.put(locale, symbols); + } + return symbols; + } + + // ----------------------------------------------------- + // String + // ------ + protected static String replace(String text, String fromText, String toText) { + if (text == null || fromText == null || toText == null) { + return null; + } + StringBuilder sb = new StringBuilder(); + int pos = 0; + int pos2 = 0; + do { + pos = text.indexOf(fromText, pos2); + if (pos == 0) { + sb.append(toText); + pos2 = fromText.length(); + } else if (pos > 0) { + sb.append(text.substring(pos2, pos)); + sb.append(toText); + pos2 = pos + fromText.length(); + } else { + sb.append(text.substring(pos2)); + return sb.toString(); + } + } while (true); + } + + protected static final String[] EMPTY_STRINGS = new String[0]; + + protected static String[] split(final String str, final String delimiter) { + if (str == null || str.trim().length() == 0) { + return EMPTY_STRINGS; + } + final List list = new ArrayList(); + final StringTokenizer st = new StringTokenizer(str, delimiter); + while (st.hasMoreElements()) { + list.add(st.nextToken()); + } + return (String[]) list.toArray(new String[list.size()]); + } + + //========================================================================== + // ========= + // Assert Helper + // ============= + /** + * Assert that the object is not null. + * + * @param variableName Variable name. (NotNull) + * @param value Value. (NotNull) + * @exception IllegalArgumentException + */ + protected static void assertObjectNotNull(String variableName, Object value) { + if (variableName == null) { + String msg = "The value should not be null: variableName=" + + variableName + " value=" + value; + throw new IllegalArgumentException(msg); + } + if (value == null) { + String msg = "The value should not be null: variableName=" + + variableName; + throw new IllegalArgumentException(msg); + } + } +} Property changes on: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/util/SimpleTypeUtil.java ___________________________________________________________________ Name: svn:eol-style + native Modified: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/bsbhv/BsEventScheduleBhv.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/bsbhv/BsEventScheduleBhv.java 2008-12-27 22:14:41 UTC (rev 1629) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/bsbhv/BsEventScheduleBhv.java 2008-12-27 22:18:30 UTC (rev 1630) @@ -1,9 +1,8 @@ package jp.sf.pal.scheduler.db.bsbhv; import java.util.List; +import java.util.Map; -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; @@ -22,14 +21,13 @@ import jp.sf.pal.scheduler.db.cbean.FacilityScheduleMappingCB; import jp.sf.pal.scheduler.db.exbhv.EventScheduleMappingBhv; import jp.sf.pal.scheduler.db.exbhv.FacilityScheduleMappingBhv; -import jp.sf.pal.scheduler.db.exdao.EventScheduleDao; import jp.sf.pal.scheduler.db.exentity.EventSchedule; import jp.sf.pal.scheduler.db.exentity.EventScheduleContent; import jp.sf.pal.scheduler.db.exentity.EventScheduleMapping; import jp.sf.pal.scheduler.db.exentity.FacilityScheduleMapping; /** - * The behavior of EVENT_SCHEDULE. + * The behavior of EVENT_SCHEDULE that the type is TABLE.
* *
  * [primary-key]
@@ -74,12 +72,6 @@
 
     //==========================================================================
     // =========
-    // Attribute
-    // =========
-    protected EventScheduleDao _dao;
-
-    //==========================================================================
-    // =========
     // Table name
     // ==========
     /** @return The name on database of table. (NotNull) */
@@ -91,39 +83,18 @@
     // =========
     // DBMeta
     // ======
-    /** @return The meta data of the database. (NotNull) */
+    /** @return The instance of DBMeta. (NotNull) */
     public DBMeta getDBMeta() {
         return EventScheduleDbm.getInstance();
     }
 
-    /** @return The meta data of the database as my table type. (NotNull) */
+    /** @return The instance of DBMeta as my table type. (NotNull) */
     public EventScheduleDbm getMyDBMeta() {
         return EventScheduleDbm.getInstance();
     }
 
     //==========================================================================
     // =========
-    // Dao Accessor
-    // ============
-    public EventScheduleDao getMyDao() {
-        return _dao;
-    }
-
-    public void setMyDao(EventScheduleDao dao) {
-        assertObjectNotNull("dao", dao);
-        _dao = dao;
-    }
-
-    public DaoReadable getDaoReadable() {
-        return getMyDao();
-    }
-
-    public DaoWritable getDaoWritable() {
-        return getMyDao();
-    }
-
-    //==========================================================================
-    // =========
     // New Instance
     // ============
     public Entity newEntity() {
@@ -153,7 +124,7 @@
      * @return The selected count.
      */
     public int selectCount(EventScheduleCB cb) {
-        assertConditionBeanNotNull(cb);
+        assertCBNotNull(cb);
         return delegateSelectCount(cb);
     }
 
@@ -233,7 +204,7 @@
      * @return The result bean of selected list. (NotNull)
      */
     public ListResultBean selectList(EventScheduleCB cb) {
-        assertConditionBeanNotNull(cb);
+        assertCBNotNull(cb);
         return new ResultBeanBuilder(getTableDbName())
                 .buildListResultBean(cb, delegateSelectList(cb));
     }
@@ -249,7 +220,7 @@
      * @return The result bean of selected page. (NotNull)
      */
     public PagingResultBean selectPage(final EventScheduleCB cb) {
-        assertConditionBeanNotNull(cb);
+        assertCBNotNull(cb);
         final PagingInvoker invoker = new PagingInvoker(
                 getTableDbName());
         final PagingHandler handler = new PagingHandler() {
@@ -270,6 +241,32 @@
 
     //==========================================================================
     // =========
+    // Scalar Select
+    // =============
+    /**
+     * Select the scalar value derived by a function. 
Call a function + * method after this method called like as follows: + * + *
+     * eventScheduleBhv.scalarSelect(Date.class).max(new ScalarQuery(EventScheduleCB cb) {
+     *     cb.specify().columnXxxDatetime(); // the required specification of target column
+     *     cb.query().setXxxName_PrefixSearch("S"); // query as you like it
+     * });
+     * 
+ * + * @param The type of result. + * @param resultType The type of result. (NotNull) + * @return The scalar value derived by a function. (Nullable) + */ + public SLFunction scalarSelect( + Class resultType) { + EventScheduleCB cb = newMyConditionBean(); + cb.xsetupForScalarSelect(); + return new SLFunction(cb, resultType); + } + + //========================================================================== + // ========= // Various Select // ============== /** @@ -279,8 +276,7 @@ * @param valueLabelSetupper The setupper of value-label. (NotNull) * @return The list of value-label. (NotNull) */ - public List> selectValueLabelList( - EventScheduleCB cb, + public List> selectValueLabelList(EventScheduleCB cb, ValueLabelSetupper valueLabelSetupper) { return createValueLabelList(selectList(cb), valueLabelSetupper); } @@ -489,8 +485,8 @@ //========================================================================== // ========= - // Pullout Foreign - // =============== + // Pull out Foreign + // ================ /** * Pull out the list of referrer-as-one table 'EventScheduleContent'. * @@ -810,11 +806,11 @@ */ public int queryUpdate(EventSchedule eventSchedule, EventScheduleCB cb) { assertObjectNotNull("eventSchedule", eventSchedule); - assertConditionBeanNotNull(cb); + assertCBNotNull(cb); setupCommonColumnOfUpdateIfNeeds(eventSchedule); filterEntityOfUpdate(eventSchedule); assertEntityOfUpdate(eventSchedule); - return getMyDao().updateByQuery(cb, eventSchedule); + return invoke(createQueryUpdateEntityCBCommand(eventSchedule, cb)); } /** @@ -824,8 +820,8 @@ * @return The deleted count. */ public int queryDelete(EventScheduleCB cb) { - assertConditionBeanNotNull(cb); - return getMyDao().deleteByQuery(cb); + assertCBNotNull(cb); + return invoke(createQueryDeleteCBCommand(cb)); } //========================================================================== @@ -837,19 +833,27 @@ // ========= // Delegate Method // =============== + // [Behavior Command] // ----------------------------------------------------- // Select // ------ protected int delegateSelectCount(EventScheduleCB cb) { - assertConditionBeanNotNull(cb); - return getMyDao().selectCount(cb); + return invoke(createSelectCountCBCommand(cb)); } + protected int doCallReadCount(ConditionBean cb) { + return delegateSelectCount((EventScheduleCB) cb); + } + protected List delegateSelectList(EventScheduleCB cb) { - assertConditionBeanNotNull(cb); - return getMyDao().selectList(cb); + return invoke(createSelectListCBCommand(cb, EventSchedule.class)); } + @SuppressWarnings("unchecked") + protected List doCallReadList(ConditionBean cb) { + return (List) delegateSelectList((EventScheduleCB) cb); + } + // ----------------------------------------------------- // Update // ------ @@ -857,62 +861,97 @@ if (!processBeforeInsert(e)) { return 1; } - return getMyDao().insert(e); + return invoke(createInsertEntityCommand(e)); } + protected int doCallCreate(Entity entity) { + return delegateInsert(downcast(entity)); + } + protected int delegateUpdate(EventSchedule e) { if (!processBeforeUpdate(e)) { return 1; } - return getMyDao().updateModifiedOnly(e); + return invoke(createUpdateEntityCommand(e)); } + protected int doCallModify(Entity entity) { + return delegateUpdate(downcast(entity)); + } + protected int delegateUpdateNonstrict(EventSchedule e) { if (!processBeforeUpdate(e)) { return 1; } - return getMyDao().updateNonstrictModifiedOnly(e); + return invoke(createUpdateNonstrictEntityCommand(e)); } protected int delegateDelete(EventSchedule e) { if (!processBeforeDelete(e)) { return 1; } - return getMyDao().delete(e); + return invoke(createDeleteEntityCommand(e)); } + protected int doCallRemove(Entity entity) { + return delegateDelete(downcast(entity)); + } + protected int delegateDeleteNonstrict(EventSchedule e) { if (!processBeforeDelete(e)) { return 1; } - return getMyDao().deleteNonstrict(e); + return invoke(createDeleteNonstrictEntityCommand(e)); } protected int[] delegateInsertList(List ls) { - assertObjectNotNull("eventScheduleList", ls); - return getMyDao().insertList(helpFilterBeforeInsertInternally(ls)); + if (ls.isEmpty()) { + return new int[] {}; + } + return invoke(createBatchInsertEntityCommand(helpFilterBeforeInsertInternally(ls))); } + @SuppressWarnings("unchecked") + protected int[] doCreateList(List ls) { + return delegateInsertList((List) ls); + } + protected int[] delegateUpdateList(List ls) { - assertObjectNotNull("eventScheduleList", ls); - return getMyDao().updateList(helpFilterBeforeUpdateInternally(ls)); + if (ls.isEmpty()) { + return new int[] {}; + } + return invoke(createBatchUpdateEntityCommand(helpFilterBeforeUpdateInternally(ls))); } + @SuppressWarnings("unchecked") + protected int[] doModifyList(List ls) { + return delegateUpdateList((List) ls); + } + protected int[] delegateUpdateListNonstrict(List ls) { - assertObjectNotNull("eventScheduleList", ls); - return getMyDao().updateListNonstrict( - helpFilterBeforeUpdateInternally(ls)); + if (ls.isEmpty()) { + return new int[] {}; + } + return invoke(createBatchUpdateNonstrictEntityCommand(helpFilterBeforeUpdateInternally(ls))); } protected int[] delegateDeleteList(List ls) { - assertObjectNotNull("eventScheduleList", ls); - return getMyDao().deleteList(helpFilterBeforeDeleteInternally(ls)); + if (ls.isEmpty()) { + return new int[] {}; + } + return invoke(createBatchDeleteEntityCommand(helpFilterBeforeDeleteInternally(ls))); } + @SuppressWarnings("unchecked") + protected int[] doRemoveList(List ls) { + return delegateDeleteList((List) ls); + } + protected int[] delegateDeleteListNonstrict(List ls) { - assertObjectNotNull("eventScheduleList", ls); - return getMyDao().deleteListNonstrict( - helpFilterBeforeDeleteInternally(ls)); + if (ls.isEmpty()) { + return new int[] {}; + } + return invoke(createBatchDeleteNonstrictEntityCommand(helpFilterBeforeDeleteInternally(ls))); } //========================================================================== Modified: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/bsbhv/BsEventScheduleContentBhv.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/bsbhv/BsEventScheduleContentBhv.java 2008-12-27 22:14:41 UTC (rev 1629) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/bsbhv/BsEventScheduleContentBhv.java 2008-12-27 22:18:30 UTC (rev 1630) @@ -1,9 +1,8 @@ package jp.sf.pal.scheduler.db.bsbhv; import java.util.List; +import java.util.Map; -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; @@ -16,12 +15,11 @@ import jp.sf.pal.scheduler.db.allcommon.dbmeta.DBMeta; import jp.sf.pal.scheduler.db.bsentity.dbmeta.EventScheduleContentDbm; import jp.sf.pal.scheduler.db.cbean.EventScheduleContentCB; -import jp.sf.pal.scheduler.db.exdao.EventScheduleContentDao; import jp.sf.pal.scheduler.db.exentity.EventSchedule; import jp.sf.pal.scheduler.db.exentity.EventScheduleContent; /** - * The behavior of EVENT_SCHEDULE_CONTENT. + * The behavior of EVENT_SCHEDULE_CONTENT that the type is TABLE.
* *
  * [primary-key]
@@ -66,12 +64,6 @@
 
     //==========================================================================
     // =========
-    // Attribute
-    // =========
-    protected EventScheduleContentDao _dao;
-
-    //==========================================================================
-    // =========
     // Table name
     // ==========
     /** @return The name on database of table. (NotNull) */
@@ -83,39 +75,18 @@
     // =========
     // DBMeta
     // ======
-    /** @return The meta data of the database. (NotNull) */
+    /** @return The instance of DBMeta. (NotNull) */
     public DBMeta getDBMeta() {
         return EventScheduleContentDbm.getInstance();
     }
 
-    /** @return The meta data of the database as my table type. (NotNull) */
+    /** @return The instance of DBMeta as my table type. (NotNull) */
     public EventScheduleContentDbm getMyDBMeta() {
         return EventScheduleContentDbm.getInstance();
     }
 
     //==========================================================================
     // =========
-    // Dao Accessor
-    // ============
-    public EventScheduleContentDao getMyDao() {
-        return _dao;
-    }
-
-    public void setMyDao(EventScheduleContentDao dao) {
-        assertObjectNotNull("dao", dao);
-        _dao = dao;
-    }
-
-    public DaoReadable getDaoReadable() {
-        return getMyDao();
-    }
-
-    public DaoWritable getDaoWritable() {
-        return getMyDao();
-    }
-
-    //==========================================================================
-    // =========
     // New Instance
     // ============
     public Entity newEntity() {
@@ -145,7 +116,7 @@
      * @return The selected count.
      */
     public int selectCount(EventScheduleContentCB cb) {
-        assertConditionBeanNotNull(cb);
+        assertCBNotNull(cb);
         return delegateSelectCount(cb);
     }
 
@@ -227,7 +198,7 @@
      */
     public ListResultBean selectList(
             EventScheduleContentCB cb) {
-        assertConditionBeanNotNull(cb);
+        assertCBNotNull(cb);
         return new ResultBeanBuilder(getTableDbName())
                 .buildListResultBean(cb, delegateSelectList(cb));
     }
@@ -244,7 +215,7 @@
      */
     public PagingResultBean selectPage(
             final EventScheduleContentCB cb) {
-        assertConditionBeanNotNull(cb);
+        assertCBNotNull(cb);
         final PagingInvoker invoker = new PagingInvoker(
                 getTableDbName());
         final PagingHandler handler = new PagingHandler() {
@@ -265,6 +236,32 @@
 
     //==========================================================================
     // =========
+    // Scalar Select
+    // =============
+    /**
+     * Select the scalar value derived by a function. 
Call a function + * method after this method called like as follows: + * + *
+     * eventScheduleContentBhv.scalarSelect(Date.class).max(new ScalarQuery(EventScheduleContentCB cb) {
+     *     cb.specify().columnXxxDatetime(); // the required specification of target column
+     *     cb.query().setXxxName_PrefixSearch("S"); // query as you like it
+     * });
+     * 
+ * + * @param The type of result. + * @param resultType The type of result. (NotNull) + * @return The scalar value derived by a function. (Nullable) + */ + public SLFunction scalarSelect( + Class resultType) { + EventScheduleContentCB cb = newMyConditionBean(); + cb.xsetupForScalarSelect(); + return new SLFunction(cb, resultType); + } + + //========================================================================== + // ========= // Various Select // ============== /** @@ -274,7 +271,7 @@ * @param valueLabelSetupper The setupper of value-label. (NotNull) * @return The list of value-label. (NotNull) */ - public List> selectValueLabelList( + public List> selectValueLabelList( EventScheduleContentCB cb, ValueLabelSetupper valueLabelSetupper) { return createValueLabelList(selectList(cb), valueLabelSetupper); @@ -287,8 +284,8 @@ //========================================================================== // ========= - // Pullout Foreign - // =============== + // Pull out Foreign + // ================ /** * Pull out the list of foreign table 'EventSchedule'. * @@ -496,11 +493,11 @@ public int queryUpdate(EventScheduleContent eventScheduleContent, EventScheduleContentCB cb) { assertObjectNotNull("eventScheduleContent", eventScheduleContent); - assertConditionBeanNotNull(cb); + assertCBNotNull(cb); setupCommonColumnOfUpdateIfNeeds(eventScheduleContent); filterEntityOfUpdate(eventScheduleContent); assertEntityOfUpdate(eventScheduleContent); - return getMyDao().updateByQuery(cb, eventScheduleContent); + return invoke(createQueryUpdateEntityCBCommand(eventScheduleContent, cb)); } /** @@ -510,8 +507,8 @@ * @return The deleted count. */ public int queryDelete(EventScheduleContentCB cb) { - assertConditionBeanNotNull(cb); - return getMyDao().deleteByQuery(cb); + assertCBNotNull(cb); + return invoke(createQueryDeleteCBCommand(cb)); } //========================================================================== @@ -523,20 +520,28 @@ // ========= // Delegate Method // =============== + // [Behavior Command] // ----------------------------------------------------- // Select // ------ protected int delegateSelectCount(EventScheduleContentCB cb) { - assertConditionBeanNotNull(cb); - return getMyDao().selectCount(cb); + return invoke(createSelectCountCBCommand(cb)); } + protected int doCallReadCount(ConditionBean cb) { + return delegateSelectCount((EventScheduleContentCB) cb); + } + protected List delegateSelectList( EventScheduleContentCB cb) { - assertConditionBeanNotNull(cb); - return getMyDao().selectList(cb); + return invoke(createSelectListCBCommand(cb, EventScheduleContent.class)); } + @SuppressWarnings("unchecked") + protected List doCallReadList(ConditionBean cb) { + return (List) delegateSelectList((EventScheduleContentCB) cb); + } + // ----------------------------------------------------- // Update // ------ @@ -544,38 +549,71 @@ if (!processBeforeInsert(e)) { return 1; } - return getMyDao().insert(e); + return invoke(createInsertEntityCommand(e)); } + protected int doCallCreate(Entity entity) { + return delegateInsert(downcast(entity)); + } + protected int delegateUpdate(EventScheduleContent e) { if (!processBeforeUpdate(e)) { return 1; } - return getMyDao().updateModifiedOnly(e); + return invoke(createUpdateEntityCommand(e)); } + protected int doCallModify(Entity entity) { + return delegateUpdate(downcast(entity)); + } + protected int delegateDelete(EventScheduleContent e) { if (!processBeforeDelete(e)) { return 1; } - return getMyDao().delete(e); + return invoke(createDeleteEntityCommand(e)); } + protected int doCallRemove(Entity entity) { + return delegateDelete(downcast(entity)); + } + protected int[] delegateInsertList(List ls) { - assertObjectNotNull("eventScheduleContentList", ls); - return getMyDao().insertList(helpFilterBeforeInsertInternally(ls)); + if (ls.isEmpty()) { + return new int[] {}; + } + return invoke(createBatchInsertEntityCommand(helpFilterBeforeInsertInternally(ls))); } + @SuppressWarnings("unchecked") + protected int[] doCreateList(List ls) { + return delegateInsertList((List) ls); + } + protected int[] delegateUpdateList(List ls) { - assertObjectNotNull("eventScheduleContentList", ls); - return getMyDao().updateList(helpFilterBeforeUpdateInternally(ls)); + if (ls.isEmpty()) { + return new int[] {}; + } + return invoke(createBatchUpdateEntityCommand(helpFilterBeforeUpdateInternally(ls))); } + @SuppressWarnings("unchecked") + protected int[] doModifyList(List ls) { + return delegateUpdateList((List) ls); + } + protected int[] delegateDeleteList(List ls) { - assertObjectNotNull("eventScheduleContentList", ls); - return getMyDao().deleteList(helpFilterBeforeDeleteInternally(ls)); + if (ls.isEmpty()) { + return new int[] {}; + } + return invoke(createBatchDeleteEntityCommand(helpFilterBeforeDeleteInternally(ls))); } + @SuppressWarnings("unchecked") + protected int[] doRemoveList(List ls) { + return delegateDeleteList((List) ls); + } + //========================================================================== // ========= // Optimistic Lock Info Modified: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/bsbhv/BsEventScheduleMappingBhv.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/bsbhv/BsEventScheduleMappingBhv.java 2008-12-27 22:14:41 UTC (rev 1629) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/bsbhv/BsEventScheduleMappingBhv.java 2008-12-27 22:18:30 UTC (rev 1630) @@ -1,9 +1,8 @@ package jp.sf.pal.scheduler.db.bsbhv; import java.util.List; +import java.util.Map; -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; @@ -16,13 +15,12 @@ import jp.sf.pal.scheduler.db.allcommon.dbmeta.DBMeta; import jp.sf.pal.scheduler.db.bsentity.dbmeta.EventScheduleMappingDbm; import jp.sf.pal.scheduler.db.cbean.EventScheduleMappingCB; -import jp.sf.pal.scheduler.db.exdao.EventScheduleMappingDao; import jp.sf.pal.scheduler.db.exentity.EventSchedule; import jp.sf.pal.scheduler.db.exentity.EventScheduleMapping; import jp.sf.pal.scheduler.db.exentity.UserInfo; /** - * The behavior of EVENT_SCHEDULE_MAPPING. + * The behavior of EVENT_SCHEDULE_MAPPING that the type is TABLE.
* *
  * [primary-key]
@@ -67,12 +65,6 @@
 
     //==========================================================================
     // =========
-    // Attribute
-    // =========
-    protected EventScheduleMappingDao _dao;
-
-    //==========================================================================
-    // =========
     // Table name
     // ==========
     /** @return The name on database of table. (NotNull) */
@@ -84,39 +76,18 @@
     // =========
     // DBMeta
     // ======
-    /** @return The meta data of the database. (NotNull) */
+    /** @return The instance of DBMeta. (NotNull) */
     public DBMeta getDBMeta() {
         return EventScheduleMappingDbm.getInstance();
     }
 
-    /** @return The meta data of the database as my table type. (NotNull) */
+    /** @return The instance of DBMeta as my table type. (NotNull) */
     public EventScheduleMappingDbm getMyDBMeta() {
         return EventScheduleMappingDbm.getInstance();
     }
 
     //==========================================================================
     // =========
-    // Dao Accessor
-    // ============
-    public EventScheduleMappingDao getMyDao() {
-        return _dao;
-    }
-
-    public void setMyDao(EventScheduleMappingDao dao) {
-        assertObjectNotNull("dao", dao);
-        _dao = dao;
-    }
-
-    public DaoReadable getDaoReadable() {
-        return getMyDao();
-    }
-
-    public DaoWritable getDaoWritable() {
-        return getMyDao();
-    }
-
-    //==========================================================================
-    // =========
     // New Instance
     // ============
     public Entity newEntity() {
@@ -146,7 +117,7 @@
      * @return The selected count.
      */
     public int selectCount(EventScheduleMappingCB cb) {
-        assertConditionBeanNotNull(cb);
+        assertCBNotNull(cb);
         return delegateSelectCount(cb);
     }
 
@@ -228,7 +199,7 @@
      */
     public ListResultBean selectList(
             EventScheduleMappingCB cb) {
-        assertConditionBeanNotNull(cb);
+        assertCBNotNull(cb);
         return new ResultBeanBuilder(getTableDbName())
                 .buildListResultBean(cb, delegateSelectList(cb));
     }
@@ -245,7 +216,7 @@
      */
     public PagingResultBean selectPage(
             final EventScheduleMappingCB cb) {
-        assertConditionBeanNotNull(cb);
+        assertCBNotNull(cb);
         final PagingInvoker invoker = new PagingInvoker(
                 getTableDbName());
         final PagingHandler handler = new PagingHandler() {
@@ -266,6 +237,32 @@
 
     //==========================================================================
     // =========
+    // Scalar Select
+    // =============
+    /**
+     * Select the scalar value derived by a function. 
Call a function + * method after this method called like as follows: + * + *
+     * eventScheduleMappingBhv.scalarSelect(Date.class).max(new ScalarQuery(EventScheduleMappingCB cb) {
+     *     cb.specify().columnXxxDatetime(); // the required specification of target column
+     *     cb.query().setXxxName_PrefixSearch("S"); // query as you like it
+     * });
+     * 
+ * + * @param The type of result. + * @param resultType The type of result. (NotNull) + * @return The scalar value derived by a function. (Nullable) + */ + public SLFunction scalarSelect( + Class resultType) { + EventScheduleMappingCB cb = newMyConditionBean(); + cb.xsetupForScalarSelect(); + return new SLFunction(cb, resultType); + } + + //========================================================================== + // ========= // Various Select // ============== /** @@ -275,7 +272,7 @@ * @param valueLabelSetupper The setupper of value-label. (NotNull) * @return The list of value-label. (NotNull) */ - public List> selectValueLabelList( + public List> selectValueLabelList( EventScheduleMappingCB cb, ValueLabelSetupper valueLabelSetupper) { return createValueLabelList(selectList(cb), valueLabelSetupper); @@ -288,8 +285,8 @@ //========================================================================== // ========= - // Pullout Foreign - // =============== + // Pull out Foreign + // ================ /** * Pull out the list of foreign table 'EventSchedule'. * @@ -515,11 +512,11 @@ public int queryUpdate(EventScheduleMapping eventScheduleMapping, EventScheduleMappingCB cb) { assertObjectNotNull("eventScheduleMapping", eventScheduleMapping); - assertConditionBeanNotNull(cb); + assertCBNotNull(cb); setupCommonColumnOfUpdateIfNeeds(eventScheduleMapping); filterEntityOfUpdate(eventScheduleMapping); assertEntityOfUpdate(eventScheduleMapping); - return getMyDao().updateByQuery(cb, eventScheduleMapping); + return invoke(createQueryUpdateEntityCBCommand(eventScheduleMapping, cb)); } /** @@ -529,8 +526,8 @@ * @return The deleted count. */ public int queryDelete(EventScheduleMappingCB cb) { - assertConditionBeanNotNull(cb); - return getMyDao().deleteByQuery(cb); + assertCBNotNull(cb); + return invoke(createQueryDeleteCBCommand(cb)); } //========================================================================== @@ -542,20 +539,28 @@ // ========= // Delegate Method // =============== + // [Behavior Command] // ----------------------------------------------------- // Select // ------ protected int delegateSelectCount(EventScheduleMappingCB cb) { - assertConditionBeanNotNull(cb); - return getMyDao().selectCount(cb); + return invoke(createSelectCountCBCommand(cb)); } + protected int doCallReadCount(ConditionBean cb) { + return delegateSelectCount((EventScheduleMappingCB) cb); + } + protected List delegateSelectList( EventScheduleMappingCB cb) { - assertConditionBeanNotNull(cb); - return getMyDao().selectList(cb); + return invoke(createSelectListCBCommand(cb, EventScheduleMapping.class)); } + @SuppressWarnings("unchecked") + protected List doCallReadList(ConditionBean cb) { + return (List) delegateSelectList((EventScheduleMappingCB) cb); + } + // ----------------------------------------------------- // Update // ------ @@ -563,38 +568,71 @@ if (!processBeforeInsert(e)) { return 1; } - return getMyDao().insert(e); + return invoke(createInsertEntityCommand(e)); } + protected int doCallCreate(Entity entity) { + return delegateInsert(downcast(entity)); + } + protected int delegateUpdate(EventScheduleMapping e) { if (!processBeforeUpdate(e)) { return 1; } - return getMyDao().updateModifiedOnly(e); + return invoke(createUpdateEntityCommand(e)); } + protected int doCallModify(Entity entity) { + return delegateUpdate(downcast(entity)); + } + protected int delegateDelete(EventScheduleMapping e) { if (!processBeforeDelete(e)) { return 1; } - return getMyDao().delete(e); + return invoke(createDeleteEntityCommand(e)); } + protected int doCallRemove(Entity entity) { + return delegateDelete(downcast(entity)); + } + protected int[] delegateInsertList(List ls) { - assertObjectNotNull("eventScheduleMappingList", ls); - return getMyDao().insertList(helpFilterBeforeInsertInternally(ls)); + if (ls.isEmpty()) { + return new int[] {}; + } + return invoke(createBatchInsertEntityCommand(helpFilterBeforeInsertInternally(ls))); } + @SuppressWarnings("unchecked") + protected int[] doCreateList(List ls) { + return delegateInsertList((List) ls); + } + protected int[] delegateUpdateList(List ls) { - assertObjectNotNull("eventScheduleMappingList", ls); - return getMyDao().updateList(helpFilterBeforeUpdateInternally(ls)); + if (ls.isEmpty()) { + return new int[] {}; + } + return invoke(createBatchUpdateEntityCommand(helpFilterBeforeUpdateInternally(ls))); } + @SuppressWarnings("unchecked") + protected int[] doModifyList(List ls) { + return delegateUpdateList((List) ls); + } + protected int[] delegateDeleteList(List ls) { - assertObjectNotNull("eventScheduleMappingList", ls); - return getMyDao().deleteList(helpFilterBeforeDeleteInternally(ls)); + if (ls.isEmpty()) { + return new int[] {}; + } + return invoke(createBatchDeleteEntityCommand(helpFilterBeforeDeleteInternally(ls))); } + @SuppressWarnings("unchecked") + protected int[] doRemoveList(List ls) { + return delegateDeleteList((List) ls); + } + //========================================================================== // ========= // Optimistic Lock Info Modified: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/bsbhv/BsFacilityBhv.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/bsbhv/BsFacilityBhv.java 2008-12-27 22:14:41 UTC (rev 1629) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/bsbhv/BsFacilityBhv.java 2008-12-27 22:18:30 UTC (rev 1630) @@ -1,9 +1,8 @@ package jp.sf.pal.scheduler.db.bsbhv; import java.util.List; +import java.util.Map; -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; @@ -20,14 +19,13 @@ import jp.sf.pal.scheduler.db.cbean.FacilityCB; import jp.sf.pal.scheduler.db.cbean.FacilityScheduleMappingCB; import jp.sf.pal.scheduler.db.exbhv.FacilityScheduleMappingBhv; -import jp.sf.pal.scheduler.db.exdao.FacilityDao; import jp.sf.pal.scheduler.db.exentity.Facility; import jp.sf.pal.scheduler.db.exentity.FacilityContent; import jp.sf.pal.scheduler.db.exentity.FacilityGroup; import jp.sf.pal.scheduler.db.exentity.FacilityScheduleMapping; /** - * The behavior of FACILITY. + * The behavior of FACILITY that the type is TABLE.
* *
  * [primary-key]
@@ -72,12 +70,6 @@
 
     //==========================================================================
     // =========
-    // Attribute
-    // =========
-    protected FacilityDao _dao;
-
-    //==========================================================================
-    // =========
     // Table name
     // ==========
     /** @return The name on database of table. (NotNull) */
@@ -89,39 +81,18 @@
     // =========
     // DBMeta
     // ======
-    /** @return The meta data of the database. (NotNull) */
+    /** @return The instance of DBMeta. (NotNull) */
     public DBMeta getDBMeta() {
         return FacilityDbm.getInstance();
     }
 
-    /** @return The meta data of the database as my table type. (NotNull) */
+    /** @return The instance of DBMeta as my table type. (NotNull) */
     public FacilityDbm getMyDBMeta() {
         return FacilityDbm.getInstance();
     }
 
     //==========================================================================
     // =========
-    // Dao Accessor
-    // ============
-    public FacilityDao getMyDao() {
-        return _dao;
-    }
-
-    public void setMyDao(FacilityDao dao) {
-        assertObjectNotNull("dao", dao);
-        _dao = dao;
-    }
-
-    public DaoReadable getDaoReadable() {
-        return getMyDao();
-    }
-
-    public DaoWritable getDaoWritable() {
-        return getMyDao();
-    }
-
-    //==========================================================================
-    // =========
     // New Instance
     // ============
     public Entity newEntity() {
@@ -151,7 +122,7 @@
      * @return The selected count.
      */
     public int selectCount(FacilityCB cb) {
-        assertConditionBeanNotNull(cb);
+        assertCBNotNull(cb);
         return delegateSelectCount(cb);
     }
 
@@ -228,7 +199,7 @@
      * @return The result bean of selected list. (NotNull)
      */
     public ListResultBean selectList(FacilityCB cb) {
-        assertConditionBeanNotNull(cb);
+        assertCBNotNull(cb);
         return new ResultBeanBuilder(getTableDbName())
                 .buildListResultBean(cb, delegateSelectList(cb));
     }
@@ -244,7 +215,7 @@
      * @return The result bean of selected page. (NotNull)
      */
     public PagingResultBean selectPage(final FacilityCB cb) {
-        assertConditionBeanNotNull(cb);
+        assertCBNotNull(cb);
         final PagingInvoker invoker = new PagingInvoker(
                 getTableDbName());
         final PagingHandler handler = new PagingHandler() {
@@ -265,6 +236,32 @@
 
     //==========================================================================
     // =========
+    // Scalar Select
+    // =============
+    /**
+     * Select the scalar value derived by a function. 
Call a function + * method after this method called like as follows: + * + *
+     * facilityBhv.scalarSelect(Date.class).max(new ScalarQuery(FacilityCB cb) {
+     *     cb.specify().columnXxxDatetime(); // the required specification of target column
+     *     cb.query().setXxxName_PrefixSearch("S"); // query as you like it
+     * });
+     * 
+ * + * @param The type of result. + * @param resultType The type of result. (NotNull) + * @return The scalar value derived by a function. (Nullable) + */ + public SLFunction scalarSelect( + Class resultType) { + FacilityCB cb = newMyConditionBean(); + cb.xsetupForScalarSelect(); + return new SLFunction(cb, resultType); + } + + //========================================================================== + // ========= // Various Select // ============== /** @@ -274,8 +271,8 @@ * @param valueLabelSetupper The setupper of value-label. (NotNull) * @return The list of value-label. (NotNull) */ - public List> selectValueLabelList( - FacilityCB cb, ValueLabelSetupper valueLabelSetupper) { + public List> selectValueLabelList(FacilityCB cb, + ValueLabelSetupper valueLabelSetupper) { return createValueLabelList(selectList(cb), valueLabelSetupper); } @@ -381,8 +378,8 @@ //========================================================================== // ========= - // Pullout Foreign - // =============== + // Pull out Foreign + // ================ /** * Pull out the list of foreign table 'FacilityGroup'. * @@ -710,11 +707,11 @@ */ public int queryUpdate(Facility facility, FacilityCB cb) { assertObjectNotNull("facility", facility); - assertConditionBeanNotNull(cb); + assertCBNotNull(cb); setupCommonColumnOfUpdateIfNeeds(facility); filterEntityOfUpdate(facility); assertEntityOfUpdate(facility); - return getMyDao().updateByQuery(cb, facility); + return invoke(createQueryUpdateEntityCBCommand(facility, cb)); } /** @@ -724,8 +721,8 @@ * @return The deleted count. */ public int queryDelete(FacilityCB cb) { - assertConditionBeanNotNull(cb); - return getMyDao().deleteByQuery(cb); + assertCBNotNull(cb); + return invoke(createQueryDeleteCBCommand(cb)); } //========================================================================== @@ -737,19 +734,27 @@ // ========= // Delegate Method // =============== + // [Behavior Command] // ----------------------------------------------------- // Select // ------ protected int delegateSelectCount(FacilityCB cb) { - assertConditionBeanNotNull(cb); - return getMyDao().selectCount(cb); + return invoke(createSelectCountCBCommand(cb)); } + protected int doCallReadCount(ConditionBean cb) { + return delegateSelectCount((FacilityCB) cb); + } + protected List delegateSelectList(FacilityCB cb) { - assertConditionBeanNotNull(cb); - return getMyDao().selectList(cb); + return invoke(createSelectListCBCommand(cb, Facility.class)); } + @SuppressWarnings("unchecked") + protected List doCallReadList(ConditionBean cb) { + return (List) delegateSelectList((FacilityCB) cb); + } + // ----------------------------------------------------- // Update // ------ @@ -757,62 +762,97 @@ if (!processBeforeInsert(e)) { return 1; } - return getMyDao().insert(e); + return invoke(createInsertEntityCommand(e)); } + protected int doCallCreate(Entity entity) { + return delegateInsert(downcast(entity)); + } + protected int delegateUpdate(Facility e) { if (!processBeforeUpdate(e)) { return 1; } - return getMyDao().updateModifiedOnly(e); + return invoke(createUpdateEntityCommand(e)); } + protected int doCallModify(Entity entity) { + return delegateUpdate(downcast(entity)); + } + protected int delegateUpdateNonstrict(Facility e) { if (!processBeforeUpdate(e)) { return 1; } - return getMyDao().updateNonstrictModifiedOnly(e); + return invoke(createUpdateNonstrictEntityCommand(e)); } protected int delegateDelete(Facility e) { if (!processBeforeDelete(e)) { return 1; } - return getMyDao().delete(e); + return invoke(createDeleteEntityCommand(e)); } + protected int doCallRemove(Entity entity) { + return delegateDelete(downcast(entity)); + } + protected int delegateDeleteNonstrict(Facility e) { if (!processBeforeDelete(e)) { return 1; } - return getMyDao().deleteNonstrict(e); + return invoke(createDeleteNonstrictEntityCommand(e)); } protected int[] delegateInsertList(List ls) { - assertObjectNotNull("facilityList", ls); - return getMyDao().insertList(helpFilterBeforeInsertInternally(ls)); + if (ls.isEmpty()) { + return new int[] {}; + } + return invoke(createBatchInsertEntityCommand(helpFilterBeforeInsertInternally(ls))); } + @SuppressWarnings("unchecked") + protected int[] doCreateList(List ls) { + return delegateInsertList((List) ls); + } + protected int[] delegateUpdateList(List ls) { - assertObjectNotNull("facilityList", ls); - return getMyDao().updateList(helpFilterBeforeUpdateInternally(ls)); + if (ls.isEmpty()) { + return new int[] {}; + } + return invoke(createBatchUpdateEntityCommand(helpFilterBeforeUpdateInternally(ls))); } + @SuppressWarnings("unchecked") + protected int[] doModifyList(List ls) { + return delegateUpdateList((List) ls); + } + protected int[] delegateUpdateListNonstrict(List ls) { - assertObjectNotNull("facilityList", ls); - return getMyDao().updateListNonstrict( - helpFilterBeforeUpdateInternally(ls)); + if (ls.isEmpty()) { + return new int[] {}; + } + return invoke(createBatchUpdateNonstrictEntityCommand(helpFilterBeforeUpdateInternally(ls))); } protected int[] delegateDeleteList(List ls) { - assertObjectNotNull("facilityList", ls); - return getMyDao().deleteList(helpFilterBeforeDeleteInternally(ls)); + if (ls.isEmpty()) { + return new int[] {}; + } + return invoke(createBatchDeleteEntityCommand(helpFilterBeforeDeleteInternally(ls))); } + @SuppressWarnings("unchecked") + protected int[] doRemoveList(List ls) { + return delegateDeleteList((List) ls); + } + protected int[] delegateDeleteListNonstrict(List ls) { - assertObjectNotNull("facilityList", ls); - return getMyDao().deleteListNonstrict( - helpFilterBeforeDeleteInternally(ls)); + if (ls.isEmpty()) { + return new int[] {}; + } + return invoke(createBatchDeleteNonstrictEntityCommand(helpFilterBeforeDeleteInternally(ls))); } //========================================================================== Modified: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/bsbhv/BsFacilityContentBhv.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/bsbhv/BsFacilityContentBhv.java 2008-12-27 22:14:41 UTC (rev 1629) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/bsbhv/BsFacilityContentBhv.java 2008-12-27 22:18:30 UTC (rev 1630) @@ -1,9 +1,8 @@ package jp.sf.pal.scheduler.db.bsbhv; import java.util.List; +import java.util.Map; -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; @@ -16,12 +15,11 @@ import jp.sf.pal.scheduler.db.allcommon.dbmeta.DBMeta; import jp.sf.pal.scheduler.db.bsentity.dbmeta.FacilityContentDbm; import jp.sf.pal.scheduler.db.cbean.FacilityContentCB; -import jp.sf.pal.scheduler.db.exdao.FacilityContentDao; import jp.sf.pal.scheduler.db.exentity.Facility; import jp.sf.pal.scheduler.db.exentity.FacilityContent; /** - * The behavior of FACILITY_CONTENT. + * The behavior of FACILITY_CONTENT that the type is TABLE.
* *
  * [primary-key]
@@ -66,12 +64,6 @@
 
     //==========================================================================
     // =========
-    // Attribute
-    // =========
-    protected FacilityContentDao _dao;
-
-    //==========================================================================
-    // =========
     // Table name
     // ==========
     /** @return The name on database of table. (NotNull) */
@@ -83,39 +75,18 @@
     // =========
     // DBMeta
     // ======
-    /** @return The meta data of the database. (NotNull) */
+    /** @return The instance of DBMeta. (NotNull) */
     public DBMeta getDBMeta() {
         return FacilityContentDbm.getInstance();
     }
 
-    /** @return The meta data of the database as my table type. (NotNull) */
+    /** @return The instance of DBMeta as my table type. (NotNull) */
     public FacilityContentDbm getMyDBMeta() {
         return FacilityContentDbm.getInstance();
     }
 
     //==========================================================================
     // =========
-    // Dao Accessor
-    // ============
-    public FacilityContentDao getMyDao() {
-        return _dao;
-    }
-
-    public void setMyDao(FacilityContentDao dao) {
-        assertObjectNotNull("dao", dao);
-        _dao = dao;
-    }
-
-    public DaoReadable getDaoReadable() {
-        return getMyDao();
-    }
-
-    public DaoWritable getDaoWritable() {
-        return getMyDao();
-    }
-
-    //==========================================================================
-    // =========
     // New Instance
     // ============
     public Entity newEntity() {
@@ -145,7 +116,7 @@
      * @return The selected count.
      */
     public int selectCount(FacilityContentCB cb) {
-        assertConditionBeanNotNull(cb);
+        assertCBNotNull(cb);
         return delegateSelectCount(cb);
     }
 
@@ -226,7 +197,7 @@
      * @return The result bean of selected list. (NotNull)
      */
     public ListResultBean selectList(FacilityContentCB cb) {
-        assertConditionBeanNotNull(cb);
+        assertCBNotNull(cb);
         return new ResultBeanBuilder(getTableDbName())
                 .buildListResultBean(cb, delegateSelectList(cb));
     }
@@ -243,7 +214,7 @@
      */
     public PagingResultBean selectPage(
             final FacilityContentCB cb) {
-        assertConditionBeanNotNull(cb);
+        assertCBNotNull(cb);
         final PagingInvoker invoker = new PagingInvoker(
                 getTableDbName());
         final PagingHandler handler = new PagingHandler() {
@@ -264,6 +235,32 @@
 
     //==========================================================================
     // =========
+    // Scalar Select
+    // =============
+    /**
+     * Select the scalar value derived by a function. 
Call a function + * method after this method called like as follows: + * + *
+     * facilityContentBhv.scalarSelect(Date.class).max(new ScalarQuery(FacilityContentCB cb) {
+     *     cb.specify().columnXxxDatetime(); // the required specification of target column
+     *     cb.query().setXxxName_PrefixSearch("S"); // query as you like it
+     * });
+     * 
+ * + * @param The type of result. + * @param resultType The type of result. (NotNull) + * @return The scalar value derived by a function. (Nullable) + */ + public SLFunction scalarSelect( + Class resultType) { + FacilityContentCB cb = newMyConditionBean(); + cb.xsetupForScalarSelect(); + return new SLFunction(cb, resultType); + } + + //========================================================================== + // ========= // Various Select // ============== /** @@ -273,8 +270,7 @@ * @param valueLabelSetupper The setupper of value-label. (NotNull) * @return The list of value-label. (NotNull) */ - public List> selectValueLabelList( - FacilityContentCB cb, + public List> selectValueLabelList(FacilityContentCB cb, ValueLabelSetupper valueLabelSetupper) { return createValueLabelList(selectList(cb), valueLabelSetupper); } @@ -286,8 +282,8 @@ //========================================================================== // ========= - // Pullout Foreign - // =============== + // Pull out Foreign + // ================ /** * Pull out the list of foreign table 'Facility'. * @@ -486,11 +482,11 @@ */ public int queryUpdate(FacilityContent facilityContent, FacilityContentCB cb) { assertObjectNotNull("facilityContent", facilityContent); - assertConditionBeanNotNull(cb); + assertCBNotNull(cb); setupCommonColumnOfUpdateIfNeeds(facilityContent); filterEntityOfUpdate(facilityContent); assertEntityOfUpdate(facilityContent); - return getMyDao().updateByQuery(cb, facilityContent); + return invoke(createQueryUpdateEntityCBCommand(facilityContent, cb)); } /** @@ -500,8 +496,8 @@ * @return The deleted count. */ public int queryDelete(FacilityContentCB cb) { - assertConditionBeanNotNull(cb); - return getMyDao().deleteByQuery(cb); + assertCBNotNull(cb); + return invoke(createQueryDeleteCBCommand(cb)); } //========================================================================== @@ -513,19 +509,27 @@ // ========= // Delegate Method // =============== + // [Behavior Command] // ----------------------------------------------------- // Select // ------ protected int delegateSelectCount(FacilityContentCB cb) { - assertConditionBeanNotNull(cb); - return getMyDao().selectCount(cb); + return invoke(createSelectCountCBCommand(cb)); } + protected int doCallReadCount(ConditionBean cb) { + return delegateSelectCount((FacilityContentCB) cb); + } + protected List delegateSelectList(FacilityContentCB cb) { - assertConditionBeanNotNull(cb); - return getMyDao().selectList(cb); + return invoke(createSelectListCBCommand(cb, FacilityContent.class)); } + @SuppressWarnings("unchecked") + protected List doCallReadList(ConditionBean cb) { + return (List) delegateSelectList((FacilityContentCB) cb); + } + // ----------------------------------------------------- // Update // ------ @@ -533,38 +537,71 @@ if (!processBeforeInsert(e)) { return 1; } - return getMyDao().insert(e); + return invoke(createInsertEntityCommand(e)); } + protected int doCallCreate(Entity entity) { + return delegateInsert(downcast(entity)); + } + protected int delegateUpdate(FacilityContent e) { if (!processBeforeUpdate(e)) { return 1; } - return getMyDao().updateModifiedOnly(e); + return invoke(createUpdateEntityCommand(e)); } + protected int doCallModify(Entity entity) { + return delegateUpdate(downcast(entity)); + } + protected int delegateDelete(FacilityContent e) { if (!processBeforeDelete(e)) { return 1; } - return getMyDao().delete(e); + return invoke(createDeleteEntityCommand(e)); } + protected int doCallRemove(Entity entity) { + return delegateDelete(downcast(entity)); + } + protected int[] delegateInsertList(List ls) { - assertObjectNotNull("facilityContentList", ls); - return getMyDao().insertList(helpFilterBeforeInsertInternally(ls)); + if (ls.isEmpty()) { + return new int[] {}; + } + return invoke(createBatchInsertEntityCommand(helpFilterBeforeInsertInternally(ls))); } + @SuppressWarnings("unchecked") + protected int[] doCreateList(List ls) { + return delegateInsertList((List) ls); + } + protected int[] delegateUpdateList(List ls) { - assertObjectNotNull("facilityContentList", ls); - return getMyDao().updateList(helpFilterBeforeUpdateInternally(ls)); + if (ls.isEmpty()) { + return new int[] {}; + } + return invoke(createBatchUpdateEntityCommand(helpFilterBeforeUpdateInternally(ls))); } + @SuppressWarnings("unchecked") + protected int[] doModifyList(List ls) { + return delegateUpdateList((List) ls); + } + protected int[] delegateDeleteList(List ls) { - assertObjectNotNull("facilityContentList", ls); - return getMyDao().deleteList(helpFilterBeforeDeleteInternally(ls)); + if (ls.isEmpty()) { + return new int[] {}; + } + return invoke(createBatchDeleteEntityCommand(helpFilterBeforeDeleteInternally(ls))); } + @SuppressWarnings("unchecked") + protected int[] doRemoveList(List ls) { + return delegateDeleteList((List) ls); + } + //========================================================================== // ========= // Optimistic Lock Info Modified: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/bsbhv/BsFacilityGroupBhv.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/bsbhv/BsFacilityGroupBhv.java 2008-12-27 22:14:41 UTC (rev 1629) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/bsbhv/BsFacilityGroupBhv.java 2008-12-27 22:18:30 UTC (rev 1630) @@ -1,9 +1,8 @@ package jp.sf.pal.scheduler.db.bsbhv; import java.util.List; +import java.util.Map; -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; @@ -20,12 +19,11 @@ import jp.sf.pal.scheduler.db.cbean.FacilityCB; import jp.sf.pal.scheduler.db.cbean.FacilityGroupCB; import jp.sf.pal.scheduler.db.exbhv.FacilityBhv; -import jp.sf.pal.scheduler.db.exdao.FacilityGroupDao; import jp.sf.pal.scheduler.db.exentity.Facility; import jp.sf.pal.scheduler.db.exentity.FacilityGroup; /** - * The behavior of FACILITY_GROUP. + * The behavior of FACILITY_GROUP that the type is TABLE.
* *
  * [primary-key]
@@ -70,12 +68,6 @@
 
     //==========================================================================
     // =========
-    // Attribute
-    // =========
-    protected FacilityGroupDao _dao;
-
-    //==========================================================================
-    // =========
     // Table name
     // ==========
     /** @return The name on database of table. (NotNull) */
@@ -87,39 +79,18 @@
     // =========
     // DBMeta
     // ======
-    /** @return The meta data of the database. (NotNull) */
+    /** @return The instance of DBMeta. (NotNull) */
     public DBMeta getDBMeta() {
         return FacilityGroupDbm.getInstance();
     }
 
-    /** @return The meta data of the database as my table type. (NotNull) */
+    /** @return The instance of DBMeta as my table type. (NotNull) */
     public FacilityGroupDbm getMyDBMeta() {
         return FacilityGroupDbm.getInstance();
     }
 
     //==========================================================================
     // =========
-    // Dao Accessor
-    // ============
-    public FacilityGroupDao getMyDao() {
-        return _dao;
-    }
-
-    public void setMyDao(FacilityGroupDao dao) {
-        assertObjectNotNull("dao", dao);
-        _dao = dao;
-    }
-
-    public DaoReadable getDaoReadable() {
-        return getMyDao();
-    }
-
-    public DaoWritable getDaoWritable() {
-        return getMyDao();
-    }
-
-    //==========================================================================
-    // =========
     // New Instance
     // ============
     public Entity newEntity() {
@@ -149,7 +120,7 @@
      * @return The selected count.
      */
     public int selectCount(FacilityGroupCB cb) {
-        assertConditionBeanNotNull(cb);
+        assertCBNotNull(cb);
         return delegateSelectCount(cb);
     }
 
@@ -229,7 +200,7 @@
      * @return The result bean of selected list. (NotNull)
      */
     public ListResultBean selectList(FacilityGroupCB cb) {
-        assertConditionBeanNotNull(cb);
+        assertCBNotNull(cb);
         return new ResultBeanBuilder(getTableDbName())
                 .buildListResultBean(cb, delegateSelectList(cb));
     }
@@ -245,7 +216,7 @@
      * @return The result bean of selected page. (NotNull)
      */
     public PagingResultBean selectPage(final FacilityGroupCB cb) {
-        assertConditionBeanNotNull(cb);
+        assertCBNotNull(cb);
         final PagingInvoker invoker = new PagingInvoker(
                 getTableDbName());
         final PagingHandler handler = new PagingHandler() {
@@ -266,6 +237,32 @@
 
     //==========================================================================
     // =========
+    // Scalar Select
+    // =============
+    /**
+     * Select the scalar value derived by a function. 
Call a function + * method after this method called like as follows: + * + *
+     * facilityGroupBhv.scalarSelect(Date.class).max(new ScalarQuery(FacilityGroupCB cb) {
+     *     cb.specify().columnXxxDatetime(); // the required specification of target column
+     *     cb.query().setXxxName_PrefixSearch("S"); // query as you like it
+     * });
+     * 
+ * + * @param The type of result. + * @param resultType The type of result. (NotNull) + * @return The scalar value derived by a function. (Nullable) + */ + public SLFunction scalarSelect( + Class resultType) { + FacilityGroupCB cb = newMyConditionBean(); + cb.xsetupForScalarSelect(); + return new SLFunction(cb, resultType); + } + + //========================================================================== + // ========= // Various Select // ============== /** @@ -275,8 +272,7 @@ * @param valueLabelSetupper The setupper of value-label. (NotNull) * @return The list of value-label. (NotNull) */ - public List> selectValueLabelList( - FacilityGroupCB cb, + public List> selectValueLabelList(FacilityGroupCB cb, ValueLabelSetupper valueLabelSetupper) { return createValueLabelList(selectList(cb), valueLabelSetupper); } @@ -379,8 +375,8 @@ //========================================================================== // ========= - // Pullout Foreign - // =============== + // Pull out Foreign + // ================ //========================================================================== // ========= @@ -683,11 +679,11 @@ */ public int queryUpdate(FacilityGroup facilityGroup, FacilityGroupCB cb) { assertObjectNotNull("facilityGroup", facilityGroup); - assertConditionBeanNotNull(cb); + assertCBNotNull(cb); setupCommonColumnOfUpdateIfNeeds(facilityGroup); filterEntityOfUpdate(facilityGroup); assertEntityOfUpdate(facilityGroup); - return getMyDao().updateByQuery(cb, facilityGroup); + return invoke(createQueryUpdateEntityCBCommand(facilityGroup, cb)); } /** @@ -697,8 +693,8 @@ * @return The deleted count. */ public int queryDelete(FacilityGroupCB cb) { - assertConditionBeanNotNull(cb); - return getMyDao().deleteByQuery(cb); + assertCBNotNull(cb); + return invoke(createQueryDeleteCBCommand(cb)); } //========================================================================== @@ -710,19 +706,27 @@ // ========= // Delegate Method // =============== + // [Behavior Command] // ----------------------------------------------------- // Select // ------ protected int delegateSelectCount(FacilityGroupCB cb) { - assertConditionBeanNotNull(cb); - return getMyDao().selectCount(cb); + return invoke(createSelectCountCBCommand(cb)); } + protected int doCallReadCount(ConditionBean cb) { + return delegateSelectCount((FacilityGroupCB) cb); + } + protected List delegateSelectList(FacilityGroupCB cb) { - assertConditionBeanNotNull(cb); - return getMyDao().selectList(cb); + return invoke(createSelectListCBCommand(cb, FacilityGroup.class)); } + @SuppressWarnings("unchecked") + protected List doCallReadList(ConditionBean cb) { + return (List) delegateSelectList((FacilityGroupCB) cb); + } + // ----------------------------------------------------- // Update // ------ @@ -730,62 +734,97 @@ if (!processBeforeInsert(e)) { return 1; } - return getMyDao().insert(e); + return invoke(createInsertEntityCommand(e)); } + protected int doCallCreate(Entity entity) { + return delegateInsert(downcast(entity)); + } + protected int delegateUpdate(FacilityGroup e) { if (!processBeforeUpdate(e)) { return 1; } - return getMyDao().updateModifiedOnly(e); + return invoke(createUpdateEntityCommand(e)); } + protected int doCallModify(Entity entity) { + return delegateUpdate(downcast(entity)); + } + protected int delegateUpdateNonstrict(FacilityGroup e) { if (!processBeforeUpdate(e)) { return 1; } - return getMyDao().updateNonstrictModifiedOnly(e); + return invoke(createUpdateNonstrictEntityCommand(e)); } protected int delegateDelete(FacilityGroup e) { if (!processBeforeDelete(e)) { return 1; } - return getMyDao().delete(e); + return invoke(createDeleteEntityCommand(e)); } + protected int doCallRemove(Entity entity) { + return delegateDelete(downcast(entity)); + } + protected int delegateDeleteNonstrict(FacilityGroup e) { if (!processBeforeDelete(e)) { return 1; } - return getMyDao().deleteNonstrict(e); + return invoke(createDeleteNonstrictEntityCommand(e)); } protected int[] delegateInsertList(List ls) { - assertObjectNotNull("facilityGroupList", ls); - return getMyDao().insertList(helpFilterBeforeInsertInternally(ls)); + if (ls.isEmpty()) { + return new int[] {}; + } + return invoke(createBatchInsertEntityCommand(helpFilterBeforeInsertInternally(ls))); } + @SuppressWarnings("unchecked") + protected int[] doCreateList(List ls) { + return delegateInsertList((List) ls); + } + protected int[] delegateUpdateList(List ls) { - assertObjectNotNull("facilityGroupList", ls); - return getMyDao().updateList(helpFilterBeforeUpdateInternally(ls)); + if (ls.isEmpty()) { + return new int[] {}; + } + return invoke(createBatchUpdateEntityCommand(helpFilterBeforeUpdateInternally(ls))); } + @SuppressWarnings("unchecked") + protected int[] doModifyList(List ls) { + return delegateUpdateList((List) ls); + } + protected int[] delegateUpdateListNonstrict(List ls) { - assertObjectNotNull("facilityGroupList", ls); - return getMyDao().updateListNonstrict( - helpFilterBeforeUpdateInternally(ls)); + if (ls.isEmpty()) { + return new int[] {}; + } + return invoke(createBatchUpdateNonstrictEntityCommand(helpFilterBeforeUpdateInternally(ls))); } protected int[] delegateDeleteList(List ls) { - assertObjectNotNull("facilityGroupList", ls); - return getMyDao().deleteList(helpFilterBeforeDeleteInternally(ls)); + if (ls.isEmpty()) { + return new int[] {}; + } + return invoke(createBatchDeleteEntityCommand(helpFilterBeforeDeleteInternally(ls))); } + @SuppressWarnings("unchecked") + protected int[] doRemoveList(List ls) { + return delegateDeleteList((List) ls); + } + protected int[] delegateDeleteListNonstrict(List ls) { - assertObjectNotNull("facilityGroupList", ls); - return getMyDao().deleteListNonstrict( - helpFilterBeforeDeleteInternally(ls)); + if (ls.isEmpty()) { + return new int[] {}; + } + return invoke(createBatchDeleteNonstrictEntityCommand(helpFilterBeforeDeleteInternally(ls))); } //========================================================================== Modified: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/bsbhv/BsFacilityScheduleMappingBhv.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/bsbhv/BsFacilityScheduleMappingBhv.java 2008-12-27 22:14:41 UTC (rev 1629) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/bsbhv/BsFacilityScheduleMappingBhv.java 2008-12-27 22:18:30 UTC (rev 1630) @@ -1,9 +1,8 @@ package jp.sf.pal.scheduler.db.bsbhv; import java.util.List; +import java.util.Map; -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; @@ -16,13 +15,12 @@ import jp.sf.pal.scheduler.db.allcommon.dbmeta.DBMeta; import jp.sf.pal.scheduler.db.bsentity.dbmeta.FacilityScheduleMappingDbm; import jp.sf.pal.scheduler.db.cbean.FacilityScheduleMappingCB; -import jp.sf.pal.scheduler.db.exdao.FacilityScheduleMappingDao; import jp.sf.pal.scheduler.db.exentity.EventSchedule; import jp.sf.pal.scheduler.db.exentity.Facility; import jp.sf.pal.scheduler.db.exentity.FacilityScheduleMapping; /** - * The behavior of FACILITY_SCHEDULE_MAPPING. + * The behavior of FACILITY_SCHEDULE_MAPPING that the type is TABLE.
* *
  * [primary-key]
@@ -67,12 +65,6 @@
 
     //==========================================================================
     // =========
-    // Attribute
-    // =========
-    protected FacilityScheduleMappingDao _dao;
-
-    //==========================================================================
-    // =========
     // Table name
     // ==========
     /** @return The name on database of table. (NotNull) */
@@ -84,39 +76,18 @@
     // =========
     // DBMeta
     // ======
-    /** @return The meta data of the database. (NotNull) */
+    /** @return The instance of DBMeta. (NotNull) */
     public DBMeta getDBMeta() {
         return FacilityScheduleMappingDbm.getInstance();
     }
 
-    /** @return The meta data of the database as my table type. (NotNull) */
+    /** @return The instance of DBMeta as my table type. (NotNull) */
     public FacilityScheduleMappingDbm getMyDBMeta() {
         return FacilityScheduleMappingDbm.getInstance();
     }
 
     //==========================================================================
     // =========
-    // Dao Accessor
-    // ============
-    public FacilityScheduleMappingDao getMyDao() {
-        return _dao;
-    }
-
-    public void setMyDao(FacilityScheduleMappingDao dao) {
-        assertObjectNotNull("dao", dao);
-        _dao = dao;
-    }
-
-    public DaoReadable getDaoReadable() {
-        return getMyDao();
-    }
-
-    public DaoWritable getDaoWritable() {
-        return getMyDao();
-    }
-
-    //==========================================================================
-    // =========
     // New Instance
     // ============
     public Entity newEntity() {
@@ -146,7 +117,7 @@
      * @return The selected count.
      */
     public int selectCount(FacilityScheduleMappingCB cb) {
-        assertConditionBeanNotNull(cb);
+        assertCBNotNull(cb);
         return delegateSelectCount(cb);
     }
 
@@ -229,7 +200,7 @@
      */
     public ListResultBean selectList(
             FacilityScheduleMappingCB cb) {
-        assertConditionBeanNotNull(cb);
+        assertCBNotNull(cb);
         return new ResultBeanBuilder(getTableDbName())
                 .buildListResultBean(cb, delegateSelectList(cb));
     }
@@ -246,7 +217,7 @@
      */
     public PagingResultBean selectPage(
             final FacilityScheduleMappingCB cb) {
-        assertConditionBeanNotNull(cb);
+        assertCBNotNull(cb);
         final PagingInvoker invoker = new PagingInvoker(
                 getTableDbName());
         final PagingHandler handler = new PagingHandler() {
@@ -267,6 +238,32 @@
 
     //==========================================================================
     // =========
+    // Scalar Select
+    // =============
+    /**
+     * Select the scalar value derived by a function. 
Call a function + * method after this method called like as follows: + * + *
+     * facilityScheduleMappingBhv.scalarSelect(Date.class).max(new ScalarQuery(FacilityScheduleMappingCB cb) {
+     *     cb.specify().columnXxxDatetime(); // the required specification of target column
+     *     cb.query().setXxxName_PrefixSearch("S"); // query as you like it
+     * });
+     * 
+ * + * @param The type of result. + * @param resultType The type of result. (NotNull) + * @return The scalar value derived by a function. (Nullable) + */ + public SLFunction scalarSelect( + Class resultType) { + FacilityScheduleMappingCB cb = newMyConditionBean(); + cb.xsetupForScalarSelect(); + return new SLFunction(cb, resultType); + } + + //========================================================================== + // ========= // Various Select // ============== /** @@ -276,7 +273,7 @@ * @param valueLabelSetupper The setupper of value-label. (NotNull) * @return The list of value-label. (NotNull) */ - public List> selectValueLabelList( + public List> selectValueLabelList( FacilityScheduleMappingCB cb, ValueLabelSetupper valueLabelSetupper) { return createValueLabelList(selectList(cb), valueLabelSetupper); @@ -289,8 +286,8 @@ //========================================================================== // ========= - // Pullout Foreign - // =============== + // Pull out Foreign + // ================ /** * Pull out the list of foreign table 'EventSchedule'. * @@ -521,11 +518,12 @@ public int queryUpdate(FacilityScheduleMapping facilityScheduleMapping, FacilityScheduleMappingCB cb) { assertObjectNotNull("facilityScheduleMapping", facilityScheduleMapping); - assertConditionBeanNotNull(cb); + assertCBNotNull(cb); setupCommonColumnOfUpdateIfNeeds(facilityScheduleMapping); filterEntityOfUpdate(facilityScheduleMapping); assertEntityOfUpdate(facilityScheduleMapping); - return getMyDao().updateByQuery(cb, facilityScheduleMapping); + return invoke(createQueryUpdateEntityCBCommand(facilityScheduleMapping, + cb)); } /** @@ -535,8 +533,8 @@ * @return The deleted count. */ public int queryDelete(FacilityScheduleMappingCB cb) { - assertConditionBeanNotNull(cb); - return getMyDao().deleteByQuery(cb); + assertCBNotNull(cb); + return invoke(createQueryDeleteCBCommand(cb)); } //========================================================================== @@ -548,20 +546,29 @@ // ========= // Delegate Method // =============== + // [Behavior Command] // ----------------------------------------------------- // Select // ------ protected int delegateSelectCount(FacilityScheduleMappingCB cb) { - assertConditionBeanNotNull(cb); - return getMyDao().selectCount(cb); + return invoke(createSelectCountCBCommand(cb)); } + protected int doCallReadCount(ConditionBean cb) { + return delegateSelectCount((FacilityScheduleMappingCB) cb); + } + protected List delegateSelectList( FacilityScheduleMappingCB cb) { - assertConditionBeanNotNull(cb); - return getMyDao().selectList(cb); + return invoke(createSelectListCBCommand(cb, + FacilityScheduleMapping.class)); } + @SuppressWarnings("unchecked") + protected List doCallReadList(ConditionBean cb) { + return (List) delegateSelectList((FacilityScheduleMappingCB) cb); + } + // ----------------------------------------------------- // Update // ------ @@ -569,38 +576,71 @@ if (!processBeforeInsert(e)) { return 1; } - return getMyDao().insert(e); + return invoke(createInsertEntityCommand(e)); } + protected int doCallCreate(Entity entity) { + return delegateInsert(downcast(entity)); + } + protected int delegateUpdate(FacilityScheduleMapping e) { if (!processBeforeUpdate(e)) { return 1; } - return getMyDao().updateModifiedOnly(e); + return invoke(createUpdateEntityCommand(e)); } + protected int doCallModify(Entity entity) { + return delegateUpdate(downcast(entity)); + } + protected int delegateDelete(FacilityScheduleMapping e) { if (!processBeforeDelete(e)) { return 1; } - return getMyDao().delete(e); + return invoke(createDeleteEntityCommand(e)); } + protected int doCallRemove(Entity entity) { + return delegateDelete(downcast(entity)); + } + protected int[] delegateInsertList(List ls) { - assertObjectNotNull("facilityScheduleMappingList", ls); - return getMyDao().insertList(helpFilterBeforeInsertInternally(ls)); + if (ls.isEmpty()) { + return new int[] {}; + } + return invoke(createBatchInsertEntityCommand(helpFilterBeforeInsertInternally(ls))); } + @SuppressWarnings("unchecked") + protected int[] doCreateList(List ls) { + return delegateInsertList((List) ls); + } + protected int[] delegateUpdateList(List ls) { - assertObjectNotNull("facilityScheduleMappingList", ls); - return getMyDao().updateList(helpFilterBeforeUpdateInternally(ls)); + if (ls.isEmpty()) { + return new int[] {}; + } + return invoke(createBatchUpdateEntityCommand(helpFilterBeforeUpdateInternally(ls))); } + @SuppressWarnings("unchecked") + protected int[] doModifyList(List ls) { + return delegateUpdateList((List) ls); + } + protected int[] delegateDeleteList(List ls) { - assertObjectNotNull("facilityScheduleMappingList", ls); - return getMyDao().deleteList(helpFilterBeforeDeleteInternally(ls)); + if (ls.isEmpty()) { + return new int[] {}; + } + return invoke(createBatchDeleteEntityCommand(helpFilterBeforeDeleteInternally(ls))); } + @SuppressWarnings("unchecked") + protected int[] doRemoveList(List ls) { + return delegateDeleteList((List) ls); + } + //========================================================================== // ========= // Optimistic Lock Info Modified: 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 2008-12-27 22:14:41 UTC (rev 1629) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/bsbhv/BsGroupInfoBhv.java 2008-12-27 22:18:30 UTC (rev 1630) @@ -1,9 +1,8 @@ package jp.sf.pal.scheduler.db.bsbhv; import java.util.List; +import java.util.Map; -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; @@ -22,13 +21,12 @@ 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. + * The behavior of GROUP_INFO that the type is TABLE.
* *
  * [primary-key]
@@ -73,12 +71,6 @@
 
     //==========================================================================
     // =========
-    // Attribute
-    // =========
-    protected GroupInfoDao _dao;
-
-    //==========================================================================
-    // =========
     // Table name
     // ==========
     /** @return The name on database of table. (NotNull) */
@@ -90,39 +82,18 @@
     // =========
     // DBMeta
     // ======
-    /** @return The meta data of the database. (NotNull) */
+    /** @return The instance of DBMeta. (NotNull) */
     public DBMeta getDBMeta() {
         return GroupInfoDbm.getInstance();
     }
 
-    /** @return The meta data of the database as my table type. (NotNull) */
+    /** @return The instance of DBMeta as my table type. (NotNull) */
     public GroupInfoDbm getMyDBMeta() {
         return GroupInfoDbm.getInstance();
     }
 
     //==========================================================================
     // =========
-    // Dao Accessor
-    // ============
-    public GroupInfoDao getMyDao() {
-        return _dao;
-    }
-
-    public void setMyDao(GroupInfoDao dao) {
-        assertObjectNotNull("dao", dao);
-        _dao = dao;
-    }
-
-    public DaoReadable getDaoReadable() {
-        return getMyDao();
-    }
-
-    public DaoWritable getDaoWritable() {
-        return getMyDao();
-    }
-
-    //==========================================================================
-    // =========
     // New Instance
     // ============
     public Entity newEntity() {
@@ -152,7 +123,7 @@
      * @return The selected count.
      */
     public int selectCount(GroupInfoCB cb) {
-        assertConditionBeanNotNull(cb);
+        assertCBNotNull(cb);
         return delegateSelectCount(cb);
     }
 
@@ -229,7 +200,7 @@
      * @return The result bean of selected list. (NotNull)
      */
     public ListResultBean selectList(GroupInfoCB cb) {
-        assertConditionBeanNotNull(cb);
+        assertCBNotNull(cb);
         return new ResultBeanBuilder(getTableDbName())
                 .buildListResultBean(cb, delegateSelectList(cb));
     }
@@ -245,7 +216,7 @@
      * @return The result bean of selected page. (NotNull)
      */
     public PagingResultBean selectPage(final GroupInfoCB cb) {
-        assertConditionBeanNotNull(cb);
+        assertCBNotNull(cb);
         final PagingInvoker invoker = new PagingInvoker(
                 getTableDbName());
         final PagingHandler handler = new PagingHandler() {
@@ -266,6 +237,32 @@
 
     //==========================================================================
     // =========
+    // Scalar Select
+    // =============
+    /**
+     * Select the scalar value derived by a function. 
Call a function + * method after this method called like as follows: + * + *
+     * groupInfoBhv.scalarSelect(Date.class).max(new ScalarQuery(GroupInfoCB cb) {
+     *     cb.specify().columnXxxDatetime(); // the required specification of target column
+     *     cb.query().setXxxName_PrefixSearch("S"); // query as you like it
+     * });
+     * 
+ * + * @param The type of result. + * @param resultType The type of result. (NotNull) + * @return The scalar value derived by a function. (Nullable) + */ + public SLFunction scalarSelect( + Class resultType) { + GroupInfoCB cb = newMyConditionBean(); + cb.xsetupForScalarSelect(); + return new SLFunction(cb, resultType); + } + + //========================================================================== + // ========= // Various Select // ============== /** @@ -275,8 +272,8 @@ * @param valueLabelSetupper The setupper of value-label. (NotNull) * @return The list of value-label. (NotNull) */ - public List> selectValueLabelList( - GroupInfoCB cb, ValueLabelSetupper valueLabelSetupper) { + public List> selectValueLabelList(GroupInfoCB cb, + ValueLabelSetupper valueLabelSetupper) { return createValueLabelList(selectList(cb), valueLabelSetupper); } @@ -467,8 +464,8 @@ //========================================================================== // ========= - // Pullout Foreign - // =============== + // Pull out Foreign + // ================ //========================================================================== // ========= @@ -766,11 +763,11 @@ */ public int queryUpdate(GroupInfo groupInfo, GroupInfoCB cb) { assertObjectNotNull("groupInfo", groupInfo); - assertConditionBeanNotNull(cb); + assertCBNotNull(cb); setupCommonColumnOfUpdateIfNeeds(groupInfo); filterEntityOfUpdate(groupInfo); assertEntityOfUpdate(groupInfo); - return getMyDao().updateByQuery(cb, groupInfo); + return invoke(createQueryUpdateEntityCBCommand(groupInfo, cb)); } /** @@ -780,8 +777,8 @@ * @return The deleted count. */ public int queryDelete(GroupInfoCB cb) { - assertConditionBeanNotNull(cb); - return getMyDao().deleteByQuery(cb); + assertCBNotNull(cb); + return invoke(createQueryDeleteCBCommand(cb)); } //========================================================================== @@ -793,19 +790,27 @@ // ========= // Delegate Method // =============== + // [Behavior Command] // ----------------------------------------------------- // Select // ------ protected int delegateSelectCount(GroupInfoCB cb) { - assertConditionBeanNotNull(cb); - return getMyDao().selectCount(cb); + return invoke(createSelectCountCBCommand(cb)); } + protected int doCallReadCount(ConditionBean cb) { + return delegateSelectCount((GroupInfoCB) cb); + } + protected List delegateSelectList(GroupInfoCB cb) { - assertConditionBeanNotNull(cb); - return getMyDao().selectList(cb); + return invoke(createSelectListCBCommand(cb, GroupInfo.class)); } + @SuppressWarnings("unchecked") + protected List doCallReadList(ConditionBean cb) { + return (List) delegateSelectList((GroupInfoCB) cb); + } + // ----------------------------------------------------- // Update // ------ @@ -813,62 +818,97 @@ if (!processBeforeInsert(e)) { return 1; } - return getMyDao().insert(e); + return invoke(createInsertEntityCommand(e)); } + protected int doCallCreate(Entity entity) { + return delegateInsert(downcast(entity)); + } + protected int delegateUpdate(GroupInfo e) { if (!processBeforeUpdate(e)) { return 1; } - return getMyDao().updateModifiedOnly(e); + return invoke(createUpdateEntityCommand(e)); } + protected int doCallModify(Entity entity) { + return delegateUpdate(downcast(entity)); + } + protected int delegateUpdateNonstrict(GroupInfo e) { if (!processBeforeUpdate(e)) { return 1; } - return getMyDao().updateNonstrictModifiedOnly(e); + return invoke(createUpdateNonstrictEntityCommand(e)); } protected int delegateDelete(GroupInfo e) { if (!processBeforeDelete(e)) { return 1; } - return getMyDao().delete(e); + return invoke(createDeleteEntityCommand(e)); } + protected int doCallRemove(Entity entity) { + return delegateDelete(downcast(entity)); + } + protected int delegateDeleteNonstrict(GroupInfo e) { if (!processBeforeDelete(e)) { return 1; } - return getMyDao().deleteNonstrict(e); + return invoke(createDeleteNonstrictEntityCommand(e)); } protected int[] delegateInsertList(List ls) { - assertObjectNotNull("groupInfoList", ls); - return getMyDao().insertList(helpFilterBeforeInsertInternally(ls)); + if (ls.isEmpty()) { + return new int[] {}; + } + return invoke(createBatchInsertEntityCommand(helpFilterBeforeInsertInternally(ls))); } + @SuppressWarnings("unchecked") + protected int[] doCreateList(List ls) { + return delegateInsertList((List) ls); + } + protected int[] delegateUpdateList(List ls) { - assertObjectNotNull("groupInfoList", ls); - return getMyDao().updateList(helpFilterBeforeUpdateInternally(ls)); + if (ls.isEmpty()) { + return new int[] {}; + } + return invoke(createBatchUpdateEntityCommand(helpFilterBeforeUpdateInternally(ls))); } + @SuppressWarnings("unchecked") + protected int[] doModifyList(List ls) { + return delegateUpdateList((List) ls); + } + protected int[] delegateUpdateListNonstrict(List ls) { - assertObjectNotNull("groupInfoList", ls); - return getMyDao().updateListNonstrict( - helpFilterBeforeUpdateInternally(ls)); + if (ls.isEmpty()) { + return new int[] {}; + } + return invoke(createBatchUpdateNonstrictEntityCommand(helpFilterBeforeUpdateInternally(ls))); } protected int[] delegateDeleteList(List ls) { - assertObjectNotNull("groupInfoList", ls); - return getMyDao().deleteList(helpFilterBeforeDeleteInternally(ls)); + if (ls.isEmpty()) { + return new int[] {}; + } + return invoke(createBatchDeleteEntityCommand(helpFilterBeforeDeleteInternally(ls))); } + @SuppressWarnings("unchecked") + protected int[] doRemoveList(List ls) { + return delegateDeleteList((List) ls); + } + protected int[] delegateDeleteListNonstrict(List ls) { - assertObjectNotNull("groupInfoList", ls); - return getMyDao().deleteListNonstrict( - helpFilterBeforeDeleteInternally(ls)); + if (ls.isEmpty()) { + return new int[] {}; + } + return invoke(createBatchDeleteNonstrictEntityCommand(helpFilterBeforeDeleteInternally(ls))); } //========================================================================== Modified: 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 2008-12-27 22:14:41 UTC (rev 1629) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/bsbhv/BsGroupMappingBhv.java 2008-12-27 22:18:30 UTC (rev 1630) @@ -1,9 +1,8 @@ package jp.sf.pal.scheduler.db.bsbhv; import java.util.List; +import java.util.Map; -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; @@ -16,13 +15,12 @@ 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. + * The behavior of GROUP_MAPPING that the type is TABLE.
* *
  * [primary-key]
@@ -67,12 +65,6 @@
 
     //==========================================================================
     // =========
-    // Attribute
-    // =========
-    protected GroupMappingDao _dao;
-
-    //==========================================================================
-    // =========
     // Table name
     // ==========
     /** @return The name on database of table. (NotNull) */
@@ -84,39 +76,18 @@
     // =========
     // DBMeta
     // ======
-    /** @return The meta data of the database. (NotNull) */
+    /** @return The instance of DBMeta. (NotNull) */
     public DBMeta getDBMeta() {
         return GroupMappingDbm.getInstance();
     }
 
-    /** @return The meta data of the database as my table type. (NotNull) */
+    /** @return The instance of DBMeta as my table type. (NotNull) */
     public GroupMappingDbm getMyDBMeta() {
         return GroupMappingDbm.getInstance();
     }
 
     //==========================================================================
     // =========
-    // Dao Accessor
-    // ============
-    public GroupMappingDao getMyDao() {
-        return _dao;
-    }
-
-    public void setMyDao(GroupMappingDao dao) {
-        assertObjectNotNull("dao", dao);
-        _dao = dao;
-    }
-
-    public DaoReadable getDaoReadable() {
-        return getMyDao();
-    }
-
-    public DaoWritable getDaoWritable() {
-        return getMyDao();
-    }
-
-    //==========================================================================
-    // =========
     // New Instance
     // ============
     public Entity newEntity() {
@@ -146,7 +117,7 @@
      * @return The selected count.
      */
     public int selectCount(GroupMappingCB cb) {
-        assertConditionBeanNotNull(cb);
+        assertCBNotNull(cb);
         return delegateSelectCount(cb);
     }
 
@@ -226,7 +197,7 @@
      * @return The result bean of selected list. (NotNull)
      */
     public ListResultBean selectList(GroupMappingCB cb) {
-        assertConditionBeanNotNull(cb);
+        assertCBNotNull(cb);
         return new ResultBeanBuilder(getTableDbName())
                 .buildListResultBean(cb, delegateSelectList(cb));
     }
@@ -242,7 +213,7 @@
      * @return The result bean of selected page. (NotNull)
      */
     public PagingResultBean selectPage(final GroupMappingCB cb) {
-        assertConditionBeanNotNull(cb);
+        assertCBNotNull(cb);
         final PagingInvoker invoker = new PagingInvoker(
                 getTableDbName());
         final PagingHandler handler = new PagingHandler() {
@@ -263,6 +234,32 @@
 
     //==========================================================================
     // =========
+    // Scalar Select
+    // =============
+    /**
+     * Select the scalar value derived by a function. 
Call a function + * method after this method called like as follows: + * + *
+     * groupMappingBhv.scalarSelect(Date.class).max(new ScalarQuery(GroupMappingCB cb) {
+     *     cb.specify().columnXxxDatetime(); // the required specification of target column
+     *     cb.query().setXxxName_PrefixSearch("S"); // query as you like it
+     * });
+     * 
+ * + * @param The type of result. + * @param resultType The type of result. (NotNull) + * @return The scalar value derived by a function. (Nullable) + */ + public SLFunction scalarSelect( + Class resultType) { + GroupMappingCB cb = newMyConditionBean(); + cb.xsetupForScalarSelect(); + return new SLFunction(cb, resultType); + } + + //========================================================================== + // ========= // Various Select // ============== /** @@ -272,8 +269,7 @@ * @param valueLabelSetupper The setupper of value-label. (NotNull) * @return The list of value-label. (NotNull) */ - public List> selectValueLabelList( - GroupMappingCB cb, + public List> selectValueLabelList(GroupMappingCB cb, ValueLabelSetupper valueLabelSetupper) { return createValueLabelList(selectList(cb), valueLabelSetupper); } @@ -285,8 +281,8 @@ //========================================================================== // ========= - // Pullout Foreign - // =============== + // Pull out Foreign + // ================ /** * Pull out the list of foreign table 'GroupInfo'. * @@ -499,11 +495,11 @@ */ public int queryUpdate(GroupMapping groupMapping, GroupMappingCB cb) { assertObjectNotNull("groupMapping", groupMapping); - assertConditionBeanNotNull(cb); + assertCBNotNull(cb); setupCommonColumnOfUpdateIfNeeds(groupMapping); filterEntityOfUpdate(groupMapping); assertEntityOfUpdate(groupMapping); - return getMyDao().updateByQuery(cb, groupMapping); + return invoke(createQueryUpdateEntityCBCommand(groupMapping, cb)); } /** @@ -513,8 +509,8 @@ * @return The deleted count. */ public int queryDelete(GroupMappingCB cb) { - assertConditionBeanNotNull(cb); - return getMyDao().deleteByQuery(cb); + assertCBNotNull(cb); + return invoke(createQueryDeleteCBCommand(cb)); } //========================================================================== @@ -526,19 +522,27 @@ // ========= // Delegate Method // =============== + // [Behavior Command] // ----------------------------------------------------- // Select // ------ protected int delegateSelectCount(GroupMappingCB cb) { - assertConditionBeanNotNull(cb); - return getMyDao().selectCount(cb); + return invoke(createSelectCountCBCommand(cb)); } + protected int doCallReadCount(ConditionBean cb) { + return delegateSelectCount((GroupMappingCB) cb); + } + protected List delegateSelectList(GroupMappingCB cb) { - assertConditionBeanNotNull(cb); - return getMyDao().selectList(cb); + return invoke(createSelectListCBCommand(cb, GroupMapping.class)); } + @SuppressWarnings("unchecked") + protected List doCallReadList(ConditionBean cb) { + return (List) delegateSelectList((GroupMappingCB) cb); + } + // ----------------------------------------------------- // Update // ------ @@ -546,38 +550,71 @@ if (!processBeforeInsert(e)) { return 1; } - return getMyDao().insert(e); + return invoke(createInsertEntityCommand(e)); } + protected int doCallCreate(Entity entity) { + return delegateInsert(downcast(entity)); + } + protected int delegateUpdate(GroupMapping e) { if (!processBeforeUpdate(e)) { return 1; } - return getMyDao().updateModifiedOnly(e); + return invoke(createUpdateEntityCommand(e)); } + protected int doCallModify(Entity entity) { + return delegateUpdate(downcast(entity)); + } + protected int delegateDelete(GroupMapping e) { if (!processBeforeDelete(e)) { return 1; } - return getMyDao().delete(e); + return invoke(createDeleteEntityCommand(e)); } + protected int doCallRemove(Entity entity) { + return delegateDelete(downcast(entity)); + } + protected int[] delegateInsertList(List ls) { - assertObjectNotNull("groupMappingList", ls); - return getMyDao().insertList(helpFilterBeforeInsertInternally(ls)); + if (ls.isEmpty()) { + return new int[] {}; + } + return invoke(createBatchInsertEntityCommand(helpFilterBeforeInsertInternally(ls))); } + @SuppressWarnings("unchecked") + protected int[] doCreateList(List ls) { + return delegateInsertList((List) ls); + } + protected int[] delegateUpdateList(List ls) { - assertObjectNotNull("groupMappingList", ls); - return getMyDao().updateList(helpFilterBeforeUpdateInternally(ls)); + if (ls.isEmpty()) { + return new int[] {}; + } + return invoke(createBatchUpdateEntityCommand(helpFilterBeforeUpdateInternally(ls))); } + @SuppressWarnings("unchecked") + protected int[] doModifyList(List ls) { + return delegateUpdateList((List) ls); + } + protected int[] delegateDeleteList(List ls) { - assertObjectNotNull("groupMappingList", ls); - return getMyDao().deleteList(helpFilterBeforeDeleteInternally(ls)); + if (ls.isEmpty()) { + return new int[] {}; + } + return invoke(createBatchDeleteEntityCommand(helpFilterBeforeDeleteInternally(ls))); } + @SuppressWarnings("unchecked") + protected int[] doRemoveList(List ls) { + return delegateDeleteList((List) ls); + } + //========================================================================== // ========= // Optimistic Lock Info Modified: 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 2008-12-27 22:14:41 UTC (rev 1629) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/bsbhv/BsRoleInfoBhv.java 2008-12-27 22:18:30 UTC (rev 1630) @@ -1,9 +1,8 @@ package jp.sf.pal.scheduler.db.bsbhv; import java.util.List; +import java.util.Map; -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; @@ -22,13 +21,12 @@ 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. + * The behavior of ROLE_INFO that the type is TABLE.
* *
  * [primary-key]
@@ -73,12 +71,6 @@
 
     //==========================================================================
     // =========
-    // Attribute
-    // =========
-    protected RoleInfoDao _dao;
-
-    //==========================================================================
-    // =========
     // Table name
     // ==========
     /** @return The name on database of table. (NotNull) */
@@ -90,39 +82,18 @@
     // =========
     // DBMeta
     // ======
-    /** @return The meta data of the database. (NotNull) */
+    /** @return The instance of DBMeta. (NotNull) */
     public DBMeta getDBMeta() {
         return RoleInfoDbm.getInstance();
     }
 
-    /** @return The meta data of the database as my table type. (NotNull) */
+    /** @return The instance of DBMeta as my table type. (NotNull) */
     public RoleInfoDbm getMyDBMeta() {
         return RoleInfoDbm.getInstance();
     }
 
     //==========================================================================
     // =========
-    // Dao Accessor
-    // ============
-    public RoleInfoDao getMyDao() {
-        return _dao;
-    }
-
-    public void setMyDao(RoleInfoDao dao) {
-        assertObjectNotNull("dao", dao);
-        _dao = dao;
-    }
-
-    public DaoReadable getDaoReadable() {
-        return getMyDao();
-    }
-
-    public DaoWritable getDaoWritable() {
-        return getMyDao();
-    }
-
-    //==========================================================================
-    // =========
     // New Instance
     // ============
     public Entity newEntity() {
@@ -152,7 +123,7 @@
      * @return The selected count.
      */
     public int selectCount(RoleInfoCB cb) {
-        assertConditionBeanNotNull(cb);
+        assertCBNotNull(cb);
         return delegateSelectCount(cb);
     }
 
@@ -229,7 +200,7 @@
      * @return The result bean of selected list. (NotNull)
      */
     public ListResultBean selectList(RoleInfoCB cb) {
-        assertConditionBeanNotNull(cb);
+        assertCBNotNull(cb);
         return new ResultBeanBuilder(getTableDbName())
                 .buildListResultBean(cb, delegateSelectList(cb));
     }
@@ -245,7 +216,7 @@
      * @return The result bean of selected page. (NotNull)
      */
     public PagingResultBean selectPage(final RoleInfoCB cb) {
-        assertConditionBeanNotNull(cb);
+        assertCBNotNull(cb);
         final PagingInvoker invoker = new PagingInvoker(
                 getTableDbName());
         final PagingHandler handler = new PagingHandler() {
@@ -266,6 +237,32 @@
 
     //==========================================================================
     // =========
+    // Scalar Select
+    // =============
+    /**
+     * Select the scalar value derived by a function. 
Call a function + * method after this method called like as follows: + * + *
+     * roleInfoBhv.scalarSelect(Date.class).max(new ScalarQuery(RoleInfoCB cb) {
+     *     cb.specify().columnXxxDatetime(); // the required specification of target column
+     *     cb.query().setXxxName_PrefixSearch("S"); // query as you like it
+     * });
+     * 
+ * + * @param The type of result. + * @param resultType The type of result. (NotNull) + * @return The scalar value derived by a function. (Nullable) + */ + public SLFunction scalarSelect( + Class resultType) { + RoleInfoCB cb = newMyConditionBean(); + cb.xsetupForScalarSelect(); + return new SLFunction(cb, resultType); + } + + //========================================================================== + // ========= // Various Select // ============== /** @@ -275,8 +272,8 @@ * @param valueLabelSetupper The setupper of value-label. (NotNull) * @return The list of value-label. (NotNull) */ - public List> selectValueLabelList( - RoleInfoCB cb, ValueLabelSetupper valueLabelSetupper) { + public List> selectValueLabelList(RoleInfoCB cb, + ValueLabelSetupper valueLabelSetupper) { return createValueLabelList(selectList(cb), valueLabelSetupper); } @@ -467,8 +464,8 @@ //========================================================================== // ========= - // Pullout Foreign - // =============== + // Pull out Foreign + // ================ //========================================================================== // ========= @@ -764,11 +761,11 @@ */ public int queryUpdate(RoleInfo roleInfo, RoleInfoCB cb) { assertObjectNotNull("roleInfo", roleInfo); - assertConditionBeanNotNull(cb); + assertCBNotNull(cb); setupCommonColumnOfUpdateIfNeeds(roleInfo); filterEntityOfUpdate(roleInfo); assertEntityOfUpdate(roleInfo); - return getMyDao().updateByQuery(cb, roleInfo); + return invoke(createQueryUpdateEntityCBCommand(roleInfo, cb)); } /** @@ -778,8 +775,8 @@ * @return The deleted count. */ public int queryDelete(RoleInfoCB cb) { - assertConditionBeanNotNull(cb); - return getMyDao().deleteByQuery(cb); + assertCBNotNull(cb); + return invoke(createQueryDeleteCBCommand(cb)); } //========================================================================== @@ -791,19 +788,27 @@ // ========= // Delegate Method // =============== + // [Behavior Command] // ----------------------------------------------------- // Select // ------ protected int delegateSelectCount(RoleInfoCB cb) { - assertConditionBeanNotNull(cb); - return getMyDao().selectCount(cb); + return invoke(createSelectCountCBCommand(cb)); } + protected int doCallReadCount(ConditionBean cb) { + return delegateSelectCount((RoleInfoCB) cb); + } + protected List delegateSelectList(RoleInfoCB cb) { - assertConditionBeanNotNull(cb); - return getMyDao().selectList(cb); + return invoke(createSelectListCBCommand(cb, RoleInfo.class)); } + @SuppressWarnings("unchecked") + protected List doCallReadList(ConditionBean cb) { + return (List) delegateSelectList((RoleInfoCB) cb); + } + // ----------------------------------------------------- // Update // ------ @@ -811,62 +816,97 @@ if (!processBeforeInsert(e)) { return 1; } - return getMyDao().insert(e); + return invoke(createInsertEntityCommand(e)); } + protected int doCallCreate(Entity entity) { + return delegateInsert(downcast(entity)); + } + protected int delegateUpdate(RoleInfo e) { if (!processBeforeUpdate(e)) { return 1; } - return getMyDao().updateModifiedOnly(e); + return invoke(createUpdateEntityCommand(e)); } + protected int doCallModify(Entity entity) { + return delegateUpdate(downcast(entity)); + } + protected int delegateUpdateNonstrict(RoleInfo e) { if (!processBeforeUpdate(e)) { return 1; } - return getMyDao().updateNonstrictModifiedOnly(e); + return invoke(createUpdateNonstrictEntityCommand(e)); } protected int delegateDelete(RoleInfo e) { if (!processBeforeDelete(e)) { return 1; } - return getMyDao().delete(e); + return invoke(createDeleteEntityCommand(e)); } + protected int doCallRemove(Entity entity) { + return delegateDelete(downcast(entity)); + } + protected int delegateDeleteNonstrict(RoleInfo e) { if (!processBeforeDelete(e)) { return 1; } - return getMyDao().deleteNonstrict(e); + return invoke(createDeleteNonstrictEntityCommand(e)); } protected int[] delegateInsertList(List ls) { - assertObjectNotNull("roleInfoList", ls); - return getMyDao().insertList(helpFilterBeforeInsertInternally(ls)); + if (ls.isEmpty()) { + return new int[] {}; + } + return invoke(createBatchInsertEntityCommand(helpFilterBeforeInsertInternally(ls))); } + @SuppressWarnings("unchecked") + protected int[] doCreateList(List ls) { + return delegateInsertList((List) ls); + } + protected int[] delegateUpdateList(List ls) { - assertObjectNotNull("roleInfoList", ls); - return getMyDao().updateList(helpFilterBeforeUpdateInternally(ls)); + if (ls.isEmpty()) { + return new int[] {}; + } + return invoke(createBatchUpdateEntityCommand(helpFilterBeforeUpdateInternally(ls))); } + @SuppressWarnings("unchecked") + protected int[] doModifyList(List ls) { + return delegateUpdateList((List) ls); + } + protected int[] delegateUpdateListNonstrict(List ls) { - assertObjectNotNull("roleInfoList", ls); - return getMyDao().updateListNonstrict( - helpFilterBeforeUpdateInternally(ls)); + if (ls.isEmpty()) { + return new int[] {}; + } + return invoke(createBatchUpdateNonstrictEntityCommand(helpFilterBeforeUpdateInternally(ls))); } protected int[] delegateDeleteList(List ls) { - assertObjectNotNull("roleInfoList", ls); - return getMyDao().deleteList(helpFilterBeforeDeleteInternally(ls)); + if (ls.isEmpty()) { + return new int[] {}; + } + return invoke(createBatchDeleteEntityCommand(helpFilterBeforeDeleteInternally(ls))); } + @SuppressWarnings("unchecked") + protected int[] doRemoveList(List ls) { + return delegateDeleteList((List) ls); + } + protected int[] delegateDeleteListNonstrict(List ls) { - assertObjectNotNull("roleInfoList", ls); - return getMyDao().deleteListNonstrict( - helpFilterBeforeDeleteInternally(ls)); + if (ls.isEmpty()) { + return new int[] {}; + } + return invoke(createBatchDeleteNonstrictEntityCommand(helpFilterBeforeDeleteInternally(ls))); } //========================================================================== Modified: 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 2008-12-27 22:14:41 UTC (rev 1629) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/bsbhv/BsRoleMappingBhv.java 2008-12-27 22:18:30 UTC (rev 1630) @@ -1,9 +1,8 @@ package jp.sf.pal.scheduler.db.bsbhv; import java.util.List; +import java.util.Map; -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; @@ -16,13 +15,12 @@ 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. + * The behavior of ROLE_MAPPING that the type is TABLE.
* *
  * [primary-key]
@@ -67,12 +65,6 @@
 
     //==========================================================================
     // =========
-    // Attribute
-    // =========
-    protected RoleMappingDao _dao;
-
-    //==========================================================================
-    // =========
     // Table name
     // ==========
     /** @return The name on database of table. (NotNull) */
@@ -84,39 +76,18 @@
     // =========
     // DBMeta
     // ======
-    /** @return The meta data of the database. (NotNull) */
+    /** @return The instance of DBMeta. (NotNull) */
     public DBMeta getDBMeta() {
         return RoleMappingDbm.getInstance();
     }
 
-    /** @return The meta data of the database as my table type. (NotNull) */
+    /** @return The instance of DBMeta as my table type. (NotNull) */
     public RoleMappingDbm getMyDBMeta() {
         return RoleMappingDbm.getInstance();
     }
 
     //==========================================================================
     // =========
-    // Dao Accessor
-    // ============
-    public RoleMappingDao getMyDao() {
-        return _dao;
-    }
-
-    public void setMyDao(RoleMappingDao dao) {
-        assertObjectNotNull("dao", dao);
-        _dao = dao;
-    }
-
-    public DaoReadable getDaoReadable() {
-        return getMyDao();
-    }
-
-    public DaoWritable getDaoWritable() {
-        return getMyDao();
-    }
-
-    //==========================================================================
-    // =========
     // New Instance
     // ============
     public Entity newEntity() {
@@ -146,7 +117,7 @@
      * @return The selected count.
      */
     public int selectCount(RoleMappingCB cb) {
-        assertConditionBeanNotNull(cb);
+        assertCBNotNull(cb);
         return delegateSelectCount(cb);
     }
 
@@ -223,7 +194,7 @@
      * @return The result bean of selected list. (NotNull)
      */
     public ListResultBean selectList(RoleMappingCB cb) {
-        assertConditionBeanNotNull(cb);
+        assertCBNotNull(cb);
         return new ResultBeanBuilder(getTableDbName())
                 .buildListResultBean(cb, delegateSelectList(cb));
     }
@@ -239,7 +210,7 @@
      * @return The result bean of selected page. (NotNull)
      */
     public PagingResultBean selectPage(final RoleMappingCB cb) {
-        assertConditionBeanNotNull(cb);
+        assertCBNotNull(cb);
         final PagingInvoker invoker = new PagingInvoker(
                 getTableDbName());
         final PagingHandler handler = new PagingHandler() {
@@ -260,6 +231,32 @@
 
     //==========================================================================
     // =========
+    // Scalar Select
+    // =============
+    /**
+     * Select the scalar value derived by a function. 
Call a function + * method after this method called like as follows: + * + *
+     * roleMappingBhv.scalarSelect(Date.class).max(new ScalarQuery(RoleMappingCB cb) {
+     *     cb.specify().columnXxxDatetime(); // the required specification of target column
+     *     cb.query().setXxxName_PrefixSearch("S"); // query as you like it
+     * });
+     * 
+ * + * @param The type of result. + * @param resultType The type of result. (NotNull) + * @return The scalar value derived by a function. (Nullable) + */ + public SLFunction scalarSelect( + Class resultType) { + RoleMappingCB cb = newMyConditionBean(); + cb.xsetupForScalarSelect(); + return new SLFunction(cb, resultType); + } + + //========================================================================== + // ========= // Various Select // ============== /** @@ -269,8 +266,8 @@ * @param valueLabelSetupper The setupper of value-label. (NotNull) * @return The list of value-label. (NotNull) */ - public List> selectValueLabelList( - RoleMappingCB cb, ValueLabelSetupper valueLabelSetupper) { + public List> selectValueLabelList(RoleMappingCB cb, + ValueLabelSetupper valueLabelSetupper) { return createValueLabelList(selectList(cb), valueLabelSetupper); } @@ -281,8 +278,8 @@ //========================================================================== // ========= - // Pullout Foreign - // =============== + // Pull out Foreign + // ================ /** * Pull out the list of foreign table 'RoleInfo'. * @@ -494,11 +491,11 @@ */ public int queryUpdate(RoleMapping roleMapping, RoleMappingCB cb) { assertObjectNotNull("roleMapping", roleMapping); - assertConditionBeanNotNull(cb); + assertCBNotNull(cb); setupCommonColumnOfUpdateIfNeeds(roleMapping); filterEntityOfUpdate(roleMapping); assertEntityOfUpdate(roleMapping); - return getMyDao().updateByQuery(cb, roleMapping); + return invoke(createQueryUpdateEntityCBCommand(roleMapping, cb)); } /** @@ -508,8 +505,8 @@ * @return The deleted count. */ public int queryDelete(RoleMappingCB cb) { - assertConditionBeanNotNull(cb); - return getMyDao().deleteByQuery(cb); + assertCBNotNull(cb); + return invoke(createQueryDeleteCBCommand(cb)); } //========================================================================== @@ -521,19 +518,27 @@ // ========= // Delegate Method // =============== + // [Behavior Command] // ----------------------------------------------------- // Select // ------ protected int delegateSelectCount(RoleMappingCB cb) { - assertConditionBeanNotNull(cb); - return getMyDao().selectCount(cb); + return invoke(createSelectCountCBCommand(cb)); } + protected int doCallReadCount(ConditionBean cb) { + return delegateSelectCount((RoleMappingCB) cb); + } + protected List delegateSelectList(RoleMappingCB cb) { - assertConditionBeanNotNull(cb); - return getMyDao().selectList(cb); + return invoke(createSelectListCBCommand(cb, RoleMapping.class)); } + @SuppressWarnings("unchecked") + protected List doCallReadList(ConditionBean cb) { + return (List) delegateSelectList((RoleMappingCB) cb); + } + // ----------------------------------------------------- // Update // ------ @@ -541,38 +546,71 @@ if (!processBeforeInsert(e)) { return 1; } - return getMyDao().insert(e); + return invoke(createInsertEntityCommand(e)); } + protected int doCallCreate(Entity entity) { + return delegateInsert(downcast(entity)); + } + protected int delegateUpdate(RoleMapping e) { if (!processBeforeUpdate(e)) { return 1; } - return getMyDao().updateModifiedOnly(e); + return invoke(createUpdateEntityCommand(e)); } + protected int doCallModify(Entity entity) { + return delegateUpdate(downcast(entity)); + } + protected int delegateDelete(RoleMapping e) { if (!processBeforeDelete(e)) { return 1; } - return getMyDao().delete(e); + return invoke(createDeleteEntityCommand(e)); } + protected int doCallRemove(Entity entity) { + return delegateDelete(downcast(entity)); + } + protected int[] delegateInsertList(List ls) { - assertObjectNotNull("roleMappingList", ls); - return getMyDao().insertList(helpFilterBeforeInsertInternally(ls)); + if (ls.isEmpty()) { + return new int[] {}; + } + return invoke(createBatchInsertEntityCommand(helpFilterBeforeInsertInternally(ls))); } + @SuppressWarnings("unchecked") + protected int[] doCreateList(List ls) { + return delegateInsertList((List) ls); + } + protected int[] delegateUpdateList(List ls) { - assertObjectNotNull("roleMappingList", ls); - return getMyDao().updateList(helpFilterBeforeUpdateInternally(ls)); + if (ls.isEmpty()) { + return new int[] {}; + } + return invoke(createBatchUpdateEntityCommand(helpFilterBeforeUpdateInternally(ls))); } + @SuppressWarnings("unchecked") + protected int[] doModifyList(List ls) { + return delegateUpdateList((List) ls); + } + protected int[] delegateDeleteList(List ls) { - assertObjectNotNull("roleMappingList", ls); - return getMyDao().deleteList(helpFilterBeforeDeleteInternally(ls)); + if (ls.isEmpty()) { + return new int[] {}; + } + return invoke(createBatchDeleteEntityCommand(helpFilterBeforeDeleteInternally(ls))); } + @SuppressWarnings("unchecked") + protected int[] doRemoveList(List ls) { + return delegateDeleteList((List) ls); + } + //========================================================================== // ========= // Optimistic Lock Info Modified: 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 2008-12-27 22:14:41 UTC (rev 1629) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/bsbhv/BsUserInfoBhv.java 2008-12-27 22:18:30 UTC (rev 1630) @@ -1,9 +1,8 @@ package jp.sf.pal.scheduler.db.bsbhv; import java.util.List; +import java.util.Map; -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; @@ -24,7 +23,6 @@ import jp.sf.pal.scheduler.db.exbhv.EventScheduleMappingBhv; import jp.sf.pal.scheduler.db.exbhv.GroupMappingBhv; import jp.sf.pal.scheduler.db.exbhv.RoleMappingBhv; -import jp.sf.pal.scheduler.db.exdao.UserInfoDao; import jp.sf.pal.scheduler.db.exentity.EventScheduleMapping; import jp.sf.pal.scheduler.db.exentity.GroupInfo; import jp.sf.pal.scheduler.db.exentity.GroupMapping; @@ -33,14 +31,14 @@ import jp.sf.pal.scheduler.db.exentity.UserInfo; /** - * The behavior of USER_INFO. + * The behavior of USER_INFO that the type is TABLE.
* *
  * [primary-key]
  *     USER_ID
  * 
  * [column]
- *     USER_ID, GIVEN_NAME, FAMILY_NAME, MIDDLE_NAME, GIVEN_NAME_DESC, FAMILY_NAME_DESC, NICKNAME, GENDER, BIRTH_DATE, EMAIL, URL, TELEPHONE, LOCALE, ROLE_ID, GROUP_ID, CREATED_TIME, CREATED_BY, UPDATED_TIME, UPDATED_BY, DELETED_TIME, DELETED_BY, VERSIONNO
+ *     USER_ID, GIVEN_NAME, FAMILY_NAME, MIDDLE_NAME, GIVEN_NAME_DESC, FAMILY_NAME_DESC, NICKNAME, GENDER, BIRTH_DATE, EMAIL, URL, TELEPHONE, LOCALE, ROLE_ID, GROUP_ID, STATUS, CREATED_TIME, CREATED_BY, UPDATED_TIME, UPDATED_BY, DELETED_TIME, DELETED_BY, VERSIONNO
  * 
  * [sequence]
  *     
@@ -78,12 +76,6 @@
 
     //==========================================================================
     // =========
-    // Attribute
-    // =========
-    protected UserInfoDao _dao;
-
-    //==========================================================================
-    // =========
     // Table name
     // ==========
     /** @return The name on database of table. (NotNull) */
@@ -95,39 +87,18 @@
     // =========
     // DBMeta
     // ======
-    /** @return The meta data of the database. (NotNull) */
+    /** @return The instance of DBMeta. (NotNull) */
     public DBMeta getDBMeta() {
         return UserInfoDbm.getInstance();
     }
 
-    /** @return The meta data of the database as my table type. (NotNull) */
+    /** @return The instance of DBMeta as my table type. (NotNull) */
     public UserInfoDbm getMyDBMeta() {
         return UserInfoDbm.getInstance();
     }
 
     //==========================================================================
     // =========
-    // Dao Accessor
-    // ============
-    public UserInfoDao getMyDao() {
-        return _dao;
-    }
-
-    public void setMyDao(UserInfoDao dao) {
-        assertObjectNotNull("dao", dao);
-        _dao = dao;
-    }
-
-    public DaoReadable getDaoReadable() {
-        return getMyDao();
-    }
-
-    public DaoWritable getDaoWritable() {
-        return getMyDao();
-    }
-
-    //==========================================================================
-    // =========
     // New Instance
     // ============
     public Entity newEntity() {
@@ -157,7 +128,7 @@
      * @return The selected count.
      */
     public int selectCount(UserInfoCB cb) {
-        assertConditionBeanNotNull(cb);
+        assertCBNotNull(cb);
         return delegateSelectCount(cb);
     }
 
@@ -234,7 +205,7 @@
      * @return The result bean of selected list. (NotNull)
      */
     public ListResultBean selectList(UserInfoCB cb) {
-        assertConditionBeanNotNull(cb);
+        assertCBNotNull(cb);
         return new ResultBeanBuilder(getTableDbName())
                 .buildListResultBean(cb, delegateSelectList(cb));
     }
@@ -250,7 +221,7 @@
      * @return The result bean of selected page. (NotNull)
      */
     public PagingResultBean selectPage(final UserInfoCB cb) {
-        assertConditionBeanNotNull(cb);
+        assertCBNotNull(cb);
         final PagingInvoker invoker = new PagingInvoker(
                 getTableDbName());
         final PagingHandler handler = new PagingHandler() {
@@ -271,6 +242,32 @@
 
     //==========================================================================
     // =========
+    // Scalar Select
+    // =============
+    /**
+     * Select the scalar value derived by a function. 
Call a function + * method after this method called like as follows: + * + *
+     * userInfoBhv.scalarSelect(Date.class).max(new ScalarQuery(UserInfoCB cb) {
+     *     cb.specify().columnXxxDatetime(); // the required specification of target column
+     *     cb.query().setXxxName_PrefixSearch("S"); // query as you like it
+     * });
+     * 
+ * + * @param The type of result. + * @param resultType The type of result. (NotNull) + * @return The scalar value derived by a function. (Nullable) + */ + public SLFunction scalarSelect( + Class resultType) { + UserInfoCB cb = newMyConditionBean(); + cb.xsetupForScalarSelect(); + return new SLFunction(cb, resultType); + } + + //========================================================================== + // ========= // Various Select // ============== /** @@ -280,8 +277,8 @@ * @param valueLabelSetupper The setupper of value-label. (NotNull) * @return The list of value-label. (NotNull) */ - public List> selectValueLabelList( - UserInfoCB cb, ValueLabelSetupper valueLabelSetupper) { + public List> selectValueLabelList(UserInfoCB cb, + ValueLabelSetupper valueLabelSetupper) { return createValueLabelList(selectList(cb), valueLabelSetupper); } @@ -568,8 +565,8 @@ //========================================================================== // ========= - // Pullout Foreign - // =============== + // Pull out Foreign + // ================ /** * Pull out the list of foreign table 'GroupInfo'. * @@ -894,11 +891,11 @@ */ public int queryUpdate(UserInfo userInfo, UserInfoCB cb) { assertObjectNotNull("userInfo", userInfo); - assertConditionBeanNotNull(cb); + assertCBNotNull(cb); setupCommonColumnOfUpdateIfNeeds(userInfo); filterEntityOfUpdate(userInfo); assertEntityOfUpdate(userInfo); - return getMyDao().updateByQuery(cb, userInfo); + return invoke(createQueryUpdateEntityCBCommand(userInfo, cb)); } /** @@ -908,8 +905,8 @@ * @return The deleted count. */ public int queryDelete(UserInfoCB cb) { - assertConditionBeanNotNull(cb); - return getMyDao().deleteByQuery(cb); + assertCBNotNull(cb); + return invoke(createQueryDeleteCBCommand(cb)); } //========================================================================== @@ -921,19 +918,27 @@ // ========= // Delegate Method // =============== + // [Behavior Command] // ----------------------------------------------------- // Select // ------ protected int delegateSelectCount(UserInfoCB cb) { - assertConditionBeanNotNull(cb); - return getMyDao().selectCount(cb); + return invoke(createSelectCountCBCommand(cb)); } + protected int doCallReadCount(ConditionBean cb) { + return delegateSelectCount((UserInfoCB) cb); + } + protected List delegateSelectList(UserInfoCB cb) { - assertConditionBeanNotNull(cb); - return getMyDao().selectList(cb); + return invoke(createSelectListCBCommand(cb, UserInfo.class)); } + @SuppressWarnings("unchecked") + protected List doCallReadList(ConditionBean cb) { + return (List) delegateSelectList((UserInfoCB) cb); + } + // ----------------------------------------------------- // Update // ------ @@ -941,62 +946,97 @@ if (!processBeforeInsert(e)) { return 1; } - return getMyDao().insert(e); + return invoke(createInsertEntityCommand(e)); } + protected int doCallCreate(Entity entity) { + return delegateInsert(downcast(entity)); + } + protected int delegateUpdate(UserInfo e) { if (!processBeforeUpdate(e)) { return 1; } - return getMyDao().updateModifiedOnly(e); + return invoke(createUpdateEntityCommand(e)); } + protected int doCallModify(Entity entity) { + return delegateUpdate(downcast(entity)); + } + protected int delegateUpdateNonstrict(UserInfo e) { if (!processBeforeUpdate(e)) { return 1; } - return getMyDao().updateNonstrictModifiedOnly(e); + return invoke(createUpdateNonstrictEntityCommand(e)); } protected int delegateDelete(UserInfo e) { if (!processBeforeDelete(e)) { return 1; } - return getMyDao().delete(e); + return invoke(createDeleteEntityCommand(e)); } + protected int doCallRemove(Entity entity) { + return delegateDelete(downcast(entity)); + } + protected int delegateDeleteNonstrict(UserInfo e) { if (!processBeforeDelete(e)) { return 1; } - return getMyDao().deleteNonstrict(e); + return invoke(createDeleteNonstrictEntityCommand(e)); } protected int[] delegateInsertList(List ls) { - assertObjectNotNull("userInfoList", ls); - return getMyDao().insertList(helpFilterBeforeInsertInternally(ls)); + if (ls.isEmpty()) { + return new int[] {}; + } + return invoke(createBatchInsertEntityCommand(helpFilterBeforeInsertInternally(ls))); } + @SuppressWarnings("unchecked") + protected int[] doCreateList(List ls) { + return delegateInsertList((List) ls); + } + protected int[] delegateUpdateList(List ls) { - assertObjectNotNull("userInfoList", ls); - return getMyDao().updateList(helpFilterBeforeUpdateInternally(ls)); + if (ls.isEmpty()) { + return new int[] {}; + } + return invoke(createBatchUpdateEntityCommand(helpFilterBeforeUpdateInternally(ls))); } + @SuppressWarnings("unchecked") + protected int[] doModifyList(List ls) { + return delegateUpdateList((List) ls); + } + protected int[] delegateUpdateListNonstrict(List ls) { - assertObjectNotNull("userInfoList", ls); - return getMyDao().updateListNonstrict( - helpFilterBeforeUpdateInternally(ls)); + if (ls.isEmpty()) { + return new int[] {}; + } + return invoke(createBatchUpdateNonstrictEntityCommand(helpFilterBeforeUpdateInternally(ls))); } protected int[] delegateDeleteList(List ls) { - assertObjectNotNull("userInfoList", ls); - return getMyDao().deleteList(helpFilterBeforeDeleteInternally(ls)); + if (ls.isEmpty()) { + return new int[] {}; + } + return invoke(createBatchDeleteEntityCommand(helpFilterBeforeDeleteInternally(ls))); } + @SuppressWarnings("unchecked") + protected int[] doRemoveList(List ls) { + return delegateDeleteList((List) ls); + } + protected int[] delegateDeleteListNonstrict(List ls) { - assertObjectNotNull("userInfoList", ls); - return getMyDao().deleteListNonstrict( - helpFilterBeforeDeleteInternally(ls)); + if (ls.isEmpty()) { + return new int[] {}; + } + return invoke(createBatchDeleteNonstrictEntityCommand(helpFilterBeforeDeleteInternally(ls))); } //========================================================================== Modified: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/bsentity/BsEventSchedule.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/bsentity/BsEventSchedule.java 2008-12-27 22:14:41 UTC (rev 1629) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/bsentity/BsEventSchedule.java 2008-12-27 22:18:30 UTC (rev 1630) @@ -45,7 +45,6 @@ * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public abstract class BsEventSchedule implements Entity, java.io.Serializable { //========================================================================== Modified: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/bsentity/BsEventScheduleContent.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/bsentity/BsEventScheduleContent.java 2008-12-27 22:14:41 UTC (rev 1629) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/bsentity/BsEventScheduleContent.java 2008-12-27 22:18:30 UTC (rev 1630) @@ -41,7 +41,6 @@ * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public abstract class BsEventScheduleContent implements Entity, java.io.Serializable { Modified: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/bsentity/BsEventScheduleMapping.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/bsentity/BsEventScheduleMapping.java 2008-12-27 22:14:41 UTC (rev 1629) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/bsentity/BsEventScheduleMapping.java 2008-12-27 22:18:30 UTC (rev 1630) @@ -42,7 +42,6 @@ * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public abstract class BsEventScheduleMapping implements Entity, java.io.Serializable { Modified: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/bsentity/BsFacility.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/bsentity/BsFacility.java 2008-12-27 22:14:41 UTC (rev 1629) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/bsentity/BsFacility.java 2008-12-27 22:18:30 UTC (rev 1630) @@ -45,7 +45,6 @@ * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public abstract class BsFacility implements Entity, java.io.Serializable { //========================================================================== Modified: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/bsentity/BsFacilityContent.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/bsentity/BsFacilityContent.java 2008-12-27 22:14:41 UTC (rev 1629) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/bsentity/BsFacilityContent.java 2008-12-27 22:18:30 UTC (rev 1630) @@ -41,7 +41,6 @@ * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public abstract class BsFacilityContent implements Entity, java.io.Serializable { //========================================================================== Modified: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/bsentity/BsFacilityGroup.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/bsentity/BsFacilityGroup.java 2008-12-27 22:14:41 UTC (rev 1629) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/bsentity/BsFacilityGroup.java 2008-12-27 22:18:30 UTC (rev 1630) @@ -43,7 +43,6 @@ * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public abstract class BsFacilityGroup implements Entity, java.io.Serializable { //========================================================================== Modified: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/bsentity/BsFacilityScheduleMapping.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/bsentity/BsFacilityScheduleMapping.java 2008-12-27 22:14:41 UTC (rev 1629) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/bsentity/BsFacilityScheduleMapping.java 2008-12-27 22:18:30 UTC (rev 1630) @@ -42,7 +42,6 @@ * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public abstract class BsFacilityScheduleMapping implements Entity, java.io.Serializable { Modified: 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 2008-12-27 22:14:41 UTC (rev 1629) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/bsentity/BsGroupInfo.java 2008-12-27 22:18:30 UTC (rev 1630) @@ -44,7 +44,6 @@ * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public abstract class BsGroupInfo implements Entity, java.io.Serializable { //========================================================================== Modified: 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 2008-12-27 22:14:41 UTC (rev 1629) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/bsentity/BsGroupMapping.java 2008-12-27 22:18:30 UTC (rev 1630) @@ -42,7 +42,6 @@ * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public abstract class BsGroupMapping implements Entity, java.io.Serializable { //========================================================================== Modified: 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 2008-12-27 22:14:41 UTC (rev 1629) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/bsentity/BsRoleInfo.java 2008-12-27 22:18:30 UTC (rev 1630) @@ -44,7 +44,6 @@ * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public abstract class BsRoleInfo implements Entity, java.io.Serializable { //========================================================================== Modified: 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 2008-12-27 22:14:41 UTC (rev 1629) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/bsentity/BsRoleMapping.java 2008-12-27 22:18:30 UTC (rev 1630) @@ -42,7 +42,6 @@ * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public abstract class BsRoleMapping implements Entity, java.io.Serializable { //========================================================================== Modified: 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 2008-12-27 22:14:41 UTC (rev 1629) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/bsentity/BsUserInfo.java 2008-12-27 22:18:30 UTC (rev 1630) @@ -21,7 +21,7 @@ * USER_ID * * [column] - * USER_ID, GIVEN_NAME, FAMILY_NAME, MIDDLE_NAME, GIVEN_NAME_DESC, FAMILY_NAME_DESC, NICKNAME, GENDER, BIRTH_DATE, EMAIL, URL, TELEPHONE, LOCALE, ROLE_ID, GROUP_ID, CREATED_TIME, CREATED_BY, UPDATED_TIME, UPDATED_BY, DELETED_TIME, DELETED_BY, VERSIONNO + * USER_ID, GIVEN_NAME, FAMILY_NAME, MIDDLE_NAME, GIVEN_NAME_DESC, FAMILY_NAME_DESC, NICKNAME, GENDER, BIRTH_DATE, EMAIL, URL, TELEPHONE, LOCALE, ROLE_ID, GROUP_ID, STATUS, CREATED_TIME, CREATED_BY, UPDATED_TIME, UPDATED_BY, DELETED_TIME, DELETED_BY, VERSIONNO * * [sequence] * @@ -47,7 +47,6 @@ * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public abstract class BsUserInfo implements Entity, java.io.Serializable { //========================================================================== @@ -115,6 +114,9 @@ /** GROUP_ID: {VARCHAR(255) : FK to GROUP_INFO} */ protected String _groupId; + /** STATUS: {VARCHAR(1)} */ + protected String _status; + /** CREATED_TIME: {NotNull : TIMESTAMP} */ protected java.sql.Timestamp _createdTime; @@ -434,6 +436,7 @@ sb.append(delimiter).append(getLocale()); sb.append(delimiter).append(getRoleId()); sb.append(delimiter).append(getGroupId()); + sb.append(delimiter).append(getStatus()); sb.append(delimiter).append(getCreatedTime()); sb.append(delimiter).append(getCreatedBy()); sb.append(delimiter).append(getUpdatedTime()); @@ -785,6 +788,28 @@ this._groupId = groupId; } + /** The column annotation for S2Dao. {VARCHAR(1)} */ + public static final String status_COLUMN = "STATUS"; + + /** + * STATUS: {VARCHAR(1)}
+ * + * @return The value of the column 'STATUS'. (Nullable) + */ + public String getStatus() { + return _status; + } + + /** + * STATUS: {VARCHAR(1)}
+ * + * @param status The value of the column 'STATUS'. (Nullable) + */ + public void setStatus(String status) { + _modifiedProperties.addPropertyName("status"); + this._status = status; + } + /** The column annotation for S2Dao. {NotNull : TIMESTAMP} */ public static final String createdTime_COLUMN = "CREATED_TIME"; Modified: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/bsentity/dbmeta/EventScheduleContentDbm.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/bsentity/dbmeta/EventScheduleContentDbm.java 2008-12-27 22:14:41 UTC (rev 1629) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/bsentity/dbmeta/EventScheduleContentDbm.java 2008-12-27 22:18:30 UTC (rev 1630) @@ -8,6 +8,7 @@ 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.helper.StringKeyMap; import jp.sf.pal.scheduler.db.exentity.EventScheduleContent; /** @@ -15,7 +16,6 @@ * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public class EventScheduleContentDbm extends AbstractDBMeta { private static final EventScheduleContentDbm _instance = new EventScheduleContentDbm(); @@ -61,40 +61,14 @@ return _columnContent; } - { - initializeColumnInfoList(); - } - //========================================================================== // ========= - // Name Map - // ======== - public Map getDbNamePropertyNameKeyToLowerMap() { - return createDbNamePropertyNameKeyToLowerMap(); + // Resource Initialization + // ======================= + { + initializeInformationResource(); } - public Map getPropertyNameDbNameKeyToLowerMap() { - return createPropertyNameDbNameKeyToLowerMap(); - } - - protected static Map _dbNamePropertyNameKeyToLowerMap; - - protected Map createDbNamePropertyNameKeyToLowerMap() { - if (_dbNamePropertyNameKeyToLowerMap == null) { - _dbNamePropertyNameKeyToLowerMap = setupKeyToLowerMap(true); - } - return _dbNamePropertyNameKeyToLowerMap; - } - - protected static Map _propertyNameDbNameKeyToLowerMap; - - protected Map createPropertyNameDbNameKeyToLowerMap() { - if (_propertyNameDbNameKeyToLowerMap == null) { - _propertyNameDbNameKeyToLowerMap = setupKeyToLowerMap(false); - } - return _propertyNameDbNameKeyToLowerMap; - } - //========================================================================== // ========= // Type Name @@ -253,7 +227,8 @@ // Entity Property Setup // ===================== // It's very INTERNAL! - protected Map> _epsMap = newHashMap(); + protected Map> _epsMap = StringKeyMap + .createAsFlexibleConcurrent(); { setupEps(_epsMap, new EpsId(), columnId()); setupEps(_epsMap, new EpsContent(), columnContent()); Modified: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/bsentity/dbmeta/EventScheduleDbm.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/bsentity/dbmeta/EventScheduleDbm.java 2008-12-27 22:14:41 UTC (rev 1629) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/bsentity/dbmeta/EventScheduleDbm.java 2008-12-27 22:18:30 UTC (rev 1630) @@ -9,6 +9,7 @@ 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.allcommon.helper.StringKeyMap; import jp.sf.pal.scheduler.db.exentity.EventSchedule; /** @@ -16,7 +17,6 @@ * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public class EventScheduleDbm extends AbstractDBMeta { private static final EventScheduleDbm _instance = new EventScheduleDbm(); @@ -160,40 +160,14 @@ return _columnVersionno; } - { - initializeColumnInfoList(); - } - //========================================================================== // ========= - // Name Map - // ======== - public Map getDbNamePropertyNameKeyToLowerMap() { - return createDbNamePropertyNameKeyToLowerMap(); + // Resource Initialization + // ======================= + { + initializeInformationResource(); } - public Map getPropertyNameDbNameKeyToLowerMap() { - return createPropertyNameDbNameKeyToLowerMap(); - } - - protected static Map _dbNamePropertyNameKeyToLowerMap; - - protected Map createDbNamePropertyNameKeyToLowerMap() { - if (_dbNamePropertyNameKeyToLowerMap == null) { - _dbNamePropertyNameKeyToLowerMap = setupKeyToLowerMap(true); - } - return _dbNamePropertyNameKeyToLowerMap; - } - - protected static Map _propertyNameDbNameKeyToLowerMap; - - protected Map createPropertyNameDbNameKeyToLowerMap() { - if (_propertyNameDbNameKeyToLowerMap == null) { - _propertyNameDbNameKeyToLowerMap = setupKeyToLowerMap(false); - } - return _propertyNameDbNameKeyToLowerMap; - } - //========================================================================== // ========= // Type Name @@ -370,7 +344,8 @@ // Entity Property Setup // ===================== // It's very INTERNAL! - protected Map> _epsMap = newHashMap(); + protected Map> _epsMap = StringKeyMap + .createAsFlexibleConcurrent(); { setupEps(_epsMap, new EpsId(), columnId()); setupEps(_epsMap, new EpsTitle(), columnTitle()); Modified: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/bsentity/dbmeta/EventScheduleMappingDbm.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/bsentity/dbmeta/EventScheduleMappingDbm.java 2008-12-27 22:14:41 UTC (rev 1629) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/bsentity/dbmeta/EventScheduleMappingDbm.java 2008-12-27 22:18:30 UTC (rev 1630) @@ -8,6 +8,7 @@ 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.helper.StringKeyMap; import jp.sf.pal.scheduler.db.exentity.EventScheduleMapping; /** @@ -15,7 +16,6 @@ * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public class EventScheduleMappingDbm extends AbstractDBMeta { private static final EventScheduleMappingDbm _instance = new EventScheduleMappingDbm(); @@ -68,40 +68,14 @@ return _columnUserId; } - { - initializeColumnInfoList(); - } - //========================================================================== // ========= - // Name Map - // ======== - public Map getDbNamePropertyNameKeyToLowerMap() { - return createDbNamePropertyNameKeyToLowerMap(); + // Resource Initialization + // ======================= + { + initializeInformationResource(); } - public Map getPropertyNameDbNameKeyToLowerMap() { - return createPropertyNameDbNameKeyToLowerMap(); - } - - protected static Map _dbNamePropertyNameKeyToLowerMap; - - protected Map createDbNamePropertyNameKeyToLowerMap() { - if (_dbNamePropertyNameKeyToLowerMap == null) { - _dbNamePropertyNameKeyToLowerMap = setupKeyToLowerMap(true); - } - return _dbNamePropertyNameKeyToLowerMap; - } - - protected static Map _propertyNameDbNameKeyToLowerMap; - - protected Map createPropertyNameDbNameKeyToLowerMap() { - if (_propertyNameDbNameKeyToLowerMap == null) { - _propertyNameDbNameKeyToLowerMap = setupKeyToLowerMap(false); - } - return _propertyNameDbNameKeyToLowerMap; - } - //========================================================================== // ========= // Type Name @@ -266,7 +240,8 @@ // Entity Property Setup // ===================== // It's very INTERNAL! - protected Map> _epsMap = newHashMap(); + protected Map> _epsMap = StringKeyMap + .createAsFlexibleConcurrent(); { setupEps(_epsMap, new EpsId(), columnId()); setupEps(_epsMap, new EpsScheduleId(), columnScheduleId()); Modified: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/bsentity/dbmeta/FacilityContentDbm.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/bsentity/dbmeta/FacilityContentDbm.java 2008-12-27 22:14:41 UTC (rev 1629) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/bsentity/dbmeta/FacilityContentDbm.java 2008-12-27 22:18:30 UTC (rev 1630) @@ -8,6 +8,7 @@ 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.helper.StringKeyMap; import jp.sf.pal.scheduler.db.exentity.FacilityContent; /** @@ -15,7 +16,6 @@ * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public class FacilityContentDbm extends AbstractDBMeta { private static final FacilityContentDbm _instance = new FacilityContentDbm(); @@ -61,40 +61,14 @@ return _columnContent; } - { - initializeColumnInfoList(); - } - //========================================================================== // ========= - // Name Map - // ======== - public Map getDbNamePropertyNameKeyToLowerMap() { - return createDbNamePropertyNameKeyToLowerMap(); + // Resource Initialization + // ======================= + { + initializeInformationResource(); } - public Map getPropertyNameDbNameKeyToLowerMap() { - return createPropertyNameDbNameKeyToLowerMap(); - } - - protected static Map _dbNamePropertyNameKeyToLowerMap; - - protected Map createDbNamePropertyNameKeyToLowerMap() { - if (_dbNamePropertyNameKeyToLowerMap == null) { - _dbNamePropertyNameKeyToLowerMap = setupKeyToLowerMap(true); - } - return _dbNamePropertyNameKeyToLowerMap; - } - - protected static Map _propertyNameDbNameKeyToLowerMap; - - protected Map createPropertyNameDbNameKeyToLowerMap() { - if (_propertyNameDbNameKeyToLowerMap == null) { - _propertyNameDbNameKeyToLowerMap = setupKeyToLowerMap(false); - } - return _propertyNameDbNameKeyToLowerMap; - } - //========================================================================== // ========= // Type Name @@ -251,7 +225,8 @@ // Entity Property Setup // ===================== // It's very INTERNAL! - protected Map> _epsMap = newHashMap(); + protected Map> _epsMap = StringKeyMap + .createAsFlexibleConcurrent(); { setupEps(_epsMap, new EpsId(), columnId()); setupEps(_epsMap, new EpsContent(), columnContent()); Modified: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/bsentity/dbmeta/FacilityDbm.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/bsentity/dbmeta/FacilityDbm.java 2008-12-27 22:14:41 UTC (rev 1629) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/bsentity/dbmeta/FacilityDbm.java 2008-12-27 22:18:30 UTC (rev 1630) @@ -9,6 +9,7 @@ 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.allcommon.helper.StringKeyMap; import jp.sf.pal.scheduler.db.exentity.Facility; /** @@ -16,7 +17,6 @@ * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public class FacilityDbm extends AbstractDBMeta { private static final FacilityDbm _instance = new FacilityDbm(); @@ -125,40 +125,14 @@ return _columnVersionno; } - { - initializeColumnInfoList(); - } - //========================================================================== // ========= - // Name Map - // ======== - public Map getDbNamePropertyNameKeyToLowerMap() { - return createDbNamePropertyNameKeyToLowerMap(); + // Resource Initialization + // ======================= + { + initializeInformationResource(); } - public Map getPropertyNameDbNameKeyToLowerMap() { - return createPropertyNameDbNameKeyToLowerMap(); - } - - protected static Map _dbNamePropertyNameKeyToLowerMap; - - protected Map createDbNamePropertyNameKeyToLowerMap() { - if (_dbNamePropertyNameKeyToLowerMap == null) { - _dbNamePropertyNameKeyToLowerMap = setupKeyToLowerMap(true); - } - return _dbNamePropertyNameKeyToLowerMap; - } - - protected static Map _propertyNameDbNameKeyToLowerMap; - - protected Map createPropertyNameDbNameKeyToLowerMap() { - if (_propertyNameDbNameKeyToLowerMap == null) { - _propertyNameDbNameKeyToLowerMap = setupKeyToLowerMap(false); - } - return _propertyNameDbNameKeyToLowerMap; - } - //========================================================================== // ========= // Type Name @@ -335,7 +309,8 @@ // Entity Property Setup // ===================== // It's very INTERNAL! - protected Map> _epsMap = newHashMap(); + protected Map> _epsMap = StringKeyMap + .createAsFlexibleConcurrent(); { setupEps(_epsMap, new EpsId(), columnId()); setupEps(_epsMap, new EpsName(), columnName()); Modified: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/bsentity/dbmeta/FacilityGroupDbm.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/bsentity/dbmeta/FacilityGroupDbm.java 2008-12-27 22:14:41 UTC (rev 1629) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/bsentity/dbmeta/FacilityGroupDbm.java 2008-12-27 22:18:30 UTC (rev 1630) @@ -8,6 +8,7 @@ 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.allcommon.helper.StringKeyMap; import jp.sf.pal.scheduler.db.exentity.FacilityGroup; /** @@ -15,7 +16,6 @@ * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public class FacilityGroupDbm extends AbstractDBMeta { private static final FacilityGroupDbm _instance = new FacilityGroupDbm(); @@ -117,40 +117,14 @@ return _columnVersionno; } - { - initializeColumnInfoList(); - } - //========================================================================== // ========= - // Name Map - // ======== - public Map getDbNamePropertyNameKeyToLowerMap() { - return createDbNamePropertyNameKeyToLowerMap(); + // Resource Initialization + // ======================= + { + initializeInformationResource(); } - public Map getPropertyNameDbNameKeyToLowerMap() { - return createPropertyNameDbNameKeyToLowerMap(); - } - - protected static Map _dbNamePropertyNameKeyToLowerMap; - - protected Map createDbNamePropertyNameKeyToLowerMap() { - if (_dbNamePropertyNameKeyToLowerMap == null) { - _dbNamePropertyNameKeyToLowerMap = setupKeyToLowerMap(true); - } - return _dbNamePropertyNameKeyToLowerMap; - } - - protected static Map _propertyNameDbNameKeyToLowerMap; - - protected Map createPropertyNameDbNameKeyToLowerMap() { - if (_propertyNameDbNameKeyToLowerMap == null) { - _propertyNameDbNameKeyToLowerMap = setupKeyToLowerMap(false); - } - return _propertyNameDbNameKeyToLowerMap; - } - //========================================================================== // ========= // Type Name @@ -313,7 +287,8 @@ // Entity Property Setup // ===================== // It's very INTERNAL! - protected Map> _epsMap = newHashMap(); + protected Map> _epsMap = StringKeyMap + .createAsFlexibleConcurrent(); { setupEps(_epsMap, new EpsId(), columnId()); setupEps(_epsMap, new EpsName(), columnName()); Modified: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/bsentity/dbmeta/FacilityScheduleMappingDbm.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/bsentity/dbmeta/FacilityScheduleMappingDbm.java 2008-12-27 22:14:41 UTC (rev 1629) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/bsentity/dbmeta/FacilityScheduleMappingDbm.java 2008-12-27 22:18:30 UTC (rev 1630) @@ -8,6 +8,7 @@ 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.helper.StringKeyMap; import jp.sf.pal.scheduler.db.exentity.FacilityScheduleMapping; /** @@ -15,7 +16,6 @@ * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public class FacilityScheduleMappingDbm extends AbstractDBMeta { private static final FacilityScheduleMappingDbm _instance = new FacilityScheduleMappingDbm(); @@ -68,40 +68,14 @@ return _columnFacilityId; } - { - initializeColumnInfoList(); - } - //========================================================================== // ========= - // Name Map - // ======== - public Map getDbNamePropertyNameKeyToLowerMap() { - return createDbNamePropertyNameKeyToLowerMap(); + // Resource Initialization + // ======================= + { + initializeInformationResource(); } - public Map getPropertyNameDbNameKeyToLowerMap() { - return createPropertyNameDbNameKeyToLowerMap(); - } - - protected static Map _dbNamePropertyNameKeyToLowerMap; - - protected Map createDbNamePropertyNameKeyToLowerMap() { - if (_dbNamePropertyNameKeyToLowerMap == null) { - _dbNamePropertyNameKeyToLowerMap = setupKeyToLowerMap(true); - } - return _dbNamePropertyNameKeyToLowerMap; - } - - protected static Map _propertyNameDbNameKeyToLowerMap; - - protected Map createPropertyNameDbNameKeyToLowerMap() { - if (_propertyNameDbNameKeyToLowerMap == null) { - _propertyNameDbNameKeyToLowerMap = setupKeyToLowerMap(false); - } - return _propertyNameDbNameKeyToLowerMap; - } - //========================================================================== // ========= // Type Name @@ -266,7 +240,8 @@ // Entity Property Setup // ===================== // It's very INTERNAL! - protected Map> _epsMap = newHashMap(); + protected Map> _epsMap = StringKeyMap + .createAsFlexibleConcurrent(); { setupEps(_epsMap, new EpsId(), columnId()); setupEps(_epsMap, new EpsScheduleId(), columnScheduleId()); Modified: 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 2008-12-27 22:14:41 UTC (rev 1629) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/bsentity/dbmeta/GroupInfoDbm.java 2008-12-27 22:18:30 UTC (rev 1630) @@ -8,6 +8,7 @@ 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.allcommon.helper.StringKeyMap; import jp.sf.pal.scheduler.db.exentity.GroupInfo; /** @@ -15,7 +16,6 @@ * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public class GroupInfoDbm extends AbstractDBMeta { private static final GroupInfoDbm _instance = new GroupInfoDbm(); @@ -138,40 +138,14 @@ return _columnVersionno; } - { - initializeColumnInfoList(); - } - //========================================================================== // ========= - // Name Map - // ======== - public Map getDbNamePropertyNameKeyToLowerMap() { - return createDbNamePropertyNameKeyToLowerMap(); + // Resource Initialization + // ======================= + { + initializeInformationResource(); } - public Map getPropertyNameDbNameKeyToLowerMap() { - return createPropertyNameDbNameKeyToLowerMap(); - } - - protected static Map _dbNamePropertyNameKeyToLowerMap; - - protected Map createDbNamePropertyNameKeyToLowerMap() { - if (_dbNamePropertyNameKeyToLowerMap == null) { - _dbNamePropertyNameKeyToLowerMap = setupKeyToLowerMap(true); - } - return _dbNamePropertyNameKeyToLowerMap; - } - - protected static Map _propertyNameDbNameKeyToLowerMap; - - protected Map createPropertyNameDbNameKeyToLowerMap() { - if (_propertyNameDbNameKeyToLowerMap == null) { - _propertyNameDbNameKeyToLowerMap = setupKeyToLowerMap(false); - } - return _propertyNameDbNameKeyToLowerMap; - } - //========================================================================== // ========= // Type Name @@ -341,7 +315,8 @@ // Entity Property Setup // ===================== // It's very INTERNAL! - protected Map> _epsMap = newHashMap(); + protected Map> _epsMap = StringKeyMap + .createAsFlexibleConcurrent(); { setupEps(_epsMap, new EpsGroupId(), columnGroupId()); setupEps(_epsMap, new EpsName(), columnName()); Modified: 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 2008-12-27 22:14:41 UTC (rev 1629) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/bsentity/dbmeta/GroupMappingDbm.java 2008-12-27 22:18:30 UTC (rev 1630) @@ -8,6 +8,7 @@ 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.helper.StringKeyMap; import jp.sf.pal.scheduler.db.exentity.GroupMapping; /** @@ -15,7 +16,6 @@ * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public class GroupMappingDbm extends AbstractDBMeta { private static final GroupMappingDbm _instance = new GroupMappingDbm(); @@ -68,40 +68,14 @@ return _columnGroupId; } - { - initializeColumnInfoList(); - } - //========================================================================== // ========= - // Name Map - // ======== - public Map getDbNamePropertyNameKeyToLowerMap() { - return createDbNamePropertyNameKeyToLowerMap(); + // Resource Initialization + // ======================= + { + initializeInformationResource(); } - public Map getPropertyNameDbNameKeyToLowerMap() { - return createPropertyNameDbNameKeyToLowerMap(); - } - - protected static Map _dbNamePropertyNameKeyToLowerMap; - - protected Map createDbNamePropertyNameKeyToLowerMap() { - if (_dbNamePropertyNameKeyToLowerMap == null) { - _dbNamePropertyNameKeyToLowerMap = setupKeyToLowerMap(true); - } - return _dbNamePropertyNameKeyToLowerMap; - } - - protected static Map _propertyNameDbNameKeyToLowerMap; - - protected Map createPropertyNameDbNameKeyToLowerMap() { - if (_propertyNameDbNameKeyToLowerMap == null) { - _propertyNameDbNameKeyToLowerMap = setupKeyToLowerMap(false); - } - return _propertyNameDbNameKeyToLowerMap; - } - //========================================================================== // ========= // Type Name @@ -263,7 +237,8 @@ // Entity Property Setup // ===================== // It's very INTERNAL! - protected Map> _epsMap = newHashMap(); + protected Map> _epsMap = StringKeyMap + .createAsFlexibleConcurrent(); { setupEps(_epsMap, new EpsId(), columnId()); setupEps(_epsMap, new EpsUserId(), columnUserId()); Modified: 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 2008-12-27 22:14:41 UTC (rev 1629) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/bsentity/dbmeta/RoleInfoDbm.java 2008-12-27 22:18:30 UTC (rev 1630) @@ -8,6 +8,7 @@ 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.allcommon.helper.StringKeyMap; import jp.sf.pal.scheduler.db.exentity.RoleInfo; /** @@ -15,7 +16,6 @@ * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public class RoleInfoDbm extends AbstractDBMeta { private static final RoleInfoDbm _instance = new RoleInfoDbm(); @@ -138,40 +138,14 @@ return _columnVersionno; } - { - initializeColumnInfoList(); - } - //========================================================================== // ========= - // Name Map - // ======== - public Map getDbNamePropertyNameKeyToLowerMap() { - return createDbNamePropertyNameKeyToLowerMap(); + // Resource Initialization + // ======================= + { + initializeInformationResource(); } - public Map getPropertyNameDbNameKeyToLowerMap() { - return createPropertyNameDbNameKeyToLowerMap(); - } - - protected static Map _dbNamePropertyNameKeyToLowerMap; - - protected Map createDbNamePropertyNameKeyToLowerMap() { - if (_dbNamePropertyNameKeyToLowerMap == null) { - _dbNamePropertyNameKeyToLowerMap = setupKeyToLowerMap(true); - } - return _dbNamePropertyNameKeyToLowerMap; - } - - protected static Map _propertyNameDbNameKeyToLowerMap; - - protected Map createPropertyNameDbNameKeyToLowerMap() { - if (_propertyNameDbNameKeyToLowerMap == null) { - _propertyNameDbNameKeyToLowerMap = setupKeyToLowerMap(false); - } - return _propertyNameDbNameKeyToLowerMap; - } - //========================================================================== // ========= // Type Name @@ -341,7 +315,8 @@ // Entity Property Setup // ===================== // It's very INTERNAL! - protected Map> _epsMap = newHashMap(); + protected Map> _epsMap = StringKeyMap + .createAsFlexibleConcurrent(); { setupEps(_epsMap, new EpsRoleId(), columnRoleId()); setupEps(_epsMap, new EpsName(), columnName()); Modified: 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 2008-12-27 22:14:41 UTC (rev 1629) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/bsentity/dbmeta/RoleMappingDbm.java 2008-12-27 22:18:30 UTC (rev 1630) @@ -8,6 +8,7 @@ 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.helper.StringKeyMap; import jp.sf.pal.scheduler.db.exentity.RoleMapping; /** @@ -15,7 +16,6 @@ * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public class RoleMappingDbm extends AbstractDBMeta { private static final RoleMappingDbm _instance = new RoleMappingDbm(); @@ -68,40 +68,14 @@ return _columnRoleId; } - { - initializeColumnInfoList(); - } - //========================================================================== // ========= - // Name Map - // ======== - public Map getDbNamePropertyNameKeyToLowerMap() { - return createDbNamePropertyNameKeyToLowerMap(); + // Resource Initialization + // ======================= + { + initializeInformationResource(); } - public Map getPropertyNameDbNameKeyToLowerMap() { - return createPropertyNameDbNameKeyToLowerMap(); - } - - protected static Map _dbNamePropertyNameKeyToLowerMap; - - protected Map createDbNamePropertyNameKeyToLowerMap() { - if (_dbNamePropertyNameKeyToLowerMap == null) { - _dbNamePropertyNameKeyToLowerMap = setupKeyToLowerMap(true); - } - return _dbNamePropertyNameKeyToLowerMap; - } - - protected static Map _propertyNameDbNameKeyToLowerMap; - - protected Map createPropertyNameDbNameKeyToLowerMap() { - if (_propertyNameDbNameKeyToLowerMap == null) { - _propertyNameDbNameKeyToLowerMap = setupKeyToLowerMap(false); - } - return _propertyNameDbNameKeyToLowerMap; - } - //========================================================================== // ========= // Type Name @@ -263,7 +237,8 @@ // Entity Property Setup // ===================== // It's very INTERNAL! - protected Map> _epsMap = newHashMap(); + protected Map> _epsMap = StringKeyMap + .createAsFlexibleConcurrent(); { setupEps(_epsMap, new EpsId(), columnId()); setupEps(_epsMap, new EpsUserId(), columnUserId()); Modified: 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 2008-12-27 22:14:41 UTC (rev 1629) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/bsentity/dbmeta/UserInfoDbm.java 2008-12-27 22:18:30 UTC (rev 1630) @@ -9,6 +9,7 @@ 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.allcommon.helper.StringKeyMap; import jp.sf.pal.scheduler.db.exentity.UserInfo; /** @@ -16,7 +17,6 @@ * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public class UserInfoDbm extends AbstractDBMeta { private static final UserInfoDbm _instance = new UserInfoDbm(); @@ -93,6 +93,9 @@ protected ColumnInfo _columnGroupId = cci("GROUP_ID", "groupId", String.class, false, 255, 0); + protected ColumnInfo _columnStatus = cci("STATUS", "status", String.class, + false, 1, 0); + protected ColumnInfo _columnCreatedTime = cci("CREATED_TIME", "createdTime", java.sql.Timestamp.class, false, null, null); @@ -174,6 +177,10 @@ return _columnGroupId; } + public ColumnInfo columnStatus() { + return _columnStatus; + } + public ColumnInfo columnCreatedTime() { return _columnCreatedTime; } @@ -202,40 +209,14 @@ return _columnVersionno; } - { - initializeColumnInfoList(); - } - //========================================================================== // ========= - // Name Map - // ======== - public Map getDbNamePropertyNameKeyToLowerMap() { - return createDbNamePropertyNameKeyToLowerMap(); + // Resource Initialization + // ======================= + { + initializeInformationResource(); } - public Map getPropertyNameDbNameKeyToLowerMap() { - return createPropertyNameDbNameKeyToLowerMap(); - } - - protected static Map _dbNamePropertyNameKeyToLowerMap; - - protected Map createDbNamePropertyNameKeyToLowerMap() { - if (_dbNamePropertyNameKeyToLowerMap == null) { - _dbNamePropertyNameKeyToLowerMap = setupKeyToLowerMap(true); - } - return _dbNamePropertyNameKeyToLowerMap; - } - - protected static Map _propertyNameDbNameKeyToLowerMap; - - protected Map createPropertyNameDbNameKeyToLowerMap() { - if (_propertyNameDbNameKeyToLowerMap == null) { - _propertyNameDbNameKeyToLowerMap = setupKeyToLowerMap(false); - } - return _propertyNameDbNameKeyToLowerMap; - } - //========================================================================== // ========= // Type Name @@ -424,7 +405,8 @@ // Entity Property Setup // ===================== // It's very INTERNAL! - protected Map> _epsMap = newHashMap(); + protected Map> _epsMap = StringKeyMap + .createAsFlexibleConcurrent(); { setupEps(_epsMap, new EpsUserId(), columnUserId()); setupEps(_epsMap, new EpsGivenName(), columnGivenName()); @@ -441,6 +423,7 @@ setupEps(_epsMap, new EpsLocale(), columnLocale()); setupEps(_epsMap, new EpsRoleId(), columnRoleId()); setupEps(_epsMap, new EpsGroupId(), columnGroupId()); + setupEps(_epsMap, new EpsStatus(), columnStatus()); setupEps(_epsMap, new EpsCreatedTime(), columnCreatedTime()); setupEps(_epsMap, new EpsCreatedBy(), columnCreatedBy()); setupEps(_epsMap, new EpsUpdatedTime(), columnUpdatedTime()); @@ -549,6 +532,12 @@ } } + public static class EpsStatus implements Eps { + public void setup(UserInfo e, Object v) { + e.setStatus((String) v); + } + } + public static class EpsCreatedTime implements Eps { public void setup(UserInfo e, Object v) { e.setCreatedTime((java.sql.Timestamp) v); Modified: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/bs/BsEventScheduleCB.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/bs/BsEventScheduleCB.java 2008-12-27 22:14:41 UTC (rev 1629) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/bs/BsEventScheduleCB.java 2008-12-27 22:18:30 UTC (rev 1630) @@ -20,7 +20,6 @@ * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public class BsEventScheduleCB extends AbstractConditionBean { //========================================================================== @@ -88,7 +87,12 @@ return _conditionQuery; } - public ConditionQuery getConditionQueryAsInterface() { + /** + * The implementation. + * + * @return The conditionQuery of the local table as interface. (NotNull) + */ + public ConditionQuery localCQ() { return getConditionQuery(); } @@ -138,24 +142,6 @@ query().xsetUnionAllQuery(cq); } - /** - * @param unionQuery The query of 'union'. (NotNull) - * @deprecated Sorry! Please use union(UnionQuery - * unionQuery). - */ - public void union(EventScheduleCQ unionQuery) { - query().xsetUnionQuery(unionQuery); - } - - /** - * @param unionQuery The query of 'union'. (NotNull) - * @deprecated Sorry! Please use unionAll(UnionQuery - * unionQuery). - */ - public void unionAll(EventScheduleCQ unionQuery) { - query().xsetUnionAllQuery(unionQuery); - } - public boolean hasUnionQueryOrUnionAllQuery() { return query().hasUnionQueryOrUnionAllQuery(); } @@ -206,7 +192,8 @@ public EventScheduleCQ qy() { return query(); } - }, _forDeriveReferrer); + }, _forDerivedReferrer, _forScalarSelect, + _forScalarSubQuery); } return _specification; } @@ -218,8 +205,10 @@ protected EventScheduleContentCB.Specification _eventScheduleContentAsOne; public Specification(ConditionBean baseCB, - SpQyCall qyCall, boolean forDeriveReferrer) { - super(baseCB, qyCall, forDeriveReferrer); + SpQyCall qyCall, boolean forDeriveReferrer, + boolean forScalarSelect, boolean forScalarSubQuery) { + super(baseCB, qyCall, forDeriveReferrer, forScalarSelect, + forScalarSubQuery); _myQyCall = qyCall; } @@ -299,7 +288,8 @@ assertForeign("eventScheduleContentAsOne"); if (_eventScheduleContentAsOne == null) { _eventScheduleContentAsOne = new EventScheduleContentCB.Specification( - _baseCB, new SpQyCall() { + _baseCB, + new SpQyCall() { public boolean has() { return _myQyCall.has() && _myQyCall @@ -311,7 +301,8 @@ return _myQyCall.qy() .queryEventScheduleContentAsOne(); } - }, _forDeriveReferrer); + }, _forDerivedReferrer, _forScalarSelect, + _forScalarSubQuery); } return _eventScheduleContentAsOne; } Modified: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/bs/BsEventScheduleContentCB.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/bs/BsEventScheduleContentCB.java 2008-12-27 22:14:41 UTC (rev 1629) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/bs/BsEventScheduleContentCB.java 2008-12-27 22:18:30 UTC (rev 1630) @@ -18,7 +18,6 @@ * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public class BsEventScheduleContentCB extends AbstractConditionBean { //========================================================================== @@ -86,7 +85,12 @@ return _conditionQuery; } - public ConditionQuery getConditionQueryAsInterface() { + /** + * The implementation. + * + * @return The conditionQuery of the local table as interface. (NotNull) + */ + public ConditionQuery localCQ() { return getConditionQuery(); } @@ -136,24 +140,6 @@ query().xsetUnionAllQuery(cq); } - /** - * @param unionQuery The query of 'union'. (NotNull) - * @deprecated Sorry! Please use union(UnionQuery - * unionQuery). - */ - public void union(EventScheduleContentCQ unionQuery) { - query().xsetUnionQuery(unionQuery); - } - - /** - * @param unionQuery The query of 'union'. (NotNull) - * @deprecated Sorry! Please use unionAll(UnionQuery - * unionQuery). - */ - public void unionAll(EventScheduleContentCQ unionQuery) { - query().xsetUnionAllQuery(unionQuery); - } - public boolean hasUnionQueryOrUnionAllQuery() { return query().hasUnionQueryOrUnionAllQuery(); } @@ -162,7 +148,6 @@ // ========= // Setup Select // ============ - protected EventScheduleNss _nssEventSchedule; public EventScheduleNss getNssEventSchedule() { @@ -203,7 +188,8 @@ public EventScheduleContentCQ qy() { return query(); } - }, _forDeriveReferrer); + }, _forDerivedReferrer, _forScalarSelect, + _forScalarSubQuery); } return _specification; } @@ -216,8 +202,10 @@ public Specification(ConditionBean baseCB, SpQyCall qyCall, - boolean forDeriveReferrer) { - super(baseCB, qyCall, forDeriveReferrer); + boolean forDeriveReferrer, boolean forScalarSelect, + boolean forScalarSubQuery) { + super(baseCB, qyCall, forDeriveReferrer, forScalarSelect, + forScalarSubQuery); _myQyCall = qyCall; } @@ -242,7 +230,8 @@ public EventScheduleCB.Specification specifyEventSchedule() { assertForeign("eventSchedule"); if (_eventSchedule == null) { - _eventSchedule = new EventScheduleCB.Specification(_baseCB, + _eventSchedule = new EventScheduleCB.Specification( + _baseCB, new SpQyCall() { public boolean has() { return _myQyCall.has() @@ -254,7 +243,8 @@ public EventScheduleCQ qy() { return _myQyCall.qy().queryEventSchedule(); } - }, _forDeriveReferrer); + }, _forDerivedReferrer, _forScalarSelect, + _forScalarSubQuery); } return _eventSchedule; } Modified: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/bs/BsEventScheduleMappingCB.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/bs/BsEventScheduleMappingCB.java 2008-12-27 22:14:41 UTC (rev 1629) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/bs/BsEventScheduleMappingCB.java 2008-12-27 22:18:30 UTC (rev 1630) @@ -21,7 +21,6 @@ * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public class BsEventScheduleMappingCB extends AbstractConditionBean { //========================================================================== @@ -89,7 +88,12 @@ return _conditionQuery; } - public ConditionQuery getConditionQueryAsInterface() { + /** + * The implementation. + * + * @return The conditionQuery of the local table as interface. (NotNull) + */ + public ConditionQuery localCQ() { return getConditionQuery(); } @@ -139,24 +143,6 @@ query().xsetUnionAllQuery(cq); } - /** - * @param unionQuery The query of 'union'. (NotNull) - * @deprecated Sorry! Please use union(UnionQuery - * unionQuery). - */ - public void union(EventScheduleMappingCQ unionQuery) { - query().xsetUnionQuery(unionQuery); - } - - /** - * @param unionQuery The query of 'union'. (NotNull) - * @deprecated Sorry! Please use unionAll(UnionQuery - * unionQuery). - */ - public void unionAll(EventScheduleMappingCQ unionQuery) { - query().xsetUnionAllQuery(unionQuery); - } - public boolean hasUnionQueryOrUnionAllQuery() { return query().hasUnionQueryOrUnionAllQuery(); } @@ -165,7 +151,6 @@ // ========= // Setup Select // ============ - protected EventScheduleNss _nssEventSchedule; public EventScheduleNss getNssEventSchedule() { @@ -227,7 +212,8 @@ public EventScheduleMappingCQ qy() { return query(); } - }, _forDeriveReferrer); + }, _forDerivedReferrer, _forScalarSelect, + _forScalarSubQuery); } return _specification; } @@ -242,8 +228,10 @@ public Specification(ConditionBean baseCB, SpQyCall qyCall, - boolean forDeriveReferrer) { - super(baseCB, qyCall, forDeriveReferrer); + boolean forDeriveReferrer, boolean forScalarSelect, + boolean forScalarSubQuery) { + super(baseCB, qyCall, forDeriveReferrer, forScalarSelect, + forScalarSubQuery); _myQyCall = qyCall; } @@ -276,7 +264,8 @@ public EventScheduleCB.Specification specifyEventSchedule() { assertForeign("eventSchedule"); if (_eventSchedule == null) { - _eventSchedule = new EventScheduleCB.Specification(_baseCB, + _eventSchedule = new EventScheduleCB.Specification( + _baseCB, new SpQyCall() { public boolean has() { return _myQyCall.has() @@ -288,7 +277,8 @@ public EventScheduleCQ qy() { return _myQyCall.qy().queryEventSchedule(); } - }, _forDeriveReferrer); + }, _forDerivedReferrer, _forScalarSelect, + _forScalarSubQuery); } return _eventSchedule; } @@ -307,7 +297,8 @@ public UserInfoCQ qy() { return _myQyCall.qy().queryUserInfo(); } - }, _forDeriveReferrer); + }, _forDerivedReferrer, _forScalarSelect, + _forScalarSubQuery); } return _userInfo; } Modified: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/bs/BsFacilityCB.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/bs/BsFacilityCB.java 2008-12-27 22:14:41 UTC (rev 1629) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/bs/BsFacilityCB.java 2008-12-27 22:18:30 UTC (rev 1630) @@ -22,7 +22,6 @@ * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public class BsFacilityCB extends AbstractConditionBean { //========================================================================== @@ -90,7 +89,12 @@ return _conditionQuery; } - public ConditionQuery getConditionQueryAsInterface() { + /** + * The implementation. + * + * @return The conditionQuery of the local table as interface. (NotNull) + */ + public ConditionQuery localCQ() { return getConditionQuery(); } @@ -140,23 +144,6 @@ query().xsetUnionAllQuery(cq); } - /** - * @param unionQuery The query of 'union'. (NotNull) - * @deprecated Sorry! Please use union(UnionQuery unionQuery). - */ - public void union(FacilityCQ unionQuery) { - query().xsetUnionQuery(unionQuery); - } - - /** - * @param unionQuery The query of 'union'. (NotNull) - * @deprecated Sorry! Please use unionAll(UnionQuery - * unionQuery). - */ - public void unionAll(FacilityCQ unionQuery) { - query().xsetUnionAllQuery(unionQuery); - } - public boolean hasUnionQueryOrUnionAllQuery() { return query().hasUnionQueryOrUnionAllQuery(); } @@ -165,7 +152,6 @@ // ========= // Setup Select // ============ - protected FacilityGroupNss _nssFacilityGroup; public FacilityGroupNss getNssFacilityGroup() { @@ -229,7 +215,8 @@ public FacilityCQ qy() { return query(); } - }, _forDeriveReferrer); + }, _forDerivedReferrer, _forScalarSelect, + _forScalarSubQuery); } return _specification; } @@ -242,8 +229,10 @@ protected FacilityContentCB.Specification _facilityContentAsOne; public Specification(ConditionBean baseCB, SpQyCall qyCall, - boolean forDeriveReferrer) { - super(baseCB, qyCall, forDeriveReferrer); + boolean forDeriveReferrer, boolean forScalarSelect, + boolean forScalarSubQuery) { + super(baseCB, qyCall, forDeriveReferrer, forScalarSelect, + forScalarSubQuery); _myQyCall = qyCall; } @@ -305,7 +294,8 @@ public FacilityGroupCB.Specification specifyFacilityGroup() { assertForeign("facilityGroup"); if (_facilityGroup == null) { - _facilityGroup = new FacilityGroupCB.Specification(_baseCB, + _facilityGroup = new FacilityGroupCB.Specification( + _baseCB, new SpQyCall() { public boolean has() { return _myQyCall.has() @@ -317,7 +307,8 @@ public FacilityGroupCQ qy() { return _myQyCall.qy().queryFacilityGroup(); } - }, _forDeriveReferrer); + }, _forDerivedReferrer, _forScalarSelect, + _forScalarSubQuery); } return _facilityGroup; } @@ -326,7 +317,8 @@ assertForeign("facilityContentAsOne"); if (_facilityContentAsOne == null) { _facilityContentAsOne = new FacilityContentCB.Specification( - _baseCB, new SpQyCall() { + _baseCB, + new SpQyCall() { public boolean has() { return _myQyCall.has() && _myQyCall @@ -338,7 +330,8 @@ return _myQyCall.qy() .queryFacilityContentAsOne(); } - }, _forDeriveReferrer); + }, _forDerivedReferrer, _forScalarSelect, + _forScalarSubQuery); } return _facilityContentAsOne; } Modified: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/bs/BsFacilityContentCB.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/bs/BsFacilityContentCB.java 2008-12-27 22:14:41 UTC (rev 1629) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/bs/BsFacilityContentCB.java 2008-12-27 22:18:30 UTC (rev 1630) @@ -18,7 +18,6 @@ * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public class BsFacilityContentCB extends AbstractConditionBean { //========================================================================== @@ -86,7 +85,12 @@ return _conditionQuery; } - public ConditionQuery getConditionQueryAsInterface() { + /** + * The implementation. + * + * @return The conditionQuery of the local table as interface. (NotNull) + */ + public ConditionQuery localCQ() { return getConditionQuery(); } @@ -136,24 +140,6 @@ query().xsetUnionAllQuery(cq); } - /** - * @param unionQuery The query of 'union'. (NotNull) - * @deprecated Sorry! Please use union(UnionQuery - * unionQuery). - */ - public void union(FacilityContentCQ unionQuery) { - query().xsetUnionQuery(unionQuery); - } - - /** - * @param unionQuery The query of 'union'. (NotNull) - * @deprecated Sorry! Please use unionAll(UnionQuery - * unionQuery). - */ - public void unionAll(FacilityContentCQ unionQuery) { - query().xsetUnionAllQuery(unionQuery); - } - public boolean hasUnionQueryOrUnionAllQuery() { return query().hasUnionQueryOrUnionAllQuery(); } @@ -162,7 +148,6 @@ // ========= // Setup Select // ============ - protected FacilityNss _nssFacility; public FacilityNss getNssFacility() { @@ -202,7 +187,8 @@ public FacilityContentCQ qy() { return query(); } - }, _forDeriveReferrer); + }, _forDerivedReferrer, _forScalarSelect, + _forScalarSubQuery); } return _specification; } @@ -214,8 +200,10 @@ protected FacilityCB.Specification _facility; public Specification(ConditionBean baseCB, - SpQyCall qyCall, boolean forDeriveReferrer) { - super(baseCB, qyCall, forDeriveReferrer); + SpQyCall qyCall, boolean forDeriveReferrer, + boolean forScalarSelect, boolean forScalarSubQuery) { + super(baseCB, qyCall, forDeriveReferrer, forScalarSelect, + forScalarSubQuery); _myQyCall = qyCall; } @@ -251,7 +239,8 @@ public FacilityCQ qy() { return _myQyCall.qy().queryFacility(); } - }, _forDeriveReferrer); + }, _forDerivedReferrer, _forScalarSelect, + _forScalarSubQuery); } return _facility; } Modified: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/bs/BsFacilityGroupCB.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/bs/BsFacilityGroupCB.java 2008-12-27 22:14:41 UTC (rev 1629) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/bs/BsFacilityGroupCB.java 2008-12-27 22:18:30 UTC (rev 1630) @@ -16,7 +16,6 @@ * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public class BsFacilityGroupCB extends AbstractConditionBean { //========================================================================== @@ -84,7 +83,12 @@ return _conditionQuery; } - public ConditionQuery getConditionQueryAsInterface() { + /** + * The implementation. + * + * @return The conditionQuery of the local table as interface. (NotNull) + */ + public ConditionQuery localCQ() { return getConditionQuery(); } @@ -134,24 +138,6 @@ query().xsetUnionAllQuery(cq); } - /** - * @param unionQuery The query of 'union'. (NotNull) - * @deprecated Sorry! Please use union(UnionQuery - * unionQuery). - */ - public void union(FacilityGroupCQ unionQuery) { - query().xsetUnionQuery(unionQuery); - } - - /** - * @param unionQuery The query of 'union'. (NotNull) - * @deprecated Sorry! Please use unionAll(UnionQuery - * unionQuery). - */ - public void unionAll(FacilityGroupCQ unionQuery) { - query().xsetUnionAllQuery(unionQuery); - } - public boolean hasUnionQueryOrUnionAllQuery() { return query().hasUnionQueryOrUnionAllQuery(); } @@ -179,7 +165,8 @@ public FacilityGroupCQ qy() { return query(); } - }, _forDeriveReferrer); + }, _forDerivedReferrer, _forScalarSelect, + _forScalarSubQuery); } return _specification; } @@ -189,8 +176,10 @@ protected SpQyCall _myQyCall; public Specification(ConditionBean baseCB, - SpQyCall qyCall, boolean forDeriveReferrer) { - super(baseCB, qyCall, forDeriveReferrer); + SpQyCall qyCall, boolean forDeriveReferrer, + boolean forScalarSelect, boolean forScalarSubQuery) { + super(baseCB, qyCall, forDeriveReferrer, forScalarSelect, + forScalarSubQuery); _myQyCall = qyCall; } Modified: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/bs/BsFacilityScheduleMappingCB.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/bs/BsFacilityScheduleMappingCB.java 2008-12-27 22:14:41 UTC (rev 1629) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/bs/BsFacilityScheduleMappingCB.java 2008-12-27 22:18:30 UTC (rev 1630) @@ -21,7 +21,6 @@ * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public class BsFacilityScheduleMappingCB extends AbstractConditionBean { //========================================================================== @@ -89,7 +88,12 @@ return _conditionQuery; } - public ConditionQuery getConditionQueryAsInterface() { + /** + * The implementation. + * + * @return The conditionQuery of the local table as interface. (NotNull) + */ + public ConditionQuery localCQ() { return getConditionQuery(); } @@ -139,24 +143,6 @@ query().xsetUnionAllQuery(cq); } - /** - * @param unionQuery The query of 'union'. (NotNull) - * @deprecated Sorry! Please use union(UnionQuery - * unionQuery). - */ - public void union(FacilityScheduleMappingCQ unionQuery) { - query().xsetUnionQuery(unionQuery); - } - - /** - * @param unionQuery The query of 'union'. (NotNull) - * @deprecated Sorry! Please use - * unionAll(UnionQuery unionQuery). - */ - public void unionAll(FacilityScheduleMappingCQ unionQuery) { - query().xsetUnionAllQuery(unionQuery); - } - public boolean hasUnionQueryOrUnionAllQuery() { return query().hasUnionQueryOrUnionAllQuery(); } @@ -165,7 +151,6 @@ // ========= // Setup Select // ============ - protected EventScheduleNss _nssEventSchedule; public EventScheduleNss getNssEventSchedule() { @@ -227,7 +212,8 @@ public FacilityScheduleMappingCQ qy() { return query(); } - }, _forDeriveReferrer); + }, _forDerivedReferrer, _forScalarSelect, + _forScalarSubQuery); } return _specification; } @@ -242,8 +228,10 @@ public Specification(ConditionBean baseCB, SpQyCall qyCall, - boolean forDeriveReferrer) { - super(baseCB, qyCall, forDeriveReferrer); + boolean forDeriveReferrer, boolean forScalarSelect, + boolean forScalarSubQuery) { + super(baseCB, qyCall, forDeriveReferrer, forScalarSelect, + forScalarSubQuery); _myQyCall = qyCall; } @@ -276,7 +264,8 @@ public EventScheduleCB.Specification specifyEventSchedule() { assertForeign("eventSchedule"); if (_eventSchedule == null) { - _eventSchedule = new EventScheduleCB.Specification(_baseCB, + _eventSchedule = new EventScheduleCB.Specification( + _baseCB, new SpQyCall() { public boolean has() { return _myQyCall.has() @@ -288,7 +277,8 @@ public EventScheduleCQ qy() { return _myQyCall.qy().queryEventSchedule(); } - }, _forDeriveReferrer); + }, _forDerivedReferrer, _forScalarSelect, + _forScalarSubQuery); } return _eventSchedule; } @@ -307,7 +297,8 @@ public FacilityCQ qy() { return _myQyCall.qy().queryFacility(); } - }, _forDeriveReferrer); + }, _forDerivedReferrer, _forScalarSelect, + _forScalarSubQuery); } return _facility; } Modified: 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 2008-12-27 22:14:41 UTC (rev 1629) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/bs/BsGroupInfoCB.java 2008-12-27 22:18:30 UTC (rev 1630) @@ -17,7 +17,6 @@ * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public class BsGroupInfoCB extends AbstractConditionBean { //========================================================================== @@ -86,7 +85,12 @@ return _conditionQuery; } - public ConditionQuery getConditionQueryAsInterface() { + /** + * The implementation. + * + * @return The conditionQuery of the local table as interface. (NotNull) + */ + public ConditionQuery localCQ() { return getConditionQuery(); } @@ -136,23 +140,6 @@ query().xsetUnionAllQuery(cq); } - /** - * @param unionQuery The query of 'union'. (NotNull) - * @deprecated Sorry! Please use union(UnionQuery unionQuery). - */ - public void union(GroupInfoCQ unionQuery) { - query().xsetUnionQuery(unionQuery); - } - - /** - * @param unionQuery The query of 'union'. (NotNull) - * @deprecated Sorry! Please use unionAll(UnionQuery - * unionQuery). - */ - public void unionAll(GroupInfoCQ unionQuery) { - query().xsetUnionAllQuery(unionQuery); - } - public boolean hasUnionQueryOrUnionAllQuery() { return query().hasUnionQueryOrUnionAllQuery(); } @@ -180,7 +167,8 @@ public GroupInfoCQ qy() { return query(); } - }, _forDeriveReferrer); + }, _forDerivedReferrer, _forScalarSelect, + _forScalarSubQuery); } return _specification; } @@ -190,8 +178,10 @@ protected SpQyCall _myQyCall; public Specification(ConditionBean baseCB, - SpQyCall qyCall, boolean forDeriveReferrer) { - super(baseCB, qyCall, forDeriveReferrer); + SpQyCall qyCall, boolean forDeriveReferrer, + boolean forScalarSelect, boolean forScalarSubQuery) { + super(baseCB, qyCall, forDeriveReferrer, forScalarSelect, + forScalarSubQuery); _myQyCall = qyCall; } Modified: 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 2008-12-27 22:14:41 UTC (rev 1629) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/bs/BsGroupMappingCB.java 2008-12-27 22:18:30 UTC (rev 1630) @@ -21,7 +21,6 @@ * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public class BsGroupMappingCB extends AbstractConditionBean { //========================================================================== @@ -89,7 +88,12 @@ return _conditionQuery; } - public ConditionQuery getConditionQueryAsInterface() { + /** + * The implementation. + * + * @return The conditionQuery of the local table as interface. (NotNull) + */ + public ConditionQuery localCQ() { return getConditionQuery(); } @@ -139,24 +143,6 @@ query().xsetUnionAllQuery(cq); } - /** - * @param unionQuery The query of 'union'. (NotNull) - * @deprecated Sorry! Please use union(UnionQuery - * unionQuery). - */ - public void union(GroupMappingCQ unionQuery) { - query().xsetUnionQuery(unionQuery); - } - - /** - * @param unionQuery The query of 'union'. (NotNull) - * @deprecated Sorry! Please use unionAll(UnionQuery - * unionQuery). - */ - public void unionAll(GroupMappingCQ unionQuery) { - query().xsetUnionAllQuery(unionQuery); - } - public boolean hasUnionQueryOrUnionAllQuery() { return query().hasUnionQueryOrUnionAllQuery(); } @@ -165,7 +151,6 @@ // ========= // Setup Select // ============ - protected GroupInfoNss _nssGroupInfo; public GroupInfoNss getNssGroupInfo() { @@ -226,7 +211,8 @@ public GroupMappingCQ qy() { return query(); } - }, _forDeriveReferrer); + }, _forDerivedReferrer, _forScalarSelect, + _forScalarSubQuery); } return _specification; } @@ -240,8 +226,10 @@ protected UserInfoCB.Specification _userInfo; public Specification(ConditionBean baseCB, - SpQyCall qyCall, boolean forDeriveReferrer) { - super(baseCB, qyCall, forDeriveReferrer); + SpQyCall qyCall, boolean forDeriveReferrer, + boolean forScalarSelect, boolean forScalarSubQuery) { + super(baseCB, qyCall, forDeriveReferrer, forScalarSelect, + forScalarSubQuery); _myQyCall = qyCall; } @@ -285,7 +273,8 @@ public GroupInfoCQ qy() { return _myQyCall.qy().queryGroupInfo(); } - }, _forDeriveReferrer); + }, _forDerivedReferrer, _forScalarSelect, + _forScalarSubQuery); } return _groupInfo; } @@ -304,7 +293,8 @@ public UserInfoCQ qy() { return _myQyCall.qy().queryUserInfo(); } - }, _forDeriveReferrer); + }, _forDerivedReferrer, _forScalarSelect, + _forScalarSubQuery); } return _userInfo; } Modified: 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 2008-12-27 22:14:41 UTC (rev 1629) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/bs/BsRoleInfoCB.java 2008-12-27 22:18:30 UTC (rev 1630) @@ -17,7 +17,6 @@ * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public class BsRoleInfoCB extends AbstractConditionBean { //========================================================================== @@ -86,7 +85,12 @@ return _conditionQuery; } - public ConditionQuery getConditionQueryAsInterface() { + /** + * The implementation. + * + * @return The conditionQuery of the local table as interface. (NotNull) + */ + public ConditionQuery localCQ() { return getConditionQuery(); } @@ -136,23 +140,6 @@ query().xsetUnionAllQuery(cq); } - /** - * @param unionQuery The query of 'union'. (NotNull) - * @deprecated Sorry! Please use union(UnionQuery unionQuery). - */ - public void union(RoleInfoCQ unionQuery) { - query().xsetUnionQuery(unionQuery); - } - - /** - * @param unionQuery The query of 'union'. (NotNull) - * @deprecated Sorry! Please use unionAll(UnionQuery - * unionQuery). - */ - public void unionAll(RoleInfoCQ unionQuery) { - query().xsetUnionAllQuery(unionQuery); - } - public boolean hasUnionQueryOrUnionAllQuery() { return query().hasUnionQueryOrUnionAllQuery(); } @@ -180,7 +167,8 @@ public RoleInfoCQ qy() { return query(); } - }, _forDeriveReferrer); + }, _forDerivedReferrer, _forScalarSelect, + _forScalarSubQuery); } return _specification; } @@ -189,8 +177,10 @@ protected SpQyCall _myQyCall; public Specification(ConditionBean baseCB, SpQyCall qyCall, - boolean forDeriveReferrer) { - super(baseCB, qyCall, forDeriveReferrer); + boolean forDeriveReferrer, boolean forScalarSelect, + boolean forScalarSubQuery) { + super(baseCB, qyCall, forDeriveReferrer, forScalarSelect, + forScalarSubQuery); _myQyCall = qyCall; } Modified: 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 2008-12-27 22:14:41 UTC (rev 1629) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/bs/BsRoleMappingCB.java 2008-12-27 22:18:30 UTC (rev 1630) @@ -21,7 +21,6 @@ * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public class BsRoleMappingCB extends AbstractConditionBean { //========================================================================== @@ -89,7 +88,12 @@ return _conditionQuery; } - public ConditionQuery getConditionQueryAsInterface() { + /** + * The implementation. + * + * @return The conditionQuery of the local table as interface. (NotNull) + */ + public ConditionQuery localCQ() { return getConditionQuery(); } @@ -139,24 +143,6 @@ query().xsetUnionAllQuery(cq); } - /** - * @param unionQuery The query of 'union'. (NotNull) - * @deprecated Sorry! Please use union(UnionQuery - * unionQuery). - */ - public void union(RoleMappingCQ unionQuery) { - query().xsetUnionQuery(unionQuery); - } - - /** - * @param unionQuery The query of 'union'. (NotNull) - * @deprecated Sorry! Please use unionAll(UnionQuery - * unionQuery). - */ - public void unionAll(RoleMappingCQ unionQuery) { - query().xsetUnionAllQuery(unionQuery); - } - public boolean hasUnionQueryOrUnionAllQuery() { return query().hasUnionQueryOrUnionAllQuery(); } @@ -165,7 +151,6 @@ // ========= // Setup Select // ============ - protected RoleInfoNss _nssRoleInfo; public RoleInfoNss getNssRoleInfo() { @@ -226,7 +211,8 @@ public RoleMappingCQ qy() { return query(); } - }, _forDeriveReferrer); + }, _forDerivedReferrer, _forScalarSelect, + _forScalarSubQuery); } return _specification; } @@ -240,8 +226,10 @@ protected UserInfoCB.Specification _userInfo; public Specification(ConditionBean baseCB, - SpQyCall qyCall, boolean forDeriveReferrer) { - super(baseCB, qyCall, forDeriveReferrer); + SpQyCall qyCall, boolean forDeriveReferrer, + boolean forScalarSelect, boolean forScalarSubQuery) { + super(baseCB, qyCall, forDeriveReferrer, forScalarSelect, + forScalarSubQuery); _myQyCall = qyCall; } @@ -285,7 +273,8 @@ public RoleInfoCQ qy() { return _myQyCall.qy().queryRoleInfo(); } - }, _forDeriveReferrer); + }, _forDerivedReferrer, _forScalarSelect, + _forScalarSubQuery); } return _roleInfo; } @@ -304,7 +293,8 @@ public UserInfoCQ qy() { return _myQyCall.qy().queryUserInfo(); } - }, _forDeriveReferrer); + }, _forDerivedReferrer, _forScalarSelect, + _forScalarSubQuery); } return _userInfo; } Modified: 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 2008-12-27 22:14:41 UTC (rev 1629) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/bs/BsUserInfoCB.java 2008-12-27 22:18:30 UTC (rev 1630) @@ -24,7 +24,6 @@ * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public class BsUserInfoCB extends AbstractConditionBean { //========================================================================== @@ -93,7 +92,12 @@ return _conditionQuery; } - public ConditionQuery getConditionQueryAsInterface() { + /** + * The implementation. + * + * @return The conditionQuery of the local table as interface. (NotNull) + */ + public ConditionQuery localCQ() { return getConditionQuery(); } @@ -143,23 +147,6 @@ query().xsetUnionAllQuery(cq); } - /** - * @param unionQuery The query of 'union'. (NotNull) - * @deprecated Sorry! Please use union(UnionQuery unionQuery). - */ - public void union(UserInfoCQ unionQuery) { - query().xsetUnionQuery(unionQuery); - } - - /** - * @param unionQuery The query of 'union'. (NotNull) - * @deprecated Sorry! Please use unionAll(UnionQuery - * unionQuery). - */ - public void unionAll(UserInfoCQ unionQuery) { - query().xsetUnionAllQuery(unionQuery); - } - public boolean hasUnionQueryOrUnionAllQuery() { return query().hasUnionQueryOrUnionAllQuery(); } @@ -168,7 +155,6 @@ // ========= // Setup Select // ============ - protected GroupInfoNss _nssGroupInfo; public GroupInfoNss getNssGroupInfo() { @@ -229,7 +215,8 @@ public UserInfoCQ qy() { return query(); } - }, _forDeriveReferrer); + }, _forDerivedReferrer, _forScalarSelect, + _forScalarSubQuery); } return _specification; } @@ -242,8 +229,10 @@ protected RoleInfoCB.Specification _roleInfo; public Specification(ConditionBean baseCB, SpQyCall qyCall, - boolean forDeriveReferrer) { - super(baseCB, qyCall, forDeriveReferrer); + boolean forDeriveReferrer, boolean forScalarSelect, + boolean forScalarSubQuery) { + super(baseCB, qyCall, forDeriveReferrer, forScalarSelect, + forScalarSubQuery); _myQyCall = qyCall; } @@ -307,6 +296,10 @@ doColumn("GROUP_ID"); } + public void columnStatus() { + doColumn("STATUS"); + } + public void columnCreatedTime() { doColumn("CREATED_TIME"); } @@ -363,7 +356,8 @@ public GroupInfoCQ qy() { return _myQyCall.qy().queryGroupInfo(); } - }, _forDeriveReferrer); + }, _forDerivedReferrer, _forScalarSelect, + _forScalarSubQuery); } return _groupInfo; } @@ -382,7 +376,8 @@ public RoleInfoCQ qy() { return _myQyCall.qy().queryRoleInfo(); } - }, _forDeriveReferrer); + }, _forDerivedReferrer, _forScalarSelect, + _forScalarSubQuery); } return _roleInfo; } Modified: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/cq/bs/AbstractBsEventScheduleCQ.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/cq/bs/AbstractBsEventScheduleCQ.java 2008-12-27 22:14:41 UTC (rev 1629) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/cq/bs/AbstractBsEventScheduleCQ.java 2008-12-27 22:18:30 UTC (rev 1630) @@ -22,7 +22,6 @@ * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public abstract class AbstractBsEventScheduleCQ extends AbstractConditionQuery { //========================================================================== @@ -52,7 +51,8 @@ // ===== /** - * Equal(=). And NullIgnored, OnceRegistered. {PK : ID : NotNull : BIGINT} + * Equal(=). And NullIgnored, OnlyOnceRegistered. {PK : ID : NotNull : + * BIGINT} * * @param id The value of id as equal. */ @@ -61,7 +61,7 @@ } /** - * NotEqual(!=). And NullIgnored, OnceRegistered. + * NotEqual(!=). And NullIgnored, OnlyOnceRegistered. * * @param id The value of id as notEqual. */ @@ -70,7 +70,7 @@ } /** - * GreaterThan(>). And NullIgnored, OnceRegistered. + * GreaterThan(>). And NullIgnored, OnlyOnceRegistered. * * @param id The value of id as greaterThan. */ @@ -79,7 +79,7 @@ } /** - * LessThan(<). And NullIgnored, OnceRegistered. + * LessThan(<). And NullIgnored, OnlyOnceRegistered. * * @param id The value of id as lessThan. */ @@ -88,7 +88,7 @@ } /** - * GreaterEqual(>=). And NullIgnored, OnceRegistered. + * GreaterEqual(>=). And NullIgnored, OnlyOnceRegistered. * * @param id The value of id as greaterEqual. */ @@ -97,7 +97,7 @@ } /** - * LessEqual(<=). And NullIgnored, OnceRegistered. + * LessEqual(<=). And NullIgnored, OnlyOnceRegistered. * * @param id The value of id as lessEqual. */ @@ -125,22 +125,6 @@ regId(CK_NINS, cTL(idList)); } - /** - * @param eventScheduleContentCBquery Query. - * @deprecated Please use inScopeEventScheduleContentAsOne(subQuery) method. - */ - public void setId_InScopeSubQuery_EventScheduleContentAsOne( - EventScheduleContentCQ eventScheduleContentCBquery) { - String subQueryPropertyName = keepId_InScopeSubQuery_EventScheduleContentAsOne(eventScheduleContentCBquery);// for - // saving - // query - // - - // value - // . - registerInScopeSubQuery(eventScheduleContentCBquery, "ID", "ID", - subQueryPropertyName); - } - public void inScopeEventScheduleContentAsOne( SubQuery subQuery) { assertObjectNotNull("subQuery", subQuery); @@ -148,29 +132,13 @@ cb.xsetupForInScopeSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepId_InScopeSubQuery_EventScheduleContentAsOne(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerInScopeSubQuery(cb.query(), "ID", "ID", subQueryPropertyName); } - abstract public String keepId_InScopeSubQuery_EventScheduleContentAsOne( + public abstract String keepId_InScopeSubQuery_EventScheduleContentAsOne( EventScheduleContentCQ subQuery); - /** - * @param eventScheduleMappingCBquery Query. - * @deprecated Please use inScopeEventScheduleMappingList(subQuery) method. - */ - public void setId_InScopeSubQuery_EventScheduleMappingList( - EventScheduleMappingCQ eventScheduleMappingCBquery) { - String subQueryPropertyName = keepId_InScopeSubQuery_EventScheduleMappingList(eventScheduleMappingCBquery);// for - // saving - // query - // - - // value - // . - registerInScopeSubQuery(eventScheduleMappingCBquery, "ID", - "SCHEDULE_ID", subQueryPropertyName); - } - public void inScopeEventScheduleMappingList( SubQuery subQuery) { assertObjectNotNull("subQuery", subQuery); @@ -178,31 +146,14 @@ cb.xsetupForInScopeSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepId_InScopeSubQuery_EventScheduleMappingList(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerInScopeSubQuery(cb.query(), "ID", "SCHEDULE_ID", subQueryPropertyName); } - abstract public String keepId_InScopeSubQuery_EventScheduleMappingList( + public abstract String keepId_InScopeSubQuery_EventScheduleMappingList( EventScheduleMappingCQ subQuery); - /** - * @param facilityScheduleMappingCBquery Query. - * @deprecated Please use inScopeFacilityScheduleMappingList(subQuery) - * method. - */ - public void setId_InScopeSubQuery_FacilityScheduleMappingList( - FacilityScheduleMappingCQ facilityScheduleMappingCBquery) { - String subQueryPropertyName = keepId_InScopeSubQuery_FacilityScheduleMappingList(facilityScheduleMappingCBquery);// for - // saving - // query - // - - // value - // . - registerInScopeSubQuery(facilityScheduleMappingCBquery, "ID", - "SCHEDULE_ID", subQueryPropertyName); - } - public void inScopeFacilityScheduleMappingList( SubQuery subQuery) { assertObjectNotNull("subQuery", subQuery); @@ -210,12 +161,12 @@ cb.xsetupForInScopeSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepId_InScopeSubQuery_FacilityScheduleMappingList(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerInScopeSubQuery(cb.query(), "ID", "SCHEDULE_ID", subQueryPropertyName); } - abstract public String keepId_InScopeSubQuery_FacilityScheduleMappingList( + public abstract String keepId_InScopeSubQuery_FacilityScheduleMappingList( FacilityScheduleMappingCQ subQuery); public void notInScopeEventScheduleContentAsOne( @@ -225,11 +176,11 @@ cb.xsetupForInScopeSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepId_NotInScopeSubQuery_EventScheduleContentAsOne(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerNotInScopeSubQuery(cb.query(), "ID", "ID", subQueryPropertyName); } - abstract public String keepId_NotInScopeSubQuery_EventScheduleContentAsOne( + public abstract String keepId_NotInScopeSubQuery_EventScheduleContentAsOne( EventScheduleContentCQ subQuery); public void notInScopeEventScheduleMappingList( @@ -239,12 +190,12 @@ cb.xsetupForInScopeSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepId_NotInScopeSubQuery_EventScheduleMappingList(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerNotInScopeSubQuery(cb.query(), "ID", "SCHEDULE_ID", subQueryPropertyName); } - abstract public String keepId_NotInScopeSubQuery_EventScheduleMappingList( + public abstract String keepId_NotInScopeSubQuery_EventScheduleMappingList( EventScheduleMappingCQ subQuery); public void notInScopeFacilityScheduleMappingList( @@ -254,31 +205,15 @@ cb.xsetupForInScopeSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepId_NotInScopeSubQuery_FacilityScheduleMappingList(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerNotInScopeSubQuery(cb.query(), "ID", "SCHEDULE_ID", subQueryPropertyName); } - abstract public String keepId_NotInScopeSubQuery_FacilityScheduleMappingList( + public abstract String keepId_NotInScopeSubQuery_FacilityScheduleMappingList( FacilityScheduleMappingCQ subQuery); /** - * @param eventScheduleContentCBquery Query. - * @deprecated Please use existsEventScheduleContentAsOne(subQuery) method. - */ - public void setId_ExistsSubQuery_EventScheduleContentAsOne( - EventScheduleContentCQ eventScheduleContentCBquery) { - String subQueryPropertyName = keepId_ExistsSubQuery_EventScheduleContentAsOne(eventScheduleContentCBquery);// for - // saving - // query - // - - // value - // . - registerExistsSubQuery(eventScheduleContentCBquery, "ID", "ID", - subQueryPropertyName); - } - - /** * Set up 'exists' sub-query. {exists (select ID from EVENT_SCHEDULE_CONTENT * where ...)} * @@ -293,30 +228,14 @@ cb.xsetupForExistsSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepId_ExistsSubQuery_EventScheduleContentAsOne(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerExistsSubQuery(cb.query(), "ID", "ID", subQueryPropertyName); } - abstract public String keepId_ExistsSubQuery_EventScheduleContentAsOne( + public abstract String keepId_ExistsSubQuery_EventScheduleContentAsOne( EventScheduleContentCQ subQuery); /** - * @param eventScheduleMappingCBquery Query. - * @deprecated Please use existsEventScheduleMappingList(subQuery) method. - */ - public void setId_ExistsSubQuery_EventScheduleMappingList( - EventScheduleMappingCQ eventScheduleMappingCBquery) { - String subQueryPropertyName = keepId_ExistsSubQuery_EventScheduleMappingList(eventScheduleMappingCBquery);// for - // saving - // query - // - - // value - // . - registerExistsSubQuery(eventScheduleMappingCBquery, "ID", - "SCHEDULE_ID", subQueryPropertyName); - } - - /** * Set up 'exists' sub-query. {exists (select SCHEDULE_ID from * EVENT_SCHEDULE_MAPPING where ...)} * @@ -331,32 +250,15 @@ cb.xsetupForExistsSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepId_ExistsSubQuery_EventScheduleMappingList(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerExistsSubQuery(cb.query(), "ID", "SCHEDULE_ID", subQueryPropertyName); } - abstract public String keepId_ExistsSubQuery_EventScheduleMappingList( + public abstract String keepId_ExistsSubQuery_EventScheduleMappingList( EventScheduleMappingCQ subQuery); /** - * @param facilityScheduleMappingCBquery Query. - * @deprecated Please use existsFacilityScheduleMappingList(subQuery) - * method. - */ - public void setId_ExistsSubQuery_FacilityScheduleMappingList( - FacilityScheduleMappingCQ facilityScheduleMappingCBquery) { - String subQueryPropertyName = keepId_ExistsSubQuery_FacilityScheduleMappingList(facilityScheduleMappingCBquery);// for - // saving - // query - // - - // value - // . - registerExistsSubQuery(facilityScheduleMappingCBquery, "ID", - "SCHEDULE_ID", subQueryPropertyName); - } - - /** * Set up 'exists' sub-query. {exists (select SCHEDULE_ID from * FACILITY_SCHEDULE_MAPPING where ...)} * @@ -371,12 +273,12 @@ cb.xsetupForExistsSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepId_ExistsSubQuery_FacilityScheduleMappingList(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerExistsSubQuery(cb.query(), "ID", "SCHEDULE_ID", subQueryPropertyName); } - abstract public String keepId_ExistsSubQuery_FacilityScheduleMappingList( + public abstract String keepId_ExistsSubQuery_FacilityScheduleMappingList( FacilityScheduleMappingCQ subQuery); /** @@ -394,11 +296,11 @@ cb.xsetupForExistsSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepId_NotExistsSubQuery_EventScheduleContentAsOne(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerNotExistsSubQuery(cb.query(), "ID", "ID", subQueryPropertyName); } - abstract public String keepId_NotExistsSubQuery_EventScheduleContentAsOne( + public abstract String keepId_NotExistsSubQuery_EventScheduleContentAsOne( EventScheduleContentCQ subQuery); /** @@ -416,12 +318,12 @@ cb.xsetupForExistsSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepId_NotExistsSubQuery_EventScheduleMappingList(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerNotExistsSubQuery(cb.query(), "ID", "SCHEDULE_ID", subQueryPropertyName); } - abstract public String keepId_NotExistsSubQuery_EventScheduleMappingList( + public abstract String keepId_NotExistsSubQuery_EventScheduleMappingList( EventScheduleMappingCQ subQuery); /** @@ -439,53 +341,53 @@ cb.xsetupForExistsSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepId_NotExistsSubQuery_FacilityScheduleMappingList(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerNotExistsSubQuery(cb.query(), "ID", "SCHEDULE_ID", subQueryPropertyName); } - abstract public String keepId_NotExistsSubQuery_FacilityScheduleMappingList( + public abstract String keepId_NotExistsSubQuery_FacilityScheduleMappingList( FacilityScheduleMappingCQ subQuery); public void xderiveEventScheduleMappingList(String function, SubQuery subQuery, String aliasName) { assertObjectNotNull("subQuery", subQuery); EventScheduleMappingCB cb = new EventScheduleMappingCB(); - cb.xsetupForDeriveReferrer(); + cb.xsetupForDerivedReferrer(); subQuery.query(cb); - String subQueryPropertyName = keepId_DeriveSubQuery_EventScheduleMappingList(cb - .query());// for saving query-value. - registerDeriveSubQuery(function, cb.query(), "ID", "SCHEDULE_ID", - subQueryPropertyName, aliasName); + String subQueryPropertyName = keepId_DerivedReferrer_EventScheduleMappingList(cb + .query()); // for saving query-value. + registerDerivedReferrerSubQuery(function, cb.query(), "ID", + "SCHEDULE_ID", subQueryPropertyName, aliasName); } - abstract public String keepId_DeriveSubQuery_EventScheduleMappingList( + public abstract String keepId_DerivedReferrer_EventScheduleMappingList( EventScheduleMappingCQ subQuery); public void xderiveFacilityScheduleMappingList(String function, SubQuery subQuery, String aliasName) { assertObjectNotNull("subQuery", subQuery); FacilityScheduleMappingCB cb = new FacilityScheduleMappingCB(); - cb.xsetupForDeriveReferrer(); + cb.xsetupForDerivedReferrer(); subQuery.query(cb); - String subQueryPropertyName = keepId_DeriveSubQuery_FacilityScheduleMappingList(cb - .query());// for saving query-value. - registerDeriveSubQuery(function, cb.query(), "ID", "SCHEDULE_ID", - subQueryPropertyName, aliasName); + String subQueryPropertyName = keepId_DerivedReferrer_FacilityScheduleMappingList(cb + .query()); // for saving query-value. + registerDerivedReferrerSubQuery(function, cb.query(), "ID", + "SCHEDULE_ID", subQueryPropertyName, aliasName); } - abstract public String keepId_DeriveSubQuery_FacilityScheduleMappingList( + public abstract String keepId_DerivedReferrer_FacilityScheduleMappingList( FacilityScheduleMappingCQ subQuery); /** - * IsNull(is null). And OnceRegistered. + * IsNull(is null). And OnlyOnceRegistered. */ public void setId_IsNull() { regId(CK_ISN, DUMMY_OBJECT); } /** - * IsNotNull(is not null). And OnceRegistered. + * IsNotNull(is not null). And OnlyOnceRegistered. */ public void setId_IsNotNull() { regId(CK_ISNN, DUMMY_OBJECT); @@ -502,7 +404,7 @@ abstract protected ConditionValue getCValueId(); /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {NotNull : + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {NotNull : * VARCHAR(100)} * * @param title The value of title as equal. @@ -512,7 +414,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param title The value of title as notEqual. */ @@ -521,7 +423,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param title The value of title as greaterThan. */ @@ -530,7 +432,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param title The value of title as lessThan. */ @@ -539,7 +441,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param title The value of title as greaterEqual. */ @@ -548,7 +450,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param title The value of title as lessEqual. */ @@ -557,7 +459,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param title The value of title as prefixSearch. */ @@ -566,20 +468,6 @@ } /** - * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, - * SeveralRegistered. - * - * @param title The value of title as likeSearch. - * @param likeSearchOption The option of like-search. (NotNull) - */ - public void setTitle_LikeSearch( - String title, - jp.sf.pal.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. * @@ -590,27 +478,41 @@ } /** - * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * - * @param title The collection of title as inScope. - * @param inScopeOption The option of in-scope. (NotNull) + * @param titleList The collection of title as notInScope. */ - public void setTitle_InScope( + public void setTitle_NotInScope(Collection titleList) { + regTitle(CK_NINS, cTL(titleList)); + } + + /** + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param title The value of title as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) + */ + public void setTitle_LikeSearch( String title, - jp.sf.pal.scheduler.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(title), getCValueTitle(), "TITLE", - "Title", "title", inScopeOption); + jp.sf.pal.scheduler.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(title), getCValueTitle(), "TITLE", "Title", "title", + likeSearchOption); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param titleList The collection of title as notInScope. + * @param title The value of title as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setTitle_NotInScope(Collection titleList) { - regTitle(CK_NINS, cTL(titleList)); + public void setTitle_NotLikeSearch( + String title, + jp.sf.pal.scheduler.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(title), getCValueTitle(), "TITLE", "Title", + "title", likeSearchOption); } protected void regTitle(ConditionKey key, Object value) { @@ -625,7 +527,7 @@ abstract protected ConditionValue getCValueTitle(); /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {VARCHAR(100)} + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {VARCHAR(100)} * * @param location The value of location as equal. */ @@ -634,7 +536,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param location The value of location as notEqual. */ @@ -643,7 +545,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param location The value of location as greaterThan. */ @@ -652,7 +554,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param location The value of location as lessThan. */ @@ -661,7 +563,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param location The value of location as greaterEqual. */ @@ -670,7 +572,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param location The value of location as lessEqual. */ @@ -679,7 +581,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param location The value of location as prefixSearch. */ @@ -688,20 +590,6 @@ } /** - * 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. * @@ -712,38 +600,52 @@ } /** - * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * - * @param location The collection of location as inScope. - * @param inScopeOption The option of in-scope. (NotNull) + * @param locationList The collection of location as notInScope. */ - public void setLocation_InScope( + public void setLocation_NotInScope(Collection locationList) { + regLocation(CK_NINS, cTL(locationList)); + } + + /** + * 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.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(location), getCValueLocation(), - "LOCATION", "Location", "location", inScopeOption); + jp.sf.pal.scheduler.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(location), getCValueLocation(), "LOCATION", + "Location", "location", likeSearchOption); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param locationList The collection of location as notInScope. + * @param location The value of location as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setLocation_NotInScope(Collection locationList) { - regLocation(CK_NINS, cTL(locationList)); + public void setLocation_NotLikeSearch( + String location, + jp.sf.pal.scheduler.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(location), getCValueLocation(), "LOCATION", + "Location", "location", likeSearchOption); } /** - * IsNull(is null). And OnceRegistered. + * IsNull(is null). And OnlyOnceRegistered. */ public void setLocation_IsNull() { regLocation(CK_ISN, DUMMY_OBJECT); } /** - * IsNotNull(is not null). And OnceRegistered. + * IsNotNull(is not null). And OnlyOnceRegistered. */ public void setLocation_IsNotNull() { regLocation(CK_ISNN, DUMMY_OBJECT); @@ -762,7 +664,7 @@ abstract protected ConditionValue getCValueLocation(); /** - * Equal(=). And NullIgnored, OnceRegistered. {NotNull : DATE} + * Equal(=). And NullIgnored, OnlyOnceRegistered. {NotNull : DATE} * * @param startDate The value of startDate as equal. */ @@ -771,7 +673,7 @@ } /** - * NotEqual(!=). And NullIgnored, OnceRegistered. + * NotEqual(!=). And NullIgnored, OnlyOnceRegistered. * * @param startDate The value of startDate as notEqual. */ @@ -780,7 +682,7 @@ } /** - * GreaterThan(>). And NullIgnored, OnceRegistered. + * GreaterThan(>). And NullIgnored, OnlyOnceRegistered. * * @param startDate The value of startDate as greaterThan. */ @@ -789,7 +691,7 @@ } /** - * LessThan(>). And NullIgnored, OnceRegistered. + * LessThan(>). And NullIgnored, OnlyOnceRegistered. * * @param startDate The value of startDate as lessThan. */ @@ -798,7 +700,7 @@ } /** - * GreaterEqual(>). And NullIgnored, OnceRegistered. + * GreaterEqual(>). And NullIgnored, OnlyOnceRegistered. * * @param startDate The value of startDate as greaterEqual. */ @@ -807,7 +709,7 @@ } /** - * LessEqual(>). And NullIgnored, OnceRegistered. + * LessEqual(>). And NullIgnored, OnlyOnceRegistered. * * @param startDate The value of startDate as lessEqual. */ @@ -817,7 +719,7 @@ /** * FromTo($fromDate <= COLUMN_NAME <= $toDate). And NullIgnored, - * OnceRegistered. {NotNull : DATE} + * OnlyOnceRegistered. {NotNull : DATE} * * @param fromDate The from-date of startDate. (Nullable) * @param toDate The to-date of startDate. (Nullable) @@ -833,7 +735,7 @@ /** * FromTo($fromDate <= COLUMN_NAME < $toDate + 1). And NullIgnored, - * OnceRegistered. {NotNull : DATE} + * OnlyOnceRegistered. {NotNull : DATE} * * @param fromDate The from-date of startDate. (Nullable) * @param toDate The to-date of startDate. (Nullable) @@ -859,7 +761,7 @@ abstract protected ConditionValue getCValueStartDate(); /** - * Equal(=). And NullIgnored, OnceRegistered. {TIME} + * Equal(=). And NullIgnored, OnlyOnceRegistered. {TIME} * * @param startTime The value of startTime as equal. */ @@ -868,7 +770,7 @@ } /** - * NotEqual(!=). And NullIgnored, OnceRegistered. + * NotEqual(!=). And NullIgnored, OnlyOnceRegistered. * * @param startTime The value of startTime as notEqual. */ @@ -877,7 +779,7 @@ } /** - * GreaterThan(>). And NullIgnored, OnceRegistered. + * GreaterThan(>). And NullIgnored, OnlyOnceRegistered. * * @param startTime The value of startTime as greaterThan. */ @@ -886,7 +788,7 @@ } /** - * LessThan(>). And NullIgnored, OnceRegistered. + * LessThan(>). And NullIgnored, OnlyOnceRegistered. * * @param startTime The value of startTime as lessThan. */ @@ -895,7 +797,7 @@ } /** - * GreaterEqual(>). And NullIgnored, OnceRegistered. + * GreaterEqual(>). And NullIgnored, OnlyOnceRegistered. * * @param startTime The value of startTime as greaterEqual. */ @@ -904,7 +806,7 @@ } /** - * LessEqual(>). And NullIgnored, OnceRegistered. + * LessEqual(>). And NullIgnored, OnlyOnceRegistered. * * @param startTime The value of startTime as lessEqual. */ @@ -913,14 +815,14 @@ } /** - * IsNull(is null). And OnceRegistered. + * IsNull(is null). And OnlyOnceRegistered. */ public void setStartTime_IsNull() { regStartTime(CK_ISN, DUMMY_OBJECT); } /** - * IsNotNull(is not null). And OnceRegistered. + * IsNotNull(is not null). And OnlyOnceRegistered. */ public void setStartTime_IsNotNull() { regStartTime(CK_ISNN, DUMMY_OBJECT); @@ -939,7 +841,7 @@ abstract protected ConditionValue getCValueStartTime(); /** - * Equal(=). And NullIgnored, OnceRegistered. {DATE} + * Equal(=). And NullIgnored, OnlyOnceRegistered. {DATE} * * @param endDate The value of endDate as equal. */ @@ -948,7 +850,7 @@ } /** - * NotEqual(!=). And NullIgnored, OnceRegistered. + * NotEqual(!=). And NullIgnored, OnlyOnceRegistered. * * @param endDate The value of endDate as notEqual. */ @@ -957,7 +859,7 @@ } /** - * GreaterThan(>). And NullIgnored, OnceRegistered. + * GreaterThan(>). And NullIgnored, OnlyOnceRegistered. * * @param endDate The value of endDate as greaterThan. */ @@ -966,7 +868,7 @@ } /** - * LessThan(>). And NullIgnored, OnceRegistered. + * LessThan(>). And NullIgnored, OnlyOnceRegistered. * * @param endDate The value of endDate as lessThan. */ @@ -975,7 +877,7 @@ } /** - * GreaterEqual(>). And NullIgnored, OnceRegistered. + * GreaterEqual(>). And NullIgnored, OnlyOnceRegistered. * * @param endDate The value of endDate as greaterEqual. */ @@ -984,7 +886,7 @@ } /** - * LessEqual(>). And NullIgnored, OnceRegistered. + * LessEqual(>). And NullIgnored, OnlyOnceRegistered. * * @param endDate The value of endDate as lessEqual. */ @@ -994,7 +896,7 @@ /** * FromTo($fromDate <= COLUMN_NAME <= $toDate). And NullIgnored, - * OnceRegistered. {DATE} + * OnlyOnceRegistered. {DATE} * * @param fromDate The from-date of endDate. (Nullable) * @param toDate The to-date of endDate. (Nullable) @@ -1010,7 +912,7 @@ /** * FromTo($fromDate <= COLUMN_NAME < $toDate + 1). And NullIgnored, - * OnceRegistered. {DATE} + * OnlyOnceRegistered. {DATE} * * @param fromDate The from-date of endDate. (Nullable) * @param toDate The to-date of endDate. (Nullable) @@ -1024,14 +926,14 @@ } /** - * IsNull(is null). And OnceRegistered. + * IsNull(is null). And OnlyOnceRegistered. */ public void setEndDate_IsNull() { regEndDate(CK_ISN, DUMMY_OBJECT); } /** - * IsNotNull(is not null). And OnceRegistered. + * IsNotNull(is not null). And OnlyOnceRegistered. */ public void setEndDate_IsNotNull() { regEndDate(CK_ISNN, DUMMY_OBJECT); @@ -1050,7 +952,7 @@ abstract protected ConditionValue getCValueEndDate(); /** - * Equal(=). And NullIgnored, OnceRegistered. {TIME} + * Equal(=). And NullIgnored, OnlyOnceRegistered. {TIME} * * @param endTime The value of endTime as equal. */ @@ -1059,7 +961,7 @@ } /** - * NotEqual(!=). And NullIgnored, OnceRegistered. + * NotEqual(!=). And NullIgnored, OnlyOnceRegistered. * * @param endTime The value of endTime as notEqual. */ @@ -1068,7 +970,7 @@ } /** - * GreaterThan(>). And NullIgnored, OnceRegistered. + * GreaterThan(>). And NullIgnored, OnlyOnceRegistered. * * @param endTime The value of endTime as greaterThan. */ @@ -1077,7 +979,7 @@ } /** - * LessThan(>). And NullIgnored, OnceRegistered. + * LessThan(>). And NullIgnored, OnlyOnceRegistered. * * @param endTime The value of endTime as lessThan. */ @@ -1086,7 +988,7 @@ } /** - * GreaterEqual(>). And NullIgnored, OnceRegistered. + * GreaterEqual(>). And NullIgnored, OnlyOnceRegistered. * * @param endTime The value of endTime as greaterEqual. */ @@ -1095,7 +997,7 @@ } /** - * LessEqual(>). And NullIgnored, OnceRegistered. + * LessEqual(>). And NullIgnored, OnlyOnceRegistered. * * @param endTime The value of endTime as lessEqual. */ @@ -1104,14 +1006,14 @@ } /** - * IsNull(is null). And OnceRegistered. + * IsNull(is null). And OnlyOnceRegistered. */ public void setEndTime_IsNull() { regEndTime(CK_ISN, DUMMY_OBJECT); } /** - * IsNotNull(is not null). And OnceRegistered. + * IsNotNull(is not null). And OnlyOnceRegistered. */ public void setEndTime_IsNotNull() { regEndTime(CK_ISNN, DUMMY_OBJECT); @@ -1130,8 +1032,8 @@ abstract protected ConditionValue getCValueEndTime(); /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {NotNull : VARCHAR(1) : - * Default=[F]} + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {NotNull : + * VARCHAR(1) : Default=[F]} * * @param secret The value of secret as equal. */ @@ -1140,7 +1042,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param secret The value of secret as notEqual. */ @@ -1149,7 +1051,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param secret The value of secret as greaterThan. */ @@ -1158,7 +1060,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param secret The value of secret as lessThan. */ @@ -1167,7 +1069,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param secret The value of secret as greaterEqual. */ @@ -1176,7 +1078,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param secret The value of secret as lessEqual. */ @@ -1185,7 +1087,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param secret The value of secret as prefixSearch. */ @@ -1194,20 +1096,6 @@ } /** - * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, - * SeveralRegistered. - * - * @param secret The value of secret as likeSearch. - * @param likeSearchOption The option of like-search. (NotNull) - */ - public void setSecret_LikeSearch( - String secret, - jp.sf.pal.scheduler.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { - registerLikeSearchQuery(CK_LS, fRES(secret), getCValueSecret(), - "SECRET", "Secret", "secret", likeSearchOption); - } - - /** * InScope(in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * @@ -1218,27 +1106,41 @@ } /** - * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * - * @param secret The collection of secret as inScope. - * @param inScopeOption The option of in-scope. (NotNull) + * @param secretList The collection of secret as notInScope. */ - public void setSecret_InScope( + public void setSecret_NotInScope(Collection secretList) { + regSecret(CK_NINS, cTL(secretList)); + } + + /** + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param secret The value of secret as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) + */ + public void setSecret_LikeSearch( String secret, - jp.sf.pal.scheduler.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(secret), getCValueSecret(), "SECRET", - "Secret", "secret", inScopeOption); + jp.sf.pal.scheduler.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(secret), getCValueSecret(), "SECRET", "Secret", + "secret", likeSearchOption); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param secretList The collection of secret as notInScope. + * @param secret The value of secret as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setSecret_NotInScope(Collection secretList) { - regSecret(CK_NINS, cTL(secretList)); + public void setSecret_NotLikeSearch( + String secret, + jp.sf.pal.scheduler.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(secret), getCValueSecret(), "SECRET", "Secret", + "secret", likeSearchOption); } protected void regSecret(ConditionKey key, Object value) { @@ -1254,7 +1156,8 @@ abstract protected ConditionValue getCValueSecret(); /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {NotNull : VARCHAR(10)} + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {NotNull : + * VARCHAR(10)} * * @param type The value of type as equal. */ @@ -1263,7 +1166,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param type The value of type as notEqual. */ @@ -1272,7 +1175,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param type The value of type as greaterThan. */ @@ -1281,7 +1184,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param type The value of type as lessThan. */ @@ -1290,7 +1193,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param type The value of type as greaterEqual. */ @@ -1299,7 +1202,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param type The value of type as lessEqual. */ @@ -1308,7 +1211,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param type The value of type as prefixSearch. */ @@ -1317,20 +1220,6 @@ } /** - * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, - * SeveralRegistered. - * - * @param type The value of type as likeSearch. - * @param likeSearchOption The option of like-search. (NotNull) - */ - public void setType_LikeSearch( - String type, - jp.sf.pal.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. * @@ -1341,27 +1230,41 @@ } /** - * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * - * @param type The collection of type as inScope. - * @param inScopeOption The option of in-scope. (NotNull) + * @param typeList The collection of type as notInScope. */ - public void setType_InScope( + public void setType_NotInScope(Collection typeList) { + regType(CK_NINS, cTL(typeList)); + } + + /** + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param type The value of type as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) + */ + public void setType_LikeSearch( String type, - jp.sf.pal.scheduler.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(type), getCValueType(), "TYPE", - "Type", "type", inScopeOption); + jp.sf.pal.scheduler.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(type), getCValueType(), "TYPE", "Type", "type", + likeSearchOption); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param typeList The collection of type as notInScope. + * @param type The value of type as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setType_NotInScope(Collection typeList) { - regType(CK_NINS, cTL(typeList)); + public void setType_NotLikeSearch( + String type, + jp.sf.pal.scheduler.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(type), getCValueType(), "TYPE", "Type", "type", + likeSearchOption); } protected void regType(ConditionKey key, Object value) { @@ -1375,7 +1278,7 @@ abstract protected ConditionValue getCValueType(); /** - * Equal(=). And NullIgnored, OnceRegistered. {NotNull : TIMESTAMP} + * Equal(=). And NullIgnored, OnlyOnceRegistered. {NotNull : TIMESTAMP} * * @param createdTime The value of createdTime as equal. */ @@ -1384,7 +1287,7 @@ } /** - * NotEqual(!=). And NullIgnored, OnceRegistered. + * NotEqual(!=). And NullIgnored, OnlyOnceRegistered. * * @param createdTime The value of createdTime as notEqual. */ @@ -1393,7 +1296,7 @@ } /** - * GreaterThan(>). And NullIgnored, OnceRegistered. + * GreaterThan(>). And NullIgnored, OnlyOnceRegistered. * * @param createdTime The value of createdTime as greaterThan. */ @@ -1402,7 +1305,7 @@ } /** - * LessThan(>). And NullIgnored, OnceRegistered. + * LessThan(>). And NullIgnored, OnlyOnceRegistered. * * @param createdTime The value of createdTime as lessThan. */ @@ -1411,7 +1314,7 @@ } /** - * GreaterEqual(>). And NullIgnored, OnceRegistered. + * GreaterEqual(>). And NullIgnored, OnlyOnceRegistered. * * @param createdTime The value of createdTime as greaterEqual. */ @@ -1420,7 +1323,7 @@ } /** - * LessEqual(>). And NullIgnored, OnceRegistered. + * LessEqual(>). And NullIgnored, OnlyOnceRegistered. * * @param createdTime The value of createdTime as lessEqual. */ @@ -1430,7 +1333,7 @@ /** * FromTo($fromDate <= COLUMN_NAME <= $toDate). And NullIgnored, - * OnceRegistered. {NotNull : TIMESTAMP} + * OnlyOnceRegistered. {NotNull : TIMESTAMP} * * @param fromDate The from-date of createdTime. (Nullable) * @param toDate The to-date of createdTime. (Nullable) @@ -1448,7 +1351,7 @@ /** * FromTo($fromDate <= COLUMN_NAME < $toDate + 1). And NullIgnored, - * OnceRegistered. {NotNull : TIMESTAMP} + * OnlyOnceRegistered. {NotNull : TIMESTAMP} * * @param fromDate The from-date of createdTime. (Nullable) * @param toDate The to-date of createdTime. (Nullable) @@ -1474,7 +1377,7 @@ abstract protected ConditionValue getCValueCreatedTime(); /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {NotNull : + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {NotNull : * VARCHAR(255)} * * @param createdBy The value of createdBy as equal. @@ -1484,7 +1387,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param createdBy The value of createdBy as notEqual. */ @@ -1493,7 +1396,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param createdBy The value of createdBy as greaterThan. */ @@ -1502,7 +1405,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param createdBy The value of createdBy as lessThan. */ @@ -1511,7 +1414,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param createdBy The value of createdBy as greaterEqual. */ @@ -1520,7 +1423,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param createdBy The value of createdBy as lessEqual. */ @@ -1529,7 +1432,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param createdBy The value of createdBy as prefixSearch. */ @@ -1538,20 +1441,6 @@ } /** - * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, - * SeveralRegistered. - * - * @param createdBy The value of createdBy as likeSearch. - * @param likeSearchOption The option of like-search. (NotNull) - */ - public void setCreatedBy_LikeSearch( - String createdBy, - jp.sf.pal.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. * @@ -1562,27 +1451,41 @@ } /** - * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * - * @param createdBy The collection of createdBy as inScope. - * @param inScopeOption The option of in-scope. (NotNull) + * @param createdByList The collection of createdBy as notInScope. */ - public void setCreatedBy_InScope( + public void setCreatedBy_NotInScope(Collection createdByList) { + regCreatedBy(CK_NINS, cTL(createdByList)); + } + + /** + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param createdBy The value of createdBy as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) + */ + public void setCreatedBy_LikeSearch( String createdBy, - jp.sf.pal.scheduler.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(createdBy), getCValueCreatedBy(), - "CREATED_BY", "CreatedBy", "createdBy", inScopeOption); + jp.sf.pal.scheduler.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(createdBy), getCValueCreatedBy(), "CREATED_BY", + "CreatedBy", "createdBy", likeSearchOption); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param createdByList The collection of createdBy as notInScope. + * @param createdBy The value of createdBy as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setCreatedBy_NotInScope(Collection createdByList) { - regCreatedBy(CK_NINS, cTL(createdByList)); + public void setCreatedBy_NotLikeSearch( + String createdBy, + jp.sf.pal.scheduler.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(createdBy), getCValueCreatedBy(), "CREATED_BY", + "CreatedBy", "createdBy", likeSearchOption); } protected void regCreatedBy(ConditionKey key, Object value) { @@ -1598,7 +1501,7 @@ abstract protected ConditionValue getCValueCreatedBy(); /** - * Equal(=). And NullIgnored, OnceRegistered. {NotNull : TIMESTAMP} + * Equal(=). And NullIgnored, OnlyOnceRegistered. {NotNull : TIMESTAMP} * * @param updatedTime The value of updatedTime as equal. */ @@ -1607,7 +1510,7 @@ } /** - * NotEqual(!=). And NullIgnored, OnceRegistered. + * NotEqual(!=). And NullIgnored, OnlyOnceRegistered. * * @param updatedTime The value of updatedTime as notEqual. */ @@ -1616,7 +1519,7 @@ } /** - * GreaterThan(>). And NullIgnored, OnceRegistered. + * GreaterThan(>). And NullIgnored, OnlyOnceRegistered. * * @param updatedTime The value of updatedTime as greaterThan. */ @@ -1625,7 +1528,7 @@ } /** - * LessThan(>). And NullIgnored, OnceRegistered. + * LessThan(>). And NullIgnored, OnlyOnceRegistered. * * @param updatedTime The value of updatedTime as lessThan. */ @@ -1634,7 +1537,7 @@ } /** - * GreaterEqual(>). And NullIgnored, OnceRegistered. + * GreaterEqual(>). And NullIgnored, OnlyOnceRegistered. * * @param updatedTime The value of updatedTime as greaterEqual. */ @@ -1643,7 +1546,7 @@ } /** - * LessEqual(>). And NullIgnored, OnceRegistered. + * LessEqual(>). And NullIgnored, OnlyOnceRegistered. * * @param updatedTime The value of updatedTime as lessEqual. */ @@ -1653,7 +1556,7 @@ /** * FromTo($fromDate <= COLUMN_NAME <= $toDate). And NullIgnored, - * OnceRegistered. {NotNull : TIMESTAMP} + * OnlyOnceRegistered. {NotNull : TIMESTAMP} * * @param fromDate The from-date of updatedTime. (Nullable) * @param toDate The to-date of updatedTime. (Nullable) @@ -1671,7 +1574,7 @@ /** * FromTo($fromDate <= COLUMN_NAME < $toDate + 1). And NullIgnored, - * OnceRegistered. {NotNull : TIMESTAMP} + * OnlyOnceRegistered. {NotNull : TIMESTAMP} * * @param fromDate The from-date of updatedTime. (Nullable) * @param toDate The to-date of updatedTime. (Nullable) @@ -1697,7 +1600,7 @@ abstract protected ConditionValue getCValueUpdatedTime(); /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {NotNull : + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {NotNull : * VARCHAR(255)} * * @param updatedBy The value of updatedBy as equal. @@ -1707,7 +1610,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param updatedBy The value of updatedBy as notEqual. */ @@ -1716,7 +1619,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param updatedBy The value of updatedBy as greaterThan. */ @@ -1725,7 +1628,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param updatedBy The value of updatedBy as lessThan. */ @@ -1734,7 +1637,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param updatedBy The value of updatedBy as greaterEqual. */ @@ -1743,7 +1646,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param updatedBy The value of updatedBy as lessEqual. */ @@ -1752,7 +1655,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param updatedBy The value of updatedBy as prefixSearch. */ @@ -1761,20 +1664,6 @@ } /** - * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, - * SeveralRegistered. - * - * @param updatedBy The value of updatedBy as likeSearch. - * @param likeSearchOption The option of like-search. (NotNull) - */ - public void setUpdatedBy_LikeSearch( - String updatedBy, - jp.sf.pal.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. * @@ -1785,27 +1674,41 @@ } /** - * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * - * @param updatedBy The collection of updatedBy as inScope. - * @param inScopeOption The option of in-scope. (NotNull) + * @param updatedByList The collection of updatedBy as notInScope. */ - public void setUpdatedBy_InScope( + public void setUpdatedBy_NotInScope(Collection updatedByList) { + regUpdatedBy(CK_NINS, cTL(updatedByList)); + } + + /** + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param updatedBy The value of updatedBy as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) + */ + public void setUpdatedBy_LikeSearch( String updatedBy, - jp.sf.pal.scheduler.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(updatedBy), getCValueUpdatedBy(), - "UPDATED_BY", "UpdatedBy", "updatedBy", inScopeOption); + jp.sf.pal.scheduler.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(updatedBy), getCValueUpdatedBy(), "UPDATED_BY", + "UpdatedBy", "updatedBy", likeSearchOption); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param updatedByList The collection of updatedBy as notInScope. + * @param updatedBy The value of updatedBy as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setUpdatedBy_NotInScope(Collection updatedByList) { - regUpdatedBy(CK_NINS, cTL(updatedByList)); + public void setUpdatedBy_NotLikeSearch( + String updatedBy, + jp.sf.pal.scheduler.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(updatedBy), getCValueUpdatedBy(), "UPDATED_BY", + "UpdatedBy", "updatedBy", likeSearchOption); } protected void regUpdatedBy(ConditionKey key, Object value) { @@ -1821,7 +1724,7 @@ abstract protected ConditionValue getCValueUpdatedBy(); /** - * Equal(=). And NullIgnored, OnceRegistered. {TIMESTAMP} + * Equal(=). And NullIgnored, OnlyOnceRegistered. {TIMESTAMP} * * @param deletedTime The value of deletedTime as equal. */ @@ -1830,7 +1733,7 @@ } /** - * NotEqual(!=). And NullIgnored, OnceRegistered. + * NotEqual(!=). And NullIgnored, OnlyOnceRegistered. * * @param deletedTime The value of deletedTime as notEqual. */ @@ -1839,7 +1742,7 @@ } /** - * GreaterThan(>). And NullIgnored, OnceRegistered. + * GreaterThan(>). And NullIgnored, OnlyOnceRegistered. * * @param deletedTime The value of deletedTime as greaterThan. */ @@ -1848,7 +1751,7 @@ } /** - * LessThan(>). And NullIgnored, OnceRegistered. + * LessThan(>). And NullIgnored, OnlyOnceRegistered. * * @param deletedTime The value of deletedTime as lessThan. */ @@ -1857,7 +1760,7 @@ } /** - * GreaterEqual(>). And NullIgnored, OnceRegistered. + * GreaterEqual(>). And NullIgnored, OnlyOnceRegistered. * * @param deletedTime The value of deletedTime as greaterEqual. */ @@ -1866,7 +1769,7 @@ } /** - * LessEqual(>). And NullIgnored, OnceRegistered. + * LessEqual(>). And NullIgnored, OnlyOnceRegistered. * * @param deletedTime The value of deletedTime as lessEqual. */ @@ -1876,7 +1779,7 @@ /** * FromTo($fromDate <= COLUMN_NAME <= $toDate). And NullIgnored, - * OnceRegistered. {TIMESTAMP} + * OnlyOnceRegistered. {TIMESTAMP} * * @param fromDate The from-date of deletedTime. (Nullable) * @param toDate The to-date of deletedTime. (Nullable) @@ -1894,7 +1797,7 @@ /** * FromTo($fromDate <= COLUMN_NAME < $toDate + 1). And NullIgnored, - * OnceRegistered. {TIMESTAMP} + * OnlyOnceRegistered. {TIMESTAMP} * * @param fromDate The from-date of deletedTime. (Nullable) * @param toDate The to-date of deletedTime. (Nullable) @@ -1908,14 +1811,14 @@ } /** - * IsNull(is null). And OnceRegistered. + * IsNull(is null). And OnlyOnceRegistered. */ public void setDeletedTime_IsNull() { regDeletedTime(CK_ISN, DUMMY_OBJECT); } /** - * IsNotNull(is not null). And OnceRegistered. + * IsNotNull(is not null). And OnlyOnceRegistered. */ public void setDeletedTime_IsNotNull() { regDeletedTime(CK_ISNN, DUMMY_OBJECT); @@ -1934,7 +1837,7 @@ abstract protected ConditionValue getCValueDeletedTime(); /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {VARCHAR(255)} + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {VARCHAR(255)} * * @param deletedBy The value of deletedBy as equal. */ @@ -1943,7 +1846,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param deletedBy The value of deletedBy as notEqual. */ @@ -1952,7 +1855,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param deletedBy The value of deletedBy as greaterThan. */ @@ -1961,7 +1864,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param deletedBy The value of deletedBy as lessThan. */ @@ -1970,7 +1873,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param deletedBy The value of deletedBy as greaterEqual. */ @@ -1979,7 +1882,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param deletedBy The value of deletedBy as lessEqual. */ @@ -1988,7 +1891,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param deletedBy The value of deletedBy as prefixSearch. */ @@ -1997,20 +1900,6 @@ } /** - * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, - * SeveralRegistered. - * - * @param deletedBy The value of deletedBy as likeSearch. - * @param likeSearchOption The option of like-search. (NotNull) - */ - public void setDeletedBy_LikeSearch( - String deletedBy, - jp.sf.pal.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. * @@ -2021,38 +1910,52 @@ } /** - * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * - * @param deletedBy The collection of deletedBy as inScope. - * @param inScopeOption The option of in-scope. (NotNull) + * @param deletedByList The collection of deletedBy as notInScope. */ - public void setDeletedBy_InScope( + public void setDeletedBy_NotInScope(Collection deletedByList) { + regDeletedBy(CK_NINS, cTL(deletedByList)); + } + + /** + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param deletedBy The value of deletedBy as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) + */ + public void setDeletedBy_LikeSearch( String deletedBy, - jp.sf.pal.scheduler.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(deletedBy), getCValueDeletedBy(), - "DELETED_BY", "DeletedBy", "deletedBy", inScopeOption); + jp.sf.pal.scheduler.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(deletedBy), getCValueDeletedBy(), "DELETED_BY", + "DeletedBy", "deletedBy", likeSearchOption); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param deletedByList The collection of deletedBy as notInScope. + * @param deletedBy The value of deletedBy as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setDeletedBy_NotInScope(Collection deletedByList) { - regDeletedBy(CK_NINS, cTL(deletedByList)); + public void setDeletedBy_NotLikeSearch( + String deletedBy, + jp.sf.pal.scheduler.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(deletedBy), getCValueDeletedBy(), "DELETED_BY", + "DeletedBy", "deletedBy", likeSearchOption); } /** - * IsNull(is null). And OnceRegistered. + * IsNull(is null). And OnlyOnceRegistered. */ public void setDeletedBy_IsNull() { regDeletedBy(CK_ISN, DUMMY_OBJECT); } /** - * IsNotNull(is not null). And OnceRegistered. + * IsNotNull(is not null). And OnlyOnceRegistered. */ public void setDeletedBy_IsNotNull() { regDeletedBy(CK_ISNN, DUMMY_OBJECT); @@ -2071,7 +1974,7 @@ abstract protected ConditionValue getCValueDeletedBy(); /** - * Equal(=). And NullIgnored, OnceRegistered. {NotNull : INTEGER} + * Equal(=). And NullIgnored, OnlyOnceRegistered. {NotNull : INTEGER} * * @param versionno The value of versionno as equal. */ @@ -2080,7 +1983,7 @@ } /** - * NotEqual(!=). And NullIgnored, OnceRegistered. + * NotEqual(!=). And NullIgnored, OnlyOnceRegistered. * * @param versionno The value of versionno as notEqual. */ @@ -2089,7 +1992,7 @@ } /** - * GreaterThan(>). And NullIgnored, OnceRegistered. + * GreaterThan(>). And NullIgnored, OnlyOnceRegistered. * * @param versionno The value of versionno as greaterThan. */ @@ -2098,7 +2001,7 @@ } /** - * LessThan(<). And NullIgnored, OnceRegistered. + * LessThan(<). And NullIgnored, OnlyOnceRegistered. * * @param versionno The value of versionno as lessThan. */ @@ -2107,7 +2010,7 @@ } /** - * GreaterEqual(>=). And NullIgnored, OnceRegistered. + * GreaterEqual(>=). And NullIgnored, OnlyOnceRegistered. * * @param versionno The value of versionno as greaterEqual. */ @@ -2116,7 +2019,7 @@ } /** - * LessEqual(<=). And NullIgnored, OnceRegistered. + * LessEqual(<=). And NullIgnored, OnlyOnceRegistered. * * @param versionno The value of versionno as lessEqual. */ @@ -2156,6 +2059,53 @@ abstract protected ConditionValue getCValueVersionno(); + public SSQFunction scalar_Equal() { + return xcreateSSQFunction("="); + } + + public SSQFunction scalar_GreaterEqual() { + return xcreateSSQFunction(">="); + } + + public SSQFunction scalar_GreaterThan() { + return xcreateSSQFunction(">"); + } + + public SSQFunction scalar_LessEqual() { + return xcreateSSQFunction("<="); + } + + public SSQFunction scalar_LessThan() { + return xcreateSSQFunction("<"); + } + + protected SSQFunction xcreateSSQFunction( + final String operand) { + return new SSQFunction( + new SSQSetupper() { + public void setup(String function, + SubQuery subQuery) { + xscalarSubQuery(function, subQuery, operand); + } + }); + } + + protected void xscalarSubQuery(String function, + SubQuery subQuery, String operand) { + assertObjectNotNull("subQuery", subQuery); + EventScheduleCB cb = new EventScheduleCB(); + cb.xsetupForScalarSubQuery(); + subQuery.query(cb); + String subQueryPropertyName = keepScalarSubQuery(cb.query()); // for + // saving + // query + // -value. + registerScalarSubQuery(function, cb.query(), subQueryPropertyName, + operand); + } + + public abstract String keepScalarSubQuery(EventScheduleCQ subQuery); + // Very Internal (for Suppressing Warn about 'Not Use Import') protected String getConditionBeanClassNameInternally() { return EventScheduleCB.class.getName(); Modified: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/cq/bs/AbstractBsEventScheduleContentCQ.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/cq/bs/AbstractBsEventScheduleContentCQ.java 2008-12-27 22:14:41 UTC (rev 1629) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/cq/bs/AbstractBsEventScheduleContentCQ.java 2008-12-27 22:18:30 UTC (rev 1630) @@ -18,7 +18,6 @@ * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public abstract class AbstractBsEventScheduleContentCQ extends AbstractConditionQuery { @@ -49,8 +48,8 @@ // ===== /** - * Equal(=). And NullIgnored, OnceRegistered. {PK : NotNull : BIGINT : FK to - * EVENT_SCHEDULE} + * Equal(=). And NullIgnored, OnlyOnceRegistered. {PK : NotNull : BIGINT : + * FK to EVENT_SCHEDULE} * * @param id The value of id as equal. */ @@ -59,7 +58,7 @@ } /** - * NotEqual(!=). And NullIgnored, OnceRegistered. + * NotEqual(!=). And NullIgnored, OnlyOnceRegistered. * * @param id The value of id as notEqual. */ @@ -68,7 +67,7 @@ } /** - * GreaterThan(>). And NullIgnored, OnceRegistered. + * GreaterThan(>). And NullIgnored, OnlyOnceRegistered. * * @param id The value of id as greaterThan. */ @@ -77,7 +76,7 @@ } /** - * LessThan(<). And NullIgnored, OnceRegistered. + * LessThan(<). And NullIgnored, OnlyOnceRegistered. * * @param id The value of id as lessThan. */ @@ -86,7 +85,7 @@ } /** - * GreaterEqual(>=). And NullIgnored, OnceRegistered. + * GreaterEqual(>=). And NullIgnored, OnlyOnceRegistered. * * @param id The value of id as greaterEqual. */ @@ -95,7 +94,7 @@ } /** - * LessEqual(<=). And NullIgnored, OnceRegistered. + * LessEqual(<=). And NullIgnored, OnlyOnceRegistered. * * @param id The value of id as lessEqual. */ @@ -123,44 +122,28 @@ regId(CK_NINS, cTL(idList)); } - /** - * @param eventScheduleCBquery Query. - * @deprecated Please use inScopeEventSchedule(subQuery) method. - */ - public void setId_InScopeSubQuery_EventSchedule( - EventScheduleCQ eventScheduleCBquery) { - String subQueryPropertyName = keepId_InScopeSubQuery_EventSchedule(eventScheduleCBquery);// for - // saving - // query - // - - // value - // . - registerInScopeSubQuery(eventScheduleCBquery, "ID", "ID", - subQueryPropertyName); - } - public void inScopeEventSchedule(SubQuery subQuery) { assertObjectNotNull("subQuery", subQuery); EventScheduleCB cb = new EventScheduleCB(); cb.xsetupForInScopeSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepId_InScopeSubQuery_EventSchedule(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerInScopeSubQuery(cb.query(), "ID", "ID", subQueryPropertyName); } - abstract public String keepId_InScopeSubQuery_EventSchedule( + public abstract String keepId_InScopeSubQuery_EventSchedule( EventScheduleCQ subQuery); /** - * IsNull(is null). And OnceRegistered. + * IsNull(is null). And OnlyOnceRegistered. */ public void setId_IsNull() { regId(CK_ISN, DUMMY_OBJECT); } /** - * IsNotNull(is not null). And OnceRegistered. + * IsNotNull(is not null). And OnlyOnceRegistered. */ public void setId_IsNotNull() { regId(CK_ISNN, DUMMY_OBJECT); @@ -177,7 +160,7 @@ abstract protected ConditionValue getCValueId(); /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {VARCHAR(1000)} + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {VARCHAR(1000)} * * @param content The value of content as equal. */ @@ -186,7 +169,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param content The value of content as notEqual. */ @@ -195,7 +178,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param content The value of content as greaterThan. */ @@ -204,7 +187,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param content The value of content as lessThan. */ @@ -213,7 +196,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param content The value of content as greaterEqual. */ @@ -222,7 +205,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param content The value of content as lessEqual. */ @@ -231,7 +214,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param content The value of content as prefixSearch. */ @@ -240,20 +223,6 @@ } /** - * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, - * SeveralRegistered. - * - * @param content The value of content as likeSearch. - * @param likeSearchOption The option of like-search. (NotNull) - */ - public void setContent_LikeSearch( - String content, - jp.sf.pal.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. * @@ -264,38 +233,52 @@ } /** - * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * - * @param content The collection of content as inScope. - * @param inScopeOption The option of in-scope. (NotNull) + * @param contentList The collection of content as notInScope. */ - public void setContent_InScope( + public void setContent_NotInScope(Collection contentList) { + regContent(CK_NINS, cTL(contentList)); + } + + /** + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param content The value of content as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) + */ + public void setContent_LikeSearch( String content, - jp.sf.pal.scheduler.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(content), getCValueContent(), - "CONTENT", "Content", "content", inScopeOption); + jp.sf.pal.scheduler.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(content), getCValueContent(), "CONTENT", "Content", + "content", likeSearchOption); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param contentList The collection of content as notInScope. + * @param content The value of content as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setContent_NotInScope(Collection contentList) { - regContent(CK_NINS, cTL(contentList)); + public void setContent_NotLikeSearch( + String content, + jp.sf.pal.scheduler.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(content), getCValueContent(), "CONTENT", "Content", + "content", likeSearchOption); } /** - * IsNull(is null). And OnceRegistered. + * IsNull(is null). And OnlyOnceRegistered. */ public void setContent_IsNull() { regContent(CK_ISN, DUMMY_OBJECT); } /** - * IsNotNull(is not null). And OnceRegistered. + * IsNotNull(is not null). And OnlyOnceRegistered. */ public void setContent_IsNotNull() { regContent(CK_ISNN, DUMMY_OBJECT); @@ -313,6 +296,53 @@ abstract protected ConditionValue getCValueContent(); + public SSQFunction scalar_Equal() { + return xcreateSSQFunction("="); + } + + public SSQFunction scalar_GreaterEqual() { + return xcreateSSQFunction(">="); + } + + public SSQFunction scalar_GreaterThan() { + return xcreateSSQFunction(">"); + } + + public SSQFunction scalar_LessEqual() { + return xcreateSSQFunction("<="); + } + + public SSQFunction scalar_LessThan() { + return xcreateSSQFunction("<"); + } + + protected SSQFunction xcreateSSQFunction( + final String operand) { + return new SSQFunction( + new SSQSetupper() { + public void setup(String function, + SubQuery subQuery) { + xscalarSubQuery(function, subQuery, operand); + } + }); + } + + protected void xscalarSubQuery(String function, + SubQuery subQuery, String operand) { + assertObjectNotNull("subQuery", subQuery); + EventScheduleContentCB cb = new EventScheduleContentCB(); + cb.xsetupForScalarSubQuery(); + subQuery.query(cb); + String subQueryPropertyName = keepScalarSubQuery(cb.query()); // for + // saving + // query + // -value. + registerScalarSubQuery(function, cb.query(), subQueryPropertyName, + operand); + } + + public abstract String keepScalarSubQuery(EventScheduleContentCQ subQuery); + // Very Internal (for Suppressing Warn about 'Not Use Import') protected String getConditionBeanClassNameInternally() { return EventScheduleContentCB.class.getName(); Modified: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/cq/bs/AbstractBsEventScheduleMappingCQ.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/cq/bs/AbstractBsEventScheduleMappingCQ.java 2008-12-27 22:14:41 UTC (rev 1629) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/cq/bs/AbstractBsEventScheduleMappingCQ.java 2008-12-27 22:18:30 UTC (rev 1630) @@ -13,14 +13,12 @@ import jp.sf.pal.scheduler.db.cbean.UserInfoCB; import jp.sf.pal.scheduler.db.cbean.cq.EventScheduleCQ; import jp.sf.pal.scheduler.db.cbean.cq.EventScheduleMappingCQ; -import jp.sf.pal.scheduler.db.cbean.cq.UserInfoCQ; /** * The abstract condition-query of EVENT_SCHEDULE_MAPPING. * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public abstract class AbstractBsEventScheduleMappingCQ extends AbstractConditionQuery { @@ -51,7 +49,8 @@ // ===== /** - * Equal(=). And NullIgnored, OnceRegistered. {PK : ID : NotNull : BIGINT} + * Equal(=). And NullIgnored, OnlyOnceRegistered. {PK : ID : NotNull : + * BIGINT} * * @param id The value of id as equal. */ @@ -60,7 +59,7 @@ } /** - * NotEqual(!=). And NullIgnored, OnceRegistered. + * NotEqual(!=). And NullIgnored, OnlyOnceRegistered. * * @param id The value of id as notEqual. */ @@ -69,7 +68,7 @@ } /** - * GreaterThan(>). And NullIgnored, OnceRegistered. + * GreaterThan(>). And NullIgnored, OnlyOnceRegistered. * * @param id The value of id as greaterThan. */ @@ -78,7 +77,7 @@ } /** - * LessThan(<). And NullIgnored, OnceRegistered. + * LessThan(<). And NullIgnored, OnlyOnceRegistered. * * @param id The value of id as lessThan. */ @@ -87,7 +86,7 @@ } /** - * GreaterEqual(>=). And NullIgnored, OnceRegistered. + * GreaterEqual(>=). And NullIgnored, OnlyOnceRegistered. * * @param id The value of id as greaterEqual. */ @@ -96,7 +95,7 @@ } /** - * LessEqual(<=). And NullIgnored, OnceRegistered. + * LessEqual(<=). And NullIgnored, OnlyOnceRegistered. * * @param id The value of id as lessEqual. */ @@ -125,14 +124,14 @@ } /** - * IsNull(is null). And OnceRegistered. + * IsNull(is null). And OnlyOnceRegistered. */ public void setId_IsNull() { regId(CK_ISN, DUMMY_OBJECT); } /** - * IsNotNull(is not null). And OnceRegistered. + * IsNotNull(is not null). And OnlyOnceRegistered. */ public void setId_IsNotNull() { regId(CK_ISNN, DUMMY_OBJECT); @@ -149,7 +148,7 @@ abstract protected ConditionValue getCValueId(); /** - * Equal(=). And NullIgnored, OnceRegistered. {NotNull : BIGINT : FK to + * Equal(=). And NullIgnored, OnlyOnceRegistered. {NotNull : BIGINT : FK to * EVENT_SCHEDULE} * * @param scheduleId The value of scheduleId as equal. @@ -159,7 +158,7 @@ } /** - * NotEqual(!=). And NullIgnored, OnceRegistered. + * NotEqual(!=). And NullIgnored, OnlyOnceRegistered. * * @param scheduleId The value of scheduleId as notEqual. */ @@ -168,7 +167,7 @@ } /** - * GreaterThan(>). And NullIgnored, OnceRegistered. + * GreaterThan(>). And NullIgnored, OnlyOnceRegistered. * * @param scheduleId The value of scheduleId as greaterThan. */ @@ -177,7 +176,7 @@ } /** - * LessThan(<). And NullIgnored, OnceRegistered. + * LessThan(<). And NullIgnored, OnlyOnceRegistered. * * @param scheduleId The value of scheduleId as lessThan. */ @@ -186,7 +185,7 @@ } /** - * GreaterEqual(>=). And NullIgnored, OnceRegistered. + * GreaterEqual(>=). And NullIgnored, OnlyOnceRegistered. * * @param scheduleId The value of scheduleId as greaterEqual. */ @@ -195,7 +194,7 @@ } /** - * LessEqual(<=). And NullIgnored, OnceRegistered. + * LessEqual(<=). And NullIgnored, OnlyOnceRegistered. * * @param scheduleId The value of scheduleId as lessEqual. */ @@ -223,34 +222,18 @@ regScheduleId(CK_NINS, cTL(scheduleIdList)); } - /** - * @param eventScheduleCBquery Query. - * @deprecated Please use inScopeEventSchedule(subQuery) method. - */ - public void setScheduleId_InScopeSubQuery_EventSchedule( - EventScheduleCQ eventScheduleCBquery) { - String subQueryPropertyName = keepScheduleId_InScopeSubQuery_EventSchedule(eventScheduleCBquery);// for - // saving - // query - // - - // value - // . - registerInScopeSubQuery(eventScheduleCBquery, "SCHEDULE_ID", "ID", - subQueryPropertyName); - } - public void inScopeEventSchedule(SubQuery subQuery) { assertObjectNotNull("subQuery", subQuery); EventScheduleCB cb = new EventScheduleCB(); cb.xsetupForInScopeSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepScheduleId_InScopeSubQuery_EventSchedule(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerInScopeSubQuery(cb.query(), "SCHEDULE_ID", "ID", subQueryPropertyName); } - abstract public String keepScheduleId_InScopeSubQuery_EventSchedule( + public abstract String keepScheduleId_InScopeSubQuery_EventSchedule( EventScheduleCQ subQuery); protected void regScheduleId(ConditionKey key, Object value) { @@ -266,8 +249,8 @@ abstract protected ConditionValue getCValueScheduleId(); /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {NotNull : VARCHAR(255) - * : FK to USER_INFO} + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {NotNull : + * VARCHAR(255) : FK to USER_INFO} * * @param userId The value of userId as equal. */ @@ -276,7 +259,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param userId The value of userId as notEqual. */ @@ -285,7 +268,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param userId The value of userId as greaterThan. */ @@ -294,7 +277,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param userId The value of userId as lessThan. */ @@ -303,7 +286,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param userId The value of userId as greaterEqual. */ @@ -312,7 +295,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param userId The value of userId as lessEqual. */ @@ -321,7 +304,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param userId The value of userId as prefixSearch. */ @@ -330,20 +313,6 @@ } /** - * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, - * SeveralRegistered. - * - * @param userId The value of userId as likeSearch. - * @param likeSearchOption The option of like-search. (NotNull) - */ - public void setUserId_LikeSearch( - String userId, - jp.sf.pal.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. * @@ -354,42 +323,41 @@ } /** - * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * - * @param userId The collection of userId as inScope. - * @param inScopeOption The option of in-scope. (NotNull) + * @param userIdList The collection of userId as notInScope. */ - public void setUserId_InScope( - String userId, - jp.sf.pal.scheduler.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(userId), getCValueUserId(), - "USER_ID", "UserId", "userId", inScopeOption); + public void setUserId_NotInScope(Collection userIdList) { + regUserId(CK_NINS, cTL(userIdList)); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param userIdList The collection of userId as notInScope. + * @param userId The value of userId as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) */ - public void setUserId_NotInScope(Collection userIdList) { - regUserId(CK_NINS, cTL(userIdList)); + public void setUserId_LikeSearch( + String userId, + jp.sf.pal.scheduler.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(userId), getCValueUserId(), "USER_ID", "UserId", + "userId", likeSearchOption); } /** - * @param userInfoCBquery Query. - * @deprecated Please use inScopeUserInfo(subQuery) method. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param userId The value of userId as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setUserId_InScopeSubQuery_UserInfo(UserInfoCQ userInfoCBquery) { - String subQueryPropertyName = keepUserId_InScopeSubQuery_UserInfo(userInfoCBquery);// for - // saving - // query - // - - // value - // . - registerInScopeSubQuery(userInfoCBquery, "USER_ID", "USER_ID", - subQueryPropertyName); + public void setUserId_NotLikeSearch( + String userId, + jp.sf.pal.scheduler.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(userId), getCValueUserId(), "USER_ID", "UserId", + "userId", likeSearchOption); } public void inScopeUserInfo(SubQuery subQuery) { @@ -398,12 +366,12 @@ cb.xsetupForInScopeSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepUserId_InScopeSubQuery_UserInfo(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerInScopeSubQuery(cb.query(), "USER_ID", "USER_ID", subQueryPropertyName); } - abstract public String keepUserId_InScopeSubQuery_UserInfo( + public abstract String keepUserId_InScopeSubQuery_UserInfo( jp.sf.pal.scheduler.db.cbean.cq.UserInfoCQ subQuery); protected void regUserId(ConditionKey key, Object value) { @@ -418,6 +386,53 @@ abstract protected ConditionValue getCValueUserId(); + public SSQFunction scalar_Equal() { + return xcreateSSQFunction("="); + } + + public SSQFunction scalar_GreaterEqual() { + return xcreateSSQFunction(">="); + } + + public SSQFunction scalar_GreaterThan() { + return xcreateSSQFunction(">"); + } + + public SSQFunction scalar_LessEqual() { + return xcreateSSQFunction("<="); + } + + public SSQFunction scalar_LessThan() { + return xcreateSSQFunction("<"); + } + + protected SSQFunction xcreateSSQFunction( + final String operand) { + return new SSQFunction( + new SSQSetupper() { + public void setup(String function, + SubQuery subQuery) { + xscalarSubQuery(function, subQuery, operand); + } + }); + } + + protected void xscalarSubQuery(String function, + SubQuery subQuery, String operand) { + assertObjectNotNull("subQuery", subQuery); + EventScheduleMappingCB cb = new EventScheduleMappingCB(); + cb.xsetupForScalarSubQuery(); + subQuery.query(cb); + String subQueryPropertyName = keepScalarSubQuery(cb.query()); // for + // saving + // query + // -value. + registerScalarSubQuery(function, cb.query(), subQueryPropertyName, + operand); + } + + public abstract String keepScalarSubQuery(EventScheduleMappingCQ subQuery); + // Very Internal (for Suppressing Warn about 'Not Use Import') protected String getConditionBeanClassNameInternally() { return EventScheduleMappingCB.class.getName(); Modified: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/cq/bs/AbstractBsFacilityCQ.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/cq/bs/AbstractBsFacilityCQ.java 2008-12-27 22:14:41 UTC (rev 1629) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/cq/bs/AbstractBsFacilityCQ.java 2008-12-27 22:18:30 UTC (rev 1630) @@ -22,7 +22,6 @@ * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public abstract class AbstractBsFacilityCQ extends AbstractConditionQuery { //========================================================================== @@ -52,7 +51,8 @@ // ===== /** - * Equal(=). And NullIgnored, OnceRegistered. {PK : ID : NotNull : INTEGER} + * Equal(=). And NullIgnored, OnlyOnceRegistered. {PK : ID : NotNull : + * INTEGER} * * @param id The value of id as equal. */ @@ -61,7 +61,7 @@ } /** - * NotEqual(!=). And NullIgnored, OnceRegistered. + * NotEqual(!=). And NullIgnored, OnlyOnceRegistered. * * @param id The value of id as notEqual. */ @@ -70,7 +70,7 @@ } /** - * GreaterThan(>). And NullIgnored, OnceRegistered. + * GreaterThan(>). And NullIgnored, OnlyOnceRegistered. * * @param id The value of id as greaterThan. */ @@ -79,7 +79,7 @@ } /** - * LessThan(<). And NullIgnored, OnceRegistered. + * LessThan(<). And NullIgnored, OnlyOnceRegistered. * * @param id The value of id as lessThan. */ @@ -88,7 +88,7 @@ } /** - * GreaterEqual(>=). And NullIgnored, OnceRegistered. + * GreaterEqual(>=). And NullIgnored, OnlyOnceRegistered. * * @param id The value of id as greaterEqual. */ @@ -97,7 +97,7 @@ } /** - * LessEqual(<=). And NullIgnored, OnceRegistered. + * LessEqual(<=). And NullIgnored, OnlyOnceRegistered. * * @param id The value of id as lessEqual. */ @@ -125,52 +125,19 @@ regId(CK_NINS, cTL(idList)); } - /** - * @param facilityContentCBquery Query. - * @deprecated Please use inScopeFacilityContentAsOne(subQuery) method. - */ - public void setId_InScopeSubQuery_FacilityContentAsOne( - FacilityContentCQ facilityContentCBquery) { - String subQueryPropertyName = keepId_InScopeSubQuery_FacilityContentAsOne(facilityContentCBquery);// for - // saving - // query - // - - // value - // . - registerInScopeSubQuery(facilityContentCBquery, "ID", "ID", - subQueryPropertyName); - } - public void inScopeFacilityContentAsOne(SubQuery subQuery) { assertObjectNotNull("subQuery", subQuery); FacilityContentCB cb = new FacilityContentCB(); cb.xsetupForInScopeSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepId_InScopeSubQuery_FacilityContentAsOne(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerInScopeSubQuery(cb.query(), "ID", "ID", subQueryPropertyName); } - abstract public String keepId_InScopeSubQuery_FacilityContentAsOne( + public abstract String keepId_InScopeSubQuery_FacilityContentAsOne( FacilityContentCQ subQuery); - /** - * @param facilityScheduleMappingCBquery Query. - * @deprecated Please use inScopeFacilityScheduleMappingList(subQuery) - * method. - */ - public void setId_InScopeSubQuery_FacilityScheduleMappingList( - FacilityScheduleMappingCQ facilityScheduleMappingCBquery) { - String subQueryPropertyName = keepId_InScopeSubQuery_FacilityScheduleMappingList(facilityScheduleMappingCBquery);// for - // saving - // query - // - - // value - // . - registerInScopeSubQuery(facilityScheduleMappingCBquery, "ID", - "FACILITY_ID", subQueryPropertyName); - } - public void inScopeFacilityScheduleMappingList( SubQuery subQuery) { assertObjectNotNull("subQuery", subQuery); @@ -178,12 +145,12 @@ cb.xsetupForInScopeSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepId_InScopeSubQuery_FacilityScheduleMappingList(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerInScopeSubQuery(cb.query(), "ID", "FACILITY_ID", subQueryPropertyName); } - abstract public String keepId_InScopeSubQuery_FacilityScheduleMappingList( + public abstract String keepId_InScopeSubQuery_FacilityScheduleMappingList( FacilityScheduleMappingCQ subQuery); public void notInScopeFacilityContentAsOne( @@ -193,11 +160,11 @@ cb.xsetupForInScopeSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepId_NotInScopeSubQuery_FacilityContentAsOne(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerNotInScopeSubQuery(cb.query(), "ID", "ID", subQueryPropertyName); } - abstract public String keepId_NotInScopeSubQuery_FacilityContentAsOne( + public abstract String keepId_NotInScopeSubQuery_FacilityContentAsOne( FacilityContentCQ subQuery); public void notInScopeFacilityScheduleMappingList( @@ -207,31 +174,15 @@ cb.xsetupForInScopeSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepId_NotInScopeSubQuery_FacilityScheduleMappingList(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerNotInScopeSubQuery(cb.query(), "ID", "FACILITY_ID", subQueryPropertyName); } - abstract public String keepId_NotInScopeSubQuery_FacilityScheduleMappingList( + public abstract String keepId_NotInScopeSubQuery_FacilityScheduleMappingList( FacilityScheduleMappingCQ subQuery); /** - * @param facilityContentCBquery Query. - * @deprecated Please use existsFacilityContentAsOne(subQuery) method. - */ - public void setId_ExistsSubQuery_FacilityContentAsOne( - FacilityContentCQ facilityContentCBquery) { - String subQueryPropertyName = keepId_ExistsSubQuery_FacilityContentAsOne(facilityContentCBquery);// for - // saving - // query - // - - // value - // . - registerExistsSubQuery(facilityContentCBquery, "ID", "ID", - subQueryPropertyName); - } - - /** * Set up 'exists' sub-query. {exists (select ID from FACILITY_CONTENT where * ...)} * @@ -244,31 +195,14 @@ cb.xsetupForExistsSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepId_ExistsSubQuery_FacilityContentAsOne(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerExistsSubQuery(cb.query(), "ID", "ID", subQueryPropertyName); } - abstract public String keepId_ExistsSubQuery_FacilityContentAsOne( + public abstract String keepId_ExistsSubQuery_FacilityContentAsOne( FacilityContentCQ subQuery); /** - * @param facilityScheduleMappingCBquery Query. - * @deprecated Please use existsFacilityScheduleMappingList(subQuery) - * method. - */ - public void setId_ExistsSubQuery_FacilityScheduleMappingList( - FacilityScheduleMappingCQ facilityScheduleMappingCBquery) { - String subQueryPropertyName = keepId_ExistsSubQuery_FacilityScheduleMappingList(facilityScheduleMappingCBquery);// for - // saving - // query - // - - // value - // . - registerExistsSubQuery(facilityScheduleMappingCBquery, "ID", - "FACILITY_ID", subQueryPropertyName); - } - - /** * Set up 'exists' sub-query. {exists (select FACILITY_ID from * FACILITY_SCHEDULE_MAPPING where ...)} * @@ -283,12 +217,12 @@ cb.xsetupForExistsSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepId_ExistsSubQuery_FacilityScheduleMappingList(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerExistsSubQuery(cb.query(), "ID", "FACILITY_ID", subQueryPropertyName); } - abstract public String keepId_ExistsSubQuery_FacilityScheduleMappingList( + public abstract String keepId_ExistsSubQuery_FacilityScheduleMappingList( FacilityScheduleMappingCQ subQuery); /** @@ -306,11 +240,11 @@ cb.xsetupForExistsSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepId_NotExistsSubQuery_FacilityContentAsOne(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerNotExistsSubQuery(cb.query(), "ID", "ID", subQueryPropertyName); } - abstract public String keepId_NotExistsSubQuery_FacilityContentAsOne( + public abstract String keepId_NotExistsSubQuery_FacilityContentAsOne( FacilityContentCQ subQuery); /** @@ -328,38 +262,38 @@ cb.xsetupForExistsSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepId_NotExistsSubQuery_FacilityScheduleMappingList(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerNotExistsSubQuery(cb.query(), "ID", "FACILITY_ID", subQueryPropertyName); } - abstract public String keepId_NotExistsSubQuery_FacilityScheduleMappingList( + public abstract String keepId_NotExistsSubQuery_FacilityScheduleMappingList( FacilityScheduleMappingCQ subQuery); public void xderiveFacilityScheduleMappingList(String function, SubQuery subQuery, String aliasName) { assertObjectNotNull("subQuery", subQuery); FacilityScheduleMappingCB cb = new FacilityScheduleMappingCB(); - cb.xsetupForDeriveReferrer(); + cb.xsetupForDerivedReferrer(); subQuery.query(cb); - String subQueryPropertyName = keepId_DeriveSubQuery_FacilityScheduleMappingList(cb - .query());// for saving query-value. - registerDeriveSubQuery(function, cb.query(), "ID", "FACILITY_ID", - subQueryPropertyName, aliasName); + String subQueryPropertyName = keepId_DerivedReferrer_FacilityScheduleMappingList(cb + .query()); // for saving query-value. + registerDerivedReferrerSubQuery(function, cb.query(), "ID", + "FACILITY_ID", subQueryPropertyName, aliasName); } - abstract public String keepId_DeriveSubQuery_FacilityScheduleMappingList( + public abstract String keepId_DerivedReferrer_FacilityScheduleMappingList( FacilityScheduleMappingCQ subQuery); /** - * IsNull(is null). And OnceRegistered. + * IsNull(is null). And OnlyOnceRegistered. */ public void setId_IsNull() { regId(CK_ISN, DUMMY_OBJECT); } /** - * IsNotNull(is not null). And OnceRegistered. + * IsNotNull(is not null). And OnlyOnceRegistered. */ public void setId_IsNotNull() { regId(CK_ISNN, DUMMY_OBJECT); @@ -376,7 +310,7 @@ abstract protected ConditionValue getCValueId(); /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {NotNull : + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {NotNull : * VARCHAR(100)} * * @param name The value of name as equal. @@ -386,7 +320,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param name The value of name as notEqual. */ @@ -395,7 +329,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param name The value of name as greaterThan. */ @@ -404,7 +338,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param name The value of name as lessThan. */ @@ -413,7 +347,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param name The value of name as greaterEqual. */ @@ -422,7 +356,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param name The value of name as lessEqual. */ @@ -431,7 +365,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param name The value of name as prefixSearch. */ @@ -440,20 +374,6 @@ } /** - * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, - * SeveralRegistered. - * - * @param name The value of name as likeSearch. - * @param likeSearchOption The option of like-search. (NotNull) - */ - public void setName_LikeSearch( - String name, - jp.sf.pal.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. * @@ -464,27 +384,41 @@ } /** - * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * - * @param name The collection of name as inScope. - * @param inScopeOption The option of in-scope. (NotNull) + * @param nameList The collection of name as notInScope. */ - public void setName_InScope( + public void setName_NotInScope(Collection nameList) { + regName(CK_NINS, cTL(nameList)); + } + + /** + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param name The value of name as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) + */ + public void setName_LikeSearch( String name, - jp.sf.pal.scheduler.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(name), getCValueName(), "NAME", - "Name", "name", inScopeOption); + jp.sf.pal.scheduler.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(name), getCValueName(), "NAME", "Name", "name", + likeSearchOption); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param nameList The collection of name as notInScope. + * @param name The value of name as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setName_NotInScope(Collection nameList) { - regName(CK_NINS, cTL(nameList)); + public void setName_NotLikeSearch( + String name, + jp.sf.pal.scheduler.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(name), getCValueName(), "NAME", "Name", "name", + likeSearchOption); } protected void regName(ConditionKey key, Object value) { @@ -498,7 +432,7 @@ abstract protected ConditionValue getCValueName(); /** - * Equal(=). And NullIgnored, OnceRegistered. {NotNull : INTEGER : + * Equal(=). And NullIgnored, OnlyOnceRegistered. {NotNull : INTEGER : * Default=[1]} * * @param sortOrder The value of sortOrder as equal. @@ -508,7 +442,7 @@ } /** - * NotEqual(!=). And NullIgnored, OnceRegistered. + * NotEqual(!=). And NullIgnored, OnlyOnceRegistered. * * @param sortOrder The value of sortOrder as notEqual. */ @@ -517,7 +451,7 @@ } /** - * GreaterThan(>). And NullIgnored, OnceRegistered. + * GreaterThan(>). And NullIgnored, OnlyOnceRegistered. * * @param sortOrder The value of sortOrder as greaterThan. */ @@ -526,7 +460,7 @@ } /** - * LessThan(<). And NullIgnored, OnceRegistered. + * LessThan(<). And NullIgnored, OnlyOnceRegistered. * * @param sortOrder The value of sortOrder as lessThan. */ @@ -535,7 +469,7 @@ } /** - * GreaterEqual(>=). And NullIgnored, OnceRegistered. + * GreaterEqual(>=). And NullIgnored, OnlyOnceRegistered. * * @param sortOrder The value of sortOrder as greaterEqual. */ @@ -544,7 +478,7 @@ } /** - * LessEqual(<=). And NullIgnored, OnceRegistered. + * LessEqual(<=). And NullIgnored, OnlyOnceRegistered. * * @param sortOrder The value of sortOrder as lessEqual. */ @@ -585,7 +519,7 @@ abstract protected ConditionValue getCValueSortOrder(); /** - * Equal(=). And NullIgnored, OnceRegistered. {NotNull : INTEGER : FK to + * Equal(=). And NullIgnored, OnlyOnceRegistered. {NotNull : INTEGER : FK to * FACILITY_GROUP} * * @param groupId The value of groupId as equal. @@ -595,7 +529,7 @@ } /** - * NotEqual(!=). And NullIgnored, OnceRegistered. + * NotEqual(!=). And NullIgnored, OnlyOnceRegistered. * * @param groupId The value of groupId as notEqual. */ @@ -604,7 +538,7 @@ } /** - * GreaterThan(>). And NullIgnored, OnceRegistered. + * GreaterThan(>). And NullIgnored, OnlyOnceRegistered. * * @param groupId The value of groupId as greaterThan. */ @@ -613,7 +547,7 @@ } /** - * LessThan(<). And NullIgnored, OnceRegistered. + * LessThan(<). And NullIgnored, OnlyOnceRegistered. * * @param groupId The value of groupId as lessThan. */ @@ -622,7 +556,7 @@ } /** - * GreaterEqual(>=). And NullIgnored, OnceRegistered. + * GreaterEqual(>=). And NullIgnored, OnlyOnceRegistered. * * @param groupId The value of groupId as greaterEqual. */ @@ -631,7 +565,7 @@ } /** - * LessEqual(<=). And NullIgnored, OnceRegistered. + * LessEqual(<=). And NullIgnored, OnlyOnceRegistered. * * @param groupId The value of groupId as lessEqual. */ @@ -659,34 +593,18 @@ regGroupId(CK_NINS, cTL(groupIdList)); } - /** - * @param facilityGroupCBquery Query. - * @deprecated Please use inScopeFacilityGroup(subQuery) method. - */ - public void setGroupId_InScopeSubQuery_FacilityGroup( - FacilityGroupCQ facilityGroupCBquery) { - String subQueryPropertyName = keepGroupId_InScopeSubQuery_FacilityGroup(facilityGroupCBquery);// for - // saving - // query - // - - // value - // . - registerInScopeSubQuery(facilityGroupCBquery, "GROUP_ID", "ID", - subQueryPropertyName); - } - public void inScopeFacilityGroup(SubQuery subQuery) { assertObjectNotNull("subQuery", subQuery); FacilityGroupCB cb = new FacilityGroupCB(); cb.xsetupForInScopeSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepGroupId_InScopeSubQuery_FacilityGroup(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerInScopeSubQuery(cb.query(), "GROUP_ID", "ID", subQueryPropertyName); } - abstract public String keepGroupId_InScopeSubQuery_FacilityGroup( + public abstract String keepGroupId_InScopeSubQuery_FacilityGroup( FacilityGroupCQ subQuery); protected void regGroupId(ConditionKey key, Object value) { @@ -702,7 +620,7 @@ abstract protected ConditionValue getCValueGroupId(); /** - * Equal(=). And NullIgnored, OnceRegistered. {NotNull : TIMESTAMP} + * Equal(=). And NullIgnored, OnlyOnceRegistered. {NotNull : TIMESTAMP} * * @param createdTime The value of createdTime as equal. */ @@ -711,7 +629,7 @@ } /** - * NotEqual(!=). And NullIgnored, OnceRegistered. + * NotEqual(!=). And NullIgnored, OnlyOnceRegistered. * * @param createdTime The value of createdTime as notEqual. */ @@ -720,7 +638,7 @@ } /** - * GreaterThan(>). And NullIgnored, OnceRegistered. + * GreaterThan(>). And NullIgnored, OnlyOnceRegistered. * * @param createdTime The value of createdTime as greaterThan. */ @@ -729,7 +647,7 @@ } /** - * LessThan(>). And NullIgnored, OnceRegistered. + * LessThan(>). And NullIgnored, OnlyOnceRegistered. * * @param createdTime The value of createdTime as lessThan. */ @@ -738,7 +656,7 @@ } /** - * GreaterEqual(>). And NullIgnored, OnceRegistered. + * GreaterEqual(>). And NullIgnored, OnlyOnceRegistered. * * @param createdTime The value of createdTime as greaterEqual. */ @@ -747,7 +665,7 @@ } /** - * LessEqual(>). And NullIgnored, OnceRegistered. + * LessEqual(>). And NullIgnored, OnlyOnceRegistered. * * @param createdTime The value of createdTime as lessEqual. */ @@ -757,7 +675,7 @@ /** * FromTo($fromDate <= COLUMN_NAME <= $toDate). And NullIgnored, - * OnceRegistered. {NotNull : TIMESTAMP} + * OnlyOnceRegistered. {NotNull : TIMESTAMP} * * @param fromDate The from-date of createdTime. (Nullable) * @param toDate The to-date of createdTime. (Nullable) @@ -775,7 +693,7 @@ /** * FromTo($fromDate <= COLUMN_NAME < $toDate + 1). And NullIgnored, - * OnceRegistered. {NotNull : TIMESTAMP} + * OnlyOnceRegistered. {NotNull : TIMESTAMP} * * @param fromDate The from-date of createdTime. (Nullable) * @param toDate The to-date of createdTime. (Nullable) @@ -801,7 +719,7 @@ abstract protected ConditionValue getCValueCreatedTime(); /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {NotNull : + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {NotNull : * VARCHAR(255)} * * @param createdBy The value of createdBy as equal. @@ -811,7 +729,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param createdBy The value of createdBy as notEqual. */ @@ -820,7 +738,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param createdBy The value of createdBy as greaterThan. */ @@ -829,7 +747,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param createdBy The value of createdBy as lessThan. */ @@ -838,7 +756,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param createdBy The value of createdBy as greaterEqual. */ @@ -847,7 +765,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param createdBy The value of createdBy as lessEqual. */ @@ -856,7 +774,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param createdBy The value of createdBy as prefixSearch. */ @@ -865,20 +783,6 @@ } /** - * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, - * SeveralRegistered. - * - * @param createdBy The value of createdBy as likeSearch. - * @param likeSearchOption The option of like-search. (NotNull) - */ - public void setCreatedBy_LikeSearch( - String createdBy, - jp.sf.pal.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. * @@ -889,27 +793,41 @@ } /** - * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * - * @param createdBy The collection of createdBy as inScope. - * @param inScopeOption The option of in-scope. (NotNull) + * @param createdByList The collection of createdBy as notInScope. */ - public void setCreatedBy_InScope( + public void setCreatedBy_NotInScope(Collection createdByList) { + regCreatedBy(CK_NINS, cTL(createdByList)); + } + + /** + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param createdBy The value of createdBy as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) + */ + public void setCreatedBy_LikeSearch( String createdBy, - jp.sf.pal.scheduler.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(createdBy), getCValueCreatedBy(), - "CREATED_BY", "CreatedBy", "createdBy", inScopeOption); + jp.sf.pal.scheduler.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(createdBy), getCValueCreatedBy(), "CREATED_BY", + "CreatedBy", "createdBy", likeSearchOption); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param createdByList The collection of createdBy as notInScope. + * @param createdBy The value of createdBy as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setCreatedBy_NotInScope(Collection createdByList) { - regCreatedBy(CK_NINS, cTL(createdByList)); + public void setCreatedBy_NotLikeSearch( + String createdBy, + jp.sf.pal.scheduler.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(createdBy), getCValueCreatedBy(), "CREATED_BY", + "CreatedBy", "createdBy", likeSearchOption); } protected void regCreatedBy(ConditionKey key, Object value) { @@ -925,7 +843,7 @@ abstract protected ConditionValue getCValueCreatedBy(); /** - * Equal(=). And NullIgnored, OnceRegistered. {NotNull : TIMESTAMP} + * Equal(=). And NullIgnored, OnlyOnceRegistered. {NotNull : TIMESTAMP} * * @param updatedTime The value of updatedTime as equal. */ @@ -934,7 +852,7 @@ } /** - * NotEqual(!=). And NullIgnored, OnceRegistered. + * NotEqual(!=). And NullIgnored, OnlyOnceRegistered. * * @param updatedTime The value of updatedTime as notEqual. */ @@ -943,7 +861,7 @@ } /** - * GreaterThan(>). And NullIgnored, OnceRegistered. + * GreaterThan(>). And NullIgnored, OnlyOnceRegistered. * * @param updatedTime The value of updatedTime as greaterThan. */ @@ -952,7 +870,7 @@ } /** - * LessThan(>). And NullIgnored, OnceRegistered. + * LessThan(>). And NullIgnored, OnlyOnceRegistered. * * @param updatedTime The value of updatedTime as lessThan. */ @@ -961,7 +879,7 @@ } /** - * GreaterEqual(>). And NullIgnored, OnceRegistered. + * GreaterEqual(>). And NullIgnored, OnlyOnceRegistered. * * @param updatedTime The value of updatedTime as greaterEqual. */ @@ -970,7 +888,7 @@ } /** - * LessEqual(>). And NullIgnored, OnceRegistered. + * LessEqual(>). And NullIgnored, OnlyOnceRegistered. * * @param updatedTime The value of updatedTime as lessEqual. */ @@ -980,7 +898,7 @@ /** * FromTo($fromDate <= COLUMN_NAME <= $toDate). And NullIgnored, - * OnceRegistered. {NotNull : TIMESTAMP} + * OnlyOnceRegistered. {NotNull : TIMESTAMP} * * @param fromDate The from-date of updatedTime. (Nullable) * @param toDate The to-date of updatedTime. (Nullable) @@ -998,7 +916,7 @@ /** * FromTo($fromDate <= COLUMN_NAME < $toDate + 1). And NullIgnored, - * OnceRegistered. {NotNull : TIMESTAMP} + * OnlyOnceRegistered. {NotNull : TIMESTAMP} * * @param fromDate The from-date of updatedTime. (Nullable) * @param toDate The to-date of updatedTime. (Nullable) @@ -1024,7 +942,7 @@ abstract protected ConditionValue getCValueUpdatedTime(); /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {NotNull : + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {NotNull : * VARCHAR(255)} * * @param updatedBy The value of updatedBy as equal. @@ -1034,7 +952,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param updatedBy The value of updatedBy as notEqual. */ @@ -1043,7 +961,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param updatedBy The value of updatedBy as greaterThan. */ @@ -1052,7 +970,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param updatedBy The value of updatedBy as lessThan. */ @@ -1061,7 +979,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param updatedBy The value of updatedBy as greaterEqual. */ @@ -1070,7 +988,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param updatedBy The value of updatedBy as lessEqual. */ @@ -1079,7 +997,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param updatedBy The value of updatedBy as prefixSearch. */ @@ -1088,20 +1006,6 @@ } /** - * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, - * SeveralRegistered. - * - * @param updatedBy The value of updatedBy as likeSearch. - * @param likeSearchOption The option of like-search. (NotNull) - */ - public void setUpdatedBy_LikeSearch( - String updatedBy, - jp.sf.pal.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. * @@ -1112,27 +1016,41 @@ } /** - * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * - * @param updatedBy The collection of updatedBy as inScope. - * @param inScopeOption The option of in-scope. (NotNull) + * @param updatedByList The collection of updatedBy as notInScope. */ - public void setUpdatedBy_InScope( + public void setUpdatedBy_NotInScope(Collection updatedByList) { + regUpdatedBy(CK_NINS, cTL(updatedByList)); + } + + /** + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param updatedBy The value of updatedBy as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) + */ + public void setUpdatedBy_LikeSearch( String updatedBy, - jp.sf.pal.scheduler.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(updatedBy), getCValueUpdatedBy(), - "UPDATED_BY", "UpdatedBy", "updatedBy", inScopeOption); + jp.sf.pal.scheduler.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(updatedBy), getCValueUpdatedBy(), "UPDATED_BY", + "UpdatedBy", "updatedBy", likeSearchOption); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param updatedByList The collection of updatedBy as notInScope. + * @param updatedBy The value of updatedBy as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setUpdatedBy_NotInScope(Collection updatedByList) { - regUpdatedBy(CK_NINS, cTL(updatedByList)); + public void setUpdatedBy_NotLikeSearch( + String updatedBy, + jp.sf.pal.scheduler.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(updatedBy), getCValueUpdatedBy(), "UPDATED_BY", + "UpdatedBy", "updatedBy", likeSearchOption); } protected void regUpdatedBy(ConditionKey key, Object value) { @@ -1148,7 +1066,7 @@ abstract protected ConditionValue getCValueUpdatedBy(); /** - * Equal(=). And NullIgnored, OnceRegistered. {TIMESTAMP} + * Equal(=). And NullIgnored, OnlyOnceRegistered. {TIMESTAMP} * * @param deletedTime The value of deletedTime as equal. */ @@ -1157,7 +1075,7 @@ } /** - * NotEqual(!=). And NullIgnored, OnceRegistered. + * NotEqual(!=). And NullIgnored, OnlyOnceRegistered. * * @param deletedTime The value of deletedTime as notEqual. */ @@ -1166,7 +1084,7 @@ } /** - * GreaterThan(>). And NullIgnored, OnceRegistered. + * GreaterThan(>). And NullIgnored, OnlyOnceRegistered. * * @param deletedTime The value of deletedTime as greaterThan. */ @@ -1175,7 +1093,7 @@ } /** - * LessThan(>). And NullIgnored, OnceRegistered. + * LessThan(>). And NullIgnored, OnlyOnceRegistered. * * @param deletedTime The value of deletedTime as lessThan. */ @@ -1184,7 +1102,7 @@ } /** - * GreaterEqual(>). And NullIgnored, OnceRegistered. + * GreaterEqual(>). And NullIgnored, OnlyOnceRegistered. * * @param deletedTime The value of deletedTime as greaterEqual. */ @@ -1193,7 +1111,7 @@ } /** - * LessEqual(>). And NullIgnored, OnceRegistered. + * LessEqual(>). And NullIgnored, OnlyOnceRegistered. * * @param deletedTime The value of deletedTime as lessEqual. */ @@ -1203,7 +1121,7 @@ /** * FromTo($fromDate <= COLUMN_NAME <= $toDate). And NullIgnored, - * OnceRegistered. {TIMESTAMP} + * OnlyOnceRegistered. {TIMESTAMP} * * @param fromDate The from-date of deletedTime. (Nullable) * @param toDate The to-date of deletedTime. (Nullable) @@ -1221,7 +1139,7 @@ /** * FromTo($fromDate <= COLUMN_NAME < $toDate + 1). And NullIgnored, - * OnceRegistered. {TIMESTAMP} + * OnlyOnceRegistered. {TIMESTAMP} * * @param fromDate The from-date of deletedTime. (Nullable) * @param toDate The to-date of deletedTime. (Nullable) @@ -1235,14 +1153,14 @@ } /** - * IsNull(is null). And OnceRegistered. + * IsNull(is null). And OnlyOnceRegistered. */ public void setDeletedTime_IsNull() { regDeletedTime(CK_ISN, DUMMY_OBJECT); } /** - * IsNotNull(is not null). And OnceRegistered. + * IsNotNull(is not null). And OnlyOnceRegistered. */ public void setDeletedTime_IsNotNull() { regDeletedTime(CK_ISNN, DUMMY_OBJECT); @@ -1261,7 +1179,7 @@ abstract protected ConditionValue getCValueDeletedTime(); /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {VARCHAR(255)} + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {VARCHAR(255)} * * @param deletedBy The value of deletedBy as equal. */ @@ -1270,7 +1188,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param deletedBy The value of deletedBy as notEqual. */ @@ -1279,7 +1197,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param deletedBy The value of deletedBy as greaterThan. */ @@ -1288,7 +1206,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param deletedBy The value of deletedBy as lessThan. */ @@ -1297,7 +1215,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param deletedBy The value of deletedBy as greaterEqual. */ @@ -1306,7 +1224,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param deletedBy The value of deletedBy as lessEqual. */ @@ -1315,7 +1233,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param deletedBy The value of deletedBy as prefixSearch. */ @@ -1324,20 +1242,6 @@ } /** - * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, - * SeveralRegistered. - * - * @param deletedBy The value of deletedBy as likeSearch. - * @param likeSearchOption The option of like-search. (NotNull) - */ - public void setDeletedBy_LikeSearch( - String deletedBy, - jp.sf.pal.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. * @@ -1348,38 +1252,52 @@ } /** - * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * - * @param deletedBy The collection of deletedBy as inScope. - * @param inScopeOption The option of in-scope. (NotNull) + * @param deletedByList The collection of deletedBy as notInScope. */ - public void setDeletedBy_InScope( + public void setDeletedBy_NotInScope(Collection deletedByList) { + regDeletedBy(CK_NINS, cTL(deletedByList)); + } + + /** + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param deletedBy The value of deletedBy as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) + */ + public void setDeletedBy_LikeSearch( String deletedBy, - jp.sf.pal.scheduler.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(deletedBy), getCValueDeletedBy(), - "DELETED_BY", "DeletedBy", "deletedBy", inScopeOption); + jp.sf.pal.scheduler.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(deletedBy), getCValueDeletedBy(), "DELETED_BY", + "DeletedBy", "deletedBy", likeSearchOption); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param deletedByList The collection of deletedBy as notInScope. + * @param deletedBy The value of deletedBy as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setDeletedBy_NotInScope(Collection deletedByList) { - regDeletedBy(CK_NINS, cTL(deletedByList)); + public void setDeletedBy_NotLikeSearch( + String deletedBy, + jp.sf.pal.scheduler.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(deletedBy), getCValueDeletedBy(), "DELETED_BY", + "DeletedBy", "deletedBy", likeSearchOption); } /** - * IsNull(is null). And OnceRegistered. + * IsNull(is null). And OnlyOnceRegistered. */ public void setDeletedBy_IsNull() { regDeletedBy(CK_ISN, DUMMY_OBJECT); } /** - * IsNotNull(is not null). And OnceRegistered. + * IsNotNull(is not null). And OnlyOnceRegistered. */ public void setDeletedBy_IsNotNull() { regDeletedBy(CK_ISNN, DUMMY_OBJECT); @@ -1398,7 +1316,7 @@ abstract protected ConditionValue getCValueDeletedBy(); /** - * Equal(=). And NullIgnored, OnceRegistered. {NotNull : INTEGER : + * Equal(=). And NullIgnored, OnlyOnceRegistered. {NotNull : INTEGER : * Default=[0]} * * @param versionno The value of versionno as equal. @@ -1408,7 +1326,7 @@ } /** - * NotEqual(!=). And NullIgnored, OnceRegistered. + * NotEqual(!=). And NullIgnored, OnlyOnceRegistered. * * @param versionno The value of versionno as notEqual. */ @@ -1417,7 +1335,7 @@ } /** - * GreaterThan(>). And NullIgnored, OnceRegistered. + * GreaterThan(>). And NullIgnored, OnlyOnceRegistered. * * @param versionno The value of versionno as greaterThan. */ @@ -1426,7 +1344,7 @@ } /** - * LessThan(<). And NullIgnored, OnceRegistered. + * LessThan(<). And NullIgnored, OnlyOnceRegistered. * * @param versionno The value of versionno as lessThan. */ @@ -1435,7 +1353,7 @@ } /** - * GreaterEqual(>=). And NullIgnored, OnceRegistered. + * GreaterEqual(>=). And NullIgnored, OnlyOnceRegistered. * * @param versionno The value of versionno as greaterEqual. */ @@ -1444,7 +1362,7 @@ } /** - * LessEqual(<=). And NullIgnored, OnceRegistered. + * LessEqual(<=). And NullIgnored, OnlyOnceRegistered. * * @param versionno The value of versionno as lessEqual. */ @@ -1484,6 +1402,50 @@ abstract protected ConditionValue getCValueVersionno(); + public SSQFunction scalar_Equal() { + return xcreateSSQFunction("="); + } + + public SSQFunction scalar_GreaterEqual() { + return xcreateSSQFunction(">="); + } + + public SSQFunction scalar_GreaterThan() { + return xcreateSSQFunction(">"); + } + + public SSQFunction scalar_LessEqual() { + return xcreateSSQFunction("<="); + } + + public SSQFunction scalar_LessThan() { + return xcreateSSQFunction("<"); + } + + protected SSQFunction xcreateSSQFunction(final String operand) { + return new SSQFunction(new SSQSetupper() { + public void setup(String function, SubQuery subQuery) { + xscalarSubQuery(function, subQuery, operand); + } + }); + } + + protected void xscalarSubQuery(String function, + SubQuery subQuery, String operand) { + assertObjectNotNull("subQuery", subQuery); + FacilityCB cb = new FacilityCB(); + cb.xsetupForScalarSubQuery(); + subQuery.query(cb); + String subQueryPropertyName = keepScalarSubQuery(cb.query()); // for + // saving + // query + // -value. + registerScalarSubQuery(function, cb.query(), subQueryPropertyName, + operand); + } + + public abstract String keepScalarSubQuery(FacilityCQ subQuery); + // Very Internal (for Suppressing Warn about 'Not Use Import') protected String getConditionBeanClassNameInternally() { return FacilityCB.class.getName(); Modified: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/cq/bs/AbstractBsFacilityContentCQ.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/cq/bs/AbstractBsFacilityContentCQ.java 2008-12-27 22:14:41 UTC (rev 1629) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/cq/bs/AbstractBsFacilityContentCQ.java 2008-12-27 22:18:30 UTC (rev 1630) @@ -18,7 +18,6 @@ * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public abstract class AbstractBsFacilityContentCQ extends AbstractConditionQuery { @@ -49,8 +48,8 @@ // ===== /** - * Equal(=). And NullIgnored, OnceRegistered. {PK : NotNull : INTEGER : FK - * to FACILITY} + * Equal(=). And NullIgnored, OnlyOnceRegistered. {PK : NotNull : INTEGER : + * FK to FACILITY} * * @param id The value of id as equal. */ @@ -59,7 +58,7 @@ } /** - * NotEqual(!=). And NullIgnored, OnceRegistered. + * NotEqual(!=). And NullIgnored, OnlyOnceRegistered. * * @param id The value of id as notEqual. */ @@ -68,7 +67,7 @@ } /** - * GreaterThan(>). And NullIgnored, OnceRegistered. + * GreaterThan(>). And NullIgnored, OnlyOnceRegistered. * * @param id The value of id as greaterThan. */ @@ -77,7 +76,7 @@ } /** - * LessThan(<). And NullIgnored, OnceRegistered. + * LessThan(<). And NullIgnored, OnlyOnceRegistered. * * @param id The value of id as lessThan. */ @@ -86,7 +85,7 @@ } /** - * GreaterEqual(>=). And NullIgnored, OnceRegistered. + * GreaterEqual(>=). And NullIgnored, OnlyOnceRegistered. * * @param id The value of id as greaterEqual. */ @@ -95,7 +94,7 @@ } /** - * LessEqual(<=). And NullIgnored, OnceRegistered. + * LessEqual(<=). And NullIgnored, OnlyOnceRegistered. * * @param id The value of id as lessEqual. */ @@ -123,42 +122,27 @@ regId(CK_NINS, cTL(idList)); } - /** - * @param facilityCBquery Query. - * @deprecated Please use inScopeFacility(subQuery) method. - */ - public void setId_InScopeSubQuery_Facility(FacilityCQ facilityCBquery) { - String subQueryPropertyName = keepId_InScopeSubQuery_Facility(facilityCBquery);// for - // saving - // query - // - - // value - // . - registerInScopeSubQuery(facilityCBquery, "ID", "ID", - subQueryPropertyName); - } - public void inScopeFacility(SubQuery subQuery) { assertObjectNotNull("subQuery", subQuery); FacilityCB cb = new FacilityCB(); cb.xsetupForInScopeSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepId_InScopeSubQuery_Facility(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerInScopeSubQuery(cb.query(), "ID", "ID", subQueryPropertyName); } - abstract public String keepId_InScopeSubQuery_Facility(FacilityCQ subQuery); + public abstract String keepId_InScopeSubQuery_Facility(FacilityCQ subQuery); /** - * IsNull(is null). And OnceRegistered. + * IsNull(is null). And OnlyOnceRegistered. */ public void setId_IsNull() { regId(CK_ISN, DUMMY_OBJECT); } /** - * IsNotNull(is not null). And OnceRegistered. + * IsNotNull(is not null). And OnlyOnceRegistered. */ public void setId_IsNotNull() { regId(CK_ISNN, DUMMY_OBJECT); @@ -175,7 +159,7 @@ abstract protected ConditionValue getCValueId(); /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {VARCHAR(1000)} + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {VARCHAR(1000)} * * @param content The value of content as equal. */ @@ -184,7 +168,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param content The value of content as notEqual. */ @@ -193,7 +177,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param content The value of content as greaterThan. */ @@ -202,7 +186,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param content The value of content as lessThan. */ @@ -211,7 +195,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param content The value of content as greaterEqual. */ @@ -220,7 +204,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param content The value of content as lessEqual. */ @@ -229,7 +213,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param content The value of content as prefixSearch. */ @@ -238,20 +222,6 @@ } /** - * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, - * SeveralRegistered. - * - * @param content The value of content as likeSearch. - * @param likeSearchOption The option of like-search. (NotNull) - */ - public void setContent_LikeSearch( - String content, - jp.sf.pal.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. * @@ -262,38 +232,52 @@ } /** - * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * - * @param content The collection of content as inScope. - * @param inScopeOption The option of in-scope. (NotNull) + * @param contentList The collection of content as notInScope. */ - public void setContent_InScope( + public void setContent_NotInScope(Collection contentList) { + regContent(CK_NINS, cTL(contentList)); + } + + /** + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param content The value of content as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) + */ + public void setContent_LikeSearch( String content, - jp.sf.pal.scheduler.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(content), getCValueContent(), - "CONTENT", "Content", "content", inScopeOption); + jp.sf.pal.scheduler.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(content), getCValueContent(), "CONTENT", "Content", + "content", likeSearchOption); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param contentList The collection of content as notInScope. + * @param content The value of content as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setContent_NotInScope(Collection contentList) { - regContent(CK_NINS, cTL(contentList)); + public void setContent_NotLikeSearch( + String content, + jp.sf.pal.scheduler.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(content), getCValueContent(), "CONTENT", "Content", + "content", likeSearchOption); } /** - * IsNull(is null). And OnceRegistered. + * IsNull(is null). And OnlyOnceRegistered. */ public void setContent_IsNull() { regContent(CK_ISN, DUMMY_OBJECT); } /** - * IsNotNull(is not null). And OnceRegistered. + * IsNotNull(is not null). And OnlyOnceRegistered. */ public void setContent_IsNotNull() { regContent(CK_ISNN, DUMMY_OBJECT); @@ -311,6 +295,53 @@ abstract protected ConditionValue getCValueContent(); + public SSQFunction scalar_Equal() { + return xcreateSSQFunction("="); + } + + public SSQFunction scalar_GreaterEqual() { + return xcreateSSQFunction(">="); + } + + public SSQFunction scalar_GreaterThan() { + return xcreateSSQFunction(">"); + } + + public SSQFunction scalar_LessEqual() { + return xcreateSSQFunction("<="); + } + + public SSQFunction scalar_LessThan() { + return xcreateSSQFunction("<"); + } + + protected SSQFunction xcreateSSQFunction( + final String operand) { + return new SSQFunction( + new SSQSetupper() { + public void setup(String function, + SubQuery subQuery) { + xscalarSubQuery(function, subQuery, operand); + } + }); + } + + protected void xscalarSubQuery(String function, + SubQuery subQuery, String operand) { + assertObjectNotNull("subQuery", subQuery); + FacilityContentCB cb = new FacilityContentCB(); + cb.xsetupForScalarSubQuery(); + subQuery.query(cb); + String subQueryPropertyName = keepScalarSubQuery(cb.query()); // for + // saving + // query + // -value. + registerScalarSubQuery(function, cb.query(), subQueryPropertyName, + operand); + } + + public abstract String keepScalarSubQuery(FacilityContentCQ subQuery); + // Very Internal (for Suppressing Warn about 'Not Use Import') protected String getConditionBeanClassNameInternally() { return FacilityContentCB.class.getName(); Modified: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/cq/bs/AbstractBsFacilityGroupCQ.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/cq/bs/AbstractBsFacilityGroupCQ.java 2008-12-27 22:14:41 UTC (rev 1629) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/cq/bs/AbstractBsFacilityGroupCQ.java 2008-12-27 22:18:30 UTC (rev 1630) @@ -18,7 +18,6 @@ * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public abstract class AbstractBsFacilityGroupCQ extends AbstractConditionQuery { //========================================================================== @@ -48,7 +47,8 @@ // ===== /** - * Equal(=). And NullIgnored, OnceRegistered. {PK : ID : NotNull : INTEGER} + * Equal(=). And NullIgnored, OnlyOnceRegistered. {PK : ID : NotNull : + * INTEGER} * * @param id The value of id as equal. */ @@ -57,7 +57,7 @@ } /** - * NotEqual(!=). And NullIgnored, OnceRegistered. + * NotEqual(!=). And NullIgnored, OnlyOnceRegistered. * * @param id The value of id as notEqual. */ @@ -66,7 +66,7 @@ } /** - * GreaterThan(>). And NullIgnored, OnceRegistered. + * GreaterThan(>). And NullIgnored, OnlyOnceRegistered. * * @param id The value of id as greaterThan. */ @@ -75,7 +75,7 @@ } /** - * LessThan(<). And NullIgnored, OnceRegistered. + * LessThan(<). And NullIgnored, OnlyOnceRegistered. * * @param id The value of id as lessThan. */ @@ -84,7 +84,7 @@ } /** - * GreaterEqual(>=). And NullIgnored, OnceRegistered. + * GreaterEqual(>=). And NullIgnored, OnlyOnceRegistered. * * @param id The value of id as greaterEqual. */ @@ -93,7 +93,7 @@ } /** - * LessEqual(<=). And NullIgnored, OnceRegistered. + * LessEqual(<=). And NullIgnored, OnlyOnceRegistered. * * @param id The value of id as lessEqual. */ @@ -121,33 +121,18 @@ regId(CK_NINS, cTL(idList)); } - /** - * @param facilityCBquery Query. - * @deprecated Please use inScopeFacilityList(subQuery) method. - */ - public void setId_InScopeSubQuery_FacilityList(FacilityCQ facilityCBquery) { - String subQueryPropertyName = keepId_InScopeSubQuery_FacilityList(facilityCBquery);// for - // saving - // query - // - - // value - // . - registerInScopeSubQuery(facilityCBquery, "ID", "GROUP_ID", - subQueryPropertyName); - } - public void inScopeFacilityList(SubQuery subQuery) { assertObjectNotNull("subQuery", subQuery); FacilityCB cb = new FacilityCB(); cb.xsetupForInScopeSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepId_InScopeSubQuery_FacilityList(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerInScopeSubQuery(cb.query(), "ID", "GROUP_ID", subQueryPropertyName); } - abstract public String keepId_InScopeSubQuery_FacilityList( + public abstract String keepId_InScopeSubQuery_FacilityList( FacilityCQ subQuery); public void notInScopeFacilityList(SubQuery subQuery) { @@ -156,30 +141,15 @@ cb.xsetupForInScopeSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepId_NotInScopeSubQuery_FacilityList(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerNotInScopeSubQuery(cb.query(), "ID", "GROUP_ID", subQueryPropertyName); } - abstract public String keepId_NotInScopeSubQuery_FacilityList( + public abstract String keepId_NotInScopeSubQuery_FacilityList( FacilityCQ subQuery); /** - * @param facilityCBquery Query. - * @deprecated Please use existsFacilityList(subQuery) method. - */ - public void setId_ExistsSubQuery_FacilityList(FacilityCQ facilityCBquery) { - String subQueryPropertyName = keepId_ExistsSubQuery_FacilityList(facilityCBquery);// for - // saving - // query - // - - // value - // . - registerExistsSubQuery(facilityCBquery, "ID", "GROUP_ID", - subQueryPropertyName); - } - - /** * Set up 'exists' sub-query. {exists (select GROUP_ID from FACILITY where * ...)} * @@ -192,12 +162,12 @@ cb.xsetupForExistsSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepId_ExistsSubQuery_FacilityList(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerExistsSubQuery(cb.query(), "ID", "GROUP_ID", subQueryPropertyName); } - abstract public String keepId_ExistsSubQuery_FacilityList( + public abstract String keepId_ExistsSubQuery_FacilityList( FacilityCQ subQuery); /** @@ -213,38 +183,38 @@ cb.xsetupForExistsSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepId_NotExistsSubQuery_FacilityList(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerNotExistsSubQuery(cb.query(), "ID", "GROUP_ID", subQueryPropertyName); } - abstract public String keepId_NotExistsSubQuery_FacilityList( + public abstract String keepId_NotExistsSubQuery_FacilityList( FacilityCQ subQuery); public void xderiveFacilityList(String function, SubQuery subQuery, String aliasName) { assertObjectNotNull("subQuery", subQuery); FacilityCB cb = new FacilityCB(); - cb.xsetupForDeriveReferrer(); + cb.xsetupForDerivedReferrer(); subQuery.query(cb); - String subQueryPropertyName = keepId_DeriveSubQuery_FacilityList(cb - .query());// for saving query-value. - registerDeriveSubQuery(function, cb.query(), "ID", "GROUP_ID", + String subQueryPropertyName = keepId_DerivedReferrer_FacilityList(cb + .query()); // for saving query-value. + registerDerivedReferrerSubQuery(function, cb.query(), "ID", "GROUP_ID", subQueryPropertyName, aliasName); } - abstract public String keepId_DeriveSubQuery_FacilityList( + public abstract String keepId_DerivedReferrer_FacilityList( FacilityCQ subQuery); /** - * IsNull(is null). And OnceRegistered. + * IsNull(is null). And OnlyOnceRegistered. */ public void setId_IsNull() { regId(CK_ISN, DUMMY_OBJECT); } /** - * IsNotNull(is not null). And OnceRegistered. + * IsNotNull(is not null). And OnlyOnceRegistered. */ public void setId_IsNotNull() { regId(CK_ISNN, DUMMY_OBJECT); @@ -261,7 +231,7 @@ abstract protected ConditionValue getCValueId(); /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {NotNull : + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {NotNull : * VARCHAR(100)} * * @param name The value of name as equal. @@ -271,7 +241,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param name The value of name as notEqual. */ @@ -280,7 +250,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param name The value of name as greaterThan. */ @@ -289,7 +259,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param name The value of name as lessThan. */ @@ -298,7 +268,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param name The value of name as greaterEqual. */ @@ -307,7 +277,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param name The value of name as lessEqual. */ @@ -316,7 +286,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param name The value of name as prefixSearch. */ @@ -325,20 +295,6 @@ } /** - * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, - * SeveralRegistered. - * - * @param name The value of name as likeSearch. - * @param likeSearchOption The option of like-search. (NotNull) - */ - public void setName_LikeSearch( - String name, - jp.sf.pal.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. * @@ -349,27 +305,41 @@ } /** - * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * - * @param name The collection of name as inScope. - * @param inScopeOption The option of in-scope. (NotNull) + * @param nameList The collection of name as notInScope. */ - public void setName_InScope( + public void setName_NotInScope(Collection nameList) { + regName(CK_NINS, cTL(nameList)); + } + + /** + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param name The value of name as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) + */ + public void setName_LikeSearch( String name, - jp.sf.pal.scheduler.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(name), getCValueName(), "NAME", - "Name", "name", inScopeOption); + jp.sf.pal.scheduler.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(name), getCValueName(), "NAME", "Name", "name", + likeSearchOption); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param nameList The collection of name as notInScope. + * @param name The value of name as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setName_NotInScope(Collection nameList) { - regName(CK_NINS, cTL(nameList)); + public void setName_NotLikeSearch( + String name, + jp.sf.pal.scheduler.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(name), getCValueName(), "NAME", "Name", "name", + likeSearchOption); } protected void regName(ConditionKey key, Object value) { @@ -383,7 +353,7 @@ abstract protected ConditionValue getCValueName(); /** - * Equal(=). And NullIgnored, OnceRegistered. {NotNull : INTEGER : + * Equal(=). And NullIgnored, OnlyOnceRegistered. {NotNull : INTEGER : * Default=[1]} * * @param sortOrder The value of sortOrder as equal. @@ -393,7 +363,7 @@ } /** - * NotEqual(!=). And NullIgnored, OnceRegistered. + * NotEqual(!=). And NullIgnored, OnlyOnceRegistered. * * @param sortOrder The value of sortOrder as notEqual. */ @@ -402,7 +372,7 @@ } /** - * GreaterThan(>). And NullIgnored, OnceRegistered. + * GreaterThan(>). And NullIgnored, OnlyOnceRegistered. * * @param sortOrder The value of sortOrder as greaterThan. */ @@ -411,7 +381,7 @@ } /** - * LessThan(<). And NullIgnored, OnceRegistered. + * LessThan(<). And NullIgnored, OnlyOnceRegistered. * * @param sortOrder The value of sortOrder as lessThan. */ @@ -420,7 +390,7 @@ } /** - * GreaterEqual(>=). And NullIgnored, OnceRegistered. + * GreaterEqual(>=). And NullIgnored, OnlyOnceRegistered. * * @param sortOrder The value of sortOrder as greaterEqual. */ @@ -429,7 +399,7 @@ } /** - * LessEqual(<=). And NullIgnored, OnceRegistered. + * LessEqual(<=). And NullIgnored, OnlyOnceRegistered. * * @param sortOrder The value of sortOrder as lessEqual. */ @@ -470,7 +440,7 @@ abstract protected ConditionValue getCValueSortOrder(); /** - * Equal(=). And NullIgnored, OnceRegistered. {NotNull : TIMESTAMP} + * Equal(=). And NullIgnored, OnlyOnceRegistered. {NotNull : TIMESTAMP} * * @param createdTime The value of createdTime as equal. */ @@ -479,7 +449,7 @@ } /** - * NotEqual(!=). And NullIgnored, OnceRegistered. + * NotEqual(!=). And NullIgnored, OnlyOnceRegistered. * * @param createdTime The value of createdTime as notEqual. */ @@ -488,7 +458,7 @@ } /** - * GreaterThan(>). And NullIgnored, OnceRegistered. + * GreaterThan(>). And NullIgnored, OnlyOnceRegistered. * * @param createdTime The value of createdTime as greaterThan. */ @@ -497,7 +467,7 @@ } /** - * LessThan(>). And NullIgnored, OnceRegistered. + * LessThan(>). And NullIgnored, OnlyOnceRegistered. * * @param createdTime The value of createdTime as lessThan. */ @@ -506,7 +476,7 @@ } /** - * GreaterEqual(>). And NullIgnored, OnceRegistered. + * GreaterEqual(>). And NullIgnored, OnlyOnceRegistered. * * @param createdTime The value of createdTime as greaterEqual. */ @@ -515,7 +485,7 @@ } /** - * LessEqual(>). And NullIgnored, OnceRegistered. + * LessEqual(>). And NullIgnored, OnlyOnceRegistered. * * @param createdTime The value of createdTime as lessEqual. */ @@ -525,7 +495,7 @@ /** * FromTo($fromDate <= COLUMN_NAME <= $toDate). And NullIgnored, - * OnceRegistered. {NotNull : TIMESTAMP} + * OnlyOnceRegistered. {NotNull : TIMESTAMP} * * @param fromDate The from-date of createdTime. (Nullable) * @param toDate The to-date of createdTime. (Nullable) @@ -543,7 +513,7 @@ /** * FromTo($fromDate <= COLUMN_NAME < $toDate + 1). And NullIgnored, - * OnceRegistered. {NotNull : TIMESTAMP} + * OnlyOnceRegistered. {NotNull : TIMESTAMP} * * @param fromDate The from-date of createdTime. (Nullable) * @param toDate The to-date of createdTime. (Nullable) @@ -569,7 +539,7 @@ abstract protected ConditionValue getCValueCreatedTime(); /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {NotNull : + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {NotNull : * VARCHAR(255)} * * @param createdBy The value of createdBy as equal. @@ -579,7 +549,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param createdBy The value of createdBy as notEqual. */ @@ -588,7 +558,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param createdBy The value of createdBy as greaterThan. */ @@ -597,7 +567,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param createdBy The value of createdBy as lessThan. */ @@ -606,7 +576,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param createdBy The value of createdBy as greaterEqual. */ @@ -615,7 +585,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param createdBy The value of createdBy as lessEqual. */ @@ -624,7 +594,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param createdBy The value of createdBy as prefixSearch. */ @@ -633,20 +603,6 @@ } /** - * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, - * SeveralRegistered. - * - * @param createdBy The value of createdBy as likeSearch. - * @param likeSearchOption The option of like-search. (NotNull) - */ - public void setCreatedBy_LikeSearch( - String createdBy, - jp.sf.pal.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. * @@ -657,27 +613,41 @@ } /** - * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * - * @param createdBy The collection of createdBy as inScope. - * @param inScopeOption The option of in-scope. (NotNull) + * @param createdByList The collection of createdBy as notInScope. */ - public void setCreatedBy_InScope( + public void setCreatedBy_NotInScope(Collection createdByList) { + regCreatedBy(CK_NINS, cTL(createdByList)); + } + + /** + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param createdBy The value of createdBy as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) + */ + public void setCreatedBy_LikeSearch( String createdBy, - jp.sf.pal.scheduler.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(createdBy), getCValueCreatedBy(), - "CREATED_BY", "CreatedBy", "createdBy", inScopeOption); + jp.sf.pal.scheduler.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(createdBy), getCValueCreatedBy(), "CREATED_BY", + "CreatedBy", "createdBy", likeSearchOption); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param createdByList The collection of createdBy as notInScope. + * @param createdBy The value of createdBy as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setCreatedBy_NotInScope(Collection createdByList) { - regCreatedBy(CK_NINS, cTL(createdByList)); + public void setCreatedBy_NotLikeSearch( + String createdBy, + jp.sf.pal.scheduler.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(createdBy), getCValueCreatedBy(), "CREATED_BY", + "CreatedBy", "createdBy", likeSearchOption); } protected void regCreatedBy(ConditionKey key, Object value) { @@ -693,7 +663,7 @@ abstract protected ConditionValue getCValueCreatedBy(); /** - * Equal(=). And NullIgnored, OnceRegistered. {NotNull : TIMESTAMP} + * Equal(=). And NullIgnored, OnlyOnceRegistered. {NotNull : TIMESTAMP} * * @param updatedTime The value of updatedTime as equal. */ @@ -702,7 +672,7 @@ } /** - * NotEqual(!=). And NullIgnored, OnceRegistered. + * NotEqual(!=). And NullIgnored, OnlyOnceRegistered. * * @param updatedTime The value of updatedTime as notEqual. */ @@ -711,7 +681,7 @@ } /** - * GreaterThan(>). And NullIgnored, OnceRegistered. + * GreaterThan(>). And NullIgnored, OnlyOnceRegistered. * * @param updatedTime The value of updatedTime as greaterThan. */ @@ -720,7 +690,7 @@ } /** - * LessThan(>). And NullIgnored, OnceRegistered. + * LessThan(>). And NullIgnored, OnlyOnceRegistered. * * @param updatedTime The value of updatedTime as lessThan. */ @@ -729,7 +699,7 @@ } /** - * GreaterEqual(>). And NullIgnored, OnceRegistered. + * GreaterEqual(>). And NullIgnored, OnlyOnceRegistered. * * @param updatedTime The value of updatedTime as greaterEqual. */ @@ -738,7 +708,7 @@ } /** - * LessEqual(>). And NullIgnored, OnceRegistered. + * LessEqual(>). And NullIgnored, OnlyOnceRegistered. * * @param updatedTime The value of updatedTime as lessEqual. */ @@ -748,7 +718,7 @@ /** * FromTo($fromDate <= COLUMN_NAME <= $toDate). And NullIgnored, - * OnceRegistered. {NotNull : TIMESTAMP} + * OnlyOnceRegistered. {NotNull : TIMESTAMP} * * @param fromDate The from-date of updatedTime. (Nullable) * @param toDate The to-date of updatedTime. (Nullable) @@ -766,7 +736,7 @@ /** * FromTo($fromDate <= COLUMN_NAME < $toDate + 1). And NullIgnored, - * OnceRegistered. {NotNull : TIMESTAMP} + * OnlyOnceRegistered. {NotNull : TIMESTAMP} * * @param fromDate The from-date of updatedTime. (Nullable) * @param toDate The to-date of updatedTime. (Nullable) @@ -792,7 +762,7 @@ abstract protected ConditionValue getCValueUpdatedTime(); /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {NotNull : + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {NotNull : * VARCHAR(255)} * * @param updatedBy The value of updatedBy as equal. @@ -802,7 +772,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param updatedBy The value of updatedBy as notEqual. */ @@ -811,7 +781,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param updatedBy The value of updatedBy as greaterThan. */ @@ -820,7 +790,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param updatedBy The value of updatedBy as lessThan. */ @@ -829,7 +799,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param updatedBy The value of updatedBy as greaterEqual. */ @@ -838,7 +808,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param updatedBy The value of updatedBy as lessEqual. */ @@ -847,7 +817,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param updatedBy The value of updatedBy as prefixSearch. */ @@ -856,20 +826,6 @@ } /** - * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, - * SeveralRegistered. - * - * @param updatedBy The value of updatedBy as likeSearch. - * @param likeSearchOption The option of like-search. (NotNull) - */ - public void setUpdatedBy_LikeSearch( - String updatedBy, - jp.sf.pal.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. * @@ -880,27 +836,41 @@ } /** - * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * - * @param updatedBy The collection of updatedBy as inScope. - * @param inScopeOption The option of in-scope. (NotNull) + * @param updatedByList The collection of updatedBy as notInScope. */ - public void setUpdatedBy_InScope( + public void setUpdatedBy_NotInScope(Collection updatedByList) { + regUpdatedBy(CK_NINS, cTL(updatedByList)); + } + + /** + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param updatedBy The value of updatedBy as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) + */ + public void setUpdatedBy_LikeSearch( String updatedBy, - jp.sf.pal.scheduler.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(updatedBy), getCValueUpdatedBy(), - "UPDATED_BY", "UpdatedBy", "updatedBy", inScopeOption); + jp.sf.pal.scheduler.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(updatedBy), getCValueUpdatedBy(), "UPDATED_BY", + "UpdatedBy", "updatedBy", likeSearchOption); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param updatedByList The collection of updatedBy as notInScope. + * @param updatedBy The value of updatedBy as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setUpdatedBy_NotInScope(Collection updatedByList) { - regUpdatedBy(CK_NINS, cTL(updatedByList)); + public void setUpdatedBy_NotLikeSearch( + String updatedBy, + jp.sf.pal.scheduler.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(updatedBy), getCValueUpdatedBy(), "UPDATED_BY", + "UpdatedBy", "updatedBy", likeSearchOption); } protected void regUpdatedBy(ConditionKey key, Object value) { @@ -916,7 +886,7 @@ abstract protected ConditionValue getCValueUpdatedBy(); /** - * Equal(=). And NullIgnored, OnceRegistered. {TIMESTAMP} + * Equal(=). And NullIgnored, OnlyOnceRegistered. {TIMESTAMP} * * @param deletedTime The value of deletedTime as equal. */ @@ -925,7 +895,7 @@ } /** - * NotEqual(!=). And NullIgnored, OnceRegistered. + * NotEqual(!=). And NullIgnored, OnlyOnceRegistered. * * @param deletedTime The value of deletedTime as notEqual. */ @@ -934,7 +904,7 @@ } /** - * GreaterThan(>). And NullIgnored, OnceRegistered. + * GreaterThan(>). And NullIgnored, OnlyOnceRegistered. * * @param deletedTime The value of deletedTime as greaterThan. */ @@ -943,7 +913,7 @@ } /** - * LessThan(>). And NullIgnored, OnceRegistered. + * LessThan(>). And NullIgnored, OnlyOnceRegistered. * * @param deletedTime The value of deletedTime as lessThan. */ @@ -952,7 +922,7 @@ } /** - * GreaterEqual(>). And NullIgnored, OnceRegistered. + * GreaterEqual(>). And NullIgnored, OnlyOnceRegistered. * * @param deletedTime The value of deletedTime as greaterEqual. */ @@ -961,7 +931,7 @@ } /** - * LessEqual(>). And NullIgnored, OnceRegistered. + * LessEqual(>). And NullIgnored, OnlyOnceRegistered. * * @param deletedTime The value of deletedTime as lessEqual. */ @@ -971,7 +941,7 @@ /** * FromTo($fromDate <= COLUMN_NAME <= $toDate). And NullIgnored, - * OnceRegistered. {TIMESTAMP} + * OnlyOnceRegistered. {TIMESTAMP} * * @param fromDate The from-date of deletedTime. (Nullable) * @param toDate The to-date of deletedTime. (Nullable) @@ -989,7 +959,7 @@ /** * FromTo($fromDate <= COLUMN_NAME < $toDate + 1). And NullIgnored, - * OnceRegistered. {TIMESTAMP} + * OnlyOnceRegistered. {TIMESTAMP} * * @param fromDate The from-date of deletedTime. (Nullable) * @param toDate The to-date of deletedTime. (Nullable) @@ -1003,14 +973,14 @@ } /** - * IsNull(is null). And OnceRegistered. + * IsNull(is null). And OnlyOnceRegistered. */ public void setDeletedTime_IsNull() { regDeletedTime(CK_ISN, DUMMY_OBJECT); } /** - * IsNotNull(is not null). And OnceRegistered. + * IsNotNull(is not null). And OnlyOnceRegistered. */ public void setDeletedTime_IsNotNull() { regDeletedTime(CK_ISNN, DUMMY_OBJECT); @@ -1029,7 +999,7 @@ abstract protected ConditionValue getCValueDeletedTime(); /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {VARCHAR(255)} + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {VARCHAR(255)} * * @param deletedBy The value of deletedBy as equal. */ @@ -1038,7 +1008,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param deletedBy The value of deletedBy as notEqual. */ @@ -1047,7 +1017,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param deletedBy The value of deletedBy as greaterThan. */ @@ -1056,7 +1026,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param deletedBy The value of deletedBy as lessThan. */ @@ -1065,7 +1035,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param deletedBy The value of deletedBy as greaterEqual. */ @@ -1074,7 +1044,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param deletedBy The value of deletedBy as lessEqual. */ @@ -1083,7 +1053,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param deletedBy The value of deletedBy as prefixSearch. */ @@ -1092,20 +1062,6 @@ } /** - * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, - * SeveralRegistered. - * - * @param deletedBy The value of deletedBy as likeSearch. - * @param likeSearchOption The option of like-search. (NotNull) - */ - public void setDeletedBy_LikeSearch( - String deletedBy, - jp.sf.pal.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. * @@ -1116,38 +1072,52 @@ } /** - * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * - * @param deletedBy The collection of deletedBy as inScope. - * @param inScopeOption The option of in-scope. (NotNull) + * @param deletedByList The collection of deletedBy as notInScope. */ - public void setDeletedBy_InScope( + public void setDeletedBy_NotInScope(Collection deletedByList) { + regDeletedBy(CK_NINS, cTL(deletedByList)); + } + + /** + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param deletedBy The value of deletedBy as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) + */ + public void setDeletedBy_LikeSearch( String deletedBy, - jp.sf.pal.scheduler.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(deletedBy), getCValueDeletedBy(), - "DELETED_BY", "DeletedBy", "deletedBy", inScopeOption); + jp.sf.pal.scheduler.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(deletedBy), getCValueDeletedBy(), "DELETED_BY", + "DeletedBy", "deletedBy", likeSearchOption); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param deletedByList The collection of deletedBy as notInScope. + * @param deletedBy The value of deletedBy as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setDeletedBy_NotInScope(Collection deletedByList) { - regDeletedBy(CK_NINS, cTL(deletedByList)); + public void setDeletedBy_NotLikeSearch( + String deletedBy, + jp.sf.pal.scheduler.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(deletedBy), getCValueDeletedBy(), "DELETED_BY", + "DeletedBy", "deletedBy", likeSearchOption); } /** - * IsNull(is null). And OnceRegistered. + * IsNull(is null). And OnlyOnceRegistered. */ public void setDeletedBy_IsNull() { regDeletedBy(CK_ISN, DUMMY_OBJECT); } /** - * IsNotNull(is not null). And OnceRegistered. + * IsNotNull(is not null). And OnlyOnceRegistered. */ public void setDeletedBy_IsNotNull() { regDeletedBy(CK_ISNN, DUMMY_OBJECT); @@ -1166,7 +1136,7 @@ abstract protected ConditionValue getCValueDeletedBy(); /** - * Equal(=). And NullIgnored, OnceRegistered. {NotNull : INTEGER : + * Equal(=). And NullIgnored, OnlyOnceRegistered. {NotNull : INTEGER : * Default=[0]} * * @param versionno The value of versionno as equal. @@ -1176,7 +1146,7 @@ } /** - * NotEqual(!=). And NullIgnored, OnceRegistered. + * NotEqual(!=). And NullIgnored, OnlyOnceRegistered. * * @param versionno The value of versionno as notEqual. */ @@ -1185,7 +1155,7 @@ } /** - * GreaterThan(>). And NullIgnored, OnceRegistered. + * GreaterThan(>). And NullIgnored, OnlyOnceRegistered. * * @param versionno The value of versionno as greaterThan. */ @@ -1194,7 +1164,7 @@ } /** - * LessThan(<). And NullIgnored, OnceRegistered. + * LessThan(<). And NullIgnored, OnlyOnceRegistered. * * @param versionno The value of versionno as lessThan. */ @@ -1203,7 +1173,7 @@ } /** - * GreaterEqual(>=). And NullIgnored, OnceRegistered. + * GreaterEqual(>=). And NullIgnored, OnlyOnceRegistered. * * @param versionno The value of versionno as greaterEqual. */ @@ -1212,7 +1182,7 @@ } /** - * LessEqual(<=). And NullIgnored, OnceRegistered. + * LessEqual(<=). And NullIgnored, OnlyOnceRegistered. * * @param versionno The value of versionno as lessEqual. */ @@ -1252,6 +1222,53 @@ abstract protected ConditionValue getCValueVersionno(); + public SSQFunction scalar_Equal() { + return xcreateSSQFunction("="); + } + + public SSQFunction scalar_GreaterEqual() { + return xcreateSSQFunction(">="); + } + + public SSQFunction scalar_GreaterThan() { + return xcreateSSQFunction(">"); + } + + public SSQFunction scalar_LessEqual() { + return xcreateSSQFunction("<="); + } + + public SSQFunction scalar_LessThan() { + return xcreateSSQFunction("<"); + } + + protected SSQFunction xcreateSSQFunction( + final String operand) { + return new SSQFunction( + new SSQSetupper() { + public void setup(String function, + SubQuery subQuery) { + xscalarSubQuery(function, subQuery, operand); + } + }); + } + + protected void xscalarSubQuery(String function, + SubQuery subQuery, String operand) { + assertObjectNotNull("subQuery", subQuery); + FacilityGroupCB cb = new FacilityGroupCB(); + cb.xsetupForScalarSubQuery(); + subQuery.query(cb); + String subQueryPropertyName = keepScalarSubQuery(cb.query()); // for + // saving + // query + // -value. + registerScalarSubQuery(function, cb.query(), subQueryPropertyName, + operand); + } + + public abstract String keepScalarSubQuery(FacilityGroupCQ subQuery); + // Very Internal (for Suppressing Warn about 'Not Use Import') protected String getConditionBeanClassNameInternally() { return FacilityGroupCB.class.getName(); Modified: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/cq/bs/AbstractBsFacilityScheduleMappingCQ.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/cq/bs/AbstractBsFacilityScheduleMappingCQ.java 2008-12-27 22:14:41 UTC (rev 1629) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/cq/bs/AbstractBsFacilityScheduleMappingCQ.java 2008-12-27 22:18:30 UTC (rev 1630) @@ -20,7 +20,6 @@ * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public abstract class AbstractBsFacilityScheduleMappingCQ extends AbstractConditionQuery { @@ -51,7 +50,8 @@ // ===== /** - * Equal(=). And NullIgnored, OnceRegistered. {PK : ID : NotNull : BIGINT} + * Equal(=). And NullIgnored, OnlyOnceRegistered. {PK : ID : NotNull : + * BIGINT} * * @param id The value of id as equal. */ @@ -60,7 +60,7 @@ } /** - * NotEqual(!=). And NullIgnored, OnceRegistered. + * NotEqual(!=). And NullIgnored, OnlyOnceRegistered. * * @param id The value of id as notEqual. */ @@ -69,7 +69,7 @@ } /** - * GreaterThan(>). And NullIgnored, OnceRegistered. + * GreaterThan(>). And NullIgnored, OnlyOnceRegistered. * * @param id The value of id as greaterThan. */ @@ -78,7 +78,7 @@ } /** - * LessThan(<). And NullIgnored, OnceRegistered. + * LessThan(<). And NullIgnored, OnlyOnceRegistered. * * @param id The value of id as lessThan. */ @@ -87,7 +87,7 @@ } /** - * GreaterEqual(>=). And NullIgnored, OnceRegistered. + * GreaterEqual(>=). And NullIgnored, OnlyOnceRegistered. * * @param id The value of id as greaterEqual. */ @@ -96,7 +96,7 @@ } /** - * LessEqual(<=). And NullIgnored, OnceRegistered. + * LessEqual(<=). And NullIgnored, OnlyOnceRegistered. * * @param id The value of id as lessEqual. */ @@ -125,14 +125,14 @@ } /** - * IsNull(is null). And OnceRegistered. + * IsNull(is null). And OnlyOnceRegistered. */ public void setId_IsNull() { regId(CK_ISN, DUMMY_OBJECT); } /** - * IsNotNull(is not null). And OnceRegistered. + * IsNotNull(is not null). And OnlyOnceRegistered. */ public void setId_IsNotNull() { regId(CK_ISNN, DUMMY_OBJECT); @@ -149,7 +149,7 @@ abstract protected ConditionValue getCValueId(); /** - * Equal(=). And NullIgnored, OnceRegistered. {NotNull : BIGINT : FK to + * Equal(=). And NullIgnored, OnlyOnceRegistered. {NotNull : BIGINT : FK to * EVENT_SCHEDULE} * * @param scheduleId The value of scheduleId as equal. @@ -159,7 +159,7 @@ } /** - * NotEqual(!=). And NullIgnored, OnceRegistered. + * NotEqual(!=). And NullIgnored, OnlyOnceRegistered. * * @param scheduleId The value of scheduleId as notEqual. */ @@ -168,7 +168,7 @@ } /** - * GreaterThan(>). And NullIgnored, OnceRegistered. + * GreaterThan(>). And NullIgnored, OnlyOnceRegistered. * * @param scheduleId The value of scheduleId as greaterThan. */ @@ -177,7 +177,7 @@ } /** - * LessThan(<). And NullIgnored, OnceRegistered. + * LessThan(<). And NullIgnored, OnlyOnceRegistered. * * @param scheduleId The value of scheduleId as lessThan. */ @@ -186,7 +186,7 @@ } /** - * GreaterEqual(>=). And NullIgnored, OnceRegistered. + * GreaterEqual(>=). And NullIgnored, OnlyOnceRegistered. * * @param scheduleId The value of scheduleId as greaterEqual. */ @@ -195,7 +195,7 @@ } /** - * LessEqual(<=). And NullIgnored, OnceRegistered. + * LessEqual(<=). And NullIgnored, OnlyOnceRegistered. * * @param scheduleId The value of scheduleId as lessEqual. */ @@ -223,34 +223,18 @@ regScheduleId(CK_NINS, cTL(scheduleIdList)); } - /** - * @param eventScheduleCBquery Query. - * @deprecated Please use inScopeEventSchedule(subQuery) method. - */ - public void setScheduleId_InScopeSubQuery_EventSchedule( - EventScheduleCQ eventScheduleCBquery) { - String subQueryPropertyName = keepScheduleId_InScopeSubQuery_EventSchedule(eventScheduleCBquery);// for - // saving - // query - // - - // value - // . - registerInScopeSubQuery(eventScheduleCBquery, "SCHEDULE_ID", "ID", - subQueryPropertyName); - } - public void inScopeEventSchedule(SubQuery subQuery) { assertObjectNotNull("subQuery", subQuery); EventScheduleCB cb = new EventScheduleCB(); cb.xsetupForInScopeSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepScheduleId_InScopeSubQuery_EventSchedule(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerInScopeSubQuery(cb.query(), "SCHEDULE_ID", "ID", subQueryPropertyName); } - abstract public String keepScheduleId_InScopeSubQuery_EventSchedule( + public abstract String keepScheduleId_InScopeSubQuery_EventSchedule( EventScheduleCQ subQuery); protected void regScheduleId(ConditionKey key, Object value) { @@ -266,7 +250,7 @@ abstract protected ConditionValue getCValueScheduleId(); /** - * Equal(=). And NullIgnored, OnceRegistered. {NotNull : INTEGER : FK to + * Equal(=). And NullIgnored, OnlyOnceRegistered. {NotNull : INTEGER : FK to * FACILITY} * * @param facilityId The value of facilityId as equal. @@ -276,7 +260,7 @@ } /** - * NotEqual(!=). And NullIgnored, OnceRegistered. + * NotEqual(!=). And NullIgnored, OnlyOnceRegistered. * * @param facilityId The value of facilityId as notEqual. */ @@ -285,7 +269,7 @@ } /** - * GreaterThan(>). And NullIgnored, OnceRegistered. + * GreaterThan(>). And NullIgnored, OnlyOnceRegistered. * * @param facilityId The value of facilityId as greaterThan. */ @@ -294,7 +278,7 @@ } /** - * LessThan(<). And NullIgnored, OnceRegistered. + * LessThan(<). And NullIgnored, OnlyOnceRegistered. * * @param facilityId The value of facilityId as lessThan. */ @@ -303,7 +287,7 @@ } /** - * GreaterEqual(>=). And NullIgnored, OnceRegistered. + * GreaterEqual(>=). And NullIgnored, OnlyOnceRegistered. * * @param facilityId The value of facilityId as greaterEqual. */ @@ -312,7 +296,7 @@ } /** - * LessEqual(<=). And NullIgnored, OnceRegistered. + * LessEqual(<=). And NullIgnored, OnlyOnceRegistered. * * @param facilityId The value of facilityId as lessEqual. */ @@ -340,34 +324,18 @@ regFacilityId(CK_NINS, cTL(facilityIdList)); } - /** - * @param facilityCBquery Query. - * @deprecated Please use inScopeFacility(subQuery) method. - */ - public void setFacilityId_InScopeSubQuery_Facility( - FacilityCQ facilityCBquery) { - String subQueryPropertyName = keepFacilityId_InScopeSubQuery_Facility(facilityCBquery);// for - // saving - // query - // - - // value - // . - registerInScopeSubQuery(facilityCBquery, "FACILITY_ID", "ID", - subQueryPropertyName); - } - public void inScopeFacility(SubQuery subQuery) { assertObjectNotNull("subQuery", subQuery); FacilityCB cb = new FacilityCB(); cb.xsetupForInScopeSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepFacilityId_InScopeSubQuery_Facility(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerInScopeSubQuery(cb.query(), "FACILITY_ID", "ID", subQueryPropertyName); } - abstract public String keepFacilityId_InScopeSubQuery_Facility( + public abstract String keepFacilityId_InScopeSubQuery_Facility( FacilityCQ subQuery); protected void regFacilityId(ConditionKey key, Object value) { @@ -382,6 +350,53 @@ abstract protected ConditionValue getCValueFacilityId(); + public SSQFunction scalar_Equal() { + return xcreateSSQFunction("="); + } + + public SSQFunction scalar_GreaterEqual() { + return xcreateSSQFunction(">="); + } + + public SSQFunction scalar_GreaterThan() { + return xcreateSSQFunction(">"); + } + + public SSQFunction scalar_LessEqual() { + return xcreateSSQFunction("<="); + } + + public SSQFunction scalar_LessThan() { + return xcreateSSQFunction("<"); + } + + protected SSQFunction xcreateSSQFunction( + final String operand) { + return new SSQFunction( + new SSQSetupper() { + public void setup(String function, + SubQuery subQuery) { + xscalarSubQuery(function, subQuery, operand); + } + }); + } + + protected void xscalarSubQuery(String function, + SubQuery subQuery, String operand) { + assertObjectNotNull("subQuery", subQuery); + FacilityScheduleMappingCB cb = new FacilityScheduleMappingCB(); + cb.xsetupForScalarSubQuery(); + subQuery.query(cb); + String subQueryPropertyName = keepScalarSubQuery(cb.query()); // for + // saving + // query + // -value. + registerScalarSubQuery(function, cb.query(), subQueryPropertyName, + operand); + } + + public abstract String keepScalarSubQuery(FacilityScheduleMappingCQ subQuery); + // Very Internal (for Suppressing Warn about 'Not Use Import') protected String getConditionBeanClassNameInternally() { return FacilityScheduleMappingCB.class.getName(); Modified: 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 2008-12-27 22:14:41 UTC (rev 1629) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/cq/bs/AbstractBsGroupInfoCQ.java 2008-12-27 22:18:30 UTC (rev 1630) @@ -20,7 +20,6 @@ * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public abstract class AbstractBsGroupInfoCQ extends AbstractConditionQuery { //========================================================================== @@ -50,7 +49,7 @@ // ===== /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {PK : NotNull : + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {PK : NotNull : * VARCHAR(255)} * * @param groupId The value of groupId as equal. @@ -60,7 +59,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param groupId The value of groupId as notEqual. */ @@ -69,7 +68,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param groupId The value of groupId as greaterThan. */ @@ -78,7 +77,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param groupId The value of groupId as lessThan. */ @@ -87,7 +86,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param groupId The value of groupId as greaterEqual. */ @@ -96,7 +95,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param groupId The value of groupId as lessEqual. */ @@ -105,7 +104,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param groupId The value of groupId as prefixSearch. */ @@ -114,20 +113,6 @@ } /** - * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, - * SeveralRegistered. - * - * @param groupId The value of groupId as likeSearch. - * @param likeSearchOption The option of like-search. (NotNull) - */ - public void setGroupId_LikeSearch( - String groupId, - jp.sf.pal.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. * @@ -138,43 +123,41 @@ } /** - * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * - * @param groupId The collection of groupId as inScope. - * @param inScopeOption The option of in-scope. (NotNull) + * @param groupIdList The collection of groupId as notInScope. */ - public void setGroupId_InScope( - String groupId, - jp.sf.pal.scheduler.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(groupId), getCValueGroupId(), - "GROUP_ID", "GroupId", "groupId", inScopeOption); + public void setGroupId_NotInScope(Collection groupIdList) { + regGroupId(CK_NINS, cTL(groupIdList)); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param groupIdList The collection of groupId as notInScope. + * @param groupId The value of groupId as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) */ - public void setGroupId_NotInScope(Collection groupIdList) { - regGroupId(CK_NINS, cTL(groupIdList)); + public void setGroupId_LikeSearch( + String groupId, + jp.sf.pal.scheduler.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(groupId), getCValueGroupId(), "GROUP_ID", "GroupId", + "groupId", likeSearchOption); } /** - * @param groupMappingCBquery Query. - * @deprecated Please use inScopeGroupMappingList(subQuery) method. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param groupId The value of groupId as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setGroupId_InScopeSubQuery_GroupMappingList( - GroupMappingCQ groupMappingCBquery) { - String subQueryPropertyName = keepGroupId_InScopeSubQuery_GroupMappingList(groupMappingCBquery);// for - // saving - // query - // - - // value - // . - registerInScopeSubQuery(groupMappingCBquery, "GROUP_ID", "GROUP_ID", - subQueryPropertyName); + public void setGroupId_NotLikeSearch( + String groupId, + jp.sf.pal.scheduler.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(groupId), getCValueGroupId(), "GROUP_ID", + "GroupId", "groupId", likeSearchOption); } public void inScopeGroupMappingList(SubQuery subQuery) { @@ -183,42 +166,26 @@ cb.xsetupForInScopeSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepGroupId_InScopeSubQuery_GroupMappingList(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerInScopeSubQuery(cb.query(), "GROUP_ID", "GROUP_ID", subQueryPropertyName); } - abstract public String keepGroupId_InScopeSubQuery_GroupMappingList( + public abstract String keepGroupId_InScopeSubQuery_GroupMappingList( GroupMappingCQ subQuery); - /** - * @param userInfoCBquery Query. - * @deprecated Please use inScopeUserInfoList(subQuery) method. - */ - public void setGroupId_InScopeSubQuery_UserInfoList( - UserInfoCQ userInfoCBquery) { - String subQueryPropertyName = keepGroupId_InScopeSubQuery_UserInfoList(userInfoCBquery);// for - // saving - // query - // - - // value - // . - registerInScopeSubQuery(userInfoCBquery, "GROUP_ID", "GROUP_ID", - subQueryPropertyName); - } - public void inScopeUserInfoList(SubQuery subQuery) { assertObjectNotNull("subQuery", subQuery); UserInfoCB cb = new UserInfoCB(); cb.xsetupForInScopeSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepGroupId_InScopeSubQuery_UserInfoList(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerInScopeSubQuery(cb.query(), "GROUP_ID", "GROUP_ID", subQueryPropertyName); } - abstract public String keepGroupId_InScopeSubQuery_UserInfoList( + public abstract String keepGroupId_InScopeSubQuery_UserInfoList( UserInfoCQ subQuery); public void notInScopeGroupMappingList(SubQuery subQuery) { @@ -227,12 +194,12 @@ cb.xsetupForInScopeSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepGroupId_NotInScopeSubQuery_GroupMappingList(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerNotInScopeSubQuery(cb.query(), "GROUP_ID", "GROUP_ID", subQueryPropertyName); } - abstract public String keepGroupId_NotInScopeSubQuery_GroupMappingList( + public abstract String keepGroupId_NotInScopeSubQuery_GroupMappingList( GroupMappingCQ subQuery); public void notInScopeUserInfoList(SubQuery subQuery) { @@ -241,31 +208,15 @@ cb.xsetupForInScopeSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepGroupId_NotInScopeSubQuery_UserInfoList(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerNotInScopeSubQuery(cb.query(), "GROUP_ID", "GROUP_ID", subQueryPropertyName); } - abstract public String keepGroupId_NotInScopeSubQuery_UserInfoList( + public abstract String keepGroupId_NotInScopeSubQuery_UserInfoList( UserInfoCQ subQuery); /** - * @param groupMappingCBquery Query. - * @deprecated Please use existsGroupMappingList(subQuery) method. - */ - public void setGroupId_ExistsSubQuery_GroupMappingList( - GroupMappingCQ groupMappingCBquery) { - String subQueryPropertyName = keepGroupId_ExistsSubQuery_GroupMappingList(groupMappingCBquery);// for - // saving - // query - // - - // value - // . - registerExistsSubQuery(groupMappingCBquery, "GROUP_ID", "GROUP_ID", - subQueryPropertyName); - } - - /** * Set up 'exists' sub-query. {exists (select GROUP_ID from GROUP_MAPPING * where ...)} * @@ -278,31 +229,15 @@ cb.xsetupForExistsSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepGroupId_ExistsSubQuery_GroupMappingList(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerExistsSubQuery(cb.query(), "GROUP_ID", "GROUP_ID", subQueryPropertyName); } - abstract public String keepGroupId_ExistsSubQuery_GroupMappingList( + public abstract String keepGroupId_ExistsSubQuery_GroupMappingList( GroupMappingCQ subQuery); /** - * @param userInfoCBquery Query. - * @deprecated Please use existsUserInfoList(subQuery) method. - */ - public void setGroupId_ExistsSubQuery_UserInfoList( - UserInfoCQ userInfoCBquery) { - String subQueryPropertyName = keepGroupId_ExistsSubQuery_UserInfoList(userInfoCBquery);// for - // saving - // query - // - - // value - // . - registerExistsSubQuery(userInfoCBquery, "GROUP_ID", "GROUP_ID", - subQueryPropertyName); - } - - /** * Set up 'exists' sub-query. {exists (select GROUP_ID from USER_INFO where * ...)} * @@ -315,12 +250,12 @@ cb.xsetupForExistsSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepGroupId_ExistsSubQuery_UserInfoList(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerExistsSubQuery(cb.query(), "GROUP_ID", "GROUP_ID", subQueryPropertyName); } - abstract public String keepGroupId_ExistsSubQuery_UserInfoList( + public abstract String keepGroupId_ExistsSubQuery_UserInfoList( UserInfoCQ subQuery); /** @@ -337,12 +272,12 @@ cb.xsetupForExistsSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepGroupId_NotExistsSubQuery_GroupMappingList(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerNotExistsSubQuery(cb.query(), "GROUP_ID", "GROUP_ID", subQueryPropertyName); } - abstract public String keepGroupId_NotExistsSubQuery_GroupMappingList( + public abstract String keepGroupId_NotExistsSubQuery_GroupMappingList( GroupMappingCQ subQuery); /** @@ -358,53 +293,53 @@ cb.xsetupForExistsSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepGroupId_NotExistsSubQuery_UserInfoList(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerNotExistsSubQuery(cb.query(), "GROUP_ID", "GROUP_ID", subQueryPropertyName); } - abstract public String keepGroupId_NotExistsSubQuery_UserInfoList( + public abstract String keepGroupId_NotExistsSubQuery_UserInfoList( UserInfoCQ subQuery); public void xderiveGroupMappingList(String function, SubQuery subQuery, String aliasName) { assertObjectNotNull("subQuery", subQuery); GroupMappingCB cb = new GroupMappingCB(); - cb.xsetupForDeriveReferrer(); + cb.xsetupForDerivedReferrer(); subQuery.query(cb); - String subQueryPropertyName = keepGroupId_DeriveSubQuery_GroupMappingList(cb - .query());// for saving query-value. - registerDeriveSubQuery(function, cb.query(), "GROUP_ID", "GROUP_ID", - subQueryPropertyName, aliasName); + String subQueryPropertyName = keepGroupId_DerivedReferrer_GroupMappingList(cb + .query()); // for saving query-value. + registerDerivedReferrerSubQuery(function, cb.query(), "GROUP_ID", + "GROUP_ID", subQueryPropertyName, aliasName); } - abstract public String keepGroupId_DeriveSubQuery_GroupMappingList( + public abstract String keepGroupId_DerivedReferrer_GroupMappingList( GroupMappingCQ subQuery); public void xderiveUserInfoList(String function, SubQuery subQuery, String aliasName) { assertObjectNotNull("subQuery", subQuery); UserInfoCB cb = new UserInfoCB(); - cb.xsetupForDeriveReferrer(); + cb.xsetupForDerivedReferrer(); subQuery.query(cb); - String subQueryPropertyName = keepGroupId_DeriveSubQuery_UserInfoList(cb - .query());// for saving query-value. - registerDeriveSubQuery(function, cb.query(), "GROUP_ID", "GROUP_ID", - subQueryPropertyName, aliasName); + String subQueryPropertyName = keepGroupId_DerivedReferrer_UserInfoList(cb + .query()); // for saving query-value. + registerDerivedReferrerSubQuery(function, cb.query(), "GROUP_ID", + "GROUP_ID", subQueryPropertyName, aliasName); } - abstract public String keepGroupId_DeriveSubQuery_UserInfoList( + public abstract String keepGroupId_DerivedReferrer_UserInfoList( UserInfoCQ subQuery); /** - * IsNull(is null). And OnceRegistered. + * IsNull(is null). And OnlyOnceRegistered. */ public void setGroupId_IsNull() { regGroupId(CK_ISN, DUMMY_OBJECT); } /** - * IsNotNull(is not null). And OnceRegistered. + * IsNotNull(is not null). And OnlyOnceRegistered. */ public void setGroupId_IsNotNull() { regGroupId(CK_ISNN, DUMMY_OBJECT); @@ -423,7 +358,7 @@ abstract protected ConditionValue getCValueGroupId(); /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {VARCHAR(100)} + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {VARCHAR(100)} * * @param name The value of name as equal. */ @@ -432,7 +367,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param name The value of name as notEqual. */ @@ -441,7 +376,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param name The value of name as greaterThan. */ @@ -450,7 +385,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param name The value of name as lessThan. */ @@ -459,7 +394,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param name The value of name as greaterEqual. */ @@ -468,7 +403,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param name The value of name as lessEqual. */ @@ -477,7 +412,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param name The value of name as prefixSearch. */ @@ -486,20 +421,6 @@ } /** - * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, - * SeveralRegistered. - * - * @param name The value of name as likeSearch. - * @param likeSearchOption The option of like-search. (NotNull) - */ - public void setName_LikeSearch( - String name, - jp.sf.pal.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. * @@ -510,38 +431,52 @@ } /** - * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * - * @param name The collection of name as inScope. - * @param inScopeOption The option of in-scope. (NotNull) + * @param nameList The collection of name as notInScope. */ - public void setName_InScope( + public void setName_NotInScope(Collection nameList) { + regName(CK_NINS, cTL(nameList)); + } + + /** + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param name The value of name as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) + */ + public void setName_LikeSearch( String name, - jp.sf.pal.scheduler.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(name), getCValueName(), "NAME", - "Name", "name", inScopeOption); + jp.sf.pal.scheduler.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(name), getCValueName(), "NAME", "Name", "name", + likeSearchOption); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param nameList The collection of name as notInScope. + * @param name The value of name as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setName_NotInScope(Collection nameList) { - regName(CK_NINS, cTL(nameList)); + public void setName_NotLikeSearch( + String name, + jp.sf.pal.scheduler.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(name), getCValueName(), "NAME", "Name", "name", + likeSearchOption); } /** - * IsNull(is null). And OnceRegistered. + * IsNull(is null). And OnlyOnceRegistered. */ public void setName_IsNull() { regName(CK_ISN, DUMMY_OBJECT); } /** - * IsNotNull(is not null). And OnceRegistered. + * IsNotNull(is not null). And OnlyOnceRegistered. */ public void setName_IsNotNull() { regName(CK_ISNN, DUMMY_OBJECT); @@ -558,7 +493,7 @@ abstract protected ConditionValue getCValueName(); /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {VARCHAR(255)} + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {VARCHAR(255)} * * @param description The value of description as equal. */ @@ -567,7 +502,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param description The value of description as notEqual. */ @@ -576,7 +511,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param description The value of description as greaterThan. */ @@ -585,7 +520,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param description The value of description as lessThan. */ @@ -594,7 +529,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param description The value of description as greaterEqual. */ @@ -603,7 +538,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param description The value of description as lessEqual. */ @@ -612,7 +547,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param description The value of description as prefixSearch. */ @@ -621,21 +556,6 @@ } /** - * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, - * SeveralRegistered. - * - * @param description The value of description as likeSearch. - * @param likeSearchOption The option of like-search. (NotNull) - */ - public void setDescription_LikeSearch( - String description, - jp.sf.pal.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. * @@ -646,38 +566,52 @@ } /** - * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * - * @param description The collection of description as inScope. - * @param inScopeOption The option of in-scope. (NotNull) + * @param descriptionList The collection of description as notInScope. */ - public void setDescription_InScope( + public void setDescription_NotInScope(Collection descriptionList) { + regDescription(CK_NINS, cTL(descriptionList)); + } + + /** + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param description The value of description as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) + */ + public void setDescription_LikeSearch( String description, - jp.sf.pal.scheduler.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(description), getCValueDescription(), - "DESCRIPTION", "Description", "description", inScopeOption); + jp.sf.pal.scheduler.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(description), getCValueDescription(), "DESCRIPTION", + "Description", "description", likeSearchOption); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param descriptionList The collection of description as notInScope. + * @param description The value of description as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setDescription_NotInScope(Collection descriptionList) { - regDescription(CK_NINS, cTL(descriptionList)); + public void setDescription_NotLikeSearch( + String description, + jp.sf.pal.scheduler.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(description), getCValueDescription(), + "DESCRIPTION", "Description", "description", likeSearchOption); } /** - * IsNull(is null). And OnceRegistered. + * IsNull(is null). And OnlyOnceRegistered. */ public void setDescription_IsNull() { regDescription(CK_ISN, DUMMY_OBJECT); } /** - * IsNotNull(is not null). And OnceRegistered. + * IsNotNull(is not null). And OnlyOnceRegistered. */ public void setDescription_IsNotNull() { regDescription(CK_ISNN, DUMMY_OBJECT); @@ -696,7 +630,7 @@ abstract protected ConditionValue getCValueDescription(); /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {VARCHAR(255)} + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {VARCHAR(255)} * * @param email The value of email as equal. */ @@ -705,7 +639,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param email The value of email as notEqual. */ @@ -714,7 +648,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param email The value of email as greaterThan. */ @@ -723,7 +657,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param email The value of email as lessThan. */ @@ -732,7 +666,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param email The value of email as greaterEqual. */ @@ -741,7 +675,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param email The value of email as lessEqual. */ @@ -750,7 +684,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param email The value of email as prefixSearch. */ @@ -759,20 +693,6 @@ } /** - * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, - * SeveralRegistered. - * - * @param email The value of email as likeSearch. - * @param likeSearchOption The option of like-search. (NotNull) - */ - public void setEmail_LikeSearch( - String email, - jp.sf.pal.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. * @@ -783,38 +703,52 @@ } /** - * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * - * @param email The collection of email as inScope. - * @param inScopeOption The option of in-scope. (NotNull) + * @param emailList The collection of email as notInScope. */ - public void setEmail_InScope( + public void setEmail_NotInScope(Collection emailList) { + regEmail(CK_NINS, cTL(emailList)); + } + + /** + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param email The value of email as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) + */ + public void setEmail_LikeSearch( String email, - jp.sf.pal.scheduler.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(email), getCValueEmail(), "EMAIL", - "Email", "email", inScopeOption); + jp.sf.pal.scheduler.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(email), getCValueEmail(), "EMAIL", "Email", "email", + likeSearchOption); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param emailList The collection of email as notInScope. + * @param email The value of email as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setEmail_NotInScope(Collection emailList) { - regEmail(CK_NINS, cTL(emailList)); + public void setEmail_NotLikeSearch( + String email, + jp.sf.pal.scheduler.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(email), getCValueEmail(), "EMAIL", "Email", + "email", likeSearchOption); } /** - * IsNull(is null). And OnceRegistered. + * IsNull(is null). And OnlyOnceRegistered. */ public void setEmail_IsNull() { regEmail(CK_ISN, DUMMY_OBJECT); } /** - * IsNotNull(is not null). And OnceRegistered. + * IsNotNull(is not null). And OnlyOnceRegistered. */ public void setEmail_IsNotNull() { regEmail(CK_ISNN, DUMMY_OBJECT); @@ -832,7 +766,7 @@ abstract protected ConditionValue getCValueEmail(); /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {VARCHAR(255)} + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {VARCHAR(255)} * * @param url The value of url as equal. */ @@ -841,7 +775,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param url The value of url as notEqual. */ @@ -850,7 +784,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param url The value of url as greaterThan. */ @@ -859,7 +793,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param url The value of url as lessThan. */ @@ -868,7 +802,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param url The value of url as greaterEqual. */ @@ -877,7 +811,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param url The value of url as lessEqual. */ @@ -886,7 +820,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param url The value of url as prefixSearch. */ @@ -895,20 +829,6 @@ } /** - * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, - * SeveralRegistered. - * - * @param url The value of url as likeSearch. - * @param likeSearchOption The option of like-search. (NotNull) - */ - public void setUrl_LikeSearch( - String url, - jp.sf.pal.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. * @@ -919,38 +839,52 @@ } /** - * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * - * @param url The collection of url as inScope. - * @param inScopeOption The option of in-scope. (NotNull) + * @param urlList The collection of url as notInScope. */ - public void setUrl_InScope( + public void setUrl_NotInScope(Collection urlList) { + regUrl(CK_NINS, cTL(urlList)); + } + + /** + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param url The value of url as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) + */ + public void setUrl_LikeSearch( String url, - jp.sf.pal.scheduler.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(url), getCValueUrl(), "URL", "Url", - "url", inScopeOption); + jp.sf.pal.scheduler.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(url), getCValueUrl(), "URL", "Url", "url", + likeSearchOption); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param urlList The collection of url as notInScope. + * @param url The value of url as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setUrl_NotInScope(Collection urlList) { - regUrl(CK_NINS, cTL(urlList)); + public void setUrl_NotLikeSearch( + String url, + jp.sf.pal.scheduler.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(url), getCValueUrl(), "URL", "Url", "url", + likeSearchOption); } /** - * IsNull(is null). And OnceRegistered. + * IsNull(is null). And OnlyOnceRegistered. */ public void setUrl_IsNull() { regUrl(CK_ISN, DUMMY_OBJECT); } /** - * IsNotNull(is not null). And OnceRegistered. + * IsNotNull(is not null). And OnlyOnceRegistered. */ public void setUrl_IsNotNull() { regUrl(CK_ISNN, DUMMY_OBJECT); @@ -967,7 +901,7 @@ abstract protected ConditionValue getCValueUrl(); /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {VARCHAR(40)} + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {VARCHAR(40)} * * @param telephone The value of telephone as equal. */ @@ -976,7 +910,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param telephone The value of telephone as notEqual. */ @@ -985,7 +919,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param telephone The value of telephone as greaterThan. */ @@ -994,7 +928,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param telephone The value of telephone as lessThan. */ @@ -1003,7 +937,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param telephone The value of telephone as greaterEqual. */ @@ -1012,7 +946,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param telephone The value of telephone as lessEqual. */ @@ -1021,7 +955,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param telephone The value of telephone as prefixSearch. */ @@ -1030,20 +964,6 @@ } /** - * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, - * SeveralRegistered. - * - * @param telephone The value of telephone as likeSearch. - * @param likeSearchOption The option of like-search. (NotNull) - */ - public void setTelephone_LikeSearch( - String telephone, - jp.sf.pal.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. * @@ -1054,38 +974,52 @@ } /** - * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * - * @param telephone The collection of telephone as inScope. - * @param inScopeOption The option of in-scope. (NotNull) + * @param telephoneList The collection of telephone as notInScope. */ - public void setTelephone_InScope( + public void setTelephone_NotInScope(Collection telephoneList) { + regTelephone(CK_NINS, cTL(telephoneList)); + } + + /** + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param telephone The value of telephone as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) + */ + public void setTelephone_LikeSearch( String telephone, - jp.sf.pal.scheduler.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(telephone), getCValueTelephone(), - "TELEPHONE", "Telephone", "telephone", inScopeOption); + jp.sf.pal.scheduler.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(telephone), getCValueTelephone(), "TELEPHONE", + "Telephone", "telephone", likeSearchOption); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param telephoneList The collection of telephone as notInScope. + * @param telephone The value of telephone as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setTelephone_NotInScope(Collection telephoneList) { - regTelephone(CK_NINS, cTL(telephoneList)); + public void setTelephone_NotLikeSearch( + String telephone, + jp.sf.pal.scheduler.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(telephone), getCValueTelephone(), "TELEPHONE", + "Telephone", "telephone", likeSearchOption); } /** - * IsNull(is null). And OnceRegistered. + * IsNull(is null). And OnlyOnceRegistered. */ public void setTelephone_IsNull() { regTelephone(CK_ISN, DUMMY_OBJECT); } /** - * IsNotNull(is not null). And OnceRegistered. + * IsNotNull(is not null). And OnlyOnceRegistered. */ public void setTelephone_IsNotNull() { regTelephone(CK_ISNN, DUMMY_OBJECT); @@ -1104,7 +1038,7 @@ abstract protected ConditionValue getCValueTelephone(); /** - * Equal(=). And NullIgnored, OnceRegistered. {NotNull : TIMESTAMP} + * Equal(=). And NullIgnored, OnlyOnceRegistered. {NotNull : TIMESTAMP} * * @param createdTime The value of createdTime as equal. */ @@ -1113,7 +1047,7 @@ } /** - * NotEqual(!=). And NullIgnored, OnceRegistered. + * NotEqual(!=). And NullIgnored, OnlyOnceRegistered. * * @param createdTime The value of createdTime as notEqual. */ @@ -1122,7 +1056,7 @@ } /** - * GreaterThan(>). And NullIgnored, OnceRegistered. + * GreaterThan(>). And NullIgnored, OnlyOnceRegistered. * * @param createdTime The value of createdTime as greaterThan. */ @@ -1131,7 +1065,7 @@ } /** - * LessThan(>). And NullIgnored, OnceRegistered. + * LessThan(>). And NullIgnored, OnlyOnceRegistered. * * @param createdTime The value of createdTime as lessThan. */ @@ -1140,7 +1074,7 @@ } /** - * GreaterEqual(>). And NullIgnored, OnceRegistered. + * GreaterEqual(>). And NullIgnored, OnlyOnceRegistered. * * @param createdTime The value of createdTime as greaterEqual. */ @@ -1149,7 +1083,7 @@ } /** - * LessEqual(>). And NullIgnored, OnceRegistered. + * LessEqual(>). And NullIgnored, OnlyOnceRegistered. * * @param createdTime The value of createdTime as lessEqual. */ @@ -1159,7 +1093,7 @@ /** * FromTo($fromDate <= COLUMN_NAME <= $toDate). And NullIgnored, - * OnceRegistered. {NotNull : TIMESTAMP} + * OnlyOnceRegistered. {NotNull : TIMESTAMP} * * @param fromDate The from-date of createdTime. (Nullable) * @param toDate The to-date of createdTime. (Nullable) @@ -1177,7 +1111,7 @@ /** * FromTo($fromDate <= COLUMN_NAME < $toDate + 1). And NullIgnored, - * OnceRegistered. {NotNull : TIMESTAMP} + * OnlyOnceRegistered. {NotNull : TIMESTAMP} * * @param fromDate The from-date of createdTime. (Nullable) * @param toDate The to-date of createdTime. (Nullable) @@ -1203,7 +1137,7 @@ abstract protected ConditionValue getCValueCreatedTime(); /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {NotNull : + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {NotNull : * VARCHAR(255)} * * @param createdBy The value of createdBy as equal. @@ -1213,7 +1147,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param createdBy The value of createdBy as notEqual. */ @@ -1222,7 +1156,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param createdBy The value of createdBy as greaterThan. */ @@ -1231,7 +1165,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param createdBy The value of createdBy as lessThan. */ @@ -1240,7 +1174,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param createdBy The value of createdBy as greaterEqual. */ @@ -1249,7 +1183,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param createdBy The value of createdBy as lessEqual. */ @@ -1258,7 +1192,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param createdBy The value of createdBy as prefixSearch. */ @@ -1267,20 +1201,6 @@ } /** - * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, - * SeveralRegistered. - * - * @param createdBy The value of createdBy as likeSearch. - * @param likeSearchOption The option of like-search. (NotNull) - */ - public void setCreatedBy_LikeSearch( - String createdBy, - jp.sf.pal.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. * @@ -1291,27 +1211,41 @@ } /** - * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * - * @param createdBy The collection of createdBy as inScope. - * @param inScopeOption The option of in-scope. (NotNull) + * @param createdByList The collection of createdBy as notInScope. */ - public void setCreatedBy_InScope( + public void setCreatedBy_NotInScope(Collection createdByList) { + regCreatedBy(CK_NINS, cTL(createdByList)); + } + + /** + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param createdBy The value of createdBy as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) + */ + public void setCreatedBy_LikeSearch( String createdBy, - jp.sf.pal.scheduler.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(createdBy), getCValueCreatedBy(), - "CREATED_BY", "CreatedBy", "createdBy", inScopeOption); + jp.sf.pal.scheduler.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(createdBy), getCValueCreatedBy(), "CREATED_BY", + "CreatedBy", "createdBy", likeSearchOption); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param createdByList The collection of createdBy as notInScope. + * @param createdBy The value of createdBy as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setCreatedBy_NotInScope(Collection createdByList) { - regCreatedBy(CK_NINS, cTL(createdByList)); + public void setCreatedBy_NotLikeSearch( + String createdBy, + jp.sf.pal.scheduler.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(createdBy), getCValueCreatedBy(), "CREATED_BY", + "CreatedBy", "createdBy", likeSearchOption); } protected void regCreatedBy(ConditionKey key, Object value) { @@ -1327,7 +1261,7 @@ abstract protected ConditionValue getCValueCreatedBy(); /** - * Equal(=). And NullIgnored, OnceRegistered. {NotNull : TIMESTAMP} + * Equal(=). And NullIgnored, OnlyOnceRegistered. {NotNull : TIMESTAMP} * * @param updatedTime The value of updatedTime as equal. */ @@ -1336,7 +1270,7 @@ } /** - * NotEqual(!=). And NullIgnored, OnceRegistered. + * NotEqual(!=). And NullIgnored, OnlyOnceRegistered. * * @param updatedTime The value of updatedTime as notEqual. */ @@ -1345,7 +1279,7 @@ } /** - * GreaterThan(>). And NullIgnored, OnceRegistered. + * GreaterThan(>). And NullIgnored, OnlyOnceRegistered. * * @param updatedTime The value of updatedTime as greaterThan. */ @@ -1354,7 +1288,7 @@ } /** - * LessThan(>). And NullIgnored, OnceRegistered. + * LessThan(>). And NullIgnored, OnlyOnceRegistered. * * @param updatedTime The value of updatedTime as lessThan. */ @@ -1363,7 +1297,7 @@ } /** - * GreaterEqual(>). And NullIgnored, OnceRegistered. + * GreaterEqual(>). And NullIgnored, OnlyOnceRegistered. * * @param updatedTime The value of updatedTime as greaterEqual. */ @@ -1372,7 +1306,7 @@ } /** - * LessEqual(>). And NullIgnored, OnceRegistered. + * LessEqual(>). And NullIgnored, OnlyOnceRegistered. * * @param updatedTime The value of updatedTime as lessEqual. */ @@ -1382,7 +1316,7 @@ /** * FromTo($fromDate <= COLUMN_NAME <= $toDate). And NullIgnored, - * OnceRegistered. {NotNull : TIMESTAMP} + * OnlyOnceRegistered. {NotNull : TIMESTAMP} * * @param fromDate The from-date of updatedTime. (Nullable) * @param toDate The to-date of updatedTime. (Nullable) @@ -1400,7 +1334,7 @@ /** * FromTo($fromDate <= COLUMN_NAME < $toDate + 1). And NullIgnored, - * OnceRegistered. {NotNull : TIMESTAMP} + * OnlyOnceRegistered. {NotNull : TIMESTAMP} * * @param fromDate The from-date of updatedTime. (Nullable) * @param toDate The to-date of updatedTime. (Nullable) @@ -1426,7 +1360,7 @@ abstract protected ConditionValue getCValueUpdatedTime(); /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {NotNull : + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {NotNull : * VARCHAR(255)} * * @param updatedBy The value of updatedBy as equal. @@ -1436,7 +1370,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param updatedBy The value of updatedBy as notEqual. */ @@ -1445,7 +1379,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param updatedBy The value of updatedBy as greaterThan. */ @@ -1454,7 +1388,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param updatedBy The value of updatedBy as lessThan. */ @@ -1463,7 +1397,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param updatedBy The value of updatedBy as greaterEqual. */ @@ -1472,7 +1406,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param updatedBy The value of updatedBy as lessEqual. */ @@ -1481,7 +1415,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param updatedBy The value of updatedBy as prefixSearch. */ @@ -1490,20 +1424,6 @@ } /** - * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, - * SeveralRegistered. - * - * @param updatedBy The value of updatedBy as likeSearch. - * @param likeSearchOption The option of like-search. (NotNull) - */ - public void setUpdatedBy_LikeSearch( - String updatedBy, - jp.sf.pal.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. * @@ -1514,27 +1434,41 @@ } /** - * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * - * @param updatedBy The collection of updatedBy as inScope. - * @param inScopeOption The option of in-scope. (NotNull) + * @param updatedByList The collection of updatedBy as notInScope. */ - public void setUpdatedBy_InScope( + public void setUpdatedBy_NotInScope(Collection updatedByList) { + regUpdatedBy(CK_NINS, cTL(updatedByList)); + } + + /** + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param updatedBy The value of updatedBy as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) + */ + public void setUpdatedBy_LikeSearch( String updatedBy, - jp.sf.pal.scheduler.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(updatedBy), getCValueUpdatedBy(), - "UPDATED_BY", "UpdatedBy", "updatedBy", inScopeOption); + jp.sf.pal.scheduler.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(updatedBy), getCValueUpdatedBy(), "UPDATED_BY", + "UpdatedBy", "updatedBy", likeSearchOption); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param updatedByList The collection of updatedBy as notInScope. + * @param updatedBy The value of updatedBy as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setUpdatedBy_NotInScope(Collection updatedByList) { - regUpdatedBy(CK_NINS, cTL(updatedByList)); + public void setUpdatedBy_NotLikeSearch( + String updatedBy, + jp.sf.pal.scheduler.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(updatedBy), getCValueUpdatedBy(), "UPDATED_BY", + "UpdatedBy", "updatedBy", likeSearchOption); } protected void regUpdatedBy(ConditionKey key, Object value) { @@ -1550,7 +1484,7 @@ abstract protected ConditionValue getCValueUpdatedBy(); /** - * Equal(=). And NullIgnored, OnceRegistered. {TIMESTAMP} + * Equal(=). And NullIgnored, OnlyOnceRegistered. {TIMESTAMP} * * @param deletedTime The value of deletedTime as equal. */ @@ -1559,7 +1493,7 @@ } /** - * NotEqual(!=). And NullIgnored, OnceRegistered. + * NotEqual(!=). And NullIgnored, OnlyOnceRegistered. * * @param deletedTime The value of deletedTime as notEqual. */ @@ -1568,7 +1502,7 @@ } /** - * GreaterThan(>). And NullIgnored, OnceRegistered. + * GreaterThan(>). And NullIgnored, OnlyOnceRegistered. * * @param deletedTime The value of deletedTime as greaterThan. */ @@ -1577,7 +1511,7 @@ } /** - * LessThan(>). And NullIgnored, OnceRegistered. + * LessThan(>). And NullIgnored, OnlyOnceRegistered. * * @param deletedTime The value of deletedTime as lessThan. */ @@ -1586,7 +1520,7 @@ } /** - * GreaterEqual(>). And NullIgnored, OnceRegistered. + * GreaterEqual(>). And NullIgnored, OnlyOnceRegistered. * * @param deletedTime The value of deletedTime as greaterEqual. */ @@ -1595,7 +1529,7 @@ } /** - * LessEqual(>). And NullIgnored, OnceRegistered. + * LessEqual(>). And NullIgnored, OnlyOnceRegistered. * * @param deletedTime The value of deletedTime as lessEqual. */ @@ -1605,7 +1539,7 @@ /** * FromTo($fromDate <= COLUMN_NAME <= $toDate). And NullIgnored, - * OnceRegistered. {TIMESTAMP} + * OnlyOnceRegistered. {TIMESTAMP} * * @param fromDate The from-date of deletedTime. (Nullable) * @param toDate The to-date of deletedTime. (Nullable) @@ -1623,7 +1557,7 @@ /** * FromTo($fromDate <= COLUMN_NAME < $toDate + 1). And NullIgnored, - * OnceRegistered. {TIMESTAMP} + * OnlyOnceRegistered. {TIMESTAMP} * * @param fromDate The from-date of deletedTime. (Nullable) * @param toDate The to-date of deletedTime. (Nullable) @@ -1637,14 +1571,14 @@ } /** - * IsNull(is null). And OnceRegistered. + * IsNull(is null). And OnlyOnceRegistered. */ public void setDeletedTime_IsNull() { regDeletedTime(CK_ISN, DUMMY_OBJECT); } /** - * IsNotNull(is not null). And OnceRegistered. + * IsNotNull(is not null). And OnlyOnceRegistered. */ public void setDeletedTime_IsNotNull() { regDeletedTime(CK_ISNN, DUMMY_OBJECT); @@ -1663,7 +1597,7 @@ abstract protected ConditionValue getCValueDeletedTime(); /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {VARCHAR(255)} + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {VARCHAR(255)} * * @param deletedBy The value of deletedBy as equal. */ @@ -1672,7 +1606,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param deletedBy The value of deletedBy as notEqual. */ @@ -1681,7 +1615,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param deletedBy The value of deletedBy as greaterThan. */ @@ -1690,7 +1624,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param deletedBy The value of deletedBy as lessThan. */ @@ -1699,7 +1633,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param deletedBy The value of deletedBy as greaterEqual. */ @@ -1708,7 +1642,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param deletedBy The value of deletedBy as lessEqual. */ @@ -1717,7 +1651,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param deletedBy The value of deletedBy as prefixSearch. */ @@ -1726,20 +1660,6 @@ } /** - * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, - * SeveralRegistered. - * - * @param deletedBy The value of deletedBy as likeSearch. - * @param likeSearchOption The option of like-search. (NotNull) - */ - public void setDeletedBy_LikeSearch( - String deletedBy, - jp.sf.pal.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. * @@ -1750,38 +1670,52 @@ } /** - * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * - * @param deletedBy The collection of deletedBy as inScope. - * @param inScopeOption The option of in-scope. (NotNull) + * @param deletedByList The collection of deletedBy as notInScope. */ - public void setDeletedBy_InScope( + public void setDeletedBy_NotInScope(Collection deletedByList) { + regDeletedBy(CK_NINS, cTL(deletedByList)); + } + + /** + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param deletedBy The value of deletedBy as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) + */ + public void setDeletedBy_LikeSearch( String deletedBy, - jp.sf.pal.scheduler.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(deletedBy), getCValueDeletedBy(), - "DELETED_BY", "DeletedBy", "deletedBy", inScopeOption); + jp.sf.pal.scheduler.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(deletedBy), getCValueDeletedBy(), "DELETED_BY", + "DeletedBy", "deletedBy", likeSearchOption); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param deletedByList The collection of deletedBy as notInScope. + * @param deletedBy The value of deletedBy as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setDeletedBy_NotInScope(Collection deletedByList) { - regDeletedBy(CK_NINS, cTL(deletedByList)); + public void setDeletedBy_NotLikeSearch( + String deletedBy, + jp.sf.pal.scheduler.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(deletedBy), getCValueDeletedBy(), "DELETED_BY", + "DeletedBy", "deletedBy", likeSearchOption); } /** - * IsNull(is null). And OnceRegistered. + * IsNull(is null). And OnlyOnceRegistered. */ public void setDeletedBy_IsNull() { regDeletedBy(CK_ISN, DUMMY_OBJECT); } /** - * IsNotNull(is not null). And OnceRegistered. + * IsNotNull(is not null). And OnlyOnceRegistered. */ public void setDeletedBy_IsNotNull() { regDeletedBy(CK_ISNN, DUMMY_OBJECT); @@ -1800,7 +1734,7 @@ abstract protected ConditionValue getCValueDeletedBy(); /** - * Equal(=). And NullIgnored, OnceRegistered. {NotNull : INTEGER} + * Equal(=). And NullIgnored, OnlyOnceRegistered. {NotNull : INTEGER} * * @param versionno The value of versionno as equal. */ @@ -1809,7 +1743,7 @@ } /** - * NotEqual(!=). And NullIgnored, OnceRegistered. + * NotEqual(!=). And NullIgnored, OnlyOnceRegistered. * * @param versionno The value of versionno as notEqual. */ @@ -1818,7 +1752,7 @@ } /** - * GreaterThan(>). And NullIgnored, OnceRegistered. + * GreaterThan(>). And NullIgnored, OnlyOnceRegistered. * * @param versionno The value of versionno as greaterThan. */ @@ -1827,7 +1761,7 @@ } /** - * LessThan(<). And NullIgnored, OnceRegistered. + * LessThan(<). And NullIgnored, OnlyOnceRegistered. * * @param versionno The value of versionno as lessThan. */ @@ -1836,7 +1770,7 @@ } /** - * GreaterEqual(>=). And NullIgnored, OnceRegistered. + * GreaterEqual(>=). And NullIgnored, OnlyOnceRegistered. * * @param versionno The value of versionno as greaterEqual. */ @@ -1845,7 +1779,7 @@ } /** - * LessEqual(<=). And NullIgnored, OnceRegistered. + * LessEqual(<=). And NullIgnored, OnlyOnceRegistered. * * @param versionno The value of versionno as lessEqual. */ @@ -1885,6 +1819,50 @@ abstract protected ConditionValue getCValueVersionno(); + public SSQFunction scalar_Equal() { + return xcreateSSQFunction("="); + } + + public SSQFunction scalar_GreaterEqual() { + return xcreateSSQFunction(">="); + } + + public SSQFunction scalar_GreaterThan() { + return xcreateSSQFunction(">"); + } + + public SSQFunction scalar_LessEqual() { + return xcreateSSQFunction("<="); + } + + public SSQFunction scalar_LessThan() { + return xcreateSSQFunction("<"); + } + + protected SSQFunction xcreateSSQFunction(final String operand) { + return new SSQFunction(new SSQSetupper() { + public void setup(String function, SubQuery subQuery) { + xscalarSubQuery(function, subQuery, operand); + } + }); + } + + protected void xscalarSubQuery(String function, + SubQuery subQuery, String operand) { + assertObjectNotNull("subQuery", subQuery); + GroupInfoCB cb = new GroupInfoCB(); + cb.xsetupForScalarSubQuery(); + subQuery.query(cb); + String subQueryPropertyName = keepScalarSubQuery(cb.query()); // for + // saving + // query + // -value. + registerScalarSubQuery(function, cb.query(), subQueryPropertyName, + operand); + } + + public abstract String keepScalarSubQuery(GroupInfoCQ subQuery); + // Very Internal (for Suppressing Warn about 'Not Use Import') protected String getConditionBeanClassNameInternally() { return GroupInfoCB.class.getName(); Modified: 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 2008-12-27 22:14:41 UTC (rev 1629) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/cq/bs/AbstractBsGroupMappingCQ.java 2008-12-27 22:18:30 UTC (rev 1630) @@ -11,16 +11,13 @@ 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 { //========================================================================== @@ -50,7 +47,8 @@ // ===== /** - * Equal(=). And NullIgnored, OnceRegistered. {PK : ID : NotNull : INTEGER} + * Equal(=). And NullIgnored, OnlyOnceRegistered. {PK : ID : NotNull : + * INTEGER} * * @param id The value of id as equal. */ @@ -59,7 +57,7 @@ } /** - * NotEqual(!=). And NullIgnored, OnceRegistered. + * NotEqual(!=). And NullIgnored, OnlyOnceRegistered. * * @param id The value of id as notEqual. */ @@ -68,7 +66,7 @@ } /** - * GreaterThan(>). And NullIgnored, OnceRegistered. + * GreaterThan(>). And NullIgnored, OnlyOnceRegistered. * * @param id The value of id as greaterThan. */ @@ -77,7 +75,7 @@ } /** - * LessThan(<). And NullIgnored, OnceRegistered. + * LessThan(<). And NullIgnored, OnlyOnceRegistered. * * @param id The value of id as lessThan. */ @@ -86,7 +84,7 @@ } /** - * GreaterEqual(>=). And NullIgnored, OnceRegistered. + * GreaterEqual(>=). And NullIgnored, OnlyOnceRegistered. * * @param id The value of id as greaterEqual. */ @@ -95,7 +93,7 @@ } /** - * LessEqual(<=). And NullIgnored, OnceRegistered. + * LessEqual(<=). And NullIgnored, OnlyOnceRegistered. * * @param id The value of id as lessEqual. */ @@ -124,14 +122,14 @@ } /** - * IsNull(is null). And OnceRegistered. + * IsNull(is null). And OnlyOnceRegistered. */ public void setId_IsNull() { regId(CK_ISN, DUMMY_OBJECT); } /** - * IsNotNull(is not null). And OnceRegistered. + * IsNotNull(is not null). And OnlyOnceRegistered. */ public void setId_IsNotNull() { regId(CK_ISNN, DUMMY_OBJECT); @@ -148,8 +146,8 @@ abstract protected ConditionValue getCValueId(); /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {NotNull : VARCHAR(255) - * : FK to USER_INFO} + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {NotNull : + * VARCHAR(255) : FK to USER_INFO} * * @param userId The value of userId as equal. */ @@ -158,7 +156,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param userId The value of userId as notEqual. */ @@ -167,7 +165,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param userId The value of userId as greaterThan. */ @@ -176,7 +174,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param userId The value of userId as lessThan. */ @@ -185,7 +183,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param userId The value of userId as greaterEqual. */ @@ -194,7 +192,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param userId The value of userId as lessEqual. */ @@ -203,7 +201,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param userId The value of userId as prefixSearch. */ @@ -212,20 +210,6 @@ } /** - * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, - * SeveralRegistered. - * - * @param userId The value of userId as likeSearch. - * @param likeSearchOption The option of like-search. (NotNull) - */ - public void setUserId_LikeSearch( - String userId, - jp.sf.pal.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. * @@ -236,42 +220,41 @@ } /** - * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * - * @param userId The collection of userId as inScope. - * @param inScopeOption The option of in-scope. (NotNull) + * @param userIdList The collection of userId as notInScope. */ - public void setUserId_InScope( - String userId, - jp.sf.pal.scheduler.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(userId), getCValueUserId(), - "USER_ID", "UserId", "userId", inScopeOption); + public void setUserId_NotInScope(Collection userIdList) { + regUserId(CK_NINS, cTL(userIdList)); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param userIdList The collection of userId as notInScope. + * @param userId The value of userId as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) */ - public void setUserId_NotInScope(Collection userIdList) { - regUserId(CK_NINS, cTL(userIdList)); + public void setUserId_LikeSearch( + String userId, + jp.sf.pal.scheduler.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(userId), getCValueUserId(), "USER_ID", "UserId", + "userId", likeSearchOption); } /** - * @param userInfoCBquery Query. - * @deprecated Please use inScopeUserInfo(subQuery) method. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param userId The value of userId as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setUserId_InScopeSubQuery_UserInfo(UserInfoCQ userInfoCBquery) { - String subQueryPropertyName = keepUserId_InScopeSubQuery_UserInfo(userInfoCBquery);// for - // saving - // query - // - - // value - // . - registerInScopeSubQuery(userInfoCBquery, "USER_ID", "USER_ID", - subQueryPropertyName); + public void setUserId_NotLikeSearch( + String userId, + jp.sf.pal.scheduler.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(userId), getCValueUserId(), "USER_ID", "UserId", + "userId", likeSearchOption); } public void inScopeUserInfo(SubQuery subQuery) { @@ -280,12 +263,12 @@ cb.xsetupForInScopeSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepUserId_InScopeSubQuery_UserInfo(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerInScopeSubQuery(cb.query(), "USER_ID", "USER_ID", subQueryPropertyName); } - abstract public String keepUserId_InScopeSubQuery_UserInfo( + public abstract String keepUserId_InScopeSubQuery_UserInfo( jp.sf.pal.scheduler.db.cbean.cq.UserInfoCQ subQuery); protected void regUserId(ConditionKey key, Object value) { @@ -301,8 +284,8 @@ abstract protected ConditionValue getCValueUserId(); /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {NotNull : VARCHAR(255) - * : FK to GROUP_INFO} + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {NotNull : + * VARCHAR(255) : FK to GROUP_INFO} * * @param groupId The value of groupId as equal. */ @@ -311,7 +294,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param groupId The value of groupId as notEqual. */ @@ -320,7 +303,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param groupId The value of groupId as greaterThan. */ @@ -329,7 +312,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param groupId The value of groupId as lessThan. */ @@ -338,7 +321,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param groupId The value of groupId as greaterEqual. */ @@ -347,7 +330,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param groupId The value of groupId as lessEqual. */ @@ -356,7 +339,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param groupId The value of groupId as prefixSearch. */ @@ -365,20 +348,6 @@ } /** - * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, - * SeveralRegistered. - * - * @param groupId The value of groupId as likeSearch. - * @param likeSearchOption The option of like-search. (NotNull) - */ - public void setGroupId_LikeSearch( - String groupId, - jp.sf.pal.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. * @@ -389,43 +358,41 @@ } /** - * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * - * @param groupId The collection of groupId as inScope. - * @param inScopeOption The option of in-scope. (NotNull) + * @param groupIdList The collection of groupId as notInScope. */ - public void setGroupId_InScope( - String groupId, - jp.sf.pal.scheduler.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(groupId), getCValueGroupId(), - "GROUP_ID", "GroupId", "groupId", inScopeOption); + public void setGroupId_NotInScope(Collection groupIdList) { + regGroupId(CK_NINS, cTL(groupIdList)); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param groupIdList The collection of groupId as notInScope. + * @param groupId The value of groupId as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) */ - public void setGroupId_NotInScope(Collection groupIdList) { - regGroupId(CK_NINS, cTL(groupIdList)); + public void setGroupId_LikeSearch( + String groupId, + jp.sf.pal.scheduler.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(groupId), getCValueGroupId(), "GROUP_ID", "GroupId", + "groupId", likeSearchOption); } /** - * @param groupInfoCBquery Query. - * @deprecated Please use inScopeGroupInfo(subQuery) method. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param groupId The value of groupId as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setGroupId_InScopeSubQuery_GroupInfo( - GroupInfoCQ groupInfoCBquery) { - String subQueryPropertyName = keepGroupId_InScopeSubQuery_GroupInfo(groupInfoCBquery);// for - // saving - // query - // - - // value - // . - registerInScopeSubQuery(groupInfoCBquery, "GROUP_ID", "GROUP_ID", - subQueryPropertyName); + public void setGroupId_NotLikeSearch( + String groupId, + jp.sf.pal.scheduler.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(groupId), getCValueGroupId(), "GROUP_ID", + "GroupId", "groupId", likeSearchOption); } public void inScopeGroupInfo(SubQuery subQuery) { @@ -434,12 +401,12 @@ cb.xsetupForInScopeSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepGroupId_InScopeSubQuery_GroupInfo(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerInScopeSubQuery(cb.query(), "GROUP_ID", "GROUP_ID", subQueryPropertyName); } - abstract public String keepGroupId_InScopeSubQuery_GroupInfo( + public abstract String keepGroupId_InScopeSubQuery_GroupInfo( jp.sf.pal.scheduler.db.cbean.cq.GroupInfoCQ subQuery); protected void regGroupId(ConditionKey key, Object value) { @@ -454,6 +421,53 @@ abstract protected ConditionValue getCValueGroupId(); + public SSQFunction scalar_Equal() { + return xcreateSSQFunction("="); + } + + public SSQFunction scalar_GreaterEqual() { + return xcreateSSQFunction(">="); + } + + public SSQFunction scalar_GreaterThan() { + return xcreateSSQFunction(">"); + } + + public SSQFunction scalar_LessEqual() { + return xcreateSSQFunction("<="); + } + + public SSQFunction scalar_LessThan() { + return xcreateSSQFunction("<"); + } + + protected SSQFunction xcreateSSQFunction( + final String operand) { + return new SSQFunction( + new SSQSetupper() { + public void setup(String function, + SubQuery subQuery) { + xscalarSubQuery(function, subQuery, operand); + } + }); + } + + protected void xscalarSubQuery(String function, + SubQuery subQuery, String operand) { + assertObjectNotNull("subQuery", subQuery); + GroupMappingCB cb = new GroupMappingCB(); + cb.xsetupForScalarSubQuery(); + subQuery.query(cb); + String subQueryPropertyName = keepScalarSubQuery(cb.query()); // for + // saving + // query + // -value. + registerScalarSubQuery(function, cb.query(), subQueryPropertyName, + operand); + } + + public abstract String keepScalarSubQuery(GroupMappingCQ subQuery); + // Very Internal (for Suppressing Warn about 'Not Use Import') protected String getConditionBeanClassNameInternally() { return GroupMappingCB.class.getName(); Modified: 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 2008-12-27 22:14:41 UTC (rev 1629) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/cq/bs/AbstractBsRoleInfoCQ.java 2008-12-27 22:18:30 UTC (rev 1630) @@ -20,7 +20,6 @@ * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public abstract class AbstractBsRoleInfoCQ extends AbstractConditionQuery { //========================================================================== @@ -50,7 +49,7 @@ // ===== /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {PK : NotNull : + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {PK : NotNull : * VARCHAR(255)} * * @param roleId The value of roleId as equal. @@ -60,7 +59,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param roleId The value of roleId as notEqual. */ @@ -69,7 +68,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param roleId The value of roleId as greaterThan. */ @@ -78,7 +77,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param roleId The value of roleId as lessThan. */ @@ -87,7 +86,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param roleId The value of roleId as greaterEqual. */ @@ -96,7 +95,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param roleId The value of roleId as lessEqual. */ @@ -105,7 +104,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param roleId The value of roleId as prefixSearch. */ @@ -114,20 +113,6 @@ } /** - * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, - * SeveralRegistered. - * - * @param roleId The value of roleId as likeSearch. - * @param likeSearchOption The option of like-search. (NotNull) - */ - public void setRoleId_LikeSearch( - String roleId, - jp.sf.pal.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. * @@ -138,43 +123,41 @@ } /** - * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * - * @param roleId The collection of roleId as inScope. - * @param inScopeOption The option of in-scope. (NotNull) + * @param roleIdList The collection of roleId as notInScope. */ - public void setRoleId_InScope( - String roleId, - jp.sf.pal.scheduler.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(roleId), getCValueRoleId(), - "ROLE_ID", "RoleId", "roleId", inScopeOption); + public void setRoleId_NotInScope(Collection roleIdList) { + regRoleId(CK_NINS, cTL(roleIdList)); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param roleIdList The collection of roleId as notInScope. + * @param roleId The value of roleId as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) */ - public void setRoleId_NotInScope(Collection roleIdList) { - regRoleId(CK_NINS, cTL(roleIdList)); + public void setRoleId_LikeSearch( + String roleId, + jp.sf.pal.scheduler.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(roleId), getCValueRoleId(), "ROLE_ID", "RoleId", + "roleId", likeSearchOption); } /** - * @param roleMappingCBquery Query. - * @deprecated Please use inScopeRoleMappingList(subQuery) method. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param roleId The value of roleId as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setRoleId_InScopeSubQuery_RoleMappingList( - RoleMappingCQ roleMappingCBquery) { - String subQueryPropertyName = keepRoleId_InScopeSubQuery_RoleMappingList(roleMappingCBquery);// for - // saving - // query - // - - // value - // . - registerInScopeSubQuery(roleMappingCBquery, "ROLE_ID", "ROLE_ID", - subQueryPropertyName); + public void setRoleId_NotLikeSearch( + String roleId, + jp.sf.pal.scheduler.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(roleId), getCValueRoleId(), "ROLE_ID", "RoleId", + "roleId", likeSearchOption); } public void inScopeRoleMappingList(SubQuery subQuery) { @@ -183,42 +166,26 @@ cb.xsetupForInScopeSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepRoleId_InScopeSubQuery_RoleMappingList(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerInScopeSubQuery(cb.query(), "ROLE_ID", "ROLE_ID", subQueryPropertyName); } - abstract public String keepRoleId_InScopeSubQuery_RoleMappingList( + public abstract String keepRoleId_InScopeSubQuery_RoleMappingList( RoleMappingCQ subQuery); - /** - * @param userInfoCBquery Query. - * @deprecated Please use inScopeUserInfoList(subQuery) method. - */ - public void setRoleId_InScopeSubQuery_UserInfoList( - UserInfoCQ userInfoCBquery) { - String subQueryPropertyName = keepRoleId_InScopeSubQuery_UserInfoList(userInfoCBquery);// for - // saving - // query - // - - // value - // . - registerInScopeSubQuery(userInfoCBquery, "ROLE_ID", "ROLE_ID", - subQueryPropertyName); - } - public void inScopeUserInfoList(SubQuery subQuery) { assertObjectNotNull("subQuery", subQuery); UserInfoCB cb = new UserInfoCB(); cb.xsetupForInScopeSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepRoleId_InScopeSubQuery_UserInfoList(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerInScopeSubQuery(cb.query(), "ROLE_ID", "ROLE_ID", subQueryPropertyName); } - abstract public String keepRoleId_InScopeSubQuery_UserInfoList( + public abstract String keepRoleId_InScopeSubQuery_UserInfoList( UserInfoCQ subQuery); public void notInScopeRoleMappingList(SubQuery subQuery) { @@ -227,12 +194,12 @@ cb.xsetupForInScopeSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepRoleId_NotInScopeSubQuery_RoleMappingList(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerNotInScopeSubQuery(cb.query(), "ROLE_ID", "ROLE_ID", subQueryPropertyName); } - abstract public String keepRoleId_NotInScopeSubQuery_RoleMappingList( + public abstract String keepRoleId_NotInScopeSubQuery_RoleMappingList( RoleMappingCQ subQuery); public void notInScopeUserInfoList(SubQuery subQuery) { @@ -241,31 +208,15 @@ cb.xsetupForInScopeSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepRoleId_NotInScopeSubQuery_UserInfoList(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerNotInScopeSubQuery(cb.query(), "ROLE_ID", "ROLE_ID", subQueryPropertyName); } - abstract public String keepRoleId_NotInScopeSubQuery_UserInfoList( + public abstract String keepRoleId_NotInScopeSubQuery_UserInfoList( UserInfoCQ subQuery); /** - * @param roleMappingCBquery Query. - * @deprecated Please use existsRoleMappingList(subQuery) method. - */ - public void setRoleId_ExistsSubQuery_RoleMappingList( - RoleMappingCQ roleMappingCBquery) { - String subQueryPropertyName = keepRoleId_ExistsSubQuery_RoleMappingList(roleMappingCBquery);// for - // saving - // query - // - - // value - // . - registerExistsSubQuery(roleMappingCBquery, "ROLE_ID", "ROLE_ID", - subQueryPropertyName); - } - - /** * Set up 'exists' sub-query. {exists (select ROLE_ID from ROLE_MAPPING * where ...)} * @@ -278,30 +229,15 @@ cb.xsetupForExistsSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepRoleId_ExistsSubQuery_RoleMappingList(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerExistsSubQuery(cb.query(), "ROLE_ID", "ROLE_ID", subQueryPropertyName); } - abstract public String keepRoleId_ExistsSubQuery_RoleMappingList( + public abstract String keepRoleId_ExistsSubQuery_RoleMappingList( RoleMappingCQ subQuery); /** - * @param userInfoCBquery Query. - * @deprecated Please use existsUserInfoList(subQuery) method. - */ - public void setRoleId_ExistsSubQuery_UserInfoList(UserInfoCQ userInfoCBquery) { - String subQueryPropertyName = keepRoleId_ExistsSubQuery_UserInfoList(userInfoCBquery);// for - // saving - // query - // - - // value - // . - registerExistsSubQuery(userInfoCBquery, "ROLE_ID", "ROLE_ID", - subQueryPropertyName); - } - - /** * Set up 'exists' sub-query. {exists (select ROLE_ID from USER_INFO where * ...)} * @@ -314,12 +250,12 @@ cb.xsetupForExistsSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepRoleId_ExistsSubQuery_UserInfoList(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerExistsSubQuery(cb.query(), "ROLE_ID", "ROLE_ID", subQueryPropertyName); } - abstract public String keepRoleId_ExistsSubQuery_UserInfoList( + public abstract String keepRoleId_ExistsSubQuery_UserInfoList( UserInfoCQ subQuery); /** @@ -335,12 +271,12 @@ cb.xsetupForExistsSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepRoleId_NotExistsSubQuery_RoleMappingList(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerNotExistsSubQuery(cb.query(), "ROLE_ID", "ROLE_ID", subQueryPropertyName); } - abstract public String keepRoleId_NotExistsSubQuery_RoleMappingList( + public abstract String keepRoleId_NotExistsSubQuery_RoleMappingList( RoleMappingCQ subQuery); /** @@ -356,53 +292,53 @@ cb.xsetupForExistsSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepRoleId_NotExistsSubQuery_UserInfoList(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerNotExistsSubQuery(cb.query(), "ROLE_ID", "ROLE_ID", subQueryPropertyName); } - abstract public String keepRoleId_NotExistsSubQuery_UserInfoList( + public abstract String keepRoleId_NotExistsSubQuery_UserInfoList( UserInfoCQ subQuery); public void xderiveRoleMappingList(String function, SubQuery subQuery, String aliasName) { assertObjectNotNull("subQuery", subQuery); RoleMappingCB cb = new RoleMappingCB(); - cb.xsetupForDeriveReferrer(); + cb.xsetupForDerivedReferrer(); subQuery.query(cb); - String subQueryPropertyName = keepRoleId_DeriveSubQuery_RoleMappingList(cb - .query());// for saving query-value. - registerDeriveSubQuery(function, cb.query(), "ROLE_ID", "ROLE_ID", - subQueryPropertyName, aliasName); + String subQueryPropertyName = keepRoleId_DerivedReferrer_RoleMappingList(cb + .query()); // for saving query-value. + registerDerivedReferrerSubQuery(function, cb.query(), "ROLE_ID", + "ROLE_ID", subQueryPropertyName, aliasName); } - abstract public String keepRoleId_DeriveSubQuery_RoleMappingList( + public abstract String keepRoleId_DerivedReferrer_RoleMappingList( RoleMappingCQ subQuery); public void xderiveUserInfoList(String function, SubQuery subQuery, String aliasName) { assertObjectNotNull("subQuery", subQuery); UserInfoCB cb = new UserInfoCB(); - cb.xsetupForDeriveReferrer(); + cb.xsetupForDerivedReferrer(); subQuery.query(cb); - String subQueryPropertyName = keepRoleId_DeriveSubQuery_UserInfoList(cb - .query());// for saving query-value. - registerDeriveSubQuery(function, cb.query(), "ROLE_ID", "ROLE_ID", - subQueryPropertyName, aliasName); + String subQueryPropertyName = keepRoleId_DerivedReferrer_UserInfoList(cb + .query()); // for saving query-value. + registerDerivedReferrerSubQuery(function, cb.query(), "ROLE_ID", + "ROLE_ID", subQueryPropertyName, aliasName); } - abstract public String keepRoleId_DeriveSubQuery_UserInfoList( + public abstract String keepRoleId_DerivedReferrer_UserInfoList( UserInfoCQ subQuery); /** - * IsNull(is null). And OnceRegistered. + * IsNull(is null). And OnlyOnceRegistered. */ public void setRoleId_IsNull() { regRoleId(CK_ISN, DUMMY_OBJECT); } /** - * IsNotNull(is not null). And OnceRegistered. + * IsNotNull(is not null). And OnlyOnceRegistered. */ public void setRoleId_IsNotNull() { regRoleId(CK_ISNN, DUMMY_OBJECT); @@ -421,7 +357,7 @@ abstract protected ConditionValue getCValueRoleId(); /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {VARCHAR(100)} + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {VARCHAR(100)} * * @param name The value of name as equal. */ @@ -430,7 +366,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param name The value of name as notEqual. */ @@ -439,7 +375,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param name The value of name as greaterThan. */ @@ -448,7 +384,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param name The value of name as lessThan. */ @@ -457,7 +393,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param name The value of name as greaterEqual. */ @@ -466,7 +402,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param name The value of name as lessEqual. */ @@ -475,7 +411,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param name The value of name as prefixSearch. */ @@ -484,20 +420,6 @@ } /** - * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, - * SeveralRegistered. - * - * @param name The value of name as likeSearch. - * @param likeSearchOption The option of like-search. (NotNull) - */ - public void setName_LikeSearch( - String name, - jp.sf.pal.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. * @@ -508,38 +430,52 @@ } /** - * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * - * @param name The collection of name as inScope. - * @param inScopeOption The option of in-scope. (NotNull) + * @param nameList The collection of name as notInScope. */ - public void setName_InScope( + public void setName_NotInScope(Collection nameList) { + regName(CK_NINS, cTL(nameList)); + } + + /** + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param name The value of name as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) + */ + public void setName_LikeSearch( String name, - jp.sf.pal.scheduler.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(name), getCValueName(), "NAME", - "Name", "name", inScopeOption); + jp.sf.pal.scheduler.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(name), getCValueName(), "NAME", "Name", "name", + likeSearchOption); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param nameList The collection of name as notInScope. + * @param name The value of name as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setName_NotInScope(Collection nameList) { - regName(CK_NINS, cTL(nameList)); + public void setName_NotLikeSearch( + String name, + jp.sf.pal.scheduler.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(name), getCValueName(), "NAME", "Name", "name", + likeSearchOption); } /** - * IsNull(is null). And OnceRegistered. + * IsNull(is null). And OnlyOnceRegistered. */ public void setName_IsNull() { regName(CK_ISN, DUMMY_OBJECT); } /** - * IsNotNull(is not null). And OnceRegistered. + * IsNotNull(is not null). And OnlyOnceRegistered. */ public void setName_IsNotNull() { regName(CK_ISNN, DUMMY_OBJECT); @@ -556,7 +492,7 @@ abstract protected ConditionValue getCValueName(); /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {VARCHAR(255)} + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {VARCHAR(255)} * * @param description The value of description as equal. */ @@ -565,7 +501,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param description The value of description as notEqual. */ @@ -574,7 +510,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param description The value of description as greaterThan. */ @@ -583,7 +519,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param description The value of description as lessThan. */ @@ -592,7 +528,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param description The value of description as greaterEqual. */ @@ -601,7 +537,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param description The value of description as lessEqual. */ @@ -610,7 +546,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param description The value of description as prefixSearch. */ @@ -619,21 +555,6 @@ } /** - * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, - * SeveralRegistered. - * - * @param description The value of description as likeSearch. - * @param likeSearchOption The option of like-search. (NotNull) - */ - public void setDescription_LikeSearch( - String description, - jp.sf.pal.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. * @@ -644,38 +565,52 @@ } /** - * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * - * @param description The collection of description as inScope. - * @param inScopeOption The option of in-scope. (NotNull) + * @param descriptionList The collection of description as notInScope. */ - public void setDescription_InScope( + public void setDescription_NotInScope(Collection descriptionList) { + regDescription(CK_NINS, cTL(descriptionList)); + } + + /** + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param description The value of description as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) + */ + public void setDescription_LikeSearch( String description, - jp.sf.pal.scheduler.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(description), getCValueDescription(), - "DESCRIPTION", "Description", "description", inScopeOption); + jp.sf.pal.scheduler.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(description), getCValueDescription(), "DESCRIPTION", + "Description", "description", likeSearchOption); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param descriptionList The collection of description as notInScope. + * @param description The value of description as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setDescription_NotInScope(Collection descriptionList) { - regDescription(CK_NINS, cTL(descriptionList)); + public void setDescription_NotLikeSearch( + String description, + jp.sf.pal.scheduler.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(description), getCValueDescription(), + "DESCRIPTION", "Description", "description", likeSearchOption); } /** - * IsNull(is null). And OnceRegistered. + * IsNull(is null). And OnlyOnceRegistered. */ public void setDescription_IsNull() { regDescription(CK_ISN, DUMMY_OBJECT); } /** - * IsNotNull(is not null). And OnceRegistered. + * IsNotNull(is not null). And OnlyOnceRegistered. */ public void setDescription_IsNotNull() { regDescription(CK_ISNN, DUMMY_OBJECT); @@ -694,7 +629,7 @@ abstract protected ConditionValue getCValueDescription(); /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {VARCHAR(255)} + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {VARCHAR(255)} * * @param email The value of email as equal. */ @@ -703,7 +638,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param email The value of email as notEqual. */ @@ -712,7 +647,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param email The value of email as greaterThan. */ @@ -721,7 +656,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param email The value of email as lessThan. */ @@ -730,7 +665,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param email The value of email as greaterEqual. */ @@ -739,7 +674,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param email The value of email as lessEqual. */ @@ -748,7 +683,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param email The value of email as prefixSearch. */ @@ -757,20 +692,6 @@ } /** - * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, - * SeveralRegistered. - * - * @param email The value of email as likeSearch. - * @param likeSearchOption The option of like-search. (NotNull) - */ - public void setEmail_LikeSearch( - String email, - jp.sf.pal.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. * @@ -781,38 +702,52 @@ } /** - * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * - * @param email The collection of email as inScope. - * @param inScopeOption The option of in-scope. (NotNull) + * @param emailList The collection of email as notInScope. */ - public void setEmail_InScope( + public void setEmail_NotInScope(Collection emailList) { + regEmail(CK_NINS, cTL(emailList)); + } + + /** + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param email The value of email as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) + */ + public void setEmail_LikeSearch( String email, - jp.sf.pal.scheduler.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(email), getCValueEmail(), "EMAIL", - "Email", "email", inScopeOption); + jp.sf.pal.scheduler.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(email), getCValueEmail(), "EMAIL", "Email", "email", + likeSearchOption); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param emailList The collection of email as notInScope. + * @param email The value of email as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setEmail_NotInScope(Collection emailList) { - regEmail(CK_NINS, cTL(emailList)); + public void setEmail_NotLikeSearch( + String email, + jp.sf.pal.scheduler.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(email), getCValueEmail(), "EMAIL", "Email", + "email", likeSearchOption); } /** - * IsNull(is null). And OnceRegistered. + * IsNull(is null). And OnlyOnceRegistered. */ public void setEmail_IsNull() { regEmail(CK_ISN, DUMMY_OBJECT); } /** - * IsNotNull(is not null). And OnceRegistered. + * IsNotNull(is not null). And OnlyOnceRegistered. */ public void setEmail_IsNotNull() { regEmail(CK_ISNN, DUMMY_OBJECT); @@ -830,7 +765,7 @@ abstract protected ConditionValue getCValueEmail(); /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {VARCHAR(255)} + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {VARCHAR(255)} * * @param url The value of url as equal. */ @@ -839,7 +774,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param url The value of url as notEqual. */ @@ -848,7 +783,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param url The value of url as greaterThan. */ @@ -857,7 +792,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param url The value of url as lessThan. */ @@ -866,7 +801,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param url The value of url as greaterEqual. */ @@ -875,7 +810,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param url The value of url as lessEqual. */ @@ -884,7 +819,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param url The value of url as prefixSearch. */ @@ -893,20 +828,6 @@ } /** - * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, - * SeveralRegistered. - * - * @param url The value of url as likeSearch. - * @param likeSearchOption The option of like-search. (NotNull) - */ - public void setUrl_LikeSearch( - String url, - jp.sf.pal.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. * @@ -917,38 +838,52 @@ } /** - * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * - * @param url The collection of url as inScope. - * @param inScopeOption The option of in-scope. (NotNull) + * @param urlList The collection of url as notInScope. */ - public void setUrl_InScope( + public void setUrl_NotInScope(Collection urlList) { + regUrl(CK_NINS, cTL(urlList)); + } + + /** + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param url The value of url as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) + */ + public void setUrl_LikeSearch( String url, - jp.sf.pal.scheduler.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(url), getCValueUrl(), "URL", "Url", - "url", inScopeOption); + jp.sf.pal.scheduler.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(url), getCValueUrl(), "URL", "Url", "url", + likeSearchOption); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param urlList The collection of url as notInScope. + * @param url The value of url as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setUrl_NotInScope(Collection urlList) { - regUrl(CK_NINS, cTL(urlList)); + public void setUrl_NotLikeSearch( + String url, + jp.sf.pal.scheduler.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(url), getCValueUrl(), "URL", "Url", "url", + likeSearchOption); } /** - * IsNull(is null). And OnceRegistered. + * IsNull(is null). And OnlyOnceRegistered. */ public void setUrl_IsNull() { regUrl(CK_ISN, DUMMY_OBJECT); } /** - * IsNotNull(is not null). And OnceRegistered. + * IsNotNull(is not null). And OnlyOnceRegistered. */ public void setUrl_IsNotNull() { regUrl(CK_ISNN, DUMMY_OBJECT); @@ -965,7 +900,7 @@ abstract protected ConditionValue getCValueUrl(); /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {VARCHAR(40)} + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {VARCHAR(40)} * * @param telephone The value of telephone as equal. */ @@ -974,7 +909,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param telephone The value of telephone as notEqual. */ @@ -983,7 +918,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param telephone The value of telephone as greaterThan. */ @@ -992,7 +927,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param telephone The value of telephone as lessThan. */ @@ -1001,7 +936,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param telephone The value of telephone as greaterEqual. */ @@ -1010,7 +945,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param telephone The value of telephone as lessEqual. */ @@ -1019,7 +954,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param telephone The value of telephone as prefixSearch. */ @@ -1028,20 +963,6 @@ } /** - * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, - * SeveralRegistered. - * - * @param telephone The value of telephone as likeSearch. - * @param likeSearchOption The option of like-search. (NotNull) - */ - public void setTelephone_LikeSearch( - String telephone, - jp.sf.pal.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. * @@ -1052,38 +973,52 @@ } /** - * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * - * @param telephone The collection of telephone as inScope. - * @param inScopeOption The option of in-scope. (NotNull) + * @param telephoneList The collection of telephone as notInScope. */ - public void setTelephone_InScope( + public void setTelephone_NotInScope(Collection telephoneList) { + regTelephone(CK_NINS, cTL(telephoneList)); + } + + /** + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param telephone The value of telephone as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) + */ + public void setTelephone_LikeSearch( String telephone, - jp.sf.pal.scheduler.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(telephone), getCValueTelephone(), - "TELEPHONE", "Telephone", "telephone", inScopeOption); + jp.sf.pal.scheduler.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(telephone), getCValueTelephone(), "TELEPHONE", + "Telephone", "telephone", likeSearchOption); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param telephoneList The collection of telephone as notInScope. + * @param telephone The value of telephone as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setTelephone_NotInScope(Collection telephoneList) { - regTelephone(CK_NINS, cTL(telephoneList)); + public void setTelephone_NotLikeSearch( + String telephone, + jp.sf.pal.scheduler.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(telephone), getCValueTelephone(), "TELEPHONE", + "Telephone", "telephone", likeSearchOption); } /** - * IsNull(is null). And OnceRegistered. + * IsNull(is null). And OnlyOnceRegistered. */ public void setTelephone_IsNull() { regTelephone(CK_ISN, DUMMY_OBJECT); } /** - * IsNotNull(is not null). And OnceRegistered. + * IsNotNull(is not null). And OnlyOnceRegistered. */ public void setTelephone_IsNotNull() { regTelephone(CK_ISNN, DUMMY_OBJECT); @@ -1102,7 +1037,7 @@ abstract protected ConditionValue getCValueTelephone(); /** - * Equal(=). And NullIgnored, OnceRegistered. {NotNull : TIMESTAMP} + * Equal(=). And NullIgnored, OnlyOnceRegistered. {NotNull : TIMESTAMP} * * @param createdTime The value of createdTime as equal. */ @@ -1111,7 +1046,7 @@ } /** - * NotEqual(!=). And NullIgnored, OnceRegistered. + * NotEqual(!=). And NullIgnored, OnlyOnceRegistered. * * @param createdTime The value of createdTime as notEqual. */ @@ -1120,7 +1055,7 @@ } /** - * GreaterThan(>). And NullIgnored, OnceRegistered. + * GreaterThan(>). And NullIgnored, OnlyOnceRegistered. * * @param createdTime The value of createdTime as greaterThan. */ @@ -1129,7 +1064,7 @@ } /** - * LessThan(>). And NullIgnored, OnceRegistered. + * LessThan(>). And NullIgnored, OnlyOnceRegistered. * * @param createdTime The value of createdTime as lessThan. */ @@ -1138,7 +1073,7 @@ } /** - * GreaterEqual(>). And NullIgnored, OnceRegistered. + * GreaterEqual(>). And NullIgnored, OnlyOnceRegistered. * * @param createdTime The value of createdTime as greaterEqual. */ @@ -1147,7 +1082,7 @@ } /** - * LessEqual(>). And NullIgnored, OnceRegistered. + * LessEqual(>). And NullIgnored, OnlyOnceRegistered. * * @param createdTime The value of createdTime as lessEqual. */ @@ -1157,7 +1092,7 @@ /** * FromTo($fromDate <= COLUMN_NAME <= $toDate). And NullIgnored, - * OnceRegistered. {NotNull : TIMESTAMP} + * OnlyOnceRegistered. {NotNull : TIMESTAMP} * * @param fromDate The from-date of createdTime. (Nullable) * @param toDate The to-date of createdTime. (Nullable) @@ -1175,7 +1110,7 @@ /** * FromTo($fromDate <= COLUMN_NAME < $toDate + 1). And NullIgnored, - * OnceRegistered. {NotNull : TIMESTAMP} + * OnlyOnceRegistered. {NotNull : TIMESTAMP} * * @param fromDate The from-date of createdTime. (Nullable) * @param toDate The to-date of createdTime. (Nullable) @@ -1201,7 +1136,7 @@ abstract protected ConditionValue getCValueCreatedTime(); /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {NotNull : + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {NotNull : * VARCHAR(255)} * * @param createdBy The value of createdBy as equal. @@ -1211,7 +1146,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param createdBy The value of createdBy as notEqual. */ @@ -1220,7 +1155,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param createdBy The value of createdBy as greaterThan. */ @@ -1229,7 +1164,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param createdBy The value of createdBy as lessThan. */ @@ -1238,7 +1173,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param createdBy The value of createdBy as greaterEqual. */ @@ -1247,7 +1182,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param createdBy The value of createdBy as lessEqual. */ @@ -1256,7 +1191,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param createdBy The value of createdBy as prefixSearch. */ @@ -1265,20 +1200,6 @@ } /** - * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, - * SeveralRegistered. - * - * @param createdBy The value of createdBy as likeSearch. - * @param likeSearchOption The option of like-search. (NotNull) - */ - public void setCreatedBy_LikeSearch( - String createdBy, - jp.sf.pal.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. * @@ -1289,27 +1210,41 @@ } /** - * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * - * @param createdBy The collection of createdBy as inScope. - * @param inScopeOption The option of in-scope. (NotNull) + * @param createdByList The collection of createdBy as notInScope. */ - public void setCreatedBy_InScope( + public void setCreatedBy_NotInScope(Collection createdByList) { + regCreatedBy(CK_NINS, cTL(createdByList)); + } + + /** + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param createdBy The value of createdBy as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) + */ + public void setCreatedBy_LikeSearch( String createdBy, - jp.sf.pal.scheduler.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(createdBy), getCValueCreatedBy(), - "CREATED_BY", "CreatedBy", "createdBy", inScopeOption); + jp.sf.pal.scheduler.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(createdBy), getCValueCreatedBy(), "CREATED_BY", + "CreatedBy", "createdBy", likeSearchOption); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param createdByList The collection of createdBy as notInScope. + * @param createdBy The value of createdBy as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setCreatedBy_NotInScope(Collection createdByList) { - regCreatedBy(CK_NINS, cTL(createdByList)); + public void setCreatedBy_NotLikeSearch( + String createdBy, + jp.sf.pal.scheduler.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(createdBy), getCValueCreatedBy(), "CREATED_BY", + "CreatedBy", "createdBy", likeSearchOption); } protected void regCreatedBy(ConditionKey key, Object value) { @@ -1325,7 +1260,7 @@ abstract protected ConditionValue getCValueCreatedBy(); /** - * Equal(=). And NullIgnored, OnceRegistered. {NotNull : TIMESTAMP} + * Equal(=). And NullIgnored, OnlyOnceRegistered. {NotNull : TIMESTAMP} * * @param updatedTime The value of updatedTime as equal. */ @@ -1334,7 +1269,7 @@ } /** - * NotEqual(!=). And NullIgnored, OnceRegistered. + * NotEqual(!=). And NullIgnored, OnlyOnceRegistered. * * @param updatedTime The value of updatedTime as notEqual. */ @@ -1343,7 +1278,7 @@ } /** - * GreaterThan(>). And NullIgnored, OnceRegistered. + * GreaterThan(>). And NullIgnored, OnlyOnceRegistered. * * @param updatedTime The value of updatedTime as greaterThan. */ @@ -1352,7 +1287,7 @@ } /** - * LessThan(>). And NullIgnored, OnceRegistered. + * LessThan(>). And NullIgnored, OnlyOnceRegistered. * * @param updatedTime The value of updatedTime as lessThan. */ @@ -1361,7 +1296,7 @@ } /** - * GreaterEqual(>). And NullIgnored, OnceRegistered. + * GreaterEqual(>). And NullIgnored, OnlyOnceRegistered. * * @param updatedTime The value of updatedTime as greaterEqual. */ @@ -1370,7 +1305,7 @@ } /** - * LessEqual(>). And NullIgnored, OnceRegistered. + * LessEqual(>). And NullIgnored, OnlyOnceRegistered. * * @param updatedTime The value of updatedTime as lessEqual. */ @@ -1380,7 +1315,7 @@ /** * FromTo($fromDate <= COLUMN_NAME <= $toDate). And NullIgnored, - * OnceRegistered. {NotNull : TIMESTAMP} + * OnlyOnceRegistered. {NotNull : TIMESTAMP} * * @param fromDate The from-date of updatedTime. (Nullable) * @param toDate The to-date of updatedTime. (Nullable) @@ -1398,7 +1333,7 @@ /** * FromTo($fromDate <= COLUMN_NAME < $toDate + 1). And NullIgnored, - * OnceRegistered. {NotNull : TIMESTAMP} + * OnlyOnceRegistered. {NotNull : TIMESTAMP} * * @param fromDate The from-date of updatedTime. (Nullable) * @param toDate The to-date of updatedTime. (Nullable) @@ -1424,7 +1359,7 @@ abstract protected ConditionValue getCValueUpdatedTime(); /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {NotNull : + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {NotNull : * VARCHAR(255)} * * @param updatedBy The value of updatedBy as equal. @@ -1434,7 +1369,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param updatedBy The value of updatedBy as notEqual. */ @@ -1443,7 +1378,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param updatedBy The value of updatedBy as greaterThan. */ @@ -1452,7 +1387,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param updatedBy The value of updatedBy as lessThan. */ @@ -1461,7 +1396,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param updatedBy The value of updatedBy as greaterEqual. */ @@ -1470,7 +1405,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param updatedBy The value of updatedBy as lessEqual. */ @@ -1479,7 +1414,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param updatedBy The value of updatedBy as prefixSearch. */ @@ -1488,20 +1423,6 @@ } /** - * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, - * SeveralRegistered. - * - * @param updatedBy The value of updatedBy as likeSearch. - * @param likeSearchOption The option of like-search. (NotNull) - */ - public void setUpdatedBy_LikeSearch( - String updatedBy, - jp.sf.pal.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. * @@ -1512,27 +1433,41 @@ } /** - * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * - * @param updatedBy The collection of updatedBy as inScope. - * @param inScopeOption The option of in-scope. (NotNull) + * @param updatedByList The collection of updatedBy as notInScope. */ - public void setUpdatedBy_InScope( + public void setUpdatedBy_NotInScope(Collection updatedByList) { + regUpdatedBy(CK_NINS, cTL(updatedByList)); + } + + /** + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param updatedBy The value of updatedBy as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) + */ + public void setUpdatedBy_LikeSearch( String updatedBy, - jp.sf.pal.scheduler.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(updatedBy), getCValueUpdatedBy(), - "UPDATED_BY", "UpdatedBy", "updatedBy", inScopeOption); + jp.sf.pal.scheduler.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(updatedBy), getCValueUpdatedBy(), "UPDATED_BY", + "UpdatedBy", "updatedBy", likeSearchOption); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param updatedByList The collection of updatedBy as notInScope. + * @param updatedBy The value of updatedBy as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setUpdatedBy_NotInScope(Collection updatedByList) { - regUpdatedBy(CK_NINS, cTL(updatedByList)); + public void setUpdatedBy_NotLikeSearch( + String updatedBy, + jp.sf.pal.scheduler.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(updatedBy), getCValueUpdatedBy(), "UPDATED_BY", + "UpdatedBy", "updatedBy", likeSearchOption); } protected void regUpdatedBy(ConditionKey key, Object value) { @@ -1548,7 +1483,7 @@ abstract protected ConditionValue getCValueUpdatedBy(); /** - * Equal(=). And NullIgnored, OnceRegistered. {TIMESTAMP} + * Equal(=). And NullIgnored, OnlyOnceRegistered. {TIMESTAMP} * * @param deletedTime The value of deletedTime as equal. */ @@ -1557,7 +1492,7 @@ } /** - * NotEqual(!=). And NullIgnored, OnceRegistered. + * NotEqual(!=). And NullIgnored, OnlyOnceRegistered. * * @param deletedTime The value of deletedTime as notEqual. */ @@ -1566,7 +1501,7 @@ } /** - * GreaterThan(>). And NullIgnored, OnceRegistered. + * GreaterThan(>). And NullIgnored, OnlyOnceRegistered. * * @param deletedTime The value of deletedTime as greaterThan. */ @@ -1575,7 +1510,7 @@ } /** - * LessThan(>). And NullIgnored, OnceRegistered. + * LessThan(>). And NullIgnored, OnlyOnceRegistered. * * @param deletedTime The value of deletedTime as lessThan. */ @@ -1584,7 +1519,7 @@ } /** - * GreaterEqual(>). And NullIgnored, OnceRegistered. + * GreaterEqual(>). And NullIgnored, OnlyOnceRegistered. * * @param deletedTime The value of deletedTime as greaterEqual. */ @@ -1593,7 +1528,7 @@ } /** - * LessEqual(>). And NullIgnored, OnceRegistered. + * LessEqual(>). And NullIgnored, OnlyOnceRegistered. * * @param deletedTime The value of deletedTime as lessEqual. */ @@ -1603,7 +1538,7 @@ /** * FromTo($fromDate <= COLUMN_NAME <= $toDate). And NullIgnored, - * OnceRegistered. {TIMESTAMP} + * OnlyOnceRegistered. {TIMESTAMP} * * @param fromDate The from-date of deletedTime. (Nullable) * @param toDate The to-date of deletedTime. (Nullable) @@ -1621,7 +1556,7 @@ /** * FromTo($fromDate <= COLUMN_NAME < $toDate + 1). And NullIgnored, - * OnceRegistered. {TIMESTAMP} + * OnlyOnceRegistered. {TIMESTAMP} * * @param fromDate The from-date of deletedTime. (Nullable) * @param toDate The to-date of deletedTime. (Nullable) @@ -1635,14 +1570,14 @@ } /** - * IsNull(is null). And OnceRegistered. + * IsNull(is null). And OnlyOnceRegistered. */ public void setDeletedTime_IsNull() { regDeletedTime(CK_ISN, DUMMY_OBJECT); } /** - * IsNotNull(is not null). And OnceRegistered. + * IsNotNull(is not null). And OnlyOnceRegistered. */ public void setDeletedTime_IsNotNull() { regDeletedTime(CK_ISNN, DUMMY_OBJECT); @@ -1661,7 +1596,7 @@ abstract protected ConditionValue getCValueDeletedTime(); /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {VARCHAR(255)} + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {VARCHAR(255)} * * @param deletedBy The value of deletedBy as equal. */ @@ -1670,7 +1605,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param deletedBy The value of deletedBy as notEqual. */ @@ -1679,7 +1614,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param deletedBy The value of deletedBy as greaterThan. */ @@ -1688,7 +1623,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param deletedBy The value of deletedBy as lessThan. */ @@ -1697,7 +1632,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param deletedBy The value of deletedBy as greaterEqual. */ @@ -1706,7 +1641,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param deletedBy The value of deletedBy as lessEqual. */ @@ -1715,7 +1650,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param deletedBy The value of deletedBy as prefixSearch. */ @@ -1724,20 +1659,6 @@ } /** - * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, - * SeveralRegistered. - * - * @param deletedBy The value of deletedBy as likeSearch. - * @param likeSearchOption The option of like-search. (NotNull) - */ - public void setDeletedBy_LikeSearch( - String deletedBy, - jp.sf.pal.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. * @@ -1748,38 +1669,52 @@ } /** - * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * - * @param deletedBy The collection of deletedBy as inScope. - * @param inScopeOption The option of in-scope. (NotNull) + * @param deletedByList The collection of deletedBy as notInScope. */ - public void setDeletedBy_InScope( + public void setDeletedBy_NotInScope(Collection deletedByList) { + regDeletedBy(CK_NINS, cTL(deletedByList)); + } + + /** + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param deletedBy The value of deletedBy as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) + */ + public void setDeletedBy_LikeSearch( String deletedBy, - jp.sf.pal.scheduler.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(deletedBy), getCValueDeletedBy(), - "DELETED_BY", "DeletedBy", "deletedBy", inScopeOption); + jp.sf.pal.scheduler.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(deletedBy), getCValueDeletedBy(), "DELETED_BY", + "DeletedBy", "deletedBy", likeSearchOption); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param deletedByList The collection of deletedBy as notInScope. + * @param deletedBy The value of deletedBy as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setDeletedBy_NotInScope(Collection deletedByList) { - regDeletedBy(CK_NINS, cTL(deletedByList)); + public void setDeletedBy_NotLikeSearch( + String deletedBy, + jp.sf.pal.scheduler.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(deletedBy), getCValueDeletedBy(), "DELETED_BY", + "DeletedBy", "deletedBy", likeSearchOption); } /** - * IsNull(is null). And OnceRegistered. + * IsNull(is null). And OnlyOnceRegistered. */ public void setDeletedBy_IsNull() { regDeletedBy(CK_ISN, DUMMY_OBJECT); } /** - * IsNotNull(is not null). And OnceRegistered. + * IsNotNull(is not null). And OnlyOnceRegistered. */ public void setDeletedBy_IsNotNull() { regDeletedBy(CK_ISNN, DUMMY_OBJECT); @@ -1798,7 +1733,7 @@ abstract protected ConditionValue getCValueDeletedBy(); /** - * Equal(=). And NullIgnored, OnceRegistered. {NotNull : INTEGER} + * Equal(=). And NullIgnored, OnlyOnceRegistered. {NotNull : INTEGER} * * @param versionno The value of versionno as equal. */ @@ -1807,7 +1742,7 @@ } /** - * NotEqual(!=). And NullIgnored, OnceRegistered. + * NotEqual(!=). And NullIgnored, OnlyOnceRegistered. * * @param versionno The value of versionno as notEqual. */ @@ -1816,7 +1751,7 @@ } /** - * GreaterThan(>). And NullIgnored, OnceRegistered. + * GreaterThan(>). And NullIgnored, OnlyOnceRegistered. * * @param versionno The value of versionno as greaterThan. */ @@ -1825,7 +1760,7 @@ } /** - * LessThan(<). And NullIgnored, OnceRegistered. + * LessThan(<). And NullIgnored, OnlyOnceRegistered. * * @param versionno The value of versionno as lessThan. */ @@ -1834,7 +1769,7 @@ } /** - * GreaterEqual(>=). And NullIgnored, OnceRegistered. + * GreaterEqual(>=). And NullIgnored, OnlyOnceRegistered. * * @param versionno The value of versionno as greaterEqual. */ @@ -1843,7 +1778,7 @@ } /** - * LessEqual(<=). And NullIgnored, OnceRegistered. + * LessEqual(<=). And NullIgnored, OnlyOnceRegistered. * * @param versionno The value of versionno as lessEqual. */ @@ -1883,6 +1818,50 @@ abstract protected ConditionValue getCValueVersionno(); + public SSQFunction scalar_Equal() { + return xcreateSSQFunction("="); + } + + public SSQFunction scalar_GreaterEqual() { + return xcreateSSQFunction(">="); + } + + public SSQFunction scalar_GreaterThan() { + return xcreateSSQFunction(">"); + } + + public SSQFunction scalar_LessEqual() { + return xcreateSSQFunction("<="); + } + + public SSQFunction scalar_LessThan() { + return xcreateSSQFunction("<"); + } + + protected SSQFunction xcreateSSQFunction(final String operand) { + return new SSQFunction(new SSQSetupper() { + public void setup(String function, SubQuery subQuery) { + xscalarSubQuery(function, subQuery, operand); + } + }); + } + + protected void xscalarSubQuery(String function, + SubQuery subQuery, String operand) { + assertObjectNotNull("subQuery", subQuery); + RoleInfoCB cb = new RoleInfoCB(); + cb.xsetupForScalarSubQuery(); + subQuery.query(cb); + String subQueryPropertyName = keepScalarSubQuery(cb.query()); // for + // saving + // query + // -value. + registerScalarSubQuery(function, cb.query(), subQueryPropertyName, + operand); + } + + public abstract String keepScalarSubQuery(RoleInfoCQ subQuery); + // Very Internal (for Suppressing Warn about 'Not Use Import') protected String getConditionBeanClassNameInternally() { return RoleInfoCB.class.getName(); Modified: 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 2008-12-27 22:14:41 UTC (rev 1629) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/cq/bs/AbstractBsRoleMappingCQ.java 2008-12-27 22:18:30 UTC (rev 1630) @@ -11,16 +11,13 @@ 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 { //========================================================================== @@ -50,7 +47,8 @@ // ===== /** - * Equal(=). And NullIgnored, OnceRegistered. {PK : ID : NotNull : INTEGER} + * Equal(=). And NullIgnored, OnlyOnceRegistered. {PK : ID : NotNull : + * INTEGER} * * @param id The value of id as equal. */ @@ -59,7 +57,7 @@ } /** - * NotEqual(!=). And NullIgnored, OnceRegistered. + * NotEqual(!=). And NullIgnored, OnlyOnceRegistered. * * @param id The value of id as notEqual. */ @@ -68,7 +66,7 @@ } /** - * GreaterThan(>). And NullIgnored, OnceRegistered. + * GreaterThan(>). And NullIgnored, OnlyOnceRegistered. * * @param id The value of id as greaterThan. */ @@ -77,7 +75,7 @@ } /** - * LessThan(<). And NullIgnored, OnceRegistered. + * LessThan(<). And NullIgnored, OnlyOnceRegistered. * * @param id The value of id as lessThan. */ @@ -86,7 +84,7 @@ } /** - * GreaterEqual(>=). And NullIgnored, OnceRegistered. + * GreaterEqual(>=). And NullIgnored, OnlyOnceRegistered. * * @param id The value of id as greaterEqual. */ @@ -95,7 +93,7 @@ } /** - * LessEqual(<=). And NullIgnored, OnceRegistered. + * LessEqual(<=). And NullIgnored, OnlyOnceRegistered. * * @param id The value of id as lessEqual. */ @@ -124,14 +122,14 @@ } /** - * IsNull(is null). And OnceRegistered. + * IsNull(is null). And OnlyOnceRegistered. */ public void setId_IsNull() { regId(CK_ISN, DUMMY_OBJECT); } /** - * IsNotNull(is not null). And OnceRegistered. + * IsNotNull(is not null). And OnlyOnceRegistered. */ public void setId_IsNotNull() { regId(CK_ISNN, DUMMY_OBJECT); @@ -148,8 +146,8 @@ abstract protected ConditionValue getCValueId(); /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {NotNull : VARCHAR(255) - * : FK to USER_INFO} + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {NotNull : + * VARCHAR(255) : FK to USER_INFO} * * @param userId The value of userId as equal. */ @@ -158,7 +156,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param userId The value of userId as notEqual. */ @@ -167,7 +165,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param userId The value of userId as greaterThan. */ @@ -176,7 +174,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param userId The value of userId as lessThan. */ @@ -185,7 +183,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param userId The value of userId as greaterEqual. */ @@ -194,7 +192,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param userId The value of userId as lessEqual. */ @@ -203,7 +201,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param userId The value of userId as prefixSearch. */ @@ -212,20 +210,6 @@ } /** - * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, - * SeveralRegistered. - * - * @param userId The value of userId as likeSearch. - * @param likeSearchOption The option of like-search. (NotNull) - */ - public void setUserId_LikeSearch( - String userId, - jp.sf.pal.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. * @@ -236,42 +220,41 @@ } /** - * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * - * @param userId The collection of userId as inScope. - * @param inScopeOption The option of in-scope. (NotNull) + * @param userIdList The collection of userId as notInScope. */ - public void setUserId_InScope( - String userId, - jp.sf.pal.scheduler.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(userId), getCValueUserId(), - "USER_ID", "UserId", "userId", inScopeOption); + public void setUserId_NotInScope(Collection userIdList) { + regUserId(CK_NINS, cTL(userIdList)); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param userIdList The collection of userId as notInScope. + * @param userId The value of userId as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) */ - public void setUserId_NotInScope(Collection userIdList) { - regUserId(CK_NINS, cTL(userIdList)); + public void setUserId_LikeSearch( + String userId, + jp.sf.pal.scheduler.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(userId), getCValueUserId(), "USER_ID", "UserId", + "userId", likeSearchOption); } /** - * @param userInfoCBquery Query. - * @deprecated Please use inScopeUserInfo(subQuery) method. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param userId The value of userId as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setUserId_InScopeSubQuery_UserInfo(UserInfoCQ userInfoCBquery) { - String subQueryPropertyName = keepUserId_InScopeSubQuery_UserInfo(userInfoCBquery);// for - // saving - // query - // - - // value - // . - registerInScopeSubQuery(userInfoCBquery, "USER_ID", "USER_ID", - subQueryPropertyName); + public void setUserId_NotLikeSearch( + String userId, + jp.sf.pal.scheduler.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(userId), getCValueUserId(), "USER_ID", "UserId", + "userId", likeSearchOption); } public void inScopeUserInfo(SubQuery subQuery) { @@ -280,12 +263,12 @@ cb.xsetupForInScopeSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepUserId_InScopeSubQuery_UserInfo(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerInScopeSubQuery(cb.query(), "USER_ID", "USER_ID", subQueryPropertyName); } - abstract public String keepUserId_InScopeSubQuery_UserInfo( + public abstract String keepUserId_InScopeSubQuery_UserInfo( jp.sf.pal.scheduler.db.cbean.cq.UserInfoCQ subQuery); protected void regUserId(ConditionKey key, Object value) { @@ -301,8 +284,8 @@ abstract protected ConditionValue getCValueUserId(); /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {NotNull : VARCHAR(255) - * : FK to ROLE_INFO} + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {NotNull : + * VARCHAR(255) : FK to ROLE_INFO} * * @param roleId The value of roleId as equal. */ @@ -311,7 +294,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param roleId The value of roleId as notEqual. */ @@ -320,7 +303,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param roleId The value of roleId as greaterThan. */ @@ -329,7 +312,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param roleId The value of roleId as lessThan. */ @@ -338,7 +321,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param roleId The value of roleId as greaterEqual. */ @@ -347,7 +330,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param roleId The value of roleId as lessEqual. */ @@ -356,7 +339,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param roleId The value of roleId as prefixSearch. */ @@ -365,20 +348,6 @@ } /** - * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, - * SeveralRegistered. - * - * @param roleId The value of roleId as likeSearch. - * @param likeSearchOption The option of like-search. (NotNull) - */ - public void setRoleId_LikeSearch( - String roleId, - jp.sf.pal.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. * @@ -389,42 +358,41 @@ } /** - * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * - * @param roleId The collection of roleId as inScope. - * @param inScopeOption The option of in-scope. (NotNull) + * @param roleIdList The collection of roleId as notInScope. */ - public void setRoleId_InScope( - String roleId, - jp.sf.pal.scheduler.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(roleId), getCValueRoleId(), - "ROLE_ID", "RoleId", "roleId", inScopeOption); + public void setRoleId_NotInScope(Collection roleIdList) { + regRoleId(CK_NINS, cTL(roleIdList)); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param roleIdList The collection of roleId as notInScope. + * @param roleId The value of roleId as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) */ - public void setRoleId_NotInScope(Collection roleIdList) { - regRoleId(CK_NINS, cTL(roleIdList)); + public void setRoleId_LikeSearch( + String roleId, + jp.sf.pal.scheduler.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(roleId), getCValueRoleId(), "ROLE_ID", "RoleId", + "roleId", likeSearchOption); } /** - * @param roleInfoCBquery Query. - * @deprecated Please use inScopeRoleInfo(subQuery) method. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param roleId The value of roleId as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setRoleId_InScopeSubQuery_RoleInfo(RoleInfoCQ roleInfoCBquery) { - String subQueryPropertyName = keepRoleId_InScopeSubQuery_RoleInfo(roleInfoCBquery);// for - // saving - // query - // - - // value - // . - registerInScopeSubQuery(roleInfoCBquery, "ROLE_ID", "ROLE_ID", - subQueryPropertyName); + public void setRoleId_NotLikeSearch( + String roleId, + jp.sf.pal.scheduler.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(roleId), getCValueRoleId(), "ROLE_ID", "RoleId", + "roleId", likeSearchOption); } public void inScopeRoleInfo(SubQuery subQuery) { @@ -433,12 +401,12 @@ cb.xsetupForInScopeSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepRoleId_InScopeSubQuery_RoleInfo(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerInScopeSubQuery(cb.query(), "ROLE_ID", "ROLE_ID", subQueryPropertyName); } - abstract public String keepRoleId_InScopeSubQuery_RoleInfo( + public abstract String keepRoleId_InScopeSubQuery_RoleInfo( jp.sf.pal.scheduler.db.cbean.cq.RoleInfoCQ subQuery); protected void regRoleId(ConditionKey key, Object value) { @@ -453,6 +421,50 @@ abstract protected ConditionValue getCValueRoleId(); + public SSQFunction scalar_Equal() { + return xcreateSSQFunction("="); + } + + public SSQFunction scalar_GreaterEqual() { + return xcreateSSQFunction(">="); + } + + public SSQFunction scalar_GreaterThan() { + return xcreateSSQFunction(">"); + } + + public SSQFunction scalar_LessEqual() { + return xcreateSSQFunction("<="); + } + + public SSQFunction scalar_LessThan() { + return xcreateSSQFunction("<"); + } + + protected SSQFunction xcreateSSQFunction(final String operand) { + return new SSQFunction(new SSQSetupper() { + public void setup(String function, SubQuery subQuery) { + xscalarSubQuery(function, subQuery, operand); + } + }); + } + + protected void xscalarSubQuery(String function, + SubQuery subQuery, String operand) { + assertObjectNotNull("subQuery", subQuery); + RoleMappingCB cb = new RoleMappingCB(); + cb.xsetupForScalarSubQuery(); + subQuery.query(cb); + String subQueryPropertyName = keepScalarSubQuery(cb.query()); // for + // saving + // query + // -value. + registerScalarSubQuery(function, cb.query(), subQueryPropertyName, + operand); + } + + public abstract String keepScalarSubQuery(RoleMappingCQ subQuery); + // Very Internal (for Suppressing Warn about 'Not Use Import') protected String getConditionBeanClassNameInternally() { return RoleMappingCB.class.getName(); Modified: 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 2008-12-27 22:14:41 UTC (rev 1629) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/cq/bs/AbstractBsUserInfoCQ.java 2008-12-27 22:18:30 UTC (rev 1630) @@ -15,9 +15,7 @@ import jp.sf.pal.scheduler.db.cbean.RoleMappingCB; import jp.sf.pal.scheduler.db.cbean.UserInfoCB; import jp.sf.pal.scheduler.db.cbean.cq.EventScheduleMappingCQ; -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.UserInfoCQ; @@ -26,7 +24,6 @@ * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public abstract class AbstractBsUserInfoCQ extends AbstractConditionQuery { //========================================================================== @@ -56,7 +53,7 @@ // ===== /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {PK : NotNull : + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {PK : NotNull : * VARCHAR(255)} * * @param userId The value of userId as equal. @@ -66,7 +63,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param userId The value of userId as notEqual. */ @@ -75,7 +72,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param userId The value of userId as greaterThan. */ @@ -84,7 +81,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param userId The value of userId as lessThan. */ @@ -93,7 +90,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param userId The value of userId as greaterEqual. */ @@ -102,7 +99,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param userId The value of userId as lessEqual. */ @@ -111,7 +108,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param userId The value of userId as prefixSearch. */ @@ -120,20 +117,6 @@ } /** - * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, - * SeveralRegistered. - * - * @param userId The value of userId as likeSearch. - * @param likeSearchOption The option of like-search. (NotNull) - */ - public void setUserId_LikeSearch( - String userId, - jp.sf.pal.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. * @@ -144,43 +127,41 @@ } /** - * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * - * @param userId The collection of userId as inScope. - * @param inScopeOption The option of in-scope. (NotNull) + * @param userIdList The collection of userId as notInScope. */ - public void setUserId_InScope( - String userId, - jp.sf.pal.scheduler.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(userId), getCValueUserId(), - "USER_ID", "UserId", "userId", inScopeOption); + public void setUserId_NotInScope(Collection userIdList) { + regUserId(CK_NINS, cTL(userIdList)); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param userIdList The collection of userId as notInScope. + * @param userId The value of userId as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) */ - public void setUserId_NotInScope(Collection userIdList) { - regUserId(CK_NINS, cTL(userIdList)); + public void setUserId_LikeSearch( + String userId, + jp.sf.pal.scheduler.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(userId), getCValueUserId(), "USER_ID", "UserId", + "userId", likeSearchOption); } /** - * @param eventScheduleMappingCBquery Query. - * @deprecated Please use inScopeEventScheduleMappingList(subQuery) method. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param userId The value of userId as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setUserId_InScopeSubQuery_EventScheduleMappingList( - EventScheduleMappingCQ eventScheduleMappingCBquery) { - String subQueryPropertyName = keepUserId_InScopeSubQuery_EventScheduleMappingList(eventScheduleMappingCBquery);// for - // saving - // query - // - - // value - // . - registerInScopeSubQuery(eventScheduleMappingCBquery, "USER_ID", - "USER_ID", subQueryPropertyName); + public void setUserId_NotLikeSearch( + String userId, + jp.sf.pal.scheduler.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(userId), getCValueUserId(), "USER_ID", "UserId", + "userId", likeSearchOption); } public void inScopeEventScheduleMappingList( @@ -190,72 +171,40 @@ cb.xsetupForInScopeSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepUserId_InScopeSubQuery_EventScheduleMappingList(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerInScopeSubQuery(cb.query(), "USER_ID", "USER_ID", subQueryPropertyName); } - abstract public String keepUserId_InScopeSubQuery_EventScheduleMappingList( + public abstract String keepUserId_InScopeSubQuery_EventScheduleMappingList( EventScheduleMappingCQ subQuery); - /** - * @param groupMappingCBquery Query. - * @deprecated Please use inScopeGroupMappingList(subQuery) method. - */ - public void setUserId_InScopeSubQuery_GroupMappingList( - GroupMappingCQ groupMappingCBquery) { - String subQueryPropertyName = keepUserId_InScopeSubQuery_GroupMappingList(groupMappingCBquery);// for - // saving - // query - // - - // value - // . - registerInScopeSubQuery(groupMappingCBquery, "USER_ID", "USER_ID", - subQueryPropertyName); - } - public void inScopeGroupMappingList(SubQuery subQuery) { assertObjectNotNull("subQuery", subQuery); GroupMappingCB cb = new GroupMappingCB(); cb.xsetupForInScopeSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepUserId_InScopeSubQuery_GroupMappingList(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerInScopeSubQuery(cb.query(), "USER_ID", "USER_ID", subQueryPropertyName); } - abstract public String keepUserId_InScopeSubQuery_GroupMappingList( + public abstract String keepUserId_InScopeSubQuery_GroupMappingList( GroupMappingCQ subQuery); - /** - * @param roleMappingCBquery Query. - * @deprecated Please use inScopeRoleMappingList(subQuery) method. - */ - public void setUserId_InScopeSubQuery_RoleMappingList( - RoleMappingCQ roleMappingCBquery) { - String subQueryPropertyName = keepUserId_InScopeSubQuery_RoleMappingList(roleMappingCBquery);// for - // saving - // query - // - - // value - // . - registerInScopeSubQuery(roleMappingCBquery, "USER_ID", "USER_ID", - subQueryPropertyName); - } - public void inScopeRoleMappingList(SubQuery subQuery) { assertObjectNotNull("subQuery", subQuery); RoleMappingCB cb = new RoleMappingCB(); cb.xsetupForInScopeSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepUserId_InScopeSubQuery_RoleMappingList(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerInScopeSubQuery(cb.query(), "USER_ID", "USER_ID", subQueryPropertyName); } - abstract public String keepUserId_InScopeSubQuery_RoleMappingList( + public abstract String keepUserId_InScopeSubQuery_RoleMappingList( RoleMappingCQ subQuery); public void notInScopeEventScheduleMappingList( @@ -265,12 +214,12 @@ cb.xsetupForInScopeSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepUserId_NotInScopeSubQuery_EventScheduleMappingList(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerNotInScopeSubQuery(cb.query(), "USER_ID", "USER_ID", subQueryPropertyName); } - abstract public String keepUserId_NotInScopeSubQuery_EventScheduleMappingList( + public abstract String keepUserId_NotInScopeSubQuery_EventScheduleMappingList( EventScheduleMappingCQ subQuery); public void notInScopeGroupMappingList(SubQuery subQuery) { @@ -279,12 +228,12 @@ cb.xsetupForInScopeSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepUserId_NotInScopeSubQuery_GroupMappingList(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerNotInScopeSubQuery(cb.query(), "USER_ID", "USER_ID", subQueryPropertyName); } - abstract public String keepUserId_NotInScopeSubQuery_GroupMappingList( + public abstract String keepUserId_NotInScopeSubQuery_GroupMappingList( GroupMappingCQ subQuery); public void notInScopeRoleMappingList(SubQuery subQuery) { @@ -293,31 +242,15 @@ cb.xsetupForInScopeSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepUserId_NotInScopeSubQuery_RoleMappingList(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerNotInScopeSubQuery(cb.query(), "USER_ID", "USER_ID", subQueryPropertyName); } - abstract public String keepUserId_NotInScopeSubQuery_RoleMappingList( + public abstract String keepUserId_NotInScopeSubQuery_RoleMappingList( RoleMappingCQ subQuery); /** - * @param eventScheduleMappingCBquery Query. - * @deprecated Please use existsEventScheduleMappingList(subQuery) method. - */ - public void setUserId_ExistsSubQuery_EventScheduleMappingList( - EventScheduleMappingCQ eventScheduleMappingCBquery) { - String subQueryPropertyName = keepUserId_ExistsSubQuery_EventScheduleMappingList(eventScheduleMappingCBquery);// for - // saving - // query - // - - // value - // . - registerExistsSubQuery(eventScheduleMappingCBquery, "USER_ID", - "USER_ID", subQueryPropertyName); - } - - /** * Set up 'exists' sub-query. {exists (select USER_ID from * EVENT_SCHEDULE_MAPPING where ...)} * @@ -332,31 +265,15 @@ cb.xsetupForExistsSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepUserId_ExistsSubQuery_EventScheduleMappingList(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerExistsSubQuery(cb.query(), "USER_ID", "USER_ID", subQueryPropertyName); } - abstract public String keepUserId_ExistsSubQuery_EventScheduleMappingList( + public abstract String keepUserId_ExistsSubQuery_EventScheduleMappingList( EventScheduleMappingCQ 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 ...)} * @@ -369,31 +286,15 @@ cb.xsetupForExistsSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepUserId_ExistsSubQuery_GroupMappingList(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerExistsSubQuery(cb.query(), "USER_ID", "USER_ID", subQueryPropertyName); } - abstract public String keepUserId_ExistsSubQuery_GroupMappingList( + public abstract String keepUserId_ExistsSubQuery_GroupMappingList( GroupMappingCQ subQuery); /** - * @param roleMappingCBquery Query. - * @deprecated Please use existsRoleMappingList(subQuery) method. - */ - public void setUserId_ExistsSubQuery_RoleMappingList( - RoleMappingCQ roleMappingCBquery) { - String subQueryPropertyName = keepUserId_ExistsSubQuery_RoleMappingList(roleMappingCBquery);// for - // saving - // query - // - - // value - // . - registerExistsSubQuery(roleMappingCBquery, "USER_ID", "USER_ID", - subQueryPropertyName); - } - - /** * Set up 'exists' sub-query. {exists (select USER_ID from ROLE_MAPPING * where ...)} * @@ -406,12 +307,12 @@ cb.xsetupForExistsSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepUserId_ExistsSubQuery_RoleMappingList(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerExistsSubQuery(cb.query(), "USER_ID", "USER_ID", subQueryPropertyName); } - abstract public String keepUserId_ExistsSubQuery_RoleMappingList( + public abstract String keepUserId_ExistsSubQuery_RoleMappingList( RoleMappingCQ subQuery); /** @@ -429,12 +330,12 @@ cb.xsetupForExistsSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepUserId_NotExistsSubQuery_EventScheduleMappingList(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerNotExistsSubQuery(cb.query(), "USER_ID", "USER_ID", subQueryPropertyName); } - abstract public String keepUserId_NotExistsSubQuery_EventScheduleMappingList( + public abstract String keepUserId_NotExistsSubQuery_EventScheduleMappingList( EventScheduleMappingCQ subQuery); /** @@ -451,12 +352,12 @@ cb.xsetupForExistsSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepUserId_NotExistsSubQuery_GroupMappingList(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerNotExistsSubQuery(cb.query(), "USER_ID", "USER_ID", subQueryPropertyName); } - abstract public String keepUserId_NotExistsSubQuery_GroupMappingList( + public abstract String keepUserId_NotExistsSubQuery_GroupMappingList( GroupMappingCQ subQuery); /** @@ -472,68 +373,68 @@ cb.xsetupForExistsSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepUserId_NotExistsSubQuery_RoleMappingList(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerNotExistsSubQuery(cb.query(), "USER_ID", "USER_ID", subQueryPropertyName); } - abstract public String keepUserId_NotExistsSubQuery_RoleMappingList( + public abstract String keepUserId_NotExistsSubQuery_RoleMappingList( RoleMappingCQ subQuery); public void xderiveEventScheduleMappingList(String function, SubQuery subQuery, String aliasName) { assertObjectNotNull("subQuery", subQuery); EventScheduleMappingCB cb = new EventScheduleMappingCB(); - cb.xsetupForDeriveReferrer(); + cb.xsetupForDerivedReferrer(); subQuery.query(cb); - String subQueryPropertyName = keepUserId_DeriveSubQuery_EventScheduleMappingList(cb - .query());// for saving query-value. - registerDeriveSubQuery(function, cb.query(), "USER_ID", "USER_ID", - subQueryPropertyName, aliasName); + String subQueryPropertyName = keepUserId_DerivedReferrer_EventScheduleMappingList(cb + .query()); // for saving query-value. + registerDerivedReferrerSubQuery(function, cb.query(), "USER_ID", + "USER_ID", subQueryPropertyName, aliasName); } - abstract public String keepUserId_DeriveSubQuery_EventScheduleMappingList( + public abstract String keepUserId_DerivedReferrer_EventScheduleMappingList( EventScheduleMappingCQ subQuery); public void xderiveGroupMappingList(String function, SubQuery subQuery, String aliasName) { assertObjectNotNull("subQuery", subQuery); GroupMappingCB cb = new GroupMappingCB(); - cb.xsetupForDeriveReferrer(); + cb.xsetupForDerivedReferrer(); subQuery.query(cb); - String subQueryPropertyName = keepUserId_DeriveSubQuery_GroupMappingList(cb - .query());// for saving query-value. - registerDeriveSubQuery(function, cb.query(), "USER_ID", "USER_ID", - subQueryPropertyName, aliasName); + String subQueryPropertyName = keepUserId_DerivedReferrer_GroupMappingList(cb + .query()); // for saving query-value. + registerDerivedReferrerSubQuery(function, cb.query(), "USER_ID", + "USER_ID", subQueryPropertyName, aliasName); } - abstract public String keepUserId_DeriveSubQuery_GroupMappingList( + public abstract String keepUserId_DerivedReferrer_GroupMappingList( GroupMappingCQ subQuery); public void xderiveRoleMappingList(String function, SubQuery subQuery, String aliasName) { assertObjectNotNull("subQuery", subQuery); RoleMappingCB cb = new RoleMappingCB(); - cb.xsetupForDeriveReferrer(); + cb.xsetupForDerivedReferrer(); subQuery.query(cb); - String subQueryPropertyName = keepUserId_DeriveSubQuery_RoleMappingList(cb - .query());// for saving query-value. - registerDeriveSubQuery(function, cb.query(), "USER_ID", "USER_ID", - subQueryPropertyName, aliasName); + String subQueryPropertyName = keepUserId_DerivedReferrer_RoleMappingList(cb + .query()); // for saving query-value. + registerDerivedReferrerSubQuery(function, cb.query(), "USER_ID", + "USER_ID", subQueryPropertyName, aliasName); } - abstract public String keepUserId_DeriveSubQuery_RoleMappingList( + public abstract String keepUserId_DerivedReferrer_RoleMappingList( RoleMappingCQ subQuery); /** - * IsNull(is null). And OnceRegistered. + * IsNull(is null). And OnlyOnceRegistered. */ public void setUserId_IsNull() { regUserId(CK_ISN, DUMMY_OBJECT); } /** - * IsNotNull(is not null). And OnceRegistered. + * IsNotNull(is not null). And OnlyOnceRegistered. */ public void setUserId_IsNotNull() { regUserId(CK_ISNN, DUMMY_OBJECT); @@ -552,7 +453,7 @@ abstract protected ConditionValue getCValueUserId(); /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {VARCHAR(100)} + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {VARCHAR(100)} * * @param givenName The value of givenName as equal. */ @@ -561,7 +462,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param givenName The value of givenName as notEqual. */ @@ -570,7 +471,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param givenName The value of givenName as greaterThan. */ @@ -579,7 +480,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param givenName The value of givenName as lessThan. */ @@ -588,7 +489,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param givenName The value of givenName as greaterEqual. */ @@ -597,7 +498,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param givenName The value of givenName as lessEqual. */ @@ -606,7 +507,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param givenName The value of givenName as prefixSearch. */ @@ -615,20 +516,6 @@ } /** - * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, - * SeveralRegistered. - * - * @param givenName The value of givenName as likeSearch. - * @param likeSearchOption The option of like-search. (NotNull) - */ - public void setGivenName_LikeSearch( - String givenName, - jp.sf.pal.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. * @@ -639,38 +526,52 @@ } /** - * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * - * @param givenName The collection of givenName as inScope. - * @param inScopeOption The option of in-scope. (NotNull) + * @param givenNameList The collection of givenName as notInScope. */ - public void setGivenName_InScope( + public void setGivenName_NotInScope(Collection givenNameList) { + regGivenName(CK_NINS, cTL(givenNameList)); + } + + /** + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param givenName The value of givenName as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) + */ + public void setGivenName_LikeSearch( String givenName, - jp.sf.pal.scheduler.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(givenName), getCValueGivenName(), - "GIVEN_NAME", "GivenName", "givenName", inScopeOption); + jp.sf.pal.scheduler.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(givenName), getCValueGivenName(), "GIVEN_NAME", + "GivenName", "givenName", likeSearchOption); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param givenNameList The collection of givenName as notInScope. + * @param givenName The value of givenName as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setGivenName_NotInScope(Collection givenNameList) { - regGivenName(CK_NINS, cTL(givenNameList)); + public void setGivenName_NotLikeSearch( + String givenName, + jp.sf.pal.scheduler.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(givenName), getCValueGivenName(), "GIVEN_NAME", + "GivenName", "givenName", likeSearchOption); } /** - * IsNull(is null). And OnceRegistered. + * IsNull(is null). And OnlyOnceRegistered. */ public void setGivenName_IsNull() { regGivenName(CK_ISN, DUMMY_OBJECT); } /** - * IsNotNull(is not null). And OnceRegistered. + * IsNotNull(is not null). And OnlyOnceRegistered. */ public void setGivenName_IsNotNull() { regGivenName(CK_ISNN, DUMMY_OBJECT); @@ -689,7 +590,7 @@ abstract protected ConditionValue getCValueGivenName(); /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {VARCHAR(100)} + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {VARCHAR(100)} * * @param familyName The value of familyName as equal. */ @@ -698,7 +599,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param familyName The value of familyName as notEqual. */ @@ -707,7 +608,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param familyName The value of familyName as greaterThan. */ @@ -716,7 +617,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param familyName The value of familyName as lessThan. */ @@ -725,7 +626,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param familyName The value of familyName as greaterEqual. */ @@ -734,7 +635,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param familyName The value of familyName as lessEqual. */ @@ -743,7 +644,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param familyName The value of familyName as prefixSearch. */ @@ -752,20 +653,6 @@ } /** - * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, - * SeveralRegistered. - * - * @param familyName The value of familyName as likeSearch. - * @param likeSearchOption The option of like-search. (NotNull) - */ - public void setFamilyName_LikeSearch( - String familyName, - jp.sf.pal.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. * @@ -776,38 +663,52 @@ } /** - * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * - * @param familyName The collection of familyName as inScope. - * @param inScopeOption The option of in-scope. (NotNull) + * @param familyNameList The collection of familyName as notInScope. */ - public void setFamilyName_InScope( + public void setFamilyName_NotInScope(Collection familyNameList) { + regFamilyName(CK_NINS, cTL(familyNameList)); + } + + /** + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param familyName The value of familyName as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) + */ + public void setFamilyName_LikeSearch( String familyName, - jp.sf.pal.scheduler.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(familyName), getCValueFamilyName(), - "FAMILY_NAME", "FamilyName", "familyName", inScopeOption); + jp.sf.pal.scheduler.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(familyName), getCValueFamilyName(), "FAMILY_NAME", + "FamilyName", "familyName", likeSearchOption); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param familyNameList The collection of familyName as notInScope. + * @param familyName The value of familyName as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setFamilyName_NotInScope(Collection familyNameList) { - regFamilyName(CK_NINS, cTL(familyNameList)); + public void setFamilyName_NotLikeSearch( + String familyName, + jp.sf.pal.scheduler.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(familyName), getCValueFamilyName(), "FAMILY_NAME", + "FamilyName", "familyName", likeSearchOption); } /** - * IsNull(is null). And OnceRegistered. + * IsNull(is null). And OnlyOnceRegistered. */ public void setFamilyName_IsNull() { regFamilyName(CK_ISN, DUMMY_OBJECT); } /** - * IsNotNull(is not null). And OnceRegistered. + * IsNotNull(is not null). And OnlyOnceRegistered. */ public void setFamilyName_IsNotNull() { regFamilyName(CK_ISNN, DUMMY_OBJECT); @@ -826,7 +727,7 @@ abstract protected ConditionValue getCValueFamilyName(); /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {VARCHAR(50)} + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {VARCHAR(50)} * * @param middleName The value of middleName as equal. */ @@ -835,7 +736,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param middleName The value of middleName as notEqual. */ @@ -844,7 +745,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param middleName The value of middleName as greaterThan. */ @@ -853,7 +754,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param middleName The value of middleName as lessThan. */ @@ -862,7 +763,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param middleName The value of middleName as greaterEqual. */ @@ -871,7 +772,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param middleName The value of middleName as lessEqual. */ @@ -880,7 +781,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param middleName The value of middleName as prefixSearch. */ @@ -889,20 +790,6 @@ } /** - * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, - * SeveralRegistered. - * - * @param middleName The value of middleName as likeSearch. - * @param likeSearchOption The option of like-search. (NotNull) - */ - public void setMiddleName_LikeSearch( - String middleName, - jp.sf.pal.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. * @@ -913,38 +800,52 @@ } /** - * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * - * @param middleName The collection of middleName as inScope. - * @param inScopeOption The option of in-scope. (NotNull) + * @param middleNameList The collection of middleName as notInScope. */ - public void setMiddleName_InScope( + public void setMiddleName_NotInScope(Collection middleNameList) { + regMiddleName(CK_NINS, cTL(middleNameList)); + } + + /** + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param middleName The value of middleName as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) + */ + public void setMiddleName_LikeSearch( String middleName, - jp.sf.pal.scheduler.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(middleName), getCValueMiddleName(), - "MIDDLE_NAME", "MiddleName", "middleName", inScopeOption); + jp.sf.pal.scheduler.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(middleName), getCValueMiddleName(), "MIDDLE_NAME", + "MiddleName", "middleName", likeSearchOption); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param middleNameList The collection of middleName as notInScope. + * @param middleName The value of middleName as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setMiddleName_NotInScope(Collection middleNameList) { - regMiddleName(CK_NINS, cTL(middleNameList)); + public void setMiddleName_NotLikeSearch( + String middleName, + jp.sf.pal.scheduler.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(middleName), getCValueMiddleName(), "MIDDLE_NAME", + "MiddleName", "middleName", likeSearchOption); } /** - * IsNull(is null). And OnceRegistered. + * IsNull(is null). And OnlyOnceRegistered. */ public void setMiddleName_IsNull() { regMiddleName(CK_ISN, DUMMY_OBJECT); } /** - * IsNotNull(is not null). And OnceRegistered. + * IsNotNull(is not null). And OnlyOnceRegistered. */ public void setMiddleName_IsNotNull() { regMiddleName(CK_ISNN, DUMMY_OBJECT); @@ -963,7 +864,7 @@ abstract protected ConditionValue getCValueMiddleName(); /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {VARCHAR(100)} + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {VARCHAR(100)} * * @param givenNameDesc The value of givenNameDesc as equal. */ @@ -972,7 +873,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param givenNameDesc The value of givenNameDesc as notEqual. */ @@ -981,7 +882,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param givenNameDesc The value of givenNameDesc as greaterThan. */ @@ -990,7 +891,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param givenNameDesc The value of givenNameDesc as lessThan. */ @@ -999,7 +900,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param givenNameDesc The value of givenNameDesc as greaterEqual. */ @@ -1008,7 +909,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param givenNameDesc The value of givenNameDesc as lessEqual. */ @@ -1017,7 +918,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param givenNameDesc The value of givenNameDesc as prefixSearch. */ @@ -1026,21 +927,6 @@ } /** - * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, - * SeveralRegistered. - * - * @param givenNameDesc The value of givenNameDesc as likeSearch. - * @param likeSearchOption The option of like-search. (NotNull) - */ - public void setGivenNameDesc_LikeSearch( - String givenNameDesc, - jp.sf.pal.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. * @@ -1051,39 +937,54 @@ } /** - * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * - * @param givenNameDesc The collection of givenNameDesc as inScope. - * @param inScopeOption The option of in-scope. (NotNull) + * @param givenNameDescList The collection of givenNameDesc as notInScope. */ - public void setGivenNameDesc_InScope( + public void setGivenNameDesc_NotInScope(Collection givenNameDescList) { + regGivenNameDesc(CK_NINS, cTL(givenNameDescList)); + } + + /** + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param givenNameDesc The value of givenNameDesc as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) + */ + public void setGivenNameDesc_LikeSearch( String givenNameDesc, - jp.sf.pal.scheduler.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(givenNameDesc), - getCValueGivenNameDesc(), "GIVEN_NAME_DESC", "GivenNameDesc", - "givenNameDesc", inScopeOption); + jp.sf.pal.scheduler.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(givenNameDesc), getCValueGivenNameDesc(), + "GIVEN_NAME_DESC", "GivenNameDesc", "givenNameDesc", + likeSearchOption); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param givenNameDescList The collection of givenNameDesc as notInScope. + * @param givenNameDesc The value of givenNameDesc as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setGivenNameDesc_NotInScope(Collection givenNameDescList) { - regGivenNameDesc(CK_NINS, cTL(givenNameDescList)); + public void setGivenNameDesc_NotLikeSearch( + String givenNameDesc, + jp.sf.pal.scheduler.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(givenNameDesc), getCValueGivenNameDesc(), + "GIVEN_NAME_DESC", "GivenNameDesc", "givenNameDesc", + likeSearchOption); } /** - * IsNull(is null). And OnceRegistered. + * IsNull(is null). And OnlyOnceRegistered. */ public void setGivenNameDesc_IsNull() { regGivenNameDesc(CK_ISN, DUMMY_OBJECT); } /** - * IsNotNull(is not null). And OnceRegistered. + * IsNotNull(is not null). And OnlyOnceRegistered. */ public void setGivenNameDesc_IsNotNull() { regGivenNameDesc(CK_ISNN, DUMMY_OBJECT); @@ -1102,7 +1003,7 @@ abstract protected ConditionValue getCValueGivenNameDesc(); /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {VARCHAR(100)} + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {VARCHAR(100)} * * @param familyNameDesc The value of familyNameDesc as equal. */ @@ -1111,7 +1012,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param familyNameDesc The value of familyNameDesc as notEqual. */ @@ -1120,7 +1021,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param familyNameDesc The value of familyNameDesc as greaterThan. */ @@ -1129,7 +1030,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param familyNameDesc The value of familyNameDesc as lessThan. */ @@ -1138,7 +1039,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param familyNameDesc The value of familyNameDesc as greaterEqual. */ @@ -1147,7 +1048,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param familyNameDesc The value of familyNameDesc as lessEqual. */ @@ -1156,7 +1057,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param familyNameDesc The value of familyNameDesc as prefixSearch. */ @@ -1165,21 +1066,6 @@ } /** - * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, - * SeveralRegistered. - * - * @param familyNameDesc The value of familyNameDesc as likeSearch. - * @param likeSearchOption The option of like-search. (NotNull) - */ - public void setFamilyNameDesc_LikeSearch( - String familyNameDesc, - jp.sf.pal.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. * @@ -1190,40 +1076,55 @@ } /** - * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * - * @param familyNameDesc The collection of familyNameDesc as inScope. - * @param inScopeOption The option of in-scope. (NotNull) + * @param familyNameDescList The collection of familyNameDesc as notInScope. */ - public void setFamilyNameDesc_InScope( + public void setFamilyNameDesc_NotInScope( + Collection familyNameDescList) { + regFamilyNameDesc(CK_NINS, cTL(familyNameDescList)); + } + + /** + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param familyNameDesc The value of familyNameDesc as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) + */ + public void setFamilyNameDesc_LikeSearch( String familyNameDesc, - jp.sf.pal.scheduler.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(familyNameDesc), - getCValueFamilyNameDesc(), "FAMILY_NAME_DESC", - "FamilyNameDesc", "familyNameDesc", inScopeOption); + jp.sf.pal.scheduler.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(familyNameDesc), getCValueFamilyNameDesc(), + "FAMILY_NAME_DESC", "FamilyNameDesc", "familyNameDesc", + likeSearchOption); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param familyNameDescList The collection of familyNameDesc as notInScope. + * @param familyNameDesc The value of familyNameDesc as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setFamilyNameDesc_NotInScope( - Collection familyNameDescList) { - regFamilyNameDesc(CK_NINS, cTL(familyNameDescList)); + public void setFamilyNameDesc_NotLikeSearch( + String familyNameDesc, + jp.sf.pal.scheduler.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(familyNameDesc), getCValueFamilyNameDesc(), + "FAMILY_NAME_DESC", "FamilyNameDesc", "familyNameDesc", + likeSearchOption); } /** - * IsNull(is null). And OnceRegistered. + * IsNull(is null). And OnlyOnceRegistered. */ public void setFamilyNameDesc_IsNull() { regFamilyNameDesc(CK_ISN, DUMMY_OBJECT); } /** - * IsNotNull(is not null). And OnceRegistered. + * IsNotNull(is not null). And OnlyOnceRegistered. */ public void setFamilyNameDesc_IsNotNull() { regFamilyNameDesc(CK_ISNN, DUMMY_OBJECT); @@ -1242,7 +1143,7 @@ abstract protected ConditionValue getCValueFamilyNameDesc(); /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {VARCHAR(100)} + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {VARCHAR(100)} * * @param nickname The value of nickname as equal. */ @@ -1251,7 +1152,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param nickname The value of nickname as notEqual. */ @@ -1260,7 +1161,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param nickname The value of nickname as greaterThan. */ @@ -1269,7 +1170,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param nickname The value of nickname as lessThan. */ @@ -1278,7 +1179,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param nickname The value of nickname as greaterEqual. */ @@ -1287,7 +1188,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param nickname The value of nickname as lessEqual. */ @@ -1296,7 +1197,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param nickname The value of nickname as prefixSearch. */ @@ -1305,20 +1206,6 @@ } /** - * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, - * SeveralRegistered. - * - * @param nickname The value of nickname as likeSearch. - * @param likeSearchOption The option of like-search. (NotNull) - */ - public void setNickname_LikeSearch( - String nickname, - jp.sf.pal.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. * @@ -1329,38 +1216,52 @@ } /** - * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * - * @param nickname The collection of nickname as inScope. - * @param inScopeOption The option of in-scope. (NotNull) + * @param nicknameList The collection of nickname as notInScope. */ - public void setNickname_InScope( + public void setNickname_NotInScope(Collection nicknameList) { + regNickname(CK_NINS, cTL(nicknameList)); + } + + /** + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param nickname The value of nickname as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) + */ + public void setNickname_LikeSearch( String nickname, - jp.sf.pal.scheduler.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(nickname), getCValueNickname(), - "NICKNAME", "Nickname", "nickname", inScopeOption); + jp.sf.pal.scheduler.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(nickname), getCValueNickname(), "NICKNAME", + "Nickname", "nickname", likeSearchOption); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param nicknameList The collection of nickname as notInScope. + * @param nickname The value of nickname as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setNickname_NotInScope(Collection nicknameList) { - regNickname(CK_NINS, cTL(nicknameList)); + public void setNickname_NotLikeSearch( + String nickname, + jp.sf.pal.scheduler.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(nickname), getCValueNickname(), "NICKNAME", + "Nickname", "nickname", likeSearchOption); } /** - * IsNull(is null). And OnceRegistered. + * IsNull(is null). And OnlyOnceRegistered. */ public void setNickname_IsNull() { regNickname(CK_ISN, DUMMY_OBJECT); } /** - * IsNotNull(is not null). And OnceRegistered. + * IsNotNull(is not null). And OnlyOnceRegistered. */ public void setNickname_IsNotNull() { regNickname(CK_ISNN, DUMMY_OBJECT); @@ -1379,7 +1280,7 @@ abstract protected ConditionValue getCValueNickname(); /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {VARCHAR(1)} + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {VARCHAR(1)} * * @param gender The value of gender as equal. */ @@ -1388,7 +1289,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param gender The value of gender as notEqual. */ @@ -1397,7 +1298,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param gender The value of gender as greaterThan. */ @@ -1406,7 +1307,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param gender The value of gender as lessThan. */ @@ -1415,7 +1316,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param gender The value of gender as greaterEqual. */ @@ -1424,7 +1325,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param gender The value of gender as lessEqual. */ @@ -1433,7 +1334,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param gender The value of gender as prefixSearch. */ @@ -1442,20 +1343,6 @@ } /** - * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, - * SeveralRegistered. - * - * @param gender The value of gender as likeSearch. - * @param likeSearchOption The option of like-search. (NotNull) - */ - public void setGender_LikeSearch( - String gender, - jp.sf.pal.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. * @@ -1466,38 +1353,52 @@ } /** - * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * - * @param gender The collection of gender as inScope. - * @param inScopeOption The option of in-scope. (NotNull) + * @param genderList The collection of gender as notInScope. */ - public void setGender_InScope( + public void setGender_NotInScope(Collection genderList) { + regGender(CK_NINS, cTL(genderList)); + } + + /** + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param gender The value of gender as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) + */ + public void setGender_LikeSearch( String gender, - jp.sf.pal.scheduler.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(gender), getCValueGender(), "GENDER", - "Gender", "gender", inScopeOption); + jp.sf.pal.scheduler.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(gender), getCValueGender(), "GENDER", "Gender", + "gender", likeSearchOption); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param genderList The collection of gender as notInScope. + * @param gender The value of gender as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setGender_NotInScope(Collection genderList) { - regGender(CK_NINS, cTL(genderList)); + public void setGender_NotLikeSearch( + String gender, + jp.sf.pal.scheduler.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(gender), getCValueGender(), "GENDER", "Gender", + "gender", likeSearchOption); } /** - * IsNull(is null). And OnceRegistered. + * IsNull(is null). And OnlyOnceRegistered. */ public void setGender_IsNull() { regGender(CK_ISN, DUMMY_OBJECT); } /** - * IsNotNull(is not null). And OnceRegistered. + * IsNotNull(is not null). And OnlyOnceRegistered. */ public void setGender_IsNotNull() { regGender(CK_ISNN, DUMMY_OBJECT); @@ -1516,7 +1417,7 @@ abstract protected ConditionValue getCValueGender(); /** - * Equal(=). And NullIgnored, OnceRegistered. {DATE} + * Equal(=). And NullIgnored, OnlyOnceRegistered. {DATE} * * @param birthDate The value of birthDate as equal. */ @@ -1525,7 +1426,7 @@ } /** - * NotEqual(!=). And NullIgnored, OnceRegistered. + * NotEqual(!=). And NullIgnored, OnlyOnceRegistered. * * @param birthDate The value of birthDate as notEqual. */ @@ -1534,7 +1435,7 @@ } /** - * GreaterThan(>). And NullIgnored, OnceRegistered. + * GreaterThan(>). And NullIgnored, OnlyOnceRegistered. * * @param birthDate The value of birthDate as greaterThan. */ @@ -1543,7 +1444,7 @@ } /** - * LessThan(>). And NullIgnored, OnceRegistered. + * LessThan(>). And NullIgnored, OnlyOnceRegistered. * * @param birthDate The value of birthDate as lessThan. */ @@ -1552,7 +1453,7 @@ } /** - * GreaterEqual(>). And NullIgnored, OnceRegistered. + * GreaterEqual(>). And NullIgnored, OnlyOnceRegistered. * * @param birthDate The value of birthDate as greaterEqual. */ @@ -1561,7 +1462,7 @@ } /** - * LessEqual(>). And NullIgnored, OnceRegistered. + * LessEqual(>). And NullIgnored, OnlyOnceRegistered. * * @param birthDate The value of birthDate as lessEqual. */ @@ -1571,7 +1472,7 @@ /** * FromTo($fromDate <= COLUMN_NAME <= $toDate). And NullIgnored, - * OnceRegistered. {DATE} + * OnlyOnceRegistered. {DATE} * * @param fromDate The from-date of birthDate. (Nullable) * @param toDate The to-date of birthDate. (Nullable) @@ -1587,7 +1488,7 @@ /** * FromTo($fromDate <= COLUMN_NAME < $toDate + 1). And NullIgnored, - * OnceRegistered. {DATE} + * OnlyOnceRegistered. {DATE} * * @param fromDate The from-date of birthDate. (Nullable) * @param toDate The to-date of birthDate. (Nullable) @@ -1601,14 +1502,14 @@ } /** - * IsNull(is null). And OnceRegistered. + * IsNull(is null). And OnlyOnceRegistered. */ public void setBirthDate_IsNull() { regBirthDate(CK_ISN, DUMMY_OBJECT); } /** - * IsNotNull(is not null). And OnceRegistered. + * IsNotNull(is not null). And OnlyOnceRegistered. */ public void setBirthDate_IsNotNull() { regBirthDate(CK_ISNN, DUMMY_OBJECT); @@ -1627,7 +1528,7 @@ abstract protected ConditionValue getCValueBirthDate(); /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {VARCHAR(255)} + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {VARCHAR(255)} * * @param email The value of email as equal. */ @@ -1636,7 +1537,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param email The value of email as notEqual. */ @@ -1645,7 +1546,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param email The value of email as greaterThan. */ @@ -1654,7 +1555,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param email The value of email as lessThan. */ @@ -1663,7 +1564,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param email The value of email as greaterEqual. */ @@ -1672,7 +1573,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param email The value of email as lessEqual. */ @@ -1681,7 +1582,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param email The value of email as prefixSearch. */ @@ -1690,20 +1591,6 @@ } /** - * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, - * SeveralRegistered. - * - * @param email The value of email as likeSearch. - * @param likeSearchOption The option of like-search. (NotNull) - */ - public void setEmail_LikeSearch( - String email, - jp.sf.pal.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. * @@ -1714,38 +1601,52 @@ } /** - * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * - * @param email The collection of email as inScope. - * @param inScopeOption The option of in-scope. (NotNull) + * @param emailList The collection of email as notInScope. */ - public void setEmail_InScope( + public void setEmail_NotInScope(Collection emailList) { + regEmail(CK_NINS, cTL(emailList)); + } + + /** + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param email The value of email as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) + */ + public void setEmail_LikeSearch( String email, - jp.sf.pal.scheduler.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(email), getCValueEmail(), "EMAIL", - "Email", "email", inScopeOption); + jp.sf.pal.scheduler.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(email), getCValueEmail(), "EMAIL", "Email", "email", + likeSearchOption); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param emailList The collection of email as notInScope. + * @param email The value of email as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setEmail_NotInScope(Collection emailList) { - regEmail(CK_NINS, cTL(emailList)); + public void setEmail_NotLikeSearch( + String email, + jp.sf.pal.scheduler.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(email), getCValueEmail(), "EMAIL", "Email", + "email", likeSearchOption); } /** - * IsNull(is null). And OnceRegistered. + * IsNull(is null). And OnlyOnceRegistered. */ public void setEmail_IsNull() { regEmail(CK_ISN, DUMMY_OBJECT); } /** - * IsNotNull(is not null). And OnceRegistered. + * IsNotNull(is not null). And OnlyOnceRegistered. */ public void setEmail_IsNotNull() { regEmail(CK_ISNN, DUMMY_OBJECT); @@ -1763,7 +1664,7 @@ abstract protected ConditionValue getCValueEmail(); /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {VARCHAR(255)} + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {VARCHAR(255)} * * @param url The value of url as equal. */ @@ -1772,7 +1673,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param url The value of url as notEqual. */ @@ -1781,7 +1682,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param url The value of url as greaterThan. */ @@ -1790,7 +1691,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param url The value of url as lessThan. */ @@ -1799,7 +1700,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param url The value of url as greaterEqual. */ @@ -1808,7 +1709,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param url The value of url as lessEqual. */ @@ -1817,7 +1718,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param url The value of url as prefixSearch. */ @@ -1826,20 +1727,6 @@ } /** - * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, - * SeveralRegistered. - * - * @param url The value of url as likeSearch. - * @param likeSearchOption The option of like-search. (NotNull) - */ - public void setUrl_LikeSearch( - String url, - jp.sf.pal.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. * @@ -1850,38 +1737,52 @@ } /** - * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * - * @param url The collection of url as inScope. - * @param inScopeOption The option of in-scope. (NotNull) + * @param urlList The collection of url as notInScope. */ - public void setUrl_InScope( + public void setUrl_NotInScope(Collection urlList) { + regUrl(CK_NINS, cTL(urlList)); + } + + /** + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param url The value of url as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) + */ + public void setUrl_LikeSearch( String url, - jp.sf.pal.scheduler.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(url), getCValueUrl(), "URL", "Url", - "url", inScopeOption); + jp.sf.pal.scheduler.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(url), getCValueUrl(), "URL", "Url", "url", + likeSearchOption); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param urlList The collection of url as notInScope. + * @param url The value of url as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setUrl_NotInScope(Collection urlList) { - regUrl(CK_NINS, cTL(urlList)); + public void setUrl_NotLikeSearch( + String url, + jp.sf.pal.scheduler.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(url), getCValueUrl(), "URL", "Url", "url", + likeSearchOption); } /** - * IsNull(is null). And OnceRegistered. + * IsNull(is null). And OnlyOnceRegistered. */ public void setUrl_IsNull() { regUrl(CK_ISN, DUMMY_OBJECT); } /** - * IsNotNull(is not null). And OnceRegistered. + * IsNotNull(is not null). And OnlyOnceRegistered. */ public void setUrl_IsNotNull() { regUrl(CK_ISNN, DUMMY_OBJECT); @@ -1898,7 +1799,7 @@ abstract protected ConditionValue getCValueUrl(); /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {VARCHAR(40)} + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {VARCHAR(40)} * * @param telephone The value of telephone as equal. */ @@ -1907,7 +1808,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param telephone The value of telephone as notEqual. */ @@ -1916,7 +1817,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param telephone The value of telephone as greaterThan. */ @@ -1925,7 +1826,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param telephone The value of telephone as lessThan. */ @@ -1934,7 +1835,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param telephone The value of telephone as greaterEqual. */ @@ -1943,7 +1844,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param telephone The value of telephone as lessEqual. */ @@ -1952,7 +1853,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param telephone The value of telephone as prefixSearch. */ @@ -1961,20 +1862,6 @@ } /** - * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, - * SeveralRegistered. - * - * @param telephone The value of telephone as likeSearch. - * @param likeSearchOption The option of like-search. (NotNull) - */ - public void setTelephone_LikeSearch( - String telephone, - jp.sf.pal.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. * @@ -1985,38 +1872,52 @@ } /** - * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * - * @param telephone The collection of telephone as inScope. - * @param inScopeOption The option of in-scope. (NotNull) + * @param telephoneList The collection of telephone as notInScope. */ - public void setTelephone_InScope( + public void setTelephone_NotInScope(Collection telephoneList) { + regTelephone(CK_NINS, cTL(telephoneList)); + } + + /** + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param telephone The value of telephone as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) + */ + public void setTelephone_LikeSearch( String telephone, - jp.sf.pal.scheduler.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(telephone), getCValueTelephone(), - "TELEPHONE", "Telephone", "telephone", inScopeOption); + jp.sf.pal.scheduler.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(telephone), getCValueTelephone(), "TELEPHONE", + "Telephone", "telephone", likeSearchOption); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param telephoneList The collection of telephone as notInScope. + * @param telephone The value of telephone as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setTelephone_NotInScope(Collection telephoneList) { - regTelephone(CK_NINS, cTL(telephoneList)); + public void setTelephone_NotLikeSearch( + String telephone, + jp.sf.pal.scheduler.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(telephone), getCValueTelephone(), "TELEPHONE", + "Telephone", "telephone", likeSearchOption); } /** - * IsNull(is null). And OnceRegistered. + * IsNull(is null). And OnlyOnceRegistered. */ public void setTelephone_IsNull() { regTelephone(CK_ISN, DUMMY_OBJECT); } /** - * IsNotNull(is not null). And OnceRegistered. + * IsNotNull(is not null). And OnlyOnceRegistered. */ public void setTelephone_IsNotNull() { regTelephone(CK_ISNN, DUMMY_OBJECT); @@ -2035,7 +1936,7 @@ abstract protected ConditionValue getCValueTelephone(); /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {VARCHAR(5)} + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {VARCHAR(5)} * * @param locale The value of locale as equal. */ @@ -2044,7 +1945,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param locale The value of locale as notEqual. */ @@ -2053,7 +1954,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param locale The value of locale as greaterThan. */ @@ -2062,7 +1963,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param locale The value of locale as lessThan. */ @@ -2071,7 +1972,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param locale The value of locale as greaterEqual. */ @@ -2080,7 +1981,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param locale The value of locale as lessEqual. */ @@ -2089,7 +1990,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param locale The value of locale as prefixSearch. */ @@ -2098,20 +1999,6 @@ } /** - * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, - * SeveralRegistered. - * - * @param locale The value of locale as likeSearch. - * @param likeSearchOption The option of like-search. (NotNull) - */ - public void setLocale_LikeSearch( - String locale, - jp.sf.pal.scheduler.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { - registerLikeSearchQuery(CK_LS, fRES(locale), getCValueLocale(), - "LOCALE", "Locale", "locale", likeSearchOption); - } - - /** * InScope(in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * @@ -2122,38 +2009,52 @@ } /** - * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * - * @param locale The collection of locale as inScope. - * @param inScopeOption The option of in-scope. (NotNull) + * @param localeList The collection of locale as notInScope. */ - public void setLocale_InScope( + public void setLocale_NotInScope(Collection localeList) { + regLocale(CK_NINS, cTL(localeList)); + } + + /** + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param locale The value of locale as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) + */ + public void setLocale_LikeSearch( String locale, - jp.sf.pal.scheduler.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(locale), getCValueLocale(), "LOCALE", - "Locale", "locale", inScopeOption); + jp.sf.pal.scheduler.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(locale), getCValueLocale(), "LOCALE", "Locale", + "locale", likeSearchOption); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param localeList The collection of locale as notInScope. + * @param locale The value of locale as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setLocale_NotInScope(Collection localeList) { - regLocale(CK_NINS, cTL(localeList)); + public void setLocale_NotLikeSearch( + String locale, + jp.sf.pal.scheduler.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(locale), getCValueLocale(), "LOCALE", "Locale", + "locale", likeSearchOption); } /** - * IsNull(is null). And OnceRegistered. + * IsNull(is null). And OnlyOnceRegistered. */ public void setLocale_IsNull() { regLocale(CK_ISN, DUMMY_OBJECT); } /** - * IsNotNull(is not null). And OnceRegistered. + * IsNotNull(is not null). And OnlyOnceRegistered. */ public void setLocale_IsNotNull() { regLocale(CK_ISNN, DUMMY_OBJECT); @@ -2172,8 +2073,8 @@ abstract protected ConditionValue getCValueLocale(); /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {VARCHAR(255) : FK to - * ROLE_INFO} + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {VARCHAR(255) : FK + * to ROLE_INFO} * * @param roleId The value of roleId as equal. */ @@ -2182,7 +2083,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param roleId The value of roleId as notEqual. */ @@ -2191,7 +2092,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param roleId The value of roleId as greaterThan. */ @@ -2200,7 +2101,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param roleId The value of roleId as lessThan. */ @@ -2209,7 +2110,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param roleId The value of roleId as greaterEqual. */ @@ -2218,7 +2119,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param roleId The value of roleId as lessEqual. */ @@ -2227,7 +2128,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param roleId The value of roleId as prefixSearch. */ @@ -2236,20 +2137,6 @@ } /** - * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, - * SeveralRegistered. - * - * @param roleId The value of roleId as likeSearch. - * @param likeSearchOption The option of like-search. (NotNull) - */ - public void setRoleId_LikeSearch( - String roleId, - jp.sf.pal.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. * @@ -2260,42 +2147,41 @@ } /** - * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * - * @param roleId The collection of roleId as inScope. - * @param inScopeOption The option of in-scope. (NotNull) + * @param roleIdList The collection of roleId as notInScope. */ - public void setRoleId_InScope( - String roleId, - jp.sf.pal.scheduler.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(roleId), getCValueRoleId(), - "ROLE_ID", "RoleId", "roleId", inScopeOption); + public void setRoleId_NotInScope(Collection roleIdList) { + regRoleId(CK_NINS, cTL(roleIdList)); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param roleIdList The collection of roleId as notInScope. + * @param roleId The value of roleId as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) */ - public void setRoleId_NotInScope(Collection roleIdList) { - regRoleId(CK_NINS, cTL(roleIdList)); + public void setRoleId_LikeSearch( + String roleId, + jp.sf.pal.scheduler.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(roleId), getCValueRoleId(), "ROLE_ID", "RoleId", + "roleId", likeSearchOption); } /** - * @param roleInfoCBquery Query. - * @deprecated Please use inScopeRoleInfo(subQuery) method. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param roleId The value of roleId as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setRoleId_InScopeSubQuery_RoleInfo(RoleInfoCQ roleInfoCBquery) { - String subQueryPropertyName = keepRoleId_InScopeSubQuery_RoleInfo(roleInfoCBquery);// for - // saving - // query - // - - // value - // . - registerInScopeSubQuery(roleInfoCBquery, "ROLE_ID", "ROLE_ID", - subQueryPropertyName); + public void setRoleId_NotLikeSearch( + String roleId, + jp.sf.pal.scheduler.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(roleId), getCValueRoleId(), "ROLE_ID", "RoleId", + "roleId", likeSearchOption); } public void inScopeRoleInfo(SubQuery subQuery) { @@ -2304,23 +2190,23 @@ cb.xsetupForInScopeSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepRoleId_InScopeSubQuery_RoleInfo(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerInScopeSubQuery(cb.query(), "ROLE_ID", "ROLE_ID", subQueryPropertyName); } - abstract public String keepRoleId_InScopeSubQuery_RoleInfo( + public abstract String keepRoleId_InScopeSubQuery_RoleInfo( jp.sf.pal.scheduler.db.cbean.cq.RoleInfoCQ subQuery); /** - * IsNull(is null). And OnceRegistered. + * IsNull(is null). And OnlyOnceRegistered. */ public void setRoleId_IsNull() { regRoleId(CK_ISN, DUMMY_OBJECT); } /** - * IsNotNull(is not null). And OnceRegistered. + * IsNotNull(is not null). And OnlyOnceRegistered. */ public void setRoleId_IsNotNull() { regRoleId(CK_ISNN, DUMMY_OBJECT); @@ -2339,8 +2225,8 @@ abstract protected ConditionValue getCValueRoleId(); /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {VARCHAR(255) : FK to - * GROUP_INFO} + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {VARCHAR(255) : FK + * to GROUP_INFO} * * @param groupId The value of groupId as equal. */ @@ -2349,7 +2235,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param groupId The value of groupId as notEqual. */ @@ -2358,7 +2244,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param groupId The value of groupId as greaterThan. */ @@ -2367,7 +2253,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param groupId The value of groupId as lessThan. */ @@ -2376,7 +2262,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param groupId The value of groupId as greaterEqual. */ @@ -2385,7 +2271,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param groupId The value of groupId as lessEqual. */ @@ -2394,7 +2280,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param groupId The value of groupId as prefixSearch. */ @@ -2403,20 +2289,6 @@ } /** - * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, - * SeveralRegistered. - * - * @param groupId The value of groupId as likeSearch. - * @param likeSearchOption The option of like-search. (NotNull) - */ - public void setGroupId_LikeSearch( - String groupId, - jp.sf.pal.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. * @@ -2427,43 +2299,41 @@ } /** - * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * - * @param groupId The collection of groupId as inScope. - * @param inScopeOption The option of in-scope. (NotNull) + * @param groupIdList The collection of groupId as notInScope. */ - public void setGroupId_InScope( - String groupId, - jp.sf.pal.scheduler.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(groupId), getCValueGroupId(), - "GROUP_ID", "GroupId", "groupId", inScopeOption); + public void setGroupId_NotInScope(Collection groupIdList) { + regGroupId(CK_NINS, cTL(groupIdList)); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param groupIdList The collection of groupId as notInScope. + * @param groupId The value of groupId as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) */ - public void setGroupId_NotInScope(Collection groupIdList) { - regGroupId(CK_NINS, cTL(groupIdList)); + public void setGroupId_LikeSearch( + String groupId, + jp.sf.pal.scheduler.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(groupId), getCValueGroupId(), "GROUP_ID", "GroupId", + "groupId", likeSearchOption); } /** - * @param groupInfoCBquery Query. - * @deprecated Please use inScopeGroupInfo(subQuery) method. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param groupId The value of groupId as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setGroupId_InScopeSubQuery_GroupInfo( - GroupInfoCQ groupInfoCBquery) { - String subQueryPropertyName = keepGroupId_InScopeSubQuery_GroupInfo(groupInfoCBquery);// for - // saving - // query - // - - // value - // . - registerInScopeSubQuery(groupInfoCBquery, "GROUP_ID", "GROUP_ID", - subQueryPropertyName); + public void setGroupId_NotLikeSearch( + String groupId, + jp.sf.pal.scheduler.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(groupId), getCValueGroupId(), "GROUP_ID", + "GroupId", "groupId", likeSearchOption); } public void inScopeGroupInfo(SubQuery subQuery) { @@ -2472,23 +2342,23 @@ cb.xsetupForInScopeSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepGroupId_InScopeSubQuery_GroupInfo(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerInScopeSubQuery(cb.query(), "GROUP_ID", "GROUP_ID", subQueryPropertyName); } - abstract public String keepGroupId_InScopeSubQuery_GroupInfo( + public abstract String keepGroupId_InScopeSubQuery_GroupInfo( jp.sf.pal.scheduler.db.cbean.cq.GroupInfoCQ subQuery); /** - * IsNull(is null). And OnceRegistered. + * IsNull(is null). And OnlyOnceRegistered. */ public void setGroupId_IsNull() { regGroupId(CK_ISN, DUMMY_OBJECT); } /** - * IsNotNull(is not null). And OnceRegistered. + * IsNotNull(is not null). And OnlyOnceRegistered. */ public void setGroupId_IsNotNull() { regGroupId(CK_ISNN, DUMMY_OBJECT); @@ -2507,8 +2377,145 @@ abstract protected ConditionValue getCValueGroupId(); /** - * Equal(=). And NullIgnored, OnceRegistered. {NotNull : TIMESTAMP} + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {VARCHAR(1)} * + * @param status The value of status as equal. + */ + public void setStatus_Equal(String status) { + regStatus(CK_EQ, fRES(status)); + } + + /** + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. + * + * @param status The value of status as notEqual. + */ + public void setStatus_NotEqual(String status) { + regStatus(CK_NE, fRES(status)); + } + + /** + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. + * + * @param status The value of status as greaterThan. + */ + public void setStatus_GreaterThan(String status) { + regStatus(CK_GT, fRES(status)); + } + + /** + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. + * + * @param status The value of status as lessThan. + */ + public void setStatus_LessThan(String status) { + regStatus(CK_LT, fRES(status)); + } + + /** + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. + * + * @param status The value of status as greaterEqual. + */ + public void setStatus_GreaterEqual(String status) { + regStatus(CK_GE, fRES(status)); + } + + /** + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. + * + * @param status The value of status as lessEqual. + */ + public void setStatus_LessEqual(String status) { + regStatus(CK_LE, fRES(status)); + } + + /** + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. + * + * @param status The value of status as prefixSearch. + */ + public void setStatus_PrefixSearch(String status) { + regStatus(CK_PS, fRES(status)); + } + + /** + * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NullOrEmptyElementIgnored, SeveralRegistered. + * + * @param statusList The collection of status as inScope. + */ + public void setStatus_InScope(Collection statusList) { + regStatus(CK_INS, cTL(statusList)); + } + + /** + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, + * NullOrEmptyElementIgnored, SeveralRegistered. + * + * @param statusList The collection of status as notInScope. + */ + public void setStatus_NotInScope(Collection statusList) { + regStatus(CK_NINS, cTL(statusList)); + } + + /** + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param status The value of status as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) + */ + public void setStatus_LikeSearch( + String status, + jp.sf.pal.scheduler.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(status), getCValueStatus(), "STATUS", "Status", + "status", likeSearchOption); + } + + /** + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param status The value of status as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) + */ + public void setStatus_NotLikeSearch( + String status, + jp.sf.pal.scheduler.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(status), getCValueStatus(), "STATUS", "Status", + "status", likeSearchOption); + } + + /** + * IsNull(is null). And OnlyOnceRegistered. + */ + public void setStatus_IsNull() { + regStatus(CK_ISN, DUMMY_OBJECT); + } + + /** + * IsNotNull(is not null). And OnlyOnceRegistered. + */ + public void setStatus_IsNotNull() { + regStatus(CK_ISNN, DUMMY_OBJECT); + } + + protected void regStatus(ConditionKey key, Object value) { + registerQuery(key, value, getCValueStatus(), "STATUS", "Status", + "status"); + } + + protected void registerInlineStatus(ConditionKey key, Object value) { + registerInlineQuery(key, value, getCValueStatus(), "STATUS", "Status", + "status"); + } + + abstract protected ConditionValue getCValueStatus(); + + /** + * Equal(=). And NullIgnored, OnlyOnceRegistered. {NotNull : TIMESTAMP} + * * @param createdTime The value of createdTime as equal. */ public void setCreatedTime_Equal(java.sql.Timestamp createdTime) { @@ -2516,7 +2523,7 @@ } /** - * NotEqual(!=). And NullIgnored, OnceRegistered. + * NotEqual(!=). And NullIgnored, OnlyOnceRegistered. * * @param createdTime The value of createdTime as notEqual. */ @@ -2525,7 +2532,7 @@ } /** - * GreaterThan(>). And NullIgnored, OnceRegistered. + * GreaterThan(>). And NullIgnored, OnlyOnceRegistered. * * @param createdTime The value of createdTime as greaterThan. */ @@ -2534,7 +2541,7 @@ } /** - * LessThan(>). And NullIgnored, OnceRegistered. + * LessThan(>). And NullIgnored, OnlyOnceRegistered. * * @param createdTime The value of createdTime as lessThan. */ @@ -2543,7 +2550,7 @@ } /** - * GreaterEqual(>). And NullIgnored, OnceRegistered. + * GreaterEqual(>). And NullIgnored, OnlyOnceRegistered. * * @param createdTime The value of createdTime as greaterEqual. */ @@ -2552,7 +2559,7 @@ } /** - * LessEqual(>). And NullIgnored, OnceRegistered. + * LessEqual(>). And NullIgnored, OnlyOnceRegistered. * * @param createdTime The value of createdTime as lessEqual. */ @@ -2562,7 +2569,7 @@ /** * FromTo($fromDate <= COLUMN_NAME <= $toDate). And NullIgnored, - * OnceRegistered. {NotNull : TIMESTAMP} + * OnlyOnceRegistered. {NotNull : TIMESTAMP} * * @param fromDate The from-date of createdTime. (Nullable) * @param toDate The to-date of createdTime. (Nullable) @@ -2580,7 +2587,7 @@ /** * FromTo($fromDate <= COLUMN_NAME < $toDate + 1). And NullIgnored, - * OnceRegistered. {NotNull : TIMESTAMP} + * OnlyOnceRegistered. {NotNull : TIMESTAMP} * * @param fromDate The from-date of createdTime. (Nullable) * @param toDate The to-date of createdTime. (Nullable) @@ -2606,7 +2613,7 @@ abstract protected ConditionValue getCValueCreatedTime(); /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {NotNull : + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {NotNull : * VARCHAR(255)} * * @param createdBy The value of createdBy as equal. @@ -2616,7 +2623,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param createdBy The value of createdBy as notEqual. */ @@ -2625,7 +2632,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param createdBy The value of createdBy as greaterThan. */ @@ -2634,7 +2641,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param createdBy The value of createdBy as lessThan. */ @@ -2643,7 +2650,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param createdBy The value of createdBy as greaterEqual. */ @@ -2652,7 +2659,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param createdBy The value of createdBy as lessEqual. */ @@ -2661,7 +2668,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param createdBy The value of createdBy as prefixSearch. */ @@ -2670,20 +2677,6 @@ } /** - * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, - * SeveralRegistered. - * - * @param createdBy The value of createdBy as likeSearch. - * @param likeSearchOption The option of like-search. (NotNull) - */ - public void setCreatedBy_LikeSearch( - String createdBy, - jp.sf.pal.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. * @@ -2694,27 +2687,41 @@ } /** - * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * - * @param createdBy The collection of createdBy as inScope. - * @param inScopeOption The option of in-scope. (NotNull) + * @param createdByList The collection of createdBy as notInScope. */ - public void setCreatedBy_InScope( + public void setCreatedBy_NotInScope(Collection createdByList) { + regCreatedBy(CK_NINS, cTL(createdByList)); + } + + /** + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param createdBy The value of createdBy as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) + */ + public void setCreatedBy_LikeSearch( String createdBy, - jp.sf.pal.scheduler.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(createdBy), getCValueCreatedBy(), - "CREATED_BY", "CreatedBy", "createdBy", inScopeOption); + jp.sf.pal.scheduler.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(createdBy), getCValueCreatedBy(), "CREATED_BY", + "CreatedBy", "createdBy", likeSearchOption); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param createdByList The collection of createdBy as notInScope. + * @param createdBy The value of createdBy as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setCreatedBy_NotInScope(Collection createdByList) { - regCreatedBy(CK_NINS, cTL(createdByList)); + public void setCreatedBy_NotLikeSearch( + String createdBy, + jp.sf.pal.scheduler.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(createdBy), getCValueCreatedBy(), "CREATED_BY", + "CreatedBy", "createdBy", likeSearchOption); } protected void regCreatedBy(ConditionKey key, Object value) { @@ -2730,7 +2737,7 @@ abstract protected ConditionValue getCValueCreatedBy(); /** - * Equal(=). And NullIgnored, OnceRegistered. {NotNull : TIMESTAMP} + * Equal(=). And NullIgnored, OnlyOnceRegistered. {NotNull : TIMESTAMP} * * @param updatedTime The value of updatedTime as equal. */ @@ -2739,7 +2746,7 @@ } /** - * NotEqual(!=). And NullIgnored, OnceRegistered. + * NotEqual(!=). And NullIgnored, OnlyOnceRegistered. * * @param updatedTime The value of updatedTime as notEqual. */ @@ -2748,7 +2755,7 @@ } /** - * GreaterThan(>). And NullIgnored, OnceRegistered. + * GreaterThan(>). And NullIgnored, OnlyOnceRegistered. * * @param updatedTime The value of updatedTime as greaterThan. */ @@ -2757,7 +2764,7 @@ } /** - * LessThan(>). And NullIgnored, OnceRegistered. + * LessThan(>). And NullIgnored, OnlyOnceRegistered. * * @param updatedTime The value of updatedTime as lessThan. */ @@ -2766,7 +2773,7 @@ } /** - * GreaterEqual(>). And NullIgnored, OnceRegistered. + * GreaterEqual(>). And NullIgnored, OnlyOnceRegistered. * * @param updatedTime The value of updatedTime as greaterEqual. */ @@ -2775,7 +2782,7 @@ } /** - * LessEqual(>). And NullIgnored, OnceRegistered. + * LessEqual(>). And NullIgnored, OnlyOnceRegistered. * * @param updatedTime The value of updatedTime as lessEqual. */ @@ -2785,7 +2792,7 @@ /** * FromTo($fromDate <= COLUMN_NAME <= $toDate). And NullIgnored, - * OnceRegistered. {NotNull : TIMESTAMP} + * OnlyOnceRegistered. {NotNull : TIMESTAMP} * * @param fromDate The from-date of updatedTime. (Nullable) * @param toDate The to-date of updatedTime. (Nullable) @@ -2803,7 +2810,7 @@ /** * FromTo($fromDate <= COLUMN_NAME < $toDate + 1). And NullIgnored, - * OnceRegistered. {NotNull : TIMESTAMP} + * OnlyOnceRegistered. {NotNull : TIMESTAMP} * * @param fromDate The from-date of updatedTime. (Nullable) * @param toDate The to-date of updatedTime. (Nullable) @@ -2829,7 +2836,7 @@ abstract protected ConditionValue getCValueUpdatedTime(); /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {NotNull : + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {NotNull : * VARCHAR(255)} * * @param updatedBy The value of updatedBy as equal. @@ -2839,7 +2846,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param updatedBy The value of updatedBy as notEqual. */ @@ -2848,7 +2855,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param updatedBy The value of updatedBy as greaterThan. */ @@ -2857,7 +2864,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param updatedBy The value of updatedBy as lessThan. */ @@ -2866,7 +2873,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param updatedBy The value of updatedBy as greaterEqual. */ @@ -2875,7 +2882,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param updatedBy The value of updatedBy as lessEqual. */ @@ -2884,7 +2891,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param updatedBy The value of updatedBy as prefixSearch. */ @@ -2893,20 +2900,6 @@ } /** - * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, - * SeveralRegistered. - * - * @param updatedBy The value of updatedBy as likeSearch. - * @param likeSearchOption The option of like-search. (NotNull) - */ - public void setUpdatedBy_LikeSearch( - String updatedBy, - jp.sf.pal.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. * @@ -2917,27 +2910,41 @@ } /** - * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * - * @param updatedBy The collection of updatedBy as inScope. - * @param inScopeOption The option of in-scope. (NotNull) + * @param updatedByList The collection of updatedBy as notInScope. */ - public void setUpdatedBy_InScope( + public void setUpdatedBy_NotInScope(Collection updatedByList) { + regUpdatedBy(CK_NINS, cTL(updatedByList)); + } + + /** + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param updatedBy The value of updatedBy as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) + */ + public void setUpdatedBy_LikeSearch( String updatedBy, - jp.sf.pal.scheduler.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(updatedBy), getCValueUpdatedBy(), - "UPDATED_BY", "UpdatedBy", "updatedBy", inScopeOption); + jp.sf.pal.scheduler.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(updatedBy), getCValueUpdatedBy(), "UPDATED_BY", + "UpdatedBy", "updatedBy", likeSearchOption); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param updatedByList The collection of updatedBy as notInScope. + * @param updatedBy The value of updatedBy as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setUpdatedBy_NotInScope(Collection updatedByList) { - regUpdatedBy(CK_NINS, cTL(updatedByList)); + public void setUpdatedBy_NotLikeSearch( + String updatedBy, + jp.sf.pal.scheduler.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(updatedBy), getCValueUpdatedBy(), "UPDATED_BY", + "UpdatedBy", "updatedBy", likeSearchOption); } protected void regUpdatedBy(ConditionKey key, Object value) { @@ -2953,7 +2960,7 @@ abstract protected ConditionValue getCValueUpdatedBy(); /** - * Equal(=). And NullIgnored, OnceRegistered. {TIMESTAMP} + * Equal(=). And NullIgnored, OnlyOnceRegistered. {TIMESTAMP} * * @param deletedTime The value of deletedTime as equal. */ @@ -2962,7 +2969,7 @@ } /** - * NotEqual(!=). And NullIgnored, OnceRegistered. + * NotEqual(!=). And NullIgnored, OnlyOnceRegistered. * * @param deletedTime The value of deletedTime as notEqual. */ @@ -2971,7 +2978,7 @@ } /** - * GreaterThan(>). And NullIgnored, OnceRegistered. + * GreaterThan(>). And NullIgnored, OnlyOnceRegistered. * * @param deletedTime The value of deletedTime as greaterThan. */ @@ -2980,7 +2987,7 @@ } /** - * LessThan(>). And NullIgnored, OnceRegistered. + * LessThan(>). And NullIgnored, OnlyOnceRegistered. * * @param deletedTime The value of deletedTime as lessThan. */ @@ -2989,7 +2996,7 @@ } /** - * GreaterEqual(>). And NullIgnored, OnceRegistered. + * GreaterEqual(>). And NullIgnored, OnlyOnceRegistered. * * @param deletedTime The value of deletedTime as greaterEqual. */ @@ -2998,7 +3005,7 @@ } /** - * LessEqual(>). And NullIgnored, OnceRegistered. + * LessEqual(>). And NullIgnored, OnlyOnceRegistered. * * @param deletedTime The value of deletedTime as lessEqual. */ @@ -3008,7 +3015,7 @@ /** * FromTo($fromDate <= COLUMN_NAME <= $toDate). And NullIgnored, - * OnceRegistered. {TIMESTAMP} + * OnlyOnceRegistered. {TIMESTAMP} * * @param fromDate The from-date of deletedTime. (Nullable) * @param toDate The to-date of deletedTime. (Nullable) @@ -3026,7 +3033,7 @@ /** * FromTo($fromDate <= COLUMN_NAME < $toDate + 1). And NullIgnored, - * OnceRegistered. {TIMESTAMP} + * OnlyOnceRegistered. {TIMESTAMP} * * @param fromDate The from-date of deletedTime. (Nullable) * @param toDate The to-date of deletedTime. (Nullable) @@ -3040,14 +3047,14 @@ } /** - * IsNull(is null). And OnceRegistered. + * IsNull(is null). And OnlyOnceRegistered. */ public void setDeletedTime_IsNull() { regDeletedTime(CK_ISN, DUMMY_OBJECT); } /** - * IsNotNull(is not null). And OnceRegistered. + * IsNotNull(is not null). And OnlyOnceRegistered. */ public void setDeletedTime_IsNotNull() { regDeletedTime(CK_ISNN, DUMMY_OBJECT); @@ -3066,7 +3073,7 @@ abstract protected ConditionValue getCValueDeletedTime(); /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {VARCHAR(255)} + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {VARCHAR(255)} * * @param deletedBy The value of deletedBy as equal. */ @@ -3075,7 +3082,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param deletedBy The value of deletedBy as notEqual. */ @@ -3084,7 +3091,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param deletedBy The value of deletedBy as greaterThan. */ @@ -3093,7 +3100,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param deletedBy The value of deletedBy as lessThan. */ @@ -3102,7 +3109,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param deletedBy The value of deletedBy as greaterEqual. */ @@ -3111,7 +3118,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param deletedBy The value of deletedBy as lessEqual. */ @@ -3120,7 +3127,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param deletedBy The value of deletedBy as prefixSearch. */ @@ -3129,20 +3136,6 @@ } /** - * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, - * SeveralRegistered. - * - * @param deletedBy The value of deletedBy as likeSearch. - * @param likeSearchOption The option of like-search. (NotNull) - */ - public void setDeletedBy_LikeSearch( - String deletedBy, - jp.sf.pal.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. * @@ -3153,38 +3146,52 @@ } /** - * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * - * @param deletedBy The collection of deletedBy as inScope. - * @param inScopeOption The option of in-scope. (NotNull) + * @param deletedByList The collection of deletedBy as notInScope. */ - public void setDeletedBy_InScope( + public void setDeletedBy_NotInScope(Collection deletedByList) { + regDeletedBy(CK_NINS, cTL(deletedByList)); + } + + /** + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param deletedBy The value of deletedBy as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) + */ + public void setDeletedBy_LikeSearch( String deletedBy, - jp.sf.pal.scheduler.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(deletedBy), getCValueDeletedBy(), - "DELETED_BY", "DeletedBy", "deletedBy", inScopeOption); + jp.sf.pal.scheduler.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(deletedBy), getCValueDeletedBy(), "DELETED_BY", + "DeletedBy", "deletedBy", likeSearchOption); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param deletedByList The collection of deletedBy as notInScope. + * @param deletedBy The value of deletedBy as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setDeletedBy_NotInScope(Collection deletedByList) { - regDeletedBy(CK_NINS, cTL(deletedByList)); + public void setDeletedBy_NotLikeSearch( + String deletedBy, + jp.sf.pal.scheduler.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(deletedBy), getCValueDeletedBy(), "DELETED_BY", + "DeletedBy", "deletedBy", likeSearchOption); } /** - * IsNull(is null). And OnceRegistered. + * IsNull(is null). And OnlyOnceRegistered. */ public void setDeletedBy_IsNull() { regDeletedBy(CK_ISN, DUMMY_OBJECT); } /** - * IsNotNull(is not null). And OnceRegistered. + * IsNotNull(is not null). And OnlyOnceRegistered. */ public void setDeletedBy_IsNotNull() { regDeletedBy(CK_ISNN, DUMMY_OBJECT); @@ -3203,7 +3210,7 @@ abstract protected ConditionValue getCValueDeletedBy(); /** - * Equal(=). And NullIgnored, OnceRegistered. {NotNull : INTEGER} + * Equal(=). And NullIgnored, OnlyOnceRegistered. {NotNull : INTEGER} * * @param versionno The value of versionno as equal. */ @@ -3212,7 +3219,7 @@ } /** - * NotEqual(!=). And NullIgnored, OnceRegistered. + * NotEqual(!=). And NullIgnored, OnlyOnceRegistered. * * @param versionno The value of versionno as notEqual. */ @@ -3221,7 +3228,7 @@ } /** - * GreaterThan(>). And NullIgnored, OnceRegistered. + * GreaterThan(>). And NullIgnored, OnlyOnceRegistered. * * @param versionno The value of versionno as greaterThan. */ @@ -3230,7 +3237,7 @@ } /** - * LessThan(<). And NullIgnored, OnceRegistered. + * LessThan(<). And NullIgnored, OnlyOnceRegistered. * * @param versionno The value of versionno as lessThan. */ @@ -3239,7 +3246,7 @@ } /** - * GreaterEqual(>=). And NullIgnored, OnceRegistered. + * GreaterEqual(>=). And NullIgnored, OnlyOnceRegistered. * * @param versionno The value of versionno as greaterEqual. */ @@ -3248,7 +3255,7 @@ } /** - * LessEqual(<=). And NullIgnored, OnceRegistered. + * LessEqual(<=). And NullIgnored, OnlyOnceRegistered. * * @param versionno The value of versionno as lessEqual. */ @@ -3288,6 +3295,50 @@ abstract protected ConditionValue getCValueVersionno(); + public SSQFunction scalar_Equal() { + return xcreateSSQFunction("="); + } + + public SSQFunction scalar_GreaterEqual() { + return xcreateSSQFunction(">="); + } + + public SSQFunction scalar_GreaterThan() { + return xcreateSSQFunction(">"); + } + + public SSQFunction scalar_LessEqual() { + return xcreateSSQFunction("<="); + } + + public SSQFunction scalar_LessThan() { + return xcreateSSQFunction("<"); + } + + protected SSQFunction xcreateSSQFunction(final String operand) { + return new SSQFunction(new SSQSetupper() { + public void setup(String function, SubQuery subQuery) { + xscalarSubQuery(function, subQuery, operand); + } + }); + } + + protected void xscalarSubQuery(String function, + SubQuery subQuery, String operand) { + assertObjectNotNull("subQuery", subQuery); + UserInfoCB cb = new UserInfoCB(); + cb.xsetupForScalarSubQuery(); + subQuery.query(cb); + String subQueryPropertyName = keepScalarSubQuery(cb.query()); // for + // saving + // query + // -value. + registerScalarSubQuery(function, cb.query(), subQueryPropertyName, + operand); + } + + public abstract String keepScalarSubQuery(UserInfoCQ subQuery); + // Very Internal (for Suppressing Warn about 'Not Use Import') protected String getConditionBeanClassNameInternally() { return UserInfoCB.class.getName(); Modified: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/cq/bs/BsEventScheduleCQ.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/cq/bs/BsEventScheduleCQ.java 2008-12-27 22:14:41 UTC (rev 1629) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/cq/bs/BsEventScheduleCQ.java 2008-12-27 22:18:30 UTC (rev 1630) @@ -5,6 +5,7 @@ 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.EventScheduleCB; import jp.sf.pal.scheduler.db.cbean.cq.EventScheduleCQ; import jp.sf.pal.scheduler.db.cbean.cq.EventScheduleContentCQ; import jp.sf.pal.scheduler.db.cbean.cq.EventScheduleMappingCQ; @@ -16,7 +17,6 @@ * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public class BsEventScheduleCQ extends AbstractBsEventScheduleCQ { //========================================================================== @@ -62,7 +62,7 @@ public EventScheduleCIQ on() { if (isBaseQuery(this)) { throw new UnsupportedOperationException( - "Unsupported onClause of Base Table!"); + "Unsupported on-clause for local table!"); } EventScheduleCIQ inlineQuery = inline(); inlineQuery.xsetOnClauseInline(true); @@ -292,38 +292,38 @@ return "id_NotExistsSubQuery_FacilityScheduleMappingList." + key; } - protected Map _id_DeriveSubQuery_EventScheduleMappingListMap; + protected Map _id_DerivedReferrer_EventScheduleMappingListMap; - public Map getId_DeriveSubQuery_EventScheduleMappingList() { - return _id_DeriveSubQuery_EventScheduleMappingListMap; + public Map getId_DerivedReferrer_EventScheduleMappingList() { + return _id_DerivedReferrer_EventScheduleMappingListMap; } - public String keepId_DeriveSubQuery_EventScheduleMappingList( + public String keepId_DerivedReferrer_EventScheduleMappingList( EventScheduleMappingCQ subQuery) { - if (_id_DeriveSubQuery_EventScheduleMappingListMap == null) { - _id_DeriveSubQuery_EventScheduleMappingListMap = newLinkedHashMap(); + if (_id_DerivedReferrer_EventScheduleMappingListMap == null) { + _id_DerivedReferrer_EventScheduleMappingListMap = newLinkedHashMap(); } String key = "subQueryMapKey" - + (_id_DeriveSubQuery_EventScheduleMappingListMap.size() + 1); - _id_DeriveSubQuery_EventScheduleMappingListMap.put(key, subQuery); - return "id_DeriveSubQuery_EventScheduleMappingList." + key; + + (_id_DerivedReferrer_EventScheduleMappingListMap.size() + 1); + _id_DerivedReferrer_EventScheduleMappingListMap.put(key, subQuery); + return "id_DerivedReferrer_EventScheduleMappingList." + key; } - protected Map _id_DeriveSubQuery_FacilityScheduleMappingListMap; + protected Map _id_DerivedReferrer_FacilityScheduleMappingListMap; - public Map getId_DeriveSubQuery_FacilityScheduleMappingList() { - return _id_DeriveSubQuery_FacilityScheduleMappingListMap; + public Map getId_DerivedReferrer_FacilityScheduleMappingList() { + return _id_DerivedReferrer_FacilityScheduleMappingListMap; } - public String keepId_DeriveSubQuery_FacilityScheduleMappingList( + public String keepId_DerivedReferrer_FacilityScheduleMappingList( FacilityScheduleMappingCQ subQuery) { - if (_id_DeriveSubQuery_FacilityScheduleMappingListMap == null) { - _id_DeriveSubQuery_FacilityScheduleMappingListMap = newLinkedHashMap(); + if (_id_DerivedReferrer_FacilityScheduleMappingListMap == null) { + _id_DerivedReferrer_FacilityScheduleMappingListMap = newLinkedHashMap(); } String key = "subQueryMapKey" - + (_id_DeriveSubQuery_FacilityScheduleMappingListMap.size() + 1); - _id_DeriveSubQuery_FacilityScheduleMappingListMap.put(key, subQuery); - return "id_DeriveSubQuery_FacilityScheduleMappingList." + key; + + (_id_DerivedReferrer_FacilityScheduleMappingListMap.size() + 1); + _id_DerivedReferrer_FacilityScheduleMappingListMap.put(key, subQuery); + return "id_DerivedReferrer_FacilityScheduleMappingList." + key; } public BsEventScheduleCQ addOrderBy_Id_Asc() { @@ -715,7 +715,6 @@ // ========= // Foreign Query // ============= - public EventScheduleContentCQ queryEventScheduleContentAsOne() { return getConditionQueryEventScheduleContentAsOne(); } @@ -724,22 +723,13 @@ public EventScheduleContentCQ getConditionQueryEventScheduleContentAsOne() { if (_conditionQueryEventScheduleContentAsOne == null) { - _conditionQueryEventScheduleContentAsOne = createQueryEventScheduleContentAsOne(); - setupOuterJoin_EventScheduleContentAsOne(); + _conditionQueryEventScheduleContentAsOne = xcreateQueryEventScheduleContentAsOne(); + xsetupOuterJoinEventScheduleContentAsOne(); } return _conditionQueryEventScheduleContentAsOne; } - protected void setupOuterJoin_EventScheduleContentAsOne() { - Map joinOnMap = newLinkedHashMap(); - joinOnMap.put(getRealColumnName("ID"), - getConditionQueryEventScheduleContentAsOne().getRealColumnName( - "ID")); - registerOuterJoin(getConditionQueryEventScheduleContentAsOne(), - joinOnMap); - } - - protected EventScheduleContentCQ createQueryEventScheduleContentAsOne() { + protected EventScheduleContentCQ xcreateQueryEventScheduleContentAsOne() { String nrp = resolveNextRelationPath("EVENT_SCHEDULE", "eventScheduleContentAsOne"); String jan = resolveJoinAliasName(nrp, getNextNestLevel()); @@ -750,10 +740,41 @@ return cq; } + protected void xsetupOuterJoinEventScheduleContentAsOne() { + EventScheduleContentCQ cq = getConditionQueryEventScheduleContentAsOne(); + Map joinOnMap = newLinkedHashMap(); + joinOnMap.put(getRealColumnName("ID"), cq.getRealColumnName("ID")); + registerOuterJoin(cq, joinOnMap); + } + public boolean hasConditionQueryEventScheduleContentAsOne() { return _conditionQueryEventScheduleContentAsOne != null; } + //========================================================================== + // ========= + // Derived Query + // ============= + protected Map _scalarSubQueryMap; + + public Map getScalarSubQuery() { + return _scalarSubQueryMap; + } + + public String keepScalarSubQuery(EventScheduleCQ subQuery) { + if (_scalarSubQueryMap == null) { + _scalarSubQueryMap = newLinkedHashMap(); + } + String key = "subQueryMapKey" + (_scalarSubQueryMap.size() + 1); + _scalarSubQueryMap.put(key, subQuery); + return "scalarSubQuery." + key; + } + + // Very Internal (for Suppressing Warn about 'Not Use Import') + protected String getConditionBeanClassNameInternally() { + return EventScheduleCB.class.getName(); + } + protected String getConditionQueryClassNameInternally() { return EventScheduleCQ.class.getName(); } Modified: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/cq/bs/BsEventScheduleContentCQ.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/cq/bs/BsEventScheduleContentCQ.java 2008-12-27 22:14:41 UTC (rev 1629) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/cq/bs/BsEventScheduleContentCQ.java 2008-12-27 22:18:30 UTC (rev 1630) @@ -5,6 +5,7 @@ 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.EventScheduleContentCB; import jp.sf.pal.scheduler.db.cbean.cq.EventScheduleCQ; import jp.sf.pal.scheduler.db.cbean.cq.EventScheduleContentCQ; import jp.sf.pal.scheduler.db.cbean.cq.ciq.EventScheduleContentCIQ; @@ -14,7 +15,6 @@ * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public class BsEventScheduleContentCQ extends AbstractBsEventScheduleContentCQ { //========================================================================== @@ -60,7 +60,7 @@ public EventScheduleContentCIQ on() { if (isBaseQuery(this)) { throw new UnsupportedOperationException( - "Unsupported onClause of Base Table!"); + "Unsupported on-clause for local table!"); } EventScheduleContentCIQ inlineQuery = inline(); inlineQuery.xsetOnClauseInline(true); @@ -169,7 +169,6 @@ // ========= // Foreign Query // ============= - public EventScheduleCQ queryEventSchedule() { return getConditionQueryEventSchedule(); } @@ -178,20 +177,13 @@ public EventScheduleCQ getConditionQueryEventSchedule() { if (_conditionQueryEventSchedule == null) { - _conditionQueryEventSchedule = createQueryEventSchedule(); - setupOuterJoin_EventSchedule(); + _conditionQueryEventSchedule = xcreateQueryEventSchedule(); + xsetupOuterJoinEventSchedule(); } return _conditionQueryEventSchedule; } - protected void setupOuterJoin_EventSchedule() { - Map joinOnMap = newLinkedHashMap(); - joinOnMap.put(getRealColumnName("ID"), getConditionQueryEventSchedule() - .getRealColumnName("ID")); - registerOuterJoin(getConditionQueryEventSchedule(), joinOnMap); - } - - protected EventScheduleCQ createQueryEventSchedule() { + protected EventScheduleCQ xcreateQueryEventSchedule() { String nrp = resolveNextRelationPath("EVENT_SCHEDULE_CONTENT", "eventSchedule"); String jan = resolveJoinAliasName(nrp, getNextNestLevel()); @@ -202,10 +194,41 @@ return cq; } + protected void xsetupOuterJoinEventSchedule() { + EventScheduleCQ cq = getConditionQueryEventSchedule(); + Map joinOnMap = newLinkedHashMap(); + joinOnMap.put(getRealColumnName("ID"), cq.getRealColumnName("ID")); + registerOuterJoin(cq, joinOnMap); + } + public boolean hasConditionQueryEventSchedule() { return _conditionQueryEventSchedule != null; } + //========================================================================== + // ========= + // Derived Query + // ============= + protected Map _scalarSubQueryMap; + + public Map getScalarSubQuery() { + return _scalarSubQueryMap; + } + + public String keepScalarSubQuery(EventScheduleContentCQ subQuery) { + if (_scalarSubQueryMap == null) { + _scalarSubQueryMap = newLinkedHashMap(); + } + String key = "subQueryMapKey" + (_scalarSubQueryMap.size() + 1); + _scalarSubQueryMap.put(key, subQuery); + return "scalarSubQuery." + key; + } + + // Very Internal (for Suppressing Warn about 'Not Use Import') + protected String getConditionBeanClassNameInternally() { + return EventScheduleContentCB.class.getName(); + } + protected String getConditionQueryClassNameInternally() { return EventScheduleContentCQ.class.getName(); } Modified: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/cq/bs/BsEventScheduleMappingCQ.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/cq/bs/BsEventScheduleMappingCQ.java 2008-12-27 22:14:41 UTC (rev 1629) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/cq/bs/BsEventScheduleMappingCQ.java 2008-12-27 22:18:30 UTC (rev 1630) @@ -5,6 +5,7 @@ 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.EventScheduleMappingCB; import jp.sf.pal.scheduler.db.cbean.cq.EventScheduleCQ; import jp.sf.pal.scheduler.db.cbean.cq.EventScheduleMappingCQ; import jp.sf.pal.scheduler.db.cbean.cq.UserInfoCQ; @@ -15,7 +16,6 @@ * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public class BsEventScheduleMappingCQ extends AbstractBsEventScheduleMappingCQ { //========================================================================== @@ -61,7 +61,7 @@ public EventScheduleMappingCIQ on() { if (isBaseQuery(this)) { throw new UnsupportedOperationException( - "Unsupported onClause of Base Table!"); + "Unsupported on-clause for local table!"); } EventScheduleMappingCIQ inlineQuery = inline(); inlineQuery.xsetOnClauseInline(true); @@ -214,7 +214,6 @@ // ========= // Foreign Query // ============= - public EventScheduleCQ queryEventSchedule() { return getConditionQueryEventSchedule(); } @@ -223,20 +222,13 @@ public EventScheduleCQ getConditionQueryEventSchedule() { if (_conditionQueryEventSchedule == null) { - _conditionQueryEventSchedule = createQueryEventSchedule(); - setupOuterJoin_EventSchedule(); + _conditionQueryEventSchedule = xcreateQueryEventSchedule(); + xsetupOuterJoinEventSchedule(); } return _conditionQueryEventSchedule; } - protected void setupOuterJoin_EventSchedule() { - Map joinOnMap = newLinkedHashMap(); - joinOnMap.put(getRealColumnName("SCHEDULE_ID"), - getConditionQueryEventSchedule().getRealColumnName("ID")); - registerOuterJoin(getConditionQueryEventSchedule(), joinOnMap); - } - - protected EventScheduleCQ createQueryEventSchedule() { + protected EventScheduleCQ xcreateQueryEventSchedule() { String nrp = resolveNextRelationPath("EVENT_SCHEDULE_MAPPING", "eventSchedule"); String jan = resolveJoinAliasName(nrp, getNextNestLevel()); @@ -247,6 +239,14 @@ return cq; } + protected void xsetupOuterJoinEventSchedule() { + EventScheduleCQ cq = getConditionQueryEventSchedule(); + Map joinOnMap = newLinkedHashMap(); + joinOnMap.put(getRealColumnName("SCHEDULE_ID"), cq + .getRealColumnName("ID")); + registerOuterJoin(cq, joinOnMap); + } + public boolean hasConditionQueryEventSchedule() { return _conditionQueryEventSchedule != null; } @@ -259,20 +259,13 @@ public UserInfoCQ getConditionQueryUserInfo() { if (_conditionQueryUserInfo == null) { - _conditionQueryUserInfo = createQueryUserInfo(); - setupOuterJoin_UserInfo(); + _conditionQueryUserInfo = xcreateQueryUserInfo(); + xsetupOuterJoinUserInfo(); } return _conditionQueryUserInfo; } - protected void setupOuterJoin_UserInfo() { - Map joinOnMap = newLinkedHashMap(); - joinOnMap.put(getRealColumnName("USER_ID"), getConditionQueryUserInfo() - .getRealColumnName("USER_ID")); - registerOuterJoin(getConditionQueryUserInfo(), joinOnMap); - } - - protected UserInfoCQ createQueryUserInfo() { + protected UserInfoCQ xcreateQueryUserInfo() { String nrp = resolveNextRelationPath("EVENT_SCHEDULE_MAPPING", "userInfo"); String jan = resolveJoinAliasName(nrp, getNextNestLevel()); @@ -283,10 +276,42 @@ return cq; } + protected void xsetupOuterJoinUserInfo() { + UserInfoCQ cq = getConditionQueryUserInfo(); + Map joinOnMap = newLinkedHashMap(); + joinOnMap.put(getRealColumnName("USER_ID"), cq + .getRealColumnName("USER_ID")); + registerOuterJoin(cq, joinOnMap); + } + public boolean hasConditionQueryUserInfo() { return _conditionQueryUserInfo != null; } + //========================================================================== + // ========= + // Derived Query + // ============= + protected Map _scalarSubQueryMap; + + public Map getScalarSubQuery() { + return _scalarSubQueryMap; + } + + public String keepScalarSubQuery(EventScheduleMappingCQ subQuery) { + if (_scalarSubQueryMap == null) { + _scalarSubQueryMap = newLinkedHashMap(); + } + String key = "subQueryMapKey" + (_scalarSubQueryMap.size() + 1); + _scalarSubQueryMap.put(key, subQuery); + return "scalarSubQuery." + key; + } + + // Very Internal (for Suppressing Warn about 'Not Use Import') + protected String getConditionBeanClassNameInternally() { + return EventScheduleMappingCB.class.getName(); + } + protected String getConditionQueryClassNameInternally() { return EventScheduleMappingCQ.class.getName(); } Modified: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/cq/bs/BsFacilityCQ.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/cq/bs/BsFacilityCQ.java 2008-12-27 22:14:41 UTC (rev 1629) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/cq/bs/BsFacilityCQ.java 2008-12-27 22:18:30 UTC (rev 1630) @@ -5,6 +5,7 @@ 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.FacilityCB; import jp.sf.pal.scheduler.db.cbean.cq.FacilityCQ; import jp.sf.pal.scheduler.db.cbean.cq.FacilityContentCQ; import jp.sf.pal.scheduler.db.cbean.cq.FacilityGroupCQ; @@ -16,7 +17,6 @@ * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public class BsFacilityCQ extends AbstractBsFacilityCQ { //========================================================================== @@ -62,7 +62,7 @@ public FacilityCIQ on() { if (isBaseQuery(this)) { throw new UnsupportedOperationException( - "Unsupported onClause of Base Table!"); + "Unsupported on-clause for local table!"); } FacilityCIQ inlineQuery = inline(); inlineQuery.xsetOnClauseInline(true); @@ -224,21 +224,21 @@ return "id_NotExistsSubQuery_FacilityScheduleMappingList." + key; } - protected Map _id_DeriveSubQuery_FacilityScheduleMappingListMap; + protected Map _id_DerivedReferrer_FacilityScheduleMappingListMap; - public Map getId_DeriveSubQuery_FacilityScheduleMappingList() { - return _id_DeriveSubQuery_FacilityScheduleMappingListMap; + public Map getId_DerivedReferrer_FacilityScheduleMappingList() { + return _id_DerivedReferrer_FacilityScheduleMappingListMap; } - public String keepId_DeriveSubQuery_FacilityScheduleMappingList( + public String keepId_DerivedReferrer_FacilityScheduleMappingList( FacilityScheduleMappingCQ subQuery) { - if (_id_DeriveSubQuery_FacilityScheduleMappingListMap == null) { - _id_DeriveSubQuery_FacilityScheduleMappingListMap = newLinkedHashMap(); + if (_id_DerivedReferrer_FacilityScheduleMappingListMap == null) { + _id_DerivedReferrer_FacilityScheduleMappingListMap = newLinkedHashMap(); } String key = "subQueryMapKey" - + (_id_DeriveSubQuery_FacilityScheduleMappingListMap.size() + 1); - _id_DeriveSubQuery_FacilityScheduleMappingListMap.put(key, subQuery); - return "id_DeriveSubQuery_FacilityScheduleMappingList." + key; + + (_id_DerivedReferrer_FacilityScheduleMappingListMap.size() + 1); + _id_DerivedReferrer_FacilityScheduleMappingListMap.put(key, subQuery); + return "id_DerivedReferrer_FacilityScheduleMappingList." + key; } public BsFacilityCQ addOrderBy_Id_Asc() { @@ -536,7 +536,6 @@ // ========= // Foreign Query // ============= - public FacilityGroupCQ queryFacilityGroup() { return getConditionQueryFacilityGroup(); } @@ -545,20 +544,13 @@ public FacilityGroupCQ getConditionQueryFacilityGroup() { if (_conditionQueryFacilityGroup == null) { - _conditionQueryFacilityGroup = createQueryFacilityGroup(); - setupOuterJoin_FacilityGroup(); + _conditionQueryFacilityGroup = xcreateQueryFacilityGroup(); + xsetupOuterJoinFacilityGroup(); } return _conditionQueryFacilityGroup; } - protected void setupOuterJoin_FacilityGroup() { - Map joinOnMap = newLinkedHashMap(); - joinOnMap.put(getRealColumnName("GROUP_ID"), - getConditionQueryFacilityGroup().getRealColumnName("ID")); - registerOuterJoin(getConditionQueryFacilityGroup(), joinOnMap); - } - - protected FacilityGroupCQ createQueryFacilityGroup() { + protected FacilityGroupCQ xcreateQueryFacilityGroup() { String nrp = resolveNextRelationPath("FACILITY", "facilityGroup"); String jan = resolveJoinAliasName(nrp, getNextNestLevel()); FacilityGroupCQ cq = new FacilityGroupCQ(this, getSqlClause(), jan, @@ -568,6 +560,14 @@ return cq; } + protected void xsetupOuterJoinFacilityGroup() { + FacilityGroupCQ cq = getConditionQueryFacilityGroup(); + Map joinOnMap = newLinkedHashMap(); + joinOnMap + .put(getRealColumnName("GROUP_ID"), cq.getRealColumnName("ID")); + registerOuterJoin(cq, joinOnMap); + } + public boolean hasConditionQueryFacilityGroup() { return _conditionQueryFacilityGroup != null; } @@ -580,22 +580,13 @@ public FacilityContentCQ getConditionQueryFacilityContentAsOne() { if (_conditionQueryFacilityContentAsOne == null) { - _conditionQueryFacilityContentAsOne = createQueryFacilityContentAsOne(); - setupOuterJoin_FacilityContentAsOne(); + _conditionQueryFacilityContentAsOne = xcreateQueryFacilityContentAsOne(); + xsetupOuterJoinFacilityContentAsOne(); } return _conditionQueryFacilityContentAsOne; } - protected void setupOuterJoin_FacilityContentAsOne() { - Map joinOnMap = newLinkedHashMap(); - joinOnMap - .put(getRealColumnName("ID"), - getConditionQueryFacilityContentAsOne() - .getRealColumnName("ID")); - registerOuterJoin(getConditionQueryFacilityContentAsOne(), joinOnMap); - } - - protected FacilityContentCQ createQueryFacilityContentAsOne() { + protected FacilityContentCQ xcreateQueryFacilityContentAsOne() { String nrp = resolveNextRelationPath("FACILITY", "facilityContentAsOne"); String jan = resolveJoinAliasName(nrp, getNextNestLevel()); FacilityContentCQ cq = new FacilityContentCQ(this, getSqlClause(), jan, @@ -605,10 +596,41 @@ return cq; } + protected void xsetupOuterJoinFacilityContentAsOne() { + FacilityContentCQ cq = getConditionQueryFacilityContentAsOne(); + Map joinOnMap = newLinkedHashMap(); + joinOnMap.put(getRealColumnName("ID"), cq.getRealColumnName("ID")); + registerOuterJoin(cq, joinOnMap); + } + public boolean hasConditionQueryFacilityContentAsOne() { return _conditionQueryFacilityContentAsOne != null; } + //========================================================================== + // ========= + // Derived Query + // ============= + protected Map _scalarSubQueryMap; + + public Map getScalarSubQuery() { + return _scalarSubQueryMap; + } + + public String keepScalarSubQuery(FacilityCQ subQuery) { + if (_scalarSubQueryMap == null) { + _scalarSubQueryMap = newLinkedHashMap(); + } + String key = "subQueryMapKey" + (_scalarSubQueryMap.size() + 1); + _scalarSubQueryMap.put(key, subQuery); + return "scalarSubQuery." + key; + } + + // Very Internal (for Suppressing Warn about 'Not Use Import') + protected String getConditionBeanClassNameInternally() { + return FacilityCB.class.getName(); + } + protected String getConditionQueryClassNameInternally() { return FacilityCQ.class.getName(); } Modified: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/cq/bs/BsFacilityContentCQ.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/cq/bs/BsFacilityContentCQ.java 2008-12-27 22:14:41 UTC (rev 1629) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/cq/bs/BsFacilityContentCQ.java 2008-12-27 22:18:30 UTC (rev 1630) @@ -5,6 +5,7 @@ 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.FacilityContentCB; import jp.sf.pal.scheduler.db.cbean.cq.FacilityCQ; import jp.sf.pal.scheduler.db.cbean.cq.FacilityContentCQ; import jp.sf.pal.scheduler.db.cbean.cq.ciq.FacilityContentCIQ; @@ -14,7 +15,6 @@ * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public class BsFacilityContentCQ extends AbstractBsFacilityContentCQ { //========================================================================== @@ -60,7 +60,7 @@ public FacilityContentCIQ on() { if (isBaseQuery(this)) { throw new UnsupportedOperationException( - "Unsupported onClause of Base Table!"); + "Unsupported on-clause for local table!"); } FacilityContentCIQ inlineQuery = inline(); inlineQuery.xsetOnClauseInline(true); @@ -166,7 +166,6 @@ // ========= // Foreign Query // ============= - public FacilityCQ queryFacility() { return getConditionQueryFacility(); } @@ -175,20 +174,13 @@ public FacilityCQ getConditionQueryFacility() { if (_conditionQueryFacility == null) { - _conditionQueryFacility = createQueryFacility(); - setupOuterJoin_Facility(); + _conditionQueryFacility = xcreateQueryFacility(); + xsetupOuterJoinFacility(); } return _conditionQueryFacility; } - protected void setupOuterJoin_Facility() { - Map joinOnMap = newLinkedHashMap(); - joinOnMap.put(getRealColumnName("ID"), getConditionQueryFacility() - .getRealColumnName("ID")); - registerOuterJoin(getConditionQueryFacility(), joinOnMap); - } - - protected FacilityCQ createQueryFacility() { + protected FacilityCQ xcreateQueryFacility() { String nrp = resolveNextRelationPath("FACILITY_CONTENT", "facility"); String jan = resolveJoinAliasName(nrp, getNextNestLevel()); FacilityCQ cq = new FacilityCQ(this, getSqlClause(), jan, @@ -198,10 +190,41 @@ return cq; } + protected void xsetupOuterJoinFacility() { + FacilityCQ cq = getConditionQueryFacility(); + Map joinOnMap = newLinkedHashMap(); + joinOnMap.put(getRealColumnName("ID"), cq.getRealColumnName("ID")); + registerOuterJoin(cq, joinOnMap); + } + public boolean hasConditionQueryFacility() { return _conditionQueryFacility != null; } + //========================================================================== + // ========= + // Derived Query + // ============= + protected Map _scalarSubQueryMap; + + public Map getScalarSubQuery() { + return _scalarSubQueryMap; + } + + public String keepScalarSubQuery(FacilityContentCQ subQuery) { + if (_scalarSubQueryMap == null) { + _scalarSubQueryMap = newLinkedHashMap(); + } + String key = "subQueryMapKey" + (_scalarSubQueryMap.size() + 1); + _scalarSubQueryMap.put(key, subQuery); + return "scalarSubQuery." + key; + } + + // Very Internal (for Suppressing Warn about 'Not Use Import') + protected String getConditionBeanClassNameInternally() { + return FacilityContentCB.class.getName(); + } + protected String getConditionQueryClassNameInternally() { return FacilityContentCQ.class.getName(); } Modified: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/cq/bs/BsFacilityGroupCQ.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/cq/bs/BsFacilityGroupCQ.java 2008-12-27 22:14:41 UTC (rev 1629) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/cq/bs/BsFacilityGroupCQ.java 2008-12-27 22:18:30 UTC (rev 1630) @@ -5,6 +5,7 @@ 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.FacilityGroupCB; import jp.sf.pal.scheduler.db.cbean.cq.FacilityCQ; import jp.sf.pal.scheduler.db.cbean.cq.FacilityGroupCQ; import jp.sf.pal.scheduler.db.cbean.cq.ciq.FacilityGroupCIQ; @@ -14,7 +15,6 @@ * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public class BsFacilityGroupCQ extends AbstractBsFacilityGroupCQ { //========================================================================== @@ -60,7 +60,7 @@ public FacilityGroupCIQ on() { if (isBaseQuery(this)) { throw new UnsupportedOperationException( - "Unsupported onClause of Base Table!"); + "Unsupported on-clause for local table!"); } FacilityGroupCIQ inlineQuery = inline(); inlineQuery.xsetOnClauseInline(true); @@ -149,20 +149,20 @@ return "id_NotExistsSubQuery_FacilityList." + key; } - protected Map _id_DeriveSubQuery_FacilityListMap; + protected Map _id_DerivedReferrer_FacilityListMap; - public Map getId_DeriveSubQuery_FacilityList() { - return _id_DeriveSubQuery_FacilityListMap; + public Map getId_DerivedReferrer_FacilityList() { + return _id_DerivedReferrer_FacilityListMap; } - public String keepId_DeriveSubQuery_FacilityList(FacilityCQ subQuery) { - if (_id_DeriveSubQuery_FacilityListMap == null) { - _id_DeriveSubQuery_FacilityListMap = newLinkedHashMap(); + public String keepId_DerivedReferrer_FacilityList(FacilityCQ subQuery) { + if (_id_DerivedReferrer_FacilityListMap == null) { + _id_DerivedReferrer_FacilityListMap = newLinkedHashMap(); } String key = "subQueryMapKey" - + (_id_DeriveSubQuery_FacilityListMap.size() + 1); - _id_DeriveSubQuery_FacilityListMap.put(key, subQuery); - return "id_DeriveSubQuery_FacilityList." + key; + + (_id_DerivedReferrer_FacilityListMap.size() + 1); + _id_DerivedReferrer_FacilityListMap.put(key, subQuery); + return "id_DerivedReferrer_FacilityList." + key; } public BsFacilityGroupCQ addOrderBy_Id_Asc() { @@ -408,7 +408,30 @@ // ========= // Foreign Query // ============= + //========================================================================== + // ========= + // Derived Query + // ============= + protected Map _scalarSubQueryMap; + public Map getScalarSubQuery() { + return _scalarSubQueryMap; + } + + public String keepScalarSubQuery(FacilityGroupCQ subQuery) { + if (_scalarSubQueryMap == null) { + _scalarSubQueryMap = newLinkedHashMap(); + } + String key = "subQueryMapKey" + (_scalarSubQueryMap.size() + 1); + _scalarSubQueryMap.put(key, subQuery); + return "scalarSubQuery." + key; + } + + // Very Internal (for Suppressing Warn about 'Not Use Import') + protected String getConditionBeanClassNameInternally() { + return FacilityGroupCB.class.getName(); + } + protected String getConditionQueryClassNameInternally() { return FacilityGroupCQ.class.getName(); } Modified: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/cq/bs/BsFacilityScheduleMappingCQ.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/cq/bs/BsFacilityScheduleMappingCQ.java 2008-12-27 22:14:41 UTC (rev 1629) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/cq/bs/BsFacilityScheduleMappingCQ.java 2008-12-27 22:18:30 UTC (rev 1630) @@ -5,6 +5,7 @@ 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.FacilityScheduleMappingCB; import jp.sf.pal.scheduler.db.cbean.cq.EventScheduleCQ; import jp.sf.pal.scheduler.db.cbean.cq.FacilityCQ; import jp.sf.pal.scheduler.db.cbean.cq.FacilityScheduleMappingCQ; @@ -15,7 +16,6 @@ * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public class BsFacilityScheduleMappingCQ extends AbstractBsFacilityScheduleMappingCQ { @@ -62,7 +62,7 @@ public FacilityScheduleMappingCIQ on() { if (isBaseQuery(this)) { throw new UnsupportedOperationException( - "Unsupported onClause of Base Table!"); + "Unsupported on-clause for local table!"); } FacilityScheduleMappingCIQ inlineQuery = inline(); inlineQuery.xsetOnClauseInline(true); @@ -215,7 +215,6 @@ // ========= // Foreign Query // ============= - public EventScheduleCQ queryEventSchedule() { return getConditionQueryEventSchedule(); } @@ -224,20 +223,13 @@ public EventScheduleCQ getConditionQueryEventSchedule() { if (_conditionQueryEventSchedule == null) { - _conditionQueryEventSchedule = createQueryEventSchedule(); - setupOuterJoin_EventSchedule(); + _conditionQueryEventSchedule = xcreateQueryEventSchedule(); + xsetupOuterJoinEventSchedule(); } return _conditionQueryEventSchedule; } - protected void setupOuterJoin_EventSchedule() { - Map joinOnMap = newLinkedHashMap(); - joinOnMap.put(getRealColumnName("SCHEDULE_ID"), - getConditionQueryEventSchedule().getRealColumnName("ID")); - registerOuterJoin(getConditionQueryEventSchedule(), joinOnMap); - } - - protected EventScheduleCQ createQueryEventSchedule() { + protected EventScheduleCQ xcreateQueryEventSchedule() { String nrp = resolveNextRelationPath("FACILITY_SCHEDULE_MAPPING", "eventSchedule"); String jan = resolveJoinAliasName(nrp, getNextNestLevel()); @@ -248,6 +240,14 @@ return cq; } + protected void xsetupOuterJoinEventSchedule() { + EventScheduleCQ cq = getConditionQueryEventSchedule(); + Map joinOnMap = newLinkedHashMap(); + joinOnMap.put(getRealColumnName("SCHEDULE_ID"), cq + .getRealColumnName("ID")); + registerOuterJoin(cq, joinOnMap); + } + public boolean hasConditionQueryEventSchedule() { return _conditionQueryEventSchedule != null; } @@ -260,20 +260,13 @@ public FacilityCQ getConditionQueryFacility() { if (_conditionQueryFacility == null) { - _conditionQueryFacility = createQueryFacility(); - setupOuterJoin_Facility(); + _conditionQueryFacility = xcreateQueryFacility(); + xsetupOuterJoinFacility(); } return _conditionQueryFacility; } - protected void setupOuterJoin_Facility() { - Map joinOnMap = newLinkedHashMap(); - joinOnMap.put(getRealColumnName("FACILITY_ID"), - getConditionQueryFacility().getRealColumnName("ID")); - registerOuterJoin(getConditionQueryFacility(), joinOnMap); - } - - protected FacilityCQ createQueryFacility() { + protected FacilityCQ xcreateQueryFacility() { String nrp = resolveNextRelationPath("FACILITY_SCHEDULE_MAPPING", "facility"); String jan = resolveJoinAliasName(nrp, getNextNestLevel()); @@ -284,10 +277,42 @@ return cq; } + protected void xsetupOuterJoinFacility() { + FacilityCQ cq = getConditionQueryFacility(); + Map joinOnMap = newLinkedHashMap(); + joinOnMap.put(getRealColumnName("FACILITY_ID"), cq + .getRealColumnName("ID")); + registerOuterJoin(cq, joinOnMap); + } + public boolean hasConditionQueryFacility() { return _conditionQueryFacility != null; } + //========================================================================== + // ========= + // Derived Query + // ============= + protected Map _scalarSubQueryMap; + + public Map getScalarSubQuery() { + return _scalarSubQueryMap; + } + + public String keepScalarSubQuery(FacilityScheduleMappingCQ subQuery) { + if (_scalarSubQueryMap == null) { + _scalarSubQueryMap = newLinkedHashMap(); + } + String key = "subQueryMapKey" + (_scalarSubQueryMap.size() + 1); + _scalarSubQueryMap.put(key, subQuery); + return "scalarSubQuery." + key; + } + + // Very Internal (for Suppressing Warn about 'Not Use Import') + protected String getConditionBeanClassNameInternally() { + return FacilityScheduleMappingCB.class.getName(); + } + protected String getConditionQueryClassNameInternally() { return FacilityScheduleMappingCQ.class.getName(); } Modified: 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 2008-12-27 22:14:41 UTC (rev 1629) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/cq/bs/BsGroupInfoCQ.java 2008-12-27 22:18:30 UTC (rev 1630) @@ -5,6 +5,7 @@ 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.GroupInfoCB; 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; @@ -15,7 +16,6 @@ * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public class BsGroupInfoCQ extends AbstractBsGroupInfoCQ { //========================================================================== @@ -61,7 +61,7 @@ public GroupInfoCIQ on() { if (isBaseQuery(this)) { throw new UnsupportedOperationException( - "Unsupported onClause of Base Table!"); + "Unsupported on-clause for local table!"); } GroupInfoCIQ inlineQuery = inline(); inlineQuery.xsetOnClauseInline(true); @@ -219,37 +219,37 @@ return "groupId_NotExistsSubQuery_UserInfoList." + key; } - protected Map _groupId_DeriveSubQuery_GroupMappingListMap; + protected Map _groupId_DerivedReferrer_GroupMappingListMap; - public Map getGroupId_DeriveSubQuery_GroupMappingList() { - return _groupId_DeriveSubQuery_GroupMappingListMap; + public Map getGroupId_DerivedReferrer_GroupMappingList() { + return _groupId_DerivedReferrer_GroupMappingListMap; } - public String keepGroupId_DeriveSubQuery_GroupMappingList( + public String keepGroupId_DerivedReferrer_GroupMappingList( GroupMappingCQ subQuery) { - if (_groupId_DeriveSubQuery_GroupMappingListMap == null) { - _groupId_DeriveSubQuery_GroupMappingListMap = newLinkedHashMap(); + if (_groupId_DerivedReferrer_GroupMappingListMap == null) { + _groupId_DerivedReferrer_GroupMappingListMap = newLinkedHashMap(); } String key = "subQueryMapKey" - + (_groupId_DeriveSubQuery_GroupMappingListMap.size() + 1); - _groupId_DeriveSubQuery_GroupMappingListMap.put(key, subQuery); - return "groupId_DeriveSubQuery_GroupMappingList." + key; + + (_groupId_DerivedReferrer_GroupMappingListMap.size() + 1); + _groupId_DerivedReferrer_GroupMappingListMap.put(key, subQuery); + return "groupId_DerivedReferrer_GroupMappingList." + key; } - protected Map _groupId_DeriveSubQuery_UserInfoListMap; + protected Map _groupId_DerivedReferrer_UserInfoListMap; - public Map getGroupId_DeriveSubQuery_UserInfoList() { - return _groupId_DeriveSubQuery_UserInfoListMap; + public Map getGroupId_DerivedReferrer_UserInfoList() { + return _groupId_DerivedReferrer_UserInfoListMap; } - public String keepGroupId_DeriveSubQuery_UserInfoList(UserInfoCQ subQuery) { - if (_groupId_DeriveSubQuery_UserInfoListMap == null) { - _groupId_DeriveSubQuery_UserInfoListMap = newLinkedHashMap(); + public String keepGroupId_DerivedReferrer_UserInfoList(UserInfoCQ subQuery) { + if (_groupId_DerivedReferrer_UserInfoListMap == null) { + _groupId_DerivedReferrer_UserInfoListMap = newLinkedHashMap(); } String key = "subQueryMapKey" - + (_groupId_DeriveSubQuery_UserInfoListMap.size() + 1); - _groupId_DeriveSubQuery_UserInfoListMap.put(key, subQuery); - return "groupId_DeriveSubQuery_UserInfoList." + key; + + (_groupId_DerivedReferrer_UserInfoListMap.size() + 1); + _groupId_DerivedReferrer_UserInfoListMap.put(key, subQuery); + return "groupId_DerivedReferrer_UserInfoList." + key; } public BsGroupInfoCQ addOrderBy_GroupId_Asc() { @@ -564,7 +564,30 @@ // ========= // Foreign Query // ============= + //========================================================================== + // ========= + // Derived Query + // ============= + protected Map _scalarSubQueryMap; + public Map getScalarSubQuery() { + return _scalarSubQueryMap; + } + + public String keepScalarSubQuery(GroupInfoCQ subQuery) { + if (_scalarSubQueryMap == null) { + _scalarSubQueryMap = newLinkedHashMap(); + } + String key = "subQueryMapKey" + (_scalarSubQueryMap.size() + 1); + _scalarSubQueryMap.put(key, subQuery); + return "scalarSubQuery." + key; + } + + // Very Internal (for Suppressing Warn about 'Not Use Import') + protected String getConditionBeanClassNameInternally() { + return GroupInfoCB.class.getName(); + } + protected String getConditionQueryClassNameInternally() { return GroupInfoCQ.class.getName(); } Modified: 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 2008-12-27 22:14:41 UTC (rev 1629) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/cq/bs/BsGroupMappingCQ.java 2008-12-27 22:18:30 UTC (rev 1630) @@ -5,6 +5,7 @@ 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.GroupMappingCB; 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; @@ -15,7 +16,6 @@ * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public class BsGroupMappingCQ extends AbstractBsGroupMappingCQ { //========================================================================== @@ -61,7 +61,7 @@ public GroupMappingCIQ on() { if (isBaseQuery(this)) { throw new UnsupportedOperationException( - "Unsupported onClause of Base Table!"); + "Unsupported on-clause for local table!"); } GroupMappingCIQ inlineQuery = inline(); inlineQuery.xsetOnClauseInline(true); @@ -210,7 +210,6 @@ // ========= // Foreign Query // ============= - public GroupInfoCQ queryGroupInfo() { return getConditionQueryGroupInfo(); } @@ -219,20 +218,13 @@ public GroupInfoCQ getConditionQueryGroupInfo() { if (_conditionQueryGroupInfo == null) { - _conditionQueryGroupInfo = createQueryGroupInfo(); - setupOuterJoin_GroupInfo(); + _conditionQueryGroupInfo = xcreateQueryGroupInfo(); + xsetupOuterJoinGroupInfo(); } return _conditionQueryGroupInfo; } - protected void setupOuterJoin_GroupInfo() { - Map joinOnMap = newLinkedHashMap(); - joinOnMap.put(getRealColumnName("GROUP_ID"), - getConditionQueryGroupInfo().getRealColumnName("GROUP_ID")); - registerOuterJoin(getConditionQueryGroupInfo(), joinOnMap); - } - - protected GroupInfoCQ createQueryGroupInfo() { + protected GroupInfoCQ xcreateQueryGroupInfo() { String nrp = resolveNextRelationPath("GROUP_MAPPING", "groupInfo"); String jan = resolveJoinAliasName(nrp, getNextNestLevel()); GroupInfoCQ cq = new GroupInfoCQ(this, getSqlClause(), jan, @@ -242,6 +234,14 @@ return cq; } + protected void xsetupOuterJoinGroupInfo() { + GroupInfoCQ cq = getConditionQueryGroupInfo(); + Map joinOnMap = newLinkedHashMap(); + joinOnMap.put(getRealColumnName("GROUP_ID"), cq + .getRealColumnName("GROUP_ID")); + registerOuterJoin(cq, joinOnMap); + } + public boolean hasConditionQueryGroupInfo() { return _conditionQueryGroupInfo != null; } @@ -254,20 +254,13 @@ public UserInfoCQ getConditionQueryUserInfo() { if (_conditionQueryUserInfo == null) { - _conditionQueryUserInfo = createQueryUserInfo(); - setupOuterJoin_UserInfo(); + _conditionQueryUserInfo = xcreateQueryUserInfo(); + xsetupOuterJoinUserInfo(); } return _conditionQueryUserInfo; } - protected void setupOuterJoin_UserInfo() { - Map joinOnMap = newLinkedHashMap(); - joinOnMap.put(getRealColumnName("USER_ID"), getConditionQueryUserInfo() - .getRealColumnName("USER_ID")); - registerOuterJoin(getConditionQueryUserInfo(), joinOnMap); - } - - protected UserInfoCQ createQueryUserInfo() { + protected UserInfoCQ xcreateQueryUserInfo() { String nrp = resolveNextRelationPath("GROUP_MAPPING", "userInfo"); String jan = resolveJoinAliasName(nrp, getNextNestLevel()); UserInfoCQ cq = new UserInfoCQ(this, getSqlClause(), jan, @@ -277,10 +270,42 @@ return cq; } + protected void xsetupOuterJoinUserInfo() { + UserInfoCQ cq = getConditionQueryUserInfo(); + Map joinOnMap = newLinkedHashMap(); + joinOnMap.put(getRealColumnName("USER_ID"), cq + .getRealColumnName("USER_ID")); + registerOuterJoin(cq, joinOnMap); + } + public boolean hasConditionQueryUserInfo() { return _conditionQueryUserInfo != null; } + //========================================================================== + // ========= + // Derived Query + // ============= + protected Map _scalarSubQueryMap; + + public Map getScalarSubQuery() { + return _scalarSubQueryMap; + } + + public String keepScalarSubQuery(GroupMappingCQ subQuery) { + if (_scalarSubQueryMap == null) { + _scalarSubQueryMap = newLinkedHashMap(); + } + String key = "subQueryMapKey" + (_scalarSubQueryMap.size() + 1); + _scalarSubQueryMap.put(key, subQuery); + return "scalarSubQuery." + key; + } + + // Very Internal (for Suppressing Warn about 'Not Use Import') + protected String getConditionBeanClassNameInternally() { + return GroupMappingCB.class.getName(); + } + protected String getConditionQueryClassNameInternally() { return GroupMappingCQ.class.getName(); } Modified: 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 2008-12-27 22:14:41 UTC (rev 1629) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/cq/bs/BsRoleInfoCQ.java 2008-12-27 22:18:30 UTC (rev 1630) @@ -5,6 +5,7 @@ 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.RoleInfoCB; 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; @@ -15,7 +16,6 @@ * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public class BsRoleInfoCQ extends AbstractBsRoleInfoCQ { //========================================================================== @@ -61,7 +61,7 @@ public RoleInfoCIQ on() { if (isBaseQuery(this)) { throw new UnsupportedOperationException( - "Unsupported onClause of Base Table!"); + "Unsupported on-clause for local table!"); } RoleInfoCIQ inlineQuery = inline(); inlineQuery.xsetOnClauseInline(true); @@ -218,37 +218,37 @@ return "roleId_NotExistsSubQuery_UserInfoList." + key; } - protected Map _roleId_DeriveSubQuery_RoleMappingListMap; + protected Map _roleId_DerivedReferrer_RoleMappingListMap; - public Map getRoleId_DeriveSubQuery_RoleMappingList() { - return _roleId_DeriveSubQuery_RoleMappingListMap; + public Map getRoleId_DerivedReferrer_RoleMappingList() { + return _roleId_DerivedReferrer_RoleMappingListMap; } - public String keepRoleId_DeriveSubQuery_RoleMappingList( + public String keepRoleId_DerivedReferrer_RoleMappingList( RoleMappingCQ subQuery) { - if (_roleId_DeriveSubQuery_RoleMappingListMap == null) { - _roleId_DeriveSubQuery_RoleMappingListMap = newLinkedHashMap(); + if (_roleId_DerivedReferrer_RoleMappingListMap == null) { + _roleId_DerivedReferrer_RoleMappingListMap = newLinkedHashMap(); } String key = "subQueryMapKey" - + (_roleId_DeriveSubQuery_RoleMappingListMap.size() + 1); - _roleId_DeriveSubQuery_RoleMappingListMap.put(key, subQuery); - return "roleId_DeriveSubQuery_RoleMappingList." + key; + + (_roleId_DerivedReferrer_RoleMappingListMap.size() + 1); + _roleId_DerivedReferrer_RoleMappingListMap.put(key, subQuery); + return "roleId_DerivedReferrer_RoleMappingList." + key; } - protected Map _roleId_DeriveSubQuery_UserInfoListMap; + protected Map _roleId_DerivedReferrer_UserInfoListMap; - public Map getRoleId_DeriveSubQuery_UserInfoList() { - return _roleId_DeriveSubQuery_UserInfoListMap; + public Map getRoleId_DerivedReferrer_UserInfoList() { + return _roleId_DerivedReferrer_UserInfoListMap; } - public String keepRoleId_DeriveSubQuery_UserInfoList(UserInfoCQ subQuery) { - if (_roleId_DeriveSubQuery_UserInfoListMap == null) { - _roleId_DeriveSubQuery_UserInfoListMap = newLinkedHashMap(); + public String keepRoleId_DerivedReferrer_UserInfoList(UserInfoCQ subQuery) { + if (_roleId_DerivedReferrer_UserInfoListMap == null) { + _roleId_DerivedReferrer_UserInfoListMap = newLinkedHashMap(); } String key = "subQueryMapKey" - + (_roleId_DeriveSubQuery_UserInfoListMap.size() + 1); - _roleId_DeriveSubQuery_UserInfoListMap.put(key, subQuery); - return "roleId_DeriveSubQuery_UserInfoList." + key; + + (_roleId_DerivedReferrer_UserInfoListMap.size() + 1); + _roleId_DerivedReferrer_UserInfoListMap.put(key, subQuery); + return "roleId_DerivedReferrer_UserInfoList." + key; } public BsRoleInfoCQ addOrderBy_RoleId_Asc() { @@ -563,7 +563,30 @@ // ========= // Foreign Query // ============= + //========================================================================== + // ========= + // Derived Query + // ============= + protected Map _scalarSubQueryMap; + public Map getScalarSubQuery() { + return _scalarSubQueryMap; + } + + public String keepScalarSubQuery(RoleInfoCQ subQuery) { + if (_scalarSubQueryMap == null) { + _scalarSubQueryMap = newLinkedHashMap(); + } + String key = "subQueryMapKey" + (_scalarSubQueryMap.size() + 1); + _scalarSubQueryMap.put(key, subQuery); + return "scalarSubQuery." + key; + } + + // Very Internal (for Suppressing Warn about 'Not Use Import') + protected String getConditionBeanClassNameInternally() { + return RoleInfoCB.class.getName(); + } + protected String getConditionQueryClassNameInternally() { return RoleInfoCQ.class.getName(); } Modified: 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 2008-12-27 22:14:41 UTC (rev 1629) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/cq/bs/BsRoleMappingCQ.java 2008-12-27 22:18:30 UTC (rev 1630) @@ -5,6 +5,7 @@ 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.RoleMappingCB; 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; @@ -15,7 +16,6 @@ * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public class BsRoleMappingCQ extends AbstractBsRoleMappingCQ { //========================================================================== @@ -61,7 +61,7 @@ public RoleMappingCIQ on() { if (isBaseQuery(this)) { throw new UnsupportedOperationException( - "Unsupported onClause of Base Table!"); + "Unsupported on-clause for local table!"); } RoleMappingCIQ inlineQuery = inline(); inlineQuery.xsetOnClauseInline(true); @@ -210,7 +210,6 @@ // ========= // Foreign Query // ============= - public RoleInfoCQ queryRoleInfo() { return getConditionQueryRoleInfo(); } @@ -219,20 +218,13 @@ public RoleInfoCQ getConditionQueryRoleInfo() { if (_conditionQueryRoleInfo == null) { - _conditionQueryRoleInfo = createQueryRoleInfo(); - setupOuterJoin_RoleInfo(); + _conditionQueryRoleInfo = xcreateQueryRoleInfo(); + xsetupOuterJoinRoleInfo(); } return _conditionQueryRoleInfo; } - protected void setupOuterJoin_RoleInfo() { - Map joinOnMap = newLinkedHashMap(); - joinOnMap.put(getRealColumnName("ROLE_ID"), getConditionQueryRoleInfo() - .getRealColumnName("ROLE_ID")); - registerOuterJoin(getConditionQueryRoleInfo(), joinOnMap); - } - - protected RoleInfoCQ createQueryRoleInfo() { + protected RoleInfoCQ xcreateQueryRoleInfo() { String nrp = resolveNextRelationPath("ROLE_MAPPING", "roleInfo"); String jan = resolveJoinAliasName(nrp, getNextNestLevel()); RoleInfoCQ cq = new RoleInfoCQ(this, getSqlClause(), jan, @@ -242,6 +234,14 @@ return cq; } + protected void xsetupOuterJoinRoleInfo() { + RoleInfoCQ cq = getConditionQueryRoleInfo(); + Map joinOnMap = newLinkedHashMap(); + joinOnMap.put(getRealColumnName("ROLE_ID"), cq + .getRealColumnName("ROLE_ID")); + registerOuterJoin(cq, joinOnMap); + } + public boolean hasConditionQueryRoleInfo() { return _conditionQueryRoleInfo != null; } @@ -254,20 +254,13 @@ public UserInfoCQ getConditionQueryUserInfo() { if (_conditionQueryUserInfo == null) { - _conditionQueryUserInfo = createQueryUserInfo(); - setupOuterJoin_UserInfo(); + _conditionQueryUserInfo = xcreateQueryUserInfo(); + xsetupOuterJoinUserInfo(); } return _conditionQueryUserInfo; } - protected void setupOuterJoin_UserInfo() { - Map joinOnMap = newLinkedHashMap(); - joinOnMap.put(getRealColumnName("USER_ID"), getConditionQueryUserInfo() - .getRealColumnName("USER_ID")); - registerOuterJoin(getConditionQueryUserInfo(), joinOnMap); - } - - protected UserInfoCQ createQueryUserInfo() { + protected UserInfoCQ xcreateQueryUserInfo() { String nrp = resolveNextRelationPath("ROLE_MAPPING", "userInfo"); String jan = resolveJoinAliasName(nrp, getNextNestLevel()); UserInfoCQ cq = new UserInfoCQ(this, getSqlClause(), jan, @@ -277,10 +270,42 @@ return cq; } + protected void xsetupOuterJoinUserInfo() { + UserInfoCQ cq = getConditionQueryUserInfo(); + Map joinOnMap = newLinkedHashMap(); + joinOnMap.put(getRealColumnName("USER_ID"), cq + .getRealColumnName("USER_ID")); + registerOuterJoin(cq, joinOnMap); + } + public boolean hasConditionQueryUserInfo() { return _conditionQueryUserInfo != null; } + //========================================================================== + // ========= + // Derived Query + // ============= + protected Map _scalarSubQueryMap; + + public Map getScalarSubQuery() { + return _scalarSubQueryMap; + } + + public String keepScalarSubQuery(RoleMappingCQ subQuery) { + if (_scalarSubQueryMap == null) { + _scalarSubQueryMap = newLinkedHashMap(); + } + String key = "subQueryMapKey" + (_scalarSubQueryMap.size() + 1); + _scalarSubQueryMap.put(key, subQuery); + return "scalarSubQuery." + key; + } + + // Very Internal (for Suppressing Warn about 'Not Use Import') + protected String getConditionBeanClassNameInternally() { + return RoleMappingCB.class.getName(); + } + protected String getConditionQueryClassNameInternally() { return RoleMappingCQ.class.getName(); } Modified: 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 2008-12-27 22:14:41 UTC (rev 1629) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/cq/bs/BsUserInfoCQ.java 2008-12-27 22:18:30 UTC (rev 1630) @@ -5,6 +5,7 @@ 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.UserInfoCB; import jp.sf.pal.scheduler.db.cbean.cq.EventScheduleMappingCQ; import jp.sf.pal.scheduler.db.cbean.cq.GroupInfoCQ; import jp.sf.pal.scheduler.db.cbean.cq.GroupMappingCQ; @@ -18,7 +19,6 @@ * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public class BsUserInfoCQ extends AbstractBsUserInfoCQ { //========================================================================== @@ -64,7 +64,7 @@ public UserInfoCIQ on() { if (isBaseQuery(this)) { throw new UnsupportedOperationException( - "Unsupported onClause of Base Table!"); + "Unsupported on-clause for local table!"); } UserInfoCIQ inlineQuery = inline(); inlineQuery.xsetOnClauseInline(true); @@ -296,55 +296,55 @@ return "userId_NotExistsSubQuery_RoleMappingList." + key; } - protected Map _userId_DeriveSubQuery_EventScheduleMappingListMap; + protected Map _userId_DerivedReferrer_EventScheduleMappingListMap; - public Map getUserId_DeriveSubQuery_EventScheduleMappingList() { - return _userId_DeriveSubQuery_EventScheduleMappingListMap; + public Map getUserId_DerivedReferrer_EventScheduleMappingList() { + return _userId_DerivedReferrer_EventScheduleMappingListMap; } - public String keepUserId_DeriveSubQuery_EventScheduleMappingList( + public String keepUserId_DerivedReferrer_EventScheduleMappingList( EventScheduleMappingCQ subQuery) { - if (_userId_DeriveSubQuery_EventScheduleMappingListMap == null) { - _userId_DeriveSubQuery_EventScheduleMappingListMap = newLinkedHashMap(); + if (_userId_DerivedReferrer_EventScheduleMappingListMap == null) { + _userId_DerivedReferrer_EventScheduleMappingListMap = newLinkedHashMap(); } String key = "subQueryMapKey" - + (_userId_DeriveSubQuery_EventScheduleMappingListMap.size() + 1); - _userId_DeriveSubQuery_EventScheduleMappingListMap.put(key, subQuery); - return "userId_DeriveSubQuery_EventScheduleMappingList." + key; + + (_userId_DerivedReferrer_EventScheduleMappingListMap.size() + 1); + _userId_DerivedReferrer_EventScheduleMappingListMap.put(key, subQuery); + return "userId_DerivedReferrer_EventScheduleMappingList." + key; } - protected Map _userId_DeriveSubQuery_GroupMappingListMap; + protected Map _userId_DerivedReferrer_GroupMappingListMap; - public Map getUserId_DeriveSubQuery_GroupMappingList() { - return _userId_DeriveSubQuery_GroupMappingListMap; + public Map getUserId_DerivedReferrer_GroupMappingList() { + return _userId_DerivedReferrer_GroupMappingListMap; } - public String keepUserId_DeriveSubQuery_GroupMappingList( + public String keepUserId_DerivedReferrer_GroupMappingList( GroupMappingCQ subQuery) { - if (_userId_DeriveSubQuery_GroupMappingListMap == null) { - _userId_DeriveSubQuery_GroupMappingListMap = newLinkedHashMap(); + if (_userId_DerivedReferrer_GroupMappingListMap == null) { + _userId_DerivedReferrer_GroupMappingListMap = newLinkedHashMap(); } String key = "subQueryMapKey" - + (_userId_DeriveSubQuery_GroupMappingListMap.size() + 1); - _userId_DeriveSubQuery_GroupMappingListMap.put(key, subQuery); - return "userId_DeriveSubQuery_GroupMappingList." + key; + + (_userId_DerivedReferrer_GroupMappingListMap.size() + 1); + _userId_DerivedReferrer_GroupMappingListMap.put(key, subQuery); + return "userId_DerivedReferrer_GroupMappingList." + key; } - protected Map _userId_DeriveSubQuery_RoleMappingListMap; + protected Map _userId_DerivedReferrer_RoleMappingListMap; - public Map getUserId_DeriveSubQuery_RoleMappingList() { - return _userId_DeriveSubQuery_RoleMappingListMap; + public Map getUserId_DerivedReferrer_RoleMappingList() { + return _userId_DerivedReferrer_RoleMappingListMap; } - public String keepUserId_DeriveSubQuery_RoleMappingList( + public String keepUserId_DerivedReferrer_RoleMappingList( RoleMappingCQ subQuery) { - if (_userId_DeriveSubQuery_RoleMappingListMap == null) { - _userId_DeriveSubQuery_RoleMappingListMap = newLinkedHashMap(); + if (_userId_DerivedReferrer_RoleMappingListMap == null) { + _userId_DerivedReferrer_RoleMappingListMap = newLinkedHashMap(); } String key = "subQueryMapKey" - + (_userId_DeriveSubQuery_RoleMappingListMap.size() + 1); - _userId_DeriveSubQuery_RoleMappingListMap.put(key, subQuery); - return "userId_DeriveSubQuery_RoleMappingList." + key; + + (_userId_DerivedReferrer_RoleMappingListMap.size() + 1); + _userId_DerivedReferrer_RoleMappingListMap.put(key, subQuery); + return "userId_DerivedReferrer_RoleMappingList." + key; } public BsUserInfoCQ addOrderBy_UserId_Asc() { @@ -711,6 +711,29 @@ return this; } + protected ConditionValue _status; + + public ConditionValue getStatus() { + if (_status == null) { + _status = new ConditionValue(); + } + return _status; + } + + protected ConditionValue getCValueStatus() { + return getStatus(); + } + + public BsUserInfoCQ addOrderBy_Status_Asc() { + regOBA("STATUS"); + return this; + } + + public BsUserInfoCQ addOrderBy_Status_Desc() { + regOBD("STATUS"); + return this; + } + protected ConditionValue _createdTime; public ConditionValue getCreatedTime() { @@ -908,7 +931,6 @@ // ========= // Foreign Query // ============= - public GroupInfoCQ queryGroupInfo() { return getConditionQueryGroupInfo(); } @@ -917,20 +939,13 @@ public GroupInfoCQ getConditionQueryGroupInfo() { if (_conditionQueryGroupInfo == null) { - _conditionQueryGroupInfo = createQueryGroupInfo(); - setupOuterJoin_GroupInfo(); + _conditionQueryGroupInfo = xcreateQueryGroupInfo(); + xsetupOuterJoinGroupInfo(); } return _conditionQueryGroupInfo; } - protected void setupOuterJoin_GroupInfo() { - Map joinOnMap = newLinkedHashMap(); - joinOnMap.put(getRealColumnName("GROUP_ID"), - getConditionQueryGroupInfo().getRealColumnName("GROUP_ID")); - registerOuterJoin(getConditionQueryGroupInfo(), joinOnMap); - } - - protected GroupInfoCQ createQueryGroupInfo() { + protected GroupInfoCQ xcreateQueryGroupInfo() { String nrp = resolveNextRelationPath("USER_INFO", "groupInfo"); String jan = resolveJoinAliasName(nrp, getNextNestLevel()); GroupInfoCQ cq = new GroupInfoCQ(this, getSqlClause(), jan, @@ -940,6 +955,14 @@ return cq; } + protected void xsetupOuterJoinGroupInfo() { + GroupInfoCQ cq = getConditionQueryGroupInfo(); + Map joinOnMap = newLinkedHashMap(); + joinOnMap.put(getRealColumnName("GROUP_ID"), cq + .getRealColumnName("GROUP_ID")); + registerOuterJoin(cq, joinOnMap); + } + public boolean hasConditionQueryGroupInfo() { return _conditionQueryGroupInfo != null; } @@ -952,20 +975,13 @@ public RoleInfoCQ getConditionQueryRoleInfo() { if (_conditionQueryRoleInfo == null) { - _conditionQueryRoleInfo = createQueryRoleInfo(); - setupOuterJoin_RoleInfo(); + _conditionQueryRoleInfo = xcreateQueryRoleInfo(); + xsetupOuterJoinRoleInfo(); } return _conditionQueryRoleInfo; } - protected void setupOuterJoin_RoleInfo() { - Map joinOnMap = newLinkedHashMap(); - joinOnMap.put(getRealColumnName("ROLE_ID"), getConditionQueryRoleInfo() - .getRealColumnName("ROLE_ID")); - registerOuterJoin(getConditionQueryRoleInfo(), joinOnMap); - } - - protected RoleInfoCQ createQueryRoleInfo() { + protected RoleInfoCQ xcreateQueryRoleInfo() { String nrp = resolveNextRelationPath("USER_INFO", "roleInfo"); String jan = resolveJoinAliasName(nrp, getNextNestLevel()); RoleInfoCQ cq = new RoleInfoCQ(this, getSqlClause(), jan, @@ -975,10 +991,42 @@ return cq; } + protected void xsetupOuterJoinRoleInfo() { + RoleInfoCQ cq = getConditionQueryRoleInfo(); + Map joinOnMap = newLinkedHashMap(); + joinOnMap.put(getRealColumnName("ROLE_ID"), cq + .getRealColumnName("ROLE_ID")); + registerOuterJoin(cq, joinOnMap); + } + public boolean hasConditionQueryRoleInfo() { return _conditionQueryRoleInfo != null; } + //========================================================================== + // ========= + // Derived Query + // ============= + protected Map _scalarSubQueryMap; + + public Map getScalarSubQuery() { + return _scalarSubQueryMap; + } + + public String keepScalarSubQuery(UserInfoCQ subQuery) { + if (_scalarSubQueryMap == null) { + _scalarSubQueryMap = newLinkedHashMap(); + } + String key = "subQueryMapKey" + (_scalarSubQueryMap.size() + 1); + _scalarSubQueryMap.put(key, subQuery); + return "scalarSubQuery." + key; + } + + // Very Internal (for Suppressing Warn about 'Not Use Import') + protected String getConditionBeanClassNameInternally() { + return UserInfoCB.class.getName(); + } + protected String getConditionQueryClassNameInternally() { return UserInfoCQ.class.getName(); } Modified: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/cq/ciq/EventScheduleCIQ.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/cq/ciq/EventScheduleCIQ.java 2008-12-27 22:14:41 UTC (rev 1629) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/cq/ciq/EventScheduleCIQ.java 2008-12-27 22:18:30 UTC (rev 1630) @@ -5,6 +5,7 @@ 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.EventScheduleCB; import jp.sf.pal.scheduler.db.cbean.cq.EventScheduleCQ; import jp.sf.pal.scheduler.db.cbean.cq.EventScheduleContentCQ; import jp.sf.pal.scheduler.db.cbean.cq.EventScheduleMappingCQ; @@ -17,7 +18,6 @@ * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public class EventScheduleCIQ extends AbstractBsEventScheduleCQ { //========================================================================== @@ -167,16 +167,16 @@ "NotExistsSubQuery at inline() is unsupported! Sorry!"); } - public String keepId_DeriveSubQuery_EventScheduleMappingList( + public String keepId_DerivedReferrer_EventScheduleMappingList( EventScheduleMappingCQ subQuery) { throw new UnsupportedOperationException( - "DeriveSubQuery at inline() is unsupported! Sorry!"); + "DerivedReferrer at inline() is unsupported! Sorry!"); } - public String keepId_DeriveSubQuery_FacilityScheduleMappingList( + public String keepId_DerivedReferrer_FacilityScheduleMappingList( FacilityScheduleMappingCQ subQuery) { throw new UnsupportedOperationException( - "DeriveSubQuery at inline() is unsupported! Sorry!"); + "DerivedReferrer at inline() is unsupported! Sorry!"); } protected ConditionValue getCValueTitle() { @@ -239,6 +239,20 @@ return _myCQ.getVersionno(); } + //========================================================================== + // ========= + // Derived Query + // ============= + public String keepScalarSubQuery(EventScheduleCQ subQuery) { + throw new UnsupportedOperationException( + "ScalarSubQuery at inline() is unsupported! Sorry!"); + } + + // Very Internal (for Suppressing Warn about 'Not Use Import') + protected String getConditionBeanClassNameInternally() { + return EventScheduleCB.class.getName(); + } + protected String getConditionQueryClassNameInternally() { return EventScheduleCQ.class.getName(); } Modified: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/cq/ciq/EventScheduleContentCIQ.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/cq/ciq/EventScheduleContentCIQ.java 2008-12-27 22:14:41 UTC (rev 1629) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/cq/ciq/EventScheduleContentCIQ.java 2008-12-27 22:18:30 UTC (rev 1630) @@ -5,6 +5,7 @@ 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.EventScheduleContentCB; import jp.sf.pal.scheduler.db.cbean.cq.EventScheduleCQ; import jp.sf.pal.scheduler.db.cbean.cq.EventScheduleContentCQ; import jp.sf.pal.scheduler.db.cbean.cq.bs.AbstractBsEventScheduleContentCQ; @@ -15,7 +16,6 @@ * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public class EventScheduleContentCIQ extends AbstractBsEventScheduleContentCQ { //========================================================================== @@ -104,6 +104,20 @@ return _myCQ.getContent(); } + //========================================================================== + // ========= + // Derived Query + // ============= + public String keepScalarSubQuery(EventScheduleContentCQ subQuery) { + throw new UnsupportedOperationException( + "ScalarSubQuery at inline() is unsupported! Sorry!"); + } + + // Very Internal (for Suppressing Warn about 'Not Use Import') + protected String getConditionBeanClassNameInternally() { + return EventScheduleContentCB.class.getName(); + } + protected String getConditionQueryClassNameInternally() { return EventScheduleContentCQ.class.getName(); } Modified: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/cq/ciq/EventScheduleMappingCIQ.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/cq/ciq/EventScheduleMappingCIQ.java 2008-12-27 22:14:41 UTC (rev 1629) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/cq/ciq/EventScheduleMappingCIQ.java 2008-12-27 22:18:30 UTC (rev 1630) @@ -5,6 +5,7 @@ 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.EventScheduleMappingCB; import jp.sf.pal.scheduler.db.cbean.cq.EventScheduleCQ; import jp.sf.pal.scheduler.db.cbean.cq.EventScheduleMappingCQ; import jp.sf.pal.scheduler.db.cbean.cq.UserInfoCQ; @@ -16,7 +17,6 @@ * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public class EventScheduleMappingCIQ extends AbstractBsEventScheduleMappingCQ { //========================================================================== @@ -114,6 +114,20 @@ return _myCQ.keepUserId_InScopeSubQuery_UserInfo(subQuery); } + //========================================================================== + // ========= + // Derived Query + // ============= + public String keepScalarSubQuery(EventScheduleMappingCQ subQuery) { + throw new UnsupportedOperationException( + "ScalarSubQuery at inline() is unsupported! Sorry!"); + } + + // Very Internal (for Suppressing Warn about 'Not Use Import') + protected String getConditionBeanClassNameInternally() { + return EventScheduleMappingCB.class.getName(); + } + protected String getConditionQueryClassNameInternally() { return EventScheduleMappingCQ.class.getName(); } Modified: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/cq/ciq/FacilityCIQ.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/cq/ciq/FacilityCIQ.java 2008-12-27 22:14:41 UTC (rev 1629) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/cq/ciq/FacilityCIQ.java 2008-12-27 22:18:30 UTC (rev 1630) @@ -5,6 +5,7 @@ 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.FacilityCB; import jp.sf.pal.scheduler.db.cbean.cq.FacilityCQ; import jp.sf.pal.scheduler.db.cbean.cq.FacilityContentCQ; import jp.sf.pal.scheduler.db.cbean.cq.FacilityGroupCQ; @@ -17,7 +18,6 @@ * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public class FacilityCIQ extends AbstractBsFacilityCQ { //========================================================================== @@ -143,10 +143,10 @@ "NotExistsSubQuery at inline() is unsupported! Sorry!"); } - public String keepId_DeriveSubQuery_FacilityScheduleMappingList( + public String keepId_DerivedReferrer_FacilityScheduleMappingList( FacilityScheduleMappingCQ subQuery) { throw new UnsupportedOperationException( - "DeriveSubQuery at inline() is unsupported! Sorry!"); + "DerivedReferrer at inline() is unsupported! Sorry!"); } protected ConditionValue getCValueName() { @@ -194,6 +194,20 @@ return _myCQ.getVersionno(); } + //========================================================================== + // ========= + // Derived Query + // ============= + public String keepScalarSubQuery(FacilityCQ subQuery) { + throw new UnsupportedOperationException( + "ScalarSubQuery at inline() is unsupported! Sorry!"); + } + + // Very Internal (for Suppressing Warn about 'Not Use Import') + protected String getConditionBeanClassNameInternally() { + return FacilityCB.class.getName(); + } + protected String getConditionQueryClassNameInternally() { return FacilityCQ.class.getName(); } Modified: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/cq/ciq/FacilityContentCIQ.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/cq/ciq/FacilityContentCIQ.java 2008-12-27 22:14:41 UTC (rev 1629) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/cq/ciq/FacilityContentCIQ.java 2008-12-27 22:18:30 UTC (rev 1630) @@ -5,6 +5,7 @@ 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.FacilityContentCB; import jp.sf.pal.scheduler.db.cbean.cq.FacilityCQ; import jp.sf.pal.scheduler.db.cbean.cq.FacilityContentCQ; import jp.sf.pal.scheduler.db.cbean.cq.bs.AbstractBsFacilityContentCQ; @@ -15,7 +16,6 @@ * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public class FacilityContentCIQ extends AbstractBsFacilityContentCQ { //========================================================================== @@ -103,6 +103,20 @@ return _myCQ.getContent(); } + //========================================================================== + // ========= + // Derived Query + // ============= + public String keepScalarSubQuery(FacilityContentCQ subQuery) { + throw new UnsupportedOperationException( + "ScalarSubQuery at inline() is unsupported! Sorry!"); + } + + // Very Internal (for Suppressing Warn about 'Not Use Import') + protected String getConditionBeanClassNameInternally() { + return FacilityContentCB.class.getName(); + } + protected String getConditionQueryClassNameInternally() { return FacilityContentCQ.class.getName(); } Modified: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/cq/ciq/FacilityGroupCIQ.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/cq/ciq/FacilityGroupCIQ.java 2008-12-27 22:14:41 UTC (rev 1629) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/cq/ciq/FacilityGroupCIQ.java 2008-12-27 22:18:30 UTC (rev 1630) @@ -5,6 +5,7 @@ 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.FacilityGroupCB; import jp.sf.pal.scheduler.db.cbean.cq.FacilityCQ; import jp.sf.pal.scheduler.db.cbean.cq.FacilityGroupCQ; import jp.sf.pal.scheduler.db.cbean.cq.bs.AbstractBsFacilityGroupCQ; @@ -15,7 +16,6 @@ * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public class FacilityGroupCIQ extends AbstractBsFacilityGroupCQ { //========================================================================== @@ -113,9 +113,9 @@ "NotExistsSubQuery at inline() is unsupported! Sorry!"); } - public String keepId_DeriveSubQuery_FacilityList(FacilityCQ subQuery) { + public String keepId_DerivedReferrer_FacilityList(FacilityCQ subQuery) { throw new UnsupportedOperationException( - "DeriveSubQuery at inline() is unsupported! Sorry!"); + "DerivedReferrer at inline() is unsupported! Sorry!"); } protected ConditionValue getCValueName() { @@ -154,6 +154,20 @@ return _myCQ.getVersionno(); } + //========================================================================== + // ========= + // Derived Query + // ============= + public String keepScalarSubQuery(FacilityGroupCQ subQuery) { + throw new UnsupportedOperationException( + "ScalarSubQuery at inline() is unsupported! Sorry!"); + } + + // Very Internal (for Suppressing Warn about 'Not Use Import') + protected String getConditionBeanClassNameInternally() { + return FacilityGroupCB.class.getName(); + } + protected String getConditionQueryClassNameInternally() { return FacilityGroupCQ.class.getName(); } Modified: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/cq/ciq/FacilityScheduleMappingCIQ.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/cq/ciq/FacilityScheduleMappingCIQ.java 2008-12-27 22:14:41 UTC (rev 1629) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/cq/ciq/FacilityScheduleMappingCIQ.java 2008-12-27 22:18:30 UTC (rev 1630) @@ -5,6 +5,7 @@ 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.FacilityScheduleMappingCB; import jp.sf.pal.scheduler.db.cbean.cq.EventScheduleCQ; import jp.sf.pal.scheduler.db.cbean.cq.FacilityCQ; import jp.sf.pal.scheduler.db.cbean.cq.FacilityScheduleMappingCQ; @@ -16,7 +17,6 @@ * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public class FacilityScheduleMappingCIQ extends AbstractBsFacilityScheduleMappingCQ { @@ -115,6 +115,20 @@ return _myCQ.keepFacilityId_InScopeSubQuery_Facility(subQuery); } + //========================================================================== + // ========= + // Derived Query + // ============= + public String keepScalarSubQuery(FacilityScheduleMappingCQ subQuery) { + throw new UnsupportedOperationException( + "ScalarSubQuery at inline() is unsupported! Sorry!"); + } + + // Very Internal (for Suppressing Warn about 'Not Use Import') + protected String getConditionBeanClassNameInternally() { + return FacilityScheduleMappingCB.class.getName(); + } + protected String getConditionQueryClassNameInternally() { return FacilityScheduleMappingCQ.class.getName(); } Modified: 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 2008-12-27 22:14:41 UTC (rev 1629) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/cq/ciq/GroupInfoCIQ.java 2008-12-27 22:18:30 UTC (rev 1630) @@ -5,6 +5,7 @@ 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.GroupInfoCB; 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; @@ -16,7 +17,6 @@ * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public class GroupInfoCIQ extends AbstractBsGroupInfoCQ { //========================================================================== @@ -137,15 +137,15 @@ "NotExistsSubQuery at inline() is unsupported! Sorry!"); } - public String keepGroupId_DeriveSubQuery_GroupMappingList( + public String keepGroupId_DerivedReferrer_GroupMappingList( GroupMappingCQ subQuery) { throw new UnsupportedOperationException( - "DeriveSubQuery at inline() is unsupported! Sorry!"); + "DerivedReferrer at inline() is unsupported! Sorry!"); } - public String keepGroupId_DeriveSubQuery_UserInfoList(UserInfoCQ subQuery) { + public String keepGroupId_DerivedReferrer_UserInfoList(UserInfoCQ subQuery) { throw new UnsupportedOperationException( - "DeriveSubQuery at inline() is unsupported! Sorry!"); + "DerivedReferrer at inline() is unsupported! Sorry!"); } protected ConditionValue getCValueName() { @@ -196,6 +196,20 @@ return _myCQ.getVersionno(); } + //========================================================================== + // ========= + // Derived Query + // ============= + public String keepScalarSubQuery(GroupInfoCQ subQuery) { + throw new UnsupportedOperationException( + "ScalarSubQuery at inline() is unsupported! Sorry!"); + } + + // Very Internal (for Suppressing Warn about 'Not Use Import') + protected String getConditionBeanClassNameInternally() { + return GroupInfoCB.class.getName(); + } + protected String getConditionQueryClassNameInternally() { return GroupInfoCQ.class.getName(); } Modified: 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 2008-12-27 22:14:41 UTC (rev 1629) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/cq/ciq/GroupMappingCIQ.java 2008-12-27 22:18:30 UTC (rev 1630) @@ -5,6 +5,7 @@ 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.GroupMappingCB; 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; @@ -16,7 +17,6 @@ * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public class GroupMappingCIQ extends AbstractBsGroupMappingCQ { //========================================================================== @@ -112,6 +112,20 @@ return _myCQ.keepGroupId_InScopeSubQuery_GroupInfo(subQuery); } + //========================================================================== + // ========= + // Derived Query + // ============= + public String keepScalarSubQuery(GroupMappingCQ subQuery) { + throw new UnsupportedOperationException( + "ScalarSubQuery at inline() is unsupported! Sorry!"); + } + + // Very Internal (for Suppressing Warn about 'Not Use Import') + protected String getConditionBeanClassNameInternally() { + return GroupMappingCB.class.getName(); + } + protected String getConditionQueryClassNameInternally() { return GroupMappingCQ.class.getName(); } Modified: 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 2008-12-27 22:14:41 UTC (rev 1629) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/cq/ciq/RoleInfoCIQ.java 2008-12-27 22:18:30 UTC (rev 1630) @@ -5,6 +5,7 @@ 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.RoleInfoCB; 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; @@ -16,7 +17,6 @@ * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public class RoleInfoCIQ extends AbstractBsRoleInfoCQ { //========================================================================== @@ -136,15 +136,15 @@ "NotExistsSubQuery at inline() is unsupported! Sorry!"); } - public String keepRoleId_DeriveSubQuery_RoleMappingList( + public String keepRoleId_DerivedReferrer_RoleMappingList( RoleMappingCQ subQuery) { throw new UnsupportedOperationException( - "DeriveSubQuery at inline() is unsupported! Sorry!"); + "DerivedReferrer at inline() is unsupported! Sorry!"); } - public String keepRoleId_DeriveSubQuery_UserInfoList(UserInfoCQ subQuery) { + public String keepRoleId_DerivedReferrer_UserInfoList(UserInfoCQ subQuery) { throw new UnsupportedOperationException( - "DeriveSubQuery at inline() is unsupported! Sorry!"); + "DerivedReferrer at inline() is unsupported! Sorry!"); } protected ConditionValue getCValueName() { @@ -195,6 +195,20 @@ return _myCQ.getVersionno(); } + //========================================================================== + // ========= + // Derived Query + // ============= + public String keepScalarSubQuery(RoleInfoCQ subQuery) { + throw new UnsupportedOperationException( + "ScalarSubQuery at inline() is unsupported! Sorry!"); + } + + // Very Internal (for Suppressing Warn about 'Not Use Import') + protected String getConditionBeanClassNameInternally() { + return RoleInfoCB.class.getName(); + } + protected String getConditionQueryClassNameInternally() { return RoleInfoCQ.class.getName(); } Modified: 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 2008-12-27 22:14:41 UTC (rev 1629) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/cq/ciq/RoleMappingCIQ.java 2008-12-27 22:18:30 UTC (rev 1630) @@ -5,6 +5,7 @@ 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.RoleMappingCB; 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; @@ -16,7 +17,6 @@ * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public class RoleMappingCIQ extends AbstractBsRoleMappingCQ { //========================================================================== @@ -112,6 +112,20 @@ return _myCQ.keepRoleId_InScopeSubQuery_RoleInfo(subQuery); } + //========================================================================== + // ========= + // Derived Query + // ============= + public String keepScalarSubQuery(RoleMappingCQ subQuery) { + throw new UnsupportedOperationException( + "ScalarSubQuery at inline() is unsupported! Sorry!"); + } + + // Very Internal (for Suppressing Warn about 'Not Use Import') + protected String getConditionBeanClassNameInternally() { + return RoleMappingCB.class.getName(); + } + protected String getConditionQueryClassNameInternally() { return RoleMappingCQ.class.getName(); } Modified: 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 2008-12-27 22:14:41 UTC (rev 1629) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/cq/ciq/UserInfoCIQ.java 2008-12-27 22:18:30 UTC (rev 1630) @@ -5,6 +5,7 @@ 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.UserInfoCB; import jp.sf.pal.scheduler.db.cbean.cq.EventScheduleMappingCQ; import jp.sf.pal.scheduler.db.cbean.cq.GroupInfoCQ; import jp.sf.pal.scheduler.db.cbean.cq.GroupMappingCQ; @@ -19,7 +20,6 @@ * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public class UserInfoCIQ extends AbstractBsUserInfoCQ { //========================================================================== @@ -167,22 +167,22 @@ "NotExistsSubQuery at inline() is unsupported! Sorry!"); } - public String keepUserId_DeriveSubQuery_EventScheduleMappingList( + public String keepUserId_DerivedReferrer_EventScheduleMappingList( EventScheduleMappingCQ subQuery) { throw new UnsupportedOperationException( - "DeriveSubQuery at inline() is unsupported! Sorry!"); + "DerivedReferrer at inline() is unsupported! Sorry!"); } - public String keepUserId_DeriveSubQuery_GroupMappingList( + public String keepUserId_DerivedReferrer_GroupMappingList( GroupMappingCQ subQuery) { throw new UnsupportedOperationException( - "DeriveSubQuery at inline() is unsupported! Sorry!"); + "DerivedReferrer at inline() is unsupported! Sorry!"); } - public String keepUserId_DeriveSubQuery_RoleMappingList( + public String keepUserId_DerivedReferrer_RoleMappingList( RoleMappingCQ subQuery) { throw new UnsupportedOperationException( - "DeriveSubQuery at inline() is unsupported! Sorry!"); + "DerivedReferrer at inline() is unsupported! Sorry!"); } protected ConditionValue getCValueGivenName() { @@ -249,6 +249,10 @@ return _myCQ.keepGroupId_InScopeSubQuery_GroupInfo(subQuery); } + protected ConditionValue getCValueStatus() { + return _myCQ.getStatus(); + } + protected ConditionValue getCValueCreatedTime() { return _myCQ.getCreatedTime(); } @@ -277,6 +281,20 @@ return _myCQ.getVersionno(); } + //========================================================================== + // ========= + // Derived Query + // ============= + public String keepScalarSubQuery(UserInfoCQ subQuery) { + throw new UnsupportedOperationException( + "ScalarSubQuery at inline() is unsupported! Sorry!"); + } + + // Very Internal (for Suppressing Warn about 'Not Use Import') + protected String getConditionBeanClassNameInternally() { + return UserInfoCB.class.getName(); + } + protected String getConditionQueryClassNameInternally() { return UserInfoCQ.class.getName(); } Modified: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/nss/EventScheduleContentNss.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/nss/EventScheduleContentNss.java 2008-12-27 22:14:41 UTC (rev 1629) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/nss/EventScheduleContentNss.java 2008-12-27 22:18:30 UTC (rev 1630) @@ -8,7 +8,6 @@ * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public class EventScheduleContentNss { protected EventScheduleContentCQ _query; Modified: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/nss/EventScheduleMappingNss.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/nss/EventScheduleMappingNss.java 2008-12-27 22:14:41 UTC (rev 1629) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/nss/EventScheduleMappingNss.java 2008-12-27 22:18:30 UTC (rev 1630) @@ -8,7 +8,6 @@ * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public class EventScheduleMappingNss { protected EventScheduleMappingCQ _query; Modified: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/nss/EventScheduleNss.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/nss/EventScheduleNss.java 2008-12-27 22:14:41 UTC (rev 1629) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/nss/EventScheduleNss.java 2008-12-27 22:18:30 UTC (rev 1630) @@ -8,7 +8,6 @@ * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public class EventScheduleNss { protected EventScheduleCQ _query; Modified: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/nss/FacilityContentNss.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/nss/FacilityContentNss.java 2008-12-27 22:14:41 UTC (rev 1629) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/nss/FacilityContentNss.java 2008-12-27 22:18:30 UTC (rev 1630) @@ -8,7 +8,6 @@ * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public class FacilityContentNss { protected FacilityContentCQ _query; Modified: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/nss/FacilityGroupNss.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/nss/FacilityGroupNss.java 2008-12-27 22:14:41 UTC (rev 1629) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/nss/FacilityGroupNss.java 2008-12-27 22:18:30 UTC (rev 1630) @@ -7,7 +7,6 @@ * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public class FacilityGroupNss { protected FacilityGroupCQ _query; Modified: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/nss/FacilityNss.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/nss/FacilityNss.java 2008-12-27 22:14:41 UTC (rev 1629) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/nss/FacilityNss.java 2008-12-27 22:18:30 UTC (rev 1630) @@ -8,7 +8,6 @@ * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public class FacilityNss { protected FacilityCQ _query; Modified: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/nss/FacilityScheduleMappingNss.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/nss/FacilityScheduleMappingNss.java 2008-12-27 22:14:41 UTC (rev 1629) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/nss/FacilityScheduleMappingNss.java 2008-12-27 22:18:30 UTC (rev 1630) @@ -8,7 +8,6 @@ * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public class FacilityScheduleMappingNss { protected FacilityScheduleMappingCQ _query; Modified: 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 2008-12-27 22:14:41 UTC (rev 1629) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/nss/GroupInfoNss.java 2008-12-27 22:18:30 UTC (rev 1630) @@ -7,7 +7,6 @@ * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public class GroupInfoNss { protected GroupInfoCQ _query; Modified: 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 2008-12-27 22:14:41 UTC (rev 1629) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/nss/GroupMappingNss.java 2008-12-27 22:18:30 UTC (rev 1630) @@ -8,7 +8,6 @@ * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public class GroupMappingNss { protected GroupMappingCQ _query; Modified: 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 2008-12-27 22:14:41 UTC (rev 1629) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/nss/RoleInfoNss.java 2008-12-27 22:18:30 UTC (rev 1630) @@ -7,7 +7,6 @@ * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public class RoleInfoNss { protected RoleInfoCQ _query; Modified: 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 2008-12-27 22:14:41 UTC (rev 1629) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/nss/RoleMappingNss.java 2008-12-27 22:18:30 UTC (rev 1630) @@ -8,7 +8,6 @@ * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public class RoleMappingNss { protected RoleMappingCQ _query; Modified: 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 2008-12-27 22:14:41 UTC (rev 1629) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/nss/UserInfoNss.java 2008-12-27 22:18:30 UTC (rev 1630) @@ -8,7 +8,6 @@ * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public class UserInfoNss { protected UserInfoCQ _query; Modified: scheduler/trunk/src/main/resources/dbflute.dicon =================================================================== --- scheduler/trunk/src/main/resources/dbflute.dicon 2008-12-27 22:14:41 UTC (rev 1629) +++ scheduler/trunk/src/main/resources/dbflute.dicon 2008-12-27 22:18:30 UTC (rev 1630) @@ -5,113 +5,44 @@ - - - "UTF-8" + + + + + + - + + + + + - - - - + + - - - - - - - - - - - - dbflute.interceptor - - - - - - dbflute.interceptor - - - - - dbflute.interceptor - - - - - dbflute.interceptor - - - - - dbflute.interceptor - - - - - dbflute.interceptor - - - - - dbflute.interceptor - - - - - dbflute.interceptor - - - - - dbflute.interceptor - - - - - dbflute.interceptor - - - - - dbflute.interceptor - - - - - dbflute.interceptor - - - - - dbflute.interceptor - Modified: scheduler/trunk/src/main/webapp/WEB-INF/db/scheduler.1.log.db =================================================================== (Binary files differ) Modified: scheduler/trunk/src/main/webapp/WEB-INF/db/scheduler.data.db =================================================================== (Binary files differ) From svnnotify ¡÷ sourceforge.jp Sun Dec 28 07:20:25 2008 From: svnnotify ¡÷ sourceforge.jp (svnnotify ¡÷ sourceforge.jp) Date: Sun, 28 Dec 2008 07:20:25 +0900 Subject: [pal-cvs 3896] [1631] added status column to userinfo table. Message-ID: <1230416425.541658.19026.nullmailer@users.sourceforge.jp> Revision: 1631 http://svn.sourceforge.jp/view?root=pal&view=rev&rev=1631 Author: shinsuke Date: 2008-12-28 07:20:25 +0900 (Sun, 28 Dec 2008) Log Message: ----------- added status column to userinfo table. replaced with dbflute 0.8.7. Modified Paths: -------------- timecard/trunk/dbflute/_project.bat timecard/trunk/dbflute/_project.sh timecard/trunk/dbflute/build-timecard.properties timecard/trunk/mydbflute/README.txt timecard/trunk/src/main/config/erd/timecard.erd timecard/trunk/src/main/config/sql/timecard.ddl timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/BehaviorSelector.java timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/CacheBehaviorSelector.java timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/DBFluteConfig.java timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/EntityDefinedCommonColumn.java timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/bhv/AbstractBehaviorReadable.java timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/bhv/AbstractBehaviorWritable.java timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/bhv/BehaviorReadable.java timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/bhv/BehaviorWritable.java timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/cbean/AbstractConditionBean.java timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/cbean/AbstractConditionQuery.java timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/cbean/ConditionBean.java timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/cbean/ConditionBeanContext.java timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/cbean/ConditionQuery.java timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/cbean/ckey/ConditionKey.java timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/cbean/coption/FromToOption.java timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/cbean/coption/LikeSearchOption.java timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/cbean/cvalue/ConditionValue.java timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/cbean/outsidesql/OutsideSqlContext.java timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/cbean/outsidesql/OutsideSqlOption.java timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/cbean/outsidesql/executor/OutsideSqlBasicExecutor.java timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/cbean/outsidesql/executor/OutsideSqlCursorExecutor.java timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/cbean/outsidesql/executor/OutsideSqlEntityExecutor.java timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/cbean/outsidesql/executor/OutsideSqlPagingExecutor.java timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/cbean/sqlclause/AbstractSqlClause.java timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/cbean/sqlclause/SqlClause.java timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/cbean/sqlclause/SqlClauseOracle.java timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/dbmeta/AbstractDBMeta.java timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/dbmeta/DBMeta.java timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/dbmeta/DBMetaInstanceHandler.java timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/dbmeta/hierarchy/HierarchyArranger.java timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/dbmeta/hierarchy/HierarchyRequest.java timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/dbmeta/hierarchy/HierarchyRequestElement.java timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/dbmeta/hierarchy/HierarchySourceColumn.java timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/dbmeta/hierarchy/HierarchySourceIterator.java timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/dbmeta/hierarchy/HierarchySourceRow.java timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/dbmeta/info/ColumnInfo.java timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/dbmeta/info/RelationInfo.java timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/helper/MapStringBuilderImpl.java timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/s2dao/FetchNarrowingResultSetWrapper.java timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/s2dao/internal/rshandler/InternalAbstractDtoMetaDataResultSetHandler.java timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/s2dao/internal/sqlcommand/InternalAbstractAutoStaticCommand.java timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/s2dao/internal/sqlcommand/InternalAbstractBatchAutoStaticCommand.java timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/s2dao/internal/sqlcommand/InternalAbstractDynamicCommand.java timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/s2dao/internal/sqlcommand/InternalAbstractSqlCommand.java timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/s2dao/internal/sqlcommand/InternalDeleteAutoStaticCommand.java timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/s2dao/internal/sqlcommand/InternalDeleteBatchAutoStaticCommand.java timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/s2dao/internal/sqlcommand/InternalDeleteQueryAutoDynamicCommand.java timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/s2dao/internal/sqlcommand/InternalInsertAutoDynamicCommand.java timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/s2dao/internal/sqlcommand/InternalInsertBatchAutoStaticCommand.java timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/s2dao/internal/sqlcommand/InternalProcedureCommand.java timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/s2dao/internal/sqlcommand/InternalUpdateAutoDynamicCommand.java timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/s2dao/internal/sqlcommand/InternalUpdateBatchAutoStaticCommand.java timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/s2dao/internal/sqlcommand/InternalUpdateDynamicCommand.java timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/s2dao/internal/sqlcommand/InternalUpdateQueryAutoDynamicCommand.java timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/s2dao/internal/sqlhandler/InternalAbstractAutoHandler.java timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/s2dao/internal/sqlhandler/InternalAbstractBatchAutoHandler.java timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/s2dao/internal/sqlhandler/InternalBasicHandler.java timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/s2dao/internal/sqlhandler/InternalBasicSelectHandler.java timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/s2dao/internal/sqlhandler/InternalBasicUpdateHandler.java timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/s2dao/internal/sqlhandler/InternalInsertAutoHandler.java timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/s2dao/internal/sqlhandler/InternalInsertBatchAutoHandler.java timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/s2dao/internal/sqlhandler/InternalProcedureHandler.java timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/s2dao/internal/sqlhandler/InternalUpdateAutoHandler.java timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/s2dao/internal/sqlparser/InternalSqlParser.java timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/s2dao/internal/various/InternalProcedureMetaDataFactory.java timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/util/SimpleAssertUtil.java timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/util/SimpleStringUtil.java timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/util/SimpleSystemUtil.java timecard/trunk/src/main/java/jp/sf/pal/timecard/db/bsbhv/BsDailyReportBhv.java timecard/trunk/src/main/java/jp/sf/pal/timecard/db/bsbhv/BsEmployeeBhv.java timecard/trunk/src/main/java/jp/sf/pal/timecard/db/bsbhv/BsGroupInfoBhv.java timecard/trunk/src/main/java/jp/sf/pal/timecard/db/bsbhv/BsGroupMappingBhv.java timecard/trunk/src/main/java/jp/sf/pal/timecard/db/bsbhv/BsMonthlyReportBhv.java timecard/trunk/src/main/java/jp/sf/pal/timecard/db/bsbhv/BsMonthlyWorkingReportBhv.java timecard/trunk/src/main/java/jp/sf/pal/timecard/db/bsbhv/BsRoleInfoBhv.java timecard/trunk/src/main/java/jp/sf/pal/timecard/db/bsbhv/BsRoleMappingBhv.java timecard/trunk/src/main/java/jp/sf/pal/timecard/db/bsbhv/BsUserInfoBhv.java timecard/trunk/src/main/java/jp/sf/pal/timecard/db/bsbhv/BsWorkingTypeBhv.java timecard/trunk/src/main/java/jp/sf/pal/timecard/db/bsentity/BsDailyReport.java timecard/trunk/src/main/java/jp/sf/pal/timecard/db/bsentity/BsEmployee.java timecard/trunk/src/main/java/jp/sf/pal/timecard/db/bsentity/BsGroupInfo.java timecard/trunk/src/main/java/jp/sf/pal/timecard/db/bsentity/BsGroupMapping.java timecard/trunk/src/main/java/jp/sf/pal/timecard/db/bsentity/BsMonthlyReport.java timecard/trunk/src/main/java/jp/sf/pal/timecard/db/bsentity/BsMonthlyWorkingReport.java timecard/trunk/src/main/java/jp/sf/pal/timecard/db/bsentity/BsRoleInfo.java timecard/trunk/src/main/java/jp/sf/pal/timecard/db/bsentity/BsRoleMapping.java timecard/trunk/src/main/java/jp/sf/pal/timecard/db/bsentity/BsUserInfo.java timecard/trunk/src/main/java/jp/sf/pal/timecard/db/bsentity/BsWorkingType.java timecard/trunk/src/main/java/jp/sf/pal/timecard/db/bsentity/dbmeta/DailyReportDbm.java timecard/trunk/src/main/java/jp/sf/pal/timecard/db/bsentity/dbmeta/EmployeeDbm.java timecard/trunk/src/main/java/jp/sf/pal/timecard/db/bsentity/dbmeta/GroupInfoDbm.java timecard/trunk/src/main/java/jp/sf/pal/timecard/db/bsentity/dbmeta/GroupMappingDbm.java timecard/trunk/src/main/java/jp/sf/pal/timecard/db/bsentity/dbmeta/MonthlyReportDbm.java timecard/trunk/src/main/java/jp/sf/pal/timecard/db/bsentity/dbmeta/MonthlyWorkingReportDbm.java timecard/trunk/src/main/java/jp/sf/pal/timecard/db/bsentity/dbmeta/RoleInfoDbm.java timecard/trunk/src/main/java/jp/sf/pal/timecard/db/bsentity/dbmeta/RoleMappingDbm.java timecard/trunk/src/main/java/jp/sf/pal/timecard/db/bsentity/dbmeta/UserInfoDbm.java timecard/trunk/src/main/java/jp/sf/pal/timecard/db/bsentity/dbmeta/WorkingTypeDbm.java timecard/trunk/src/main/java/jp/sf/pal/timecard/db/cbean/bs/BsDailyReportCB.java timecard/trunk/src/main/java/jp/sf/pal/timecard/db/cbean/bs/BsEmployeeCB.java timecard/trunk/src/main/java/jp/sf/pal/timecard/db/cbean/bs/BsGroupInfoCB.java timecard/trunk/src/main/java/jp/sf/pal/timecard/db/cbean/bs/BsGroupMappingCB.java timecard/trunk/src/main/java/jp/sf/pal/timecard/db/cbean/bs/BsMonthlyReportCB.java timecard/trunk/src/main/java/jp/sf/pal/timecard/db/cbean/bs/BsMonthlyWorkingReportCB.java timecard/trunk/src/main/java/jp/sf/pal/timecard/db/cbean/bs/BsRoleInfoCB.java timecard/trunk/src/main/java/jp/sf/pal/timecard/db/cbean/bs/BsRoleMappingCB.java timecard/trunk/src/main/java/jp/sf/pal/timecard/db/cbean/bs/BsUserInfoCB.java timecard/trunk/src/main/java/jp/sf/pal/timecard/db/cbean/bs/BsWorkingTypeCB.java timecard/trunk/src/main/java/jp/sf/pal/timecard/db/cbean/cq/bs/AbstractBsDailyReportCQ.java timecard/trunk/src/main/java/jp/sf/pal/timecard/db/cbean/cq/bs/AbstractBsEmployeeCQ.java timecard/trunk/src/main/java/jp/sf/pal/timecard/db/cbean/cq/bs/AbstractBsGroupInfoCQ.java timecard/trunk/src/main/java/jp/sf/pal/timecard/db/cbean/cq/bs/AbstractBsGroupMappingCQ.java timecard/trunk/src/main/java/jp/sf/pal/timecard/db/cbean/cq/bs/AbstractBsMonthlyReportCQ.java timecard/trunk/src/main/java/jp/sf/pal/timecard/db/cbean/cq/bs/AbstractBsMonthlyWorkingReportCQ.java timecard/trunk/src/main/java/jp/sf/pal/timecard/db/cbean/cq/bs/AbstractBsRoleInfoCQ.java timecard/trunk/src/main/java/jp/sf/pal/timecard/db/cbean/cq/bs/AbstractBsRoleMappingCQ.java timecard/trunk/src/main/java/jp/sf/pal/timecard/db/cbean/cq/bs/AbstractBsUserInfoCQ.java timecard/trunk/src/main/java/jp/sf/pal/timecard/db/cbean/cq/bs/AbstractBsWorkingTypeCQ.java timecard/trunk/src/main/java/jp/sf/pal/timecard/db/cbean/cq/bs/BsDailyReportCQ.java timecard/trunk/src/main/java/jp/sf/pal/timecard/db/cbean/cq/bs/BsEmployeeCQ.java timecard/trunk/src/main/java/jp/sf/pal/timecard/db/cbean/cq/bs/BsGroupInfoCQ.java timecard/trunk/src/main/java/jp/sf/pal/timecard/db/cbean/cq/bs/BsGroupMappingCQ.java timecard/trunk/src/main/java/jp/sf/pal/timecard/db/cbean/cq/bs/BsMonthlyReportCQ.java timecard/trunk/src/main/java/jp/sf/pal/timecard/db/cbean/cq/bs/BsMonthlyWorkingReportCQ.java timecard/trunk/src/main/java/jp/sf/pal/timecard/db/cbean/cq/bs/BsRoleInfoCQ.java timecard/trunk/src/main/java/jp/sf/pal/timecard/db/cbean/cq/bs/BsRoleMappingCQ.java timecard/trunk/src/main/java/jp/sf/pal/timecard/db/cbean/cq/bs/BsUserInfoCQ.java timecard/trunk/src/main/java/jp/sf/pal/timecard/db/cbean/cq/bs/BsWorkingTypeCQ.java timecard/trunk/src/main/java/jp/sf/pal/timecard/db/cbean/cq/ciq/DailyReportCIQ.java timecard/trunk/src/main/java/jp/sf/pal/timecard/db/cbean/cq/ciq/EmployeeCIQ.java timecard/trunk/src/main/java/jp/sf/pal/timecard/db/cbean/cq/ciq/GroupInfoCIQ.java timecard/trunk/src/main/java/jp/sf/pal/timecard/db/cbean/cq/ciq/GroupMappingCIQ.java timecard/trunk/src/main/java/jp/sf/pal/timecard/db/cbean/cq/ciq/MonthlyReportCIQ.java timecard/trunk/src/main/java/jp/sf/pal/timecard/db/cbean/cq/ciq/MonthlyWorkingReportCIQ.java timecard/trunk/src/main/java/jp/sf/pal/timecard/db/cbean/cq/ciq/RoleInfoCIQ.java timecard/trunk/src/main/java/jp/sf/pal/timecard/db/cbean/cq/ciq/RoleMappingCIQ.java timecard/trunk/src/main/java/jp/sf/pal/timecard/db/cbean/cq/ciq/UserInfoCIQ.java timecard/trunk/src/main/java/jp/sf/pal/timecard/db/cbean/cq/ciq/WorkingTypeCIQ.java timecard/trunk/src/main/java/jp/sf/pal/timecard/db/cbean/nss/DailyReportNss.java timecard/trunk/src/main/java/jp/sf/pal/timecard/db/cbean/nss/EmployeeNss.java timecard/trunk/src/main/java/jp/sf/pal/timecard/db/cbean/nss/GroupInfoNss.java timecard/trunk/src/main/java/jp/sf/pal/timecard/db/cbean/nss/GroupMappingNss.java timecard/trunk/src/main/java/jp/sf/pal/timecard/db/cbean/nss/MonthlyReportNss.java timecard/trunk/src/main/java/jp/sf/pal/timecard/db/cbean/nss/MonthlyWorkingReportNss.java timecard/trunk/src/main/java/jp/sf/pal/timecard/db/cbean/nss/RoleInfoNss.java timecard/trunk/src/main/java/jp/sf/pal/timecard/db/cbean/nss/RoleMappingNss.java timecard/trunk/src/main/java/jp/sf/pal/timecard/db/cbean/nss/UserInfoNss.java timecard/trunk/src/main/java/jp/sf/pal/timecard/db/cbean/nss/WorkingTypeNss.java timecard/trunk/src/main/resources/dbflute.dicon timecard/trunk/src/main/webapp/WEB-INF/db/timecard.1.log.db timecard/trunk/src/main/webapp/WEB-INF/db/timecard.data.db Added Paths: ----------- timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/CommonColumnAutoSetupper.java timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/CommonColumnBasicAutoSetupper.java timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/DBDef.java timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/bhv/core/ timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/bhv/core/BehaviorCommand.java timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/bhv/core/BehaviorCommandComponentSetup.java timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/bhv/core/BehaviorCommandInvoker.java timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/bhv/core/BehaviorInitializer.java timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/bhv/core/SqlExecution.java timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/bhv/core/SqlExecutionCreator.java timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/bhv/core/command/ timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/bhv/core/command/AbstractBehaviorCommand.java timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/bhv/core/command/AbstractEntityCommand.java timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/bhv/core/command/AbstractListEntityCommand.java timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/bhv/core/command/AbstractOutsideSqlCommand.java timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/bhv/core/command/AbstractOutsideSqlSelectCommand.java timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/bhv/core/command/AbstractSelectCBCommand.java timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/bhv/core/command/BatchDeleteEntityCommand.java timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/bhv/core/command/BatchDeleteNonstrictEntityCommand.java timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/bhv/core/command/BatchInsertEntityCommand.java timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/bhv/core/command/BatchUpdateEntityCommand.java timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/bhv/core/command/BatchUpdateNonstrictEntityCommand.java timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/bhv/core/command/DeleteEntityCommand.java timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/bhv/core/command/DeleteNonstrictEntityCommand.java timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/bhv/core/command/InsertEntityCommand.java timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/bhv/core/command/OutsideSqlCallCommand.java timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/bhv/core/command/OutsideSqlExecuteCommand.java timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/bhv/core/command/OutsideSqlSelectCursorCommand.java timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/bhv/core/command/OutsideSqlSelectListCommand.java timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/bhv/core/command/QueryDeleteCBCommand.java timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/bhv/core/command/QueryUpdateEntityCBCommand.java timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/bhv/core/command/SelectCountCBCommand.java timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/bhv/core/command/SelectListCBCommand.java timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/bhv/core/command/SelectNextValCommand.java timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/bhv/core/command/SelectScalarCBCommand.java timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/bhv/core/command/UpdateEntityCommand.java timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/bhv/core/command/UpdateNonstrictEntityCommand.java timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/bhv/core/execution/ timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/bhv/core/execution/BasicSelectExecution.java timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/bhv/core/execution/OutsideSqlSelectExecution.java timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/bhv/core/execution/SelectCBExecution.java timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/cbean/ScalarQuery.java timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/cbean/ckey/ConditionKeyNotLikeSearch.java timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/helper/StringKeyMap.java timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/helper/StringSet.java timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/s2dao/BeanMetaDataFactoryExtension.java timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/s2dao/PropertyTypeFactoryBuilderExtension.java timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/s2dao/SqlLogRegistryLatestSqlProvider.java timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/s2dao/internal/various/InternalIdentifierAbstractGenerator.java timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/s2dao/internal/various/InternalIdentifierAssignedGenerator.java timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/s2dao/internal/various/InternalIdentifierGeneratorFactory.java timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/s2dao/internal/various/InternalIdentifierIdentityGenerator.java timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/s2dao/internal/various/InternalIdentifierSequenceGenerator.java timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/s2dao/internal/various/InternalStatementFactory.java timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/util/SimpleResourceUtil.java timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/util/SimpleTypeUtil.java Removed Paths: ------------- timecard/trunk/src/main/java/jp/sf/pal/timecard/db/bsdao/ timecard/trunk/src/main/java/jp/sf/pal/timecard/db/exdao/ -------------- next part -------------- Modified: timecard/trunk/dbflute/_project.bat =================================================================== --- timecard/trunk/dbflute/_project.bat 2008-12-27 22:18:30 UTC (rev 1630) +++ timecard/trunk/dbflute/_project.bat 2008-12-27 22:20:25 UTC (rev 1631) @@ -2,4 +2,4 @@ set MY_PROJECT_NAME=timecard -set DBFLUTE_HOME=..\mydbflute\dbflute-0.8.2 +set DBFLUTE_HOME=..\mydbflute\dbflute-0.8.7 Modified: timecard/trunk/dbflute/_project.sh =================================================================== --- timecard/trunk/dbflute/_project.sh 2008-12-27 22:18:30 UTC (rev 1630) +++ timecard/trunk/dbflute/_project.sh 2008-12-27 22:20:25 UTC (rev 1631) @@ -2,4 +2,4 @@ export MY_PROJECT_NAME=timecard -export DBFLUTE_HOME=../mydbflute/dbflute-0.8.2 +export DBFLUTE_HOME=../mydbflute/dbflute-0.8.7 Modified: timecard/trunk/dbflute/build-timecard.properties =================================================================== --- timecard/trunk/dbflute/build-timecard.properties 2008-12-27 22:18:30 UTC (rev 1630) +++ timecard/trunk/dbflute/build-timecard.properties 2008-12-27 22:20:25 UTC (rev 1631) @@ -157,5 +157,5 @@ torque.additionalForeignKeyMap = map:{ \ } -#torque.isDeleteOldTableClass = true +torque.isDeleteOldTableClass = true Modified: timecard/trunk/mydbflute/README.txt =================================================================== --- timecard/trunk/mydbflute/README.txt 2008-12-27 22:18:30 UTC (rev 1630) +++ timecard/trunk/mydbflute/README.txt 2008-12-27 22:20:25 UTC (rev 1631) @@ -1,3 +1,3 @@ -$ mkdir dbflute-0.8.2 -$ cd dbflute-0.8.2 -$ unzip ../dbflute-0.8.2.zip +$ mkdir dbflute-0.8.7 +$ cd dbflute-0.8.7 +$ unzip ../dbflute-0.8.7.zip Modified: timecard/trunk/src/main/config/erd/timecard.erd =================================================================== --- timecard/trunk/src/main/config/erd/timecard.erd 2008-12-27 22:18:30 UTC (rev 1630) +++ timecard/trunk/src/main/config/erd/timecard.erd 2008-12-27 22:20:25 UTC (rev 1631) @@ -237,6 +237,11 @@ + + 255 + 255 + 206 + 319 484 @@ -403,6 +408,11 @@ + + 255 + 255 + 206 + 331 909 @@ -622,6 +632,22 @@ + status + Status + + VARCHAR + String + true + 12 + + 1 + false + false + + false + + + created_time Created Time @@ -651,7 +677,7 @@ updated_time Updated Time - + 10 true false @@ -673,7 +699,7 @@ deleted_time Deleted Time - + 10 false false @@ -710,6 +736,11 @@ + + 255 + 255 + 206 + 315 1220 @@ -802,7 +833,7 @@ created_time Created Time - + 10 true false @@ -824,7 +855,7 @@ updated_time Updated Time - + 10 true false @@ -846,7 +877,7 @@ deleted_time Deleted Time - + 10 false false @@ -868,7 +899,7 @@ versionNo Version No. - + 10 true false @@ -878,6 +909,11 @@ + + 255 + 255 + 206 + 66 1740 @@ -947,6 +983,11 @@ + + 255 + 255 + 206 + 70 909 @@ -1104,7 +1145,7 @@ created_time Created Time - + 10 true false @@ -1126,7 +1167,7 @@ updated_time Updated Time - + 10 true false @@ -1148,7 +1189,7 @@ deleted_time Deleted Time - + 10 false false @@ -1170,7 +1211,7 @@ versionNo Version No. - + 10 true false @@ -1180,6 +1221,11 @@ + + 255 + 255 + 206 + 594 1740 @@ -1244,6 +1290,11 @@ + + 255 + 255 + 206 + 602 909 @@ -1629,6 +1680,11 @@ + + 255 + 255 + 206 + 331 40 @@ -1736,6 +1792,11 @@ + + 255 + 255 + 206 + 40 40 @@ -1908,6 +1969,11 @@ + + 255 + 255 + 206 + 51 484 Modified: timecard/trunk/src/main/config/sql/timecard.ddl =================================================================== --- timecard/trunk/src/main/config/sql/timecard.ddl 2008-12-27 22:18:30 UTC (rev 1630) +++ timecard/trunk/src/main/config/sql/timecard.ddl 2008-12-27 22:20:25 UTC (rev 1631) @@ -9,9 +9,9 @@ DROP TABLE role_info; DROP TABLE group_info; -/********************************** -Table Name: Group Information -**********************************/ +/**********************************/ +/* Table Name: Group Information */ +/**********************************/ CREATE TABLE group_info( group_id VARCHAR(255) NOT NULL PRIMARY KEY, name VARCHAR(100), @@ -28,9 +28,9 @@ versionNo INTEGER NOT NULL ); -/********************************** -Table Name: Role Information -**********************************/ +/**********************************/ +/* Table Name: Role Information */ +/**********************************/ CREATE TABLE role_info( role_id VARCHAR(255) NOT NULL PRIMARY KEY, name VARCHAR(100), @@ -47,9 +47,9 @@ versionNo INTEGER NOT NULL ); -/********************************** -Table Name: User Information -**********************************/ +/**********************************/ +/* Table Name: User Information */ +/**********************************/ CREATE TABLE user_info( user_id VARCHAR(255) NOT NULL PRIMARY KEY, given_name VARCHAR(100), @@ -66,6 +66,7 @@ locale VARCHAR(5), role_id VARCHAR(255), group_id VARCHAR(255), + status VARCHAR(1), created_time TIMESTAMP NOT NULL, created_by VARCHAR(255) NOT NULL, updated_time TIMESTAMP NOT NULL, @@ -77,9 +78,9 @@ FOREIGN KEY (role_id) REFERENCES role_info (role_id) ); -/********************************** -Table Name: Employee -**********************************/ +/**********************************/ +/* Table Name: Employee */ +/**********************************/ CREATE TABLE employee( id INTEGER NOT NULL IDENTITY PRIMARY KEY, username VARCHAR(255) NOT NULL, @@ -96,9 +97,9 @@ FOREIGN KEY (manager) REFERENCES user_info (user_id) ); -/********************************** -Table Name: Monthly Report -**********************************/ +/**********************************/ +/* Table Name: Monthly Report */ +/**********************************/ CREATE TABLE monthly_report( id BIGINT(20) NOT NULL IDENTITY PRIMARY KEY, year INTEGER NOT NULL, @@ -120,9 +121,9 @@ FOREIGN KEY (employee_id) REFERENCES employee (id) ); -/********************************** -Table Name: Daily Report -**********************************/ +/**********************************/ +/* Table Name: Daily Report */ +/**********************************/ CREATE TABLE daily_report( id BIGINT(20) NOT NULL IDENTITY PRIMARY KEY, date INTEGER NOT NULL, @@ -145,9 +146,9 @@ FOREIGN KEY (monthly_report_id) REFERENCES monthly_report (id) ); -/********************************** -Table Name: Group Mapping -**********************************/ +/**********************************/ +/* Table Name: Group Mapping */ +/**********************************/ CREATE TABLE group_mapping( id INTEGER NOT NULL IDENTITY PRIMARY KEY, user_id VARCHAR(255) NOT NULL, @@ -156,9 +157,9 @@ FOREIGN KEY (group_id) REFERENCES group_info (group_id) ); -/********************************** -Table Name: Role Mapping -**********************************/ +/**********************************/ +/* Table Name: Role Mapping */ +/**********************************/ CREATE TABLE role_mapping( id INT NOT NULL IDENTITY PRIMARY KEY, user_id VARCHAR(255) NOT NULL, @@ -167,9 +168,9 @@ FOREIGN KEY (role_id) REFERENCES role_info (role_id) ); -/********************************** -Table Name: Working Type -**********************************/ +/**********************************/ +/* Table Name: Working Type */ +/**********************************/ CREATE TABLE working_type( id INTEGER NOT NULL IDENTITY PRIMARY KEY, name VARCHAR(100) NOT NULL, @@ -185,9 +186,9 @@ versionNo INTEGER DEFAULT 0 NOT NULL ); -/********************************** -Table Name: Monthly Working Report -**********************************/ +/**********************************/ +/* Table Name: Monthly Working Report */ +/**********************************/ CREATE TABLE monthly_working_report( id BIGINT(20) NOT NULL IDENTITY PRIMARY KEY, value DOUBLE NOT NULL, Modified: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/BehaviorSelector.java =================================================================== --- timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/BehaviorSelector.java 2008-12-27 22:18:30 UTC (rev 1630) +++ timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/BehaviorSelector.java 2008-12-27 22:20:25 UTC (rev 1631) @@ -10,8 +10,7 @@ public interface BehaviorSelector { /** - * Initialize condition-bean meta data.
If you call this, Hot Deploy - * of OutsideSql becomes Cool! + * Initialize condition-bean meta data.
*/ public void initializeConditionBeanMetaData(); Modified: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/CacheBehaviorSelector.java =================================================================== --- timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/CacheBehaviorSelector.java 2008-12-27 22:18:30 UTC (rev 1630) +++ timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/CacheBehaviorSelector.java 2008-12-27 22:20:25 UTC (rev 1631) @@ -1,8 +1,8 @@ package jp.sf.pal.timecard.db.allcommon; import java.util.Collection; -import java.util.LinkedHashMap; import java.util.Map; +import java.util.concurrent.ConcurrentHashMap; import jp.sf.pal.timecard.db.allcommon.bhv.BehaviorReadable; import jp.sf.pal.timecard.db.allcommon.dbmeta.DBMeta; @@ -31,15 +31,14 @@ // Attribute // ========= /** The cache of behavior. (It's the generic hell!) */ - protected Map, BehaviorReadable> _behaviorCache = new LinkedHashMap, BehaviorReadable>(); + protected Map, BehaviorReadable> _behaviorCache = new ConcurrentHashMap, BehaviorReadable>(); //========================================================================== // ========= // Initialize // ========== /** - * Initialize condition-bean meta data.
If you call this, Hot Deploy - * of OutsideSql becomes Cool! + * Initialize condition-bean meta data.
*/ public void initializeConditionBeanMetaData() { final Map dbmetaMap = DBMetaInstanceHandler @@ -53,8 +52,7 @@ } for (DBMeta dbmeta : dbmetas) { final BehaviorReadable bhv = byName(dbmeta.getTableDbName()); - final DaoReadable dao = bhv.getDaoReadable(); - dao.initializeDaoMetaData("selectList"); + bhv.warmUpCommand(); } if (_log.isInfoEnabled()) { long after = System.currentTimeMillis(); Added: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/CommonColumnAutoSetupper.java =================================================================== --- timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/CommonColumnAutoSetupper.java (rev 0) +++ timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/CommonColumnAutoSetupper.java 2008-12-27 22:20:25 UTC (rev 1631) @@ -0,0 +1,25 @@ +package jp.sf.pal.timecard.db.allcommon; + +/** + * The auto set-upper of common column. + * + * @author DBFlute(AutoGenerator) + */ +public interface CommonColumnAutoSetupper { + + /** + * Handle common columns of insert if it needs. + * + * @param targetEntity Target entity that the type is entity interface. + * (NotNull) + */ + public void handleCommonColumnOfInsertIfNeeds(Entity targetEntity); + + /** + * Handle common columns of update if it needs. + * + * @param targetEntity Target entity that the type is entity interface. + * (NotNull) + */ + public void handleCommonColumnOfUpdateIfNeeds(Entity targetEntity); +} Property changes on: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/CommonColumnAutoSetupper.java ___________________________________________________________________ Name: svn:eol-style + native Added: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/CommonColumnBasicAutoSetupper.java =================================================================== --- timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/CommonColumnBasicAutoSetupper.java (rev 0) +++ timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/CommonColumnBasicAutoSetupper.java 2008-12-27 22:20:25 UTC (rev 1631) @@ -0,0 +1,31 @@ +package jp.sf.pal.timecard.db.allcommon; + +/** + * The basic implementation of the auto set-upper of common column. + * + * @author DBFlute(AutoGenerator) + */ +public class CommonColumnBasicAutoSetupper implements CommonColumnAutoSetupper { + + //========================================================================== + // =========== + // Set up + // ====== + /** + * Handle common columns of insert if it needs. + * + * @param targetEntity Target entity that the type is entity interface. + * (NotNull) + */ + public void handleCommonColumnOfInsertIfNeeds(Entity targetEntity) { + } + + /** + * Handle common columns of update if it needs. + * + * @param targetEntity Target entity that the type is entity interface. + * (NotNull) + */ + public void handleCommonColumnOfUpdateIfNeeds(Entity targetEntity) { + } +} Property changes on: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/CommonColumnBasicAutoSetupper.java ___________________________________________________________________ Name: svn:eol-style + native Added: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/DBDef.java =================================================================== --- timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/DBDef.java (rev 0) +++ timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/DBDef.java 2008-12-27 22:20:25 UTC (rev 1631) @@ -0,0 +1,179 @@ +package jp.sf.pal.timecard.db.allcommon; + +import java.util.Collections; +import java.util.HashMap; +import java.util.Iterator; +import java.util.Map; +import java.util.Set; + +/** + * The definition of database. + * + * @author DBFlute(AutoGenerator) + */ +public enum DBDef { + + //========================================================================== + // ========= + // ENUM + // ==== + MySQL("mysql", null), PostgreSQL("postgresql", "postgre"), Oracle("oracle", + null), DB2("db2", null), SQLServer("sqlserver", "mssql"), FireBird( + "firebird", null), H2("h2", null), Derby("derby", null), MSAccess( + "msaccess", null), Unknown("unknown", null); + + //========================================================================== + // ========= + // Static Reference + // ================ + // ----------------------------------------------------- + // Code Value + // ---------- + private static final Map _codeValueMap = new HashMap(); + static { + for (DBDef value : values()) { + _codeValueMap.put(value.code().toLowerCase(), value); + } + } + + private static final Map _codeAliasValueMap = new HashMap(); + static { + for (DBDef value : values()) { + if (value.codeAlias() != null) { + _codeAliasValueMap.put(value.codeAlias().toLowerCase(), value); + } + } + } + + /** + * @param code The code of the DB. (Nullable: If the code is null, it + * returns null) + * @return The instance that has the code. (Nullable) + */ + public static DBDef codeOf(String code) { + if (code == null) { + return null; + } + final String lowerCaseCode = code.toLowerCase(); + DBDef def = _codeValueMap.get(lowerCaseCode); + if (def == null) { + def = _codeAliasValueMap.get(lowerCaseCode); + } + return def; + } + + // ----------------------------------------------------- + // Driver Hint + // ----------- + private static final Map _driverHintMap; + static { + final Map tmpMap = new HashMap(); + tmpMap.put("mysql", MySQL); + tmpMap.put("postgresql", PostgreSQL); + tmpMap.put("oracle", Oracle); + tmpMap.put("db2", DB2); + tmpMap.put("sqlserver", SQLServer); + tmpMap.put("firebird", FireBird); + tmpMap.put("org.h2", H2); + tmpMap.put("org.apache.derby", Derby); + _driverHintMap = Collections.unmodifiableMap(tmpMap); + } + + public static DBDef byDriverClassName(String driverClassName) { + final Set keySet = _driverHintMap.keySet(); + for (final Iterator ite = keySet.iterator(); ite.hasNext();) { + final String driverHint = ite.next(); + if (driverClassName.indexOf(driverHint) >= 0) { + final DBDef dbdef = _driverHintMap.get(driverHint); + if (dbdef != null) { + return dbdef; + } + } + } + return null; + } + + //========================================================================== + // ========= + // Current Definition + // ================== + /** The current definition of database. (NotNull, Default 'Unknown') */ + private static DBDef _currentDef; + static { + _currentDef = codeOf("H2"); + if (_currentDef == null) { + _currentDef = Unknown; + } + } + + /** + * @return The current definition of database. (NotNull) + */ + public static DBDef getCurrentDef() { + return _currentDef; + } + + /** + * @param currentDef The current definition of database. (NotNull) + */ + public static void setCurrentDef(DBDef currentDef) { + if (currentDef == null) { + String msg = "The argument 'currentDef' should not be null at DBDef.setCurrentDef()"; + throw new IllegalArgumentException(msg); + } + _currentDef = currentDef; + } + + /** + * @param dbdef The definition of database. (NotNull) + * @return Is the definition of database current? + */ + public static boolean isCurrentDef(DBDef dbdef) { + if (dbdef == null) { + String msg = "The argument 'dbdef' should not be null at DBDef.isCurrentDef()"; + throw new IllegalArgumentException(msg); + } + return _currentDef != null ? _currentDef.equals(dbdef) : false; + } + + //========================================================================== + // ========= + // Attribute + // ========= + /** The code of the DB. (NotNull) */ + private String _code; + + /** The code alias of the DB. (Nullable) */ + private String _codeAlias; + + //========================================================================== + // ========= + // Constructor + // =========== + /** + * @param code The code of the DB. (NotNull) + * @param codeAlias The code alias of the DB. (Nullable) + */ + private DBDef(String code, String codeAlias) { + _code = code; + _codeAlias = codeAlias; + } + + //========================================================================== + // ========= + // Accessor + // ======== + /** + * @return The code of the DB. (NotNull) + */ + public String code() { + return _code; + } + + /** + * @return The code alias of the DB. (Nullable) + */ + private String codeAlias() { + return _codeAlias; + } +} Property changes on: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/DBDef.java ___________________________________________________________________ Name: svn:eol-style + native Modified: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/DBFluteConfig.java =================================================================== --- timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/DBFluteConfig.java 2008-12-27 22:18:30 UTC (rev 1630) +++ timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/DBFluteConfig.java 2008-12-27 22:20:25 UTC (rev 1631) @@ -24,10 +24,6 @@ // ========= protected StatementConfig _defaultStatementConfig; - protected boolean _conditionBeanFormatSql = true;// This is for - - // compatibility! - protected boolean _queryLogLevelInfo; protected boolean _executeStatusLogLevelInfo; @@ -36,10 +32,6 @@ protected UniqueConstraintDeterminator _uniqueConstraintDeterminator; - protected boolean _sqlExceptionOldStyleHandling = false;// This is for - - // compatibility! - protected String _logDateFormat; protected String _logTimestampFormat; @@ -92,27 +84,6 @@ //========================================================================== // ========= - // ConditionBean Format Sql - // ======================== - public boolean isConditionBeanFormatSql() { - return _conditionBeanFormatSql; - } - - /** - * @param conditionBeanFormatSql The value of the config. - * @deprecated This is for compatibility! - */ - public void setConditionBeanFormatSql(boolean conditionBeanFormatSql) { - assertNotLocked(); - if (_log.isInfoEnabled()) { - _log.info("...Setting conditionBeanFormatSql: " - + conditionBeanFormatSql); - } - _conditionBeanFormatSql = conditionBeanFormatSql; - } - - //========================================================================== - // ========= // Query Log Level Info // ==================== public boolean isQueryLogLevelInfo() { @@ -184,31 +155,8 @@ public boolean isUniqueConstraintException(Throwable t); } - // [DBFlute-0.7.7] //========================================================================== // ========= - // SQL Exception Old Style - // ======================= - public boolean isSqlExceptionOldStyleHandling() { - return _sqlExceptionOldStyleHandling; - } - - /** - * @param sqlExceptionOldStyleHandling The value of the config. - * @deprecated This is for compatibility! - */ - public void setSqlExceptionOldStyleHandling( - boolean sqlExceptionOldStyleHandling) { - assertNotLocked(); - if (_log.isInfoEnabled()) { - _log.info("...Setting sqlExceptionOldStyleHandling: " - + sqlExceptionOldStyleHandling); - } - _sqlExceptionOldStyleHandling = sqlExceptionOldStyleHandling; - } - - //========================================================================== - // ========= // Log Format // ========== public String getLogDateFormat() { @@ -303,7 +251,6 @@ // ============ public void clear() { // the only properties that update OK while executing _defaultStatementConfig = null; - _conditionBeanFormatSql = true; // as default _queryLogLevelInfo = false; _executeStatusLogLevelInfo = false; _useSqlLogRegistry = false; Modified: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/EntityDefinedCommonColumn.java =================================================================== --- timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/EntityDefinedCommonColumn.java 2008-12-27 22:18:30 UTC (rev 1630) +++ timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/EntityDefinedCommonColumn.java 2008-12-27 22:20:25 UTC (rev 1631) @@ -8,6 +8,12 @@ public interface EntityDefinedCommonColumn extends Entity { /** + * Enable common column auto set up. {for after disable because the default + * is enabled} + */ + public void enableCommonColumnAutoSetup(); + + /** * Disable common column auto set up. */ public void disableCommonColumnAutoSetup(); Modified: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/bhv/AbstractBehaviorReadable.java =================================================================== --- timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/bhv/AbstractBehaviorReadable.java 2008-12-27 22:18:30 UTC (rev 1630) +++ timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/bhv/AbstractBehaviorReadable.java 2008-12-27 22:20:25 UTC (rev 1631) @@ -11,10 +11,16 @@ import java.util.Set; import jp.sf.pal.timecard.db.allcommon.BehaviorSelector; -import jp.sf.pal.timecard.db.allcommon.DaoSelector; import jp.sf.pal.timecard.db.allcommon.Entity; import jp.sf.pal.timecard.db.allcommon.bhv.batch.TokenFileOutputOption; import jp.sf.pal.timecard.db.allcommon.bhv.batch.TokenFileOutputResult; +import jp.sf.pal.timecard.db.allcommon.bhv.core.BehaviorCommand; +import jp.sf.pal.timecard.db.allcommon.bhv.core.BehaviorCommandInvoker; +import jp.sf.pal.timecard.db.allcommon.bhv.core.command.AbstractBehaviorCommand; +import jp.sf.pal.timecard.db.allcommon.bhv.core.command.SelectCountCBCommand; +import jp.sf.pal.timecard.db.allcommon.bhv.core.command.SelectListCBCommand; +import jp.sf.pal.timecard.db.allcommon.bhv.core.command.SelectNextValCommand; +import jp.sf.pal.timecard.db.allcommon.bhv.core.command.SelectScalarCBCommand; import jp.sf.pal.timecard.db.allcommon.bhv.load.LoadReferrerOption; import jp.sf.pal.timecard.db.allcommon.bhv.setup.ValueLabelBox; import jp.sf.pal.timecard.db.allcommon.bhv.setup.ValueLabelSetupper; @@ -25,8 +31,9 @@ import jp.sf.pal.timecard.db.allcommon.cbean.PagingHandler; import jp.sf.pal.timecard.db.allcommon.cbean.PagingInvoker; import jp.sf.pal.timecard.db.allcommon.cbean.PagingResultBean; -import jp.sf.pal.timecard.db.allcommon.cbean.outsidesql.OutsideSqlDao; +import jp.sf.pal.timecard.db.allcommon.cbean.ScalarQuery; import jp.sf.pal.timecard.db.allcommon.cbean.outsidesql.executor.OutsideSqlBasicExecutor; +import jp.sf.pal.timecard.db.allcommon.cbean.sqlclause.SqlClause; import jp.sf.pal.timecard.db.allcommon.dbmeta.info.ColumnInfo; import jp.sf.pal.timecard.db.allcommon.helper.token.file.FileMakingHeaderInfo; import jp.sf.pal.timecard.db.allcommon.helper.token.file.FileMakingOption; @@ -35,11 +42,10 @@ import jp.sf.pal.timecard.db.allcommon.util.SimpleSystemUtil; /** - * The abstract class of behavior-readable. + * The abstract class of readable behavior. * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public abstract class AbstractBehaviorReadable implements BehaviorReadable { //========================================================================== @@ -50,13 +56,13 @@ * Behavior-selector instance. It's basically referred at loadReferrer. * (Required for loadReferrer) */ - protected BehaviorSelector _behaviorSelector; + protected BehaviorCommandInvoker _behaviorCommandInvoker; /** - * Dao-selector instance. It's basically referred at loadReferrer. (Required - * for OutsideSql) + * Behavior-selector instance. It's basically referred at loadReferrer. + * (Required for loadReferrer) */ - protected DaoSelector _daoSelector; + protected BehaviorSelector _behaviorSelector; //========================================================================== // =========== @@ -83,7 +89,7 @@ * @return Read count. (NotNull) */ public int readCount(ConditionBean cb) { - assertConditionBeanNotNull(cb); + assertCBNotNull(cb); return callReadCount(cb); } @@ -100,7 +106,7 @@ * When the entity has been duplicated. */ public Entity readEntity(ConditionBean cb) { - assertConditionBeanNotNull(cb); + assertCBNotNull(cb); final List ls = readList(cb); if (ls.isEmpty()) { return null; @@ -120,7 +126,7 @@ * When the entity has been duplicated. */ public Entity readEntityWithDeletedCheck(ConditionBean cb) { - assertConditionBeanNotNull(cb); + assertCBNotNull(cb); final List ls = readList(cb); assertEntityNotDeleted(ls, cb); assertEntitySelectedAsOne(ls, cb); @@ -133,7 +139,7 @@ // =========================== protected ENTITY helpSelectEntityInternally( CB cb, InternalSelectEntityCallback callback) { - assertConditionBeanNotNull(cb); + assertCBNotNull(cb); cb.checkSafetyResult(1); List ls = null; try { @@ -156,7 +162,7 @@ protected ENTITY helpSelectEntityWithDeletedCheckInternally( CB cb, InternalSelectEntityWithDeletedCheckCallback callback) { - assertConditionBeanNotNull(cb); + assertCBNotNull(cb); cb.checkSafetyResult(1); List ls = null; try { @@ -175,7 +181,7 @@ } //========================================================================== - // =========== + // ========= // List Read // ========= /** @@ -186,7 +192,7 @@ * list. (NotNull) */ public ListResultBean readList(ConditionBean cb) { - assertConditionBeanNotNull(cb); + assertCBNotNull(cb); return new jp.sf.pal.timecard.db.allcommon.cbean.ResultBeanBuilder( getTableDbName()).buildListResultBean(cb, callReadList(cb)); } @@ -198,7 +204,7 @@ * @return Read page. (NotNull) */ public PagingResultBean readPage(final ConditionBean cb) { - assertConditionBeanNotNull(cb); + assertCBNotNull(cb); final PagingInvoker invoker = new PagingInvoker( getTableDbName()); final PagingHandler handler = new PagingHandler() { @@ -225,8 +231,7 @@ * @exception jp.sf.pal.timecard.db.allcommon.exception.EntityAlreadyDeletedException * When the entity has already been deleted. */ - protected void assertEntityNotDeleted( - jp.sf.pal.timecard.db.allcommon.Entity entity, Object searchKey4Log) { + protected void assertEntityNotDeleted(Entity entity, Object searchKey4Log) { if (entity == null) { throwEntityAlreadyDeletedException(searchKey4Log); } @@ -239,7 +244,8 @@ * @param searchKey4Log Search-key for Logging. (NotNull) * @exception jp.sf.pal.timecard.db.allcommon.exception.EntityAlreadyDeletedException */ - protected void assertEntityNotDeleted(List ls, Object searchKey4Log) { + protected void assertEntityNotDeleted(List ls, + Object searchKey4Log) { if (ls == null || ls.isEmpty()) { throwEntityAlreadyDeletedException(searchKey4Log); } @@ -253,7 +259,8 @@ * @exception jp.sf.pal.timecard.db.allcommon.exception.EntityAlreadyDeletedException * @exception jp.sf.pal.timecard.db.allcommon.exception.EntityDuplicatedException */ - protected void assertEntitySelectedAsOne(List ls, Object searchKey4Log) { + protected void assertEntitySelectedAsOne(List ls, + Object searchKey4Log) { if (ls == null || ls.isEmpty()) { throwEntityAlreadyDeletedException(searchKey4Log); } @@ -274,49 +281,254 @@ //========================================================================== // ========= - // Various Select - // ============== - public OutsideSqlBasicExecutor outsideSql() { - assertDaoSelectorNotNull("outsideSql"); - final OutsideSqlDao outsideSqlDao = _daoSelector - .select(OutsideSqlDao.class); - return new OutsideSqlBasicExecutor(outsideSqlDao, getTableDbName()); - } + // Scalar Select + // ============= + /** + * The scalar function.
This is not static class because this uses + * the method 'invoke(BehaviorCommand)' + * + * @param The type of condition-bean. + * @param The type of result. + */ + public class SLFunction { // SL: ScaLar - private void assertDaoSelectorNotNull(String methodName) { - if (_daoSelector == null) { + /** The condition-bean for scalar select. (NotNull) */ + protected CB _conditionBean; + + /** The condition-bean for scalar select. (NotNull) */ + protected Class _resultType; + + /** + * @param conditionBean The condition-bean initialized only for scalar + * select. (NotNull) + * @param resultType The type os result. (NotNull) + */ + public SLFunction(CB conditionBean, Class resultType) { + _conditionBean = conditionBean; + _resultType = resultType; + } + + /** + * Select the maximum value.
+ * + *
+         * memberBhv.scalarSelect(Date.class).max(new ScalarQuery(MemberCB cb) {
+         *     cb.specify().columnMemberBirthday(); // the required specification of target column
+         *     cb.query().setMemberStatusCode_Equal_Formalized(); // query as you like it
+         * });
+         * 
+ * + * @param scalarQuery The query for scalar. (NotNull) + * @return The maximum value. (Nullable) + */ + public RESULT max(ScalarQuery scalarQuery) { + assertObjectNotNull("scalarQuery", scalarQuery); + return exec(scalarQuery, SqlClause.SelectClauseType.MAX); + } + + /** + * Select the minimum value.
+ * + *
+         * memberBhv.scalarSelect(Date.class).min(new ScalarQuery(MemberCB cb) {
+         *     cb.specify().columnMemberBirthday(); // the required specification of target column
+         *     cb.query().setMemberStatusCode_Equal_Formalized(); // query as you like it
+         * });
+         * 
+ * + * @param scalarQuery The query for scalar. (NotNull) + * @return The minimum value. (Nullable) + */ + public RESULT min(ScalarQuery scalarQuery) { + assertObjectNotNull("scalarQuery", scalarQuery); + return exec(scalarQuery, SqlClause.SelectClauseType.MIN); + } + + /** + * Select the summary value.
+ * + *
+         * purchaseBhv.scalarSelect(Integer.class).sum(new ScalarQuery(PurchaseCB cb) {
+         *     cb.specify().columnPurchaseCount(); // the required specification of target column
+         *     cb.query().setPurchaseDatetime_GreaterEqual(date); // query as you like it
+         * });
+         * 
+ * + * @param scalarQuery The query for scalar. (NotNull) + * @return The summary value. (Nullable) + */ + public RESULT sum(ScalarQuery scalarQuery) { + assertObjectNotNull("scalarQuery", scalarQuery); + return exec(scalarQuery, SqlClause.SelectClauseType.SUM); + } + + /** + * Select the average value.
+ * + *
+         * purchaseBhv.scalarSelect(Integer.class).avg(new ScalarQuery(PurchaseCB cb) {
+         *     cb.specify().columnPurchaseCount(); // the required specification of target column
+         *     cb.query().setPurchaseDatetime_GreaterEqual(date); // query as you like it
+         * });
+         * 
+ * + * @param scalarQuery The query for scalar. (NotNull) + * @return The average value. (Nullable) + */ + public RESULT avg(ScalarQuery scalarQuery) { + assertObjectNotNull("scalarQuery", scalarQuery); + return exec(scalarQuery, SqlClause.SelectClauseType.AVG); + } + + protected RESULT exec(ScalarQuery scalarQuery, + SqlClause.SelectClauseType selectClauseType) { + assertObjectNotNull("scalarQuery", scalarQuery); + assertObjectNotNull("selectClauseType", selectClauseType); + assertObjectNotNull("conditionBean", _conditionBean); + assertObjectNotNull("resultType", _resultType); + scalarQuery.query(_conditionBean); + assertScalarSelectRequiredSpecifyColumn(); + return invoke(createSelectScalarCBCommand(_conditionBean, + _resultType, selectClauseType)); + } + + protected void assertScalarSelectRequiredSpecifyColumn() { + final String columnName = _conditionBean.getSqlClause() + .getSpecifiedColumnNameAsOne(); + if (columnName == null) { + throwScalarSelectInvalidColumnSpecificationException(); + } + } + + protected void throwScalarSelectInvalidColumnSpecificationException() { String msg = "Look! Read the message below." + getLineSeparator(); msg = msg + "/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *" + getLineSeparator(); - msg = msg - + "Not found the selector of dao as behavior's attributed!" + msg = msg + "The specified column for scalar select was Invalid!" + getLineSeparator(); msg = msg + getLineSeparator(); msg = msg + "[Advice]" + getLineSeparator(); msg = msg - + "Please confirm the definition of the selector at your 'dbflute.dicon'." + + " You should call specify().column[TargetColumn]() only once." + getLineSeparator(); - msg = msg + "It is precondition that '" + methodName - + "()' needs the selector instance." + getLineSeparator(); - msg = msg + getLineSeparator(); - msg = msg + "[Your Behavior's Attributes]" + getLineSeparator(); - msg = msg + " _behaviorSelector : " + _behaviorSelector + msg = msg + " For example:" + getLineSeparator(); + msg = msg + " " + getLineSeparator(); + msg = msg + " [Wrong]" + getLineSeparator(); + msg = msg + " /- - - - - - - - - - - - - - - - - - - - " + getLineSeparator(); - msg = msg + " _daoSelector : " + _daoSelector + msg = msg + + " memberBhv.scalarSelect(Date.class).max(new ScalarQuery() {" + getLineSeparator(); - msg = msg + "* * * * * * * * * */" + getLineSeparator(); - throw new IllegalStateException(msg); + msg = msg + " public void query(MemberCB cb) {" + + getLineSeparator(); + msg = msg + " // *No! It's empty!" + getLineSeparator(); + msg = msg + " }" + getLineSeparator(); + msg = msg + " });" + getLineSeparator(); + msg = msg + " - - - - - - - - - -/" + getLineSeparator(); + msg = msg + " " + getLineSeparator(); + msg = msg + " [Wrong]" + getLineSeparator(); + msg = msg + " /- - - - - - - - - - - - - - - - - - - - " + + getLineSeparator(); + msg = msg + + " memberBhv.scalarSelect(Date.class).max(new ScalarQuery() {" + + getLineSeparator(); + msg = msg + " public void query(MemberCB cb) {" + + getLineSeparator(); + msg = msg + " cb.specify().columnMemberBirthday();" + + getLineSeparator(); + msg = msg + + " cb.specify().columnRegisterDatetime(); // *No! It's duplicated!" + + getLineSeparator(); + msg = msg + " }" + getLineSeparator(); + msg = msg + " });" + getLineSeparator(); + msg = msg + " - - - - - - - - - -/" + getLineSeparator(); + msg = msg + " " + getLineSeparator(); + msg = msg + " [Good!]" + getLineSeparator(); + msg = msg + " /- - - - - - - - - - - - - - - - - - - - " + + getLineSeparator(); + msg = msg + + " memberBhv.scalarSelect(Date.class).max(new ScalarQuery() {" + + getLineSeparator(); + msg = msg + " public void query(MemberCB cb) {" + + getLineSeparator(); + msg = msg + + " cb.specify().columnMemberBirthday(); // *Point!" + + getLineSeparator(); + msg = msg + " }" + getLineSeparator(); + msg = msg + " });" + getLineSeparator(); + msg = msg + " - - - - - - - - - -/" + getLineSeparator(); + msg = msg + getLineSeparator(); + msg = msg + "[ConditionBean Type]" + getLineSeparator() + + _conditionBean.getClass().getName() + getLineSeparator(); + msg = msg + getLineSeparator(); + msg = msg + "[Result Type]" + getLineSeparator() + + _resultType.getName() + getLineSeparator(); + msg = msg + "* * * * * * * * * */"; + throw new ScalarSelectInvalidColumnSpecificationException(msg); } } + public static class ScalarSelectInvalidColumnSpecificationException extends + RuntimeException { + private static final long serialVersionUID = 1L; + + public ScalarSelectInvalidColumnSpecificationException(String msg) { + super(msg); + } + } + + //========================================================================== + // ========= + // OutsideSql + // ========== /** - * Create value-label list. + * Get the basic executor of outside-SQL.
The invoker of behavior + * command should be not null when you call this method. * + *
+     * You can use the methods for outside-SQL are as follows:
+     * {Basic}
+     *   o selectList()
+     *   o execute()
+     *   o call()
+     * 
+     * {Entity}
+     *   o entityHandling().selectEntity()
+     *   o entityHandling().selectEntityWithDeletedCheck()
+     * 
+     * {Cursor}
+     *   o cursorHandling().selectCursor()
+     * 
+     * {Paging}
+     *   o autoPaging().selectList()
+     *   o autoPaging().selectPage()
+     *   o manualPaging().selectList()
+     *   o manualPaging().selectPage()
+     * 
+     * {Option -- Dynamic}
+     *   o dynamicBinding().selectList()
+     * 
+ * + * @return The basic executor of outside-SQL. (NotNull) + */ + public OutsideSqlBasicExecutor outsideSql() { + assertBehaviorCommandInvoker("outsideSql"); + return new OutsideSqlBasicExecutor(_behaviorCommandInvoker, + getTableDbName()); + } + + //========================================================================== + // ========= + // Various Select + // ============== + /** + * Create the list of value-label. + * * @param The type of entity. * @param entityList The list of entity. (NotNull) - * @param valueLabelSetupper Value-label-setupper. (NotNull) - * @return Value-label list. (NotNull) + * @param valueLabelSetupper The setupper of value-label. (NotNull) + * @return The list of value-label. (NotNull) */ public List> createValueLabelList( List entityList, @@ -362,10 +574,10 @@ } } - protected Object helpConvertingSequenceObject(Class resultClass, + protected Object helpConvertingSequenceObject(Class resultClass, Object sequenceObject) { try { - final Constructor constructor = resultClass + final Constructor constructor = resultClass .getConstructor(new Class[] { String.class }); return constructor.newInstance(new Object[] { sequenceObject .toString() }); @@ -534,6 +746,7 @@ * @param value The value of primary key. (Nullable) * @return The value of primary key. (Nullable) */ + @SuppressWarnings("unchecked") protected PK toLowerCasePrimaryKeyIfString(PK value) { return (PK) toLowerCaseIfString(value); } @@ -580,22 +793,22 @@ + "/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *" + getLineSeparator(); msg = msg - + "Not found the selector of behavior as behavior's attributed!" + + "Not found the selector of behavior as behavior's attribute!" + getLineSeparator(); msg = msg + getLineSeparator(); msg = msg + "[Advice]" + getLineSeparator(); msg = msg - + "Please confirm the definition of the selector at your 'dbflute.dicon'." + + "Please confirm the definition of the selector at your component configuration of DBFlute." + getLineSeparator(); msg = msg + "It is precondition that '" + methodName + "()' needs the selector instance." + getLineSeparator(); msg = msg + getLineSeparator(); msg = msg + "[Your Behavior's Attributes]" + getLineSeparator(); - msg = msg + " _behaviorSelector : " + _behaviorSelector + msg = msg + " _behaviorCommandInvoker : " + + _behaviorCommandInvoker + getLineSeparator(); + msg = msg + " _behaviorSelector : " + _behaviorSelector + getLineSeparator(); - msg = msg + " _daoSelector : " + _daoSelector - + getLineSeparator(); - msg = msg + "* * * * * * * * * */" + getLineSeparator(); + msg = msg + "* * * * * * * * * */"; throw new IllegalStateException(msg); } } @@ -648,14 +861,14 @@ public TokenFileOutputResult outputTokenFile(ConditionBean cb, String filename, TokenFileOutputOption tokenFileOutputOption) throws java.io.FileNotFoundException, java.io.IOException { - assertConditionBeanNotNull(cb); + assertCBNotNull(cb); assertStringNotNullAndNotTrimmedEmpty("filename", filename); assertObjectNotNull("tokenFileOutputOption", tokenFileOutputOption); final List ls = readList(cb); List> rowList = new ArrayList>(); - for (java.util.Iterator ite = ls.iterator(); ite.hasNext();) { - final Entity entity = (Entity) ite.next(); + for (java.util.Iterator ite = ls.iterator(); ite.hasNext();) { + final Entity entity = ite.next(); final List valueList = getDBMeta() .convertToColumnStringValueList(entity); rowList.add(valueList); @@ -665,9 +878,9 @@ .getFileMakingOption(); final FileMakingHeaderInfo fileMakingHeaderInfo = new FileMakingHeaderInfo(); final List columnDbNameList = new ArrayList(); - for (final java.util.Iterator ite = getDBMeta().getColumnInfoList() - .iterator(); ite.hasNext();) { - final ColumnInfo columnInfo = (ColumnInfo) ite.next(); + for (final java.util.Iterator ite = getDBMeta() + .getColumnInfoList().iterator(); ite.hasNext();) { + final ColumnInfo columnInfo = ite.next(); columnDbNameList.add(columnInfo.getColumnDbName()); } fileMakingHeaderInfo.setColumnNameList(columnDbNameList); @@ -690,7 +903,7 @@ * @return All count. */ protected int callGetCountAll() { - return readCount(newConditionBean()); + return callReadCount(newConditionBean()); } /** @@ -699,7 +912,7 @@ * @return All list. (NotNull) */ protected List callGetListAll() { - return readList(newConditionBean()); + return callReadList(newConditionBean()); } /** @@ -710,14 +923,12 @@ * @return Read count. (NotNull) */ protected int callReadCount(ConditionBean cb) { - assertConditionBeanNotNull(cb); - final Class[] types = new Class[] { cb.getClass() }; - final java.lang.reflect.Method mtd = getMethod(getDaoReadable() - .getClass(), "selectCount", types); - final Object result = invoke(mtd, getDaoReadable(), new Object[] { cb }); - return ((Integer) result).intValue(); + assertCBNotNull(cb); + return doCallReadCount(cb); } + protected abstract int doCallReadCount(ConditionBean cb); + /** * The implementation. * @@ -727,42 +938,110 @@ * (NotNull) */ protected List 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) result; + assertCBNotNull(cb); + return doCallReadList(cb); } - private Method getMethod(Class clazz, String methodName, Class[] argTypes) { - try { - return clazz.getMethod(methodName, argTypes); - } catch (NoSuchMethodException ex) { - String msg = "class=" + clazz + " method=" + methodName + "-" - + java.util.Arrays.asList(argTypes); - throw new RuntimeException(msg, ex); + protected abstract List doCallReadList(ConditionBean cb); + + //========================================================================== + // ========= + // Behavior Command + // ================ + public void warmUpCommand() { + { + SelectCountCBCommand cmd = createSelectCountCBCommand(newConditionBean()); + cmd.setInitializeOnly(true); + invoke(cmd); } + { + SelectListCBCommand cmd = createSelectListCBCommand( + newConditionBean(), getDBMeta().getEntityType()); + cmd.setInitializeOnly(true); + invoke(cmd); + } } - private Object invoke(Method method, Object target, Object[] args) { - try { - return method.invoke(target, args); - } catch (java.lang.reflect.InvocationTargetException ex) { - Throwable t = ex.getCause(); - if (t instanceof RuntimeException) { - throw (RuntimeException) t; - } - if (t instanceof Error) { - throw (Error) t; - } - String msg = "target=" + target + " method=" + method + "-" - + java.util.Arrays.asList(args); - throw new RuntimeException(msg, ex); - } catch (IllegalAccessException ex) { - String msg = "target=" + target + " method=" + method + "-" - + java.util.Arrays.asList(args); - throw new RuntimeException(msg, ex); + protected SelectCountCBCommand createSelectCountCBCommand(ConditionBean cb) { + assertBehaviorCommandInvoker("createSelectCountCBCommand"); + final SelectCountCBCommand command = xsetupSelectCommand(new SelectCountCBCommand()); + command.setConditionBeanType(cb.getClass()); + command.setConditionBean(cb); + return command; + } + + protected SelectListCBCommand createSelectListCBCommand( + ConditionBean cb, Class entityType) { + assertBehaviorCommandInvoker("createSelectListCBCommand"); + final SelectListCBCommand command = xsetupSelectCommand(new SelectListCBCommand()); + command.setConditionBeanType(cb.getClass()); + command.setConditionBean(cb); + command.setEntityType(entityType); + return command; + } + + protected SelectNextValCommand createSelectNextValCommand( + Class resultType) { + assertBehaviorCommandInvoker("createSelectNextValCommand"); + final SelectNextValCommand command = xsetupSelectCommand(new SelectNextValCommand()); + command.setResultType(resultType); + return command; + } + + protected SelectScalarCBCommand createSelectScalarCBCommand( + ConditionBean cb, Class resultType, + SqlClause.SelectClauseType selectClauseType) { + assertBehaviorCommandInvoker("createSelectScalarCBCommand"); + final SelectScalarCBCommand command = xsetupSelectCommand(new SelectScalarCBCommand()); + command.setConditionBeanType(cb.getClass()); + command.setConditionBean(cb); + command.setResultType(resultType); + command.setSelectClauseType(selectClauseType); + return command; + } + + private > COMMAND xsetupSelectCommand( + COMMAND command) { + command.setTableDbName(getTableDbName()); + _behaviorCommandInvoker.injectComponentProperty(command); + return command; + } + + /** + * Invoke the command of behavior. + * + * @param The type of result. + * @param behaviorCommand The command of behavior. (NotNull) + * @return The instance of result. (Nullable) + */ + protected RESULT invoke(BehaviorCommand behaviorCommand) { + return _behaviorCommandInvoker.invoke(behaviorCommand); + } + + protected void assertBehaviorCommandInvoker(String methodName) { + if (_behaviorCommandInvoker == null) { + String msg = "Look! Read the message below." + getLineSeparator(); + msg = msg + + "/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *" + + getLineSeparator(); + msg = msg + + "Not found the invoker of behavior command as behavior's attributed!" + + getLineSeparator(); + msg = msg + getLineSeparator(); + msg = msg + "[Advice]" + getLineSeparator(); + msg = msg + + "Please confirm the definition of the invoker at your 'dbflute.dicon'." + + getLineSeparator(); + msg = msg + "It is precondition that '" + methodName + + "()' needs the invoker instance." + getLineSeparator(); + msg = msg + getLineSeparator(); + msg = msg + "[Your Behavior's Attributes]" + getLineSeparator(); + msg = msg + " _behaviorCommandInvoker : " + + _behaviorCommandInvoker + getLineSeparator(); + msg = msg + " _behaviorSelector : " + _behaviorSelector + + getLineSeparator(); + msg = msg + "* * * * * * * * * */"; + throw new IllegalStateException(msg); } } @@ -800,6 +1079,7 @@ return SimpleSystemUtil.getLineSeparator(); } + @SuppressWarnings("unchecked") protected ENTITY helpDowncastInternally( Entity entity, Class clazz) { assertObjectNotNull("entity", entity); @@ -850,8 +1130,16 @@ * * @param cb Condition-bean. (NotNull) */ - protected void assertConditionBeanNotNull( - jp.sf.pal.timecard.db.allcommon.cbean.ConditionBean cb) { + protected void assertConditionBeanNotNull(ConditionBean cb) { + assertCBNotNull(cb); + } + + /** + * Assert that the condition-bean is not null. + * + * @param cb Condition-bean. (NotNull) + */ + protected void assertCBNotNull(ConditionBean cb) { assertObjectNotNull("cb", cb); } @@ -896,7 +1184,7 @@ * * @param ls List. (NotNull) */ - protected void assertListNotNullAndEmpty(List ls) { + protected void assertListNotNullAndEmpty(List ls) { assertObjectNotNull("ls", ls); if (!ls.isEmpty()) { String msg = "The list should be empty: ls=" + ls.toString(); @@ -909,7 +1197,7 @@ * * @param ls List. (NotNull) */ - protected void assertListNotNullAndNotEmpty(List ls) { + protected void assertListNotNullAndNotEmpty(List ls) { assertObjectNotNull("ls", ls); if (ls.isEmpty()) { String msg = "The list should not be empty: ls=" + ls.toString(); @@ -922,7 +1210,7 @@ * * @param ls List. (NotNull) */ - protected void assertListNotNullAndHasOnlyOne(List ls) { + protected void assertListNotNullAndHasOnlyOne(List ls) { assertObjectNotNull("ls", ls); if (ls.size() != 1) { String msg = "The list should contain only one object: ls=" @@ -936,38 +1224,39 @@ // Accessor // ======== /** - * Get the selector of behavior. + * Get the invoker of behavior command. * - * @return The select of behavior. (Nullable: But normally NotNull) + * @return The invoker of behavior command. (Nullable: But normally NotNull) */ - protected BehaviorSelector getBehaviorSelector() { - return _behaviorSelector; + protected BehaviorCommandInvoker getBehaviorCommandInvoker() { + return _behaviorCommandInvoker; } /** - * Set the selector of behavior. + * Set the invoker of behavior command. * - * @param behaviorSelector The selector of behavior. (NotNull) + * @param behaviorCommandInvoker The invoker of behavior command. (NotNull) */ - public void setBehaviorSelector(BehaviorSelector behaviorSelector) { - this._behaviorSelector = behaviorSelector; + public void setBehaviorCommandInvoker( + BehaviorCommandInvoker behaviorCommandInvoker) { + this._behaviorCommandInvoker = behaviorCommandInvoker; } /** - * Get the selector of DAO. + * Get the selector of behavior. * - * @return The select of DAO. (Nullable: But normally NotNull) + * @return The select of behavior. (Nullable: But normally NotNull) */ - protected DaoSelector getDaoSelector() { - return _daoSelector; + protected BehaviorSelector getBehaviorSelector() { + return _behaviorSelector; } /** - * Set the selector of DAO. + * Set the selector of behavior. * - * @param daoSelector The selector of DAO. (NotNull) + * @param behaviorSelector The selector of behavior. (NotNull) */ - public void setDaoSelector(DaoSelector daoSelector) { - _daoSelector = daoSelector; + public void setBehaviorSelector(BehaviorSelector behaviorSelector) { + this._behaviorSelector = behaviorSelector; } } Modified: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/bhv/AbstractBehaviorWritable.java =================================================================== --- timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/bhv/AbstractBehaviorWritable.java 2008-12-27 22:18:30 UTC (rev 1630) +++ timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/bhv/AbstractBehaviorWritable.java 2008-12-27 22:20:25 UTC (rev 1631) @@ -4,10 +4,25 @@ import java.util.Iterator; import java.util.List; +import jp.sf.pal.timecard.db.allcommon.CommonColumnAutoSetupper; import jp.sf.pal.timecard.db.allcommon.Entity; import jp.sf.pal.timecard.db.allcommon.bhv.batch.TokenFileReflectionFailure; import jp.sf.pal.timecard.db.allcommon.bhv.batch.TokenFileReflectionOption; import jp.sf.pal.timecard.db.allcommon.bhv.batch.TokenFileReflectionResult; +import jp.sf.pal.timecard.db.allcommon.bhv.core.command.AbstractEntityCommand; +import jp.sf.pal.timecard.db.allcommon.bhv.core.command.AbstractListEntityCommand; +import jp.sf.pal.timecard.db.allcommon.bhv.core.command.BatchDeleteEntityCommand; +import jp.sf.pal.timecard.db.allcommon.bhv.core.command.BatchDeleteNonstrictEntityCommand; +import jp.sf.pal.timecard.db.allcommon.bhv.core.command.BatchInsertEntityCommand; +import jp.sf.pal.timecard.db.allcommon.bhv.core.command.BatchUpdateEntityCommand; +import jp.sf.pal.timecard.db.allcommon.bhv.core.command.BatchUpdateNonstrictEntityCommand; +import jp.sf.pal.timecard.db.allcommon.bhv.core.command.DeleteEntityCommand; +import jp.sf.pal.timecard.db.allcommon.bhv.core.command.DeleteNonstrictEntityCommand; +import jp.sf.pal.timecard.db.allcommon.bhv.core.command.InsertEntityCommand; +import jp.sf.pal.timecard.db.allcommon.bhv.core.command.QueryDeleteCBCommand; +import jp.sf.pal.timecard.db.allcommon.bhv.core.command.QueryUpdateEntityCBCommand; +import jp.sf.pal.timecard.db.allcommon.bhv.core.command.UpdateEntityCommand; +import jp.sf.pal.timecard.db.allcommon.bhv.core.command.UpdateNonstrictEntityCommand; import jp.sf.pal.timecard.db.allcommon.cbean.ConditionBean; import jp.sf.pal.timecard.db.allcommon.dbmeta.DBMeta; import jp.sf.pal.timecard.db.allcommon.helper.MapStringBuilder; @@ -20,7 +35,7 @@ import jp.sf.pal.timecard.db.allcommon.helper.token.file.impl.FileTokenImpl; /** - * The abstract class of behavior-writable. + * The abstract class of writable behavior. * * @author DBFlute(AutoGenerator) */ @@ -29,6 +44,31 @@ //========================================================================== // ========= + // Definition + // ========== + /** Map-string map-mark. */ + private static final String MAP_STRING_MAP_MARK = "map:"; + + /** Map-string start-brace. */ + private static final String MAP_STRING_START_BRACE = "@{"; + + /** Map-string end-brace. */ + private static final String MAP_STRING_END_BRACE = "@}"; + + /** Map-string delimiter. */ + private static final String MAP_STRING_DELIMITER = "@;"; + + /** Map-string equal. */ + private static final String MAP_STRING_EQUAL = "@="; + + //========================================================================== + // =========== + // Attribute + // ========= + protected CommonColumnAutoSetupper _commonColumnAutoSetupper; + + //========================================================================== + // ========= // Entity Update // ============= // ----------------------------------------------------- @@ -357,7 +397,7 @@ * @param entityList Entity list. (NotNull and NotEmpty) * @return The array of created count. */ - public int[] lumpCreate(java.util.List entityList) { + public int[] lumpCreate(List entityList) { assertListNotNullAndNotEmpty(entityList); return callCreateList(entityList); } @@ -370,7 +410,7 @@ * @exception jp.sf.pal.timecard.db.allcommon.exception.EntityAlreadyUpdatedException * If s2dao's version is over 1.0.47 (contains 1.0.47). */ - public int[] lumpModify(java.util.List entityList) { + public int[] lumpModify(List entityList) { assertListNotNullAndNotEmpty(entityList); return callModifyList(entityList); } @@ -383,7 +423,7 @@ * @exception jp.sf.pal.timecard.db.allcommon.exception.EntityAlreadyUpdatedException * If s2dao's version is over 1.0.47 (contains 1.0.47). */ - public int[] lumpRemove(java.util.List entityList) { + public int[] lumpRemove(List entityList) { assertListNotNullAndNotEmpty(entityList); return callRemoveList(entityList); } @@ -611,9 +651,11 @@ if (!processBeforeInsert(entity)) { return 1;/* as Normal End */ } - return getDaoWritable().create(entity); + return doCallCreate(entity); } + protected abstract int doCallCreate(Entity entity); + /** * Process before insert. * @@ -645,9 +687,11 @@ if (!processBeforeUpdate(entity)) { return 1;/* as Normal End */ } - return getDaoWritable().modifyModifiedOnly(entity); + return doCallModify(entity); } + protected abstract int doCallModify(Entity entity); + /** * Process before update. * @@ -678,9 +722,11 @@ if (!processBeforeDelete(entity)) { return 1;/* as Normal End */ } - return getDaoWritable().remove(entity); + return doCallRemove(entity); } + protected abstract int doCallRemove(Entity entity); + /** * Process before delete. * @@ -729,8 +775,38 @@ * (NotNull) */ protected void setupCommonColumnOfInsertIfNeeds(Entity targetEntity) { + final CommonColumnAutoSetupper setupper = getCommonColumnAutoSetupper(); + assertCommonColumnAutoSetupperNotNull(); + setupper.handleCommonColumnOfInsertIfNeeds(targetEntity); } + private void assertCommonColumnAutoSetupperNotNull() { + if (_commonColumnAutoSetupper == null) { + String msg = "Look! Read the message below." + getLineSeparator(); + msg = msg + + "/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *" + + getLineSeparator(); + msg = msg + + "Not found the auto set-upper of common column as behavior's attribute!" + + getLineSeparator(); + msg = msg + getLineSeparator(); + msg = msg + "[Advice]" + getLineSeparator(); + msg = msg + + "Please confirm the definition of the set-upper at your component configuration of DBFlute." + + getLineSeparator(); + msg = msg + getLineSeparator(); + msg = msg + "[Your Behavior's Attributes]" + getLineSeparator(); + msg = msg + " _behaviorCommandInvoker : " + + _behaviorCommandInvoker + getLineSeparator(); + msg = msg + " _behaviorSelector : " + _behaviorSelector + + getLineSeparator(); + msg = msg + " _commonColumnAutoSetupper : " + + _commonColumnAutoSetupper + getLineSeparator(); + msg = msg + "* * * * * * * * * */"; + throw new IllegalStateException(msg); + } + } + /** * Filter the entity of insert. * @@ -778,6 +854,9 @@ * (NotNull) */ protected void setupCommonColumnOfUpdateIfNeeds(Entity targetEntity) { + final CommonColumnAutoSetupper setupper = getCommonColumnAutoSetupper(); + assertCommonColumnAutoSetupperNotNull(); + setupper.handleCommonColumnOfUpdateIfNeeds(targetEntity); } /** @@ -843,12 +922,14 @@ * (NotNull) * @return Inserted count. */ - public int[] callCreateList(java.util.List entityList) { + public int[] callCreateList(List entityList) { assertObjectNotNull("entityList", entityList); helpFilterBeforeInsertInternally(entityList); - return getDaoWritable().createList(entityList); + return doCreateList(entityList); } + protected abstract int[] doCreateList(List entityList); + /** * The implementation. * @@ -856,12 +937,14 @@ * (NotNull) * @return Updated count. */ - public int[] callModifyList(java.util.List entityList) { + public int[] callModifyList(List entityList) { assertObjectNotNull("entityList", entityList); helpFilterBeforeUpdateInternally(entityList); - return getDaoWritable().modifyList(entityList); + return doModifyList(entityList); } + protected abstract int[] doModifyList(List entityList); + /** * The implementation. * @@ -869,12 +952,14 @@ * (NotNull) * @return Deleted count. */ - public int[] callRemoveList(java.util.List entityList) { + public int[] callRemoveList(List entityList) { assertObjectNotNull("entityList", entityList); helpFilterBeforeDeleteInternally(entityList); - return getDaoWritable().removeList(entityList); + return doRemoveList(entityList); } + protected abstract int[] doRemoveList(List entityList); + protected void assertEntityHasVersionNoValue(Entity entity) { if (!getDBMeta().hasVersionNo()) { return; @@ -994,4 +1079,148 @@ } return filteredList; } + + //========================================================================== + // ========= + // Behavior Command + // ================ + protected InsertEntityCommand createInsertEntityCommand(Entity entity) { + assertBehaviorCommandInvoker("createInsertEntityCommand"); + return xsetupEntityCommand(new InsertEntityCommand(), entity); + } + + protected UpdateEntityCommand createUpdateEntityCommand(Entity entity) { + assertBehaviorCommandInvoker("createUpdateEntityCommand"); + return xsetupEntityCommand(new UpdateEntityCommand(), entity); + } + + protected UpdateNonstrictEntityCommand createUpdateNonstrictEntityCommand( + Entity entity) { + assertBehaviorCommandInvoker("createUpdateNonstrictEntityCommand"); + return xsetupEntityCommand(new UpdateNonstrictEntityCommand(), entity); + } + + protected DeleteEntityCommand createDeleteEntityCommand(Entity entity) { + assertBehaviorCommandInvoker("createDeleteEntityCommand"); + return xsetupEntityCommand(new DeleteEntityCommand(), entity); + } + + protected DeleteNonstrictEntityCommand createDeleteNonstrictEntityCommand( + Entity entity) { + assertBehaviorCommandInvoker("createDeleteNonstrictEntityCommand"); + return xsetupEntityCommand(new DeleteNonstrictEntityCommand(), entity); + } + + private COMMAND xsetupEntityCommand( + COMMAND command, Entity entity) { + command.setTableDbName(getTableDbName()); + _behaviorCommandInvoker.injectComponentProperty(command); + command.setEntityType(entity.getClass()); + command.setEntity(entity); + return command; + } + + protected BatchInsertEntityCommand createBatchInsertEntityCommand( + List entityList) { + assertBehaviorCommandInvoker("createBatchInsertEntityCommand"); + return xsetupListEntityCommand(new BatchInsertEntityCommand(), + entityList); + } + + protected BatchUpdateEntityCommand createBatchUpdateEntityCommand( + List entityList) { + assertBehaviorCommandInvoker("createBatchUpdateEntityCommand"); + return xsetupListEntityCommand(new BatchUpdateEntityCommand(), + entityList); + } + + protected BatchUpdateNonstrictEntityCommand createBatchUpdateNonstrictEntityCommand( + List entityList) { + assertBehaviorCommandInvoker("createBatchUpdateNonstrictEntityCommand"); + return xsetupListEntityCommand(new BatchUpdateNonstrictEntityCommand(), + entityList); + } + + protected BatchDeleteEntityCommand createBatchDeleteEntityCommand( + List entityList) { + assertBehaviorCommandInvoker("createBatchDeleteEntityCommand"); + return xsetupListEntityCommand(new BatchDeleteEntityCommand(), + entityList); + } + + protected BatchDeleteNonstrictEntityCommand createBatchDeleteNonstrictEntityCommand( + List entityList) { + assertBehaviorCommandInvoker("createBatchDeleteNonstrictEntityCommand"); + return xsetupListEntityCommand(new BatchDeleteNonstrictEntityCommand(), + entityList); + } + + /** + * @param The type of behavior command for list entity. + * @param command The command of behavior. (NotNull) + * @param entityList The list of entity. (NotNull, NotEmpty) + * @return The command of behavior. (NotNull) + */ + private COMMAND xsetupListEntityCommand( + COMMAND command, List entityList) { + if (entityList.isEmpty()) { + String msg = "The argument 'entityList' should not be empty: " + + entityList; + throw new IllegalStateException(msg); + } + command.setTableDbName(getTableDbName()); + _behaviorCommandInvoker.injectComponentProperty(command); + command.setEntityType(entityList.get(0).getClass()); // *The list should + // not be empty! + command.setEntityList(entityList); + return command; + } + + protected QueryDeleteCBCommand createQueryDeleteCBCommand(ConditionBean cb) { + assertBehaviorCommandInvoker("createQueryDeleteCBCommand"); + final QueryDeleteCBCommand cmd = new QueryDeleteCBCommand(); + cmd.setTableDbName(getTableDbName()); + _behaviorCommandInvoker.injectComponentProperty(cmd); + cmd.setConditionBeanType(cb.getClass()); + cmd.setConditionBean(cb); + return cmd; + } + + protected QueryUpdateEntityCBCommand createQueryUpdateEntityCBCommand( + Entity entity, ConditionBean cb) { + assertBehaviorCommandInvoker("createQueryUpdateEntityCBCommand"); + final QueryUpdateEntityCBCommand cmd = new QueryUpdateEntityCBCommand(); + cmd.setTableDbName(getTableDbName()); + _behaviorCommandInvoker.injectComponentProperty(cmd); + cmd.setConditionBeanType(cb.getClass()); + cmd.setConditionBean(cb); + cmd.setEntityType(entity.getClass()); + cmd.setEntity(entity); + return cmd; + } + + //========================================================================== + // ========= + // Accessor + // ======== + /** + * Get the auto set-upper of common column. + * + * @return The auto set-upper of common column. (Nullable: But normally + * NotNull) + */ + protected CommonColumnAutoSetupper getCommonColumnAutoSetupper() { + return _commonColumnAutoSetupper; + } + + /** + * Set the auto set-upper of common column. + * + * @param commonColumnAutoSetupper The auto set-upper of common column. + * (NotNull) + */ + public void setCommonColumnAutoSetupper( + CommonColumnAutoSetupper commonColumnAutoSetupper) { + this._commonColumnAutoSetupper = commonColumnAutoSetupper; + } } Modified: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/bhv/BehaviorReadable.java =================================================================== --- timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/bhv/BehaviorReadable.java 2008-12-27 22:18:30 UTC (rev 1630) +++ timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/bhv/BehaviorReadable.java 2008-12-27 22:20:25 UTC (rev 1631) @@ -1,6 +1,5 @@ package jp.sf.pal.timecard.db.allcommon.bhv; -import jp.sf.pal.timecard.db.allcommon.DaoReadable; import jp.sf.pal.timecard.db.allcommon.Entity; import jp.sf.pal.timecard.db.allcommon.cbean.ConditionBean; import jp.sf.pal.timecard.db.allcommon.cbean.ListResultBean; @@ -16,34 +15,12 @@ //========================================================================== // ========= - // Definition - // ========== - /** Map-string map-mark. */ - public static final String MAP_STRING_MAP_MARK = "map:"; - - /** Map-string list-mark. */ - public static final String MAP_STRING_LIST_MARK = "list:"; - - /** Map-string start-brace. */ - public static final String MAP_STRING_START_BRACE = "@{"; - - /** Map-string end-brace. */ - public static final String MAP_STRING_END_BRACE = "@}"; - - /** Map-string delimiter. */ - public static final String MAP_STRING_DELIMITER = "@;"; - - /** Map-string equal. */ - public static final String MAP_STRING_EQUAL = "@="; - - //========================================================================== - // ========= // Table name // ========== /** - * Get table db-name. + * Get table DB name. * - * @return Table db-name. (NotNull) + * @return Table DB name. (NotNull) */ public String getTableDbName(); @@ -52,25 +29,14 @@ // DBMeta // ====== /** - * Get dbmeta. + * Get the instance of DBMeta. * - * @return DBMeta. (NotNull) + * @return The instance of DBMeta. (NotNull) */ public DBMeta getDBMeta(); //========================================================================== // ========= - // Dao Accessor - // ============ - /** - * Get dao-readable. - * - * @return Dao-readable. (NotNull) - */ - public DaoReadable getDaoReadable(); - - //========================================================================== - // ========= // New Instance // ============ /** @@ -173,4 +139,13 @@ * @return The value of sequence. (NotNull) */ public java.math.BigDecimal readNextVal(); + + //========================================================================== + // ========= + // Warm Up + // ======= + /** + * Warm up the command of behavior. + */ + public void warmUpCommand(); } Modified: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/bhv/BehaviorWritable.java =================================================================== --- timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/bhv/BehaviorWritable.java 2008-12-27 22:18:30 UTC (rev 1630) +++ timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/bhv/BehaviorWritable.java 2008-12-27 22:20:25 UTC (rev 1631) @@ -1,6 +1,7 @@ package jp.sf.pal.timecard.db.allcommon.bhv; -import jp.sf.pal.timecard.db.allcommon.DaoWritable; +import java.util.List; + import jp.sf.pal.timecard.db.allcommon.Entity; /** @@ -10,13 +11,6 @@ */ public interface BehaviorWritable extends BehaviorReadable { - /** - * Get dao-writable. - * - * @return Dao-writable. (NotNull) - */ - public DaoWritable getDaoWritable(); - //========================================================================== // =========== // Basic Entity Update @@ -116,15 +110,15 @@ /** * Lump create the list. * - * @param entityList Entity-list. (NotNull and NotEmpty) + * @param entityList The list of entity. (NotNull and NotEmpty) * @return The array of created count. */ - public int[] lumpCreate(java.util.List entityList); + public int[] lumpCreate(List entityList); /** - * Lump Modify the list. + * Lump modify the list. * - * @param entityList Entity-list. (NotNull and NotEmpty) + * @param entityList The list of entity. (NotNull and NotEmpty) * @return Modified count. * @exception jp.sf.pal.timecard.db.allcommon.exception.EntityAlreadyUpdatedException * When the entity has already been updated. And Only when @@ -132,12 +126,12 @@ * @exception jp.sf.pal.timecard.db.allcommon.exception.EntityDuplicatedException * When the entity has been duplicated. */ - public int[] lumpModify(java.util.List entityList); + public int[] lumpModify(List entityList); /** * Lump remove the list. * - * @param entityList Entity-list. (NotNull and NotEmpty) + * @param entityList The list of entity. (NotNull and NotEmpty) * @return Removed count. * @exception jp.sf.pal.timecard.db.allcommon.exception.EntityAlreadyUpdatedException * When the entity has already been updated. And Only when @@ -145,5 +139,5 @@ * @exception jp.sf.pal.timecard.db.allcommon.exception.EntityDuplicatedException * When the entity has been duplicated. */ - public int[] lumpRemove(java.util.List entityList); + public int[] lumpRemove(List entityList); } Added: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/bhv/core/BehaviorCommand.java =================================================================== --- timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/bhv/core/BehaviorCommand.java (rev 0) +++ timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/bhv/core/BehaviorCommand.java 2008-12-27 22:20:25 UTC (rev 1631) @@ -0,0 +1,71 @@ +package jp.sf.pal.timecard.db.allcommon.bhv.core; + +import jp.sf.pal.timecard.db.allcommon.cbean.ConditionBean; +import jp.sf.pal.timecard.db.allcommon.cbean.outsidesql.OutsideSqlOption; + +/** + * @author DBFlute(AutoGenerator) + * @param The type of result. + */ +public interface BehaviorCommand { + + //========================================================================== + // ========= + // Basic Information + // ================= + public String getTableDbName(); + + public String getCommandName(); + + /** + * Get the return type of command. This type is not related to generic type + * because this is for conversion and check only. + * + * @return The return type of command. (NotNull) + */ + public Class getCommandReturnType(); + + public boolean isInitializeOnly(); + + //========================================================================== + // ========= + // Detail Information + // ================== + public boolean isConditionBean(); + + public boolean isOutsideSql(); + + public boolean isProcedure(); + + public boolean isSelect(); + + public boolean isSelectCount(); + + //========================================================================== + // ========= + // Process Callback + // ================ + public void beforeGettingSqlExecution(); + + public void afterExecuting(); + + //========================================================================== + // ========= + // SqlExecution Handling + // ===================== + public String buildSqlExecutionKey(); + + public SqlExecutionCreator createSqlExecutionCreator(); + + public Object[] getSqlExecutionArgument(); + + //========================================================================== + // ========= + // Argument Information + // ==================== + public ConditionBean getConditionBean(); + + public String getOutsideSqlPath(); + + public OutsideSqlOption getOutsideSqlOption(); +} Property changes on: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/bhv/core/BehaviorCommand.java ___________________________________________________________________ Name: svn:eol-style + native Added: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/bhv/core/BehaviorCommandComponentSetup.java =================================================================== --- timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/bhv/core/BehaviorCommandComponentSetup.java (rev 0) +++ timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/bhv/core/BehaviorCommandComponentSetup.java 2008-12-27 22:20:25 UTC (rev 1631) @@ -0,0 +1,23 @@ +package jp.sf.pal.timecard.db.allcommon.bhv.core; + +import javax.sql.DataSource; + +import org.seasar.dao.BeanMetaDataFactory; +import org.seasar.dao.ValueTypeFactory; +import org.seasar.extension.jdbc.StatementFactory; + +/** + * @author DBFlute(AutoGenerator) + */ +public interface BehaviorCommandComponentSetup { + + public void setDataSource(DataSource dataSource); + + public void setStatementFactory(StatementFactory statementFactory); + + public void setBeanMetaDataFactory(BeanMetaDataFactory beanMetaDataFactory); + + public void setValueTypeFactory(ValueTypeFactory valueTypeFactory); + + public void setSqlFileEncoding(String sqlFileEncoding); +} Property changes on: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/bhv/core/BehaviorCommandComponentSetup.java ___________________________________________________________________ Name: svn:eol-style + native Added: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/bhv/core/BehaviorCommandInvoker.java =================================================================== --- timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/bhv/core/BehaviorCommandInvoker.java (rev 0) +++ timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/bhv/core/BehaviorCommandInvoker.java 2008-12-27 22:20:25 UTC (rev 1631) @@ -0,0 +1,842 @@ +package jp.sf.pal.timecard.db.allcommon.bhv.core; + +import java.util.Arrays; +import java.util.List; +import java.util.Map; +import java.util.concurrent.ConcurrentHashMap; + +import javax.sql.DataSource; + +import jp.sf.pal.timecard.db.allcommon.DBFluteConfig; +import jp.sf.pal.timecard.db.allcommon.Entity; +import jp.sf.pal.timecard.db.allcommon.InternalMapContext; +import jp.sf.pal.timecard.db.allcommon.XLog; +import jp.sf.pal.timecard.db.allcommon.cbean.ConditionBeanContext; +import jp.sf.pal.timecard.db.allcommon.cbean.FetchNarrowingBeanContext; +import jp.sf.pal.timecard.db.allcommon.cbean.outsidesql.OutsideSqlContext; +import jp.sf.pal.timecard.db.allcommon.dbmeta.DBMeta; +import jp.sf.pal.timecard.db.allcommon.dbmeta.DBMetaInstanceHandler; +import jp.sf.pal.timecard.db.allcommon.helper.stacktrace.InvokeNameExtractingResource; +import jp.sf.pal.timecard.db.allcommon.helper.stacktrace.InvokeNameResult; +import jp.sf.pal.timecard.db.allcommon.helper.stacktrace.impl.InvokeNameExtractorImpl; +import jp.sf.pal.timecard.db.allcommon.jdbc.StatementConfig; +import jp.sf.pal.timecard.db.allcommon.s2dao.internal.various.InternalStatementFactory; +import jp.sf.pal.timecard.db.allcommon.util.SimpleSystemUtil; +import jp.sf.pal.timecard.db.allcommon.util.SimpleTypeUtil; +import jp.sf.pal.timecard.db.allcommon.util.TraceViewUtil; + +import org.seasar.dao.BeanMetaDataFactory; +import org.seasar.dao.ValueTypeFactory; +import org.seasar.extension.jdbc.StatementFactory; +import org.seasar.framework.util.Disposable; +import org.seasar.framework.util.DisposableUtil; + +/** + * The invoker of behavior command. + * + *
+ * public interface methods are as follows:
+ * 
+ *   o injectComponentProperty(BehaviorCommandComponentSetup behaviorCommand);
+ *   o invoke(BehaviorCommand behaviorCommand);
+ *   o isDisposable();
+ *   o isExecutionCacheEmpty();
+ * 
+ * + * @author DBFlute(AutoGenerator) + */ +public class BehaviorCommandInvoker implements Disposable { + + //========================================================================== + // ========= + // Attribute + // ========= + // ----------------------------------------------------- + // Injection Target + // ---------------- + protected DataSource _dataSource; + + protected BeanMetaDataFactory _beanMetaDataFactory; + + protected ValueTypeFactory _valueTypeFactory; + + // ----------------------------------------------------- + // Fixed Property + // -------------- + protected final StatementFactory _statementFactory = createStatememtFactory(); + + protected final Map _executionMap = new ConcurrentHashMap(); + + // ----------------------------------------------------- + // Dispose Status + // -------------- + protected boolean disposable; + + //========================================================================== + // ========= + // Constructor + // =========== + public BehaviorCommandInvoker() { + } + + //========================================================================== + // ========= + // Command Set up + // ============== + /** + * Inject the properties of component to the command of behavior. {Public + * Interface} + * + * @param behaviorCommand The command of behavior. (NotNull) + */ + public void injectComponentProperty( + BehaviorCommandComponentSetup behaviorCommand) { + behaviorCommand.setDataSource(_dataSource); + behaviorCommand.setStatementFactory(_statementFactory); + behaviorCommand.setBeanMetaDataFactory(_beanMetaDataFactory); + behaviorCommand.setValueTypeFactory(_valueTypeFactory); + behaviorCommand.setSqlFileEncoding(getSqlFileEncoding()); + } + + protected String getSqlFileEncoding() { + return "UTF-8"; // This value is set when generating. + } + + //========================================================================== + // ========= + // Command Invoke + // ============== + /** + * Invoke the command of behavior. {Public Interface} This method is an + * entry point! + * + * @param The type of result. + * @param behaviorCommand The command of behavior. (NotNull) + * @return The result object. (Nullable) + */ + public RESULT invoke(BehaviorCommand behaviorCommand) { + clearContext(); + try { + return doInvoke(behaviorCommand); + } finally { + clearContext(); + } + } + + /** + * @param The type of result. + * @param behaviorCommand The command of behavior. (NotNull) + * @return The result object. (Nullable) + */ + protected RESULT doInvoke(BehaviorCommand behaviorCommand) { + // - - - - - - - - - - - - - + // Initialize SQL Execution + // - - - - - - - - - - - - - + if (behaviorCommand.isInitializeOnly()) { + initializeSqlExecution(behaviorCommand); + return null; // The end! (Initialize Only) + } + behaviorCommand.beforeGettingSqlExecution(); + + SqlExecution execution = null; + try { + final String key = behaviorCommand.buildSqlExecutionKey(); + execution = getSqlExecution(key); + if (execution == null) { + long beforeCmd = 0; + if (isLogEnabled()) { + beforeCmd = System.currentTimeMillis(); + } + SqlExecutionCreator creator = behaviorCommand + .createSqlExecutionCreator(); + execution = getSqlExecution(key, creator); + if (isLogEnabled()) { + final long afterCmd = System.currentTimeMillis(); + if (beforeCmd != afterCmd) { + logSqlExecution(behaviorCommand, execution, beforeCmd, + afterCmd); + } + } + } + } finally { + if (isLogEnabled()) { + logInvocation(behaviorCommand); + } + } + + long before = 0; + if (isLogEnabled()) { + before = System.currentTimeMillis(); + } + + Object ret = null; + try { + final Object[] args = behaviorCommand.getSqlExecutionArgument(); + ret = executeSql(execution, args); + } finally { + behaviorCommand.afterExecuting(); + } + final Class retType = behaviorCommand.getCommandReturnType(); + assertRetType(retType, ret); + + if (isLogEnabled()) { + final long after = System.currentTimeMillis(); + logReturn(behaviorCommand, retType, ret, before, after); + } + + // - - - - - - - - - - + // Convert and Return! + // - - - - - - - - - - + if (retType.isPrimitive()) { + ret = convertPrimitiveWrapper(retType, ret); + } else if (Number.class.isAssignableFrom(retType)) { + ret = convertNumber(retType, ret); + } + @SuppressWarnings("unchecked") + final RESULT result = (RESULT) ret; + return result; + } + + //========================================================================== + // ========= + // SQL Execution + // ============= + protected void initializeSqlExecution( + BehaviorCommand behaviorCommand) { + final String key = behaviorCommand.buildSqlExecutionKey(); + SqlExecutionCreator creator = behaviorCommand + .createSqlExecutionCreator(); + getSqlExecution(key, creator); + } + + protected SqlExecution getSqlExecution(String key) { + return _executionMap.get(key); + } + + /** + * @param key The key of SQL execution. (NotNull) + * @param executionCreator The creator of SQL execution. (NotNull) + * @return The SQL execution that may be created then. (NotNull) + */ + protected SqlExecution getSqlExecution(String key, + SqlExecutionCreator executionCreator) { + SqlExecution execution = getSqlExecution(key); + if (execution == null) { + synchronized (_executionMap) { + execution = getSqlExecution(key); + if (execution == null) { + if (isLogEnabled()) { + log("...Initializing sqlExecution for the key '" + key + + "'"); + } + _executionMap.put(key, executionCreator + .createSqlExecution()); + } else { + if (isLogEnabled()) { + log("...Getting sqlExecution as cache because the previous thread have already initilized."); + } + } + } + execution = getSqlExecution(key); + if (execution == null) { + String msg = "sqlExecutionCreator.createSqlCommand() should not return null:"; + msg = msg + " sqlExecutionCreator=" + executionCreator + + " key=" + key; + throw new IllegalStateException(msg); + } + if (!disposable) { + synchronized (this) { + if (!disposable) { + toBeDisposable(); + } + } + } + } + return execution; + } + + protected Object executeSql(SqlExecution execution, Object[] args) { + return execution.execute(args); + } + + //========================================================================== + // ========= + // Log SqlCommand + // ============== + protected void logSqlExecution( + BehaviorCommand behaviorCommand, SqlExecution execution, + long beforeCmd, long afterCmd) { + log("SqlExecution Initialization Cost: [" + + TraceViewUtil.convertToPerformanceView(afterCmd - beforeCmd) + + "]"); + } + + //========================================================================== + // ========= + // Log Invocation + // ============== + protected void logInvocation( + BehaviorCommand behaviorCommand) { + final StackTraceElement[] stackTrace = new Exception().getStackTrace(); + final InvokeNameResult behaviorResult = extractBehaviorInvokeName(stackTrace); + filterBehaviorResult(behaviorCommand, behaviorResult); + + final String invokeClassName; + final String invokeMethodName; + if (!behaviorResult.isEmptyResult()) { + invokeClassName = behaviorResult.getSimpleClassName(); + invokeMethodName = behaviorResult.getMethodName(); + } else { + invokeClassName = behaviorCommand.getTableDbName(); + invokeMethodName = behaviorCommand.getCommandName(); + } + final String expWithoutKakko = buildInvocationExpressionWithoutKakko( + behaviorCommand, invokeClassName, invokeMethodName); + + // Save behavior invoke name for error message. + putObjectToMapContext("df:BehaviorInvokeName", expWithoutKakko + "()"); + + final String equalBorder = buildFitBorder("", "=", expWithoutKakko, + false); + final String callerExpression = expWithoutKakko + "()"; + + log("/=====================================================" + + equalBorder + "=="); + log(" " + + callerExpression); + log(" " + + equalBorder + "=/"); + + logPath(behaviorCommand, stackTrace, behaviorResult); + + if (behaviorCommand.isOutsideSql() && !behaviorCommand.isProcedure()) { + final OutsideSqlContext outsideSqlContext = getOutsideSqlContext(); + if (outsideSqlContext != null) { + log("path: " + behaviorCommand.getOutsideSqlPath()); + log("option: " + behaviorCommand.getOutsideSqlOption()); + } + } + } + + protected void filterBehaviorResult( + BehaviorCommand behaviorCommand, + InvokeNameResult behaviorResult) { + final String simpleClassName = behaviorResult.getSimpleClassName(); + if (simpleClassName == null) { + return; + } + if (simpleClassName.contains("Behavior") + && simpleClassName.endsWith("$SLFunction")) { + final String behaviorClassName = findBehaviorClassNameFromDBMeta(behaviorCommand + .getTableDbName()); + behaviorResult.setSimpleClassName(behaviorClassName); + behaviorResult.setMethodName("scalarSelect()." + + behaviorResult.getMethodName()); + } + } + + protected void logPath(BehaviorCommand behaviorCommand, + StackTraceElement[] stackTrace, InvokeNameResult behaviorResult) { + final int bhvNextIndex = behaviorResult.getNextStartIndex(); + final InvokeNameResult clientResult = extractClientInvokeName( + stackTrace, bhvNextIndex); + final int clientFirstIndex = clientResult.getFoundFirstIndex(); + final InvokeNameResult byPassResult = extractByPassInvokeName( + stackTrace, bhvNextIndex, clientFirstIndex - bhvNextIndex); + + final String clientInvokeName = clientResult.getInvokeName(); + final String byPassInvokeName = byPassResult.getInvokeName(); + final String behaviorInvokeName = behaviorResult.getInvokeName(); + if (clientInvokeName.trim().length() == 0 + && byPassInvokeName.trim().length() == 0) { + return; + } + + // Save client invoke name for error message. + if (!clientResult.isEmptyResult()) { + putObjectToMapContext("df:ClientInvokeName", clientInvokeName); + } + // Save by-pass invoke name for error message. + if (!byPassResult.isEmptyResult()) { + putObjectToMapContext("df:ByPassInvokeName", byPassInvokeName); + } + + log(clientInvokeName + byPassInvokeName + behaviorInvokeName + "..."); + } + + protected String buildInvocationExpressionWithoutKakko( + BehaviorCommand behaviorCommand, String invokeClassName, + String invokeMethodName) { + if (invokeClassName.contains("OutsideSql") + && invokeClassName.endsWith("Executor")) { // OutsideSql + // Executor Handling + try { + final String originalName = invokeClassName; + if (behaviorCommand.isOutsideSql()) { + final OutsideSqlContext outsideSqlContext = getOutsideSqlContext(); + final String tableDbName = outsideSqlContext + .getTableDbName(); + final String behaviorClassName = findBehaviorClassNameFromDBMeta(tableDbName); + invokeClassName = behaviorClassName + ".outsideSql()"; + if (originalName.endsWith("OutsideSqlEntityExecutor")) { + invokeClassName = invokeClassName + ".entityHandling()"; + } else if (originalName + .endsWith("OutsideSqlPagingExecutor")) { + if (outsideSqlContext.isAutoPagingLogging()) { + invokeClassName = invokeClassName + ".autoPaging()"; + } else { + invokeClassName = invokeClassName + + ".manualPaging()"; + } + } else if (originalName + .endsWith("OutsideSqlCursorExecutor")) { + invokeClassName = invokeClassName + ".cursorHandling()"; + } + } else { + invokeClassName = "OutsideSql"; + } + } catch (RuntimeException ignored) { + log("Ignored exception occurred: msg=" + ignored.getMessage()); + } + } + String callerExpressionWithoutKakko = invokeClassName + "." + + invokeMethodName; + if ("selectPage".equals(invokeMethodName)) { // Special Handling! + boolean resultTypeInteger = false; + if (behaviorCommand.isOutsideSql()) { + final OutsideSqlContext outsideSqlContext = getOutsideSqlContext(); + final Object resultTypeSpecification = outsideSqlContext + .getResultTypeSpecification(); + if (resultTypeSpecification != null + && resultTypeSpecification instanceof Class) { + final Class resultType = (Class) resultTypeSpecification; + if (Integer.class.isAssignableFrom(resultType)) { + resultTypeInteger = true; + } + } + } + if (resultTypeInteger || behaviorCommand.isSelectCount()) { + callerExpressionWithoutKakko = callerExpressionWithoutKakko + + "():count"; + } else { + callerExpressionWithoutKakko = callerExpressionWithoutKakko + + "():paging"; + } + } + return callerExpressionWithoutKakko; + } + + protected String buildFitBorder(String prefix, String element, + String lengthTargetString, boolean space) { + final int length = space ? lengthTargetString.length() / 2 + : lengthTargetString.length(); + final StringBuffer sb = new StringBuffer(); + sb.append(prefix); + for (int i = 0; i < length; i++) { + sb.append(element); + if (space) { + sb.append(" "); + } + } + if (space) { + sb.append(element); + } + return sb.toString(); + } + + protected InvokeNameResult extractClientInvokeName( + StackTraceElement[] stackTrace, final int startIndex) { + final List 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 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 suffixList = Arrays.asList(new String[] { "Bhv", + "BehaviorReadable", "BehaviorWritable", "PagingInvoker" }); + final List keywordList = Arrays.asList(new String[] { "Bhv$", + "BehaviorReadable$", "BehaviorWritable$" }); + final List ousideSql1List = Arrays + .asList(new String[] { "OutsideSql" }); + final List ousideSql2List = Arrays + .asList(new String[] { "Executor" }); + final List 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 suffixList) { + for (String suffix : suffixList) { + if (className.endsWith(suffix)) { + return true; + } + } + return false; + } + + protected boolean isClassNameContains(String className, + List keywordList) { + for (String keyword : keywordList) { + if (className.contains(keyword)) { + return true; + } + } + return false; + } + + /** + * @param resource the call-back resource for invoke-name-extracting. + * (NotNull) + * @param stackTrace Stack log. (NotNull) + * @return The result of invoke name. (NotNull: If not found, returns empty + * string.) + */ + protected InvokeNameResult extractInvokeName( + InvokeNameExtractingResource resource, + StackTraceElement[] stackTrace) { + final InvokeNameExtractorImpl extractor = new InvokeNameExtractorImpl(); + extractor.setStackTrace(stackTrace); + return extractor.extractInvokeName(resource); + } + + /** + * @param simpleClassName The simple class name. (NotNull) + * @return The simple class name removed the base prefix. (NotNull) + */ + protected String removeBasePrefixFromSimpleClassName(String simpleClassName) { + if (!simpleClassName.startsWith("Bs")) { + return simpleClassName; + } + final int prefixLength = "Bs".length(); + if (!Character.isUpperCase(simpleClassName.substring(prefixLength) + .charAt(0))) { + return simpleClassName; + } + if (simpleClassName.length() <= prefixLength) { + return simpleClassName; + } + return "" + simpleClassName.substring(prefixLength); + } + + protected String findBehaviorClassNameFromDBMeta(String tableDbName) { + final DBMeta dbmeta = DBMetaInstanceHandler.findDBMeta(tableDbName); + final String behaviorTypeName = dbmeta.getBehaviorTypeName(); + final String behaviorClassName = behaviorTypeName + .substring(behaviorTypeName.lastIndexOf(".") + ".".length()); + return removeBasePrefixFromSimpleClassName(behaviorClassName); + } + + //========================================================================== + // ========= + // Log Return + // ========== + protected void logReturn(BehaviorCommand behaviorCommand, + Class retType, Object ret, long before, long after) { + try { + final String daoResultPrefix = "===========/ [" + + TraceViewUtil.convertToPerformanceView(after - before) + + " - "; + if (List.class.isAssignableFrom(retType)) { + if (ret == null) { + log(daoResultPrefix + "Selected list: null]"); + } else { + final List ls = (java.util.List) ret; + if (ls.isEmpty()) { + log(daoResultPrefix + "Selected list: 0]"); + } else if (ls.size() == 1 && ls.get(0) instanceof Number) { + log(daoResultPrefix + "Selected count: " + ls.get(0) + + "]"); + } else { + log(daoResultPrefix + "Selected list: " + ls.size() + + " first=" + ls.get(0) + "]"); + } + } + } else if (Entity.class.isAssignableFrom(retType)) { + if (ret == null) { + log(daoResultPrefix + "Selected entity: null" + "]"); + } else { + final Entity entity = (Entity) ret; + log(daoResultPrefix + "Selected entity: " + entity + "]"); + } + } else if (Entity.class.isAssignableFrom(retType)) { + if (ret == null) { + log(daoResultPrefix + "Selected entity: null" + "]"); + } else { + final Entity entity = (Entity) ret; + log(daoResultPrefix + "Selected entity: " + entity + "]"); + } + } else if (int[].class.isAssignableFrom(retType)) { + if (ret == null) { + log(daoResultPrefix + "Selected entity: null" + "]"); + } else { + final int[] resultArray = (int[]) ret; + if (resultArray.length == 0) { + log(daoResultPrefix + "All updated count: 0]"); + } else { + final StringBuilder sb = new StringBuilder(); + boolean resultExpressionScope = true; + int resultCount = 0; + int loopCount = 0; + for (int element : resultArray) { + resultCount = resultCount + element; + if (resultExpressionScope) { + if (loopCount <= 10) { + if (sb.length() == 0) { + sb.append(element); + } else { + sb.append(",").append(element); + } + } else { + sb.append(",").append("..."); + resultExpressionScope = false; + } + } + ++loopCount; + } + sb.insert(0, "{").append("}"); + log(daoResultPrefix + "All updated count: " + + resultCount + " result=" + sb + "]"); + } + } + } else { + if (behaviorCommand.isSelectCount()) { + log(daoResultPrefix + "Selected count: " + ret + "]"); + } else { + log(daoResultPrefix + "Result: " + ret + "]"); + } + } + log(" "); + } catch (RuntimeException e) { + String msg = "Result object debug threw the exception: behaviorCommand="; + msg = msg + behaviorCommand + " retType=" + retType; + msg = msg + " ret=" + ret; + throw e; + } + } + + //========================================================================== + // ========= + // Context Helper + // ============== + protected OutsideSqlContext getOutsideSqlContext() { + if (!OutsideSqlContext.isExistOutsideSqlContextOnThread()) { + return null; + } + return OutsideSqlContext.getOutsideSqlContextOnThread(); + } + + protected void putObjectToMapContext(String key, Object value) { + InternalMapContext.setObject(key, value); + } + + protected void clearContext() { + if (OutsideSqlContext.isExistOutsideSqlContextOnThread()) { + OutsideSqlContext.clearOutsideSqlContextOnThread(); + } + if (FetchNarrowingBeanContext.isExistFetchNarrowingBeanOnThread()) { + // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + // - - - - - - - - - - - - - - - + // Because there is possible that fetch narrowing has been ignored + // for manualPaging of outsideSql. + // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + // - - - - - - - - - - - - - - - + FetchNarrowingBeanContext.getFetchNarrowingBeanOnThread() + .restoreIgnoredFetchNarrowing(); + + FetchNarrowingBeanContext.clearFetchNarrowingBeanOnThread(); + } + if (ConditionBeanContext.isExistConditionBeanOnThread()) { + ConditionBeanContext.clearConditionBeanOnThread(); + } + if (InternalMapContext.isExistInternalMapContextOnThread()) { + InternalMapContext.clearInternalMapContextOnThread(); + } + } + + //========================================================================== + // ========= + // Execute Status Log + // ================== + protected void log(String msg) { + XLog.log(msg); + } + + protected boolean isLogEnabled() { + return XLog.isLogEnabled(); + } + + protected StatementFactory createStatememtFactory() { + final StatementConfig defaultStatementConfig = DBFluteConfig + .getInstance().getDefaultStatementConfig(); + final boolean internalDebug = DBFluteConfig.getInstance() + .isInternalDebug(); + InternalStatementFactory factory = new InternalStatementFactory(); + factory.setDefaultStatementConfig(defaultStatementConfig); + factory.setInternalDebug(internalDebug); + return factory; + } + + //========================================================================== + // ========= + // Dispose + // ======= + public void toBeDisposable() { + DisposableUtil.add(this); + disposable = true; + } + + public void dispose() { + _executionMap.clear(); + disposable = false; + } + + public boolean isDisposable() { + return disposable; + } + + public boolean isExecutionCacheEmpty() { + return _executionMap.isEmpty(); + } + + //========================================================================== + // ========= + // Convert Helper + // ============== + protected Object convertPrimitiveWrapper(Class retType, Object ret) { + return SimpleTypeUtil.toWrapper(retType, ret); + } + + protected Object convertNumber(Class retType, Object ret) { + return SimpleTypeUtil.toNumber(retType, ret); + } + + //========================================================================== + // ========= + // Assert Helper + // ============= + protected void assertRetType(Class retType, Object ret) { + if (List.class.isAssignableFrom(retType)) { + if (ret != null && !(ret instanceof List)) { + String msg = "The retType is difference from actual return: "; + msg = msg + "retType=" + retType + " ret.getClass()=" + + ret.getClass() + " ref=" + ret; + throw new IllegalStateException(msg); + } + } else if (Entity.class.isAssignableFrom(retType)) { + if (ret != null && !(ret instanceof Entity)) { + String msg = "The retType is difference from actual return: "; + msg = msg + "retType=" + retType + " ret.getClass()=" + + ret.getClass() + " ref=" + ret; + throw new IllegalStateException(msg); + } + } + } + + //========================================================================== + // ========= + // General Helper + // ============== + protected String getLineSeparator() { + return SimpleSystemUtil.getLineSeparator(); + } + + //========================================================================== + // ========= + // Accessor + // ======== + public void setDataSource(DataSource dataSource) { + _dataSource = dataSource; + } + + public void setBeanMetaDataFactory(BeanMetaDataFactory beanMetaDataFactory) { + _beanMetaDataFactory = beanMetaDataFactory; + } + + public void setValueTypeFactory(ValueTypeFactory valueTypeFactory) { + _valueTypeFactory = valueTypeFactory; + } +} Property changes on: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/bhv/core/BehaviorCommandInvoker.java ___________________________________________________________________ Name: svn:eol-style + native Added: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/bhv/core/BehaviorInitializer.java =================================================================== --- timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/bhv/core/BehaviorInitializer.java (rev 0) +++ timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/bhv/core/BehaviorInitializer.java 2008-12-27 22:20:25 UTC (rev 1631) @@ -0,0 +1,184 @@ +package jp.sf.pal.timecard.db.allcommon.bhv.core; + +import java.util.Collections; +import java.util.Map; +import java.util.concurrent.ConcurrentHashMap; + +import javax.sql.XADataSource; + +import jp.sf.pal.timecard.db.allcommon.DBDef; +import jp.sf.pal.timecard.db.allcommon.DBFluteConfig; +import jp.sf.pal.timecard.db.allcommon.cbean.ConditionBeanContext; +import jp.sf.pal.timecard.db.allcommon.dbmeta.DBMetaInstanceHandler; +import jp.sf.pal.timecard.db.allcommon.s2dao.internal.sqllog.InternalSqlLogRegistry; +import jp.sf.pal.timecard.db.allcommon.util.SimpleSystemUtil; + +import org.seasar.extension.dbcp.impl.XADataSourceImpl; + +/** + * @author DBFlute(AutoGenerator) + */ +public class BehaviorInitializer { + + //========================================================================== + // ========= + // Definition + // ========== + /** Log-instance. */ + private static final org.apache.commons.logging.Log _log = org.apache.commons.logging.LogFactory + .getLog(BehaviorInitializer.class); + + // ----------------------------------------------------- + // For DBMeta + // ---------- + /** + * The map of table DB name and class name for the handler of DB meta + * instance. + */ + protected static final Map _tableDbNameClassNameMap; + static { + final Map tmpMap = newConcurrentHashMap(); + tmpMap.put("DAILY_REPORT", + "jp.sf.pal.timecard.db.bsentity.dbmeta.DailyReportDbm"); + tmpMap.put("EMPLOYEE", + "jp.sf.pal.timecard.db.bsentity.dbmeta.EmployeeDbm"); + tmpMap.put("GROUP_INFO", + "jp.sf.pal.timecard.db.bsentity.dbmeta.GroupInfoDbm"); + tmpMap.put("GROUP_MAPPING", + "jp.sf.pal.timecard.db.bsentity.dbmeta.GroupMappingDbm"); + tmpMap.put("MONTHLY_REPORT", + "jp.sf.pal.timecard.db.bsentity.dbmeta.MonthlyReportDbm"); + tmpMap + .put("MONTHLY_WORKING_REPORT", + "jp.sf.pal.timecard.db.bsentity.dbmeta.MonthlyWorkingReportDbm"); + tmpMap.put("ROLE_INFO", + "jp.sf.pal.timecard.db.bsentity.dbmeta.RoleInfoDbm"); + tmpMap.put("ROLE_MAPPING", + "jp.sf.pal.timecard.db.bsentity.dbmeta.RoleMappingDbm"); + tmpMap.put("USER_INFO", + "jp.sf.pal.timecard.db.bsentity.dbmeta.UserInfoDbm"); + tmpMap.put("WORKING_TYPE", + "jp.sf.pal.timecard.db.bsentity.dbmeta.WorkingTypeDbm"); + _tableDbNameClassNameMap = Collections.unmodifiableMap(tmpMap); + } + + protected static ConcurrentHashMap newConcurrentHashMap() { + return new ConcurrentHashMap(); + } + + //========================================================================== + // ========= + // Constructor + // =========== + /** + * Constructor. And initialize various components related behavior. + * + * @param xaDataSource The data source of XA. (Nullable) + */ + public BehaviorInitializer(XADataSource xaDataSource) { + _log + .info("/* * * * * * * * * * * * * * * * * * * * * * * * * * * * {DBFlute}"); + initializeDBMetaResource(); + handleSqlLogRegistry(); + loadCoolClasses(); + if (xaDataSource != null) { + showInformation(xaDataSource); + setupDBDefByDriverClassName(xaDataSource); + } + DBFluteConfig.getInstance().lock(); + _log.info("* * * * */"); + } + + //========================================================================== + // ========= + // DBMeta + // ====== + protected void initializeDBMetaResource() { + DBMetaInstanceHandler.setupDBMetaResource(_tableDbNameClassNameMap); + } + + //========================================================================== + // ========= + // Cool Classes + // ============ + protected void loadCoolClasses() { // for S2Container basically + ConditionBeanContext.loadCoolClasses(); // Against the ClassLoader + // Headache! + } + + //========================================================================== + // ========= + // Information + // =========== + protected void showInformation(XADataSource xaDataSource) { + if (xaDataSource != null && xaDataSource instanceof XADataSourceImpl) { + final StringBuilder sb = new StringBuilder(); + final XADataSourceImpl xaDataSourceImpl = (XADataSourceImpl) xaDataSource; + final String driverClassName = xaDataSourceImpl + .getDriverClassName(); + final String url = xaDataSourceImpl.getURL(); + final String user = xaDataSourceImpl.getUser(); + sb.append(" [XADataSource]:").append(getLineSeparator()); + sb.append(" driver = " + driverClassName).append( + getLineSeparator()); + sb.append(" url = " + url).append(getLineSeparator()); + sb.append(" user = " + user); + _log.info("{Injection Information}" + getLineSeparator() + sb); + } + } + + //========================================================================== + // ========= + // Database Product Name + // ===================== + protected void setupDBDefByDriverClassName(XADataSource xaDataSource) { + if (xaDataSource != null && xaDataSource instanceof XADataSourceImpl) { + final XADataSourceImpl xaDataSourceImpl = (XADataSourceImpl) xaDataSource; + final String driverClassName = xaDataSourceImpl + .getDriverClassName(); + final DBDef dbdef = DBDef.byDriverClassName(driverClassName); + if (dbdef != null) { + DBDef.setCurrentDef(dbdef); + return; + } + } + } + + //========================================================================== + // ========= + // SQL Log Registry + // ================ + protected void handleSqlLogRegistry() { + if (DBFluteConfig.getInstance().isUseSqlLogRegistry()) { + final StringBuilder sb = new StringBuilder(); + sb.append("{SqlLog Information}").append(getLineSeparator()); + sb.append(" [SqlLogRegistry]").append(getLineSeparator()); + if (InternalSqlLogRegistry.setupSqlLogRegistry()) { + sb + .append( + " ...Setting up SqlLogRegistry(org.seasar.extension.jdbc)!") + .append(getLineSeparator()); + sb + .append(" Because the property 'useSqlLogRegistry' of the config of DBFlute is true."); + } else { + sb + .append(" SqlLogRegistry(org.seasar.extension.jdbc) is not supported at the version!"); + } + _log.info(sb); + } else { + final Object sqlLogRegistry = InternalSqlLogRegistry + .findContainerSqlLogRegistry(); + if (sqlLogRegistry != null) { + InternalSqlLogRegistry.closeRegistration(); + } + } + } + + //========================================================================== + // ========= + // General Helper + // ============== + protected String getLineSeparator() { + return SimpleSystemUtil.getLineSeparator(); + } +} Property changes on: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/bhv/core/BehaviorInitializer.java ___________________________________________________________________ Name: svn:eol-style + native Added: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/bhv/core/SqlExecution.java =================================================================== --- timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/bhv/core/SqlExecution.java (rev 0) +++ timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/bhv/core/SqlExecution.java 2008-12-27 22:20:25 UTC (rev 1631) @@ -0,0 +1,9 @@ +package jp.sf.pal.timecard.db.allcommon.bhv.core; + +/** + * @author DBFlute(AutoGenerator) + */ +public interface SqlExecution { + + public Object execute(Object[] args); +} Property changes on: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/bhv/core/SqlExecution.java ___________________________________________________________________ Name: svn:eol-style + native Added: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/bhv/core/SqlExecutionCreator.java =================================================================== --- timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/bhv/core/SqlExecutionCreator.java (rev 0) +++ timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/bhv/core/SqlExecutionCreator.java 2008-12-27 22:20:25 UTC (rev 1631) @@ -0,0 +1,9 @@ +package jp.sf.pal.timecard.db.allcommon.bhv.core; + +/** + * @author DBFlute(AutoGenerator) + */ +public interface SqlExecutionCreator { + + SqlExecution createSqlExecution(); +} Property changes on: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/bhv/core/SqlExecutionCreator.java ___________________________________________________________________ Name: svn:eol-style + native Added: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/bhv/core/command/AbstractBehaviorCommand.java =================================================================== --- timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/bhv/core/command/AbstractBehaviorCommand.java (rev 0) +++ timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/bhv/core/command/AbstractBehaviorCommand.java 2008-12-27 22:20:25 UTC (rev 1631) @@ -0,0 +1,261 @@ +package jp.sf.pal.timecard.db.allcommon.bhv.core.command; + +import java.sql.ResultSet; +import java.sql.SQLException; +import java.util.ArrayList; +import java.util.List; + +import javax.sql.DataSource; + +import jp.sf.pal.timecard.db.allcommon.DBDef; +import jp.sf.pal.timecard.db.allcommon.bhv.core.BehaviorCommand; +import jp.sf.pal.timecard.db.allcommon.bhv.core.BehaviorCommandComponentSetup; +import jp.sf.pal.timecard.db.allcommon.s2dao.internal.rshandler.InternalBeanListMetaDataResultSetHandler; +import jp.sf.pal.timecard.db.allcommon.s2dao.internal.sqlcommand.InternalUpdateDynamicCommand; +import jp.sf.pal.timecard.db.allcommon.s2dao.internal.various.InternalRelationRowCreator; +import jp.sf.pal.timecard.db.allcommon.s2dao.internal.various.InternalRowCreator; + +import org.seasar.dao.BeanMetaData; +import org.seasar.dao.BeanMetaDataFactory; +import org.seasar.dao.ValueTypeFactory; +import org.seasar.extension.jdbc.ResultSetHandler; +import org.seasar.extension.jdbc.StatementFactory; +import org.seasar.extension.jdbc.ValueType; +import org.seasar.extension.jdbc.types.ValueTypes; + +/** + * @author DBFlute(AutoGenerator) + * @param The type of result. + */ +public abstract class AbstractBehaviorCommand implements + BehaviorCommand, BehaviorCommandComponentSetup { + + //========================================================================== + // ========= + // Attribute + // ========= + // ----------------------------------------------------- + // Basic Information + // ----------------- + /** The table DB name. (Required) */ + protected String _tableDbName; + + /** Is it initialize only? (Choice) */ + protected boolean _initializeOnly; + + // ----------------------------------------------------- + // Injection Component + // ------------------- + protected DataSource _dataSource; + + protected StatementFactory _statementFactory; + + protected BeanMetaDataFactory _beanMetaDataFactory; + + protected ValueTypeFactory _valueTypeFactory; + + protected String _sqlFileEncoding; + + //========================================================================== + // ========= + // Factory + // ======= + // ----------------------------------------------------- + // UpdateDynamicCommnd + // ------------------- + protected InternalUpdateDynamicCommand createUpdateDynamicCommand( + String[] argNames, Class[] argTypes, String sql) { + final InternalUpdateDynamicCommand cmd = new InternalUpdateDynamicCommand( + _dataSource, _statementFactory); + cmd.setArgNames(argNames); + cmd.setArgTypes(argTypes); + if (sql != null) { + cmd.setSql(sql); + } + return cmd; + } + + // ----------------------------------------------------- + // ResultSetHandler + // ---------------- + protected ResultSetHandler createBeanListMetaDataResultSetHandler( + BeanMetaData bmd) { + final InternalRowCreator rowCreator = createInternalRowCreator(bmd); + final InternalRelationRowCreator relationRowCreator = createInternalRelationRowCreator(bmd); + return new InternalBeanListMetaDataResultSetHandler(bmd, rowCreator, + relationRowCreator); + } + + protected ResultSetHandler createObjectResultSetHandler(Class objectType) { + final ValueType valueType = ValueTypes.getValueType(objectType); + return new InternalObjectResultSetHandler(valueType); + } + + protected ResultSetHandler createObjectListResultSetHandler( + Class objectType) { + final ValueType valueType = ValueTypes.getValueType(objectType); + return createObjectListResultSetHandler(valueType); + } + + protected ResultSetHandler createObjectListResultSetHandler( + ValueType valueType) { + return new InternalObjectListResultSetHandler(valueType); + } + + protected static class InternalObjectResultSetHandler implements + ResultSetHandler { + private ValueType valueType; + + public InternalObjectResultSetHandler(ValueType valueType) { + this.valueType = valueType; + } + + public Object handle(ResultSet rs) throws SQLException { + while (rs.next()) { + return valueType.getValue(rs, 1); + } + return null; + } + } + + protected static class InternalObjectListResultSetHandler implements + ResultSetHandler { + private ValueType valueType; + + public InternalObjectListResultSetHandler(ValueType valueType) { + this.valueType = valueType; + } + + public Object handle(ResultSet rs) throws SQLException { + final List ret = new ArrayList(); + while (rs.next()) { + ret.add(valueType.getValue(rs, 1)); + } + return ret; + } + } + + protected static class InternalNullResultSetHandler implements + ResultSetHandler { + public Object handle(ResultSet rs) throws SQLException { + return null; + } + } + + protected InternalRowCreator createInternalRowCreator(BeanMetaData bmd) { + final Class clazz = bmd != null ? bmd.getBeanClass() : null; + return InternalRowCreator.createInternalRowCreator(clazz); + } + + protected InternalRelationRowCreator createInternalRelationRowCreator( + BeanMetaData bmd) { + return new InternalRelationRowCreator(); // Not yet implemented about + // performance tuning! + } + + //========================================================================== + // ========= + // Assist Helper + // ============= + protected String buildDbmsSuffix() { + final String productName = DBDef.getCurrentDef().code(); + return (productName != null ? "_" + productName.toLowerCase() : ""); + } + + //========================================================================== + // ========= + // Assert Helper + // ============= + protected void assertBasicProperty(String methodName) { + if (_tableDbName == null) { + throw new IllegalStateException(buildAssertMessage("_tableDbName", + methodName)); + } + } + + protected void assertComponentProperty(String methodName) { + if (_dataSource == null) { + throw new IllegalStateException(buildAssertMessage("_dataSource", + methodName)); + } + if (_statementFactory == null) { + throw new IllegalStateException(buildAssertMessage( + "_statementFactory", methodName)); + } + if (_beanMetaDataFactory == null) { + throw new IllegalStateException(buildAssertMessage( + "_beanMetaDataFactory", methodName)); + } + if (_valueTypeFactory == null) { + throw new IllegalStateException(buildAssertMessage( + "_valueTypeFactory", methodName)); + } + if (_sqlFileEncoding == null) { + throw new IllegalStateException(buildAssertMessage( + "_sqlFileEncoding", methodName)); + } + } + + protected String buildAssertMessage(String propertyName, String methodName) { + propertyName = propertyName.startsWith("_") ? propertyName + .substring("_".length()) : propertyName; + String msg = "The property '" + propertyName + "' should not be null"; + msg = msg + " when you call " + methodName + "()."; + throw new IllegalStateException(msg); + } + + //========================================================================== + // ========= + // Basic Override + // ============== + @Override + public String toString() { + return getClass().getSimpleName() + ":{" + buildSqlExecutionKey() + "}"; + } + + //========================================================================== + // ========= + // Accessor + // ======== + // ----------------------------------------------------- + // Basic Information + // ----------------- + public String getTableDbName() { + return _tableDbName; + } + + public void setTableDbName(String tableDbName) { + _tableDbName = tableDbName; + } + + public void setInitializeOnly(boolean initializeOnly) { + _initializeOnly = initializeOnly; + } + + public boolean isInitializeOnly() { + return _initializeOnly; + } + + // ----------------------------------------------------- + // Injection Component + // ------------------- + public void setDataSource(DataSource dataSource) { + _dataSource = dataSource; + } + + public void setStatementFactory(StatementFactory statementFactory) { + _statementFactory = statementFactory; + } + + public void setBeanMetaDataFactory(BeanMetaDataFactory beanMetaDataFactory) { + _beanMetaDataFactory = beanMetaDataFactory; + } + + public void setValueTypeFactory(ValueTypeFactory valueTypeFactory) { + _valueTypeFactory = valueTypeFactory; + } + + public void setSqlFileEncoding(String sqlFileEncoding) { + _sqlFileEncoding = sqlFileEncoding; + } +} Property changes on: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/bhv/core/command/AbstractBehaviorCommand.java ___________________________________________________________________ Name: svn:eol-style + native Added: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/bhv/core/command/AbstractEntityCommand.java =================================================================== --- timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/bhv/core/command/AbstractEntityCommand.java (rev 0) +++ timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/bhv/core/command/AbstractEntityCommand.java 2008-12-27 22:20:25 UTC (rev 1631) @@ -0,0 +1,182 @@ +package jp.sf.pal.timecard.db.allcommon.bhv.core.command; + +import java.util.ArrayList; +import java.util.List; + +import jp.sf.pal.timecard.db.allcommon.Entity; +import jp.sf.pal.timecard.db.allcommon.cbean.ConditionBean; +import jp.sf.pal.timecard.db.allcommon.cbean.outsidesql.OutsideSqlOption; +import jp.sf.pal.timecard.db.allcommon.dbmeta.DBMeta; + +import org.seasar.dao.BeanMetaData; +import org.seasar.extension.jdbc.PropertyType; + +/** + * @author DBFlute(AutoGenerator) + */ +public abstract class AbstractEntityCommand extends + AbstractBehaviorCommand { + + //========================================================================== + // ========= + // Attribute + // ========= + /** The type of entity. (Required) */ + protected Class _entityType; + + /** The instance of condition-bean. (Required) */ + protected Entity _entity; + + //========================================================================== + // ========= + // Basic Information + // ================= + public Class getCommandReturnType() { + return Integer.class; + } + + //========================================================================== + // ========= + // Detail Information + // ================== + public boolean isConditionBean() { + return false; + } + + public boolean isOutsideSql() { + return false; + } + + public boolean isProcedure() { + return false; + } + + public boolean isSelect() { + return false; + } + + public boolean isSelectCount() { + return false; + } + + //========================================================================== + // ========= + // Factory + // ======= + // ----------------------------------------------------- + // BeanMetaData + // ------------ + protected BeanMetaData createBeanMetaData() { + return _beanMetaDataFactory.createBeanMetaData(_entityType); + } + + //========================================================================== + // ========= + // Process Callback + // ================ + public void beforeGettingSqlExecution() { + } + + public void afterExecuting() { + } + + //========================================================================== + // ========= + // SqlExecution Handling + // ===================== + public String buildSqlExecutionKey() { + assertStatus("buildSqlExecutionKey"); + return _tableDbName + ":" + getCommandName() + "(" + + _entityType.getSimpleName() + ")"; + } + + public Object[] getSqlExecutionArgument() { + assertStatus("getSqlExecutionArgument"); + return new Object[] { _entity }; + } + + //========================================================================== + // ========= + // Argument Information + // ==================== + public ConditionBean getConditionBean() { + return null; + } + + public String getOutsideSqlPath() { + return null; + } + + public OutsideSqlOption getOutsideSqlOption() { + return null; + } + + //========================================================================== + // ========= + // Assist Helper + // ============= + protected DBMeta findDBMeta() { + // /- - - - - - - - - - - - - - - - - - - - - - - - - - - - + // Cannot use the handler of DBMeta instance + // because the customize-entity is contained to find here. + // - - - - - - - - - -/ + // DBMetaInstanceHandler.findDBMeta(_tableDbName); + + final Class beanType = _entityType; + if (beanType == null) { + return null; + } + if (!Entity.class.isAssignableFrom(beanType)) { + return null; + } + final Entity entity; + try { + entity = (Entity) beanType.newInstance(); + } catch (InstantiationException e) { + throw new IllegalStateException(e); + } catch (IllegalAccessException e) { + throw new IllegalStateException(e); + } + return entity.getDBMeta(); + } + + protected String[] getPersistentPropertyNames(BeanMetaData bmd) { + final List nameList = new ArrayList(); + for (int i = 0; i < bmd.getPropertyTypeSize(); ++i) { + final PropertyType pt = bmd.getPropertyType(i); + if (pt.isPersistent()) { + nameList.add(pt.getPropertyName()); + } + } + return nameList.toArray(new String[nameList.size()]); + } + + //========================================================================== + // ========= + // Assert Helper + // ============= + protected void assertStatus(String methodName) { + assertBasicProperty(methodName); + assertComponentProperty(methodName); + if (_entityType == null) { + throw new IllegalStateException(buildAssertMessage("_entityType", + methodName)); + } + if (_entity == null) { + throw new IllegalStateException(buildAssertMessage("_entity", + methodName)); + } + } + + //========================================================================== + // ========= + // Accessor + // ======== + public void setEntityType(Class entityType) { + _entityType = entityType; + } + + public void setEntity(Entity entity) { + _entity = entity; + } +} Property changes on: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/bhv/core/command/AbstractEntityCommand.java ___________________________________________________________________ Name: svn:eol-style + native Added: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/bhv/core/command/AbstractListEntityCommand.java =================================================================== --- timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/bhv/core/command/AbstractListEntityCommand.java (rev 0) +++ timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/bhv/core/command/AbstractListEntityCommand.java 2008-12-27 22:20:25 UTC (rev 1631) @@ -0,0 +1,182 @@ +package jp.sf.pal.timecard.db.allcommon.bhv.core.command; + +import java.util.ArrayList; +import java.util.List; + +import jp.sf.pal.timecard.db.allcommon.Entity; +import jp.sf.pal.timecard.db.allcommon.cbean.ConditionBean; +import jp.sf.pal.timecard.db.allcommon.cbean.outsidesql.OutsideSqlOption; +import jp.sf.pal.timecard.db.allcommon.dbmeta.DBMeta; + +import org.seasar.dao.BeanMetaData; +import org.seasar.extension.jdbc.PropertyType; + +/** + * @author DBFlute(AutoGenerator) + */ +public abstract class AbstractListEntityCommand extends + AbstractBehaviorCommand { + + //========================================================================== + // ========= + // Attribute + // ========= + /** The type of entity. (Required) */ + protected Class _entityType; + + /** The instance of condition-bean. (Required) */ + protected List _entityList; + + //========================================================================== + // ========= + // Basic Information + // ================= + public Class getCommandReturnType() { + return int[].class; + } + + //========================================================================== + // ========= + // Detail Information + // ================== + public boolean isConditionBean() { + return false; + } + + public boolean isOutsideSql() { + return false; + } + + public boolean isProcedure() { + return false; + } + + public boolean isSelect() { + return false; + } + + public boolean isSelectCount() { + return false; + } + + //========================================================================== + // ========= + // Factory + // ======= + // ----------------------------------------------------- + // BeanMetaData + // ------------ + protected BeanMetaData createBeanMetaData() { + return _beanMetaDataFactory.createBeanMetaData(_entityType); + } + + //========================================================================== + // ========= + // Process Callback + // ================ + public void beforeGettingSqlExecution() { + } + + public void afterExecuting() { + } + + //========================================================================== + // ========= + // SqlExecution Handling + // ===================== + public String buildSqlExecutionKey() { + assertStatus("buildSqlExecutionKey"); + return _tableDbName + ":" + getCommandName() + "(List<" + + _entityType.getSimpleName() + ">)"; + } + + public Object[] getSqlExecutionArgument() { + assertStatus("getSqlExecutionArgument"); + return new Object[] { _entityList }; + } + + //========================================================================== + // ========= + // Argument Information + // ==================== + public ConditionBean getConditionBean() { + return null; + } + + public String getOutsideSqlPath() { + return null; + } + + public OutsideSqlOption getOutsideSqlOption() { + return null; + } + + //========================================================================== + // ========= + // Assist Helper + // ============= + protected DBMeta findDBMeta() { + // /- - - - - - - - - - - - - - - - - - - - - - - - - - - - + // Cannot use the handler of DBMeta instance + // because the customize-entity is contained to find here. + // - - - - - - - - - -/ + // DBMetaInstanceHandler.findDBMeta(_tableDbName); + + final Class beanType = _entityType; + if (beanType == null) { + return null; + } + if (!Entity.class.isAssignableFrom(beanType)) { + return null; + } + final Entity entity; + try { + entity = (Entity) beanType.newInstance(); + } catch (InstantiationException e) { + throw new IllegalStateException(e); + } catch (IllegalAccessException e) { + throw new IllegalStateException(e); + } + return entity.getDBMeta(); + } + + protected String[] getPersistentPropertyNames(BeanMetaData bmd) { + final List nameList = new ArrayList(); + for (int i = 0; i < bmd.getPropertyTypeSize(); ++i) { + final PropertyType pt = bmd.getPropertyType(i); + if (pt.isPersistent()) { + nameList.add(pt.getPropertyName()); + } + } + return nameList.toArray(new String[nameList.size()]); + } + + //========================================================================== + // ========= + // Assert Helper + // ============= + protected void assertStatus(String methodName) { + assertBasicProperty(methodName); + assertComponentProperty(methodName); + if (_entityType == null) { + throw new IllegalStateException(buildAssertMessage("_entityType", + methodName)); + } + if (_entityList == null) { + throw new IllegalStateException(buildAssertMessage("_entityList", + methodName)); + } + } + + //========================================================================== + // ========= + // Accessor + // ======== + public void setEntityType(Class entityType) { + _entityType = entityType; + } + + public void setEntityList(List entityList) { + _entityList = entityList; + } +} Property changes on: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/bhv/core/command/AbstractListEntityCommand.java ___________________________________________________________________ Name: svn:eol-style + native Added: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/bhv/core/command/AbstractOutsideSqlCommand.java =================================================================== --- timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/bhv/core/command/AbstractOutsideSqlCommand.java (rev 0) +++ timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/bhv/core/command/AbstractOutsideSqlCommand.java 2008-12-27 22:20:25 UTC (rev 1631) @@ -0,0 +1,93 @@ +package jp.sf.pal.timecard.db.allcommon.bhv.core.command; + +import jp.sf.pal.timecard.db.allcommon.cbean.ConditionBean; +import jp.sf.pal.timecard.db.allcommon.cbean.outsidesql.OutsideSqlOption; + +/** + * @author DBFlute(AutoGenerator) + * @param The type of result. + */ +public abstract class AbstractOutsideSqlCommand extends + AbstractBehaviorCommand { + + //========================================================================== + // ========= + // Attribute + // ========= + // ----------------------------------------------------- + // Basic Information + // ----------------- + /** The path of outside-SQL. (Required) */ + protected String _outsideSqlPath; + + /** The parameter-bean. (Required to set, but Nullable) */ + protected Object _parameterBean; + + /** The option of outside-SQL. (Required) */ + protected OutsideSqlOption _outsideSqlOption; + + //========================================================================== + // ========= + // Detail Information + // ================== + public boolean isConditionBean() { + return false; // When the command is for outside-SQL, it always be + // false. + } + + public boolean isOutsideSql() { + return true; + } + + public boolean isSelectCount() { + return false; // When the command is for outside-SQL, it always be + // false. + } + + //========================================================================== + // ========= + // Argument Information + // ==================== + public ConditionBean getConditionBean() { + return null; + } + + public String getOutsideSqlPath() { + return _outsideSqlPath; + } + + public OutsideSqlOption getOutsideSqlOption() { + return _outsideSqlOption; + } + + //========================================================================== + // ========= + // Assert Helper + // ============= + protected void assertOutsideSqlBasic(String methodName) { + if (_outsideSqlPath == null) { + throw new IllegalStateException(buildAssertMessage( + "_outsideSqlPath", methodName)); + } + if (_outsideSqlOption == null) { + throw new IllegalStateException(buildAssertMessage( + "_outsideSqlOption", methodName)); + } + } + + //========================================================================== + // ========= + // Accessor + // ======== + public void setOutsideSqlPath(String outsideSqlPath) { + _outsideSqlPath = outsideSqlPath; + } + + public void setParameterBean(Object parameterBean) { + _parameterBean = parameterBean; + } + + public void setOutsideSqlOption(OutsideSqlOption outsideSqlOption) { + _outsideSqlOption = outsideSqlOption; + } +} Property changes on: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/bhv/core/command/AbstractOutsideSqlCommand.java ___________________________________________________________________ Name: svn:eol-style + native Added: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/bhv/core/command/AbstractOutsideSqlSelectCommand.java =================================================================== --- timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/bhv/core/command/AbstractOutsideSqlSelectCommand.java (rev 0) +++ timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/bhv/core/command/AbstractOutsideSqlSelectCommand.java 2008-12-27 22:20:25 UTC (rev 1631) @@ -0,0 +1,175 @@ +package jp.sf.pal.timecard.db.allcommon.bhv.core.command; + +import jp.sf.pal.timecard.db.allcommon.bhv.core.SqlExecution; +import jp.sf.pal.timecard.db.allcommon.bhv.core.SqlExecutionCreator; +import jp.sf.pal.timecard.db.allcommon.bhv.core.execution.OutsideSqlSelectExecution; +import jp.sf.pal.timecard.db.allcommon.cbean.FetchNarrowingBean; +import jp.sf.pal.timecard.db.allcommon.cbean.FetchNarrowingBeanContext; +import jp.sf.pal.timecard.db.allcommon.cbean.outsidesql.OutsideSqlContext; +import jp.sf.pal.timecard.db.allcommon.cbean.outsidesql.OutsideSqlOption; + +import org.seasar.extension.jdbc.ResultSetHandler; + +/** + * The abstract command for OutsideSql.selectSomething(). + * + * @author DBFlute(AutoGenerator) + * @param The type of result. + */ +public abstract class AbstractOutsideSqlSelectCommand extends + AbstractOutsideSqlCommand { + + //========================================================================== + // ========= + // Detail Information + // ================== + public boolean isProcedure() { + return false; + } + + public boolean isSelect() { + return true; + } + + //========================================================================== + // ========= + // Process Callback + // ================ + public void beforeGettingSqlExecution() { + assertStatus("beforeGettingSqlExecution"); + final String path = _outsideSqlPath; + final Object pmb = _parameterBean; + final OutsideSqlOption option = _outsideSqlOption; + final Object resultTypeSpecification = getResultTypeSpecification(); + final boolean autoPagingLogging = (option.isAutoPaging() || option + .isSourcePagingRequestTypeAuto()); + final OutsideSqlContext outsideSqlContext = new OutsideSqlContext(); + outsideSqlContext.setOutsideSqlPath(path); + outsideSqlContext.setParameterBean(pmb); + outsideSqlContext.setResultTypeSpecification(resultTypeSpecification); + outsideSqlContext.setMethodName(getCommandName()); + outsideSqlContext.setStatementConfig(option.getStatementConfig()); + outsideSqlContext.setTableDbName(option.getTableDbName()); + outsideSqlContext.setDynamicBinding(option.isDynamicBinding()); + outsideSqlContext.setOffsetByCursorForcedly(option.isAutoPaging()); + outsideSqlContext.setLimitByCursorForcedly(option.isAutoPaging()); + outsideSqlContext.setAutoPagingLogging(autoPagingLogging); // for + // logging + outsideSqlContext.setupBehaviorQueryPathIfNeeds(); + OutsideSqlContext.setOutsideSqlContextOnThread(outsideSqlContext); + + // Set up fetchNarrowingBean. + setupOutsideSqlFetchNarrowingBean(pmb, option); + } + + protected void setupOutsideSqlFetchNarrowingBean(Object pmb, + OutsideSqlOption option) { + if (pmb == null + || !FetchNarrowingBeanContext.isTheTypeFetchNarrowingBean(pmb + .getClass())) { + return; + } + final FetchNarrowingBean fetchNarrowingBean = (FetchNarrowingBean) pmb; + if (option.isManualPaging()) { + fetchNarrowingBean.ignoreFetchNarrowing(); + } + FetchNarrowingBeanContext + .setFetchNarrowingBeanOnThread(fetchNarrowingBean); + } + + public void afterExecuting() { + } + + //========================================================================== + // ========= + // SqlExecution Handling + // ===================== + public String buildSqlExecutionKey() { + assertStatus("buildSqlExecutionKey"); + return generateSpecifiedOutsideSqlUniqueKey(); + } + + protected String generateSpecifiedOutsideSqlUniqueKey() { + final String methodName = getCommandName(); + final String path = _outsideSqlPath; + final Object pmb = _parameterBean; + final OutsideSqlOption option = _outsideSqlOption; + final Object resultTypeSpecification = getResultTypeSpecification(); + return OutsideSqlContext.generateSpecifiedOutsideSqlUniqueKey( + methodName, path, pmb, option, resultTypeSpecification); + } + + public SqlExecutionCreator createSqlExecutionCreator() { + assertStatus("createSqlExecutionCreator"); + return new SqlExecutionCreator() { + public SqlExecution createSqlExecution() { + final OutsideSqlContext outsideSqlContext = OutsideSqlContext + .getOutsideSqlContextOnThread(); + return createOutsideSqlSelectExecution(outsideSqlContext); + } + }; + } + + protected SqlExecution createOutsideSqlSelectExecution( + OutsideSqlContext outsideSqlContext) { + // - - - - - - - - - - - - - - - - - - - - - - - + // The attribute of Specified-OutsideSqlContext. + // - - - - - - - - - - - - - - - - - - - - - - - + final String suffix = buildDbmsSuffix(); + final String sql = outsideSqlContext.readFilteredOutsideSql( + _sqlFileEncoding, suffix); + final Object pmb = outsideSqlContext.getParameterBean(); + + // - - - - - - - - - - - - - - - + // The attribute of SqlCommand. + // - - - - - - - - - - - - - - - + final String[] argNames = (pmb != null ? new String[] { "pmb" } + : new String[] {}); + final Class[] argTypes = (pmb != null ? new Class[] { pmb + .getClass() } : new Class[] {}); + + // - - - - - - - - - - - - - + // Create ResultSetHandler. + // - - - - - - - - - - - - - + final ResultSetHandler handler = createOutsideSqlSelectResultSetHandler(); + + // - - - - - - - - - - - + // Create SqlExecution. + // - - - - - - - - - - - + return createOutsideSqlSelectExecution(handler, argNames, argTypes, sql); + } + + protected OutsideSqlSelectExecution createOutsideSqlSelectExecution( + ResultSetHandler handler, String[] argNames, Class[] argTypes, + String sql) { + final OutsideSqlSelectExecution cmd = new OutsideSqlSelectExecution( + _dataSource, _statementFactory, handler); + cmd.setArgNames(argNames); + cmd.setArgTypes(argTypes); + cmd.setSql(sql); + return cmd; + } + + public Object[] getSqlExecutionArgument() { + assertStatus("getSqlExecutionArgument"); + return new Object[] { _parameterBean }; + } + + //========================================================================== + // ========= + // Extension Point + // =============== + protected abstract ResultSetHandler createOutsideSqlSelectResultSetHandler(); + + protected abstract Object getResultTypeSpecification(); + + //========================================================================== + // ========= + // Assert Helper + // ============= + protected void assertStatus(String methodName) { + assertBasicProperty(methodName); + assertComponentProperty(methodName); + assertOutsideSqlBasic(methodName); + } +} Property changes on: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/bhv/core/command/AbstractOutsideSqlSelectCommand.java ___________________________________________________________________ Name: svn:eol-style + native Added: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/bhv/core/command/AbstractSelectCBCommand.java =================================================================== --- timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/bhv/core/command/AbstractSelectCBCommand.java (rev 0) +++ timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/bhv/core/command/AbstractSelectCBCommand.java 2008-12-27 22:20:25 UTC (rev 1631) @@ -0,0 +1,122 @@ +package jp.sf.pal.timecard.db.allcommon.bhv.core.command; + +import jp.sf.pal.timecard.db.allcommon.bhv.core.SqlExecution; +import jp.sf.pal.timecard.db.allcommon.bhv.core.execution.SelectCBExecution; +import jp.sf.pal.timecard.db.allcommon.cbean.ConditionBean; +import jp.sf.pal.timecard.db.allcommon.cbean.outsidesql.OutsideSqlOption; + +import org.seasar.extension.jdbc.ResultSetHandler; + +/** + * @author DBFlute(AutoGenerator) + * @param The type of result. + */ +public abstract class AbstractSelectCBCommand extends + AbstractBehaviorCommand { + + //========================================================================== + // ========= + // Attribute + // ========= + /** The type of condition-bean. (Derived from conditionBean) */ + protected Class _conditionBeanType; + + /** The instance of condition-bean. (Required) */ + protected ConditionBean _conditionBean; + + //========================================================================== + // ========= + // Detail Information + // ================== + public boolean isConditionBean() { + return true; + } + + public boolean isOutsideSql() { + return false; + } + + public boolean isProcedure() { + return false; + } + + public boolean isSelect() { + return true; + } + + //========================================================================== + // ========= + // SqlExecution Handling + // ===================== + public String buildSqlExecutionKey() { + assertStatus("buildSqlExecutionKey"); + return _tableDbName + ":" + getCommandName() + "(" + + _conditionBeanType.getSimpleName() + ")"; + } + + protected SqlExecution createSelectCBExecution( + Class cbType, ResultSetHandler handler) { + return createSelectCBExecution(handler, new String[] { "dto" }, + new Class[] { cbType }); + } + + protected SelectCBExecution createSelectCBExecution( + ResultSetHandler handler, String[] argNames, Class[] argTypes) { + final SelectCBExecution cmd = new SelectCBExecution(_dataSource, + _statementFactory, handler); + cmd.setArgNames(argNames); + cmd.setArgTypes(argTypes); + return cmd; + } + + public Object[] getSqlExecutionArgument() { + assertStatus("getSqlExecutionArgument"); + return new Object[] { _conditionBean }; + } + + //========================================================================== + // ========= + // Argument Information + // ==================== + public ConditionBean getConditionBean() { + return _conditionBean; + } + + public String getOutsideSqlPath() { + return null; + } + + public OutsideSqlOption getOutsideSqlOption() { + return null; + } + + //========================================================================== + // ========= + // Assert Helper + // ============= + protected void assertStatus(String methodName) { + assertBasicProperty(methodName); + assertComponentProperty(methodName); + if (_conditionBeanType == null) { + throw new IllegalStateException(buildAssertMessage( + "_conditionBeanType", methodName)); + } + if (_conditionBean == null) { + throw new IllegalStateException(buildAssertMessage( + "_conditionBean", methodName)); + } + } + + //========================================================================== + // ========= + // Accessor + // ======== + public void setConditionBeanType( + Class conditionBeanType) { + _conditionBeanType = conditionBeanType; + } + + public void setConditionBean(ConditionBean conditionBean) { + _conditionBean = conditionBean; + } +} Property changes on: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/bhv/core/command/AbstractSelectCBCommand.java ___________________________________________________________________ Name: svn:eol-style + native Added: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/bhv/core/command/BatchDeleteEntityCommand.java =================================================================== --- timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/bhv/core/command/BatchDeleteEntityCommand.java (rev 0) +++ timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/bhv/core/command/BatchDeleteEntityCommand.java 2008-12-27 22:20:25 UTC (rev 1631) @@ -0,0 +1,51 @@ +package jp.sf.pal.timecard.db.allcommon.bhv.core.command; + +import jp.sf.pal.timecard.db.allcommon.bhv.core.SqlExecution; +import jp.sf.pal.timecard.db.allcommon.bhv.core.SqlExecutionCreator; +import jp.sf.pal.timecard.db.allcommon.s2dao.internal.sqlcommand.InternalDeleteBatchAutoStaticCommand; + +import org.seasar.dao.BeanMetaData; + +/** + * @author DBFlute(AutoGenerator) + */ +public class BatchDeleteEntityCommand extends AbstractListEntityCommand { + + //========================================================================== + // ========= + // Basic Information + // ================= + public String getCommandName() { + return "batchDelete"; + } + + //========================================================================== + // ========= + // SqlExecution Handling + // ===================== + public SqlExecutionCreator createSqlExecutionCreator() { + assertStatus("createSqlExecutionCreator"); + return new SqlExecutionCreator() { + public SqlExecution createSqlExecution() { + final BeanMetaData bmd = createBeanMetaData(); + return createBatchDeleteEntitySqlExecution(bmd); + } + }; + } + + protected SqlExecution createBatchDeleteEntitySqlExecution(BeanMetaData bmd) { + final String[] propertyNames = getPersistentPropertyNames(bmd); + return createDeleteBatchAutoStaticCommand(bmd, propertyNames); + } + + protected InternalDeleteBatchAutoStaticCommand createDeleteBatchAutoStaticCommand( + BeanMetaData bmd, String[] propertyNames) { + boolean opt = isOptimisticLockHandling(); + return new InternalDeleteBatchAutoStaticCommand(_dataSource, + _statementFactory, bmd, propertyNames, opt); + } + + protected boolean isOptimisticLockHandling() { + return true; + } +} Property changes on: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/bhv/core/command/BatchDeleteEntityCommand.java ___________________________________________________________________ Name: svn:eol-style + native Added: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/bhv/core/command/BatchDeleteNonstrictEntityCommand.java =================================================================== --- timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/bhv/core/command/BatchDeleteNonstrictEntityCommand.java (rev 0) +++ timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/bhv/core/command/BatchDeleteNonstrictEntityCommand.java 2008-12-27 22:20:25 UTC (rev 1631) @@ -0,0 +1,25 @@ +package jp.sf.pal.timecard.db.allcommon.bhv.core.command; + +/** + * @author DBFlute(AutoGenerator) + */ +public class BatchDeleteNonstrictEntityCommand extends BatchDeleteEntityCommand { + + //========================================================================== + // ========= + // Basic Information + // ================= + @Override + public String getCommandName() { + return "batchDeleteNonstrict"; + } + + //========================================================================== + // ========= + // SqlExecution Handling + // ===================== + @Override + protected boolean isOptimisticLockHandling() { + return false; + } +} Property changes on: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/bhv/core/command/BatchDeleteNonstrictEntityCommand.java ___________________________________________________________________ Name: svn:eol-style + native Added: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/bhv/core/command/BatchInsertEntityCommand.java =================================================================== --- timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/bhv/core/command/BatchInsertEntityCommand.java (rev 0) +++ timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/bhv/core/command/BatchInsertEntityCommand.java 2008-12-27 22:20:25 UTC (rev 1631) @@ -0,0 +1,46 @@ +package jp.sf.pal.timecard.db.allcommon.bhv.core.command; + +import jp.sf.pal.timecard.db.allcommon.bhv.core.SqlExecution; +import jp.sf.pal.timecard.db.allcommon.bhv.core.SqlExecutionCreator; +import jp.sf.pal.timecard.db.allcommon.s2dao.internal.sqlcommand.InternalInsertBatchAutoStaticCommand; + +import org.seasar.dao.BeanMetaData; + +/** + * @author DBFlute(AutoGenerator) + */ +public class BatchInsertEntityCommand extends AbstractListEntityCommand { + + //========================================================================== + // ========= + // Basic Information + // ================= + public String getCommandName() { + return "batchInsert"; + } + + //========================================================================== + // ========= + // SqlExecution Handling + // ===================== + public SqlExecutionCreator createSqlExecutionCreator() { + assertStatus("createSqlExecutionCreator"); + return new SqlExecutionCreator() { + public SqlExecution createSqlExecution() { + final BeanMetaData bmd = createBeanMetaData(); + return createBatchInsertEntitySqlExecution(bmd); + } + }; + } + + protected SqlExecution createBatchInsertEntitySqlExecution(BeanMetaData bmd) { + final String[] propertyNames = getPersistentPropertyNames(bmd); + return createInsertBatchAutoStaticCommand(bmd, propertyNames); + } + + protected InternalInsertBatchAutoStaticCommand createInsertBatchAutoStaticCommand( + BeanMetaData bmd, String[] propertyNames) { + return new InternalInsertBatchAutoStaticCommand(_dataSource, + _statementFactory, bmd, propertyNames); + } +} Property changes on: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/bhv/core/command/BatchInsertEntityCommand.java ___________________________________________________________________ Name: svn:eol-style + native Added: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/bhv/core/command/BatchUpdateEntityCommand.java =================================================================== --- timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/bhv/core/command/BatchUpdateEntityCommand.java (rev 0) +++ timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/bhv/core/command/BatchUpdateEntityCommand.java 2008-12-27 22:20:25 UTC (rev 1631) @@ -0,0 +1,51 @@ +package jp.sf.pal.timecard.db.allcommon.bhv.core.command; + +import jp.sf.pal.timecard.db.allcommon.bhv.core.SqlExecution; +import jp.sf.pal.timecard.db.allcommon.bhv.core.SqlExecutionCreator; +import jp.sf.pal.timecard.db.allcommon.s2dao.internal.sqlcommand.InternalUpdateBatchAutoStaticCommand; + +import org.seasar.dao.BeanMetaData; + +/** + * @author DBFlute(AutoGenerator) + */ +public class BatchUpdateEntityCommand extends AbstractListEntityCommand { + + //========================================================================== + // ========= + // Basic Information + // ================= + public String getCommandName() { + return "batchUpdate"; + } + + //========================================================================== + // ========= + // SqlExecution Handling + // ===================== + public SqlExecutionCreator createSqlExecutionCreator() { + assertStatus("createSqlExecutionCreator"); + return new SqlExecutionCreator() { + public SqlExecution createSqlExecution() { + final BeanMetaData bmd = createBeanMetaData(); + return createBatchUpdateEntitySqlExecution(bmd); + } + }; + } + + protected SqlExecution createBatchUpdateEntitySqlExecution(BeanMetaData bmd) { + final String[] propertyNames = getPersistentPropertyNames(bmd); + return createUpdateBatchAutoStaticCommand(bmd, propertyNames); + } + + protected InternalUpdateBatchAutoStaticCommand createUpdateBatchAutoStaticCommand( + BeanMetaData bmd, String[] propertyNames) { + boolean opt = isOptimisticLockHandling(); + return new InternalUpdateBatchAutoStaticCommand(_dataSource, + _statementFactory, bmd, propertyNames, opt, opt); + } + + protected boolean isOptimisticLockHandling() { + return true; + } +} Property changes on: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/bhv/core/command/BatchUpdateEntityCommand.java ___________________________________________________________________ Name: svn:eol-style + native Added: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/bhv/core/command/BatchUpdateNonstrictEntityCommand.java =================================================================== --- timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/bhv/core/command/BatchUpdateNonstrictEntityCommand.java (rev 0) +++ timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/bhv/core/command/BatchUpdateNonstrictEntityCommand.java 2008-12-27 22:20:25 UTC (rev 1631) @@ -0,0 +1,25 @@ +package jp.sf.pal.timecard.db.allcommon.bhv.core.command; + +/** + * @author DBFlute(AutoGenerator) + */ +public class BatchUpdateNonstrictEntityCommand extends BatchUpdateEntityCommand { + + //========================================================================== + // ========= + // Basic Information + // ================= + @Override + public String getCommandName() { + return "batchUpdateNonstrict"; + } + + //========================================================================== + // ========= + // SqlExecution Handling + // ===================== + @Override + protected boolean isOptimisticLockHandling() { + return false; + } +} Property changes on: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/bhv/core/command/BatchUpdateNonstrictEntityCommand.java ___________________________________________________________________ Name: svn:eol-style + native Added: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/bhv/core/command/DeleteEntityCommand.java =================================================================== --- timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/bhv/core/command/DeleteEntityCommand.java (rev 0) +++ timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/bhv/core/command/DeleteEntityCommand.java 2008-12-27 22:20:25 UTC (rev 1631) @@ -0,0 +1,51 @@ +package jp.sf.pal.timecard.db.allcommon.bhv.core.command; + +import jp.sf.pal.timecard.db.allcommon.bhv.core.SqlExecution; +import jp.sf.pal.timecard.db.allcommon.bhv.core.SqlExecutionCreator; +import jp.sf.pal.timecard.db.allcommon.s2dao.internal.sqlcommand.InternalDeleteAutoStaticCommand; + +import org.seasar.dao.BeanMetaData; + +/** + * @author DBFlute(AutoGenerator) + */ +public class DeleteEntityCommand extends AbstractEntityCommand { + + //========================================================================== + // ========= + // Basic Information + // ================= + public String getCommandName() { + return "delete"; + } + + //========================================================================== + // ========= + // SqlExecution Handling + // ===================== + public SqlExecutionCreator createSqlExecutionCreator() { + assertStatus("createSqlExecutionCreator"); + return new SqlExecutionCreator() { + public SqlExecution createSqlExecution() { + final BeanMetaData bmd = createBeanMetaData(); + return createDeleteEntitySqlExecution(bmd); + } + }; + } + + protected SqlExecution createDeleteEntitySqlExecution(BeanMetaData bmd) { + final String[] propertyNames = getPersistentPropertyNames(bmd); + return createDeleteAutoStaticCommand(bmd, propertyNames); + } + + protected InternalDeleteAutoStaticCommand createDeleteAutoStaticCommand( + BeanMetaData bmd, String[] propertyNames) { + return new InternalDeleteAutoStaticCommand(_dataSource, + _statementFactory, bmd, propertyNames, + isOptimisticLockHandling()); + } + + protected boolean isOptimisticLockHandling() { + return true; + } +} Property changes on: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/bhv/core/command/DeleteEntityCommand.java ___________________________________________________________________ Name: svn:eol-style + native Added: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/bhv/core/command/DeleteNonstrictEntityCommand.java =================================================================== --- timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/bhv/core/command/DeleteNonstrictEntityCommand.java (rev 0) +++ timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/bhv/core/command/DeleteNonstrictEntityCommand.java 2008-12-27 22:20:25 UTC (rev 1631) @@ -0,0 +1,25 @@ +package jp.sf.pal.timecard.db.allcommon.bhv.core.command; + +/** + * @author DBFlute(AutoGenerator) + */ +public class DeleteNonstrictEntityCommand extends DeleteEntityCommand { + + //========================================================================== + // ========= + // Basic Information + // ================= + @Override + public String getCommandName() { + return "deleteNonstrict"; + } + + //========================================================================== + // ========= + // SqlExecution Handling + // ===================== + @Override + protected boolean isOptimisticLockHandling() { + return false; + } +} Property changes on: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/bhv/core/command/DeleteNonstrictEntityCommand.java ___________________________________________________________________ Name: svn:eol-style + native Added: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/bhv/core/command/InsertEntityCommand.java =================================================================== --- timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/bhv/core/command/InsertEntityCommand.java (rev 0) +++ timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/bhv/core/command/InsertEntityCommand.java 2008-12-27 22:20:25 UTC (rev 1631) @@ -0,0 +1,86 @@ +package jp.sf.pal.timecard.db.allcommon.bhv.core.command; + +import java.util.List; + +import jp.sf.pal.timecard.db.allcommon.bhv.core.SqlExecution; +import jp.sf.pal.timecard.db.allcommon.bhv.core.SqlExecutionCreator; +import jp.sf.pal.timecard.db.allcommon.dbmeta.DBMeta; +import jp.sf.pal.timecard.db.allcommon.dbmeta.info.ColumnInfo; +import jp.sf.pal.timecard.db.allcommon.s2dao.internal.sqlcommand.InternalInsertAutoDynamicCommand; + +import org.seasar.dao.BeanMetaData; + +/** + * @author DBFlute(AutoGenerator) + */ +public class InsertEntityCommand extends AbstractEntityCommand { + + //========================================================================== + // ========= + // Basic Information + // ================= + public String getCommandName() { + return "insert"; + } + + //========================================================================== + // ========= + // SqlExecution Handling + // ===================== + public SqlExecutionCreator createSqlExecutionCreator() { + assertStatus("createSqlExecutionCreator"); + return new SqlExecutionCreator() { + public SqlExecution createSqlExecution() { + final BeanMetaData bmd = createBeanMetaData(); + return createInsertEntitySqlExecution(bmd); + } + }; + } + + protected SqlExecution createInsertEntitySqlExecution(BeanMetaData bmd) { + final SqlExecution nonPrimaryKeySqlExecution = createNonPrimaryInsertSqlExecution(bmd); + if (nonPrimaryKeySqlExecution != null) { + return nonPrimaryKeySqlExecution; + } + final String[] propertyNames = getPersistentPropertyNames(bmd); + return createInsertAutoDynamicCommand(bmd, propertyNames); + } + + protected InternalInsertAutoDynamicCommand createInsertAutoDynamicCommand( + BeanMetaData bmd, String[] propertyNames) { + final InternalInsertAutoDynamicCommand cmd = new InternalInsertAutoDynamicCommand(); + cmd.setBeanMetaData(bmd); + cmd.setDataSource(_dataSource); + cmd.setPropertyNames(propertyNames); + cmd.setStatementFactory(_statementFactory); + return cmd; + } + + /** + * @param bmd The meta data of bean. (NotNull) + * @return Whether the method is target. (For example if it has primary key, + * returns false.) + */ + protected SqlExecution createNonPrimaryInsertSqlExecution(BeanMetaData bmd) { + final DBMeta dbmeta = findDBMeta(); + if (dbmeta.hasPrimaryKey()) { + return null; + } + final List columnInfoList = dbmeta.getColumnInfoList(); + final StringBuilder columnDefSb = new StringBuilder(); + for (jp.sf.pal.timecard.db.allcommon.dbmeta.info.ColumnInfo columnInfo : columnInfoList) { + columnDefSb.append(", ").append(columnInfo.getColumnDbName()); + } + columnDefSb.delete(0, ", ".length()).insert(0, "(").append(")"); + final StringBuilder columnValuesSb = new StringBuilder(); + for (jp.sf.pal.timecard.db.allcommon.dbmeta.info.ColumnInfo columnInfo : columnInfoList) { + columnValuesSb.append(", /*dto.").append( + columnInfo.getPropertyName()).append("*/null"); + } + columnValuesSb.delete(0, ", ".length()).insert(0, "(").append(")"); + final String sql = "insert into " + dbmeta.getTableSqlName() + + columnDefSb + " values" + columnValuesSb; + return createUpdateDynamicCommand(new String[] { "dto" }, + new Class[] { _entityType }, sql); + } +} Property changes on: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/bhv/core/command/InsertEntityCommand.java ___________________________________________________________________ Name: svn:eol-style + native Added: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/bhv/core/command/OutsideSqlCallCommand.java =================================================================== --- timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/bhv/core/command/OutsideSqlCallCommand.java (rev 0) +++ timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/bhv/core/command/OutsideSqlCallCommand.java 2008-12-27 22:20:25 UTC (rev 1631) @@ -0,0 +1,152 @@ +package jp.sf.pal.timecard.db.allcommon.bhv.core.command; + +import jp.sf.pal.timecard.db.allcommon.bhv.core.SqlExecution; +import jp.sf.pal.timecard.db.allcommon.bhv.core.SqlExecutionCreator; +import jp.sf.pal.timecard.db.allcommon.cbean.outsidesql.OutsideSqlContext; +import jp.sf.pal.timecard.db.allcommon.cbean.outsidesql.OutsideSqlOption; +import jp.sf.pal.timecard.db.allcommon.s2dao.internal.sqlcommand.InternalProcedureCommand; +import jp.sf.pal.timecard.db.allcommon.s2dao.internal.various.InternalProcedureMetaData; +import jp.sf.pal.timecard.db.allcommon.s2dao.internal.various.InternalProcedureMetaDataFactory; + +import org.seasar.extension.jdbc.ResultSetHandler; + +/** + * The behavior command for OutsideSql.execute(). + * + * @author DBFlute(AutoGenerator) + */ +public class OutsideSqlCallCommand extends AbstractOutsideSqlCommand { + + //========================================================================== + // ========= + // Basic Information + // ================= + public String getCommandName() { + return "call"; + } + + public Class getCommandReturnType() { + return void.class; + } + + //========================================================================== + // ========= + // Detail Information + // ================== + public boolean isProcedure() { + return true; + } + + public boolean isSelect() { + return false; + } + + //========================================================================== + // ========= + // Process Callback + // ================ + public void beforeGettingSqlExecution() { + assertStatus("beforeGettingSqlExecution"); + final String path = _outsideSqlPath; + final Object pmb = _parameterBean; + final OutsideSqlOption option = _outsideSqlOption; + final OutsideSqlContext outsideSqlContext = new OutsideSqlContext(); + outsideSqlContext.setDynamicBinding(option.isDynamicBinding()); + outsideSqlContext.setOffsetByCursorForcedly(option.isAutoPaging()); + outsideSqlContext.setLimitByCursorForcedly(option.isAutoPaging()); + outsideSqlContext.setOutsideSqlPath(path); + outsideSqlContext.setParameterBean(pmb); + outsideSqlContext.setMethodName(getCommandName()); + outsideSqlContext.setStatementConfig(option.getStatementConfig()); + outsideSqlContext.setTableDbName(option.getTableDbName()); + outsideSqlContext.setupBehaviorQueryPathIfNeeds(); + OutsideSqlContext.setOutsideSqlContextOnThread(outsideSqlContext); + } + + public void afterExecuting() { + } + + //========================================================================== + // ========= + // SqlExecution Handling + // ===================== + public String buildSqlExecutionKey() { + assertStatus("buildSqlExecutionKey"); + return generateSpecifiedOutsideSqlUniqueKey(); + } + + protected String generateSpecifiedOutsideSqlUniqueKey() { + final String methodName = getCommandName(); + final String path = _outsideSqlPath; + final Object pmb = _parameterBean; + final OutsideSqlOption option = _outsideSqlOption; + return OutsideSqlContext.generateSpecifiedOutsideSqlUniqueKey( + methodName, path, pmb, option, null); + } + + public SqlExecutionCreator createSqlExecutionCreator() { + assertStatus("createSqlExecutionCreator"); + return new SqlExecutionCreator() { + public SqlExecution createSqlExecution() { + final OutsideSqlContext outsideSqlContext = OutsideSqlContext + .getOutsideSqlContextOnThread(); + return createOutsideSqlCallCommand(outsideSqlContext); + } + }; + } + + protected SqlExecution createOutsideSqlCallCommand( + OutsideSqlContext outsideSqlContext) { + // - - - - - - - - - - - - - - - - - - - - - - - + // The attribute of Specified-OutsideSqlContext. + // - - - - - - - - - - - - - - - - - - - - - - - + final Object pmb = outsideSqlContext.getParameterBean(); + final String procedureName = outsideSqlContext.getOutsideSqlPath(); + + // - - - - - - - - - - - - - - - + // The attribute of SqlCommand. + // - - - - - - - - - - - - - - - + final InternalProcedureMetaDataFactory factory = createProcedureMetaDataFactory(); + factory.setValueTypeFactory(_valueTypeFactory); + final Class pmbType = (pmb != null ? pmb.getClass() : null); + final InternalProcedureMetaData metaData = factory + .createProcedureMetaData(procedureName, pmbType); + return createProcedureCommand(metaData); + } + + protected InternalProcedureMetaDataFactory createProcedureMetaDataFactory() { + return new InternalProcedureMetaDataFactory(); + } + + protected InternalProcedureCommand createProcedureCommand( + InternalProcedureMetaData metaData) { + // Because a procedure command does not use result set handler. + final ResultSetHandler resultSetHandler = new InternalNullResultSetHandler(); + return new InternalProcedureCommand(_dataSource, resultSetHandler, + _statementFactory, metaData); + } + + // /- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + // - - + // InternalProcedureCommand switches argument so this is unnecessary + // actually! + // - - - - - - - - - -/ + public Object[] getSqlExecutionArgument() { + return new Object[] { _parameterBean }; + } + + //========================================================================== + // ========= + // Assert Helper + // ============= + protected void assertStatus(String methodName) { + assertBasicProperty(methodName); + assertComponentProperty(methodName); + assertOutsideSqlBasic(methodName); + if (_parameterBean == null) { + String msg = "The property 'parameterBean' should not be null"; + msg = msg + " when you call " + methodName + "()."; + throw new IllegalStateException(msg); + } + } +} Property changes on: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/bhv/core/command/OutsideSqlCallCommand.java ___________________________________________________________________ Name: svn:eol-style + native Added: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/bhv/core/command/OutsideSqlExecuteCommand.java =================================================================== --- timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/bhv/core/command/OutsideSqlExecuteCommand.java (rev 0) +++ timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/bhv/core/command/OutsideSqlExecuteCommand.java 2008-12-27 22:20:25 UTC (rev 1631) @@ -0,0 +1,128 @@ +package jp.sf.pal.timecard.db.allcommon.bhv.core.command; + +import jp.sf.pal.timecard.db.allcommon.bhv.core.SqlExecution; +import jp.sf.pal.timecard.db.allcommon.bhv.core.SqlExecutionCreator; +import jp.sf.pal.timecard.db.allcommon.cbean.outsidesql.OutsideSqlContext; +import jp.sf.pal.timecard.db.allcommon.cbean.outsidesql.OutsideSqlOption; + +/** + * The behavior command for OutsideSql.execute(). + * + * @author DBFlute(AutoGenerator) + */ +public class OutsideSqlExecuteCommand extends + AbstractOutsideSqlCommand { + + //========================================================================== + // ========= + // Basic Information + // ================= + public String getCommandName() { + return "execute"; + } + + public Class getCommandReturnType() { + return Integer.class; + } + + //========================================================================== + // ========= + // Detail Information + // ================== + public boolean isProcedure() { + return false; + } + + public boolean isSelect() { + return false; + } + + //========================================================================== + // ========= + // Process Callback + // ================ + public void beforeGettingSqlExecution() { + assertStatus("beforeGettingSqlExecution"); + final String path = _outsideSqlPath; + final Object pmb = _parameterBean; + final OutsideSqlOption option = _outsideSqlOption; + final OutsideSqlContext outsideSqlContext = new OutsideSqlContext(); + outsideSqlContext.setDynamicBinding(option.isDynamicBinding()); + outsideSqlContext.setOffsetByCursorForcedly(option.isAutoPaging()); + outsideSqlContext.setLimitByCursorForcedly(option.isAutoPaging()); + outsideSqlContext.setOutsideSqlPath(path); + outsideSqlContext.setParameterBean(pmb); + outsideSqlContext.setMethodName(getCommandName()); + outsideSqlContext.setStatementConfig(option.getStatementConfig()); + outsideSqlContext.setTableDbName(option.getTableDbName()); + outsideSqlContext.setupBehaviorQueryPathIfNeeds(); + OutsideSqlContext.setOutsideSqlContextOnThread(outsideSqlContext); + } + + public void afterExecuting() { + } + + //========================================================================== + // ========= + // SqlExecution Handling + // ===================== + public String buildSqlExecutionKey() { + assertStatus("buildSqlExecutionKey"); + return generateSpecifiedOutsideSqlUniqueKey(); + } + + protected String generateSpecifiedOutsideSqlUniqueKey() { + final String methodName = getCommandName(); + final String path = _outsideSqlPath; + final Object pmb = _parameterBean; + final OutsideSqlOption option = _outsideSqlOption; + return OutsideSqlContext.generateSpecifiedOutsideSqlUniqueKey( + methodName, path, pmb, option, null); + } + + public SqlExecutionCreator createSqlExecutionCreator() { + assertStatus("createSqlExecutionCreator"); + return new SqlExecutionCreator() { + public SqlExecution createSqlExecution() { + final OutsideSqlContext outsideSqlContext = OutsideSqlContext + .getOutsideSqlContextOnThread(); + return createOutsideSqlExecuteExecution(outsideSqlContext); + } + }; + } + + protected SqlExecution createOutsideSqlExecuteExecution( + OutsideSqlContext outsideSqlContext) { + // - - - - - - - - - - - - - - - - - - - - - - - + // The attribute of Specified-OutsideSqlContext. + // - - - - - - - - - - - - - - - - - - - - - - - + final String suffix = buildDbmsSuffix(); + final String sql = outsideSqlContext.readFilteredOutsideSql( + _sqlFileEncoding, suffix); + final Object pmb = outsideSqlContext.getParameterBean(); + + // - - - - - - - - - - - - - - - + // The attribute of SqlCommand. + // - - - - - - - - - - - - - - - + final String[] argNames = (pmb != null ? new String[] { "pmb" } + : new String[] {}); + final Class[] argTypes = (pmb != null ? new Class[] { pmb + .getClass() } : new Class[] {}); + + return createUpdateDynamicCommand(argNames, argTypes, sql); + } + + public Object[] getSqlExecutionArgument() { + return new Object[] { _parameterBean }; + } + + //========================================================================== + // ========= + // Assert Helper + // ============= + protected void assertStatus(String methodName) { + assertBasicProperty(methodName); + assertComponentProperty(methodName); + assertOutsideSqlBasic(methodName); + } +} Property changes on: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/bhv/core/command/OutsideSqlExecuteCommand.java ___________________________________________________________________ Name: svn:eol-style + native Added: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/bhv/core/command/OutsideSqlSelectCursorCommand.java =================================================================== --- timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/bhv/core/command/OutsideSqlSelectCursorCommand.java (rev 0) +++ timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/bhv/core/command/OutsideSqlSelectCursorCommand.java 2008-12-27 22:20:25 UTC (rev 1631) @@ -0,0 +1,77 @@ +package jp.sf.pal.timecard.db.allcommon.bhv.core.command; + +import java.sql.ResultSet; +import java.sql.SQLException; + +import jp.sf.pal.timecard.db.allcommon.jdbc.CursorHandler; + +import org.seasar.extension.jdbc.ResultSetHandler; + +/** + * The behavior command for OutsideSql.selectList(). + * + * @author DBFlute(AutoGenerator) + */ +public class OutsideSqlSelectCursorCommand extends + AbstractOutsideSqlSelectCommand { + + //========================================================================== + // ========= + // Attribute + // ========= + /** The handler of cursor. (Required) */ + protected CursorHandler _cursorHandler; + + //========================================================================== + // ========= + // Basic Information + // ================= + public String getCommandName() { + return "selectCursor"; + } + + public Class getCommandReturnType() { + return Object.class; + } + + //========================================================================== + // ========= + // Extension Point + // =============== + @Override + protected ResultSetHandler createOutsideSqlSelectResultSetHandler() { + return new ResultSetHandler() { + public Object handle(ResultSet rs) throws SQLException { + return _cursorHandler.handle(rs); + } + }; + } + + @Override + protected Object getResultTypeSpecification() { + return _cursorHandler; + } + + //========================================================================== + // ========= + // Assert Helper + // ============= + @Override + protected void assertStatus(String methodName) { + assertBasicProperty(methodName); + assertComponentProperty(methodName); + assertOutsideSqlBasic(methodName); + if (_cursorHandler == null) { + throw new IllegalStateException(buildAssertMessage( + "_cursorHandler", methodName)); + } + } + + //========================================================================== + // ========= + // Accessor + // ======== + public void setCursorHandler(CursorHandler cursorHandler) { + _cursorHandler = cursorHandler; + } +} Property changes on: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/bhv/core/command/OutsideSqlSelectCursorCommand.java ___________________________________________________________________ Name: svn:eol-style + native Added: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/bhv/core/command/OutsideSqlSelectListCommand.java =================================================================== --- timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/bhv/core/command/OutsideSqlSelectListCommand.java (rev 0) +++ timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/bhv/core/command/OutsideSqlSelectListCommand.java 2008-12-27 22:20:25 UTC (rev 1631) @@ -0,0 +1,96 @@ +package jp.sf.pal.timecard.db.allcommon.bhv.core.command; + +import java.util.List; + +import org.seasar.dao.BeanMetaData; +import org.seasar.extension.jdbc.ResultSetHandler; +import org.seasar.extension.jdbc.ValueType; +import org.seasar.extension.jdbc.types.ValueTypes; + +/** + * The behavior command for OutsideSql.selectList(). + * + * @author DBFlute(AutoGenerator) + * @param The type of entity. + */ +public class OutsideSqlSelectListCommand extends + AbstractOutsideSqlSelectCommand> { + + //========================================================================== + // ========= + // Attribute + // ========= + /** The type of entity. (Required) */ + protected Class _entityType; + + //========================================================================== + // ========= + // Basic Information + // ================= + public String getCommandName() { + return "selectList"; + } + + public Class getCommandReturnType() { + return List.class; + } + + //========================================================================== + // ========= + // Factory + // ======= + // ----------------------------------------------------- + // BeanMetaData + // ------------ + protected BeanMetaData createBeanMetaData() { + assertEntityType("createBeanMetaData"); + return _beanMetaDataFactory.createBeanMetaData(_entityType); + } + + // ----------------------------------------------------- + // ResultSetHandler + // ---------------- + protected ResultSetHandler createOutsideSqlBeanListResultSetHandler( + BeanMetaData bmd) { + final ValueType valueType = ValueTypes.getValueType(_entityType); + if (valueType == null || !valueType.equals(ValueTypes.OBJECT)) { + return createObjectListResultSetHandler(valueType); + } + return createBeanListMetaDataResultSetHandler(bmd); + } + + //========================================================================== + // ========= + // Extension Point + // =============== + @Override + protected ResultSetHandler createOutsideSqlSelectResultSetHandler() { + final BeanMetaData bmd = createBeanMetaData(); + final ResultSetHandler handler = createOutsideSqlBeanListResultSetHandler(bmd); + return handler; + } + + @Override + protected Object getResultTypeSpecification() { + return _entityType; + } + + //========================================================================== + // ========= + // Assert Helper + // ============= + protected void assertEntityType(String methodName) { + if (_entityType == null) { + throw new IllegalStateException(buildAssertMessage("_entityType", + methodName)); + } + } + + //========================================================================== + // ========= + // Accessor + // ======== + public void setEntityType(Class entityType) { + _entityType = entityType; + } +} Property changes on: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/bhv/core/command/OutsideSqlSelectListCommand.java ___________________________________________________________________ Name: svn:eol-style + native Added: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/bhv/core/command/QueryDeleteCBCommand.java =================================================================== --- timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/bhv/core/command/QueryDeleteCBCommand.java (rev 0) +++ timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/bhv/core/command/QueryDeleteCBCommand.java 2008-12-27 22:20:25 UTC (rev 1631) @@ -0,0 +1,151 @@ +package jp.sf.pal.timecard.db.allcommon.bhv.core.command; + +import jp.sf.pal.timecard.db.allcommon.bhv.core.SqlExecution; +import jp.sf.pal.timecard.db.allcommon.bhv.core.SqlExecutionCreator; +import jp.sf.pal.timecard.db.allcommon.cbean.ConditionBean; +import jp.sf.pal.timecard.db.allcommon.cbean.ConditionBeanContext; +import jp.sf.pal.timecard.db.allcommon.cbean.FetchNarrowingBeanContext; +import jp.sf.pal.timecard.db.allcommon.cbean.outsidesql.OutsideSqlOption; +import jp.sf.pal.timecard.db.allcommon.s2dao.internal.sqlcommand.InternalDeleteQueryAutoDynamicCommand; + +/** + * @author DBFlute(AutoGenerator) + */ +public class QueryDeleteCBCommand extends AbstractBehaviorCommand { + + //========================================================================== + // ========= + // Attribute + // ========= + /** The type of condition-bean. (Derived from conditionBean) */ + protected Class _conditionBeanType; + + /** The instance of condition-bean. (Required) */ + protected ConditionBean _conditionBean; + + //========================================================================== + // ========= + // Basic Information + // ================= + public String getCommandName() { + return "queryDelete"; + } + + public Class getCommandReturnType() { + return int.class; + } + + //========================================================================== + // ========= + // Detail Information + // ================== + public boolean isConditionBean() { + return true; + } + + public boolean isOutsideSql() { + return false; + } + + public boolean isProcedure() { + return false; + } + + public boolean isSelect() { + return false; + } + + public boolean isSelectCount() { + return false; + } + + //========================================================================== + // ========= + // Process Callback + // ================ + public void beforeGettingSqlExecution() { + assertStatus("beforeGettingSqlExecution"); + final ConditionBean cb = _conditionBean; + FetchNarrowingBeanContext.setFetchNarrowingBeanOnThread(cb); + ConditionBeanContext.setConditionBeanOnThread(cb); + } + + public void afterExecuting() { + } + + //========================================================================== + // ========= + // SqlExecution Handling + // ===================== + public String buildSqlExecutionKey() { + assertStatus("buildSqlExecutionKey"); + return _tableDbName + ":" + getCommandName() + "(" + + _conditionBeanType.getSimpleName() + ")"; + } + + public SqlExecutionCreator createSqlExecutionCreator() { + assertStatus("createSqlExecutionCreator"); + return new SqlExecutionCreator() { + public SqlExecution createSqlExecution() { + return createQueryDeleteCBExecution(_conditionBeanType); + } + }; + } + + protected SqlExecution createQueryDeleteCBExecution( + Class cbType) { + return new InternalDeleteQueryAutoDynamicCommand(_dataSource, + _statementFactory); + } + + public Object[] getSqlExecutionArgument() { + assertStatus("getSqlExecutionArgument"); + return new Object[] { _conditionBean }; + } + + //========================================================================== + // ========= + // Argument Information + // ==================== + public ConditionBean getConditionBean() { + return _conditionBean; + } + + public String getOutsideSqlPath() { + return null; + } + + public OutsideSqlOption getOutsideSqlOption() { + return null; + } + + //========================================================================== + // ========= + // Assert Helper + // ============= + protected void assertStatus(String methodName) { + assertBasicProperty(methodName); + assertComponentProperty(methodName); + if (_conditionBeanType == null) { + throw new IllegalStateException(buildAssertMessage( + "_conditionBeanType", methodName)); + } + if (_conditionBean == null) { + throw new IllegalStateException(buildAssertMessage( + "_conditionBean", methodName)); + } + } + + //========================================================================== + // ========= + // Accessor + // ======== + public void setConditionBeanType( + Class conditionBeanType) { + _conditionBeanType = conditionBeanType; + } + + public void setConditionBean(ConditionBean conditionBean) { + _conditionBean = conditionBean; + } +} Property changes on: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/bhv/core/command/QueryDeleteCBCommand.java ___________________________________________________________________ Name: svn:eol-style + native Added: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/bhv/core/command/QueryUpdateEntityCBCommand.java =================================================================== --- timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/bhv/core/command/QueryUpdateEntityCBCommand.java (rev 0) +++ timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/bhv/core/command/QueryUpdateEntityCBCommand.java 2008-12-27 22:20:25 UTC (rev 1631) @@ -0,0 +1,140 @@ +package jp.sf.pal.timecard.db.allcommon.bhv.core.command; + +import jp.sf.pal.timecard.db.allcommon.bhv.core.SqlExecution; +import jp.sf.pal.timecard.db.allcommon.bhv.core.SqlExecutionCreator; +import jp.sf.pal.timecard.db.allcommon.cbean.ConditionBean; +import jp.sf.pal.timecard.db.allcommon.cbean.ConditionBeanContext; +import jp.sf.pal.timecard.db.allcommon.cbean.FetchNarrowingBeanContext; +import jp.sf.pal.timecard.db.allcommon.cbean.outsidesql.OutsideSqlOption; +import jp.sf.pal.timecard.db.allcommon.s2dao.internal.sqlcommand.InternalUpdateQueryAutoDynamicCommand; + +/** + * @author DBFlute(AutoGenerator) + */ +public class QueryUpdateEntityCBCommand extends AbstractEntityCommand { + + //========================================================================== + // ========= + // Attribute + // ========= + /** The type of condition-bean. (Derived from conditionBean) */ + protected Class _conditionBeanType; + + /** The instance of condition-bean. (Required) */ + protected ConditionBean _conditionBean; + + //========================================================================== + // ========= + // Basic Information + // ================= + public String getCommandName() { + return "queryUpdate"; + } + + //========================================================================== + // ========= + // Detail Information + // ================== + @Override + public boolean isConditionBean() { + return true; + } + + //========================================================================== + // ========= + // Process Callback + // ================ + @Override + public void beforeGettingSqlExecution() { + assertStatus("beforeGettingSqlExecution"); + final ConditionBean cb = _conditionBean; + FetchNarrowingBeanContext.setFetchNarrowingBeanOnThread(cb); + ConditionBeanContext.setConditionBeanOnThread(cb); + } + + //========================================================================== + // ========= + // SqlExecution Handling + // ===================== + public String buildSqlExecutionKey() { + assertStatus("buildSqlExecutionKey"); + return _tableDbName + ":" + getCommandName() + "(" + + _entityType.getSimpleName() + ", " + + _conditionBeanType.getSimpleName() + ")"; + } + + public SqlExecutionCreator createSqlExecutionCreator() { + assertStatus("createSqlExecutionCreator"); + return new SqlExecutionCreator() { + public SqlExecution createSqlExecution() { + return createQueryUpdateEntityCBExecution(_conditionBeanType); + } + }; + } + + protected SqlExecution createQueryUpdateEntityCBExecution( + Class cbType) { + return new InternalUpdateQueryAutoDynamicCommand(_dataSource, + _statementFactory); + } + + public Object[] getSqlExecutionArgument() { + assertStatus("getSqlExecutionArgument"); + return new Object[] { _conditionBean, _entity }; + } + + //========================================================================== + // ========= + // Argument Information + // ==================== + public ConditionBean getConditionBean() { + return _conditionBean; + } + + public String getOutsideSqlPath() { + return null; + } + + public OutsideSqlOption getOutsideSqlOption() { + return null; + } + + //========================================================================== + // ========= + // Assert Helper + // ============= + @Override + protected void assertStatus(String methodName) { + assertBasicProperty(methodName); + assertComponentProperty(methodName); + if (_entityType == null) { + throw new IllegalStateException(buildAssertMessage("_entityType", + methodName)); + } + if (_entity == null) { + throw new IllegalStateException(buildAssertMessage("_entity", + methodName)); + } + if (_conditionBeanType == null) { + throw new IllegalStateException(buildAssertMessage( + "_conditionBeanType", methodName)); + } + if (_conditionBean == null) { + throw new IllegalStateException(buildAssertMessage( + "_conditionBean", methodName)); + } + } + + //========================================================================== + // ========= + // Accessor + // ======== + public void setConditionBeanType( + Class conditionBeanType) { + _conditionBeanType = conditionBeanType; + } + + public void setConditionBean(ConditionBean conditionBean) { + _conditionBean = conditionBean; + } +} Property changes on: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/bhv/core/command/QueryUpdateEntityCBCommand.java ___________________________________________________________________ Name: svn:eol-style + native Added: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/bhv/core/command/SelectCountCBCommand.java =================================================================== --- timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/bhv/core/command/SelectCountCBCommand.java (rev 0) +++ timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/bhv/core/command/SelectCountCBCommand.java 2008-12-27 22:20:25 UTC (rev 1631) @@ -0,0 +1,65 @@ +package jp.sf.pal.timecard.db.allcommon.bhv.core.command; + +import jp.sf.pal.timecard.db.allcommon.bhv.core.SqlExecution; +import jp.sf.pal.timecard.db.allcommon.bhv.core.SqlExecutionCreator; +import jp.sf.pal.timecard.db.allcommon.cbean.ConditionBean; +import jp.sf.pal.timecard.db.allcommon.cbean.ConditionBeanContext; + +import org.seasar.extension.jdbc.ResultSetHandler; + +/** + * @author DBFlute(AutoGenerator) + */ +public class SelectCountCBCommand extends AbstractSelectCBCommand { + + //========================================================================== + // ========= + // Basic Information + // ================= + public String getCommandName() { + return "selectCount"; + } + + public Class getCommandReturnType() { + return Integer.class; + } + + //========================================================================== + // ========= + // Process Callback + // ================ + public void beforeGettingSqlExecution() { + assertStatus("beforeGettingSqlExecution"); + final ConditionBean cb = _conditionBean; + cb.xsetupSelectCountIgnoreFetchScope(); // *Point! + ConditionBeanContext.setConditionBeanOnThread(cb); + } + + public void afterExecuting() { + assertStatus("afterExecuting"); + final ConditionBean cb = _conditionBean; + cb.xafterCareSelectCountIgnoreFetchScope(); + } + + //========================================================================== + // ========= + // Detail Information + // ================== + public boolean isSelectCount() { + return true; + } + + //========================================================================== + // ========= + // SqlExecution Handling + // ===================== + public SqlExecutionCreator createSqlExecutionCreator() { + assertStatus("createSqlExecutionCreator"); + return new SqlExecutionCreator() { + public SqlExecution createSqlExecution() { + ResultSetHandler handler = createObjectResultSetHandler(getCommandReturnType()); + return createSelectCBExecution(_conditionBeanType, handler); + } + }; + } +} Property changes on: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/bhv/core/command/SelectCountCBCommand.java ___________________________________________________________________ Name: svn:eol-style + native Added: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/bhv/core/command/SelectListCBCommand.java =================================================================== --- timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/bhv/core/command/SelectListCBCommand.java (rev 0) +++ timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/bhv/core/command/SelectListCBCommand.java 2008-12-27 22:20:25 UTC (rev 1631) @@ -0,0 +1,103 @@ +package jp.sf.pal.timecard.db.allcommon.bhv.core.command; + +import java.util.List; + +import jp.sf.pal.timecard.db.allcommon.Entity; +import jp.sf.pal.timecard.db.allcommon.bhv.core.SqlExecution; +import jp.sf.pal.timecard.db.allcommon.bhv.core.SqlExecutionCreator; +import jp.sf.pal.timecard.db.allcommon.cbean.ConditionBean; +import jp.sf.pal.timecard.db.allcommon.cbean.ConditionBeanContext; +import jp.sf.pal.timecard.db.allcommon.cbean.FetchNarrowingBeanContext; + +import org.seasar.dao.BeanMetaData; +import org.seasar.extension.jdbc.ResultSetHandler; + +/** + * @author DBFlute(AutoGenerator) + * @param The type of entity. + */ +public class SelectListCBCommand extends + AbstractSelectCBCommand> { + + //========================================================================== + // ========= + // Attribute + // ========= + /** The type of entity. (Required) */ + protected Class _entityType; + + //========================================================================== + // ========= + // Basic Information + // ================= + public String getCommandName() { + return "selectList"; + } + + public Class getCommandReturnType() { + return List.class; + } + + //========================================================================== + // ========= + // Detail Information + // ================== + public boolean isSelectCount() { + return false; + } + + //========================================================================== + // ========= + // Process Callback + // ================ + public void beforeGettingSqlExecution() { + assertStatus("beforeGettingSqlExecution"); + final ConditionBean cb = _conditionBean; + FetchNarrowingBeanContext.setFetchNarrowingBeanOnThread(cb); + ConditionBeanContext.setConditionBeanOnThread(cb); + } + + public void afterExecuting() { + assertStatus("afterExecuting"); + } + + //========================================================================== + // ========= + // SqlExecution Handling + // ===================== + public SqlExecutionCreator createSqlExecutionCreator() { + assertStatus("createSqlExecutionCreator"); + return new SqlExecutionCreator() { + public SqlExecution createSqlExecution() { + BeanMetaData bmd = createBeanMetaData(); + ResultSetHandler handler = createBeanListMetaDataResultSetHandler(bmd); + return createSelectCBExecution(_conditionBeanType, handler); + } + }; + } + + protected BeanMetaData createBeanMetaData() { + return _beanMetaDataFactory.createBeanMetaData(_entityType); + } + + //========================================================================== + // ========= + // Assert Helper + // ============= + @Override + protected void assertStatus(String methodName) { + super.assertStatus(methodName); + if (_entityType == null) { + throw new IllegalStateException(buildAssertMessage("_entityType", + methodName)); + } + } + + //========================================================================== + // ========= + // Accessor + // ======== + public void setEntityType(Class entityType) { + _entityType = entityType; + } +} Property changes on: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/bhv/core/command/SelectListCBCommand.java ___________________________________________________________________ Name: svn:eol-style + native Added: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/bhv/core/command/SelectNextValCommand.java =================================================================== --- timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/bhv/core/command/SelectNextValCommand.java (rev 0) +++ timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/bhv/core/command/SelectNextValCommand.java 2008-12-27 22:20:25 UTC (rev 1631) @@ -0,0 +1,162 @@ +package jp.sf.pal.timecard.db.allcommon.bhv.core.command; + +import jp.sf.pal.timecard.db.allcommon.bhv.core.SqlExecution; +import jp.sf.pal.timecard.db.allcommon.bhv.core.SqlExecutionCreator; +import jp.sf.pal.timecard.db.allcommon.bhv.core.execution.BasicSelectExecution; +import jp.sf.pal.timecard.db.allcommon.cbean.ConditionBean; +import jp.sf.pal.timecard.db.allcommon.cbean.outsidesql.OutsideSqlOption; +import jp.sf.pal.timecard.db.allcommon.dbmeta.DBMeta; +import jp.sf.pal.timecard.db.allcommon.dbmeta.DBMetaInstanceHandler; + +import org.seasar.extension.jdbc.ResultSetHandler; + +/** + * @author DBFlute(AutoGenerator) + * @param The type of result. + */ +public class SelectNextValCommand extends + AbstractBehaviorCommand { + + //========================================================================== + // ========= + // Attribute + // ========= + /** The type of result. (NotNull) */ + protected Class _resultType; + + //========================================================================== + // ========= + // Basic Information + // ================= + public String getCommandName() { + return "selectNextVal"; + } + + public Class getCommandReturnType() { + return _resultType; + } + + //========================================================================== + // ========= + // Detail Information + // ================== + public boolean isConditionBean() { + return false; + } + + public boolean isOutsideSql() { + return false; + } + + public boolean isProcedure() { + return false; + } + + public boolean isSelect() { + return true; + } + + public boolean isSelectCount() { + return false; + } + + //========================================================================== + // ========= + // Process Callback + // ================ + public void beforeGettingSqlExecution() { + } + + public void afterExecuting() { + } + + //========================================================================== + // ========= + // SqlExecution Handling + // ===================== + public String buildSqlExecutionKey() { + assertStatus("buildSqlExecutionKey"); + return _tableDbName + ":" + getCommandName() + "()"; + } + + public SqlExecutionCreator createSqlExecutionCreator() { + assertStatus("createSqlExecutionCreator"); + return new SqlExecutionCreator() { + public SqlExecution createSqlExecution() { + ResultSetHandler handler = createObjectResultSetHandler(_resultType); + return createSelectNextValExecution(handler); + } + }; + } + + protected SqlExecution createSelectNextValExecution(ResultSetHandler handler) { + final DBMeta dbmeta = findDBMeta(); + if (!dbmeta.hasSequence()) { + String msg = "If the method 'selectNextVal()' exists, DBMeta.hasSequence() should return true:"; + msg = msg + " dbmeta.hasSequence()=" + dbmeta.hasSequence(); + throw new IllegalStateException(msg); + } + final String nextValSql = dbmeta.getSequenceNextValSql(); + if (nextValSql == null) { + String msg = "If the method 'selectNextVal()' exists, DBMeta.getSequenceNextValSql() should not return null:"; + msg = msg + " dbmeta.getSequenceNextValSql()=" + + dbmeta.getSequenceNextValSql(); + throw new IllegalStateException(msg); + } + return createBasicSelectExecution(handler, new String[] {}, + new Class[] {}, nextValSql); + } + + protected BasicSelectExecution createBasicSelectExecution( + ResultSetHandler handler, String[] argNames, Class[] argTypes, + String sql) { + final BasicSelectExecution cmd = new BasicSelectExecution(_dataSource, + _statementFactory, handler); + cmd.setArgNames(argNames); + cmd.setArgTypes(argTypes); + cmd.setSql(sql); + return cmd; + } + + protected DBMeta findDBMeta() { + return DBMetaInstanceHandler.findDBMeta(_tableDbName); + } + + public Object[] getSqlExecutionArgument() { + assertStatus("getSqlExecutionArgument"); + return new Object[] {}; + } + + //========================================================================== + // ========= + // Argument Information + // ==================== + public ConditionBean getConditionBean() { + return null; + } + + public String getOutsideSqlPath() { + return null; + } + + public OutsideSqlOption getOutsideSqlOption() { + return null; + } + + //========================================================================== + // ========= + // Assert Helper + // ============= + protected void assertStatus(String methodName) { + assertBasicProperty(methodName); + assertComponentProperty(methodName); + } + + //========================================================================== + // ========= + // Accessor + // ======== + public void setResultType(Class resultType) { + _resultType = resultType; + } +} Property changes on: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/bhv/core/command/SelectNextValCommand.java ___________________________________________________________________ Name: svn:eol-style + native Added: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/bhv/core/command/SelectScalarCBCommand.java =================================================================== --- timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/bhv/core/command/SelectScalarCBCommand.java (rev 0) +++ timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/bhv/core/command/SelectScalarCBCommand.java 2008-12-27 22:20:25 UTC (rev 1631) @@ -0,0 +1,112 @@ +package jp.sf.pal.timecard.db.allcommon.bhv.core.command; + +import jp.sf.pal.timecard.db.allcommon.bhv.core.SqlExecution; +import jp.sf.pal.timecard.db.allcommon.bhv.core.SqlExecutionCreator; +import jp.sf.pal.timecard.db.allcommon.cbean.ConditionBean; +import jp.sf.pal.timecard.db.allcommon.cbean.ConditionBeanContext; +import jp.sf.pal.timecard.db.allcommon.cbean.sqlclause.SqlClause; + +import org.seasar.extension.jdbc.ResultSetHandler; + +/** + * @author DBFlute(AutoGenerator) + * @param The type of result. + */ +public class SelectScalarCBCommand extends + AbstractSelectCBCommand { + + //========================================================================== + // ========= + // Attribute + // ========= + /** The type of result. (NotNull) */ + protected Class _resultType; + + /** The type of select clause. (NotNull) */ + protected SqlClause.SelectClauseType _selectClauseType; + + //========================================================================== + // ========= + // Basic Information + // ================= + public String getCommandName() { + assertStatus("getCommandName"); + final String resultTypeName = _resultType.getSimpleName(); + final String scalarMethodName = _selectClauseType.toString() + .toLowerCase(); + return "scalarSelect(" + resultTypeName + ")." + scalarMethodName; + } + + public Class getCommandReturnType() { + assertStatus("getCommandReturnType"); + return _resultType; + } + + //========================================================================== + // ========= + // Detail Information + // ================== + public boolean isSelectCount() { + return false; + } + + //========================================================================== + // ========= + // Process Callback + // ================ + public void beforeGettingSqlExecution() { + assertStatus("beforeGettingSqlExecution"); + final ConditionBean cb = _conditionBean; + ConditionBeanContext.setConditionBeanOnThread(cb); + cb.getSqlClause().classifySelectClauseType(_selectClauseType); //*Point! + } + + public void afterExecuting() { + assertStatus("afterExecuting"); + final ConditionBean cb = _conditionBean; + cb.getSqlClause().rollbackSelectClauseType(); + } + + //========================================================================== + // ========= + // SqlExecution Handling + // ===================== + public SqlExecutionCreator createSqlExecutionCreator() { + assertStatus("createSqlExecutionCreator"); + return new SqlExecutionCreator() { + public SqlExecution createSqlExecution() { + ResultSetHandler handler = createObjectResultSetHandler(getCommandReturnType()); + return createSelectCBExecution(_conditionBeanType, handler); + } + }; + } + + //========================================================================== + // ========= + // Assert Helper + // ============= + @Override + protected void assertStatus(String methodName) { + super.assertStatus(methodName); + if (_resultType == null) { + throw new IllegalStateException(buildAssertMessage("_resultType", + methodName)); + } + if (_selectClauseType == null) { + throw new IllegalStateException(buildAssertMessage( + "_selectClauseType", methodName)); + } + } + + //========================================================================== + // ========= + // Accessor + // ======== + public void setResultType(Class resultType) { + _resultType = resultType; + } + + public void setSelectClauseType(SqlClause.SelectClauseType selectClauseType) { + _selectClauseType = selectClauseType; + } +} Property changes on: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/bhv/core/command/SelectScalarCBCommand.java ___________________________________________________________________ Name: svn:eol-style + native Added: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/bhv/core/command/UpdateEntityCommand.java =================================================================== --- timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/bhv/core/command/UpdateEntityCommand.java (rev 0) +++ timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/bhv/core/command/UpdateEntityCommand.java 2008-12-27 22:20:25 UTC (rev 1631) @@ -0,0 +1,55 @@ +package jp.sf.pal.timecard.db.allcommon.bhv.core.command; + +import jp.sf.pal.timecard.db.allcommon.bhv.core.SqlExecution; +import jp.sf.pal.timecard.db.allcommon.bhv.core.SqlExecutionCreator; +import jp.sf.pal.timecard.db.allcommon.s2dao.internal.sqlcommand.InternalUpdateModifiedOnlyCommand; + +import org.seasar.dao.BeanMetaData; + +/** + * @author DBFlute(AutoGenerator) + */ +public class UpdateEntityCommand extends AbstractEntityCommand { + + //========================================================================== + // ========= + // Basic Information + // ================= + public String getCommandName() { + return "update"; + } + + //========================================================================== + // ========= + // SqlExecution Handling + // ===================== + public SqlExecutionCreator createSqlExecutionCreator() { + assertStatus("createSqlExecutionCreator"); + return new SqlExecutionCreator() { + public SqlExecution createSqlExecution() { + final BeanMetaData bmd = createBeanMetaData(); + return createUpdateEntitySqlExecution(bmd); + } + }; + } + + protected SqlExecution createUpdateEntitySqlExecution(BeanMetaData bmd) { + final String[] propertyNames = getPersistentPropertyNames(bmd); + return createUpdateModifiedOnlyCommand(bmd, propertyNames); + } + + protected InternalUpdateModifiedOnlyCommand createUpdateModifiedOnlyCommand( + BeanMetaData bmd, String[] propertyNames) { + final InternalUpdateModifiedOnlyCommand cmd = new InternalUpdateModifiedOnlyCommand( + _dataSource, _statementFactory); + cmd.setBeanMetaData(bmd);// Extension Point! + cmd.setPropertyNames(propertyNames); + cmd.setOptimisticLockHandling(isOptimisticLockHandling()); + cmd.setVersionNoAutoIncrementOnMemory(isOptimisticLockHandling()); + return cmd; + } + + protected boolean isOptimisticLockHandling() { + return true; + } +} Property changes on: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/bhv/core/command/UpdateEntityCommand.java ___________________________________________________________________ Name: svn:eol-style + native Added: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/bhv/core/command/UpdateNonstrictEntityCommand.java =================================================================== --- timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/bhv/core/command/UpdateNonstrictEntityCommand.java (rev 0) +++ timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/bhv/core/command/UpdateNonstrictEntityCommand.java 2008-12-27 22:20:25 UTC (rev 1631) @@ -0,0 +1,25 @@ +package jp.sf.pal.timecard.db.allcommon.bhv.core.command; + +/** + * @author DBFlute(AutoGenerator) + */ +public class UpdateNonstrictEntityCommand extends UpdateEntityCommand { + + //========================================================================== + // ========= + // Basic Information + // ================= + @Override + public String getCommandName() { + return "updateNonstrict"; + } + + //========================================================================== + // ========= + // SqlExecution Handling + // ===================== + @Override + protected boolean isOptimisticLockHandling() { + return false; + } +} Property changes on: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/bhv/core/command/UpdateNonstrictEntityCommand.java ___________________________________________________________________ Name: svn:eol-style + native Added: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/bhv/core/execution/BasicSelectExecution.java =================================================================== --- timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/bhv/core/execution/BasicSelectExecution.java (rev 0) +++ timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/bhv/core/execution/BasicSelectExecution.java 2008-12-27 22:20:25 UTC (rev 1631) @@ -0,0 +1,77 @@ +package jp.sf.pal.timecard.db.allcommon.bhv.core.execution; + +import javax.sql.DataSource; + +import jp.sf.pal.timecard.db.allcommon.s2dao.internal.sqlcommand.InternalAbstractDynamicCommand; +import jp.sf.pal.timecard.db.allcommon.s2dao.internal.sqlhandler.InternalBasicSelectHandler; + +import org.seasar.dao.CommandContext; +import org.seasar.extension.jdbc.ResultSetHandler; +import org.seasar.extension.jdbc.StatementFactory; + +/** + * @author DBFlute(AutoGenerator) + */ +public class BasicSelectExecution extends InternalAbstractDynamicCommand { + + //========================================================================== + // ========= + // Attribute + // ========= + /** The handler of resultSet. */ + protected ResultSetHandler resultSetHandler; + + //========================================================================== + // ========= + // Constructor + // =========== + /** + * Constructor. + * + * @param dataSource Data source. + * @param statementFactory The factory of statement. + * @param resultSetHandler The handler of resultSet. + */ + public BasicSelectExecution(DataSource dataSource, + StatementFactory statementFactory, ResultSetHandler resultSetHandler) { + super(dataSource, statementFactory); + this.resultSetHandler = resultSetHandler; + } + + //========================================================================== + // ========= + // Execute + // ======= + /** + * @param args The array of argument. (Nullable) + * @return The object of execution result. (Nullable) + */ + public Object execute(Object[] args) { + final CommandContext ctx = apply(args); + final InternalBasicSelectHandler selectHandler = createBasicSelectHandler( + ctx.getSql(), this.resultSetHandler); + final Object[] bindVariableArray = ctx.getBindVariables(); + selectHandler.setLoggingMessageSqlArgs(bindVariableArray); + return selectHandler.execute(bindVariableArray, ctx + .getBindVariableTypes()); + } + + //========================================================================== + // ========= + // Select Handler + // ============== + protected InternalBasicSelectHandler createBasicSelectHandler( + String realSql, ResultSetHandler rsh) { + return new InternalBasicSelectHandler(getDataSource(), realSql, rsh, + getStatementFactory()); + } + + //========================================================================== + // ========= + // Parser Option + // ============= + @Override + protected boolean isBlockNullParameter() { + return true; // Because the SQL is select. + } +} Property changes on: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/bhv/core/execution/BasicSelectExecution.java ___________________________________________________________________ Name: svn:eol-style + native Added: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/bhv/core/execution/OutsideSqlSelectExecution.java =================================================================== --- timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/bhv/core/execution/OutsideSqlSelectExecution.java (rev 0) +++ timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/bhv/core/execution/OutsideSqlSelectExecution.java 2008-12-27 22:20:25 UTC (rev 1631) @@ -0,0 +1,225 @@ +package jp.sf.pal.timecard.db.allcommon.bhv.core.execution; + +import java.util.ArrayList; +import java.util.List; + +import javax.sql.DataSource; + +import jp.sf.pal.timecard.db.allcommon.cbean.outsidesql.OutsideSqlContext; +import jp.sf.pal.timecard.db.allcommon.s2dao.internal.sqlcommand.InternalAbstractDynamicCommand; +import jp.sf.pal.timecard.db.allcommon.s2dao.internal.sqlhandler.InternalBasicSelectHandler; +import jp.sf.pal.timecard.db.allcommon.util.SimpleStringUtil; +import jp.sf.pal.timecard.db.allcommon.util.SimpleSystemUtil; + +import org.seasar.dao.CommandContext; +import org.seasar.extension.jdbc.ResultSetHandler; +import org.seasar.extension.jdbc.StatementFactory; +import org.seasar.framework.beans.BeanDesc; +import org.seasar.framework.beans.PropertyDesc; +import org.seasar.framework.beans.factory.BeanDescFactory; + +/** + * @author DBFlute(AutoGenerator) + */ +public class OutsideSqlSelectExecution extends InternalAbstractDynamicCommand { + + //========================================================================== + // ========= + // Attribute + // ========= + /** The handler of resultSet. */ + protected ResultSetHandler resultSetHandler; + + //========================================================================== + // ========= + // Constructor + // =========== + /** + * Constructor. + * + * @param dataSource Data source. + * @param statementFactory The factory of statement. + * @param resultSetHandler The handler of resultSet. + */ + public OutsideSqlSelectExecution(DataSource dataSource, + StatementFactory statementFactory, ResultSetHandler resultSetHandler) { + super(dataSource, statementFactory); + this.resultSetHandler = resultSetHandler; + } + + //========================================================================== + // ========= + // Execute + // ======= + /** + * @param args The array of argument. (NotNull, The first element should be + * the instance of Pmb) + * @return The object of execution result. (Nullable) + */ + public Object execute(Object[] args) { + final OutsideSqlContext outsideSqlContext = OutsideSqlContext + .getOutsideSqlContextOnThread(); + if (outsideSqlContext.isDynamicBinding()) { + return executeOutsideSqlAsDynamic(args, outsideSqlContext); + } else { + return executeOutsideSqlAsStatic(args, outsideSqlContext); + } + } + + // ----------------------------------------------------- + // OutsideSql Execute + // ------------------ + /** + * Execute outside-SQL as Dynamic. + * + * @param args The array of argument. (NotNull, The first element should be + * the instance of Pmb) + * @param outsideSqlContext The context of outside-SQL. (NotNull) + * @return Result. (Nullable) + */ + protected Object executeOutsideSqlAsDynamic(Object[] args, + OutsideSqlContext outsideSqlContext) { + final Object firstArg = args[0]; + String staticSql = getSql(); + if (firstArg != null) { + final BeanDesc beanDesc = BeanDescFactory.getBeanDesc(firstArg + .getClass()); + + // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + // - - - - - - - + // Resolve embedded comment for parsing bind variable comment in + // embedded comment. + // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + // - - - - - - - + for (int i = 0; i < beanDesc.getPropertyDescSize(); i++) { + final PropertyDesc propertyDesc = beanDesc.getPropertyDesc(i); + final Class propertyType = propertyDesc.getPropertyType(); + if (!propertyType.equals(String.class)) { + continue; + } + final String outsideSqlPiece = (String) propertyDesc + .getValue(firstArg); + if (outsideSqlPiece == null) { + continue; + } + final String embeddedComment = "/*$pmb." + + propertyDesc.getPropertyName() + "*/"; + staticSql = replaceString(staticSql, embeddedComment, + outsideSqlPiece); + } + } + + final OutsideSqlSelectExecution outsideSqlCommand = createDynamicSqlFactory(); + outsideSqlCommand.setArgNames(getArgNames()); + outsideSqlCommand.setArgTypes(getArgTypes()); + outsideSqlCommand.setSql(staticSql); + + final CommandContext ctx = outsideSqlCommand.apply(args); + final List bindVariableList = new ArrayList(); + final List> bindVariableTypeList = new ArrayList>(); + addBindVariableInfo(ctx, bindVariableList, bindVariableTypeList); + final InternalBasicSelectHandler selectHandler = createBasicSelectHandler( + ctx.getSql(), this.resultSetHandler); + final Object[] bindVariableArray = bindVariableList.toArray(); + selectHandler.setLoggingMessageSqlArgs(bindVariableArray); + return selectHandler.execute(bindVariableArray, + toClassArray(bindVariableTypeList)); + } + + /** + * Execute outside-SQL as static. + * + * @param args The array of argument. (NotNull, The first element should be + * the instance of Pmb) + * @param outsideSqlContext The context of outside-SQL. (NotNull) + * @return Result. (Nullable) + */ + protected Object executeOutsideSqlAsStatic(Object[] args, + OutsideSqlContext outsideSqlContext) { + final CommandContext ctx = apply(args); + final InternalBasicSelectHandler selectHandler = createBasicSelectHandler( + ctx.getSql(), this.resultSetHandler); + final Object[] bindVariableArray = ctx.getBindVariables(); + selectHandler.setLoggingMessageSqlArgs(bindVariableArray); + return selectHandler.execute(bindVariableArray, ctx + .getBindVariableTypes()); + } + + //========================================================================== + // ========= + // Dynamic SQL Factory + // =================== + protected OutsideSqlSelectExecution createDynamicSqlFactory() { + return new OutsideSqlSelectExecution(getDataSource(), + getStatementFactory(), resultSetHandler); + } + + //========================================================================== + // ========= + // Select Handler + // ============== + protected InternalBasicSelectHandler createBasicSelectHandler( + String realSql, ResultSetHandler rsh) { + return new InternalBasicSelectHandler(getDataSource(), realSql, rsh, + getStatementFactory()); + } + + //========================================================================== + // ========= + // Parser Option + // ============= + @Override + protected boolean isBlockNullParameter() { + return true; // Because the SQL is select. + } + + //========================================================================== + // ========= + // Setup Helper + // ============ + protected Class[] toClassArray(List> 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 bindVariableList, List> bindVariableTypeList) { + final Object[] bindVariables = ctx.getBindVariables(); + addBindVariableList(bindVariableList, bindVariables); + final Class[] bindVariableTypes = ctx.getBindVariableTypes(); + addBindVariableTypeList(bindVariableTypeList, bindVariableTypes); + } + + protected void addBindVariableList(List bindVariableList, + Object[] bindVariables) { + for (int i = 0; i < bindVariables.length; i++) { + bindVariableList.add(bindVariables[i]); + } + } + + protected void addBindVariableTypeList(List> bindVariableTypeList, + Class[] bindVariableTypes) { + for (int i = 0; i < bindVariableTypes.length; i++) { + bindVariableTypeList.add(bindVariableTypes[i]); + } + } + + //========================================================================== + // ========= + // General Helper + // ============== + protected final String replaceString(String text, String fromText, + String toText) { + return SimpleStringUtil.replace(text, fromText, toText); + } + + protected String getLineSeparator() { + return SimpleSystemUtil.getLineSeparator(); + } +} Property changes on: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/bhv/core/execution/OutsideSqlSelectExecution.java ___________________________________________________________________ Name: svn:eol-style + native Added: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/bhv/core/execution/SelectCBExecution.java =================================================================== --- timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/bhv/core/execution/SelectCBExecution.java (rev 0) +++ timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/bhv/core/execution/SelectCBExecution.java 2008-12-27 22:20:25 UTC (rev 1631) @@ -0,0 +1,168 @@ +package jp.sf.pal.timecard.db.allcommon.bhv.core.execution; + +import java.util.ArrayList; +import java.util.List; + +import javax.sql.DataSource; + +import jp.sf.pal.timecard.db.allcommon.cbean.ConditionBean; +import jp.sf.pal.timecard.db.allcommon.cbean.ConditionBeanContext; +import jp.sf.pal.timecard.db.allcommon.s2dao.internal.sqlcommand.InternalAbstractDynamicCommand; +import jp.sf.pal.timecard.db.allcommon.s2dao.internal.sqlhandler.InternalBasicSelectHandler; +import jp.sf.pal.timecard.db.allcommon.util.SimpleStringUtil; +import jp.sf.pal.timecard.db.allcommon.util.SimpleSystemUtil; + +import org.seasar.dao.CommandContext; +import org.seasar.extension.jdbc.ResultSetHandler; +import org.seasar.extension.jdbc.StatementFactory; + +/** + * @author DBFlute(AutoGenerator) + */ +public class SelectCBExecution extends InternalAbstractDynamicCommand { + + //========================================================================== + // ========= + // Attribute + // ========= + /** The handler of resultSet. */ + protected ResultSetHandler resultSetHandler; + + //========================================================================== + // ========= + // Constructor + // =========== + /** + * Constructor. + * + * @param dataSource Data source. + * @param statementFactory The factory of statement. + * @param resultSetHandler The handler of resultSet. + */ + public SelectCBExecution(DataSource dataSource, + StatementFactory statementFactory, ResultSetHandler resultSetHandler) { + super(dataSource, statementFactory); + this.resultSetHandler = resultSetHandler; + } + + //========================================================================== + // ========= + // Execute + // ======= + /** + * @param args The array of argument. (NotNull, The first element should be + * the instance of CB) + * @return The object of execution result. (Nullable) + */ + public Object execute(Object[] args) { + final List bindVariableList = new ArrayList(); + final List> bindVariableTypeList = new ArrayList>(); + + final String finalClause = setupRealClause(args, bindVariableList, + bindVariableTypeList); + final InternalBasicSelectHandler selectHandler = createBasicSelectHandler( + finalClause, this.resultSetHandler); + final Object[] bindVariableArray = bindVariableList.toArray(); + selectHandler.setLoggingMessageSqlArgs(bindVariableArray); + return selectHandler.execute(bindVariableArray, + toClassArray(bindVariableTypeList)); + } + + // ----------------------------------------------------- + // Setup Clause + // ------------ + protected String setupRealClause(Object[] args, + List bindVariableList, List> bindVariableTypeList) { + final ConditionBean cb = ConditionBeanContext + .getConditionBeanOnThread(); + final String realClause; + { + final SelectCBExecution dynamicSqlFactory = createDynamicSqlFactory(); + dynamicSqlFactory.setArgNames(getArgNames()); + dynamicSqlFactory.setArgTypes(getArgTypes()); + dynamicSqlFactory.setSql(cb.getSqlClause().getClause()); + final CommandContext ctx = dynamicSqlFactory.apply(args); + realClause = ctx.getSql(); + addBindVariableInfo(ctx, bindVariableList, bindVariableTypeList); + } + return realClause; + } + + //========================================================================== + // ========= + // Dynamic SQL Factory + // =================== + protected SelectCBExecution createDynamicSqlFactory() { + return new SelectCBExecution(getDataSource(), getStatementFactory(), + resultSetHandler); + } + + //========================================================================== + // ========= + // Select Handler + // ============== + protected InternalBasicSelectHandler createBasicSelectHandler( + String realSql, ResultSetHandler rsh) { + return new InternalBasicSelectHandler(getDataSource(), realSql, rsh, + getStatementFactory()); + } + + //========================================================================== + // ========= + // Parser Option + // ============= + @Override + protected boolean isBlockNullParameter() { + return true; // Because the SQL is select. + } + + //========================================================================== + // ========= + // Setup Helper + // ============ + protected Class[] toClassArray(List> 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 bindVariableList, List> bindVariableTypeList) { + final Object[] bindVariables = ctx.getBindVariables(); + addBindVariableList(bindVariableList, bindVariables); + final Class[] bindVariableTypes = ctx.getBindVariableTypes(); + addBindVariableTypeList(bindVariableTypeList, bindVariableTypes); + } + + protected void addBindVariableList(List bindVariableList, + Object[] bindVariables) { + for (int i = 0; i < bindVariables.length; i++) { + bindVariableList.add(bindVariables[i]); + } + } + + protected void addBindVariableTypeList(List> bindVariableTypeList, + Class[] bindVariableTypes) { + for (int i = 0; i < bindVariableTypes.length; i++) { + bindVariableTypeList.add(bindVariableTypes[i]); + } + } + + //========================================================================== + // ========= + // General Helper + // ============== + protected final String replaceString(String text, String fromText, + String toText) { + return SimpleStringUtil.replace(text, fromText, toText); + } + + protected String getLineSeparator() { + return SimpleSystemUtil.getLineSeparator(); + } +} Property changes on: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/bhv/core/execution/SelectCBExecution.java ___________________________________________________________________ Name: svn:eol-style + native Modified: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/cbean/AbstractConditionBean.java =================================================================== --- timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/cbean/AbstractConditionBean.java 2008-12-27 22:18:30 UTC (rev 1630) +++ timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/cbean/AbstractConditionBean.java 2008-12-27 22:20:25 UTC (rev 1631) @@ -24,6 +24,28 @@ public abstract class AbstractConditionBean implements ConditionBean { //========================================================================== + // =========== + // Definition + // ========== + /** Map-string map-mark. */ + private static final String MAP_STRING_MAP_MARK = "map:"; + + /** Map-string list-mark. */ + private static final String MAP_STRING_LIST_MARK = "list:"; + + /** Map-string start-brace. */ + private static final String MAP_STRING_START_BRACE = "@{"; + + /** Map-string end-brace. */ + private static final String MAP_STRING_END_BRACE = "@}"; + + /** Map-string delimiter. */ + private static final String MAP_STRING_DELIMITER = "@;"; + + /** Map-string equal. */ + private static final String MAP_STRING_EQUAL = "@="; + + //========================================================================== // ========= // Attribute // ========= @@ -41,8 +63,12 @@ // [DBFlute-0.7.4] @jflute -- At the future, I'll implement some check // logics by these purpose types. - protected boolean _forDeriveReferrer; + protected boolean _forDerivedReferrer; + protected boolean _forScalarSelect; + + protected boolean _forScalarSubQuery; + protected boolean _forUnion; protected boolean _forExistsSubQuery; @@ -73,27 +99,6 @@ //========================================================================== // ========= - // ConditionQuery - // ============== - /** - * Get condition query as interface. At the future, change public to - * protected. - * - * @return Instance of query as interface. (NotNull) - */ - abstract public ConditionQuery getConditionQueryAsInterface(); - - /** - * The implementation. - * - * @return The conditionQuery of the local table as interface. (NotNull) - */ - public ConditionQuery localCQ() { - return getConditionQueryAsInterface(); - } - - //========================================================================== - // ========= // Accept PrimaryKey // ================= /** @@ -498,42 +503,6 @@ //========================================================================== // ========= - // Limit Select - // ============ - /** Is limit-select PK only? */ - protected boolean _isLimitSelectPKOnly; - - /** - * Is limit-select PK only? - * - * @return Determination. - */ - public boolean isLimitSelect_PKOnly() { - return _isLimitSelectPKOnly; - } - - /** - * Limit select PK only. - * - * @return this. (NotNull) - */ - public ConditionBean limitSelect_PKOnly() { - _isLimitSelectPKOnly = true; - return this; - } - - /** - * Limit select off. - * - * @return this. (NotNull) - */ - public ConditionBean limitSelect_Off() { - _isLimitSelectPKOnly = false; - return this; - } - - //========================================================================== - // ========= // Lock Setting // ============ /** @@ -559,11 +528,8 @@ public ConditionBean xsetupSelectCountIgnoreFetchScope() { _isSelectCountIgnoreFetchScope = true; - // If the query uses union query, it needs included-select-column. - if (!hasUnionQueryOrUnionAllQuery()) { - getSqlClause().ignoreIncludedSelectColumn(); - } - + getSqlClause().classifySelectClauseType( + SqlClause.SelectClauseType.COUNT); getSqlClause().ignoreOrderBy(); getSqlClause().ignoreFetchScope(); return this; @@ -578,11 +544,7 @@ public ConditionBean xafterCareSelectCountIgnoreFetchScope() { _isSelectCountIgnoreFetchScope = false; - // If the query uses union query, it needs included-select-column. - if (!hasUnionQueryOrUnionAllQuery()) { - getSqlClause().makeIncludedSelectColumnEffective(); - } - + getSqlClause().rollbackSelectClauseType(); getSqlClause().makeOrderByEffective(); getSqlClause().makeFetchScopeEffective(); return this; @@ -613,20 +575,29 @@ protected CQ _query; - protected boolean _forDeriveReferrer; + protected boolean _forDerivedReferrer; - protected boolean alreadySpecifyRequiredColumn; + protected boolean _forScalarSelect; + protected boolean _forScalarSubQuery; + + protected boolean _alreadySpecifyRequiredColumn; + /** * @param baseCB The condition-bean of base level. (NotNull) - * @param qyCall The callback for condition-query. (NotNull) - * @param forDeriveReferrer Is this for derive referrer? + * @param qyCall The call-back for condition-query. (NotNull) + * @param forDerivedReferrer Is this for derive referrer? + * @param forScalarSelect Is this for scalar select? + * @param forScalarSubQuery Is this for scalar sub-query? */ protected AbstractSpecification(ConditionBean baseCB, - SpQyCall qyCall, boolean forDeriveReferrer) { + SpQyCall qyCall, boolean forDerivedReferrer, + boolean forScalarSelect, boolean forScalarSubQuery) { _baseCB = baseCB; _qyCall = qyCall; - _forDeriveReferrer = forDeriveReferrer; + _forDerivedReferrer = forDerivedReferrer; + _forScalarSelect = forScalarSelect; + _forScalarSubQuery = forScalarSubQuery; } protected void doColumn(String columnName) { @@ -634,8 +605,8 @@ if (_query == null) { _query = _qyCall.qy(); } - if (!_forDeriveReferrer && !alreadySpecifyRequiredColumn) { - alreadySpecifyRequiredColumn = true; + if (isRequiredColumnSpecificationEnabled()) { + _alreadySpecifyRequiredColumn = true; doSpecifyRequiredColumn(); } String relationPath = _query.getRelationPath() != null ? _query @@ -652,6 +623,11 @@ columnName); } + protected boolean isRequiredColumnSpecificationEnabled() { + return !_forDerivedReferrer && !_forScalarSelect + && !_forScalarSubQuery && !_alreadySpecifyRequiredColumn; + } + protected void assertColumn(String columnName) { if (_query == null && !_qyCall.has()) { throwSpecifyColumnNotSetupSelectColumnException(columnName); @@ -659,9 +635,15 @@ } protected void assertForeign(String foreignPropertyName) { - if (_forDeriveReferrer) { - throwDeriveReferrerInvalidForeignSpecificationException(foreignPropertyName); + if (_forDerivedReferrer) { + throwDerivedReferrerInvalidForeignSpecificationException(foreignPropertyName); } + if (_forScalarSelect) { + throwScalarSelectInvalidForeignSpecificationException(foreignPropertyName); + } + if (_forScalarSubQuery) { + throwScalarSubQueryInvalidForeignSpecificationException(foreignPropertyName); + } } protected abstract void doSpecifyRequiredColumn(); @@ -714,19 +696,19 @@ throw new SpecifyColumnNotSetupSelectColumnException(msg); } - protected void throwDeriveReferrerInvalidForeignSpecificationException( + protected void throwDerivedReferrerInvalidForeignSpecificationException( String foreignPropertyName) { String msg = "Look! Read the message below." + getLineSeparator(); msg = msg + "/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *" + getLineSeparator(); msg = msg - + "You specified a foreign table column in spite of derive-sub-query!" + + "You specified a foreign table column in spite of derived-referrer!" + getLineSeparator(); msg = msg + getLineSeparator(); msg = msg + "[Advice]" + getLineSeparator(); msg = msg - + "You should specified a local table column at condition-bean for derive-sub-query." + + "You should specified a local table column at condition-bean for derived-referrer." + getLineSeparator(); msg = msg + " For example:" + getLineSeparator(); msg = msg + " " + getLineSeparator(); @@ -736,7 +718,7 @@ msg = msg + " MemberCB cb = new MemberCB();" + getLineSeparator(); msg = msg - + " cb.specify().derivePurchaseList().max(new SubQuery() {" + + " cb.specify().derivedPurchaseList().max(new SubQuery() {" + getLineSeparator(); msg = msg + " public void query(PurchaseCB subCB) {" + getLineSeparator(); @@ -754,7 +736,7 @@ msg = msg + " MemberCB cb = new MemberCB();" + getLineSeparator(); msg = msg - + " cb.specify().derivePurchaseList().max(new SubQuery() {" + + " cb.specify().derivedPurchaseList().max(new SubQuery() {" + getLineSeparator(); msg = msg + " public void query(PurchaseCB subCB) {" + getLineSeparator(); @@ -769,9 +751,117 @@ msg = msg + "[Specified Foreign Property]" + getLineSeparator() + foreignPropertyName + getLineSeparator(); msg = msg + "* * * * * * * * * */"; - throw new DeriveReferrerInvalidForeignSpecificationException(msg); + throw new DerivedReferrerInvalidForeignSpecificationException(msg); } + protected void throwScalarSelectInvalidForeignSpecificationException( + String foreignPropertyName) { + String msg = "Look! Read the message below." + getLineSeparator(); + msg = msg + + "/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *" + + getLineSeparator(); + msg = msg + + "You specified a foreign table column in spite of scalar select!" + + getLineSeparator(); + msg = msg + getLineSeparator(); + msg = msg + "[Advice]" + getLineSeparator(); + msg = msg + + "You should specified a local table column at condition-bean for scalar select." + + getLineSeparator(); + msg = msg + " For example:" + getLineSeparator(); + msg = msg + " " + getLineSeparator(); + msg = msg + " [Wrong]" + getLineSeparator(); + msg = msg + " /- - - - - - - - - - - - - - - - - - - - " + + getLineSeparator(); + msg = msg + + " memberBhv.scalarSelect(Integer.class).max(new ScalarSelect() {" + + getLineSeparator(); + msg = msg + " public void query(MemberCB cb) {" + + getLineSeparator(); + msg = msg + + " cb.specify().specifyMemberStatus().columnDisplayOrder(); // *No!" + + getLineSeparator(); + msg = msg + " }" + getLineSeparator(); + msg = msg + " });" + getLineSeparator(); + msg = msg + " - - - - - - - - - -/" + getLineSeparator(); + msg = msg + " " + getLineSeparator(); + msg = msg + " [Good!]" + getLineSeparator(); + msg = msg + " /- - - - - - - - - - - - - - - - - - - - " + + getLineSeparator(); + msg = msg + + " memberBhv.scalarSelect(Date.class).max(new ScalarSelect() {" + + getLineSeparator(); + msg = msg + " public void query(MemberCB cb) {" + + getLineSeparator(); + msg = msg + + " cb.specify().columnMemberBirthday(); // *Point!" + + getLineSeparator(); + msg = msg + " }" + getLineSeparator(); + msg = msg + " });" + getLineSeparator(); + msg = msg + " - - - - - - - - - -/" + getLineSeparator(); + msg = msg + getLineSeparator(); + msg = msg + "[Specified Foreign Property]" + getLineSeparator() + + foreignPropertyName + getLineSeparator(); + msg = msg + "* * * * * * * * * */"; + throw new ScalarSelectInvalidForeignSpecificationException(msg); + } + + protected void throwScalarSubQueryInvalidForeignSpecificationException( + String foreignPropertyName) { + String msg = "Look! Read the message below." + getLineSeparator(); + msg = msg + + "/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *" + + getLineSeparator(); + msg = msg + + "You specified a foreign table column in spite of derived-query!" + + getLineSeparator(); + msg = msg + getLineSeparator(); + msg = msg + "[Advice]" + getLineSeparator(); + msg = msg + + "You should specified a local table column at condition-bean for derived-query." + + getLineSeparator(); + msg = msg + " For example:" + getLineSeparator(); + msg = msg + " " + getLineSeparator(); + msg = msg + " [Wrong]" + getLineSeparator(); + msg = msg + " /- - - - - - - - - - - - - - - - - - - - " + + getLineSeparator(); + msg = msg + " MemberCB cb = new MemberCB();" + + getLineSeparator(); + msg = msg + + " cb.query().scalar_Equal().max(new SubQuery() {" + + getLineSeparator(); + msg = msg + " public void query(MemberCB subCB) {" + + getLineSeparator(); + msg = msg + + " subCB.specify().specifyMemberStatusName().columnDisplayOrder(); // *No!" + + getLineSeparator(); + msg = msg + " }" + getLineSeparator(); + msg = msg + " });" + getLineSeparator(); + msg = msg + " - - - - - - - - - -/" + getLineSeparator(); + msg = msg + " " + getLineSeparator(); + msg = msg + " [Good!]" + getLineSeparator(); + msg = msg + " /- - - - - - - - - - - - - - - - - - - - " + + getLineSeparator(); + msg = msg + " MemberCB cb = new MemberCB();" + + getLineSeparator(); + msg = msg + + " cb.query().scalar_Equal().max(new SubQuery() {" + + getLineSeparator(); + msg = msg + " public void query(MemberCB subCB) {" + + getLineSeparator(); + msg = msg + + " subCB.specify().columnMemberBirthday();// *Point!" + + getLineSeparator(); + msg = msg + " }" + getLineSeparator(); + msg = msg + " });" + getLineSeparator(); + msg = msg + " - - - - - - - - - -/" + getLineSeparator(); + msg = msg + getLineSeparator(); + msg = msg + "[Specified Foreign Property]" + getLineSeparator() + + foreignPropertyName + getLineSeparator(); + msg = msg + "* * * * * * * * * */"; + throw new ScalarSubQueryInvalidForeignSpecificationException(msg); + } + protected String getLineSeparator() { return SimpleSystemUtil.getLineSeparator(); } @@ -792,15 +882,33 @@ } } - public static class DeriveReferrerInvalidForeignSpecificationException + public static class DerivedReferrerInvalidForeignSpecificationException extends RuntimeException { private static final long serialVersionUID = 1L; - public DeriveReferrerInvalidForeignSpecificationException(String msg) { + public DerivedReferrerInvalidForeignSpecificationException(String msg) { super(msg); } } + public static class ScalarSubQueryInvalidForeignSpecificationException + extends RuntimeException { + private static final long serialVersionUID = 1L; + + public ScalarSubQueryInvalidForeignSpecificationException(String msg) { + super(msg); + } + } + + public static class ScalarSelectInvalidForeignSpecificationException extends + RuntimeException { + private static final long serialVersionUID = 1L; + + public ScalarSelectInvalidForeignSpecificationException(String msg) { + super(msg); + } + } + public static class RAFunction { protected ConditionBean _baseCB; @@ -815,6 +923,18 @@ _querySetupper = querySetupper; } + public void count(SubQuery subQuery, String aliasName) { + assertAliasName(aliasName); + _querySetupper.setup("count", subQuery, _localCQ, aliasName.trim()); + } + + public void countDistinct(SubQuery subQuery, + String aliasName) { + assertAliasName(aliasName); + _querySetupper.setup("count(distinct", subQuery, _localCQ, + aliasName.trim()); + } + public void max(SubQuery subQuery, String aliasName) { assertAliasName(aliasName); _querySetupper.setup("max", subQuery, _localCQ, aliasName.trim()); @@ -835,14 +955,9 @@ _querySetupper.setup("avg", subQuery, _localCQ, aliasName.trim()); } - public void count(SubQuery subQuery, String aliasName) { - assertAliasName(aliasName); - _querySetupper.setup("count", subQuery, _localCQ, aliasName.trim()); - } - protected void assertAliasName(String aliasName) { if (aliasName == null || aliasName.trim().length() == 0) { - throwDeriveReferrerInvalidAliasNameException(); + throwDerivedReferrerInvalidAliasNameException(); } DBMeta dbmeta = DBMetaInstanceHandler.findDBMeta(_baseCB .getTableDbName()); @@ -860,17 +975,17 @@ } } if (!existsSetterMethod) { - throwDeriveReferrerEntityPropertyNotFoundException(aliasName, + throwDerivedReferrerEntityPropertyNotFoundException(aliasName, dbmeta.getEntityType()); } } - protected void throwDeriveReferrerInvalidAliasNameException() { + protected void throwDerivedReferrerInvalidAliasNameException() { String msg = "Look! Read the message below." + getLineSeparator(); msg = msg + "/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *" + getLineSeparator(); - msg = msg + "The alias name for derive-referrer was Invalid!" + msg = msg + "The alias name for derived-referrer was Invalid!" + getLineSeparator(); msg = msg + getLineSeparator(); msg = msg + "[Advice]" + getLineSeparator(); @@ -915,17 +1030,17 @@ msg = msg + "[Local Table]" + getLineSeparator() + _localCQ.getTableDbName() + getLineSeparator(); msg = msg + "* * * * * * * * * */"; - throw new DeriveReferrerInvalidAliasNameException(msg); + throw new DerivedReferrerInvalidAliasNameException(msg); } - protected void throwDeriveReferrerEntityPropertyNotFoundException( + protected void throwDerivedReferrerEntityPropertyNotFoundException( String aliasName, Class entityType) { String msg = "Look! Read the message below." + getLineSeparator(); msg = msg + "/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *" + getLineSeparator(); msg = msg - + "A property for derive-referrer was Not Found in the entity!" + + "A property for derived-referrer was Not Found in the entity!" + getLineSeparator(); msg = msg + getLineSeparator(); msg = msg + "[Advice]" + getLineSeparator(); @@ -981,7 +1096,7 @@ msg = msg + "[Target Entity]" + getLineSeparator() + entityType + getLineSeparator(); msg = msg + "* * * * * * * * * */"; - throw new DeriveReferrerEntityPropertyNotFoundException(msg); + throw new DerivedReferrerEntityPropertyNotFoundException(msg); } protected String replaceString(String text, String fromText, @@ -999,20 +1114,20 @@ LOCAL_CQ cq, String aliasName); } - public static class DeriveReferrerInvalidAliasNameException extends + public static class DerivedReferrerInvalidAliasNameException extends RuntimeException { private static final long serialVersionUID = 1L; - public DeriveReferrerInvalidAliasNameException(String msg) { + public DerivedReferrerInvalidAliasNameException(String msg) { super(msg); } } - public static class DeriveReferrerEntityPropertyNotFoundException extends + public static class DerivedReferrerEntityPropertyNotFoundException extends RuntimeException { private static final long serialVersionUID = 1L; - public DeriveReferrerEntityPropertyNotFoundException(String msg) { + public DerivedReferrerEntityPropertyNotFoundException(String msg) { super(msg); } } @@ -1042,7 +1157,6 @@ protected void doSetupSelect(SsCall callback) { String foreignPropertyName = callback.qf().getForeignPropertyName(); assertSetupSelectBeforeUnion(foreignPropertyName); - limitSelect_Off(); String foreignTableAliasName = callback.qf().getRealAliasName(); String localRelationPath = localCQ().getRelationPath(); getSqlClause().registerSelectedSelectColumn(foreignTableAliasName, @@ -1164,19 +1278,27 @@ // ========= // Purpose Type // ============ - public void xsetupForDeriveReferrer() { - _forDeriveReferrer = true; + public void xsetupForDerivedReferrer() { // Very Internal + _forDerivedReferrer = true; } - public void xsetupForUnion() { + public void xsetupForScalarSelect() { // Very Internal + _forScalarSelect = true; + } + + public void xsetupForScalarSubQuery() { // Very Internal + _forScalarSubQuery = true; + } + + public void xsetupForUnion() { // Very Internal _forUnion = true; } - public void xsetupForExistsSubQuery() { + public void xsetupForExistsSubQuery() { // Very Internal _forExistsSubQuery = true; } - public void xsetupForInScopeSubQuery() { + public void xsetupForInScopeSubQuery() { // Very Internal _forInScopeSubQuery = true; } Modified: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/cbean/AbstractConditionQuery.java =================================================================== --- timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/cbean/AbstractConditionQuery.java 2008-12-27 22:18:30 UTC (rev 1630) +++ timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/cbean/AbstractConditionQuery.java 2008-12-27 22:20:25 UTC (rev 1631) @@ -48,12 +48,14 @@ protected static final ConditionKey CK_PS = ConditionKey.CK_PREFIX_SEARCH; - protected static final ConditionKey CK_LS = ConditionKey.CK_LIKE_SEARCH; - protected static final ConditionKey CK_INS = ConditionKey.CK_IN_SCOPE; protected static final ConditionKey CK_NINS = ConditionKey.CK_NOT_IN_SCOPE; + protected static final ConditionKey CK_LS = ConditionKey.CK_LIKE_SEARCH; + + protected static final ConditionKey CK_NLS = ConditionKey.CK_NOT_LIKE_SEARCH; + protected static final ConditionKey CK_ISN = ConditionKey.CK_IS_NULL; protected static final ConditionKey CK_ISNN = ConditionKey.CK_IS_NOT_NULL; @@ -351,15 +353,7 @@ String msg = "The argument[unionQuery] should not be null."; throw new IllegalArgumentException(msg); } - reflectRelationOnUnionQuery(this, unionQuery);// Reflect Relation! - getSqlClause().copyIncludedSelectColumn(unionQuery.getSqlClause());// Reflect - // IncludedSelectColumn - // ! - if (getSqlClause().isFormatClauseEffective()) { - unionQuery.getSqlClause().makeFormatClauseEffective();// Reflect - // FormatClause - // ! - } + reflectRelationOnUnionQuery(this, unionQuery); // Reflect Relation! String key = (unionAll ? "unionAllQuery" : "unionQuery") + unionQueryMap.size(); unionQueryMap.put(key, unionQuery); @@ -416,22 +410,6 @@ // Register // ======== // ----------------------------------------------------- - // Include-As-Mine - // --------------- - /** - * Register included-select-column. - * - * @param aliasName Alias name. This should not contain comma. (NotNull) - * @param realColumnName Real column name. This should not contain comma. - * (NotNull) - * @deprecated Unsupported! - */ - protected void registerIncludedSelectColumn(String aliasName, - String realColumnName) { - throw new UnsupportedOperationException(); - } - - // ----------------------------------------------------- // Query // ----- protected void registerQuery(ConditionKey key, Object value, @@ -488,6 +466,13 @@ // ----------------------------------------------------- // LikeSearch Query // ---------------- + protected void regLSQ(ConditionKey key, String value, + ConditionValue cvalue, String colName, String capPropName, + String uncapPropName, LikeSearchOption option) { + registerLikeSearchQuery(key, value, cvalue, colName, capPropName, + uncapPropName, option); + } + @SuppressWarnings("deprecation") protected void registerLikeSearchQuery(ConditionKey key, String value, ConditionValue cvalue, String colName, String capPropName, @@ -700,25 +685,20 @@ assertObjectNotNull("InScopeSubQyery(" + columnName + ")", subQuery); inScopeOption = inScopeOption != null ? inScopeOption + " " : ""; String realColumnName = getInScopeSubQueryRealColumnName(columnName); + xincrementLocalSubQueryLevelIfNeeds(subQuery); String subQueryClause = getInScopeSubQuerySql(subQuery, relatedColumnName, propertyName); - String clause = null; - if (getSqlClause().isFormatClauseEffective()) { - String ln = getLineSeparator(); - int subQueryLevel = subQuery.getSubQueryLevel(); - String subQueryIdentity = propertyName + "[" + subQueryLevel + "]"; - String beginMark = getSqlClause().resolveSubQueryBeginMark( - subQueryIdentity) - + ln; - String endMark = getSqlClause().resolveSubQueryEndMark( - subQueryIdentity); - String endIndent = " "; - clause = realColumnName + " " + inScopeOption + "in (" + beginMark - + subQueryClause + ln + endIndent + ")" + endMark; - } else { - clause = realColumnName + " " + inScopeOption + "in (" - + subQueryClause + ")"; - } + String ln = getLineSeparator(); + int subQueryLevel = subQuery.getSubQueryLevel(); + String subQueryIdentity = propertyName + "[" + subQueryLevel + "]"; + String beginMark = getSqlClause().resolveSubQueryBeginMark( + subQueryIdentity) + + ln; + String endMark = getSqlClause() + .resolveSubQueryEndMark(subQueryIdentity); + String endIndent = " "; + String clause = realColumnName + " " + inScopeOption + "in (" + + beginMark + subQueryClause + ln + endIndent + ")" + endMark; registerWhereClause(clause); } @@ -728,22 +708,11 @@ protected String getInScopeSubQuerySql(ConditionQuery subQuery, String relatedColumnName, String propertyName) { - String selectClause = "select " - + getSqlClause().getLocalTableAliasName() + "." + String tableAliasName = getSqlClause().getLocalTableAliasName(); + String selectClause = "select " + tableAliasName + "." + relatedColumnName; - String fromWhereClause = subQuery.getSqlClause() - .getClauseFromWhereWithUnionTemplate(); - fromWhereClause = replaceString(fromWhereClause, ".conditionQuery.", - "." + getLocationBase(propertyName) + ".");// Very Important! - - // Replace template marks. These are very important! - fromWhereClause = replaceString(fromWhereClause, getSqlClause() - .getUnionSelectClauseMark(), selectClause); - fromWhereClause = replaceString(fromWhereClause, getSqlClause() - .getUnionWhereClauseMark(), ""); - fromWhereClause = replaceString(fromWhereClause, getSqlClause() - .getUnionWhereFirstConditionMark(), ""); - + String fromWhereClause = buildPlainSubQueryFromWhereClause(subQuery, + relatedColumnName, propertyName, selectClause, tableAliasName); return selectClause + " " + fromWhereClause; } @@ -769,24 +738,20 @@ assertObjectNotNull("ExistsSubQyery(" + columnName + ")", subQuery); existsOption = existsOption != null ? existsOption + " " : ""; String realColumnName = getExistsSubQueryRealColumnName(columnName); + xincrementLocalSubQueryLevelIfNeeds(subQuery); String subQueryClause = getExistsSubQuerySql(subQuery, realColumnName, relatedColumnName, propertyName); - String clause = null; - if (getSqlClause().isFormatClauseEffective()) { - String ln = getLineSeparator(); - int subQueryLevel = subQuery.getSubQueryLevel(); - String subQueryIdentity = propertyName + "[" + subQueryLevel + "]"; - String beginMark = getSqlClause().resolveSubQueryBeginMark( - subQueryIdentity) - + ln; - String endMark = getSqlClause().resolveSubQueryEndMark( - subQueryIdentity); - String endIndent = " "; - clause = existsOption + "exists (" + beginMark + subQueryClause - + ln + endIndent + ")" + endMark; - } else { - clause = existsOption + "exists (" + subQueryClause + ")"; - } + String ln = getLineSeparator(); + int subQueryLevel = subQuery.getSubQueryLevel(); + String subQueryIdentity = propertyName + "[" + subQueryLevel + "]"; + String beginMark = getSqlClause().resolveSubQueryBeginMark( + subQueryIdentity) + + ln; + String endMark = getSqlClause() + .resolveSubQueryEndMark(subQueryIdentity); + String endIndent = " "; + String clause = existsOption + "exists (" + beginMark + subQueryClause + + ln + endIndent + ")" + endMark; registerWhereClause(clause); } @@ -801,134 +766,116 @@ protected String getExistsSubQuerySql(ConditionQuery subQuery, String realColumnName, String relatedColumnName, String propertyName) { int subQueryLevel = subQuery.getSubQueryLevel(); - if (_subQueryLevel <= subQueryLevel) { - _subQueryLevel = subQueryLevel + 1; - } String tableAliasName = "dfsublocal_" + subQueryLevel; String selectClause = "select " + tableAliasName + "." + relatedColumnName; - String fromWhereClause = subQuery.getSqlClause() - .getClauseFromWhereWithWhereUnionTemplate(); - fromWhereClause = replaceString(fromWhereClause, "dflocal", - tableAliasName);// Very Important! - fromWhereClause = replaceString(fromWhereClause, ".conditionQuery.", - "." + getLocationBase(propertyName) + ".");// Very Important! - - String joinCondition = tableAliasName + "." + relatedColumnName + " = " - + realColumnName; - String firstConditionAfter = " and "; - if (getSqlClause().isFormatClauseEffective()) { - firstConditionAfter = getLineSeparator() + " and "; - } - - // Replace template marks. These are very important! - fromWhereClause = replaceString(fromWhereClause, getSqlClause() - .getWhereClauseMark(), "where " + joinCondition); - fromWhereClause = replaceString(fromWhereClause, getSqlClause() - .getWhereFirstConditionMark(), joinCondition - + firstConditionAfter); - fromWhereClause = replaceString(fromWhereClause, getSqlClause() - .getUnionSelectClauseMark(), selectClause); - fromWhereClause = replaceString(fromWhereClause, getSqlClause() - .getUnionWhereClauseMark(), "where " + joinCondition); - fromWhereClause = replaceString(fromWhereClause, getSqlClause() - .getUnionWhereFirstConditionMark(), joinCondition - + firstConditionAfter); - + String fromWhereClause = buildCorrelationSubQueryFromWhereClause( + subQuery, relatedColumnName, propertyName, selectClause, + tableAliasName, realColumnName); return selectClause + " " + fromWhereClause; } // [DBFlute-0.7.4] // ----------------------------------------------------- - // DeriveSubQuery - // -------------- - protected void registerDeriveSubQuery(String function, + // DerivedReferrerSubQuery + // ----------------------- + protected void registerDerivedReferrerSubQuery(String function, ConditionQuery subQuery, String columnName, String relatedColumnName, String propertyName, String aliasName) { - assertObjectNotNull("DeriveSubQuery(" + columnName + ")", subQuery); - final String realColumnName = getDeriveSubQueryRealColumnName(columnName); - final String subQueryClause = getDeriveSubQuerySql(function, subQuery, - realColumnName, relatedColumnName, propertyName, aliasName); - final String clause; - if (getSqlClause().isFormatClauseEffective()) { - final String ln = getLineSeparator(); - final int subQueryLevel = subQuery.getSubQueryLevel(); - final String subQueryIdentity = propertyName + "[" + subQueryLevel - + "]"; - final String beginMark = getSqlClause().resolveSubQueryBeginMark( - subQueryIdentity) - + ln; - final String endMark = getSqlClause().resolveSubQueryEndMark( - subQueryIdentity); - final String endIndent = " "; - clause = "(" + beginMark + subQueryClause + ln + endIndent - + ") as " + aliasName + endMark; - } else { - clause = "(" + subQueryClause + ") as " + aliasName; - } + assertObjectNotNull("DerivedReferrerSubQuery(function)", function); + assertObjectNotNull("DerivedReferrerSubQuery(" + columnName + ")", + subQuery); + String realColumnName = getDerivedReferrerSubQueryRealColumnName(columnName); + xincrementLocalSubQueryLevelIfNeeds(subQuery); + String subQueryClause = getDerivedReferrerSubQuerySql(function, + subQuery, realColumnName, relatedColumnName, propertyName, + aliasName); + String ln = getLineSeparator(); + int subQueryLevel = subQuery.getSubQueryLevel(); + String subQueryIdentity = propertyName + "[" + subQueryLevel + "]"; + String beginMark = getSqlClause().resolveSubQueryBeginMark( + subQueryIdentity) + + ln; + String endMark = getSqlClause() + .resolveSubQueryEndMark(subQueryIdentity); + String endIndent = " "; + String clause = "(" + beginMark + subQueryClause + ln + endIndent + + ") " + aliasName + endMark; getSqlClause().specifyDeriveSubQuery(aliasName, clause); } - protected String getDeriveSubQueryRealColumnName(String columnName) { + protected String getDerivedReferrerSubQueryRealColumnName(String columnName) { return getRealColumnName(columnName); } - protected String getDeriveSubQuerySql(String function, + protected String getDerivedReferrerSubQuerySql(String function, ConditionQuery subQuery, String realColumnName, String relatedColumnName, String propertyName, String aliasName) { - final int subQueryLevel = subQuery.getSubQueryLevel(); - if (_subQueryLevel <= subQueryLevel) { - _subQueryLevel = subQueryLevel + 1; - } - final String tableAliasName = "dfsublocal_" + subQueryLevel; - final String deriveColumnName = subQuery.getSqlClause() + int subQueryLevel = subQuery.getSubQueryLevel(); + String tableAliasName = "dfsublocal_" + subQueryLevel; + String deriveColumnName = subQuery.getSqlClause() .getSpecifiedColumnNameAsOne(); if (deriveColumnName == null || deriveColumnName.trim().length() == 0) { - throwDeriveReferrerInvalidColumnSpecificationException(function, + throwDerivedReferrerInvalidColumnSpecificationException(function, aliasName); } - assertDeriveReferrerColumnType(function, subQuery, deriveColumnName); - subQuery.getSqlClause().clearSpecifiedSelectColumn(); - final String selectClause = "select " + function + "(" + tableAliasName - + "." + deriveColumnName + ")"; - String fromWhereClause = subQuery.getSqlClause() - .getClauseFromWhereWithWhereUnionTemplate(); - fromWhereClause = replaceString(fromWhereClause, "dflocal", - tableAliasName);// Very Important! - fromWhereClause = replaceString(fromWhereClause, ".conditionQuery.", - "." + getLocationBase(propertyName) + ".");// Very Important! - - final String joinCondition = tableAliasName + "." + relatedColumnName - + " = " + realColumnName; - String firstConditionAfter = " and "; - if (getSqlClause().isFormatClauseEffective()) { - firstConditionAfter = getLineSeparator() + " and "; + assertDerivedReferrerColumnType(function, subQuery, deriveColumnName); + subQuery.getSqlClause().clearSpecifiedSelectColumn(); // specified + // columns + // disappear at + // this timing + String connect = xbuildFunctionConnector(function); + if (subQuery.getSqlClause().hasUnionQuery()) { + String ln = getLineSeparator(); + String subQueryIdentity = propertyName + "[" + subQueryLevel + + ":subquerymain]"; + String beginMark = getSqlClause().resolveSubQueryBeginMark( + subQueryIdentity) + + ln; + String endMark = getSqlClause().resolveSubQueryEndMark( + subQueryIdentity); + DBMeta dbmeta = DBMetaInstanceHandler.findDBMeta(subQuery + .getTableDbName()); + if (!dbmeta.hasPrimaryKey() || dbmeta.hasTwoOrMorePrimaryKeys()) { + String msg = "The derived-referrer is unsupported when no primary key or two-or-more primary keys:"; + msg = msg + " table=" + subQuery.getTableDbName(); + throw new UnsupportedOperationException(msg); + } + String primaryKeyName = dbmeta.getPrimaryUniqueInfo() + .getFirstColumn().getColumnDbName(); + String selectClause = "select " + tableAliasName + "." + + primaryKeyName + ", " + tableAliasName + "." + + relatedColumnName + ", " + tableAliasName + "." + + deriveColumnName; + String fromWhereClause = buildPlainSubQueryFromWhereClause( + subQuery, relatedColumnName, propertyName, selectClause, + tableAliasName); + String mainSql = selectClause + " " + fromWhereClause; + String joinCondition = "dfsubquerymain." + relatedColumnName + + " = " + realColumnName; + return "select " + function + connect + "dfsubquerymain." + + deriveColumnName + ")" + ln + " from (" + beginMark + + mainSql + ln + " ) dfsubquerymain" + endMark + ln + + " where " + joinCondition; + } else { + String selectClause = "select " + function + connect + + tableAliasName + "." + deriveColumnName + ")"; + String fromWhereClause = buildCorrelationSubQueryFromWhereClause( + subQuery, relatedColumnName, propertyName, selectClause, + tableAliasName, realColumnName); + return selectClause + " " + fromWhereClause; } - - // Replace template marks. These are very important! - fromWhereClause = replaceString(fromWhereClause, getSqlClause() - .getWhereClauseMark(), "where " + joinCondition); - fromWhereClause = replaceString(fromWhereClause, getSqlClause() - .getWhereFirstConditionMark(), joinCondition - + firstConditionAfter); - fromWhereClause = replaceString(fromWhereClause, getSqlClause() - .getUnionSelectClauseMark(), selectClause); - fromWhereClause = replaceString(fromWhereClause, getSqlClause() - .getUnionWhereClauseMark(), "where " + joinCondition); - fromWhereClause = replaceString(fromWhereClause, getSqlClause() - .getUnionWhereFirstConditionMark(), joinCondition - + firstConditionAfter); - - return selectClause + " " + fromWhereClause; } - protected void throwDeriveReferrerInvalidColumnSpecificationException( + protected void throwDerivedReferrerInvalidColumnSpecificationException( String function, String aliasName) { + String method = xconvertFunctionToMethod(function); String msg = "Look! Read the message below." + getLineSeparator(); msg = msg + "/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *" + getLineSeparator(); - msg = msg + "The specified the column for derive-referrer was Invalid!" + msg = msg + + "The specified the column for derived-referrer was Invalid!" + getLineSeparator(); msg = msg + getLineSeparator(); msg = msg + "[Advice]" + getLineSeparator(); @@ -941,7 +888,7 @@ msg = msg + " /- - - - - - - - - - - - - - - - - - - - " + getLineSeparator(); msg = msg + " MemberCB cb = new MemberCB();" + getLineSeparator(); - msg = msg + " cb.specify().derivePurchaseList()." + function + msg = msg + " cb.specify().derivePurchaseList()." + method + "(new SubQuery() {" + getLineSeparator(); msg = msg + " public void query(PurchaseCB subCB) {" + getLineSeparator(); @@ -955,7 +902,7 @@ msg = msg + " /- - - - - - - - - - - - - - - - - - - - " + getLineSeparator(); msg = msg + " MemberCB cb = new MemberCB();" + getLineSeparator(); - msg = msg + " cb.specify().derivePurchaseList()." + function + msg = msg + " cb.specify().derivePurchaseList()." + method + "(new SubQuery() {" + getLineSeparator(); msg = msg + " public void query(PurchaseCB subCB) {" + getLineSeparator(); @@ -973,7 +920,7 @@ msg = msg + " /- - - - - - - - - - - - - - - - - - - - " + getLineSeparator(); msg = msg + " MemberCB cb = new MemberCB();" + getLineSeparator(); - msg = msg + " cb.specify().derivePurchaseList()." + function + msg = msg + " cb.specify().derivePurchaseList()." + method + "(new SubQuery() {" + getLineSeparator(); msg = msg + " public void query(PurchaseCB subCB) {" + getLineSeparator(); @@ -988,19 +935,19 @@ msg = msg + "[Alias Name]" + getLineSeparator() + aliasName + getLineSeparator(); msg = msg + "* * * * * * * * * */"; - throw new DeriveReferrerInvalidColumnSpecificationException(msg); + throw new DerivedReferrerInvalidColumnSpecificationException(msg); } - public static class DeriveReferrerInvalidColumnSpecificationException + public static class DerivedReferrerInvalidColumnSpecificationException extends RuntimeException { private static final long serialVersionUID = 1L; - public DeriveReferrerInvalidColumnSpecificationException(String msg) { + public DerivedReferrerInvalidColumnSpecificationException(String msg) { super(msg); } } - protected void assertDeriveReferrerColumnType(String function, + protected void assertDerivedReferrerColumnType(String function, ConditionQuery subQuery, String deriveColumnName) { final DBMeta dbmeta = DBMetaInstanceHandler.findDBMeta(subQuery .getTableDbName()); @@ -1009,13 +956,13 @@ if ("sum".equalsIgnoreCase(function) || "avg".equalsIgnoreCase(function)) { if (!Number.class.isAssignableFrom(deriveColumnType)) { - throwDeriveReferrerUnmatchedColumnTypeException(function, + throwDerivedReferrerUnmatchedColumnTypeException(function, deriveColumnName, deriveColumnType); } } } - protected void throwDeriveReferrerUnmatchedColumnTypeException( + protected void throwDerivedReferrerUnmatchedColumnTypeException( String function, String deriveColumnName, Class deriveColumnType) { String msg = "Look! Read the message below." + getLineSeparator(); msg = msg @@ -1040,19 +987,366 @@ msg = msg + "[Derive Column]" + getLineSeparator() + deriveColumnName + "(" + deriveColumnType.getName() + ")" + getLineSeparator(); msg = msg + "* * * * * * * * * */"; - throw new DeriveReferrerUnmatchedColumnTypeException(msg); + throw new DerivedReferrerUnmatchedColumnTypeException(msg); } - public static class DeriveReferrerUnmatchedColumnTypeException extends + public static class DerivedReferrerUnmatchedColumnTypeException extends RuntimeException { private static final long serialVersionUID = 1L; - public DeriveReferrerUnmatchedColumnTypeException(String msg) { + public DerivedReferrerUnmatchedColumnTypeException(String msg) { super(msg); } } + // [DBFlute-0.8.8] // ----------------------------------------------------- + // ScalarSubQuery + // -------------- + protected void registerScalarSubQuery(String function, + ConditionQuery subQuery, String propertyName, String operand) { + assertObjectNotNull("ScalarSubQuery(" + propertyName + ")", subQuery); + + // Get the specified column before it disappears at sub-query making. + String deriveRealColumnName; + { + String deriveColumnName = subQuery.getSqlClause() + .getSpecifiedColumnNameAsOne(); + if (deriveColumnName == null + || deriveColumnName.trim().length() == 0) { + throwScalarSubQueryInvalidColumnSpecificationException(function); + } + deriveRealColumnName = getScalarSubQueryRealColumnName(deriveColumnName); + } + + xincrementLocalSubQueryLevelIfNeeds(subQuery); + String subQueryClause = getScalarSubQuerySql(function, subQuery, + propertyName); + String ln = getLineSeparator(); + int subQueryLevel = subQuery.getSubQueryLevel(); + String subQueryIdentity = propertyName + "[" + subQueryLevel + "]"; + String beginMark = getSqlClause().resolveSubQueryBeginMark( + subQueryIdentity) + + ln; + String endMark = getSqlClause() + .resolveSubQueryEndMark(subQueryIdentity); + String endIndent = " "; + String clause = deriveRealColumnName + " " + operand + " (" + beginMark + + subQueryClause + ln + endIndent + ") " + endMark; + registerWhereClause(clause); + } + + protected String getScalarSubQueryRealColumnName(String columnName) { + return getRealColumnName(columnName); + } + + protected String getScalarSubQuerySql(String function, + ConditionQuery subQuery, String propertyName) { + int subQueryLevel = subQuery.getSubQueryLevel(); + String tableAliasName = "dfsublocal_" + subQueryLevel; + String deriveColumnName = subQuery.getSqlClause() + .getSpecifiedColumnNameAsOne(); + if (deriveColumnName == null || deriveColumnName.trim().length() == 0) { + throwScalarSubQueryInvalidColumnSpecificationException(function); + } + assertScalarSubQueryColumnType(function, subQuery, deriveColumnName); + subQuery.getSqlClause().clearSpecifiedSelectColumn(); // specified + // columns + // disappear at + // this timing + DBMeta dbmeta = DBMetaInstanceHandler.findDBMeta(subQuery + .getTableDbName()); + if (!dbmeta.hasPrimaryKey() || dbmeta.hasTwoOrMorePrimaryKeys()) { + String msg = "The scalar-sub-query is unsupported when no primary key or two-or-more primary keys:"; + msg = msg + " table=" + subQuery.getTableDbName(); + throw new UnsupportedOperationException(msg); + } + String primaryKeyName = dbmeta.getPrimaryUniqueInfo().getFirstColumn() + .getColumnDbName(); + if (subQuery.getSqlClause().hasUnionQuery()) { + String ln = getLineSeparator(); + String subQueryIdentity = propertyName + "[" + subQueryLevel + + ":subquerymain]"; + String beginMark = getSqlClause().resolveSubQueryBeginMark( + subQueryIdentity) + + ln; + String endMark = getSqlClause().resolveSubQueryEndMark( + subQueryIdentity); + String selectClause = "select " + tableAliasName + "." + + primaryKeyName + ", " + tableAliasName + "." + + deriveColumnName; + String fromWhereClause = buildPlainSubQueryFromWhereClause( + subQuery, primaryKeyName, propertyName, selectClause, + tableAliasName); + String mainSql = selectClause + " " + fromWhereClause; + return "select " + function + "(dfsubquerymain." + deriveColumnName + + ")" + ln + " from (" + beginMark + mainSql + ln + + " ) dfsubquerymain" + endMark; + } else { + String selectClause = "select " + function + "(" + tableAliasName + + "." + deriveColumnName + ")"; + String fromWhereClause = buildPlainSubQueryFromWhereClause( + subQuery, primaryKeyName, propertyName, selectClause, + tableAliasName); + return selectClause + " " + fromWhereClause; + } + } + + protected void throwScalarSubQueryInvalidColumnSpecificationException( + String function) { + String msg = "Look! Read the message below." + getLineSeparator(); + msg = msg + + "/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *" + + getLineSeparator(); + msg = msg + + "The specified the column for derived-referrer was Invalid!" + + getLineSeparator(); + msg = msg + getLineSeparator(); + msg = msg + "[Advice]" + getLineSeparator(); + msg = msg + + " You should call specify().column[TargetColumn]() only once." + + getLineSeparator(); + msg = msg + " For example:" + getLineSeparator(); + msg = msg + " " + getLineSeparator(); + msg = msg + " [Wrong]" + getLineSeparator(); + msg = msg + " /- - - - - - - - - - - - - - - - - - - - " + + getLineSeparator(); + msg = msg + " MemberCB cb = new MemberCB();" + getLineSeparator(); + msg = msg + " cb.query().scalar_Equal()." + function + + "(new SubQuery() {" + getLineSeparator(); + msg = msg + " public void query(MemberCB subCB) {" + + getLineSeparator(); + msg = msg + " // *No! It's empty!" + getLineSeparator(); + msg = msg + " }" + getLineSeparator(); + msg = msg + " });" + getLineSeparator(); + msg = msg + " - - - - - - - - - -/" + getLineSeparator(); + msg = msg + " " + getLineSeparator(); + msg = msg + " [Wrong]" + getLineSeparator(); + msg = msg + " /- - - - - - - - - - - - - - - - - - - - " + + getLineSeparator(); + msg = msg + " MemberCB cb = new MemberCB();" + getLineSeparator(); + msg = msg + " cb.query().scalar_Equal()." + function + + "(new SubQuery() {" + getLineSeparator(); + msg = msg + " public void query(MemberCB subCB) {" + + getLineSeparator(); + msg = msg + " subCB.specify().columnMemberBirthday();" + + getLineSeparator(); + msg = msg + + " subCB.specify().columnMemberName(); // *No! It's duplicated!" + + getLineSeparator(); + msg = msg + " }" + getLineSeparator(); + msg = msg + " });" + getLineSeparator(); + msg = msg + " - - - - - - - - - -/" + getLineSeparator(); + msg = msg + " " + getLineSeparator(); + msg = msg + " [Good!]" + getLineSeparator(); + msg = msg + " /- - - - - - - - - - - - - - - - - - - - " + + getLineSeparator(); + msg = msg + " MemberCB cb = new MemberCB();" + getLineSeparator(); + msg = msg + " cb.query().scalar_Equal()." + function + + "(new SubQuery() {" + getLineSeparator(); + msg = msg + " public void query(MemberCB subCB) {" + + getLineSeparator(); + msg = msg + + " subCB.specify().columnPurchaseDatetime(); // *Point!" + + getLineSeparator(); + msg = msg + " }" + getLineSeparator(); + msg = msg + " });" + getLineSeparator(); + msg = msg + " - - - - - - - - - -/" + getLineSeparator(); + msg = msg + "* * * * * * * * * */"; + throw new ScalarSubQueryInvalidColumnSpecificationException(msg); + } + + public static class ScalarSubQueryInvalidColumnSpecificationException + extends RuntimeException { + private static final long serialVersionUID = 1L; + + public ScalarSubQueryInvalidColumnSpecificationException(String msg) { + super(msg); + } + } + + protected void assertScalarSubQueryColumnType(String function, + ConditionQuery subQuery, String deriveColumnName) { + final DBMeta dbmeta = DBMetaInstanceHandler.findDBMeta(subQuery + .getTableDbName()); + final Class deriveColumnType = dbmeta.findColumnInfo( + deriveColumnName).getPropertyType(); + if ("sum".equalsIgnoreCase(function) + || "avg".equalsIgnoreCase(function)) { + if (!Number.class.isAssignableFrom(deriveColumnType)) { + throwScalarSubQueryUnmatchedColumnTypeException(function, + deriveColumnName, deriveColumnType); + } + } + } + + protected void throwScalarSubQueryUnmatchedColumnTypeException( + String function, String deriveColumnName, Class deriveColumnType) { + String msg = "Look! Read the message below." + getLineSeparator(); + msg = msg + + "/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *" + + getLineSeparator(); + msg = msg + + "The type of the specified the column unmatched with the function!" + + getLineSeparator(); + msg = msg + getLineSeparator(); + msg = msg + "[Advice]" + getLineSeparator(); + msg = msg + "You should confirm the list as follow:" + + getLineSeparator(); + msg = msg + " max() : String, Number, Date" + getLineSeparator(); + msg = msg + " min() : String, Number, Date" + getLineSeparator(); + msg = msg + " sum() : Number" + getLineSeparator(); + msg = msg + " avg() : Number" + getLineSeparator(); + msg = msg + getLineSeparator(); + msg = msg + "[Function]" + getLineSeparator() + function + + getLineSeparator(); + msg = msg + getLineSeparator(); + msg = msg + "[Derive Column]" + getLineSeparator() + deriveColumnName + + "(" + deriveColumnType.getName() + ")" + getLineSeparator(); + msg = msg + "* * * * * * * * * */"; + throw new ScalarSubQueryUnmatchedColumnTypeException(msg); + } + + public static class ScalarSubQueryUnmatchedColumnTypeException extends + RuntimeException { + private static final long serialVersionUID = 1L; + + public ScalarSubQueryUnmatchedColumnTypeException(String msg) { + super(msg); + } + } + + public static class SSQFunction { + protected SSQSetupper _setupper; + + public SSQFunction(SSQSetupper setupper) { + _setupper = setupper; + } + + public void max(SubQuery subQuery) { + _setupper.setup("max", subQuery); + } + + public void min(SubQuery subQuery) { + _setupper.setup("min", subQuery); + } + + public void sum(SubQuery subQuery) { + _setupper.setup("sum", subQuery); + } + + public void avg(SubQuery subQuery) { + _setupper.setup("avg", subQuery); + } + } + + protected static interface SSQSetupper { + public void setup(String function, SubQuery subQuery); + } + + // ----------------------------------------------------- + // SubQuery Common + // --------------- + protected String buildPlainSubQueryFromWhereClause(ConditionQuery subQuery, + String relatedColumnName, String propertyName, String selectClause, + String tableAliasName) { + String fromWhereClause = subQuery.getSqlClause() + .getClauseFromWhereWithUnionTemplate(); + + // Replace the alias names for local table with alias name of sub-query + // unique. + // However when it's inScope this replacement is unnecessary so comment + // out here. + // (Override base alias name at sub-query on SQL) + // So if the argument 'tableAliasName' is not null, replace it. + if (tableAliasName != null) { + fromWhereClause = replaceString(fromWhereClause, "dflocal", + tableAliasName); + } + + // Resolve the location path for the condition-query of sub-query. + fromWhereClause = replaceString(fromWhereClause, ".conditionQuery.", + "." + getLocationBase(propertyName) + "."); + + // Replace template marks. These are very important! + fromWhereClause = replaceString(fromWhereClause, getSqlClause() + .getUnionSelectClauseMark(), selectClause); + fromWhereClause = replaceString(fromWhereClause, getSqlClause() + .getUnionWhereClauseMark(), ""); + fromWhereClause = replaceString(fromWhereClause, getSqlClause() + .getUnionWhereFirstConditionMark(), ""); + return fromWhereClause; + } + + protected String buildCorrelationSubQueryFromWhereClause( + ConditionQuery subQuery, String relatedColumnName, + String propertyName, String selectClause, String tableAliasName, + String realColumnName) { + String fromWhereClause = subQuery.getSqlClause() + .getClauseFromWhereWithWhereUnionTemplate(); + + // Replace the alias names for local table with alias name of sub-query + // unique. + fromWhereClause = replaceString(fromWhereClause, "dflocal", + tableAliasName); + + // Resolve the location path for the condition-query of sub-query. + fromWhereClause = replaceString(fromWhereClause, ".conditionQuery.", + "." + getLocationBase(propertyName) + "."); + + String joinCondition = tableAliasName + "." + relatedColumnName + " = " + + realColumnName; + String firstConditionAfter = getLineSeparator() + " and "; + + // Replace template marks. These are very important! + fromWhereClause = replaceString(fromWhereClause, getSqlClause() + .getWhereClauseMark(), "where " + joinCondition); + fromWhereClause = replaceString(fromWhereClause, getSqlClause() + .getWhereFirstConditionMark(), joinCondition + + firstConditionAfter); + fromWhereClause = replaceString(fromWhereClause, getSqlClause() + .getUnionSelectClauseMark(), selectClause); + fromWhereClause = replaceString(fromWhereClause, getSqlClause() + .getUnionWhereClauseMark(), "where " + joinCondition); + fromWhereClause = replaceString(fromWhereClause, getSqlClause() + .getUnionWhereFirstConditionMark(), joinCondition + + firstConditionAfter); + return fromWhereClause; + } + + protected void xincrementLocalSubQueryLevelIfNeeds(ConditionQuery subQuery) { // Very + // Internal + int subQueryLevel = subQuery.getSubQueryLevel(); + if (_subQueryLevel <= subQueryLevel) { + _subQueryLevel = subQueryLevel + 1; + } + } + + protected String xbuildFunctionConnector(String function) { + if (function != null && function.endsWith("(distinct")) { // For example + // 'count(distinct' + return " "; + } else { + return "("; + } + } + + protected String xconvertFunctionToMethod(String function) { + if (function != null && function.contains("(")) { // For example + // 'count(distinct' + int index = function.indexOf("("); + String front = function.substring(0, index); + if (function.length() > front.length() + "(".length()) { + String rear = function.substring(index + "(".length()); + function = front + initCap(rear); + } else { + function = front; + } + } + return function; + } + + // ----------------------------------------------------- // Where Clause // ------------ protected void setupConditionValueAndRegisterWhereClause(ConditionKey key, @@ -1276,14 +1570,16 @@ // ========= // Fixed Condition // =============== - protected String prepareFixedCondition(String fixedCondition, - String localAliasName, String foreignAliasName) { + protected String ppFxCd(String fixedCondition, String localAliasName, + String foreignAliasName) { // prepareFixedCondition fixedCondition = replaceString(fixedCondition, "$$alias$$", foreignAliasName); fixedCondition = replaceString(fixedCondition, "$$foreignAlias$$", foreignAliasName); fixedCondition = replaceString(fixedCondition, "$$localAlias$$", localAliasName); + fixedCondition = replaceString(fixedCondition, "$$locationBase$$.", + "dto." + getLocationBase()); return fixedCondition; } @@ -1515,7 +1811,7 @@ return newList; } - public void doNss(NssCall callback) {// Very Internal + public void doNss(NssCall callback) { // Very Internal String foreignPropertyName = callback.qf().getForeignPropertyName(); String foreignTableAliasName = callback.qf().getRealAliasName(); getSqlClause().registerSelectedSelectColumn(foreignTableAliasName, @@ -1524,7 +1820,7 @@ callback.qf().getRelationPath(), foreignPropertyName); } - public static interface NssCall {// Very Internal + public static interface NssCall { // Very Internal public ConditionQuery qf(); } Modified: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/cbean/ConditionBean.java =================================================================== --- timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/cbean/ConditionBean.java 2008-12-27 22:18:30 UTC (rev 1630) +++ timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/cbean/ConditionBean.java 2008-12-27 22:20:25 UTC (rev 1631) @@ -1,5 +1,7 @@ package jp.sf.pal.timecard.db.allcommon.cbean; +import java.util.Map; + import jp.sf.pal.timecard.db.allcommon.cbean.sqlclause.SqlClause; import jp.sf.pal.timecard.db.allcommon.jdbc.StatementConfig; @@ -11,28 +13,6 @@ public interface ConditionBean extends PagingBean { //========================================================================== - // =========== - // Definition - // ========== - /** Map-string map-mark. */ - public static final String MAP_STRING_MAP_MARK = "map:"; - - /** Map-string list-mark. */ - public static final String MAP_STRING_LIST_MARK = "list:"; - - /** Map-string start-brace. */ - public static final String MAP_STRING_START_BRACE = "@{"; - - /** Map-string end-brace. */ - public static final String MAP_STRING_END_BRACE = "@}"; - - /** Map-string delimiter. */ - public static final String MAP_STRING_DELIMITER = "@;"; - - /** Map-string equal. */ - public static final String MAP_STRING_EQUAL = "@="; - - //========================================================================== // ========= // Table Name // ========== @@ -70,8 +50,7 @@ * * @param primaryKeyMap Primary-key map. (NotNull and NotEmpty) */ - public void acceptPrimaryKeyMap( - java.util.Map primaryKeyMap); + public void acceptPrimaryKeyMap(Map primaryKeyMap); /** * Accept primary-key map-string. Delimiter is at-mark and semicolon. @@ -105,14 +84,6 @@ // Query // ===== /** - * Get condition-query as interface. - * - * @return Instance of query as interface. (NotNull) - * @deprecated - */ - public ConditionQuery getConditionQueryAsInterface(); - - /** * Get the conditionQuery of the local table as interface. * * @return The conditionQuery of the local table as interface. (NotNull) @@ -131,32 +102,6 @@ public boolean hasUnionQueryOrUnionAllQuery(); //========================================================================== - // ========= - // Limit Select - // ============ - /** - * Limit select PK only. This is OLD style. You can do the same thing by - * specify(). - * - * @return this. (NotNull) - */ - public ConditionBean limitSelect_PKOnly(); - - /** - * Limit select off. - * - * @return this. (NotNull) - */ - public ConditionBean limitSelect_Off(); - - /** - * Is limit-select PK only? - * - * @return Determination. - */ - public boolean isLimitSelect_PKOnly(); - - //========================================================================== // =========== // Lock Setting // ============ Modified: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/cbean/ConditionBeanContext.java =================================================================== --- timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/cbean/ConditionBeanContext.java 2008-12-27 22:18:30 UTC (rev 1630) +++ timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/cbean/ConditionBeanContext.java 2008-12-27 22:20:25 UTC (rev 1631) @@ -1,10 +1,6 @@ package jp.sf.pal.timecard.db.allcommon.cbean; -import java.util.Collections; -import java.util.LinkedHashMap; -import java.util.Map; - -import jp.sf.pal.timecard.db.allcommon.DBFluteConfig; +import jp.sf.pal.timecard.db.allcommon.DBDef; import jp.sf.pal.timecard.db.allcommon.cbean.sqlclause.SqlClause; import jp.sf.pal.timecard.db.allcommon.cbean.sqlclause.SqlClauseDb2; import jp.sf.pal.timecard.db.allcommon.cbean.sqlclause.SqlClauseDerby; @@ -78,11 +74,35 @@ //========================================================================== // ========= - // Initialize against the ClassLoader Headache - // =========================================== + // Type Determination + // ================== + /** + * Is the argument condition-bean? + * + * @param dtoInstance DTO instance. + * @return Determination. + */ + public static boolean isTheArgumentConditionBean(final Object dtoInstance) { + return dtoInstance instanceof ConditionBean; + } + + /** + * Is the type condition-bean? + * + * @param dtoClass DtoClass. + * @return Determination. + */ + public static boolean isTheTypeConditionBean(final Class dtoClass) { + return ConditionBean.class.isAssignableFrom(dtoClass); + } + + //========================================================================== + // ========= + // Cool Classes + // ============ @SuppressWarnings("unused") - public static void initialize() { - boolean debugEnabled = _log.isDebugEnabled(); + public static void loadCoolClasses() { + boolean debugEnabled = false; // If you watch the log, set this true. // Against the ClassLoader Headache! final StringBuilder sb = new StringBuilder(); { @@ -119,120 +139,6 @@ //========================================================================== // ========= - // Type Determination - // ================== - /** - * Is the argument condition-bean? - * - * @param dtoInstance DTO instance. - * @return Determination. - */ - public static boolean isTheArgumentConditionBean(final Object dtoInstance) { - if (dtoInstance instanceof ConditionBean) { - return true; - } else { - return false; - } - } - - /** - * Is the type condition-bean? - * - * @param dtoClass DtoClass. - * @return Determination. - */ - public static boolean isTheTypeConditionBean(final Class dtoClass) { - if (ConditionBean.class.isAssignableFrom(dtoClass)) { - return true; - } else { - return false; - } - } - - //========================================================================== - // ========= - // Product Name - // ============ - public static final String DB_NAME_DERBY = "derby"; - - public static final String DB_NAME_H2 = "h2"; - - public static final String DB_NAME_ORACLE = "oracle"; - - public static final String DB_NAME_MYSQL = "mysql"; - - public static final String DB_NAME_POSTGRESQL = "postgresql"; - - public static final String DB_NAME_FIREBIRD = "firebird"; - - public static final String DB_NAME_MSSQL = "mssql"; - - public static final String DB_NAME_SYBASE = "sybase"; - - public static final String DB_NAME_DB2 = "db2"; - - protected static final Map _driverHintDatabaseProductNameMap; - static { - final Map tmpMap = Collections - .synchronizedMap(new LinkedHashMap()); - 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 keySet = _driverHintDatabaseProductNameMap - .keySet(); - for (final java.util.Iterator ite = keySet.iterator(); ite - .hasNext();) { - final String driverHint = (String) ite.next(); - if (driverClassName.indexOf(driverHint) >= 0) { - final String databaseProductName = (String) _driverHintDatabaseProductNameMap - .get(driverHint); - setDatabaseProductName(databaseProductName); - return true; - } - } - return false; - } - - /** The database product name. */ - private static String _databaseProductName; - - /** - * Get database product name. - * - * @return Database product name. - */ - public static String getDatabaseProductName() { - return _databaseProductName; - } - - /** - * Set database product name. - * - * @param name Database product name. (NotNull) - */ - public static void setDatabaseProductName(String name) { - if (_databaseProductName != null) { - String msg = "Already set up: current=" + _databaseProductName - + " your=" + name; - throw new IllegalStateException(msg); - } - _databaseProductName = name; - } - - //========================================================================== - // ========= // SqlClause Creator // ================= /** @@ -244,9 +150,6 @@ public static SqlClause createSqlClause(ConditionBean cb) { final String tableSqlName = cb.getTableSqlName(); final SqlClause sqlClause = createSqlClause(tableSqlName); - if (DBFluteConfig.getInstance().isConditionBeanFormatSql()) { - sqlClause.makeFormatClauseEffective(); - } return sqlClause; } @@ -257,27 +160,22 @@ * @return SQL-clause. (NotNull) */ public static SqlClause createSqlClause(String tableDbName) { - final String databaseProductName = getDatabaseProductName(); - if (databaseProductName == null) { - return new SqlClauseH2(tableDbName); - } - final String name = databaseProductName.toLowerCase(); - if (name.equalsIgnoreCase(DB_NAME_DERBY)) { - return new SqlClauseDerby(tableDbName); - } else if (name.equalsIgnoreCase(DB_NAME_H2)) { - return new SqlClauseH2(tableDbName); - } else if (name.equalsIgnoreCase(DB_NAME_ORACLE)) { - return new SqlClauseOracle(tableDbName); - } else if (name.equalsIgnoreCase(DB_NAME_FIREBIRD)) { - return new SqlClauseFirebird(tableDbName); - } else if (name.equalsIgnoreCase(DB_NAME_MYSQL)) { + if (DBDef.isCurrentDef(DBDef.MySQL)) { return new SqlClauseMySql(tableDbName); - } else if (name.equalsIgnoreCase(DB_NAME_POSTGRESQL)) { + } else if (DBDef.isCurrentDef(DBDef.PostgreSQL)) { return new SqlClausePostgreSql(tableDbName); - } else if (name.equalsIgnoreCase(DB_NAME_MSSQL)) { - return new SqlClauseSqlServer(tableDbName); - } else if (name.equalsIgnoreCase(DB_NAME_DB2)) { + } else if (DBDef.isCurrentDef(DBDef.Oracle)) { + return new SqlClauseOracle(tableDbName); + } else if (DBDef.isCurrentDef(DBDef.DB2)) { return new SqlClauseDb2(tableDbName); + } else if (DBDef.isCurrentDef(DBDef.SQLServer)) { + return new SqlClauseSqlServer(tableDbName); + } else if (DBDef.isCurrentDef(DBDef.FireBird)) { + return new SqlClauseFirebird(tableDbName); + } else if (DBDef.isCurrentDef(DBDef.H2)) { + return new SqlClauseH2(tableDbName); + } else if (DBDef.isCurrentDef(DBDef.Derby)) { + return new SqlClauseDerby(tableDbName); } else { return new SqlClauseH2(tableDbName); } @@ -362,12 +260,7 @@ // Display SQL // =========== public static String convertConditionBean2DisplaySql(ConditionBean cb) { - final String twoWaySql; - if (cb.isLimitSelect_PKOnly()) { - twoWaySql = cb.getSqlClause().getClausePKOnly(); - } else { - twoWaySql = cb.getSqlClause().getClause(); - } + final String twoWaySql = cb.getSqlClause().getClause(); return InternalSqlParser.convertTwoWaySql2DisplaySql(twoWaySql, cb); } @@ -390,31 +283,8 @@ errorCode); } - // [DBFlute-0.7.8] //========================================================================== // ========= - // Database Type - // ============= - /** - * Is the database Oracle? - * - * @return Is the database Oracle? - */ - public static boolean isOracle() { - return createSqlClause("dummy") instanceof SqlClauseOracle; - } - - /** - * Is the database PostgreSQL? - * - * @return Is the database PostgreSQL? - */ - public static boolean isPostgreSql() { - return createSqlClause("dummy") instanceof SqlClausePostgreSql; - } - - //========================================================================== - // ========= // Helper // ====== /** Modified: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/cbean/ConditionQuery.java =================================================================== --- timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/cbean/ConditionQuery.java 2008-12-27 22:18:30 UTC (rev 1630) +++ timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/cbean/ConditionQuery.java 2008-12-27 22:20:25 UTC (rev 1631) @@ -8,7 +8,6 @@ * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public interface ConditionQuery { //========================================================================== Added: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/cbean/ScalarQuery.java =================================================================== --- timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/cbean/ScalarQuery.java (rev 0) +++ timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/cbean/ScalarQuery.java 2008-12-27 22:20:25 UTC (rev 1631) @@ -0,0 +1,5 @@ +package jp.sf.pal.timecard.db.allcommon.cbean; + +public interface ScalarQuery { + public void query(CB cb); +} Property changes on: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/cbean/ScalarQuery.java ___________________________________________________________________ Name: svn:eol-style + native Modified: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/cbean/ckey/ConditionKey.java =================================================================== --- timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/cbean/ckey/ConditionKey.java 2008-12-27 22:18:30 UTC (rev 1630) +++ timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/cbean/ckey/ConditionKey.java 2008-12-27 22:20:25 UTC (rev 1631) @@ -12,6 +12,10 @@ */ public abstract class ConditionKey { + //========================================================================== + // ========= + // Definition + // ========== /** Mark of replaced value. */ public static final String MARK_OF_REPLACED_VALUE = "ReplacedValue"; @@ -36,15 +40,18 @@ /** The condition key of prefixSearch. */ public static final ConditionKey CK_PREFIX_SEARCH = new ConditionKeyPrefixSearch(); - /** The condition key of likeSearch. */ - public static final ConditionKey CK_LIKE_SEARCH = new ConditionKeyLikeSearch(); - /** The condition key of inScope. */ public static final ConditionKey CK_IN_SCOPE = new ConditionKeyInScope(); /** The condition key of notInScope. */ public static final ConditionKey CK_NOT_IN_SCOPE = new ConditionKeyNotInScope(); + /** The condition key of likeSearch. */ + public static final ConditionKey CK_LIKE_SEARCH = new ConditionKeyLikeSearch(); + + /** The condition key of notLikeSearch. */ + public static final ConditionKey CK_NOT_LIKE_SEARCH = new ConditionKeyNotLikeSearch(); + /** The condition key of isNull. */ public static final ConditionKey CK_IS_NULL = new ConditionKeyIsNull(); @@ -54,31 +61,21 @@ /** Dummy-object for IsNull and IsNotNull and so on... */ protected static final Object DUMMY_OBJECT = new Object(); + //========================================================================== + // ========= + // Attribute + // ========= /** Condition-key. */ protected String _conditionKey; /** Operand. */ protected String _operand; + //========================================================================== + // ========= + // Validation + // ========== /** - * Get condition-key. - * - * @return Condition-key. - */ - public String getConditionKey() { - return _conditionKey; - } - - /** - * Get operand. - * - * @return Operand. - */ - public String getOperand() { - return _operand; - } - - /** * Is valid registration? * * @param conditionValue Condition value. (NotNull) @@ -89,6 +86,10 @@ abstract public boolean isValidRegistration(ConditionValue conditionValue, Object value, String callerName); + //========================================================================== + // ========= + // Where Clause + // ============ /** * Add where clause. * @@ -149,6 +150,10 @@ abstract protected void doAddWhereClause(List conditionList, String columnName, ConditionValue value, ConditionOption option); + //========================================================================== + // ========= + // Condition Value + // =============== /** * Setup condition value. * @@ -210,6 +215,10 @@ ConditionValue conditionValue, Object value, String location, ConditionOption option); + //========================================================================== + // ========= + // Bind Clause + // =========== /** * Build bind clause. (for s2dao) * @@ -269,6 +278,10 @@ return "%"; } + //========================================================================== + // ========= + // Basic Override + // ============== /** * The override. Returns hash-code of this condition-key string. * @@ -304,4 +317,26 @@ return "ConditionKey: " + getConditionKey() + " " + getOperand() + " wild-card=[" + getWildCard() + "]"; } + + //========================================================================== + // ========= + // Accessor + // ======== + /** + * Get condition-key. + * + * @return Condition-key. + */ + public String getConditionKey() { + return _conditionKey; + } + + /** + * Get operand. + * + * @return Operand. + */ + public String getOperand() { + return _operand; + } } Added: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/cbean/ckey/ConditionKeyNotLikeSearch.java =================================================================== --- timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/cbean/ckey/ConditionKeyNotLikeSearch.java (rev 0) +++ timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/cbean/ckey/ConditionKeyNotLikeSearch.java 2008-12-27 22:20:25 UTC (rev 1631) @@ -0,0 +1,104 @@ +package jp.sf.pal.timecard.db.allcommon.cbean.ckey; + +import java.util.List; + +import jp.sf.pal.timecard.db.allcommon.cbean.coption.ConditionOption; +import jp.sf.pal.timecard.db.allcommon.cbean.coption.LikeSearchOption; +import jp.sf.pal.timecard.db.allcommon.cbean.cvalue.ConditionValue; + +/** + * The condition-key of notLikeSearch. + * + * @author DBFlute(AutoGenerator) + */ +public class ConditionKeyNotLikeSearch extends ConditionKey { + + /** + * Constructor. + */ + protected ConditionKeyNotLikeSearch() { + _conditionKey = "notLikeSearch"; + _operand = "not like"; + } + + /** + * Is valid registration? + * + * @param conditionValue Condition value. (NotNull) + * @param value Value. (NotNull) + * @param callerName Caller name. (NotNull) + * @return Determination. + */ + public boolean isValidRegistration(ConditionValue conditionValue, + Object value, String callerName) { + if (value == null) { + return false; + } + return true; + } + + /** + * This method implements super#doAddWhereClause(). + * + * @param conditionList Condition list. (NotNull) + * @param columnName Column name. (NotNull) + * @param value Condition value. (NotNull) + */ + protected void doAddWhereClause(List 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 conditionList, + String columnName, ConditionValue value, ConditionOption option) { + if (option == null) { + String msg = "The argument[option] should not be null: columnName=" + + columnName + " value=" + value; + throw new IllegalArgumentException(msg); + } + if (!(option instanceof LikeSearchOption)) { + String msg = "The argument[option] should be LikeSearchOption: columnName=" + + columnName + " value=" + value; + throw new IllegalArgumentException(msg); + } + final LikeSearchOption myOption = (LikeSearchOption) option; + conditionList.add(buildBindClauseWithRearOption(columnName, value + .getNotLikeSearchLocation(), myOption.getRearOption())); + } + + /** + * This method implements super#doSetupConditionValue(). + * + * @param conditionValue Condition value. (NotNull) + * @param value Value. (NotNull) + * @param location Location. (NotNull) + */ + protected void doSetupConditionValue(ConditionValue conditionValue, + Object value, String location) { + throw new UnsupportedOperationException( + "doSetupConditionValue without condition-option is unsupported!!!"); + } + + /** + * This method implements super#doSetupConditionValue(). + * + * @param conditionValue Condition value. (NotNull) + * @param value Value. (NotNull) + * @param location Location. (NotNull) + * @param option Condition option. (NotNull) + */ + protected void doSetupConditionValue(ConditionValue conditionValue, + Object value, String location, ConditionOption option) { + conditionValue.setNotLikeSearch((String) value, + (LikeSearchOption) option).setNotLikeSearchLocation(location); + } +} Property changes on: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/cbean/ckey/ConditionKeyNotLikeSearch.java ___________________________________________________________________ Name: svn:eol-style + native Modified: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/cbean/coption/FromToOption.java =================================================================== --- timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/cbean/coption/FromToOption.java 2008-12-27 22:18:30 UTC (rev 1630) +++ timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/cbean/coption/FromToOption.java 2008-12-27 22:20:25 UTC (rev 1631) @@ -1,5 +1,10 @@ package jp.sf.pal.timecard.db.allcommon.cbean.coption; +import java.util.Calendar; +import java.util.Date; + +import jp.sf.pal.timecard.db.allcommon.cbean.ckey.ConditionKey; + /** * The option of from-to. * @@ -85,60 +90,84 @@ // ========= // Internal Main // ============= - public java.util.Date filterFromDate(java.util.Date fromDate) { + /** + * Filter the date as From. It requires this method is called before + * getFromDateConditionKey(). + * + * @param fromDate The date as From. (Nullable: If the value is null, it + * returns null) + * @return The filtered date as From. (Nullable) + */ + public Date filterFromDate(Date fromDate) { if (fromDate == null) { return null; } if (_compareAsDate) { - final java.util.Calendar cal = java.util.Calendar.getInstance(); + final Calendar cal = Calendar.getInstance(); cal.setTimeInMillis(fromDate.getTime()); clearCalendarHourMinuteSecondMilli(cal); - final java.util.Date cloneDate = (java.util.Date) fromDate.clone(); + final Date cloneDate = (Date) fromDate.clone(); cloneDate.setTime(cal.getTimeInMillis()); return cloneDate; } return fromDate; } - public java.util.Date filterToDate(java.util.Date toDate) { + /** + * Filter the date as To. It requires this method is called before + * getToDateConditionKey(). + * + * @param toDate The date as To. (Nullable: If the value is null, it returns + * null) + * @return The filtered date as To. (Nullable) + */ + public Date filterToDate(Date toDate) { if (toDate == null) { return null; } if (_compareAsDate) { - final java.util.Calendar cal = java.util.Calendar.getInstance(); + final Calendar cal = Calendar.getInstance(); cal.setTimeInMillis(toDate.getTime()); clearCalendarHourMinuteSecondMilli(cal); addCalendarNextDay(cal);// Key Point! - final java.util.Date cloneDate = (java.util.Date) toDate.clone(); + final Date cloneDate = (Date) toDate.clone(); cloneDate.setTime(cal.getTimeInMillis()); return cloneDate; } return toDate; } - public jp.sf.pal.timecard.db.allcommon.cbean.ckey.ConditionKey getFromDateConditionKey() { + /** + * Get the condition-key of the from-date. It requires this method is called + * after filterFromDate(). + * + * @return The condition-key of the from-date. (NotNull) + */ + public ConditionKey getFromDateConditionKey() { if (_compareAsDate) { - return jp.sf.pal.timecard.db.allcommon.cbean.ckey.ConditionKey.CK_GREATER_EQUAL; + return ConditionKey.CK_GREATER_EQUAL; } if (_fromDateGreaterThan) { - return jp.sf.pal.timecard.db.allcommon.cbean.ckey.ConditionKey.CK_GREATER_THAN;// Default - // ! + return ConditionKey.CK_GREATER_THAN;// Default! } else { - return jp.sf.pal.timecard.db.allcommon.cbean.ckey.ConditionKey.CK_GREATER_EQUAL;// Default - // ! + return ConditionKey.CK_GREATER_EQUAL;// Default! } } - public jp.sf.pal.timecard.db.allcommon.cbean.ckey.ConditionKey getToDateConditionKey() { + /** + * Get the condition-key of the to-date. It requires this method is called + * after filterToDate(). + * + * @return The condition-key of the to-date. (NotNull) + */ + public ConditionKey getToDateConditionKey() { if (_compareAsDate) { - return jp.sf.pal.timecard.db.allcommon.cbean.ckey.ConditionKey.CK_LESS_THAN; + return ConditionKey.CK_LESS_THAN; } if (_toDateLessThan) { - return jp.sf.pal.timecard.db.allcommon.cbean.ckey.ConditionKey.CK_LESS_THAN;// Default - // ! + return ConditionKey.CK_LESS_THAN;// Default! } else { - return jp.sf.pal.timecard.db.allcommon.cbean.ckey.ConditionKey.CK_LESS_EQUAL;// Default - // ! + return ConditionKey.CK_LESS_EQUAL;// Default! } } @@ -146,15 +175,15 @@ // ========= // Calendar Helper // =============== - protected void addCalendarNextDay(java.util.Calendar cal) { - cal.add(java.util.Calendar.DAY_OF_MONTH, 1); + protected void addCalendarNextDay(Calendar cal) { + cal.add(Calendar.DAY_OF_MONTH, 1); } - protected void clearCalendarHourMinuteSecondMilli(java.util.Calendar cal) { - cal.clear(java.util.Calendar.MILLISECOND); - cal.clear(java.util.Calendar.SECOND); - cal.clear(java.util.Calendar.MINUTE); - cal.set(java.util.Calendar.HOUR_OF_DAY, cal - .getActualMinimum(java.util.Calendar.HOUR_OF_DAY)); + protected void clearCalendarHourMinuteSecondMilli(Calendar cal) { + cal.clear(Calendar.MILLISECOND); + cal.clear(Calendar.SECOND); + cal.clear(Calendar.MINUTE); + cal.set(Calendar.HOUR_OF_DAY, cal + .getActualMinimum(Calendar.HOUR_OF_DAY)); } } Modified: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/cbean/coption/LikeSearchOption.java =================================================================== --- timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/cbean/coption/LikeSearchOption.java 2008-12-27 22:18:30 UTC (rev 1630) +++ timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/cbean/coption/LikeSearchOption.java 2008-12-27 22:20:25 UTC (rev 1631) @@ -4,6 +4,7 @@ import java.util.Iterator; import java.util.List; +import jp.sf.pal.timecard.db.allcommon.DBDef; import jp.sf.pal.timecard.db.allcommon.cbean.coption.parts.local.JapaneseOptionPartsAgent; /** @@ -230,6 +231,10 @@ String tmp = replace(value, _escape, _escape + _escape); tmp = replace(tmp, "%", _escape + "%"); tmp = replace(tmp, "_", _escape + "_"); + if (DBDef.isCurrentDef(DBDef.Oracle)) { + tmp = replace(tmp, "\uff05", _escape + "\uff05"); + tmp = replace(tmp, "\uff3f", _escape + "\uff3f"); + } value = tmp; } final String wildCard = "%"; Modified: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/cbean/cvalue/ConditionValue.java =================================================================== --- timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/cbean/cvalue/ConditionValue.java 2008-12-27 22:18:30 UTC (rev 1630) +++ timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/cbean/cvalue/ConditionValue.java 2008-12-27 22:20:25 UTC (rev 1631) @@ -6,9 +6,10 @@ import jp.sf.pal.timecard.db.allcommon.cbean.coption.InScopeOption; import jp.sf.pal.timecard.db.allcommon.cbean.coption.LikeSearchOption; +import jp.sf.pal.timecard.db.allcommon.util.SimpleTypeUtil; /** - * Condition value. + * Condition-value. * * @author DBFlute(AutoGenerator) */ @@ -578,110 +579,9 @@ //========================================================================== // ========= - // Like Search - // =========== - /** Value of likeSearch. */ - protected List _likeSearch; - - /** Value of likeSearch for spare. */ - protected List _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(); - _likeSearch4Spare = new ArrayList(); - } - if (_likeSearch.isEmpty() && !_likeSearch4Spare.isEmpty()) { - for (int index = 0; index < _likeSearch4Spare.size(); index++) { - _likeSearch.add(_likeSearch4Spare.get(index)); - } - } - LikeSearchValue likeSearchValue = new LikeSearchValue(value, option); - _likeSearch.add(likeSearchValue); - _likeSearch4Spare.add(likeSearchValue); - return this; - } - - /** Location of likeSearch. */ - protected String _likeSearchLocation; - - /** - * Get the location of likeSearch. - * - * @return The location of likeSearch. (Nullable) - */ - public String getLikeSearchLocation() { - return _likeSearchLocation; - } - - /** - * Set the location of likeSearch. - * - * @param location The location of likeSearch. (Nullable) - * @return this. (NotNull) - */ - public ConditionValue setLikeSearchLocation(String location) { - _likeSearchLocation = location; - return this; - } - - protected static class LikeSearchValue { - protected String _value; - - protected LikeSearchOption _option; - - public LikeSearchValue(String value, LikeSearchOption option) { - _value = value; - _option = option; - } - - public String getValue() { - return _value; - } - - public LikeSearchOption getOption() { - return _option; - } - - public String generateRealValue() { - if (_option == null) { - return _value; - } - return _option.generateRealValue(_value); - } - } - - //========================================================================== - // ========= // In Scope // ======== - /** Value of inScope. */ + /** The value of inScope. */ protected List _inScope; protected InScopeOption _inScopeOption; @@ -774,7 +674,7 @@ // ========= // Not In Scope // ============ - /** Value of notInScope. */ + /** The value of notInScope. */ protected List _notInScope; /** @@ -852,6 +752,207 @@ //========================================================================== // ========= + // Like Search + // =========== + /** The value of likeSearch. */ + protected List _likeSearch; + + /** The value of likeSearch for spare. */ + protected List _likeSearch4Spare; + + /** + * Get the value of likeSearch. + * + * @return The value of likeSearch. (Nullable) + */ + public String getLikeSearch() { + if (_likeSearch == null) { + return null; + } + if (_likeSearch.isEmpty() && !_likeSearch4Spare.isEmpty()) { + for (int index = 0; index < _likeSearch4Spare.size(); index++) { + _likeSearch.add(_likeSearch4Spare.get(index)); + } + } + final LikeSearchValue likeSearchValue = _likeSearch.remove(0); + return (String) filterValue(likeSearchValue.generateRealValue()); + } + + /** + * Set the value of likeSearch. + * + * @param value The value of likeSearch. (Nullable) + * @param option The option of likeSearch. (Nullable) + * @return this. (NotNull) + */ + public ConditionValue setLikeSearch(String value, LikeSearchOption option) { + if (_likeSearch == null) { + _likeSearch = new ArrayList(); + _likeSearch4Spare = new ArrayList(); + } + if (_likeSearch.isEmpty() && !_likeSearch4Spare.isEmpty()) { + for (int index = 0; index < _likeSearch4Spare.size(); index++) { + _likeSearch.add(_likeSearch4Spare.get(index)); + } + } + LikeSearchValue likeSearchValue = new LikeSearchValue(value, option); + _likeSearch.add(likeSearchValue); + _likeSearch4Spare.add(likeSearchValue); + return this; + } + + /** Location of likeSearch. */ + protected String _likeSearchLocation; + + /** + * Get the location of likeSearch. + * + * @return The location of likeSearch. (Nullable) + */ + public String getLikeSearchLocation() { + return _likeSearchLocation; + } + + /** + * Set the location of likeSearch. + * + * @param location The location of likeSearch. (Nullable) + * @return this. (NotNull) + */ + public ConditionValue setLikeSearchLocation(String location) { + _likeSearchLocation = location; + return this; + } + + protected static class LikeSearchValue { + protected String _value; + + protected LikeSearchOption _option; + + public LikeSearchValue(String value, LikeSearchOption option) { + _value = value; + _option = option; + } + + public String getValue() { + return _value; + } + + public LikeSearchOption getOption() { + return _option; + } + + public String generateRealValue() { + if (_option == null) { + return _value; + } + return _option.generateRealValue(_value); + } + } + + //========================================================================== + // ========= + // Not Like Search + // =============== + /** The value of notLikeSearch. */ + protected List _notLikeSearch; + + /** The value of notLikeSearch for spare. */ + protected List _notLikeSearch4Spare; + + /** + * Get the value of notLikeSearch. + * + * @return The value of notLikeSearch. (Nullable) + */ + public String getNotLikeSearch() { + if (_notLikeSearch == null) { + return null; + } + if (_notLikeSearch.isEmpty() && !_notLikeSearch4Spare.isEmpty()) { + for (int index = 0; index < _notLikeSearch4Spare.size(); index++) { + _notLikeSearch.add(_notLikeSearch4Spare.get(index)); + } + } + final NotLikeSearchValue notLikeSearchValue = _notLikeSearch.remove(0); + return (String) filterValue(notLikeSearchValue.generateRealValue()); + } + + /** + * Set the value of notLikeSearch. + * + * @param value The value of notLikeSearch. (Nullable) + * @param option The option of notLikeSearch. (Nullable) + * @return this. (NotNull) + */ + public ConditionValue setNotLikeSearch(String value, LikeSearchOption option) { + if (_notLikeSearch == null) { + _notLikeSearch = new ArrayList(); + _notLikeSearch4Spare = new ArrayList(); + } + if (_notLikeSearch.isEmpty() && !_notLikeSearch4Spare.isEmpty()) { + for (int index = 0; index < _notLikeSearch4Spare.size(); index++) { + _notLikeSearch.add(_notLikeSearch4Spare.get(index)); + } + } + NotLikeSearchValue notLikeSearchValue = new NotLikeSearchValue(value, + option); + _notLikeSearch.add(notLikeSearchValue); + _notLikeSearch4Spare.add(notLikeSearchValue); + return this; + } + + /** Location of notLikeSearch. */ + protected String _notLikeSearchLocation; + + /** + * Get the location of notLikeSearch. + * + * @return The location of notLikeSearch. (Nullable) + */ + public String getNotLikeSearchLocation() { + return _notLikeSearchLocation; + } + + /** + * Set the location of notLikeSearch. + * + * @param location The location of notLikeSearch. (Nullable) + * @return this. (NotNull) + */ + public ConditionValue setNotLikeSearchLocation(String location) { + _notLikeSearchLocation = location; + return this; + } + + protected static class NotLikeSearchValue { + protected String _value; + + protected LikeSearchOption _option; + + public NotLikeSearchValue(String value, LikeSearchOption option) { + _value = value; + _option = option; + } + + public String getValue() { + return _value; + } + + public LikeSearchOption getOption() { + return _option; + } + + public String generateRealValue() { + if (_option == null) { + return _value; + } + return _option.generateRealValue(_value); + } + } + + //========================================================================== + // ========= // Is Null // ======= /** Value of isNull. */ @@ -976,8 +1077,8 @@ * Filter value. If the value is instance of java.util.Date or * java.util.Calendar, returns value as java.sql.Date. * - * @param value Value. (Nullable) - * @return Filtered value. (Nullable) + * @param value The value. (Nullable) + * @return The filtered value. (Nullable) */ protected Object filterValue(Object value) { if (value == null) { @@ -991,18 +1092,18 @@ } if (value instanceof java.util.Date || value instanceof java.util.Calendar) { - return SqlDateConversionUtil.toDate(value); + return SimpleTypeUtil.toSqlDate(value); } else { return value; } } /** - * Filter value. If the value is instance of java.util.Date or + * Filter the list of value. If the value is instance of java.util.Date or * java.util.Calendar, returns value as java.sql.Date. * - * @param valueList Value-list. (Nullable) - * @return Filtered value-list. (Nullable) + * @param valueList The list of value. (Nullable) + * @return The filtered list of value. (Nullable) */ protected List filterValue(List valueList) { if (valueList == null || valueList.isEmpty()) { @@ -1015,204 +1116,4 @@ } return resultList; } - - protected static class SqlDateConversionUtil { - - private SqlDateConversionUtil() { - } - - public static java.sql.Date toDate(Object o) { - return toDate(o, null); - } - - public static java.sql.Date toDate(Object o, String pattern) { - if (o instanceof java.sql.Date) { - return (java.sql.Date) o; - } - java.util.Date date = DateConversionUtil.toDate(o, pattern); - if (date != null) { - return new java.sql.Date(date.getTime()); - } - return null; - } - } - - protected static class DateConversionUtil { - - private DateConversionUtil() { - } - - public static java.util.Date toDate(Object o) { - return toDate(o, null); - } - - public static java.util.Date toDate(Object o, String pattern) { - if (o == null) { - return null; - } else if (o instanceof String) { - return toDate((String) o, pattern); - } else if (o instanceof java.util.Date) { - return (java.util.Date) o; - } else if (o instanceof java.util.Calendar) { - return ((java.util.Calendar) o).getTime(); - } else { - return toDate(o.toString(), pattern); - } - } - - public static java.util.Date toDate(String s, String pattern) { - return toDate(s, pattern, java.util.Locale.getDefault()); - } - - public static java.util.Date toDate(String s, String pattern, - java.util.Locale locale) { - java.text.SimpleDateFormat sdf = getDateFormat(s, pattern, locale); - try { - return sdf.parse(s); - } catch (java.text.ParseException ex) { - throw new RuntimeException(ex); - } - } - - public static java.text.SimpleDateFormat getDateFormat(String s, - String pattern, java.util.Locale locale) { - if (pattern != null) { - return new java.text.SimpleDateFormat(pattern); - } - return getDateFormat(s, locale); - } - - public static java.text.SimpleDateFormat getDateFormat(String s, - java.util.Locale locale) { - String pattern = getPattern(locale); - String shortPattern = removeDelimiter(pattern); - String delimitor = findDelimiter(s); - if (delimitor == null) { - if (s.length() == shortPattern.length()) { - return new java.text.SimpleDateFormat(shortPattern); - } - if (s.length() == shortPattern.length() + 2) { - return new java.text.SimpleDateFormat(InternalStringUtil - .replace(shortPattern, "yy", "yyyy")); - } - } else { - String[] array = InternalStringUtil.split(s, delimitor); - for (int i = 0; i < array.length; ++i) { - if (array[i].length() == 4) { - pattern = InternalStringUtil.replace(pattern, "yy", - "yyyy"); - break; - } - } - return new java.text.SimpleDateFormat(pattern); - } - return new java.text.SimpleDateFormat(); - } - - public static java.text.SimpleDateFormat getDateFormat( - java.util.Locale locale) { - return new java.text.SimpleDateFormat(getPattern(locale)); - } - - public static java.text.SimpleDateFormat getY4DateFormat( - java.util.Locale locale) { - return new java.text.SimpleDateFormat(getY4Pattern(locale)); - } - - public static String getY4Pattern(java.util.Locale locale) { - String pattern = getPattern(locale); - if (pattern.indexOf("yyyy") < 0) { - pattern = InternalStringUtil.replace(pattern, "yy", "yyyy"); - } - return pattern; - } - - public static String getPattern(java.util.Locale locale) { - java.text.SimpleDateFormat df = (java.text.SimpleDateFormat) java.text.DateFormat - .getDateInstance(java.text.DateFormat.SHORT, locale); - String pattern = df.toPattern(); - int index = pattern.indexOf(' '); - if (index > 0) { - pattern = pattern.substring(0, index); - } - if (pattern.indexOf("MM") < 0) { - pattern = InternalStringUtil.replace(pattern, "M", "MM"); - } - if (pattern.indexOf("dd") < 0) { - pattern = InternalStringUtil.replace(pattern, "d", "dd"); - } - return pattern; - } - - public static String findDelimiter(String value) { - for (int i = 0; i < value.length(); ++i) { - char c = value.charAt(i); - if (Character.isDigit(c)) { - continue; - } - return Character.toString(c); - } - return null; - } - - public static String removeDelimiter(String pattern) { - StringBuffer buf = new StringBuffer(); - for (int i = 0; i < pattern.length(); ++i) { - char c = pattern.charAt(i); - if (c == 'y' || c == 'M' || c == 'd') { - buf.append(c); - } - } - return buf.toString(); - } - } - - protected static class InternalStringUtil { - public static final String[] EMPTY_STRINGS = new String[0]; - - private InternalStringUtil() { - } - - public static final boolean isEmpty(String text) { - return text == null || text.length() == 0; - } - - public static final String replace(String text, String fromText, - String toText) { - if (text == null || fromText == null || toText == null) { - return null; - } - StringBuffer buf = new StringBuffer(100); - int pos = 0; - int pos2 = 0; - while (true) { - pos = text.indexOf(fromText, pos2); - if (pos == 0) { - buf.append(toText); - pos2 = fromText.length(); - } else if (pos > 0) { - buf.append(text.substring(pos2, pos)); - buf.append(toText); - pos2 = pos + fromText.length(); - } else { - buf.append(text.substring(pos2)); - break; - } - } - return buf.toString(); - } - - public static String[] split(String str, String delim) { - if (str == null) { - return EMPTY_STRINGS; - } - List list = new java.util.ArrayList(); - java.util.StringTokenizer st = new java.util.StringTokenizer(str, - delim); - while (st.hasMoreElements()) { - list.add(st.nextToken()); - } - return (String[]) list.toArray(new String[list.size()]); - } - } } Modified: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/cbean/outsidesql/OutsideSqlContext.java =================================================================== --- timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/cbean/outsidesql/OutsideSqlContext.java 2008-12-27 22:18:30 UTC (rev 1630) +++ timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/cbean/outsidesql/OutsideSqlContext.java 2008-12-27 22:20:25 UTC (rev 1631) @@ -1,17 +1,21 @@ package jp.sf.pal.timecard.db.allcommon.cbean.outsidesql; +import java.io.BufferedReader; +import java.io.IOException; +import java.io.InputStream; +import java.io.InputStreamReader; +import java.io.Reader; + import jp.sf.pal.timecard.db.allcommon.DBFluteConfig; import jp.sf.pal.timecard.db.allcommon.dbmeta.DBMeta; import jp.sf.pal.timecard.db.allcommon.dbmeta.DBMetaInstanceHandler; import jp.sf.pal.timecard.db.allcommon.jdbc.StatementConfig; +import jp.sf.pal.timecard.db.allcommon.util.SimpleResourceUtil; import jp.sf.pal.timecard.db.allcommon.util.SimpleStringUtil; import jp.sf.pal.timecard.db.allcommon.util.SimpleSystemUtil; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; -import org.seasar.framework.util.InputStreamReaderUtil; -import org.seasar.framework.util.ReaderUtil; -import org.seasar.framework.util.ResourceUtil; /** * The context of outside-SQL. @@ -33,7 +37,7 @@ /** * Get outside-SQL context on thread. * - * @return Outside-SQL context. (Nullable) + * @return The context of outside-SQL. (Nullable) */ public static OutsideSqlContext getOutsideSqlContextOnThread() { return (OutsideSqlContext) _threadLocal.get(); @@ -42,7 +46,7 @@ /** * Set outside-SQL context on thread. * - * @param outsideSqlContext Outside-SQL context. (NotNull) + * @param outsideSqlContext The context of outside-SQL. (NotNull) */ public static void setOutsideSqlContextOnThread( OutsideSqlContext outsideSqlContext) { @@ -54,7 +58,7 @@ } /** - * Is existing outside-SQL context on thread? + * Is existing the context of outside-SQL on thread? * * @return Determination. */ @@ -63,7 +67,7 @@ } /** - * Clear outside-SQL context on thread. + * Clear the context of outside-SQL on thread. */ public static void clearOutsideSqlContextOnThread() { _threadLocal.set(null); @@ -77,12 +81,20 @@ String methodName, String path, Object pmb, OutsideSqlOption option, Object resultTypeSpecification) { final String pmbKey = (pmb != null ? pmb.getClass().getName() : "null"); - final String resultKey = (resultTypeSpecification != null ? ":" - + resultTypeSpecification : "null"); + final String resultKey; + if (resultTypeSpecification != null) { + if (resultTypeSpecification instanceof Class) { + resultKey = ((Class) resultTypeSpecification).getName(); + } else { + resultKey = resultTypeSpecification.toString(); + } + } else { + resultKey = "null"; + } final String tableDbName = option.getTableDbName(); final String generatedUniqueKey = option.generateUniqueKey(); - return methodName + "():" + tableDbName + ":" + path + ":" + pmbKey - + ":" + generatedUniqueKey + resultKey; + return tableDbName + ":" + methodName + "():" + path + ":" + pmbKey + + ":" + generatedUniqueKey + ":" + resultKey; } //========================================================================== @@ -116,18 +128,9 @@ // Attribute // ========= // ----------------------------------------------------- - // Common of OutsideSql - // -------------------- - protected boolean _dynamicBinding; - - protected boolean _offsetByCursorForcedly; - - protected boolean _limitByCursorForcedly; - - // ----------------------------------------------------- - // Specified OutsideSql - // -------------------- - /** The path of outside-sql. (The mark of Specified-OutsideSql) */ + // Basic + // ----- + /** The path of outside-SQL. (The mark of specified outside-SQL) */ protected String _outsideSqlPath; protected Object _parameterBean; @@ -136,12 +139,23 @@ protected String _methodName; - /** The config of statement. (Nullable) */ + /** The configuration of statement. (Nullable) */ protected StatementConfig _statementConfig; /** The DB name of table for using behavior-SQL-path. (Nullable) */ protected String _tableDbName; + // ----------------------------------------------------- + // Option + // ------ + protected boolean _dynamicBinding; + + protected boolean _offsetByCursorForcedly; + + protected boolean _limitByCursorForcedly; + + protected boolean _autoPagingLogging; // for logging + //========================================================================== // ========= // Read SQL @@ -200,7 +214,7 @@ } /** - * Read outside-sql path. Required attribute is 'outsideSqlPath'. + * Read outside-SQL path. Required attribute is 'outsideSqlPath'. * * @param sqlFileEncoding The encoding of SQL file. (NotNull) * @param dbmsSuffix The suffix of DBMS. (NotNull) @@ -214,6 +228,13 @@ String sql; if (isExistResource(dbmsPath)) { sql = readText(dbmsPath, sqlFileEncoding); + } else if ("_postgresql".equals(dbmsSuffix) + && isExistResource("_postgre")) { + sql = readText("_postgre", sqlFileEncoding); // Patch for name + // difference + } else if ("_sqlserver".equals(dbmsSuffix) && isExistResource("_mssql")) { + sql = readText("_mssql", sqlFileEncoding); // Patch for name + // difference } else if (isExistResource(standardPath)) { sql = readText(standardPath, sqlFileEncoding); } else { @@ -324,16 +345,46 @@ // General Helper // ============== protected boolean isExistResource(String path) { - return ResourceUtil.isExist(path); + return SimpleResourceUtil.isExist(path); } protected String readText(final String path, String sqlFileEncoding) { - final java.io.InputStream is = ResourceUtil.getResourceAsStream(path); - final java.io.Reader reader = InputStreamReaderUtil.create(is, - sqlFileEncoding); - return ReaderUtil.readText(reader); + final InputStream ins = SimpleResourceUtil.getResourceStream(path); + final Reader reader = createInputStreamReader(ins, sqlFileEncoding); + return readText(reader); } + protected Reader createInputStreamReader(InputStream ins, String encoding) { + try { + return new InputStreamReader(ins, encoding); + } catch (IOException e) { + String msg = "Failed to create the reader of the input stream:"; + msg = msg + " ins=" + ins + " encoding=" + encoding; + throw new IllegalStateException(msg, e); + } + } + + public String readText(Reader reader) { + final BufferedReader bfreader = new BufferedReader(reader); + final StringBuilder out = new StringBuilder(100); + try { + try { + final char[] buf = new char[8192]; + int n; + while ((n = bfreader.read(buf)) >= 0) { + out.append(buf, 0, n); + } + } finally { + bfreader.close(); + } + } catch (IOException e) { + String msg = "Failed to read the input stream:"; + msg = msg + " bfreader=" + bfreader + " reader=" + reader; + throw new IllegalStateException(msg, e); + } + return out.toString(); + } + protected static String replaceString(String text, String fromText, String toText) { return SimpleStringUtil.replace(text, fromText, toText); @@ -348,35 +399,8 @@ // Accessor // ======== // ----------------------------------------------------- - // Common of OutsideSql - // -------------------- - public boolean isDynamicBinding() { - return _dynamicBinding; - } - - public void setDynamicBinding(boolean dynamicBinding) { - this._dynamicBinding = dynamicBinding; - } - - public boolean isOffsetByCursorForcedly() { - return _offsetByCursorForcedly; - } - - public void setOffsetByCursorForcedly(boolean offsetByCursorForcedly) { - this._offsetByCursorForcedly = offsetByCursorForcedly; - } - - public boolean isLimitByCursorForcedly() { - return _limitByCursorForcedly; - } - - public void setLimitByCursorForcedly(boolean limitByCursorForcedly) { - this._limitByCursorForcedly = limitByCursorForcedly; - } - - // ----------------------------------------------------- - // Specified OutsideSql - // -------------------- + // Basic + // ----- public String getOutsideSqlPath() { return _outsideSqlPath; } @@ -424,4 +448,39 @@ public void setTableDbName(String tableDbName) { this._tableDbName = tableDbName; } + + // ----------------------------------------------------- + // Option + // ------ + public boolean isDynamicBinding() { + return _dynamicBinding; + } + + public void setDynamicBinding(boolean dynamicBinding) { + this._dynamicBinding = dynamicBinding; + } + + public boolean isOffsetByCursorForcedly() { + return _offsetByCursorForcedly; + } + + public void setOffsetByCursorForcedly(boolean offsetByCursorForcedly) { + this._offsetByCursorForcedly = offsetByCursorForcedly; + } + + public boolean isLimitByCursorForcedly() { + return _limitByCursorForcedly; + } + + public void setLimitByCursorForcedly(boolean limitByCursorForcedly) { + this._limitByCursorForcedly = limitByCursorForcedly; + } + + public boolean isAutoPagingLogging() { // for logging + return _autoPagingLogging; + } + + public void setAutoPagingLogging(boolean autoPagingLogging) { // for logging + this._autoPagingLogging = autoPagingLogging; + } } Modified: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/cbean/outsidesql/OutsideSqlOption.java =================================================================== --- timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/cbean/outsidesql/OutsideSqlOption.java 2008-12-27 22:18:30 UTC (rev 1630) +++ timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/cbean/outsidesql/OutsideSqlOption.java 2008-12-27 22:20:25 UTC (rev 1631) @@ -16,6 +16,7 @@ // ----------------------------------------------------- // Option // ------ + /** The request type of paging. */ protected String _pagingRequestType = "non"; protected boolean _dynamicBinding; @@ -23,6 +24,8 @@ /** The configuration of statement. (Nullable) */ protected StatementConfig _statementConfig; + protected String _sourcePagingRequestType = "non"; + // ----------------------------------------------------- // Information // ----------- @@ -59,6 +62,7 @@ // ==== public OutsideSqlOption copyOptionWithoutPaging() { final OutsideSqlOption copyOption = new OutsideSqlOption(); + copyOption.setPagingSourceRequestType(_pagingRequestType); if (isDynamicBinding()) { copyOption.dynamicBinding(); } @@ -103,6 +107,15 @@ _statementConfig = statementConfig; } + protected void setPagingSourceRequestType(String sourcePagingRequestType) { // Very + // Internal + _sourcePagingRequestType = sourcePagingRequestType; + } + + public boolean isSourcePagingRequestTypeAuto() { // Very Internal + return "auto".equals(_sourcePagingRequestType); + } + // ----------------------------------------------------- // Information // ----------- Modified: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/cbean/outsidesql/executor/OutsideSqlBasicExecutor.java =================================================================== --- timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/cbean/outsidesql/executor/OutsideSqlBasicExecutor.java 2008-12-27 22:18:30 UTC (rev 1630) +++ timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/cbean/outsidesql/executor/OutsideSqlBasicExecutor.java 2008-12-27 22:20:25 UTC (rev 1631) @@ -2,15 +2,20 @@ import java.util.List; +import jp.sf.pal.timecard.db.allcommon.bhv.core.BehaviorCommand; +import jp.sf.pal.timecard.db.allcommon.bhv.core.BehaviorCommandInvoker; +import jp.sf.pal.timecard.db.allcommon.bhv.core.command.AbstractOutsideSqlCommand; +import jp.sf.pal.timecard.db.allcommon.bhv.core.command.OutsideSqlCallCommand; +import jp.sf.pal.timecard.db.allcommon.bhv.core.command.OutsideSqlExecuteCommand; +import jp.sf.pal.timecard.db.allcommon.bhv.core.command.OutsideSqlSelectListCommand; import jp.sf.pal.timecard.db.allcommon.cbean.ListResultBean; import jp.sf.pal.timecard.db.allcommon.cbean.ResultBeanBuilder; -import jp.sf.pal.timecard.db.allcommon.cbean.outsidesql.OutsideSqlDao; import jp.sf.pal.timecard.db.allcommon.cbean.outsidesql.OutsideSqlOption; import jp.sf.pal.timecard.db.allcommon.cbean.outsidesql.ProcedurePmb; import jp.sf.pal.timecard.db.allcommon.jdbc.StatementConfig; /** - * The executor of outside-sql.
+ * The executor of outside-SQL.
* *
  * {Basic}
@@ -33,7 +38,6 @@
  * 
  * {Option -- Dynamic}
  *   o dynamicBinding().selectList()
- * 
  * 
* * @author DBFlute(AutoGenerator) @@ -44,8 +48,8 @@ // ========= // Attribute // ========= - /** The DAO of outside-sql. (NotNull) */ - protected final OutsideSqlDao _outsideSqlDao; + /** The invoker of behavior command. (NotNull) */ + protected final BehaviorCommandInvoker _behaviorCommandInvoker; /** Table DB name. (NotNull) */ protected final String _tableDbName; @@ -60,9 +64,9 @@ // ========= // Constructor // =========== - public OutsideSqlBasicExecutor(OutsideSqlDao outsideSqlDao, - String tableDbName) { - this._outsideSqlDao = outsideSqlDao; + public OutsideSqlBasicExecutor( + BehaviorCommandInvoker behaviorCommandInvoker, String tableDbName) { + this._behaviorCommandInvoker = behaviorCommandInvoker; this._tableDbName = tableDbName; } @@ -80,12 +84,12 @@ * @param entityType The element type of entity. (NotNull) * @return The result bean of selected list. (NotNull) * @exception jp.sf.pal.timecard.db.allcommon.exception.OutsideSqlNotFoundException - * When the outside-sql is not found. + * When the outside-SQL is not found. */ public ListResultBean selectList(String path, Object pmb, Class entityType) { - List resultList = _outsideSqlDao.selectList(path, pmb, - createOutsideSqlOption(), entityType); + List resultList = invoke(createSelectListCommand(path, pmb, + entityType)); return new ResultBeanBuilder(_tableDbName) .buildListResultBean(resultList); } @@ -102,10 +106,10 @@ * object. (Nullable) * @return The count of execution. * @exception jp.sf.pal.timecard.db.allcommon.exception.OutsideSqlNotFoundException - * When the outside-sql is not found. + * When the outside-SQL is not found. */ public int execute(String path, Object pmb) { - return _outsideSqlDao.execute(path, pmb, createOutsideSqlOption()); + return invoke(createExecuteCommand(path, pmb)); } // [DBFlute-0.7.5] @@ -123,12 +127,53 @@ throw new IllegalArgumentException( "The argument of call() 'pmb' should not be null!"); } - _outsideSqlDao.call(pmb.getProcedureName(), pmb, - createOutsideSqlOption()); + invoke(createCallCommand(pmb.getProcedureName(), pmb)); } //========================================================================== // ========= + // Behavior Command + // ================ + protected BehaviorCommand> createSelectListCommand( + String path, Object pmb, Class entityType) { + final OutsideSqlSelectListCommand cmd = xsetupCommand( + new OutsideSqlSelectListCommand(), path, pmb); + cmd.setEntityType(entityType); + return cmd; + } + + protected BehaviorCommand createExecuteCommand(String path, + Object pmb) { + return xsetupCommand(new OutsideSqlExecuteCommand(), path, pmb); + } + + protected BehaviorCommand createCallCommand(String path, Object pmb) { + return xsetupCommand(new OutsideSqlCallCommand(), path, pmb); + } + + private > COMMAND xsetupCommand( + COMMAND command, String path, Object pmb) { + command.setTableDbName(_tableDbName); + _behaviorCommandInvoker.injectComponentProperty(command); + command.setOutsideSqlPath(path); + command.setParameterBean(pmb); + command.setOutsideSqlOption(createOutsideSqlOption()); + return command; + } + + /** + * Invoke the command of behavior. + * + * @param The type of result. + * @param behaviorCommand The command of behavior. (NotNull) + * @return The instance of result. (Nullable) + */ + protected RESULT invoke(BehaviorCommand behaviorCommand) { + return _behaviorCommandInvoker.invoke(behaviorCommand); + } + + //========================================================================== + // ========= // Option // ====== // ----------------------------------------------------- @@ -144,11 +189,11 @@ * # * * - * @return The cursor executor of outside-sql. (NotNull) + * @return The cursor executor of outside-SQL. (NotNull) */ public OutsideSqlCursorExecutor cursorHandling() { - return new OutsideSqlCursorExecutor(_outsideSqlDao, - createOutsideSqlOption()); + return new OutsideSqlCursorExecutor(_behaviorCommandInvoker, + createOutsideSqlOption(), _tableDbName); } /** @@ -161,11 +206,11 @@ * # * * - * @return The cursor executor of outside-sql. (NotNull) + * @return The cursor executor of outside-SQL. (NotNull) */ public OutsideSqlEntityExecutor entityHandling() { - return new OutsideSqlEntityExecutor(_outsideSqlDao, - createOutsideSqlOption()); + return new OutsideSqlEntityExecutor(_behaviorCommandInvoker, + createOutsideSqlOption(), _tableDbName); } // ----------------------------------------------------- @@ -191,7 +236,7 @@ public OutsideSqlPagingExecutor autoPaging() { final OutsideSqlOption option = createOutsideSqlOption(); option.autoPaging(); - return new OutsideSqlPagingExecutor(_outsideSqlDao, option, + return new OutsideSqlPagingExecutor(_behaviorCommandInvoker, option, _tableDbName); } @@ -215,7 +260,7 @@ public OutsideSqlPagingExecutor manualPaging() { final OutsideSqlOption option = createOutsideSqlOption(); option.manualPaging(); - return new OutsideSqlPagingExecutor(_outsideSqlDao, option, + return new OutsideSqlPagingExecutor(_behaviorCommandInvoker, option, _tableDbName); } Modified: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/cbean/outsidesql/executor/OutsideSqlCursorExecutor.java =================================================================== --- timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/cbean/outsidesql/executor/OutsideSqlCursorExecutor.java 2008-12-27 22:18:30 UTC (rev 1630) +++ timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/cbean/outsidesql/executor/OutsideSqlCursorExecutor.java 2008-12-27 22:20:25 UTC (rev 1631) @@ -1,12 +1,14 @@ package jp.sf.pal.timecard.db.allcommon.cbean.outsidesql.executor; -import jp.sf.pal.timecard.db.allcommon.cbean.outsidesql.OutsideSqlDao; +import jp.sf.pal.timecard.db.allcommon.bhv.core.BehaviorCommand; +import jp.sf.pal.timecard.db.allcommon.bhv.core.BehaviorCommandInvoker; +import jp.sf.pal.timecard.db.allcommon.bhv.core.command.OutsideSqlSelectCursorCommand; import jp.sf.pal.timecard.db.allcommon.cbean.outsidesql.OutsideSqlOption; import jp.sf.pal.timecard.db.allcommon.jdbc.CursorHandler; import jp.sf.pal.timecard.db.allcommon.jdbc.StatementConfig; /** - * The cursor executor of outside-sql. + * The cursor executor of outside-SQL. * * @param The type of parameter-bean. * @author DBFlute(AutoGenerator) @@ -17,18 +19,25 @@ // ========= // Attribute // ========= - protected final OutsideSqlDao _outsideSqlDao; + /** The invoker of behavior command. (NotNull) */ + protected final BehaviorCommandInvoker _behaviorCommandInvoker; + /** The option of outside-SQL. (NotNull) */ protected final OutsideSqlOption _outsideSqlOption; + /** The DB name of table. (NotNull) */ + protected final String _tableDbName; + //========================================================================== // ========= // Constructor // =========== - public OutsideSqlCursorExecutor(OutsideSqlDao outsideSqlDao, - OutsideSqlOption outsideSqlOption) { - this._outsideSqlDao = outsideSqlDao; + public OutsideSqlCursorExecutor( + BehaviorCommandInvoker behaviorCommandInvoker, + OutsideSqlOption outsideSqlOption, String tableDbName) { + this._behaviorCommandInvoker = behaviorCommandInvoker; this._outsideSqlOption = outsideSqlOption; + this._tableDbName = tableDbName; } //========================================================================== @@ -44,14 +53,46 @@ * @param handler The handler of cursor. (NotNull) * @return The result object that the cursor handler returns. (Nullable) * @exception jp.sf.pal.timecard.db.allcommon.exception.OutsideSqlNotFoundException - * When the outside-sql is not found. + * When the outside-SQL is not found. */ public Object selectCursor(String path, PARAMETER_BEAN pmb, CursorHandler handler) { - return _outsideSqlDao.selectCursor(path, pmb, _outsideSqlOption, + return invoke(createSelectCursorCommand(path, pmb, handler)); + } + + //========================================================================== + // ========= + // Behavior Command + // ================ + protected BehaviorCommand createSelectCursorCommand(String path, + PARAMETER_BEAN pmb, CursorHandler handler) { + return xsetupCommand(new OutsideSqlSelectCursorCommand(), path, pmb, handler); } + private OutsideSqlSelectCursorCommand xsetupCommand( + OutsideSqlSelectCursorCommand command, String path, + PARAMETER_BEAN pmb, CursorHandler handler) { + command.setTableDbName(_tableDbName); + _behaviorCommandInvoker.injectComponentProperty(command); + command.setOutsideSqlPath(path); + command.setParameterBean(pmb); + command.setOutsideSqlOption(_outsideSqlOption); + command.setCursorHandler(handler); + return command; + } + + /** + * Invoke the command of behavior. + * + * @param The type of result. + * @param behaviorCommand The command of behavior. (NotNull) + * @return The instance of result. (Nullable) + */ + protected RESULT invoke(BehaviorCommand behaviorCommand) { + return _behaviorCommandInvoker.invoke(behaviorCommand); + } + //========================================================================== // ========= // Option Modified: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/cbean/outsidesql/executor/OutsideSqlEntityExecutor.java =================================================================== --- timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/cbean/outsidesql/executor/OutsideSqlEntityExecutor.java 2008-12-27 22:18:30 UTC (rev 1630) +++ timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/cbean/outsidesql/executor/OutsideSqlEntityExecutor.java 2008-12-27 22:20:25 UTC (rev 1631) @@ -2,14 +2,16 @@ import java.util.List; +import jp.sf.pal.timecard.db.allcommon.bhv.core.BehaviorCommand; +import jp.sf.pal.timecard.db.allcommon.bhv.core.BehaviorCommandInvoker; +import jp.sf.pal.timecard.db.allcommon.bhv.core.command.OutsideSqlSelectListCommand; import jp.sf.pal.timecard.db.allcommon.cbean.ConditionBeanContext; -import jp.sf.pal.timecard.db.allcommon.cbean.outsidesql.OutsideSqlDao; import jp.sf.pal.timecard.db.allcommon.cbean.outsidesql.OutsideSqlOption; import jp.sf.pal.timecard.db.allcommon.jdbc.StatementConfig; import jp.sf.pal.timecard.db.allcommon.util.SimpleSystemUtil; /** - * The cursor executor of outside-sql. + * The cursor executor of outside-SQL. * * @param The type of parameter-bean. * @author DBFlute(AutoGenerator) @@ -20,18 +22,25 @@ // ========= // Attribute // ========= - protected final OutsideSqlDao _outsideSqlDao; + /** The invoker of behavior command. (NotNull) */ + protected final BehaviorCommandInvoker _behaviorCommandInvoker; + /** The option of outside-SQL. (NotNull) */ protected final OutsideSqlOption _outsideSqlOption; + /** The DB name of table. (NotNull) */ + protected final String _tableDbName; + //========================================================================== // ========= // Constructor // =========== - public OutsideSqlEntityExecutor(OutsideSqlDao outsideSqlDao, - OutsideSqlOption outsideSqlOption) { - this._outsideSqlDao = outsideSqlDao; + public OutsideSqlEntityExecutor( + BehaviorCommandInvoker behaviorCommandInvoker, + OutsideSqlOption outsideSqlOption, String tableDbName) { + this._behaviorCommandInvoker = behaviorCommandInvoker; this._outsideSqlOption = outsideSqlOption; + this._tableDbName = tableDbName; } //========================================================================== @@ -48,14 +57,14 @@ * @param entityType The type of entity. (NotNull) * @return The selected entity. (Nullable) * @exception jp.sf.pal.timecard.db.allcommon.exception.OutsideSqlNotFoundException - * When the outside-sql is not found. + * When the outside-SQL is not found. * @exception jp.sf.pal.timecard.db.allcommon.exception.EntityDuplicatedException * When the entity is duplicated. */ public ENTITY selectEntity(String path, PARAMETER_BEAN pmb, Class entityType) { - final List ls = _outsideSqlDao.selectList(path, pmb, - _outsideSqlOption, entityType); + final List ls = invoke(createSelectListCommand(path, pmb, + entityType)); if (ls.isEmpty()) { return null; } @@ -76,7 +85,7 @@ * @param entityType The type of entity. (NotNull) * @return The selected entity. (Nullable) * @exception jp.sf.pal.timecard.db.allcommon.exception.OutsideSqlNotFoundException - * When the outside-sql is not found. + * When the outside-SQL is not found. * @exception jp.sf.pal.timecard.db.allcommon.exception.EntityAlreadyDeletedException * When the entity has already been deleted(not found). * @exception jp.sf.pal.timecard.db.allcommon.exception.EntityDuplicatedException @@ -84,8 +93,8 @@ */ public ENTITY selectEntityWithDeletedCheck(String path, PARAMETER_BEAN pmb, Class entityType) { - final List ls = _outsideSqlDao.selectList(path, pmb, - _outsideSqlOption, entityType); + final List ls = invoke(createSelectListCommand(path, pmb, + entityType)); if (ls == null || ls.isEmpty()) { throwEntityAlreadyDeletedException(buildSearch4LogString(path, pmb, entityType)); @@ -127,6 +136,39 @@ //========================================================================== // ========= + // Behavior Command + // ================ + protected BehaviorCommand> createSelectListCommand( + String path, PARAMETER_BEAN pmb, Class entityType) { + return xsetupCommand(new OutsideSqlSelectListCommand(), path, + pmb, entityType); + } + + private OutsideSqlSelectListCommand xsetupCommand( + OutsideSqlSelectListCommand command, String path, + PARAMETER_BEAN pmb, Class entityType) { + command.setTableDbName(_tableDbName); + _behaviorCommandInvoker.injectComponentProperty(command); + command.setOutsideSqlPath(path); + command.setParameterBean(pmb); + command.setOutsideSqlOption(_outsideSqlOption); + command.setEntityType(entityType); + return command; + } + + /** + * Invoke the command of behavior. + * + * @param The type of result. + * @param behaviorCommand The command of behavior. (NotNull) + * @return The instance of result. (Nullable) + */ + protected RESULT invoke(BehaviorCommand behaviorCommand) { + return _behaviorCommandInvoker.invoke(behaviorCommand); + } + + //========================================================================== + // ========= // Option // ====== public OutsideSqlEntityExecutor configure( Modified: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/cbean/outsidesql/executor/OutsideSqlPagingExecutor.java =================================================================== --- timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/cbean/outsidesql/executor/OutsideSqlPagingExecutor.java 2008-12-27 22:18:30 UTC (rev 1630) +++ timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/cbean/outsidesql/executor/OutsideSqlPagingExecutor.java 2008-12-27 22:20:25 UTC (rev 1631) @@ -3,18 +3,20 @@ import java.util.List; import jp.sf.pal.timecard.db.allcommon.DBFluteConfig; +import jp.sf.pal.timecard.db.allcommon.bhv.core.BehaviorCommand; +import jp.sf.pal.timecard.db.allcommon.bhv.core.BehaviorCommandInvoker; +import jp.sf.pal.timecard.db.allcommon.bhv.core.command.OutsideSqlSelectListCommand; import jp.sf.pal.timecard.db.allcommon.cbean.ListResultBean; import jp.sf.pal.timecard.db.allcommon.cbean.PagingBean; import jp.sf.pal.timecard.db.allcommon.cbean.PagingHandler; import jp.sf.pal.timecard.db.allcommon.cbean.PagingInvoker; import jp.sf.pal.timecard.db.allcommon.cbean.PagingResultBean; import jp.sf.pal.timecard.db.allcommon.cbean.ResultBeanBuilder; -import jp.sf.pal.timecard.db.allcommon.cbean.outsidesql.OutsideSqlDao; import jp.sf.pal.timecard.db.allcommon.cbean.outsidesql.OutsideSqlOption; import jp.sf.pal.timecard.db.allcommon.jdbc.StatementConfig; /** - * The paging executor of outsideSql. + * The paging executor of outside-SQL. * * @author DBFlute(AutoGenerator) */ @@ -24,10 +26,10 @@ // ========= // Attribute // ========= - /** The DAO of outsideSql. (NotNull) */ - protected final OutsideSqlDao _outsideSqlDao; + /** The invoker of behavior command. (NotNull) */ + protected final BehaviorCommandInvoker _behaviorCommandInvoker; - /** The option of outsideSql. (NotNull) */ + /** The option of outside-SQL. (NotNull) */ protected final OutsideSqlOption _outsideSqlOption; /** The DB name of table. (NotNull) */ @@ -37,9 +39,10 @@ // ========= // Constructor // =========== - public OutsideSqlPagingExecutor(OutsideSqlDao outsideSqlDao, + public OutsideSqlPagingExecutor( + BehaviorCommandInvoker behaviorCommandInvoker, OutsideSqlOption outsideSqlOption, String tableDbName) { - this._outsideSqlDao = outsideSqlDao; + this._behaviorCommandInvoker = behaviorCommandInvoker; this._outsideSqlOption = outsideSqlOption; this._tableDbName = tableDbName; } @@ -81,13 +84,13 @@ * @param entityType The type of result entity. (NotNull) * @return The result bean of paged list. (NotNull) * @exception com.example.dbflute.basic.dbflute.allcommon.exception.OutsideSqlNotFoundException - * When the outside-sql is not found. + * When the outside-SQL is not found. */ public ListResultBean selectList(String path, PagingBean pmb, Class entityType) { setupScrollableCursorIfNeeds(); - List resultList = _outsideSqlDao.selectList(path, pmb, - _outsideSqlOption, entityType); + List resultList = invoke(createSelectListCommand(path, pmb, + entityType)); return new ResultBeanBuilder(_tableDbName) .buildListResultBean(resultList); } @@ -141,7 +144,7 @@ * # -- ELSE select count(*) * # /[*]END[*]/ * # ... - * o It's S2Dao's restriction...Sorry + * o It's restriction...Sorry * * * @param The type of entity. @@ -150,14 +153,11 @@ * @param entityType The type of result entity. (NotNull) * @return The result bean of paging. (NotNull) * @exception jp.sf.pal.timecard.db.allcommon.exception.OutsideSqlNotFoundException - * When the outside-sql is not found. + * When the outside-SQL is not found. */ public PagingResultBean selectPage(final String path, final PagingBean pmb, final Class entityType) { - final OutsideSqlOption countOption = _outsideSqlOption - .copyOptionWithoutPaging(); - final OutsideSqlEntityExecutor countExecutor = new OutsideSqlEntityExecutor( - _outsideSqlDao, countOption); + final OutsideSqlEntityExecutor countExecutor = createCountExecutor(); final PagingHandler handler = new PagingHandler() { public PagingBean getPagingBean() { return pmb; @@ -182,6 +182,13 @@ return invoker.invokePaging(handler); } + protected OutsideSqlEntityExecutor createCountExecutor() { + final OutsideSqlOption countOption = _outsideSqlOption + .copyOptionWithoutPaging(); + return new OutsideSqlEntityExecutor( + _behaviorCommandInvoker, countOption, _tableDbName); + } + protected void setupScrollableCursorIfNeeds() { if (!_outsideSqlOption.isAutoPaging()) { return; @@ -207,6 +214,39 @@ //========================================================================== // ========= + // Behavior Command + // ================ + protected BehaviorCommand> createSelectListCommand( + String path, Object pmb, Class entityType) { + return xsetupCommand(new OutsideSqlSelectListCommand(), path, + pmb, entityType); + } + + private OutsideSqlSelectListCommand xsetupCommand( + OutsideSqlSelectListCommand command, String path, + Object pmb, Class entityType) { + command.setTableDbName(_tableDbName); + _behaviorCommandInvoker.injectComponentProperty(command); + command.setOutsideSqlPath(path); + command.setParameterBean(pmb); + command.setOutsideSqlOption(_outsideSqlOption); + command.setEntityType(entityType); + return command; + } + + /** + * Invoke the command of behavior. + * + * @param The type of result. + * @param behaviorCommand The command of behavior. (NotNull) + * @return The instance of result. (Nullable) + */ + protected RESULT invoke(BehaviorCommand behaviorCommand) { + return _behaviorCommandInvoker.invoke(behaviorCommand); + } + + //========================================================================== + // ========= // Option // ====== public OutsideSqlPagingExecutor configure(StatementConfig statementConfig) { Modified: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/cbean/sqlclause/AbstractSqlClause.java =================================================================== --- timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/cbean/sqlclause/AbstractSqlClause.java 2008-12-27 22:18:30 UTC (rev 1630) +++ timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/cbean/sqlclause/AbstractSqlClause.java 2008-12-27 22:20:25 UTC (rev 1631) @@ -17,23 +17,23 @@ import jp.sf.pal.timecard.db.allcommon.dbmeta.DBMetaInstanceHandler; import jp.sf.pal.timecard.db.allcommon.dbmeta.info.ColumnInfo; import jp.sf.pal.timecard.db.allcommon.dbmeta.info.ForeignInfo; -import jp.sf.pal.timecard.db.allcommon.dbmeta.info.UniqueInfo; import jp.sf.pal.timecard.db.allcommon.util.SimpleAssertUtil; import jp.sf.pal.timecard.db.allcommon.util.SimpleStringUtil; import jp.sf.pal.timecard.db.allcommon.util.SimpleSystemUtil; /** - * The abstract class of SqlClause. + * The abstract class of SQL clause. * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public abstract class AbstractSqlClause implements SqlClause { //========================================================================== // ========= // Definition // ========== + protected static final SelectClauseType DEFAULT_SELECT_CLAUSE_TYPE = SelectClauseType.COLUMNS; + protected static final String SELECT_HINT = "/*$dto.selectHint*/"; //========================================================================== @@ -43,12 +43,16 @@ // ----------------------------------------------------- // Basic // ----- - /** Target table name. */ + /** The name of table. */ protected final String _tableName; // ----------------------------------------------------- // Clause Resource // --------------- + // /- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + // - + // The resources that are not often used to are lazy-loaded for performance. + // - - - - - - - - - -/ /** * Selected select column map. map:{tableAliasName : map:{columnName : * selectColumnInfo}} @@ -57,48 +61,48 @@ /** * Specified select column map. map:{ tableAliasName = map:{ columnName : - * null } } + * null } } (Nullable: This is lazy-loaded) */ - protected Map> _specifiedSelectColumnMap;// [ + protected Map> _specifiedSelectColumnMap; // [ // DBFlute // - - // 0.7.4 - // ] + // 0.7 + // .4] - /** Specified derive sub-query map. */ - protected Map _specifiedDeriveSubQueryMap;// [DBFlute-0.7.4] + /** Specified derive sub-query map. (Nullable: This is lazy-loaded) */ + protected Map _specifiedDeriveSubQueryMap; //[DBFlute-0.7.4] - /** Included select column map. */ - protected Map _includedSelectColumnMap = new LinkedHashMap(); - /** * The map of real column and alias of select clause. map:{realColumnName : * aliasName} */ - protected Map _selectClauseRealColumnAliasMap = new HashMap();// Without + protected Map _selectClauseRealColumnAliasMap = new HashMap(); // Without // linked // ! + /** The type of select clause. (NotNull) */ + protected SelectClauseType _selectClauseType = DEFAULT_SELECT_CLAUSE_TYPE; + + /** The previous type of select clause. (Nullable: The default is null) */ + protected SelectClauseType _previousSelectClauseType; + /** Outer join map. */ protected Map _outerJoinMap = new LinkedHashMap(); - /** Where list. */ + /** The list of where clause. */ protected List _whereList = new ArrayList(); /** Inline where list for BaseTable. */ protected List _baseTableInlineWhereList = new ArrayList(); - /** Order-by clause. */ + /** The clause of order-by. (NotNull) */ protected final OrderByClause _orderByClause = new OrderByClause(); - /** Union clause list. */ - protected List _unionQueryInfoList = new ArrayList(); + /** The list of union clause. (Nullable: This is lazy-loaded) */ + protected List _unionQueryInfoList; - /** Is included-select-column effective? Default value is false. */ - protected boolean _isIncludedSelectColumnEffective = false; - /** Is order-by effective? Default value is false. */ protected boolean _isOrderByEffective = false; @@ -138,7 +142,7 @@ // ----------------------------------------------------- // Optional Info // ------------- - protected boolean _formatClause; + protected boolean _formatClause = true; //========================================================================== // ========= @@ -163,28 +167,20 @@ StringBuilder sb = new StringBuilder(512); sb.append(getSelectClause()); sb.append(" "); - sb.append(buildClauseWithoutMainSelect(false)); + sb.append(buildClauseWithoutMainSelect()); String sql = sb.toString(); - return filterSubQueryIndent(sql); + sql = filterUnionCountOrScalar(sql); + sql = filterSubQueryIndent(sql); + return sql; } - public String getClausePKOnly() { + protected String buildClauseWithoutMainSelect() { StringBuilder sb = new StringBuilder(512); - sb.append(getSelectClausePKOnly()); - sb.append(" "); - sb.append(buildClauseWithoutMainSelect(true)); - String sql = sb.toString(); - return filterSubQueryIndent(sql); - } - - protected String buildClauseWithoutMainSelect(boolean pkonly) { - StringBuilder sb = new StringBuilder(512); sb.append(getFromClause()); sb.append(getFromHint()); sb.append(" "); sb.append(getWhereClause()); - String unionClause = buildUnionClause(pkonly ? getSelectClausePKOnly() - : getSelectClause()); + String unionClause = buildUnionClause(getSelectClause()); // Delete template mark! (At the future this will be unnecessary.) unionClause = replaceString(unionClause, getUnionWhereClauseMark(), "");// Required @@ -225,29 +221,45 @@ protected String buildUnionClause(String selectClause) { StringBuilder sb = new StringBuilder(); - for (final Iterator ite = _unionQueryInfoList - .iterator(); ite.hasNext();) { - final UnionQueryInfo unionQueryInfo = (UnionQueryInfo) ite.next(); - final String unionQueryClause = unionQueryInfo - .getUnionQueryClause(); - final boolean unionAll = unionQueryInfo.isUnionAll(); - if (isFormatClauseEffective()) { + if (hasUnionQuery()) { + for (Iterator ite = _unionQueryInfoList.iterator(); ite + .hasNext();) { + UnionQueryInfo unionQueryInfo = (UnionQueryInfo) ite.next(); + String unionQueryClause = unionQueryInfo.getUnionQueryClause(); + boolean unionAll = unionQueryInfo.isUnionAll(); sb.append(getLineSeparator()); - } - sb.append(unionAll ? " union all " : " union "); - if (isFormatClauseEffective()) { + sb.append(unionAll ? " union all " : " union "); sb.append(getLineSeparator()); + sb.append(selectClause).append(" ").append(unionQueryClause); } - sb.append(selectClause).append(" ").append(unionQueryClause); } return sb.toString(); } + protected String filterUnionCountOrScalar(String sql) { + if (!isSelectClauseTypeCountOrScalar() || !hasUnionQuery()) { + return sql; + } + String selectClause = buildSelectClauseCountOrScalar("dfmain"); + String ln = getLineSeparator(); + String beginMark = resolveSubQueryBeginMark("dfmain") + ln; + String endMark = resolveSubQueryEndMark("dfmain"); + return selectClause + ln + " from (" + beginMark + sql + ln + + " ) dfmain" + endMark; + } + //========================================================================== // ========= // Clause Parts // ============ public String getSelectClause() { + // [DBFlute-0.8.6] + if (isSelectClauseTypeCountOrScalar() && !hasUnionQuery()) { + return buildSelectClauseCountOrScalar("dflocal"); + } + // /- - - - - - - - - - - - - - - - - - - - - - - - + // The type of select clause is COLUMNS since here. + // - - - - - - - - - -/ StringBuilder sb = new StringBuilder(); DBMeta dbmeta = DBMetaInstanceHandler.findDBMeta(_tableName); List columnInfoList = dbmeta.getColumnInfoList(); @@ -265,7 +277,19 @@ // [DBFlute-0.7.4] if (existsSpecifiedLocal && !localSpecifiedMap.containsKey(columnName)) { - continue; + if (isSelectClauseTypeCountOrScalar() && hasUnionQuery()) { + // Here it must be with union query. + // So the primary Key is target for saving unique. + // But if it does not have primary keys, all column is + // target. + if (dbmeta.hasPrimaryKey()) { + if (!columnInfo.isPrimary()) { + continue; + } + } + } else { + continue; + } } if (sb.length() > 0) { @@ -307,10 +331,6 @@ selectColumnInfo.getColumnAliasName()); } } - if (_isIncludedSelectColumnEffective - && !_includedSelectColumnMap.isEmpty()) { - sb.append(getIncludedSelectColumnClause()); - } // [DBFlute-0.7.4] if (_specifiedDeriveSubQueryMap != null @@ -318,9 +338,7 @@ Collection deriveSubQuerySet = _specifiedDeriveSubQueryMap .values(); for (String deriveSubQuery : deriveSubQuerySet) { - if (isFormatClauseEffective()) { - sb.append(getLineSeparator()).append(" "); - } + sb.append(getLineSeparator()).append(" "); sb.append(", ").append(deriveSubQuery); } } @@ -328,67 +346,83 @@ return sb.toString(); } - public String getSelectClausePKOnly() { - StringBuilder sb = new StringBuilder(); - DBMeta dbmeta = DBMetaInstanceHandler.findDBMeta(_tableName); - UniqueInfo uniqueInfo = dbmeta.getPrimaryUniqueInfo(); - List columnInfoList = uniqueInfo.getUniqueColumnList(); - for (ColumnInfo columnInfo : columnInfoList) { - String columnName = columnInfo.getColumnDbName(); - if (sb.length() > 0) { - sb.append(", "); - } else { - sb.append("select").append(SELECT_HINT).append(" "); - } - String realColumnName = getLocalTableAliasName() + "." + columnName; - sb.append(realColumnName).append(" as ").append(columnName); - _selectClauseRealColumnAliasMap.put(realColumnName, columnName); + protected boolean isSelectClauseTypeCountOrScalar() { + if (_selectClauseType.equals(SelectClauseType.COUNT)) { + return true; + } else if (_selectClauseType.equals(SelectClauseType.MAX)) { + return true; + } else if (_selectClauseType.equals(SelectClauseType.MIN)) { + return true; + } else if (_selectClauseType.equals(SelectClauseType.SUM)) { + return true; + } else if (_selectClauseType.equals(SelectClauseType.AVG)) { + return true; } - if (_isIncludedSelectColumnEffective - && !_includedSelectColumnMap.isEmpty()) { - sb.append(getIncludedSelectColumnClause()); - } + return false; + } - // [DBFlute-0.7.4] - if (_specifiedDeriveSubQueryMap != null - && !_specifiedDeriveSubQueryMap.isEmpty()) { - Collection deriveSubQuerySet = _specifiedDeriveSubQueryMap - .values(); - for (String deriveSubQuery : deriveSubQuerySet) { - if (isFormatClauseEffective()) { - sb.append(getLineSeparator()).append(" "); - } - sb.append(", ").append(deriveSubQuery); - } + protected String buildSelectClauseCountOrScalar(String aliasName) { + if (_selectClauseType.equals(SelectClauseType.COUNT)) { + return buildSelectClauseCount(); + } else if (_selectClauseType.equals(SelectClauseType.MAX)) { + return buildSelectClauseMax(aliasName); + } else if (_selectClauseType.equals(SelectClauseType.MIN)) { + return buildSelectClauseMin(aliasName); + } else if (_selectClauseType.equals(SelectClauseType.SUM)) { + return buildSelectClauseSum(aliasName); + } else if (_selectClauseType.equals(SelectClauseType.AVG)) { + return buildSelectClauseAvg(aliasName); } + String msg = "The type of select clause is not for scalar:"; + msg = msg + " type=" + _selectClauseType; + throw new IllegalStateException(msg); + } - return sb.toString(); + protected String buildSelectClauseCount() { + return "select count(*)"; } - public String getSelectHint() { - return createSelectHint(); + protected String buildSelectClauseMax(String aliasName) { + String columnName = getSpecifiedColumnNameAsOne(); + assertScalarSelectSpecifiedColumnOnlyOne(columnName); + return "select max(" + aliasName + "." + columnName + ")"; } - public String getIncludedSelectColumnClause() { - StringBuilder sb = new StringBuilder(); - int count = 0; - for (Iterator ite = _includedSelectColumnMap.keySet() - .iterator(); ite.hasNext(); count++) { - String aliasName = ite.next(); - String realColumnName = (String) _includedSelectColumnMap - .get(aliasName); - sb.append(", ").append(realColumnName).append(" as ").append( - aliasName); - _selectClauseRealColumnAliasMap.put(realColumnName, aliasName); + protected String buildSelectClauseMin(String aliasName) { + String columnName = getSpecifiedColumnNameAsOne(); + assertScalarSelectSpecifiedColumnOnlyOne(columnName); + return "select min(" + aliasName + "." + columnName + ")"; + } + + protected String buildSelectClauseSum(String aliasName) { + String columnName = getSpecifiedColumnNameAsOne(); + assertScalarSelectSpecifiedColumnOnlyOne(columnName); + return "select sum(" + aliasName + "." + columnName + ")"; + } + + protected String buildSelectClauseAvg(String aliasName) { + String columnName = getSpecifiedColumnNameAsOne(); + assertScalarSelectSpecifiedColumnOnlyOne(columnName); + return "select avg(" + aliasName + "." + columnName + ")"; + } + + protected void assertScalarSelectSpecifiedColumnOnlyOne(String columnName) { + if (columnName != null) { + return; } - return sb.toString(); + String msg = "The specified column exists one"; + msg = msg + " when the type of select clause is for scalar:"; + msg = msg + " specifiedSelectColumnMap=" + _specifiedSelectColumnMap; + throw new IllegalStateException(msg); } + public String getSelectHint() { + return createSelectHint(); + } + public String getFromClause() { StringBuilder sb = new StringBuilder(); - if (isFormatClauseEffective()) { - sb.append(getLineSeparator()).append(" "); - } + sb.append(getLineSeparator()).append(" "); sb.append("from "); if (_baseTableInlineWhereList.isEmpty()) { sb.append(_tableName).append(" dflocal"); @@ -417,9 +451,7 @@ Map joinOnMap = joinInfo.getJoinOnMap(); assertJoinOnMapNotEmpty(joinOnMap, aliasName); - if (isFormatClauseEffective()) { - sb.append(getLineSeparator()).append(" "); - } + sb.append(getLineSeparator()).append(" "); sb.append(" left outer join "); if (inlineWhereClauseList.isEmpty()) { sb.append(joinTableName); @@ -489,16 +521,12 @@ String clauseElement = (String) ite.next(); clauseElement = filterWhereClauseSimply(clauseElement); if (count == 0) { - if (isFormatClauseEffective()) { - sb.append(getLineSeparator()).append(" "); - } + sb.append(getLineSeparator()).append(" "); sb.append("where ").append( template ? getWhereFirstConditionMark() : "").append( clauseElement); } else { - if (isFormatClauseEffective()) { - sb.append(getLineSeparator()).append(" "); - } + sb.append(getLineSeparator()).append(" "); sb.append(" and ").append(clauseElement); } } @@ -510,7 +538,7 @@ public String getOrderByClause() { String orderByClause = null; - if (!_unionQueryInfoList.isEmpty()) { + if (hasUnionQuery()) { if (_selectClauseRealColumnAliasMap == null || _selectClauseRealColumnAliasMap.isEmpty()) { String msg = "The selectClauseColumnAliasMap should not be null or empty when union query exists: " @@ -522,8 +550,7 @@ } else { orderByClause = _orderByClause.getOrderByClause(); } - if (isFormatClauseEffective() && orderByClause != null - && orderByClause.trim().length() > 0) { + if (orderByClause != null && orderByClause.trim().length() > 0) { return getLineSeparator() + " " + orderByClause; } else { return orderByClause; @@ -532,8 +559,7 @@ public String getSqlSuffix() { String sqlSuffix = createSqlSuffix(); - if (isFormatClauseEffective() && sqlSuffix != null - && sqlSuffix.trim().length() > 0) { + if (sqlSuffix != null && sqlSuffix.trim().length() > 0) { return getLineSeparator() + sqlSuffix; } else { return sqlSuffix; @@ -542,20 +568,6 @@ //========================================================================== // ========= - // Copy Parts - // ========== - public void copyIncludedSelectColumn(SqlClause sqlClause) { - Set keySet = _includedSelectColumnMap.keySet(); - for (Iterator ite = keySet.iterator(); ite.hasNext();) { - String aliasName = ite.next(); - String realColumnName = (String) _includedSelectColumnMap - .get(aliasName); - sqlClause.registerIncludedSelectColumn(aliasName, realColumnName); - } - } - - //========================================================================== - // ========= // SelectedSelectColumn // ==================== /** @@ -644,26 +656,6 @@ //========================================================================== // ========= - // IncludedSelectColumn - // ==================== - public void ignoreIncludedSelectColumn() { - _isIncludedSelectColumnEffective = false; - } - - public void makeIncludedSelectColumnEffective() { - if (!_includedSelectColumnMap.isEmpty()) { - _isIncludedSelectColumnEffective = true; - } - } - - public void registerIncludedSelectColumn(String aliasName, - String realColumnName) { - _isIncludedSelectColumnEffective = true; - _includedSelectColumnMap.put(aliasName, realColumnName); - } - - //========================================================================== - // ========= // OuterJoin // ========= public void registerOuterJoin(String joinTableName, String aliasName, @@ -1079,12 +1071,23 @@ public void registerUnionQuery(String unionQueryClause, boolean unionAll) { assertStringNotNullAndNotTrimmedEmpty("unionQueryClause", unionQueryClause); - final UnionQueryInfo unionQueryInfo = new UnionQueryInfo(); + UnionQueryInfo unionQueryInfo = new UnionQueryInfo(); unionQueryInfo.setUnionQueryClause(unionQueryClause); unionQueryInfo.setUnionAll(unionAll); + addUnionQueryInfo(unionQueryInfo); + } + + protected void addUnionQueryInfo(UnionQueryInfo unionQueryInfo) { + if (_unionQueryInfoList == null) { + _unionQueryInfoList = new ArrayList(); + } _unionQueryInfoList.add(unionQueryInfo); } + public boolean hasUnionQuery() { + return _unionQueryInfoList != null && !_unionQueryInfoList.isEmpty(); + } + protected static class UnionQueryInfo { protected String _unionQueryClause; @@ -1425,18 +1428,6 @@ //========================================================================== // ========= - // Format Clause - // ============= - public boolean isFormatClauseEffective() { - return _formatClause; - } - - public void makeFormatClauseEffective() { - _formatClause = true; - } - - //========================================================================== - // ========= // Sub Query Indent // ================ public String resolveSubQueryBeginMark(String subQueryIdentity) { @@ -1462,13 +1453,11 @@ } public String filterSubQueryIndent(String sql) { - return isFormatClauseEffective() ? filterSubQueryIndent(sql, "") : sql; + return filterSubQueryIndent(sql, "", sql); } - protected String filterSubQueryIndent(String sql, String preIndent) { - if (!isFormatClauseEffective()) { - return sql; - } + protected String filterSubQueryIndent(String sql, String preIndent, + String originalSql) { final String lineSeparator = getLineSeparator(); if (!sql.contains(getSubQueryBeginMarkPrefix())) { return sql; @@ -1509,7 +1498,8 @@ // - - - - - - - - // In begin to end // - - - - - - - - - if (line.contains(endMarkPrefix + subQueryIdentity)) {// The end + if (line.contains(endMarkPrefix + subQueryIdentity)) { // The + // end final int markIndex = line.indexOf(endMarkPrefix); final int terminalIndex = line.indexOf(identityTerminal); if (terminalIndex < 0) { @@ -1521,7 +1511,7 @@ + line.substring(terminalIndex + terminalLength); subSb.append(clause).append(getLineSeparator()); final String currentSql = filterSubQueryIndent(subSb - .toString(), preIndent + indent); + .toString(), preIndent + indent, originalSql); mainSb.append(currentSql); throughBegin = false; throughBeginFirst = false; @@ -1544,10 +1534,11 @@ + getLineSeparator(); msg = msg + subQueryIdentity + getLineSeparator(); msg = msg + getLineSeparator() + "[Before Filter]" - + getLineSeparator(); - msg = msg + sql + getLineSeparator(); + + getLineSeparator() + sql; msg = msg + getLineSeparator() + "[After Filter]" + getLineSeparator() + filteredSql; + msg = msg + getLineSeparator() + "[Original SQL]" + + getLineSeparator() + originalSql; throw new SubQueryIndentFailureException(msg); } if (filteredSql.contains(beginMarkPrefix)) { @@ -1556,10 +1547,11 @@ + getLineSeparator(); msg = msg + subQueryIdentity + getLineSeparator(); msg = msg + getLineSeparator() + "[Before Filter]" - + getLineSeparator(); - msg = msg + sql + getLineSeparator(); + + getLineSeparator() + sql; msg = msg + getLineSeparator() + "[After Filter]" + getLineSeparator() + filteredSql; + msg = msg + getLineSeparator() + "[Original SQL]" + + getLineSeparator() + originalSql; throw new SubQueryIndentFailureException(msg); } return filteredSql; @@ -1592,7 +1584,7 @@ } if (!_specifiedSelectColumnMap.containsKey(tableAliasName)) { _specifiedSelectColumnMap.put(tableAliasName, - new HashMap()); + new LinkedHashMap()); } Map elementMap = _specifiedSelectColumnMap .get(tableAliasName); @@ -1666,10 +1658,7 @@ getUnionWhereFirstConditionMark(), ""); final StringBuilder sb = new StringBuilder(); - String ln = ""; - if (isFormatClauseEffective()) { - ln = getLineSeparator(); - } + String ln = getLineSeparator(); sb.append("update ").append(_tableName).append(ln); int index = 0; // It is guaranteed that the map has one or more elements. @@ -1728,10 +1717,7 @@ final String subQuery = filterSubQueryIndent(selectClause + " " + fromWhereClause); final StringBuilder sb = new StringBuilder(); - String ln = ""; - if (isFormatClauseEffective()) { - ln = getLineSeparator(); - } + String ln = getLineSeparator(); sb.append("delete from ").append(_tableName).append(ln); sb.append(" where ").append(primaryKeyName); sb.append(" in (").append(ln).append(subQuery).append(ln).append( @@ -1760,6 +1746,29 @@ return false; } + // [DBFlute-0.8.6] + //========================================================================== + // ========= + // Select Clause Type + // ================== + public void classifySelectClauseType(SelectClauseType selectClauseType) { + changeSelectClauseType(selectClauseType); + } + + protected void changeSelectClauseType(SelectClauseType selectClauseType) { + savePreviousSelectClauseType(); + _selectClauseType = selectClauseType; + } + + protected void savePreviousSelectClauseType() { + _previousSelectClauseType = _selectClauseType; + } + + public void rollbackSelectClauseType() { + _selectClauseType = _previousSelectClauseType != null ? _previousSelectClauseType + : DEFAULT_SELECT_CLAUSE_TYPE; + } + // [DBFlute-0.7.5] //========================================================================== // ========= Modified: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/cbean/sqlclause/SqlClause.java =================================================================== --- timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/cbean/sqlclause/SqlClause.java 2008-12-27 22:18:30 UTC (rev 1630) +++ timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/cbean/sqlclause/SqlClause.java 2008-12-27 22:20:25 UTC (rev 1631) @@ -7,7 +7,7 @@ import jp.sf.pal.timecard.db.allcommon.cbean.cvalue.ConditionValue; /** - * The interface of SQL-clause. + * The interface of SQL clause. * * @author DBFlute(AutoGenerator) */ @@ -35,21 +35,6 @@ */ public String getClause(); - /** - * Get clause of all parts as PK-only. - * - *
-     * # 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
-     * 
- * - * @return The clause of all parts as PK-Only. (NotNull) - */ - public String getClausePKOnly(); - // ----------------------------------------------------- // Fragment Clause // --------------- @@ -92,14 +77,6 @@ public String getSelectClause(); /** - * Get The clause of 'select' as PK-only. This is an internal method. - * - * @return The clause of select PK-only. {[select ...] from table...} - * (NotNull) - */ - public String getSelectClausePKOnly(); - - /** * Get the hint of 'select'. This is an internal method. * * @return The hint of 'select'. {select [select-hint] * from table...} @@ -108,14 +85,6 @@ public String getSelectHint(); /** - * Get the clause of included-select-column. This is an internal method. - * - * @return The clause of included-select-column. {select ... , - * [included-select-column clause] from table...} (NotNull) - */ - public String getIncludedSelectColumnClause(); - - /** * Get the clause of 'from'. This is an internal method. * * @return The clause of 'from'. (NotNull) @@ -162,17 +131,6 @@ //========================================================================== // ========= - // Copy Parts - // ========== - /** - * Copy included-select-column. - * - * @param sqlClause SQL-clause. (NotNull) - */ - public void copyIncludedSelectColumn(SqlClause sqlClause); - - //========================================================================== - // ========= // SelectedSelectColumn // ==================== /** @@ -189,30 +147,6 @@ //========================================================================== // ========= - // IncludedSelectColumn - // ==================== - /** - * Ignore included-select-column. - */ - public void ignoreIncludedSelectColumn(); - - /** - * Make included-select-column effective. - */ - public void makeIncludedSelectColumnEffective(); - - /** - * Register included-select-column. - * - * @param aliasName The alias name of the included-select-column. (NotNull) - * @param realColumnName The real column name of the included-select-column. - * (NotNull) - */ - public void registerIncludedSelectColumn(String aliasName, - String realColumnName); - - //========================================================================== - // ========= // OuterJoin // ========= /** @@ -340,6 +274,8 @@ // ===== public void registerUnionQuery(String unionClause, boolean unionAll); + public boolean hasUnionQuery(); + //========================================================================== // ========= // FetchScope @@ -561,14 +497,6 @@ //========================================================================== // ========= - // Format Clause - // ============= - public boolean isFormatClauseEffective(); - - public void makeFormatClauseEffective(); - - //========================================================================== - // ========= // Sub Query Indent // ================ public String resolveSubQueryBeginMark(String subQueryIdentity); @@ -588,8 +516,17 @@ public boolean hasSpecifiedDeriveSubQuery(String aliasName); + /** + * Get the name of only one specified column. + * + * @return The name of only one specified column. (Nullable: If it's not + * found or duplicated, it returns null) + */ public String getSpecifiedColumnNameAsOne(); + /** + * Clear specified select columns. + */ public void clearSpecifiedSelectColumn(); // [DBFlute-0.7.5] @@ -621,4 +558,29 @@ */ public boolean isUniqueConstraintException(String sqlState, Integer errorCode); + + // [DBFlute-0.8.6] + //========================================================================== + // ========= + // Select Clause Type + // ================== + /** + * Classify the type of select clause into specified type. + * + * @param selectClauseType The type of select clause. (NotNull) + */ + public void classifySelectClauseType(SelectClauseType selectClauseType); + + /** + * Roll-back the type of select clause into previous one. If it has no + * change, classify its type into default type. + */ + public void rollbackSelectClauseType(); + + /** + * The type of select clause. + */ + public static enum SelectClauseType { + COLUMNS, COUNT, MAX, MIN, SUM, AVG + } } Modified: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/cbean/sqlclause/SqlClauseOracle.java =================================================================== --- timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/cbean/sqlclause/SqlClauseOracle.java 2008-12-27 22:18:30 UTC (rev 1630) +++ timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/cbean/sqlclause/SqlClauseOracle.java 2008-12-27 22:20:25 UTC (rev 1631) @@ -71,12 +71,7 @@ if (!isFetchStartIndexSupported() && !isFetchSizeSupported()) { return; } - String ln = null; - if (isFormatClauseEffective()) { - ln = getLineSeparator(); - } else { - ln = ""; - } + String ln = getLineSeparator(); _fetchScopeSelectHint = " * from (select base.*, rownum as rn from (" + ln + "select"; _fetchScopeSqlSuffix = ""; Modified: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/dbmeta/AbstractDBMeta.java =================================================================== --- timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/dbmeta/AbstractDBMeta.java 2008-12-27 22:18:30 UTC (rev 1630) +++ timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/dbmeta/AbstractDBMeta.java 2008-12-27 22:20:25 UTC (rev 1631) @@ -5,12 +5,11 @@ import java.util.Collection; import java.util.Collections; import java.util.HashMap; -import java.util.HashSet; import java.util.Iterator; import java.util.LinkedHashMap; import java.util.List; import java.util.Map; -import java.util.Set; +import java.util.concurrent.ConcurrentHashMap; import jp.sf.pal.timecard.db.allcommon.Entity; import jp.sf.pal.timecard.db.allcommon.dbmeta.info.ColumnInfo; @@ -22,6 +21,7 @@ import jp.sf.pal.timecard.db.allcommon.helper.MapListStringImpl; import jp.sf.pal.timecard.db.allcommon.helper.MapStringBuilder; import jp.sf.pal.timecard.db.allcommon.helper.MapStringBuilderImpl; +import jp.sf.pal.timecard.db.allcommon.helper.StringKeyMap; import jp.sf.pal.timecard.db.allcommon.util.SimpleAssertUtil; import jp.sf.pal.timecard.db.allcommon.util.SimpleStringUtil; import jp.sf.pal.timecard.db.allcommon.util.SimpleSystemUtil; @@ -31,68 +31,113 @@ * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public abstract class AbstractDBMeta implements DBMeta { //========================================================================== // ========= + // Definition + // ========== + protected static final Object DUMMY_VALUE = new Object(); + + //========================================================================== + // ========= // Attribute // ========= - protected List _columnInfoList; + // ----------------------------------------------------- + // Information Resource + // -------------------- + // Initialized at its getter. + private StringKeyMap _tableDbNameFlexibleMap; + private StringKeyMap _tablePropertyNameFlexibleMap; + + private List _columnInfoList; + + private StringKeyMap _columnInfoFlexibleMap; + + // Initialized at hasMethod(). + private Map _methodNameMap = newConcurrentHashMap(); + //========================================================================== // ========= + // Table Info + // ========== + /** + * Get the flexible map of table DB name. + * + * @return The flexible map of table DB name. (NotNull, NotEmpty) + */ + protected Map getTableDbNameFlexibleMap() { + if (_tableDbNameFlexibleMap != null) { + return _tableDbNameFlexibleMap; + } + synchronized (this) { + if (_tableDbNameFlexibleMap != null) { + return _tableDbNameFlexibleMap; + } + _tableDbNameFlexibleMap = StringKeyMap.createAsFlexibleConcurrent(); + _tableDbNameFlexibleMap.put(getTableDbName(), getTableDbName()); + return _tableDbNameFlexibleMap; + } + } + + /** + * Get the flexible map of table property name. + * + * @return The flexible map of table property name. (NotNull, NotEmpty) + */ + protected Map getTablePropertyNameFlexibleMap() { + if (_tablePropertyNameFlexibleMap != null) { + return _tablePropertyNameFlexibleMap; + } + synchronized (this) { + if (_tablePropertyNameFlexibleMap != null) { + return _tablePropertyNameFlexibleMap; + } + _tablePropertyNameFlexibleMap = StringKeyMap + .createAsFlexibleConcurrent(); + _tablePropertyNameFlexibleMap.put(getTableDbName(), + getTablePropertyName()); + return _tableDbNameFlexibleMap; + } + } + + //========================================================================== + // ========= // Column Info // =========== /** * The implementation. * - * @param columnFlexibleName The flexible name of the column. (NotNull) + * @param columnFlexibleName The flexible name(IgnoreCase, IgnoreUnderscore) + * of the column. (NotNull, NotEmpty) * @return Determination. */ public boolean hasColumn(String columnFlexibleName) { - if (!hasFlexibleName(columnFlexibleName)) { - return false; - } - final String propertyName = findPropertyName(columnFlexibleName); - return hasMethod("column" + initCap(propertyName)); + assertStringNotNullAndNotTrimmedEmpty("columnFlexibleName", + columnFlexibleName); + return getColumnInfoFlexibleMap().containsKey(columnFlexibleName); } /** * The implementation. * - * @param columnFlexibleName The flexible name of the column. (NotNull and - * NotEmpty) + * @param columnFlexibleName The flexible name(IgnoreCase, IgnoreUnderscore) + * of the column. (NotNull, NotEmpty) * @return The information of the column. (NotNull) */ public ColumnInfo findColumnInfo(String columnFlexibleName) { assertStringNotNullAndNotTrimmedEmpty("columnFlexibleName", columnFlexibleName); - if (!hasColumn(columnFlexibleName)) { + final ColumnInfo columnInfo = getColumnInfoFlexibleMap().get( + columnFlexibleName); + if (columnInfo == null) { String msg = "Not found column by columnFlexibleName: " + columnFlexibleName; msg = msg + " tableName=" + getTableDbName(); throw new IllegalArgumentException(msg); } - String methodName = "column" - + initCap(findPropertyName(columnFlexibleName)); - Method method = null; - try { - method = this.getClass().getMethod(methodName, new Class[] {}); - } catch (NoSuchMethodException e) { - String msg = "Not found column by columnFlexibleName: " - + columnFlexibleName; - msg = msg + " tableName=" + getTableDbName() + " methodName=" - + methodName; - throw new RuntimeException(msg, e); - } - try { - return (ColumnInfo) method.invoke(this, new Object[] {}); - } catch (IllegalAccessException e) { - throw new RuntimeException(e); - } catch (java.lang.reflect.InvocationTargetException e) { - throw new RuntimeException(e.getCause()); - } + return columnInfo; } protected ColumnInfo cci(String columnDbName, String propertyName, @@ -114,7 +159,7 @@ /** * The implementation. * - * @return The list of columns. (NotNull and NotEmpty) + * @return The list of columns. (NotNull, NotEmpty) */ public List getColumnInfoList() { if (_columnInfoList != null) { @@ -144,79 +189,118 @@ } } - protected void initializeColumnInfoList() { - getColumnInfoList();// Ignore return value because of initialization - // only! + /** + * Get the flexible map of column information. + * + * @return The flexible map of column information. (NotNull, NotEmpty) + */ + protected Map getColumnInfoFlexibleMap() { + if (_columnInfoFlexibleMap != null) { + return _columnInfoFlexibleMap; + } + final List columnInfoList = getColumnInfoList(); + synchronized (this) { + if (_columnInfoFlexibleMap != null) { + return _columnInfoFlexibleMap; + } + _columnInfoFlexibleMap = StringKeyMap.createAsFlexibleConcurrent(); + for (ColumnInfo columnInfo : columnInfoList) { + _columnInfoFlexibleMap.put(columnInfo.getColumnDbName(), + columnInfo); + } + return _columnInfoFlexibleMap; + } } //========================================================================== - // =========== + // ========= + // Resource Initialization + // ======================= + protected void initializeInformationResource() { // for instance initializer + // of subclass. + // Initialize the flexible map of table DB name. + getTableDbNameFlexibleMap(); + + // Initialize the flexible map of table property name. + getTablePropertyNameFlexibleMap(); + + // Initialize the list of column information. + getColumnInfoList(); + + // Initialize the flexible map of column information. + getColumnInfoFlexibleMap(); + + // Initialize the map of (public)method name. + hasMethod("dummy"); + } + + //========================================================================== + // ========= // Name Handling // ============= /** * The implementation. * - * @param flexibleName Flexible-name(IgnoreCase). (NotNull and NotEmpty) + * @param flexibleName The flexible name(IgnoreCase, IgnoreUnderscore). + * (NotNull, NotEmpty) * @return Determination. */ public boolean hasFlexibleName(String flexibleName) { - final String key = flexibleName.toLowerCase(); - if (getDbNamePropertyNameKeyToLowerMap().containsKey(key)) { - return true; - } - if (getPropertyNameDbNameKeyToLowerMap().containsKey(key)) { - return true; - } - return false; + assertStringNotNullAndNotTrimmedEmpty("flexibleName", flexibleName); + + // It uses column before table because column is used much more than + // table. + // This is the same consideration at other methods. + return getColumnInfoFlexibleMap().containsKey(flexibleName) + || getTableDbNameFlexibleMap().containsKey(flexibleName); } /** * The implementation. * - * @param flexibleName Flexible-name(IgnoreCase). (NotNull and NotEmpty) - * @return DB name. (NotNull and NotEmpty) + * @param flexibleName The flexible name(IgnoreCase, IgnoreUnderscore). + * (NotNull, NotEmpty) + * @return DB name. (NotNull, NotEmpty) */ public String findDbName(String flexibleName) { - final String key = flexibleName.toLowerCase(); - if (getPropertyNameDbNameKeyToLowerMap().containsKey(key)) { - return (String) getPropertyNameDbNameKeyToLowerMap().get(key); + assertStringNotNullAndNotTrimmedEmpty("flexibleName", flexibleName); + final ColumnInfo columnInfoMap = getColumnInfoFlexibleMap().get( + flexibleName); + if (columnInfoMap != null) { + return columnInfoMap.getColumnDbName(); } - if (getDbNamePropertyNameKeyToLowerMap().containsKey(key)) { - final String dbNameKeyToLower = ((String) getDbNamePropertyNameKeyToLowerMap() - .get(key)).toLowerCase(); - if (getPropertyNameDbNameKeyToLowerMap().containsKey( - dbNameKeyToLower)) { - return (String) getPropertyNameDbNameKeyToLowerMap().get( - dbNameKeyToLower); - } + final String tableDbName = getTableDbNameFlexibleMap() + .get(flexibleName); + if (tableDbName != null) { + return tableDbName; } - String msg = "Not found object by the flexible name: flexibleName=" + String msg = "Not found DB name by the flexible name: flexibleName=" + flexibleName; - throw new IllegalStateException(msg); + throw new IllegalArgumentException(msg); } /** * The implementation. * - * @param flexibleName Flexible-name(IgnoreCase). (NotNull and NotEmpty) - * @return DB name. (NotNull and NotEmpty) + * @param flexibleName The flexible name(IgnoreCase, IgnoreUnderscore). + * (NotNull, NotEmpty) + * @return DB name. (NotNull, NotEmpty) */ public String findPropertyName(String flexibleName) { - final String key = flexibleName.toLowerCase(); - if (getDbNamePropertyNameKeyToLowerMap().containsKey(key)) { - return (String) getDbNamePropertyNameKeyToLowerMap().get(key); + assertStringNotNullAndNotTrimmedEmpty("flexibleName", flexibleName); + final ColumnInfo columnInfoMap = getColumnInfoFlexibleMap().get( + flexibleName); + if (columnInfoMap != null) { + return columnInfoMap.getPropertyName(); } - if (getPropertyNameDbNameKeyToLowerMap().containsKey(key)) { - final String dbNameToLower = ((String) getPropertyNameDbNameKeyToLowerMap() - .get(key)).toLowerCase(); - if (getDbNamePropertyNameKeyToLowerMap().containsKey(dbNameToLower)) { - return (String) getDbNamePropertyNameKeyToLowerMap().get( - dbNameToLower); - } + final String tablePropertyName = getTablePropertyNameFlexibleMap().get( + flexibleName); + if (tablePropertyName != null) { + return tablePropertyName; } - String msg = "Not found object by the flexible name: flexibleName=" + String msg = "Not found property name by the flexible name: flexibleName=" + flexibleName; - throw new IllegalStateException(msg); + throw new IllegalArgumentException(msg); } //========================================================================== @@ -735,10 +819,8 @@ protected void registerEntityPropertySetupper( String columnName, String propertyName, Eps setupper, Map> entityPropertySetupperMap) { + // Only column name is registered because the map must be flexible map. entityPropertySetupperMap.put(columnName, setupper); - entityPropertySetupperMap.put(propertyName, setupper); - entityPropertySetupperMap.put(columnName.toLowerCase(), setupper); - entityPropertySetupperMap.put(propertyName.toLowerCase(), setupper); } protected Eps findEps( @@ -945,6 +1027,7 @@ /** * This class is for Internal. Don't use this! */ + @SuppressWarnings("unchecked") protected static class MapStringValueAnalyzer { protected java.util.Map _valueMap; @@ -1072,6 +1155,7 @@ // ========= // Assist Helper // ============= + @SuppressWarnings("unchecked") protected ENTITY downcast(Entity entity) { checkDowncast(entity); return (ENTITY) entity; @@ -1118,10 +1202,10 @@ protected Map setupKeyToLowerMap(boolean dbNameKey) { final Map map; if (dbNameKey) { - map = newLinkedHashMap(getTableDbName().toLowerCase(), + map = newConcurrentHashMap(getTableDbName().toLowerCase(), getTablePropertyName()); } else { - map = newLinkedHashMap(getTablePropertyName().toLowerCase(), + map = newConcurrentHashMap(getTablePropertyName().toLowerCase(), getTableDbName()); } Method[] methods = this.getClass().getMethods(); @@ -1178,6 +1262,17 @@ return new HashMap(); } + protected ConcurrentHashMap newConcurrentHashMap() { + return new ConcurrentHashMap(); + } + + protected ConcurrentHashMap newConcurrentHashMap( + KEY key, VALUE value) { + ConcurrentHashMap map = newConcurrentHashMap(); + map.put(key, value); + return map; + } + protected LinkedHashMap newLinkedHashMap() { return new LinkedHashMap(); } @@ -1201,23 +1296,26 @@ // ----------------------------------------------------- // Reflection Handling // ------------------- - private Set _cachedMethodNames = new HashSet(); // for - - // performance - + /** + * Does it have the method? + * + * @param methodName The name of method. (NotNull, NotEmpty, + * PublicMethodOnly) + * @return Determination. + */ protected boolean hasMethod(String methodName) { assertStringNotNullAndNotTrimmedEmpty("methodName", methodName); - if (_cachedMethodNames.isEmpty()) { - synchronized (_cachedMethodNames) { - if (_cachedMethodNames.isEmpty()) { + if (_methodNameMap.isEmpty()) { + synchronized (_methodNameMap) { + if (_methodNameMap.isEmpty()) { final Method[] methods = this.getClass().getMethods(); for (Method method : methods) { - _cachedMethodNames.add(method.getName()); + _methodNameMap.put(method.getName(), DUMMY_VALUE); } } } } - return _cachedMethodNames.contains(methodName); + return _methodNameMap.containsKey(methodName); } // ----------------------------------------------------- Modified: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/dbmeta/DBMeta.java =================================================================== --- timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/dbmeta/DBMeta.java 2008-12-27 22:18:30 UTC (rev 1630) +++ timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/dbmeta/DBMeta.java 2008-12-27 22:20:25 UTC (rev 1631) @@ -17,23 +17,22 @@ * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public interface DBMeta { //========================================================================== // ========= // Definition // ========== - /** Map-string map-mark. */ + /** Map-string map mark. */ public static final String MAP_STRING_MAP_MARK = "map:"; - /** Map-string list-mark. */ + /** Map-string list mark. */ public static final String MAP_STRING_LIST_MARK = "list:"; - /** Map-string start-brace. */ + /** Map-string start brace. */ public static final String MAP_STRING_START_BRACE = "@{"; - /** Map-string end-brace. */ + /** Map-string end brace. */ public static final String MAP_STRING_END_BRACE = "@}"; /** Map-string delimiter. */ @@ -47,23 +46,23 @@ // Table Info // ========== /** - * Get table db-name. + * Get table DB name. * - * @return Table db-name. (NotNull) + * @return Table DB name. (NotNull) */ public String getTableDbName(); /** - * Get table property-name(JavaBeansRule). + * Get table property name(JavaBeansRule). * - * @return Table property-name(JavaBeansRule). (NotNull) + * @return Table property name(JavaBeansRule). (NotNull) */ public String getTablePropertyName(); /** - * Get table SQL-name. + * Get table SQL name. * - * @return Table SQL-name. (NotNull) + * @return Table SQL name. (NotNull) */ public String getTableSqlName(); @@ -80,10 +79,10 @@ public boolean hasFlexibleName(String flexibleName); /** - * Find db name by flexible name. {Target objects are TABLE and COLUMN} + * Find DB name by flexible name. {Target objects are TABLE and COLUMN} * * @param flexibleName The flexible name. (NotNull and NotEmpty) - * @return Db name. (NotNull and NotEmpty) + * @return The DB name of anything. (NotNull and NotEmpty) */ public String findDbName(String flexibleName); @@ -92,60 +91,40 @@ * TABLE and COLUMN} * * @param flexibleName The flexible name. (NotNull and NotEmpty) - * @return Db name. (NotNull and NotEmpty) + * @return The DB name of anything. (NotNull and NotEmpty) */ public String findPropertyName(String flexibleName); //========================================================================== // ========= - // Name Map - // ======== - /** - * Get the key-to-lower map of DB name(lower) and property name. - * - * @return The key-to-lower map of DB name(lower) and property name. - * (NotNull) - */ - public Map 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 getPropertyNameDbNameKeyToLowerMap(); - - //========================================================================== - // ========= // Type Name // ========= /** - * Get the type-name of entity. + * Get the type name of entity. * - * @return The type-name of entity. (NotNull) + * @return The type name of entity. (NotNull) */ public String getEntityTypeName(); /** - * Get the type-name of condition-bean. + * Get the type name of condition-bean. * - * @return The type-name of condition-bean. (Nullable: If the condition-bean + * @return The type name of condition-bean. (Nullable: If the condition-bean * does not exist) */ public String getConditionBeanTypeName(); /** - * Get the type-name of dao. + * Get the type name of DAO. * - * @return The type-name of dao. (Nullable: If the dao does not exist) + * @return The type name of DAO. (Nullable: If the DAO does not exist) */ public String getDaoTypeName(); /** - * Get the type-name of behavior. + * Get the type name of behavior. * - * @return The type-name of behavior. (Nullable: If the behavior does not + * @return The type name of behavior. (Nullable: If the behavior does not * exist) */ public String getBehaviorTypeName(); Modified: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/dbmeta/DBMetaInstanceHandler.java =================================================================== --- timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/dbmeta/DBMetaInstanceHandler.java 2008-12-27 22:18:30 UTC (rev 1630) +++ timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/dbmeta/DBMetaInstanceHandler.java 2008-12-27 22:20:25 UTC (rev 1631) @@ -1,113 +1,85 @@ package jp.sf.pal.timecard.db.allcommon.dbmeta; -import java.util.Collections; -import java.util.LinkedHashMap; +import java.lang.reflect.Method; import java.util.Map; import java.util.Set; +import java.util.concurrent.ConcurrentHashMap; +import jp.sf.pal.timecard.db.allcommon.helper.StringKeyMap; import jp.sf.pal.timecard.db.allcommon.util.SimpleAssertUtil; /** - * DBMeta instance handler. + * The instance handler of DB meta. * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public class DBMetaInstanceHandler { //========================================================================== // ========= // Definition // ========== + /** Log-instance. */ + private static final org.apache.commons.logging.Log _log = org.apache.commons.logging.LogFactory + .getLog(DBMetaInstanceHandler.class); + + //========================================================================== + // ========= + // Resource Map + // ============ /** Table DB-name instance map. */ - protected static final Map _tableDbNameInstanceMap = new LinkedHashMap(); + protected static final Map _tableDbNameInstanceMap = newConcurrentHashMap(); - /** The map of table DB-name and class name. */ - protected static final Map _tableDbNameClassNameMap; - static { - Map tmpMap = new LinkedHashMap(); + /** The map of table DB name and class name. This is for initialization. */ + protected static final Map _tableDbNameClassNameMap = newConcurrentHashMap(); - tmpMap.put("DAILY_REPORT", - "jp.sf.pal.timecard.db.bsentity.dbmeta.DailyReportDbm"); - tmpMap.put("EMPLOYEE", - "jp.sf.pal.timecard.db.bsentity.dbmeta.EmployeeDbm"); - tmpMap.put("GROUP_INFO", - "jp.sf.pal.timecard.db.bsentity.dbmeta.GroupInfoDbm"); - tmpMap.put("GROUP_MAPPING", - "jp.sf.pal.timecard.db.bsentity.dbmeta.GroupMappingDbm"); - tmpMap.put("MONTHLY_REPORT", - "jp.sf.pal.timecard.db.bsentity.dbmeta.MonthlyReportDbm"); - tmpMap - .put("MONTHLY_WORKING_REPORT", - "jp.sf.pal.timecard.db.bsentity.dbmeta.MonthlyWorkingReportDbm"); - tmpMap.put("ROLE_INFO", - "jp.sf.pal.timecard.db.bsentity.dbmeta.RoleInfoDbm"); - tmpMap.put("ROLE_MAPPING", - "jp.sf.pal.timecard.db.bsentity.dbmeta.RoleMappingDbm"); - tmpMap.put("USER_INFO", - "jp.sf.pal.timecard.db.bsentity.dbmeta.UserInfoDbm"); - tmpMap.put("WORKING_TYPE", - "jp.sf.pal.timecard.db.bsentity.dbmeta.WorkingTypeDbm"); + /** The flexible map of table DB name. This is for conversion at finding. */ + protected static final Map _tableDbNameFlexibleMap = StringKeyMap + .createAsFlexibleConcurrent(); - _tableDbNameClassNameMap = Collections.unmodifiableMap(tmpMap); - } + /** The count of setting up resources of DB meta for internal information. */ + protected static int setupCount = 0; - /** The key-to-lower map of DB-name and property-name for table. */ - protected static final Map _tableDbNamePropertyNameKeyToLowerMap; - static { - Map tmpMap = new LinkedHashMap(); - - tmpMap.put("DAILY_REPORT".toLowerCase(), "dailyReport"); - tmpMap.put("EMPLOYEE".toLowerCase(), "employee"); - tmpMap.put("GROUP_INFO".toLowerCase(), "groupInfo"); - tmpMap.put("GROUP_MAPPING".toLowerCase(), "groupMapping"); - tmpMap.put("MONTHLY_REPORT".toLowerCase(), "monthlyReport"); - tmpMap.put("MONTHLY_WORKING_REPORT".toLowerCase(), - "monthlyWorkingReport"); - tmpMap.put("ROLE_INFO".toLowerCase(), "roleInfo"); - tmpMap.put("ROLE_MAPPING".toLowerCase(), "roleMapping"); - tmpMap.put("USER_INFO".toLowerCase(), "userInfo"); - tmpMap.put("WORKING_TYPE".toLowerCase(), "workingType"); - - _tableDbNamePropertyNameKeyToLowerMap = Collections - .unmodifiableMap(tmpMap); - } - - /** The key-to-lower map of property-name and DB-name for table. */ - protected static final Map _tablePropertyNameDbNameKeyToLowerMap; - static { - Map tmpMap = new LinkedHashMap(); - - tmpMap.put("dailyReport".toLowerCase(), "DAILY_REPORT"); - tmpMap.put("employee".toLowerCase(), "EMPLOYEE"); - tmpMap.put("groupInfo".toLowerCase(), "GROUP_INFO"); - tmpMap.put("groupMapping".toLowerCase(), "GROUP_MAPPING"); - tmpMap.put("monthlyReport".toLowerCase(), "MONTHLY_REPORT"); - tmpMap.put("monthlyWorkingReport".toLowerCase(), - "MONTHLY_WORKING_REPORT"); - tmpMap.put("roleInfo".toLowerCase(), "ROLE_INFO"); - tmpMap.put("roleMapping".toLowerCase(), "ROLE_MAPPING"); - tmpMap.put("userInfo".toLowerCase(), "USER_INFO"); - tmpMap.put("workingType".toLowerCase(), "WORKING_TYPE"); - - _tablePropertyNameDbNameKeyToLowerMap = Collections - .unmodifiableMap(tmpMap); - } - - protected static DBMeta getDBMeta(String className) { - try { - Class clazz = Class.forName(className); - java.lang.reflect.Method methoz = clazz.getMethod("getInstance", - (Class[]) null); - Object result = methoz.invoke(null, (Object[]) null); - return (DBMeta) result; - } catch (Exception e) { - throw new RuntimeException(e); + /** + * Set up the resource of DBMeta. Lock this class. + * + * @param tableDbNameClassNameMap The map of table DB name and class name. + * (NotNull) + */ + public static synchronized void setupDBMetaResource( + Map tableDbNameClassNameMap) { + if (tableDbNameClassNameMap == null) { + String msg = "The argument 'tableDbNameClassNameMap' should not be null"; + msg = msg + " at DBMetaInstanceHandler.setupDBMetaResource()"; + throw new IllegalArgumentException(msg); } + if (tableDbNameClassNameMap.isEmpty()) { + String msg = "The argument 'tableDbNameClassNameMap' should not be empty"; + msg = msg + " at DBMetaInstanceHandler.setupDBMetaResource()"; + throw new IllegalArgumentException(msg); + } + final String firstMsg = "...Setting up resources of DB meta"; + final int tableCount = tableDbNameClassNameMap.size(); + if (setupCount == 0) { + _log.info(firstMsg + ": tables=" + tableCount); // basically here + } else { + _log.info(firstMsg + " AGAIN(" + (setupCount + 1) + + " times): tables=" + tableCount); + } + _tableDbNameInstanceMap.clear(); + _tableDbNameClassNameMap.clear(); + _tableDbNameFlexibleMap.clear(); + final Set tableDbNameSet = tableDbNameClassNameMap.keySet(); + for (String tableDbName : tableDbNameSet) { + final String className = tableDbNameClassNameMap.get(tableDbName); + _tableDbNameClassNameMap.put(tableDbName, className); + _tableDbNameFlexibleMap.put(tableDbName, tableDbName); + } + ++setupCount; } /** - * @return The initialized map that contains all instances of dbmeta. + * @return The initialized map that contains all instances of DB meta. * (NotNull & NotEmpty) */ public static Map getDBMetaMap() { @@ -140,45 +112,31 @@ // Main Method // =========== /** - * Find dbmeta by table flexible-name. + * Find DB meta by table flexible name. * *
-     * If the table name is 'ORDER_DETAIL', you can find the dbmeta by ...(as follows)
+     * If the table name is 'ORDER_DETAIL', you can find the DB meta by ...(as follows)
      *     'ORDER_DETAIL', 'ORDer_DeTAiL', 'order_detail'
      *     , 'OrderDetail', 'orderdetail', 'oRderDetaIl'
      * 
* - * @param tableFlexibleName Table flexible-name. (NotNull) - * @return The instance of dbmeta. (NotNull) - * @exception DBMetaNotFoundException When the dbmeta is not found. + * @param tableFlexibleName The flexible name of table. (NotNull) + * @return The instance of DB meta. (NotNull) + * @exception DBMetaNotFoundException When the DB meta is not found. */ public static DBMeta findDBMeta(String tableFlexibleName) { assertStringNotNullAndNotTrimmedEmpty("tableFlexibleName", tableFlexibleName); - if (_tableDbNameInstanceMap.containsKey(tableFlexibleName)) { - return byTableDbName(tableFlexibleName); - } - String toLowerKey = tableFlexibleName.toLowerCase(); - if (_tableDbNamePropertyNameKeyToLowerMap.containsKey(toLowerKey)) { - String propertyName = (String) _tableDbNamePropertyNameKeyToLowerMap - .get(toLowerKey); - String dbName = (String) _tablePropertyNameDbNameKeyToLowerMap - .get(propertyName.toLowerCase()); - return byTableDbName(dbName); - } - if (_tablePropertyNameDbNameKeyToLowerMap.containsKey(toLowerKey)) { - String dbName = (String) _tablePropertyNameDbNameKeyToLowerMap - .get(toLowerKey); - return byTableDbName(dbName); - } final int dotLastIndex = tableFlexibleName.lastIndexOf("."); if (dotLastIndex >= 0) { - try { - return findDBMeta(tableFlexibleName.substring(dotLastIndex + 1)); - } catch (DBMetaNotFoundException e) { - // Nothing - } + tableFlexibleName = tableFlexibleName.substring(dotLastIndex + + ".".length()); } + final String tableDbName = _tableDbNameFlexibleMap + .get(tableFlexibleName); + if (tableDbName != null) { + return byTableDbName(tableDbName); + } String msg = "The instance map returned null by the key: key=" + tableFlexibleName + " instanceMap=" + _tableDbNameInstanceMap; throw new DBMetaNotFoundException(msg); @@ -202,8 +160,9 @@ assertStringNotNullAndNotTrimmedEmpty("tableDbName", tableDbName); DBMeta instance = getCachedDBMeta(tableDbName); if (instance == null) { - String msg = "The instance map returned null by the key: key=" - + tableDbName + " instanceMap=" + _tableDbNameInstanceMap; + String msg = "The instance map returned null by the key:"; + msg = msg + " key=" + tableDbName + " instanceMap=" + + _tableDbNameInstanceMap; throw new DBMetaNotFoundException(msg); } return instance; @@ -225,10 +184,25 @@ return _tableDbNameInstanceMap.get(tableName); } + protected static DBMeta getDBMeta(String className) { + try { + Class clazz = Class.forName(className); + Method methoz = clazz.getMethod("getInstance", (Class[]) null); + Object result = methoz.invoke(null, (Object[]) null); + return (DBMeta) result; + } catch (Exception e) { + throw new RuntimeException(e); + } + } + //========================================================================== // ========= // General Helper // ============== + protected static ConcurrentHashMap newConcurrentHashMap() { + return new ConcurrentHashMap(); + } + // ----------------------------------------------------- // Assert Object // ------------- Modified: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/dbmeta/hierarchy/HierarchyArranger.java =================================================================== --- timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/dbmeta/hierarchy/HierarchyArranger.java 2008-12-27 22:18:30 UTC (rev 1630) +++ timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/dbmeta/hierarchy/HierarchyArranger.java 2008-12-27 22:20:25 UTC (rev 1631) @@ -222,7 +222,6 @@ * @author DBFlute(AutoGenerator) * @param The type of local entity extends Entity */ - ¡÷ SuppressWarnings("unchecked") public class HierarchyArranger { //========================================================================== @@ -457,9 +456,9 @@ List referrerList = extractReferrerList(localEntity, referrerInfo); if (referrerList == null) { - String msg = "The referrer list should not be null: localEntity=" - + localEntity + " referrerInfo=" + referrerInfo; - throw new IllegalStateException(msg); + // Initialize the list of referrer and inject it. + referrerList = new ArrayList(); + injectReferrerList(localEntity, referrerInfo, referrerList); } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -765,8 +764,8 @@ return capPropReferrerName; } - private java.lang.reflect.Method findMethod(Class clazz, String methodName, - Class[] argTypes) { + private java.lang.reflect.Method findMethod(Class clazz, + String methodName, Class[] argTypes) { try { return clazz.getMethod(methodName, argTypes); } catch (NoSuchMethodException ex) { @@ -852,10 +851,10 @@ return sb.toString(); } - private String createTypeViewFromTypeArray(Class[] array) { + private String createTypeViewFromTypeArray(Class[] array) { final StringBuffer sb = new StringBuffer(); for (int i = 0; i < array.length; i++) { - final Class type = array[i]; + final Class type = array[i]; if (sb.length() == 0) { sb.append(type.getSimpleName()); } else { Modified: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/dbmeta/hierarchy/HierarchyRequest.java =================================================================== --- timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/dbmeta/hierarchy/HierarchyRequest.java 2008-12-27 22:18:30 UTC (rev 1630) +++ timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/dbmeta/hierarchy/HierarchyRequest.java 2008-12-27 22:20:25 UTC (rev 1631) @@ -16,7 +16,6 @@ * @author DBFlute(AutoGenerator) * @param The type of local entity. */ - ¡÷ SuppressWarnings("unchecked") public class HierarchyRequest { //========================================================================== Modified: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/dbmeta/hierarchy/HierarchyRequestElement.java =================================================================== --- timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/dbmeta/hierarchy/HierarchyRequestElement.java 2008-12-27 22:18:30 UTC (rev 1630) +++ timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/dbmeta/hierarchy/HierarchyRequestElement.java 2008-12-27 22:20:25 UTC (rev 1631) @@ -9,7 +9,6 @@ /** * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public class HierarchyRequestElement { //========================================================================== Modified: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/dbmeta/hierarchy/HierarchySourceColumn.java =================================================================== --- timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/dbmeta/hierarchy/HierarchySourceColumn.java 2008-12-27 22:18:30 UTC (rev 1630) +++ timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/dbmeta/hierarchy/HierarchySourceColumn.java 2008-12-27 22:20:25 UTC (rev 1631) @@ -3,7 +3,6 @@ /** * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public interface HierarchySourceColumn { public String getColumnName(); Modified: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/dbmeta/hierarchy/HierarchySourceIterator.java =================================================================== --- timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/dbmeta/hierarchy/HierarchySourceIterator.java 2008-12-27 22:18:30 UTC (rev 1630) +++ timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/dbmeta/hierarchy/HierarchySourceIterator.java 2008-12-27 22:20:25 UTC (rev 1631) @@ -3,7 +3,6 @@ /** * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public interface HierarchySourceIterator { public boolean hasNext(); Modified: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/dbmeta/hierarchy/HierarchySourceRow.java =================================================================== --- timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/dbmeta/hierarchy/HierarchySourceRow.java 2008-12-27 22:18:30 UTC (rev 1630) +++ timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/dbmeta/hierarchy/HierarchySourceRow.java 2008-12-27 22:20:25 UTC (rev 1631) @@ -3,7 +3,6 @@ /** * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public interface HierarchySourceRow { public Object extractColumnValue(HierarchySourceColumn columnInfo); Modified: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/dbmeta/info/ColumnInfo.java =================================================================== --- timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/dbmeta/info/ColumnInfo.java 2008-12-27 22:18:30 UTC (rev 1630) +++ timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/dbmeta/info/ColumnInfo.java 2008-12-27 22:20:25 UTC (rev 1631) @@ -8,7 +8,6 @@ * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public class ColumnInfo { //========================================================================== Modified: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/dbmeta/info/RelationInfo.java =================================================================== --- timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/dbmeta/info/RelationInfo.java 2008-12-27 22:18:30 UTC (rev 1630) +++ timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/dbmeta/info/RelationInfo.java 2008-12-27 22:20:25 UTC (rev 1631) @@ -1,13 +1,14 @@ package jp.sf.pal.timecard.db.allcommon.dbmeta.info; +import java.util.Map; + import jp.sf.pal.timecard.db.allcommon.dbmeta.DBMeta; /** - * The class of referer information. + * The class of referrer information. * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public interface RelationInfo { public String getRelationPropertyName(); @@ -16,7 +17,7 @@ public DBMeta getTargetDBMeta(); - public java.util.Map getLocalTargetColumnInfoMap(); + public Map getLocalTargetColumnInfoMap(); public boolean isOneToOne(); Modified: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/helper/MapStringBuilderImpl.java =================================================================== --- timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/helper/MapStringBuilderImpl.java 2008-12-27 22:18:30 UTC (rev 1630) +++ timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/helper/MapStringBuilderImpl.java 2008-12-27 22:20:25 UTC (rev 1631) @@ -1,17 +1,20 @@ package jp.sf.pal.timecard.db.allcommon.helper; +import java.util.Arrays; +import java.util.List; + import jp.sf.pal.timecard.db.allcommon.helper.token.line.LineToken; import jp.sf.pal.timecard.db.allcommon.helper.token.line.LineTokenizingOption; import jp.sf.pal.timecard.db.allcommon.helper.token.line.impl.LineTokenImpl; /** - * The implementation of map-string-builder. + * The implementation of map-string builder. * * @author DBFlute(AutoGenerator) */ public class MapStringBuilderImpl implements MapStringBuilder { - protected java.util.List _columnNameList; + protected List _columnNameList; protected String _msMapMark; @@ -26,10 +29,10 @@ protected boolean _trimDoubleQuotation; public void setColumnNames(String[] columnNames) { - _columnNameList = java.util.Arrays.asList(columnNames); + _columnNameList = Arrays.asList(columnNames); } - public void setColumnNameList(java.util.List columnNameList) { + public void setColumnNameList(List columnNameList) { _columnNameList = columnNameList; } @@ -83,7 +86,7 @@ return sb.toString(); } - public String buildFromList(java.util.List valueList) { + public String buildFromList(List valueList) { if (valueList == null) { String msg = "The argument[valueList] should not be null."; throw new IllegalArgumentException(msg); @@ -103,7 +106,7 @@ return sb.toString(); } - protected java.util.List tokenize(String value, String delimiter) { + protected List tokenize(String value, String delimiter) { final LineToken lineToken = new LineTokenImpl(); final LineTokenizingOption lineTokenizingOption = new LineTokenizingOption(); lineTokenizingOption.setDelimiter(delimiter); @@ -144,8 +147,8 @@ } } - protected void assertColumnValueList(java.util.List columnNameList, - java.util.List valueList) { + protected void assertColumnValueList(List columnNameList, + List valueList) { if (columnNameList.size() != valueList.size()) { String msg = "The length of columnNameList and valueList are difference. (" + columnNameList.size() + ", " + valueList.size() + ")"; Added: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/helper/StringKeyMap.java =================================================================== --- timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/helper/StringKeyMap.java (rev 0) +++ timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/helper/StringKeyMap.java 2008-12-27 22:20:25 UTC (rev 1631) @@ -0,0 +1,201 @@ +package jp.sf.pal.timecard.db.allcommon.helper; + +import java.util.Collection; +import java.util.HashMap; +import java.util.Map; +import java.util.Set; +import java.util.concurrent.ConcurrentHashMap; + +/** + * @author DBFlute(AutoGenerator) + * @param The type of value. + */ +public class StringKeyMap implements Map { + + //========================================================================== + // ========= + // Attribute + // ========= + protected final Map _internalMap; + + protected boolean _removeUnderscore; + + //========================================================================== + // ========= + // Constructor + // =========== + protected StringKeyMap(boolean removeUnderscore, boolean concurrent) { + _removeUnderscore = removeUnderscore; + if (concurrent) { + _internalMap = newConcurrentHashMap(); + } else { + _internalMap = newHashMap(); + } + } + + public static StringKeyMap createAsFlexible() { + return new StringKeyMap(true, false); + } + + public static StringKeyMap createAsFlexibleConcurrent() { + return new StringKeyMap(true, true); + } + + public static StringKeyMap createAsCaseInsensitive() { + return new StringKeyMap(false, false); + } + + public static StringKeyMap createAsCaseInsensitiveConcurrent() { + return new StringKeyMap(false, true); + } + + //========================================================================== + // ========= + // Map Emulator + // ============ + // ----------------------------------------------------- + // Key Related + // ----------- + public VALUE get(Object key) { + final String stringKey = convertStringKey(key); + if (stringKey != null) { + return _internalMap.get(stringKey); + } + return null; + } + + public VALUE put(String key, VALUE value) { + final String stringKey = convertStringKey(key); + if (stringKey != null) { + return _internalMap.put(stringKey, value); + } + return null; + } + + public VALUE remove(Object key) { + final String stringKey = convertStringKey(key); + if (stringKey != null) { + return _internalMap.remove(stringKey); + } + return null; + } + + public final void putAll(Map map) { + final Set keySet = map.keySet(); + for (String key : keySet) { + put(key, map.get(key)); + } + } + + public boolean containsKey(Object key) { + return get(key) != null; + } + + // ----------------------------------------------------- + // Delegate + // -------- + public void clear() { + _internalMap.clear(); + } + + public int size() { + return _internalMap.size(); + } + + public boolean isEmpty() { + return _internalMap.isEmpty(); + } + + public Set keySet() { + return _internalMap.keySet(); + } + + public Collection values() { + return _internalMap.values(); + } + + public boolean containsValue(Object obj) { + return _internalMap.containsValue(obj); + } + + public Set> entrySet() { + return _internalMap.entrySet(); + } + + //========================================================================== + // ========= + // Key Converter + // ============= + protected String convertStringKey(Object key) { + if (!(key instanceof String)) { + return null; + } + return toLowerCase(removeUnderscore((String) key)); + } + + protected String removeUnderscore(String value) { + if (_removeUnderscore) { + return replace(value, "_", ""); + } + return value; + } + + protected String toLowerCase(String value) { + return value.toLowerCase(); + } + + //========================================================================== + // ========= + // General Helper + // ============== + protected static String replace(String text, String fromText, String toText) { + if (text == null || fromText == null || toText == null) { + return null; + } + StringBuilder sb = new StringBuilder(100); + int pos = 0; + int pos2 = 0; + while (true) { + pos = text.indexOf(fromText, pos2); + if (pos == 0) { + sb.append(toText); + pos2 = fromText.length(); + } else if (pos > 0) { + sb.append(text.substring(pos2, pos)); + sb.append(toText); + pos2 = pos + fromText.length(); + } else { + sb.append(text.substring(pos2)); + break; + } + } + return sb.toString(); + } + + protected static ConcurrentHashMap newConcurrentHashMap() { + return new ConcurrentHashMap(); + } + + protected static HashMap newHashMap() { + return new HashMap(); + } + + //========================================================================== + // ========= + // Basic Override + // ============== + @Override + public boolean equals(Object obj) { + return _internalMap.equals(obj); + } + + @Override + public int hashCode() { + return _internalMap.hashCode(); + } + + @Override + public String toString() { + return _internalMap.toString(); + } +} \ No newline at end of file Property changes on: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/helper/StringKeyMap.java ___________________________________________________________________ Name: svn:eol-style + native Added: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/helper/StringSet.java =================================================================== --- timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/helper/StringSet.java (rev 0) +++ timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/helper/StringSet.java 2008-12-27 22:20:25 UTC (rev 1631) @@ -0,0 +1,233 @@ +package jp.sf.pal.timecard.db.allcommon.helper; + +import java.util.Collection; +import java.util.HashMap; +import java.util.Iterator; +import java.util.Map; +import java.util.Set; +import java.util.concurrent.ConcurrentHashMap; + +/** + * @author DBFlute(AutoGenerator) + */ +public class StringSet implements Set { + + //========================================================================== + // ========= + // Definition + // ========== + protected static final Object DUMMY_VALUE = new Object(); + + //========================================================================== + // ========= + // Attribute + // ========= + protected final Map _internalMap; + + protected boolean _removeUnderscore; + + //========================================================================== + // ========= + // Constructor + // =========== + protected StringSet(boolean removeUnderscore, boolean concurrent) { + _removeUnderscore = removeUnderscore; + if (concurrent) { + _internalMap = newConcurrentHashMap(); + } else { + _internalMap = newHashMap(); + } + } + + public static StringSet createAsFlexible() { + return new StringSet(true, false); + } + + public static StringSet createAsFlexibleConcurrent() { + return new StringSet(true, true); + } + + public static StringSet createAsCaseInsensitive() { + return new StringSet(false, false); + } + + public static StringSet createAsCaseInsensitiveConcurrent() { + return new StringSet(false, true); + } + + //========================================================================== + // ========= + // Map Emulator + // ============ + // ----------------------------------------------------- + // Key Related + // ----------- + public boolean add(String value) { + final String stringValue = convertStringKey(value); + if (stringValue != null) { + return _internalMap.put(stringValue, DUMMY_VALUE) != null; + } + return false; + } + + public boolean remove(Object value) { + final String stringValue = convertStringKey(value); + if (stringValue != null) { + return _internalMap.remove(stringValue) != null; + } + return false; + } + + public boolean contains(Object value) { + final String stringValue = convertStringKey(value); + if (stringValue != null) { + return _internalMap.containsKey(stringValue); + } + return false; + } + + // ----------------------------------------------------- + // Delegate + // -------- + public void clear() { + _internalMap.clear(); + } + + public int size() { + return _internalMap.size(); + } + + public boolean isEmpty() { + return _internalMap.isEmpty(); + } + + public boolean addAll(Collection c) { + boolean success = false; + for (String s : c) { + if (add(s)) { + success = true; + } + } + return success; + } + + public boolean removeAll(Collection c) { + boolean success = false; + for (Object s : c) { + if (remove(s)) { + success = true; + } + } + return success; + } + + public boolean containsAll(Collection c) { + for (Object s : c) { + if (contains(s)) { + return true; + } + } + return false; + } + + public Iterator iterator() { + return _internalMap.keySet().iterator(); + } + + public boolean retainAll(Collection c) { + boolean success = false; + for (Object s : c) { + if (!contains(s)) { + if (remove(s)) { + success = true; + } + } + } + return success; + } + + public Object[] toArray() { + return _internalMap.keySet().toArray(); + } + + public T[] toArray(T[] a) { + return _internalMap.keySet().toArray(a); + } + + //========================================================================== + // ========= + // Key Converter + // ============= + protected String convertStringKey(Object value) { + if (!(value instanceof String)) { + return null; + } + return toLowerCase(removeUnderscore((String) value)); + } + + protected String removeUnderscore(String value) { + if (_removeUnderscore) { + return replace(value, "_", ""); + } + return value; + } + + protected String toLowerCase(String value) { + return value.toLowerCase(); + } + + //========================================================================== + // ========= + // General Helper + // ============== + protected static String replace(String text, String fromText, String toText) { + if (text == null || fromText == null || toText == null) { + return null; + } + StringBuilder sb = new StringBuilder(100); + int pos = 0; + int pos2 = 0; + while (true) { + pos = text.indexOf(fromText, pos2); + if (pos == 0) { + sb.append(toText); + pos2 = fromText.length(); + } else if (pos > 0) { + sb.append(text.substring(pos2, pos)); + sb.append(toText); + pos2 = pos + fromText.length(); + } else { + sb.append(text.substring(pos2)); + break; + } + } + return sb.toString(); + } + + protected static ConcurrentHashMap newConcurrentHashMap() { + return new ConcurrentHashMap(); + } + + protected static HashMap newHashMap() { + return new HashMap(); + } + + //========================================================================== + // ========= + // Basic Override + // ============== + @Override + public boolean equals(Object obj) { + return _internalMap.keySet().equals(obj); + } + + @Override + public int hashCode() { + return _internalMap.keySet().hashCode(); + } + + @Override + public String toString() { + return _internalMap.keySet().toString(); + } +} \ No newline at end of file Property changes on: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/helper/StringSet.java ___________________________________________________________________ Name: svn:eol-style + native Added: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/s2dao/BeanMetaDataFactoryExtension.java =================================================================== --- timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/s2dao/BeanMetaDataFactoryExtension.java (rev 0) +++ timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/s2dao/BeanMetaDataFactoryExtension.java 2008-12-27 22:20:25 UTC (rev 1631) @@ -0,0 +1,213 @@ +package jp.sf.pal.timecard.db.allcommon.s2dao; + +import java.sql.DatabaseMetaData; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.concurrent.ConcurrentHashMap; + +import jp.sf.pal.timecard.db.allcommon.Entity; +import jp.sf.pal.timecard.db.allcommon.s2dao.internal.various.InternalIdentifierGeneratorFactory; + +import org.seasar.dao.BeanMetaData; +import org.seasar.dao.IdentifierGenerator; +import org.seasar.dao.impl.BeanMetaDataFactoryImpl; +import org.seasar.dao.impl.BeanMetaDataImpl; +import org.seasar.extension.jdbc.PropertyType; +import org.seasar.framework.beans.PropertyDesc; + +/** + * BeanMetaDataFactoryImpl for DBFlute. + * + * @author DBFlute(AutoGenerator) + */ + ¡÷ SuppressWarnings("unchecked") +public class BeanMetaDataFactoryExtension extends BeanMetaDataFactoryImpl { + + //========================================================================== + // ========= + // Attribute + // ========= + /** The map of bean meta data for cache. */ + protected Map, BeanMetaData> _metaMap = newConcurrentHashMap(); + + //========================================================================== + // ========= + // Override for Cache + // ================== + @Override + public BeanMetaData createBeanMetaData(Class beanClass) { + final BeanMetaData cachedMeta = findCachedMeta(beanClass); + if (cachedMeta != null) { + return cachedMeta; + } else { + return super.createBeanMetaData(beanClass); + } + } + + @Override + public BeanMetaData createBeanMetaData(Class beanClass, + int relationNestLevel) { + final BeanMetaData cachedMeta = findCachedMeta(beanClass); + if (cachedMeta != null) { + return cachedMeta; + } else { + return super.createBeanMetaData(beanClass, relationNestLevel); + } + } + + @Override + public BeanMetaData createBeanMetaData(DatabaseMetaData dbMetaData, + Class beanClass, int relationNestLevel) { + final BeanMetaData cachedMeta = findOrCreateCachedMetaIfNeeds( + dbMetaData, beanClass, relationNestLevel); + if (cachedMeta != null) { + return cachedMeta; + } else { + return super.createBeanMetaData(dbMetaData, beanClass, + relationNestLevel); + } + } + + protected BeanMetaData findCachedMeta(Class beanClass) { + if (isDBFluteEntity(beanClass)) { + final BeanMetaData cachedMeta = getMetaFromCache(beanClass); + if (cachedMeta != null) { + return cachedMeta; + } + } + return null; + } + + protected BeanMetaData findOrCreateCachedMetaIfNeeds( + DatabaseMetaData dbMetaData, Class beanClass, int relationNestLevel) { + if (isDBFluteEntity(beanClass)) { + final BeanMetaData cachedMeta = getMetaFromCache(beanClass); + if (cachedMeta != null) { + return cachedMeta; + } else { + return super.createBeanMetaData(dbMetaData, beanClass, 0); + } + } + return null; + } + + //========================================================================== + // ========= + // BeanMetaData Creation + // ===================== + @Override + protected BeanMetaDataImpl createBeanMetaDataImpl() { + // /= = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = + // = = + // for ConditionBean and insert() and update() and delete() and so on... + // = = = = = = = = = =/ + return new BeanMetaDataImpl() { + protected List _internalIdentifierGeneratorList = new ArrayList(); + + protected Map _internalIdentifierGeneratorsByPropertyName = newConcurrentHashMap(); + + // /= = = = = = = + // for cache + // = = = = =/ + @Override + public void initialize() { // for Cache + final Class myBeanClass = getBeanClass(); + if (isDBFluteEntity(myBeanClass)) { + final BeanMetaData cachedMeta = getMetaFromCache(myBeanClass); + if (cachedMeta == null) { + _metaMap.put(myBeanClass, this); + } + } + super.initialize(); + } + + // /= = = = = = = + // for insert() + // = = = = =/ + // The attributes 'identifierGenerators' and + // 'identifierGeneratorsByPropertyName' + // of super class are unused. It prepares original atributes here. + @Override + protected void setupIdentifierGenerator(PropertyType propertyType) { + final PropertyDesc pd = propertyType.getPropertyDesc(); + final String propertyName = propertyType.getPropertyName(); + final String idType = beanAnnotationReader.getId(pd, getDbms()); + final IdentifierGenerator generator = createInternalIdentifierGenerator( + propertyType, idType); + _internalIdentifierGeneratorList.add(generator); + _internalIdentifierGeneratorsByPropertyName.put(propertyName, + generator); + } + + protected IdentifierGenerator createInternalIdentifierGenerator( + PropertyType propertyType, String idType) { + return InternalIdentifierGeneratorFactory + .createIdentifierGenerator(propertyType, getDbms(), + idType); + } + + @Override + public IdentifierGenerator getIdentifierGenerator(int index) { + return _internalIdentifierGeneratorList.get(index); + } + + @Override + public int getIdentifierGeneratorSize() { + return _internalIdentifierGeneratorList.size(); + } + + @Override + public IdentifierGenerator getIdentifierGenerator( + String propertyName) { + return _internalIdentifierGeneratorsByPropertyName + .get(propertyName); + } + }; + } + + // /= = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = + // Other extension points about BeanMetaDataImpl is as follows: + // + // S2DaoMetaDataExtension.createNonConcurrencyBmdFactory() + // --> for NonConcurrency (updateNonstrict() and deleteNonstrict() and so + // on...) + // + // S2DaoMetaDataExtension.createOutsideSqlCustomizeBeanMetaDataFactory() + // --> for OutsideSql but it overrides nothing. + // = = = = = = = = = =/ + + //========================================================================== + // ========= + // Relation Next Level + // =================== + /** + * Get the limit nest level of relation. + * + * @return The limit nest level of relation. + */ + @Override + protected int getLimitRelationNestLevel() { + return 2; // for Compatible to old version DBFlute + } + + //========================================================================== + // ========= + // General Helper + // ============== + protected ConcurrentHashMap newConcurrentHashMap() { + return new ConcurrentHashMap(); + } + + //========================================================================== + // ========= + // Assist Helper + // ============= + protected boolean isDBFluteEntity(Class beanClass) { + return Entity.class.isAssignableFrom(beanClass); + } + + protected BeanMetaData getMetaFromCache(Class beanClass) { + return _metaMap.get(beanClass); + } +} \ No newline at end of file Property changes on: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/s2dao/BeanMetaDataFactoryExtension.java ___________________________________________________________________ Name: svn:eol-style + native Modified: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/s2dao/FetchNarrowingResultSetWrapper.java =================================================================== --- timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/s2dao/FetchNarrowingResultSetWrapper.java 2008-12-27 22:18:30 UTC (rev 1630) +++ timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/s2dao/FetchNarrowingResultSetWrapper.java 2008-12-27 22:20:25 UTC (rev 1631) @@ -4,6 +4,7 @@ import java.sql.SQLException; import java.sql.Statement; +import jp.sf.pal.timecard.db.allcommon.DBDef; import jp.sf.pal.timecard.db.allcommon.cbean.FetchNarrowingBean; import jp.sf.pal.timecard.db.allcommon.s2dao.internal.sqlhandler.InternalBasicHandler.SQLExceptionHandler; @@ -41,6 +42,9 @@ /** Does it skip to cursor end? */ protected boolean _skipToCursorEnd; + /** Is the database DB2? */ + protected final boolean _db2 = DBDef.isCurrentDef(DBDef.DB2); + //========================================================================== // ========= // Constructor @@ -71,7 +75,7 @@ // Skip // ==== /** - * Skip to start-index. + * Skip to the point at start index. */ protected void skip() { if (!isAvailableSkipRecord()) { @@ -125,12 +129,15 @@ // Next // ==== /** - * Next. + * Move to the next record. * * @return Does the result set have next record? * @throws SQLException */ public boolean next() throws SQLException { + if (_db2 && _skipToCursorEnd) { // [DBFLUTE-243] + return false; + } final boolean hasNext = super.next(); ++_requestCounter; if (!isAvailableLimitLoopCount()) { Added: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/s2dao/PropertyTypeFactoryBuilderExtension.java =================================================================== --- timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/s2dao/PropertyTypeFactoryBuilderExtension.java (rev 0) +++ timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/s2dao/PropertyTypeFactoryBuilderExtension.java 2008-12-27 22:20:25 UTC (rev 1631) @@ -0,0 +1,215 @@ +package jp.sf.pal.timecard.db.allcommon.s2dao; + +import java.sql.DatabaseMetaData; +import java.util.ArrayList; +import java.util.List; + +import jp.sf.pal.timecard.db.allcommon.Entity; +import jp.sf.pal.timecard.db.allcommon.dbmeta.DBMeta; + +import org.seasar.dao.BeanAnnotationReader; +import org.seasar.dao.ColumnNaming; +import org.seasar.dao.Dbms; +import org.seasar.dao.PropertyTypeFactory; +import org.seasar.dao.PropertyTypeFactoryBuilder; +import org.seasar.dao.ValueTypeFactory; +import org.seasar.dao.impl.AbstractPropertyTypeFactory; +import org.seasar.extension.jdbc.PropertyType; +import org.seasar.framework.beans.BeanDesc; +import org.seasar.framework.beans.PropertyDesc; + +/** + * The factory builder of property type for S2Dao. {Since S2Dao-1.0.47} + * + * @author DBFlute(AutoGenerator) + */ + ¡÷ SuppressWarnings("unchecked") +public class PropertyTypeFactoryBuilderExtension implements + PropertyTypeFactoryBuilder { + + //========================================================================== + // ========= + // Attribute + // ========= + protected ValueTypeFactory valueTypeFactory; + + protected ColumnNaming columnNaming; + + //========================================================================== + // ========= + // Build + // ===== + public PropertyTypeFactory build(Class beanClass, + BeanAnnotationReader beanAnnotationReader) { + return new FastPropertyTypeFactoryExtension(beanClass, + beanAnnotationReader, valueTypeFactory, columnNaming); + } + + public PropertyTypeFactory build(Class beanClass, + BeanAnnotationReader beanAnnotationReader, Dbms dbms, + DatabaseMetaData databaseMetaData) { + return new FastPropertyTypeFactoryExtension(beanClass, + beanAnnotationReader, valueTypeFactory, columnNaming, dbms); + } + + //========================================================================== + // ========= + // Extension Class + // =============== + protected static class FastPropertyTypeFactoryExtension extends + AbstractPropertyTypeFactory { + + protected DBMeta _dbmeta; + + protected String[] _noPersisteneProps; + + public FastPropertyTypeFactoryExtension(Class beanClass, + BeanAnnotationReader beanAnnotationReader, + ValueTypeFactory valueTypeFactory, ColumnNaming columnNaming) { + super(beanClass, beanAnnotationReader, valueTypeFactory, + columnNaming); + initializeResources(); + } + + public FastPropertyTypeFactoryExtension(Class beanClass, + BeanAnnotationReader beanAnnotationReader, + ValueTypeFactory valueTypeFactory, ColumnNaming columnNaming, + Dbms dbms) { + super(beanClass, beanAnnotationReader, valueTypeFactory, + columnNaming, dbms); + initializeResources(); + } + + protected void initializeResources() { + if (isEntity()) { + _dbmeta = findDBMeta(); + } + _noPersisteneProps = beanAnnotationReader.getNoPersisteneProps(); + } + + protected boolean isEntity() { + return Entity.class.isAssignableFrom(beanClass); + } + + protected boolean hasDBMeta() { + return _dbmeta != null; + } + + protected DBMeta findDBMeta() { + try { + final Entity entity = (Entity) beanClass.newInstance(); + return entity.getDBMeta(); + } catch (Exception e) { + String msg = "beanClass.newInstance() threw the exception: beanClass=" + + beanClass; + throw new RuntimeException(msg, e); + } + } + + public PropertyType[] createBeanPropertyTypes(String tableName) { + final List list = new ArrayList(); + final BeanDesc beanDesc = getBeanDesc(); + for (int i = 0; i < beanDesc.getPropertyDescSize(); ++i) { + final PropertyDesc pd = beanDesc.getPropertyDesc(i); + + // Read-only property is unnecessary! + if (!pd.hasWriteMethod()) { + continue; + } + + // Relation property is unnecessary! + if (isRelation(pd)) { + continue; + } + + final PropertyType pt = createPropertyType(pd); + pt.setPrimaryKey(isPrimaryKey(pd)); + pt.setPersistent(isPersistent(pt)); + list.add(pt); + } + return list.toArray(new PropertyType[list.size()]); + } + + @Override + protected boolean isRelation(PropertyDesc propertyDesc) { + final String propertyName = propertyDesc.getPropertyName(); + if (hasDBMeta() + && (_dbmeta.hasForeign(propertyName) || _dbmeta + .hasReferrer(propertyName))) { + return true; + } + return hasRelationNoAnnotation(propertyDesc); + } + + protected boolean hasRelationNoAnnotation(PropertyDesc propertyDesc) { + return beanAnnotationReader.hasRelationNo(propertyDesc); + } + + @Override + protected boolean isPrimaryKey(PropertyDesc propertyDesc) { + final String propertyName = propertyDesc.getPropertyName(); + if (hasDBMeta() && _dbmeta.hasPrimaryKey() + && _dbmeta.hasColumn(propertyName)) { + if (_dbmeta.findColumnInfo(propertyName).isPrimary()) { + return true; + } + } + return hasIdAnnotation(propertyDesc); + } + + protected boolean hasIdAnnotation(PropertyDesc propertyDesc) { + final Dbms dbms = getDbms(); + return beanAnnotationReader.getId(propertyDesc, dbms) != null; + } + + @Override + protected boolean isPersistent(PropertyType propertyType) { + final String propertyName = propertyType.getPropertyName(); + final PropertyDesc propertyDesc = propertyType.getPropertyDesc(); + if ((hasDBMeta() && _dbmeta.hasColumn(propertyName)) + || hasColumnAnnotation(propertyDesc)) { + if (!isElementOfNoPersistentProps(propertyDesc)) { + return true; + } + } + return false; + } + + protected boolean hasColumnAnnotation(PropertyDesc propertyDesc) { + return beanAnnotationReader.getColumnAnnotation(propertyDesc) != null; + } + + protected boolean isElementOfNoPersistentProps(PropertyDesc propertyDesc) { + final String propertyName = propertyDesc.getPropertyName(); + final String[] props = _noPersisteneProps; + if (props != null && props.length >= 0) { + for (int i = 0; i < props.length; ++i) { + if (props[i].equals(propertyName)) { + return true; + } + } + } + return false; + } + } + + //========================================================================== + // ========= + // Accessor + // ======== + public ValueTypeFactory getValueTypeFactory() { + return valueTypeFactory; + } + + public void setValueTypeFactory(ValueTypeFactory valueTypeFactory) { + this.valueTypeFactory = valueTypeFactory; + } + + public ColumnNaming getColumnNaming() { + return columnNaming; + } + + public void setColumnNaming(ColumnNaming columnNaming) { + this.columnNaming = columnNaming; + } +} Added: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/s2dao/SqlLogRegistryLatestSqlProvider.java =================================================================== --- timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/s2dao/SqlLogRegistryLatestSqlProvider.java (rev 0) +++ timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/s2dao/SqlLogRegistryLatestSqlProvider.java 2008-12-27 22:20:25 UTC (rev 1631) @@ -0,0 +1,21 @@ +package jp.sf.pal.timecard.db.allcommon.s2dao; + +import jp.sf.pal.timecard.db.allcommon.jdbc.LatestSqlProvider; +import jp.sf.pal.timecard.db.allcommon.s2dao.internal.sqllog.InternalSqlLogRegistry; + +/** + * The provider of latest SQL using SqlLogRegistry. This instance should be + * singleton. + * + * @author DBFlute(AutoGenerator) + */ +public class SqlLogRegistryLatestSqlProvider implements LatestSqlProvider { + + public String getDisplaySql() { + return InternalSqlLogRegistry.peekCompleteSql(); + } + + public void clearSqlCache() { + InternalSqlLogRegistry.clearSqlLogRegistry(); + } +} Property changes on: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/s2dao/SqlLogRegistryLatestSqlProvider.java ___________________________________________________________________ Name: svn:eol-style + native Modified: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/s2dao/internal/rshandler/InternalAbstractDtoMetaDataResultSetHandler.java =================================================================== --- timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/s2dao/internal/rshandler/InternalAbstractDtoMetaDataResultSetHandler.java 2008-12-27 22:18:30 UTC (rev 1630) +++ timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/s2dao/internal/rshandler/InternalAbstractDtoMetaDataResultSetHandler.java 2008-12-27 22:20:25 UTC (rev 1631) @@ -6,10 +6,11 @@ import java.util.Map; import java.util.Set; +import jp.sf.pal.timecard.db.allcommon.helper.StringSet; + import org.seasar.dao.DtoMetaData; import org.seasar.dao.RowCreator; import org.seasar.extension.jdbc.ResultSetHandler; -import org.seasar.framework.util.CaseInsensitiveSet; /** * @author DBFlute(AutoGenerator) @@ -67,10 +68,10 @@ return rowCreator.createRow(rs, propertyCache, beanClass); } - protected Set createColumnNames(final ResultSetMetaData rsmd) + protected Set createColumnNames(final ResultSetMetaData rsmd) throws SQLException { final int count = rsmd.getColumnCount(); - final Set columnNames = new CaseInsensitiveSet(); + final Set columnNames = StringSet.createAsCaseInsensitive(); for (int i = 0; i < count; ++i) { final String columnName = rsmd.getColumnLabel(i + 1); final int pos = columnName.lastIndexOf('.'); // [DAO-41] Modified: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/s2dao/internal/sqlcommand/InternalAbstractAutoStaticCommand.java =================================================================== --- timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/s2dao/internal/sqlcommand/InternalAbstractAutoStaticCommand.java 2008-12-27 22:18:30 UTC (rev 1630) +++ timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/s2dao/internal/sqlcommand/InternalAbstractAutoStaticCommand.java 2008-12-27 22:20:25 UTC (rev 1631) @@ -10,7 +10,6 @@ import org.seasar.dao.BeanMetaData; import org.seasar.dao.IdentifierGenerator; -import org.seasar.dao.NotSingleRowUpdatedRuntimeException; import org.seasar.dao.PrimaryKeyNotFoundRuntimeException; import org.seasar.extension.jdbc.PropertyType; import org.seasar.extension.jdbc.StatementFactory; @@ -24,19 +23,13 @@ //========================================================================== // ========= - // Definition - // ========== - protected static final boolean DEFAULT_VERSION_NO_AUTO_INCREMENT_ON_MEMORY = true; - - //========================================================================== - // ========= // Attribute // ========= private PropertyType[] propertyTypes; - private boolean checkSingleRowUpdate = true; + protected boolean optimisticLockHandling; - protected boolean versionNoAutoIncrementOnMemory = DEFAULT_VERSION_NO_AUTO_INCREMENT_ON_MEMORY; + protected boolean versionNoAutoIncrementOnMemory; //========================================================================== // ========= @@ -44,15 +37,10 @@ // =========== public InternalAbstractAutoStaticCommand(DataSource dataSource, StatementFactory statementFactory, BeanMetaData beanMetaData, - String[] propertyNames) { - this(dataSource, statementFactory, beanMetaData, propertyNames, - DEFAULT_VERSION_NO_AUTO_INCREMENT_ON_MEMORY); - } - - public InternalAbstractAutoStaticCommand(DataSource dataSource, - StatementFactory statementFactory, BeanMetaData beanMetaData, - String[] propertyNames, boolean versionNoAutoIncrementOnMemory) { + String[] propertyNames, boolean optimisticLockHandling, + boolean versionNoAutoIncrementOnMemory) { super(dataSource, statementFactory, beanMetaData); + this.optimisticLockHandling = optimisticLockHandling; this.versionNoAutoIncrementOnMemory = versionNoAutoIncrementOnMemory; setupPropertyTypes(propertyNames); setupSql(); @@ -62,26 +50,19 @@ // ========= // Execute // ======= - public Object execute(Object[] args) { + public Object execute(Object[] args) { // NOT for Batch. Batch should + // override. InternalAbstractAutoHandler handler = createAutoHandler(); + handler.setOptimisticLockHandling(optimisticLockHandling); + handler + .setVersionNoAutoIncrementOnMemory(versionNoAutoIncrementOnMemory); handler.setSql(getSql()); handler.setLoggingMessageSqlArgs(args); int rows = handler.execute(args); - if (isCheckSingleRowUpdate() && rows != 1) { - throw createNotSingleRowUpdatedRuntimeException(args[0], rows); - } return new Integer(rows); } - public boolean isCheckSingleRowUpdate() { - return checkSingleRowUpdate; - } - - public void setCheckSingleRowUpdate(boolean checkSingleRowUpdate) { - this.checkSingleRowUpdate = checkSingleRowUpdate; - } - - protected NotSingleRowUpdatedRuntimeException createNotSingleRowUpdatedRuntimeException( + protected EntityAlreadyUpdatedException createEntityAlreadyUpdatedException( Object bean, int rows) { return new EntityAlreadyUpdatedException(bean, rows); } @@ -194,7 +175,7 @@ protected void setupDeleteSql() { checkPrimaryKey(); - StringBuilder sb = new StringBuilder(100); + final StringBuilder sb = new StringBuilder(100); sb.append("delete from "); sb.append(getBeanMetaData().getTableName()); setupUpdateWhere(sb); @@ -215,11 +196,11 @@ sb.append(bmd.getPrimaryKey(i)).append(" = ? and "); } sb.setLength(sb.length() - 5); - if (bmd.hasVersionNoPropertyType()) { + if (optimisticLockHandling && bmd.hasVersionNoPropertyType()) { PropertyType pt = bmd.getVersionNoPropertyType(); sb.append(" and ").append(pt.getColumnName()).append(" = ?"); } - if (bmd.hasTimestampPropertyType()) { + if (optimisticLockHandling && bmd.hasTimestampPropertyType()) { PropertyType pt = bmd.getTimestampPropertyType(); sb.append(" and ").append(pt.getColumnName()).append(" = ?"); } Modified: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/s2dao/internal/sqlcommand/InternalAbstractBatchAutoStaticCommand.java =================================================================== --- timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/s2dao/internal/sqlcommand/InternalAbstractBatchAutoStaticCommand.java 2008-12-27 22:18:30 UTC (rev 1630) +++ timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/s2dao/internal/sqlcommand/InternalAbstractBatchAutoStaticCommand.java 2008-12-27 22:20:25 UTC (rev 1631) @@ -15,49 +15,30 @@ //========================================================================== // ========= - // Attribute - // ========= - protected final boolean returningRows; - - //========================================================================== - // ========= // Constructor // =========== public InternalAbstractBatchAutoStaticCommand(DataSource dataSource, StatementFactory statementFactory, BeanMetaData beanMetaData, - String[] propertyNames, boolean returningRows) { - this(dataSource, statementFactory, beanMetaData, propertyNames, - returningRows, DEFAULT_VERSION_NO_AUTO_INCREMENT_ON_MEMORY); - } - - public InternalAbstractBatchAutoStaticCommand(DataSource dataSource, - StatementFactory statementFactory, BeanMetaData beanMetaData, - String[] propertyNames, boolean returningRows, + String[] propertyNames, boolean optimisticLockHandling, boolean versionNoAutoIncrementOnMemory) { super(dataSource, statementFactory, beanMetaData, propertyNames, - versionNoAutoIncrementOnMemory); - this.returningRows = returningRows; + optimisticLockHandling, versionNoAutoIncrementOnMemory); } //========================================================================== // ========= // Execute // ======= + @Override public Object execute(Object[] args) { final InternalAbstractBatchAutoHandler handler = createBatchAutoHandler(); - - // It is unnecessary! - // injectDaoClass(handler); - + handler.setOptimisticLockHandling(optimisticLockHandling); + handler + .setVersionNoAutoIncrementOnMemory(versionNoAutoIncrementOnMemory); handler.setSql(getSql()); // The logging message SQL of procedure is unnecessary. // handler.setLoggingMessageSqlArgs(args); - if (this.returningRows) { - return handler.executeBatch(args); - } else { - final int updatedRows = handler.execute(args); - return new Integer(updatedRows); - } + return handler.executeBatch(args); } protected abstract InternalAbstractBatchAutoHandler createBatchAutoHandler(); Modified: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/s2dao/internal/sqlcommand/InternalAbstractDynamicCommand.java =================================================================== --- timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/s2dao/internal/sqlcommand/InternalAbstractDynamicCommand.java 2008-12-27 22:18:30 UTC (rev 1630) +++ timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/s2dao/internal/sqlcommand/InternalAbstractDynamicCommand.java 2008-12-27 22:20:25 UTC (rev 1631) @@ -44,10 +44,15 @@ } protected InternalSqlParser createInternalSqlParser(String sql) { - return new InternalSqlParser(sql); + return new InternalSqlParser(sql, isBlockNullParameter()); } - public CommandContext apply(Object[] args) {// It is necessary to be public! + protected boolean isBlockNullParameter() { // Extension Point! + return false; + } + + public CommandContext apply(Object[] args) { // It is necessary to be + // public! final CommandContext ctx = createCommandContext(args); rootNode.accept(ctx); return ctx; Modified: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/s2dao/internal/sqlcommand/InternalAbstractSqlCommand.java =================================================================== --- timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/s2dao/internal/sqlcommand/InternalAbstractSqlCommand.java 2008-12-27 22:18:30 UTC (rev 1630) +++ timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/s2dao/internal/sqlcommand/InternalAbstractSqlCommand.java 2008-12-27 22:20:25 UTC (rev 1631) @@ -2,13 +2,16 @@ import javax.sql.DataSource; +import jp.sf.pal.timecard.db.allcommon.bhv.core.SqlExecution; + import org.seasar.dao.SqlCommand; import org.seasar.extension.jdbc.StatementFactory; /** * @author DBFlute(AutoGenerator) */ -public abstract class InternalAbstractSqlCommand implements SqlCommand { +public abstract class InternalAbstractSqlCommand implements SqlCommand, + SqlExecution { //========================================================================== // ========= Modified: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/s2dao/internal/sqlcommand/InternalDeleteAutoStaticCommand.java =================================================================== --- timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/s2dao/internal/sqlcommand/InternalDeleteAutoStaticCommand.java 2008-12-27 22:18:30 UTC (rev 1630) +++ timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/s2dao/internal/sqlcommand/InternalDeleteAutoStaticCommand.java 2008-12-27 22:20:25 UTC (rev 1631) @@ -20,8 +20,9 @@ // =========== public InternalDeleteAutoStaticCommand(DataSource dataSource, StatementFactory statementFactory, BeanMetaData beanMetaData, - String[] propertyNames) { - super(dataSource, statementFactory, beanMetaData, propertyNames); + String[] propertyNames, boolean optimisticLockHandling) { + super(dataSource, statementFactory, beanMetaData, propertyNames, + optimisticLockHandling, false); } //========================================================================== Modified: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/s2dao/internal/sqlcommand/InternalDeleteBatchAutoStaticCommand.java =================================================================== --- timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/s2dao/internal/sqlcommand/InternalDeleteBatchAutoStaticCommand.java 2008-12-27 22:18:30 UTC (rev 1630) +++ timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/s2dao/internal/sqlcommand/InternalDeleteBatchAutoStaticCommand.java 2008-12-27 22:20:25 UTC (rev 1631) @@ -21,9 +21,9 @@ // =========== public InternalDeleteBatchAutoStaticCommand(DataSource dataSource, StatementFactory statementFactory, BeanMetaData beanMetaData, - String[] propertyNames, boolean returningRows) { + String[] propertyNames, boolean optimisticLockHandling) { super(dataSource, statementFactory, beanMetaData, propertyNames, - returningRows); + optimisticLockHandling, false); } //========================================================================== Modified: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/s2dao/internal/sqlcommand/InternalDeleteQueryAutoDynamicCommand.java =================================================================== --- timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/s2dao/internal/sqlcommand/InternalDeleteQueryAutoDynamicCommand.java 2008-12-27 22:18:30 UTC (rev 1630) +++ timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/s2dao/internal/sqlcommand/InternalDeleteQueryAutoDynamicCommand.java 2008-12-27 22:20:25 UTC (rev 1631) @@ -2,6 +2,7 @@ import javax.sql.DataSource; +import jp.sf.pal.timecard.db.allcommon.bhv.core.SqlExecution; import jp.sf.pal.timecard.db.allcommon.cbean.ConditionBean; import jp.sf.pal.timecard.db.allcommon.s2dao.internal.sqlhandler.InternalCommandContextHandler; import jp.sf.pal.timecard.db.allcommon.s2dao.internal.sqlparser.InternalCommandContextCreator; @@ -16,7 +17,8 @@ /** * @author DBFlute(AutoGenerator) */ -public class InternalDeleteQueryAutoDynamicCommand implements SqlCommand { +public class InternalDeleteQueryAutoDynamicCommand implements SqlCommand, + SqlExecution { //========================================================================== // ========= @@ -83,7 +85,7 @@ String[] argNames, Class[] argTypes, Object[] args) { CommandContext context; { - InternalSqlParser parser = new InternalSqlParser(twoWaySql); + InternalSqlParser parser = new InternalSqlParser(twoWaySql, true); Node node = parser.parse(); InternalCommandContextCreator creator = new InternalCommandContextCreator( argNames, argTypes); Modified: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/s2dao/internal/sqlcommand/InternalInsertAutoDynamicCommand.java =================================================================== --- timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/s2dao/internal/sqlcommand/InternalInsertAutoDynamicCommand.java 2008-12-27 22:18:30 UTC (rev 1630) +++ timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/s2dao/internal/sqlcommand/InternalInsertAutoDynamicCommand.java 2008-12-27 22:20:25 UTC (rev 1631) @@ -5,11 +5,11 @@ import javax.sql.DataSource; +import jp.sf.pal.timecard.db.allcommon.bhv.core.SqlExecution; import jp.sf.pal.timecard.db.allcommon.s2dao.internal.sqlhandler.InternalInsertAutoHandler; import org.seasar.dao.BeanMetaData; import org.seasar.dao.IdentifierGenerator; -import org.seasar.dao.NotSingleRowUpdatedRuntimeException; import org.seasar.dao.SqlCommand; import org.seasar.extension.jdbc.PropertyType; import org.seasar.extension.jdbc.StatementFactory; @@ -18,7 +18,8 @@ /** * @author DBFlute(AutoGenerator) */ -public class InternalInsertAutoDynamicCommand implements SqlCommand { +public class InternalInsertAutoDynamicCommand implements SqlCommand, + SqlExecution { //========================================================================== // ========= @@ -32,8 +33,6 @@ protected String[] propertyNames; - protected boolean checkSingleRowUpdate = true; - //========================================================================== // ========= // Constructor @@ -56,9 +55,6 @@ handler.setSql(sql); handler.setLoggingMessageSqlArgs(args); final int rows = handler.execute(args); - if (isCheckSingleRowUpdate() && rows != 1) { - throw new NotSingleRowUpdatedRuntimeException(args[0], rows); - } return new Integer(rows); } @@ -161,12 +157,4 @@ public void setPropertyNames(String[] propertyNames) { this.propertyNames = propertyNames; } - - public boolean isCheckSingleRowUpdate() { - return checkSingleRowUpdate; - } - - public void setCheckSingleRowUpdate(boolean checkSingleRowUpdate) { - this.checkSingleRowUpdate = checkSingleRowUpdate; - } } Modified: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/s2dao/internal/sqlcommand/InternalInsertBatchAutoStaticCommand.java =================================================================== --- timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/s2dao/internal/sqlcommand/InternalInsertBatchAutoStaticCommand.java 2008-12-27 22:18:30 UTC (rev 1630) +++ timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/s2dao/internal/sqlcommand/InternalInsertBatchAutoStaticCommand.java 2008-12-27 22:20:25 UTC (rev 1631) @@ -21,9 +21,9 @@ // =========== public InternalInsertBatchAutoStaticCommand(DataSource dataSource, StatementFactory statementFactory, BeanMetaData beanMetaData, - String[] propertyNames, boolean returningRows) { - super(dataSource, statementFactory, beanMetaData, propertyNames, - returningRows); + String[] propertyNames) { + super(dataSource, statementFactory, beanMetaData, propertyNames, false, + false); } //========================================================================== Modified: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/s2dao/internal/sqlcommand/InternalProcedureCommand.java =================================================================== --- timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/s2dao/internal/sqlcommand/InternalProcedureCommand.java 2008-12-27 22:18:30 UTC (rev 1630) +++ timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/s2dao/internal/sqlcommand/InternalProcedureCommand.java 2008-12-27 22:20:25 UTC (rev 1631) @@ -2,6 +2,7 @@ import javax.sql.DataSource; +import jp.sf.pal.timecard.db.allcommon.bhv.core.SqlExecution; import jp.sf.pal.timecard.db.allcommon.cbean.outsidesql.OutsideSqlContext; import jp.sf.pal.timecard.db.allcommon.s2dao.internal.sqlhandler.InternalProcedureHandler; import jp.sf.pal.timecard.db.allcommon.s2dao.internal.various.InternalProcedureMetaData; @@ -13,7 +14,7 @@ /** * @author DBFlute(AutoGenerator) */ -public class InternalProcedureCommand implements SqlCommand { +public class InternalProcedureCommand implements SqlCommand, SqlExecution { //========================================================================== // ========= Modified: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/s2dao/internal/sqlcommand/InternalUpdateAutoDynamicCommand.java =================================================================== --- timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/s2dao/internal/sqlcommand/InternalUpdateAutoDynamicCommand.java 2008-12-27 22:18:30 UTC (rev 1630) +++ timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/s2dao/internal/sqlcommand/InternalUpdateAutoDynamicCommand.java 2008-12-27 22:20:25 UTC (rev 1631) @@ -5,29 +5,27 @@ import javax.sql.DataSource; +import jp.sf.pal.timecard.db.allcommon.XLog; import jp.sf.pal.timecard.db.allcommon.s2dao.internal.sqlhandler.InternalUpdateAutoHandler; import org.seasar.dao.BeanMetaData; import org.seasar.dao.NoUpdatePropertyTypeRuntimeException; -import org.seasar.dao.impl.AbstractSqlCommand; import org.seasar.extension.jdbc.PropertyType; import org.seasar.extension.jdbc.StatementFactory; /** * @author DBFlute(AutoGenerator) */ -public class InternalUpdateAutoDynamicCommand extends AbstractSqlCommand { +public class InternalUpdateAutoDynamicCommand extends + InternalAbstractSqlCommand { //========================================================================== // ========= // Definition // ========== - /** Log instance. */ - private static final org.apache.commons.logging.Log _log = org.apache.commons.logging.LogFactory - .getLog(InternalUpdateAutoDynamicCommand.class); + /** The result for no update as normal execution. */ + private static final Integer NO_UPDATE = new Integer(1); - private static final Integer NO_UPDATE = new Integer(0); - //========================================================================== // ========= // Attribute @@ -36,9 +34,9 @@ private String[] propertyNames; - private boolean checkSingleRowUpdate = true; + private boolean optimisticLockHandling; - private boolean versionNoAutoIncrementOnMemory = true; + private boolean versionNoAutoIncrementOnMemory; //========================================================================== // ========= @@ -59,8 +57,8 @@ final PropertyType[] propertyTypes = createUpdatePropertyTypes(bmd, bean, getPropertyNames()); if (propertyTypes.length == 0) { - if (_log.isDebugEnabled()) { - _log.debug(createNoUpdateLogMessage(bean, bmd)); + if (isLogEnabled()) { + log(createNoUpdateLogMessage(bean, bmd)); } return NO_UPDATE; } @@ -83,10 +81,10 @@ BeanMetaData bmd, PropertyType[] propertyTypes) { InternalUpdateAutoHandler handler = new InternalUpdateAutoHandler( getDataSource(), getStatementFactory(), bmd, propertyTypes); + handler.setOptimisticLockHandling(optimisticLockHandling); //[DBFlute-0.8 + // .0] handler .setVersionNoAutoIncrementOnMemory(versionNoAutoIncrementOnMemory); - handler.setCheckSingleRowUpdate(isCheckSingleRowUpdate()); //[DBFlute-0.8 - // .0] return handler; } @@ -182,17 +180,33 @@ sb.append(bmd.getPrimaryKey(i)).append(" = ? and "); } sb.setLength(sb.length() - 5); - if (bmd.hasVersionNoPropertyType()) { + if (optimisticLockHandling && bmd.hasVersionNoPropertyType()) { PropertyType pt = bmd.getVersionNoPropertyType(); sb.append(" and ").append(pt.getColumnName()).append(" = ?"); } - if (bmd.hasTimestampPropertyType()) { + if (optimisticLockHandling && bmd.hasTimestampPropertyType()) { PropertyType pt = bmd.getTimestampPropertyType(); sb.append(" and ").append(pt.getColumnName()).append(" = ?"); } return sb.toString(); } + //========================================================================== + // ========= + // Execute Status Log + // ================== + protected void log(String msg) { + XLog.log(msg); + } + + protected boolean isLogEnabled() { + return XLog.isLogEnabled(); + } + + //========================================================================== + // ========= + // Accessor + // ======== protected boolean isVersionNoAutoIncrementOnMemory() { return versionNoAutoIncrementOnMemory; } @@ -223,11 +237,7 @@ this.propertyNames = propertyNames; } - public boolean isCheckSingleRowUpdate() { - return checkSingleRowUpdate; + public void setOptimisticLockHandling(boolean optimisticLockHandling) { + this.optimisticLockHandling = optimisticLockHandling; } - - public void setCheckSingleRowUpdate(boolean resultCheck) { - this.checkSingleRowUpdate = resultCheck; - } } Modified: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/s2dao/internal/sqlcommand/InternalUpdateBatchAutoStaticCommand.java =================================================================== --- timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/s2dao/internal/sqlcommand/InternalUpdateBatchAutoStaticCommand.java 2008-12-27 22:18:30 UTC (rev 1630) +++ timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/s2dao/internal/sqlcommand/InternalUpdateBatchAutoStaticCommand.java 2008-12-27 22:20:25 UTC (rev 1631) @@ -21,10 +21,10 @@ // =========== public InternalUpdateBatchAutoStaticCommand(DataSource dataSource, StatementFactory statementFactory, BeanMetaData beanMetaData, - String[] propertyNames, boolean returningRows, + String[] propertyNames, boolean optimisticLockHandling, boolean versionNoAutoIncrementOnMemory) { super(dataSource, statementFactory, beanMetaData, propertyNames, - returningRows, versionNoAutoIncrementOnMemory); + optimisticLockHandling, versionNoAutoIncrementOnMemory); } //========================================================================== Modified: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/s2dao/internal/sqlcommand/InternalUpdateDynamicCommand.java =================================================================== --- timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/s2dao/internal/sqlcommand/InternalUpdateDynamicCommand.java 2008-12-27 22:18:30 UTC (rev 1630) +++ timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/s2dao/internal/sqlcommand/InternalUpdateDynamicCommand.java 2008-12-27 22:20:25 UTC (rev 1631) @@ -28,11 +28,16 @@ // ======= public Object execute(Object args[]) { final CommandContext ctx = apply(args); - final InternalBasicUpdateHandler updateHandler = new InternalBasicUpdateHandler( - getDataSource(), ctx.getSql(), getStatementFactory()); - Object[] bindVariables = ctx.getBindVariables(); + final InternalBasicUpdateHandler updateHandler = createBasicUpdateHandler(ctx); + final Object[] bindVariables = ctx.getBindVariables(); updateHandler.setLoggingMessageSqlArgs(bindVariables); return new Integer(updateHandler.execute(bindVariables, ctx .getBindVariableTypes())); } + + protected InternalBasicUpdateHandler createBasicUpdateHandler( + CommandContext ctx) { + return new InternalBasicUpdateHandler(getDataSource(), ctx.getSql(), + getStatementFactory()); + } } Modified: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/s2dao/internal/sqlcommand/InternalUpdateQueryAutoDynamicCommand.java =================================================================== --- timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/s2dao/internal/sqlcommand/InternalUpdateQueryAutoDynamicCommand.java 2008-12-27 22:18:30 UTC (rev 1630) +++ timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/s2dao/internal/sqlcommand/InternalUpdateQueryAutoDynamicCommand.java 2008-12-27 22:20:25 UTC (rev 1631) @@ -10,6 +10,7 @@ import javax.sql.DataSource; import jp.sf.pal.timecard.db.allcommon.Entity; +import jp.sf.pal.timecard.db.allcommon.bhv.core.SqlExecution; import jp.sf.pal.timecard.db.allcommon.cbean.ConditionBean; import jp.sf.pal.timecard.db.allcommon.dbmeta.DBMeta; import jp.sf.pal.timecard.db.allcommon.dbmeta.DBMetaInstanceHandler; @@ -27,7 +28,8 @@ /** * @author DBFlute(AutoGenerator) */ -public class InternalUpdateQueryAutoDynamicCommand implements SqlCommand { +public class InternalUpdateQueryAutoDynamicCommand implements SqlCommand, + SqlExecution { //========================================================================== // ========= @@ -209,7 +211,7 @@ String[] argNames, Class[] argTypes, Object[] args) { CommandContext context; { - InternalSqlParser parser = new InternalSqlParser(twoWaySql); + InternalSqlParser parser = new InternalSqlParser(twoWaySql, true); Node node = parser.parse(); InternalCommandContextCreator creator = new InternalCommandContextCreator( argNames, argTypes); Modified: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/s2dao/internal/sqlhandler/InternalAbstractAutoHandler.java =================================================================== --- timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/s2dao/internal/sqlhandler/InternalAbstractAutoHandler.java 2008-12-27 22:18:30 UTC (rev 1630) +++ timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/s2dao/internal/sqlhandler/InternalAbstractAutoHandler.java 2008-12-27 22:20:25 UTC (rev 1631) @@ -10,12 +10,14 @@ import javax.sql.DataSource; +import jp.sf.pal.timecard.db.allcommon.exception.EntityAlreadyUpdatedException; +import jp.sf.pal.timecard.db.allcommon.util.SimpleTypeUtil; + import org.seasar.dao.BeanMetaData; import org.seasar.extension.jdbc.PropertyType; import org.seasar.extension.jdbc.StatementFactory; import org.seasar.extension.jdbc.ValueType; import org.seasar.framework.beans.PropertyDesc; -import org.seasar.framework.util.IntegerConversionUtil; /** * @author DBFlute(AutoGenerator) @@ -38,8 +40,10 @@ protected PropertyType[] propertyTypes; - protected boolean versionNoAutoIncrementOnMemory = true; + protected boolean optimisticLockHandling; + protected boolean versionNoAutoIncrementOnMemory; + //========================================================================== // ========= // Constructor @@ -52,6 +56,10 @@ this.propertyTypes = propertyTypes; } + //========================================================================== + // ========= + // Execute + // ======= public int execute(Object[] args) { Connection connection = getConnection(); try { @@ -77,6 +85,9 @@ } finally { close(ps); } + if (optimisticLockHandling && ret != 1) { + throw createEntityAlreadyUpdatedException(bean, ret); + } postUpdateBean(bean, ret); return ret; } @@ -96,12 +107,25 @@ } } + protected EntityAlreadyUpdatedException createEntityAlreadyUpdatedException( + Object bean, int rows) { + return new EntityAlreadyUpdatedException(bean, rows); + } + + //========================================================================== + // ========= + // Pre/Post Bean + // ============= protected void preUpdateBean(Object bean) { } protected void postUpdateBean(Object bean, int ret) { } + //========================================================================== + // ========= + // Bind Setupper + // ============= protected abstract void setupBindVariables(Object bean); protected void setupInsertBindVariables(Object bean) { @@ -149,7 +173,7 @@ if (value == null) { continue;// because of 'VERSION_NO = VERSION_NO + 1' } - int intValue = IntegerConversionUtil.toPrimitiveInt(value) + 1; + int intValue = SimpleTypeUtil.toPrimitiveInt(value) + 1; setVersionNo(new Integer(intValue)); varList.add(getVersionNo()); } else { @@ -182,13 +206,13 @@ varList.add(pd.getValue(bean)); varValueTypeList.add(pt.getValueType()); } - if (bmd.hasVersionNoPropertyType()) { + if (optimisticLockHandling && bmd.hasVersionNoPropertyType()) { PropertyType pt = bmd.getVersionNoPropertyType(); PropertyDesc pd = pt.getPropertyDesc(); varList.add(pd.getValue(bean)); varValueTypeList.add(pt.getValueType()); } - if (bmd.hasTimestampPropertyType()) { + if (optimisticLockHandling && bmd.hasTimestampPropertyType()) { PropertyType pt = bmd.getTimestampPropertyType(); PropertyDesc pd = pt.getPropertyDesc(); varList.add(pd.getValue(bean)); @@ -260,6 +284,14 @@ this.propertyTypes = propertyTypes; } + public boolean isOptimisticLockHandling() { + return optimisticLockHandling; + } + + public void setOptimisticLockHandling(boolean optimisticLockHandling) { + this.optimisticLockHandling = optimisticLockHandling; + } + protected boolean isVersionNoAutoIncrementOnMemory() { return versionNoAutoIncrementOnMemory; } Modified: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/s2dao/internal/sqlhandler/InternalAbstractBatchAutoHandler.java =================================================================== --- timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/s2dao/internal/sqlhandler/InternalAbstractBatchAutoHandler.java 2008-12-27 22:18:30 UTC (rev 1630) +++ timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/s2dao/internal/sqlhandler/InternalAbstractBatchAutoHandler.java 2008-12-27 22:20:25 UTC (rev 1631) @@ -9,6 +9,11 @@ import javax.sql.DataSource; +import jp.sf.pal.timecard.db.allcommon.DBDef; +import jp.sf.pal.timecard.db.allcommon.exception.BatchEntityAlreadyUpdatedException; +import jp.sf.pal.timecard.db.allcommon.exception.EntityAlreadyDeletedException; +import jp.sf.pal.timecard.db.allcommon.exception.EntityDuplicatedException; + import org.seasar.dao.BeanMetaData; import org.seasar.extension.jdbc.PropertyType; import org.seasar.extension.jdbc.StatementFactory; @@ -41,6 +46,39 @@ // ========= // Execute // ======= + public int execute(Object[] args) { + List list = null; + if (args[0] instanceof Object[]) { + list = Arrays.asList((Object[]) args[0]); + } else if (args[0] instanceof List) { + list = (List) args[0]; + } + if (list == null) { + throw new IllegalArgumentException("args[0]"); + } + int[] ret = execute(list); + int updatedRow = 0; + for (int i = 0; i < ret.length; i++) { + if (ret[i] > 0) { + updatedRow += ret[i]; + } + } + return updatedRow; + } + + public int[] executeBatch(Object[] args) { + List list = null; + if (args[0] instanceof Object[]) { + list = Arrays.asList((Object[]) args[0]); + } else if (args[0] instanceof List) { + list = (List) args[0]; + } + if (list == null) { + throw new IllegalArgumentException("args[0]"); + } + return execute(list); + } + public int[] execute(List list, Class[] argTypes) { return execute(list); } @@ -63,7 +101,9 @@ final Object bean = (Object) iter.next(); prepareBatchElement(ps, bean); } - return executeBatch(ps, list); + final int[] result = executeBatch(ps, list); + handleBatchUpdateResultWithOptimisticLock(ps, list, result); + return result; } finally { close(ps); } @@ -74,46 +114,100 @@ // postBatchUpdateBean(...); } - public int execute(Object[] args) { - List list = null; - if (args[0] instanceof Object[]) { - list = Arrays.asList((Object[]) args[0]); - } else if (args[0] instanceof List) { - list = (List) args[0]; + protected void prepareBatchElement(PreparedStatement ps, Object bean) { + setupBindVariables(bean); + logSql(getBindVariables(), getArgTypes(getBindVariables())); + bindArgs(ps, getBindVariables(), getBindVariableValueTypes()); + addBatch(ps); + } + + //========================================================================== + // ========= + // Optimistic Lock + // =============== + protected void handleBatchUpdateResultWithOptimisticLock( + PreparedStatement ps, List list, int[] result) { + if (DBDef.isCurrentDef(DBDef.Oracle)) { + final int updateCount; + try { + updateCount = ps.getUpdateCount(); + } catch (SQLException e) { + handleSQLException(e, ps); + return; // Unreachable! + } + handleBatchUpdateResultWithOptimisticLockByUpdateCount(list, + updateCount); + } else { + handleBatchUpdateResultWithOptimisticLockByResult(list, result); } - if (list == null) { - throw new IllegalArgumentException("args[0]"); + } + + protected void handleBatchUpdateResultWithOptimisticLockByUpdateCount( + List list, int updateCount) { + if (list.isEmpty()) { + return;// for Safety! } - int[] ret = execute(list); - int updatedRow = 0; - for (int i = 0; i < ret.length; i++) { - if (ret[i] > 0) { - updatedRow += ret[i]; + if (updateCount < 0) { + return;// for Safety! + } + final int entityCount = list.size(); + if (updateCount < entityCount) { + if (isOptimisticLockHandling()) { + throw new BatchEntityAlreadyUpdatedException(list.get(0), 0, + updateCount); + } else { + String msg = "The entity have already deleted:"; + msg = msg + " updateCount=" + updateCount; + msg = msg + " entityCount=" + entityCount; + msg = msg + " allEntities=" + list; + throw new EntityAlreadyDeletedException(msg); } } - return updatedRow; } - public int[] executeBatch(Object[] args) { - List list = null; - if (args[0] instanceof Object[]) { - list = Arrays.asList((Object[]) args[0]); - } else if (args[0] instanceof List) { - list = (List) args[0]; + protected void handleBatchUpdateResultWithOptimisticLockByResult( + List list, int[] result) { + if (list.isEmpty()) { + return;// for Safety! } - if (list == null) { - throw new IllegalArgumentException("args[0]"); + final int[] updatedCountArray = result; + final int entityCount = list.size(); + int index = 0; + boolean alreadyUpdated = false; + for (int oneUpdateCount : updatedCountArray) { + if (entityCount <= index) { + break;// for Safety! + } + if (oneUpdateCount == 0) { + alreadyUpdated = true; + break; + } else if (oneUpdateCount > 1) { + String msg = "The entity updated two or more records in batch update:"; + msg = msg + " entity=" + list.get(index); + msg = msg + " updatedCount=" + oneUpdateCount; + msg = msg + " allEntities=" + list; + throw new EntityDuplicatedException(msg); + } + ++index; } - return execute(list); + if (alreadyUpdated) { + int updateCount = 0; + for (int oneUpdateCount : updatedCountArray) { + updateCount = updateCount + oneUpdateCount; + } + if (isOptimisticLockHandling()) { + throw new BatchEntityAlreadyUpdatedException(list.get(index), + 0, updateCount); + } else { + String msg = "The entity have already deleted:"; + msg = msg + " entity=" + list.get(index); + msg = msg + " updateCount=" + updateCount; + msg = msg + " allEntities=" + list; + throw new EntityAlreadyDeletedException(msg); + } + } } - protected void prepareBatchElement(PreparedStatement ps, Object bean) { - setupBindVariables(bean); - logSql(getBindVariables(), getArgTypes(getBindVariables())); - bindArgs(ps, getBindVariables(), getBindVariableValueTypes()); - addBatch(ps); - } - //========================================================================== // ========= // JDBC Delegator Modified: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/s2dao/internal/sqlhandler/InternalBasicHandler.java =================================================================== --- timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/s2dao/internal/sqlhandler/InternalBasicHandler.java 2008-12-27 22:18:30 UTC (rev 1630) +++ timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/s2dao/internal/sqlhandler/InternalBasicHandler.java 2008-12-27 22:20:25 UTC (rev 1631) @@ -9,6 +9,7 @@ import javax.sql.DataSource; import jp.sf.pal.timecard.db.allcommon.CallbackContext; +import jp.sf.pal.timecard.db.allcommon.DBDef; import jp.sf.pal.timecard.db.allcommon.DBFluteConfig; import jp.sf.pal.timecard.db.allcommon.InternalMapContext; import jp.sf.pal.timecard.db.allcommon.QLog; @@ -25,7 +26,6 @@ import org.seasar.extension.jdbc.StatementFactory; import org.seasar.extension.jdbc.ValueType; import org.seasar.extension.jdbc.types.ValueTypes; -import org.seasar.framework.exception.SQLRuntimeException; /** * @author DBFlute(AutoGenerator) @@ -73,7 +73,7 @@ return; } for (int i = 0; i < args.length; ++i) { - ValueType valueType = getValueType(argTypes[i]); + final ValueType valueType = findValueType(args[i], argTypes[i]); try { valueType.bindValue(ps, i + 1, args[i]); } catch (SQLException e) { @@ -82,6 +82,19 @@ } } + protected ValueType findValueType(Object arg, Class argType) { + ValueType valueType = ValueTypes.getValueType(arg); + if (valueType != null) { + return valueType; + } + valueType = ValueTypes.getValueType(argType); + if (valueType != null) { + return valueType; + } + String msg = "Unknown type¡§argType=" + argType + " args=" + arg; + throw new IllegalStateException(msg); + } + protected Class[] getArgTypes(Object[] args) { if (args == null) { return null; @@ -151,10 +164,6 @@ return InternalBindVariableUtil.getBindVariableText(bindVariable); } - protected ValueType getValueType(Class clazz) { - return ValueTypes.getValueType(clazz); - } - //========================================================================== // ========= // Exception Handler @@ -194,9 +203,6 @@ public void handleSQLException(SQLException e, Statement statement, boolean uniqueConstraintValid, String completeSql) { - if (isSqlExceptionOldStyleHandling()) { - throw new SQLRuntimeException(e); - } if (uniqueConstraintValid && isUniqueConstraintException(e)) { throwEntityAlreadyExistsException(e, statement, completeSql); } @@ -217,10 +223,6 @@ .getUniqueConstraintDeterminator(); } - protected boolean isSqlExceptionOldStyleHandling() { - return DBFluteConfig.getInstance().isSqlExceptionOldStyleHandling(); - } - protected void throwEntityAlreadyExistsException(SQLException e, Statement statement, String completeSql) { String msg = "Look! Read the message below." + getLineSeparator(); @@ -560,7 +562,7 @@ // ========= // Assist Helper // ============= - // It needs this method if the target database doest not support line + // It needs this method if the target database does not support line // comment. protected String removeLineComment(final String sql) { // With removing CR! if (sql == null || sql.trim().length() == 0) { @@ -578,7 +580,8 @@ } sb.append(line).append("\n"); } - return sb.toString(); + final String filteredSql = sb.toString(); + return filteredSql.substring(0, filteredSql.lastIndexOf("\n")); } //========================================================================== @@ -606,9 +609,17 @@ } public void setSql(String sql) { + if (isRemoveLineCommentFromSql()) { + sql = removeLineComment(sql); + } this.sql = sql; } + protected boolean isRemoveLineCommentFromSql() { + // Because the MS-Access does not support line comments. + return DBDef.isCurrentDef(DBDef.MSAccess); + } + public StatementFactory getStatementFactory() { return statementFactory; } Modified: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/s2dao/internal/sqlhandler/InternalBasicSelectHandler.java =================================================================== --- timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/s2dao/internal/sqlhandler/InternalBasicSelectHandler.java 2008-12-27 22:18:30 UTC (rev 1630) +++ timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/s2dao/internal/sqlhandler/InternalBasicSelectHandler.java 2008-12-27 22:20:25 UTC (rev 1631) @@ -45,8 +45,7 @@ return execute(args, getArgTypes(args)); } - @SuppressWarnings("unchecked") - public Object execute(Object[] args, Class[] argTypes) { + public Object execute(Object[] args, Class[] argTypes) { Connection conn = getConnection(); try { return execute(conn, args, argTypes); @@ -55,8 +54,7 @@ } } - @SuppressWarnings("unchecked") - public Object execute(Connection conn, Object[] args, Class[] argTypes) { + public Object execute(Connection conn, Object[] args, Class[] argTypes) { logSql(args, argTypes); PreparedStatement ps = null; try { Modified: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/s2dao/internal/sqlhandler/InternalBasicUpdateHandler.java =================================================================== --- timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/s2dao/internal/sqlhandler/InternalBasicUpdateHandler.java 2008-12-27 22:18:30 UTC (rev 1630) +++ timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/s2dao/internal/sqlhandler/InternalBasicUpdateHandler.java 2008-12-27 22:20:25 UTC (rev 1631) @@ -29,8 +29,7 @@ return execute(args, getArgTypes(args)); } - @SuppressWarnings("unchecked") - public int execute(Object[] args, Class[] argTypes) { + public int execute(Object[] args, Class[] argTypes) { Connection connection = getConnection(); try { return execute(connection, args, argTypes); @@ -39,8 +38,7 @@ } } - @SuppressWarnings("unchecked") - public int execute(Connection connection, Object[] args, Class[] argTypes) { + public int execute(Connection connection, Object[] args, Class[] argTypes) { logSql(args, argTypes); PreparedStatement ps = prepareStatement(connection); try { Modified: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/s2dao/internal/sqlhandler/InternalInsertAutoHandler.java =================================================================== --- timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/s2dao/internal/sqlhandler/InternalInsertAutoHandler.java 2008-12-27 22:18:30 UTC (rev 1630) +++ timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/s2dao/internal/sqlhandler/InternalInsertAutoHandler.java 2008-12-27 22:20:25 UTC (rev 1631) @@ -20,6 +20,7 @@ StatementFactory statementFactory, BeanMetaData beanMetaData, PropertyType[] propertyTypes) { super(dataSource, statementFactory, beanMetaData, propertyTypes); + setOptimisticLockHandling(false); } //========================================================================== Modified: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/s2dao/internal/sqlhandler/InternalInsertBatchAutoHandler.java =================================================================== --- timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/s2dao/internal/sqlhandler/InternalInsertBatchAutoHandler.java 2008-12-27 22:18:30 UTC (rev 1630) +++ timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/s2dao/internal/sqlhandler/InternalInsertBatchAutoHandler.java 2008-12-27 22:20:25 UTC (rev 1631) @@ -19,8 +19,8 @@ public InternalInsertBatchAutoHandler(DataSource dataSource, StatementFactory statementFactory, BeanMetaData beanMetaData, PropertyType[] propertyTypes) { - super(dataSource, statementFactory, beanMetaData, propertyTypes); + setOptimisticLockHandling(false); } //========================================================================== Modified: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/s2dao/internal/sqlhandler/InternalProcedureHandler.java =================================================================== --- timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/s2dao/internal/sqlhandler/InternalProcedureHandler.java 2008-12-27 22:18:30 UTC (rev 1630) +++ timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/s2dao/internal/sqlhandler/InternalProcedureHandler.java 2008-12-27 22:20:25 UTC (rev 1631) @@ -12,6 +12,7 @@ import javax.sql.DataSource; +import jp.sf.pal.timecard.db.allcommon.helper.StringKeyMap; import jp.sf.pal.timecard.db.allcommon.s2dao.internal.various.InternalProcedureMetaData; import jp.sf.pal.timecard.db.allcommon.s2dao.internal.various.InternalProcedureParameterType; @@ -21,7 +22,6 @@ import org.seasar.extension.jdbc.ValueType; import org.seasar.extension.jdbc.impl.PropertyTypeImpl; import org.seasar.extension.jdbc.types.ValueTypes; -import org.seasar.framework.util.CaseInsensitiveMap; /** * @author DBFlute(AutoGenerator) @@ -220,10 +220,9 @@ protected static abstract class InternalAbstractMapResultSetHandler implements ResultSetHandler { - @SuppressWarnings("unchecked") protected Map createRow(ResultSet rs, PropertyType[] propertyTypes) throws SQLException { - Map row = new CaseInsensitiveMap(); + Map row = StringKeyMap.createAsFlexible(); for (int i = 0; i < propertyTypes.length; ++i) { Object value = propertyTypes[i].getValueType().getValue(rs, i + 1); Modified: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/s2dao/internal/sqlhandler/InternalUpdateAutoHandler.java =================================================================== --- timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/s2dao/internal/sqlhandler/InternalUpdateAutoHandler.java 2008-12-27 22:18:30 UTC (rev 1630) +++ timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/s2dao/internal/sqlhandler/InternalUpdateAutoHandler.java 2008-12-27 22:20:25 UTC (rev 1631) @@ -2,8 +2,6 @@ import javax.sql.DataSource; -import jp.sf.pal.timecard.db.allcommon.exception.EntityAlreadyUpdatedException; - import org.seasar.dao.BeanMetaData; import org.seasar.extension.jdbc.PropertyType; import org.seasar.extension.jdbc.StatementFactory; @@ -17,12 +15,6 @@ // ========= // Constructor // =========== - private boolean checkSingleRowUpdate = true; - - //========================================================================== - // ========= - // Constructor - // =========== public InternalUpdateAutoHandler(DataSource dataSource, StatementFactory statementFactory, BeanMetaData beanMetaData, PropertyType[] propertyTypes) { @@ -41,27 +33,7 @@ @Override protected void postUpdateBean(Object bean, int ret) { - if (isCheckSingleRowUpdate() && ret < 1) { - throw createEntityAlreadyUpdatedException(bean, ret); - } updateVersionNoIfNeed(bean); updateTimestampIfNeed(bean); } - - protected EntityAlreadyUpdatedException createEntityAlreadyUpdatedException( - Object bean, int rows) { - return new EntityAlreadyUpdatedException(bean, rows); - } - - //========================================================================== - // ========= - // Accessor - // ======== - public boolean isCheckSingleRowUpdate() { - return checkSingleRowUpdate; - } - - public void setCheckSingleRowUpdate(boolean resultCheck) { - this.checkSingleRowUpdate = resultCheck; - } } Modified: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/s2dao/internal/sqlparser/InternalSqlParser.java =================================================================== --- timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/s2dao/internal/sqlparser/InternalSqlParser.java 2008-12-27 22:18:30 UTC (rev 1630) +++ timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/s2dao/internal/sqlparser/InternalSqlParser.java 2008-12-27 22:20:25 UTC (rev 1631) @@ -45,22 +45,25 @@ // ========= // Attribute // ========= + protected String specifiedSql; + + protected boolean blockNullParameter; + protected InternalSqlTokenizer tokenizer; protected Stack nodeStack = new Stack(); - protected String specifiedSql;// Extension! - //========================================================================== // ========= // Constructor // =========== - public InternalSqlParser(String sql) { + public InternalSqlParser(String sql, boolean blockNullParameter) { sql = sql.trim(); if (sql.endsWith(";")) { sql = sql.substring(0, sql.length() - 1); } - specifiedSql = sql;// Extension! + specifiedSql = sql; + this.blockNullParameter = blockNullParameter; tokenizer = new InternalSqlTokenizer(sql); } @@ -303,12 +306,14 @@ protected AbstractNode createBindVariableNode(String expr, String testValue) {// Extension // ! - return new InternalBindVariableNode(expr, testValue, specifiedSql); + return new InternalBindVariableNode(expr, testValue, specifiedSql, + blockNullParameter); } protected AbstractNode createEmbeddedValueNode(String expr, String testValue) {// Extension // ! - return new InternalEmbeddedValueNode(expr, testValue, specifiedSql); + return new InternalEmbeddedValueNode(expr, testValue, specifiedSql, + blockNullParameter); } protected ContainerNode createIfNode(String expr) {// Extension! @@ -344,12 +349,15 @@ protected String _specifiedSql; + protected boolean _blockNullParameter; + public InternalBindVariableNode(String expression, String testValue, - String specifiedSql) { + String specifiedSql, boolean blockNullParameter) { this._expression = expression; this._testValue = testValue; this._names = InternalStringUtil.split(expression, "."); this._specifiedSql = specifiedSql; + this._blockNullParameter = blockNullParameter; } public void accept(CommandContext ctx) { @@ -360,7 +368,7 @@ valueAndType.setTargetType(clazz); setupValueAndType(valueAndType); - if (valueAndType.getTargetValue() == null) { + if (_blockNullParameter && valueAndType.getTargetValue() == null) { throwBindOrEmbeddedParameterNullValueException(valueAndType); } if (!isInScope()) { @@ -462,12 +470,15 @@ protected String _specifiedSql; + protected boolean _blockNullParameter; + public InternalEmbeddedValueNode(String expression, String testValue, - String specifiedSql) { + String specifiedSql, boolean blockNullParameter) { this._expression = expression; this._testValue = testValue; this._names = InternalStringUtil.split(expression, "."); this._specifiedSql = specifiedSql; + this._blockNullParameter = blockNullParameter; } public void accept(CommandContext ctx) { @@ -478,7 +489,7 @@ valueAndType.setTargetType(clazz); setupValueAndType(valueAndType); - if (valueAndType.getTargetValue() == null) { + if (_blockNullParameter && valueAndType.getTargetValue() == null) { throwBindOrEmbeddedParameterNullValueException(valueAndType); } if (!isInScope()) { @@ -1276,7 +1287,8 @@ String[] argNames, Class[] argTypes, Object[] args) { final CommandContext context; { - final InternalSqlParser parser = new InternalSqlParser(twoWaySql); + final InternalSqlParser parser = new InternalSqlParser(twoWaySql, + false); final Node node = parser.parse(); final InternalCommandContextCreator creator = new InternalCommandContextCreator( argNames, argTypes); Added: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/s2dao/internal/various/InternalIdentifierAbstractGenerator.java =================================================================== --- timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/s2dao/internal/various/InternalIdentifierAbstractGenerator.java (rev 0) +++ timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/s2dao/internal/various/InternalIdentifierAbstractGenerator.java 2008-12-27 22:20:25 UTC (rev 1631) @@ -0,0 +1,146 @@ +package jp.sf.pal.timecard.db.allcommon.s2dao.internal.various; + +import java.sql.CallableStatement; +import java.sql.Connection; +import java.sql.PreparedStatement; +import java.sql.ResultSet; +import java.sql.SQLException; +import java.sql.Statement; + +import javax.sql.DataSource; + +import jp.sf.pal.timecard.db.allcommon.s2dao.internal.sqlhandler.InternalBasicSelectHandler; +import jp.sf.pal.timecard.db.allcommon.s2dao.internal.sqlhandler.InternalBasicHandler.SQLExceptionHandler; + +import org.seasar.dao.Dbms; +import org.seasar.dao.IdentifierGenerator; +import org.seasar.extension.jdbc.PropertyType; +import org.seasar.extension.jdbc.ResultSetHandler; +import org.seasar.extension.jdbc.StatementFactory; +import org.seasar.extension.jdbc.ValueType; +import org.seasar.framework.beans.PropertyDesc; + +/** + * @author DBFlute(AutoGenerator) + */ +public abstract class InternalIdentifierAbstractGenerator implements + IdentifierGenerator { + + //========================================================================== + // ========= + // Attribute + // ========= + protected PropertyType propertyType; + + protected Dbms dbms; + + protected ResultSetHandler resultSetHandler; + + //========================================================================== + // ========= + // Constructor + // =========== + public InternalIdentifierAbstractGenerator(PropertyType propertyType, + Dbms dbms) { + this.propertyType = propertyType; + this.dbms = dbms; + resultSetHandler = new InternalIdentifierResultSetHandler(propertyType + .getValueType()); + } + + //========================================================================== + // ========= + // Assist Helper + // ============= + protected Object executeSql(DataSource ds, String sql, Object[] args) { + InternalBasicSelectHandler selectHandler = createSelectHandler(ds, sql); + if (args != null) { + selectHandler.setLoggingMessageSqlArgs(args); + } + return selectHandler.execute(args); + } + + protected InternalBasicSelectHandler createSelectHandler(DataSource ds, + String sql) { + // Use original statement factory for identifier generator. + return new InternalBasicSelectHandler(ds, sql, resultSetHandler, + createStatementFactory(ds, sql)); + } + + protected StatementFactory createStatementFactory(DataSource ds, String sql) { + return new InternalIdentifierGeneratorStatementFactory(); + } + + protected void reflectIdentifier(Object bean, Object value) { + if (propertyType == null) { + String msg = "The arguement[propertyType] should not be null: value=" + + value; + throw new IllegalArgumentException(msg); + } + PropertyDesc pd = propertyType.getPropertyDesc(); + pd.setValue(bean, value); + } + + //========================================================================== + // ========= + // Result Set Handler + // ================== + protected static class InternalIdentifierResultSetHandler implements + ResultSetHandler { + private ValueType valueType; + + public InternalIdentifierResultSetHandler(ValueType valueType) { + this.valueType = valueType; + } + + public Object handle(ResultSet rs) throws SQLException { + if (rs.next()) { + return valueType.getValue(rs, 1); + } + return null; + } + } + + //========================================================================== + // ========= + // Statement Factory + // ================= + protected static class InternalIdentifierGeneratorStatementFactory + implements StatementFactory { + public PreparedStatement createPreparedStatement(Connection conn, + String sql) { + try { + return conn.prepareStatement(sql); + } catch (SQLException e) { + handleSQLException(e, null); + return null; // Unreachable! + } + } + + public CallableStatement createCallableStatement(Connection conn, + String sql) { + try { + return conn.prepareCall(sql); + } catch (SQLException e) { + handleSQLException(e, null); + return null; // Unreachable! + } + } + + protected void handleSQLException(SQLException e, Statement statement) { + new SQLExceptionHandler().handleSQLException(e, statement); + } + } + + //========================================================================== + // ========= + // Accessor + // ======== + public String getPropertyName() { + return propertyType.getPropertyName(); + } + + public Dbms getDbms() { + return dbms; + } +} Property changes on: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/s2dao/internal/various/InternalIdentifierAbstractGenerator.java ___________________________________________________________________ Name: svn:eol-style + native Added: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/s2dao/internal/various/InternalIdentifierAssignedGenerator.java =================================================================== --- timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/s2dao/internal/various/InternalIdentifierAssignedGenerator.java (rev 0) +++ timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/s2dao/internal/various/InternalIdentifierAssignedGenerator.java 2008-12-27 22:20:25 UTC (rev 1631) @@ -0,0 +1,33 @@ +package jp.sf.pal.timecard.db.allcommon.s2dao.internal.various; + +import javax.sql.DataSource; + +import org.seasar.dao.Dbms; +import org.seasar.extension.jdbc.PropertyType; + +/** + * @author DBFlute(AutoGenerator) + */ +public class InternalIdentifierAssignedGenerator extends + InternalIdentifierAbstractGenerator { + + //========================================================================== + // ========= + // Constructor + // =========== + public InternalIdentifierAssignedGenerator(PropertyType propertyType, + Dbms dbms) { + super(propertyType, dbms); + } + + //========================================================================== + // ========= + // Implementation + // ============== + public void setIdentifier(Object bean, DataSource ds) { + } + + public boolean isSelfGenerate() { + return true; + } +} Property changes on: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/s2dao/internal/various/InternalIdentifierAssignedGenerator.java ___________________________________________________________________ Name: svn:eol-style + native Added: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/s2dao/internal/various/InternalIdentifierGeneratorFactory.java =================================================================== --- timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/s2dao/internal/various/InternalIdentifierGeneratorFactory.java (rev 0) +++ timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/s2dao/internal/various/InternalIdentifierGeneratorFactory.java 2008-12-27 22:20:25 UTC (rev 1631) @@ -0,0 +1,105 @@ +package jp.sf.pal.timecard.db.allcommon.s2dao.internal.various; + +import java.lang.reflect.Constructor; +import java.util.HashMap; +import java.util.Map; + +import jp.sf.pal.timecard.db.allcommon.util.SimpleStringUtil; + +import org.seasar.dao.Dbms; +import org.seasar.dao.IdentifierGenerator; +import org.seasar.extension.jdbc.PropertyType; +import org.seasar.framework.beans.BeanDesc; +import org.seasar.framework.beans.PropertyDesc; +import org.seasar.framework.beans.factory.BeanDescFactory; +import org.seasar.framework.util.ClassUtil; +import org.seasar.framework.util.ConstructorUtil; + +/** + * @author DBFlute(AutoGenerator) + */ +public class InternalIdentifierGeneratorFactory { + + //========================================================================== + // ========= + // Attribute + // ========= + private static Map> generatorClasses = new HashMap>(); + + static { + addIdentifierGeneratorClass("assigned", + InternalIdentifierAssignedGenerator.class); + addIdentifierGeneratorClass("identity", + InternalIdentifierIdentityGenerator.class); + addIdentifierGeneratorClass("sequence", + InternalIdentifierSequenceGenerator.class); + } + + //========================================================================== + // ========= + // Constructor + // =========== + private InternalIdentifierGeneratorFactory() { + } + + //========================================================================== + // ========= + // Identifier Generator + // ==================== + public static void addIdentifierGeneratorClass(String name, Class clazz) { + generatorClasses.put(name, clazz); + } + + public static IdentifierGenerator createIdentifierGenerator( + PropertyType propertyType, Dbms dbms) { + return createIdentifierGenerator(propertyType, dbms, null); + } + + public static IdentifierGenerator createIdentifierGenerator( + PropertyType propertyType, Dbms dbms, String annotation) { + if (propertyType == null) { + String msg = "The argument[propertyType] should not be null: dbms=" + + dbms + " annotation=" + annotation; + throw new IllegalArgumentException(msg); + } + if (dbms == null) { + String msg = "The argument[dbms] should not be null: propertyType=" + + propertyType + " annotation=" + annotation; + throw new IllegalArgumentException(msg); + } + if (annotation == null) { + return new InternalIdentifierAssignedGenerator(propertyType, dbms); + } + String[] array = SimpleStringUtil.split(annotation, "=, "); + Class clazz = getGeneratorClass(array[0]); + IdentifierGenerator generator = createIdentifierGenerator(clazz, + propertyType, dbms); + for (int i = 1; i < array.length; i += 2) { + setProperty(generator, array[i].trim(), array[i + 1].trim()); + } + return generator; + } + + protected static Class getGeneratorClass(String name) { + Class clazz = generatorClasses.get(name); + if (clazz != null) { + return clazz; + } + return ClassUtil.forName(name); + } + + protected static IdentifierGenerator createIdentifierGenerator( + Class clazz, PropertyType propertyType, Dbms dbms) { + Constructor constructor = ClassUtil.getConstructor(clazz, + new Class[] { PropertyType.class, Dbms.class }); + return (IdentifierGenerator) ConstructorUtil.newInstance(constructor, + new Object[] { propertyType, dbms }); + } + + protected static void setProperty(IdentifierGenerator generator, + String propertyName, String value) { + BeanDesc beanDesc = BeanDescFactory.getBeanDesc(generator.getClass()); + PropertyDesc pd = beanDesc.getPropertyDesc(propertyName); + pd.setValue(generator, value); + } +} Property changes on: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/s2dao/internal/various/InternalIdentifierGeneratorFactory.java ___________________________________________________________________ Name: svn:eol-style + native Added: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/s2dao/internal/various/InternalIdentifierIdentityGenerator.java =================================================================== --- timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/s2dao/internal/various/InternalIdentifierIdentityGenerator.java (rev 0) +++ timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/s2dao/internal/various/InternalIdentifierIdentityGenerator.java 2008-12-27 22:20:25 UTC (rev 1631) @@ -0,0 +1,35 @@ +package jp.sf.pal.timecard.db.allcommon.s2dao.internal.various; + +import javax.sql.DataSource; + +import org.seasar.dao.Dbms; +import org.seasar.extension.jdbc.PropertyType; + +/** + * @author DBFlute(AutoGenerator) + */ +public class InternalIdentifierIdentityGenerator extends + InternalIdentifierAbstractGenerator { + + //========================================================================== + // ========= + // Constructor + // =========== + public InternalIdentifierIdentityGenerator(PropertyType propertyType, + Dbms dbms) { + super(propertyType, dbms); + } + + //========================================================================== + // ========= + // Implementation + // ============== + public void setIdentifier(Object bean, DataSource ds) { + Object value = executeSql(ds, getDbms().getIdentitySelectString(), null); + reflectIdentifier(bean, value); + } + + public boolean isSelfGenerate() { + return false; + } +} Property changes on: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/s2dao/internal/various/InternalIdentifierIdentityGenerator.java ___________________________________________________________________ Name: svn:eol-style + native Added: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/s2dao/internal/various/InternalIdentifierSequenceGenerator.java =================================================================== --- timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/s2dao/internal/various/InternalIdentifierSequenceGenerator.java (rev 0) +++ timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/s2dao/internal/various/InternalIdentifierSequenceGenerator.java 2008-12-27 22:20:25 UTC (rev 1631) @@ -0,0 +1,116 @@ +package jp.sf.pal.timecard.db.allcommon.s2dao.internal.various; + +import java.util.HashMap; + +import javax.sql.DataSource; + +import jp.sf.pal.timecard.db.allcommon.util.SimpleTypeUtil; + +import org.seasar.dao.Dbms; +import org.seasar.extension.jdbc.PropertyType; + +/** + * @author DBFlute(AutoGenerator) + */ +public class InternalIdentifierSequenceGenerator extends + InternalIdentifierAbstractGenerator { + + // - - - - - - - - - - + // [Unused on DBFlute] + // - - - - - - - - - - + + //========================================================================== + // ========= + // Attribute + // ========= + private String sequenceName; + + private long allocationSize = 0; + + private HashMap idContextMap = new HashMap(); + + //========================================================================== + // ========= + // Constructor + // =========== + public InternalIdentifierSequenceGenerator(PropertyType propertyType, + Dbms dbms) { + super(propertyType, dbms); + } + + //========================================================================== + // ========= + // Implementation + // ============== + public void setIdentifier(Object bean, DataSource ds) { + reflectIdentifier(bean, getNextValue(ds)); + } + + public boolean isSelfGenerate() { + return getDbms().isSelfGenerate(); + } + + //========================================================================== + // ========= + // Next Value + // ========== + protected Object getNextValue(DataSource ds) { + if (allocationSize > 0) { + long value = getIdContext(ds).getNextValue(ds); + return new Long(value); + } + return getNewInitialValue(ds); + } + + protected Object getNewInitialValue(DataSource ds) { + return executeSql(ds, getDbms().getSequenceNextValString(sequenceName), + null); + } + + protected IdContext getIdContext(DataSource ds) { + synchronized (idContextMap) { + IdContext context = idContextMap.get(ds); + if (context == null) { + context = new IdContext(); + idContextMap.put(ds, context); + } + return context; + } + } + + public class IdContext { + protected long initialValue; + + protected long allocated = Long.MAX_VALUE; + + public synchronized long getNextValue(DataSource ds) { + if (allocated < allocationSize) { + return initialValue + allocated++; + } + initialValue = SimpleTypeUtil + .toPrimitiveLong(getNewInitialValue(ds)); + allocated = 1; + return initialValue; + } + } + + //========================================================================== + // ========= + // Accessor + // ======== + public String getSequenceName() { + return sequenceName; + } + + public void setSequenceName(String sequenceName) { + this.sequenceName = sequenceName; + } + + public long getAllocationSize() { + return allocationSize; + } + + public void setAllocationSize(long allocationSize) { + this.allocationSize = allocationSize; + } +} Property changes on: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/s2dao/internal/various/InternalIdentifierSequenceGenerator.java ___________________________________________________________________ Name: svn:eol-style + native Modified: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/s2dao/internal/various/InternalProcedureMetaDataFactory.java =================================================================== --- timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/s2dao/internal/various/InternalProcedureMetaDataFactory.java 2008-12-27 22:18:30 UTC (rev 1630) +++ timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/s2dao/internal/various/InternalProcedureMetaDataFactory.java 2008-12-27 22:20:25 UTC (rev 1631) @@ -7,7 +7,7 @@ import java.util.Map; import java.util.Stack; -import jp.sf.pal.timecard.db.allcommon.cbean.ConditionBeanContext; +import jp.sf.pal.timecard.db.allcommon.DBDef; import org.seasar.dao.ValueTypeFactory; import org.seasar.dao.util.TypeUtil; @@ -146,9 +146,9 @@ } final Class type = field.getType(); if (List.class.isAssignableFrom(type)) {// is for out parameter cursor. - if (ConditionBeanContext.isOracle()) { + if (DBDef.isCurrentDef(DBDef.Oracle)) { return ValueTypes.ORACLE_RESULT_SET; - } else if (ConditionBeanContext.isPostgreSql()) { + } else if (DBDef.isCurrentDef(DBDef.PostgreSQL)) { return ValueTypes.POSTGRE_RESULT_SET; } else { return ValueTypes.SERIALIZABLE_BYTE_ARRAY; Added: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/s2dao/internal/various/InternalStatementFactory.java =================================================================== --- timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/s2dao/internal/various/InternalStatementFactory.java (rev 0) +++ timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/s2dao/internal/various/InternalStatementFactory.java 2008-12-27 22:20:25 UTC (rev 1631) @@ -0,0 +1,158 @@ +package jp.sf.pal.timecard.db.allcommon.s2dao.internal.various; + +import java.sql.CallableStatement; +import java.sql.Connection; +import java.sql.PreparedStatement; +import java.sql.SQLException; +import java.sql.Statement; + +import jp.sf.pal.timecard.db.allcommon.cbean.ConditionBean; +import jp.sf.pal.timecard.db.allcommon.cbean.ConditionBeanContext; +import jp.sf.pal.timecard.db.allcommon.cbean.outsidesql.OutsideSqlContext; +import jp.sf.pal.timecard.db.allcommon.jdbc.StatementConfig; +import jp.sf.pal.timecard.db.allcommon.s2dao.internal.sqlhandler.InternalBasicHandler.SQLExceptionHandler; + +import org.seasar.extension.jdbc.StatementFactory; + +/** + * @author DBFlute(AutoGenerator) + */ +public class InternalStatementFactory implements StatementFactory { + + //========================================================================== + // ========= + // Definition + // ========== + /** Log-instance. */ + private static final org.apache.commons.logging.Log _log = org.apache.commons.logging.LogFactory + .getLog(InternalStatementFactory.class); + + //========================================================================== + // ========= + // Attribute + // ========= + protected StatementConfig defaultStatementConfig; + + protected boolean internalDebug; + + //========================================================================== + // ========= + // Constructor + // =========== + public InternalStatementFactory() { + } + + //========================================================================== + // ========= + // Implementation + // ============== + public PreparedStatement createPreparedStatement(Connection conn, String sql) { + try { + final StatementConfig config = findStatementConfigOnThread(); + ; + final int resultSetType; + if (config != null && config.hasResultSetType()) { + resultSetType = config.getResultSetType(); + } else if (defaultStatementConfig != null + && defaultStatementConfig.hasResultSetType()) { + resultSetType = defaultStatementConfig.getResultSetType(); + } else { + resultSetType = java.sql.ResultSet.TYPE_FORWARD_ONLY; + } + final int resultSetConcurrency = java.sql.ResultSet.CONCUR_READ_ONLY; + if (internalDebug) { + _log.debug("...Creating prepareStatement(sql, " + resultSetType + + ", " + resultSetConcurrency + ")"); + } + final PreparedStatement ps = conn.prepareStatement(sql, + resultSetType, resultSetConcurrency); + if (config != null && config.hasStatementOptions()) { + if (internalDebug) { + _log.debug("...Setting statement config as request: " + + config); + } + reflectStatementOptions(config, ps); + } else { + reflectDefaultOptionsToStatementIfNeeds(ps); + } + return ps; + } catch (SQLException e) { + handleSQLException(e, null); + return null;// Unreachable! + } + } + + public CallableStatement createCallableStatement(Connection conn, String sql) { + return prepareCall(conn, sql); + } + + protected StatementConfig findStatementConfigOnThread() { + final StatementConfig config; + if (ConditionBeanContext.isExistConditionBeanOnThread()) { + final ConditionBean cb = ConditionBeanContext + .getConditionBeanOnThread(); + config = cb.getStatementConfig(); + } else if (OutsideSqlContext.isExistOutsideSqlContextOnThread()) { + final OutsideSqlContext context = OutsideSqlContext + .getOutsideSqlContextOnThread(); + config = context.getStatementConfig(); + } else { + config = null; + } + return config; + } + + protected void reflectDefaultOptionsToStatementIfNeeds(PreparedStatement ps) { + if (defaultStatementConfig != null + && defaultStatementConfig.hasStatementOptions()) { + if (internalDebug) { + _log.debug("...Setting statement config as default: " + + defaultStatementConfig); + } + reflectStatementOptions(defaultStatementConfig, ps); + return; + } + } + + protected void reflectStatementOptions(StatementConfig config, + PreparedStatement ps) { + try { + if (config.hasQueryTimeout()) { + ps.setQueryTimeout(config.getQueryTimeout()); + } + if (config.hasFetchSize()) { + ps.setFetchSize(config.getFetchSize()); + } + if (config.hasMaxRows()) { + ps.setMaxRows(config.getMaxRows()); + } + } catch (SQLException e) { + handleSQLException(e, ps); + } + } + + protected CallableStatement prepareCall(Connection conn, String sql) { + try { + return conn.prepareCall(sql); + } catch (SQLException e) { + handleSQLException(e, null); + return null;// Unreachable! + } + } + + protected void handleSQLException(SQLException e, Statement statement) { + new SQLExceptionHandler().handleSQLException(e, statement); + } + + //========================================================================== + // ========= + // Accessor + // ======== + public void setDefaultStatementConfig(StatementConfig defaultStatementConfig) { + this.defaultStatementConfig = defaultStatementConfig; + } + + public void setInternalDebug(boolean internalDebug) { + this.internalDebug = internalDebug; + } +} Property changes on: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/s2dao/internal/various/InternalStatementFactory.java ___________________________________________________________________ Name: svn:eol-style + native Modified: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/util/SimpleAssertUtil.java =================================================================== --- timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/util/SimpleAssertUtil.java 2008-12-27 22:18:30 UTC (rev 1630) +++ timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/util/SimpleAssertUtil.java 2008-12-27 22:20:25 UTC (rev 1631) @@ -7,11 +7,8 @@ //========================================================================== // ========= - // Assert + // Object // ====== - // ----------------------------------------------------- - // Assert Object - // ------------- /** * Assert that the object is not null. * @@ -32,9 +29,10 @@ } } - // ----------------------------------------------------- - // Assert String - // ------------- + //========================================================================== + // ========= + // String + // ====== /** * Assert that the entity is not null and not trimmed empty. * Added: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/util/SimpleResourceUtil.java =================================================================== --- timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/util/SimpleResourceUtil.java (rev 0) +++ timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/util/SimpleResourceUtil.java 2008-12-27 22:20:25 UTC (rev 1631) @@ -0,0 +1,117 @@ +package jp.sf.pal.timecard.db.allcommon.util; + +import java.io.IOException; +import java.io.InputStream; +import java.net.URL; +import java.net.URLConnection; + +/** + * @author DBFlute(AutoGenerator) + */ +public class SimpleResourceUtil { + + //========================================================================== + // ========= + // Resource Path + // ============= + public static String getResourcePath(String path, String extension) { + if (extension == null) { + return path; + } + extension = "." + extension; + if (path.endsWith(extension)) { + return path; + } + return path.replace('.', '/') + extension; + } + + public static String getResourcePath(Class clazz) { + return clazz.getName().replace('.', '/') + ".class"; + } + + //========================================================================== + // ========= + // Resource URL + // ============ + public static URL getResourceUrl(String path) { + return getResourceUrl(path, null); + } + + public static URL getResourceUrl(String path, String extension) { + return getResourceUrl(path, extension, Thread.currentThread() + .getContextClassLoader()); + } + + public static URL getResourceUrl(String path, String extension, + ClassLoader loader) { + if (path == null || loader == null) { + return null; + } + path = getResourcePath(path, extension); + return loader.getResource(path); + } + + //========================================================================== + // ========= + // Resource Stream + // =============== + public static InputStream getResourceStream(String path) { + return getResourceStream(path, null); + } + + public static InputStream getResourceStream(String path, String extension) { + final URL url = getResourceUrl(path, extension); + return url != null ? openStream(url) : null; + } + + //========================================================================== + // ========= + // Resource Existence + // ================== + public static boolean isExist(String path) { + return getResourceUrl(path) != null; + } + + //========================================================================== + // ========= + // Assist Helper + // ============= + protected static ClassLoader getClassLoader() { + return Thread.currentThread().getContextClassLoader(); + } + + protected static InputStream openStream(URL url) { + try { + URLConnection connection = url.openConnection(); + connection.setUseCaches(false); + return connection.getInputStream(); + } catch (IOException e) { + String msg = "Failed to open the stream: url=" + url; + throw new IllegalStateException(msg, e); + } + } + + //========================================================================== + // ========= + // Assert Helper + // ============= + /** + * Assert that the object is not null. + * + * @param variableName Variable name. (NotNull) + * @param value Value. (NotNull) + * @exception IllegalArgumentException + */ + protected static void assertObjectNotNull(String variableName, Object value) { + if (variableName == null) { + String msg = "The value should not be null: variableName=" + + variableName + " value=" + value; + throw new IllegalArgumentException(msg); + } + if (value == null) { + String msg = "The value should not be null: variableName=" + + variableName; + throw new IllegalArgumentException(msg); + } + } +} Property changes on: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/util/SimpleResourceUtil.java ___________________________________________________________________ Name: svn:eol-style + native Modified: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/util/SimpleStringUtil.java =================================================================== --- timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/util/SimpleStringUtil.java 2008-12-27 22:18:30 UTC (rev 1630) +++ timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/util/SimpleStringUtil.java 2008-12-27 22:20:25 UTC (rev 1631) @@ -1,14 +1,20 @@ package jp.sf.pal.timecard.db.allcommon.util; +import java.util.ArrayList; +import java.util.List; +import java.util.StringTokenizer; + /** * @author DBFlute(AutoGenerator) */ public class SimpleStringUtil { + protected static final String[] EMPTY_STRINGS = new String[0]; + //========================================================================== // ========= - // String - // ====== + // Replace + // ======= public static String replace(String text, String fromText, String toText) { if (text == null || fromText == null || toText == null) { return null; @@ -32,6 +38,26 @@ } while (true); } + //========================================================================== + // ========= + // Split + // ===== + public static String[] split(final String str, final String delimiter) { + if (str == null || str.trim().length() == 0) { + return EMPTY_STRINGS; + } + final List list = new ArrayList(); + final StringTokenizer st = new StringTokenizer(str, delimiter); + while (st.hasMoreElements()) { + list.add(st.nextToken()); + } + return (String[]) list.toArray(new String[list.size()]); + } + + //========================================================================== + // ========= + // Initial Convert + // =============== public static String initCap(String str) { assertObjectNotNull("str", str); return str.substring(0, 1).toUpperCase() + str.substring(1); @@ -42,9 +68,10 @@ return str.substring(0, 1).toLowerCase() + str.substring(1); } - // ----------------------------------------------------- - // Assert Object - // ------------- + //========================================================================== + // ========= + // Assert Helper + // ============= /** * Assert that the object is not null. * Modified: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/util/SimpleSystemUtil.java =================================================================== --- timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/util/SimpleSystemUtil.java 2008-12-27 22:18:30 UTC (rev 1630) +++ timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/util/SimpleSystemUtil.java 2008-12-27 22:20:25 UTC (rev 1631) @@ -7,8 +7,8 @@ //========================================================================== // ========= - // System - // ====== + // Line Separator + // ============== public static String getLineSeparator() { // /- - - - - - - - - - - - - - - - - - - - - - // Because 'CR + LF' caused many trouble! Added: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/util/SimpleTypeUtil.java =================================================================== --- timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/util/SimpleTypeUtil.java (rev 0) +++ timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/util/SimpleTypeUtil.java 2008-12-27 22:20:25 UTC (rev 1631) @@ -0,0 +1,692 @@ +package jp.sf.pal.timecard.db.allcommon.util; + +import java.math.BigDecimal; +import java.math.BigInteger; +import java.text.DateFormat; +import java.text.DecimalFormatSymbols; +import java.text.ParseException; +import java.text.SimpleDateFormat; +import java.util.ArrayList; +import java.util.Calendar; +import java.util.Date; +import java.util.List; +import java.util.Locale; +import java.util.Map; +import java.util.StringTokenizer; +import java.util.concurrent.ConcurrentHashMap; + +/** + * {Refers to S2Container's utility and Extends it} + * + * @author DBFlute(AutoGenerator) + */ +public class SimpleTypeUtil { + + //========================================================================== + // ========= + // Convert To + // ========== + // ----------------------------------------------------- + // Boolean + // ------- + public static Boolean toBoolean(Object o) { + if (o == null) { + return null; + } else if (o instanceof Boolean) { + return (Boolean) o; + } else if (o instanceof Number) { + int num = ((Number) o).intValue(); + return Boolean.valueOf(num != 0); + } else if (o instanceof String) { + String s = (String) o; + if ("true".equalsIgnoreCase(s)) { + return Boolean.TRUE; + } else if ("false".equalsIgnoreCase(s)) { + return Boolean.FALSE; + } else if (s.equals("0")) { + return Boolean.FALSE; + } else { + return Boolean.TRUE; + } + } else { + return Boolean.TRUE; + } + } + + // ----------------------------------------------------- + // Integer + // ------- + public static Integer toInteger(Object o) { + return toInteger(o, null); + } + + public static Integer toInteger(Object o, String pattern) { + if (o == null) { + return null; + } else if (o instanceof Integer) { + return (Integer) o; + } else if (o instanceof Number) { + return new Integer(((Number) o).intValue()); + } else if (o instanceof String) { + return toInteger((String) o); + } else if (o instanceof java.util.Date) { + if (pattern != null) { + return new Integer(new SimpleDateFormat(pattern).format(o)); + } + return new Integer((int) ((java.util.Date) o).getTime()); + } else if (o instanceof Boolean) { + return ((Boolean) o).booleanValue() ? new Integer(1) : new Integer( + 0); + } else { + return toInteger(o.toString()); + } + } + + protected static Integer toInteger(String s) { + if (s == null || s.trim().length() == 0) { + return null; + } + return new Integer(normalize(s)); + } + + public static int toPrimitiveInt(Object o) { + return toPrimitiveInt(o, null); + } + + public static int toPrimitiveInt(Object o, String pattern) { + if (o == null) { + return 0; + } else if (o instanceof Number) { + return ((Number) o).intValue(); + } else if (o instanceof String) { + return toPrimitiveInt((String) o); + } else if (o instanceof java.util.Date) { + if (pattern != null) { + return Integer + .parseInt(new SimpleDateFormat(pattern).format(o)); + } + return (int) ((java.util.Date) o).getTime(); + } else if (o instanceof Boolean) { + return ((Boolean) o).booleanValue() ? 1 : 0; + } else { + return toPrimitiveInt(o.toString()); + } + } + + protected static int toPrimitiveInt(String s) { + if (s == null || s.trim().length() == 0) { + return 0; + } + return Integer.parseInt(normalize(s)); + } + + // ----------------------------------------------------- + // BigDecimal + // ---------- + public static BigDecimal toBigDecimal(Object o) { + return toBigDecimal(o, null); + } + + public static BigDecimal toBigDecimal(Object o, String pattern) { + if (o == null) { + return null; + } else if (o instanceof BigDecimal) { + return (BigDecimal) o; + } else if (o instanceof java.util.Date) { + if (pattern != null) { + return new BigDecimal(new SimpleDateFormat(pattern).format(o)); + } + return new BigDecimal(Long.toString(((java.util.Date) o).getTime())); + } else if (o instanceof String) { + String s = (String) o; + if (s == null || s.trim().length() == 0) { + return null; + } + return new BigDecimal(new BigDecimal(s).toPlainString()); + } else { + return new BigDecimal(new BigDecimal(o.toString()).toPlainString()); + } + } + + // ----------------------------------------------------- + // Double + // ------ + public static Double toDouble(Object o) { + return toDouble(o, null); + } + + public static Double toDouble(Object o, String pattern) { + if (o == null) { + return null; + } else if (o instanceof Double) { + return (Double) o; + } else if (o instanceof Number) { + return new Double(((Number) o).doubleValue()); + } else if (o instanceof String) { + return toDouble((String) o); + } else if (o instanceof java.util.Date) { + if (pattern != null) { + return new Double(new SimpleDateFormat(pattern).format(o)); + } + return new Double(((java.util.Date) o).getTime()); + } else { + return toDouble(o.toString()); + } + } + + protected static Double toDouble(String s) { + if (s == null || s.trim().length() == 0) { + return null; + } + return new Double(normalize(s)); + } + + // ----------------------------------------------------- + // Long + // ---- + public static Long toLong(Object o) { + return toLong(o, null); + } + + public static Long toLong(Object o, String pattern) { + if (o == null) { + return null; + } else if (o instanceof Long) { + return (Long) o; + } else if (o instanceof Number) { + return new Long(((Number) o).longValue()); + } else if (o instanceof String) { + return toLong((String) o); + } else if (o instanceof java.util.Date) { + if (pattern != null) { + return new Long(new SimpleDateFormat(pattern).format(o)); + } + return new Long(((java.util.Date) o).getTime()); + } else if (o instanceof Boolean) { + return ((Boolean) o).booleanValue() ? new Long(1) : new Long(0); + } else { + return toLong(o.toString()); + } + } + + protected static Long toLong(String s) { + if (s == null || s.trim().length() == 0) { + return null; + } + return new Long(normalize(s)); + } + + public static long toPrimitiveLong(Object o) { + return toPrimitiveLong(o, null); + } + + public static long toPrimitiveLong(Object o, String pattern) { + if (o == null) { + return 0; + } else if (o instanceof Number) { + return ((Number) o).longValue(); + } else if (o instanceof String) { + return toPrimitiveLong((String) o); + } else if (o instanceof java.util.Date) { + if (pattern != null) { + return Long.parseLong(new SimpleDateFormat(pattern).format(o)); + } + return ((java.util.Date) o).getTime(); + } else if (o instanceof Boolean) { + return ((Boolean) o).booleanValue() ? 1 : 0; + } else { + return toPrimitiveLong(o.toString()); + } + } + + protected static long toPrimitiveLong(String s) { + if (s == null || s.trim().length() == 0) { + return 0; + } + return Long.parseLong(normalize(s)); + } + + // ----------------------------------------------------- + // Float + // ----- + public static Float toFloat(Object o) { + return toFloat(o, null); + } + + public static Float toFloat(Object o, String pattern) { + if (o == null) { + return null; + } else if (o instanceof Float) { + return (Float) o; + } else if (o instanceof Number) { + return new Float(((Number) o).floatValue()); + } else if (o instanceof String) { + return toFloat((String) o); + } else if (o instanceof java.util.Date) { + if (pattern != null) { + return new Float(new SimpleDateFormat(pattern).format(o)); + } + return new Float(((java.util.Date) o).getTime()); + } else { + return toFloat(o.toString()); + } + } + + protected static Float toFloat(String s) { + if (s == null || s.trim().length() == 0) { + return null; + } + return new Float(normalize(s)); + } + + // ----------------------------------------------------- + // Short + // ----- + public static Short toShort(Object o) { + return toShort(o, null); + } + + public static Short toShort(Object o, String pattern) { + if (o == null) { + return null; + } else if (o instanceof Short) { + return (Short) o; + } else if (o instanceof Number) { + return new Short(((Number) o).shortValue()); + } else if (o instanceof String) { + return toShort((String) o); + } else if (o instanceof java.util.Date) { + if (pattern != null) { + return new Short(new SimpleDateFormat(pattern).format(o)); + } + return new Short((short) ((java.util.Date) o).getTime()); + } else if (o instanceof Boolean) { + return ((Boolean) o).booleanValue() ? new Short((short) 1) + : new Short((short) 0); + } else { + return toShort(o.toString()); + } + } + + protected static Short toShort(String s) { + if (s == null || s.trim().length() == 0) { + return null; + } + return new Short(normalize(s)); + } + + // ----------------------------------------------------- + // BigInteger + // ---------- + public static BigInteger toBigInteger(Object o) { + return toBigInteger(o, null); + } + + public static BigInteger toBigInteger(Object o, String pattern) { + if (o == null) { + return null; + } else if (o instanceof BigInteger) { + return (BigInteger) o; + } else { + Long l = toLong(o, pattern); + if (l == null) { + return null; + } + return BigInteger.valueOf(l.longValue()); + } + } + + // ----------------------------------------------------- + // Byte + // ---- + public static Byte toByte(Object o) { + return toByte(o, null); + } + + public static Byte toByte(Object o, String pattern) { + if (o == null) { + return null; + } else if (o instanceof Byte) { + return (Byte) o; + } else if (o instanceof Number) { + return new Byte(((Number) o).byteValue()); + } else if (o instanceof String) { + return toByte((String) o); + } else if (o instanceof java.util.Date) { + if (pattern != null) { + return new Byte(new SimpleDateFormat(pattern).format(o)); + } + return new Byte((byte) ((java.util.Date) o).getTime()); + } else if (o instanceof Boolean) { + return ((Boolean) o).booleanValue() ? new Byte((byte) 1) + : new Byte((byte) 0); + } else { + return toByte(o.toString()); + } + } + + protected static Byte toByte(String s) { + if (s == null || s.trim().length() == 0) { + return null; + } + return new Byte(normalize(s)); + } + + // ----------------------------------------------------- + // Date + // ---- + public static Date toDate(Object o) { + return toDate(o, null); + } + + public static Date toDate(Object o, String pattern) { + if (o == null) { + return null; + } else if (o instanceof String) { + return toDate((String) o, pattern); + } else if (o instanceof Date) { + return (Date) o; + } else if (o instanceof Calendar) { + return ((Calendar) o).getTime(); + } else { + return toDate(o.toString(), pattern); + } + } + + protected static Date toDate(String s, String pattern) { + return toDate(s, pattern, Locale.getDefault()); + } + + protected static Date toDate(String s, String pattern, Locale locale) { + if (s == null || s.trim().length() == 0) { + return null; + } + SimpleDateFormat sdf = getDateFormat(s, pattern, locale); + try { + return sdf.parse(s); + } catch (ParseException e) { + String msg = "Failed to parse the string to date: "; + msg = msg + " string=" + s + " format=" + sdf + " locale=" + locale; + throw new IllegalStateException(msg, e); + } + } + + public static java.sql.Date toSqlDate(Object o) { + return toSqlDate(o, null); + } + + public static java.sql.Date toSqlDate(Object o, String pattern) { + if (o instanceof java.sql.Date) { + return (java.sql.Date) o; + } + java.util.Date date = toDate(o, pattern); + if (date != null) { + return new java.sql.Date(date.getTime()); + } + return null; + } + + // ----------------------------------------------------- + // Number + // ------ + public static Object toNumber(Class type, Object o) { + if (type == Integer.class) { + return toInteger(o); + } else if (type == BigDecimal.class) { + return toBigDecimal(o); + } else if (type == Double.class) { + return toDouble(o); + } else if (type == Long.class) { + return toLong(o); + } else if (type == Float.class) { + return toFloat(o); + } else if (type == Short.class) { + return toShort(o); + } else if (type == BigInteger.class) { + return toBigInteger(o); + } else if (type == Byte.class) { + return toByte(o); + } + return o; + } + + // ----------------------------------------------------- + // Wrapper + // ------- + public static Object toWrapper(Class type, Object o) { + if (type == int.class) { + Integer i = toInteger(o); + if (i != null) { + return i; + } + return new Integer(0); + } else if (type == double.class) { + Double d = toDouble(o); + if (d != null) { + return d; + } + return new Double(0); + } else if (type == long.class) { + Long l = toLong(o); + if (l != null) { + return l; + } + return new Long(0); + } else if (type == float.class) { + Float f = toFloat(o); + if (f != null) { + return f; + } + return new Float(0); + } else if (type == short.class) { + Short s = toShort(o); + if (s != null) { + return s; + } + return new Short((short) 0); + } else if (type == boolean.class) { + Boolean b = toBoolean(o); + if (b != null) { + return b; + } + return Boolean.FALSE; + } else if (type == byte.class) { + Byte b = toByte(o); + if (b != null) { + return b; + } + return new Byte((byte) 0); + } + return o; + } + + //========================================================================== + // ========= + // Normalize + // ========= + protected static String normalize(String s) { + return normalize(s, Locale.getDefault()); + } + + protected static String normalize(String s, Locale locale) { + if (s == null) { + return null; + } + DecimalFormatSymbols symbols = getDecimalFormatSymbols(locale); + char decimalSep = symbols.getDecimalSeparator(); + char groupingSep = symbols.getGroupingSeparator(); + StringBuilder sb = new StringBuilder(20); + for (int i = 0; i < s.length(); ++i) { + char c = s.charAt(i); + if (c == groupingSep) { + continue; + } else if (c == decimalSep) { + c = '.'; + } + sb.append(c); + } + return sb.toString(); + } + + //========================================================================== + // ========= + // Assist Helper + // ============= + + // ----------------------------------------------------- + // DateFormat + // ---------- + protected static SimpleDateFormat getDateFormat(String s, String pattern, + Locale locale) { + if (pattern != null) { + return new SimpleDateFormat(pattern); + } + return getDateFormat(s, locale); + } + + protected static SimpleDateFormat getDateFormat(String s, Locale locale) { + String pattern = getDateFormatPattern(locale); + String shortPattern = removeDateDelimiter(pattern); + String delimitor = findDateDelimiter(s); + if (delimitor == null) { + if (s.length() == shortPattern.length()) { + return new SimpleDateFormat(shortPattern); + } + if (s.length() == shortPattern.length() + 2) { + return new SimpleDateFormat(replace(shortPattern, "yy", "yyyy")); + } + } else { + String[] array = split(s, delimitor); + for (int i = 0; i < array.length; ++i) { + if (array[i].length() == 4) { + pattern = replace(pattern, "yy", "yyyy"); + break; + } + } + return new SimpleDateFormat(pattern); + } + return new SimpleDateFormat(); + } + + protected static String getDateFormatPattern(Locale locale) { + SimpleDateFormat df = (SimpleDateFormat) DateFormat.getDateInstance( + DateFormat.SHORT, locale); + String pattern = df.toPattern(); + int index = pattern.indexOf(' '); + if (index > 0) { + pattern = pattern.substring(0, index); + } + if (pattern.indexOf("MM") < 0) { + pattern = replace(pattern, "M", "MM"); + } + if (pattern.indexOf("dd") < 0) { + pattern = replace(pattern, "d", "dd"); + } + return pattern; + } + + protected static String removeDateDelimiter(String pattern) { + StringBuilder sb = new StringBuilder(); + for (int i = 0; i < pattern.length(); ++i) { + char c = pattern.charAt(i); + if (c == 'y' || c == 'M' || c == 'd') { + sb.append(c); + } + } + return sb.toString(); + } + + protected static String findDateDelimiter(String value) { + for (int i = 0; i < value.length(); ++i) { + char c = value.charAt(i); + if (Character.isDigit(c)) { + continue; + } + return Character.toString(c); + } + return null; + } + + // ----------------------------------------------------- + // DecimalFormatSymbols + // -------------------- + protected static Map symbolsCache = new ConcurrentHashMap(); + + protected static DecimalFormatSymbols getDecimalFormatSymbols() { + return getDecimalFormatSymbols(Locale.getDefault()); + } + + protected static DecimalFormatSymbols getDecimalFormatSymbols(Locale locale) { + DecimalFormatSymbols symbols = (DecimalFormatSymbols) symbolsCache + .get(locale); + if (symbols == null) { + symbols = new DecimalFormatSymbols(locale); + symbolsCache.put(locale, symbols); + } + return symbols; + } + + // ----------------------------------------------------- + // String + // ------ + protected static String replace(String text, String fromText, String toText) { + if (text == null || fromText == null || toText == null) { + return null; + } + StringBuilder sb = new StringBuilder(); + int pos = 0; + int pos2 = 0; + do { + pos = text.indexOf(fromText, pos2); + if (pos == 0) { + sb.append(toText); + pos2 = fromText.length(); + } else if (pos > 0) { + sb.append(text.substring(pos2, pos)); + sb.append(toText); + pos2 = pos + fromText.length(); + } else { + sb.append(text.substring(pos2)); + return sb.toString(); + } + } while (true); + } + + protected static final String[] EMPTY_STRINGS = new String[0]; + + protected static String[] split(final String str, final String delimiter) { + if (str == null || str.trim().length() == 0) { + return EMPTY_STRINGS; + } + final List list = new ArrayList(); + final StringTokenizer st = new StringTokenizer(str, delimiter); + while (st.hasMoreElements()) { + list.add(st.nextToken()); + } + return (String[]) list.toArray(new String[list.size()]); + } + + //========================================================================== + // ========= + // Assert Helper + // ============= + /** + * Assert that the object is not null. + * + * @param variableName Variable name. (NotNull) + * @param value Value. (NotNull) + * @exception IllegalArgumentException + */ + protected static void assertObjectNotNull(String variableName, Object value) { + if (variableName == null) { + String msg = "The value should not be null: variableName=" + + variableName + " value=" + value; + throw new IllegalArgumentException(msg); + } + if (value == null) { + String msg = "The value should not be null: variableName=" + + variableName; + throw new IllegalArgumentException(msg); + } + } +} Property changes on: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/util/SimpleTypeUtil.java ___________________________________________________________________ Name: svn:eol-style + native Modified: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/bsbhv/BsDailyReportBhv.java =================================================================== --- timecard/trunk/src/main/java/jp/sf/pal/timecard/db/bsbhv/BsDailyReportBhv.java 2008-12-27 22:18:30 UTC (rev 1630) +++ timecard/trunk/src/main/java/jp/sf/pal/timecard/db/bsbhv/BsDailyReportBhv.java 2008-12-27 22:20:25 UTC (rev 1631) @@ -1,9 +1,8 @@ package jp.sf.pal.timecard.db.bsbhv; import java.util.List; +import java.util.Map; -import jp.sf.pal.timecard.db.allcommon.DaoReadable; -import jp.sf.pal.timecard.db.allcommon.DaoWritable; import jp.sf.pal.timecard.db.allcommon.Entity; import jp.sf.pal.timecard.db.allcommon.bhv.setup.ValueLabelSetupper; import jp.sf.pal.timecard.db.allcommon.cbean.ConditionBean; @@ -16,12 +15,11 @@ import jp.sf.pal.timecard.db.allcommon.dbmeta.DBMeta; import jp.sf.pal.timecard.db.bsentity.dbmeta.DailyReportDbm; import jp.sf.pal.timecard.db.cbean.DailyReportCB; -import jp.sf.pal.timecard.db.exdao.DailyReportDao; import jp.sf.pal.timecard.db.exentity.DailyReport; import jp.sf.pal.timecard.db.exentity.MonthlyReport; /** - * The behavior of DAILY_REPORT. + * The behavior of DAILY_REPORT that the type is TABLE.
* *
  * [primary-key]
@@ -66,12 +64,6 @@
 
     //==========================================================================
     // =========
-    // Attribute
-    // =========
-    protected DailyReportDao _dao;
-
-    //==========================================================================
-    // =========
     // Table name
     // ==========
     /** @return The name on database of table. (NotNull) */
@@ -83,39 +75,18 @@
     // =========
     // DBMeta
     // ======
-    /** @return The meta data of the database. (NotNull) */
+    /** @return The instance of DBMeta. (NotNull) */
     public DBMeta getDBMeta() {
         return DailyReportDbm.getInstance();
     }
 
-    /** @return The meta data of the database as my table type. (NotNull) */
+    /** @return The instance of DBMeta as my table type. (NotNull) */
     public DailyReportDbm getMyDBMeta() {
         return DailyReportDbm.getInstance();
     }
 
     //==========================================================================
     // =========
-    // Dao Accessor
-    // ============
-    public DailyReportDao getMyDao() {
-        return _dao;
-    }
-
-    public void setMyDao(DailyReportDao dao) {
-        assertObjectNotNull("dao", dao);
-        _dao = dao;
-    }
-
-    public DaoReadable getDaoReadable() {
-        return getMyDao();
-    }
-
-    public DaoWritable getDaoWritable() {
-        return getMyDao();
-    }
-
-    //==========================================================================
-    // =========
     // New Instance
     // ============
     public Entity newEntity() {
@@ -145,7 +116,7 @@
      * @return The selected count.
      */
     public int selectCount(DailyReportCB cb) {
-        assertConditionBeanNotNull(cb);
+        assertCBNotNull(cb);
         return delegateSelectCount(cb);
     }
 
@@ -222,7 +193,7 @@
      * @return The result bean of selected list. (NotNull)
      */
     public ListResultBean selectList(DailyReportCB cb) {
-        assertConditionBeanNotNull(cb);
+        assertCBNotNull(cb);
         return new ResultBeanBuilder(getTableDbName())
                 .buildListResultBean(cb, delegateSelectList(cb));
     }
@@ -238,7 +209,7 @@
      * @return The result bean of selected page. (NotNull)
      */
     public PagingResultBean selectPage(final DailyReportCB cb) {
-        assertConditionBeanNotNull(cb);
+        assertCBNotNull(cb);
         final PagingInvoker invoker = new PagingInvoker(
                 getTableDbName());
         final PagingHandler handler = new PagingHandler() {
@@ -259,6 +230,32 @@
 
     //==========================================================================
     // =========
+    // Scalar Select
+    // =============
+    /**
+     * Select the scalar value derived by a function. 
Call a function + * method after this method called like as follows: + * + *
+     * dailyReportBhv.scalarSelect(Date.class).max(new ScalarQuery(DailyReportCB cb) {
+     *     cb.specify().columnXxxDatetime(); // the required specification of target column
+     *     cb.query().setXxxName_PrefixSearch("S"); // query as you like it
+     * });
+     * 
+ * + * @param The type of result. + * @param resultType The type of result. (NotNull) + * @return The scalar value derived by a function. (Nullable) + */ + public SLFunction scalarSelect( + Class resultType) { + DailyReportCB cb = newMyConditionBean(); + cb.xsetupForScalarSelect(); + return new SLFunction(cb, resultType); + } + + //========================================================================== + // ========= // Various Select // ============== /** @@ -268,8 +265,8 @@ * @param valueLabelSetupper The setupper of value-label. (NotNull) * @return The list of value-label. (NotNull) */ - public List> selectValueLabelList( - DailyReportCB cb, ValueLabelSetupper valueLabelSetupper) { + public List> selectValueLabelList(DailyReportCB cb, + ValueLabelSetupper valueLabelSetupper) { return createValueLabelList(selectList(cb), valueLabelSetupper); } @@ -280,8 +277,8 @@ //========================================================================== // ========= - // Pullout Foreign - // =============== + // Pull out Foreign + // ================ /** * Pull out the list of foreign table 'MonthlyReport'. * @@ -600,11 +597,11 @@ */ public int queryUpdate(DailyReport dailyReport, DailyReportCB cb) { assertObjectNotNull("dailyReport", dailyReport); - assertConditionBeanNotNull(cb); + assertCBNotNull(cb); setupCommonColumnOfUpdateIfNeeds(dailyReport); filterEntityOfUpdate(dailyReport); assertEntityOfUpdate(dailyReport); - return getMyDao().updateByQuery(cb, dailyReport); + return invoke(createQueryUpdateEntityCBCommand(dailyReport, cb)); } /** @@ -614,8 +611,8 @@ * @return The deleted count. */ public int queryDelete(DailyReportCB cb) { - assertConditionBeanNotNull(cb); - return getMyDao().deleteByQuery(cb); + assertCBNotNull(cb); + return invoke(createQueryDeleteCBCommand(cb)); } //========================================================================== @@ -627,19 +624,27 @@ // ========= // Delegate Method // =============== + // [Behavior Command] // ----------------------------------------------------- // Select // ------ protected int delegateSelectCount(DailyReportCB cb) { - assertConditionBeanNotNull(cb); - return getMyDao().selectCount(cb); + return invoke(createSelectCountCBCommand(cb)); } + protected int doCallReadCount(ConditionBean cb) { + return delegateSelectCount((DailyReportCB) cb); + } + protected List delegateSelectList(DailyReportCB cb) { - assertConditionBeanNotNull(cb); - return getMyDao().selectList(cb); + return invoke(createSelectListCBCommand(cb, DailyReport.class)); } + @SuppressWarnings("unchecked") + protected List doCallReadList(ConditionBean cb) { + return (List) delegateSelectList((DailyReportCB) cb); + } + // ----------------------------------------------------- // Update // ------ @@ -647,62 +652,97 @@ if (!processBeforeInsert(e)) { return 1; } - return getMyDao().insert(e); + return invoke(createInsertEntityCommand(e)); } + protected int doCallCreate(Entity entity) { + return delegateInsert(downcast(entity)); + } + protected int delegateUpdate(DailyReport e) { if (!processBeforeUpdate(e)) { return 1; } - return getMyDao().updateModifiedOnly(e); + return invoke(createUpdateEntityCommand(e)); } + protected int doCallModify(Entity entity) { + return delegateUpdate(downcast(entity)); + } + protected int delegateUpdateNonstrict(DailyReport e) { if (!processBeforeUpdate(e)) { return 1; } - return getMyDao().updateNonstrictModifiedOnly(e); + return invoke(createUpdateNonstrictEntityCommand(e)); } protected int delegateDelete(DailyReport e) { if (!processBeforeDelete(e)) { return 1; } - return getMyDao().delete(e); + return invoke(createDeleteEntityCommand(e)); } + protected int doCallRemove(Entity entity) { + return delegateDelete(downcast(entity)); + } + protected int delegateDeleteNonstrict(DailyReport e) { if (!processBeforeDelete(e)) { return 1; } - return getMyDao().deleteNonstrict(e); + return invoke(createDeleteNonstrictEntityCommand(e)); } protected int[] delegateInsertList(List ls) { - assertObjectNotNull("dailyReportList", ls); - return getMyDao().insertList(helpFilterBeforeInsertInternally(ls)); + if (ls.isEmpty()) { + return new int[] {}; + } + return invoke(createBatchInsertEntityCommand(helpFilterBeforeInsertInternally(ls))); } + @SuppressWarnings("unchecked") + protected int[] doCreateList(List ls) { + return delegateInsertList((List) ls); + } + protected int[] delegateUpdateList(List ls) { - assertObjectNotNull("dailyReportList", ls); - return getMyDao().updateList(helpFilterBeforeUpdateInternally(ls)); + if (ls.isEmpty()) { + return new int[] {}; + } + return invoke(createBatchUpdateEntityCommand(helpFilterBeforeUpdateInternally(ls))); } + @SuppressWarnings("unchecked") + protected int[] doModifyList(List ls) { + return delegateUpdateList((List) ls); + } + protected int[] delegateUpdateListNonstrict(List ls) { - assertObjectNotNull("dailyReportList", ls); - return getMyDao().updateListNonstrict( - helpFilterBeforeUpdateInternally(ls)); + if (ls.isEmpty()) { + return new int[] {}; + } + return invoke(createBatchUpdateNonstrictEntityCommand(helpFilterBeforeUpdateInternally(ls))); } protected int[] delegateDeleteList(List ls) { - assertObjectNotNull("dailyReportList", ls); - return getMyDao().deleteList(helpFilterBeforeDeleteInternally(ls)); + if (ls.isEmpty()) { + return new int[] {}; + } + return invoke(createBatchDeleteEntityCommand(helpFilterBeforeDeleteInternally(ls))); } + @SuppressWarnings("unchecked") + protected int[] doRemoveList(List ls) { + return delegateDeleteList((List) ls); + } + protected int[] delegateDeleteListNonstrict(List ls) { - assertObjectNotNull("dailyReportList", ls); - return getMyDao().deleteListNonstrict( - helpFilterBeforeDeleteInternally(ls)); + if (ls.isEmpty()) { + return new int[] {}; + } + return invoke(createBatchDeleteNonstrictEntityCommand(helpFilterBeforeDeleteInternally(ls))); } //========================================================================== Modified: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/bsbhv/BsEmployeeBhv.java =================================================================== --- timecard/trunk/src/main/java/jp/sf/pal/timecard/db/bsbhv/BsEmployeeBhv.java 2008-12-27 22:18:30 UTC (rev 1630) +++ timecard/trunk/src/main/java/jp/sf/pal/timecard/db/bsbhv/BsEmployeeBhv.java 2008-12-27 22:20:25 UTC (rev 1631) @@ -1,9 +1,8 @@ package jp.sf.pal.timecard.db.bsbhv; import java.util.List; +import java.util.Map; -import jp.sf.pal.timecard.db.allcommon.DaoReadable; -import jp.sf.pal.timecard.db.allcommon.DaoWritable; import jp.sf.pal.timecard.db.allcommon.Entity; import jp.sf.pal.timecard.db.allcommon.bhv.load.LoadReferrerOption; import jp.sf.pal.timecard.db.allcommon.bhv.setup.ConditionBeanSetupper; @@ -20,13 +19,12 @@ import jp.sf.pal.timecard.db.cbean.EmployeeCB; import jp.sf.pal.timecard.db.cbean.MonthlyReportCB; import jp.sf.pal.timecard.db.exbhv.MonthlyReportBhv; -import jp.sf.pal.timecard.db.exdao.EmployeeDao; import jp.sf.pal.timecard.db.exentity.Employee; import jp.sf.pal.timecard.db.exentity.MonthlyReport; import jp.sf.pal.timecard.db.exentity.UserInfo; /** - * The behavior of EMPLOYEE. + * The behavior of EMPLOYEE that the type is TABLE.
* *
  * [primary-key]
@@ -71,12 +69,6 @@
 
     //==========================================================================
     // =========
-    // Attribute
-    // =========
-    protected EmployeeDao _dao;
-
-    //==========================================================================
-    // =========
     // Table name
     // ==========
     /** @return The name on database of table. (NotNull) */
@@ -88,39 +80,18 @@
     // =========
     // DBMeta
     // ======
-    /** @return The meta data of the database. (NotNull) */
+    /** @return The instance of DBMeta. (NotNull) */
     public DBMeta getDBMeta() {
         return EmployeeDbm.getInstance();
     }
 
-    /** @return The meta data of the database as my table type. (NotNull) */
+    /** @return The instance of DBMeta as my table type. (NotNull) */
     public EmployeeDbm getMyDBMeta() {
         return EmployeeDbm.getInstance();
     }
 
     //==========================================================================
     // =========
-    // Dao Accessor
-    // ============
-    public EmployeeDao getMyDao() {
-        return _dao;
-    }
-
-    public void setMyDao(EmployeeDao dao) {
-        assertObjectNotNull("dao", dao);
-        _dao = dao;
-    }
-
-    public DaoReadable getDaoReadable() {
-        return getMyDao();
-    }
-
-    public DaoWritable getDaoWritable() {
-        return getMyDao();
-    }
-
-    //==========================================================================
-    // =========
     // New Instance
     // ============
     public Entity newEntity() {
@@ -150,7 +121,7 @@
      * @return The selected count.
      */
     public int selectCount(EmployeeCB cb) {
-        assertConditionBeanNotNull(cb);
+        assertCBNotNull(cb);
         return delegateSelectCount(cb);
     }
 
@@ -227,7 +198,7 @@
      * @return The result bean of selected list. (NotNull)
      */
     public ListResultBean selectList(EmployeeCB cb) {
-        assertConditionBeanNotNull(cb);
+        assertCBNotNull(cb);
         return new ResultBeanBuilder(getTableDbName())
                 .buildListResultBean(cb, delegateSelectList(cb));
     }
@@ -243,7 +214,7 @@
      * @return The result bean of selected page. (NotNull)
      */
     public PagingResultBean selectPage(final EmployeeCB cb) {
-        assertConditionBeanNotNull(cb);
+        assertCBNotNull(cb);
         final PagingInvoker invoker = new PagingInvoker(
                 getTableDbName());
         final PagingHandler handler = new PagingHandler() {
@@ -264,6 +235,32 @@
 
     //==========================================================================
     // =========
+    // Scalar Select
+    // =============
+    /**
+     * Select the scalar value derived by a function. 
Call a function + * method after this method called like as follows: + * + *
+     * employeeBhv.scalarSelect(Date.class).max(new ScalarQuery(EmployeeCB cb) {
+     *     cb.specify().columnXxxDatetime(); // the required specification of target column
+     *     cb.query().setXxxName_PrefixSearch("S"); // query as you like it
+     * });
+     * 
+ * + * @param The type of result. + * @param resultType The type of result. (NotNull) + * @return The scalar value derived by a function. (Nullable) + */ + public SLFunction scalarSelect( + Class resultType) { + EmployeeCB cb = newMyConditionBean(); + cb.xsetupForScalarSelect(); + return new SLFunction(cb, resultType); + } + + //========================================================================== + // ========= // Various Select // ============== /** @@ -273,8 +270,8 @@ * @param valueLabelSetupper The setupper of value-label. (NotNull) * @return The list of value-label. (NotNull) */ - public List> selectValueLabelList( - EmployeeCB cb, ValueLabelSetupper valueLabelSetupper) { + public List> selectValueLabelList(EmployeeCB cb, + ValueLabelSetupper valueLabelSetupper) { return createValueLabelList(selectList(cb), valueLabelSetupper); } @@ -377,8 +374,8 @@ //========================================================================== // ========= - // Pullout Foreign - // =============== + // Pull out Foreign + // ================ /** * Pull out the list of foreign table 'UserInfo'. * @@ -703,11 +700,11 @@ */ public int queryUpdate(Employee employee, EmployeeCB cb) { assertObjectNotNull("employee", employee); - assertConditionBeanNotNull(cb); + assertCBNotNull(cb); setupCommonColumnOfUpdateIfNeeds(employee); filterEntityOfUpdate(employee); assertEntityOfUpdate(employee); - return getMyDao().updateByQuery(cb, employee); + return invoke(createQueryUpdateEntityCBCommand(employee, cb)); } /** @@ -717,8 +714,8 @@ * @return The deleted count. */ public int queryDelete(EmployeeCB cb) { - assertConditionBeanNotNull(cb); - return getMyDao().deleteByQuery(cb); + assertCBNotNull(cb); + return invoke(createQueryDeleteCBCommand(cb)); } //========================================================================== @@ -730,19 +727,27 @@ // ========= // Delegate Method // =============== + // [Behavior Command] // ----------------------------------------------------- // Select // ------ protected int delegateSelectCount(EmployeeCB cb) { - assertConditionBeanNotNull(cb); - return getMyDao().selectCount(cb); + return invoke(createSelectCountCBCommand(cb)); } + protected int doCallReadCount(ConditionBean cb) { + return delegateSelectCount((EmployeeCB) cb); + } + protected List delegateSelectList(EmployeeCB cb) { - assertConditionBeanNotNull(cb); - return getMyDao().selectList(cb); + return invoke(createSelectListCBCommand(cb, Employee.class)); } + @SuppressWarnings("unchecked") + protected List doCallReadList(ConditionBean cb) { + return (List) delegateSelectList((EmployeeCB) cb); + } + // ----------------------------------------------------- // Update // ------ @@ -750,62 +755,97 @@ if (!processBeforeInsert(e)) { return 1; } - return getMyDao().insert(e); + return invoke(createInsertEntityCommand(e)); } + protected int doCallCreate(Entity entity) { + return delegateInsert(downcast(entity)); + } + protected int delegateUpdate(Employee e) { if (!processBeforeUpdate(e)) { return 1; } - return getMyDao().updateModifiedOnly(e); + return invoke(createUpdateEntityCommand(e)); } + protected int doCallModify(Entity entity) { + return delegateUpdate(downcast(entity)); + } + protected int delegateUpdateNonstrict(Employee e) { if (!processBeforeUpdate(e)) { return 1; } - return getMyDao().updateNonstrictModifiedOnly(e); + return invoke(createUpdateNonstrictEntityCommand(e)); } protected int delegateDelete(Employee e) { if (!processBeforeDelete(e)) { return 1; } - return getMyDao().delete(e); + return invoke(createDeleteEntityCommand(e)); } + protected int doCallRemove(Entity entity) { + return delegateDelete(downcast(entity)); + } + protected int delegateDeleteNonstrict(Employee e) { if (!processBeforeDelete(e)) { return 1; } - return getMyDao().deleteNonstrict(e); + return invoke(createDeleteNonstrictEntityCommand(e)); } protected int[] delegateInsertList(List ls) { - assertObjectNotNull("employeeList", ls); - return getMyDao().insertList(helpFilterBeforeInsertInternally(ls)); + if (ls.isEmpty()) { + return new int[] {}; + } + return invoke(createBatchInsertEntityCommand(helpFilterBeforeInsertInternally(ls))); } + @SuppressWarnings("unchecked") + protected int[] doCreateList(List ls) { + return delegateInsertList((List) ls); + } + protected int[] delegateUpdateList(List ls) { - assertObjectNotNull("employeeList", ls); - return getMyDao().updateList(helpFilterBeforeUpdateInternally(ls)); + if (ls.isEmpty()) { + return new int[] {}; + } + return invoke(createBatchUpdateEntityCommand(helpFilterBeforeUpdateInternally(ls))); } + @SuppressWarnings("unchecked") + protected int[] doModifyList(List ls) { + return delegateUpdateList((List) ls); + } + protected int[] delegateUpdateListNonstrict(List ls) { - assertObjectNotNull("employeeList", ls); - return getMyDao().updateListNonstrict( - helpFilterBeforeUpdateInternally(ls)); + if (ls.isEmpty()) { + return new int[] {}; + } + return invoke(createBatchUpdateNonstrictEntityCommand(helpFilterBeforeUpdateInternally(ls))); } protected int[] delegateDeleteList(List ls) { - assertObjectNotNull("employeeList", ls); - return getMyDao().deleteList(helpFilterBeforeDeleteInternally(ls)); + if (ls.isEmpty()) { + return new int[] {}; + } + return invoke(createBatchDeleteEntityCommand(helpFilterBeforeDeleteInternally(ls))); } + @SuppressWarnings("unchecked") + protected int[] doRemoveList(List ls) { + return delegateDeleteList((List) ls); + } + protected int[] delegateDeleteListNonstrict(List ls) { - assertObjectNotNull("employeeList", ls); - return getMyDao().deleteListNonstrict( - helpFilterBeforeDeleteInternally(ls)); + if (ls.isEmpty()) { + return new int[] {}; + } + return invoke(createBatchDeleteNonstrictEntityCommand(helpFilterBeforeDeleteInternally(ls))); } //========================================================================== Modified: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/bsbhv/BsGroupInfoBhv.java =================================================================== --- timecard/trunk/src/main/java/jp/sf/pal/timecard/db/bsbhv/BsGroupInfoBhv.java 2008-12-27 22:18:30 UTC (rev 1630) +++ timecard/trunk/src/main/java/jp/sf/pal/timecard/db/bsbhv/BsGroupInfoBhv.java 2008-12-27 22:20:25 UTC (rev 1631) @@ -1,9 +1,8 @@ package jp.sf.pal.timecard.db.bsbhv; import java.util.List; +import java.util.Map; -import jp.sf.pal.timecard.db.allcommon.DaoReadable; -import jp.sf.pal.timecard.db.allcommon.DaoWritable; import jp.sf.pal.timecard.db.allcommon.Entity; import jp.sf.pal.timecard.db.allcommon.bhv.load.LoadReferrerOption; import jp.sf.pal.timecard.db.allcommon.bhv.setup.ConditionBeanSetupper; @@ -22,13 +21,12 @@ import jp.sf.pal.timecard.db.cbean.UserInfoCB; import jp.sf.pal.timecard.db.exbhv.GroupMappingBhv; import jp.sf.pal.timecard.db.exbhv.UserInfoBhv; -import jp.sf.pal.timecard.db.exdao.GroupInfoDao; import jp.sf.pal.timecard.db.exentity.GroupInfo; import jp.sf.pal.timecard.db.exentity.GroupMapping; import jp.sf.pal.timecard.db.exentity.UserInfo; /** - * The behavior of GROUP_INFO. + * The behavior of GROUP_INFO that the type is TABLE.
* *
  * [primary-key]
@@ -73,12 +71,6 @@
 
     //==========================================================================
     // =========
-    // Attribute
-    // =========
-    protected GroupInfoDao _dao;
-
-    //==========================================================================
-    // =========
     // Table name
     // ==========
     /** @return The name on database of table. (NotNull) */
@@ -90,39 +82,18 @@
     // =========
     // DBMeta
     // ======
-    /** @return The meta data of the database. (NotNull) */
+    /** @return The instance of DBMeta. (NotNull) */
     public DBMeta getDBMeta() {
         return GroupInfoDbm.getInstance();
     }
 
-    /** @return The meta data of the database as my table type. (NotNull) */
+    /** @return The instance of DBMeta as my table type. (NotNull) */
     public GroupInfoDbm getMyDBMeta() {
         return GroupInfoDbm.getInstance();
     }
 
     //==========================================================================
     // =========
-    // Dao Accessor
-    // ============
-    public GroupInfoDao getMyDao() {
-        return _dao;
-    }
-
-    public void setMyDao(GroupInfoDao dao) {
-        assertObjectNotNull("dao", dao);
-        _dao = dao;
-    }
-
-    public DaoReadable getDaoReadable() {
-        return getMyDao();
-    }
-
-    public DaoWritable getDaoWritable() {
-        return getMyDao();
-    }
-
-    //==========================================================================
-    // =========
     // New Instance
     // ============
     public Entity newEntity() {
@@ -152,7 +123,7 @@
      * @return The selected count.
      */
     public int selectCount(GroupInfoCB cb) {
-        assertConditionBeanNotNull(cb);
+        assertCBNotNull(cb);
         return delegateSelectCount(cb);
     }
 
@@ -229,7 +200,7 @@
      * @return The result bean of selected list. (NotNull)
      */
     public ListResultBean selectList(GroupInfoCB cb) {
-        assertConditionBeanNotNull(cb);
+        assertCBNotNull(cb);
         return new ResultBeanBuilder(getTableDbName())
                 .buildListResultBean(cb, delegateSelectList(cb));
     }
@@ -245,7 +216,7 @@
      * @return The result bean of selected page. (NotNull)
      */
     public PagingResultBean selectPage(final GroupInfoCB cb) {
-        assertConditionBeanNotNull(cb);
+        assertCBNotNull(cb);
         final PagingInvoker invoker = new PagingInvoker(
                 getTableDbName());
         final PagingHandler handler = new PagingHandler() {
@@ -266,6 +237,32 @@
 
     //==========================================================================
     // =========
+    // Scalar Select
+    // =============
+    /**
+     * Select the scalar value derived by a function. 
Call a function + * method after this method called like as follows: + * + *
+     * groupInfoBhv.scalarSelect(Date.class).max(new ScalarQuery(GroupInfoCB cb) {
+     *     cb.specify().columnXxxDatetime(); // the required specification of target column
+     *     cb.query().setXxxName_PrefixSearch("S"); // query as you like it
+     * });
+     * 
+ * + * @param The type of result. + * @param resultType The type of result. (NotNull) + * @return The scalar value derived by a function. (Nullable) + */ + public SLFunction scalarSelect( + Class resultType) { + GroupInfoCB cb = newMyConditionBean(); + cb.xsetupForScalarSelect(); + return new SLFunction(cb, resultType); + } + + //========================================================================== + // ========= // Various Select // ============== /** @@ -275,8 +272,8 @@ * @param valueLabelSetupper The setupper of value-label. (NotNull) * @return The list of value-label. (NotNull) */ - public List> selectValueLabelList( - GroupInfoCB cb, ValueLabelSetupper valueLabelSetupper) { + public List> selectValueLabelList(GroupInfoCB cb, + ValueLabelSetupper valueLabelSetupper) { return createValueLabelList(selectList(cb), valueLabelSetupper); } @@ -467,8 +464,8 @@ //========================================================================== // ========= - // Pullout Foreign - // =============== + // Pull out Foreign + // ================ //========================================================================== // ========= @@ -766,11 +763,11 @@ */ public int queryUpdate(GroupInfo groupInfo, GroupInfoCB cb) { assertObjectNotNull("groupInfo", groupInfo); - assertConditionBeanNotNull(cb); + assertCBNotNull(cb); setupCommonColumnOfUpdateIfNeeds(groupInfo); filterEntityOfUpdate(groupInfo); assertEntityOfUpdate(groupInfo); - return getMyDao().updateByQuery(cb, groupInfo); + return invoke(createQueryUpdateEntityCBCommand(groupInfo, cb)); } /** @@ -780,8 +777,8 @@ * @return The deleted count. */ public int queryDelete(GroupInfoCB cb) { - assertConditionBeanNotNull(cb); - return getMyDao().deleteByQuery(cb); + assertCBNotNull(cb); + return invoke(createQueryDeleteCBCommand(cb)); } //========================================================================== @@ -793,19 +790,27 @@ // ========= // Delegate Method // =============== + // [Behavior Command] // ----------------------------------------------------- // Select // ------ protected int delegateSelectCount(GroupInfoCB cb) { - assertConditionBeanNotNull(cb); - return getMyDao().selectCount(cb); + return invoke(createSelectCountCBCommand(cb)); } + protected int doCallReadCount(ConditionBean cb) { + return delegateSelectCount((GroupInfoCB) cb); + } + protected List delegateSelectList(GroupInfoCB cb) { - assertConditionBeanNotNull(cb); - return getMyDao().selectList(cb); + return invoke(createSelectListCBCommand(cb, GroupInfo.class)); } + @SuppressWarnings("unchecked") + protected List doCallReadList(ConditionBean cb) { + return (List) delegateSelectList((GroupInfoCB) cb); + } + // ----------------------------------------------------- // Update // ------ @@ -813,62 +818,97 @@ if (!processBeforeInsert(e)) { return 1; } - return getMyDao().insert(e); + return invoke(createInsertEntityCommand(e)); } + protected int doCallCreate(Entity entity) { + return delegateInsert(downcast(entity)); + } + protected int delegateUpdate(GroupInfo e) { if (!processBeforeUpdate(e)) { return 1; } - return getMyDao().updateModifiedOnly(e); + return invoke(createUpdateEntityCommand(e)); } + protected int doCallModify(Entity entity) { + return delegateUpdate(downcast(entity)); + } + protected int delegateUpdateNonstrict(GroupInfo e) { if (!processBeforeUpdate(e)) { return 1; } - return getMyDao().updateNonstrictModifiedOnly(e); + return invoke(createUpdateNonstrictEntityCommand(e)); } protected int delegateDelete(GroupInfo e) { if (!processBeforeDelete(e)) { return 1; } - return getMyDao().delete(e); + return invoke(createDeleteEntityCommand(e)); } + protected int doCallRemove(Entity entity) { + return delegateDelete(downcast(entity)); + } + protected int delegateDeleteNonstrict(GroupInfo e) { if (!processBeforeDelete(e)) { return 1; } - return getMyDao().deleteNonstrict(e); + return invoke(createDeleteNonstrictEntityCommand(e)); } protected int[] delegateInsertList(List ls) { - assertObjectNotNull("groupInfoList", ls); - return getMyDao().insertList(helpFilterBeforeInsertInternally(ls)); + if (ls.isEmpty()) { + return new int[] {}; + } + return invoke(createBatchInsertEntityCommand(helpFilterBeforeInsertInternally(ls))); } + @SuppressWarnings("unchecked") + protected int[] doCreateList(List ls) { + return delegateInsertList((List) ls); + } + protected int[] delegateUpdateList(List ls) { - assertObjectNotNull("groupInfoList", ls); - return getMyDao().updateList(helpFilterBeforeUpdateInternally(ls)); + if (ls.isEmpty()) { + return new int[] {}; + } + return invoke(createBatchUpdateEntityCommand(helpFilterBeforeUpdateInternally(ls))); } + @SuppressWarnings("unchecked") + protected int[] doModifyList(List ls) { + return delegateUpdateList((List) ls); + } + protected int[] delegateUpdateListNonstrict(List ls) { - assertObjectNotNull("groupInfoList", ls); - return getMyDao().updateListNonstrict( - helpFilterBeforeUpdateInternally(ls)); + if (ls.isEmpty()) { + return new int[] {}; + } + return invoke(createBatchUpdateNonstrictEntityCommand(helpFilterBeforeUpdateInternally(ls))); } protected int[] delegateDeleteList(List ls) { - assertObjectNotNull("groupInfoList", ls); - return getMyDao().deleteList(helpFilterBeforeDeleteInternally(ls)); + if (ls.isEmpty()) { + return new int[] {}; + } + return invoke(createBatchDeleteEntityCommand(helpFilterBeforeDeleteInternally(ls))); } + @SuppressWarnings("unchecked") + protected int[] doRemoveList(List ls) { + return delegateDeleteList((List) ls); + } + protected int[] delegateDeleteListNonstrict(List ls) { - assertObjectNotNull("groupInfoList", ls); - return getMyDao().deleteListNonstrict( - helpFilterBeforeDeleteInternally(ls)); + if (ls.isEmpty()) { + return new int[] {}; + } + return invoke(createBatchDeleteNonstrictEntityCommand(helpFilterBeforeDeleteInternally(ls))); } //========================================================================== Modified: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/bsbhv/BsGroupMappingBhv.java =================================================================== --- timecard/trunk/src/main/java/jp/sf/pal/timecard/db/bsbhv/BsGroupMappingBhv.java 2008-12-27 22:18:30 UTC (rev 1630) +++ timecard/trunk/src/main/java/jp/sf/pal/timecard/db/bsbhv/BsGroupMappingBhv.java 2008-12-27 22:20:25 UTC (rev 1631) @@ -1,9 +1,8 @@ package jp.sf.pal.timecard.db.bsbhv; import java.util.List; +import java.util.Map; -import jp.sf.pal.timecard.db.allcommon.DaoReadable; -import jp.sf.pal.timecard.db.allcommon.DaoWritable; import jp.sf.pal.timecard.db.allcommon.Entity; import jp.sf.pal.timecard.db.allcommon.bhv.setup.ValueLabelSetupper; import jp.sf.pal.timecard.db.allcommon.cbean.ConditionBean; @@ -16,13 +15,12 @@ import jp.sf.pal.timecard.db.allcommon.dbmeta.DBMeta; import jp.sf.pal.timecard.db.bsentity.dbmeta.GroupMappingDbm; import jp.sf.pal.timecard.db.cbean.GroupMappingCB; -import jp.sf.pal.timecard.db.exdao.GroupMappingDao; import jp.sf.pal.timecard.db.exentity.GroupInfo; import jp.sf.pal.timecard.db.exentity.GroupMapping; import jp.sf.pal.timecard.db.exentity.UserInfo; /** - * The behavior of GROUP_MAPPING. + * The behavior of GROUP_MAPPING that the type is TABLE.
* *
  * [primary-key]
@@ -67,12 +65,6 @@
 
     //==========================================================================
     // =========
-    // Attribute
-    // =========
-    protected GroupMappingDao _dao;
-
-    //==========================================================================
-    // =========
     // Table name
     // ==========
     /** @return The name on database of table. (NotNull) */
@@ -84,39 +76,18 @@
     // =========
     // DBMeta
     // ======
-    /** @return The meta data of the database. (NotNull) */
+    /** @return The instance of DBMeta. (NotNull) */
     public DBMeta getDBMeta() {
         return GroupMappingDbm.getInstance();
     }
 
-    /** @return The meta data of the database as my table type. (NotNull) */
+    /** @return The instance of DBMeta as my table type. (NotNull) */
     public GroupMappingDbm getMyDBMeta() {
         return GroupMappingDbm.getInstance();
     }
 
     //==========================================================================
     // =========
-    // Dao Accessor
-    // ============
-    public GroupMappingDao getMyDao() {
-        return _dao;
-    }
-
-    public void setMyDao(GroupMappingDao dao) {
-        assertObjectNotNull("dao", dao);
-        _dao = dao;
-    }
-
-    public DaoReadable getDaoReadable() {
-        return getMyDao();
-    }
-
-    public DaoWritable getDaoWritable() {
-        return getMyDao();
-    }
-
-    //==========================================================================
-    // =========
     // New Instance
     // ============
     public Entity newEntity() {
@@ -146,7 +117,7 @@
      * @return The selected count.
      */
     public int selectCount(GroupMappingCB cb) {
-        assertConditionBeanNotNull(cb);
+        assertCBNotNull(cb);
         return delegateSelectCount(cb);
     }
 
@@ -226,7 +197,7 @@
      * @return The result bean of selected list. (NotNull)
      */
     public ListResultBean selectList(GroupMappingCB cb) {
-        assertConditionBeanNotNull(cb);
+        assertCBNotNull(cb);
         return new ResultBeanBuilder(getTableDbName())
                 .buildListResultBean(cb, delegateSelectList(cb));
     }
@@ -242,7 +213,7 @@
      * @return The result bean of selected page. (NotNull)
      */
     public PagingResultBean selectPage(final GroupMappingCB cb) {
-        assertConditionBeanNotNull(cb);
+        assertCBNotNull(cb);
         final PagingInvoker invoker = new PagingInvoker(
                 getTableDbName());
         final PagingHandler handler = new PagingHandler() {
@@ -263,6 +234,32 @@
 
     //==========================================================================
     // =========
+    // Scalar Select
+    // =============
+    /**
+     * Select the scalar value derived by a function. 
Call a function + * method after this method called like as follows: + * + *
+     * groupMappingBhv.scalarSelect(Date.class).max(new ScalarQuery(GroupMappingCB cb) {
+     *     cb.specify().columnXxxDatetime(); // the required specification of target column
+     *     cb.query().setXxxName_PrefixSearch("S"); // query as you like it
+     * });
+     * 
+ * + * @param The type of result. + * @param resultType The type of result. (NotNull) + * @return The scalar value derived by a function. (Nullable) + */ + public SLFunction scalarSelect( + Class resultType) { + GroupMappingCB cb = newMyConditionBean(); + cb.xsetupForScalarSelect(); + return new SLFunction(cb, resultType); + } + + //========================================================================== + // ========= // Various Select // ============== /** @@ -272,8 +269,7 @@ * @param valueLabelSetupper The setupper of value-label. (NotNull) * @return The list of value-label. (NotNull) */ - public List> selectValueLabelList( - GroupMappingCB cb, + public List> selectValueLabelList(GroupMappingCB cb, ValueLabelSetupper valueLabelSetupper) { return createValueLabelList(selectList(cb), valueLabelSetupper); } @@ -285,8 +281,8 @@ //========================================================================== // ========= - // Pullout Foreign - // =============== + // Pull out Foreign + // ================ /** * Pull out the list of foreign table 'GroupInfo'. * @@ -499,11 +495,11 @@ */ public int queryUpdate(GroupMapping groupMapping, GroupMappingCB cb) { assertObjectNotNull("groupMapping", groupMapping); - assertConditionBeanNotNull(cb); + assertCBNotNull(cb); setupCommonColumnOfUpdateIfNeeds(groupMapping); filterEntityOfUpdate(groupMapping); assertEntityOfUpdate(groupMapping); - return getMyDao().updateByQuery(cb, groupMapping); + return invoke(createQueryUpdateEntityCBCommand(groupMapping, cb)); } /** @@ -513,8 +509,8 @@ * @return The deleted count. */ public int queryDelete(GroupMappingCB cb) { - assertConditionBeanNotNull(cb); - return getMyDao().deleteByQuery(cb); + assertCBNotNull(cb); + return invoke(createQueryDeleteCBCommand(cb)); } //========================================================================== @@ -526,19 +522,27 @@ // ========= // Delegate Method // =============== + // [Behavior Command] // ----------------------------------------------------- // Select // ------ protected int delegateSelectCount(GroupMappingCB cb) { - assertConditionBeanNotNull(cb); - return getMyDao().selectCount(cb); + return invoke(createSelectCountCBCommand(cb)); } + protected int doCallReadCount(ConditionBean cb) { + return delegateSelectCount((GroupMappingCB) cb); + } + protected List delegateSelectList(GroupMappingCB cb) { - assertConditionBeanNotNull(cb); - return getMyDao().selectList(cb); + return invoke(createSelectListCBCommand(cb, GroupMapping.class)); } + @SuppressWarnings("unchecked") + protected List doCallReadList(ConditionBean cb) { + return (List) delegateSelectList((GroupMappingCB) cb); + } + // ----------------------------------------------------- // Update // ------ @@ -546,38 +550,71 @@ if (!processBeforeInsert(e)) { return 1; } - return getMyDao().insert(e); + return invoke(createInsertEntityCommand(e)); } + protected int doCallCreate(Entity entity) { + return delegateInsert(downcast(entity)); + } + protected int delegateUpdate(GroupMapping e) { if (!processBeforeUpdate(e)) { return 1; } - return getMyDao().updateModifiedOnly(e); + return invoke(createUpdateEntityCommand(e)); } + protected int doCallModify(Entity entity) { + return delegateUpdate(downcast(entity)); + } + protected int delegateDelete(GroupMapping e) { if (!processBeforeDelete(e)) { return 1; } - return getMyDao().delete(e); + return invoke(createDeleteEntityCommand(e)); } + protected int doCallRemove(Entity entity) { + return delegateDelete(downcast(entity)); + } + protected int[] delegateInsertList(List ls) { - assertObjectNotNull("groupMappingList", ls); - return getMyDao().insertList(helpFilterBeforeInsertInternally(ls)); + if (ls.isEmpty()) { + return new int[] {}; + } + return invoke(createBatchInsertEntityCommand(helpFilterBeforeInsertInternally(ls))); } + @SuppressWarnings("unchecked") + protected int[] doCreateList(List ls) { + return delegateInsertList((List) ls); + } + protected int[] delegateUpdateList(List ls) { - assertObjectNotNull("groupMappingList", ls); - return getMyDao().updateList(helpFilterBeforeUpdateInternally(ls)); + if (ls.isEmpty()) { + return new int[] {}; + } + return invoke(createBatchUpdateEntityCommand(helpFilterBeforeUpdateInternally(ls))); } + @SuppressWarnings("unchecked") + protected int[] doModifyList(List ls) { + return delegateUpdateList((List) ls); + } + protected int[] delegateDeleteList(List ls) { - assertObjectNotNull("groupMappingList", ls); - return getMyDao().deleteList(helpFilterBeforeDeleteInternally(ls)); + if (ls.isEmpty()) { + return new int[] {}; + } + return invoke(createBatchDeleteEntityCommand(helpFilterBeforeDeleteInternally(ls))); } + @SuppressWarnings("unchecked") + protected int[] doRemoveList(List ls) { + return delegateDeleteList((List) ls); + } + //========================================================================== // ========= // Optimistic Lock Info Modified: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/bsbhv/BsMonthlyReportBhv.java =================================================================== --- timecard/trunk/src/main/java/jp/sf/pal/timecard/db/bsbhv/BsMonthlyReportBhv.java 2008-12-27 22:18:30 UTC (rev 1630) +++ timecard/trunk/src/main/java/jp/sf/pal/timecard/db/bsbhv/BsMonthlyReportBhv.java 2008-12-27 22:20:25 UTC (rev 1631) @@ -1,9 +1,8 @@ package jp.sf.pal.timecard.db.bsbhv; import java.util.List; +import java.util.Map; -import jp.sf.pal.timecard.db.allcommon.DaoReadable; -import jp.sf.pal.timecard.db.allcommon.DaoWritable; import jp.sf.pal.timecard.db.allcommon.Entity; import jp.sf.pal.timecard.db.allcommon.bhv.load.LoadReferrerOption; import jp.sf.pal.timecard.db.allcommon.bhv.setup.ConditionBeanSetupper; @@ -22,14 +21,13 @@ import jp.sf.pal.timecard.db.cbean.MonthlyWorkingReportCB; import jp.sf.pal.timecard.db.exbhv.DailyReportBhv; import jp.sf.pal.timecard.db.exbhv.MonthlyWorkingReportBhv; -import jp.sf.pal.timecard.db.exdao.MonthlyReportDao; import jp.sf.pal.timecard.db.exentity.DailyReport; import jp.sf.pal.timecard.db.exentity.Employee; import jp.sf.pal.timecard.db.exentity.MonthlyReport; import jp.sf.pal.timecard.db.exentity.MonthlyWorkingReport; /** - * The behavior of MONTHLY_REPORT. + * The behavior of MONTHLY_REPORT that the type is TABLE.
* *
  * [primary-key]
@@ -74,12 +72,6 @@
 
     //==========================================================================
     // =========
-    // Attribute
-    // =========
-    protected MonthlyReportDao _dao;
-
-    //==========================================================================
-    // =========
     // Table name
     // ==========
     /** @return The name on database of table. (NotNull) */
@@ -91,39 +83,18 @@
     // =========
     // DBMeta
     // ======
-    /** @return The meta data of the database. (NotNull) */
+    /** @return The instance of DBMeta. (NotNull) */
     public DBMeta getDBMeta() {
         return MonthlyReportDbm.getInstance();
     }
 
-    /** @return The meta data of the database as my table type. (NotNull) */
+    /** @return The instance of DBMeta as my table type. (NotNull) */
     public MonthlyReportDbm getMyDBMeta() {
         return MonthlyReportDbm.getInstance();
     }
 
     //==========================================================================
     // =========
-    // Dao Accessor
-    // ============
-    public MonthlyReportDao getMyDao() {
-        return _dao;
-    }
-
-    public void setMyDao(MonthlyReportDao dao) {
-        assertObjectNotNull("dao", dao);
-        _dao = dao;
-    }
-
-    public DaoReadable getDaoReadable() {
-        return getMyDao();
-    }
-
-    public DaoWritable getDaoWritable() {
-        return getMyDao();
-    }
-
-    //==========================================================================
-    // =========
     // New Instance
     // ============
     public Entity newEntity() {
@@ -153,7 +124,7 @@
      * @return The selected count.
      */
     public int selectCount(MonthlyReportCB cb) {
-        assertConditionBeanNotNull(cb);
+        assertCBNotNull(cb);
         return delegateSelectCount(cb);
     }
 
@@ -233,7 +204,7 @@
      * @return The result bean of selected list. (NotNull)
      */
     public ListResultBean selectList(MonthlyReportCB cb) {
-        assertConditionBeanNotNull(cb);
+        assertCBNotNull(cb);
         return new ResultBeanBuilder(getTableDbName())
                 .buildListResultBean(cb, delegateSelectList(cb));
     }
@@ -249,7 +220,7 @@
      * @return The result bean of selected page. (NotNull)
      */
     public PagingResultBean selectPage(final MonthlyReportCB cb) {
-        assertConditionBeanNotNull(cb);
+        assertCBNotNull(cb);
         final PagingInvoker invoker = new PagingInvoker(
                 getTableDbName());
         final PagingHandler handler = new PagingHandler() {
@@ -270,6 +241,32 @@
 
     //==========================================================================
     // =========
+    // Scalar Select
+    // =============
+    /**
+     * Select the scalar value derived by a function. 
Call a function + * method after this method called like as follows: + * + *
+     * monthlyReportBhv.scalarSelect(Date.class).max(new ScalarQuery(MonthlyReportCB cb) {
+     *     cb.specify().columnXxxDatetime(); // the required specification of target column
+     *     cb.query().setXxxName_PrefixSearch("S"); // query as you like it
+     * });
+     * 
+ * + * @param The type of result. + * @param resultType The type of result. (NotNull) + * @return The scalar value derived by a function. (Nullable) + */ + public SLFunction scalarSelect( + Class resultType) { + MonthlyReportCB cb = newMyConditionBean(); + cb.xsetupForScalarSelect(); + return new SLFunction(cb, resultType); + } + + //========================================================================== + // ========= // Various Select // ============== /** @@ -279,8 +276,7 @@ * @param valueLabelSetupper The setupper of value-label. (NotNull) * @return The list of value-label. (NotNull) */ - public List> selectValueLabelList( - MonthlyReportCB cb, + public List> selectValueLabelList(MonthlyReportCB cb, ValueLabelSetupper valueLabelSetupper) { return createValueLabelList(selectList(cb), valueLabelSetupper); } @@ -483,8 +479,8 @@ //========================================================================== // ========= - // Pullout Foreign - // =============== + // Pull out Foreign + // ================ /** * Pull out the list of foreign table 'Employee'. * @@ -802,11 +798,11 @@ */ public int queryUpdate(MonthlyReport monthlyReport, MonthlyReportCB cb) { assertObjectNotNull("monthlyReport", monthlyReport); - assertConditionBeanNotNull(cb); + assertCBNotNull(cb); setupCommonColumnOfUpdateIfNeeds(monthlyReport); filterEntityOfUpdate(monthlyReport); assertEntityOfUpdate(monthlyReport); - return getMyDao().updateByQuery(cb, monthlyReport); + return invoke(createQueryUpdateEntityCBCommand(monthlyReport, cb)); } /** @@ -816,8 +812,8 @@ * @return The deleted count. */ public int queryDelete(MonthlyReportCB cb) { - assertConditionBeanNotNull(cb); - return getMyDao().deleteByQuery(cb); + assertCBNotNull(cb); + return invoke(createQueryDeleteCBCommand(cb)); } //========================================================================== @@ -829,19 +825,27 @@ // ========= // Delegate Method // =============== + // [Behavior Command] // ----------------------------------------------------- // Select // ------ protected int delegateSelectCount(MonthlyReportCB cb) { - assertConditionBeanNotNull(cb); - return getMyDao().selectCount(cb); + return invoke(createSelectCountCBCommand(cb)); } + protected int doCallReadCount(ConditionBean cb) { + return delegateSelectCount((MonthlyReportCB) cb); + } + protected List delegateSelectList(MonthlyReportCB cb) { - assertConditionBeanNotNull(cb); - return getMyDao().selectList(cb); + return invoke(createSelectListCBCommand(cb, MonthlyReport.class)); } + @SuppressWarnings("unchecked") + protected List doCallReadList(ConditionBean cb) { + return (List) delegateSelectList((MonthlyReportCB) cb); + } + // ----------------------------------------------------- // Update // ------ @@ -849,62 +853,97 @@ if (!processBeforeInsert(e)) { return 1; } - return getMyDao().insert(e); + return invoke(createInsertEntityCommand(e)); } + protected int doCallCreate(Entity entity) { + return delegateInsert(downcast(entity)); + } + protected int delegateUpdate(MonthlyReport e) { if (!processBeforeUpdate(e)) { return 1; } - return getMyDao().updateModifiedOnly(e); + return invoke(createUpdateEntityCommand(e)); } + protected int doCallModify(Entity entity) { + return delegateUpdate(downcast(entity)); + } + protected int delegateUpdateNonstrict(MonthlyReport e) { if (!processBeforeUpdate(e)) { return 1; } - return getMyDao().updateNonstrictModifiedOnly(e); + return invoke(createUpdateNonstrictEntityCommand(e)); } protected int delegateDelete(MonthlyReport e) { if (!processBeforeDelete(e)) { return 1; } - return getMyDao().delete(e); + return invoke(createDeleteEntityCommand(e)); } + protected int doCallRemove(Entity entity) { + return delegateDelete(downcast(entity)); + } + protected int delegateDeleteNonstrict(MonthlyReport e) { if (!processBeforeDelete(e)) { return 1; } - return getMyDao().deleteNonstrict(e); + return invoke(createDeleteNonstrictEntityCommand(e)); } protected int[] delegateInsertList(List ls) { - assertObjectNotNull("monthlyReportList", ls); - return getMyDao().insertList(helpFilterBeforeInsertInternally(ls)); + if (ls.isEmpty()) { + return new int[] {}; + } + return invoke(createBatchInsertEntityCommand(helpFilterBeforeInsertInternally(ls))); } + @SuppressWarnings("unchecked") + protected int[] doCreateList(List ls) { + return delegateInsertList((List) ls); + } + protected int[] delegateUpdateList(List ls) { - assertObjectNotNull("monthlyReportList", ls); - return getMyDao().updateList(helpFilterBeforeUpdateInternally(ls)); + if (ls.isEmpty()) { + return new int[] {}; + } + return invoke(createBatchUpdateEntityCommand(helpFilterBeforeUpdateInternally(ls))); } + @SuppressWarnings("unchecked") + protected int[] doModifyList(List ls) { + return delegateUpdateList((List) ls); + } + protected int[] delegateUpdateListNonstrict(List ls) { - assertObjectNotNull("monthlyReportList", ls); - return getMyDao().updateListNonstrict( - helpFilterBeforeUpdateInternally(ls)); + if (ls.isEmpty()) { + return new int[] {}; + } + return invoke(createBatchUpdateNonstrictEntityCommand(helpFilterBeforeUpdateInternally(ls))); } protected int[] delegateDeleteList(List ls) { - assertObjectNotNull("monthlyReportList", ls); - return getMyDao().deleteList(helpFilterBeforeDeleteInternally(ls)); + if (ls.isEmpty()) { + return new int[] {}; + } + return invoke(createBatchDeleteEntityCommand(helpFilterBeforeDeleteInternally(ls))); } + @SuppressWarnings("unchecked") + protected int[] doRemoveList(List ls) { + return delegateDeleteList((List) ls); + } + protected int[] delegateDeleteListNonstrict(List ls) { - assertObjectNotNull("monthlyReportList", ls); - return getMyDao().deleteListNonstrict( - helpFilterBeforeDeleteInternally(ls)); + if (ls.isEmpty()) { + return new int[] {}; + } + return invoke(createBatchDeleteNonstrictEntityCommand(helpFilterBeforeDeleteInternally(ls))); } //========================================================================== Modified: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/bsbhv/BsMonthlyWorkingReportBhv.java =================================================================== --- timecard/trunk/src/main/java/jp/sf/pal/timecard/db/bsbhv/BsMonthlyWorkingReportBhv.java 2008-12-27 22:18:30 UTC (rev 1630) +++ timecard/trunk/src/main/java/jp/sf/pal/timecard/db/bsbhv/BsMonthlyWorkingReportBhv.java 2008-12-27 22:20:25 UTC (rev 1631) @@ -1,9 +1,8 @@ package jp.sf.pal.timecard.db.bsbhv; import java.util.List; +import java.util.Map; -import jp.sf.pal.timecard.db.allcommon.DaoReadable; -import jp.sf.pal.timecard.db.allcommon.DaoWritable; import jp.sf.pal.timecard.db.allcommon.Entity; import jp.sf.pal.timecard.db.allcommon.bhv.setup.ValueLabelSetupper; import jp.sf.pal.timecard.db.allcommon.cbean.ConditionBean; @@ -16,13 +15,12 @@ import jp.sf.pal.timecard.db.allcommon.dbmeta.DBMeta; import jp.sf.pal.timecard.db.bsentity.dbmeta.MonthlyWorkingReportDbm; import jp.sf.pal.timecard.db.cbean.MonthlyWorkingReportCB; -import jp.sf.pal.timecard.db.exdao.MonthlyWorkingReportDao; import jp.sf.pal.timecard.db.exentity.MonthlyReport; import jp.sf.pal.timecard.db.exentity.MonthlyWorkingReport; import jp.sf.pal.timecard.db.exentity.WorkingType; /** - * The behavior of MONTHLY_WORKING_REPORT. + * The behavior of MONTHLY_WORKING_REPORT that the type is TABLE.
* *
  * [primary-key]
@@ -67,12 +65,6 @@
 
     //==========================================================================
     // =========
-    // Attribute
-    // =========
-    protected MonthlyWorkingReportDao _dao;
-
-    //==========================================================================
-    // =========
     // Table name
     // ==========
     /** @return The name on database of table. (NotNull) */
@@ -84,39 +76,18 @@
     // =========
     // DBMeta
     // ======
-    /** @return The meta data of the database. (NotNull) */
+    /** @return The instance of DBMeta. (NotNull) */
     public DBMeta getDBMeta() {
         return MonthlyWorkingReportDbm.getInstance();
     }
 
-    /** @return The meta data of the database as my table type. (NotNull) */
+    /** @return The instance of DBMeta as my table type. (NotNull) */
     public MonthlyWorkingReportDbm getMyDBMeta() {
         return MonthlyWorkingReportDbm.getInstance();
     }
 
     //==========================================================================
     // =========
-    // Dao Accessor
-    // ============
-    public MonthlyWorkingReportDao getMyDao() {
-        return _dao;
-    }
-
-    public void setMyDao(MonthlyWorkingReportDao dao) {
-        assertObjectNotNull("dao", dao);
-        _dao = dao;
-    }
-
-    public DaoReadable getDaoReadable() {
-        return getMyDao();
-    }
-
-    public DaoWritable getDaoWritable() {
-        return getMyDao();
-    }
-
-    //==========================================================================
-    // =========
     // New Instance
     // ============
     public Entity newEntity() {
@@ -146,7 +117,7 @@
      * @return The selected count.
      */
     public int selectCount(MonthlyWorkingReportCB cb) {
-        assertConditionBeanNotNull(cb);
+        assertCBNotNull(cb);
         return delegateSelectCount(cb);
     }
 
@@ -228,7 +199,7 @@
      */
     public ListResultBean selectList(
             MonthlyWorkingReportCB cb) {
-        assertConditionBeanNotNull(cb);
+        assertCBNotNull(cb);
         return new ResultBeanBuilder(getTableDbName())
                 .buildListResultBean(cb, delegateSelectList(cb));
     }
@@ -245,7 +216,7 @@
      */
     public PagingResultBean selectPage(
             final MonthlyWorkingReportCB cb) {
-        assertConditionBeanNotNull(cb);
+        assertCBNotNull(cb);
         final PagingInvoker invoker = new PagingInvoker(
                 getTableDbName());
         final PagingHandler handler = new PagingHandler() {
@@ -266,6 +237,32 @@
 
     //==========================================================================
     // =========
+    // Scalar Select
+    // =============
+    /**
+     * Select the scalar value derived by a function. 
Call a function + * method after this method called like as follows: + * + *
+     * monthlyWorkingReportBhv.scalarSelect(Date.class).max(new ScalarQuery(MonthlyWorkingReportCB cb) {
+     *     cb.specify().columnXxxDatetime(); // the required specification of target column
+     *     cb.query().setXxxName_PrefixSearch("S"); // query as you like it
+     * });
+     * 
+ * + * @param The type of result. + * @param resultType The type of result. (NotNull) + * @return The scalar value derived by a function. (Nullable) + */ + public SLFunction scalarSelect( + Class resultType) { + MonthlyWorkingReportCB cb = newMyConditionBean(); + cb.xsetupForScalarSelect(); + return new SLFunction(cb, resultType); + } + + //========================================================================== + // ========= // Various Select // ============== /** @@ -275,7 +272,7 @@ * @param valueLabelSetupper The setupper of value-label. (NotNull) * @return The list of value-label. (NotNull) */ - public List> selectValueLabelList( + public List> selectValueLabelList( MonthlyWorkingReportCB cb, ValueLabelSetupper valueLabelSetupper) { return createValueLabelList(selectList(cb), valueLabelSetupper); @@ -288,8 +285,8 @@ //========================================================================== // ========= - // Pullout Foreign - // =============== + // Pull out Foreign + // ================ /** * Pull out the list of foreign table 'MonthlyReport'. * @@ -516,11 +513,11 @@ public int queryUpdate(MonthlyWorkingReport monthlyWorkingReport, MonthlyWorkingReportCB cb) { assertObjectNotNull("monthlyWorkingReport", monthlyWorkingReport); - assertConditionBeanNotNull(cb); + assertCBNotNull(cb); setupCommonColumnOfUpdateIfNeeds(monthlyWorkingReport); filterEntityOfUpdate(monthlyWorkingReport); assertEntityOfUpdate(monthlyWorkingReport); - return getMyDao().updateByQuery(cb, monthlyWorkingReport); + return invoke(createQueryUpdateEntityCBCommand(monthlyWorkingReport, cb)); } /** @@ -530,8 +527,8 @@ * @return The deleted count. */ public int queryDelete(MonthlyWorkingReportCB cb) { - assertConditionBeanNotNull(cb); - return getMyDao().deleteByQuery(cb); + assertCBNotNull(cb); + return invoke(createQueryDeleteCBCommand(cb)); } //========================================================================== @@ -543,20 +540,28 @@ // ========= // Delegate Method // =============== + // [Behavior Command] // ----------------------------------------------------- // Select // ------ protected int delegateSelectCount(MonthlyWorkingReportCB cb) { - assertConditionBeanNotNull(cb); - return getMyDao().selectCount(cb); + return invoke(createSelectCountCBCommand(cb)); } + protected int doCallReadCount(ConditionBean cb) { + return delegateSelectCount((MonthlyWorkingReportCB) cb); + } + protected List delegateSelectList( MonthlyWorkingReportCB cb) { - assertConditionBeanNotNull(cb); - return getMyDao().selectList(cb); + return invoke(createSelectListCBCommand(cb, MonthlyWorkingReport.class)); } + @SuppressWarnings("unchecked") + protected List doCallReadList(ConditionBean cb) { + return (List) delegateSelectList((MonthlyWorkingReportCB) cb); + } + // ----------------------------------------------------- // Update // ------ @@ -564,38 +569,71 @@ if (!processBeforeInsert(e)) { return 1; } - return getMyDao().insert(e); + return invoke(createInsertEntityCommand(e)); } + protected int doCallCreate(Entity entity) { + return delegateInsert(downcast(entity)); + } + protected int delegateUpdate(MonthlyWorkingReport e) { if (!processBeforeUpdate(e)) { return 1; } - return getMyDao().updateModifiedOnly(e); + return invoke(createUpdateEntityCommand(e)); } + protected int doCallModify(Entity entity) { + return delegateUpdate(downcast(entity)); + } + protected int delegateDelete(MonthlyWorkingReport e) { if (!processBeforeDelete(e)) { return 1; } - return getMyDao().delete(e); + return invoke(createDeleteEntityCommand(e)); } + protected int doCallRemove(Entity entity) { + return delegateDelete(downcast(entity)); + } + protected int[] delegateInsertList(List ls) { - assertObjectNotNull("monthlyWorkingReportList", ls); - return getMyDao().insertList(helpFilterBeforeInsertInternally(ls)); + if (ls.isEmpty()) { + return new int[] {}; + } + return invoke(createBatchInsertEntityCommand(helpFilterBeforeInsertInternally(ls))); } + @SuppressWarnings("unchecked") + protected int[] doCreateList(List ls) { + return delegateInsertList((List) ls); + } + protected int[] delegateUpdateList(List ls) { - assertObjectNotNull("monthlyWorkingReportList", ls); - return getMyDao().updateList(helpFilterBeforeUpdateInternally(ls)); + if (ls.isEmpty()) { + return new int[] {}; + } + return invoke(createBatchUpdateEntityCommand(helpFilterBeforeUpdateInternally(ls))); } + @SuppressWarnings("unchecked") + protected int[] doModifyList(List ls) { + return delegateUpdateList((List) ls); + } + protected int[] delegateDeleteList(List ls) { - assertObjectNotNull("monthlyWorkingReportList", ls); - return getMyDao().deleteList(helpFilterBeforeDeleteInternally(ls)); + if (ls.isEmpty()) { + return new int[] {}; + } + return invoke(createBatchDeleteEntityCommand(helpFilterBeforeDeleteInternally(ls))); } + @SuppressWarnings("unchecked") + protected int[] doRemoveList(List ls) { + return delegateDeleteList((List) ls); + } + //========================================================================== // ========= // Optimistic Lock Info Modified: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/bsbhv/BsRoleInfoBhv.java =================================================================== --- timecard/trunk/src/main/java/jp/sf/pal/timecard/db/bsbhv/BsRoleInfoBhv.java 2008-12-27 22:18:30 UTC (rev 1630) +++ timecard/trunk/src/main/java/jp/sf/pal/timecard/db/bsbhv/BsRoleInfoBhv.java 2008-12-27 22:20:25 UTC (rev 1631) @@ -1,9 +1,8 @@ package jp.sf.pal.timecard.db.bsbhv; import java.util.List; +import java.util.Map; -import jp.sf.pal.timecard.db.allcommon.DaoReadable; -import jp.sf.pal.timecard.db.allcommon.DaoWritable; import jp.sf.pal.timecard.db.allcommon.Entity; import jp.sf.pal.timecard.db.allcommon.bhv.load.LoadReferrerOption; import jp.sf.pal.timecard.db.allcommon.bhv.setup.ConditionBeanSetupper; @@ -22,13 +21,12 @@ import jp.sf.pal.timecard.db.cbean.UserInfoCB; import jp.sf.pal.timecard.db.exbhv.RoleMappingBhv; import jp.sf.pal.timecard.db.exbhv.UserInfoBhv; -import jp.sf.pal.timecard.db.exdao.RoleInfoDao; import jp.sf.pal.timecard.db.exentity.RoleInfo; import jp.sf.pal.timecard.db.exentity.RoleMapping; import jp.sf.pal.timecard.db.exentity.UserInfo; /** - * The behavior of ROLE_INFO. + * The behavior of ROLE_INFO that the type is TABLE.
* *
  * [primary-key]
@@ -73,12 +71,6 @@
 
     //==========================================================================
     // =========
-    // Attribute
-    // =========
-    protected RoleInfoDao _dao;
-
-    //==========================================================================
-    // =========
     // Table name
     // ==========
     /** @return The name on database of table. (NotNull) */
@@ -90,39 +82,18 @@
     // =========
     // DBMeta
     // ======
-    /** @return The meta data of the database. (NotNull) */
+    /** @return The instance of DBMeta. (NotNull) */
     public DBMeta getDBMeta() {
         return RoleInfoDbm.getInstance();
     }
 
-    /** @return The meta data of the database as my table type. (NotNull) */
+    /** @return The instance of DBMeta as my table type. (NotNull) */
     public RoleInfoDbm getMyDBMeta() {
         return RoleInfoDbm.getInstance();
     }
 
     //==========================================================================
     // =========
-    // Dao Accessor
-    // ============
-    public RoleInfoDao getMyDao() {
-        return _dao;
-    }
-
-    public void setMyDao(RoleInfoDao dao) {
-        assertObjectNotNull("dao", dao);
-        _dao = dao;
-    }
-
-    public DaoReadable getDaoReadable() {
-        return getMyDao();
-    }
-
-    public DaoWritable getDaoWritable() {
-        return getMyDao();
-    }
-
-    //==========================================================================
-    // =========
     // New Instance
     // ============
     public Entity newEntity() {
@@ -152,7 +123,7 @@
      * @return The selected count.
      */
     public int selectCount(RoleInfoCB cb) {
-        assertConditionBeanNotNull(cb);
+        assertCBNotNull(cb);
         return delegateSelectCount(cb);
     }
 
@@ -229,7 +200,7 @@
      * @return The result bean of selected list. (NotNull)
      */
     public ListResultBean selectList(RoleInfoCB cb) {
-        assertConditionBeanNotNull(cb);
+        assertCBNotNull(cb);
         return new ResultBeanBuilder(getTableDbName())
                 .buildListResultBean(cb, delegateSelectList(cb));
     }
@@ -245,7 +216,7 @@
      * @return The result bean of selected page. (NotNull)
      */
     public PagingResultBean selectPage(final RoleInfoCB cb) {
-        assertConditionBeanNotNull(cb);
+        assertCBNotNull(cb);
         final PagingInvoker invoker = new PagingInvoker(
                 getTableDbName());
         final PagingHandler handler = new PagingHandler() {
@@ -266,6 +237,32 @@
 
     //==========================================================================
     // =========
+    // Scalar Select
+    // =============
+    /**
+     * Select the scalar value derived by a function. 
Call a function + * method after this method called like as follows: + * + *
+     * roleInfoBhv.scalarSelect(Date.class).max(new ScalarQuery(RoleInfoCB cb) {
+     *     cb.specify().columnXxxDatetime(); // the required specification of target column
+     *     cb.query().setXxxName_PrefixSearch("S"); // query as you like it
+     * });
+     * 
+ * + * @param The type of result. + * @param resultType The type of result. (NotNull) + * @return The scalar value derived by a function. (Nullable) + */ + public SLFunction scalarSelect( + Class resultType) { + RoleInfoCB cb = newMyConditionBean(); + cb.xsetupForScalarSelect(); + return new SLFunction(cb, resultType); + } + + //========================================================================== + // ========= // Various Select // ============== /** @@ -275,8 +272,8 @@ * @param valueLabelSetupper The setupper of value-label. (NotNull) * @return The list of value-label. (NotNull) */ - public List> selectValueLabelList( - RoleInfoCB cb, ValueLabelSetupper valueLabelSetupper) { + public List> selectValueLabelList(RoleInfoCB cb, + ValueLabelSetupper valueLabelSetupper) { return createValueLabelList(selectList(cb), valueLabelSetupper); } @@ -467,8 +464,8 @@ //========================================================================== // ========= - // Pullout Foreign - // =============== + // Pull out Foreign + // ================ //========================================================================== // ========= @@ -764,11 +761,11 @@ */ public int queryUpdate(RoleInfo roleInfo, RoleInfoCB cb) { assertObjectNotNull("roleInfo", roleInfo); - assertConditionBeanNotNull(cb); + assertCBNotNull(cb); setupCommonColumnOfUpdateIfNeeds(roleInfo); filterEntityOfUpdate(roleInfo); assertEntityOfUpdate(roleInfo); - return getMyDao().updateByQuery(cb, roleInfo); + return invoke(createQueryUpdateEntityCBCommand(roleInfo, cb)); } /** @@ -778,8 +775,8 @@ * @return The deleted count. */ public int queryDelete(RoleInfoCB cb) { - assertConditionBeanNotNull(cb); - return getMyDao().deleteByQuery(cb); + assertCBNotNull(cb); + return invoke(createQueryDeleteCBCommand(cb)); } //========================================================================== @@ -791,19 +788,27 @@ // ========= // Delegate Method // =============== + // [Behavior Command] // ----------------------------------------------------- // Select // ------ protected int delegateSelectCount(RoleInfoCB cb) { - assertConditionBeanNotNull(cb); - return getMyDao().selectCount(cb); + return invoke(createSelectCountCBCommand(cb)); } + protected int doCallReadCount(ConditionBean cb) { + return delegateSelectCount((RoleInfoCB) cb); + } + protected List delegateSelectList(RoleInfoCB cb) { - assertConditionBeanNotNull(cb); - return getMyDao().selectList(cb); + return invoke(createSelectListCBCommand(cb, RoleInfo.class)); } + @SuppressWarnings("unchecked") + protected List doCallReadList(ConditionBean cb) { + return (List) delegateSelectList((RoleInfoCB) cb); + } + // ----------------------------------------------------- // Update // ------ @@ -811,62 +816,97 @@ if (!processBeforeInsert(e)) { return 1; } - return getMyDao().insert(e); + return invoke(createInsertEntityCommand(e)); } + protected int doCallCreate(Entity entity) { + return delegateInsert(downcast(entity)); + } + protected int delegateUpdate(RoleInfo e) { if (!processBeforeUpdate(e)) { return 1; } - return getMyDao().updateModifiedOnly(e); + return invoke(createUpdateEntityCommand(e)); } + protected int doCallModify(Entity entity) { + return delegateUpdate(downcast(entity)); + } + protected int delegateUpdateNonstrict(RoleInfo e) { if (!processBeforeUpdate(e)) { return 1; } - return getMyDao().updateNonstrictModifiedOnly(e); + return invoke(createUpdateNonstrictEntityCommand(e)); } protected int delegateDelete(RoleInfo e) { if (!processBeforeDelete(e)) { return 1; } - return getMyDao().delete(e); + return invoke(createDeleteEntityCommand(e)); } + protected int doCallRemove(Entity entity) { + return delegateDelete(downcast(entity)); + } + protected int delegateDeleteNonstrict(RoleInfo e) { if (!processBeforeDelete(e)) { return 1; } - return getMyDao().deleteNonstrict(e); + return invoke(createDeleteNonstrictEntityCommand(e)); } protected int[] delegateInsertList(List ls) { - assertObjectNotNull("roleInfoList", ls); - return getMyDao().insertList(helpFilterBeforeInsertInternally(ls)); + if (ls.isEmpty()) { + return new int[] {}; + } + return invoke(createBatchInsertEntityCommand(helpFilterBeforeInsertInternally(ls))); } + @SuppressWarnings("unchecked") + protected int[] doCreateList(List ls) { + return delegateInsertList((List) ls); + } + protected int[] delegateUpdateList(List ls) { - assertObjectNotNull("roleInfoList", ls); - return getMyDao().updateList(helpFilterBeforeUpdateInternally(ls)); + if (ls.isEmpty()) { + return new int[] {}; + } + return invoke(createBatchUpdateEntityCommand(helpFilterBeforeUpdateInternally(ls))); } + @SuppressWarnings("unchecked") + protected int[] doModifyList(List ls) { + return delegateUpdateList((List) ls); + } + protected int[] delegateUpdateListNonstrict(List ls) { - assertObjectNotNull("roleInfoList", ls); - return getMyDao().updateListNonstrict( - helpFilterBeforeUpdateInternally(ls)); + if (ls.isEmpty()) { + return new int[] {}; + } + return invoke(createBatchUpdateNonstrictEntityCommand(helpFilterBeforeUpdateInternally(ls))); } protected int[] delegateDeleteList(List ls) { - assertObjectNotNull("roleInfoList", ls); - return getMyDao().deleteList(helpFilterBeforeDeleteInternally(ls)); + if (ls.isEmpty()) { + return new int[] {}; + } + return invoke(createBatchDeleteEntityCommand(helpFilterBeforeDeleteInternally(ls))); } + @SuppressWarnings("unchecked") + protected int[] doRemoveList(List ls) { + return delegateDeleteList((List) ls); + } + protected int[] delegateDeleteListNonstrict(List ls) { - assertObjectNotNull("roleInfoList", ls); - return getMyDao().deleteListNonstrict( - helpFilterBeforeDeleteInternally(ls)); + if (ls.isEmpty()) { + return new int[] {}; + } + return invoke(createBatchDeleteNonstrictEntityCommand(helpFilterBeforeDeleteInternally(ls))); } //========================================================================== Modified: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/bsbhv/BsRoleMappingBhv.java =================================================================== --- timecard/trunk/src/main/java/jp/sf/pal/timecard/db/bsbhv/BsRoleMappingBhv.java 2008-12-27 22:18:30 UTC (rev 1630) +++ timecard/trunk/src/main/java/jp/sf/pal/timecard/db/bsbhv/BsRoleMappingBhv.java 2008-12-27 22:20:25 UTC (rev 1631) @@ -1,9 +1,8 @@ package jp.sf.pal.timecard.db.bsbhv; import java.util.List; +import java.util.Map; -import jp.sf.pal.timecard.db.allcommon.DaoReadable; -import jp.sf.pal.timecard.db.allcommon.DaoWritable; import jp.sf.pal.timecard.db.allcommon.Entity; import jp.sf.pal.timecard.db.allcommon.bhv.setup.ValueLabelSetupper; import jp.sf.pal.timecard.db.allcommon.cbean.ConditionBean; @@ -16,13 +15,12 @@ import jp.sf.pal.timecard.db.allcommon.dbmeta.DBMeta; import jp.sf.pal.timecard.db.bsentity.dbmeta.RoleMappingDbm; import jp.sf.pal.timecard.db.cbean.RoleMappingCB; -import jp.sf.pal.timecard.db.exdao.RoleMappingDao; import jp.sf.pal.timecard.db.exentity.RoleInfo; import jp.sf.pal.timecard.db.exentity.RoleMapping; import jp.sf.pal.timecard.db.exentity.UserInfo; /** - * The behavior of ROLE_MAPPING. + * The behavior of ROLE_MAPPING that the type is TABLE.
* *
  * [primary-key]
@@ -67,12 +65,6 @@
 
     //==========================================================================
     // =========
-    // Attribute
-    // =========
-    protected RoleMappingDao _dao;
-
-    //==========================================================================
-    // =========
     // Table name
     // ==========
     /** @return The name on database of table. (NotNull) */
@@ -84,39 +76,18 @@
     // =========
     // DBMeta
     // ======
-    /** @return The meta data of the database. (NotNull) */
+    /** @return The instance of DBMeta. (NotNull) */
     public DBMeta getDBMeta() {
         return RoleMappingDbm.getInstance();
     }
 
-    /** @return The meta data of the database as my table type. (NotNull) */
+    /** @return The instance of DBMeta as my table type. (NotNull) */
     public RoleMappingDbm getMyDBMeta() {
         return RoleMappingDbm.getInstance();
     }
 
     //==========================================================================
     // =========
-    // Dao Accessor
-    // ============
-    public RoleMappingDao getMyDao() {
-        return _dao;
-    }
-
-    public void setMyDao(RoleMappingDao dao) {
-        assertObjectNotNull("dao", dao);
-        _dao = dao;
-    }
-
-    public DaoReadable getDaoReadable() {
-        return getMyDao();
-    }
-
-    public DaoWritable getDaoWritable() {
-        return getMyDao();
-    }
-
-    //==========================================================================
-    // =========
     // New Instance
     // ============
     public Entity newEntity() {
@@ -146,7 +117,7 @@
      * @return The selected count.
      */
     public int selectCount(RoleMappingCB cb) {
-        assertConditionBeanNotNull(cb);
+        assertCBNotNull(cb);
         return delegateSelectCount(cb);
     }
 
@@ -223,7 +194,7 @@
      * @return The result bean of selected list. (NotNull)
      */
     public ListResultBean selectList(RoleMappingCB cb) {
-        assertConditionBeanNotNull(cb);
+        assertCBNotNull(cb);
         return new ResultBeanBuilder(getTableDbName())
                 .buildListResultBean(cb, delegateSelectList(cb));
     }
@@ -239,7 +210,7 @@
      * @return The result bean of selected page. (NotNull)
      */
     public PagingResultBean selectPage(final RoleMappingCB cb) {
-        assertConditionBeanNotNull(cb);
+        assertCBNotNull(cb);
         final PagingInvoker invoker = new PagingInvoker(
                 getTableDbName());
         final PagingHandler handler = new PagingHandler() {
@@ -260,6 +231,32 @@
 
     //==========================================================================
     // =========
+    // Scalar Select
+    // =============
+    /**
+     * Select the scalar value derived by a function. 
Call a function + * method after this method called like as follows: + * + *
+     * roleMappingBhv.scalarSelect(Date.class).max(new ScalarQuery(RoleMappingCB cb) {
+     *     cb.specify().columnXxxDatetime(); // the required specification of target column
+     *     cb.query().setXxxName_PrefixSearch("S"); // query as you like it
+     * });
+     * 
+ * + * @param The type of result. + * @param resultType The type of result. (NotNull) + * @return The scalar value derived by a function. (Nullable) + */ + public SLFunction scalarSelect( + Class resultType) { + RoleMappingCB cb = newMyConditionBean(); + cb.xsetupForScalarSelect(); + return new SLFunction(cb, resultType); + } + + //========================================================================== + // ========= // Various Select // ============== /** @@ -269,8 +266,8 @@ * @param valueLabelSetupper The setupper of value-label. (NotNull) * @return The list of value-label. (NotNull) */ - public List> selectValueLabelList( - RoleMappingCB cb, ValueLabelSetupper valueLabelSetupper) { + public List> selectValueLabelList(RoleMappingCB cb, + ValueLabelSetupper valueLabelSetupper) { return createValueLabelList(selectList(cb), valueLabelSetupper); } @@ -281,8 +278,8 @@ //========================================================================== // ========= - // Pullout Foreign - // =============== + // Pull out Foreign + // ================ /** * Pull out the list of foreign table 'RoleInfo'. * @@ -494,11 +491,11 @@ */ public int queryUpdate(RoleMapping roleMapping, RoleMappingCB cb) { assertObjectNotNull("roleMapping", roleMapping); - assertConditionBeanNotNull(cb); + assertCBNotNull(cb); setupCommonColumnOfUpdateIfNeeds(roleMapping); filterEntityOfUpdate(roleMapping); assertEntityOfUpdate(roleMapping); - return getMyDao().updateByQuery(cb, roleMapping); + return invoke(createQueryUpdateEntityCBCommand(roleMapping, cb)); } /** @@ -508,8 +505,8 @@ * @return The deleted count. */ public int queryDelete(RoleMappingCB cb) { - assertConditionBeanNotNull(cb); - return getMyDao().deleteByQuery(cb); + assertCBNotNull(cb); + return invoke(createQueryDeleteCBCommand(cb)); } //========================================================================== @@ -521,19 +518,27 @@ // ========= // Delegate Method // =============== + // [Behavior Command] // ----------------------------------------------------- // Select // ------ protected int delegateSelectCount(RoleMappingCB cb) { - assertConditionBeanNotNull(cb); - return getMyDao().selectCount(cb); + return invoke(createSelectCountCBCommand(cb)); } + protected int doCallReadCount(ConditionBean cb) { + return delegateSelectCount((RoleMappingCB) cb); + } + protected List delegateSelectList(RoleMappingCB cb) { - assertConditionBeanNotNull(cb); - return getMyDao().selectList(cb); + return invoke(createSelectListCBCommand(cb, RoleMapping.class)); } + @SuppressWarnings("unchecked") + protected List doCallReadList(ConditionBean cb) { + return (List) delegateSelectList((RoleMappingCB) cb); + } + // ----------------------------------------------------- // Update // ------ @@ -541,38 +546,71 @@ if (!processBeforeInsert(e)) { return 1; } - return getMyDao().insert(e); + return invoke(createInsertEntityCommand(e)); } + protected int doCallCreate(Entity entity) { + return delegateInsert(downcast(entity)); + } + protected int delegateUpdate(RoleMapping e) { if (!processBeforeUpdate(e)) { return 1; } - return getMyDao().updateModifiedOnly(e); + return invoke(createUpdateEntityCommand(e)); } + protected int doCallModify(Entity entity) { + return delegateUpdate(downcast(entity)); + } + protected int delegateDelete(RoleMapping e) { if (!processBeforeDelete(e)) { return 1; } - return getMyDao().delete(e); + return invoke(createDeleteEntityCommand(e)); } + protected int doCallRemove(Entity entity) { + return delegateDelete(downcast(entity)); + } + protected int[] delegateInsertList(List ls) { - assertObjectNotNull("roleMappingList", ls); - return getMyDao().insertList(helpFilterBeforeInsertInternally(ls)); + if (ls.isEmpty()) { + return new int[] {}; + } + return invoke(createBatchInsertEntityCommand(helpFilterBeforeInsertInternally(ls))); } + @SuppressWarnings("unchecked") + protected int[] doCreateList(List ls) { + return delegateInsertList((List) ls); + } + protected int[] delegateUpdateList(List ls) { - assertObjectNotNull("roleMappingList", ls); - return getMyDao().updateList(helpFilterBeforeUpdateInternally(ls)); + if (ls.isEmpty()) { + return new int[] {}; + } + return invoke(createBatchUpdateEntityCommand(helpFilterBeforeUpdateInternally(ls))); } + @SuppressWarnings("unchecked") + protected int[] doModifyList(List ls) { + return delegateUpdateList((List) ls); + } + protected int[] delegateDeleteList(List ls) { - assertObjectNotNull("roleMappingList", ls); - return getMyDao().deleteList(helpFilterBeforeDeleteInternally(ls)); + if (ls.isEmpty()) { + return new int[] {}; + } + return invoke(createBatchDeleteEntityCommand(helpFilterBeforeDeleteInternally(ls))); } + @SuppressWarnings("unchecked") + protected int[] doRemoveList(List ls) { + return delegateDeleteList((List) ls); + } + //========================================================================== // ========= // Optimistic Lock Info Modified: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/bsbhv/BsUserInfoBhv.java =================================================================== --- timecard/trunk/src/main/java/jp/sf/pal/timecard/db/bsbhv/BsUserInfoBhv.java 2008-12-27 22:18:30 UTC (rev 1630) +++ timecard/trunk/src/main/java/jp/sf/pal/timecard/db/bsbhv/BsUserInfoBhv.java 2008-12-27 22:20:25 UTC (rev 1631) @@ -1,9 +1,8 @@ package jp.sf.pal.timecard.db.bsbhv; import java.util.List; +import java.util.Map; -import jp.sf.pal.timecard.db.allcommon.DaoReadable; -import jp.sf.pal.timecard.db.allcommon.DaoWritable; import jp.sf.pal.timecard.db.allcommon.Entity; import jp.sf.pal.timecard.db.allcommon.bhv.load.LoadReferrerOption; import jp.sf.pal.timecard.db.allcommon.bhv.setup.ConditionBeanSetupper; @@ -24,7 +23,6 @@ import jp.sf.pal.timecard.db.exbhv.EmployeeBhv; import jp.sf.pal.timecard.db.exbhv.GroupMappingBhv; import jp.sf.pal.timecard.db.exbhv.RoleMappingBhv; -import jp.sf.pal.timecard.db.exdao.UserInfoDao; import jp.sf.pal.timecard.db.exentity.Employee; import jp.sf.pal.timecard.db.exentity.GroupInfo; import jp.sf.pal.timecard.db.exentity.GroupMapping; @@ -33,14 +31,14 @@ import jp.sf.pal.timecard.db.exentity.UserInfo; /** - * The behavior of USER_INFO. + * The behavior of USER_INFO that the type is TABLE.
* *
  * [primary-key]
  *     USER_ID
  * 
  * [column]
- *     USER_ID, GIVEN_NAME, FAMILY_NAME, MIDDLE_NAME, GIVEN_NAME_DESC, FAMILY_NAME_DESC, NICKNAME, GENDER, BIRTH_DATE, EMAIL, URL, TELEPHONE, LOCALE, ROLE_ID, GROUP_ID, CREATED_TIME, CREATED_BY, UPDATED_TIME, UPDATED_BY, DELETED_TIME, DELETED_BY, VERSIONNO
+ *     USER_ID, GIVEN_NAME, FAMILY_NAME, MIDDLE_NAME, GIVEN_NAME_DESC, FAMILY_NAME_DESC, NICKNAME, GENDER, BIRTH_DATE, EMAIL, URL, TELEPHONE, LOCALE, ROLE_ID, GROUP_ID, STATUS, CREATED_TIME, CREATED_BY, UPDATED_TIME, UPDATED_BY, DELETED_TIME, DELETED_BY, VERSIONNO
  * 
  * [sequence]
  *     
@@ -78,12 +76,6 @@
 
     //==========================================================================
     // =========
-    // Attribute
-    // =========
-    protected UserInfoDao _dao;
-
-    //==========================================================================
-    // =========
     // Table name
     // ==========
     /** @return The name on database of table. (NotNull) */
@@ -95,39 +87,18 @@
     // =========
     // DBMeta
     // ======
-    /** @return The meta data of the database. (NotNull) */
+    /** @return The instance of DBMeta. (NotNull) */
     public DBMeta getDBMeta() {
         return UserInfoDbm.getInstance();
     }
 
-    /** @return The meta data of the database as my table type. (NotNull) */
+    /** @return The instance of DBMeta as my table type. (NotNull) */
     public UserInfoDbm getMyDBMeta() {
         return UserInfoDbm.getInstance();
     }
 
     //==========================================================================
     // =========
-    // Dao Accessor
-    // ============
-    public UserInfoDao getMyDao() {
-        return _dao;
-    }
-
-    public void setMyDao(UserInfoDao dao) {
-        assertObjectNotNull("dao", dao);
-        _dao = dao;
-    }
-
-    public DaoReadable getDaoReadable() {
-        return getMyDao();
-    }
-
-    public DaoWritable getDaoWritable() {
-        return getMyDao();
-    }
-
-    //==========================================================================
-    // =========
     // New Instance
     // ============
     public Entity newEntity() {
@@ -157,7 +128,7 @@
      * @return The selected count.
      */
     public int selectCount(UserInfoCB cb) {
-        assertConditionBeanNotNull(cb);
+        assertCBNotNull(cb);
         return delegateSelectCount(cb);
     }
 
@@ -234,7 +205,7 @@
      * @return The result bean of selected list. (NotNull)
      */
     public ListResultBean selectList(UserInfoCB cb) {
-        assertConditionBeanNotNull(cb);
+        assertCBNotNull(cb);
         return new ResultBeanBuilder(getTableDbName())
                 .buildListResultBean(cb, delegateSelectList(cb));
     }
@@ -250,7 +221,7 @@
      * @return The result bean of selected page. (NotNull)
      */
     public PagingResultBean selectPage(final UserInfoCB cb) {
-        assertConditionBeanNotNull(cb);
+        assertCBNotNull(cb);
         final PagingInvoker invoker = new PagingInvoker(
                 getTableDbName());
         final PagingHandler handler = new PagingHandler() {
@@ -271,6 +242,32 @@
 
     //==========================================================================
     // =========
+    // Scalar Select
+    // =============
+    /**
+     * Select the scalar value derived by a function. 
Call a function + * method after this method called like as follows: + * + *
+     * userInfoBhv.scalarSelect(Date.class).max(new ScalarQuery(UserInfoCB cb) {
+     *     cb.specify().columnXxxDatetime(); // the required specification of target column
+     *     cb.query().setXxxName_PrefixSearch("S"); // query as you like it
+     * });
+     * 
+ * + * @param The type of result. + * @param resultType The type of result. (NotNull) + * @return The scalar value derived by a function. (Nullable) + */ + public SLFunction scalarSelect( + Class resultType) { + UserInfoCB cb = newMyConditionBean(); + cb.xsetupForScalarSelect(); + return new SLFunction(cb, resultType); + } + + //========================================================================== + // ========= // Various Select // ============== /** @@ -280,8 +277,8 @@ * @param valueLabelSetupper The setupper of value-label. (NotNull) * @return The list of value-label. (NotNull) */ - public List> selectValueLabelList( - UserInfoCB cb, ValueLabelSetupper valueLabelSetupper) { + public List> selectValueLabelList(UserInfoCB cb, + ValueLabelSetupper valueLabelSetupper) { return createValueLabelList(selectList(cb), valueLabelSetupper); } @@ -653,8 +650,8 @@ //========================================================================== // ========= - // Pullout Foreign - // =============== + // Pull out Foreign + // ================ /** * Pull out the list of foreign table 'GroupInfo'. * @@ -979,11 +976,11 @@ */ public int queryUpdate(UserInfo userInfo, UserInfoCB cb) { assertObjectNotNull("userInfo", userInfo); - assertConditionBeanNotNull(cb); + assertCBNotNull(cb); setupCommonColumnOfUpdateIfNeeds(userInfo); filterEntityOfUpdate(userInfo); assertEntityOfUpdate(userInfo); - return getMyDao().updateByQuery(cb, userInfo); + return invoke(createQueryUpdateEntityCBCommand(userInfo, cb)); } /** @@ -993,8 +990,8 @@ * @return The deleted count. */ public int queryDelete(UserInfoCB cb) { - assertConditionBeanNotNull(cb); - return getMyDao().deleteByQuery(cb); + assertCBNotNull(cb); + return invoke(createQueryDeleteCBCommand(cb)); } //========================================================================== @@ -1006,19 +1003,27 @@ // ========= // Delegate Method // =============== + // [Behavior Command] // ----------------------------------------------------- // Select // ------ protected int delegateSelectCount(UserInfoCB cb) { - assertConditionBeanNotNull(cb); - return getMyDao().selectCount(cb); + return invoke(createSelectCountCBCommand(cb)); } + protected int doCallReadCount(ConditionBean cb) { + return delegateSelectCount((UserInfoCB) cb); + } + protected List delegateSelectList(UserInfoCB cb) { - assertConditionBeanNotNull(cb); - return getMyDao().selectList(cb); + return invoke(createSelectListCBCommand(cb, UserInfo.class)); } + @SuppressWarnings("unchecked") + protected List doCallReadList(ConditionBean cb) { + return (List) delegateSelectList((UserInfoCB) cb); + } + // ----------------------------------------------------- // Update // ------ @@ -1026,62 +1031,97 @@ if (!processBeforeInsert(e)) { return 1; } - return getMyDao().insert(e); + return invoke(createInsertEntityCommand(e)); } + protected int doCallCreate(Entity entity) { + return delegateInsert(downcast(entity)); + } + protected int delegateUpdate(UserInfo e) { if (!processBeforeUpdate(e)) { return 1; } - return getMyDao().updateModifiedOnly(e); + return invoke(createUpdateEntityCommand(e)); } + protected int doCallModify(Entity entity) { + return delegateUpdate(downcast(entity)); + } + protected int delegateUpdateNonstrict(UserInfo e) { if (!processBeforeUpdate(e)) { return 1; } - return getMyDao().updateNonstrictModifiedOnly(e); + return invoke(createUpdateNonstrictEntityCommand(e)); } protected int delegateDelete(UserInfo e) { if (!processBeforeDelete(e)) { return 1; } - return getMyDao().delete(e); + return invoke(createDeleteEntityCommand(e)); } + protected int doCallRemove(Entity entity) { + return delegateDelete(downcast(entity)); + } + protected int delegateDeleteNonstrict(UserInfo e) { if (!processBeforeDelete(e)) { return 1; } - return getMyDao().deleteNonstrict(e); + return invoke(createDeleteNonstrictEntityCommand(e)); } protected int[] delegateInsertList(List ls) { - assertObjectNotNull("userInfoList", ls); - return getMyDao().insertList(helpFilterBeforeInsertInternally(ls)); + if (ls.isEmpty()) { + return new int[] {}; + } + return invoke(createBatchInsertEntityCommand(helpFilterBeforeInsertInternally(ls))); } + @SuppressWarnings("unchecked") + protected int[] doCreateList(List ls) { + return delegateInsertList((List) ls); + } + protected int[] delegateUpdateList(List ls) { - assertObjectNotNull("userInfoList", ls); - return getMyDao().updateList(helpFilterBeforeUpdateInternally(ls)); + if (ls.isEmpty()) { + return new int[] {}; + } + return invoke(createBatchUpdateEntityCommand(helpFilterBeforeUpdateInternally(ls))); } + @SuppressWarnings("unchecked") + protected int[] doModifyList(List ls) { + return delegateUpdateList((List) ls); + } + protected int[] delegateUpdateListNonstrict(List ls) { - assertObjectNotNull("userInfoList", ls); - return getMyDao().updateListNonstrict( - helpFilterBeforeUpdateInternally(ls)); + if (ls.isEmpty()) { + return new int[] {}; + } + return invoke(createBatchUpdateNonstrictEntityCommand(helpFilterBeforeUpdateInternally(ls))); } protected int[] delegateDeleteList(List ls) { - assertObjectNotNull("userInfoList", ls); - return getMyDao().deleteList(helpFilterBeforeDeleteInternally(ls)); + if (ls.isEmpty()) { + return new int[] {}; + } + return invoke(createBatchDeleteEntityCommand(helpFilterBeforeDeleteInternally(ls))); } + @SuppressWarnings("unchecked") + protected int[] doRemoveList(List ls) { + return delegateDeleteList((List) ls); + } + protected int[] delegateDeleteListNonstrict(List ls) { - assertObjectNotNull("userInfoList", ls); - return getMyDao().deleteListNonstrict( - helpFilterBeforeDeleteInternally(ls)); + if (ls.isEmpty()) { + return new int[] {}; + } + return invoke(createBatchDeleteNonstrictEntityCommand(helpFilterBeforeDeleteInternally(ls))); } //========================================================================== Modified: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/bsbhv/BsWorkingTypeBhv.java =================================================================== --- timecard/trunk/src/main/java/jp/sf/pal/timecard/db/bsbhv/BsWorkingTypeBhv.java 2008-12-27 22:18:30 UTC (rev 1630) +++ timecard/trunk/src/main/java/jp/sf/pal/timecard/db/bsbhv/BsWorkingTypeBhv.java 2008-12-27 22:20:25 UTC (rev 1631) @@ -1,9 +1,8 @@ package jp.sf.pal.timecard.db.bsbhv; import java.util.List; +import java.util.Map; -import jp.sf.pal.timecard.db.allcommon.DaoReadable; -import jp.sf.pal.timecard.db.allcommon.DaoWritable; import jp.sf.pal.timecard.db.allcommon.Entity; import jp.sf.pal.timecard.db.allcommon.bhv.load.LoadReferrerOption; import jp.sf.pal.timecard.db.allcommon.bhv.setup.ConditionBeanSetupper; @@ -20,12 +19,11 @@ import jp.sf.pal.timecard.db.cbean.MonthlyWorkingReportCB; import jp.sf.pal.timecard.db.cbean.WorkingTypeCB; import jp.sf.pal.timecard.db.exbhv.MonthlyWorkingReportBhv; -import jp.sf.pal.timecard.db.exdao.WorkingTypeDao; import jp.sf.pal.timecard.db.exentity.MonthlyWorkingReport; import jp.sf.pal.timecard.db.exentity.WorkingType; /** - * The behavior of WORKING_TYPE. + * The behavior of WORKING_TYPE that the type is TABLE.
* *
  * [primary-key]
@@ -70,12 +68,6 @@
 
     //==========================================================================
     // =========
-    // Attribute
-    // =========
-    protected WorkingTypeDao _dao;
-
-    //==========================================================================
-    // =========
     // Table name
     // ==========
     /** @return The name on database of table. (NotNull) */
@@ -87,39 +79,18 @@
     // =========
     // DBMeta
     // ======
-    /** @return The meta data of the database. (NotNull) */
+    /** @return The instance of DBMeta. (NotNull) */
     public DBMeta getDBMeta() {
         return WorkingTypeDbm.getInstance();
     }
 
-    /** @return The meta data of the database as my table type. (NotNull) */
+    /** @return The instance of DBMeta as my table type. (NotNull) */
     public WorkingTypeDbm getMyDBMeta() {
         return WorkingTypeDbm.getInstance();
     }
 
     //==========================================================================
     // =========
-    // Dao Accessor
-    // ============
-    public WorkingTypeDao getMyDao() {
-        return _dao;
-    }
-
-    public void setMyDao(WorkingTypeDao dao) {
-        assertObjectNotNull("dao", dao);
-        _dao = dao;
-    }
-
-    public DaoReadable getDaoReadable() {
-        return getMyDao();
-    }
-
-    public DaoWritable getDaoWritable() {
-        return getMyDao();
-    }
-
-    //==========================================================================
-    // =========
     // New Instance
     // ============
     public Entity newEntity() {
@@ -149,7 +120,7 @@
      * @return The selected count.
      */
     public int selectCount(WorkingTypeCB cb) {
-        assertConditionBeanNotNull(cb);
+        assertCBNotNull(cb);
         return delegateSelectCount(cb);
     }
 
@@ -226,7 +197,7 @@
      * @return The result bean of selected list. (NotNull)
      */
     public ListResultBean selectList(WorkingTypeCB cb) {
-        assertConditionBeanNotNull(cb);
+        assertCBNotNull(cb);
         return new ResultBeanBuilder(getTableDbName())
                 .buildListResultBean(cb, delegateSelectList(cb));
     }
@@ -242,7 +213,7 @@
      * @return The result bean of selected page. (NotNull)
      */
     public PagingResultBean selectPage(final WorkingTypeCB cb) {
-        assertConditionBeanNotNull(cb);
+        assertCBNotNull(cb);
         final PagingInvoker invoker = new PagingInvoker(
                 getTableDbName());
         final PagingHandler handler = new PagingHandler() {
@@ -263,6 +234,32 @@
 
     //==========================================================================
     // =========
+    // Scalar Select
+    // =============
+    /**
+     * Select the scalar value derived by a function. 
Call a function + * method after this method called like as follows: + * + *
+     * workingTypeBhv.scalarSelect(Date.class).max(new ScalarQuery(WorkingTypeCB cb) {
+     *     cb.specify().columnXxxDatetime(); // the required specification of target column
+     *     cb.query().setXxxName_PrefixSearch("S"); // query as you like it
+     * });
+     * 
+ * + * @param The type of result. + * @param resultType The type of result. (NotNull) + * @return The scalar value derived by a function. (Nullable) + */ + public SLFunction scalarSelect( + Class resultType) { + WorkingTypeCB cb = newMyConditionBean(); + cb.xsetupForScalarSelect(); + return new SLFunction(cb, resultType); + } + + //========================================================================== + // ========= // Various Select // ============== /** @@ -272,8 +269,8 @@ * @param valueLabelSetupper The setupper of value-label. (NotNull) * @return The list of value-label. (NotNull) */ - public List> selectValueLabelList( - WorkingTypeCB cb, ValueLabelSetupper valueLabelSetupper) { + public List> selectValueLabelList(WorkingTypeCB cb, + ValueLabelSetupper valueLabelSetupper) { return createValueLabelList(selectList(cb), valueLabelSetupper); } @@ -379,8 +376,8 @@ //========================================================================== // ========= - // Pullout Foreign - // =============== + // Pull out Foreign + // ================ //========================================================================== // ========= @@ -683,11 +680,11 @@ */ public int queryUpdate(WorkingType workingType, WorkingTypeCB cb) { assertObjectNotNull("workingType", workingType); - assertConditionBeanNotNull(cb); + assertCBNotNull(cb); setupCommonColumnOfUpdateIfNeeds(workingType); filterEntityOfUpdate(workingType); assertEntityOfUpdate(workingType); - return getMyDao().updateByQuery(cb, workingType); + return invoke(createQueryUpdateEntityCBCommand(workingType, cb)); } /** @@ -697,8 +694,8 @@ * @return The deleted count. */ public int queryDelete(WorkingTypeCB cb) { - assertConditionBeanNotNull(cb); - return getMyDao().deleteByQuery(cb); + assertCBNotNull(cb); + return invoke(createQueryDeleteCBCommand(cb)); } //========================================================================== @@ -710,19 +707,27 @@ // ========= // Delegate Method // =============== + // [Behavior Command] // ----------------------------------------------------- // Select // ------ protected int delegateSelectCount(WorkingTypeCB cb) { - assertConditionBeanNotNull(cb); - return getMyDao().selectCount(cb); + return invoke(createSelectCountCBCommand(cb)); } + protected int doCallReadCount(ConditionBean cb) { + return delegateSelectCount((WorkingTypeCB) cb); + } + protected List delegateSelectList(WorkingTypeCB cb) { - assertConditionBeanNotNull(cb); - return getMyDao().selectList(cb); + return invoke(createSelectListCBCommand(cb, WorkingType.class)); } + @SuppressWarnings("unchecked") + protected List doCallReadList(ConditionBean cb) { + return (List) delegateSelectList((WorkingTypeCB) cb); + } + // ----------------------------------------------------- // Update // ------ @@ -730,62 +735,97 @@ if (!processBeforeInsert(e)) { return 1; } - return getMyDao().insert(e); + return invoke(createInsertEntityCommand(e)); } + protected int doCallCreate(Entity entity) { + return delegateInsert(downcast(entity)); + } + protected int delegateUpdate(WorkingType e) { if (!processBeforeUpdate(e)) { return 1; } - return getMyDao().updateModifiedOnly(e); + return invoke(createUpdateEntityCommand(e)); } + protected int doCallModify(Entity entity) { + return delegateUpdate(downcast(entity)); + } + protected int delegateUpdateNonstrict(WorkingType e) { if (!processBeforeUpdate(e)) { return 1; } - return getMyDao().updateNonstrictModifiedOnly(e); + return invoke(createUpdateNonstrictEntityCommand(e)); } protected int delegateDelete(WorkingType e) { if (!processBeforeDelete(e)) { return 1; } - return getMyDao().delete(e); + return invoke(createDeleteEntityCommand(e)); } + protected int doCallRemove(Entity entity) { + return delegateDelete(downcast(entity)); + } + protected int delegateDeleteNonstrict(WorkingType e) { if (!processBeforeDelete(e)) { return 1; } - return getMyDao().deleteNonstrict(e); + return invoke(createDeleteNonstrictEntityCommand(e)); } protected int[] delegateInsertList(List ls) { - assertObjectNotNull("workingTypeList", ls); - return getMyDao().insertList(helpFilterBeforeInsertInternally(ls)); + if (ls.isEmpty()) { + return new int[] {}; + } + return invoke(createBatchInsertEntityCommand(helpFilterBeforeInsertInternally(ls))); } + @SuppressWarnings("unchecked") + protected int[] doCreateList(List ls) { + return delegateInsertList((List) ls); + } + protected int[] delegateUpdateList(List ls) { - assertObjectNotNull("workingTypeList", ls); - return getMyDao().updateList(helpFilterBeforeUpdateInternally(ls)); + if (ls.isEmpty()) { + return new int[] {}; + } + return invoke(createBatchUpdateEntityCommand(helpFilterBeforeUpdateInternally(ls))); } + @SuppressWarnings("unchecked") + protected int[] doModifyList(List ls) { + return delegateUpdateList((List) ls); + } + protected int[] delegateUpdateListNonstrict(List ls) { - assertObjectNotNull("workingTypeList", ls); - return getMyDao().updateListNonstrict( - helpFilterBeforeUpdateInternally(ls)); + if (ls.isEmpty()) { + return new int[] {}; + } + return invoke(createBatchUpdateNonstrictEntityCommand(helpFilterBeforeUpdateInternally(ls))); } protected int[] delegateDeleteList(List ls) { - assertObjectNotNull("workingTypeList", ls); - return getMyDao().deleteList(helpFilterBeforeDeleteInternally(ls)); + if (ls.isEmpty()) { + return new int[] {}; + } + return invoke(createBatchDeleteEntityCommand(helpFilterBeforeDeleteInternally(ls))); } + @SuppressWarnings("unchecked") + protected int[] doRemoveList(List ls) { + return delegateDeleteList((List) ls); + } + protected int[] delegateDeleteListNonstrict(List ls) { - assertObjectNotNull("workingTypeList", ls); - return getMyDao().deleteListNonstrict( - helpFilterBeforeDeleteInternally(ls)); + if (ls.isEmpty()) { + return new int[] {}; + } + return invoke(createBatchDeleteNonstrictEntityCommand(helpFilterBeforeDeleteInternally(ls))); } //========================================================================== Modified: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/bsentity/BsDailyReport.java =================================================================== --- timecard/trunk/src/main/java/jp/sf/pal/timecard/db/bsentity/BsDailyReport.java 2008-12-27 22:18:30 UTC (rev 1630) +++ timecard/trunk/src/main/java/jp/sf/pal/timecard/db/bsentity/BsDailyReport.java 2008-12-27 22:20:25 UTC (rev 1631) @@ -41,7 +41,6 @@ * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public abstract class BsDailyReport implements Entity, java.io.Serializable { //========================================================================== Modified: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/bsentity/BsEmployee.java =================================================================== --- timecard/trunk/src/main/java/jp/sf/pal/timecard/db/bsentity/BsEmployee.java 2008-12-27 22:18:30 UTC (rev 1630) +++ timecard/trunk/src/main/java/jp/sf/pal/timecard/db/bsentity/BsEmployee.java 2008-12-27 22:20:25 UTC (rev 1631) @@ -44,7 +44,6 @@ * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public abstract class BsEmployee implements Entity, java.io.Serializable { //========================================================================== Modified: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/bsentity/BsGroupInfo.java =================================================================== --- timecard/trunk/src/main/java/jp/sf/pal/timecard/db/bsentity/BsGroupInfo.java 2008-12-27 22:18:30 UTC (rev 1630) +++ timecard/trunk/src/main/java/jp/sf/pal/timecard/db/bsentity/BsGroupInfo.java 2008-12-27 22:20:25 UTC (rev 1631) @@ -44,7 +44,6 @@ * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public abstract class BsGroupInfo implements Entity, java.io.Serializable { //========================================================================== Modified: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/bsentity/BsGroupMapping.java =================================================================== --- timecard/trunk/src/main/java/jp/sf/pal/timecard/db/bsentity/BsGroupMapping.java 2008-12-27 22:18:30 UTC (rev 1630) +++ timecard/trunk/src/main/java/jp/sf/pal/timecard/db/bsentity/BsGroupMapping.java 2008-12-27 22:20:25 UTC (rev 1631) @@ -42,7 +42,6 @@ * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public abstract class BsGroupMapping implements Entity, java.io.Serializable { //========================================================================== Modified: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/bsentity/BsMonthlyReport.java =================================================================== --- timecard/trunk/src/main/java/jp/sf/pal/timecard/db/bsentity/BsMonthlyReport.java 2008-12-27 22:18:30 UTC (rev 1630) +++ timecard/trunk/src/main/java/jp/sf/pal/timecard/db/bsentity/BsMonthlyReport.java 2008-12-27 22:20:25 UTC (rev 1631) @@ -45,7 +45,6 @@ * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public abstract class BsMonthlyReport implements Entity, java.io.Serializable { //========================================================================== Modified: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/bsentity/BsMonthlyWorkingReport.java =================================================================== --- timecard/trunk/src/main/java/jp/sf/pal/timecard/db/bsentity/BsMonthlyWorkingReport.java 2008-12-27 22:18:30 UTC (rev 1630) +++ timecard/trunk/src/main/java/jp/sf/pal/timecard/db/bsentity/BsMonthlyWorkingReport.java 2008-12-27 22:20:25 UTC (rev 1631) @@ -42,7 +42,6 @@ * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public abstract class BsMonthlyWorkingReport implements Entity, java.io.Serializable { Modified: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/bsentity/BsRoleInfo.java =================================================================== --- timecard/trunk/src/main/java/jp/sf/pal/timecard/db/bsentity/BsRoleInfo.java 2008-12-27 22:18:30 UTC (rev 1630) +++ timecard/trunk/src/main/java/jp/sf/pal/timecard/db/bsentity/BsRoleInfo.java 2008-12-27 22:20:25 UTC (rev 1631) @@ -44,7 +44,6 @@ * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public abstract class BsRoleInfo implements Entity, java.io.Serializable { //========================================================================== Modified: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/bsentity/BsRoleMapping.java =================================================================== --- timecard/trunk/src/main/java/jp/sf/pal/timecard/db/bsentity/BsRoleMapping.java 2008-12-27 22:18:30 UTC (rev 1630) +++ timecard/trunk/src/main/java/jp/sf/pal/timecard/db/bsentity/BsRoleMapping.java 2008-12-27 22:20:25 UTC (rev 1631) @@ -42,7 +42,6 @@ * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public abstract class BsRoleMapping implements Entity, java.io.Serializable { //========================================================================== Modified: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/bsentity/BsUserInfo.java =================================================================== --- timecard/trunk/src/main/java/jp/sf/pal/timecard/db/bsentity/BsUserInfo.java 2008-12-27 22:18:30 UTC (rev 1630) +++ timecard/trunk/src/main/java/jp/sf/pal/timecard/db/bsentity/BsUserInfo.java 2008-12-27 22:20:25 UTC (rev 1631) @@ -21,7 +21,7 @@ * USER_ID * * [column] - * USER_ID, GIVEN_NAME, FAMILY_NAME, MIDDLE_NAME, GIVEN_NAME_DESC, FAMILY_NAME_DESC, NICKNAME, GENDER, BIRTH_DATE, EMAIL, URL, TELEPHONE, LOCALE, ROLE_ID, GROUP_ID, CREATED_TIME, CREATED_BY, UPDATED_TIME, UPDATED_BY, DELETED_TIME, DELETED_BY, VERSIONNO + * USER_ID, GIVEN_NAME, FAMILY_NAME, MIDDLE_NAME, GIVEN_NAME_DESC, FAMILY_NAME_DESC, NICKNAME, GENDER, BIRTH_DATE, EMAIL, URL, TELEPHONE, LOCALE, ROLE_ID, GROUP_ID, STATUS, CREATED_TIME, CREATED_BY, UPDATED_TIME, UPDATED_BY, DELETED_TIME, DELETED_BY, VERSIONNO * * [sequence] * @@ -47,7 +47,6 @@ * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public abstract class BsUserInfo implements Entity, java.io.Serializable { //========================================================================== @@ -115,6 +114,9 @@ /** GROUP_ID: {VARCHAR(255) : FK to GROUP_INFO} */ protected String _groupId; + /** STATUS: {VARCHAR(1)} */ + protected String _status; + /** CREATED_TIME: {NotNull : TIMESTAMP} */ protected java.sql.Timestamp _createdTime; @@ -462,6 +464,7 @@ sb.append(delimiter).append(getLocale()); sb.append(delimiter).append(getRoleId()); sb.append(delimiter).append(getGroupId()); + sb.append(delimiter).append(getStatus()); sb.append(delimiter).append(getCreatedTime()); sb.append(delimiter).append(getCreatedBy()); sb.append(delimiter).append(getUpdatedTime()); @@ -813,6 +816,28 @@ this._groupId = groupId; } + /** The column annotation for S2Dao. {VARCHAR(1)} */ + public static final String status_COLUMN = "STATUS"; + + /** + * STATUS: {VARCHAR(1)}
+ * + * @return The value of the column 'STATUS'. (Nullable) + */ + public String getStatus() { + return _status; + } + + /** + * STATUS: {VARCHAR(1)}
+ * + * @param status The value of the column 'STATUS'. (Nullable) + */ + public void setStatus(String status) { + _modifiedProperties.addPropertyName("status"); + this._status = status; + } + /** The column annotation for S2Dao. {NotNull : TIMESTAMP} */ public static final String createdTime_COLUMN = "CREATED_TIME"; Modified: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/bsentity/BsWorkingType.java =================================================================== --- timecard/trunk/src/main/java/jp/sf/pal/timecard/db/bsentity/BsWorkingType.java 2008-12-27 22:18:30 UTC (rev 1630) +++ timecard/trunk/src/main/java/jp/sf/pal/timecard/db/bsentity/BsWorkingType.java 2008-12-27 22:20:25 UTC (rev 1631) @@ -43,7 +43,6 @@ * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public abstract class BsWorkingType implements Entity, java.io.Serializable { //========================================================================== Modified: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/bsentity/dbmeta/DailyReportDbm.java =================================================================== --- timecard/trunk/src/main/java/jp/sf/pal/timecard/db/bsentity/dbmeta/DailyReportDbm.java 2008-12-27 22:18:30 UTC (rev 1630) +++ timecard/trunk/src/main/java/jp/sf/pal/timecard/db/bsentity/dbmeta/DailyReportDbm.java 2008-12-27 22:20:25 UTC (rev 1631) @@ -8,6 +8,7 @@ import jp.sf.pal.timecard.db.allcommon.dbmeta.info.ColumnInfo; import jp.sf.pal.timecard.db.allcommon.dbmeta.info.ForeignInfo; import jp.sf.pal.timecard.db.allcommon.dbmeta.info.UniqueInfo; +import jp.sf.pal.timecard.db.allcommon.helper.StringKeyMap; import jp.sf.pal.timecard.db.exentity.DailyReport; /** @@ -15,7 +16,6 @@ * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public class DailyReportDbm extends AbstractDBMeta { private static final DailyReportDbm _instance = new DailyReportDbm(); @@ -173,40 +173,14 @@ return _columnVersionno; } - { - initializeColumnInfoList(); - } - //========================================================================== // ========= - // Name Map - // ======== - public Map getDbNamePropertyNameKeyToLowerMap() { - return createDbNamePropertyNameKeyToLowerMap(); + // Resource Initialization + // ======================= + { + initializeInformationResource(); } - public Map getPropertyNameDbNameKeyToLowerMap() { - return createPropertyNameDbNameKeyToLowerMap(); - } - - protected static Map _dbNamePropertyNameKeyToLowerMap; - - protected Map createDbNamePropertyNameKeyToLowerMap() { - if (_dbNamePropertyNameKeyToLowerMap == null) { - _dbNamePropertyNameKeyToLowerMap = setupKeyToLowerMap(true); - } - return _dbNamePropertyNameKeyToLowerMap; - } - - protected static Map _propertyNameDbNameKeyToLowerMap; - - protected Map createPropertyNameDbNameKeyToLowerMap() { - if (_propertyNameDbNameKeyToLowerMap == null) { - _propertyNameDbNameKeyToLowerMap = setupKeyToLowerMap(false); - } - return _propertyNameDbNameKeyToLowerMap; - } - //========================================================================== // ========= // Type Name @@ -371,7 +345,8 @@ // Entity Property Setup // ===================== // It's very INTERNAL! - protected Map> _epsMap = newHashMap(); + protected Map> _epsMap = StringKeyMap + .createAsFlexibleConcurrent(); { setupEps(_epsMap, new EpsId(), columnId()); setupEps(_epsMap, new EpsDate(), columnDate()); Modified: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/bsentity/dbmeta/EmployeeDbm.java =================================================================== --- timecard/trunk/src/main/java/jp/sf/pal/timecard/db/bsentity/dbmeta/EmployeeDbm.java 2008-12-27 22:18:30 UTC (rev 1630) +++ timecard/trunk/src/main/java/jp/sf/pal/timecard/db/bsentity/dbmeta/EmployeeDbm.java 2008-12-27 22:20:25 UTC (rev 1631) @@ -9,6 +9,7 @@ import jp.sf.pal.timecard.db.allcommon.dbmeta.info.ForeignInfo; import jp.sf.pal.timecard.db.allcommon.dbmeta.info.ReferrerInfo; import jp.sf.pal.timecard.db.allcommon.dbmeta.info.UniqueInfo; +import jp.sf.pal.timecard.db.allcommon.helper.StringKeyMap; import jp.sf.pal.timecard.db.exentity.Employee; /** @@ -16,7 +17,6 @@ * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public class EmployeeDbm extends AbstractDBMeta { private static final EmployeeDbm _instance = new EmployeeDbm(); @@ -125,40 +125,14 @@ return _columnVersionno; } - { - initializeColumnInfoList(); - } - //========================================================================== // ========= - // Name Map - // ======== - public Map getDbNamePropertyNameKeyToLowerMap() { - return createDbNamePropertyNameKeyToLowerMap(); + // Resource Initialization + // ======================= + { + initializeInformationResource(); } - public Map getPropertyNameDbNameKeyToLowerMap() { - return createPropertyNameDbNameKeyToLowerMap(); - } - - protected static Map _dbNamePropertyNameKeyToLowerMap; - - protected Map createDbNamePropertyNameKeyToLowerMap() { - if (_dbNamePropertyNameKeyToLowerMap == null) { - _dbNamePropertyNameKeyToLowerMap = setupKeyToLowerMap(true); - } - return _dbNamePropertyNameKeyToLowerMap; - } - - protected static Map _propertyNameDbNameKeyToLowerMap; - - protected Map createPropertyNameDbNameKeyToLowerMap() { - if (_propertyNameDbNameKeyToLowerMap == null) { - _propertyNameDbNameKeyToLowerMap = setupKeyToLowerMap(false); - } - return _propertyNameDbNameKeyToLowerMap; - } - //========================================================================== // ========= // Type Name @@ -335,7 +309,8 @@ // Entity Property Setup // ===================== // It's very INTERNAL! - protected Map> _epsMap = newHashMap(); + protected Map> _epsMap = StringKeyMap + .createAsFlexibleConcurrent(); { setupEps(_epsMap, new EpsId(), columnId()); setupEps(_epsMap, new EpsUsername(), columnUsername()); Modified: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/bsentity/dbmeta/GroupInfoDbm.java =================================================================== --- timecard/trunk/src/main/java/jp/sf/pal/timecard/db/bsentity/dbmeta/GroupInfoDbm.java 2008-12-27 22:18:30 UTC (rev 1630) +++ timecard/trunk/src/main/java/jp/sf/pal/timecard/db/bsentity/dbmeta/GroupInfoDbm.java 2008-12-27 22:20:25 UTC (rev 1631) @@ -8,6 +8,7 @@ import jp.sf.pal.timecard.db.allcommon.dbmeta.info.ColumnInfo; import jp.sf.pal.timecard.db.allcommon.dbmeta.info.ReferrerInfo; import jp.sf.pal.timecard.db.allcommon.dbmeta.info.UniqueInfo; +import jp.sf.pal.timecard.db.allcommon.helper.StringKeyMap; import jp.sf.pal.timecard.db.exentity.GroupInfo; /** @@ -15,7 +16,6 @@ * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public class GroupInfoDbm extends AbstractDBMeta { private static final GroupInfoDbm _instance = new GroupInfoDbm(); @@ -138,40 +138,14 @@ return _columnVersionno; } - { - initializeColumnInfoList(); - } - //========================================================================== // ========= - // Name Map - // ======== - public Map getDbNamePropertyNameKeyToLowerMap() { - return createDbNamePropertyNameKeyToLowerMap(); + // Resource Initialization + // ======================= + { + initializeInformationResource(); } - public Map getPropertyNameDbNameKeyToLowerMap() { - return createPropertyNameDbNameKeyToLowerMap(); - } - - protected static Map _dbNamePropertyNameKeyToLowerMap; - - protected Map createDbNamePropertyNameKeyToLowerMap() { - if (_dbNamePropertyNameKeyToLowerMap == null) { - _dbNamePropertyNameKeyToLowerMap = setupKeyToLowerMap(true); - } - return _dbNamePropertyNameKeyToLowerMap; - } - - protected static Map _propertyNameDbNameKeyToLowerMap; - - protected Map createPropertyNameDbNameKeyToLowerMap() { - if (_propertyNameDbNameKeyToLowerMap == null) { - _propertyNameDbNameKeyToLowerMap = setupKeyToLowerMap(false); - } - return _propertyNameDbNameKeyToLowerMap; - } - //========================================================================== // ========= // Type Name @@ -341,7 +315,8 @@ // Entity Property Setup // ===================== // It's very INTERNAL! - protected Map> _epsMap = newHashMap(); + protected Map> _epsMap = StringKeyMap + .createAsFlexibleConcurrent(); { setupEps(_epsMap, new EpsGroupId(), columnGroupId()); setupEps(_epsMap, new EpsName(), columnName()); Modified: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/bsentity/dbmeta/GroupMappingDbm.java =================================================================== --- timecard/trunk/src/main/java/jp/sf/pal/timecard/db/bsentity/dbmeta/GroupMappingDbm.java 2008-12-27 22:18:30 UTC (rev 1630) +++ timecard/trunk/src/main/java/jp/sf/pal/timecard/db/bsentity/dbmeta/GroupMappingDbm.java 2008-12-27 22:20:25 UTC (rev 1631) @@ -8,6 +8,7 @@ import jp.sf.pal.timecard.db.allcommon.dbmeta.info.ColumnInfo; import jp.sf.pal.timecard.db.allcommon.dbmeta.info.ForeignInfo; import jp.sf.pal.timecard.db.allcommon.dbmeta.info.UniqueInfo; +import jp.sf.pal.timecard.db.allcommon.helper.StringKeyMap; import jp.sf.pal.timecard.db.exentity.GroupMapping; /** @@ -15,7 +16,6 @@ * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public class GroupMappingDbm extends AbstractDBMeta { private static final GroupMappingDbm _instance = new GroupMappingDbm(); @@ -68,40 +68,14 @@ return _columnGroupId; } - { - initializeColumnInfoList(); - } - //========================================================================== // ========= - // Name Map - // ======== - public Map getDbNamePropertyNameKeyToLowerMap() { - return createDbNamePropertyNameKeyToLowerMap(); + // Resource Initialization + // ======================= + { + initializeInformationResource(); } - public Map getPropertyNameDbNameKeyToLowerMap() { - return createPropertyNameDbNameKeyToLowerMap(); - } - - protected static Map _dbNamePropertyNameKeyToLowerMap; - - protected Map createDbNamePropertyNameKeyToLowerMap() { - if (_dbNamePropertyNameKeyToLowerMap == null) { - _dbNamePropertyNameKeyToLowerMap = setupKeyToLowerMap(true); - } - return _dbNamePropertyNameKeyToLowerMap; - } - - protected static Map _propertyNameDbNameKeyToLowerMap; - - protected Map createPropertyNameDbNameKeyToLowerMap() { - if (_propertyNameDbNameKeyToLowerMap == null) { - _propertyNameDbNameKeyToLowerMap = setupKeyToLowerMap(false); - } - return _propertyNameDbNameKeyToLowerMap; - } - //========================================================================== // ========= // Type Name @@ -263,7 +237,8 @@ // Entity Property Setup // ===================== // It's very INTERNAL! - protected Map> _epsMap = newHashMap(); + protected Map> _epsMap = StringKeyMap + .createAsFlexibleConcurrent(); { setupEps(_epsMap, new EpsId(), columnId()); setupEps(_epsMap, new EpsUserId(), columnUserId()); Modified: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/bsentity/dbmeta/MonthlyReportDbm.java =================================================================== --- timecard/trunk/src/main/java/jp/sf/pal/timecard/db/bsentity/dbmeta/MonthlyReportDbm.java 2008-12-27 22:18:30 UTC (rev 1630) +++ timecard/trunk/src/main/java/jp/sf/pal/timecard/db/bsentity/dbmeta/MonthlyReportDbm.java 2008-12-27 22:20:25 UTC (rev 1631) @@ -9,6 +9,7 @@ import jp.sf.pal.timecard.db.allcommon.dbmeta.info.ForeignInfo; import jp.sf.pal.timecard.db.allcommon.dbmeta.info.ReferrerInfo; import jp.sf.pal.timecard.db.allcommon.dbmeta.info.UniqueInfo; +import jp.sf.pal.timecard.db.allcommon.helper.StringKeyMap; import jp.sf.pal.timecard.db.exentity.MonthlyReport; /** @@ -16,7 +17,6 @@ * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public class MonthlyReportDbm extends AbstractDBMeta { private static final MonthlyReportDbm _instance = new MonthlyReportDbm(); @@ -167,40 +167,14 @@ return _columnVersionno; } - { - initializeColumnInfoList(); - } - //========================================================================== // ========= - // Name Map - // ======== - public Map getDbNamePropertyNameKeyToLowerMap() { - return createDbNamePropertyNameKeyToLowerMap(); + // Resource Initialization + // ======================= + { + initializeInformationResource(); } - public Map getPropertyNameDbNameKeyToLowerMap() { - return createPropertyNameDbNameKeyToLowerMap(); - } - - protected static Map _dbNamePropertyNameKeyToLowerMap; - - protected Map createDbNamePropertyNameKeyToLowerMap() { - if (_dbNamePropertyNameKeyToLowerMap == null) { - _dbNamePropertyNameKeyToLowerMap = setupKeyToLowerMap(true); - } - return _dbNamePropertyNameKeyToLowerMap; - } - - protected static Map _propertyNameDbNameKeyToLowerMap; - - protected Map createPropertyNameDbNameKeyToLowerMap() { - if (_propertyNameDbNameKeyToLowerMap == null) { - _propertyNameDbNameKeyToLowerMap = setupKeyToLowerMap(false); - } - return _propertyNameDbNameKeyToLowerMap; - } - //========================================================================== // ========= // Type Name @@ -376,7 +350,8 @@ // Entity Property Setup // ===================== // It's very INTERNAL! - protected Map> _epsMap = newHashMap(); + protected Map> _epsMap = StringKeyMap + .createAsFlexibleConcurrent(); { setupEps(_epsMap, new EpsId(), columnId()); setupEps(_epsMap, new EpsYear(), columnYear()); Modified: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/bsentity/dbmeta/MonthlyWorkingReportDbm.java =================================================================== --- timecard/trunk/src/main/java/jp/sf/pal/timecard/db/bsentity/dbmeta/MonthlyWorkingReportDbm.java 2008-12-27 22:18:30 UTC (rev 1630) +++ timecard/trunk/src/main/java/jp/sf/pal/timecard/db/bsentity/dbmeta/MonthlyWorkingReportDbm.java 2008-12-27 22:20:25 UTC (rev 1631) @@ -8,6 +8,7 @@ import jp.sf.pal.timecard.db.allcommon.dbmeta.info.ColumnInfo; import jp.sf.pal.timecard.db.allcommon.dbmeta.info.ForeignInfo; import jp.sf.pal.timecard.db.allcommon.dbmeta.info.UniqueInfo; +import jp.sf.pal.timecard.db.allcommon.helper.StringKeyMap; import jp.sf.pal.timecard.db.exentity.MonthlyWorkingReport; /** @@ -15,7 +16,6 @@ * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public class MonthlyWorkingReportDbm extends AbstractDBMeta { private static final MonthlyWorkingReportDbm _instance = new MonthlyWorkingReportDbm(); @@ -75,40 +75,14 @@ return _columnWorkingTypeId; } - { - initializeColumnInfoList(); - } - //========================================================================== // ========= - // Name Map - // ======== - public Map getDbNamePropertyNameKeyToLowerMap() { - return createDbNamePropertyNameKeyToLowerMap(); + // Resource Initialization + // ======================= + { + initializeInformationResource(); } - public Map getPropertyNameDbNameKeyToLowerMap() { - return createPropertyNameDbNameKeyToLowerMap(); - } - - protected static Map _dbNamePropertyNameKeyToLowerMap; - - protected Map createDbNamePropertyNameKeyToLowerMap() { - if (_dbNamePropertyNameKeyToLowerMap == null) { - _dbNamePropertyNameKeyToLowerMap = setupKeyToLowerMap(true); - } - return _dbNamePropertyNameKeyToLowerMap; - } - - protected static Map _propertyNameDbNameKeyToLowerMap; - - protected Map createPropertyNameDbNameKeyToLowerMap() { - if (_propertyNameDbNameKeyToLowerMap == null) { - _propertyNameDbNameKeyToLowerMap = setupKeyToLowerMap(false); - } - return _propertyNameDbNameKeyToLowerMap; - } - //========================================================================== // ========= // Type Name @@ -275,7 +249,8 @@ // Entity Property Setup // ===================== // It's very INTERNAL! - protected Map> _epsMap = newHashMap(); + protected Map> _epsMap = StringKeyMap + .createAsFlexibleConcurrent(); { setupEps(_epsMap, new EpsId(), columnId()); setupEps(_epsMap, new EpsValue(), columnValue()); Modified: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/bsentity/dbmeta/RoleInfoDbm.java =================================================================== --- timecard/trunk/src/main/java/jp/sf/pal/timecard/db/bsentity/dbmeta/RoleInfoDbm.java 2008-12-27 22:18:30 UTC (rev 1630) +++ timecard/trunk/src/main/java/jp/sf/pal/timecard/db/bsentity/dbmeta/RoleInfoDbm.java 2008-12-27 22:20:25 UTC (rev 1631) @@ -8,6 +8,7 @@ import jp.sf.pal.timecard.db.allcommon.dbmeta.info.ColumnInfo; import jp.sf.pal.timecard.db.allcommon.dbmeta.info.ReferrerInfo; import jp.sf.pal.timecard.db.allcommon.dbmeta.info.UniqueInfo; +import jp.sf.pal.timecard.db.allcommon.helper.StringKeyMap; import jp.sf.pal.timecard.db.exentity.RoleInfo; /** @@ -15,7 +16,6 @@ * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public class RoleInfoDbm extends AbstractDBMeta { private static final RoleInfoDbm _instance = new RoleInfoDbm(); @@ -138,40 +138,14 @@ return _columnVersionno; } - { - initializeColumnInfoList(); - } - //========================================================================== // ========= - // Name Map - // ======== - public Map getDbNamePropertyNameKeyToLowerMap() { - return createDbNamePropertyNameKeyToLowerMap(); + // Resource Initialization + // ======================= + { + initializeInformationResource(); } - public Map getPropertyNameDbNameKeyToLowerMap() { - return createPropertyNameDbNameKeyToLowerMap(); - } - - protected static Map _dbNamePropertyNameKeyToLowerMap; - - protected Map createDbNamePropertyNameKeyToLowerMap() { - if (_dbNamePropertyNameKeyToLowerMap == null) { - _dbNamePropertyNameKeyToLowerMap = setupKeyToLowerMap(true); - } - return _dbNamePropertyNameKeyToLowerMap; - } - - protected static Map _propertyNameDbNameKeyToLowerMap; - - protected Map createPropertyNameDbNameKeyToLowerMap() { - if (_propertyNameDbNameKeyToLowerMap == null) { - _propertyNameDbNameKeyToLowerMap = setupKeyToLowerMap(false); - } - return _propertyNameDbNameKeyToLowerMap; - } - //========================================================================== // ========= // Type Name @@ -341,7 +315,8 @@ // Entity Property Setup // ===================== // It's very INTERNAL! - protected Map> _epsMap = newHashMap(); + protected Map> _epsMap = StringKeyMap + .createAsFlexibleConcurrent(); { setupEps(_epsMap, new EpsRoleId(), columnRoleId()); setupEps(_epsMap, new EpsName(), columnName()); Modified: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/bsentity/dbmeta/RoleMappingDbm.java =================================================================== --- timecard/trunk/src/main/java/jp/sf/pal/timecard/db/bsentity/dbmeta/RoleMappingDbm.java 2008-12-27 22:18:30 UTC (rev 1630) +++ timecard/trunk/src/main/java/jp/sf/pal/timecard/db/bsentity/dbmeta/RoleMappingDbm.java 2008-12-27 22:20:25 UTC (rev 1631) @@ -8,6 +8,7 @@ import jp.sf.pal.timecard.db.allcommon.dbmeta.info.ColumnInfo; import jp.sf.pal.timecard.db.allcommon.dbmeta.info.ForeignInfo; import jp.sf.pal.timecard.db.allcommon.dbmeta.info.UniqueInfo; +import jp.sf.pal.timecard.db.allcommon.helper.StringKeyMap; import jp.sf.pal.timecard.db.exentity.RoleMapping; /** @@ -15,7 +16,6 @@ * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public class RoleMappingDbm extends AbstractDBMeta { private static final RoleMappingDbm _instance = new RoleMappingDbm(); @@ -68,40 +68,14 @@ return _columnRoleId; } - { - initializeColumnInfoList(); - } - //========================================================================== // ========= - // Name Map - // ======== - public Map getDbNamePropertyNameKeyToLowerMap() { - return createDbNamePropertyNameKeyToLowerMap(); + // Resource Initialization + // ======================= + { + initializeInformationResource(); } - public Map getPropertyNameDbNameKeyToLowerMap() { - return createPropertyNameDbNameKeyToLowerMap(); - } - - protected static Map _dbNamePropertyNameKeyToLowerMap; - - protected Map createDbNamePropertyNameKeyToLowerMap() { - if (_dbNamePropertyNameKeyToLowerMap == null) { - _dbNamePropertyNameKeyToLowerMap = setupKeyToLowerMap(true); - } - return _dbNamePropertyNameKeyToLowerMap; - } - - protected static Map _propertyNameDbNameKeyToLowerMap; - - protected Map createPropertyNameDbNameKeyToLowerMap() { - if (_propertyNameDbNameKeyToLowerMap == null) { - _propertyNameDbNameKeyToLowerMap = setupKeyToLowerMap(false); - } - return _propertyNameDbNameKeyToLowerMap; - } - //========================================================================== // ========= // Type Name @@ -263,7 +237,8 @@ // Entity Property Setup // ===================== // It's very INTERNAL! - protected Map> _epsMap = newHashMap(); + protected Map> _epsMap = StringKeyMap + .createAsFlexibleConcurrent(); { setupEps(_epsMap, new EpsId(), columnId()); setupEps(_epsMap, new EpsUserId(), columnUserId()); Modified: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/bsentity/dbmeta/UserInfoDbm.java =================================================================== --- timecard/trunk/src/main/java/jp/sf/pal/timecard/db/bsentity/dbmeta/UserInfoDbm.java 2008-12-27 22:18:30 UTC (rev 1630) +++ timecard/trunk/src/main/java/jp/sf/pal/timecard/db/bsentity/dbmeta/UserInfoDbm.java 2008-12-27 22:20:25 UTC (rev 1631) @@ -9,6 +9,7 @@ import jp.sf.pal.timecard.db.allcommon.dbmeta.info.ForeignInfo; import jp.sf.pal.timecard.db.allcommon.dbmeta.info.ReferrerInfo; import jp.sf.pal.timecard.db.allcommon.dbmeta.info.UniqueInfo; +import jp.sf.pal.timecard.db.allcommon.helper.StringKeyMap; import jp.sf.pal.timecard.db.exentity.UserInfo; /** @@ -16,7 +17,6 @@ * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public class UserInfoDbm extends AbstractDBMeta { private static final UserInfoDbm _instance = new UserInfoDbm(); @@ -93,6 +93,9 @@ protected ColumnInfo _columnGroupId = cci("GROUP_ID", "groupId", String.class, false, 255, 0); + protected ColumnInfo _columnStatus = cci("STATUS", "status", String.class, + false, 1, 0); + protected ColumnInfo _columnCreatedTime = cci("CREATED_TIME", "createdTime", java.sql.Timestamp.class, false, null, null); @@ -174,6 +177,10 @@ return _columnGroupId; } + public ColumnInfo columnStatus() { + return _columnStatus; + } + public ColumnInfo columnCreatedTime() { return _columnCreatedTime; } @@ -202,40 +209,14 @@ return _columnVersionno; } - { - initializeColumnInfoList(); - } - //========================================================================== // ========= - // Name Map - // ======== - public Map getDbNamePropertyNameKeyToLowerMap() { - return createDbNamePropertyNameKeyToLowerMap(); + // Resource Initialization + // ======================= + { + initializeInformationResource(); } - public Map getPropertyNameDbNameKeyToLowerMap() { - return createPropertyNameDbNameKeyToLowerMap(); - } - - protected static Map _dbNamePropertyNameKeyToLowerMap; - - protected Map createDbNamePropertyNameKeyToLowerMap() { - if (_dbNamePropertyNameKeyToLowerMap == null) { - _dbNamePropertyNameKeyToLowerMap = setupKeyToLowerMap(true); - } - return _dbNamePropertyNameKeyToLowerMap; - } - - protected static Map _propertyNameDbNameKeyToLowerMap; - - protected Map createPropertyNameDbNameKeyToLowerMap() { - if (_propertyNameDbNameKeyToLowerMap == null) { - _propertyNameDbNameKeyToLowerMap = setupKeyToLowerMap(false); - } - return _propertyNameDbNameKeyToLowerMap; - } - //========================================================================== // ========= // Type Name @@ -431,7 +412,8 @@ // Entity Property Setup // ===================== // It's very INTERNAL! - protected Map> _epsMap = newHashMap(); + protected Map> _epsMap = StringKeyMap + .createAsFlexibleConcurrent(); { setupEps(_epsMap, new EpsUserId(), columnUserId()); setupEps(_epsMap, new EpsGivenName(), columnGivenName()); @@ -448,6 +430,7 @@ setupEps(_epsMap, new EpsLocale(), columnLocale()); setupEps(_epsMap, new EpsRoleId(), columnRoleId()); setupEps(_epsMap, new EpsGroupId(), columnGroupId()); + setupEps(_epsMap, new EpsStatus(), columnStatus()); setupEps(_epsMap, new EpsCreatedTime(), columnCreatedTime()); setupEps(_epsMap, new EpsCreatedBy(), columnCreatedBy()); setupEps(_epsMap, new EpsUpdatedTime(), columnUpdatedTime()); @@ -556,6 +539,12 @@ } } + public static class EpsStatus implements Eps { + public void setup(UserInfo e, Object v) { + e.setStatus((String) v); + } + } + public static class EpsCreatedTime implements Eps { public void setup(UserInfo e, Object v) { e.setCreatedTime((java.sql.Timestamp) v); Modified: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/bsentity/dbmeta/WorkingTypeDbm.java =================================================================== --- timecard/trunk/src/main/java/jp/sf/pal/timecard/db/bsentity/dbmeta/WorkingTypeDbm.java 2008-12-27 22:18:30 UTC (rev 1630) +++ timecard/trunk/src/main/java/jp/sf/pal/timecard/db/bsentity/dbmeta/WorkingTypeDbm.java 2008-12-27 22:20:25 UTC (rev 1631) @@ -8,6 +8,7 @@ import jp.sf.pal.timecard.db.allcommon.dbmeta.info.ColumnInfo; import jp.sf.pal.timecard.db.allcommon.dbmeta.info.ReferrerInfo; import jp.sf.pal.timecard.db.allcommon.dbmeta.info.UniqueInfo; +import jp.sf.pal.timecard.db.allcommon.helper.StringKeyMap; import jp.sf.pal.timecard.db.exentity.WorkingType; /** @@ -15,7 +16,6 @@ * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public class WorkingTypeDbm extends AbstractDBMeta { private static final WorkingTypeDbm _instance = new WorkingTypeDbm(); @@ -131,40 +131,14 @@ return _columnVersionno; } - { - initializeColumnInfoList(); - } - //========================================================================== // ========= - // Name Map - // ======== - public Map getDbNamePropertyNameKeyToLowerMap() { - return createDbNamePropertyNameKeyToLowerMap(); + // Resource Initialization + // ======================= + { + initializeInformationResource(); } - public Map getPropertyNameDbNameKeyToLowerMap() { - return createPropertyNameDbNameKeyToLowerMap(); - } - - protected static Map _dbNamePropertyNameKeyToLowerMap; - - protected Map createDbNamePropertyNameKeyToLowerMap() { - if (_dbNamePropertyNameKeyToLowerMap == null) { - _dbNamePropertyNameKeyToLowerMap = setupKeyToLowerMap(true); - } - return _dbNamePropertyNameKeyToLowerMap; - } - - protected static Map _propertyNameDbNameKeyToLowerMap; - - protected Map createPropertyNameDbNameKeyToLowerMap() { - if (_propertyNameDbNameKeyToLowerMap == null) { - _propertyNameDbNameKeyToLowerMap = setupKeyToLowerMap(false); - } - return _propertyNameDbNameKeyToLowerMap; - } - //========================================================================== // ========= // Type Name @@ -328,7 +302,8 @@ // Entity Property Setup // ===================== // It's very INTERNAL! - protected Map> _epsMap = newHashMap(); + protected Map> _epsMap = StringKeyMap + .createAsFlexibleConcurrent(); { setupEps(_epsMap, new EpsId(), columnId()); setupEps(_epsMap, new EpsName(), columnName()); Modified: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/cbean/bs/BsDailyReportCB.java =================================================================== --- timecard/trunk/src/main/java/jp/sf/pal/timecard/db/cbean/bs/BsDailyReportCB.java 2008-12-27 22:18:30 UTC (rev 1630) +++ timecard/trunk/src/main/java/jp/sf/pal/timecard/db/cbean/bs/BsDailyReportCB.java 2008-12-27 22:20:25 UTC (rev 1631) @@ -18,7 +18,6 @@ * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public class BsDailyReportCB extends AbstractConditionBean { //========================================================================== @@ -86,7 +85,12 @@ return _conditionQuery; } - public ConditionQuery getConditionQueryAsInterface() { + /** + * The implementation. + * + * @return The conditionQuery of the local table as interface. (NotNull) + */ + public ConditionQuery localCQ() { return getConditionQuery(); } @@ -136,24 +140,6 @@ query().xsetUnionAllQuery(cq); } - /** - * @param unionQuery The query of 'union'. (NotNull) - * @deprecated Sorry! Please use union(UnionQuery - * unionQuery). - */ - public void union(DailyReportCQ unionQuery) { - query().xsetUnionQuery(unionQuery); - } - - /** - * @param unionQuery The query of 'union'. (NotNull) - * @deprecated Sorry! Please use unionAll(UnionQuery - * unionQuery). - */ - public void unionAll(DailyReportCQ unionQuery) { - query().xsetUnionAllQuery(unionQuery); - } - public boolean hasUnionQueryOrUnionAllQuery() { return query().hasUnionQueryOrUnionAllQuery(); } @@ -162,7 +148,6 @@ // ========= // Setup Select // ============ - protected MonthlyReportNss _nssMonthlyReport; public MonthlyReportNss getNssMonthlyReport() { @@ -203,7 +188,8 @@ public DailyReportCQ qy() { return query(); } - }, _forDeriveReferrer); + }, _forDerivedReferrer, _forScalarSelect, + _forScalarSubQuery); } return _specification; } @@ -215,8 +201,10 @@ protected MonthlyReportCB.Specification _monthlyReport; public Specification(ConditionBean baseCB, - SpQyCall qyCall, boolean forDeriveReferrer) { - super(baseCB, qyCall, forDeriveReferrer); + SpQyCall qyCall, boolean forDeriveReferrer, + boolean forScalarSelect, boolean forScalarSubQuery) { + super(baseCB, qyCall, forDeriveReferrer, forScalarSelect, + forScalarSubQuery); _myQyCall = qyCall; } @@ -306,7 +294,8 @@ public MonthlyReportCB.Specification specifyMonthlyReport() { assertForeign("monthlyReport"); if (_monthlyReport == null) { - _monthlyReport = new MonthlyReportCB.Specification(_baseCB, + _monthlyReport = new MonthlyReportCB.Specification( + _baseCB, new SpQyCall() { public boolean has() { return _myQyCall.has() @@ -318,7 +307,8 @@ public MonthlyReportCQ qy() { return _myQyCall.qy().queryMonthlyReport(); } - }, _forDeriveReferrer); + }, _forDerivedReferrer, _forScalarSelect, + _forScalarSubQuery); } return _monthlyReport; } Modified: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/cbean/bs/BsEmployeeCB.java =================================================================== --- timecard/trunk/src/main/java/jp/sf/pal/timecard/db/cbean/bs/BsEmployeeCB.java 2008-12-27 22:18:30 UTC (rev 1630) +++ timecard/trunk/src/main/java/jp/sf/pal/timecard/db/cbean/bs/BsEmployeeCB.java 2008-12-27 22:20:25 UTC (rev 1631) @@ -19,7 +19,6 @@ * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public class BsEmployeeCB extends AbstractConditionBean { //========================================================================== @@ -87,7 +86,12 @@ return _conditionQuery; } - public ConditionQuery getConditionQueryAsInterface() { + /** + * The implementation. + * + * @return The conditionQuery of the local table as interface. (NotNull) + */ + public ConditionQuery localCQ() { return getConditionQuery(); } @@ -137,23 +141,6 @@ query().xsetUnionAllQuery(cq); } - /** - * @param unionQuery The query of 'union'. (NotNull) - * @deprecated Sorry! Please use union(UnionQuery unionQuery). - */ - public void union(EmployeeCQ unionQuery) { - query().xsetUnionQuery(unionQuery); - } - - /** - * @param unionQuery The query of 'union'. (NotNull) - * @deprecated Sorry! Please use unionAll(UnionQuery - * unionQuery). - */ - public void unionAll(EmployeeCQ unionQuery) { - query().xsetUnionAllQuery(unionQuery); - } - public boolean hasUnionQueryOrUnionAllQuery() { return query().hasUnionQueryOrUnionAllQuery(); } @@ -162,7 +149,6 @@ // ========= // Setup Select // ============ - protected UserInfoNss _nssUserInfoByUsername; public UserInfoNss getNssUserInfoByUsername() { @@ -227,7 +213,8 @@ public EmployeeCQ qy() { return query(); } - }, _forDeriveReferrer); + }, _forDerivedReferrer, _forScalarSelect, + _forScalarSubQuery); } return _specification; } @@ -240,8 +227,10 @@ protected UserInfoCB.Specification _userInfoByManager; public Specification(ConditionBean baseCB, SpQyCall qyCall, - boolean forDeriveReferrer) { - super(baseCB, qyCall, forDeriveReferrer); + boolean forDeriveReferrer, boolean forScalarSelect, + boolean forScalarSubQuery) { + super(baseCB, qyCall, forDeriveReferrer, forScalarSelect, + forScalarSubQuery); _myQyCall = qyCall; } @@ -306,7 +295,8 @@ public UserInfoCB.Specification specifyUserInfoByUsername() { assertForeign("userInfoByUsername"); if (_userInfoByUsername == null) { - _userInfoByUsername = new UserInfoCB.Specification(_baseCB, + _userInfoByUsername = new UserInfoCB.Specification( + _baseCB, new SpQyCall() { public boolean has() { return _myQyCall.has() @@ -318,7 +308,8 @@ public UserInfoCQ qy() { return _myQyCall.qy().queryUserInfoByUsername(); } - }, _forDeriveReferrer); + }, _forDerivedReferrer, _forScalarSelect, + _forScalarSubQuery); } return _userInfoByUsername; } @@ -326,7 +317,8 @@ public UserInfoCB.Specification specifyUserInfoByManager() { assertForeign("userInfoByManager"); if (_userInfoByManager == null) { - _userInfoByManager = new UserInfoCB.Specification(_baseCB, + _userInfoByManager = new UserInfoCB.Specification( + _baseCB, new SpQyCall() { public boolean has() { return _myQyCall.has() @@ -338,7 +330,8 @@ public UserInfoCQ qy() { return _myQyCall.qy().queryUserInfoByManager(); } - }, _forDeriveReferrer); + }, _forDerivedReferrer, _forScalarSelect, + _forScalarSubQuery); } return _userInfoByManager; } Modified: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/cbean/bs/BsGroupInfoCB.java =================================================================== --- timecard/trunk/src/main/java/jp/sf/pal/timecard/db/cbean/bs/BsGroupInfoCB.java 2008-12-27 22:18:30 UTC (rev 1630) +++ timecard/trunk/src/main/java/jp/sf/pal/timecard/db/cbean/bs/BsGroupInfoCB.java 2008-12-27 22:20:25 UTC (rev 1631) @@ -17,7 +17,6 @@ * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public class BsGroupInfoCB extends AbstractConditionBean { //========================================================================== @@ -86,7 +85,12 @@ return _conditionQuery; } - public ConditionQuery getConditionQueryAsInterface() { + /** + * The implementation. + * + * @return The conditionQuery of the local table as interface. (NotNull) + */ + public ConditionQuery localCQ() { return getConditionQuery(); } @@ -136,23 +140,6 @@ query().xsetUnionAllQuery(cq); } - /** - * @param unionQuery The query of 'union'. (NotNull) - * @deprecated Sorry! Please use union(UnionQuery unionQuery). - */ - public void union(GroupInfoCQ unionQuery) { - query().xsetUnionQuery(unionQuery); - } - - /** - * @param unionQuery The query of 'union'. (NotNull) - * @deprecated Sorry! Please use unionAll(UnionQuery - * unionQuery). - */ - public void unionAll(GroupInfoCQ unionQuery) { - query().xsetUnionAllQuery(unionQuery); - } - public boolean hasUnionQueryOrUnionAllQuery() { return query().hasUnionQueryOrUnionAllQuery(); } @@ -180,7 +167,8 @@ public GroupInfoCQ qy() { return query(); } - }, _forDeriveReferrer); + }, _forDerivedReferrer, _forScalarSelect, + _forScalarSubQuery); } return _specification; } @@ -190,8 +178,10 @@ protected SpQyCall _myQyCall; public Specification(ConditionBean baseCB, - SpQyCall qyCall, boolean forDeriveReferrer) { - super(baseCB, qyCall, forDeriveReferrer); + SpQyCall qyCall, boolean forDeriveReferrer, + boolean forScalarSelect, boolean forScalarSubQuery) { + super(baseCB, qyCall, forDeriveReferrer, forScalarSelect, + forScalarSubQuery); _myQyCall = qyCall; } Modified: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/cbean/bs/BsGroupMappingCB.java =================================================================== --- timecard/trunk/src/main/java/jp/sf/pal/timecard/db/cbean/bs/BsGroupMappingCB.java 2008-12-27 22:18:30 UTC (rev 1630) +++ timecard/trunk/src/main/java/jp/sf/pal/timecard/db/cbean/bs/BsGroupMappingCB.java 2008-12-27 22:20:25 UTC (rev 1631) @@ -21,7 +21,6 @@ * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public class BsGroupMappingCB extends AbstractConditionBean { //========================================================================== @@ -89,7 +88,12 @@ return _conditionQuery; } - public ConditionQuery getConditionQueryAsInterface() { + /** + * The implementation. + * + * @return The conditionQuery of the local table as interface. (NotNull) + */ + public ConditionQuery localCQ() { return getConditionQuery(); } @@ -139,24 +143,6 @@ query().xsetUnionAllQuery(cq); } - /** - * @param unionQuery The query of 'union'. (NotNull) - * @deprecated Sorry! Please use union(UnionQuery - * unionQuery). - */ - public void union(GroupMappingCQ unionQuery) { - query().xsetUnionQuery(unionQuery); - } - - /** - * @param unionQuery The query of 'union'. (NotNull) - * @deprecated Sorry! Please use unionAll(UnionQuery - * unionQuery). - */ - public void unionAll(GroupMappingCQ unionQuery) { - query().xsetUnionAllQuery(unionQuery); - } - public boolean hasUnionQueryOrUnionAllQuery() { return query().hasUnionQueryOrUnionAllQuery(); } @@ -165,7 +151,6 @@ // ========= // Setup Select // ============ - protected GroupInfoNss _nssGroupInfo; public GroupInfoNss getNssGroupInfo() { @@ -226,7 +211,8 @@ public GroupMappingCQ qy() { return query(); } - }, _forDeriveReferrer); + }, _forDerivedReferrer, _forScalarSelect, + _forScalarSubQuery); } return _specification; } @@ -240,8 +226,10 @@ protected UserInfoCB.Specification _userInfo; public Specification(ConditionBean baseCB, - SpQyCall qyCall, boolean forDeriveReferrer) { - super(baseCB, qyCall, forDeriveReferrer); + SpQyCall qyCall, boolean forDeriveReferrer, + boolean forScalarSelect, boolean forScalarSubQuery) { + super(baseCB, qyCall, forDeriveReferrer, forScalarSelect, + forScalarSubQuery); _myQyCall = qyCall; } @@ -285,7 +273,8 @@ public GroupInfoCQ qy() { return _myQyCall.qy().queryGroupInfo(); } - }, _forDeriveReferrer); + }, _forDerivedReferrer, _forScalarSelect, + _forScalarSubQuery); } return _groupInfo; } @@ -304,7 +293,8 @@ public UserInfoCQ qy() { return _myQyCall.qy().queryUserInfo(); } - }, _forDeriveReferrer); + }, _forDerivedReferrer, _forScalarSelect, + _forScalarSubQuery); } return _userInfo; } Modified: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/cbean/bs/BsMonthlyReportCB.java =================================================================== --- timecard/trunk/src/main/java/jp/sf/pal/timecard/db/cbean/bs/BsMonthlyReportCB.java 2008-12-27 22:18:30 UTC (rev 1630) +++ timecard/trunk/src/main/java/jp/sf/pal/timecard/db/cbean/bs/BsMonthlyReportCB.java 2008-12-27 22:20:25 UTC (rev 1631) @@ -20,7 +20,6 @@ * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public class BsMonthlyReportCB extends AbstractConditionBean { //========================================================================== @@ -88,7 +87,12 @@ return _conditionQuery; } - public ConditionQuery getConditionQueryAsInterface() { + /** + * The implementation. + * + * @return The conditionQuery of the local table as interface. (NotNull) + */ + public ConditionQuery localCQ() { return getConditionQuery(); } @@ -138,24 +142,6 @@ query().xsetUnionAllQuery(cq); } - /** - * @param unionQuery The query of 'union'. (NotNull) - * @deprecated Sorry! Please use union(UnionQuery - * unionQuery). - */ - public void union(MonthlyReportCQ unionQuery) { - query().xsetUnionQuery(unionQuery); - } - - /** - * @param unionQuery The query of 'union'. (NotNull) - * @deprecated Sorry! Please use unionAll(UnionQuery - * unionQuery). - */ - public void unionAll(MonthlyReportCQ unionQuery) { - query().xsetUnionAllQuery(unionQuery); - } - public boolean hasUnionQueryOrUnionAllQuery() { return query().hasUnionQueryOrUnionAllQuery(); } @@ -164,7 +150,6 @@ // ========= // Setup Select // ============ - protected EmployeeNss _nssEmployee; public EmployeeNss getNssEmployee() { @@ -204,7 +189,8 @@ public MonthlyReportCQ qy() { return query(); } - }, _forDeriveReferrer); + }, _forDerivedReferrer, _forScalarSelect, + _forScalarSubQuery); } return _specification; } @@ -216,8 +202,10 @@ protected EmployeeCB.Specification _employee; public Specification(ConditionBean baseCB, - SpQyCall qyCall, boolean forDeriveReferrer) { - super(baseCB, qyCall, forDeriveReferrer); + SpQyCall qyCall, boolean forDeriveReferrer, + boolean forScalarSelect, boolean forScalarSubQuery) { + super(baseCB, qyCall, forDeriveReferrer, forScalarSelect, + forScalarSubQuery); _myQyCall = qyCall; } @@ -314,7 +302,8 @@ public EmployeeCQ qy() { return _myQyCall.qy().queryEmployee(); } - }, _forDeriveReferrer); + }, _forDerivedReferrer, _forScalarSelect, + _forScalarSubQuery); } return _employee; } Modified: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/cbean/bs/BsMonthlyWorkingReportCB.java =================================================================== --- timecard/trunk/src/main/java/jp/sf/pal/timecard/db/cbean/bs/BsMonthlyWorkingReportCB.java 2008-12-27 22:18:30 UTC (rev 1630) +++ timecard/trunk/src/main/java/jp/sf/pal/timecard/db/cbean/bs/BsMonthlyWorkingReportCB.java 2008-12-27 22:20:25 UTC (rev 1631) @@ -21,7 +21,6 @@ * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public class BsMonthlyWorkingReportCB extends AbstractConditionBean { //========================================================================== @@ -89,7 +88,12 @@ return _conditionQuery; } - public ConditionQuery getConditionQueryAsInterface() { + /** + * The implementation. + * + * @return The conditionQuery of the local table as interface. (NotNull) + */ + public ConditionQuery localCQ() { return getConditionQuery(); } @@ -139,24 +143,6 @@ query().xsetUnionAllQuery(cq); } - /** - * @param unionQuery The query of 'union'. (NotNull) - * @deprecated Sorry! Please use union(UnionQuery - * unionQuery). - */ - public void union(MonthlyWorkingReportCQ unionQuery) { - query().xsetUnionQuery(unionQuery); - } - - /** - * @param unionQuery The query of 'union'. (NotNull) - * @deprecated Sorry! Please use unionAll(UnionQuery - * unionQuery). - */ - public void unionAll(MonthlyWorkingReportCQ unionQuery) { - query().xsetUnionAllQuery(unionQuery); - } - public boolean hasUnionQueryOrUnionAllQuery() { return query().hasUnionQueryOrUnionAllQuery(); } @@ -165,7 +151,6 @@ // ========= // Setup Select // ============ - protected MonthlyReportNss _nssMonthlyReport; public MonthlyReportNss getNssMonthlyReport() { @@ -227,7 +212,8 @@ public MonthlyWorkingReportCQ qy() { return query(); } - }, _forDeriveReferrer); + }, _forDerivedReferrer, _forScalarSelect, + _forScalarSubQuery); } return _specification; } @@ -242,8 +228,10 @@ public Specification(ConditionBean baseCB, SpQyCall qyCall, - boolean forDeriveReferrer) { - super(baseCB, qyCall, forDeriveReferrer); + boolean forDeriveReferrer, boolean forScalarSelect, + boolean forScalarSubQuery) { + super(baseCB, qyCall, forDeriveReferrer, forScalarSelect, + forScalarSubQuery); _myQyCall = qyCall; } @@ -280,7 +268,8 @@ public MonthlyReportCB.Specification specifyMonthlyReport() { assertForeign("monthlyReport"); if (_monthlyReport == null) { - _monthlyReport = new MonthlyReportCB.Specification(_baseCB, + _monthlyReport = new MonthlyReportCB.Specification( + _baseCB, new SpQyCall() { public boolean has() { return _myQyCall.has() @@ -292,7 +281,8 @@ public MonthlyReportCQ qy() { return _myQyCall.qy().queryMonthlyReport(); } - }, _forDeriveReferrer); + }, _forDerivedReferrer, _forScalarSelect, + _forScalarSubQuery); } return _monthlyReport; } @@ -300,7 +290,8 @@ public WorkingTypeCB.Specification specifyWorkingType() { assertForeign("workingType"); if (_workingType == null) { - _workingType = new WorkingTypeCB.Specification(_baseCB, + _workingType = new WorkingTypeCB.Specification( + _baseCB, new SpQyCall() { public boolean has() { return _myQyCall.has() @@ -311,7 +302,8 @@ public WorkingTypeCQ qy() { return _myQyCall.qy().queryWorkingType(); } - }, _forDeriveReferrer); + }, _forDerivedReferrer, _forScalarSelect, + _forScalarSubQuery); } return _workingType; } Modified: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/cbean/bs/BsRoleInfoCB.java =================================================================== --- timecard/trunk/src/main/java/jp/sf/pal/timecard/db/cbean/bs/BsRoleInfoCB.java 2008-12-27 22:18:30 UTC (rev 1630) +++ timecard/trunk/src/main/java/jp/sf/pal/timecard/db/cbean/bs/BsRoleInfoCB.java 2008-12-27 22:20:25 UTC (rev 1631) @@ -17,7 +17,6 @@ * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public class BsRoleInfoCB extends AbstractConditionBean { //========================================================================== @@ -86,7 +85,12 @@ return _conditionQuery; } - public ConditionQuery getConditionQueryAsInterface() { + /** + * The implementation. + * + * @return The conditionQuery of the local table as interface. (NotNull) + */ + public ConditionQuery localCQ() { return getConditionQuery(); } @@ -136,23 +140,6 @@ query().xsetUnionAllQuery(cq); } - /** - * @param unionQuery The query of 'union'. (NotNull) - * @deprecated Sorry! Please use union(UnionQuery unionQuery). - */ - public void union(RoleInfoCQ unionQuery) { - query().xsetUnionQuery(unionQuery); - } - - /** - * @param unionQuery The query of 'union'. (NotNull) - * @deprecated Sorry! Please use unionAll(UnionQuery - * unionQuery). - */ - public void unionAll(RoleInfoCQ unionQuery) { - query().xsetUnionAllQuery(unionQuery); - } - public boolean hasUnionQueryOrUnionAllQuery() { return query().hasUnionQueryOrUnionAllQuery(); } @@ -180,7 +167,8 @@ public RoleInfoCQ qy() { return query(); } - }, _forDeriveReferrer); + }, _forDerivedReferrer, _forScalarSelect, + _forScalarSubQuery); } return _specification; } @@ -189,8 +177,10 @@ protected SpQyCall _myQyCall; public Specification(ConditionBean baseCB, SpQyCall qyCall, - boolean forDeriveReferrer) { - super(baseCB, qyCall, forDeriveReferrer); + boolean forDeriveReferrer, boolean forScalarSelect, + boolean forScalarSubQuery) { + super(baseCB, qyCall, forDeriveReferrer, forScalarSelect, + forScalarSubQuery); _myQyCall = qyCall; } Modified: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/cbean/bs/BsRoleMappingCB.java =================================================================== --- timecard/trunk/src/main/java/jp/sf/pal/timecard/db/cbean/bs/BsRoleMappingCB.java 2008-12-27 22:18:30 UTC (rev 1630) +++ timecard/trunk/src/main/java/jp/sf/pal/timecard/db/cbean/bs/BsRoleMappingCB.java 2008-12-27 22:20:25 UTC (rev 1631) @@ -21,7 +21,6 @@ * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public class BsRoleMappingCB extends AbstractConditionBean { //========================================================================== @@ -89,7 +88,12 @@ return _conditionQuery; } - public ConditionQuery getConditionQueryAsInterface() { + /** + * The implementation. + * + * @return The conditionQuery of the local table as interface. (NotNull) + */ + public ConditionQuery localCQ() { return getConditionQuery(); } @@ -139,24 +143,6 @@ query().xsetUnionAllQuery(cq); } - /** - * @param unionQuery The query of 'union'. (NotNull) - * @deprecated Sorry! Please use union(UnionQuery - * unionQuery). - */ - public void union(RoleMappingCQ unionQuery) { - query().xsetUnionQuery(unionQuery); - } - - /** - * @param unionQuery The query of 'union'. (NotNull) - * @deprecated Sorry! Please use unionAll(UnionQuery - * unionQuery). - */ - public void unionAll(RoleMappingCQ unionQuery) { - query().xsetUnionAllQuery(unionQuery); - } - public boolean hasUnionQueryOrUnionAllQuery() { return query().hasUnionQueryOrUnionAllQuery(); } @@ -165,7 +151,6 @@ // ========= // Setup Select // ============ - protected RoleInfoNss _nssRoleInfo; public RoleInfoNss getNssRoleInfo() { @@ -226,7 +211,8 @@ public RoleMappingCQ qy() { return query(); } - }, _forDeriveReferrer); + }, _forDerivedReferrer, _forScalarSelect, + _forScalarSubQuery); } return _specification; } @@ -240,8 +226,10 @@ protected UserInfoCB.Specification _userInfo; public Specification(ConditionBean baseCB, - SpQyCall qyCall, boolean forDeriveReferrer) { - super(baseCB, qyCall, forDeriveReferrer); + SpQyCall qyCall, boolean forDeriveReferrer, + boolean forScalarSelect, boolean forScalarSubQuery) { + super(baseCB, qyCall, forDeriveReferrer, forScalarSelect, + forScalarSubQuery); _myQyCall = qyCall; } @@ -285,7 +273,8 @@ public RoleInfoCQ qy() { return _myQyCall.qy().queryRoleInfo(); } - }, _forDeriveReferrer); + }, _forDerivedReferrer, _forScalarSelect, + _forScalarSubQuery); } return _roleInfo; } @@ -304,7 +293,8 @@ public UserInfoCQ qy() { return _myQyCall.qy().queryUserInfo(); } - }, _forDeriveReferrer); + }, _forDerivedReferrer, _forScalarSelect, + _forScalarSubQuery); } return _userInfo; } Modified: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/cbean/bs/BsUserInfoCB.java =================================================================== --- timecard/trunk/src/main/java/jp/sf/pal/timecard/db/cbean/bs/BsUserInfoCB.java 2008-12-27 22:18:30 UTC (rev 1630) +++ timecard/trunk/src/main/java/jp/sf/pal/timecard/db/cbean/bs/BsUserInfoCB.java 2008-12-27 22:20:25 UTC (rev 1631) @@ -24,7 +24,6 @@ * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public class BsUserInfoCB extends AbstractConditionBean { //========================================================================== @@ -93,7 +92,12 @@ return _conditionQuery; } - public ConditionQuery getConditionQueryAsInterface() { + /** + * The implementation. + * + * @return The conditionQuery of the local table as interface. (NotNull) + */ + public ConditionQuery localCQ() { return getConditionQuery(); } @@ -143,23 +147,6 @@ query().xsetUnionAllQuery(cq); } - /** - * @param unionQuery The query of 'union'. (NotNull) - * @deprecated Sorry! Please use union(UnionQuery unionQuery). - */ - public void union(UserInfoCQ unionQuery) { - query().xsetUnionQuery(unionQuery); - } - - /** - * @param unionQuery The query of 'union'. (NotNull) - * @deprecated Sorry! Please use unionAll(UnionQuery - * unionQuery). - */ - public void unionAll(UserInfoCQ unionQuery) { - query().xsetUnionAllQuery(unionQuery); - } - public boolean hasUnionQueryOrUnionAllQuery() { return query().hasUnionQueryOrUnionAllQuery(); } @@ -168,7 +155,6 @@ // ========= // Setup Select // ============ - protected GroupInfoNss _nssGroupInfo; public GroupInfoNss getNssGroupInfo() { @@ -229,7 +215,8 @@ public UserInfoCQ qy() { return query(); } - }, _forDeriveReferrer); + }, _forDerivedReferrer, _forScalarSelect, + _forScalarSubQuery); } return _specification; } @@ -242,8 +229,10 @@ protected RoleInfoCB.Specification _roleInfo; public Specification(ConditionBean baseCB, SpQyCall qyCall, - boolean forDeriveReferrer) { - super(baseCB, qyCall, forDeriveReferrer); + boolean forDeriveReferrer, boolean forScalarSelect, + boolean forScalarSubQuery) { + super(baseCB, qyCall, forDeriveReferrer, forScalarSelect, + forScalarSubQuery); _myQyCall = qyCall; } @@ -307,6 +296,10 @@ doColumn("GROUP_ID"); } + public void columnStatus() { + doColumn("STATUS"); + } + public void columnCreatedTime() { doColumn("CREATED_TIME"); } @@ -363,7 +356,8 @@ public GroupInfoCQ qy() { return _myQyCall.qy().queryGroupInfo(); } - }, _forDeriveReferrer); + }, _forDerivedReferrer, _forScalarSelect, + _forScalarSubQuery); } return _groupInfo; } @@ -382,7 +376,8 @@ public RoleInfoCQ qy() { return _myQyCall.qy().queryRoleInfo(); } - }, _forDeriveReferrer); + }, _forDerivedReferrer, _forScalarSelect, + _forScalarSubQuery); } return _roleInfo; } Modified: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/cbean/bs/BsWorkingTypeCB.java =================================================================== --- timecard/trunk/src/main/java/jp/sf/pal/timecard/db/cbean/bs/BsWorkingTypeCB.java 2008-12-27 22:18:30 UTC (rev 1630) +++ timecard/trunk/src/main/java/jp/sf/pal/timecard/db/cbean/bs/BsWorkingTypeCB.java 2008-12-27 22:20:25 UTC (rev 1631) @@ -16,7 +16,6 @@ * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public class BsWorkingTypeCB extends AbstractConditionBean { //========================================================================== @@ -84,7 +83,12 @@ return _conditionQuery; } - public ConditionQuery getConditionQueryAsInterface() { + /** + * The implementation. + * + * @return The conditionQuery of the local table as interface. (NotNull) + */ + public ConditionQuery localCQ() { return getConditionQuery(); } @@ -134,24 +138,6 @@ query().xsetUnionAllQuery(cq); } - /** - * @param unionQuery The query of 'union'. (NotNull) - * @deprecated Sorry! Please use union(UnionQuery - * unionQuery). - */ - public void union(WorkingTypeCQ unionQuery) { - query().xsetUnionQuery(unionQuery); - } - - /** - * @param unionQuery The query of 'union'. (NotNull) - * @deprecated Sorry! Please use unionAll(UnionQuery - * unionQuery). - */ - public void unionAll(WorkingTypeCQ unionQuery) { - query().xsetUnionAllQuery(unionQuery); - } - public boolean hasUnionQueryOrUnionAllQuery() { return query().hasUnionQueryOrUnionAllQuery(); } @@ -179,7 +165,8 @@ public WorkingTypeCQ qy() { return query(); } - }, _forDeriveReferrer); + }, _forDerivedReferrer, _forScalarSelect, + _forScalarSubQuery); } return _specification; } @@ -189,8 +176,10 @@ protected SpQyCall _myQyCall; public Specification(ConditionBean baseCB, - SpQyCall qyCall, boolean forDeriveReferrer) { - super(baseCB, qyCall, forDeriveReferrer); + SpQyCall qyCall, boolean forDeriveReferrer, + boolean forScalarSelect, boolean forScalarSubQuery) { + super(baseCB, qyCall, forDeriveReferrer, forScalarSelect, + forScalarSubQuery); _myQyCall = qyCall; } Modified: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/cbean/cq/bs/AbstractBsDailyReportCQ.java =================================================================== --- timecard/trunk/src/main/java/jp/sf/pal/timecard/db/cbean/cq/bs/AbstractBsDailyReportCQ.java 2008-12-27 22:18:30 UTC (rev 1630) +++ timecard/trunk/src/main/java/jp/sf/pal/timecard/db/cbean/cq/bs/AbstractBsDailyReportCQ.java 2008-12-27 22:20:25 UTC (rev 1631) @@ -18,7 +18,6 @@ * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public abstract class AbstractBsDailyReportCQ extends AbstractConditionQuery { //========================================================================== @@ -48,7 +47,8 @@ // ===== /** - * Equal(=). And NullIgnored, OnceRegistered. {PK : ID : NotNull : BIGINT} + * Equal(=). And NullIgnored, OnlyOnceRegistered. {PK : ID : NotNull : + * BIGINT} * * @param id The value of id as equal. */ @@ -57,7 +57,7 @@ } /** - * NotEqual(!=). And NullIgnored, OnceRegistered. + * NotEqual(!=). And NullIgnored, OnlyOnceRegistered. * * @param id The value of id as notEqual. */ @@ -66,7 +66,7 @@ } /** - * GreaterThan(>). And NullIgnored, OnceRegistered. + * GreaterThan(>). And NullIgnored, OnlyOnceRegistered. * * @param id The value of id as greaterThan. */ @@ -75,7 +75,7 @@ } /** - * LessThan(<). And NullIgnored, OnceRegistered. + * LessThan(<). And NullIgnored, OnlyOnceRegistered. * * @param id The value of id as lessThan. */ @@ -84,7 +84,7 @@ } /** - * GreaterEqual(>=). And NullIgnored, OnceRegistered. + * GreaterEqual(>=). And NullIgnored, OnlyOnceRegistered. * * @param id The value of id as greaterEqual. */ @@ -93,7 +93,7 @@ } /** - * LessEqual(<=). And NullIgnored, OnceRegistered. + * LessEqual(<=). And NullIgnored, OnlyOnceRegistered. * * @param id The value of id as lessEqual. */ @@ -122,14 +122,14 @@ } /** - * IsNull(is null). And OnceRegistered. + * IsNull(is null). And OnlyOnceRegistered. */ public void setId_IsNull() { regId(CK_ISN, DUMMY_OBJECT); } /** - * IsNotNull(is not null). And OnceRegistered. + * IsNotNull(is not null). And OnlyOnceRegistered. */ public void setId_IsNotNull() { regId(CK_ISNN, DUMMY_OBJECT); @@ -146,7 +146,7 @@ abstract protected ConditionValue getCValueId(); /** - * Equal(=). And NullIgnored, OnceRegistered. {NotNull : INTEGER} + * Equal(=). And NullIgnored, OnlyOnceRegistered. {NotNull : INTEGER} * * @param date The value of date as equal. */ @@ -155,7 +155,7 @@ } /** - * NotEqual(!=). And NullIgnored, OnceRegistered. + * NotEqual(!=). And NullIgnored, OnlyOnceRegistered. * * @param date The value of date as notEqual. */ @@ -164,7 +164,7 @@ } /** - * GreaterThan(>). And NullIgnored, OnceRegistered. + * GreaterThan(>). And NullIgnored, OnlyOnceRegistered. * * @param date The value of date as greaterThan. */ @@ -173,7 +173,7 @@ } /** - * LessThan(<). And NullIgnored, OnceRegistered. + * LessThan(<). And NullIgnored, OnlyOnceRegistered. * * @param date The value of date as lessThan. */ @@ -182,7 +182,7 @@ } /** - * GreaterEqual(>=). And NullIgnored, OnceRegistered. + * GreaterEqual(>=). And NullIgnored, OnlyOnceRegistered. * * @param date The value of date as greaterEqual. */ @@ -191,7 +191,7 @@ } /** - * LessEqual(<=). And NullIgnored, OnceRegistered. + * LessEqual(<=). And NullIgnored, OnlyOnceRegistered. * * @param date The value of date as lessEqual. */ @@ -230,7 +230,7 @@ abstract protected ConditionValue getCValueDate(); /** - * Equal(=). And NullIgnored, OnceRegistered. {NotNull : INTEGER} + * Equal(=). And NullIgnored, OnlyOnceRegistered. {NotNull : INTEGER} * * @param dayOfWeek The value of dayOfWeek as equal. */ @@ -239,7 +239,7 @@ } /** - * NotEqual(!=). And NullIgnored, OnceRegistered. + * NotEqual(!=). And NullIgnored, OnlyOnceRegistered. * * @param dayOfWeek The value of dayOfWeek as notEqual. */ @@ -248,7 +248,7 @@ } /** - * GreaterThan(>). And NullIgnored, OnceRegistered. + * GreaterThan(>). And NullIgnored, OnlyOnceRegistered. * * @param dayOfWeek The value of dayOfWeek as greaterThan. */ @@ -257,7 +257,7 @@ } /** - * LessThan(<). And NullIgnored, OnceRegistered. + * LessThan(<). And NullIgnored, OnlyOnceRegistered. * * @param dayOfWeek The value of dayOfWeek as lessThan. */ @@ -266,7 +266,7 @@ } /** - * GreaterEqual(>=). And NullIgnored, OnceRegistered. + * GreaterEqual(>=). And NullIgnored, OnlyOnceRegistered. * * @param dayOfWeek The value of dayOfWeek as greaterEqual. */ @@ -275,7 +275,7 @@ } /** - * LessEqual(<=). And NullIgnored, OnceRegistered. + * LessEqual(<=). And NullIgnored, OnlyOnceRegistered. * * @param dayOfWeek The value of dayOfWeek as lessEqual. */ @@ -316,7 +316,7 @@ abstract protected ConditionValue getCValueDayOfWeek(); /** - * Equal(=). And NullIgnored, OnceRegistered. {NotNull : INTEGER} + * Equal(=). And NullIgnored, OnlyOnceRegistered. {NotNull : INTEGER} * * @param dateType The value of dateType as equal. */ @@ -325,7 +325,7 @@ } /** - * NotEqual(!=). And NullIgnored, OnceRegistered. + * NotEqual(!=). And NullIgnored, OnlyOnceRegistered. * * @param dateType The value of dateType as notEqual. */ @@ -334,7 +334,7 @@ } /** - * GreaterThan(>). And NullIgnored, OnceRegistered. + * GreaterThan(>). And NullIgnored, OnlyOnceRegistered. * * @param dateType The value of dateType as greaterThan. */ @@ -343,7 +343,7 @@ } /** - * LessThan(<). And NullIgnored, OnceRegistered. + * LessThan(<). And NullIgnored, OnlyOnceRegistered. * * @param dateType The value of dateType as lessThan. */ @@ -352,7 +352,7 @@ } /** - * GreaterEqual(>=). And NullIgnored, OnceRegistered. + * GreaterEqual(>=). And NullIgnored, OnlyOnceRegistered. * * @param dateType The value of dateType as greaterEqual. */ @@ -361,7 +361,7 @@ } /** - * LessEqual(<=). And NullIgnored, OnceRegistered. + * LessEqual(<=). And NullIgnored, OnlyOnceRegistered. * * @param dateType The value of dateType as lessEqual. */ @@ -402,7 +402,7 @@ abstract protected ConditionValue getCValueDateType(); /** - * Equal(=). And NullIgnored, OnceRegistered. {NotNull : INTEGER : + * Equal(=). And NullIgnored, OnlyOnceRegistered. {NotNull : INTEGER : * Default=[1]} * * @param workingType The value of workingType as equal. @@ -412,7 +412,7 @@ } /** - * NotEqual(!=). And NullIgnored, OnceRegistered. + * NotEqual(!=). And NullIgnored, OnlyOnceRegistered. * * @param workingType The value of workingType as notEqual. */ @@ -421,7 +421,7 @@ } /** - * GreaterThan(>). And NullIgnored, OnceRegistered. + * GreaterThan(>). And NullIgnored, OnlyOnceRegistered. * * @param workingType The value of workingType as greaterThan. */ @@ -430,7 +430,7 @@ } /** - * LessThan(<). And NullIgnored, OnceRegistered. + * LessThan(<). And NullIgnored, OnlyOnceRegistered. * * @param workingType The value of workingType as lessThan. */ @@ -439,7 +439,7 @@ } /** - * GreaterEqual(>=). And NullIgnored, OnceRegistered. + * GreaterEqual(>=). And NullIgnored, OnlyOnceRegistered. * * @param workingType The value of workingType as greaterEqual. */ @@ -448,7 +448,7 @@ } /** - * LessEqual(<=). And NullIgnored, OnceRegistered. + * LessEqual(<=). And NullIgnored, OnlyOnceRegistered. * * @param workingType The value of workingType as lessEqual. */ @@ -489,7 +489,7 @@ abstract protected ConditionValue getCValueWorkingType(); /** - * Equal(=). And NullIgnored, OnceRegistered. {NotNull : INTEGER : + * Equal(=). And NullIgnored, OnlyOnceRegistered. {NotNull : INTEGER : * Default=[1]} * * @param status The value of status as equal. @@ -499,7 +499,7 @@ } /** - * NotEqual(!=). And NullIgnored, OnceRegistered. + * NotEqual(!=). And NullIgnored, OnlyOnceRegistered. * * @param status The value of status as notEqual. */ @@ -508,7 +508,7 @@ } /** - * GreaterThan(>). And NullIgnored, OnceRegistered. + * GreaterThan(>). And NullIgnored, OnlyOnceRegistered. * * @param status The value of status as greaterThan. */ @@ -517,7 +517,7 @@ } /** - * LessThan(<). And NullIgnored, OnceRegistered. + * LessThan(<). And NullIgnored, OnlyOnceRegistered. * * @param status The value of status as lessThan. */ @@ -526,7 +526,7 @@ } /** - * GreaterEqual(>=). And NullIgnored, OnceRegistered. + * GreaterEqual(>=). And NullIgnored, OnlyOnceRegistered. * * @param status The value of status as greaterEqual. */ @@ -535,7 +535,7 @@ } /** - * LessEqual(<=). And NullIgnored, OnceRegistered. + * LessEqual(<=). And NullIgnored, OnlyOnceRegistered. * * @param status The value of status as lessEqual. */ @@ -576,7 +576,7 @@ abstract protected ConditionValue getCValueStatus(); /** - * Equal(=). And NullIgnored, OnceRegistered. {TIME} + * Equal(=). And NullIgnored, OnlyOnceRegistered. {TIME} * * @param startTime The value of startTime as equal. */ @@ -585,7 +585,7 @@ } /** - * NotEqual(!=). And NullIgnored, OnceRegistered. + * NotEqual(!=). And NullIgnored, OnlyOnceRegistered. * * @param startTime The value of startTime as notEqual. */ @@ -594,7 +594,7 @@ } /** - * GreaterThan(>). And NullIgnored, OnceRegistered. + * GreaterThan(>). And NullIgnored, OnlyOnceRegistered. * * @param startTime The value of startTime as greaterThan. */ @@ -603,7 +603,7 @@ } /** - * LessThan(>). And NullIgnored, OnceRegistered. + * LessThan(>). And NullIgnored, OnlyOnceRegistered. * * @param startTime The value of startTime as lessThan. */ @@ -612,7 +612,7 @@ } /** - * GreaterEqual(>). And NullIgnored, OnceRegistered. + * GreaterEqual(>). And NullIgnored, OnlyOnceRegistered. * * @param startTime The value of startTime as greaterEqual. */ @@ -621,7 +621,7 @@ } /** - * LessEqual(>). And NullIgnored, OnceRegistered. + * LessEqual(>). And NullIgnored, OnlyOnceRegistered. * * @param startTime The value of startTime as lessEqual. */ @@ -630,14 +630,14 @@ } /** - * IsNull(is null). And OnceRegistered. + * IsNull(is null). And OnlyOnceRegistered. */ public void setStartTime_IsNull() { regStartTime(CK_ISN, DUMMY_OBJECT); } /** - * IsNotNull(is not null). And OnceRegistered. + * IsNotNull(is not null). And OnlyOnceRegistered. */ public void setStartTime_IsNotNull() { regStartTime(CK_ISNN, DUMMY_OBJECT); @@ -656,7 +656,7 @@ abstract protected ConditionValue getCValueStartTime(); /** - * Equal(=). And NullIgnored, OnceRegistered. {TIME} + * Equal(=). And NullIgnored, OnlyOnceRegistered. {TIME} * * @param endTime The value of endTime as equal. */ @@ -665,7 +665,7 @@ } /** - * NotEqual(!=). And NullIgnored, OnceRegistered. + * NotEqual(!=). And NullIgnored, OnlyOnceRegistered. * * @param endTime The value of endTime as notEqual. */ @@ -674,7 +674,7 @@ } /** - * GreaterThan(>). And NullIgnored, OnceRegistered. + * GreaterThan(>). And NullIgnored, OnlyOnceRegistered. * * @param endTime The value of endTime as greaterThan. */ @@ -683,7 +683,7 @@ } /** - * LessThan(>). And NullIgnored, OnceRegistered. + * LessThan(>). And NullIgnored, OnlyOnceRegistered. * * @param endTime The value of endTime as lessThan. */ @@ -692,7 +692,7 @@ } /** - * GreaterEqual(>). And NullIgnored, OnceRegistered. + * GreaterEqual(>). And NullIgnored, OnlyOnceRegistered. * * @param endTime The value of endTime as greaterEqual. */ @@ -701,7 +701,7 @@ } /** - * LessEqual(>). And NullIgnored, OnceRegistered. + * LessEqual(>). And NullIgnored, OnlyOnceRegistered. * * @param endTime The value of endTime as lessEqual. */ @@ -710,14 +710,14 @@ } /** - * IsNull(is null). And OnceRegistered. + * IsNull(is null). And OnlyOnceRegistered. */ public void setEndTime_IsNull() { regEndTime(CK_ISN, DUMMY_OBJECT); } /** - * IsNotNull(is not null). And OnceRegistered. + * IsNotNull(is not null). And OnlyOnceRegistered. */ public void setEndTime_IsNotNull() { regEndTime(CK_ISNN, DUMMY_OBJECT); @@ -736,7 +736,7 @@ abstract protected ConditionValue getCValueEndTime(); /** - * Equal(=). And NullIgnored, OnceRegistered. {TIME} + * Equal(=). And NullIgnored, OnlyOnceRegistered. {TIME} * * @param breakTime The value of breakTime as equal. */ @@ -745,7 +745,7 @@ } /** - * NotEqual(!=). And NullIgnored, OnceRegistered. + * NotEqual(!=). And NullIgnored, OnlyOnceRegistered. * * @param breakTime The value of breakTime as notEqual. */ @@ -754,7 +754,7 @@ } /** - * GreaterThan(>). And NullIgnored, OnceRegistered. + * GreaterThan(>). And NullIgnored, OnlyOnceRegistered. * * @param breakTime The value of breakTime as greaterThan. */ @@ -763,7 +763,7 @@ } /** - * LessThan(>). And NullIgnored, OnceRegistered. + * LessThan(>). And NullIgnored, OnlyOnceRegistered. * * @param breakTime The value of breakTime as lessThan. */ @@ -772,7 +772,7 @@ } /** - * GreaterEqual(>). And NullIgnored, OnceRegistered. + * GreaterEqual(>). And NullIgnored, OnlyOnceRegistered. * * @param breakTime The value of breakTime as greaterEqual. */ @@ -781,7 +781,7 @@ } /** - * LessEqual(>). And NullIgnored, OnceRegistered. + * LessEqual(>). And NullIgnored, OnlyOnceRegistered. * * @param breakTime The value of breakTime as lessEqual. */ @@ -790,14 +790,14 @@ } /** - * IsNull(is null). And OnceRegistered. + * IsNull(is null). And OnlyOnceRegistered. */ public void setBreakTime_IsNull() { regBreakTime(CK_ISN, DUMMY_OBJECT); } /** - * IsNotNull(is not null). And OnceRegistered. + * IsNotNull(is not null). And OnlyOnceRegistered. */ public void setBreakTime_IsNotNull() { regBreakTime(CK_ISNN, DUMMY_OBJECT); @@ -816,7 +816,7 @@ abstract protected ConditionValue getCValueBreakTime(); /** - * Equal(=). And NullIgnored, OnceRegistered. {TIME} + * Equal(=). And NullIgnored, OnlyOnceRegistered. {TIME} * * @param otjTime The value of otjTime as equal. */ @@ -825,7 +825,7 @@ } /** - * NotEqual(!=). And NullIgnored, OnceRegistered. + * NotEqual(!=). And NullIgnored, OnlyOnceRegistered. * * @param otjTime The value of otjTime as notEqual. */ @@ -834,7 +834,7 @@ } /** - * GreaterThan(>). And NullIgnored, OnceRegistered. + * GreaterThan(>). And NullIgnored, OnlyOnceRegistered. * * @param otjTime The value of otjTime as greaterThan. */ @@ -843,7 +843,7 @@ } /** - * LessThan(>). And NullIgnored, OnceRegistered. + * LessThan(>). And NullIgnored, OnlyOnceRegistered. * * @param otjTime The value of otjTime as lessThan. */ @@ -852,7 +852,7 @@ } /** - * GreaterEqual(>). And NullIgnored, OnceRegistered. + * GreaterEqual(>). And NullIgnored, OnlyOnceRegistered. * * @param otjTime The value of otjTime as greaterEqual. */ @@ -861,7 +861,7 @@ } /** - * LessEqual(>). And NullIgnored, OnceRegistered. + * LessEqual(>). And NullIgnored, OnlyOnceRegistered. * * @param otjTime The value of otjTime as lessEqual. */ @@ -870,14 +870,14 @@ } /** - * IsNull(is null). And OnceRegistered. + * IsNull(is null). And OnlyOnceRegistered. */ public void setOtjTime_IsNull() { regOtjTime(CK_ISN, DUMMY_OBJECT); } /** - * IsNotNull(is not null). And OnceRegistered. + * IsNotNull(is not null). And OnlyOnceRegistered. */ public void setOtjTime_IsNotNull() { regOtjTime(CK_ISNN, DUMMY_OBJECT); @@ -896,7 +896,7 @@ abstract protected ConditionValue getCValueOtjTime(); /** - * Equal(=). And NullIgnored, OnceRegistered. {BIGINT} + * Equal(=). And NullIgnored, OnlyOnceRegistered. {BIGINT} * * @param workingTime The value of workingTime as equal. */ @@ -905,7 +905,7 @@ } /** - * NotEqual(!=). And NullIgnored, OnceRegistered. + * NotEqual(!=). And NullIgnored, OnlyOnceRegistered. * * @param workingTime The value of workingTime as notEqual. */ @@ -914,7 +914,7 @@ } /** - * GreaterThan(>). And NullIgnored, OnceRegistered. + * GreaterThan(>). And NullIgnored, OnlyOnceRegistered. * * @param workingTime The value of workingTime as greaterThan. */ @@ -923,7 +923,7 @@ } /** - * LessThan(<). And NullIgnored, OnceRegistered. + * LessThan(<). And NullIgnored, OnlyOnceRegistered. * * @param workingTime The value of workingTime as lessThan. */ @@ -932,7 +932,7 @@ } /** - * GreaterEqual(>=). And NullIgnored, OnceRegistered. + * GreaterEqual(>=). And NullIgnored, OnlyOnceRegistered. * * @param workingTime The value of workingTime as greaterEqual. */ @@ -941,7 +941,7 @@ } /** - * LessEqual(<=). And NullIgnored, OnceRegistered. + * LessEqual(<=). And NullIgnored, OnlyOnceRegistered. * * @param workingTime The value of workingTime as lessEqual. */ @@ -970,14 +970,14 @@ } /** - * IsNull(is null). And OnceRegistered. + * IsNull(is null). And OnlyOnceRegistered. */ public void setWorkingTime_IsNull() { regWorkingTime(CK_ISN, DUMMY_OBJECT); } /** - * IsNotNull(is not null). And OnceRegistered. + * IsNotNull(is not null). And OnlyOnceRegistered. */ public void setWorkingTime_IsNotNull() { regWorkingTime(CK_ISNN, DUMMY_OBJECT); @@ -996,7 +996,7 @@ abstract protected ConditionValue getCValueWorkingTime(); /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {VARCHAR(200)} + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {VARCHAR(200)} * * @param memo The value of memo as equal. */ @@ -1005,7 +1005,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param memo The value of memo as notEqual. */ @@ -1014,7 +1014,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param memo The value of memo as greaterThan. */ @@ -1023,7 +1023,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param memo The value of memo as lessThan. */ @@ -1032,7 +1032,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param memo The value of memo as greaterEqual. */ @@ -1041,7 +1041,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param memo The value of memo as lessEqual. */ @@ -1050,7 +1050,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param memo The value of memo as prefixSearch. */ @@ -1059,20 +1059,6 @@ } /** - * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, - * SeveralRegistered. - * - * @param memo The value of memo as likeSearch. - * @param likeSearchOption The option of like-search. (NotNull) - */ - public void setMemo_LikeSearch( - String memo, - jp.sf.pal.timecard.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { - registerLikeSearchQuery(CK_LS, fRES(memo), getCValueMemo(), "MEMO", - "Memo", "memo", likeSearchOption); - } - - /** * InScope(in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * @@ -1083,38 +1069,52 @@ } /** - * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * - * @param memo The collection of memo as inScope. - * @param inScopeOption The option of in-scope. (NotNull) + * @param memoList The collection of memo as notInScope. */ - public void setMemo_InScope( + public void setMemo_NotInScope(Collection memoList) { + regMemo(CK_NINS, cTL(memoList)); + } + + /** + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param memo The value of memo as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) + */ + public void setMemo_LikeSearch( String memo, - jp.sf.pal.timecard.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(memo), getCValueMemo(), "MEMO", - "Memo", "memo", inScopeOption); + jp.sf.pal.timecard.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(memo), getCValueMemo(), "MEMO", "Memo", "memo", + likeSearchOption); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param memoList The collection of memo as notInScope. + * @param memo The value of memo as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setMemo_NotInScope(Collection memoList) { - regMemo(CK_NINS, cTL(memoList)); + public void setMemo_NotLikeSearch( + String memo, + jp.sf.pal.timecard.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(memo), getCValueMemo(), "MEMO", "Memo", "memo", + likeSearchOption); } /** - * IsNull(is null). And OnceRegistered. + * IsNull(is null). And OnlyOnceRegistered. */ public void setMemo_IsNull() { regMemo(CK_ISN, DUMMY_OBJECT); } /** - * IsNotNull(is not null). And OnceRegistered. + * IsNotNull(is not null). And OnlyOnceRegistered. */ public void setMemo_IsNotNull() { regMemo(CK_ISNN, DUMMY_OBJECT); @@ -1131,7 +1131,7 @@ abstract protected ConditionValue getCValueMemo(); /** - * Equal(=). And NullIgnored, OnceRegistered. {NotNull : BIGINT : + * Equal(=). And NullIgnored, OnlyOnceRegistered. {NotNull : BIGINT : * Default=[0] : FK to MONTHLY_REPORT} * * @param monthlyReportId The value of monthlyReportId as equal. @@ -1141,7 +1141,7 @@ } /** - * NotEqual(!=). And NullIgnored, OnceRegistered. + * NotEqual(!=). And NullIgnored, OnlyOnceRegistered. * * @param monthlyReportId The value of monthlyReportId as notEqual. */ @@ -1150,7 +1150,7 @@ } /** - * GreaterThan(>). And NullIgnored, OnceRegistered. + * GreaterThan(>). And NullIgnored, OnlyOnceRegistered. * * @param monthlyReportId The value of monthlyReportId as greaterThan. */ @@ -1159,7 +1159,7 @@ } /** - * LessThan(<). And NullIgnored, OnceRegistered. + * LessThan(<). And NullIgnored, OnlyOnceRegistered. * * @param monthlyReportId The value of monthlyReportId as lessThan. */ @@ -1168,7 +1168,7 @@ } /** - * GreaterEqual(>=). And NullIgnored, OnceRegistered. + * GreaterEqual(>=). And NullIgnored, OnlyOnceRegistered. * * @param monthlyReportId The value of monthlyReportId as greaterEqual. */ @@ -1177,7 +1177,7 @@ } /** - * LessEqual(<=). And NullIgnored, OnceRegistered. + * LessEqual(<=). And NullIgnored, OnlyOnceRegistered. * * @param monthlyReportId The value of monthlyReportId as lessEqual. */ @@ -1207,34 +1207,18 @@ regMonthlyReportId(CK_NINS, cTL(monthlyReportIdList)); } - /** - * @param monthlyReportCBquery Query. - * @deprecated Please use inScopeMonthlyReport(subQuery) method. - */ - public void setMonthlyReportId_InScopeSubQuery_MonthlyReport( - MonthlyReportCQ monthlyReportCBquery) { - String subQueryPropertyName = keepMonthlyReportId_InScopeSubQuery_MonthlyReport(monthlyReportCBquery);// for - // saving - // query - // - - // value - // . - registerInScopeSubQuery(monthlyReportCBquery, "MONTHLY_REPORT_ID", - "ID", subQueryPropertyName); - } - public void inScopeMonthlyReport(SubQuery subQuery) { assertObjectNotNull("subQuery", subQuery); MonthlyReportCB cb = new MonthlyReportCB(); cb.xsetupForInScopeSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepMonthlyReportId_InScopeSubQuery_MonthlyReport(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerInScopeSubQuery(cb.query(), "MONTHLY_REPORT_ID", "ID", subQueryPropertyName); } - abstract public String keepMonthlyReportId_InScopeSubQuery_MonthlyReport( + public abstract String keepMonthlyReportId_InScopeSubQuery_MonthlyReport( MonthlyReportCQ subQuery); protected void regMonthlyReportId(ConditionKey key, Object value) { @@ -1250,7 +1234,7 @@ abstract protected ConditionValue getCValueMonthlyReportId(); /** - * Equal(=). And NullIgnored, OnceRegistered. {NotNull : TIMESTAMP} + * Equal(=). And NullIgnored, OnlyOnceRegistered. {NotNull : TIMESTAMP} * * @param createdTime The value of createdTime as equal. */ @@ -1259,7 +1243,7 @@ } /** - * NotEqual(!=). And NullIgnored, OnceRegistered. + * NotEqual(!=). And NullIgnored, OnlyOnceRegistered. * * @param createdTime The value of createdTime as notEqual. */ @@ -1268,7 +1252,7 @@ } /** - * GreaterThan(>). And NullIgnored, OnceRegistered. + * GreaterThan(>). And NullIgnored, OnlyOnceRegistered. * * @param createdTime The value of createdTime as greaterThan. */ @@ -1277,7 +1261,7 @@ } /** - * LessThan(>). And NullIgnored, OnceRegistered. + * LessThan(>). And NullIgnored, OnlyOnceRegistered. * * @param createdTime The value of createdTime as lessThan. */ @@ -1286,7 +1270,7 @@ } /** - * GreaterEqual(>). And NullIgnored, OnceRegistered. + * GreaterEqual(>). And NullIgnored, OnlyOnceRegistered. * * @param createdTime The value of createdTime as greaterEqual. */ @@ -1295,7 +1279,7 @@ } /** - * LessEqual(>). And NullIgnored, OnceRegistered. + * LessEqual(>). And NullIgnored, OnlyOnceRegistered. * * @param createdTime The value of createdTime as lessEqual. */ @@ -1305,7 +1289,7 @@ /** * FromTo($fromDate <= COLUMN_NAME <= $toDate). And NullIgnored, - * OnceRegistered. {NotNull : TIMESTAMP} + * OnlyOnceRegistered. {NotNull : TIMESTAMP} * * @param fromDate The from-date of createdTime. (Nullable) * @param toDate The to-date of createdTime. (Nullable) @@ -1323,7 +1307,7 @@ /** * FromTo($fromDate <= COLUMN_NAME < $toDate + 1). And NullIgnored, - * OnceRegistered. {NotNull : TIMESTAMP} + * OnlyOnceRegistered. {NotNull : TIMESTAMP} * * @param fromDate The from-date of createdTime. (Nullable) * @param toDate The to-date of createdTime. (Nullable) @@ -1349,7 +1333,7 @@ abstract protected ConditionValue getCValueCreatedTime(); /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {NotNull : + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {NotNull : * VARCHAR(255)} * * @param createdBy The value of createdBy as equal. @@ -1359,7 +1343,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param createdBy The value of createdBy as notEqual. */ @@ -1368,7 +1352,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param createdBy The value of createdBy as greaterThan. */ @@ -1377,7 +1361,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param createdBy The value of createdBy as lessThan. */ @@ -1386,7 +1370,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param createdBy The value of createdBy as greaterEqual. */ @@ -1395,7 +1379,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param createdBy The value of createdBy as lessEqual. */ @@ -1404,7 +1388,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param createdBy The value of createdBy as prefixSearch. */ @@ -1413,20 +1397,6 @@ } /** - * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, - * SeveralRegistered. - * - * @param createdBy The value of createdBy as likeSearch. - * @param likeSearchOption The option of like-search. (NotNull) - */ - public void setCreatedBy_LikeSearch( - String createdBy, - jp.sf.pal.timecard.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { - registerLikeSearchQuery(CK_LS, fRES(createdBy), getCValueCreatedBy(), - "CREATED_BY", "CreatedBy", "createdBy", likeSearchOption); - } - - /** * InScope(in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * @@ -1437,27 +1407,41 @@ } /** - * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * - * @param createdBy The collection of createdBy as inScope. - * @param inScopeOption The option of in-scope. (NotNull) + * @param createdByList The collection of createdBy as notInScope. */ - public void setCreatedBy_InScope( + public void setCreatedBy_NotInScope(Collection createdByList) { + regCreatedBy(CK_NINS, cTL(createdByList)); + } + + /** + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param createdBy The value of createdBy as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) + */ + public void setCreatedBy_LikeSearch( String createdBy, - jp.sf.pal.timecard.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(createdBy), getCValueCreatedBy(), - "CREATED_BY", "CreatedBy", "createdBy", inScopeOption); + jp.sf.pal.timecard.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(createdBy), getCValueCreatedBy(), "CREATED_BY", + "CreatedBy", "createdBy", likeSearchOption); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param createdByList The collection of createdBy as notInScope. + * @param createdBy The value of createdBy as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setCreatedBy_NotInScope(Collection createdByList) { - regCreatedBy(CK_NINS, cTL(createdByList)); + public void setCreatedBy_NotLikeSearch( + String createdBy, + jp.sf.pal.timecard.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(createdBy), getCValueCreatedBy(), "CREATED_BY", + "CreatedBy", "createdBy", likeSearchOption); } protected void regCreatedBy(ConditionKey key, Object value) { @@ -1473,7 +1457,7 @@ abstract protected ConditionValue getCValueCreatedBy(); /** - * Equal(=). And NullIgnored, OnceRegistered. {NotNull : TIMESTAMP} + * Equal(=). And NullIgnored, OnlyOnceRegistered. {NotNull : TIMESTAMP} * * @param updatedTime The value of updatedTime as equal. */ @@ -1482,7 +1466,7 @@ } /** - * NotEqual(!=). And NullIgnored, OnceRegistered. + * NotEqual(!=). And NullIgnored, OnlyOnceRegistered. * * @param updatedTime The value of updatedTime as notEqual. */ @@ -1491,7 +1475,7 @@ } /** - * GreaterThan(>). And NullIgnored, OnceRegistered. + * GreaterThan(>). And NullIgnored, OnlyOnceRegistered. * * @param updatedTime The value of updatedTime as greaterThan. */ @@ -1500,7 +1484,7 @@ } /** - * LessThan(>). And NullIgnored, OnceRegistered. + * LessThan(>). And NullIgnored, OnlyOnceRegistered. * * @param updatedTime The value of updatedTime as lessThan. */ @@ -1509,7 +1493,7 @@ } /** - * GreaterEqual(>). And NullIgnored, OnceRegistered. + * GreaterEqual(>). And NullIgnored, OnlyOnceRegistered. * * @param updatedTime The value of updatedTime as greaterEqual. */ @@ -1518,7 +1502,7 @@ } /** - * LessEqual(>). And NullIgnored, OnceRegistered. + * LessEqual(>). And NullIgnored, OnlyOnceRegistered. * * @param updatedTime The value of updatedTime as lessEqual. */ @@ -1528,7 +1512,7 @@ /** * FromTo($fromDate <= COLUMN_NAME <= $toDate). And NullIgnored, - * OnceRegistered. {NotNull : TIMESTAMP} + * OnlyOnceRegistered. {NotNull : TIMESTAMP} * * @param fromDate The from-date of updatedTime. (Nullable) * @param toDate The to-date of updatedTime. (Nullable) @@ -1546,7 +1530,7 @@ /** * FromTo($fromDate <= COLUMN_NAME < $toDate + 1). And NullIgnored, - * OnceRegistered. {NotNull : TIMESTAMP} + * OnlyOnceRegistered. {NotNull : TIMESTAMP} * * @param fromDate The from-date of updatedTime. (Nullable) * @param toDate The to-date of updatedTime. (Nullable) @@ -1572,7 +1556,7 @@ abstract protected ConditionValue getCValueUpdatedTime(); /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {NotNull : + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {NotNull : * VARCHAR(255)} * * @param updatedBy The value of updatedBy as equal. @@ -1582,7 +1566,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param updatedBy The value of updatedBy as notEqual. */ @@ -1591,7 +1575,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param updatedBy The value of updatedBy as greaterThan. */ @@ -1600,7 +1584,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param updatedBy The value of updatedBy as lessThan. */ @@ -1609,7 +1593,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param updatedBy The value of updatedBy as greaterEqual. */ @@ -1618,7 +1602,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param updatedBy The value of updatedBy as lessEqual. */ @@ -1627,7 +1611,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param updatedBy The value of updatedBy as prefixSearch. */ @@ -1636,20 +1620,6 @@ } /** - * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, - * SeveralRegistered. - * - * @param updatedBy The value of updatedBy as likeSearch. - * @param likeSearchOption The option of like-search. (NotNull) - */ - public void setUpdatedBy_LikeSearch( - String updatedBy, - jp.sf.pal.timecard.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { - registerLikeSearchQuery(CK_LS, fRES(updatedBy), getCValueUpdatedBy(), - "UPDATED_BY", "UpdatedBy", "updatedBy", likeSearchOption); - } - - /** * InScope(in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * @@ -1660,27 +1630,41 @@ } /** - * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * - * @param updatedBy The collection of updatedBy as inScope. - * @param inScopeOption The option of in-scope. (NotNull) + * @param updatedByList The collection of updatedBy as notInScope. */ - public void setUpdatedBy_InScope( + public void setUpdatedBy_NotInScope(Collection updatedByList) { + regUpdatedBy(CK_NINS, cTL(updatedByList)); + } + + /** + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param updatedBy The value of updatedBy as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) + */ + public void setUpdatedBy_LikeSearch( String updatedBy, - jp.sf.pal.timecard.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(updatedBy), getCValueUpdatedBy(), - "UPDATED_BY", "UpdatedBy", "updatedBy", inScopeOption); + jp.sf.pal.timecard.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(updatedBy), getCValueUpdatedBy(), "UPDATED_BY", + "UpdatedBy", "updatedBy", likeSearchOption); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param updatedByList The collection of updatedBy as notInScope. + * @param updatedBy The value of updatedBy as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setUpdatedBy_NotInScope(Collection updatedByList) { - regUpdatedBy(CK_NINS, cTL(updatedByList)); + public void setUpdatedBy_NotLikeSearch( + String updatedBy, + jp.sf.pal.timecard.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(updatedBy), getCValueUpdatedBy(), "UPDATED_BY", + "UpdatedBy", "updatedBy", likeSearchOption); } protected void regUpdatedBy(ConditionKey key, Object value) { @@ -1696,7 +1680,7 @@ abstract protected ConditionValue getCValueUpdatedBy(); /** - * Equal(=). And NullIgnored, OnceRegistered. {NotNull : INTEGER : + * Equal(=). And NullIgnored, OnlyOnceRegistered. {NotNull : INTEGER : * Default=[0]} * * @param versionno The value of versionno as equal. @@ -1706,7 +1690,7 @@ } /** - * NotEqual(!=). And NullIgnored, OnceRegistered. + * NotEqual(!=). And NullIgnored, OnlyOnceRegistered. * * @param versionno The value of versionno as notEqual. */ @@ -1715,7 +1699,7 @@ } /** - * GreaterThan(>). And NullIgnored, OnceRegistered. + * GreaterThan(>). And NullIgnored, OnlyOnceRegistered. * * @param versionno The value of versionno as greaterThan. */ @@ -1724,7 +1708,7 @@ } /** - * LessThan(<). And NullIgnored, OnceRegistered. + * LessThan(<). And NullIgnored, OnlyOnceRegistered. * * @param versionno The value of versionno as lessThan. */ @@ -1733,7 +1717,7 @@ } /** - * GreaterEqual(>=). And NullIgnored, OnceRegistered. + * GreaterEqual(>=). And NullIgnored, OnlyOnceRegistered. * * @param versionno The value of versionno as greaterEqual. */ @@ -1742,7 +1726,7 @@ } /** - * LessEqual(<=). And NullIgnored, OnceRegistered. + * LessEqual(<=). And NullIgnored, OnlyOnceRegistered. * * @param versionno The value of versionno as lessEqual. */ @@ -1782,6 +1766,50 @@ abstract protected ConditionValue getCValueVersionno(); + public SSQFunction scalar_Equal() { + return xcreateSSQFunction("="); + } + + public SSQFunction scalar_GreaterEqual() { + return xcreateSSQFunction(">="); + } + + public SSQFunction scalar_GreaterThan() { + return xcreateSSQFunction(">"); + } + + public SSQFunction scalar_LessEqual() { + return xcreateSSQFunction("<="); + } + + public SSQFunction scalar_LessThan() { + return xcreateSSQFunction("<"); + } + + protected SSQFunction xcreateSSQFunction(final String operand) { + return new SSQFunction(new SSQSetupper() { + public void setup(String function, SubQuery subQuery) { + xscalarSubQuery(function, subQuery, operand); + } + }); + } + + protected void xscalarSubQuery(String function, + SubQuery subQuery, String operand) { + assertObjectNotNull("subQuery", subQuery); + DailyReportCB cb = new DailyReportCB(); + cb.xsetupForScalarSubQuery(); + subQuery.query(cb); + String subQueryPropertyName = keepScalarSubQuery(cb.query()); // for + // saving + // query + // -value. + registerScalarSubQuery(function, cb.query(), subQueryPropertyName, + operand); + } + + public abstract String keepScalarSubQuery(DailyReportCQ subQuery); + // Very Internal (for Suppressing Warn about 'Not Use Import') protected String getConditionBeanClassNameInternally() { return DailyReportCB.class.getName(); Modified: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/cbean/cq/bs/AbstractBsEmployeeCQ.java =================================================================== --- timecard/trunk/src/main/java/jp/sf/pal/timecard/db/cbean/cq/bs/AbstractBsEmployeeCQ.java 2008-12-27 22:18:30 UTC (rev 1630) +++ timecard/trunk/src/main/java/jp/sf/pal/timecard/db/cbean/cq/bs/AbstractBsEmployeeCQ.java 2008-12-27 22:20:25 UTC (rev 1631) @@ -13,14 +13,12 @@ import jp.sf.pal.timecard.db.cbean.UserInfoCB; import jp.sf.pal.timecard.db.cbean.cq.EmployeeCQ; import jp.sf.pal.timecard.db.cbean.cq.MonthlyReportCQ; -import jp.sf.pal.timecard.db.cbean.cq.UserInfoCQ; /** * The abstract condition-query of EMPLOYEE. * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public abstract class AbstractBsEmployeeCQ extends AbstractConditionQuery { //========================================================================== @@ -50,7 +48,8 @@ // ===== /** - * Equal(=). And NullIgnored, OnceRegistered. {PK : ID : NotNull : INTEGER} + * Equal(=). And NullIgnored, OnlyOnceRegistered. {PK : ID : NotNull : + * INTEGER} * * @param id The value of id as equal. */ @@ -59,7 +58,7 @@ } /** - * NotEqual(!=). And NullIgnored, OnceRegistered. + * NotEqual(!=). And NullIgnored, OnlyOnceRegistered. * * @param id The value of id as notEqual. */ @@ -68,7 +67,7 @@ } /** - * GreaterThan(>). And NullIgnored, OnceRegistered. + * GreaterThan(>). And NullIgnored, OnlyOnceRegistered. * * @param id The value of id as greaterThan. */ @@ -77,7 +76,7 @@ } /** - * LessThan(<). And NullIgnored, OnceRegistered. + * LessThan(<). And NullIgnored, OnlyOnceRegistered. * * @param id The value of id as lessThan. */ @@ -86,7 +85,7 @@ } /** - * GreaterEqual(>=). And NullIgnored, OnceRegistered. + * GreaterEqual(>=). And NullIgnored, OnlyOnceRegistered. * * @param id The value of id as greaterEqual. */ @@ -95,7 +94,7 @@ } /** - * LessEqual(<=). And NullIgnored, OnceRegistered. + * LessEqual(<=). And NullIgnored, OnlyOnceRegistered. * * @param id The value of id as lessEqual. */ @@ -123,34 +122,18 @@ regId(CK_NINS, cTL(idList)); } - /** - * @param monthlyReportCBquery Query. - * @deprecated Please use inScopeMonthlyReportList(subQuery) method. - */ - public void setId_InScopeSubQuery_MonthlyReportList( - MonthlyReportCQ monthlyReportCBquery) { - String subQueryPropertyName = keepId_InScopeSubQuery_MonthlyReportList(monthlyReportCBquery);// for - // saving - // query - // - - // value - // . - registerInScopeSubQuery(monthlyReportCBquery, "ID", "EMPLOYEE_ID", - subQueryPropertyName); - } - public void inScopeMonthlyReportList(SubQuery subQuery) { assertObjectNotNull("subQuery", subQuery); MonthlyReportCB cb = new MonthlyReportCB(); cb.xsetupForInScopeSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepId_InScopeSubQuery_MonthlyReportList(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerInScopeSubQuery(cb.query(), "ID", "EMPLOYEE_ID", subQueryPropertyName); } - abstract public String keepId_InScopeSubQuery_MonthlyReportList( + public abstract String keepId_InScopeSubQuery_MonthlyReportList( MonthlyReportCQ subQuery); public void notInScopeMonthlyReportList(SubQuery subQuery) { @@ -159,31 +142,15 @@ cb.xsetupForInScopeSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepId_NotInScopeSubQuery_MonthlyReportList(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerNotInScopeSubQuery(cb.query(), "ID", "EMPLOYEE_ID", subQueryPropertyName); } - abstract public String keepId_NotInScopeSubQuery_MonthlyReportList( + public abstract String keepId_NotInScopeSubQuery_MonthlyReportList( MonthlyReportCQ subQuery); /** - * @param monthlyReportCBquery Query. - * @deprecated Please use existsMonthlyReportList(subQuery) method. - */ - public void setId_ExistsSubQuery_MonthlyReportList( - MonthlyReportCQ monthlyReportCBquery) { - String subQueryPropertyName = keepId_ExistsSubQuery_MonthlyReportList(monthlyReportCBquery);// for - // saving - // query - // - - // value - // . - registerExistsSubQuery(monthlyReportCBquery, "ID", "EMPLOYEE_ID", - subQueryPropertyName); - } - - /** * Set up 'exists' sub-query. {exists (select EMPLOYEE_ID from * MONTHLY_REPORT where ...)} * @@ -196,12 +163,12 @@ cb.xsetupForExistsSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepId_ExistsSubQuery_MonthlyReportList(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerExistsSubQuery(cb.query(), "ID", "EMPLOYEE_ID", subQueryPropertyName); } - abstract public String keepId_ExistsSubQuery_MonthlyReportList( + public abstract String keepId_ExistsSubQuery_MonthlyReportList( MonthlyReportCQ subQuery); /** @@ -217,38 +184,38 @@ cb.xsetupForExistsSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepId_NotExistsSubQuery_MonthlyReportList(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerNotExistsSubQuery(cb.query(), "ID", "EMPLOYEE_ID", subQueryPropertyName); } - abstract public String keepId_NotExistsSubQuery_MonthlyReportList( + public abstract String keepId_NotExistsSubQuery_MonthlyReportList( MonthlyReportCQ subQuery); public void xderiveMonthlyReportList(String function, SubQuery subQuery, String aliasName) { assertObjectNotNull("subQuery", subQuery); MonthlyReportCB cb = new MonthlyReportCB(); - cb.xsetupForDeriveReferrer(); + cb.xsetupForDerivedReferrer(); subQuery.query(cb); - String subQueryPropertyName = keepId_DeriveSubQuery_MonthlyReportList(cb - .query());// for saving query-value. - registerDeriveSubQuery(function, cb.query(), "ID", "EMPLOYEE_ID", - subQueryPropertyName, aliasName); + String subQueryPropertyName = keepId_DerivedReferrer_MonthlyReportList(cb + .query()); // for saving query-value. + registerDerivedReferrerSubQuery(function, cb.query(), "ID", + "EMPLOYEE_ID", subQueryPropertyName, aliasName); } - abstract public String keepId_DeriveSubQuery_MonthlyReportList( + public abstract String keepId_DerivedReferrer_MonthlyReportList( MonthlyReportCQ subQuery); /** - * IsNull(is null). And OnceRegistered. + * IsNull(is null). And OnlyOnceRegistered. */ public void setId_IsNull() { regId(CK_ISN, DUMMY_OBJECT); } /** - * IsNotNull(is not null). And OnceRegistered. + * IsNotNull(is not null). And OnlyOnceRegistered. */ public void setId_IsNotNull() { regId(CK_ISNN, DUMMY_OBJECT); @@ -265,8 +232,8 @@ abstract protected ConditionValue getCValueId(); /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {NotNull : VARCHAR(255) - * : FK to USER_INFO} + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {NotNull : + * VARCHAR(255) : FK to USER_INFO} * * @param username The value of username as equal. */ @@ -275,7 +242,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param username The value of username as notEqual. */ @@ -284,7 +251,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param username The value of username as greaterThan. */ @@ -293,7 +260,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param username The value of username as lessThan. */ @@ -302,7 +269,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param username The value of username as greaterEqual. */ @@ -311,7 +278,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param username The value of username as lessEqual. */ @@ -320,7 +287,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param username The value of username as prefixSearch. */ @@ -329,20 +296,6 @@ } /** - * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, - * SeveralRegistered. - * - * @param username The value of username as likeSearch. - * @param likeSearchOption The option of like-search. (NotNull) - */ - public void setUsername_LikeSearch( - String username, - jp.sf.pal.timecard.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { - registerLikeSearchQuery(CK_LS, fRES(username), getCValueUsername(), - "USERNAME", "Username", "username", likeSearchOption); - } - - /** * InScope(in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * @@ -353,43 +306,41 @@ } /** - * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * - * @param username The collection of username as inScope. - * @param inScopeOption The option of in-scope. (NotNull) + * @param usernameList The collection of username as notInScope. */ - public void setUsername_InScope( - String username, - jp.sf.pal.timecard.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(username), getCValueUsername(), - "USERNAME", "Username", "username", inScopeOption); + public void setUsername_NotInScope(Collection usernameList) { + regUsername(CK_NINS, cTL(usernameList)); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param usernameList The collection of username as notInScope. + * @param username The value of username as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) */ - public void setUsername_NotInScope(Collection usernameList) { - regUsername(CK_NINS, cTL(usernameList)); + public void setUsername_LikeSearch( + String username, + jp.sf.pal.timecard.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(username), getCValueUsername(), "USERNAME", + "Username", "username", likeSearchOption); } /** - * @param userInfoCBquery Query. - * @deprecated Please use inScopeUserInfoByUsername(subQuery) method. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param username The value of username as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setUsername_InScopeSubQuery_UserInfoByUsername( - UserInfoCQ userInfoCBquery) { - String subQueryPropertyName = keepUsername_InScopeSubQuery_UserInfoByUsername(userInfoCBquery);// for - // saving - // query - // - - // value - // . - registerInScopeSubQuery(userInfoCBquery, "USERNAME", "USER_ID", - subQueryPropertyName); + public void setUsername_NotLikeSearch( + String username, + jp.sf.pal.timecard.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(username), getCValueUsername(), "USERNAME", + "Username", "username", likeSearchOption); } public void inScopeUserInfoByUsername(SubQuery subQuery) { @@ -398,12 +349,12 @@ cb.xsetupForInScopeSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepUsername_InScopeSubQuery_UserInfoByUsername(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerInScopeSubQuery(cb.query(), "USERNAME", "USER_ID", subQueryPropertyName); } - abstract public String keepUsername_InScopeSubQuery_UserInfoByUsername( + public abstract String keepUsername_InScopeSubQuery_UserInfoByUsername( jp.sf.pal.timecard.db.cbean.cq.UserInfoCQ subQuery); protected void regUsername(ConditionKey key, Object value) { @@ -419,8 +370,8 @@ abstract protected ConditionValue getCValueUsername(); /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {NotNull : VARCHAR(255) - * : FK to USER_INFO} + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {NotNull : + * VARCHAR(255) : FK to USER_INFO} * * @param manager The value of manager as equal. */ @@ -429,7 +380,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param manager The value of manager as notEqual. */ @@ -438,7 +389,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param manager The value of manager as greaterThan. */ @@ -447,7 +398,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param manager The value of manager as lessThan. */ @@ -456,7 +407,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param manager The value of manager as greaterEqual. */ @@ -465,7 +416,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param manager The value of manager as lessEqual. */ @@ -474,7 +425,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param manager The value of manager as prefixSearch. */ @@ -483,20 +434,6 @@ } /** - * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, - * SeveralRegistered. - * - * @param manager The value of manager as likeSearch. - * @param likeSearchOption The option of like-search. (NotNull) - */ - public void setManager_LikeSearch( - String manager, - jp.sf.pal.timecard.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { - registerLikeSearchQuery(CK_LS, fRES(manager), getCValueManager(), - "MANAGER", "Manager", "manager", likeSearchOption); - } - - /** * InScope(in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * @@ -507,43 +444,41 @@ } /** - * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * - * @param manager The collection of manager as inScope. - * @param inScopeOption The option of in-scope. (NotNull) + * @param managerList The collection of manager as notInScope. */ - public void setManager_InScope( - String manager, - jp.sf.pal.timecard.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(manager), getCValueManager(), - "MANAGER", "Manager", "manager", inScopeOption); + public void setManager_NotInScope(Collection managerList) { + regManager(CK_NINS, cTL(managerList)); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param managerList The collection of manager as notInScope. + * @param manager The value of manager as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) */ - public void setManager_NotInScope(Collection managerList) { - regManager(CK_NINS, cTL(managerList)); + public void setManager_LikeSearch( + String manager, + jp.sf.pal.timecard.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(manager), getCValueManager(), "MANAGER", "Manager", + "manager", likeSearchOption); } /** - * @param userInfoCBquery Query. - * @deprecated Please use inScopeUserInfoByManager(subQuery) method. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param manager The value of manager as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setManager_InScopeSubQuery_UserInfoByManager( - UserInfoCQ userInfoCBquery) { - String subQueryPropertyName = keepManager_InScopeSubQuery_UserInfoByManager(userInfoCBquery);// for - // saving - // query - // - - // value - // . - registerInScopeSubQuery(userInfoCBquery, "MANAGER", "USER_ID", - subQueryPropertyName); + public void setManager_NotLikeSearch( + String manager, + jp.sf.pal.timecard.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(manager), getCValueManager(), "MANAGER", "Manager", + "manager", likeSearchOption); } public void inScopeUserInfoByManager(SubQuery subQuery) { @@ -552,12 +487,12 @@ cb.xsetupForInScopeSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepManager_InScopeSubQuery_UserInfoByManager(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerInScopeSubQuery(cb.query(), "MANAGER", "USER_ID", subQueryPropertyName); } - abstract public String keepManager_InScopeSubQuery_UserInfoByManager( + public abstract String keepManager_InScopeSubQuery_UserInfoByManager( jp.sf.pal.timecard.db.cbean.cq.UserInfoCQ subQuery); protected void regManager(ConditionKey key, Object value) { @@ -573,8 +508,8 @@ abstract protected ConditionValue getCValueManager(); /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {NotNull : VARCHAR(1) : - * Default=[T]} + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {NotNull : + * VARCHAR(1) : Default=[T]} * * @param isAvailable The value of isAvailable as equal. */ @@ -583,7 +518,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param isAvailable The value of isAvailable as notEqual. */ @@ -592,7 +527,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param isAvailable The value of isAvailable as greaterThan. */ @@ -601,7 +536,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param isAvailable The value of isAvailable as lessThan. */ @@ -610,7 +545,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param isAvailable The value of isAvailable as greaterEqual. */ @@ -619,7 +554,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param isAvailable The value of isAvailable as lessEqual. */ @@ -628,7 +563,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param isAvailable The value of isAvailable as prefixSearch. */ @@ -637,21 +572,6 @@ } /** - * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, - * SeveralRegistered. - * - * @param isAvailable The value of isAvailable as likeSearch. - * @param likeSearchOption The option of like-search. (NotNull) - */ - public void setIsAvailable_LikeSearch( - String isAvailable, - jp.sf.pal.timecard.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { - registerLikeSearchQuery(CK_LS, fRES(isAvailable), - getCValueIsAvailable(), "IS_AVAILABLE", "IsAvailable", - "isAvailable", likeSearchOption); - } - - /** * InScope(in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * @@ -662,27 +582,41 @@ } /** - * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * - * @param isAvailable The collection of isAvailable as inScope. - * @param inScopeOption The option of in-scope. (NotNull) + * @param isAvailableList The collection of isAvailable as notInScope. */ - public void setIsAvailable_InScope( + public void setIsAvailable_NotInScope(Collection isAvailableList) { + regIsAvailable(CK_NINS, cTL(isAvailableList)); + } + + /** + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param isAvailable The value of isAvailable as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) + */ + public void setIsAvailable_LikeSearch( String isAvailable, - jp.sf.pal.timecard.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(isAvailable), getCValueIsAvailable(), - "IS_AVAILABLE", "IsAvailable", "isAvailable", inScopeOption); + jp.sf.pal.timecard.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(isAvailable), getCValueIsAvailable(), + "IS_AVAILABLE", "IsAvailable", "isAvailable", likeSearchOption); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param isAvailableList The collection of isAvailable as notInScope. + * @param isAvailable The value of isAvailable as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setIsAvailable_NotInScope(Collection isAvailableList) { - regIsAvailable(CK_NINS, cTL(isAvailableList)); + public void setIsAvailable_NotLikeSearch( + String isAvailable, + jp.sf.pal.timecard.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(isAvailable), getCValueIsAvailable(), + "IS_AVAILABLE", "IsAvailable", "isAvailable", likeSearchOption); } protected void regIsAvailable(ConditionKey key, Object value) { @@ -698,7 +632,7 @@ abstract protected ConditionValue getCValueIsAvailable(); /** - * Equal(=). And NullIgnored, OnceRegistered. {NotNull : TIMESTAMP} + * Equal(=). And NullIgnored, OnlyOnceRegistered. {NotNull : TIMESTAMP} * * @param createdTime The value of createdTime as equal. */ @@ -707,7 +641,7 @@ } /** - * NotEqual(!=). And NullIgnored, OnceRegistered. + * NotEqual(!=). And NullIgnored, OnlyOnceRegistered. * * @param createdTime The value of createdTime as notEqual. */ @@ -716,7 +650,7 @@ } /** - * GreaterThan(>). And NullIgnored, OnceRegistered. + * GreaterThan(>). And NullIgnored, OnlyOnceRegistered. * * @param createdTime The value of createdTime as greaterThan. */ @@ -725,7 +659,7 @@ } /** - * LessThan(>). And NullIgnored, OnceRegistered. + * LessThan(>). And NullIgnored, OnlyOnceRegistered. * * @param createdTime The value of createdTime as lessThan. */ @@ -734,7 +668,7 @@ } /** - * GreaterEqual(>). And NullIgnored, OnceRegistered. + * GreaterEqual(>). And NullIgnored, OnlyOnceRegistered. * * @param createdTime The value of createdTime as greaterEqual. */ @@ -743,7 +677,7 @@ } /** - * LessEqual(>). And NullIgnored, OnceRegistered. + * LessEqual(>). And NullIgnored, OnlyOnceRegistered. * * @param createdTime The value of createdTime as lessEqual. */ @@ -753,7 +687,7 @@ /** * FromTo($fromDate <= COLUMN_NAME <= $toDate). And NullIgnored, - * OnceRegistered. {NotNull : TIMESTAMP} + * OnlyOnceRegistered. {NotNull : TIMESTAMP} * * @param fromDate The from-date of createdTime. (Nullable) * @param toDate The to-date of createdTime. (Nullable) @@ -771,7 +705,7 @@ /** * FromTo($fromDate <= COLUMN_NAME < $toDate + 1). And NullIgnored, - * OnceRegistered. {NotNull : TIMESTAMP} + * OnlyOnceRegistered. {NotNull : TIMESTAMP} * * @param fromDate The from-date of createdTime. (Nullable) * @param toDate The to-date of createdTime. (Nullable) @@ -797,7 +731,7 @@ abstract protected ConditionValue getCValueCreatedTime(); /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {NotNull : + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {NotNull : * VARCHAR(255)} * * @param createdBy The value of createdBy as equal. @@ -807,7 +741,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param createdBy The value of createdBy as notEqual. */ @@ -816,7 +750,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param createdBy The value of createdBy as greaterThan. */ @@ -825,7 +759,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param createdBy The value of createdBy as lessThan. */ @@ -834,7 +768,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param createdBy The value of createdBy as greaterEqual. */ @@ -843,7 +777,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param createdBy The value of createdBy as lessEqual. */ @@ -852,7 +786,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param createdBy The value of createdBy as prefixSearch. */ @@ -861,20 +795,6 @@ } /** - * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, - * SeveralRegistered. - * - * @param createdBy The value of createdBy as likeSearch. - * @param likeSearchOption The option of like-search. (NotNull) - */ - public void setCreatedBy_LikeSearch( - String createdBy, - jp.sf.pal.timecard.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { - registerLikeSearchQuery(CK_LS, fRES(createdBy), getCValueCreatedBy(), - "CREATED_BY", "CreatedBy", "createdBy", likeSearchOption); - } - - /** * InScope(in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * @@ -885,27 +805,41 @@ } /** - * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * - * @param createdBy The collection of createdBy as inScope. - * @param inScopeOption The option of in-scope. (NotNull) + * @param createdByList The collection of createdBy as notInScope. */ - public void setCreatedBy_InScope( + public void setCreatedBy_NotInScope(Collection createdByList) { + regCreatedBy(CK_NINS, cTL(createdByList)); + } + + /** + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param createdBy The value of createdBy as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) + */ + public void setCreatedBy_LikeSearch( String createdBy, - jp.sf.pal.timecard.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(createdBy), getCValueCreatedBy(), - "CREATED_BY", "CreatedBy", "createdBy", inScopeOption); + jp.sf.pal.timecard.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(createdBy), getCValueCreatedBy(), "CREATED_BY", + "CreatedBy", "createdBy", likeSearchOption); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param createdByList The collection of createdBy as notInScope. + * @param createdBy The value of createdBy as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setCreatedBy_NotInScope(Collection createdByList) { - regCreatedBy(CK_NINS, cTL(createdByList)); + public void setCreatedBy_NotLikeSearch( + String createdBy, + jp.sf.pal.timecard.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(createdBy), getCValueCreatedBy(), "CREATED_BY", + "CreatedBy", "createdBy", likeSearchOption); } protected void regCreatedBy(ConditionKey key, Object value) { @@ -921,7 +855,7 @@ abstract protected ConditionValue getCValueCreatedBy(); /** - * Equal(=). And NullIgnored, OnceRegistered. {NotNull : TIMESTAMP} + * Equal(=). And NullIgnored, OnlyOnceRegistered. {NotNull : TIMESTAMP} * * @param updatedTime The value of updatedTime as equal. */ @@ -930,7 +864,7 @@ } /** - * NotEqual(!=). And NullIgnored, OnceRegistered. + * NotEqual(!=). And NullIgnored, OnlyOnceRegistered. * * @param updatedTime The value of updatedTime as notEqual. */ @@ -939,7 +873,7 @@ } /** - * GreaterThan(>). And NullIgnored, OnceRegistered. + * GreaterThan(>). And NullIgnored, OnlyOnceRegistered. * * @param updatedTime The value of updatedTime as greaterThan. */ @@ -948,7 +882,7 @@ } /** - * LessThan(>). And NullIgnored, OnceRegistered. + * LessThan(>). And NullIgnored, OnlyOnceRegistered. * * @param updatedTime The value of updatedTime as lessThan. */ @@ -957,7 +891,7 @@ } /** - * GreaterEqual(>). And NullIgnored, OnceRegistered. + * GreaterEqual(>). And NullIgnored, OnlyOnceRegistered. * * @param updatedTime The value of updatedTime as greaterEqual. */ @@ -966,7 +900,7 @@ } /** - * LessEqual(>). And NullIgnored, OnceRegistered. + * LessEqual(>). And NullIgnored, OnlyOnceRegistered. * * @param updatedTime The value of updatedTime as lessEqual. */ @@ -976,7 +910,7 @@ /** * FromTo($fromDate <= COLUMN_NAME <= $toDate). And NullIgnored, - * OnceRegistered. {NotNull : TIMESTAMP} + * OnlyOnceRegistered. {NotNull : TIMESTAMP} * * @param fromDate The from-date of updatedTime. (Nullable) * @param toDate The to-date of updatedTime. (Nullable) @@ -994,7 +928,7 @@ /** * FromTo($fromDate <= COLUMN_NAME < $toDate + 1). And NullIgnored, - * OnceRegistered. {NotNull : TIMESTAMP} + * OnlyOnceRegistered. {NotNull : TIMESTAMP} * * @param fromDate The from-date of updatedTime. (Nullable) * @param toDate The to-date of updatedTime. (Nullable) @@ -1020,7 +954,7 @@ abstract protected ConditionValue getCValueUpdatedTime(); /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {NotNull : + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {NotNull : * VARCHAR(255)} * * @param updatedBy The value of updatedBy as equal. @@ -1030,7 +964,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param updatedBy The value of updatedBy as notEqual. */ @@ -1039,7 +973,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param updatedBy The value of updatedBy as greaterThan. */ @@ -1048,7 +982,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param updatedBy The value of updatedBy as lessThan. */ @@ -1057,7 +991,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param updatedBy The value of updatedBy as greaterEqual. */ @@ -1066,7 +1000,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param updatedBy The value of updatedBy as lessEqual. */ @@ -1075,7 +1009,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param updatedBy The value of updatedBy as prefixSearch. */ @@ -1084,20 +1018,6 @@ } /** - * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, - * SeveralRegistered. - * - * @param updatedBy The value of updatedBy as likeSearch. - * @param likeSearchOption The option of like-search. (NotNull) - */ - public void setUpdatedBy_LikeSearch( - String updatedBy, - jp.sf.pal.timecard.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { - registerLikeSearchQuery(CK_LS, fRES(updatedBy), getCValueUpdatedBy(), - "UPDATED_BY", "UpdatedBy", "updatedBy", likeSearchOption); - } - - /** * InScope(in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * @@ -1108,27 +1028,41 @@ } /** - * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * - * @param updatedBy The collection of updatedBy as inScope. - * @param inScopeOption The option of in-scope. (NotNull) + * @param updatedByList The collection of updatedBy as notInScope. */ - public void setUpdatedBy_InScope( + public void setUpdatedBy_NotInScope(Collection updatedByList) { + regUpdatedBy(CK_NINS, cTL(updatedByList)); + } + + /** + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param updatedBy The value of updatedBy as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) + */ + public void setUpdatedBy_LikeSearch( String updatedBy, - jp.sf.pal.timecard.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(updatedBy), getCValueUpdatedBy(), - "UPDATED_BY", "UpdatedBy", "updatedBy", inScopeOption); + jp.sf.pal.timecard.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(updatedBy), getCValueUpdatedBy(), "UPDATED_BY", + "UpdatedBy", "updatedBy", likeSearchOption); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param updatedByList The collection of updatedBy as notInScope. + * @param updatedBy The value of updatedBy as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setUpdatedBy_NotInScope(Collection updatedByList) { - regUpdatedBy(CK_NINS, cTL(updatedByList)); + public void setUpdatedBy_NotLikeSearch( + String updatedBy, + jp.sf.pal.timecard.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(updatedBy), getCValueUpdatedBy(), "UPDATED_BY", + "UpdatedBy", "updatedBy", likeSearchOption); } protected void regUpdatedBy(ConditionKey key, Object value) { @@ -1144,7 +1078,7 @@ abstract protected ConditionValue getCValueUpdatedBy(); /** - * Equal(=). And NullIgnored, OnceRegistered. {TIMESTAMP} + * Equal(=). And NullIgnored, OnlyOnceRegistered. {TIMESTAMP} * * @param deletedTime The value of deletedTime as equal. */ @@ -1153,7 +1087,7 @@ } /** - * NotEqual(!=). And NullIgnored, OnceRegistered. + * NotEqual(!=). And NullIgnored, OnlyOnceRegistered. * * @param deletedTime The value of deletedTime as notEqual. */ @@ -1162,7 +1096,7 @@ } /** - * GreaterThan(>). And NullIgnored, OnceRegistered. + * GreaterThan(>). And NullIgnored, OnlyOnceRegistered. * * @param deletedTime The value of deletedTime as greaterThan. */ @@ -1171,7 +1105,7 @@ } /** - * LessThan(>). And NullIgnored, OnceRegistered. + * LessThan(>). And NullIgnored, OnlyOnceRegistered. * * @param deletedTime The value of deletedTime as lessThan. */ @@ -1180,7 +1114,7 @@ } /** - * GreaterEqual(>). And NullIgnored, OnceRegistered. + * GreaterEqual(>). And NullIgnored, OnlyOnceRegistered. * * @param deletedTime The value of deletedTime as greaterEqual. */ @@ -1189,7 +1123,7 @@ } /** - * LessEqual(>). And NullIgnored, OnceRegistered. + * LessEqual(>). And NullIgnored, OnlyOnceRegistered. * * @param deletedTime The value of deletedTime as lessEqual. */ @@ -1199,7 +1133,7 @@ /** * FromTo($fromDate <= COLUMN_NAME <= $toDate). And NullIgnored, - * OnceRegistered. {TIMESTAMP} + * OnlyOnceRegistered. {TIMESTAMP} * * @param fromDate The from-date of deletedTime. (Nullable) * @param toDate The to-date of deletedTime. (Nullable) @@ -1217,7 +1151,7 @@ /** * FromTo($fromDate <= COLUMN_NAME < $toDate + 1). And NullIgnored, - * OnceRegistered. {TIMESTAMP} + * OnlyOnceRegistered. {TIMESTAMP} * * @param fromDate The from-date of deletedTime. (Nullable) * @param toDate The to-date of deletedTime. (Nullable) @@ -1231,14 +1165,14 @@ } /** - * IsNull(is null). And OnceRegistered. + * IsNull(is null). And OnlyOnceRegistered. */ public void setDeletedTime_IsNull() { regDeletedTime(CK_ISN, DUMMY_OBJECT); } /** - * IsNotNull(is not null). And OnceRegistered. + * IsNotNull(is not null). And OnlyOnceRegistered. */ public void setDeletedTime_IsNotNull() { regDeletedTime(CK_ISNN, DUMMY_OBJECT); @@ -1257,7 +1191,7 @@ abstract protected ConditionValue getCValueDeletedTime(); /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {VARCHAR(255)} + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {VARCHAR(255)} * * @param deletedBy The value of deletedBy as equal. */ @@ -1266,7 +1200,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param deletedBy The value of deletedBy as notEqual. */ @@ -1275,7 +1209,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param deletedBy The value of deletedBy as greaterThan. */ @@ -1284,7 +1218,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param deletedBy The value of deletedBy as lessThan. */ @@ -1293,7 +1227,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param deletedBy The value of deletedBy as greaterEqual. */ @@ -1302,7 +1236,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param deletedBy The value of deletedBy as lessEqual. */ @@ -1311,7 +1245,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param deletedBy The value of deletedBy as prefixSearch. */ @@ -1320,20 +1254,6 @@ } /** - * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, - * SeveralRegistered. - * - * @param deletedBy The value of deletedBy as likeSearch. - * @param likeSearchOption The option of like-search. (NotNull) - */ - public void setDeletedBy_LikeSearch( - String deletedBy, - jp.sf.pal.timecard.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { - registerLikeSearchQuery(CK_LS, fRES(deletedBy), getCValueDeletedBy(), - "DELETED_BY", "DeletedBy", "deletedBy", likeSearchOption); - } - - /** * InScope(in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * @@ -1344,38 +1264,52 @@ } /** - * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * - * @param deletedBy The collection of deletedBy as inScope. - * @param inScopeOption The option of in-scope. (NotNull) + * @param deletedByList The collection of deletedBy as notInScope. */ - public void setDeletedBy_InScope( + public void setDeletedBy_NotInScope(Collection deletedByList) { + regDeletedBy(CK_NINS, cTL(deletedByList)); + } + + /** + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param deletedBy The value of deletedBy as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) + */ + public void setDeletedBy_LikeSearch( String deletedBy, - jp.sf.pal.timecard.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(deletedBy), getCValueDeletedBy(), - "DELETED_BY", "DeletedBy", "deletedBy", inScopeOption); + jp.sf.pal.timecard.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(deletedBy), getCValueDeletedBy(), "DELETED_BY", + "DeletedBy", "deletedBy", likeSearchOption); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param deletedByList The collection of deletedBy as notInScope. + * @param deletedBy The value of deletedBy as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setDeletedBy_NotInScope(Collection deletedByList) { - regDeletedBy(CK_NINS, cTL(deletedByList)); + public void setDeletedBy_NotLikeSearch( + String deletedBy, + jp.sf.pal.timecard.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(deletedBy), getCValueDeletedBy(), "DELETED_BY", + "DeletedBy", "deletedBy", likeSearchOption); } /** - * IsNull(is null). And OnceRegistered. + * IsNull(is null). And OnlyOnceRegistered. */ public void setDeletedBy_IsNull() { regDeletedBy(CK_ISN, DUMMY_OBJECT); } /** - * IsNotNull(is not null). And OnceRegistered. + * IsNotNull(is not null). And OnlyOnceRegistered. */ public void setDeletedBy_IsNotNull() { regDeletedBy(CK_ISNN, DUMMY_OBJECT); @@ -1394,7 +1328,7 @@ abstract protected ConditionValue getCValueDeletedBy(); /** - * Equal(=). And NullIgnored, OnceRegistered. {NotNull : INTEGER : + * Equal(=). And NullIgnored, OnlyOnceRegistered. {NotNull : INTEGER : * Default=[0]} * * @param versionno The value of versionno as equal. @@ -1404,7 +1338,7 @@ } /** - * NotEqual(!=). And NullIgnored, OnceRegistered. + * NotEqual(!=). And NullIgnored, OnlyOnceRegistered. * * @param versionno The value of versionno as notEqual. */ @@ -1413,7 +1347,7 @@ } /** - * GreaterThan(>). And NullIgnored, OnceRegistered. + * GreaterThan(>). And NullIgnored, OnlyOnceRegistered. * * @param versionno The value of versionno as greaterThan. */ @@ -1422,7 +1356,7 @@ } /** - * LessThan(<). And NullIgnored, OnceRegistered. + * LessThan(<). And NullIgnored, OnlyOnceRegistered. * * @param versionno The value of versionno as lessThan. */ @@ -1431,7 +1365,7 @@ } /** - * GreaterEqual(>=). And NullIgnored, OnceRegistered. + * GreaterEqual(>=). And NullIgnored, OnlyOnceRegistered. * * @param versionno The value of versionno as greaterEqual. */ @@ -1440,7 +1374,7 @@ } /** - * LessEqual(<=). And NullIgnored, OnceRegistered. + * LessEqual(<=). And NullIgnored, OnlyOnceRegistered. * * @param versionno The value of versionno as lessEqual. */ @@ -1480,6 +1414,50 @@ abstract protected ConditionValue getCValueVersionno(); + public SSQFunction scalar_Equal() { + return xcreateSSQFunction("="); + } + + public SSQFunction scalar_GreaterEqual() { + return xcreateSSQFunction(">="); + } + + public SSQFunction scalar_GreaterThan() { + return xcreateSSQFunction(">"); + } + + public SSQFunction scalar_LessEqual() { + return xcreateSSQFunction("<="); + } + + public SSQFunction scalar_LessThan() { + return xcreateSSQFunction("<"); + } + + protected SSQFunction xcreateSSQFunction(final String operand) { + return new SSQFunction(new SSQSetupper() { + public void setup(String function, SubQuery subQuery) { + xscalarSubQuery(function, subQuery, operand); + } + }); + } + + protected void xscalarSubQuery(String function, + SubQuery subQuery, String operand) { + assertObjectNotNull("subQuery", subQuery); + EmployeeCB cb = new EmployeeCB(); + cb.xsetupForScalarSubQuery(); + subQuery.query(cb); + String subQueryPropertyName = keepScalarSubQuery(cb.query()); // for + // saving + // query + // -value. + registerScalarSubQuery(function, cb.query(), subQueryPropertyName, + operand); + } + + public abstract String keepScalarSubQuery(EmployeeCQ subQuery); + // Very Internal (for Suppressing Warn about 'Not Use Import') protected String getConditionBeanClassNameInternally() { return EmployeeCB.class.getName(); Modified: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/cbean/cq/bs/AbstractBsGroupInfoCQ.java =================================================================== --- timecard/trunk/src/main/java/jp/sf/pal/timecard/db/cbean/cq/bs/AbstractBsGroupInfoCQ.java 2008-12-27 22:18:30 UTC (rev 1630) +++ timecard/trunk/src/main/java/jp/sf/pal/timecard/db/cbean/cq/bs/AbstractBsGroupInfoCQ.java 2008-12-27 22:20:25 UTC (rev 1631) @@ -20,7 +20,6 @@ * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public abstract class AbstractBsGroupInfoCQ extends AbstractConditionQuery { //========================================================================== @@ -50,7 +49,7 @@ // ===== /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {PK : NotNull : + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {PK : NotNull : * VARCHAR(255)} * * @param groupId The value of groupId as equal. @@ -60,7 +59,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param groupId The value of groupId as notEqual. */ @@ -69,7 +68,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param groupId The value of groupId as greaterThan. */ @@ -78,7 +77,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param groupId The value of groupId as lessThan. */ @@ -87,7 +86,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param groupId The value of groupId as greaterEqual. */ @@ -96,7 +95,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param groupId The value of groupId as lessEqual. */ @@ -105,7 +104,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param groupId The value of groupId as prefixSearch. */ @@ -114,20 +113,6 @@ } /** - * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, - * SeveralRegistered. - * - * @param groupId The value of groupId as likeSearch. - * @param likeSearchOption The option of like-search. (NotNull) - */ - public void setGroupId_LikeSearch( - String groupId, - jp.sf.pal.timecard.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { - registerLikeSearchQuery(CK_LS, fRES(groupId), getCValueGroupId(), - "GROUP_ID", "GroupId", "groupId", likeSearchOption); - } - - /** * InScope(in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * @@ -138,43 +123,41 @@ } /** - * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * - * @param groupId The collection of groupId as inScope. - * @param inScopeOption The option of in-scope. (NotNull) + * @param groupIdList The collection of groupId as notInScope. */ - public void setGroupId_InScope( - String groupId, - jp.sf.pal.timecard.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(groupId), getCValueGroupId(), - "GROUP_ID", "GroupId", "groupId", inScopeOption); + public void setGroupId_NotInScope(Collection groupIdList) { + regGroupId(CK_NINS, cTL(groupIdList)); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param groupIdList The collection of groupId as notInScope. + * @param groupId The value of groupId as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) */ - public void setGroupId_NotInScope(Collection groupIdList) { - regGroupId(CK_NINS, cTL(groupIdList)); + public void setGroupId_LikeSearch( + String groupId, + jp.sf.pal.timecard.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(groupId), getCValueGroupId(), "GROUP_ID", "GroupId", + "groupId", likeSearchOption); } /** - * @param groupMappingCBquery Query. - * @deprecated Please use inScopeGroupMappingList(subQuery) method. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param groupId The value of groupId as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setGroupId_InScopeSubQuery_GroupMappingList( - GroupMappingCQ groupMappingCBquery) { - String subQueryPropertyName = keepGroupId_InScopeSubQuery_GroupMappingList(groupMappingCBquery);// for - // saving - // query - // - - // value - // . - registerInScopeSubQuery(groupMappingCBquery, "GROUP_ID", "GROUP_ID", - subQueryPropertyName); + public void setGroupId_NotLikeSearch( + String groupId, + jp.sf.pal.timecard.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(groupId), getCValueGroupId(), "GROUP_ID", + "GroupId", "groupId", likeSearchOption); } public void inScopeGroupMappingList(SubQuery subQuery) { @@ -183,42 +166,26 @@ cb.xsetupForInScopeSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepGroupId_InScopeSubQuery_GroupMappingList(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerInScopeSubQuery(cb.query(), "GROUP_ID", "GROUP_ID", subQueryPropertyName); } - abstract public String keepGroupId_InScopeSubQuery_GroupMappingList( + public abstract String keepGroupId_InScopeSubQuery_GroupMappingList( GroupMappingCQ subQuery); - /** - * @param userInfoCBquery Query. - * @deprecated Please use inScopeUserInfoList(subQuery) method. - */ - public void setGroupId_InScopeSubQuery_UserInfoList( - UserInfoCQ userInfoCBquery) { - String subQueryPropertyName = keepGroupId_InScopeSubQuery_UserInfoList(userInfoCBquery);// for - // saving - // query - // - - // value - // . - registerInScopeSubQuery(userInfoCBquery, "GROUP_ID", "GROUP_ID", - subQueryPropertyName); - } - public void inScopeUserInfoList(SubQuery subQuery) { assertObjectNotNull("subQuery", subQuery); UserInfoCB cb = new UserInfoCB(); cb.xsetupForInScopeSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepGroupId_InScopeSubQuery_UserInfoList(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerInScopeSubQuery(cb.query(), "GROUP_ID", "GROUP_ID", subQueryPropertyName); } - abstract public String keepGroupId_InScopeSubQuery_UserInfoList( + public abstract String keepGroupId_InScopeSubQuery_UserInfoList( UserInfoCQ subQuery); public void notInScopeGroupMappingList(SubQuery subQuery) { @@ -227,12 +194,12 @@ cb.xsetupForInScopeSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepGroupId_NotInScopeSubQuery_GroupMappingList(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerNotInScopeSubQuery(cb.query(), "GROUP_ID", "GROUP_ID", subQueryPropertyName); } - abstract public String keepGroupId_NotInScopeSubQuery_GroupMappingList( + public abstract String keepGroupId_NotInScopeSubQuery_GroupMappingList( GroupMappingCQ subQuery); public void notInScopeUserInfoList(SubQuery subQuery) { @@ -241,31 +208,15 @@ cb.xsetupForInScopeSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepGroupId_NotInScopeSubQuery_UserInfoList(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerNotInScopeSubQuery(cb.query(), "GROUP_ID", "GROUP_ID", subQueryPropertyName); } - abstract public String keepGroupId_NotInScopeSubQuery_UserInfoList( + public abstract String keepGroupId_NotInScopeSubQuery_UserInfoList( UserInfoCQ subQuery); /** - * @param groupMappingCBquery Query. - * @deprecated Please use existsGroupMappingList(subQuery) method. - */ - public void setGroupId_ExistsSubQuery_GroupMappingList( - GroupMappingCQ groupMappingCBquery) { - String subQueryPropertyName = keepGroupId_ExistsSubQuery_GroupMappingList(groupMappingCBquery);// for - // saving - // query - // - - // value - // . - registerExistsSubQuery(groupMappingCBquery, "GROUP_ID", "GROUP_ID", - subQueryPropertyName); - } - - /** * Set up 'exists' sub-query. {exists (select GROUP_ID from GROUP_MAPPING * where ...)} * @@ -278,31 +229,15 @@ cb.xsetupForExistsSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepGroupId_ExistsSubQuery_GroupMappingList(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerExistsSubQuery(cb.query(), "GROUP_ID", "GROUP_ID", subQueryPropertyName); } - abstract public String keepGroupId_ExistsSubQuery_GroupMappingList( + public abstract String keepGroupId_ExistsSubQuery_GroupMappingList( GroupMappingCQ subQuery); /** - * @param userInfoCBquery Query. - * @deprecated Please use existsUserInfoList(subQuery) method. - */ - public void setGroupId_ExistsSubQuery_UserInfoList( - UserInfoCQ userInfoCBquery) { - String subQueryPropertyName = keepGroupId_ExistsSubQuery_UserInfoList(userInfoCBquery);// for - // saving - // query - // - - // value - // . - registerExistsSubQuery(userInfoCBquery, "GROUP_ID", "GROUP_ID", - subQueryPropertyName); - } - - /** * Set up 'exists' sub-query. {exists (select GROUP_ID from USER_INFO where * ...)} * @@ -315,12 +250,12 @@ cb.xsetupForExistsSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepGroupId_ExistsSubQuery_UserInfoList(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerExistsSubQuery(cb.query(), "GROUP_ID", "GROUP_ID", subQueryPropertyName); } - abstract public String keepGroupId_ExistsSubQuery_UserInfoList( + public abstract String keepGroupId_ExistsSubQuery_UserInfoList( UserInfoCQ subQuery); /** @@ -337,12 +272,12 @@ cb.xsetupForExistsSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepGroupId_NotExistsSubQuery_GroupMappingList(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerNotExistsSubQuery(cb.query(), "GROUP_ID", "GROUP_ID", subQueryPropertyName); } - abstract public String keepGroupId_NotExistsSubQuery_GroupMappingList( + public abstract String keepGroupId_NotExistsSubQuery_GroupMappingList( GroupMappingCQ subQuery); /** @@ -358,53 +293,53 @@ cb.xsetupForExistsSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepGroupId_NotExistsSubQuery_UserInfoList(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerNotExistsSubQuery(cb.query(), "GROUP_ID", "GROUP_ID", subQueryPropertyName); } - abstract public String keepGroupId_NotExistsSubQuery_UserInfoList( + public abstract String keepGroupId_NotExistsSubQuery_UserInfoList( UserInfoCQ subQuery); public void xderiveGroupMappingList(String function, SubQuery subQuery, String aliasName) { assertObjectNotNull("subQuery", subQuery); GroupMappingCB cb = new GroupMappingCB(); - cb.xsetupForDeriveReferrer(); + cb.xsetupForDerivedReferrer(); subQuery.query(cb); - String subQueryPropertyName = keepGroupId_DeriveSubQuery_GroupMappingList(cb - .query());// for saving query-value. - registerDeriveSubQuery(function, cb.query(), "GROUP_ID", "GROUP_ID", - subQueryPropertyName, aliasName); + String subQueryPropertyName = keepGroupId_DerivedReferrer_GroupMappingList(cb + .query()); // for saving query-value. + registerDerivedReferrerSubQuery(function, cb.query(), "GROUP_ID", + "GROUP_ID", subQueryPropertyName, aliasName); } - abstract public String keepGroupId_DeriveSubQuery_GroupMappingList( + public abstract String keepGroupId_DerivedReferrer_GroupMappingList( GroupMappingCQ subQuery); public void xderiveUserInfoList(String function, SubQuery subQuery, String aliasName) { assertObjectNotNull("subQuery", subQuery); UserInfoCB cb = new UserInfoCB(); - cb.xsetupForDeriveReferrer(); + cb.xsetupForDerivedReferrer(); subQuery.query(cb); - String subQueryPropertyName = keepGroupId_DeriveSubQuery_UserInfoList(cb - .query());// for saving query-value. - registerDeriveSubQuery(function, cb.query(), "GROUP_ID", "GROUP_ID", - subQueryPropertyName, aliasName); + String subQueryPropertyName = keepGroupId_DerivedReferrer_UserInfoList(cb + .query()); // for saving query-value. + registerDerivedReferrerSubQuery(function, cb.query(), "GROUP_ID", + "GROUP_ID", subQueryPropertyName, aliasName); } - abstract public String keepGroupId_DeriveSubQuery_UserInfoList( + public abstract String keepGroupId_DerivedReferrer_UserInfoList( UserInfoCQ subQuery); /** - * IsNull(is null). And OnceRegistered. + * IsNull(is null). And OnlyOnceRegistered. */ public void setGroupId_IsNull() { regGroupId(CK_ISN, DUMMY_OBJECT); } /** - * IsNotNull(is not null). And OnceRegistered. + * IsNotNull(is not null). And OnlyOnceRegistered. */ public void setGroupId_IsNotNull() { regGroupId(CK_ISNN, DUMMY_OBJECT); @@ -423,7 +358,7 @@ abstract protected ConditionValue getCValueGroupId(); /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {VARCHAR(100)} + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {VARCHAR(100)} * * @param name The value of name as equal. */ @@ -432,7 +367,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param name The value of name as notEqual. */ @@ -441,7 +376,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param name The value of name as greaterThan. */ @@ -450,7 +385,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param name The value of name as lessThan. */ @@ -459,7 +394,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param name The value of name as greaterEqual. */ @@ -468,7 +403,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param name The value of name as lessEqual. */ @@ -477,7 +412,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param name The value of name as prefixSearch. */ @@ -486,20 +421,6 @@ } /** - * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, - * SeveralRegistered. - * - * @param name The value of name as likeSearch. - * @param likeSearchOption The option of like-search. (NotNull) - */ - public void setName_LikeSearch( - String name, - jp.sf.pal.timecard.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { - registerLikeSearchQuery(CK_LS, fRES(name), getCValueName(), "NAME", - "Name", "name", likeSearchOption); - } - - /** * InScope(in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * @@ -510,38 +431,52 @@ } /** - * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * - * @param name The collection of name as inScope. - * @param inScopeOption The option of in-scope. (NotNull) + * @param nameList The collection of name as notInScope. */ - public void setName_InScope( + public void setName_NotInScope(Collection nameList) { + regName(CK_NINS, cTL(nameList)); + } + + /** + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param name The value of name as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) + */ + public void setName_LikeSearch( String name, - jp.sf.pal.timecard.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(name), getCValueName(), "NAME", - "Name", "name", inScopeOption); + jp.sf.pal.timecard.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(name), getCValueName(), "NAME", "Name", "name", + likeSearchOption); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param nameList The collection of name as notInScope. + * @param name The value of name as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setName_NotInScope(Collection nameList) { - regName(CK_NINS, cTL(nameList)); + public void setName_NotLikeSearch( + String name, + jp.sf.pal.timecard.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(name), getCValueName(), "NAME", "Name", "name", + likeSearchOption); } /** - * IsNull(is null). And OnceRegistered. + * IsNull(is null). And OnlyOnceRegistered. */ public void setName_IsNull() { regName(CK_ISN, DUMMY_OBJECT); } /** - * IsNotNull(is not null). And OnceRegistered. + * IsNotNull(is not null). And OnlyOnceRegistered. */ public void setName_IsNotNull() { regName(CK_ISNN, DUMMY_OBJECT); @@ -558,7 +493,7 @@ abstract protected ConditionValue getCValueName(); /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {VARCHAR(255)} + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {VARCHAR(255)} * * @param description The value of description as equal. */ @@ -567,7 +502,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param description The value of description as notEqual. */ @@ -576,7 +511,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param description The value of description as greaterThan. */ @@ -585,7 +520,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param description The value of description as lessThan. */ @@ -594,7 +529,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param description The value of description as greaterEqual. */ @@ -603,7 +538,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param description The value of description as lessEqual. */ @@ -612,7 +547,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param description The value of description as prefixSearch. */ @@ -621,21 +556,6 @@ } /** - * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, - * SeveralRegistered. - * - * @param description The value of description as likeSearch. - * @param likeSearchOption The option of like-search. (NotNull) - */ - public void setDescription_LikeSearch( - String description, - jp.sf.pal.timecard.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { - registerLikeSearchQuery(CK_LS, fRES(description), - getCValueDescription(), "DESCRIPTION", "Description", - "description", likeSearchOption); - } - - /** * InScope(in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * @@ -646,38 +566,52 @@ } /** - * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * - * @param description The collection of description as inScope. - * @param inScopeOption The option of in-scope. (NotNull) + * @param descriptionList The collection of description as notInScope. */ - public void setDescription_InScope( + public void setDescription_NotInScope(Collection descriptionList) { + regDescription(CK_NINS, cTL(descriptionList)); + } + + /** + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param description The value of description as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) + */ + public void setDescription_LikeSearch( String description, - jp.sf.pal.timecard.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(description), getCValueDescription(), - "DESCRIPTION", "Description", "description", inScopeOption); + jp.sf.pal.timecard.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(description), getCValueDescription(), "DESCRIPTION", + "Description", "description", likeSearchOption); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param descriptionList The collection of description as notInScope. + * @param description The value of description as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setDescription_NotInScope(Collection descriptionList) { - regDescription(CK_NINS, cTL(descriptionList)); + public void setDescription_NotLikeSearch( + String description, + jp.sf.pal.timecard.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(description), getCValueDescription(), + "DESCRIPTION", "Description", "description", likeSearchOption); } /** - * IsNull(is null). And OnceRegistered. + * IsNull(is null). And OnlyOnceRegistered. */ public void setDescription_IsNull() { regDescription(CK_ISN, DUMMY_OBJECT); } /** - * IsNotNull(is not null). And OnceRegistered. + * IsNotNull(is not null). And OnlyOnceRegistered. */ public void setDescription_IsNotNull() { regDescription(CK_ISNN, DUMMY_OBJECT); @@ -696,7 +630,7 @@ abstract protected ConditionValue getCValueDescription(); /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {VARCHAR(255)} + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {VARCHAR(255)} * * @param email The value of email as equal. */ @@ -705,7 +639,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param email The value of email as notEqual. */ @@ -714,7 +648,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param email The value of email as greaterThan. */ @@ -723,7 +657,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param email The value of email as lessThan. */ @@ -732,7 +666,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param email The value of email as greaterEqual. */ @@ -741,7 +675,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param email The value of email as lessEqual. */ @@ -750,7 +684,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param email The value of email as prefixSearch. */ @@ -759,20 +693,6 @@ } /** - * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, - * SeveralRegistered. - * - * @param email The value of email as likeSearch. - * @param likeSearchOption The option of like-search. (NotNull) - */ - public void setEmail_LikeSearch( - String email, - jp.sf.pal.timecard.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { - registerLikeSearchQuery(CK_LS, fRES(email), getCValueEmail(), "EMAIL", - "Email", "email", likeSearchOption); - } - - /** * InScope(in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * @@ -783,38 +703,52 @@ } /** - * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * - * @param email The collection of email as inScope. - * @param inScopeOption The option of in-scope. (NotNull) + * @param emailList The collection of email as notInScope. */ - public void setEmail_InScope( + public void setEmail_NotInScope(Collection emailList) { + regEmail(CK_NINS, cTL(emailList)); + } + + /** + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param email The value of email as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) + */ + public void setEmail_LikeSearch( String email, - jp.sf.pal.timecard.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(email), getCValueEmail(), "EMAIL", - "Email", "email", inScopeOption); + jp.sf.pal.timecard.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(email), getCValueEmail(), "EMAIL", "Email", "email", + likeSearchOption); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param emailList The collection of email as notInScope. + * @param email The value of email as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setEmail_NotInScope(Collection emailList) { - regEmail(CK_NINS, cTL(emailList)); + public void setEmail_NotLikeSearch( + String email, + jp.sf.pal.timecard.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(email), getCValueEmail(), "EMAIL", "Email", + "email", likeSearchOption); } /** - * IsNull(is null). And OnceRegistered. + * IsNull(is null). And OnlyOnceRegistered. */ public void setEmail_IsNull() { regEmail(CK_ISN, DUMMY_OBJECT); } /** - * IsNotNull(is not null). And OnceRegistered. + * IsNotNull(is not null). And OnlyOnceRegistered. */ public void setEmail_IsNotNull() { regEmail(CK_ISNN, DUMMY_OBJECT); @@ -832,7 +766,7 @@ abstract protected ConditionValue getCValueEmail(); /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {VARCHAR(255)} + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {VARCHAR(255)} * * @param url The value of url as equal. */ @@ -841,7 +775,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param url The value of url as notEqual. */ @@ -850,7 +784,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param url The value of url as greaterThan. */ @@ -859,7 +793,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param url The value of url as lessThan. */ @@ -868,7 +802,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param url The value of url as greaterEqual. */ @@ -877,7 +811,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param url The value of url as lessEqual. */ @@ -886,7 +820,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param url The value of url as prefixSearch. */ @@ -895,20 +829,6 @@ } /** - * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, - * SeveralRegistered. - * - * @param url The value of url as likeSearch. - * @param likeSearchOption The option of like-search. (NotNull) - */ - public void setUrl_LikeSearch( - String url, - jp.sf.pal.timecard.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { - registerLikeSearchQuery(CK_LS, fRES(url), getCValueUrl(), "URL", "Url", - "url", likeSearchOption); - } - - /** * InScope(in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * @@ -919,38 +839,52 @@ } /** - * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * - * @param url The collection of url as inScope. - * @param inScopeOption The option of in-scope. (NotNull) + * @param urlList The collection of url as notInScope. */ - public void setUrl_InScope( + public void setUrl_NotInScope(Collection urlList) { + regUrl(CK_NINS, cTL(urlList)); + } + + /** + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param url The value of url as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) + */ + public void setUrl_LikeSearch( String url, - jp.sf.pal.timecard.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(url), getCValueUrl(), "URL", "Url", - "url", inScopeOption); + jp.sf.pal.timecard.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(url), getCValueUrl(), "URL", "Url", "url", + likeSearchOption); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param urlList The collection of url as notInScope. + * @param url The value of url as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setUrl_NotInScope(Collection urlList) { - regUrl(CK_NINS, cTL(urlList)); + public void setUrl_NotLikeSearch( + String url, + jp.sf.pal.timecard.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(url), getCValueUrl(), "URL", "Url", "url", + likeSearchOption); } /** - * IsNull(is null). And OnceRegistered. + * IsNull(is null). And OnlyOnceRegistered. */ public void setUrl_IsNull() { regUrl(CK_ISN, DUMMY_OBJECT); } /** - * IsNotNull(is not null). And OnceRegistered. + * IsNotNull(is not null). And OnlyOnceRegistered. */ public void setUrl_IsNotNull() { regUrl(CK_ISNN, DUMMY_OBJECT); @@ -967,7 +901,7 @@ abstract protected ConditionValue getCValueUrl(); /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {VARCHAR(40)} + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {VARCHAR(40)} * * @param telephone The value of telephone as equal. */ @@ -976,7 +910,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param telephone The value of telephone as notEqual. */ @@ -985,7 +919,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param telephone The value of telephone as greaterThan. */ @@ -994,7 +928,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param telephone The value of telephone as lessThan. */ @@ -1003,7 +937,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param telephone The value of telephone as greaterEqual. */ @@ -1012,7 +946,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param telephone The value of telephone as lessEqual. */ @@ -1021,7 +955,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param telephone The value of telephone as prefixSearch. */ @@ -1030,20 +964,6 @@ } /** - * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, - * SeveralRegistered. - * - * @param telephone The value of telephone as likeSearch. - * @param likeSearchOption The option of like-search. (NotNull) - */ - public void setTelephone_LikeSearch( - String telephone, - jp.sf.pal.timecard.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { - registerLikeSearchQuery(CK_LS, fRES(telephone), getCValueTelephone(), - "TELEPHONE", "Telephone", "telephone", likeSearchOption); - } - - /** * InScope(in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * @@ -1054,38 +974,52 @@ } /** - * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * - * @param telephone The collection of telephone as inScope. - * @param inScopeOption The option of in-scope. (NotNull) + * @param telephoneList The collection of telephone as notInScope. */ - public void setTelephone_InScope( + public void setTelephone_NotInScope(Collection telephoneList) { + regTelephone(CK_NINS, cTL(telephoneList)); + } + + /** + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param telephone The value of telephone as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) + */ + public void setTelephone_LikeSearch( String telephone, - jp.sf.pal.timecard.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(telephone), getCValueTelephone(), - "TELEPHONE", "Telephone", "telephone", inScopeOption); + jp.sf.pal.timecard.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(telephone), getCValueTelephone(), "TELEPHONE", + "Telephone", "telephone", likeSearchOption); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param telephoneList The collection of telephone as notInScope. + * @param telephone The value of telephone as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setTelephone_NotInScope(Collection telephoneList) { - regTelephone(CK_NINS, cTL(telephoneList)); + public void setTelephone_NotLikeSearch( + String telephone, + jp.sf.pal.timecard.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(telephone), getCValueTelephone(), "TELEPHONE", + "Telephone", "telephone", likeSearchOption); } /** - * IsNull(is null). And OnceRegistered. + * IsNull(is null). And OnlyOnceRegistered. */ public void setTelephone_IsNull() { regTelephone(CK_ISN, DUMMY_OBJECT); } /** - * IsNotNull(is not null). And OnceRegistered. + * IsNotNull(is not null). And OnlyOnceRegistered. */ public void setTelephone_IsNotNull() { regTelephone(CK_ISNN, DUMMY_OBJECT); @@ -1104,7 +1038,7 @@ abstract protected ConditionValue getCValueTelephone(); /** - * Equal(=). And NullIgnored, OnceRegistered. {NotNull : TIMESTAMP} + * Equal(=). And NullIgnored, OnlyOnceRegistered. {NotNull : TIMESTAMP} * * @param createdTime The value of createdTime as equal. */ @@ -1113,7 +1047,7 @@ } /** - * NotEqual(!=). And NullIgnored, OnceRegistered. + * NotEqual(!=). And NullIgnored, OnlyOnceRegistered. * * @param createdTime The value of createdTime as notEqual. */ @@ -1122,7 +1056,7 @@ } /** - * GreaterThan(>). And NullIgnored, OnceRegistered. + * GreaterThan(>). And NullIgnored, OnlyOnceRegistered. * * @param createdTime The value of createdTime as greaterThan. */ @@ -1131,7 +1065,7 @@ } /** - * LessThan(>). And NullIgnored, OnceRegistered. + * LessThan(>). And NullIgnored, OnlyOnceRegistered. * * @param createdTime The value of createdTime as lessThan. */ @@ -1140,7 +1074,7 @@ } /** - * GreaterEqual(>). And NullIgnored, OnceRegistered. + * GreaterEqual(>). And NullIgnored, OnlyOnceRegistered. * * @param createdTime The value of createdTime as greaterEqual. */ @@ -1149,7 +1083,7 @@ } /** - * LessEqual(>). And NullIgnored, OnceRegistered. + * LessEqual(>). And NullIgnored, OnlyOnceRegistered. * * @param createdTime The value of createdTime as lessEqual. */ @@ -1159,7 +1093,7 @@ /** * FromTo($fromDate <= COLUMN_NAME <= $toDate). And NullIgnored, - * OnceRegistered. {NotNull : TIMESTAMP} + * OnlyOnceRegistered. {NotNull : TIMESTAMP} * * @param fromDate The from-date of createdTime. (Nullable) * @param toDate The to-date of createdTime. (Nullable) @@ -1177,7 +1111,7 @@ /** * FromTo($fromDate <= COLUMN_NAME < $toDate + 1). And NullIgnored, - * OnceRegistered. {NotNull : TIMESTAMP} + * OnlyOnceRegistered. {NotNull : TIMESTAMP} * * @param fromDate The from-date of createdTime. (Nullable) * @param toDate The to-date of createdTime. (Nullable) @@ -1203,7 +1137,7 @@ abstract protected ConditionValue getCValueCreatedTime(); /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {NotNull : + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {NotNull : * VARCHAR(255)} * * @param createdBy The value of createdBy as equal. @@ -1213,7 +1147,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param createdBy The value of createdBy as notEqual. */ @@ -1222,7 +1156,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param createdBy The value of createdBy as greaterThan. */ @@ -1231,7 +1165,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param createdBy The value of createdBy as lessThan. */ @@ -1240,7 +1174,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param createdBy The value of createdBy as greaterEqual. */ @@ -1249,7 +1183,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param createdBy The value of createdBy as lessEqual. */ @@ -1258,7 +1192,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param createdBy The value of createdBy as prefixSearch. */ @@ -1267,20 +1201,6 @@ } /** - * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, - * SeveralRegistered. - * - * @param createdBy The value of createdBy as likeSearch. - * @param likeSearchOption The option of like-search. (NotNull) - */ - public void setCreatedBy_LikeSearch( - String createdBy, - jp.sf.pal.timecard.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { - registerLikeSearchQuery(CK_LS, fRES(createdBy), getCValueCreatedBy(), - "CREATED_BY", "CreatedBy", "createdBy", likeSearchOption); - } - - /** * InScope(in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * @@ -1291,27 +1211,41 @@ } /** - * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * - * @param createdBy The collection of createdBy as inScope. - * @param inScopeOption The option of in-scope. (NotNull) + * @param createdByList The collection of createdBy as notInScope. */ - public void setCreatedBy_InScope( + public void setCreatedBy_NotInScope(Collection createdByList) { + regCreatedBy(CK_NINS, cTL(createdByList)); + } + + /** + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param createdBy The value of createdBy as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) + */ + public void setCreatedBy_LikeSearch( String createdBy, - jp.sf.pal.timecard.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(createdBy), getCValueCreatedBy(), - "CREATED_BY", "CreatedBy", "createdBy", inScopeOption); + jp.sf.pal.timecard.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(createdBy), getCValueCreatedBy(), "CREATED_BY", + "CreatedBy", "createdBy", likeSearchOption); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param createdByList The collection of createdBy as notInScope. + * @param createdBy The value of createdBy as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setCreatedBy_NotInScope(Collection createdByList) { - regCreatedBy(CK_NINS, cTL(createdByList)); + public void setCreatedBy_NotLikeSearch( + String createdBy, + jp.sf.pal.timecard.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(createdBy), getCValueCreatedBy(), "CREATED_BY", + "CreatedBy", "createdBy", likeSearchOption); } protected void regCreatedBy(ConditionKey key, Object value) { @@ -1327,7 +1261,7 @@ abstract protected ConditionValue getCValueCreatedBy(); /** - * Equal(=). And NullIgnored, OnceRegistered. {NotNull : TIMESTAMP} + * Equal(=). And NullIgnored, OnlyOnceRegistered. {NotNull : TIMESTAMP} * * @param updatedTime The value of updatedTime as equal. */ @@ -1336,7 +1270,7 @@ } /** - * NotEqual(!=). And NullIgnored, OnceRegistered. + * NotEqual(!=). And NullIgnored, OnlyOnceRegistered. * * @param updatedTime The value of updatedTime as notEqual. */ @@ -1345,7 +1279,7 @@ } /** - * GreaterThan(>). And NullIgnored, OnceRegistered. + * GreaterThan(>). And NullIgnored, OnlyOnceRegistered. * * @param updatedTime The value of updatedTime as greaterThan. */ @@ -1354,7 +1288,7 @@ } /** - * LessThan(>). And NullIgnored, OnceRegistered. + * LessThan(>). And NullIgnored, OnlyOnceRegistered. * * @param updatedTime The value of updatedTime as lessThan. */ @@ -1363,7 +1297,7 @@ } /** - * GreaterEqual(>). And NullIgnored, OnceRegistered. + * GreaterEqual(>). And NullIgnored, OnlyOnceRegistered. * * @param updatedTime The value of updatedTime as greaterEqual. */ @@ -1372,7 +1306,7 @@ } /** - * LessEqual(>). And NullIgnored, OnceRegistered. + * LessEqual(>). And NullIgnored, OnlyOnceRegistered. * * @param updatedTime The value of updatedTime as lessEqual. */ @@ -1382,7 +1316,7 @@ /** * FromTo($fromDate <= COLUMN_NAME <= $toDate). And NullIgnored, - * OnceRegistered. {NotNull : TIMESTAMP} + * OnlyOnceRegistered. {NotNull : TIMESTAMP} * * @param fromDate The from-date of updatedTime. (Nullable) * @param toDate The to-date of updatedTime. (Nullable) @@ -1400,7 +1334,7 @@ /** * FromTo($fromDate <= COLUMN_NAME < $toDate + 1). And NullIgnored, - * OnceRegistered. {NotNull : TIMESTAMP} + * OnlyOnceRegistered. {NotNull : TIMESTAMP} * * @param fromDate The from-date of updatedTime. (Nullable) * @param toDate The to-date of updatedTime. (Nullable) @@ -1426,7 +1360,7 @@ abstract protected ConditionValue getCValueUpdatedTime(); /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {NotNull : + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {NotNull : * VARCHAR(255)} * * @param updatedBy The value of updatedBy as equal. @@ -1436,7 +1370,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param updatedBy The value of updatedBy as notEqual. */ @@ -1445,7 +1379,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param updatedBy The value of updatedBy as greaterThan. */ @@ -1454,7 +1388,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param updatedBy The value of updatedBy as lessThan. */ @@ -1463,7 +1397,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param updatedBy The value of updatedBy as greaterEqual. */ @@ -1472,7 +1406,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param updatedBy The value of updatedBy as lessEqual. */ @@ -1481,7 +1415,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param updatedBy The value of updatedBy as prefixSearch. */ @@ -1490,20 +1424,6 @@ } /** - * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, - * SeveralRegistered. - * - * @param updatedBy The value of updatedBy as likeSearch. - * @param likeSearchOption The option of like-search. (NotNull) - */ - public void setUpdatedBy_LikeSearch( - String updatedBy, - jp.sf.pal.timecard.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { - registerLikeSearchQuery(CK_LS, fRES(updatedBy), getCValueUpdatedBy(), - "UPDATED_BY", "UpdatedBy", "updatedBy", likeSearchOption); - } - - /** * InScope(in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * @@ -1514,27 +1434,41 @@ } /** - * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * - * @param updatedBy The collection of updatedBy as inScope. - * @param inScopeOption The option of in-scope. (NotNull) + * @param updatedByList The collection of updatedBy as notInScope. */ - public void setUpdatedBy_InScope( + public void setUpdatedBy_NotInScope(Collection updatedByList) { + regUpdatedBy(CK_NINS, cTL(updatedByList)); + } + + /** + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param updatedBy The value of updatedBy as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) + */ + public void setUpdatedBy_LikeSearch( String updatedBy, - jp.sf.pal.timecard.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(updatedBy), getCValueUpdatedBy(), - "UPDATED_BY", "UpdatedBy", "updatedBy", inScopeOption); + jp.sf.pal.timecard.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(updatedBy), getCValueUpdatedBy(), "UPDATED_BY", + "UpdatedBy", "updatedBy", likeSearchOption); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param updatedByList The collection of updatedBy as notInScope. + * @param updatedBy The value of updatedBy as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setUpdatedBy_NotInScope(Collection updatedByList) { - regUpdatedBy(CK_NINS, cTL(updatedByList)); + public void setUpdatedBy_NotLikeSearch( + String updatedBy, + jp.sf.pal.timecard.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(updatedBy), getCValueUpdatedBy(), "UPDATED_BY", + "UpdatedBy", "updatedBy", likeSearchOption); } protected void regUpdatedBy(ConditionKey key, Object value) { @@ -1550,7 +1484,7 @@ abstract protected ConditionValue getCValueUpdatedBy(); /** - * Equal(=). And NullIgnored, OnceRegistered. {TIMESTAMP} + * Equal(=). And NullIgnored, OnlyOnceRegistered. {TIMESTAMP} * * @param deletedTime The value of deletedTime as equal. */ @@ -1559,7 +1493,7 @@ } /** - * NotEqual(!=). And NullIgnored, OnceRegistered. + * NotEqual(!=). And NullIgnored, OnlyOnceRegistered. * * @param deletedTime The value of deletedTime as notEqual. */ @@ -1568,7 +1502,7 @@ } /** - * GreaterThan(>). And NullIgnored, OnceRegistered. + * GreaterThan(>). And NullIgnored, OnlyOnceRegistered. * * @param deletedTime The value of deletedTime as greaterThan. */ @@ -1577,7 +1511,7 @@ } /** - * LessThan(>). And NullIgnored, OnceRegistered. + * LessThan(>). And NullIgnored, OnlyOnceRegistered. * * @param deletedTime The value of deletedTime as lessThan. */ @@ -1586,7 +1520,7 @@ } /** - * GreaterEqual(>). And NullIgnored, OnceRegistered. + * GreaterEqual(>). And NullIgnored, OnlyOnceRegistered. * * @param deletedTime The value of deletedTime as greaterEqual. */ @@ -1595,7 +1529,7 @@ } /** - * LessEqual(>). And NullIgnored, OnceRegistered. + * LessEqual(>). And NullIgnored, OnlyOnceRegistered. * * @param deletedTime The value of deletedTime as lessEqual. */ @@ -1605,7 +1539,7 @@ /** * FromTo($fromDate <= COLUMN_NAME <= $toDate). And NullIgnored, - * OnceRegistered. {TIMESTAMP} + * OnlyOnceRegistered. {TIMESTAMP} * * @param fromDate The from-date of deletedTime. (Nullable) * @param toDate The to-date of deletedTime. (Nullable) @@ -1623,7 +1557,7 @@ /** * FromTo($fromDate <= COLUMN_NAME < $toDate + 1). And NullIgnored, - * OnceRegistered. {TIMESTAMP} + * OnlyOnceRegistered. {TIMESTAMP} * * @param fromDate The from-date of deletedTime. (Nullable) * @param toDate The to-date of deletedTime. (Nullable) @@ -1637,14 +1571,14 @@ } /** - * IsNull(is null). And OnceRegistered. + * IsNull(is null). And OnlyOnceRegistered. */ public void setDeletedTime_IsNull() { regDeletedTime(CK_ISN, DUMMY_OBJECT); } /** - * IsNotNull(is not null). And OnceRegistered. + * IsNotNull(is not null). And OnlyOnceRegistered. */ public void setDeletedTime_IsNotNull() { regDeletedTime(CK_ISNN, DUMMY_OBJECT); @@ -1663,7 +1597,7 @@ abstract protected ConditionValue getCValueDeletedTime(); /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {VARCHAR(255)} + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {VARCHAR(255)} * * @param deletedBy The value of deletedBy as equal. */ @@ -1672,7 +1606,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param deletedBy The value of deletedBy as notEqual. */ @@ -1681,7 +1615,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param deletedBy The value of deletedBy as greaterThan. */ @@ -1690,7 +1624,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param deletedBy The value of deletedBy as lessThan. */ @@ -1699,7 +1633,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param deletedBy The value of deletedBy as greaterEqual. */ @@ -1708,7 +1642,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param deletedBy The value of deletedBy as lessEqual. */ @@ -1717,7 +1651,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param deletedBy The value of deletedBy as prefixSearch. */ @@ -1726,20 +1660,6 @@ } /** - * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, - * SeveralRegistered. - * - * @param deletedBy The value of deletedBy as likeSearch. - * @param likeSearchOption The option of like-search. (NotNull) - */ - public void setDeletedBy_LikeSearch( - String deletedBy, - jp.sf.pal.timecard.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { - registerLikeSearchQuery(CK_LS, fRES(deletedBy), getCValueDeletedBy(), - "DELETED_BY", "DeletedBy", "deletedBy", likeSearchOption); - } - - /** * InScope(in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * @@ -1750,38 +1670,52 @@ } /** - * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * - * @param deletedBy The collection of deletedBy as inScope. - * @param inScopeOption The option of in-scope. (NotNull) + * @param deletedByList The collection of deletedBy as notInScope. */ - public void setDeletedBy_InScope( + public void setDeletedBy_NotInScope(Collection deletedByList) { + regDeletedBy(CK_NINS, cTL(deletedByList)); + } + + /** + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param deletedBy The value of deletedBy as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) + */ + public void setDeletedBy_LikeSearch( String deletedBy, - jp.sf.pal.timecard.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(deletedBy), getCValueDeletedBy(), - "DELETED_BY", "DeletedBy", "deletedBy", inScopeOption); + jp.sf.pal.timecard.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(deletedBy), getCValueDeletedBy(), "DELETED_BY", + "DeletedBy", "deletedBy", likeSearchOption); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param deletedByList The collection of deletedBy as notInScope. + * @param deletedBy The value of deletedBy as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setDeletedBy_NotInScope(Collection deletedByList) { - regDeletedBy(CK_NINS, cTL(deletedByList)); + public void setDeletedBy_NotLikeSearch( + String deletedBy, + jp.sf.pal.timecard.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(deletedBy), getCValueDeletedBy(), "DELETED_BY", + "DeletedBy", "deletedBy", likeSearchOption); } /** - * IsNull(is null). And OnceRegistered. + * IsNull(is null). And OnlyOnceRegistered. */ public void setDeletedBy_IsNull() { regDeletedBy(CK_ISN, DUMMY_OBJECT); } /** - * IsNotNull(is not null). And OnceRegistered. + * IsNotNull(is not null). And OnlyOnceRegistered. */ public void setDeletedBy_IsNotNull() { regDeletedBy(CK_ISNN, DUMMY_OBJECT); @@ -1800,7 +1734,7 @@ abstract protected ConditionValue getCValueDeletedBy(); /** - * Equal(=). And NullIgnored, OnceRegistered. {NotNull : INTEGER} + * Equal(=). And NullIgnored, OnlyOnceRegistered. {NotNull : INTEGER} * * @param versionno The value of versionno as equal. */ @@ -1809,7 +1743,7 @@ } /** - * NotEqual(!=). And NullIgnored, OnceRegistered. + * NotEqual(!=). And NullIgnored, OnlyOnceRegistered. * * @param versionno The value of versionno as notEqual. */ @@ -1818,7 +1752,7 @@ } /** - * GreaterThan(>). And NullIgnored, OnceRegistered. + * GreaterThan(>). And NullIgnored, OnlyOnceRegistered. * * @param versionno The value of versionno as greaterThan. */ @@ -1827,7 +1761,7 @@ } /** - * LessThan(<). And NullIgnored, OnceRegistered. + * LessThan(<). And NullIgnored, OnlyOnceRegistered. * * @param versionno The value of versionno as lessThan. */ @@ -1836,7 +1770,7 @@ } /** - * GreaterEqual(>=). And NullIgnored, OnceRegistered. + * GreaterEqual(>=). And NullIgnored, OnlyOnceRegistered. * * @param versionno The value of versionno as greaterEqual. */ @@ -1845,7 +1779,7 @@ } /** - * LessEqual(<=). And NullIgnored, OnceRegistered. + * LessEqual(<=). And NullIgnored, OnlyOnceRegistered. * * @param versionno The value of versionno as lessEqual. */ @@ -1885,6 +1819,50 @@ abstract protected ConditionValue getCValueVersionno(); + public SSQFunction scalar_Equal() { + return xcreateSSQFunction("="); + } + + public SSQFunction scalar_GreaterEqual() { + return xcreateSSQFunction(">="); + } + + public SSQFunction scalar_GreaterThan() { + return xcreateSSQFunction(">"); + } + + public SSQFunction scalar_LessEqual() { + return xcreateSSQFunction("<="); + } + + public SSQFunction scalar_LessThan() { + return xcreateSSQFunction("<"); + } + + protected SSQFunction xcreateSSQFunction(final String operand) { + return new SSQFunction(new SSQSetupper() { + public void setup(String function, SubQuery subQuery) { + xscalarSubQuery(function, subQuery, operand); + } + }); + } + + protected void xscalarSubQuery(String function, + SubQuery subQuery, String operand) { + assertObjectNotNull("subQuery", subQuery); + GroupInfoCB cb = new GroupInfoCB(); + cb.xsetupForScalarSubQuery(); + subQuery.query(cb); + String subQueryPropertyName = keepScalarSubQuery(cb.query()); // for + // saving + // query + // -value. + registerScalarSubQuery(function, cb.query(), subQueryPropertyName, + operand); + } + + public abstract String keepScalarSubQuery(GroupInfoCQ subQuery); + // Very Internal (for Suppressing Warn about 'Not Use Import') protected String getConditionBeanClassNameInternally() { return GroupInfoCB.class.getName(); Modified: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/cbean/cq/bs/AbstractBsGroupMappingCQ.java =================================================================== --- timecard/trunk/src/main/java/jp/sf/pal/timecard/db/cbean/cq/bs/AbstractBsGroupMappingCQ.java 2008-12-27 22:18:30 UTC (rev 1630) +++ timecard/trunk/src/main/java/jp/sf/pal/timecard/db/cbean/cq/bs/AbstractBsGroupMappingCQ.java 2008-12-27 22:20:25 UTC (rev 1631) @@ -11,16 +11,13 @@ import jp.sf.pal.timecard.db.cbean.GroupInfoCB; import jp.sf.pal.timecard.db.cbean.GroupMappingCB; import jp.sf.pal.timecard.db.cbean.UserInfoCB; -import jp.sf.pal.timecard.db.cbean.cq.GroupInfoCQ; import jp.sf.pal.timecard.db.cbean.cq.GroupMappingCQ; -import jp.sf.pal.timecard.db.cbean.cq.UserInfoCQ; /** * The abstract condition-query of GROUP_MAPPING. * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public abstract class AbstractBsGroupMappingCQ extends AbstractConditionQuery { //========================================================================== @@ -50,7 +47,8 @@ // ===== /** - * Equal(=). And NullIgnored, OnceRegistered. {PK : ID : NotNull : INTEGER} + * Equal(=). And NullIgnored, OnlyOnceRegistered. {PK : ID : NotNull : + * INTEGER} * * @param id The value of id as equal. */ @@ -59,7 +57,7 @@ } /** - * NotEqual(!=). And NullIgnored, OnceRegistered. + * NotEqual(!=). And NullIgnored, OnlyOnceRegistered. * * @param id The value of id as notEqual. */ @@ -68,7 +66,7 @@ } /** - * GreaterThan(>). And NullIgnored, OnceRegistered. + * GreaterThan(>). And NullIgnored, OnlyOnceRegistered. * * @param id The value of id as greaterThan. */ @@ -77,7 +75,7 @@ } /** - * LessThan(<). And NullIgnored, OnceRegistered. + * LessThan(<). And NullIgnored, OnlyOnceRegistered. * * @param id The value of id as lessThan. */ @@ -86,7 +84,7 @@ } /** - * GreaterEqual(>=). And NullIgnored, OnceRegistered. + * GreaterEqual(>=). And NullIgnored, OnlyOnceRegistered. * * @param id The value of id as greaterEqual. */ @@ -95,7 +93,7 @@ } /** - * LessEqual(<=). And NullIgnored, OnceRegistered. + * LessEqual(<=). And NullIgnored, OnlyOnceRegistered. * * @param id The value of id as lessEqual. */ @@ -124,14 +122,14 @@ } /** - * IsNull(is null). And OnceRegistered. + * IsNull(is null). And OnlyOnceRegistered. */ public void setId_IsNull() { regId(CK_ISN, DUMMY_OBJECT); } /** - * IsNotNull(is not null). And OnceRegistered. + * IsNotNull(is not null). And OnlyOnceRegistered. */ public void setId_IsNotNull() { regId(CK_ISNN, DUMMY_OBJECT); @@ -148,8 +146,8 @@ abstract protected ConditionValue getCValueId(); /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {NotNull : VARCHAR(255) - * : FK to USER_INFO} + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {NotNull : + * VARCHAR(255) : FK to USER_INFO} * * @param userId The value of userId as equal. */ @@ -158,7 +156,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param userId The value of userId as notEqual. */ @@ -167,7 +165,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param userId The value of userId as greaterThan. */ @@ -176,7 +174,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param userId The value of userId as lessThan. */ @@ -185,7 +183,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param userId The value of userId as greaterEqual. */ @@ -194,7 +192,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param userId The value of userId as lessEqual. */ @@ -203,7 +201,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param userId The value of userId as prefixSearch. */ @@ -212,20 +210,6 @@ } /** - * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, - * SeveralRegistered. - * - * @param userId The value of userId as likeSearch. - * @param likeSearchOption The option of like-search. (NotNull) - */ - public void setUserId_LikeSearch( - String userId, - jp.sf.pal.timecard.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { - registerLikeSearchQuery(CK_LS, fRES(userId), getCValueUserId(), - "USER_ID", "UserId", "userId", likeSearchOption); - } - - /** * InScope(in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * @@ -236,42 +220,41 @@ } /** - * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * - * @param userId The collection of userId as inScope. - * @param inScopeOption The option of in-scope. (NotNull) + * @param userIdList The collection of userId as notInScope. */ - public void setUserId_InScope( - String userId, - jp.sf.pal.timecard.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(userId), getCValueUserId(), - "USER_ID", "UserId", "userId", inScopeOption); + public void setUserId_NotInScope(Collection userIdList) { + regUserId(CK_NINS, cTL(userIdList)); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param userIdList The collection of userId as notInScope. + * @param userId The value of userId as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) */ - public void setUserId_NotInScope(Collection userIdList) { - regUserId(CK_NINS, cTL(userIdList)); + public void setUserId_LikeSearch( + String userId, + jp.sf.pal.timecard.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(userId), getCValueUserId(), "USER_ID", "UserId", + "userId", likeSearchOption); } /** - * @param userInfoCBquery Query. - * @deprecated Please use inScopeUserInfo(subQuery) method. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param userId The value of userId as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setUserId_InScopeSubQuery_UserInfo(UserInfoCQ userInfoCBquery) { - String subQueryPropertyName = keepUserId_InScopeSubQuery_UserInfo(userInfoCBquery);// for - // saving - // query - // - - // value - // . - registerInScopeSubQuery(userInfoCBquery, "USER_ID", "USER_ID", - subQueryPropertyName); + public void setUserId_NotLikeSearch( + String userId, + jp.sf.pal.timecard.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(userId), getCValueUserId(), "USER_ID", "UserId", + "userId", likeSearchOption); } public void inScopeUserInfo(SubQuery subQuery) { @@ -280,12 +263,12 @@ cb.xsetupForInScopeSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepUserId_InScopeSubQuery_UserInfo(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerInScopeSubQuery(cb.query(), "USER_ID", "USER_ID", subQueryPropertyName); } - abstract public String keepUserId_InScopeSubQuery_UserInfo( + public abstract String keepUserId_InScopeSubQuery_UserInfo( jp.sf.pal.timecard.db.cbean.cq.UserInfoCQ subQuery); protected void regUserId(ConditionKey key, Object value) { @@ -301,8 +284,8 @@ abstract protected ConditionValue getCValueUserId(); /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {NotNull : VARCHAR(255) - * : FK to GROUP_INFO} + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {NotNull : + * VARCHAR(255) : FK to GROUP_INFO} * * @param groupId The value of groupId as equal. */ @@ -311,7 +294,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param groupId The value of groupId as notEqual. */ @@ -320,7 +303,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param groupId The value of groupId as greaterThan. */ @@ -329,7 +312,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param groupId The value of groupId as lessThan. */ @@ -338,7 +321,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param groupId The value of groupId as greaterEqual. */ @@ -347,7 +330,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param groupId The value of groupId as lessEqual. */ @@ -356,7 +339,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param groupId The value of groupId as prefixSearch. */ @@ -365,20 +348,6 @@ } /** - * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, - * SeveralRegistered. - * - * @param groupId The value of groupId as likeSearch. - * @param likeSearchOption The option of like-search. (NotNull) - */ - public void setGroupId_LikeSearch( - String groupId, - jp.sf.pal.timecard.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { - registerLikeSearchQuery(CK_LS, fRES(groupId), getCValueGroupId(), - "GROUP_ID", "GroupId", "groupId", likeSearchOption); - } - - /** * InScope(in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * @@ -389,43 +358,41 @@ } /** - * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * - * @param groupId The collection of groupId as inScope. - * @param inScopeOption The option of in-scope. (NotNull) + * @param groupIdList The collection of groupId as notInScope. */ - public void setGroupId_InScope( - String groupId, - jp.sf.pal.timecard.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(groupId), getCValueGroupId(), - "GROUP_ID", "GroupId", "groupId", inScopeOption); + public void setGroupId_NotInScope(Collection groupIdList) { + regGroupId(CK_NINS, cTL(groupIdList)); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param groupIdList The collection of groupId as notInScope. + * @param groupId The value of groupId as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) */ - public void setGroupId_NotInScope(Collection groupIdList) { - regGroupId(CK_NINS, cTL(groupIdList)); + public void setGroupId_LikeSearch( + String groupId, + jp.sf.pal.timecard.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(groupId), getCValueGroupId(), "GROUP_ID", "GroupId", + "groupId", likeSearchOption); } /** - * @param groupInfoCBquery Query. - * @deprecated Please use inScopeGroupInfo(subQuery) method. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param groupId The value of groupId as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setGroupId_InScopeSubQuery_GroupInfo( - GroupInfoCQ groupInfoCBquery) { - String subQueryPropertyName = keepGroupId_InScopeSubQuery_GroupInfo(groupInfoCBquery);// for - // saving - // query - // - - // value - // . - registerInScopeSubQuery(groupInfoCBquery, "GROUP_ID", "GROUP_ID", - subQueryPropertyName); + public void setGroupId_NotLikeSearch( + String groupId, + jp.sf.pal.timecard.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(groupId), getCValueGroupId(), "GROUP_ID", + "GroupId", "groupId", likeSearchOption); } public void inScopeGroupInfo(SubQuery subQuery) { @@ -434,12 +401,12 @@ cb.xsetupForInScopeSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepGroupId_InScopeSubQuery_GroupInfo(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerInScopeSubQuery(cb.query(), "GROUP_ID", "GROUP_ID", subQueryPropertyName); } - abstract public String keepGroupId_InScopeSubQuery_GroupInfo( + public abstract String keepGroupId_InScopeSubQuery_GroupInfo( jp.sf.pal.timecard.db.cbean.cq.GroupInfoCQ subQuery); protected void regGroupId(ConditionKey key, Object value) { @@ -454,6 +421,53 @@ abstract protected ConditionValue getCValueGroupId(); + public SSQFunction scalar_Equal() { + return xcreateSSQFunction("="); + } + + public SSQFunction scalar_GreaterEqual() { + return xcreateSSQFunction(">="); + } + + public SSQFunction scalar_GreaterThan() { + return xcreateSSQFunction(">"); + } + + public SSQFunction scalar_LessEqual() { + return xcreateSSQFunction("<="); + } + + public SSQFunction scalar_LessThan() { + return xcreateSSQFunction("<"); + } + + protected SSQFunction xcreateSSQFunction( + final String operand) { + return new SSQFunction( + new SSQSetupper() { + public void setup(String function, + SubQuery subQuery) { + xscalarSubQuery(function, subQuery, operand); + } + }); + } + + protected void xscalarSubQuery(String function, + SubQuery subQuery, String operand) { + assertObjectNotNull("subQuery", subQuery); + GroupMappingCB cb = new GroupMappingCB(); + cb.xsetupForScalarSubQuery(); + subQuery.query(cb); + String subQueryPropertyName = keepScalarSubQuery(cb.query()); // for + // saving + // query + // -value. + registerScalarSubQuery(function, cb.query(), subQueryPropertyName, + operand); + } + + public abstract String keepScalarSubQuery(GroupMappingCQ subQuery); + // Very Internal (for Suppressing Warn about 'Not Use Import') protected String getConditionBeanClassNameInternally() { return GroupMappingCB.class.getName(); Modified: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/cbean/cq/bs/AbstractBsMonthlyReportCQ.java =================================================================== --- timecard/trunk/src/main/java/jp/sf/pal/timecard/db/cbean/cq/bs/AbstractBsMonthlyReportCQ.java 2008-12-27 22:18:30 UTC (rev 1630) +++ timecard/trunk/src/main/java/jp/sf/pal/timecard/db/cbean/cq/bs/AbstractBsMonthlyReportCQ.java 2008-12-27 22:20:25 UTC (rev 1631) @@ -22,7 +22,6 @@ * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public abstract class AbstractBsMonthlyReportCQ extends AbstractConditionQuery { //========================================================================== @@ -52,7 +51,8 @@ // ===== /** - * Equal(=). And NullIgnored, OnceRegistered. {PK : ID : NotNull : BIGINT} + * Equal(=). And NullIgnored, OnlyOnceRegistered. {PK : ID : NotNull : + * BIGINT} * * @param id The value of id as equal. */ @@ -61,7 +61,7 @@ } /** - * NotEqual(!=). And NullIgnored, OnceRegistered. + * NotEqual(!=). And NullIgnored, OnlyOnceRegistered. * * @param id The value of id as notEqual. */ @@ -70,7 +70,7 @@ } /** - * GreaterThan(>). And NullIgnored, OnceRegistered. + * GreaterThan(>). And NullIgnored, OnlyOnceRegistered. * * @param id The value of id as greaterThan. */ @@ -79,7 +79,7 @@ } /** - * LessThan(<). And NullIgnored, OnceRegistered. + * LessThan(<). And NullIgnored, OnlyOnceRegistered. * * @param id The value of id as lessThan. */ @@ -88,7 +88,7 @@ } /** - * GreaterEqual(>=). And NullIgnored, OnceRegistered. + * GreaterEqual(>=). And NullIgnored, OnlyOnceRegistered. * * @param id The value of id as greaterEqual. */ @@ -97,7 +97,7 @@ } /** - * LessEqual(<=). And NullIgnored, OnceRegistered. + * LessEqual(<=). And NullIgnored, OnlyOnceRegistered. * * @param id The value of id as lessEqual. */ @@ -125,52 +125,20 @@ regId(CK_NINS, cTL(idList)); } - /** - * @param dailyReportCBquery Query. - * @deprecated Please use inScopeDailyReportList(subQuery) method. - */ - public void setId_InScopeSubQuery_DailyReportList( - DailyReportCQ dailyReportCBquery) { - String subQueryPropertyName = keepId_InScopeSubQuery_DailyReportList(dailyReportCBquery);// for - // saving - // query - // - - // value - // . - registerInScopeSubQuery(dailyReportCBquery, "ID", "MONTHLY_REPORT_ID", - subQueryPropertyName); - } - public void inScopeDailyReportList(SubQuery subQuery) { assertObjectNotNull("subQuery", subQuery); DailyReportCB cb = new DailyReportCB(); cb.xsetupForInScopeSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepId_InScopeSubQuery_DailyReportList(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerInScopeSubQuery(cb.query(), "ID", "MONTHLY_REPORT_ID", subQueryPropertyName); } - abstract public String keepId_InScopeSubQuery_DailyReportList( + public abstract String keepId_InScopeSubQuery_DailyReportList( DailyReportCQ subQuery); - /** - * @param monthlyWorkingReportCBquery Query. - * @deprecated Please use inScopeMonthlyWorkingReportList(subQuery) method. - */ - public void setId_InScopeSubQuery_MonthlyWorkingReportList( - MonthlyWorkingReportCQ monthlyWorkingReportCBquery) { - String subQueryPropertyName = keepId_InScopeSubQuery_MonthlyWorkingReportList(monthlyWorkingReportCBquery);// for - // saving - // query - // - - // value - // . - registerInScopeSubQuery(monthlyWorkingReportCBquery, "ID", - "MONTHLY_REPORT_ID", subQueryPropertyName); - } - public void inScopeMonthlyWorkingReportList( SubQuery subQuery) { assertObjectNotNull("subQuery", subQuery); @@ -178,12 +146,12 @@ cb.xsetupForInScopeSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepId_InScopeSubQuery_MonthlyWorkingReportList(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerInScopeSubQuery(cb.query(), "ID", "MONTHLY_REPORT_ID", subQueryPropertyName); } - abstract public String keepId_InScopeSubQuery_MonthlyWorkingReportList( + public abstract String keepId_InScopeSubQuery_MonthlyWorkingReportList( MonthlyWorkingReportCQ subQuery); public void notInScopeDailyReportList(SubQuery subQuery) { @@ -192,12 +160,12 @@ cb.xsetupForInScopeSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepId_NotInScopeSubQuery_DailyReportList(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerNotInScopeSubQuery(cb.query(), "ID", "MONTHLY_REPORT_ID", subQueryPropertyName); } - abstract public String keepId_NotInScopeSubQuery_DailyReportList( + public abstract String keepId_NotInScopeSubQuery_DailyReportList( DailyReportCQ subQuery); public void notInScopeMonthlyWorkingReportList( @@ -207,31 +175,15 @@ cb.xsetupForInScopeSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepId_NotInScopeSubQuery_MonthlyWorkingReportList(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerNotInScopeSubQuery(cb.query(), "ID", "MONTHLY_REPORT_ID", subQueryPropertyName); } - abstract public String keepId_NotInScopeSubQuery_MonthlyWorkingReportList( + public abstract String keepId_NotInScopeSubQuery_MonthlyWorkingReportList( MonthlyWorkingReportCQ subQuery); /** - * @param dailyReportCBquery Query. - * @deprecated Please use existsDailyReportList(subQuery) method. - */ - public void setId_ExistsSubQuery_DailyReportList( - DailyReportCQ dailyReportCBquery) { - String subQueryPropertyName = keepId_ExistsSubQuery_DailyReportList(dailyReportCBquery);// for - // saving - // query - // - - // value - // . - registerExistsSubQuery(dailyReportCBquery, "ID", "MONTHLY_REPORT_ID", - subQueryPropertyName); - } - - /** * Set up 'exists' sub-query. {exists (select MONTHLY_REPORT_ID from * DAILY_REPORT where ...)} * @@ -244,31 +196,15 @@ cb.xsetupForExistsSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepId_ExistsSubQuery_DailyReportList(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerExistsSubQuery(cb.query(), "ID", "MONTHLY_REPORT_ID", subQueryPropertyName); } - abstract public String keepId_ExistsSubQuery_DailyReportList( + public abstract String keepId_ExistsSubQuery_DailyReportList( DailyReportCQ subQuery); /** - * @param monthlyWorkingReportCBquery Query. - * @deprecated Please use existsMonthlyWorkingReportList(subQuery) method. - */ - public void setId_ExistsSubQuery_MonthlyWorkingReportList( - MonthlyWorkingReportCQ monthlyWorkingReportCBquery) { - String subQueryPropertyName = keepId_ExistsSubQuery_MonthlyWorkingReportList(monthlyWorkingReportCBquery);// for - // saving - // query - // - - // value - // . - registerExistsSubQuery(monthlyWorkingReportCBquery, "ID", - "MONTHLY_REPORT_ID", subQueryPropertyName); - } - - /** * Set up 'exists' sub-query. {exists (select MONTHLY_REPORT_ID from * MONTHLY_WORKING_REPORT where ...)} * @@ -283,12 +219,12 @@ cb.xsetupForExistsSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepId_ExistsSubQuery_MonthlyWorkingReportList(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerExistsSubQuery(cb.query(), "ID", "MONTHLY_REPORT_ID", subQueryPropertyName); } - abstract public String keepId_ExistsSubQuery_MonthlyWorkingReportList( + public abstract String keepId_ExistsSubQuery_MonthlyWorkingReportList( MonthlyWorkingReportCQ subQuery); /** @@ -304,12 +240,12 @@ cb.xsetupForExistsSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepId_NotExistsSubQuery_DailyReportList(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerNotExistsSubQuery(cb.query(), "ID", "MONTHLY_REPORT_ID", subQueryPropertyName); } - abstract public String keepId_NotExistsSubQuery_DailyReportList( + public abstract String keepId_NotExistsSubQuery_DailyReportList( DailyReportCQ subQuery); /** @@ -327,53 +263,53 @@ cb.xsetupForExistsSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepId_NotExistsSubQuery_MonthlyWorkingReportList(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerNotExistsSubQuery(cb.query(), "ID", "MONTHLY_REPORT_ID", subQueryPropertyName); } - abstract public String keepId_NotExistsSubQuery_MonthlyWorkingReportList( + public abstract String keepId_NotExistsSubQuery_MonthlyWorkingReportList( MonthlyWorkingReportCQ subQuery); public void xderiveDailyReportList(String function, SubQuery subQuery, String aliasName) { assertObjectNotNull("subQuery", subQuery); DailyReportCB cb = new DailyReportCB(); - cb.xsetupForDeriveReferrer(); + cb.xsetupForDerivedReferrer(); subQuery.query(cb); - String subQueryPropertyName = keepId_DeriveSubQuery_DailyReportList(cb - .query());// for saving query-value. - registerDeriveSubQuery(function, cb.query(), "ID", "MONTHLY_REPORT_ID", - subQueryPropertyName, aliasName); + String subQueryPropertyName = keepId_DerivedReferrer_DailyReportList(cb + .query()); // for saving query-value. + registerDerivedReferrerSubQuery(function, cb.query(), "ID", + "MONTHLY_REPORT_ID", subQueryPropertyName, aliasName); } - abstract public String keepId_DeriveSubQuery_DailyReportList( + public abstract String keepId_DerivedReferrer_DailyReportList( DailyReportCQ subQuery); public void xderiveMonthlyWorkingReportList(String function, SubQuery subQuery, String aliasName) { assertObjectNotNull("subQuery", subQuery); MonthlyWorkingReportCB cb = new MonthlyWorkingReportCB(); - cb.xsetupForDeriveReferrer(); + cb.xsetupForDerivedReferrer(); subQuery.query(cb); - String subQueryPropertyName = keepId_DeriveSubQuery_MonthlyWorkingReportList(cb - .query());// for saving query-value. - registerDeriveSubQuery(function, cb.query(), "ID", "MONTHLY_REPORT_ID", - subQueryPropertyName, aliasName); + String subQueryPropertyName = keepId_DerivedReferrer_MonthlyWorkingReportList(cb + .query()); // for saving query-value. + registerDerivedReferrerSubQuery(function, cb.query(), "ID", + "MONTHLY_REPORT_ID", subQueryPropertyName, aliasName); } - abstract public String keepId_DeriveSubQuery_MonthlyWorkingReportList( + public abstract String keepId_DerivedReferrer_MonthlyWorkingReportList( MonthlyWorkingReportCQ subQuery); /** - * IsNull(is null). And OnceRegistered. + * IsNull(is null). And OnlyOnceRegistered. */ public void setId_IsNull() { regId(CK_ISN, DUMMY_OBJECT); } /** - * IsNotNull(is not null). And OnceRegistered. + * IsNotNull(is not null). And OnlyOnceRegistered. */ public void setId_IsNotNull() { regId(CK_ISNN, DUMMY_OBJECT); @@ -390,7 +326,7 @@ abstract protected ConditionValue getCValueId(); /** - * Equal(=). And NullIgnored, OnceRegistered. {NotNull : INTEGER} + * Equal(=). And NullIgnored, OnlyOnceRegistered. {NotNull : INTEGER} * * @param year The value of year as equal. */ @@ -399,7 +335,7 @@ } /** - * NotEqual(!=). And NullIgnored, OnceRegistered. + * NotEqual(!=). And NullIgnored, OnlyOnceRegistered. * * @param year The value of year as notEqual. */ @@ -408,7 +344,7 @@ } /** - * GreaterThan(>). And NullIgnored, OnceRegistered. + * GreaterThan(>). And NullIgnored, OnlyOnceRegistered. * * @param year The value of year as greaterThan. */ @@ -417,7 +353,7 @@ } /** - * LessThan(<). And NullIgnored, OnceRegistered. + * LessThan(<). And NullIgnored, OnlyOnceRegistered. * * @param year The value of year as lessThan. */ @@ -426,7 +362,7 @@ } /** - * GreaterEqual(>=). And NullIgnored, OnceRegistered. + * GreaterEqual(>=). And NullIgnored, OnlyOnceRegistered. * * @param year The value of year as greaterEqual. */ @@ -435,7 +371,7 @@ } /** - * LessEqual(<=). And NullIgnored, OnceRegistered. + * LessEqual(<=). And NullIgnored, OnlyOnceRegistered. * * @param year The value of year as lessEqual. */ @@ -474,7 +410,7 @@ abstract protected ConditionValue getCValueYear(); /** - * Equal(=). And NullIgnored, OnceRegistered. {NotNull : INTEGER} + * Equal(=). And NullIgnored, OnlyOnceRegistered. {NotNull : INTEGER} * * @param month The value of month as equal. */ @@ -483,7 +419,7 @@ } /** - * NotEqual(!=). And NullIgnored, OnceRegistered. + * NotEqual(!=). And NullIgnored, OnlyOnceRegistered. * * @param month The value of month as notEqual. */ @@ -492,7 +428,7 @@ } /** - * GreaterThan(>). And NullIgnored, OnceRegistered. + * GreaterThan(>). And NullIgnored, OnlyOnceRegistered. * * @param month The value of month as greaterThan. */ @@ -501,7 +437,7 @@ } /** - * LessThan(<). And NullIgnored, OnceRegistered. + * LessThan(<). And NullIgnored, OnlyOnceRegistered. * * @param month The value of month as lessThan. */ @@ -510,7 +446,7 @@ } /** - * GreaterEqual(>=). And NullIgnored, OnceRegistered. + * GreaterEqual(>=). And NullIgnored, OnlyOnceRegistered. * * @param month The value of month as greaterEqual. */ @@ -519,7 +455,7 @@ } /** - * LessEqual(<=). And NullIgnored, OnceRegistered. + * LessEqual(<=). And NullIgnored, OnlyOnceRegistered. * * @param month The value of month as lessEqual. */ @@ -559,7 +495,7 @@ abstract protected ConditionValue getCValueMonth(); /** - * Equal(=). And NullIgnored, OnceRegistered. {NotNull : INTEGER : + * Equal(=). And NullIgnored, OnlyOnceRegistered. {NotNull : INTEGER : * Default=[1]} * * @param status The value of status as equal. @@ -569,7 +505,7 @@ } /** - * NotEqual(!=). And NullIgnored, OnceRegistered. + * NotEqual(!=). And NullIgnored, OnlyOnceRegistered. * * @param status The value of status as notEqual. */ @@ -578,7 +514,7 @@ } /** - * GreaterThan(>). And NullIgnored, OnceRegistered. + * GreaterThan(>). And NullIgnored, OnlyOnceRegistered. * * @param status The value of status as greaterThan. */ @@ -587,7 +523,7 @@ } /** - * LessThan(<). And NullIgnored, OnceRegistered. + * LessThan(<). And NullIgnored, OnlyOnceRegistered. * * @param status The value of status as lessThan. */ @@ -596,7 +532,7 @@ } /** - * GreaterEqual(>=). And NullIgnored, OnceRegistered. + * GreaterEqual(>=). And NullIgnored, OnlyOnceRegistered. * * @param status The value of status as greaterEqual. */ @@ -605,7 +541,7 @@ } /** - * LessEqual(<=). And NullIgnored, OnceRegistered. + * LessEqual(<=). And NullIgnored, OnlyOnceRegistered. * * @param status The value of status as lessEqual. */ @@ -646,7 +582,7 @@ abstract protected ConditionValue getCValueStatus(); /** - * Equal(=). And NullIgnored, OnceRegistered. {NotNull : DOUBLE : + * Equal(=). And NullIgnored, OnlyOnceRegistered. {NotNull : DOUBLE : * Default=[0]} * * @param stdWorkingDays The value of stdWorkingDays as equal. @@ -656,7 +592,7 @@ } /** - * NotEqual(!=). And NullIgnored, OnceRegistered. + * NotEqual(!=). And NullIgnored, OnlyOnceRegistered. * * @param stdWorkingDays The value of stdWorkingDays as notEqual. */ @@ -665,7 +601,7 @@ } /** - * GreaterThan(>). And NullIgnored, OnceRegistered. + * GreaterThan(>). And NullIgnored, OnlyOnceRegistered. * * @param stdWorkingDays The value of stdWorkingDays as greaterThan. */ @@ -675,7 +611,7 @@ } /** - * LessThan(<). And NullIgnored, OnceRegistered. + * LessThan(<). And NullIgnored, OnlyOnceRegistered. * * @param stdWorkingDays The value of stdWorkingDays as lessThan. */ @@ -684,7 +620,7 @@ } /** - * GreaterEqual(>=). And NullIgnored, OnceRegistered. + * GreaterEqual(>=). And NullIgnored, OnlyOnceRegistered. * * @param stdWorkingDays The value of stdWorkingDays as greaterEqual. */ @@ -694,7 +630,7 @@ } /** - * LessEqual(<=). And NullIgnored, OnceRegistered. + * LessEqual(<=). And NullIgnored, OnlyOnceRegistered. * * @param stdWorkingDays The value of stdWorkingDays as lessEqual. */ @@ -737,7 +673,7 @@ abstract protected ConditionValue getCValueStdWorkingDays(); /** - * Equal(=). And NullIgnored, OnceRegistered. {NotNull : BIGINT : + * Equal(=). And NullIgnored, OnlyOnceRegistered. {NotNull : BIGINT : * Default=[0]} * * @param workingTime The value of workingTime as equal. @@ -747,7 +683,7 @@ } /** - * NotEqual(!=). And NullIgnored, OnceRegistered. + * NotEqual(!=). And NullIgnored, OnlyOnceRegistered. * * @param workingTime The value of workingTime as notEqual. */ @@ -756,7 +692,7 @@ } /** - * GreaterThan(>). And NullIgnored, OnceRegistered. + * GreaterThan(>). And NullIgnored, OnlyOnceRegistered. * * @param workingTime The value of workingTime as greaterThan. */ @@ -765,7 +701,7 @@ } /** - * LessThan(<). And NullIgnored, OnceRegistered. + * LessThan(<). And NullIgnored, OnlyOnceRegistered. * * @param workingTime The value of workingTime as lessThan. */ @@ -774,7 +710,7 @@ } /** - * GreaterEqual(>=). And NullIgnored, OnceRegistered. + * GreaterEqual(>=). And NullIgnored, OnlyOnceRegistered. * * @param workingTime The value of workingTime as greaterEqual. */ @@ -783,7 +719,7 @@ } /** - * LessEqual(<=). And NullIgnored, OnceRegistered. + * LessEqual(<=). And NullIgnored, OnlyOnceRegistered. * * @param workingTime The value of workingTime as lessEqual. */ @@ -824,7 +760,7 @@ abstract protected ConditionValue getCValueWorkingTime(); /** - * Equal(=). And NullIgnored, OnceRegistered. {NotNull : BIGINT : + * Equal(=). And NullIgnored, OnlyOnceRegistered. {NotNull : BIGINT : * Default=[0]} * * @param stdWorkingTime The value of stdWorkingTime as equal. @@ -834,7 +770,7 @@ } /** - * NotEqual(!=). And NullIgnored, OnceRegistered. + * NotEqual(!=). And NullIgnored, OnlyOnceRegistered. * * @param stdWorkingTime The value of stdWorkingTime as notEqual. */ @@ -843,7 +779,7 @@ } /** - * GreaterThan(>). And NullIgnored, OnceRegistered. + * GreaterThan(>). And NullIgnored, OnlyOnceRegistered. * * @param stdWorkingTime The value of stdWorkingTime as greaterThan. */ @@ -852,7 +788,7 @@ } /** - * LessThan(<). And NullIgnored, OnceRegistered. + * LessThan(<). And NullIgnored, OnlyOnceRegistered. * * @param stdWorkingTime The value of stdWorkingTime as lessThan. */ @@ -861,7 +797,7 @@ } /** - * GreaterEqual(>=). And NullIgnored, OnceRegistered. + * GreaterEqual(>=). And NullIgnored, OnlyOnceRegistered. * * @param stdWorkingTime The value of stdWorkingTime as greaterEqual. */ @@ -870,7 +806,7 @@ } /** - * LessEqual(<=). And NullIgnored, OnceRegistered. + * LessEqual(<=). And NullIgnored, OnlyOnceRegistered. * * @param stdWorkingTime The value of stdWorkingTime as lessEqual. */ @@ -911,7 +847,7 @@ abstract protected ConditionValue getCValueStdWorkingTime(); /** - * Equal(=). And NullIgnored, OnceRegistered. {NotNull : BIGINT : + * Equal(=). And NullIgnored, OnlyOnceRegistered. {NotNull : BIGINT : * Default=[0]} * * @param overTime The value of overTime as equal. @@ -921,7 +857,7 @@ } /** - * NotEqual(!=). And NullIgnored, OnceRegistered. + * NotEqual(!=). And NullIgnored, OnlyOnceRegistered. * * @param overTime The value of overTime as notEqual. */ @@ -930,7 +866,7 @@ } /** - * GreaterThan(>). And NullIgnored, OnceRegistered. + * GreaterThan(>). And NullIgnored, OnlyOnceRegistered. * * @param overTime The value of overTime as greaterThan. */ @@ -939,7 +875,7 @@ } /** - * LessThan(<). And NullIgnored, OnceRegistered. + * LessThan(<). And NullIgnored, OnlyOnceRegistered. * * @param overTime The value of overTime as lessThan. */ @@ -948,7 +884,7 @@ } /** - * GreaterEqual(>=). And NullIgnored, OnceRegistered. + * GreaterEqual(>=). And NullIgnored, OnlyOnceRegistered. * * @param overTime The value of overTime as greaterEqual. */ @@ -957,7 +893,7 @@ } /** - * LessEqual(<=). And NullIgnored, OnceRegistered. + * LessEqual(<=). And NullIgnored, OnlyOnceRegistered. * * @param overTime The value of overTime as lessEqual. */ @@ -998,7 +934,7 @@ abstract protected ConditionValue getCValueOverTime(); /** - * Equal(=). And NullIgnored, OnceRegistered. {NotNull : BIGINT : + * Equal(=). And NullIgnored, OnlyOnceRegistered. {NotNull : BIGINT : * Default=[0]} * * @param mntOverTime The value of mntOverTime as equal. @@ -1008,7 +944,7 @@ } /** - * NotEqual(!=). And NullIgnored, OnceRegistered. + * NotEqual(!=). And NullIgnored, OnlyOnceRegistered. * * @param mntOverTime The value of mntOverTime as notEqual. */ @@ -1017,7 +953,7 @@ } /** - * GreaterThan(>). And NullIgnored, OnceRegistered. + * GreaterThan(>). And NullIgnored, OnlyOnceRegistered. * * @param mntOverTime The value of mntOverTime as greaterThan. */ @@ -1026,7 +962,7 @@ } /** - * LessThan(<). And NullIgnored, OnceRegistered. + * LessThan(<). And NullIgnored, OnlyOnceRegistered. * * @param mntOverTime The value of mntOverTime as lessThan. */ @@ -1035,7 +971,7 @@ } /** - * GreaterEqual(>=). And NullIgnored, OnceRegistered. + * GreaterEqual(>=). And NullIgnored, OnlyOnceRegistered. * * @param mntOverTime The value of mntOverTime as greaterEqual. */ @@ -1044,7 +980,7 @@ } /** - * LessEqual(<=). And NullIgnored, OnceRegistered. + * LessEqual(<=). And NullIgnored, OnlyOnceRegistered. * * @param mntOverTime The value of mntOverTime as lessEqual. */ @@ -1085,7 +1021,7 @@ abstract protected ConditionValue getCValueMntOverTime(); /** - * Equal(=). And NullIgnored, OnceRegistered. {NotNull : INTEGER : FK to + * Equal(=). And NullIgnored, OnlyOnceRegistered. {NotNull : INTEGER : FK to * EMPLOYEE} * * @param employeeId The value of employeeId as equal. @@ -1095,7 +1031,7 @@ } /** - * NotEqual(!=). And NullIgnored, OnceRegistered. + * NotEqual(!=). And NullIgnored, OnlyOnceRegistered. * * @param employeeId The value of employeeId as notEqual. */ @@ -1104,7 +1040,7 @@ } /** - * GreaterThan(>). And NullIgnored, OnceRegistered. + * GreaterThan(>). And NullIgnored, OnlyOnceRegistered. * * @param employeeId The value of employeeId as greaterThan. */ @@ -1113,7 +1049,7 @@ } /** - * LessThan(<). And NullIgnored, OnceRegistered. + * LessThan(<). And NullIgnored, OnlyOnceRegistered. * * @param employeeId The value of employeeId as lessThan. */ @@ -1122,7 +1058,7 @@ } /** - * GreaterEqual(>=). And NullIgnored, OnceRegistered. + * GreaterEqual(>=). And NullIgnored, OnlyOnceRegistered. * * @param employeeId The value of employeeId as greaterEqual. */ @@ -1131,7 +1067,7 @@ } /** - * LessEqual(<=). And NullIgnored, OnceRegistered. + * LessEqual(<=). And NullIgnored, OnlyOnceRegistered. * * @param employeeId The value of employeeId as lessEqual. */ @@ -1159,34 +1095,18 @@ regEmployeeId(CK_NINS, cTL(employeeIdList)); } - /** - * @param employeeCBquery Query. - * @deprecated Please use inScopeEmployee(subQuery) method. - */ - public void setEmployeeId_InScopeSubQuery_Employee( - EmployeeCQ employeeCBquery) { - String subQueryPropertyName = keepEmployeeId_InScopeSubQuery_Employee(employeeCBquery);// for - // saving - // query - // - - // value - // . - registerInScopeSubQuery(employeeCBquery, "EMPLOYEE_ID", "ID", - subQueryPropertyName); - } - public void inScopeEmployee(SubQuery subQuery) { assertObjectNotNull("subQuery", subQuery); EmployeeCB cb = new EmployeeCB(); cb.xsetupForInScopeSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepEmployeeId_InScopeSubQuery_Employee(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerInScopeSubQuery(cb.query(), "EMPLOYEE_ID", "ID", subQueryPropertyName); } - abstract public String keepEmployeeId_InScopeSubQuery_Employee( + public abstract String keepEmployeeId_InScopeSubQuery_Employee( EmployeeCQ subQuery); protected void regEmployeeId(ConditionKey key, Object value) { @@ -1202,7 +1122,7 @@ abstract protected ConditionValue getCValueEmployeeId(); /** - * Equal(=). And NullIgnored, OnceRegistered. {NotNull : TIMESTAMP} + * Equal(=). And NullIgnored, OnlyOnceRegistered. {NotNull : TIMESTAMP} * * @param createdTime The value of createdTime as equal. */ @@ -1211,7 +1131,7 @@ } /** - * NotEqual(!=). And NullIgnored, OnceRegistered. + * NotEqual(!=). And NullIgnored, OnlyOnceRegistered. * * @param createdTime The value of createdTime as notEqual. */ @@ -1220,7 +1140,7 @@ } /** - * GreaterThan(>). And NullIgnored, OnceRegistered. + * GreaterThan(>). And NullIgnored, OnlyOnceRegistered. * * @param createdTime The value of createdTime as greaterThan. */ @@ -1229,7 +1149,7 @@ } /** - * LessThan(>). And NullIgnored, OnceRegistered. + * LessThan(>). And NullIgnored, OnlyOnceRegistered. * * @param createdTime The value of createdTime as lessThan. */ @@ -1238,7 +1158,7 @@ } /** - * GreaterEqual(>). And NullIgnored, OnceRegistered. + * GreaterEqual(>). And NullIgnored, OnlyOnceRegistered. * * @param createdTime The value of createdTime as greaterEqual. */ @@ -1247,7 +1167,7 @@ } /** - * LessEqual(>). And NullIgnored, OnceRegistered. + * LessEqual(>). And NullIgnored, OnlyOnceRegistered. * * @param createdTime The value of createdTime as lessEqual. */ @@ -1257,7 +1177,7 @@ /** * FromTo($fromDate <= COLUMN_NAME <= $toDate). And NullIgnored, - * OnceRegistered. {NotNull : TIMESTAMP} + * OnlyOnceRegistered. {NotNull : TIMESTAMP} * * @param fromDate The from-date of createdTime. (Nullable) * @param toDate The to-date of createdTime. (Nullable) @@ -1275,7 +1195,7 @@ /** * FromTo($fromDate <= COLUMN_NAME < $toDate + 1). And NullIgnored, - * OnceRegistered. {NotNull : TIMESTAMP} + * OnlyOnceRegistered. {NotNull : TIMESTAMP} * * @param fromDate The from-date of createdTime. (Nullable) * @param toDate The to-date of createdTime. (Nullable) @@ -1301,7 +1221,7 @@ abstract protected ConditionValue getCValueCreatedTime(); /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {NotNull : + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {NotNull : * VARCHAR(255)} * * @param createdBy The value of createdBy as equal. @@ -1311,7 +1231,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param createdBy The value of createdBy as notEqual. */ @@ -1320,7 +1240,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param createdBy The value of createdBy as greaterThan. */ @@ -1329,7 +1249,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param createdBy The value of createdBy as lessThan. */ @@ -1338,7 +1258,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param createdBy The value of createdBy as greaterEqual. */ @@ -1347,7 +1267,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param createdBy The value of createdBy as lessEqual. */ @@ -1356,7 +1276,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param createdBy The value of createdBy as prefixSearch. */ @@ -1365,20 +1285,6 @@ } /** - * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, - * SeveralRegistered. - * - * @param createdBy The value of createdBy as likeSearch. - * @param likeSearchOption The option of like-search. (NotNull) - */ - public void setCreatedBy_LikeSearch( - String createdBy, - jp.sf.pal.timecard.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { - registerLikeSearchQuery(CK_LS, fRES(createdBy), getCValueCreatedBy(), - "CREATED_BY", "CreatedBy", "createdBy", likeSearchOption); - } - - /** * InScope(in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * @@ -1389,27 +1295,41 @@ } /** - * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * - * @param createdBy The collection of createdBy as inScope. - * @param inScopeOption The option of in-scope. (NotNull) + * @param createdByList The collection of createdBy as notInScope. */ - public void setCreatedBy_InScope( + public void setCreatedBy_NotInScope(Collection createdByList) { + regCreatedBy(CK_NINS, cTL(createdByList)); + } + + /** + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param createdBy The value of createdBy as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) + */ + public void setCreatedBy_LikeSearch( String createdBy, - jp.sf.pal.timecard.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(createdBy), getCValueCreatedBy(), - "CREATED_BY", "CreatedBy", "createdBy", inScopeOption); + jp.sf.pal.timecard.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(createdBy), getCValueCreatedBy(), "CREATED_BY", + "CreatedBy", "createdBy", likeSearchOption); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param createdByList The collection of createdBy as notInScope. + * @param createdBy The value of createdBy as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setCreatedBy_NotInScope(Collection createdByList) { - regCreatedBy(CK_NINS, cTL(createdByList)); + public void setCreatedBy_NotLikeSearch( + String createdBy, + jp.sf.pal.timecard.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(createdBy), getCValueCreatedBy(), "CREATED_BY", + "CreatedBy", "createdBy", likeSearchOption); } protected void regCreatedBy(ConditionKey key, Object value) { @@ -1425,7 +1345,7 @@ abstract protected ConditionValue getCValueCreatedBy(); /** - * Equal(=). And NullIgnored, OnceRegistered. {NotNull : TIMESTAMP} + * Equal(=). And NullIgnored, OnlyOnceRegistered. {NotNull : TIMESTAMP} * * @param updatedTime The value of updatedTime as equal. */ @@ -1434,7 +1354,7 @@ } /** - * NotEqual(!=). And NullIgnored, OnceRegistered. + * NotEqual(!=). And NullIgnored, OnlyOnceRegistered. * * @param updatedTime The value of updatedTime as notEqual. */ @@ -1443,7 +1363,7 @@ } /** - * GreaterThan(>). And NullIgnored, OnceRegistered. + * GreaterThan(>). And NullIgnored, OnlyOnceRegistered. * * @param updatedTime The value of updatedTime as greaterThan. */ @@ -1452,7 +1372,7 @@ } /** - * LessThan(>). And NullIgnored, OnceRegistered. + * LessThan(>). And NullIgnored, OnlyOnceRegistered. * * @param updatedTime The value of updatedTime as lessThan. */ @@ -1461,7 +1381,7 @@ } /** - * GreaterEqual(>). And NullIgnored, OnceRegistered. + * GreaterEqual(>). And NullIgnored, OnlyOnceRegistered. * * @param updatedTime The value of updatedTime as greaterEqual. */ @@ -1470,7 +1390,7 @@ } /** - * LessEqual(>). And NullIgnored, OnceRegistered. + * LessEqual(>). And NullIgnored, OnlyOnceRegistered. * * @param updatedTime The value of updatedTime as lessEqual. */ @@ -1480,7 +1400,7 @@ /** * FromTo($fromDate <= COLUMN_NAME <= $toDate). And NullIgnored, - * OnceRegistered. {NotNull : TIMESTAMP} + * OnlyOnceRegistered. {NotNull : TIMESTAMP} * * @param fromDate The from-date of updatedTime. (Nullable) * @param toDate The to-date of updatedTime. (Nullable) @@ -1498,7 +1418,7 @@ /** * FromTo($fromDate <= COLUMN_NAME < $toDate + 1). And NullIgnored, - * OnceRegistered. {NotNull : TIMESTAMP} + * OnlyOnceRegistered. {NotNull : TIMESTAMP} * * @param fromDate The from-date of updatedTime. (Nullable) * @param toDate The to-date of updatedTime. (Nullable) @@ -1524,7 +1444,7 @@ abstract protected ConditionValue getCValueUpdatedTime(); /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {NotNull : + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {NotNull : * VARCHAR(255)} * * @param updatedBy The value of updatedBy as equal. @@ -1534,7 +1454,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param updatedBy The value of updatedBy as notEqual. */ @@ -1543,7 +1463,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param updatedBy The value of updatedBy as greaterThan. */ @@ -1552,7 +1472,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param updatedBy The value of updatedBy as lessThan. */ @@ -1561,7 +1481,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param updatedBy The value of updatedBy as greaterEqual. */ @@ -1570,7 +1490,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param updatedBy The value of updatedBy as lessEqual. */ @@ -1579,7 +1499,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param updatedBy The value of updatedBy as prefixSearch. */ @@ -1588,20 +1508,6 @@ } /** - * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, - * SeveralRegistered. - * - * @param updatedBy The value of updatedBy as likeSearch. - * @param likeSearchOption The option of like-search. (NotNull) - */ - public void setUpdatedBy_LikeSearch( - String updatedBy, - jp.sf.pal.timecard.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { - registerLikeSearchQuery(CK_LS, fRES(updatedBy), getCValueUpdatedBy(), - "UPDATED_BY", "UpdatedBy", "updatedBy", likeSearchOption); - } - - /** * InScope(in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * @@ -1612,27 +1518,41 @@ } /** - * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * - * @param updatedBy The collection of updatedBy as inScope. - * @param inScopeOption The option of in-scope. (NotNull) + * @param updatedByList The collection of updatedBy as notInScope. */ - public void setUpdatedBy_InScope( + public void setUpdatedBy_NotInScope(Collection updatedByList) { + regUpdatedBy(CK_NINS, cTL(updatedByList)); + } + + /** + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param updatedBy The value of updatedBy as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) + */ + public void setUpdatedBy_LikeSearch( String updatedBy, - jp.sf.pal.timecard.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(updatedBy), getCValueUpdatedBy(), - "UPDATED_BY", "UpdatedBy", "updatedBy", inScopeOption); + jp.sf.pal.timecard.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(updatedBy), getCValueUpdatedBy(), "UPDATED_BY", + "UpdatedBy", "updatedBy", likeSearchOption); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param updatedByList The collection of updatedBy as notInScope. + * @param updatedBy The value of updatedBy as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setUpdatedBy_NotInScope(Collection updatedByList) { - regUpdatedBy(CK_NINS, cTL(updatedByList)); + public void setUpdatedBy_NotLikeSearch( + String updatedBy, + jp.sf.pal.timecard.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(updatedBy), getCValueUpdatedBy(), "UPDATED_BY", + "UpdatedBy", "updatedBy", likeSearchOption); } protected void regUpdatedBy(ConditionKey key, Object value) { @@ -1648,7 +1568,7 @@ abstract protected ConditionValue getCValueUpdatedBy(); /** - * Equal(=). And NullIgnored, OnceRegistered. {TIMESTAMP} + * Equal(=). And NullIgnored, OnlyOnceRegistered. {TIMESTAMP} * * @param deletedTime The value of deletedTime as equal. */ @@ -1657,7 +1577,7 @@ } /** - * NotEqual(!=). And NullIgnored, OnceRegistered. + * NotEqual(!=). And NullIgnored, OnlyOnceRegistered. * * @param deletedTime The value of deletedTime as notEqual. */ @@ -1666,7 +1586,7 @@ } /** - * GreaterThan(>). And NullIgnored, OnceRegistered. + * GreaterThan(>). And NullIgnored, OnlyOnceRegistered. * * @param deletedTime The value of deletedTime as greaterThan. */ @@ -1675,7 +1595,7 @@ } /** - * LessThan(>). And NullIgnored, OnceRegistered. + * LessThan(>). And NullIgnored, OnlyOnceRegistered. * * @param deletedTime The value of deletedTime as lessThan. */ @@ -1684,7 +1604,7 @@ } /** - * GreaterEqual(>). And NullIgnored, OnceRegistered. + * GreaterEqual(>). And NullIgnored, OnlyOnceRegistered. * * @param deletedTime The value of deletedTime as greaterEqual. */ @@ -1693,7 +1613,7 @@ } /** - * LessEqual(>). And NullIgnored, OnceRegistered. + * LessEqual(>). And NullIgnored, OnlyOnceRegistered. * * @param deletedTime The value of deletedTime as lessEqual. */ @@ -1703,7 +1623,7 @@ /** * FromTo($fromDate <= COLUMN_NAME <= $toDate). And NullIgnored, - * OnceRegistered. {TIMESTAMP} + * OnlyOnceRegistered. {TIMESTAMP} * * @param fromDate The from-date of deletedTime. (Nullable) * @param toDate The to-date of deletedTime. (Nullable) @@ -1721,7 +1641,7 @@ /** * FromTo($fromDate <= COLUMN_NAME < $toDate + 1). And NullIgnored, - * OnceRegistered. {TIMESTAMP} + * OnlyOnceRegistered. {TIMESTAMP} * * @param fromDate The from-date of deletedTime. (Nullable) * @param toDate The to-date of deletedTime. (Nullable) @@ -1735,14 +1655,14 @@ } /** - * IsNull(is null). And OnceRegistered. + * IsNull(is null). And OnlyOnceRegistered. */ public void setDeletedTime_IsNull() { regDeletedTime(CK_ISN, DUMMY_OBJECT); } /** - * IsNotNull(is not null). And OnceRegistered. + * IsNotNull(is not null). And OnlyOnceRegistered. */ public void setDeletedTime_IsNotNull() { regDeletedTime(CK_ISNN, DUMMY_OBJECT); @@ -1761,7 +1681,7 @@ abstract protected ConditionValue getCValueDeletedTime(); /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {VARCHAR(255)} + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {VARCHAR(255)} * * @param deletedBy The value of deletedBy as equal. */ @@ -1770,7 +1690,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param deletedBy The value of deletedBy as notEqual. */ @@ -1779,7 +1699,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param deletedBy The value of deletedBy as greaterThan. */ @@ -1788,7 +1708,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param deletedBy The value of deletedBy as lessThan. */ @@ -1797,7 +1717,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param deletedBy The value of deletedBy as greaterEqual. */ @@ -1806,7 +1726,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param deletedBy The value of deletedBy as lessEqual. */ @@ -1815,7 +1735,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param deletedBy The value of deletedBy as prefixSearch. */ @@ -1824,20 +1744,6 @@ } /** - * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, - * SeveralRegistered. - * - * @param deletedBy The value of deletedBy as likeSearch. - * @param likeSearchOption The option of like-search. (NotNull) - */ - public void setDeletedBy_LikeSearch( - String deletedBy, - jp.sf.pal.timecard.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { - registerLikeSearchQuery(CK_LS, fRES(deletedBy), getCValueDeletedBy(), - "DELETED_BY", "DeletedBy", "deletedBy", likeSearchOption); - } - - /** * InScope(in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * @@ -1848,38 +1754,52 @@ } /** - * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * - * @param deletedBy The collection of deletedBy as inScope. - * @param inScopeOption The option of in-scope. (NotNull) + * @param deletedByList The collection of deletedBy as notInScope. */ - public void setDeletedBy_InScope( + public void setDeletedBy_NotInScope(Collection deletedByList) { + regDeletedBy(CK_NINS, cTL(deletedByList)); + } + + /** + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param deletedBy The value of deletedBy as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) + */ + public void setDeletedBy_LikeSearch( String deletedBy, - jp.sf.pal.timecard.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(deletedBy), getCValueDeletedBy(), - "DELETED_BY", "DeletedBy", "deletedBy", inScopeOption); + jp.sf.pal.timecard.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(deletedBy), getCValueDeletedBy(), "DELETED_BY", + "DeletedBy", "deletedBy", likeSearchOption); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param deletedByList The collection of deletedBy as notInScope. + * @param deletedBy The value of deletedBy as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setDeletedBy_NotInScope(Collection deletedByList) { - regDeletedBy(CK_NINS, cTL(deletedByList)); + public void setDeletedBy_NotLikeSearch( + String deletedBy, + jp.sf.pal.timecard.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(deletedBy), getCValueDeletedBy(), "DELETED_BY", + "DeletedBy", "deletedBy", likeSearchOption); } /** - * IsNull(is null). And OnceRegistered. + * IsNull(is null). And OnlyOnceRegistered. */ public void setDeletedBy_IsNull() { regDeletedBy(CK_ISN, DUMMY_OBJECT); } /** - * IsNotNull(is not null). And OnceRegistered. + * IsNotNull(is not null). And OnlyOnceRegistered. */ public void setDeletedBy_IsNotNull() { regDeletedBy(CK_ISNN, DUMMY_OBJECT); @@ -1898,7 +1818,7 @@ abstract protected ConditionValue getCValueDeletedBy(); /** - * Equal(=). And NullIgnored, OnceRegistered. {NotNull : INTEGER : + * Equal(=). And NullIgnored, OnlyOnceRegistered. {NotNull : INTEGER : * Default=[0]} * * @param versionno The value of versionno as equal. @@ -1908,7 +1828,7 @@ } /** - * NotEqual(!=). And NullIgnored, OnceRegistered. + * NotEqual(!=). And NullIgnored, OnlyOnceRegistered. * * @param versionno The value of versionno as notEqual. */ @@ -1917,7 +1837,7 @@ } /** - * GreaterThan(>). And NullIgnored, OnceRegistered. + * GreaterThan(>). And NullIgnored, OnlyOnceRegistered. * * @param versionno The value of versionno as greaterThan. */ @@ -1926,7 +1846,7 @@ } /** - * LessThan(<). And NullIgnored, OnceRegistered. + * LessThan(<). And NullIgnored, OnlyOnceRegistered. * * @param versionno The value of versionno as lessThan. */ @@ -1935,7 +1855,7 @@ } /** - * GreaterEqual(>=). And NullIgnored, OnceRegistered. + * GreaterEqual(>=). And NullIgnored, OnlyOnceRegistered. * * @param versionno The value of versionno as greaterEqual. */ @@ -1944,7 +1864,7 @@ } /** - * LessEqual(<=). And NullIgnored, OnceRegistered. + * LessEqual(<=). And NullIgnored, OnlyOnceRegistered. * * @param versionno The value of versionno as lessEqual. */ @@ -1984,6 +1904,53 @@ abstract protected ConditionValue getCValueVersionno(); + public SSQFunction scalar_Equal() { + return xcreateSSQFunction("="); + } + + public SSQFunction scalar_GreaterEqual() { + return xcreateSSQFunction(">="); + } + + public SSQFunction scalar_GreaterThan() { + return xcreateSSQFunction(">"); + } + + public SSQFunction scalar_LessEqual() { + return xcreateSSQFunction("<="); + } + + public SSQFunction scalar_LessThan() { + return xcreateSSQFunction("<"); + } + + protected SSQFunction xcreateSSQFunction( + final String operand) { + return new SSQFunction( + new SSQSetupper() { + public void setup(String function, + SubQuery subQuery) { + xscalarSubQuery(function, subQuery, operand); + } + }); + } + + protected void xscalarSubQuery(String function, + SubQuery subQuery, String operand) { + assertObjectNotNull("subQuery", subQuery); + MonthlyReportCB cb = new MonthlyReportCB(); + cb.xsetupForScalarSubQuery(); + subQuery.query(cb); + String subQueryPropertyName = keepScalarSubQuery(cb.query()); // for + // saving + // query + // -value. + registerScalarSubQuery(function, cb.query(), subQueryPropertyName, + operand); + } + + public abstract String keepScalarSubQuery(MonthlyReportCQ subQuery); + // Very Internal (for Suppressing Warn about 'Not Use Import') protected String getConditionBeanClassNameInternally() { return MonthlyReportCB.class.getName(); Modified: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/cbean/cq/bs/AbstractBsMonthlyWorkingReportCQ.java =================================================================== --- timecard/trunk/src/main/java/jp/sf/pal/timecard/db/cbean/cq/bs/AbstractBsMonthlyWorkingReportCQ.java 2008-12-27 22:18:30 UTC (rev 1630) +++ timecard/trunk/src/main/java/jp/sf/pal/timecard/db/cbean/cq/bs/AbstractBsMonthlyWorkingReportCQ.java 2008-12-27 22:20:25 UTC (rev 1631) @@ -20,7 +20,6 @@ * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public abstract class AbstractBsMonthlyWorkingReportCQ extends AbstractConditionQuery { @@ -51,7 +50,8 @@ // ===== /** - * Equal(=). And NullIgnored, OnceRegistered. {PK : ID : NotNull : BIGINT} + * Equal(=). And NullIgnored, OnlyOnceRegistered. {PK : ID : NotNull : + * BIGINT} * * @param id The value of id as equal. */ @@ -60,7 +60,7 @@ } /** - * NotEqual(!=). And NullIgnored, OnceRegistered. + * NotEqual(!=). And NullIgnored, OnlyOnceRegistered. * * @param id The value of id as notEqual. */ @@ -69,7 +69,7 @@ } /** - * GreaterThan(>). And NullIgnored, OnceRegistered. + * GreaterThan(>). And NullIgnored, OnlyOnceRegistered. * * @param id The value of id as greaterThan. */ @@ -78,7 +78,7 @@ } /** - * LessThan(<). And NullIgnored, OnceRegistered. + * LessThan(<). And NullIgnored, OnlyOnceRegistered. * * @param id The value of id as lessThan. */ @@ -87,7 +87,7 @@ } /** - * GreaterEqual(>=). And NullIgnored, OnceRegistered. + * GreaterEqual(>=). And NullIgnored, OnlyOnceRegistered. * * @param id The value of id as greaterEqual. */ @@ -96,7 +96,7 @@ } /** - * LessEqual(<=). And NullIgnored, OnceRegistered. + * LessEqual(<=). And NullIgnored, OnlyOnceRegistered. * * @param id The value of id as lessEqual. */ @@ -125,14 +125,14 @@ } /** - * IsNull(is null). And OnceRegistered. + * IsNull(is null). And OnlyOnceRegistered. */ public void setId_IsNull() { regId(CK_ISN, DUMMY_OBJECT); } /** - * IsNotNull(is not null). And OnceRegistered. + * IsNotNull(is not null). And OnlyOnceRegistered. */ public void setId_IsNotNull() { regId(CK_ISNN, DUMMY_OBJECT); @@ -149,7 +149,7 @@ abstract protected ConditionValue getCValueId(); /** - * Equal(=). And NullIgnored, OnceRegistered. {NotNull : DOUBLE} + * Equal(=). And NullIgnored, OnlyOnceRegistered. {NotNull : DOUBLE} * * @param value The value of value as equal. */ @@ -158,7 +158,7 @@ } /** - * NotEqual(!=). And NullIgnored, OnceRegistered. + * NotEqual(!=). And NullIgnored, OnlyOnceRegistered. * * @param value The value of value as notEqual. */ @@ -167,7 +167,7 @@ } /** - * GreaterThan(>). And NullIgnored, OnceRegistered. + * GreaterThan(>). And NullIgnored, OnlyOnceRegistered. * * @param value The value of value as greaterThan. */ @@ -176,7 +176,7 @@ } /** - * LessThan(<). And NullIgnored, OnceRegistered. + * LessThan(<). And NullIgnored, OnlyOnceRegistered. * * @param value The value of value as lessThan. */ @@ -185,7 +185,7 @@ } /** - * GreaterEqual(>=). And NullIgnored, OnceRegistered. + * GreaterEqual(>=). And NullIgnored, OnlyOnceRegistered. * * @param value The value of value as greaterEqual. */ @@ -194,7 +194,7 @@ } /** - * LessEqual(<=). And NullIgnored, OnceRegistered. + * LessEqual(<=). And NullIgnored, OnlyOnceRegistered. * * @param value The value of value as lessEqual. */ @@ -234,7 +234,7 @@ abstract protected ConditionValue getCValueValue(); /** - * Equal(=). And NullIgnored, OnceRegistered. {NotNull : BIGINT : FK to + * Equal(=). And NullIgnored, OnlyOnceRegistered. {NotNull : BIGINT : FK to * MONTHLY_REPORT} * * @param monthlyReportId The value of monthlyReportId as equal. @@ -244,7 +244,7 @@ } /** - * NotEqual(!=). And NullIgnored, OnceRegistered. + * NotEqual(!=). And NullIgnored, OnlyOnceRegistered. * * @param monthlyReportId The value of monthlyReportId as notEqual. */ @@ -253,7 +253,7 @@ } /** - * GreaterThan(>). And NullIgnored, OnceRegistered. + * GreaterThan(>). And NullIgnored, OnlyOnceRegistered. * * @param monthlyReportId The value of monthlyReportId as greaterThan. */ @@ -262,7 +262,7 @@ } /** - * LessThan(<). And NullIgnored, OnceRegistered. + * LessThan(<). And NullIgnored, OnlyOnceRegistered. * * @param monthlyReportId The value of monthlyReportId as lessThan. */ @@ -271,7 +271,7 @@ } /** - * GreaterEqual(>=). And NullIgnored, OnceRegistered. + * GreaterEqual(>=). And NullIgnored, OnlyOnceRegistered. * * @param monthlyReportId The value of monthlyReportId as greaterEqual. */ @@ -280,7 +280,7 @@ } /** - * LessEqual(<=). And NullIgnored, OnceRegistered. + * LessEqual(<=). And NullIgnored, OnlyOnceRegistered. * * @param monthlyReportId The value of monthlyReportId as lessEqual. */ @@ -310,34 +310,18 @@ regMonthlyReportId(CK_NINS, cTL(monthlyReportIdList)); } - /** - * @param monthlyReportCBquery Query. - * @deprecated Please use inScopeMonthlyReport(subQuery) method. - */ - public void setMonthlyReportId_InScopeSubQuery_MonthlyReport( - MonthlyReportCQ monthlyReportCBquery) { - String subQueryPropertyName = keepMonthlyReportId_InScopeSubQuery_MonthlyReport(monthlyReportCBquery);// for - // saving - // query - // - - // value - // . - registerInScopeSubQuery(monthlyReportCBquery, "MONTHLY_REPORT_ID", - "ID", subQueryPropertyName); - } - public void inScopeMonthlyReport(SubQuery subQuery) { assertObjectNotNull("subQuery", subQuery); MonthlyReportCB cb = new MonthlyReportCB(); cb.xsetupForInScopeSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepMonthlyReportId_InScopeSubQuery_MonthlyReport(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerInScopeSubQuery(cb.query(), "MONTHLY_REPORT_ID", "ID", subQueryPropertyName); } - abstract public String keepMonthlyReportId_InScopeSubQuery_MonthlyReport( + public abstract String keepMonthlyReportId_InScopeSubQuery_MonthlyReport( MonthlyReportCQ subQuery); protected void regMonthlyReportId(ConditionKey key, Object value) { @@ -353,7 +337,7 @@ abstract protected ConditionValue getCValueMonthlyReportId(); /** - * Equal(=). And NullIgnored, OnceRegistered. {NotNull : INTEGER : FK to + * Equal(=). And NullIgnored, OnlyOnceRegistered. {NotNull : INTEGER : FK to * WORKING_TYPE} * * @param workingTypeId The value of workingTypeId as equal. @@ -363,7 +347,7 @@ } /** - * NotEqual(!=). And NullIgnored, OnceRegistered. + * NotEqual(!=). And NullIgnored, OnlyOnceRegistered. * * @param workingTypeId The value of workingTypeId as notEqual. */ @@ -372,7 +356,7 @@ } /** - * GreaterThan(>). And NullIgnored, OnceRegistered. + * GreaterThan(>). And NullIgnored, OnlyOnceRegistered. * * @param workingTypeId The value of workingTypeId as greaterThan. */ @@ -381,7 +365,7 @@ } /** - * LessThan(<). And NullIgnored, OnceRegistered. + * LessThan(<). And NullIgnored, OnlyOnceRegistered. * * @param workingTypeId The value of workingTypeId as lessThan. */ @@ -390,7 +374,7 @@ } /** - * GreaterEqual(>=). And NullIgnored, OnceRegistered. + * GreaterEqual(>=). And NullIgnored, OnlyOnceRegistered. * * @param workingTypeId The value of workingTypeId as greaterEqual. */ @@ -399,7 +383,7 @@ } /** - * LessEqual(<=). And NullIgnored, OnceRegistered. + * LessEqual(<=). And NullIgnored, OnlyOnceRegistered. * * @param workingTypeId The value of workingTypeId as lessEqual. */ @@ -428,34 +412,18 @@ regWorkingTypeId(CK_NINS, cTL(workingTypeIdList)); } - /** - * @param workingTypeCBquery Query. - * @deprecated Please use inScopeWorkingType(subQuery) method. - */ - public void setWorkingTypeId_InScopeSubQuery_WorkingType( - WorkingTypeCQ workingTypeCBquery) { - String subQueryPropertyName = keepWorkingTypeId_InScopeSubQuery_WorkingType(workingTypeCBquery);// for - // saving - // query - // - - // value - // . - registerInScopeSubQuery(workingTypeCBquery, "WORKING_TYPE_ID", "ID", - subQueryPropertyName); - } - public void inScopeWorkingType(SubQuery subQuery) { assertObjectNotNull("subQuery", subQuery); WorkingTypeCB cb = new WorkingTypeCB(); cb.xsetupForInScopeSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepWorkingTypeId_InScopeSubQuery_WorkingType(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerInScopeSubQuery(cb.query(), "WORKING_TYPE_ID", "ID", subQueryPropertyName); } - abstract public String keepWorkingTypeId_InScopeSubQuery_WorkingType( + public abstract String keepWorkingTypeId_InScopeSubQuery_WorkingType( WorkingTypeCQ subQuery); protected void regWorkingTypeId(ConditionKey key, Object value) { @@ -470,6 +438,53 @@ abstract protected ConditionValue getCValueWorkingTypeId(); + public SSQFunction scalar_Equal() { + return xcreateSSQFunction("="); + } + + public SSQFunction scalar_GreaterEqual() { + return xcreateSSQFunction(">="); + } + + public SSQFunction scalar_GreaterThan() { + return xcreateSSQFunction(">"); + } + + public SSQFunction scalar_LessEqual() { + return xcreateSSQFunction("<="); + } + + public SSQFunction scalar_LessThan() { + return xcreateSSQFunction("<"); + } + + protected SSQFunction xcreateSSQFunction( + final String operand) { + return new SSQFunction( + new SSQSetupper() { + public void setup(String function, + SubQuery subQuery) { + xscalarSubQuery(function, subQuery, operand); + } + }); + } + + protected void xscalarSubQuery(String function, + SubQuery subQuery, String operand) { + assertObjectNotNull("subQuery", subQuery); + MonthlyWorkingReportCB cb = new MonthlyWorkingReportCB(); + cb.xsetupForScalarSubQuery(); + subQuery.query(cb); + String subQueryPropertyName = keepScalarSubQuery(cb.query()); // for + // saving + // query + // -value. + registerScalarSubQuery(function, cb.query(), subQueryPropertyName, + operand); + } + + public abstract String keepScalarSubQuery(MonthlyWorkingReportCQ subQuery); + // Very Internal (for Suppressing Warn about 'Not Use Import') protected String getConditionBeanClassNameInternally() { return MonthlyWorkingReportCB.class.getName(); Modified: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/cbean/cq/bs/AbstractBsRoleInfoCQ.java =================================================================== --- timecard/trunk/src/main/java/jp/sf/pal/timecard/db/cbean/cq/bs/AbstractBsRoleInfoCQ.java 2008-12-27 22:18:30 UTC (rev 1630) +++ timecard/trunk/src/main/java/jp/sf/pal/timecard/db/cbean/cq/bs/AbstractBsRoleInfoCQ.java 2008-12-27 22:20:25 UTC (rev 1631) @@ -20,7 +20,6 @@ * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public abstract class AbstractBsRoleInfoCQ extends AbstractConditionQuery { //========================================================================== @@ -50,7 +49,7 @@ // ===== /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {PK : NotNull : + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {PK : NotNull : * VARCHAR(255)} * * @param roleId The value of roleId as equal. @@ -60,7 +59,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param roleId The value of roleId as notEqual. */ @@ -69,7 +68,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param roleId The value of roleId as greaterThan. */ @@ -78,7 +77,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param roleId The value of roleId as lessThan. */ @@ -87,7 +86,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param roleId The value of roleId as greaterEqual. */ @@ -96,7 +95,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param roleId The value of roleId as lessEqual. */ @@ -105,7 +104,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param roleId The value of roleId as prefixSearch. */ @@ -114,20 +113,6 @@ } /** - * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, - * SeveralRegistered. - * - * @param roleId The value of roleId as likeSearch. - * @param likeSearchOption The option of like-search. (NotNull) - */ - public void setRoleId_LikeSearch( - String roleId, - jp.sf.pal.timecard.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { - registerLikeSearchQuery(CK_LS, fRES(roleId), getCValueRoleId(), - "ROLE_ID", "RoleId", "roleId", likeSearchOption); - } - - /** * InScope(in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * @@ -138,43 +123,41 @@ } /** - * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * - * @param roleId The collection of roleId as inScope. - * @param inScopeOption The option of in-scope. (NotNull) + * @param roleIdList The collection of roleId as notInScope. */ - public void setRoleId_InScope( - String roleId, - jp.sf.pal.timecard.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(roleId), getCValueRoleId(), - "ROLE_ID", "RoleId", "roleId", inScopeOption); + public void setRoleId_NotInScope(Collection roleIdList) { + regRoleId(CK_NINS, cTL(roleIdList)); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param roleIdList The collection of roleId as notInScope. + * @param roleId The value of roleId as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) */ - public void setRoleId_NotInScope(Collection roleIdList) { - regRoleId(CK_NINS, cTL(roleIdList)); + public void setRoleId_LikeSearch( + String roleId, + jp.sf.pal.timecard.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(roleId), getCValueRoleId(), "ROLE_ID", "RoleId", + "roleId", likeSearchOption); } /** - * @param roleMappingCBquery Query. - * @deprecated Please use inScopeRoleMappingList(subQuery) method. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param roleId The value of roleId as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setRoleId_InScopeSubQuery_RoleMappingList( - RoleMappingCQ roleMappingCBquery) { - String subQueryPropertyName = keepRoleId_InScopeSubQuery_RoleMappingList(roleMappingCBquery);// for - // saving - // query - // - - // value - // . - registerInScopeSubQuery(roleMappingCBquery, "ROLE_ID", "ROLE_ID", - subQueryPropertyName); + public void setRoleId_NotLikeSearch( + String roleId, + jp.sf.pal.timecard.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(roleId), getCValueRoleId(), "ROLE_ID", "RoleId", + "roleId", likeSearchOption); } public void inScopeRoleMappingList(SubQuery subQuery) { @@ -183,42 +166,26 @@ cb.xsetupForInScopeSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepRoleId_InScopeSubQuery_RoleMappingList(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerInScopeSubQuery(cb.query(), "ROLE_ID", "ROLE_ID", subQueryPropertyName); } - abstract public String keepRoleId_InScopeSubQuery_RoleMappingList( + public abstract String keepRoleId_InScopeSubQuery_RoleMappingList( RoleMappingCQ subQuery); - /** - * @param userInfoCBquery Query. - * @deprecated Please use inScopeUserInfoList(subQuery) method. - */ - public void setRoleId_InScopeSubQuery_UserInfoList( - UserInfoCQ userInfoCBquery) { - String subQueryPropertyName = keepRoleId_InScopeSubQuery_UserInfoList(userInfoCBquery);// for - // saving - // query - // - - // value - // . - registerInScopeSubQuery(userInfoCBquery, "ROLE_ID", "ROLE_ID", - subQueryPropertyName); - } - public void inScopeUserInfoList(SubQuery subQuery) { assertObjectNotNull("subQuery", subQuery); UserInfoCB cb = new UserInfoCB(); cb.xsetupForInScopeSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepRoleId_InScopeSubQuery_UserInfoList(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerInScopeSubQuery(cb.query(), "ROLE_ID", "ROLE_ID", subQueryPropertyName); } - abstract public String keepRoleId_InScopeSubQuery_UserInfoList( + public abstract String keepRoleId_InScopeSubQuery_UserInfoList( UserInfoCQ subQuery); public void notInScopeRoleMappingList(SubQuery subQuery) { @@ -227,12 +194,12 @@ cb.xsetupForInScopeSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepRoleId_NotInScopeSubQuery_RoleMappingList(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerNotInScopeSubQuery(cb.query(), "ROLE_ID", "ROLE_ID", subQueryPropertyName); } - abstract public String keepRoleId_NotInScopeSubQuery_RoleMappingList( + public abstract String keepRoleId_NotInScopeSubQuery_RoleMappingList( RoleMappingCQ subQuery); public void notInScopeUserInfoList(SubQuery subQuery) { @@ -241,31 +208,15 @@ cb.xsetupForInScopeSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepRoleId_NotInScopeSubQuery_UserInfoList(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerNotInScopeSubQuery(cb.query(), "ROLE_ID", "ROLE_ID", subQueryPropertyName); } - abstract public String keepRoleId_NotInScopeSubQuery_UserInfoList( + public abstract String keepRoleId_NotInScopeSubQuery_UserInfoList( UserInfoCQ subQuery); /** - * @param roleMappingCBquery Query. - * @deprecated Please use existsRoleMappingList(subQuery) method. - */ - public void setRoleId_ExistsSubQuery_RoleMappingList( - RoleMappingCQ roleMappingCBquery) { - String subQueryPropertyName = keepRoleId_ExistsSubQuery_RoleMappingList(roleMappingCBquery);// for - // saving - // query - // - - // value - // . - registerExistsSubQuery(roleMappingCBquery, "ROLE_ID", "ROLE_ID", - subQueryPropertyName); - } - - /** * Set up 'exists' sub-query. {exists (select ROLE_ID from ROLE_MAPPING * where ...)} * @@ -278,30 +229,15 @@ cb.xsetupForExistsSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepRoleId_ExistsSubQuery_RoleMappingList(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerExistsSubQuery(cb.query(), "ROLE_ID", "ROLE_ID", subQueryPropertyName); } - abstract public String keepRoleId_ExistsSubQuery_RoleMappingList( + public abstract String keepRoleId_ExistsSubQuery_RoleMappingList( RoleMappingCQ subQuery); /** - * @param userInfoCBquery Query. - * @deprecated Please use existsUserInfoList(subQuery) method. - */ - public void setRoleId_ExistsSubQuery_UserInfoList(UserInfoCQ userInfoCBquery) { - String subQueryPropertyName = keepRoleId_ExistsSubQuery_UserInfoList(userInfoCBquery);// for - // saving - // query - // - - // value - // . - registerExistsSubQuery(userInfoCBquery, "ROLE_ID", "ROLE_ID", - subQueryPropertyName); - } - - /** * Set up 'exists' sub-query. {exists (select ROLE_ID from USER_INFO where * ...)} * @@ -314,12 +250,12 @@ cb.xsetupForExistsSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepRoleId_ExistsSubQuery_UserInfoList(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerExistsSubQuery(cb.query(), "ROLE_ID", "ROLE_ID", subQueryPropertyName); } - abstract public String keepRoleId_ExistsSubQuery_UserInfoList( + public abstract String keepRoleId_ExistsSubQuery_UserInfoList( UserInfoCQ subQuery); /** @@ -335,12 +271,12 @@ cb.xsetupForExistsSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepRoleId_NotExistsSubQuery_RoleMappingList(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerNotExistsSubQuery(cb.query(), "ROLE_ID", "ROLE_ID", subQueryPropertyName); } - abstract public String keepRoleId_NotExistsSubQuery_RoleMappingList( + public abstract String keepRoleId_NotExistsSubQuery_RoleMappingList( RoleMappingCQ subQuery); /** @@ -356,53 +292,53 @@ cb.xsetupForExistsSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepRoleId_NotExistsSubQuery_UserInfoList(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerNotExistsSubQuery(cb.query(), "ROLE_ID", "ROLE_ID", subQueryPropertyName); } - abstract public String keepRoleId_NotExistsSubQuery_UserInfoList( + public abstract String keepRoleId_NotExistsSubQuery_UserInfoList( UserInfoCQ subQuery); public void xderiveRoleMappingList(String function, SubQuery subQuery, String aliasName) { assertObjectNotNull("subQuery", subQuery); RoleMappingCB cb = new RoleMappingCB(); - cb.xsetupForDeriveReferrer(); + cb.xsetupForDerivedReferrer(); subQuery.query(cb); - String subQueryPropertyName = keepRoleId_DeriveSubQuery_RoleMappingList(cb - .query());// for saving query-value. - registerDeriveSubQuery(function, cb.query(), "ROLE_ID", "ROLE_ID", - subQueryPropertyName, aliasName); + String subQueryPropertyName = keepRoleId_DerivedReferrer_RoleMappingList(cb + .query()); // for saving query-value. + registerDerivedReferrerSubQuery(function, cb.query(), "ROLE_ID", + "ROLE_ID", subQueryPropertyName, aliasName); } - abstract public String keepRoleId_DeriveSubQuery_RoleMappingList( + public abstract String keepRoleId_DerivedReferrer_RoleMappingList( RoleMappingCQ subQuery); public void xderiveUserInfoList(String function, SubQuery subQuery, String aliasName) { assertObjectNotNull("subQuery", subQuery); UserInfoCB cb = new UserInfoCB(); - cb.xsetupForDeriveReferrer(); + cb.xsetupForDerivedReferrer(); subQuery.query(cb); - String subQueryPropertyName = keepRoleId_DeriveSubQuery_UserInfoList(cb - .query());// for saving query-value. - registerDeriveSubQuery(function, cb.query(), "ROLE_ID", "ROLE_ID", - subQueryPropertyName, aliasName); + String subQueryPropertyName = keepRoleId_DerivedReferrer_UserInfoList(cb + .query()); // for saving query-value. + registerDerivedReferrerSubQuery(function, cb.query(), "ROLE_ID", + "ROLE_ID", subQueryPropertyName, aliasName); } - abstract public String keepRoleId_DeriveSubQuery_UserInfoList( + public abstract String keepRoleId_DerivedReferrer_UserInfoList( UserInfoCQ subQuery); /** - * IsNull(is null). And OnceRegistered. + * IsNull(is null). And OnlyOnceRegistered. */ public void setRoleId_IsNull() { regRoleId(CK_ISN, DUMMY_OBJECT); } /** - * IsNotNull(is not null). And OnceRegistered. + * IsNotNull(is not null). And OnlyOnceRegistered. */ public void setRoleId_IsNotNull() { regRoleId(CK_ISNN, DUMMY_OBJECT); @@ -421,7 +357,7 @@ abstract protected ConditionValue getCValueRoleId(); /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {VARCHAR(100)} + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {VARCHAR(100)} * * @param name The value of name as equal. */ @@ -430,7 +366,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param name The value of name as notEqual. */ @@ -439,7 +375,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param name The value of name as greaterThan. */ @@ -448,7 +384,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param name The value of name as lessThan. */ @@ -457,7 +393,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param name The value of name as greaterEqual. */ @@ -466,7 +402,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param name The value of name as lessEqual. */ @@ -475,7 +411,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param name The value of name as prefixSearch. */ @@ -484,20 +420,6 @@ } /** - * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, - * SeveralRegistered. - * - * @param name The value of name as likeSearch. - * @param likeSearchOption The option of like-search. (NotNull) - */ - public void setName_LikeSearch( - String name, - jp.sf.pal.timecard.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { - registerLikeSearchQuery(CK_LS, fRES(name), getCValueName(), "NAME", - "Name", "name", likeSearchOption); - } - - /** * InScope(in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * @@ -508,38 +430,52 @@ } /** - * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * - * @param name The collection of name as inScope. - * @param inScopeOption The option of in-scope. (NotNull) + * @param nameList The collection of name as notInScope. */ - public void setName_InScope( + public void setName_NotInScope(Collection nameList) { + regName(CK_NINS, cTL(nameList)); + } + + /** + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param name The value of name as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) + */ + public void setName_LikeSearch( String name, - jp.sf.pal.timecard.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(name), getCValueName(), "NAME", - "Name", "name", inScopeOption); + jp.sf.pal.timecard.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(name), getCValueName(), "NAME", "Name", "name", + likeSearchOption); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param nameList The collection of name as notInScope. + * @param name The value of name as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setName_NotInScope(Collection nameList) { - regName(CK_NINS, cTL(nameList)); + public void setName_NotLikeSearch( + String name, + jp.sf.pal.timecard.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(name), getCValueName(), "NAME", "Name", "name", + likeSearchOption); } /** - * IsNull(is null). And OnceRegistered. + * IsNull(is null). And OnlyOnceRegistered. */ public void setName_IsNull() { regName(CK_ISN, DUMMY_OBJECT); } /** - * IsNotNull(is not null). And OnceRegistered. + * IsNotNull(is not null). And OnlyOnceRegistered. */ public void setName_IsNotNull() { regName(CK_ISNN, DUMMY_OBJECT); @@ -556,7 +492,7 @@ abstract protected ConditionValue getCValueName(); /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {VARCHAR(255)} + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {VARCHAR(255)} * * @param description The value of description as equal. */ @@ -565,7 +501,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param description The value of description as notEqual. */ @@ -574,7 +510,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param description The value of description as greaterThan. */ @@ -583,7 +519,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param description The value of description as lessThan. */ @@ -592,7 +528,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param description The value of description as greaterEqual. */ @@ -601,7 +537,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param description The value of description as lessEqual. */ @@ -610,7 +546,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param description The value of description as prefixSearch. */ @@ -619,21 +555,6 @@ } /** - * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, - * SeveralRegistered. - * - * @param description The value of description as likeSearch. - * @param likeSearchOption The option of like-search. (NotNull) - */ - public void setDescription_LikeSearch( - String description, - jp.sf.pal.timecard.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { - registerLikeSearchQuery(CK_LS, fRES(description), - getCValueDescription(), "DESCRIPTION", "Description", - "description", likeSearchOption); - } - - /** * InScope(in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * @@ -644,38 +565,52 @@ } /** - * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * - * @param description The collection of description as inScope. - * @param inScopeOption The option of in-scope. (NotNull) + * @param descriptionList The collection of description as notInScope. */ - public void setDescription_InScope( + public void setDescription_NotInScope(Collection descriptionList) { + regDescription(CK_NINS, cTL(descriptionList)); + } + + /** + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param description The value of description as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) + */ + public void setDescription_LikeSearch( String description, - jp.sf.pal.timecard.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(description), getCValueDescription(), - "DESCRIPTION", "Description", "description", inScopeOption); + jp.sf.pal.timecard.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(description), getCValueDescription(), "DESCRIPTION", + "Description", "description", likeSearchOption); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param descriptionList The collection of description as notInScope. + * @param description The value of description as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setDescription_NotInScope(Collection descriptionList) { - regDescription(CK_NINS, cTL(descriptionList)); + public void setDescription_NotLikeSearch( + String description, + jp.sf.pal.timecard.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(description), getCValueDescription(), + "DESCRIPTION", "Description", "description", likeSearchOption); } /** - * IsNull(is null). And OnceRegistered. + * IsNull(is null). And OnlyOnceRegistered. */ public void setDescription_IsNull() { regDescription(CK_ISN, DUMMY_OBJECT); } /** - * IsNotNull(is not null). And OnceRegistered. + * IsNotNull(is not null). And OnlyOnceRegistered. */ public void setDescription_IsNotNull() { regDescription(CK_ISNN, DUMMY_OBJECT); @@ -694,7 +629,7 @@ abstract protected ConditionValue getCValueDescription(); /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {VARCHAR(255)} + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {VARCHAR(255)} * * @param email The value of email as equal. */ @@ -703,7 +638,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param email The value of email as notEqual. */ @@ -712,7 +647,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param email The value of email as greaterThan. */ @@ -721,7 +656,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param email The value of email as lessThan. */ @@ -730,7 +665,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param email The value of email as greaterEqual. */ @@ -739,7 +674,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param email The value of email as lessEqual. */ @@ -748,7 +683,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param email The value of email as prefixSearch. */ @@ -757,20 +692,6 @@ } /** - * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, - * SeveralRegistered. - * - * @param email The value of email as likeSearch. - * @param likeSearchOption The option of like-search. (NotNull) - */ - public void setEmail_LikeSearch( - String email, - jp.sf.pal.timecard.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { - registerLikeSearchQuery(CK_LS, fRES(email), getCValueEmail(), "EMAIL", - "Email", "email", likeSearchOption); - } - - /** * InScope(in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * @@ -781,38 +702,52 @@ } /** - * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * - * @param email The collection of email as inScope. - * @param inScopeOption The option of in-scope. (NotNull) + * @param emailList The collection of email as notInScope. */ - public void setEmail_InScope( + public void setEmail_NotInScope(Collection emailList) { + regEmail(CK_NINS, cTL(emailList)); + } + + /** + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param email The value of email as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) + */ + public void setEmail_LikeSearch( String email, - jp.sf.pal.timecard.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(email), getCValueEmail(), "EMAIL", - "Email", "email", inScopeOption); + jp.sf.pal.timecard.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(email), getCValueEmail(), "EMAIL", "Email", "email", + likeSearchOption); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param emailList The collection of email as notInScope. + * @param email The value of email as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setEmail_NotInScope(Collection emailList) { - regEmail(CK_NINS, cTL(emailList)); + public void setEmail_NotLikeSearch( + String email, + jp.sf.pal.timecard.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(email), getCValueEmail(), "EMAIL", "Email", + "email", likeSearchOption); } /** - * IsNull(is null). And OnceRegistered. + * IsNull(is null). And OnlyOnceRegistered. */ public void setEmail_IsNull() { regEmail(CK_ISN, DUMMY_OBJECT); } /** - * IsNotNull(is not null). And OnceRegistered. + * IsNotNull(is not null). And OnlyOnceRegistered. */ public void setEmail_IsNotNull() { regEmail(CK_ISNN, DUMMY_OBJECT); @@ -830,7 +765,7 @@ abstract protected ConditionValue getCValueEmail(); /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {VARCHAR(255)} + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {VARCHAR(255)} * * @param url The value of url as equal. */ @@ -839,7 +774,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param url The value of url as notEqual. */ @@ -848,7 +783,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param url The value of url as greaterThan. */ @@ -857,7 +792,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param url The value of url as lessThan. */ @@ -866,7 +801,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param url The value of url as greaterEqual. */ @@ -875,7 +810,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param url The value of url as lessEqual. */ @@ -884,7 +819,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param url The value of url as prefixSearch. */ @@ -893,20 +828,6 @@ } /** - * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, - * SeveralRegistered. - * - * @param url The value of url as likeSearch. - * @param likeSearchOption The option of like-search. (NotNull) - */ - public void setUrl_LikeSearch( - String url, - jp.sf.pal.timecard.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { - registerLikeSearchQuery(CK_LS, fRES(url), getCValueUrl(), "URL", "Url", - "url", likeSearchOption); - } - - /** * InScope(in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * @@ -917,38 +838,52 @@ } /** - * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * - * @param url The collection of url as inScope. - * @param inScopeOption The option of in-scope. (NotNull) + * @param urlList The collection of url as notInScope. */ - public void setUrl_InScope( + public void setUrl_NotInScope(Collection urlList) { + regUrl(CK_NINS, cTL(urlList)); + } + + /** + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param url The value of url as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) + */ + public void setUrl_LikeSearch( String url, - jp.sf.pal.timecard.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(url), getCValueUrl(), "URL", "Url", - "url", inScopeOption); + jp.sf.pal.timecard.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(url), getCValueUrl(), "URL", "Url", "url", + likeSearchOption); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param urlList The collection of url as notInScope. + * @param url The value of url as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setUrl_NotInScope(Collection urlList) { - regUrl(CK_NINS, cTL(urlList)); + public void setUrl_NotLikeSearch( + String url, + jp.sf.pal.timecard.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(url), getCValueUrl(), "URL", "Url", "url", + likeSearchOption); } /** - * IsNull(is null). And OnceRegistered. + * IsNull(is null). And OnlyOnceRegistered. */ public void setUrl_IsNull() { regUrl(CK_ISN, DUMMY_OBJECT); } /** - * IsNotNull(is not null). And OnceRegistered. + * IsNotNull(is not null). And OnlyOnceRegistered. */ public void setUrl_IsNotNull() { regUrl(CK_ISNN, DUMMY_OBJECT); @@ -965,7 +900,7 @@ abstract protected ConditionValue getCValueUrl(); /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {VARCHAR(40)} + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {VARCHAR(40)} * * @param telephone The value of telephone as equal. */ @@ -974,7 +909,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param telephone The value of telephone as notEqual. */ @@ -983,7 +918,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param telephone The value of telephone as greaterThan. */ @@ -992,7 +927,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param telephone The value of telephone as lessThan. */ @@ -1001,7 +936,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param telephone The value of telephone as greaterEqual. */ @@ -1010,7 +945,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param telephone The value of telephone as lessEqual. */ @@ -1019,7 +954,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param telephone The value of telephone as prefixSearch. */ @@ -1028,20 +963,6 @@ } /** - * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, - * SeveralRegistered. - * - * @param telephone The value of telephone as likeSearch. - * @param likeSearchOption The option of like-search. (NotNull) - */ - public void setTelephone_LikeSearch( - String telephone, - jp.sf.pal.timecard.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { - registerLikeSearchQuery(CK_LS, fRES(telephone), getCValueTelephone(), - "TELEPHONE", "Telephone", "telephone", likeSearchOption); - } - - /** * InScope(in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * @@ -1052,38 +973,52 @@ } /** - * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * - * @param telephone The collection of telephone as inScope. - * @param inScopeOption The option of in-scope. (NotNull) + * @param telephoneList The collection of telephone as notInScope. */ - public void setTelephone_InScope( + public void setTelephone_NotInScope(Collection telephoneList) { + regTelephone(CK_NINS, cTL(telephoneList)); + } + + /** + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param telephone The value of telephone as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) + */ + public void setTelephone_LikeSearch( String telephone, - jp.sf.pal.timecard.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(telephone), getCValueTelephone(), - "TELEPHONE", "Telephone", "telephone", inScopeOption); + jp.sf.pal.timecard.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(telephone), getCValueTelephone(), "TELEPHONE", + "Telephone", "telephone", likeSearchOption); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param telephoneList The collection of telephone as notInScope. + * @param telephone The value of telephone as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setTelephone_NotInScope(Collection telephoneList) { - regTelephone(CK_NINS, cTL(telephoneList)); + public void setTelephone_NotLikeSearch( + String telephone, + jp.sf.pal.timecard.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(telephone), getCValueTelephone(), "TELEPHONE", + "Telephone", "telephone", likeSearchOption); } /** - * IsNull(is null). And OnceRegistered. + * IsNull(is null). And OnlyOnceRegistered. */ public void setTelephone_IsNull() { regTelephone(CK_ISN, DUMMY_OBJECT); } /** - * IsNotNull(is not null). And OnceRegistered. + * IsNotNull(is not null). And OnlyOnceRegistered. */ public void setTelephone_IsNotNull() { regTelephone(CK_ISNN, DUMMY_OBJECT); @@ -1102,7 +1037,7 @@ abstract protected ConditionValue getCValueTelephone(); /** - * Equal(=). And NullIgnored, OnceRegistered. {NotNull : TIMESTAMP} + * Equal(=). And NullIgnored, OnlyOnceRegistered. {NotNull : TIMESTAMP} * * @param createdTime The value of createdTime as equal. */ @@ -1111,7 +1046,7 @@ } /** - * NotEqual(!=). And NullIgnored, OnceRegistered. + * NotEqual(!=). And NullIgnored, OnlyOnceRegistered. * * @param createdTime The value of createdTime as notEqual. */ @@ -1120,7 +1055,7 @@ } /** - * GreaterThan(>). And NullIgnored, OnceRegistered. + * GreaterThan(>). And NullIgnored, OnlyOnceRegistered. * * @param createdTime The value of createdTime as greaterThan. */ @@ -1129,7 +1064,7 @@ } /** - * LessThan(>). And NullIgnored, OnceRegistered. + * LessThan(>). And NullIgnored, OnlyOnceRegistered. * * @param createdTime The value of createdTime as lessThan. */ @@ -1138,7 +1073,7 @@ } /** - * GreaterEqual(>). And NullIgnored, OnceRegistered. + * GreaterEqual(>). And NullIgnored, OnlyOnceRegistered. * * @param createdTime The value of createdTime as greaterEqual. */ @@ -1147,7 +1082,7 @@ } /** - * LessEqual(>). And NullIgnored, OnceRegistered. + * LessEqual(>). And NullIgnored, OnlyOnceRegistered. * * @param createdTime The value of createdTime as lessEqual. */ @@ -1157,7 +1092,7 @@ /** * FromTo($fromDate <= COLUMN_NAME <= $toDate). And NullIgnored, - * OnceRegistered. {NotNull : TIMESTAMP} + * OnlyOnceRegistered. {NotNull : TIMESTAMP} * * @param fromDate The from-date of createdTime. (Nullable) * @param toDate The to-date of createdTime. (Nullable) @@ -1175,7 +1110,7 @@ /** * FromTo($fromDate <= COLUMN_NAME < $toDate + 1). And NullIgnored, - * OnceRegistered. {NotNull : TIMESTAMP} + * OnlyOnceRegistered. {NotNull : TIMESTAMP} * * @param fromDate The from-date of createdTime. (Nullable) * @param toDate The to-date of createdTime. (Nullable) @@ -1201,7 +1136,7 @@ abstract protected ConditionValue getCValueCreatedTime(); /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {NotNull : + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {NotNull : * VARCHAR(255)} * * @param createdBy The value of createdBy as equal. @@ -1211,7 +1146,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param createdBy The value of createdBy as notEqual. */ @@ -1220,7 +1155,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param createdBy The value of createdBy as greaterThan. */ @@ -1229,7 +1164,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param createdBy The value of createdBy as lessThan. */ @@ -1238,7 +1173,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param createdBy The value of createdBy as greaterEqual. */ @@ -1247,7 +1182,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param createdBy The value of createdBy as lessEqual. */ @@ -1256,7 +1191,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param createdBy The value of createdBy as prefixSearch. */ @@ -1265,20 +1200,6 @@ } /** - * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, - * SeveralRegistered. - * - * @param createdBy The value of createdBy as likeSearch. - * @param likeSearchOption The option of like-search. (NotNull) - */ - public void setCreatedBy_LikeSearch( - String createdBy, - jp.sf.pal.timecard.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { - registerLikeSearchQuery(CK_LS, fRES(createdBy), getCValueCreatedBy(), - "CREATED_BY", "CreatedBy", "createdBy", likeSearchOption); - } - - /** * InScope(in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * @@ -1289,27 +1210,41 @@ } /** - * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * - * @param createdBy The collection of createdBy as inScope. - * @param inScopeOption The option of in-scope. (NotNull) + * @param createdByList The collection of createdBy as notInScope. */ - public void setCreatedBy_InScope( + public void setCreatedBy_NotInScope(Collection createdByList) { + regCreatedBy(CK_NINS, cTL(createdByList)); + } + + /** + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param createdBy The value of createdBy as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) + */ + public void setCreatedBy_LikeSearch( String createdBy, - jp.sf.pal.timecard.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(createdBy), getCValueCreatedBy(), - "CREATED_BY", "CreatedBy", "createdBy", inScopeOption); + jp.sf.pal.timecard.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(createdBy), getCValueCreatedBy(), "CREATED_BY", + "CreatedBy", "createdBy", likeSearchOption); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param createdByList The collection of createdBy as notInScope. + * @param createdBy The value of createdBy as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setCreatedBy_NotInScope(Collection createdByList) { - regCreatedBy(CK_NINS, cTL(createdByList)); + public void setCreatedBy_NotLikeSearch( + String createdBy, + jp.sf.pal.timecard.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(createdBy), getCValueCreatedBy(), "CREATED_BY", + "CreatedBy", "createdBy", likeSearchOption); } protected void regCreatedBy(ConditionKey key, Object value) { @@ -1325,7 +1260,7 @@ abstract protected ConditionValue getCValueCreatedBy(); /** - * Equal(=). And NullIgnored, OnceRegistered. {NotNull : TIMESTAMP} + * Equal(=). And NullIgnored, OnlyOnceRegistered. {NotNull : TIMESTAMP} * * @param updatedTime The value of updatedTime as equal. */ @@ -1334,7 +1269,7 @@ } /** - * NotEqual(!=). And NullIgnored, OnceRegistered. + * NotEqual(!=). And NullIgnored, OnlyOnceRegistered. * * @param updatedTime The value of updatedTime as notEqual. */ @@ -1343,7 +1278,7 @@ } /** - * GreaterThan(>). And NullIgnored, OnceRegistered. + * GreaterThan(>). And NullIgnored, OnlyOnceRegistered. * * @param updatedTime The value of updatedTime as greaterThan. */ @@ -1352,7 +1287,7 @@ } /** - * LessThan(>). And NullIgnored, OnceRegistered. + * LessThan(>). And NullIgnored, OnlyOnceRegistered. * * @param updatedTime The value of updatedTime as lessThan. */ @@ -1361,7 +1296,7 @@ } /** - * GreaterEqual(>). And NullIgnored, OnceRegistered. + * GreaterEqual(>). And NullIgnored, OnlyOnceRegistered. * * @param updatedTime The value of updatedTime as greaterEqual. */ @@ -1370,7 +1305,7 @@ } /** - * LessEqual(>). And NullIgnored, OnceRegistered. + * LessEqual(>). And NullIgnored, OnlyOnceRegistered. * * @param updatedTime The value of updatedTime as lessEqual. */ @@ -1380,7 +1315,7 @@ /** * FromTo($fromDate <= COLUMN_NAME <= $toDate). And NullIgnored, - * OnceRegistered. {NotNull : TIMESTAMP} + * OnlyOnceRegistered. {NotNull : TIMESTAMP} * * @param fromDate The from-date of updatedTime. (Nullable) * @param toDate The to-date of updatedTime. (Nullable) @@ -1398,7 +1333,7 @@ /** * FromTo($fromDate <= COLUMN_NAME < $toDate + 1). And NullIgnored, - * OnceRegistered. {NotNull : TIMESTAMP} + * OnlyOnceRegistered. {NotNull : TIMESTAMP} * * @param fromDate The from-date of updatedTime. (Nullable) * @param toDate The to-date of updatedTime. (Nullable) @@ -1424,7 +1359,7 @@ abstract protected ConditionValue getCValueUpdatedTime(); /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {NotNull : + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {NotNull : * VARCHAR(255)} * * @param updatedBy The value of updatedBy as equal. @@ -1434,7 +1369,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param updatedBy The value of updatedBy as notEqual. */ @@ -1443,7 +1378,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param updatedBy The value of updatedBy as greaterThan. */ @@ -1452,7 +1387,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param updatedBy The value of updatedBy as lessThan. */ @@ -1461,7 +1396,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param updatedBy The value of updatedBy as greaterEqual. */ @@ -1470,7 +1405,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param updatedBy The value of updatedBy as lessEqual. */ @@ -1479,7 +1414,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param updatedBy The value of updatedBy as prefixSearch. */ @@ -1488,20 +1423,6 @@ } /** - * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, - * SeveralRegistered. - * - * @param updatedBy The value of updatedBy as likeSearch. - * @param likeSearchOption The option of like-search. (NotNull) - */ - public void setUpdatedBy_LikeSearch( - String updatedBy, - jp.sf.pal.timecard.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { - registerLikeSearchQuery(CK_LS, fRES(updatedBy), getCValueUpdatedBy(), - "UPDATED_BY", "UpdatedBy", "updatedBy", likeSearchOption); - } - - /** * InScope(in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * @@ -1512,27 +1433,41 @@ } /** - * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * - * @param updatedBy The collection of updatedBy as inScope. - * @param inScopeOption The option of in-scope. (NotNull) + * @param updatedByList The collection of updatedBy as notInScope. */ - public void setUpdatedBy_InScope( + public void setUpdatedBy_NotInScope(Collection updatedByList) { + regUpdatedBy(CK_NINS, cTL(updatedByList)); + } + + /** + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param updatedBy The value of updatedBy as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) + */ + public void setUpdatedBy_LikeSearch( String updatedBy, - jp.sf.pal.timecard.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(updatedBy), getCValueUpdatedBy(), - "UPDATED_BY", "UpdatedBy", "updatedBy", inScopeOption); + jp.sf.pal.timecard.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(updatedBy), getCValueUpdatedBy(), "UPDATED_BY", + "UpdatedBy", "updatedBy", likeSearchOption); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param updatedByList The collection of updatedBy as notInScope. + * @param updatedBy The value of updatedBy as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setUpdatedBy_NotInScope(Collection updatedByList) { - regUpdatedBy(CK_NINS, cTL(updatedByList)); + public void setUpdatedBy_NotLikeSearch( + String updatedBy, + jp.sf.pal.timecard.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(updatedBy), getCValueUpdatedBy(), "UPDATED_BY", + "UpdatedBy", "updatedBy", likeSearchOption); } protected void regUpdatedBy(ConditionKey key, Object value) { @@ -1548,7 +1483,7 @@ abstract protected ConditionValue getCValueUpdatedBy(); /** - * Equal(=). And NullIgnored, OnceRegistered. {TIMESTAMP} + * Equal(=). And NullIgnored, OnlyOnceRegistered. {TIMESTAMP} * * @param deletedTime The value of deletedTime as equal. */ @@ -1557,7 +1492,7 @@ } /** - * NotEqual(!=). And NullIgnored, OnceRegistered. + * NotEqual(!=). And NullIgnored, OnlyOnceRegistered. * * @param deletedTime The value of deletedTime as notEqual. */ @@ -1566,7 +1501,7 @@ } /** - * GreaterThan(>). And NullIgnored, OnceRegistered. + * GreaterThan(>). And NullIgnored, OnlyOnceRegistered. * * @param deletedTime The value of deletedTime as greaterThan. */ @@ -1575,7 +1510,7 @@ } /** - * LessThan(>). And NullIgnored, OnceRegistered. + * LessThan(>). And NullIgnored, OnlyOnceRegistered. * * @param deletedTime The value of deletedTime as lessThan. */ @@ -1584,7 +1519,7 @@ } /** - * GreaterEqual(>). And NullIgnored, OnceRegistered. + * GreaterEqual(>). And NullIgnored, OnlyOnceRegistered. * * @param deletedTime The value of deletedTime as greaterEqual. */ @@ -1593,7 +1528,7 @@ } /** - * LessEqual(>). And NullIgnored, OnceRegistered. + * LessEqual(>). And NullIgnored, OnlyOnceRegistered. * * @param deletedTime The value of deletedTime as lessEqual. */ @@ -1603,7 +1538,7 @@ /** * FromTo($fromDate <= COLUMN_NAME <= $toDate). And NullIgnored, - * OnceRegistered. {TIMESTAMP} + * OnlyOnceRegistered. {TIMESTAMP} * * @param fromDate The from-date of deletedTime. (Nullable) * @param toDate The to-date of deletedTime. (Nullable) @@ -1621,7 +1556,7 @@ /** * FromTo($fromDate <= COLUMN_NAME < $toDate + 1). And NullIgnored, - * OnceRegistered. {TIMESTAMP} + * OnlyOnceRegistered. {TIMESTAMP} * * @param fromDate The from-date of deletedTime. (Nullable) * @param toDate The to-date of deletedTime. (Nullable) @@ -1635,14 +1570,14 @@ } /** - * IsNull(is null). And OnceRegistered. + * IsNull(is null). And OnlyOnceRegistered. */ public void setDeletedTime_IsNull() { regDeletedTime(CK_ISN, DUMMY_OBJECT); } /** - * IsNotNull(is not null). And OnceRegistered. + * IsNotNull(is not null). And OnlyOnceRegistered. */ public void setDeletedTime_IsNotNull() { regDeletedTime(CK_ISNN, DUMMY_OBJECT); @@ -1661,7 +1596,7 @@ abstract protected ConditionValue getCValueDeletedTime(); /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {VARCHAR(255)} + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {VARCHAR(255)} * * @param deletedBy The value of deletedBy as equal. */ @@ -1670,7 +1605,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param deletedBy The value of deletedBy as notEqual. */ @@ -1679,7 +1614,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param deletedBy The value of deletedBy as greaterThan. */ @@ -1688,7 +1623,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param deletedBy The value of deletedBy as lessThan. */ @@ -1697,7 +1632,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param deletedBy The value of deletedBy as greaterEqual. */ @@ -1706,7 +1641,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param deletedBy The value of deletedBy as lessEqual. */ @@ -1715,7 +1650,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param deletedBy The value of deletedBy as prefixSearch. */ @@ -1724,20 +1659,6 @@ } /** - * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, - * SeveralRegistered. - * - * @param deletedBy The value of deletedBy as likeSearch. - * @param likeSearchOption The option of like-search. (NotNull) - */ - public void setDeletedBy_LikeSearch( - String deletedBy, - jp.sf.pal.timecard.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { - registerLikeSearchQuery(CK_LS, fRES(deletedBy), getCValueDeletedBy(), - "DELETED_BY", "DeletedBy", "deletedBy", likeSearchOption); - } - - /** * InScope(in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * @@ -1748,38 +1669,52 @@ } /** - * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * - * @param deletedBy The collection of deletedBy as inScope. - * @param inScopeOption The option of in-scope. (NotNull) + * @param deletedByList The collection of deletedBy as notInScope. */ - public void setDeletedBy_InScope( + public void setDeletedBy_NotInScope(Collection deletedByList) { + regDeletedBy(CK_NINS, cTL(deletedByList)); + } + + /** + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param deletedBy The value of deletedBy as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) + */ + public void setDeletedBy_LikeSearch( String deletedBy, - jp.sf.pal.timecard.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(deletedBy), getCValueDeletedBy(), - "DELETED_BY", "DeletedBy", "deletedBy", inScopeOption); + jp.sf.pal.timecard.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(deletedBy), getCValueDeletedBy(), "DELETED_BY", + "DeletedBy", "deletedBy", likeSearchOption); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param deletedByList The collection of deletedBy as notInScope. + * @param deletedBy The value of deletedBy as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setDeletedBy_NotInScope(Collection deletedByList) { - regDeletedBy(CK_NINS, cTL(deletedByList)); + public void setDeletedBy_NotLikeSearch( + String deletedBy, + jp.sf.pal.timecard.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(deletedBy), getCValueDeletedBy(), "DELETED_BY", + "DeletedBy", "deletedBy", likeSearchOption); } /** - * IsNull(is null). And OnceRegistered. + * IsNull(is null). And OnlyOnceRegistered. */ public void setDeletedBy_IsNull() { regDeletedBy(CK_ISN, DUMMY_OBJECT); } /** - * IsNotNull(is not null). And OnceRegistered. + * IsNotNull(is not null). And OnlyOnceRegistered. */ public void setDeletedBy_IsNotNull() { regDeletedBy(CK_ISNN, DUMMY_OBJECT); @@ -1798,7 +1733,7 @@ abstract protected ConditionValue getCValueDeletedBy(); /** - * Equal(=). And NullIgnored, OnceRegistered. {NotNull : INTEGER} + * Equal(=). And NullIgnored, OnlyOnceRegistered. {NotNull : INTEGER} * * @param versionno The value of versionno as equal. */ @@ -1807,7 +1742,7 @@ } /** - * NotEqual(!=). And NullIgnored, OnceRegistered. + * NotEqual(!=). And NullIgnored, OnlyOnceRegistered. * * @param versionno The value of versionno as notEqual. */ @@ -1816,7 +1751,7 @@ } /** - * GreaterThan(>). And NullIgnored, OnceRegistered. + * GreaterThan(>). And NullIgnored, OnlyOnceRegistered. * * @param versionno The value of versionno as greaterThan. */ @@ -1825,7 +1760,7 @@ } /** - * LessThan(<). And NullIgnored, OnceRegistered. + * LessThan(<). And NullIgnored, OnlyOnceRegistered. * * @param versionno The value of versionno as lessThan. */ @@ -1834,7 +1769,7 @@ } /** - * GreaterEqual(>=). And NullIgnored, OnceRegistered. + * GreaterEqual(>=). And NullIgnored, OnlyOnceRegistered. * * @param versionno The value of versionno as greaterEqual. */ @@ -1843,7 +1778,7 @@ } /** - * LessEqual(<=). And NullIgnored, OnceRegistered. + * LessEqual(<=). And NullIgnored, OnlyOnceRegistered. * * @param versionno The value of versionno as lessEqual. */ @@ -1883,6 +1818,50 @@ abstract protected ConditionValue getCValueVersionno(); + public SSQFunction scalar_Equal() { + return xcreateSSQFunction("="); + } + + public SSQFunction scalar_GreaterEqual() { + return xcreateSSQFunction(">="); + } + + public SSQFunction scalar_GreaterThan() { + return xcreateSSQFunction(">"); + } + + public SSQFunction scalar_LessEqual() { + return xcreateSSQFunction("<="); + } + + public SSQFunction scalar_LessThan() { + return xcreateSSQFunction("<"); + } + + protected SSQFunction xcreateSSQFunction(final String operand) { + return new SSQFunction(new SSQSetupper() { + public void setup(String function, SubQuery subQuery) { + xscalarSubQuery(function, subQuery, operand); + } + }); + } + + protected void xscalarSubQuery(String function, + SubQuery subQuery, String operand) { + assertObjectNotNull("subQuery", subQuery); + RoleInfoCB cb = new RoleInfoCB(); + cb.xsetupForScalarSubQuery(); + subQuery.query(cb); + String subQueryPropertyName = keepScalarSubQuery(cb.query()); // for + // saving + // query + // -value. + registerScalarSubQuery(function, cb.query(), subQueryPropertyName, + operand); + } + + public abstract String keepScalarSubQuery(RoleInfoCQ subQuery); + // Very Internal (for Suppressing Warn about 'Not Use Import') protected String getConditionBeanClassNameInternally() { return RoleInfoCB.class.getName(); Modified: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/cbean/cq/bs/AbstractBsRoleMappingCQ.java =================================================================== --- timecard/trunk/src/main/java/jp/sf/pal/timecard/db/cbean/cq/bs/AbstractBsRoleMappingCQ.java 2008-12-27 22:18:30 UTC (rev 1630) +++ timecard/trunk/src/main/java/jp/sf/pal/timecard/db/cbean/cq/bs/AbstractBsRoleMappingCQ.java 2008-12-27 22:20:25 UTC (rev 1631) @@ -11,16 +11,13 @@ import jp.sf.pal.timecard.db.cbean.RoleInfoCB; import jp.sf.pal.timecard.db.cbean.RoleMappingCB; import jp.sf.pal.timecard.db.cbean.UserInfoCB; -import jp.sf.pal.timecard.db.cbean.cq.RoleInfoCQ; import jp.sf.pal.timecard.db.cbean.cq.RoleMappingCQ; -import jp.sf.pal.timecard.db.cbean.cq.UserInfoCQ; /** * The abstract condition-query of ROLE_MAPPING. * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public abstract class AbstractBsRoleMappingCQ extends AbstractConditionQuery { //========================================================================== @@ -50,7 +47,8 @@ // ===== /** - * Equal(=). And NullIgnored, OnceRegistered. {PK : ID : NotNull : INTEGER} + * Equal(=). And NullIgnored, OnlyOnceRegistered. {PK : ID : NotNull : + * INTEGER} * * @param id The value of id as equal. */ @@ -59,7 +57,7 @@ } /** - * NotEqual(!=). And NullIgnored, OnceRegistered. + * NotEqual(!=). And NullIgnored, OnlyOnceRegistered. * * @param id The value of id as notEqual. */ @@ -68,7 +66,7 @@ } /** - * GreaterThan(>). And NullIgnored, OnceRegistered. + * GreaterThan(>). And NullIgnored, OnlyOnceRegistered. * * @param id The value of id as greaterThan. */ @@ -77,7 +75,7 @@ } /** - * LessThan(<). And NullIgnored, OnceRegistered. + * LessThan(<). And NullIgnored, OnlyOnceRegistered. * * @param id The value of id as lessThan. */ @@ -86,7 +84,7 @@ } /** - * GreaterEqual(>=). And NullIgnored, OnceRegistered. + * GreaterEqual(>=). And NullIgnored, OnlyOnceRegistered. * * @param id The value of id as greaterEqual. */ @@ -95,7 +93,7 @@ } /** - * LessEqual(<=). And NullIgnored, OnceRegistered. + * LessEqual(<=). And NullIgnored, OnlyOnceRegistered. * * @param id The value of id as lessEqual. */ @@ -124,14 +122,14 @@ } /** - * IsNull(is null). And OnceRegistered. + * IsNull(is null). And OnlyOnceRegistered. */ public void setId_IsNull() { regId(CK_ISN, DUMMY_OBJECT); } /** - * IsNotNull(is not null). And OnceRegistered. + * IsNotNull(is not null). And OnlyOnceRegistered. */ public void setId_IsNotNull() { regId(CK_ISNN, DUMMY_OBJECT); @@ -148,8 +146,8 @@ abstract protected ConditionValue getCValueId(); /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {NotNull : VARCHAR(255) - * : FK to USER_INFO} + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {NotNull : + * VARCHAR(255) : FK to USER_INFO} * * @param userId The value of userId as equal. */ @@ -158,7 +156,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param userId The value of userId as notEqual. */ @@ -167,7 +165,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param userId The value of userId as greaterThan. */ @@ -176,7 +174,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param userId The value of userId as lessThan. */ @@ -185,7 +183,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param userId The value of userId as greaterEqual. */ @@ -194,7 +192,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param userId The value of userId as lessEqual. */ @@ -203,7 +201,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param userId The value of userId as prefixSearch. */ @@ -212,20 +210,6 @@ } /** - * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, - * SeveralRegistered. - * - * @param userId The value of userId as likeSearch. - * @param likeSearchOption The option of like-search. (NotNull) - */ - public void setUserId_LikeSearch( - String userId, - jp.sf.pal.timecard.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { - registerLikeSearchQuery(CK_LS, fRES(userId), getCValueUserId(), - "USER_ID", "UserId", "userId", likeSearchOption); - } - - /** * InScope(in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * @@ -236,42 +220,41 @@ } /** - * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * - * @param userId The collection of userId as inScope. - * @param inScopeOption The option of in-scope. (NotNull) + * @param userIdList The collection of userId as notInScope. */ - public void setUserId_InScope( - String userId, - jp.sf.pal.timecard.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(userId), getCValueUserId(), - "USER_ID", "UserId", "userId", inScopeOption); + public void setUserId_NotInScope(Collection userIdList) { + regUserId(CK_NINS, cTL(userIdList)); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param userIdList The collection of userId as notInScope. + * @param userId The value of userId as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) */ - public void setUserId_NotInScope(Collection userIdList) { - regUserId(CK_NINS, cTL(userIdList)); + public void setUserId_LikeSearch( + String userId, + jp.sf.pal.timecard.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(userId), getCValueUserId(), "USER_ID", "UserId", + "userId", likeSearchOption); } /** - * @param userInfoCBquery Query. - * @deprecated Please use inScopeUserInfo(subQuery) method. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param userId The value of userId as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setUserId_InScopeSubQuery_UserInfo(UserInfoCQ userInfoCBquery) { - String subQueryPropertyName = keepUserId_InScopeSubQuery_UserInfo(userInfoCBquery);// for - // saving - // query - // - - // value - // . - registerInScopeSubQuery(userInfoCBquery, "USER_ID", "USER_ID", - subQueryPropertyName); + public void setUserId_NotLikeSearch( + String userId, + jp.sf.pal.timecard.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(userId), getCValueUserId(), "USER_ID", "UserId", + "userId", likeSearchOption); } public void inScopeUserInfo(SubQuery subQuery) { @@ -280,12 +263,12 @@ cb.xsetupForInScopeSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepUserId_InScopeSubQuery_UserInfo(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerInScopeSubQuery(cb.query(), "USER_ID", "USER_ID", subQueryPropertyName); } - abstract public String keepUserId_InScopeSubQuery_UserInfo( + public abstract String keepUserId_InScopeSubQuery_UserInfo( jp.sf.pal.timecard.db.cbean.cq.UserInfoCQ subQuery); protected void regUserId(ConditionKey key, Object value) { @@ -301,8 +284,8 @@ abstract protected ConditionValue getCValueUserId(); /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {NotNull : VARCHAR(255) - * : FK to ROLE_INFO} + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {NotNull : + * VARCHAR(255) : FK to ROLE_INFO} * * @param roleId The value of roleId as equal. */ @@ -311,7 +294,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param roleId The value of roleId as notEqual. */ @@ -320,7 +303,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param roleId The value of roleId as greaterThan. */ @@ -329,7 +312,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param roleId The value of roleId as lessThan. */ @@ -338,7 +321,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param roleId The value of roleId as greaterEqual. */ @@ -347,7 +330,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param roleId The value of roleId as lessEqual. */ @@ -356,7 +339,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param roleId The value of roleId as prefixSearch. */ @@ -365,20 +348,6 @@ } /** - * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, - * SeveralRegistered. - * - * @param roleId The value of roleId as likeSearch. - * @param likeSearchOption The option of like-search. (NotNull) - */ - public void setRoleId_LikeSearch( - String roleId, - jp.sf.pal.timecard.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { - registerLikeSearchQuery(CK_LS, fRES(roleId), getCValueRoleId(), - "ROLE_ID", "RoleId", "roleId", likeSearchOption); - } - - /** * InScope(in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * @@ -389,42 +358,41 @@ } /** - * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * - * @param roleId The collection of roleId as inScope. - * @param inScopeOption The option of in-scope. (NotNull) + * @param roleIdList The collection of roleId as notInScope. */ - public void setRoleId_InScope( - String roleId, - jp.sf.pal.timecard.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(roleId), getCValueRoleId(), - "ROLE_ID", "RoleId", "roleId", inScopeOption); + public void setRoleId_NotInScope(Collection roleIdList) { + regRoleId(CK_NINS, cTL(roleIdList)); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param roleIdList The collection of roleId as notInScope. + * @param roleId The value of roleId as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) */ - public void setRoleId_NotInScope(Collection roleIdList) { - regRoleId(CK_NINS, cTL(roleIdList)); + public void setRoleId_LikeSearch( + String roleId, + jp.sf.pal.timecard.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(roleId), getCValueRoleId(), "ROLE_ID", "RoleId", + "roleId", likeSearchOption); } /** - * @param roleInfoCBquery Query. - * @deprecated Please use inScopeRoleInfo(subQuery) method. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param roleId The value of roleId as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setRoleId_InScopeSubQuery_RoleInfo(RoleInfoCQ roleInfoCBquery) { - String subQueryPropertyName = keepRoleId_InScopeSubQuery_RoleInfo(roleInfoCBquery);// for - // saving - // query - // - - // value - // . - registerInScopeSubQuery(roleInfoCBquery, "ROLE_ID", "ROLE_ID", - subQueryPropertyName); + public void setRoleId_NotLikeSearch( + String roleId, + jp.sf.pal.timecard.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(roleId), getCValueRoleId(), "ROLE_ID", "RoleId", + "roleId", likeSearchOption); } public void inScopeRoleInfo(SubQuery subQuery) { @@ -433,12 +401,12 @@ cb.xsetupForInScopeSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepRoleId_InScopeSubQuery_RoleInfo(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerInScopeSubQuery(cb.query(), "ROLE_ID", "ROLE_ID", subQueryPropertyName); } - abstract public String keepRoleId_InScopeSubQuery_RoleInfo( + public abstract String keepRoleId_InScopeSubQuery_RoleInfo( jp.sf.pal.timecard.db.cbean.cq.RoleInfoCQ subQuery); protected void regRoleId(ConditionKey key, Object value) { @@ -453,6 +421,50 @@ abstract protected ConditionValue getCValueRoleId(); + public SSQFunction scalar_Equal() { + return xcreateSSQFunction("="); + } + + public SSQFunction scalar_GreaterEqual() { + return xcreateSSQFunction(">="); + } + + public SSQFunction scalar_GreaterThan() { + return xcreateSSQFunction(">"); + } + + public SSQFunction scalar_LessEqual() { + return xcreateSSQFunction("<="); + } + + public SSQFunction scalar_LessThan() { + return xcreateSSQFunction("<"); + } + + protected SSQFunction xcreateSSQFunction(final String operand) { + return new SSQFunction(new SSQSetupper() { + public void setup(String function, SubQuery subQuery) { + xscalarSubQuery(function, subQuery, operand); + } + }); + } + + protected void xscalarSubQuery(String function, + SubQuery subQuery, String operand) { + assertObjectNotNull("subQuery", subQuery); + RoleMappingCB cb = new RoleMappingCB(); + cb.xsetupForScalarSubQuery(); + subQuery.query(cb); + String subQueryPropertyName = keepScalarSubQuery(cb.query()); // for + // saving + // query + // -value. + registerScalarSubQuery(function, cb.query(), subQueryPropertyName, + operand); + } + + public abstract String keepScalarSubQuery(RoleMappingCQ subQuery); + // Very Internal (for Suppressing Warn about 'Not Use Import') protected String getConditionBeanClassNameInternally() { return RoleMappingCB.class.getName(); Modified: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/cbean/cq/bs/AbstractBsUserInfoCQ.java =================================================================== --- timecard/trunk/src/main/java/jp/sf/pal/timecard/db/cbean/cq/bs/AbstractBsUserInfoCQ.java 2008-12-27 22:18:30 UTC (rev 1630) +++ timecard/trunk/src/main/java/jp/sf/pal/timecard/db/cbean/cq/bs/AbstractBsUserInfoCQ.java 2008-12-27 22:20:25 UTC (rev 1631) @@ -15,9 +15,7 @@ import jp.sf.pal.timecard.db.cbean.RoleMappingCB; import jp.sf.pal.timecard.db.cbean.UserInfoCB; import jp.sf.pal.timecard.db.cbean.cq.EmployeeCQ; -import jp.sf.pal.timecard.db.cbean.cq.GroupInfoCQ; import jp.sf.pal.timecard.db.cbean.cq.GroupMappingCQ; -import jp.sf.pal.timecard.db.cbean.cq.RoleInfoCQ; import jp.sf.pal.timecard.db.cbean.cq.RoleMappingCQ; import jp.sf.pal.timecard.db.cbean.cq.UserInfoCQ; @@ -26,7 +24,6 @@ * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public abstract class AbstractBsUserInfoCQ extends AbstractConditionQuery { //========================================================================== @@ -56,7 +53,7 @@ // ===== /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {PK : NotNull : + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {PK : NotNull : * VARCHAR(255)} * * @param userId The value of userId as equal. @@ -66,7 +63,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param userId The value of userId as notEqual. */ @@ -75,7 +72,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param userId The value of userId as greaterThan. */ @@ -84,7 +81,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param userId The value of userId as lessThan. */ @@ -93,7 +90,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param userId The value of userId as greaterEqual. */ @@ -102,7 +99,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param userId The value of userId as lessEqual. */ @@ -111,7 +108,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param userId The value of userId as prefixSearch. */ @@ -120,20 +117,6 @@ } /** - * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, - * SeveralRegistered. - * - * @param userId The value of userId as likeSearch. - * @param likeSearchOption The option of like-search. (NotNull) - */ - public void setUserId_LikeSearch( - String userId, - jp.sf.pal.timecard.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { - registerLikeSearchQuery(CK_LS, fRES(userId), getCValueUserId(), - "USER_ID", "UserId", "userId", likeSearchOption); - } - - /** * InScope(in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * @@ -144,43 +127,41 @@ } /** - * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * - * @param userId The collection of userId as inScope. - * @param inScopeOption The option of in-scope. (NotNull) + * @param userIdList The collection of userId as notInScope. */ - public void setUserId_InScope( - String userId, - jp.sf.pal.timecard.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(userId), getCValueUserId(), - "USER_ID", "UserId", "userId", inScopeOption); + public void setUserId_NotInScope(Collection userIdList) { + regUserId(CK_NINS, cTL(userIdList)); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param userIdList The collection of userId as notInScope. + * @param userId The value of userId as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) */ - public void setUserId_NotInScope(Collection userIdList) { - regUserId(CK_NINS, cTL(userIdList)); + public void setUserId_LikeSearch( + String userId, + jp.sf.pal.timecard.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(userId), getCValueUserId(), "USER_ID", "UserId", + "userId", likeSearchOption); } /** - * @param employeeCBquery Query. - * @deprecated Please use inScopeEmployeeByUsernameList(subQuery) method. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param userId The value of userId as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setUserId_InScopeSubQuery_EmployeeByUsernameList( - EmployeeCQ employeeCBquery) { - String subQueryPropertyName = keepUserId_InScopeSubQuery_EmployeeByUsernameList(employeeCBquery);// for - // saving - // query - // - - // value - // . - registerInScopeSubQuery(employeeCBquery, "USER_ID", "USERNAME", - subQueryPropertyName); + public void setUserId_NotLikeSearch( + String userId, + jp.sf.pal.timecard.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(userId), getCValueUserId(), "USER_ID", "UserId", + "userId", likeSearchOption); } public void inScopeEmployeeByUsernameList(SubQuery subQuery) { @@ -189,102 +170,54 @@ cb.xsetupForInScopeSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepUserId_InScopeSubQuery_EmployeeByUsernameList(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerInScopeSubQuery(cb.query(), "USER_ID", "USERNAME", subQueryPropertyName); } - abstract public String keepUserId_InScopeSubQuery_EmployeeByUsernameList( + public abstract String keepUserId_InScopeSubQuery_EmployeeByUsernameList( EmployeeCQ subQuery); - /** - * @param employeeCBquery Query. - * @deprecated Please use inScopeEmployeeByManagerList(subQuery) method. - */ - public void setUserId_InScopeSubQuery_EmployeeByManagerList( - EmployeeCQ employeeCBquery) { - String subQueryPropertyName = keepUserId_InScopeSubQuery_EmployeeByManagerList(employeeCBquery);// for - // saving - // query - // - - // value - // . - registerInScopeSubQuery(employeeCBquery, "USER_ID", "MANAGER", - subQueryPropertyName); - } - public void inScopeEmployeeByManagerList(SubQuery subQuery) { assertObjectNotNull("subQuery", subQuery); EmployeeCB cb = new EmployeeCB(); cb.xsetupForInScopeSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepUserId_InScopeSubQuery_EmployeeByManagerList(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerInScopeSubQuery(cb.query(), "USER_ID", "MANAGER", subQueryPropertyName); } - abstract public String keepUserId_InScopeSubQuery_EmployeeByManagerList( + public abstract String keepUserId_InScopeSubQuery_EmployeeByManagerList( EmployeeCQ subQuery); - /** - * @param groupMappingCBquery Query. - * @deprecated Please use inScopeGroupMappingList(subQuery) method. - */ - public void setUserId_InScopeSubQuery_GroupMappingList( - GroupMappingCQ groupMappingCBquery) { - String subQueryPropertyName = keepUserId_InScopeSubQuery_GroupMappingList(groupMappingCBquery);// for - // saving - // query - // - - // value - // . - registerInScopeSubQuery(groupMappingCBquery, "USER_ID", "USER_ID", - subQueryPropertyName); - } - public void inScopeGroupMappingList(SubQuery subQuery) { assertObjectNotNull("subQuery", subQuery); GroupMappingCB cb = new GroupMappingCB(); cb.xsetupForInScopeSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepUserId_InScopeSubQuery_GroupMappingList(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerInScopeSubQuery(cb.query(), "USER_ID", "USER_ID", subQueryPropertyName); } - abstract public String keepUserId_InScopeSubQuery_GroupMappingList( + public abstract String keepUserId_InScopeSubQuery_GroupMappingList( GroupMappingCQ subQuery); - /** - * @param roleMappingCBquery Query. - * @deprecated Please use inScopeRoleMappingList(subQuery) method. - */ - public void setUserId_InScopeSubQuery_RoleMappingList( - RoleMappingCQ roleMappingCBquery) { - String subQueryPropertyName = keepUserId_InScopeSubQuery_RoleMappingList(roleMappingCBquery);// for - // saving - // query - // - - // value - // . - registerInScopeSubQuery(roleMappingCBquery, "USER_ID", "USER_ID", - subQueryPropertyName); - } - public void inScopeRoleMappingList(SubQuery subQuery) { assertObjectNotNull("subQuery", subQuery); RoleMappingCB cb = new RoleMappingCB(); cb.xsetupForInScopeSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepUserId_InScopeSubQuery_RoleMappingList(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerInScopeSubQuery(cb.query(), "USER_ID", "USER_ID", subQueryPropertyName); } - abstract public String keepUserId_InScopeSubQuery_RoleMappingList( + public abstract String keepUserId_InScopeSubQuery_RoleMappingList( RoleMappingCQ subQuery); public void notInScopeEmployeeByUsernameList(SubQuery subQuery) { @@ -293,12 +226,12 @@ cb.xsetupForInScopeSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepUserId_NotInScopeSubQuery_EmployeeByUsernameList(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerNotInScopeSubQuery(cb.query(), "USER_ID", "USERNAME", subQueryPropertyName); } - abstract public String keepUserId_NotInScopeSubQuery_EmployeeByUsernameList( + public abstract String keepUserId_NotInScopeSubQuery_EmployeeByUsernameList( EmployeeCQ subQuery); public void notInScopeEmployeeByManagerList(SubQuery subQuery) { @@ -307,12 +240,12 @@ cb.xsetupForInScopeSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepUserId_NotInScopeSubQuery_EmployeeByManagerList(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerNotInScopeSubQuery(cb.query(), "USER_ID", "MANAGER", subQueryPropertyName); } - abstract public String keepUserId_NotInScopeSubQuery_EmployeeByManagerList( + public abstract String keepUserId_NotInScopeSubQuery_EmployeeByManagerList( EmployeeCQ subQuery); public void notInScopeGroupMappingList(SubQuery subQuery) { @@ -321,12 +254,12 @@ cb.xsetupForInScopeSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepUserId_NotInScopeSubQuery_GroupMappingList(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerNotInScopeSubQuery(cb.query(), "USER_ID", "USER_ID", subQueryPropertyName); } - abstract public String keepUserId_NotInScopeSubQuery_GroupMappingList( + public abstract String keepUserId_NotInScopeSubQuery_GroupMappingList( GroupMappingCQ subQuery); public void notInScopeRoleMappingList(SubQuery subQuery) { @@ -335,31 +268,15 @@ cb.xsetupForInScopeSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepUserId_NotInScopeSubQuery_RoleMappingList(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerNotInScopeSubQuery(cb.query(), "USER_ID", "USER_ID", subQueryPropertyName); } - abstract public String keepUserId_NotInScopeSubQuery_RoleMappingList( + public abstract String keepUserId_NotInScopeSubQuery_RoleMappingList( RoleMappingCQ subQuery); /** - * @param employeeCBquery Query. - * @deprecated Please use existsEmployeeByUsernameList(subQuery) method. - */ - public void setUserId_ExistsSubQuery_EmployeeByUsernameList( - EmployeeCQ employeeCBquery) { - String subQueryPropertyName = keepUserId_ExistsSubQuery_EmployeeByUsernameList(employeeCBquery);// for - // saving - // query - // - - // value - // . - registerExistsSubQuery(employeeCBquery, "USER_ID", "USERNAME", - subQueryPropertyName); - } - - /** * Set up 'exists' sub-query. {exists (select USERNAME from EMPLOYEE where * ...)} * @@ -373,31 +290,15 @@ cb.xsetupForExistsSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepUserId_ExistsSubQuery_EmployeeByUsernameList(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerExistsSubQuery(cb.query(), "USER_ID", "USERNAME", subQueryPropertyName); } - abstract public String keepUserId_ExistsSubQuery_EmployeeByUsernameList( + public abstract String keepUserId_ExistsSubQuery_EmployeeByUsernameList( EmployeeCQ subQuery); /** - * @param employeeCBquery Query. - * @deprecated Please use existsEmployeeByManagerList(subQuery) method. - */ - public void setUserId_ExistsSubQuery_EmployeeByManagerList( - EmployeeCQ employeeCBquery) { - String subQueryPropertyName = keepUserId_ExistsSubQuery_EmployeeByManagerList(employeeCBquery);// for - // saving - // query - // - - // value - // . - registerExistsSubQuery(employeeCBquery, "USER_ID", "MANAGER", - subQueryPropertyName); - } - - /** * Set up 'exists' sub-query. {exists (select MANAGER from EMPLOYEE where * ...)} * @@ -411,31 +312,15 @@ cb.xsetupForExistsSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepUserId_ExistsSubQuery_EmployeeByManagerList(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerExistsSubQuery(cb.query(), "USER_ID", "MANAGER", subQueryPropertyName); } - abstract public String keepUserId_ExistsSubQuery_EmployeeByManagerList( + public abstract String keepUserId_ExistsSubQuery_EmployeeByManagerList( EmployeeCQ subQuery); /** - * @param groupMappingCBquery Query. - * @deprecated Please use existsGroupMappingList(subQuery) method. - */ - public void setUserId_ExistsSubQuery_GroupMappingList( - GroupMappingCQ groupMappingCBquery) { - String subQueryPropertyName = keepUserId_ExistsSubQuery_GroupMappingList(groupMappingCBquery);// for - // saving - // query - // - - // value - // . - registerExistsSubQuery(groupMappingCBquery, "USER_ID", "USER_ID", - subQueryPropertyName); - } - - /** * Set up 'exists' sub-query. {exists (select USER_ID from GROUP_MAPPING * where ...)} * @@ -448,31 +333,15 @@ cb.xsetupForExistsSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepUserId_ExistsSubQuery_GroupMappingList(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerExistsSubQuery(cb.query(), "USER_ID", "USER_ID", subQueryPropertyName); } - abstract public String keepUserId_ExistsSubQuery_GroupMappingList( + public abstract String keepUserId_ExistsSubQuery_GroupMappingList( GroupMappingCQ subQuery); /** - * @param roleMappingCBquery Query. - * @deprecated Please use existsRoleMappingList(subQuery) method. - */ - public void setUserId_ExistsSubQuery_RoleMappingList( - RoleMappingCQ roleMappingCBquery) { - String subQueryPropertyName = keepUserId_ExistsSubQuery_RoleMappingList(roleMappingCBquery);// for - // saving - // query - // - - // value - // . - registerExistsSubQuery(roleMappingCBquery, "USER_ID", "USER_ID", - subQueryPropertyName); - } - - /** * Set up 'exists' sub-query. {exists (select USER_ID from ROLE_MAPPING * where ...)} * @@ -485,12 +354,12 @@ cb.xsetupForExistsSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepUserId_ExistsSubQuery_RoleMappingList(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerExistsSubQuery(cb.query(), "USER_ID", "USER_ID", subQueryPropertyName); } - abstract public String keepUserId_ExistsSubQuery_RoleMappingList( + public abstract String keepUserId_ExistsSubQuery_RoleMappingList( RoleMappingCQ subQuery); /** @@ -507,12 +376,12 @@ cb.xsetupForExistsSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepUserId_NotExistsSubQuery_EmployeeByUsernameList(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerNotExistsSubQuery(cb.query(), "USER_ID", "USERNAME", subQueryPropertyName); } - abstract public String keepUserId_NotExistsSubQuery_EmployeeByUsernameList( + public abstract String keepUserId_NotExistsSubQuery_EmployeeByUsernameList( EmployeeCQ subQuery); /** @@ -529,12 +398,12 @@ cb.xsetupForExistsSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepUserId_NotExistsSubQuery_EmployeeByManagerList(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerNotExistsSubQuery(cb.query(), "USER_ID", "MANAGER", subQueryPropertyName); } - abstract public String keepUserId_NotExistsSubQuery_EmployeeByManagerList( + public abstract String keepUserId_NotExistsSubQuery_EmployeeByManagerList( EmployeeCQ subQuery); /** @@ -551,12 +420,12 @@ cb.xsetupForExistsSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepUserId_NotExistsSubQuery_GroupMappingList(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerNotExistsSubQuery(cb.query(), "USER_ID", "USER_ID", subQueryPropertyName); } - abstract public String keepUserId_NotExistsSubQuery_GroupMappingList( + public abstract String keepUserId_NotExistsSubQuery_GroupMappingList( GroupMappingCQ subQuery); /** @@ -572,83 +441,83 @@ cb.xsetupForExistsSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepUserId_NotExistsSubQuery_RoleMappingList(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerNotExistsSubQuery(cb.query(), "USER_ID", "USER_ID", subQueryPropertyName); } - abstract public String keepUserId_NotExistsSubQuery_RoleMappingList( + public abstract String keepUserId_NotExistsSubQuery_RoleMappingList( RoleMappingCQ subQuery); public void xderiveEmployeeByUsernameList(String function, SubQuery subQuery, String aliasName) { assertObjectNotNull("subQuery", subQuery); EmployeeCB cb = new EmployeeCB(); - cb.xsetupForDeriveReferrer(); + cb.xsetupForDerivedReferrer(); subQuery.query(cb); - String subQueryPropertyName = keepUserId_DeriveSubQuery_EmployeeByUsernameList(cb - .query());// for saving query-value. - registerDeriveSubQuery(function, cb.query(), "USER_ID", "USERNAME", - subQueryPropertyName, aliasName); + String subQueryPropertyName = keepUserId_DerivedReferrer_EmployeeByUsernameList(cb + .query()); // for saving query-value. + registerDerivedReferrerSubQuery(function, cb.query(), "USER_ID", + "USERNAME", subQueryPropertyName, aliasName); } - abstract public String keepUserId_DeriveSubQuery_EmployeeByUsernameList( + public abstract String keepUserId_DerivedReferrer_EmployeeByUsernameList( EmployeeCQ subQuery); public void xderiveEmployeeByManagerList(String function, SubQuery subQuery, String aliasName) { assertObjectNotNull("subQuery", subQuery); EmployeeCB cb = new EmployeeCB(); - cb.xsetupForDeriveReferrer(); + cb.xsetupForDerivedReferrer(); subQuery.query(cb); - String subQueryPropertyName = keepUserId_DeriveSubQuery_EmployeeByManagerList(cb - .query());// for saving query-value. - registerDeriveSubQuery(function, cb.query(), "USER_ID", "MANAGER", - subQueryPropertyName, aliasName); + String subQueryPropertyName = keepUserId_DerivedReferrer_EmployeeByManagerList(cb + .query()); // for saving query-value. + registerDerivedReferrerSubQuery(function, cb.query(), "USER_ID", + "MANAGER", subQueryPropertyName, aliasName); } - abstract public String keepUserId_DeriveSubQuery_EmployeeByManagerList( + public abstract String keepUserId_DerivedReferrer_EmployeeByManagerList( EmployeeCQ subQuery); public void xderiveGroupMappingList(String function, SubQuery subQuery, String aliasName) { assertObjectNotNull("subQuery", subQuery); GroupMappingCB cb = new GroupMappingCB(); - cb.xsetupForDeriveReferrer(); + cb.xsetupForDerivedReferrer(); subQuery.query(cb); - String subQueryPropertyName = keepUserId_DeriveSubQuery_GroupMappingList(cb - .query());// for saving query-value. - registerDeriveSubQuery(function, cb.query(), "USER_ID", "USER_ID", - subQueryPropertyName, aliasName); + String subQueryPropertyName = keepUserId_DerivedReferrer_GroupMappingList(cb + .query()); // for saving query-value. + registerDerivedReferrerSubQuery(function, cb.query(), "USER_ID", + "USER_ID", subQueryPropertyName, aliasName); } - abstract public String keepUserId_DeriveSubQuery_GroupMappingList( + public abstract String keepUserId_DerivedReferrer_GroupMappingList( GroupMappingCQ subQuery); public void xderiveRoleMappingList(String function, SubQuery subQuery, String aliasName) { assertObjectNotNull("subQuery", subQuery); RoleMappingCB cb = new RoleMappingCB(); - cb.xsetupForDeriveReferrer(); + cb.xsetupForDerivedReferrer(); subQuery.query(cb); - String subQueryPropertyName = keepUserId_DeriveSubQuery_RoleMappingList(cb - .query());// for saving query-value. - registerDeriveSubQuery(function, cb.query(), "USER_ID", "USER_ID", - subQueryPropertyName, aliasName); + String subQueryPropertyName = keepUserId_DerivedReferrer_RoleMappingList(cb + .query()); // for saving query-value. + registerDerivedReferrerSubQuery(function, cb.query(), "USER_ID", + "USER_ID", subQueryPropertyName, aliasName); } - abstract public String keepUserId_DeriveSubQuery_RoleMappingList( + public abstract String keepUserId_DerivedReferrer_RoleMappingList( RoleMappingCQ subQuery); /** - * IsNull(is null). And OnceRegistered. + * IsNull(is null). And OnlyOnceRegistered. */ public void setUserId_IsNull() { regUserId(CK_ISN, DUMMY_OBJECT); } /** - * IsNotNull(is not null). And OnceRegistered. + * IsNotNull(is not null). And OnlyOnceRegistered. */ public void setUserId_IsNotNull() { regUserId(CK_ISNN, DUMMY_OBJECT); @@ -667,7 +536,7 @@ abstract protected ConditionValue getCValueUserId(); /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {VARCHAR(100)} + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {VARCHAR(100)} * * @param givenName The value of givenName as equal. */ @@ -676,7 +545,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param givenName The value of givenName as notEqual. */ @@ -685,7 +554,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param givenName The value of givenName as greaterThan. */ @@ -694,7 +563,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param givenName The value of givenName as lessThan. */ @@ -703,7 +572,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param givenName The value of givenName as greaterEqual. */ @@ -712,7 +581,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param givenName The value of givenName as lessEqual. */ @@ -721,7 +590,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param givenName The value of givenName as prefixSearch. */ @@ -730,20 +599,6 @@ } /** - * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, - * SeveralRegistered. - * - * @param givenName The value of givenName as likeSearch. - * @param likeSearchOption The option of like-search. (NotNull) - */ - public void setGivenName_LikeSearch( - String givenName, - jp.sf.pal.timecard.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { - registerLikeSearchQuery(CK_LS, fRES(givenName), getCValueGivenName(), - "GIVEN_NAME", "GivenName", "givenName", likeSearchOption); - } - - /** * InScope(in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * @@ -754,38 +609,52 @@ } /** - * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * - * @param givenName The collection of givenName as inScope. - * @param inScopeOption The option of in-scope. (NotNull) + * @param givenNameList The collection of givenName as notInScope. */ - public void setGivenName_InScope( + public void setGivenName_NotInScope(Collection givenNameList) { + regGivenName(CK_NINS, cTL(givenNameList)); + } + + /** + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param givenName The value of givenName as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) + */ + public void setGivenName_LikeSearch( String givenName, - jp.sf.pal.timecard.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(givenName), getCValueGivenName(), - "GIVEN_NAME", "GivenName", "givenName", inScopeOption); + jp.sf.pal.timecard.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(givenName), getCValueGivenName(), "GIVEN_NAME", + "GivenName", "givenName", likeSearchOption); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param givenNameList The collection of givenName as notInScope. + * @param givenName The value of givenName as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setGivenName_NotInScope(Collection givenNameList) { - regGivenName(CK_NINS, cTL(givenNameList)); + public void setGivenName_NotLikeSearch( + String givenName, + jp.sf.pal.timecard.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(givenName), getCValueGivenName(), "GIVEN_NAME", + "GivenName", "givenName", likeSearchOption); } /** - * IsNull(is null). And OnceRegistered. + * IsNull(is null). And OnlyOnceRegistered. */ public void setGivenName_IsNull() { regGivenName(CK_ISN, DUMMY_OBJECT); } /** - * IsNotNull(is not null). And OnceRegistered. + * IsNotNull(is not null). And OnlyOnceRegistered. */ public void setGivenName_IsNotNull() { regGivenName(CK_ISNN, DUMMY_OBJECT); @@ -804,7 +673,7 @@ abstract protected ConditionValue getCValueGivenName(); /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {VARCHAR(100)} + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {VARCHAR(100)} * * @param familyName The value of familyName as equal. */ @@ -813,7 +682,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param familyName The value of familyName as notEqual. */ @@ -822,7 +691,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param familyName The value of familyName as greaterThan. */ @@ -831,7 +700,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param familyName The value of familyName as lessThan. */ @@ -840,7 +709,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param familyName The value of familyName as greaterEqual. */ @@ -849,7 +718,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param familyName The value of familyName as lessEqual. */ @@ -858,7 +727,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param familyName The value of familyName as prefixSearch. */ @@ -867,20 +736,6 @@ } /** - * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, - * SeveralRegistered. - * - * @param familyName The value of familyName as likeSearch. - * @param likeSearchOption The option of like-search. (NotNull) - */ - public void setFamilyName_LikeSearch( - String familyName, - jp.sf.pal.timecard.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { - registerLikeSearchQuery(CK_LS, fRES(familyName), getCValueFamilyName(), - "FAMILY_NAME", "FamilyName", "familyName", likeSearchOption); - } - - /** * InScope(in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * @@ -891,38 +746,52 @@ } /** - * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * - * @param familyName The collection of familyName as inScope. - * @param inScopeOption The option of in-scope. (NotNull) + * @param familyNameList The collection of familyName as notInScope. */ - public void setFamilyName_InScope( + public void setFamilyName_NotInScope(Collection familyNameList) { + regFamilyName(CK_NINS, cTL(familyNameList)); + } + + /** + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param familyName The value of familyName as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) + */ + public void setFamilyName_LikeSearch( String familyName, - jp.sf.pal.timecard.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(familyName), getCValueFamilyName(), - "FAMILY_NAME", "FamilyName", "familyName", inScopeOption); + jp.sf.pal.timecard.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(familyName), getCValueFamilyName(), "FAMILY_NAME", + "FamilyName", "familyName", likeSearchOption); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param familyNameList The collection of familyName as notInScope. + * @param familyName The value of familyName as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setFamilyName_NotInScope(Collection familyNameList) { - regFamilyName(CK_NINS, cTL(familyNameList)); + public void setFamilyName_NotLikeSearch( + String familyName, + jp.sf.pal.timecard.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(familyName), getCValueFamilyName(), "FAMILY_NAME", + "FamilyName", "familyName", likeSearchOption); } /** - * IsNull(is null). And OnceRegistered. + * IsNull(is null). And OnlyOnceRegistered. */ public void setFamilyName_IsNull() { regFamilyName(CK_ISN, DUMMY_OBJECT); } /** - * IsNotNull(is not null). And OnceRegistered. + * IsNotNull(is not null). And OnlyOnceRegistered. */ public void setFamilyName_IsNotNull() { regFamilyName(CK_ISNN, DUMMY_OBJECT); @@ -941,7 +810,7 @@ abstract protected ConditionValue getCValueFamilyName(); /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {VARCHAR(50)} + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {VARCHAR(50)} * * @param middleName The value of middleName as equal. */ @@ -950,7 +819,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param middleName The value of middleName as notEqual. */ @@ -959,7 +828,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param middleName The value of middleName as greaterThan. */ @@ -968,7 +837,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param middleName The value of middleName as lessThan. */ @@ -977,7 +846,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param middleName The value of middleName as greaterEqual. */ @@ -986,7 +855,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param middleName The value of middleName as lessEqual. */ @@ -995,7 +864,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param middleName The value of middleName as prefixSearch. */ @@ -1004,20 +873,6 @@ } /** - * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, - * SeveralRegistered. - * - * @param middleName The value of middleName as likeSearch. - * @param likeSearchOption The option of like-search. (NotNull) - */ - public void setMiddleName_LikeSearch( - String middleName, - jp.sf.pal.timecard.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { - registerLikeSearchQuery(CK_LS, fRES(middleName), getCValueMiddleName(), - "MIDDLE_NAME", "MiddleName", "middleName", likeSearchOption); - } - - /** * InScope(in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * @@ -1028,38 +883,52 @@ } /** - * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * - * @param middleName The collection of middleName as inScope. - * @param inScopeOption The option of in-scope. (NotNull) + * @param middleNameList The collection of middleName as notInScope. */ - public void setMiddleName_InScope( + public void setMiddleName_NotInScope(Collection middleNameList) { + regMiddleName(CK_NINS, cTL(middleNameList)); + } + + /** + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param middleName The value of middleName as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) + */ + public void setMiddleName_LikeSearch( String middleName, - jp.sf.pal.timecard.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(middleName), getCValueMiddleName(), - "MIDDLE_NAME", "MiddleName", "middleName", inScopeOption); + jp.sf.pal.timecard.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(middleName), getCValueMiddleName(), "MIDDLE_NAME", + "MiddleName", "middleName", likeSearchOption); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param middleNameList The collection of middleName as notInScope. + * @param middleName The value of middleName as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setMiddleName_NotInScope(Collection middleNameList) { - regMiddleName(CK_NINS, cTL(middleNameList)); + public void setMiddleName_NotLikeSearch( + String middleName, + jp.sf.pal.timecard.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(middleName), getCValueMiddleName(), "MIDDLE_NAME", + "MiddleName", "middleName", likeSearchOption); } /** - * IsNull(is null). And OnceRegistered. + * IsNull(is null). And OnlyOnceRegistered. */ public void setMiddleName_IsNull() { regMiddleName(CK_ISN, DUMMY_OBJECT); } /** - * IsNotNull(is not null). And OnceRegistered. + * IsNotNull(is not null). And OnlyOnceRegistered. */ public void setMiddleName_IsNotNull() { regMiddleName(CK_ISNN, DUMMY_OBJECT); @@ -1078,7 +947,7 @@ abstract protected ConditionValue getCValueMiddleName(); /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {VARCHAR(100)} + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {VARCHAR(100)} * * @param givenNameDesc The value of givenNameDesc as equal. */ @@ -1087,7 +956,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param givenNameDesc The value of givenNameDesc as notEqual. */ @@ -1096,7 +965,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param givenNameDesc The value of givenNameDesc as greaterThan. */ @@ -1105,7 +974,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param givenNameDesc The value of givenNameDesc as lessThan. */ @@ -1114,7 +983,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param givenNameDesc The value of givenNameDesc as greaterEqual. */ @@ -1123,7 +992,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param givenNameDesc The value of givenNameDesc as lessEqual. */ @@ -1132,7 +1001,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param givenNameDesc The value of givenNameDesc as prefixSearch. */ @@ -1141,21 +1010,6 @@ } /** - * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, - * SeveralRegistered. - * - * @param givenNameDesc The value of givenNameDesc as likeSearch. - * @param likeSearchOption The option of like-search. (NotNull) - */ - public void setGivenNameDesc_LikeSearch( - String givenNameDesc, - jp.sf.pal.timecard.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { - registerLikeSearchQuery(CK_LS, fRES(givenNameDesc), - getCValueGivenNameDesc(), "GIVEN_NAME_DESC", "GivenNameDesc", - "givenNameDesc", likeSearchOption); - } - - /** * InScope(in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * @@ -1166,39 +1020,54 @@ } /** - * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * - * @param givenNameDesc The collection of givenNameDesc as inScope. - * @param inScopeOption The option of in-scope. (NotNull) + * @param givenNameDescList The collection of givenNameDesc as notInScope. */ - public void setGivenNameDesc_InScope( + public void setGivenNameDesc_NotInScope(Collection givenNameDescList) { + regGivenNameDesc(CK_NINS, cTL(givenNameDescList)); + } + + /** + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param givenNameDesc The value of givenNameDesc as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) + */ + public void setGivenNameDesc_LikeSearch( String givenNameDesc, - jp.sf.pal.timecard.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(givenNameDesc), - getCValueGivenNameDesc(), "GIVEN_NAME_DESC", "GivenNameDesc", - "givenNameDesc", inScopeOption); + jp.sf.pal.timecard.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(givenNameDesc), getCValueGivenNameDesc(), + "GIVEN_NAME_DESC", "GivenNameDesc", "givenNameDesc", + likeSearchOption); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param givenNameDescList The collection of givenNameDesc as notInScope. + * @param givenNameDesc The value of givenNameDesc as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setGivenNameDesc_NotInScope(Collection givenNameDescList) { - regGivenNameDesc(CK_NINS, cTL(givenNameDescList)); + public void setGivenNameDesc_NotLikeSearch( + String givenNameDesc, + jp.sf.pal.timecard.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(givenNameDesc), getCValueGivenNameDesc(), + "GIVEN_NAME_DESC", "GivenNameDesc", "givenNameDesc", + likeSearchOption); } /** - * IsNull(is null). And OnceRegistered. + * IsNull(is null). And OnlyOnceRegistered. */ public void setGivenNameDesc_IsNull() { regGivenNameDesc(CK_ISN, DUMMY_OBJECT); } /** - * IsNotNull(is not null). And OnceRegistered. + * IsNotNull(is not null). And OnlyOnceRegistered. */ public void setGivenNameDesc_IsNotNull() { regGivenNameDesc(CK_ISNN, DUMMY_OBJECT); @@ -1217,7 +1086,7 @@ abstract protected ConditionValue getCValueGivenNameDesc(); /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {VARCHAR(100)} + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {VARCHAR(100)} * * @param familyNameDesc The value of familyNameDesc as equal. */ @@ -1226,7 +1095,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param familyNameDesc The value of familyNameDesc as notEqual. */ @@ -1235,7 +1104,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param familyNameDesc The value of familyNameDesc as greaterThan. */ @@ -1244,7 +1113,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param familyNameDesc The value of familyNameDesc as lessThan. */ @@ -1253,7 +1122,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param familyNameDesc The value of familyNameDesc as greaterEqual. */ @@ -1262,7 +1131,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param familyNameDesc The value of familyNameDesc as lessEqual. */ @@ -1271,7 +1140,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param familyNameDesc The value of familyNameDesc as prefixSearch. */ @@ -1280,21 +1149,6 @@ } /** - * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, - * SeveralRegistered. - * - * @param familyNameDesc The value of familyNameDesc as likeSearch. - * @param likeSearchOption The option of like-search. (NotNull) - */ - public void setFamilyNameDesc_LikeSearch( - String familyNameDesc, - jp.sf.pal.timecard.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { - registerLikeSearchQuery(CK_LS, fRES(familyNameDesc), - getCValueFamilyNameDesc(), "FAMILY_NAME_DESC", - "FamilyNameDesc", "familyNameDesc", likeSearchOption); - } - - /** * InScope(in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * @@ -1305,40 +1159,55 @@ } /** - * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * - * @param familyNameDesc The collection of familyNameDesc as inScope. - * @param inScopeOption The option of in-scope. (NotNull) + * @param familyNameDescList The collection of familyNameDesc as notInScope. */ - public void setFamilyNameDesc_InScope( + public void setFamilyNameDesc_NotInScope( + Collection familyNameDescList) { + regFamilyNameDesc(CK_NINS, cTL(familyNameDescList)); + } + + /** + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param familyNameDesc The value of familyNameDesc as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) + */ + public void setFamilyNameDesc_LikeSearch( String familyNameDesc, - jp.sf.pal.timecard.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(familyNameDesc), - getCValueFamilyNameDesc(), "FAMILY_NAME_DESC", - "FamilyNameDesc", "familyNameDesc", inScopeOption); + jp.sf.pal.timecard.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(familyNameDesc), getCValueFamilyNameDesc(), + "FAMILY_NAME_DESC", "FamilyNameDesc", "familyNameDesc", + likeSearchOption); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param familyNameDescList The collection of familyNameDesc as notInScope. + * @param familyNameDesc The value of familyNameDesc as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setFamilyNameDesc_NotInScope( - Collection familyNameDescList) { - regFamilyNameDesc(CK_NINS, cTL(familyNameDescList)); + public void setFamilyNameDesc_NotLikeSearch( + String familyNameDesc, + jp.sf.pal.timecard.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(familyNameDesc), getCValueFamilyNameDesc(), + "FAMILY_NAME_DESC", "FamilyNameDesc", "familyNameDesc", + likeSearchOption); } /** - * IsNull(is null). And OnceRegistered. + * IsNull(is null). And OnlyOnceRegistered. */ public void setFamilyNameDesc_IsNull() { regFamilyNameDesc(CK_ISN, DUMMY_OBJECT); } /** - * IsNotNull(is not null). And OnceRegistered. + * IsNotNull(is not null). And OnlyOnceRegistered. */ public void setFamilyNameDesc_IsNotNull() { regFamilyNameDesc(CK_ISNN, DUMMY_OBJECT); @@ -1357,7 +1226,7 @@ abstract protected ConditionValue getCValueFamilyNameDesc(); /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {VARCHAR(100)} + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {VARCHAR(100)} * * @param nickname The value of nickname as equal. */ @@ -1366,7 +1235,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param nickname The value of nickname as notEqual. */ @@ -1375,7 +1244,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param nickname The value of nickname as greaterThan. */ @@ -1384,7 +1253,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param nickname The value of nickname as lessThan. */ @@ -1393,7 +1262,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param nickname The value of nickname as greaterEqual. */ @@ -1402,7 +1271,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param nickname The value of nickname as lessEqual. */ @@ -1411,7 +1280,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param nickname The value of nickname as prefixSearch. */ @@ -1420,20 +1289,6 @@ } /** - * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, - * SeveralRegistered. - * - * @param nickname The value of nickname as likeSearch. - * @param likeSearchOption The option of like-search. (NotNull) - */ - public void setNickname_LikeSearch( - String nickname, - jp.sf.pal.timecard.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { - registerLikeSearchQuery(CK_LS, fRES(nickname), getCValueNickname(), - "NICKNAME", "Nickname", "nickname", likeSearchOption); - } - - /** * InScope(in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * @@ -1444,38 +1299,52 @@ } /** - * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * - * @param nickname The collection of nickname as inScope. - * @param inScopeOption The option of in-scope. (NotNull) + * @param nicknameList The collection of nickname as notInScope. */ - public void setNickname_InScope( + public void setNickname_NotInScope(Collection nicknameList) { + regNickname(CK_NINS, cTL(nicknameList)); + } + + /** + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param nickname The value of nickname as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) + */ + public void setNickname_LikeSearch( String nickname, - jp.sf.pal.timecard.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(nickname), getCValueNickname(), - "NICKNAME", "Nickname", "nickname", inScopeOption); + jp.sf.pal.timecard.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(nickname), getCValueNickname(), "NICKNAME", + "Nickname", "nickname", likeSearchOption); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param nicknameList The collection of nickname as notInScope. + * @param nickname The value of nickname as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setNickname_NotInScope(Collection nicknameList) { - regNickname(CK_NINS, cTL(nicknameList)); + public void setNickname_NotLikeSearch( + String nickname, + jp.sf.pal.timecard.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(nickname), getCValueNickname(), "NICKNAME", + "Nickname", "nickname", likeSearchOption); } /** - * IsNull(is null). And OnceRegistered. + * IsNull(is null). And OnlyOnceRegistered. */ public void setNickname_IsNull() { regNickname(CK_ISN, DUMMY_OBJECT); } /** - * IsNotNull(is not null). And OnceRegistered. + * IsNotNull(is not null). And OnlyOnceRegistered. */ public void setNickname_IsNotNull() { regNickname(CK_ISNN, DUMMY_OBJECT); @@ -1494,7 +1363,7 @@ abstract protected ConditionValue getCValueNickname(); /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {VARCHAR(1)} + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {VARCHAR(1)} * * @param gender The value of gender as equal. */ @@ -1503,7 +1372,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param gender The value of gender as notEqual. */ @@ -1512,7 +1381,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param gender The value of gender as greaterThan. */ @@ -1521,7 +1390,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param gender The value of gender as lessThan. */ @@ -1530,7 +1399,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param gender The value of gender as greaterEqual. */ @@ -1539,7 +1408,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param gender The value of gender as lessEqual. */ @@ -1548,7 +1417,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param gender The value of gender as prefixSearch. */ @@ -1557,20 +1426,6 @@ } /** - * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, - * SeveralRegistered. - * - * @param gender The value of gender as likeSearch. - * @param likeSearchOption The option of like-search. (NotNull) - */ - public void setGender_LikeSearch( - String gender, - jp.sf.pal.timecard.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { - registerLikeSearchQuery(CK_LS, fRES(gender), getCValueGender(), - "GENDER", "Gender", "gender", likeSearchOption); - } - - /** * InScope(in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * @@ -1581,38 +1436,52 @@ } /** - * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * - * @param gender The collection of gender as inScope. - * @param inScopeOption The option of in-scope. (NotNull) + * @param genderList The collection of gender as notInScope. */ - public void setGender_InScope( + public void setGender_NotInScope(Collection genderList) { + regGender(CK_NINS, cTL(genderList)); + } + + /** + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param gender The value of gender as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) + */ + public void setGender_LikeSearch( String gender, - jp.sf.pal.timecard.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(gender), getCValueGender(), "GENDER", - "Gender", "gender", inScopeOption); + jp.sf.pal.timecard.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(gender), getCValueGender(), "GENDER", "Gender", + "gender", likeSearchOption); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param genderList The collection of gender as notInScope. + * @param gender The value of gender as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setGender_NotInScope(Collection genderList) { - regGender(CK_NINS, cTL(genderList)); + public void setGender_NotLikeSearch( + String gender, + jp.sf.pal.timecard.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(gender), getCValueGender(), "GENDER", "Gender", + "gender", likeSearchOption); } /** - * IsNull(is null). And OnceRegistered. + * IsNull(is null). And OnlyOnceRegistered. */ public void setGender_IsNull() { regGender(CK_ISN, DUMMY_OBJECT); } /** - * IsNotNull(is not null). And OnceRegistered. + * IsNotNull(is not null). And OnlyOnceRegistered. */ public void setGender_IsNotNull() { regGender(CK_ISNN, DUMMY_OBJECT); @@ -1631,7 +1500,7 @@ abstract protected ConditionValue getCValueGender(); /** - * Equal(=). And NullIgnored, OnceRegistered. {DATE} + * Equal(=). And NullIgnored, OnlyOnceRegistered. {DATE} * * @param birthDate The value of birthDate as equal. */ @@ -1640,7 +1509,7 @@ } /** - * NotEqual(!=). And NullIgnored, OnceRegistered. + * NotEqual(!=). And NullIgnored, OnlyOnceRegistered. * * @param birthDate The value of birthDate as notEqual. */ @@ -1649,7 +1518,7 @@ } /** - * GreaterThan(>). And NullIgnored, OnceRegistered. + * GreaterThan(>). And NullIgnored, OnlyOnceRegistered. * * @param birthDate The value of birthDate as greaterThan. */ @@ -1658,7 +1527,7 @@ } /** - * LessThan(>). And NullIgnored, OnceRegistered. + * LessThan(>). And NullIgnored, OnlyOnceRegistered. * * @param birthDate The value of birthDate as lessThan. */ @@ -1667,7 +1536,7 @@ } /** - * GreaterEqual(>). And NullIgnored, OnceRegistered. + * GreaterEqual(>). And NullIgnored, OnlyOnceRegistered. * * @param birthDate The value of birthDate as greaterEqual. */ @@ -1676,7 +1545,7 @@ } /** - * LessEqual(>). And NullIgnored, OnceRegistered. + * LessEqual(>). And NullIgnored, OnlyOnceRegistered. * * @param birthDate The value of birthDate as lessEqual. */ @@ -1686,7 +1555,7 @@ /** * FromTo($fromDate <= COLUMN_NAME <= $toDate). And NullIgnored, - * OnceRegistered. {DATE} + * OnlyOnceRegistered. {DATE} * * @param fromDate The from-date of birthDate. (Nullable) * @param toDate The to-date of birthDate. (Nullable) @@ -1702,7 +1571,7 @@ /** * FromTo($fromDate <= COLUMN_NAME < $toDate + 1). And NullIgnored, - * OnceRegistered. {DATE} + * OnlyOnceRegistered. {DATE} * * @param fromDate The from-date of birthDate. (Nullable) * @param toDate The to-date of birthDate. (Nullable) @@ -1716,14 +1585,14 @@ } /** - * IsNull(is null). And OnceRegistered. + * IsNull(is null). And OnlyOnceRegistered. */ public void setBirthDate_IsNull() { regBirthDate(CK_ISN, DUMMY_OBJECT); } /** - * IsNotNull(is not null). And OnceRegistered. + * IsNotNull(is not null). And OnlyOnceRegistered. */ public void setBirthDate_IsNotNull() { regBirthDate(CK_ISNN, DUMMY_OBJECT); @@ -1742,7 +1611,7 @@ abstract protected ConditionValue getCValueBirthDate(); /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {VARCHAR(255)} + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {VARCHAR(255)} * * @param email The value of email as equal. */ @@ -1751,7 +1620,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param email The value of email as notEqual. */ @@ -1760,7 +1629,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param email The value of email as greaterThan. */ @@ -1769,7 +1638,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param email The value of email as lessThan. */ @@ -1778,7 +1647,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param email The value of email as greaterEqual. */ @@ -1787,7 +1656,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param email The value of email as lessEqual. */ @@ -1796,7 +1665,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param email The value of email as prefixSearch. */ @@ -1805,20 +1674,6 @@ } /** - * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, - * SeveralRegistered. - * - * @param email The value of email as likeSearch. - * @param likeSearchOption The option of like-search. (NotNull) - */ - public void setEmail_LikeSearch( - String email, - jp.sf.pal.timecard.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { - registerLikeSearchQuery(CK_LS, fRES(email), getCValueEmail(), "EMAIL", - "Email", "email", likeSearchOption); - } - - /** * InScope(in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * @@ -1829,38 +1684,52 @@ } /** - * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * - * @param email The collection of email as inScope. - * @param inScopeOption The option of in-scope. (NotNull) + * @param emailList The collection of email as notInScope. */ - public void setEmail_InScope( + public void setEmail_NotInScope(Collection emailList) { + regEmail(CK_NINS, cTL(emailList)); + } + + /** + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param email The value of email as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) + */ + public void setEmail_LikeSearch( String email, - jp.sf.pal.timecard.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(email), getCValueEmail(), "EMAIL", - "Email", "email", inScopeOption); + jp.sf.pal.timecard.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(email), getCValueEmail(), "EMAIL", "Email", "email", + likeSearchOption); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param emailList The collection of email as notInScope. + * @param email The value of email as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setEmail_NotInScope(Collection emailList) { - regEmail(CK_NINS, cTL(emailList)); + public void setEmail_NotLikeSearch( + String email, + jp.sf.pal.timecard.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(email), getCValueEmail(), "EMAIL", "Email", + "email", likeSearchOption); } /** - * IsNull(is null). And OnceRegistered. + * IsNull(is null). And OnlyOnceRegistered. */ public void setEmail_IsNull() { regEmail(CK_ISN, DUMMY_OBJECT); } /** - * IsNotNull(is not null). And OnceRegistered. + * IsNotNull(is not null). And OnlyOnceRegistered. */ public void setEmail_IsNotNull() { regEmail(CK_ISNN, DUMMY_OBJECT); @@ -1878,7 +1747,7 @@ abstract protected ConditionValue getCValueEmail(); /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {VARCHAR(255)} + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {VARCHAR(255)} * * @param url The value of url as equal. */ @@ -1887,7 +1756,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param url The value of url as notEqual. */ @@ -1896,7 +1765,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param url The value of url as greaterThan. */ @@ -1905,7 +1774,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param url The value of url as lessThan. */ @@ -1914,7 +1783,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param url The value of url as greaterEqual. */ @@ -1923,7 +1792,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param url The value of url as lessEqual. */ @@ -1932,7 +1801,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param url The value of url as prefixSearch. */ @@ -1941,20 +1810,6 @@ } /** - * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, - * SeveralRegistered. - * - * @param url The value of url as likeSearch. - * @param likeSearchOption The option of like-search. (NotNull) - */ - public void setUrl_LikeSearch( - String url, - jp.sf.pal.timecard.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { - registerLikeSearchQuery(CK_LS, fRES(url), getCValueUrl(), "URL", "Url", - "url", likeSearchOption); - } - - /** * InScope(in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * @@ -1965,38 +1820,52 @@ } /** - * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * - * @param url The collection of url as inScope. - * @param inScopeOption The option of in-scope. (NotNull) + * @param urlList The collection of url as notInScope. */ - public void setUrl_InScope( + public void setUrl_NotInScope(Collection urlList) { + regUrl(CK_NINS, cTL(urlList)); + } + + /** + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param url The value of url as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) + */ + public void setUrl_LikeSearch( String url, - jp.sf.pal.timecard.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(url), getCValueUrl(), "URL", "Url", - "url", inScopeOption); + jp.sf.pal.timecard.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(url), getCValueUrl(), "URL", "Url", "url", + likeSearchOption); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param urlList The collection of url as notInScope. + * @param url The value of url as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setUrl_NotInScope(Collection urlList) { - regUrl(CK_NINS, cTL(urlList)); + public void setUrl_NotLikeSearch( + String url, + jp.sf.pal.timecard.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(url), getCValueUrl(), "URL", "Url", "url", + likeSearchOption); } /** - * IsNull(is null). And OnceRegistered. + * IsNull(is null). And OnlyOnceRegistered. */ public void setUrl_IsNull() { regUrl(CK_ISN, DUMMY_OBJECT); } /** - * IsNotNull(is not null). And OnceRegistered. + * IsNotNull(is not null). And OnlyOnceRegistered. */ public void setUrl_IsNotNull() { regUrl(CK_ISNN, DUMMY_OBJECT); @@ -2013,7 +1882,7 @@ abstract protected ConditionValue getCValueUrl(); /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {VARCHAR(40)} + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {VARCHAR(40)} * * @param telephone The value of telephone as equal. */ @@ -2022,7 +1891,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param telephone The value of telephone as notEqual. */ @@ -2031,7 +1900,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param telephone The value of telephone as greaterThan. */ @@ -2040,7 +1909,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param telephone The value of telephone as lessThan. */ @@ -2049,7 +1918,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param telephone The value of telephone as greaterEqual. */ @@ -2058,7 +1927,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param telephone The value of telephone as lessEqual. */ @@ -2067,7 +1936,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param telephone The value of telephone as prefixSearch. */ @@ -2076,20 +1945,6 @@ } /** - * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, - * SeveralRegistered. - * - * @param telephone The value of telephone as likeSearch. - * @param likeSearchOption The option of like-search. (NotNull) - */ - public void setTelephone_LikeSearch( - String telephone, - jp.sf.pal.timecard.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { - registerLikeSearchQuery(CK_LS, fRES(telephone), getCValueTelephone(), - "TELEPHONE", "Telephone", "telephone", likeSearchOption); - } - - /** * InScope(in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * @@ -2100,38 +1955,52 @@ } /** - * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * - * @param telephone The collection of telephone as inScope. - * @param inScopeOption The option of in-scope. (NotNull) + * @param telephoneList The collection of telephone as notInScope. */ - public void setTelephone_InScope( + public void setTelephone_NotInScope(Collection telephoneList) { + regTelephone(CK_NINS, cTL(telephoneList)); + } + + /** + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param telephone The value of telephone as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) + */ + public void setTelephone_LikeSearch( String telephone, - jp.sf.pal.timecard.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(telephone), getCValueTelephone(), - "TELEPHONE", "Telephone", "telephone", inScopeOption); + jp.sf.pal.timecard.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(telephone), getCValueTelephone(), "TELEPHONE", + "Telephone", "telephone", likeSearchOption); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param telephoneList The collection of telephone as notInScope. + * @param telephone The value of telephone as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setTelephone_NotInScope(Collection telephoneList) { - regTelephone(CK_NINS, cTL(telephoneList)); + public void setTelephone_NotLikeSearch( + String telephone, + jp.sf.pal.timecard.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(telephone), getCValueTelephone(), "TELEPHONE", + "Telephone", "telephone", likeSearchOption); } /** - * IsNull(is null). And OnceRegistered. + * IsNull(is null). And OnlyOnceRegistered. */ public void setTelephone_IsNull() { regTelephone(CK_ISN, DUMMY_OBJECT); } /** - * IsNotNull(is not null). And OnceRegistered. + * IsNotNull(is not null). And OnlyOnceRegistered. */ public void setTelephone_IsNotNull() { regTelephone(CK_ISNN, DUMMY_OBJECT); @@ -2150,7 +2019,7 @@ abstract protected ConditionValue getCValueTelephone(); /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {VARCHAR(5)} + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {VARCHAR(5)} * * @param locale The value of locale as equal. */ @@ -2159,7 +2028,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param locale The value of locale as notEqual. */ @@ -2168,7 +2037,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param locale The value of locale as greaterThan. */ @@ -2177,7 +2046,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param locale The value of locale as lessThan. */ @@ -2186,7 +2055,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param locale The value of locale as greaterEqual. */ @@ -2195,7 +2064,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param locale The value of locale as lessEqual. */ @@ -2204,7 +2073,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param locale The value of locale as prefixSearch. */ @@ -2213,20 +2082,6 @@ } /** - * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, - * SeveralRegistered. - * - * @param locale The value of locale as likeSearch. - * @param likeSearchOption The option of like-search. (NotNull) - */ - public void setLocale_LikeSearch( - String locale, - jp.sf.pal.timecard.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { - registerLikeSearchQuery(CK_LS, fRES(locale), getCValueLocale(), - "LOCALE", "Locale", "locale", likeSearchOption); - } - - /** * InScope(in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * @@ -2237,38 +2092,52 @@ } /** - * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * - * @param locale The collection of locale as inScope. - * @param inScopeOption The option of in-scope. (NotNull) + * @param localeList The collection of locale as notInScope. */ - public void setLocale_InScope( + public void setLocale_NotInScope(Collection localeList) { + regLocale(CK_NINS, cTL(localeList)); + } + + /** + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param locale The value of locale as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) + */ + public void setLocale_LikeSearch( String locale, - jp.sf.pal.timecard.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(locale), getCValueLocale(), "LOCALE", - "Locale", "locale", inScopeOption); + jp.sf.pal.timecard.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(locale), getCValueLocale(), "LOCALE", "Locale", + "locale", likeSearchOption); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param localeList The collection of locale as notInScope. + * @param locale The value of locale as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setLocale_NotInScope(Collection localeList) { - regLocale(CK_NINS, cTL(localeList)); + public void setLocale_NotLikeSearch( + String locale, + jp.sf.pal.timecard.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(locale), getCValueLocale(), "LOCALE", "Locale", + "locale", likeSearchOption); } /** - * IsNull(is null). And OnceRegistered. + * IsNull(is null). And OnlyOnceRegistered. */ public void setLocale_IsNull() { regLocale(CK_ISN, DUMMY_OBJECT); } /** - * IsNotNull(is not null). And OnceRegistered. + * IsNotNull(is not null). And OnlyOnceRegistered. */ public void setLocale_IsNotNull() { regLocale(CK_ISNN, DUMMY_OBJECT); @@ -2287,8 +2156,8 @@ abstract protected ConditionValue getCValueLocale(); /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {VARCHAR(255) : FK to - * ROLE_INFO} + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {VARCHAR(255) : FK + * to ROLE_INFO} * * @param roleId The value of roleId as equal. */ @@ -2297,7 +2166,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param roleId The value of roleId as notEqual. */ @@ -2306,7 +2175,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param roleId The value of roleId as greaterThan. */ @@ -2315,7 +2184,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param roleId The value of roleId as lessThan. */ @@ -2324,7 +2193,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param roleId The value of roleId as greaterEqual. */ @@ -2333,7 +2202,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param roleId The value of roleId as lessEqual. */ @@ -2342,7 +2211,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param roleId The value of roleId as prefixSearch. */ @@ -2351,20 +2220,6 @@ } /** - * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, - * SeveralRegistered. - * - * @param roleId The value of roleId as likeSearch. - * @param likeSearchOption The option of like-search. (NotNull) - */ - public void setRoleId_LikeSearch( - String roleId, - jp.sf.pal.timecard.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { - registerLikeSearchQuery(CK_LS, fRES(roleId), getCValueRoleId(), - "ROLE_ID", "RoleId", "roleId", likeSearchOption); - } - - /** * InScope(in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * @@ -2375,42 +2230,41 @@ } /** - * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * - * @param roleId The collection of roleId as inScope. - * @param inScopeOption The option of in-scope. (NotNull) + * @param roleIdList The collection of roleId as notInScope. */ - public void setRoleId_InScope( - String roleId, - jp.sf.pal.timecard.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(roleId), getCValueRoleId(), - "ROLE_ID", "RoleId", "roleId", inScopeOption); + public void setRoleId_NotInScope(Collection roleIdList) { + regRoleId(CK_NINS, cTL(roleIdList)); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param roleIdList The collection of roleId as notInScope. + * @param roleId The value of roleId as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) */ - public void setRoleId_NotInScope(Collection roleIdList) { - regRoleId(CK_NINS, cTL(roleIdList)); + public void setRoleId_LikeSearch( + String roleId, + jp.sf.pal.timecard.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(roleId), getCValueRoleId(), "ROLE_ID", "RoleId", + "roleId", likeSearchOption); } /** - * @param roleInfoCBquery Query. - * @deprecated Please use inScopeRoleInfo(subQuery) method. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param roleId The value of roleId as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setRoleId_InScopeSubQuery_RoleInfo(RoleInfoCQ roleInfoCBquery) { - String subQueryPropertyName = keepRoleId_InScopeSubQuery_RoleInfo(roleInfoCBquery);// for - // saving - // query - // - - // value - // . - registerInScopeSubQuery(roleInfoCBquery, "ROLE_ID", "ROLE_ID", - subQueryPropertyName); + public void setRoleId_NotLikeSearch( + String roleId, + jp.sf.pal.timecard.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(roleId), getCValueRoleId(), "ROLE_ID", "RoleId", + "roleId", likeSearchOption); } public void inScopeRoleInfo(SubQuery subQuery) { @@ -2419,23 +2273,23 @@ cb.xsetupForInScopeSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepRoleId_InScopeSubQuery_RoleInfo(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerInScopeSubQuery(cb.query(), "ROLE_ID", "ROLE_ID", subQueryPropertyName); } - abstract public String keepRoleId_InScopeSubQuery_RoleInfo( + public abstract String keepRoleId_InScopeSubQuery_RoleInfo( jp.sf.pal.timecard.db.cbean.cq.RoleInfoCQ subQuery); /** - * IsNull(is null). And OnceRegistered. + * IsNull(is null). And OnlyOnceRegistered. */ public void setRoleId_IsNull() { regRoleId(CK_ISN, DUMMY_OBJECT); } /** - * IsNotNull(is not null). And OnceRegistered. + * IsNotNull(is not null). And OnlyOnceRegistered. */ public void setRoleId_IsNotNull() { regRoleId(CK_ISNN, DUMMY_OBJECT); @@ -2454,8 +2308,8 @@ abstract protected ConditionValue getCValueRoleId(); /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {VARCHAR(255) : FK to - * GROUP_INFO} + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {VARCHAR(255) : FK + * to GROUP_INFO} * * @param groupId The value of groupId as equal. */ @@ -2464,7 +2318,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param groupId The value of groupId as notEqual. */ @@ -2473,7 +2327,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param groupId The value of groupId as greaterThan. */ @@ -2482,7 +2336,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param groupId The value of groupId as lessThan. */ @@ -2491,7 +2345,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param groupId The value of groupId as greaterEqual. */ @@ -2500,7 +2354,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param groupId The value of groupId as lessEqual. */ @@ -2509,7 +2363,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param groupId The value of groupId as prefixSearch. */ @@ -2518,20 +2372,6 @@ } /** - * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, - * SeveralRegistered. - * - * @param groupId The value of groupId as likeSearch. - * @param likeSearchOption The option of like-search. (NotNull) - */ - public void setGroupId_LikeSearch( - String groupId, - jp.sf.pal.timecard.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { - registerLikeSearchQuery(CK_LS, fRES(groupId), getCValueGroupId(), - "GROUP_ID", "GroupId", "groupId", likeSearchOption); - } - - /** * InScope(in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * @@ -2542,43 +2382,41 @@ } /** - * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * - * @param groupId The collection of groupId as inScope. - * @param inScopeOption The option of in-scope. (NotNull) + * @param groupIdList The collection of groupId as notInScope. */ - public void setGroupId_InScope( - String groupId, - jp.sf.pal.timecard.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(groupId), getCValueGroupId(), - "GROUP_ID", "GroupId", "groupId", inScopeOption); + public void setGroupId_NotInScope(Collection groupIdList) { + regGroupId(CK_NINS, cTL(groupIdList)); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param groupIdList The collection of groupId as notInScope. + * @param groupId The value of groupId as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) */ - public void setGroupId_NotInScope(Collection groupIdList) { - regGroupId(CK_NINS, cTL(groupIdList)); + public void setGroupId_LikeSearch( + String groupId, + jp.sf.pal.timecard.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(groupId), getCValueGroupId(), "GROUP_ID", "GroupId", + "groupId", likeSearchOption); } /** - * @param groupInfoCBquery Query. - * @deprecated Please use inScopeGroupInfo(subQuery) method. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param groupId The value of groupId as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setGroupId_InScopeSubQuery_GroupInfo( - GroupInfoCQ groupInfoCBquery) { - String subQueryPropertyName = keepGroupId_InScopeSubQuery_GroupInfo(groupInfoCBquery);// for - // saving - // query - // - - // value - // . - registerInScopeSubQuery(groupInfoCBquery, "GROUP_ID", "GROUP_ID", - subQueryPropertyName); + public void setGroupId_NotLikeSearch( + String groupId, + jp.sf.pal.timecard.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(groupId), getCValueGroupId(), "GROUP_ID", + "GroupId", "groupId", likeSearchOption); } public void inScopeGroupInfo(SubQuery subQuery) { @@ -2587,23 +2425,23 @@ cb.xsetupForInScopeSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepGroupId_InScopeSubQuery_GroupInfo(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerInScopeSubQuery(cb.query(), "GROUP_ID", "GROUP_ID", subQueryPropertyName); } - abstract public String keepGroupId_InScopeSubQuery_GroupInfo( + public abstract String keepGroupId_InScopeSubQuery_GroupInfo( jp.sf.pal.timecard.db.cbean.cq.GroupInfoCQ subQuery); /** - * IsNull(is null). And OnceRegistered. + * IsNull(is null). And OnlyOnceRegistered. */ public void setGroupId_IsNull() { regGroupId(CK_ISN, DUMMY_OBJECT); } /** - * IsNotNull(is not null). And OnceRegistered. + * IsNotNull(is not null). And OnlyOnceRegistered. */ public void setGroupId_IsNotNull() { regGroupId(CK_ISNN, DUMMY_OBJECT); @@ -2622,8 +2460,145 @@ abstract protected ConditionValue getCValueGroupId(); /** - * Equal(=). And NullIgnored, OnceRegistered. {NotNull : TIMESTAMP} + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {VARCHAR(1)} * + * @param status The value of status as equal. + */ + public void setStatus_Equal(String status) { + regStatus(CK_EQ, fRES(status)); + } + + /** + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. + * + * @param status The value of status as notEqual. + */ + public void setStatus_NotEqual(String status) { + regStatus(CK_NE, fRES(status)); + } + + /** + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. + * + * @param status The value of status as greaterThan. + */ + public void setStatus_GreaterThan(String status) { + regStatus(CK_GT, fRES(status)); + } + + /** + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. + * + * @param status The value of status as lessThan. + */ + public void setStatus_LessThan(String status) { + regStatus(CK_LT, fRES(status)); + } + + /** + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. + * + * @param status The value of status as greaterEqual. + */ + public void setStatus_GreaterEqual(String status) { + regStatus(CK_GE, fRES(status)); + } + + /** + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. + * + * @param status The value of status as lessEqual. + */ + public void setStatus_LessEqual(String status) { + regStatus(CK_LE, fRES(status)); + } + + /** + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. + * + * @param status The value of status as prefixSearch. + */ + public void setStatus_PrefixSearch(String status) { + regStatus(CK_PS, fRES(status)); + } + + /** + * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NullOrEmptyElementIgnored, SeveralRegistered. + * + * @param statusList The collection of status as inScope. + */ + public void setStatus_InScope(Collection statusList) { + regStatus(CK_INS, cTL(statusList)); + } + + /** + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, + * NullOrEmptyElementIgnored, SeveralRegistered. + * + * @param statusList The collection of status as notInScope. + */ + public void setStatus_NotInScope(Collection statusList) { + regStatus(CK_NINS, cTL(statusList)); + } + + /** + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param status The value of status as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) + */ + public void setStatus_LikeSearch( + String status, + jp.sf.pal.timecard.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(status), getCValueStatus(), "STATUS", "Status", + "status", likeSearchOption); + } + + /** + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param status The value of status as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) + */ + public void setStatus_NotLikeSearch( + String status, + jp.sf.pal.timecard.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(status), getCValueStatus(), "STATUS", "Status", + "status", likeSearchOption); + } + + /** + * IsNull(is null). And OnlyOnceRegistered. + */ + public void setStatus_IsNull() { + regStatus(CK_ISN, DUMMY_OBJECT); + } + + /** + * IsNotNull(is not null). And OnlyOnceRegistered. + */ + public void setStatus_IsNotNull() { + regStatus(CK_ISNN, DUMMY_OBJECT); + } + + protected void regStatus(ConditionKey key, Object value) { + registerQuery(key, value, getCValueStatus(), "STATUS", "Status", + "status"); + } + + protected void registerInlineStatus(ConditionKey key, Object value) { + registerInlineQuery(key, value, getCValueStatus(), "STATUS", "Status", + "status"); + } + + abstract protected ConditionValue getCValueStatus(); + + /** + * Equal(=). And NullIgnored, OnlyOnceRegistered. {NotNull : TIMESTAMP} + * * @param createdTime The value of createdTime as equal. */ public void setCreatedTime_Equal(java.sql.Timestamp createdTime) { @@ -2631,7 +2606,7 @@ } /** - * NotEqual(!=). And NullIgnored, OnceRegistered. + * NotEqual(!=). And NullIgnored, OnlyOnceRegistered. * * @param createdTime The value of createdTime as notEqual. */ @@ -2640,7 +2615,7 @@ } /** - * GreaterThan(>). And NullIgnored, OnceRegistered. + * GreaterThan(>). And NullIgnored, OnlyOnceRegistered. * * @param createdTime The value of createdTime as greaterThan. */ @@ -2649,7 +2624,7 @@ } /** - * LessThan(>). And NullIgnored, OnceRegistered. + * LessThan(>). And NullIgnored, OnlyOnceRegistered. * * @param createdTime The value of createdTime as lessThan. */ @@ -2658,7 +2633,7 @@ } /** - * GreaterEqual(>). And NullIgnored, OnceRegistered. + * GreaterEqual(>). And NullIgnored, OnlyOnceRegistered. * * @param createdTime The value of createdTime as greaterEqual. */ @@ -2667,7 +2642,7 @@ } /** - * LessEqual(>). And NullIgnored, OnceRegistered. + * LessEqual(>). And NullIgnored, OnlyOnceRegistered. * * @param createdTime The value of createdTime as lessEqual. */ @@ -2677,7 +2652,7 @@ /** * FromTo($fromDate <= COLUMN_NAME <= $toDate). And NullIgnored, - * OnceRegistered. {NotNull : TIMESTAMP} + * OnlyOnceRegistered. {NotNull : TIMESTAMP} * * @param fromDate The from-date of createdTime. (Nullable) * @param toDate The to-date of createdTime. (Nullable) @@ -2695,7 +2670,7 @@ /** * FromTo($fromDate <= COLUMN_NAME < $toDate + 1). And NullIgnored, - * OnceRegistered. {NotNull : TIMESTAMP} + * OnlyOnceRegistered. {NotNull : TIMESTAMP} * * @param fromDate The from-date of createdTime. (Nullable) * @param toDate The to-date of createdTime. (Nullable) @@ -2721,7 +2696,7 @@ abstract protected ConditionValue getCValueCreatedTime(); /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {NotNull : + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {NotNull : * VARCHAR(255)} * * @param createdBy The value of createdBy as equal. @@ -2731,7 +2706,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param createdBy The value of createdBy as notEqual. */ @@ -2740,7 +2715,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param createdBy The value of createdBy as greaterThan. */ @@ -2749,7 +2724,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param createdBy The value of createdBy as lessThan. */ @@ -2758,7 +2733,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param createdBy The value of createdBy as greaterEqual. */ @@ -2767,7 +2742,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param createdBy The value of createdBy as lessEqual. */ @@ -2776,7 +2751,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param createdBy The value of createdBy as prefixSearch. */ @@ -2785,20 +2760,6 @@ } /** - * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, - * SeveralRegistered. - * - * @param createdBy The value of createdBy as likeSearch. - * @param likeSearchOption The option of like-search. (NotNull) - */ - public void setCreatedBy_LikeSearch( - String createdBy, - jp.sf.pal.timecard.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { - registerLikeSearchQuery(CK_LS, fRES(createdBy), getCValueCreatedBy(), - "CREATED_BY", "CreatedBy", "createdBy", likeSearchOption); - } - - /** * InScope(in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * @@ -2809,27 +2770,41 @@ } /** - * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * - * @param createdBy The collection of createdBy as inScope. - * @param inScopeOption The option of in-scope. (NotNull) + * @param createdByList The collection of createdBy as notInScope. */ - public void setCreatedBy_InScope( + public void setCreatedBy_NotInScope(Collection createdByList) { + regCreatedBy(CK_NINS, cTL(createdByList)); + } + + /** + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param createdBy The value of createdBy as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) + */ + public void setCreatedBy_LikeSearch( String createdBy, - jp.sf.pal.timecard.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(createdBy), getCValueCreatedBy(), - "CREATED_BY", "CreatedBy", "createdBy", inScopeOption); + jp.sf.pal.timecard.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(createdBy), getCValueCreatedBy(), "CREATED_BY", + "CreatedBy", "createdBy", likeSearchOption); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param createdByList The collection of createdBy as notInScope. + * @param createdBy The value of createdBy as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setCreatedBy_NotInScope(Collection createdByList) { - regCreatedBy(CK_NINS, cTL(createdByList)); + public void setCreatedBy_NotLikeSearch( + String createdBy, + jp.sf.pal.timecard.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(createdBy), getCValueCreatedBy(), "CREATED_BY", + "CreatedBy", "createdBy", likeSearchOption); } protected void regCreatedBy(ConditionKey key, Object value) { @@ -2845,7 +2820,7 @@ abstract protected ConditionValue getCValueCreatedBy(); /** - * Equal(=). And NullIgnored, OnceRegistered. {NotNull : TIMESTAMP} + * Equal(=). And NullIgnored, OnlyOnceRegistered. {NotNull : TIMESTAMP} * * @param updatedTime The value of updatedTime as equal. */ @@ -2854,7 +2829,7 @@ } /** - * NotEqual(!=). And NullIgnored, OnceRegistered. + * NotEqual(!=). And NullIgnored, OnlyOnceRegistered. * * @param updatedTime The value of updatedTime as notEqual. */ @@ -2863,7 +2838,7 @@ } /** - * GreaterThan(>). And NullIgnored, OnceRegistered. + * GreaterThan(>). And NullIgnored, OnlyOnceRegistered. * * @param updatedTime The value of updatedTime as greaterThan. */ @@ -2872,7 +2847,7 @@ } /** - * LessThan(>). And NullIgnored, OnceRegistered. + * LessThan(>). And NullIgnored, OnlyOnceRegistered. * * @param updatedTime The value of updatedTime as lessThan. */ @@ -2881,7 +2856,7 @@ } /** - * GreaterEqual(>). And NullIgnored, OnceRegistered. + * GreaterEqual(>). And NullIgnored, OnlyOnceRegistered. * * @param updatedTime The value of updatedTime as greaterEqual. */ @@ -2890,7 +2865,7 @@ } /** - * LessEqual(>). And NullIgnored, OnceRegistered. + * LessEqual(>). And NullIgnored, OnlyOnceRegistered. * * @param updatedTime The value of updatedTime as lessEqual. */ @@ -2900,7 +2875,7 @@ /** * FromTo($fromDate <= COLUMN_NAME <= $toDate). And NullIgnored, - * OnceRegistered. {NotNull : TIMESTAMP} + * OnlyOnceRegistered. {NotNull : TIMESTAMP} * * @param fromDate The from-date of updatedTime. (Nullable) * @param toDate The to-date of updatedTime. (Nullable) @@ -2918,7 +2893,7 @@ /** * FromTo($fromDate <= COLUMN_NAME < $toDate + 1). And NullIgnored, - * OnceRegistered. {NotNull : TIMESTAMP} + * OnlyOnceRegistered. {NotNull : TIMESTAMP} * * @param fromDate The from-date of updatedTime. (Nullable) * @param toDate The to-date of updatedTime. (Nullable) @@ -2944,7 +2919,7 @@ abstract protected ConditionValue getCValueUpdatedTime(); /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {NotNull : + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {NotNull : * VARCHAR(255)} * * @param updatedBy The value of updatedBy as equal. @@ -2954,7 +2929,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param updatedBy The value of updatedBy as notEqual. */ @@ -2963,7 +2938,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param updatedBy The value of updatedBy as greaterThan. */ @@ -2972,7 +2947,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param updatedBy The value of updatedBy as lessThan. */ @@ -2981,7 +2956,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param updatedBy The value of updatedBy as greaterEqual. */ @@ -2990,7 +2965,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param updatedBy The value of updatedBy as lessEqual. */ @@ -2999,7 +2974,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param updatedBy The value of updatedBy as prefixSearch. */ @@ -3008,20 +2983,6 @@ } /** - * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, - * SeveralRegistered. - * - * @param updatedBy The value of updatedBy as likeSearch. - * @param likeSearchOption The option of like-search. (NotNull) - */ - public void setUpdatedBy_LikeSearch( - String updatedBy, - jp.sf.pal.timecard.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { - registerLikeSearchQuery(CK_LS, fRES(updatedBy), getCValueUpdatedBy(), - "UPDATED_BY", "UpdatedBy", "updatedBy", likeSearchOption); - } - - /** * InScope(in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * @@ -3032,27 +2993,41 @@ } /** - * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * - * @param updatedBy The collection of updatedBy as inScope. - * @param inScopeOption The option of in-scope. (NotNull) + * @param updatedByList The collection of updatedBy as notInScope. */ - public void setUpdatedBy_InScope( + public void setUpdatedBy_NotInScope(Collection updatedByList) { + regUpdatedBy(CK_NINS, cTL(updatedByList)); + } + + /** + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param updatedBy The value of updatedBy as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) + */ + public void setUpdatedBy_LikeSearch( String updatedBy, - jp.sf.pal.timecard.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(updatedBy), getCValueUpdatedBy(), - "UPDATED_BY", "UpdatedBy", "updatedBy", inScopeOption); + jp.sf.pal.timecard.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(updatedBy), getCValueUpdatedBy(), "UPDATED_BY", + "UpdatedBy", "updatedBy", likeSearchOption); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param updatedByList The collection of updatedBy as notInScope. + * @param updatedBy The value of updatedBy as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setUpdatedBy_NotInScope(Collection updatedByList) { - regUpdatedBy(CK_NINS, cTL(updatedByList)); + public void setUpdatedBy_NotLikeSearch( + String updatedBy, + jp.sf.pal.timecard.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(updatedBy), getCValueUpdatedBy(), "UPDATED_BY", + "UpdatedBy", "updatedBy", likeSearchOption); } protected void regUpdatedBy(ConditionKey key, Object value) { @@ -3068,7 +3043,7 @@ abstract protected ConditionValue getCValueUpdatedBy(); /** - * Equal(=). And NullIgnored, OnceRegistered. {TIMESTAMP} + * Equal(=). And NullIgnored, OnlyOnceRegistered. {TIMESTAMP} * * @param deletedTime The value of deletedTime as equal. */ @@ -3077,7 +3052,7 @@ } /** - * NotEqual(!=). And NullIgnored, OnceRegistered. + * NotEqual(!=). And NullIgnored, OnlyOnceRegistered. * * @param deletedTime The value of deletedTime as notEqual. */ @@ -3086,7 +3061,7 @@ } /** - * GreaterThan(>). And NullIgnored, OnceRegistered. + * GreaterThan(>). And NullIgnored, OnlyOnceRegistered. * * @param deletedTime The value of deletedTime as greaterThan. */ @@ -3095,7 +3070,7 @@ } /** - * LessThan(>). And NullIgnored, OnceRegistered. + * LessThan(>). And NullIgnored, OnlyOnceRegistered. * * @param deletedTime The value of deletedTime as lessThan. */ @@ -3104,7 +3079,7 @@ } /** - * GreaterEqual(>). And NullIgnored, OnceRegistered. + * GreaterEqual(>). And NullIgnored, OnlyOnceRegistered. * * @param deletedTime The value of deletedTime as greaterEqual. */ @@ -3113,7 +3088,7 @@ } /** - * LessEqual(>). And NullIgnored, OnceRegistered. + * LessEqual(>). And NullIgnored, OnlyOnceRegistered. * * @param deletedTime The value of deletedTime as lessEqual. */ @@ -3123,7 +3098,7 @@ /** * FromTo($fromDate <= COLUMN_NAME <= $toDate). And NullIgnored, - * OnceRegistered. {TIMESTAMP} + * OnlyOnceRegistered. {TIMESTAMP} * * @param fromDate The from-date of deletedTime. (Nullable) * @param toDate The to-date of deletedTime. (Nullable) @@ -3141,7 +3116,7 @@ /** * FromTo($fromDate <= COLUMN_NAME < $toDate + 1). And NullIgnored, - * OnceRegistered. {TIMESTAMP} + * OnlyOnceRegistered. {TIMESTAMP} * * @param fromDate The from-date of deletedTime. (Nullable) * @param toDate The to-date of deletedTime. (Nullable) @@ -3155,14 +3130,14 @@ } /** - * IsNull(is null). And OnceRegistered. + * IsNull(is null). And OnlyOnceRegistered. */ public void setDeletedTime_IsNull() { regDeletedTime(CK_ISN, DUMMY_OBJECT); } /** - * IsNotNull(is not null). And OnceRegistered. + * IsNotNull(is not null). And OnlyOnceRegistered. */ public void setDeletedTime_IsNotNull() { regDeletedTime(CK_ISNN, DUMMY_OBJECT); @@ -3181,7 +3156,7 @@ abstract protected ConditionValue getCValueDeletedTime(); /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {VARCHAR(255)} + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {VARCHAR(255)} * * @param deletedBy The value of deletedBy as equal. */ @@ -3190,7 +3165,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param deletedBy The value of deletedBy as notEqual. */ @@ -3199,7 +3174,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param deletedBy The value of deletedBy as greaterThan. */ @@ -3208,7 +3183,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param deletedBy The value of deletedBy as lessThan. */ @@ -3217,7 +3192,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param deletedBy The value of deletedBy as greaterEqual. */ @@ -3226,7 +3201,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param deletedBy The value of deletedBy as lessEqual. */ @@ -3235,7 +3210,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param deletedBy The value of deletedBy as prefixSearch. */ @@ -3244,20 +3219,6 @@ } /** - * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, - * SeveralRegistered. - * - * @param deletedBy The value of deletedBy as likeSearch. - * @param likeSearchOption The option of like-search. (NotNull) - */ - public void setDeletedBy_LikeSearch( - String deletedBy, - jp.sf.pal.timecard.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { - registerLikeSearchQuery(CK_LS, fRES(deletedBy), getCValueDeletedBy(), - "DELETED_BY", "DeletedBy", "deletedBy", likeSearchOption); - } - - /** * InScope(in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * @@ -3268,38 +3229,52 @@ } /** - * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * - * @param deletedBy The collection of deletedBy as inScope. - * @param inScopeOption The option of in-scope. (NotNull) + * @param deletedByList The collection of deletedBy as notInScope. */ - public void setDeletedBy_InScope( + public void setDeletedBy_NotInScope(Collection deletedByList) { + regDeletedBy(CK_NINS, cTL(deletedByList)); + } + + /** + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param deletedBy The value of deletedBy as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) + */ + public void setDeletedBy_LikeSearch( String deletedBy, - jp.sf.pal.timecard.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(deletedBy), getCValueDeletedBy(), - "DELETED_BY", "DeletedBy", "deletedBy", inScopeOption); + jp.sf.pal.timecard.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(deletedBy), getCValueDeletedBy(), "DELETED_BY", + "DeletedBy", "deletedBy", likeSearchOption); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param deletedByList The collection of deletedBy as notInScope. + * @param deletedBy The value of deletedBy as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setDeletedBy_NotInScope(Collection deletedByList) { - regDeletedBy(CK_NINS, cTL(deletedByList)); + public void setDeletedBy_NotLikeSearch( + String deletedBy, + jp.sf.pal.timecard.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(deletedBy), getCValueDeletedBy(), "DELETED_BY", + "DeletedBy", "deletedBy", likeSearchOption); } /** - * IsNull(is null). And OnceRegistered. + * IsNull(is null). And OnlyOnceRegistered. */ public void setDeletedBy_IsNull() { regDeletedBy(CK_ISN, DUMMY_OBJECT); } /** - * IsNotNull(is not null). And OnceRegistered. + * IsNotNull(is not null). And OnlyOnceRegistered. */ public void setDeletedBy_IsNotNull() { regDeletedBy(CK_ISNN, DUMMY_OBJECT); @@ -3318,7 +3293,7 @@ abstract protected ConditionValue getCValueDeletedBy(); /** - * Equal(=). And NullIgnored, OnceRegistered. {NotNull : INTEGER} + * Equal(=). And NullIgnored, OnlyOnceRegistered. {NotNull : INTEGER} * * @param versionno The value of versionno as equal. */ @@ -3327,7 +3302,7 @@ } /** - * NotEqual(!=). And NullIgnored, OnceRegistered. + * NotEqual(!=). And NullIgnored, OnlyOnceRegistered. * * @param versionno The value of versionno as notEqual. */ @@ -3336,7 +3311,7 @@ } /** - * GreaterThan(>). And NullIgnored, OnceRegistered. + * GreaterThan(>). And NullIgnored, OnlyOnceRegistered. * * @param versionno The value of versionno as greaterThan. */ @@ -3345,7 +3320,7 @@ } /** - * LessThan(<). And NullIgnored, OnceRegistered. + * LessThan(<). And NullIgnored, OnlyOnceRegistered. * * @param versionno The value of versionno as lessThan. */ @@ -3354,7 +3329,7 @@ } /** - * GreaterEqual(>=). And NullIgnored, OnceRegistered. + * GreaterEqual(>=). And NullIgnored, OnlyOnceRegistered. * * @param versionno The value of versionno as greaterEqual. */ @@ -3363,7 +3338,7 @@ } /** - * LessEqual(<=). And NullIgnored, OnceRegistered. + * LessEqual(<=). And NullIgnored, OnlyOnceRegistered. * * @param versionno The value of versionno as lessEqual. */ @@ -3403,6 +3378,50 @@ abstract protected ConditionValue getCValueVersionno(); + public SSQFunction scalar_Equal() { + return xcreateSSQFunction("="); + } + + public SSQFunction scalar_GreaterEqual() { + return xcreateSSQFunction(">="); + } + + public SSQFunction scalar_GreaterThan() { + return xcreateSSQFunction(">"); + } + + public SSQFunction scalar_LessEqual() { + return xcreateSSQFunction("<="); + } + + public SSQFunction scalar_LessThan() { + return xcreateSSQFunction("<"); + } + + protected SSQFunction xcreateSSQFunction(final String operand) { + return new SSQFunction(new SSQSetupper() { + public void setup(String function, SubQuery subQuery) { + xscalarSubQuery(function, subQuery, operand); + } + }); + } + + protected void xscalarSubQuery(String function, + SubQuery subQuery, String operand) { + assertObjectNotNull("subQuery", subQuery); + UserInfoCB cb = new UserInfoCB(); + cb.xsetupForScalarSubQuery(); + subQuery.query(cb); + String subQueryPropertyName = keepScalarSubQuery(cb.query()); // for + // saving + // query + // -value. + registerScalarSubQuery(function, cb.query(), subQueryPropertyName, + operand); + } + + public abstract String keepScalarSubQuery(UserInfoCQ subQuery); + // Very Internal (for Suppressing Warn about 'Not Use Import') protected String getConditionBeanClassNameInternally() { return UserInfoCB.class.getName(); Modified: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/cbean/cq/bs/AbstractBsWorkingTypeCQ.java =================================================================== --- timecard/trunk/src/main/java/jp/sf/pal/timecard/db/cbean/cq/bs/AbstractBsWorkingTypeCQ.java 2008-12-27 22:18:30 UTC (rev 1630) +++ timecard/trunk/src/main/java/jp/sf/pal/timecard/db/cbean/cq/bs/AbstractBsWorkingTypeCQ.java 2008-12-27 22:20:25 UTC (rev 1631) @@ -18,7 +18,6 @@ * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public abstract class AbstractBsWorkingTypeCQ extends AbstractConditionQuery { //========================================================================== @@ -48,7 +47,8 @@ // ===== /** - * Equal(=). And NullIgnored, OnceRegistered. {PK : ID : NotNull : INTEGER} + * Equal(=). And NullIgnored, OnlyOnceRegistered. {PK : ID : NotNull : + * INTEGER} * * @param id The value of id as equal. */ @@ -57,7 +57,7 @@ } /** - * NotEqual(!=). And NullIgnored, OnceRegistered. + * NotEqual(!=). And NullIgnored, OnlyOnceRegistered. * * @param id The value of id as notEqual. */ @@ -66,7 +66,7 @@ } /** - * GreaterThan(>). And NullIgnored, OnceRegistered. + * GreaterThan(>). And NullIgnored, OnlyOnceRegistered. * * @param id The value of id as greaterThan. */ @@ -75,7 +75,7 @@ } /** - * LessThan(<). And NullIgnored, OnceRegistered. + * LessThan(<). And NullIgnored, OnlyOnceRegistered. * * @param id The value of id as lessThan. */ @@ -84,7 +84,7 @@ } /** - * GreaterEqual(>=). And NullIgnored, OnceRegistered. + * GreaterEqual(>=). And NullIgnored, OnlyOnceRegistered. * * @param id The value of id as greaterEqual. */ @@ -93,7 +93,7 @@ } /** - * LessEqual(<=). And NullIgnored, OnceRegistered. + * LessEqual(<=). And NullIgnored, OnlyOnceRegistered. * * @param id The value of id as lessEqual. */ @@ -121,22 +121,6 @@ regId(CK_NINS, cTL(idList)); } - /** - * @param monthlyWorkingReportCBquery Query. - * @deprecated Please use inScopeMonthlyWorkingReportList(subQuery) method. - */ - public void setId_InScopeSubQuery_MonthlyWorkingReportList( - MonthlyWorkingReportCQ monthlyWorkingReportCBquery) { - String subQueryPropertyName = keepId_InScopeSubQuery_MonthlyWorkingReportList(monthlyWorkingReportCBquery);// for - // saving - // query - // - - // value - // . - registerInScopeSubQuery(monthlyWorkingReportCBquery, "ID", - "WORKING_TYPE_ID", subQueryPropertyName); - } - public void inScopeMonthlyWorkingReportList( SubQuery subQuery) { assertObjectNotNull("subQuery", subQuery); @@ -144,12 +128,12 @@ cb.xsetupForInScopeSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepId_InScopeSubQuery_MonthlyWorkingReportList(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerInScopeSubQuery(cb.query(), "ID", "WORKING_TYPE_ID", subQueryPropertyName); } - abstract public String keepId_InScopeSubQuery_MonthlyWorkingReportList( + public abstract String keepId_InScopeSubQuery_MonthlyWorkingReportList( MonthlyWorkingReportCQ subQuery); public void notInScopeMonthlyWorkingReportList( @@ -159,31 +143,15 @@ cb.xsetupForInScopeSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepId_NotInScopeSubQuery_MonthlyWorkingReportList(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerNotInScopeSubQuery(cb.query(), "ID", "WORKING_TYPE_ID", subQueryPropertyName); } - abstract public String keepId_NotInScopeSubQuery_MonthlyWorkingReportList( + public abstract String keepId_NotInScopeSubQuery_MonthlyWorkingReportList( MonthlyWorkingReportCQ subQuery); /** - * @param monthlyWorkingReportCBquery Query. - * @deprecated Please use existsMonthlyWorkingReportList(subQuery) method. - */ - public void setId_ExistsSubQuery_MonthlyWorkingReportList( - MonthlyWorkingReportCQ monthlyWorkingReportCBquery) { - String subQueryPropertyName = keepId_ExistsSubQuery_MonthlyWorkingReportList(monthlyWorkingReportCBquery);// for - // saving - // query - // - - // value - // . - registerExistsSubQuery(monthlyWorkingReportCBquery, "ID", - "WORKING_TYPE_ID", subQueryPropertyName); - } - - /** * Set up 'exists' sub-query. {exists (select WORKING_TYPE_ID from * MONTHLY_WORKING_REPORT where ...)} * @@ -198,12 +166,12 @@ cb.xsetupForExistsSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepId_ExistsSubQuery_MonthlyWorkingReportList(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerExistsSubQuery(cb.query(), "ID", "WORKING_TYPE_ID", subQueryPropertyName); } - abstract public String keepId_ExistsSubQuery_MonthlyWorkingReportList( + public abstract String keepId_ExistsSubQuery_MonthlyWorkingReportList( MonthlyWorkingReportCQ subQuery); /** @@ -221,38 +189,38 @@ cb.xsetupForExistsSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepId_NotExistsSubQuery_MonthlyWorkingReportList(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerNotExistsSubQuery(cb.query(), "ID", "WORKING_TYPE_ID", subQueryPropertyName); } - abstract public String keepId_NotExistsSubQuery_MonthlyWorkingReportList( + public abstract String keepId_NotExistsSubQuery_MonthlyWorkingReportList( MonthlyWorkingReportCQ subQuery); public void xderiveMonthlyWorkingReportList(String function, SubQuery subQuery, String aliasName) { assertObjectNotNull("subQuery", subQuery); MonthlyWorkingReportCB cb = new MonthlyWorkingReportCB(); - cb.xsetupForDeriveReferrer(); + cb.xsetupForDerivedReferrer(); subQuery.query(cb); - String subQueryPropertyName = keepId_DeriveSubQuery_MonthlyWorkingReportList(cb - .query());// for saving query-value. - registerDeriveSubQuery(function, cb.query(), "ID", "WORKING_TYPE_ID", - subQueryPropertyName, aliasName); + String subQueryPropertyName = keepId_DerivedReferrer_MonthlyWorkingReportList(cb + .query()); // for saving query-value. + registerDerivedReferrerSubQuery(function, cb.query(), "ID", + "WORKING_TYPE_ID", subQueryPropertyName, aliasName); } - abstract public String keepId_DeriveSubQuery_MonthlyWorkingReportList( + public abstract String keepId_DerivedReferrer_MonthlyWorkingReportList( MonthlyWorkingReportCQ subQuery); /** - * IsNull(is null). And OnceRegistered. + * IsNull(is null). And OnlyOnceRegistered. */ public void setId_IsNull() { regId(CK_ISN, DUMMY_OBJECT); } /** - * IsNotNull(is not null). And OnceRegistered. + * IsNotNull(is not null). And OnlyOnceRegistered. */ public void setId_IsNotNull() { regId(CK_ISNN, DUMMY_OBJECT); @@ -269,7 +237,7 @@ abstract protected ConditionValue getCValueId(); /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {NotNull : + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {NotNull : * VARCHAR(100)} * * @param name The value of name as equal. @@ -279,7 +247,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param name The value of name as notEqual. */ @@ -288,7 +256,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param name The value of name as greaterThan. */ @@ -297,7 +265,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param name The value of name as lessThan. */ @@ -306,7 +274,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param name The value of name as greaterEqual. */ @@ -315,7 +283,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param name The value of name as lessEqual. */ @@ -324,7 +292,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param name The value of name as prefixSearch. */ @@ -333,20 +301,6 @@ } /** - * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, - * SeveralRegistered. - * - * @param name The value of name as likeSearch. - * @param likeSearchOption The option of like-search. (NotNull) - */ - public void setName_LikeSearch( - String name, - jp.sf.pal.timecard.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { - registerLikeSearchQuery(CK_LS, fRES(name), getCValueName(), "NAME", - "Name", "name", likeSearchOption); - } - - /** * InScope(in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * @@ -357,27 +311,41 @@ } /** - * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * - * @param name The collection of name as inScope. - * @param inScopeOption The option of in-scope. (NotNull) + * @param nameList The collection of name as notInScope. */ - public void setName_InScope( + public void setName_NotInScope(Collection nameList) { + regName(CK_NINS, cTL(nameList)); + } + + /** + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param name The value of name as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) + */ + public void setName_LikeSearch( String name, - jp.sf.pal.timecard.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(name), getCValueName(), "NAME", - "Name", "name", inScopeOption); + jp.sf.pal.timecard.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(name), getCValueName(), "NAME", "Name", "name", + likeSearchOption); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param nameList The collection of name as notInScope. + * @param name The value of name as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setName_NotInScope(Collection nameList) { - regName(CK_NINS, cTL(nameList)); + public void setName_NotLikeSearch( + String name, + jp.sf.pal.timecard.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(name), getCValueName(), "NAME", "Name", "name", + likeSearchOption); } protected void regName(ConditionKey key, Object value) { @@ -391,7 +359,7 @@ abstract protected ConditionValue getCValueName(); /** - * Equal(=). And NullIgnored, OnceRegistered. {NotNull : INTEGER} + * Equal(=). And NullIgnored, OnlyOnceRegistered. {NotNull : INTEGER} * * @param value The value of value as equal. */ @@ -400,7 +368,7 @@ } /** - * NotEqual(!=). And NullIgnored, OnceRegistered. + * NotEqual(!=). And NullIgnored, OnlyOnceRegistered. * * @param value The value of value as notEqual. */ @@ -409,7 +377,7 @@ } /** - * GreaterThan(>). And NullIgnored, OnceRegistered. + * GreaterThan(>). And NullIgnored, OnlyOnceRegistered. * * @param value The value of value as greaterThan. */ @@ -418,7 +386,7 @@ } /** - * LessThan(<). And NullIgnored, OnceRegistered. + * LessThan(<). And NullIgnored, OnlyOnceRegistered. * * @param value The value of value as lessThan. */ @@ -427,7 +395,7 @@ } /** - * GreaterEqual(>=). And NullIgnored, OnceRegistered. + * GreaterEqual(>=). And NullIgnored, OnlyOnceRegistered. * * @param value The value of value as greaterEqual. */ @@ -436,7 +404,7 @@ } /** - * LessEqual(<=). And NullIgnored, OnceRegistered. + * LessEqual(<=). And NullIgnored, OnlyOnceRegistered. * * @param value The value of value as lessEqual. */ @@ -476,7 +444,8 @@ abstract protected ConditionValue getCValueValue(); /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {NotNull : VARCHAR(10)} + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {NotNull : + * VARCHAR(10)} * * @param type The value of type as equal. */ @@ -485,7 +454,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param type The value of type as notEqual. */ @@ -494,7 +463,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param type The value of type as greaterThan. */ @@ -503,7 +472,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param type The value of type as lessThan. */ @@ -512,7 +481,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param type The value of type as greaterEqual. */ @@ -521,7 +490,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param type The value of type as lessEqual. */ @@ -530,7 +499,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param type The value of type as prefixSearch. */ @@ -539,20 +508,6 @@ } /** - * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, - * SeveralRegistered. - * - * @param type The value of type as likeSearch. - * @param likeSearchOption The option of like-search. (NotNull) - */ - public void setType_LikeSearch( - String type, - jp.sf.pal.timecard.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { - registerLikeSearchQuery(CK_LS, fRES(type), getCValueType(), "TYPE", - "Type", "type", likeSearchOption); - } - - /** * InScope(in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * @@ -563,27 +518,41 @@ } /** - * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * - * @param type The collection of type as inScope. - * @param inScopeOption The option of in-scope. (NotNull) + * @param typeList The collection of type as notInScope. */ - public void setType_InScope( + public void setType_NotInScope(Collection typeList) { + regType(CK_NINS, cTL(typeList)); + } + + /** + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param type The value of type as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) + */ + public void setType_LikeSearch( String type, - jp.sf.pal.timecard.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(type), getCValueType(), "TYPE", - "Type", "type", inScopeOption); + jp.sf.pal.timecard.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(type), getCValueType(), "TYPE", "Type", "type", + likeSearchOption); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param typeList The collection of type as notInScope. + * @param type The value of type as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setType_NotInScope(Collection typeList) { - regType(CK_NINS, cTL(typeList)); + public void setType_NotLikeSearch( + String type, + jp.sf.pal.timecard.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(type), getCValueType(), "TYPE", "Type", "type", + likeSearchOption); } protected void regType(ConditionKey key, Object value) { @@ -597,7 +566,7 @@ abstract protected ConditionValue getCValueType(); /** - * Equal(=). And NullIgnored, OnceRegistered. {INTEGER : Default=[1]} + * Equal(=). And NullIgnored, OnlyOnceRegistered. {INTEGER : Default=[1]} * * @param parentId The value of parentId as equal. */ @@ -606,7 +575,7 @@ } /** - * NotEqual(!=). And NullIgnored, OnceRegistered. + * NotEqual(!=). And NullIgnored, OnlyOnceRegistered. * * @param parentId The value of parentId as notEqual. */ @@ -615,7 +584,7 @@ } /** - * GreaterThan(>). And NullIgnored, OnceRegistered. + * GreaterThan(>). And NullIgnored, OnlyOnceRegistered. * * @param parentId The value of parentId as greaterThan. */ @@ -624,7 +593,7 @@ } /** - * LessThan(<). And NullIgnored, OnceRegistered. + * LessThan(<). And NullIgnored, OnlyOnceRegistered. * * @param parentId The value of parentId as lessThan. */ @@ -633,7 +602,7 @@ } /** - * GreaterEqual(>=). And NullIgnored, OnceRegistered. + * GreaterEqual(>=). And NullIgnored, OnlyOnceRegistered. * * @param parentId The value of parentId as greaterEqual. */ @@ -642,7 +611,7 @@ } /** - * LessEqual(<=). And NullIgnored, OnceRegistered. + * LessEqual(<=). And NullIgnored, OnlyOnceRegistered. * * @param parentId The value of parentId as lessEqual. */ @@ -671,14 +640,14 @@ } /** - * IsNull(is null). And OnceRegistered. + * IsNull(is null). And OnlyOnceRegistered. */ public void setParentId_IsNull() { regParentId(CK_ISN, DUMMY_OBJECT); } /** - * IsNotNull(is not null). And OnceRegistered. + * IsNotNull(is not null). And OnlyOnceRegistered. */ public void setParentId_IsNotNull() { regParentId(CK_ISNN, DUMMY_OBJECT); @@ -697,7 +666,7 @@ abstract protected ConditionValue getCValueParentId(); /** - * Equal(=). And NullIgnored, OnceRegistered. {NotNull : TIMESTAMP} + * Equal(=). And NullIgnored, OnlyOnceRegistered. {NotNull : TIMESTAMP} * * @param createdTime The value of createdTime as equal. */ @@ -706,7 +675,7 @@ } /** - * NotEqual(!=). And NullIgnored, OnceRegistered. + * NotEqual(!=). And NullIgnored, OnlyOnceRegistered. * * @param createdTime The value of createdTime as notEqual. */ @@ -715,7 +684,7 @@ } /** - * GreaterThan(>). And NullIgnored, OnceRegistered. + * GreaterThan(>). And NullIgnored, OnlyOnceRegistered. * * @param createdTime The value of createdTime as greaterThan. */ @@ -724,7 +693,7 @@ } /** - * LessThan(>). And NullIgnored, OnceRegistered. + * LessThan(>). And NullIgnored, OnlyOnceRegistered. * * @param createdTime The value of createdTime as lessThan. */ @@ -733,7 +702,7 @@ } /** - * GreaterEqual(>). And NullIgnored, OnceRegistered. + * GreaterEqual(>). And NullIgnored, OnlyOnceRegistered. * * @param createdTime The value of createdTime as greaterEqual. */ @@ -742,7 +711,7 @@ } /** - * LessEqual(>). And NullIgnored, OnceRegistered. + * LessEqual(>). And NullIgnored, OnlyOnceRegistered. * * @param createdTime The value of createdTime as lessEqual. */ @@ -752,7 +721,7 @@ /** * FromTo($fromDate <= COLUMN_NAME <= $toDate). And NullIgnored, - * OnceRegistered. {NotNull : TIMESTAMP} + * OnlyOnceRegistered. {NotNull : TIMESTAMP} * * @param fromDate The from-date of createdTime. (Nullable) * @param toDate The to-date of createdTime. (Nullable) @@ -770,7 +739,7 @@ /** * FromTo($fromDate <= COLUMN_NAME < $toDate + 1). And NullIgnored, - * OnceRegistered. {NotNull : TIMESTAMP} + * OnlyOnceRegistered. {NotNull : TIMESTAMP} * * @param fromDate The from-date of createdTime. (Nullable) * @param toDate The to-date of createdTime. (Nullable) @@ -796,7 +765,7 @@ abstract protected ConditionValue getCValueCreatedTime(); /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {NotNull : + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {NotNull : * VARCHAR(255)} * * @param createdBy The value of createdBy as equal. @@ -806,7 +775,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param createdBy The value of createdBy as notEqual. */ @@ -815,7 +784,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param createdBy The value of createdBy as greaterThan. */ @@ -824,7 +793,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param createdBy The value of createdBy as lessThan. */ @@ -833,7 +802,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param createdBy The value of createdBy as greaterEqual. */ @@ -842,7 +811,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param createdBy The value of createdBy as lessEqual. */ @@ -851,7 +820,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param createdBy The value of createdBy as prefixSearch. */ @@ -860,20 +829,6 @@ } /** - * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, - * SeveralRegistered. - * - * @param createdBy The value of createdBy as likeSearch. - * @param likeSearchOption The option of like-search. (NotNull) - */ - public void setCreatedBy_LikeSearch( - String createdBy, - jp.sf.pal.timecard.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { - registerLikeSearchQuery(CK_LS, fRES(createdBy), getCValueCreatedBy(), - "CREATED_BY", "CreatedBy", "createdBy", likeSearchOption); - } - - /** * InScope(in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * @@ -884,27 +839,41 @@ } /** - * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * - * @param createdBy The collection of createdBy as inScope. - * @param inScopeOption The option of in-scope. (NotNull) + * @param createdByList The collection of createdBy as notInScope. */ - public void setCreatedBy_InScope( + public void setCreatedBy_NotInScope(Collection createdByList) { + regCreatedBy(CK_NINS, cTL(createdByList)); + } + + /** + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param createdBy The value of createdBy as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) + */ + public void setCreatedBy_LikeSearch( String createdBy, - jp.sf.pal.timecard.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(createdBy), getCValueCreatedBy(), - "CREATED_BY", "CreatedBy", "createdBy", inScopeOption); + jp.sf.pal.timecard.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(createdBy), getCValueCreatedBy(), "CREATED_BY", + "CreatedBy", "createdBy", likeSearchOption); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param createdByList The collection of createdBy as notInScope. + * @param createdBy The value of createdBy as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setCreatedBy_NotInScope(Collection createdByList) { - regCreatedBy(CK_NINS, cTL(createdByList)); + public void setCreatedBy_NotLikeSearch( + String createdBy, + jp.sf.pal.timecard.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(createdBy), getCValueCreatedBy(), "CREATED_BY", + "CreatedBy", "createdBy", likeSearchOption); } protected void regCreatedBy(ConditionKey key, Object value) { @@ -920,7 +889,7 @@ abstract protected ConditionValue getCValueCreatedBy(); /** - * Equal(=). And NullIgnored, OnceRegistered. {NotNull : TIMESTAMP} + * Equal(=). And NullIgnored, OnlyOnceRegistered. {NotNull : TIMESTAMP} * * @param updatedTime The value of updatedTime as equal. */ @@ -929,7 +898,7 @@ } /** - * NotEqual(!=). And NullIgnored, OnceRegistered. + * NotEqual(!=). And NullIgnored, OnlyOnceRegistered. * * @param updatedTime The value of updatedTime as notEqual. */ @@ -938,7 +907,7 @@ } /** - * GreaterThan(>). And NullIgnored, OnceRegistered. + * GreaterThan(>). And NullIgnored, OnlyOnceRegistered. * * @param updatedTime The value of updatedTime as greaterThan. */ @@ -947,7 +916,7 @@ } /** - * LessThan(>). And NullIgnored, OnceRegistered. + * LessThan(>). And NullIgnored, OnlyOnceRegistered. * * @param updatedTime The value of updatedTime as lessThan. */ @@ -956,7 +925,7 @@ } /** - * GreaterEqual(>). And NullIgnored, OnceRegistered. + * GreaterEqual(>). And NullIgnored, OnlyOnceRegistered. * * @param updatedTime The value of updatedTime as greaterEqual. */ @@ -965,7 +934,7 @@ } /** - * LessEqual(>). And NullIgnored, OnceRegistered. + * LessEqual(>). And NullIgnored, OnlyOnceRegistered. * * @param updatedTime The value of updatedTime as lessEqual. */ @@ -975,7 +944,7 @@ /** * FromTo($fromDate <= COLUMN_NAME <= $toDate). And NullIgnored, - * OnceRegistered. {NotNull : TIMESTAMP} + * OnlyOnceRegistered. {NotNull : TIMESTAMP} * * @param fromDate The from-date of updatedTime. (Nullable) * @param toDate The to-date of updatedTime. (Nullable) @@ -993,7 +962,7 @@ /** * FromTo($fromDate <= COLUMN_NAME < $toDate + 1). And NullIgnored, - * OnceRegistered. {NotNull : TIMESTAMP} + * OnlyOnceRegistered. {NotNull : TIMESTAMP} * * @param fromDate The from-date of updatedTime. (Nullable) * @param toDate The to-date of updatedTime. (Nullable) @@ -1019,7 +988,7 @@ abstract protected ConditionValue getCValueUpdatedTime(); /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {NotNull : + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {NotNull : * VARCHAR(255)} * * @param updatedBy The value of updatedBy as equal. @@ -1029,7 +998,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param updatedBy The value of updatedBy as notEqual. */ @@ -1038,7 +1007,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param updatedBy The value of updatedBy as greaterThan. */ @@ -1047,7 +1016,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param updatedBy The value of updatedBy as lessThan. */ @@ -1056,7 +1025,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param updatedBy The value of updatedBy as greaterEqual. */ @@ -1065,7 +1034,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param updatedBy The value of updatedBy as lessEqual. */ @@ -1074,7 +1043,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param updatedBy The value of updatedBy as prefixSearch. */ @@ -1083,20 +1052,6 @@ } /** - * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, - * SeveralRegistered. - * - * @param updatedBy The value of updatedBy as likeSearch. - * @param likeSearchOption The option of like-search. (NotNull) - */ - public void setUpdatedBy_LikeSearch( - String updatedBy, - jp.sf.pal.timecard.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { - registerLikeSearchQuery(CK_LS, fRES(updatedBy), getCValueUpdatedBy(), - "UPDATED_BY", "UpdatedBy", "updatedBy", likeSearchOption); - } - - /** * InScope(in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * @@ -1107,27 +1062,41 @@ } /** - * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * - * @param updatedBy The collection of updatedBy as inScope. - * @param inScopeOption The option of in-scope. (NotNull) + * @param updatedByList The collection of updatedBy as notInScope. */ - public void setUpdatedBy_InScope( + public void setUpdatedBy_NotInScope(Collection updatedByList) { + regUpdatedBy(CK_NINS, cTL(updatedByList)); + } + + /** + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param updatedBy The value of updatedBy as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) + */ + public void setUpdatedBy_LikeSearch( String updatedBy, - jp.sf.pal.timecard.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(updatedBy), getCValueUpdatedBy(), - "UPDATED_BY", "UpdatedBy", "updatedBy", inScopeOption); + jp.sf.pal.timecard.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(updatedBy), getCValueUpdatedBy(), "UPDATED_BY", + "UpdatedBy", "updatedBy", likeSearchOption); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param updatedByList The collection of updatedBy as notInScope. + * @param updatedBy The value of updatedBy as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setUpdatedBy_NotInScope(Collection updatedByList) { - regUpdatedBy(CK_NINS, cTL(updatedByList)); + public void setUpdatedBy_NotLikeSearch( + String updatedBy, + jp.sf.pal.timecard.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(updatedBy), getCValueUpdatedBy(), "UPDATED_BY", + "UpdatedBy", "updatedBy", likeSearchOption); } protected void regUpdatedBy(ConditionKey key, Object value) { @@ -1143,7 +1112,7 @@ abstract protected ConditionValue getCValueUpdatedBy(); /** - * Equal(=). And NullIgnored, OnceRegistered. {TIMESTAMP} + * Equal(=). And NullIgnored, OnlyOnceRegistered. {TIMESTAMP} * * @param deletedTime The value of deletedTime as equal. */ @@ -1152,7 +1121,7 @@ } /** - * NotEqual(!=). And NullIgnored, OnceRegistered. + * NotEqual(!=). And NullIgnored, OnlyOnceRegistered. * * @param deletedTime The value of deletedTime as notEqual. */ @@ -1161,7 +1130,7 @@ } /** - * GreaterThan(>). And NullIgnored, OnceRegistered. + * GreaterThan(>). And NullIgnored, OnlyOnceRegistered. * * @param deletedTime The value of deletedTime as greaterThan. */ @@ -1170,7 +1139,7 @@ } /** - * LessThan(>). And NullIgnored, OnceRegistered. + * LessThan(>). And NullIgnored, OnlyOnceRegistered. * * @param deletedTime The value of deletedTime as lessThan. */ @@ -1179,7 +1148,7 @@ } /** - * GreaterEqual(>). And NullIgnored, OnceRegistered. + * GreaterEqual(>). And NullIgnored, OnlyOnceRegistered. * * @param deletedTime The value of deletedTime as greaterEqual. */ @@ -1188,7 +1157,7 @@ } /** - * LessEqual(>). And NullIgnored, OnceRegistered. + * LessEqual(>). And NullIgnored, OnlyOnceRegistered. * * @param deletedTime The value of deletedTime as lessEqual. */ @@ -1198,7 +1167,7 @@ /** * FromTo($fromDate <= COLUMN_NAME <= $toDate). And NullIgnored, - * OnceRegistered. {TIMESTAMP} + * OnlyOnceRegistered. {TIMESTAMP} * * @param fromDate The from-date of deletedTime. (Nullable) * @param toDate The to-date of deletedTime. (Nullable) @@ -1216,7 +1185,7 @@ /** * FromTo($fromDate <= COLUMN_NAME < $toDate + 1). And NullIgnored, - * OnceRegistered. {TIMESTAMP} + * OnlyOnceRegistered. {TIMESTAMP} * * @param fromDate The from-date of deletedTime. (Nullable) * @param toDate The to-date of deletedTime. (Nullable) @@ -1230,14 +1199,14 @@ } /** - * IsNull(is null). And OnceRegistered. + * IsNull(is null). And OnlyOnceRegistered. */ public void setDeletedTime_IsNull() { regDeletedTime(CK_ISN, DUMMY_OBJECT); } /** - * IsNotNull(is not null). And OnceRegistered. + * IsNotNull(is not null). And OnlyOnceRegistered. */ public void setDeletedTime_IsNotNull() { regDeletedTime(CK_ISNN, DUMMY_OBJECT); @@ -1256,7 +1225,7 @@ abstract protected ConditionValue getCValueDeletedTime(); /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {VARCHAR(255)} + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {VARCHAR(255)} * * @param deletedBy The value of deletedBy as equal. */ @@ -1265,7 +1234,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param deletedBy The value of deletedBy as notEqual. */ @@ -1274,7 +1243,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param deletedBy The value of deletedBy as greaterThan. */ @@ -1283,7 +1252,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param deletedBy The value of deletedBy as lessThan. */ @@ -1292,7 +1261,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param deletedBy The value of deletedBy as greaterEqual. */ @@ -1301,7 +1270,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param deletedBy The value of deletedBy as lessEqual. */ @@ -1310,7 +1279,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param deletedBy The value of deletedBy as prefixSearch. */ @@ -1319,20 +1288,6 @@ } /** - * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, - * SeveralRegistered. - * - * @param deletedBy The value of deletedBy as likeSearch. - * @param likeSearchOption The option of like-search. (NotNull) - */ - public void setDeletedBy_LikeSearch( - String deletedBy, - jp.sf.pal.timecard.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { - registerLikeSearchQuery(CK_LS, fRES(deletedBy), getCValueDeletedBy(), - "DELETED_BY", "DeletedBy", "deletedBy", likeSearchOption); - } - - /** * InScope(in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * @@ -1343,38 +1298,52 @@ } /** - * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * - * @param deletedBy The collection of deletedBy as inScope. - * @param inScopeOption The option of in-scope. (NotNull) + * @param deletedByList The collection of deletedBy as notInScope. */ - public void setDeletedBy_InScope( + public void setDeletedBy_NotInScope(Collection deletedByList) { + regDeletedBy(CK_NINS, cTL(deletedByList)); + } + + /** + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param deletedBy The value of deletedBy as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) + */ + public void setDeletedBy_LikeSearch( String deletedBy, - jp.sf.pal.timecard.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(deletedBy), getCValueDeletedBy(), - "DELETED_BY", "DeletedBy", "deletedBy", inScopeOption); + jp.sf.pal.timecard.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(deletedBy), getCValueDeletedBy(), "DELETED_BY", + "DeletedBy", "deletedBy", likeSearchOption); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param deletedByList The collection of deletedBy as notInScope. + * @param deletedBy The value of deletedBy as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setDeletedBy_NotInScope(Collection deletedByList) { - regDeletedBy(CK_NINS, cTL(deletedByList)); + public void setDeletedBy_NotLikeSearch( + String deletedBy, + jp.sf.pal.timecard.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(deletedBy), getCValueDeletedBy(), "DELETED_BY", + "DeletedBy", "deletedBy", likeSearchOption); } /** - * IsNull(is null). And OnceRegistered. + * IsNull(is null). And OnlyOnceRegistered. */ public void setDeletedBy_IsNull() { regDeletedBy(CK_ISN, DUMMY_OBJECT); } /** - * IsNotNull(is not null). And OnceRegistered. + * IsNotNull(is not null). And OnlyOnceRegistered. */ public void setDeletedBy_IsNotNull() { regDeletedBy(CK_ISNN, DUMMY_OBJECT); @@ -1393,7 +1362,7 @@ abstract protected ConditionValue getCValueDeletedBy(); /** - * Equal(=). And NullIgnored, OnceRegistered. {NotNull : INTEGER : + * Equal(=). And NullIgnored, OnlyOnceRegistered. {NotNull : INTEGER : * Default=[0]} * * @param versionno The value of versionno as equal. @@ -1403,7 +1372,7 @@ } /** - * NotEqual(!=). And NullIgnored, OnceRegistered. + * NotEqual(!=). And NullIgnored, OnlyOnceRegistered. * * @param versionno The value of versionno as notEqual. */ @@ -1412,7 +1381,7 @@ } /** - * GreaterThan(>). And NullIgnored, OnceRegistered. + * GreaterThan(>). And NullIgnored, OnlyOnceRegistered. * * @param versionno The value of versionno as greaterThan. */ @@ -1421,7 +1390,7 @@ } /** - * LessThan(<). And NullIgnored, OnceRegistered. + * LessThan(<). And NullIgnored, OnlyOnceRegistered. * * @param versionno The value of versionno as lessThan. */ @@ -1430,7 +1399,7 @@ } /** - * GreaterEqual(>=). And NullIgnored, OnceRegistered. + * GreaterEqual(>=). And NullIgnored, OnlyOnceRegistered. * * @param versionno The value of versionno as greaterEqual. */ @@ -1439,7 +1408,7 @@ } /** - * LessEqual(<=). And NullIgnored, OnceRegistered. + * LessEqual(<=). And NullIgnored, OnlyOnceRegistered. * * @param versionno The value of versionno as lessEqual. */ @@ -1479,6 +1448,50 @@ abstract protected ConditionValue getCValueVersionno(); + public SSQFunction scalar_Equal() { + return xcreateSSQFunction("="); + } + + public SSQFunction scalar_GreaterEqual() { + return xcreateSSQFunction(">="); + } + + public SSQFunction scalar_GreaterThan() { + return xcreateSSQFunction(">"); + } + + public SSQFunction scalar_LessEqual() { + return xcreateSSQFunction("<="); + } + + public SSQFunction scalar_LessThan() { + return xcreateSSQFunction("<"); + } + + protected SSQFunction xcreateSSQFunction(final String operand) { + return new SSQFunction(new SSQSetupper() { + public void setup(String function, SubQuery subQuery) { + xscalarSubQuery(function, subQuery, operand); + } + }); + } + + protected void xscalarSubQuery(String function, + SubQuery subQuery, String operand) { + assertObjectNotNull("subQuery", subQuery); + WorkingTypeCB cb = new WorkingTypeCB(); + cb.xsetupForScalarSubQuery(); + subQuery.query(cb); + String subQueryPropertyName = keepScalarSubQuery(cb.query()); // for + // saving + // query + // -value. + registerScalarSubQuery(function, cb.query(), subQueryPropertyName, + operand); + } + + public abstract String keepScalarSubQuery(WorkingTypeCQ subQuery); + // Very Internal (for Suppressing Warn about 'Not Use Import') protected String getConditionBeanClassNameInternally() { return WorkingTypeCB.class.getName(); Modified: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/cbean/cq/bs/BsDailyReportCQ.java =================================================================== --- timecard/trunk/src/main/java/jp/sf/pal/timecard/db/cbean/cq/bs/BsDailyReportCQ.java 2008-12-27 22:18:30 UTC (rev 1630) +++ timecard/trunk/src/main/java/jp/sf/pal/timecard/db/cbean/cq/bs/BsDailyReportCQ.java 2008-12-27 22:20:25 UTC (rev 1631) @@ -5,6 +5,7 @@ import jp.sf.pal.timecard.db.allcommon.cbean.ConditionQuery; import jp.sf.pal.timecard.db.allcommon.cbean.cvalue.ConditionValue; import jp.sf.pal.timecard.db.allcommon.cbean.sqlclause.SqlClause; +import jp.sf.pal.timecard.db.cbean.DailyReportCB; import jp.sf.pal.timecard.db.cbean.cq.DailyReportCQ; import jp.sf.pal.timecard.db.cbean.cq.MonthlyReportCQ; import jp.sf.pal.timecard.db.cbean.cq.ciq.DailyReportCIQ; @@ -14,7 +15,6 @@ * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public class BsDailyReportCQ extends AbstractBsDailyReportCQ { //========================================================================== @@ -60,7 +60,7 @@ public DailyReportCIQ on() { if (isBaseQuery(this)) { throw new UnsupportedOperationException( - "Unsupported onClause of Base Table!"); + "Unsupported on-clause for local table!"); } DailyReportCIQ inlineQuery = inline(); inlineQuery.xsetOnClauseInline(true); @@ -536,7 +536,6 @@ // ========= // Foreign Query // ============= - public MonthlyReportCQ queryMonthlyReport() { return getConditionQueryMonthlyReport(); } @@ -545,20 +544,13 @@ public MonthlyReportCQ getConditionQueryMonthlyReport() { if (_conditionQueryMonthlyReport == null) { - _conditionQueryMonthlyReport = createQueryMonthlyReport(); - setupOuterJoin_MonthlyReport(); + _conditionQueryMonthlyReport = xcreateQueryMonthlyReport(); + xsetupOuterJoinMonthlyReport(); } return _conditionQueryMonthlyReport; } - protected void setupOuterJoin_MonthlyReport() { - Map joinOnMap = newLinkedHashMap(); - joinOnMap.put(getRealColumnName("MONTHLY_REPORT_ID"), - getConditionQueryMonthlyReport().getRealColumnName("ID")); - registerOuterJoin(getConditionQueryMonthlyReport(), joinOnMap); - } - - protected MonthlyReportCQ createQueryMonthlyReport() { + protected MonthlyReportCQ xcreateQueryMonthlyReport() { String nrp = resolveNextRelationPath("DAILY_REPORT", "monthlyReport"); String jan = resolveJoinAliasName(nrp, getNextNestLevel()); MonthlyReportCQ cq = new MonthlyReportCQ(this, getSqlClause(), jan, @@ -568,10 +560,42 @@ return cq; } + protected void xsetupOuterJoinMonthlyReport() { + MonthlyReportCQ cq = getConditionQueryMonthlyReport(); + Map joinOnMap = newLinkedHashMap(); + joinOnMap.put(getRealColumnName("MONTHLY_REPORT_ID"), cq + .getRealColumnName("ID")); + registerOuterJoin(cq, joinOnMap); + } + public boolean hasConditionQueryMonthlyReport() { return _conditionQueryMonthlyReport != null; } + //========================================================================== + // ========= + // Derived Query + // ============= + protected Map _scalarSubQueryMap; + + public Map getScalarSubQuery() { + return _scalarSubQueryMap; + } + + public String keepScalarSubQuery(DailyReportCQ subQuery) { + if (_scalarSubQueryMap == null) { + _scalarSubQueryMap = newLinkedHashMap(); + } + String key = "subQueryMapKey" + (_scalarSubQueryMap.size() + 1); + _scalarSubQueryMap.put(key, subQuery); + return "scalarSubQuery." + key; + } + + // Very Internal (for Suppressing Warn about 'Not Use Import') + protected String getConditionBeanClassNameInternally() { + return DailyReportCB.class.getName(); + } + protected String getConditionQueryClassNameInternally() { return DailyReportCQ.class.getName(); } Modified: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/cbean/cq/bs/BsEmployeeCQ.java =================================================================== --- timecard/trunk/src/main/java/jp/sf/pal/timecard/db/cbean/cq/bs/BsEmployeeCQ.java 2008-12-27 22:18:30 UTC (rev 1630) +++ timecard/trunk/src/main/java/jp/sf/pal/timecard/db/cbean/cq/bs/BsEmployeeCQ.java 2008-12-27 22:20:25 UTC (rev 1631) @@ -5,6 +5,7 @@ import jp.sf.pal.timecard.db.allcommon.cbean.ConditionQuery; import jp.sf.pal.timecard.db.allcommon.cbean.cvalue.ConditionValue; import jp.sf.pal.timecard.db.allcommon.cbean.sqlclause.SqlClause; +import jp.sf.pal.timecard.db.cbean.EmployeeCB; import jp.sf.pal.timecard.db.cbean.cq.EmployeeCQ; import jp.sf.pal.timecard.db.cbean.cq.MonthlyReportCQ; import jp.sf.pal.timecard.db.cbean.cq.UserInfoCQ; @@ -15,7 +16,6 @@ * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public class BsEmployeeCQ extends AbstractBsEmployeeCQ { //========================================================================== @@ -61,7 +61,7 @@ public EmployeeCIQ on() { if (isBaseQuery(this)) { throw new UnsupportedOperationException( - "Unsupported onClause of Base Table!"); + "Unsupported on-clause for local table!"); } EmployeeCIQ inlineQuery = inline(); inlineQuery.xsetOnClauseInline(true); @@ -154,21 +154,21 @@ return "id_NotExistsSubQuery_MonthlyReportList." + key; } - protected Map _id_DeriveSubQuery_MonthlyReportListMap; + protected Map _id_DerivedReferrer_MonthlyReportListMap; - public Map getId_DeriveSubQuery_MonthlyReportList() { - return _id_DeriveSubQuery_MonthlyReportListMap; + public Map getId_DerivedReferrer_MonthlyReportList() { + return _id_DerivedReferrer_MonthlyReportListMap; } - public String keepId_DeriveSubQuery_MonthlyReportList( + public String keepId_DerivedReferrer_MonthlyReportList( MonthlyReportCQ subQuery) { - if (_id_DeriveSubQuery_MonthlyReportListMap == null) { - _id_DeriveSubQuery_MonthlyReportListMap = newLinkedHashMap(); + if (_id_DerivedReferrer_MonthlyReportListMap == null) { + _id_DerivedReferrer_MonthlyReportListMap = newLinkedHashMap(); } String key = "subQueryMapKey" - + (_id_DeriveSubQuery_MonthlyReportListMap.size() + 1); - _id_DeriveSubQuery_MonthlyReportListMap.put(key, subQuery); - return "id_DeriveSubQuery_MonthlyReportList." + key; + + (_id_DerivedReferrer_MonthlyReportListMap.size() + 1); + _id_DerivedReferrer_MonthlyReportListMap.put(key, subQuery); + return "id_DerivedReferrer_MonthlyReportList." + key; } public BsEmployeeCQ addOrderBy_Id_Asc() { @@ -483,7 +483,6 @@ // ========= // Foreign Query // ============= - public UserInfoCQ queryUserInfoByUsername() { return getConditionQueryUserInfoByUsername(); } @@ -492,21 +491,13 @@ public UserInfoCQ getConditionQueryUserInfoByUsername() { if (_conditionQueryUserInfoByUsername == null) { - _conditionQueryUserInfoByUsername = createQueryUserInfoByUsername(); - setupOuterJoin_UserInfoByUsername(); + _conditionQueryUserInfoByUsername = xcreateQueryUserInfoByUsername(); + xsetupOuterJoinUserInfoByUsername(); } return _conditionQueryUserInfoByUsername; } - protected void setupOuterJoin_UserInfoByUsername() { - Map joinOnMap = newLinkedHashMap(); - joinOnMap.put(getRealColumnName("USERNAME"), - getConditionQueryUserInfoByUsername().getRealColumnName( - "USER_ID")); - registerOuterJoin(getConditionQueryUserInfoByUsername(), joinOnMap); - } - - protected UserInfoCQ createQueryUserInfoByUsername() { + protected UserInfoCQ xcreateQueryUserInfoByUsername() { String nrp = resolveNextRelationPath("EMPLOYEE", "userInfoByUsername"); String jan = resolveJoinAliasName(nrp, getNextNestLevel()); UserInfoCQ cq = new UserInfoCQ(this, getSqlClause(), jan, @@ -516,6 +507,14 @@ return cq; } + protected void xsetupOuterJoinUserInfoByUsername() { + UserInfoCQ cq = getConditionQueryUserInfoByUsername(); + Map joinOnMap = newLinkedHashMap(); + joinOnMap.put(getRealColumnName("USERNAME"), cq + .getRealColumnName("USER_ID")); + registerOuterJoin(cq, joinOnMap); + } + public boolean hasConditionQueryUserInfoByUsername() { return _conditionQueryUserInfoByUsername != null; } @@ -528,21 +527,13 @@ public UserInfoCQ getConditionQueryUserInfoByManager() { if (_conditionQueryUserInfoByManager == null) { - _conditionQueryUserInfoByManager = createQueryUserInfoByManager(); - setupOuterJoin_UserInfoByManager(); + _conditionQueryUserInfoByManager = xcreateQueryUserInfoByManager(); + xsetupOuterJoinUserInfoByManager(); } return _conditionQueryUserInfoByManager; } - protected void setupOuterJoin_UserInfoByManager() { - Map joinOnMap = newLinkedHashMap(); - joinOnMap.put(getRealColumnName("MANAGER"), - getConditionQueryUserInfoByManager().getRealColumnName( - "USER_ID")); - registerOuterJoin(getConditionQueryUserInfoByManager(), joinOnMap); - } - - protected UserInfoCQ createQueryUserInfoByManager() { + protected UserInfoCQ xcreateQueryUserInfoByManager() { String nrp = resolveNextRelationPath("EMPLOYEE", "userInfoByManager"); String jan = resolveJoinAliasName(nrp, getNextNestLevel()); UserInfoCQ cq = new UserInfoCQ(this, getSqlClause(), jan, @@ -552,10 +543,42 @@ return cq; } + protected void xsetupOuterJoinUserInfoByManager() { + UserInfoCQ cq = getConditionQueryUserInfoByManager(); + Map joinOnMap = newLinkedHashMap(); + joinOnMap.put(getRealColumnName("MANAGER"), cq + .getRealColumnName("USER_ID")); + registerOuterJoin(cq, joinOnMap); + } + public boolean hasConditionQueryUserInfoByManager() { return _conditionQueryUserInfoByManager != null; } + //========================================================================== + // ========= + // Derived Query + // ============= + protected Map _scalarSubQueryMap; + + public Map getScalarSubQuery() { + return _scalarSubQueryMap; + } + + public String keepScalarSubQuery(EmployeeCQ subQuery) { + if (_scalarSubQueryMap == null) { + _scalarSubQueryMap = newLinkedHashMap(); + } + String key = "subQueryMapKey" + (_scalarSubQueryMap.size() + 1); + _scalarSubQueryMap.put(key, subQuery); + return "scalarSubQuery." + key; + } + + // Very Internal (for Suppressing Warn about 'Not Use Import') + protected String getConditionBeanClassNameInternally() { + return EmployeeCB.class.getName(); + } + protected String getConditionQueryClassNameInternally() { return EmployeeCQ.class.getName(); } Modified: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/cbean/cq/bs/BsGroupInfoCQ.java =================================================================== --- timecard/trunk/src/main/java/jp/sf/pal/timecard/db/cbean/cq/bs/BsGroupInfoCQ.java 2008-12-27 22:18:30 UTC (rev 1630) +++ timecard/trunk/src/main/java/jp/sf/pal/timecard/db/cbean/cq/bs/BsGroupInfoCQ.java 2008-12-27 22:20:25 UTC (rev 1631) @@ -5,6 +5,7 @@ import jp.sf.pal.timecard.db.allcommon.cbean.ConditionQuery; import jp.sf.pal.timecard.db.allcommon.cbean.cvalue.ConditionValue; import jp.sf.pal.timecard.db.allcommon.cbean.sqlclause.SqlClause; +import jp.sf.pal.timecard.db.cbean.GroupInfoCB; import jp.sf.pal.timecard.db.cbean.cq.GroupInfoCQ; import jp.sf.pal.timecard.db.cbean.cq.GroupMappingCQ; import jp.sf.pal.timecard.db.cbean.cq.UserInfoCQ; @@ -15,7 +16,6 @@ * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public class BsGroupInfoCQ extends AbstractBsGroupInfoCQ { //========================================================================== @@ -61,7 +61,7 @@ public GroupInfoCIQ on() { if (isBaseQuery(this)) { throw new UnsupportedOperationException( - "Unsupported onClause of Base Table!"); + "Unsupported on-clause for local table!"); } GroupInfoCIQ inlineQuery = inline(); inlineQuery.xsetOnClauseInline(true); @@ -219,37 +219,37 @@ return "groupId_NotExistsSubQuery_UserInfoList." + key; } - protected Map _groupId_DeriveSubQuery_GroupMappingListMap; + protected Map _groupId_DerivedReferrer_GroupMappingListMap; - public Map getGroupId_DeriveSubQuery_GroupMappingList() { - return _groupId_DeriveSubQuery_GroupMappingListMap; + public Map getGroupId_DerivedReferrer_GroupMappingList() { + return _groupId_DerivedReferrer_GroupMappingListMap; } - public String keepGroupId_DeriveSubQuery_GroupMappingList( + public String keepGroupId_DerivedReferrer_GroupMappingList( GroupMappingCQ subQuery) { - if (_groupId_DeriveSubQuery_GroupMappingListMap == null) { - _groupId_DeriveSubQuery_GroupMappingListMap = newLinkedHashMap(); + if (_groupId_DerivedReferrer_GroupMappingListMap == null) { + _groupId_DerivedReferrer_GroupMappingListMap = newLinkedHashMap(); } String key = "subQueryMapKey" - + (_groupId_DeriveSubQuery_GroupMappingListMap.size() + 1); - _groupId_DeriveSubQuery_GroupMappingListMap.put(key, subQuery); - return "groupId_DeriveSubQuery_GroupMappingList." + key; + + (_groupId_DerivedReferrer_GroupMappingListMap.size() + 1); + _groupId_DerivedReferrer_GroupMappingListMap.put(key, subQuery); + return "groupId_DerivedReferrer_GroupMappingList." + key; } - protected Map _groupId_DeriveSubQuery_UserInfoListMap; + protected Map _groupId_DerivedReferrer_UserInfoListMap; - public Map getGroupId_DeriveSubQuery_UserInfoList() { - return _groupId_DeriveSubQuery_UserInfoListMap; + public Map getGroupId_DerivedReferrer_UserInfoList() { + return _groupId_DerivedReferrer_UserInfoListMap; } - public String keepGroupId_DeriveSubQuery_UserInfoList(UserInfoCQ subQuery) { - if (_groupId_DeriveSubQuery_UserInfoListMap == null) { - _groupId_DeriveSubQuery_UserInfoListMap = newLinkedHashMap(); + public String keepGroupId_DerivedReferrer_UserInfoList(UserInfoCQ subQuery) { + if (_groupId_DerivedReferrer_UserInfoListMap == null) { + _groupId_DerivedReferrer_UserInfoListMap = newLinkedHashMap(); } String key = "subQueryMapKey" - + (_groupId_DeriveSubQuery_UserInfoListMap.size() + 1); - _groupId_DeriveSubQuery_UserInfoListMap.put(key, subQuery); - return "groupId_DeriveSubQuery_UserInfoList." + key; + + (_groupId_DerivedReferrer_UserInfoListMap.size() + 1); + _groupId_DerivedReferrer_UserInfoListMap.put(key, subQuery); + return "groupId_DerivedReferrer_UserInfoList." + key; } public BsGroupInfoCQ addOrderBy_GroupId_Asc() { @@ -564,7 +564,30 @@ // ========= // Foreign Query // ============= + //========================================================================== + // ========= + // Derived Query + // ============= + protected Map _scalarSubQueryMap; + public Map getScalarSubQuery() { + return _scalarSubQueryMap; + } + + public String keepScalarSubQuery(GroupInfoCQ subQuery) { + if (_scalarSubQueryMap == null) { + _scalarSubQueryMap = newLinkedHashMap(); + } + String key = "subQueryMapKey" + (_scalarSubQueryMap.size() + 1); + _scalarSubQueryMap.put(key, subQuery); + return "scalarSubQuery." + key; + } + + // Very Internal (for Suppressing Warn about 'Not Use Import') + protected String getConditionBeanClassNameInternally() { + return GroupInfoCB.class.getName(); + } + protected String getConditionQueryClassNameInternally() { return GroupInfoCQ.class.getName(); } Modified: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/cbean/cq/bs/BsGroupMappingCQ.java =================================================================== --- timecard/trunk/src/main/java/jp/sf/pal/timecard/db/cbean/cq/bs/BsGroupMappingCQ.java 2008-12-27 22:18:30 UTC (rev 1630) +++ timecard/trunk/src/main/java/jp/sf/pal/timecard/db/cbean/cq/bs/BsGroupMappingCQ.java 2008-12-27 22:20:25 UTC (rev 1631) @@ -5,6 +5,7 @@ import jp.sf.pal.timecard.db.allcommon.cbean.ConditionQuery; import jp.sf.pal.timecard.db.allcommon.cbean.cvalue.ConditionValue; import jp.sf.pal.timecard.db.allcommon.cbean.sqlclause.SqlClause; +import jp.sf.pal.timecard.db.cbean.GroupMappingCB; import jp.sf.pal.timecard.db.cbean.cq.GroupInfoCQ; import jp.sf.pal.timecard.db.cbean.cq.GroupMappingCQ; import jp.sf.pal.timecard.db.cbean.cq.UserInfoCQ; @@ -15,7 +16,6 @@ * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public class BsGroupMappingCQ extends AbstractBsGroupMappingCQ { //========================================================================== @@ -61,7 +61,7 @@ public GroupMappingCIQ on() { if (isBaseQuery(this)) { throw new UnsupportedOperationException( - "Unsupported onClause of Base Table!"); + "Unsupported on-clause for local table!"); } GroupMappingCIQ inlineQuery = inline(); inlineQuery.xsetOnClauseInline(true); @@ -210,7 +210,6 @@ // ========= // Foreign Query // ============= - public GroupInfoCQ queryGroupInfo() { return getConditionQueryGroupInfo(); } @@ -219,20 +218,13 @@ public GroupInfoCQ getConditionQueryGroupInfo() { if (_conditionQueryGroupInfo == null) { - _conditionQueryGroupInfo = createQueryGroupInfo(); - setupOuterJoin_GroupInfo(); + _conditionQueryGroupInfo = xcreateQueryGroupInfo(); + xsetupOuterJoinGroupInfo(); } return _conditionQueryGroupInfo; } - protected void setupOuterJoin_GroupInfo() { - Map joinOnMap = newLinkedHashMap(); - joinOnMap.put(getRealColumnName("GROUP_ID"), - getConditionQueryGroupInfo().getRealColumnName("GROUP_ID")); - registerOuterJoin(getConditionQueryGroupInfo(), joinOnMap); - } - - protected GroupInfoCQ createQueryGroupInfo() { + protected GroupInfoCQ xcreateQueryGroupInfo() { String nrp = resolveNextRelationPath("GROUP_MAPPING", "groupInfo"); String jan = resolveJoinAliasName(nrp, getNextNestLevel()); GroupInfoCQ cq = new GroupInfoCQ(this, getSqlClause(), jan, @@ -242,6 +234,14 @@ return cq; } + protected void xsetupOuterJoinGroupInfo() { + GroupInfoCQ cq = getConditionQueryGroupInfo(); + Map joinOnMap = newLinkedHashMap(); + joinOnMap.put(getRealColumnName("GROUP_ID"), cq + .getRealColumnName("GROUP_ID")); + registerOuterJoin(cq, joinOnMap); + } + public boolean hasConditionQueryGroupInfo() { return _conditionQueryGroupInfo != null; } @@ -254,20 +254,13 @@ public UserInfoCQ getConditionQueryUserInfo() { if (_conditionQueryUserInfo == null) { - _conditionQueryUserInfo = createQueryUserInfo(); - setupOuterJoin_UserInfo(); + _conditionQueryUserInfo = xcreateQueryUserInfo(); + xsetupOuterJoinUserInfo(); } return _conditionQueryUserInfo; } - protected void setupOuterJoin_UserInfo() { - Map joinOnMap = newLinkedHashMap(); - joinOnMap.put(getRealColumnName("USER_ID"), getConditionQueryUserInfo() - .getRealColumnName("USER_ID")); - registerOuterJoin(getConditionQueryUserInfo(), joinOnMap); - } - - protected UserInfoCQ createQueryUserInfo() { + protected UserInfoCQ xcreateQueryUserInfo() { String nrp = resolveNextRelationPath("GROUP_MAPPING", "userInfo"); String jan = resolveJoinAliasName(nrp, getNextNestLevel()); UserInfoCQ cq = new UserInfoCQ(this, getSqlClause(), jan, @@ -277,10 +270,42 @@ return cq; } + protected void xsetupOuterJoinUserInfo() { + UserInfoCQ cq = getConditionQueryUserInfo(); + Map joinOnMap = newLinkedHashMap(); + joinOnMap.put(getRealColumnName("USER_ID"), cq + .getRealColumnName("USER_ID")); + registerOuterJoin(cq, joinOnMap); + } + public boolean hasConditionQueryUserInfo() { return _conditionQueryUserInfo != null; } + //========================================================================== + // ========= + // Derived Query + // ============= + protected Map _scalarSubQueryMap; + + public Map getScalarSubQuery() { + return _scalarSubQueryMap; + } + + public String keepScalarSubQuery(GroupMappingCQ subQuery) { + if (_scalarSubQueryMap == null) { + _scalarSubQueryMap = newLinkedHashMap(); + } + String key = "subQueryMapKey" + (_scalarSubQueryMap.size() + 1); + _scalarSubQueryMap.put(key, subQuery); + return "scalarSubQuery." + key; + } + + // Very Internal (for Suppressing Warn about 'Not Use Import') + protected String getConditionBeanClassNameInternally() { + return GroupMappingCB.class.getName(); + } + protected String getConditionQueryClassNameInternally() { return GroupMappingCQ.class.getName(); } Modified: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/cbean/cq/bs/BsMonthlyReportCQ.java =================================================================== --- timecard/trunk/src/main/java/jp/sf/pal/timecard/db/cbean/cq/bs/BsMonthlyReportCQ.java 2008-12-27 22:18:30 UTC (rev 1630) +++ timecard/trunk/src/main/java/jp/sf/pal/timecard/db/cbean/cq/bs/BsMonthlyReportCQ.java 2008-12-27 22:20:25 UTC (rev 1631) @@ -5,6 +5,7 @@ import jp.sf.pal.timecard.db.allcommon.cbean.ConditionQuery; import jp.sf.pal.timecard.db.allcommon.cbean.cvalue.ConditionValue; import jp.sf.pal.timecard.db.allcommon.cbean.sqlclause.SqlClause; +import jp.sf.pal.timecard.db.cbean.MonthlyReportCB; import jp.sf.pal.timecard.db.cbean.cq.DailyReportCQ; import jp.sf.pal.timecard.db.cbean.cq.EmployeeCQ; import jp.sf.pal.timecard.db.cbean.cq.MonthlyReportCQ; @@ -16,7 +17,6 @@ * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public class BsMonthlyReportCQ extends AbstractBsMonthlyReportCQ { //========================================================================== @@ -62,7 +62,7 @@ public MonthlyReportCIQ on() { if (isBaseQuery(this)) { throw new UnsupportedOperationException( - "Unsupported onClause of Base Table!"); + "Unsupported on-clause for local table!"); } MonthlyReportCIQ inlineQuery = inline(); inlineQuery.xsetOnClauseInline(true); @@ -221,37 +221,37 @@ return "id_NotExistsSubQuery_MonthlyWorkingReportList." + key; } - protected Map _id_DeriveSubQuery_DailyReportListMap; + protected Map _id_DerivedReferrer_DailyReportListMap; - public Map getId_DeriveSubQuery_DailyReportList() { - return _id_DeriveSubQuery_DailyReportListMap; + public Map getId_DerivedReferrer_DailyReportList() { + return _id_DerivedReferrer_DailyReportListMap; } - public String keepId_DeriveSubQuery_DailyReportList(DailyReportCQ subQuery) { - if (_id_DeriveSubQuery_DailyReportListMap == null) { - _id_DeriveSubQuery_DailyReportListMap = newLinkedHashMap(); + public String keepId_DerivedReferrer_DailyReportList(DailyReportCQ subQuery) { + if (_id_DerivedReferrer_DailyReportListMap == null) { + _id_DerivedReferrer_DailyReportListMap = newLinkedHashMap(); } String key = "subQueryMapKey" - + (_id_DeriveSubQuery_DailyReportListMap.size() + 1); - _id_DeriveSubQuery_DailyReportListMap.put(key, subQuery); - return "id_DeriveSubQuery_DailyReportList." + key; + + (_id_DerivedReferrer_DailyReportListMap.size() + 1); + _id_DerivedReferrer_DailyReportListMap.put(key, subQuery); + return "id_DerivedReferrer_DailyReportList." + key; } - protected Map _id_DeriveSubQuery_MonthlyWorkingReportListMap; + protected Map _id_DerivedReferrer_MonthlyWorkingReportListMap; - public Map getId_DeriveSubQuery_MonthlyWorkingReportList() { - return _id_DeriveSubQuery_MonthlyWorkingReportListMap; + public Map getId_DerivedReferrer_MonthlyWorkingReportList() { + return _id_DerivedReferrer_MonthlyWorkingReportListMap; } - public String keepId_DeriveSubQuery_MonthlyWorkingReportList( + public String keepId_DerivedReferrer_MonthlyWorkingReportList( MonthlyWorkingReportCQ subQuery) { - if (_id_DeriveSubQuery_MonthlyWorkingReportListMap == null) { - _id_DeriveSubQuery_MonthlyWorkingReportListMap = newLinkedHashMap(); + if (_id_DerivedReferrer_MonthlyWorkingReportListMap == null) { + _id_DerivedReferrer_MonthlyWorkingReportListMap = newLinkedHashMap(); } String key = "subQueryMapKey" - + (_id_DeriveSubQuery_MonthlyWorkingReportListMap.size() + 1); - _id_DeriveSubQuery_MonthlyWorkingReportListMap.put(key, subQuery); - return "id_DeriveSubQuery_MonthlyWorkingReportList." + key; + + (_id_DerivedReferrer_MonthlyWorkingReportListMap.size() + 1); + _id_DerivedReferrer_MonthlyWorkingReportListMap.put(key, subQuery); + return "id_DerivedReferrer_MonthlyWorkingReportList." + key; } public BsMonthlyReportCQ addOrderBy_Id_Asc() { @@ -680,7 +680,6 @@ // ========= // Foreign Query // ============= - public EmployeeCQ queryEmployee() { return getConditionQueryEmployee(); } @@ -689,20 +688,13 @@ public EmployeeCQ getConditionQueryEmployee() { if (_conditionQueryEmployee == null) { - _conditionQueryEmployee = createQueryEmployee(); - setupOuterJoin_Employee(); + _conditionQueryEmployee = xcreateQueryEmployee(); + xsetupOuterJoinEmployee(); } return _conditionQueryEmployee; } - protected void setupOuterJoin_Employee() { - Map joinOnMap = newLinkedHashMap(); - joinOnMap.put(getRealColumnName("EMPLOYEE_ID"), - getConditionQueryEmployee().getRealColumnName("ID")); - registerOuterJoin(getConditionQueryEmployee(), joinOnMap); - } - - protected EmployeeCQ createQueryEmployee() { + protected EmployeeCQ xcreateQueryEmployee() { String nrp = resolveNextRelationPath("MONTHLY_REPORT", "employee"); String jan = resolveJoinAliasName(nrp, getNextNestLevel()); EmployeeCQ cq = new EmployeeCQ(this, getSqlClause(), jan, @@ -712,10 +704,42 @@ return cq; } + protected void xsetupOuterJoinEmployee() { + EmployeeCQ cq = getConditionQueryEmployee(); + Map joinOnMap = newLinkedHashMap(); + joinOnMap.put(getRealColumnName("EMPLOYEE_ID"), cq + .getRealColumnName("ID")); + registerOuterJoin(cq, joinOnMap); + } + public boolean hasConditionQueryEmployee() { return _conditionQueryEmployee != null; } + //========================================================================== + // ========= + // Derived Query + // ============= + protected Map _scalarSubQueryMap; + + public Map getScalarSubQuery() { + return _scalarSubQueryMap; + } + + public String keepScalarSubQuery(MonthlyReportCQ subQuery) { + if (_scalarSubQueryMap == null) { + _scalarSubQueryMap = newLinkedHashMap(); + } + String key = "subQueryMapKey" + (_scalarSubQueryMap.size() + 1); + _scalarSubQueryMap.put(key, subQuery); + return "scalarSubQuery." + key; + } + + // Very Internal (for Suppressing Warn about 'Not Use Import') + protected String getConditionBeanClassNameInternally() { + return MonthlyReportCB.class.getName(); + } + protected String getConditionQueryClassNameInternally() { return MonthlyReportCQ.class.getName(); } Modified: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/cbean/cq/bs/BsMonthlyWorkingReportCQ.java =================================================================== --- timecard/trunk/src/main/java/jp/sf/pal/timecard/db/cbean/cq/bs/BsMonthlyWorkingReportCQ.java 2008-12-27 22:18:30 UTC (rev 1630) +++ timecard/trunk/src/main/java/jp/sf/pal/timecard/db/cbean/cq/bs/BsMonthlyWorkingReportCQ.java 2008-12-27 22:20:25 UTC (rev 1631) @@ -5,6 +5,7 @@ import jp.sf.pal.timecard.db.allcommon.cbean.ConditionQuery; import jp.sf.pal.timecard.db.allcommon.cbean.cvalue.ConditionValue; import jp.sf.pal.timecard.db.allcommon.cbean.sqlclause.SqlClause; +import jp.sf.pal.timecard.db.cbean.MonthlyWorkingReportCB; import jp.sf.pal.timecard.db.cbean.cq.MonthlyReportCQ; import jp.sf.pal.timecard.db.cbean.cq.MonthlyWorkingReportCQ; import jp.sf.pal.timecard.db.cbean.cq.WorkingTypeCQ; @@ -15,7 +16,6 @@ * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public class BsMonthlyWorkingReportCQ extends AbstractBsMonthlyWorkingReportCQ { //========================================================================== @@ -61,7 +61,7 @@ public MonthlyWorkingReportCIQ on() { if (isBaseQuery(this)) { throw new UnsupportedOperationException( - "Unsupported onClause of Base Table!"); + "Unsupported on-clause for local table!"); } MonthlyWorkingReportCIQ inlineQuery = inline(); inlineQuery.xsetOnClauseInline(true); @@ -239,7 +239,6 @@ // ========= // Foreign Query // ============= - public MonthlyReportCQ queryMonthlyReport() { return getConditionQueryMonthlyReport(); } @@ -248,20 +247,13 @@ public MonthlyReportCQ getConditionQueryMonthlyReport() { if (_conditionQueryMonthlyReport == null) { - _conditionQueryMonthlyReport = createQueryMonthlyReport(); - setupOuterJoin_MonthlyReport(); + _conditionQueryMonthlyReport = xcreateQueryMonthlyReport(); + xsetupOuterJoinMonthlyReport(); } return _conditionQueryMonthlyReport; } - protected void setupOuterJoin_MonthlyReport() { - Map joinOnMap = newLinkedHashMap(); - joinOnMap.put(getRealColumnName("MONTHLY_REPORT_ID"), - getConditionQueryMonthlyReport().getRealColumnName("ID")); - registerOuterJoin(getConditionQueryMonthlyReport(), joinOnMap); - } - - protected MonthlyReportCQ createQueryMonthlyReport() { + protected MonthlyReportCQ xcreateQueryMonthlyReport() { String nrp = resolveNextRelationPath("MONTHLY_WORKING_REPORT", "monthlyReport"); String jan = resolveJoinAliasName(nrp, getNextNestLevel()); @@ -272,6 +264,14 @@ return cq; } + protected void xsetupOuterJoinMonthlyReport() { + MonthlyReportCQ cq = getConditionQueryMonthlyReport(); + Map joinOnMap = newLinkedHashMap(); + joinOnMap.put(getRealColumnName("MONTHLY_REPORT_ID"), cq + .getRealColumnName("ID")); + registerOuterJoin(cq, joinOnMap); + } + public boolean hasConditionQueryMonthlyReport() { return _conditionQueryMonthlyReport != null; } @@ -284,20 +284,13 @@ public WorkingTypeCQ getConditionQueryWorkingType() { if (_conditionQueryWorkingType == null) { - _conditionQueryWorkingType = createQueryWorkingType(); - setupOuterJoin_WorkingType(); + _conditionQueryWorkingType = xcreateQueryWorkingType(); + xsetupOuterJoinWorkingType(); } return _conditionQueryWorkingType; } - protected void setupOuterJoin_WorkingType() { - Map joinOnMap = newLinkedHashMap(); - joinOnMap.put(getRealColumnName("WORKING_TYPE_ID"), - getConditionQueryWorkingType().getRealColumnName("ID")); - registerOuterJoin(getConditionQueryWorkingType(), joinOnMap); - } - - protected WorkingTypeCQ createQueryWorkingType() { + protected WorkingTypeCQ xcreateQueryWorkingType() { String nrp = resolveNextRelationPath("MONTHLY_WORKING_REPORT", "workingType"); String jan = resolveJoinAliasName(nrp, getNextNestLevel()); @@ -308,10 +301,42 @@ return cq; } + protected void xsetupOuterJoinWorkingType() { + WorkingTypeCQ cq = getConditionQueryWorkingType(); + Map joinOnMap = newLinkedHashMap(); + joinOnMap.put(getRealColumnName("WORKING_TYPE_ID"), cq + .getRealColumnName("ID")); + registerOuterJoin(cq, joinOnMap); + } + public boolean hasConditionQueryWorkingType() { return _conditionQueryWorkingType != null; } + //========================================================================== + // ========= + // Derived Query + // ============= + protected Map _scalarSubQueryMap; + + public Map getScalarSubQuery() { + return _scalarSubQueryMap; + } + + public String keepScalarSubQuery(MonthlyWorkingReportCQ subQuery) { + if (_scalarSubQueryMap == null) { + _scalarSubQueryMap = newLinkedHashMap(); + } + String key = "subQueryMapKey" + (_scalarSubQueryMap.size() + 1); + _scalarSubQueryMap.put(key, subQuery); + return "scalarSubQuery." + key; + } + + // Very Internal (for Suppressing Warn about 'Not Use Import') + protected String getConditionBeanClassNameInternally() { + return MonthlyWorkingReportCB.class.getName(); + } + protected String getConditionQueryClassNameInternally() { return MonthlyWorkingReportCQ.class.getName(); } Modified: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/cbean/cq/bs/BsRoleInfoCQ.java =================================================================== --- timecard/trunk/src/main/java/jp/sf/pal/timecard/db/cbean/cq/bs/BsRoleInfoCQ.java 2008-12-27 22:18:30 UTC (rev 1630) +++ timecard/trunk/src/main/java/jp/sf/pal/timecard/db/cbean/cq/bs/BsRoleInfoCQ.java 2008-12-27 22:20:25 UTC (rev 1631) @@ -5,6 +5,7 @@ import jp.sf.pal.timecard.db.allcommon.cbean.ConditionQuery; import jp.sf.pal.timecard.db.allcommon.cbean.cvalue.ConditionValue; import jp.sf.pal.timecard.db.allcommon.cbean.sqlclause.SqlClause; +import jp.sf.pal.timecard.db.cbean.RoleInfoCB; import jp.sf.pal.timecard.db.cbean.cq.RoleInfoCQ; import jp.sf.pal.timecard.db.cbean.cq.RoleMappingCQ; import jp.sf.pal.timecard.db.cbean.cq.UserInfoCQ; @@ -15,7 +16,6 @@ * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public class BsRoleInfoCQ extends AbstractBsRoleInfoCQ { //========================================================================== @@ -61,7 +61,7 @@ public RoleInfoCIQ on() { if (isBaseQuery(this)) { throw new UnsupportedOperationException( - "Unsupported onClause of Base Table!"); + "Unsupported on-clause for local table!"); } RoleInfoCIQ inlineQuery = inline(); inlineQuery.xsetOnClauseInline(true); @@ -218,37 +218,37 @@ return "roleId_NotExistsSubQuery_UserInfoList." + key; } - protected Map _roleId_DeriveSubQuery_RoleMappingListMap; + protected Map _roleId_DerivedReferrer_RoleMappingListMap; - public Map getRoleId_DeriveSubQuery_RoleMappingList() { - return _roleId_DeriveSubQuery_RoleMappingListMap; + public Map getRoleId_DerivedReferrer_RoleMappingList() { + return _roleId_DerivedReferrer_RoleMappingListMap; } - public String keepRoleId_DeriveSubQuery_RoleMappingList( + public String keepRoleId_DerivedReferrer_RoleMappingList( RoleMappingCQ subQuery) { - if (_roleId_DeriveSubQuery_RoleMappingListMap == null) { - _roleId_DeriveSubQuery_RoleMappingListMap = newLinkedHashMap(); + if (_roleId_DerivedReferrer_RoleMappingListMap == null) { + _roleId_DerivedReferrer_RoleMappingListMap = newLinkedHashMap(); } String key = "subQueryMapKey" - + (_roleId_DeriveSubQuery_RoleMappingListMap.size() + 1); - _roleId_DeriveSubQuery_RoleMappingListMap.put(key, subQuery); - return "roleId_DeriveSubQuery_RoleMappingList." + key; + + (_roleId_DerivedReferrer_RoleMappingListMap.size() + 1); + _roleId_DerivedReferrer_RoleMappingListMap.put(key, subQuery); + return "roleId_DerivedReferrer_RoleMappingList." + key; } - protected Map _roleId_DeriveSubQuery_UserInfoListMap; + protected Map _roleId_DerivedReferrer_UserInfoListMap; - public Map getRoleId_DeriveSubQuery_UserInfoList() { - return _roleId_DeriveSubQuery_UserInfoListMap; + public Map getRoleId_DerivedReferrer_UserInfoList() { + return _roleId_DerivedReferrer_UserInfoListMap; } - public String keepRoleId_DeriveSubQuery_UserInfoList(UserInfoCQ subQuery) { - if (_roleId_DeriveSubQuery_UserInfoListMap == null) { - _roleId_DeriveSubQuery_UserInfoListMap = newLinkedHashMap(); + public String keepRoleId_DerivedReferrer_UserInfoList(UserInfoCQ subQuery) { + if (_roleId_DerivedReferrer_UserInfoListMap == null) { + _roleId_DerivedReferrer_UserInfoListMap = newLinkedHashMap(); } String key = "subQueryMapKey" - + (_roleId_DeriveSubQuery_UserInfoListMap.size() + 1); - _roleId_DeriveSubQuery_UserInfoListMap.put(key, subQuery); - return "roleId_DeriveSubQuery_UserInfoList." + key; + + (_roleId_DerivedReferrer_UserInfoListMap.size() + 1); + _roleId_DerivedReferrer_UserInfoListMap.put(key, subQuery); + return "roleId_DerivedReferrer_UserInfoList." + key; } public BsRoleInfoCQ addOrderBy_RoleId_Asc() { @@ -563,7 +563,30 @@ // ========= // Foreign Query // ============= + //========================================================================== + // ========= + // Derived Query + // ============= + protected Map _scalarSubQueryMap; + public Map getScalarSubQuery() { + return _scalarSubQueryMap; + } + + public String keepScalarSubQuery(RoleInfoCQ subQuery) { + if (_scalarSubQueryMap == null) { + _scalarSubQueryMap = newLinkedHashMap(); + } + String key = "subQueryMapKey" + (_scalarSubQueryMap.size() + 1); + _scalarSubQueryMap.put(key, subQuery); + return "scalarSubQuery." + key; + } + + // Very Internal (for Suppressing Warn about 'Not Use Import') + protected String getConditionBeanClassNameInternally() { + return RoleInfoCB.class.getName(); + } + protected String getConditionQueryClassNameInternally() { return RoleInfoCQ.class.getName(); } Modified: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/cbean/cq/bs/BsRoleMappingCQ.java =================================================================== --- timecard/trunk/src/main/java/jp/sf/pal/timecard/db/cbean/cq/bs/BsRoleMappingCQ.java 2008-12-27 22:18:30 UTC (rev 1630) +++ timecard/trunk/src/main/java/jp/sf/pal/timecard/db/cbean/cq/bs/BsRoleMappingCQ.java 2008-12-27 22:20:25 UTC (rev 1631) @@ -5,6 +5,7 @@ import jp.sf.pal.timecard.db.allcommon.cbean.ConditionQuery; import jp.sf.pal.timecard.db.allcommon.cbean.cvalue.ConditionValue; import jp.sf.pal.timecard.db.allcommon.cbean.sqlclause.SqlClause; +import jp.sf.pal.timecard.db.cbean.RoleMappingCB; import jp.sf.pal.timecard.db.cbean.cq.RoleInfoCQ; import jp.sf.pal.timecard.db.cbean.cq.RoleMappingCQ; import jp.sf.pal.timecard.db.cbean.cq.UserInfoCQ; @@ -15,7 +16,6 @@ * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public class BsRoleMappingCQ extends AbstractBsRoleMappingCQ { //========================================================================== @@ -61,7 +61,7 @@ public RoleMappingCIQ on() { if (isBaseQuery(this)) { throw new UnsupportedOperationException( - "Unsupported onClause of Base Table!"); + "Unsupported on-clause for local table!"); } RoleMappingCIQ inlineQuery = inline(); inlineQuery.xsetOnClauseInline(true); @@ -210,7 +210,6 @@ // ========= // Foreign Query // ============= - public RoleInfoCQ queryRoleInfo() { return getConditionQueryRoleInfo(); } @@ -219,20 +218,13 @@ public RoleInfoCQ getConditionQueryRoleInfo() { if (_conditionQueryRoleInfo == null) { - _conditionQueryRoleInfo = createQueryRoleInfo(); - setupOuterJoin_RoleInfo(); + _conditionQueryRoleInfo = xcreateQueryRoleInfo(); + xsetupOuterJoinRoleInfo(); } return _conditionQueryRoleInfo; } - protected void setupOuterJoin_RoleInfo() { - Map joinOnMap = newLinkedHashMap(); - joinOnMap.put(getRealColumnName("ROLE_ID"), getConditionQueryRoleInfo() - .getRealColumnName("ROLE_ID")); - registerOuterJoin(getConditionQueryRoleInfo(), joinOnMap); - } - - protected RoleInfoCQ createQueryRoleInfo() { + protected RoleInfoCQ xcreateQueryRoleInfo() { String nrp = resolveNextRelationPath("ROLE_MAPPING", "roleInfo"); String jan = resolveJoinAliasName(nrp, getNextNestLevel()); RoleInfoCQ cq = new RoleInfoCQ(this, getSqlClause(), jan, @@ -242,6 +234,14 @@ return cq; } + protected void xsetupOuterJoinRoleInfo() { + RoleInfoCQ cq = getConditionQueryRoleInfo(); + Map joinOnMap = newLinkedHashMap(); + joinOnMap.put(getRealColumnName("ROLE_ID"), cq + .getRealColumnName("ROLE_ID")); + registerOuterJoin(cq, joinOnMap); + } + public boolean hasConditionQueryRoleInfo() { return _conditionQueryRoleInfo != null; } @@ -254,20 +254,13 @@ public UserInfoCQ getConditionQueryUserInfo() { if (_conditionQueryUserInfo == null) { - _conditionQueryUserInfo = createQueryUserInfo(); - setupOuterJoin_UserInfo(); + _conditionQueryUserInfo = xcreateQueryUserInfo(); + xsetupOuterJoinUserInfo(); } return _conditionQueryUserInfo; } - protected void setupOuterJoin_UserInfo() { - Map joinOnMap = newLinkedHashMap(); - joinOnMap.put(getRealColumnName("USER_ID"), getConditionQueryUserInfo() - .getRealColumnName("USER_ID")); - registerOuterJoin(getConditionQueryUserInfo(), joinOnMap); - } - - protected UserInfoCQ createQueryUserInfo() { + protected UserInfoCQ xcreateQueryUserInfo() { String nrp = resolveNextRelationPath("ROLE_MAPPING", "userInfo"); String jan = resolveJoinAliasName(nrp, getNextNestLevel()); UserInfoCQ cq = new UserInfoCQ(this, getSqlClause(), jan, @@ -277,10 +270,42 @@ return cq; } + protected void xsetupOuterJoinUserInfo() { + UserInfoCQ cq = getConditionQueryUserInfo(); + Map joinOnMap = newLinkedHashMap(); + joinOnMap.put(getRealColumnName("USER_ID"), cq + .getRealColumnName("USER_ID")); + registerOuterJoin(cq, joinOnMap); + } + public boolean hasConditionQueryUserInfo() { return _conditionQueryUserInfo != null; } + //========================================================================== + // ========= + // Derived Query + // ============= + protected Map _scalarSubQueryMap; + + public Map getScalarSubQuery() { + return _scalarSubQueryMap; + } + + public String keepScalarSubQuery(RoleMappingCQ subQuery) { + if (_scalarSubQueryMap == null) { + _scalarSubQueryMap = newLinkedHashMap(); + } + String key = "subQueryMapKey" + (_scalarSubQueryMap.size() + 1); + _scalarSubQueryMap.put(key, subQuery); + return "scalarSubQuery." + key; + } + + // Very Internal (for Suppressing Warn about 'Not Use Import') + protected String getConditionBeanClassNameInternally() { + return RoleMappingCB.class.getName(); + } + protected String getConditionQueryClassNameInternally() { return RoleMappingCQ.class.getName(); } Modified: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/cbean/cq/bs/BsUserInfoCQ.java =================================================================== --- timecard/trunk/src/main/java/jp/sf/pal/timecard/db/cbean/cq/bs/BsUserInfoCQ.java 2008-12-27 22:18:30 UTC (rev 1630) +++ timecard/trunk/src/main/java/jp/sf/pal/timecard/db/cbean/cq/bs/BsUserInfoCQ.java 2008-12-27 22:20:25 UTC (rev 1631) @@ -5,6 +5,7 @@ import jp.sf.pal.timecard.db.allcommon.cbean.ConditionQuery; import jp.sf.pal.timecard.db.allcommon.cbean.cvalue.ConditionValue; import jp.sf.pal.timecard.db.allcommon.cbean.sqlclause.SqlClause; +import jp.sf.pal.timecard.db.cbean.UserInfoCB; import jp.sf.pal.timecard.db.cbean.cq.EmployeeCQ; import jp.sf.pal.timecard.db.cbean.cq.GroupInfoCQ; import jp.sf.pal.timecard.db.cbean.cq.GroupMappingCQ; @@ -18,7 +19,6 @@ * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public class BsUserInfoCQ extends AbstractBsUserInfoCQ { //========================================================================== @@ -64,7 +64,7 @@ public UserInfoCIQ on() { if (isBaseQuery(this)) { throw new UnsupportedOperationException( - "Unsupported onClause of Base Table!"); + "Unsupported on-clause for local table!"); } UserInfoCIQ inlineQuery = inline(); inlineQuery.xsetOnClauseInline(true); @@ -361,72 +361,72 @@ return "userId_NotExistsSubQuery_RoleMappingList." + key; } - protected Map _userId_DeriveSubQuery_EmployeeByUsernameListMap; + protected Map _userId_DerivedReferrer_EmployeeByUsernameListMap; - public Map getUserId_DeriveSubQuery_EmployeeByUsernameList() { - return _userId_DeriveSubQuery_EmployeeByUsernameListMap; + public Map getUserId_DerivedReferrer_EmployeeByUsernameList() { + return _userId_DerivedReferrer_EmployeeByUsernameListMap; } - public String keepUserId_DeriveSubQuery_EmployeeByUsernameList( + public String keepUserId_DerivedReferrer_EmployeeByUsernameList( EmployeeCQ subQuery) { - if (_userId_DeriveSubQuery_EmployeeByUsernameListMap == null) { - _userId_DeriveSubQuery_EmployeeByUsernameListMap = newLinkedHashMap(); + if (_userId_DerivedReferrer_EmployeeByUsernameListMap == null) { + _userId_DerivedReferrer_EmployeeByUsernameListMap = newLinkedHashMap(); } String key = "subQueryMapKey" - + (_userId_DeriveSubQuery_EmployeeByUsernameListMap.size() + 1); - _userId_DeriveSubQuery_EmployeeByUsernameListMap.put(key, subQuery); - return "userId_DeriveSubQuery_EmployeeByUsernameList." + key; + + (_userId_DerivedReferrer_EmployeeByUsernameListMap.size() + 1); + _userId_DerivedReferrer_EmployeeByUsernameListMap.put(key, subQuery); + return "userId_DerivedReferrer_EmployeeByUsernameList." + key; } - protected Map _userId_DeriveSubQuery_EmployeeByManagerListMap; + protected Map _userId_DerivedReferrer_EmployeeByManagerListMap; - public Map getUserId_DeriveSubQuery_EmployeeByManagerList() { - return _userId_DeriveSubQuery_EmployeeByManagerListMap; + public Map getUserId_DerivedReferrer_EmployeeByManagerList() { + return _userId_DerivedReferrer_EmployeeByManagerListMap; } - public String keepUserId_DeriveSubQuery_EmployeeByManagerList( + public String keepUserId_DerivedReferrer_EmployeeByManagerList( EmployeeCQ subQuery) { - if (_userId_DeriveSubQuery_EmployeeByManagerListMap == null) { - _userId_DeriveSubQuery_EmployeeByManagerListMap = newLinkedHashMap(); + if (_userId_DerivedReferrer_EmployeeByManagerListMap == null) { + _userId_DerivedReferrer_EmployeeByManagerListMap = newLinkedHashMap(); } String key = "subQueryMapKey" - + (_userId_DeriveSubQuery_EmployeeByManagerListMap.size() + 1); - _userId_DeriveSubQuery_EmployeeByManagerListMap.put(key, subQuery); - return "userId_DeriveSubQuery_EmployeeByManagerList." + key; + + (_userId_DerivedReferrer_EmployeeByManagerListMap.size() + 1); + _userId_DerivedReferrer_EmployeeByManagerListMap.put(key, subQuery); + return "userId_DerivedReferrer_EmployeeByManagerList." + key; } - protected Map _userId_DeriveSubQuery_GroupMappingListMap; + protected Map _userId_DerivedReferrer_GroupMappingListMap; - public Map getUserId_DeriveSubQuery_GroupMappingList() { - return _userId_DeriveSubQuery_GroupMappingListMap; + public Map getUserId_DerivedReferrer_GroupMappingList() { + return _userId_DerivedReferrer_GroupMappingListMap; } - public String keepUserId_DeriveSubQuery_GroupMappingList( + public String keepUserId_DerivedReferrer_GroupMappingList( GroupMappingCQ subQuery) { - if (_userId_DeriveSubQuery_GroupMappingListMap == null) { - _userId_DeriveSubQuery_GroupMappingListMap = newLinkedHashMap(); + if (_userId_DerivedReferrer_GroupMappingListMap == null) { + _userId_DerivedReferrer_GroupMappingListMap = newLinkedHashMap(); } String key = "subQueryMapKey" - + (_userId_DeriveSubQuery_GroupMappingListMap.size() + 1); - _userId_DeriveSubQuery_GroupMappingListMap.put(key, subQuery); - return "userId_DeriveSubQuery_GroupMappingList." + key; + + (_userId_DerivedReferrer_GroupMappingListMap.size() + 1); + _userId_DerivedReferrer_GroupMappingListMap.put(key, subQuery); + return "userId_DerivedReferrer_GroupMappingList." + key; } - protected Map _userId_DeriveSubQuery_RoleMappingListMap; + protected Map _userId_DerivedReferrer_RoleMappingListMap; - public Map getUserId_DeriveSubQuery_RoleMappingList() { - return _userId_DeriveSubQuery_RoleMappingListMap; + public Map getUserId_DerivedReferrer_RoleMappingList() { + return _userId_DerivedReferrer_RoleMappingListMap; } - public String keepUserId_DeriveSubQuery_RoleMappingList( + public String keepUserId_DerivedReferrer_RoleMappingList( RoleMappingCQ subQuery) { - if (_userId_DeriveSubQuery_RoleMappingListMap == null) { - _userId_DeriveSubQuery_RoleMappingListMap = newLinkedHashMap(); + if (_userId_DerivedReferrer_RoleMappingListMap == null) { + _userId_DerivedReferrer_RoleMappingListMap = newLinkedHashMap(); } String key = "subQueryMapKey" - + (_userId_DeriveSubQuery_RoleMappingListMap.size() + 1); - _userId_DeriveSubQuery_RoleMappingListMap.put(key, subQuery); - return "userId_DeriveSubQuery_RoleMappingList." + key; + + (_userId_DerivedReferrer_RoleMappingListMap.size() + 1); + _userId_DerivedReferrer_RoleMappingListMap.put(key, subQuery); + return "userId_DerivedReferrer_RoleMappingList." + key; } public BsUserInfoCQ addOrderBy_UserId_Asc() { @@ -793,6 +793,29 @@ return this; } + protected ConditionValue _status; + + public ConditionValue getStatus() { + if (_status == null) { + _status = new ConditionValue(); + } + return _status; + } + + protected ConditionValue getCValueStatus() { + return getStatus(); + } + + public BsUserInfoCQ addOrderBy_Status_Asc() { + regOBA("STATUS"); + return this; + } + + public BsUserInfoCQ addOrderBy_Status_Desc() { + regOBD("STATUS"); + return this; + } + protected ConditionValue _createdTime; public ConditionValue getCreatedTime() { @@ -990,7 +1013,6 @@ // ========= // Foreign Query // ============= - public GroupInfoCQ queryGroupInfo() { return getConditionQueryGroupInfo(); } @@ -999,20 +1021,13 @@ public GroupInfoCQ getConditionQueryGroupInfo() { if (_conditionQueryGroupInfo == null) { - _conditionQueryGroupInfo = createQueryGroupInfo(); - setupOuterJoin_GroupInfo(); + _conditionQueryGroupInfo = xcreateQueryGroupInfo(); + xsetupOuterJoinGroupInfo(); } return _conditionQueryGroupInfo; } - protected void setupOuterJoin_GroupInfo() { - Map joinOnMap = newLinkedHashMap(); - joinOnMap.put(getRealColumnName("GROUP_ID"), - getConditionQueryGroupInfo().getRealColumnName("GROUP_ID")); - registerOuterJoin(getConditionQueryGroupInfo(), joinOnMap); - } - - protected GroupInfoCQ createQueryGroupInfo() { + protected GroupInfoCQ xcreateQueryGroupInfo() { String nrp = resolveNextRelationPath("USER_INFO", "groupInfo"); String jan = resolveJoinAliasName(nrp, getNextNestLevel()); GroupInfoCQ cq = new GroupInfoCQ(this, getSqlClause(), jan, @@ -1022,6 +1037,14 @@ return cq; } + protected void xsetupOuterJoinGroupInfo() { + GroupInfoCQ cq = getConditionQueryGroupInfo(); + Map joinOnMap = newLinkedHashMap(); + joinOnMap.put(getRealColumnName("GROUP_ID"), cq + .getRealColumnName("GROUP_ID")); + registerOuterJoin(cq, joinOnMap); + } + public boolean hasConditionQueryGroupInfo() { return _conditionQueryGroupInfo != null; } @@ -1034,20 +1057,13 @@ public RoleInfoCQ getConditionQueryRoleInfo() { if (_conditionQueryRoleInfo == null) { - _conditionQueryRoleInfo = createQueryRoleInfo(); - setupOuterJoin_RoleInfo(); + _conditionQueryRoleInfo = xcreateQueryRoleInfo(); + xsetupOuterJoinRoleInfo(); } return _conditionQueryRoleInfo; } - protected void setupOuterJoin_RoleInfo() { - Map joinOnMap = newLinkedHashMap(); - joinOnMap.put(getRealColumnName("ROLE_ID"), getConditionQueryRoleInfo() - .getRealColumnName("ROLE_ID")); - registerOuterJoin(getConditionQueryRoleInfo(), joinOnMap); - } - - protected RoleInfoCQ createQueryRoleInfo() { + protected RoleInfoCQ xcreateQueryRoleInfo() { String nrp = resolveNextRelationPath("USER_INFO", "roleInfo"); String jan = resolveJoinAliasName(nrp, getNextNestLevel()); RoleInfoCQ cq = new RoleInfoCQ(this, getSqlClause(), jan, @@ -1057,10 +1073,42 @@ return cq; } + protected void xsetupOuterJoinRoleInfo() { + RoleInfoCQ cq = getConditionQueryRoleInfo(); + Map joinOnMap = newLinkedHashMap(); + joinOnMap.put(getRealColumnName("ROLE_ID"), cq + .getRealColumnName("ROLE_ID")); + registerOuterJoin(cq, joinOnMap); + } + public boolean hasConditionQueryRoleInfo() { return _conditionQueryRoleInfo != null; } + //========================================================================== + // ========= + // Derived Query + // ============= + protected Map _scalarSubQueryMap; + + public Map getScalarSubQuery() { + return _scalarSubQueryMap; + } + + public String keepScalarSubQuery(UserInfoCQ subQuery) { + if (_scalarSubQueryMap == null) { + _scalarSubQueryMap = newLinkedHashMap(); + } + String key = "subQueryMapKey" + (_scalarSubQueryMap.size() + 1); + _scalarSubQueryMap.put(key, subQuery); + return "scalarSubQuery." + key; + } + + // Very Internal (for Suppressing Warn about 'Not Use Import') + protected String getConditionBeanClassNameInternally() { + return UserInfoCB.class.getName(); + } + protected String getConditionQueryClassNameInternally() { return UserInfoCQ.class.getName(); } Modified: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/cbean/cq/bs/BsWorkingTypeCQ.java =================================================================== --- timecard/trunk/src/main/java/jp/sf/pal/timecard/db/cbean/cq/bs/BsWorkingTypeCQ.java 2008-12-27 22:18:30 UTC (rev 1630) +++ timecard/trunk/src/main/java/jp/sf/pal/timecard/db/cbean/cq/bs/BsWorkingTypeCQ.java 2008-12-27 22:20:25 UTC (rev 1631) @@ -5,6 +5,7 @@ import jp.sf.pal.timecard.db.allcommon.cbean.ConditionQuery; import jp.sf.pal.timecard.db.allcommon.cbean.cvalue.ConditionValue; import jp.sf.pal.timecard.db.allcommon.cbean.sqlclause.SqlClause; +import jp.sf.pal.timecard.db.cbean.WorkingTypeCB; import jp.sf.pal.timecard.db.cbean.cq.MonthlyWorkingReportCQ; import jp.sf.pal.timecard.db.cbean.cq.WorkingTypeCQ; import jp.sf.pal.timecard.db.cbean.cq.ciq.WorkingTypeCIQ; @@ -14,7 +15,6 @@ * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public class BsWorkingTypeCQ extends AbstractBsWorkingTypeCQ { //========================================================================== @@ -60,7 +60,7 @@ public WorkingTypeCIQ on() { if (isBaseQuery(this)) { throw new UnsupportedOperationException( - "Unsupported onClause of Base Table!"); + "Unsupported on-clause for local table!"); } WorkingTypeCIQ inlineQuery = inline(); inlineQuery.xsetOnClauseInline(true); @@ -153,21 +153,21 @@ return "id_NotExistsSubQuery_MonthlyWorkingReportList." + key; } - protected Map _id_DeriveSubQuery_MonthlyWorkingReportListMap; + protected Map _id_DerivedReferrer_MonthlyWorkingReportListMap; - public Map getId_DeriveSubQuery_MonthlyWorkingReportList() { - return _id_DeriveSubQuery_MonthlyWorkingReportListMap; + public Map getId_DerivedReferrer_MonthlyWorkingReportList() { + return _id_DerivedReferrer_MonthlyWorkingReportListMap; } - public String keepId_DeriveSubQuery_MonthlyWorkingReportList( + public String keepId_DerivedReferrer_MonthlyWorkingReportList( MonthlyWorkingReportCQ subQuery) { - if (_id_DeriveSubQuery_MonthlyWorkingReportListMap == null) { - _id_DeriveSubQuery_MonthlyWorkingReportListMap = newLinkedHashMap(); + if (_id_DerivedReferrer_MonthlyWorkingReportListMap == null) { + _id_DerivedReferrer_MonthlyWorkingReportListMap = newLinkedHashMap(); } String key = "subQueryMapKey" - + (_id_DeriveSubQuery_MonthlyWorkingReportListMap.size() + 1); - _id_DeriveSubQuery_MonthlyWorkingReportListMap.put(key, subQuery); - return "id_DeriveSubQuery_MonthlyWorkingReportList." + key; + + (_id_DerivedReferrer_MonthlyWorkingReportListMap.size() + 1); + _id_DerivedReferrer_MonthlyWorkingReportListMap.put(key, subQuery); + return "id_DerivedReferrer_MonthlyWorkingReportList." + key; } public BsWorkingTypeCQ addOrderBy_Id_Asc() { @@ -459,7 +459,30 @@ // ========= // Foreign Query // ============= + //========================================================================== + // ========= + // Derived Query + // ============= + protected Map _scalarSubQueryMap; + public Map getScalarSubQuery() { + return _scalarSubQueryMap; + } + + public String keepScalarSubQuery(WorkingTypeCQ subQuery) { + if (_scalarSubQueryMap == null) { + _scalarSubQueryMap = newLinkedHashMap(); + } + String key = "subQueryMapKey" + (_scalarSubQueryMap.size() + 1); + _scalarSubQueryMap.put(key, subQuery); + return "scalarSubQuery." + key; + } + + // Very Internal (for Suppressing Warn about 'Not Use Import') + protected String getConditionBeanClassNameInternally() { + return WorkingTypeCB.class.getName(); + } + protected String getConditionQueryClassNameInternally() { return WorkingTypeCQ.class.getName(); } Modified: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/cbean/cq/ciq/DailyReportCIQ.java =================================================================== --- timecard/trunk/src/main/java/jp/sf/pal/timecard/db/cbean/cq/ciq/DailyReportCIQ.java 2008-12-27 22:18:30 UTC (rev 1630) +++ timecard/trunk/src/main/java/jp/sf/pal/timecard/db/cbean/cq/ciq/DailyReportCIQ.java 2008-12-27 22:20:25 UTC (rev 1631) @@ -5,6 +5,7 @@ import jp.sf.pal.timecard.db.allcommon.cbean.coption.ConditionOption; import jp.sf.pal.timecard.db.allcommon.cbean.cvalue.ConditionValue; import jp.sf.pal.timecard.db.allcommon.cbean.sqlclause.SqlClause; +import jp.sf.pal.timecard.db.cbean.DailyReportCB; import jp.sf.pal.timecard.db.cbean.cq.DailyReportCQ; import jp.sf.pal.timecard.db.cbean.cq.MonthlyReportCQ; import jp.sf.pal.timecard.db.cbean.cq.bs.AbstractBsDailyReportCQ; @@ -15,7 +16,6 @@ * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public class DailyReportCIQ extends AbstractBsDailyReportCQ { //========================================================================== @@ -169,6 +169,20 @@ return _myCQ.getVersionno(); } + //========================================================================== + // ========= + // Derived Query + // ============= + public String keepScalarSubQuery(DailyReportCQ subQuery) { + throw new UnsupportedOperationException( + "ScalarSubQuery at inline() is unsupported! Sorry!"); + } + + // Very Internal (for Suppressing Warn about 'Not Use Import') + protected String getConditionBeanClassNameInternally() { + return DailyReportCB.class.getName(); + } + protected String getConditionQueryClassNameInternally() { return DailyReportCQ.class.getName(); } Modified: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/cbean/cq/ciq/EmployeeCIQ.java =================================================================== --- timecard/trunk/src/main/java/jp/sf/pal/timecard/db/cbean/cq/ciq/EmployeeCIQ.java 2008-12-27 22:18:30 UTC (rev 1630) +++ timecard/trunk/src/main/java/jp/sf/pal/timecard/db/cbean/cq/ciq/EmployeeCIQ.java 2008-12-27 22:20:25 UTC (rev 1631) @@ -5,6 +5,7 @@ import jp.sf.pal.timecard.db.allcommon.cbean.coption.ConditionOption; import jp.sf.pal.timecard.db.allcommon.cbean.cvalue.ConditionValue; import jp.sf.pal.timecard.db.allcommon.cbean.sqlclause.SqlClause; +import jp.sf.pal.timecard.db.cbean.EmployeeCB; import jp.sf.pal.timecard.db.cbean.cq.EmployeeCQ; import jp.sf.pal.timecard.db.cbean.cq.MonthlyReportCQ; import jp.sf.pal.timecard.db.cbean.cq.UserInfoCQ; @@ -16,7 +17,6 @@ * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public class EmployeeCIQ extends AbstractBsEmployeeCQ { //========================================================================== @@ -118,10 +118,10 @@ "NotExistsSubQuery at inline() is unsupported! Sorry!"); } - public String keepId_DeriveSubQuery_MonthlyReportList( + public String keepId_DerivedReferrer_MonthlyReportList( MonthlyReportCQ subQuery) { throw new UnsupportedOperationException( - "DeriveSubQuery at inline() is unsupported! Sorry!"); + "DerivedReferrer at inline() is unsupported! Sorry!"); } protected ConditionValue getCValueUsername() { @@ -174,6 +174,20 @@ return _myCQ.getVersionno(); } + //========================================================================== + // ========= + // Derived Query + // ============= + public String keepScalarSubQuery(EmployeeCQ subQuery) { + throw new UnsupportedOperationException( + "ScalarSubQuery at inline() is unsupported! Sorry!"); + } + + // Very Internal (for Suppressing Warn about 'Not Use Import') + protected String getConditionBeanClassNameInternally() { + return EmployeeCB.class.getName(); + } + protected String getConditionQueryClassNameInternally() { return EmployeeCQ.class.getName(); } Modified: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/cbean/cq/ciq/GroupInfoCIQ.java =================================================================== --- timecard/trunk/src/main/java/jp/sf/pal/timecard/db/cbean/cq/ciq/GroupInfoCIQ.java 2008-12-27 22:18:30 UTC (rev 1630) +++ timecard/trunk/src/main/java/jp/sf/pal/timecard/db/cbean/cq/ciq/GroupInfoCIQ.java 2008-12-27 22:20:25 UTC (rev 1631) @@ -5,6 +5,7 @@ import jp.sf.pal.timecard.db.allcommon.cbean.coption.ConditionOption; import jp.sf.pal.timecard.db.allcommon.cbean.cvalue.ConditionValue; import jp.sf.pal.timecard.db.allcommon.cbean.sqlclause.SqlClause; +import jp.sf.pal.timecard.db.cbean.GroupInfoCB; import jp.sf.pal.timecard.db.cbean.cq.GroupInfoCQ; import jp.sf.pal.timecard.db.cbean.cq.GroupMappingCQ; import jp.sf.pal.timecard.db.cbean.cq.UserInfoCQ; @@ -16,7 +17,6 @@ * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public class GroupInfoCIQ extends AbstractBsGroupInfoCQ { //========================================================================== @@ -137,15 +137,15 @@ "NotExistsSubQuery at inline() is unsupported! Sorry!"); } - public String keepGroupId_DeriveSubQuery_GroupMappingList( + public String keepGroupId_DerivedReferrer_GroupMappingList( GroupMappingCQ subQuery) { throw new UnsupportedOperationException( - "DeriveSubQuery at inline() is unsupported! Sorry!"); + "DerivedReferrer at inline() is unsupported! Sorry!"); } - public String keepGroupId_DeriveSubQuery_UserInfoList(UserInfoCQ subQuery) { + public String keepGroupId_DerivedReferrer_UserInfoList(UserInfoCQ subQuery) { throw new UnsupportedOperationException( - "DeriveSubQuery at inline() is unsupported! Sorry!"); + "DerivedReferrer at inline() is unsupported! Sorry!"); } protected ConditionValue getCValueName() { @@ -196,6 +196,20 @@ return _myCQ.getVersionno(); } + //========================================================================== + // ========= + // Derived Query + // ============= + public String keepScalarSubQuery(GroupInfoCQ subQuery) { + throw new UnsupportedOperationException( + "ScalarSubQuery at inline() is unsupported! Sorry!"); + } + + // Very Internal (for Suppressing Warn about 'Not Use Import') + protected String getConditionBeanClassNameInternally() { + return GroupInfoCB.class.getName(); + } + protected String getConditionQueryClassNameInternally() { return GroupInfoCQ.class.getName(); } Modified: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/cbean/cq/ciq/GroupMappingCIQ.java =================================================================== --- timecard/trunk/src/main/java/jp/sf/pal/timecard/db/cbean/cq/ciq/GroupMappingCIQ.java 2008-12-27 22:18:30 UTC (rev 1630) +++ timecard/trunk/src/main/java/jp/sf/pal/timecard/db/cbean/cq/ciq/GroupMappingCIQ.java 2008-12-27 22:20:25 UTC (rev 1631) @@ -5,6 +5,7 @@ import jp.sf.pal.timecard.db.allcommon.cbean.coption.ConditionOption; import jp.sf.pal.timecard.db.allcommon.cbean.cvalue.ConditionValue; import jp.sf.pal.timecard.db.allcommon.cbean.sqlclause.SqlClause; +import jp.sf.pal.timecard.db.cbean.GroupMappingCB; import jp.sf.pal.timecard.db.cbean.cq.GroupInfoCQ; import jp.sf.pal.timecard.db.cbean.cq.GroupMappingCQ; import jp.sf.pal.timecard.db.cbean.cq.UserInfoCQ; @@ -16,7 +17,6 @@ * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public class GroupMappingCIQ extends AbstractBsGroupMappingCQ { //========================================================================== @@ -112,6 +112,20 @@ return _myCQ.keepGroupId_InScopeSubQuery_GroupInfo(subQuery); } + //========================================================================== + // ========= + // Derived Query + // ============= + public String keepScalarSubQuery(GroupMappingCQ subQuery) { + throw new UnsupportedOperationException( + "ScalarSubQuery at inline() is unsupported! Sorry!"); + } + + // Very Internal (for Suppressing Warn about 'Not Use Import') + protected String getConditionBeanClassNameInternally() { + return GroupMappingCB.class.getName(); + } + protected String getConditionQueryClassNameInternally() { return GroupMappingCQ.class.getName(); } Modified: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/cbean/cq/ciq/MonthlyReportCIQ.java =================================================================== --- timecard/trunk/src/main/java/jp/sf/pal/timecard/db/cbean/cq/ciq/MonthlyReportCIQ.java 2008-12-27 22:18:30 UTC (rev 1630) +++ timecard/trunk/src/main/java/jp/sf/pal/timecard/db/cbean/cq/ciq/MonthlyReportCIQ.java 2008-12-27 22:20:25 UTC (rev 1631) @@ -5,6 +5,7 @@ import jp.sf.pal.timecard.db.allcommon.cbean.coption.ConditionOption; import jp.sf.pal.timecard.db.allcommon.cbean.cvalue.ConditionValue; import jp.sf.pal.timecard.db.allcommon.cbean.sqlclause.SqlClause; +import jp.sf.pal.timecard.db.cbean.MonthlyReportCB; import jp.sf.pal.timecard.db.cbean.cq.DailyReportCQ; import jp.sf.pal.timecard.db.cbean.cq.EmployeeCQ; import jp.sf.pal.timecard.db.cbean.cq.MonthlyReportCQ; @@ -17,7 +18,6 @@ * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public class MonthlyReportCIQ extends AbstractBsMonthlyReportCQ { //========================================================================== @@ -140,15 +140,15 @@ "NotExistsSubQuery at inline() is unsupported! Sorry!"); } - public String keepId_DeriveSubQuery_DailyReportList(DailyReportCQ subQuery) { + public String keepId_DerivedReferrer_DailyReportList(DailyReportCQ subQuery) { throw new UnsupportedOperationException( - "DeriveSubQuery at inline() is unsupported! Sorry!"); + "DerivedReferrer at inline() is unsupported! Sorry!"); } - public String keepId_DeriveSubQuery_MonthlyWorkingReportList( + public String keepId_DerivedReferrer_MonthlyWorkingReportList( MonthlyWorkingReportCQ subQuery) { throw new UnsupportedOperationException( - "DeriveSubQuery at inline() is unsupported! Sorry!"); + "DerivedReferrer at inline() is unsupported! Sorry!"); } protected ConditionValue getCValueYear() { @@ -219,6 +219,20 @@ return _myCQ.getVersionno(); } + //========================================================================== + // ========= + // Derived Query + // ============= + public String keepScalarSubQuery(MonthlyReportCQ subQuery) { + throw new UnsupportedOperationException( + "ScalarSubQuery at inline() is unsupported! Sorry!"); + } + + // Very Internal (for Suppressing Warn about 'Not Use Import') + protected String getConditionBeanClassNameInternally() { + return MonthlyReportCB.class.getName(); + } + protected String getConditionQueryClassNameInternally() { return MonthlyReportCQ.class.getName(); } Modified: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/cbean/cq/ciq/MonthlyWorkingReportCIQ.java =================================================================== --- timecard/trunk/src/main/java/jp/sf/pal/timecard/db/cbean/cq/ciq/MonthlyWorkingReportCIQ.java 2008-12-27 22:18:30 UTC (rev 1630) +++ timecard/trunk/src/main/java/jp/sf/pal/timecard/db/cbean/cq/ciq/MonthlyWorkingReportCIQ.java 2008-12-27 22:20:25 UTC (rev 1631) @@ -5,6 +5,7 @@ import jp.sf.pal.timecard.db.allcommon.cbean.coption.ConditionOption; import jp.sf.pal.timecard.db.allcommon.cbean.cvalue.ConditionValue; import jp.sf.pal.timecard.db.allcommon.cbean.sqlclause.SqlClause; +import jp.sf.pal.timecard.db.cbean.MonthlyWorkingReportCB; import jp.sf.pal.timecard.db.cbean.cq.MonthlyReportCQ; import jp.sf.pal.timecard.db.cbean.cq.MonthlyWorkingReportCQ; import jp.sf.pal.timecard.db.cbean.cq.WorkingTypeCQ; @@ -16,7 +17,6 @@ * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public class MonthlyWorkingReportCIQ extends AbstractBsMonthlyWorkingReportCQ { //========================================================================== @@ -120,6 +120,20 @@ return _myCQ.keepWorkingTypeId_InScopeSubQuery_WorkingType(subQuery); } + //========================================================================== + // ========= + // Derived Query + // ============= + public String keepScalarSubQuery(MonthlyWorkingReportCQ subQuery) { + throw new UnsupportedOperationException( + "ScalarSubQuery at inline() is unsupported! Sorry!"); + } + + // Very Internal (for Suppressing Warn about 'Not Use Import') + protected String getConditionBeanClassNameInternally() { + return MonthlyWorkingReportCB.class.getName(); + } + protected String getConditionQueryClassNameInternally() { return MonthlyWorkingReportCQ.class.getName(); } Modified: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/cbean/cq/ciq/RoleInfoCIQ.java =================================================================== --- timecard/trunk/src/main/java/jp/sf/pal/timecard/db/cbean/cq/ciq/RoleInfoCIQ.java 2008-12-27 22:18:30 UTC (rev 1630) +++ timecard/trunk/src/main/java/jp/sf/pal/timecard/db/cbean/cq/ciq/RoleInfoCIQ.java 2008-12-27 22:20:25 UTC (rev 1631) @@ -5,6 +5,7 @@ import jp.sf.pal.timecard.db.allcommon.cbean.coption.ConditionOption; import jp.sf.pal.timecard.db.allcommon.cbean.cvalue.ConditionValue; import jp.sf.pal.timecard.db.allcommon.cbean.sqlclause.SqlClause; +import jp.sf.pal.timecard.db.cbean.RoleInfoCB; import jp.sf.pal.timecard.db.cbean.cq.RoleInfoCQ; import jp.sf.pal.timecard.db.cbean.cq.RoleMappingCQ; import jp.sf.pal.timecard.db.cbean.cq.UserInfoCQ; @@ -16,7 +17,6 @@ * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public class RoleInfoCIQ extends AbstractBsRoleInfoCQ { //========================================================================== @@ -136,15 +136,15 @@ "NotExistsSubQuery at inline() is unsupported! Sorry!"); } - public String keepRoleId_DeriveSubQuery_RoleMappingList( + public String keepRoleId_DerivedReferrer_RoleMappingList( RoleMappingCQ subQuery) { throw new UnsupportedOperationException( - "DeriveSubQuery at inline() is unsupported! Sorry!"); + "DerivedReferrer at inline() is unsupported! Sorry!"); } - public String keepRoleId_DeriveSubQuery_UserInfoList(UserInfoCQ subQuery) { + public String keepRoleId_DerivedReferrer_UserInfoList(UserInfoCQ subQuery) { throw new UnsupportedOperationException( - "DeriveSubQuery at inline() is unsupported! Sorry!"); + "DerivedReferrer at inline() is unsupported! Sorry!"); } protected ConditionValue getCValueName() { @@ -195,6 +195,20 @@ return _myCQ.getVersionno(); } + //========================================================================== + // ========= + // Derived Query + // ============= + public String keepScalarSubQuery(RoleInfoCQ subQuery) { + throw new UnsupportedOperationException( + "ScalarSubQuery at inline() is unsupported! Sorry!"); + } + + // Very Internal (for Suppressing Warn about 'Not Use Import') + protected String getConditionBeanClassNameInternally() { + return RoleInfoCB.class.getName(); + } + protected String getConditionQueryClassNameInternally() { return RoleInfoCQ.class.getName(); } Modified: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/cbean/cq/ciq/RoleMappingCIQ.java =================================================================== --- timecard/trunk/src/main/java/jp/sf/pal/timecard/db/cbean/cq/ciq/RoleMappingCIQ.java 2008-12-27 22:18:30 UTC (rev 1630) +++ timecard/trunk/src/main/java/jp/sf/pal/timecard/db/cbean/cq/ciq/RoleMappingCIQ.java 2008-12-27 22:20:25 UTC (rev 1631) @@ -5,6 +5,7 @@ import jp.sf.pal.timecard.db.allcommon.cbean.coption.ConditionOption; import jp.sf.pal.timecard.db.allcommon.cbean.cvalue.ConditionValue; import jp.sf.pal.timecard.db.allcommon.cbean.sqlclause.SqlClause; +import jp.sf.pal.timecard.db.cbean.RoleMappingCB; import jp.sf.pal.timecard.db.cbean.cq.RoleInfoCQ; import jp.sf.pal.timecard.db.cbean.cq.RoleMappingCQ; import jp.sf.pal.timecard.db.cbean.cq.UserInfoCQ; @@ -16,7 +17,6 @@ * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public class RoleMappingCIQ extends AbstractBsRoleMappingCQ { //========================================================================== @@ -112,6 +112,20 @@ return _myCQ.keepRoleId_InScopeSubQuery_RoleInfo(subQuery); } + //========================================================================== + // ========= + // Derived Query + // ============= + public String keepScalarSubQuery(RoleMappingCQ subQuery) { + throw new UnsupportedOperationException( + "ScalarSubQuery at inline() is unsupported! Sorry!"); + } + + // Very Internal (for Suppressing Warn about 'Not Use Import') + protected String getConditionBeanClassNameInternally() { + return RoleMappingCB.class.getName(); + } + protected String getConditionQueryClassNameInternally() { return RoleMappingCQ.class.getName(); } Modified: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/cbean/cq/ciq/UserInfoCIQ.java =================================================================== --- timecard/trunk/src/main/java/jp/sf/pal/timecard/db/cbean/cq/ciq/UserInfoCIQ.java 2008-12-27 22:18:30 UTC (rev 1630) +++ timecard/trunk/src/main/java/jp/sf/pal/timecard/db/cbean/cq/ciq/UserInfoCIQ.java 2008-12-27 22:20:25 UTC (rev 1631) @@ -5,6 +5,7 @@ import jp.sf.pal.timecard.db.allcommon.cbean.coption.ConditionOption; import jp.sf.pal.timecard.db.allcommon.cbean.cvalue.ConditionValue; import jp.sf.pal.timecard.db.allcommon.cbean.sqlclause.SqlClause; +import jp.sf.pal.timecard.db.cbean.UserInfoCB; import jp.sf.pal.timecard.db.cbean.cq.EmployeeCQ; import jp.sf.pal.timecard.db.cbean.cq.GroupInfoCQ; import jp.sf.pal.timecard.db.cbean.cq.GroupMappingCQ; @@ -19,7 +20,6 @@ * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public class UserInfoCIQ extends AbstractBsUserInfoCQ { //========================================================================== @@ -190,28 +190,28 @@ "NotExistsSubQuery at inline() is unsupported! Sorry!"); } - public String keepUserId_DeriveSubQuery_EmployeeByUsernameList( + public String keepUserId_DerivedReferrer_EmployeeByUsernameList( EmployeeCQ subQuery) { throw new UnsupportedOperationException( - "DeriveSubQuery at inline() is unsupported! Sorry!"); + "DerivedReferrer at inline() is unsupported! Sorry!"); } - public String keepUserId_DeriveSubQuery_EmployeeByManagerList( + public String keepUserId_DerivedReferrer_EmployeeByManagerList( EmployeeCQ subQuery) { throw new UnsupportedOperationException( - "DeriveSubQuery at inline() is unsupported! Sorry!"); + "DerivedReferrer at inline() is unsupported! Sorry!"); } - public String keepUserId_DeriveSubQuery_GroupMappingList( + public String keepUserId_DerivedReferrer_GroupMappingList( GroupMappingCQ subQuery) { throw new UnsupportedOperationException( - "DeriveSubQuery at inline() is unsupported! Sorry!"); + "DerivedReferrer at inline() is unsupported! Sorry!"); } - public String keepUserId_DeriveSubQuery_RoleMappingList( + public String keepUserId_DerivedReferrer_RoleMappingList( RoleMappingCQ subQuery) { throw new UnsupportedOperationException( - "DeriveSubQuery at inline() is unsupported! Sorry!"); + "DerivedReferrer at inline() is unsupported! Sorry!"); } protected ConditionValue getCValueGivenName() { @@ -278,6 +278,10 @@ return _myCQ.keepGroupId_InScopeSubQuery_GroupInfo(subQuery); } + protected ConditionValue getCValueStatus() { + return _myCQ.getStatus(); + } + protected ConditionValue getCValueCreatedTime() { return _myCQ.getCreatedTime(); } @@ -306,6 +310,20 @@ return _myCQ.getVersionno(); } + //========================================================================== + // ========= + // Derived Query + // ============= + public String keepScalarSubQuery(UserInfoCQ subQuery) { + throw new UnsupportedOperationException( + "ScalarSubQuery at inline() is unsupported! Sorry!"); + } + + // Very Internal (for Suppressing Warn about 'Not Use Import') + protected String getConditionBeanClassNameInternally() { + return UserInfoCB.class.getName(); + } + protected String getConditionQueryClassNameInternally() { return UserInfoCQ.class.getName(); } Modified: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/cbean/cq/ciq/WorkingTypeCIQ.java =================================================================== --- timecard/trunk/src/main/java/jp/sf/pal/timecard/db/cbean/cq/ciq/WorkingTypeCIQ.java 2008-12-27 22:18:30 UTC (rev 1630) +++ timecard/trunk/src/main/java/jp/sf/pal/timecard/db/cbean/cq/ciq/WorkingTypeCIQ.java 2008-12-27 22:20:25 UTC (rev 1631) @@ -5,6 +5,7 @@ import jp.sf.pal.timecard.db.allcommon.cbean.coption.ConditionOption; import jp.sf.pal.timecard.db.allcommon.cbean.cvalue.ConditionValue; import jp.sf.pal.timecard.db.allcommon.cbean.sqlclause.SqlClause; +import jp.sf.pal.timecard.db.cbean.WorkingTypeCB; import jp.sf.pal.timecard.db.cbean.cq.MonthlyWorkingReportCQ; import jp.sf.pal.timecard.db.cbean.cq.WorkingTypeCQ; import jp.sf.pal.timecard.db.cbean.cq.bs.AbstractBsWorkingTypeCQ; @@ -15,7 +16,6 @@ * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public class WorkingTypeCIQ extends AbstractBsWorkingTypeCQ { //========================================================================== @@ -118,10 +118,10 @@ "NotExistsSubQuery at inline() is unsupported! Sorry!"); } - public String keepId_DeriveSubQuery_MonthlyWorkingReportList( + public String keepId_DerivedReferrer_MonthlyWorkingReportList( MonthlyWorkingReportCQ subQuery) { throw new UnsupportedOperationException( - "DeriveSubQuery at inline() is unsupported! Sorry!"); + "DerivedReferrer at inline() is unsupported! Sorry!"); } protected ConditionValue getCValueName() { @@ -168,6 +168,20 @@ return _myCQ.getVersionno(); } + //========================================================================== + // ========= + // Derived Query + // ============= + public String keepScalarSubQuery(WorkingTypeCQ subQuery) { + throw new UnsupportedOperationException( + "ScalarSubQuery at inline() is unsupported! Sorry!"); + } + + // Very Internal (for Suppressing Warn about 'Not Use Import') + protected String getConditionBeanClassNameInternally() { + return WorkingTypeCB.class.getName(); + } + protected String getConditionQueryClassNameInternally() { return WorkingTypeCQ.class.getName(); } Modified: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/cbean/nss/DailyReportNss.java =================================================================== --- timecard/trunk/src/main/java/jp/sf/pal/timecard/db/cbean/nss/DailyReportNss.java 2008-12-27 22:18:30 UTC (rev 1630) +++ timecard/trunk/src/main/java/jp/sf/pal/timecard/db/cbean/nss/DailyReportNss.java 2008-12-27 22:20:25 UTC (rev 1631) @@ -8,7 +8,6 @@ * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public class DailyReportNss { protected DailyReportCQ _query; Modified: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/cbean/nss/EmployeeNss.java =================================================================== --- timecard/trunk/src/main/java/jp/sf/pal/timecard/db/cbean/nss/EmployeeNss.java 2008-12-27 22:18:30 UTC (rev 1630) +++ timecard/trunk/src/main/java/jp/sf/pal/timecard/db/cbean/nss/EmployeeNss.java 2008-12-27 22:20:25 UTC (rev 1631) @@ -8,7 +8,6 @@ * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public class EmployeeNss { protected EmployeeCQ _query; Modified: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/cbean/nss/GroupInfoNss.java =================================================================== --- timecard/trunk/src/main/java/jp/sf/pal/timecard/db/cbean/nss/GroupInfoNss.java 2008-12-27 22:18:30 UTC (rev 1630) +++ timecard/trunk/src/main/java/jp/sf/pal/timecard/db/cbean/nss/GroupInfoNss.java 2008-12-27 22:20:25 UTC (rev 1631) @@ -7,7 +7,6 @@ * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public class GroupInfoNss { protected GroupInfoCQ _query; Modified: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/cbean/nss/GroupMappingNss.java =================================================================== --- timecard/trunk/src/main/java/jp/sf/pal/timecard/db/cbean/nss/GroupMappingNss.java 2008-12-27 22:18:30 UTC (rev 1630) +++ timecard/trunk/src/main/java/jp/sf/pal/timecard/db/cbean/nss/GroupMappingNss.java 2008-12-27 22:20:25 UTC (rev 1631) @@ -8,7 +8,6 @@ * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public class GroupMappingNss { protected GroupMappingCQ _query; Modified: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/cbean/nss/MonthlyReportNss.java =================================================================== --- timecard/trunk/src/main/java/jp/sf/pal/timecard/db/cbean/nss/MonthlyReportNss.java 2008-12-27 22:18:30 UTC (rev 1630) +++ timecard/trunk/src/main/java/jp/sf/pal/timecard/db/cbean/nss/MonthlyReportNss.java 2008-12-27 22:20:25 UTC (rev 1631) @@ -8,7 +8,6 @@ * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public class MonthlyReportNss { protected MonthlyReportCQ _query; Modified: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/cbean/nss/MonthlyWorkingReportNss.java =================================================================== --- timecard/trunk/src/main/java/jp/sf/pal/timecard/db/cbean/nss/MonthlyWorkingReportNss.java 2008-12-27 22:18:30 UTC (rev 1630) +++ timecard/trunk/src/main/java/jp/sf/pal/timecard/db/cbean/nss/MonthlyWorkingReportNss.java 2008-12-27 22:20:25 UTC (rev 1631) @@ -8,7 +8,6 @@ * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public class MonthlyWorkingReportNss { protected MonthlyWorkingReportCQ _query; Modified: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/cbean/nss/RoleInfoNss.java =================================================================== --- timecard/trunk/src/main/java/jp/sf/pal/timecard/db/cbean/nss/RoleInfoNss.java 2008-12-27 22:18:30 UTC (rev 1630) +++ timecard/trunk/src/main/java/jp/sf/pal/timecard/db/cbean/nss/RoleInfoNss.java 2008-12-27 22:20:25 UTC (rev 1631) @@ -7,7 +7,6 @@ * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public class RoleInfoNss { protected RoleInfoCQ _query; Modified: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/cbean/nss/RoleMappingNss.java =================================================================== --- timecard/trunk/src/main/java/jp/sf/pal/timecard/db/cbean/nss/RoleMappingNss.java 2008-12-27 22:18:30 UTC (rev 1630) +++ timecard/trunk/src/main/java/jp/sf/pal/timecard/db/cbean/nss/RoleMappingNss.java 2008-12-27 22:20:25 UTC (rev 1631) @@ -8,7 +8,6 @@ * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public class RoleMappingNss { protected RoleMappingCQ _query; Modified: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/cbean/nss/UserInfoNss.java =================================================================== --- timecard/trunk/src/main/java/jp/sf/pal/timecard/db/cbean/nss/UserInfoNss.java 2008-12-27 22:18:30 UTC (rev 1630) +++ timecard/trunk/src/main/java/jp/sf/pal/timecard/db/cbean/nss/UserInfoNss.java 2008-12-27 22:20:25 UTC (rev 1631) @@ -8,7 +8,6 @@ * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public class UserInfoNss { protected UserInfoCQ _query; Modified: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/cbean/nss/WorkingTypeNss.java =================================================================== --- timecard/trunk/src/main/java/jp/sf/pal/timecard/db/cbean/nss/WorkingTypeNss.java 2008-12-27 22:18:30 UTC (rev 1630) +++ timecard/trunk/src/main/java/jp/sf/pal/timecard/db/cbean/nss/WorkingTypeNss.java 2008-12-27 22:20:25 UTC (rev 1631) @@ -7,7 +7,6 @@ * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public class WorkingTypeNss { protected WorkingTypeCQ _query; Modified: timecard/trunk/src/main/resources/dbflute.dicon =================================================================== --- timecard/trunk/src/main/resources/dbflute.dicon 2008-12-27 22:18:30 UTC (rev 1630) +++ timecard/trunk/src/main/resources/dbflute.dicon 2008-12-27 22:20:25 UTC (rev 1631) @@ -5,101 +5,42 @@ - - - "UTF-8" + + + + + + - + + + + + - - - - + + - - - - - - - - - - - - dbflute.interceptor - - - - - - dbflute.interceptor - - - - - dbflute.interceptor - - - - - dbflute.interceptor - - - - - dbflute.interceptor - - - - - dbflute.interceptor - - - - - dbflute.interceptor - - - - - dbflute.interceptor - - - - - dbflute.interceptor - - - - - dbflute.interceptor - - - - - dbflute.interceptor - Modified: timecard/trunk/src/main/webapp/WEB-INF/db/timecard.1.log.db =================================================================== (Binary files differ) Modified: timecard/trunk/src/main/webapp/WEB-INF/db/timecard.data.db =================================================================== (Binary files differ) From svnnotify ¡÷ sourceforge.jp Sun Dec 28 07:20:46 2008 From: svnnotify ¡÷ sourceforge.jp (svnnotify ¡÷ sourceforge.jp) Date: Sun, 28 Dec 2008 07:20:46 +0900 Subject: [pal-cvs 3897] [1632] added status column to userinfo table. Message-ID: <1230416446.144591.19193.nullmailer@users.sourceforge.jp> Revision: 1632 http://svn.sourceforge.jp/view?root=pal&view=rev&rev=1632 Author: shinsuke Date: 2008-12-28 07:20:45 +0900 (Sun, 28 Dec 2008) Log Message: ----------- added status column to userinfo table. replaced with dbflute 0.8.7. Removed Paths: ------------- timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/BFinder.java timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/CacheDaoSelector.java timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/DaoReadable.java timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/DaoSelector.java timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/DaoWritable.java timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/GenMetaData.java timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/annotation/OutsideSql.java timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/cbean/SimpleOrderByBean.java timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/cbean/outsidesql/OutsideSqlDao.java timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/s2dao/FetchNarrowingResultSetFactory.java timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/s2dao/S2BeanMetaDataFactoryImpl.java timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/s2dao/S2DaoInterceptor.java timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/s2dao/S2DaoLatestSqlProvider.java timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/s2dao/S2DaoMetaDataExtension.java timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/s2dao/S2DaoMetaDataFactoryImpl.java timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/s2dao/S2DaoPropertyTypeFactoryBuilderExtension.java timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/s2dao/S2DaoSelectDynamicCommand.java -------------- next part -------------- Deleted: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/BFinder.java =================================================================== --- timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/BFinder.java 2008-12-27 22:20:25 UTC (rev 1631) +++ timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/BFinder.java 2008-12-27 22:20:45 UTC (rev 1632) @@ -1,110 +0,0 @@ -package jp.sf.pal.timecard.db.allcommon; - -import jp.sf.pal.timecard.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 find( - Class 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); - } - } -} Deleted: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/CacheDaoSelector.java =================================================================== --- timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/CacheDaoSelector.java 2008-12-27 22:20:25 UTC (rev 1631) +++ timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/CacheDaoSelector.java 2008-12-27 22:20:45 UTC (rev 1632) @@ -1,66 +0,0 @@ -package jp.sf.pal.timecard.db.allcommon; - -import jp.sf.pal.timecard.db.allcommon.dbmeta.DBMeta; -import jp.sf.pal.timecard.db.allcommon.dbmeta.DBMetaInstanceHandler; - -/** - * The implementation of DAO-selector. - * - *
- * 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.
- * 
- * - * @author DBFlute(AutoGenerator) - */ - ¡÷ SuppressWarnings("unchecked") -public class CacheDaoSelector extends CacheAbstractSelector implements - DaoSelector { - - //========================================================================== - // ========= - // Selector - // ======== - /** - * Select DAO. - * - * @param The type of DAO. - * @param daoType DAO type. (NotNull) - * @return DAO. (NotNull) - */ - public DAO select(Class 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 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 daoType; - try { - daoType = (Class) Class.forName(daoTypeName); - } catch (ClassNotFoundException e) { - throw new RuntimeException("The class does not exist: " - + daoTypeName, e); - } - return daoType; - } -} Deleted: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/DaoReadable.java =================================================================== --- timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/DaoReadable.java 2008-12-27 22:20:25 UTC (rev 1631) +++ timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/DaoReadable.java 2008-12-27 22:20:45 UTC (rev 1632) @@ -1,11 +0,0 @@ -package jp.sf.pal.timecard.db.allcommon; - -/** - * The interface of dao-readable. - * - * @author DBFlute(AutoGenerator) - */ -public interface DaoReadable { - public void initializeDaoMetaData(String methodName);// Very Internal - // Method! -} Deleted: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/DaoSelector.java =================================================================== --- timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/DaoSelector.java 2008-12-27 22:20:25 UTC (rev 1631) +++ timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/DaoSelector.java 2008-12-27 22:20:45 UTC (rev 1632) @@ -1,26 +0,0 @@ -package jp.sf.pal.timecard.db.allcommon; - -/** - * The interface of DAO-selector. - * - * @author DBFlute(AutoGenerator) - */ -public interface DaoSelector { - - /** - * Select DAO. - * - * @param The type of DAO. - * @param daoType DAO type. (NotNull) - * @return Dao. (NotNull) - */ - public DAO select(Class daoType); - - /** - * Select DAO-readable by name. - * - * @param tableFlexibleName Table flexible name. (NotNull) - * @return DAO-readable. (NotNull) - */ - public DaoReadable byName(String tableFlexibleName); -} Deleted: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/DaoWritable.java =================================================================== --- timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/DaoWritable.java 2008-12-27 22:20:25 UTC (rev 1631) +++ timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/DaoWritable.java 2008-12-27 22:20:45 UTC (rev 1632) @@ -1,70 +0,0 @@ -package jp.sf.pal.timecard.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 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 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 entityList); -} Deleted: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/GenMetaData.java =================================================================== --- timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/GenMetaData.java 2008-12-27 22:20:25 UTC (rev 1631) +++ timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/GenMetaData.java 2008-12-27 22:20:45 UTC (rev 1632) @@ -1,258 +0,0 @@ -package jp.sf.pal.timecard.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.timecard.db.allcommon"; - } - - /** - * Get the property-value of baseBehaviorPackage. - * - * @return The property-value. - */ - public String getBaseBehaviorPackage() { - return "jp.sf.pal.timecard.db.bsbhv"; - } - - /** - * Get the property-value of baseDaoPackage. - * - * @return The property-value. - */ - public String getBaseDaoPackage() { - return "jp.sf.pal.timecard.db.bsdao"; - } - - /** - * Get the property-value of baseEntityPackage. - * - * @return The property-value. - */ - public String getBaseEntityPackage() { - return "jp.sf.pal.timecard.db.bsentity"; - } - - /** - * Get the property-value of conditionBeanPackage. - * - * @return The property-value. - */ - public String getConditionBeanPackage() { - return "jp.sf.pal.timecard.db.cbean"; - } - - /** - * Get the property-value of extendedDaoPackage. - * - * @return The property-value. - */ - public String getExtendedDaoPackage() { - return "jp.sf.pal.timecard.db.exdao"; - } - - /** - * Get the property-value of extendedBehaviorPackage. - * - * @return The property-value. - */ - public String getExtendedBehaviorPackage() { - return "jp.sf.pal.timecard.db.exbhv"; - } - - /** - * Get the property-value of extendedEntityPackage. - * - * @return The property-value. - */ - public String getExtendedEntityPackage() { - return "jp.sf.pal.timecard.db.exentity"; - } - - //========================================================================== - // ========= - // Optimistic Lock - // =============== - /** - * Get the property-value of updateDateFieldName. - * - * @return The property-value. - */ - public String getUpdateDateFieldName() { - return ""; - } - - /** - * Get the property-value of versionNoFieldName. - * - * @return The property-value. - */ - public String getVersionNoFieldName() { - return ""; - } - - //========================================================================== - // ========= - // Extract - // ======= - /** - * Get the value of 'extractAcceptStartBrace'. - * - * @return The property-value. (NotNull) - */ - public String getExtractAcceptStartBrace() { - return "@{"; - } - - /** - * Get the value of 'extractAcceptEndBrace'. - * - * @return The property-value. (NotNull) - */ - public String getExtractAcceptEndBrace() { - return "@}"; - } - - /** - * Get the value of 'extractAcceptDelimiter'. - * - * @return The property-value. (NotNull) - */ - public String getExtractAcceptDelimiter() { - return "@;"; - } - - /** - * Get the value of 'extractAcceptEqual'. - * - * @return The property-value. (NotNull) - */ - public String getExtractAcceptEqual() { - return "@="; - } -} Deleted: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/annotation/OutsideSql.java =================================================================== --- timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/annotation/OutsideSql.java 2008-12-27 22:20:25 UTC (rev 1631) +++ timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/annotation/OutsideSql.java 2008-12-27 22:20:45 UTC (rev 1632) @@ -1,18 +0,0 @@ -package jp.sf.pal.timecard.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; -} Deleted: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/cbean/SimpleOrderByBean.java =================================================================== --- timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/cbean/SimpleOrderByBean.java 2008-12-27 22:20:25 UTC (rev 1631) +++ timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/cbean/SimpleOrderByBean.java 2008-12-27 22:20:45 UTC (rev 1632) @@ -1,165 +0,0 @@ -package jp.sf.pal.timecard.db.allcommon.cbean; - -import jp.sf.pal.timecard.db.allcommon.cbean.sqlclause.OrderByClause; -import jp.sf.pal.timecard.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; - } -} Deleted: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/cbean/outsidesql/OutsideSqlDao.java =================================================================== --- timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/cbean/outsidesql/OutsideSqlDao.java 2008-12-27 22:20:25 UTC (rev 1631) +++ timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/cbean/outsidesql/OutsideSqlDao.java 2008-12-27 22:20:45 UTC (rev 1632) @@ -1,37 +0,0 @@ -package jp.sf.pal.timecard.db.allcommon.cbean.outsidesql; - -import java.util.List; - -import jp.sf.pal.timecard.db.allcommon.DaoReadable; -import jp.sf.pal.timecard.db.allcommon.jdbc.CursorHandler; - -/** - * The dao of outside-sql. - * - * @author DBFlute(AutoGenerator) - */ -public interface OutsideSqlDao extends DaoReadable { - - //========================================================================== - // ========= - // Select - // ====== - List selectList(String path, Object pmb, - OutsideSqlOption option, Class entityType); - - 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); -} Deleted: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/s2dao/FetchNarrowingResultSetFactory.java =================================================================== --- timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/s2dao/FetchNarrowingResultSetFactory.java 2008-12-27 22:20:25 UTC (rev 1631) +++ timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/s2dao/FetchNarrowingResultSetFactory.java 2008-12-27 22:20:45 UTC (rev 1632) @@ -1,125 +0,0 @@ -package jp.sf.pal.timecard.db.allcommon.s2dao; - -import java.sql.PreparedStatement; -import java.sql.ResultSet; -import java.sql.SQLException; -import java.sql.Statement; - -import jp.sf.pal.timecard.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); - } -} Deleted: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/s2dao/S2BeanMetaDataFactoryImpl.java =================================================================== --- timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/s2dao/S2BeanMetaDataFactoryImpl.java 2008-12-27 22:20:25 UTC (rev 1631) +++ timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/s2dao/S2BeanMetaDataFactoryImpl.java 2008-12-27 22:20:45 UTC (rev 1632) @@ -1,116 +0,0 @@ -package jp.sf.pal.timecard.db.allcommon.s2dao; - -import java.sql.DatabaseMetaData; -import java.util.Collections; -import java.util.HashMap; -import java.util.Map; - -import jp.sf.pal.timecard.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, BeanMetaData> _metaMap = Collections - .synchronizedMap(new HashMap, BeanMetaData>()); - - @Override - public BeanMetaData createBeanMetaData(Class beanClass) { - final BeanMetaData cachedMeta = findCachedMeta(beanClass); - if (cachedMeta != null) { - return cachedMeta; - } else { - return super.createBeanMetaData(beanClass); - } - } - - @Override - public BeanMetaData createBeanMetaData(Class beanClass, - int relationNestLevel) { - final BeanMetaData cachedMeta = findCachedMeta(beanClass); - if (cachedMeta != null) { - return cachedMeta; - } else { - return super.createBeanMetaData(beanClass, relationNestLevel); - } - } - - @Override - public BeanMetaData createBeanMetaData(DatabaseMetaData dbMetaData, - Class beanClass, int relationNestLevel) { - final BeanMetaData cachedMeta = findOrCreateCachedMetaIfNeeds( - dbMetaData, beanClass, relationNestLevel); - if (cachedMeta != null) { - return cachedMeta; - } else { - return super.createBeanMetaData(dbMetaData, beanClass, - relationNestLevel); - } - } - - protected BeanMetaData findCachedMeta(Class beanClass) { - if (isDBFluteEntity(beanClass)) { - final BeanMetaData cachedMeta = getMetaFromCache(beanClass); - if (cachedMeta != null) { - return cachedMeta; - } - } - return null; - } - - protected BeanMetaData findOrCreateCachedMetaIfNeeds( - DatabaseMetaData dbMetaData, Class beanClass, int relationNestLevel) { - if (isDBFluteEntity(beanClass)) { - final BeanMetaData cachedMeta = getMetaFromCache(beanClass); - if (cachedMeta != null) { - return cachedMeta; - } else { - return super.createBeanMetaData(dbMetaData, beanClass, 0); - } - } - return null; - } - - @Override - protected BeanMetaDataImpl createBeanMetaDataImpl() { - return new BeanMetaDataImpl() { - @Override - public void initialize() { - final Class myBeanClass = getBeanClass(); - if (isDBFluteEntity(myBeanClass)) { - final BeanMetaData cachedMeta = getMetaFromCache(myBeanClass); - if (cachedMeta == null) { - _metaMap.put(myBeanClass, this); - } - } - super.initialize(); - } - }; - } - - protected boolean isDBFluteEntity(Class beanClass) { - return Entity.class.isAssignableFrom(beanClass); - } - - protected BeanMetaData getMetaFromCache(Class beanClass) { - return _metaMap.get(beanClass); - } - - /** - * Get the limit nest level of relation. - * - * @return The limit nest level of relation. - */ - @Override - protected int getLimitRelationNestLevel() { - return 2;// for Compatible to old version DBFlute - } -} \ No newline at end of file Deleted: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/s2dao/S2DaoInterceptor.java =================================================================== --- timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/s2dao/S2DaoInterceptor.java 2008-12-27 22:20:25 UTC (rev 1631) +++ timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/s2dao/S2DaoInterceptor.java 2008-12-27 22:20:45 UTC (rev 1632) @@ -1,1027 +0,0 @@ -package jp.sf.pal.timecard.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.timecard.db.allcommon.Entity; -import jp.sf.pal.timecard.db.allcommon.InternalMapContext; -import jp.sf.pal.timecard.db.allcommon.XLog; -import jp.sf.pal.timecard.db.allcommon.cbean.ConditionBean; -import jp.sf.pal.timecard.db.allcommon.cbean.ConditionBeanContext; -import jp.sf.pal.timecard.db.allcommon.cbean.FetchNarrowingBean; -import jp.sf.pal.timecard.db.allcommon.cbean.FetchNarrowingBeanContext; -import jp.sf.pal.timecard.db.allcommon.cbean.outsidesql.OutsideSqlContext; -import jp.sf.pal.timecard.db.allcommon.cbean.outsidesql.OutsideSqlDao; -import jp.sf.pal.timecard.db.allcommon.cbean.outsidesql.OutsideSqlOption; -import jp.sf.pal.timecard.db.allcommon.dbmeta.DBMeta; -import jp.sf.pal.timecard.db.allcommon.dbmeta.DBMetaInstanceHandler; -import jp.sf.pal.timecard.db.allcommon.exception.EntityAlreadyUpdatedException; -import jp.sf.pal.timecard.db.allcommon.helper.stacktrace.InvokeNameExtractingResource; -import jp.sf.pal.timecard.db.allcommon.helper.stacktrace.InvokeNameResult; -import jp.sf.pal.timecard.db.allcommon.helper.stacktrace.impl.InvokeNameExtractorImpl; -import jp.sf.pal.timecard.db.allcommon.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 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 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 suffixList = Arrays.asList(new String[] { "Bhv", - "BehaviorReadable", "BehaviorWritable", "PagingInvoker" }); - final List keywordList = Arrays.asList(new String[] { "Bhv$", - "BehaviorReadable$", "BehaviorWritable$" }); - final List ousideSql1List = Arrays - .asList(new String[] { "OutsideSql" }); - final List ousideSql2List = Arrays - .asList(new String[] { "Executor" }); - final List 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 suffixList) { - for (String suffix : suffixList) { - if (className.endsWith(suffix)) { - return true; - } - } - return false; - } - - protected boolean isClassNameContains(String className, - List 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 outsideSqlType = jp.sf.pal.timecard.db.allcommon.annotation.OutsideSql.class; - final jp.sf.pal.timecard.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. - *

- * If this method is condition bean select target, make dynamic SQL. Else - * nothing. - * - * @param invocation Method invocation. (NotNull) - * @return ConditionBean. (Nullable) - */ - protected ConditionBean preprocessConditionBean(MethodInvocation invocation) { - final OutsideSqlContext outsideSqlContext = getOutsideSqlContext(); - if (outsideSqlContext != null) { - return null; // Because it has already finished setting up - // fetchNarrowingBean for outsideSql here. - } - - final ConditionBean cb; - { - final Object[] args = invocation.getArguments(); - if (args == null || args.length == 0) { - return null; - } - final Object arg0 = args[0]; - if (arg0 == null) { - return null; - } - if (!ConditionBeanContext.isTheTypeConditionBean(arg0.getClass())) {// The - // argument - // is - // not - // condition - // - - // bean - // ... - if (FetchNarrowingBeanContext.isTheTypeFetchNarrowingBean(arg0 - .getClass()) - && !isSelectCountIgnoreFetchScopeMethod(invocation)) { - // Fetch-narrowing-bean and Not select count! - FetchNarrowingBeanContext - .setFetchNarrowingBeanOnThread((FetchNarrowingBean) arg0); - } - return null; - } - cb = (ConditionBean) arg0; - } - - if (isSelectCountIgnoreFetchScopeMethod(invocation)) { - cb.xsetupSelectCountIgnoreFetchScope(); - } else { - FetchNarrowingBeanContext.setFetchNarrowingBeanOnThread(cb); - } - - ConditionBeanContext.setConditionBeanOnThread(cb); - return cb; - } - - /** - * Post-process condition-bean. - * - * @param invocation Method invocation. (NotNull) - * @param cb Condition-bean. (Nullable) - */ - protected void postprocessConditionBean(MethodInvocation invocation, - ConditionBean cb) { - if (cb == null) { - return; - } - if (isSelectCountIgnoreFetchScopeMethod(invocation)) { - cb.xafterCareSelectCountIgnoreFetchScope(); - } - } - - // ----------------------------------------------------- - // Clear Thread Local - // ------------------ - protected void clearThreadLocal() { - if (OutsideSqlContext.isExistOutsideSqlContextOnThread()) { - OutsideSqlContext.clearOutsideSqlContextOnThread(); - } - if (FetchNarrowingBeanContext.isExistFetchNarrowingBeanOnThread()) { - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - // Because there is possible that fetch narrowing has been ignored - // for manualPaging of outsideSql. - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - FetchNarrowingBeanContext.getFetchNarrowingBeanOnThread() - .restoreIgnoredFetchNarrowing(); - - FetchNarrowingBeanContext.clearFetchNarrowingBeanOnThread(); - } - if (ConditionBeanContext.isExistConditionBeanOnThread()) { - ConditionBeanContext.clearConditionBeanOnThread(); - } - if (InternalMapContext.isExistInternalMapContextOnThread()) { - InternalMapContext.clearInternalMapContextOnThread(); - } - } - - //========================================================================== - // ========= - // Context Helper - // ============== - protected OutsideSqlContext getOutsideSqlContext() { - if (!OutsideSqlContext.isExistOutsideSqlContextOnThread()) { - return null; - } - return OutsideSqlContext.getOutsideSqlContextOnThread(); - } - - protected boolean isSpecifiedOutsideSql() { - final OutsideSqlContext outsideSqlContext = getOutsideSqlContext(); - return outsideSqlContext != null - && outsideSqlContext.isSpecifiedOutsideSql(); - } - - protected void putObjectToMapContext(String key, Object value) { - InternalMapContext.setObject(key, value); - } - - //========================================================================== - // ========= - // Determination - // ============= - /** - * Is select count ignore-fetch-scope method? - * - * @param invocation Method invocation. (NotNull) - * @return Determination. - */ - protected boolean isSelectCountIgnoreFetchScopeMethod( - MethodInvocation invocation) { - final String name = invocation.getMethod().getName(); - return name.startsWith("readCount") || name.startsWith("selectCount"); - } - - //========================================================================== - // ========= - // General Helper - // ============== - /** - * Is the method abstract? - * - * @param method Method. (NotNull) - * @return Determination. (NotNull) - */ - public boolean isAbstract(Method method) { - final int mod = method.getModifiers(); - return Modifier.isAbstract(mod); - } - - /** - * Get the value of line separator. - * - * @return The value of line separator. (NotNull) - */ - protected String getLineSeparator() { - return System.getProperty("line.separator"); - } -} \ No newline at end of file Deleted: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/s2dao/S2DaoLatestSqlProvider.java =================================================================== --- timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/s2dao/S2DaoLatestSqlProvider.java 2008-12-27 22:20:25 UTC (rev 1631) +++ timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/s2dao/S2DaoLatestSqlProvider.java 2008-12-27 22:20:45 UTC (rev 1632) @@ -1,20 +0,0 @@ -package jp.sf.pal.timecard.db.allcommon.s2dao; - -import jp.sf.pal.timecard.db.allcommon.jdbc.LatestSqlProvider; -import jp.sf.pal.timecard.db.allcommon.s2dao.internal.sqllog.InternalSqlLogRegistry; - -/** - * The provider of latest SQL as S2Dao. This instance should be singleton. - * - * @author DBFlute(AutoGenerator) - */ -public class S2DaoLatestSqlProvider implements LatestSqlProvider { - - public String getDisplaySql() { - return InternalSqlLogRegistry.peekCompleteSql(); - } - - public void clearSqlCache() { - InternalSqlLogRegistry.clearSqlLogRegistry(); - } -} Deleted: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/s2dao/S2DaoMetaDataExtension.java =================================================================== --- timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/s2dao/S2DaoMetaDataExtension.java 2008-12-27 22:20:25 UTC (rev 1631) +++ timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/s2dao/S2DaoMetaDataExtension.java 2008-12-27 22:20:45 UTC (rev 1632) @@ -1,1460 +0,0 @@ -package jp.sf.pal.timecard.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.timecard.db.allcommon.BehaviorSelector; -import jp.sf.pal.timecard.db.allcommon.Entity; -import jp.sf.pal.timecard.db.allcommon.annotation.OutsideSql; -import jp.sf.pal.timecard.db.allcommon.cbean.ConditionBean; -import jp.sf.pal.timecard.db.allcommon.cbean.ConditionBeanContext; -import jp.sf.pal.timecard.db.allcommon.cbean.outsidesql.OutsideSqlContext; -import jp.sf.pal.timecard.db.allcommon.dbmeta.DBMeta; -import jp.sf.pal.timecard.db.allcommon.exception.BatchEntityAlreadyUpdatedException; -import jp.sf.pal.timecard.db.allcommon.exception.EntityAlreadyDeletedException; -import jp.sf.pal.timecard.db.allcommon.exception.EntityDuplicatedException; -import jp.sf.pal.timecard.db.allcommon.jdbc.CursorHandler; -import jp.sf.pal.timecard.db.allcommon.s2dao.internal.rshandler.InternalBeanArrayMetaDataResultSetHandler; -import jp.sf.pal.timecard.db.allcommon.s2dao.internal.rshandler.InternalBeanListMetaDataResultSetHandler; -import jp.sf.pal.timecard.db.allcommon.s2dao.internal.sqlcommand.InternalDeleteAutoStaticCommand; -import jp.sf.pal.timecard.db.allcommon.s2dao.internal.sqlcommand.InternalDeleteBatchAutoStaticCommand; -import jp.sf.pal.timecard.db.allcommon.s2dao.internal.sqlcommand.InternalDeleteQueryAutoDynamicCommand; -import jp.sf.pal.timecard.db.allcommon.s2dao.internal.sqlcommand.InternalInsertAutoDynamicCommand; -import jp.sf.pal.timecard.db.allcommon.s2dao.internal.sqlcommand.InternalInsertBatchAutoStaticCommand; -import jp.sf.pal.timecard.db.allcommon.s2dao.internal.sqlcommand.InternalProcedureCommand; -import jp.sf.pal.timecard.db.allcommon.s2dao.internal.sqlcommand.InternalUpdateAutoDynamicCommand; -import jp.sf.pal.timecard.db.allcommon.s2dao.internal.sqlcommand.InternalUpdateBatchAutoStaticCommand; -import jp.sf.pal.timecard.db.allcommon.s2dao.internal.sqlcommand.InternalUpdateDynamicCommand; -import jp.sf.pal.timecard.db.allcommon.s2dao.internal.sqlcommand.InternalUpdateModifiedOnlyCommand; -import jp.sf.pal.timecard.db.allcommon.s2dao.internal.sqlcommand.InternalUpdateQueryAutoDynamicCommand; -import jp.sf.pal.timecard.db.allcommon.s2dao.internal.sqlhandler.InternalDeleteBatchAutoHandler; -import jp.sf.pal.timecard.db.allcommon.s2dao.internal.sqlhandler.InternalUpdateBatchAutoHandler; -import jp.sf.pal.timecard.db.allcommon.s2dao.internal.sqlhandler.InternalBasicHandler.SQLExceptionHandler; -import jp.sf.pal.timecard.db.allcommon.s2dao.internal.various.InternalProcedureMetaData; -import jp.sf.pal.timecard.db.allcommon.s2dao.internal.various.InternalProcedureMetaDataFactory; -import jp.sf.pal.timecard.db.allcommon.s2dao.internal.various.InternalRelationRowCreator; -import jp.sf.pal.timecard.db.allcommon.s2dao.internal.various.InternalRowCreator; -import jp.sf.pal.timecard.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 ret = new ArrayList(); - while (rs.next()) { - ret.add(valueType.getValue(rs, 1)); - } - return ret; - } - } - - protected BeanMetaData createSpecifiedOutsideSqlCursorBeanMetaData( - Method method) { - return createOutsideSqlCustomizeBeanMetaDataFactory() - .createBeanMetaData(getOutsideSqlDefaultBeanClass(method)); - } - - protected ResultSetHandler createSpecifiedOutsideSqlCursorResultSetHandler( - BeanMetaData specifiedBeanMetaData) { - return new org.seasar.extension.jdbc.impl.ObjectResultSetHandler();// This - // is - // dummy - // for - // cursor - // handling - // ! - } - - // - - - - - - - - - - - - - // Execute - // - - - - - protected void setupSpecifiedOutsideSqlExecuteCommand(String sqlCommandKey, - Method method, OutsideSqlContext outsideSqlContext) { - // - - - - - - - - - - - - - - - - - - - - - - - - // The attribute of Specified-OutsideSqlContext. - // - - - - - - - - - - - - - - - - - - - - - - - - final String sql = outsideSqlContext.readFilteredOutsideSql( - getSqlFileEncoding(), dbms.getSuffix()); - final Object pmb = outsideSqlContext.getParameterBean(); - - // - - - - - - - - - - - - - - - - // The attribute of SqlCommand. - // - - - - - - - - - - - - - - - - final String[] argNames = (pmb != null ? new String[] { "pmb" } - : new String[] {}); - final Class[] argTypes = (pmb != null ? new Class[] { pmb - .getClass() } : new Class[] {}); - - final InternalUpdateDynamicCommand cmd = new InternalUpdateDynamicCommand( - dataSource, statementFactory) { - @Override - public Object execute(Object[] args) { - if (args.length != 3) { - String msg = "Internal Error! OutsideSqlDao.execute() should have 3 arguements: args.length=" - + args.length; - throw new IllegalStateException(msg); - } - Object arg = args[1]; - return super.execute(new Object[] { arg }); - } - }; - - // It is unnecessary for DBFlute! - // cmd.setNotSingleRowUpdatedExceptionClass( - // getNotSingleRowUpdatedExceptionClass(method)); - - registerSqlCommand(sqlCommandKey, method, sql, argNames, argTypes, cmd); - } - - // - - - - - - - - - - - - - // Call Procedure - // - - - - - - - - protected void setupSpecifiedOutsideSqlCallCommand(String sqlCommandKey, - Method method, OutsideSqlContext outsideSqlContext) { - // - - - - - - - - - - - - - - - - - - - - - - - - // The attribute of Specified-OutsideSqlContext. - // - - - - - - - - - - - - - - - - - - - - - - - - final Object pmb = outsideSqlContext.getParameterBean(); - final String procedureName = outsideSqlContext.getOutsideSqlPath(); - - // - - - - - - - - - - - - - - - - // The attribute of SqlCommand. - // - - - - - - - - - - - - - - - - final InternalProcedureMetaDataFactory factory = createInternalProcedureMetaDataFactory(); - factory.setValueTypeFactory(valueTypeFactory); - final Class pmbType = pmb != null ? pmb.getClass() : null; - final InternalProcedureMetaData metaData = factory - .createProcedureMetaData(procedureName, pmbType); - final InternalProcedureCommand cmd = createInternalProcedureCommand( - method, metaData); - putSqlCommand(sqlCommandKey, cmd); - } - - protected InternalProcedureMetaDataFactory createInternalProcedureMetaDataFactory() { - return new InternalProcedureMetaDataFactory(); - } - - protected InternalProcedureCommand createInternalProcedureCommand( - Method method, InternalProcedureMetaData metaData) { - final ResultSetHandler resultSetHandler = createResultSetHandler(method); - return new InternalProcedureCommand(dataSource, resultSetHandler, - statementFactory, metaData); - } - - // ----------------------------------------------------- - // Common of OutsideSql - // -------------------- - protected BeanMetaDataFactory createOutsideSqlCustomizeBeanMetaDataFactory() { - final S2BeanMetaDataFactoryImpl originalBmdFactory = new S2BeanMetaDataFactoryImpl() { - protected BeanMetaDataImpl createBeanMetaDataImpl() { - return newOutsideSqlCustomizeBeanMetaDataImpl(); - } - }; - originalBmdFactory - .setAnnotationReaderFactory(this.annotationReaderFactory); - originalBmdFactory - .setPropertyTypeFactoryBuilder(createOutsideSqlPropertyTypeFactoryBuilder()); - originalBmdFactory - .setRelationPropertyTypeFactoryBuilder(this.relationPropertyTypeFactoryBuilder); - originalBmdFactory.setTableNaming(this.tableNaming); - originalBmdFactory.setDataSource(this.dataSource); - originalBmdFactory.setDaoNamingConvention(this.daoNamingConvention); - originalBmdFactory.setBeanEnhancer(this.beanEnhancer); - return originalBmdFactory; - } - - protected BeanMetaDataImpl newOutsideSqlCustomizeBeanMetaDataImpl() { - return new OutsideSqlCustomizeBeanMetaDataImpl(); - } - - protected static class OutsideSqlCustomizeBeanMetaDataImpl extends - BeanMetaDataImpl { - // Though nothing to override, it uses original class just in case. - } - - protected S2DaoPropertyTypeFactoryBuilderExtension createOutsideSqlPropertyTypeFactoryBuilder() { - final S2DaoPropertyTypeFactoryBuilderExtension impl = new S2DaoPropertyTypeFactoryBuilderExtension(); - if (columnNaming == null) { - String msg = "Internal Error! The columnNaming should not be null! {Failed to Injection!}"; - throw new IllegalStateException(msg); - } - impl.setColumnNaming(columnNaming); - impl.setValueTypeFactory(valueTypeFactory); - return impl; - } - - protected Class getOutsideSqlDefaultBeanClass(Method method) { - final Class retType = method.getReturnType(); - if (java.util.List.class.isAssignableFrom(retType)) { - final Class elementType = InternalMethodUtil - .getElementTypeOfListFromReturnMethod(method); - if (elementType != null) { - return elementType; - } else { - return getBeanClass(); - } - } else if (retType.isArray()) { - return retType.getComponentType(); - } else if (retType.isPrimitive() - || !ValueTypes.getValueType(retType).equals(ValueTypes.OBJECT)) { - return getBeanClass(); - } else { - return retType; - } - } - - protected void registerSqlCommand(String sqlCommandKey, Method method, - String sql, String[] argNames, Class[] argTypes, - BeanMetaData myBeanMetaData) { - registerSqlCommand(sqlCommandKey, method, sql, argNames, argTypes, - createResultSetHandler(myBeanMetaData, method)); - } - - protected void registerSqlCommand(String sqlCommandKey, Method method, - String sql, String[] argNames, Class[] argTypes, - ResultSetHandler myResultSetHandler) { - final S2DaoSelectDynamicCommand cmd = createCustomizeSelectDynamicCommand(myResultSetHandler); - registerSqlCommand(sqlCommandKey, method, sql, argNames, argTypes, cmd); - } - - protected void registerSqlCommand(String sqlCommandKey, Method method, - String sql, String[] argNames, Class[] argTypes, - S2DaoSelectDynamicCommand cmd) { - cmd.setSql(sql); - cmd.setArgNames(argNames); - cmd.setArgTypes(argTypes); - this.sqlCommands.put(sqlCommandKey, cmd); - } - - protected void registerSqlCommand(String sqlCommandKey, Method method, - String sql, String[] argNames, Class[] argTypes, - InternalUpdateDynamicCommand cmd) { - cmd.setSql(sql); - cmd.setArgNames(argNames); - cmd.setArgTypes(argTypes); - this.sqlCommands.put(sqlCommandKey, cmd); - } - - //========================================================================== - // ========= - // Common Handlnig - // =============== - @Override - protected void putSqlCommand(String methodName, SqlCommand cmd) { - sqlCommands.put(methodName, cmd); - } - - protected boolean isCheckSingleRowUpdate(Method method) { - return checkSingleRowUpdateForAll - & daoAnnotationReader.isCheckSingleRowUpdate(method); - } - - //========================================================================== - // ========= - // Customize SelectDynamicCommand Creation - // ======================================= - /** - * Create the customize select dynamic command that is for all select SQL on - * DBFlute. - * - * @param handler The handler of result set. (NotNull) - * @return The customize select dynamic command. (NotNull) - */ - protected S2DaoSelectDynamicCommand createCustomizeSelectDynamicCommand( - ResultSetHandler handler) { - return new S2DaoSelectDynamicCommand(dataSource, statementFactory, - handler); - } - - //========================================================================== - // ========= - // ResultSetHandler Override - // ========================= - @Override - protected ResultSetHandler createResultSetHandler(Method method) { - return this.resultSetHandlerFactory.getResultSetHandler( - daoAnnotationReader, beanMetaData, method); - } - - protected ResultSetHandler createResultSetHandler( - BeanMetaData specifiedBeanMetaData, Method method) {// For specified - // BeanMetaData - return this.resultSetHandlerFactory.getResultSetHandler( - daoAnnotationReader, specifiedBeanMetaData, method); - } - - //========================================================================== - // ========= - // JDBC Delegator - // ============== - protected Connection getConnection() { - if (dataSource == null) { - throw new IllegalStateException( - "The dataSource should not be null!"); - } - try { - return dataSource.getConnection(); - } catch (SQLException e) { - handleSQLException(e, null); - return null;// Unreachable! - } - } - - protected DatabaseMetaData getMetaData(Connection conn) { - try { - return conn.getMetaData(); - } catch (SQLException e) { - handleSQLException(e, null); - return null;// Unreachable! - } - } - - protected String getDatabaseProductName(DatabaseMetaData dbMetaData) { - try { - return dbMetaData.getDatabaseProductName(); - } catch (SQLException e) { - handleSQLException(e, null); - return null;// Unreachable! - } - } - - protected void close(Connection conn) { - if (conn == null) { - return; - } - try { - conn.close(); - } catch (SQLException e) { - handleSQLException(e, null); - } - } - - //========================================================================== - // ========= - // Exception Handlnig - // ================== - protected void handleSQLException(SQLException e, Statement statement) { - new SQLExceptionHandler().handleSQLException(e, statement); - } - - //========================================================================== - // ========= - // ResultSetHandlerFactoryImpl Extension - // ===================================== - public static class ResultSetHandlerFactoryExtension extends - ResultSetHandlerFactoryImpl { - public ResultSetHandlerFactoryExtension() { - super(); - } - - @Override - protected RowCreator createRowCreator() { // [DAO-118] (2007/08/25) - return createInternalRowCreator(null); - } - - @Override - protected RelationRowCreator createRelationRowCreator() { - return createInternalRelationRowCreator(null); - } - - @Override - protected ResultSetHandler createBeanListMetaDataResultSetHandler( - BeanMetaData bmd) { // DBFlute Target - final InternalRowCreator rowCreator = createInternalRowCreator(bmd); - final InternalRelationRowCreator relationRowCreator = createInternalRelationRowCreator(bmd); - return new InternalBeanListMetaDataResultSetHandler(bmd, - rowCreator, relationRowCreator); - } - - @Override - protected ResultSetHandler createBeanArrayMetaDataResultSetHandler( - BeanMetaData bmd) { // DBFlute Target - final InternalRowCreator rowCreator = createInternalRowCreator(bmd); - final InternalRelationRowCreator relationRowCreator = createInternalRelationRowCreator(bmd); - return new InternalBeanArrayMetaDataResultSetHandler(bmd, - rowCreator, relationRowCreator); - } - - protected InternalRowCreator createInternalRowCreator(BeanMetaData bmd) { - final Class clazz = bmd != null ? bmd.getBeanClass() : null; - return InternalRowCreator.createInternalRowCreator(clazz); - } - - protected InternalRelationRowCreator createInternalRelationRowCreator( - BeanMetaData bmd) { - return new InternalRelationRowCreator(); // Not yet implemented - // about performance - // tuning! - } - } - - //========================================================================== - // ========= - // Vert Internal - // ============= - protected static class InternalMethodUtil { - public static Class getElementTypeOfListFromReturnMethod(Method method) { - return InternalReflectionUtil - .getElementTypeOfListFromReturnType(method); - } - } - - protected static class InternalReflectionUtil { - public static Class getElementTypeOfList(final Type parameterizedList) { - if (!(parameterizedList instanceof ParameterizedType)) { - return null; - } - final ParameterizedType parameterizedType = ParameterizedType.class - .cast(parameterizedList); - final Type rawType = parameterizedType.getRawType(); - if (!(rawType instanceof Class)) { - return null; - } - final Class rawClass = Class.class.cast(rawType); - if (!rawClass.isAssignableFrom(List.class)) { - return null; - } - final Type[] actualTypeArgument = parameterizedType - .getActualTypeArguments(); - if (actualTypeArgument == null || actualTypeArgument.length != 1) { - return null; - } - if (!(actualTypeArgument[0] instanceof Class)) { - return null; - } - return Class.class.cast(actualTypeArgument[0]); - } - - public static Class getElementTypeOfListFromParameterType( - final Method method, final int parameterPosition) { - final Type[] pmbTypes = method.getGenericParameterTypes(); - return getElementTypeOfList(pmbTypes[parameterPosition]); - } - - public static Class getElementTypeOfListFromReturnType( - final Method method) { - return getElementTypeOfList(method.getGenericReturnType()); - } - } - - //========================================================================== - // ========= - // Assist Helper - // ============= - protected DBMeta findDBMeta() { - final Class beanType = getBeanClass(); - if (beanType == null) { - return null; - } - if (!Entity.class.isAssignableFrom(beanType)) { - return null; - } - final Entity entity; - try { - entity = (Entity) beanType.newInstance(); - } catch (InstantiationException e) { - throw new IllegalStateException(e); - } catch (IllegalAccessException e) { - throw new IllegalStateException(e); - } - return entity.getDBMeta(); - } - - //========================================================================== - // ========= - // General Helper - // ============== - protected String getLineSeparator() { - return SimpleSystemUtil.getLineSeparator(); - } - - //========================================================================== - // ========= - // Accessor - // ======== - // ----------------------------------------------------- - // Sql File Encoding - // ----------------- - public String getSqlFileEncoding() { - return sqlFileEncoding; - } - - // ----------------------------------------------------- - // Bean Enhancer - // ------------- - public BeanEnhancer getBeanEnhancer() { - return beanEnhancer; - } - - public void setBeanEnhancer(final BeanEnhancer beanEnhancer) { - this.beanEnhancer = beanEnhancer; - } - - // ----------------------------------------------------- - // Annotation Reader Factory - // ------------------------- - public void setAnnotationReaderFactory( - org.seasar.dao.AnnotationReaderFactory annotationReaderFactory) { - this.annotationReaderFactory = annotationReaderFactory; - } - - // ----------------------------------------------------- - // Version After 1.0.47 - // -------------------- - public ColumnNaming getColumnNaming() { - return columnNaming; - } - - public void setColumnNaming(final ColumnNaming columnNaming) { - this.columnNaming = columnNaming; - } - - public PropertyTypeFactoryBuilder getPropertyTypeFactoryBuilder() { - return propertyTypeFactoryBuilder; - } - - public void setPropertyTypeFactoryBuilder( - final PropertyTypeFactoryBuilder propertyTypeFactoryBuilder) { - this.propertyTypeFactoryBuilder = propertyTypeFactoryBuilder; - } - - public RelationPropertyTypeFactoryBuilder getRelationPropertyTypeFactoryBuilder() { - return relationPropertyTypeFactoryBuilder; - } - - public void setRelationPropertyTypeFactoryBuilder( - final RelationPropertyTypeFactoryBuilder relationPropertyTypeFactoryBuilder) { - this.relationPropertyTypeFactoryBuilder = relationPropertyTypeFactoryBuilder; - } - - public TableNaming getTableNaming() { - return tableNaming; - } - - public void setTableNaming(final TableNaming tableNaming) { - this.tableNaming = tableNaming; - } - - // ----------------------------------------------------- - // DBFlute Extension - // ----------------- - public BehaviorSelector getBehaviorSelector() { - return _behaviorSelector; - } - - public void setBehaviorSelector(final BehaviorSelector behaviorSelector) { - this._behaviorSelector = behaviorSelector; - } - - public boolean isInternalDebug() { - return _internalDebug; - } - - public void setInternalDebug(final boolean internalDebug) { - this._internalDebug = internalDebug; - } -} Deleted: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/s2dao/S2DaoMetaDataFactoryImpl.java =================================================================== --- timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/s2dao/S2DaoMetaDataFactoryImpl.java 2008-12-27 22:20:25 UTC (rev 1631) +++ timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/s2dao/S2DaoMetaDataFactoryImpl.java 2008-12-27 22:20:45 UTC (rev 1632) @@ -1,655 +0,0 @@ -package jp.sf.pal.timecard.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.timecard.db.allcommon.DBFluteConfig; -import jp.sf.pal.timecard.db.allcommon.cbean.ConditionBean; -import jp.sf.pal.timecard.db.allcommon.cbean.ConditionBeanContext; -import jp.sf.pal.timecard.db.allcommon.cbean.outsidesql.OutsideSqlContext; -import jp.sf.pal.timecard.db.allcommon.jdbc.StatementConfig; -import jp.sf.pal.timecard.db.allcommon.s2dao.internal.sqlhandler.InternalBasicHandler.SQLExceptionHandler; -import jp.sf.pal.timecard.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 daoMetaDataCache = new HashMap(); - - protected boolean initialized; - - protected boolean useDaoClassForLog; - - protected String sqlFileEncoding; - - protected BeanEnhancer beanEnhancer; - - // ----------------------------------------------------- - // Version After 1.0.47 - // -------------------- - /** The naming of column. {After S2Dao-1.0.47} */ - protected ColumnNaming columnNaming; - - /** The builder of property type factory. {After S2Dao-1.0.47} */ - protected PropertyTypeFactoryBuilder propertyTypeFactoryBuilder; - - /** The builder of relation property type factory. {After S2Dao-1.0.47} */ - protected RelationPropertyTypeFactoryBuilder relationPropertyTypeFactoryBuilder; - - /** The builder of table naming. {After S2Dao-1.0.47} */ - protected TableNaming tableNaming; - - // ----------------------------------------------------- - // DBFlute Extension - // ----------------- - /** The lock monitor of DAO meta data initialization. */ - protected Object _daoMetaDataInitializationLockMonitor = new Object(); - - //========================================================================== - // ========= - // Constructor - // =========== - public S2DaoMetaDataFactoryImpl(DataSource dataSource, - AnnotationReaderFactory annotationReaderFactory, - XADataSource xaDataSource) { - this.dataSource = dataSource; - this.annotationReaderFactory = annotationReaderFactory; - - _log - .info("/* * * * * * * * * * * * * * * * * * * * * * * * * * * * {DBFlute}"); - showInformation(dataSource, xaDataSource); - - // Stop the LinkageError! - ConditionBeanContext.initialize(); - - initializeDatabaseProductNameOfContext(xaDataSource); - - handleSqlLogRegistry(); - - DBFluteConfig.getInstance().lock(); - _log.info("* * * * */"); - } - - protected void showInformation(javax.sql.DataSource dataSource, - javax.sql.XADataSource xaDataSource) { - final StringBuilder sb = new StringBuilder(); - if (xaDataSource != null - && xaDataSource instanceof org.seasar.extension.dbcp.impl.XADataSourceImpl) { - final org.seasar.extension.dbcp.impl.XADataSourceImpl xaDataSourceImpl = (org.seasar.extension.dbcp.impl.XADataSourceImpl) xaDataSource; - final String driverClassName = xaDataSourceImpl - .getDriverClassName(); - final String url = xaDataSourceImpl.getURL(); - final String user = xaDataSourceImpl.getUser(); - sb.append(" [XADataSource]:").append(getLineSeparator()); - sb.append(" driver = " + driverClassName).append( - getLineSeparator()); - sb.append(" url = " + url).append(getLineSeparator()); - sb.append(" user = " + user); - } - _log.info("{Injection Information}" + getLineSeparator() + sb); - } - - protected void handleSqlLogRegistry() { - final StringBuilder sb = new StringBuilder(); - sb.append("{SqlLog Information}").append(getLineSeparator()); - sb.append(" [SqlLogRegistry]").append(getLineSeparator()); - if (DBFluteConfig.getInstance().isUseSqlLogRegistry()) { - if (InternalSqlLogRegistry.setupSqlLogRegistry()) { - sb - .append( - " ...Setting up SqlLogRegistry(org.seasar.extension.jdbc)!") - .append(getLineSeparator()); - sb - .append(" Because the property 'useSqlLogRegistry' of the config of DBFlute is true."); - } else { - sb - .append(" SqlLogRegistry(org.seasar.extension.jdbc) is not supported at the version!"); - } - } else { - final Object sqlLogRegistry = InternalSqlLogRegistry - .findContainerSqlLogRegistry(); - if (sqlLogRegistry != null) { - InternalSqlLogRegistry.closeRegistration(); - sb - .append( - " SqlLogRegistry(org.seasar.extension.jdbc) is close! It's default for DBFlute.") - .append(getLineSeparator()); - sb - .append(" If you want to use this, set SqlLogRegistry to SqlLogRegistryLocator at yourself."); - } else { - sb - .append(" SqlLogRegistry(org.seasar.extension.jdbc) is not available!"); - } - } - _log.info(sb); - } - - // ----------------------------------------------------- - // Database Product Name - // --------------------- - protected void initializeDatabaseProductNameOfContext( - javax.sql.XADataSource xaDataSource) { - if (getDatabaseProductNameFromContext() != null) { - return; - } - - // From JDBC Driver! - if (xaDataSource != null - && xaDataSource instanceof org.seasar.extension.dbcp.impl.XADataSourceImpl) { - final org.seasar.extension.dbcp.impl.XADataSourceImpl xaDataSourceImpl = (org.seasar.extension.dbcp.impl.XADataSourceImpl) xaDataSource; - final String driverClassName = xaDataSourceImpl - .getDriverClassName(); - if (driverClassName != null) { - if (setupDatabaseProductNameByDriverClassName(driverClassName)) { - _log - .info("...Initializing database product name from driverClassName: " - + getDatabaseProductNameFromContext()); - return; - } - } - } - - _log.info("...Initializing database product name as default: H2"); - setDatabaseProductNameToContext("H2"); - } - - protected String getDatabaseProductNameFromContext() { - return ConditionBeanContext.getDatabaseProductName(); - } - - protected void setDatabaseProductNameToContext(String name) { - ConditionBeanContext.setDatabaseProductName(name); - } - - protected boolean setupDatabaseProductNameByDriverClassName( - String driverClassName) { - return ConditionBeanContext - .setupDatabaseProductNameByDriverClassName(driverClassName); - } - - //========================================================================== - // ========= - // Implementation - // ============== - @SuppressWarnings("unchecked") - public DaoMetaData getDaoMetaData(final Class daoClass) { - if (!initialized) { - DisposableUtil.add(this); - initialized = true; - } - final String key = daoClass.getName(); - - // [A] - DaoMetaData dmd = getSynchronizedDaoMetaDataCache(key); - - // [B] - if (dmd != null) { - return dmd; - } - - // [C] - synchronized (_daoMetaDataInitializationLockMonitor) {// One Thread Only - // Entered - // [D] - dmd = getSynchronizedDaoMetaDataCache(key); - // [E] - if (dmd != null) { - // The second thread that stops at [C] can find - // because the first thread have already initialized. - if (_log.isDebugEnabled()) { - _log - .debug("...Getting daoMetaData as cache because the previous thread have already initilized."); - } - return dmd; - } - // [F] - if (_log.isDebugEnabled()) { - _log.debug("...Creating daoMetaData for " - + daoClass.getSimpleName() + "."); - } - final DaoMetaData dmdi = createDaoMetaData(daoClass); - putSynchronizedDaoMetaDataCache(key, dmdi); - } - // [G] - dmd = getSynchronizedDaoMetaDataCache(key); - if (dmd != null) { - return dmd; - } - String msg = "The cache should have data meta data here: key=" + key - + " cache=" + daoMetaDataCache; - throw new IllegalStateException(msg); - } - - @SuppressWarnings("unchecked") - protected void putSynchronizedDaoMetaDataCache(String key, DaoMetaData dmd) { - synchronized (daoMetaDataCache) { - daoMetaDataCache.put(key, dmd); - } - } - - protected DaoMetaData getSynchronizedDaoMetaDataCache(String key) { - DaoMetaData dmd = null; - synchronized (daoMetaDataCache) { - dmd = (DaoMetaData) daoMetaDataCache.get(key); - } - return dmd; - } - - //========================================================================== - // ========= - // DataMetaData Creation - // ===================== - protected DaoMetaData createDaoMetaData(final Class daoClass) { - final BeanDesc daoBeanDesc = BeanDescFactory.getBeanDesc(daoClass); - final DaoAnnotationReader daoAnnotationReader = annotationReaderFactory - .createDaoAnnotationReader(daoBeanDesc); - - final DaoMetaDataImpl daoMetaData = createDaoMetaDataExtension(); - daoMetaData.setDaoClass(daoClass); - daoMetaData.setDataSource(dataSource); - daoMetaData.setStatementFactory(createCustomizeStatememtFactory()); - daoMetaData.setResultSetFactory(createCustomizeResultSetFactory()); - daoMetaData.setValueTypeFactory(valueTypeFactory); - daoMetaData.setBeanMetaDataFactory(getBeanMetaDataFactory()); - daoMetaData.setDaoNamingConvention(getDaoNamingConvention()); - daoMetaData.setUseDaoClassForLog(useDaoClassForLog); - daoMetaData.setDaoAnnotationReader(daoAnnotationReader); - daoMetaData.setProcedureMetaDataFactory(procedureMetaDataFactory); - daoMetaData.setDtoMetaDataFactory(dtoMetaDataFactory); - daoMetaData.setResultSetHandlerFactory(resultSetHandlerFactory); - if (sqlFileEncoding != null) { - daoMetaData.setSqlFileEncoding(sqlFileEncoding); - } - if (pagingSqlRewriter != null) { - daoMetaData.setPagingSQLRewriter(pagingSqlRewriter); - } - daoMetaData.initialize(); - return daoMetaData; - } - - protected S2DaoMetaDataExtension createDaoMetaDataExtension() { - final S2DaoMetaDataExtension dmdExtension = newDaoMetaDataExtension(); - dmdExtension.setBeanEnhancer(beanEnhancer); - dmdExtension.setAnnotationReaderFactory(this.annotationReaderFactory); - dmdExtension.setColumnNaming(this.columnNaming); - dmdExtension - .setPropertyTypeFactoryBuilder(this.propertyTypeFactoryBuilder); - dmdExtension - .setRelationPropertyTypeFactoryBuilder(this.relationPropertyTypeFactoryBuilder); - dmdExtension.setTableNaming(tableNaming); - dmdExtension.setInternalDebug(DBFluteConfig.getInstance() - .isInternalDebug()); - return dmdExtension; - } - - protected S2DaoMetaDataExtension newDaoMetaDataExtension() { - return new S2DaoMetaDataExtension(); - } - - //========================================================================== - // ========= - // Result Set Factory - // ================== - /** - * Create the customize result set factory that is for all SQL on DBFlute. - * - * @return The customize statement factory. (NotNull) - */ - protected ResultSetFactory createCustomizeResultSetFactory() { - return new FetchNarrowingResultSetFactory(); - } - - //========================================================================== - // ========= - // Statement Factory - // ================= - /** - * Create the customize statement factory that is for all SQL on DBFlute. - * - * @return The customize statement factory. (NotNull) - */ - protected StatementFactory createCustomizeStatememtFactory() { - final StatementConfig defaultStatementConfig = DBFluteConfig - .getInstance().getDefaultStatementConfig(); - final boolean internalDebug = DBFluteConfig.getInstance() - .isInternalDebug(); - return new StatementFactory() { - public PreparedStatement createPreparedStatement(Connection con, - String sql) { - try { - final StatementConfig config = findStatementConfigOnThread(); - ; - final int resultSetType; - if (config != null && config.hasResultSetType()) { - resultSetType = config.getResultSetType(); - } else if (defaultStatementConfig != null - && defaultStatementConfig.hasResultSetType()) { - resultSetType = defaultStatementConfig - .getResultSetType(); - } else { - resultSetType = java.sql.ResultSet.TYPE_FORWARD_ONLY; - } - final int resultSetConcurrency = java.sql.ResultSet.CONCUR_READ_ONLY; - if (internalDebug) { - _log.debug("...Creating prepareStatement(sql, " - + resultSetType + ", " + resultSetConcurrency - + ")"); - } - final PreparedStatement ps = con.prepareStatement(sql, - resultSetType, resultSetConcurrency); - if (config != null && config.hasStatementOptions()) { - if (internalDebug) { - _log - .debug("...Setting statement config as request: " - + config); - } - reflectStatementOptions(config, ps); - } else { - reflectDefaultOptionsToStatementIfNeeds(ps); - } - return ps; - } catch (SQLException e) { - handleSQLException(e, null); - return null;// Unreachable! - } - } - - public CallableStatement createCallableStatement(Connection conn, - String sql) { - return prepareCall(conn, sql); - } - - protected StatementConfig findStatementConfigOnThread() { - final StatementConfig config; - if (ConditionBeanContext.isExistConditionBeanOnThread()) { - final ConditionBean cb = ConditionBeanContext - .getConditionBeanOnThread(); - config = cb.getStatementConfig(); - } else if (OutsideSqlContext.isExistOutsideSqlContextOnThread()) { - final OutsideSqlContext context = OutsideSqlContext - .getOutsideSqlContextOnThread(); - config = context.getStatementConfig(); - } else { - config = null; - } - return config; - } - - protected void reflectDefaultOptionsToStatementIfNeeds( - PreparedStatement ps) { - if (defaultStatementConfig != null - && defaultStatementConfig.hasStatementOptions()) { - if (internalDebug) { - _log.debug("...Setting statement config as default: " - + defaultStatementConfig); - } - reflectStatementOptions(defaultStatementConfig, ps); - return; - } - } - - protected void reflectStatementOptions(StatementConfig config, - PreparedStatement ps) { - try { - if (config.hasQueryTimeout()) { - ps.setQueryTimeout(config.getQueryTimeout()); - } - if (config.hasFetchSize()) { - ps.setFetchSize(config.getFetchSize()); - } - if (config.hasMaxRows()) { - ps.setMaxRows(config.getMaxRows()); - } - } catch (SQLException e) { - handleSQLException(e, ps); - } - } - - protected CallableStatement prepareCall(Connection conn, String sql) { - try { - return conn.prepareCall(sql); - } catch (SQLException e) { - handleSQLException(e, null); - return null;// Unreachable! - } - } - - protected void handleSQLException(SQLException e, - Statement statement) { - new SQLExceptionHandler().handleSQLException(e, statement); - } - }; - } - - //========================================================================== - // ========= - // Dispose - // ======= - public synchronized void dispose() { - daoMetaDataCache.clear(); - initialized = false; - } - - //========================================================================== - // ========= - // Helper - // ====== - /** - * Get the value of line separator. - * - * @return The value of line separator. (NotNull) - */ - protected static String getLineSeparator() { - return System.getProperty("line.separator"); - } - - //========================================================================== - // ========= - // Accessor - // ======== - // ----------------------------------------------------- - // Factory Basic - // ------------- - public void setValueTypeFactory(final ValueTypeFactory valueTypeFactory) { - this.valueTypeFactory = valueTypeFactory; - } - - protected BeanMetaDataFactory getBeanMetaDataFactory() { - return beanMetaDataFactory; - } - - public void setBeanMetaDataFactory( - final BeanMetaDataFactory beanMetaDataFactory) { - this.beanMetaDataFactory = beanMetaDataFactory; - } - - public DaoNamingConvention getDaoNamingConvention() { - return daoNamingConvention; - } - - public void setDaoNamingConvention( - final DaoNamingConvention daoNamingConvention) { - this.daoNamingConvention = daoNamingConvention; - } - - public void setAnnotationReaderFactory( - final AnnotationReaderFactory annotationReaderFactory) { - this.annotationReaderFactory = annotationReaderFactory; - } - - public void setDataSource(final DataSource dataSource) { - this.dataSource = dataSource; - } - - public void setUseDaoClassForLog(final boolean userDaoClassForLog) { - useDaoClassForLog = userDaoClassForLog; - } - - public void setResultSetHandlerFactory( - final ResultSetHandlerFactory resultSetHandlerFactory) { - this.resultSetHandlerFactory = resultSetHandlerFactory; - } - - public void setDtoMetaDataFactory( - final DtoMetaDataFactory dtoMetaDataFactory) { - this.dtoMetaDataFactory = dtoMetaDataFactory; - } - - public void setProcedureMetaDataFactory( - ProcedureMetaDataFactory procedureMetaDataFactory) { - this.procedureMetaDataFactory = procedureMetaDataFactory; - } - - public void setPagingSQLRewriter(final PagingSqlRewriter pagingSqlRewriter) { - this.pagingSqlRewriter = pagingSqlRewriter; - } - - public String getSqlFileEncoding() { - return sqlFileEncoding; - } - - public void setSqlFileEncoding(final String encoding) { - sqlFileEncoding = encoding; - } - - public BeanEnhancer getBeanEnhancer() { - return beanEnhancer; - } - - public void setBeanEnhancer(final BeanEnhancer beanEnhancer) { - this.beanEnhancer = beanEnhancer; - } - - // ----------------------------------------------------- - // Version After 1.0.47 - // -------------------- - public ColumnNaming getColumnNaming() { - return columnNaming; - } - - public void setColumnNaming(final ColumnNaming columnNaming) { - this.columnNaming = columnNaming; - } - - public PropertyTypeFactoryBuilder getPropertyTypeFactoryBuilder() { - return propertyTypeFactoryBuilder; - } - - public void setPropertyTypeFactoryBuilder( - final PropertyTypeFactoryBuilder propertyTypeFactoryBuilder) { - this.propertyTypeFactoryBuilder = propertyTypeFactoryBuilder; - } - - public RelationPropertyTypeFactoryBuilder getRelationPropertyTypeFactoryBuilder() { - return relationPropertyTypeFactoryBuilder; - } - - public void setRelationPropertyTypeFactoryBuilder( - final RelationPropertyTypeFactoryBuilder relationPropertyTypeFactoryBuilder) { - this.relationPropertyTypeFactoryBuilder = relationPropertyTypeFactoryBuilder; - } - - public TableNaming getTableNaming() { - return tableNaming; - } - - public void setTableNaming(final TableNaming tableNaming) { - this.tableNaming = tableNaming; - } -} \ No newline at end of file Deleted: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/s2dao/S2DaoPropertyTypeFactoryBuilderExtension.java =================================================================== --- timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/s2dao/S2DaoPropertyTypeFactoryBuilderExtension.java 2008-12-27 22:20:25 UTC (rev 1631) +++ timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/s2dao/S2DaoPropertyTypeFactoryBuilderExtension.java 2008-12-27 22:20:45 UTC (rev 1632) @@ -1,215 +0,0 @@ -package jp.sf.pal.timecard.db.allcommon.s2dao; - -import java.sql.DatabaseMetaData; -import java.util.ArrayList; -import java.util.List; - -import jp.sf.pal.timecard.db.allcommon.Entity; -import jp.sf.pal.timecard.db.allcommon.dbmeta.DBMeta; - -import org.seasar.dao.BeanAnnotationReader; -import org.seasar.dao.ColumnNaming; -import org.seasar.dao.Dbms; -import org.seasar.dao.PropertyTypeFactory; -import org.seasar.dao.PropertyTypeFactoryBuilder; -import org.seasar.dao.ValueTypeFactory; -import org.seasar.dao.impl.AbstractPropertyTypeFactory; -import org.seasar.extension.jdbc.PropertyType; -import org.seasar.framework.beans.BeanDesc; -import org.seasar.framework.beans.PropertyDesc; - -/** - * The factory builder of property type for S2Dao. {Since S2Dao-1.0.47} - * - * @author DBFlute(AutoGenerator) - */ - ¡÷ SuppressWarnings("unchecked") -public class 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 list = new ArrayList(); - final BeanDesc beanDesc = getBeanDesc(); - for (int i = 0; i < beanDesc.getPropertyDescSize(); ++i) { - final PropertyDesc pd = beanDesc.getPropertyDesc(i); - - // Read-only property is unnecessary! - if (!pd.hasWriteMethod()) { - continue; - } - - // Relation property is unnecessary! - if (isRelation(pd)) { - continue; - } - - final PropertyType pt = createPropertyType(pd); - pt.setPrimaryKey(isPrimaryKey(pd)); - pt.setPersistent(isPersistent(pt)); - list.add(pt); - } - return list.toArray(new PropertyType[list.size()]); - } - - @Override - protected boolean isRelation(PropertyDesc propertyDesc) { - final String propertyName = propertyDesc.getPropertyName(); - if (hasDBMeta() - && (_dbmeta.hasForeign(propertyName) || _dbmeta - .hasReferrer(propertyName))) { - return true; - } - return hasRelationNoAnnotation(propertyDesc); - } - - protected boolean hasRelationNoAnnotation(PropertyDesc propertyDesc) { - return beanAnnotationReader.hasRelationNo(propertyDesc); - } - - @Override - protected boolean isPrimaryKey(PropertyDesc propertyDesc) { - final String propertyName = propertyDesc.getPropertyName(); - if (hasDBMeta() && _dbmeta.hasPrimaryKey() - && _dbmeta.hasColumn(propertyName)) { - if (_dbmeta.findColumnInfo(propertyName).isPrimary()) { - return true; - } - } - return hasIdAnnotation(propertyDesc); - } - - protected boolean hasIdAnnotation(PropertyDesc propertyDesc) { - final Dbms dbms = getDbms(); - return beanAnnotationReader.getId(propertyDesc, dbms) != null; - } - - @Override - protected boolean isPersistent(PropertyType propertyType) { - final String propertyName = propertyType.getPropertyName(); - final PropertyDesc propertyDesc = propertyType.getPropertyDesc(); - if ((hasDBMeta() && _dbmeta.hasColumn(propertyName)) - || hasColumnAnnotation(propertyDesc)) { - if (!isElementOfNoPersistentProps(propertyDesc)) { - return true; - } - } - return false; - } - - protected boolean hasColumnAnnotation(PropertyDesc propertyDesc) { - return beanAnnotationReader.getColumnAnnotation(propertyDesc) != null; - } - - protected boolean isElementOfNoPersistentProps(PropertyDesc propertyDesc) { - final String propertyName = propertyDesc.getPropertyName(); - final String[] props = _noPersisteneProps; - if (props != null && props.length >= 0) { - for (int i = 0; i < props.length; ++i) { - if (props[i].equals(propertyName)) { - return true; - } - } - } - return false; - } - } - - //========================================================================== - // ========= - // Accessor - // ======== - public ValueTypeFactory getValueTypeFactory() { - return valueTypeFactory; - } - - public void setValueTypeFactory(ValueTypeFactory valueTypeFactory) { - this.valueTypeFactory = valueTypeFactory; - } - - public ColumnNaming getColumnNaming() { - return columnNaming; - } - - public void setColumnNaming(ColumnNaming columnNaming) { - this.columnNaming = columnNaming; - } -} Deleted: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/s2dao/S2DaoSelectDynamicCommand.java =================================================================== --- timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/s2dao/S2DaoSelectDynamicCommand.java 2008-12-27 22:20:25 UTC (rev 1631) +++ timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/s2dao/S2DaoSelectDynamicCommand.java 2008-12-27 22:20:45 UTC (rev 1632) @@ -1,491 +0,0 @@ -package jp.sf.pal.timecard.db.allcommon.s2dao; - -import java.util.ArrayList; -import java.util.List; - -import javax.sql.DataSource; - -import jp.sf.pal.timecard.db.allcommon.cbean.ConditionBean; -import jp.sf.pal.timecard.db.allcommon.cbean.ConditionBeanContext; -import jp.sf.pal.timecard.db.allcommon.cbean.outsidesql.OutsideSqlContext; -import jp.sf.pal.timecard.db.allcommon.s2dao.internal.sqlcommand.InternalAbstractDynamicCommand; -import jp.sf.pal.timecard.db.allcommon.s2dao.internal.sqlhandler.InternalBasicSelectHandler; -import jp.sf.pal.timecard.db.allcommon.util.SimpleStringUtil; -import jp.sf.pal.timecard.db.allcommon.util.SimpleSystemUtil; - -import org.seasar.dao.CommandContext; -import org.seasar.extension.jdbc.ResultSetHandler; -import org.seasar.extension.jdbc.StatementFactory; -import org.seasar.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 bindVariableList = new ArrayList(4); - final List bindVariableTypeList = new ArrayList(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 bindVariableList = new java.util.ArrayList(); - final java.util.List bindVariableTypeList = new java.util.ArrayList(); - 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.timecard.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.timecard.db.allcommon.jdbc.CursorHandler) { - final jp.sf.pal.timecard.db.allcommon.jdbc.CursorHandler cursorHandler = (jp.sf.pal.timecard.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 bindVariableList, List 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 bindVariableList, List 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 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 bindVariableList, List bindVariableTypeList) { - final Object[] bindVariables = ctx.getBindVariables(); - addBindVariableList(bindVariableList, bindVariables); - final Class[] bindVariableTypes = ctx.getBindVariableTypes(); - addBindVariableTypeList(bindVariableTypeList, bindVariableTypes); - } - - protected void addBindVariableList(List bindVariableList, - Object[] bindVariables) { - for (int i = 0; i < bindVariables.length; i++) { - bindVariableList.add(bindVariables[i]); - } - } - - protected void addBindVariableTypeList(List 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 From svnnotify ¡÷ sourceforge.jp Sun Dec 28 07:21:53 2008 From: svnnotify ¡÷ sourceforge.jp (svnnotify ¡÷ sourceforge.jp) Date: Sun, 28 Dec 2008 07:21:53 +0900 Subject: [pal-cvs 3898] [1633] added status column to userinfo table. Message-ID: <1230416513.253842.20406.nullmailer@users.sourceforge.jp> Revision: 1633 http://svn.sourceforge.jp/view?root=pal&view=rev&rev=1633 Author: shinsuke Date: 2008-12-28 07:21:53 +0900 (Sun, 28 Dec 2008) Log Message: ----------- added status column to userinfo table. replaced with dbflute 0.8.7. Modified Paths: -------------- todolist/trunk/dbflute/_project.bat todolist/trunk/dbflute/_project.sh todolist/trunk/dbflute/build-todolist.properties todolist/trunk/mydbflute/README.txt todolist/trunk/src/main/config/erd/todolist.erd todolist/trunk/src/main/config/sql/todolist.ddl todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/BehaviorSelector.java todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/CacheBehaviorSelector.java todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/DBFluteConfig.java todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/EntityDefinedCommonColumn.java todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/bhv/AbstractBehaviorReadable.java todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/bhv/AbstractBehaviorWritable.java todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/bhv/BehaviorReadable.java todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/bhv/BehaviorWritable.java todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/cbean/AbstractConditionBean.java todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/cbean/AbstractConditionQuery.java todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/cbean/ConditionBean.java todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/cbean/ConditionBeanContext.java todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/cbean/ConditionQuery.java todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/cbean/ckey/ConditionKey.java todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/cbean/coption/FromToOption.java todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/cbean/coption/LikeSearchOption.java todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/cbean/cvalue/ConditionValue.java todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/cbean/outsidesql/OutsideSqlContext.java todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/cbean/outsidesql/OutsideSqlOption.java todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/cbean/outsidesql/executor/OutsideSqlBasicExecutor.java todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/cbean/outsidesql/executor/OutsideSqlCursorExecutor.java todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/cbean/outsidesql/executor/OutsideSqlEntityExecutor.java todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/cbean/outsidesql/executor/OutsideSqlPagingExecutor.java todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/cbean/sqlclause/AbstractSqlClause.java todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/cbean/sqlclause/SqlClause.java todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/cbean/sqlclause/SqlClauseOracle.java todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/dbmeta/AbstractDBMeta.java todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/dbmeta/DBMeta.java todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/dbmeta/DBMetaInstanceHandler.java todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/dbmeta/hierarchy/HierarchyArranger.java todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/dbmeta/hierarchy/HierarchyRequest.java todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/dbmeta/hierarchy/HierarchyRequestElement.java todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/dbmeta/hierarchy/HierarchySourceColumn.java todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/dbmeta/hierarchy/HierarchySourceIterator.java todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/dbmeta/hierarchy/HierarchySourceRow.java todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/dbmeta/info/ColumnInfo.java todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/dbmeta/info/RelationInfo.java todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/helper/MapStringBuilderImpl.java todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/s2dao/FetchNarrowingResultSetWrapper.java todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/s2dao/internal/rshandler/InternalAbstractDtoMetaDataResultSetHandler.java todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/s2dao/internal/sqlcommand/InternalAbstractAutoStaticCommand.java todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/s2dao/internal/sqlcommand/InternalAbstractBatchAutoStaticCommand.java todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/s2dao/internal/sqlcommand/InternalAbstractDynamicCommand.java todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/s2dao/internal/sqlcommand/InternalAbstractSqlCommand.java todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/s2dao/internal/sqlcommand/InternalDeleteAutoStaticCommand.java todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/s2dao/internal/sqlcommand/InternalDeleteBatchAutoStaticCommand.java todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/s2dao/internal/sqlcommand/InternalDeleteQueryAutoDynamicCommand.java todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/s2dao/internal/sqlcommand/InternalInsertAutoDynamicCommand.java todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/s2dao/internal/sqlcommand/InternalInsertBatchAutoStaticCommand.java todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/s2dao/internal/sqlcommand/InternalProcedureCommand.java todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/s2dao/internal/sqlcommand/InternalUpdateAutoDynamicCommand.java todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/s2dao/internal/sqlcommand/InternalUpdateBatchAutoStaticCommand.java todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/s2dao/internal/sqlcommand/InternalUpdateDynamicCommand.java todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/s2dao/internal/sqlcommand/InternalUpdateQueryAutoDynamicCommand.java todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/s2dao/internal/sqlhandler/InternalAbstractAutoHandler.java todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/s2dao/internal/sqlhandler/InternalAbstractBatchAutoHandler.java todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/s2dao/internal/sqlhandler/InternalBasicHandler.java todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/s2dao/internal/sqlhandler/InternalBasicSelectHandler.java todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/s2dao/internal/sqlhandler/InternalBasicUpdateHandler.java todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/s2dao/internal/sqlhandler/InternalInsertAutoHandler.java todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/s2dao/internal/sqlhandler/InternalInsertBatchAutoHandler.java todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/s2dao/internal/sqlhandler/InternalProcedureHandler.java todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/s2dao/internal/sqlhandler/InternalUpdateAutoHandler.java todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/s2dao/internal/sqlparser/InternalSqlParser.java todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/s2dao/internal/various/InternalProcedureMetaDataFactory.java todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/util/SimpleAssertUtil.java todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/util/SimpleStringUtil.java todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/util/SimpleSystemUtil.java todolist/trunk/src/main/java/jp/sf/pal/todolist/db/bsbhv/BsGroupInfoBhv.java todolist/trunk/src/main/java/jp/sf/pal/todolist/db/bsbhv/BsGroupMappingBhv.java todolist/trunk/src/main/java/jp/sf/pal/todolist/db/bsbhv/BsRoleInfoBhv.java todolist/trunk/src/main/java/jp/sf/pal/todolist/db/bsbhv/BsRoleMappingBhv.java todolist/trunk/src/main/java/jp/sf/pal/todolist/db/bsbhv/BsTodoBhv.java todolist/trunk/src/main/java/jp/sf/pal/todolist/db/bsbhv/BsTodoCategoryBhv.java todolist/trunk/src/main/java/jp/sf/pal/todolist/db/bsbhv/BsTodoMappingBhv.java todolist/trunk/src/main/java/jp/sf/pal/todolist/db/bsbhv/BsUserInfoBhv.java todolist/trunk/src/main/java/jp/sf/pal/todolist/db/bsentity/BsGroupInfo.java todolist/trunk/src/main/java/jp/sf/pal/todolist/db/bsentity/BsGroupMapping.java todolist/trunk/src/main/java/jp/sf/pal/todolist/db/bsentity/BsRoleInfo.java todolist/trunk/src/main/java/jp/sf/pal/todolist/db/bsentity/BsRoleMapping.java todolist/trunk/src/main/java/jp/sf/pal/todolist/db/bsentity/BsTodo.java todolist/trunk/src/main/java/jp/sf/pal/todolist/db/bsentity/BsTodoCategory.java todolist/trunk/src/main/java/jp/sf/pal/todolist/db/bsentity/BsTodoMapping.java todolist/trunk/src/main/java/jp/sf/pal/todolist/db/bsentity/BsUserInfo.java todolist/trunk/src/main/java/jp/sf/pal/todolist/db/bsentity/dbmeta/GroupInfoDbm.java todolist/trunk/src/main/java/jp/sf/pal/todolist/db/bsentity/dbmeta/GroupMappingDbm.java todolist/trunk/src/main/java/jp/sf/pal/todolist/db/bsentity/dbmeta/RoleInfoDbm.java todolist/trunk/src/main/java/jp/sf/pal/todolist/db/bsentity/dbmeta/RoleMappingDbm.java todolist/trunk/src/main/java/jp/sf/pal/todolist/db/bsentity/dbmeta/TodoCategoryDbm.java todolist/trunk/src/main/java/jp/sf/pal/todolist/db/bsentity/dbmeta/TodoDbm.java todolist/trunk/src/main/java/jp/sf/pal/todolist/db/bsentity/dbmeta/TodoMappingDbm.java todolist/trunk/src/main/java/jp/sf/pal/todolist/db/bsentity/dbmeta/UserInfoDbm.java todolist/trunk/src/main/java/jp/sf/pal/todolist/db/cbean/bs/BsGroupInfoCB.java todolist/trunk/src/main/java/jp/sf/pal/todolist/db/cbean/bs/BsGroupMappingCB.java todolist/trunk/src/main/java/jp/sf/pal/todolist/db/cbean/bs/BsRoleInfoCB.java todolist/trunk/src/main/java/jp/sf/pal/todolist/db/cbean/bs/BsRoleMappingCB.java todolist/trunk/src/main/java/jp/sf/pal/todolist/db/cbean/bs/BsTodoCB.java todolist/trunk/src/main/java/jp/sf/pal/todolist/db/cbean/bs/BsTodoCategoryCB.java todolist/trunk/src/main/java/jp/sf/pal/todolist/db/cbean/bs/BsTodoMappingCB.java todolist/trunk/src/main/java/jp/sf/pal/todolist/db/cbean/bs/BsUserInfoCB.java todolist/trunk/src/main/java/jp/sf/pal/todolist/db/cbean/cq/bs/AbstractBsGroupInfoCQ.java todolist/trunk/src/main/java/jp/sf/pal/todolist/db/cbean/cq/bs/AbstractBsGroupMappingCQ.java todolist/trunk/src/main/java/jp/sf/pal/todolist/db/cbean/cq/bs/AbstractBsRoleInfoCQ.java todolist/trunk/src/main/java/jp/sf/pal/todolist/db/cbean/cq/bs/AbstractBsRoleMappingCQ.java todolist/trunk/src/main/java/jp/sf/pal/todolist/db/cbean/cq/bs/AbstractBsTodoCQ.java todolist/trunk/src/main/java/jp/sf/pal/todolist/db/cbean/cq/bs/AbstractBsTodoCategoryCQ.java todolist/trunk/src/main/java/jp/sf/pal/todolist/db/cbean/cq/bs/AbstractBsTodoMappingCQ.java todolist/trunk/src/main/java/jp/sf/pal/todolist/db/cbean/cq/bs/AbstractBsUserInfoCQ.java todolist/trunk/src/main/java/jp/sf/pal/todolist/db/cbean/cq/bs/BsGroupInfoCQ.java todolist/trunk/src/main/java/jp/sf/pal/todolist/db/cbean/cq/bs/BsGroupMappingCQ.java todolist/trunk/src/main/java/jp/sf/pal/todolist/db/cbean/cq/bs/BsRoleInfoCQ.java todolist/trunk/src/main/java/jp/sf/pal/todolist/db/cbean/cq/bs/BsRoleMappingCQ.java todolist/trunk/src/main/java/jp/sf/pal/todolist/db/cbean/cq/bs/BsTodoCQ.java todolist/trunk/src/main/java/jp/sf/pal/todolist/db/cbean/cq/bs/BsTodoCategoryCQ.java todolist/trunk/src/main/java/jp/sf/pal/todolist/db/cbean/cq/bs/BsTodoMappingCQ.java todolist/trunk/src/main/java/jp/sf/pal/todolist/db/cbean/cq/bs/BsUserInfoCQ.java todolist/trunk/src/main/java/jp/sf/pal/todolist/db/cbean/cq/ciq/GroupInfoCIQ.java todolist/trunk/src/main/java/jp/sf/pal/todolist/db/cbean/cq/ciq/GroupMappingCIQ.java todolist/trunk/src/main/java/jp/sf/pal/todolist/db/cbean/cq/ciq/RoleInfoCIQ.java todolist/trunk/src/main/java/jp/sf/pal/todolist/db/cbean/cq/ciq/RoleMappingCIQ.java todolist/trunk/src/main/java/jp/sf/pal/todolist/db/cbean/cq/ciq/TodoCIQ.java todolist/trunk/src/main/java/jp/sf/pal/todolist/db/cbean/cq/ciq/TodoCategoryCIQ.java todolist/trunk/src/main/java/jp/sf/pal/todolist/db/cbean/cq/ciq/TodoMappingCIQ.java todolist/trunk/src/main/java/jp/sf/pal/todolist/db/cbean/cq/ciq/UserInfoCIQ.java todolist/trunk/src/main/java/jp/sf/pal/todolist/db/cbean/nss/GroupInfoNss.java todolist/trunk/src/main/java/jp/sf/pal/todolist/db/cbean/nss/GroupMappingNss.java todolist/trunk/src/main/java/jp/sf/pal/todolist/db/cbean/nss/RoleInfoNss.java todolist/trunk/src/main/java/jp/sf/pal/todolist/db/cbean/nss/RoleMappingNss.java todolist/trunk/src/main/java/jp/sf/pal/todolist/db/cbean/nss/TodoCategoryNss.java todolist/trunk/src/main/java/jp/sf/pal/todolist/db/cbean/nss/TodoMappingNss.java todolist/trunk/src/main/java/jp/sf/pal/todolist/db/cbean/nss/TodoNss.java todolist/trunk/src/main/java/jp/sf/pal/todolist/db/cbean/nss/UserInfoNss.java todolist/trunk/src/main/resources/dbflute.dicon todolist/trunk/src/main/webapp/WEB-INF/db/todolist.1.log.db todolist/trunk/src/main/webapp/WEB-INF/db/todolist.data.db Added Paths: ----------- todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/CommonColumnAutoSetupper.java todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/CommonColumnBasicAutoSetupper.java todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/DBDef.java todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/bhv/core/ todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/bhv/core/BehaviorCommand.java todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/bhv/core/BehaviorCommandComponentSetup.java todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/bhv/core/BehaviorCommandInvoker.java todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/bhv/core/BehaviorInitializer.java todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/bhv/core/SqlExecution.java todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/bhv/core/SqlExecutionCreator.java todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/bhv/core/command/ todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/bhv/core/command/AbstractBehaviorCommand.java todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/bhv/core/command/AbstractEntityCommand.java todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/bhv/core/command/AbstractListEntityCommand.java todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/bhv/core/command/AbstractOutsideSqlCommand.java todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/bhv/core/command/AbstractOutsideSqlSelectCommand.java todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/bhv/core/command/AbstractSelectCBCommand.java todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/bhv/core/command/BatchDeleteEntityCommand.java todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/bhv/core/command/BatchDeleteNonstrictEntityCommand.java todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/bhv/core/command/BatchInsertEntityCommand.java todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/bhv/core/command/BatchUpdateEntityCommand.java todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/bhv/core/command/BatchUpdateNonstrictEntityCommand.java todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/bhv/core/command/DeleteEntityCommand.java todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/bhv/core/command/DeleteNonstrictEntityCommand.java todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/bhv/core/command/InsertEntityCommand.java todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/bhv/core/command/OutsideSqlCallCommand.java todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/bhv/core/command/OutsideSqlExecuteCommand.java todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/bhv/core/command/OutsideSqlSelectCursorCommand.java todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/bhv/core/command/OutsideSqlSelectListCommand.java todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/bhv/core/command/QueryDeleteCBCommand.java todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/bhv/core/command/QueryUpdateEntityCBCommand.java todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/bhv/core/command/SelectCountCBCommand.java todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/bhv/core/command/SelectListCBCommand.java todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/bhv/core/command/SelectNextValCommand.java todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/bhv/core/command/SelectScalarCBCommand.java todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/bhv/core/command/UpdateEntityCommand.java todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/bhv/core/command/UpdateNonstrictEntityCommand.java todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/bhv/core/execution/ todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/bhv/core/execution/BasicSelectExecution.java todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/bhv/core/execution/OutsideSqlSelectExecution.java todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/bhv/core/execution/SelectCBExecution.java todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/cbean/ScalarQuery.java todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/cbean/ckey/ConditionKeyNotLikeSearch.java todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/helper/StringKeyMap.java todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/helper/StringSet.java todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/s2dao/BeanMetaDataFactoryExtension.java todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/s2dao/PropertyTypeFactoryBuilderExtension.java todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/s2dao/SqlLogRegistryLatestSqlProvider.java todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/s2dao/internal/various/InternalIdentifierAbstractGenerator.java todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/s2dao/internal/various/InternalIdentifierAssignedGenerator.java todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/s2dao/internal/various/InternalIdentifierGeneratorFactory.java todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/s2dao/internal/various/InternalIdentifierIdentityGenerator.java todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/s2dao/internal/various/InternalIdentifierSequenceGenerator.java todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/s2dao/internal/various/InternalStatementFactory.java todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/util/SimpleResourceUtil.java todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/util/SimpleTypeUtil.java Removed Paths: ------------- todolist/trunk/src/main/java/jp/sf/pal/todolist/db/bsdao/ todolist/trunk/src/main/java/jp/sf/pal/todolist/db/exdao/ -------------- next part -------------- Modified: todolist/trunk/dbflute/_project.bat =================================================================== --- todolist/trunk/dbflute/_project.bat 2008-12-27 22:20:45 UTC (rev 1632) +++ todolist/trunk/dbflute/_project.bat 2008-12-27 22:21:53 UTC (rev 1633) @@ -2,4 +2,4 @@ set MY_PROJECT_NAME=todolist -set DBFLUTE_HOME=..\mydbflute\dbflute-0.8.2 +set DBFLUTE_HOME=..\mydbflute\dbflute-0.8.7 Modified: todolist/trunk/dbflute/_project.sh =================================================================== --- todolist/trunk/dbflute/_project.sh 2008-12-27 22:20:45 UTC (rev 1632) +++ todolist/trunk/dbflute/_project.sh 2008-12-27 22:21:53 UTC (rev 1633) @@ -2,4 +2,4 @@ export MY_PROJECT_NAME=todolist -export DBFLUTE_HOME=../mydbflute/dbflute-0.8.2 +export DBFLUTE_HOME=../mydbflute/dbflute-0.8.7 Modified: todolist/trunk/dbflute/build-todolist.properties =================================================================== --- todolist/trunk/dbflute/build-todolist.properties 2008-12-27 22:20:45 UTC (rev 1632) +++ todolist/trunk/dbflute/build-todolist.properties 2008-12-27 22:21:53 UTC (rev 1633) @@ -157,5 +157,5 @@ torque.additionalForeignKeyMap = map:{ \ } -#torque.isDeleteOldTableClass = true +torque.isDeleteOldTableClass = true Modified: todolist/trunk/mydbflute/README.txt =================================================================== --- todolist/trunk/mydbflute/README.txt 2008-12-27 22:20:45 UTC (rev 1632) +++ todolist/trunk/mydbflute/README.txt 2008-12-27 22:21:53 UTC (rev 1633) @@ -1,3 +1,3 @@ -$ mkdir dbflute-0.8.2 -$ cd dbflute-0.8.2 -$ unzip ../dbflute-0.8.2.zip +$ mkdir dbflute-0.8.7 +$ cd dbflute-0.8.7 +$ unzip ../dbflute-0.8.7.zip Modified: todolist/trunk/src/main/config/erd/todolist.erd =================================================================== --- todolist/trunk/src/main/config/erd/todolist.erd 2008-12-27 22:20:45 UTC (rev 1632) +++ todolist/trunk/src/main/config/erd/todolist.erd 2008-12-27 22:21:53 UTC (rev 1633) @@ -204,6 +204,22 @@ + status + Status + + VARCHAR + String + true + 12 + + 1 + false + false + + false + + + created_time Created Time @@ -233,7 +249,7 @@ updated_time Updated Time - + 10 true false @@ -255,7 +271,7 @@ deleted_time Deleted Time - + 10 false false @@ -292,6 +308,11 @@ + + 255 + 255 + 206 + 566 757 @@ -384,7 +405,7 @@ created_time Created Time - + 10 true false @@ -406,7 +427,7 @@ updated_time Updated Time - + 10 true false @@ -428,7 +449,7 @@ deleted_time Deleted Time - + 10 false false @@ -450,7 +471,7 @@ versionNo Version No. - + 10 true false @@ -460,6 +481,11 @@ + + 255 + 255 + 206 + 40 1277 @@ -529,6 +555,11 @@ + + 255 + 255 + 206 + 44 389 @@ -686,7 +717,7 @@ created_time Created Time - + 10 true false @@ -708,7 +739,7 @@ updated_time Updated Time - + 10 true false @@ -730,7 +761,7 @@ deleted_time Deleted Time - + 10 false false @@ -752,7 +783,7 @@ versionNo Version No. - + 10 true false @@ -762,6 +793,11 @@ + + 255 + 255 + 206 + 864 1277 @@ -826,6 +862,11 @@ + + 255 + 255 + 206 + 872 389 @@ -1087,6 +1128,11 @@ + + 255 + 255 + 206 + 580 40 @@ -1191,7 +1237,7 @@ created_time Created Time - + 10 true false @@ -1213,7 +1259,7 @@ updated_time Updated Time - + 10 true false @@ -1235,7 +1281,7 @@ deleted_time Deleted Time - + 10 false false @@ -1257,7 +1303,7 @@ versionNo Version No. - + 10 true false @@ -1267,6 +1313,11 @@ + + 255 + 255 + 206 + 305 389 @@ -1391,7 +1442,7 @@ created_time Created Time - + 10 true false @@ -1413,7 +1464,7 @@ updated_time Updated Time - + 10 true false @@ -1435,7 +1486,7 @@ deleted_time Deleted Time - + 10 false false @@ -1456,6 +1507,11 @@ + + 255 + 255 + 206 + 583 389 Modified: todolist/trunk/src/main/config/sql/todolist.ddl =================================================================== --- todolist/trunk/src/main/config/sql/todolist.ddl 2008-12-27 22:20:45 UTC (rev 1632) +++ todolist/trunk/src/main/config/sql/todolist.ddl 2008-12-27 22:21:53 UTC (rev 1633) @@ -7,9 +7,9 @@ DROP TABLE role_info; DROP TABLE group_info; -/********************************** -Table Name: Group Information -**********************************/ +/**********************************/ +/* Table Name: Group Information */ +/**********************************/ CREATE TABLE group_info( group_id VARCHAR(255) NOT NULL PRIMARY KEY, name VARCHAR(100), @@ -26,9 +26,9 @@ versionNo INTEGER NOT NULL ); -/********************************** -Table Name: Role Information -**********************************/ +/**********************************/ +/* Table Name: Role Information */ +/**********************************/ CREATE TABLE role_info( role_id VARCHAR(255) NOT NULL PRIMARY KEY, name VARCHAR(100), @@ -45,9 +45,9 @@ versionNo INTEGER NOT NULL ); -/********************************** -Table Name: User Information -**********************************/ +/**********************************/ +/* Table Name: User Information */ +/**********************************/ CREATE TABLE user_info( user_id VARCHAR(255) NOT NULL PRIMARY KEY, given_name VARCHAR(100), @@ -64,6 +64,7 @@ locale VARCHAR(5), role_id VARCHAR(255), group_id VARCHAR(255), + status VARCHAR(1), created_time TIMESTAMP NOT NULL, created_by VARCHAR(255) NOT NULL, updated_time TIMESTAMP NOT NULL, @@ -75,9 +76,9 @@ FOREIGN KEY (role_id) REFERENCES role_info (role_id) ); -/********************************** -Table Name: Group Mapping -**********************************/ +/**********************************/ +/* Table Name: Group Mapping */ +/**********************************/ CREATE TABLE group_mapping( id INTEGER NOT NULL IDENTITY PRIMARY KEY, user_id VARCHAR(255) NOT NULL, @@ -86,9 +87,9 @@ FOREIGN KEY (group_id) REFERENCES group_info (group_id) ); -/********************************** -Table Name: Role Mapping -**********************************/ +/**********************************/ +/* Table Name: Role Mapping */ +/**********************************/ CREATE TABLE role_mapping( id INT NOT NULL IDENTITY PRIMARY KEY, user_id VARCHAR(255) NOT NULL, @@ -97,9 +98,9 @@ FOREIGN KEY (role_id) REFERENCES role_info (role_id) ); -/********************************** -Table Name: ToDo -**********************************/ +/**********************************/ +/* Table Name: ToDo */ +/**********************************/ CREATE TABLE todo( id BIGINT(20) NOT NULL IDENTITY PRIMARY KEY, name VARCHAR(100) NOT NULL, @@ -118,9 +119,9 @@ FOREIGN KEY (created_by) REFERENCES user_info (user_id) ); -/********************************** -Table Name: ToDo Category -**********************************/ +/**********************************/ +/* Table Name: ToDo Category */ +/**********************************/ CREATE TABLE todo_category( id BIGINT(20) NOT NULL IDENTITY PRIMARY KEY, name VARCHAR(100) NOT NULL, @@ -135,9 +136,9 @@ FOREIGN KEY (user_id) REFERENCES user_info (user_id) ); -/********************************** -Table Name: ToDo Mapping -**********************************/ +/**********************************/ +/* Table Name: ToDo Mapping */ +/**********************************/ CREATE TABLE todo_mapping( id BIGINT(20) NOT NULL IDENTITY PRIMARY KEY, status INT NOT NULL, Modified: todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/BehaviorSelector.java =================================================================== --- todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/BehaviorSelector.java 2008-12-27 22:20:45 UTC (rev 1632) +++ todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/BehaviorSelector.java 2008-12-27 22:21:53 UTC (rev 1633) @@ -10,8 +10,7 @@ public interface BehaviorSelector { /** - * Initialize condition-bean meta data.
If you call this, Hot Deploy - * of OutsideSql becomes Cool! + * Initialize condition-bean meta data.
*/ public void initializeConditionBeanMetaData(); Modified: todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/CacheBehaviorSelector.java =================================================================== --- todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/CacheBehaviorSelector.java 2008-12-27 22:20:45 UTC (rev 1632) +++ todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/CacheBehaviorSelector.java 2008-12-27 22:21:53 UTC (rev 1633) @@ -1,8 +1,8 @@ package jp.sf.pal.todolist.db.allcommon; import java.util.Collection; -import java.util.LinkedHashMap; import java.util.Map; +import java.util.concurrent.ConcurrentHashMap; import jp.sf.pal.todolist.db.allcommon.bhv.BehaviorReadable; import jp.sf.pal.todolist.db.allcommon.dbmeta.DBMeta; @@ -31,15 +31,14 @@ // Attribute // ========= /** The cache of behavior. (It's the generic hell!) */ - protected Map, BehaviorReadable> _behaviorCache = new LinkedHashMap, BehaviorReadable>(); + protected Map, BehaviorReadable> _behaviorCache = new ConcurrentHashMap, BehaviorReadable>(); //========================================================================== // ========= // Initialize // ========== /** - * Initialize condition-bean meta data.
If you call this, Hot Deploy - * of OutsideSql becomes Cool! + * Initialize condition-bean meta data.
*/ public void initializeConditionBeanMetaData() { final Map dbmetaMap = DBMetaInstanceHandler @@ -53,8 +52,7 @@ } for (DBMeta dbmeta : dbmetas) { final BehaviorReadable bhv = byName(dbmeta.getTableDbName()); - final DaoReadable dao = bhv.getDaoReadable(); - dao.initializeDaoMetaData("selectList"); + bhv.warmUpCommand(); } if (_log.isInfoEnabled()) { long after = System.currentTimeMillis(); Added: todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/CommonColumnAutoSetupper.java =================================================================== --- todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/CommonColumnAutoSetupper.java (rev 0) +++ todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/CommonColumnAutoSetupper.java 2008-12-27 22:21:53 UTC (rev 1633) @@ -0,0 +1,25 @@ +package jp.sf.pal.todolist.db.allcommon; + +/** + * The auto set-upper of common column. + * + * @author DBFlute(AutoGenerator) + */ +public interface CommonColumnAutoSetupper { + + /** + * Handle common columns of insert if it needs. + * + * @param targetEntity Target entity that the type is entity interface. + * (NotNull) + */ + public void handleCommonColumnOfInsertIfNeeds(Entity targetEntity); + + /** + * Handle common columns of update if it needs. + * + * @param targetEntity Target entity that the type is entity interface. + * (NotNull) + */ + public void handleCommonColumnOfUpdateIfNeeds(Entity targetEntity); +} Property changes on: todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/CommonColumnAutoSetupper.java ___________________________________________________________________ Name: svn:eol-style + native Added: todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/CommonColumnBasicAutoSetupper.java =================================================================== --- todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/CommonColumnBasicAutoSetupper.java (rev 0) +++ todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/CommonColumnBasicAutoSetupper.java 2008-12-27 22:21:53 UTC (rev 1633) @@ -0,0 +1,31 @@ +package jp.sf.pal.todolist.db.allcommon; + +/** + * The basic implementation of the auto set-upper of common column. + * + * @author DBFlute(AutoGenerator) + */ +public class CommonColumnBasicAutoSetupper implements CommonColumnAutoSetupper { + + //========================================================================== + // =========== + // Set up + // ====== + /** + * Handle common columns of insert if it needs. + * + * @param targetEntity Target entity that the type is entity interface. + * (NotNull) + */ + public void handleCommonColumnOfInsertIfNeeds(Entity targetEntity) { + } + + /** + * Handle common columns of update if it needs. + * + * @param targetEntity Target entity that the type is entity interface. + * (NotNull) + */ + public void handleCommonColumnOfUpdateIfNeeds(Entity targetEntity) { + } +} Property changes on: todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/CommonColumnBasicAutoSetupper.java ___________________________________________________________________ Name: svn:eol-style + native Added: todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/DBDef.java =================================================================== --- todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/DBDef.java (rev 0) +++ todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/DBDef.java 2008-12-27 22:21:53 UTC (rev 1633) @@ -0,0 +1,179 @@ +package jp.sf.pal.todolist.db.allcommon; + +import java.util.Collections; +import java.util.HashMap; +import java.util.Iterator; +import java.util.Map; +import java.util.Set; + +/** + * The definition of database. + * + * @author DBFlute(AutoGenerator) + */ +public enum DBDef { + + //========================================================================== + // ========= + // ENUM + // ==== + MySQL("mysql", null), PostgreSQL("postgresql", "postgre"), Oracle("oracle", + null), DB2("db2", null), SQLServer("sqlserver", "mssql"), FireBird( + "firebird", null), H2("h2", null), Derby("derby", null), MSAccess( + "msaccess", null), Unknown("unknown", null); + + //========================================================================== + // ========= + // Static Reference + // ================ + // ----------------------------------------------------- + // Code Value + // ---------- + private static final Map _codeValueMap = new HashMap(); + static { + for (DBDef value : values()) { + _codeValueMap.put(value.code().toLowerCase(), value); + } + } + + private static final Map _codeAliasValueMap = new HashMap(); + static { + for (DBDef value : values()) { + if (value.codeAlias() != null) { + _codeAliasValueMap.put(value.codeAlias().toLowerCase(), value); + } + } + } + + /** + * @param code The code of the DB. (Nullable: If the code is null, it + * returns null) + * @return The instance that has the code. (Nullable) + */ + public static DBDef codeOf(String code) { + if (code == null) { + return null; + } + final String lowerCaseCode = code.toLowerCase(); + DBDef def = _codeValueMap.get(lowerCaseCode); + if (def == null) { + def = _codeAliasValueMap.get(lowerCaseCode); + } + return def; + } + + // ----------------------------------------------------- + // Driver Hint + // ----------- + private static final Map _driverHintMap; + static { + final Map tmpMap = new HashMap(); + tmpMap.put("mysql", MySQL); + tmpMap.put("postgresql", PostgreSQL); + tmpMap.put("oracle", Oracle); + tmpMap.put("db2", DB2); + tmpMap.put("sqlserver", SQLServer); + tmpMap.put("firebird", FireBird); + tmpMap.put("org.h2", H2); + tmpMap.put("org.apache.derby", Derby); + _driverHintMap = Collections.unmodifiableMap(tmpMap); + } + + public static DBDef byDriverClassName(String driverClassName) { + final Set keySet = _driverHintMap.keySet(); + for (final Iterator ite = keySet.iterator(); ite.hasNext();) { + final String driverHint = ite.next(); + if (driverClassName.indexOf(driverHint) >= 0) { + final DBDef dbdef = _driverHintMap.get(driverHint); + if (dbdef != null) { + return dbdef; + } + } + } + return null; + } + + //========================================================================== + // ========= + // Current Definition + // ================== + /** The current definition of database. (NotNull, Default 'Unknown') */ + private static DBDef _currentDef; + static { + _currentDef = codeOf("H2"); + if (_currentDef == null) { + _currentDef = Unknown; + } + } + + /** + * @return The current definition of database. (NotNull) + */ + public static DBDef getCurrentDef() { + return _currentDef; + } + + /** + * @param currentDef The current definition of database. (NotNull) + */ + public static void setCurrentDef(DBDef currentDef) { + if (currentDef == null) { + String msg = "The argument 'currentDef' should not be null at DBDef.setCurrentDef()"; + throw new IllegalArgumentException(msg); + } + _currentDef = currentDef; + } + + /** + * @param dbdef The definition of database. (NotNull) + * @return Is the definition of database current? + */ + public static boolean isCurrentDef(DBDef dbdef) { + if (dbdef == null) { + String msg = "The argument 'dbdef' should not be null at DBDef.isCurrentDef()"; + throw new IllegalArgumentException(msg); + } + return _currentDef != null ? _currentDef.equals(dbdef) : false; + } + + //========================================================================== + // ========= + // Attribute + // ========= + /** The code of the DB. (NotNull) */ + private String _code; + + /** The code alias of the DB. (Nullable) */ + private String _codeAlias; + + //========================================================================== + // ========= + // Constructor + // =========== + /** + * @param code The code of the DB. (NotNull) + * @param codeAlias The code alias of the DB. (Nullable) + */ + private DBDef(String code, String codeAlias) { + _code = code; + _codeAlias = codeAlias; + } + + //========================================================================== + // ========= + // Accessor + // ======== + /** + * @return The code of the DB. (NotNull) + */ + public String code() { + return _code; + } + + /** + * @return The code alias of the DB. (Nullable) + */ + private String codeAlias() { + return _codeAlias; + } +} Property changes on: todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/DBDef.java ___________________________________________________________________ Name: svn:eol-style + native Modified: todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/DBFluteConfig.java =================================================================== --- todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/DBFluteConfig.java 2008-12-27 22:20:45 UTC (rev 1632) +++ todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/DBFluteConfig.java 2008-12-27 22:21:53 UTC (rev 1633) @@ -24,10 +24,6 @@ // ========= protected StatementConfig _defaultStatementConfig; - protected boolean _conditionBeanFormatSql = true;// This is for - - // compatibility! - protected boolean _queryLogLevelInfo; protected boolean _executeStatusLogLevelInfo; @@ -36,10 +32,6 @@ protected UniqueConstraintDeterminator _uniqueConstraintDeterminator; - protected boolean _sqlExceptionOldStyleHandling = false;// This is for - - // compatibility! - protected String _logDateFormat; protected String _logTimestampFormat; @@ -92,27 +84,6 @@ //========================================================================== // ========= - // ConditionBean Format Sql - // ======================== - public boolean isConditionBeanFormatSql() { - return _conditionBeanFormatSql; - } - - /** - * @param conditionBeanFormatSql The value of the config. - * @deprecated This is for compatibility! - */ - public void setConditionBeanFormatSql(boolean conditionBeanFormatSql) { - assertNotLocked(); - if (_log.isInfoEnabled()) { - _log.info("...Setting conditionBeanFormatSql: " - + conditionBeanFormatSql); - } - _conditionBeanFormatSql = conditionBeanFormatSql; - } - - //========================================================================== - // ========= // Query Log Level Info // ==================== public boolean isQueryLogLevelInfo() { @@ -184,31 +155,8 @@ public boolean isUniqueConstraintException(Throwable t); } - // [DBFlute-0.7.7] //========================================================================== // ========= - // SQL Exception Old Style - // ======================= - public boolean isSqlExceptionOldStyleHandling() { - return _sqlExceptionOldStyleHandling; - } - - /** - * @param sqlExceptionOldStyleHandling The value of the config. - * @deprecated This is for compatibility! - */ - public void setSqlExceptionOldStyleHandling( - boolean sqlExceptionOldStyleHandling) { - assertNotLocked(); - if (_log.isInfoEnabled()) { - _log.info("...Setting sqlExceptionOldStyleHandling: " - + sqlExceptionOldStyleHandling); - } - _sqlExceptionOldStyleHandling = sqlExceptionOldStyleHandling; - } - - //========================================================================== - // ========= // Log Format // ========== public String getLogDateFormat() { @@ -303,7 +251,6 @@ // ============ public void clear() { // the only properties that update OK while executing _defaultStatementConfig = null; - _conditionBeanFormatSql = true; // as default _queryLogLevelInfo = false; _executeStatusLogLevelInfo = false; _useSqlLogRegistry = false; Modified: todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/EntityDefinedCommonColumn.java =================================================================== --- todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/EntityDefinedCommonColumn.java 2008-12-27 22:20:45 UTC (rev 1632) +++ todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/EntityDefinedCommonColumn.java 2008-12-27 22:21:53 UTC (rev 1633) @@ -8,6 +8,12 @@ public interface EntityDefinedCommonColumn extends Entity { /** + * Enable common column auto set up. {for after disable because the default + * is enabled} + */ + public void enableCommonColumnAutoSetup(); + + /** * Disable common column auto set up. */ public void disableCommonColumnAutoSetup(); Modified: todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/bhv/AbstractBehaviorReadable.java =================================================================== --- todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/bhv/AbstractBehaviorReadable.java 2008-12-27 22:20:45 UTC (rev 1632) +++ todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/bhv/AbstractBehaviorReadable.java 2008-12-27 22:21:53 UTC (rev 1633) @@ -11,10 +11,16 @@ import java.util.Set; import jp.sf.pal.todolist.db.allcommon.BehaviorSelector; -import jp.sf.pal.todolist.db.allcommon.DaoSelector; import jp.sf.pal.todolist.db.allcommon.Entity; import jp.sf.pal.todolist.db.allcommon.bhv.batch.TokenFileOutputOption; import jp.sf.pal.todolist.db.allcommon.bhv.batch.TokenFileOutputResult; +import jp.sf.pal.todolist.db.allcommon.bhv.core.BehaviorCommand; +import jp.sf.pal.todolist.db.allcommon.bhv.core.BehaviorCommandInvoker; +import jp.sf.pal.todolist.db.allcommon.bhv.core.command.AbstractBehaviorCommand; +import jp.sf.pal.todolist.db.allcommon.bhv.core.command.SelectCountCBCommand; +import jp.sf.pal.todolist.db.allcommon.bhv.core.command.SelectListCBCommand; +import jp.sf.pal.todolist.db.allcommon.bhv.core.command.SelectNextValCommand; +import jp.sf.pal.todolist.db.allcommon.bhv.core.command.SelectScalarCBCommand; import jp.sf.pal.todolist.db.allcommon.bhv.load.LoadReferrerOption; import jp.sf.pal.todolist.db.allcommon.bhv.setup.ValueLabelBox; import jp.sf.pal.todolist.db.allcommon.bhv.setup.ValueLabelSetupper; @@ -25,8 +31,9 @@ import jp.sf.pal.todolist.db.allcommon.cbean.PagingHandler; import jp.sf.pal.todolist.db.allcommon.cbean.PagingInvoker; import jp.sf.pal.todolist.db.allcommon.cbean.PagingResultBean; -import jp.sf.pal.todolist.db.allcommon.cbean.outsidesql.OutsideSqlDao; +import jp.sf.pal.todolist.db.allcommon.cbean.ScalarQuery; import jp.sf.pal.todolist.db.allcommon.cbean.outsidesql.executor.OutsideSqlBasicExecutor; +import jp.sf.pal.todolist.db.allcommon.cbean.sqlclause.SqlClause; import jp.sf.pal.todolist.db.allcommon.dbmeta.info.ColumnInfo; import jp.sf.pal.todolist.db.allcommon.helper.token.file.FileMakingHeaderInfo; import jp.sf.pal.todolist.db.allcommon.helper.token.file.FileMakingOption; @@ -35,11 +42,10 @@ import jp.sf.pal.todolist.db.allcommon.util.SimpleSystemUtil; /** - * The abstract class of behavior-readable. + * The abstract class of readable behavior. * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public abstract class AbstractBehaviorReadable implements BehaviorReadable { //========================================================================== @@ -50,13 +56,13 @@ * Behavior-selector instance. It's basically referred at loadReferrer. * (Required for loadReferrer) */ - protected BehaviorSelector _behaviorSelector; + protected BehaviorCommandInvoker _behaviorCommandInvoker; /** - * Dao-selector instance. It's basically referred at loadReferrer. (Required - * for OutsideSql) + * Behavior-selector instance. It's basically referred at loadReferrer. + * (Required for loadReferrer) */ - protected DaoSelector _daoSelector; + protected BehaviorSelector _behaviorSelector; //========================================================================== // =========== @@ -83,7 +89,7 @@ * @return Read count. (NotNull) */ public int readCount(ConditionBean cb) { - assertConditionBeanNotNull(cb); + assertCBNotNull(cb); return callReadCount(cb); } @@ -100,7 +106,7 @@ * When the entity has been duplicated. */ public Entity readEntity(ConditionBean cb) { - assertConditionBeanNotNull(cb); + assertCBNotNull(cb); final List ls = readList(cb); if (ls.isEmpty()) { return null; @@ -120,7 +126,7 @@ * When the entity has been duplicated. */ public Entity readEntityWithDeletedCheck(ConditionBean cb) { - assertConditionBeanNotNull(cb); + assertCBNotNull(cb); final List ls = readList(cb); assertEntityNotDeleted(ls, cb); assertEntitySelectedAsOne(ls, cb); @@ -133,7 +139,7 @@ // =========================== protected ENTITY helpSelectEntityInternally( CB cb, InternalSelectEntityCallback callback) { - assertConditionBeanNotNull(cb); + assertCBNotNull(cb); cb.checkSafetyResult(1); List ls = null; try { @@ -156,7 +162,7 @@ protected ENTITY helpSelectEntityWithDeletedCheckInternally( CB cb, InternalSelectEntityWithDeletedCheckCallback callback) { - assertConditionBeanNotNull(cb); + assertCBNotNull(cb); cb.checkSafetyResult(1); List ls = null; try { @@ -175,7 +181,7 @@ } //========================================================================== - // =========== + // ========= // List Read // ========= /** @@ -186,7 +192,7 @@ * list. (NotNull) */ public ListResultBean readList(ConditionBean cb) { - assertConditionBeanNotNull(cb); + assertCBNotNull(cb); return new jp.sf.pal.todolist.db.allcommon.cbean.ResultBeanBuilder( getTableDbName()).buildListResultBean(cb, callReadList(cb)); } @@ -198,7 +204,7 @@ * @return Read page. (NotNull) */ public PagingResultBean readPage(final ConditionBean cb) { - assertConditionBeanNotNull(cb); + assertCBNotNull(cb); final PagingInvoker invoker = new PagingInvoker( getTableDbName()); final PagingHandler handler = new PagingHandler() { @@ -225,8 +231,7 @@ * @exception jp.sf.pal.todolist.db.allcommon.exception.EntityAlreadyDeletedException * When the entity has already been deleted. */ - protected void assertEntityNotDeleted( - jp.sf.pal.todolist.db.allcommon.Entity entity, Object searchKey4Log) { + protected void assertEntityNotDeleted(Entity entity, Object searchKey4Log) { if (entity == null) { throwEntityAlreadyDeletedException(searchKey4Log); } @@ -239,7 +244,8 @@ * @param searchKey4Log Search-key for Logging. (NotNull) * @exception jp.sf.pal.todolist.db.allcommon.exception.EntityAlreadyDeletedException */ - protected void assertEntityNotDeleted(List ls, Object searchKey4Log) { + protected void assertEntityNotDeleted(List ls, + Object searchKey4Log) { if (ls == null || ls.isEmpty()) { throwEntityAlreadyDeletedException(searchKey4Log); } @@ -253,7 +259,8 @@ * @exception jp.sf.pal.todolist.db.allcommon.exception.EntityAlreadyDeletedException * @exception jp.sf.pal.todolist.db.allcommon.exception.EntityDuplicatedException */ - protected void assertEntitySelectedAsOne(List ls, Object searchKey4Log) { + protected void assertEntitySelectedAsOne(List ls, + Object searchKey4Log) { if (ls == null || ls.isEmpty()) { throwEntityAlreadyDeletedException(searchKey4Log); } @@ -274,49 +281,254 @@ //========================================================================== // ========= - // Various Select - // ============== - public OutsideSqlBasicExecutor outsideSql() { - assertDaoSelectorNotNull("outsideSql"); - final OutsideSqlDao outsideSqlDao = _daoSelector - .select(OutsideSqlDao.class); - return new OutsideSqlBasicExecutor(outsideSqlDao, getTableDbName()); - } + // Scalar Select + // ============= + /** + * The scalar function.
This is not static class because this uses + * the method 'invoke(BehaviorCommand)' + * + * @param The type of condition-bean. + * @param The type of result. + */ + public class SLFunction { // SL: ScaLar - private void assertDaoSelectorNotNull(String methodName) { - if (_daoSelector == null) { + /** The condition-bean for scalar select. (NotNull) */ + protected CB _conditionBean; + + /** The condition-bean for scalar select. (NotNull) */ + protected Class _resultType; + + /** + * @param conditionBean The condition-bean initialized only for scalar + * select. (NotNull) + * @param resultType The type os result. (NotNull) + */ + public SLFunction(CB conditionBean, Class resultType) { + _conditionBean = conditionBean; + _resultType = resultType; + } + + /** + * Select the maximum value.
+ * + *
+         * memberBhv.scalarSelect(Date.class).max(new ScalarQuery(MemberCB cb) {
+         *     cb.specify().columnMemberBirthday(); // the required specification of target column
+         *     cb.query().setMemberStatusCode_Equal_Formalized(); // query as you like it
+         * });
+         * 
+ * + * @param scalarQuery The query for scalar. (NotNull) + * @return The maximum value. (Nullable) + */ + public RESULT max(ScalarQuery scalarQuery) { + assertObjectNotNull("scalarQuery", scalarQuery); + return exec(scalarQuery, SqlClause.SelectClauseType.MAX); + } + + /** + * Select the minimum value.
+ * + *
+         * memberBhv.scalarSelect(Date.class).min(new ScalarQuery(MemberCB cb) {
+         *     cb.specify().columnMemberBirthday(); // the required specification of target column
+         *     cb.query().setMemberStatusCode_Equal_Formalized(); // query as you like it
+         * });
+         * 
+ * + * @param scalarQuery The query for scalar. (NotNull) + * @return The minimum value. (Nullable) + */ + public RESULT min(ScalarQuery scalarQuery) { + assertObjectNotNull("scalarQuery", scalarQuery); + return exec(scalarQuery, SqlClause.SelectClauseType.MIN); + } + + /** + * Select the summary value.
+ * + *
+         * purchaseBhv.scalarSelect(Integer.class).sum(new ScalarQuery(PurchaseCB cb) {
+         *     cb.specify().columnPurchaseCount(); // the required specification of target column
+         *     cb.query().setPurchaseDatetime_GreaterEqual(date); // query as you like it
+         * });
+         * 
+ * + * @param scalarQuery The query for scalar. (NotNull) + * @return The summary value. (Nullable) + */ + public RESULT sum(ScalarQuery scalarQuery) { + assertObjectNotNull("scalarQuery", scalarQuery); + return exec(scalarQuery, SqlClause.SelectClauseType.SUM); + } + + /** + * Select the average value.
+ * + *
+         * purchaseBhv.scalarSelect(Integer.class).avg(new ScalarQuery(PurchaseCB cb) {
+         *     cb.specify().columnPurchaseCount(); // the required specification of target column
+         *     cb.query().setPurchaseDatetime_GreaterEqual(date); // query as you like it
+         * });
+         * 
+ * + * @param scalarQuery The query for scalar. (NotNull) + * @return The average value. (Nullable) + */ + public RESULT avg(ScalarQuery scalarQuery) { + assertObjectNotNull("scalarQuery", scalarQuery); + return exec(scalarQuery, SqlClause.SelectClauseType.AVG); + } + + protected RESULT exec(ScalarQuery scalarQuery, + SqlClause.SelectClauseType selectClauseType) { + assertObjectNotNull("scalarQuery", scalarQuery); + assertObjectNotNull("selectClauseType", selectClauseType); + assertObjectNotNull("conditionBean", _conditionBean); + assertObjectNotNull("resultType", _resultType); + scalarQuery.query(_conditionBean); + assertScalarSelectRequiredSpecifyColumn(); + return invoke(createSelectScalarCBCommand(_conditionBean, + _resultType, selectClauseType)); + } + + protected void assertScalarSelectRequiredSpecifyColumn() { + final String columnName = _conditionBean.getSqlClause() + .getSpecifiedColumnNameAsOne(); + if (columnName == null) { + throwScalarSelectInvalidColumnSpecificationException(); + } + } + + protected void throwScalarSelectInvalidColumnSpecificationException() { String msg = "Look! Read the message below." + getLineSeparator(); msg = msg + "/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *" + getLineSeparator(); - msg = msg - + "Not found the selector of dao as behavior's attributed!" + msg = msg + "The specified column for scalar select was Invalid!" + getLineSeparator(); msg = msg + getLineSeparator(); msg = msg + "[Advice]" + getLineSeparator(); msg = msg - + "Please confirm the definition of the selector at your 'dbflute.dicon'." + + " You should call specify().column[TargetColumn]() only once." + getLineSeparator(); - msg = msg + "It is precondition that '" + methodName - + "()' needs the selector instance." + getLineSeparator(); - msg = msg + getLineSeparator(); - msg = msg + "[Your Behavior's Attributes]" + getLineSeparator(); - msg = msg + " _behaviorSelector : " + _behaviorSelector + msg = msg + " For example:" + getLineSeparator(); + msg = msg + " " + getLineSeparator(); + msg = msg + " [Wrong]" + getLineSeparator(); + msg = msg + " /- - - - - - - - - - - - - - - - - - - - " + getLineSeparator(); - msg = msg + " _daoSelector : " + _daoSelector + msg = msg + + " memberBhv.scalarSelect(Date.class).max(new ScalarQuery() {" + getLineSeparator(); - msg = msg + "* * * * * * * * * */" + getLineSeparator(); - throw new IllegalStateException(msg); + msg = msg + " public void query(MemberCB cb) {" + + getLineSeparator(); + msg = msg + " // *No! It's empty!" + getLineSeparator(); + msg = msg + " }" + getLineSeparator(); + msg = msg + " });" + getLineSeparator(); + msg = msg + " - - - - - - - - - -/" + getLineSeparator(); + msg = msg + " " + getLineSeparator(); + msg = msg + " [Wrong]" + getLineSeparator(); + msg = msg + " /- - - - - - - - - - - - - - - - - - - - " + + getLineSeparator(); + msg = msg + + " memberBhv.scalarSelect(Date.class).max(new ScalarQuery() {" + + getLineSeparator(); + msg = msg + " public void query(MemberCB cb) {" + + getLineSeparator(); + msg = msg + " cb.specify().columnMemberBirthday();" + + getLineSeparator(); + msg = msg + + " cb.specify().columnRegisterDatetime(); // *No! It's duplicated!" + + getLineSeparator(); + msg = msg + " }" + getLineSeparator(); + msg = msg + " });" + getLineSeparator(); + msg = msg + " - - - - - - - - - -/" + getLineSeparator(); + msg = msg + " " + getLineSeparator(); + msg = msg + " [Good!]" + getLineSeparator(); + msg = msg + " /- - - - - - - - - - - - - - - - - - - - " + + getLineSeparator(); + msg = msg + + " memberBhv.scalarSelect(Date.class).max(new ScalarQuery() {" + + getLineSeparator(); + msg = msg + " public void query(MemberCB cb) {" + + getLineSeparator(); + msg = msg + + " cb.specify().columnMemberBirthday(); // *Point!" + + getLineSeparator(); + msg = msg + " }" + getLineSeparator(); + msg = msg + " });" + getLineSeparator(); + msg = msg + " - - - - - - - - - -/" + getLineSeparator(); + msg = msg + getLineSeparator(); + msg = msg + "[ConditionBean Type]" + getLineSeparator() + + _conditionBean.getClass().getName() + getLineSeparator(); + msg = msg + getLineSeparator(); + msg = msg + "[Result Type]" + getLineSeparator() + + _resultType.getName() + getLineSeparator(); + msg = msg + "* * * * * * * * * */"; + throw new ScalarSelectInvalidColumnSpecificationException(msg); } } + public static class ScalarSelectInvalidColumnSpecificationException extends + RuntimeException { + private static final long serialVersionUID = 1L; + + public ScalarSelectInvalidColumnSpecificationException(String msg) { + super(msg); + } + } + + //========================================================================== + // ========= + // OutsideSql + // ========== /** - * Create value-label list. + * Get the basic executor of outside-SQL.
The invoker of behavior + * command should be not null when you call this method. * + *
+     * You can use the methods for outside-SQL are as follows:
+     * {Basic}
+     *   o selectList()
+     *   o execute()
+     *   o call()
+     * 
+     * {Entity}
+     *   o entityHandling().selectEntity()
+     *   o entityHandling().selectEntityWithDeletedCheck()
+     * 
+     * {Cursor}
+     *   o cursorHandling().selectCursor()
+     * 
+     * {Paging}
+     *   o autoPaging().selectList()
+     *   o autoPaging().selectPage()
+     *   o manualPaging().selectList()
+     *   o manualPaging().selectPage()
+     * 
+     * {Option -- Dynamic}
+     *   o dynamicBinding().selectList()
+     * 
+ * + * @return The basic executor of outside-SQL. (NotNull) + */ + public OutsideSqlBasicExecutor outsideSql() { + assertBehaviorCommandInvoker("outsideSql"); + return new OutsideSqlBasicExecutor(_behaviorCommandInvoker, + getTableDbName()); + } + + //========================================================================== + // ========= + // Various Select + // ============== + /** + * Create the list of value-label. + * * @param The type of entity. * @param entityList The list of entity. (NotNull) - * @param valueLabelSetupper Value-label-setupper. (NotNull) - * @return Value-label list. (NotNull) + * @param valueLabelSetupper The setupper of value-label. (NotNull) + * @return The list of value-label. (NotNull) */ public List> createValueLabelList( List entityList, @@ -362,10 +574,10 @@ } } - protected Object helpConvertingSequenceObject(Class resultClass, + protected Object helpConvertingSequenceObject(Class resultClass, Object sequenceObject) { try { - final Constructor constructor = resultClass + final Constructor constructor = resultClass .getConstructor(new Class[] { String.class }); return constructor.newInstance(new Object[] { sequenceObject .toString() }); @@ -534,6 +746,7 @@ * @param value The value of primary key. (Nullable) * @return The value of primary key. (Nullable) */ + @SuppressWarnings("unchecked") protected PK toLowerCasePrimaryKeyIfString(PK value) { return (PK) toLowerCaseIfString(value); } @@ -580,22 +793,22 @@ + "/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *" + getLineSeparator(); msg = msg - + "Not found the selector of behavior as behavior's attributed!" + + "Not found the selector of behavior as behavior's attribute!" + getLineSeparator(); msg = msg + getLineSeparator(); msg = msg + "[Advice]" + getLineSeparator(); msg = msg - + "Please confirm the definition of the selector at your 'dbflute.dicon'." + + "Please confirm the definition of the selector at your component configuration of DBFlute." + getLineSeparator(); msg = msg + "It is precondition that '" + methodName + "()' needs the selector instance." + getLineSeparator(); msg = msg + getLineSeparator(); msg = msg + "[Your Behavior's Attributes]" + getLineSeparator(); - msg = msg + " _behaviorSelector : " + _behaviorSelector + msg = msg + " _behaviorCommandInvoker : " + + _behaviorCommandInvoker + getLineSeparator(); + msg = msg + " _behaviorSelector : " + _behaviorSelector + getLineSeparator(); - msg = msg + " _daoSelector : " + _daoSelector - + getLineSeparator(); - msg = msg + "* * * * * * * * * */" + getLineSeparator(); + msg = msg + "* * * * * * * * * */"; throw new IllegalStateException(msg); } } @@ -648,14 +861,14 @@ public TokenFileOutputResult outputTokenFile(ConditionBean cb, String filename, TokenFileOutputOption tokenFileOutputOption) throws java.io.FileNotFoundException, java.io.IOException { - assertConditionBeanNotNull(cb); + assertCBNotNull(cb); assertStringNotNullAndNotTrimmedEmpty("filename", filename); assertObjectNotNull("tokenFileOutputOption", tokenFileOutputOption); final List ls = readList(cb); List> rowList = new ArrayList>(); - for (java.util.Iterator ite = ls.iterator(); ite.hasNext();) { - final Entity entity = (Entity) ite.next(); + for (java.util.Iterator ite = ls.iterator(); ite.hasNext();) { + final Entity entity = ite.next(); final List valueList = getDBMeta() .convertToColumnStringValueList(entity); rowList.add(valueList); @@ -665,9 +878,9 @@ .getFileMakingOption(); final FileMakingHeaderInfo fileMakingHeaderInfo = new FileMakingHeaderInfo(); final List columnDbNameList = new ArrayList(); - for (final java.util.Iterator ite = getDBMeta().getColumnInfoList() - .iterator(); ite.hasNext();) { - final ColumnInfo columnInfo = (ColumnInfo) ite.next(); + for (final java.util.Iterator ite = getDBMeta() + .getColumnInfoList().iterator(); ite.hasNext();) { + final ColumnInfo columnInfo = ite.next(); columnDbNameList.add(columnInfo.getColumnDbName()); } fileMakingHeaderInfo.setColumnNameList(columnDbNameList); @@ -690,7 +903,7 @@ * @return All count. */ protected int callGetCountAll() { - return readCount(newConditionBean()); + return callReadCount(newConditionBean()); } /** @@ -699,7 +912,7 @@ * @return All list. (NotNull) */ protected List callGetListAll() { - return readList(newConditionBean()); + return callReadList(newConditionBean()); } /** @@ -710,14 +923,12 @@ * @return Read count. (NotNull) */ protected int callReadCount(ConditionBean cb) { - assertConditionBeanNotNull(cb); - final Class[] types = new Class[] { cb.getClass() }; - final java.lang.reflect.Method mtd = getMethod(getDaoReadable() - .getClass(), "selectCount", types); - final Object result = invoke(mtd, getDaoReadable(), new Object[] { cb }); - return ((Integer) result).intValue(); + assertCBNotNull(cb); + return doCallReadCount(cb); } + protected abstract int doCallReadCount(ConditionBean cb); + /** * The implementation. * @@ -727,42 +938,110 @@ * (NotNull) */ protected List 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) result; + assertCBNotNull(cb); + return doCallReadList(cb); } - private Method getMethod(Class clazz, String methodName, Class[] argTypes) { - try { - return clazz.getMethod(methodName, argTypes); - } catch (NoSuchMethodException ex) { - String msg = "class=" + clazz + " method=" + methodName + "-" - + java.util.Arrays.asList(argTypes); - throw new RuntimeException(msg, ex); + protected abstract List doCallReadList(ConditionBean cb); + + //========================================================================== + // ========= + // Behavior Command + // ================ + public void warmUpCommand() { + { + SelectCountCBCommand cmd = createSelectCountCBCommand(newConditionBean()); + cmd.setInitializeOnly(true); + invoke(cmd); } + { + SelectListCBCommand cmd = createSelectListCBCommand( + newConditionBean(), getDBMeta().getEntityType()); + cmd.setInitializeOnly(true); + invoke(cmd); + } } - private Object invoke(Method method, Object target, Object[] args) { - try { - return method.invoke(target, args); - } catch (java.lang.reflect.InvocationTargetException ex) { - Throwable t = ex.getCause(); - if (t instanceof RuntimeException) { - throw (RuntimeException) t; - } - if (t instanceof Error) { - throw (Error) t; - } - String msg = "target=" + target + " method=" + method + "-" - + java.util.Arrays.asList(args); - throw new RuntimeException(msg, ex); - } catch (IllegalAccessException ex) { - String msg = "target=" + target + " method=" + method + "-" - + java.util.Arrays.asList(args); - throw new RuntimeException(msg, ex); + protected SelectCountCBCommand createSelectCountCBCommand(ConditionBean cb) { + assertBehaviorCommandInvoker("createSelectCountCBCommand"); + final SelectCountCBCommand command = xsetupSelectCommand(new SelectCountCBCommand()); + command.setConditionBeanType(cb.getClass()); + command.setConditionBean(cb); + return command; + } + + protected SelectListCBCommand createSelectListCBCommand( + ConditionBean cb, Class entityType) { + assertBehaviorCommandInvoker("createSelectListCBCommand"); + final SelectListCBCommand command = xsetupSelectCommand(new SelectListCBCommand()); + command.setConditionBeanType(cb.getClass()); + command.setConditionBean(cb); + command.setEntityType(entityType); + return command; + } + + protected SelectNextValCommand createSelectNextValCommand( + Class resultType) { + assertBehaviorCommandInvoker("createSelectNextValCommand"); + final SelectNextValCommand command = xsetupSelectCommand(new SelectNextValCommand()); + command.setResultType(resultType); + return command; + } + + protected SelectScalarCBCommand createSelectScalarCBCommand( + ConditionBean cb, Class resultType, + SqlClause.SelectClauseType selectClauseType) { + assertBehaviorCommandInvoker("createSelectScalarCBCommand"); + final SelectScalarCBCommand command = xsetupSelectCommand(new SelectScalarCBCommand()); + command.setConditionBeanType(cb.getClass()); + command.setConditionBean(cb); + command.setResultType(resultType); + command.setSelectClauseType(selectClauseType); + return command; + } + + private > COMMAND xsetupSelectCommand( + COMMAND command) { + command.setTableDbName(getTableDbName()); + _behaviorCommandInvoker.injectComponentProperty(command); + return command; + } + + /** + * Invoke the command of behavior. + * + * @param The type of result. + * @param behaviorCommand The command of behavior. (NotNull) + * @return The instance of result. (Nullable) + */ + protected RESULT invoke(BehaviorCommand behaviorCommand) { + return _behaviorCommandInvoker.invoke(behaviorCommand); + } + + protected void assertBehaviorCommandInvoker(String methodName) { + if (_behaviorCommandInvoker == null) { + String msg = "Look! Read the message below." + getLineSeparator(); + msg = msg + + "/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *" + + getLineSeparator(); + msg = msg + + "Not found the invoker of behavior command as behavior's attributed!" + + getLineSeparator(); + msg = msg + getLineSeparator(); + msg = msg + "[Advice]" + getLineSeparator(); + msg = msg + + "Please confirm the definition of the invoker at your 'dbflute.dicon'." + + getLineSeparator(); + msg = msg + "It is precondition that '" + methodName + + "()' needs the invoker instance." + getLineSeparator(); + msg = msg + getLineSeparator(); + msg = msg + "[Your Behavior's Attributes]" + getLineSeparator(); + msg = msg + " _behaviorCommandInvoker : " + + _behaviorCommandInvoker + getLineSeparator(); + msg = msg + " _behaviorSelector : " + _behaviorSelector + + getLineSeparator(); + msg = msg + "* * * * * * * * * */"; + throw new IllegalStateException(msg); } } @@ -800,6 +1079,7 @@ return SimpleSystemUtil.getLineSeparator(); } + @SuppressWarnings("unchecked") protected ENTITY helpDowncastInternally( Entity entity, Class clazz) { assertObjectNotNull("entity", entity); @@ -850,8 +1130,16 @@ * * @param cb Condition-bean. (NotNull) */ - protected void assertConditionBeanNotNull( - jp.sf.pal.todolist.db.allcommon.cbean.ConditionBean cb) { + protected void assertConditionBeanNotNull(ConditionBean cb) { + assertCBNotNull(cb); + } + + /** + * Assert that the condition-bean is not null. + * + * @param cb Condition-bean. (NotNull) + */ + protected void assertCBNotNull(ConditionBean cb) { assertObjectNotNull("cb", cb); } @@ -896,7 +1184,7 @@ * * @param ls List. (NotNull) */ - protected void assertListNotNullAndEmpty(List ls) { + protected void assertListNotNullAndEmpty(List ls) { assertObjectNotNull("ls", ls); if (!ls.isEmpty()) { String msg = "The list should be empty: ls=" + ls.toString(); @@ -909,7 +1197,7 @@ * * @param ls List. (NotNull) */ - protected void assertListNotNullAndNotEmpty(List ls) { + protected void assertListNotNullAndNotEmpty(List ls) { assertObjectNotNull("ls", ls); if (ls.isEmpty()) { String msg = "The list should not be empty: ls=" + ls.toString(); @@ -922,7 +1210,7 @@ * * @param ls List. (NotNull) */ - protected void assertListNotNullAndHasOnlyOne(List ls) { + protected void assertListNotNullAndHasOnlyOne(List ls) { assertObjectNotNull("ls", ls); if (ls.size() != 1) { String msg = "The list should contain only one object: ls=" @@ -936,38 +1224,39 @@ // Accessor // ======== /** - * Get the selector of behavior. + * Get the invoker of behavior command. * - * @return The select of behavior. (Nullable: But normally NotNull) + * @return The invoker of behavior command. (Nullable: But normally NotNull) */ - protected BehaviorSelector getBehaviorSelector() { - return _behaviorSelector; + protected BehaviorCommandInvoker getBehaviorCommandInvoker() { + return _behaviorCommandInvoker; } /** - * Set the selector of behavior. + * Set the invoker of behavior command. * - * @param behaviorSelector The selector of behavior. (NotNull) + * @param behaviorCommandInvoker The invoker of behavior command. (NotNull) */ - public void setBehaviorSelector(BehaviorSelector behaviorSelector) { - this._behaviorSelector = behaviorSelector; + public void setBehaviorCommandInvoker( + BehaviorCommandInvoker behaviorCommandInvoker) { + this._behaviorCommandInvoker = behaviorCommandInvoker; } /** - * Get the selector of DAO. + * Get the selector of behavior. * - * @return The select of DAO. (Nullable: But normally NotNull) + * @return The select of behavior. (Nullable: But normally NotNull) */ - protected DaoSelector getDaoSelector() { - return _daoSelector; + protected BehaviorSelector getBehaviorSelector() { + return _behaviorSelector; } /** - * Set the selector of DAO. + * Set the selector of behavior. * - * @param daoSelector The selector of DAO. (NotNull) + * @param behaviorSelector The selector of behavior. (NotNull) */ - public void setDaoSelector(DaoSelector daoSelector) { - _daoSelector = daoSelector; + public void setBehaviorSelector(BehaviorSelector behaviorSelector) { + this._behaviorSelector = behaviorSelector; } } Modified: todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/bhv/AbstractBehaviorWritable.java =================================================================== --- todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/bhv/AbstractBehaviorWritable.java 2008-12-27 22:20:45 UTC (rev 1632) +++ todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/bhv/AbstractBehaviorWritable.java 2008-12-27 22:21:53 UTC (rev 1633) @@ -4,10 +4,25 @@ import java.util.Iterator; import java.util.List; +import jp.sf.pal.todolist.db.allcommon.CommonColumnAutoSetupper; import jp.sf.pal.todolist.db.allcommon.Entity; import jp.sf.pal.todolist.db.allcommon.bhv.batch.TokenFileReflectionFailure; import jp.sf.pal.todolist.db.allcommon.bhv.batch.TokenFileReflectionOption; import jp.sf.pal.todolist.db.allcommon.bhv.batch.TokenFileReflectionResult; +import jp.sf.pal.todolist.db.allcommon.bhv.core.command.AbstractEntityCommand; +import jp.sf.pal.todolist.db.allcommon.bhv.core.command.AbstractListEntityCommand; +import jp.sf.pal.todolist.db.allcommon.bhv.core.command.BatchDeleteEntityCommand; +import jp.sf.pal.todolist.db.allcommon.bhv.core.command.BatchDeleteNonstrictEntityCommand; +import jp.sf.pal.todolist.db.allcommon.bhv.core.command.BatchInsertEntityCommand; +import jp.sf.pal.todolist.db.allcommon.bhv.core.command.BatchUpdateEntityCommand; +import jp.sf.pal.todolist.db.allcommon.bhv.core.command.BatchUpdateNonstrictEntityCommand; +import jp.sf.pal.todolist.db.allcommon.bhv.core.command.DeleteEntityCommand; +import jp.sf.pal.todolist.db.allcommon.bhv.core.command.DeleteNonstrictEntityCommand; +import jp.sf.pal.todolist.db.allcommon.bhv.core.command.InsertEntityCommand; +import jp.sf.pal.todolist.db.allcommon.bhv.core.command.QueryDeleteCBCommand; +import jp.sf.pal.todolist.db.allcommon.bhv.core.command.QueryUpdateEntityCBCommand; +import jp.sf.pal.todolist.db.allcommon.bhv.core.command.UpdateEntityCommand; +import jp.sf.pal.todolist.db.allcommon.bhv.core.command.UpdateNonstrictEntityCommand; import jp.sf.pal.todolist.db.allcommon.cbean.ConditionBean; import jp.sf.pal.todolist.db.allcommon.dbmeta.DBMeta; import jp.sf.pal.todolist.db.allcommon.helper.MapStringBuilder; @@ -20,7 +35,7 @@ import jp.sf.pal.todolist.db.allcommon.helper.token.file.impl.FileTokenImpl; /** - * The abstract class of behavior-writable. + * The abstract class of writable behavior. * * @author DBFlute(AutoGenerator) */ @@ -29,6 +44,31 @@ //========================================================================== // ========= + // Definition + // ========== + /** Map-string map-mark. */ + private static final String MAP_STRING_MAP_MARK = "map:"; + + /** Map-string start-brace. */ + private static final String MAP_STRING_START_BRACE = "@{"; + + /** Map-string end-brace. */ + private static final String MAP_STRING_END_BRACE = "@}"; + + /** Map-string delimiter. */ + private static final String MAP_STRING_DELIMITER = "@;"; + + /** Map-string equal. */ + private static final String MAP_STRING_EQUAL = "@="; + + //========================================================================== + // =========== + // Attribute + // ========= + protected CommonColumnAutoSetupper _commonColumnAutoSetupper; + + //========================================================================== + // ========= // Entity Update // ============= // ----------------------------------------------------- @@ -357,7 +397,7 @@ * @param entityList Entity list. (NotNull and NotEmpty) * @return The array of created count. */ - public int[] lumpCreate(java.util.List entityList) { + public int[] lumpCreate(List entityList) { assertListNotNullAndNotEmpty(entityList); return callCreateList(entityList); } @@ -370,7 +410,7 @@ * @exception jp.sf.pal.todolist.db.allcommon.exception.EntityAlreadyUpdatedException * If s2dao's version is over 1.0.47 (contains 1.0.47). */ - public int[] lumpModify(java.util.List entityList) { + public int[] lumpModify(List entityList) { assertListNotNullAndNotEmpty(entityList); return callModifyList(entityList); } @@ -383,7 +423,7 @@ * @exception jp.sf.pal.todolist.db.allcommon.exception.EntityAlreadyUpdatedException * If s2dao's version is over 1.0.47 (contains 1.0.47). */ - public int[] lumpRemove(java.util.List entityList) { + public int[] lumpRemove(List entityList) { assertListNotNullAndNotEmpty(entityList); return callRemoveList(entityList); } @@ -611,9 +651,11 @@ if (!processBeforeInsert(entity)) { return 1;/* as Normal End */ } - return getDaoWritable().create(entity); + return doCallCreate(entity); } + protected abstract int doCallCreate(Entity entity); + /** * Process before insert. * @@ -645,9 +687,11 @@ if (!processBeforeUpdate(entity)) { return 1;/* as Normal End */ } - return getDaoWritable().modifyModifiedOnly(entity); + return doCallModify(entity); } + protected abstract int doCallModify(Entity entity); + /** * Process before update. * @@ -678,9 +722,11 @@ if (!processBeforeDelete(entity)) { return 1;/* as Normal End */ } - return getDaoWritable().remove(entity); + return doCallRemove(entity); } + protected abstract int doCallRemove(Entity entity); + /** * Process before delete. * @@ -729,8 +775,38 @@ * (NotNull) */ protected void setupCommonColumnOfInsertIfNeeds(Entity targetEntity) { + final CommonColumnAutoSetupper setupper = getCommonColumnAutoSetupper(); + assertCommonColumnAutoSetupperNotNull(); + setupper.handleCommonColumnOfInsertIfNeeds(targetEntity); } + private void assertCommonColumnAutoSetupperNotNull() { + if (_commonColumnAutoSetupper == null) { + String msg = "Look! Read the message below." + getLineSeparator(); + msg = msg + + "/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *" + + getLineSeparator(); + msg = msg + + "Not found the auto set-upper of common column as behavior's attribute!" + + getLineSeparator(); + msg = msg + getLineSeparator(); + msg = msg + "[Advice]" + getLineSeparator(); + msg = msg + + "Please confirm the definition of the set-upper at your component configuration of DBFlute." + + getLineSeparator(); + msg = msg + getLineSeparator(); + msg = msg + "[Your Behavior's Attributes]" + getLineSeparator(); + msg = msg + " _behaviorCommandInvoker : " + + _behaviorCommandInvoker + getLineSeparator(); + msg = msg + " _behaviorSelector : " + _behaviorSelector + + getLineSeparator(); + msg = msg + " _commonColumnAutoSetupper : " + + _commonColumnAutoSetupper + getLineSeparator(); + msg = msg + "* * * * * * * * * */"; + throw new IllegalStateException(msg); + } + } + /** * Filter the entity of insert. * @@ -778,6 +854,9 @@ * (NotNull) */ protected void setupCommonColumnOfUpdateIfNeeds(Entity targetEntity) { + final CommonColumnAutoSetupper setupper = getCommonColumnAutoSetupper(); + assertCommonColumnAutoSetupperNotNull(); + setupper.handleCommonColumnOfUpdateIfNeeds(targetEntity); } /** @@ -843,12 +922,14 @@ * (NotNull) * @return Inserted count. */ - public int[] callCreateList(java.util.List entityList) { + public int[] callCreateList(List entityList) { assertObjectNotNull("entityList", entityList); helpFilterBeforeInsertInternally(entityList); - return getDaoWritable().createList(entityList); + return doCreateList(entityList); } + protected abstract int[] doCreateList(List entityList); + /** * The implementation. * @@ -856,12 +937,14 @@ * (NotNull) * @return Updated count. */ - public int[] callModifyList(java.util.List entityList) { + public int[] callModifyList(List entityList) { assertObjectNotNull("entityList", entityList); helpFilterBeforeUpdateInternally(entityList); - return getDaoWritable().modifyList(entityList); + return doModifyList(entityList); } + protected abstract int[] doModifyList(List entityList); + /** * The implementation. * @@ -869,12 +952,14 @@ * (NotNull) * @return Deleted count. */ - public int[] callRemoveList(java.util.List entityList) { + public int[] callRemoveList(List entityList) { assertObjectNotNull("entityList", entityList); helpFilterBeforeDeleteInternally(entityList); - return getDaoWritable().removeList(entityList); + return doRemoveList(entityList); } + protected abstract int[] doRemoveList(List entityList); + protected void assertEntityHasVersionNoValue(Entity entity) { if (!getDBMeta().hasVersionNo()) { return; @@ -994,4 +1079,148 @@ } return filteredList; } + + //========================================================================== + // ========= + // Behavior Command + // ================ + protected InsertEntityCommand createInsertEntityCommand(Entity entity) { + assertBehaviorCommandInvoker("createInsertEntityCommand"); + return xsetupEntityCommand(new InsertEntityCommand(), entity); + } + + protected UpdateEntityCommand createUpdateEntityCommand(Entity entity) { + assertBehaviorCommandInvoker("createUpdateEntityCommand"); + return xsetupEntityCommand(new UpdateEntityCommand(), entity); + } + + protected UpdateNonstrictEntityCommand createUpdateNonstrictEntityCommand( + Entity entity) { + assertBehaviorCommandInvoker("createUpdateNonstrictEntityCommand"); + return xsetupEntityCommand(new UpdateNonstrictEntityCommand(), entity); + } + + protected DeleteEntityCommand createDeleteEntityCommand(Entity entity) { + assertBehaviorCommandInvoker("createDeleteEntityCommand"); + return xsetupEntityCommand(new DeleteEntityCommand(), entity); + } + + protected DeleteNonstrictEntityCommand createDeleteNonstrictEntityCommand( + Entity entity) { + assertBehaviorCommandInvoker("createDeleteNonstrictEntityCommand"); + return xsetupEntityCommand(new DeleteNonstrictEntityCommand(), entity); + } + + private COMMAND xsetupEntityCommand( + COMMAND command, Entity entity) { + command.setTableDbName(getTableDbName()); + _behaviorCommandInvoker.injectComponentProperty(command); + command.setEntityType(entity.getClass()); + command.setEntity(entity); + return command; + } + + protected BatchInsertEntityCommand createBatchInsertEntityCommand( + List entityList) { + assertBehaviorCommandInvoker("createBatchInsertEntityCommand"); + return xsetupListEntityCommand(new BatchInsertEntityCommand(), + entityList); + } + + protected BatchUpdateEntityCommand createBatchUpdateEntityCommand( + List entityList) { + assertBehaviorCommandInvoker("createBatchUpdateEntityCommand"); + return xsetupListEntityCommand(new BatchUpdateEntityCommand(), + entityList); + } + + protected BatchUpdateNonstrictEntityCommand createBatchUpdateNonstrictEntityCommand( + List entityList) { + assertBehaviorCommandInvoker("createBatchUpdateNonstrictEntityCommand"); + return xsetupListEntityCommand(new BatchUpdateNonstrictEntityCommand(), + entityList); + } + + protected BatchDeleteEntityCommand createBatchDeleteEntityCommand( + List entityList) { + assertBehaviorCommandInvoker("createBatchDeleteEntityCommand"); + return xsetupListEntityCommand(new BatchDeleteEntityCommand(), + entityList); + } + + protected BatchDeleteNonstrictEntityCommand createBatchDeleteNonstrictEntityCommand( + List entityList) { + assertBehaviorCommandInvoker("createBatchDeleteNonstrictEntityCommand"); + return xsetupListEntityCommand(new BatchDeleteNonstrictEntityCommand(), + entityList); + } + + /** + * @param The type of behavior command for list entity. + * @param command The command of behavior. (NotNull) + * @param entityList The list of entity. (NotNull, NotEmpty) + * @return The command of behavior. (NotNull) + */ + private COMMAND xsetupListEntityCommand( + COMMAND command, List entityList) { + if (entityList.isEmpty()) { + String msg = "The argument 'entityList' should not be empty: " + + entityList; + throw new IllegalStateException(msg); + } + command.setTableDbName(getTableDbName()); + _behaviorCommandInvoker.injectComponentProperty(command); + command.setEntityType(entityList.get(0).getClass()); // *The list should + // not be empty! + command.setEntityList(entityList); + return command; + } + + protected QueryDeleteCBCommand createQueryDeleteCBCommand(ConditionBean cb) { + assertBehaviorCommandInvoker("createQueryDeleteCBCommand"); + final QueryDeleteCBCommand cmd = new QueryDeleteCBCommand(); + cmd.setTableDbName(getTableDbName()); + _behaviorCommandInvoker.injectComponentProperty(cmd); + cmd.setConditionBeanType(cb.getClass()); + cmd.setConditionBean(cb); + return cmd; + } + + protected QueryUpdateEntityCBCommand createQueryUpdateEntityCBCommand( + Entity entity, ConditionBean cb) { + assertBehaviorCommandInvoker("createQueryUpdateEntityCBCommand"); + final QueryUpdateEntityCBCommand cmd = new QueryUpdateEntityCBCommand(); + cmd.setTableDbName(getTableDbName()); + _behaviorCommandInvoker.injectComponentProperty(cmd); + cmd.setConditionBeanType(cb.getClass()); + cmd.setConditionBean(cb); + cmd.setEntityType(entity.getClass()); + cmd.setEntity(entity); + return cmd; + } + + //========================================================================== + // ========= + // Accessor + // ======== + /** + * Get the auto set-upper of common column. + * + * @return The auto set-upper of common column. (Nullable: But normally + * NotNull) + */ + protected CommonColumnAutoSetupper getCommonColumnAutoSetupper() { + return _commonColumnAutoSetupper; + } + + /** + * Set the auto set-upper of common column. + * + * @param commonColumnAutoSetupper The auto set-upper of common column. + * (NotNull) + */ + public void setCommonColumnAutoSetupper( + CommonColumnAutoSetupper commonColumnAutoSetupper) { + this._commonColumnAutoSetupper = commonColumnAutoSetupper; + } } Modified: todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/bhv/BehaviorReadable.java =================================================================== --- todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/bhv/BehaviorReadable.java 2008-12-27 22:20:45 UTC (rev 1632) +++ todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/bhv/BehaviorReadable.java 2008-12-27 22:21:53 UTC (rev 1633) @@ -1,6 +1,5 @@ package jp.sf.pal.todolist.db.allcommon.bhv; -import jp.sf.pal.todolist.db.allcommon.DaoReadable; import jp.sf.pal.todolist.db.allcommon.Entity; import jp.sf.pal.todolist.db.allcommon.cbean.ConditionBean; import jp.sf.pal.todolist.db.allcommon.cbean.ListResultBean; @@ -16,34 +15,12 @@ //========================================================================== // ========= - // Definition - // ========== - /** Map-string map-mark. */ - public static final String MAP_STRING_MAP_MARK = "map:"; - - /** Map-string list-mark. */ - public static final String MAP_STRING_LIST_MARK = "list:"; - - /** Map-string start-brace. */ - public static final String MAP_STRING_START_BRACE = "@{"; - - /** Map-string end-brace. */ - public static final String MAP_STRING_END_BRACE = "@}"; - - /** Map-string delimiter. */ - public static final String MAP_STRING_DELIMITER = "@;"; - - /** Map-string equal. */ - public static final String MAP_STRING_EQUAL = "@="; - - //========================================================================== - // ========= // Table name // ========== /** - * Get table db-name. + * Get table DB name. * - * @return Table db-name. (NotNull) + * @return Table DB name. (NotNull) */ public String getTableDbName(); @@ -52,25 +29,14 @@ // DBMeta // ====== /** - * Get dbmeta. + * Get the instance of DBMeta. * - * @return DBMeta. (NotNull) + * @return The instance of DBMeta. (NotNull) */ public DBMeta getDBMeta(); //========================================================================== // ========= - // Dao Accessor - // ============ - /** - * Get dao-readable. - * - * @return Dao-readable. (NotNull) - */ - public DaoReadable getDaoReadable(); - - //========================================================================== - // ========= // New Instance // ============ /** @@ -173,4 +139,13 @@ * @return The value of sequence. (NotNull) */ public java.math.BigDecimal readNextVal(); + + //========================================================================== + // ========= + // Warm Up + // ======= + /** + * Warm up the command of behavior. + */ + public void warmUpCommand(); } Modified: todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/bhv/BehaviorWritable.java =================================================================== --- todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/bhv/BehaviorWritable.java 2008-12-27 22:20:45 UTC (rev 1632) +++ todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/bhv/BehaviorWritable.java 2008-12-27 22:21:53 UTC (rev 1633) @@ -1,6 +1,7 @@ package jp.sf.pal.todolist.db.allcommon.bhv; -import jp.sf.pal.todolist.db.allcommon.DaoWritable; +import java.util.List; + import jp.sf.pal.todolist.db.allcommon.Entity; /** @@ -10,13 +11,6 @@ */ public interface BehaviorWritable extends BehaviorReadable { - /** - * Get dao-writable. - * - * @return Dao-writable. (NotNull) - */ - public DaoWritable getDaoWritable(); - //========================================================================== // =========== // Basic Entity Update @@ -116,15 +110,15 @@ /** * Lump create the list. * - * @param entityList Entity-list. (NotNull and NotEmpty) + * @param entityList The list of entity. (NotNull and NotEmpty) * @return The array of created count. */ - public int[] lumpCreate(java.util.List entityList); + public int[] lumpCreate(List entityList); /** - * Lump Modify the list. + * Lump modify the list. * - * @param entityList Entity-list. (NotNull and NotEmpty) + * @param entityList The list of entity. (NotNull and NotEmpty) * @return Modified count. * @exception jp.sf.pal.todolist.db.allcommon.exception.EntityAlreadyUpdatedException * When the entity has already been updated. And Only when @@ -132,12 +126,12 @@ * @exception jp.sf.pal.todolist.db.allcommon.exception.EntityDuplicatedException * When the entity has been duplicated. */ - public int[] lumpModify(java.util.List entityList); + public int[] lumpModify(List entityList); /** * Lump remove the list. * - * @param entityList Entity-list. (NotNull and NotEmpty) + * @param entityList The list of entity. (NotNull and NotEmpty) * @return Removed count. * @exception jp.sf.pal.todolist.db.allcommon.exception.EntityAlreadyUpdatedException * When the entity has already been updated. And Only when @@ -145,5 +139,5 @@ * @exception jp.sf.pal.todolist.db.allcommon.exception.EntityDuplicatedException * When the entity has been duplicated. */ - public int[] lumpRemove(java.util.List entityList); + public int[] lumpRemove(List entityList); } Added: todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/bhv/core/BehaviorCommand.java =================================================================== --- todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/bhv/core/BehaviorCommand.java (rev 0) +++ todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/bhv/core/BehaviorCommand.java 2008-12-27 22:21:53 UTC (rev 1633) @@ -0,0 +1,71 @@ +package jp.sf.pal.todolist.db.allcommon.bhv.core; + +import jp.sf.pal.todolist.db.allcommon.cbean.ConditionBean; +import jp.sf.pal.todolist.db.allcommon.cbean.outsidesql.OutsideSqlOption; + +/** + * @author DBFlute(AutoGenerator) + * @param The type of result. + */ +public interface BehaviorCommand { + + //========================================================================== + // ========= + // Basic Information + // ================= + public String getTableDbName(); + + public String getCommandName(); + + /** + * Get the return type of command. This type is not related to generic type + * because this is for conversion and check only. + * + * @return The return type of command. (NotNull) + */ + public Class getCommandReturnType(); + + public boolean isInitializeOnly(); + + //========================================================================== + // ========= + // Detail Information + // ================== + public boolean isConditionBean(); + + public boolean isOutsideSql(); + + public boolean isProcedure(); + + public boolean isSelect(); + + public boolean isSelectCount(); + + //========================================================================== + // ========= + // Process Callback + // ================ + public void beforeGettingSqlExecution(); + + public void afterExecuting(); + + //========================================================================== + // ========= + // SqlExecution Handling + // ===================== + public String buildSqlExecutionKey(); + + public SqlExecutionCreator createSqlExecutionCreator(); + + public Object[] getSqlExecutionArgument(); + + //========================================================================== + // ========= + // Argument Information + // ==================== + public ConditionBean getConditionBean(); + + public String getOutsideSqlPath(); + + public OutsideSqlOption getOutsideSqlOption(); +} Property changes on: todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/bhv/core/BehaviorCommand.java ___________________________________________________________________ Name: svn:eol-style + native Added: todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/bhv/core/BehaviorCommandComponentSetup.java =================================================================== --- todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/bhv/core/BehaviorCommandComponentSetup.java (rev 0) +++ todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/bhv/core/BehaviorCommandComponentSetup.java 2008-12-27 22:21:53 UTC (rev 1633) @@ -0,0 +1,23 @@ +package jp.sf.pal.todolist.db.allcommon.bhv.core; + +import javax.sql.DataSource; + +import org.seasar.dao.BeanMetaDataFactory; +import org.seasar.dao.ValueTypeFactory; +import org.seasar.extension.jdbc.StatementFactory; + +/** + * @author DBFlute(AutoGenerator) + */ +public interface BehaviorCommandComponentSetup { + + public void setDataSource(DataSource dataSource); + + public void setStatementFactory(StatementFactory statementFactory); + + public void setBeanMetaDataFactory(BeanMetaDataFactory beanMetaDataFactory); + + public void setValueTypeFactory(ValueTypeFactory valueTypeFactory); + + public void setSqlFileEncoding(String sqlFileEncoding); +} Property changes on: todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/bhv/core/BehaviorCommandComponentSetup.java ___________________________________________________________________ Name: svn:eol-style + native Added: todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/bhv/core/BehaviorCommandInvoker.java =================================================================== --- todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/bhv/core/BehaviorCommandInvoker.java (rev 0) +++ todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/bhv/core/BehaviorCommandInvoker.java 2008-12-27 22:21:53 UTC (rev 1633) @@ -0,0 +1,842 @@ +package jp.sf.pal.todolist.db.allcommon.bhv.core; + +import java.util.Arrays; +import java.util.List; +import java.util.Map; +import java.util.concurrent.ConcurrentHashMap; + +import javax.sql.DataSource; + +import jp.sf.pal.todolist.db.allcommon.DBFluteConfig; +import jp.sf.pal.todolist.db.allcommon.Entity; +import jp.sf.pal.todolist.db.allcommon.InternalMapContext; +import jp.sf.pal.todolist.db.allcommon.XLog; +import jp.sf.pal.todolist.db.allcommon.cbean.ConditionBeanContext; +import jp.sf.pal.todolist.db.allcommon.cbean.FetchNarrowingBeanContext; +import jp.sf.pal.todolist.db.allcommon.cbean.outsidesql.OutsideSqlContext; +import jp.sf.pal.todolist.db.allcommon.dbmeta.DBMeta; +import jp.sf.pal.todolist.db.allcommon.dbmeta.DBMetaInstanceHandler; +import jp.sf.pal.todolist.db.allcommon.helper.stacktrace.InvokeNameExtractingResource; +import jp.sf.pal.todolist.db.allcommon.helper.stacktrace.InvokeNameResult; +import jp.sf.pal.todolist.db.allcommon.helper.stacktrace.impl.InvokeNameExtractorImpl; +import jp.sf.pal.todolist.db.allcommon.jdbc.StatementConfig; +import jp.sf.pal.todolist.db.allcommon.s2dao.internal.various.InternalStatementFactory; +import jp.sf.pal.todolist.db.allcommon.util.SimpleSystemUtil; +import jp.sf.pal.todolist.db.allcommon.util.SimpleTypeUtil; +import jp.sf.pal.todolist.db.allcommon.util.TraceViewUtil; + +import org.seasar.dao.BeanMetaDataFactory; +import org.seasar.dao.ValueTypeFactory; +import org.seasar.extension.jdbc.StatementFactory; +import org.seasar.framework.util.Disposable; +import org.seasar.framework.util.DisposableUtil; + +/** + * The invoker of behavior command. + * + *
+ * public interface methods are as follows:
+ * 
+ *   o injectComponentProperty(BehaviorCommandComponentSetup behaviorCommand);
+ *   o invoke(BehaviorCommand behaviorCommand);
+ *   o isDisposable();
+ *   o isExecutionCacheEmpty();
+ * 
+ * + * @author DBFlute(AutoGenerator) + */ +public class BehaviorCommandInvoker implements Disposable { + + //========================================================================== + // ========= + // Attribute + // ========= + // ----------------------------------------------------- + // Injection Target + // ---------------- + protected DataSource _dataSource; + + protected BeanMetaDataFactory _beanMetaDataFactory; + + protected ValueTypeFactory _valueTypeFactory; + + // ----------------------------------------------------- + // Fixed Property + // -------------- + protected final StatementFactory _statementFactory = createStatememtFactory(); + + protected final Map _executionMap = new ConcurrentHashMap(); + + // ----------------------------------------------------- + // Dispose Status + // -------------- + protected boolean disposable; + + //========================================================================== + // ========= + // Constructor + // =========== + public BehaviorCommandInvoker() { + } + + //========================================================================== + // ========= + // Command Set up + // ============== + /** + * Inject the properties of component to the command of behavior. {Public + * Interface} + * + * @param behaviorCommand The command of behavior. (NotNull) + */ + public void injectComponentProperty( + BehaviorCommandComponentSetup behaviorCommand) { + behaviorCommand.setDataSource(_dataSource); + behaviorCommand.setStatementFactory(_statementFactory); + behaviorCommand.setBeanMetaDataFactory(_beanMetaDataFactory); + behaviorCommand.setValueTypeFactory(_valueTypeFactory); + behaviorCommand.setSqlFileEncoding(getSqlFileEncoding()); + } + + protected String getSqlFileEncoding() { + return "UTF-8"; // This value is set when generating. + } + + //========================================================================== + // ========= + // Command Invoke + // ============== + /** + * Invoke the command of behavior. {Public Interface} This method is an + * entry point! + * + * @param The type of result. + * @param behaviorCommand The command of behavior. (NotNull) + * @return The result object. (Nullable) + */ + public RESULT invoke(BehaviorCommand behaviorCommand) { + clearContext(); + try { + return doInvoke(behaviorCommand); + } finally { + clearContext(); + } + } + + /** + * @param The type of result. + * @param behaviorCommand The command of behavior. (NotNull) + * @return The result object. (Nullable) + */ + protected RESULT doInvoke(BehaviorCommand behaviorCommand) { + // - - - - - - - - - - - - - + // Initialize SQL Execution + // - - - - - - - - - - - - - + if (behaviorCommand.isInitializeOnly()) { + initializeSqlExecution(behaviorCommand); + return null; // The end! (Initialize Only) + } + behaviorCommand.beforeGettingSqlExecution(); + + SqlExecution execution = null; + try { + final String key = behaviorCommand.buildSqlExecutionKey(); + execution = getSqlExecution(key); + if (execution == null) { + long beforeCmd = 0; + if (isLogEnabled()) { + beforeCmd = System.currentTimeMillis(); + } + SqlExecutionCreator creator = behaviorCommand + .createSqlExecutionCreator(); + execution = getSqlExecution(key, creator); + if (isLogEnabled()) { + final long afterCmd = System.currentTimeMillis(); + if (beforeCmd != afterCmd) { + logSqlExecution(behaviorCommand, execution, beforeCmd, + afterCmd); + } + } + } + } finally { + if (isLogEnabled()) { + logInvocation(behaviorCommand); + } + } + + long before = 0; + if (isLogEnabled()) { + before = System.currentTimeMillis(); + } + + Object ret = null; + try { + final Object[] args = behaviorCommand.getSqlExecutionArgument(); + ret = executeSql(execution, args); + } finally { + behaviorCommand.afterExecuting(); + } + final Class retType = behaviorCommand.getCommandReturnType(); + assertRetType(retType, ret); + + if (isLogEnabled()) { + final long after = System.currentTimeMillis(); + logReturn(behaviorCommand, retType, ret, before, after); + } + + // - - - - - - - - - - + // Convert and Return! + // - - - - - - - - - - + if (retType.isPrimitive()) { + ret = convertPrimitiveWrapper(retType, ret); + } else if (Number.class.isAssignableFrom(retType)) { + ret = convertNumber(retType, ret); + } + @SuppressWarnings("unchecked") + final RESULT result = (RESULT) ret; + return result; + } + + //========================================================================== + // ========= + // SQL Execution + // ============= + protected void initializeSqlExecution( + BehaviorCommand behaviorCommand) { + final String key = behaviorCommand.buildSqlExecutionKey(); + SqlExecutionCreator creator = behaviorCommand + .createSqlExecutionCreator(); + getSqlExecution(key, creator); + } + + protected SqlExecution getSqlExecution(String key) { + return _executionMap.get(key); + } + + /** + * @param key The key of SQL execution. (NotNull) + * @param executionCreator The creator of SQL execution. (NotNull) + * @return The SQL execution that may be created then. (NotNull) + */ + protected SqlExecution getSqlExecution(String key, + SqlExecutionCreator executionCreator) { + SqlExecution execution = getSqlExecution(key); + if (execution == null) { + synchronized (_executionMap) { + execution = getSqlExecution(key); + if (execution == null) { + if (isLogEnabled()) { + log("...Initializing sqlExecution for the key '" + key + + "'"); + } + _executionMap.put(key, executionCreator + .createSqlExecution()); + } else { + if (isLogEnabled()) { + log("...Getting sqlExecution as cache because the previous thread have already initilized."); + } + } + } + execution = getSqlExecution(key); + if (execution == null) { + String msg = "sqlExecutionCreator.createSqlCommand() should not return null:"; + msg = msg + " sqlExecutionCreator=" + executionCreator + + " key=" + key; + throw new IllegalStateException(msg); + } + if (!disposable) { + synchronized (this) { + if (!disposable) { + toBeDisposable(); + } + } + } + } + return execution; + } + + protected Object executeSql(SqlExecution execution, Object[] args) { + return execution.execute(args); + } + + //========================================================================== + // ========= + // Log SqlCommand + // ============== + protected void logSqlExecution( + BehaviorCommand behaviorCommand, SqlExecution execution, + long beforeCmd, long afterCmd) { + log("SqlExecution Initialization Cost: [" + + TraceViewUtil.convertToPerformanceView(afterCmd - beforeCmd) + + "]"); + } + + //========================================================================== + // ========= + // Log Invocation + // ============== + protected void logInvocation( + BehaviorCommand behaviorCommand) { + final StackTraceElement[] stackTrace = new Exception().getStackTrace(); + final InvokeNameResult behaviorResult = extractBehaviorInvokeName(stackTrace); + filterBehaviorResult(behaviorCommand, behaviorResult); + + final String invokeClassName; + final String invokeMethodName; + if (!behaviorResult.isEmptyResult()) { + invokeClassName = behaviorResult.getSimpleClassName(); + invokeMethodName = behaviorResult.getMethodName(); + } else { + invokeClassName = behaviorCommand.getTableDbName(); + invokeMethodName = behaviorCommand.getCommandName(); + } + final String expWithoutKakko = buildInvocationExpressionWithoutKakko( + behaviorCommand, invokeClassName, invokeMethodName); + + // Save behavior invoke name for error message. + putObjectToMapContext("df:BehaviorInvokeName", expWithoutKakko + "()"); + + final String equalBorder = buildFitBorder("", "=", expWithoutKakko, + false); + final String callerExpression = expWithoutKakko + "()"; + + log("/=====================================================" + + equalBorder + "=="); + log(" " + + callerExpression); + log(" " + + equalBorder + "=/"); + + logPath(behaviorCommand, stackTrace, behaviorResult); + + if (behaviorCommand.isOutsideSql() && !behaviorCommand.isProcedure()) { + final OutsideSqlContext outsideSqlContext = getOutsideSqlContext(); + if (outsideSqlContext != null) { + log("path: " + behaviorCommand.getOutsideSqlPath()); + log("option: " + behaviorCommand.getOutsideSqlOption()); + } + } + } + + protected void filterBehaviorResult( + BehaviorCommand behaviorCommand, + InvokeNameResult behaviorResult) { + final String simpleClassName = behaviorResult.getSimpleClassName(); + if (simpleClassName == null) { + return; + } + if (simpleClassName.contains("Behavior") + && simpleClassName.endsWith("$SLFunction")) { + final String behaviorClassName = findBehaviorClassNameFromDBMeta(behaviorCommand + .getTableDbName()); + behaviorResult.setSimpleClassName(behaviorClassName); + behaviorResult.setMethodName("scalarSelect()." + + behaviorResult.getMethodName()); + } + } + + protected void logPath(BehaviorCommand behaviorCommand, + StackTraceElement[] stackTrace, InvokeNameResult behaviorResult) { + final int bhvNextIndex = behaviorResult.getNextStartIndex(); + final InvokeNameResult clientResult = extractClientInvokeName( + stackTrace, bhvNextIndex); + final int clientFirstIndex = clientResult.getFoundFirstIndex(); + final InvokeNameResult byPassResult = extractByPassInvokeName( + stackTrace, bhvNextIndex, clientFirstIndex - bhvNextIndex); + + final String clientInvokeName = clientResult.getInvokeName(); + final String byPassInvokeName = byPassResult.getInvokeName(); + final String behaviorInvokeName = behaviorResult.getInvokeName(); + if (clientInvokeName.trim().length() == 0 + && byPassInvokeName.trim().length() == 0) { + return; + } + + // Save client invoke name for error message. + if (!clientResult.isEmptyResult()) { + putObjectToMapContext("df:ClientInvokeName", clientInvokeName); + } + // Save by-pass invoke name for error message. + if (!byPassResult.isEmptyResult()) { + putObjectToMapContext("df:ByPassInvokeName", byPassInvokeName); + } + + log(clientInvokeName + byPassInvokeName + behaviorInvokeName + "..."); + } + + protected String buildInvocationExpressionWithoutKakko( + BehaviorCommand behaviorCommand, String invokeClassName, + String invokeMethodName) { + if (invokeClassName.contains("OutsideSql") + && invokeClassName.endsWith("Executor")) { // OutsideSql + // Executor Handling + try { + final String originalName = invokeClassName; + if (behaviorCommand.isOutsideSql()) { + final OutsideSqlContext outsideSqlContext = getOutsideSqlContext(); + final String tableDbName = outsideSqlContext + .getTableDbName(); + final String behaviorClassName = findBehaviorClassNameFromDBMeta(tableDbName); + invokeClassName = behaviorClassName + ".outsideSql()"; + if (originalName.endsWith("OutsideSqlEntityExecutor")) { + invokeClassName = invokeClassName + ".entityHandling()"; + } else if (originalName + .endsWith("OutsideSqlPagingExecutor")) { + if (outsideSqlContext.isAutoPagingLogging()) { + invokeClassName = invokeClassName + ".autoPaging()"; + } else { + invokeClassName = invokeClassName + + ".manualPaging()"; + } + } else if (originalName + .endsWith("OutsideSqlCursorExecutor")) { + invokeClassName = invokeClassName + ".cursorHandling()"; + } + } else { + invokeClassName = "OutsideSql"; + } + } catch (RuntimeException ignored) { + log("Ignored exception occurred: msg=" + ignored.getMessage()); + } + } + String callerExpressionWithoutKakko = invokeClassName + "." + + invokeMethodName; + if ("selectPage".equals(invokeMethodName)) { // Special Handling! + boolean resultTypeInteger = false; + if (behaviorCommand.isOutsideSql()) { + final OutsideSqlContext outsideSqlContext = getOutsideSqlContext(); + final Object resultTypeSpecification = outsideSqlContext + .getResultTypeSpecification(); + if (resultTypeSpecification != null + && resultTypeSpecification instanceof Class) { + final Class resultType = (Class) resultTypeSpecification; + if (Integer.class.isAssignableFrom(resultType)) { + resultTypeInteger = true; + } + } + } + if (resultTypeInteger || behaviorCommand.isSelectCount()) { + callerExpressionWithoutKakko = callerExpressionWithoutKakko + + "():count"; + } else { + callerExpressionWithoutKakko = callerExpressionWithoutKakko + + "():paging"; + } + } + return callerExpressionWithoutKakko; + } + + protected String buildFitBorder(String prefix, String element, + String lengthTargetString, boolean space) { + final int length = space ? lengthTargetString.length() / 2 + : lengthTargetString.length(); + final StringBuffer sb = new StringBuffer(); + sb.append(prefix); + for (int i = 0; i < length; i++) { + sb.append(element); + if (space) { + sb.append(" "); + } + } + if (space) { + sb.append(element); + } + return sb.toString(); + } + + protected InvokeNameResult extractClientInvokeName( + StackTraceElement[] stackTrace, final int startIndex) { + final List 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 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 suffixList = Arrays.asList(new String[] { "Bhv", + "BehaviorReadable", "BehaviorWritable", "PagingInvoker" }); + final List keywordList = Arrays.asList(new String[] { "Bhv$", + "BehaviorReadable$", "BehaviorWritable$" }); + final List ousideSql1List = Arrays + .asList(new String[] { "OutsideSql" }); + final List ousideSql2List = Arrays + .asList(new String[] { "Executor" }); + final List 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 suffixList) { + for (String suffix : suffixList) { + if (className.endsWith(suffix)) { + return true; + } + } + return false; + } + + protected boolean isClassNameContains(String className, + List keywordList) { + for (String keyword : keywordList) { + if (className.contains(keyword)) { + return true; + } + } + return false; + } + + /** + * @param resource the call-back resource for invoke-name-extracting. + * (NotNull) + * @param stackTrace Stack log. (NotNull) + * @return The result of invoke name. (NotNull: If not found, returns empty + * string.) + */ + protected InvokeNameResult extractInvokeName( + InvokeNameExtractingResource resource, + StackTraceElement[] stackTrace) { + final InvokeNameExtractorImpl extractor = new InvokeNameExtractorImpl(); + extractor.setStackTrace(stackTrace); + return extractor.extractInvokeName(resource); + } + + /** + * @param simpleClassName The simple class name. (NotNull) + * @return The simple class name removed the base prefix. (NotNull) + */ + protected String removeBasePrefixFromSimpleClassName(String simpleClassName) { + if (!simpleClassName.startsWith("Bs")) { + return simpleClassName; + } + final int prefixLength = "Bs".length(); + if (!Character.isUpperCase(simpleClassName.substring(prefixLength) + .charAt(0))) { + return simpleClassName; + } + if (simpleClassName.length() <= prefixLength) { + return simpleClassName; + } + return "" + simpleClassName.substring(prefixLength); + } + + protected String findBehaviorClassNameFromDBMeta(String tableDbName) { + final DBMeta dbmeta = DBMetaInstanceHandler.findDBMeta(tableDbName); + final String behaviorTypeName = dbmeta.getBehaviorTypeName(); + final String behaviorClassName = behaviorTypeName + .substring(behaviorTypeName.lastIndexOf(".") + ".".length()); + return removeBasePrefixFromSimpleClassName(behaviorClassName); + } + + //========================================================================== + // ========= + // Log Return + // ========== + protected void logReturn(BehaviorCommand behaviorCommand, + Class retType, Object ret, long before, long after) { + try { + final String daoResultPrefix = "===========/ [" + + TraceViewUtil.convertToPerformanceView(after - before) + + " - "; + if (List.class.isAssignableFrom(retType)) { + if (ret == null) { + log(daoResultPrefix + "Selected list: null]"); + } else { + final List ls = (java.util.List) ret; + if (ls.isEmpty()) { + log(daoResultPrefix + "Selected list: 0]"); + } else if (ls.size() == 1 && ls.get(0) instanceof Number) { + log(daoResultPrefix + "Selected count: " + ls.get(0) + + "]"); + } else { + log(daoResultPrefix + "Selected list: " + ls.size() + + " first=" + ls.get(0) + "]"); + } + } + } else if (Entity.class.isAssignableFrom(retType)) { + if (ret == null) { + log(daoResultPrefix + "Selected entity: null" + "]"); + } else { + final Entity entity = (Entity) ret; + log(daoResultPrefix + "Selected entity: " + entity + "]"); + } + } else if (Entity.class.isAssignableFrom(retType)) { + if (ret == null) { + log(daoResultPrefix + "Selected entity: null" + "]"); + } else { + final Entity entity = (Entity) ret; + log(daoResultPrefix + "Selected entity: " + entity + "]"); + } + } else if (int[].class.isAssignableFrom(retType)) { + if (ret == null) { + log(daoResultPrefix + "Selected entity: null" + "]"); + } else { + final int[] resultArray = (int[]) ret; + if (resultArray.length == 0) { + log(daoResultPrefix + "All updated count: 0]"); + } else { + final StringBuilder sb = new StringBuilder(); + boolean resultExpressionScope = true; + int resultCount = 0; + int loopCount = 0; + for (int element : resultArray) { + resultCount = resultCount + element; + if (resultExpressionScope) { + if (loopCount <= 10) { + if (sb.length() == 0) { + sb.append(element); + } else { + sb.append(",").append(element); + } + } else { + sb.append(",").append("..."); + resultExpressionScope = false; + } + } + ++loopCount; + } + sb.insert(0, "{").append("}"); + log(daoResultPrefix + "All updated count: " + + resultCount + " result=" + sb + "]"); + } + } + } else { + if (behaviorCommand.isSelectCount()) { + log(daoResultPrefix + "Selected count: " + ret + "]"); + } else { + log(daoResultPrefix + "Result: " + ret + "]"); + } + } + log(" "); + } catch (RuntimeException e) { + String msg = "Result object debug threw the exception: behaviorCommand="; + msg = msg + behaviorCommand + " retType=" + retType; + msg = msg + " ret=" + ret; + throw e; + } + } + + //========================================================================== + // ========= + // Context Helper + // ============== + protected OutsideSqlContext getOutsideSqlContext() { + if (!OutsideSqlContext.isExistOutsideSqlContextOnThread()) { + return null; + } + return OutsideSqlContext.getOutsideSqlContextOnThread(); + } + + protected void putObjectToMapContext(String key, Object value) { + InternalMapContext.setObject(key, value); + } + + protected void clearContext() { + if (OutsideSqlContext.isExistOutsideSqlContextOnThread()) { + OutsideSqlContext.clearOutsideSqlContextOnThread(); + } + if (FetchNarrowingBeanContext.isExistFetchNarrowingBeanOnThread()) { + // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + // - - - - - - - - - - - - - - - + // Because there is possible that fetch narrowing has been ignored + // for manualPaging of outsideSql. + // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + // - - - - - - - - - - - - - - - + FetchNarrowingBeanContext.getFetchNarrowingBeanOnThread() + .restoreIgnoredFetchNarrowing(); + + FetchNarrowingBeanContext.clearFetchNarrowingBeanOnThread(); + } + if (ConditionBeanContext.isExistConditionBeanOnThread()) { + ConditionBeanContext.clearConditionBeanOnThread(); + } + if (InternalMapContext.isExistInternalMapContextOnThread()) { + InternalMapContext.clearInternalMapContextOnThread(); + } + } + + //========================================================================== + // ========= + // Execute Status Log + // ================== + protected void log(String msg) { + XLog.log(msg); + } + + protected boolean isLogEnabled() { + return XLog.isLogEnabled(); + } + + protected StatementFactory createStatememtFactory() { + final StatementConfig defaultStatementConfig = DBFluteConfig + .getInstance().getDefaultStatementConfig(); + final boolean internalDebug = DBFluteConfig.getInstance() + .isInternalDebug(); + InternalStatementFactory factory = new InternalStatementFactory(); + factory.setDefaultStatementConfig(defaultStatementConfig); + factory.setInternalDebug(internalDebug); + return factory; + } + + //========================================================================== + // ========= + // Dispose + // ======= + public void toBeDisposable() { + DisposableUtil.add(this); + disposable = true; + } + + public void dispose() { + _executionMap.clear(); + disposable = false; + } + + public boolean isDisposable() { + return disposable; + } + + public boolean isExecutionCacheEmpty() { + return _executionMap.isEmpty(); + } + + //========================================================================== + // ========= + // Convert Helper + // ============== + protected Object convertPrimitiveWrapper(Class retType, Object ret) { + return SimpleTypeUtil.toWrapper(retType, ret); + } + + protected Object convertNumber(Class retType, Object ret) { + return SimpleTypeUtil.toNumber(retType, ret); + } + + //========================================================================== + // ========= + // Assert Helper + // ============= + protected void assertRetType(Class retType, Object ret) { + if (List.class.isAssignableFrom(retType)) { + if (ret != null && !(ret instanceof List)) { + String msg = "The retType is difference from actual return: "; + msg = msg + "retType=" + retType + " ret.getClass()=" + + ret.getClass() + " ref=" + ret; + throw new IllegalStateException(msg); + } + } else if (Entity.class.isAssignableFrom(retType)) { + if (ret != null && !(ret instanceof Entity)) { + String msg = "The retType is difference from actual return: "; + msg = msg + "retType=" + retType + " ret.getClass()=" + + ret.getClass() + " ref=" + ret; + throw new IllegalStateException(msg); + } + } + } + + //========================================================================== + // ========= + // General Helper + // ============== + protected String getLineSeparator() { + return SimpleSystemUtil.getLineSeparator(); + } + + //========================================================================== + // ========= + // Accessor + // ======== + public void setDataSource(DataSource dataSource) { + _dataSource = dataSource; + } + + public void setBeanMetaDataFactory(BeanMetaDataFactory beanMetaDataFactory) { + _beanMetaDataFactory = beanMetaDataFactory; + } + + public void setValueTypeFactory(ValueTypeFactory valueTypeFactory) { + _valueTypeFactory = valueTypeFactory; + } +} Property changes on: todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/bhv/core/BehaviorCommandInvoker.java ___________________________________________________________________ Name: svn:eol-style + native Added: todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/bhv/core/BehaviorInitializer.java =================================================================== --- todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/bhv/core/BehaviorInitializer.java (rev 0) +++ todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/bhv/core/BehaviorInitializer.java 2008-12-27 22:21:53 UTC (rev 1633) @@ -0,0 +1,178 @@ +package jp.sf.pal.todolist.db.allcommon.bhv.core; + +import java.util.Collections; +import java.util.Map; +import java.util.concurrent.ConcurrentHashMap; + +import javax.sql.XADataSource; + +import jp.sf.pal.todolist.db.allcommon.DBDef; +import jp.sf.pal.todolist.db.allcommon.DBFluteConfig; +import jp.sf.pal.todolist.db.allcommon.cbean.ConditionBeanContext; +import jp.sf.pal.todolist.db.allcommon.dbmeta.DBMetaInstanceHandler; +import jp.sf.pal.todolist.db.allcommon.s2dao.internal.sqllog.InternalSqlLogRegistry; +import jp.sf.pal.todolist.db.allcommon.util.SimpleSystemUtil; + +import org.seasar.extension.dbcp.impl.XADataSourceImpl; + +/** + * @author DBFlute(AutoGenerator) + */ +public class BehaviorInitializer { + + //========================================================================== + // ========= + // Definition + // ========== + /** Log-instance. */ + private static final org.apache.commons.logging.Log _log = org.apache.commons.logging.LogFactory + .getLog(BehaviorInitializer.class); + + // ----------------------------------------------------- + // For DBMeta + // ---------- + /** + * The map of table DB name and class name for the handler of DB meta + * instance. + */ + protected static final Map _tableDbNameClassNameMap; + static { + final Map tmpMap = newConcurrentHashMap(); + tmpMap.put("GROUP_INFO", + "jp.sf.pal.todolist.db.bsentity.dbmeta.GroupInfoDbm"); + tmpMap.put("GROUP_MAPPING", + "jp.sf.pal.todolist.db.bsentity.dbmeta.GroupMappingDbm"); + tmpMap.put("ROLE_INFO", + "jp.sf.pal.todolist.db.bsentity.dbmeta.RoleInfoDbm"); + tmpMap.put("ROLE_MAPPING", + "jp.sf.pal.todolist.db.bsentity.dbmeta.RoleMappingDbm"); + tmpMap.put("TODO", "jp.sf.pal.todolist.db.bsentity.dbmeta.TodoDbm"); + tmpMap.put("TODO_CATEGORY", + "jp.sf.pal.todolist.db.bsentity.dbmeta.TodoCategoryDbm"); + tmpMap.put("TODO_MAPPING", + "jp.sf.pal.todolist.db.bsentity.dbmeta.TodoMappingDbm"); + tmpMap.put("USER_INFO", + "jp.sf.pal.todolist.db.bsentity.dbmeta.UserInfoDbm"); + _tableDbNameClassNameMap = Collections.unmodifiableMap(tmpMap); + } + + protected static ConcurrentHashMap newConcurrentHashMap() { + return new ConcurrentHashMap(); + } + + //========================================================================== + // ========= + // Constructor + // =========== + /** + * Constructor. And initialize various components related behavior. + * + * @param xaDataSource The data source of XA. (Nullable) + */ + public BehaviorInitializer(XADataSource xaDataSource) { + _log + .info("/* * * * * * * * * * * * * * * * * * * * * * * * * * * * {DBFlute}"); + initializeDBMetaResource(); + handleSqlLogRegistry(); + loadCoolClasses(); + if (xaDataSource != null) { + showInformation(xaDataSource); + setupDBDefByDriverClassName(xaDataSource); + } + DBFluteConfig.getInstance().lock(); + _log.info("* * * * */"); + } + + //========================================================================== + // ========= + // DBMeta + // ====== + protected void initializeDBMetaResource() { + DBMetaInstanceHandler.setupDBMetaResource(_tableDbNameClassNameMap); + } + + //========================================================================== + // ========= + // Cool Classes + // ============ + protected void loadCoolClasses() { // for S2Container basically + ConditionBeanContext.loadCoolClasses(); // Against the ClassLoader + // Headache! + } + + //========================================================================== + // ========= + // Information + // =========== + protected void showInformation(XADataSource xaDataSource) { + if (xaDataSource != null && xaDataSource instanceof XADataSourceImpl) { + final StringBuilder sb = new StringBuilder(); + final XADataSourceImpl xaDataSourceImpl = (XADataSourceImpl) xaDataSource; + final String driverClassName = xaDataSourceImpl + .getDriverClassName(); + final String url = xaDataSourceImpl.getURL(); + final String user = xaDataSourceImpl.getUser(); + sb.append(" [XADataSource]:").append(getLineSeparator()); + sb.append(" driver = " + driverClassName).append( + getLineSeparator()); + sb.append(" url = " + url).append(getLineSeparator()); + sb.append(" user = " + user); + _log.info("{Injection Information}" + getLineSeparator() + sb); + } + } + + //========================================================================== + // ========= + // Database Product Name + // ===================== + protected void setupDBDefByDriverClassName(XADataSource xaDataSource) { + if (xaDataSource != null && xaDataSource instanceof XADataSourceImpl) { + final XADataSourceImpl xaDataSourceImpl = (XADataSourceImpl) xaDataSource; + final String driverClassName = xaDataSourceImpl + .getDriverClassName(); + final DBDef dbdef = DBDef.byDriverClassName(driverClassName); + if (dbdef != null) { + DBDef.setCurrentDef(dbdef); + return; + } + } + } + + //========================================================================== + // ========= + // SQL Log Registry + // ================ + protected void handleSqlLogRegistry() { + if (DBFluteConfig.getInstance().isUseSqlLogRegistry()) { + final StringBuilder sb = new StringBuilder(); + sb.append("{SqlLog Information}").append(getLineSeparator()); + sb.append(" [SqlLogRegistry]").append(getLineSeparator()); + if (InternalSqlLogRegistry.setupSqlLogRegistry()) { + sb + .append( + " ...Setting up SqlLogRegistry(org.seasar.extension.jdbc)!") + .append(getLineSeparator()); + sb + .append(" Because the property 'useSqlLogRegistry' of the config of DBFlute is true."); + } else { + sb + .append(" SqlLogRegistry(org.seasar.extension.jdbc) is not supported at the version!"); + } + _log.info(sb); + } else { + final Object sqlLogRegistry = InternalSqlLogRegistry + .findContainerSqlLogRegistry(); + if (sqlLogRegistry != null) { + InternalSqlLogRegistry.closeRegistration(); + } + } + } + + //========================================================================== + // ========= + // General Helper + // ============== + protected String getLineSeparator() { + return SimpleSystemUtil.getLineSeparator(); + } +} Property changes on: todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/bhv/core/BehaviorInitializer.java ___________________________________________________________________ Name: svn:eol-style + native Added: todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/bhv/core/SqlExecution.java =================================================================== --- todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/bhv/core/SqlExecution.java (rev 0) +++ todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/bhv/core/SqlExecution.java 2008-12-27 22:21:53 UTC (rev 1633) @@ -0,0 +1,9 @@ +package jp.sf.pal.todolist.db.allcommon.bhv.core; + +/** + * @author DBFlute(AutoGenerator) + */ +public interface SqlExecution { + + public Object execute(Object[] args); +} Property changes on: todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/bhv/core/SqlExecution.java ___________________________________________________________________ Name: svn:eol-style + native Added: todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/bhv/core/SqlExecutionCreator.java =================================================================== --- todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/bhv/core/SqlExecutionCreator.java (rev 0) +++ todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/bhv/core/SqlExecutionCreator.java 2008-12-27 22:21:53 UTC (rev 1633) @@ -0,0 +1,9 @@ +package jp.sf.pal.todolist.db.allcommon.bhv.core; + +/** + * @author DBFlute(AutoGenerator) + */ +public interface SqlExecutionCreator { + + SqlExecution createSqlExecution(); +} Property changes on: todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/bhv/core/SqlExecutionCreator.java ___________________________________________________________________ Name: svn:eol-style + native Added: todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/bhv/core/command/AbstractBehaviorCommand.java =================================================================== --- todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/bhv/core/command/AbstractBehaviorCommand.java (rev 0) +++ todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/bhv/core/command/AbstractBehaviorCommand.java 2008-12-27 22:21:53 UTC (rev 1633) @@ -0,0 +1,261 @@ +package jp.sf.pal.todolist.db.allcommon.bhv.core.command; + +import java.sql.ResultSet; +import java.sql.SQLException; +import java.util.ArrayList; +import java.util.List; + +import javax.sql.DataSource; + +import jp.sf.pal.todolist.db.allcommon.DBDef; +import jp.sf.pal.todolist.db.allcommon.bhv.core.BehaviorCommand; +import jp.sf.pal.todolist.db.allcommon.bhv.core.BehaviorCommandComponentSetup; +import jp.sf.pal.todolist.db.allcommon.s2dao.internal.rshandler.InternalBeanListMetaDataResultSetHandler; +import jp.sf.pal.todolist.db.allcommon.s2dao.internal.sqlcommand.InternalUpdateDynamicCommand; +import jp.sf.pal.todolist.db.allcommon.s2dao.internal.various.InternalRelationRowCreator; +import jp.sf.pal.todolist.db.allcommon.s2dao.internal.various.InternalRowCreator; + +import org.seasar.dao.BeanMetaData; +import org.seasar.dao.BeanMetaDataFactory; +import org.seasar.dao.ValueTypeFactory; +import org.seasar.extension.jdbc.ResultSetHandler; +import org.seasar.extension.jdbc.StatementFactory; +import org.seasar.extension.jdbc.ValueType; +import org.seasar.extension.jdbc.types.ValueTypes; + +/** + * @author DBFlute(AutoGenerator) + * @param The type of result. + */ +public abstract class AbstractBehaviorCommand implements + BehaviorCommand, BehaviorCommandComponentSetup { + + //========================================================================== + // ========= + // Attribute + // ========= + // ----------------------------------------------------- + // Basic Information + // ----------------- + /** The table DB name. (Required) */ + protected String _tableDbName; + + /** Is it initialize only? (Choice) */ + protected boolean _initializeOnly; + + // ----------------------------------------------------- + // Injection Component + // ------------------- + protected DataSource _dataSource; + + protected StatementFactory _statementFactory; + + protected BeanMetaDataFactory _beanMetaDataFactory; + + protected ValueTypeFactory _valueTypeFactory; + + protected String _sqlFileEncoding; + + //========================================================================== + // ========= + // Factory + // ======= + // ----------------------------------------------------- + // UpdateDynamicCommnd + // ------------------- + protected InternalUpdateDynamicCommand createUpdateDynamicCommand( + String[] argNames, Class[] argTypes, String sql) { + final InternalUpdateDynamicCommand cmd = new InternalUpdateDynamicCommand( + _dataSource, _statementFactory); + cmd.setArgNames(argNames); + cmd.setArgTypes(argTypes); + if (sql != null) { + cmd.setSql(sql); + } + return cmd; + } + + // ----------------------------------------------------- + // ResultSetHandler + // ---------------- + protected ResultSetHandler createBeanListMetaDataResultSetHandler( + BeanMetaData bmd) { + final InternalRowCreator rowCreator = createInternalRowCreator(bmd); + final InternalRelationRowCreator relationRowCreator = createInternalRelationRowCreator(bmd); + return new InternalBeanListMetaDataResultSetHandler(bmd, rowCreator, + relationRowCreator); + } + + protected ResultSetHandler createObjectResultSetHandler(Class objectType) { + final ValueType valueType = ValueTypes.getValueType(objectType); + return new InternalObjectResultSetHandler(valueType); + } + + protected ResultSetHandler createObjectListResultSetHandler( + Class objectType) { + final ValueType valueType = ValueTypes.getValueType(objectType); + return createObjectListResultSetHandler(valueType); + } + + protected ResultSetHandler createObjectListResultSetHandler( + ValueType valueType) { + return new InternalObjectListResultSetHandler(valueType); + } + + protected static class InternalObjectResultSetHandler implements + ResultSetHandler { + private ValueType valueType; + + public InternalObjectResultSetHandler(ValueType valueType) { + this.valueType = valueType; + } + + public Object handle(ResultSet rs) throws SQLException { + while (rs.next()) { + return valueType.getValue(rs, 1); + } + return null; + } + } + + protected static class InternalObjectListResultSetHandler implements + ResultSetHandler { + private ValueType valueType; + + public InternalObjectListResultSetHandler(ValueType valueType) { + this.valueType = valueType; + } + + public Object handle(ResultSet rs) throws SQLException { + final List ret = new ArrayList(); + while (rs.next()) { + ret.add(valueType.getValue(rs, 1)); + } + return ret; + } + } + + protected static class InternalNullResultSetHandler implements + ResultSetHandler { + public Object handle(ResultSet rs) throws SQLException { + return null; + } + } + + protected InternalRowCreator createInternalRowCreator(BeanMetaData bmd) { + final Class clazz = bmd != null ? bmd.getBeanClass() : null; + return InternalRowCreator.createInternalRowCreator(clazz); + } + + protected InternalRelationRowCreator createInternalRelationRowCreator( + BeanMetaData bmd) { + return new InternalRelationRowCreator(); // Not yet implemented about + // performance tuning! + } + + //========================================================================== + // ========= + // Assist Helper + // ============= + protected String buildDbmsSuffix() { + final String productName = DBDef.getCurrentDef().code(); + return (productName != null ? "_" + productName.toLowerCase() : ""); + } + + //========================================================================== + // ========= + // Assert Helper + // ============= + protected void assertBasicProperty(String methodName) { + if (_tableDbName == null) { + throw new IllegalStateException(buildAssertMessage("_tableDbName", + methodName)); + } + } + + protected void assertComponentProperty(String methodName) { + if (_dataSource == null) { + throw new IllegalStateException(buildAssertMessage("_dataSource", + methodName)); + } + if (_statementFactory == null) { + throw new IllegalStateException(buildAssertMessage( + "_statementFactory", methodName)); + } + if (_beanMetaDataFactory == null) { + throw new IllegalStateException(buildAssertMessage( + "_beanMetaDataFactory", methodName)); + } + if (_valueTypeFactory == null) { + throw new IllegalStateException(buildAssertMessage( + "_valueTypeFactory", methodName)); + } + if (_sqlFileEncoding == null) { + throw new IllegalStateException(buildAssertMessage( + "_sqlFileEncoding", methodName)); + } + } + + protected String buildAssertMessage(String propertyName, String methodName) { + propertyName = propertyName.startsWith("_") ? propertyName + .substring("_".length()) : propertyName; + String msg = "The property '" + propertyName + "' should not be null"; + msg = msg + " when you call " + methodName + "()."; + throw new IllegalStateException(msg); + } + + //========================================================================== + // ========= + // Basic Override + // ============== + @Override + public String toString() { + return getClass().getSimpleName() + ":{" + buildSqlExecutionKey() + "}"; + } + + //========================================================================== + // ========= + // Accessor + // ======== + // ----------------------------------------------------- + // Basic Information + // ----------------- + public String getTableDbName() { + return _tableDbName; + } + + public void setTableDbName(String tableDbName) { + _tableDbName = tableDbName; + } + + public void setInitializeOnly(boolean initializeOnly) { + _initializeOnly = initializeOnly; + } + + public boolean isInitializeOnly() { + return _initializeOnly; + } + + // ----------------------------------------------------- + // Injection Component + // ------------------- + public void setDataSource(DataSource dataSource) { + _dataSource = dataSource; + } + + public void setStatementFactory(StatementFactory statementFactory) { + _statementFactory = statementFactory; + } + + public void setBeanMetaDataFactory(BeanMetaDataFactory beanMetaDataFactory) { + _beanMetaDataFactory = beanMetaDataFactory; + } + + public void setValueTypeFactory(ValueTypeFactory valueTypeFactory) { + _valueTypeFactory = valueTypeFactory; + } + + public void setSqlFileEncoding(String sqlFileEncoding) { + _sqlFileEncoding = sqlFileEncoding; + } +} Property changes on: todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/bhv/core/command/AbstractBehaviorCommand.java ___________________________________________________________________ Name: svn:eol-style + native Added: todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/bhv/core/command/AbstractEntityCommand.java =================================================================== --- todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/bhv/core/command/AbstractEntityCommand.java (rev 0) +++ todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/bhv/core/command/AbstractEntityCommand.java 2008-12-27 22:21:53 UTC (rev 1633) @@ -0,0 +1,182 @@ +package jp.sf.pal.todolist.db.allcommon.bhv.core.command; + +import java.util.ArrayList; +import java.util.List; + +import jp.sf.pal.todolist.db.allcommon.Entity; +import jp.sf.pal.todolist.db.allcommon.cbean.ConditionBean; +import jp.sf.pal.todolist.db.allcommon.cbean.outsidesql.OutsideSqlOption; +import jp.sf.pal.todolist.db.allcommon.dbmeta.DBMeta; + +import org.seasar.dao.BeanMetaData; +import org.seasar.extension.jdbc.PropertyType; + +/** + * @author DBFlute(AutoGenerator) + */ +public abstract class AbstractEntityCommand extends + AbstractBehaviorCommand { + + //========================================================================== + // ========= + // Attribute + // ========= + /** The type of entity. (Required) */ + protected Class _entityType; + + /** The instance of condition-bean. (Required) */ + protected Entity _entity; + + //========================================================================== + // ========= + // Basic Information + // ================= + public Class getCommandReturnType() { + return Integer.class; + } + + //========================================================================== + // ========= + // Detail Information + // ================== + public boolean isConditionBean() { + return false; + } + + public boolean isOutsideSql() { + return false; + } + + public boolean isProcedure() { + return false; + } + + public boolean isSelect() { + return false; + } + + public boolean isSelectCount() { + return false; + } + + //========================================================================== + // ========= + // Factory + // ======= + // ----------------------------------------------------- + // BeanMetaData + // ------------ + protected BeanMetaData createBeanMetaData() { + return _beanMetaDataFactory.createBeanMetaData(_entityType); + } + + //========================================================================== + // ========= + // Process Callback + // ================ + public void beforeGettingSqlExecution() { + } + + public void afterExecuting() { + } + + //========================================================================== + // ========= + // SqlExecution Handling + // ===================== + public String buildSqlExecutionKey() { + assertStatus("buildSqlExecutionKey"); + return _tableDbName + ":" + getCommandName() + "(" + + _entityType.getSimpleName() + ")"; + } + + public Object[] getSqlExecutionArgument() { + assertStatus("getSqlExecutionArgument"); + return new Object[] { _entity }; + } + + //========================================================================== + // ========= + // Argument Information + // ==================== + public ConditionBean getConditionBean() { + return null; + } + + public String getOutsideSqlPath() { + return null; + } + + public OutsideSqlOption getOutsideSqlOption() { + return null; + } + + //========================================================================== + // ========= + // Assist Helper + // ============= + protected DBMeta findDBMeta() { + // /- - - - - - - - - - - - - - - - - - - - - - - - - - - - + // Cannot use the handler of DBMeta instance + // because the customize-entity is contained to find here. + // - - - - - - - - - -/ + // DBMetaInstanceHandler.findDBMeta(_tableDbName); + + final Class beanType = _entityType; + if (beanType == null) { + return null; + } + if (!Entity.class.isAssignableFrom(beanType)) { + return null; + } + final Entity entity; + try { + entity = (Entity) beanType.newInstance(); + } catch (InstantiationException e) { + throw new IllegalStateException(e); + } catch (IllegalAccessException e) { + throw new IllegalStateException(e); + } + return entity.getDBMeta(); + } + + protected String[] getPersistentPropertyNames(BeanMetaData bmd) { + final List nameList = new ArrayList(); + for (int i = 0; i < bmd.getPropertyTypeSize(); ++i) { + final PropertyType pt = bmd.getPropertyType(i); + if (pt.isPersistent()) { + nameList.add(pt.getPropertyName()); + } + } + return nameList.toArray(new String[nameList.size()]); + } + + //========================================================================== + // ========= + // Assert Helper + // ============= + protected void assertStatus(String methodName) { + assertBasicProperty(methodName); + assertComponentProperty(methodName); + if (_entityType == null) { + throw new IllegalStateException(buildAssertMessage("_entityType", + methodName)); + } + if (_entity == null) { + throw new IllegalStateException(buildAssertMessage("_entity", + methodName)); + } + } + + //========================================================================== + // ========= + // Accessor + // ======== + public void setEntityType(Class entityType) { + _entityType = entityType; + } + + public void setEntity(Entity entity) { + _entity = entity; + } +} Property changes on: todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/bhv/core/command/AbstractEntityCommand.java ___________________________________________________________________ Name: svn:eol-style + native Added: todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/bhv/core/command/AbstractListEntityCommand.java =================================================================== --- todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/bhv/core/command/AbstractListEntityCommand.java (rev 0) +++ todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/bhv/core/command/AbstractListEntityCommand.java 2008-12-27 22:21:53 UTC (rev 1633) @@ -0,0 +1,182 @@ +package jp.sf.pal.todolist.db.allcommon.bhv.core.command; + +import java.util.ArrayList; +import java.util.List; + +import jp.sf.pal.todolist.db.allcommon.Entity; +import jp.sf.pal.todolist.db.allcommon.cbean.ConditionBean; +import jp.sf.pal.todolist.db.allcommon.cbean.outsidesql.OutsideSqlOption; +import jp.sf.pal.todolist.db.allcommon.dbmeta.DBMeta; + +import org.seasar.dao.BeanMetaData; +import org.seasar.extension.jdbc.PropertyType; + +/** + * @author DBFlute(AutoGenerator) + */ +public abstract class AbstractListEntityCommand extends + AbstractBehaviorCommand { + + //========================================================================== + // ========= + // Attribute + // ========= + /** The type of entity. (Required) */ + protected Class _entityType; + + /** The instance of condition-bean. (Required) */ + protected List _entityList; + + //========================================================================== + // ========= + // Basic Information + // ================= + public Class getCommandReturnType() { + return int[].class; + } + + //========================================================================== + // ========= + // Detail Information + // ================== + public boolean isConditionBean() { + return false; + } + + public boolean isOutsideSql() { + return false; + } + + public boolean isProcedure() { + return false; + } + + public boolean isSelect() { + return false; + } + + public boolean isSelectCount() { + return false; + } + + //========================================================================== + // ========= + // Factory + // ======= + // ----------------------------------------------------- + // BeanMetaData + // ------------ + protected BeanMetaData createBeanMetaData() { + return _beanMetaDataFactory.createBeanMetaData(_entityType); + } + + //========================================================================== + // ========= + // Process Callback + // ================ + public void beforeGettingSqlExecution() { + } + + public void afterExecuting() { + } + + //========================================================================== + // ========= + // SqlExecution Handling + // ===================== + public String buildSqlExecutionKey() { + assertStatus("buildSqlExecutionKey"); + return _tableDbName + ":" + getCommandName() + "(List<" + + _entityType.getSimpleName() + ">)"; + } + + public Object[] getSqlExecutionArgument() { + assertStatus("getSqlExecutionArgument"); + return new Object[] { _entityList }; + } + + //========================================================================== + // ========= + // Argument Information + // ==================== + public ConditionBean getConditionBean() { + return null; + } + + public String getOutsideSqlPath() { + return null; + } + + public OutsideSqlOption getOutsideSqlOption() { + return null; + } + + //========================================================================== + // ========= + // Assist Helper + // ============= + protected DBMeta findDBMeta() { + // /- - - - - - - - - - - - - - - - - - - - - - - - - - - - + // Cannot use the handler of DBMeta instance + // because the customize-entity is contained to find here. + // - - - - - - - - - -/ + // DBMetaInstanceHandler.findDBMeta(_tableDbName); + + final Class beanType = _entityType; + if (beanType == null) { + return null; + } + if (!Entity.class.isAssignableFrom(beanType)) { + return null; + } + final Entity entity; + try { + entity = (Entity) beanType.newInstance(); + } catch (InstantiationException e) { + throw new IllegalStateException(e); + } catch (IllegalAccessException e) { + throw new IllegalStateException(e); + } + return entity.getDBMeta(); + } + + protected String[] getPersistentPropertyNames(BeanMetaData bmd) { + final List nameList = new ArrayList(); + for (int i = 0; i < bmd.getPropertyTypeSize(); ++i) { + final PropertyType pt = bmd.getPropertyType(i); + if (pt.isPersistent()) { + nameList.add(pt.getPropertyName()); + } + } + return nameList.toArray(new String[nameList.size()]); + } + + //========================================================================== + // ========= + // Assert Helper + // ============= + protected void assertStatus(String methodName) { + assertBasicProperty(methodName); + assertComponentProperty(methodName); + if (_entityType == null) { + throw new IllegalStateException(buildAssertMessage("_entityType", + methodName)); + } + if (_entityList == null) { + throw new IllegalStateException(buildAssertMessage("_entityList", + methodName)); + } + } + + //========================================================================== + // ========= + // Accessor + // ======== + public void setEntityType(Class entityType) { + _entityType = entityType; + } + + public void setEntityList(List entityList) { + _entityList = entityList; + } +} Property changes on: todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/bhv/core/command/AbstractListEntityCommand.java ___________________________________________________________________ Name: svn:eol-style + native Added: todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/bhv/core/command/AbstractOutsideSqlCommand.java =================================================================== --- todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/bhv/core/command/AbstractOutsideSqlCommand.java (rev 0) +++ todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/bhv/core/command/AbstractOutsideSqlCommand.java 2008-12-27 22:21:53 UTC (rev 1633) @@ -0,0 +1,93 @@ +package jp.sf.pal.todolist.db.allcommon.bhv.core.command; + +import jp.sf.pal.todolist.db.allcommon.cbean.ConditionBean; +import jp.sf.pal.todolist.db.allcommon.cbean.outsidesql.OutsideSqlOption; + +/** + * @author DBFlute(AutoGenerator) + * @param The type of result. + */ +public abstract class AbstractOutsideSqlCommand extends + AbstractBehaviorCommand { + + //========================================================================== + // ========= + // Attribute + // ========= + // ----------------------------------------------------- + // Basic Information + // ----------------- + /** The path of outside-SQL. (Required) */ + protected String _outsideSqlPath; + + /** The parameter-bean. (Required to set, but Nullable) */ + protected Object _parameterBean; + + /** The option of outside-SQL. (Required) */ + protected OutsideSqlOption _outsideSqlOption; + + //========================================================================== + // ========= + // Detail Information + // ================== + public boolean isConditionBean() { + return false; // When the command is for outside-SQL, it always be + // false. + } + + public boolean isOutsideSql() { + return true; + } + + public boolean isSelectCount() { + return false; // When the command is for outside-SQL, it always be + // false. + } + + //========================================================================== + // ========= + // Argument Information + // ==================== + public ConditionBean getConditionBean() { + return null; + } + + public String getOutsideSqlPath() { + return _outsideSqlPath; + } + + public OutsideSqlOption getOutsideSqlOption() { + return _outsideSqlOption; + } + + //========================================================================== + // ========= + // Assert Helper + // ============= + protected void assertOutsideSqlBasic(String methodName) { + if (_outsideSqlPath == null) { + throw new IllegalStateException(buildAssertMessage( + "_outsideSqlPath", methodName)); + } + if (_outsideSqlOption == null) { + throw new IllegalStateException(buildAssertMessage( + "_outsideSqlOption", methodName)); + } + } + + //========================================================================== + // ========= + // Accessor + // ======== + public void setOutsideSqlPath(String outsideSqlPath) { + _outsideSqlPath = outsideSqlPath; + } + + public void setParameterBean(Object parameterBean) { + _parameterBean = parameterBean; + } + + public void setOutsideSqlOption(OutsideSqlOption outsideSqlOption) { + _outsideSqlOption = outsideSqlOption; + } +} Property changes on: todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/bhv/core/command/AbstractOutsideSqlCommand.java ___________________________________________________________________ Name: svn:eol-style + native Added: todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/bhv/core/command/AbstractOutsideSqlSelectCommand.java =================================================================== --- todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/bhv/core/command/AbstractOutsideSqlSelectCommand.java (rev 0) +++ todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/bhv/core/command/AbstractOutsideSqlSelectCommand.java 2008-12-27 22:21:53 UTC (rev 1633) @@ -0,0 +1,175 @@ +package jp.sf.pal.todolist.db.allcommon.bhv.core.command; + +import jp.sf.pal.todolist.db.allcommon.bhv.core.SqlExecution; +import jp.sf.pal.todolist.db.allcommon.bhv.core.SqlExecutionCreator; +import jp.sf.pal.todolist.db.allcommon.bhv.core.execution.OutsideSqlSelectExecution; +import jp.sf.pal.todolist.db.allcommon.cbean.FetchNarrowingBean; +import jp.sf.pal.todolist.db.allcommon.cbean.FetchNarrowingBeanContext; +import jp.sf.pal.todolist.db.allcommon.cbean.outsidesql.OutsideSqlContext; +import jp.sf.pal.todolist.db.allcommon.cbean.outsidesql.OutsideSqlOption; + +import org.seasar.extension.jdbc.ResultSetHandler; + +/** + * The abstract command for OutsideSql.selectSomething(). + * + * @author DBFlute(AutoGenerator) + * @param The type of result. + */ +public abstract class AbstractOutsideSqlSelectCommand extends + AbstractOutsideSqlCommand { + + //========================================================================== + // ========= + // Detail Information + // ================== + public boolean isProcedure() { + return false; + } + + public boolean isSelect() { + return true; + } + + //========================================================================== + // ========= + // Process Callback + // ================ + public void beforeGettingSqlExecution() { + assertStatus("beforeGettingSqlExecution"); + final String path = _outsideSqlPath; + final Object pmb = _parameterBean; + final OutsideSqlOption option = _outsideSqlOption; + final Object resultTypeSpecification = getResultTypeSpecification(); + final boolean autoPagingLogging = (option.isAutoPaging() || option + .isSourcePagingRequestTypeAuto()); + final OutsideSqlContext outsideSqlContext = new OutsideSqlContext(); + outsideSqlContext.setOutsideSqlPath(path); + outsideSqlContext.setParameterBean(pmb); + outsideSqlContext.setResultTypeSpecification(resultTypeSpecification); + outsideSqlContext.setMethodName(getCommandName()); + outsideSqlContext.setStatementConfig(option.getStatementConfig()); + outsideSqlContext.setTableDbName(option.getTableDbName()); + outsideSqlContext.setDynamicBinding(option.isDynamicBinding()); + outsideSqlContext.setOffsetByCursorForcedly(option.isAutoPaging()); + outsideSqlContext.setLimitByCursorForcedly(option.isAutoPaging()); + outsideSqlContext.setAutoPagingLogging(autoPagingLogging); // for + // logging + outsideSqlContext.setupBehaviorQueryPathIfNeeds(); + OutsideSqlContext.setOutsideSqlContextOnThread(outsideSqlContext); + + // Set up fetchNarrowingBean. + setupOutsideSqlFetchNarrowingBean(pmb, option); + } + + protected void setupOutsideSqlFetchNarrowingBean(Object pmb, + OutsideSqlOption option) { + if (pmb == null + || !FetchNarrowingBeanContext.isTheTypeFetchNarrowingBean(pmb + .getClass())) { + return; + } + final FetchNarrowingBean fetchNarrowingBean = (FetchNarrowingBean) pmb; + if (option.isManualPaging()) { + fetchNarrowingBean.ignoreFetchNarrowing(); + } + FetchNarrowingBeanContext + .setFetchNarrowingBeanOnThread(fetchNarrowingBean); + } + + public void afterExecuting() { + } + + //========================================================================== + // ========= + // SqlExecution Handling + // ===================== + public String buildSqlExecutionKey() { + assertStatus("buildSqlExecutionKey"); + return generateSpecifiedOutsideSqlUniqueKey(); + } + + protected String generateSpecifiedOutsideSqlUniqueKey() { + final String methodName = getCommandName(); + final String path = _outsideSqlPath; + final Object pmb = _parameterBean; + final OutsideSqlOption option = _outsideSqlOption; + final Object resultTypeSpecification = getResultTypeSpecification(); + return OutsideSqlContext.generateSpecifiedOutsideSqlUniqueKey( + methodName, path, pmb, option, resultTypeSpecification); + } + + public SqlExecutionCreator createSqlExecutionCreator() { + assertStatus("createSqlExecutionCreator"); + return new SqlExecutionCreator() { + public SqlExecution createSqlExecution() { + final OutsideSqlContext outsideSqlContext = OutsideSqlContext + .getOutsideSqlContextOnThread(); + return createOutsideSqlSelectExecution(outsideSqlContext); + } + }; + } + + protected SqlExecution createOutsideSqlSelectExecution( + OutsideSqlContext outsideSqlContext) { + // - - - - - - - - - - - - - - - - - - - - - - - + // The attribute of Specified-OutsideSqlContext. + // - - - - - - - - - - - - - - - - - - - - - - - + final String suffix = buildDbmsSuffix(); + final String sql = outsideSqlContext.readFilteredOutsideSql( + _sqlFileEncoding, suffix); + final Object pmb = outsideSqlContext.getParameterBean(); + + // - - - - - - - - - - - - - - - + // The attribute of SqlCommand. + // - - - - - - - - - - - - - - - + final String[] argNames = (pmb != null ? new String[] { "pmb" } + : new String[] {}); + final Class[] argTypes = (pmb != null ? new Class[] { pmb + .getClass() } : new Class[] {}); + + // - - - - - - - - - - - - - + // Create ResultSetHandler. + // - - - - - - - - - - - - - + final ResultSetHandler handler = createOutsideSqlSelectResultSetHandler(); + + // - - - - - - - - - - - + // Create SqlExecution. + // - - - - - - - - - - - + return createOutsideSqlSelectExecution(handler, argNames, argTypes, sql); + } + + protected OutsideSqlSelectExecution createOutsideSqlSelectExecution( + ResultSetHandler handler, String[] argNames, Class[] argTypes, + String sql) { + final OutsideSqlSelectExecution cmd = new OutsideSqlSelectExecution( + _dataSource, _statementFactory, handler); + cmd.setArgNames(argNames); + cmd.setArgTypes(argTypes); + cmd.setSql(sql); + return cmd; + } + + public Object[] getSqlExecutionArgument() { + assertStatus("getSqlExecutionArgument"); + return new Object[] { _parameterBean }; + } + + //========================================================================== + // ========= + // Extension Point + // =============== + protected abstract ResultSetHandler createOutsideSqlSelectResultSetHandler(); + + protected abstract Object getResultTypeSpecification(); + + //========================================================================== + // ========= + // Assert Helper + // ============= + protected void assertStatus(String methodName) { + assertBasicProperty(methodName); + assertComponentProperty(methodName); + assertOutsideSqlBasic(methodName); + } +} Property changes on: todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/bhv/core/command/AbstractOutsideSqlSelectCommand.java ___________________________________________________________________ Name: svn:eol-style + native Added: todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/bhv/core/command/AbstractSelectCBCommand.java =================================================================== --- todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/bhv/core/command/AbstractSelectCBCommand.java (rev 0) +++ todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/bhv/core/command/AbstractSelectCBCommand.java 2008-12-27 22:21:53 UTC (rev 1633) @@ -0,0 +1,122 @@ +package jp.sf.pal.todolist.db.allcommon.bhv.core.command; + +import jp.sf.pal.todolist.db.allcommon.bhv.core.SqlExecution; +import jp.sf.pal.todolist.db.allcommon.bhv.core.execution.SelectCBExecution; +import jp.sf.pal.todolist.db.allcommon.cbean.ConditionBean; +import jp.sf.pal.todolist.db.allcommon.cbean.outsidesql.OutsideSqlOption; + +import org.seasar.extension.jdbc.ResultSetHandler; + +/** + * @author DBFlute(AutoGenerator) + * @param The type of result. + */ +public abstract class AbstractSelectCBCommand extends + AbstractBehaviorCommand { + + //========================================================================== + // ========= + // Attribute + // ========= + /** The type of condition-bean. (Derived from conditionBean) */ + protected Class _conditionBeanType; + + /** The instance of condition-bean. (Required) */ + protected ConditionBean _conditionBean; + + //========================================================================== + // ========= + // Detail Information + // ================== + public boolean isConditionBean() { + return true; + } + + public boolean isOutsideSql() { + return false; + } + + public boolean isProcedure() { + return false; + } + + public boolean isSelect() { + return true; + } + + //========================================================================== + // ========= + // SqlExecution Handling + // ===================== + public String buildSqlExecutionKey() { + assertStatus("buildSqlExecutionKey"); + return _tableDbName + ":" + getCommandName() + "(" + + _conditionBeanType.getSimpleName() + ")"; + } + + protected SqlExecution createSelectCBExecution( + Class cbType, ResultSetHandler handler) { + return createSelectCBExecution(handler, new String[] { "dto" }, + new Class[] { cbType }); + } + + protected SelectCBExecution createSelectCBExecution( + ResultSetHandler handler, String[] argNames, Class[] argTypes) { + final SelectCBExecution cmd = new SelectCBExecution(_dataSource, + _statementFactory, handler); + cmd.setArgNames(argNames); + cmd.setArgTypes(argTypes); + return cmd; + } + + public Object[] getSqlExecutionArgument() { + assertStatus("getSqlExecutionArgument"); + return new Object[] { _conditionBean }; + } + + //========================================================================== + // ========= + // Argument Information + // ==================== + public ConditionBean getConditionBean() { + return _conditionBean; + } + + public String getOutsideSqlPath() { + return null; + } + + public OutsideSqlOption getOutsideSqlOption() { + return null; + } + + //========================================================================== + // ========= + // Assert Helper + // ============= + protected void assertStatus(String methodName) { + assertBasicProperty(methodName); + assertComponentProperty(methodName); + if (_conditionBeanType == null) { + throw new IllegalStateException(buildAssertMessage( + "_conditionBeanType", methodName)); + } + if (_conditionBean == null) { + throw new IllegalStateException(buildAssertMessage( + "_conditionBean", methodName)); + } + } + + //========================================================================== + // ========= + // Accessor + // ======== + public void setConditionBeanType( + Class conditionBeanType) { + _conditionBeanType = conditionBeanType; + } + + public void setConditionBean(ConditionBean conditionBean) { + _conditionBean = conditionBean; + } +} Property changes on: todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/bhv/core/command/AbstractSelectCBCommand.java ___________________________________________________________________ Name: svn:eol-style + native Added: todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/bhv/core/command/BatchDeleteEntityCommand.java =================================================================== --- todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/bhv/core/command/BatchDeleteEntityCommand.java (rev 0) +++ todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/bhv/core/command/BatchDeleteEntityCommand.java 2008-12-27 22:21:53 UTC (rev 1633) @@ -0,0 +1,51 @@ +package jp.sf.pal.todolist.db.allcommon.bhv.core.command; + +import jp.sf.pal.todolist.db.allcommon.bhv.core.SqlExecution; +import jp.sf.pal.todolist.db.allcommon.bhv.core.SqlExecutionCreator; +import jp.sf.pal.todolist.db.allcommon.s2dao.internal.sqlcommand.InternalDeleteBatchAutoStaticCommand; + +import org.seasar.dao.BeanMetaData; + +/** + * @author DBFlute(AutoGenerator) + */ +public class BatchDeleteEntityCommand extends AbstractListEntityCommand { + + //========================================================================== + // ========= + // Basic Information + // ================= + public String getCommandName() { + return "batchDelete"; + } + + //========================================================================== + // ========= + // SqlExecution Handling + // ===================== + public SqlExecutionCreator createSqlExecutionCreator() { + assertStatus("createSqlExecutionCreator"); + return new SqlExecutionCreator() { + public SqlExecution createSqlExecution() { + final BeanMetaData bmd = createBeanMetaData(); + return createBatchDeleteEntitySqlExecution(bmd); + } + }; + } + + protected SqlExecution createBatchDeleteEntitySqlExecution(BeanMetaData bmd) { + final String[] propertyNames = getPersistentPropertyNames(bmd); + return createDeleteBatchAutoStaticCommand(bmd, propertyNames); + } + + protected InternalDeleteBatchAutoStaticCommand createDeleteBatchAutoStaticCommand( + BeanMetaData bmd, String[] propertyNames) { + boolean opt = isOptimisticLockHandling(); + return new InternalDeleteBatchAutoStaticCommand(_dataSource, + _statementFactory, bmd, propertyNames, opt); + } + + protected boolean isOptimisticLockHandling() { + return true; + } +} Property changes on: todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/bhv/core/command/BatchDeleteEntityCommand.java ___________________________________________________________________ Name: svn:eol-style + native Added: todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/bhv/core/command/BatchDeleteNonstrictEntityCommand.java =================================================================== --- todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/bhv/core/command/BatchDeleteNonstrictEntityCommand.java (rev 0) +++ todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/bhv/core/command/BatchDeleteNonstrictEntityCommand.java 2008-12-27 22:21:53 UTC (rev 1633) @@ -0,0 +1,25 @@ +package jp.sf.pal.todolist.db.allcommon.bhv.core.command; + +/** + * @author DBFlute(AutoGenerator) + */ +public class BatchDeleteNonstrictEntityCommand extends BatchDeleteEntityCommand { + + //========================================================================== + // ========= + // Basic Information + // ================= + @Override + public String getCommandName() { + return "batchDeleteNonstrict"; + } + + //========================================================================== + // ========= + // SqlExecution Handling + // ===================== + @Override + protected boolean isOptimisticLockHandling() { + return false; + } +} Property changes on: todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/bhv/core/command/BatchDeleteNonstrictEntityCommand.java ___________________________________________________________________ Name: svn:eol-style + native Added: todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/bhv/core/command/BatchInsertEntityCommand.java =================================================================== --- todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/bhv/core/command/BatchInsertEntityCommand.java (rev 0) +++ todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/bhv/core/command/BatchInsertEntityCommand.java 2008-12-27 22:21:53 UTC (rev 1633) @@ -0,0 +1,46 @@ +package jp.sf.pal.todolist.db.allcommon.bhv.core.command; + +import jp.sf.pal.todolist.db.allcommon.bhv.core.SqlExecution; +import jp.sf.pal.todolist.db.allcommon.bhv.core.SqlExecutionCreator; +import jp.sf.pal.todolist.db.allcommon.s2dao.internal.sqlcommand.InternalInsertBatchAutoStaticCommand; + +import org.seasar.dao.BeanMetaData; + +/** + * @author DBFlute(AutoGenerator) + */ +public class BatchInsertEntityCommand extends AbstractListEntityCommand { + + //========================================================================== + // ========= + // Basic Information + // ================= + public String getCommandName() { + return "batchInsert"; + } + + //========================================================================== + // ========= + // SqlExecution Handling + // ===================== + public SqlExecutionCreator createSqlExecutionCreator() { + assertStatus("createSqlExecutionCreator"); + return new SqlExecutionCreator() { + public SqlExecution createSqlExecution() { + final BeanMetaData bmd = createBeanMetaData(); + return createBatchInsertEntitySqlExecution(bmd); + } + }; + } + + protected SqlExecution createBatchInsertEntitySqlExecution(BeanMetaData bmd) { + final String[] propertyNames = getPersistentPropertyNames(bmd); + return createInsertBatchAutoStaticCommand(bmd, propertyNames); + } + + protected InternalInsertBatchAutoStaticCommand createInsertBatchAutoStaticCommand( + BeanMetaData bmd, String[] propertyNames) { + return new InternalInsertBatchAutoStaticCommand(_dataSource, + _statementFactory, bmd, propertyNames); + } +} Property changes on: todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/bhv/core/command/BatchInsertEntityCommand.java ___________________________________________________________________ Name: svn:eol-style + native Added: todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/bhv/core/command/BatchUpdateEntityCommand.java =================================================================== --- todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/bhv/core/command/BatchUpdateEntityCommand.java (rev 0) +++ todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/bhv/core/command/BatchUpdateEntityCommand.java 2008-12-27 22:21:53 UTC (rev 1633) @@ -0,0 +1,51 @@ +package jp.sf.pal.todolist.db.allcommon.bhv.core.command; + +import jp.sf.pal.todolist.db.allcommon.bhv.core.SqlExecution; +import jp.sf.pal.todolist.db.allcommon.bhv.core.SqlExecutionCreator; +import jp.sf.pal.todolist.db.allcommon.s2dao.internal.sqlcommand.InternalUpdateBatchAutoStaticCommand; + +import org.seasar.dao.BeanMetaData; + +/** + * @author DBFlute(AutoGenerator) + */ +public class BatchUpdateEntityCommand extends AbstractListEntityCommand { + + //========================================================================== + // ========= + // Basic Information + // ================= + public String getCommandName() { + return "batchUpdate"; + } + + //========================================================================== + // ========= + // SqlExecution Handling + // ===================== + public SqlExecutionCreator createSqlExecutionCreator() { + assertStatus("createSqlExecutionCreator"); + return new SqlExecutionCreator() { + public SqlExecution createSqlExecution() { + final BeanMetaData bmd = createBeanMetaData(); + return createBatchUpdateEntitySqlExecution(bmd); + } + }; + } + + protected SqlExecution createBatchUpdateEntitySqlExecution(BeanMetaData bmd) { + final String[] propertyNames = getPersistentPropertyNames(bmd); + return createUpdateBatchAutoStaticCommand(bmd, propertyNames); + } + + protected InternalUpdateBatchAutoStaticCommand createUpdateBatchAutoStaticCommand( + BeanMetaData bmd, String[] propertyNames) { + boolean opt = isOptimisticLockHandling(); + return new InternalUpdateBatchAutoStaticCommand(_dataSource, + _statementFactory, bmd, propertyNames, opt, opt); + } + + protected boolean isOptimisticLockHandling() { + return true; + } +} Property changes on: todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/bhv/core/command/BatchUpdateEntityCommand.java ___________________________________________________________________ Name: svn:eol-style + native Added: todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/bhv/core/command/BatchUpdateNonstrictEntityCommand.java =================================================================== --- todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/bhv/core/command/BatchUpdateNonstrictEntityCommand.java (rev 0) +++ todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/bhv/core/command/BatchUpdateNonstrictEntityCommand.java 2008-12-27 22:21:53 UTC (rev 1633) @@ -0,0 +1,25 @@ +package jp.sf.pal.todolist.db.allcommon.bhv.core.command; + +/** + * @author DBFlute(AutoGenerator) + */ +public class BatchUpdateNonstrictEntityCommand extends BatchUpdateEntityCommand { + + //========================================================================== + // ========= + // Basic Information + // ================= + @Override + public String getCommandName() { + return "batchUpdateNonstrict"; + } + + //========================================================================== + // ========= + // SqlExecution Handling + // ===================== + @Override + protected boolean isOptimisticLockHandling() { + return false; + } +} Property changes on: todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/bhv/core/command/BatchUpdateNonstrictEntityCommand.java ___________________________________________________________________ Name: svn:eol-style + native Added: todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/bhv/core/command/DeleteEntityCommand.java =================================================================== --- todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/bhv/core/command/DeleteEntityCommand.java (rev 0) +++ todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/bhv/core/command/DeleteEntityCommand.java 2008-12-27 22:21:53 UTC (rev 1633) @@ -0,0 +1,51 @@ +package jp.sf.pal.todolist.db.allcommon.bhv.core.command; + +import jp.sf.pal.todolist.db.allcommon.bhv.core.SqlExecution; +import jp.sf.pal.todolist.db.allcommon.bhv.core.SqlExecutionCreator; +import jp.sf.pal.todolist.db.allcommon.s2dao.internal.sqlcommand.InternalDeleteAutoStaticCommand; + +import org.seasar.dao.BeanMetaData; + +/** + * @author DBFlute(AutoGenerator) + */ +public class DeleteEntityCommand extends AbstractEntityCommand { + + //========================================================================== + // ========= + // Basic Information + // ================= + public String getCommandName() { + return "delete"; + } + + //========================================================================== + // ========= + // SqlExecution Handling + // ===================== + public SqlExecutionCreator createSqlExecutionCreator() { + assertStatus("createSqlExecutionCreator"); + return new SqlExecutionCreator() { + public SqlExecution createSqlExecution() { + final BeanMetaData bmd = createBeanMetaData(); + return createDeleteEntitySqlExecution(bmd); + } + }; + } + + protected SqlExecution createDeleteEntitySqlExecution(BeanMetaData bmd) { + final String[] propertyNames = getPersistentPropertyNames(bmd); + return createDeleteAutoStaticCommand(bmd, propertyNames); + } + + protected InternalDeleteAutoStaticCommand createDeleteAutoStaticCommand( + BeanMetaData bmd, String[] propertyNames) { + return new InternalDeleteAutoStaticCommand(_dataSource, + _statementFactory, bmd, propertyNames, + isOptimisticLockHandling()); + } + + protected boolean isOptimisticLockHandling() { + return true; + } +} Property changes on: todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/bhv/core/command/DeleteEntityCommand.java ___________________________________________________________________ Name: svn:eol-style + native Added: todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/bhv/core/command/DeleteNonstrictEntityCommand.java =================================================================== --- todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/bhv/core/command/DeleteNonstrictEntityCommand.java (rev 0) +++ todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/bhv/core/command/DeleteNonstrictEntityCommand.java 2008-12-27 22:21:53 UTC (rev 1633) @@ -0,0 +1,25 @@ +package jp.sf.pal.todolist.db.allcommon.bhv.core.command; + +/** + * @author DBFlute(AutoGenerator) + */ +public class DeleteNonstrictEntityCommand extends DeleteEntityCommand { + + //========================================================================== + // ========= + // Basic Information + // ================= + @Override + public String getCommandName() { + return "deleteNonstrict"; + } + + //========================================================================== + // ========= + // SqlExecution Handling + // ===================== + @Override + protected boolean isOptimisticLockHandling() { + return false; + } +} Property changes on: todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/bhv/core/command/DeleteNonstrictEntityCommand.java ___________________________________________________________________ Name: svn:eol-style + native Added: todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/bhv/core/command/InsertEntityCommand.java =================================================================== --- todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/bhv/core/command/InsertEntityCommand.java (rev 0) +++ todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/bhv/core/command/InsertEntityCommand.java 2008-12-27 22:21:53 UTC (rev 1633) @@ -0,0 +1,86 @@ +package jp.sf.pal.todolist.db.allcommon.bhv.core.command; + +import java.util.List; + +import jp.sf.pal.todolist.db.allcommon.bhv.core.SqlExecution; +import jp.sf.pal.todolist.db.allcommon.bhv.core.SqlExecutionCreator; +import jp.sf.pal.todolist.db.allcommon.dbmeta.DBMeta; +import jp.sf.pal.todolist.db.allcommon.dbmeta.info.ColumnInfo; +import jp.sf.pal.todolist.db.allcommon.s2dao.internal.sqlcommand.InternalInsertAutoDynamicCommand; + +import org.seasar.dao.BeanMetaData; + +/** + * @author DBFlute(AutoGenerator) + */ +public class InsertEntityCommand extends AbstractEntityCommand { + + //========================================================================== + // ========= + // Basic Information + // ================= + public String getCommandName() { + return "insert"; + } + + //========================================================================== + // ========= + // SqlExecution Handling + // ===================== + public SqlExecutionCreator createSqlExecutionCreator() { + assertStatus("createSqlExecutionCreator"); + return new SqlExecutionCreator() { + public SqlExecution createSqlExecution() { + final BeanMetaData bmd = createBeanMetaData(); + return createInsertEntitySqlExecution(bmd); + } + }; + } + + protected SqlExecution createInsertEntitySqlExecution(BeanMetaData bmd) { + final SqlExecution nonPrimaryKeySqlExecution = createNonPrimaryInsertSqlExecution(bmd); + if (nonPrimaryKeySqlExecution != null) { + return nonPrimaryKeySqlExecution; + } + final String[] propertyNames = getPersistentPropertyNames(bmd); + return createInsertAutoDynamicCommand(bmd, propertyNames); + } + + protected InternalInsertAutoDynamicCommand createInsertAutoDynamicCommand( + BeanMetaData bmd, String[] propertyNames) { + final InternalInsertAutoDynamicCommand cmd = new InternalInsertAutoDynamicCommand(); + cmd.setBeanMetaData(bmd); + cmd.setDataSource(_dataSource); + cmd.setPropertyNames(propertyNames); + cmd.setStatementFactory(_statementFactory); + return cmd; + } + + /** + * @param bmd The meta data of bean. (NotNull) + * @return Whether the method is target. (For example if it has primary key, + * returns false.) + */ + protected SqlExecution createNonPrimaryInsertSqlExecution(BeanMetaData bmd) { + final DBMeta dbmeta = findDBMeta(); + if (dbmeta.hasPrimaryKey()) { + return null; + } + final List columnInfoList = dbmeta.getColumnInfoList(); + final StringBuilder columnDefSb = new StringBuilder(); + for (jp.sf.pal.todolist.db.allcommon.dbmeta.info.ColumnInfo columnInfo : columnInfoList) { + columnDefSb.append(", ").append(columnInfo.getColumnDbName()); + } + columnDefSb.delete(0, ", ".length()).insert(0, "(").append(")"); + final StringBuilder columnValuesSb = new StringBuilder(); + for (jp.sf.pal.todolist.db.allcommon.dbmeta.info.ColumnInfo columnInfo : columnInfoList) { + columnValuesSb.append(", /*dto.").append( + columnInfo.getPropertyName()).append("*/null"); + } + columnValuesSb.delete(0, ", ".length()).insert(0, "(").append(")"); + final String sql = "insert into " + dbmeta.getTableSqlName() + + columnDefSb + " values" + columnValuesSb; + return createUpdateDynamicCommand(new String[] { "dto" }, + new Class[] { _entityType }, sql); + } +} Property changes on: todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/bhv/core/command/InsertEntityCommand.java ___________________________________________________________________ Name: svn:eol-style + native Added: todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/bhv/core/command/OutsideSqlCallCommand.java =================================================================== --- todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/bhv/core/command/OutsideSqlCallCommand.java (rev 0) +++ todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/bhv/core/command/OutsideSqlCallCommand.java 2008-12-27 22:21:53 UTC (rev 1633) @@ -0,0 +1,152 @@ +package jp.sf.pal.todolist.db.allcommon.bhv.core.command; + +import jp.sf.pal.todolist.db.allcommon.bhv.core.SqlExecution; +import jp.sf.pal.todolist.db.allcommon.bhv.core.SqlExecutionCreator; +import jp.sf.pal.todolist.db.allcommon.cbean.outsidesql.OutsideSqlContext; +import jp.sf.pal.todolist.db.allcommon.cbean.outsidesql.OutsideSqlOption; +import jp.sf.pal.todolist.db.allcommon.s2dao.internal.sqlcommand.InternalProcedureCommand; +import jp.sf.pal.todolist.db.allcommon.s2dao.internal.various.InternalProcedureMetaData; +import jp.sf.pal.todolist.db.allcommon.s2dao.internal.various.InternalProcedureMetaDataFactory; + +import org.seasar.extension.jdbc.ResultSetHandler; + +/** + * The behavior command for OutsideSql.execute(). + * + * @author DBFlute(AutoGenerator) + */ +public class OutsideSqlCallCommand extends AbstractOutsideSqlCommand { + + //========================================================================== + // ========= + // Basic Information + // ================= + public String getCommandName() { + return "call"; + } + + public Class getCommandReturnType() { + return void.class; + } + + //========================================================================== + // ========= + // Detail Information + // ================== + public boolean isProcedure() { + return true; + } + + public boolean isSelect() { + return false; + } + + //========================================================================== + // ========= + // Process Callback + // ================ + public void beforeGettingSqlExecution() { + assertStatus("beforeGettingSqlExecution"); + final String path = _outsideSqlPath; + final Object pmb = _parameterBean; + final OutsideSqlOption option = _outsideSqlOption; + final OutsideSqlContext outsideSqlContext = new OutsideSqlContext(); + outsideSqlContext.setDynamicBinding(option.isDynamicBinding()); + outsideSqlContext.setOffsetByCursorForcedly(option.isAutoPaging()); + outsideSqlContext.setLimitByCursorForcedly(option.isAutoPaging()); + outsideSqlContext.setOutsideSqlPath(path); + outsideSqlContext.setParameterBean(pmb); + outsideSqlContext.setMethodName(getCommandName()); + outsideSqlContext.setStatementConfig(option.getStatementConfig()); + outsideSqlContext.setTableDbName(option.getTableDbName()); + outsideSqlContext.setupBehaviorQueryPathIfNeeds(); + OutsideSqlContext.setOutsideSqlContextOnThread(outsideSqlContext); + } + + public void afterExecuting() { + } + + //========================================================================== + // ========= + // SqlExecution Handling + // ===================== + public String buildSqlExecutionKey() { + assertStatus("buildSqlExecutionKey"); + return generateSpecifiedOutsideSqlUniqueKey(); + } + + protected String generateSpecifiedOutsideSqlUniqueKey() { + final String methodName = getCommandName(); + final String path = _outsideSqlPath; + final Object pmb = _parameterBean; + final OutsideSqlOption option = _outsideSqlOption; + return OutsideSqlContext.generateSpecifiedOutsideSqlUniqueKey( + methodName, path, pmb, option, null); + } + + public SqlExecutionCreator createSqlExecutionCreator() { + assertStatus("createSqlExecutionCreator"); + return new SqlExecutionCreator() { + public SqlExecution createSqlExecution() { + final OutsideSqlContext outsideSqlContext = OutsideSqlContext + .getOutsideSqlContextOnThread(); + return createOutsideSqlCallCommand(outsideSqlContext); + } + }; + } + + protected SqlExecution createOutsideSqlCallCommand( + OutsideSqlContext outsideSqlContext) { + // - - - - - - - - - - - - - - - - - - - - - - - + // The attribute of Specified-OutsideSqlContext. + // - - - - - - - - - - - - - - - - - - - - - - - + final Object pmb = outsideSqlContext.getParameterBean(); + final String procedureName = outsideSqlContext.getOutsideSqlPath(); + + // - - - - - - - - - - - - - - - + // The attribute of SqlCommand. + // - - - - - - - - - - - - - - - + final InternalProcedureMetaDataFactory factory = createProcedureMetaDataFactory(); + factory.setValueTypeFactory(_valueTypeFactory); + final Class pmbType = (pmb != null ? pmb.getClass() : null); + final InternalProcedureMetaData metaData = factory + .createProcedureMetaData(procedureName, pmbType); + return createProcedureCommand(metaData); + } + + protected InternalProcedureMetaDataFactory createProcedureMetaDataFactory() { + return new InternalProcedureMetaDataFactory(); + } + + protected InternalProcedureCommand createProcedureCommand( + InternalProcedureMetaData metaData) { + // Because a procedure command does not use result set handler. + final ResultSetHandler resultSetHandler = new InternalNullResultSetHandler(); + return new InternalProcedureCommand(_dataSource, resultSetHandler, + _statementFactory, metaData); + } + + // /- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + // - - + // InternalProcedureCommand switches argument so this is unnecessary + // actually! + // - - - - - - - - - -/ + public Object[] getSqlExecutionArgument() { + return new Object[] { _parameterBean }; + } + + //========================================================================== + // ========= + // Assert Helper + // ============= + protected void assertStatus(String methodName) { + assertBasicProperty(methodName); + assertComponentProperty(methodName); + assertOutsideSqlBasic(methodName); + if (_parameterBean == null) { + String msg = "The property 'parameterBean' should not be null"; + msg = msg + " when you call " + methodName + "()."; + throw new IllegalStateException(msg); + } + } +} Property changes on: todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/bhv/core/command/OutsideSqlCallCommand.java ___________________________________________________________________ Name: svn:eol-style + native Added: todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/bhv/core/command/OutsideSqlExecuteCommand.java =================================================================== --- todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/bhv/core/command/OutsideSqlExecuteCommand.java (rev 0) +++ todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/bhv/core/command/OutsideSqlExecuteCommand.java 2008-12-27 22:21:53 UTC (rev 1633) @@ -0,0 +1,128 @@ +package jp.sf.pal.todolist.db.allcommon.bhv.core.command; + +import jp.sf.pal.todolist.db.allcommon.bhv.core.SqlExecution; +import jp.sf.pal.todolist.db.allcommon.bhv.core.SqlExecutionCreator; +import jp.sf.pal.todolist.db.allcommon.cbean.outsidesql.OutsideSqlContext; +import jp.sf.pal.todolist.db.allcommon.cbean.outsidesql.OutsideSqlOption; + +/** + * The behavior command for OutsideSql.execute(). + * + * @author DBFlute(AutoGenerator) + */ +public class OutsideSqlExecuteCommand extends + AbstractOutsideSqlCommand { + + //========================================================================== + // ========= + // Basic Information + // ================= + public String getCommandName() { + return "execute"; + } + + public Class getCommandReturnType() { + return Integer.class; + } + + //========================================================================== + // ========= + // Detail Information + // ================== + public boolean isProcedure() { + return false; + } + + public boolean isSelect() { + return false; + } + + //========================================================================== + // ========= + // Process Callback + // ================ + public void beforeGettingSqlExecution() { + assertStatus("beforeGettingSqlExecution"); + final String path = _outsideSqlPath; + final Object pmb = _parameterBean; + final OutsideSqlOption option = _outsideSqlOption; + final OutsideSqlContext outsideSqlContext = new OutsideSqlContext(); + outsideSqlContext.setDynamicBinding(option.isDynamicBinding()); + outsideSqlContext.setOffsetByCursorForcedly(option.isAutoPaging()); + outsideSqlContext.setLimitByCursorForcedly(option.isAutoPaging()); + outsideSqlContext.setOutsideSqlPath(path); + outsideSqlContext.setParameterBean(pmb); + outsideSqlContext.setMethodName(getCommandName()); + outsideSqlContext.setStatementConfig(option.getStatementConfig()); + outsideSqlContext.setTableDbName(option.getTableDbName()); + outsideSqlContext.setupBehaviorQueryPathIfNeeds(); + OutsideSqlContext.setOutsideSqlContextOnThread(outsideSqlContext); + } + + public void afterExecuting() { + } + + //========================================================================== + // ========= + // SqlExecution Handling + // ===================== + public String buildSqlExecutionKey() { + assertStatus("buildSqlExecutionKey"); + return generateSpecifiedOutsideSqlUniqueKey(); + } + + protected String generateSpecifiedOutsideSqlUniqueKey() { + final String methodName = getCommandName(); + final String path = _outsideSqlPath; + final Object pmb = _parameterBean; + final OutsideSqlOption option = _outsideSqlOption; + return OutsideSqlContext.generateSpecifiedOutsideSqlUniqueKey( + methodName, path, pmb, option, null); + } + + public SqlExecutionCreator createSqlExecutionCreator() { + assertStatus("createSqlExecutionCreator"); + return new SqlExecutionCreator() { + public SqlExecution createSqlExecution() { + final OutsideSqlContext outsideSqlContext = OutsideSqlContext + .getOutsideSqlContextOnThread(); + return createOutsideSqlExecuteExecution(outsideSqlContext); + } + }; + } + + protected SqlExecution createOutsideSqlExecuteExecution( + OutsideSqlContext outsideSqlContext) { + // - - - - - - - - - - - - - - - - - - - - - - - + // The attribute of Specified-OutsideSqlContext. + // - - - - - - - - - - - - - - - - - - - - - - - + final String suffix = buildDbmsSuffix(); + final String sql = outsideSqlContext.readFilteredOutsideSql( + _sqlFileEncoding, suffix); + final Object pmb = outsideSqlContext.getParameterBean(); + + // - - - - - - - - - - - - - - - + // The attribute of SqlCommand. + // - - - - - - - - - - - - - - - + final String[] argNames = (pmb != null ? new String[] { "pmb" } + : new String[] {}); + final Class[] argTypes = (pmb != null ? new Class[] { pmb + .getClass() } : new Class[] {}); + + return createUpdateDynamicCommand(argNames, argTypes, sql); + } + + public Object[] getSqlExecutionArgument() { + return new Object[] { _parameterBean }; + } + + //========================================================================== + // ========= + // Assert Helper + // ============= + protected void assertStatus(String methodName) { + assertBasicProperty(methodName); + assertComponentProperty(methodName); + assertOutsideSqlBasic(methodName); + } +} Property changes on: todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/bhv/core/command/OutsideSqlExecuteCommand.java ___________________________________________________________________ Name: svn:eol-style + native Added: todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/bhv/core/command/OutsideSqlSelectCursorCommand.java =================================================================== --- todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/bhv/core/command/OutsideSqlSelectCursorCommand.java (rev 0) +++ todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/bhv/core/command/OutsideSqlSelectCursorCommand.java 2008-12-27 22:21:53 UTC (rev 1633) @@ -0,0 +1,77 @@ +package jp.sf.pal.todolist.db.allcommon.bhv.core.command; + +import java.sql.ResultSet; +import java.sql.SQLException; + +import jp.sf.pal.todolist.db.allcommon.jdbc.CursorHandler; + +import org.seasar.extension.jdbc.ResultSetHandler; + +/** + * The behavior command for OutsideSql.selectList(). + * + * @author DBFlute(AutoGenerator) + */ +public class OutsideSqlSelectCursorCommand extends + AbstractOutsideSqlSelectCommand { + + //========================================================================== + // ========= + // Attribute + // ========= + /** The handler of cursor. (Required) */ + protected CursorHandler _cursorHandler; + + //========================================================================== + // ========= + // Basic Information + // ================= + public String getCommandName() { + return "selectCursor"; + } + + public Class getCommandReturnType() { + return Object.class; + } + + //========================================================================== + // ========= + // Extension Point + // =============== + @Override + protected ResultSetHandler createOutsideSqlSelectResultSetHandler() { + return new ResultSetHandler() { + public Object handle(ResultSet rs) throws SQLException { + return _cursorHandler.handle(rs); + } + }; + } + + @Override + protected Object getResultTypeSpecification() { + return _cursorHandler; + } + + //========================================================================== + // ========= + // Assert Helper + // ============= + @Override + protected void assertStatus(String methodName) { + assertBasicProperty(methodName); + assertComponentProperty(methodName); + assertOutsideSqlBasic(methodName); + if (_cursorHandler == null) { + throw new IllegalStateException(buildAssertMessage( + "_cursorHandler", methodName)); + } + } + + //========================================================================== + // ========= + // Accessor + // ======== + public void setCursorHandler(CursorHandler cursorHandler) { + _cursorHandler = cursorHandler; + } +} Property changes on: todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/bhv/core/command/OutsideSqlSelectCursorCommand.java ___________________________________________________________________ Name: svn:eol-style + native Added: todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/bhv/core/command/OutsideSqlSelectListCommand.java =================================================================== --- todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/bhv/core/command/OutsideSqlSelectListCommand.java (rev 0) +++ todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/bhv/core/command/OutsideSqlSelectListCommand.java 2008-12-27 22:21:53 UTC (rev 1633) @@ -0,0 +1,96 @@ +package jp.sf.pal.todolist.db.allcommon.bhv.core.command; + +import java.util.List; + +import org.seasar.dao.BeanMetaData; +import org.seasar.extension.jdbc.ResultSetHandler; +import org.seasar.extension.jdbc.ValueType; +import org.seasar.extension.jdbc.types.ValueTypes; + +/** + * The behavior command for OutsideSql.selectList(). + * + * @author DBFlute(AutoGenerator) + * @param The type of entity. + */ +public class OutsideSqlSelectListCommand extends + AbstractOutsideSqlSelectCommand> { + + //========================================================================== + // ========= + // Attribute + // ========= + /** The type of entity. (Required) */ + protected Class _entityType; + + //========================================================================== + // ========= + // Basic Information + // ================= + public String getCommandName() { + return "selectList"; + } + + public Class getCommandReturnType() { + return List.class; + } + + //========================================================================== + // ========= + // Factory + // ======= + // ----------------------------------------------------- + // BeanMetaData + // ------------ + protected BeanMetaData createBeanMetaData() { + assertEntityType("createBeanMetaData"); + return _beanMetaDataFactory.createBeanMetaData(_entityType); + } + + // ----------------------------------------------------- + // ResultSetHandler + // ---------------- + protected ResultSetHandler createOutsideSqlBeanListResultSetHandler( + BeanMetaData bmd) { + final ValueType valueType = ValueTypes.getValueType(_entityType); + if (valueType == null || !valueType.equals(ValueTypes.OBJECT)) { + return createObjectListResultSetHandler(valueType); + } + return createBeanListMetaDataResultSetHandler(bmd); + } + + //========================================================================== + // ========= + // Extension Point + // =============== + @Override + protected ResultSetHandler createOutsideSqlSelectResultSetHandler() { + final BeanMetaData bmd = createBeanMetaData(); + final ResultSetHandler handler = createOutsideSqlBeanListResultSetHandler(bmd); + return handler; + } + + @Override + protected Object getResultTypeSpecification() { + return _entityType; + } + + //========================================================================== + // ========= + // Assert Helper + // ============= + protected void assertEntityType(String methodName) { + if (_entityType == null) { + throw new IllegalStateException(buildAssertMessage("_entityType", + methodName)); + } + } + + //========================================================================== + // ========= + // Accessor + // ======== + public void setEntityType(Class entityType) { + _entityType = entityType; + } +} Property changes on: todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/bhv/core/command/OutsideSqlSelectListCommand.java ___________________________________________________________________ Name: svn:eol-style + native Added: todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/bhv/core/command/QueryDeleteCBCommand.java =================================================================== --- todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/bhv/core/command/QueryDeleteCBCommand.java (rev 0) +++ todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/bhv/core/command/QueryDeleteCBCommand.java 2008-12-27 22:21:53 UTC (rev 1633) @@ -0,0 +1,151 @@ +package jp.sf.pal.todolist.db.allcommon.bhv.core.command; + +import jp.sf.pal.todolist.db.allcommon.bhv.core.SqlExecution; +import jp.sf.pal.todolist.db.allcommon.bhv.core.SqlExecutionCreator; +import jp.sf.pal.todolist.db.allcommon.cbean.ConditionBean; +import jp.sf.pal.todolist.db.allcommon.cbean.ConditionBeanContext; +import jp.sf.pal.todolist.db.allcommon.cbean.FetchNarrowingBeanContext; +import jp.sf.pal.todolist.db.allcommon.cbean.outsidesql.OutsideSqlOption; +import jp.sf.pal.todolist.db.allcommon.s2dao.internal.sqlcommand.InternalDeleteQueryAutoDynamicCommand; + +/** + * @author DBFlute(AutoGenerator) + */ +public class QueryDeleteCBCommand extends AbstractBehaviorCommand { + + //========================================================================== + // ========= + // Attribute + // ========= + /** The type of condition-bean. (Derived from conditionBean) */ + protected Class _conditionBeanType; + + /** The instance of condition-bean. (Required) */ + protected ConditionBean _conditionBean; + + //========================================================================== + // ========= + // Basic Information + // ================= + public String getCommandName() { + return "queryDelete"; + } + + public Class getCommandReturnType() { + return int.class; + } + + //========================================================================== + // ========= + // Detail Information + // ================== + public boolean isConditionBean() { + return true; + } + + public boolean isOutsideSql() { + return false; + } + + public boolean isProcedure() { + return false; + } + + public boolean isSelect() { + return false; + } + + public boolean isSelectCount() { + return false; + } + + //========================================================================== + // ========= + // Process Callback + // ================ + public void beforeGettingSqlExecution() { + assertStatus("beforeGettingSqlExecution"); + final ConditionBean cb = _conditionBean; + FetchNarrowingBeanContext.setFetchNarrowingBeanOnThread(cb); + ConditionBeanContext.setConditionBeanOnThread(cb); + } + + public void afterExecuting() { + } + + //========================================================================== + // ========= + // SqlExecution Handling + // ===================== + public String buildSqlExecutionKey() { + assertStatus("buildSqlExecutionKey"); + return _tableDbName + ":" + getCommandName() + "(" + + _conditionBeanType.getSimpleName() + ")"; + } + + public SqlExecutionCreator createSqlExecutionCreator() { + assertStatus("createSqlExecutionCreator"); + return new SqlExecutionCreator() { + public SqlExecution createSqlExecution() { + return createQueryDeleteCBExecution(_conditionBeanType); + } + }; + } + + protected SqlExecution createQueryDeleteCBExecution( + Class cbType) { + return new InternalDeleteQueryAutoDynamicCommand(_dataSource, + _statementFactory); + } + + public Object[] getSqlExecutionArgument() { + assertStatus("getSqlExecutionArgument"); + return new Object[] { _conditionBean }; + } + + //========================================================================== + // ========= + // Argument Information + // ==================== + public ConditionBean getConditionBean() { + return _conditionBean; + } + + public String getOutsideSqlPath() { + return null; + } + + public OutsideSqlOption getOutsideSqlOption() { + return null; + } + + //========================================================================== + // ========= + // Assert Helper + // ============= + protected void assertStatus(String methodName) { + assertBasicProperty(methodName); + assertComponentProperty(methodName); + if (_conditionBeanType == null) { + throw new IllegalStateException(buildAssertMessage( + "_conditionBeanType", methodName)); + } + if (_conditionBean == null) { + throw new IllegalStateException(buildAssertMessage( + "_conditionBean", methodName)); + } + } + + //========================================================================== + // ========= + // Accessor + // ======== + public void setConditionBeanType( + Class conditionBeanType) { + _conditionBeanType = conditionBeanType; + } + + public void setConditionBean(ConditionBean conditionBean) { + _conditionBean = conditionBean; + } +} Property changes on: todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/bhv/core/command/QueryDeleteCBCommand.java ___________________________________________________________________ Name: svn:eol-style + native Added: todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/bhv/core/command/QueryUpdateEntityCBCommand.java =================================================================== --- todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/bhv/core/command/QueryUpdateEntityCBCommand.java (rev 0) +++ todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/bhv/core/command/QueryUpdateEntityCBCommand.java 2008-12-27 22:21:53 UTC (rev 1633) @@ -0,0 +1,140 @@ +package jp.sf.pal.todolist.db.allcommon.bhv.core.command; + +import jp.sf.pal.todolist.db.allcommon.bhv.core.SqlExecution; +import jp.sf.pal.todolist.db.allcommon.bhv.core.SqlExecutionCreator; +import jp.sf.pal.todolist.db.allcommon.cbean.ConditionBean; +import jp.sf.pal.todolist.db.allcommon.cbean.ConditionBeanContext; +import jp.sf.pal.todolist.db.allcommon.cbean.FetchNarrowingBeanContext; +import jp.sf.pal.todolist.db.allcommon.cbean.outsidesql.OutsideSqlOption; +import jp.sf.pal.todolist.db.allcommon.s2dao.internal.sqlcommand.InternalUpdateQueryAutoDynamicCommand; + +/** + * @author DBFlute(AutoGenerator) + */ +public class QueryUpdateEntityCBCommand extends AbstractEntityCommand { + + //========================================================================== + // ========= + // Attribute + // ========= + /** The type of condition-bean. (Derived from conditionBean) */ + protected Class _conditionBeanType; + + /** The instance of condition-bean. (Required) */ + protected ConditionBean _conditionBean; + + //========================================================================== + // ========= + // Basic Information + // ================= + public String getCommandName() { + return "queryUpdate"; + } + + //========================================================================== + // ========= + // Detail Information + // ================== + @Override + public boolean isConditionBean() { + return true; + } + + //========================================================================== + // ========= + // Process Callback + // ================ + @Override + public void beforeGettingSqlExecution() { + assertStatus("beforeGettingSqlExecution"); + final ConditionBean cb = _conditionBean; + FetchNarrowingBeanContext.setFetchNarrowingBeanOnThread(cb); + ConditionBeanContext.setConditionBeanOnThread(cb); + } + + //========================================================================== + // ========= + // SqlExecution Handling + // ===================== + public String buildSqlExecutionKey() { + assertStatus("buildSqlExecutionKey"); + return _tableDbName + ":" + getCommandName() + "(" + + _entityType.getSimpleName() + ", " + + _conditionBeanType.getSimpleName() + ")"; + } + + public SqlExecutionCreator createSqlExecutionCreator() { + assertStatus("createSqlExecutionCreator"); + return new SqlExecutionCreator() { + public SqlExecution createSqlExecution() { + return createQueryUpdateEntityCBExecution(_conditionBeanType); + } + }; + } + + protected SqlExecution createQueryUpdateEntityCBExecution( + Class cbType) { + return new InternalUpdateQueryAutoDynamicCommand(_dataSource, + _statementFactory); + } + + public Object[] getSqlExecutionArgument() { + assertStatus("getSqlExecutionArgument"); + return new Object[] { _conditionBean, _entity }; + } + + //========================================================================== + // ========= + // Argument Information + // ==================== + public ConditionBean getConditionBean() { + return _conditionBean; + } + + public String getOutsideSqlPath() { + return null; + } + + public OutsideSqlOption getOutsideSqlOption() { + return null; + } + + //========================================================================== + // ========= + // Assert Helper + // ============= + @Override + protected void assertStatus(String methodName) { + assertBasicProperty(methodName); + assertComponentProperty(methodName); + if (_entityType == null) { + throw new IllegalStateException(buildAssertMessage("_entityType", + methodName)); + } + if (_entity == null) { + throw new IllegalStateException(buildAssertMessage("_entity", + methodName)); + } + if (_conditionBeanType == null) { + throw new IllegalStateException(buildAssertMessage( + "_conditionBeanType", methodName)); + } + if (_conditionBean == null) { + throw new IllegalStateException(buildAssertMessage( + "_conditionBean", methodName)); + } + } + + //========================================================================== + // ========= + // Accessor + // ======== + public void setConditionBeanType( + Class conditionBeanType) { + _conditionBeanType = conditionBeanType; + } + + public void setConditionBean(ConditionBean conditionBean) { + _conditionBean = conditionBean; + } +} Property changes on: todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/bhv/core/command/QueryUpdateEntityCBCommand.java ___________________________________________________________________ Name: svn:eol-style + native Added: todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/bhv/core/command/SelectCountCBCommand.java =================================================================== --- todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/bhv/core/command/SelectCountCBCommand.java (rev 0) +++ todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/bhv/core/command/SelectCountCBCommand.java 2008-12-27 22:21:53 UTC (rev 1633) @@ -0,0 +1,65 @@ +package jp.sf.pal.todolist.db.allcommon.bhv.core.command; + +import jp.sf.pal.todolist.db.allcommon.bhv.core.SqlExecution; +import jp.sf.pal.todolist.db.allcommon.bhv.core.SqlExecutionCreator; +import jp.sf.pal.todolist.db.allcommon.cbean.ConditionBean; +import jp.sf.pal.todolist.db.allcommon.cbean.ConditionBeanContext; + +import org.seasar.extension.jdbc.ResultSetHandler; + +/** + * @author DBFlute(AutoGenerator) + */ +public class SelectCountCBCommand extends AbstractSelectCBCommand { + + //========================================================================== + // ========= + // Basic Information + // ================= + public String getCommandName() { + return "selectCount"; + } + + public Class getCommandReturnType() { + return Integer.class; + } + + //========================================================================== + // ========= + // Process Callback + // ================ + public void beforeGettingSqlExecution() { + assertStatus("beforeGettingSqlExecution"); + final ConditionBean cb = _conditionBean; + cb.xsetupSelectCountIgnoreFetchScope(); // *Point! + ConditionBeanContext.setConditionBeanOnThread(cb); + } + + public void afterExecuting() { + assertStatus("afterExecuting"); + final ConditionBean cb = _conditionBean; + cb.xafterCareSelectCountIgnoreFetchScope(); + } + + //========================================================================== + // ========= + // Detail Information + // ================== + public boolean isSelectCount() { + return true; + } + + //========================================================================== + // ========= + // SqlExecution Handling + // ===================== + public SqlExecutionCreator createSqlExecutionCreator() { + assertStatus("createSqlExecutionCreator"); + return new SqlExecutionCreator() { + public SqlExecution createSqlExecution() { + ResultSetHandler handler = createObjectResultSetHandler(getCommandReturnType()); + return createSelectCBExecution(_conditionBeanType, handler); + } + }; + } +} Property changes on: todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/bhv/core/command/SelectCountCBCommand.java ___________________________________________________________________ Name: svn:eol-style + native Added: todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/bhv/core/command/SelectListCBCommand.java =================================================================== --- todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/bhv/core/command/SelectListCBCommand.java (rev 0) +++ todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/bhv/core/command/SelectListCBCommand.java 2008-12-27 22:21:53 UTC (rev 1633) @@ -0,0 +1,103 @@ +package jp.sf.pal.todolist.db.allcommon.bhv.core.command; + +import java.util.List; + +import jp.sf.pal.todolist.db.allcommon.Entity; +import jp.sf.pal.todolist.db.allcommon.bhv.core.SqlExecution; +import jp.sf.pal.todolist.db.allcommon.bhv.core.SqlExecutionCreator; +import jp.sf.pal.todolist.db.allcommon.cbean.ConditionBean; +import jp.sf.pal.todolist.db.allcommon.cbean.ConditionBeanContext; +import jp.sf.pal.todolist.db.allcommon.cbean.FetchNarrowingBeanContext; + +import org.seasar.dao.BeanMetaData; +import org.seasar.extension.jdbc.ResultSetHandler; + +/** + * @author DBFlute(AutoGenerator) + * @param The type of entity. + */ +public class SelectListCBCommand extends + AbstractSelectCBCommand> { + + //========================================================================== + // ========= + // Attribute + // ========= + /** The type of entity. (Required) */ + protected Class _entityType; + + //========================================================================== + // ========= + // Basic Information + // ================= + public String getCommandName() { + return "selectList"; + } + + public Class getCommandReturnType() { + return List.class; + } + + //========================================================================== + // ========= + // Detail Information + // ================== + public boolean isSelectCount() { + return false; + } + + //========================================================================== + // ========= + // Process Callback + // ================ + public void beforeGettingSqlExecution() { + assertStatus("beforeGettingSqlExecution"); + final ConditionBean cb = _conditionBean; + FetchNarrowingBeanContext.setFetchNarrowingBeanOnThread(cb); + ConditionBeanContext.setConditionBeanOnThread(cb); + } + + public void afterExecuting() { + assertStatus("afterExecuting"); + } + + //========================================================================== + // ========= + // SqlExecution Handling + // ===================== + public SqlExecutionCreator createSqlExecutionCreator() { + assertStatus("createSqlExecutionCreator"); + return new SqlExecutionCreator() { + public SqlExecution createSqlExecution() { + BeanMetaData bmd = createBeanMetaData(); + ResultSetHandler handler = createBeanListMetaDataResultSetHandler(bmd); + return createSelectCBExecution(_conditionBeanType, handler); + } + }; + } + + protected BeanMetaData createBeanMetaData() { + return _beanMetaDataFactory.createBeanMetaData(_entityType); + } + + //========================================================================== + // ========= + // Assert Helper + // ============= + @Override + protected void assertStatus(String methodName) { + super.assertStatus(methodName); + if (_entityType == null) { + throw new IllegalStateException(buildAssertMessage("_entityType", + methodName)); + } + } + + //========================================================================== + // ========= + // Accessor + // ======== + public void setEntityType(Class entityType) { + _entityType = entityType; + } +} Property changes on: todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/bhv/core/command/SelectListCBCommand.java ___________________________________________________________________ Name: svn:eol-style + native Added: todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/bhv/core/command/SelectNextValCommand.java =================================================================== --- todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/bhv/core/command/SelectNextValCommand.java (rev 0) +++ todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/bhv/core/command/SelectNextValCommand.java 2008-12-27 22:21:53 UTC (rev 1633) @@ -0,0 +1,162 @@ +package jp.sf.pal.todolist.db.allcommon.bhv.core.command; + +import jp.sf.pal.todolist.db.allcommon.bhv.core.SqlExecution; +import jp.sf.pal.todolist.db.allcommon.bhv.core.SqlExecutionCreator; +import jp.sf.pal.todolist.db.allcommon.bhv.core.execution.BasicSelectExecution; +import jp.sf.pal.todolist.db.allcommon.cbean.ConditionBean; +import jp.sf.pal.todolist.db.allcommon.cbean.outsidesql.OutsideSqlOption; +import jp.sf.pal.todolist.db.allcommon.dbmeta.DBMeta; +import jp.sf.pal.todolist.db.allcommon.dbmeta.DBMetaInstanceHandler; + +import org.seasar.extension.jdbc.ResultSetHandler; + +/** + * @author DBFlute(AutoGenerator) + * @param The type of result. + */ +public class SelectNextValCommand extends + AbstractBehaviorCommand { + + //========================================================================== + // ========= + // Attribute + // ========= + /** The type of result. (NotNull) */ + protected Class _resultType; + + //========================================================================== + // ========= + // Basic Information + // ================= + public String getCommandName() { + return "selectNextVal"; + } + + public Class getCommandReturnType() { + return _resultType; + } + + //========================================================================== + // ========= + // Detail Information + // ================== + public boolean isConditionBean() { + return false; + } + + public boolean isOutsideSql() { + return false; + } + + public boolean isProcedure() { + return false; + } + + public boolean isSelect() { + return true; + } + + public boolean isSelectCount() { + return false; + } + + //========================================================================== + // ========= + // Process Callback + // ================ + public void beforeGettingSqlExecution() { + } + + public void afterExecuting() { + } + + //========================================================================== + // ========= + // SqlExecution Handling + // ===================== + public String buildSqlExecutionKey() { + assertStatus("buildSqlExecutionKey"); + return _tableDbName + ":" + getCommandName() + "()"; + } + + public SqlExecutionCreator createSqlExecutionCreator() { + assertStatus("createSqlExecutionCreator"); + return new SqlExecutionCreator() { + public SqlExecution createSqlExecution() { + ResultSetHandler handler = createObjectResultSetHandler(_resultType); + return createSelectNextValExecution(handler); + } + }; + } + + protected SqlExecution createSelectNextValExecution(ResultSetHandler handler) { + final DBMeta dbmeta = findDBMeta(); + if (!dbmeta.hasSequence()) { + String msg = "If the method 'selectNextVal()' exists, DBMeta.hasSequence() should return true:"; + msg = msg + " dbmeta.hasSequence()=" + dbmeta.hasSequence(); + throw new IllegalStateException(msg); + } + final String nextValSql = dbmeta.getSequenceNextValSql(); + if (nextValSql == null) { + String msg = "If the method 'selectNextVal()' exists, DBMeta.getSequenceNextValSql() should not return null:"; + msg = msg + " dbmeta.getSequenceNextValSql()=" + + dbmeta.getSequenceNextValSql(); + throw new IllegalStateException(msg); + } + return createBasicSelectExecution(handler, new String[] {}, + new Class[] {}, nextValSql); + } + + protected BasicSelectExecution createBasicSelectExecution( + ResultSetHandler handler, String[] argNames, Class[] argTypes, + String sql) { + final BasicSelectExecution cmd = new BasicSelectExecution(_dataSource, + _statementFactory, handler); + cmd.setArgNames(argNames); + cmd.setArgTypes(argTypes); + cmd.setSql(sql); + return cmd; + } + + protected DBMeta findDBMeta() { + return DBMetaInstanceHandler.findDBMeta(_tableDbName); + } + + public Object[] getSqlExecutionArgument() { + assertStatus("getSqlExecutionArgument"); + return new Object[] {}; + } + + //========================================================================== + // ========= + // Argument Information + // ==================== + public ConditionBean getConditionBean() { + return null; + } + + public String getOutsideSqlPath() { + return null; + } + + public OutsideSqlOption getOutsideSqlOption() { + return null; + } + + //========================================================================== + // ========= + // Assert Helper + // ============= + protected void assertStatus(String methodName) { + assertBasicProperty(methodName); + assertComponentProperty(methodName); + } + + //========================================================================== + // ========= + // Accessor + // ======== + public void setResultType(Class resultType) { + _resultType = resultType; + } +} Property changes on: todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/bhv/core/command/SelectNextValCommand.java ___________________________________________________________________ Name: svn:eol-style + native Added: todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/bhv/core/command/SelectScalarCBCommand.java =================================================================== --- todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/bhv/core/command/SelectScalarCBCommand.java (rev 0) +++ todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/bhv/core/command/SelectScalarCBCommand.java 2008-12-27 22:21:53 UTC (rev 1633) @@ -0,0 +1,112 @@ +package jp.sf.pal.todolist.db.allcommon.bhv.core.command; + +import jp.sf.pal.todolist.db.allcommon.bhv.core.SqlExecution; +import jp.sf.pal.todolist.db.allcommon.bhv.core.SqlExecutionCreator; +import jp.sf.pal.todolist.db.allcommon.cbean.ConditionBean; +import jp.sf.pal.todolist.db.allcommon.cbean.ConditionBeanContext; +import jp.sf.pal.todolist.db.allcommon.cbean.sqlclause.SqlClause; + +import org.seasar.extension.jdbc.ResultSetHandler; + +/** + * @author DBFlute(AutoGenerator) + * @param The type of result. + */ +public class SelectScalarCBCommand extends + AbstractSelectCBCommand { + + //========================================================================== + // ========= + // Attribute + // ========= + /** The type of result. (NotNull) */ + protected Class _resultType; + + /** The type of select clause. (NotNull) */ + protected SqlClause.SelectClauseType _selectClauseType; + + //========================================================================== + // ========= + // Basic Information + // ================= + public String getCommandName() { + assertStatus("getCommandName"); + final String resultTypeName = _resultType.getSimpleName(); + final String scalarMethodName = _selectClauseType.toString() + .toLowerCase(); + return "scalarSelect(" + resultTypeName + ")." + scalarMethodName; + } + + public Class getCommandReturnType() { + assertStatus("getCommandReturnType"); + return _resultType; + } + + //========================================================================== + // ========= + // Detail Information + // ================== + public boolean isSelectCount() { + return false; + } + + //========================================================================== + // ========= + // Process Callback + // ================ + public void beforeGettingSqlExecution() { + assertStatus("beforeGettingSqlExecution"); + final ConditionBean cb = _conditionBean; + ConditionBeanContext.setConditionBeanOnThread(cb); + cb.getSqlClause().classifySelectClauseType(_selectClauseType); //*Point! + } + + public void afterExecuting() { + assertStatus("afterExecuting"); + final ConditionBean cb = _conditionBean; + cb.getSqlClause().rollbackSelectClauseType(); + } + + //========================================================================== + // ========= + // SqlExecution Handling + // ===================== + public SqlExecutionCreator createSqlExecutionCreator() { + assertStatus("createSqlExecutionCreator"); + return new SqlExecutionCreator() { + public SqlExecution createSqlExecution() { + ResultSetHandler handler = createObjectResultSetHandler(getCommandReturnType()); + return createSelectCBExecution(_conditionBeanType, handler); + } + }; + } + + //========================================================================== + // ========= + // Assert Helper + // ============= + @Override + protected void assertStatus(String methodName) { + super.assertStatus(methodName); + if (_resultType == null) { + throw new IllegalStateException(buildAssertMessage("_resultType", + methodName)); + } + if (_selectClauseType == null) { + throw new IllegalStateException(buildAssertMessage( + "_selectClauseType", methodName)); + } + } + + //========================================================================== + // ========= + // Accessor + // ======== + public void setResultType(Class resultType) { + _resultType = resultType; + } + + public void setSelectClauseType(SqlClause.SelectClauseType selectClauseType) { + _selectClauseType = selectClauseType; + } +} Property changes on: todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/bhv/core/command/SelectScalarCBCommand.java ___________________________________________________________________ Name: svn:eol-style + native Added: todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/bhv/core/command/UpdateEntityCommand.java =================================================================== --- todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/bhv/core/command/UpdateEntityCommand.java (rev 0) +++ todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/bhv/core/command/UpdateEntityCommand.java 2008-12-27 22:21:53 UTC (rev 1633) @@ -0,0 +1,55 @@ +package jp.sf.pal.todolist.db.allcommon.bhv.core.command; + +import jp.sf.pal.todolist.db.allcommon.bhv.core.SqlExecution; +import jp.sf.pal.todolist.db.allcommon.bhv.core.SqlExecutionCreator; +import jp.sf.pal.todolist.db.allcommon.s2dao.internal.sqlcommand.InternalUpdateModifiedOnlyCommand; + +import org.seasar.dao.BeanMetaData; + +/** + * @author DBFlute(AutoGenerator) + */ +public class UpdateEntityCommand extends AbstractEntityCommand { + + //========================================================================== + // ========= + // Basic Information + // ================= + public String getCommandName() { + return "update"; + } + + //========================================================================== + // ========= + // SqlExecution Handling + // ===================== + public SqlExecutionCreator createSqlExecutionCreator() { + assertStatus("createSqlExecutionCreator"); + return new SqlExecutionCreator() { + public SqlExecution createSqlExecution() { + final BeanMetaData bmd = createBeanMetaData(); + return createUpdateEntitySqlExecution(bmd); + } + }; + } + + protected SqlExecution createUpdateEntitySqlExecution(BeanMetaData bmd) { + final String[] propertyNames = getPersistentPropertyNames(bmd); + return createUpdateModifiedOnlyCommand(bmd, propertyNames); + } + + protected InternalUpdateModifiedOnlyCommand createUpdateModifiedOnlyCommand( + BeanMetaData bmd, String[] propertyNames) { + final InternalUpdateModifiedOnlyCommand cmd = new InternalUpdateModifiedOnlyCommand( + _dataSource, _statementFactory); + cmd.setBeanMetaData(bmd);// Extension Point! + cmd.setPropertyNames(propertyNames); + cmd.setOptimisticLockHandling(isOptimisticLockHandling()); + cmd.setVersionNoAutoIncrementOnMemory(isOptimisticLockHandling()); + return cmd; + } + + protected boolean isOptimisticLockHandling() { + return true; + } +} Property changes on: todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/bhv/core/command/UpdateEntityCommand.java ___________________________________________________________________ Name: svn:eol-style + native Added: todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/bhv/core/command/UpdateNonstrictEntityCommand.java =================================================================== --- todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/bhv/core/command/UpdateNonstrictEntityCommand.java (rev 0) +++ todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/bhv/core/command/UpdateNonstrictEntityCommand.java 2008-12-27 22:21:53 UTC (rev 1633) @@ -0,0 +1,25 @@ +package jp.sf.pal.todolist.db.allcommon.bhv.core.command; + +/** + * @author DBFlute(AutoGenerator) + */ +public class UpdateNonstrictEntityCommand extends UpdateEntityCommand { + + //========================================================================== + // ========= + // Basic Information + // ================= + @Override + public String getCommandName() { + return "updateNonstrict"; + } + + //========================================================================== + // ========= + // SqlExecution Handling + // ===================== + @Override + protected boolean isOptimisticLockHandling() { + return false; + } +} Property changes on: todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/bhv/core/command/UpdateNonstrictEntityCommand.java ___________________________________________________________________ Name: svn:eol-style + native Added: todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/bhv/core/execution/BasicSelectExecution.java =================================================================== --- todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/bhv/core/execution/BasicSelectExecution.java (rev 0) +++ todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/bhv/core/execution/BasicSelectExecution.java 2008-12-27 22:21:53 UTC (rev 1633) @@ -0,0 +1,77 @@ +package jp.sf.pal.todolist.db.allcommon.bhv.core.execution; + +import javax.sql.DataSource; + +import jp.sf.pal.todolist.db.allcommon.s2dao.internal.sqlcommand.InternalAbstractDynamicCommand; +import jp.sf.pal.todolist.db.allcommon.s2dao.internal.sqlhandler.InternalBasicSelectHandler; + +import org.seasar.dao.CommandContext; +import org.seasar.extension.jdbc.ResultSetHandler; +import org.seasar.extension.jdbc.StatementFactory; + +/** + * @author DBFlute(AutoGenerator) + */ +public class BasicSelectExecution extends InternalAbstractDynamicCommand { + + //========================================================================== + // ========= + // Attribute + // ========= + /** The handler of resultSet. */ + protected ResultSetHandler resultSetHandler; + + //========================================================================== + // ========= + // Constructor + // =========== + /** + * Constructor. + * + * @param dataSource Data source. + * @param statementFactory The factory of statement. + * @param resultSetHandler The handler of resultSet. + */ + public BasicSelectExecution(DataSource dataSource, + StatementFactory statementFactory, ResultSetHandler resultSetHandler) { + super(dataSource, statementFactory); + this.resultSetHandler = resultSetHandler; + } + + //========================================================================== + // ========= + // Execute + // ======= + /** + * @param args The array of argument. (Nullable) + * @return The object of execution result. (Nullable) + */ + public Object execute(Object[] args) { + final CommandContext ctx = apply(args); + final InternalBasicSelectHandler selectHandler = createBasicSelectHandler( + ctx.getSql(), this.resultSetHandler); + final Object[] bindVariableArray = ctx.getBindVariables(); + selectHandler.setLoggingMessageSqlArgs(bindVariableArray); + return selectHandler.execute(bindVariableArray, ctx + .getBindVariableTypes()); + } + + //========================================================================== + // ========= + // Select Handler + // ============== + protected InternalBasicSelectHandler createBasicSelectHandler( + String realSql, ResultSetHandler rsh) { + return new InternalBasicSelectHandler(getDataSource(), realSql, rsh, + getStatementFactory()); + } + + //========================================================================== + // ========= + // Parser Option + // ============= + @Override + protected boolean isBlockNullParameter() { + return true; // Because the SQL is select. + } +} Property changes on: todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/bhv/core/execution/BasicSelectExecution.java ___________________________________________________________________ Name: svn:eol-style + native Added: todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/bhv/core/execution/OutsideSqlSelectExecution.java =================================================================== --- todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/bhv/core/execution/OutsideSqlSelectExecution.java (rev 0) +++ todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/bhv/core/execution/OutsideSqlSelectExecution.java 2008-12-27 22:21:53 UTC (rev 1633) @@ -0,0 +1,225 @@ +package jp.sf.pal.todolist.db.allcommon.bhv.core.execution; + +import java.util.ArrayList; +import java.util.List; + +import javax.sql.DataSource; + +import jp.sf.pal.todolist.db.allcommon.cbean.outsidesql.OutsideSqlContext; +import jp.sf.pal.todolist.db.allcommon.s2dao.internal.sqlcommand.InternalAbstractDynamicCommand; +import jp.sf.pal.todolist.db.allcommon.s2dao.internal.sqlhandler.InternalBasicSelectHandler; +import jp.sf.pal.todolist.db.allcommon.util.SimpleStringUtil; +import jp.sf.pal.todolist.db.allcommon.util.SimpleSystemUtil; + +import org.seasar.dao.CommandContext; +import org.seasar.extension.jdbc.ResultSetHandler; +import org.seasar.extension.jdbc.StatementFactory; +import org.seasar.framework.beans.BeanDesc; +import org.seasar.framework.beans.PropertyDesc; +import org.seasar.framework.beans.factory.BeanDescFactory; + +/** + * @author DBFlute(AutoGenerator) + */ +public class OutsideSqlSelectExecution extends InternalAbstractDynamicCommand { + + //========================================================================== + // ========= + // Attribute + // ========= + /** The handler of resultSet. */ + protected ResultSetHandler resultSetHandler; + + //========================================================================== + // ========= + // Constructor + // =========== + /** + * Constructor. + * + * @param dataSource Data source. + * @param statementFactory The factory of statement. + * @param resultSetHandler The handler of resultSet. + */ + public OutsideSqlSelectExecution(DataSource dataSource, + StatementFactory statementFactory, ResultSetHandler resultSetHandler) { + super(dataSource, statementFactory); + this.resultSetHandler = resultSetHandler; + } + + //========================================================================== + // ========= + // Execute + // ======= + /** + * @param args The array of argument. (NotNull, The first element should be + * the instance of Pmb) + * @return The object of execution result. (Nullable) + */ + public Object execute(Object[] args) { + final OutsideSqlContext outsideSqlContext = OutsideSqlContext + .getOutsideSqlContextOnThread(); + if (outsideSqlContext.isDynamicBinding()) { + return executeOutsideSqlAsDynamic(args, outsideSqlContext); + } else { + return executeOutsideSqlAsStatic(args, outsideSqlContext); + } + } + + // ----------------------------------------------------- + // OutsideSql Execute + // ------------------ + /** + * Execute outside-SQL as Dynamic. + * + * @param args The array of argument. (NotNull, The first element should be + * the instance of Pmb) + * @param outsideSqlContext The context of outside-SQL. (NotNull) + * @return Result. (Nullable) + */ + protected Object executeOutsideSqlAsDynamic(Object[] args, + OutsideSqlContext outsideSqlContext) { + final Object firstArg = args[0]; + String staticSql = getSql(); + if (firstArg != null) { + final BeanDesc beanDesc = BeanDescFactory.getBeanDesc(firstArg + .getClass()); + + // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + // - - - - - - - + // Resolve embedded comment for parsing bind variable comment in + // embedded comment. + // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + // - - - - - - - + for (int i = 0; i < beanDesc.getPropertyDescSize(); i++) { + final PropertyDesc propertyDesc = beanDesc.getPropertyDesc(i); + final Class propertyType = propertyDesc.getPropertyType(); + if (!propertyType.equals(String.class)) { + continue; + } + final String outsideSqlPiece = (String) propertyDesc + .getValue(firstArg); + if (outsideSqlPiece == null) { + continue; + } + final String embeddedComment = "/*$pmb." + + propertyDesc.getPropertyName() + "*/"; + staticSql = replaceString(staticSql, embeddedComment, + outsideSqlPiece); + } + } + + final OutsideSqlSelectExecution outsideSqlCommand = createDynamicSqlFactory(); + outsideSqlCommand.setArgNames(getArgNames()); + outsideSqlCommand.setArgTypes(getArgTypes()); + outsideSqlCommand.setSql(staticSql); + + final CommandContext ctx = outsideSqlCommand.apply(args); + final List bindVariableList = new ArrayList(); + final List> bindVariableTypeList = new ArrayList>(); + addBindVariableInfo(ctx, bindVariableList, bindVariableTypeList); + final InternalBasicSelectHandler selectHandler = createBasicSelectHandler( + ctx.getSql(), this.resultSetHandler); + final Object[] bindVariableArray = bindVariableList.toArray(); + selectHandler.setLoggingMessageSqlArgs(bindVariableArray); + return selectHandler.execute(bindVariableArray, + toClassArray(bindVariableTypeList)); + } + + /** + * Execute outside-SQL as static. + * + * @param args The array of argument. (NotNull, The first element should be + * the instance of Pmb) + * @param outsideSqlContext The context of outside-SQL. (NotNull) + * @return Result. (Nullable) + */ + protected Object executeOutsideSqlAsStatic(Object[] args, + OutsideSqlContext outsideSqlContext) { + final CommandContext ctx = apply(args); + final InternalBasicSelectHandler selectHandler = createBasicSelectHandler( + ctx.getSql(), this.resultSetHandler); + final Object[] bindVariableArray = ctx.getBindVariables(); + selectHandler.setLoggingMessageSqlArgs(bindVariableArray); + return selectHandler.execute(bindVariableArray, ctx + .getBindVariableTypes()); + } + + //========================================================================== + // ========= + // Dynamic SQL Factory + // =================== + protected OutsideSqlSelectExecution createDynamicSqlFactory() { + return new OutsideSqlSelectExecution(getDataSource(), + getStatementFactory(), resultSetHandler); + } + + //========================================================================== + // ========= + // Select Handler + // ============== + protected InternalBasicSelectHandler createBasicSelectHandler( + String realSql, ResultSetHandler rsh) { + return new InternalBasicSelectHandler(getDataSource(), realSql, rsh, + getStatementFactory()); + } + + //========================================================================== + // ========= + // Parser Option + // ============= + @Override + protected boolean isBlockNullParameter() { + return true; // Because the SQL is select. + } + + //========================================================================== + // ========= + // Setup Helper + // ============ + protected Class[] toClassArray(List> 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 bindVariableList, List> bindVariableTypeList) { + final Object[] bindVariables = ctx.getBindVariables(); + addBindVariableList(bindVariableList, bindVariables); + final Class[] bindVariableTypes = ctx.getBindVariableTypes(); + addBindVariableTypeList(bindVariableTypeList, bindVariableTypes); + } + + protected void addBindVariableList(List bindVariableList, + Object[] bindVariables) { + for (int i = 0; i < bindVariables.length; i++) { + bindVariableList.add(bindVariables[i]); + } + } + + protected void addBindVariableTypeList(List> bindVariableTypeList, + Class[] bindVariableTypes) { + for (int i = 0; i < bindVariableTypes.length; i++) { + bindVariableTypeList.add(bindVariableTypes[i]); + } + } + + //========================================================================== + // ========= + // General Helper + // ============== + protected final String replaceString(String text, String fromText, + String toText) { + return SimpleStringUtil.replace(text, fromText, toText); + } + + protected String getLineSeparator() { + return SimpleSystemUtil.getLineSeparator(); + } +} Property changes on: todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/bhv/core/execution/OutsideSqlSelectExecution.java ___________________________________________________________________ Name: svn:eol-style + native Added: todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/bhv/core/execution/SelectCBExecution.java =================================================================== --- todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/bhv/core/execution/SelectCBExecution.java (rev 0) +++ todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/bhv/core/execution/SelectCBExecution.java 2008-12-27 22:21:53 UTC (rev 1633) @@ -0,0 +1,168 @@ +package jp.sf.pal.todolist.db.allcommon.bhv.core.execution; + +import java.util.ArrayList; +import java.util.List; + +import javax.sql.DataSource; + +import jp.sf.pal.todolist.db.allcommon.cbean.ConditionBean; +import jp.sf.pal.todolist.db.allcommon.cbean.ConditionBeanContext; +import jp.sf.pal.todolist.db.allcommon.s2dao.internal.sqlcommand.InternalAbstractDynamicCommand; +import jp.sf.pal.todolist.db.allcommon.s2dao.internal.sqlhandler.InternalBasicSelectHandler; +import jp.sf.pal.todolist.db.allcommon.util.SimpleStringUtil; +import jp.sf.pal.todolist.db.allcommon.util.SimpleSystemUtil; + +import org.seasar.dao.CommandContext; +import org.seasar.extension.jdbc.ResultSetHandler; +import org.seasar.extension.jdbc.StatementFactory; + +/** + * @author DBFlute(AutoGenerator) + */ +public class SelectCBExecution extends InternalAbstractDynamicCommand { + + //========================================================================== + // ========= + // Attribute + // ========= + /** The handler of resultSet. */ + protected ResultSetHandler resultSetHandler; + + //========================================================================== + // ========= + // Constructor + // =========== + /** + * Constructor. + * + * @param dataSource Data source. + * @param statementFactory The factory of statement. + * @param resultSetHandler The handler of resultSet. + */ + public SelectCBExecution(DataSource dataSource, + StatementFactory statementFactory, ResultSetHandler resultSetHandler) { + super(dataSource, statementFactory); + this.resultSetHandler = resultSetHandler; + } + + //========================================================================== + // ========= + // Execute + // ======= + /** + * @param args The array of argument. (NotNull, The first element should be + * the instance of CB) + * @return The object of execution result. (Nullable) + */ + public Object execute(Object[] args) { + final List bindVariableList = new ArrayList(); + final List> bindVariableTypeList = new ArrayList>(); + + final String finalClause = setupRealClause(args, bindVariableList, + bindVariableTypeList); + final InternalBasicSelectHandler selectHandler = createBasicSelectHandler( + finalClause, this.resultSetHandler); + final Object[] bindVariableArray = bindVariableList.toArray(); + selectHandler.setLoggingMessageSqlArgs(bindVariableArray); + return selectHandler.execute(bindVariableArray, + toClassArray(bindVariableTypeList)); + } + + // ----------------------------------------------------- + // Setup Clause + // ------------ + protected String setupRealClause(Object[] args, + List bindVariableList, List> bindVariableTypeList) { + final ConditionBean cb = ConditionBeanContext + .getConditionBeanOnThread(); + final String realClause; + { + final SelectCBExecution dynamicSqlFactory = createDynamicSqlFactory(); + dynamicSqlFactory.setArgNames(getArgNames()); + dynamicSqlFactory.setArgTypes(getArgTypes()); + dynamicSqlFactory.setSql(cb.getSqlClause().getClause()); + final CommandContext ctx = dynamicSqlFactory.apply(args); + realClause = ctx.getSql(); + addBindVariableInfo(ctx, bindVariableList, bindVariableTypeList); + } + return realClause; + } + + //========================================================================== + // ========= + // Dynamic SQL Factory + // =================== + protected SelectCBExecution createDynamicSqlFactory() { + return new SelectCBExecution(getDataSource(), getStatementFactory(), + resultSetHandler); + } + + //========================================================================== + // ========= + // Select Handler + // ============== + protected InternalBasicSelectHandler createBasicSelectHandler( + String realSql, ResultSetHandler rsh) { + return new InternalBasicSelectHandler(getDataSource(), realSql, rsh, + getStatementFactory()); + } + + //========================================================================== + // ========= + // Parser Option + // ============= + @Override + protected boolean isBlockNullParameter() { + return true; // Because the SQL is select. + } + + //========================================================================== + // ========= + // Setup Helper + // ============ + protected Class[] toClassArray(List> 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 bindVariableList, List> bindVariableTypeList) { + final Object[] bindVariables = ctx.getBindVariables(); + addBindVariableList(bindVariableList, bindVariables); + final Class[] bindVariableTypes = ctx.getBindVariableTypes(); + addBindVariableTypeList(bindVariableTypeList, bindVariableTypes); + } + + protected void addBindVariableList(List bindVariableList, + Object[] bindVariables) { + for (int i = 0; i < bindVariables.length; i++) { + bindVariableList.add(bindVariables[i]); + } + } + + protected void addBindVariableTypeList(List> bindVariableTypeList, + Class[] bindVariableTypes) { + for (int i = 0; i < bindVariableTypes.length; i++) { + bindVariableTypeList.add(bindVariableTypes[i]); + } + } + + //========================================================================== + // ========= + // General Helper + // ============== + protected final String replaceString(String text, String fromText, + String toText) { + return SimpleStringUtil.replace(text, fromText, toText); + } + + protected String getLineSeparator() { + return SimpleSystemUtil.getLineSeparator(); + } +} Property changes on: todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/bhv/core/execution/SelectCBExecution.java ___________________________________________________________________ Name: svn:eol-style + native Modified: todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/cbean/AbstractConditionBean.java =================================================================== --- todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/cbean/AbstractConditionBean.java 2008-12-27 22:20:45 UTC (rev 1632) +++ todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/cbean/AbstractConditionBean.java 2008-12-27 22:21:53 UTC (rev 1633) @@ -24,6 +24,28 @@ public abstract class AbstractConditionBean implements ConditionBean { //========================================================================== + // =========== + // Definition + // ========== + /** Map-string map-mark. */ + private static final String MAP_STRING_MAP_MARK = "map:"; + + /** Map-string list-mark. */ + private static final String MAP_STRING_LIST_MARK = "list:"; + + /** Map-string start-brace. */ + private static final String MAP_STRING_START_BRACE = "@{"; + + /** Map-string end-brace. */ + private static final String MAP_STRING_END_BRACE = "@}"; + + /** Map-string delimiter. */ + private static final String MAP_STRING_DELIMITER = "@;"; + + /** Map-string equal. */ + private static final String MAP_STRING_EQUAL = "@="; + + //========================================================================== // ========= // Attribute // ========= @@ -41,8 +63,12 @@ // [DBFlute-0.7.4] @jflute -- At the future, I'll implement some check // logics by these purpose types. - protected boolean _forDeriveReferrer; + protected boolean _forDerivedReferrer; + protected boolean _forScalarSelect; + + protected boolean _forScalarSubQuery; + protected boolean _forUnion; protected boolean _forExistsSubQuery; @@ -73,27 +99,6 @@ //========================================================================== // ========= - // ConditionQuery - // ============== - /** - * Get condition query as interface. At the future, change public to - * protected. - * - * @return Instance of query as interface. (NotNull) - */ - abstract public ConditionQuery getConditionQueryAsInterface(); - - /** - * The implementation. - * - * @return The conditionQuery of the local table as interface. (NotNull) - */ - public ConditionQuery localCQ() { - return getConditionQueryAsInterface(); - } - - //========================================================================== - // ========= // Accept PrimaryKey // ================= /** @@ -498,42 +503,6 @@ //========================================================================== // ========= - // Limit Select - // ============ - /** Is limit-select PK only? */ - protected boolean _isLimitSelectPKOnly; - - /** - * Is limit-select PK only? - * - * @return Determination. - */ - public boolean isLimitSelect_PKOnly() { - return _isLimitSelectPKOnly; - } - - /** - * Limit select PK only. - * - * @return this. (NotNull) - */ - public ConditionBean limitSelect_PKOnly() { - _isLimitSelectPKOnly = true; - return this; - } - - /** - * Limit select off. - * - * @return this. (NotNull) - */ - public ConditionBean limitSelect_Off() { - _isLimitSelectPKOnly = false; - return this; - } - - //========================================================================== - // ========= // Lock Setting // ============ /** @@ -559,11 +528,8 @@ public ConditionBean xsetupSelectCountIgnoreFetchScope() { _isSelectCountIgnoreFetchScope = true; - // If the query uses union query, it needs included-select-column. - if (!hasUnionQueryOrUnionAllQuery()) { - getSqlClause().ignoreIncludedSelectColumn(); - } - + getSqlClause().classifySelectClauseType( + SqlClause.SelectClauseType.COUNT); getSqlClause().ignoreOrderBy(); getSqlClause().ignoreFetchScope(); return this; @@ -578,11 +544,7 @@ public ConditionBean xafterCareSelectCountIgnoreFetchScope() { _isSelectCountIgnoreFetchScope = false; - // If the query uses union query, it needs included-select-column. - if (!hasUnionQueryOrUnionAllQuery()) { - getSqlClause().makeIncludedSelectColumnEffective(); - } - + getSqlClause().rollbackSelectClauseType(); getSqlClause().makeOrderByEffective(); getSqlClause().makeFetchScopeEffective(); return this; @@ -613,20 +575,29 @@ protected CQ _query; - protected boolean _forDeriveReferrer; + protected boolean _forDerivedReferrer; - protected boolean alreadySpecifyRequiredColumn; + protected boolean _forScalarSelect; + protected boolean _forScalarSubQuery; + + protected boolean _alreadySpecifyRequiredColumn; + /** * @param baseCB The condition-bean of base level. (NotNull) - * @param qyCall The callback for condition-query. (NotNull) - * @param forDeriveReferrer Is this for derive referrer? + * @param qyCall The call-back for condition-query. (NotNull) + * @param forDerivedReferrer Is this for derive referrer? + * @param forScalarSelect Is this for scalar select? + * @param forScalarSubQuery Is this for scalar sub-query? */ protected AbstractSpecification(ConditionBean baseCB, - SpQyCall qyCall, boolean forDeriveReferrer) { + SpQyCall qyCall, boolean forDerivedReferrer, + boolean forScalarSelect, boolean forScalarSubQuery) { _baseCB = baseCB; _qyCall = qyCall; - _forDeriveReferrer = forDeriveReferrer; + _forDerivedReferrer = forDerivedReferrer; + _forScalarSelect = forScalarSelect; + _forScalarSubQuery = forScalarSubQuery; } protected void doColumn(String columnName) { @@ -634,8 +605,8 @@ if (_query == null) { _query = _qyCall.qy(); } - if (!_forDeriveReferrer && !alreadySpecifyRequiredColumn) { - alreadySpecifyRequiredColumn = true; + if (isRequiredColumnSpecificationEnabled()) { + _alreadySpecifyRequiredColumn = true; doSpecifyRequiredColumn(); } String relationPath = _query.getRelationPath() != null ? _query @@ -652,6 +623,11 @@ columnName); } + protected boolean isRequiredColumnSpecificationEnabled() { + return !_forDerivedReferrer && !_forScalarSelect + && !_forScalarSubQuery && !_alreadySpecifyRequiredColumn; + } + protected void assertColumn(String columnName) { if (_query == null && !_qyCall.has()) { throwSpecifyColumnNotSetupSelectColumnException(columnName); @@ -659,9 +635,15 @@ } protected void assertForeign(String foreignPropertyName) { - if (_forDeriveReferrer) { - throwDeriveReferrerInvalidForeignSpecificationException(foreignPropertyName); + if (_forDerivedReferrer) { + throwDerivedReferrerInvalidForeignSpecificationException(foreignPropertyName); } + if (_forScalarSelect) { + throwScalarSelectInvalidForeignSpecificationException(foreignPropertyName); + } + if (_forScalarSubQuery) { + throwScalarSubQueryInvalidForeignSpecificationException(foreignPropertyName); + } } protected abstract void doSpecifyRequiredColumn(); @@ -714,19 +696,19 @@ throw new SpecifyColumnNotSetupSelectColumnException(msg); } - protected void throwDeriveReferrerInvalidForeignSpecificationException( + protected void throwDerivedReferrerInvalidForeignSpecificationException( String foreignPropertyName) { String msg = "Look! Read the message below." + getLineSeparator(); msg = msg + "/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *" + getLineSeparator(); msg = msg - + "You specified a foreign table column in spite of derive-sub-query!" + + "You specified a foreign table column in spite of derived-referrer!" + getLineSeparator(); msg = msg + getLineSeparator(); msg = msg + "[Advice]" + getLineSeparator(); msg = msg - + "You should specified a local table column at condition-bean for derive-sub-query." + + "You should specified a local table column at condition-bean for derived-referrer." + getLineSeparator(); msg = msg + " For example:" + getLineSeparator(); msg = msg + " " + getLineSeparator(); @@ -736,7 +718,7 @@ msg = msg + " MemberCB cb = new MemberCB();" + getLineSeparator(); msg = msg - + " cb.specify().derivePurchaseList().max(new SubQuery() {" + + " cb.specify().derivedPurchaseList().max(new SubQuery() {" + getLineSeparator(); msg = msg + " public void query(PurchaseCB subCB) {" + getLineSeparator(); @@ -754,7 +736,7 @@ msg = msg + " MemberCB cb = new MemberCB();" + getLineSeparator(); msg = msg - + " cb.specify().derivePurchaseList().max(new SubQuery() {" + + " cb.specify().derivedPurchaseList().max(new SubQuery() {" + getLineSeparator(); msg = msg + " public void query(PurchaseCB subCB) {" + getLineSeparator(); @@ -769,9 +751,117 @@ msg = msg + "[Specified Foreign Property]" + getLineSeparator() + foreignPropertyName + getLineSeparator(); msg = msg + "* * * * * * * * * */"; - throw new DeriveReferrerInvalidForeignSpecificationException(msg); + throw new DerivedReferrerInvalidForeignSpecificationException(msg); } + protected void throwScalarSelectInvalidForeignSpecificationException( + String foreignPropertyName) { + String msg = "Look! Read the message below." + getLineSeparator(); + msg = msg + + "/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *" + + getLineSeparator(); + msg = msg + + "You specified a foreign table column in spite of scalar select!" + + getLineSeparator(); + msg = msg + getLineSeparator(); + msg = msg + "[Advice]" + getLineSeparator(); + msg = msg + + "You should specified a local table column at condition-bean for scalar select." + + getLineSeparator(); + msg = msg + " For example:" + getLineSeparator(); + msg = msg + " " + getLineSeparator(); + msg = msg + " [Wrong]" + getLineSeparator(); + msg = msg + " /- - - - - - - - - - - - - - - - - - - - " + + getLineSeparator(); + msg = msg + + " memberBhv.scalarSelect(Integer.class).max(new ScalarSelect() {" + + getLineSeparator(); + msg = msg + " public void query(MemberCB cb) {" + + getLineSeparator(); + msg = msg + + " cb.specify().specifyMemberStatus().columnDisplayOrder(); // *No!" + + getLineSeparator(); + msg = msg + " }" + getLineSeparator(); + msg = msg + " });" + getLineSeparator(); + msg = msg + " - - - - - - - - - -/" + getLineSeparator(); + msg = msg + " " + getLineSeparator(); + msg = msg + " [Good!]" + getLineSeparator(); + msg = msg + " /- - - - - - - - - - - - - - - - - - - - " + + getLineSeparator(); + msg = msg + + " memberBhv.scalarSelect(Date.class).max(new ScalarSelect() {" + + getLineSeparator(); + msg = msg + " public void query(MemberCB cb) {" + + getLineSeparator(); + msg = msg + + " cb.specify().columnMemberBirthday(); // *Point!" + + getLineSeparator(); + msg = msg + " }" + getLineSeparator(); + msg = msg + " });" + getLineSeparator(); + msg = msg + " - - - - - - - - - -/" + getLineSeparator(); + msg = msg + getLineSeparator(); + msg = msg + "[Specified Foreign Property]" + getLineSeparator() + + foreignPropertyName + getLineSeparator(); + msg = msg + "* * * * * * * * * */"; + throw new ScalarSelectInvalidForeignSpecificationException(msg); + } + + protected void throwScalarSubQueryInvalidForeignSpecificationException( + String foreignPropertyName) { + String msg = "Look! Read the message below." + getLineSeparator(); + msg = msg + + "/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *" + + getLineSeparator(); + msg = msg + + "You specified a foreign table column in spite of derived-query!" + + getLineSeparator(); + msg = msg + getLineSeparator(); + msg = msg + "[Advice]" + getLineSeparator(); + msg = msg + + "You should specified a local table column at condition-bean for derived-query." + + getLineSeparator(); + msg = msg + " For example:" + getLineSeparator(); + msg = msg + " " + getLineSeparator(); + msg = msg + " [Wrong]" + getLineSeparator(); + msg = msg + " /- - - - - - - - - - - - - - - - - - - - " + + getLineSeparator(); + msg = msg + " MemberCB cb = new MemberCB();" + + getLineSeparator(); + msg = msg + + " cb.query().scalar_Equal().max(new SubQuery() {" + + getLineSeparator(); + msg = msg + " public void query(MemberCB subCB) {" + + getLineSeparator(); + msg = msg + + " subCB.specify().specifyMemberStatusName().columnDisplayOrder(); // *No!" + + getLineSeparator(); + msg = msg + " }" + getLineSeparator(); + msg = msg + " });" + getLineSeparator(); + msg = msg + " - - - - - - - - - -/" + getLineSeparator(); + msg = msg + " " + getLineSeparator(); + msg = msg + " [Good!]" + getLineSeparator(); + msg = msg + " /- - - - - - - - - - - - - - - - - - - - " + + getLineSeparator(); + msg = msg + " MemberCB cb = new MemberCB();" + + getLineSeparator(); + msg = msg + + " cb.query().scalar_Equal().max(new SubQuery() {" + + getLineSeparator(); + msg = msg + " public void query(MemberCB subCB) {" + + getLineSeparator(); + msg = msg + + " subCB.specify().columnMemberBirthday();// *Point!" + + getLineSeparator(); + msg = msg + " }" + getLineSeparator(); + msg = msg + " });" + getLineSeparator(); + msg = msg + " - - - - - - - - - -/" + getLineSeparator(); + msg = msg + getLineSeparator(); + msg = msg + "[Specified Foreign Property]" + getLineSeparator() + + foreignPropertyName + getLineSeparator(); + msg = msg + "* * * * * * * * * */"; + throw new ScalarSubQueryInvalidForeignSpecificationException(msg); + } + protected String getLineSeparator() { return SimpleSystemUtil.getLineSeparator(); } @@ -792,15 +882,33 @@ } } - public static class DeriveReferrerInvalidForeignSpecificationException + public static class DerivedReferrerInvalidForeignSpecificationException extends RuntimeException { private static final long serialVersionUID = 1L; - public DeriveReferrerInvalidForeignSpecificationException(String msg) { + public DerivedReferrerInvalidForeignSpecificationException(String msg) { super(msg); } } + public static class ScalarSubQueryInvalidForeignSpecificationException + extends RuntimeException { + private static final long serialVersionUID = 1L; + + public ScalarSubQueryInvalidForeignSpecificationException(String msg) { + super(msg); + } + } + + public static class ScalarSelectInvalidForeignSpecificationException extends + RuntimeException { + private static final long serialVersionUID = 1L; + + public ScalarSelectInvalidForeignSpecificationException(String msg) { + super(msg); + } + } + public static class RAFunction { protected ConditionBean _baseCB; @@ -815,6 +923,18 @@ _querySetupper = querySetupper; } + public void count(SubQuery subQuery, String aliasName) { + assertAliasName(aliasName); + _querySetupper.setup("count", subQuery, _localCQ, aliasName.trim()); + } + + public void countDistinct(SubQuery subQuery, + String aliasName) { + assertAliasName(aliasName); + _querySetupper.setup("count(distinct", subQuery, _localCQ, + aliasName.trim()); + } + public void max(SubQuery subQuery, String aliasName) { assertAliasName(aliasName); _querySetupper.setup("max", subQuery, _localCQ, aliasName.trim()); @@ -835,14 +955,9 @@ _querySetupper.setup("avg", subQuery, _localCQ, aliasName.trim()); } - public void count(SubQuery subQuery, String aliasName) { - assertAliasName(aliasName); - _querySetupper.setup("count", subQuery, _localCQ, aliasName.trim()); - } - protected void assertAliasName(String aliasName) { if (aliasName == null || aliasName.trim().length() == 0) { - throwDeriveReferrerInvalidAliasNameException(); + throwDerivedReferrerInvalidAliasNameException(); } DBMeta dbmeta = DBMetaInstanceHandler.findDBMeta(_baseCB .getTableDbName()); @@ -860,17 +975,17 @@ } } if (!existsSetterMethod) { - throwDeriveReferrerEntityPropertyNotFoundException(aliasName, + throwDerivedReferrerEntityPropertyNotFoundException(aliasName, dbmeta.getEntityType()); } } - protected void throwDeriveReferrerInvalidAliasNameException() { + protected void throwDerivedReferrerInvalidAliasNameException() { String msg = "Look! Read the message below." + getLineSeparator(); msg = msg + "/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *" + getLineSeparator(); - msg = msg + "The alias name for derive-referrer was Invalid!" + msg = msg + "The alias name for derived-referrer was Invalid!" + getLineSeparator(); msg = msg + getLineSeparator(); msg = msg + "[Advice]" + getLineSeparator(); @@ -915,17 +1030,17 @@ msg = msg + "[Local Table]" + getLineSeparator() + _localCQ.getTableDbName() + getLineSeparator(); msg = msg + "* * * * * * * * * */"; - throw new DeriveReferrerInvalidAliasNameException(msg); + throw new DerivedReferrerInvalidAliasNameException(msg); } - protected void throwDeriveReferrerEntityPropertyNotFoundException( + protected void throwDerivedReferrerEntityPropertyNotFoundException( String aliasName, Class entityType) { String msg = "Look! Read the message below." + getLineSeparator(); msg = msg + "/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *" + getLineSeparator(); msg = msg - + "A property for derive-referrer was Not Found in the entity!" + + "A property for derived-referrer was Not Found in the entity!" + getLineSeparator(); msg = msg + getLineSeparator(); msg = msg + "[Advice]" + getLineSeparator(); @@ -981,7 +1096,7 @@ msg = msg + "[Target Entity]" + getLineSeparator() + entityType + getLineSeparator(); msg = msg + "* * * * * * * * * */"; - throw new DeriveReferrerEntityPropertyNotFoundException(msg); + throw new DerivedReferrerEntityPropertyNotFoundException(msg); } protected String replaceString(String text, String fromText, @@ -999,20 +1114,20 @@ LOCAL_CQ cq, String aliasName); } - public static class DeriveReferrerInvalidAliasNameException extends + public static class DerivedReferrerInvalidAliasNameException extends RuntimeException { private static final long serialVersionUID = 1L; - public DeriveReferrerInvalidAliasNameException(String msg) { + public DerivedReferrerInvalidAliasNameException(String msg) { super(msg); } } - public static class DeriveReferrerEntityPropertyNotFoundException extends + public static class DerivedReferrerEntityPropertyNotFoundException extends RuntimeException { private static final long serialVersionUID = 1L; - public DeriveReferrerEntityPropertyNotFoundException(String msg) { + public DerivedReferrerEntityPropertyNotFoundException(String msg) { super(msg); } } @@ -1042,7 +1157,6 @@ protected void doSetupSelect(SsCall callback) { String foreignPropertyName = callback.qf().getForeignPropertyName(); assertSetupSelectBeforeUnion(foreignPropertyName); - limitSelect_Off(); String foreignTableAliasName = callback.qf().getRealAliasName(); String localRelationPath = localCQ().getRelationPath(); getSqlClause().registerSelectedSelectColumn(foreignTableAliasName, @@ -1164,19 +1278,27 @@ // ========= // Purpose Type // ============ - public void xsetupForDeriveReferrer() { - _forDeriveReferrer = true; + public void xsetupForDerivedReferrer() { // Very Internal + _forDerivedReferrer = true; } - public void xsetupForUnion() { + public void xsetupForScalarSelect() { // Very Internal + _forScalarSelect = true; + } + + public void xsetupForScalarSubQuery() { // Very Internal + _forScalarSubQuery = true; + } + + public void xsetupForUnion() { // Very Internal _forUnion = true; } - public void xsetupForExistsSubQuery() { + public void xsetupForExistsSubQuery() { // Very Internal _forExistsSubQuery = true; } - public void xsetupForInScopeSubQuery() { + public void xsetupForInScopeSubQuery() { // Very Internal _forInScopeSubQuery = true; } Modified: todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/cbean/AbstractConditionQuery.java =================================================================== --- todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/cbean/AbstractConditionQuery.java 2008-12-27 22:20:45 UTC (rev 1632) +++ todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/cbean/AbstractConditionQuery.java 2008-12-27 22:21:53 UTC (rev 1633) @@ -48,12 +48,14 @@ protected static final ConditionKey CK_PS = ConditionKey.CK_PREFIX_SEARCH; - protected static final ConditionKey CK_LS = ConditionKey.CK_LIKE_SEARCH; - protected static final ConditionKey CK_INS = ConditionKey.CK_IN_SCOPE; protected static final ConditionKey CK_NINS = ConditionKey.CK_NOT_IN_SCOPE; + protected static final ConditionKey CK_LS = ConditionKey.CK_LIKE_SEARCH; + + protected static final ConditionKey CK_NLS = ConditionKey.CK_NOT_LIKE_SEARCH; + protected static final ConditionKey CK_ISN = ConditionKey.CK_IS_NULL; protected static final ConditionKey CK_ISNN = ConditionKey.CK_IS_NOT_NULL; @@ -351,15 +353,7 @@ String msg = "The argument[unionQuery] should not be null."; throw new IllegalArgumentException(msg); } - reflectRelationOnUnionQuery(this, unionQuery);// Reflect Relation! - getSqlClause().copyIncludedSelectColumn(unionQuery.getSqlClause());// Reflect - // IncludedSelectColumn - // ! - if (getSqlClause().isFormatClauseEffective()) { - unionQuery.getSqlClause().makeFormatClauseEffective();// Reflect - // FormatClause - // ! - } + reflectRelationOnUnionQuery(this, unionQuery); // Reflect Relation! String key = (unionAll ? "unionAllQuery" : "unionQuery") + unionQueryMap.size(); unionQueryMap.put(key, unionQuery); @@ -416,22 +410,6 @@ // Register // ======== // ----------------------------------------------------- - // Include-As-Mine - // --------------- - /** - * Register included-select-column. - * - * @param aliasName Alias name. This should not contain comma. (NotNull) - * @param realColumnName Real column name. This should not contain comma. - * (NotNull) - * @deprecated Unsupported! - */ - protected void registerIncludedSelectColumn(String aliasName, - String realColumnName) { - throw new UnsupportedOperationException(); - } - - // ----------------------------------------------------- // Query // ----- protected void registerQuery(ConditionKey key, Object value, @@ -488,6 +466,13 @@ // ----------------------------------------------------- // LikeSearch Query // ---------------- + protected void regLSQ(ConditionKey key, String value, + ConditionValue cvalue, String colName, String capPropName, + String uncapPropName, LikeSearchOption option) { + registerLikeSearchQuery(key, value, cvalue, colName, capPropName, + uncapPropName, option); + } + @SuppressWarnings("deprecation") protected void registerLikeSearchQuery(ConditionKey key, String value, ConditionValue cvalue, String colName, String capPropName, @@ -700,25 +685,20 @@ assertObjectNotNull("InScopeSubQyery(" + columnName + ")", subQuery); inScopeOption = inScopeOption != null ? inScopeOption + " " : ""; String realColumnName = getInScopeSubQueryRealColumnName(columnName); + xincrementLocalSubQueryLevelIfNeeds(subQuery); String subQueryClause = getInScopeSubQuerySql(subQuery, relatedColumnName, propertyName); - String clause = null; - if (getSqlClause().isFormatClauseEffective()) { - String ln = getLineSeparator(); - int subQueryLevel = subQuery.getSubQueryLevel(); - String subQueryIdentity = propertyName + "[" + subQueryLevel + "]"; - String beginMark = getSqlClause().resolveSubQueryBeginMark( - subQueryIdentity) - + ln; - String endMark = getSqlClause().resolveSubQueryEndMark( - subQueryIdentity); - String endIndent = " "; - clause = realColumnName + " " + inScopeOption + "in (" + beginMark - + subQueryClause + ln + endIndent + ")" + endMark; - } else { - clause = realColumnName + " " + inScopeOption + "in (" - + subQueryClause + ")"; - } + String ln = getLineSeparator(); + int subQueryLevel = subQuery.getSubQueryLevel(); + String subQueryIdentity = propertyName + "[" + subQueryLevel + "]"; + String beginMark = getSqlClause().resolveSubQueryBeginMark( + subQueryIdentity) + + ln; + String endMark = getSqlClause() + .resolveSubQueryEndMark(subQueryIdentity); + String endIndent = " "; + String clause = realColumnName + " " + inScopeOption + "in (" + + beginMark + subQueryClause + ln + endIndent + ")" + endMark; registerWhereClause(clause); } @@ -728,22 +708,11 @@ protected String getInScopeSubQuerySql(ConditionQuery subQuery, String relatedColumnName, String propertyName) { - String selectClause = "select " - + getSqlClause().getLocalTableAliasName() + "." + String tableAliasName = getSqlClause().getLocalTableAliasName(); + String selectClause = "select " + tableAliasName + "." + relatedColumnName; - String fromWhereClause = subQuery.getSqlClause() - .getClauseFromWhereWithUnionTemplate(); - fromWhereClause = replaceString(fromWhereClause, ".conditionQuery.", - "." + getLocationBase(propertyName) + ".");// Very Important! - - // Replace template marks. These are very important! - fromWhereClause = replaceString(fromWhereClause, getSqlClause() - .getUnionSelectClauseMark(), selectClause); - fromWhereClause = replaceString(fromWhereClause, getSqlClause() - .getUnionWhereClauseMark(), ""); - fromWhereClause = replaceString(fromWhereClause, getSqlClause() - .getUnionWhereFirstConditionMark(), ""); - + String fromWhereClause = buildPlainSubQueryFromWhereClause(subQuery, + relatedColumnName, propertyName, selectClause, tableAliasName); return selectClause + " " + fromWhereClause; } @@ -769,24 +738,20 @@ assertObjectNotNull("ExistsSubQyery(" + columnName + ")", subQuery); existsOption = existsOption != null ? existsOption + " " : ""; String realColumnName = getExistsSubQueryRealColumnName(columnName); + xincrementLocalSubQueryLevelIfNeeds(subQuery); String subQueryClause = getExistsSubQuerySql(subQuery, realColumnName, relatedColumnName, propertyName); - String clause = null; - if (getSqlClause().isFormatClauseEffective()) { - String ln = getLineSeparator(); - int subQueryLevel = subQuery.getSubQueryLevel(); - String subQueryIdentity = propertyName + "[" + subQueryLevel + "]"; - String beginMark = getSqlClause().resolveSubQueryBeginMark( - subQueryIdentity) - + ln; - String endMark = getSqlClause().resolveSubQueryEndMark( - subQueryIdentity); - String endIndent = " "; - clause = existsOption + "exists (" + beginMark + subQueryClause - + ln + endIndent + ")" + endMark; - } else { - clause = existsOption + "exists (" + subQueryClause + ")"; - } + String ln = getLineSeparator(); + int subQueryLevel = subQuery.getSubQueryLevel(); + String subQueryIdentity = propertyName + "[" + subQueryLevel + "]"; + String beginMark = getSqlClause().resolveSubQueryBeginMark( + subQueryIdentity) + + ln; + String endMark = getSqlClause() + .resolveSubQueryEndMark(subQueryIdentity); + String endIndent = " "; + String clause = existsOption + "exists (" + beginMark + subQueryClause + + ln + endIndent + ")" + endMark; registerWhereClause(clause); } @@ -801,134 +766,116 @@ protected String getExistsSubQuerySql(ConditionQuery subQuery, String realColumnName, String relatedColumnName, String propertyName) { int subQueryLevel = subQuery.getSubQueryLevel(); - if (_subQueryLevel <= subQueryLevel) { - _subQueryLevel = subQueryLevel + 1; - } String tableAliasName = "dfsublocal_" + subQueryLevel; String selectClause = "select " + tableAliasName + "." + relatedColumnName; - String fromWhereClause = subQuery.getSqlClause() - .getClauseFromWhereWithWhereUnionTemplate(); - fromWhereClause = replaceString(fromWhereClause, "dflocal", - tableAliasName);// Very Important! - fromWhereClause = replaceString(fromWhereClause, ".conditionQuery.", - "." + getLocationBase(propertyName) + ".");// Very Important! - - String joinCondition = tableAliasName + "." + relatedColumnName + " = " - + realColumnName; - String firstConditionAfter = " and "; - if (getSqlClause().isFormatClauseEffective()) { - firstConditionAfter = getLineSeparator() + " and "; - } - - // Replace template marks. These are very important! - fromWhereClause = replaceString(fromWhereClause, getSqlClause() - .getWhereClauseMark(), "where " + joinCondition); - fromWhereClause = replaceString(fromWhereClause, getSqlClause() - .getWhereFirstConditionMark(), joinCondition - + firstConditionAfter); - fromWhereClause = replaceString(fromWhereClause, getSqlClause() - .getUnionSelectClauseMark(), selectClause); - fromWhereClause = replaceString(fromWhereClause, getSqlClause() - .getUnionWhereClauseMark(), "where " + joinCondition); - fromWhereClause = replaceString(fromWhereClause, getSqlClause() - .getUnionWhereFirstConditionMark(), joinCondition - + firstConditionAfter); - + String fromWhereClause = buildCorrelationSubQueryFromWhereClause( + subQuery, relatedColumnName, propertyName, selectClause, + tableAliasName, realColumnName); return selectClause + " " + fromWhereClause; } // [DBFlute-0.7.4] // ----------------------------------------------------- - // DeriveSubQuery - // -------------- - protected void registerDeriveSubQuery(String function, + // DerivedReferrerSubQuery + // ----------------------- + protected void registerDerivedReferrerSubQuery(String function, ConditionQuery subQuery, String columnName, String relatedColumnName, String propertyName, String aliasName) { - assertObjectNotNull("DeriveSubQuery(" + columnName + ")", subQuery); - final String realColumnName = getDeriveSubQueryRealColumnName(columnName); - final String subQueryClause = getDeriveSubQuerySql(function, subQuery, - realColumnName, relatedColumnName, propertyName, aliasName); - final String clause; - if (getSqlClause().isFormatClauseEffective()) { - final String ln = getLineSeparator(); - final int subQueryLevel = subQuery.getSubQueryLevel(); - final String subQueryIdentity = propertyName + "[" + subQueryLevel - + "]"; - final String beginMark = getSqlClause().resolveSubQueryBeginMark( - subQueryIdentity) - + ln; - final String endMark = getSqlClause().resolveSubQueryEndMark( - subQueryIdentity); - final String endIndent = " "; - clause = "(" + beginMark + subQueryClause + ln + endIndent - + ") as " + aliasName + endMark; - } else { - clause = "(" + subQueryClause + ") as " + aliasName; - } + assertObjectNotNull("DerivedReferrerSubQuery(function)", function); + assertObjectNotNull("DerivedReferrerSubQuery(" + columnName + ")", + subQuery); + String realColumnName = getDerivedReferrerSubQueryRealColumnName(columnName); + xincrementLocalSubQueryLevelIfNeeds(subQuery); + String subQueryClause = getDerivedReferrerSubQuerySql(function, + subQuery, realColumnName, relatedColumnName, propertyName, + aliasName); + String ln = getLineSeparator(); + int subQueryLevel = subQuery.getSubQueryLevel(); + String subQueryIdentity = propertyName + "[" + subQueryLevel + "]"; + String beginMark = getSqlClause().resolveSubQueryBeginMark( + subQueryIdentity) + + ln; + String endMark = getSqlClause() + .resolveSubQueryEndMark(subQueryIdentity); + String endIndent = " "; + String clause = "(" + beginMark + subQueryClause + ln + endIndent + + ") " + aliasName + endMark; getSqlClause().specifyDeriveSubQuery(aliasName, clause); } - protected String getDeriveSubQueryRealColumnName(String columnName) { + protected String getDerivedReferrerSubQueryRealColumnName(String columnName) { return getRealColumnName(columnName); } - protected String getDeriveSubQuerySql(String function, + protected String getDerivedReferrerSubQuerySql(String function, ConditionQuery subQuery, String realColumnName, String relatedColumnName, String propertyName, String aliasName) { - final int subQueryLevel = subQuery.getSubQueryLevel(); - if (_subQueryLevel <= subQueryLevel) { - _subQueryLevel = subQueryLevel + 1; - } - final String tableAliasName = "dfsublocal_" + subQueryLevel; - final String deriveColumnName = subQuery.getSqlClause() + int subQueryLevel = subQuery.getSubQueryLevel(); + String tableAliasName = "dfsublocal_" + subQueryLevel; + String deriveColumnName = subQuery.getSqlClause() .getSpecifiedColumnNameAsOne(); if (deriveColumnName == null || deriveColumnName.trim().length() == 0) { - throwDeriveReferrerInvalidColumnSpecificationException(function, + throwDerivedReferrerInvalidColumnSpecificationException(function, aliasName); } - assertDeriveReferrerColumnType(function, subQuery, deriveColumnName); - subQuery.getSqlClause().clearSpecifiedSelectColumn(); - final String selectClause = "select " + function + "(" + tableAliasName - + "." + deriveColumnName + ")"; - String fromWhereClause = subQuery.getSqlClause() - .getClauseFromWhereWithWhereUnionTemplate(); - fromWhereClause = replaceString(fromWhereClause, "dflocal", - tableAliasName);// Very Important! - fromWhereClause = replaceString(fromWhereClause, ".conditionQuery.", - "." + getLocationBase(propertyName) + ".");// Very Important! - - final String joinCondition = tableAliasName + "." + relatedColumnName - + " = " + realColumnName; - String firstConditionAfter = " and "; - if (getSqlClause().isFormatClauseEffective()) { - firstConditionAfter = getLineSeparator() + " and "; + assertDerivedReferrerColumnType(function, subQuery, deriveColumnName); + subQuery.getSqlClause().clearSpecifiedSelectColumn(); // specified + // columns + // disappear at + // this timing + String connect = xbuildFunctionConnector(function); + if (subQuery.getSqlClause().hasUnionQuery()) { + String ln = getLineSeparator(); + String subQueryIdentity = propertyName + "[" + subQueryLevel + + ":subquerymain]"; + String beginMark = getSqlClause().resolveSubQueryBeginMark( + subQueryIdentity) + + ln; + String endMark = getSqlClause().resolveSubQueryEndMark( + subQueryIdentity); + DBMeta dbmeta = DBMetaInstanceHandler.findDBMeta(subQuery + .getTableDbName()); + if (!dbmeta.hasPrimaryKey() || dbmeta.hasTwoOrMorePrimaryKeys()) { + String msg = "The derived-referrer is unsupported when no primary key or two-or-more primary keys:"; + msg = msg + " table=" + subQuery.getTableDbName(); + throw new UnsupportedOperationException(msg); + } + String primaryKeyName = dbmeta.getPrimaryUniqueInfo() + .getFirstColumn().getColumnDbName(); + String selectClause = "select " + tableAliasName + "." + + primaryKeyName + ", " + tableAliasName + "." + + relatedColumnName + ", " + tableAliasName + "." + + deriveColumnName; + String fromWhereClause = buildPlainSubQueryFromWhereClause( + subQuery, relatedColumnName, propertyName, selectClause, + tableAliasName); + String mainSql = selectClause + " " + fromWhereClause; + String joinCondition = "dfsubquerymain." + relatedColumnName + + " = " + realColumnName; + return "select " + function + connect + "dfsubquerymain." + + deriveColumnName + ")" + ln + " from (" + beginMark + + mainSql + ln + " ) dfsubquerymain" + endMark + ln + + " where " + joinCondition; + } else { + String selectClause = "select " + function + connect + + tableAliasName + "." + deriveColumnName + ")"; + String fromWhereClause = buildCorrelationSubQueryFromWhereClause( + subQuery, relatedColumnName, propertyName, selectClause, + tableAliasName, realColumnName); + return selectClause + " " + fromWhereClause; } - - // Replace template marks. These are very important! - fromWhereClause = replaceString(fromWhereClause, getSqlClause() - .getWhereClauseMark(), "where " + joinCondition); - fromWhereClause = replaceString(fromWhereClause, getSqlClause() - .getWhereFirstConditionMark(), joinCondition - + firstConditionAfter); - fromWhereClause = replaceString(fromWhereClause, getSqlClause() - .getUnionSelectClauseMark(), selectClause); - fromWhereClause = replaceString(fromWhereClause, getSqlClause() - .getUnionWhereClauseMark(), "where " + joinCondition); - fromWhereClause = replaceString(fromWhereClause, getSqlClause() - .getUnionWhereFirstConditionMark(), joinCondition - + firstConditionAfter); - - return selectClause + " " + fromWhereClause; } - protected void throwDeriveReferrerInvalidColumnSpecificationException( + protected void throwDerivedReferrerInvalidColumnSpecificationException( String function, String aliasName) { + String method = xconvertFunctionToMethod(function); String msg = "Look! Read the message below." + getLineSeparator(); msg = msg + "/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *" + getLineSeparator(); - msg = msg + "The specified the column for derive-referrer was Invalid!" + msg = msg + + "The specified the column for derived-referrer was Invalid!" + getLineSeparator(); msg = msg + getLineSeparator(); msg = msg + "[Advice]" + getLineSeparator(); @@ -941,7 +888,7 @@ msg = msg + " /- - - - - - - - - - - - - - - - - - - - " + getLineSeparator(); msg = msg + " MemberCB cb = new MemberCB();" + getLineSeparator(); - msg = msg + " cb.specify().derivePurchaseList()." + function + msg = msg + " cb.specify().derivePurchaseList()." + method + "(new SubQuery() {" + getLineSeparator(); msg = msg + " public void query(PurchaseCB subCB) {" + getLineSeparator(); @@ -955,7 +902,7 @@ msg = msg + " /- - - - - - - - - - - - - - - - - - - - " + getLineSeparator(); msg = msg + " MemberCB cb = new MemberCB();" + getLineSeparator(); - msg = msg + " cb.specify().derivePurchaseList()." + function + msg = msg + " cb.specify().derivePurchaseList()." + method + "(new SubQuery() {" + getLineSeparator(); msg = msg + " public void query(PurchaseCB subCB) {" + getLineSeparator(); @@ -973,7 +920,7 @@ msg = msg + " /- - - - - - - - - - - - - - - - - - - - " + getLineSeparator(); msg = msg + " MemberCB cb = new MemberCB();" + getLineSeparator(); - msg = msg + " cb.specify().derivePurchaseList()." + function + msg = msg + " cb.specify().derivePurchaseList()." + method + "(new SubQuery() {" + getLineSeparator(); msg = msg + " public void query(PurchaseCB subCB) {" + getLineSeparator(); @@ -988,19 +935,19 @@ msg = msg + "[Alias Name]" + getLineSeparator() + aliasName + getLineSeparator(); msg = msg + "* * * * * * * * * */"; - throw new DeriveReferrerInvalidColumnSpecificationException(msg); + throw new DerivedReferrerInvalidColumnSpecificationException(msg); } - public static class DeriveReferrerInvalidColumnSpecificationException + public static class DerivedReferrerInvalidColumnSpecificationException extends RuntimeException { private static final long serialVersionUID = 1L; - public DeriveReferrerInvalidColumnSpecificationException(String msg) { + public DerivedReferrerInvalidColumnSpecificationException(String msg) { super(msg); } } - protected void assertDeriveReferrerColumnType(String function, + protected void assertDerivedReferrerColumnType(String function, ConditionQuery subQuery, String deriveColumnName) { final DBMeta dbmeta = DBMetaInstanceHandler.findDBMeta(subQuery .getTableDbName()); @@ -1009,13 +956,13 @@ if ("sum".equalsIgnoreCase(function) || "avg".equalsIgnoreCase(function)) { if (!Number.class.isAssignableFrom(deriveColumnType)) { - throwDeriveReferrerUnmatchedColumnTypeException(function, + throwDerivedReferrerUnmatchedColumnTypeException(function, deriveColumnName, deriveColumnType); } } } - protected void throwDeriveReferrerUnmatchedColumnTypeException( + protected void throwDerivedReferrerUnmatchedColumnTypeException( String function, String deriveColumnName, Class deriveColumnType) { String msg = "Look! Read the message below." + getLineSeparator(); msg = msg @@ -1040,19 +987,366 @@ msg = msg + "[Derive Column]" + getLineSeparator() + deriveColumnName + "(" + deriveColumnType.getName() + ")" + getLineSeparator(); msg = msg + "* * * * * * * * * */"; - throw new DeriveReferrerUnmatchedColumnTypeException(msg); + throw new DerivedReferrerUnmatchedColumnTypeException(msg); } - public static class DeriveReferrerUnmatchedColumnTypeException extends + public static class DerivedReferrerUnmatchedColumnTypeException extends RuntimeException { private static final long serialVersionUID = 1L; - public DeriveReferrerUnmatchedColumnTypeException(String msg) { + public DerivedReferrerUnmatchedColumnTypeException(String msg) { super(msg); } } + // [DBFlute-0.8.8] // ----------------------------------------------------- + // ScalarSubQuery + // -------------- + protected void registerScalarSubQuery(String function, + ConditionQuery subQuery, String propertyName, String operand) { + assertObjectNotNull("ScalarSubQuery(" + propertyName + ")", subQuery); + + // Get the specified column before it disappears at sub-query making. + String deriveRealColumnName; + { + String deriveColumnName = subQuery.getSqlClause() + .getSpecifiedColumnNameAsOne(); + if (deriveColumnName == null + || deriveColumnName.trim().length() == 0) { + throwScalarSubQueryInvalidColumnSpecificationException(function); + } + deriveRealColumnName = getScalarSubQueryRealColumnName(deriveColumnName); + } + + xincrementLocalSubQueryLevelIfNeeds(subQuery); + String subQueryClause = getScalarSubQuerySql(function, subQuery, + propertyName); + String ln = getLineSeparator(); + int subQueryLevel = subQuery.getSubQueryLevel(); + String subQueryIdentity = propertyName + "[" + subQueryLevel + "]"; + String beginMark = getSqlClause().resolveSubQueryBeginMark( + subQueryIdentity) + + ln; + String endMark = getSqlClause() + .resolveSubQueryEndMark(subQueryIdentity); + String endIndent = " "; + String clause = deriveRealColumnName + " " + operand + " (" + beginMark + + subQueryClause + ln + endIndent + ") " + endMark; + registerWhereClause(clause); + } + + protected String getScalarSubQueryRealColumnName(String columnName) { + return getRealColumnName(columnName); + } + + protected String getScalarSubQuerySql(String function, + ConditionQuery subQuery, String propertyName) { + int subQueryLevel = subQuery.getSubQueryLevel(); + String tableAliasName = "dfsublocal_" + subQueryLevel; + String deriveColumnName = subQuery.getSqlClause() + .getSpecifiedColumnNameAsOne(); + if (deriveColumnName == null || deriveColumnName.trim().length() == 0) { + throwScalarSubQueryInvalidColumnSpecificationException(function); + } + assertScalarSubQueryColumnType(function, subQuery, deriveColumnName); + subQuery.getSqlClause().clearSpecifiedSelectColumn(); // specified + // columns + // disappear at + // this timing + DBMeta dbmeta = DBMetaInstanceHandler.findDBMeta(subQuery + .getTableDbName()); + if (!dbmeta.hasPrimaryKey() || dbmeta.hasTwoOrMorePrimaryKeys()) { + String msg = "The scalar-sub-query is unsupported when no primary key or two-or-more primary keys:"; + msg = msg + " table=" + subQuery.getTableDbName(); + throw new UnsupportedOperationException(msg); + } + String primaryKeyName = dbmeta.getPrimaryUniqueInfo().getFirstColumn() + .getColumnDbName(); + if (subQuery.getSqlClause().hasUnionQuery()) { + String ln = getLineSeparator(); + String subQueryIdentity = propertyName + "[" + subQueryLevel + + ":subquerymain]"; + String beginMark = getSqlClause().resolveSubQueryBeginMark( + subQueryIdentity) + + ln; + String endMark = getSqlClause().resolveSubQueryEndMark( + subQueryIdentity); + String selectClause = "select " + tableAliasName + "." + + primaryKeyName + ", " + tableAliasName + "." + + deriveColumnName; + String fromWhereClause = buildPlainSubQueryFromWhereClause( + subQuery, primaryKeyName, propertyName, selectClause, + tableAliasName); + String mainSql = selectClause + " " + fromWhereClause; + return "select " + function + "(dfsubquerymain." + deriveColumnName + + ")" + ln + " from (" + beginMark + mainSql + ln + + " ) dfsubquerymain" + endMark; + } else { + String selectClause = "select " + function + "(" + tableAliasName + + "." + deriveColumnName + ")"; + String fromWhereClause = buildPlainSubQueryFromWhereClause( + subQuery, primaryKeyName, propertyName, selectClause, + tableAliasName); + return selectClause + " " + fromWhereClause; + } + } + + protected void throwScalarSubQueryInvalidColumnSpecificationException( + String function) { + String msg = "Look! Read the message below." + getLineSeparator(); + msg = msg + + "/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *" + + getLineSeparator(); + msg = msg + + "The specified the column for derived-referrer was Invalid!" + + getLineSeparator(); + msg = msg + getLineSeparator(); + msg = msg + "[Advice]" + getLineSeparator(); + msg = msg + + " You should call specify().column[TargetColumn]() only once." + + getLineSeparator(); + msg = msg + " For example:" + getLineSeparator(); + msg = msg + " " + getLineSeparator(); + msg = msg + " [Wrong]" + getLineSeparator(); + msg = msg + " /- - - - - - - - - - - - - - - - - - - - " + + getLineSeparator(); + msg = msg + " MemberCB cb = new MemberCB();" + getLineSeparator(); + msg = msg + " cb.query().scalar_Equal()." + function + + "(new SubQuery() {" + getLineSeparator(); + msg = msg + " public void query(MemberCB subCB) {" + + getLineSeparator(); + msg = msg + " // *No! It's empty!" + getLineSeparator(); + msg = msg + " }" + getLineSeparator(); + msg = msg + " });" + getLineSeparator(); + msg = msg + " - - - - - - - - - -/" + getLineSeparator(); + msg = msg + " " + getLineSeparator(); + msg = msg + " [Wrong]" + getLineSeparator(); + msg = msg + " /- - - - - - - - - - - - - - - - - - - - " + + getLineSeparator(); + msg = msg + " MemberCB cb = new MemberCB();" + getLineSeparator(); + msg = msg + " cb.query().scalar_Equal()." + function + + "(new SubQuery() {" + getLineSeparator(); + msg = msg + " public void query(MemberCB subCB) {" + + getLineSeparator(); + msg = msg + " subCB.specify().columnMemberBirthday();" + + getLineSeparator(); + msg = msg + + " subCB.specify().columnMemberName(); // *No! It's duplicated!" + + getLineSeparator(); + msg = msg + " }" + getLineSeparator(); + msg = msg + " });" + getLineSeparator(); + msg = msg + " - - - - - - - - - -/" + getLineSeparator(); + msg = msg + " " + getLineSeparator(); + msg = msg + " [Good!]" + getLineSeparator(); + msg = msg + " /- - - - - - - - - - - - - - - - - - - - " + + getLineSeparator(); + msg = msg + " MemberCB cb = new MemberCB();" + getLineSeparator(); + msg = msg + " cb.query().scalar_Equal()." + function + + "(new SubQuery() {" + getLineSeparator(); + msg = msg + " public void query(MemberCB subCB) {" + + getLineSeparator(); + msg = msg + + " subCB.specify().columnPurchaseDatetime(); // *Point!" + + getLineSeparator(); + msg = msg + " }" + getLineSeparator(); + msg = msg + " });" + getLineSeparator(); + msg = msg + " - - - - - - - - - -/" + getLineSeparator(); + msg = msg + "* * * * * * * * * */"; + throw new ScalarSubQueryInvalidColumnSpecificationException(msg); + } + + public static class ScalarSubQueryInvalidColumnSpecificationException + extends RuntimeException { + private static final long serialVersionUID = 1L; + + public ScalarSubQueryInvalidColumnSpecificationException(String msg) { + super(msg); + } + } + + protected void assertScalarSubQueryColumnType(String function, + ConditionQuery subQuery, String deriveColumnName) { + final DBMeta dbmeta = DBMetaInstanceHandler.findDBMeta(subQuery + .getTableDbName()); + final Class deriveColumnType = dbmeta.findColumnInfo( + deriveColumnName).getPropertyType(); + if ("sum".equalsIgnoreCase(function) + || "avg".equalsIgnoreCase(function)) { + if (!Number.class.isAssignableFrom(deriveColumnType)) { + throwScalarSubQueryUnmatchedColumnTypeException(function, + deriveColumnName, deriveColumnType); + } + } + } + + protected void throwScalarSubQueryUnmatchedColumnTypeException( + String function, String deriveColumnName, Class deriveColumnType) { + String msg = "Look! Read the message below." + getLineSeparator(); + msg = msg + + "/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *" + + getLineSeparator(); + msg = msg + + "The type of the specified the column unmatched with the function!" + + getLineSeparator(); + msg = msg + getLineSeparator(); + msg = msg + "[Advice]" + getLineSeparator(); + msg = msg + "You should confirm the list as follow:" + + getLineSeparator(); + msg = msg + " max() : String, Number, Date" + getLineSeparator(); + msg = msg + " min() : String, Number, Date" + getLineSeparator(); + msg = msg + " sum() : Number" + getLineSeparator(); + msg = msg + " avg() : Number" + getLineSeparator(); + msg = msg + getLineSeparator(); + msg = msg + "[Function]" + getLineSeparator() + function + + getLineSeparator(); + msg = msg + getLineSeparator(); + msg = msg + "[Derive Column]" + getLineSeparator() + deriveColumnName + + "(" + deriveColumnType.getName() + ")" + getLineSeparator(); + msg = msg + "* * * * * * * * * */"; + throw new ScalarSubQueryUnmatchedColumnTypeException(msg); + } + + public static class ScalarSubQueryUnmatchedColumnTypeException extends + RuntimeException { + private static final long serialVersionUID = 1L; + + public ScalarSubQueryUnmatchedColumnTypeException(String msg) { + super(msg); + } + } + + public static class SSQFunction { + protected SSQSetupper _setupper; + + public SSQFunction(SSQSetupper setupper) { + _setupper = setupper; + } + + public void max(SubQuery subQuery) { + _setupper.setup("max", subQuery); + } + + public void min(SubQuery subQuery) { + _setupper.setup("min", subQuery); + } + + public void sum(SubQuery subQuery) { + _setupper.setup("sum", subQuery); + } + + public void avg(SubQuery subQuery) { + _setupper.setup("avg", subQuery); + } + } + + protected static interface SSQSetupper { + public void setup(String function, SubQuery subQuery); + } + + // ----------------------------------------------------- + // SubQuery Common + // --------------- + protected String buildPlainSubQueryFromWhereClause(ConditionQuery subQuery, + String relatedColumnName, String propertyName, String selectClause, + String tableAliasName) { + String fromWhereClause = subQuery.getSqlClause() + .getClauseFromWhereWithUnionTemplate(); + + // Replace the alias names for local table with alias name of sub-query + // unique. + // However when it's inScope this replacement is unnecessary so comment + // out here. + // (Override base alias name at sub-query on SQL) + // So if the argument 'tableAliasName' is not null, replace it. + if (tableAliasName != null) { + fromWhereClause = replaceString(fromWhereClause, "dflocal", + tableAliasName); + } + + // Resolve the location path for the condition-query of sub-query. + fromWhereClause = replaceString(fromWhereClause, ".conditionQuery.", + "." + getLocationBase(propertyName) + "."); + + // Replace template marks. These are very important! + fromWhereClause = replaceString(fromWhereClause, getSqlClause() + .getUnionSelectClauseMark(), selectClause); + fromWhereClause = replaceString(fromWhereClause, getSqlClause() + .getUnionWhereClauseMark(), ""); + fromWhereClause = replaceString(fromWhereClause, getSqlClause() + .getUnionWhereFirstConditionMark(), ""); + return fromWhereClause; + } + + protected String buildCorrelationSubQueryFromWhereClause( + ConditionQuery subQuery, String relatedColumnName, + String propertyName, String selectClause, String tableAliasName, + String realColumnName) { + String fromWhereClause = subQuery.getSqlClause() + .getClauseFromWhereWithWhereUnionTemplate(); + + // Replace the alias names for local table with alias name of sub-query + // unique. + fromWhereClause = replaceString(fromWhereClause, "dflocal", + tableAliasName); + + // Resolve the location path for the condition-query of sub-query. + fromWhereClause = replaceString(fromWhereClause, ".conditionQuery.", + "." + getLocationBase(propertyName) + "."); + + String joinCondition = tableAliasName + "." + relatedColumnName + " = " + + realColumnName; + String firstConditionAfter = getLineSeparator() + " and "; + + // Replace template marks. These are very important! + fromWhereClause = replaceString(fromWhereClause, getSqlClause() + .getWhereClauseMark(), "where " + joinCondition); + fromWhereClause = replaceString(fromWhereClause, getSqlClause() + .getWhereFirstConditionMark(), joinCondition + + firstConditionAfter); + fromWhereClause = replaceString(fromWhereClause, getSqlClause() + .getUnionSelectClauseMark(), selectClause); + fromWhereClause = replaceString(fromWhereClause, getSqlClause() + .getUnionWhereClauseMark(), "where " + joinCondition); + fromWhereClause = replaceString(fromWhereClause, getSqlClause() + .getUnionWhereFirstConditionMark(), joinCondition + + firstConditionAfter); + return fromWhereClause; + } + + protected void xincrementLocalSubQueryLevelIfNeeds(ConditionQuery subQuery) { // Very + // Internal + int subQueryLevel = subQuery.getSubQueryLevel(); + if (_subQueryLevel <= subQueryLevel) { + _subQueryLevel = subQueryLevel + 1; + } + } + + protected String xbuildFunctionConnector(String function) { + if (function != null && function.endsWith("(distinct")) { // For example + // 'count(distinct' + return " "; + } else { + return "("; + } + } + + protected String xconvertFunctionToMethod(String function) { + if (function != null && function.contains("(")) { // For example + // 'count(distinct' + int index = function.indexOf("("); + String front = function.substring(0, index); + if (function.length() > front.length() + "(".length()) { + String rear = function.substring(index + "(".length()); + function = front + initCap(rear); + } else { + function = front; + } + } + return function; + } + + // ----------------------------------------------------- // Where Clause // ------------ protected void setupConditionValueAndRegisterWhereClause(ConditionKey key, @@ -1276,14 +1570,16 @@ // ========= // Fixed Condition // =============== - protected String prepareFixedCondition(String fixedCondition, - String localAliasName, String foreignAliasName) { + protected String ppFxCd(String fixedCondition, String localAliasName, + String foreignAliasName) { // prepareFixedCondition fixedCondition = replaceString(fixedCondition, "$$alias$$", foreignAliasName); fixedCondition = replaceString(fixedCondition, "$$foreignAlias$$", foreignAliasName); fixedCondition = replaceString(fixedCondition, "$$localAlias$$", localAliasName); + fixedCondition = replaceString(fixedCondition, "$$locationBase$$.", + "dto." + getLocationBase()); return fixedCondition; } @@ -1515,7 +1811,7 @@ return newList; } - public void doNss(NssCall callback) {// Very Internal + public void doNss(NssCall callback) { // Very Internal String foreignPropertyName = callback.qf().getForeignPropertyName(); String foreignTableAliasName = callback.qf().getRealAliasName(); getSqlClause().registerSelectedSelectColumn(foreignTableAliasName, @@ -1524,7 +1820,7 @@ callback.qf().getRelationPath(), foreignPropertyName); } - public static interface NssCall {// Very Internal + public static interface NssCall { // Very Internal public ConditionQuery qf(); } Modified: todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/cbean/ConditionBean.java =================================================================== --- todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/cbean/ConditionBean.java 2008-12-27 22:20:45 UTC (rev 1632) +++ todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/cbean/ConditionBean.java 2008-12-27 22:21:53 UTC (rev 1633) @@ -1,5 +1,7 @@ package jp.sf.pal.todolist.db.allcommon.cbean; +import java.util.Map; + import jp.sf.pal.todolist.db.allcommon.cbean.sqlclause.SqlClause; import jp.sf.pal.todolist.db.allcommon.jdbc.StatementConfig; @@ -11,28 +13,6 @@ public interface ConditionBean extends PagingBean { //========================================================================== - // =========== - // Definition - // ========== - /** Map-string map-mark. */ - public static final String MAP_STRING_MAP_MARK = "map:"; - - /** Map-string list-mark. */ - public static final String MAP_STRING_LIST_MARK = "list:"; - - /** Map-string start-brace. */ - public static final String MAP_STRING_START_BRACE = "@{"; - - /** Map-string end-brace. */ - public static final String MAP_STRING_END_BRACE = "@}"; - - /** Map-string delimiter. */ - public static final String MAP_STRING_DELIMITER = "@;"; - - /** Map-string equal. */ - public static final String MAP_STRING_EQUAL = "@="; - - //========================================================================== // ========= // Table Name // ========== @@ -70,8 +50,7 @@ * * @param primaryKeyMap Primary-key map. (NotNull and NotEmpty) */ - public void acceptPrimaryKeyMap( - java.util.Map primaryKeyMap); + public void acceptPrimaryKeyMap(Map primaryKeyMap); /** * Accept primary-key map-string. Delimiter is at-mark and semicolon. @@ -105,14 +84,6 @@ // Query // ===== /** - * Get condition-query as interface. - * - * @return Instance of query as interface. (NotNull) - * @deprecated - */ - public ConditionQuery getConditionQueryAsInterface(); - - /** * Get the conditionQuery of the local table as interface. * * @return The conditionQuery of the local table as interface. (NotNull) @@ -131,32 +102,6 @@ public boolean hasUnionQueryOrUnionAllQuery(); //========================================================================== - // ========= - // Limit Select - // ============ - /** - * Limit select PK only. This is OLD style. You can do the same thing by - * specify(). - * - * @return this. (NotNull) - */ - public ConditionBean limitSelect_PKOnly(); - - /** - * Limit select off. - * - * @return this. (NotNull) - */ - public ConditionBean limitSelect_Off(); - - /** - * Is limit-select PK only? - * - * @return Determination. - */ - public boolean isLimitSelect_PKOnly(); - - //========================================================================== // =========== // Lock Setting // ============ Modified: todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/cbean/ConditionBeanContext.java =================================================================== --- todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/cbean/ConditionBeanContext.java 2008-12-27 22:20:45 UTC (rev 1632) +++ todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/cbean/ConditionBeanContext.java 2008-12-27 22:21:53 UTC (rev 1633) @@ -1,10 +1,6 @@ package jp.sf.pal.todolist.db.allcommon.cbean; -import java.util.Collections; -import java.util.LinkedHashMap; -import java.util.Map; - -import jp.sf.pal.todolist.db.allcommon.DBFluteConfig; +import jp.sf.pal.todolist.db.allcommon.DBDef; import jp.sf.pal.todolist.db.allcommon.cbean.sqlclause.SqlClause; import jp.sf.pal.todolist.db.allcommon.cbean.sqlclause.SqlClauseDb2; import jp.sf.pal.todolist.db.allcommon.cbean.sqlclause.SqlClauseDerby; @@ -78,11 +74,35 @@ //========================================================================== // ========= - // Initialize against the ClassLoader Headache - // =========================================== + // Type Determination + // ================== + /** + * Is the argument condition-bean? + * + * @param dtoInstance DTO instance. + * @return Determination. + */ + public static boolean isTheArgumentConditionBean(final Object dtoInstance) { + return dtoInstance instanceof ConditionBean; + } + + /** + * Is the type condition-bean? + * + * @param dtoClass DtoClass. + * @return Determination. + */ + public static boolean isTheTypeConditionBean(final Class dtoClass) { + return ConditionBean.class.isAssignableFrom(dtoClass); + } + + //========================================================================== + // ========= + // Cool Classes + // ============ @SuppressWarnings("unused") - public static void initialize() { - boolean debugEnabled = _log.isDebugEnabled(); + public static void loadCoolClasses() { + boolean debugEnabled = false; // If you watch the log, set this true. // Against the ClassLoader Headache! final StringBuilder sb = new StringBuilder(); { @@ -119,120 +139,6 @@ //========================================================================== // ========= - // Type Determination - // ================== - /** - * Is the argument condition-bean? - * - * @param dtoInstance DTO instance. - * @return Determination. - */ - public static boolean isTheArgumentConditionBean(final Object dtoInstance) { - if (dtoInstance instanceof ConditionBean) { - return true; - } else { - return false; - } - } - - /** - * Is the type condition-bean? - * - * @param dtoClass DtoClass. - * @return Determination. - */ - public static boolean isTheTypeConditionBean(final Class dtoClass) { - if (ConditionBean.class.isAssignableFrom(dtoClass)) { - return true; - } else { - return false; - } - } - - //========================================================================== - // ========= - // Product Name - // ============ - public static final String DB_NAME_DERBY = "derby"; - - public static final String DB_NAME_H2 = "h2"; - - public static final String DB_NAME_ORACLE = "oracle"; - - public static final String DB_NAME_MYSQL = "mysql"; - - public static final String DB_NAME_POSTGRESQL = "postgresql"; - - public static final String DB_NAME_FIREBIRD = "firebird"; - - public static final String DB_NAME_MSSQL = "mssql"; - - public static final String DB_NAME_SYBASE = "sybase"; - - public static final String DB_NAME_DB2 = "db2"; - - protected static final Map _driverHintDatabaseProductNameMap; - static { - final Map tmpMap = Collections - .synchronizedMap(new LinkedHashMap()); - 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 keySet = _driverHintDatabaseProductNameMap - .keySet(); - for (final java.util.Iterator ite = keySet.iterator(); ite - .hasNext();) { - final String driverHint = (String) ite.next(); - if (driverClassName.indexOf(driverHint) >= 0) { - final String databaseProductName = (String) _driverHintDatabaseProductNameMap - .get(driverHint); - setDatabaseProductName(databaseProductName); - return true; - } - } - return false; - } - - /** The database product name. */ - private static String _databaseProductName; - - /** - * Get database product name. - * - * @return Database product name. - */ - public static String getDatabaseProductName() { - return _databaseProductName; - } - - /** - * Set database product name. - * - * @param name Database product name. (NotNull) - */ - public static void setDatabaseProductName(String name) { - if (_databaseProductName != null) { - String msg = "Already set up: current=" + _databaseProductName - + " your=" + name; - throw new IllegalStateException(msg); - } - _databaseProductName = name; - } - - //========================================================================== - // ========= // SqlClause Creator // ================= /** @@ -244,9 +150,6 @@ public static SqlClause createSqlClause(ConditionBean cb) { final String tableSqlName = cb.getTableSqlName(); final SqlClause sqlClause = createSqlClause(tableSqlName); - if (DBFluteConfig.getInstance().isConditionBeanFormatSql()) { - sqlClause.makeFormatClauseEffective(); - } return sqlClause; } @@ -257,27 +160,22 @@ * @return SQL-clause. (NotNull) */ public static SqlClause createSqlClause(String tableDbName) { - final String databaseProductName = getDatabaseProductName(); - if (databaseProductName == null) { - return new SqlClauseH2(tableDbName); - } - final String name = databaseProductName.toLowerCase(); - if (name.equalsIgnoreCase(DB_NAME_DERBY)) { - return new SqlClauseDerby(tableDbName); - } else if (name.equalsIgnoreCase(DB_NAME_H2)) { - return new SqlClauseH2(tableDbName); - } else if (name.equalsIgnoreCase(DB_NAME_ORACLE)) { - return new SqlClauseOracle(tableDbName); - } else if (name.equalsIgnoreCase(DB_NAME_FIREBIRD)) { - return new SqlClauseFirebird(tableDbName); - } else if (name.equalsIgnoreCase(DB_NAME_MYSQL)) { + if (DBDef.isCurrentDef(DBDef.MySQL)) { return new SqlClauseMySql(tableDbName); - } else if (name.equalsIgnoreCase(DB_NAME_POSTGRESQL)) { + } else if (DBDef.isCurrentDef(DBDef.PostgreSQL)) { return new SqlClausePostgreSql(tableDbName); - } else if (name.equalsIgnoreCase(DB_NAME_MSSQL)) { - return new SqlClauseSqlServer(tableDbName); - } else if (name.equalsIgnoreCase(DB_NAME_DB2)) { + } else if (DBDef.isCurrentDef(DBDef.Oracle)) { + return new SqlClauseOracle(tableDbName); + } else if (DBDef.isCurrentDef(DBDef.DB2)) { return new SqlClauseDb2(tableDbName); + } else if (DBDef.isCurrentDef(DBDef.SQLServer)) { + return new SqlClauseSqlServer(tableDbName); + } else if (DBDef.isCurrentDef(DBDef.FireBird)) { + return new SqlClauseFirebird(tableDbName); + } else if (DBDef.isCurrentDef(DBDef.H2)) { + return new SqlClauseH2(tableDbName); + } else if (DBDef.isCurrentDef(DBDef.Derby)) { + return new SqlClauseDerby(tableDbName); } else { return new SqlClauseH2(tableDbName); } @@ -362,12 +260,7 @@ // Display SQL // =========== public static String convertConditionBean2DisplaySql(ConditionBean cb) { - final String twoWaySql; - if (cb.isLimitSelect_PKOnly()) { - twoWaySql = cb.getSqlClause().getClausePKOnly(); - } else { - twoWaySql = cb.getSqlClause().getClause(); - } + final String twoWaySql = cb.getSqlClause().getClause(); return InternalSqlParser.convertTwoWaySql2DisplaySql(twoWaySql, cb); } @@ -390,31 +283,8 @@ errorCode); } - // [DBFlute-0.7.8] //========================================================================== // ========= - // Database Type - // ============= - /** - * Is the database Oracle? - * - * @return Is the database Oracle? - */ - public static boolean isOracle() { - return createSqlClause("dummy") instanceof SqlClauseOracle; - } - - /** - * Is the database PostgreSQL? - * - * @return Is the database PostgreSQL? - */ - public static boolean isPostgreSql() { - return createSqlClause("dummy") instanceof SqlClausePostgreSql; - } - - //========================================================================== - // ========= // Helper // ====== /** Modified: todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/cbean/ConditionQuery.java =================================================================== --- todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/cbean/ConditionQuery.java 2008-12-27 22:20:45 UTC (rev 1632) +++ todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/cbean/ConditionQuery.java 2008-12-27 22:21:53 UTC (rev 1633) @@ -8,7 +8,6 @@ * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public interface ConditionQuery { //========================================================================== Added: todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/cbean/ScalarQuery.java =================================================================== --- todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/cbean/ScalarQuery.java (rev 0) +++ todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/cbean/ScalarQuery.java 2008-12-27 22:21:53 UTC (rev 1633) @@ -0,0 +1,5 @@ +package jp.sf.pal.todolist.db.allcommon.cbean; + +public interface ScalarQuery { + public void query(CB cb); +} Property changes on: todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/cbean/ScalarQuery.java ___________________________________________________________________ Name: svn:eol-style + native Modified: todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/cbean/ckey/ConditionKey.java =================================================================== --- todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/cbean/ckey/ConditionKey.java 2008-12-27 22:20:45 UTC (rev 1632) +++ todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/cbean/ckey/ConditionKey.java 2008-12-27 22:21:53 UTC (rev 1633) @@ -12,6 +12,10 @@ */ public abstract class ConditionKey { + //========================================================================== + // ========= + // Definition + // ========== /** Mark of replaced value. */ public static final String MARK_OF_REPLACED_VALUE = "ReplacedValue"; @@ -36,15 +40,18 @@ /** The condition key of prefixSearch. */ public static final ConditionKey CK_PREFIX_SEARCH = new ConditionKeyPrefixSearch(); - /** The condition key of likeSearch. */ - public static final ConditionKey CK_LIKE_SEARCH = new ConditionKeyLikeSearch(); - /** The condition key of inScope. */ public static final ConditionKey CK_IN_SCOPE = new ConditionKeyInScope(); /** The condition key of notInScope. */ public static final ConditionKey CK_NOT_IN_SCOPE = new ConditionKeyNotInScope(); + /** The condition key of likeSearch. */ + public static final ConditionKey CK_LIKE_SEARCH = new ConditionKeyLikeSearch(); + + /** The condition key of notLikeSearch. */ + public static final ConditionKey CK_NOT_LIKE_SEARCH = new ConditionKeyNotLikeSearch(); + /** The condition key of isNull. */ public static final ConditionKey CK_IS_NULL = new ConditionKeyIsNull(); @@ -54,31 +61,21 @@ /** Dummy-object for IsNull and IsNotNull and so on... */ protected static final Object DUMMY_OBJECT = new Object(); + //========================================================================== + // ========= + // Attribute + // ========= /** Condition-key. */ protected String _conditionKey; /** Operand. */ protected String _operand; + //========================================================================== + // ========= + // Validation + // ========== /** - * Get condition-key. - * - * @return Condition-key. - */ - public String getConditionKey() { - return _conditionKey; - } - - /** - * Get operand. - * - * @return Operand. - */ - public String getOperand() { - return _operand; - } - - /** * Is valid registration? * * @param conditionValue Condition value. (NotNull) @@ -89,6 +86,10 @@ abstract public boolean isValidRegistration(ConditionValue conditionValue, Object value, String callerName); + //========================================================================== + // ========= + // Where Clause + // ============ /** * Add where clause. * @@ -149,6 +150,10 @@ abstract protected void doAddWhereClause(List conditionList, String columnName, ConditionValue value, ConditionOption option); + //========================================================================== + // ========= + // Condition Value + // =============== /** * Setup condition value. * @@ -210,6 +215,10 @@ ConditionValue conditionValue, Object value, String location, ConditionOption option); + //========================================================================== + // ========= + // Bind Clause + // =========== /** * Build bind clause. (for s2dao) * @@ -269,6 +278,10 @@ return "%"; } + //========================================================================== + // ========= + // Basic Override + // ============== /** * The override. Returns hash-code of this condition-key string. * @@ -304,4 +317,26 @@ return "ConditionKey: " + getConditionKey() + " " + getOperand() + " wild-card=[" + getWildCard() + "]"; } + + //========================================================================== + // ========= + // Accessor + // ======== + /** + * Get condition-key. + * + * @return Condition-key. + */ + public String getConditionKey() { + return _conditionKey; + } + + /** + * Get operand. + * + * @return Operand. + */ + public String getOperand() { + return _operand; + } } Added: todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/cbean/ckey/ConditionKeyNotLikeSearch.java =================================================================== --- todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/cbean/ckey/ConditionKeyNotLikeSearch.java (rev 0) +++ todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/cbean/ckey/ConditionKeyNotLikeSearch.java 2008-12-27 22:21:53 UTC (rev 1633) @@ -0,0 +1,104 @@ +package jp.sf.pal.todolist.db.allcommon.cbean.ckey; + +import java.util.List; + +import jp.sf.pal.todolist.db.allcommon.cbean.coption.ConditionOption; +import jp.sf.pal.todolist.db.allcommon.cbean.coption.LikeSearchOption; +import jp.sf.pal.todolist.db.allcommon.cbean.cvalue.ConditionValue; + +/** + * The condition-key of notLikeSearch. + * + * @author DBFlute(AutoGenerator) + */ +public class ConditionKeyNotLikeSearch extends ConditionKey { + + /** + * Constructor. + */ + protected ConditionKeyNotLikeSearch() { + _conditionKey = "notLikeSearch"; + _operand = "not like"; + } + + /** + * Is valid registration? + * + * @param conditionValue Condition value. (NotNull) + * @param value Value. (NotNull) + * @param callerName Caller name. (NotNull) + * @return Determination. + */ + public boolean isValidRegistration(ConditionValue conditionValue, + Object value, String callerName) { + if (value == null) { + return false; + } + return true; + } + + /** + * This method implements super#doAddWhereClause(). + * + * @param conditionList Condition list. (NotNull) + * @param columnName Column name. (NotNull) + * @param value Condition value. (NotNull) + */ + protected void doAddWhereClause(List 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 conditionList, + String columnName, ConditionValue value, ConditionOption option) { + if (option == null) { + String msg = "The argument[option] should not be null: columnName=" + + columnName + " value=" + value; + throw new IllegalArgumentException(msg); + } + if (!(option instanceof LikeSearchOption)) { + String msg = "The argument[option] should be LikeSearchOption: columnName=" + + columnName + " value=" + value; + throw new IllegalArgumentException(msg); + } + final LikeSearchOption myOption = (LikeSearchOption) option; + conditionList.add(buildBindClauseWithRearOption(columnName, value + .getNotLikeSearchLocation(), myOption.getRearOption())); + } + + /** + * This method implements super#doSetupConditionValue(). + * + * @param conditionValue Condition value. (NotNull) + * @param value Value. (NotNull) + * @param location Location. (NotNull) + */ + protected void doSetupConditionValue(ConditionValue conditionValue, + Object value, String location) { + throw new UnsupportedOperationException( + "doSetupConditionValue without condition-option is unsupported!!!"); + } + + /** + * This method implements super#doSetupConditionValue(). + * + * @param conditionValue Condition value. (NotNull) + * @param value Value. (NotNull) + * @param location Location. (NotNull) + * @param option Condition option. (NotNull) + */ + protected void doSetupConditionValue(ConditionValue conditionValue, + Object value, String location, ConditionOption option) { + conditionValue.setNotLikeSearch((String) value, + (LikeSearchOption) option).setNotLikeSearchLocation(location); + } +} Property changes on: todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/cbean/ckey/ConditionKeyNotLikeSearch.java ___________________________________________________________________ Name: svn:eol-style + native Modified: todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/cbean/coption/FromToOption.java =================================================================== --- todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/cbean/coption/FromToOption.java 2008-12-27 22:20:45 UTC (rev 1632) +++ todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/cbean/coption/FromToOption.java 2008-12-27 22:21:53 UTC (rev 1633) @@ -1,5 +1,10 @@ package jp.sf.pal.todolist.db.allcommon.cbean.coption; +import java.util.Calendar; +import java.util.Date; + +import jp.sf.pal.todolist.db.allcommon.cbean.ckey.ConditionKey; + /** * The option of from-to. * @@ -85,60 +90,84 @@ // ========= // Internal Main // ============= - public java.util.Date filterFromDate(java.util.Date fromDate) { + /** + * Filter the date as From. It requires this method is called before + * getFromDateConditionKey(). + * + * @param fromDate The date as From. (Nullable: If the value is null, it + * returns null) + * @return The filtered date as From. (Nullable) + */ + public Date filterFromDate(Date fromDate) { if (fromDate == null) { return null; } if (_compareAsDate) { - final java.util.Calendar cal = java.util.Calendar.getInstance(); + final Calendar cal = Calendar.getInstance(); cal.setTimeInMillis(fromDate.getTime()); clearCalendarHourMinuteSecondMilli(cal); - final java.util.Date cloneDate = (java.util.Date) fromDate.clone(); + final Date cloneDate = (Date) fromDate.clone(); cloneDate.setTime(cal.getTimeInMillis()); return cloneDate; } return fromDate; } - public java.util.Date filterToDate(java.util.Date toDate) { + /** + * Filter the date as To. It requires this method is called before + * getToDateConditionKey(). + * + * @param toDate The date as To. (Nullable: If the value is null, it returns + * null) + * @return The filtered date as To. (Nullable) + */ + public Date filterToDate(Date toDate) { if (toDate == null) { return null; } if (_compareAsDate) { - final java.util.Calendar cal = java.util.Calendar.getInstance(); + final Calendar cal = Calendar.getInstance(); cal.setTimeInMillis(toDate.getTime()); clearCalendarHourMinuteSecondMilli(cal); addCalendarNextDay(cal);// Key Point! - final java.util.Date cloneDate = (java.util.Date) toDate.clone(); + final Date cloneDate = (Date) toDate.clone(); cloneDate.setTime(cal.getTimeInMillis()); return cloneDate; } return toDate; } - public jp.sf.pal.todolist.db.allcommon.cbean.ckey.ConditionKey getFromDateConditionKey() { + /** + * Get the condition-key of the from-date. It requires this method is called + * after filterFromDate(). + * + * @return The condition-key of the from-date. (NotNull) + */ + public ConditionKey getFromDateConditionKey() { if (_compareAsDate) { - return jp.sf.pal.todolist.db.allcommon.cbean.ckey.ConditionKey.CK_GREATER_EQUAL; + return ConditionKey.CK_GREATER_EQUAL; } if (_fromDateGreaterThan) { - return jp.sf.pal.todolist.db.allcommon.cbean.ckey.ConditionKey.CK_GREATER_THAN;// Default - // ! + return ConditionKey.CK_GREATER_THAN;// Default! } else { - return jp.sf.pal.todolist.db.allcommon.cbean.ckey.ConditionKey.CK_GREATER_EQUAL;// Default - // ! + return ConditionKey.CK_GREATER_EQUAL;// Default! } } - public jp.sf.pal.todolist.db.allcommon.cbean.ckey.ConditionKey getToDateConditionKey() { + /** + * Get the condition-key of the to-date. It requires this method is called + * after filterToDate(). + * + * @return The condition-key of the to-date. (NotNull) + */ + public ConditionKey getToDateConditionKey() { if (_compareAsDate) { - return jp.sf.pal.todolist.db.allcommon.cbean.ckey.ConditionKey.CK_LESS_THAN; + return ConditionKey.CK_LESS_THAN; } if (_toDateLessThan) { - return jp.sf.pal.todolist.db.allcommon.cbean.ckey.ConditionKey.CK_LESS_THAN;// Default - // ! + return ConditionKey.CK_LESS_THAN;// Default! } else { - return jp.sf.pal.todolist.db.allcommon.cbean.ckey.ConditionKey.CK_LESS_EQUAL;// Default - // ! + return ConditionKey.CK_LESS_EQUAL;// Default! } } @@ -146,15 +175,15 @@ // ========= // Calendar Helper // =============== - protected void addCalendarNextDay(java.util.Calendar cal) { - cal.add(java.util.Calendar.DAY_OF_MONTH, 1); + protected void addCalendarNextDay(Calendar cal) { + cal.add(Calendar.DAY_OF_MONTH, 1); } - protected void clearCalendarHourMinuteSecondMilli(java.util.Calendar cal) { - cal.clear(java.util.Calendar.MILLISECOND); - cal.clear(java.util.Calendar.SECOND); - cal.clear(java.util.Calendar.MINUTE); - cal.set(java.util.Calendar.HOUR_OF_DAY, cal - .getActualMinimum(java.util.Calendar.HOUR_OF_DAY)); + protected void clearCalendarHourMinuteSecondMilli(Calendar cal) { + cal.clear(Calendar.MILLISECOND); + cal.clear(Calendar.SECOND); + cal.clear(Calendar.MINUTE); + cal.set(Calendar.HOUR_OF_DAY, cal + .getActualMinimum(Calendar.HOUR_OF_DAY)); } } Modified: todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/cbean/coption/LikeSearchOption.java =================================================================== --- todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/cbean/coption/LikeSearchOption.java 2008-12-27 22:20:45 UTC (rev 1632) +++ todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/cbean/coption/LikeSearchOption.java 2008-12-27 22:21:53 UTC (rev 1633) @@ -4,6 +4,7 @@ import java.util.Iterator; import java.util.List; +import jp.sf.pal.todolist.db.allcommon.DBDef; import jp.sf.pal.todolist.db.allcommon.cbean.coption.parts.local.JapaneseOptionPartsAgent; /** @@ -230,6 +231,10 @@ String tmp = replace(value, _escape, _escape + _escape); tmp = replace(tmp, "%", _escape + "%"); tmp = replace(tmp, "_", _escape + "_"); + if (DBDef.isCurrentDef(DBDef.Oracle)) { + tmp = replace(tmp, "\uff05", _escape + "\uff05"); + tmp = replace(tmp, "\uff3f", _escape + "\uff3f"); + } value = tmp; } final String wildCard = "%"; Modified: todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/cbean/cvalue/ConditionValue.java =================================================================== --- todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/cbean/cvalue/ConditionValue.java 2008-12-27 22:20:45 UTC (rev 1632) +++ todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/cbean/cvalue/ConditionValue.java 2008-12-27 22:21:53 UTC (rev 1633) @@ -6,9 +6,10 @@ import jp.sf.pal.todolist.db.allcommon.cbean.coption.InScopeOption; import jp.sf.pal.todolist.db.allcommon.cbean.coption.LikeSearchOption; +import jp.sf.pal.todolist.db.allcommon.util.SimpleTypeUtil; /** - * Condition value. + * Condition-value. * * @author DBFlute(AutoGenerator) */ @@ -578,110 +579,9 @@ //========================================================================== // ========= - // Like Search - // =========== - /** Value of likeSearch. */ - protected List _likeSearch; - - /** Value of likeSearch for spare. */ - protected List _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(); - _likeSearch4Spare = new ArrayList(); - } - if (_likeSearch.isEmpty() && !_likeSearch4Spare.isEmpty()) { - for (int index = 0; index < _likeSearch4Spare.size(); index++) { - _likeSearch.add(_likeSearch4Spare.get(index)); - } - } - LikeSearchValue likeSearchValue = new LikeSearchValue(value, option); - _likeSearch.add(likeSearchValue); - _likeSearch4Spare.add(likeSearchValue); - return this; - } - - /** Location of likeSearch. */ - protected String _likeSearchLocation; - - /** - * Get the location of likeSearch. - * - * @return The location of likeSearch. (Nullable) - */ - public String getLikeSearchLocation() { - return _likeSearchLocation; - } - - /** - * Set the location of likeSearch. - * - * @param location The location of likeSearch. (Nullable) - * @return this. (NotNull) - */ - public ConditionValue setLikeSearchLocation(String location) { - _likeSearchLocation = location; - return this; - } - - protected static class LikeSearchValue { - protected String _value; - - protected LikeSearchOption _option; - - public LikeSearchValue(String value, LikeSearchOption option) { - _value = value; - _option = option; - } - - public String getValue() { - return _value; - } - - public LikeSearchOption getOption() { - return _option; - } - - public String generateRealValue() { - if (_option == null) { - return _value; - } - return _option.generateRealValue(_value); - } - } - - //========================================================================== - // ========= // In Scope // ======== - /** Value of inScope. */ + /** The value of inScope. */ protected List _inScope; protected InScopeOption _inScopeOption; @@ -774,7 +674,7 @@ // ========= // Not In Scope // ============ - /** Value of notInScope. */ + /** The value of notInScope. */ protected List _notInScope; /** @@ -852,6 +752,207 @@ //========================================================================== // ========= + // Like Search + // =========== + /** The value of likeSearch. */ + protected List _likeSearch; + + /** The value of likeSearch for spare. */ + protected List _likeSearch4Spare; + + /** + * Get the value of likeSearch. + * + * @return The value of likeSearch. (Nullable) + */ + public String getLikeSearch() { + if (_likeSearch == null) { + return null; + } + if (_likeSearch.isEmpty() && !_likeSearch4Spare.isEmpty()) { + for (int index = 0; index < _likeSearch4Spare.size(); index++) { + _likeSearch.add(_likeSearch4Spare.get(index)); + } + } + final LikeSearchValue likeSearchValue = _likeSearch.remove(0); + return (String) filterValue(likeSearchValue.generateRealValue()); + } + + /** + * Set the value of likeSearch. + * + * @param value The value of likeSearch. (Nullable) + * @param option The option of likeSearch. (Nullable) + * @return this. (NotNull) + */ + public ConditionValue setLikeSearch(String value, LikeSearchOption option) { + if (_likeSearch == null) { + _likeSearch = new ArrayList(); + _likeSearch4Spare = new ArrayList(); + } + if (_likeSearch.isEmpty() && !_likeSearch4Spare.isEmpty()) { + for (int index = 0; index < _likeSearch4Spare.size(); index++) { + _likeSearch.add(_likeSearch4Spare.get(index)); + } + } + LikeSearchValue likeSearchValue = new LikeSearchValue(value, option); + _likeSearch.add(likeSearchValue); + _likeSearch4Spare.add(likeSearchValue); + return this; + } + + /** Location of likeSearch. */ + protected String _likeSearchLocation; + + /** + * Get the location of likeSearch. + * + * @return The location of likeSearch. (Nullable) + */ + public String getLikeSearchLocation() { + return _likeSearchLocation; + } + + /** + * Set the location of likeSearch. + * + * @param location The location of likeSearch. (Nullable) + * @return this. (NotNull) + */ + public ConditionValue setLikeSearchLocation(String location) { + _likeSearchLocation = location; + return this; + } + + protected static class LikeSearchValue { + protected String _value; + + protected LikeSearchOption _option; + + public LikeSearchValue(String value, LikeSearchOption option) { + _value = value; + _option = option; + } + + public String getValue() { + return _value; + } + + public LikeSearchOption getOption() { + return _option; + } + + public String generateRealValue() { + if (_option == null) { + return _value; + } + return _option.generateRealValue(_value); + } + } + + //========================================================================== + // ========= + // Not Like Search + // =============== + /** The value of notLikeSearch. */ + protected List _notLikeSearch; + + /** The value of notLikeSearch for spare. */ + protected List _notLikeSearch4Spare; + + /** + * Get the value of notLikeSearch. + * + * @return The value of notLikeSearch. (Nullable) + */ + public String getNotLikeSearch() { + if (_notLikeSearch == null) { + return null; + } + if (_notLikeSearch.isEmpty() && !_notLikeSearch4Spare.isEmpty()) { + for (int index = 0; index < _notLikeSearch4Spare.size(); index++) { + _notLikeSearch.add(_notLikeSearch4Spare.get(index)); + } + } + final NotLikeSearchValue notLikeSearchValue = _notLikeSearch.remove(0); + return (String) filterValue(notLikeSearchValue.generateRealValue()); + } + + /** + * Set the value of notLikeSearch. + * + * @param value The value of notLikeSearch. (Nullable) + * @param option The option of notLikeSearch. (Nullable) + * @return this. (NotNull) + */ + public ConditionValue setNotLikeSearch(String value, LikeSearchOption option) { + if (_notLikeSearch == null) { + _notLikeSearch = new ArrayList(); + _notLikeSearch4Spare = new ArrayList(); + } + if (_notLikeSearch.isEmpty() && !_notLikeSearch4Spare.isEmpty()) { + for (int index = 0; index < _notLikeSearch4Spare.size(); index++) { + _notLikeSearch.add(_notLikeSearch4Spare.get(index)); + } + } + NotLikeSearchValue notLikeSearchValue = new NotLikeSearchValue(value, + option); + _notLikeSearch.add(notLikeSearchValue); + _notLikeSearch4Spare.add(notLikeSearchValue); + return this; + } + + /** Location of notLikeSearch. */ + protected String _notLikeSearchLocation; + + /** + * Get the location of notLikeSearch. + * + * @return The location of notLikeSearch. (Nullable) + */ + public String getNotLikeSearchLocation() { + return _notLikeSearchLocation; + } + + /** + * Set the location of notLikeSearch. + * + * @param location The location of notLikeSearch. (Nullable) + * @return this. (NotNull) + */ + public ConditionValue setNotLikeSearchLocation(String location) { + _notLikeSearchLocation = location; + return this; + } + + protected static class NotLikeSearchValue { + protected String _value; + + protected LikeSearchOption _option; + + public NotLikeSearchValue(String value, LikeSearchOption option) { + _value = value; + _option = option; + } + + public String getValue() { + return _value; + } + + public LikeSearchOption getOption() { + return _option; + } + + public String generateRealValue() { + if (_option == null) { + return _value; + } + return _option.generateRealValue(_value); + } + } + + //========================================================================== + // ========= // Is Null // ======= /** Value of isNull. */ @@ -976,8 +1077,8 @@ * Filter value. If the value is instance of java.util.Date or * java.util.Calendar, returns value as java.sql.Date. * - * @param value Value. (Nullable) - * @return Filtered value. (Nullable) + * @param value The value. (Nullable) + * @return The filtered value. (Nullable) */ protected Object filterValue(Object value) { if (value == null) { @@ -991,18 +1092,18 @@ } if (value instanceof java.util.Date || value instanceof java.util.Calendar) { - return SqlDateConversionUtil.toDate(value); + return SimpleTypeUtil.toSqlDate(value); } else { return value; } } /** - * Filter value. If the value is instance of java.util.Date or + * Filter the list of value. If the value is instance of java.util.Date or * java.util.Calendar, returns value as java.sql.Date. * - * @param valueList Value-list. (Nullable) - * @return Filtered value-list. (Nullable) + * @param valueList The list of value. (Nullable) + * @return The filtered list of value. (Nullable) */ protected List filterValue(List valueList) { if (valueList == null || valueList.isEmpty()) { @@ -1015,204 +1116,4 @@ } return resultList; } - - protected static class SqlDateConversionUtil { - - private SqlDateConversionUtil() { - } - - public static java.sql.Date toDate(Object o) { - return toDate(o, null); - } - - public static java.sql.Date toDate(Object o, String pattern) { - if (o instanceof java.sql.Date) { - return (java.sql.Date) o; - } - java.util.Date date = DateConversionUtil.toDate(o, pattern); - if (date != null) { - return new java.sql.Date(date.getTime()); - } - return null; - } - } - - protected static class DateConversionUtil { - - private DateConversionUtil() { - } - - public static java.util.Date toDate(Object o) { - return toDate(o, null); - } - - public static java.util.Date toDate(Object o, String pattern) { - if (o == null) { - return null; - } else if (o instanceof String) { - return toDate((String) o, pattern); - } else if (o instanceof java.util.Date) { - return (java.util.Date) o; - } else if (o instanceof java.util.Calendar) { - return ((java.util.Calendar) o).getTime(); - } else { - return toDate(o.toString(), pattern); - } - } - - public static java.util.Date toDate(String s, String pattern) { - return toDate(s, pattern, java.util.Locale.getDefault()); - } - - public static java.util.Date toDate(String s, String pattern, - java.util.Locale locale) { - java.text.SimpleDateFormat sdf = getDateFormat(s, pattern, locale); - try { - return sdf.parse(s); - } catch (java.text.ParseException ex) { - throw new RuntimeException(ex); - } - } - - public static java.text.SimpleDateFormat getDateFormat(String s, - String pattern, java.util.Locale locale) { - if (pattern != null) { - return new java.text.SimpleDateFormat(pattern); - } - return getDateFormat(s, locale); - } - - public static java.text.SimpleDateFormat getDateFormat(String s, - java.util.Locale locale) { - String pattern = getPattern(locale); - String shortPattern = removeDelimiter(pattern); - String delimitor = findDelimiter(s); - if (delimitor == null) { - if (s.length() == shortPattern.length()) { - return new java.text.SimpleDateFormat(shortPattern); - } - if (s.length() == shortPattern.length() + 2) { - return new java.text.SimpleDateFormat(InternalStringUtil - .replace(shortPattern, "yy", "yyyy")); - } - } else { - String[] array = InternalStringUtil.split(s, delimitor); - for (int i = 0; i < array.length; ++i) { - if (array[i].length() == 4) { - pattern = InternalStringUtil.replace(pattern, "yy", - "yyyy"); - break; - } - } - return new java.text.SimpleDateFormat(pattern); - } - return new java.text.SimpleDateFormat(); - } - - public static java.text.SimpleDateFormat getDateFormat( - java.util.Locale locale) { - return new java.text.SimpleDateFormat(getPattern(locale)); - } - - public static java.text.SimpleDateFormat getY4DateFormat( - java.util.Locale locale) { - return new java.text.SimpleDateFormat(getY4Pattern(locale)); - } - - public static String getY4Pattern(java.util.Locale locale) { - String pattern = getPattern(locale); - if (pattern.indexOf("yyyy") < 0) { - pattern = InternalStringUtil.replace(pattern, "yy", "yyyy"); - } - return pattern; - } - - public static String getPattern(java.util.Locale locale) { - java.text.SimpleDateFormat df = (java.text.SimpleDateFormat) java.text.DateFormat - .getDateInstance(java.text.DateFormat.SHORT, locale); - String pattern = df.toPattern(); - int index = pattern.indexOf(' '); - if (index > 0) { - pattern = pattern.substring(0, index); - } - if (pattern.indexOf("MM") < 0) { - pattern = InternalStringUtil.replace(pattern, "M", "MM"); - } - if (pattern.indexOf("dd") < 0) { - pattern = InternalStringUtil.replace(pattern, "d", "dd"); - } - return pattern; - } - - public static String findDelimiter(String value) { - for (int i = 0; i < value.length(); ++i) { - char c = value.charAt(i); - if (Character.isDigit(c)) { - continue; - } - return Character.toString(c); - } - return null; - } - - public static String removeDelimiter(String pattern) { - StringBuffer buf = new StringBuffer(); - for (int i = 0; i < pattern.length(); ++i) { - char c = pattern.charAt(i); - if (c == 'y' || c == 'M' || c == 'd') { - buf.append(c); - } - } - return buf.toString(); - } - } - - protected static class InternalStringUtil { - public static final String[] EMPTY_STRINGS = new String[0]; - - private InternalStringUtil() { - } - - public static final boolean isEmpty(String text) { - return text == null || text.length() == 0; - } - - public static final String replace(String text, String fromText, - String toText) { - if (text == null || fromText == null || toText == null) { - return null; - } - StringBuffer buf = new StringBuffer(100); - int pos = 0; - int pos2 = 0; - while (true) { - pos = text.indexOf(fromText, pos2); - if (pos == 0) { - buf.append(toText); - pos2 = fromText.length(); - } else if (pos > 0) { - buf.append(text.substring(pos2, pos)); - buf.append(toText); - pos2 = pos + fromText.length(); - } else { - buf.append(text.substring(pos2)); - break; - } - } - return buf.toString(); - } - - public static String[] split(String str, String delim) { - if (str == null) { - return EMPTY_STRINGS; - } - List list = new java.util.ArrayList(); - java.util.StringTokenizer st = new java.util.StringTokenizer(str, - delim); - while (st.hasMoreElements()) { - list.add(st.nextToken()); - } - return (String[]) list.toArray(new String[list.size()]); - } - } } Modified: todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/cbean/outsidesql/OutsideSqlContext.java =================================================================== --- todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/cbean/outsidesql/OutsideSqlContext.java 2008-12-27 22:20:45 UTC (rev 1632) +++ todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/cbean/outsidesql/OutsideSqlContext.java 2008-12-27 22:21:53 UTC (rev 1633) @@ -1,17 +1,21 @@ package jp.sf.pal.todolist.db.allcommon.cbean.outsidesql; +import java.io.BufferedReader; +import java.io.IOException; +import java.io.InputStream; +import java.io.InputStreamReader; +import java.io.Reader; + import jp.sf.pal.todolist.db.allcommon.DBFluteConfig; import jp.sf.pal.todolist.db.allcommon.dbmeta.DBMeta; import jp.sf.pal.todolist.db.allcommon.dbmeta.DBMetaInstanceHandler; import jp.sf.pal.todolist.db.allcommon.jdbc.StatementConfig; +import jp.sf.pal.todolist.db.allcommon.util.SimpleResourceUtil; import jp.sf.pal.todolist.db.allcommon.util.SimpleStringUtil; import jp.sf.pal.todolist.db.allcommon.util.SimpleSystemUtil; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; -import org.seasar.framework.util.InputStreamReaderUtil; -import org.seasar.framework.util.ReaderUtil; -import org.seasar.framework.util.ResourceUtil; /** * The context of outside-SQL. @@ -33,7 +37,7 @@ /** * Get outside-SQL context on thread. * - * @return Outside-SQL context. (Nullable) + * @return The context of outside-SQL. (Nullable) */ public static OutsideSqlContext getOutsideSqlContextOnThread() { return (OutsideSqlContext) _threadLocal.get(); @@ -42,7 +46,7 @@ /** * Set outside-SQL context on thread. * - * @param outsideSqlContext Outside-SQL context. (NotNull) + * @param outsideSqlContext The context of outside-SQL. (NotNull) */ public static void setOutsideSqlContextOnThread( OutsideSqlContext outsideSqlContext) { @@ -54,7 +58,7 @@ } /** - * Is existing outside-SQL context on thread? + * Is existing the context of outside-SQL on thread? * * @return Determination. */ @@ -63,7 +67,7 @@ } /** - * Clear outside-SQL context on thread. + * Clear the context of outside-SQL on thread. */ public static void clearOutsideSqlContextOnThread() { _threadLocal.set(null); @@ -77,12 +81,20 @@ String methodName, String path, Object pmb, OutsideSqlOption option, Object resultTypeSpecification) { final String pmbKey = (pmb != null ? pmb.getClass().getName() : "null"); - final String resultKey = (resultTypeSpecification != null ? ":" - + resultTypeSpecification : "null"); + final String resultKey; + if (resultTypeSpecification != null) { + if (resultTypeSpecification instanceof Class) { + resultKey = ((Class) resultTypeSpecification).getName(); + } else { + resultKey = resultTypeSpecification.toString(); + } + } else { + resultKey = "null"; + } final String tableDbName = option.getTableDbName(); final String generatedUniqueKey = option.generateUniqueKey(); - return methodName + "():" + tableDbName + ":" + path + ":" + pmbKey - + ":" + generatedUniqueKey + resultKey; + return tableDbName + ":" + methodName + "():" + path + ":" + pmbKey + + ":" + generatedUniqueKey + ":" + resultKey; } //========================================================================== @@ -116,18 +128,9 @@ // Attribute // ========= // ----------------------------------------------------- - // Common of OutsideSql - // -------------------- - protected boolean _dynamicBinding; - - protected boolean _offsetByCursorForcedly; - - protected boolean _limitByCursorForcedly; - - // ----------------------------------------------------- - // Specified OutsideSql - // -------------------- - /** The path of outside-sql. (The mark of Specified-OutsideSql) */ + // Basic + // ----- + /** The path of outside-SQL. (The mark of specified outside-SQL) */ protected String _outsideSqlPath; protected Object _parameterBean; @@ -136,12 +139,23 @@ protected String _methodName; - /** The config of statement. (Nullable) */ + /** The configuration of statement. (Nullable) */ protected StatementConfig _statementConfig; /** The DB name of table for using behavior-SQL-path. (Nullable) */ protected String _tableDbName; + // ----------------------------------------------------- + // Option + // ------ + protected boolean _dynamicBinding; + + protected boolean _offsetByCursorForcedly; + + protected boolean _limitByCursorForcedly; + + protected boolean _autoPagingLogging; // for logging + //========================================================================== // ========= // Read SQL @@ -200,7 +214,7 @@ } /** - * Read outside-sql path. Required attribute is 'outsideSqlPath'. + * Read outside-SQL path. Required attribute is 'outsideSqlPath'. * * @param sqlFileEncoding The encoding of SQL file. (NotNull) * @param dbmsSuffix The suffix of DBMS. (NotNull) @@ -214,6 +228,13 @@ String sql; if (isExistResource(dbmsPath)) { sql = readText(dbmsPath, sqlFileEncoding); + } else if ("_postgresql".equals(dbmsSuffix) + && isExistResource("_postgre")) { + sql = readText("_postgre", sqlFileEncoding); // Patch for name + // difference + } else if ("_sqlserver".equals(dbmsSuffix) && isExistResource("_mssql")) { + sql = readText("_mssql", sqlFileEncoding); // Patch for name + // difference } else if (isExistResource(standardPath)) { sql = readText(standardPath, sqlFileEncoding); } else { @@ -324,16 +345,46 @@ // General Helper // ============== protected boolean isExistResource(String path) { - return ResourceUtil.isExist(path); + return SimpleResourceUtil.isExist(path); } protected String readText(final String path, String sqlFileEncoding) { - final java.io.InputStream is = ResourceUtil.getResourceAsStream(path); - final java.io.Reader reader = InputStreamReaderUtil.create(is, - sqlFileEncoding); - return ReaderUtil.readText(reader); + final InputStream ins = SimpleResourceUtil.getResourceStream(path); + final Reader reader = createInputStreamReader(ins, sqlFileEncoding); + return readText(reader); } + protected Reader createInputStreamReader(InputStream ins, String encoding) { + try { + return new InputStreamReader(ins, encoding); + } catch (IOException e) { + String msg = "Failed to create the reader of the input stream:"; + msg = msg + " ins=" + ins + " encoding=" + encoding; + throw new IllegalStateException(msg, e); + } + } + + public String readText(Reader reader) { + final BufferedReader bfreader = new BufferedReader(reader); + final StringBuilder out = new StringBuilder(100); + try { + try { + final char[] buf = new char[8192]; + int n; + while ((n = bfreader.read(buf)) >= 0) { + out.append(buf, 0, n); + } + } finally { + bfreader.close(); + } + } catch (IOException e) { + String msg = "Failed to read the input stream:"; + msg = msg + " bfreader=" + bfreader + " reader=" + reader; + throw new IllegalStateException(msg, e); + } + return out.toString(); + } + protected static String replaceString(String text, String fromText, String toText) { return SimpleStringUtil.replace(text, fromText, toText); @@ -348,35 +399,8 @@ // Accessor // ======== // ----------------------------------------------------- - // Common of OutsideSql - // -------------------- - public boolean isDynamicBinding() { - return _dynamicBinding; - } - - public void setDynamicBinding(boolean dynamicBinding) { - this._dynamicBinding = dynamicBinding; - } - - public boolean isOffsetByCursorForcedly() { - return _offsetByCursorForcedly; - } - - public void setOffsetByCursorForcedly(boolean offsetByCursorForcedly) { - this._offsetByCursorForcedly = offsetByCursorForcedly; - } - - public boolean isLimitByCursorForcedly() { - return _limitByCursorForcedly; - } - - public void setLimitByCursorForcedly(boolean limitByCursorForcedly) { - this._limitByCursorForcedly = limitByCursorForcedly; - } - - // ----------------------------------------------------- - // Specified OutsideSql - // -------------------- + // Basic + // ----- public String getOutsideSqlPath() { return _outsideSqlPath; } @@ -424,4 +448,39 @@ public void setTableDbName(String tableDbName) { this._tableDbName = tableDbName; } + + // ----------------------------------------------------- + // Option + // ------ + public boolean isDynamicBinding() { + return _dynamicBinding; + } + + public void setDynamicBinding(boolean dynamicBinding) { + this._dynamicBinding = dynamicBinding; + } + + public boolean isOffsetByCursorForcedly() { + return _offsetByCursorForcedly; + } + + public void setOffsetByCursorForcedly(boolean offsetByCursorForcedly) { + this._offsetByCursorForcedly = offsetByCursorForcedly; + } + + public boolean isLimitByCursorForcedly() { + return _limitByCursorForcedly; + } + + public void setLimitByCursorForcedly(boolean limitByCursorForcedly) { + this._limitByCursorForcedly = limitByCursorForcedly; + } + + public boolean isAutoPagingLogging() { // for logging + return _autoPagingLogging; + } + + public void setAutoPagingLogging(boolean autoPagingLogging) { // for logging + this._autoPagingLogging = autoPagingLogging; + } } Modified: todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/cbean/outsidesql/OutsideSqlOption.java =================================================================== --- todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/cbean/outsidesql/OutsideSqlOption.java 2008-12-27 22:20:45 UTC (rev 1632) +++ todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/cbean/outsidesql/OutsideSqlOption.java 2008-12-27 22:21:53 UTC (rev 1633) @@ -16,6 +16,7 @@ // ----------------------------------------------------- // Option // ------ + /** The request type of paging. */ protected String _pagingRequestType = "non"; protected boolean _dynamicBinding; @@ -23,6 +24,8 @@ /** The configuration of statement. (Nullable) */ protected StatementConfig _statementConfig; + protected String _sourcePagingRequestType = "non"; + // ----------------------------------------------------- // Information // ----------- @@ -59,6 +62,7 @@ // ==== public OutsideSqlOption copyOptionWithoutPaging() { final OutsideSqlOption copyOption = new OutsideSqlOption(); + copyOption.setPagingSourceRequestType(_pagingRequestType); if (isDynamicBinding()) { copyOption.dynamicBinding(); } @@ -103,6 +107,15 @@ _statementConfig = statementConfig; } + protected void setPagingSourceRequestType(String sourcePagingRequestType) { // Very + // Internal + _sourcePagingRequestType = sourcePagingRequestType; + } + + public boolean isSourcePagingRequestTypeAuto() { // Very Internal + return "auto".equals(_sourcePagingRequestType); + } + // ----------------------------------------------------- // Information // ----------- Modified: todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/cbean/outsidesql/executor/OutsideSqlBasicExecutor.java =================================================================== --- todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/cbean/outsidesql/executor/OutsideSqlBasicExecutor.java 2008-12-27 22:20:45 UTC (rev 1632) +++ todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/cbean/outsidesql/executor/OutsideSqlBasicExecutor.java 2008-12-27 22:21:53 UTC (rev 1633) @@ -2,15 +2,20 @@ import java.util.List; +import jp.sf.pal.todolist.db.allcommon.bhv.core.BehaviorCommand; +import jp.sf.pal.todolist.db.allcommon.bhv.core.BehaviorCommandInvoker; +import jp.sf.pal.todolist.db.allcommon.bhv.core.command.AbstractOutsideSqlCommand; +import jp.sf.pal.todolist.db.allcommon.bhv.core.command.OutsideSqlCallCommand; +import jp.sf.pal.todolist.db.allcommon.bhv.core.command.OutsideSqlExecuteCommand; +import jp.sf.pal.todolist.db.allcommon.bhv.core.command.OutsideSqlSelectListCommand; import jp.sf.pal.todolist.db.allcommon.cbean.ListResultBean; import jp.sf.pal.todolist.db.allcommon.cbean.ResultBeanBuilder; -import jp.sf.pal.todolist.db.allcommon.cbean.outsidesql.OutsideSqlDao; import jp.sf.pal.todolist.db.allcommon.cbean.outsidesql.OutsideSqlOption; import jp.sf.pal.todolist.db.allcommon.cbean.outsidesql.ProcedurePmb; import jp.sf.pal.todolist.db.allcommon.jdbc.StatementConfig; /** - * The executor of outside-sql.
+ * The executor of outside-SQL.
* *
  * {Basic}
@@ -33,7 +38,6 @@
  * 
  * {Option -- Dynamic}
  *   o dynamicBinding().selectList()
- * 
  * 
* * @author DBFlute(AutoGenerator) @@ -44,8 +48,8 @@ // ========= // Attribute // ========= - /** The DAO of outside-sql. (NotNull) */ - protected final OutsideSqlDao _outsideSqlDao; + /** The invoker of behavior command. (NotNull) */ + protected final BehaviorCommandInvoker _behaviorCommandInvoker; /** Table DB name. (NotNull) */ protected final String _tableDbName; @@ -60,9 +64,9 @@ // ========= // Constructor // =========== - public OutsideSqlBasicExecutor(OutsideSqlDao outsideSqlDao, - String tableDbName) { - this._outsideSqlDao = outsideSqlDao; + public OutsideSqlBasicExecutor( + BehaviorCommandInvoker behaviorCommandInvoker, String tableDbName) { + this._behaviorCommandInvoker = behaviorCommandInvoker; this._tableDbName = tableDbName; } @@ -80,12 +84,12 @@ * @param entityType The element type of entity. (NotNull) * @return The result bean of selected list. (NotNull) * @exception jp.sf.pal.todolist.db.allcommon.exception.OutsideSqlNotFoundException - * When the outside-sql is not found. + * When the outside-SQL is not found. */ public ListResultBean selectList(String path, Object pmb, Class entityType) { - List resultList = _outsideSqlDao.selectList(path, pmb, - createOutsideSqlOption(), entityType); + List resultList = invoke(createSelectListCommand(path, pmb, + entityType)); return new ResultBeanBuilder(_tableDbName) .buildListResultBean(resultList); } @@ -102,10 +106,10 @@ * object. (Nullable) * @return The count of execution. * @exception jp.sf.pal.todolist.db.allcommon.exception.OutsideSqlNotFoundException - * When the outside-sql is not found. + * When the outside-SQL is not found. */ public int execute(String path, Object pmb) { - return _outsideSqlDao.execute(path, pmb, createOutsideSqlOption()); + return invoke(createExecuteCommand(path, pmb)); } // [DBFlute-0.7.5] @@ -123,12 +127,53 @@ throw new IllegalArgumentException( "The argument of call() 'pmb' should not be null!"); } - _outsideSqlDao.call(pmb.getProcedureName(), pmb, - createOutsideSqlOption()); + invoke(createCallCommand(pmb.getProcedureName(), pmb)); } //========================================================================== // ========= + // Behavior Command + // ================ + protected BehaviorCommand> createSelectListCommand( + String path, Object pmb, Class entityType) { + final OutsideSqlSelectListCommand cmd = xsetupCommand( + new OutsideSqlSelectListCommand(), path, pmb); + cmd.setEntityType(entityType); + return cmd; + } + + protected BehaviorCommand createExecuteCommand(String path, + Object pmb) { + return xsetupCommand(new OutsideSqlExecuteCommand(), path, pmb); + } + + protected BehaviorCommand createCallCommand(String path, Object pmb) { + return xsetupCommand(new OutsideSqlCallCommand(), path, pmb); + } + + private > COMMAND xsetupCommand( + COMMAND command, String path, Object pmb) { + command.setTableDbName(_tableDbName); + _behaviorCommandInvoker.injectComponentProperty(command); + command.setOutsideSqlPath(path); + command.setParameterBean(pmb); + command.setOutsideSqlOption(createOutsideSqlOption()); + return command; + } + + /** + * Invoke the command of behavior. + * + * @param The type of result. + * @param behaviorCommand The command of behavior. (NotNull) + * @return The instance of result. (Nullable) + */ + protected RESULT invoke(BehaviorCommand behaviorCommand) { + return _behaviorCommandInvoker.invoke(behaviorCommand); + } + + //========================================================================== + // ========= // Option // ====== // ----------------------------------------------------- @@ -144,11 +189,11 @@ * # * * - * @return The cursor executor of outside-sql. (NotNull) + * @return The cursor executor of outside-SQL. (NotNull) */ public OutsideSqlCursorExecutor cursorHandling() { - return new OutsideSqlCursorExecutor(_outsideSqlDao, - createOutsideSqlOption()); + return new OutsideSqlCursorExecutor(_behaviorCommandInvoker, + createOutsideSqlOption(), _tableDbName); } /** @@ -161,11 +206,11 @@ * # * * - * @return The cursor executor of outside-sql. (NotNull) + * @return The cursor executor of outside-SQL. (NotNull) */ public OutsideSqlEntityExecutor entityHandling() { - return new OutsideSqlEntityExecutor(_outsideSqlDao, - createOutsideSqlOption()); + return new OutsideSqlEntityExecutor(_behaviorCommandInvoker, + createOutsideSqlOption(), _tableDbName); } // ----------------------------------------------------- @@ -191,7 +236,7 @@ public OutsideSqlPagingExecutor autoPaging() { final OutsideSqlOption option = createOutsideSqlOption(); option.autoPaging(); - return new OutsideSqlPagingExecutor(_outsideSqlDao, option, + return new OutsideSqlPagingExecutor(_behaviorCommandInvoker, option, _tableDbName); } @@ -215,7 +260,7 @@ public OutsideSqlPagingExecutor manualPaging() { final OutsideSqlOption option = createOutsideSqlOption(); option.manualPaging(); - return new OutsideSqlPagingExecutor(_outsideSqlDao, option, + return new OutsideSqlPagingExecutor(_behaviorCommandInvoker, option, _tableDbName); } Modified: todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/cbean/outsidesql/executor/OutsideSqlCursorExecutor.java =================================================================== --- todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/cbean/outsidesql/executor/OutsideSqlCursorExecutor.java 2008-12-27 22:20:45 UTC (rev 1632) +++ todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/cbean/outsidesql/executor/OutsideSqlCursorExecutor.java 2008-12-27 22:21:53 UTC (rev 1633) @@ -1,12 +1,14 @@ package jp.sf.pal.todolist.db.allcommon.cbean.outsidesql.executor; -import jp.sf.pal.todolist.db.allcommon.cbean.outsidesql.OutsideSqlDao; +import jp.sf.pal.todolist.db.allcommon.bhv.core.BehaviorCommand; +import jp.sf.pal.todolist.db.allcommon.bhv.core.BehaviorCommandInvoker; +import jp.sf.pal.todolist.db.allcommon.bhv.core.command.OutsideSqlSelectCursorCommand; import jp.sf.pal.todolist.db.allcommon.cbean.outsidesql.OutsideSqlOption; import jp.sf.pal.todolist.db.allcommon.jdbc.CursorHandler; import jp.sf.pal.todolist.db.allcommon.jdbc.StatementConfig; /** - * The cursor executor of outside-sql. + * The cursor executor of outside-SQL. * * @param The type of parameter-bean. * @author DBFlute(AutoGenerator) @@ -17,18 +19,25 @@ // ========= // Attribute // ========= - protected final OutsideSqlDao _outsideSqlDao; + /** The invoker of behavior command. (NotNull) */ + protected final BehaviorCommandInvoker _behaviorCommandInvoker; + /** The option of outside-SQL. (NotNull) */ protected final OutsideSqlOption _outsideSqlOption; + /** The DB name of table. (NotNull) */ + protected final String _tableDbName; + //========================================================================== // ========= // Constructor // =========== - public OutsideSqlCursorExecutor(OutsideSqlDao outsideSqlDao, - OutsideSqlOption outsideSqlOption) { - this._outsideSqlDao = outsideSqlDao; + public OutsideSqlCursorExecutor( + BehaviorCommandInvoker behaviorCommandInvoker, + OutsideSqlOption outsideSqlOption, String tableDbName) { + this._behaviorCommandInvoker = behaviorCommandInvoker; this._outsideSqlOption = outsideSqlOption; + this._tableDbName = tableDbName; } //========================================================================== @@ -44,14 +53,46 @@ * @param handler The handler of cursor. (NotNull) * @return The result object that the cursor handler returns. (Nullable) * @exception jp.sf.pal.todolist.db.allcommon.exception.OutsideSqlNotFoundException - * When the outside-sql is not found. + * When the outside-SQL is not found. */ public Object selectCursor(String path, PARAMETER_BEAN pmb, CursorHandler handler) { - return _outsideSqlDao.selectCursor(path, pmb, _outsideSqlOption, + return invoke(createSelectCursorCommand(path, pmb, handler)); + } + + //========================================================================== + // ========= + // Behavior Command + // ================ + protected BehaviorCommand createSelectCursorCommand(String path, + PARAMETER_BEAN pmb, CursorHandler handler) { + return xsetupCommand(new OutsideSqlSelectCursorCommand(), path, pmb, handler); } + private OutsideSqlSelectCursorCommand xsetupCommand( + OutsideSqlSelectCursorCommand command, String path, + PARAMETER_BEAN pmb, CursorHandler handler) { + command.setTableDbName(_tableDbName); + _behaviorCommandInvoker.injectComponentProperty(command); + command.setOutsideSqlPath(path); + command.setParameterBean(pmb); + command.setOutsideSqlOption(_outsideSqlOption); + command.setCursorHandler(handler); + return command; + } + + /** + * Invoke the command of behavior. + * + * @param The type of result. + * @param behaviorCommand The command of behavior. (NotNull) + * @return The instance of result. (Nullable) + */ + protected RESULT invoke(BehaviorCommand behaviorCommand) { + return _behaviorCommandInvoker.invoke(behaviorCommand); + } + //========================================================================== // ========= // Option Modified: todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/cbean/outsidesql/executor/OutsideSqlEntityExecutor.java =================================================================== --- todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/cbean/outsidesql/executor/OutsideSqlEntityExecutor.java 2008-12-27 22:20:45 UTC (rev 1632) +++ todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/cbean/outsidesql/executor/OutsideSqlEntityExecutor.java 2008-12-27 22:21:53 UTC (rev 1633) @@ -2,14 +2,16 @@ import java.util.List; +import jp.sf.pal.todolist.db.allcommon.bhv.core.BehaviorCommand; +import jp.sf.pal.todolist.db.allcommon.bhv.core.BehaviorCommandInvoker; +import jp.sf.pal.todolist.db.allcommon.bhv.core.command.OutsideSqlSelectListCommand; import jp.sf.pal.todolist.db.allcommon.cbean.ConditionBeanContext; -import jp.sf.pal.todolist.db.allcommon.cbean.outsidesql.OutsideSqlDao; import jp.sf.pal.todolist.db.allcommon.cbean.outsidesql.OutsideSqlOption; import jp.sf.pal.todolist.db.allcommon.jdbc.StatementConfig; import jp.sf.pal.todolist.db.allcommon.util.SimpleSystemUtil; /** - * The cursor executor of outside-sql. + * The cursor executor of outside-SQL. * * @param The type of parameter-bean. * @author DBFlute(AutoGenerator) @@ -20,18 +22,25 @@ // ========= // Attribute // ========= - protected final OutsideSqlDao _outsideSqlDao; + /** The invoker of behavior command. (NotNull) */ + protected final BehaviorCommandInvoker _behaviorCommandInvoker; + /** The option of outside-SQL. (NotNull) */ protected final OutsideSqlOption _outsideSqlOption; + /** The DB name of table. (NotNull) */ + protected final String _tableDbName; + //========================================================================== // ========= // Constructor // =========== - public OutsideSqlEntityExecutor(OutsideSqlDao outsideSqlDao, - OutsideSqlOption outsideSqlOption) { - this._outsideSqlDao = outsideSqlDao; + public OutsideSqlEntityExecutor( + BehaviorCommandInvoker behaviorCommandInvoker, + OutsideSqlOption outsideSqlOption, String tableDbName) { + this._behaviorCommandInvoker = behaviorCommandInvoker; this._outsideSqlOption = outsideSqlOption; + this._tableDbName = tableDbName; } //========================================================================== @@ -48,14 +57,14 @@ * @param entityType The type of entity. (NotNull) * @return The selected entity. (Nullable) * @exception jp.sf.pal.todolist.db.allcommon.exception.OutsideSqlNotFoundException - * When the outside-sql is not found. + * When the outside-SQL is not found. * @exception jp.sf.pal.todolist.db.allcommon.exception.EntityDuplicatedException * When the entity is duplicated. */ public ENTITY selectEntity(String path, PARAMETER_BEAN pmb, Class entityType) { - final List ls = _outsideSqlDao.selectList(path, pmb, - _outsideSqlOption, entityType); + final List ls = invoke(createSelectListCommand(path, pmb, + entityType)); if (ls.isEmpty()) { return null; } @@ -76,7 +85,7 @@ * @param entityType The type of entity. (NotNull) * @return The selected entity. (Nullable) * @exception jp.sf.pal.todolist.db.allcommon.exception.OutsideSqlNotFoundException - * When the outside-sql is not found. + * When the outside-SQL is not found. * @exception jp.sf.pal.todolist.db.allcommon.exception.EntityAlreadyDeletedException * When the entity has already been deleted(not found). * @exception jp.sf.pal.todolist.db.allcommon.exception.EntityDuplicatedException @@ -84,8 +93,8 @@ */ public ENTITY selectEntityWithDeletedCheck(String path, PARAMETER_BEAN pmb, Class entityType) { - final List ls = _outsideSqlDao.selectList(path, pmb, - _outsideSqlOption, entityType); + final List ls = invoke(createSelectListCommand(path, pmb, + entityType)); if (ls == null || ls.isEmpty()) { throwEntityAlreadyDeletedException(buildSearch4LogString(path, pmb, entityType)); @@ -127,6 +136,39 @@ //========================================================================== // ========= + // Behavior Command + // ================ + protected BehaviorCommand> createSelectListCommand( + String path, PARAMETER_BEAN pmb, Class entityType) { + return xsetupCommand(new OutsideSqlSelectListCommand(), path, + pmb, entityType); + } + + private OutsideSqlSelectListCommand xsetupCommand( + OutsideSqlSelectListCommand command, String path, + PARAMETER_BEAN pmb, Class entityType) { + command.setTableDbName(_tableDbName); + _behaviorCommandInvoker.injectComponentProperty(command); + command.setOutsideSqlPath(path); + command.setParameterBean(pmb); + command.setOutsideSqlOption(_outsideSqlOption); + command.setEntityType(entityType); + return command; + } + + /** + * Invoke the command of behavior. + * + * @param The type of result. + * @param behaviorCommand The command of behavior. (NotNull) + * @return The instance of result. (Nullable) + */ + protected RESULT invoke(BehaviorCommand behaviorCommand) { + return _behaviorCommandInvoker.invoke(behaviorCommand); + } + + //========================================================================== + // ========= // Option // ====== public OutsideSqlEntityExecutor configure( Modified: todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/cbean/outsidesql/executor/OutsideSqlPagingExecutor.java =================================================================== --- todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/cbean/outsidesql/executor/OutsideSqlPagingExecutor.java 2008-12-27 22:20:45 UTC (rev 1632) +++ todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/cbean/outsidesql/executor/OutsideSqlPagingExecutor.java 2008-12-27 22:21:53 UTC (rev 1633) @@ -3,18 +3,20 @@ import java.util.List; import jp.sf.pal.todolist.db.allcommon.DBFluteConfig; +import jp.sf.pal.todolist.db.allcommon.bhv.core.BehaviorCommand; +import jp.sf.pal.todolist.db.allcommon.bhv.core.BehaviorCommandInvoker; +import jp.sf.pal.todolist.db.allcommon.bhv.core.command.OutsideSqlSelectListCommand; import jp.sf.pal.todolist.db.allcommon.cbean.ListResultBean; import jp.sf.pal.todolist.db.allcommon.cbean.PagingBean; import jp.sf.pal.todolist.db.allcommon.cbean.PagingHandler; import jp.sf.pal.todolist.db.allcommon.cbean.PagingInvoker; import jp.sf.pal.todolist.db.allcommon.cbean.PagingResultBean; import jp.sf.pal.todolist.db.allcommon.cbean.ResultBeanBuilder; -import jp.sf.pal.todolist.db.allcommon.cbean.outsidesql.OutsideSqlDao; import jp.sf.pal.todolist.db.allcommon.cbean.outsidesql.OutsideSqlOption; import jp.sf.pal.todolist.db.allcommon.jdbc.StatementConfig; /** - * The paging executor of outsideSql. + * The paging executor of outside-SQL. * * @author DBFlute(AutoGenerator) */ @@ -24,10 +26,10 @@ // ========= // Attribute // ========= - /** The DAO of outsideSql. (NotNull) */ - protected final OutsideSqlDao _outsideSqlDao; + /** The invoker of behavior command. (NotNull) */ + protected final BehaviorCommandInvoker _behaviorCommandInvoker; - /** The option of outsideSql. (NotNull) */ + /** The option of outside-SQL. (NotNull) */ protected final OutsideSqlOption _outsideSqlOption; /** The DB name of table. (NotNull) */ @@ -37,9 +39,10 @@ // ========= // Constructor // =========== - public OutsideSqlPagingExecutor(OutsideSqlDao outsideSqlDao, + public OutsideSqlPagingExecutor( + BehaviorCommandInvoker behaviorCommandInvoker, OutsideSqlOption outsideSqlOption, String tableDbName) { - this._outsideSqlDao = outsideSqlDao; + this._behaviorCommandInvoker = behaviorCommandInvoker; this._outsideSqlOption = outsideSqlOption; this._tableDbName = tableDbName; } @@ -81,13 +84,13 @@ * @param entityType The type of result entity. (NotNull) * @return The result bean of paged list. (NotNull) * @exception com.example.dbflute.basic.dbflute.allcommon.exception.OutsideSqlNotFoundException - * When the outside-sql is not found. + * When the outside-SQL is not found. */ public ListResultBean selectList(String path, PagingBean pmb, Class entityType) { setupScrollableCursorIfNeeds(); - List resultList = _outsideSqlDao.selectList(path, pmb, - _outsideSqlOption, entityType); + List resultList = invoke(createSelectListCommand(path, pmb, + entityType)); return new ResultBeanBuilder(_tableDbName) .buildListResultBean(resultList); } @@ -141,7 +144,7 @@ * # -- ELSE select count(*) * # /[*]END[*]/ * # ... - * o It's S2Dao's restriction...Sorry + * o It's restriction...Sorry * * * @param The type of entity. @@ -150,14 +153,11 @@ * @param entityType The type of result entity. (NotNull) * @return The result bean of paging. (NotNull) * @exception jp.sf.pal.todolist.db.allcommon.exception.OutsideSqlNotFoundException - * When the outside-sql is not found. + * When the outside-SQL is not found. */ public PagingResultBean selectPage(final String path, final PagingBean pmb, final Class entityType) { - final OutsideSqlOption countOption = _outsideSqlOption - .copyOptionWithoutPaging(); - final OutsideSqlEntityExecutor countExecutor = new OutsideSqlEntityExecutor( - _outsideSqlDao, countOption); + final OutsideSqlEntityExecutor countExecutor = createCountExecutor(); final PagingHandler handler = new PagingHandler() { public PagingBean getPagingBean() { return pmb; @@ -182,6 +182,13 @@ return invoker.invokePaging(handler); } + protected OutsideSqlEntityExecutor createCountExecutor() { + final OutsideSqlOption countOption = _outsideSqlOption + .copyOptionWithoutPaging(); + return new OutsideSqlEntityExecutor( + _behaviorCommandInvoker, countOption, _tableDbName); + } + protected void setupScrollableCursorIfNeeds() { if (!_outsideSqlOption.isAutoPaging()) { return; @@ -207,6 +214,39 @@ //========================================================================== // ========= + // Behavior Command + // ================ + protected BehaviorCommand> createSelectListCommand( + String path, Object pmb, Class entityType) { + return xsetupCommand(new OutsideSqlSelectListCommand(), path, + pmb, entityType); + } + + private OutsideSqlSelectListCommand xsetupCommand( + OutsideSqlSelectListCommand command, String path, + Object pmb, Class entityType) { + command.setTableDbName(_tableDbName); + _behaviorCommandInvoker.injectComponentProperty(command); + command.setOutsideSqlPath(path); + command.setParameterBean(pmb); + command.setOutsideSqlOption(_outsideSqlOption); + command.setEntityType(entityType); + return command; + } + + /** + * Invoke the command of behavior. + * + * @param The type of result. + * @param behaviorCommand The command of behavior. (NotNull) + * @return The instance of result. (Nullable) + */ + protected RESULT invoke(BehaviorCommand behaviorCommand) { + return _behaviorCommandInvoker.invoke(behaviorCommand); + } + + //========================================================================== + // ========= // Option // ====== public OutsideSqlPagingExecutor configure(StatementConfig statementConfig) { Modified: todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/cbean/sqlclause/AbstractSqlClause.java =================================================================== --- todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/cbean/sqlclause/AbstractSqlClause.java 2008-12-27 22:20:45 UTC (rev 1632) +++ todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/cbean/sqlclause/AbstractSqlClause.java 2008-12-27 22:21:53 UTC (rev 1633) @@ -17,23 +17,23 @@ import jp.sf.pal.todolist.db.allcommon.dbmeta.DBMetaInstanceHandler; import jp.sf.pal.todolist.db.allcommon.dbmeta.info.ColumnInfo; import jp.sf.pal.todolist.db.allcommon.dbmeta.info.ForeignInfo; -import jp.sf.pal.todolist.db.allcommon.dbmeta.info.UniqueInfo; import jp.sf.pal.todolist.db.allcommon.util.SimpleAssertUtil; import jp.sf.pal.todolist.db.allcommon.util.SimpleStringUtil; import jp.sf.pal.todolist.db.allcommon.util.SimpleSystemUtil; /** - * The abstract class of SqlClause. + * The abstract class of SQL clause. * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public abstract class AbstractSqlClause implements SqlClause { //========================================================================== // ========= // Definition // ========== + protected static final SelectClauseType DEFAULT_SELECT_CLAUSE_TYPE = SelectClauseType.COLUMNS; + protected static final String SELECT_HINT = "/*$dto.selectHint*/"; //========================================================================== @@ -43,12 +43,16 @@ // ----------------------------------------------------- // Basic // ----- - /** Target table name. */ + /** The name of table. */ protected final String _tableName; // ----------------------------------------------------- // Clause Resource // --------------- + // /- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + // - + // The resources that are not often used to are lazy-loaded for performance. + // - - - - - - - - - -/ /** * Selected select column map. map:{tableAliasName : map:{columnName : * selectColumnInfo}} @@ -57,48 +61,48 @@ /** * Specified select column map. map:{ tableAliasName = map:{ columnName : - * null } } + * null } } (Nullable: This is lazy-loaded) */ - protected Map> _specifiedSelectColumnMap;// [ + protected Map> _specifiedSelectColumnMap; // [ // DBFlute // - - // 0.7.4 - // ] + // 0.7 + // .4] - /** Specified derive sub-query map. */ - protected Map _specifiedDeriveSubQueryMap;// [DBFlute-0.7.4] + /** Specified derive sub-query map. (Nullable: This is lazy-loaded) */ + protected Map _specifiedDeriveSubQueryMap; //[DBFlute-0.7.4] - /** Included select column map. */ - protected Map _includedSelectColumnMap = new LinkedHashMap(); - /** * The map of real column and alias of select clause. map:{realColumnName : * aliasName} */ - protected Map _selectClauseRealColumnAliasMap = new HashMap();// Without + protected Map _selectClauseRealColumnAliasMap = new HashMap(); // Without // linked // ! + /** The type of select clause. (NotNull) */ + protected SelectClauseType _selectClauseType = DEFAULT_SELECT_CLAUSE_TYPE; + + /** The previous type of select clause. (Nullable: The default is null) */ + protected SelectClauseType _previousSelectClauseType; + /** Outer join map. */ protected Map _outerJoinMap = new LinkedHashMap(); - /** Where list. */ + /** The list of where clause. */ protected List _whereList = new ArrayList(); /** Inline where list for BaseTable. */ protected List _baseTableInlineWhereList = new ArrayList(); - /** Order-by clause. */ + /** The clause of order-by. (NotNull) */ protected final OrderByClause _orderByClause = new OrderByClause(); - /** Union clause list. */ - protected List _unionQueryInfoList = new ArrayList(); + /** The list of union clause. (Nullable: This is lazy-loaded) */ + protected List _unionQueryInfoList; - /** Is included-select-column effective? Default value is false. */ - protected boolean _isIncludedSelectColumnEffective = false; - /** Is order-by effective? Default value is false. */ protected boolean _isOrderByEffective = false; @@ -138,7 +142,7 @@ // ----------------------------------------------------- // Optional Info // ------------- - protected boolean _formatClause; + protected boolean _formatClause = true; //========================================================================== // ========= @@ -163,28 +167,20 @@ StringBuilder sb = new StringBuilder(512); sb.append(getSelectClause()); sb.append(" "); - sb.append(buildClauseWithoutMainSelect(false)); + sb.append(buildClauseWithoutMainSelect()); String sql = sb.toString(); - return filterSubQueryIndent(sql); + sql = filterUnionCountOrScalar(sql); + sql = filterSubQueryIndent(sql); + return sql; } - public String getClausePKOnly() { + protected String buildClauseWithoutMainSelect() { StringBuilder sb = new StringBuilder(512); - sb.append(getSelectClausePKOnly()); - sb.append(" "); - sb.append(buildClauseWithoutMainSelect(true)); - String sql = sb.toString(); - return filterSubQueryIndent(sql); - } - - protected String buildClauseWithoutMainSelect(boolean pkonly) { - StringBuilder sb = new StringBuilder(512); sb.append(getFromClause()); sb.append(getFromHint()); sb.append(" "); sb.append(getWhereClause()); - String unionClause = buildUnionClause(pkonly ? getSelectClausePKOnly() - : getSelectClause()); + String unionClause = buildUnionClause(getSelectClause()); // Delete template mark! (At the future this will be unnecessary.) unionClause = replaceString(unionClause, getUnionWhereClauseMark(), "");// Required @@ -225,29 +221,45 @@ protected String buildUnionClause(String selectClause) { StringBuilder sb = new StringBuilder(); - for (final Iterator ite = _unionQueryInfoList - .iterator(); ite.hasNext();) { - final UnionQueryInfo unionQueryInfo = (UnionQueryInfo) ite.next(); - final String unionQueryClause = unionQueryInfo - .getUnionQueryClause(); - final boolean unionAll = unionQueryInfo.isUnionAll(); - if (isFormatClauseEffective()) { + if (hasUnionQuery()) { + for (Iterator ite = _unionQueryInfoList.iterator(); ite + .hasNext();) { + UnionQueryInfo unionQueryInfo = (UnionQueryInfo) ite.next(); + String unionQueryClause = unionQueryInfo.getUnionQueryClause(); + boolean unionAll = unionQueryInfo.isUnionAll(); sb.append(getLineSeparator()); - } - sb.append(unionAll ? " union all " : " union "); - if (isFormatClauseEffective()) { + sb.append(unionAll ? " union all " : " union "); sb.append(getLineSeparator()); + sb.append(selectClause).append(" ").append(unionQueryClause); } - sb.append(selectClause).append(" ").append(unionQueryClause); } return sb.toString(); } + protected String filterUnionCountOrScalar(String sql) { + if (!isSelectClauseTypeCountOrScalar() || !hasUnionQuery()) { + return sql; + } + String selectClause = buildSelectClauseCountOrScalar("dfmain"); + String ln = getLineSeparator(); + String beginMark = resolveSubQueryBeginMark("dfmain") + ln; + String endMark = resolveSubQueryEndMark("dfmain"); + return selectClause + ln + " from (" + beginMark + sql + ln + + " ) dfmain" + endMark; + } + //========================================================================== // ========= // Clause Parts // ============ public String getSelectClause() { + // [DBFlute-0.8.6] + if (isSelectClauseTypeCountOrScalar() && !hasUnionQuery()) { + return buildSelectClauseCountOrScalar("dflocal"); + } + // /- - - - - - - - - - - - - - - - - - - - - - - - + // The type of select clause is COLUMNS since here. + // - - - - - - - - - -/ StringBuilder sb = new StringBuilder(); DBMeta dbmeta = DBMetaInstanceHandler.findDBMeta(_tableName); List columnInfoList = dbmeta.getColumnInfoList(); @@ -265,7 +277,19 @@ // [DBFlute-0.7.4] if (existsSpecifiedLocal && !localSpecifiedMap.containsKey(columnName)) { - continue; + if (isSelectClauseTypeCountOrScalar() && hasUnionQuery()) { + // Here it must be with union query. + // So the primary Key is target for saving unique. + // But if it does not have primary keys, all column is + // target. + if (dbmeta.hasPrimaryKey()) { + if (!columnInfo.isPrimary()) { + continue; + } + } + } else { + continue; + } } if (sb.length() > 0) { @@ -307,10 +331,6 @@ selectColumnInfo.getColumnAliasName()); } } - if (_isIncludedSelectColumnEffective - && !_includedSelectColumnMap.isEmpty()) { - sb.append(getIncludedSelectColumnClause()); - } // [DBFlute-0.7.4] if (_specifiedDeriveSubQueryMap != null @@ -318,9 +338,7 @@ Collection deriveSubQuerySet = _specifiedDeriveSubQueryMap .values(); for (String deriveSubQuery : deriveSubQuerySet) { - if (isFormatClauseEffective()) { - sb.append(getLineSeparator()).append(" "); - } + sb.append(getLineSeparator()).append(" "); sb.append(", ").append(deriveSubQuery); } } @@ -328,67 +346,83 @@ return sb.toString(); } - public String getSelectClausePKOnly() { - StringBuilder sb = new StringBuilder(); - DBMeta dbmeta = DBMetaInstanceHandler.findDBMeta(_tableName); - UniqueInfo uniqueInfo = dbmeta.getPrimaryUniqueInfo(); - List columnInfoList = uniqueInfo.getUniqueColumnList(); - for (ColumnInfo columnInfo : columnInfoList) { - String columnName = columnInfo.getColumnDbName(); - if (sb.length() > 0) { - sb.append(", "); - } else { - sb.append("select").append(SELECT_HINT).append(" "); - } - String realColumnName = getLocalTableAliasName() + "." + columnName; - sb.append(realColumnName).append(" as ").append(columnName); - _selectClauseRealColumnAliasMap.put(realColumnName, columnName); + protected boolean isSelectClauseTypeCountOrScalar() { + if (_selectClauseType.equals(SelectClauseType.COUNT)) { + return true; + } else if (_selectClauseType.equals(SelectClauseType.MAX)) { + return true; + } else if (_selectClauseType.equals(SelectClauseType.MIN)) { + return true; + } else if (_selectClauseType.equals(SelectClauseType.SUM)) { + return true; + } else if (_selectClauseType.equals(SelectClauseType.AVG)) { + return true; } - if (_isIncludedSelectColumnEffective - && !_includedSelectColumnMap.isEmpty()) { - sb.append(getIncludedSelectColumnClause()); - } + return false; + } - // [DBFlute-0.7.4] - if (_specifiedDeriveSubQueryMap != null - && !_specifiedDeriveSubQueryMap.isEmpty()) { - Collection deriveSubQuerySet = _specifiedDeriveSubQueryMap - .values(); - for (String deriveSubQuery : deriveSubQuerySet) { - if (isFormatClauseEffective()) { - sb.append(getLineSeparator()).append(" "); - } - sb.append(", ").append(deriveSubQuery); - } + protected String buildSelectClauseCountOrScalar(String aliasName) { + if (_selectClauseType.equals(SelectClauseType.COUNT)) { + return buildSelectClauseCount(); + } else if (_selectClauseType.equals(SelectClauseType.MAX)) { + return buildSelectClauseMax(aliasName); + } else if (_selectClauseType.equals(SelectClauseType.MIN)) { + return buildSelectClauseMin(aliasName); + } else if (_selectClauseType.equals(SelectClauseType.SUM)) { + return buildSelectClauseSum(aliasName); + } else if (_selectClauseType.equals(SelectClauseType.AVG)) { + return buildSelectClauseAvg(aliasName); } + String msg = "The type of select clause is not for scalar:"; + msg = msg + " type=" + _selectClauseType; + throw new IllegalStateException(msg); + } - return sb.toString(); + protected String buildSelectClauseCount() { + return "select count(*)"; } - public String getSelectHint() { - return createSelectHint(); + protected String buildSelectClauseMax(String aliasName) { + String columnName = getSpecifiedColumnNameAsOne(); + assertScalarSelectSpecifiedColumnOnlyOne(columnName); + return "select max(" + aliasName + "." + columnName + ")"; } - public String getIncludedSelectColumnClause() { - StringBuilder sb = new StringBuilder(); - int count = 0; - for (Iterator ite = _includedSelectColumnMap.keySet() - .iterator(); ite.hasNext(); count++) { - String aliasName = ite.next(); - String realColumnName = (String) _includedSelectColumnMap - .get(aliasName); - sb.append(", ").append(realColumnName).append(" as ").append( - aliasName); - _selectClauseRealColumnAliasMap.put(realColumnName, aliasName); + protected String buildSelectClauseMin(String aliasName) { + String columnName = getSpecifiedColumnNameAsOne(); + assertScalarSelectSpecifiedColumnOnlyOne(columnName); + return "select min(" + aliasName + "." + columnName + ")"; + } + + protected String buildSelectClauseSum(String aliasName) { + String columnName = getSpecifiedColumnNameAsOne(); + assertScalarSelectSpecifiedColumnOnlyOne(columnName); + return "select sum(" + aliasName + "." + columnName + ")"; + } + + protected String buildSelectClauseAvg(String aliasName) { + String columnName = getSpecifiedColumnNameAsOne(); + assertScalarSelectSpecifiedColumnOnlyOne(columnName); + return "select avg(" + aliasName + "." + columnName + ")"; + } + + protected void assertScalarSelectSpecifiedColumnOnlyOne(String columnName) { + if (columnName != null) { + return; } - return sb.toString(); + String msg = "The specified column exists one"; + msg = msg + " when the type of select clause is for scalar:"; + msg = msg + " specifiedSelectColumnMap=" + _specifiedSelectColumnMap; + throw new IllegalStateException(msg); } + public String getSelectHint() { + return createSelectHint(); + } + public String getFromClause() { StringBuilder sb = new StringBuilder(); - if (isFormatClauseEffective()) { - sb.append(getLineSeparator()).append(" "); - } + sb.append(getLineSeparator()).append(" "); sb.append("from "); if (_baseTableInlineWhereList.isEmpty()) { sb.append(_tableName).append(" dflocal"); @@ -417,9 +451,7 @@ Map joinOnMap = joinInfo.getJoinOnMap(); assertJoinOnMapNotEmpty(joinOnMap, aliasName); - if (isFormatClauseEffective()) { - sb.append(getLineSeparator()).append(" "); - } + sb.append(getLineSeparator()).append(" "); sb.append(" left outer join "); if (inlineWhereClauseList.isEmpty()) { sb.append(joinTableName); @@ -489,16 +521,12 @@ String clauseElement = (String) ite.next(); clauseElement = filterWhereClauseSimply(clauseElement); if (count == 0) { - if (isFormatClauseEffective()) { - sb.append(getLineSeparator()).append(" "); - } + sb.append(getLineSeparator()).append(" "); sb.append("where ").append( template ? getWhereFirstConditionMark() : "").append( clauseElement); } else { - if (isFormatClauseEffective()) { - sb.append(getLineSeparator()).append(" "); - } + sb.append(getLineSeparator()).append(" "); sb.append(" and ").append(clauseElement); } } @@ -510,7 +538,7 @@ public String getOrderByClause() { String orderByClause = null; - if (!_unionQueryInfoList.isEmpty()) { + if (hasUnionQuery()) { if (_selectClauseRealColumnAliasMap == null || _selectClauseRealColumnAliasMap.isEmpty()) { String msg = "The selectClauseColumnAliasMap should not be null or empty when union query exists: " @@ -522,8 +550,7 @@ } else { orderByClause = _orderByClause.getOrderByClause(); } - if (isFormatClauseEffective() && orderByClause != null - && orderByClause.trim().length() > 0) { + if (orderByClause != null && orderByClause.trim().length() > 0) { return getLineSeparator() + " " + orderByClause; } else { return orderByClause; @@ -532,8 +559,7 @@ public String getSqlSuffix() { String sqlSuffix = createSqlSuffix(); - if (isFormatClauseEffective() && sqlSuffix != null - && sqlSuffix.trim().length() > 0) { + if (sqlSuffix != null && sqlSuffix.trim().length() > 0) { return getLineSeparator() + sqlSuffix; } else { return sqlSuffix; @@ -542,20 +568,6 @@ //========================================================================== // ========= - // Copy Parts - // ========== - public void copyIncludedSelectColumn(SqlClause sqlClause) { - Set keySet = _includedSelectColumnMap.keySet(); - for (Iterator ite = keySet.iterator(); ite.hasNext();) { - String aliasName = ite.next(); - String realColumnName = (String) _includedSelectColumnMap - .get(aliasName); - sqlClause.registerIncludedSelectColumn(aliasName, realColumnName); - } - } - - //========================================================================== - // ========= // SelectedSelectColumn // ==================== /** @@ -644,26 +656,6 @@ //========================================================================== // ========= - // IncludedSelectColumn - // ==================== - public void ignoreIncludedSelectColumn() { - _isIncludedSelectColumnEffective = false; - } - - public void makeIncludedSelectColumnEffective() { - if (!_includedSelectColumnMap.isEmpty()) { - _isIncludedSelectColumnEffective = true; - } - } - - public void registerIncludedSelectColumn(String aliasName, - String realColumnName) { - _isIncludedSelectColumnEffective = true; - _includedSelectColumnMap.put(aliasName, realColumnName); - } - - //========================================================================== - // ========= // OuterJoin // ========= public void registerOuterJoin(String joinTableName, String aliasName, @@ -1079,12 +1071,23 @@ public void registerUnionQuery(String unionQueryClause, boolean unionAll) { assertStringNotNullAndNotTrimmedEmpty("unionQueryClause", unionQueryClause); - final UnionQueryInfo unionQueryInfo = new UnionQueryInfo(); + UnionQueryInfo unionQueryInfo = new UnionQueryInfo(); unionQueryInfo.setUnionQueryClause(unionQueryClause); unionQueryInfo.setUnionAll(unionAll); + addUnionQueryInfo(unionQueryInfo); + } + + protected void addUnionQueryInfo(UnionQueryInfo unionQueryInfo) { + if (_unionQueryInfoList == null) { + _unionQueryInfoList = new ArrayList(); + } _unionQueryInfoList.add(unionQueryInfo); } + public boolean hasUnionQuery() { + return _unionQueryInfoList != null && !_unionQueryInfoList.isEmpty(); + } + protected static class UnionQueryInfo { protected String _unionQueryClause; @@ -1425,18 +1428,6 @@ //========================================================================== // ========= - // Format Clause - // ============= - public boolean isFormatClauseEffective() { - return _formatClause; - } - - public void makeFormatClauseEffective() { - _formatClause = true; - } - - //========================================================================== - // ========= // Sub Query Indent // ================ public String resolveSubQueryBeginMark(String subQueryIdentity) { @@ -1462,13 +1453,11 @@ } public String filterSubQueryIndent(String sql) { - return isFormatClauseEffective() ? filterSubQueryIndent(sql, "") : sql; + return filterSubQueryIndent(sql, "", sql); } - protected String filterSubQueryIndent(String sql, String preIndent) { - if (!isFormatClauseEffective()) { - return sql; - } + protected String filterSubQueryIndent(String sql, String preIndent, + String originalSql) { final String lineSeparator = getLineSeparator(); if (!sql.contains(getSubQueryBeginMarkPrefix())) { return sql; @@ -1509,7 +1498,8 @@ // - - - - - - - - // In begin to end // - - - - - - - - - if (line.contains(endMarkPrefix + subQueryIdentity)) {// The end + if (line.contains(endMarkPrefix + subQueryIdentity)) { // The + // end final int markIndex = line.indexOf(endMarkPrefix); final int terminalIndex = line.indexOf(identityTerminal); if (terminalIndex < 0) { @@ -1521,7 +1511,7 @@ + line.substring(terminalIndex + terminalLength); subSb.append(clause).append(getLineSeparator()); final String currentSql = filterSubQueryIndent(subSb - .toString(), preIndent + indent); + .toString(), preIndent + indent, originalSql); mainSb.append(currentSql); throughBegin = false; throughBeginFirst = false; @@ -1544,10 +1534,11 @@ + getLineSeparator(); msg = msg + subQueryIdentity + getLineSeparator(); msg = msg + getLineSeparator() + "[Before Filter]" - + getLineSeparator(); - msg = msg + sql + getLineSeparator(); + + getLineSeparator() + sql; msg = msg + getLineSeparator() + "[After Filter]" + getLineSeparator() + filteredSql; + msg = msg + getLineSeparator() + "[Original SQL]" + + getLineSeparator() + originalSql; throw new SubQueryIndentFailureException(msg); } if (filteredSql.contains(beginMarkPrefix)) { @@ -1556,10 +1547,11 @@ + getLineSeparator(); msg = msg + subQueryIdentity + getLineSeparator(); msg = msg + getLineSeparator() + "[Before Filter]" - + getLineSeparator(); - msg = msg + sql + getLineSeparator(); + + getLineSeparator() + sql; msg = msg + getLineSeparator() + "[After Filter]" + getLineSeparator() + filteredSql; + msg = msg + getLineSeparator() + "[Original SQL]" + + getLineSeparator() + originalSql; throw new SubQueryIndentFailureException(msg); } return filteredSql; @@ -1592,7 +1584,7 @@ } if (!_specifiedSelectColumnMap.containsKey(tableAliasName)) { _specifiedSelectColumnMap.put(tableAliasName, - new HashMap()); + new LinkedHashMap()); } Map elementMap = _specifiedSelectColumnMap .get(tableAliasName); @@ -1666,10 +1658,7 @@ getUnionWhereFirstConditionMark(), ""); final StringBuilder sb = new StringBuilder(); - String ln = ""; - if (isFormatClauseEffective()) { - ln = getLineSeparator(); - } + String ln = getLineSeparator(); sb.append("update ").append(_tableName).append(ln); int index = 0; // It is guaranteed that the map has one or more elements. @@ -1728,10 +1717,7 @@ final String subQuery = filterSubQueryIndent(selectClause + " " + fromWhereClause); final StringBuilder sb = new StringBuilder(); - String ln = ""; - if (isFormatClauseEffective()) { - ln = getLineSeparator(); - } + String ln = getLineSeparator(); sb.append("delete from ").append(_tableName).append(ln); sb.append(" where ").append(primaryKeyName); sb.append(" in (").append(ln).append(subQuery).append(ln).append( @@ -1760,6 +1746,29 @@ return false; } + // [DBFlute-0.8.6] + //========================================================================== + // ========= + // Select Clause Type + // ================== + public void classifySelectClauseType(SelectClauseType selectClauseType) { + changeSelectClauseType(selectClauseType); + } + + protected void changeSelectClauseType(SelectClauseType selectClauseType) { + savePreviousSelectClauseType(); + _selectClauseType = selectClauseType; + } + + protected void savePreviousSelectClauseType() { + _previousSelectClauseType = _selectClauseType; + } + + public void rollbackSelectClauseType() { + _selectClauseType = _previousSelectClauseType != null ? _previousSelectClauseType + : DEFAULT_SELECT_CLAUSE_TYPE; + } + // [DBFlute-0.7.5] //========================================================================== // ========= Modified: todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/cbean/sqlclause/SqlClause.java =================================================================== --- todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/cbean/sqlclause/SqlClause.java 2008-12-27 22:20:45 UTC (rev 1632) +++ todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/cbean/sqlclause/SqlClause.java 2008-12-27 22:21:53 UTC (rev 1633) @@ -7,7 +7,7 @@ import jp.sf.pal.todolist.db.allcommon.cbean.cvalue.ConditionValue; /** - * The interface of SQL-clause. + * The interface of SQL clause. * * @author DBFlute(AutoGenerator) */ @@ -35,21 +35,6 @@ */ public String getClause(); - /** - * Get clause of all parts as PK-only. - * - *
-     * # 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
-     * 
- * - * @return The clause of all parts as PK-Only. (NotNull) - */ - public String getClausePKOnly(); - // ----------------------------------------------------- // Fragment Clause // --------------- @@ -92,14 +77,6 @@ public String getSelectClause(); /** - * Get The clause of 'select' as PK-only. This is an internal method. - * - * @return The clause of select PK-only. {[select ...] from table...} - * (NotNull) - */ - public String getSelectClausePKOnly(); - - /** * Get the hint of 'select'. This is an internal method. * * @return The hint of 'select'. {select [select-hint] * from table...} @@ -108,14 +85,6 @@ public String getSelectHint(); /** - * Get the clause of included-select-column. This is an internal method. - * - * @return The clause of included-select-column. {select ... , - * [included-select-column clause] from table...} (NotNull) - */ - public String getIncludedSelectColumnClause(); - - /** * Get the clause of 'from'. This is an internal method. * * @return The clause of 'from'. (NotNull) @@ -162,17 +131,6 @@ //========================================================================== // ========= - // Copy Parts - // ========== - /** - * Copy included-select-column. - * - * @param sqlClause SQL-clause. (NotNull) - */ - public void copyIncludedSelectColumn(SqlClause sqlClause); - - //========================================================================== - // ========= // SelectedSelectColumn // ==================== /** @@ -189,30 +147,6 @@ //========================================================================== // ========= - // IncludedSelectColumn - // ==================== - /** - * Ignore included-select-column. - */ - public void ignoreIncludedSelectColumn(); - - /** - * Make included-select-column effective. - */ - public void makeIncludedSelectColumnEffective(); - - /** - * Register included-select-column. - * - * @param aliasName The alias name of the included-select-column. (NotNull) - * @param realColumnName The real column name of the included-select-column. - * (NotNull) - */ - public void registerIncludedSelectColumn(String aliasName, - String realColumnName); - - //========================================================================== - // ========= // OuterJoin // ========= /** @@ -340,6 +274,8 @@ // ===== public void registerUnionQuery(String unionClause, boolean unionAll); + public boolean hasUnionQuery(); + //========================================================================== // ========= // FetchScope @@ -561,14 +497,6 @@ //========================================================================== // ========= - // Format Clause - // ============= - public boolean isFormatClauseEffective(); - - public void makeFormatClauseEffective(); - - //========================================================================== - // ========= // Sub Query Indent // ================ public String resolveSubQueryBeginMark(String subQueryIdentity); @@ -588,8 +516,17 @@ public boolean hasSpecifiedDeriveSubQuery(String aliasName); + /** + * Get the name of only one specified column. + * + * @return The name of only one specified column. (Nullable: If it's not + * found or duplicated, it returns null) + */ public String getSpecifiedColumnNameAsOne(); + /** + * Clear specified select columns. + */ public void clearSpecifiedSelectColumn(); // [DBFlute-0.7.5] @@ -621,4 +558,29 @@ */ public boolean isUniqueConstraintException(String sqlState, Integer errorCode); + + // [DBFlute-0.8.6] + //========================================================================== + // ========= + // Select Clause Type + // ================== + /** + * Classify the type of select clause into specified type. + * + * @param selectClauseType The type of select clause. (NotNull) + */ + public void classifySelectClauseType(SelectClauseType selectClauseType); + + /** + * Roll-back the type of select clause into previous one. If it has no + * change, classify its type into default type. + */ + public void rollbackSelectClauseType(); + + /** + * The type of select clause. + */ + public static enum SelectClauseType { + COLUMNS, COUNT, MAX, MIN, SUM, AVG + } } Modified: todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/cbean/sqlclause/SqlClauseOracle.java =================================================================== --- todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/cbean/sqlclause/SqlClauseOracle.java 2008-12-27 22:20:45 UTC (rev 1632) +++ todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/cbean/sqlclause/SqlClauseOracle.java 2008-12-27 22:21:53 UTC (rev 1633) @@ -71,12 +71,7 @@ if (!isFetchStartIndexSupported() && !isFetchSizeSupported()) { return; } - String ln = null; - if (isFormatClauseEffective()) { - ln = getLineSeparator(); - } else { - ln = ""; - } + String ln = getLineSeparator(); _fetchScopeSelectHint = " * from (select base.*, rownum as rn from (" + ln + "select"; _fetchScopeSqlSuffix = ""; Modified: todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/dbmeta/AbstractDBMeta.java =================================================================== --- todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/dbmeta/AbstractDBMeta.java 2008-12-27 22:20:45 UTC (rev 1632) +++ todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/dbmeta/AbstractDBMeta.java 2008-12-27 22:21:53 UTC (rev 1633) @@ -5,12 +5,11 @@ import java.util.Collection; import java.util.Collections; import java.util.HashMap; -import java.util.HashSet; import java.util.Iterator; import java.util.LinkedHashMap; import java.util.List; import java.util.Map; -import java.util.Set; +import java.util.concurrent.ConcurrentHashMap; import jp.sf.pal.todolist.db.allcommon.Entity; import jp.sf.pal.todolist.db.allcommon.dbmeta.info.ColumnInfo; @@ -22,6 +21,7 @@ import jp.sf.pal.todolist.db.allcommon.helper.MapListStringImpl; import jp.sf.pal.todolist.db.allcommon.helper.MapStringBuilder; import jp.sf.pal.todolist.db.allcommon.helper.MapStringBuilderImpl; +import jp.sf.pal.todolist.db.allcommon.helper.StringKeyMap; import jp.sf.pal.todolist.db.allcommon.util.SimpleAssertUtil; import jp.sf.pal.todolist.db.allcommon.util.SimpleStringUtil; import jp.sf.pal.todolist.db.allcommon.util.SimpleSystemUtil; @@ -31,68 +31,113 @@ * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public abstract class AbstractDBMeta implements DBMeta { //========================================================================== // ========= + // Definition + // ========== + protected static final Object DUMMY_VALUE = new Object(); + + //========================================================================== + // ========= // Attribute // ========= - protected List _columnInfoList; + // ----------------------------------------------------- + // Information Resource + // -------------------- + // Initialized at its getter. + private StringKeyMap _tableDbNameFlexibleMap; + private StringKeyMap _tablePropertyNameFlexibleMap; + + private List _columnInfoList; + + private StringKeyMap _columnInfoFlexibleMap; + + // Initialized at hasMethod(). + private Map _methodNameMap = newConcurrentHashMap(); + //========================================================================== // ========= + // Table Info + // ========== + /** + * Get the flexible map of table DB name. + * + * @return The flexible map of table DB name. (NotNull, NotEmpty) + */ + protected Map getTableDbNameFlexibleMap() { + if (_tableDbNameFlexibleMap != null) { + return _tableDbNameFlexibleMap; + } + synchronized (this) { + if (_tableDbNameFlexibleMap != null) { + return _tableDbNameFlexibleMap; + } + _tableDbNameFlexibleMap = StringKeyMap.createAsFlexibleConcurrent(); + _tableDbNameFlexibleMap.put(getTableDbName(), getTableDbName()); + return _tableDbNameFlexibleMap; + } + } + + /** + * Get the flexible map of table property name. + * + * @return The flexible map of table property name. (NotNull, NotEmpty) + */ + protected Map getTablePropertyNameFlexibleMap() { + if (_tablePropertyNameFlexibleMap != null) { + return _tablePropertyNameFlexibleMap; + } + synchronized (this) { + if (_tablePropertyNameFlexibleMap != null) { + return _tablePropertyNameFlexibleMap; + } + _tablePropertyNameFlexibleMap = StringKeyMap + .createAsFlexibleConcurrent(); + _tablePropertyNameFlexibleMap.put(getTableDbName(), + getTablePropertyName()); + return _tableDbNameFlexibleMap; + } + } + + //========================================================================== + // ========= // Column Info // =========== /** * The implementation. * - * @param columnFlexibleName The flexible name of the column. (NotNull) + * @param columnFlexibleName The flexible name(IgnoreCase, IgnoreUnderscore) + * of the column. (NotNull, NotEmpty) * @return Determination. */ public boolean hasColumn(String columnFlexibleName) { - if (!hasFlexibleName(columnFlexibleName)) { - return false; - } - final String propertyName = findPropertyName(columnFlexibleName); - return hasMethod("column" + initCap(propertyName)); + assertStringNotNullAndNotTrimmedEmpty("columnFlexibleName", + columnFlexibleName); + return getColumnInfoFlexibleMap().containsKey(columnFlexibleName); } /** * The implementation. * - * @param columnFlexibleName The flexible name of the column. (NotNull and - * NotEmpty) + * @param columnFlexibleName The flexible name(IgnoreCase, IgnoreUnderscore) + * of the column. (NotNull, NotEmpty) * @return The information of the column. (NotNull) */ public ColumnInfo findColumnInfo(String columnFlexibleName) { assertStringNotNullAndNotTrimmedEmpty("columnFlexibleName", columnFlexibleName); - if (!hasColumn(columnFlexibleName)) { + final ColumnInfo columnInfo = getColumnInfoFlexibleMap().get( + columnFlexibleName); + if (columnInfo == null) { String msg = "Not found column by columnFlexibleName: " + columnFlexibleName; msg = msg + " tableName=" + getTableDbName(); throw new IllegalArgumentException(msg); } - String methodName = "column" - + initCap(findPropertyName(columnFlexibleName)); - Method method = null; - try { - method = this.getClass().getMethod(methodName, new Class[] {}); - } catch (NoSuchMethodException e) { - String msg = "Not found column by columnFlexibleName: " - + columnFlexibleName; - msg = msg + " tableName=" + getTableDbName() + " methodName=" - + methodName; - throw new RuntimeException(msg, e); - } - try { - return (ColumnInfo) method.invoke(this, new Object[] {}); - } catch (IllegalAccessException e) { - throw new RuntimeException(e); - } catch (java.lang.reflect.InvocationTargetException e) { - throw new RuntimeException(e.getCause()); - } + return columnInfo; } protected ColumnInfo cci(String columnDbName, String propertyName, @@ -114,7 +159,7 @@ /** * The implementation. * - * @return The list of columns. (NotNull and NotEmpty) + * @return The list of columns. (NotNull, NotEmpty) */ public List getColumnInfoList() { if (_columnInfoList != null) { @@ -144,79 +189,118 @@ } } - protected void initializeColumnInfoList() { - getColumnInfoList();// Ignore return value because of initialization - // only! + /** + * Get the flexible map of column information. + * + * @return The flexible map of column information. (NotNull, NotEmpty) + */ + protected Map getColumnInfoFlexibleMap() { + if (_columnInfoFlexibleMap != null) { + return _columnInfoFlexibleMap; + } + final List columnInfoList = getColumnInfoList(); + synchronized (this) { + if (_columnInfoFlexibleMap != null) { + return _columnInfoFlexibleMap; + } + _columnInfoFlexibleMap = StringKeyMap.createAsFlexibleConcurrent(); + for (ColumnInfo columnInfo : columnInfoList) { + _columnInfoFlexibleMap.put(columnInfo.getColumnDbName(), + columnInfo); + } + return _columnInfoFlexibleMap; + } } //========================================================================== - // =========== + // ========= + // Resource Initialization + // ======================= + protected void initializeInformationResource() { // for instance initializer + // of subclass. + // Initialize the flexible map of table DB name. + getTableDbNameFlexibleMap(); + + // Initialize the flexible map of table property name. + getTablePropertyNameFlexibleMap(); + + // Initialize the list of column information. + getColumnInfoList(); + + // Initialize the flexible map of column information. + getColumnInfoFlexibleMap(); + + // Initialize the map of (public)method name. + hasMethod("dummy"); + } + + //========================================================================== + // ========= // Name Handling // ============= /** * The implementation. * - * @param flexibleName Flexible-name(IgnoreCase). (NotNull and NotEmpty) + * @param flexibleName The flexible name(IgnoreCase, IgnoreUnderscore). + * (NotNull, NotEmpty) * @return Determination. */ public boolean hasFlexibleName(String flexibleName) { - final String key = flexibleName.toLowerCase(); - if (getDbNamePropertyNameKeyToLowerMap().containsKey(key)) { - return true; - } - if (getPropertyNameDbNameKeyToLowerMap().containsKey(key)) { - return true; - } - return false; + assertStringNotNullAndNotTrimmedEmpty("flexibleName", flexibleName); + + // It uses column before table because column is used much more than + // table. + // This is the same consideration at other methods. + return getColumnInfoFlexibleMap().containsKey(flexibleName) + || getTableDbNameFlexibleMap().containsKey(flexibleName); } /** * The implementation. * - * @param flexibleName Flexible-name(IgnoreCase). (NotNull and NotEmpty) - * @return DB name. (NotNull and NotEmpty) + * @param flexibleName The flexible name(IgnoreCase, IgnoreUnderscore). + * (NotNull, NotEmpty) + * @return DB name. (NotNull, NotEmpty) */ public String findDbName(String flexibleName) { - final String key = flexibleName.toLowerCase(); - if (getPropertyNameDbNameKeyToLowerMap().containsKey(key)) { - return (String) getPropertyNameDbNameKeyToLowerMap().get(key); + assertStringNotNullAndNotTrimmedEmpty("flexibleName", flexibleName); + final ColumnInfo columnInfoMap = getColumnInfoFlexibleMap().get( + flexibleName); + if (columnInfoMap != null) { + return columnInfoMap.getColumnDbName(); } - if (getDbNamePropertyNameKeyToLowerMap().containsKey(key)) { - final String dbNameKeyToLower = ((String) getDbNamePropertyNameKeyToLowerMap() - .get(key)).toLowerCase(); - if (getPropertyNameDbNameKeyToLowerMap().containsKey( - dbNameKeyToLower)) { - return (String) getPropertyNameDbNameKeyToLowerMap().get( - dbNameKeyToLower); - } + final String tableDbName = getTableDbNameFlexibleMap() + .get(flexibleName); + if (tableDbName != null) { + return tableDbName; } - String msg = "Not found object by the flexible name: flexibleName=" + String msg = "Not found DB name by the flexible name: flexibleName=" + flexibleName; - throw new IllegalStateException(msg); + throw new IllegalArgumentException(msg); } /** * The implementation. * - * @param flexibleName Flexible-name(IgnoreCase). (NotNull and NotEmpty) - * @return DB name. (NotNull and NotEmpty) + * @param flexibleName The flexible name(IgnoreCase, IgnoreUnderscore). + * (NotNull, NotEmpty) + * @return DB name. (NotNull, NotEmpty) */ public String findPropertyName(String flexibleName) { - final String key = flexibleName.toLowerCase(); - if (getDbNamePropertyNameKeyToLowerMap().containsKey(key)) { - return (String) getDbNamePropertyNameKeyToLowerMap().get(key); + assertStringNotNullAndNotTrimmedEmpty("flexibleName", flexibleName); + final ColumnInfo columnInfoMap = getColumnInfoFlexibleMap().get( + flexibleName); + if (columnInfoMap != null) { + return columnInfoMap.getPropertyName(); } - if (getPropertyNameDbNameKeyToLowerMap().containsKey(key)) { - final String dbNameToLower = ((String) getPropertyNameDbNameKeyToLowerMap() - .get(key)).toLowerCase(); - if (getDbNamePropertyNameKeyToLowerMap().containsKey(dbNameToLower)) { - return (String) getDbNamePropertyNameKeyToLowerMap().get( - dbNameToLower); - } + final String tablePropertyName = getTablePropertyNameFlexibleMap().get( + flexibleName); + if (tablePropertyName != null) { + return tablePropertyName; } - String msg = "Not found object by the flexible name: flexibleName=" + String msg = "Not found property name by the flexible name: flexibleName=" + flexibleName; - throw new IllegalStateException(msg); + throw new IllegalArgumentException(msg); } //========================================================================== @@ -735,10 +819,8 @@ protected void registerEntityPropertySetupper( String columnName, String propertyName, Eps setupper, Map> entityPropertySetupperMap) { + // Only column name is registered because the map must be flexible map. entityPropertySetupperMap.put(columnName, setupper); - entityPropertySetupperMap.put(propertyName, setupper); - entityPropertySetupperMap.put(columnName.toLowerCase(), setupper); - entityPropertySetupperMap.put(propertyName.toLowerCase(), setupper); } protected Eps findEps( @@ -945,6 +1027,7 @@ /** * This class is for Internal. Don't use this! */ + @SuppressWarnings("unchecked") protected static class MapStringValueAnalyzer { protected java.util.Map _valueMap; @@ -1072,6 +1155,7 @@ // ========= // Assist Helper // ============= + @SuppressWarnings("unchecked") protected ENTITY downcast(Entity entity) { checkDowncast(entity); return (ENTITY) entity; @@ -1118,10 +1202,10 @@ protected Map setupKeyToLowerMap(boolean dbNameKey) { final Map map; if (dbNameKey) { - map = newLinkedHashMap(getTableDbName().toLowerCase(), + map = newConcurrentHashMap(getTableDbName().toLowerCase(), getTablePropertyName()); } else { - map = newLinkedHashMap(getTablePropertyName().toLowerCase(), + map = newConcurrentHashMap(getTablePropertyName().toLowerCase(), getTableDbName()); } Method[] methods = this.getClass().getMethods(); @@ -1178,6 +1262,17 @@ return new HashMap(); } + protected ConcurrentHashMap newConcurrentHashMap() { + return new ConcurrentHashMap(); + } + + protected ConcurrentHashMap newConcurrentHashMap( + KEY key, VALUE value) { + ConcurrentHashMap map = newConcurrentHashMap(); + map.put(key, value); + return map; + } + protected LinkedHashMap newLinkedHashMap() { return new LinkedHashMap(); } @@ -1201,23 +1296,26 @@ // ----------------------------------------------------- // Reflection Handling // ------------------- - private Set _cachedMethodNames = new HashSet(); // for - - // performance - + /** + * Does it have the method? + * + * @param methodName The name of method. (NotNull, NotEmpty, + * PublicMethodOnly) + * @return Determination. + */ protected boolean hasMethod(String methodName) { assertStringNotNullAndNotTrimmedEmpty("methodName", methodName); - if (_cachedMethodNames.isEmpty()) { - synchronized (_cachedMethodNames) { - if (_cachedMethodNames.isEmpty()) { + if (_methodNameMap.isEmpty()) { + synchronized (_methodNameMap) { + if (_methodNameMap.isEmpty()) { final Method[] methods = this.getClass().getMethods(); for (Method method : methods) { - _cachedMethodNames.add(method.getName()); + _methodNameMap.put(method.getName(), DUMMY_VALUE); } } } } - return _cachedMethodNames.contains(methodName); + return _methodNameMap.containsKey(methodName); } // ----------------------------------------------------- Modified: todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/dbmeta/DBMeta.java =================================================================== --- todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/dbmeta/DBMeta.java 2008-12-27 22:20:45 UTC (rev 1632) +++ todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/dbmeta/DBMeta.java 2008-12-27 22:21:53 UTC (rev 1633) @@ -17,23 +17,22 @@ * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public interface DBMeta { //========================================================================== // ========= // Definition // ========== - /** Map-string map-mark. */ + /** Map-string map mark. */ public static final String MAP_STRING_MAP_MARK = "map:"; - /** Map-string list-mark. */ + /** Map-string list mark. */ public static final String MAP_STRING_LIST_MARK = "list:"; - /** Map-string start-brace. */ + /** Map-string start brace. */ public static final String MAP_STRING_START_BRACE = "@{"; - /** Map-string end-brace. */ + /** Map-string end brace. */ public static final String MAP_STRING_END_BRACE = "@}"; /** Map-string delimiter. */ @@ -47,23 +46,23 @@ // Table Info // ========== /** - * Get table db-name. + * Get table DB name. * - * @return Table db-name. (NotNull) + * @return Table DB name. (NotNull) */ public String getTableDbName(); /** - * Get table property-name(JavaBeansRule). + * Get table property name(JavaBeansRule). * - * @return Table property-name(JavaBeansRule). (NotNull) + * @return Table property name(JavaBeansRule). (NotNull) */ public String getTablePropertyName(); /** - * Get table SQL-name. + * Get table SQL name. * - * @return Table SQL-name. (NotNull) + * @return Table SQL name. (NotNull) */ public String getTableSqlName(); @@ -80,10 +79,10 @@ public boolean hasFlexibleName(String flexibleName); /** - * Find db name by flexible name. {Target objects are TABLE and COLUMN} + * Find DB name by flexible name. {Target objects are TABLE and COLUMN} * * @param flexibleName The flexible name. (NotNull and NotEmpty) - * @return Db name. (NotNull and NotEmpty) + * @return The DB name of anything. (NotNull and NotEmpty) */ public String findDbName(String flexibleName); @@ -92,60 +91,40 @@ * TABLE and COLUMN} * * @param flexibleName The flexible name. (NotNull and NotEmpty) - * @return Db name. (NotNull and NotEmpty) + * @return The DB name of anything. (NotNull and NotEmpty) */ public String findPropertyName(String flexibleName); //========================================================================== // ========= - // Name Map - // ======== - /** - * Get the key-to-lower map of DB name(lower) and property name. - * - * @return The key-to-lower map of DB name(lower) and property name. - * (NotNull) - */ - public Map 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 getPropertyNameDbNameKeyToLowerMap(); - - //========================================================================== - // ========= // Type Name // ========= /** - * Get the type-name of entity. + * Get the type name of entity. * - * @return The type-name of entity. (NotNull) + * @return The type name of entity. (NotNull) */ public String getEntityTypeName(); /** - * Get the type-name of condition-bean. + * Get the type name of condition-bean. * - * @return The type-name of condition-bean. (Nullable: If the condition-bean + * @return The type name of condition-bean. (Nullable: If the condition-bean * does not exist) */ public String getConditionBeanTypeName(); /** - * Get the type-name of dao. + * Get the type name of DAO. * - * @return The type-name of dao. (Nullable: If the dao does not exist) + * @return The type name of DAO. (Nullable: If the DAO does not exist) */ public String getDaoTypeName(); /** - * Get the type-name of behavior. + * Get the type name of behavior. * - * @return The type-name of behavior. (Nullable: If the behavior does not + * @return The type name of behavior. (Nullable: If the behavior does not * exist) */ public String getBehaviorTypeName(); Modified: todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/dbmeta/DBMetaInstanceHandler.java =================================================================== --- todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/dbmeta/DBMetaInstanceHandler.java 2008-12-27 22:20:45 UTC (rev 1632) +++ todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/dbmeta/DBMetaInstanceHandler.java 2008-12-27 22:21:53 UTC (rev 1633) @@ -1,101 +1,85 @@ package jp.sf.pal.todolist.db.allcommon.dbmeta; -import java.util.Collections; -import java.util.LinkedHashMap; +import java.lang.reflect.Method; import java.util.Map; import java.util.Set; +import java.util.concurrent.ConcurrentHashMap; +import jp.sf.pal.todolist.db.allcommon.helper.StringKeyMap; import jp.sf.pal.todolist.db.allcommon.util.SimpleAssertUtil; /** - * DBMeta instance handler. + * The instance handler of DB meta. * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public class DBMetaInstanceHandler { //========================================================================== // ========= // Definition // ========== + /** Log-instance. */ + private static final org.apache.commons.logging.Log _log = org.apache.commons.logging.LogFactory + .getLog(DBMetaInstanceHandler.class); + + //========================================================================== + // ========= + // Resource Map + // ============ /** Table DB-name instance map. */ - protected static final Map _tableDbNameInstanceMap = new LinkedHashMap(); + protected static final Map _tableDbNameInstanceMap = newConcurrentHashMap(); - /** The map of table DB-name and class name. */ - protected static final Map _tableDbNameClassNameMap; - static { - Map tmpMap = new LinkedHashMap(); + /** The map of table DB name and class name. This is for initialization. */ + protected static final Map _tableDbNameClassNameMap = newConcurrentHashMap(); - tmpMap.put("GROUP_INFO", - "jp.sf.pal.todolist.db.bsentity.dbmeta.GroupInfoDbm"); - tmpMap.put("GROUP_MAPPING", - "jp.sf.pal.todolist.db.bsentity.dbmeta.GroupMappingDbm"); - tmpMap.put("ROLE_INFO", - "jp.sf.pal.todolist.db.bsentity.dbmeta.RoleInfoDbm"); - tmpMap.put("ROLE_MAPPING", - "jp.sf.pal.todolist.db.bsentity.dbmeta.RoleMappingDbm"); - tmpMap.put("TODO", "jp.sf.pal.todolist.db.bsentity.dbmeta.TodoDbm"); - tmpMap.put("TODO_CATEGORY", - "jp.sf.pal.todolist.db.bsentity.dbmeta.TodoCategoryDbm"); - tmpMap.put("TODO_MAPPING", - "jp.sf.pal.todolist.db.bsentity.dbmeta.TodoMappingDbm"); - tmpMap.put("USER_INFO", - "jp.sf.pal.todolist.db.bsentity.dbmeta.UserInfoDbm"); + /** The flexible map of table DB name. This is for conversion at finding. */ + protected static final Map _tableDbNameFlexibleMap = StringKeyMap + .createAsFlexibleConcurrent(); - _tableDbNameClassNameMap = Collections.unmodifiableMap(tmpMap); - } + /** The count of setting up resources of DB meta for internal information. */ + protected static int setupCount = 0; - /** The key-to-lower map of DB-name and property-name for table. */ - protected static final Map _tableDbNamePropertyNameKeyToLowerMap; - static { - Map tmpMap = new LinkedHashMap(); - - 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("TODO".toLowerCase(), "todo"); - tmpMap.put("TODO_CATEGORY".toLowerCase(), "todoCategory"); - tmpMap.put("TODO_MAPPING".toLowerCase(), "todoMapping"); - 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 _tablePropertyNameDbNameKeyToLowerMap; - static { - Map tmpMap = new LinkedHashMap(); - - 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("todo".toLowerCase(), "TODO"); - tmpMap.put("todoCategory".toLowerCase(), "TODO_CATEGORY"); - tmpMap.put("todoMapping".toLowerCase(), "TODO_MAPPING"); - tmpMap.put("userInfo".toLowerCase(), "USER_INFO"); - - _tablePropertyNameDbNameKeyToLowerMap = Collections - .unmodifiableMap(tmpMap); - } - - protected static DBMeta getDBMeta(String className) { - try { - Class clazz = Class.forName(className); - java.lang.reflect.Method methoz = clazz.getMethod("getInstance", - (Class[]) null); - Object result = methoz.invoke(null, (Object[]) null); - return (DBMeta) result; - } catch (Exception e) { - throw new RuntimeException(e); + /** + * Set up the resource of DBMeta. Lock this class. + * + * @param tableDbNameClassNameMap The map of table DB name and class name. + * (NotNull) + */ + public static synchronized void setupDBMetaResource( + Map tableDbNameClassNameMap) { + if (tableDbNameClassNameMap == null) { + String msg = "The argument 'tableDbNameClassNameMap' should not be null"; + msg = msg + " at DBMetaInstanceHandler.setupDBMetaResource()"; + throw new IllegalArgumentException(msg); } + if (tableDbNameClassNameMap.isEmpty()) { + String msg = "The argument 'tableDbNameClassNameMap' should not be empty"; + msg = msg + " at DBMetaInstanceHandler.setupDBMetaResource()"; + throw new IllegalArgumentException(msg); + } + final String firstMsg = "...Setting up resources of DB meta"; + final int tableCount = tableDbNameClassNameMap.size(); + if (setupCount == 0) { + _log.info(firstMsg + ": tables=" + tableCount); // basically here + } else { + _log.info(firstMsg + " AGAIN(" + (setupCount + 1) + + " times): tables=" + tableCount); + } + _tableDbNameInstanceMap.clear(); + _tableDbNameClassNameMap.clear(); + _tableDbNameFlexibleMap.clear(); + final Set tableDbNameSet = tableDbNameClassNameMap.keySet(); + for (String tableDbName : tableDbNameSet) { + final String className = tableDbNameClassNameMap.get(tableDbName); + _tableDbNameClassNameMap.put(tableDbName, className); + _tableDbNameFlexibleMap.put(tableDbName, tableDbName); + } + ++setupCount; } /** - * @return The initialized map that contains all instances of dbmeta. + * @return The initialized map that contains all instances of DB meta. * (NotNull & NotEmpty) */ public static Map getDBMetaMap() { @@ -128,45 +112,31 @@ // Main Method // =========== /** - * Find dbmeta by table flexible-name. + * Find DB meta by table flexible name. * *
-     * If the table name is 'ORDER_DETAIL', you can find the dbmeta by ...(as follows)
+     * If the table name is 'ORDER_DETAIL', you can find the DB meta by ...(as follows)
      *     'ORDER_DETAIL', 'ORDer_DeTAiL', 'order_detail'
      *     , 'OrderDetail', 'orderdetail', 'oRderDetaIl'
      * 
* - * @param tableFlexibleName Table flexible-name. (NotNull) - * @return The instance of dbmeta. (NotNull) - * @exception DBMetaNotFoundException When the dbmeta is not found. + * @param tableFlexibleName The flexible name of table. (NotNull) + * @return The instance of DB meta. (NotNull) + * @exception DBMetaNotFoundException When the DB meta is not found. */ public static DBMeta findDBMeta(String tableFlexibleName) { assertStringNotNullAndNotTrimmedEmpty("tableFlexibleName", tableFlexibleName); - if (_tableDbNameInstanceMap.containsKey(tableFlexibleName)) { - return byTableDbName(tableFlexibleName); - } - String toLowerKey = tableFlexibleName.toLowerCase(); - if (_tableDbNamePropertyNameKeyToLowerMap.containsKey(toLowerKey)) { - String propertyName = (String) _tableDbNamePropertyNameKeyToLowerMap - .get(toLowerKey); - String dbName = (String) _tablePropertyNameDbNameKeyToLowerMap - .get(propertyName.toLowerCase()); - return byTableDbName(dbName); - } - if (_tablePropertyNameDbNameKeyToLowerMap.containsKey(toLowerKey)) { - String dbName = (String) _tablePropertyNameDbNameKeyToLowerMap - .get(toLowerKey); - return byTableDbName(dbName); - } final int dotLastIndex = tableFlexibleName.lastIndexOf("."); if (dotLastIndex >= 0) { - try { - return findDBMeta(tableFlexibleName.substring(dotLastIndex + 1)); - } catch (DBMetaNotFoundException e) { - // Nothing - } + tableFlexibleName = tableFlexibleName.substring(dotLastIndex + + ".".length()); } + final String tableDbName = _tableDbNameFlexibleMap + .get(tableFlexibleName); + if (tableDbName != null) { + return byTableDbName(tableDbName); + } String msg = "The instance map returned null by the key: key=" + tableFlexibleName + " instanceMap=" + _tableDbNameInstanceMap; throw new DBMetaNotFoundException(msg); @@ -190,8 +160,9 @@ assertStringNotNullAndNotTrimmedEmpty("tableDbName", tableDbName); DBMeta instance = getCachedDBMeta(tableDbName); if (instance == null) { - String msg = "The instance map returned null by the key: key=" - + tableDbName + " instanceMap=" + _tableDbNameInstanceMap; + String msg = "The instance map returned null by the key:"; + msg = msg + " key=" + tableDbName + " instanceMap=" + + _tableDbNameInstanceMap; throw new DBMetaNotFoundException(msg); } return instance; @@ -213,10 +184,25 @@ return _tableDbNameInstanceMap.get(tableName); } + protected static DBMeta getDBMeta(String className) { + try { + Class clazz = Class.forName(className); + Method methoz = clazz.getMethod("getInstance", (Class[]) null); + Object result = methoz.invoke(null, (Object[]) null); + return (DBMeta) result; + } catch (Exception e) { + throw new RuntimeException(e); + } + } + //========================================================================== // ========= // General Helper // ============== + protected static ConcurrentHashMap newConcurrentHashMap() { + return new ConcurrentHashMap(); + } + // ----------------------------------------------------- // Assert Object // ------------- Modified: todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/dbmeta/hierarchy/HierarchyArranger.java =================================================================== --- todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/dbmeta/hierarchy/HierarchyArranger.java 2008-12-27 22:20:45 UTC (rev 1632) +++ todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/dbmeta/hierarchy/HierarchyArranger.java 2008-12-27 22:21:53 UTC (rev 1633) @@ -222,7 +222,6 @@ * @author DBFlute(AutoGenerator) * @param The type of local entity extends Entity */ - ¡÷ SuppressWarnings("unchecked") public class HierarchyArranger { //========================================================================== @@ -457,9 +456,9 @@ List referrerList = extractReferrerList(localEntity, referrerInfo); if (referrerList == null) { - String msg = "The referrer list should not be null: localEntity=" - + localEntity + " referrerInfo=" + referrerInfo; - throw new IllegalStateException(msg); + // Initialize the list of referrer and inject it. + referrerList = new ArrayList(); + injectReferrerList(localEntity, referrerInfo, referrerList); } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -765,8 +764,8 @@ return capPropReferrerName; } - private java.lang.reflect.Method findMethod(Class clazz, String methodName, - Class[] argTypes) { + private java.lang.reflect.Method findMethod(Class clazz, + String methodName, Class[] argTypes) { try { return clazz.getMethod(methodName, argTypes); } catch (NoSuchMethodException ex) { @@ -852,10 +851,10 @@ return sb.toString(); } - private String createTypeViewFromTypeArray(Class[] array) { + private String createTypeViewFromTypeArray(Class[] array) { final StringBuffer sb = new StringBuffer(); for (int i = 0; i < array.length; i++) { - final Class type = array[i]; + final Class type = array[i]; if (sb.length() == 0) { sb.append(type.getSimpleName()); } else { Modified: todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/dbmeta/hierarchy/HierarchyRequest.java =================================================================== --- todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/dbmeta/hierarchy/HierarchyRequest.java 2008-12-27 22:20:45 UTC (rev 1632) +++ todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/dbmeta/hierarchy/HierarchyRequest.java 2008-12-27 22:21:53 UTC (rev 1633) @@ -16,7 +16,6 @@ * @author DBFlute(AutoGenerator) * @param The type of local entity. */ - ¡÷ SuppressWarnings("unchecked") public class HierarchyRequest { //========================================================================== Modified: todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/dbmeta/hierarchy/HierarchyRequestElement.java =================================================================== --- todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/dbmeta/hierarchy/HierarchyRequestElement.java 2008-12-27 22:20:45 UTC (rev 1632) +++ todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/dbmeta/hierarchy/HierarchyRequestElement.java 2008-12-27 22:21:53 UTC (rev 1633) @@ -9,7 +9,6 @@ /** * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public class HierarchyRequestElement { //========================================================================== Modified: todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/dbmeta/hierarchy/HierarchySourceColumn.java =================================================================== --- todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/dbmeta/hierarchy/HierarchySourceColumn.java 2008-12-27 22:20:45 UTC (rev 1632) +++ todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/dbmeta/hierarchy/HierarchySourceColumn.java 2008-12-27 22:21:53 UTC (rev 1633) @@ -3,7 +3,6 @@ /** * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public interface HierarchySourceColumn { public String getColumnName(); Modified: todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/dbmeta/hierarchy/HierarchySourceIterator.java =================================================================== --- todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/dbmeta/hierarchy/HierarchySourceIterator.java 2008-12-27 22:20:45 UTC (rev 1632) +++ todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/dbmeta/hierarchy/HierarchySourceIterator.java 2008-12-27 22:21:53 UTC (rev 1633) @@ -3,7 +3,6 @@ /** * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public interface HierarchySourceIterator { public boolean hasNext(); Modified: todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/dbmeta/hierarchy/HierarchySourceRow.java =================================================================== --- todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/dbmeta/hierarchy/HierarchySourceRow.java 2008-12-27 22:20:45 UTC (rev 1632) +++ todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/dbmeta/hierarchy/HierarchySourceRow.java 2008-12-27 22:21:53 UTC (rev 1633) @@ -3,7 +3,6 @@ /** * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public interface HierarchySourceRow { public Object extractColumnValue(HierarchySourceColumn columnInfo); Modified: todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/dbmeta/info/ColumnInfo.java =================================================================== --- todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/dbmeta/info/ColumnInfo.java 2008-12-27 22:20:45 UTC (rev 1632) +++ todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/dbmeta/info/ColumnInfo.java 2008-12-27 22:21:53 UTC (rev 1633) @@ -8,7 +8,6 @@ * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public class ColumnInfo { //========================================================================== Modified: todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/dbmeta/info/RelationInfo.java =================================================================== --- todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/dbmeta/info/RelationInfo.java 2008-12-27 22:20:45 UTC (rev 1632) +++ todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/dbmeta/info/RelationInfo.java 2008-12-27 22:21:53 UTC (rev 1633) @@ -1,13 +1,14 @@ package jp.sf.pal.todolist.db.allcommon.dbmeta.info; +import java.util.Map; + import jp.sf.pal.todolist.db.allcommon.dbmeta.DBMeta; /** - * The class of referer information. + * The class of referrer information. * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public interface RelationInfo { public String getRelationPropertyName(); @@ -16,7 +17,7 @@ public DBMeta getTargetDBMeta(); - public java.util.Map getLocalTargetColumnInfoMap(); + public Map getLocalTargetColumnInfoMap(); public boolean isOneToOne(); Modified: todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/helper/MapStringBuilderImpl.java =================================================================== --- todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/helper/MapStringBuilderImpl.java 2008-12-27 22:20:45 UTC (rev 1632) +++ todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/helper/MapStringBuilderImpl.java 2008-12-27 22:21:53 UTC (rev 1633) @@ -1,17 +1,20 @@ package jp.sf.pal.todolist.db.allcommon.helper; +import java.util.Arrays; +import java.util.List; + import jp.sf.pal.todolist.db.allcommon.helper.token.line.LineToken; import jp.sf.pal.todolist.db.allcommon.helper.token.line.LineTokenizingOption; import jp.sf.pal.todolist.db.allcommon.helper.token.line.impl.LineTokenImpl; /** - * The implementation of map-string-builder. + * The implementation of map-string builder. * * @author DBFlute(AutoGenerator) */ public class MapStringBuilderImpl implements MapStringBuilder { - protected java.util.List _columnNameList; + protected List _columnNameList; protected String _msMapMark; @@ -26,10 +29,10 @@ protected boolean _trimDoubleQuotation; public void setColumnNames(String[] columnNames) { - _columnNameList = java.util.Arrays.asList(columnNames); + _columnNameList = Arrays.asList(columnNames); } - public void setColumnNameList(java.util.List columnNameList) { + public void setColumnNameList(List columnNameList) { _columnNameList = columnNameList; } @@ -83,7 +86,7 @@ return sb.toString(); } - public String buildFromList(java.util.List valueList) { + public String buildFromList(List valueList) { if (valueList == null) { String msg = "The argument[valueList] should not be null."; throw new IllegalArgumentException(msg); @@ -103,7 +106,7 @@ return sb.toString(); } - protected java.util.List tokenize(String value, String delimiter) { + protected List tokenize(String value, String delimiter) { final LineToken lineToken = new LineTokenImpl(); final LineTokenizingOption lineTokenizingOption = new LineTokenizingOption(); lineTokenizingOption.setDelimiter(delimiter); @@ -144,8 +147,8 @@ } } - protected void assertColumnValueList(java.util.List columnNameList, - java.util.List valueList) { + protected void assertColumnValueList(List columnNameList, + List valueList) { if (columnNameList.size() != valueList.size()) { String msg = "The length of columnNameList and valueList are difference. (" + columnNameList.size() + ", " + valueList.size() + ")"; Added: todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/helper/StringKeyMap.java =================================================================== --- todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/helper/StringKeyMap.java (rev 0) +++ todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/helper/StringKeyMap.java 2008-12-27 22:21:53 UTC (rev 1633) @@ -0,0 +1,201 @@ +package jp.sf.pal.todolist.db.allcommon.helper; + +import java.util.Collection; +import java.util.HashMap; +import java.util.Map; +import java.util.Set; +import java.util.concurrent.ConcurrentHashMap; + +/** + * @author DBFlute(AutoGenerator) + * @param The type of value. + */ +public class StringKeyMap implements Map { + + //========================================================================== + // ========= + // Attribute + // ========= + protected final Map _internalMap; + + protected boolean _removeUnderscore; + + //========================================================================== + // ========= + // Constructor + // =========== + protected StringKeyMap(boolean removeUnderscore, boolean concurrent) { + _removeUnderscore = removeUnderscore; + if (concurrent) { + _internalMap = newConcurrentHashMap(); + } else { + _internalMap = newHashMap(); + } + } + + public static StringKeyMap createAsFlexible() { + return new StringKeyMap(true, false); + } + + public static StringKeyMap createAsFlexibleConcurrent() { + return new StringKeyMap(true, true); + } + + public static StringKeyMap createAsCaseInsensitive() { + return new StringKeyMap(false, false); + } + + public static StringKeyMap createAsCaseInsensitiveConcurrent() { + return new StringKeyMap(false, true); + } + + //========================================================================== + // ========= + // Map Emulator + // ============ + // ----------------------------------------------------- + // Key Related + // ----------- + public VALUE get(Object key) { + final String stringKey = convertStringKey(key); + if (stringKey != null) { + return _internalMap.get(stringKey); + } + return null; + } + + public VALUE put(String key, VALUE value) { + final String stringKey = convertStringKey(key); + if (stringKey != null) { + return _internalMap.put(stringKey, value); + } + return null; + } + + public VALUE remove(Object key) { + final String stringKey = convertStringKey(key); + if (stringKey != null) { + return _internalMap.remove(stringKey); + } + return null; + } + + public final void putAll(Map map) { + final Set keySet = map.keySet(); + for (String key : keySet) { + put(key, map.get(key)); + } + } + + public boolean containsKey(Object key) { + return get(key) != null; + } + + // ----------------------------------------------------- + // Delegate + // -------- + public void clear() { + _internalMap.clear(); + } + + public int size() { + return _internalMap.size(); + } + + public boolean isEmpty() { + return _internalMap.isEmpty(); + } + + public Set keySet() { + return _internalMap.keySet(); + } + + public Collection values() { + return _internalMap.values(); + } + + public boolean containsValue(Object obj) { + return _internalMap.containsValue(obj); + } + + public Set> entrySet() { + return _internalMap.entrySet(); + } + + //========================================================================== + // ========= + // Key Converter + // ============= + protected String convertStringKey(Object key) { + if (!(key instanceof String)) { + return null; + } + return toLowerCase(removeUnderscore((String) key)); + } + + protected String removeUnderscore(String value) { + if (_removeUnderscore) { + return replace(value, "_", ""); + } + return value; + } + + protected String toLowerCase(String value) { + return value.toLowerCase(); + } + + //========================================================================== + // ========= + // General Helper + // ============== + protected static String replace(String text, String fromText, String toText) { + if (text == null || fromText == null || toText == null) { + return null; + } + StringBuilder sb = new StringBuilder(100); + int pos = 0; + int pos2 = 0; + while (true) { + pos = text.indexOf(fromText, pos2); + if (pos == 0) { + sb.append(toText); + pos2 = fromText.length(); + } else if (pos > 0) { + sb.append(text.substring(pos2, pos)); + sb.append(toText); + pos2 = pos + fromText.length(); + } else { + sb.append(text.substring(pos2)); + break; + } + } + return sb.toString(); + } + + protected static ConcurrentHashMap newConcurrentHashMap() { + return new ConcurrentHashMap(); + } + + protected static HashMap newHashMap() { + return new HashMap(); + } + + //========================================================================== + // ========= + // Basic Override + // ============== + @Override + public boolean equals(Object obj) { + return _internalMap.equals(obj); + } + + @Override + public int hashCode() { + return _internalMap.hashCode(); + } + + @Override + public String toString() { + return _internalMap.toString(); + } +} \ No newline at end of file Property changes on: todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/helper/StringKeyMap.java ___________________________________________________________________ Name: svn:eol-style + native Added: todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/helper/StringSet.java =================================================================== --- todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/helper/StringSet.java (rev 0) +++ todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/helper/StringSet.java 2008-12-27 22:21:53 UTC (rev 1633) @@ -0,0 +1,233 @@ +package jp.sf.pal.todolist.db.allcommon.helper; + +import java.util.Collection; +import java.util.HashMap; +import java.util.Iterator; +import java.util.Map; +import java.util.Set; +import java.util.concurrent.ConcurrentHashMap; + +/** + * @author DBFlute(AutoGenerator) + */ +public class StringSet implements Set { + + //========================================================================== + // ========= + // Definition + // ========== + protected static final Object DUMMY_VALUE = new Object(); + + //========================================================================== + // ========= + // Attribute + // ========= + protected final Map _internalMap; + + protected boolean _removeUnderscore; + + //========================================================================== + // ========= + // Constructor + // =========== + protected StringSet(boolean removeUnderscore, boolean concurrent) { + _removeUnderscore = removeUnderscore; + if (concurrent) { + _internalMap = newConcurrentHashMap(); + } else { + _internalMap = newHashMap(); + } + } + + public static StringSet createAsFlexible() { + return new StringSet(true, false); + } + + public static StringSet createAsFlexibleConcurrent() { + return new StringSet(true, true); + } + + public static StringSet createAsCaseInsensitive() { + return new StringSet(false, false); + } + + public static StringSet createAsCaseInsensitiveConcurrent() { + return new StringSet(false, true); + } + + //========================================================================== + // ========= + // Map Emulator + // ============ + // ----------------------------------------------------- + // Key Related + // ----------- + public boolean add(String value) { + final String stringValue = convertStringKey(value); + if (stringValue != null) { + return _internalMap.put(stringValue, DUMMY_VALUE) != null; + } + return false; + } + + public boolean remove(Object value) { + final String stringValue = convertStringKey(value); + if (stringValue != null) { + return _internalMap.remove(stringValue) != null; + } + return false; + } + + public boolean contains(Object value) { + final String stringValue = convertStringKey(value); + if (stringValue != null) { + return _internalMap.containsKey(stringValue); + } + return false; + } + + // ----------------------------------------------------- + // Delegate + // -------- + public void clear() { + _internalMap.clear(); + } + + public int size() { + return _internalMap.size(); + } + + public boolean isEmpty() { + return _internalMap.isEmpty(); + } + + public boolean addAll(Collection c) { + boolean success = false; + for (String s : c) { + if (add(s)) { + success = true; + } + } + return success; + } + + public boolean removeAll(Collection c) { + boolean success = false; + for (Object s : c) { + if (remove(s)) { + success = true; + } + } + return success; + } + + public boolean containsAll(Collection c) { + for (Object s : c) { + if (contains(s)) { + return true; + } + } + return false; + } + + public Iterator iterator() { + return _internalMap.keySet().iterator(); + } + + public boolean retainAll(Collection c) { + boolean success = false; + for (Object s : c) { + if (!contains(s)) { + if (remove(s)) { + success = true; + } + } + } + return success; + } + + public Object[] toArray() { + return _internalMap.keySet().toArray(); + } + + public T[] toArray(T[] a) { + return _internalMap.keySet().toArray(a); + } + + //========================================================================== + // ========= + // Key Converter + // ============= + protected String convertStringKey(Object value) { + if (!(value instanceof String)) { + return null; + } + return toLowerCase(removeUnderscore((String) value)); + } + + protected String removeUnderscore(String value) { + if (_removeUnderscore) { + return replace(value, "_", ""); + } + return value; + } + + protected String toLowerCase(String value) { + return value.toLowerCase(); + } + + //========================================================================== + // ========= + // General Helper + // ============== + protected static String replace(String text, String fromText, String toText) { + if (text == null || fromText == null || toText == null) { + return null; + } + StringBuilder sb = new StringBuilder(100); + int pos = 0; + int pos2 = 0; + while (true) { + pos = text.indexOf(fromText, pos2); + if (pos == 0) { + sb.append(toText); + pos2 = fromText.length(); + } else if (pos > 0) { + sb.append(text.substring(pos2, pos)); + sb.append(toText); + pos2 = pos + fromText.length(); + } else { + sb.append(text.substring(pos2)); + break; + } + } + return sb.toString(); + } + + protected static ConcurrentHashMap newConcurrentHashMap() { + return new ConcurrentHashMap(); + } + + protected static HashMap newHashMap() { + return new HashMap(); + } + + //========================================================================== + // ========= + // Basic Override + // ============== + @Override + public boolean equals(Object obj) { + return _internalMap.keySet().equals(obj); + } + + @Override + public int hashCode() { + return _internalMap.keySet().hashCode(); + } + + @Override + public String toString() { + return _internalMap.keySet().toString(); + } +} \ No newline at end of file Property changes on: todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/helper/StringSet.java ___________________________________________________________________ Name: svn:eol-style + native Added: todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/s2dao/BeanMetaDataFactoryExtension.java =================================================================== --- todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/s2dao/BeanMetaDataFactoryExtension.java (rev 0) +++ todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/s2dao/BeanMetaDataFactoryExtension.java 2008-12-27 22:21:53 UTC (rev 1633) @@ -0,0 +1,213 @@ +package jp.sf.pal.todolist.db.allcommon.s2dao; + +import java.sql.DatabaseMetaData; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.concurrent.ConcurrentHashMap; + +import jp.sf.pal.todolist.db.allcommon.Entity; +import jp.sf.pal.todolist.db.allcommon.s2dao.internal.various.InternalIdentifierGeneratorFactory; + +import org.seasar.dao.BeanMetaData; +import org.seasar.dao.IdentifierGenerator; +import org.seasar.dao.impl.BeanMetaDataFactoryImpl; +import org.seasar.dao.impl.BeanMetaDataImpl; +import org.seasar.extension.jdbc.PropertyType; +import org.seasar.framework.beans.PropertyDesc; + +/** + * BeanMetaDataFactoryImpl for DBFlute. + * + * @author DBFlute(AutoGenerator) + */ + ¡÷ SuppressWarnings("unchecked") +public class BeanMetaDataFactoryExtension extends BeanMetaDataFactoryImpl { + + //========================================================================== + // ========= + // Attribute + // ========= + /** The map of bean meta data for cache. */ + protected Map, BeanMetaData> _metaMap = newConcurrentHashMap(); + + //========================================================================== + // ========= + // Override for Cache + // ================== + @Override + public BeanMetaData createBeanMetaData(Class beanClass) { + final BeanMetaData cachedMeta = findCachedMeta(beanClass); + if (cachedMeta != null) { + return cachedMeta; + } else { + return super.createBeanMetaData(beanClass); + } + } + + @Override + public BeanMetaData createBeanMetaData(Class beanClass, + int relationNestLevel) { + final BeanMetaData cachedMeta = findCachedMeta(beanClass); + if (cachedMeta != null) { + return cachedMeta; + } else { + return super.createBeanMetaData(beanClass, relationNestLevel); + } + } + + @Override + public BeanMetaData createBeanMetaData(DatabaseMetaData dbMetaData, + Class beanClass, int relationNestLevel) { + final BeanMetaData cachedMeta = findOrCreateCachedMetaIfNeeds( + dbMetaData, beanClass, relationNestLevel); + if (cachedMeta != null) { + return cachedMeta; + } else { + return super.createBeanMetaData(dbMetaData, beanClass, + relationNestLevel); + } + } + + protected BeanMetaData findCachedMeta(Class beanClass) { + if (isDBFluteEntity(beanClass)) { + final BeanMetaData cachedMeta = getMetaFromCache(beanClass); + if (cachedMeta != null) { + return cachedMeta; + } + } + return null; + } + + protected BeanMetaData findOrCreateCachedMetaIfNeeds( + DatabaseMetaData dbMetaData, Class beanClass, int relationNestLevel) { + if (isDBFluteEntity(beanClass)) { + final BeanMetaData cachedMeta = getMetaFromCache(beanClass); + if (cachedMeta != null) { + return cachedMeta; + } else { + return super.createBeanMetaData(dbMetaData, beanClass, 0); + } + } + return null; + } + + //========================================================================== + // ========= + // BeanMetaData Creation + // ===================== + @Override + protected BeanMetaDataImpl createBeanMetaDataImpl() { + // /= = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = + // = = + // for ConditionBean and insert() and update() and delete() and so on... + // = = = = = = = = = =/ + return new BeanMetaDataImpl() { + protected List _internalIdentifierGeneratorList = new ArrayList(); + + protected Map _internalIdentifierGeneratorsByPropertyName = newConcurrentHashMap(); + + // /= = = = = = = + // for cache + // = = = = =/ + @Override + public void initialize() { // for Cache + final Class myBeanClass = getBeanClass(); + if (isDBFluteEntity(myBeanClass)) { + final BeanMetaData cachedMeta = getMetaFromCache(myBeanClass); + if (cachedMeta == null) { + _metaMap.put(myBeanClass, this); + } + } + super.initialize(); + } + + // /= = = = = = = + // for insert() + // = = = = =/ + // The attributes 'identifierGenerators' and + // 'identifierGeneratorsByPropertyName' + // of super class are unused. It prepares original atributes here. + @Override + protected void setupIdentifierGenerator(PropertyType propertyType) { + final PropertyDesc pd = propertyType.getPropertyDesc(); + final String propertyName = propertyType.getPropertyName(); + final String idType = beanAnnotationReader.getId(pd, getDbms()); + final IdentifierGenerator generator = createInternalIdentifierGenerator( + propertyType, idType); + _internalIdentifierGeneratorList.add(generator); + _internalIdentifierGeneratorsByPropertyName.put(propertyName, + generator); + } + + protected IdentifierGenerator createInternalIdentifierGenerator( + PropertyType propertyType, String idType) { + return InternalIdentifierGeneratorFactory + .createIdentifierGenerator(propertyType, getDbms(), + idType); + } + + @Override + public IdentifierGenerator getIdentifierGenerator(int index) { + return _internalIdentifierGeneratorList.get(index); + } + + @Override + public int getIdentifierGeneratorSize() { + return _internalIdentifierGeneratorList.size(); + } + + @Override + public IdentifierGenerator getIdentifierGenerator( + String propertyName) { + return _internalIdentifierGeneratorsByPropertyName + .get(propertyName); + } + }; + } + + // /= = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = + // Other extension points about BeanMetaDataImpl is as follows: + // + // S2DaoMetaDataExtension.createNonConcurrencyBmdFactory() + // --> for NonConcurrency (updateNonstrict() and deleteNonstrict() and so + // on...) + // + // S2DaoMetaDataExtension.createOutsideSqlCustomizeBeanMetaDataFactory() + // --> for OutsideSql but it overrides nothing. + // = = = = = = = = = =/ + + //========================================================================== + // ========= + // Relation Next Level + // =================== + /** + * Get the limit nest level of relation. + * + * @return The limit nest level of relation. + */ + @Override + protected int getLimitRelationNestLevel() { + return 2; // for Compatible to old version DBFlute + } + + //========================================================================== + // ========= + // General Helper + // ============== + protected ConcurrentHashMap newConcurrentHashMap() { + return new ConcurrentHashMap(); + } + + //========================================================================== + // ========= + // Assist Helper + // ============= + protected boolean isDBFluteEntity(Class beanClass) { + return Entity.class.isAssignableFrom(beanClass); + } + + protected BeanMetaData getMetaFromCache(Class beanClass) { + return _metaMap.get(beanClass); + } +} \ No newline at end of file Property changes on: todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/s2dao/BeanMetaDataFactoryExtension.java ___________________________________________________________________ Name: svn:eol-style + native Modified: todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/s2dao/FetchNarrowingResultSetWrapper.java =================================================================== --- todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/s2dao/FetchNarrowingResultSetWrapper.java 2008-12-27 22:20:45 UTC (rev 1632) +++ todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/s2dao/FetchNarrowingResultSetWrapper.java 2008-12-27 22:21:53 UTC (rev 1633) @@ -4,6 +4,7 @@ import java.sql.SQLException; import java.sql.Statement; +import jp.sf.pal.todolist.db.allcommon.DBDef; import jp.sf.pal.todolist.db.allcommon.cbean.FetchNarrowingBean; import jp.sf.pal.todolist.db.allcommon.s2dao.internal.sqlhandler.InternalBasicHandler.SQLExceptionHandler; @@ -41,6 +42,9 @@ /** Does it skip to cursor end? */ protected boolean _skipToCursorEnd; + /** Is the database DB2? */ + protected final boolean _db2 = DBDef.isCurrentDef(DBDef.DB2); + //========================================================================== // ========= // Constructor @@ -71,7 +75,7 @@ // Skip // ==== /** - * Skip to start-index. + * Skip to the point at start index. */ protected void skip() { if (!isAvailableSkipRecord()) { @@ -125,12 +129,15 @@ // Next // ==== /** - * Next. + * Move to the next record. * * @return Does the result set have next record? * @throws SQLException */ public boolean next() throws SQLException { + if (_db2 && _skipToCursorEnd) { // [DBFLUTE-243] + return false; + } final boolean hasNext = super.next(); ++_requestCounter; if (!isAvailableLimitLoopCount()) { Added: todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/s2dao/PropertyTypeFactoryBuilderExtension.java =================================================================== --- todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/s2dao/PropertyTypeFactoryBuilderExtension.java (rev 0) +++ todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/s2dao/PropertyTypeFactoryBuilderExtension.java 2008-12-27 22:21:53 UTC (rev 1633) @@ -0,0 +1,215 @@ +package jp.sf.pal.todolist.db.allcommon.s2dao; + +import java.sql.DatabaseMetaData; +import java.util.ArrayList; +import java.util.List; + +import jp.sf.pal.todolist.db.allcommon.Entity; +import jp.sf.pal.todolist.db.allcommon.dbmeta.DBMeta; + +import org.seasar.dao.BeanAnnotationReader; +import org.seasar.dao.ColumnNaming; +import org.seasar.dao.Dbms; +import org.seasar.dao.PropertyTypeFactory; +import org.seasar.dao.PropertyTypeFactoryBuilder; +import org.seasar.dao.ValueTypeFactory; +import org.seasar.dao.impl.AbstractPropertyTypeFactory; +import org.seasar.extension.jdbc.PropertyType; +import org.seasar.framework.beans.BeanDesc; +import org.seasar.framework.beans.PropertyDesc; + +/** + * The factory builder of property type for S2Dao. {Since S2Dao-1.0.47} + * + * @author DBFlute(AutoGenerator) + */ + ¡÷ SuppressWarnings("unchecked") +public class PropertyTypeFactoryBuilderExtension implements + PropertyTypeFactoryBuilder { + + //========================================================================== + // ========= + // Attribute + // ========= + protected ValueTypeFactory valueTypeFactory; + + protected ColumnNaming columnNaming; + + //========================================================================== + // ========= + // Build + // ===== + public PropertyTypeFactory build(Class beanClass, + BeanAnnotationReader beanAnnotationReader) { + return new FastPropertyTypeFactoryExtension(beanClass, + beanAnnotationReader, valueTypeFactory, columnNaming); + } + + public PropertyTypeFactory build(Class beanClass, + BeanAnnotationReader beanAnnotationReader, Dbms dbms, + DatabaseMetaData databaseMetaData) { + return new FastPropertyTypeFactoryExtension(beanClass, + beanAnnotationReader, valueTypeFactory, columnNaming, dbms); + } + + //========================================================================== + // ========= + // Extension Class + // =============== + protected static class FastPropertyTypeFactoryExtension extends + AbstractPropertyTypeFactory { + + protected DBMeta _dbmeta; + + protected String[] _noPersisteneProps; + + public FastPropertyTypeFactoryExtension(Class beanClass, + BeanAnnotationReader beanAnnotationReader, + ValueTypeFactory valueTypeFactory, ColumnNaming columnNaming) { + super(beanClass, beanAnnotationReader, valueTypeFactory, + columnNaming); + initializeResources(); + } + + public FastPropertyTypeFactoryExtension(Class beanClass, + BeanAnnotationReader beanAnnotationReader, + ValueTypeFactory valueTypeFactory, ColumnNaming columnNaming, + Dbms dbms) { + super(beanClass, beanAnnotationReader, valueTypeFactory, + columnNaming, dbms); + initializeResources(); + } + + protected void initializeResources() { + if (isEntity()) { + _dbmeta = findDBMeta(); + } + _noPersisteneProps = beanAnnotationReader.getNoPersisteneProps(); + } + + protected boolean isEntity() { + return Entity.class.isAssignableFrom(beanClass); + } + + protected boolean hasDBMeta() { + return _dbmeta != null; + } + + protected DBMeta findDBMeta() { + try { + final Entity entity = (Entity) beanClass.newInstance(); + return entity.getDBMeta(); + } catch (Exception e) { + String msg = "beanClass.newInstance() threw the exception: beanClass=" + + beanClass; + throw new RuntimeException(msg, e); + } + } + + public PropertyType[] createBeanPropertyTypes(String tableName) { + final List list = new ArrayList(); + final BeanDesc beanDesc = getBeanDesc(); + for (int i = 0; i < beanDesc.getPropertyDescSize(); ++i) { + final PropertyDesc pd = beanDesc.getPropertyDesc(i); + + // Read-only property is unnecessary! + if (!pd.hasWriteMethod()) { + continue; + } + + // Relation property is unnecessary! + if (isRelation(pd)) { + continue; + } + + final PropertyType pt = createPropertyType(pd); + pt.setPrimaryKey(isPrimaryKey(pd)); + pt.setPersistent(isPersistent(pt)); + list.add(pt); + } + return list.toArray(new PropertyType[list.size()]); + } + + @Override + protected boolean isRelation(PropertyDesc propertyDesc) { + final String propertyName = propertyDesc.getPropertyName(); + if (hasDBMeta() + && (_dbmeta.hasForeign(propertyName) || _dbmeta + .hasReferrer(propertyName))) { + return true; + } + return hasRelationNoAnnotation(propertyDesc); + } + + protected boolean hasRelationNoAnnotation(PropertyDesc propertyDesc) { + return beanAnnotationReader.hasRelationNo(propertyDesc); + } + + @Override + protected boolean isPrimaryKey(PropertyDesc propertyDesc) { + final String propertyName = propertyDesc.getPropertyName(); + if (hasDBMeta() && _dbmeta.hasPrimaryKey() + && _dbmeta.hasColumn(propertyName)) { + if (_dbmeta.findColumnInfo(propertyName).isPrimary()) { + return true; + } + } + return hasIdAnnotation(propertyDesc); + } + + protected boolean hasIdAnnotation(PropertyDesc propertyDesc) { + final Dbms dbms = getDbms(); + return beanAnnotationReader.getId(propertyDesc, dbms) != null; + } + + @Override + protected boolean isPersistent(PropertyType propertyType) { + final String propertyName = propertyType.getPropertyName(); + final PropertyDesc propertyDesc = propertyType.getPropertyDesc(); + if ((hasDBMeta() && _dbmeta.hasColumn(propertyName)) + || hasColumnAnnotation(propertyDesc)) { + if (!isElementOfNoPersistentProps(propertyDesc)) { + return true; + } + } + return false; + } + + protected boolean hasColumnAnnotation(PropertyDesc propertyDesc) { + return beanAnnotationReader.getColumnAnnotation(propertyDesc) != null; + } + + protected boolean isElementOfNoPersistentProps(PropertyDesc propertyDesc) { + final String propertyName = propertyDesc.getPropertyName(); + final String[] props = _noPersisteneProps; + if (props != null && props.length >= 0) { + for (int i = 0; i < props.length; ++i) { + if (props[i].equals(propertyName)) { + return true; + } + } + } + return false; + } + } + + //========================================================================== + // ========= + // Accessor + // ======== + public ValueTypeFactory getValueTypeFactory() { + return valueTypeFactory; + } + + public void setValueTypeFactory(ValueTypeFactory valueTypeFactory) { + this.valueTypeFactory = valueTypeFactory; + } + + public ColumnNaming getColumnNaming() { + return columnNaming; + } + + public void setColumnNaming(ColumnNaming columnNaming) { + this.columnNaming = columnNaming; + } +} Added: todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/s2dao/SqlLogRegistryLatestSqlProvider.java =================================================================== --- todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/s2dao/SqlLogRegistryLatestSqlProvider.java (rev 0) +++ todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/s2dao/SqlLogRegistryLatestSqlProvider.java 2008-12-27 22:21:53 UTC (rev 1633) @@ -0,0 +1,21 @@ +package jp.sf.pal.todolist.db.allcommon.s2dao; + +import jp.sf.pal.todolist.db.allcommon.jdbc.LatestSqlProvider; +import jp.sf.pal.todolist.db.allcommon.s2dao.internal.sqllog.InternalSqlLogRegistry; + +/** + * The provider of latest SQL using SqlLogRegistry. This instance should be + * singleton. + * + * @author DBFlute(AutoGenerator) + */ +public class SqlLogRegistryLatestSqlProvider implements LatestSqlProvider { + + public String getDisplaySql() { + return InternalSqlLogRegistry.peekCompleteSql(); + } + + public void clearSqlCache() { + InternalSqlLogRegistry.clearSqlLogRegistry(); + } +} Property changes on: todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/s2dao/SqlLogRegistryLatestSqlProvider.java ___________________________________________________________________ Name: svn:eol-style + native Modified: todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/s2dao/internal/rshandler/InternalAbstractDtoMetaDataResultSetHandler.java =================================================================== --- todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/s2dao/internal/rshandler/InternalAbstractDtoMetaDataResultSetHandler.java 2008-12-27 22:20:45 UTC (rev 1632) +++ todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/s2dao/internal/rshandler/InternalAbstractDtoMetaDataResultSetHandler.java 2008-12-27 22:21:53 UTC (rev 1633) @@ -6,10 +6,11 @@ import java.util.Map; import java.util.Set; +import jp.sf.pal.todolist.db.allcommon.helper.StringSet; + import org.seasar.dao.DtoMetaData; import org.seasar.dao.RowCreator; import org.seasar.extension.jdbc.ResultSetHandler; -import org.seasar.framework.util.CaseInsensitiveSet; /** * @author DBFlute(AutoGenerator) @@ -67,10 +68,10 @@ return rowCreator.createRow(rs, propertyCache, beanClass); } - protected Set createColumnNames(final ResultSetMetaData rsmd) + protected Set createColumnNames(final ResultSetMetaData rsmd) throws SQLException { final int count = rsmd.getColumnCount(); - final Set columnNames = new CaseInsensitiveSet(); + final Set columnNames = StringSet.createAsCaseInsensitive(); for (int i = 0; i < count; ++i) { final String columnName = rsmd.getColumnLabel(i + 1); final int pos = columnName.lastIndexOf('.'); // [DAO-41] Modified: todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/s2dao/internal/sqlcommand/InternalAbstractAutoStaticCommand.java =================================================================== --- todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/s2dao/internal/sqlcommand/InternalAbstractAutoStaticCommand.java 2008-12-27 22:20:45 UTC (rev 1632) +++ todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/s2dao/internal/sqlcommand/InternalAbstractAutoStaticCommand.java 2008-12-27 22:21:53 UTC (rev 1633) @@ -10,7 +10,6 @@ import org.seasar.dao.BeanMetaData; import org.seasar.dao.IdentifierGenerator; -import org.seasar.dao.NotSingleRowUpdatedRuntimeException; import org.seasar.dao.PrimaryKeyNotFoundRuntimeException; import org.seasar.extension.jdbc.PropertyType; import org.seasar.extension.jdbc.StatementFactory; @@ -24,19 +23,13 @@ //========================================================================== // ========= - // Definition - // ========== - protected static final boolean DEFAULT_VERSION_NO_AUTO_INCREMENT_ON_MEMORY = true; - - //========================================================================== - // ========= // Attribute // ========= private PropertyType[] propertyTypes; - private boolean checkSingleRowUpdate = true; + protected boolean optimisticLockHandling; - protected boolean versionNoAutoIncrementOnMemory = DEFAULT_VERSION_NO_AUTO_INCREMENT_ON_MEMORY; + protected boolean versionNoAutoIncrementOnMemory; //========================================================================== // ========= @@ -44,15 +37,10 @@ // =========== public InternalAbstractAutoStaticCommand(DataSource dataSource, StatementFactory statementFactory, BeanMetaData beanMetaData, - String[] propertyNames) { - this(dataSource, statementFactory, beanMetaData, propertyNames, - DEFAULT_VERSION_NO_AUTO_INCREMENT_ON_MEMORY); - } - - public InternalAbstractAutoStaticCommand(DataSource dataSource, - StatementFactory statementFactory, BeanMetaData beanMetaData, - String[] propertyNames, boolean versionNoAutoIncrementOnMemory) { + String[] propertyNames, boolean optimisticLockHandling, + boolean versionNoAutoIncrementOnMemory) { super(dataSource, statementFactory, beanMetaData); + this.optimisticLockHandling = optimisticLockHandling; this.versionNoAutoIncrementOnMemory = versionNoAutoIncrementOnMemory; setupPropertyTypes(propertyNames); setupSql(); @@ -62,26 +50,19 @@ // ========= // Execute // ======= - public Object execute(Object[] args) { + public Object execute(Object[] args) { // NOT for Batch. Batch should + // override. InternalAbstractAutoHandler handler = createAutoHandler(); + handler.setOptimisticLockHandling(optimisticLockHandling); + handler + .setVersionNoAutoIncrementOnMemory(versionNoAutoIncrementOnMemory); handler.setSql(getSql()); handler.setLoggingMessageSqlArgs(args); int rows = handler.execute(args); - if (isCheckSingleRowUpdate() && rows != 1) { - throw createNotSingleRowUpdatedRuntimeException(args[0], rows); - } return new Integer(rows); } - public boolean isCheckSingleRowUpdate() { - return checkSingleRowUpdate; - } - - public void setCheckSingleRowUpdate(boolean checkSingleRowUpdate) { - this.checkSingleRowUpdate = checkSingleRowUpdate; - } - - protected NotSingleRowUpdatedRuntimeException createNotSingleRowUpdatedRuntimeException( + protected EntityAlreadyUpdatedException createEntityAlreadyUpdatedException( Object bean, int rows) { return new EntityAlreadyUpdatedException(bean, rows); } @@ -194,7 +175,7 @@ protected void setupDeleteSql() { checkPrimaryKey(); - StringBuilder sb = new StringBuilder(100); + final StringBuilder sb = new StringBuilder(100); sb.append("delete from "); sb.append(getBeanMetaData().getTableName()); setupUpdateWhere(sb); @@ -215,11 +196,11 @@ sb.append(bmd.getPrimaryKey(i)).append(" = ? and "); } sb.setLength(sb.length() - 5); - if (bmd.hasVersionNoPropertyType()) { + if (optimisticLockHandling && bmd.hasVersionNoPropertyType()) { PropertyType pt = bmd.getVersionNoPropertyType(); sb.append(" and ").append(pt.getColumnName()).append(" = ?"); } - if (bmd.hasTimestampPropertyType()) { + if (optimisticLockHandling && bmd.hasTimestampPropertyType()) { PropertyType pt = bmd.getTimestampPropertyType(); sb.append(" and ").append(pt.getColumnName()).append(" = ?"); } Modified: todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/s2dao/internal/sqlcommand/InternalAbstractBatchAutoStaticCommand.java =================================================================== --- todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/s2dao/internal/sqlcommand/InternalAbstractBatchAutoStaticCommand.java 2008-12-27 22:20:45 UTC (rev 1632) +++ todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/s2dao/internal/sqlcommand/InternalAbstractBatchAutoStaticCommand.java 2008-12-27 22:21:53 UTC (rev 1633) @@ -15,49 +15,30 @@ //========================================================================== // ========= - // Attribute - // ========= - protected final boolean returningRows; - - //========================================================================== - // ========= // Constructor // =========== public InternalAbstractBatchAutoStaticCommand(DataSource dataSource, StatementFactory statementFactory, BeanMetaData beanMetaData, - String[] propertyNames, boolean returningRows) { - this(dataSource, statementFactory, beanMetaData, propertyNames, - returningRows, DEFAULT_VERSION_NO_AUTO_INCREMENT_ON_MEMORY); - } - - public InternalAbstractBatchAutoStaticCommand(DataSource dataSource, - StatementFactory statementFactory, BeanMetaData beanMetaData, - String[] propertyNames, boolean returningRows, + String[] propertyNames, boolean optimisticLockHandling, boolean versionNoAutoIncrementOnMemory) { super(dataSource, statementFactory, beanMetaData, propertyNames, - versionNoAutoIncrementOnMemory); - this.returningRows = returningRows; + optimisticLockHandling, versionNoAutoIncrementOnMemory); } //========================================================================== // ========= // Execute // ======= + @Override public Object execute(Object[] args) { final InternalAbstractBatchAutoHandler handler = createBatchAutoHandler(); - - // It is unnecessary! - // injectDaoClass(handler); - + handler.setOptimisticLockHandling(optimisticLockHandling); + handler + .setVersionNoAutoIncrementOnMemory(versionNoAutoIncrementOnMemory); handler.setSql(getSql()); // The logging message SQL of procedure is unnecessary. // handler.setLoggingMessageSqlArgs(args); - if (this.returningRows) { - return handler.executeBatch(args); - } else { - final int updatedRows = handler.execute(args); - return new Integer(updatedRows); - } + return handler.executeBatch(args); } protected abstract InternalAbstractBatchAutoHandler createBatchAutoHandler(); Modified: todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/s2dao/internal/sqlcommand/InternalAbstractDynamicCommand.java =================================================================== --- todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/s2dao/internal/sqlcommand/InternalAbstractDynamicCommand.java 2008-12-27 22:20:45 UTC (rev 1632) +++ todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/s2dao/internal/sqlcommand/InternalAbstractDynamicCommand.java 2008-12-27 22:21:53 UTC (rev 1633) @@ -44,10 +44,15 @@ } protected InternalSqlParser createInternalSqlParser(String sql) { - return new InternalSqlParser(sql); + return new InternalSqlParser(sql, isBlockNullParameter()); } - public CommandContext apply(Object[] args) {// It is necessary to be public! + protected boolean isBlockNullParameter() { // Extension Point! + return false; + } + + public CommandContext apply(Object[] args) { // It is necessary to be + // public! final CommandContext ctx = createCommandContext(args); rootNode.accept(ctx); return ctx; Modified: todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/s2dao/internal/sqlcommand/InternalAbstractSqlCommand.java =================================================================== --- todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/s2dao/internal/sqlcommand/InternalAbstractSqlCommand.java 2008-12-27 22:20:45 UTC (rev 1632) +++ todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/s2dao/internal/sqlcommand/InternalAbstractSqlCommand.java 2008-12-27 22:21:53 UTC (rev 1633) @@ -2,13 +2,16 @@ import javax.sql.DataSource; +import jp.sf.pal.todolist.db.allcommon.bhv.core.SqlExecution; + import org.seasar.dao.SqlCommand; import org.seasar.extension.jdbc.StatementFactory; /** * @author DBFlute(AutoGenerator) */ -public abstract class InternalAbstractSqlCommand implements SqlCommand { +public abstract class InternalAbstractSqlCommand implements SqlCommand, + SqlExecution { //========================================================================== // ========= Modified: todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/s2dao/internal/sqlcommand/InternalDeleteAutoStaticCommand.java =================================================================== --- todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/s2dao/internal/sqlcommand/InternalDeleteAutoStaticCommand.java 2008-12-27 22:20:45 UTC (rev 1632) +++ todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/s2dao/internal/sqlcommand/InternalDeleteAutoStaticCommand.java 2008-12-27 22:21:53 UTC (rev 1633) @@ -20,8 +20,9 @@ // =========== public InternalDeleteAutoStaticCommand(DataSource dataSource, StatementFactory statementFactory, BeanMetaData beanMetaData, - String[] propertyNames) { - super(dataSource, statementFactory, beanMetaData, propertyNames); + String[] propertyNames, boolean optimisticLockHandling) { + super(dataSource, statementFactory, beanMetaData, propertyNames, + optimisticLockHandling, false); } //========================================================================== Modified: todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/s2dao/internal/sqlcommand/InternalDeleteBatchAutoStaticCommand.java =================================================================== --- todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/s2dao/internal/sqlcommand/InternalDeleteBatchAutoStaticCommand.java 2008-12-27 22:20:45 UTC (rev 1632) +++ todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/s2dao/internal/sqlcommand/InternalDeleteBatchAutoStaticCommand.java 2008-12-27 22:21:53 UTC (rev 1633) @@ -21,9 +21,9 @@ // =========== public InternalDeleteBatchAutoStaticCommand(DataSource dataSource, StatementFactory statementFactory, BeanMetaData beanMetaData, - String[] propertyNames, boolean returningRows) { + String[] propertyNames, boolean optimisticLockHandling) { super(dataSource, statementFactory, beanMetaData, propertyNames, - returningRows); + optimisticLockHandling, false); } //========================================================================== Modified: todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/s2dao/internal/sqlcommand/InternalDeleteQueryAutoDynamicCommand.java =================================================================== --- todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/s2dao/internal/sqlcommand/InternalDeleteQueryAutoDynamicCommand.java 2008-12-27 22:20:45 UTC (rev 1632) +++ todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/s2dao/internal/sqlcommand/InternalDeleteQueryAutoDynamicCommand.java 2008-12-27 22:21:53 UTC (rev 1633) @@ -2,6 +2,7 @@ import javax.sql.DataSource; +import jp.sf.pal.todolist.db.allcommon.bhv.core.SqlExecution; import jp.sf.pal.todolist.db.allcommon.cbean.ConditionBean; import jp.sf.pal.todolist.db.allcommon.s2dao.internal.sqlhandler.InternalCommandContextHandler; import jp.sf.pal.todolist.db.allcommon.s2dao.internal.sqlparser.InternalCommandContextCreator; @@ -16,7 +17,8 @@ /** * @author DBFlute(AutoGenerator) */ -public class InternalDeleteQueryAutoDynamicCommand implements SqlCommand { +public class InternalDeleteQueryAutoDynamicCommand implements SqlCommand, + SqlExecution { //========================================================================== // ========= @@ -83,7 +85,7 @@ String[] argNames, Class[] argTypes, Object[] args) { CommandContext context; { - InternalSqlParser parser = new InternalSqlParser(twoWaySql); + InternalSqlParser parser = new InternalSqlParser(twoWaySql, true); Node node = parser.parse(); InternalCommandContextCreator creator = new InternalCommandContextCreator( argNames, argTypes); Modified: todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/s2dao/internal/sqlcommand/InternalInsertAutoDynamicCommand.java =================================================================== --- todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/s2dao/internal/sqlcommand/InternalInsertAutoDynamicCommand.java 2008-12-27 22:20:45 UTC (rev 1632) +++ todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/s2dao/internal/sqlcommand/InternalInsertAutoDynamicCommand.java 2008-12-27 22:21:53 UTC (rev 1633) @@ -5,11 +5,11 @@ import javax.sql.DataSource; +import jp.sf.pal.todolist.db.allcommon.bhv.core.SqlExecution; import jp.sf.pal.todolist.db.allcommon.s2dao.internal.sqlhandler.InternalInsertAutoHandler; import org.seasar.dao.BeanMetaData; import org.seasar.dao.IdentifierGenerator; -import org.seasar.dao.NotSingleRowUpdatedRuntimeException; import org.seasar.dao.SqlCommand; import org.seasar.extension.jdbc.PropertyType; import org.seasar.extension.jdbc.StatementFactory; @@ -18,7 +18,8 @@ /** * @author DBFlute(AutoGenerator) */ -public class InternalInsertAutoDynamicCommand implements SqlCommand { +public class InternalInsertAutoDynamicCommand implements SqlCommand, + SqlExecution { //========================================================================== // ========= @@ -32,8 +33,6 @@ protected String[] propertyNames; - protected boolean checkSingleRowUpdate = true; - //========================================================================== // ========= // Constructor @@ -56,9 +55,6 @@ handler.setSql(sql); handler.setLoggingMessageSqlArgs(args); final int rows = handler.execute(args); - if (isCheckSingleRowUpdate() && rows != 1) { - throw new NotSingleRowUpdatedRuntimeException(args[0], rows); - } return new Integer(rows); } @@ -161,12 +157,4 @@ public void setPropertyNames(String[] propertyNames) { this.propertyNames = propertyNames; } - - public boolean isCheckSingleRowUpdate() { - return checkSingleRowUpdate; - } - - public void setCheckSingleRowUpdate(boolean checkSingleRowUpdate) { - this.checkSingleRowUpdate = checkSingleRowUpdate; - } } Modified: todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/s2dao/internal/sqlcommand/InternalInsertBatchAutoStaticCommand.java =================================================================== --- todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/s2dao/internal/sqlcommand/InternalInsertBatchAutoStaticCommand.java 2008-12-27 22:20:45 UTC (rev 1632) +++ todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/s2dao/internal/sqlcommand/InternalInsertBatchAutoStaticCommand.java 2008-12-27 22:21:53 UTC (rev 1633) @@ -21,9 +21,9 @@ // =========== public InternalInsertBatchAutoStaticCommand(DataSource dataSource, StatementFactory statementFactory, BeanMetaData beanMetaData, - String[] propertyNames, boolean returningRows) { - super(dataSource, statementFactory, beanMetaData, propertyNames, - returningRows); + String[] propertyNames) { + super(dataSource, statementFactory, beanMetaData, propertyNames, false, + false); } //========================================================================== Modified: todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/s2dao/internal/sqlcommand/InternalProcedureCommand.java =================================================================== --- todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/s2dao/internal/sqlcommand/InternalProcedureCommand.java 2008-12-27 22:20:45 UTC (rev 1632) +++ todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/s2dao/internal/sqlcommand/InternalProcedureCommand.java 2008-12-27 22:21:53 UTC (rev 1633) @@ -2,6 +2,7 @@ import javax.sql.DataSource; +import jp.sf.pal.todolist.db.allcommon.bhv.core.SqlExecution; import jp.sf.pal.todolist.db.allcommon.cbean.outsidesql.OutsideSqlContext; import jp.sf.pal.todolist.db.allcommon.s2dao.internal.sqlhandler.InternalProcedureHandler; import jp.sf.pal.todolist.db.allcommon.s2dao.internal.various.InternalProcedureMetaData; @@ -13,7 +14,7 @@ /** * @author DBFlute(AutoGenerator) */ -public class InternalProcedureCommand implements SqlCommand { +public class InternalProcedureCommand implements SqlCommand, SqlExecution { //========================================================================== // ========= Modified: todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/s2dao/internal/sqlcommand/InternalUpdateAutoDynamicCommand.java =================================================================== --- todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/s2dao/internal/sqlcommand/InternalUpdateAutoDynamicCommand.java 2008-12-27 22:20:45 UTC (rev 1632) +++ todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/s2dao/internal/sqlcommand/InternalUpdateAutoDynamicCommand.java 2008-12-27 22:21:53 UTC (rev 1633) @@ -5,29 +5,27 @@ import javax.sql.DataSource; +import jp.sf.pal.todolist.db.allcommon.XLog; import jp.sf.pal.todolist.db.allcommon.s2dao.internal.sqlhandler.InternalUpdateAutoHandler; import org.seasar.dao.BeanMetaData; import org.seasar.dao.NoUpdatePropertyTypeRuntimeException; -import org.seasar.dao.impl.AbstractSqlCommand; import org.seasar.extension.jdbc.PropertyType; import org.seasar.extension.jdbc.StatementFactory; /** * @author DBFlute(AutoGenerator) */ -public class InternalUpdateAutoDynamicCommand extends AbstractSqlCommand { +public class InternalUpdateAutoDynamicCommand extends + InternalAbstractSqlCommand { //========================================================================== // ========= // Definition // ========== - /** Log instance. */ - private static final org.apache.commons.logging.Log _log = org.apache.commons.logging.LogFactory - .getLog(InternalUpdateAutoDynamicCommand.class); + /** The result for no update as normal execution. */ + private static final Integer NO_UPDATE = new Integer(1); - private static final Integer NO_UPDATE = new Integer(0); - //========================================================================== // ========= // Attribute @@ -36,9 +34,9 @@ private String[] propertyNames; - private boolean checkSingleRowUpdate = true; + private boolean optimisticLockHandling; - private boolean versionNoAutoIncrementOnMemory = true; + private boolean versionNoAutoIncrementOnMemory; //========================================================================== // ========= @@ -59,8 +57,8 @@ final PropertyType[] propertyTypes = createUpdatePropertyTypes(bmd, bean, getPropertyNames()); if (propertyTypes.length == 0) { - if (_log.isDebugEnabled()) { - _log.debug(createNoUpdateLogMessage(bean, bmd)); + if (isLogEnabled()) { + log(createNoUpdateLogMessage(bean, bmd)); } return NO_UPDATE; } @@ -83,10 +81,10 @@ BeanMetaData bmd, PropertyType[] propertyTypes) { InternalUpdateAutoHandler handler = new InternalUpdateAutoHandler( getDataSource(), getStatementFactory(), bmd, propertyTypes); + handler.setOptimisticLockHandling(optimisticLockHandling); //[DBFlute-0.8 + // .0] handler .setVersionNoAutoIncrementOnMemory(versionNoAutoIncrementOnMemory); - handler.setCheckSingleRowUpdate(isCheckSingleRowUpdate()); //[DBFlute-0.8 - // .0] return handler; } @@ -182,17 +180,33 @@ sb.append(bmd.getPrimaryKey(i)).append(" = ? and "); } sb.setLength(sb.length() - 5); - if (bmd.hasVersionNoPropertyType()) { + if (optimisticLockHandling && bmd.hasVersionNoPropertyType()) { PropertyType pt = bmd.getVersionNoPropertyType(); sb.append(" and ").append(pt.getColumnName()).append(" = ?"); } - if (bmd.hasTimestampPropertyType()) { + if (optimisticLockHandling && bmd.hasTimestampPropertyType()) { PropertyType pt = bmd.getTimestampPropertyType(); sb.append(" and ").append(pt.getColumnName()).append(" = ?"); } return sb.toString(); } + //========================================================================== + // ========= + // Execute Status Log + // ================== + protected void log(String msg) { + XLog.log(msg); + } + + protected boolean isLogEnabled() { + return XLog.isLogEnabled(); + } + + //========================================================================== + // ========= + // Accessor + // ======== protected boolean isVersionNoAutoIncrementOnMemory() { return versionNoAutoIncrementOnMemory; } @@ -223,11 +237,7 @@ this.propertyNames = propertyNames; } - public boolean isCheckSingleRowUpdate() { - return checkSingleRowUpdate; + public void setOptimisticLockHandling(boolean optimisticLockHandling) { + this.optimisticLockHandling = optimisticLockHandling; } - - public void setCheckSingleRowUpdate(boolean resultCheck) { - this.checkSingleRowUpdate = resultCheck; - } } Modified: todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/s2dao/internal/sqlcommand/InternalUpdateBatchAutoStaticCommand.java =================================================================== --- todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/s2dao/internal/sqlcommand/InternalUpdateBatchAutoStaticCommand.java 2008-12-27 22:20:45 UTC (rev 1632) +++ todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/s2dao/internal/sqlcommand/InternalUpdateBatchAutoStaticCommand.java 2008-12-27 22:21:53 UTC (rev 1633) @@ -21,10 +21,10 @@ // =========== public InternalUpdateBatchAutoStaticCommand(DataSource dataSource, StatementFactory statementFactory, BeanMetaData beanMetaData, - String[] propertyNames, boolean returningRows, + String[] propertyNames, boolean optimisticLockHandling, boolean versionNoAutoIncrementOnMemory) { super(dataSource, statementFactory, beanMetaData, propertyNames, - returningRows, versionNoAutoIncrementOnMemory); + optimisticLockHandling, versionNoAutoIncrementOnMemory); } //========================================================================== Modified: todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/s2dao/internal/sqlcommand/InternalUpdateDynamicCommand.java =================================================================== --- todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/s2dao/internal/sqlcommand/InternalUpdateDynamicCommand.java 2008-12-27 22:20:45 UTC (rev 1632) +++ todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/s2dao/internal/sqlcommand/InternalUpdateDynamicCommand.java 2008-12-27 22:21:53 UTC (rev 1633) @@ -28,11 +28,16 @@ // ======= public Object execute(Object args[]) { final CommandContext ctx = apply(args); - final InternalBasicUpdateHandler updateHandler = new InternalBasicUpdateHandler( - getDataSource(), ctx.getSql(), getStatementFactory()); - Object[] bindVariables = ctx.getBindVariables(); + final InternalBasicUpdateHandler updateHandler = createBasicUpdateHandler(ctx); + final Object[] bindVariables = ctx.getBindVariables(); updateHandler.setLoggingMessageSqlArgs(bindVariables); return new Integer(updateHandler.execute(bindVariables, ctx .getBindVariableTypes())); } + + protected InternalBasicUpdateHandler createBasicUpdateHandler( + CommandContext ctx) { + return new InternalBasicUpdateHandler(getDataSource(), ctx.getSql(), + getStatementFactory()); + } } Modified: todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/s2dao/internal/sqlcommand/InternalUpdateQueryAutoDynamicCommand.java =================================================================== --- todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/s2dao/internal/sqlcommand/InternalUpdateQueryAutoDynamicCommand.java 2008-12-27 22:20:45 UTC (rev 1632) +++ todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/s2dao/internal/sqlcommand/InternalUpdateQueryAutoDynamicCommand.java 2008-12-27 22:21:53 UTC (rev 1633) @@ -10,6 +10,7 @@ import javax.sql.DataSource; import jp.sf.pal.todolist.db.allcommon.Entity; +import jp.sf.pal.todolist.db.allcommon.bhv.core.SqlExecution; import jp.sf.pal.todolist.db.allcommon.cbean.ConditionBean; import jp.sf.pal.todolist.db.allcommon.dbmeta.DBMeta; import jp.sf.pal.todolist.db.allcommon.dbmeta.DBMetaInstanceHandler; @@ -27,7 +28,8 @@ /** * @author DBFlute(AutoGenerator) */ -public class InternalUpdateQueryAutoDynamicCommand implements SqlCommand { +public class InternalUpdateQueryAutoDynamicCommand implements SqlCommand, + SqlExecution { //========================================================================== // ========= @@ -209,7 +211,7 @@ String[] argNames, Class[] argTypes, Object[] args) { CommandContext context; { - InternalSqlParser parser = new InternalSqlParser(twoWaySql); + InternalSqlParser parser = new InternalSqlParser(twoWaySql, true); Node node = parser.parse(); InternalCommandContextCreator creator = new InternalCommandContextCreator( argNames, argTypes); Modified: todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/s2dao/internal/sqlhandler/InternalAbstractAutoHandler.java =================================================================== --- todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/s2dao/internal/sqlhandler/InternalAbstractAutoHandler.java 2008-12-27 22:20:45 UTC (rev 1632) +++ todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/s2dao/internal/sqlhandler/InternalAbstractAutoHandler.java 2008-12-27 22:21:53 UTC (rev 1633) @@ -10,12 +10,14 @@ import javax.sql.DataSource; +import jp.sf.pal.todolist.db.allcommon.exception.EntityAlreadyUpdatedException; +import jp.sf.pal.todolist.db.allcommon.util.SimpleTypeUtil; + import org.seasar.dao.BeanMetaData; import org.seasar.extension.jdbc.PropertyType; import org.seasar.extension.jdbc.StatementFactory; import org.seasar.extension.jdbc.ValueType; import org.seasar.framework.beans.PropertyDesc; -import org.seasar.framework.util.IntegerConversionUtil; /** * @author DBFlute(AutoGenerator) @@ -38,8 +40,10 @@ protected PropertyType[] propertyTypes; - protected boolean versionNoAutoIncrementOnMemory = true; + protected boolean optimisticLockHandling; + protected boolean versionNoAutoIncrementOnMemory; + //========================================================================== // ========= // Constructor @@ -52,6 +56,10 @@ this.propertyTypes = propertyTypes; } + //========================================================================== + // ========= + // Execute + // ======= public int execute(Object[] args) { Connection connection = getConnection(); try { @@ -77,6 +85,9 @@ } finally { close(ps); } + if (optimisticLockHandling && ret != 1) { + throw createEntityAlreadyUpdatedException(bean, ret); + } postUpdateBean(bean, ret); return ret; } @@ -96,12 +107,25 @@ } } + protected EntityAlreadyUpdatedException createEntityAlreadyUpdatedException( + Object bean, int rows) { + return new EntityAlreadyUpdatedException(bean, rows); + } + + //========================================================================== + // ========= + // Pre/Post Bean + // ============= protected void preUpdateBean(Object bean) { } protected void postUpdateBean(Object bean, int ret) { } + //========================================================================== + // ========= + // Bind Setupper + // ============= protected abstract void setupBindVariables(Object bean); protected void setupInsertBindVariables(Object bean) { @@ -149,7 +173,7 @@ if (value == null) { continue;// because of 'VERSION_NO = VERSION_NO + 1' } - int intValue = IntegerConversionUtil.toPrimitiveInt(value) + 1; + int intValue = SimpleTypeUtil.toPrimitiveInt(value) + 1; setVersionNo(new Integer(intValue)); varList.add(getVersionNo()); } else { @@ -182,13 +206,13 @@ varList.add(pd.getValue(bean)); varValueTypeList.add(pt.getValueType()); } - if (bmd.hasVersionNoPropertyType()) { + if (optimisticLockHandling && bmd.hasVersionNoPropertyType()) { PropertyType pt = bmd.getVersionNoPropertyType(); PropertyDesc pd = pt.getPropertyDesc(); varList.add(pd.getValue(bean)); varValueTypeList.add(pt.getValueType()); } - if (bmd.hasTimestampPropertyType()) { + if (optimisticLockHandling && bmd.hasTimestampPropertyType()) { PropertyType pt = bmd.getTimestampPropertyType(); PropertyDesc pd = pt.getPropertyDesc(); varList.add(pd.getValue(bean)); @@ -260,6 +284,14 @@ this.propertyTypes = propertyTypes; } + public boolean isOptimisticLockHandling() { + return optimisticLockHandling; + } + + public void setOptimisticLockHandling(boolean optimisticLockHandling) { + this.optimisticLockHandling = optimisticLockHandling; + } + protected boolean isVersionNoAutoIncrementOnMemory() { return versionNoAutoIncrementOnMemory; } Modified: todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/s2dao/internal/sqlhandler/InternalAbstractBatchAutoHandler.java =================================================================== --- todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/s2dao/internal/sqlhandler/InternalAbstractBatchAutoHandler.java 2008-12-27 22:20:45 UTC (rev 1632) +++ todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/s2dao/internal/sqlhandler/InternalAbstractBatchAutoHandler.java 2008-12-27 22:21:53 UTC (rev 1633) @@ -9,6 +9,11 @@ import javax.sql.DataSource; +import jp.sf.pal.todolist.db.allcommon.DBDef; +import jp.sf.pal.todolist.db.allcommon.exception.BatchEntityAlreadyUpdatedException; +import jp.sf.pal.todolist.db.allcommon.exception.EntityAlreadyDeletedException; +import jp.sf.pal.todolist.db.allcommon.exception.EntityDuplicatedException; + import org.seasar.dao.BeanMetaData; import org.seasar.extension.jdbc.PropertyType; import org.seasar.extension.jdbc.StatementFactory; @@ -41,6 +46,39 @@ // ========= // Execute // ======= + public int execute(Object[] args) { + List list = null; + if (args[0] instanceof Object[]) { + list = Arrays.asList((Object[]) args[0]); + } else if (args[0] instanceof List) { + list = (List) args[0]; + } + if (list == null) { + throw new IllegalArgumentException("args[0]"); + } + int[] ret = execute(list); + int updatedRow = 0; + for (int i = 0; i < ret.length; i++) { + if (ret[i] > 0) { + updatedRow += ret[i]; + } + } + return updatedRow; + } + + public int[] executeBatch(Object[] args) { + List list = null; + if (args[0] instanceof Object[]) { + list = Arrays.asList((Object[]) args[0]); + } else if (args[0] instanceof List) { + list = (List) args[0]; + } + if (list == null) { + throw new IllegalArgumentException("args[0]"); + } + return execute(list); + } + public int[] execute(List list, Class[] argTypes) { return execute(list); } @@ -63,7 +101,9 @@ final Object bean = (Object) iter.next(); prepareBatchElement(ps, bean); } - return executeBatch(ps, list); + final int[] result = executeBatch(ps, list); + handleBatchUpdateResultWithOptimisticLock(ps, list, result); + return result; } finally { close(ps); } @@ -74,46 +114,100 @@ // postBatchUpdateBean(...); } - public int execute(Object[] args) { - List list = null; - if (args[0] instanceof Object[]) { - list = Arrays.asList((Object[]) args[0]); - } else if (args[0] instanceof List) { - list = (List) args[0]; + protected void prepareBatchElement(PreparedStatement ps, Object bean) { + setupBindVariables(bean); + logSql(getBindVariables(), getArgTypes(getBindVariables())); + bindArgs(ps, getBindVariables(), getBindVariableValueTypes()); + addBatch(ps); + } + + //========================================================================== + // ========= + // Optimistic Lock + // =============== + protected void handleBatchUpdateResultWithOptimisticLock( + PreparedStatement ps, List list, int[] result) { + if (DBDef.isCurrentDef(DBDef.Oracle)) { + final int updateCount; + try { + updateCount = ps.getUpdateCount(); + } catch (SQLException e) { + handleSQLException(e, ps); + return; // Unreachable! + } + handleBatchUpdateResultWithOptimisticLockByUpdateCount(list, + updateCount); + } else { + handleBatchUpdateResultWithOptimisticLockByResult(list, result); } - if (list == null) { - throw new IllegalArgumentException("args[0]"); + } + + protected void handleBatchUpdateResultWithOptimisticLockByUpdateCount( + List list, int updateCount) { + if (list.isEmpty()) { + return;// for Safety! } - int[] ret = execute(list); - int updatedRow = 0; - for (int i = 0; i < ret.length; i++) { - if (ret[i] > 0) { - updatedRow += ret[i]; + if (updateCount < 0) { + return;// for Safety! + } + final int entityCount = list.size(); + if (updateCount < entityCount) { + if (isOptimisticLockHandling()) { + throw new BatchEntityAlreadyUpdatedException(list.get(0), 0, + updateCount); + } else { + String msg = "The entity have already deleted:"; + msg = msg + " updateCount=" + updateCount; + msg = msg + " entityCount=" + entityCount; + msg = msg + " allEntities=" + list; + throw new EntityAlreadyDeletedException(msg); } } - return updatedRow; } - public int[] executeBatch(Object[] args) { - List list = null; - if (args[0] instanceof Object[]) { - list = Arrays.asList((Object[]) args[0]); - } else if (args[0] instanceof List) { - list = (List) args[0]; + protected void handleBatchUpdateResultWithOptimisticLockByResult( + List list, int[] result) { + if (list.isEmpty()) { + return;// for Safety! } - if (list == null) { - throw new IllegalArgumentException("args[0]"); + final int[] updatedCountArray = result; + final int entityCount = list.size(); + int index = 0; + boolean alreadyUpdated = false; + for (int oneUpdateCount : updatedCountArray) { + if (entityCount <= index) { + break;// for Safety! + } + if (oneUpdateCount == 0) { + alreadyUpdated = true; + break; + } else if (oneUpdateCount > 1) { + String msg = "The entity updated two or more records in batch update:"; + msg = msg + " entity=" + list.get(index); + msg = msg + " updatedCount=" + oneUpdateCount; + msg = msg + " allEntities=" + list; + throw new EntityDuplicatedException(msg); + } + ++index; } - return execute(list); + if (alreadyUpdated) { + int updateCount = 0; + for (int oneUpdateCount : updatedCountArray) { + updateCount = updateCount + oneUpdateCount; + } + if (isOptimisticLockHandling()) { + throw new BatchEntityAlreadyUpdatedException(list.get(index), + 0, updateCount); + } else { + String msg = "The entity have already deleted:"; + msg = msg + " entity=" + list.get(index); + msg = msg + " updateCount=" + updateCount; + msg = msg + " allEntities=" + list; + throw new EntityAlreadyDeletedException(msg); + } + } } - protected void prepareBatchElement(PreparedStatement ps, Object bean) { - setupBindVariables(bean); - logSql(getBindVariables(), getArgTypes(getBindVariables())); - bindArgs(ps, getBindVariables(), getBindVariableValueTypes()); - addBatch(ps); - } - //========================================================================== // ========= // JDBC Delegator Modified: todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/s2dao/internal/sqlhandler/InternalBasicHandler.java =================================================================== --- todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/s2dao/internal/sqlhandler/InternalBasicHandler.java 2008-12-27 22:20:45 UTC (rev 1632) +++ todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/s2dao/internal/sqlhandler/InternalBasicHandler.java 2008-12-27 22:21:53 UTC (rev 1633) @@ -9,6 +9,7 @@ import javax.sql.DataSource; import jp.sf.pal.todolist.db.allcommon.CallbackContext; +import jp.sf.pal.todolist.db.allcommon.DBDef; import jp.sf.pal.todolist.db.allcommon.DBFluteConfig; import jp.sf.pal.todolist.db.allcommon.InternalMapContext; import jp.sf.pal.todolist.db.allcommon.QLog; @@ -25,7 +26,6 @@ import org.seasar.extension.jdbc.StatementFactory; import org.seasar.extension.jdbc.ValueType; import org.seasar.extension.jdbc.types.ValueTypes; -import org.seasar.framework.exception.SQLRuntimeException; /** * @author DBFlute(AutoGenerator) @@ -73,7 +73,7 @@ return; } for (int i = 0; i < args.length; ++i) { - ValueType valueType = getValueType(argTypes[i]); + final ValueType valueType = findValueType(args[i], argTypes[i]); try { valueType.bindValue(ps, i + 1, args[i]); } catch (SQLException e) { @@ -82,6 +82,19 @@ } } + protected ValueType findValueType(Object arg, Class argType) { + ValueType valueType = ValueTypes.getValueType(arg); + if (valueType != null) { + return valueType; + } + valueType = ValueTypes.getValueType(argType); + if (valueType != null) { + return valueType; + } + String msg = "Unknown type¡§argType=" + argType + " args=" + arg; + throw new IllegalStateException(msg); + } + protected Class[] getArgTypes(Object[] args) { if (args == null) { return null; @@ -151,10 +164,6 @@ return InternalBindVariableUtil.getBindVariableText(bindVariable); } - protected ValueType getValueType(Class clazz) { - return ValueTypes.getValueType(clazz); - } - //========================================================================== // ========= // Exception Handler @@ -194,9 +203,6 @@ public void handleSQLException(SQLException e, Statement statement, boolean uniqueConstraintValid, String completeSql) { - if (isSqlExceptionOldStyleHandling()) { - throw new SQLRuntimeException(e); - } if (uniqueConstraintValid && isUniqueConstraintException(e)) { throwEntityAlreadyExistsException(e, statement, completeSql); } @@ -217,10 +223,6 @@ .getUniqueConstraintDeterminator(); } - protected boolean isSqlExceptionOldStyleHandling() { - return DBFluteConfig.getInstance().isSqlExceptionOldStyleHandling(); - } - protected void throwEntityAlreadyExistsException(SQLException e, Statement statement, String completeSql) { String msg = "Look! Read the message below." + getLineSeparator(); @@ -560,7 +562,7 @@ // ========= // Assist Helper // ============= - // It needs this method if the target database doest not support line + // It needs this method if the target database does not support line // comment. protected String removeLineComment(final String sql) { // With removing CR! if (sql == null || sql.trim().length() == 0) { @@ -578,7 +580,8 @@ } sb.append(line).append("\n"); } - return sb.toString(); + final String filteredSql = sb.toString(); + return filteredSql.substring(0, filteredSql.lastIndexOf("\n")); } //========================================================================== @@ -606,9 +609,17 @@ } public void setSql(String sql) { + if (isRemoveLineCommentFromSql()) { + sql = removeLineComment(sql); + } this.sql = sql; } + protected boolean isRemoveLineCommentFromSql() { + // Because the MS-Access does not support line comments. + return DBDef.isCurrentDef(DBDef.MSAccess); + } + public StatementFactory getStatementFactory() { return statementFactory; } Modified: todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/s2dao/internal/sqlhandler/InternalBasicSelectHandler.java =================================================================== --- todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/s2dao/internal/sqlhandler/InternalBasicSelectHandler.java 2008-12-27 22:20:45 UTC (rev 1632) +++ todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/s2dao/internal/sqlhandler/InternalBasicSelectHandler.java 2008-12-27 22:21:53 UTC (rev 1633) @@ -45,8 +45,7 @@ return execute(args, getArgTypes(args)); } - @SuppressWarnings("unchecked") - public Object execute(Object[] args, Class[] argTypes) { + public Object execute(Object[] args, Class[] argTypes) { Connection conn = getConnection(); try { return execute(conn, args, argTypes); @@ -55,8 +54,7 @@ } } - @SuppressWarnings("unchecked") - public Object execute(Connection conn, Object[] args, Class[] argTypes) { + public Object execute(Connection conn, Object[] args, Class[] argTypes) { logSql(args, argTypes); PreparedStatement ps = null; try { Modified: todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/s2dao/internal/sqlhandler/InternalBasicUpdateHandler.java =================================================================== --- todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/s2dao/internal/sqlhandler/InternalBasicUpdateHandler.java 2008-12-27 22:20:45 UTC (rev 1632) +++ todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/s2dao/internal/sqlhandler/InternalBasicUpdateHandler.java 2008-12-27 22:21:53 UTC (rev 1633) @@ -29,8 +29,7 @@ return execute(args, getArgTypes(args)); } - @SuppressWarnings("unchecked") - public int execute(Object[] args, Class[] argTypes) { + public int execute(Object[] args, Class[] argTypes) { Connection connection = getConnection(); try { return execute(connection, args, argTypes); @@ -39,8 +38,7 @@ } } - @SuppressWarnings("unchecked") - public int execute(Connection connection, Object[] args, Class[] argTypes) { + public int execute(Connection connection, Object[] args, Class[] argTypes) { logSql(args, argTypes); PreparedStatement ps = prepareStatement(connection); try { Modified: todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/s2dao/internal/sqlhandler/InternalInsertAutoHandler.java =================================================================== --- todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/s2dao/internal/sqlhandler/InternalInsertAutoHandler.java 2008-12-27 22:20:45 UTC (rev 1632) +++ todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/s2dao/internal/sqlhandler/InternalInsertAutoHandler.java 2008-12-27 22:21:53 UTC (rev 1633) @@ -20,6 +20,7 @@ StatementFactory statementFactory, BeanMetaData beanMetaData, PropertyType[] propertyTypes) { super(dataSource, statementFactory, beanMetaData, propertyTypes); + setOptimisticLockHandling(false); } //========================================================================== Modified: todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/s2dao/internal/sqlhandler/InternalInsertBatchAutoHandler.java =================================================================== --- todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/s2dao/internal/sqlhandler/InternalInsertBatchAutoHandler.java 2008-12-27 22:20:45 UTC (rev 1632) +++ todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/s2dao/internal/sqlhandler/InternalInsertBatchAutoHandler.java 2008-12-27 22:21:53 UTC (rev 1633) @@ -19,8 +19,8 @@ public InternalInsertBatchAutoHandler(DataSource dataSource, StatementFactory statementFactory, BeanMetaData beanMetaData, PropertyType[] propertyTypes) { - super(dataSource, statementFactory, beanMetaData, propertyTypes); + setOptimisticLockHandling(false); } //========================================================================== Modified: todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/s2dao/internal/sqlhandler/InternalProcedureHandler.java =================================================================== --- todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/s2dao/internal/sqlhandler/InternalProcedureHandler.java 2008-12-27 22:20:45 UTC (rev 1632) +++ todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/s2dao/internal/sqlhandler/InternalProcedureHandler.java 2008-12-27 22:21:53 UTC (rev 1633) @@ -12,6 +12,7 @@ import javax.sql.DataSource; +import jp.sf.pal.todolist.db.allcommon.helper.StringKeyMap; import jp.sf.pal.todolist.db.allcommon.s2dao.internal.various.InternalProcedureMetaData; import jp.sf.pal.todolist.db.allcommon.s2dao.internal.various.InternalProcedureParameterType; @@ -21,7 +22,6 @@ import org.seasar.extension.jdbc.ValueType; import org.seasar.extension.jdbc.impl.PropertyTypeImpl; import org.seasar.extension.jdbc.types.ValueTypes; -import org.seasar.framework.util.CaseInsensitiveMap; /** * @author DBFlute(AutoGenerator) @@ -220,10 +220,9 @@ protected static abstract class InternalAbstractMapResultSetHandler implements ResultSetHandler { - @SuppressWarnings("unchecked") protected Map createRow(ResultSet rs, PropertyType[] propertyTypes) throws SQLException { - Map row = new CaseInsensitiveMap(); + Map row = StringKeyMap.createAsFlexible(); for (int i = 0; i < propertyTypes.length; ++i) { Object value = propertyTypes[i].getValueType().getValue(rs, i + 1); Modified: todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/s2dao/internal/sqlhandler/InternalUpdateAutoHandler.java =================================================================== --- todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/s2dao/internal/sqlhandler/InternalUpdateAutoHandler.java 2008-12-27 22:20:45 UTC (rev 1632) +++ todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/s2dao/internal/sqlhandler/InternalUpdateAutoHandler.java 2008-12-27 22:21:53 UTC (rev 1633) @@ -2,8 +2,6 @@ import javax.sql.DataSource; -import jp.sf.pal.todolist.db.allcommon.exception.EntityAlreadyUpdatedException; - import org.seasar.dao.BeanMetaData; import org.seasar.extension.jdbc.PropertyType; import org.seasar.extension.jdbc.StatementFactory; @@ -17,12 +15,6 @@ // ========= // Constructor // =========== - private boolean checkSingleRowUpdate = true; - - //========================================================================== - // ========= - // Constructor - // =========== public InternalUpdateAutoHandler(DataSource dataSource, StatementFactory statementFactory, BeanMetaData beanMetaData, PropertyType[] propertyTypes) { @@ -41,27 +33,7 @@ @Override protected void postUpdateBean(Object bean, int ret) { - if (isCheckSingleRowUpdate() && ret < 1) { - throw createEntityAlreadyUpdatedException(bean, ret); - } updateVersionNoIfNeed(bean); updateTimestampIfNeed(bean); } - - protected EntityAlreadyUpdatedException createEntityAlreadyUpdatedException( - Object bean, int rows) { - return new EntityAlreadyUpdatedException(bean, rows); - } - - //========================================================================== - // ========= - // Accessor - // ======== - public boolean isCheckSingleRowUpdate() { - return checkSingleRowUpdate; - } - - public void setCheckSingleRowUpdate(boolean resultCheck) { - this.checkSingleRowUpdate = resultCheck; - } } Modified: todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/s2dao/internal/sqlparser/InternalSqlParser.java =================================================================== --- todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/s2dao/internal/sqlparser/InternalSqlParser.java 2008-12-27 22:20:45 UTC (rev 1632) +++ todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/s2dao/internal/sqlparser/InternalSqlParser.java 2008-12-27 22:21:53 UTC (rev 1633) @@ -45,22 +45,25 @@ // ========= // Attribute // ========= + protected String specifiedSql; + + protected boolean blockNullParameter; + protected InternalSqlTokenizer tokenizer; protected Stack nodeStack = new Stack(); - protected String specifiedSql;// Extension! - //========================================================================== // ========= // Constructor // =========== - public InternalSqlParser(String sql) { + public InternalSqlParser(String sql, boolean blockNullParameter) { sql = sql.trim(); if (sql.endsWith(";")) { sql = sql.substring(0, sql.length() - 1); } - specifiedSql = sql;// Extension! + specifiedSql = sql; + this.blockNullParameter = blockNullParameter; tokenizer = new InternalSqlTokenizer(sql); } @@ -303,12 +306,14 @@ protected AbstractNode createBindVariableNode(String expr, String testValue) {// Extension // ! - return new InternalBindVariableNode(expr, testValue, specifiedSql); + return new InternalBindVariableNode(expr, testValue, specifiedSql, + blockNullParameter); } protected AbstractNode createEmbeddedValueNode(String expr, String testValue) {// Extension // ! - return new InternalEmbeddedValueNode(expr, testValue, specifiedSql); + return new InternalEmbeddedValueNode(expr, testValue, specifiedSql, + blockNullParameter); } protected ContainerNode createIfNode(String expr) {// Extension! @@ -344,12 +349,15 @@ protected String _specifiedSql; + protected boolean _blockNullParameter; + public InternalBindVariableNode(String expression, String testValue, - String specifiedSql) { + String specifiedSql, boolean blockNullParameter) { this._expression = expression; this._testValue = testValue; this._names = InternalStringUtil.split(expression, "."); this._specifiedSql = specifiedSql; + this._blockNullParameter = blockNullParameter; } public void accept(CommandContext ctx) { @@ -360,7 +368,7 @@ valueAndType.setTargetType(clazz); setupValueAndType(valueAndType); - if (valueAndType.getTargetValue() == null) { + if (_blockNullParameter && valueAndType.getTargetValue() == null) { throwBindOrEmbeddedParameterNullValueException(valueAndType); } if (!isInScope()) { @@ -462,12 +470,15 @@ protected String _specifiedSql; + protected boolean _blockNullParameter; + public InternalEmbeddedValueNode(String expression, String testValue, - String specifiedSql) { + String specifiedSql, boolean blockNullParameter) { this._expression = expression; this._testValue = testValue; this._names = InternalStringUtil.split(expression, "."); this._specifiedSql = specifiedSql; + this._blockNullParameter = blockNullParameter; } public void accept(CommandContext ctx) { @@ -478,7 +489,7 @@ valueAndType.setTargetType(clazz); setupValueAndType(valueAndType); - if (valueAndType.getTargetValue() == null) { + if (_blockNullParameter && valueAndType.getTargetValue() == null) { throwBindOrEmbeddedParameterNullValueException(valueAndType); } if (!isInScope()) { @@ -1276,7 +1287,8 @@ String[] argNames, Class[] argTypes, Object[] args) { final CommandContext context; { - final InternalSqlParser parser = new InternalSqlParser(twoWaySql); + final InternalSqlParser parser = new InternalSqlParser(twoWaySql, + false); final Node node = parser.parse(); final InternalCommandContextCreator creator = new InternalCommandContextCreator( argNames, argTypes); Added: todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/s2dao/internal/various/InternalIdentifierAbstractGenerator.java =================================================================== --- todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/s2dao/internal/various/InternalIdentifierAbstractGenerator.java (rev 0) +++ todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/s2dao/internal/various/InternalIdentifierAbstractGenerator.java 2008-12-27 22:21:53 UTC (rev 1633) @@ -0,0 +1,146 @@ +package jp.sf.pal.todolist.db.allcommon.s2dao.internal.various; + +import java.sql.CallableStatement; +import java.sql.Connection; +import java.sql.PreparedStatement; +import java.sql.ResultSet; +import java.sql.SQLException; +import java.sql.Statement; + +import javax.sql.DataSource; + +import jp.sf.pal.todolist.db.allcommon.s2dao.internal.sqlhandler.InternalBasicSelectHandler; +import jp.sf.pal.todolist.db.allcommon.s2dao.internal.sqlhandler.InternalBasicHandler.SQLExceptionHandler; + +import org.seasar.dao.Dbms; +import org.seasar.dao.IdentifierGenerator; +import org.seasar.extension.jdbc.PropertyType; +import org.seasar.extension.jdbc.ResultSetHandler; +import org.seasar.extension.jdbc.StatementFactory; +import org.seasar.extension.jdbc.ValueType; +import org.seasar.framework.beans.PropertyDesc; + +/** + * @author DBFlute(AutoGenerator) + */ +public abstract class InternalIdentifierAbstractGenerator implements + IdentifierGenerator { + + //========================================================================== + // ========= + // Attribute + // ========= + protected PropertyType propertyType; + + protected Dbms dbms; + + protected ResultSetHandler resultSetHandler; + + //========================================================================== + // ========= + // Constructor + // =========== + public InternalIdentifierAbstractGenerator(PropertyType propertyType, + Dbms dbms) { + this.propertyType = propertyType; + this.dbms = dbms; + resultSetHandler = new InternalIdentifierResultSetHandler(propertyType + .getValueType()); + } + + //========================================================================== + // ========= + // Assist Helper + // ============= + protected Object executeSql(DataSource ds, String sql, Object[] args) { + InternalBasicSelectHandler selectHandler = createSelectHandler(ds, sql); + if (args != null) { + selectHandler.setLoggingMessageSqlArgs(args); + } + return selectHandler.execute(args); + } + + protected InternalBasicSelectHandler createSelectHandler(DataSource ds, + String sql) { + // Use original statement factory for identifier generator. + return new InternalBasicSelectHandler(ds, sql, resultSetHandler, + createStatementFactory(ds, sql)); + } + + protected StatementFactory createStatementFactory(DataSource ds, String sql) { + return new InternalIdentifierGeneratorStatementFactory(); + } + + protected void reflectIdentifier(Object bean, Object value) { + if (propertyType == null) { + String msg = "The arguement[propertyType] should not be null: value=" + + value; + throw new IllegalArgumentException(msg); + } + PropertyDesc pd = propertyType.getPropertyDesc(); + pd.setValue(bean, value); + } + + //========================================================================== + // ========= + // Result Set Handler + // ================== + protected static class InternalIdentifierResultSetHandler implements + ResultSetHandler { + private ValueType valueType; + + public InternalIdentifierResultSetHandler(ValueType valueType) { + this.valueType = valueType; + } + + public Object handle(ResultSet rs) throws SQLException { + if (rs.next()) { + return valueType.getValue(rs, 1); + } + return null; + } + } + + //========================================================================== + // ========= + // Statement Factory + // ================= + protected static class InternalIdentifierGeneratorStatementFactory + implements StatementFactory { + public PreparedStatement createPreparedStatement(Connection conn, + String sql) { + try { + return conn.prepareStatement(sql); + } catch (SQLException e) { + handleSQLException(e, null); + return null; // Unreachable! + } + } + + public CallableStatement createCallableStatement(Connection conn, + String sql) { + try { + return conn.prepareCall(sql); + } catch (SQLException e) { + handleSQLException(e, null); + return null; // Unreachable! + } + } + + protected void handleSQLException(SQLException e, Statement statement) { + new SQLExceptionHandler().handleSQLException(e, statement); + } + } + + //========================================================================== + // ========= + // Accessor + // ======== + public String getPropertyName() { + return propertyType.getPropertyName(); + } + + public Dbms getDbms() { + return dbms; + } +} Property changes on: todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/s2dao/internal/various/InternalIdentifierAbstractGenerator.java ___________________________________________________________________ Name: svn:eol-style + native Added: todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/s2dao/internal/various/InternalIdentifierAssignedGenerator.java =================================================================== --- todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/s2dao/internal/various/InternalIdentifierAssignedGenerator.java (rev 0) +++ todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/s2dao/internal/various/InternalIdentifierAssignedGenerator.java 2008-12-27 22:21:53 UTC (rev 1633) @@ -0,0 +1,33 @@ +package jp.sf.pal.todolist.db.allcommon.s2dao.internal.various; + +import javax.sql.DataSource; + +import org.seasar.dao.Dbms; +import org.seasar.extension.jdbc.PropertyType; + +/** + * @author DBFlute(AutoGenerator) + */ +public class InternalIdentifierAssignedGenerator extends + InternalIdentifierAbstractGenerator { + + //========================================================================== + // ========= + // Constructor + // =========== + public InternalIdentifierAssignedGenerator(PropertyType propertyType, + Dbms dbms) { + super(propertyType, dbms); + } + + //========================================================================== + // ========= + // Implementation + // ============== + public void setIdentifier(Object bean, DataSource ds) { + } + + public boolean isSelfGenerate() { + return true; + } +} Property changes on: todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/s2dao/internal/various/InternalIdentifierAssignedGenerator.java ___________________________________________________________________ Name: svn:eol-style + native Added: todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/s2dao/internal/various/InternalIdentifierGeneratorFactory.java =================================================================== --- todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/s2dao/internal/various/InternalIdentifierGeneratorFactory.java (rev 0) +++ todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/s2dao/internal/various/InternalIdentifierGeneratorFactory.java 2008-12-27 22:21:53 UTC (rev 1633) @@ -0,0 +1,105 @@ +package jp.sf.pal.todolist.db.allcommon.s2dao.internal.various; + +import java.lang.reflect.Constructor; +import java.util.HashMap; +import java.util.Map; + +import jp.sf.pal.todolist.db.allcommon.util.SimpleStringUtil; + +import org.seasar.dao.Dbms; +import org.seasar.dao.IdentifierGenerator; +import org.seasar.extension.jdbc.PropertyType; +import org.seasar.framework.beans.BeanDesc; +import org.seasar.framework.beans.PropertyDesc; +import org.seasar.framework.beans.factory.BeanDescFactory; +import org.seasar.framework.util.ClassUtil; +import org.seasar.framework.util.ConstructorUtil; + +/** + * @author DBFlute(AutoGenerator) + */ +public class InternalIdentifierGeneratorFactory { + + //========================================================================== + // ========= + // Attribute + // ========= + private static Map> generatorClasses = new HashMap>(); + + static { + addIdentifierGeneratorClass("assigned", + InternalIdentifierAssignedGenerator.class); + addIdentifierGeneratorClass("identity", + InternalIdentifierIdentityGenerator.class); + addIdentifierGeneratorClass("sequence", + InternalIdentifierSequenceGenerator.class); + } + + //========================================================================== + // ========= + // Constructor + // =========== + private InternalIdentifierGeneratorFactory() { + } + + //========================================================================== + // ========= + // Identifier Generator + // ==================== + public static void addIdentifierGeneratorClass(String name, Class clazz) { + generatorClasses.put(name, clazz); + } + + public static IdentifierGenerator createIdentifierGenerator( + PropertyType propertyType, Dbms dbms) { + return createIdentifierGenerator(propertyType, dbms, null); + } + + public static IdentifierGenerator createIdentifierGenerator( + PropertyType propertyType, Dbms dbms, String annotation) { + if (propertyType == null) { + String msg = "The argument[propertyType] should not be null: dbms=" + + dbms + " annotation=" + annotation; + throw new IllegalArgumentException(msg); + } + if (dbms == null) { + String msg = "The argument[dbms] should not be null: propertyType=" + + propertyType + " annotation=" + annotation; + throw new IllegalArgumentException(msg); + } + if (annotation == null) { + return new InternalIdentifierAssignedGenerator(propertyType, dbms); + } + String[] array = SimpleStringUtil.split(annotation, "=, "); + Class clazz = getGeneratorClass(array[0]); + IdentifierGenerator generator = createIdentifierGenerator(clazz, + propertyType, dbms); + for (int i = 1; i < array.length; i += 2) { + setProperty(generator, array[i].trim(), array[i + 1].trim()); + } + return generator; + } + + protected static Class getGeneratorClass(String name) { + Class clazz = generatorClasses.get(name); + if (clazz != null) { + return clazz; + } + return ClassUtil.forName(name); + } + + protected static IdentifierGenerator createIdentifierGenerator( + Class clazz, PropertyType propertyType, Dbms dbms) { + Constructor constructor = ClassUtil.getConstructor(clazz, + new Class[] { PropertyType.class, Dbms.class }); + return (IdentifierGenerator) ConstructorUtil.newInstance(constructor, + new Object[] { propertyType, dbms }); + } + + protected static void setProperty(IdentifierGenerator generator, + String propertyName, String value) { + BeanDesc beanDesc = BeanDescFactory.getBeanDesc(generator.getClass()); + PropertyDesc pd = beanDesc.getPropertyDesc(propertyName); + pd.setValue(generator, value); + } +} Property changes on: todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/s2dao/internal/various/InternalIdentifierGeneratorFactory.java ___________________________________________________________________ Name: svn:eol-style + native Added: todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/s2dao/internal/various/InternalIdentifierIdentityGenerator.java =================================================================== --- todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/s2dao/internal/various/InternalIdentifierIdentityGenerator.java (rev 0) +++ todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/s2dao/internal/various/InternalIdentifierIdentityGenerator.java 2008-12-27 22:21:53 UTC (rev 1633) @@ -0,0 +1,35 @@ +package jp.sf.pal.todolist.db.allcommon.s2dao.internal.various; + +import javax.sql.DataSource; + +import org.seasar.dao.Dbms; +import org.seasar.extension.jdbc.PropertyType; + +/** + * @author DBFlute(AutoGenerator) + */ +public class InternalIdentifierIdentityGenerator extends + InternalIdentifierAbstractGenerator { + + //========================================================================== + // ========= + // Constructor + // =========== + public InternalIdentifierIdentityGenerator(PropertyType propertyType, + Dbms dbms) { + super(propertyType, dbms); + } + + //========================================================================== + // ========= + // Implementation + // ============== + public void setIdentifier(Object bean, DataSource ds) { + Object value = executeSql(ds, getDbms().getIdentitySelectString(), null); + reflectIdentifier(bean, value); + } + + public boolean isSelfGenerate() { + return false; + } +} Property changes on: todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/s2dao/internal/various/InternalIdentifierIdentityGenerator.java ___________________________________________________________________ Name: svn:eol-style + native Added: todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/s2dao/internal/various/InternalIdentifierSequenceGenerator.java =================================================================== --- todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/s2dao/internal/various/InternalIdentifierSequenceGenerator.java (rev 0) +++ todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/s2dao/internal/various/InternalIdentifierSequenceGenerator.java 2008-12-27 22:21:53 UTC (rev 1633) @@ -0,0 +1,116 @@ +package jp.sf.pal.todolist.db.allcommon.s2dao.internal.various; + +import java.util.HashMap; + +import javax.sql.DataSource; + +import jp.sf.pal.todolist.db.allcommon.util.SimpleTypeUtil; + +import org.seasar.dao.Dbms; +import org.seasar.extension.jdbc.PropertyType; + +/** + * @author DBFlute(AutoGenerator) + */ +public class InternalIdentifierSequenceGenerator extends + InternalIdentifierAbstractGenerator { + + // - - - - - - - - - - + // [Unused on DBFlute] + // - - - - - - - - - - + + //========================================================================== + // ========= + // Attribute + // ========= + private String sequenceName; + + private long allocationSize = 0; + + private HashMap idContextMap = new HashMap(); + + //========================================================================== + // ========= + // Constructor + // =========== + public InternalIdentifierSequenceGenerator(PropertyType propertyType, + Dbms dbms) { + super(propertyType, dbms); + } + + //========================================================================== + // ========= + // Implementation + // ============== + public void setIdentifier(Object bean, DataSource ds) { + reflectIdentifier(bean, getNextValue(ds)); + } + + public boolean isSelfGenerate() { + return getDbms().isSelfGenerate(); + } + + //========================================================================== + // ========= + // Next Value + // ========== + protected Object getNextValue(DataSource ds) { + if (allocationSize > 0) { + long value = getIdContext(ds).getNextValue(ds); + return new Long(value); + } + return getNewInitialValue(ds); + } + + protected Object getNewInitialValue(DataSource ds) { + return executeSql(ds, getDbms().getSequenceNextValString(sequenceName), + null); + } + + protected IdContext getIdContext(DataSource ds) { + synchronized (idContextMap) { + IdContext context = idContextMap.get(ds); + if (context == null) { + context = new IdContext(); + idContextMap.put(ds, context); + } + return context; + } + } + + public class IdContext { + protected long initialValue; + + protected long allocated = Long.MAX_VALUE; + + public synchronized long getNextValue(DataSource ds) { + if (allocated < allocationSize) { + return initialValue + allocated++; + } + initialValue = SimpleTypeUtil + .toPrimitiveLong(getNewInitialValue(ds)); + allocated = 1; + return initialValue; + } + } + + //========================================================================== + // ========= + // Accessor + // ======== + public String getSequenceName() { + return sequenceName; + } + + public void setSequenceName(String sequenceName) { + this.sequenceName = sequenceName; + } + + public long getAllocationSize() { + return allocationSize; + } + + public void setAllocationSize(long allocationSize) { + this.allocationSize = allocationSize; + } +} Property changes on: todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/s2dao/internal/various/InternalIdentifierSequenceGenerator.java ___________________________________________________________________ Name: svn:eol-style + native Modified: todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/s2dao/internal/various/InternalProcedureMetaDataFactory.java =================================================================== --- todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/s2dao/internal/various/InternalProcedureMetaDataFactory.java 2008-12-27 22:20:45 UTC (rev 1632) +++ todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/s2dao/internal/various/InternalProcedureMetaDataFactory.java 2008-12-27 22:21:53 UTC (rev 1633) @@ -7,7 +7,7 @@ import java.util.Map; import java.util.Stack; -import jp.sf.pal.todolist.db.allcommon.cbean.ConditionBeanContext; +import jp.sf.pal.todolist.db.allcommon.DBDef; import org.seasar.dao.ValueTypeFactory; import org.seasar.dao.util.TypeUtil; @@ -146,9 +146,9 @@ } final Class type = field.getType(); if (List.class.isAssignableFrom(type)) {// is for out parameter cursor. - if (ConditionBeanContext.isOracle()) { + if (DBDef.isCurrentDef(DBDef.Oracle)) { return ValueTypes.ORACLE_RESULT_SET; - } else if (ConditionBeanContext.isPostgreSql()) { + } else if (DBDef.isCurrentDef(DBDef.PostgreSQL)) { return ValueTypes.POSTGRE_RESULT_SET; } else { return ValueTypes.SERIALIZABLE_BYTE_ARRAY; Added: todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/s2dao/internal/various/InternalStatementFactory.java =================================================================== --- todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/s2dao/internal/various/InternalStatementFactory.java (rev 0) +++ todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/s2dao/internal/various/InternalStatementFactory.java 2008-12-27 22:21:53 UTC (rev 1633) @@ -0,0 +1,158 @@ +package jp.sf.pal.todolist.db.allcommon.s2dao.internal.various; + +import java.sql.CallableStatement; +import java.sql.Connection; +import java.sql.PreparedStatement; +import java.sql.SQLException; +import java.sql.Statement; + +import jp.sf.pal.todolist.db.allcommon.cbean.ConditionBean; +import jp.sf.pal.todolist.db.allcommon.cbean.ConditionBeanContext; +import jp.sf.pal.todolist.db.allcommon.cbean.outsidesql.OutsideSqlContext; +import jp.sf.pal.todolist.db.allcommon.jdbc.StatementConfig; +import jp.sf.pal.todolist.db.allcommon.s2dao.internal.sqlhandler.InternalBasicHandler.SQLExceptionHandler; + +import org.seasar.extension.jdbc.StatementFactory; + +/** + * @author DBFlute(AutoGenerator) + */ +public class InternalStatementFactory implements StatementFactory { + + //========================================================================== + // ========= + // Definition + // ========== + /** Log-instance. */ + private static final org.apache.commons.logging.Log _log = org.apache.commons.logging.LogFactory + .getLog(InternalStatementFactory.class); + + //========================================================================== + // ========= + // Attribute + // ========= + protected StatementConfig defaultStatementConfig; + + protected boolean internalDebug; + + //========================================================================== + // ========= + // Constructor + // =========== + public InternalStatementFactory() { + } + + //========================================================================== + // ========= + // Implementation + // ============== + public PreparedStatement createPreparedStatement(Connection conn, String sql) { + try { + final StatementConfig config = findStatementConfigOnThread(); + ; + final int resultSetType; + if (config != null && config.hasResultSetType()) { + resultSetType = config.getResultSetType(); + } else if (defaultStatementConfig != null + && defaultStatementConfig.hasResultSetType()) { + resultSetType = defaultStatementConfig.getResultSetType(); + } else { + resultSetType = java.sql.ResultSet.TYPE_FORWARD_ONLY; + } + final int resultSetConcurrency = java.sql.ResultSet.CONCUR_READ_ONLY; + if (internalDebug) { + _log.debug("...Creating prepareStatement(sql, " + resultSetType + + ", " + resultSetConcurrency + ")"); + } + final PreparedStatement ps = conn.prepareStatement(sql, + resultSetType, resultSetConcurrency); + if (config != null && config.hasStatementOptions()) { + if (internalDebug) { + _log.debug("...Setting statement config as request: " + + config); + } + reflectStatementOptions(config, ps); + } else { + reflectDefaultOptionsToStatementIfNeeds(ps); + } + return ps; + } catch (SQLException e) { + handleSQLException(e, null); + return null;// Unreachable! + } + } + + public CallableStatement createCallableStatement(Connection conn, String sql) { + return prepareCall(conn, sql); + } + + protected StatementConfig findStatementConfigOnThread() { + final StatementConfig config; + if (ConditionBeanContext.isExistConditionBeanOnThread()) { + final ConditionBean cb = ConditionBeanContext + .getConditionBeanOnThread(); + config = cb.getStatementConfig(); + } else if (OutsideSqlContext.isExistOutsideSqlContextOnThread()) { + final OutsideSqlContext context = OutsideSqlContext + .getOutsideSqlContextOnThread(); + config = context.getStatementConfig(); + } else { + config = null; + } + return config; + } + + protected void reflectDefaultOptionsToStatementIfNeeds(PreparedStatement ps) { + if (defaultStatementConfig != null + && defaultStatementConfig.hasStatementOptions()) { + if (internalDebug) { + _log.debug("...Setting statement config as default: " + + defaultStatementConfig); + } + reflectStatementOptions(defaultStatementConfig, ps); + return; + } + } + + protected void reflectStatementOptions(StatementConfig config, + PreparedStatement ps) { + try { + if (config.hasQueryTimeout()) { + ps.setQueryTimeout(config.getQueryTimeout()); + } + if (config.hasFetchSize()) { + ps.setFetchSize(config.getFetchSize()); + } + if (config.hasMaxRows()) { + ps.setMaxRows(config.getMaxRows()); + } + } catch (SQLException e) { + handleSQLException(e, ps); + } + } + + protected CallableStatement prepareCall(Connection conn, String sql) { + try { + return conn.prepareCall(sql); + } catch (SQLException e) { + handleSQLException(e, null); + return null;// Unreachable! + } + } + + protected void handleSQLException(SQLException e, Statement statement) { + new SQLExceptionHandler().handleSQLException(e, statement); + } + + //========================================================================== + // ========= + // Accessor + // ======== + public void setDefaultStatementConfig(StatementConfig defaultStatementConfig) { + this.defaultStatementConfig = defaultStatementConfig; + } + + public void setInternalDebug(boolean internalDebug) { + this.internalDebug = internalDebug; + } +} Property changes on: todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/s2dao/internal/various/InternalStatementFactory.java ___________________________________________________________________ Name: svn:eol-style + native Modified: todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/util/SimpleAssertUtil.java =================================================================== --- todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/util/SimpleAssertUtil.java 2008-12-27 22:20:45 UTC (rev 1632) +++ todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/util/SimpleAssertUtil.java 2008-12-27 22:21:53 UTC (rev 1633) @@ -7,11 +7,8 @@ //========================================================================== // ========= - // Assert + // Object // ====== - // ----------------------------------------------------- - // Assert Object - // ------------- /** * Assert that the object is not null. * @@ -32,9 +29,10 @@ } } - // ----------------------------------------------------- - // Assert String - // ------------- + //========================================================================== + // ========= + // String + // ====== /** * Assert that the entity is not null and not trimmed empty. * Added: todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/util/SimpleResourceUtil.java =================================================================== --- todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/util/SimpleResourceUtil.java (rev 0) +++ todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/util/SimpleResourceUtil.java 2008-12-27 22:21:53 UTC (rev 1633) @@ -0,0 +1,117 @@ +package jp.sf.pal.todolist.db.allcommon.util; + +import java.io.IOException; +import java.io.InputStream; +import java.net.URL; +import java.net.URLConnection; + +/** + * @author DBFlute(AutoGenerator) + */ +public class SimpleResourceUtil { + + //========================================================================== + // ========= + // Resource Path + // ============= + public static String getResourcePath(String path, String extension) { + if (extension == null) { + return path; + } + extension = "." + extension; + if (path.endsWith(extension)) { + return path; + } + return path.replace('.', '/') + extension; + } + + public static String getResourcePath(Class clazz) { + return clazz.getName().replace('.', '/') + ".class"; + } + + //========================================================================== + // ========= + // Resource URL + // ============ + public static URL getResourceUrl(String path) { + return getResourceUrl(path, null); + } + + public static URL getResourceUrl(String path, String extension) { + return getResourceUrl(path, extension, Thread.currentThread() + .getContextClassLoader()); + } + + public static URL getResourceUrl(String path, String extension, + ClassLoader loader) { + if (path == null || loader == null) { + return null; + } + path = getResourcePath(path, extension); + return loader.getResource(path); + } + + //========================================================================== + // ========= + // Resource Stream + // =============== + public static InputStream getResourceStream(String path) { + return getResourceStream(path, null); + } + + public static InputStream getResourceStream(String path, String extension) { + final URL url = getResourceUrl(path, extension); + return url != null ? openStream(url) : null; + } + + //========================================================================== + // ========= + // Resource Existence + // ================== + public static boolean isExist(String path) { + return getResourceUrl(path) != null; + } + + //========================================================================== + // ========= + // Assist Helper + // ============= + protected static ClassLoader getClassLoader() { + return Thread.currentThread().getContextClassLoader(); + } + + protected static InputStream openStream(URL url) { + try { + URLConnection connection = url.openConnection(); + connection.setUseCaches(false); + return connection.getInputStream(); + } catch (IOException e) { + String msg = "Failed to open the stream: url=" + url; + throw new IllegalStateException(msg, e); + } + } + + //========================================================================== + // ========= + // Assert Helper + // ============= + /** + * Assert that the object is not null. + * + * @param variableName Variable name. (NotNull) + * @param value Value. (NotNull) + * @exception IllegalArgumentException + */ + protected static void assertObjectNotNull(String variableName, Object value) { + if (variableName == null) { + String msg = "The value should not be null: variableName=" + + variableName + " value=" + value; + throw new IllegalArgumentException(msg); + } + if (value == null) { + String msg = "The value should not be null: variableName=" + + variableName; + throw new IllegalArgumentException(msg); + } + } +} Property changes on: todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/util/SimpleResourceUtil.java ___________________________________________________________________ Name: svn:eol-style + native Modified: todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/util/SimpleStringUtil.java =================================================================== --- todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/util/SimpleStringUtil.java 2008-12-27 22:20:45 UTC (rev 1632) +++ todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/util/SimpleStringUtil.java 2008-12-27 22:21:53 UTC (rev 1633) @@ -1,14 +1,20 @@ package jp.sf.pal.todolist.db.allcommon.util; +import java.util.ArrayList; +import java.util.List; +import java.util.StringTokenizer; + /** * @author DBFlute(AutoGenerator) */ public class SimpleStringUtil { + protected static final String[] EMPTY_STRINGS = new String[0]; + //========================================================================== // ========= - // String - // ====== + // Replace + // ======= public static String replace(String text, String fromText, String toText) { if (text == null || fromText == null || toText == null) { return null; @@ -32,6 +38,26 @@ } while (true); } + //========================================================================== + // ========= + // Split + // ===== + public static String[] split(final String str, final String delimiter) { + if (str == null || str.trim().length() == 0) { + return EMPTY_STRINGS; + } + final List list = new ArrayList(); + final StringTokenizer st = new StringTokenizer(str, delimiter); + while (st.hasMoreElements()) { + list.add(st.nextToken()); + } + return (String[]) list.toArray(new String[list.size()]); + } + + //========================================================================== + // ========= + // Initial Convert + // =============== public static String initCap(String str) { assertObjectNotNull("str", str); return str.substring(0, 1).toUpperCase() + str.substring(1); @@ -42,9 +68,10 @@ return str.substring(0, 1).toLowerCase() + str.substring(1); } - // ----------------------------------------------------- - // Assert Object - // ------------- + //========================================================================== + // ========= + // Assert Helper + // ============= /** * Assert that the object is not null. * Modified: todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/util/SimpleSystemUtil.java =================================================================== --- todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/util/SimpleSystemUtil.java 2008-12-27 22:20:45 UTC (rev 1632) +++ todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/util/SimpleSystemUtil.java 2008-12-27 22:21:53 UTC (rev 1633) @@ -7,8 +7,8 @@ //========================================================================== // ========= - // System - // ====== + // Line Separator + // ============== public static String getLineSeparator() { // /- - - - - - - - - - - - - - - - - - - - - - // Because 'CR + LF' caused many trouble! Added: todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/util/SimpleTypeUtil.java =================================================================== --- todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/util/SimpleTypeUtil.java (rev 0) +++ todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/util/SimpleTypeUtil.java 2008-12-27 22:21:53 UTC (rev 1633) @@ -0,0 +1,692 @@ +package jp.sf.pal.todolist.db.allcommon.util; + +import java.math.BigDecimal; +import java.math.BigInteger; +import java.text.DateFormat; +import java.text.DecimalFormatSymbols; +import java.text.ParseException; +import java.text.SimpleDateFormat; +import java.util.ArrayList; +import java.util.Calendar; +import java.util.Date; +import java.util.List; +import java.util.Locale; +import java.util.Map; +import java.util.StringTokenizer; +import java.util.concurrent.ConcurrentHashMap; + +/** + * {Refers to S2Container's utility and Extends it} + * + * @author DBFlute(AutoGenerator) + */ +public class SimpleTypeUtil { + + //========================================================================== + // ========= + // Convert To + // ========== + // ----------------------------------------------------- + // Boolean + // ------- + public static Boolean toBoolean(Object o) { + if (o == null) { + return null; + } else if (o instanceof Boolean) { + return (Boolean) o; + } else if (o instanceof Number) { + int num = ((Number) o).intValue(); + return Boolean.valueOf(num != 0); + } else if (o instanceof String) { + String s = (String) o; + if ("true".equalsIgnoreCase(s)) { + return Boolean.TRUE; + } else if ("false".equalsIgnoreCase(s)) { + return Boolean.FALSE; + } else if (s.equals("0")) { + return Boolean.FALSE; + } else { + return Boolean.TRUE; + } + } else { + return Boolean.TRUE; + } + } + + // ----------------------------------------------------- + // Integer + // ------- + public static Integer toInteger(Object o) { + return toInteger(o, null); + } + + public static Integer toInteger(Object o, String pattern) { + if (o == null) { + return null; + } else if (o instanceof Integer) { + return (Integer) o; + } else if (o instanceof Number) { + return new Integer(((Number) o).intValue()); + } else if (o instanceof String) { + return toInteger((String) o); + } else if (o instanceof java.util.Date) { + if (pattern != null) { + return new Integer(new SimpleDateFormat(pattern).format(o)); + } + return new Integer((int) ((java.util.Date) o).getTime()); + } else if (o instanceof Boolean) { + return ((Boolean) o).booleanValue() ? new Integer(1) : new Integer( + 0); + } else { + return toInteger(o.toString()); + } + } + + protected static Integer toInteger(String s) { + if (s == null || s.trim().length() == 0) { + return null; + } + return new Integer(normalize(s)); + } + + public static int toPrimitiveInt(Object o) { + return toPrimitiveInt(o, null); + } + + public static int toPrimitiveInt(Object o, String pattern) { + if (o == null) { + return 0; + } else if (o instanceof Number) { + return ((Number) o).intValue(); + } else if (o instanceof String) { + return toPrimitiveInt((String) o); + } else if (o instanceof java.util.Date) { + if (pattern != null) { + return Integer + .parseInt(new SimpleDateFormat(pattern).format(o)); + } + return (int) ((java.util.Date) o).getTime(); + } else if (o instanceof Boolean) { + return ((Boolean) o).booleanValue() ? 1 : 0; + } else { + return toPrimitiveInt(o.toString()); + } + } + + protected static int toPrimitiveInt(String s) { + if (s == null || s.trim().length() == 0) { + return 0; + } + return Integer.parseInt(normalize(s)); + } + + // ----------------------------------------------------- + // BigDecimal + // ---------- + public static BigDecimal toBigDecimal(Object o) { + return toBigDecimal(o, null); + } + + public static BigDecimal toBigDecimal(Object o, String pattern) { + if (o == null) { + return null; + } else if (o instanceof BigDecimal) { + return (BigDecimal) o; + } else if (o instanceof java.util.Date) { + if (pattern != null) { + return new BigDecimal(new SimpleDateFormat(pattern).format(o)); + } + return new BigDecimal(Long.toString(((java.util.Date) o).getTime())); + } else if (o instanceof String) { + String s = (String) o; + if (s == null || s.trim().length() == 0) { + return null; + } + return new BigDecimal(new BigDecimal(s).toPlainString()); + } else { + return new BigDecimal(new BigDecimal(o.toString()).toPlainString()); + } + } + + // ----------------------------------------------------- + // Double + // ------ + public static Double toDouble(Object o) { + return toDouble(o, null); + } + + public static Double toDouble(Object o, String pattern) { + if (o == null) { + return null; + } else if (o instanceof Double) { + return (Double) o; + } else if (o instanceof Number) { + return new Double(((Number) o).doubleValue()); + } else if (o instanceof String) { + return toDouble((String) o); + } else if (o instanceof java.util.Date) { + if (pattern != null) { + return new Double(new SimpleDateFormat(pattern).format(o)); + } + return new Double(((java.util.Date) o).getTime()); + } else { + return toDouble(o.toString()); + } + } + + protected static Double toDouble(String s) { + if (s == null || s.trim().length() == 0) { + return null; + } + return new Double(normalize(s)); + } + + // ----------------------------------------------------- + // Long + // ---- + public static Long toLong(Object o) { + return toLong(o, null); + } + + public static Long toLong(Object o, String pattern) { + if (o == null) { + return null; + } else if (o instanceof Long) { + return (Long) o; + } else if (o instanceof Number) { + return new Long(((Number) o).longValue()); + } else if (o instanceof String) { + return toLong((String) o); + } else if (o instanceof java.util.Date) { + if (pattern != null) { + return new Long(new SimpleDateFormat(pattern).format(o)); + } + return new Long(((java.util.Date) o).getTime()); + } else if (o instanceof Boolean) { + return ((Boolean) o).booleanValue() ? new Long(1) : new Long(0); + } else { + return toLong(o.toString()); + } + } + + protected static Long toLong(String s) { + if (s == null || s.trim().length() == 0) { + return null; + } + return new Long(normalize(s)); + } + + public static long toPrimitiveLong(Object o) { + return toPrimitiveLong(o, null); + } + + public static long toPrimitiveLong(Object o, String pattern) { + if (o == null) { + return 0; + } else if (o instanceof Number) { + return ((Number) o).longValue(); + } else if (o instanceof String) { + return toPrimitiveLong((String) o); + } else if (o instanceof java.util.Date) { + if (pattern != null) { + return Long.parseLong(new SimpleDateFormat(pattern).format(o)); + } + return ((java.util.Date) o).getTime(); + } else if (o instanceof Boolean) { + return ((Boolean) o).booleanValue() ? 1 : 0; + } else { + return toPrimitiveLong(o.toString()); + } + } + + protected static long toPrimitiveLong(String s) { + if (s == null || s.trim().length() == 0) { + return 0; + } + return Long.parseLong(normalize(s)); + } + + // ----------------------------------------------------- + // Float + // ----- + public static Float toFloat(Object o) { + return toFloat(o, null); + } + + public static Float toFloat(Object o, String pattern) { + if (o == null) { + return null; + } else if (o instanceof Float) { + return (Float) o; + } else if (o instanceof Number) { + return new Float(((Number) o).floatValue()); + } else if (o instanceof String) { + return toFloat((String) o); + } else if (o instanceof java.util.Date) { + if (pattern != null) { + return new Float(new SimpleDateFormat(pattern).format(o)); + } + return new Float(((java.util.Date) o).getTime()); + } else { + return toFloat(o.toString()); + } + } + + protected static Float toFloat(String s) { + if (s == null || s.trim().length() == 0) { + return null; + } + return new Float(normalize(s)); + } + + // ----------------------------------------------------- + // Short + // ----- + public static Short toShort(Object o) { + return toShort(o, null); + } + + public static Short toShort(Object o, String pattern) { + if (o == null) { + return null; + } else if (o instanceof Short) { + return (Short) o; + } else if (o instanceof Number) { + return new Short(((Number) o).shortValue()); + } else if (o instanceof String) { + return toShort((String) o); + } else if (o instanceof java.util.Date) { + if (pattern != null) { + return new Short(new SimpleDateFormat(pattern).format(o)); + } + return new Short((short) ((java.util.Date) o).getTime()); + } else if (o instanceof Boolean) { + return ((Boolean) o).booleanValue() ? new Short((short) 1) + : new Short((short) 0); + } else { + return toShort(o.toString()); + } + } + + protected static Short toShort(String s) { + if (s == null || s.trim().length() == 0) { + return null; + } + return new Short(normalize(s)); + } + + // ----------------------------------------------------- + // BigInteger + // ---------- + public static BigInteger toBigInteger(Object o) { + return toBigInteger(o, null); + } + + public static BigInteger toBigInteger(Object o, String pattern) { + if (o == null) { + return null; + } else if (o instanceof BigInteger) { + return (BigInteger) o; + } else { + Long l = toLong(o, pattern); + if (l == null) { + return null; + } + return BigInteger.valueOf(l.longValue()); + } + } + + // ----------------------------------------------------- + // Byte + // ---- + public static Byte toByte(Object o) { + return toByte(o, null); + } + + public static Byte toByte(Object o, String pattern) { + if (o == null) { + return null; + } else if (o instanceof Byte) { + return (Byte) o; + } else if (o instanceof Number) { + return new Byte(((Number) o).byteValue()); + } else if (o instanceof String) { + return toByte((String) o); + } else if (o instanceof java.util.Date) { + if (pattern != null) { + return new Byte(new SimpleDateFormat(pattern).format(o)); + } + return new Byte((byte) ((java.util.Date) o).getTime()); + } else if (o instanceof Boolean) { + return ((Boolean) o).booleanValue() ? new Byte((byte) 1) + : new Byte((byte) 0); + } else { + return toByte(o.toString()); + } + } + + protected static Byte toByte(String s) { + if (s == null || s.trim().length() == 0) { + return null; + } + return new Byte(normalize(s)); + } + + // ----------------------------------------------------- + // Date + // ---- + public static Date toDate(Object o) { + return toDate(o, null); + } + + public static Date toDate(Object o, String pattern) { + if (o == null) { + return null; + } else if (o instanceof String) { + return toDate((String) o, pattern); + } else if (o instanceof Date) { + return (Date) o; + } else if (o instanceof Calendar) { + return ((Calendar) o).getTime(); + } else { + return toDate(o.toString(), pattern); + } + } + + protected static Date toDate(String s, String pattern) { + return toDate(s, pattern, Locale.getDefault()); + } + + protected static Date toDate(String s, String pattern, Locale locale) { + if (s == null || s.trim().length() == 0) { + return null; + } + SimpleDateFormat sdf = getDateFormat(s, pattern, locale); + try { + return sdf.parse(s); + } catch (ParseException e) { + String msg = "Failed to parse the string to date: "; + msg = msg + " string=" + s + " format=" + sdf + " locale=" + locale; + throw new IllegalStateException(msg, e); + } + } + + public static java.sql.Date toSqlDate(Object o) { + return toSqlDate(o, null); + } + + public static java.sql.Date toSqlDate(Object o, String pattern) { + if (o instanceof java.sql.Date) { + return (java.sql.Date) o; + } + java.util.Date date = toDate(o, pattern); + if (date != null) { + return new java.sql.Date(date.getTime()); + } + return null; + } + + // ----------------------------------------------------- + // Number + // ------ + public static Object toNumber(Class type, Object o) { + if (type == Integer.class) { + return toInteger(o); + } else if (type == BigDecimal.class) { + return toBigDecimal(o); + } else if (type == Double.class) { + return toDouble(o); + } else if (type == Long.class) { + return toLong(o); + } else if (type == Float.class) { + return toFloat(o); + } else if (type == Short.class) { + return toShort(o); + } else if (type == BigInteger.class) { + return toBigInteger(o); + } else if (type == Byte.class) { + return toByte(o); + } + return o; + } + + // ----------------------------------------------------- + // Wrapper + // ------- + public static Object toWrapper(Class type, Object o) { + if (type == int.class) { + Integer i = toInteger(o); + if (i != null) { + return i; + } + return new Integer(0); + } else if (type == double.class) { + Double d = toDouble(o); + if (d != null) { + return d; + } + return new Double(0); + } else if (type == long.class) { + Long l = toLong(o); + if (l != null) { + return l; + } + return new Long(0); + } else if (type == float.class) { + Float f = toFloat(o); + if (f != null) { + return f; + } + return new Float(0); + } else if (type == short.class) { + Short s = toShort(o); + if (s != null) { + return s; + } + return new Short((short) 0); + } else if (type == boolean.class) { + Boolean b = toBoolean(o); + if (b != null) { + return b; + } + return Boolean.FALSE; + } else if (type == byte.class) { + Byte b = toByte(o); + if (b != null) { + return b; + } + return new Byte((byte) 0); + } + return o; + } + + //========================================================================== + // ========= + // Normalize + // ========= + protected static String normalize(String s) { + return normalize(s, Locale.getDefault()); + } + + protected static String normalize(String s, Locale locale) { + if (s == null) { + return null; + } + DecimalFormatSymbols symbols = getDecimalFormatSymbols(locale); + char decimalSep = symbols.getDecimalSeparator(); + char groupingSep = symbols.getGroupingSeparator(); + StringBuilder sb = new StringBuilder(20); + for (int i = 0; i < s.length(); ++i) { + char c = s.charAt(i); + if (c == groupingSep) { + continue; + } else if (c == decimalSep) { + c = '.'; + } + sb.append(c); + } + return sb.toString(); + } + + //========================================================================== + // ========= + // Assist Helper + // ============= + + // ----------------------------------------------------- + // DateFormat + // ---------- + protected static SimpleDateFormat getDateFormat(String s, String pattern, + Locale locale) { + if (pattern != null) { + return new SimpleDateFormat(pattern); + } + return getDateFormat(s, locale); + } + + protected static SimpleDateFormat getDateFormat(String s, Locale locale) { + String pattern = getDateFormatPattern(locale); + String shortPattern = removeDateDelimiter(pattern); + String delimitor = findDateDelimiter(s); + if (delimitor == null) { + if (s.length() == shortPattern.length()) { + return new SimpleDateFormat(shortPattern); + } + if (s.length() == shortPattern.length() + 2) { + return new SimpleDateFormat(replace(shortPattern, "yy", "yyyy")); + } + } else { + String[] array = split(s, delimitor); + for (int i = 0; i < array.length; ++i) { + if (array[i].length() == 4) { + pattern = replace(pattern, "yy", "yyyy"); + break; + } + } + return new SimpleDateFormat(pattern); + } + return new SimpleDateFormat(); + } + + protected static String getDateFormatPattern(Locale locale) { + SimpleDateFormat df = (SimpleDateFormat) DateFormat.getDateInstance( + DateFormat.SHORT, locale); + String pattern = df.toPattern(); + int index = pattern.indexOf(' '); + if (index > 0) { + pattern = pattern.substring(0, index); + } + if (pattern.indexOf("MM") < 0) { + pattern = replace(pattern, "M", "MM"); + } + if (pattern.indexOf("dd") < 0) { + pattern = replace(pattern, "d", "dd"); + } + return pattern; + } + + protected static String removeDateDelimiter(String pattern) { + StringBuilder sb = new StringBuilder(); + for (int i = 0; i < pattern.length(); ++i) { + char c = pattern.charAt(i); + if (c == 'y' || c == 'M' || c == 'd') { + sb.append(c); + } + } + return sb.toString(); + } + + protected static String findDateDelimiter(String value) { + for (int i = 0; i < value.length(); ++i) { + char c = value.charAt(i); + if (Character.isDigit(c)) { + continue; + } + return Character.toString(c); + } + return null; + } + + // ----------------------------------------------------- + // DecimalFormatSymbols + // -------------------- + protected static Map symbolsCache = new ConcurrentHashMap(); + + protected static DecimalFormatSymbols getDecimalFormatSymbols() { + return getDecimalFormatSymbols(Locale.getDefault()); + } + + protected static DecimalFormatSymbols getDecimalFormatSymbols(Locale locale) { + DecimalFormatSymbols symbols = (DecimalFormatSymbols) symbolsCache + .get(locale); + if (symbols == null) { + symbols = new DecimalFormatSymbols(locale); + symbolsCache.put(locale, symbols); + } + return symbols; + } + + // ----------------------------------------------------- + // String + // ------ + protected static String replace(String text, String fromText, String toText) { + if (text == null || fromText == null || toText == null) { + return null; + } + StringBuilder sb = new StringBuilder(); + int pos = 0; + int pos2 = 0; + do { + pos = text.indexOf(fromText, pos2); + if (pos == 0) { + sb.append(toText); + pos2 = fromText.length(); + } else if (pos > 0) { + sb.append(text.substring(pos2, pos)); + sb.append(toText); + pos2 = pos + fromText.length(); + } else { + sb.append(text.substring(pos2)); + return sb.toString(); + } + } while (true); + } + + protected static final String[] EMPTY_STRINGS = new String[0]; + + protected static String[] split(final String str, final String delimiter) { + if (str == null || str.trim().length() == 0) { + return EMPTY_STRINGS; + } + final List list = new ArrayList(); + final StringTokenizer st = new StringTokenizer(str, delimiter); + while (st.hasMoreElements()) { + list.add(st.nextToken()); + } + return (String[]) list.toArray(new String[list.size()]); + } + + //========================================================================== + // ========= + // Assert Helper + // ============= + /** + * Assert that the object is not null. + * + * @param variableName Variable name. (NotNull) + * @param value Value. (NotNull) + * @exception IllegalArgumentException + */ + protected static void assertObjectNotNull(String variableName, Object value) { + if (variableName == null) { + String msg = "The value should not be null: variableName=" + + variableName + " value=" + value; + throw new IllegalArgumentException(msg); + } + if (value == null) { + String msg = "The value should not be null: variableName=" + + variableName; + throw new IllegalArgumentException(msg); + } + } +} Property changes on: todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/util/SimpleTypeUtil.java ___________________________________________________________________ Name: svn:eol-style + native Modified: todolist/trunk/src/main/java/jp/sf/pal/todolist/db/bsbhv/BsGroupInfoBhv.java =================================================================== --- todolist/trunk/src/main/java/jp/sf/pal/todolist/db/bsbhv/BsGroupInfoBhv.java 2008-12-27 22:20:45 UTC (rev 1632) +++ todolist/trunk/src/main/java/jp/sf/pal/todolist/db/bsbhv/BsGroupInfoBhv.java 2008-12-27 22:21:53 UTC (rev 1633) @@ -1,9 +1,8 @@ package jp.sf.pal.todolist.db.bsbhv; import java.util.List; +import java.util.Map; -import jp.sf.pal.todolist.db.allcommon.DaoReadable; -import jp.sf.pal.todolist.db.allcommon.DaoWritable; import jp.sf.pal.todolist.db.allcommon.Entity; import jp.sf.pal.todolist.db.allcommon.bhv.load.LoadReferrerOption; import jp.sf.pal.todolist.db.allcommon.bhv.setup.ConditionBeanSetupper; @@ -22,13 +21,12 @@ import jp.sf.pal.todolist.db.cbean.UserInfoCB; import jp.sf.pal.todolist.db.exbhv.GroupMappingBhv; import jp.sf.pal.todolist.db.exbhv.UserInfoBhv; -import jp.sf.pal.todolist.db.exdao.GroupInfoDao; import jp.sf.pal.todolist.db.exentity.GroupInfo; import jp.sf.pal.todolist.db.exentity.GroupMapping; import jp.sf.pal.todolist.db.exentity.UserInfo; /** - * The behavior of GROUP_INFO. + * The behavior of GROUP_INFO that the type is TABLE.
* *
  * [primary-key]
@@ -73,12 +71,6 @@
 
     //==========================================================================
     // =========
-    // Attribute
-    // =========
-    protected GroupInfoDao _dao;
-
-    //==========================================================================
-    // =========
     // Table name
     // ==========
     /** @return The name on database of table. (NotNull) */
@@ -90,39 +82,18 @@
     // =========
     // DBMeta
     // ======
-    /** @return The meta data of the database. (NotNull) */
+    /** @return The instance of DBMeta. (NotNull) */
     public DBMeta getDBMeta() {
         return GroupInfoDbm.getInstance();
     }
 
-    /** @return The meta data of the database as my table type. (NotNull) */
+    /** @return The instance of DBMeta as my table type. (NotNull) */
     public GroupInfoDbm getMyDBMeta() {
         return GroupInfoDbm.getInstance();
     }
 
     //==========================================================================
     // =========
-    // Dao Accessor
-    // ============
-    public GroupInfoDao getMyDao() {
-        return _dao;
-    }
-
-    public void setMyDao(GroupInfoDao dao) {
-        assertObjectNotNull("dao", dao);
-        _dao = dao;
-    }
-
-    public DaoReadable getDaoReadable() {
-        return getMyDao();
-    }
-
-    public DaoWritable getDaoWritable() {
-        return getMyDao();
-    }
-
-    //==========================================================================
-    // =========
     // New Instance
     // ============
     public Entity newEntity() {
@@ -152,7 +123,7 @@
      * @return The selected count.
      */
     public int selectCount(GroupInfoCB cb) {
-        assertConditionBeanNotNull(cb);
+        assertCBNotNull(cb);
         return delegateSelectCount(cb);
     }
 
@@ -229,7 +200,7 @@
      * @return The result bean of selected list. (NotNull)
      */
     public ListResultBean selectList(GroupInfoCB cb) {
-        assertConditionBeanNotNull(cb);
+        assertCBNotNull(cb);
         return new ResultBeanBuilder(getTableDbName())
                 .buildListResultBean(cb, delegateSelectList(cb));
     }
@@ -245,7 +216,7 @@
      * @return The result bean of selected page. (NotNull)
      */
     public PagingResultBean selectPage(final GroupInfoCB cb) {
-        assertConditionBeanNotNull(cb);
+        assertCBNotNull(cb);
         final PagingInvoker invoker = new PagingInvoker(
                 getTableDbName());
         final PagingHandler handler = new PagingHandler() {
@@ -266,6 +237,32 @@
 
     //==========================================================================
     // =========
+    // Scalar Select
+    // =============
+    /**
+     * Select the scalar value derived by a function. 
Call a function + * method after this method called like as follows: + * + *
+     * groupInfoBhv.scalarSelect(Date.class).max(new ScalarQuery(GroupInfoCB cb) {
+     *     cb.specify().columnXxxDatetime(); // the required specification of target column
+     *     cb.query().setXxxName_PrefixSearch("S"); // query as you like it
+     * });
+     * 
+ * + * @param The type of result. + * @param resultType The type of result. (NotNull) + * @return The scalar value derived by a function. (Nullable) + */ + public SLFunction scalarSelect( + Class resultType) { + GroupInfoCB cb = newMyConditionBean(); + cb.xsetupForScalarSelect(); + return new SLFunction(cb, resultType); + } + + //========================================================================== + // ========= // Various Select // ============== /** @@ -275,8 +272,8 @@ * @param valueLabelSetupper The setupper of value-label. (NotNull) * @return The list of value-label. (NotNull) */ - public List> selectValueLabelList( - GroupInfoCB cb, ValueLabelSetupper valueLabelSetupper) { + public List> selectValueLabelList(GroupInfoCB cb, + ValueLabelSetupper valueLabelSetupper) { return createValueLabelList(selectList(cb), valueLabelSetupper); } @@ -467,8 +464,8 @@ //========================================================================== // ========= - // Pullout Foreign - // =============== + // Pull out Foreign + // ================ //========================================================================== // ========= @@ -766,11 +763,11 @@ */ public int queryUpdate(GroupInfo groupInfo, GroupInfoCB cb) { assertObjectNotNull("groupInfo", groupInfo); - assertConditionBeanNotNull(cb); + assertCBNotNull(cb); setupCommonColumnOfUpdateIfNeeds(groupInfo); filterEntityOfUpdate(groupInfo); assertEntityOfUpdate(groupInfo); - return getMyDao().updateByQuery(cb, groupInfo); + return invoke(createQueryUpdateEntityCBCommand(groupInfo, cb)); } /** @@ -780,8 +777,8 @@ * @return The deleted count. */ public int queryDelete(GroupInfoCB cb) { - assertConditionBeanNotNull(cb); - return getMyDao().deleteByQuery(cb); + assertCBNotNull(cb); + return invoke(createQueryDeleteCBCommand(cb)); } //========================================================================== @@ -793,19 +790,27 @@ // ========= // Delegate Method // =============== + // [Behavior Command] // ----------------------------------------------------- // Select // ------ protected int delegateSelectCount(GroupInfoCB cb) { - assertConditionBeanNotNull(cb); - return getMyDao().selectCount(cb); + return invoke(createSelectCountCBCommand(cb)); } + protected int doCallReadCount(ConditionBean cb) { + return delegateSelectCount((GroupInfoCB) cb); + } + protected List delegateSelectList(GroupInfoCB cb) { - assertConditionBeanNotNull(cb); - return getMyDao().selectList(cb); + return invoke(createSelectListCBCommand(cb, GroupInfo.class)); } + @SuppressWarnings("unchecked") + protected List doCallReadList(ConditionBean cb) { + return (List) delegateSelectList((GroupInfoCB) cb); + } + // ----------------------------------------------------- // Update // ------ @@ -813,62 +818,97 @@ if (!processBeforeInsert(e)) { return 1; } - return getMyDao().insert(e); + return invoke(createInsertEntityCommand(e)); } + protected int doCallCreate(Entity entity) { + return delegateInsert(downcast(entity)); + } + protected int delegateUpdate(GroupInfo e) { if (!processBeforeUpdate(e)) { return 1; } - return getMyDao().updateModifiedOnly(e); + return invoke(createUpdateEntityCommand(e)); } + protected int doCallModify(Entity entity) { + return delegateUpdate(downcast(entity)); + } + protected int delegateUpdateNonstrict(GroupInfo e) { if (!processBeforeUpdate(e)) { return 1; } - return getMyDao().updateNonstrictModifiedOnly(e); + return invoke(createUpdateNonstrictEntityCommand(e)); } protected int delegateDelete(GroupInfo e) { if (!processBeforeDelete(e)) { return 1; } - return getMyDao().delete(e); + return invoke(createDeleteEntityCommand(e)); } + protected int doCallRemove(Entity entity) { + return delegateDelete(downcast(entity)); + } + protected int delegateDeleteNonstrict(GroupInfo e) { if (!processBeforeDelete(e)) { return 1; } - return getMyDao().deleteNonstrict(e); + return invoke(createDeleteNonstrictEntityCommand(e)); } protected int[] delegateInsertList(List ls) { - assertObjectNotNull("groupInfoList", ls); - return getMyDao().insertList(helpFilterBeforeInsertInternally(ls)); + if (ls.isEmpty()) { + return new int[] {}; + } + return invoke(createBatchInsertEntityCommand(helpFilterBeforeInsertInternally(ls))); } + @SuppressWarnings("unchecked") + protected int[] doCreateList(List ls) { + return delegateInsertList((List) ls); + } + protected int[] delegateUpdateList(List ls) { - assertObjectNotNull("groupInfoList", ls); - return getMyDao().updateList(helpFilterBeforeUpdateInternally(ls)); + if (ls.isEmpty()) { + return new int[] {}; + } + return invoke(createBatchUpdateEntityCommand(helpFilterBeforeUpdateInternally(ls))); } + @SuppressWarnings("unchecked") + protected int[] doModifyList(List ls) { + return delegateUpdateList((List) ls); + } + protected int[] delegateUpdateListNonstrict(List ls) { - assertObjectNotNull("groupInfoList", ls); - return getMyDao().updateListNonstrict( - helpFilterBeforeUpdateInternally(ls)); + if (ls.isEmpty()) { + return new int[] {}; + } + return invoke(createBatchUpdateNonstrictEntityCommand(helpFilterBeforeUpdateInternally(ls))); } protected int[] delegateDeleteList(List ls) { - assertObjectNotNull("groupInfoList", ls); - return getMyDao().deleteList(helpFilterBeforeDeleteInternally(ls)); + if (ls.isEmpty()) { + return new int[] {}; + } + return invoke(createBatchDeleteEntityCommand(helpFilterBeforeDeleteInternally(ls))); } + @SuppressWarnings("unchecked") + protected int[] doRemoveList(List ls) { + return delegateDeleteList((List) ls); + } + protected int[] delegateDeleteListNonstrict(List ls) { - assertObjectNotNull("groupInfoList", ls); - return getMyDao().deleteListNonstrict( - helpFilterBeforeDeleteInternally(ls)); + if (ls.isEmpty()) { + return new int[] {}; + } + return invoke(createBatchDeleteNonstrictEntityCommand(helpFilterBeforeDeleteInternally(ls))); } //========================================================================== Modified: todolist/trunk/src/main/java/jp/sf/pal/todolist/db/bsbhv/BsGroupMappingBhv.java =================================================================== --- todolist/trunk/src/main/java/jp/sf/pal/todolist/db/bsbhv/BsGroupMappingBhv.java 2008-12-27 22:20:45 UTC (rev 1632) +++ todolist/trunk/src/main/java/jp/sf/pal/todolist/db/bsbhv/BsGroupMappingBhv.java 2008-12-27 22:21:53 UTC (rev 1633) @@ -1,9 +1,8 @@ package jp.sf.pal.todolist.db.bsbhv; import java.util.List; +import java.util.Map; -import jp.sf.pal.todolist.db.allcommon.DaoReadable; -import jp.sf.pal.todolist.db.allcommon.DaoWritable; import jp.sf.pal.todolist.db.allcommon.Entity; import jp.sf.pal.todolist.db.allcommon.bhv.setup.ValueLabelSetupper; import jp.sf.pal.todolist.db.allcommon.cbean.ConditionBean; @@ -16,13 +15,12 @@ import jp.sf.pal.todolist.db.allcommon.dbmeta.DBMeta; import jp.sf.pal.todolist.db.bsentity.dbmeta.GroupMappingDbm; import jp.sf.pal.todolist.db.cbean.GroupMappingCB; -import jp.sf.pal.todolist.db.exdao.GroupMappingDao; import jp.sf.pal.todolist.db.exentity.GroupInfo; import jp.sf.pal.todolist.db.exentity.GroupMapping; import jp.sf.pal.todolist.db.exentity.UserInfo; /** - * The behavior of GROUP_MAPPING. + * The behavior of GROUP_MAPPING that the type is TABLE.
* *
  * [primary-key]
@@ -67,12 +65,6 @@
 
     //==========================================================================
     // =========
-    // Attribute
-    // =========
-    protected GroupMappingDao _dao;
-
-    //==========================================================================
-    // =========
     // Table name
     // ==========
     /** @return The name on database of table. (NotNull) */
@@ -84,39 +76,18 @@
     // =========
     // DBMeta
     // ======
-    /** @return The meta data of the database. (NotNull) */
+    /** @return The instance of DBMeta. (NotNull) */
     public DBMeta getDBMeta() {
         return GroupMappingDbm.getInstance();
     }
 
-    /** @return The meta data of the database as my table type. (NotNull) */
+    /** @return The instance of DBMeta as my table type. (NotNull) */
     public GroupMappingDbm getMyDBMeta() {
         return GroupMappingDbm.getInstance();
     }
 
     //==========================================================================
     // =========
-    // Dao Accessor
-    // ============
-    public GroupMappingDao getMyDao() {
-        return _dao;
-    }
-
-    public void setMyDao(GroupMappingDao dao) {
-        assertObjectNotNull("dao", dao);
-        _dao = dao;
-    }
-
-    public DaoReadable getDaoReadable() {
-        return getMyDao();
-    }
-
-    public DaoWritable getDaoWritable() {
-        return getMyDao();
-    }
-
-    //==========================================================================
-    // =========
     // New Instance
     // ============
     public Entity newEntity() {
@@ -146,7 +117,7 @@
      * @return The selected count.
      */
     public int selectCount(GroupMappingCB cb) {
-        assertConditionBeanNotNull(cb);
+        assertCBNotNull(cb);
         return delegateSelectCount(cb);
     }
 
@@ -226,7 +197,7 @@
      * @return The result bean of selected list. (NotNull)
      */
     public ListResultBean selectList(GroupMappingCB cb) {
-        assertConditionBeanNotNull(cb);
+        assertCBNotNull(cb);
         return new ResultBeanBuilder(getTableDbName())
                 .buildListResultBean(cb, delegateSelectList(cb));
     }
@@ -242,7 +213,7 @@
      * @return The result bean of selected page. (NotNull)
      */
     public PagingResultBean selectPage(final GroupMappingCB cb) {
-        assertConditionBeanNotNull(cb);
+        assertCBNotNull(cb);
         final PagingInvoker invoker = new PagingInvoker(
                 getTableDbName());
         final PagingHandler handler = new PagingHandler() {
@@ -263,6 +234,32 @@
 
     //==========================================================================
     // =========
+    // Scalar Select
+    // =============
+    /**
+     * Select the scalar value derived by a function. 
Call a function + * method after this method called like as follows: + * + *
+     * groupMappingBhv.scalarSelect(Date.class).max(new ScalarQuery(GroupMappingCB cb) {
+     *     cb.specify().columnXxxDatetime(); // the required specification of target column
+     *     cb.query().setXxxName_PrefixSearch("S"); // query as you like it
+     * });
+     * 
+ * + * @param The type of result. + * @param resultType The type of result. (NotNull) + * @return The scalar value derived by a function. (Nullable) + */ + public SLFunction scalarSelect( + Class resultType) { + GroupMappingCB cb = newMyConditionBean(); + cb.xsetupForScalarSelect(); + return new SLFunction(cb, resultType); + } + + //========================================================================== + // ========= // Various Select // ============== /** @@ -272,8 +269,7 @@ * @param valueLabelSetupper The setupper of value-label. (NotNull) * @return The list of value-label. (NotNull) */ - public List> selectValueLabelList( - GroupMappingCB cb, + public List> selectValueLabelList(GroupMappingCB cb, ValueLabelSetupper valueLabelSetupper) { return createValueLabelList(selectList(cb), valueLabelSetupper); } @@ -285,8 +281,8 @@ //========================================================================== // ========= - // Pullout Foreign - // =============== + // Pull out Foreign + // ================ /** * Pull out the list of foreign table 'GroupInfo'. * @@ -499,11 +495,11 @@ */ public int queryUpdate(GroupMapping groupMapping, GroupMappingCB cb) { assertObjectNotNull("groupMapping", groupMapping); - assertConditionBeanNotNull(cb); + assertCBNotNull(cb); setupCommonColumnOfUpdateIfNeeds(groupMapping); filterEntityOfUpdate(groupMapping); assertEntityOfUpdate(groupMapping); - return getMyDao().updateByQuery(cb, groupMapping); + return invoke(createQueryUpdateEntityCBCommand(groupMapping, cb)); } /** @@ -513,8 +509,8 @@ * @return The deleted count. */ public int queryDelete(GroupMappingCB cb) { - assertConditionBeanNotNull(cb); - return getMyDao().deleteByQuery(cb); + assertCBNotNull(cb); + return invoke(createQueryDeleteCBCommand(cb)); } //========================================================================== @@ -526,19 +522,27 @@ // ========= // Delegate Method // =============== + // [Behavior Command] // ----------------------------------------------------- // Select // ------ protected int delegateSelectCount(GroupMappingCB cb) { - assertConditionBeanNotNull(cb); - return getMyDao().selectCount(cb); + return invoke(createSelectCountCBCommand(cb)); } + protected int doCallReadCount(ConditionBean cb) { + return delegateSelectCount((GroupMappingCB) cb); + } + protected List delegateSelectList(GroupMappingCB cb) { - assertConditionBeanNotNull(cb); - return getMyDao().selectList(cb); + return invoke(createSelectListCBCommand(cb, GroupMapping.class)); } + @SuppressWarnings("unchecked") + protected List doCallReadList(ConditionBean cb) { + return (List) delegateSelectList((GroupMappingCB) cb); + } + // ----------------------------------------------------- // Update // ------ @@ -546,38 +550,71 @@ if (!processBeforeInsert(e)) { return 1; } - return getMyDao().insert(e); + return invoke(createInsertEntityCommand(e)); } + protected int doCallCreate(Entity entity) { + return delegateInsert(downcast(entity)); + } + protected int delegateUpdate(GroupMapping e) { if (!processBeforeUpdate(e)) { return 1; } - return getMyDao().updateModifiedOnly(e); + return invoke(createUpdateEntityCommand(e)); } + protected int doCallModify(Entity entity) { + return delegateUpdate(downcast(entity)); + } + protected int delegateDelete(GroupMapping e) { if (!processBeforeDelete(e)) { return 1; } - return getMyDao().delete(e); + return invoke(createDeleteEntityCommand(e)); } + protected int doCallRemove(Entity entity) { + return delegateDelete(downcast(entity)); + } + protected int[] delegateInsertList(List ls) { - assertObjectNotNull("groupMappingList", ls); - return getMyDao().insertList(helpFilterBeforeInsertInternally(ls)); + if (ls.isEmpty()) { + return new int[] {}; + } + return invoke(createBatchInsertEntityCommand(helpFilterBeforeInsertInternally(ls))); } + @SuppressWarnings("unchecked") + protected int[] doCreateList(List ls) { + return delegateInsertList((List) ls); + } + protected int[] delegateUpdateList(List ls) { - assertObjectNotNull("groupMappingList", ls); - return getMyDao().updateList(helpFilterBeforeUpdateInternally(ls)); + if (ls.isEmpty()) { + return new int[] {}; + } + return invoke(createBatchUpdateEntityCommand(helpFilterBeforeUpdateInternally(ls))); } + @SuppressWarnings("unchecked") + protected int[] doModifyList(List ls) { + return delegateUpdateList((List) ls); + } + protected int[] delegateDeleteList(List ls) { - assertObjectNotNull("groupMappingList", ls); - return getMyDao().deleteList(helpFilterBeforeDeleteInternally(ls)); + if (ls.isEmpty()) { + return new int[] {}; + } + return invoke(createBatchDeleteEntityCommand(helpFilterBeforeDeleteInternally(ls))); } + @SuppressWarnings("unchecked") + protected int[] doRemoveList(List ls) { + return delegateDeleteList((List) ls); + } + //========================================================================== // ========= // Optimistic Lock Info Modified: todolist/trunk/src/main/java/jp/sf/pal/todolist/db/bsbhv/BsRoleInfoBhv.java =================================================================== --- todolist/trunk/src/main/java/jp/sf/pal/todolist/db/bsbhv/BsRoleInfoBhv.java 2008-12-27 22:20:45 UTC (rev 1632) +++ todolist/trunk/src/main/java/jp/sf/pal/todolist/db/bsbhv/BsRoleInfoBhv.java 2008-12-27 22:21:53 UTC (rev 1633) @@ -1,9 +1,8 @@ package jp.sf.pal.todolist.db.bsbhv; import java.util.List; +import java.util.Map; -import jp.sf.pal.todolist.db.allcommon.DaoReadable; -import jp.sf.pal.todolist.db.allcommon.DaoWritable; import jp.sf.pal.todolist.db.allcommon.Entity; import jp.sf.pal.todolist.db.allcommon.bhv.load.LoadReferrerOption; import jp.sf.pal.todolist.db.allcommon.bhv.setup.ConditionBeanSetupper; @@ -22,13 +21,12 @@ import jp.sf.pal.todolist.db.cbean.UserInfoCB; import jp.sf.pal.todolist.db.exbhv.RoleMappingBhv; import jp.sf.pal.todolist.db.exbhv.UserInfoBhv; -import jp.sf.pal.todolist.db.exdao.RoleInfoDao; import jp.sf.pal.todolist.db.exentity.RoleInfo; import jp.sf.pal.todolist.db.exentity.RoleMapping; import jp.sf.pal.todolist.db.exentity.UserInfo; /** - * The behavior of ROLE_INFO. + * The behavior of ROLE_INFO that the type is TABLE.
* *
  * [primary-key]
@@ -73,12 +71,6 @@
 
     //==========================================================================
     // =========
-    // Attribute
-    // =========
-    protected RoleInfoDao _dao;
-
-    //==========================================================================
-    // =========
     // Table name
     // ==========
     /** @return The name on database of table. (NotNull) */
@@ -90,39 +82,18 @@
     // =========
     // DBMeta
     // ======
-    /** @return The meta data of the database. (NotNull) */
+    /** @return The instance of DBMeta. (NotNull) */
     public DBMeta getDBMeta() {
         return RoleInfoDbm.getInstance();
     }
 
-    /** @return The meta data of the database as my table type. (NotNull) */
+    /** @return The instance of DBMeta as my table type. (NotNull) */
     public RoleInfoDbm getMyDBMeta() {
         return RoleInfoDbm.getInstance();
     }
 
     //==========================================================================
     // =========
-    // Dao Accessor
-    // ============
-    public RoleInfoDao getMyDao() {
-        return _dao;
-    }
-
-    public void setMyDao(RoleInfoDao dao) {
-        assertObjectNotNull("dao", dao);
-        _dao = dao;
-    }
-
-    public DaoReadable getDaoReadable() {
-        return getMyDao();
-    }
-
-    public DaoWritable getDaoWritable() {
-        return getMyDao();
-    }
-
-    //==========================================================================
-    // =========
     // New Instance
     // ============
     public Entity newEntity() {
@@ -152,7 +123,7 @@
      * @return The selected count.
      */
     public int selectCount(RoleInfoCB cb) {
-        assertConditionBeanNotNull(cb);
+        assertCBNotNull(cb);
         return delegateSelectCount(cb);
     }
 
@@ -229,7 +200,7 @@
      * @return The result bean of selected list. (NotNull)
      */
     public ListResultBean selectList(RoleInfoCB cb) {
-        assertConditionBeanNotNull(cb);
+        assertCBNotNull(cb);
         return new ResultBeanBuilder(getTableDbName())
                 .buildListResultBean(cb, delegateSelectList(cb));
     }
@@ -245,7 +216,7 @@
      * @return The result bean of selected page. (NotNull)
      */
     public PagingResultBean selectPage(final RoleInfoCB cb) {
-        assertConditionBeanNotNull(cb);
+        assertCBNotNull(cb);
         final PagingInvoker invoker = new PagingInvoker(
                 getTableDbName());
         final PagingHandler handler = new PagingHandler() {
@@ -266,6 +237,32 @@
 
     //==========================================================================
     // =========
+    // Scalar Select
+    // =============
+    /**
+     * Select the scalar value derived by a function. 
Call a function + * method after this method called like as follows: + * + *
+     * roleInfoBhv.scalarSelect(Date.class).max(new ScalarQuery(RoleInfoCB cb) {
+     *     cb.specify().columnXxxDatetime(); // the required specification of target column
+     *     cb.query().setXxxName_PrefixSearch("S"); // query as you like it
+     * });
+     * 
+ * + * @param The type of result. + * @param resultType The type of result. (NotNull) + * @return The scalar value derived by a function. (Nullable) + */ + public SLFunction scalarSelect( + Class resultType) { + RoleInfoCB cb = newMyConditionBean(); + cb.xsetupForScalarSelect(); + return new SLFunction(cb, resultType); + } + + //========================================================================== + // ========= // Various Select // ============== /** @@ -275,8 +272,8 @@ * @param valueLabelSetupper The setupper of value-label. (NotNull) * @return The list of value-label. (NotNull) */ - public List> selectValueLabelList( - RoleInfoCB cb, ValueLabelSetupper valueLabelSetupper) { + public List> selectValueLabelList(RoleInfoCB cb, + ValueLabelSetupper valueLabelSetupper) { return createValueLabelList(selectList(cb), valueLabelSetupper); } @@ -467,8 +464,8 @@ //========================================================================== // ========= - // Pullout Foreign - // =============== + // Pull out Foreign + // ================ //========================================================================== // ========= @@ -764,11 +761,11 @@ */ public int queryUpdate(RoleInfo roleInfo, RoleInfoCB cb) { assertObjectNotNull("roleInfo", roleInfo); - assertConditionBeanNotNull(cb); + assertCBNotNull(cb); setupCommonColumnOfUpdateIfNeeds(roleInfo); filterEntityOfUpdate(roleInfo); assertEntityOfUpdate(roleInfo); - return getMyDao().updateByQuery(cb, roleInfo); + return invoke(createQueryUpdateEntityCBCommand(roleInfo, cb)); } /** @@ -778,8 +775,8 @@ * @return The deleted count. */ public int queryDelete(RoleInfoCB cb) { - assertConditionBeanNotNull(cb); - return getMyDao().deleteByQuery(cb); + assertCBNotNull(cb); + return invoke(createQueryDeleteCBCommand(cb)); } //========================================================================== @@ -791,19 +788,27 @@ // ========= // Delegate Method // =============== + // [Behavior Command] // ----------------------------------------------------- // Select // ------ protected int delegateSelectCount(RoleInfoCB cb) { - assertConditionBeanNotNull(cb); - return getMyDao().selectCount(cb); + return invoke(createSelectCountCBCommand(cb)); } + protected int doCallReadCount(ConditionBean cb) { + return delegateSelectCount((RoleInfoCB) cb); + } + protected List delegateSelectList(RoleInfoCB cb) { - assertConditionBeanNotNull(cb); - return getMyDao().selectList(cb); + return invoke(createSelectListCBCommand(cb, RoleInfo.class)); } + @SuppressWarnings("unchecked") + protected List doCallReadList(ConditionBean cb) { + return (List) delegateSelectList((RoleInfoCB) cb); + } + // ----------------------------------------------------- // Update // ------ @@ -811,62 +816,97 @@ if (!processBeforeInsert(e)) { return 1; } - return getMyDao().insert(e); + return invoke(createInsertEntityCommand(e)); } + protected int doCallCreate(Entity entity) { + return delegateInsert(downcast(entity)); + } + protected int delegateUpdate(RoleInfo e) { if (!processBeforeUpdate(e)) { return 1; } - return getMyDao().updateModifiedOnly(e); + return invoke(createUpdateEntityCommand(e)); } + protected int doCallModify(Entity entity) { + return delegateUpdate(downcast(entity)); + } + protected int delegateUpdateNonstrict(RoleInfo e) { if (!processBeforeUpdate(e)) { return 1; } - return getMyDao().updateNonstrictModifiedOnly(e); + return invoke(createUpdateNonstrictEntityCommand(e)); } protected int delegateDelete(RoleInfo e) { if (!processBeforeDelete(e)) { return 1; } - return getMyDao().delete(e); + return invoke(createDeleteEntityCommand(e)); } + protected int doCallRemove(Entity entity) { + return delegateDelete(downcast(entity)); + } + protected int delegateDeleteNonstrict(RoleInfo e) { if (!processBeforeDelete(e)) { return 1; } - return getMyDao().deleteNonstrict(e); + return invoke(createDeleteNonstrictEntityCommand(e)); } protected int[] delegateInsertList(List ls) { - assertObjectNotNull("roleInfoList", ls); - return getMyDao().insertList(helpFilterBeforeInsertInternally(ls)); + if (ls.isEmpty()) { + return new int[] {}; + } + return invoke(createBatchInsertEntityCommand(helpFilterBeforeInsertInternally(ls))); } + @SuppressWarnings("unchecked") + protected int[] doCreateList(List ls) { + return delegateInsertList((List) ls); + } + protected int[] delegateUpdateList(List ls) { - assertObjectNotNull("roleInfoList", ls); - return getMyDao().updateList(helpFilterBeforeUpdateInternally(ls)); + if (ls.isEmpty()) { + return new int[] {}; + } + return invoke(createBatchUpdateEntityCommand(helpFilterBeforeUpdateInternally(ls))); } + @SuppressWarnings("unchecked") + protected int[] doModifyList(List ls) { + return delegateUpdateList((List) ls); + } + protected int[] delegateUpdateListNonstrict(List ls) { - assertObjectNotNull("roleInfoList", ls); - return getMyDao().updateListNonstrict( - helpFilterBeforeUpdateInternally(ls)); + if (ls.isEmpty()) { + return new int[] {}; + } + return invoke(createBatchUpdateNonstrictEntityCommand(helpFilterBeforeUpdateInternally(ls))); } protected int[] delegateDeleteList(List ls) { - assertObjectNotNull("roleInfoList", ls); - return getMyDao().deleteList(helpFilterBeforeDeleteInternally(ls)); + if (ls.isEmpty()) { + return new int[] {}; + } + return invoke(createBatchDeleteEntityCommand(helpFilterBeforeDeleteInternally(ls))); } + @SuppressWarnings("unchecked") + protected int[] doRemoveList(List ls) { + return delegateDeleteList((List) ls); + } + protected int[] delegateDeleteListNonstrict(List ls) { - assertObjectNotNull("roleInfoList", ls); - return getMyDao().deleteListNonstrict( - helpFilterBeforeDeleteInternally(ls)); + if (ls.isEmpty()) { + return new int[] {}; + } + return invoke(createBatchDeleteNonstrictEntityCommand(helpFilterBeforeDeleteInternally(ls))); } //========================================================================== Modified: todolist/trunk/src/main/java/jp/sf/pal/todolist/db/bsbhv/BsRoleMappingBhv.java =================================================================== --- todolist/trunk/src/main/java/jp/sf/pal/todolist/db/bsbhv/BsRoleMappingBhv.java 2008-12-27 22:20:45 UTC (rev 1632) +++ todolist/trunk/src/main/java/jp/sf/pal/todolist/db/bsbhv/BsRoleMappingBhv.java 2008-12-27 22:21:53 UTC (rev 1633) @@ -1,9 +1,8 @@ package jp.sf.pal.todolist.db.bsbhv; import java.util.List; +import java.util.Map; -import jp.sf.pal.todolist.db.allcommon.DaoReadable; -import jp.sf.pal.todolist.db.allcommon.DaoWritable; import jp.sf.pal.todolist.db.allcommon.Entity; import jp.sf.pal.todolist.db.allcommon.bhv.setup.ValueLabelSetupper; import jp.sf.pal.todolist.db.allcommon.cbean.ConditionBean; @@ -16,13 +15,12 @@ import jp.sf.pal.todolist.db.allcommon.dbmeta.DBMeta; import jp.sf.pal.todolist.db.bsentity.dbmeta.RoleMappingDbm; import jp.sf.pal.todolist.db.cbean.RoleMappingCB; -import jp.sf.pal.todolist.db.exdao.RoleMappingDao; import jp.sf.pal.todolist.db.exentity.RoleInfo; import jp.sf.pal.todolist.db.exentity.RoleMapping; import jp.sf.pal.todolist.db.exentity.UserInfo; /** - * The behavior of ROLE_MAPPING. + * The behavior of ROLE_MAPPING that the type is TABLE.
* *
  * [primary-key]
@@ -67,12 +65,6 @@
 
     //==========================================================================
     // =========
-    // Attribute
-    // =========
-    protected RoleMappingDao _dao;
-
-    //==========================================================================
-    // =========
     // Table name
     // ==========
     /** @return The name on database of table. (NotNull) */
@@ -84,39 +76,18 @@
     // =========
     // DBMeta
     // ======
-    /** @return The meta data of the database. (NotNull) */
+    /** @return The instance of DBMeta. (NotNull) */
     public DBMeta getDBMeta() {
         return RoleMappingDbm.getInstance();
     }
 
-    /** @return The meta data of the database as my table type. (NotNull) */
+    /** @return The instance of DBMeta as my table type. (NotNull) */
     public RoleMappingDbm getMyDBMeta() {
         return RoleMappingDbm.getInstance();
     }
 
     //==========================================================================
     // =========
-    // Dao Accessor
-    // ============
-    public RoleMappingDao getMyDao() {
-        return _dao;
-    }
-
-    public void setMyDao(RoleMappingDao dao) {
-        assertObjectNotNull("dao", dao);
-        _dao = dao;
-    }
-
-    public DaoReadable getDaoReadable() {
-        return getMyDao();
-    }
-
-    public DaoWritable getDaoWritable() {
-        return getMyDao();
-    }
-
-    //==========================================================================
-    // =========
     // New Instance
     // ============
     public Entity newEntity() {
@@ -146,7 +117,7 @@
      * @return The selected count.
      */
     public int selectCount(RoleMappingCB cb) {
-        assertConditionBeanNotNull(cb);
+        assertCBNotNull(cb);
         return delegateSelectCount(cb);
     }
 
@@ -223,7 +194,7 @@
      * @return The result bean of selected list. (NotNull)
      */
     public ListResultBean selectList(RoleMappingCB cb) {
-        assertConditionBeanNotNull(cb);
+        assertCBNotNull(cb);
         return new ResultBeanBuilder(getTableDbName())
                 .buildListResultBean(cb, delegateSelectList(cb));
     }
@@ -239,7 +210,7 @@
      * @return The result bean of selected page. (NotNull)
      */
     public PagingResultBean selectPage(final RoleMappingCB cb) {
-        assertConditionBeanNotNull(cb);
+        assertCBNotNull(cb);
         final PagingInvoker invoker = new PagingInvoker(
                 getTableDbName());
         final PagingHandler handler = new PagingHandler() {
@@ -260,6 +231,32 @@
 
     //==========================================================================
     // =========
+    // Scalar Select
+    // =============
+    /**
+     * Select the scalar value derived by a function. 
Call a function + * method after this method called like as follows: + * + *
+     * roleMappingBhv.scalarSelect(Date.class).max(new ScalarQuery(RoleMappingCB cb) {
+     *     cb.specify().columnXxxDatetime(); // the required specification of target column
+     *     cb.query().setXxxName_PrefixSearch("S"); // query as you like it
+     * });
+     * 
+ * + * @param The type of result. + * @param resultType The type of result. (NotNull) + * @return The scalar value derived by a function. (Nullable) + */ + public SLFunction scalarSelect( + Class resultType) { + RoleMappingCB cb = newMyConditionBean(); + cb.xsetupForScalarSelect(); + return new SLFunction(cb, resultType); + } + + //========================================================================== + // ========= // Various Select // ============== /** @@ -269,8 +266,8 @@ * @param valueLabelSetupper The setupper of value-label. (NotNull) * @return The list of value-label. (NotNull) */ - public List> selectValueLabelList( - RoleMappingCB cb, ValueLabelSetupper valueLabelSetupper) { + public List> selectValueLabelList(RoleMappingCB cb, + ValueLabelSetupper valueLabelSetupper) { return createValueLabelList(selectList(cb), valueLabelSetupper); } @@ -281,8 +278,8 @@ //========================================================================== // ========= - // Pullout Foreign - // =============== + // Pull out Foreign + // ================ /** * Pull out the list of foreign table 'RoleInfo'. * @@ -494,11 +491,11 @@ */ public int queryUpdate(RoleMapping roleMapping, RoleMappingCB cb) { assertObjectNotNull("roleMapping", roleMapping); - assertConditionBeanNotNull(cb); + assertCBNotNull(cb); setupCommonColumnOfUpdateIfNeeds(roleMapping); filterEntityOfUpdate(roleMapping); assertEntityOfUpdate(roleMapping); - return getMyDao().updateByQuery(cb, roleMapping); + return invoke(createQueryUpdateEntityCBCommand(roleMapping, cb)); } /** @@ -508,8 +505,8 @@ * @return The deleted count. */ public int queryDelete(RoleMappingCB cb) { - assertConditionBeanNotNull(cb); - return getMyDao().deleteByQuery(cb); + assertCBNotNull(cb); + return invoke(createQueryDeleteCBCommand(cb)); } //========================================================================== @@ -521,19 +518,27 @@ // ========= // Delegate Method // =============== + // [Behavior Command] // ----------------------------------------------------- // Select // ------ protected int delegateSelectCount(RoleMappingCB cb) { - assertConditionBeanNotNull(cb); - return getMyDao().selectCount(cb); + return invoke(createSelectCountCBCommand(cb)); } + protected int doCallReadCount(ConditionBean cb) { + return delegateSelectCount((RoleMappingCB) cb); + } + protected List delegateSelectList(RoleMappingCB cb) { - assertConditionBeanNotNull(cb); - return getMyDao().selectList(cb); + return invoke(createSelectListCBCommand(cb, RoleMapping.class)); } + @SuppressWarnings("unchecked") + protected List doCallReadList(ConditionBean cb) { + return (List) delegateSelectList((RoleMappingCB) cb); + } + // ----------------------------------------------------- // Update // ------ @@ -541,38 +546,71 @@ if (!processBeforeInsert(e)) { return 1; } - return getMyDao().insert(e); + return invoke(createInsertEntityCommand(e)); } + protected int doCallCreate(Entity entity) { + return delegateInsert(downcast(entity)); + } + protected int delegateUpdate(RoleMapping e) { if (!processBeforeUpdate(e)) { return 1; } - return getMyDao().updateModifiedOnly(e); + return invoke(createUpdateEntityCommand(e)); } + protected int doCallModify(Entity entity) { + return delegateUpdate(downcast(entity)); + } + protected int delegateDelete(RoleMapping e) { if (!processBeforeDelete(e)) { return 1; } - return getMyDao().delete(e); + return invoke(createDeleteEntityCommand(e)); } + protected int doCallRemove(Entity entity) { + return delegateDelete(downcast(entity)); + } + protected int[] delegateInsertList(List ls) { - assertObjectNotNull("roleMappingList", ls); - return getMyDao().insertList(helpFilterBeforeInsertInternally(ls)); + if (ls.isEmpty()) { + return new int[] {}; + } + return invoke(createBatchInsertEntityCommand(helpFilterBeforeInsertInternally(ls))); } + @SuppressWarnings("unchecked") + protected int[] doCreateList(List ls) { + return delegateInsertList((List) ls); + } + protected int[] delegateUpdateList(List ls) { - assertObjectNotNull("roleMappingList", ls); - return getMyDao().updateList(helpFilterBeforeUpdateInternally(ls)); + if (ls.isEmpty()) { + return new int[] {}; + } + return invoke(createBatchUpdateEntityCommand(helpFilterBeforeUpdateInternally(ls))); } + @SuppressWarnings("unchecked") + protected int[] doModifyList(List ls) { + return delegateUpdateList((List) ls); + } + protected int[] delegateDeleteList(List ls) { - assertObjectNotNull("roleMappingList", ls); - return getMyDao().deleteList(helpFilterBeforeDeleteInternally(ls)); + if (ls.isEmpty()) { + return new int[] {}; + } + return invoke(createBatchDeleteEntityCommand(helpFilterBeforeDeleteInternally(ls))); } + @SuppressWarnings("unchecked") + protected int[] doRemoveList(List ls) { + return delegateDeleteList((List) ls); + } + //========================================================================== // ========= // Optimistic Lock Info Modified: todolist/trunk/src/main/java/jp/sf/pal/todolist/db/bsbhv/BsTodoBhv.java =================================================================== --- todolist/trunk/src/main/java/jp/sf/pal/todolist/db/bsbhv/BsTodoBhv.java 2008-12-27 22:20:45 UTC (rev 1632) +++ todolist/trunk/src/main/java/jp/sf/pal/todolist/db/bsbhv/BsTodoBhv.java 2008-12-27 22:21:53 UTC (rev 1633) @@ -1,9 +1,8 @@ package jp.sf.pal.todolist.db.bsbhv; import java.util.List; +import java.util.Map; -import jp.sf.pal.todolist.db.allcommon.DaoReadable; -import jp.sf.pal.todolist.db.allcommon.DaoWritable; import jp.sf.pal.todolist.db.allcommon.Entity; import jp.sf.pal.todolist.db.allcommon.bhv.load.LoadReferrerOption; import jp.sf.pal.todolist.db.allcommon.bhv.setup.ConditionBeanSetupper; @@ -20,13 +19,12 @@ import jp.sf.pal.todolist.db.cbean.TodoCB; import jp.sf.pal.todolist.db.cbean.TodoMappingCB; import jp.sf.pal.todolist.db.exbhv.TodoMappingBhv; -import jp.sf.pal.todolist.db.exdao.TodoDao; import jp.sf.pal.todolist.db.exentity.Todo; import jp.sf.pal.todolist.db.exentity.TodoMapping; import jp.sf.pal.todolist.db.exentity.UserInfo; /** - * The behavior of TODO. + * The behavior of TODO that the type is TABLE.
* *
  * [primary-key]
@@ -71,12 +69,6 @@
 
     //==========================================================================
     // =========
-    // Attribute
-    // =========
-    protected TodoDao _dao;
-
-    //==========================================================================
-    // =========
     // Table name
     // ==========
     /** @return The name on database of table. (NotNull) */
@@ -88,39 +80,18 @@
     // =========
     // DBMeta
     // ======
-    /** @return The meta data of the database. (NotNull) */
+    /** @return The instance of DBMeta. (NotNull) */
     public DBMeta getDBMeta() {
         return TodoDbm.getInstance();
     }
 
-    /** @return The meta data of the database as my table type. (NotNull) */
+    /** @return The instance of DBMeta as my table type. (NotNull) */
     public TodoDbm getMyDBMeta() {
         return TodoDbm.getInstance();
     }
 
     //==========================================================================
     // =========
-    // Dao Accessor
-    // ============
-    public TodoDao getMyDao() {
-        return _dao;
-    }
-
-    public void setMyDao(TodoDao dao) {
-        assertObjectNotNull("dao", dao);
-        _dao = dao;
-    }
-
-    public DaoReadable getDaoReadable() {
-        return getMyDao();
-    }
-
-    public DaoWritable getDaoWritable() {
-        return getMyDao();
-    }
-
-    //==========================================================================
-    // =========
     // New Instance
     // ============
     public Entity newEntity() {
@@ -150,7 +121,7 @@
      * @return The selected count.
      */
     public int selectCount(TodoCB cb) {
-        assertConditionBeanNotNull(cb);
+        assertCBNotNull(cb);
         return delegateSelectCount(cb);
     }
 
@@ -227,7 +198,7 @@
      * @return The result bean of selected list. (NotNull)
      */
     public ListResultBean selectList(TodoCB cb) {
-        assertConditionBeanNotNull(cb);
+        assertCBNotNull(cb);
         return new ResultBeanBuilder(getTableDbName())
                 .buildListResultBean(cb, delegateSelectList(cb));
     }
@@ -243,7 +214,7 @@
      * @return The result bean of selected page. (NotNull)
      */
     public PagingResultBean selectPage(final TodoCB cb) {
-        assertConditionBeanNotNull(cb);
+        assertCBNotNull(cb);
         final PagingInvoker invoker = new PagingInvoker(
                 getTableDbName());
         final PagingHandler handler = new PagingHandler() {
@@ -264,6 +235,32 @@
 
     //==========================================================================
     // =========
+    // Scalar Select
+    // =============
+    /**
+     * Select the scalar value derived by a function. 
Call a function + * method after this method called like as follows: + * + *
+     * todoBhv.scalarSelect(Date.class).max(new ScalarQuery(TodoCB cb) {
+     *     cb.specify().columnXxxDatetime(); // the required specification of target column
+     *     cb.query().setXxxName_PrefixSearch("S"); // query as you like it
+     * });
+     * 
+ * + * @param The type of result. + * @param resultType The type of result. (NotNull) + * @return The scalar value derived by a function. (Nullable) + */ + public SLFunction scalarSelect( + Class resultType) { + TodoCB cb = newMyConditionBean(); + cb.xsetupForScalarSelect(); + return new SLFunction(cb, resultType); + } + + //========================================================================== + // ========= // Various Select // ============== /** @@ -273,7 +270,7 @@ * @param valueLabelSetupper The setupper of value-label. (NotNull) * @return The list of value-label. (NotNull) */ - public List> selectValueLabelList(TodoCB cb, + public List> selectValueLabelList(TodoCB cb, ValueLabelSetupper valueLabelSetupper) { return createValueLabelList(selectList(cb), valueLabelSetupper); } @@ -374,8 +371,8 @@ //========================================================================== // ========= - // Pullout Foreign - // =============== + // Pull out Foreign + // ================ /** * Pull out the list of foreign table 'UserInfo'. * @@ -684,11 +681,11 @@ */ public int queryUpdate(Todo todo, TodoCB cb) { assertObjectNotNull("todo", todo); - assertConditionBeanNotNull(cb); + assertCBNotNull(cb); setupCommonColumnOfUpdateIfNeeds(todo); filterEntityOfUpdate(todo); assertEntityOfUpdate(todo); - return getMyDao().updateByQuery(cb, todo); + return invoke(createQueryUpdateEntityCBCommand(todo, cb)); } /** @@ -698,8 +695,8 @@ * @return The deleted count. */ public int queryDelete(TodoCB cb) { - assertConditionBeanNotNull(cb); - return getMyDao().deleteByQuery(cb); + assertCBNotNull(cb); + return invoke(createQueryDeleteCBCommand(cb)); } //========================================================================== @@ -711,19 +708,27 @@ // ========= // Delegate Method // =============== + // [Behavior Command] // ----------------------------------------------------- // Select // ------ protected int delegateSelectCount(TodoCB cb) { - assertConditionBeanNotNull(cb); - return getMyDao().selectCount(cb); + return invoke(createSelectCountCBCommand(cb)); } + protected int doCallReadCount(ConditionBean cb) { + return delegateSelectCount((TodoCB) cb); + } + protected List delegateSelectList(TodoCB cb) { - assertConditionBeanNotNull(cb); - return getMyDao().selectList(cb); + return invoke(createSelectListCBCommand(cb, Todo.class)); } + @SuppressWarnings("unchecked") + protected List doCallReadList(ConditionBean cb) { + return (List) delegateSelectList((TodoCB) cb); + } + // ----------------------------------------------------- // Update // ------ @@ -731,62 +736,97 @@ if (!processBeforeInsert(e)) { return 1; } - return getMyDao().insert(e); + return invoke(createInsertEntityCommand(e)); } + protected int doCallCreate(Entity entity) { + return delegateInsert(downcast(entity)); + } + protected int delegateUpdate(Todo e) { if (!processBeforeUpdate(e)) { return 1; } - return getMyDao().updateModifiedOnly(e); + return invoke(createUpdateEntityCommand(e)); } + protected int doCallModify(Entity entity) { + return delegateUpdate(downcast(entity)); + } + protected int delegateUpdateNonstrict(Todo e) { if (!processBeforeUpdate(e)) { return 1; } - return getMyDao().updateNonstrictModifiedOnly(e); + return invoke(createUpdateNonstrictEntityCommand(e)); } protected int delegateDelete(Todo e) { if (!processBeforeDelete(e)) { return 1; } - return getMyDao().delete(e); + return invoke(createDeleteEntityCommand(e)); } + protected int doCallRemove(Entity entity) { + return delegateDelete(downcast(entity)); + } + protected int delegateDeleteNonstrict(Todo e) { if (!processBeforeDelete(e)) { return 1; } - return getMyDao().deleteNonstrict(e); + return invoke(createDeleteNonstrictEntityCommand(e)); } protected int[] delegateInsertList(List ls) { - assertObjectNotNull("todoList", ls); - return getMyDao().insertList(helpFilterBeforeInsertInternally(ls)); + if (ls.isEmpty()) { + return new int[] {}; + } + return invoke(createBatchInsertEntityCommand(helpFilterBeforeInsertInternally(ls))); } + @SuppressWarnings("unchecked") + protected int[] doCreateList(List ls) { + return delegateInsertList((List) ls); + } + protected int[] delegateUpdateList(List ls) { - assertObjectNotNull("todoList", ls); - return getMyDao().updateList(helpFilterBeforeUpdateInternally(ls)); + if (ls.isEmpty()) { + return new int[] {}; + } + return invoke(createBatchUpdateEntityCommand(helpFilterBeforeUpdateInternally(ls))); } + @SuppressWarnings("unchecked") + protected int[] doModifyList(List ls) { + return delegateUpdateList((List) ls); + } + protected int[] delegateUpdateListNonstrict(List ls) { - assertObjectNotNull("todoList", ls); - return getMyDao().updateListNonstrict( - helpFilterBeforeUpdateInternally(ls)); + if (ls.isEmpty()) { + return new int[] {}; + } + return invoke(createBatchUpdateNonstrictEntityCommand(helpFilterBeforeUpdateInternally(ls))); } protected int[] delegateDeleteList(List ls) { - assertObjectNotNull("todoList", ls); - return getMyDao().deleteList(helpFilterBeforeDeleteInternally(ls)); + if (ls.isEmpty()) { + return new int[] {}; + } + return invoke(createBatchDeleteEntityCommand(helpFilterBeforeDeleteInternally(ls))); } + @SuppressWarnings("unchecked") + protected int[] doRemoveList(List ls) { + return delegateDeleteList((List) ls); + } + protected int[] delegateDeleteListNonstrict(List ls) { - assertObjectNotNull("todoList", ls); - return getMyDao().deleteListNonstrict( - helpFilterBeforeDeleteInternally(ls)); + if (ls.isEmpty()) { + return new int[] {}; + } + return invoke(createBatchDeleteNonstrictEntityCommand(helpFilterBeforeDeleteInternally(ls))); } //========================================================================== Modified: todolist/trunk/src/main/java/jp/sf/pal/todolist/db/bsbhv/BsTodoCategoryBhv.java =================================================================== --- todolist/trunk/src/main/java/jp/sf/pal/todolist/db/bsbhv/BsTodoCategoryBhv.java 2008-12-27 22:20:45 UTC (rev 1632) +++ todolist/trunk/src/main/java/jp/sf/pal/todolist/db/bsbhv/BsTodoCategoryBhv.java 2008-12-27 22:21:53 UTC (rev 1633) @@ -1,9 +1,8 @@ package jp.sf.pal.todolist.db.bsbhv; import java.util.List; +import java.util.Map; -import jp.sf.pal.todolist.db.allcommon.DaoReadable; -import jp.sf.pal.todolist.db.allcommon.DaoWritable; import jp.sf.pal.todolist.db.allcommon.Entity; import jp.sf.pal.todolist.db.allcommon.bhv.load.LoadReferrerOption; import jp.sf.pal.todolist.db.allcommon.bhv.setup.ConditionBeanSetupper; @@ -20,13 +19,12 @@ import jp.sf.pal.todolist.db.cbean.TodoCategoryCB; import jp.sf.pal.todolist.db.cbean.TodoMappingCB; import jp.sf.pal.todolist.db.exbhv.TodoMappingBhv; -import jp.sf.pal.todolist.db.exdao.TodoCategoryDao; import jp.sf.pal.todolist.db.exentity.TodoCategory; import jp.sf.pal.todolist.db.exentity.TodoMapping; import jp.sf.pal.todolist.db.exentity.UserInfo; /** - * The behavior of TODO_CATEGORY. + * The behavior of TODO_CATEGORY that the type is TABLE.
* *
  * [primary-key]
@@ -71,12 +69,6 @@
 
     //==========================================================================
     // =========
-    // Attribute
-    // =========
-    protected TodoCategoryDao _dao;
-
-    //==========================================================================
-    // =========
     // Table name
     // ==========
     /** @return The name on database of table. (NotNull) */
@@ -88,39 +80,18 @@
     // =========
     // DBMeta
     // ======
-    /** @return The meta data of the database. (NotNull) */
+    /** @return The instance of DBMeta. (NotNull) */
     public DBMeta getDBMeta() {
         return TodoCategoryDbm.getInstance();
     }
 
-    /** @return The meta data of the database as my table type. (NotNull) */
+    /** @return The instance of DBMeta as my table type. (NotNull) */
     public TodoCategoryDbm getMyDBMeta() {
         return TodoCategoryDbm.getInstance();
     }
 
     //==========================================================================
     // =========
-    // Dao Accessor
-    // ============
-    public TodoCategoryDao getMyDao() {
-        return _dao;
-    }
-
-    public void setMyDao(TodoCategoryDao dao) {
-        assertObjectNotNull("dao", dao);
-        _dao = dao;
-    }
-
-    public DaoReadable getDaoReadable() {
-        return getMyDao();
-    }
-
-    public DaoWritable getDaoWritable() {
-        return getMyDao();
-    }
-
-    //==========================================================================
-    // =========
     // New Instance
     // ============
     public Entity newEntity() {
@@ -150,7 +121,7 @@
      * @return The selected count.
      */
     public int selectCount(TodoCategoryCB cb) {
-        assertConditionBeanNotNull(cb);
+        assertCBNotNull(cb);
         return delegateSelectCount(cb);
     }
 
@@ -230,7 +201,7 @@
      * @return The result bean of selected list. (NotNull)
      */
     public ListResultBean selectList(TodoCategoryCB cb) {
-        assertConditionBeanNotNull(cb);
+        assertCBNotNull(cb);
         return new ResultBeanBuilder(getTableDbName())
                 .buildListResultBean(cb, delegateSelectList(cb));
     }
@@ -246,7 +217,7 @@
      * @return The result bean of selected page. (NotNull)
      */
     public PagingResultBean selectPage(final TodoCategoryCB cb) {
-        assertConditionBeanNotNull(cb);
+        assertCBNotNull(cb);
         final PagingInvoker invoker = new PagingInvoker(
                 getTableDbName());
         final PagingHandler handler = new PagingHandler() {
@@ -267,6 +238,32 @@
 
     //==========================================================================
     // =========
+    // Scalar Select
+    // =============
+    /**
+     * Select the scalar value derived by a function. 
Call a function + * method after this method called like as follows: + * + *
+     * todoCategoryBhv.scalarSelect(Date.class).max(new ScalarQuery(TodoCategoryCB cb) {
+     *     cb.specify().columnXxxDatetime(); // the required specification of target column
+     *     cb.query().setXxxName_PrefixSearch("S"); // query as you like it
+     * });
+     * 
+ * + * @param The type of result. + * @param resultType The type of result. (NotNull) + * @return The scalar value derived by a function. (Nullable) + */ + public SLFunction scalarSelect( + Class resultType) { + TodoCategoryCB cb = newMyConditionBean(); + cb.xsetupForScalarSelect(); + return new SLFunction(cb, resultType); + } + + //========================================================================== + // ========= // Various Select // ============== /** @@ -276,8 +273,7 @@ * @param valueLabelSetupper The setupper of value-label. (NotNull) * @return The list of value-label. (NotNull) */ - public List> selectValueLabelList( - TodoCategoryCB cb, + public List> selectValueLabelList(TodoCategoryCB cb, ValueLabelSetupper valueLabelSetupper) { return createValueLabelList(selectList(cb), valueLabelSetupper); } @@ -379,8 +375,8 @@ //========================================================================== // ========= - // Pullout Foreign - // =============== + // Pull out Foreign + // ================ /** * Pull out the list of foreign table 'UserInfo'. * @@ -577,11 +573,11 @@ */ public int queryUpdate(TodoCategory todoCategory, TodoCategoryCB cb) { assertObjectNotNull("todoCategory", todoCategory); - assertConditionBeanNotNull(cb); + assertCBNotNull(cb); setupCommonColumnOfUpdateIfNeeds(todoCategory); filterEntityOfUpdate(todoCategory); assertEntityOfUpdate(todoCategory); - return getMyDao().updateByQuery(cb, todoCategory); + return invoke(createQueryUpdateEntityCBCommand(todoCategory, cb)); } /** @@ -591,8 +587,8 @@ * @return The deleted count. */ public int queryDelete(TodoCategoryCB cb) { - assertConditionBeanNotNull(cb); - return getMyDao().deleteByQuery(cb); + assertCBNotNull(cb); + return invoke(createQueryDeleteCBCommand(cb)); } //========================================================================== @@ -604,19 +600,27 @@ // ========= // Delegate Method // =============== + // [Behavior Command] // ----------------------------------------------------- // Select // ------ protected int delegateSelectCount(TodoCategoryCB cb) { - assertConditionBeanNotNull(cb); - return getMyDao().selectCount(cb); + return invoke(createSelectCountCBCommand(cb)); } + protected int doCallReadCount(ConditionBean cb) { + return delegateSelectCount((TodoCategoryCB) cb); + } + protected List delegateSelectList(TodoCategoryCB cb) { - assertConditionBeanNotNull(cb); - return getMyDao().selectList(cb); + return invoke(createSelectListCBCommand(cb, TodoCategory.class)); } + @SuppressWarnings("unchecked") + protected List doCallReadList(ConditionBean cb) { + return (List) delegateSelectList((TodoCategoryCB) cb); + } + // ----------------------------------------------------- // Update // ------ @@ -624,38 +628,71 @@ if (!processBeforeInsert(e)) { return 1; } - return getMyDao().insert(e); + return invoke(createInsertEntityCommand(e)); } + protected int doCallCreate(Entity entity) { + return delegateInsert(downcast(entity)); + } + protected int delegateUpdate(TodoCategory e) { if (!processBeforeUpdate(e)) { return 1; } - return getMyDao().updateModifiedOnly(e); + return invoke(createUpdateEntityCommand(e)); } + protected int doCallModify(Entity entity) { + return delegateUpdate(downcast(entity)); + } + protected int delegateDelete(TodoCategory e) { if (!processBeforeDelete(e)) { return 1; } - return getMyDao().delete(e); + return invoke(createDeleteEntityCommand(e)); } + protected int doCallRemove(Entity entity) { + return delegateDelete(downcast(entity)); + } + protected int[] delegateInsertList(List ls) { - assertObjectNotNull("todoCategoryList", ls); - return getMyDao().insertList(helpFilterBeforeInsertInternally(ls)); + if (ls.isEmpty()) { + return new int[] {}; + } + return invoke(createBatchInsertEntityCommand(helpFilterBeforeInsertInternally(ls))); } + @SuppressWarnings("unchecked") + protected int[] doCreateList(List ls) { + return delegateInsertList((List) ls); + } + protected int[] delegateUpdateList(List ls) { - assertObjectNotNull("todoCategoryList", ls); - return getMyDao().updateList(helpFilterBeforeUpdateInternally(ls)); + if (ls.isEmpty()) { + return new int[] {}; + } + return invoke(createBatchUpdateEntityCommand(helpFilterBeforeUpdateInternally(ls))); } + @SuppressWarnings("unchecked") + protected int[] doModifyList(List ls) { + return delegateUpdateList((List) ls); + } + protected int[] delegateDeleteList(List ls) { - assertObjectNotNull("todoCategoryList", ls); - return getMyDao().deleteList(helpFilterBeforeDeleteInternally(ls)); + if (ls.isEmpty()) { + return new int[] {}; + } + return invoke(createBatchDeleteEntityCommand(helpFilterBeforeDeleteInternally(ls))); } + @SuppressWarnings("unchecked") + protected int[] doRemoveList(List ls) { + return delegateDeleteList((List) ls); + } + //========================================================================== // ========= // Optimistic Lock Info Modified: todolist/trunk/src/main/java/jp/sf/pal/todolist/db/bsbhv/BsTodoMappingBhv.java =================================================================== --- todolist/trunk/src/main/java/jp/sf/pal/todolist/db/bsbhv/BsTodoMappingBhv.java 2008-12-27 22:20:45 UTC (rev 1632) +++ todolist/trunk/src/main/java/jp/sf/pal/todolist/db/bsbhv/BsTodoMappingBhv.java 2008-12-27 22:21:53 UTC (rev 1633) @@ -1,9 +1,8 @@ package jp.sf.pal.todolist.db.bsbhv; import java.util.List; +import java.util.Map; -import jp.sf.pal.todolist.db.allcommon.DaoReadable; -import jp.sf.pal.todolist.db.allcommon.DaoWritable; import jp.sf.pal.todolist.db.allcommon.Entity; import jp.sf.pal.todolist.db.allcommon.bhv.setup.ValueLabelSetupper; import jp.sf.pal.todolist.db.allcommon.cbean.ConditionBean; @@ -16,14 +15,13 @@ import jp.sf.pal.todolist.db.allcommon.dbmeta.DBMeta; import jp.sf.pal.todolist.db.bsentity.dbmeta.TodoMappingDbm; import jp.sf.pal.todolist.db.cbean.TodoMappingCB; -import jp.sf.pal.todolist.db.exdao.TodoMappingDao; import jp.sf.pal.todolist.db.exentity.Todo; import jp.sf.pal.todolist.db.exentity.TodoCategory; import jp.sf.pal.todolist.db.exentity.TodoMapping; import jp.sf.pal.todolist.db.exentity.UserInfo; /** - * The behavior of TODO_MAPPING. + * The behavior of TODO_MAPPING that the type is TABLE.
* *
  * [primary-key]
@@ -68,12 +66,6 @@
 
     //==========================================================================
     // =========
-    // Attribute
-    // =========
-    protected TodoMappingDao _dao;
-
-    //==========================================================================
-    // =========
     // Table name
     // ==========
     /** @return The name on database of table. (NotNull) */
@@ -85,39 +77,18 @@
     // =========
     // DBMeta
     // ======
-    /** @return The meta data of the database. (NotNull) */
+    /** @return The instance of DBMeta. (NotNull) */
     public DBMeta getDBMeta() {
         return TodoMappingDbm.getInstance();
     }
 
-    /** @return The meta data of the database as my table type. (NotNull) */
+    /** @return The instance of DBMeta as my table type. (NotNull) */
     public TodoMappingDbm getMyDBMeta() {
         return TodoMappingDbm.getInstance();
     }
 
     //==========================================================================
     // =========
-    // Dao Accessor
-    // ============
-    public TodoMappingDao getMyDao() {
-        return _dao;
-    }
-
-    public void setMyDao(TodoMappingDao dao) {
-        assertObjectNotNull("dao", dao);
-        _dao = dao;
-    }
-
-    public DaoReadable getDaoReadable() {
-        return getMyDao();
-    }
-
-    public DaoWritable getDaoWritable() {
-        return getMyDao();
-    }
-
-    //==========================================================================
-    // =========
     // New Instance
     // ============
     public Entity newEntity() {
@@ -147,7 +118,7 @@
      * @return The selected count.
      */
     public int selectCount(TodoMappingCB cb) {
-        assertConditionBeanNotNull(cb);
+        assertCBNotNull(cb);
         return delegateSelectCount(cb);
     }
 
@@ -224,7 +195,7 @@
      * @return The result bean of selected list. (NotNull)
      */
     public ListResultBean selectList(TodoMappingCB cb) {
-        assertConditionBeanNotNull(cb);
+        assertCBNotNull(cb);
         return new ResultBeanBuilder(getTableDbName())
                 .buildListResultBean(cb, delegateSelectList(cb));
     }
@@ -240,7 +211,7 @@
      * @return The result bean of selected page. (NotNull)
      */
     public PagingResultBean selectPage(final TodoMappingCB cb) {
-        assertConditionBeanNotNull(cb);
+        assertCBNotNull(cb);
         final PagingInvoker invoker = new PagingInvoker(
                 getTableDbName());
         final PagingHandler handler = new PagingHandler() {
@@ -261,6 +232,32 @@
 
     //==========================================================================
     // =========
+    // Scalar Select
+    // =============
+    /**
+     * Select the scalar value derived by a function. 
Call a function + * method after this method called like as follows: + * + *
+     * todoMappingBhv.scalarSelect(Date.class).max(new ScalarQuery(TodoMappingCB cb) {
+     *     cb.specify().columnXxxDatetime(); // the required specification of target column
+     *     cb.query().setXxxName_PrefixSearch("S"); // query as you like it
+     * });
+     * 
+ * + * @param The type of result. + * @param resultType The type of result. (NotNull) + * @return The scalar value derived by a function. (Nullable) + */ + public SLFunction scalarSelect( + Class resultType) { + TodoMappingCB cb = newMyConditionBean(); + cb.xsetupForScalarSelect(); + return new SLFunction(cb, resultType); + } + + //========================================================================== + // ========= // Various Select // ============== /** @@ -270,8 +267,8 @@ * @param valueLabelSetupper The setupper of value-label. (NotNull) * @return The list of value-label. (NotNull) */ - public List> selectValueLabelList( - TodoMappingCB cb, ValueLabelSetupper valueLabelSetupper) { + public List> selectValueLabelList(TodoMappingCB cb, + ValueLabelSetupper valueLabelSetupper) { return createValueLabelList(selectList(cb), valueLabelSetupper); } @@ -282,8 +279,8 @@ //========================================================================== // ========= - // Pullout Foreign - // =============== + // Pull out Foreign + // ================ /** * Pull out the list of foreign table 'Todo'. * @@ -632,11 +629,11 @@ */ public int queryUpdate(TodoMapping todoMapping, TodoMappingCB cb) { assertObjectNotNull("todoMapping", todoMapping); - assertConditionBeanNotNull(cb); + assertCBNotNull(cb); setupCommonColumnOfUpdateIfNeeds(todoMapping); filterEntityOfUpdate(todoMapping); assertEntityOfUpdate(todoMapping); - return getMyDao().updateByQuery(cb, todoMapping); + return invoke(createQueryUpdateEntityCBCommand(todoMapping, cb)); } /** @@ -646,8 +643,8 @@ * @return The deleted count. */ public int queryDelete(TodoMappingCB cb) { - assertConditionBeanNotNull(cb); - return getMyDao().deleteByQuery(cb); + assertCBNotNull(cb); + return invoke(createQueryDeleteCBCommand(cb)); } //========================================================================== @@ -659,19 +656,27 @@ // ========= // Delegate Method // =============== + // [Behavior Command] // ----------------------------------------------------- // Select // ------ protected int delegateSelectCount(TodoMappingCB cb) { - assertConditionBeanNotNull(cb); - return getMyDao().selectCount(cb); + return invoke(createSelectCountCBCommand(cb)); } + protected int doCallReadCount(ConditionBean cb) { + return delegateSelectCount((TodoMappingCB) cb); + } + protected List delegateSelectList(TodoMappingCB cb) { - assertConditionBeanNotNull(cb); - return getMyDao().selectList(cb); + return invoke(createSelectListCBCommand(cb, TodoMapping.class)); } + @SuppressWarnings("unchecked") + protected List doCallReadList(ConditionBean cb) { + return (List) delegateSelectList((TodoMappingCB) cb); + } + // ----------------------------------------------------- // Update // ------ @@ -679,62 +684,97 @@ if (!processBeforeInsert(e)) { return 1; } - return getMyDao().insert(e); + return invoke(createInsertEntityCommand(e)); } + protected int doCallCreate(Entity entity) { + return delegateInsert(downcast(entity)); + } + protected int delegateUpdate(TodoMapping e) { if (!processBeforeUpdate(e)) { return 1; } - return getMyDao().updateModifiedOnly(e); + return invoke(createUpdateEntityCommand(e)); } + protected int doCallModify(Entity entity) { + return delegateUpdate(downcast(entity)); + } + protected int delegateUpdateNonstrict(TodoMapping e) { if (!processBeforeUpdate(e)) { return 1; } - return getMyDao().updateNonstrictModifiedOnly(e); + return invoke(createUpdateNonstrictEntityCommand(e)); } protected int delegateDelete(TodoMapping e) { if (!processBeforeDelete(e)) { return 1; } - return getMyDao().delete(e); + return invoke(createDeleteEntityCommand(e)); } + protected int doCallRemove(Entity entity) { + return delegateDelete(downcast(entity)); + } + protected int delegateDeleteNonstrict(TodoMapping e) { if (!processBeforeDelete(e)) { return 1; } - return getMyDao().deleteNonstrict(e); + return invoke(createDeleteNonstrictEntityCommand(e)); } protected int[] delegateInsertList(List ls) { - assertObjectNotNull("todoMappingList", ls); - return getMyDao().insertList(helpFilterBeforeInsertInternally(ls)); + if (ls.isEmpty()) { + return new int[] {}; + } + return invoke(createBatchInsertEntityCommand(helpFilterBeforeInsertInternally(ls))); } + @SuppressWarnings("unchecked") + protected int[] doCreateList(List ls) { + return delegateInsertList((List) ls); + } + protected int[] delegateUpdateList(List ls) { - assertObjectNotNull("todoMappingList", ls); - return getMyDao().updateList(helpFilterBeforeUpdateInternally(ls)); + if (ls.isEmpty()) { + return new int[] {}; + } + return invoke(createBatchUpdateEntityCommand(helpFilterBeforeUpdateInternally(ls))); } + @SuppressWarnings("unchecked") + protected int[] doModifyList(List ls) { + return delegateUpdateList((List) ls); + } + protected int[] delegateUpdateListNonstrict(List ls) { - assertObjectNotNull("todoMappingList", ls); - return getMyDao().updateListNonstrict( - helpFilterBeforeUpdateInternally(ls)); + if (ls.isEmpty()) { + return new int[] {}; + } + return invoke(createBatchUpdateNonstrictEntityCommand(helpFilterBeforeUpdateInternally(ls))); } protected int[] delegateDeleteList(List ls) { - assertObjectNotNull("todoMappingList", ls); - return getMyDao().deleteList(helpFilterBeforeDeleteInternally(ls)); + if (ls.isEmpty()) { + return new int[] {}; + } + return invoke(createBatchDeleteEntityCommand(helpFilterBeforeDeleteInternally(ls))); } + @SuppressWarnings("unchecked") + protected int[] doRemoveList(List ls) { + return delegateDeleteList((List) ls); + } + protected int[] delegateDeleteListNonstrict(List ls) { - assertObjectNotNull("todoMappingList", ls); - return getMyDao().deleteListNonstrict( - helpFilterBeforeDeleteInternally(ls)); + if (ls.isEmpty()) { + return new int[] {}; + } + return invoke(createBatchDeleteNonstrictEntityCommand(helpFilterBeforeDeleteInternally(ls))); } //========================================================================== Modified: todolist/trunk/src/main/java/jp/sf/pal/todolist/db/bsbhv/BsUserInfoBhv.java =================================================================== --- todolist/trunk/src/main/java/jp/sf/pal/todolist/db/bsbhv/BsUserInfoBhv.java 2008-12-27 22:20:45 UTC (rev 1632) +++ todolist/trunk/src/main/java/jp/sf/pal/todolist/db/bsbhv/BsUserInfoBhv.java 2008-12-27 22:21:53 UTC (rev 1633) @@ -1,9 +1,8 @@ package jp.sf.pal.todolist.db.bsbhv; import java.util.List; +import java.util.Map; -import jp.sf.pal.todolist.db.allcommon.DaoReadable; -import jp.sf.pal.todolist.db.allcommon.DaoWritable; import jp.sf.pal.todolist.db.allcommon.Entity; import jp.sf.pal.todolist.db.allcommon.bhv.load.LoadReferrerOption; import jp.sf.pal.todolist.db.allcommon.bhv.setup.ConditionBeanSetupper; @@ -28,7 +27,6 @@ import jp.sf.pal.todolist.db.exbhv.TodoBhv; import jp.sf.pal.todolist.db.exbhv.TodoCategoryBhv; import jp.sf.pal.todolist.db.exbhv.TodoMappingBhv; -import jp.sf.pal.todolist.db.exdao.UserInfoDao; import jp.sf.pal.todolist.db.exentity.GroupInfo; import jp.sf.pal.todolist.db.exentity.GroupMapping; import jp.sf.pal.todolist.db.exentity.RoleInfo; @@ -39,14 +37,14 @@ import jp.sf.pal.todolist.db.exentity.UserInfo; /** - * The behavior of USER_INFO. + * The behavior of USER_INFO that the type is TABLE.
* *
  * [primary-key]
  *     USER_ID
  * 
  * [column]
- *     USER_ID, GIVEN_NAME, FAMILY_NAME, MIDDLE_NAME, GIVEN_NAME_DESC, FAMILY_NAME_DESC, NICKNAME, GENDER, BIRTH_DATE, EMAIL, URL, TELEPHONE, LOCALE, ROLE_ID, GROUP_ID, CREATED_TIME, CREATED_BY, UPDATED_TIME, UPDATED_BY, DELETED_TIME, DELETED_BY, VERSIONNO
+ *     USER_ID, GIVEN_NAME, FAMILY_NAME, MIDDLE_NAME, GIVEN_NAME_DESC, FAMILY_NAME_DESC, NICKNAME, GENDER, BIRTH_DATE, EMAIL, URL, TELEPHONE, LOCALE, ROLE_ID, GROUP_ID, STATUS, CREATED_TIME, CREATED_BY, UPDATED_TIME, UPDATED_BY, DELETED_TIME, DELETED_BY, VERSIONNO
  * 
  * [sequence]
  *     
@@ -84,12 +82,6 @@
 
     //==========================================================================
     // =========
-    // Attribute
-    // =========
-    protected UserInfoDao _dao;
-
-    //==========================================================================
-    // =========
     // Table name
     // ==========
     /** @return The name on database of table. (NotNull) */
@@ -101,39 +93,18 @@
     // =========
     // DBMeta
     // ======
-    /** @return The meta data of the database. (NotNull) */
+    /** @return The instance of DBMeta. (NotNull) */
     public DBMeta getDBMeta() {
         return UserInfoDbm.getInstance();
     }
 
-    /** @return The meta data of the database as my table type. (NotNull) */
+    /** @return The instance of DBMeta as my table type. (NotNull) */
     public UserInfoDbm getMyDBMeta() {
         return UserInfoDbm.getInstance();
     }
 
     //==========================================================================
     // =========
-    // Dao Accessor
-    // ============
-    public UserInfoDao getMyDao() {
-        return _dao;
-    }
-
-    public void setMyDao(UserInfoDao dao) {
-        assertObjectNotNull("dao", dao);
-        _dao = dao;
-    }
-
-    public DaoReadable getDaoReadable() {
-        return getMyDao();
-    }
-
-    public DaoWritable getDaoWritable() {
-        return getMyDao();
-    }
-
-    //==========================================================================
-    // =========
     // New Instance
     // ============
     public Entity newEntity() {
@@ -163,7 +134,7 @@
      * @return The selected count.
      */
     public int selectCount(UserInfoCB cb) {
-        assertConditionBeanNotNull(cb);
+        assertCBNotNull(cb);
         return delegateSelectCount(cb);
     }
 
@@ -240,7 +211,7 @@
      * @return The result bean of selected list. (NotNull)
      */
     public ListResultBean selectList(UserInfoCB cb) {
-        assertConditionBeanNotNull(cb);
+        assertCBNotNull(cb);
         return new ResultBeanBuilder(getTableDbName())
                 .buildListResultBean(cb, delegateSelectList(cb));
     }
@@ -256,7 +227,7 @@
      * @return The result bean of selected page. (NotNull)
      */
     public PagingResultBean selectPage(final UserInfoCB cb) {
-        assertConditionBeanNotNull(cb);
+        assertCBNotNull(cb);
         final PagingInvoker invoker = new PagingInvoker(
                 getTableDbName());
         final PagingHandler handler = new PagingHandler() {
@@ -277,6 +248,32 @@
 
     //==========================================================================
     // =========
+    // Scalar Select
+    // =============
+    /**
+     * Select the scalar value derived by a function. 
Call a function + * method after this method called like as follows: + * + *
+     * userInfoBhv.scalarSelect(Date.class).max(new ScalarQuery(UserInfoCB cb) {
+     *     cb.specify().columnXxxDatetime(); // the required specification of target column
+     *     cb.query().setXxxName_PrefixSearch("S"); // query as you like it
+     * });
+     * 
+ * + * @param The type of result. + * @param resultType The type of result. (NotNull) + * @return The scalar value derived by a function. (Nullable) + */ + public SLFunction scalarSelect( + Class resultType) { + UserInfoCB cb = newMyConditionBean(); + cb.xsetupForScalarSelect(); + return new SLFunction(cb, resultType); + } + + //========================================================================== + // ========= // Various Select // ============== /** @@ -286,8 +283,8 @@ * @param valueLabelSetupper The setupper of value-label. (NotNull) * @return The list of value-label. (NotNull) */ - public List> selectValueLabelList( - UserInfoCB cb, ValueLabelSetupper valueLabelSetupper) { + public List> selectValueLabelList(UserInfoCB cb, + ValueLabelSetupper valueLabelSetupper) { return createValueLabelList(selectList(cb), valueLabelSetupper); } @@ -749,8 +746,8 @@ //========================================================================== // ========= - // Pullout Foreign - // =============== + // Pull out Foreign + // ================ /** * Pull out the list of foreign table 'GroupInfo'. * @@ -1075,11 +1072,11 @@ */ public int queryUpdate(UserInfo userInfo, UserInfoCB cb) { assertObjectNotNull("userInfo", userInfo); - assertConditionBeanNotNull(cb); + assertCBNotNull(cb); setupCommonColumnOfUpdateIfNeeds(userInfo); filterEntityOfUpdate(userInfo); assertEntityOfUpdate(userInfo); - return getMyDao().updateByQuery(cb, userInfo); + return invoke(createQueryUpdateEntityCBCommand(userInfo, cb)); } /** @@ -1089,8 +1086,8 @@ * @return The deleted count. */ public int queryDelete(UserInfoCB cb) { - assertConditionBeanNotNull(cb); - return getMyDao().deleteByQuery(cb); + assertCBNotNull(cb); + return invoke(createQueryDeleteCBCommand(cb)); } //========================================================================== @@ -1102,19 +1099,27 @@ // ========= // Delegate Method // =============== + // [Behavior Command] // ----------------------------------------------------- // Select // ------ protected int delegateSelectCount(UserInfoCB cb) { - assertConditionBeanNotNull(cb); - return getMyDao().selectCount(cb); + return invoke(createSelectCountCBCommand(cb)); } + protected int doCallReadCount(ConditionBean cb) { + return delegateSelectCount((UserInfoCB) cb); + } + protected List delegateSelectList(UserInfoCB cb) { - assertConditionBeanNotNull(cb); - return getMyDao().selectList(cb); + return invoke(createSelectListCBCommand(cb, UserInfo.class)); } + @SuppressWarnings("unchecked") + protected List doCallReadList(ConditionBean cb) { + return (List) delegateSelectList((UserInfoCB) cb); + } + // ----------------------------------------------------- // Update // ------ @@ -1122,62 +1127,97 @@ if (!processBeforeInsert(e)) { return 1; } - return getMyDao().insert(e); + return invoke(createInsertEntityCommand(e)); } + protected int doCallCreate(Entity entity) { + return delegateInsert(downcast(entity)); + } + protected int delegateUpdate(UserInfo e) { if (!processBeforeUpdate(e)) { return 1; } - return getMyDao().updateModifiedOnly(e); + return invoke(createUpdateEntityCommand(e)); } + protected int doCallModify(Entity entity) { + return delegateUpdate(downcast(entity)); + } + protected int delegateUpdateNonstrict(UserInfo e) { if (!processBeforeUpdate(e)) { return 1; } - return getMyDao().updateNonstrictModifiedOnly(e); + return invoke(createUpdateNonstrictEntityCommand(e)); } protected int delegateDelete(UserInfo e) { if (!processBeforeDelete(e)) { return 1; } - return getMyDao().delete(e); + return invoke(createDeleteEntityCommand(e)); } + protected int doCallRemove(Entity entity) { + return delegateDelete(downcast(entity)); + } + protected int delegateDeleteNonstrict(UserInfo e) { if (!processBeforeDelete(e)) { return 1; } - return getMyDao().deleteNonstrict(e); + return invoke(createDeleteNonstrictEntityCommand(e)); } protected int[] delegateInsertList(List ls) { - assertObjectNotNull("userInfoList", ls); - return getMyDao().insertList(helpFilterBeforeInsertInternally(ls)); + if (ls.isEmpty()) { + return new int[] {}; + } + return invoke(createBatchInsertEntityCommand(helpFilterBeforeInsertInternally(ls))); } + @SuppressWarnings("unchecked") + protected int[] doCreateList(List ls) { + return delegateInsertList((List) ls); + } + protected int[] delegateUpdateList(List ls) { - assertObjectNotNull("userInfoList", ls); - return getMyDao().updateList(helpFilterBeforeUpdateInternally(ls)); + if (ls.isEmpty()) { + return new int[] {}; + } + return invoke(createBatchUpdateEntityCommand(helpFilterBeforeUpdateInternally(ls))); } + @SuppressWarnings("unchecked") + protected int[] doModifyList(List ls) { + return delegateUpdateList((List) ls); + } + protected int[] delegateUpdateListNonstrict(List ls) { - assertObjectNotNull("userInfoList", ls); - return getMyDao().updateListNonstrict( - helpFilterBeforeUpdateInternally(ls)); + if (ls.isEmpty()) { + return new int[] {}; + } + return invoke(createBatchUpdateNonstrictEntityCommand(helpFilterBeforeUpdateInternally(ls))); } protected int[] delegateDeleteList(List ls) { - assertObjectNotNull("userInfoList", ls); - return getMyDao().deleteList(helpFilterBeforeDeleteInternally(ls)); + if (ls.isEmpty()) { + return new int[] {}; + } + return invoke(createBatchDeleteEntityCommand(helpFilterBeforeDeleteInternally(ls))); } + @SuppressWarnings("unchecked") + protected int[] doRemoveList(List ls) { + return delegateDeleteList((List) ls); + } + protected int[] delegateDeleteListNonstrict(List ls) { - assertObjectNotNull("userInfoList", ls); - return getMyDao().deleteListNonstrict( - helpFilterBeforeDeleteInternally(ls)); + if (ls.isEmpty()) { + return new int[] {}; + } + return invoke(createBatchDeleteNonstrictEntityCommand(helpFilterBeforeDeleteInternally(ls))); } //========================================================================== Modified: todolist/trunk/src/main/java/jp/sf/pal/todolist/db/bsentity/BsGroupInfo.java =================================================================== --- todolist/trunk/src/main/java/jp/sf/pal/todolist/db/bsentity/BsGroupInfo.java 2008-12-27 22:20:45 UTC (rev 1632) +++ todolist/trunk/src/main/java/jp/sf/pal/todolist/db/bsentity/BsGroupInfo.java 2008-12-27 22:21:53 UTC (rev 1633) @@ -44,7 +44,6 @@ * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public abstract class BsGroupInfo implements Entity, java.io.Serializable { //========================================================================== Modified: todolist/trunk/src/main/java/jp/sf/pal/todolist/db/bsentity/BsGroupMapping.java =================================================================== --- todolist/trunk/src/main/java/jp/sf/pal/todolist/db/bsentity/BsGroupMapping.java 2008-12-27 22:20:45 UTC (rev 1632) +++ todolist/trunk/src/main/java/jp/sf/pal/todolist/db/bsentity/BsGroupMapping.java 2008-12-27 22:21:53 UTC (rev 1633) @@ -42,7 +42,6 @@ * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public abstract class BsGroupMapping implements Entity, java.io.Serializable { //========================================================================== Modified: todolist/trunk/src/main/java/jp/sf/pal/todolist/db/bsentity/BsRoleInfo.java =================================================================== --- todolist/trunk/src/main/java/jp/sf/pal/todolist/db/bsentity/BsRoleInfo.java 2008-12-27 22:20:45 UTC (rev 1632) +++ todolist/trunk/src/main/java/jp/sf/pal/todolist/db/bsentity/BsRoleInfo.java 2008-12-27 22:21:53 UTC (rev 1633) @@ -44,7 +44,6 @@ * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public abstract class BsRoleInfo implements Entity, java.io.Serializable { //========================================================================== Modified: todolist/trunk/src/main/java/jp/sf/pal/todolist/db/bsentity/BsRoleMapping.java =================================================================== --- todolist/trunk/src/main/java/jp/sf/pal/todolist/db/bsentity/BsRoleMapping.java 2008-12-27 22:20:45 UTC (rev 1632) +++ todolist/trunk/src/main/java/jp/sf/pal/todolist/db/bsentity/BsRoleMapping.java 2008-12-27 22:21:53 UTC (rev 1633) @@ -42,7 +42,6 @@ * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public abstract class BsRoleMapping implements Entity, java.io.Serializable { //========================================================================== Modified: todolist/trunk/src/main/java/jp/sf/pal/todolist/db/bsentity/BsTodo.java =================================================================== --- todolist/trunk/src/main/java/jp/sf/pal/todolist/db/bsentity/BsTodo.java 2008-12-27 22:20:45 UTC (rev 1632) +++ todolist/trunk/src/main/java/jp/sf/pal/todolist/db/bsentity/BsTodo.java 2008-12-27 22:21:53 UTC (rev 1633) @@ -44,7 +44,6 @@ * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public abstract class BsTodo implements Entity, java.io.Serializable { //========================================================================== Modified: todolist/trunk/src/main/java/jp/sf/pal/todolist/db/bsentity/BsTodoCategory.java =================================================================== --- todolist/trunk/src/main/java/jp/sf/pal/todolist/db/bsentity/BsTodoCategory.java 2008-12-27 22:20:45 UTC (rev 1632) +++ todolist/trunk/src/main/java/jp/sf/pal/todolist/db/bsentity/BsTodoCategory.java 2008-12-27 22:21:53 UTC (rev 1633) @@ -44,7 +44,6 @@ * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public abstract class BsTodoCategory implements Entity, java.io.Serializable { //========================================================================== Modified: todolist/trunk/src/main/java/jp/sf/pal/todolist/db/bsentity/BsTodoMapping.java =================================================================== --- todolist/trunk/src/main/java/jp/sf/pal/todolist/db/bsentity/BsTodoMapping.java 2008-12-27 22:20:45 UTC (rev 1632) +++ todolist/trunk/src/main/java/jp/sf/pal/todolist/db/bsentity/BsTodoMapping.java 2008-12-27 22:21:53 UTC (rev 1633) @@ -43,7 +43,6 @@ * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public abstract class BsTodoMapping implements Entity, java.io.Serializable { //========================================================================== Modified: todolist/trunk/src/main/java/jp/sf/pal/todolist/db/bsentity/BsUserInfo.java =================================================================== --- todolist/trunk/src/main/java/jp/sf/pal/todolist/db/bsentity/BsUserInfo.java 2008-12-27 22:20:45 UTC (rev 1632) +++ todolist/trunk/src/main/java/jp/sf/pal/todolist/db/bsentity/BsUserInfo.java 2008-12-27 22:21:53 UTC (rev 1633) @@ -23,7 +23,7 @@ * USER_ID * * [column] - * USER_ID, GIVEN_NAME, FAMILY_NAME, MIDDLE_NAME, GIVEN_NAME_DESC, FAMILY_NAME_DESC, NICKNAME, GENDER, BIRTH_DATE, EMAIL, URL, TELEPHONE, LOCALE, ROLE_ID, GROUP_ID, CREATED_TIME, CREATED_BY, UPDATED_TIME, UPDATED_BY, DELETED_TIME, DELETED_BY, VERSIONNO + * USER_ID, GIVEN_NAME, FAMILY_NAME, MIDDLE_NAME, GIVEN_NAME_DESC, FAMILY_NAME_DESC, NICKNAME, GENDER, BIRTH_DATE, EMAIL, URL, TELEPHONE, LOCALE, ROLE_ID, GROUP_ID, STATUS, CREATED_TIME, CREATED_BY, UPDATED_TIME, UPDATED_BY, DELETED_TIME, DELETED_BY, VERSIONNO * * [sequence] * @@ -49,7 +49,6 @@ * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public abstract class BsUserInfo implements Entity, java.io.Serializable { //========================================================================== @@ -117,6 +116,9 @@ /** GROUP_ID: {VARCHAR(255) : FK to GROUP_INFO} */ protected String _groupId; + /** STATUS: {VARCHAR(1)} */ + protected String _status; + /** CREATED_TIME: {NotNull : TIMESTAMP} */ protected java.sql.Timestamp _createdTime; @@ -494,6 +496,7 @@ sb.append(delimiter).append(getLocale()); sb.append(delimiter).append(getRoleId()); sb.append(delimiter).append(getGroupId()); + sb.append(delimiter).append(getStatus()); sb.append(delimiter).append(getCreatedTime()); sb.append(delimiter).append(getCreatedBy()); sb.append(delimiter).append(getUpdatedTime()); @@ -845,6 +848,28 @@ this._groupId = groupId; } + /** The column annotation for S2Dao. {VARCHAR(1)} */ + public static final String status_COLUMN = "STATUS"; + + /** + * STATUS: {VARCHAR(1)}
+ * + * @return The value of the column 'STATUS'. (Nullable) + */ + public String getStatus() { + return _status; + } + + /** + * STATUS: {VARCHAR(1)}
+ * + * @param status The value of the column 'STATUS'. (Nullable) + */ + public void setStatus(String status) { + _modifiedProperties.addPropertyName("status"); + this._status = status; + } + /** The column annotation for S2Dao. {NotNull : TIMESTAMP} */ public static final String createdTime_COLUMN = "CREATED_TIME"; Modified: todolist/trunk/src/main/java/jp/sf/pal/todolist/db/bsentity/dbmeta/GroupInfoDbm.java =================================================================== --- todolist/trunk/src/main/java/jp/sf/pal/todolist/db/bsentity/dbmeta/GroupInfoDbm.java 2008-12-27 22:20:45 UTC (rev 1632) +++ todolist/trunk/src/main/java/jp/sf/pal/todolist/db/bsentity/dbmeta/GroupInfoDbm.java 2008-12-27 22:21:53 UTC (rev 1633) @@ -8,6 +8,7 @@ import jp.sf.pal.todolist.db.allcommon.dbmeta.info.ColumnInfo; import jp.sf.pal.todolist.db.allcommon.dbmeta.info.ReferrerInfo; import jp.sf.pal.todolist.db.allcommon.dbmeta.info.UniqueInfo; +import jp.sf.pal.todolist.db.allcommon.helper.StringKeyMap; import jp.sf.pal.todolist.db.exentity.GroupInfo; /** @@ -15,7 +16,6 @@ * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public class GroupInfoDbm extends AbstractDBMeta { private static final GroupInfoDbm _instance = new GroupInfoDbm(); @@ -138,40 +138,14 @@ return _columnVersionno; } - { - initializeColumnInfoList(); - } - //========================================================================== // ========= - // Name Map - // ======== - public Map getDbNamePropertyNameKeyToLowerMap() { - return createDbNamePropertyNameKeyToLowerMap(); + // Resource Initialization + // ======================= + { + initializeInformationResource(); } - public Map getPropertyNameDbNameKeyToLowerMap() { - return createPropertyNameDbNameKeyToLowerMap(); - } - - protected static Map _dbNamePropertyNameKeyToLowerMap; - - protected Map createDbNamePropertyNameKeyToLowerMap() { - if (_dbNamePropertyNameKeyToLowerMap == null) { - _dbNamePropertyNameKeyToLowerMap = setupKeyToLowerMap(true); - } - return _dbNamePropertyNameKeyToLowerMap; - } - - protected static Map _propertyNameDbNameKeyToLowerMap; - - protected Map createPropertyNameDbNameKeyToLowerMap() { - if (_propertyNameDbNameKeyToLowerMap == null) { - _propertyNameDbNameKeyToLowerMap = setupKeyToLowerMap(false); - } - return _propertyNameDbNameKeyToLowerMap; - } - //========================================================================== // ========= // Type Name @@ -341,7 +315,8 @@ // Entity Property Setup // ===================== // It's very INTERNAL! - protected Map> _epsMap = newHashMap(); + protected Map> _epsMap = StringKeyMap + .createAsFlexibleConcurrent(); { setupEps(_epsMap, new EpsGroupId(), columnGroupId()); setupEps(_epsMap, new EpsName(), columnName()); Modified: todolist/trunk/src/main/java/jp/sf/pal/todolist/db/bsentity/dbmeta/GroupMappingDbm.java =================================================================== --- todolist/trunk/src/main/java/jp/sf/pal/todolist/db/bsentity/dbmeta/GroupMappingDbm.java 2008-12-27 22:20:45 UTC (rev 1632) +++ todolist/trunk/src/main/java/jp/sf/pal/todolist/db/bsentity/dbmeta/GroupMappingDbm.java 2008-12-27 22:21:53 UTC (rev 1633) @@ -8,6 +8,7 @@ import jp.sf.pal.todolist.db.allcommon.dbmeta.info.ColumnInfo; import jp.sf.pal.todolist.db.allcommon.dbmeta.info.ForeignInfo; import jp.sf.pal.todolist.db.allcommon.dbmeta.info.UniqueInfo; +import jp.sf.pal.todolist.db.allcommon.helper.StringKeyMap; import jp.sf.pal.todolist.db.exentity.GroupMapping; /** @@ -15,7 +16,6 @@ * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public class GroupMappingDbm extends AbstractDBMeta { private static final GroupMappingDbm _instance = new GroupMappingDbm(); @@ -68,40 +68,14 @@ return _columnGroupId; } - { - initializeColumnInfoList(); - } - //========================================================================== // ========= - // Name Map - // ======== - public Map getDbNamePropertyNameKeyToLowerMap() { - return createDbNamePropertyNameKeyToLowerMap(); + // Resource Initialization + // ======================= + { + initializeInformationResource(); } - public Map getPropertyNameDbNameKeyToLowerMap() { - return createPropertyNameDbNameKeyToLowerMap(); - } - - protected static Map _dbNamePropertyNameKeyToLowerMap; - - protected Map createDbNamePropertyNameKeyToLowerMap() { - if (_dbNamePropertyNameKeyToLowerMap == null) { - _dbNamePropertyNameKeyToLowerMap = setupKeyToLowerMap(true); - } - return _dbNamePropertyNameKeyToLowerMap; - } - - protected static Map _propertyNameDbNameKeyToLowerMap; - - protected Map createPropertyNameDbNameKeyToLowerMap() { - if (_propertyNameDbNameKeyToLowerMap == null) { - _propertyNameDbNameKeyToLowerMap = setupKeyToLowerMap(false); - } - return _propertyNameDbNameKeyToLowerMap; - } - //========================================================================== // ========= // Type Name @@ -263,7 +237,8 @@ // Entity Property Setup // ===================== // It's very INTERNAL! - protected Map> _epsMap = newHashMap(); + protected Map> _epsMap = StringKeyMap + .createAsFlexibleConcurrent(); { setupEps(_epsMap, new EpsId(), columnId()); setupEps(_epsMap, new EpsUserId(), columnUserId()); Modified: todolist/trunk/src/main/java/jp/sf/pal/todolist/db/bsentity/dbmeta/RoleInfoDbm.java =================================================================== --- todolist/trunk/src/main/java/jp/sf/pal/todolist/db/bsentity/dbmeta/RoleInfoDbm.java 2008-12-27 22:20:45 UTC (rev 1632) +++ todolist/trunk/src/main/java/jp/sf/pal/todolist/db/bsentity/dbmeta/RoleInfoDbm.java 2008-12-27 22:21:53 UTC (rev 1633) @@ -8,6 +8,7 @@ import jp.sf.pal.todolist.db.allcommon.dbmeta.info.ColumnInfo; import jp.sf.pal.todolist.db.allcommon.dbmeta.info.ReferrerInfo; import jp.sf.pal.todolist.db.allcommon.dbmeta.info.UniqueInfo; +import jp.sf.pal.todolist.db.allcommon.helper.StringKeyMap; import jp.sf.pal.todolist.db.exentity.RoleInfo; /** @@ -15,7 +16,6 @@ * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public class RoleInfoDbm extends AbstractDBMeta { private static final RoleInfoDbm _instance = new RoleInfoDbm(); @@ -138,40 +138,14 @@ return _columnVersionno; } - { - initializeColumnInfoList(); - } - //========================================================================== // ========= - // Name Map - // ======== - public Map getDbNamePropertyNameKeyToLowerMap() { - return createDbNamePropertyNameKeyToLowerMap(); + // Resource Initialization + // ======================= + { + initializeInformationResource(); } - public Map getPropertyNameDbNameKeyToLowerMap() { - return createPropertyNameDbNameKeyToLowerMap(); - } - - protected static Map _dbNamePropertyNameKeyToLowerMap; - - protected Map createDbNamePropertyNameKeyToLowerMap() { - if (_dbNamePropertyNameKeyToLowerMap == null) { - _dbNamePropertyNameKeyToLowerMap = setupKeyToLowerMap(true); - } - return _dbNamePropertyNameKeyToLowerMap; - } - - protected static Map _propertyNameDbNameKeyToLowerMap; - - protected Map createPropertyNameDbNameKeyToLowerMap() { - if (_propertyNameDbNameKeyToLowerMap == null) { - _propertyNameDbNameKeyToLowerMap = setupKeyToLowerMap(false); - } - return _propertyNameDbNameKeyToLowerMap; - } - //========================================================================== // ========= // Type Name @@ -341,7 +315,8 @@ // Entity Property Setup // ===================== // It's very INTERNAL! - protected Map> _epsMap = newHashMap(); + protected Map> _epsMap = StringKeyMap + .createAsFlexibleConcurrent(); { setupEps(_epsMap, new EpsRoleId(), columnRoleId()); setupEps(_epsMap, new EpsName(), columnName()); Modified: todolist/trunk/src/main/java/jp/sf/pal/todolist/db/bsentity/dbmeta/RoleMappingDbm.java =================================================================== --- todolist/trunk/src/main/java/jp/sf/pal/todolist/db/bsentity/dbmeta/RoleMappingDbm.java 2008-12-27 22:20:45 UTC (rev 1632) +++ todolist/trunk/src/main/java/jp/sf/pal/todolist/db/bsentity/dbmeta/RoleMappingDbm.java 2008-12-27 22:21:53 UTC (rev 1633) @@ -8,6 +8,7 @@ import jp.sf.pal.todolist.db.allcommon.dbmeta.info.ColumnInfo; import jp.sf.pal.todolist.db.allcommon.dbmeta.info.ForeignInfo; import jp.sf.pal.todolist.db.allcommon.dbmeta.info.UniqueInfo; +import jp.sf.pal.todolist.db.allcommon.helper.StringKeyMap; import jp.sf.pal.todolist.db.exentity.RoleMapping; /** @@ -15,7 +16,6 @@ * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public class RoleMappingDbm extends AbstractDBMeta { private static final RoleMappingDbm _instance = new RoleMappingDbm(); @@ -68,40 +68,14 @@ return _columnRoleId; } - { - initializeColumnInfoList(); - } - //========================================================================== // ========= - // Name Map - // ======== - public Map getDbNamePropertyNameKeyToLowerMap() { - return createDbNamePropertyNameKeyToLowerMap(); + // Resource Initialization + // ======================= + { + initializeInformationResource(); } - public Map getPropertyNameDbNameKeyToLowerMap() { - return createPropertyNameDbNameKeyToLowerMap(); - } - - protected static Map _dbNamePropertyNameKeyToLowerMap; - - protected Map createDbNamePropertyNameKeyToLowerMap() { - if (_dbNamePropertyNameKeyToLowerMap == null) { - _dbNamePropertyNameKeyToLowerMap = setupKeyToLowerMap(true); - } - return _dbNamePropertyNameKeyToLowerMap; - } - - protected static Map _propertyNameDbNameKeyToLowerMap; - - protected Map createPropertyNameDbNameKeyToLowerMap() { - if (_propertyNameDbNameKeyToLowerMap == null) { - _propertyNameDbNameKeyToLowerMap = setupKeyToLowerMap(false); - } - return _propertyNameDbNameKeyToLowerMap; - } - //========================================================================== // ========= // Type Name @@ -263,7 +237,8 @@ // Entity Property Setup // ===================== // It's very INTERNAL! - protected Map> _epsMap = newHashMap(); + protected Map> _epsMap = StringKeyMap + .createAsFlexibleConcurrent(); { setupEps(_epsMap, new EpsId(), columnId()); setupEps(_epsMap, new EpsUserId(), columnUserId()); Modified: todolist/trunk/src/main/java/jp/sf/pal/todolist/db/bsentity/dbmeta/TodoCategoryDbm.java =================================================================== --- todolist/trunk/src/main/java/jp/sf/pal/todolist/db/bsentity/dbmeta/TodoCategoryDbm.java 2008-12-27 22:20:45 UTC (rev 1632) +++ todolist/trunk/src/main/java/jp/sf/pal/todolist/db/bsentity/dbmeta/TodoCategoryDbm.java 2008-12-27 22:21:53 UTC (rev 1633) @@ -9,6 +9,7 @@ import jp.sf.pal.todolist.db.allcommon.dbmeta.info.ForeignInfo; import jp.sf.pal.todolist.db.allcommon.dbmeta.info.ReferrerInfo; import jp.sf.pal.todolist.db.allcommon.dbmeta.info.UniqueInfo; +import jp.sf.pal.todolist.db.allcommon.helper.StringKeyMap; import jp.sf.pal.todolist.db.exentity.TodoCategory; /** @@ -16,7 +17,6 @@ * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public class TodoCategoryDbm extends AbstractDBMeta { private static final TodoCategoryDbm _instance = new TodoCategoryDbm(); @@ -118,40 +118,14 @@ return _columnDeletedBy; } - { - initializeColumnInfoList(); - } - //========================================================================== // ========= - // Name Map - // ======== - public Map getDbNamePropertyNameKeyToLowerMap() { - return createDbNamePropertyNameKeyToLowerMap(); + // Resource Initialization + // ======================= + { + initializeInformationResource(); } - public Map getPropertyNameDbNameKeyToLowerMap() { - return createPropertyNameDbNameKeyToLowerMap(); - } - - protected static Map _dbNamePropertyNameKeyToLowerMap; - - protected Map createDbNamePropertyNameKeyToLowerMap() { - if (_dbNamePropertyNameKeyToLowerMap == null) { - _dbNamePropertyNameKeyToLowerMap = setupKeyToLowerMap(true); - } - return _dbNamePropertyNameKeyToLowerMap; - } - - protected static Map _propertyNameDbNameKeyToLowerMap; - - protected Map createPropertyNameDbNameKeyToLowerMap() { - if (_propertyNameDbNameKeyToLowerMap == null) { - _propertyNameDbNameKeyToLowerMap = setupKeyToLowerMap(false); - } - return _propertyNameDbNameKeyToLowerMap; - } - //========================================================================== // ========= // Type Name @@ -313,7 +287,8 @@ // Entity Property Setup // ===================== // It's very INTERNAL! - protected Map> _epsMap = newHashMap(); + protected Map> _epsMap = StringKeyMap + .createAsFlexibleConcurrent(); { setupEps(_epsMap, new EpsId(), columnId()); setupEps(_epsMap, new EpsName(), columnName()); Modified: todolist/trunk/src/main/java/jp/sf/pal/todolist/db/bsentity/dbmeta/TodoDbm.java =================================================================== --- todolist/trunk/src/main/java/jp/sf/pal/todolist/db/bsentity/dbmeta/TodoDbm.java 2008-12-27 22:20:45 UTC (rev 1632) +++ todolist/trunk/src/main/java/jp/sf/pal/todolist/db/bsentity/dbmeta/TodoDbm.java 2008-12-27 22:21:53 UTC (rev 1633) @@ -9,6 +9,7 @@ import jp.sf.pal.todolist.db.allcommon.dbmeta.info.ForeignInfo; import jp.sf.pal.todolist.db.allcommon.dbmeta.info.ReferrerInfo; import jp.sf.pal.todolist.db.allcommon.dbmeta.info.UniqueInfo; +import jp.sf.pal.todolist.db.allcommon.helper.StringKeyMap; import jp.sf.pal.todolist.db.exentity.Todo; /** @@ -16,7 +17,6 @@ * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public class TodoDbm extends AbstractDBMeta { private static final TodoDbm _instance = new TodoDbm(); @@ -146,40 +146,14 @@ return _columnVersionno; } - { - initializeColumnInfoList(); - } - //========================================================================== // ========= - // Name Map - // ======== - public Map getDbNamePropertyNameKeyToLowerMap() { - return createDbNamePropertyNameKeyToLowerMap(); + // Resource Initialization + // ======================= + { + initializeInformationResource(); } - public Map getPropertyNameDbNameKeyToLowerMap() { - return createPropertyNameDbNameKeyToLowerMap(); - } - - protected static Map _dbNamePropertyNameKeyToLowerMap; - - protected Map createDbNamePropertyNameKeyToLowerMap() { - if (_dbNamePropertyNameKeyToLowerMap == null) { - _dbNamePropertyNameKeyToLowerMap = setupKeyToLowerMap(true); - } - return _dbNamePropertyNameKeyToLowerMap; - } - - protected static Map _propertyNameDbNameKeyToLowerMap; - - protected Map createPropertyNameDbNameKeyToLowerMap() { - if (_propertyNameDbNameKeyToLowerMap == null) { - _propertyNameDbNameKeyToLowerMap = setupKeyToLowerMap(false); - } - return _propertyNameDbNameKeyToLowerMap; - } - //========================================================================== // ========= // Type Name @@ -348,7 +322,8 @@ // Entity Property Setup // ===================== // It's very INTERNAL! - protected Map> _epsMap = newHashMap(); + protected Map> _epsMap = StringKeyMap + .createAsFlexibleConcurrent(); { setupEps(_epsMap, new EpsId(), columnId()); setupEps(_epsMap, new EpsName(), columnName()); Modified: todolist/trunk/src/main/java/jp/sf/pal/todolist/db/bsentity/dbmeta/TodoMappingDbm.java =================================================================== --- todolist/trunk/src/main/java/jp/sf/pal/todolist/db/bsentity/dbmeta/TodoMappingDbm.java 2008-12-27 22:20:45 UTC (rev 1632) +++ todolist/trunk/src/main/java/jp/sf/pal/todolist/db/bsentity/dbmeta/TodoMappingDbm.java 2008-12-27 22:21:53 UTC (rev 1633) @@ -8,6 +8,7 @@ import jp.sf.pal.todolist.db.allcommon.dbmeta.info.ColumnInfo; import jp.sf.pal.todolist.db.allcommon.dbmeta.info.ForeignInfo; import jp.sf.pal.todolist.db.allcommon.dbmeta.info.UniqueInfo; +import jp.sf.pal.todolist.db.allcommon.helper.StringKeyMap; import jp.sf.pal.todolist.db.exentity.TodoMapping; /** @@ -15,7 +16,6 @@ * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public class TodoMappingDbm extends AbstractDBMeta { private static final TodoMappingDbm _instance = new TodoMappingDbm(); @@ -138,40 +138,14 @@ return _columnVersionno; } - { - initializeColumnInfoList(); - } - //========================================================================== // ========= - // Name Map - // ======== - public Map getDbNamePropertyNameKeyToLowerMap() { - return createDbNamePropertyNameKeyToLowerMap(); + // Resource Initialization + // ======================= + { + initializeInformationResource(); } - public Map getPropertyNameDbNameKeyToLowerMap() { - return createPropertyNameDbNameKeyToLowerMap(); - } - - protected static Map _dbNamePropertyNameKeyToLowerMap; - - protected Map createDbNamePropertyNameKeyToLowerMap() { - if (_dbNamePropertyNameKeyToLowerMap == null) { - _dbNamePropertyNameKeyToLowerMap = setupKeyToLowerMap(true); - } - return _dbNamePropertyNameKeyToLowerMap; - } - - protected static Map _propertyNameDbNameKeyToLowerMap; - - protected Map createPropertyNameDbNameKeyToLowerMap() { - if (_propertyNameDbNameKeyToLowerMap == null) { - _propertyNameDbNameKeyToLowerMap = setupKeyToLowerMap(false); - } - return _propertyNameDbNameKeyToLowerMap; - } - //========================================================================== // ========= // Type Name @@ -347,7 +321,8 @@ // Entity Property Setup // ===================== // It's very INTERNAL! - protected Map> _epsMap = newHashMap(); + protected Map> _epsMap = StringKeyMap + .createAsFlexibleConcurrent(); { setupEps(_epsMap, new EpsId(), columnId()); setupEps(_epsMap, new EpsStatus(), columnStatus()); Modified: todolist/trunk/src/main/java/jp/sf/pal/todolist/db/bsentity/dbmeta/UserInfoDbm.java =================================================================== --- todolist/trunk/src/main/java/jp/sf/pal/todolist/db/bsentity/dbmeta/UserInfoDbm.java 2008-12-27 22:20:45 UTC (rev 1632) +++ todolist/trunk/src/main/java/jp/sf/pal/todolist/db/bsentity/dbmeta/UserInfoDbm.java 2008-12-27 22:21:53 UTC (rev 1633) @@ -9,6 +9,7 @@ import jp.sf.pal.todolist.db.allcommon.dbmeta.info.ForeignInfo; import jp.sf.pal.todolist.db.allcommon.dbmeta.info.ReferrerInfo; import jp.sf.pal.todolist.db.allcommon.dbmeta.info.UniqueInfo; +import jp.sf.pal.todolist.db.allcommon.helper.StringKeyMap; import jp.sf.pal.todolist.db.exentity.UserInfo; /** @@ -16,7 +17,6 @@ * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public class UserInfoDbm extends AbstractDBMeta { private static final UserInfoDbm _instance = new UserInfoDbm(); @@ -93,6 +93,9 @@ protected ColumnInfo _columnGroupId = cci("GROUP_ID", "groupId", String.class, false, 255, 0); + protected ColumnInfo _columnStatus = cci("STATUS", "status", String.class, + false, 1, 0); + protected ColumnInfo _columnCreatedTime = cci("CREATED_TIME", "createdTime", java.sql.Timestamp.class, false, null, null); @@ -174,6 +177,10 @@ return _columnGroupId; } + public ColumnInfo columnStatus() { + return _columnStatus; + } + public ColumnInfo columnCreatedTime() { return _columnCreatedTime; } @@ -202,40 +209,14 @@ return _columnVersionno; } - { - initializeColumnInfoList(); - } - //========================================================================== // ========= - // Name Map - // ======== - public Map getDbNamePropertyNameKeyToLowerMap() { - return createDbNamePropertyNameKeyToLowerMap(); + // Resource Initialization + // ======================= + { + initializeInformationResource(); } - public Map getPropertyNameDbNameKeyToLowerMap() { - return createPropertyNameDbNameKeyToLowerMap(); - } - - protected static Map _dbNamePropertyNameKeyToLowerMap; - - protected Map createDbNamePropertyNameKeyToLowerMap() { - if (_dbNamePropertyNameKeyToLowerMap == null) { - _dbNamePropertyNameKeyToLowerMap = setupKeyToLowerMap(true); - } - return _dbNamePropertyNameKeyToLowerMap; - } - - protected static Map _propertyNameDbNameKeyToLowerMap; - - protected Map createPropertyNameDbNameKeyToLowerMap() { - if (_propertyNameDbNameKeyToLowerMap == null) { - _propertyNameDbNameKeyToLowerMap = setupKeyToLowerMap(false); - } - return _propertyNameDbNameKeyToLowerMap; - } - //========================================================================== // ========= // Type Name @@ -437,7 +418,8 @@ // Entity Property Setup // ===================== // It's very INTERNAL! - protected Map> _epsMap = newHashMap(); + protected Map> _epsMap = StringKeyMap + .createAsFlexibleConcurrent(); { setupEps(_epsMap, new EpsUserId(), columnUserId()); setupEps(_epsMap, new EpsGivenName(), columnGivenName()); @@ -454,6 +436,7 @@ setupEps(_epsMap, new EpsLocale(), columnLocale()); setupEps(_epsMap, new EpsRoleId(), columnRoleId()); setupEps(_epsMap, new EpsGroupId(), columnGroupId()); + setupEps(_epsMap, new EpsStatus(), columnStatus()); setupEps(_epsMap, new EpsCreatedTime(), columnCreatedTime()); setupEps(_epsMap, new EpsCreatedBy(), columnCreatedBy()); setupEps(_epsMap, new EpsUpdatedTime(), columnUpdatedTime()); @@ -562,6 +545,12 @@ } } + public static class EpsStatus implements Eps { + public void setup(UserInfo e, Object v) { + e.setStatus((String) v); + } + } + public static class EpsCreatedTime implements Eps { public void setup(UserInfo e, Object v) { e.setCreatedTime((java.sql.Timestamp) v); Modified: todolist/trunk/src/main/java/jp/sf/pal/todolist/db/cbean/bs/BsGroupInfoCB.java =================================================================== --- todolist/trunk/src/main/java/jp/sf/pal/todolist/db/cbean/bs/BsGroupInfoCB.java 2008-12-27 22:20:45 UTC (rev 1632) +++ todolist/trunk/src/main/java/jp/sf/pal/todolist/db/cbean/bs/BsGroupInfoCB.java 2008-12-27 22:21:53 UTC (rev 1633) @@ -17,7 +17,6 @@ * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public class BsGroupInfoCB extends AbstractConditionBean { //========================================================================== @@ -86,7 +85,12 @@ return _conditionQuery; } - public ConditionQuery getConditionQueryAsInterface() { + /** + * The implementation. + * + * @return The conditionQuery of the local table as interface. (NotNull) + */ + public ConditionQuery localCQ() { return getConditionQuery(); } @@ -136,23 +140,6 @@ query().xsetUnionAllQuery(cq); } - /** - * @param unionQuery The query of 'union'. (NotNull) - * @deprecated Sorry! Please use union(UnionQuery unionQuery). - */ - public void union(GroupInfoCQ unionQuery) { - query().xsetUnionQuery(unionQuery); - } - - /** - * @param unionQuery The query of 'union'. (NotNull) - * @deprecated Sorry! Please use unionAll(UnionQuery - * unionQuery). - */ - public void unionAll(GroupInfoCQ unionQuery) { - query().xsetUnionAllQuery(unionQuery); - } - public boolean hasUnionQueryOrUnionAllQuery() { return query().hasUnionQueryOrUnionAllQuery(); } @@ -180,7 +167,8 @@ public GroupInfoCQ qy() { return query(); } - }, _forDeriveReferrer); + }, _forDerivedReferrer, _forScalarSelect, + _forScalarSubQuery); } return _specification; } @@ -190,8 +178,10 @@ protected SpQyCall _myQyCall; public Specification(ConditionBean baseCB, - SpQyCall qyCall, boolean forDeriveReferrer) { - super(baseCB, qyCall, forDeriveReferrer); + SpQyCall qyCall, boolean forDeriveReferrer, + boolean forScalarSelect, boolean forScalarSubQuery) { + super(baseCB, qyCall, forDeriveReferrer, forScalarSelect, + forScalarSubQuery); _myQyCall = qyCall; } Modified: todolist/trunk/src/main/java/jp/sf/pal/todolist/db/cbean/bs/BsGroupMappingCB.java =================================================================== --- todolist/trunk/src/main/java/jp/sf/pal/todolist/db/cbean/bs/BsGroupMappingCB.java 2008-12-27 22:20:45 UTC (rev 1632) +++ todolist/trunk/src/main/java/jp/sf/pal/todolist/db/cbean/bs/BsGroupMappingCB.java 2008-12-27 22:21:53 UTC (rev 1633) @@ -21,7 +21,6 @@ * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public class BsGroupMappingCB extends AbstractConditionBean { //========================================================================== @@ -89,7 +88,12 @@ return _conditionQuery; } - public ConditionQuery getConditionQueryAsInterface() { + /** + * The implementation. + * + * @return The conditionQuery of the local table as interface. (NotNull) + */ + public ConditionQuery localCQ() { return getConditionQuery(); } @@ -139,24 +143,6 @@ query().xsetUnionAllQuery(cq); } - /** - * @param unionQuery The query of 'union'. (NotNull) - * @deprecated Sorry! Please use union(UnionQuery - * unionQuery). - */ - public void union(GroupMappingCQ unionQuery) { - query().xsetUnionQuery(unionQuery); - } - - /** - * @param unionQuery The query of 'union'. (NotNull) - * @deprecated Sorry! Please use unionAll(UnionQuery - * unionQuery). - */ - public void unionAll(GroupMappingCQ unionQuery) { - query().xsetUnionAllQuery(unionQuery); - } - public boolean hasUnionQueryOrUnionAllQuery() { return query().hasUnionQueryOrUnionAllQuery(); } @@ -165,7 +151,6 @@ // ========= // Setup Select // ============ - protected GroupInfoNss _nssGroupInfo; public GroupInfoNss getNssGroupInfo() { @@ -226,7 +211,8 @@ public GroupMappingCQ qy() { return query(); } - }, _forDeriveReferrer); + }, _forDerivedReferrer, _forScalarSelect, + _forScalarSubQuery); } return _specification; } @@ -240,8 +226,10 @@ protected UserInfoCB.Specification _userInfo; public Specification(ConditionBean baseCB, - SpQyCall qyCall, boolean forDeriveReferrer) { - super(baseCB, qyCall, forDeriveReferrer); + SpQyCall qyCall, boolean forDeriveReferrer, + boolean forScalarSelect, boolean forScalarSubQuery) { + super(baseCB, qyCall, forDeriveReferrer, forScalarSelect, + forScalarSubQuery); _myQyCall = qyCall; } @@ -285,7 +273,8 @@ public GroupInfoCQ qy() { return _myQyCall.qy().queryGroupInfo(); } - }, _forDeriveReferrer); + }, _forDerivedReferrer, _forScalarSelect, + _forScalarSubQuery); } return _groupInfo; } @@ -304,7 +293,8 @@ public UserInfoCQ qy() { return _myQyCall.qy().queryUserInfo(); } - }, _forDeriveReferrer); + }, _forDerivedReferrer, _forScalarSelect, + _forScalarSubQuery); } return _userInfo; } Modified: todolist/trunk/src/main/java/jp/sf/pal/todolist/db/cbean/bs/BsRoleInfoCB.java =================================================================== --- todolist/trunk/src/main/java/jp/sf/pal/todolist/db/cbean/bs/BsRoleInfoCB.java 2008-12-27 22:20:45 UTC (rev 1632) +++ todolist/trunk/src/main/java/jp/sf/pal/todolist/db/cbean/bs/BsRoleInfoCB.java 2008-12-27 22:21:53 UTC (rev 1633) @@ -17,7 +17,6 @@ * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public class BsRoleInfoCB extends AbstractConditionBean { //========================================================================== @@ -86,7 +85,12 @@ return _conditionQuery; } - public ConditionQuery getConditionQueryAsInterface() { + /** + * The implementation. + * + * @return The conditionQuery of the local table as interface. (NotNull) + */ + public ConditionQuery localCQ() { return getConditionQuery(); } @@ -136,23 +140,6 @@ query().xsetUnionAllQuery(cq); } - /** - * @param unionQuery The query of 'union'. (NotNull) - * @deprecated Sorry! Please use union(UnionQuery unionQuery). - */ - public void union(RoleInfoCQ unionQuery) { - query().xsetUnionQuery(unionQuery); - } - - /** - * @param unionQuery The query of 'union'. (NotNull) - * @deprecated Sorry! Please use unionAll(UnionQuery - * unionQuery). - */ - public void unionAll(RoleInfoCQ unionQuery) { - query().xsetUnionAllQuery(unionQuery); - } - public boolean hasUnionQueryOrUnionAllQuery() { return query().hasUnionQueryOrUnionAllQuery(); } @@ -180,7 +167,8 @@ public RoleInfoCQ qy() { return query(); } - }, _forDeriveReferrer); + }, _forDerivedReferrer, _forScalarSelect, + _forScalarSubQuery); } return _specification; } @@ -189,8 +177,10 @@ protected SpQyCall _myQyCall; public Specification(ConditionBean baseCB, SpQyCall qyCall, - boolean forDeriveReferrer) { - super(baseCB, qyCall, forDeriveReferrer); + boolean forDeriveReferrer, boolean forScalarSelect, + boolean forScalarSubQuery) { + super(baseCB, qyCall, forDeriveReferrer, forScalarSelect, + forScalarSubQuery); _myQyCall = qyCall; } Modified: todolist/trunk/src/main/java/jp/sf/pal/todolist/db/cbean/bs/BsRoleMappingCB.java =================================================================== --- todolist/trunk/src/main/java/jp/sf/pal/todolist/db/cbean/bs/BsRoleMappingCB.java 2008-12-27 22:20:45 UTC (rev 1632) +++ todolist/trunk/src/main/java/jp/sf/pal/todolist/db/cbean/bs/BsRoleMappingCB.java 2008-12-27 22:21:53 UTC (rev 1633) @@ -21,7 +21,6 @@ * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public class BsRoleMappingCB extends AbstractConditionBean { //========================================================================== @@ -89,7 +88,12 @@ return _conditionQuery; } - public ConditionQuery getConditionQueryAsInterface() { + /** + * The implementation. + * + * @return The conditionQuery of the local table as interface. (NotNull) + */ + public ConditionQuery localCQ() { return getConditionQuery(); } @@ -139,24 +143,6 @@ query().xsetUnionAllQuery(cq); } - /** - * @param unionQuery The query of 'union'. (NotNull) - * @deprecated Sorry! Please use union(UnionQuery - * unionQuery). - */ - public void union(RoleMappingCQ unionQuery) { - query().xsetUnionQuery(unionQuery); - } - - /** - * @param unionQuery The query of 'union'. (NotNull) - * @deprecated Sorry! Please use unionAll(UnionQuery - * unionQuery). - */ - public void unionAll(RoleMappingCQ unionQuery) { - query().xsetUnionAllQuery(unionQuery); - } - public boolean hasUnionQueryOrUnionAllQuery() { return query().hasUnionQueryOrUnionAllQuery(); } @@ -165,7 +151,6 @@ // ========= // Setup Select // ============ - protected RoleInfoNss _nssRoleInfo; public RoleInfoNss getNssRoleInfo() { @@ -226,7 +211,8 @@ public RoleMappingCQ qy() { return query(); } - }, _forDeriveReferrer); + }, _forDerivedReferrer, _forScalarSelect, + _forScalarSubQuery); } return _specification; } @@ -240,8 +226,10 @@ protected UserInfoCB.Specification _userInfo; public Specification(ConditionBean baseCB, - SpQyCall qyCall, boolean forDeriveReferrer) { - super(baseCB, qyCall, forDeriveReferrer); + SpQyCall qyCall, boolean forDeriveReferrer, + boolean forScalarSelect, boolean forScalarSubQuery) { + super(baseCB, qyCall, forDeriveReferrer, forScalarSelect, + forScalarSubQuery); _myQyCall = qyCall; } @@ -285,7 +273,8 @@ public RoleInfoCQ qy() { return _myQyCall.qy().queryRoleInfo(); } - }, _forDeriveReferrer); + }, _forDerivedReferrer, _forScalarSelect, + _forScalarSubQuery); } return _roleInfo; } @@ -304,7 +293,8 @@ public UserInfoCQ qy() { return _myQyCall.qy().queryUserInfo(); } - }, _forDeriveReferrer); + }, _forDerivedReferrer, _forScalarSelect, + _forScalarSubQuery); } return _userInfo; } Modified: todolist/trunk/src/main/java/jp/sf/pal/todolist/db/cbean/bs/BsTodoCB.java =================================================================== --- todolist/trunk/src/main/java/jp/sf/pal/todolist/db/cbean/bs/BsTodoCB.java 2008-12-27 22:20:45 UTC (rev 1632) +++ todolist/trunk/src/main/java/jp/sf/pal/todolist/db/cbean/bs/BsTodoCB.java 2008-12-27 22:21:53 UTC (rev 1633) @@ -19,7 +19,6 @@ * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public class BsTodoCB extends AbstractConditionBean { //========================================================================== @@ -87,7 +86,12 @@ return _conditionQuery; } - public ConditionQuery getConditionQueryAsInterface() { + /** + * The implementation. + * + * @return The conditionQuery of the local table as interface. (NotNull) + */ + public ConditionQuery localCQ() { return getConditionQuery(); } @@ -137,22 +141,6 @@ query().xsetUnionAllQuery(cq); } - /** - * @param unionQuery The query of 'union'. (NotNull) - * @deprecated Sorry! Please use union(UnionQuery unionQuery). - */ - public void union(TodoCQ unionQuery) { - query().xsetUnionQuery(unionQuery); - } - - /** - * @param unionQuery The query of 'union'. (NotNull) - * @deprecated Sorry! Please use unionAll(UnionQuery unionQuery). - */ - public void unionAll(TodoCQ unionQuery) { - query().xsetUnionAllQuery(unionQuery); - } - public boolean hasUnionQueryOrUnionAllQuery() { return query().hasUnionQueryOrUnionAllQuery(); } @@ -161,7 +149,6 @@ // ========= // Setup Select // ============ - protected UserInfoNss _nssUserInfo; public UserInfoNss getNssUserInfo() { @@ -200,7 +187,7 @@ public TodoCQ qy() { return query(); } - }, _forDeriveReferrer); + }, _forDerivedReferrer, _forScalarSelect, _forScalarSubQuery); } return _specification; } @@ -211,8 +198,10 @@ protected UserInfoCB.Specification _userInfo; public Specification(ConditionBean baseCB, SpQyCall qyCall, - boolean forDeriveReferrer) { - super(baseCB, qyCall, forDeriveReferrer); + boolean forDeriveReferrer, boolean forScalarSelect, + boolean forScalarSubQuery) { + super(baseCB, qyCall, forDeriveReferrer, forScalarSelect, + forScalarSubQuery); _myQyCall = qyCall; } @@ -297,7 +286,8 @@ public UserInfoCQ qy() { return _myQyCall.qy().queryUserInfo(); } - }, _forDeriveReferrer); + }, _forDerivedReferrer, _forScalarSelect, + _forScalarSubQuery); } return _userInfo; } Modified: todolist/trunk/src/main/java/jp/sf/pal/todolist/db/cbean/bs/BsTodoCategoryCB.java =================================================================== --- todolist/trunk/src/main/java/jp/sf/pal/todolist/db/cbean/bs/BsTodoCategoryCB.java 2008-12-27 22:20:45 UTC (rev 1632) +++ todolist/trunk/src/main/java/jp/sf/pal/todolist/db/cbean/bs/BsTodoCategoryCB.java 2008-12-27 22:21:53 UTC (rev 1633) @@ -19,7 +19,6 @@ * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public class BsTodoCategoryCB extends AbstractConditionBean { //========================================================================== @@ -87,7 +86,12 @@ return _conditionQuery; } - public ConditionQuery getConditionQueryAsInterface() { + /** + * The implementation. + * + * @return The conditionQuery of the local table as interface. (NotNull) + */ + public ConditionQuery localCQ() { return getConditionQuery(); } @@ -137,24 +141,6 @@ query().xsetUnionAllQuery(cq); } - /** - * @param unionQuery The query of 'union'. (NotNull) - * @deprecated Sorry! Please use union(UnionQuery - * unionQuery). - */ - public void union(TodoCategoryCQ unionQuery) { - query().xsetUnionQuery(unionQuery); - } - - /** - * @param unionQuery The query of 'union'. (NotNull) - * @deprecated Sorry! Please use unionAll(UnionQuery - * unionQuery). - */ - public void unionAll(TodoCategoryCQ unionQuery) { - query().xsetUnionAllQuery(unionQuery); - } - public boolean hasUnionQueryOrUnionAllQuery() { return query().hasUnionQueryOrUnionAllQuery(); } @@ -163,7 +149,6 @@ // ========= // Setup Select // ============ - protected UserInfoNss _nssUserInfo; public UserInfoNss getNssUserInfo() { @@ -203,7 +188,8 @@ public TodoCategoryCQ qy() { return query(); } - }, _forDeriveReferrer); + }, _forDerivedReferrer, _forScalarSelect, + _forScalarSubQuery); } return _specification; } @@ -215,8 +201,10 @@ protected UserInfoCB.Specification _userInfo; public Specification(ConditionBean baseCB, - SpQyCall qyCall, boolean forDeriveReferrer) { - super(baseCB, qyCall, forDeriveReferrer); + SpQyCall qyCall, boolean forDeriveReferrer, + boolean forScalarSelect, boolean forScalarSubQuery) { + super(baseCB, qyCall, forDeriveReferrer, forScalarSelect, + forScalarSubQuery); _myQyCall = qyCall; } @@ -285,7 +273,8 @@ public UserInfoCQ qy() { return _myQyCall.qy().queryUserInfo(); } - }, _forDeriveReferrer); + }, _forDerivedReferrer, _forScalarSelect, + _forScalarSubQuery); } return _userInfo; } Modified: todolist/trunk/src/main/java/jp/sf/pal/todolist/db/cbean/bs/BsTodoMappingCB.java =================================================================== --- todolist/trunk/src/main/java/jp/sf/pal/todolist/db/cbean/bs/BsTodoMappingCB.java 2008-12-27 22:20:45 UTC (rev 1632) +++ todolist/trunk/src/main/java/jp/sf/pal/todolist/db/cbean/bs/BsTodoMappingCB.java 2008-12-27 22:21:53 UTC (rev 1633) @@ -24,7 +24,6 @@ * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public class BsTodoMappingCB extends AbstractConditionBean { //========================================================================== @@ -92,7 +91,12 @@ return _conditionQuery; } - public ConditionQuery getConditionQueryAsInterface() { + /** + * The implementation. + * + * @return The conditionQuery of the local table as interface. (NotNull) + */ + public ConditionQuery localCQ() { return getConditionQuery(); } @@ -142,24 +146,6 @@ query().xsetUnionAllQuery(cq); } - /** - * @param unionQuery The query of 'union'. (NotNull) - * @deprecated Sorry! Please use union(UnionQuery - * unionQuery). - */ - public void union(TodoMappingCQ unionQuery) { - query().xsetUnionQuery(unionQuery); - } - - /** - * @param unionQuery The query of 'union'. (NotNull) - * @deprecated Sorry! Please use unionAll(UnionQuery - * unionQuery). - */ - public void unionAll(TodoMappingCQ unionQuery) { - query().xsetUnionAllQuery(unionQuery); - } - public boolean hasUnionQueryOrUnionAllQuery() { return query().hasUnionQueryOrUnionAllQuery(); } @@ -168,7 +154,6 @@ // ========= // Setup Select // ============ - protected TodoNss _nssTodo; public TodoNss getNssTodo() { @@ -250,7 +235,8 @@ public TodoMappingCQ qy() { return query(); } - }, _forDeriveReferrer); + }, _forDerivedReferrer, _forScalarSelect, + _forScalarSubQuery); } return _specification; } @@ -266,8 +252,10 @@ protected UserInfoCB.Specification _userInfo; public Specification(ConditionBean baseCB, - SpQyCall qyCall, boolean forDeriveReferrer) { - super(baseCB, qyCall, forDeriveReferrer); + SpQyCall qyCall, boolean forDeriveReferrer, + boolean forScalarSelect, boolean forScalarSubQuery) { + super(baseCB, qyCall, forDeriveReferrer, forScalarSelect, + forScalarSubQuery); _myQyCall = qyCall; } @@ -354,7 +342,8 @@ public TodoCQ qy() { return _myQyCall.qy().queryTodo(); } - }, _forDeriveReferrer); + }, _forDerivedReferrer, _forScalarSelect, + _forScalarSubQuery); } return _todo; } @@ -362,7 +351,8 @@ public TodoCategoryCB.Specification specifyTodoCategory() { assertForeign("todoCategory"); if (_todoCategory == null) { - _todoCategory = new TodoCategoryCB.Specification(_baseCB, + _todoCategory = new TodoCategoryCB.Specification( + _baseCB, new SpQyCall() { public boolean has() { return _myQyCall.has() @@ -374,7 +364,8 @@ public TodoCategoryCQ qy() { return _myQyCall.qy().queryTodoCategory(); } - }, _forDeriveReferrer); + }, _forDerivedReferrer, _forScalarSelect, + _forScalarSubQuery); } return _todoCategory; } @@ -393,7 +384,8 @@ public UserInfoCQ qy() { return _myQyCall.qy().queryUserInfo(); } - }, _forDeriveReferrer); + }, _forDerivedReferrer, _forScalarSelect, + _forScalarSubQuery); } return _userInfo; } Modified: todolist/trunk/src/main/java/jp/sf/pal/todolist/db/cbean/bs/BsUserInfoCB.java =================================================================== --- todolist/trunk/src/main/java/jp/sf/pal/todolist/db/cbean/bs/BsUserInfoCB.java 2008-12-27 22:20:45 UTC (rev 1632) +++ todolist/trunk/src/main/java/jp/sf/pal/todolist/db/cbean/bs/BsUserInfoCB.java 2008-12-27 22:21:53 UTC (rev 1633) @@ -26,7 +26,6 @@ * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public class BsUserInfoCB extends AbstractConditionBean { //========================================================================== @@ -95,7 +94,12 @@ return _conditionQuery; } - public ConditionQuery getConditionQueryAsInterface() { + /** + * The implementation. + * + * @return The conditionQuery of the local table as interface. (NotNull) + */ + public ConditionQuery localCQ() { return getConditionQuery(); } @@ -145,23 +149,6 @@ query().xsetUnionAllQuery(cq); } - /** - * @param unionQuery The query of 'union'. (NotNull) - * @deprecated Sorry! Please use union(UnionQuery unionQuery). - */ - public void union(UserInfoCQ unionQuery) { - query().xsetUnionQuery(unionQuery); - } - - /** - * @param unionQuery The query of 'union'. (NotNull) - * @deprecated Sorry! Please use unionAll(UnionQuery - * unionQuery). - */ - public void unionAll(UserInfoCQ unionQuery) { - query().xsetUnionAllQuery(unionQuery); - } - public boolean hasUnionQueryOrUnionAllQuery() { return query().hasUnionQueryOrUnionAllQuery(); } @@ -170,7 +157,6 @@ // ========= // Setup Select // ============ - protected GroupInfoNss _nssGroupInfo; public GroupInfoNss getNssGroupInfo() { @@ -231,7 +217,8 @@ public UserInfoCQ qy() { return query(); } - }, _forDeriveReferrer); + }, _forDerivedReferrer, _forScalarSelect, + _forScalarSubQuery); } return _specification; } @@ -244,8 +231,10 @@ protected RoleInfoCB.Specification _roleInfo; public Specification(ConditionBean baseCB, SpQyCall qyCall, - boolean forDeriveReferrer) { - super(baseCB, qyCall, forDeriveReferrer); + boolean forDeriveReferrer, boolean forScalarSelect, + boolean forScalarSubQuery) { + super(baseCB, qyCall, forDeriveReferrer, forScalarSelect, + forScalarSubQuery); _myQyCall = qyCall; } @@ -309,6 +298,10 @@ doColumn("GROUP_ID"); } + public void columnStatus() { + doColumn("STATUS"); + } + public void columnCreatedTime() { doColumn("CREATED_TIME"); } @@ -365,7 +358,8 @@ public GroupInfoCQ qy() { return _myQyCall.qy().queryGroupInfo(); } - }, _forDeriveReferrer); + }, _forDerivedReferrer, _forScalarSelect, + _forScalarSubQuery); } return _groupInfo; } @@ -384,7 +378,8 @@ public RoleInfoCQ qy() { return _myQyCall.qy().queryRoleInfo(); } - }, _forDeriveReferrer); + }, _forDerivedReferrer, _forScalarSelect, + _forScalarSubQuery); } return _roleInfo; } Modified: todolist/trunk/src/main/java/jp/sf/pal/todolist/db/cbean/cq/bs/AbstractBsGroupInfoCQ.java =================================================================== --- todolist/trunk/src/main/java/jp/sf/pal/todolist/db/cbean/cq/bs/AbstractBsGroupInfoCQ.java 2008-12-27 22:20:45 UTC (rev 1632) +++ todolist/trunk/src/main/java/jp/sf/pal/todolist/db/cbean/cq/bs/AbstractBsGroupInfoCQ.java 2008-12-27 22:21:53 UTC (rev 1633) @@ -20,7 +20,6 @@ * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public abstract class AbstractBsGroupInfoCQ extends AbstractConditionQuery { //========================================================================== @@ -50,7 +49,7 @@ // ===== /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {PK : NotNull : + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {PK : NotNull : * VARCHAR(255)} * * @param groupId The value of groupId as equal. @@ -60,7 +59,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param groupId The value of groupId as notEqual. */ @@ -69,7 +68,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param groupId The value of groupId as greaterThan. */ @@ -78,7 +77,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param groupId The value of groupId as lessThan. */ @@ -87,7 +86,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param groupId The value of groupId as greaterEqual. */ @@ -96,7 +95,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param groupId The value of groupId as lessEqual. */ @@ -105,7 +104,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param groupId The value of groupId as prefixSearch. */ @@ -114,20 +113,6 @@ } /** - * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, - * SeveralRegistered. - * - * @param groupId The value of groupId as likeSearch. - * @param likeSearchOption The option of like-search. (NotNull) - */ - public void setGroupId_LikeSearch( - String groupId, - jp.sf.pal.todolist.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { - registerLikeSearchQuery(CK_LS, fRES(groupId), getCValueGroupId(), - "GROUP_ID", "GroupId", "groupId", likeSearchOption); - } - - /** * InScope(in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * @@ -138,43 +123,41 @@ } /** - * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * - * @param groupId The collection of groupId as inScope. - * @param inScopeOption The option of in-scope. (NotNull) + * @param groupIdList The collection of groupId as notInScope. */ - public void setGroupId_InScope( - String groupId, - jp.sf.pal.todolist.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(groupId), getCValueGroupId(), - "GROUP_ID", "GroupId", "groupId", inScopeOption); + public void setGroupId_NotInScope(Collection groupIdList) { + regGroupId(CK_NINS, cTL(groupIdList)); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param groupIdList The collection of groupId as notInScope. + * @param groupId The value of groupId as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) */ - public void setGroupId_NotInScope(Collection groupIdList) { - regGroupId(CK_NINS, cTL(groupIdList)); + public void setGroupId_LikeSearch( + String groupId, + jp.sf.pal.todolist.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(groupId), getCValueGroupId(), "GROUP_ID", "GroupId", + "groupId", likeSearchOption); } /** - * @param groupMappingCBquery Query. - * @deprecated Please use inScopeGroupMappingList(subQuery) method. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param groupId The value of groupId as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setGroupId_InScopeSubQuery_GroupMappingList( - GroupMappingCQ groupMappingCBquery) { - String subQueryPropertyName = keepGroupId_InScopeSubQuery_GroupMappingList(groupMappingCBquery);// for - // saving - // query - // - - // value - // . - registerInScopeSubQuery(groupMappingCBquery, "GROUP_ID", "GROUP_ID", - subQueryPropertyName); + public void setGroupId_NotLikeSearch( + String groupId, + jp.sf.pal.todolist.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(groupId), getCValueGroupId(), "GROUP_ID", + "GroupId", "groupId", likeSearchOption); } public void inScopeGroupMappingList(SubQuery subQuery) { @@ -183,42 +166,26 @@ cb.xsetupForInScopeSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepGroupId_InScopeSubQuery_GroupMappingList(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerInScopeSubQuery(cb.query(), "GROUP_ID", "GROUP_ID", subQueryPropertyName); } - abstract public String keepGroupId_InScopeSubQuery_GroupMappingList( + public abstract String keepGroupId_InScopeSubQuery_GroupMappingList( GroupMappingCQ subQuery); - /** - * @param userInfoCBquery Query. - * @deprecated Please use inScopeUserInfoList(subQuery) method. - */ - public void setGroupId_InScopeSubQuery_UserInfoList( - UserInfoCQ userInfoCBquery) { - String subQueryPropertyName = keepGroupId_InScopeSubQuery_UserInfoList(userInfoCBquery);// for - // saving - // query - // - - // value - // . - registerInScopeSubQuery(userInfoCBquery, "GROUP_ID", "GROUP_ID", - subQueryPropertyName); - } - public void inScopeUserInfoList(SubQuery subQuery) { assertObjectNotNull("subQuery", subQuery); UserInfoCB cb = new UserInfoCB(); cb.xsetupForInScopeSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepGroupId_InScopeSubQuery_UserInfoList(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerInScopeSubQuery(cb.query(), "GROUP_ID", "GROUP_ID", subQueryPropertyName); } - abstract public String keepGroupId_InScopeSubQuery_UserInfoList( + public abstract String keepGroupId_InScopeSubQuery_UserInfoList( UserInfoCQ subQuery); public void notInScopeGroupMappingList(SubQuery subQuery) { @@ -227,12 +194,12 @@ cb.xsetupForInScopeSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepGroupId_NotInScopeSubQuery_GroupMappingList(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerNotInScopeSubQuery(cb.query(), "GROUP_ID", "GROUP_ID", subQueryPropertyName); } - abstract public String keepGroupId_NotInScopeSubQuery_GroupMappingList( + public abstract String keepGroupId_NotInScopeSubQuery_GroupMappingList( GroupMappingCQ subQuery); public void notInScopeUserInfoList(SubQuery subQuery) { @@ -241,31 +208,15 @@ cb.xsetupForInScopeSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepGroupId_NotInScopeSubQuery_UserInfoList(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerNotInScopeSubQuery(cb.query(), "GROUP_ID", "GROUP_ID", subQueryPropertyName); } - abstract public String keepGroupId_NotInScopeSubQuery_UserInfoList( + public abstract String keepGroupId_NotInScopeSubQuery_UserInfoList( UserInfoCQ subQuery); /** - * @param groupMappingCBquery Query. - * @deprecated Please use existsGroupMappingList(subQuery) method. - */ - public void setGroupId_ExistsSubQuery_GroupMappingList( - GroupMappingCQ groupMappingCBquery) { - String subQueryPropertyName = keepGroupId_ExistsSubQuery_GroupMappingList(groupMappingCBquery);// for - // saving - // query - // - - // value - // . - registerExistsSubQuery(groupMappingCBquery, "GROUP_ID", "GROUP_ID", - subQueryPropertyName); - } - - /** * Set up 'exists' sub-query. {exists (select GROUP_ID from GROUP_MAPPING * where ...)} * @@ -278,31 +229,15 @@ cb.xsetupForExistsSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepGroupId_ExistsSubQuery_GroupMappingList(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerExistsSubQuery(cb.query(), "GROUP_ID", "GROUP_ID", subQueryPropertyName); } - abstract public String keepGroupId_ExistsSubQuery_GroupMappingList( + public abstract String keepGroupId_ExistsSubQuery_GroupMappingList( GroupMappingCQ subQuery); /** - * @param userInfoCBquery Query. - * @deprecated Please use existsUserInfoList(subQuery) method. - */ - public void setGroupId_ExistsSubQuery_UserInfoList( - UserInfoCQ userInfoCBquery) { - String subQueryPropertyName = keepGroupId_ExistsSubQuery_UserInfoList(userInfoCBquery);// for - // saving - // query - // - - // value - // . - registerExistsSubQuery(userInfoCBquery, "GROUP_ID", "GROUP_ID", - subQueryPropertyName); - } - - /** * Set up 'exists' sub-query. {exists (select GROUP_ID from USER_INFO where * ...)} * @@ -315,12 +250,12 @@ cb.xsetupForExistsSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepGroupId_ExistsSubQuery_UserInfoList(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerExistsSubQuery(cb.query(), "GROUP_ID", "GROUP_ID", subQueryPropertyName); } - abstract public String keepGroupId_ExistsSubQuery_UserInfoList( + public abstract String keepGroupId_ExistsSubQuery_UserInfoList( UserInfoCQ subQuery); /** @@ -337,12 +272,12 @@ cb.xsetupForExistsSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepGroupId_NotExistsSubQuery_GroupMappingList(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerNotExistsSubQuery(cb.query(), "GROUP_ID", "GROUP_ID", subQueryPropertyName); } - abstract public String keepGroupId_NotExistsSubQuery_GroupMappingList( + public abstract String keepGroupId_NotExistsSubQuery_GroupMappingList( GroupMappingCQ subQuery); /** @@ -358,53 +293,53 @@ cb.xsetupForExistsSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepGroupId_NotExistsSubQuery_UserInfoList(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerNotExistsSubQuery(cb.query(), "GROUP_ID", "GROUP_ID", subQueryPropertyName); } - abstract public String keepGroupId_NotExistsSubQuery_UserInfoList( + public abstract String keepGroupId_NotExistsSubQuery_UserInfoList( UserInfoCQ subQuery); public void xderiveGroupMappingList(String function, SubQuery subQuery, String aliasName) { assertObjectNotNull("subQuery", subQuery); GroupMappingCB cb = new GroupMappingCB(); - cb.xsetupForDeriveReferrer(); + cb.xsetupForDerivedReferrer(); subQuery.query(cb); - String subQueryPropertyName = keepGroupId_DeriveSubQuery_GroupMappingList(cb - .query());// for saving query-value. - registerDeriveSubQuery(function, cb.query(), "GROUP_ID", "GROUP_ID", - subQueryPropertyName, aliasName); + String subQueryPropertyName = keepGroupId_DerivedReferrer_GroupMappingList(cb + .query()); // for saving query-value. + registerDerivedReferrerSubQuery(function, cb.query(), "GROUP_ID", + "GROUP_ID", subQueryPropertyName, aliasName); } - abstract public String keepGroupId_DeriveSubQuery_GroupMappingList( + public abstract String keepGroupId_DerivedReferrer_GroupMappingList( GroupMappingCQ subQuery); public void xderiveUserInfoList(String function, SubQuery subQuery, String aliasName) { assertObjectNotNull("subQuery", subQuery); UserInfoCB cb = new UserInfoCB(); - cb.xsetupForDeriveReferrer(); + cb.xsetupForDerivedReferrer(); subQuery.query(cb); - String subQueryPropertyName = keepGroupId_DeriveSubQuery_UserInfoList(cb - .query());// for saving query-value. - registerDeriveSubQuery(function, cb.query(), "GROUP_ID", "GROUP_ID", - subQueryPropertyName, aliasName); + String subQueryPropertyName = keepGroupId_DerivedReferrer_UserInfoList(cb + .query()); // for saving query-value. + registerDerivedReferrerSubQuery(function, cb.query(), "GROUP_ID", + "GROUP_ID", subQueryPropertyName, aliasName); } - abstract public String keepGroupId_DeriveSubQuery_UserInfoList( + public abstract String keepGroupId_DerivedReferrer_UserInfoList( UserInfoCQ subQuery); /** - * IsNull(is null). And OnceRegistered. + * IsNull(is null). And OnlyOnceRegistered. */ public void setGroupId_IsNull() { regGroupId(CK_ISN, DUMMY_OBJECT); } /** - * IsNotNull(is not null). And OnceRegistered. + * IsNotNull(is not null). And OnlyOnceRegistered. */ public void setGroupId_IsNotNull() { regGroupId(CK_ISNN, DUMMY_OBJECT); @@ -423,7 +358,7 @@ abstract protected ConditionValue getCValueGroupId(); /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {VARCHAR(100)} + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {VARCHAR(100)} * * @param name The value of name as equal. */ @@ -432,7 +367,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param name The value of name as notEqual. */ @@ -441,7 +376,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param name The value of name as greaterThan. */ @@ -450,7 +385,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param name The value of name as lessThan. */ @@ -459,7 +394,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param name The value of name as greaterEqual. */ @@ -468,7 +403,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param name The value of name as lessEqual. */ @@ -477,7 +412,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param name The value of name as prefixSearch. */ @@ -486,20 +421,6 @@ } /** - * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, - * SeveralRegistered. - * - * @param name The value of name as likeSearch. - * @param likeSearchOption The option of like-search. (NotNull) - */ - public void setName_LikeSearch( - String name, - jp.sf.pal.todolist.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { - registerLikeSearchQuery(CK_LS, fRES(name), getCValueName(), "NAME", - "Name", "name", likeSearchOption); - } - - /** * InScope(in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * @@ -510,38 +431,52 @@ } /** - * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * - * @param name The collection of name as inScope. - * @param inScopeOption The option of in-scope. (NotNull) + * @param nameList The collection of name as notInScope. */ - public void setName_InScope( + public void setName_NotInScope(Collection nameList) { + regName(CK_NINS, cTL(nameList)); + } + + /** + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param name The value of name as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) + */ + public void setName_LikeSearch( String name, - jp.sf.pal.todolist.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(name), getCValueName(), "NAME", - "Name", "name", inScopeOption); + jp.sf.pal.todolist.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(name), getCValueName(), "NAME", "Name", "name", + likeSearchOption); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param nameList The collection of name as notInScope. + * @param name The value of name as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setName_NotInScope(Collection nameList) { - regName(CK_NINS, cTL(nameList)); + public void setName_NotLikeSearch( + String name, + jp.sf.pal.todolist.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(name), getCValueName(), "NAME", "Name", "name", + likeSearchOption); } /** - * IsNull(is null). And OnceRegistered. + * IsNull(is null). And OnlyOnceRegistered. */ public void setName_IsNull() { regName(CK_ISN, DUMMY_OBJECT); } /** - * IsNotNull(is not null). And OnceRegistered. + * IsNotNull(is not null). And OnlyOnceRegistered. */ public void setName_IsNotNull() { regName(CK_ISNN, DUMMY_OBJECT); @@ -558,7 +493,7 @@ abstract protected ConditionValue getCValueName(); /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {VARCHAR(255)} + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {VARCHAR(255)} * * @param description The value of description as equal. */ @@ -567,7 +502,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param description The value of description as notEqual. */ @@ -576,7 +511,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param description The value of description as greaterThan. */ @@ -585,7 +520,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param description The value of description as lessThan. */ @@ -594,7 +529,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param description The value of description as greaterEqual. */ @@ -603,7 +538,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param description The value of description as lessEqual. */ @@ -612,7 +547,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param description The value of description as prefixSearch. */ @@ -621,21 +556,6 @@ } /** - * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, - * SeveralRegistered. - * - * @param description The value of description as likeSearch. - * @param likeSearchOption The option of like-search. (NotNull) - */ - public void setDescription_LikeSearch( - String description, - jp.sf.pal.todolist.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { - registerLikeSearchQuery(CK_LS, fRES(description), - getCValueDescription(), "DESCRIPTION", "Description", - "description", likeSearchOption); - } - - /** * InScope(in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * @@ -646,38 +566,52 @@ } /** - * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * - * @param description The collection of description as inScope. - * @param inScopeOption The option of in-scope. (NotNull) + * @param descriptionList The collection of description as notInScope. */ - public void setDescription_InScope( + public void setDescription_NotInScope(Collection descriptionList) { + regDescription(CK_NINS, cTL(descriptionList)); + } + + /** + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param description The value of description as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) + */ + public void setDescription_LikeSearch( String description, - jp.sf.pal.todolist.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(description), getCValueDescription(), - "DESCRIPTION", "Description", "description", inScopeOption); + jp.sf.pal.todolist.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(description), getCValueDescription(), "DESCRIPTION", + "Description", "description", likeSearchOption); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param descriptionList The collection of description as notInScope. + * @param description The value of description as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setDescription_NotInScope(Collection descriptionList) { - regDescription(CK_NINS, cTL(descriptionList)); + public void setDescription_NotLikeSearch( + String description, + jp.sf.pal.todolist.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(description), getCValueDescription(), + "DESCRIPTION", "Description", "description", likeSearchOption); } /** - * IsNull(is null). And OnceRegistered. + * IsNull(is null). And OnlyOnceRegistered. */ public void setDescription_IsNull() { regDescription(CK_ISN, DUMMY_OBJECT); } /** - * IsNotNull(is not null). And OnceRegistered. + * IsNotNull(is not null). And OnlyOnceRegistered. */ public void setDescription_IsNotNull() { regDescription(CK_ISNN, DUMMY_OBJECT); @@ -696,7 +630,7 @@ abstract protected ConditionValue getCValueDescription(); /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {VARCHAR(255)} + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {VARCHAR(255)} * * @param email The value of email as equal. */ @@ -705,7 +639,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param email The value of email as notEqual. */ @@ -714,7 +648,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param email The value of email as greaterThan. */ @@ -723,7 +657,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param email The value of email as lessThan. */ @@ -732,7 +666,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param email The value of email as greaterEqual. */ @@ -741,7 +675,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param email The value of email as lessEqual. */ @@ -750,7 +684,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param email The value of email as prefixSearch. */ @@ -759,20 +693,6 @@ } /** - * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, - * SeveralRegistered. - * - * @param email The value of email as likeSearch. - * @param likeSearchOption The option of like-search. (NotNull) - */ - public void setEmail_LikeSearch( - String email, - jp.sf.pal.todolist.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { - registerLikeSearchQuery(CK_LS, fRES(email), getCValueEmail(), "EMAIL", - "Email", "email", likeSearchOption); - } - - /** * InScope(in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * @@ -783,38 +703,52 @@ } /** - * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * - * @param email The collection of email as inScope. - * @param inScopeOption The option of in-scope. (NotNull) + * @param emailList The collection of email as notInScope. */ - public void setEmail_InScope( + public void setEmail_NotInScope(Collection emailList) { + regEmail(CK_NINS, cTL(emailList)); + } + + /** + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param email The value of email as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) + */ + public void setEmail_LikeSearch( String email, - jp.sf.pal.todolist.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(email), getCValueEmail(), "EMAIL", - "Email", "email", inScopeOption); + jp.sf.pal.todolist.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(email), getCValueEmail(), "EMAIL", "Email", "email", + likeSearchOption); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param emailList The collection of email as notInScope. + * @param email The value of email as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setEmail_NotInScope(Collection emailList) { - regEmail(CK_NINS, cTL(emailList)); + public void setEmail_NotLikeSearch( + String email, + jp.sf.pal.todolist.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(email), getCValueEmail(), "EMAIL", "Email", + "email", likeSearchOption); } /** - * IsNull(is null). And OnceRegistered. + * IsNull(is null). And OnlyOnceRegistered. */ public void setEmail_IsNull() { regEmail(CK_ISN, DUMMY_OBJECT); } /** - * IsNotNull(is not null). And OnceRegistered. + * IsNotNull(is not null). And OnlyOnceRegistered. */ public void setEmail_IsNotNull() { regEmail(CK_ISNN, DUMMY_OBJECT); @@ -832,7 +766,7 @@ abstract protected ConditionValue getCValueEmail(); /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {VARCHAR(255)} + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {VARCHAR(255)} * * @param url The value of url as equal. */ @@ -841,7 +775,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param url The value of url as notEqual. */ @@ -850,7 +784,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param url The value of url as greaterThan. */ @@ -859,7 +793,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param url The value of url as lessThan. */ @@ -868,7 +802,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param url The value of url as greaterEqual. */ @@ -877,7 +811,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param url The value of url as lessEqual. */ @@ -886,7 +820,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param url The value of url as prefixSearch. */ @@ -895,20 +829,6 @@ } /** - * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, - * SeveralRegistered. - * - * @param url The value of url as likeSearch. - * @param likeSearchOption The option of like-search. (NotNull) - */ - public void setUrl_LikeSearch( - String url, - jp.sf.pal.todolist.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { - registerLikeSearchQuery(CK_LS, fRES(url), getCValueUrl(), "URL", "Url", - "url", likeSearchOption); - } - - /** * InScope(in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * @@ -919,38 +839,52 @@ } /** - * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * - * @param url The collection of url as inScope. - * @param inScopeOption The option of in-scope. (NotNull) + * @param urlList The collection of url as notInScope. */ - public void setUrl_InScope( + public void setUrl_NotInScope(Collection urlList) { + regUrl(CK_NINS, cTL(urlList)); + } + + /** + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param url The value of url as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) + */ + public void setUrl_LikeSearch( String url, - jp.sf.pal.todolist.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(url), getCValueUrl(), "URL", "Url", - "url", inScopeOption); + jp.sf.pal.todolist.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(url), getCValueUrl(), "URL", "Url", "url", + likeSearchOption); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param urlList The collection of url as notInScope. + * @param url The value of url as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setUrl_NotInScope(Collection urlList) { - regUrl(CK_NINS, cTL(urlList)); + public void setUrl_NotLikeSearch( + String url, + jp.sf.pal.todolist.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(url), getCValueUrl(), "URL", "Url", "url", + likeSearchOption); } /** - * IsNull(is null). And OnceRegistered. + * IsNull(is null). And OnlyOnceRegistered. */ public void setUrl_IsNull() { regUrl(CK_ISN, DUMMY_OBJECT); } /** - * IsNotNull(is not null). And OnceRegistered. + * IsNotNull(is not null). And OnlyOnceRegistered. */ public void setUrl_IsNotNull() { regUrl(CK_ISNN, DUMMY_OBJECT); @@ -967,7 +901,7 @@ abstract protected ConditionValue getCValueUrl(); /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {VARCHAR(40)} + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {VARCHAR(40)} * * @param telephone The value of telephone as equal. */ @@ -976,7 +910,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param telephone The value of telephone as notEqual. */ @@ -985,7 +919,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param telephone The value of telephone as greaterThan. */ @@ -994,7 +928,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param telephone The value of telephone as lessThan. */ @@ -1003,7 +937,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param telephone The value of telephone as greaterEqual. */ @@ -1012,7 +946,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param telephone The value of telephone as lessEqual. */ @@ -1021,7 +955,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param telephone The value of telephone as prefixSearch. */ @@ -1030,20 +964,6 @@ } /** - * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, - * SeveralRegistered. - * - * @param telephone The value of telephone as likeSearch. - * @param likeSearchOption The option of like-search. (NotNull) - */ - public void setTelephone_LikeSearch( - String telephone, - jp.sf.pal.todolist.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { - registerLikeSearchQuery(CK_LS, fRES(telephone), getCValueTelephone(), - "TELEPHONE", "Telephone", "telephone", likeSearchOption); - } - - /** * InScope(in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * @@ -1054,38 +974,52 @@ } /** - * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * - * @param telephone The collection of telephone as inScope. - * @param inScopeOption The option of in-scope. (NotNull) + * @param telephoneList The collection of telephone as notInScope. */ - public void setTelephone_InScope( + public void setTelephone_NotInScope(Collection telephoneList) { + regTelephone(CK_NINS, cTL(telephoneList)); + } + + /** + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param telephone The value of telephone as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) + */ + public void setTelephone_LikeSearch( String telephone, - jp.sf.pal.todolist.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(telephone), getCValueTelephone(), - "TELEPHONE", "Telephone", "telephone", inScopeOption); + jp.sf.pal.todolist.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(telephone), getCValueTelephone(), "TELEPHONE", + "Telephone", "telephone", likeSearchOption); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param telephoneList The collection of telephone as notInScope. + * @param telephone The value of telephone as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setTelephone_NotInScope(Collection telephoneList) { - regTelephone(CK_NINS, cTL(telephoneList)); + public void setTelephone_NotLikeSearch( + String telephone, + jp.sf.pal.todolist.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(telephone), getCValueTelephone(), "TELEPHONE", + "Telephone", "telephone", likeSearchOption); } /** - * IsNull(is null). And OnceRegistered. + * IsNull(is null). And OnlyOnceRegistered. */ public void setTelephone_IsNull() { regTelephone(CK_ISN, DUMMY_OBJECT); } /** - * IsNotNull(is not null). And OnceRegistered. + * IsNotNull(is not null). And OnlyOnceRegistered. */ public void setTelephone_IsNotNull() { regTelephone(CK_ISNN, DUMMY_OBJECT); @@ -1104,7 +1038,7 @@ abstract protected ConditionValue getCValueTelephone(); /** - * Equal(=). And NullIgnored, OnceRegistered. {NotNull : TIMESTAMP} + * Equal(=). And NullIgnored, OnlyOnceRegistered. {NotNull : TIMESTAMP} * * @param createdTime The value of createdTime as equal. */ @@ -1113,7 +1047,7 @@ } /** - * NotEqual(!=). And NullIgnored, OnceRegistered. + * NotEqual(!=). And NullIgnored, OnlyOnceRegistered. * * @param createdTime The value of createdTime as notEqual. */ @@ -1122,7 +1056,7 @@ } /** - * GreaterThan(>). And NullIgnored, OnceRegistered. + * GreaterThan(>). And NullIgnored, OnlyOnceRegistered. * * @param createdTime The value of createdTime as greaterThan. */ @@ -1131,7 +1065,7 @@ } /** - * LessThan(>). And NullIgnored, OnceRegistered. + * LessThan(>). And NullIgnored, OnlyOnceRegistered. * * @param createdTime The value of createdTime as lessThan. */ @@ -1140,7 +1074,7 @@ } /** - * GreaterEqual(>). And NullIgnored, OnceRegistered. + * GreaterEqual(>). And NullIgnored, OnlyOnceRegistered. * * @param createdTime The value of createdTime as greaterEqual. */ @@ -1149,7 +1083,7 @@ } /** - * LessEqual(>). And NullIgnored, OnceRegistered. + * LessEqual(>). And NullIgnored, OnlyOnceRegistered. * * @param createdTime The value of createdTime as lessEqual. */ @@ -1159,7 +1093,7 @@ /** * FromTo($fromDate <= COLUMN_NAME <= $toDate). And NullIgnored, - * OnceRegistered. {NotNull : TIMESTAMP} + * OnlyOnceRegistered. {NotNull : TIMESTAMP} * * @param fromDate The from-date of createdTime. (Nullable) * @param toDate The to-date of createdTime. (Nullable) @@ -1177,7 +1111,7 @@ /** * FromTo($fromDate <= COLUMN_NAME < $toDate + 1). And NullIgnored, - * OnceRegistered. {NotNull : TIMESTAMP} + * OnlyOnceRegistered. {NotNull : TIMESTAMP} * * @param fromDate The from-date of createdTime. (Nullable) * @param toDate The to-date of createdTime. (Nullable) @@ -1203,7 +1137,7 @@ abstract protected ConditionValue getCValueCreatedTime(); /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {NotNull : + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {NotNull : * VARCHAR(255)} * * @param createdBy The value of createdBy as equal. @@ -1213,7 +1147,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param createdBy The value of createdBy as notEqual. */ @@ -1222,7 +1156,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param createdBy The value of createdBy as greaterThan. */ @@ -1231,7 +1165,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param createdBy The value of createdBy as lessThan. */ @@ -1240,7 +1174,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param createdBy The value of createdBy as greaterEqual. */ @@ -1249,7 +1183,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param createdBy The value of createdBy as lessEqual. */ @@ -1258,7 +1192,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param createdBy The value of createdBy as prefixSearch. */ @@ -1267,20 +1201,6 @@ } /** - * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, - * SeveralRegistered. - * - * @param createdBy The value of createdBy as likeSearch. - * @param likeSearchOption The option of like-search. (NotNull) - */ - public void setCreatedBy_LikeSearch( - String createdBy, - jp.sf.pal.todolist.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { - registerLikeSearchQuery(CK_LS, fRES(createdBy), getCValueCreatedBy(), - "CREATED_BY", "CreatedBy", "createdBy", likeSearchOption); - } - - /** * InScope(in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * @@ -1291,27 +1211,41 @@ } /** - * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * - * @param createdBy The collection of createdBy as inScope. - * @param inScopeOption The option of in-scope. (NotNull) + * @param createdByList The collection of createdBy as notInScope. */ - public void setCreatedBy_InScope( + public void setCreatedBy_NotInScope(Collection createdByList) { + regCreatedBy(CK_NINS, cTL(createdByList)); + } + + /** + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param createdBy The value of createdBy as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) + */ + public void setCreatedBy_LikeSearch( String createdBy, - jp.sf.pal.todolist.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(createdBy), getCValueCreatedBy(), - "CREATED_BY", "CreatedBy", "createdBy", inScopeOption); + jp.sf.pal.todolist.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(createdBy), getCValueCreatedBy(), "CREATED_BY", + "CreatedBy", "createdBy", likeSearchOption); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param createdByList The collection of createdBy as notInScope. + * @param createdBy The value of createdBy as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setCreatedBy_NotInScope(Collection createdByList) { - regCreatedBy(CK_NINS, cTL(createdByList)); + public void setCreatedBy_NotLikeSearch( + String createdBy, + jp.sf.pal.todolist.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(createdBy), getCValueCreatedBy(), "CREATED_BY", + "CreatedBy", "createdBy", likeSearchOption); } protected void regCreatedBy(ConditionKey key, Object value) { @@ -1327,7 +1261,7 @@ abstract protected ConditionValue getCValueCreatedBy(); /** - * Equal(=). And NullIgnored, OnceRegistered. {NotNull : TIMESTAMP} + * Equal(=). And NullIgnored, OnlyOnceRegistered. {NotNull : TIMESTAMP} * * @param updatedTime The value of updatedTime as equal. */ @@ -1336,7 +1270,7 @@ } /** - * NotEqual(!=). And NullIgnored, OnceRegistered. + * NotEqual(!=). And NullIgnored, OnlyOnceRegistered. * * @param updatedTime The value of updatedTime as notEqual. */ @@ -1345,7 +1279,7 @@ } /** - * GreaterThan(>). And NullIgnored, OnceRegistered. + * GreaterThan(>). And NullIgnored, OnlyOnceRegistered. * * @param updatedTime The value of updatedTime as greaterThan. */ @@ -1354,7 +1288,7 @@ } /** - * LessThan(>). And NullIgnored, OnceRegistered. + * LessThan(>). And NullIgnored, OnlyOnceRegistered. * * @param updatedTime The value of updatedTime as lessThan. */ @@ -1363,7 +1297,7 @@ } /** - * GreaterEqual(>). And NullIgnored, OnceRegistered. + * GreaterEqual(>). And NullIgnored, OnlyOnceRegistered. * * @param updatedTime The value of updatedTime as greaterEqual. */ @@ -1372,7 +1306,7 @@ } /** - * LessEqual(>). And NullIgnored, OnceRegistered. + * LessEqual(>). And NullIgnored, OnlyOnceRegistered. * * @param updatedTime The value of updatedTime as lessEqual. */ @@ -1382,7 +1316,7 @@ /** * FromTo($fromDate <= COLUMN_NAME <= $toDate). And NullIgnored, - * OnceRegistered. {NotNull : TIMESTAMP} + * OnlyOnceRegistered. {NotNull : TIMESTAMP} * * @param fromDate The from-date of updatedTime. (Nullable) * @param toDate The to-date of updatedTime. (Nullable) @@ -1400,7 +1334,7 @@ /** * FromTo($fromDate <= COLUMN_NAME < $toDate + 1). And NullIgnored, - * OnceRegistered. {NotNull : TIMESTAMP} + * OnlyOnceRegistered. {NotNull : TIMESTAMP} * * @param fromDate The from-date of updatedTime. (Nullable) * @param toDate The to-date of updatedTime. (Nullable) @@ -1426,7 +1360,7 @@ abstract protected ConditionValue getCValueUpdatedTime(); /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {NotNull : + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {NotNull : * VARCHAR(255)} * * @param updatedBy The value of updatedBy as equal. @@ -1436,7 +1370,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param updatedBy The value of updatedBy as notEqual. */ @@ -1445,7 +1379,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param updatedBy The value of updatedBy as greaterThan. */ @@ -1454,7 +1388,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param updatedBy The value of updatedBy as lessThan. */ @@ -1463,7 +1397,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param updatedBy The value of updatedBy as greaterEqual. */ @@ -1472,7 +1406,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param updatedBy The value of updatedBy as lessEqual. */ @@ -1481,7 +1415,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param updatedBy The value of updatedBy as prefixSearch. */ @@ -1490,20 +1424,6 @@ } /** - * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, - * SeveralRegistered. - * - * @param updatedBy The value of updatedBy as likeSearch. - * @param likeSearchOption The option of like-search. (NotNull) - */ - public void setUpdatedBy_LikeSearch( - String updatedBy, - jp.sf.pal.todolist.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { - registerLikeSearchQuery(CK_LS, fRES(updatedBy), getCValueUpdatedBy(), - "UPDATED_BY", "UpdatedBy", "updatedBy", likeSearchOption); - } - - /** * InScope(in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * @@ -1514,27 +1434,41 @@ } /** - * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * - * @param updatedBy The collection of updatedBy as inScope. - * @param inScopeOption The option of in-scope. (NotNull) + * @param updatedByList The collection of updatedBy as notInScope. */ - public void setUpdatedBy_InScope( + public void setUpdatedBy_NotInScope(Collection updatedByList) { + regUpdatedBy(CK_NINS, cTL(updatedByList)); + } + + /** + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param updatedBy The value of updatedBy as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) + */ + public void setUpdatedBy_LikeSearch( String updatedBy, - jp.sf.pal.todolist.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(updatedBy), getCValueUpdatedBy(), - "UPDATED_BY", "UpdatedBy", "updatedBy", inScopeOption); + jp.sf.pal.todolist.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(updatedBy), getCValueUpdatedBy(), "UPDATED_BY", + "UpdatedBy", "updatedBy", likeSearchOption); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param updatedByList The collection of updatedBy as notInScope. + * @param updatedBy The value of updatedBy as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setUpdatedBy_NotInScope(Collection updatedByList) { - regUpdatedBy(CK_NINS, cTL(updatedByList)); + public void setUpdatedBy_NotLikeSearch( + String updatedBy, + jp.sf.pal.todolist.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(updatedBy), getCValueUpdatedBy(), "UPDATED_BY", + "UpdatedBy", "updatedBy", likeSearchOption); } protected void regUpdatedBy(ConditionKey key, Object value) { @@ -1550,7 +1484,7 @@ abstract protected ConditionValue getCValueUpdatedBy(); /** - * Equal(=). And NullIgnored, OnceRegistered. {TIMESTAMP} + * Equal(=). And NullIgnored, OnlyOnceRegistered. {TIMESTAMP} * * @param deletedTime The value of deletedTime as equal. */ @@ -1559,7 +1493,7 @@ } /** - * NotEqual(!=). And NullIgnored, OnceRegistered. + * NotEqual(!=). And NullIgnored, OnlyOnceRegistered. * * @param deletedTime The value of deletedTime as notEqual. */ @@ -1568,7 +1502,7 @@ } /** - * GreaterThan(>). And NullIgnored, OnceRegistered. + * GreaterThan(>). And NullIgnored, OnlyOnceRegistered. * * @param deletedTime The value of deletedTime as greaterThan. */ @@ -1577,7 +1511,7 @@ } /** - * LessThan(>). And NullIgnored, OnceRegistered. + * LessThan(>). And NullIgnored, OnlyOnceRegistered. * * @param deletedTime The value of deletedTime as lessThan. */ @@ -1586,7 +1520,7 @@ } /** - * GreaterEqual(>). And NullIgnored, OnceRegistered. + * GreaterEqual(>). And NullIgnored, OnlyOnceRegistered. * * @param deletedTime The value of deletedTime as greaterEqual. */ @@ -1595,7 +1529,7 @@ } /** - * LessEqual(>). And NullIgnored, OnceRegistered. + * LessEqual(>). And NullIgnored, OnlyOnceRegistered. * * @param deletedTime The value of deletedTime as lessEqual. */ @@ -1605,7 +1539,7 @@ /** * FromTo($fromDate <= COLUMN_NAME <= $toDate). And NullIgnored, - * OnceRegistered. {TIMESTAMP} + * OnlyOnceRegistered. {TIMESTAMP} * * @param fromDate The from-date of deletedTime. (Nullable) * @param toDate The to-date of deletedTime. (Nullable) @@ -1623,7 +1557,7 @@ /** * FromTo($fromDate <= COLUMN_NAME < $toDate + 1). And NullIgnored, - * OnceRegistered. {TIMESTAMP} + * OnlyOnceRegistered. {TIMESTAMP} * * @param fromDate The from-date of deletedTime. (Nullable) * @param toDate The to-date of deletedTime. (Nullable) @@ -1637,14 +1571,14 @@ } /** - * IsNull(is null). And OnceRegistered. + * IsNull(is null). And OnlyOnceRegistered. */ public void setDeletedTime_IsNull() { regDeletedTime(CK_ISN, DUMMY_OBJECT); } /** - * IsNotNull(is not null). And OnceRegistered. + * IsNotNull(is not null). And OnlyOnceRegistered. */ public void setDeletedTime_IsNotNull() { regDeletedTime(CK_ISNN, DUMMY_OBJECT); @@ -1663,7 +1597,7 @@ abstract protected ConditionValue getCValueDeletedTime(); /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {VARCHAR(255)} + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {VARCHAR(255)} * * @param deletedBy The value of deletedBy as equal. */ @@ -1672,7 +1606,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param deletedBy The value of deletedBy as notEqual. */ @@ -1681,7 +1615,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param deletedBy The value of deletedBy as greaterThan. */ @@ -1690,7 +1624,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param deletedBy The value of deletedBy as lessThan. */ @@ -1699,7 +1633,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param deletedBy The value of deletedBy as greaterEqual. */ @@ -1708,7 +1642,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param deletedBy The value of deletedBy as lessEqual. */ @@ -1717,7 +1651,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param deletedBy The value of deletedBy as prefixSearch. */ @@ -1726,20 +1660,6 @@ } /** - * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, - * SeveralRegistered. - * - * @param deletedBy The value of deletedBy as likeSearch. - * @param likeSearchOption The option of like-search. (NotNull) - */ - public void setDeletedBy_LikeSearch( - String deletedBy, - jp.sf.pal.todolist.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { - registerLikeSearchQuery(CK_LS, fRES(deletedBy), getCValueDeletedBy(), - "DELETED_BY", "DeletedBy", "deletedBy", likeSearchOption); - } - - /** * InScope(in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * @@ -1750,38 +1670,52 @@ } /** - * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * - * @param deletedBy The collection of deletedBy as inScope. - * @param inScopeOption The option of in-scope. (NotNull) + * @param deletedByList The collection of deletedBy as notInScope. */ - public void setDeletedBy_InScope( + public void setDeletedBy_NotInScope(Collection deletedByList) { + regDeletedBy(CK_NINS, cTL(deletedByList)); + } + + /** + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param deletedBy The value of deletedBy as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) + */ + public void setDeletedBy_LikeSearch( String deletedBy, - jp.sf.pal.todolist.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(deletedBy), getCValueDeletedBy(), - "DELETED_BY", "DeletedBy", "deletedBy", inScopeOption); + jp.sf.pal.todolist.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(deletedBy), getCValueDeletedBy(), "DELETED_BY", + "DeletedBy", "deletedBy", likeSearchOption); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param deletedByList The collection of deletedBy as notInScope. + * @param deletedBy The value of deletedBy as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setDeletedBy_NotInScope(Collection deletedByList) { - regDeletedBy(CK_NINS, cTL(deletedByList)); + public void setDeletedBy_NotLikeSearch( + String deletedBy, + jp.sf.pal.todolist.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(deletedBy), getCValueDeletedBy(), "DELETED_BY", + "DeletedBy", "deletedBy", likeSearchOption); } /** - * IsNull(is null). And OnceRegistered. + * IsNull(is null). And OnlyOnceRegistered. */ public void setDeletedBy_IsNull() { regDeletedBy(CK_ISN, DUMMY_OBJECT); } /** - * IsNotNull(is not null). And OnceRegistered. + * IsNotNull(is not null). And OnlyOnceRegistered. */ public void setDeletedBy_IsNotNull() { regDeletedBy(CK_ISNN, DUMMY_OBJECT); @@ -1800,7 +1734,7 @@ abstract protected ConditionValue getCValueDeletedBy(); /** - * Equal(=). And NullIgnored, OnceRegistered. {NotNull : INTEGER} + * Equal(=). And NullIgnored, OnlyOnceRegistered. {NotNull : INTEGER} * * @param versionno The value of versionno as equal. */ @@ -1809,7 +1743,7 @@ } /** - * NotEqual(!=). And NullIgnored, OnceRegistered. + * NotEqual(!=). And NullIgnored, OnlyOnceRegistered. * * @param versionno The value of versionno as notEqual. */ @@ -1818,7 +1752,7 @@ } /** - * GreaterThan(>). And NullIgnored, OnceRegistered. + * GreaterThan(>). And NullIgnored, OnlyOnceRegistered. * * @param versionno The value of versionno as greaterThan. */ @@ -1827,7 +1761,7 @@ } /** - * LessThan(<). And NullIgnored, OnceRegistered. + * LessThan(<). And NullIgnored, OnlyOnceRegistered. * * @param versionno The value of versionno as lessThan. */ @@ -1836,7 +1770,7 @@ } /** - * GreaterEqual(>=). And NullIgnored, OnceRegistered. + * GreaterEqual(>=). And NullIgnored, OnlyOnceRegistered. * * @param versionno The value of versionno as greaterEqual. */ @@ -1845,7 +1779,7 @@ } /** - * LessEqual(<=). And NullIgnored, OnceRegistered. + * LessEqual(<=). And NullIgnored, OnlyOnceRegistered. * * @param versionno The value of versionno as lessEqual. */ @@ -1885,6 +1819,50 @@ abstract protected ConditionValue getCValueVersionno(); + public SSQFunction scalar_Equal() { + return xcreateSSQFunction("="); + } + + public SSQFunction scalar_GreaterEqual() { + return xcreateSSQFunction(">="); + } + + public SSQFunction scalar_GreaterThan() { + return xcreateSSQFunction(">"); + } + + public SSQFunction scalar_LessEqual() { + return xcreateSSQFunction("<="); + } + + public SSQFunction scalar_LessThan() { + return xcreateSSQFunction("<"); + } + + protected SSQFunction xcreateSSQFunction(final String operand) { + return new SSQFunction(new SSQSetupper() { + public void setup(String function, SubQuery subQuery) { + xscalarSubQuery(function, subQuery, operand); + } + }); + } + + protected void xscalarSubQuery(String function, + SubQuery subQuery, String operand) { + assertObjectNotNull("subQuery", subQuery); + GroupInfoCB cb = new GroupInfoCB(); + cb.xsetupForScalarSubQuery(); + subQuery.query(cb); + String subQueryPropertyName = keepScalarSubQuery(cb.query()); // for + // saving + // query + // -value. + registerScalarSubQuery(function, cb.query(), subQueryPropertyName, + operand); + } + + public abstract String keepScalarSubQuery(GroupInfoCQ subQuery); + // Very Internal (for Suppressing Warn about 'Not Use Import') protected String getConditionBeanClassNameInternally() { return GroupInfoCB.class.getName(); Modified: todolist/trunk/src/main/java/jp/sf/pal/todolist/db/cbean/cq/bs/AbstractBsGroupMappingCQ.java =================================================================== --- todolist/trunk/src/main/java/jp/sf/pal/todolist/db/cbean/cq/bs/AbstractBsGroupMappingCQ.java 2008-12-27 22:20:45 UTC (rev 1632) +++ todolist/trunk/src/main/java/jp/sf/pal/todolist/db/cbean/cq/bs/AbstractBsGroupMappingCQ.java 2008-12-27 22:21:53 UTC (rev 1633) @@ -11,16 +11,13 @@ import jp.sf.pal.todolist.db.cbean.GroupInfoCB; import jp.sf.pal.todolist.db.cbean.GroupMappingCB; import jp.sf.pal.todolist.db.cbean.UserInfoCB; -import jp.sf.pal.todolist.db.cbean.cq.GroupInfoCQ; import jp.sf.pal.todolist.db.cbean.cq.GroupMappingCQ; -import jp.sf.pal.todolist.db.cbean.cq.UserInfoCQ; /** * The abstract condition-query of GROUP_MAPPING. * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public abstract class AbstractBsGroupMappingCQ extends AbstractConditionQuery { //========================================================================== @@ -50,7 +47,8 @@ // ===== /** - * Equal(=). And NullIgnored, OnceRegistered. {PK : ID : NotNull : INTEGER} + * Equal(=). And NullIgnored, OnlyOnceRegistered. {PK : ID : NotNull : + * INTEGER} * * @param id The value of id as equal. */ @@ -59,7 +57,7 @@ } /** - * NotEqual(!=). And NullIgnored, OnceRegistered. + * NotEqual(!=). And NullIgnored, OnlyOnceRegistered. * * @param id The value of id as notEqual. */ @@ -68,7 +66,7 @@ } /** - * GreaterThan(>). And NullIgnored, OnceRegistered. + * GreaterThan(>). And NullIgnored, OnlyOnceRegistered. * * @param id The value of id as greaterThan. */ @@ -77,7 +75,7 @@ } /** - * LessThan(<). And NullIgnored, OnceRegistered. + * LessThan(<). And NullIgnored, OnlyOnceRegistered. * * @param id The value of id as lessThan. */ @@ -86,7 +84,7 @@ } /** - * GreaterEqual(>=). And NullIgnored, OnceRegistered. + * GreaterEqual(>=). And NullIgnored, OnlyOnceRegistered. * * @param id The value of id as greaterEqual. */ @@ -95,7 +93,7 @@ } /** - * LessEqual(<=). And NullIgnored, OnceRegistered. + * LessEqual(<=). And NullIgnored, OnlyOnceRegistered. * * @param id The value of id as lessEqual. */ @@ -124,14 +122,14 @@ } /** - * IsNull(is null). And OnceRegistered. + * IsNull(is null). And OnlyOnceRegistered. */ public void setId_IsNull() { regId(CK_ISN, DUMMY_OBJECT); } /** - * IsNotNull(is not null). And OnceRegistered. + * IsNotNull(is not null). And OnlyOnceRegistered. */ public void setId_IsNotNull() { regId(CK_ISNN, DUMMY_OBJECT); @@ -148,8 +146,8 @@ abstract protected ConditionValue getCValueId(); /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {NotNull : VARCHAR(255) - * : FK to USER_INFO} + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {NotNull : + * VARCHAR(255) : FK to USER_INFO} * * @param userId The value of userId as equal. */ @@ -158,7 +156,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param userId The value of userId as notEqual. */ @@ -167,7 +165,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param userId The value of userId as greaterThan. */ @@ -176,7 +174,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param userId The value of userId as lessThan. */ @@ -185,7 +183,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param userId The value of userId as greaterEqual. */ @@ -194,7 +192,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param userId The value of userId as lessEqual. */ @@ -203,7 +201,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param userId The value of userId as prefixSearch. */ @@ -212,20 +210,6 @@ } /** - * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, - * SeveralRegistered. - * - * @param userId The value of userId as likeSearch. - * @param likeSearchOption The option of like-search. (NotNull) - */ - public void setUserId_LikeSearch( - String userId, - jp.sf.pal.todolist.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { - registerLikeSearchQuery(CK_LS, fRES(userId), getCValueUserId(), - "USER_ID", "UserId", "userId", likeSearchOption); - } - - /** * InScope(in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * @@ -236,42 +220,41 @@ } /** - * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * - * @param userId The collection of userId as inScope. - * @param inScopeOption The option of in-scope. (NotNull) + * @param userIdList The collection of userId as notInScope. */ - public void setUserId_InScope( - String userId, - jp.sf.pal.todolist.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(userId), getCValueUserId(), - "USER_ID", "UserId", "userId", inScopeOption); + public void setUserId_NotInScope(Collection userIdList) { + regUserId(CK_NINS, cTL(userIdList)); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param userIdList The collection of userId as notInScope. + * @param userId The value of userId as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) */ - public void setUserId_NotInScope(Collection userIdList) { - regUserId(CK_NINS, cTL(userIdList)); + public void setUserId_LikeSearch( + String userId, + jp.sf.pal.todolist.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(userId), getCValueUserId(), "USER_ID", "UserId", + "userId", likeSearchOption); } /** - * @param userInfoCBquery Query. - * @deprecated Please use inScopeUserInfo(subQuery) method. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param userId The value of userId as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setUserId_InScopeSubQuery_UserInfo(UserInfoCQ userInfoCBquery) { - String subQueryPropertyName = keepUserId_InScopeSubQuery_UserInfo(userInfoCBquery);// for - // saving - // query - // - - // value - // . - registerInScopeSubQuery(userInfoCBquery, "USER_ID", "USER_ID", - subQueryPropertyName); + public void setUserId_NotLikeSearch( + String userId, + jp.sf.pal.todolist.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(userId), getCValueUserId(), "USER_ID", "UserId", + "userId", likeSearchOption); } public void inScopeUserInfo(SubQuery subQuery) { @@ -280,12 +263,12 @@ cb.xsetupForInScopeSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepUserId_InScopeSubQuery_UserInfo(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerInScopeSubQuery(cb.query(), "USER_ID", "USER_ID", subQueryPropertyName); } - abstract public String keepUserId_InScopeSubQuery_UserInfo( + public abstract String keepUserId_InScopeSubQuery_UserInfo( jp.sf.pal.todolist.db.cbean.cq.UserInfoCQ subQuery); protected void regUserId(ConditionKey key, Object value) { @@ -301,8 +284,8 @@ abstract protected ConditionValue getCValueUserId(); /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {NotNull : VARCHAR(255) - * : FK to GROUP_INFO} + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {NotNull : + * VARCHAR(255) : FK to GROUP_INFO} * * @param groupId The value of groupId as equal. */ @@ -311,7 +294,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param groupId The value of groupId as notEqual. */ @@ -320,7 +303,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param groupId The value of groupId as greaterThan. */ @@ -329,7 +312,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param groupId The value of groupId as lessThan. */ @@ -338,7 +321,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param groupId The value of groupId as greaterEqual. */ @@ -347,7 +330,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param groupId The value of groupId as lessEqual. */ @@ -356,7 +339,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param groupId The value of groupId as prefixSearch. */ @@ -365,20 +348,6 @@ } /** - * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, - * SeveralRegistered. - * - * @param groupId The value of groupId as likeSearch. - * @param likeSearchOption The option of like-search. (NotNull) - */ - public void setGroupId_LikeSearch( - String groupId, - jp.sf.pal.todolist.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { - registerLikeSearchQuery(CK_LS, fRES(groupId), getCValueGroupId(), - "GROUP_ID", "GroupId", "groupId", likeSearchOption); - } - - /** * InScope(in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * @@ -389,43 +358,41 @@ } /** - * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * - * @param groupId The collection of groupId as inScope. - * @param inScopeOption The option of in-scope. (NotNull) + * @param groupIdList The collection of groupId as notInScope. */ - public void setGroupId_InScope( - String groupId, - jp.sf.pal.todolist.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(groupId), getCValueGroupId(), - "GROUP_ID", "GroupId", "groupId", inScopeOption); + public void setGroupId_NotInScope(Collection groupIdList) { + regGroupId(CK_NINS, cTL(groupIdList)); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param groupIdList The collection of groupId as notInScope. + * @param groupId The value of groupId as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) */ - public void setGroupId_NotInScope(Collection groupIdList) { - regGroupId(CK_NINS, cTL(groupIdList)); + public void setGroupId_LikeSearch( + String groupId, + jp.sf.pal.todolist.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(groupId), getCValueGroupId(), "GROUP_ID", "GroupId", + "groupId", likeSearchOption); } /** - * @param groupInfoCBquery Query. - * @deprecated Please use inScopeGroupInfo(subQuery) method. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param groupId The value of groupId as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setGroupId_InScopeSubQuery_GroupInfo( - GroupInfoCQ groupInfoCBquery) { - String subQueryPropertyName = keepGroupId_InScopeSubQuery_GroupInfo(groupInfoCBquery);// for - // saving - // query - // - - // value - // . - registerInScopeSubQuery(groupInfoCBquery, "GROUP_ID", "GROUP_ID", - subQueryPropertyName); + public void setGroupId_NotLikeSearch( + String groupId, + jp.sf.pal.todolist.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(groupId), getCValueGroupId(), "GROUP_ID", + "GroupId", "groupId", likeSearchOption); } public void inScopeGroupInfo(SubQuery subQuery) { @@ -434,12 +401,12 @@ cb.xsetupForInScopeSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepGroupId_InScopeSubQuery_GroupInfo(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerInScopeSubQuery(cb.query(), "GROUP_ID", "GROUP_ID", subQueryPropertyName); } - abstract public String keepGroupId_InScopeSubQuery_GroupInfo( + public abstract String keepGroupId_InScopeSubQuery_GroupInfo( jp.sf.pal.todolist.db.cbean.cq.GroupInfoCQ subQuery); protected void regGroupId(ConditionKey key, Object value) { @@ -454,6 +421,53 @@ abstract protected ConditionValue getCValueGroupId(); + public SSQFunction scalar_Equal() { + return xcreateSSQFunction("="); + } + + public SSQFunction scalar_GreaterEqual() { + return xcreateSSQFunction(">="); + } + + public SSQFunction scalar_GreaterThan() { + return xcreateSSQFunction(">"); + } + + public SSQFunction scalar_LessEqual() { + return xcreateSSQFunction("<="); + } + + public SSQFunction scalar_LessThan() { + return xcreateSSQFunction("<"); + } + + protected SSQFunction xcreateSSQFunction( + final String operand) { + return new SSQFunction( + new SSQSetupper() { + public void setup(String function, + SubQuery subQuery) { + xscalarSubQuery(function, subQuery, operand); + } + }); + } + + protected void xscalarSubQuery(String function, + SubQuery subQuery, String operand) { + assertObjectNotNull("subQuery", subQuery); + GroupMappingCB cb = new GroupMappingCB(); + cb.xsetupForScalarSubQuery(); + subQuery.query(cb); + String subQueryPropertyName = keepScalarSubQuery(cb.query()); // for + // saving + // query + // -value. + registerScalarSubQuery(function, cb.query(), subQueryPropertyName, + operand); + } + + public abstract String keepScalarSubQuery(GroupMappingCQ subQuery); + // Very Internal (for Suppressing Warn about 'Not Use Import') protected String getConditionBeanClassNameInternally() { return GroupMappingCB.class.getName(); Modified: todolist/trunk/src/main/java/jp/sf/pal/todolist/db/cbean/cq/bs/AbstractBsRoleInfoCQ.java =================================================================== --- todolist/trunk/src/main/java/jp/sf/pal/todolist/db/cbean/cq/bs/AbstractBsRoleInfoCQ.java 2008-12-27 22:20:45 UTC (rev 1632) +++ todolist/trunk/src/main/java/jp/sf/pal/todolist/db/cbean/cq/bs/AbstractBsRoleInfoCQ.java 2008-12-27 22:21:53 UTC (rev 1633) @@ -20,7 +20,6 @@ * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public abstract class AbstractBsRoleInfoCQ extends AbstractConditionQuery { //========================================================================== @@ -50,7 +49,7 @@ // ===== /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {PK : NotNull : + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {PK : NotNull : * VARCHAR(255)} * * @param roleId The value of roleId as equal. @@ -60,7 +59,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param roleId The value of roleId as notEqual. */ @@ -69,7 +68,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param roleId The value of roleId as greaterThan. */ @@ -78,7 +77,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param roleId The value of roleId as lessThan. */ @@ -87,7 +86,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param roleId The value of roleId as greaterEqual. */ @@ -96,7 +95,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param roleId The value of roleId as lessEqual. */ @@ -105,7 +104,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param roleId The value of roleId as prefixSearch. */ @@ -114,20 +113,6 @@ } /** - * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, - * SeveralRegistered. - * - * @param roleId The value of roleId as likeSearch. - * @param likeSearchOption The option of like-search. (NotNull) - */ - public void setRoleId_LikeSearch( - String roleId, - jp.sf.pal.todolist.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { - registerLikeSearchQuery(CK_LS, fRES(roleId), getCValueRoleId(), - "ROLE_ID", "RoleId", "roleId", likeSearchOption); - } - - /** * InScope(in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * @@ -138,43 +123,41 @@ } /** - * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * - * @param roleId The collection of roleId as inScope. - * @param inScopeOption The option of in-scope. (NotNull) + * @param roleIdList The collection of roleId as notInScope. */ - public void setRoleId_InScope( - String roleId, - jp.sf.pal.todolist.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(roleId), getCValueRoleId(), - "ROLE_ID", "RoleId", "roleId", inScopeOption); + public void setRoleId_NotInScope(Collection roleIdList) { + regRoleId(CK_NINS, cTL(roleIdList)); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param roleIdList The collection of roleId as notInScope. + * @param roleId The value of roleId as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) */ - public void setRoleId_NotInScope(Collection roleIdList) { - regRoleId(CK_NINS, cTL(roleIdList)); + public void setRoleId_LikeSearch( + String roleId, + jp.sf.pal.todolist.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(roleId), getCValueRoleId(), "ROLE_ID", "RoleId", + "roleId", likeSearchOption); } /** - * @param roleMappingCBquery Query. - * @deprecated Please use inScopeRoleMappingList(subQuery) method. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param roleId The value of roleId as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setRoleId_InScopeSubQuery_RoleMappingList( - RoleMappingCQ roleMappingCBquery) { - String subQueryPropertyName = keepRoleId_InScopeSubQuery_RoleMappingList(roleMappingCBquery);// for - // saving - // query - // - - // value - // . - registerInScopeSubQuery(roleMappingCBquery, "ROLE_ID", "ROLE_ID", - subQueryPropertyName); + public void setRoleId_NotLikeSearch( + String roleId, + jp.sf.pal.todolist.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(roleId), getCValueRoleId(), "ROLE_ID", "RoleId", + "roleId", likeSearchOption); } public void inScopeRoleMappingList(SubQuery subQuery) { @@ -183,42 +166,26 @@ cb.xsetupForInScopeSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepRoleId_InScopeSubQuery_RoleMappingList(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerInScopeSubQuery(cb.query(), "ROLE_ID", "ROLE_ID", subQueryPropertyName); } - abstract public String keepRoleId_InScopeSubQuery_RoleMappingList( + public abstract String keepRoleId_InScopeSubQuery_RoleMappingList( RoleMappingCQ subQuery); - /** - * @param userInfoCBquery Query. - * @deprecated Please use inScopeUserInfoList(subQuery) method. - */ - public void setRoleId_InScopeSubQuery_UserInfoList( - UserInfoCQ userInfoCBquery) { - String subQueryPropertyName = keepRoleId_InScopeSubQuery_UserInfoList(userInfoCBquery);// for - // saving - // query - // - - // value - // . - registerInScopeSubQuery(userInfoCBquery, "ROLE_ID", "ROLE_ID", - subQueryPropertyName); - } - public void inScopeUserInfoList(SubQuery subQuery) { assertObjectNotNull("subQuery", subQuery); UserInfoCB cb = new UserInfoCB(); cb.xsetupForInScopeSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepRoleId_InScopeSubQuery_UserInfoList(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerInScopeSubQuery(cb.query(), "ROLE_ID", "ROLE_ID", subQueryPropertyName); } - abstract public String keepRoleId_InScopeSubQuery_UserInfoList( + public abstract String keepRoleId_InScopeSubQuery_UserInfoList( UserInfoCQ subQuery); public void notInScopeRoleMappingList(SubQuery subQuery) { @@ -227,12 +194,12 @@ cb.xsetupForInScopeSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepRoleId_NotInScopeSubQuery_RoleMappingList(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerNotInScopeSubQuery(cb.query(), "ROLE_ID", "ROLE_ID", subQueryPropertyName); } - abstract public String keepRoleId_NotInScopeSubQuery_RoleMappingList( + public abstract String keepRoleId_NotInScopeSubQuery_RoleMappingList( RoleMappingCQ subQuery); public void notInScopeUserInfoList(SubQuery subQuery) { @@ -241,31 +208,15 @@ cb.xsetupForInScopeSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepRoleId_NotInScopeSubQuery_UserInfoList(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerNotInScopeSubQuery(cb.query(), "ROLE_ID", "ROLE_ID", subQueryPropertyName); } - abstract public String keepRoleId_NotInScopeSubQuery_UserInfoList( + public abstract String keepRoleId_NotInScopeSubQuery_UserInfoList( UserInfoCQ subQuery); /** - * @param roleMappingCBquery Query. - * @deprecated Please use existsRoleMappingList(subQuery) method. - */ - public void setRoleId_ExistsSubQuery_RoleMappingList( - RoleMappingCQ roleMappingCBquery) { - String subQueryPropertyName = keepRoleId_ExistsSubQuery_RoleMappingList(roleMappingCBquery);// for - // saving - // query - // - - // value - // . - registerExistsSubQuery(roleMappingCBquery, "ROLE_ID", "ROLE_ID", - subQueryPropertyName); - } - - /** * Set up 'exists' sub-query. {exists (select ROLE_ID from ROLE_MAPPING * where ...)} * @@ -278,30 +229,15 @@ cb.xsetupForExistsSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepRoleId_ExistsSubQuery_RoleMappingList(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerExistsSubQuery(cb.query(), "ROLE_ID", "ROLE_ID", subQueryPropertyName); } - abstract public String keepRoleId_ExistsSubQuery_RoleMappingList( + public abstract String keepRoleId_ExistsSubQuery_RoleMappingList( RoleMappingCQ subQuery); /** - * @param userInfoCBquery Query. - * @deprecated Please use existsUserInfoList(subQuery) method. - */ - public void setRoleId_ExistsSubQuery_UserInfoList(UserInfoCQ userInfoCBquery) { - String subQueryPropertyName = keepRoleId_ExistsSubQuery_UserInfoList(userInfoCBquery);// for - // saving - // query - // - - // value - // . - registerExistsSubQuery(userInfoCBquery, "ROLE_ID", "ROLE_ID", - subQueryPropertyName); - } - - /** * Set up 'exists' sub-query. {exists (select ROLE_ID from USER_INFO where * ...)} * @@ -314,12 +250,12 @@ cb.xsetupForExistsSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepRoleId_ExistsSubQuery_UserInfoList(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerExistsSubQuery(cb.query(), "ROLE_ID", "ROLE_ID", subQueryPropertyName); } - abstract public String keepRoleId_ExistsSubQuery_UserInfoList( + public abstract String keepRoleId_ExistsSubQuery_UserInfoList( UserInfoCQ subQuery); /** @@ -335,12 +271,12 @@ cb.xsetupForExistsSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepRoleId_NotExistsSubQuery_RoleMappingList(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerNotExistsSubQuery(cb.query(), "ROLE_ID", "ROLE_ID", subQueryPropertyName); } - abstract public String keepRoleId_NotExistsSubQuery_RoleMappingList( + public abstract String keepRoleId_NotExistsSubQuery_RoleMappingList( RoleMappingCQ subQuery); /** @@ -356,53 +292,53 @@ cb.xsetupForExistsSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepRoleId_NotExistsSubQuery_UserInfoList(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerNotExistsSubQuery(cb.query(), "ROLE_ID", "ROLE_ID", subQueryPropertyName); } - abstract public String keepRoleId_NotExistsSubQuery_UserInfoList( + public abstract String keepRoleId_NotExistsSubQuery_UserInfoList( UserInfoCQ subQuery); public void xderiveRoleMappingList(String function, SubQuery subQuery, String aliasName) { assertObjectNotNull("subQuery", subQuery); RoleMappingCB cb = new RoleMappingCB(); - cb.xsetupForDeriveReferrer(); + cb.xsetupForDerivedReferrer(); subQuery.query(cb); - String subQueryPropertyName = keepRoleId_DeriveSubQuery_RoleMappingList(cb - .query());// for saving query-value. - registerDeriveSubQuery(function, cb.query(), "ROLE_ID", "ROLE_ID", - subQueryPropertyName, aliasName); + String subQueryPropertyName = keepRoleId_DerivedReferrer_RoleMappingList(cb + .query()); // for saving query-value. + registerDerivedReferrerSubQuery(function, cb.query(), "ROLE_ID", + "ROLE_ID", subQueryPropertyName, aliasName); } - abstract public String keepRoleId_DeriveSubQuery_RoleMappingList( + public abstract String keepRoleId_DerivedReferrer_RoleMappingList( RoleMappingCQ subQuery); public void xderiveUserInfoList(String function, SubQuery subQuery, String aliasName) { assertObjectNotNull("subQuery", subQuery); UserInfoCB cb = new UserInfoCB(); - cb.xsetupForDeriveReferrer(); + cb.xsetupForDerivedReferrer(); subQuery.query(cb); - String subQueryPropertyName = keepRoleId_DeriveSubQuery_UserInfoList(cb - .query());// for saving query-value. - registerDeriveSubQuery(function, cb.query(), "ROLE_ID", "ROLE_ID", - subQueryPropertyName, aliasName); + String subQueryPropertyName = keepRoleId_DerivedReferrer_UserInfoList(cb + .query()); // for saving query-value. + registerDerivedReferrerSubQuery(function, cb.query(), "ROLE_ID", + "ROLE_ID", subQueryPropertyName, aliasName); } - abstract public String keepRoleId_DeriveSubQuery_UserInfoList( + public abstract String keepRoleId_DerivedReferrer_UserInfoList( UserInfoCQ subQuery); /** - * IsNull(is null). And OnceRegistered. + * IsNull(is null). And OnlyOnceRegistered. */ public void setRoleId_IsNull() { regRoleId(CK_ISN, DUMMY_OBJECT); } /** - * IsNotNull(is not null). And OnceRegistered. + * IsNotNull(is not null). And OnlyOnceRegistered. */ public void setRoleId_IsNotNull() { regRoleId(CK_ISNN, DUMMY_OBJECT); @@ -421,7 +357,7 @@ abstract protected ConditionValue getCValueRoleId(); /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {VARCHAR(100)} + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {VARCHAR(100)} * * @param name The value of name as equal. */ @@ -430,7 +366,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param name The value of name as notEqual. */ @@ -439,7 +375,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param name The value of name as greaterThan. */ @@ -448,7 +384,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param name The value of name as lessThan. */ @@ -457,7 +393,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param name The value of name as greaterEqual. */ @@ -466,7 +402,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param name The value of name as lessEqual. */ @@ -475,7 +411,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param name The value of name as prefixSearch. */ @@ -484,20 +420,6 @@ } /** - * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, - * SeveralRegistered. - * - * @param name The value of name as likeSearch. - * @param likeSearchOption The option of like-search. (NotNull) - */ - public void setName_LikeSearch( - String name, - jp.sf.pal.todolist.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { - registerLikeSearchQuery(CK_LS, fRES(name), getCValueName(), "NAME", - "Name", "name", likeSearchOption); - } - - /** * InScope(in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * @@ -508,38 +430,52 @@ } /** - * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * - * @param name The collection of name as inScope. - * @param inScopeOption The option of in-scope. (NotNull) + * @param nameList The collection of name as notInScope. */ - public void setName_InScope( + public void setName_NotInScope(Collection nameList) { + regName(CK_NINS, cTL(nameList)); + } + + /** + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param name The value of name as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) + */ + public void setName_LikeSearch( String name, - jp.sf.pal.todolist.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(name), getCValueName(), "NAME", - "Name", "name", inScopeOption); + jp.sf.pal.todolist.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(name), getCValueName(), "NAME", "Name", "name", + likeSearchOption); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param nameList The collection of name as notInScope. + * @param name The value of name as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setName_NotInScope(Collection nameList) { - regName(CK_NINS, cTL(nameList)); + public void setName_NotLikeSearch( + String name, + jp.sf.pal.todolist.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(name), getCValueName(), "NAME", "Name", "name", + likeSearchOption); } /** - * IsNull(is null). And OnceRegistered. + * IsNull(is null). And OnlyOnceRegistered. */ public void setName_IsNull() { regName(CK_ISN, DUMMY_OBJECT); } /** - * IsNotNull(is not null). And OnceRegistered. + * IsNotNull(is not null). And OnlyOnceRegistered. */ public void setName_IsNotNull() { regName(CK_ISNN, DUMMY_OBJECT); @@ -556,7 +492,7 @@ abstract protected ConditionValue getCValueName(); /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {VARCHAR(255)} + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {VARCHAR(255)} * * @param description The value of description as equal. */ @@ -565,7 +501,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param description The value of description as notEqual. */ @@ -574,7 +510,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param description The value of description as greaterThan. */ @@ -583,7 +519,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param description The value of description as lessThan. */ @@ -592,7 +528,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param description The value of description as greaterEqual. */ @@ -601,7 +537,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param description The value of description as lessEqual. */ @@ -610,7 +546,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param description The value of description as prefixSearch. */ @@ -619,21 +555,6 @@ } /** - * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, - * SeveralRegistered. - * - * @param description The value of description as likeSearch. - * @param likeSearchOption The option of like-search. (NotNull) - */ - public void setDescription_LikeSearch( - String description, - jp.sf.pal.todolist.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { - registerLikeSearchQuery(CK_LS, fRES(description), - getCValueDescription(), "DESCRIPTION", "Description", - "description", likeSearchOption); - } - - /** * InScope(in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * @@ -644,38 +565,52 @@ } /** - * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * - * @param description The collection of description as inScope. - * @param inScopeOption The option of in-scope. (NotNull) + * @param descriptionList The collection of description as notInScope. */ - public void setDescription_InScope( + public void setDescription_NotInScope(Collection descriptionList) { + regDescription(CK_NINS, cTL(descriptionList)); + } + + /** + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param description The value of description as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) + */ + public void setDescription_LikeSearch( String description, - jp.sf.pal.todolist.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(description), getCValueDescription(), - "DESCRIPTION", "Description", "description", inScopeOption); + jp.sf.pal.todolist.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(description), getCValueDescription(), "DESCRIPTION", + "Description", "description", likeSearchOption); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param descriptionList The collection of description as notInScope. + * @param description The value of description as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setDescription_NotInScope(Collection descriptionList) { - regDescription(CK_NINS, cTL(descriptionList)); + public void setDescription_NotLikeSearch( + String description, + jp.sf.pal.todolist.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(description), getCValueDescription(), + "DESCRIPTION", "Description", "description", likeSearchOption); } /** - * IsNull(is null). And OnceRegistered. + * IsNull(is null). And OnlyOnceRegistered. */ public void setDescription_IsNull() { regDescription(CK_ISN, DUMMY_OBJECT); } /** - * IsNotNull(is not null). And OnceRegistered. + * IsNotNull(is not null). And OnlyOnceRegistered. */ public void setDescription_IsNotNull() { regDescription(CK_ISNN, DUMMY_OBJECT); @@ -694,7 +629,7 @@ abstract protected ConditionValue getCValueDescription(); /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {VARCHAR(255)} + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {VARCHAR(255)} * * @param email The value of email as equal. */ @@ -703,7 +638,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param email The value of email as notEqual. */ @@ -712,7 +647,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param email The value of email as greaterThan. */ @@ -721,7 +656,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param email The value of email as lessThan. */ @@ -730,7 +665,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param email The value of email as greaterEqual. */ @@ -739,7 +674,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param email The value of email as lessEqual. */ @@ -748,7 +683,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param email The value of email as prefixSearch. */ @@ -757,20 +692,6 @@ } /** - * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, - * SeveralRegistered. - * - * @param email The value of email as likeSearch. - * @param likeSearchOption The option of like-search. (NotNull) - */ - public void setEmail_LikeSearch( - String email, - jp.sf.pal.todolist.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { - registerLikeSearchQuery(CK_LS, fRES(email), getCValueEmail(), "EMAIL", - "Email", "email", likeSearchOption); - } - - /** * InScope(in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * @@ -781,38 +702,52 @@ } /** - * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * - * @param email The collection of email as inScope. - * @param inScopeOption The option of in-scope. (NotNull) + * @param emailList The collection of email as notInScope. */ - public void setEmail_InScope( + public void setEmail_NotInScope(Collection emailList) { + regEmail(CK_NINS, cTL(emailList)); + } + + /** + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param email The value of email as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) + */ + public void setEmail_LikeSearch( String email, - jp.sf.pal.todolist.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(email), getCValueEmail(), "EMAIL", - "Email", "email", inScopeOption); + jp.sf.pal.todolist.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(email), getCValueEmail(), "EMAIL", "Email", "email", + likeSearchOption); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param emailList The collection of email as notInScope. + * @param email The value of email as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setEmail_NotInScope(Collection emailList) { - regEmail(CK_NINS, cTL(emailList)); + public void setEmail_NotLikeSearch( + String email, + jp.sf.pal.todolist.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(email), getCValueEmail(), "EMAIL", "Email", + "email", likeSearchOption); } /** - * IsNull(is null). And OnceRegistered. + * IsNull(is null). And OnlyOnceRegistered. */ public void setEmail_IsNull() { regEmail(CK_ISN, DUMMY_OBJECT); } /** - * IsNotNull(is not null). And OnceRegistered. + * IsNotNull(is not null). And OnlyOnceRegistered. */ public void setEmail_IsNotNull() { regEmail(CK_ISNN, DUMMY_OBJECT); @@ -830,7 +765,7 @@ abstract protected ConditionValue getCValueEmail(); /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {VARCHAR(255)} + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {VARCHAR(255)} * * @param url The value of url as equal. */ @@ -839,7 +774,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param url The value of url as notEqual. */ @@ -848,7 +783,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param url The value of url as greaterThan. */ @@ -857,7 +792,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param url The value of url as lessThan. */ @@ -866,7 +801,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param url The value of url as greaterEqual. */ @@ -875,7 +810,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param url The value of url as lessEqual. */ @@ -884,7 +819,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param url The value of url as prefixSearch. */ @@ -893,20 +828,6 @@ } /** - * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, - * SeveralRegistered. - * - * @param url The value of url as likeSearch. - * @param likeSearchOption The option of like-search. (NotNull) - */ - public void setUrl_LikeSearch( - String url, - jp.sf.pal.todolist.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { - registerLikeSearchQuery(CK_LS, fRES(url), getCValueUrl(), "URL", "Url", - "url", likeSearchOption); - } - - /** * InScope(in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * @@ -917,38 +838,52 @@ } /** - * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * - * @param url The collection of url as inScope. - * @param inScopeOption The option of in-scope. (NotNull) + * @param urlList The collection of url as notInScope. */ - public void setUrl_InScope( + public void setUrl_NotInScope(Collection urlList) { + regUrl(CK_NINS, cTL(urlList)); + } + + /** + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param url The value of url as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) + */ + public void setUrl_LikeSearch( String url, - jp.sf.pal.todolist.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(url), getCValueUrl(), "URL", "Url", - "url", inScopeOption); + jp.sf.pal.todolist.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(url), getCValueUrl(), "URL", "Url", "url", + likeSearchOption); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param urlList The collection of url as notInScope. + * @param url The value of url as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setUrl_NotInScope(Collection urlList) { - regUrl(CK_NINS, cTL(urlList)); + public void setUrl_NotLikeSearch( + String url, + jp.sf.pal.todolist.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(url), getCValueUrl(), "URL", "Url", "url", + likeSearchOption); } /** - * IsNull(is null). And OnceRegistered. + * IsNull(is null). And OnlyOnceRegistered. */ public void setUrl_IsNull() { regUrl(CK_ISN, DUMMY_OBJECT); } /** - * IsNotNull(is not null). And OnceRegistered. + * IsNotNull(is not null). And OnlyOnceRegistered. */ public void setUrl_IsNotNull() { regUrl(CK_ISNN, DUMMY_OBJECT); @@ -965,7 +900,7 @@ abstract protected ConditionValue getCValueUrl(); /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {VARCHAR(40)} + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {VARCHAR(40)} * * @param telephone The value of telephone as equal. */ @@ -974,7 +909,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param telephone The value of telephone as notEqual. */ @@ -983,7 +918,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param telephone The value of telephone as greaterThan. */ @@ -992,7 +927,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param telephone The value of telephone as lessThan. */ @@ -1001,7 +936,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param telephone The value of telephone as greaterEqual. */ @@ -1010,7 +945,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param telephone The value of telephone as lessEqual. */ @@ -1019,7 +954,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param telephone The value of telephone as prefixSearch. */ @@ -1028,20 +963,6 @@ } /** - * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, - * SeveralRegistered. - * - * @param telephone The value of telephone as likeSearch. - * @param likeSearchOption The option of like-search. (NotNull) - */ - public void setTelephone_LikeSearch( - String telephone, - jp.sf.pal.todolist.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { - registerLikeSearchQuery(CK_LS, fRES(telephone), getCValueTelephone(), - "TELEPHONE", "Telephone", "telephone", likeSearchOption); - } - - /** * InScope(in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * @@ -1052,38 +973,52 @@ } /** - * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * - * @param telephone The collection of telephone as inScope. - * @param inScopeOption The option of in-scope. (NotNull) + * @param telephoneList The collection of telephone as notInScope. */ - public void setTelephone_InScope( + public void setTelephone_NotInScope(Collection telephoneList) { + regTelephone(CK_NINS, cTL(telephoneList)); + } + + /** + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param telephone The value of telephone as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) + */ + public void setTelephone_LikeSearch( String telephone, - jp.sf.pal.todolist.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(telephone), getCValueTelephone(), - "TELEPHONE", "Telephone", "telephone", inScopeOption); + jp.sf.pal.todolist.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(telephone), getCValueTelephone(), "TELEPHONE", + "Telephone", "telephone", likeSearchOption); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param telephoneList The collection of telephone as notInScope. + * @param telephone The value of telephone as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setTelephone_NotInScope(Collection telephoneList) { - regTelephone(CK_NINS, cTL(telephoneList)); + public void setTelephone_NotLikeSearch( + String telephone, + jp.sf.pal.todolist.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(telephone), getCValueTelephone(), "TELEPHONE", + "Telephone", "telephone", likeSearchOption); } /** - * IsNull(is null). And OnceRegistered. + * IsNull(is null). And OnlyOnceRegistered. */ public void setTelephone_IsNull() { regTelephone(CK_ISN, DUMMY_OBJECT); } /** - * IsNotNull(is not null). And OnceRegistered. + * IsNotNull(is not null). And OnlyOnceRegistered. */ public void setTelephone_IsNotNull() { regTelephone(CK_ISNN, DUMMY_OBJECT); @@ -1102,7 +1037,7 @@ abstract protected ConditionValue getCValueTelephone(); /** - * Equal(=). And NullIgnored, OnceRegistered. {NotNull : TIMESTAMP} + * Equal(=). And NullIgnored, OnlyOnceRegistered. {NotNull : TIMESTAMP} * * @param createdTime The value of createdTime as equal. */ @@ -1111,7 +1046,7 @@ } /** - * NotEqual(!=). And NullIgnored, OnceRegistered. + * NotEqual(!=). And NullIgnored, OnlyOnceRegistered. * * @param createdTime The value of createdTime as notEqual. */ @@ -1120,7 +1055,7 @@ } /** - * GreaterThan(>). And NullIgnored, OnceRegistered. + * GreaterThan(>). And NullIgnored, OnlyOnceRegistered. * * @param createdTime The value of createdTime as greaterThan. */ @@ -1129,7 +1064,7 @@ } /** - * LessThan(>). And NullIgnored, OnceRegistered. + * LessThan(>). And NullIgnored, OnlyOnceRegistered. * * @param createdTime The value of createdTime as lessThan. */ @@ -1138,7 +1073,7 @@ } /** - * GreaterEqual(>). And NullIgnored, OnceRegistered. + * GreaterEqual(>). And NullIgnored, OnlyOnceRegistered. * * @param createdTime The value of createdTime as greaterEqual. */ @@ -1147,7 +1082,7 @@ } /** - * LessEqual(>). And NullIgnored, OnceRegistered. + * LessEqual(>). And NullIgnored, OnlyOnceRegistered. * * @param createdTime The value of createdTime as lessEqual. */ @@ -1157,7 +1092,7 @@ /** * FromTo($fromDate <= COLUMN_NAME <= $toDate). And NullIgnored, - * OnceRegistered. {NotNull : TIMESTAMP} + * OnlyOnceRegistered. {NotNull : TIMESTAMP} * * @param fromDate The from-date of createdTime. (Nullable) * @param toDate The to-date of createdTime. (Nullable) @@ -1175,7 +1110,7 @@ /** * FromTo($fromDate <= COLUMN_NAME < $toDate + 1). And NullIgnored, - * OnceRegistered. {NotNull : TIMESTAMP} + * OnlyOnceRegistered. {NotNull : TIMESTAMP} * * @param fromDate The from-date of createdTime. (Nullable) * @param toDate The to-date of createdTime. (Nullable) @@ -1201,7 +1136,7 @@ abstract protected ConditionValue getCValueCreatedTime(); /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {NotNull : + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {NotNull : * VARCHAR(255)} * * @param createdBy The value of createdBy as equal. @@ -1211,7 +1146,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param createdBy The value of createdBy as notEqual. */ @@ -1220,7 +1155,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param createdBy The value of createdBy as greaterThan. */ @@ -1229,7 +1164,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param createdBy The value of createdBy as lessThan. */ @@ -1238,7 +1173,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param createdBy The value of createdBy as greaterEqual. */ @@ -1247,7 +1182,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param createdBy The value of createdBy as lessEqual. */ @@ -1256,7 +1191,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param createdBy The value of createdBy as prefixSearch. */ @@ -1265,20 +1200,6 @@ } /** - * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, - * SeveralRegistered. - * - * @param createdBy The value of createdBy as likeSearch. - * @param likeSearchOption The option of like-search. (NotNull) - */ - public void setCreatedBy_LikeSearch( - String createdBy, - jp.sf.pal.todolist.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { - registerLikeSearchQuery(CK_LS, fRES(createdBy), getCValueCreatedBy(), - "CREATED_BY", "CreatedBy", "createdBy", likeSearchOption); - } - - /** * InScope(in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * @@ -1289,27 +1210,41 @@ } /** - * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * - * @param createdBy The collection of createdBy as inScope. - * @param inScopeOption The option of in-scope. (NotNull) + * @param createdByList The collection of createdBy as notInScope. */ - public void setCreatedBy_InScope( + public void setCreatedBy_NotInScope(Collection createdByList) { + regCreatedBy(CK_NINS, cTL(createdByList)); + } + + /** + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param createdBy The value of createdBy as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) + */ + public void setCreatedBy_LikeSearch( String createdBy, - jp.sf.pal.todolist.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(createdBy), getCValueCreatedBy(), - "CREATED_BY", "CreatedBy", "createdBy", inScopeOption); + jp.sf.pal.todolist.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(createdBy), getCValueCreatedBy(), "CREATED_BY", + "CreatedBy", "createdBy", likeSearchOption); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param createdByList The collection of createdBy as notInScope. + * @param createdBy The value of createdBy as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setCreatedBy_NotInScope(Collection createdByList) { - regCreatedBy(CK_NINS, cTL(createdByList)); + public void setCreatedBy_NotLikeSearch( + String createdBy, + jp.sf.pal.todolist.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(createdBy), getCValueCreatedBy(), "CREATED_BY", + "CreatedBy", "createdBy", likeSearchOption); } protected void regCreatedBy(ConditionKey key, Object value) { @@ -1325,7 +1260,7 @@ abstract protected ConditionValue getCValueCreatedBy(); /** - * Equal(=). And NullIgnored, OnceRegistered. {NotNull : TIMESTAMP} + * Equal(=). And NullIgnored, OnlyOnceRegistered. {NotNull : TIMESTAMP} * * @param updatedTime The value of updatedTime as equal. */ @@ -1334,7 +1269,7 @@ } /** - * NotEqual(!=). And NullIgnored, OnceRegistered. + * NotEqual(!=). And NullIgnored, OnlyOnceRegistered. * * @param updatedTime The value of updatedTime as notEqual. */ @@ -1343,7 +1278,7 @@ } /** - * GreaterThan(>). And NullIgnored, OnceRegistered. + * GreaterThan(>). And NullIgnored, OnlyOnceRegistered. * * @param updatedTime The value of updatedTime as greaterThan. */ @@ -1352,7 +1287,7 @@ } /** - * LessThan(>). And NullIgnored, OnceRegistered. + * LessThan(>). And NullIgnored, OnlyOnceRegistered. * * @param updatedTime The value of updatedTime as lessThan. */ @@ -1361,7 +1296,7 @@ } /** - * GreaterEqual(>). And NullIgnored, OnceRegistered. + * GreaterEqual(>). And NullIgnored, OnlyOnceRegistered. * * @param updatedTime The value of updatedTime as greaterEqual. */ @@ -1370,7 +1305,7 @@ } /** - * LessEqual(>). And NullIgnored, OnceRegistered. + * LessEqual(>). And NullIgnored, OnlyOnceRegistered. * * @param updatedTime The value of updatedTime as lessEqual. */ @@ -1380,7 +1315,7 @@ /** * FromTo($fromDate <= COLUMN_NAME <= $toDate). And NullIgnored, - * OnceRegistered. {NotNull : TIMESTAMP} + * OnlyOnceRegistered. {NotNull : TIMESTAMP} * * @param fromDate The from-date of updatedTime. (Nullable) * @param toDate The to-date of updatedTime. (Nullable) @@ -1398,7 +1333,7 @@ /** * FromTo($fromDate <= COLUMN_NAME < $toDate + 1). And NullIgnored, - * OnceRegistered. {NotNull : TIMESTAMP} + * OnlyOnceRegistered. {NotNull : TIMESTAMP} * * @param fromDate The from-date of updatedTime. (Nullable) * @param toDate The to-date of updatedTime. (Nullable) @@ -1424,7 +1359,7 @@ abstract protected ConditionValue getCValueUpdatedTime(); /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {NotNull : + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {NotNull : * VARCHAR(255)} * * @param updatedBy The value of updatedBy as equal. @@ -1434,7 +1369,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param updatedBy The value of updatedBy as notEqual. */ @@ -1443,7 +1378,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param updatedBy The value of updatedBy as greaterThan. */ @@ -1452,7 +1387,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param updatedBy The value of updatedBy as lessThan. */ @@ -1461,7 +1396,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param updatedBy The value of updatedBy as greaterEqual. */ @@ -1470,7 +1405,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param updatedBy The value of updatedBy as lessEqual. */ @@ -1479,7 +1414,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param updatedBy The value of updatedBy as prefixSearch. */ @@ -1488,20 +1423,6 @@ } /** - * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, - * SeveralRegistered. - * - * @param updatedBy The value of updatedBy as likeSearch. - * @param likeSearchOption The option of like-search. (NotNull) - */ - public void setUpdatedBy_LikeSearch( - String updatedBy, - jp.sf.pal.todolist.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { - registerLikeSearchQuery(CK_LS, fRES(updatedBy), getCValueUpdatedBy(), - "UPDATED_BY", "UpdatedBy", "updatedBy", likeSearchOption); - } - - /** * InScope(in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * @@ -1512,27 +1433,41 @@ } /** - * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * - * @param updatedBy The collection of updatedBy as inScope. - * @param inScopeOption The option of in-scope. (NotNull) + * @param updatedByList The collection of updatedBy as notInScope. */ - public void setUpdatedBy_InScope( + public void setUpdatedBy_NotInScope(Collection updatedByList) { + regUpdatedBy(CK_NINS, cTL(updatedByList)); + } + + /** + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param updatedBy The value of updatedBy as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) + */ + public void setUpdatedBy_LikeSearch( String updatedBy, - jp.sf.pal.todolist.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(updatedBy), getCValueUpdatedBy(), - "UPDATED_BY", "UpdatedBy", "updatedBy", inScopeOption); + jp.sf.pal.todolist.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(updatedBy), getCValueUpdatedBy(), "UPDATED_BY", + "UpdatedBy", "updatedBy", likeSearchOption); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param updatedByList The collection of updatedBy as notInScope. + * @param updatedBy The value of updatedBy as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setUpdatedBy_NotInScope(Collection updatedByList) { - regUpdatedBy(CK_NINS, cTL(updatedByList)); + public void setUpdatedBy_NotLikeSearch( + String updatedBy, + jp.sf.pal.todolist.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(updatedBy), getCValueUpdatedBy(), "UPDATED_BY", + "UpdatedBy", "updatedBy", likeSearchOption); } protected void regUpdatedBy(ConditionKey key, Object value) { @@ -1548,7 +1483,7 @@ abstract protected ConditionValue getCValueUpdatedBy(); /** - * Equal(=). And NullIgnored, OnceRegistered. {TIMESTAMP} + * Equal(=). And NullIgnored, OnlyOnceRegistered. {TIMESTAMP} * * @param deletedTime The value of deletedTime as equal. */ @@ -1557,7 +1492,7 @@ } /** - * NotEqual(!=). And NullIgnored, OnceRegistered. + * NotEqual(!=). And NullIgnored, OnlyOnceRegistered. * * @param deletedTime The value of deletedTime as notEqual. */ @@ -1566,7 +1501,7 @@ } /** - * GreaterThan(>). And NullIgnored, OnceRegistered. + * GreaterThan(>). And NullIgnored, OnlyOnceRegistered. * * @param deletedTime The value of deletedTime as greaterThan. */ @@ -1575,7 +1510,7 @@ } /** - * LessThan(>). And NullIgnored, OnceRegistered. + * LessThan(>). And NullIgnored, OnlyOnceRegistered. * * @param deletedTime The value of deletedTime as lessThan. */ @@ -1584,7 +1519,7 @@ } /** - * GreaterEqual(>). And NullIgnored, OnceRegistered. + * GreaterEqual(>). And NullIgnored, OnlyOnceRegistered. * * @param deletedTime The value of deletedTime as greaterEqual. */ @@ -1593,7 +1528,7 @@ } /** - * LessEqual(>). And NullIgnored, OnceRegistered. + * LessEqual(>). And NullIgnored, OnlyOnceRegistered. * * @param deletedTime The value of deletedTime as lessEqual. */ @@ -1603,7 +1538,7 @@ /** * FromTo($fromDate <= COLUMN_NAME <= $toDate). And NullIgnored, - * OnceRegistered. {TIMESTAMP} + * OnlyOnceRegistered. {TIMESTAMP} * * @param fromDate The from-date of deletedTime. (Nullable) * @param toDate The to-date of deletedTime. (Nullable) @@ -1621,7 +1556,7 @@ /** * FromTo($fromDate <= COLUMN_NAME < $toDate + 1). And NullIgnored, - * OnceRegistered. {TIMESTAMP} + * OnlyOnceRegistered. {TIMESTAMP} * * @param fromDate The from-date of deletedTime. (Nullable) * @param toDate The to-date of deletedTime. (Nullable) @@ -1635,14 +1570,14 @@ } /** - * IsNull(is null). And OnceRegistered. + * IsNull(is null). And OnlyOnceRegistered. */ public void setDeletedTime_IsNull() { regDeletedTime(CK_ISN, DUMMY_OBJECT); } /** - * IsNotNull(is not null). And OnceRegistered. + * IsNotNull(is not null). And OnlyOnceRegistered. */ public void setDeletedTime_IsNotNull() { regDeletedTime(CK_ISNN, DUMMY_OBJECT); @@ -1661,7 +1596,7 @@ abstract protected ConditionValue getCValueDeletedTime(); /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {VARCHAR(255)} + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {VARCHAR(255)} * * @param deletedBy The value of deletedBy as equal. */ @@ -1670,7 +1605,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param deletedBy The value of deletedBy as notEqual. */ @@ -1679,7 +1614,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param deletedBy The value of deletedBy as greaterThan. */ @@ -1688,7 +1623,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param deletedBy The value of deletedBy as lessThan. */ @@ -1697,7 +1632,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param deletedBy The value of deletedBy as greaterEqual. */ @@ -1706,7 +1641,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param deletedBy The value of deletedBy as lessEqual. */ @@ -1715,7 +1650,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param deletedBy The value of deletedBy as prefixSearch. */ @@ -1724,20 +1659,6 @@ } /** - * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, - * SeveralRegistered. - * - * @param deletedBy The value of deletedBy as likeSearch. - * @param likeSearchOption The option of like-search. (NotNull) - */ - public void setDeletedBy_LikeSearch( - String deletedBy, - jp.sf.pal.todolist.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { - registerLikeSearchQuery(CK_LS, fRES(deletedBy), getCValueDeletedBy(), - "DELETED_BY", "DeletedBy", "deletedBy", likeSearchOption); - } - - /** * InScope(in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * @@ -1748,38 +1669,52 @@ } /** - * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * - * @param deletedBy The collection of deletedBy as inScope. - * @param inScopeOption The option of in-scope. (NotNull) + * @param deletedByList The collection of deletedBy as notInScope. */ - public void setDeletedBy_InScope( + public void setDeletedBy_NotInScope(Collection deletedByList) { + regDeletedBy(CK_NINS, cTL(deletedByList)); + } + + /** + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param deletedBy The value of deletedBy as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) + */ + public void setDeletedBy_LikeSearch( String deletedBy, - jp.sf.pal.todolist.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(deletedBy), getCValueDeletedBy(), - "DELETED_BY", "DeletedBy", "deletedBy", inScopeOption); + jp.sf.pal.todolist.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(deletedBy), getCValueDeletedBy(), "DELETED_BY", + "DeletedBy", "deletedBy", likeSearchOption); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param deletedByList The collection of deletedBy as notInScope. + * @param deletedBy The value of deletedBy as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setDeletedBy_NotInScope(Collection deletedByList) { - regDeletedBy(CK_NINS, cTL(deletedByList)); + public void setDeletedBy_NotLikeSearch( + String deletedBy, + jp.sf.pal.todolist.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(deletedBy), getCValueDeletedBy(), "DELETED_BY", + "DeletedBy", "deletedBy", likeSearchOption); } /** - * IsNull(is null). And OnceRegistered. + * IsNull(is null). And OnlyOnceRegistered. */ public void setDeletedBy_IsNull() { regDeletedBy(CK_ISN, DUMMY_OBJECT); } /** - * IsNotNull(is not null). And OnceRegistered. + * IsNotNull(is not null). And OnlyOnceRegistered. */ public void setDeletedBy_IsNotNull() { regDeletedBy(CK_ISNN, DUMMY_OBJECT); @@ -1798,7 +1733,7 @@ abstract protected ConditionValue getCValueDeletedBy(); /** - * Equal(=). And NullIgnored, OnceRegistered. {NotNull : INTEGER} + * Equal(=). And NullIgnored, OnlyOnceRegistered. {NotNull : INTEGER} * * @param versionno The value of versionno as equal. */ @@ -1807,7 +1742,7 @@ } /** - * NotEqual(!=). And NullIgnored, OnceRegistered. + * NotEqual(!=). And NullIgnored, OnlyOnceRegistered. * * @param versionno The value of versionno as notEqual. */ @@ -1816,7 +1751,7 @@ } /** - * GreaterThan(>). And NullIgnored, OnceRegistered. + * GreaterThan(>). And NullIgnored, OnlyOnceRegistered. * * @param versionno The value of versionno as greaterThan. */ @@ -1825,7 +1760,7 @@ } /** - * LessThan(<). And NullIgnored, OnceRegistered. + * LessThan(<). And NullIgnored, OnlyOnceRegistered. * * @param versionno The value of versionno as lessThan. */ @@ -1834,7 +1769,7 @@ } /** - * GreaterEqual(>=). And NullIgnored, OnceRegistered. + * GreaterEqual(>=). And NullIgnored, OnlyOnceRegistered. * * @param versionno The value of versionno as greaterEqual. */ @@ -1843,7 +1778,7 @@ } /** - * LessEqual(<=). And NullIgnored, OnceRegistered. + * LessEqual(<=). And NullIgnored, OnlyOnceRegistered. * * @param versionno The value of versionno as lessEqual. */ @@ -1883,6 +1818,50 @@ abstract protected ConditionValue getCValueVersionno(); + public SSQFunction scalar_Equal() { + return xcreateSSQFunction("="); + } + + public SSQFunction scalar_GreaterEqual() { + return xcreateSSQFunction(">="); + } + + public SSQFunction scalar_GreaterThan() { + return xcreateSSQFunction(">"); + } + + public SSQFunction scalar_LessEqual() { + return xcreateSSQFunction("<="); + } + + public SSQFunction scalar_LessThan() { + return xcreateSSQFunction("<"); + } + + protected SSQFunction xcreateSSQFunction(final String operand) { + return new SSQFunction(new SSQSetupper() { + public void setup(String function, SubQuery subQuery) { + xscalarSubQuery(function, subQuery, operand); + } + }); + } + + protected void xscalarSubQuery(String function, + SubQuery subQuery, String operand) { + assertObjectNotNull("subQuery", subQuery); + RoleInfoCB cb = new RoleInfoCB(); + cb.xsetupForScalarSubQuery(); + subQuery.query(cb); + String subQueryPropertyName = keepScalarSubQuery(cb.query()); // for + // saving + // query + // -value. + registerScalarSubQuery(function, cb.query(), subQueryPropertyName, + operand); + } + + public abstract String keepScalarSubQuery(RoleInfoCQ subQuery); + // Very Internal (for Suppressing Warn about 'Not Use Import') protected String getConditionBeanClassNameInternally() { return RoleInfoCB.class.getName(); Modified: todolist/trunk/src/main/java/jp/sf/pal/todolist/db/cbean/cq/bs/AbstractBsRoleMappingCQ.java =================================================================== --- todolist/trunk/src/main/java/jp/sf/pal/todolist/db/cbean/cq/bs/AbstractBsRoleMappingCQ.java 2008-12-27 22:20:45 UTC (rev 1632) +++ todolist/trunk/src/main/java/jp/sf/pal/todolist/db/cbean/cq/bs/AbstractBsRoleMappingCQ.java 2008-12-27 22:21:53 UTC (rev 1633) @@ -11,16 +11,13 @@ import jp.sf.pal.todolist.db.cbean.RoleInfoCB; import jp.sf.pal.todolist.db.cbean.RoleMappingCB; import jp.sf.pal.todolist.db.cbean.UserInfoCB; -import jp.sf.pal.todolist.db.cbean.cq.RoleInfoCQ; import jp.sf.pal.todolist.db.cbean.cq.RoleMappingCQ; -import jp.sf.pal.todolist.db.cbean.cq.UserInfoCQ; /** * The abstract condition-query of ROLE_MAPPING. * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public abstract class AbstractBsRoleMappingCQ extends AbstractConditionQuery { //========================================================================== @@ -50,7 +47,8 @@ // ===== /** - * Equal(=). And NullIgnored, OnceRegistered. {PK : ID : NotNull : INTEGER} + * Equal(=). And NullIgnored, OnlyOnceRegistered. {PK : ID : NotNull : + * INTEGER} * * @param id The value of id as equal. */ @@ -59,7 +57,7 @@ } /** - * NotEqual(!=). And NullIgnored, OnceRegistered. + * NotEqual(!=). And NullIgnored, OnlyOnceRegistered. * * @param id The value of id as notEqual. */ @@ -68,7 +66,7 @@ } /** - * GreaterThan(>). And NullIgnored, OnceRegistered. + * GreaterThan(>). And NullIgnored, OnlyOnceRegistered. * * @param id The value of id as greaterThan. */ @@ -77,7 +75,7 @@ } /** - * LessThan(<). And NullIgnored, OnceRegistered. + * LessThan(<). And NullIgnored, OnlyOnceRegistered. * * @param id The value of id as lessThan. */ @@ -86,7 +84,7 @@ } /** - * GreaterEqual(>=). And NullIgnored, OnceRegistered. + * GreaterEqual(>=). And NullIgnored, OnlyOnceRegistered. * * @param id The value of id as greaterEqual. */ @@ -95,7 +93,7 @@ } /** - * LessEqual(<=). And NullIgnored, OnceRegistered. + * LessEqual(<=). And NullIgnored, OnlyOnceRegistered. * * @param id The value of id as lessEqual. */ @@ -124,14 +122,14 @@ } /** - * IsNull(is null). And OnceRegistered. + * IsNull(is null). And OnlyOnceRegistered. */ public void setId_IsNull() { regId(CK_ISN, DUMMY_OBJECT); } /** - * IsNotNull(is not null). And OnceRegistered. + * IsNotNull(is not null). And OnlyOnceRegistered. */ public void setId_IsNotNull() { regId(CK_ISNN, DUMMY_OBJECT); @@ -148,8 +146,8 @@ abstract protected ConditionValue getCValueId(); /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {NotNull : VARCHAR(255) - * : FK to USER_INFO} + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {NotNull : + * VARCHAR(255) : FK to USER_INFO} * * @param userId The value of userId as equal. */ @@ -158,7 +156,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param userId The value of userId as notEqual. */ @@ -167,7 +165,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param userId The value of userId as greaterThan. */ @@ -176,7 +174,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param userId The value of userId as lessThan. */ @@ -185,7 +183,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param userId The value of userId as greaterEqual. */ @@ -194,7 +192,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param userId The value of userId as lessEqual. */ @@ -203,7 +201,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param userId The value of userId as prefixSearch. */ @@ -212,20 +210,6 @@ } /** - * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, - * SeveralRegistered. - * - * @param userId The value of userId as likeSearch. - * @param likeSearchOption The option of like-search. (NotNull) - */ - public void setUserId_LikeSearch( - String userId, - jp.sf.pal.todolist.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { - registerLikeSearchQuery(CK_LS, fRES(userId), getCValueUserId(), - "USER_ID", "UserId", "userId", likeSearchOption); - } - - /** * InScope(in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * @@ -236,42 +220,41 @@ } /** - * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * - * @param userId The collection of userId as inScope. - * @param inScopeOption The option of in-scope. (NotNull) + * @param userIdList The collection of userId as notInScope. */ - public void setUserId_InScope( - String userId, - jp.sf.pal.todolist.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(userId), getCValueUserId(), - "USER_ID", "UserId", "userId", inScopeOption); + public void setUserId_NotInScope(Collection userIdList) { + regUserId(CK_NINS, cTL(userIdList)); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param userIdList The collection of userId as notInScope. + * @param userId The value of userId as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) */ - public void setUserId_NotInScope(Collection userIdList) { - regUserId(CK_NINS, cTL(userIdList)); + public void setUserId_LikeSearch( + String userId, + jp.sf.pal.todolist.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(userId), getCValueUserId(), "USER_ID", "UserId", + "userId", likeSearchOption); } /** - * @param userInfoCBquery Query. - * @deprecated Please use inScopeUserInfo(subQuery) method. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param userId The value of userId as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setUserId_InScopeSubQuery_UserInfo(UserInfoCQ userInfoCBquery) { - String subQueryPropertyName = keepUserId_InScopeSubQuery_UserInfo(userInfoCBquery);// for - // saving - // query - // - - // value - // . - registerInScopeSubQuery(userInfoCBquery, "USER_ID", "USER_ID", - subQueryPropertyName); + public void setUserId_NotLikeSearch( + String userId, + jp.sf.pal.todolist.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(userId), getCValueUserId(), "USER_ID", "UserId", + "userId", likeSearchOption); } public void inScopeUserInfo(SubQuery subQuery) { @@ -280,12 +263,12 @@ cb.xsetupForInScopeSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepUserId_InScopeSubQuery_UserInfo(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerInScopeSubQuery(cb.query(), "USER_ID", "USER_ID", subQueryPropertyName); } - abstract public String keepUserId_InScopeSubQuery_UserInfo( + public abstract String keepUserId_InScopeSubQuery_UserInfo( jp.sf.pal.todolist.db.cbean.cq.UserInfoCQ subQuery); protected void regUserId(ConditionKey key, Object value) { @@ -301,8 +284,8 @@ abstract protected ConditionValue getCValueUserId(); /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {NotNull : VARCHAR(255) - * : FK to ROLE_INFO} + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {NotNull : + * VARCHAR(255) : FK to ROLE_INFO} * * @param roleId The value of roleId as equal. */ @@ -311,7 +294,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param roleId The value of roleId as notEqual. */ @@ -320,7 +303,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param roleId The value of roleId as greaterThan. */ @@ -329,7 +312,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param roleId The value of roleId as lessThan. */ @@ -338,7 +321,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param roleId The value of roleId as greaterEqual. */ @@ -347,7 +330,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param roleId The value of roleId as lessEqual. */ @@ -356,7 +339,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param roleId The value of roleId as prefixSearch. */ @@ -365,20 +348,6 @@ } /** - * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, - * SeveralRegistered. - * - * @param roleId The value of roleId as likeSearch. - * @param likeSearchOption The option of like-search. (NotNull) - */ - public void setRoleId_LikeSearch( - String roleId, - jp.sf.pal.todolist.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { - registerLikeSearchQuery(CK_LS, fRES(roleId), getCValueRoleId(), - "ROLE_ID", "RoleId", "roleId", likeSearchOption); - } - - /** * InScope(in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * @@ -389,42 +358,41 @@ } /** - * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * - * @param roleId The collection of roleId as inScope. - * @param inScopeOption The option of in-scope. (NotNull) + * @param roleIdList The collection of roleId as notInScope. */ - public void setRoleId_InScope( - String roleId, - jp.sf.pal.todolist.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(roleId), getCValueRoleId(), - "ROLE_ID", "RoleId", "roleId", inScopeOption); + public void setRoleId_NotInScope(Collection roleIdList) { + regRoleId(CK_NINS, cTL(roleIdList)); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param roleIdList The collection of roleId as notInScope. + * @param roleId The value of roleId as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) */ - public void setRoleId_NotInScope(Collection roleIdList) { - regRoleId(CK_NINS, cTL(roleIdList)); + public void setRoleId_LikeSearch( + String roleId, + jp.sf.pal.todolist.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(roleId), getCValueRoleId(), "ROLE_ID", "RoleId", + "roleId", likeSearchOption); } /** - * @param roleInfoCBquery Query. - * @deprecated Please use inScopeRoleInfo(subQuery) method. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param roleId The value of roleId as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setRoleId_InScopeSubQuery_RoleInfo(RoleInfoCQ roleInfoCBquery) { - String subQueryPropertyName = keepRoleId_InScopeSubQuery_RoleInfo(roleInfoCBquery);// for - // saving - // query - // - - // value - // . - registerInScopeSubQuery(roleInfoCBquery, "ROLE_ID", "ROLE_ID", - subQueryPropertyName); + public void setRoleId_NotLikeSearch( + String roleId, + jp.sf.pal.todolist.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(roleId), getCValueRoleId(), "ROLE_ID", "RoleId", + "roleId", likeSearchOption); } public void inScopeRoleInfo(SubQuery subQuery) { @@ -433,12 +401,12 @@ cb.xsetupForInScopeSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepRoleId_InScopeSubQuery_RoleInfo(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerInScopeSubQuery(cb.query(), "ROLE_ID", "ROLE_ID", subQueryPropertyName); } - abstract public String keepRoleId_InScopeSubQuery_RoleInfo( + public abstract String keepRoleId_InScopeSubQuery_RoleInfo( jp.sf.pal.todolist.db.cbean.cq.RoleInfoCQ subQuery); protected void regRoleId(ConditionKey key, Object value) { @@ -453,6 +421,50 @@ abstract protected ConditionValue getCValueRoleId(); + public SSQFunction scalar_Equal() { + return xcreateSSQFunction("="); + } + + public SSQFunction scalar_GreaterEqual() { + return xcreateSSQFunction(">="); + } + + public SSQFunction scalar_GreaterThan() { + return xcreateSSQFunction(">"); + } + + public SSQFunction scalar_LessEqual() { + return xcreateSSQFunction("<="); + } + + public SSQFunction scalar_LessThan() { + return xcreateSSQFunction("<"); + } + + protected SSQFunction xcreateSSQFunction(final String operand) { + return new SSQFunction(new SSQSetupper() { + public void setup(String function, SubQuery subQuery) { + xscalarSubQuery(function, subQuery, operand); + } + }); + } + + protected void xscalarSubQuery(String function, + SubQuery subQuery, String operand) { + assertObjectNotNull("subQuery", subQuery); + RoleMappingCB cb = new RoleMappingCB(); + cb.xsetupForScalarSubQuery(); + subQuery.query(cb); + String subQueryPropertyName = keepScalarSubQuery(cb.query()); // for + // saving + // query + // -value. + registerScalarSubQuery(function, cb.query(), subQueryPropertyName, + operand); + } + + public abstract String keepScalarSubQuery(RoleMappingCQ subQuery); + // Very Internal (for Suppressing Warn about 'Not Use Import') protected String getConditionBeanClassNameInternally() { return RoleMappingCB.class.getName(); Modified: todolist/trunk/src/main/java/jp/sf/pal/todolist/db/cbean/cq/bs/AbstractBsTodoCQ.java =================================================================== --- todolist/trunk/src/main/java/jp/sf/pal/todolist/db/cbean/cq/bs/AbstractBsTodoCQ.java 2008-12-27 22:20:45 UTC (rev 1632) +++ todolist/trunk/src/main/java/jp/sf/pal/todolist/db/cbean/cq/bs/AbstractBsTodoCQ.java 2008-12-27 22:21:53 UTC (rev 1633) @@ -13,14 +13,12 @@ import jp.sf.pal.todolist.db.cbean.UserInfoCB; import jp.sf.pal.todolist.db.cbean.cq.TodoCQ; import jp.sf.pal.todolist.db.cbean.cq.TodoMappingCQ; -import jp.sf.pal.todolist.db.cbean.cq.UserInfoCQ; /** * The abstract condition-query of TODO. * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public abstract class AbstractBsTodoCQ extends AbstractConditionQuery { //========================================================================== @@ -50,7 +48,8 @@ // ===== /** - * Equal(=). And NullIgnored, OnceRegistered. {PK : ID : NotNull : BIGINT} + * Equal(=). And NullIgnored, OnlyOnceRegistered. {PK : ID : NotNull : + * BIGINT} * * @param id The value of id as equal. */ @@ -59,7 +58,7 @@ } /** - * NotEqual(!=). And NullIgnored, OnceRegistered. + * NotEqual(!=). And NullIgnored, OnlyOnceRegistered. * * @param id The value of id as notEqual. */ @@ -68,7 +67,7 @@ } /** - * GreaterThan(>). And NullIgnored, OnceRegistered. + * GreaterThan(>). And NullIgnored, OnlyOnceRegistered. * * @param id The value of id as greaterThan. */ @@ -77,7 +76,7 @@ } /** - * LessThan(<). And NullIgnored, OnceRegistered. + * LessThan(<). And NullIgnored, OnlyOnceRegistered. * * @param id The value of id as lessThan. */ @@ -86,7 +85,7 @@ } /** - * GreaterEqual(>=). And NullIgnored, OnceRegistered. + * GreaterEqual(>=). And NullIgnored, OnlyOnceRegistered. * * @param id The value of id as greaterEqual. */ @@ -95,7 +94,7 @@ } /** - * LessEqual(<=). And NullIgnored, OnceRegistered. + * LessEqual(<=). And NullIgnored, OnlyOnceRegistered. * * @param id The value of id as lessEqual. */ @@ -123,34 +122,18 @@ regId(CK_NINS, cTL(idList)); } - /** - * @param todoMappingCBquery Query. - * @deprecated Please use inScopeTodoMappingList(subQuery) method. - */ - public void setId_InScopeSubQuery_TodoMappingList( - TodoMappingCQ todoMappingCBquery) { - String subQueryPropertyName = keepId_InScopeSubQuery_TodoMappingList(todoMappingCBquery);// for - // saving - // query - // - - // value - // . - registerInScopeSubQuery(todoMappingCBquery, "ID", "TODO_ID", - subQueryPropertyName); - } - public void inScopeTodoMappingList(SubQuery subQuery) { assertObjectNotNull("subQuery", subQuery); TodoMappingCB cb = new TodoMappingCB(); cb.xsetupForInScopeSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepId_InScopeSubQuery_TodoMappingList(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerInScopeSubQuery(cb.query(), "ID", "TODO_ID", subQueryPropertyName); } - abstract public String keepId_InScopeSubQuery_TodoMappingList( + public abstract String keepId_InScopeSubQuery_TodoMappingList( TodoMappingCQ subQuery); public void notInScopeTodoMappingList(SubQuery subQuery) { @@ -159,31 +142,15 @@ cb.xsetupForInScopeSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepId_NotInScopeSubQuery_TodoMappingList(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerNotInScopeSubQuery(cb.query(), "ID", "TODO_ID", subQueryPropertyName); } - abstract public String keepId_NotInScopeSubQuery_TodoMappingList( + public abstract String keepId_NotInScopeSubQuery_TodoMappingList( TodoMappingCQ subQuery); /** - * @param todoMappingCBquery Query. - * @deprecated Please use existsTodoMappingList(subQuery) method. - */ - public void setId_ExistsSubQuery_TodoMappingList( - TodoMappingCQ todoMappingCBquery) { - String subQueryPropertyName = keepId_ExistsSubQuery_TodoMappingList(todoMappingCBquery);// for - // saving - // query - // - - // value - // . - registerExistsSubQuery(todoMappingCBquery, "ID", "TODO_ID", - subQueryPropertyName); - } - - /** * Set up 'exists' sub-query. {exists (select TODO_ID from TODO_MAPPING * where ...)} * @@ -196,12 +163,12 @@ cb.xsetupForExistsSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepId_ExistsSubQuery_TodoMappingList(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerExistsSubQuery(cb.query(), "ID", "TODO_ID", subQueryPropertyName); } - abstract public String keepId_ExistsSubQuery_TodoMappingList( + public abstract String keepId_ExistsSubQuery_TodoMappingList( TodoMappingCQ subQuery); /** @@ -217,38 +184,38 @@ cb.xsetupForExistsSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepId_NotExistsSubQuery_TodoMappingList(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerNotExistsSubQuery(cb.query(), "ID", "TODO_ID", subQueryPropertyName); } - abstract public String keepId_NotExistsSubQuery_TodoMappingList( + public abstract String keepId_NotExistsSubQuery_TodoMappingList( TodoMappingCQ subQuery); public void xderiveTodoMappingList(String function, SubQuery subQuery, String aliasName) { assertObjectNotNull("subQuery", subQuery); TodoMappingCB cb = new TodoMappingCB(); - cb.xsetupForDeriveReferrer(); + cb.xsetupForDerivedReferrer(); subQuery.query(cb); - String subQueryPropertyName = keepId_DeriveSubQuery_TodoMappingList(cb - .query());// for saving query-value. - registerDeriveSubQuery(function, cb.query(), "ID", "TODO_ID", + String subQueryPropertyName = keepId_DerivedReferrer_TodoMappingList(cb + .query()); // for saving query-value. + registerDerivedReferrerSubQuery(function, cb.query(), "ID", "TODO_ID", subQueryPropertyName, aliasName); } - abstract public String keepId_DeriveSubQuery_TodoMappingList( + public abstract String keepId_DerivedReferrer_TodoMappingList( TodoMappingCQ subQuery); /** - * IsNull(is null). And OnceRegistered. + * IsNull(is null). And OnlyOnceRegistered. */ public void setId_IsNull() { regId(CK_ISN, DUMMY_OBJECT); } /** - * IsNotNull(is not null). And OnceRegistered. + * IsNotNull(is not null). And OnlyOnceRegistered. */ public void setId_IsNotNull() { regId(CK_ISNN, DUMMY_OBJECT); @@ -265,7 +232,7 @@ abstract protected ConditionValue getCValueId(); /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {NotNull : + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {NotNull : * VARCHAR(100)} * * @param name The value of name as equal. @@ -275,7 +242,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param name The value of name as notEqual. */ @@ -284,7 +251,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param name The value of name as greaterThan. */ @@ -293,7 +260,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param name The value of name as lessThan. */ @@ -302,7 +269,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param name The value of name as greaterEqual. */ @@ -311,7 +278,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param name The value of name as lessEqual. */ @@ -320,7 +287,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param name The value of name as prefixSearch. */ @@ -329,20 +296,6 @@ } /** - * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, - * SeveralRegistered. - * - * @param name The value of name as likeSearch. - * @param likeSearchOption The option of like-search. (NotNull) - */ - public void setName_LikeSearch( - String name, - jp.sf.pal.todolist.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { - registerLikeSearchQuery(CK_LS, fRES(name), getCValueName(), "NAME", - "Name", "name", likeSearchOption); - } - - /** * InScope(in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * @@ -353,27 +306,41 @@ } /** - * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * - * @param name The collection of name as inScope. - * @param inScopeOption The option of in-scope. (NotNull) + * @param nameList The collection of name as notInScope. */ - public void setName_InScope( + public void setName_NotInScope(Collection nameList) { + regName(CK_NINS, cTL(nameList)); + } + + /** + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param name The value of name as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) + */ + public void setName_LikeSearch( String name, - jp.sf.pal.todolist.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(name), getCValueName(), "NAME", - "Name", "name", inScopeOption); + jp.sf.pal.todolist.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(name), getCValueName(), "NAME", "Name", "name", + likeSearchOption); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param nameList The collection of name as notInScope. + * @param name The value of name as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setName_NotInScope(Collection nameList) { - regName(CK_NINS, cTL(nameList)); + public void setName_NotLikeSearch( + String name, + jp.sf.pal.todolist.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(name), getCValueName(), "NAME", "Name", "name", + likeSearchOption); } protected void regName(ConditionKey key, Object value) { @@ -387,7 +354,7 @@ abstract protected ConditionValue getCValueName(); /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {VARCHAR(200)} + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {VARCHAR(200)} * * @param description The value of description as equal. */ @@ -396,7 +363,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param description The value of description as notEqual. */ @@ -405,7 +372,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param description The value of description as greaterThan. */ @@ -414,7 +381,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param description The value of description as lessThan. */ @@ -423,7 +390,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param description The value of description as greaterEqual. */ @@ -432,7 +399,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param description The value of description as lessEqual. */ @@ -441,7 +408,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param description The value of description as prefixSearch. */ @@ -450,21 +417,6 @@ } /** - * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, - * SeveralRegistered. - * - * @param description The value of description as likeSearch. - * @param likeSearchOption The option of like-search. (NotNull) - */ - public void setDescription_LikeSearch( - String description, - jp.sf.pal.todolist.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { - registerLikeSearchQuery(CK_LS, fRES(description), - getCValueDescription(), "DESCRIPTION", "Description", - "description", likeSearchOption); - } - - /** * InScope(in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * @@ -475,38 +427,52 @@ } /** - * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * - * @param description The collection of description as inScope. - * @param inScopeOption The option of in-scope. (NotNull) + * @param descriptionList The collection of description as notInScope. */ - public void setDescription_InScope( + public void setDescription_NotInScope(Collection descriptionList) { + regDescription(CK_NINS, cTL(descriptionList)); + } + + /** + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param description The value of description as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) + */ + public void setDescription_LikeSearch( String description, - jp.sf.pal.todolist.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(description), getCValueDescription(), - "DESCRIPTION", "Description", "description", inScopeOption); + jp.sf.pal.todolist.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(description), getCValueDescription(), "DESCRIPTION", + "Description", "description", likeSearchOption); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param descriptionList The collection of description as notInScope. + * @param description The value of description as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setDescription_NotInScope(Collection descriptionList) { - regDescription(CK_NINS, cTL(descriptionList)); + public void setDescription_NotLikeSearch( + String description, + jp.sf.pal.todolist.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(description), getCValueDescription(), + "DESCRIPTION", "Description", "description", likeSearchOption); } /** - * IsNull(is null). And OnceRegistered. + * IsNull(is null). And OnlyOnceRegistered. */ public void setDescription_IsNull() { regDescription(CK_ISN, DUMMY_OBJECT); } /** - * IsNotNull(is not null). And OnceRegistered. + * IsNotNull(is not null). And OnlyOnceRegistered. */ public void setDescription_IsNotNull() { regDescription(CK_ISNN, DUMMY_OBJECT); @@ -525,7 +491,7 @@ abstract protected ConditionValue getCValueDescription(); /** - * Equal(=). And NullIgnored, OnceRegistered. {NotNull : INTEGER} + * Equal(=). And NullIgnored, OnlyOnceRegistered. {NotNull : INTEGER} * * @param priority The value of priority as equal. */ @@ -534,7 +500,7 @@ } /** - * NotEqual(!=). And NullIgnored, OnceRegistered. + * NotEqual(!=). And NullIgnored, OnlyOnceRegistered. * * @param priority The value of priority as notEqual. */ @@ -543,7 +509,7 @@ } /** - * GreaterThan(>). And NullIgnored, OnceRegistered. + * GreaterThan(>). And NullIgnored, OnlyOnceRegistered. * * @param priority The value of priority as greaterThan. */ @@ -552,7 +518,7 @@ } /** - * LessThan(<). And NullIgnored, OnceRegistered. + * LessThan(<). And NullIgnored, OnlyOnceRegistered. * * @param priority The value of priority as lessThan. */ @@ -561,7 +527,7 @@ } /** - * GreaterEqual(>=). And NullIgnored, OnceRegistered. + * GreaterEqual(>=). And NullIgnored, OnlyOnceRegistered. * * @param priority The value of priority as greaterEqual. */ @@ -570,7 +536,7 @@ } /** - * LessEqual(<=). And NullIgnored, OnceRegistered. + * LessEqual(<=). And NullIgnored, OnlyOnceRegistered. * * @param priority The value of priority as lessEqual. */ @@ -611,7 +577,7 @@ abstract protected ConditionValue getCValuePriority(); /** - * Equal(=). And NullIgnored, OnceRegistered. {NotNull : INTEGER} + * Equal(=). And NullIgnored, OnlyOnceRegistered. {NotNull : INTEGER} * * @param status The value of status as equal. */ @@ -620,7 +586,7 @@ } /** - * NotEqual(!=). And NullIgnored, OnceRegistered. + * NotEqual(!=). And NullIgnored, OnlyOnceRegistered. * * @param status The value of status as notEqual. */ @@ -629,7 +595,7 @@ } /** - * GreaterThan(>). And NullIgnored, OnceRegistered. + * GreaterThan(>). And NullIgnored, OnlyOnceRegistered. * * @param status The value of status as greaterThan. */ @@ -638,7 +604,7 @@ } /** - * LessThan(<). And NullIgnored, OnceRegistered. + * LessThan(<). And NullIgnored, OnlyOnceRegistered. * * @param status The value of status as lessThan. */ @@ -647,7 +613,7 @@ } /** - * GreaterEqual(>=). And NullIgnored, OnceRegistered. + * GreaterEqual(>=). And NullIgnored, OnlyOnceRegistered. * * @param status The value of status as greaterEqual. */ @@ -656,7 +622,7 @@ } /** - * LessEqual(<=). And NullIgnored, OnceRegistered. + * LessEqual(<=). And NullIgnored, OnlyOnceRegistered. * * @param status The value of status as lessEqual. */ @@ -697,7 +663,7 @@ abstract protected ConditionValue getCValueStatus(); /** - * Equal(=). And NullIgnored, OnceRegistered. {TIMESTAMP} + * Equal(=). And NullIgnored, OnlyOnceRegistered. {TIMESTAMP} * * @param startDate The value of startDate as equal. */ @@ -706,7 +672,7 @@ } /** - * NotEqual(!=). And NullIgnored, OnceRegistered. + * NotEqual(!=). And NullIgnored, OnlyOnceRegistered. * * @param startDate The value of startDate as notEqual. */ @@ -715,7 +681,7 @@ } /** - * GreaterThan(>). And NullIgnored, OnceRegistered. + * GreaterThan(>). And NullIgnored, OnlyOnceRegistered. * * @param startDate The value of startDate as greaterThan. */ @@ -724,7 +690,7 @@ } /** - * LessThan(>). And NullIgnored, OnceRegistered. + * LessThan(>). And NullIgnored, OnlyOnceRegistered. * * @param startDate The value of startDate as lessThan. */ @@ -733,7 +699,7 @@ } /** - * GreaterEqual(>). And NullIgnored, OnceRegistered. + * GreaterEqual(>). And NullIgnored, OnlyOnceRegistered. * * @param startDate The value of startDate as greaterEqual. */ @@ -742,7 +708,7 @@ } /** - * LessEqual(>). And NullIgnored, OnceRegistered. + * LessEqual(>). And NullIgnored, OnlyOnceRegistered. * * @param startDate The value of startDate as lessEqual. */ @@ -752,7 +718,7 @@ /** * FromTo($fromDate <= COLUMN_NAME <= $toDate). And NullIgnored, - * OnceRegistered. {TIMESTAMP} + * OnlyOnceRegistered. {TIMESTAMP} * * @param fromDate The from-date of startDate. (Nullable) * @param toDate The to-date of startDate. (Nullable) @@ -770,7 +736,7 @@ /** * FromTo($fromDate <= COLUMN_NAME < $toDate + 1). And NullIgnored, - * OnceRegistered. {TIMESTAMP} + * OnlyOnceRegistered. {TIMESTAMP} * * @param fromDate The from-date of startDate. (Nullable) * @param toDate The to-date of startDate. (Nullable) @@ -784,14 +750,14 @@ } /** - * IsNull(is null). And OnceRegistered. + * IsNull(is null). And OnlyOnceRegistered. */ public void setStartDate_IsNull() { regStartDate(CK_ISN, DUMMY_OBJECT); } /** - * IsNotNull(is not null). And OnceRegistered. + * IsNotNull(is not null). And OnlyOnceRegistered. */ public void setStartDate_IsNotNull() { regStartDate(CK_ISNN, DUMMY_OBJECT); @@ -810,7 +776,7 @@ abstract protected ConditionValue getCValueStartDate(); /** - * Equal(=). And NullIgnored, OnceRegistered. {TIMESTAMP} + * Equal(=). And NullIgnored, OnlyOnceRegistered. {TIMESTAMP} * * @param endDate The value of endDate as equal. */ @@ -819,7 +785,7 @@ } /** - * NotEqual(!=). And NullIgnored, OnceRegistered. + * NotEqual(!=). And NullIgnored, OnlyOnceRegistered. * * @param endDate The value of endDate as notEqual. */ @@ -828,7 +794,7 @@ } /** - * GreaterThan(>). And NullIgnored, OnceRegistered. + * GreaterThan(>). And NullIgnored, OnlyOnceRegistered. * * @param endDate The value of endDate as greaterThan. */ @@ -837,7 +803,7 @@ } /** - * LessThan(>). And NullIgnored, OnceRegistered. + * LessThan(>). And NullIgnored, OnlyOnceRegistered. * * @param endDate The value of endDate as lessThan. */ @@ -846,7 +812,7 @@ } /** - * GreaterEqual(>). And NullIgnored, OnceRegistered. + * GreaterEqual(>). And NullIgnored, OnlyOnceRegistered. * * @param endDate The value of endDate as greaterEqual. */ @@ -855,7 +821,7 @@ } /** - * LessEqual(>). And NullIgnored, OnceRegistered. + * LessEqual(>). And NullIgnored, OnlyOnceRegistered. * * @param endDate The value of endDate as lessEqual. */ @@ -865,7 +831,7 @@ /** * FromTo($fromDate <= COLUMN_NAME <= $toDate). And NullIgnored, - * OnceRegistered. {TIMESTAMP} + * OnlyOnceRegistered. {TIMESTAMP} * * @param fromDate The from-date of endDate. (Nullable) * @param toDate The to-date of endDate. (Nullable) @@ -883,7 +849,7 @@ /** * FromTo($fromDate <= COLUMN_NAME < $toDate + 1). And NullIgnored, - * OnceRegistered. {TIMESTAMP} + * OnlyOnceRegistered. {TIMESTAMP} * * @param fromDate The from-date of endDate. (Nullable) * @param toDate The to-date of endDate. (Nullable) @@ -897,14 +863,14 @@ } /** - * IsNull(is null). And OnceRegistered. + * IsNull(is null). And OnlyOnceRegistered. */ public void setEndDate_IsNull() { regEndDate(CK_ISN, DUMMY_OBJECT); } /** - * IsNotNull(is not null). And OnceRegistered. + * IsNotNull(is not null). And OnlyOnceRegistered. */ public void setEndDate_IsNotNull() { regEndDate(CK_ISNN, DUMMY_OBJECT); @@ -923,7 +889,7 @@ abstract protected ConditionValue getCValueEndDate(); /** - * Equal(=). And NullIgnored, OnceRegistered. {NotNull : TIMESTAMP} + * Equal(=). And NullIgnored, OnlyOnceRegistered. {NotNull : TIMESTAMP} * * @param createdTime The value of createdTime as equal. */ @@ -932,7 +898,7 @@ } /** - * NotEqual(!=). And NullIgnored, OnceRegistered. + * NotEqual(!=). And NullIgnored, OnlyOnceRegistered. * * @param createdTime The value of createdTime as notEqual. */ @@ -941,7 +907,7 @@ } /** - * GreaterThan(>). And NullIgnored, OnceRegistered. + * GreaterThan(>). And NullIgnored, OnlyOnceRegistered. * * @param createdTime The value of createdTime as greaterThan. */ @@ -950,7 +916,7 @@ } /** - * LessThan(>). And NullIgnored, OnceRegistered. + * LessThan(>). And NullIgnored, OnlyOnceRegistered. * * @param createdTime The value of createdTime as lessThan. */ @@ -959,7 +925,7 @@ } /** - * GreaterEqual(>). And NullIgnored, OnceRegistered. + * GreaterEqual(>). And NullIgnored, OnlyOnceRegistered. * * @param createdTime The value of createdTime as greaterEqual. */ @@ -968,7 +934,7 @@ } /** - * LessEqual(>). And NullIgnored, OnceRegistered. + * LessEqual(>). And NullIgnored, OnlyOnceRegistered. * * @param createdTime The value of createdTime as lessEqual. */ @@ -978,7 +944,7 @@ /** * FromTo($fromDate <= COLUMN_NAME <= $toDate). And NullIgnored, - * OnceRegistered. {NotNull : TIMESTAMP} + * OnlyOnceRegistered. {NotNull : TIMESTAMP} * * @param fromDate The from-date of createdTime. (Nullable) * @param toDate The to-date of createdTime. (Nullable) @@ -996,7 +962,7 @@ /** * FromTo($fromDate <= COLUMN_NAME < $toDate + 1). And NullIgnored, - * OnceRegistered. {NotNull : TIMESTAMP} + * OnlyOnceRegistered. {NotNull : TIMESTAMP} * * @param fromDate The from-date of createdTime. (Nullable) * @param toDate The to-date of createdTime. (Nullable) @@ -1022,8 +988,8 @@ abstract protected ConditionValue getCValueCreatedTime(); /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {NotNull : VARCHAR(255) - * : FK to USER_INFO} + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {NotNull : + * VARCHAR(255) : FK to USER_INFO} * * @param createdBy The value of createdBy as equal. */ @@ -1032,7 +998,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param createdBy The value of createdBy as notEqual. */ @@ -1041,7 +1007,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param createdBy The value of createdBy as greaterThan. */ @@ -1050,7 +1016,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param createdBy The value of createdBy as lessThan. */ @@ -1059,7 +1025,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param createdBy The value of createdBy as greaterEqual. */ @@ -1068,7 +1034,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param createdBy The value of createdBy as lessEqual. */ @@ -1077,7 +1043,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param createdBy The value of createdBy as prefixSearch. */ @@ -1086,20 +1052,6 @@ } /** - * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, - * SeveralRegistered. - * - * @param createdBy The value of createdBy as likeSearch. - * @param likeSearchOption The option of like-search. (NotNull) - */ - public void setCreatedBy_LikeSearch( - String createdBy, - jp.sf.pal.todolist.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. * @@ -1110,42 +1062,41 @@ } /** - * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * - * @param createdBy The collection of createdBy as inScope. - * @param inScopeOption The option of in-scope. (NotNull) + * @param createdByList The collection of createdBy as notInScope. */ - public void setCreatedBy_InScope( - String createdBy, - jp.sf.pal.todolist.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(createdBy), getCValueCreatedBy(), - "CREATED_BY", "CreatedBy", "createdBy", inScopeOption); + public void setCreatedBy_NotInScope(Collection createdByList) { + regCreatedBy(CK_NINS, cTL(createdByList)); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param createdByList The collection of createdBy as notInScope. + * @param createdBy The value of createdBy as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) */ - public void setCreatedBy_NotInScope(Collection createdByList) { - regCreatedBy(CK_NINS, cTL(createdByList)); + public void setCreatedBy_LikeSearch( + String createdBy, + jp.sf.pal.todolist.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(createdBy), getCValueCreatedBy(), "CREATED_BY", + "CreatedBy", "createdBy", likeSearchOption); } /** - * @param userInfoCBquery Query. - * @deprecated Please use inScopeUserInfo(subQuery) method. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param createdBy The value of createdBy as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setCreatedBy_InScopeSubQuery_UserInfo(UserInfoCQ userInfoCBquery) { - String subQueryPropertyName = keepCreatedBy_InScopeSubQuery_UserInfo(userInfoCBquery);// for - // saving - // query - // - - // value - // . - registerInScopeSubQuery(userInfoCBquery, "CREATED_BY", "USER_ID", - subQueryPropertyName); + public void setCreatedBy_NotLikeSearch( + String createdBy, + jp.sf.pal.todolist.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(createdBy), getCValueCreatedBy(), "CREATED_BY", + "CreatedBy", "createdBy", likeSearchOption); } public void inScopeUserInfo(SubQuery subQuery) { @@ -1154,12 +1105,12 @@ cb.xsetupForInScopeSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepCreatedBy_InScopeSubQuery_UserInfo(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerInScopeSubQuery(cb.query(), "CREATED_BY", "USER_ID", subQueryPropertyName); } - abstract public String keepCreatedBy_InScopeSubQuery_UserInfo( + public abstract String keepCreatedBy_InScopeSubQuery_UserInfo( jp.sf.pal.todolist.db.cbean.cq.UserInfoCQ subQuery); protected void regCreatedBy(ConditionKey key, Object value) { @@ -1175,7 +1126,7 @@ abstract protected ConditionValue getCValueCreatedBy(); /** - * Equal(=). And NullIgnored, OnceRegistered. {NotNull : TIMESTAMP} + * Equal(=). And NullIgnored, OnlyOnceRegistered. {NotNull : TIMESTAMP} * * @param updatedTime The value of updatedTime as equal. */ @@ -1184,7 +1135,7 @@ } /** - * NotEqual(!=). And NullIgnored, OnceRegistered. + * NotEqual(!=). And NullIgnored, OnlyOnceRegistered. * * @param updatedTime The value of updatedTime as notEqual. */ @@ -1193,7 +1144,7 @@ } /** - * GreaterThan(>). And NullIgnored, OnceRegistered. + * GreaterThan(>). And NullIgnored, OnlyOnceRegistered. * * @param updatedTime The value of updatedTime as greaterThan. */ @@ -1202,7 +1153,7 @@ } /** - * LessThan(>). And NullIgnored, OnceRegistered. + * LessThan(>). And NullIgnored, OnlyOnceRegistered. * * @param updatedTime The value of updatedTime as lessThan. */ @@ -1211,7 +1162,7 @@ } /** - * GreaterEqual(>). And NullIgnored, OnceRegistered. + * GreaterEqual(>). And NullIgnored, OnlyOnceRegistered. * * @param updatedTime The value of updatedTime as greaterEqual. */ @@ -1220,7 +1171,7 @@ } /** - * LessEqual(>). And NullIgnored, OnceRegistered. + * LessEqual(>). And NullIgnored, OnlyOnceRegistered. * * @param updatedTime The value of updatedTime as lessEqual. */ @@ -1230,7 +1181,7 @@ /** * FromTo($fromDate <= COLUMN_NAME <= $toDate). And NullIgnored, - * OnceRegistered. {NotNull : TIMESTAMP} + * OnlyOnceRegistered. {NotNull : TIMESTAMP} * * @param fromDate The from-date of updatedTime. (Nullable) * @param toDate The to-date of updatedTime. (Nullable) @@ -1248,7 +1199,7 @@ /** * FromTo($fromDate <= COLUMN_NAME < $toDate + 1). And NullIgnored, - * OnceRegistered. {NotNull : TIMESTAMP} + * OnlyOnceRegistered. {NotNull : TIMESTAMP} * * @param fromDate The from-date of updatedTime. (Nullable) * @param toDate The to-date of updatedTime. (Nullable) @@ -1274,7 +1225,7 @@ abstract protected ConditionValue getCValueUpdatedTime(); /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {NotNull : + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {NotNull : * VARCHAR(255)} * * @param updatedBy The value of updatedBy as equal. @@ -1284,7 +1235,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param updatedBy The value of updatedBy as notEqual. */ @@ -1293,7 +1244,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param updatedBy The value of updatedBy as greaterThan. */ @@ -1302,7 +1253,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param updatedBy The value of updatedBy as lessThan. */ @@ -1311,7 +1262,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param updatedBy The value of updatedBy as greaterEqual. */ @@ -1320,7 +1271,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param updatedBy The value of updatedBy as lessEqual. */ @@ -1329,7 +1280,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param updatedBy The value of updatedBy as prefixSearch. */ @@ -1338,20 +1289,6 @@ } /** - * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, - * SeveralRegistered. - * - * @param updatedBy The value of updatedBy as likeSearch. - * @param likeSearchOption The option of like-search. (NotNull) - */ - public void setUpdatedBy_LikeSearch( - String updatedBy, - jp.sf.pal.todolist.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. * @@ -1362,27 +1299,41 @@ } /** - * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * - * @param updatedBy The collection of updatedBy as inScope. - * @param inScopeOption The option of in-scope. (NotNull) + * @param updatedByList The collection of updatedBy as notInScope. */ - public void setUpdatedBy_InScope( + public void setUpdatedBy_NotInScope(Collection updatedByList) { + regUpdatedBy(CK_NINS, cTL(updatedByList)); + } + + /** + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param updatedBy The value of updatedBy as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) + */ + public void setUpdatedBy_LikeSearch( String updatedBy, - jp.sf.pal.todolist.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(updatedBy), getCValueUpdatedBy(), - "UPDATED_BY", "UpdatedBy", "updatedBy", inScopeOption); + jp.sf.pal.todolist.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(updatedBy), getCValueUpdatedBy(), "UPDATED_BY", + "UpdatedBy", "updatedBy", likeSearchOption); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param updatedByList The collection of updatedBy as notInScope. + * @param updatedBy The value of updatedBy as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setUpdatedBy_NotInScope(Collection updatedByList) { - regUpdatedBy(CK_NINS, cTL(updatedByList)); + public void setUpdatedBy_NotLikeSearch( + String updatedBy, + jp.sf.pal.todolist.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(updatedBy), getCValueUpdatedBy(), "UPDATED_BY", + "UpdatedBy", "updatedBy", likeSearchOption); } protected void regUpdatedBy(ConditionKey key, Object value) { @@ -1398,7 +1349,7 @@ abstract protected ConditionValue getCValueUpdatedBy(); /** - * Equal(=). And NullIgnored, OnceRegistered. {TIMESTAMP} + * Equal(=). And NullIgnored, OnlyOnceRegistered. {TIMESTAMP} * * @param deletedTime The value of deletedTime as equal. */ @@ -1407,7 +1358,7 @@ } /** - * NotEqual(!=). And NullIgnored, OnceRegistered. + * NotEqual(!=). And NullIgnored, OnlyOnceRegistered. * * @param deletedTime The value of deletedTime as notEqual. */ @@ -1416,7 +1367,7 @@ } /** - * GreaterThan(>). And NullIgnored, OnceRegistered. + * GreaterThan(>). And NullIgnored, OnlyOnceRegistered. * * @param deletedTime The value of deletedTime as greaterThan. */ @@ -1425,7 +1376,7 @@ } /** - * LessThan(>). And NullIgnored, OnceRegistered. + * LessThan(>). And NullIgnored, OnlyOnceRegistered. * * @param deletedTime The value of deletedTime as lessThan. */ @@ -1434,7 +1385,7 @@ } /** - * GreaterEqual(>). And NullIgnored, OnceRegistered. + * GreaterEqual(>). And NullIgnored, OnlyOnceRegistered. * * @param deletedTime The value of deletedTime as greaterEqual. */ @@ -1443,7 +1394,7 @@ } /** - * LessEqual(>). And NullIgnored, OnceRegistered. + * LessEqual(>). And NullIgnored, OnlyOnceRegistered. * * @param deletedTime The value of deletedTime as lessEqual. */ @@ -1453,7 +1404,7 @@ /** * FromTo($fromDate <= COLUMN_NAME <= $toDate). And NullIgnored, - * OnceRegistered. {TIMESTAMP} + * OnlyOnceRegistered. {TIMESTAMP} * * @param fromDate The from-date of deletedTime. (Nullable) * @param toDate The to-date of deletedTime. (Nullable) @@ -1471,7 +1422,7 @@ /** * FromTo($fromDate <= COLUMN_NAME < $toDate + 1). And NullIgnored, - * OnceRegistered. {TIMESTAMP} + * OnlyOnceRegistered. {TIMESTAMP} * * @param fromDate The from-date of deletedTime. (Nullable) * @param toDate The to-date of deletedTime. (Nullable) @@ -1485,14 +1436,14 @@ } /** - * IsNull(is null). And OnceRegistered. + * IsNull(is null). And OnlyOnceRegistered. */ public void setDeletedTime_IsNull() { regDeletedTime(CK_ISN, DUMMY_OBJECT); } /** - * IsNotNull(is not null). And OnceRegistered. + * IsNotNull(is not null). And OnlyOnceRegistered. */ public void setDeletedTime_IsNotNull() { regDeletedTime(CK_ISNN, DUMMY_OBJECT); @@ -1511,7 +1462,7 @@ abstract protected ConditionValue getCValueDeletedTime(); /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {VARCHAR(255)} + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {VARCHAR(255)} * * @param deletedBy The value of deletedBy as equal. */ @@ -1520,7 +1471,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param deletedBy The value of deletedBy as notEqual. */ @@ -1529,7 +1480,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param deletedBy The value of deletedBy as greaterThan. */ @@ -1538,7 +1489,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param deletedBy The value of deletedBy as lessThan. */ @@ -1547,7 +1498,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param deletedBy The value of deletedBy as greaterEqual. */ @@ -1556,7 +1507,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param deletedBy The value of deletedBy as lessEqual. */ @@ -1565,7 +1516,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param deletedBy The value of deletedBy as prefixSearch. */ @@ -1574,20 +1525,6 @@ } /** - * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, - * SeveralRegistered. - * - * @param deletedBy The value of deletedBy as likeSearch. - * @param likeSearchOption The option of like-search. (NotNull) - */ - public void setDeletedBy_LikeSearch( - String deletedBy, - jp.sf.pal.todolist.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. * @@ -1598,38 +1535,52 @@ } /** - * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * - * @param deletedBy The collection of deletedBy as inScope. - * @param inScopeOption The option of in-scope. (NotNull) + * @param deletedByList The collection of deletedBy as notInScope. */ - public void setDeletedBy_InScope( + public void setDeletedBy_NotInScope(Collection deletedByList) { + regDeletedBy(CK_NINS, cTL(deletedByList)); + } + + /** + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param deletedBy The value of deletedBy as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) + */ + public void setDeletedBy_LikeSearch( String deletedBy, - jp.sf.pal.todolist.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(deletedBy), getCValueDeletedBy(), - "DELETED_BY", "DeletedBy", "deletedBy", inScopeOption); + jp.sf.pal.todolist.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(deletedBy), getCValueDeletedBy(), "DELETED_BY", + "DeletedBy", "deletedBy", likeSearchOption); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param deletedByList The collection of deletedBy as notInScope. + * @param deletedBy The value of deletedBy as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setDeletedBy_NotInScope(Collection deletedByList) { - regDeletedBy(CK_NINS, cTL(deletedByList)); + public void setDeletedBy_NotLikeSearch( + String deletedBy, + jp.sf.pal.todolist.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(deletedBy), getCValueDeletedBy(), "DELETED_BY", + "DeletedBy", "deletedBy", likeSearchOption); } /** - * IsNull(is null). And OnceRegistered. + * IsNull(is null). And OnlyOnceRegistered. */ public void setDeletedBy_IsNull() { regDeletedBy(CK_ISN, DUMMY_OBJECT); } /** - * IsNotNull(is not null). And OnceRegistered. + * IsNotNull(is not null). And OnlyOnceRegistered. */ public void setDeletedBy_IsNotNull() { regDeletedBy(CK_ISNN, DUMMY_OBJECT); @@ -1648,7 +1599,7 @@ abstract protected ConditionValue getCValueDeletedBy(); /** - * Equal(=). And NullIgnored, OnceRegistered. {NotNull : INTEGER} + * Equal(=). And NullIgnored, OnlyOnceRegistered. {NotNull : INTEGER} * * @param versionno The value of versionno as equal. */ @@ -1657,7 +1608,7 @@ } /** - * NotEqual(!=). And NullIgnored, OnceRegistered. + * NotEqual(!=). And NullIgnored, OnlyOnceRegistered. * * @param versionno The value of versionno as notEqual. */ @@ -1666,7 +1617,7 @@ } /** - * GreaterThan(>). And NullIgnored, OnceRegistered. + * GreaterThan(>). And NullIgnored, OnlyOnceRegistered. * * @param versionno The value of versionno as greaterThan. */ @@ -1675,7 +1626,7 @@ } /** - * LessThan(<). And NullIgnored, OnceRegistered. + * LessThan(<). And NullIgnored, OnlyOnceRegistered. * * @param versionno The value of versionno as lessThan. */ @@ -1684,7 +1635,7 @@ } /** - * GreaterEqual(>=). And NullIgnored, OnceRegistered. + * GreaterEqual(>=). And NullIgnored, OnlyOnceRegistered. * * @param versionno The value of versionno as greaterEqual. */ @@ -1693,7 +1644,7 @@ } /** - * LessEqual(<=). And NullIgnored, OnceRegistered. + * LessEqual(<=). And NullIgnored, OnlyOnceRegistered. * * @param versionno The value of versionno as lessEqual. */ @@ -1733,6 +1684,50 @@ abstract protected ConditionValue getCValueVersionno(); + public SSQFunction scalar_Equal() { + return xcreateSSQFunction("="); + } + + public SSQFunction scalar_GreaterEqual() { + return xcreateSSQFunction(">="); + } + + public SSQFunction scalar_GreaterThan() { + return xcreateSSQFunction(">"); + } + + public SSQFunction scalar_LessEqual() { + return xcreateSSQFunction("<="); + } + + public SSQFunction scalar_LessThan() { + return xcreateSSQFunction("<"); + } + + protected SSQFunction xcreateSSQFunction(final String operand) { + return new SSQFunction(new SSQSetupper() { + public void setup(String function, SubQuery subQuery) { + xscalarSubQuery(function, subQuery, operand); + } + }); + } + + protected void xscalarSubQuery(String function, SubQuery subQuery, + String operand) { + assertObjectNotNull("subQuery", subQuery); + TodoCB cb = new TodoCB(); + cb.xsetupForScalarSubQuery(); + subQuery.query(cb); + String subQueryPropertyName = keepScalarSubQuery(cb.query()); // for + // saving + // query + // -value. + registerScalarSubQuery(function, cb.query(), subQueryPropertyName, + operand); + } + + public abstract String keepScalarSubQuery(TodoCQ subQuery); + // Very Internal (for Suppressing Warn about 'Not Use Import') protected String getConditionBeanClassNameInternally() { return TodoCB.class.getName(); Modified: todolist/trunk/src/main/java/jp/sf/pal/todolist/db/cbean/cq/bs/AbstractBsTodoCategoryCQ.java =================================================================== --- todolist/trunk/src/main/java/jp/sf/pal/todolist/db/cbean/cq/bs/AbstractBsTodoCategoryCQ.java 2008-12-27 22:20:45 UTC (rev 1632) +++ todolist/trunk/src/main/java/jp/sf/pal/todolist/db/cbean/cq/bs/AbstractBsTodoCategoryCQ.java 2008-12-27 22:21:53 UTC (rev 1633) @@ -13,14 +13,12 @@ import jp.sf.pal.todolist.db.cbean.UserInfoCB; import jp.sf.pal.todolist.db.cbean.cq.TodoCategoryCQ; import jp.sf.pal.todolist.db.cbean.cq.TodoMappingCQ; -import jp.sf.pal.todolist.db.cbean.cq.UserInfoCQ; /** * The abstract condition-query of TODO_CATEGORY. * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public abstract class AbstractBsTodoCategoryCQ extends AbstractConditionQuery { //========================================================================== @@ -50,7 +48,8 @@ // ===== /** - * Equal(=). And NullIgnored, OnceRegistered. {PK : ID : NotNull : BIGINT} + * Equal(=). And NullIgnored, OnlyOnceRegistered. {PK : ID : NotNull : + * BIGINT} * * @param id The value of id as equal. */ @@ -59,7 +58,7 @@ } /** - * NotEqual(!=). And NullIgnored, OnceRegistered. + * NotEqual(!=). And NullIgnored, OnlyOnceRegistered. * * @param id The value of id as notEqual. */ @@ -68,7 +67,7 @@ } /** - * GreaterThan(>). And NullIgnored, OnceRegistered. + * GreaterThan(>). And NullIgnored, OnlyOnceRegistered. * * @param id The value of id as greaterThan. */ @@ -77,7 +76,7 @@ } /** - * LessThan(<). And NullIgnored, OnceRegistered. + * LessThan(<). And NullIgnored, OnlyOnceRegistered. * * @param id The value of id as lessThan. */ @@ -86,7 +85,7 @@ } /** - * GreaterEqual(>=). And NullIgnored, OnceRegistered. + * GreaterEqual(>=). And NullIgnored, OnlyOnceRegistered. * * @param id The value of id as greaterEqual. */ @@ -95,7 +94,7 @@ } /** - * LessEqual(<=). And NullIgnored, OnceRegistered. + * LessEqual(<=). And NullIgnored, OnlyOnceRegistered. * * @param id The value of id as lessEqual. */ @@ -123,34 +122,18 @@ regId(CK_NINS, cTL(idList)); } - /** - * @param todoMappingCBquery Query. - * @deprecated Please use inScopeTodoMappingList(subQuery) method. - */ - public void setId_InScopeSubQuery_TodoMappingList( - TodoMappingCQ todoMappingCBquery) { - String subQueryPropertyName = keepId_InScopeSubQuery_TodoMappingList(todoMappingCBquery);// for - // saving - // query - // - - // value - // . - registerInScopeSubQuery(todoMappingCBquery, "ID", "CATEGORY_ID", - subQueryPropertyName); - } - public void inScopeTodoMappingList(SubQuery subQuery) { assertObjectNotNull("subQuery", subQuery); TodoMappingCB cb = new TodoMappingCB(); cb.xsetupForInScopeSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepId_InScopeSubQuery_TodoMappingList(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerInScopeSubQuery(cb.query(), "ID", "CATEGORY_ID", subQueryPropertyName); } - abstract public String keepId_InScopeSubQuery_TodoMappingList( + public abstract String keepId_InScopeSubQuery_TodoMappingList( TodoMappingCQ subQuery); public void notInScopeTodoMappingList(SubQuery subQuery) { @@ -159,31 +142,15 @@ cb.xsetupForInScopeSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepId_NotInScopeSubQuery_TodoMappingList(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerNotInScopeSubQuery(cb.query(), "ID", "CATEGORY_ID", subQueryPropertyName); } - abstract public String keepId_NotInScopeSubQuery_TodoMappingList( + public abstract String keepId_NotInScopeSubQuery_TodoMappingList( TodoMappingCQ subQuery); /** - * @param todoMappingCBquery Query. - * @deprecated Please use existsTodoMappingList(subQuery) method. - */ - public void setId_ExistsSubQuery_TodoMappingList( - TodoMappingCQ todoMappingCBquery) { - String subQueryPropertyName = keepId_ExistsSubQuery_TodoMappingList(todoMappingCBquery);// for - // saving - // query - // - - // value - // . - registerExistsSubQuery(todoMappingCBquery, "ID", "CATEGORY_ID", - subQueryPropertyName); - } - - /** * Set up 'exists' sub-query. {exists (select CATEGORY_ID from TODO_MAPPING * where ...)} * @@ -196,12 +163,12 @@ cb.xsetupForExistsSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepId_ExistsSubQuery_TodoMappingList(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerExistsSubQuery(cb.query(), "ID", "CATEGORY_ID", subQueryPropertyName); } - abstract public String keepId_ExistsSubQuery_TodoMappingList( + public abstract String keepId_ExistsSubQuery_TodoMappingList( TodoMappingCQ subQuery); /** @@ -217,38 +184,38 @@ cb.xsetupForExistsSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepId_NotExistsSubQuery_TodoMappingList(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerNotExistsSubQuery(cb.query(), "ID", "CATEGORY_ID", subQueryPropertyName); } - abstract public String keepId_NotExistsSubQuery_TodoMappingList( + public abstract String keepId_NotExistsSubQuery_TodoMappingList( TodoMappingCQ subQuery); public void xderiveTodoMappingList(String function, SubQuery subQuery, String aliasName) { assertObjectNotNull("subQuery", subQuery); TodoMappingCB cb = new TodoMappingCB(); - cb.xsetupForDeriveReferrer(); + cb.xsetupForDerivedReferrer(); subQuery.query(cb); - String subQueryPropertyName = keepId_DeriveSubQuery_TodoMappingList(cb - .query());// for saving query-value. - registerDeriveSubQuery(function, cb.query(), "ID", "CATEGORY_ID", - subQueryPropertyName, aliasName); + String subQueryPropertyName = keepId_DerivedReferrer_TodoMappingList(cb + .query()); // for saving query-value. + registerDerivedReferrerSubQuery(function, cb.query(), "ID", + "CATEGORY_ID", subQueryPropertyName, aliasName); } - abstract public String keepId_DeriveSubQuery_TodoMappingList( + public abstract String keepId_DerivedReferrer_TodoMappingList( TodoMappingCQ subQuery); /** - * IsNull(is null). And OnceRegistered. + * IsNull(is null). And OnlyOnceRegistered. */ public void setId_IsNull() { regId(CK_ISN, DUMMY_OBJECT); } /** - * IsNotNull(is not null). And OnceRegistered. + * IsNotNull(is not null). And OnlyOnceRegistered. */ public void setId_IsNotNull() { regId(CK_ISNN, DUMMY_OBJECT); @@ -265,7 +232,7 @@ abstract protected ConditionValue getCValueId(); /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {NotNull : + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {NotNull : * VARCHAR(100)} * * @param name The value of name as equal. @@ -275,7 +242,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param name The value of name as notEqual. */ @@ -284,7 +251,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param name The value of name as greaterThan. */ @@ -293,7 +260,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param name The value of name as lessThan. */ @@ -302,7 +269,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param name The value of name as greaterEqual. */ @@ -311,7 +278,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param name The value of name as lessEqual. */ @@ -320,7 +287,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param name The value of name as prefixSearch. */ @@ -329,20 +296,6 @@ } /** - * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, - * SeveralRegistered. - * - * @param name The value of name as likeSearch. - * @param likeSearchOption The option of like-search. (NotNull) - */ - public void setName_LikeSearch( - String name, - jp.sf.pal.todolist.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { - registerLikeSearchQuery(CK_LS, fRES(name), getCValueName(), "NAME", - "Name", "name", likeSearchOption); - } - - /** * InScope(in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * @@ -353,27 +306,41 @@ } /** - * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * - * @param name The collection of name as inScope. - * @param inScopeOption The option of in-scope. (NotNull) + * @param nameList The collection of name as notInScope. */ - public void setName_InScope( + public void setName_NotInScope(Collection nameList) { + regName(CK_NINS, cTL(nameList)); + } + + /** + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param name The value of name as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) + */ + public void setName_LikeSearch( String name, - jp.sf.pal.todolist.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(name), getCValueName(), "NAME", - "Name", "name", inScopeOption); + jp.sf.pal.todolist.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(name), getCValueName(), "NAME", "Name", "name", + likeSearchOption); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param nameList The collection of name as notInScope. + * @param name The value of name as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setName_NotInScope(Collection nameList) { - regName(CK_NINS, cTL(nameList)); + public void setName_NotLikeSearch( + String name, + jp.sf.pal.todolist.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(name), getCValueName(), "NAME", "Name", "name", + likeSearchOption); } protected void regName(ConditionKey key, Object value) { @@ -387,7 +354,7 @@ abstract protected ConditionValue getCValueName(); /** - * Equal(=). And NullIgnored, OnceRegistered. {NotNull : INTEGER : + * Equal(=). And NullIgnored, OnlyOnceRegistered. {NotNull : INTEGER : * Default=[1]} * * @param sortOrder The value of sortOrder as equal. @@ -397,7 +364,7 @@ } /** - * NotEqual(!=). And NullIgnored, OnceRegistered. + * NotEqual(!=). And NullIgnored, OnlyOnceRegistered. * * @param sortOrder The value of sortOrder as notEqual. */ @@ -406,7 +373,7 @@ } /** - * GreaterThan(>). And NullIgnored, OnceRegistered. + * GreaterThan(>). And NullIgnored, OnlyOnceRegistered. * * @param sortOrder The value of sortOrder as greaterThan. */ @@ -415,7 +382,7 @@ } /** - * LessThan(<). And NullIgnored, OnceRegistered. + * LessThan(<). And NullIgnored, OnlyOnceRegistered. * * @param sortOrder The value of sortOrder as lessThan. */ @@ -424,7 +391,7 @@ } /** - * GreaterEqual(>=). And NullIgnored, OnceRegistered. + * GreaterEqual(>=). And NullIgnored, OnlyOnceRegistered. * * @param sortOrder The value of sortOrder as greaterEqual. */ @@ -433,7 +400,7 @@ } /** - * LessEqual(<=). And NullIgnored, OnceRegistered. + * LessEqual(<=). And NullIgnored, OnlyOnceRegistered. * * @param sortOrder The value of sortOrder as lessEqual. */ @@ -474,8 +441,8 @@ abstract protected ConditionValue getCValueSortOrder(); /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {NotNull : VARCHAR(255) - * : FK to USER_INFO} + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {NotNull : + * VARCHAR(255) : FK to USER_INFO} * * @param userId The value of userId as equal. */ @@ -484,7 +451,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param userId The value of userId as notEqual. */ @@ -493,7 +460,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param userId The value of userId as greaterThan. */ @@ -502,7 +469,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param userId The value of userId as lessThan. */ @@ -511,7 +478,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param userId The value of userId as greaterEqual. */ @@ -520,7 +487,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param userId The value of userId as lessEqual. */ @@ -529,7 +496,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param userId The value of userId as prefixSearch. */ @@ -538,20 +505,6 @@ } /** - * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, - * SeveralRegistered. - * - * @param userId The value of userId as likeSearch. - * @param likeSearchOption The option of like-search. (NotNull) - */ - public void setUserId_LikeSearch( - String userId, - jp.sf.pal.todolist.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. * @@ -562,42 +515,41 @@ } /** - * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * - * @param userId The collection of userId as inScope. - * @param inScopeOption The option of in-scope. (NotNull) + * @param userIdList The collection of userId as notInScope. */ - public void setUserId_InScope( - String userId, - jp.sf.pal.todolist.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(userId), getCValueUserId(), - "USER_ID", "UserId", "userId", inScopeOption); + public void setUserId_NotInScope(Collection userIdList) { + regUserId(CK_NINS, cTL(userIdList)); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param userIdList The collection of userId as notInScope. + * @param userId The value of userId as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) */ - public void setUserId_NotInScope(Collection userIdList) { - regUserId(CK_NINS, cTL(userIdList)); + public void setUserId_LikeSearch( + String userId, + jp.sf.pal.todolist.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(userId), getCValueUserId(), "USER_ID", "UserId", + "userId", likeSearchOption); } /** - * @param userInfoCBquery Query. - * @deprecated Please use inScopeUserInfo(subQuery) method. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param userId The value of userId as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setUserId_InScopeSubQuery_UserInfo(UserInfoCQ userInfoCBquery) { - String subQueryPropertyName = keepUserId_InScopeSubQuery_UserInfo(userInfoCBquery);// for - // saving - // query - // - - // value - // . - registerInScopeSubQuery(userInfoCBquery, "USER_ID", "USER_ID", - subQueryPropertyName); + public void setUserId_NotLikeSearch( + String userId, + jp.sf.pal.todolist.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(userId), getCValueUserId(), "USER_ID", "UserId", + "userId", likeSearchOption); } public void inScopeUserInfo(SubQuery subQuery) { @@ -606,12 +558,12 @@ cb.xsetupForInScopeSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepUserId_InScopeSubQuery_UserInfo(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerInScopeSubQuery(cb.query(), "USER_ID", "USER_ID", subQueryPropertyName); } - abstract public String keepUserId_InScopeSubQuery_UserInfo( + public abstract String keepUserId_InScopeSubQuery_UserInfo( jp.sf.pal.todolist.db.cbean.cq.UserInfoCQ subQuery); protected void regUserId(ConditionKey key, Object value) { @@ -627,7 +579,7 @@ abstract protected ConditionValue getCValueUserId(); /** - * Equal(=). And NullIgnored, OnceRegistered. {NotNull : TIMESTAMP} + * Equal(=). And NullIgnored, OnlyOnceRegistered. {NotNull : TIMESTAMP} * * @param createdTime The value of createdTime as equal. */ @@ -636,7 +588,7 @@ } /** - * NotEqual(!=). And NullIgnored, OnceRegistered. + * NotEqual(!=). And NullIgnored, OnlyOnceRegistered. * * @param createdTime The value of createdTime as notEqual. */ @@ -645,7 +597,7 @@ } /** - * GreaterThan(>). And NullIgnored, OnceRegistered. + * GreaterThan(>). And NullIgnored, OnlyOnceRegistered. * * @param createdTime The value of createdTime as greaterThan. */ @@ -654,7 +606,7 @@ } /** - * LessThan(>). And NullIgnored, OnceRegistered. + * LessThan(>). And NullIgnored, OnlyOnceRegistered. * * @param createdTime The value of createdTime as lessThan. */ @@ -663,7 +615,7 @@ } /** - * GreaterEqual(>). And NullIgnored, OnceRegistered. + * GreaterEqual(>). And NullIgnored, OnlyOnceRegistered. * * @param createdTime The value of createdTime as greaterEqual. */ @@ -672,7 +624,7 @@ } /** - * LessEqual(>). And NullIgnored, OnceRegistered. + * LessEqual(>). And NullIgnored, OnlyOnceRegistered. * * @param createdTime The value of createdTime as lessEqual. */ @@ -682,7 +634,7 @@ /** * FromTo($fromDate <= COLUMN_NAME <= $toDate). And NullIgnored, - * OnceRegistered. {NotNull : TIMESTAMP} + * OnlyOnceRegistered. {NotNull : TIMESTAMP} * * @param fromDate The from-date of createdTime. (Nullable) * @param toDate The to-date of createdTime. (Nullable) @@ -700,7 +652,7 @@ /** * FromTo($fromDate <= COLUMN_NAME < $toDate + 1). And NullIgnored, - * OnceRegistered. {NotNull : TIMESTAMP} + * OnlyOnceRegistered. {NotNull : TIMESTAMP} * * @param fromDate The from-date of createdTime. (Nullable) * @param toDate The to-date of createdTime. (Nullable) @@ -726,7 +678,7 @@ abstract protected ConditionValue getCValueCreatedTime(); /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {NotNull : + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {NotNull : * VARCHAR(255)} * * @param createdBy The value of createdBy as equal. @@ -736,7 +688,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param createdBy The value of createdBy as notEqual. */ @@ -745,7 +697,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param createdBy The value of createdBy as greaterThan. */ @@ -754,7 +706,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param createdBy The value of createdBy as lessThan. */ @@ -763,7 +715,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param createdBy The value of createdBy as greaterEqual. */ @@ -772,7 +724,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param createdBy The value of createdBy as lessEqual. */ @@ -781,7 +733,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param createdBy The value of createdBy as prefixSearch. */ @@ -790,20 +742,6 @@ } /** - * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, - * SeveralRegistered. - * - * @param createdBy The value of createdBy as likeSearch. - * @param likeSearchOption The option of like-search. (NotNull) - */ - public void setCreatedBy_LikeSearch( - String createdBy, - jp.sf.pal.todolist.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. * @@ -814,27 +752,41 @@ } /** - * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * - * @param createdBy The collection of createdBy as inScope. - * @param inScopeOption The option of in-scope. (NotNull) + * @param createdByList The collection of createdBy as notInScope. */ - public void setCreatedBy_InScope( + public void setCreatedBy_NotInScope(Collection createdByList) { + regCreatedBy(CK_NINS, cTL(createdByList)); + } + + /** + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param createdBy The value of createdBy as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) + */ + public void setCreatedBy_LikeSearch( String createdBy, - jp.sf.pal.todolist.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(createdBy), getCValueCreatedBy(), - "CREATED_BY", "CreatedBy", "createdBy", inScopeOption); + jp.sf.pal.todolist.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(createdBy), getCValueCreatedBy(), "CREATED_BY", + "CreatedBy", "createdBy", likeSearchOption); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param createdByList The collection of createdBy as notInScope. + * @param createdBy The value of createdBy as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setCreatedBy_NotInScope(Collection createdByList) { - regCreatedBy(CK_NINS, cTL(createdByList)); + public void setCreatedBy_NotLikeSearch( + String createdBy, + jp.sf.pal.todolist.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(createdBy), getCValueCreatedBy(), "CREATED_BY", + "CreatedBy", "createdBy", likeSearchOption); } protected void regCreatedBy(ConditionKey key, Object value) { @@ -850,7 +802,7 @@ abstract protected ConditionValue getCValueCreatedBy(); /** - * Equal(=). And NullIgnored, OnceRegistered. {NotNull : TIMESTAMP} + * Equal(=). And NullIgnored, OnlyOnceRegistered. {NotNull : TIMESTAMP} * * @param updatedTime The value of updatedTime as equal. */ @@ -859,7 +811,7 @@ } /** - * NotEqual(!=). And NullIgnored, OnceRegistered. + * NotEqual(!=). And NullIgnored, OnlyOnceRegistered. * * @param updatedTime The value of updatedTime as notEqual. */ @@ -868,7 +820,7 @@ } /** - * GreaterThan(>). And NullIgnored, OnceRegistered. + * GreaterThan(>). And NullIgnored, OnlyOnceRegistered. * * @param updatedTime The value of updatedTime as greaterThan. */ @@ -877,7 +829,7 @@ } /** - * LessThan(>). And NullIgnored, OnceRegistered. + * LessThan(>). And NullIgnored, OnlyOnceRegistered. * * @param updatedTime The value of updatedTime as lessThan. */ @@ -886,7 +838,7 @@ } /** - * GreaterEqual(>). And NullIgnored, OnceRegistered. + * GreaterEqual(>). And NullIgnored, OnlyOnceRegistered. * * @param updatedTime The value of updatedTime as greaterEqual. */ @@ -895,7 +847,7 @@ } /** - * LessEqual(>). And NullIgnored, OnceRegistered. + * LessEqual(>). And NullIgnored, OnlyOnceRegistered. * * @param updatedTime The value of updatedTime as lessEqual. */ @@ -905,7 +857,7 @@ /** * FromTo($fromDate <= COLUMN_NAME <= $toDate). And NullIgnored, - * OnceRegistered. {NotNull : TIMESTAMP} + * OnlyOnceRegistered. {NotNull : TIMESTAMP} * * @param fromDate The from-date of updatedTime. (Nullable) * @param toDate The to-date of updatedTime. (Nullable) @@ -923,7 +875,7 @@ /** * FromTo($fromDate <= COLUMN_NAME < $toDate + 1). And NullIgnored, - * OnceRegistered. {NotNull : TIMESTAMP} + * OnlyOnceRegistered. {NotNull : TIMESTAMP} * * @param fromDate The from-date of updatedTime. (Nullable) * @param toDate The to-date of updatedTime. (Nullable) @@ -949,7 +901,7 @@ abstract protected ConditionValue getCValueUpdatedTime(); /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {NotNull : + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {NotNull : * VARCHAR(255)} * * @param updatedBy The value of updatedBy as equal. @@ -959,7 +911,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param updatedBy The value of updatedBy as notEqual. */ @@ -968,7 +920,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param updatedBy The value of updatedBy as greaterThan. */ @@ -977,7 +929,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param updatedBy The value of updatedBy as lessThan. */ @@ -986,7 +938,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param updatedBy The value of updatedBy as greaterEqual. */ @@ -995,7 +947,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param updatedBy The value of updatedBy as lessEqual. */ @@ -1004,7 +956,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param updatedBy The value of updatedBy as prefixSearch. */ @@ -1013,20 +965,6 @@ } /** - * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, - * SeveralRegistered. - * - * @param updatedBy The value of updatedBy as likeSearch. - * @param likeSearchOption The option of like-search. (NotNull) - */ - public void setUpdatedBy_LikeSearch( - String updatedBy, - jp.sf.pal.todolist.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. * @@ -1037,27 +975,41 @@ } /** - * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * - * @param updatedBy The collection of updatedBy as inScope. - * @param inScopeOption The option of in-scope. (NotNull) + * @param updatedByList The collection of updatedBy as notInScope. */ - public void setUpdatedBy_InScope( + public void setUpdatedBy_NotInScope(Collection updatedByList) { + regUpdatedBy(CK_NINS, cTL(updatedByList)); + } + + /** + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param updatedBy The value of updatedBy as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) + */ + public void setUpdatedBy_LikeSearch( String updatedBy, - jp.sf.pal.todolist.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(updatedBy), getCValueUpdatedBy(), - "UPDATED_BY", "UpdatedBy", "updatedBy", inScopeOption); + jp.sf.pal.todolist.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(updatedBy), getCValueUpdatedBy(), "UPDATED_BY", + "UpdatedBy", "updatedBy", likeSearchOption); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param updatedByList The collection of updatedBy as notInScope. + * @param updatedBy The value of updatedBy as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setUpdatedBy_NotInScope(Collection updatedByList) { - regUpdatedBy(CK_NINS, cTL(updatedByList)); + public void setUpdatedBy_NotLikeSearch( + String updatedBy, + jp.sf.pal.todolist.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(updatedBy), getCValueUpdatedBy(), "UPDATED_BY", + "UpdatedBy", "updatedBy", likeSearchOption); } protected void regUpdatedBy(ConditionKey key, Object value) { @@ -1073,7 +1025,7 @@ abstract protected ConditionValue getCValueUpdatedBy(); /** - * Equal(=). And NullIgnored, OnceRegistered. {TIMESTAMP} + * Equal(=). And NullIgnored, OnlyOnceRegistered. {TIMESTAMP} * * @param deletedTime The value of deletedTime as equal. */ @@ -1082,7 +1034,7 @@ } /** - * NotEqual(!=). And NullIgnored, OnceRegistered. + * NotEqual(!=). And NullIgnored, OnlyOnceRegistered. * * @param deletedTime The value of deletedTime as notEqual. */ @@ -1091,7 +1043,7 @@ } /** - * GreaterThan(>). And NullIgnored, OnceRegistered. + * GreaterThan(>). And NullIgnored, OnlyOnceRegistered. * * @param deletedTime The value of deletedTime as greaterThan. */ @@ -1100,7 +1052,7 @@ } /** - * LessThan(>). And NullIgnored, OnceRegistered. + * LessThan(>). And NullIgnored, OnlyOnceRegistered. * * @param deletedTime The value of deletedTime as lessThan. */ @@ -1109,7 +1061,7 @@ } /** - * GreaterEqual(>). And NullIgnored, OnceRegistered. + * GreaterEqual(>). And NullIgnored, OnlyOnceRegistered. * * @param deletedTime The value of deletedTime as greaterEqual. */ @@ -1118,7 +1070,7 @@ } /** - * LessEqual(>). And NullIgnored, OnceRegistered. + * LessEqual(>). And NullIgnored, OnlyOnceRegistered. * * @param deletedTime The value of deletedTime as lessEqual. */ @@ -1128,7 +1080,7 @@ /** * FromTo($fromDate <= COLUMN_NAME <= $toDate). And NullIgnored, - * OnceRegistered. {TIMESTAMP} + * OnlyOnceRegistered. {TIMESTAMP} * * @param fromDate The from-date of deletedTime. (Nullable) * @param toDate The to-date of deletedTime. (Nullable) @@ -1146,7 +1098,7 @@ /** * FromTo($fromDate <= COLUMN_NAME < $toDate + 1). And NullIgnored, - * OnceRegistered. {TIMESTAMP} + * OnlyOnceRegistered. {TIMESTAMP} * * @param fromDate The from-date of deletedTime. (Nullable) * @param toDate The to-date of deletedTime. (Nullable) @@ -1160,14 +1112,14 @@ } /** - * IsNull(is null). And OnceRegistered. + * IsNull(is null). And OnlyOnceRegistered. */ public void setDeletedTime_IsNull() { regDeletedTime(CK_ISN, DUMMY_OBJECT); } /** - * IsNotNull(is not null). And OnceRegistered. + * IsNotNull(is not null). And OnlyOnceRegistered. */ public void setDeletedTime_IsNotNull() { regDeletedTime(CK_ISNN, DUMMY_OBJECT); @@ -1186,7 +1138,7 @@ abstract protected ConditionValue getCValueDeletedTime(); /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {VARCHAR(255)} + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {VARCHAR(255)} * * @param deletedBy The value of deletedBy as equal. */ @@ -1195,7 +1147,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param deletedBy The value of deletedBy as notEqual. */ @@ -1204,7 +1156,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param deletedBy The value of deletedBy as greaterThan. */ @@ -1213,7 +1165,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param deletedBy The value of deletedBy as lessThan. */ @@ -1222,7 +1174,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param deletedBy The value of deletedBy as greaterEqual. */ @@ -1231,7 +1183,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param deletedBy The value of deletedBy as lessEqual. */ @@ -1240,7 +1192,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param deletedBy The value of deletedBy as prefixSearch. */ @@ -1249,20 +1201,6 @@ } /** - * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, - * SeveralRegistered. - * - * @param deletedBy The value of deletedBy as likeSearch. - * @param likeSearchOption The option of like-search. (NotNull) - */ - public void setDeletedBy_LikeSearch( - String deletedBy, - jp.sf.pal.todolist.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. * @@ -1273,38 +1211,52 @@ } /** - * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * - * @param deletedBy The collection of deletedBy as inScope. - * @param inScopeOption The option of in-scope. (NotNull) + * @param deletedByList The collection of deletedBy as notInScope. */ - public void setDeletedBy_InScope( + public void setDeletedBy_NotInScope(Collection deletedByList) { + regDeletedBy(CK_NINS, cTL(deletedByList)); + } + + /** + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param deletedBy The value of deletedBy as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) + */ + public void setDeletedBy_LikeSearch( String deletedBy, - jp.sf.pal.todolist.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(deletedBy), getCValueDeletedBy(), - "DELETED_BY", "DeletedBy", "deletedBy", inScopeOption); + jp.sf.pal.todolist.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(deletedBy), getCValueDeletedBy(), "DELETED_BY", + "DeletedBy", "deletedBy", likeSearchOption); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param deletedByList The collection of deletedBy as notInScope. + * @param deletedBy The value of deletedBy as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setDeletedBy_NotInScope(Collection deletedByList) { - regDeletedBy(CK_NINS, cTL(deletedByList)); + public void setDeletedBy_NotLikeSearch( + String deletedBy, + jp.sf.pal.todolist.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(deletedBy), getCValueDeletedBy(), "DELETED_BY", + "DeletedBy", "deletedBy", likeSearchOption); } /** - * IsNull(is null). And OnceRegistered. + * IsNull(is null). And OnlyOnceRegistered. */ public void setDeletedBy_IsNull() { regDeletedBy(CK_ISN, DUMMY_OBJECT); } /** - * IsNotNull(is not null). And OnceRegistered. + * IsNotNull(is not null). And OnlyOnceRegistered. */ public void setDeletedBy_IsNotNull() { regDeletedBy(CK_ISNN, DUMMY_OBJECT); @@ -1322,6 +1274,53 @@ abstract protected ConditionValue getCValueDeletedBy(); + public SSQFunction scalar_Equal() { + return xcreateSSQFunction("="); + } + + public SSQFunction scalar_GreaterEqual() { + return xcreateSSQFunction(">="); + } + + public SSQFunction scalar_GreaterThan() { + return xcreateSSQFunction(">"); + } + + public SSQFunction scalar_LessEqual() { + return xcreateSSQFunction("<="); + } + + public SSQFunction scalar_LessThan() { + return xcreateSSQFunction("<"); + } + + protected SSQFunction xcreateSSQFunction( + final String operand) { + return new SSQFunction( + new SSQSetupper() { + public void setup(String function, + SubQuery subQuery) { + xscalarSubQuery(function, subQuery, operand); + } + }); + } + + protected void xscalarSubQuery(String function, + SubQuery subQuery, String operand) { + assertObjectNotNull("subQuery", subQuery); + TodoCategoryCB cb = new TodoCategoryCB(); + cb.xsetupForScalarSubQuery(); + subQuery.query(cb); + String subQueryPropertyName = keepScalarSubQuery(cb.query()); // for + // saving + // query + // -value. + registerScalarSubQuery(function, cb.query(), subQueryPropertyName, + operand); + } + + public abstract String keepScalarSubQuery(TodoCategoryCQ subQuery); + // Very Internal (for Suppressing Warn about 'Not Use Import') protected String getConditionBeanClassNameInternally() { return TodoCategoryCB.class.getName(); Modified: todolist/trunk/src/main/java/jp/sf/pal/todolist/db/cbean/cq/bs/AbstractBsTodoMappingCQ.java =================================================================== --- todolist/trunk/src/main/java/jp/sf/pal/todolist/db/cbean/cq/bs/AbstractBsTodoMappingCQ.java 2008-12-27 22:20:45 UTC (rev 1632) +++ todolist/trunk/src/main/java/jp/sf/pal/todolist/db/cbean/cq/bs/AbstractBsTodoMappingCQ.java 2008-12-27 22:21:53 UTC (rev 1633) @@ -15,14 +15,12 @@ import jp.sf.pal.todolist.db.cbean.cq.TodoCQ; import jp.sf.pal.todolist.db.cbean.cq.TodoCategoryCQ; import jp.sf.pal.todolist.db.cbean.cq.TodoMappingCQ; -import jp.sf.pal.todolist.db.cbean.cq.UserInfoCQ; /** * The abstract condition-query of TODO_MAPPING. * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public abstract class AbstractBsTodoMappingCQ extends AbstractConditionQuery { //========================================================================== @@ -52,7 +50,8 @@ // ===== /** - * Equal(=). And NullIgnored, OnceRegistered. {PK : ID : NotNull : BIGINT} + * Equal(=). And NullIgnored, OnlyOnceRegistered. {PK : ID : NotNull : + * BIGINT} * * @param id The value of id as equal. */ @@ -61,7 +60,7 @@ } /** - * NotEqual(!=). And NullIgnored, OnceRegistered. + * NotEqual(!=). And NullIgnored, OnlyOnceRegistered. * * @param id The value of id as notEqual. */ @@ -70,7 +69,7 @@ } /** - * GreaterThan(>). And NullIgnored, OnceRegistered. + * GreaterThan(>). And NullIgnored, OnlyOnceRegistered. * * @param id The value of id as greaterThan. */ @@ -79,7 +78,7 @@ } /** - * LessThan(<). And NullIgnored, OnceRegistered. + * LessThan(<). And NullIgnored, OnlyOnceRegistered. * * @param id The value of id as lessThan. */ @@ -88,7 +87,7 @@ } /** - * GreaterEqual(>=). And NullIgnored, OnceRegistered. + * GreaterEqual(>=). And NullIgnored, OnlyOnceRegistered. * * @param id The value of id as greaterEqual. */ @@ -97,7 +96,7 @@ } /** - * LessEqual(<=). And NullIgnored, OnceRegistered. + * LessEqual(<=). And NullIgnored, OnlyOnceRegistered. * * @param id The value of id as lessEqual. */ @@ -126,14 +125,14 @@ } /** - * IsNull(is null). And OnceRegistered. + * IsNull(is null). And OnlyOnceRegistered. */ public void setId_IsNull() { regId(CK_ISN, DUMMY_OBJECT); } /** - * IsNotNull(is not null). And OnceRegistered. + * IsNotNull(is not null). And OnlyOnceRegistered. */ public void setId_IsNotNull() { regId(CK_ISNN, DUMMY_OBJECT); @@ -150,7 +149,7 @@ abstract protected ConditionValue getCValueId(); /** - * Equal(=). And NullIgnored, OnceRegistered. {NotNull : INTEGER} + * Equal(=). And NullIgnored, OnlyOnceRegistered. {NotNull : INTEGER} * * @param status The value of status as equal. */ @@ -159,7 +158,7 @@ } /** - * NotEqual(!=). And NullIgnored, OnceRegistered. + * NotEqual(!=). And NullIgnored, OnlyOnceRegistered. * * @param status The value of status as notEqual. */ @@ -168,7 +167,7 @@ } /** - * GreaterThan(>). And NullIgnored, OnceRegistered. + * GreaterThan(>). And NullIgnored, OnlyOnceRegistered. * * @param status The value of status as greaterThan. */ @@ -177,7 +176,7 @@ } /** - * LessThan(<). And NullIgnored, OnceRegistered. + * LessThan(<). And NullIgnored, OnlyOnceRegistered. * * @param status The value of status as lessThan. */ @@ -186,7 +185,7 @@ } /** - * GreaterEqual(>=). And NullIgnored, OnceRegistered. + * GreaterEqual(>=). And NullIgnored, OnlyOnceRegistered. * * @param status The value of status as greaterEqual. */ @@ -195,7 +194,7 @@ } /** - * LessEqual(<=). And NullIgnored, OnceRegistered. + * LessEqual(<=). And NullIgnored, OnlyOnceRegistered. * * @param status The value of status as lessEqual. */ @@ -236,7 +235,7 @@ abstract protected ConditionValue getCValueStatus(); /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {VARCHAR(255)} + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {VARCHAR(255)} * * @param memo The value of memo as equal. */ @@ -245,7 +244,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param memo The value of memo as notEqual. */ @@ -254,7 +253,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param memo The value of memo as greaterThan. */ @@ -263,7 +262,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param memo The value of memo as lessThan. */ @@ -272,7 +271,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param memo The value of memo as greaterEqual. */ @@ -281,7 +280,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param memo The value of memo as lessEqual. */ @@ -290,7 +289,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param memo The value of memo as prefixSearch. */ @@ -299,20 +298,6 @@ } /** - * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, - * SeveralRegistered. - * - * @param memo The value of memo as likeSearch. - * @param likeSearchOption The option of like-search. (NotNull) - */ - public void setMemo_LikeSearch( - String memo, - jp.sf.pal.todolist.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { - registerLikeSearchQuery(CK_LS, fRES(memo), getCValueMemo(), "MEMO", - "Memo", "memo", likeSearchOption); - } - - /** * InScope(in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * @@ -323,38 +308,52 @@ } /** - * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * - * @param memo The collection of memo as inScope. - * @param inScopeOption The option of in-scope. (NotNull) + * @param memoList The collection of memo as notInScope. */ - public void setMemo_InScope( + public void setMemo_NotInScope(Collection memoList) { + regMemo(CK_NINS, cTL(memoList)); + } + + /** + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param memo The value of memo as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) + */ + public void setMemo_LikeSearch( String memo, - jp.sf.pal.todolist.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(memo), getCValueMemo(), "MEMO", - "Memo", "memo", inScopeOption); + jp.sf.pal.todolist.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(memo), getCValueMemo(), "MEMO", "Memo", "memo", + likeSearchOption); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param memoList The collection of memo as notInScope. + * @param memo The value of memo as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setMemo_NotInScope(Collection memoList) { - regMemo(CK_NINS, cTL(memoList)); + public void setMemo_NotLikeSearch( + String memo, + jp.sf.pal.todolist.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(memo), getCValueMemo(), "MEMO", "Memo", "memo", + likeSearchOption); } /** - * IsNull(is null). And OnceRegistered. + * IsNull(is null). And OnlyOnceRegistered. */ public void setMemo_IsNull() { regMemo(CK_ISN, DUMMY_OBJECT); } /** - * IsNotNull(is not null). And OnceRegistered. + * IsNotNull(is not null). And OnlyOnceRegistered. */ public void setMemo_IsNotNull() { regMemo(CK_ISNN, DUMMY_OBJECT); @@ -371,7 +370,7 @@ abstract protected ConditionValue getCValueMemo(); /** - * Equal(=). And NullIgnored, OnceRegistered. {NotNull : BIGINT : FK to + * Equal(=). And NullIgnored, OnlyOnceRegistered. {NotNull : BIGINT : FK to * TODO} * * @param todoId The value of todoId as equal. @@ -381,7 +380,7 @@ } /** - * NotEqual(!=). And NullIgnored, OnceRegistered. + * NotEqual(!=). And NullIgnored, OnlyOnceRegistered. * * @param todoId The value of todoId as notEqual. */ @@ -390,7 +389,7 @@ } /** - * GreaterThan(>). And NullIgnored, OnceRegistered. + * GreaterThan(>). And NullIgnored, OnlyOnceRegistered. * * @param todoId The value of todoId as greaterThan. */ @@ -399,7 +398,7 @@ } /** - * LessThan(<). And NullIgnored, OnceRegistered. + * LessThan(<). And NullIgnored, OnlyOnceRegistered. * * @param todoId The value of todoId as lessThan. */ @@ -408,7 +407,7 @@ } /** - * GreaterEqual(>=). And NullIgnored, OnceRegistered. + * GreaterEqual(>=). And NullIgnored, OnlyOnceRegistered. * * @param todoId The value of todoId as greaterEqual. */ @@ -417,7 +416,7 @@ } /** - * LessEqual(<=). And NullIgnored, OnceRegistered. + * LessEqual(<=). And NullIgnored, OnlyOnceRegistered. * * @param todoId The value of todoId as lessEqual. */ @@ -445,33 +444,18 @@ regTodoId(CK_NINS, cTL(todoIdList)); } - /** - * @param todoCBquery Query. - * @deprecated Please use inScopeTodo(subQuery) method. - */ - public void setTodoId_InScopeSubQuery_Todo(TodoCQ todoCBquery) { - String subQueryPropertyName = keepTodoId_InScopeSubQuery_Todo(todoCBquery);// for - // saving - // query - // - - // value - // . - registerInScopeSubQuery(todoCBquery, "TODO_ID", "ID", - subQueryPropertyName); - } - public void inScopeTodo(SubQuery subQuery) { assertObjectNotNull("subQuery", subQuery); TodoCB cb = new TodoCB(); cb.xsetupForInScopeSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepTodoId_InScopeSubQuery_Todo(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerInScopeSubQuery(cb.query(), "TODO_ID", "ID", subQueryPropertyName); } - abstract public String keepTodoId_InScopeSubQuery_Todo(TodoCQ subQuery); + public abstract String keepTodoId_InScopeSubQuery_Todo(TodoCQ subQuery); protected void regTodoId(ConditionKey key, Object value) { registerQuery(key, value, getCValueTodoId(), "TODO_ID", "TodoId", @@ -486,8 +470,8 @@ abstract protected ConditionValue getCValueTodoId(); /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {NotNull : VARCHAR(255) - * : FK to USER_INFO} + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {NotNull : + * VARCHAR(255) : FK to USER_INFO} * * @param userId The value of userId as equal. */ @@ -496,7 +480,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param userId The value of userId as notEqual. */ @@ -505,7 +489,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param userId The value of userId as greaterThan. */ @@ -514,7 +498,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param userId The value of userId as lessThan. */ @@ -523,7 +507,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param userId The value of userId as greaterEqual. */ @@ -532,7 +516,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param userId The value of userId as lessEqual. */ @@ -541,7 +525,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param userId The value of userId as prefixSearch. */ @@ -550,20 +534,6 @@ } /** - * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, - * SeveralRegistered. - * - * @param userId The value of userId as likeSearch. - * @param likeSearchOption The option of like-search. (NotNull) - */ - public void setUserId_LikeSearch( - String userId, - jp.sf.pal.todolist.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. * @@ -574,42 +544,41 @@ } /** - * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * - * @param userId The collection of userId as inScope. - * @param inScopeOption The option of in-scope. (NotNull) + * @param userIdList The collection of userId as notInScope. */ - public void setUserId_InScope( - String userId, - jp.sf.pal.todolist.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(userId), getCValueUserId(), - "USER_ID", "UserId", "userId", inScopeOption); + public void setUserId_NotInScope(Collection userIdList) { + regUserId(CK_NINS, cTL(userIdList)); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param userIdList The collection of userId as notInScope. + * @param userId The value of userId as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) */ - public void setUserId_NotInScope(Collection userIdList) { - regUserId(CK_NINS, cTL(userIdList)); + public void setUserId_LikeSearch( + String userId, + jp.sf.pal.todolist.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(userId), getCValueUserId(), "USER_ID", "UserId", + "userId", likeSearchOption); } /** - * @param userInfoCBquery Query. - * @deprecated Please use inScopeUserInfo(subQuery) method. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param userId The value of userId as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setUserId_InScopeSubQuery_UserInfo(UserInfoCQ userInfoCBquery) { - String subQueryPropertyName = keepUserId_InScopeSubQuery_UserInfo(userInfoCBquery);// for - // saving - // query - // - - // value - // . - registerInScopeSubQuery(userInfoCBquery, "USER_ID", "USER_ID", - subQueryPropertyName); + public void setUserId_NotLikeSearch( + String userId, + jp.sf.pal.todolist.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(userId), getCValueUserId(), "USER_ID", "UserId", + "userId", likeSearchOption); } public void inScopeUserInfo(SubQuery subQuery) { @@ -618,12 +587,12 @@ cb.xsetupForInScopeSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepUserId_InScopeSubQuery_UserInfo(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerInScopeSubQuery(cb.query(), "USER_ID", "USER_ID", subQueryPropertyName); } - abstract public String keepUserId_InScopeSubQuery_UserInfo( + public abstract String keepUserId_InScopeSubQuery_UserInfo( jp.sf.pal.todolist.db.cbean.cq.UserInfoCQ subQuery); protected void regUserId(ConditionKey key, Object value) { @@ -639,7 +608,8 @@ abstract protected ConditionValue getCValueUserId(); /** - * Equal(=). And NullIgnored, OnceRegistered. {BIGINT : FK to TODO_CATEGORY} + * Equal(=). And NullIgnored, OnlyOnceRegistered. {BIGINT : FK to + * TODO_CATEGORY} * * @param categoryId The value of categoryId as equal. */ @@ -648,7 +618,7 @@ } /** - * NotEqual(!=). And NullIgnored, OnceRegistered. + * NotEqual(!=). And NullIgnored, OnlyOnceRegistered. * * @param categoryId The value of categoryId as notEqual. */ @@ -657,7 +627,7 @@ } /** - * GreaterThan(>). And NullIgnored, OnceRegistered. + * GreaterThan(>). And NullIgnored, OnlyOnceRegistered. * * @param categoryId The value of categoryId as greaterThan. */ @@ -666,7 +636,7 @@ } /** - * LessThan(<). And NullIgnored, OnceRegistered. + * LessThan(<). And NullIgnored, OnlyOnceRegistered. * * @param categoryId The value of categoryId as lessThan. */ @@ -675,7 +645,7 @@ } /** - * GreaterEqual(>=). And NullIgnored, OnceRegistered. + * GreaterEqual(>=). And NullIgnored, OnlyOnceRegistered. * * @param categoryId The value of categoryId as greaterEqual. */ @@ -684,7 +654,7 @@ } /** - * LessEqual(<=). And NullIgnored, OnceRegistered. + * LessEqual(<=). And NullIgnored, OnlyOnceRegistered. * * @param categoryId The value of categoryId as lessEqual. */ @@ -712,45 +682,29 @@ regCategoryId(CK_NINS, cTL(categoryIdList)); } - /** - * @param todoCategoryCBquery Query. - * @deprecated Please use inScopeTodoCategory(subQuery) method. - */ - public void setCategoryId_InScopeSubQuery_TodoCategory( - TodoCategoryCQ todoCategoryCBquery) { - String subQueryPropertyName = keepCategoryId_InScopeSubQuery_TodoCategory(todoCategoryCBquery);// for - // saving - // query - // - - // value - // . - registerInScopeSubQuery(todoCategoryCBquery, "CATEGORY_ID", "ID", - subQueryPropertyName); - } - public void inScopeTodoCategory(SubQuery subQuery) { assertObjectNotNull("subQuery", subQuery); TodoCategoryCB cb = new TodoCategoryCB(); cb.xsetupForInScopeSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepCategoryId_InScopeSubQuery_TodoCategory(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerInScopeSubQuery(cb.query(), "CATEGORY_ID", "ID", subQueryPropertyName); } - abstract public String keepCategoryId_InScopeSubQuery_TodoCategory( + public abstract String keepCategoryId_InScopeSubQuery_TodoCategory( TodoCategoryCQ subQuery); /** - * IsNull(is null). And OnceRegistered. + * IsNull(is null). And OnlyOnceRegistered. */ public void setCategoryId_IsNull() { regCategoryId(CK_ISN, DUMMY_OBJECT); } /** - * IsNotNull(is not null). And OnceRegistered. + * IsNotNull(is not null). And OnlyOnceRegistered. */ public void setCategoryId_IsNotNull() { regCategoryId(CK_ISNN, DUMMY_OBJECT); @@ -769,7 +723,7 @@ abstract protected ConditionValue getCValueCategoryId(); /** - * Equal(=). And NullIgnored, OnceRegistered. {NotNull : TIMESTAMP} + * Equal(=). And NullIgnored, OnlyOnceRegistered. {NotNull : TIMESTAMP} * * @param createdTime The value of createdTime as equal. */ @@ -778,7 +732,7 @@ } /** - * NotEqual(!=). And NullIgnored, OnceRegistered. + * NotEqual(!=). And NullIgnored, OnlyOnceRegistered. * * @param createdTime The value of createdTime as notEqual. */ @@ -787,7 +741,7 @@ } /** - * GreaterThan(>). And NullIgnored, OnceRegistered. + * GreaterThan(>). And NullIgnored, OnlyOnceRegistered. * * @param createdTime The value of createdTime as greaterThan. */ @@ -796,7 +750,7 @@ } /** - * LessThan(>). And NullIgnored, OnceRegistered. + * LessThan(>). And NullIgnored, OnlyOnceRegistered. * * @param createdTime The value of createdTime as lessThan. */ @@ -805,7 +759,7 @@ } /** - * GreaterEqual(>). And NullIgnored, OnceRegistered. + * GreaterEqual(>). And NullIgnored, OnlyOnceRegistered. * * @param createdTime The value of createdTime as greaterEqual. */ @@ -814,7 +768,7 @@ } /** - * LessEqual(>). And NullIgnored, OnceRegistered. + * LessEqual(>). And NullIgnored, OnlyOnceRegistered. * * @param createdTime The value of createdTime as lessEqual. */ @@ -824,7 +778,7 @@ /** * FromTo($fromDate <= COLUMN_NAME <= $toDate). And NullIgnored, - * OnceRegistered. {NotNull : TIMESTAMP} + * OnlyOnceRegistered. {NotNull : TIMESTAMP} * * @param fromDate The from-date of createdTime. (Nullable) * @param toDate The to-date of createdTime. (Nullable) @@ -842,7 +796,7 @@ /** * FromTo($fromDate <= COLUMN_NAME < $toDate + 1). And NullIgnored, - * OnceRegistered. {NotNull : TIMESTAMP} + * OnlyOnceRegistered. {NotNull : TIMESTAMP} * * @param fromDate The from-date of createdTime. (Nullable) * @param toDate The to-date of createdTime. (Nullable) @@ -868,7 +822,7 @@ abstract protected ConditionValue getCValueCreatedTime(); /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {NotNull : + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {NotNull : * VARCHAR(255)} * * @param createdBy The value of createdBy as equal. @@ -878,7 +832,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param createdBy The value of createdBy as notEqual. */ @@ -887,7 +841,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param createdBy The value of createdBy as greaterThan. */ @@ -896,7 +850,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param createdBy The value of createdBy as lessThan. */ @@ -905,7 +859,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param createdBy The value of createdBy as greaterEqual. */ @@ -914,7 +868,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param createdBy The value of createdBy as lessEqual. */ @@ -923,7 +877,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param createdBy The value of createdBy as prefixSearch. */ @@ -932,20 +886,6 @@ } /** - * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, - * SeveralRegistered. - * - * @param createdBy The value of createdBy as likeSearch. - * @param likeSearchOption The option of like-search. (NotNull) - */ - public void setCreatedBy_LikeSearch( - String createdBy, - jp.sf.pal.todolist.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. * @@ -956,27 +896,41 @@ } /** - * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * - * @param createdBy The collection of createdBy as inScope. - * @param inScopeOption The option of in-scope. (NotNull) + * @param createdByList The collection of createdBy as notInScope. */ - public void setCreatedBy_InScope( + public void setCreatedBy_NotInScope(Collection createdByList) { + regCreatedBy(CK_NINS, cTL(createdByList)); + } + + /** + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param createdBy The value of createdBy as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) + */ + public void setCreatedBy_LikeSearch( String createdBy, - jp.sf.pal.todolist.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(createdBy), getCValueCreatedBy(), - "CREATED_BY", "CreatedBy", "createdBy", inScopeOption); + jp.sf.pal.todolist.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(createdBy), getCValueCreatedBy(), "CREATED_BY", + "CreatedBy", "createdBy", likeSearchOption); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param createdByList The collection of createdBy as notInScope. + * @param createdBy The value of createdBy as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setCreatedBy_NotInScope(Collection createdByList) { - regCreatedBy(CK_NINS, cTL(createdByList)); + public void setCreatedBy_NotLikeSearch( + String createdBy, + jp.sf.pal.todolist.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(createdBy), getCValueCreatedBy(), "CREATED_BY", + "CreatedBy", "createdBy", likeSearchOption); } protected void regCreatedBy(ConditionKey key, Object value) { @@ -992,7 +946,7 @@ abstract protected ConditionValue getCValueCreatedBy(); /** - * Equal(=). And NullIgnored, OnceRegistered. {NotNull : TIMESTAMP} + * Equal(=). And NullIgnored, OnlyOnceRegistered. {NotNull : TIMESTAMP} * * @param updatedTime The value of updatedTime as equal. */ @@ -1001,7 +955,7 @@ } /** - * NotEqual(!=). And NullIgnored, OnceRegistered. + * NotEqual(!=). And NullIgnored, OnlyOnceRegistered. * * @param updatedTime The value of updatedTime as notEqual. */ @@ -1010,7 +964,7 @@ } /** - * GreaterThan(>). And NullIgnored, OnceRegistered. + * GreaterThan(>). And NullIgnored, OnlyOnceRegistered. * * @param updatedTime The value of updatedTime as greaterThan. */ @@ -1019,7 +973,7 @@ } /** - * LessThan(>). And NullIgnored, OnceRegistered. + * LessThan(>). And NullIgnored, OnlyOnceRegistered. * * @param updatedTime The value of updatedTime as lessThan. */ @@ -1028,7 +982,7 @@ } /** - * GreaterEqual(>). And NullIgnored, OnceRegistered. + * GreaterEqual(>). And NullIgnored, OnlyOnceRegistered. * * @param updatedTime The value of updatedTime as greaterEqual. */ @@ -1037,7 +991,7 @@ } /** - * LessEqual(>). And NullIgnored, OnceRegistered. + * LessEqual(>). And NullIgnored, OnlyOnceRegistered. * * @param updatedTime The value of updatedTime as lessEqual. */ @@ -1047,7 +1001,7 @@ /** * FromTo($fromDate <= COLUMN_NAME <= $toDate). And NullIgnored, - * OnceRegistered. {NotNull : TIMESTAMP} + * OnlyOnceRegistered. {NotNull : TIMESTAMP} * * @param fromDate The from-date of updatedTime. (Nullable) * @param toDate The to-date of updatedTime. (Nullable) @@ -1065,7 +1019,7 @@ /** * FromTo($fromDate <= COLUMN_NAME < $toDate + 1). And NullIgnored, - * OnceRegistered. {NotNull : TIMESTAMP} + * OnlyOnceRegistered. {NotNull : TIMESTAMP} * * @param fromDate The from-date of updatedTime. (Nullable) * @param toDate The to-date of updatedTime. (Nullable) @@ -1091,7 +1045,7 @@ abstract protected ConditionValue getCValueUpdatedTime(); /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {NotNull : + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {NotNull : * VARCHAR(255)} * * @param updatedBy The value of updatedBy as equal. @@ -1101,7 +1055,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param updatedBy The value of updatedBy as notEqual. */ @@ -1110,7 +1064,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param updatedBy The value of updatedBy as greaterThan. */ @@ -1119,7 +1073,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param updatedBy The value of updatedBy as lessThan. */ @@ -1128,7 +1082,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param updatedBy The value of updatedBy as greaterEqual. */ @@ -1137,7 +1091,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param updatedBy The value of updatedBy as lessEqual. */ @@ -1146,7 +1100,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param updatedBy The value of updatedBy as prefixSearch. */ @@ -1155,20 +1109,6 @@ } /** - * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, - * SeveralRegistered. - * - * @param updatedBy The value of updatedBy as likeSearch. - * @param likeSearchOption The option of like-search. (NotNull) - */ - public void setUpdatedBy_LikeSearch( - String updatedBy, - jp.sf.pal.todolist.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. * @@ -1179,27 +1119,41 @@ } /** - * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * - * @param updatedBy The collection of updatedBy as inScope. - * @param inScopeOption The option of in-scope. (NotNull) + * @param updatedByList The collection of updatedBy as notInScope. */ - public void setUpdatedBy_InScope( + public void setUpdatedBy_NotInScope(Collection updatedByList) { + regUpdatedBy(CK_NINS, cTL(updatedByList)); + } + + /** + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param updatedBy The value of updatedBy as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) + */ + public void setUpdatedBy_LikeSearch( String updatedBy, - jp.sf.pal.todolist.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(updatedBy), getCValueUpdatedBy(), - "UPDATED_BY", "UpdatedBy", "updatedBy", inScopeOption); + jp.sf.pal.todolist.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(updatedBy), getCValueUpdatedBy(), "UPDATED_BY", + "UpdatedBy", "updatedBy", likeSearchOption); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param updatedByList The collection of updatedBy as notInScope. + * @param updatedBy The value of updatedBy as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setUpdatedBy_NotInScope(Collection updatedByList) { - regUpdatedBy(CK_NINS, cTL(updatedByList)); + public void setUpdatedBy_NotLikeSearch( + String updatedBy, + jp.sf.pal.todolist.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(updatedBy), getCValueUpdatedBy(), "UPDATED_BY", + "UpdatedBy", "updatedBy", likeSearchOption); } protected void regUpdatedBy(ConditionKey key, Object value) { @@ -1215,7 +1169,7 @@ abstract protected ConditionValue getCValueUpdatedBy(); /** - * Equal(=). And NullIgnored, OnceRegistered. {TIMESTAMP} + * Equal(=). And NullIgnored, OnlyOnceRegistered. {TIMESTAMP} * * @param deletedTime The value of deletedTime as equal. */ @@ -1224,7 +1178,7 @@ } /** - * NotEqual(!=). And NullIgnored, OnceRegistered. + * NotEqual(!=). And NullIgnored, OnlyOnceRegistered. * * @param deletedTime The value of deletedTime as notEqual. */ @@ -1233,7 +1187,7 @@ } /** - * GreaterThan(>). And NullIgnored, OnceRegistered. + * GreaterThan(>). And NullIgnored, OnlyOnceRegistered. * * @param deletedTime The value of deletedTime as greaterThan. */ @@ -1242,7 +1196,7 @@ } /** - * LessThan(>). And NullIgnored, OnceRegistered. + * LessThan(>). And NullIgnored, OnlyOnceRegistered. * * @param deletedTime The value of deletedTime as lessThan. */ @@ -1251,7 +1205,7 @@ } /** - * GreaterEqual(>). And NullIgnored, OnceRegistered. + * GreaterEqual(>). And NullIgnored, OnlyOnceRegistered. * * @param deletedTime The value of deletedTime as greaterEqual. */ @@ -1260,7 +1214,7 @@ } /** - * LessEqual(>). And NullIgnored, OnceRegistered. + * LessEqual(>). And NullIgnored, OnlyOnceRegistered. * * @param deletedTime The value of deletedTime as lessEqual. */ @@ -1270,7 +1224,7 @@ /** * FromTo($fromDate <= COLUMN_NAME <= $toDate). And NullIgnored, - * OnceRegistered. {TIMESTAMP} + * OnlyOnceRegistered. {TIMESTAMP} * * @param fromDate The from-date of deletedTime. (Nullable) * @param toDate The to-date of deletedTime. (Nullable) @@ -1288,7 +1242,7 @@ /** * FromTo($fromDate <= COLUMN_NAME < $toDate + 1). And NullIgnored, - * OnceRegistered. {TIMESTAMP} + * OnlyOnceRegistered. {TIMESTAMP} * * @param fromDate The from-date of deletedTime. (Nullable) * @param toDate The to-date of deletedTime. (Nullable) @@ -1302,14 +1256,14 @@ } /** - * IsNull(is null). And OnceRegistered. + * IsNull(is null). And OnlyOnceRegistered. */ public void setDeletedTime_IsNull() { regDeletedTime(CK_ISN, DUMMY_OBJECT); } /** - * IsNotNull(is not null). And OnceRegistered. + * IsNotNull(is not null). And OnlyOnceRegistered. */ public void setDeletedTime_IsNotNull() { regDeletedTime(CK_ISNN, DUMMY_OBJECT); @@ -1328,7 +1282,7 @@ abstract protected ConditionValue getCValueDeletedTime(); /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {VARCHAR(255)} + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {VARCHAR(255)} * * @param deletedBy The value of deletedBy as equal. */ @@ -1337,7 +1291,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param deletedBy The value of deletedBy as notEqual. */ @@ -1346,7 +1300,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param deletedBy The value of deletedBy as greaterThan. */ @@ -1355,7 +1309,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param deletedBy The value of deletedBy as lessThan. */ @@ -1364,7 +1318,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param deletedBy The value of deletedBy as greaterEqual. */ @@ -1373,7 +1327,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param deletedBy The value of deletedBy as lessEqual. */ @@ -1382,7 +1336,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param deletedBy The value of deletedBy as prefixSearch. */ @@ -1391,20 +1345,6 @@ } /** - * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, - * SeveralRegistered. - * - * @param deletedBy The value of deletedBy as likeSearch. - * @param likeSearchOption The option of like-search. (NotNull) - */ - public void setDeletedBy_LikeSearch( - String deletedBy, - jp.sf.pal.todolist.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. * @@ -1415,38 +1355,52 @@ } /** - * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * - * @param deletedBy The collection of deletedBy as inScope. - * @param inScopeOption The option of in-scope. (NotNull) + * @param deletedByList The collection of deletedBy as notInScope. */ - public void setDeletedBy_InScope( + public void setDeletedBy_NotInScope(Collection deletedByList) { + regDeletedBy(CK_NINS, cTL(deletedByList)); + } + + /** + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param deletedBy The value of deletedBy as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) + */ + public void setDeletedBy_LikeSearch( String deletedBy, - jp.sf.pal.todolist.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(deletedBy), getCValueDeletedBy(), - "DELETED_BY", "DeletedBy", "deletedBy", inScopeOption); + jp.sf.pal.todolist.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(deletedBy), getCValueDeletedBy(), "DELETED_BY", + "DeletedBy", "deletedBy", likeSearchOption); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param deletedByList The collection of deletedBy as notInScope. + * @param deletedBy The value of deletedBy as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setDeletedBy_NotInScope(Collection deletedByList) { - regDeletedBy(CK_NINS, cTL(deletedByList)); + public void setDeletedBy_NotLikeSearch( + String deletedBy, + jp.sf.pal.todolist.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(deletedBy), getCValueDeletedBy(), "DELETED_BY", + "DeletedBy", "deletedBy", likeSearchOption); } /** - * IsNull(is null). And OnceRegistered. + * IsNull(is null). And OnlyOnceRegistered. */ public void setDeletedBy_IsNull() { regDeletedBy(CK_ISN, DUMMY_OBJECT); } /** - * IsNotNull(is not null). And OnceRegistered. + * IsNotNull(is not null). And OnlyOnceRegistered. */ public void setDeletedBy_IsNotNull() { regDeletedBy(CK_ISNN, DUMMY_OBJECT); @@ -1465,7 +1419,7 @@ abstract protected ConditionValue getCValueDeletedBy(); /** - * Equal(=). And NullIgnored, OnceRegistered. {NotNull : INTEGER} + * Equal(=). And NullIgnored, OnlyOnceRegistered. {NotNull : INTEGER} * * @param versionno The value of versionno as equal. */ @@ -1474,7 +1428,7 @@ } /** - * NotEqual(!=). And NullIgnored, OnceRegistered. + * NotEqual(!=). And NullIgnored, OnlyOnceRegistered. * * @param versionno The value of versionno as notEqual. */ @@ -1483,7 +1437,7 @@ } /** - * GreaterThan(>). And NullIgnored, OnceRegistered. + * GreaterThan(>). And NullIgnored, OnlyOnceRegistered. * * @param versionno The value of versionno as greaterThan. */ @@ -1492,7 +1446,7 @@ } /** - * LessThan(<). And NullIgnored, OnceRegistered. + * LessThan(<). And NullIgnored, OnlyOnceRegistered. * * @param versionno The value of versionno as lessThan. */ @@ -1501,7 +1455,7 @@ } /** - * GreaterEqual(>=). And NullIgnored, OnceRegistered. + * GreaterEqual(>=). And NullIgnored, OnlyOnceRegistered. * * @param versionno The value of versionno as greaterEqual. */ @@ -1510,7 +1464,7 @@ } /** - * LessEqual(<=). And NullIgnored, OnceRegistered. + * LessEqual(<=). And NullIgnored, OnlyOnceRegistered. * * @param versionno The value of versionno as lessEqual. */ @@ -1550,6 +1504,50 @@ abstract protected ConditionValue getCValueVersionno(); + public SSQFunction scalar_Equal() { + return xcreateSSQFunction("="); + } + + public SSQFunction scalar_GreaterEqual() { + return xcreateSSQFunction(">="); + } + + public SSQFunction scalar_GreaterThan() { + return xcreateSSQFunction(">"); + } + + public SSQFunction scalar_LessEqual() { + return xcreateSSQFunction("<="); + } + + public SSQFunction scalar_LessThan() { + return xcreateSSQFunction("<"); + } + + protected SSQFunction xcreateSSQFunction(final String operand) { + return new SSQFunction(new SSQSetupper() { + public void setup(String function, SubQuery subQuery) { + xscalarSubQuery(function, subQuery, operand); + } + }); + } + + protected void xscalarSubQuery(String function, + SubQuery subQuery, String operand) { + assertObjectNotNull("subQuery", subQuery); + TodoMappingCB cb = new TodoMappingCB(); + cb.xsetupForScalarSubQuery(); + subQuery.query(cb); + String subQueryPropertyName = keepScalarSubQuery(cb.query()); // for + // saving + // query + // -value. + registerScalarSubQuery(function, cb.query(), subQueryPropertyName, + operand); + } + + public abstract String keepScalarSubQuery(TodoMappingCQ subQuery); + // Very Internal (for Suppressing Warn about 'Not Use Import') protected String getConditionBeanClassNameInternally() { return TodoMappingCB.class.getName(); Modified: todolist/trunk/src/main/java/jp/sf/pal/todolist/db/cbean/cq/bs/AbstractBsUserInfoCQ.java =================================================================== --- todolist/trunk/src/main/java/jp/sf/pal/todolist/db/cbean/cq/bs/AbstractBsUserInfoCQ.java 2008-12-27 22:20:45 UTC (rev 1632) +++ todolist/trunk/src/main/java/jp/sf/pal/todolist/db/cbean/cq/bs/AbstractBsUserInfoCQ.java 2008-12-27 22:21:53 UTC (rev 1633) @@ -16,9 +16,7 @@ import jp.sf.pal.todolist.db.cbean.TodoCategoryCB; import jp.sf.pal.todolist.db.cbean.TodoMappingCB; import jp.sf.pal.todolist.db.cbean.UserInfoCB; -import jp.sf.pal.todolist.db.cbean.cq.GroupInfoCQ; import jp.sf.pal.todolist.db.cbean.cq.GroupMappingCQ; -import jp.sf.pal.todolist.db.cbean.cq.RoleInfoCQ; import jp.sf.pal.todolist.db.cbean.cq.RoleMappingCQ; import jp.sf.pal.todolist.db.cbean.cq.TodoCQ; import jp.sf.pal.todolist.db.cbean.cq.TodoCategoryCQ; @@ -30,7 +28,6 @@ * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public abstract class AbstractBsUserInfoCQ extends AbstractConditionQuery { //========================================================================== @@ -60,7 +57,7 @@ // ===== /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {PK : NotNull : + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {PK : NotNull : * VARCHAR(255)} * * @param userId The value of userId as equal. @@ -70,7 +67,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param userId The value of userId as notEqual. */ @@ -79,7 +76,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param userId The value of userId as greaterThan. */ @@ -88,7 +85,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param userId The value of userId as lessThan. */ @@ -97,7 +94,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param userId The value of userId as greaterEqual. */ @@ -106,7 +103,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param userId The value of userId as lessEqual. */ @@ -115,7 +112,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param userId The value of userId as prefixSearch. */ @@ -124,20 +121,6 @@ } /** - * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, - * SeveralRegistered. - * - * @param userId The value of userId as likeSearch. - * @param likeSearchOption The option of like-search. (NotNull) - */ - public void setUserId_LikeSearch( - String userId, - jp.sf.pal.todolist.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. * @@ -148,43 +131,41 @@ } /** - * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * - * @param userId The collection of userId as inScope. - * @param inScopeOption The option of in-scope. (NotNull) + * @param userIdList The collection of userId as notInScope. */ - public void setUserId_InScope( - String userId, - jp.sf.pal.todolist.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(userId), getCValueUserId(), - "USER_ID", "UserId", "userId", inScopeOption); + public void setUserId_NotInScope(Collection userIdList) { + regUserId(CK_NINS, cTL(userIdList)); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param userIdList The collection of userId as notInScope. + * @param userId The value of userId as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) */ - public void setUserId_NotInScope(Collection userIdList) { - regUserId(CK_NINS, cTL(userIdList)); + public void setUserId_LikeSearch( + String userId, + jp.sf.pal.todolist.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(userId), getCValueUserId(), "USER_ID", "UserId", + "userId", likeSearchOption); } /** - * @param groupMappingCBquery Query. - * @deprecated Please use inScopeGroupMappingList(subQuery) method. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param userId The value of userId as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setUserId_InScopeSubQuery_GroupMappingList( - GroupMappingCQ groupMappingCBquery) { - String subQueryPropertyName = keepUserId_InScopeSubQuery_GroupMappingList(groupMappingCBquery);// for - // saving - // query - // - - // value - // . - registerInScopeSubQuery(groupMappingCBquery, "USER_ID", "USER_ID", - subQueryPropertyName); + public void setUserId_NotLikeSearch( + String userId, + jp.sf.pal.todolist.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(userId), getCValueUserId(), "USER_ID", "UserId", + "userId", likeSearchOption); } public void inScopeGroupMappingList(SubQuery subQuery) { @@ -193,130 +174,67 @@ cb.xsetupForInScopeSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepUserId_InScopeSubQuery_GroupMappingList(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerInScopeSubQuery(cb.query(), "USER_ID", "USER_ID", subQueryPropertyName); } - abstract public String keepUserId_InScopeSubQuery_GroupMappingList( + public abstract String keepUserId_InScopeSubQuery_GroupMappingList( GroupMappingCQ subQuery); - /** - * @param roleMappingCBquery Query. - * @deprecated Please use inScopeRoleMappingList(subQuery) method. - */ - public void setUserId_InScopeSubQuery_RoleMappingList( - RoleMappingCQ roleMappingCBquery) { - String subQueryPropertyName = keepUserId_InScopeSubQuery_RoleMappingList(roleMappingCBquery);// for - // saving - // query - // - - // value - // . - registerInScopeSubQuery(roleMappingCBquery, "USER_ID", "USER_ID", - subQueryPropertyName); - } - public void inScopeRoleMappingList(SubQuery subQuery) { assertObjectNotNull("subQuery", subQuery); RoleMappingCB cb = new RoleMappingCB(); cb.xsetupForInScopeSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepUserId_InScopeSubQuery_RoleMappingList(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerInScopeSubQuery(cb.query(), "USER_ID", "USER_ID", subQueryPropertyName); } - abstract public String keepUserId_InScopeSubQuery_RoleMappingList( + public abstract String keepUserId_InScopeSubQuery_RoleMappingList( RoleMappingCQ subQuery); - /** - * @param todoCBquery Query. - * @deprecated Please use inScopeTodoList(subQuery) method. - */ - public void setUserId_InScopeSubQuery_TodoList(TodoCQ todoCBquery) { - String subQueryPropertyName = keepUserId_InScopeSubQuery_TodoList(todoCBquery);// for - // saving - // query - // - - // value - // . - registerInScopeSubQuery(todoCBquery, "USER_ID", "CREATED_BY", - subQueryPropertyName); - } - public void inScopeTodoList(SubQuery subQuery) { assertObjectNotNull("subQuery", subQuery); TodoCB cb = new TodoCB(); cb.xsetupForInScopeSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepUserId_InScopeSubQuery_TodoList(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerInScopeSubQuery(cb.query(), "USER_ID", "CREATED_BY", subQueryPropertyName); } - abstract public String keepUserId_InScopeSubQuery_TodoList(TodoCQ subQuery); + public abstract String keepUserId_InScopeSubQuery_TodoList(TodoCQ subQuery); - /** - * @param todoCategoryCBquery Query. - * @deprecated Please use inScopeTodoCategoryList(subQuery) method. - */ - public void setUserId_InScopeSubQuery_TodoCategoryList( - TodoCategoryCQ todoCategoryCBquery) { - String subQueryPropertyName = keepUserId_InScopeSubQuery_TodoCategoryList(todoCategoryCBquery);// for - // saving - // query - // - - // value - // . - registerInScopeSubQuery(todoCategoryCBquery, "USER_ID", "USER_ID", - subQueryPropertyName); - } - public void inScopeTodoCategoryList(SubQuery subQuery) { assertObjectNotNull("subQuery", subQuery); TodoCategoryCB cb = new TodoCategoryCB(); cb.xsetupForInScopeSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepUserId_InScopeSubQuery_TodoCategoryList(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerInScopeSubQuery(cb.query(), "USER_ID", "USER_ID", subQueryPropertyName); } - abstract public String keepUserId_InScopeSubQuery_TodoCategoryList( + public abstract String keepUserId_InScopeSubQuery_TodoCategoryList( TodoCategoryCQ subQuery); - /** - * @param todoMappingCBquery Query. - * @deprecated Please use inScopeTodoMappingList(subQuery) method. - */ - public void setUserId_InScopeSubQuery_TodoMappingList( - TodoMappingCQ todoMappingCBquery) { - String subQueryPropertyName = keepUserId_InScopeSubQuery_TodoMappingList(todoMappingCBquery);// for - // saving - // query - // - - // value - // . - registerInScopeSubQuery(todoMappingCBquery, "USER_ID", "USER_ID", - subQueryPropertyName); - } - public void inScopeTodoMappingList(SubQuery subQuery) { assertObjectNotNull("subQuery", subQuery); TodoMappingCB cb = new TodoMappingCB(); cb.xsetupForInScopeSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepUserId_InScopeSubQuery_TodoMappingList(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerInScopeSubQuery(cb.query(), "USER_ID", "USER_ID", subQueryPropertyName); } - abstract public String keepUserId_InScopeSubQuery_TodoMappingList( + public abstract String keepUserId_InScopeSubQuery_TodoMappingList( TodoMappingCQ subQuery); public void notInScopeGroupMappingList(SubQuery subQuery) { @@ -325,12 +243,12 @@ cb.xsetupForInScopeSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepUserId_NotInScopeSubQuery_GroupMappingList(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerNotInScopeSubQuery(cb.query(), "USER_ID", "USER_ID", subQueryPropertyName); } - abstract public String keepUserId_NotInScopeSubQuery_GroupMappingList( + public abstract String keepUserId_NotInScopeSubQuery_GroupMappingList( GroupMappingCQ subQuery); public void notInScopeRoleMappingList(SubQuery subQuery) { @@ -339,12 +257,12 @@ cb.xsetupForInScopeSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepUserId_NotInScopeSubQuery_RoleMappingList(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerNotInScopeSubQuery(cb.query(), "USER_ID", "USER_ID", subQueryPropertyName); } - abstract public String keepUserId_NotInScopeSubQuery_RoleMappingList( + public abstract String keepUserId_NotInScopeSubQuery_RoleMappingList( RoleMappingCQ subQuery); public void notInScopeTodoList(SubQuery subQuery) { @@ -353,12 +271,12 @@ cb.xsetupForInScopeSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepUserId_NotInScopeSubQuery_TodoList(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerNotInScopeSubQuery(cb.query(), "USER_ID", "CREATED_BY", subQueryPropertyName); } - abstract public String keepUserId_NotInScopeSubQuery_TodoList( + public abstract String keepUserId_NotInScopeSubQuery_TodoList( TodoCQ subQuery); public void notInScopeTodoCategoryList(SubQuery subQuery) { @@ -367,12 +285,12 @@ cb.xsetupForInScopeSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepUserId_NotInScopeSubQuery_TodoCategoryList(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerNotInScopeSubQuery(cb.query(), "USER_ID", "USER_ID", subQueryPropertyName); } - abstract public String keepUserId_NotInScopeSubQuery_TodoCategoryList( + public abstract String keepUserId_NotInScopeSubQuery_TodoCategoryList( TodoCategoryCQ subQuery); public void notInScopeTodoMappingList(SubQuery subQuery) { @@ -381,31 +299,15 @@ cb.xsetupForInScopeSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepUserId_NotInScopeSubQuery_TodoMappingList(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerNotInScopeSubQuery(cb.query(), "USER_ID", "USER_ID", subQueryPropertyName); } - abstract public String keepUserId_NotInScopeSubQuery_TodoMappingList( + public abstract String keepUserId_NotInScopeSubQuery_TodoMappingList( TodoMappingCQ 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 ...)} * @@ -418,31 +320,15 @@ cb.xsetupForExistsSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepUserId_ExistsSubQuery_GroupMappingList(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerExistsSubQuery(cb.query(), "USER_ID", "USER_ID", subQueryPropertyName); } - abstract public String keepUserId_ExistsSubQuery_GroupMappingList( + public abstract String keepUserId_ExistsSubQuery_GroupMappingList( GroupMappingCQ subQuery); /** - * @param roleMappingCBquery Query. - * @deprecated Please use existsRoleMappingList(subQuery) method. - */ - public void setUserId_ExistsSubQuery_RoleMappingList( - RoleMappingCQ roleMappingCBquery) { - String subQueryPropertyName = keepUserId_ExistsSubQuery_RoleMappingList(roleMappingCBquery);// for - // saving - // query - // - - // value - // . - registerExistsSubQuery(roleMappingCBquery, "USER_ID", "USER_ID", - subQueryPropertyName); - } - - /** * Set up 'exists' sub-query. {exists (select USER_ID from ROLE_MAPPING * where ...)} * @@ -455,30 +341,15 @@ cb.xsetupForExistsSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepUserId_ExistsSubQuery_RoleMappingList(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerExistsSubQuery(cb.query(), "USER_ID", "USER_ID", subQueryPropertyName); } - abstract public String keepUserId_ExistsSubQuery_RoleMappingList( + public abstract String keepUserId_ExistsSubQuery_RoleMappingList( RoleMappingCQ subQuery); /** - * @param todoCBquery Query. - * @deprecated Please use existsTodoList(subQuery) method. - */ - public void setUserId_ExistsSubQuery_TodoList(TodoCQ todoCBquery) { - String subQueryPropertyName = keepUserId_ExistsSubQuery_TodoList(todoCBquery);// for - // saving - // query - // - - // value - // . - registerExistsSubQuery(todoCBquery, "USER_ID", "CREATED_BY", - subQueryPropertyName); - } - - /** * Set up 'exists' sub-query. {exists (select CREATED_BY from TODO where * ...)} * @@ -491,30 +362,14 @@ cb.xsetupForExistsSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepUserId_ExistsSubQuery_TodoList(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerExistsSubQuery(cb.query(), "USER_ID", "CREATED_BY", subQueryPropertyName); } - abstract public String keepUserId_ExistsSubQuery_TodoList(TodoCQ subQuery); + public abstract String keepUserId_ExistsSubQuery_TodoList(TodoCQ subQuery); /** - * @param todoCategoryCBquery Query. - * @deprecated Please use existsTodoCategoryList(subQuery) method. - */ - public void setUserId_ExistsSubQuery_TodoCategoryList( - TodoCategoryCQ todoCategoryCBquery) { - String subQueryPropertyName = keepUserId_ExistsSubQuery_TodoCategoryList(todoCategoryCBquery);// for - // saving - // query - // - - // value - // . - registerExistsSubQuery(todoCategoryCBquery, "USER_ID", "USER_ID", - subQueryPropertyName); - } - - /** * Set up 'exists' sub-query. {exists (select USER_ID from TODO_CATEGORY * where ...)} * @@ -527,31 +382,15 @@ cb.xsetupForExistsSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepUserId_ExistsSubQuery_TodoCategoryList(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerExistsSubQuery(cb.query(), "USER_ID", "USER_ID", subQueryPropertyName); } - abstract public String keepUserId_ExistsSubQuery_TodoCategoryList( + public abstract String keepUserId_ExistsSubQuery_TodoCategoryList( TodoCategoryCQ subQuery); /** - * @param todoMappingCBquery Query. - * @deprecated Please use existsTodoMappingList(subQuery) method. - */ - public void setUserId_ExistsSubQuery_TodoMappingList( - TodoMappingCQ todoMappingCBquery) { - String subQueryPropertyName = keepUserId_ExistsSubQuery_TodoMappingList(todoMappingCBquery);// for - // saving - // query - // - - // value - // . - registerExistsSubQuery(todoMappingCBquery, "USER_ID", "USER_ID", - subQueryPropertyName); - } - - /** * Set up 'exists' sub-query. {exists (select USER_ID from TODO_MAPPING * where ...)} * @@ -564,12 +403,12 @@ cb.xsetupForExistsSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepUserId_ExistsSubQuery_TodoMappingList(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerExistsSubQuery(cb.query(), "USER_ID", "USER_ID", subQueryPropertyName); } - abstract public String keepUserId_ExistsSubQuery_TodoMappingList( + public abstract String keepUserId_ExistsSubQuery_TodoMappingList( TodoMappingCQ subQuery); /** @@ -586,12 +425,12 @@ cb.xsetupForExistsSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepUserId_NotExistsSubQuery_GroupMappingList(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerNotExistsSubQuery(cb.query(), "USER_ID", "USER_ID", subQueryPropertyName); } - abstract public String keepUserId_NotExistsSubQuery_GroupMappingList( + public abstract String keepUserId_NotExistsSubQuery_GroupMappingList( GroupMappingCQ subQuery); /** @@ -607,12 +446,12 @@ cb.xsetupForExistsSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepUserId_NotExistsSubQuery_RoleMappingList(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerNotExistsSubQuery(cb.query(), "USER_ID", "USER_ID", subQueryPropertyName); } - abstract public String keepUserId_NotExistsSubQuery_RoleMappingList( + public abstract String keepUserId_NotExistsSubQuery_RoleMappingList( RoleMappingCQ subQuery); /** @@ -628,12 +467,12 @@ cb.xsetupForExistsSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepUserId_NotExistsSubQuery_TodoList(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerNotExistsSubQuery(cb.query(), "USER_ID", "CREATED_BY", subQueryPropertyName); } - abstract public String keepUserId_NotExistsSubQuery_TodoList(TodoCQ subQuery); + public abstract String keepUserId_NotExistsSubQuery_TodoList(TodoCQ subQuery); /** * Set up 'not exists' sub-query. {not exists (select USER_ID from @@ -649,12 +488,12 @@ cb.xsetupForExistsSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepUserId_NotExistsSubQuery_TodoCategoryList(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerNotExistsSubQuery(cb.query(), "USER_ID", "USER_ID", subQueryPropertyName); } - abstract public String keepUserId_NotExistsSubQuery_TodoCategoryList( + public abstract String keepUserId_NotExistsSubQuery_TodoCategoryList( TodoCategoryCQ subQuery); /** @@ -670,97 +509,97 @@ cb.xsetupForExistsSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepUserId_NotExistsSubQuery_TodoMappingList(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerNotExistsSubQuery(cb.query(), "USER_ID", "USER_ID", subQueryPropertyName); } - abstract public String keepUserId_NotExistsSubQuery_TodoMappingList( + public abstract String keepUserId_NotExistsSubQuery_TodoMappingList( TodoMappingCQ subQuery); public void xderiveGroupMappingList(String function, SubQuery subQuery, String aliasName) { assertObjectNotNull("subQuery", subQuery); GroupMappingCB cb = new GroupMappingCB(); - cb.xsetupForDeriveReferrer(); + cb.xsetupForDerivedReferrer(); subQuery.query(cb); - String subQueryPropertyName = keepUserId_DeriveSubQuery_GroupMappingList(cb - .query());// for saving query-value. - registerDeriveSubQuery(function, cb.query(), "USER_ID", "USER_ID", - subQueryPropertyName, aliasName); + String subQueryPropertyName = keepUserId_DerivedReferrer_GroupMappingList(cb + .query()); // for saving query-value. + registerDerivedReferrerSubQuery(function, cb.query(), "USER_ID", + "USER_ID", subQueryPropertyName, aliasName); } - abstract public String keepUserId_DeriveSubQuery_GroupMappingList( + public abstract String keepUserId_DerivedReferrer_GroupMappingList( GroupMappingCQ subQuery); public void xderiveRoleMappingList(String function, SubQuery subQuery, String aliasName) { assertObjectNotNull("subQuery", subQuery); RoleMappingCB cb = new RoleMappingCB(); - cb.xsetupForDeriveReferrer(); + cb.xsetupForDerivedReferrer(); subQuery.query(cb); - String subQueryPropertyName = keepUserId_DeriveSubQuery_RoleMappingList(cb - .query());// for saving query-value. - registerDeriveSubQuery(function, cb.query(), "USER_ID", "USER_ID", - subQueryPropertyName, aliasName); + String subQueryPropertyName = keepUserId_DerivedReferrer_RoleMappingList(cb + .query()); // for saving query-value. + registerDerivedReferrerSubQuery(function, cb.query(), "USER_ID", + "USER_ID", subQueryPropertyName, aliasName); } - abstract public String keepUserId_DeriveSubQuery_RoleMappingList( + public abstract String keepUserId_DerivedReferrer_RoleMappingList( RoleMappingCQ subQuery); public void xderiveTodoList(String function, SubQuery subQuery, String aliasName) { assertObjectNotNull("subQuery", subQuery); TodoCB cb = new TodoCB(); - cb.xsetupForDeriveReferrer(); + cb.xsetupForDerivedReferrer(); subQuery.query(cb); - String subQueryPropertyName = keepUserId_DeriveSubQuery_TodoList(cb - .query());// for saving query-value. - registerDeriveSubQuery(function, cb.query(), "USER_ID", "CREATED_BY", - subQueryPropertyName, aliasName); + String subQueryPropertyName = keepUserId_DerivedReferrer_TodoList(cb + .query()); // for saving query-value. + registerDerivedReferrerSubQuery(function, cb.query(), "USER_ID", + "CREATED_BY", subQueryPropertyName, aliasName); } - abstract public String keepUserId_DeriveSubQuery_TodoList(TodoCQ subQuery); + public abstract String keepUserId_DerivedReferrer_TodoList(TodoCQ subQuery); public void xderiveTodoCategoryList(String function, SubQuery subQuery, String aliasName) { assertObjectNotNull("subQuery", subQuery); TodoCategoryCB cb = new TodoCategoryCB(); - cb.xsetupForDeriveReferrer(); + cb.xsetupForDerivedReferrer(); subQuery.query(cb); - String subQueryPropertyName = keepUserId_DeriveSubQuery_TodoCategoryList(cb - .query());// for saving query-value. - registerDeriveSubQuery(function, cb.query(), "USER_ID", "USER_ID", - subQueryPropertyName, aliasName); + String subQueryPropertyName = keepUserId_DerivedReferrer_TodoCategoryList(cb + .query()); // for saving query-value. + registerDerivedReferrerSubQuery(function, cb.query(), "USER_ID", + "USER_ID", subQueryPropertyName, aliasName); } - abstract public String keepUserId_DeriveSubQuery_TodoCategoryList( + public abstract String keepUserId_DerivedReferrer_TodoCategoryList( TodoCategoryCQ subQuery); public void xderiveTodoMappingList(String function, SubQuery subQuery, String aliasName) { assertObjectNotNull("subQuery", subQuery); TodoMappingCB cb = new TodoMappingCB(); - cb.xsetupForDeriveReferrer(); + cb.xsetupForDerivedReferrer(); subQuery.query(cb); - String subQueryPropertyName = keepUserId_DeriveSubQuery_TodoMappingList(cb - .query());// for saving query-value. - registerDeriveSubQuery(function, cb.query(), "USER_ID", "USER_ID", - subQueryPropertyName, aliasName); + String subQueryPropertyName = keepUserId_DerivedReferrer_TodoMappingList(cb + .query()); // for saving query-value. + registerDerivedReferrerSubQuery(function, cb.query(), "USER_ID", + "USER_ID", subQueryPropertyName, aliasName); } - abstract public String keepUserId_DeriveSubQuery_TodoMappingList( + public abstract String keepUserId_DerivedReferrer_TodoMappingList( TodoMappingCQ subQuery); /** - * IsNull(is null). And OnceRegistered. + * IsNull(is null). And OnlyOnceRegistered. */ public void setUserId_IsNull() { regUserId(CK_ISN, DUMMY_OBJECT); } /** - * IsNotNull(is not null). And OnceRegistered. + * IsNotNull(is not null). And OnlyOnceRegistered. */ public void setUserId_IsNotNull() { regUserId(CK_ISNN, DUMMY_OBJECT); @@ -779,7 +618,7 @@ abstract protected ConditionValue getCValueUserId(); /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {VARCHAR(100)} + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {VARCHAR(100)} * * @param givenName The value of givenName as equal. */ @@ -788,7 +627,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param givenName The value of givenName as notEqual. */ @@ -797,7 +636,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param givenName The value of givenName as greaterThan. */ @@ -806,7 +645,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param givenName The value of givenName as lessThan. */ @@ -815,7 +654,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param givenName The value of givenName as greaterEqual. */ @@ -824,7 +663,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param givenName The value of givenName as lessEqual. */ @@ -833,7 +672,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param givenName The value of givenName as prefixSearch. */ @@ -842,20 +681,6 @@ } /** - * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, - * SeveralRegistered. - * - * @param givenName The value of givenName as likeSearch. - * @param likeSearchOption The option of like-search. (NotNull) - */ - public void setGivenName_LikeSearch( - String givenName, - jp.sf.pal.todolist.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. * @@ -866,38 +691,52 @@ } /** - * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * - * @param givenName The collection of givenName as inScope. - * @param inScopeOption The option of in-scope. (NotNull) + * @param givenNameList The collection of givenName as notInScope. */ - public void setGivenName_InScope( + public void setGivenName_NotInScope(Collection givenNameList) { + regGivenName(CK_NINS, cTL(givenNameList)); + } + + /** + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param givenName The value of givenName as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) + */ + public void setGivenName_LikeSearch( String givenName, - jp.sf.pal.todolist.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(givenName), getCValueGivenName(), - "GIVEN_NAME", "GivenName", "givenName", inScopeOption); + jp.sf.pal.todolist.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(givenName), getCValueGivenName(), "GIVEN_NAME", + "GivenName", "givenName", likeSearchOption); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param givenNameList The collection of givenName as notInScope. + * @param givenName The value of givenName as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setGivenName_NotInScope(Collection givenNameList) { - regGivenName(CK_NINS, cTL(givenNameList)); + public void setGivenName_NotLikeSearch( + String givenName, + jp.sf.pal.todolist.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(givenName), getCValueGivenName(), "GIVEN_NAME", + "GivenName", "givenName", likeSearchOption); } /** - * IsNull(is null). And OnceRegistered. + * IsNull(is null). And OnlyOnceRegistered. */ public void setGivenName_IsNull() { regGivenName(CK_ISN, DUMMY_OBJECT); } /** - * IsNotNull(is not null). And OnceRegistered. + * IsNotNull(is not null). And OnlyOnceRegistered. */ public void setGivenName_IsNotNull() { regGivenName(CK_ISNN, DUMMY_OBJECT); @@ -916,7 +755,7 @@ abstract protected ConditionValue getCValueGivenName(); /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {VARCHAR(100)} + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {VARCHAR(100)} * * @param familyName The value of familyName as equal. */ @@ -925,7 +764,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param familyName The value of familyName as notEqual. */ @@ -934,7 +773,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param familyName The value of familyName as greaterThan. */ @@ -943,7 +782,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param familyName The value of familyName as lessThan. */ @@ -952,7 +791,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param familyName The value of familyName as greaterEqual. */ @@ -961,7 +800,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param familyName The value of familyName as lessEqual. */ @@ -970,7 +809,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param familyName The value of familyName as prefixSearch. */ @@ -979,20 +818,6 @@ } /** - * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, - * SeveralRegistered. - * - * @param familyName The value of familyName as likeSearch. - * @param likeSearchOption The option of like-search. (NotNull) - */ - public void setFamilyName_LikeSearch( - String familyName, - jp.sf.pal.todolist.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. * @@ -1003,38 +828,52 @@ } /** - * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * - * @param familyName The collection of familyName as inScope. - * @param inScopeOption The option of in-scope. (NotNull) + * @param familyNameList The collection of familyName as notInScope. */ - public void setFamilyName_InScope( + public void setFamilyName_NotInScope(Collection familyNameList) { + regFamilyName(CK_NINS, cTL(familyNameList)); + } + + /** + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param familyName The value of familyName as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) + */ + public void setFamilyName_LikeSearch( String familyName, - jp.sf.pal.todolist.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(familyName), getCValueFamilyName(), - "FAMILY_NAME", "FamilyName", "familyName", inScopeOption); + jp.sf.pal.todolist.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(familyName), getCValueFamilyName(), "FAMILY_NAME", + "FamilyName", "familyName", likeSearchOption); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param familyNameList The collection of familyName as notInScope. + * @param familyName The value of familyName as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setFamilyName_NotInScope(Collection familyNameList) { - regFamilyName(CK_NINS, cTL(familyNameList)); + public void setFamilyName_NotLikeSearch( + String familyName, + jp.sf.pal.todolist.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(familyName), getCValueFamilyName(), "FAMILY_NAME", + "FamilyName", "familyName", likeSearchOption); } /** - * IsNull(is null). And OnceRegistered. + * IsNull(is null). And OnlyOnceRegistered. */ public void setFamilyName_IsNull() { regFamilyName(CK_ISN, DUMMY_OBJECT); } /** - * IsNotNull(is not null). And OnceRegistered. + * IsNotNull(is not null). And OnlyOnceRegistered. */ public void setFamilyName_IsNotNull() { regFamilyName(CK_ISNN, DUMMY_OBJECT); @@ -1053,7 +892,7 @@ abstract protected ConditionValue getCValueFamilyName(); /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {VARCHAR(50)} + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {VARCHAR(50)} * * @param middleName The value of middleName as equal. */ @@ -1062,7 +901,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param middleName The value of middleName as notEqual. */ @@ -1071,7 +910,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param middleName The value of middleName as greaterThan. */ @@ -1080,7 +919,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param middleName The value of middleName as lessThan. */ @@ -1089,7 +928,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param middleName The value of middleName as greaterEqual. */ @@ -1098,7 +937,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param middleName The value of middleName as lessEqual. */ @@ -1107,7 +946,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param middleName The value of middleName as prefixSearch. */ @@ -1116,20 +955,6 @@ } /** - * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, - * SeveralRegistered. - * - * @param middleName The value of middleName as likeSearch. - * @param likeSearchOption The option of like-search. (NotNull) - */ - public void setMiddleName_LikeSearch( - String middleName, - jp.sf.pal.todolist.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. * @@ -1140,38 +965,52 @@ } /** - * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * - * @param middleName The collection of middleName as inScope. - * @param inScopeOption The option of in-scope. (NotNull) + * @param middleNameList The collection of middleName as notInScope. */ - public void setMiddleName_InScope( + public void setMiddleName_NotInScope(Collection middleNameList) { + regMiddleName(CK_NINS, cTL(middleNameList)); + } + + /** + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param middleName The value of middleName as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) + */ + public void setMiddleName_LikeSearch( String middleName, - jp.sf.pal.todolist.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(middleName), getCValueMiddleName(), - "MIDDLE_NAME", "MiddleName", "middleName", inScopeOption); + jp.sf.pal.todolist.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(middleName), getCValueMiddleName(), "MIDDLE_NAME", + "MiddleName", "middleName", likeSearchOption); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param middleNameList The collection of middleName as notInScope. + * @param middleName The value of middleName as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setMiddleName_NotInScope(Collection middleNameList) { - regMiddleName(CK_NINS, cTL(middleNameList)); + public void setMiddleName_NotLikeSearch( + String middleName, + jp.sf.pal.todolist.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(middleName), getCValueMiddleName(), "MIDDLE_NAME", + "MiddleName", "middleName", likeSearchOption); } /** - * IsNull(is null). And OnceRegistered. + * IsNull(is null). And OnlyOnceRegistered. */ public void setMiddleName_IsNull() { regMiddleName(CK_ISN, DUMMY_OBJECT); } /** - * IsNotNull(is not null). And OnceRegistered. + * IsNotNull(is not null). And OnlyOnceRegistered. */ public void setMiddleName_IsNotNull() { regMiddleName(CK_ISNN, DUMMY_OBJECT); @@ -1190,7 +1029,7 @@ abstract protected ConditionValue getCValueMiddleName(); /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {VARCHAR(100)} + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {VARCHAR(100)} * * @param givenNameDesc The value of givenNameDesc as equal. */ @@ -1199,7 +1038,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param givenNameDesc The value of givenNameDesc as notEqual. */ @@ -1208,7 +1047,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param givenNameDesc The value of givenNameDesc as greaterThan. */ @@ -1217,7 +1056,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param givenNameDesc The value of givenNameDesc as lessThan. */ @@ -1226,7 +1065,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param givenNameDesc The value of givenNameDesc as greaterEqual. */ @@ -1235,7 +1074,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param givenNameDesc The value of givenNameDesc as lessEqual. */ @@ -1244,7 +1083,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param givenNameDesc The value of givenNameDesc as prefixSearch. */ @@ -1253,21 +1092,6 @@ } /** - * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, - * SeveralRegistered. - * - * @param givenNameDesc The value of givenNameDesc as likeSearch. - * @param likeSearchOption The option of like-search. (NotNull) - */ - public void setGivenNameDesc_LikeSearch( - String givenNameDesc, - jp.sf.pal.todolist.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. * @@ -1278,39 +1102,54 @@ } /** - * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * - * @param givenNameDesc The collection of givenNameDesc as inScope. - * @param inScopeOption The option of in-scope. (NotNull) + * @param givenNameDescList The collection of givenNameDesc as notInScope. */ - public void setGivenNameDesc_InScope( + public void setGivenNameDesc_NotInScope(Collection givenNameDescList) { + regGivenNameDesc(CK_NINS, cTL(givenNameDescList)); + } + + /** + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param givenNameDesc The value of givenNameDesc as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) + */ + public void setGivenNameDesc_LikeSearch( String givenNameDesc, - jp.sf.pal.todolist.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(givenNameDesc), - getCValueGivenNameDesc(), "GIVEN_NAME_DESC", "GivenNameDesc", - "givenNameDesc", inScopeOption); + jp.sf.pal.todolist.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(givenNameDesc), getCValueGivenNameDesc(), + "GIVEN_NAME_DESC", "GivenNameDesc", "givenNameDesc", + likeSearchOption); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param givenNameDescList The collection of givenNameDesc as notInScope. + * @param givenNameDesc The value of givenNameDesc as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setGivenNameDesc_NotInScope(Collection givenNameDescList) { - regGivenNameDesc(CK_NINS, cTL(givenNameDescList)); + public void setGivenNameDesc_NotLikeSearch( + String givenNameDesc, + jp.sf.pal.todolist.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(givenNameDesc), getCValueGivenNameDesc(), + "GIVEN_NAME_DESC", "GivenNameDesc", "givenNameDesc", + likeSearchOption); } /** - * IsNull(is null). And OnceRegistered. + * IsNull(is null). And OnlyOnceRegistered. */ public void setGivenNameDesc_IsNull() { regGivenNameDesc(CK_ISN, DUMMY_OBJECT); } /** - * IsNotNull(is not null). And OnceRegistered. + * IsNotNull(is not null). And OnlyOnceRegistered. */ public void setGivenNameDesc_IsNotNull() { regGivenNameDesc(CK_ISNN, DUMMY_OBJECT); @@ -1329,7 +1168,7 @@ abstract protected ConditionValue getCValueGivenNameDesc(); /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {VARCHAR(100)} + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {VARCHAR(100)} * * @param familyNameDesc The value of familyNameDesc as equal. */ @@ -1338,7 +1177,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param familyNameDesc The value of familyNameDesc as notEqual. */ @@ -1347,7 +1186,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param familyNameDesc The value of familyNameDesc as greaterThan. */ @@ -1356,7 +1195,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param familyNameDesc The value of familyNameDesc as lessThan. */ @@ -1365,7 +1204,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param familyNameDesc The value of familyNameDesc as greaterEqual. */ @@ -1374,7 +1213,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param familyNameDesc The value of familyNameDesc as lessEqual. */ @@ -1383,7 +1222,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param familyNameDesc The value of familyNameDesc as prefixSearch. */ @@ -1392,21 +1231,6 @@ } /** - * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, - * SeveralRegistered. - * - * @param familyNameDesc The value of familyNameDesc as likeSearch. - * @param likeSearchOption The option of like-search. (NotNull) - */ - public void setFamilyNameDesc_LikeSearch( - String familyNameDesc, - jp.sf.pal.todolist.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. * @@ -1417,40 +1241,55 @@ } /** - * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * - * @param familyNameDesc The collection of familyNameDesc as inScope. - * @param inScopeOption The option of in-scope. (NotNull) + * @param familyNameDescList The collection of familyNameDesc as notInScope. */ - public void setFamilyNameDesc_InScope( + public void setFamilyNameDesc_NotInScope( + Collection familyNameDescList) { + regFamilyNameDesc(CK_NINS, cTL(familyNameDescList)); + } + + /** + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param familyNameDesc The value of familyNameDesc as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) + */ + public void setFamilyNameDesc_LikeSearch( String familyNameDesc, - jp.sf.pal.todolist.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(familyNameDesc), - getCValueFamilyNameDesc(), "FAMILY_NAME_DESC", - "FamilyNameDesc", "familyNameDesc", inScopeOption); + jp.sf.pal.todolist.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(familyNameDesc), getCValueFamilyNameDesc(), + "FAMILY_NAME_DESC", "FamilyNameDesc", "familyNameDesc", + likeSearchOption); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param familyNameDescList The collection of familyNameDesc as notInScope. + * @param familyNameDesc The value of familyNameDesc as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setFamilyNameDesc_NotInScope( - Collection familyNameDescList) { - regFamilyNameDesc(CK_NINS, cTL(familyNameDescList)); + public void setFamilyNameDesc_NotLikeSearch( + String familyNameDesc, + jp.sf.pal.todolist.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(familyNameDesc), getCValueFamilyNameDesc(), + "FAMILY_NAME_DESC", "FamilyNameDesc", "familyNameDesc", + likeSearchOption); } /** - * IsNull(is null). And OnceRegistered. + * IsNull(is null). And OnlyOnceRegistered. */ public void setFamilyNameDesc_IsNull() { regFamilyNameDesc(CK_ISN, DUMMY_OBJECT); } /** - * IsNotNull(is not null). And OnceRegistered. + * IsNotNull(is not null). And OnlyOnceRegistered. */ public void setFamilyNameDesc_IsNotNull() { regFamilyNameDesc(CK_ISNN, DUMMY_OBJECT); @@ -1469,7 +1308,7 @@ abstract protected ConditionValue getCValueFamilyNameDesc(); /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {VARCHAR(100)} + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {VARCHAR(100)} * * @param nickname The value of nickname as equal. */ @@ -1478,7 +1317,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param nickname The value of nickname as notEqual. */ @@ -1487,7 +1326,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param nickname The value of nickname as greaterThan. */ @@ -1496,7 +1335,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param nickname The value of nickname as lessThan. */ @@ -1505,7 +1344,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param nickname The value of nickname as greaterEqual. */ @@ -1514,7 +1353,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param nickname The value of nickname as lessEqual. */ @@ -1523,7 +1362,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param nickname The value of nickname as prefixSearch. */ @@ -1532,20 +1371,6 @@ } /** - * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, - * SeveralRegistered. - * - * @param nickname The value of nickname as likeSearch. - * @param likeSearchOption The option of like-search. (NotNull) - */ - public void setNickname_LikeSearch( - String nickname, - jp.sf.pal.todolist.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { - registerLikeSearchQuery(CK_LS, fRES(nickname), getCValueNickname(), - "NICKNAME", "Nickname", "nickname", likeSearchOption); - } - - /** * InScope(in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * @@ -1556,38 +1381,52 @@ } /** - * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * - * @param nickname The collection of nickname as inScope. - * @param inScopeOption The option of in-scope. (NotNull) + * @param nicknameList The collection of nickname as notInScope. */ - public void setNickname_InScope( + public void setNickname_NotInScope(Collection nicknameList) { + regNickname(CK_NINS, cTL(nicknameList)); + } + + /** + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param nickname The value of nickname as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) + */ + public void setNickname_LikeSearch( String nickname, - jp.sf.pal.todolist.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(nickname), getCValueNickname(), - "NICKNAME", "Nickname", "nickname", inScopeOption); + jp.sf.pal.todolist.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(nickname), getCValueNickname(), "NICKNAME", + "Nickname", "nickname", likeSearchOption); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param nicknameList The collection of nickname as notInScope. + * @param nickname The value of nickname as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setNickname_NotInScope(Collection nicknameList) { - regNickname(CK_NINS, cTL(nicknameList)); + public void setNickname_NotLikeSearch( + String nickname, + jp.sf.pal.todolist.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(nickname), getCValueNickname(), "NICKNAME", + "Nickname", "nickname", likeSearchOption); } /** - * IsNull(is null). And OnceRegistered. + * IsNull(is null). And OnlyOnceRegistered. */ public void setNickname_IsNull() { regNickname(CK_ISN, DUMMY_OBJECT); } /** - * IsNotNull(is not null). And OnceRegistered. + * IsNotNull(is not null). And OnlyOnceRegistered. */ public void setNickname_IsNotNull() { regNickname(CK_ISNN, DUMMY_OBJECT); @@ -1606,7 +1445,7 @@ abstract protected ConditionValue getCValueNickname(); /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {VARCHAR(1)} + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {VARCHAR(1)} * * @param gender The value of gender as equal. */ @@ -1615,7 +1454,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param gender The value of gender as notEqual. */ @@ -1624,7 +1463,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param gender The value of gender as greaterThan. */ @@ -1633,7 +1472,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param gender The value of gender as lessThan. */ @@ -1642,7 +1481,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param gender The value of gender as greaterEqual. */ @@ -1651,7 +1490,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param gender The value of gender as lessEqual. */ @@ -1660,7 +1499,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param gender The value of gender as prefixSearch. */ @@ -1669,20 +1508,6 @@ } /** - * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, - * SeveralRegistered. - * - * @param gender The value of gender as likeSearch. - * @param likeSearchOption The option of like-search. (NotNull) - */ - public void setGender_LikeSearch( - String gender, - jp.sf.pal.todolist.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { - registerLikeSearchQuery(CK_LS, fRES(gender), getCValueGender(), - "GENDER", "Gender", "gender", likeSearchOption); - } - - /** * InScope(in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * @@ -1693,38 +1518,52 @@ } /** - * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * - * @param gender The collection of gender as inScope. - * @param inScopeOption The option of in-scope. (NotNull) + * @param genderList The collection of gender as notInScope. */ - public void setGender_InScope( + public void setGender_NotInScope(Collection genderList) { + regGender(CK_NINS, cTL(genderList)); + } + + /** + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param gender The value of gender as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) + */ + public void setGender_LikeSearch( String gender, - jp.sf.pal.todolist.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(gender), getCValueGender(), "GENDER", - "Gender", "gender", inScopeOption); + jp.sf.pal.todolist.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(gender), getCValueGender(), "GENDER", "Gender", + "gender", likeSearchOption); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param genderList The collection of gender as notInScope. + * @param gender The value of gender as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setGender_NotInScope(Collection genderList) { - regGender(CK_NINS, cTL(genderList)); + public void setGender_NotLikeSearch( + String gender, + jp.sf.pal.todolist.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(gender), getCValueGender(), "GENDER", "Gender", + "gender", likeSearchOption); } /** - * IsNull(is null). And OnceRegistered. + * IsNull(is null). And OnlyOnceRegistered. */ public void setGender_IsNull() { regGender(CK_ISN, DUMMY_OBJECT); } /** - * IsNotNull(is not null). And OnceRegistered. + * IsNotNull(is not null). And OnlyOnceRegistered. */ public void setGender_IsNotNull() { regGender(CK_ISNN, DUMMY_OBJECT); @@ -1743,7 +1582,7 @@ abstract protected ConditionValue getCValueGender(); /** - * Equal(=). And NullIgnored, OnceRegistered. {DATE} + * Equal(=). And NullIgnored, OnlyOnceRegistered. {DATE} * * @param birthDate The value of birthDate as equal. */ @@ -1752,7 +1591,7 @@ } /** - * NotEqual(!=). And NullIgnored, OnceRegistered. + * NotEqual(!=). And NullIgnored, OnlyOnceRegistered. * * @param birthDate The value of birthDate as notEqual. */ @@ -1761,7 +1600,7 @@ } /** - * GreaterThan(>). And NullIgnored, OnceRegistered. + * GreaterThan(>). And NullIgnored, OnlyOnceRegistered. * * @param birthDate The value of birthDate as greaterThan. */ @@ -1770,7 +1609,7 @@ } /** - * LessThan(>). And NullIgnored, OnceRegistered. + * LessThan(>). And NullIgnored, OnlyOnceRegistered. * * @param birthDate The value of birthDate as lessThan. */ @@ -1779,7 +1618,7 @@ } /** - * GreaterEqual(>). And NullIgnored, OnceRegistered. + * GreaterEqual(>). And NullIgnored, OnlyOnceRegistered. * * @param birthDate The value of birthDate as greaterEqual. */ @@ -1788,7 +1627,7 @@ } /** - * LessEqual(>). And NullIgnored, OnceRegistered. + * LessEqual(>). And NullIgnored, OnlyOnceRegistered. * * @param birthDate The value of birthDate as lessEqual. */ @@ -1798,7 +1637,7 @@ /** * FromTo($fromDate <= COLUMN_NAME <= $toDate). And NullIgnored, - * OnceRegistered. {DATE} + * OnlyOnceRegistered. {DATE} * * @param fromDate The from-date of birthDate. (Nullable) * @param toDate The to-date of birthDate. (Nullable) @@ -1814,7 +1653,7 @@ /** * FromTo($fromDate <= COLUMN_NAME < $toDate + 1). And NullIgnored, - * OnceRegistered. {DATE} + * OnlyOnceRegistered. {DATE} * * @param fromDate The from-date of birthDate. (Nullable) * @param toDate The to-date of birthDate. (Nullable) @@ -1828,14 +1667,14 @@ } /** - * IsNull(is null). And OnceRegistered. + * IsNull(is null). And OnlyOnceRegistered. */ public void setBirthDate_IsNull() { regBirthDate(CK_ISN, DUMMY_OBJECT); } /** - * IsNotNull(is not null). And OnceRegistered. + * IsNotNull(is not null). And OnlyOnceRegistered. */ public void setBirthDate_IsNotNull() { regBirthDate(CK_ISNN, DUMMY_OBJECT); @@ -1854,7 +1693,7 @@ abstract protected ConditionValue getCValueBirthDate(); /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {VARCHAR(255)} + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {VARCHAR(255)} * * @param email The value of email as equal. */ @@ -1863,7 +1702,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param email The value of email as notEqual. */ @@ -1872,7 +1711,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param email The value of email as greaterThan. */ @@ -1881,7 +1720,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param email The value of email as lessThan. */ @@ -1890,7 +1729,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param email The value of email as greaterEqual. */ @@ -1899,7 +1738,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param email The value of email as lessEqual. */ @@ -1908,7 +1747,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param email The value of email as prefixSearch. */ @@ -1917,20 +1756,6 @@ } /** - * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, - * SeveralRegistered. - * - * @param email The value of email as likeSearch. - * @param likeSearchOption The option of like-search. (NotNull) - */ - public void setEmail_LikeSearch( - String email, - jp.sf.pal.todolist.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { - registerLikeSearchQuery(CK_LS, fRES(email), getCValueEmail(), "EMAIL", - "Email", "email", likeSearchOption); - } - - /** * InScope(in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * @@ -1941,38 +1766,52 @@ } /** - * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * - * @param email The collection of email as inScope. - * @param inScopeOption The option of in-scope. (NotNull) + * @param emailList The collection of email as notInScope. */ - public void setEmail_InScope( + public void setEmail_NotInScope(Collection emailList) { + regEmail(CK_NINS, cTL(emailList)); + } + + /** + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param email The value of email as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) + */ + public void setEmail_LikeSearch( String email, - jp.sf.pal.todolist.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(email), getCValueEmail(), "EMAIL", - "Email", "email", inScopeOption); + jp.sf.pal.todolist.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(email), getCValueEmail(), "EMAIL", "Email", "email", + likeSearchOption); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param emailList The collection of email as notInScope. + * @param email The value of email as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setEmail_NotInScope(Collection emailList) { - regEmail(CK_NINS, cTL(emailList)); + public void setEmail_NotLikeSearch( + String email, + jp.sf.pal.todolist.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(email), getCValueEmail(), "EMAIL", "Email", + "email", likeSearchOption); } /** - * IsNull(is null). And OnceRegistered. + * IsNull(is null). And OnlyOnceRegistered. */ public void setEmail_IsNull() { regEmail(CK_ISN, DUMMY_OBJECT); } /** - * IsNotNull(is not null). And OnceRegistered. + * IsNotNull(is not null). And OnlyOnceRegistered. */ public void setEmail_IsNotNull() { regEmail(CK_ISNN, DUMMY_OBJECT); @@ -1990,7 +1829,7 @@ abstract protected ConditionValue getCValueEmail(); /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {VARCHAR(255)} + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {VARCHAR(255)} * * @param url The value of url as equal. */ @@ -1999,7 +1838,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param url The value of url as notEqual. */ @@ -2008,7 +1847,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param url The value of url as greaterThan. */ @@ -2017,7 +1856,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param url The value of url as lessThan. */ @@ -2026,7 +1865,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param url The value of url as greaterEqual. */ @@ -2035,7 +1874,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param url The value of url as lessEqual. */ @@ -2044,7 +1883,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param url The value of url as prefixSearch. */ @@ -2053,20 +1892,6 @@ } /** - * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, - * SeveralRegistered. - * - * @param url The value of url as likeSearch. - * @param likeSearchOption The option of like-search. (NotNull) - */ - public void setUrl_LikeSearch( - String url, - jp.sf.pal.todolist.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { - registerLikeSearchQuery(CK_LS, fRES(url), getCValueUrl(), "URL", "Url", - "url", likeSearchOption); - } - - /** * InScope(in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * @@ -2077,38 +1902,52 @@ } /** - * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * - * @param url The collection of url as inScope. - * @param inScopeOption The option of in-scope. (NotNull) + * @param urlList The collection of url as notInScope. */ - public void setUrl_InScope( + public void setUrl_NotInScope(Collection urlList) { + regUrl(CK_NINS, cTL(urlList)); + } + + /** + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param url The value of url as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) + */ + public void setUrl_LikeSearch( String url, - jp.sf.pal.todolist.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(url), getCValueUrl(), "URL", "Url", - "url", inScopeOption); + jp.sf.pal.todolist.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(url), getCValueUrl(), "URL", "Url", "url", + likeSearchOption); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param urlList The collection of url as notInScope. + * @param url The value of url as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setUrl_NotInScope(Collection urlList) { - regUrl(CK_NINS, cTL(urlList)); + public void setUrl_NotLikeSearch( + String url, + jp.sf.pal.todolist.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(url), getCValueUrl(), "URL", "Url", "url", + likeSearchOption); } /** - * IsNull(is null). And OnceRegistered. + * IsNull(is null). And OnlyOnceRegistered. */ public void setUrl_IsNull() { regUrl(CK_ISN, DUMMY_OBJECT); } /** - * IsNotNull(is not null). And OnceRegistered. + * IsNotNull(is not null). And OnlyOnceRegistered. */ public void setUrl_IsNotNull() { regUrl(CK_ISNN, DUMMY_OBJECT); @@ -2125,7 +1964,7 @@ abstract protected ConditionValue getCValueUrl(); /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {VARCHAR(40)} + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {VARCHAR(40)} * * @param telephone The value of telephone as equal. */ @@ -2134,7 +1973,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param telephone The value of telephone as notEqual. */ @@ -2143,7 +1982,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param telephone The value of telephone as greaterThan. */ @@ -2152,7 +1991,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param telephone The value of telephone as lessThan. */ @@ -2161,7 +2000,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param telephone The value of telephone as greaterEqual. */ @@ -2170,7 +2009,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param telephone The value of telephone as lessEqual. */ @@ -2179,7 +2018,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param telephone The value of telephone as prefixSearch. */ @@ -2188,20 +2027,6 @@ } /** - * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, - * SeveralRegistered. - * - * @param telephone The value of telephone as likeSearch. - * @param likeSearchOption The option of like-search. (NotNull) - */ - public void setTelephone_LikeSearch( - String telephone, - jp.sf.pal.todolist.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { - registerLikeSearchQuery(CK_LS, fRES(telephone), getCValueTelephone(), - "TELEPHONE", "Telephone", "telephone", likeSearchOption); - } - - /** * InScope(in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * @@ -2212,38 +2037,52 @@ } /** - * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * - * @param telephone The collection of telephone as inScope. - * @param inScopeOption The option of in-scope. (NotNull) + * @param telephoneList The collection of telephone as notInScope. */ - public void setTelephone_InScope( + public void setTelephone_NotInScope(Collection telephoneList) { + regTelephone(CK_NINS, cTL(telephoneList)); + } + + /** + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param telephone The value of telephone as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) + */ + public void setTelephone_LikeSearch( String telephone, - jp.sf.pal.todolist.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(telephone), getCValueTelephone(), - "TELEPHONE", "Telephone", "telephone", inScopeOption); + jp.sf.pal.todolist.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(telephone), getCValueTelephone(), "TELEPHONE", + "Telephone", "telephone", likeSearchOption); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param telephoneList The collection of telephone as notInScope. + * @param telephone The value of telephone as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setTelephone_NotInScope(Collection telephoneList) { - regTelephone(CK_NINS, cTL(telephoneList)); + public void setTelephone_NotLikeSearch( + String telephone, + jp.sf.pal.todolist.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(telephone), getCValueTelephone(), "TELEPHONE", + "Telephone", "telephone", likeSearchOption); } /** - * IsNull(is null). And OnceRegistered. + * IsNull(is null). And OnlyOnceRegistered. */ public void setTelephone_IsNull() { regTelephone(CK_ISN, DUMMY_OBJECT); } /** - * IsNotNull(is not null). And OnceRegistered. + * IsNotNull(is not null). And OnlyOnceRegistered. */ public void setTelephone_IsNotNull() { regTelephone(CK_ISNN, DUMMY_OBJECT); @@ -2262,7 +2101,7 @@ abstract protected ConditionValue getCValueTelephone(); /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {VARCHAR(5)} + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {VARCHAR(5)} * * @param locale The value of locale as equal. */ @@ -2271,7 +2110,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param locale The value of locale as notEqual. */ @@ -2280,7 +2119,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param locale The value of locale as greaterThan. */ @@ -2289,7 +2128,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param locale The value of locale as lessThan. */ @@ -2298,7 +2137,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param locale The value of locale as greaterEqual. */ @@ -2307,7 +2146,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param locale The value of locale as lessEqual. */ @@ -2316,7 +2155,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param locale The value of locale as prefixSearch. */ @@ -2325,20 +2164,6 @@ } /** - * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, - * SeveralRegistered. - * - * @param locale The value of locale as likeSearch. - * @param likeSearchOption The option of like-search. (NotNull) - */ - public void setLocale_LikeSearch( - String locale, - jp.sf.pal.todolist.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { - registerLikeSearchQuery(CK_LS, fRES(locale), getCValueLocale(), - "LOCALE", "Locale", "locale", likeSearchOption); - } - - /** * InScope(in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * @@ -2349,38 +2174,52 @@ } /** - * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * - * @param locale The collection of locale as inScope. - * @param inScopeOption The option of in-scope. (NotNull) + * @param localeList The collection of locale as notInScope. */ - public void setLocale_InScope( + public void setLocale_NotInScope(Collection localeList) { + regLocale(CK_NINS, cTL(localeList)); + } + + /** + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param locale The value of locale as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) + */ + public void setLocale_LikeSearch( String locale, - jp.sf.pal.todolist.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(locale), getCValueLocale(), "LOCALE", - "Locale", "locale", inScopeOption); + jp.sf.pal.todolist.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(locale), getCValueLocale(), "LOCALE", "Locale", + "locale", likeSearchOption); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param localeList The collection of locale as notInScope. + * @param locale The value of locale as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setLocale_NotInScope(Collection localeList) { - regLocale(CK_NINS, cTL(localeList)); + public void setLocale_NotLikeSearch( + String locale, + jp.sf.pal.todolist.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(locale), getCValueLocale(), "LOCALE", "Locale", + "locale", likeSearchOption); } /** - * IsNull(is null). And OnceRegistered. + * IsNull(is null). And OnlyOnceRegistered. */ public void setLocale_IsNull() { regLocale(CK_ISN, DUMMY_OBJECT); } /** - * IsNotNull(is not null). And OnceRegistered. + * IsNotNull(is not null). And OnlyOnceRegistered. */ public void setLocale_IsNotNull() { regLocale(CK_ISNN, DUMMY_OBJECT); @@ -2399,8 +2238,8 @@ abstract protected ConditionValue getCValueLocale(); /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {VARCHAR(255) : FK to - * ROLE_INFO} + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {VARCHAR(255) : FK + * to ROLE_INFO} * * @param roleId The value of roleId as equal. */ @@ -2409,7 +2248,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param roleId The value of roleId as notEqual. */ @@ -2418,7 +2257,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param roleId The value of roleId as greaterThan. */ @@ -2427,7 +2266,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param roleId The value of roleId as lessThan. */ @@ -2436,7 +2275,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param roleId The value of roleId as greaterEqual. */ @@ -2445,7 +2284,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param roleId The value of roleId as lessEqual. */ @@ -2454,7 +2293,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param roleId The value of roleId as prefixSearch. */ @@ -2463,20 +2302,6 @@ } /** - * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, - * SeveralRegistered. - * - * @param roleId The value of roleId as likeSearch. - * @param likeSearchOption The option of like-search. (NotNull) - */ - public void setRoleId_LikeSearch( - String roleId, - jp.sf.pal.todolist.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. * @@ -2487,42 +2312,41 @@ } /** - * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * - * @param roleId The collection of roleId as inScope. - * @param inScopeOption The option of in-scope. (NotNull) + * @param roleIdList The collection of roleId as notInScope. */ - public void setRoleId_InScope( - String roleId, - jp.sf.pal.todolist.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(roleId), getCValueRoleId(), - "ROLE_ID", "RoleId", "roleId", inScopeOption); + public void setRoleId_NotInScope(Collection roleIdList) { + regRoleId(CK_NINS, cTL(roleIdList)); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param roleIdList The collection of roleId as notInScope. + * @param roleId The value of roleId as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) */ - public void setRoleId_NotInScope(Collection roleIdList) { - regRoleId(CK_NINS, cTL(roleIdList)); + public void setRoleId_LikeSearch( + String roleId, + jp.sf.pal.todolist.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(roleId), getCValueRoleId(), "ROLE_ID", "RoleId", + "roleId", likeSearchOption); } /** - * @param roleInfoCBquery Query. - * @deprecated Please use inScopeRoleInfo(subQuery) method. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param roleId The value of roleId as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setRoleId_InScopeSubQuery_RoleInfo(RoleInfoCQ roleInfoCBquery) { - String subQueryPropertyName = keepRoleId_InScopeSubQuery_RoleInfo(roleInfoCBquery);// for - // saving - // query - // - - // value - // . - registerInScopeSubQuery(roleInfoCBquery, "ROLE_ID", "ROLE_ID", - subQueryPropertyName); + public void setRoleId_NotLikeSearch( + String roleId, + jp.sf.pal.todolist.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(roleId), getCValueRoleId(), "ROLE_ID", "RoleId", + "roleId", likeSearchOption); } public void inScopeRoleInfo(SubQuery subQuery) { @@ -2531,23 +2355,23 @@ cb.xsetupForInScopeSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepRoleId_InScopeSubQuery_RoleInfo(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerInScopeSubQuery(cb.query(), "ROLE_ID", "ROLE_ID", subQueryPropertyName); } - abstract public String keepRoleId_InScopeSubQuery_RoleInfo( + public abstract String keepRoleId_InScopeSubQuery_RoleInfo( jp.sf.pal.todolist.db.cbean.cq.RoleInfoCQ subQuery); /** - * IsNull(is null). And OnceRegistered. + * IsNull(is null). And OnlyOnceRegistered. */ public void setRoleId_IsNull() { regRoleId(CK_ISN, DUMMY_OBJECT); } /** - * IsNotNull(is not null). And OnceRegistered. + * IsNotNull(is not null). And OnlyOnceRegistered. */ public void setRoleId_IsNotNull() { regRoleId(CK_ISNN, DUMMY_OBJECT); @@ -2566,8 +2390,8 @@ abstract protected ConditionValue getCValueRoleId(); /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {VARCHAR(255) : FK to - * GROUP_INFO} + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {VARCHAR(255) : FK + * to GROUP_INFO} * * @param groupId The value of groupId as equal. */ @@ -2576,7 +2400,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param groupId The value of groupId as notEqual. */ @@ -2585,7 +2409,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param groupId The value of groupId as greaterThan. */ @@ -2594,7 +2418,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param groupId The value of groupId as lessThan. */ @@ -2603,7 +2427,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param groupId The value of groupId as greaterEqual. */ @@ -2612,7 +2436,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param groupId The value of groupId as lessEqual. */ @@ -2621,7 +2445,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param groupId The value of groupId as prefixSearch. */ @@ -2630,20 +2454,6 @@ } /** - * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, - * SeveralRegistered. - * - * @param groupId The value of groupId as likeSearch. - * @param likeSearchOption The option of like-search. (NotNull) - */ - public void setGroupId_LikeSearch( - String groupId, - jp.sf.pal.todolist.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. * @@ -2654,43 +2464,41 @@ } /** - * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * - * @param groupId The collection of groupId as inScope. - * @param inScopeOption The option of in-scope. (NotNull) + * @param groupIdList The collection of groupId as notInScope. */ - public void setGroupId_InScope( - String groupId, - jp.sf.pal.todolist.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(groupId), getCValueGroupId(), - "GROUP_ID", "GroupId", "groupId", inScopeOption); + public void setGroupId_NotInScope(Collection groupIdList) { + regGroupId(CK_NINS, cTL(groupIdList)); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param groupIdList The collection of groupId as notInScope. + * @param groupId The value of groupId as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) */ - public void setGroupId_NotInScope(Collection groupIdList) { - regGroupId(CK_NINS, cTL(groupIdList)); + public void setGroupId_LikeSearch( + String groupId, + jp.sf.pal.todolist.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(groupId), getCValueGroupId(), "GROUP_ID", "GroupId", + "groupId", likeSearchOption); } /** - * @param groupInfoCBquery Query. - * @deprecated Please use inScopeGroupInfo(subQuery) method. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param groupId The value of groupId as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setGroupId_InScopeSubQuery_GroupInfo( - GroupInfoCQ groupInfoCBquery) { - String subQueryPropertyName = keepGroupId_InScopeSubQuery_GroupInfo(groupInfoCBquery);// for - // saving - // query - // - - // value - // . - registerInScopeSubQuery(groupInfoCBquery, "GROUP_ID", "GROUP_ID", - subQueryPropertyName); + public void setGroupId_NotLikeSearch( + String groupId, + jp.sf.pal.todolist.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(groupId), getCValueGroupId(), "GROUP_ID", + "GroupId", "groupId", likeSearchOption); } public void inScopeGroupInfo(SubQuery subQuery) { @@ -2699,23 +2507,23 @@ cb.xsetupForInScopeSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepGroupId_InScopeSubQuery_GroupInfo(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerInScopeSubQuery(cb.query(), "GROUP_ID", "GROUP_ID", subQueryPropertyName); } - abstract public String keepGroupId_InScopeSubQuery_GroupInfo( + public abstract String keepGroupId_InScopeSubQuery_GroupInfo( jp.sf.pal.todolist.db.cbean.cq.GroupInfoCQ subQuery); /** - * IsNull(is null). And OnceRegistered. + * IsNull(is null). And OnlyOnceRegistered. */ public void setGroupId_IsNull() { regGroupId(CK_ISN, DUMMY_OBJECT); } /** - * IsNotNull(is not null). And OnceRegistered. + * IsNotNull(is not null). And OnlyOnceRegistered. */ public void setGroupId_IsNotNull() { regGroupId(CK_ISNN, DUMMY_OBJECT); @@ -2734,8 +2542,145 @@ abstract protected ConditionValue getCValueGroupId(); /** - * Equal(=). And NullIgnored, OnceRegistered. {NotNull : TIMESTAMP} + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {VARCHAR(1)} * + * @param status The value of status as equal. + */ + public void setStatus_Equal(String status) { + regStatus(CK_EQ, fRES(status)); + } + + /** + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. + * + * @param status The value of status as notEqual. + */ + public void setStatus_NotEqual(String status) { + regStatus(CK_NE, fRES(status)); + } + + /** + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. + * + * @param status The value of status as greaterThan. + */ + public void setStatus_GreaterThan(String status) { + regStatus(CK_GT, fRES(status)); + } + + /** + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. + * + * @param status The value of status as lessThan. + */ + public void setStatus_LessThan(String status) { + regStatus(CK_LT, fRES(status)); + } + + /** + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. + * + * @param status The value of status as greaterEqual. + */ + public void setStatus_GreaterEqual(String status) { + regStatus(CK_GE, fRES(status)); + } + + /** + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. + * + * @param status The value of status as lessEqual. + */ + public void setStatus_LessEqual(String status) { + regStatus(CK_LE, fRES(status)); + } + + /** + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. + * + * @param status The value of status as prefixSearch. + */ + public void setStatus_PrefixSearch(String status) { + regStatus(CK_PS, fRES(status)); + } + + /** + * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NullOrEmptyElementIgnored, SeveralRegistered. + * + * @param statusList The collection of status as inScope. + */ + public void setStatus_InScope(Collection statusList) { + regStatus(CK_INS, cTL(statusList)); + } + + /** + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, + * NullOrEmptyElementIgnored, SeveralRegistered. + * + * @param statusList The collection of status as notInScope. + */ + public void setStatus_NotInScope(Collection statusList) { + regStatus(CK_NINS, cTL(statusList)); + } + + /** + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param status The value of status as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) + */ + public void setStatus_LikeSearch( + String status, + jp.sf.pal.todolist.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(status), getCValueStatus(), "STATUS", "Status", + "status", likeSearchOption); + } + + /** + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param status The value of status as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) + */ + public void setStatus_NotLikeSearch( + String status, + jp.sf.pal.todolist.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(status), getCValueStatus(), "STATUS", "Status", + "status", likeSearchOption); + } + + /** + * IsNull(is null). And OnlyOnceRegistered. + */ + public void setStatus_IsNull() { + regStatus(CK_ISN, DUMMY_OBJECT); + } + + /** + * IsNotNull(is not null). And OnlyOnceRegistered. + */ + public void setStatus_IsNotNull() { + regStatus(CK_ISNN, DUMMY_OBJECT); + } + + protected void regStatus(ConditionKey key, Object value) { + registerQuery(key, value, getCValueStatus(), "STATUS", "Status", + "status"); + } + + protected void registerInlineStatus(ConditionKey key, Object value) { + registerInlineQuery(key, value, getCValueStatus(), "STATUS", "Status", + "status"); + } + + abstract protected ConditionValue getCValueStatus(); + + /** + * Equal(=). And NullIgnored, OnlyOnceRegistered. {NotNull : TIMESTAMP} + * * @param createdTime The value of createdTime as equal. */ public void setCreatedTime_Equal(java.sql.Timestamp createdTime) { @@ -2743,7 +2688,7 @@ } /** - * NotEqual(!=). And NullIgnored, OnceRegistered. + * NotEqual(!=). And NullIgnored, OnlyOnceRegistered. * * @param createdTime The value of createdTime as notEqual. */ @@ -2752,7 +2697,7 @@ } /** - * GreaterThan(>). And NullIgnored, OnceRegistered. + * GreaterThan(>). And NullIgnored, OnlyOnceRegistered. * * @param createdTime The value of createdTime as greaterThan. */ @@ -2761,7 +2706,7 @@ } /** - * LessThan(>). And NullIgnored, OnceRegistered. + * LessThan(>). And NullIgnored, OnlyOnceRegistered. * * @param createdTime The value of createdTime as lessThan. */ @@ -2770,7 +2715,7 @@ } /** - * GreaterEqual(>). And NullIgnored, OnceRegistered. + * GreaterEqual(>). And NullIgnored, OnlyOnceRegistered. * * @param createdTime The value of createdTime as greaterEqual. */ @@ -2779,7 +2724,7 @@ } /** - * LessEqual(>). And NullIgnored, OnceRegistered. + * LessEqual(>). And NullIgnored, OnlyOnceRegistered. * * @param createdTime The value of createdTime as lessEqual. */ @@ -2789,7 +2734,7 @@ /** * FromTo($fromDate <= COLUMN_NAME <= $toDate). And NullIgnored, - * OnceRegistered. {NotNull : TIMESTAMP} + * OnlyOnceRegistered. {NotNull : TIMESTAMP} * * @param fromDate The from-date of createdTime. (Nullable) * @param toDate The to-date of createdTime. (Nullable) @@ -2807,7 +2752,7 @@ /** * FromTo($fromDate <= COLUMN_NAME < $toDate + 1). And NullIgnored, - * OnceRegistered. {NotNull : TIMESTAMP} + * OnlyOnceRegistered. {NotNull : TIMESTAMP} * * @param fromDate The from-date of createdTime. (Nullable) * @param toDate The to-date of createdTime. (Nullable) @@ -2833,7 +2778,7 @@ abstract protected ConditionValue getCValueCreatedTime(); /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {NotNull : + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {NotNull : * VARCHAR(255)} * * @param createdBy The value of createdBy as equal. @@ -2843,7 +2788,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param createdBy The value of createdBy as notEqual. */ @@ -2852,7 +2797,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param createdBy The value of createdBy as greaterThan. */ @@ -2861,7 +2806,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param createdBy The value of createdBy as lessThan. */ @@ -2870,7 +2815,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param createdBy The value of createdBy as greaterEqual. */ @@ -2879,7 +2824,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param createdBy The value of createdBy as lessEqual. */ @@ -2888,7 +2833,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param createdBy The value of createdBy as prefixSearch. */ @@ -2897,20 +2842,6 @@ } /** - * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, - * SeveralRegistered. - * - * @param createdBy The value of createdBy as likeSearch. - * @param likeSearchOption The option of like-search. (NotNull) - */ - public void setCreatedBy_LikeSearch( - String createdBy, - jp.sf.pal.todolist.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. * @@ -2921,27 +2852,41 @@ } /** - * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * - * @param createdBy The collection of createdBy as inScope. - * @param inScopeOption The option of in-scope. (NotNull) + * @param createdByList The collection of createdBy as notInScope. */ - public void setCreatedBy_InScope( + public void setCreatedBy_NotInScope(Collection createdByList) { + regCreatedBy(CK_NINS, cTL(createdByList)); + } + + /** + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param createdBy The value of createdBy as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) + */ + public void setCreatedBy_LikeSearch( String createdBy, - jp.sf.pal.todolist.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(createdBy), getCValueCreatedBy(), - "CREATED_BY", "CreatedBy", "createdBy", inScopeOption); + jp.sf.pal.todolist.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(createdBy), getCValueCreatedBy(), "CREATED_BY", + "CreatedBy", "createdBy", likeSearchOption); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param createdByList The collection of createdBy as notInScope. + * @param createdBy The value of createdBy as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setCreatedBy_NotInScope(Collection createdByList) { - regCreatedBy(CK_NINS, cTL(createdByList)); + public void setCreatedBy_NotLikeSearch( + String createdBy, + jp.sf.pal.todolist.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(createdBy), getCValueCreatedBy(), "CREATED_BY", + "CreatedBy", "createdBy", likeSearchOption); } protected void regCreatedBy(ConditionKey key, Object value) { @@ -2957,7 +2902,7 @@ abstract protected ConditionValue getCValueCreatedBy(); /** - * Equal(=). And NullIgnored, OnceRegistered. {NotNull : TIMESTAMP} + * Equal(=). And NullIgnored, OnlyOnceRegistered. {NotNull : TIMESTAMP} * * @param updatedTime The value of updatedTime as equal. */ @@ -2966,7 +2911,7 @@ } /** - * NotEqual(!=). And NullIgnored, OnceRegistered. + * NotEqual(!=). And NullIgnored, OnlyOnceRegistered. * * @param updatedTime The value of updatedTime as notEqual. */ @@ -2975,7 +2920,7 @@ } /** - * GreaterThan(>). And NullIgnored, OnceRegistered. + * GreaterThan(>). And NullIgnored, OnlyOnceRegistered. * * @param updatedTime The value of updatedTime as greaterThan. */ @@ -2984,7 +2929,7 @@ } /** - * LessThan(>). And NullIgnored, OnceRegistered. + * LessThan(>). And NullIgnored, OnlyOnceRegistered. * * @param updatedTime The value of updatedTime as lessThan. */ @@ -2993,7 +2938,7 @@ } /** - * GreaterEqual(>). And NullIgnored, OnceRegistered. + * GreaterEqual(>). And NullIgnored, OnlyOnceRegistered. * * @param updatedTime The value of updatedTime as greaterEqual. */ @@ -3002,7 +2947,7 @@ } /** - * LessEqual(>). And NullIgnored, OnceRegistered. + * LessEqual(>). And NullIgnored, OnlyOnceRegistered. * * @param updatedTime The value of updatedTime as lessEqual. */ @@ -3012,7 +2957,7 @@ /** * FromTo($fromDate <= COLUMN_NAME <= $toDate). And NullIgnored, - * OnceRegistered. {NotNull : TIMESTAMP} + * OnlyOnceRegistered. {NotNull : TIMESTAMP} * * @param fromDate The from-date of updatedTime. (Nullable) * @param toDate The to-date of updatedTime. (Nullable) @@ -3030,7 +2975,7 @@ /** * FromTo($fromDate <= COLUMN_NAME < $toDate + 1). And NullIgnored, - * OnceRegistered. {NotNull : TIMESTAMP} + * OnlyOnceRegistered. {NotNull : TIMESTAMP} * * @param fromDate The from-date of updatedTime. (Nullable) * @param toDate The to-date of updatedTime. (Nullable) @@ -3056,7 +3001,7 @@ abstract protected ConditionValue getCValueUpdatedTime(); /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {NotNull : + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {NotNull : * VARCHAR(255)} * * @param updatedBy The value of updatedBy as equal. @@ -3066,7 +3011,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param updatedBy The value of updatedBy as notEqual. */ @@ -3075,7 +3020,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param updatedBy The value of updatedBy as greaterThan. */ @@ -3084,7 +3029,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param updatedBy The value of updatedBy as lessThan. */ @@ -3093,7 +3038,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param updatedBy The value of updatedBy as greaterEqual. */ @@ -3102,7 +3047,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param updatedBy The value of updatedBy as lessEqual. */ @@ -3111,7 +3056,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param updatedBy The value of updatedBy as prefixSearch. */ @@ -3120,20 +3065,6 @@ } /** - * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, - * SeveralRegistered. - * - * @param updatedBy The value of updatedBy as likeSearch. - * @param likeSearchOption The option of like-search. (NotNull) - */ - public void setUpdatedBy_LikeSearch( - String updatedBy, - jp.sf.pal.todolist.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. * @@ -3144,27 +3075,41 @@ } /** - * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * - * @param updatedBy The collection of updatedBy as inScope. - * @param inScopeOption The option of in-scope. (NotNull) + * @param updatedByList The collection of updatedBy as notInScope. */ - public void setUpdatedBy_InScope( + public void setUpdatedBy_NotInScope(Collection updatedByList) { + regUpdatedBy(CK_NINS, cTL(updatedByList)); + } + + /** + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param updatedBy The value of updatedBy as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) + */ + public void setUpdatedBy_LikeSearch( String updatedBy, - jp.sf.pal.todolist.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(updatedBy), getCValueUpdatedBy(), - "UPDATED_BY", "UpdatedBy", "updatedBy", inScopeOption); + jp.sf.pal.todolist.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(updatedBy), getCValueUpdatedBy(), "UPDATED_BY", + "UpdatedBy", "updatedBy", likeSearchOption); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param updatedByList The collection of updatedBy as notInScope. + * @param updatedBy The value of updatedBy as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setUpdatedBy_NotInScope(Collection updatedByList) { - regUpdatedBy(CK_NINS, cTL(updatedByList)); + public void setUpdatedBy_NotLikeSearch( + String updatedBy, + jp.sf.pal.todolist.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(updatedBy), getCValueUpdatedBy(), "UPDATED_BY", + "UpdatedBy", "updatedBy", likeSearchOption); } protected void regUpdatedBy(ConditionKey key, Object value) { @@ -3180,7 +3125,7 @@ abstract protected ConditionValue getCValueUpdatedBy(); /** - * Equal(=). And NullIgnored, OnceRegistered. {TIMESTAMP} + * Equal(=). And NullIgnored, OnlyOnceRegistered. {TIMESTAMP} * * @param deletedTime The value of deletedTime as equal. */ @@ -3189,7 +3134,7 @@ } /** - * NotEqual(!=). And NullIgnored, OnceRegistered. + * NotEqual(!=). And NullIgnored, OnlyOnceRegistered. * * @param deletedTime The value of deletedTime as notEqual. */ @@ -3198,7 +3143,7 @@ } /** - * GreaterThan(>). And NullIgnored, OnceRegistered. + * GreaterThan(>). And NullIgnored, OnlyOnceRegistered. * * @param deletedTime The value of deletedTime as greaterThan. */ @@ -3207,7 +3152,7 @@ } /** - * LessThan(>). And NullIgnored, OnceRegistered. + * LessThan(>). And NullIgnored, OnlyOnceRegistered. * * @param deletedTime The value of deletedTime as lessThan. */ @@ -3216,7 +3161,7 @@ } /** - * GreaterEqual(>). And NullIgnored, OnceRegistered. + * GreaterEqual(>). And NullIgnored, OnlyOnceRegistered. * * @param deletedTime The value of deletedTime as greaterEqual. */ @@ -3225,7 +3170,7 @@ } /** - * LessEqual(>). And NullIgnored, OnceRegistered. + * LessEqual(>). And NullIgnored, OnlyOnceRegistered. * * @param deletedTime The value of deletedTime as lessEqual. */ @@ -3235,7 +3180,7 @@ /** * FromTo($fromDate <= COLUMN_NAME <= $toDate). And NullIgnored, - * OnceRegistered. {TIMESTAMP} + * OnlyOnceRegistered. {TIMESTAMP} * * @param fromDate The from-date of deletedTime. (Nullable) * @param toDate The to-date of deletedTime. (Nullable) @@ -3253,7 +3198,7 @@ /** * FromTo($fromDate <= COLUMN_NAME < $toDate + 1). And NullIgnored, - * OnceRegistered. {TIMESTAMP} + * OnlyOnceRegistered. {TIMESTAMP} * * @param fromDate The from-date of deletedTime. (Nullable) * @param toDate The to-date of deletedTime. (Nullable) @@ -3267,14 +3212,14 @@ } /** - * IsNull(is null). And OnceRegistered. + * IsNull(is null). And OnlyOnceRegistered. */ public void setDeletedTime_IsNull() { regDeletedTime(CK_ISN, DUMMY_OBJECT); } /** - * IsNotNull(is not null). And OnceRegistered. + * IsNotNull(is not null). And OnlyOnceRegistered. */ public void setDeletedTime_IsNotNull() { regDeletedTime(CK_ISNN, DUMMY_OBJECT); @@ -3293,7 +3238,7 @@ abstract protected ConditionValue getCValueDeletedTime(); /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {VARCHAR(255)} + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {VARCHAR(255)} * * @param deletedBy The value of deletedBy as equal. */ @@ -3302,7 +3247,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param deletedBy The value of deletedBy as notEqual. */ @@ -3311,7 +3256,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param deletedBy The value of deletedBy as greaterThan. */ @@ -3320,7 +3265,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param deletedBy The value of deletedBy as lessThan. */ @@ -3329,7 +3274,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param deletedBy The value of deletedBy as greaterEqual. */ @@ -3338,7 +3283,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param deletedBy The value of deletedBy as lessEqual. */ @@ -3347,7 +3292,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param deletedBy The value of deletedBy as prefixSearch. */ @@ -3356,20 +3301,6 @@ } /** - * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, - * SeveralRegistered. - * - * @param deletedBy The value of deletedBy as likeSearch. - * @param likeSearchOption The option of like-search. (NotNull) - */ - public void setDeletedBy_LikeSearch( - String deletedBy, - jp.sf.pal.todolist.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. * @@ -3380,38 +3311,52 @@ } /** - * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * - * @param deletedBy The collection of deletedBy as inScope. - * @param inScopeOption The option of in-scope. (NotNull) + * @param deletedByList The collection of deletedBy as notInScope. */ - public void setDeletedBy_InScope( + public void setDeletedBy_NotInScope(Collection deletedByList) { + regDeletedBy(CK_NINS, cTL(deletedByList)); + } + + /** + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param deletedBy The value of deletedBy as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) + */ + public void setDeletedBy_LikeSearch( String deletedBy, - jp.sf.pal.todolist.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(deletedBy), getCValueDeletedBy(), - "DELETED_BY", "DeletedBy", "deletedBy", inScopeOption); + jp.sf.pal.todolist.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(deletedBy), getCValueDeletedBy(), "DELETED_BY", + "DeletedBy", "deletedBy", likeSearchOption); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param deletedByList The collection of deletedBy as notInScope. + * @param deletedBy The value of deletedBy as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setDeletedBy_NotInScope(Collection deletedByList) { - regDeletedBy(CK_NINS, cTL(deletedByList)); + public void setDeletedBy_NotLikeSearch( + String deletedBy, + jp.sf.pal.todolist.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(deletedBy), getCValueDeletedBy(), "DELETED_BY", + "DeletedBy", "deletedBy", likeSearchOption); } /** - * IsNull(is null). And OnceRegistered. + * IsNull(is null). And OnlyOnceRegistered. */ public void setDeletedBy_IsNull() { regDeletedBy(CK_ISN, DUMMY_OBJECT); } /** - * IsNotNull(is not null). And OnceRegistered. + * IsNotNull(is not null). And OnlyOnceRegistered. */ public void setDeletedBy_IsNotNull() { regDeletedBy(CK_ISNN, DUMMY_OBJECT); @@ -3430,7 +3375,7 @@ abstract protected ConditionValue getCValueDeletedBy(); /** - * Equal(=). And NullIgnored, OnceRegistered. {NotNull : INTEGER} + * Equal(=). And NullIgnored, OnlyOnceRegistered. {NotNull : INTEGER} * * @param versionno The value of versionno as equal. */ @@ -3439,7 +3384,7 @@ } /** - * NotEqual(!=). And NullIgnored, OnceRegistered. + * NotEqual(!=). And NullIgnored, OnlyOnceRegistered. * * @param versionno The value of versionno as notEqual. */ @@ -3448,7 +3393,7 @@ } /** - * GreaterThan(>). And NullIgnored, OnceRegistered. + * GreaterThan(>). And NullIgnored, OnlyOnceRegistered. * * @param versionno The value of versionno as greaterThan. */ @@ -3457,7 +3402,7 @@ } /** - * LessThan(<). And NullIgnored, OnceRegistered. + * LessThan(<). And NullIgnored, OnlyOnceRegistered. * * @param versionno The value of versionno as lessThan. */ @@ -3466,7 +3411,7 @@ } /** - * GreaterEqual(>=). And NullIgnored, OnceRegistered. + * GreaterEqual(>=). And NullIgnored, OnlyOnceRegistered. * * @param versionno The value of versionno as greaterEqual. */ @@ -3475,7 +3420,7 @@ } /** - * LessEqual(<=). And NullIgnored, OnceRegistered. + * LessEqual(<=). And NullIgnored, OnlyOnceRegistered. * * @param versionno The value of versionno as lessEqual. */ @@ -3515,6 +3460,50 @@ abstract protected ConditionValue getCValueVersionno(); + public SSQFunction scalar_Equal() { + return xcreateSSQFunction("="); + } + + public SSQFunction scalar_GreaterEqual() { + return xcreateSSQFunction(">="); + } + + public SSQFunction scalar_GreaterThan() { + return xcreateSSQFunction(">"); + } + + public SSQFunction scalar_LessEqual() { + return xcreateSSQFunction("<="); + } + + public SSQFunction scalar_LessThan() { + return xcreateSSQFunction("<"); + } + + protected SSQFunction xcreateSSQFunction(final String operand) { + return new SSQFunction(new SSQSetupper() { + public void setup(String function, SubQuery subQuery) { + xscalarSubQuery(function, subQuery, operand); + } + }); + } + + protected void xscalarSubQuery(String function, + SubQuery subQuery, String operand) { + assertObjectNotNull("subQuery", subQuery); + UserInfoCB cb = new UserInfoCB(); + cb.xsetupForScalarSubQuery(); + subQuery.query(cb); + String subQueryPropertyName = keepScalarSubQuery(cb.query()); // for + // saving + // query + // -value. + registerScalarSubQuery(function, cb.query(), subQueryPropertyName, + operand); + } + + public abstract String keepScalarSubQuery(UserInfoCQ subQuery); + // Very Internal (for Suppressing Warn about 'Not Use Import') protected String getConditionBeanClassNameInternally() { return UserInfoCB.class.getName(); Modified: todolist/trunk/src/main/java/jp/sf/pal/todolist/db/cbean/cq/bs/BsGroupInfoCQ.java =================================================================== --- todolist/trunk/src/main/java/jp/sf/pal/todolist/db/cbean/cq/bs/BsGroupInfoCQ.java 2008-12-27 22:20:45 UTC (rev 1632) +++ todolist/trunk/src/main/java/jp/sf/pal/todolist/db/cbean/cq/bs/BsGroupInfoCQ.java 2008-12-27 22:21:53 UTC (rev 1633) @@ -5,6 +5,7 @@ import jp.sf.pal.todolist.db.allcommon.cbean.ConditionQuery; import jp.sf.pal.todolist.db.allcommon.cbean.cvalue.ConditionValue; import jp.sf.pal.todolist.db.allcommon.cbean.sqlclause.SqlClause; +import jp.sf.pal.todolist.db.cbean.GroupInfoCB; import jp.sf.pal.todolist.db.cbean.cq.GroupInfoCQ; import jp.sf.pal.todolist.db.cbean.cq.GroupMappingCQ; import jp.sf.pal.todolist.db.cbean.cq.UserInfoCQ; @@ -15,7 +16,6 @@ * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public class BsGroupInfoCQ extends AbstractBsGroupInfoCQ { //========================================================================== @@ -61,7 +61,7 @@ public GroupInfoCIQ on() { if (isBaseQuery(this)) { throw new UnsupportedOperationException( - "Unsupported onClause of Base Table!"); + "Unsupported on-clause for local table!"); } GroupInfoCIQ inlineQuery = inline(); inlineQuery.xsetOnClauseInline(true); @@ -219,37 +219,37 @@ return "groupId_NotExistsSubQuery_UserInfoList." + key; } - protected Map _groupId_DeriveSubQuery_GroupMappingListMap; + protected Map _groupId_DerivedReferrer_GroupMappingListMap; - public Map getGroupId_DeriveSubQuery_GroupMappingList() { - return _groupId_DeriveSubQuery_GroupMappingListMap; + public Map getGroupId_DerivedReferrer_GroupMappingList() { + return _groupId_DerivedReferrer_GroupMappingListMap; } - public String keepGroupId_DeriveSubQuery_GroupMappingList( + public String keepGroupId_DerivedReferrer_GroupMappingList( GroupMappingCQ subQuery) { - if (_groupId_DeriveSubQuery_GroupMappingListMap == null) { - _groupId_DeriveSubQuery_GroupMappingListMap = newLinkedHashMap(); + if (_groupId_DerivedReferrer_GroupMappingListMap == null) { + _groupId_DerivedReferrer_GroupMappingListMap = newLinkedHashMap(); } String key = "subQueryMapKey" - + (_groupId_DeriveSubQuery_GroupMappingListMap.size() + 1); - _groupId_DeriveSubQuery_GroupMappingListMap.put(key, subQuery); - return "groupId_DeriveSubQuery_GroupMappingList." + key; + + (_groupId_DerivedReferrer_GroupMappingListMap.size() + 1); + _groupId_DerivedReferrer_GroupMappingListMap.put(key, subQuery); + return "groupId_DerivedReferrer_GroupMappingList." + key; } - protected Map _groupId_DeriveSubQuery_UserInfoListMap; + protected Map _groupId_DerivedReferrer_UserInfoListMap; - public Map getGroupId_DeriveSubQuery_UserInfoList() { - return _groupId_DeriveSubQuery_UserInfoListMap; + public Map getGroupId_DerivedReferrer_UserInfoList() { + return _groupId_DerivedReferrer_UserInfoListMap; } - public String keepGroupId_DeriveSubQuery_UserInfoList(UserInfoCQ subQuery) { - if (_groupId_DeriveSubQuery_UserInfoListMap == null) { - _groupId_DeriveSubQuery_UserInfoListMap = newLinkedHashMap(); + public String keepGroupId_DerivedReferrer_UserInfoList(UserInfoCQ subQuery) { + if (_groupId_DerivedReferrer_UserInfoListMap == null) { + _groupId_DerivedReferrer_UserInfoListMap = newLinkedHashMap(); } String key = "subQueryMapKey" - + (_groupId_DeriveSubQuery_UserInfoListMap.size() + 1); - _groupId_DeriveSubQuery_UserInfoListMap.put(key, subQuery); - return "groupId_DeriveSubQuery_UserInfoList." + key; + + (_groupId_DerivedReferrer_UserInfoListMap.size() + 1); + _groupId_DerivedReferrer_UserInfoListMap.put(key, subQuery); + return "groupId_DerivedReferrer_UserInfoList." + key; } public BsGroupInfoCQ addOrderBy_GroupId_Asc() { @@ -564,7 +564,30 @@ // ========= // Foreign Query // ============= + //========================================================================== + // ========= + // Derived Query + // ============= + protected Map _scalarSubQueryMap; + public Map getScalarSubQuery() { + return _scalarSubQueryMap; + } + + public String keepScalarSubQuery(GroupInfoCQ subQuery) { + if (_scalarSubQueryMap == null) { + _scalarSubQueryMap = newLinkedHashMap(); + } + String key = "subQueryMapKey" + (_scalarSubQueryMap.size() + 1); + _scalarSubQueryMap.put(key, subQuery); + return "scalarSubQuery." + key; + } + + // Very Internal (for Suppressing Warn about 'Not Use Import') + protected String getConditionBeanClassNameInternally() { + return GroupInfoCB.class.getName(); + } + protected String getConditionQueryClassNameInternally() { return GroupInfoCQ.class.getName(); } Modified: todolist/trunk/src/main/java/jp/sf/pal/todolist/db/cbean/cq/bs/BsGroupMappingCQ.java =================================================================== --- todolist/trunk/src/main/java/jp/sf/pal/todolist/db/cbean/cq/bs/BsGroupMappingCQ.java 2008-12-27 22:20:45 UTC (rev 1632) +++ todolist/trunk/src/main/java/jp/sf/pal/todolist/db/cbean/cq/bs/BsGroupMappingCQ.java 2008-12-27 22:21:53 UTC (rev 1633) @@ -5,6 +5,7 @@ import jp.sf.pal.todolist.db.allcommon.cbean.ConditionQuery; import jp.sf.pal.todolist.db.allcommon.cbean.cvalue.ConditionValue; import jp.sf.pal.todolist.db.allcommon.cbean.sqlclause.SqlClause; +import jp.sf.pal.todolist.db.cbean.GroupMappingCB; import jp.sf.pal.todolist.db.cbean.cq.GroupInfoCQ; import jp.sf.pal.todolist.db.cbean.cq.GroupMappingCQ; import jp.sf.pal.todolist.db.cbean.cq.UserInfoCQ; @@ -15,7 +16,6 @@ * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public class BsGroupMappingCQ extends AbstractBsGroupMappingCQ { //========================================================================== @@ -61,7 +61,7 @@ public GroupMappingCIQ on() { if (isBaseQuery(this)) { throw new UnsupportedOperationException( - "Unsupported onClause of Base Table!"); + "Unsupported on-clause for local table!"); } GroupMappingCIQ inlineQuery = inline(); inlineQuery.xsetOnClauseInline(true); @@ -210,7 +210,6 @@ // ========= // Foreign Query // ============= - public GroupInfoCQ queryGroupInfo() { return getConditionQueryGroupInfo(); } @@ -219,20 +218,13 @@ public GroupInfoCQ getConditionQueryGroupInfo() { if (_conditionQueryGroupInfo == null) { - _conditionQueryGroupInfo = createQueryGroupInfo(); - setupOuterJoin_GroupInfo(); + _conditionQueryGroupInfo = xcreateQueryGroupInfo(); + xsetupOuterJoinGroupInfo(); } return _conditionQueryGroupInfo; } - protected void setupOuterJoin_GroupInfo() { - Map joinOnMap = newLinkedHashMap(); - joinOnMap.put(getRealColumnName("GROUP_ID"), - getConditionQueryGroupInfo().getRealColumnName("GROUP_ID")); - registerOuterJoin(getConditionQueryGroupInfo(), joinOnMap); - } - - protected GroupInfoCQ createQueryGroupInfo() { + protected GroupInfoCQ xcreateQueryGroupInfo() { String nrp = resolveNextRelationPath("GROUP_MAPPING", "groupInfo"); String jan = resolveJoinAliasName(nrp, getNextNestLevel()); GroupInfoCQ cq = new GroupInfoCQ(this, getSqlClause(), jan, @@ -242,6 +234,14 @@ return cq; } + protected void xsetupOuterJoinGroupInfo() { + GroupInfoCQ cq = getConditionQueryGroupInfo(); + Map joinOnMap = newLinkedHashMap(); + joinOnMap.put(getRealColumnName("GROUP_ID"), cq + .getRealColumnName("GROUP_ID")); + registerOuterJoin(cq, joinOnMap); + } + public boolean hasConditionQueryGroupInfo() { return _conditionQueryGroupInfo != null; } @@ -254,20 +254,13 @@ public UserInfoCQ getConditionQueryUserInfo() { if (_conditionQueryUserInfo == null) { - _conditionQueryUserInfo = createQueryUserInfo(); - setupOuterJoin_UserInfo(); + _conditionQueryUserInfo = xcreateQueryUserInfo(); + xsetupOuterJoinUserInfo(); } return _conditionQueryUserInfo; } - protected void setupOuterJoin_UserInfo() { - Map joinOnMap = newLinkedHashMap(); - joinOnMap.put(getRealColumnName("USER_ID"), getConditionQueryUserInfo() - .getRealColumnName("USER_ID")); - registerOuterJoin(getConditionQueryUserInfo(), joinOnMap); - } - - protected UserInfoCQ createQueryUserInfo() { + protected UserInfoCQ xcreateQueryUserInfo() { String nrp = resolveNextRelationPath("GROUP_MAPPING", "userInfo"); String jan = resolveJoinAliasName(nrp, getNextNestLevel()); UserInfoCQ cq = new UserInfoCQ(this, getSqlClause(), jan, @@ -277,10 +270,42 @@ return cq; } + protected void xsetupOuterJoinUserInfo() { + UserInfoCQ cq = getConditionQueryUserInfo(); + Map joinOnMap = newLinkedHashMap(); + joinOnMap.put(getRealColumnName("USER_ID"), cq + .getRealColumnName("USER_ID")); + registerOuterJoin(cq, joinOnMap); + } + public boolean hasConditionQueryUserInfo() { return _conditionQueryUserInfo != null; } + //========================================================================== + // ========= + // Derived Query + // ============= + protected Map _scalarSubQueryMap; + + public Map getScalarSubQuery() { + return _scalarSubQueryMap; + } + + public String keepScalarSubQuery(GroupMappingCQ subQuery) { + if (_scalarSubQueryMap == null) { + _scalarSubQueryMap = newLinkedHashMap(); + } + String key = "subQueryMapKey" + (_scalarSubQueryMap.size() + 1); + _scalarSubQueryMap.put(key, subQuery); + return "scalarSubQuery." + key; + } + + // Very Internal (for Suppressing Warn about 'Not Use Import') + protected String getConditionBeanClassNameInternally() { + return GroupMappingCB.class.getName(); + } + protected String getConditionQueryClassNameInternally() { return GroupMappingCQ.class.getName(); } Modified: todolist/trunk/src/main/java/jp/sf/pal/todolist/db/cbean/cq/bs/BsRoleInfoCQ.java =================================================================== --- todolist/trunk/src/main/java/jp/sf/pal/todolist/db/cbean/cq/bs/BsRoleInfoCQ.java 2008-12-27 22:20:45 UTC (rev 1632) +++ todolist/trunk/src/main/java/jp/sf/pal/todolist/db/cbean/cq/bs/BsRoleInfoCQ.java 2008-12-27 22:21:53 UTC (rev 1633) @@ -5,6 +5,7 @@ import jp.sf.pal.todolist.db.allcommon.cbean.ConditionQuery; import jp.sf.pal.todolist.db.allcommon.cbean.cvalue.ConditionValue; import jp.sf.pal.todolist.db.allcommon.cbean.sqlclause.SqlClause; +import jp.sf.pal.todolist.db.cbean.RoleInfoCB; import jp.sf.pal.todolist.db.cbean.cq.RoleInfoCQ; import jp.sf.pal.todolist.db.cbean.cq.RoleMappingCQ; import jp.sf.pal.todolist.db.cbean.cq.UserInfoCQ; @@ -15,7 +16,6 @@ * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public class BsRoleInfoCQ extends AbstractBsRoleInfoCQ { //========================================================================== @@ -61,7 +61,7 @@ public RoleInfoCIQ on() { if (isBaseQuery(this)) { throw new UnsupportedOperationException( - "Unsupported onClause of Base Table!"); + "Unsupported on-clause for local table!"); } RoleInfoCIQ inlineQuery = inline(); inlineQuery.xsetOnClauseInline(true); @@ -218,37 +218,37 @@ return "roleId_NotExistsSubQuery_UserInfoList." + key; } - protected Map _roleId_DeriveSubQuery_RoleMappingListMap; + protected Map _roleId_DerivedReferrer_RoleMappingListMap; - public Map getRoleId_DeriveSubQuery_RoleMappingList() { - return _roleId_DeriveSubQuery_RoleMappingListMap; + public Map getRoleId_DerivedReferrer_RoleMappingList() { + return _roleId_DerivedReferrer_RoleMappingListMap; } - public String keepRoleId_DeriveSubQuery_RoleMappingList( + public String keepRoleId_DerivedReferrer_RoleMappingList( RoleMappingCQ subQuery) { - if (_roleId_DeriveSubQuery_RoleMappingListMap == null) { - _roleId_DeriveSubQuery_RoleMappingListMap = newLinkedHashMap(); + if (_roleId_DerivedReferrer_RoleMappingListMap == null) { + _roleId_DerivedReferrer_RoleMappingListMap = newLinkedHashMap(); } String key = "subQueryMapKey" - + (_roleId_DeriveSubQuery_RoleMappingListMap.size() + 1); - _roleId_DeriveSubQuery_RoleMappingListMap.put(key, subQuery); - return "roleId_DeriveSubQuery_RoleMappingList." + key; + + (_roleId_DerivedReferrer_RoleMappingListMap.size() + 1); + _roleId_DerivedReferrer_RoleMappingListMap.put(key, subQuery); + return "roleId_DerivedReferrer_RoleMappingList." + key; } - protected Map _roleId_DeriveSubQuery_UserInfoListMap; + protected Map _roleId_DerivedReferrer_UserInfoListMap; - public Map getRoleId_DeriveSubQuery_UserInfoList() { - return _roleId_DeriveSubQuery_UserInfoListMap; + public Map getRoleId_DerivedReferrer_UserInfoList() { + return _roleId_DerivedReferrer_UserInfoListMap; } - public String keepRoleId_DeriveSubQuery_UserInfoList(UserInfoCQ subQuery) { - if (_roleId_DeriveSubQuery_UserInfoListMap == null) { - _roleId_DeriveSubQuery_UserInfoListMap = newLinkedHashMap(); + public String keepRoleId_DerivedReferrer_UserInfoList(UserInfoCQ subQuery) { + if (_roleId_DerivedReferrer_UserInfoListMap == null) { + _roleId_DerivedReferrer_UserInfoListMap = newLinkedHashMap(); } String key = "subQueryMapKey" - + (_roleId_DeriveSubQuery_UserInfoListMap.size() + 1); - _roleId_DeriveSubQuery_UserInfoListMap.put(key, subQuery); - return "roleId_DeriveSubQuery_UserInfoList." + key; + + (_roleId_DerivedReferrer_UserInfoListMap.size() + 1); + _roleId_DerivedReferrer_UserInfoListMap.put(key, subQuery); + return "roleId_DerivedReferrer_UserInfoList." + key; } public BsRoleInfoCQ addOrderBy_RoleId_Asc() { @@ -563,7 +563,30 @@ // ========= // Foreign Query // ============= + //========================================================================== + // ========= + // Derived Query + // ============= + protected Map _scalarSubQueryMap; + public Map getScalarSubQuery() { + return _scalarSubQueryMap; + } + + public String keepScalarSubQuery(RoleInfoCQ subQuery) { + if (_scalarSubQueryMap == null) { + _scalarSubQueryMap = newLinkedHashMap(); + } + String key = "subQueryMapKey" + (_scalarSubQueryMap.size() + 1); + _scalarSubQueryMap.put(key, subQuery); + return "scalarSubQuery." + key; + } + + // Very Internal (for Suppressing Warn about 'Not Use Import') + protected String getConditionBeanClassNameInternally() { + return RoleInfoCB.class.getName(); + } + protected String getConditionQueryClassNameInternally() { return RoleInfoCQ.class.getName(); } Modified: todolist/trunk/src/main/java/jp/sf/pal/todolist/db/cbean/cq/bs/BsRoleMappingCQ.java =================================================================== --- todolist/trunk/src/main/java/jp/sf/pal/todolist/db/cbean/cq/bs/BsRoleMappingCQ.java 2008-12-27 22:20:45 UTC (rev 1632) +++ todolist/trunk/src/main/java/jp/sf/pal/todolist/db/cbean/cq/bs/BsRoleMappingCQ.java 2008-12-27 22:21:53 UTC (rev 1633) @@ -5,6 +5,7 @@ import jp.sf.pal.todolist.db.allcommon.cbean.ConditionQuery; import jp.sf.pal.todolist.db.allcommon.cbean.cvalue.ConditionValue; import jp.sf.pal.todolist.db.allcommon.cbean.sqlclause.SqlClause; +import jp.sf.pal.todolist.db.cbean.RoleMappingCB; import jp.sf.pal.todolist.db.cbean.cq.RoleInfoCQ; import jp.sf.pal.todolist.db.cbean.cq.RoleMappingCQ; import jp.sf.pal.todolist.db.cbean.cq.UserInfoCQ; @@ -15,7 +16,6 @@ * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public class BsRoleMappingCQ extends AbstractBsRoleMappingCQ { //========================================================================== @@ -61,7 +61,7 @@ public RoleMappingCIQ on() { if (isBaseQuery(this)) { throw new UnsupportedOperationException( - "Unsupported onClause of Base Table!"); + "Unsupported on-clause for local table!"); } RoleMappingCIQ inlineQuery = inline(); inlineQuery.xsetOnClauseInline(true); @@ -210,7 +210,6 @@ // ========= // Foreign Query // ============= - public RoleInfoCQ queryRoleInfo() { return getConditionQueryRoleInfo(); } @@ -219,20 +218,13 @@ public RoleInfoCQ getConditionQueryRoleInfo() { if (_conditionQueryRoleInfo == null) { - _conditionQueryRoleInfo = createQueryRoleInfo(); - setupOuterJoin_RoleInfo(); + _conditionQueryRoleInfo = xcreateQueryRoleInfo(); + xsetupOuterJoinRoleInfo(); } return _conditionQueryRoleInfo; } - protected void setupOuterJoin_RoleInfo() { - Map joinOnMap = newLinkedHashMap(); - joinOnMap.put(getRealColumnName("ROLE_ID"), getConditionQueryRoleInfo() - .getRealColumnName("ROLE_ID")); - registerOuterJoin(getConditionQueryRoleInfo(), joinOnMap); - } - - protected RoleInfoCQ createQueryRoleInfo() { + protected RoleInfoCQ xcreateQueryRoleInfo() { String nrp = resolveNextRelationPath("ROLE_MAPPING", "roleInfo"); String jan = resolveJoinAliasName(nrp, getNextNestLevel()); RoleInfoCQ cq = new RoleInfoCQ(this, getSqlClause(), jan, @@ -242,6 +234,14 @@ return cq; } + protected void xsetupOuterJoinRoleInfo() { + RoleInfoCQ cq = getConditionQueryRoleInfo(); + Map joinOnMap = newLinkedHashMap(); + joinOnMap.put(getRealColumnName("ROLE_ID"), cq + .getRealColumnName("ROLE_ID")); + registerOuterJoin(cq, joinOnMap); + } + public boolean hasConditionQueryRoleInfo() { return _conditionQueryRoleInfo != null; } @@ -254,20 +254,13 @@ public UserInfoCQ getConditionQueryUserInfo() { if (_conditionQueryUserInfo == null) { - _conditionQueryUserInfo = createQueryUserInfo(); - setupOuterJoin_UserInfo(); + _conditionQueryUserInfo = xcreateQueryUserInfo(); + xsetupOuterJoinUserInfo(); } return _conditionQueryUserInfo; } - protected void setupOuterJoin_UserInfo() { - Map joinOnMap = newLinkedHashMap(); - joinOnMap.put(getRealColumnName("USER_ID"), getConditionQueryUserInfo() - .getRealColumnName("USER_ID")); - registerOuterJoin(getConditionQueryUserInfo(), joinOnMap); - } - - protected UserInfoCQ createQueryUserInfo() { + protected UserInfoCQ xcreateQueryUserInfo() { String nrp = resolveNextRelationPath("ROLE_MAPPING", "userInfo"); String jan = resolveJoinAliasName(nrp, getNextNestLevel()); UserInfoCQ cq = new UserInfoCQ(this, getSqlClause(), jan, @@ -277,10 +270,42 @@ return cq; } + protected void xsetupOuterJoinUserInfo() { + UserInfoCQ cq = getConditionQueryUserInfo(); + Map joinOnMap = newLinkedHashMap(); + joinOnMap.put(getRealColumnName("USER_ID"), cq + .getRealColumnName("USER_ID")); + registerOuterJoin(cq, joinOnMap); + } + public boolean hasConditionQueryUserInfo() { return _conditionQueryUserInfo != null; } + //========================================================================== + // ========= + // Derived Query + // ============= + protected Map _scalarSubQueryMap; + + public Map getScalarSubQuery() { + return _scalarSubQueryMap; + } + + public String keepScalarSubQuery(RoleMappingCQ subQuery) { + if (_scalarSubQueryMap == null) { + _scalarSubQueryMap = newLinkedHashMap(); + } + String key = "subQueryMapKey" + (_scalarSubQueryMap.size() + 1); + _scalarSubQueryMap.put(key, subQuery); + return "scalarSubQuery." + key; + } + + // Very Internal (for Suppressing Warn about 'Not Use Import') + protected String getConditionBeanClassNameInternally() { + return RoleMappingCB.class.getName(); + } + protected String getConditionQueryClassNameInternally() { return RoleMappingCQ.class.getName(); } Modified: todolist/trunk/src/main/java/jp/sf/pal/todolist/db/cbean/cq/bs/BsTodoCQ.java =================================================================== --- todolist/trunk/src/main/java/jp/sf/pal/todolist/db/cbean/cq/bs/BsTodoCQ.java 2008-12-27 22:20:45 UTC (rev 1632) +++ todolist/trunk/src/main/java/jp/sf/pal/todolist/db/cbean/cq/bs/BsTodoCQ.java 2008-12-27 22:21:53 UTC (rev 1633) @@ -5,6 +5,7 @@ import jp.sf.pal.todolist.db.allcommon.cbean.ConditionQuery; import jp.sf.pal.todolist.db.allcommon.cbean.cvalue.ConditionValue; import jp.sf.pal.todolist.db.allcommon.cbean.sqlclause.SqlClause; +import jp.sf.pal.todolist.db.cbean.TodoCB; import jp.sf.pal.todolist.db.cbean.cq.TodoCQ; import jp.sf.pal.todolist.db.cbean.cq.TodoMappingCQ; import jp.sf.pal.todolist.db.cbean.cq.UserInfoCQ; @@ -15,7 +16,6 @@ * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public class BsTodoCQ extends AbstractBsTodoCQ { //========================================================================== @@ -61,7 +61,7 @@ public TodoCIQ on() { if (isBaseQuery(this)) { throw new UnsupportedOperationException( - "Unsupported onClause of Base Table!"); + "Unsupported on-clause for local table!"); } TodoCIQ inlineQuery = inline(); inlineQuery.xsetOnClauseInline(true); @@ -152,20 +152,20 @@ return "id_NotExistsSubQuery_TodoMappingList." + key; } - protected Map _id_DeriveSubQuery_TodoMappingListMap; + protected Map _id_DerivedReferrer_TodoMappingListMap; - public Map getId_DeriveSubQuery_TodoMappingList() { - return _id_DeriveSubQuery_TodoMappingListMap; + public Map getId_DerivedReferrer_TodoMappingList() { + return _id_DerivedReferrer_TodoMappingListMap; } - public String keepId_DeriveSubQuery_TodoMappingList(TodoMappingCQ subQuery) { - if (_id_DeriveSubQuery_TodoMappingListMap == null) { - _id_DeriveSubQuery_TodoMappingListMap = newLinkedHashMap(); + public String keepId_DerivedReferrer_TodoMappingList(TodoMappingCQ subQuery) { + if (_id_DerivedReferrer_TodoMappingListMap == null) { + _id_DerivedReferrer_TodoMappingListMap = newLinkedHashMap(); } String key = "subQueryMapKey" - + (_id_DeriveSubQuery_TodoMappingListMap.size() + 1); - _id_DeriveSubQuery_TodoMappingListMap.put(key, subQuery); - return "id_DeriveSubQuery_TodoMappingList." + key; + + (_id_DerivedReferrer_TodoMappingListMap.size() + 1); + _id_DerivedReferrer_TodoMappingListMap.put(key, subQuery); + return "id_DerivedReferrer_TodoMappingList." + key; } public BsTodoCQ addOrderBy_Id_Asc() { @@ -525,7 +525,6 @@ // ========= // Foreign Query // ============= - public UserInfoCQ queryUserInfo() { return getConditionQueryUserInfo(); } @@ -534,20 +533,13 @@ public UserInfoCQ getConditionQueryUserInfo() { if (_conditionQueryUserInfo == null) { - _conditionQueryUserInfo = createQueryUserInfo(); - setupOuterJoin_UserInfo(); + _conditionQueryUserInfo = xcreateQueryUserInfo(); + xsetupOuterJoinUserInfo(); } return _conditionQueryUserInfo; } - protected void setupOuterJoin_UserInfo() { - Map joinOnMap = newLinkedHashMap(); - joinOnMap.put(getRealColumnName("CREATED_BY"), - getConditionQueryUserInfo().getRealColumnName("USER_ID")); - registerOuterJoin(getConditionQueryUserInfo(), joinOnMap); - } - - protected UserInfoCQ createQueryUserInfo() { + protected UserInfoCQ xcreateQueryUserInfo() { String nrp = resolveNextRelationPath("TODO", "userInfo"); String jan = resolveJoinAliasName(nrp, getNextNestLevel()); UserInfoCQ cq = new UserInfoCQ(this, getSqlClause(), jan, @@ -557,10 +549,42 @@ return cq; } + protected void xsetupOuterJoinUserInfo() { + UserInfoCQ cq = getConditionQueryUserInfo(); + Map joinOnMap = newLinkedHashMap(); + joinOnMap.put(getRealColumnName("CREATED_BY"), cq + .getRealColumnName("USER_ID")); + registerOuterJoin(cq, joinOnMap); + } + public boolean hasConditionQueryUserInfo() { return _conditionQueryUserInfo != null; } + //========================================================================== + // ========= + // Derived Query + // ============= + protected Map _scalarSubQueryMap; + + public Map getScalarSubQuery() { + return _scalarSubQueryMap; + } + + public String keepScalarSubQuery(TodoCQ subQuery) { + if (_scalarSubQueryMap == null) { + _scalarSubQueryMap = newLinkedHashMap(); + } + String key = "subQueryMapKey" + (_scalarSubQueryMap.size() + 1); + _scalarSubQueryMap.put(key, subQuery); + return "scalarSubQuery." + key; + } + + // Very Internal (for Suppressing Warn about 'Not Use Import') + protected String getConditionBeanClassNameInternally() { + return TodoCB.class.getName(); + } + protected String getConditionQueryClassNameInternally() { return TodoCQ.class.getName(); } Modified: todolist/trunk/src/main/java/jp/sf/pal/todolist/db/cbean/cq/bs/BsTodoCategoryCQ.java =================================================================== --- todolist/trunk/src/main/java/jp/sf/pal/todolist/db/cbean/cq/bs/BsTodoCategoryCQ.java 2008-12-27 22:20:45 UTC (rev 1632) +++ todolist/trunk/src/main/java/jp/sf/pal/todolist/db/cbean/cq/bs/BsTodoCategoryCQ.java 2008-12-27 22:21:53 UTC (rev 1633) @@ -5,6 +5,7 @@ import jp.sf.pal.todolist.db.allcommon.cbean.ConditionQuery; import jp.sf.pal.todolist.db.allcommon.cbean.cvalue.ConditionValue; import jp.sf.pal.todolist.db.allcommon.cbean.sqlclause.SqlClause; +import jp.sf.pal.todolist.db.cbean.TodoCategoryCB; import jp.sf.pal.todolist.db.cbean.cq.TodoCategoryCQ; import jp.sf.pal.todolist.db.cbean.cq.TodoMappingCQ; import jp.sf.pal.todolist.db.cbean.cq.UserInfoCQ; @@ -15,7 +16,6 @@ * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public class BsTodoCategoryCQ extends AbstractBsTodoCategoryCQ { //========================================================================== @@ -61,7 +61,7 @@ public TodoCategoryCIQ on() { if (isBaseQuery(this)) { throw new UnsupportedOperationException( - "Unsupported onClause of Base Table!"); + "Unsupported on-clause for local table!"); } TodoCategoryCIQ inlineQuery = inline(); inlineQuery.xsetOnClauseInline(true); @@ -152,20 +152,20 @@ return "id_NotExistsSubQuery_TodoMappingList." + key; } - protected Map _id_DeriveSubQuery_TodoMappingListMap; + protected Map _id_DerivedReferrer_TodoMappingListMap; - public Map getId_DeriveSubQuery_TodoMappingList() { - return _id_DeriveSubQuery_TodoMappingListMap; + public Map getId_DerivedReferrer_TodoMappingList() { + return _id_DerivedReferrer_TodoMappingListMap; } - public String keepId_DeriveSubQuery_TodoMappingList(TodoMappingCQ subQuery) { - if (_id_DeriveSubQuery_TodoMappingListMap == null) { - _id_DeriveSubQuery_TodoMappingListMap = newLinkedHashMap(); + public String keepId_DerivedReferrer_TodoMappingList(TodoMappingCQ subQuery) { + if (_id_DerivedReferrer_TodoMappingListMap == null) { + _id_DerivedReferrer_TodoMappingListMap = newLinkedHashMap(); } String key = "subQueryMapKey" - + (_id_DeriveSubQuery_TodoMappingListMap.size() + 1); - _id_DeriveSubQuery_TodoMappingListMap.put(key, subQuery); - return "id_DeriveSubQuery_TodoMappingList." + key; + + (_id_DerivedReferrer_TodoMappingListMap.size() + 1); + _id_DerivedReferrer_TodoMappingListMap.put(key, subQuery); + return "id_DerivedReferrer_TodoMappingList." + key; } public BsTodoCategoryCQ addOrderBy_Id_Asc() { @@ -433,7 +433,6 @@ // ========= // Foreign Query // ============= - public UserInfoCQ queryUserInfo() { return getConditionQueryUserInfo(); } @@ -442,20 +441,13 @@ public UserInfoCQ getConditionQueryUserInfo() { if (_conditionQueryUserInfo == null) { - _conditionQueryUserInfo = createQueryUserInfo(); - setupOuterJoin_UserInfo(); + _conditionQueryUserInfo = xcreateQueryUserInfo(); + xsetupOuterJoinUserInfo(); } return _conditionQueryUserInfo; } - protected void setupOuterJoin_UserInfo() { - Map joinOnMap = newLinkedHashMap(); - joinOnMap.put(getRealColumnName("USER_ID"), getConditionQueryUserInfo() - .getRealColumnName("USER_ID")); - registerOuterJoin(getConditionQueryUserInfo(), joinOnMap); - } - - protected UserInfoCQ createQueryUserInfo() { + protected UserInfoCQ xcreateQueryUserInfo() { String nrp = resolveNextRelationPath("TODO_CATEGORY", "userInfo"); String jan = resolveJoinAliasName(nrp, getNextNestLevel()); UserInfoCQ cq = new UserInfoCQ(this, getSqlClause(), jan, @@ -465,10 +457,42 @@ return cq; } + protected void xsetupOuterJoinUserInfo() { + UserInfoCQ cq = getConditionQueryUserInfo(); + Map joinOnMap = newLinkedHashMap(); + joinOnMap.put(getRealColumnName("USER_ID"), cq + .getRealColumnName("USER_ID")); + registerOuterJoin(cq, joinOnMap); + } + public boolean hasConditionQueryUserInfo() { return _conditionQueryUserInfo != null; } + //========================================================================== + // ========= + // Derived Query + // ============= + protected Map _scalarSubQueryMap; + + public Map getScalarSubQuery() { + return _scalarSubQueryMap; + } + + public String keepScalarSubQuery(TodoCategoryCQ subQuery) { + if (_scalarSubQueryMap == null) { + _scalarSubQueryMap = newLinkedHashMap(); + } + String key = "subQueryMapKey" + (_scalarSubQueryMap.size() + 1); + _scalarSubQueryMap.put(key, subQuery); + return "scalarSubQuery." + key; + } + + // Very Internal (for Suppressing Warn about 'Not Use Import') + protected String getConditionBeanClassNameInternally() { + return TodoCategoryCB.class.getName(); + } + protected String getConditionQueryClassNameInternally() { return TodoCategoryCQ.class.getName(); } Modified: todolist/trunk/src/main/java/jp/sf/pal/todolist/db/cbean/cq/bs/BsTodoMappingCQ.java =================================================================== --- todolist/trunk/src/main/java/jp/sf/pal/todolist/db/cbean/cq/bs/BsTodoMappingCQ.java 2008-12-27 22:20:45 UTC (rev 1632) +++ todolist/trunk/src/main/java/jp/sf/pal/todolist/db/cbean/cq/bs/BsTodoMappingCQ.java 2008-12-27 22:21:53 UTC (rev 1633) @@ -5,6 +5,7 @@ import jp.sf.pal.todolist.db.allcommon.cbean.ConditionQuery; import jp.sf.pal.todolist.db.allcommon.cbean.cvalue.ConditionValue; import jp.sf.pal.todolist.db.allcommon.cbean.sqlclause.SqlClause; +import jp.sf.pal.todolist.db.cbean.TodoMappingCB; import jp.sf.pal.todolist.db.cbean.cq.TodoCQ; import jp.sf.pal.todolist.db.cbean.cq.TodoCategoryCQ; import jp.sf.pal.todolist.db.cbean.cq.TodoMappingCQ; @@ -16,7 +17,6 @@ * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public class BsTodoMappingCQ extends AbstractBsTodoMappingCQ { //========================================================================== @@ -62,7 +62,7 @@ public TodoMappingCIQ on() { if (isBaseQuery(this)) { throw new UnsupportedOperationException( - "Unsupported onClause of Base Table!"); + "Unsupported on-clause for local table!"); } TodoMappingCIQ inlineQuery = inline(); inlineQuery.xsetOnClauseInline(true); @@ -463,7 +463,6 @@ // ========= // Foreign Query // ============= - public TodoCQ queryTodo() { return getConditionQueryTodo(); } @@ -472,20 +471,13 @@ public TodoCQ getConditionQueryTodo() { if (_conditionQueryTodo == null) { - _conditionQueryTodo = createQueryTodo(); - setupOuterJoin_Todo(); + _conditionQueryTodo = xcreateQueryTodo(); + xsetupOuterJoinTodo(); } return _conditionQueryTodo; } - protected void setupOuterJoin_Todo() { - Map joinOnMap = newLinkedHashMap(); - joinOnMap.put(getRealColumnName("TODO_ID"), getConditionQueryTodo() - .getRealColumnName("ID")); - registerOuterJoin(getConditionQueryTodo(), joinOnMap); - } - - protected TodoCQ createQueryTodo() { + protected TodoCQ xcreateQueryTodo() { String nrp = resolveNextRelationPath("TODO_MAPPING", "todo"); String jan = resolveJoinAliasName(nrp, getNextNestLevel()); TodoCQ cq = new TodoCQ(this, getSqlClause(), jan, getNextNestLevel()); @@ -494,6 +486,13 @@ return cq; } + protected void xsetupOuterJoinTodo() { + TodoCQ cq = getConditionQueryTodo(); + Map joinOnMap = newLinkedHashMap(); + joinOnMap.put(getRealColumnName("TODO_ID"), cq.getRealColumnName("ID")); + registerOuterJoin(cq, joinOnMap); + } + public boolean hasConditionQueryTodo() { return _conditionQueryTodo != null; } @@ -506,20 +505,13 @@ public TodoCategoryCQ getConditionQueryTodoCategory() { if (_conditionQueryTodoCategory == null) { - _conditionQueryTodoCategory = createQueryTodoCategory(); - setupOuterJoin_TodoCategory(); + _conditionQueryTodoCategory = xcreateQueryTodoCategory(); + xsetupOuterJoinTodoCategory(); } return _conditionQueryTodoCategory; } - protected void setupOuterJoin_TodoCategory() { - Map joinOnMap = newLinkedHashMap(); - joinOnMap.put(getRealColumnName("CATEGORY_ID"), - getConditionQueryTodoCategory().getRealColumnName("ID")); - registerOuterJoin(getConditionQueryTodoCategory(), joinOnMap); - } - - protected TodoCategoryCQ createQueryTodoCategory() { + protected TodoCategoryCQ xcreateQueryTodoCategory() { String nrp = resolveNextRelationPath("TODO_MAPPING", "todoCategory"); String jan = resolveJoinAliasName(nrp, getNextNestLevel()); TodoCategoryCQ cq = new TodoCategoryCQ(this, getSqlClause(), jan, @@ -529,6 +521,14 @@ return cq; } + protected void xsetupOuterJoinTodoCategory() { + TodoCategoryCQ cq = getConditionQueryTodoCategory(); + Map joinOnMap = newLinkedHashMap(); + joinOnMap.put(getRealColumnName("CATEGORY_ID"), cq + .getRealColumnName("ID")); + registerOuterJoin(cq, joinOnMap); + } + public boolean hasConditionQueryTodoCategory() { return _conditionQueryTodoCategory != null; } @@ -541,20 +541,13 @@ public UserInfoCQ getConditionQueryUserInfo() { if (_conditionQueryUserInfo == null) { - _conditionQueryUserInfo = createQueryUserInfo(); - setupOuterJoin_UserInfo(); + _conditionQueryUserInfo = xcreateQueryUserInfo(); + xsetupOuterJoinUserInfo(); } return _conditionQueryUserInfo; } - protected void setupOuterJoin_UserInfo() { - Map joinOnMap = newLinkedHashMap(); - joinOnMap.put(getRealColumnName("USER_ID"), getConditionQueryUserInfo() - .getRealColumnName("USER_ID")); - registerOuterJoin(getConditionQueryUserInfo(), joinOnMap); - } - - protected UserInfoCQ createQueryUserInfo() { + protected UserInfoCQ xcreateQueryUserInfo() { String nrp = resolveNextRelationPath("TODO_MAPPING", "userInfo"); String jan = resolveJoinAliasName(nrp, getNextNestLevel()); UserInfoCQ cq = new UserInfoCQ(this, getSqlClause(), jan, @@ -564,10 +557,42 @@ return cq; } + protected void xsetupOuterJoinUserInfo() { + UserInfoCQ cq = getConditionQueryUserInfo(); + Map joinOnMap = newLinkedHashMap(); + joinOnMap.put(getRealColumnName("USER_ID"), cq + .getRealColumnName("USER_ID")); + registerOuterJoin(cq, joinOnMap); + } + public boolean hasConditionQueryUserInfo() { return _conditionQueryUserInfo != null; } + //========================================================================== + // ========= + // Derived Query + // ============= + protected Map _scalarSubQueryMap; + + public Map getScalarSubQuery() { + return _scalarSubQueryMap; + } + + public String keepScalarSubQuery(TodoMappingCQ subQuery) { + if (_scalarSubQueryMap == null) { + _scalarSubQueryMap = newLinkedHashMap(); + } + String key = "subQueryMapKey" + (_scalarSubQueryMap.size() + 1); + _scalarSubQueryMap.put(key, subQuery); + return "scalarSubQuery." + key; + } + + // Very Internal (for Suppressing Warn about 'Not Use Import') + protected String getConditionBeanClassNameInternally() { + return TodoMappingCB.class.getName(); + } + protected String getConditionQueryClassNameInternally() { return TodoMappingCQ.class.getName(); } Modified: todolist/trunk/src/main/java/jp/sf/pal/todolist/db/cbean/cq/bs/BsUserInfoCQ.java =================================================================== --- todolist/trunk/src/main/java/jp/sf/pal/todolist/db/cbean/cq/bs/BsUserInfoCQ.java 2008-12-27 22:20:45 UTC (rev 1632) +++ todolist/trunk/src/main/java/jp/sf/pal/todolist/db/cbean/cq/bs/BsUserInfoCQ.java 2008-12-27 22:21:53 UTC (rev 1633) @@ -5,6 +5,7 @@ import jp.sf.pal.todolist.db.allcommon.cbean.ConditionQuery; import jp.sf.pal.todolist.db.allcommon.cbean.cvalue.ConditionValue; import jp.sf.pal.todolist.db.allcommon.cbean.sqlclause.SqlClause; +import jp.sf.pal.todolist.db.cbean.UserInfoCB; import jp.sf.pal.todolist.db.cbean.cq.GroupInfoCQ; import jp.sf.pal.todolist.db.cbean.cq.GroupMappingCQ; import jp.sf.pal.todolist.db.cbean.cq.RoleInfoCQ; @@ -20,7 +21,6 @@ * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public class BsUserInfoCQ extends AbstractBsUserInfoCQ { //========================================================================== @@ -66,7 +66,7 @@ public UserInfoCIQ on() { if (isBaseQuery(this)) { throw new UnsupportedOperationException( - "Unsupported onClause of Base Table!"); + "Unsupported on-clause for local table!"); } UserInfoCIQ inlineQuery = inline(); inlineQuery.xsetOnClauseInline(true); @@ -427,88 +427,88 @@ return "userId_NotExistsSubQuery_TodoMappingList." + key; } - protected Map _userId_DeriveSubQuery_GroupMappingListMap; + protected Map _userId_DerivedReferrer_GroupMappingListMap; - public Map getUserId_DeriveSubQuery_GroupMappingList() { - return _userId_DeriveSubQuery_GroupMappingListMap; + public Map getUserId_DerivedReferrer_GroupMappingList() { + return _userId_DerivedReferrer_GroupMappingListMap; } - public String keepUserId_DeriveSubQuery_GroupMappingList( + public String keepUserId_DerivedReferrer_GroupMappingList( GroupMappingCQ subQuery) { - if (_userId_DeriveSubQuery_GroupMappingListMap == null) { - _userId_DeriveSubQuery_GroupMappingListMap = newLinkedHashMap(); + if (_userId_DerivedReferrer_GroupMappingListMap == null) { + _userId_DerivedReferrer_GroupMappingListMap = newLinkedHashMap(); } String key = "subQueryMapKey" - + (_userId_DeriveSubQuery_GroupMappingListMap.size() + 1); - _userId_DeriveSubQuery_GroupMappingListMap.put(key, subQuery); - return "userId_DeriveSubQuery_GroupMappingList." + key; + + (_userId_DerivedReferrer_GroupMappingListMap.size() + 1); + _userId_DerivedReferrer_GroupMappingListMap.put(key, subQuery); + return "userId_DerivedReferrer_GroupMappingList." + key; } - protected Map _userId_DeriveSubQuery_RoleMappingListMap; + protected Map _userId_DerivedReferrer_RoleMappingListMap; - public Map getUserId_DeriveSubQuery_RoleMappingList() { - return _userId_DeriveSubQuery_RoleMappingListMap; + public Map getUserId_DerivedReferrer_RoleMappingList() { + return _userId_DerivedReferrer_RoleMappingListMap; } - public String keepUserId_DeriveSubQuery_RoleMappingList( + public String keepUserId_DerivedReferrer_RoleMappingList( RoleMappingCQ subQuery) { - if (_userId_DeriveSubQuery_RoleMappingListMap == null) { - _userId_DeriveSubQuery_RoleMappingListMap = newLinkedHashMap(); + if (_userId_DerivedReferrer_RoleMappingListMap == null) { + _userId_DerivedReferrer_RoleMappingListMap = newLinkedHashMap(); } String key = "subQueryMapKey" - + (_userId_DeriveSubQuery_RoleMappingListMap.size() + 1); - _userId_DeriveSubQuery_RoleMappingListMap.put(key, subQuery); - return "userId_DeriveSubQuery_RoleMappingList." + key; + + (_userId_DerivedReferrer_RoleMappingListMap.size() + 1); + _userId_DerivedReferrer_RoleMappingListMap.put(key, subQuery); + return "userId_DerivedReferrer_RoleMappingList." + key; } - protected Map _userId_DeriveSubQuery_TodoListMap; + protected Map _userId_DerivedReferrer_TodoListMap; - public Map getUserId_DeriveSubQuery_TodoList() { - return _userId_DeriveSubQuery_TodoListMap; + public Map getUserId_DerivedReferrer_TodoList() { + return _userId_DerivedReferrer_TodoListMap; } - public String keepUserId_DeriveSubQuery_TodoList(TodoCQ subQuery) { - if (_userId_DeriveSubQuery_TodoListMap == null) { - _userId_DeriveSubQuery_TodoListMap = newLinkedHashMap(); + public String keepUserId_DerivedReferrer_TodoList(TodoCQ subQuery) { + if (_userId_DerivedReferrer_TodoListMap == null) { + _userId_DerivedReferrer_TodoListMap = newLinkedHashMap(); } String key = "subQueryMapKey" - + (_userId_DeriveSubQuery_TodoListMap.size() + 1); - _userId_DeriveSubQuery_TodoListMap.put(key, subQuery); - return "userId_DeriveSubQuery_TodoList." + key; + + (_userId_DerivedReferrer_TodoListMap.size() + 1); + _userId_DerivedReferrer_TodoListMap.put(key, subQuery); + return "userId_DerivedReferrer_TodoList." + key; } - protected Map _userId_DeriveSubQuery_TodoCategoryListMap; + protected Map _userId_DerivedReferrer_TodoCategoryListMap; - public Map getUserId_DeriveSubQuery_TodoCategoryList() { - return _userId_DeriveSubQuery_TodoCategoryListMap; + public Map getUserId_DerivedReferrer_TodoCategoryList() { + return _userId_DerivedReferrer_TodoCategoryListMap; } - public String keepUserId_DeriveSubQuery_TodoCategoryList( + public String keepUserId_DerivedReferrer_TodoCategoryList( TodoCategoryCQ subQuery) { - if (_userId_DeriveSubQuery_TodoCategoryListMap == null) { - _userId_DeriveSubQuery_TodoCategoryListMap = newLinkedHashMap(); + if (_userId_DerivedReferrer_TodoCategoryListMap == null) { + _userId_DerivedReferrer_TodoCategoryListMap = newLinkedHashMap(); } String key = "subQueryMapKey" - + (_userId_DeriveSubQuery_TodoCategoryListMap.size() + 1); - _userId_DeriveSubQuery_TodoCategoryListMap.put(key, subQuery); - return "userId_DeriveSubQuery_TodoCategoryList." + key; + + (_userId_DerivedReferrer_TodoCategoryListMap.size() + 1); + _userId_DerivedReferrer_TodoCategoryListMap.put(key, subQuery); + return "userId_DerivedReferrer_TodoCategoryList." + key; } - protected Map _userId_DeriveSubQuery_TodoMappingListMap; + protected Map _userId_DerivedReferrer_TodoMappingListMap; - public Map getUserId_DeriveSubQuery_TodoMappingList() { - return _userId_DeriveSubQuery_TodoMappingListMap; + public Map getUserId_DerivedReferrer_TodoMappingList() { + return _userId_DerivedReferrer_TodoMappingListMap; } - public String keepUserId_DeriveSubQuery_TodoMappingList( + public String keepUserId_DerivedReferrer_TodoMappingList( TodoMappingCQ subQuery) { - if (_userId_DeriveSubQuery_TodoMappingListMap == null) { - _userId_DeriveSubQuery_TodoMappingListMap = newLinkedHashMap(); + if (_userId_DerivedReferrer_TodoMappingListMap == null) { + _userId_DerivedReferrer_TodoMappingListMap = newLinkedHashMap(); } String key = "subQueryMapKey" - + (_userId_DeriveSubQuery_TodoMappingListMap.size() + 1); - _userId_DeriveSubQuery_TodoMappingListMap.put(key, subQuery); - return "userId_DeriveSubQuery_TodoMappingList." + key; + + (_userId_DerivedReferrer_TodoMappingListMap.size() + 1); + _userId_DerivedReferrer_TodoMappingListMap.put(key, subQuery); + return "userId_DerivedReferrer_TodoMappingList." + key; } public BsUserInfoCQ addOrderBy_UserId_Asc() { @@ -875,6 +875,29 @@ return this; } + protected ConditionValue _status; + + public ConditionValue getStatus() { + if (_status == null) { + _status = new ConditionValue(); + } + return _status; + } + + protected ConditionValue getCValueStatus() { + return getStatus(); + } + + public BsUserInfoCQ addOrderBy_Status_Asc() { + regOBA("STATUS"); + return this; + } + + public BsUserInfoCQ addOrderBy_Status_Desc() { + regOBD("STATUS"); + return this; + } + protected ConditionValue _createdTime; public ConditionValue getCreatedTime() { @@ -1072,7 +1095,6 @@ // ========= // Foreign Query // ============= - public GroupInfoCQ queryGroupInfo() { return getConditionQueryGroupInfo(); } @@ -1081,20 +1103,13 @@ public GroupInfoCQ getConditionQueryGroupInfo() { if (_conditionQueryGroupInfo == null) { - _conditionQueryGroupInfo = createQueryGroupInfo(); - setupOuterJoin_GroupInfo(); + _conditionQueryGroupInfo = xcreateQueryGroupInfo(); + xsetupOuterJoinGroupInfo(); } return _conditionQueryGroupInfo; } - protected void setupOuterJoin_GroupInfo() { - Map joinOnMap = newLinkedHashMap(); - joinOnMap.put(getRealColumnName("GROUP_ID"), - getConditionQueryGroupInfo().getRealColumnName("GROUP_ID")); - registerOuterJoin(getConditionQueryGroupInfo(), joinOnMap); - } - - protected GroupInfoCQ createQueryGroupInfo() { + protected GroupInfoCQ xcreateQueryGroupInfo() { String nrp = resolveNextRelationPath("USER_INFO", "groupInfo"); String jan = resolveJoinAliasName(nrp, getNextNestLevel()); GroupInfoCQ cq = new GroupInfoCQ(this, getSqlClause(), jan, @@ -1104,6 +1119,14 @@ return cq; } + protected void xsetupOuterJoinGroupInfo() { + GroupInfoCQ cq = getConditionQueryGroupInfo(); + Map joinOnMap = newLinkedHashMap(); + joinOnMap.put(getRealColumnName("GROUP_ID"), cq + .getRealColumnName("GROUP_ID")); + registerOuterJoin(cq, joinOnMap); + } + public boolean hasConditionQueryGroupInfo() { return _conditionQueryGroupInfo != null; } @@ -1116,20 +1139,13 @@ public RoleInfoCQ getConditionQueryRoleInfo() { if (_conditionQueryRoleInfo == null) { - _conditionQueryRoleInfo = createQueryRoleInfo(); - setupOuterJoin_RoleInfo(); + _conditionQueryRoleInfo = xcreateQueryRoleInfo(); + xsetupOuterJoinRoleInfo(); } return _conditionQueryRoleInfo; } - protected void setupOuterJoin_RoleInfo() { - Map joinOnMap = newLinkedHashMap(); - joinOnMap.put(getRealColumnName("ROLE_ID"), getConditionQueryRoleInfo() - .getRealColumnName("ROLE_ID")); - registerOuterJoin(getConditionQueryRoleInfo(), joinOnMap); - } - - protected RoleInfoCQ createQueryRoleInfo() { + protected RoleInfoCQ xcreateQueryRoleInfo() { String nrp = resolveNextRelationPath("USER_INFO", "roleInfo"); String jan = resolveJoinAliasName(nrp, getNextNestLevel()); RoleInfoCQ cq = new RoleInfoCQ(this, getSqlClause(), jan, @@ -1139,10 +1155,42 @@ return cq; } + protected void xsetupOuterJoinRoleInfo() { + RoleInfoCQ cq = getConditionQueryRoleInfo(); + Map joinOnMap = newLinkedHashMap(); + joinOnMap.put(getRealColumnName("ROLE_ID"), cq + .getRealColumnName("ROLE_ID")); + registerOuterJoin(cq, joinOnMap); + } + public boolean hasConditionQueryRoleInfo() { return _conditionQueryRoleInfo != null; } + //========================================================================== + // ========= + // Derived Query + // ============= + protected Map _scalarSubQueryMap; + + public Map getScalarSubQuery() { + return _scalarSubQueryMap; + } + + public String keepScalarSubQuery(UserInfoCQ subQuery) { + if (_scalarSubQueryMap == null) { + _scalarSubQueryMap = newLinkedHashMap(); + } + String key = "subQueryMapKey" + (_scalarSubQueryMap.size() + 1); + _scalarSubQueryMap.put(key, subQuery); + return "scalarSubQuery." + key; + } + + // Very Internal (for Suppressing Warn about 'Not Use Import') + protected String getConditionBeanClassNameInternally() { + return UserInfoCB.class.getName(); + } + protected String getConditionQueryClassNameInternally() { return UserInfoCQ.class.getName(); } Modified: todolist/trunk/src/main/java/jp/sf/pal/todolist/db/cbean/cq/ciq/GroupInfoCIQ.java =================================================================== --- todolist/trunk/src/main/java/jp/sf/pal/todolist/db/cbean/cq/ciq/GroupInfoCIQ.java 2008-12-27 22:20:45 UTC (rev 1632) +++ todolist/trunk/src/main/java/jp/sf/pal/todolist/db/cbean/cq/ciq/GroupInfoCIQ.java 2008-12-27 22:21:53 UTC (rev 1633) @@ -5,6 +5,7 @@ import jp.sf.pal.todolist.db.allcommon.cbean.coption.ConditionOption; import jp.sf.pal.todolist.db.allcommon.cbean.cvalue.ConditionValue; import jp.sf.pal.todolist.db.allcommon.cbean.sqlclause.SqlClause; +import jp.sf.pal.todolist.db.cbean.GroupInfoCB; import jp.sf.pal.todolist.db.cbean.cq.GroupInfoCQ; import jp.sf.pal.todolist.db.cbean.cq.GroupMappingCQ; import jp.sf.pal.todolist.db.cbean.cq.UserInfoCQ; @@ -16,7 +17,6 @@ * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public class GroupInfoCIQ extends AbstractBsGroupInfoCQ { //========================================================================== @@ -137,15 +137,15 @@ "NotExistsSubQuery at inline() is unsupported! Sorry!"); } - public String keepGroupId_DeriveSubQuery_GroupMappingList( + public String keepGroupId_DerivedReferrer_GroupMappingList( GroupMappingCQ subQuery) { throw new UnsupportedOperationException( - "DeriveSubQuery at inline() is unsupported! Sorry!"); + "DerivedReferrer at inline() is unsupported! Sorry!"); } - public String keepGroupId_DeriveSubQuery_UserInfoList(UserInfoCQ subQuery) { + public String keepGroupId_DerivedReferrer_UserInfoList(UserInfoCQ subQuery) { throw new UnsupportedOperationException( - "DeriveSubQuery at inline() is unsupported! Sorry!"); + "DerivedReferrer at inline() is unsupported! Sorry!"); } protected ConditionValue getCValueName() { @@ -196,6 +196,20 @@ return _myCQ.getVersionno(); } + //========================================================================== + // ========= + // Derived Query + // ============= + public String keepScalarSubQuery(GroupInfoCQ subQuery) { + throw new UnsupportedOperationException( + "ScalarSubQuery at inline() is unsupported! Sorry!"); + } + + // Very Internal (for Suppressing Warn about 'Not Use Import') + protected String getConditionBeanClassNameInternally() { + return GroupInfoCB.class.getName(); + } + protected String getConditionQueryClassNameInternally() { return GroupInfoCQ.class.getName(); } Modified: todolist/trunk/src/main/java/jp/sf/pal/todolist/db/cbean/cq/ciq/GroupMappingCIQ.java =================================================================== --- todolist/trunk/src/main/java/jp/sf/pal/todolist/db/cbean/cq/ciq/GroupMappingCIQ.java 2008-12-27 22:20:45 UTC (rev 1632) +++ todolist/trunk/src/main/java/jp/sf/pal/todolist/db/cbean/cq/ciq/GroupMappingCIQ.java 2008-12-27 22:21:53 UTC (rev 1633) @@ -5,6 +5,7 @@ import jp.sf.pal.todolist.db.allcommon.cbean.coption.ConditionOption; import jp.sf.pal.todolist.db.allcommon.cbean.cvalue.ConditionValue; import jp.sf.pal.todolist.db.allcommon.cbean.sqlclause.SqlClause; +import jp.sf.pal.todolist.db.cbean.GroupMappingCB; import jp.sf.pal.todolist.db.cbean.cq.GroupInfoCQ; import jp.sf.pal.todolist.db.cbean.cq.GroupMappingCQ; import jp.sf.pal.todolist.db.cbean.cq.UserInfoCQ; @@ -16,7 +17,6 @@ * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public class GroupMappingCIQ extends AbstractBsGroupMappingCQ { //========================================================================== @@ -112,6 +112,20 @@ return _myCQ.keepGroupId_InScopeSubQuery_GroupInfo(subQuery); } + //========================================================================== + // ========= + // Derived Query + // ============= + public String keepScalarSubQuery(GroupMappingCQ subQuery) { + throw new UnsupportedOperationException( + "ScalarSubQuery at inline() is unsupported! Sorry!"); + } + + // Very Internal (for Suppressing Warn about 'Not Use Import') + protected String getConditionBeanClassNameInternally() { + return GroupMappingCB.class.getName(); + } + protected String getConditionQueryClassNameInternally() { return GroupMappingCQ.class.getName(); } Modified: todolist/trunk/src/main/java/jp/sf/pal/todolist/db/cbean/cq/ciq/RoleInfoCIQ.java =================================================================== --- todolist/trunk/src/main/java/jp/sf/pal/todolist/db/cbean/cq/ciq/RoleInfoCIQ.java 2008-12-27 22:20:45 UTC (rev 1632) +++ todolist/trunk/src/main/java/jp/sf/pal/todolist/db/cbean/cq/ciq/RoleInfoCIQ.java 2008-12-27 22:21:53 UTC (rev 1633) @@ -5,6 +5,7 @@ import jp.sf.pal.todolist.db.allcommon.cbean.coption.ConditionOption; import jp.sf.pal.todolist.db.allcommon.cbean.cvalue.ConditionValue; import jp.sf.pal.todolist.db.allcommon.cbean.sqlclause.SqlClause; +import jp.sf.pal.todolist.db.cbean.RoleInfoCB; import jp.sf.pal.todolist.db.cbean.cq.RoleInfoCQ; import jp.sf.pal.todolist.db.cbean.cq.RoleMappingCQ; import jp.sf.pal.todolist.db.cbean.cq.UserInfoCQ; @@ -16,7 +17,6 @@ * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public class RoleInfoCIQ extends AbstractBsRoleInfoCQ { //========================================================================== @@ -136,15 +136,15 @@ "NotExistsSubQuery at inline() is unsupported! Sorry!"); } - public String keepRoleId_DeriveSubQuery_RoleMappingList( + public String keepRoleId_DerivedReferrer_RoleMappingList( RoleMappingCQ subQuery) { throw new UnsupportedOperationException( - "DeriveSubQuery at inline() is unsupported! Sorry!"); + "DerivedReferrer at inline() is unsupported! Sorry!"); } - public String keepRoleId_DeriveSubQuery_UserInfoList(UserInfoCQ subQuery) { + public String keepRoleId_DerivedReferrer_UserInfoList(UserInfoCQ subQuery) { throw new UnsupportedOperationException( - "DeriveSubQuery at inline() is unsupported! Sorry!"); + "DerivedReferrer at inline() is unsupported! Sorry!"); } protected ConditionValue getCValueName() { @@ -195,6 +195,20 @@ return _myCQ.getVersionno(); } + //========================================================================== + // ========= + // Derived Query + // ============= + public String keepScalarSubQuery(RoleInfoCQ subQuery) { + throw new UnsupportedOperationException( + "ScalarSubQuery at inline() is unsupported! Sorry!"); + } + + // Very Internal (for Suppressing Warn about 'Not Use Import') + protected String getConditionBeanClassNameInternally() { + return RoleInfoCB.class.getName(); + } + protected String getConditionQueryClassNameInternally() { return RoleInfoCQ.class.getName(); } Modified: todolist/trunk/src/main/java/jp/sf/pal/todolist/db/cbean/cq/ciq/RoleMappingCIQ.java =================================================================== --- todolist/trunk/src/main/java/jp/sf/pal/todolist/db/cbean/cq/ciq/RoleMappingCIQ.java 2008-12-27 22:20:45 UTC (rev 1632) +++ todolist/trunk/src/main/java/jp/sf/pal/todolist/db/cbean/cq/ciq/RoleMappingCIQ.java 2008-12-27 22:21:53 UTC (rev 1633) @@ -5,6 +5,7 @@ import jp.sf.pal.todolist.db.allcommon.cbean.coption.ConditionOption; import jp.sf.pal.todolist.db.allcommon.cbean.cvalue.ConditionValue; import jp.sf.pal.todolist.db.allcommon.cbean.sqlclause.SqlClause; +import jp.sf.pal.todolist.db.cbean.RoleMappingCB; import jp.sf.pal.todolist.db.cbean.cq.RoleInfoCQ; import jp.sf.pal.todolist.db.cbean.cq.RoleMappingCQ; import jp.sf.pal.todolist.db.cbean.cq.UserInfoCQ; @@ -16,7 +17,6 @@ * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public class RoleMappingCIQ extends AbstractBsRoleMappingCQ { //========================================================================== @@ -112,6 +112,20 @@ return _myCQ.keepRoleId_InScopeSubQuery_RoleInfo(subQuery); } + //========================================================================== + // ========= + // Derived Query + // ============= + public String keepScalarSubQuery(RoleMappingCQ subQuery) { + throw new UnsupportedOperationException( + "ScalarSubQuery at inline() is unsupported! Sorry!"); + } + + // Very Internal (for Suppressing Warn about 'Not Use Import') + protected String getConditionBeanClassNameInternally() { + return RoleMappingCB.class.getName(); + } + protected String getConditionQueryClassNameInternally() { return RoleMappingCQ.class.getName(); } Modified: todolist/trunk/src/main/java/jp/sf/pal/todolist/db/cbean/cq/ciq/TodoCIQ.java =================================================================== --- todolist/trunk/src/main/java/jp/sf/pal/todolist/db/cbean/cq/ciq/TodoCIQ.java 2008-12-27 22:20:45 UTC (rev 1632) +++ todolist/trunk/src/main/java/jp/sf/pal/todolist/db/cbean/cq/ciq/TodoCIQ.java 2008-12-27 22:21:53 UTC (rev 1633) @@ -5,6 +5,7 @@ import jp.sf.pal.todolist.db.allcommon.cbean.coption.ConditionOption; import jp.sf.pal.todolist.db.allcommon.cbean.cvalue.ConditionValue; import jp.sf.pal.todolist.db.allcommon.cbean.sqlclause.SqlClause; +import jp.sf.pal.todolist.db.cbean.TodoCB; import jp.sf.pal.todolist.db.cbean.cq.TodoCQ; import jp.sf.pal.todolist.db.cbean.cq.TodoMappingCQ; import jp.sf.pal.todolist.db.cbean.cq.UserInfoCQ; @@ -16,7 +17,6 @@ * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public class TodoCIQ extends AbstractBsTodoCQ { //========================================================================== @@ -116,9 +116,9 @@ "NotExistsSubQuery at inline() is unsupported! Sorry!"); } - public String keepId_DeriveSubQuery_TodoMappingList(TodoMappingCQ subQuery) { + public String keepId_DerivedReferrer_TodoMappingList(TodoMappingCQ subQuery) { throw new UnsupportedOperationException( - "DeriveSubQuery at inline() is unsupported! Sorry!"); + "DerivedReferrer at inline() is unsupported! Sorry!"); } protected ConditionValue getCValueName() { @@ -177,6 +177,20 @@ return _myCQ.getVersionno(); } + //========================================================================== + // ========= + // Derived Query + // ============= + public String keepScalarSubQuery(TodoCQ subQuery) { + throw new UnsupportedOperationException( + "ScalarSubQuery at inline() is unsupported! Sorry!"); + } + + // Very Internal (for Suppressing Warn about 'Not Use Import') + protected String getConditionBeanClassNameInternally() { + return TodoCB.class.getName(); + } + protected String getConditionQueryClassNameInternally() { return TodoCQ.class.getName(); } Modified: todolist/trunk/src/main/java/jp/sf/pal/todolist/db/cbean/cq/ciq/TodoCategoryCIQ.java =================================================================== --- todolist/trunk/src/main/java/jp/sf/pal/todolist/db/cbean/cq/ciq/TodoCategoryCIQ.java 2008-12-27 22:20:45 UTC (rev 1632) +++ todolist/trunk/src/main/java/jp/sf/pal/todolist/db/cbean/cq/ciq/TodoCategoryCIQ.java 2008-12-27 22:21:53 UTC (rev 1633) @@ -5,6 +5,7 @@ import jp.sf.pal.todolist.db.allcommon.cbean.coption.ConditionOption; import jp.sf.pal.todolist.db.allcommon.cbean.cvalue.ConditionValue; import jp.sf.pal.todolist.db.allcommon.cbean.sqlclause.SqlClause; +import jp.sf.pal.todolist.db.cbean.TodoCategoryCB; import jp.sf.pal.todolist.db.cbean.cq.TodoCategoryCQ; import jp.sf.pal.todolist.db.cbean.cq.TodoMappingCQ; import jp.sf.pal.todolist.db.cbean.cq.UserInfoCQ; @@ -16,7 +17,6 @@ * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public class TodoCategoryCIQ extends AbstractBsTodoCategoryCQ { //========================================================================== @@ -116,9 +116,9 @@ "NotExistsSubQuery at inline() is unsupported! Sorry!"); } - public String keepId_DeriveSubQuery_TodoMappingList(TodoMappingCQ subQuery) { + public String keepId_DerivedReferrer_TodoMappingList(TodoMappingCQ subQuery) { throw new UnsupportedOperationException( - "DeriveSubQuery at inline() is unsupported! Sorry!"); + "DerivedReferrer at inline() is unsupported! Sorry!"); } protected ConditionValue getCValueName() { @@ -161,6 +161,20 @@ return _myCQ.getDeletedBy(); } + //========================================================================== + // ========= + // Derived Query + // ============= + public String keepScalarSubQuery(TodoCategoryCQ subQuery) { + throw new UnsupportedOperationException( + "ScalarSubQuery at inline() is unsupported! Sorry!"); + } + + // Very Internal (for Suppressing Warn about 'Not Use Import') + protected String getConditionBeanClassNameInternally() { + return TodoCategoryCB.class.getName(); + } + protected String getConditionQueryClassNameInternally() { return TodoCategoryCQ.class.getName(); } Modified: todolist/trunk/src/main/java/jp/sf/pal/todolist/db/cbean/cq/ciq/TodoMappingCIQ.java =================================================================== --- todolist/trunk/src/main/java/jp/sf/pal/todolist/db/cbean/cq/ciq/TodoMappingCIQ.java 2008-12-27 22:20:45 UTC (rev 1632) +++ todolist/trunk/src/main/java/jp/sf/pal/todolist/db/cbean/cq/ciq/TodoMappingCIQ.java 2008-12-27 22:21:53 UTC (rev 1633) @@ -5,6 +5,7 @@ import jp.sf.pal.todolist.db.allcommon.cbean.coption.ConditionOption; import jp.sf.pal.todolist.db.allcommon.cbean.cvalue.ConditionValue; import jp.sf.pal.todolist.db.allcommon.cbean.sqlclause.SqlClause; +import jp.sf.pal.todolist.db.cbean.TodoMappingCB; import jp.sf.pal.todolist.db.cbean.cq.TodoCQ; import jp.sf.pal.todolist.db.cbean.cq.TodoCategoryCQ; import jp.sf.pal.todolist.db.cbean.cq.TodoMappingCQ; @@ -17,7 +18,6 @@ * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public class TodoMappingCIQ extends AbstractBsTodoMappingCQ { //========================================================================== @@ -158,6 +158,20 @@ return _myCQ.getVersionno(); } + //========================================================================== + // ========= + // Derived Query + // ============= + public String keepScalarSubQuery(TodoMappingCQ subQuery) { + throw new UnsupportedOperationException( + "ScalarSubQuery at inline() is unsupported! Sorry!"); + } + + // Very Internal (for Suppressing Warn about 'Not Use Import') + protected String getConditionBeanClassNameInternally() { + return TodoMappingCB.class.getName(); + } + protected String getConditionQueryClassNameInternally() { return TodoMappingCQ.class.getName(); } Modified: todolist/trunk/src/main/java/jp/sf/pal/todolist/db/cbean/cq/ciq/UserInfoCIQ.java =================================================================== --- todolist/trunk/src/main/java/jp/sf/pal/todolist/db/cbean/cq/ciq/UserInfoCIQ.java 2008-12-27 22:20:45 UTC (rev 1632) +++ todolist/trunk/src/main/java/jp/sf/pal/todolist/db/cbean/cq/ciq/UserInfoCIQ.java 2008-12-27 22:21:53 UTC (rev 1633) @@ -5,6 +5,7 @@ import jp.sf.pal.todolist.db.allcommon.cbean.coption.ConditionOption; import jp.sf.pal.todolist.db.allcommon.cbean.cvalue.ConditionValue; import jp.sf.pal.todolist.db.allcommon.cbean.sqlclause.SqlClause; +import jp.sf.pal.todolist.db.cbean.UserInfoCB; import jp.sf.pal.todolist.db.cbean.cq.GroupInfoCQ; import jp.sf.pal.todolist.db.cbean.cq.GroupMappingCQ; import jp.sf.pal.todolist.db.cbean.cq.RoleInfoCQ; @@ -21,7 +22,6 @@ * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public class UserInfoCIQ extends AbstractBsUserInfoCQ { //========================================================================== @@ -207,33 +207,33 @@ "NotExistsSubQuery at inline() is unsupported! Sorry!"); } - public String keepUserId_DeriveSubQuery_GroupMappingList( + public String keepUserId_DerivedReferrer_GroupMappingList( GroupMappingCQ subQuery) { throw new UnsupportedOperationException( - "DeriveSubQuery at inline() is unsupported! Sorry!"); + "DerivedReferrer at inline() is unsupported! Sorry!"); } - public String keepUserId_DeriveSubQuery_RoleMappingList( + public String keepUserId_DerivedReferrer_RoleMappingList( RoleMappingCQ subQuery) { throw new UnsupportedOperationException( - "DeriveSubQuery at inline() is unsupported! Sorry!"); + "DerivedReferrer at inline() is unsupported! Sorry!"); } - public String keepUserId_DeriveSubQuery_TodoList(TodoCQ subQuery) { + public String keepUserId_DerivedReferrer_TodoList(TodoCQ subQuery) { throw new UnsupportedOperationException( - "DeriveSubQuery at inline() is unsupported! Sorry!"); + "DerivedReferrer at inline() is unsupported! Sorry!"); } - public String keepUserId_DeriveSubQuery_TodoCategoryList( + public String keepUserId_DerivedReferrer_TodoCategoryList( TodoCategoryCQ subQuery) { throw new UnsupportedOperationException( - "DeriveSubQuery at inline() is unsupported! Sorry!"); + "DerivedReferrer at inline() is unsupported! Sorry!"); } - public String keepUserId_DeriveSubQuery_TodoMappingList( + public String keepUserId_DerivedReferrer_TodoMappingList( TodoMappingCQ subQuery) { throw new UnsupportedOperationException( - "DeriveSubQuery at inline() is unsupported! Sorry!"); + "DerivedReferrer at inline() is unsupported! Sorry!"); } protected ConditionValue getCValueGivenName() { @@ -300,6 +300,10 @@ return _myCQ.keepGroupId_InScopeSubQuery_GroupInfo(subQuery); } + protected ConditionValue getCValueStatus() { + return _myCQ.getStatus(); + } + protected ConditionValue getCValueCreatedTime() { return _myCQ.getCreatedTime(); } @@ -328,6 +332,20 @@ return _myCQ.getVersionno(); } + //========================================================================== + // ========= + // Derived Query + // ============= + public String keepScalarSubQuery(UserInfoCQ subQuery) { + throw new UnsupportedOperationException( + "ScalarSubQuery at inline() is unsupported! Sorry!"); + } + + // Very Internal (for Suppressing Warn about 'Not Use Import') + protected String getConditionBeanClassNameInternally() { + return UserInfoCB.class.getName(); + } + protected String getConditionQueryClassNameInternally() { return UserInfoCQ.class.getName(); } Modified: todolist/trunk/src/main/java/jp/sf/pal/todolist/db/cbean/nss/GroupInfoNss.java =================================================================== --- todolist/trunk/src/main/java/jp/sf/pal/todolist/db/cbean/nss/GroupInfoNss.java 2008-12-27 22:20:45 UTC (rev 1632) +++ todolist/trunk/src/main/java/jp/sf/pal/todolist/db/cbean/nss/GroupInfoNss.java 2008-12-27 22:21:53 UTC (rev 1633) @@ -7,7 +7,6 @@ * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public class GroupInfoNss { protected GroupInfoCQ _query; Modified: todolist/trunk/src/main/java/jp/sf/pal/todolist/db/cbean/nss/GroupMappingNss.java =================================================================== --- todolist/trunk/src/main/java/jp/sf/pal/todolist/db/cbean/nss/GroupMappingNss.java 2008-12-27 22:20:45 UTC (rev 1632) +++ todolist/trunk/src/main/java/jp/sf/pal/todolist/db/cbean/nss/GroupMappingNss.java 2008-12-27 22:21:53 UTC (rev 1633) @@ -8,7 +8,6 @@ * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public class GroupMappingNss { protected GroupMappingCQ _query; Modified: todolist/trunk/src/main/java/jp/sf/pal/todolist/db/cbean/nss/RoleInfoNss.java =================================================================== --- todolist/trunk/src/main/java/jp/sf/pal/todolist/db/cbean/nss/RoleInfoNss.java 2008-12-27 22:20:45 UTC (rev 1632) +++ todolist/trunk/src/main/java/jp/sf/pal/todolist/db/cbean/nss/RoleInfoNss.java 2008-12-27 22:21:53 UTC (rev 1633) @@ -7,7 +7,6 @@ * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public class RoleInfoNss { protected RoleInfoCQ _query; Modified: todolist/trunk/src/main/java/jp/sf/pal/todolist/db/cbean/nss/RoleMappingNss.java =================================================================== --- todolist/trunk/src/main/java/jp/sf/pal/todolist/db/cbean/nss/RoleMappingNss.java 2008-12-27 22:20:45 UTC (rev 1632) +++ todolist/trunk/src/main/java/jp/sf/pal/todolist/db/cbean/nss/RoleMappingNss.java 2008-12-27 22:21:53 UTC (rev 1633) @@ -8,7 +8,6 @@ * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public class RoleMappingNss { protected RoleMappingCQ _query; Modified: todolist/trunk/src/main/java/jp/sf/pal/todolist/db/cbean/nss/TodoCategoryNss.java =================================================================== --- todolist/trunk/src/main/java/jp/sf/pal/todolist/db/cbean/nss/TodoCategoryNss.java 2008-12-27 22:20:45 UTC (rev 1632) +++ todolist/trunk/src/main/java/jp/sf/pal/todolist/db/cbean/nss/TodoCategoryNss.java 2008-12-27 22:21:53 UTC (rev 1633) @@ -8,7 +8,6 @@ * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public class TodoCategoryNss { protected TodoCategoryCQ _query; Modified: todolist/trunk/src/main/java/jp/sf/pal/todolist/db/cbean/nss/TodoMappingNss.java =================================================================== --- todolist/trunk/src/main/java/jp/sf/pal/todolist/db/cbean/nss/TodoMappingNss.java 2008-12-27 22:20:45 UTC (rev 1632) +++ todolist/trunk/src/main/java/jp/sf/pal/todolist/db/cbean/nss/TodoMappingNss.java 2008-12-27 22:21:53 UTC (rev 1633) @@ -8,7 +8,6 @@ * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public class TodoMappingNss { protected TodoMappingCQ _query; Modified: todolist/trunk/src/main/java/jp/sf/pal/todolist/db/cbean/nss/TodoNss.java =================================================================== --- todolist/trunk/src/main/java/jp/sf/pal/todolist/db/cbean/nss/TodoNss.java 2008-12-27 22:20:45 UTC (rev 1632) +++ todolist/trunk/src/main/java/jp/sf/pal/todolist/db/cbean/nss/TodoNss.java 2008-12-27 22:21:53 UTC (rev 1633) @@ -8,7 +8,6 @@ * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public class TodoNss { protected TodoCQ _query; Modified: todolist/trunk/src/main/java/jp/sf/pal/todolist/db/cbean/nss/UserInfoNss.java =================================================================== --- todolist/trunk/src/main/java/jp/sf/pal/todolist/db/cbean/nss/UserInfoNss.java 2008-12-27 22:20:45 UTC (rev 1632) +++ todolist/trunk/src/main/java/jp/sf/pal/todolist/db/cbean/nss/UserInfoNss.java 2008-12-27 22:21:53 UTC (rev 1633) @@ -8,7 +8,6 @@ * * @author DBFlute(AutoGenerator) */ - ¡÷ SuppressWarnings("unchecked") public class UserInfoNss { protected UserInfoCQ _query; Modified: todolist/trunk/src/main/resources/dbflute.dicon =================================================================== --- todolist/trunk/src/main/resources/dbflute.dicon 2008-12-27 22:20:45 UTC (rev 1632) +++ todolist/trunk/src/main/resources/dbflute.dicon 2008-12-27 22:21:53 UTC (rev 1633) @@ -5,89 +5,40 @@ - - - "UTF-8" + + + + + + - + + + + + - - - - + + - - - - - - - - - - - - dbflute.interceptor - - - - - - dbflute.interceptor - - - - - dbflute.interceptor - - - - - dbflute.interceptor - - - - - dbflute.interceptor - - - - - dbflute.interceptor - - - - - dbflute.interceptor - - - - - dbflute.interceptor - - - - - dbflute.interceptor - Modified: todolist/trunk/src/main/webapp/WEB-INF/db/todolist.1.log.db =================================================================== (Binary files differ) Modified: todolist/trunk/src/main/webapp/WEB-INF/db/todolist.data.db =================================================================== (Binary files differ) From svnnotify ¡÷ sourceforge.jp Sun Dec 28 07:22:08 2008 From: svnnotify ¡÷ sourceforge.jp (svnnotify ¡÷ sourceforge.jp) Date: Sun, 28 Dec 2008 07:22:08 +0900 Subject: [pal-cvs 3899] [1634] added status column to userinfo table. Message-ID: <1230416528.949105.21435.nullmailer@users.sourceforge.jp> Revision: 1634 http://svn.sourceforge.jp/view?root=pal&view=rev&rev=1634 Author: shinsuke Date: 2008-12-28 07:22:08 +0900 (Sun, 28 Dec 2008) Log Message: ----------- added status column to userinfo table. replaced with dbflute 0.8.7. Removed Paths: ------------- todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/BFinder.java todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/CacheDaoSelector.java todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/DaoReadable.java todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/DaoSelector.java todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/DaoWritable.java todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/GenMetaData.java todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/annotation/OutsideSql.java todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/cbean/SimpleOrderByBean.java todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/cbean/outsidesql/OutsideSqlDao.java todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/s2dao/FetchNarrowingResultSetFactory.java todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/s2dao/S2BeanMetaDataFactoryImpl.java todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/s2dao/S2DaoInterceptor.java todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/s2dao/S2DaoLatestSqlProvider.java todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/s2dao/S2DaoMetaDataExtension.java todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/s2dao/S2DaoMetaDataFactoryImpl.java todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/s2dao/S2DaoPropertyTypeFactoryBuilderExtension.java todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/s2dao/S2DaoSelectDynamicCommand.java -------------- next part -------------- Deleted: todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/BFinder.java =================================================================== --- todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/BFinder.java 2008-12-27 22:21:53 UTC (rev 1633) +++ todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/BFinder.java 2008-12-27 22:22:08 UTC (rev 1634) @@ -1,110 +0,0 @@ -package jp.sf.pal.todolist.db.allcommon; - -import jp.sf.pal.todolist.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 find( - Class 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); - } - } -} Deleted: todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/CacheDaoSelector.java =================================================================== --- todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/CacheDaoSelector.java 2008-12-27 22:21:53 UTC (rev 1633) +++ todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/CacheDaoSelector.java 2008-12-27 22:22:08 UTC (rev 1634) @@ -1,66 +0,0 @@ -package jp.sf.pal.todolist.db.allcommon; - -import jp.sf.pal.todolist.db.allcommon.dbmeta.DBMeta; -import jp.sf.pal.todolist.db.allcommon.dbmeta.DBMetaInstanceHandler; - -/** - * The implementation of DAO-selector. - * - *
- * 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.
- * 
- * - * @author DBFlute(AutoGenerator) - */ - ¡÷ SuppressWarnings("unchecked") -public class CacheDaoSelector extends CacheAbstractSelector implements - DaoSelector { - - //========================================================================== - // ========= - // Selector - // ======== - /** - * Select DAO. - * - * @param The type of DAO. - * @param daoType DAO type. (NotNull) - * @return DAO. (NotNull) - */ - public DAO select(Class 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 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 daoType; - try { - daoType = (Class) Class.forName(daoTypeName); - } catch (ClassNotFoundException e) { - throw new RuntimeException("The class does not exist: " - + daoTypeName, e); - } - return daoType; - } -} Deleted: todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/DaoReadable.java =================================================================== --- todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/DaoReadable.java 2008-12-27 22:21:53 UTC (rev 1633) +++ todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/DaoReadable.java 2008-12-27 22:22:08 UTC (rev 1634) @@ -1,11 +0,0 @@ -package jp.sf.pal.todolist.db.allcommon; - -/** - * The interface of dao-readable. - * - * @author DBFlute(AutoGenerator) - */ -public interface DaoReadable { - public void initializeDaoMetaData(String methodName);// Very Internal - // Method! -} Deleted: todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/DaoSelector.java =================================================================== --- todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/DaoSelector.java 2008-12-27 22:21:53 UTC (rev 1633) +++ todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/DaoSelector.java 2008-12-27 22:22:08 UTC (rev 1634) @@ -1,26 +0,0 @@ -package jp.sf.pal.todolist.db.allcommon; - -/** - * The interface of DAO-selector. - * - * @author DBFlute(AutoGenerator) - */ -public interface DaoSelector { - - /** - * Select DAO. - * - * @param The type of DAO. - * @param daoType DAO type. (NotNull) - * @return Dao. (NotNull) - */ - public DAO select(Class daoType); - - /** - * Select DAO-readable by name. - * - * @param tableFlexibleName Table flexible name. (NotNull) - * @return DAO-readable. (NotNull) - */ - public DaoReadable byName(String tableFlexibleName); -} Deleted: todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/DaoWritable.java =================================================================== --- todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/DaoWritable.java 2008-12-27 22:21:53 UTC (rev 1633) +++ todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/DaoWritable.java 2008-12-27 22:22:08 UTC (rev 1634) @@ -1,70 +0,0 @@ -package jp.sf.pal.todolist.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 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 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 entityList); -} Deleted: todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/GenMetaData.java =================================================================== --- todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/GenMetaData.java 2008-12-27 22:21:53 UTC (rev 1633) +++ todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/GenMetaData.java 2008-12-27 22:22:08 UTC (rev 1634) @@ -1,258 +0,0 @@ -package jp.sf.pal.todolist.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.todolist.db.allcommon"; - } - - /** - * Get the property-value of baseBehaviorPackage. - * - * @return The property-value. - */ - public String getBaseBehaviorPackage() { - return "jp.sf.pal.todolist.db.bsbhv"; - } - - /** - * Get the property-value of baseDaoPackage. - * - * @return The property-value. - */ - public String getBaseDaoPackage() { - return "jp.sf.pal.todolist.db.bsdao"; - } - - /** - * Get the property-value of baseEntityPackage. - * - * @return The property-value. - */ - public String getBaseEntityPackage() { - return "jp.sf.pal.todolist.db.bsentity"; - } - - /** - * Get the property-value of conditionBeanPackage. - * - * @return The property-value. - */ - public String getConditionBeanPackage() { - return "jp.sf.pal.todolist.db.cbean"; - } - - /** - * Get the property-value of extendedDaoPackage. - * - * @return The property-value. - */ - public String getExtendedDaoPackage() { - return "jp.sf.pal.todolist.db.exdao"; - } - - /** - * Get the property-value of extendedBehaviorPackage. - * - * @return The property-value. - */ - public String getExtendedBehaviorPackage() { - return "jp.sf.pal.todolist.db.exbhv"; - } - - /** - * Get the property-value of extendedEntityPackage. - * - * @return The property-value. - */ - public String getExtendedEntityPackage() { - return "jp.sf.pal.todolist.db.exentity"; - } - - //========================================================================== - // ========= - // Optimistic Lock - // =============== - /** - * Get the property-value of updateDateFieldName. - * - * @return The property-value. - */ - public String getUpdateDateFieldName() { - return ""; - } - - /** - * Get the property-value of versionNoFieldName. - * - * @return The property-value. - */ - public String getVersionNoFieldName() { - return ""; - } - - //========================================================================== - // ========= - // Extract - // ======= - /** - * Get the value of 'extractAcceptStartBrace'. - * - * @return The property-value. (NotNull) - */ - public String getExtractAcceptStartBrace() { - return "@{"; - } - - /** - * Get the value of 'extractAcceptEndBrace'. - * - * @return The property-value. (NotNull) - */ - public String getExtractAcceptEndBrace() { - return "@}"; - } - - /** - * Get the value of 'extractAcceptDelimiter'. - * - * @return The property-value. (NotNull) - */ - public String getExtractAcceptDelimiter() { - return "@;"; - } - - /** - * Get the value of 'extractAcceptEqual'. - * - * @return The property-value. (NotNull) - */ - public String getExtractAcceptEqual() { - return "@="; - } -} Deleted: todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/annotation/OutsideSql.java =================================================================== --- todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/annotation/OutsideSql.java 2008-12-27 22:21:53 UTC (rev 1633) +++ todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/annotation/OutsideSql.java 2008-12-27 22:22:08 UTC (rev 1634) @@ -1,18 +0,0 @@ -package jp.sf.pal.todolist.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; -} Deleted: todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/cbean/SimpleOrderByBean.java =================================================================== --- todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/cbean/SimpleOrderByBean.java 2008-12-27 22:21:53 UTC (rev 1633) +++ todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/cbean/SimpleOrderByBean.java 2008-12-27 22:22:08 UTC (rev 1634) @@ -1,165 +0,0 @@ -package jp.sf.pal.todolist.db.allcommon.cbean; - -import jp.sf.pal.todolist.db.allcommon.cbean.sqlclause.OrderByClause; -import jp.sf.pal.todolist.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; - } -} Deleted: todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/cbean/outsidesql/OutsideSqlDao.java =================================================================== --- todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/cbean/outsidesql/OutsideSqlDao.java 2008-12-27 22:21:53 UTC (rev 1633) +++ todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/cbean/outsidesql/OutsideSqlDao.java 2008-12-27 22:22:08 UTC (rev 1634) @@ -1,37 +0,0 @@ -package jp.sf.pal.todolist.db.allcommon.cbean.outsidesql; - -import java.util.List; - -import jp.sf.pal.todolist.db.allcommon.DaoReadable; -import jp.sf.pal.todolist.db.allcommon.jdbc.CursorHandler; - -/** - * The dao of outside-sql. - * - * @author DBFlute(AutoGenerator) - */ -public interface OutsideSqlDao extends DaoReadable { - - //========================================================================== - // ========= - // Select - // ====== - List selectList(String path, Object pmb, - OutsideSqlOption option, Class entityType); - - 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); -} Deleted: todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/s2dao/FetchNarrowingResultSetFactory.java =================================================================== --- todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/s2dao/FetchNarrowingResultSetFactory.java 2008-12-27 22:21:53 UTC (rev 1633) +++ todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/s2dao/FetchNarrowingResultSetFactory.java 2008-12-27 22:22:08 UTC (rev 1634) @@ -1,125 +0,0 @@ -package jp.sf.pal.todolist.db.allcommon.s2dao; - -import java.sql.PreparedStatement; -import java.sql.ResultSet; -import java.sql.SQLException; -import java.sql.Statement; - -import jp.sf.pal.todolist.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); - } -} Deleted: todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/s2dao/S2BeanMetaDataFactoryImpl.java =================================================================== --- todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/s2dao/S2BeanMetaDataFactoryImpl.java 2008-12-27 22:21:53 UTC (rev 1633) +++ todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/s2dao/S2BeanMetaDataFactoryImpl.java 2008-12-27 22:22:08 UTC (rev 1634) @@ -1,116 +0,0 @@ -package jp.sf.pal.todolist.db.allcommon.s2dao; - -import java.sql.DatabaseMetaData; -import java.util.Collections; -import java.util.HashMap; -import java.util.Map; - -import jp.sf.pal.todolist.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, BeanMetaData> _metaMap = Collections - .synchronizedMap(new HashMap, BeanMetaData>()); - - @Override - public BeanMetaData createBeanMetaData(Class beanClass) { - final BeanMetaData cachedMeta = findCachedMeta(beanClass); - if (cachedMeta != null) { - return cachedMeta; - } else { - return super.createBeanMetaData(beanClass); - } - } - - @Override - public BeanMetaData createBeanMetaData(Class beanClass, - int relationNestLevel) { - final BeanMetaData cachedMeta = findCachedMeta(beanClass); - if (cachedMeta != null) { - return cachedMeta; - } else { - return super.createBeanMetaData(beanClass, relationNestLevel); - } - } - - @Override - public BeanMetaData createBeanMetaData(DatabaseMetaData dbMetaData, - Class beanClass, int relationNestLevel) { - final BeanMetaData cachedMeta = findOrCreateCachedMetaIfNeeds( - dbMetaData, beanClass, relationNestLevel); - if (cachedMeta != null) { - return cachedMeta; - } else { - return super.createBeanMetaData(dbMetaData, beanClass, - relationNestLevel); - } - } - - protected BeanMetaData findCachedMeta(Class beanClass) { - if (isDBFluteEntity(beanClass)) { - final BeanMetaData cachedMeta = getMetaFromCache(beanClass); - if (cachedMeta != null) { - return cachedMeta; - } - } - return null; - } - - protected BeanMetaData findOrCreateCachedMetaIfNeeds( - DatabaseMetaData dbMetaData, Class beanClass, int relationNestLevel) { - if (isDBFluteEntity(beanClass)) { - final BeanMetaData cachedMeta = getMetaFromCache(beanClass); - if (cachedMeta != null) { - return cachedMeta; - } else { - return super.createBeanMetaData(dbMetaData, beanClass, 0); - } - } - return null; - } - - @Override - protected BeanMetaDataImpl createBeanMetaDataImpl() { - return new BeanMetaDataImpl() { - @Override - public void initialize() { - final Class myBeanClass = getBeanClass(); - if (isDBFluteEntity(myBeanClass)) { - final BeanMetaData cachedMeta = getMetaFromCache(myBeanClass); - if (cachedMeta == null) { - _metaMap.put(myBeanClass, this); - } - } - super.initialize(); - } - }; - } - - protected boolean isDBFluteEntity(Class beanClass) { - return Entity.class.isAssignableFrom(beanClass); - } - - protected BeanMetaData getMetaFromCache(Class beanClass) { - return _metaMap.get(beanClass); - } - - /** - * Get the limit nest level of relation. - * - * @return The limit nest level of relation. - */ - @Override - protected int getLimitRelationNestLevel() { - return 2;// for Compatible to old version DBFlute - } -} \ No newline at end of file Deleted: todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/s2dao/S2DaoInterceptor.java =================================================================== --- todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/s2dao/S2DaoInterceptor.java 2008-12-27 22:21:53 UTC (rev 1633) +++ todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/s2dao/S2DaoInterceptor.java 2008-12-27 22:22:08 UTC (rev 1634) @@ -1,1027 +0,0 @@ -package jp.sf.pal.todolist.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.todolist.db.allcommon.Entity; -import jp.sf.pal.todolist.db.allcommon.InternalMapContext; -import jp.sf.pal.todolist.db.allcommon.XLog; -import jp.sf.pal.todolist.db.allcommon.cbean.ConditionBean; -import jp.sf.pal.todolist.db.allcommon.cbean.ConditionBeanContext; -import jp.sf.pal.todolist.db.allcommon.cbean.FetchNarrowingBean; -import jp.sf.pal.todolist.db.allcommon.cbean.FetchNarrowingBeanContext; -import jp.sf.pal.todolist.db.allcommon.cbean.outsidesql.OutsideSqlContext; -import jp.sf.pal.todolist.db.allcommon.cbean.outsidesql.OutsideSqlDao; -import jp.sf.pal.todolist.db.allcommon.cbean.outsidesql.OutsideSqlOption; -import jp.sf.pal.todolist.db.allcommon.dbmeta.DBMeta; -import jp.sf.pal.todolist.db.allcommon.dbmeta.DBMetaInstanceHandler; -import jp.sf.pal.todolist.db.allcommon.exception.EntityAlreadyUpdatedException; -import jp.sf.pal.todolist.db.allcommon.helper.stacktrace.InvokeNameExtractingResource; -import jp.sf.pal.todolist.db.allcommon.helper.stacktrace.InvokeNameResult; -import jp.sf.pal.todolist.db.allcommon.helper.stacktrace.impl.InvokeNameExtractorImpl; -import jp.sf.pal.todolist.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 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 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 suffixList = Arrays.asList(new String[] { "Bhv", - "BehaviorReadable", "BehaviorWritable", "PagingInvoker" }); - final List keywordList = Arrays.asList(new String[] { "Bhv$", - "BehaviorReadable$", "BehaviorWritable$" }); - final List ousideSql1List = Arrays - .asList(new String[] { "OutsideSql" }); - final List ousideSql2List = Arrays - .asList(new String[] { "Executor" }); - final List 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 suffixList) { - for (String suffix : suffixList) { - if (className.endsWith(suffix)) { - return true; - } - } - return false; - } - - protected boolean isClassNameContains(String className, - List 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 outsideSqlType = jp.sf.pal.todolist.db.allcommon.annotation.OutsideSql.class; - final jp.sf.pal.todolist.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. - *

- * If this method is condition bean select target, make dynamic SQL. Else - * nothing. - * - * @param invocation Method invocation. (NotNull) - * @return ConditionBean. (Nullable) - */ - protected ConditionBean preprocessConditionBean(MethodInvocation invocation) { - final OutsideSqlContext outsideSqlContext = getOutsideSqlContext(); - if (outsideSqlContext != null) { - return null; // Because it has already finished setting up - // fetchNarrowingBean for outsideSql here. - } - - final ConditionBean cb; - { - final Object[] args = invocation.getArguments(); - if (args == null || args.length == 0) { - return null; - } - final Object arg0 = args[0]; - if (arg0 == null) { - return null; - } - if (!ConditionBeanContext.isTheTypeConditionBean(arg0.getClass())) {// The - // argument - // is - // not - // condition - // - - // bean - // ... - if (FetchNarrowingBeanContext.isTheTypeFetchNarrowingBean(arg0 - .getClass()) - && !isSelectCountIgnoreFetchScopeMethod(invocation)) { - // Fetch-narrowing-bean and Not select count! - FetchNarrowingBeanContext - .setFetchNarrowingBeanOnThread((FetchNarrowingBean) arg0); - } - return null; - } - cb = (ConditionBean) arg0; - } - - if (isSelectCountIgnoreFetchScopeMethod(invocation)) { - cb.xsetupSelectCountIgnoreFetchScope(); - } else { - FetchNarrowingBeanContext.setFetchNarrowingBeanOnThread(cb); - } - - ConditionBeanContext.setConditionBeanOnThread(cb); - return cb; - } - - /** - * Post-process condition-bean. - * - * @param invocation Method invocation. (NotNull) - * @param cb Condition-bean. (Nullable) - */ - protected void postprocessConditionBean(MethodInvocation invocation, - ConditionBean cb) { - if (cb == null) { - return; - } - if (isSelectCountIgnoreFetchScopeMethod(invocation)) { - cb.xafterCareSelectCountIgnoreFetchScope(); - } - } - - // ----------------------------------------------------- - // Clear Thread Local - // ------------------ - protected void clearThreadLocal() { - if (OutsideSqlContext.isExistOutsideSqlContextOnThread()) { - OutsideSqlContext.clearOutsideSqlContextOnThread(); - } - if (FetchNarrowingBeanContext.isExistFetchNarrowingBeanOnThread()) { - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - // Because there is possible that fetch narrowing has been ignored - // for manualPaging of outsideSql. - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - FetchNarrowingBeanContext.getFetchNarrowingBeanOnThread() - .restoreIgnoredFetchNarrowing(); - - FetchNarrowingBeanContext.clearFetchNarrowingBeanOnThread(); - } - if (ConditionBeanContext.isExistConditionBeanOnThread()) { - ConditionBeanContext.clearConditionBeanOnThread(); - } - if (InternalMapContext.isExistInternalMapContextOnThread()) { - InternalMapContext.clearInternalMapContextOnThread(); - } - } - - //========================================================================== - // ========= - // Context Helper - // ============== - protected OutsideSqlContext getOutsideSqlContext() { - if (!OutsideSqlContext.isExistOutsideSqlContextOnThread()) { - return null; - } - return OutsideSqlContext.getOutsideSqlContextOnThread(); - } - - protected boolean isSpecifiedOutsideSql() { - final OutsideSqlContext outsideSqlContext = getOutsideSqlContext(); - return outsideSqlContext != null - && outsideSqlContext.isSpecifiedOutsideSql(); - } - - protected void putObjectToMapContext(String key, Object value) { - InternalMapContext.setObject(key, value); - } - - //========================================================================== - // ========= - // Determination - // ============= - /** - * Is select count ignore-fetch-scope method? - * - * @param invocation Method invocation. (NotNull) - * @return Determination. - */ - protected boolean isSelectCountIgnoreFetchScopeMethod( - MethodInvocation invocation) { - final String name = invocation.getMethod().getName(); - return name.startsWith("readCount") || name.startsWith("selectCount"); - } - - //========================================================================== - // ========= - // General Helper - // ============== - /** - * Is the method abstract? - * - * @param method Method. (NotNull) - * @return Determination. (NotNull) - */ - public boolean isAbstract(Method method) { - final int mod = method.getModifiers(); - return Modifier.isAbstract(mod); - } - - /** - * Get the value of line separator. - * - * @return The value of line separator. (NotNull) - */ - protected String getLineSeparator() { - return System.getProperty("line.separator"); - } -} \ No newline at end of file Deleted: todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/s2dao/S2DaoLatestSqlProvider.java =================================================================== --- todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/s2dao/S2DaoLatestSqlProvider.java 2008-12-27 22:21:53 UTC (rev 1633) +++ todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/s2dao/S2DaoLatestSqlProvider.java 2008-12-27 22:22:08 UTC (rev 1634) @@ -1,20 +0,0 @@ -package jp.sf.pal.todolist.db.allcommon.s2dao; - -import jp.sf.pal.todolist.db.allcommon.jdbc.LatestSqlProvider; -import jp.sf.pal.todolist.db.allcommon.s2dao.internal.sqllog.InternalSqlLogRegistry; - -/** - * The provider of latest SQL as S2Dao. This instance should be singleton. - * - * @author DBFlute(AutoGenerator) - */ -public class S2DaoLatestSqlProvider implements LatestSqlProvider { - - public String getDisplaySql() { - return InternalSqlLogRegistry.peekCompleteSql(); - } - - public void clearSqlCache() { - InternalSqlLogRegistry.clearSqlLogRegistry(); - } -} Deleted: todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/s2dao/S2DaoMetaDataExtension.java =================================================================== --- todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/s2dao/S2DaoMetaDataExtension.java 2008-12-27 22:21:53 UTC (rev 1633) +++ todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/s2dao/S2DaoMetaDataExtension.java 2008-12-27 22:22:08 UTC (rev 1634) @@ -1,1460 +0,0 @@ -package jp.sf.pal.todolist.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.todolist.db.allcommon.BehaviorSelector; -import jp.sf.pal.todolist.db.allcommon.Entity; -import jp.sf.pal.todolist.db.allcommon.annotation.OutsideSql; -import jp.sf.pal.todolist.db.allcommon.cbean.ConditionBean; -import jp.sf.pal.todolist.db.allcommon.cbean.ConditionBeanContext; -import jp.sf.pal.todolist.db.allcommon.cbean.outsidesql.OutsideSqlContext; -import jp.sf.pal.todolist.db.allcommon.dbmeta.DBMeta; -import jp.sf.pal.todolist.db.allcommon.exception.BatchEntityAlreadyUpdatedException; -import jp.sf.pal.todolist.db.allcommon.exception.EntityAlreadyDeletedException; -import jp.sf.pal.todolist.db.allcommon.exception.EntityDuplicatedException; -import jp.sf.pal.todolist.db.allcommon.jdbc.CursorHandler; -import jp.sf.pal.todolist.db.allcommon.s2dao.internal.rshandler.InternalBeanArrayMetaDataResultSetHandler; -import jp.sf.pal.todolist.db.allcommon.s2dao.internal.rshandler.InternalBeanListMetaDataResultSetHandler; -import jp.sf.pal.todolist.db.allcommon.s2dao.internal.sqlcommand.InternalDeleteAutoStaticCommand; -import jp.sf.pal.todolist.db.allcommon.s2dao.internal.sqlcommand.InternalDeleteBatchAutoStaticCommand; -import jp.sf.pal.todolist.db.allcommon.s2dao.internal.sqlcommand.InternalDeleteQueryAutoDynamicCommand; -import jp.sf.pal.todolist.db.allcommon.s2dao.internal.sqlcommand.InternalInsertAutoDynamicCommand; -import jp.sf.pal.todolist.db.allcommon.s2dao.internal.sqlcommand.InternalInsertBatchAutoStaticCommand; -import jp.sf.pal.todolist.db.allcommon.s2dao.internal.sqlcommand.InternalProcedureCommand; -import jp.sf.pal.todolist.db.allcommon.s2dao.internal.sqlcommand.InternalUpdateAutoDynamicCommand; -import jp.sf.pal.todolist.db.allcommon.s2dao.internal.sqlcommand.InternalUpdateBatchAutoStaticCommand; -import jp.sf.pal.todolist.db.allcommon.s2dao.internal.sqlcommand.InternalUpdateDynamicCommand; -import jp.sf.pal.todolist.db.allcommon.s2dao.internal.sqlcommand.InternalUpdateModifiedOnlyCommand; -import jp.sf.pal.todolist.db.allcommon.s2dao.internal.sqlcommand.InternalUpdateQueryAutoDynamicCommand; -import jp.sf.pal.todolist.db.allcommon.s2dao.internal.sqlhandler.InternalDeleteBatchAutoHandler; -import jp.sf.pal.todolist.db.allcommon.s2dao.internal.sqlhandler.InternalUpdateBatchAutoHandler; -import jp.sf.pal.todolist.db.allcommon.s2dao.internal.sqlhandler.InternalBasicHandler.SQLExceptionHandler; -import jp.sf.pal.todolist.db.allcommon.s2dao.internal.various.InternalProcedureMetaData; -import jp.sf.pal.todolist.db.allcommon.s2dao.internal.various.InternalProcedureMetaDataFactory; -import jp.sf.pal.todolist.db.allcommon.s2dao.internal.various.InternalRelationRowCreator; -import jp.sf.pal.todolist.db.allcommon.s2dao.internal.various.InternalRowCreator; -import jp.sf.pal.todolist.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 ret = new ArrayList(); - while (rs.next()) { - ret.add(valueType.getValue(rs, 1)); - } - return ret; - } - } - - protected BeanMetaData createSpecifiedOutsideSqlCursorBeanMetaData( - Method method) { - return createOutsideSqlCustomizeBeanMetaDataFactory() - .createBeanMetaData(getOutsideSqlDefaultBeanClass(method)); - } - - protected ResultSetHandler createSpecifiedOutsideSqlCursorResultSetHandler( - BeanMetaData specifiedBeanMetaData) { - return new org.seasar.extension.jdbc.impl.ObjectResultSetHandler();// This - // is - // dummy - // for - // cursor - // handling - // ! - } - - // - - - - - - - - - - - - - // Execute - // - - - - - protected void setupSpecifiedOutsideSqlExecuteCommand(String sqlCommandKey, - Method method, OutsideSqlContext outsideSqlContext) { - // - - - - - - - - - - - - - - - - - - - - - - - - // The attribute of Specified-OutsideSqlContext. - // - - - - - - - - - - - - - - - - - - - - - - - - final String sql = outsideSqlContext.readFilteredOutsideSql( - getSqlFileEncoding(), dbms.getSuffix()); - final Object pmb = outsideSqlContext.getParameterBean(); - - // - - - - - - - - - - - - - - - - // The attribute of SqlCommand. - // - - - - - - - - - - - - - - - - final String[] argNames = (pmb != null ? new String[] { "pmb" } - : new String[] {}); - final Class[] argTypes = (pmb != null ? new Class[] { pmb - .getClass() } : new Class[] {}); - - final InternalUpdateDynamicCommand cmd = new InternalUpdateDynamicCommand( - dataSource, statementFactory) { - @Override - public Object execute(Object[] args) { - if (args.length != 3) { - String msg = "Internal Error! OutsideSqlDao.execute() should have 3 arguements: args.length=" - + args.length; - throw new IllegalStateException(msg); - } - Object arg = args[1]; - return super.execute(new Object[] { arg }); - } - }; - - // It is unnecessary for DBFlute! - // cmd.setNotSingleRowUpdatedExceptionClass( - // getNotSingleRowUpdatedExceptionClass(method)); - - registerSqlCommand(sqlCommandKey, method, sql, argNames, argTypes, cmd); - } - - // - - - - - - - - - - - - - // Call Procedure - // - - - - - - - - protected void setupSpecifiedOutsideSqlCallCommand(String sqlCommandKey, - Method method, OutsideSqlContext outsideSqlContext) { - // - - - - - - - - - - - - - - - - - - - - - - - - // The attribute of Specified-OutsideSqlContext. - // - - - - - - - - - - - - - - - - - - - - - - - - final Object pmb = outsideSqlContext.getParameterBean(); - final String procedureName = outsideSqlContext.getOutsideSqlPath(); - - // - - - - - - - - - - - - - - - - // The attribute of SqlCommand. - // - - - - - - - - - - - - - - - - final InternalProcedureMetaDataFactory factory = createInternalProcedureMetaDataFactory(); - factory.setValueTypeFactory(valueTypeFactory); - final Class pmbType = pmb != null ? pmb.getClass() : null; - final InternalProcedureMetaData metaData = factory - .createProcedureMetaData(procedureName, pmbType); - final InternalProcedureCommand cmd = createInternalProcedureCommand( - method, metaData); - putSqlCommand(sqlCommandKey, cmd); - } - - protected InternalProcedureMetaDataFactory createInternalProcedureMetaDataFactory() { - return new InternalProcedureMetaDataFactory(); - } - - protected InternalProcedureCommand createInternalProcedureCommand( - Method method, InternalProcedureMetaData metaData) { - final ResultSetHandler resultSetHandler = createResultSetHandler(method); - return new InternalProcedureCommand(dataSource, resultSetHandler, - statementFactory, metaData); - } - - // ----------------------------------------------------- - // Common of OutsideSql - // -------------------- - protected BeanMetaDataFactory createOutsideSqlCustomizeBeanMetaDataFactory() { - final S2BeanMetaDataFactoryImpl originalBmdFactory = new S2BeanMetaDataFactoryImpl() { - protected BeanMetaDataImpl createBeanMetaDataImpl() { - return newOutsideSqlCustomizeBeanMetaDataImpl(); - } - }; - originalBmdFactory - .setAnnotationReaderFactory(this.annotationReaderFactory); - originalBmdFactory - .setPropertyTypeFactoryBuilder(createOutsideSqlPropertyTypeFactoryBuilder()); - originalBmdFactory - .setRelationPropertyTypeFactoryBuilder(this.relationPropertyTypeFactoryBuilder); - originalBmdFactory.setTableNaming(this.tableNaming); - originalBmdFactory.setDataSource(this.dataSource); - originalBmdFactory.setDaoNamingConvention(this.daoNamingConvention); - originalBmdFactory.setBeanEnhancer(this.beanEnhancer); - return originalBmdFactory; - } - - protected BeanMetaDataImpl newOutsideSqlCustomizeBeanMetaDataImpl() { - return new OutsideSqlCustomizeBeanMetaDataImpl(); - } - - protected static class OutsideSqlCustomizeBeanMetaDataImpl extends - BeanMetaDataImpl { - // Though nothing to override, it uses original class just in case. - } - - protected S2DaoPropertyTypeFactoryBuilderExtension createOutsideSqlPropertyTypeFactoryBuilder() { - final S2DaoPropertyTypeFactoryBuilderExtension impl = new S2DaoPropertyTypeFactoryBuilderExtension(); - if (columnNaming == null) { - String msg = "Internal Error! The columnNaming should not be null! {Failed to Injection!}"; - throw new IllegalStateException(msg); - } - impl.setColumnNaming(columnNaming); - impl.setValueTypeFactory(valueTypeFactory); - return impl; - } - - protected Class getOutsideSqlDefaultBeanClass(Method method) { - final Class retType = method.getReturnType(); - if (java.util.List.class.isAssignableFrom(retType)) { - final Class elementType = InternalMethodUtil - .getElementTypeOfListFromReturnMethod(method); - if (elementType != null) { - return elementType; - } else { - return getBeanClass(); - } - } else if (retType.isArray()) { - return retType.getComponentType(); - } else if (retType.isPrimitive() - || !ValueTypes.getValueType(retType).equals(ValueTypes.OBJECT)) { - return getBeanClass(); - } else { - return retType; - } - } - - protected void registerSqlCommand(String sqlCommandKey, Method method, - String sql, String[] argNames, Class[] argTypes, - BeanMetaData myBeanMetaData) { - registerSqlCommand(sqlCommandKey, method, sql, argNames, argTypes, - createResultSetHandler(myBeanMetaData, method)); - } - - protected void registerSqlCommand(String sqlCommandKey, Method method, - String sql, String[] argNames, Class[] argTypes, - ResultSetHandler myResultSetHandler) { - final S2DaoSelectDynamicCommand cmd = createCustomizeSelectDynamicCommand(myResultSetHandler); - registerSqlCommand(sqlCommandKey, method, sql, argNames, argTypes, cmd); - } - - protected void registerSqlCommand(String sqlCommandKey, Method method, - String sql, String[] argNames, Class[] argTypes, - S2DaoSelectDynamicCommand cmd) { - cmd.setSql(sql); - cmd.setArgNames(argNames); - cmd.setArgTypes(argTypes); - this.sqlCommands.put(sqlCommandKey, cmd); - } - - protected void registerSqlCommand(String sqlCommandKey, Method method, - String sql, String[] argNames, Class[] argTypes, - InternalUpdateDynamicCommand cmd) { - cmd.setSql(sql); - cmd.setArgNames(argNames); - cmd.setArgTypes(argTypes); - this.sqlCommands.put(sqlCommandKey, cmd); - } - - //========================================================================== - // ========= - // Common Handlnig - // =============== - @Override - protected void putSqlCommand(String methodName, SqlCommand cmd) { - sqlCommands.put(methodName, cmd); - } - - protected boolean isCheckSingleRowUpdate(Method method) { - return checkSingleRowUpdateForAll - & daoAnnotationReader.isCheckSingleRowUpdate(method); - } - - //========================================================================== - // ========= - // Customize SelectDynamicCommand Creation - // ======================================= - /** - * Create the customize select dynamic command that is for all select SQL on - * DBFlute. - * - * @param handler The handler of result set. (NotNull) - * @return The customize select dynamic command. (NotNull) - */ - protected S2DaoSelectDynamicCommand createCustomizeSelectDynamicCommand( - ResultSetHandler handler) { - return new S2DaoSelectDynamicCommand(dataSource, statementFactory, - handler); - } - - //========================================================================== - // ========= - // ResultSetHandler Override - // ========================= - @Override - protected ResultSetHandler createResultSetHandler(Method method) { - return this.resultSetHandlerFactory.getResultSetHandler( - daoAnnotationReader, beanMetaData, method); - } - - protected ResultSetHandler createResultSetHandler( - BeanMetaData specifiedBeanMetaData, Method method) {// For specified - // BeanMetaData - return this.resultSetHandlerFactory.getResultSetHandler( - daoAnnotationReader, specifiedBeanMetaData, method); - } - - //========================================================================== - // ========= - // JDBC Delegator - // ============== - protected Connection getConnection() { - if (dataSource == null) { - throw new IllegalStateException( - "The dataSource should not be null!"); - } - try { - return dataSource.getConnection(); - } catch (SQLException e) { - handleSQLException(e, null); - return null;// Unreachable! - } - } - - protected DatabaseMetaData getMetaData(Connection conn) { - try { - return conn.getMetaData(); - } catch (SQLException e) { - handleSQLException(e, null); - return null;// Unreachable! - } - } - - protected String getDatabaseProductName(DatabaseMetaData dbMetaData) { - try { - return dbMetaData.getDatabaseProductName(); - } catch (SQLException e) { - handleSQLException(e, null); - return null;// Unreachable! - } - } - - protected void close(Connection conn) { - if (conn == null) { - return; - } - try { - conn.close(); - } catch (SQLException e) { - handleSQLException(e, null); - } - } - - //========================================================================== - // ========= - // Exception Handlnig - // ================== - protected void handleSQLException(SQLException e, Statement statement) { - new SQLExceptionHandler().handleSQLException(e, statement); - } - - //========================================================================== - // ========= - // ResultSetHandlerFactoryImpl Extension - // ===================================== - public static class ResultSetHandlerFactoryExtension extends - ResultSetHandlerFactoryImpl { - public ResultSetHandlerFactoryExtension() { - super(); - } - - @Override - protected RowCreator createRowCreator() { // [DAO-118] (2007/08/25) - return createInternalRowCreator(null); - } - - @Override - protected RelationRowCreator createRelationRowCreator() { - return createInternalRelationRowCreator(null); - } - - @Override - protected ResultSetHandler createBeanListMetaDataResultSetHandler( - BeanMetaData bmd) { // DBFlute Target - final InternalRowCreator rowCreator = createInternalRowCreator(bmd); - final InternalRelationRowCreator relationRowCreator = createInternalRelationRowCreator(bmd); - return new InternalBeanListMetaDataResultSetHandler(bmd, - rowCreator, relationRowCreator); - } - - @Override - protected ResultSetHandler createBeanArrayMetaDataResultSetHandler( - BeanMetaData bmd) { // DBFlute Target - final InternalRowCreator rowCreator = createInternalRowCreator(bmd); - final InternalRelationRowCreator relationRowCreator = createInternalRelationRowCreator(bmd); - return new InternalBeanArrayMetaDataResultSetHandler(bmd, - rowCreator, relationRowCreator); - } - - protected InternalRowCreator createInternalRowCreator(BeanMetaData bmd) { - final Class clazz = bmd != null ? bmd.getBeanClass() : null; - return InternalRowCreator.createInternalRowCreator(clazz); - } - - protected InternalRelationRowCreator createInternalRelationRowCreator( - BeanMetaData bmd) { - return new InternalRelationRowCreator(); // Not yet implemented - // about performance - // tuning! - } - } - - //========================================================================== - // ========= - // Vert Internal - // ============= - protected static class InternalMethodUtil { - public static Class getElementTypeOfListFromReturnMethod(Method method) { - return InternalReflectionUtil - .getElementTypeOfListFromReturnType(method); - } - } - - protected static class InternalReflectionUtil { - public static Class getElementTypeOfList(final Type parameterizedList) { - if (!(parameterizedList instanceof ParameterizedType)) { - return null; - } - final ParameterizedType parameterizedType = ParameterizedType.class - .cast(parameterizedList); - final Type rawType = parameterizedType.getRawType(); - if (!(rawType instanceof Class)) { - return null; - } - final Class rawClass = Class.class.cast(rawType); - if (!rawClass.isAssignableFrom(List.class)) { - return null; - } - final Type[] actualTypeArgument = parameterizedType - .getActualTypeArguments(); - if (actualTypeArgument == null || actualTypeArgument.length != 1) { - return null; - } - if (!(actualTypeArgument[0] instanceof Class)) { - return null; - } - return Class.class.cast(actualTypeArgument[0]); - } - - public static Class getElementTypeOfListFromParameterType( - final Method method, final int parameterPosition) { - final Type[] pmbTypes = method.getGenericParameterTypes(); - return getElementTypeOfList(pmbTypes[parameterPosition]); - } - - public static Class getElementTypeOfListFromReturnType( - final Method method) { - return getElementTypeOfList(method.getGenericReturnType()); - } - } - - //========================================================================== - // ========= - // Assist Helper - // ============= - protected DBMeta findDBMeta() { - final Class beanType = getBeanClass(); - if (beanType == null) { - return null; - } - if (!Entity.class.isAssignableFrom(beanType)) { - return null; - } - final Entity entity; - try { - entity = (Entity) beanType.newInstance(); - } catch (InstantiationException e) { - throw new IllegalStateException(e); - } catch (IllegalAccessException e) { - throw new IllegalStateException(e); - } - return entity.getDBMeta(); - } - - //========================================================================== - // ========= - // General Helper - // ============== - protected String getLineSeparator() { - return SimpleSystemUtil.getLineSeparator(); - } - - //========================================================================== - // ========= - // Accessor - // ======== - // ----------------------------------------------------- - // Sql File Encoding - // ----------------- - public String getSqlFileEncoding() { - return sqlFileEncoding; - } - - // ----------------------------------------------------- - // Bean Enhancer - // ------------- - public BeanEnhancer getBeanEnhancer() { - return beanEnhancer; - } - - public void setBeanEnhancer(final BeanEnhancer beanEnhancer) { - this.beanEnhancer = beanEnhancer; - } - - // ----------------------------------------------------- - // Annotation Reader Factory - // ------------------------- - public void setAnnotationReaderFactory( - org.seasar.dao.AnnotationReaderFactory annotationReaderFactory) { - this.annotationReaderFactory = annotationReaderFactory; - } - - // ----------------------------------------------------- - // Version After 1.0.47 - // -------------------- - public ColumnNaming getColumnNaming() { - return columnNaming; - } - - public void setColumnNaming(final ColumnNaming columnNaming) { - this.columnNaming = columnNaming; - } - - public PropertyTypeFactoryBuilder getPropertyTypeFactoryBuilder() { - return propertyTypeFactoryBuilder; - } - - public void setPropertyTypeFactoryBuilder( - final PropertyTypeFactoryBuilder propertyTypeFactoryBuilder) { - this.propertyTypeFactoryBuilder = propertyTypeFactoryBuilder; - } - - public RelationPropertyTypeFactoryBuilder getRelationPropertyTypeFactoryBuilder() { - return relationPropertyTypeFactoryBuilder; - } - - public void setRelationPropertyTypeFactoryBuilder( - final RelationPropertyTypeFactoryBuilder relationPropertyTypeFactoryBuilder) { - this.relationPropertyTypeFactoryBuilder = relationPropertyTypeFactoryBuilder; - } - - public TableNaming getTableNaming() { - return tableNaming; - } - - public void setTableNaming(final TableNaming tableNaming) { - this.tableNaming = tableNaming; - } - - // ----------------------------------------------------- - // DBFlute Extension - // ----------------- - public BehaviorSelector getBehaviorSelector() { - return _behaviorSelector; - } - - public void setBehaviorSelector(final BehaviorSelector behaviorSelector) { - this._behaviorSelector = behaviorSelector; - } - - public boolean isInternalDebug() { - return _internalDebug; - } - - public void setInternalDebug(final boolean internalDebug) { - this._internalDebug = internalDebug; - } -} Deleted: todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/s2dao/S2DaoMetaDataFactoryImpl.java =================================================================== --- todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/s2dao/S2DaoMetaDataFactoryImpl.java 2008-12-27 22:21:53 UTC (rev 1633) +++ todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/s2dao/S2DaoMetaDataFactoryImpl.java 2008-12-27 22:22:08 UTC (rev 1634) @@ -1,655 +0,0 @@ -package jp.sf.pal.todolist.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.todolist.db.allcommon.DBFluteConfig; -import jp.sf.pal.todolist.db.allcommon.cbean.ConditionBean; -import jp.sf.pal.todolist.db.allcommon.cbean.ConditionBeanContext; -import jp.sf.pal.todolist.db.allcommon.cbean.outsidesql.OutsideSqlContext; -import jp.sf.pal.todolist.db.allcommon.jdbc.StatementConfig; -import jp.sf.pal.todolist.db.allcommon.s2dao.internal.sqlhandler.InternalBasicHandler.SQLExceptionHandler; -import jp.sf.pal.todolist.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 daoMetaDataCache = new HashMap(); - - protected boolean initialized; - - protected boolean useDaoClassForLog; - - protected String sqlFileEncoding; - - protected BeanEnhancer beanEnhancer; - - // ----------------------------------------------------- - // Version After 1.0.47 - // -------------------- - /** The naming of column. {After S2Dao-1.0.47} */ - protected ColumnNaming columnNaming; - - /** The builder of property type factory. {After S2Dao-1.0.47} */ - protected PropertyTypeFactoryBuilder propertyTypeFactoryBuilder; - - /** The builder of relation property type factory. {After S2Dao-1.0.47} */ - protected RelationPropertyTypeFactoryBuilder relationPropertyTypeFactoryBuilder; - - /** The builder of table naming. {After S2Dao-1.0.47} */ - protected TableNaming tableNaming; - - // ----------------------------------------------------- - // DBFlute Extension - // ----------------- - /** The lock monitor of DAO meta data initialization. */ - protected Object _daoMetaDataInitializationLockMonitor = new Object(); - - //========================================================================== - // ========= - // Constructor - // =========== - public S2DaoMetaDataFactoryImpl(DataSource dataSource, - AnnotationReaderFactory annotationReaderFactory, - XADataSource xaDataSource) { - this.dataSource = dataSource; - this.annotationReaderFactory = annotationReaderFactory; - - _log - .info("/* * * * * * * * * * * * * * * * * * * * * * * * * * * * {DBFlute}"); - showInformation(dataSource, xaDataSource); - - // Stop the LinkageError! - ConditionBeanContext.initialize(); - - initializeDatabaseProductNameOfContext(xaDataSource); - - handleSqlLogRegistry(); - - DBFluteConfig.getInstance().lock(); - _log.info("* * * * */"); - } - - protected void showInformation(javax.sql.DataSource dataSource, - javax.sql.XADataSource xaDataSource) { - final StringBuilder sb = new StringBuilder(); - if (xaDataSource != null - && xaDataSource instanceof org.seasar.extension.dbcp.impl.XADataSourceImpl) { - final org.seasar.extension.dbcp.impl.XADataSourceImpl xaDataSourceImpl = (org.seasar.extension.dbcp.impl.XADataSourceImpl) xaDataSource; - final String driverClassName = xaDataSourceImpl - .getDriverClassName(); - final String url = xaDataSourceImpl.getURL(); - final String user = xaDataSourceImpl.getUser(); - sb.append(" [XADataSource]:").append(getLineSeparator()); - sb.append(" driver = " + driverClassName).append( - getLineSeparator()); - sb.append(" url = " + url).append(getLineSeparator()); - sb.append(" user = " + user); - } - _log.info("{Injection Information}" + getLineSeparator() + sb); - } - - protected void handleSqlLogRegistry() { - final StringBuilder sb = new StringBuilder(); - sb.append("{SqlLog Information}").append(getLineSeparator()); - sb.append(" [SqlLogRegistry]").append(getLineSeparator()); - if (DBFluteConfig.getInstance().isUseSqlLogRegistry()) { - if (InternalSqlLogRegistry.setupSqlLogRegistry()) { - sb - .append( - " ...Setting up SqlLogRegistry(org.seasar.extension.jdbc)!") - .append(getLineSeparator()); - sb - .append(" Because the property 'useSqlLogRegistry' of the config of DBFlute is true."); - } else { - sb - .append(" SqlLogRegistry(org.seasar.extension.jdbc) is not supported at the version!"); - } - } else { - final Object sqlLogRegistry = InternalSqlLogRegistry - .findContainerSqlLogRegistry(); - if (sqlLogRegistry != null) { - InternalSqlLogRegistry.closeRegistration(); - sb - .append( - " SqlLogRegistry(org.seasar.extension.jdbc) is close! It's default for DBFlute.") - .append(getLineSeparator()); - sb - .append(" If you want to use this, set SqlLogRegistry to SqlLogRegistryLocator at yourself."); - } else { - sb - .append(" SqlLogRegistry(org.seasar.extension.jdbc) is not available!"); - } - } - _log.info(sb); - } - - // ----------------------------------------------------- - // Database Product Name - // --------------------- - protected void initializeDatabaseProductNameOfContext( - javax.sql.XADataSource xaDataSource) { - if (getDatabaseProductNameFromContext() != null) { - return; - } - - // From JDBC Driver! - if (xaDataSource != null - && xaDataSource instanceof org.seasar.extension.dbcp.impl.XADataSourceImpl) { - final org.seasar.extension.dbcp.impl.XADataSourceImpl xaDataSourceImpl = (org.seasar.extension.dbcp.impl.XADataSourceImpl) xaDataSource; - final String driverClassName = xaDataSourceImpl - .getDriverClassName(); - if (driverClassName != null) { - if (setupDatabaseProductNameByDriverClassName(driverClassName)) { - _log - .info("...Initializing database product name from driverClassName: " - + getDatabaseProductNameFromContext()); - return; - } - } - } - - _log.info("...Initializing database product name as default: H2"); - setDatabaseProductNameToContext("H2"); - } - - protected String getDatabaseProductNameFromContext() { - return ConditionBeanContext.getDatabaseProductName(); - } - - protected void setDatabaseProductNameToContext(String name) { - ConditionBeanContext.setDatabaseProductName(name); - } - - protected boolean setupDatabaseProductNameByDriverClassName( - String driverClassName) { - return ConditionBeanContext - .setupDatabaseProductNameByDriverClassName(driverClassName); - } - - //========================================================================== - // ========= - // Implementation - // ============== - @SuppressWarnings("unchecked") - public DaoMetaData getDaoMetaData(final Class daoClass) { - if (!initialized) { - DisposableUtil.add(this); - initialized = true; - } - final String key = daoClass.getName(); - - // [A] - DaoMetaData dmd = getSynchronizedDaoMetaDataCache(key); - - // [B] - if (dmd != null) { - return dmd; - } - - // [C] - synchronized (_daoMetaDataInitializationLockMonitor) {// One Thread Only - // Entered - // [D] - dmd = getSynchronizedDaoMetaDataCache(key); - // [E] - if (dmd != null) { - // The second thread that stops at [C] can find - // because the first thread have already initialized. - if (_log.isDebugEnabled()) { - _log - .debug("...Getting daoMetaData as cache because the previous thread have already initilized."); - } - return dmd; - } - // [F] - if (_log.isDebugEnabled()) { - _log.debug("...Creating daoMetaData for " - + daoClass.getSimpleName() + "."); - } - final DaoMetaData dmdi = createDaoMetaData(daoClass); - putSynchronizedDaoMetaDataCache(key, dmdi); - } - // [G] - dmd = getSynchronizedDaoMetaDataCache(key); - if (dmd != null) { - return dmd; - } - String msg = "The cache should have data meta data here: key=" + key - + " cache=" + daoMetaDataCache; - throw new IllegalStateException(msg); - } - - @SuppressWarnings("unchecked") - protected void putSynchronizedDaoMetaDataCache(String key, DaoMetaData dmd) { - synchronized (daoMetaDataCache) { - daoMetaDataCache.put(key, dmd); - } - } - - protected DaoMetaData getSynchronizedDaoMetaDataCache(String key) { - DaoMetaData dmd = null; - synchronized (daoMetaDataCache) { - dmd = (DaoMetaData) daoMetaDataCache.get(key); - } - return dmd; - } - - //========================================================================== - // ========= - // DataMetaData Creation - // ===================== - protected DaoMetaData createDaoMetaData(final Class daoClass) { - final BeanDesc daoBeanDesc = BeanDescFactory.getBeanDesc(daoClass); - final DaoAnnotationReader daoAnnotationReader = annotationReaderFactory - .createDaoAnnotationReader(daoBeanDesc); - - final DaoMetaDataImpl daoMetaData = createDaoMetaDataExtension(); - daoMetaData.setDaoClass(daoClass); - daoMetaData.setDataSource(dataSource); - daoMetaData.setStatementFactory(createCustomizeStatememtFactory()); - daoMetaData.setResultSetFactory(createCustomizeResultSetFactory()); - daoMetaData.setValueTypeFactory(valueTypeFactory); - daoMetaData.setBeanMetaDataFactory(getBeanMetaDataFactory()); - daoMetaData.setDaoNamingConvention(getDaoNamingConvention()); - daoMetaData.setUseDaoClassForLog(useDaoClassForLog); - daoMetaData.setDaoAnnotationReader(daoAnnotationReader); - daoMetaData.setProcedureMetaDataFactory(procedureMetaDataFactory); - daoMetaData.setDtoMetaDataFactory(dtoMetaDataFactory); - daoMetaData.setResultSetHandlerFactory(resultSetHandlerFactory); - if (sqlFileEncoding != null) { - daoMetaData.setSqlFileEncoding(sqlFileEncoding); - } - if (pagingSqlRewriter != null) { - daoMetaData.setPagingSQLRewriter(pagingSqlRewriter); - } - daoMetaData.initialize(); - return daoMetaData; - } - - protected S2DaoMetaDataExtension createDaoMetaDataExtension() { - final S2DaoMetaDataExtension dmdExtension = newDaoMetaDataExtension(); - dmdExtension.setBeanEnhancer(beanEnhancer); - dmdExtension.setAnnotationReaderFactory(this.annotationReaderFactory); - dmdExtension.setColumnNaming(this.columnNaming); - dmdExtension - .setPropertyTypeFactoryBuilder(this.propertyTypeFactoryBuilder); - dmdExtension - .setRelationPropertyTypeFactoryBuilder(this.relationPropertyTypeFactoryBuilder); - dmdExtension.setTableNaming(tableNaming); - dmdExtension.setInternalDebug(DBFluteConfig.getInstance() - .isInternalDebug()); - return dmdExtension; - } - - protected S2DaoMetaDataExtension newDaoMetaDataExtension() { - return new S2DaoMetaDataExtension(); - } - - //========================================================================== - // ========= - // Result Set Factory - // ================== - /** - * Create the customize result set factory that is for all SQL on DBFlute. - * - * @return The customize statement factory. (NotNull) - */ - protected ResultSetFactory createCustomizeResultSetFactory() { - return new FetchNarrowingResultSetFactory(); - } - - //========================================================================== - // ========= - // Statement Factory - // ================= - /** - * Create the customize statement factory that is for all SQL on DBFlute. - * - * @return The customize statement factory. (NotNull) - */ - protected StatementFactory createCustomizeStatememtFactory() { - final StatementConfig defaultStatementConfig = DBFluteConfig - .getInstance().getDefaultStatementConfig(); - final boolean internalDebug = DBFluteConfig.getInstance() - .isInternalDebug(); - return new StatementFactory() { - public PreparedStatement createPreparedStatement(Connection con, - String sql) { - try { - final StatementConfig config = findStatementConfigOnThread(); - ; - final int resultSetType; - if (config != null && config.hasResultSetType()) { - resultSetType = config.getResultSetType(); - } else if (defaultStatementConfig != null - && defaultStatementConfig.hasResultSetType()) { - resultSetType = defaultStatementConfig - .getResultSetType(); - } else { - resultSetType = java.sql.ResultSet.TYPE_FORWARD_ONLY; - } - final int resultSetConcurrency = java.sql.ResultSet.CONCUR_READ_ONLY; - if (internalDebug) { - _log.debug("...Creating prepareStatement(sql, " - + resultSetType + ", " + resultSetConcurrency - + ")"); - } - final PreparedStatement ps = con.prepareStatement(sql, - resultSetType, resultSetConcurrency); - if (config != null && config.hasStatementOptions()) { - if (internalDebug) { - _log - .debug("...Setting statement config as request: " - + config); - } - reflectStatementOptions(config, ps); - } else { - reflectDefaultOptionsToStatementIfNeeds(ps); - } - return ps; - } catch (SQLException e) { - handleSQLException(e, null); - return null;// Unreachable! - } - } - - public CallableStatement createCallableStatement(Connection conn, - String sql) { - return prepareCall(conn, sql); - } - - protected StatementConfig findStatementConfigOnThread() { - final StatementConfig config; - if (ConditionBeanContext.isExistConditionBeanOnThread()) { - final ConditionBean cb = ConditionBeanContext - .getConditionBeanOnThread(); - config = cb.getStatementConfig(); - } else if (OutsideSqlContext.isExistOutsideSqlContextOnThread()) { - final OutsideSqlContext context = OutsideSqlContext - .getOutsideSqlContextOnThread(); - config = context.getStatementConfig(); - } else { - config = null; - } - return config; - } - - protected void reflectDefaultOptionsToStatementIfNeeds( - PreparedStatement ps) { - if (defaultStatementConfig != null - && defaultStatementConfig.hasStatementOptions()) { - if (internalDebug) { - _log.debug("...Setting statement config as default: " - + defaultStatementConfig); - } - reflectStatementOptions(defaultStatementConfig, ps); - return; - } - } - - protected void reflectStatementOptions(StatementConfig config, - PreparedStatement ps) { - try { - if (config.hasQueryTimeout()) { - ps.setQueryTimeout(config.getQueryTimeout()); - } - if (config.hasFetchSize()) { - ps.setFetchSize(config.getFetchSize()); - } - if (config.hasMaxRows()) { - ps.setMaxRows(config.getMaxRows()); - } - } catch (SQLException e) { - handleSQLException(e, ps); - } - } - - protected CallableStatement prepareCall(Connection conn, String sql) { - try { - return conn.prepareCall(sql); - } catch (SQLException e) { - handleSQLException(e, null); - return null;// Unreachable! - } - } - - protected void handleSQLException(SQLException e, - Statement statement) { - new SQLExceptionHandler().handleSQLException(e, statement); - } - }; - } - - //========================================================================== - // ========= - // Dispose - // ======= - public synchronized void dispose() { - daoMetaDataCache.clear(); - initialized = false; - } - - //========================================================================== - // ========= - // Helper - // ====== - /** - * Get the value of line separator. - * - * @return The value of line separator. (NotNull) - */ - protected static String getLineSeparator() { - return System.getProperty("line.separator"); - } - - //========================================================================== - // ========= - // Accessor - // ======== - // ----------------------------------------------------- - // Factory Basic - // ------------- - public void setValueTypeFactory(final ValueTypeFactory valueTypeFactory) { - this.valueTypeFactory = valueTypeFactory; - } - - protected BeanMetaDataFactory getBeanMetaDataFactory() { - return beanMetaDataFactory; - } - - public void setBeanMetaDataFactory( - final BeanMetaDataFactory beanMetaDataFactory) { - this.beanMetaDataFactory = beanMetaDataFactory; - } - - public DaoNamingConvention getDaoNamingConvention() { - return daoNamingConvention; - } - - public void setDaoNamingConvention( - final DaoNamingConvention daoNamingConvention) { - this.daoNamingConvention = daoNamingConvention; - } - - public void setAnnotationReaderFactory( - final AnnotationReaderFactory annotationReaderFactory) { - this.annotationReaderFactory = annotationReaderFactory; - } - - public void setDataSource(final DataSource dataSource) { - this.dataSource = dataSource; - } - - public void setUseDaoClassForLog(final boolean userDaoClassForLog) { - useDaoClassForLog = userDaoClassForLog; - } - - public void setResultSetHandlerFactory( - final ResultSetHandlerFactory resultSetHandlerFactory) { - this.resultSetHandlerFactory = resultSetHandlerFactory; - } - - public void setDtoMetaDataFactory( - final DtoMetaDataFactory dtoMetaDataFactory) { - this.dtoMetaDataFactory = dtoMetaDataFactory; - } - - public void setProcedureMetaDataFactory( - ProcedureMetaDataFactory procedureMetaDataFactory) { - this.procedureMetaDataFactory = procedureMetaDataFactory; - } - - public void setPagingSQLRewriter(final PagingSqlRewriter pagingSqlRewriter) { - this.pagingSqlRewriter = pagingSqlRewriter; - } - - public String getSqlFileEncoding() { - return sqlFileEncoding; - } - - public void setSqlFileEncoding(final String encoding) { - sqlFileEncoding = encoding; - } - - public BeanEnhancer getBeanEnhancer() { - return beanEnhancer; - } - - public void setBeanEnhancer(final BeanEnhancer beanEnhancer) { - this.beanEnhancer = beanEnhancer; - } - - // ----------------------------------------------------- - // Version After 1.0.47 - // -------------------- - public ColumnNaming getColumnNaming() { - return columnNaming; - } - - public void setColumnNaming(final ColumnNaming columnNaming) { - this.columnNaming = columnNaming; - } - - public PropertyTypeFactoryBuilder getPropertyTypeFactoryBuilder() { - return propertyTypeFactoryBuilder; - } - - public void setPropertyTypeFactoryBuilder( - final PropertyTypeFactoryBuilder propertyTypeFactoryBuilder) { - this.propertyTypeFactoryBuilder = propertyTypeFactoryBuilder; - } - - public RelationPropertyTypeFactoryBuilder getRelationPropertyTypeFactoryBuilder() { - return relationPropertyTypeFactoryBuilder; - } - - public void setRelationPropertyTypeFactoryBuilder( - final RelationPropertyTypeFactoryBuilder relationPropertyTypeFactoryBuilder) { - this.relationPropertyTypeFactoryBuilder = relationPropertyTypeFactoryBuilder; - } - - public TableNaming getTableNaming() { - return tableNaming; - } - - public void setTableNaming(final TableNaming tableNaming) { - this.tableNaming = tableNaming; - } -} \ No newline at end of file Deleted: todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/s2dao/S2DaoPropertyTypeFactoryBuilderExtension.java =================================================================== --- todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/s2dao/S2DaoPropertyTypeFactoryBuilderExtension.java 2008-12-27 22:21:53 UTC (rev 1633) +++ todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/s2dao/S2DaoPropertyTypeFactoryBuilderExtension.java 2008-12-27 22:22:08 UTC (rev 1634) @@ -1,215 +0,0 @@ -package jp.sf.pal.todolist.db.allcommon.s2dao; - -import java.sql.DatabaseMetaData; -import java.util.ArrayList; -import java.util.List; - -import jp.sf.pal.todolist.db.allcommon.Entity; -import jp.sf.pal.todolist.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 list = new ArrayList(); - final BeanDesc beanDesc = getBeanDesc(); - for (int i = 0; i < beanDesc.getPropertyDescSize(); ++i) { - final PropertyDesc pd = beanDesc.getPropertyDesc(i); - - // Read-only property is unnecessary! - if (!pd.hasWriteMethod()) { - continue; - } - - // Relation property is unnecessary! - if (isRelation(pd)) { - continue; - } - - final PropertyType pt = createPropertyType(pd); - pt.setPrimaryKey(isPrimaryKey(pd)); - pt.setPersistent(isPersistent(pt)); - list.add(pt); - } - return list.toArray(new PropertyType[list.size()]); - } - - @Override - protected boolean isRelation(PropertyDesc propertyDesc) { - final String propertyName = propertyDesc.getPropertyName(); - if (hasDBMeta() - && (_dbmeta.hasForeign(propertyName) || _dbmeta - .hasReferrer(propertyName))) { - return true; - } - return hasRelationNoAnnotation(propertyDesc); - } - - protected boolean hasRelationNoAnnotation(PropertyDesc propertyDesc) { - return beanAnnotationReader.hasRelationNo(propertyDesc); - } - - @Override - protected boolean isPrimaryKey(PropertyDesc propertyDesc) { - final String propertyName = propertyDesc.getPropertyName(); - if (hasDBMeta() && _dbmeta.hasPrimaryKey() - && _dbmeta.hasColumn(propertyName)) { - if (_dbmeta.findColumnInfo(propertyName).isPrimary()) { - return true; - } - } - return hasIdAnnotation(propertyDesc); - } - - protected boolean hasIdAnnotation(PropertyDesc propertyDesc) { - final Dbms dbms = getDbms(); - return beanAnnotationReader.getId(propertyDesc, dbms) != null; - } - - @Override - protected boolean isPersistent(PropertyType propertyType) { - final String propertyName = propertyType.getPropertyName(); - final PropertyDesc propertyDesc = propertyType.getPropertyDesc(); - if ((hasDBMeta() && _dbmeta.hasColumn(propertyName)) - || hasColumnAnnotation(propertyDesc)) { - if (!isElementOfNoPersistentProps(propertyDesc)) { - return true; - } - } - return false; - } - - protected boolean hasColumnAnnotation(PropertyDesc propertyDesc) { - return beanAnnotationReader.getColumnAnnotation(propertyDesc) != null; - } - - protected boolean isElementOfNoPersistentProps(PropertyDesc propertyDesc) { - final String propertyName = propertyDesc.getPropertyName(); - final String[] props = _noPersisteneProps; - if (props != null && props.length >= 0) { - for (int i = 0; i < props.length; ++i) { - if (props[i].equals(propertyName)) { - return true; - } - } - } - return false; - } - } - - //========================================================================== - // ========= - // Accessor - // ======== - public ValueTypeFactory getValueTypeFactory() { - return valueTypeFactory; - } - - public void setValueTypeFactory(ValueTypeFactory valueTypeFactory) { - this.valueTypeFactory = valueTypeFactory; - } - - public ColumnNaming getColumnNaming() { - return columnNaming; - } - - public void setColumnNaming(ColumnNaming columnNaming) { - this.columnNaming = columnNaming; - } -} Deleted: todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/s2dao/S2DaoSelectDynamicCommand.java =================================================================== --- todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/s2dao/S2DaoSelectDynamicCommand.java 2008-12-27 22:21:53 UTC (rev 1633) +++ todolist/trunk/src/main/java/jp/sf/pal/todolist/db/allcommon/s2dao/S2DaoSelectDynamicCommand.java 2008-12-27 22:22:08 UTC (rev 1634) @@ -1,491 +0,0 @@ -package jp.sf.pal.todolist.db.allcommon.s2dao; - -import java.util.ArrayList; -import java.util.List; - -import javax.sql.DataSource; - -import jp.sf.pal.todolist.db.allcommon.cbean.ConditionBean; -import jp.sf.pal.todolist.db.allcommon.cbean.ConditionBeanContext; -import jp.sf.pal.todolist.db.allcommon.cbean.outsidesql.OutsideSqlContext; -import jp.sf.pal.todolist.db.allcommon.s2dao.internal.sqlcommand.InternalAbstractDynamicCommand; -import jp.sf.pal.todolist.db.allcommon.s2dao.internal.sqlhandler.InternalBasicSelectHandler; -import jp.sf.pal.todolist.db.allcommon.util.SimpleStringUtil; -import jp.sf.pal.todolist.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 bindVariableList = new ArrayList(4); - final List bindVariableTypeList = new ArrayList(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 bindVariableList = new java.util.ArrayList(); - final java.util.List bindVariableTypeList = new java.util.ArrayList(); - 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.todolist.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.todolist.db.allcommon.jdbc.CursorHandler) { - final jp.sf.pal.todolist.db.allcommon.jdbc.CursorHandler cursorHandler = (jp.sf.pal.todolist.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 bindVariableList, List 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 bindVariableList, List 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 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 bindVariableList, List bindVariableTypeList) { - final Object[] bindVariables = ctx.getBindVariables(); - addBindVariableList(bindVariableList, bindVariables); - final Class[] bindVariableTypes = ctx.getBindVariableTypes(); - addBindVariableTypeList(bindVariableTypeList, bindVariableTypes); - } - - protected void addBindVariableList(List bindVariableList, - Object[] bindVariables) { - for (int i = 0; i < bindVariables.length; i++) { - bindVariableList.add(bindVariables[i]); - } - } - - protected void addBindVariableTypeList(List 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 From svnnotify ¡÷ sourceforge.jp Wed Dec 31 08:45:47 2008 From: svnnotify ¡÷ sourceforge.jp (svnnotify ¡÷ sourceforge.jp) Date: Wed, 31 Dec 2008 08:45:47 +0900 Subject: [pal-cvs 3900] [1635] created plugins. Message-ID: <1230680747.400536.31167.nullmailer@users.sourceforge.jp> Revision: 1635 http://svn.sourceforge.jp/view?root=pal&view=rev&rev=1635 Author: shinsuke Date: 2008-12-31 08:45:47 +0900 (Wed, 31 Dec 2008) Log Message: ----------- created plugins. Added Paths: ----------- userinfo/plugins/ -------------- next part -------------- From svnnotify ¡÷ sourceforge.jp Wed Dec 31 08:46:25 2008 From: svnnotify ¡÷ sourceforge.jp (svnnotify ¡÷ sourceforge.jp) Date: Wed, 31 Dec 2008 08:46:25 +0900 Subject: [pal-cvs 3901] [1636] created userinfo-blank-plugin. Message-ID: <1230680785.936709.32331.nullmailer@users.sourceforge.jp> Revision: 1636 http://svn.sourceforge.jp/view?root=pal&view=rev&rev=1636 Author: shinsuke Date: 2008-12-31 08:46:25 +0900 (Wed, 31 Dec 2008) Log Message: ----------- created userinfo-blank-plugin. Added Paths: ----------- userinfo/plugins/userinfo-blank-plugin/ -------------- next part -------------- From svnnotify ¡÷ sourceforge.jp Wed Dec 31 08:46:35 2008 From: svnnotify ¡÷ sourceforge.jp (svnnotify ¡÷ sourceforge.jp) Date: Wed, 31 Dec 2008 08:46:35 +0900 Subject: [pal-cvs 3902] [1637] created trunk. Message-ID: <1230680795.527151.32426.nullmailer@users.sourceforge.jp> Revision: 1637 http://svn.sourceforge.jp/view?root=pal&view=rev&rev=1637 Author: shinsuke Date: 2008-12-31 08:46:35 +0900 (Wed, 31 Dec 2008) Log Message: ----------- created trunk. Added Paths: ----------- userinfo/plugins/userinfo-blank-plugin/trunk/ -------------- next part -------------- From svnnotify ¡÷ sourceforge.jp Wed Dec 31 08:47:24 2008 From: svnnotify ¡÷ sourceforge.jp (svnnotify ¡÷ sourceforge.jp) Date: Wed, 31 Dec 2008 08:47:24 +0900 Subject: [pal-cvs 3903] [1638] created userinfo-j2-plugin. Message-ID: <1230680844.650818.514.nullmailer@users.sourceforge.jp> Revision: 1638 http://svn.sourceforge.jp/view?root=pal&view=rev&rev=1638 Author: shinsuke Date: 2008-12-31 08:47:24 +0900 (Wed, 31 Dec 2008) Log Message: ----------- created userinfo-j2-plugin. Added Paths: ----------- userinfo/plugins/userinfo-j2-plugin/ -------------- next part -------------- From svnnotify ¡÷ sourceforge.jp Wed Dec 31 08:47:32 2008 From: svnnotify ¡÷ sourceforge.jp (svnnotify ¡÷ sourceforge.jp) Date: Wed, 31 Dec 2008 08:47:32 +0900 Subject: [pal-cvs 3904] [1639] created trunk. Message-ID: <1230680852.466290.580.nullmailer@users.sourceforge.jp> Revision: 1639 http://svn.sourceforge.jp/view?root=pal&view=rev&rev=1639 Author: shinsuke Date: 2008-12-31 08:47:32 +0900 (Wed, 31 Dec 2008) Log Message: ----------- created trunk. Added Paths: ----------- userinfo/plugins/userinfo-j2-plugin/trunk/ -------------- next part -------------- From svnnotify ¡÷ sourceforge.jp Wed Dec 31 08:47:48 2008 From: svnnotify ¡÷ sourceforge.jp (svnnotify ¡÷ sourceforge.jp) Date: Wed, 31 Dec 2008 08:47:48 +0900 Subject: [pal-cvs 3905] [1640] created userinfo-palportal-plugin. Message-ID: <1230680868.973438.937.nullmailer@users.sourceforge.jp> Revision: 1640 http://svn.sourceforge.jp/view?root=pal&view=rev&rev=1640 Author: shinsuke Date: 2008-12-31 08:47:48 +0900 (Wed, 31 Dec 2008) Log Message: ----------- created userinfo-palportal-plugin. Added Paths: ----------- userinfo/plugins/userinfo-palportal-plugin/ -------------- next part -------------- From svnnotify ¡÷ sourceforge.jp Wed Dec 31 08:47:59 2008 From: svnnotify ¡÷ sourceforge.jp (svnnotify ¡÷ sourceforge.jp) Date: Wed, 31 Dec 2008 08:47:59 +0900 Subject: [pal-cvs 3906] [1641] created trunk. Message-ID: <1230680879.426041.1487.nullmailer@users.sourceforge.jp> Revision: 1641 http://svn.sourceforge.jp/view?root=pal&view=rev&rev=1641 Author: shinsuke Date: 2008-12-31 08:47:59 +0900 (Wed, 31 Dec 2008) Log Message: ----------- created trunk. Added Paths: ----------- userinfo/plugins/userinfo-palportal-plugin/trunk/ -------------- next part -------------- From svnnotify ¡÷ sourceforge.jp Wed Dec 31 08:55:55 2008 From: svnnotify ¡÷ sourceforge.jp (svnnotify ¡÷ sourceforge.jp) Date: Wed, 31 Dec 2008 08:55:55 +0900 Subject: [pal-cvs 3907] [1642] initial commit. Message-ID: <1230681355.791930.9167.nullmailer@users.sourceforge.jp> Revision: 1642 http://svn.sourceforge.jp/view?root=pal&view=rev&rev=1642 Author: shinsuke Date: 2008-12-31 08:55:55 +0900 (Wed, 31 Dec 2008) Log Message: ----------- initial commit. Added Paths: ----------- userinfo/plugins/userinfo-blank-plugin/trunk/.classpath userinfo/plugins/userinfo-blank-plugin/trunk/.project userinfo/plugins/userinfo-blank-plugin/trunk/.settings/ userinfo/plugins/userinfo-blank-plugin/trunk/.settings/org.eclipse.jdt.core.prefs userinfo/plugins/userinfo-blank-plugin/trunk/.settings/org.eclipse.jdt.ui.prefs userinfo/plugins/userinfo-blank-plugin/trunk/pom.xml userinfo/plugins/userinfo-blank-plugin/trunk/src/ userinfo/plugins/userinfo-blank-plugin/trunk/src/main/ userinfo/plugins/userinfo-blank-plugin/trunk/src/main/java/ userinfo/plugins/userinfo-blank-plugin/trunk/src/main/java/jp/ userinfo/plugins/userinfo-blank-plugin/trunk/src/main/java/jp/sf/ userinfo/plugins/userinfo-blank-plugin/trunk/src/main/java/jp/sf/pal/ userinfo/plugins/userinfo-blank-plugin/trunk/src/main/java/jp/sf/pal/userinfo/ userinfo/plugins/userinfo-blank-plugin/trunk/src/main/java/jp/sf/pal/userinfo/plugin/ userinfo/plugins/userinfo-blank-plugin/trunk/src/main/java/jp/sf/pal/userinfo/plugin/impl/ userinfo/plugins/userinfo-blank-plugin/trunk/src/main/java/jp/sf/pal/userinfo/plugin/impl/PortalPluginImpl.java -------------- next part -------------- Added: userinfo/plugins/userinfo-blank-plugin/trunk/.classpath =================================================================== --- userinfo/plugins/userinfo-blank-plugin/trunk/.classpath (rev 0) +++ userinfo/plugins/userinfo-blank-plugin/trunk/.classpath 2008-12-30 23:55:55 UTC (rev 1642) @@ -0,0 +1,43 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file Property changes on: userinfo/plugins/userinfo-blank-plugin/trunk/.classpath ___________________________________________________________________ Name: svn:eol-style + native Added: userinfo/plugins/userinfo-blank-plugin/trunk/.project =================================================================== --- userinfo/plugins/userinfo-blank-plugin/trunk/.project (rev 0) +++ userinfo/plugins/userinfo-blank-plugin/trunk/.project 2008-12-30 23:55:55 UTC (rev 1642) @@ -0,0 +1,14 @@ + + userinfo-blank-plugin + + + + + org.eclipse.jdt.core.javabuilder + + + + + org.eclipse.jdt.core.javanature + + \ No newline at end of file Property changes on: userinfo/plugins/userinfo-blank-plugin/trunk/.project ___________________________________________________________________ Name: svn:eol-style + native Added: userinfo/plugins/userinfo-blank-plugin/trunk/.settings/org.eclipse.jdt.core.prefs =================================================================== --- userinfo/plugins/userinfo-blank-plugin/trunk/.settings/org.eclipse.jdt.core.prefs (rev 0) +++ userinfo/plugins/userinfo-blank-plugin/trunk/.settings/org.eclipse.jdt.core.prefs 2008-12-30 23:55:55 UTC (rev 1642) @@ -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: userinfo/plugins/userinfo-blank-plugin/trunk/.settings/org.eclipse.jdt.ui.prefs =================================================================== --- userinfo/plugins/userinfo-blank-plugin/trunk/.settings/org.eclipse.jdt.ui.prefs (rev 0) +++ userinfo/plugins/userinfo-blank-plugin/trunk/.settings/org.eclipse.jdt.ui.prefs 2008-12-30 23:55:55 UTC (rev 1642) @@ -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= Added: userinfo/plugins/userinfo-blank-plugin/trunk/pom.xml =================================================================== --- userinfo/plugins/userinfo-blank-plugin/trunk/pom.xml (rev 0) +++ userinfo/plugins/userinfo-blank-plugin/trunk/pom.xml 2008-12-30 23:55:55 UTC (rev 1642) @@ -0,0 +1,75 @@ + + + 4.0.0 + jp.sf.pal + userinfo-blank-plugin + jar + 1.0-PR2-SNAPSHOT + userinfo-blank-plugin + + validate + + + + maven-compiler-plugin + + 1.5 + 1.5 + UTF-8 + + + + maven-surefire-plugin + 2.3 + + + maven-deploy-plugin + + true + + + + org.codehaus.mojo + cobertura-maven-plugin + 2.0-SNAPSHOT + + + + clean + + + + + + + + + maven-source-plugin + + + source-jar + package + + jar + + + + + + + + + maven.seasar.org + The Seasar Foundation Maven2 Repository + http://maven.seasar.org/maven2 + + + + + jp.sf.pal + userinfo + 1.0-PR2-SNAPSHOT + provided + + + Property changes on: userinfo/plugins/userinfo-blank-plugin/trunk/pom.xml ___________________________________________________________________ Name: svn:eol-style + native Added: userinfo/plugins/userinfo-blank-plugin/trunk/src/main/java/jp/sf/pal/userinfo/plugin/impl/PortalPluginImpl.java =================================================================== --- userinfo/plugins/userinfo-blank-plugin/trunk/src/main/java/jp/sf/pal/userinfo/plugin/impl/PortalPluginImpl.java (rev 0) +++ userinfo/plugins/userinfo-blank-plugin/trunk/src/main/java/jp/sf/pal/userinfo/plugin/impl/PortalPluginImpl.java 2008-12-30 23:55:55 UTC (rev 1642) @@ -0,0 +1,92 @@ +package jp.sf.pal.userinfo.plugin.impl; + +import jp.sf.pal.userinfo.db.exentity.GroupInfo; +import jp.sf.pal.userinfo.db.exentity.RoleInfo; +import jp.sf.pal.userinfo.db.exentity.UserInfo; +import jp.sf.pal.userinfo.plugin.PortalException; +import jp.sf.pal.userinfo.plugin.PortalPlugin; + +public class PortalPluginImpl implements PortalPlugin { + + private static final long serialVersionUID = 9105382936888121155L; + + public boolean isAvailable() { + return false; + } + + public void create(UserInfo userInfo) throws PortalException { + // no operation + + } + + public void create(RoleInfo roleInfo) throws PortalException { + // no operation + + } + + public void create(GroupInfo groupInfo) throws PortalException { + // no operation + + } + + public void delete(UserInfo userInfo) throws PortalException { + // no operation + + } + + public void delete(RoleInfo roleInfo) throws PortalException { + // no operation + + } + + public void delete(GroupInfo groupInfo) throws PortalException { + // no operation + + } + + public GroupInfo getGroupInfo(String groupId) throws PortalException { + // no operation + return null; + } + + public RoleInfo getRoleInfo(String roleId) throws PortalException { + // no operation + return null; + } + + public UserInfo getUserInfo(String userId) throws PortalException { + // no operation + return null; + } + + public void update(UserInfo userInfo) throws PortalException { + // no operation + + } + + public void update(RoleInfo roleInfo) throws PortalException { + // no operation + + } + + public void update(GroupInfo groupInfo) throws PortalException { + // no operation + + } + + public boolean hasGroupInfo(String groupId) throws PortalException { + // no operation + return false; + } + + public boolean hasRoleInfo(String roleId) throws PortalException { + // no operation + return false; + } + + public boolean hasUserInfo(String userId) throws PortalException { + // no operation + return false; + } + +} Property changes on: userinfo/plugins/userinfo-blank-plugin/trunk/src/main/java/jp/sf/pal/userinfo/plugin/impl/PortalPluginImpl.java ___________________________________________________________________ Name: svn:eol-style + native From svnnotify ¡÷ sourceforge.jp Wed Dec 31 08:56:29 2008 From: svnnotify ¡÷ sourceforge.jp (svnnotify ¡÷ sourceforge.jp) Date: Wed, 31 Dec 2008 08:56:29 +0900 Subject: [pal-cvs 3908] [1643] initial commit. Message-ID: <1230681389.694518.10206.nullmailer@users.sourceforge.jp> Revision: 1643 http://svn.sourceforge.jp/view?root=pal&view=rev&rev=1643 Author: shinsuke Date: 2008-12-31 08:56:29 +0900 (Wed, 31 Dec 2008) Log Message: ----------- initial commit. Added Paths: ----------- userinfo/plugins/userinfo-j2-plugin/trunk/.classpath userinfo/plugins/userinfo-j2-plugin/trunk/.project userinfo/plugins/userinfo-j2-plugin/trunk/.settings/ userinfo/plugins/userinfo-j2-plugin/trunk/.settings/org.eclipse.jdt.core.prefs userinfo/plugins/userinfo-j2-plugin/trunk/.settings/org.eclipse.jdt.ui.prefs userinfo/plugins/userinfo-j2-plugin/trunk/pom.xml userinfo/plugins/userinfo-j2-plugin/trunk/src/ userinfo/plugins/userinfo-j2-plugin/trunk/src/main/ userinfo/plugins/userinfo-j2-plugin/trunk/src/main/java/ userinfo/plugins/userinfo-j2-plugin/trunk/src/main/java/jp/ userinfo/plugins/userinfo-j2-plugin/trunk/src/main/java/jp/sf/ userinfo/plugins/userinfo-j2-plugin/trunk/src/main/java/jp/sf/pal/ userinfo/plugins/userinfo-j2-plugin/trunk/src/main/java/jp/sf/pal/userinfo/ userinfo/plugins/userinfo-j2-plugin/trunk/src/main/java/jp/sf/pal/userinfo/plugin/ userinfo/plugins/userinfo-j2-plugin/trunk/src/main/java/jp/sf/pal/userinfo/plugin/impl/ userinfo/plugins/userinfo-j2-plugin/trunk/src/main/java/jp/sf/pal/userinfo/plugin/impl/PortalPluginImpl.java -------------- next part -------------- Added: userinfo/plugins/userinfo-j2-plugin/trunk/.classpath =================================================================== --- userinfo/plugins/userinfo-j2-plugin/trunk/.classpath (rev 0) +++ userinfo/plugins/userinfo-j2-plugin/trunk/.classpath 2008-12-30 23:56:29 UTC (rev 1643) @@ -0,0 +1,47 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file Property changes on: userinfo/plugins/userinfo-j2-plugin/trunk/.classpath ___________________________________________________________________ Name: svn:eol-style + native Added: userinfo/plugins/userinfo-j2-plugin/trunk/.project =================================================================== --- userinfo/plugins/userinfo-j2-plugin/trunk/.project (rev 0) +++ userinfo/plugins/userinfo-j2-plugin/trunk/.project 2008-12-30 23:56:29 UTC (rev 1643) @@ -0,0 +1,14 @@ + + userinfo-j2-plugin + + + + + org.eclipse.jdt.core.javabuilder + + + + + org.eclipse.jdt.core.javanature + + \ No newline at end of file Property changes on: userinfo/plugins/userinfo-j2-plugin/trunk/.project ___________________________________________________________________ Name: svn:eol-style + native Added: userinfo/plugins/userinfo-j2-plugin/trunk/.settings/org.eclipse.jdt.core.prefs =================================================================== --- userinfo/plugins/userinfo-j2-plugin/trunk/.settings/org.eclipse.jdt.core.prefs (rev 0) +++ userinfo/plugins/userinfo-j2-plugin/trunk/.settings/org.eclipse.jdt.core.prefs 2008-12-30 23:56:29 UTC (rev 1643) @@ -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: userinfo/plugins/userinfo-j2-plugin/trunk/.settings/org.eclipse.jdt.ui.prefs =================================================================== --- userinfo/plugins/userinfo-j2-plugin/trunk/.settings/org.eclipse.jdt.ui.prefs (rev 0) +++ userinfo/plugins/userinfo-j2-plugin/trunk/.settings/org.eclipse.jdt.ui.prefs 2008-12-30 23:56:29 UTC (rev 1643) @@ -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= Added: userinfo/plugins/userinfo-j2-plugin/trunk/pom.xml =================================================================== --- userinfo/plugins/userinfo-j2-plugin/trunk/pom.xml (rev 0) +++ userinfo/plugins/userinfo-j2-plugin/trunk/pom.xml 2008-12-30 23:56:29 UTC (rev 1643) @@ -0,0 +1,100 @@ + + + 4.0.0 + jp.sf.pal + userinfo-j2-plugin + jar + 1.0-PR2-SNAPSHOT + userinfo-j2-plugin + + validate + + + + maven-compiler-plugin + + 1.5 + 1.5 + UTF-8 + + + + maven-surefire-plugin + 2.3 + + + maven-deploy-plugin + + true + + + + org.codehaus.mojo + cobertura-maven-plugin + 2.0-SNAPSHOT + + + + clean + + + + + + + + + maven-source-plugin + + + source-jar + package + + jar + + + + + + + + + maven.seasar.org + The Seasar Foundation Maven2 Repository + http://maven.seasar.org/maven2 + + + + + jp.sf.pal + userinfo + 1.0-PR2-SNAPSHOT + provided + + + javax.servlet + servlet-api + 2.3 + provided + + + portlet-api + portlet-api + 1.0 + provided + + + commons-lang + commons-lang + 2.3 + provided + + + + org.apache.portals.jetspeed-2 + jetspeed-api + 2.1.3_pal-1.1 + provided + + + Property changes on: userinfo/plugins/userinfo-j2-plugin/trunk/pom.xml ___________________________________________________________________ Name: svn:eol-style + native Added: userinfo/plugins/userinfo-j2-plugin/trunk/src/main/java/jp/sf/pal/userinfo/plugin/impl/PortalPluginImpl.java =================================================================== --- userinfo/plugins/userinfo-j2-plugin/trunk/src/main/java/jp/sf/pal/userinfo/plugin/impl/PortalPluginImpl.java (rev 0) +++ userinfo/plugins/userinfo-j2-plugin/trunk/src/main/java/jp/sf/pal/userinfo/plugin/impl/PortalPluginImpl.java 2008-12-30 23:56:29 UTC (rev 1643) @@ -0,0 +1,462 @@ +package jp.sf.pal.userinfo.plugin.impl; + +import java.util.ArrayList; +import java.util.Iterator; +import java.util.List; +import java.util.Map; +import java.util.prefs.Preferences; + +import javax.portlet.PortletConfig; +import javax.portlet.PortletContext; +import javax.servlet.http.HttpServletRequest; + +import jp.sf.pal.userinfo.db.exentity.GroupInfo; +import jp.sf.pal.userinfo.db.exentity.GroupMapping; +import jp.sf.pal.userinfo.db.exentity.RoleInfo; +import jp.sf.pal.userinfo.db.exentity.RoleMapping; +import jp.sf.pal.userinfo.db.exentity.UserInfo; +import jp.sf.pal.userinfo.plugin.PortalException; +import jp.sf.pal.userinfo.plugin.PortalPlugin; + +import org.apache.commons.lang.StringUtils; +import org.apache.jetspeed.CommonPortletServices; +import org.apache.jetspeed.JetspeedActions; +import org.apache.jetspeed.om.common.SecurityConstraint; +import org.apache.jetspeed.om.folder.Folder; +import org.apache.jetspeed.page.PageManager; +import org.apache.jetspeed.security.Group; +import org.apache.jetspeed.security.GroupManager; +import org.apache.jetspeed.security.Role; +import org.apache.jetspeed.security.RoleManager; +import org.apache.jetspeed.security.SecurityException; +import org.apache.jetspeed.security.User; +import org.apache.jetspeed.security.UserManager; + +public class PortalPluginImpl implements PortalPlugin { + + private static final long serialVersionUID = -3276712435030890965L; + + private String psmlTemplatePath; + + public transient HttpServletRequest request; + + public PortalPluginImpl() { + psmlTemplatePath = Folder.USER_FOLDER + "template" + "/"; + } + + public boolean isAvailable() { + return true; + } + + public void create(UserInfo userInfo) throws PortalException { + if (userInfo == null || userInfo.getUserId() == null) { + throw new IllegalArgumentException("userInfo is null."); + } + + UserManager userManager = getUserManager(); + if (userManager.userExists(userInfo.getUserId())) { + throw new PortalException("errors.user_already_exists", "User(" + + userInfo.getUserId() + ") already exists."); + } + + try { + // Add user + userManager.addUser(userInfo.getUserId(), userInfo.getPassword()); + + User user = userManager.getUser(userInfo.getUserId()); + Preferences prefs = user.getUserAttributes(); + for (Map.Entry entry : userInfo + .getUserAttributeMap().entrySet()) { + prefs.put(entry.getKey(), entry.getValue()); + } + + // TODO Set updateRequired + // PasswordCredential credential = getPasswordCredential(userInfo + // .getUserId()); + // if (credential != null) { + // if (userInfo.isUpdateRequired() != credential.isUpdateRequired()) + // { + // getUserManager().setPasswordUpdateRequired(userInfo.getUserId(), + // userInfo.isUpdateRequired()); + // } + // } + + // Set role + for (RoleMapping roleMapping : userInfo.getRoleMappingList()) { + if (!StringUtils.isEmpty(roleMapping.getRoleId())) { + getRoleManager().addRoleToUser(userInfo.getUserId(), + roleMapping.getRoleId()); + } + } + + // Set group + for (GroupMapping groupMapping : userInfo.getGroupMappingList()) { + if (!StringUtils.isEmpty(groupMapping.getGroupId())) { + getGroupManager().addUserToGroup(userInfo.getUserId(), + groupMapping.getGroupId()); + } + } + + // TODO Add principal rule + + // Create user's psml + PageManager pageManager = getPageManager(); + if (!pageManager.userFolderExists(userInfo.getUserId())) { + String userhome = Folder.USER_FOLDER + userInfo.getUserId(); + Folder source = pageManager.getFolder(psmlTemplatePath); + pageManager.deepCopyFolder(source, userhome, userInfo + .getUserId()); + + // set security constraint + SecurityConstraint sc = pageManager + .newFolderSecurityConstraint(); + List users = new ArrayList(1); + users.add(userInfo.getUserId()); + sc.setUsers(users); + List permissions = new ArrayList(); + permissions.add(JetspeedActions.VIEW); + permissions.add(JetspeedActions.EDIT); + permissions.add(JetspeedActions.HELP); + sc.setPermissions(permissions); + Folder userFolder; + userFolder = pageManager.getFolder(userhome); + if (userFolder.getSecurityConstraints() == null) { + userFolder.setSecurityConstraints(pageManager + .newSecurityConstraints()); + } + userFolder.getSecurityConstraints().getSecurityConstraints() + .add(sc); + pageManager.updateFolder(userFolder); + pageManager.reset(); + } + } catch (Exception e) { + try { + delete(userInfo); + } catch (Exception e1) { + // ignore + } + throw new PortalException("errors.system_error_occurred_on_portal", + "System error occurred on Portal.", e); + } + } + + public void update(UserInfo userInfo) throws PortalException { + if (userInfo == null || userInfo.getUserId() == null) { + throw new IllegalArgumentException("userInfo is null."); + } + + UserManager userManager = getUserManager(); + if (!userManager.userExists(userInfo.getUserId())) { + throw new PortalException("errors.user_does_not_exist", "User(" + + userInfo.getUserId() + ") does not exist."); + } + + try { + User user = userManager.getUser(userInfo.getUserId()); + Preferences prefs = user.getUserAttributes(); + for (Map.Entry entry : userInfo + .getUserAttributeMap().entrySet()) { + prefs.put(entry.getKey(), entry.getValue()); + } + + // Set role + RoleManager roleManager = getRoleManager(); + for (Iterator itr = roleManager.getRolesForUser( + userInfo.getUserId()).iterator(); itr.hasNext();) { + Role role = itr.next(); + roleManager.removeRoleFromUser(userInfo.getUserId(), role + .getPrincipal().getName()); + } + for (RoleMapping roleMapping : userInfo.getRoleMappingList()) { + if (!StringUtils.isEmpty(roleMapping.getRoleId())) { + getRoleManager().addRoleToUser(userInfo.getUserId(), + roleMapping.getRoleId()); + } + } + + // Set group + GroupManager groupManager = getGroupManager(); + for (Iterator itr = groupManager.getGroupsForUser( + userInfo.getUserId()).iterator(); itr.hasNext();) { + Group group = itr.next(); + groupManager.removeUserFromGroup(userInfo.getUserId(), group + .getPrincipal().getName()); + } + for (GroupMapping groupMapping : userInfo.getGroupMappingList()) { + if (!StringUtils.isEmpty(groupMapping.getGroupId())) { + getGroupManager().addUserToGroup(userInfo.getUserId(), + groupMapping.getGroupId()); + } + } + } catch (Exception e) { + throw new PortalException("errors.system_error_occurred_on_portal", + "System error occurred on Portal.", e); + } + } + + public void delete(UserInfo userInfo) throws PortalException { + if (userInfo == null || userInfo.getUserId() == null) { + throw new IllegalArgumentException("userInfo is null."); + } + + UserManager userManager = getUserManager(); + if (!userManager.userExists(userInfo.getUserId())) { + throw new PortalException("errors.user_does_not_exist", "User(" + + userInfo.getUserId() + ") does not exist."); + } + + try { + userManager.removeUser(userInfo.getUserId()); + + // Remove user's psml folder + PageManager pageManager = getPageManager(); + if (pageManager.folderExists(Folder.USER_FOLDER + + userInfo.getUserId())) { + Folder folder = pageManager.getFolder(Folder.USER_FOLDER + + userInfo.getUserId()); + pageManager.removeFolder(folder); + } + } catch (Exception e) { + throw new PortalException("errors.system_error_occurred_on_portal", + "System error occurred on Portal.", e); + } + } + + public UserInfo getUserInfo(String userId) throws PortalException { + if (userId == null) { + throw new IllegalArgumentException("userId is null."); + } + + UserManager userManager = getUserManager(); + if (!userManager.userExists(userId)) { + return null; + } + + try { + User user = userManager.getUser(userId); + Preferences prefs = user.getUserAttributes(); + + UserInfo userInfo = new UserInfo(); + userInfo.setUserId(userId); + userInfo.setGivenName(prefs.get("user.name.given", null)); + userInfo.setFamilyName(prefs.get("user.name.family", null)); + userInfo.setMiddleName(prefs.get("user.name.middle", null)); + userInfo.setNickname(prefs.get("user.name.nickName", null)); + userInfo.setGender(prefs.get("user.gender", null)); + // userInfo.setBirthDate(prefs.get("user.bdate",null)); + userInfo.setEmail(prefs + .get("user.business-info.online.email", null)); + userInfo.setUrl(prefs.get("user.business-info.online.uri", null)); + userInfo.setTelephone(prefs.get( + "user.business-info.telecom.telephone.number", null)); + return userInfo; + } catch (Exception e) { + throw new PortalException("errors.system_error_occurred_on_portal", + "System error occurred on Portal.", e); + } + } + + public boolean hasUserInfo(String userId) throws PortalException { + if (userId == null) { + throw new IllegalArgumentException("userId is null."); + } + return getUserManager().userExists(userId); + } + + public void create(RoleInfo roleInfo) throws PortalException { + if (roleInfo == null || roleInfo.getRoleId() == null) { + throw new IllegalArgumentException("roleInfo is null."); + } + RoleManager roleManager = getRoleManager(); + try { + if (roleManager.roleExists(roleInfo.getRoleId())) { + throw new PortalException("errors.role_already_exists", "Role(" + + roleInfo.getRoleId() + ") already exists."); + } + roleManager.addRole(roleInfo.getRoleId()); + } catch (SecurityException e) { + throw new PortalException("errors.system_error_occurred_on_portal", + "System error occurred on Portal.", e); + } + } + + public void update(RoleInfo roleInfo) throws PortalException { + // no operation + + } + + public void delete(RoleInfo roleInfo) throws PortalException { + if (roleInfo == null || roleInfo.getRoleId() == null) { + throw new IllegalArgumentException("roleInfo is null."); + } + RoleManager roleManager = getRoleManager(); + try { + if (!roleManager.roleExists(roleInfo.getRoleId())) { + throw new PortalException("errors.role_does_not_exist", "Role(" + + roleInfo.getRoleId() + ") does not exist."); + } + roleManager.removeRole(roleInfo.getRoleId()); + } catch (SecurityException e) { + throw new PortalException("errors.system_error_occurred_on_portal", + "System error occurred on Portal.", e); + } + } + + public RoleInfo getRoleInfo(String roleId) throws PortalException { + if (roleId == null) { + throw new IllegalArgumentException("roleId is null."); + } + RoleManager roleManager = getRoleManager(); + + if (!roleManager.roleExists(roleId)) { + return null; + } + RoleInfo roleInfo = new RoleInfo(); + roleInfo.setRoleId(roleId); + return roleInfo; + } + + public boolean hasRoleInfo(String roleId) throws PortalException { + if (roleId == null) { + throw new IllegalArgumentException("roleId is null."); + } + return getRoleManager().roleExists(roleId); + } + + public void create(GroupInfo groupInfo) throws PortalException { + if (groupInfo == null || groupInfo.getGroupId() == null) { + throw new IllegalArgumentException("groupInfo is null."); + } + GroupManager groupManager = getGroupManager(); + try { + if (groupManager.groupExists(groupInfo.getGroupId())) { + throw new PortalException("errors.group_already_exists", + "Group(" + groupInfo.getGroupId() + ") already exists."); + } + groupManager.addGroup(groupInfo.getGroupId()); + } catch (SecurityException e) { + throw new PortalException("errors.system_error_occurred_on_portal", + "System error occurred on Portal.", e); + } + } + + public void update(GroupInfo groupInfo) throws PortalException { + // no operation + + } + + public void delete(GroupInfo groupInfo) throws PortalException { + if (groupInfo == null || groupInfo.getGroupId() == null) { + throw new IllegalArgumentException("groupInfo is null."); + } + GroupManager groupManager = getGroupManager(); + try { + if (!groupManager.groupExists(groupInfo.getGroupId())) { + throw new PortalException("errors.group_does_not_exist", + "Group(" + groupInfo.getGroupId() + ") does not exist."); + } + groupManager.removeGroup(groupInfo.getGroupId()); + } catch (SecurityException e) { + throw new PortalException("errors.system_error_occurred_on_portal", + "System error occurred on Portal.", e); + } + } + + public GroupInfo getGroupInfo(String groupId) throws PortalException { + if (groupId == null) { + throw new IllegalArgumentException("groupId is null."); + } + GroupManager groupManager = getGroupManager(); + + if (!groupManager.groupExists(groupId)) { + return null; + } + GroupInfo groupInfo = new GroupInfo(); + groupInfo.setGroupId(groupId); + return groupInfo; + } + + public boolean hasGroupInfo(String groupId) throws PortalException { + if (groupId == null) { + throw new IllegalArgumentException("groupId is null."); + } + return getGroupManager().groupExists(groupId); + } + + private PortletContext getPortletContext() throws PortalException { + try { + return ((PortletConfig) request + .getAttribute("javax.portlet.config")).getPortletContext(); + } catch (Exception e) { + throw new PortalException("errors.could_not_access_portal_info", + "Could not access UserManager."); + } + } + + private UserManager getUserManager() throws PortalException { + UserManager userManager = (UserManager) getPortletContext() + .getAttribute(CommonPortletServices.CPS_USER_MANAGER_COMPONENT); + if (userManager == null) { + throw new PortalException("errors.could_not_access_portal_info", + "Could not access UserManager."); + } + return userManager; + } + + private RoleManager getRoleManager() throws PortalException { + RoleManager roleManager = (RoleManager) getPortletContext() + .getAttribute(CommonPortletServices.CPS_ROLE_MANAGER_COMPONENT); + if (roleManager == null) { + throw new PortalException("errors.could_not_access_portal_info", + "Could not access RoleManager."); + } + return roleManager; + } + + private GroupManager getGroupManager() throws PortalException { + GroupManager groupManager = (GroupManager) getPortletContext() + .getAttribute(CommonPortletServices.CPS_GROUP_MANAGER_COMPONENT); + if (groupManager == null) { + throw new PortalException("errors.could_not_access_portal_info", + "Could not access GroupManager."); + } + return groupManager; + } + + private PageManager getPageManager() throws PortalException { + PageManager pageManager = (PageManager) getPortletContext() + .getAttribute(CommonPortletServices.CPS_PAGE_MANAGER_COMPONENT); + if (pageManager == null) { + throw new PortalException("errors.could_not_access_portal_info", + "Could not access PageManager."); + } + return pageManager; + } + + // private PasswordCredential getPasswordCredential(String username) + // throws PortalException, SecurityException { + // User user = getUserManager().getUser(username); + // + // PasswordCredential credential = null; + // + // Set credentials = user.getSubject().getPrivateCredentials(); + // Iterator iter = credentials.iterator(); + // while (iter.hasNext()) { + // Object o = iter.next(); + // if (o instanceof PasswordCredential) { + // credential = (PasswordCredential) o; + // break; + // } + // } + // return credential; + // } + + public String getPsmlTemplatePath() { + return psmlTemplatePath; + } + + public void setPsmlTemplatePath(String psmlTemplatePath) { + this.psmlTemplatePath = psmlTemplatePath; + } + +} Property changes on: userinfo/plugins/userinfo-j2-plugin/trunk/src/main/java/jp/sf/pal/userinfo/plugin/impl/PortalPluginImpl.java ___________________________________________________________________ Name: svn:eol-style + native From svnnotify ¡÷ sourceforge.jp Wed Dec 31 08:56:36 2008 From: svnnotify ¡÷ sourceforge.jp (svnnotify ¡÷ sourceforge.jp) Date: Wed, 31 Dec 2008 08:56:36 +0900 Subject: [pal-cvs 3909] [1644] initial commit. Message-ID: <1230681396.390624.10273.nullmailer@users.sourceforge.jp> Revision: 1644 http://svn.sourceforge.jp/view?root=pal&view=rev&rev=1644 Author: shinsuke Date: 2008-12-31 08:56:36 +0900 (Wed, 31 Dec 2008) Log Message: ----------- initial commit. Added Paths: ----------- userinfo/plugins/userinfo-palportal-plugin/trunk/.classpath userinfo/plugins/userinfo-palportal-plugin/trunk/.project userinfo/plugins/userinfo-palportal-plugin/trunk/.settings/ userinfo/plugins/userinfo-palportal-plugin/trunk/.settings/org.eclipse.jdt.core.prefs userinfo/plugins/userinfo-palportal-plugin/trunk/.settings/org.eclipse.jdt.ui.prefs userinfo/plugins/userinfo-palportal-plugin/trunk/pom.xml userinfo/plugins/userinfo-palportal-plugin/trunk/src/ userinfo/plugins/userinfo-palportal-plugin/trunk/src/main/ userinfo/plugins/userinfo-palportal-plugin/trunk/src/main/java/ userinfo/plugins/userinfo-palportal-plugin/trunk/src/main/java/jp/ userinfo/plugins/userinfo-palportal-plugin/trunk/src/main/java/jp/sf/ userinfo/plugins/userinfo-palportal-plugin/trunk/src/main/java/jp/sf/pal/ userinfo/plugins/userinfo-palportal-plugin/trunk/src/main/java/jp/sf/pal/userinfo/ userinfo/plugins/userinfo-palportal-plugin/trunk/src/main/java/jp/sf/pal/userinfo/plugin/ userinfo/plugins/userinfo-palportal-plugin/trunk/src/main/java/jp/sf/pal/userinfo/plugin/impl/ userinfo/plugins/userinfo-palportal-plugin/trunk/src/main/java/jp/sf/pal/userinfo/plugin/impl/PortalPluginImpl.java -------------- next part -------------- Added: userinfo/plugins/userinfo-palportal-plugin/trunk/.classpath =================================================================== --- userinfo/plugins/userinfo-palportal-plugin/trunk/.classpath (rev 0) +++ userinfo/plugins/userinfo-palportal-plugin/trunk/.classpath 2008-12-30 23:56:36 UTC (rev 1644) @@ -0,0 +1,47 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file Property changes on: userinfo/plugins/userinfo-palportal-plugin/trunk/.classpath ___________________________________________________________________ Name: svn:eol-style + native Added: userinfo/plugins/userinfo-palportal-plugin/trunk/.project =================================================================== --- userinfo/plugins/userinfo-palportal-plugin/trunk/.project (rev 0) +++ userinfo/plugins/userinfo-palportal-plugin/trunk/.project 2008-12-30 23:56:36 UTC (rev 1644) @@ -0,0 +1,14 @@ + + userinfo-palportal-plugin + + + + + org.eclipse.jdt.core.javabuilder + + + + + org.eclipse.jdt.core.javanature + + \ No newline at end of file Property changes on: userinfo/plugins/userinfo-palportal-plugin/trunk/.project ___________________________________________________________________ Name: svn:eol-style + native Added: userinfo/plugins/userinfo-palportal-plugin/trunk/.settings/org.eclipse.jdt.core.prefs =================================================================== --- userinfo/plugins/userinfo-palportal-plugin/trunk/.settings/org.eclipse.jdt.core.prefs (rev 0) +++ userinfo/plugins/userinfo-palportal-plugin/trunk/.settings/org.eclipse.jdt.core.prefs 2008-12-30 23:56:36 UTC (rev 1644) @@ -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: userinfo/plugins/userinfo-palportal-plugin/trunk/.settings/org.eclipse.jdt.ui.prefs =================================================================== --- userinfo/plugins/userinfo-palportal-plugin/trunk/.settings/org.eclipse.jdt.ui.prefs (rev 0) +++ userinfo/plugins/userinfo-palportal-plugin/trunk/.settings/org.eclipse.jdt.ui.prefs 2008-12-30 23:56:36 UTC (rev 1644) @@ -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= Added: userinfo/plugins/userinfo-palportal-plugin/trunk/pom.xml =================================================================== --- userinfo/plugins/userinfo-palportal-plugin/trunk/pom.xml (rev 0) +++ userinfo/plugins/userinfo-palportal-plugin/trunk/pom.xml 2008-12-30 23:56:36 UTC (rev 1644) @@ -0,0 +1,100 @@ + + + 4.0.0 + jp.sf.pal + userinfo-palportal-plugin + jar + 1.0-PR2-SNAPSHOT + userinfo-palportal-plugin + + validate + + + + maven-compiler-plugin + + 1.5 + 1.5 + UTF-8 + + + + maven-surefire-plugin + 2.3 + + + maven-deploy-plugin + + true + + + + org.codehaus.mojo + cobertura-maven-plugin + 2.0-SNAPSHOT + + + + clean + + + + + + + + + maven-source-plugin + + + source-jar + package + + jar + + + + + + + + + maven.seasar.org + The Seasar Foundation Maven2 Repository + http://maven.seasar.org/maven2 + + + + + jp.sf.pal + userinfo + 1.0-PR2-SNAPSHOT + provided + + + javax.servlet + servlet-api + 2.3 + provided + + + portlet-api + portlet-api + 1.0 + provided + + + commons-lang + commons-lang + 2.3 + provided + + + + org.apache.portals.jetspeed-2 + jetspeed-api + 2.1.3_pal-1.1 + provided + + + Property changes on: userinfo/plugins/userinfo-palportal-plugin/trunk/pom.xml ___________________________________________________________________ Name: svn:eol-style + native Added: userinfo/plugins/userinfo-palportal-plugin/trunk/src/main/java/jp/sf/pal/userinfo/plugin/impl/PortalPluginImpl.java =================================================================== --- userinfo/plugins/userinfo-palportal-plugin/trunk/src/main/java/jp/sf/pal/userinfo/plugin/impl/PortalPluginImpl.java (rev 0) +++ userinfo/plugins/userinfo-palportal-plugin/trunk/src/main/java/jp/sf/pal/userinfo/plugin/impl/PortalPluginImpl.java 2008-12-30 23:56:36 UTC (rev 1644) @@ -0,0 +1,462 @@ +package jp.sf.pal.userinfo.plugin.impl; + +import java.util.ArrayList; +import java.util.Iterator; +import java.util.List; +import java.util.Map; +import java.util.prefs.Preferences; + +import javax.portlet.PortletConfig; +import javax.portlet.PortletContext; +import javax.servlet.http.HttpServletRequest; + +import jp.sf.pal.userinfo.db.exentity.GroupInfo; +import jp.sf.pal.userinfo.db.exentity.GroupMapping; +import jp.sf.pal.userinfo.db.exentity.RoleInfo; +import jp.sf.pal.userinfo.db.exentity.RoleMapping; +import jp.sf.pal.userinfo.db.exentity.UserInfo; +import jp.sf.pal.userinfo.plugin.PortalException; +import jp.sf.pal.userinfo.plugin.PortalPlugin; + +import org.apache.commons.lang.StringUtils; +import org.apache.jetspeed.CommonPortletServices; +import org.apache.jetspeed.JetspeedActions; +import org.apache.jetspeed.om.common.SecurityConstraint; +import org.apache.jetspeed.om.folder.Folder; +import org.apache.jetspeed.page.PageManager; +import org.apache.jetspeed.security.Group; +import org.apache.jetspeed.security.GroupManager; +import org.apache.jetspeed.security.Role; +import org.apache.jetspeed.security.RoleManager; +import org.apache.jetspeed.security.SecurityException; +import org.apache.jetspeed.security.User; +import org.apache.jetspeed.security.UserManager; + +public class PortalPluginImpl implements PortalPlugin { + + private static final long serialVersionUID = -3276712435030890965L; + + private String psmlTemplatePath; + + public transient HttpServletRequest request; + + public PortalPluginImpl() { + psmlTemplatePath = Folder.USER_FOLDER + "_template" + "/"; + } + + public boolean isAvailable() { + return true; + } + + public void create(UserInfo userInfo) throws PortalException { + if (userInfo == null || userInfo.getUserId() == null) { + throw new IllegalArgumentException("userInfo is null."); + } + + UserManager userManager = getUserManager(); + if (userManager.userExists(userInfo.getUserId())) { + throw new PortalException("errors.user_already_exists", "User(" + + userInfo.getUserId() + ") already exists."); + } + + try { + // Add user + userManager.addUser(userInfo.getUserId(), userInfo.getPassword()); + + User user = userManager.getUser(userInfo.getUserId()); + Preferences prefs = user.getUserAttributes(); + for (Map.Entry entry : userInfo + .getUserAttributeMap().entrySet()) { + prefs.put(entry.getKey(), entry.getValue()); + } + + // TODO Set updateRequired + // PasswordCredential credential = getPasswordCredential(userInfo + // .getUserId()); + // if (credential != null) { + // if (userInfo.isUpdateRequired() != credential.isUpdateRequired()) + // { + // getUserManager().setPasswordUpdateRequired(userInfo.getUserId(), + // userInfo.isUpdateRequired()); + // } + // } + + // Set role + for (RoleMapping roleMapping : userInfo.getRoleMappingList()) { + if (!StringUtils.isEmpty(roleMapping.getRoleId())) { + getRoleManager().addRoleToUser(userInfo.getUserId(), + roleMapping.getRoleId()); + } + } + + // Set group + for (GroupMapping groupMapping : userInfo.getGroupMappingList()) { + if (!StringUtils.isEmpty(groupMapping.getGroupId())) { + getGroupManager().addUserToGroup(userInfo.getUserId(), + groupMapping.getGroupId()); + } + } + + // TODO Add principal rule + + // Create user's psml + PageManager pageManager = getPageManager(); + if (!pageManager.userFolderExists(userInfo.getUserId())) { + String userhome = Folder.USER_FOLDER + userInfo.getUserId(); + Folder source = pageManager.getFolder(psmlTemplatePath); + pageManager.deepCopyFolder(source, userhome, userInfo + .getUserId()); + + // set security constraint + SecurityConstraint sc = pageManager + .newFolderSecurityConstraint(); + List users = new ArrayList(1); + users.add(userInfo.getUserId()); + sc.setUsers(users); + List permissions = new ArrayList(); + permissions.add(JetspeedActions.VIEW); + permissions.add(JetspeedActions.EDIT); + permissions.add(JetspeedActions.HELP); + sc.setPermissions(permissions); + Folder userFolder; + userFolder = pageManager.getFolder(userhome); + if (userFolder.getSecurityConstraints() == null) { + userFolder.setSecurityConstraints(pageManager + .newSecurityConstraints()); + } + userFolder.getSecurityConstraints().getSecurityConstraints() + .add(sc); + pageManager.updateFolder(userFolder); + pageManager.reset(); + } + } catch (Exception e) { + try { + delete(userInfo); + } catch (Exception e1) { + // ignore + } + throw new PortalException("errors.system_error_occurred_on_portal", + "System error occurred on Portal.", e); + } + } + + public void update(UserInfo userInfo) throws PortalException { + if (userInfo == null || userInfo.getUserId() == null) { + throw new IllegalArgumentException("userInfo is null."); + } + + UserManager userManager = getUserManager(); + if (!userManager.userExists(userInfo.getUserId())) { + throw new PortalException("errors.user_does_not_exist", "User(" + + userInfo.getUserId() + ") does not exist."); + } + + try { + User user = userManager.getUser(userInfo.getUserId()); + Preferences prefs = user.getUserAttributes(); + for (Map.Entry entry : userInfo + .getUserAttributeMap().entrySet()) { + prefs.put(entry.getKey(), entry.getValue()); + } + + // Set role + RoleManager roleManager = getRoleManager(); + for (Iterator itr = roleManager.getRolesForUser( + userInfo.getUserId()).iterator(); itr.hasNext();) { + Role role = itr.next(); + roleManager.removeRoleFromUser(userInfo.getUserId(), role + .getPrincipal().getName()); + } + for (RoleMapping roleMapping : userInfo.getRoleMappingList()) { + if (!StringUtils.isEmpty(roleMapping.getRoleId())) { + getRoleManager().addRoleToUser(userInfo.getUserId(), + roleMapping.getRoleId()); + } + } + + // Set group + GroupManager groupManager = getGroupManager(); + for (Iterator itr = groupManager.getGroupsForUser( + userInfo.getUserId()).iterator(); itr.hasNext();) { + Group group = itr.next(); + groupManager.removeUserFromGroup(userInfo.getUserId(), group + .getPrincipal().getName()); + } + for (GroupMapping groupMapping : userInfo.getGroupMappingList()) { + if (!StringUtils.isEmpty(groupMapping.getGroupId())) { + getGroupManager().addUserToGroup(userInfo.getUserId(), + groupMapping.getGroupId()); + } + } + } catch (Exception e) { + throw new PortalException("errors.system_error_occurred_on_portal", + "System error occurred on Portal.", e); + } + } + + public void delete(UserInfo userInfo) throws PortalException { + if (userInfo == null || userInfo.getUserId() == null) { + throw new IllegalArgumentException("userInfo is null."); + } + + UserManager userManager = getUserManager(); + if (!userManager.userExists(userInfo.getUserId())) { + throw new PortalException("errors.user_does_not_exist", "User(" + + userInfo.getUserId() + ") does not exist."); + } + + try { + userManager.removeUser(userInfo.getUserId()); + + // Remove user's psml folder + PageManager pageManager = getPageManager(); + if (pageManager.folderExists(Folder.USER_FOLDER + + userInfo.getUserId())) { + Folder folder = pageManager.getFolder(Folder.USER_FOLDER + + userInfo.getUserId()); + pageManager.removeFolder(folder); + } + } catch (Exception e) { + throw new PortalException("errors.system_error_occurred_on_portal", + "System error occurred on Portal.", e); + } + } + + public UserInfo getUserInfo(String userId) throws PortalException { + if (userId == null) { + throw new IllegalArgumentException("userId is null."); + } + + UserManager userManager = getUserManager(); + if (!userManager.userExists(userId)) { + return null; + } + + try { + User user = userManager.getUser(userId); + Preferences prefs = user.getUserAttributes(); + + UserInfo userInfo = new UserInfo(); + userInfo.setUserId(userId); + userInfo.setGivenName(prefs.get("user.name.given", null)); + userInfo.setFamilyName(prefs.get("user.name.family", null)); + userInfo.setMiddleName(prefs.get("user.name.middle", null)); + userInfo.setNickname(prefs.get("user.name.nickName", null)); + userInfo.setGender(prefs.get("user.gender", null)); + // userInfo.setBirthDate(prefs.get("user.bdate",null)); + userInfo.setEmail(prefs + .get("user.business-info.online.email", null)); + userInfo.setUrl(prefs.get("user.business-info.online.uri", null)); + userInfo.setTelephone(prefs.get( + "user.business-info.telecom.telephone.number", null)); + return userInfo; + } catch (Exception e) { + throw new PortalException("errors.system_error_occurred_on_portal", + "System error occurred on Portal.", e); + } + } + + public boolean hasUserInfo(String userId) throws PortalException { + if (userId == null) { + throw new IllegalArgumentException("userId is null."); + } + return getUserManager().userExists(userId); + } + + public void create(RoleInfo roleInfo) throws PortalException { + if (roleInfo == null || roleInfo.getRoleId() == null) { + throw new IllegalArgumentException("roleInfo is null."); + } + RoleManager roleManager = getRoleManager(); + try { + if (roleManager.roleExists(roleInfo.getRoleId())) { + throw new PortalException("errors.role_already_exists", "Role(" + + roleInfo.getRoleId() + ") already exists."); + } + roleManager.addRole(roleInfo.getRoleId()); + } catch (SecurityException e) { + throw new PortalException("errors.system_error_occurred_on_portal", + "System error occurred on Portal.", e); + } + } + + public void update(RoleInfo roleInfo) throws PortalException { + // no operation + + } + + public void delete(RoleInfo roleInfo) throws PortalException { + if (roleInfo == null || roleInfo.getRoleId() == null) { + throw new IllegalArgumentException("roleInfo is null."); + } + RoleManager roleManager = getRoleManager(); + try { + if (!roleManager.roleExists(roleInfo.getRoleId())) { + throw new PortalException("errors.role_does_not_exist", "Role(" + + roleInfo.getRoleId() + ") does not exist."); + } + roleManager.removeRole(roleInfo.getRoleId()); + } catch (SecurityException e) { + throw new PortalException("errors.system_error_occurred_on_portal", + "System error occurred on Portal.", e); + } + } + + public RoleInfo getRoleInfo(String roleId) throws PortalException { + if (roleId == null) { + throw new IllegalArgumentException("roleId is null."); + } + RoleManager roleManager = getRoleManager(); + + if (!roleManager.roleExists(roleId)) { + return null; + } + RoleInfo roleInfo = new RoleInfo(); + roleInfo.setRoleId(roleId); + return roleInfo; + } + + public boolean hasRoleInfo(String roleId) throws PortalException { + if (roleId == null) { + throw new IllegalArgumentException("roleId is null."); + } + return getRoleManager().roleExists(roleId); + } + + public void create(GroupInfo groupInfo) throws PortalException { + if (groupInfo == null || groupInfo.getGroupId() == null) { + throw new IllegalArgumentException("groupInfo is null."); + } + GroupManager groupManager = getGroupManager(); + try { + if (groupManager.groupExists(groupInfo.getGroupId())) { + throw new PortalException("errors.group_already_exists", + "Group(" + groupInfo.getGroupId() + ") already exists."); + } + groupManager.addGroup(groupInfo.getGroupId()); + } catch (SecurityException e) { + throw new PortalException("errors.system_error_occurred_on_portal", + "System error occurred on Portal.", e); + } + } + + public void update(GroupInfo groupInfo) throws PortalException { + // no operation + + } + + public void delete(GroupInfo groupInfo) throws PortalException { + if (groupInfo == null || groupInfo.getGroupId() == null) { + throw new IllegalArgumentException("groupInfo is null."); + } + GroupManager groupManager = getGroupManager(); + try { + if (!groupManager.groupExists(groupInfo.getGroupId())) { + throw new PortalException("errors.group_does_not_exist", + "Group(" + groupInfo.getGroupId() + ") does not exist."); + } + groupManager.removeGroup(groupInfo.getGroupId()); + } catch (SecurityException e) { + throw new PortalException("errors.system_error_occurred_on_portal", + "System error occurred on Portal.", e); + } + } + + public GroupInfo getGroupInfo(String groupId) throws PortalException { + if (groupId == null) { + throw new IllegalArgumentException("groupId is null."); + } + GroupManager groupManager = getGroupManager(); + + if (!groupManager.groupExists(groupId)) { + return null; + } + GroupInfo groupInfo = new GroupInfo(); + groupInfo.setGroupId(groupId); + return groupInfo; + } + + public boolean hasGroupInfo(String groupId) throws PortalException { + if (groupId == null) { + throw new IllegalArgumentException("groupId is null."); + } + return getGroupManager().groupExists(groupId); + } + + private PortletContext getPortletContext() throws PortalException { + try { + return ((PortletConfig) request + .getAttribute("javax.portlet.config")).getPortletContext(); + } catch (Exception e) { + throw new PortalException("errors.could_not_access_portal_info", + "Could not access UserManager."); + } + } + + private UserManager getUserManager() throws PortalException { + UserManager userManager = (UserManager) getPortletContext() + .getAttribute(CommonPortletServices.CPS_USER_MANAGER_COMPONENT); + if (userManager == null) { + throw new PortalException("errors.could_not_access_portal_info", + "Could not access UserManager."); + } + return userManager; + } + + private RoleManager getRoleManager() throws PortalException { + RoleManager roleManager = (RoleManager) getPortletContext() + .getAttribute(CommonPortletServices.CPS_ROLE_MANAGER_COMPONENT); + if (roleManager == null) { + throw new PortalException("errors.could_not_access_portal_info", + "Could not access RoleManager."); + } + return roleManager; + } + + private GroupManager getGroupManager() throws PortalException { + GroupManager groupManager = (GroupManager) getPortletContext() + .getAttribute(CommonPortletServices.CPS_GROUP_MANAGER_COMPONENT); + if (groupManager == null) { + throw new PortalException("errors.could_not_access_portal_info", + "Could not access GroupManager."); + } + return groupManager; + } + + private PageManager getPageManager() throws PortalException { + PageManager pageManager = (PageManager) getPortletContext() + .getAttribute(CommonPortletServices.CPS_PAGE_MANAGER_COMPONENT); + if (pageManager == null) { + throw new PortalException("errors.could_not_access_portal_info", + "Could not access PageManager."); + } + return pageManager; + } + + // private PasswordCredential getPasswordCredential(String username) + // throws PortalException, SecurityException { + // User user = getUserManager().getUser(username); + // + // PasswordCredential credential = null; + // + // Set credentials = user.getSubject().getPrivateCredentials(); + // Iterator iter = credentials.iterator(); + // while (iter.hasNext()) { + // Object o = iter.next(); + // if (o instanceof PasswordCredential) { + // credential = (PasswordCredential) o; + // break; + // } + // } + // return credential; + // } + + public String getPsmlTemplatePath() { + return psmlTemplatePath; + } + + public void setPsmlTemplatePath(String psmlTemplatePath) { + this.psmlTemplatePath = psmlTemplatePath; + } + +} Property changes on: userinfo/plugins/userinfo-palportal-plugin/trunk/src/main/java/jp/sf/pal/userinfo/plugin/impl/PortalPluginImpl.java ___________________________________________________________________ Name: svn:eol-style + native From svnnotify ¡÷ sourceforge.jp Wed Dec 31 09:02:43 2008 From: svnnotify ¡÷ sourceforge.jp (svnnotify ¡÷ sourceforge.jp) Date: Wed, 31 Dec 2008 09:02:43 +0900 Subject: [pal-cvs 3910] [1645] added portal plugin feature. Message-ID: <1230681763.647404.16408.nullmailer@users.sourceforge.jp> Revision: 1645 http://svn.sourceforge.jp/view?root=pal&view=rev&rev=1645 Author: shinsuke Date: 2008-12-31 09:02:43 +0900 (Wed, 31 Dec 2008) Log Message: ----------- added portal plugin feature. Modified Paths: -------------- userinfo/trunk/pom.xml userinfo/trunk/src/main/java/jp/sf/pal/userinfo/action/GroupInfoAction.java userinfo/trunk/src/main/java/jp/sf/pal/userinfo/action/RoleInfoAction.java userinfo/trunk/src/main/java/jp/sf/pal/userinfo/action/UserInfoAction.java userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/exentity/UserInfo.java userinfo/trunk/src/main/java/jp/sf/pal/userinfo/service/GroupInfoService.java userinfo/trunk/src/main/java/jp/sf/pal/userinfo/service/RoleInfoService.java userinfo/trunk/src/main/java/jp/sf/pal/userinfo/service/UserInfoService.java userinfo/trunk/src/main/resources/application_ja.properties userinfo/trunk/src/main/resources/creator.dicon userinfo/trunk/src/main/resources/customizer.dicon userinfo/trunk/src/main/webapp/WEB-INF/jetspeed-portlet.xml Added Paths: ----------- userinfo/trunk/src/main/java/jp/sf/pal/userinfo/creator/ userinfo/trunk/src/main/java/jp/sf/pal/userinfo/creator/PluginCreator.java userinfo/trunk/src/main/java/jp/sf/pal/userinfo/plugin/ userinfo/trunk/src/main/java/jp/sf/pal/userinfo/plugin/PortalException.java userinfo/trunk/src/main/java/jp/sf/pal/userinfo/plugin/PortalPlugin.java -------------- next part -------------- Modified: userinfo/trunk/pom.xml =================================================================== --- userinfo/trunk/pom.xml 2008-12-30 23:56:36 UTC (rev 1644) +++ userinfo/trunk/pom.xml 2008-12-31 00:02:43 UTC (rev 1645) @@ -46,6 +46,21 @@ + maven-jar-plugin + + + binary-jar + package + + jar + + + ${project.artifactId}-${project.version} + + + + + maven-source-plugin @@ -57,6 +72,25 @@ + + maven-install-plugin + + + install-binary-jar + install + + install-file + + + ${project.build.directory}/${project.artifactId}-${project.version}.jar + ${groupId} + ${artifactId} + ${version} + jar + + + + @@ -68,6 +102,12 @@ + jp.sf.pal + userinfo-blank-plugin + 1.0-PR2-SNAPSHOT + runtime + + log4j log4j 1.2.13 @@ -160,7 +200,7 @@ org.seasar.sastruts sa-struts-portlet - 1.0.0-rc4 + 1.0.0-rc5 org.apache.geronimo.specs Modified: userinfo/trunk/src/main/java/jp/sf/pal/userinfo/action/GroupInfoAction.java =================================================================== --- userinfo/trunk/src/main/java/jp/sf/pal/userinfo/action/GroupInfoAction.java 2008-12-30 23:56:36 UTC (rev 1644) +++ userinfo/trunk/src/main/java/jp/sf/pal/userinfo/action/GroupInfoAction.java 2008-12-31 00:02:43 UTC (rev 1645) @@ -7,6 +7,7 @@ import jp.sf.pal.userinfo.UserInfoConstants; import jp.sf.pal.userinfo.common.CommonConstants; +import jp.sf.pal.userinfo.common.CommonException; import jp.sf.pal.userinfo.common.dxo.PagerDxo; import jp.sf.pal.userinfo.common.util.ConfigUtil; import jp.sf.pal.userinfo.common.util.SAStrutsUtil; @@ -201,6 +202,9 @@ } catch (ActionMessagesException e) { log.error(e.getMessage(), e); throw e; + } catch (CommonException e) { + log.error(e.getMessage(), e); + throw new ActionMessagesException(e.getMessageId(), e.getArgs()); } catch (Exception e) { log.error(e.getMessage(), e); throw new ActionMessagesException( @@ -222,6 +226,9 @@ } catch (ActionMessagesException e) { log.error(e.getMessage(), e); throw e; + } catch (CommonException e) { + log.error(e.getMessage(), e); + throw new ActionMessagesException(e.getMessageId(), e.getArgs()); } catch (Exception e) { log.error(e.getMessage(), e); throw new ActionMessagesException( @@ -243,6 +250,9 @@ } catch (ActionMessagesException e) { log.error(e.getMessage(), e); throw e; + } catch (CommonException e) { + log.error(e.getMessage(), e); + throw new ActionMessagesException(e.getMessageId(), e.getArgs()); } catch (Exception e) { log.error(e.getMessage(), e); throw new ActionMessagesException( Modified: userinfo/trunk/src/main/java/jp/sf/pal/userinfo/action/RoleInfoAction.java =================================================================== --- userinfo/trunk/src/main/java/jp/sf/pal/userinfo/action/RoleInfoAction.java 2008-12-30 23:56:36 UTC (rev 1644) +++ userinfo/trunk/src/main/java/jp/sf/pal/userinfo/action/RoleInfoAction.java 2008-12-31 00:02:43 UTC (rev 1645) @@ -7,6 +7,7 @@ import jp.sf.pal.userinfo.UserInfoConstants; import jp.sf.pal.userinfo.common.CommonConstants; +import jp.sf.pal.userinfo.common.CommonException; import jp.sf.pal.userinfo.common.dxo.PagerDxo; import jp.sf.pal.userinfo.common.util.ConfigUtil; import jp.sf.pal.userinfo.common.util.SAStrutsUtil; @@ -201,6 +202,9 @@ } catch (ActionMessagesException e) { log.error(e.getMessage(), e); throw e; + } catch (CommonException e) { + log.error(e.getMessage(), e); + throw new ActionMessagesException(e.getMessageId(), e.getArgs()); } catch (Exception e) { log.error(e.getMessage(), e); throw new ActionMessagesException( @@ -222,6 +226,9 @@ } catch (ActionMessagesException e) { log.error(e.getMessage(), e); throw e; + } catch (CommonException e) { + log.error(e.getMessage(), e); + throw new ActionMessagesException(e.getMessageId(), e.getArgs()); } catch (Exception e) { log.error(e.getMessage(), e); throw new ActionMessagesException( @@ -243,6 +250,9 @@ } catch (ActionMessagesException e) { log.error(e.getMessage(), e); throw e; + } catch (CommonException e) { + log.error(e.getMessage(), e); + throw new ActionMessagesException(e.getMessageId(), e.getArgs()); } catch (Exception e) { log.error(e.getMessage(), e); throw new ActionMessagesException( Modified: userinfo/trunk/src/main/java/jp/sf/pal/userinfo/action/UserInfoAction.java =================================================================== --- userinfo/trunk/src/main/java/jp/sf/pal/userinfo/action/UserInfoAction.java 2008-12-30 23:56:36 UTC (rev 1644) +++ userinfo/trunk/src/main/java/jp/sf/pal/userinfo/action/UserInfoAction.java 2008-12-31 00:02:43 UTC (rev 1645) @@ -11,6 +11,7 @@ import jp.sf.pal.userinfo.UserInfoConstants; import jp.sf.pal.userinfo.common.CommonConstants; +import jp.sf.pal.userinfo.common.CommonException; import jp.sf.pal.userinfo.common.dxo.PagerDxo; import jp.sf.pal.userinfo.common.util.ConfigUtil; import jp.sf.pal.userinfo.common.util.SAStrutsUtil; @@ -214,6 +215,9 @@ } catch (ActionMessagesException e) { log.error(e.getMessage(), e); throw e; + } catch (CommonException e) { + log.error(e.getMessage(), e); + throw new ActionMessagesException(e.getMessageId(), e.getArgs()); } catch (Exception e) { log.error(e.getMessage(), e); throw new ActionMessagesException( @@ -235,6 +239,9 @@ } catch (ActionMessagesException e) { log.error(e.getMessage(), e); throw e; + } catch (CommonException e) { + log.error(e.getMessage(), e); + throw new ActionMessagesException(e.getMessageId(), e.getArgs()); } catch (Exception e) { log.error(e.getMessage(), e); throw new ActionMessagesException( @@ -256,6 +263,9 @@ } catch (ActionMessagesException e) { log.error(e.getMessage(), e); throw e; + } catch (CommonException e) { + log.error(e.getMessage(), e); + throw new ActionMessagesException(e.getMessageId(), e.getArgs()); } catch (Exception e) { log.error(e.getMessage(), e); throw new ActionMessagesException( Added: userinfo/trunk/src/main/java/jp/sf/pal/userinfo/creator/PluginCreator.java =================================================================== --- userinfo/trunk/src/main/java/jp/sf/pal/userinfo/creator/PluginCreator.java (rev 0) +++ userinfo/trunk/src/main/java/jp/sf/pal/userinfo/creator/PluginCreator.java 2008-12-31 00:02:43 UTC (rev 1645) @@ -0,0 +1,26 @@ +package jp.sf.pal.userinfo.creator; + +import org.seasar.framework.container.ComponentCustomizer; +import org.seasar.framework.container.creator.ComponentCreatorImpl; +import org.seasar.framework.container.deployer.InstanceDefFactory; +import org.seasar.framework.convention.NamingConvention; + +public class PluginCreator extends ComponentCreatorImpl { + public PluginCreator(NamingConvention namingConvention) { + super(namingConvention); + setNameSuffix("Plugin"); + setInstanceDef(InstanceDefFactory.PROTOTYPE); + // setEnableInterface(true); + // setEnableAbstract(true); + setExternalBinding(true); + } + + public ComponentCustomizer getServiceCustomizer() { + return getCustomizer(); + } + + public void setServiceCustomizer(ComponentCustomizer customizer) { + setCustomizer(customizer); + } + +} Property changes on: userinfo/trunk/src/main/java/jp/sf/pal/userinfo/creator/PluginCreator.java ___________________________________________________________________ Name: svn:eol-style + native Modified: userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/exentity/UserInfo.java =================================================================== --- userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/exentity/UserInfo.java 2008-12-30 23:56:36 UTC (rev 1644) +++ userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/exentity/UserInfo.java 2008-12-31 00:02:43 UTC (rev 1645) @@ -1,8 +1,11 @@ package jp.sf.pal.userinfo.db.exentity; +import java.text.DateFormat; import java.util.ArrayList; +import java.util.HashMap; import java.util.LinkedList; import java.util.List; +import java.util.Map; import org.apache.commons.lang.StringUtils; @@ -21,6 +24,16 @@ /** Serial version UID. (Default) */ private static final long serialVersionUID = 1L; + private String password; + + public String getPassword() { + return password; + } + + public void setPassword(String password) { + this.password = password; + } + public String getNameArg0() { if (StringUtils.isEmpty(getGivenName()) && StringUtils.isEmpty(getFamilyName())) { @@ -124,4 +137,27 @@ } } } + + public Map getUserAttributeMap() { + Map map = new HashMap(); + putUserAttribute(map, "user.name.given", getGivenName()); + putUserAttribute(map, "user.name.family", getFamilyName()); + putUserAttribute(map, "user.name.middle", getMiddleName()); + putUserAttribute(map, "user.name.nickName", getNickname()); + putUserAttribute(map, "user.gender", getGender()); + putUserAttribute(map, "user.bdate", getBirthDate() != null ? DateFormat + .getDateInstance().format(getBirthDate()) : null); + putUserAttribute(map, "user.business-info.online.email", getEmail()); + putUserAttribute(map, "user.business-info.online.uri", getUrl()); + putUserAttribute(map, "user.business-info.telecom.telephone.number", + getTelephone()); + return map; + } + + private void putUserAttribute(Map map, String key, + String value) { + if (!StringUtils.isEmpty(value)) { + map.put(key, value); + } + } } Added: userinfo/trunk/src/main/java/jp/sf/pal/userinfo/plugin/PortalException.java =================================================================== --- userinfo/trunk/src/main/java/jp/sf/pal/userinfo/plugin/PortalException.java (rev 0) +++ userinfo/trunk/src/main/java/jp/sf/pal/userinfo/plugin/PortalException.java 2008-12-31 00:02:43 UTC (rev 1645) @@ -0,0 +1,50 @@ +package jp.sf.pal.userinfo.plugin; + +import jp.sf.pal.userinfo.common.CommonException; + +public class PortalException extends CommonException { + + private static final long serialVersionUID = 1546046021455935085L; + + public PortalException(String messageId) { + super(messageId); + + } + + public PortalException(String messageId, Object[] args) { + super(messageId, args); + + } + + public PortalException(String messageId, String message, Throwable cause) { + super(messageId, message, cause); + + } + + public PortalException(String messageId, Object[] args, String message, + Throwable cause) { + super(messageId, args, message, cause); + + } + + public PortalException(String messageId, String message) { + super(messageId, message); + + } + + public PortalException(String messageId, Object[] args, String message) { + super(messageId, args, message); + + } + + public PortalException(String messageId, Throwable cause) { + super(messageId, cause); + + } + + public PortalException(String messageId, Object[] args, Throwable cause) { + super(messageId, args, cause); + + } + +} Property changes on: userinfo/trunk/src/main/java/jp/sf/pal/userinfo/plugin/PortalException.java ___________________________________________________________________ Name: svn:eol-style + native Added: userinfo/trunk/src/main/java/jp/sf/pal/userinfo/plugin/PortalPlugin.java =================================================================== --- userinfo/trunk/src/main/java/jp/sf/pal/userinfo/plugin/PortalPlugin.java (rev 0) +++ userinfo/trunk/src/main/java/jp/sf/pal/userinfo/plugin/PortalPlugin.java 2008-12-31 00:02:43 UTC (rev 1645) @@ -0,0 +1,42 @@ +package jp.sf.pal.userinfo.plugin; + +import java.io.Serializable; + +import jp.sf.pal.userinfo.db.exentity.GroupInfo; +import jp.sf.pal.userinfo.db.exentity.RoleInfo; +import jp.sf.pal.userinfo.db.exentity.UserInfo; + +public interface PortalPlugin extends Serializable { + public abstract boolean isAvailable(); + + public abstract void create(UserInfo userInfo) throws PortalException; + + public abstract void update(UserInfo userInfo) throws PortalException; + + public abstract void delete(UserInfo userInfo) throws PortalException; + + public abstract UserInfo getUserInfo(String userId) throws PortalException; + + public abstract boolean hasUserInfo(String userId) throws PortalException; + + public abstract void create(RoleInfo roleInfo) throws PortalException; + + public abstract void update(RoleInfo roleInfo) throws PortalException; + + public abstract void delete(RoleInfo roleInfo) throws PortalException; + + public abstract RoleInfo getRoleInfo(String roleId) throws PortalException; + + public abstract boolean hasRoleInfo(String roleId) throws PortalException; + + public abstract void create(GroupInfo groupInfo) throws PortalException; + + public abstract void update(GroupInfo groupInfo) throws PortalException; + + public abstract void delete(GroupInfo groupInfo) throws PortalException; + + public abstract GroupInfo getGroupInfo(String groupId) + throws PortalException; + + public abstract boolean hasGroupInfo(String groupId) throws PortalException; +} Property changes on: userinfo/trunk/src/main/java/jp/sf/pal/userinfo/plugin/PortalPlugin.java ___________________________________________________________________ Name: svn:eol-style + native Modified: userinfo/trunk/src/main/java/jp/sf/pal/userinfo/service/GroupInfoService.java =================================================================== --- userinfo/trunk/src/main/java/jp/sf/pal/userinfo/service/GroupInfoService.java 2008-12-30 23:56:36 UTC (rev 1644) +++ userinfo/trunk/src/main/java/jp/sf/pal/userinfo/service/GroupInfoService.java 2008-12-31 00:02:43 UTC (rev 1645) @@ -6,6 +6,7 @@ import java.util.Date; import java.util.List; +import jp.sf.pal.userinfo.common.CommonException; import jp.sf.pal.userinfo.common.dxo.PagerDxo; import jp.sf.pal.userinfo.common.util.PagingResultBeanWrapper; import jp.sf.pal.userinfo.db.allcommon.cbean.PagingResultBean; @@ -13,6 +14,7 @@ import jp.sf.pal.userinfo.db.exbhv.GroupInfoBhv; import jp.sf.pal.userinfo.db.exentity.GroupInfo; import jp.sf.pal.userinfo.pager.GroupInfoPager; +import jp.sf.pal.userinfo.plugin.PortalPlugin; import org.seasar.framework.container.hotdeploy.HotdeployUtil; @@ -24,6 +26,8 @@ private PagerDxo pagerDxo; + private PortalPlugin portalPlugin; + public List getGroupInfoList(GroupInfoPager groupInfoPager) { HotdeployUtil.rebuildValue(groupInfoPager); @@ -75,7 +79,7 @@ return groupInfoBhv.selectEntity(cb); } - public void store(GroupInfo groupInfo) { + public void store(GroupInfo groupInfo) throws CommonException { Timestamp now = new Timestamp(System.currentTimeMillis()); groupInfo.setUpdatedTime(now); @@ -84,9 +88,19 @@ groupInfo.setCreatedTime(now); } groupInfoBhv.insertOrUpdate(groupInfo); + + if (portalPlugin.isAvailable()) { + if (portalPlugin.hasGroupInfo(groupInfo.getGroupId())) { + // update + portalPlugin.update(groupInfo); + } else { + // create + portalPlugin.create(groupInfo); + } + } } - public void disable(String groupId, String name) { + public void disable(String groupId, String name) throws CommonException { // not delete GroupInfoCB cb = new GroupInfoCB(); @@ -98,6 +112,10 @@ groupInfo.setDeletedBy(name); groupInfo.setDeletedTime(new Timestamp(new Date().getTime())); groupInfoBhv.update(groupInfo); + + if (portalPlugin.isAvailable()) { + portalPlugin.delete(groupInfo); + } } public List getAvailableGroupList(String[] selectedGroups, @@ -156,4 +174,12 @@ this.pagerDxo = pagerDxo; } + public PortalPlugin getPortalPlugin() { + return portalPlugin; + } + + public void setPortalPlugin(PortalPlugin portalPlugin) { + this.portalPlugin = portalPlugin; + } + } Modified: userinfo/trunk/src/main/java/jp/sf/pal/userinfo/service/RoleInfoService.java =================================================================== --- userinfo/trunk/src/main/java/jp/sf/pal/userinfo/service/RoleInfoService.java 2008-12-30 23:56:36 UTC (rev 1644) +++ userinfo/trunk/src/main/java/jp/sf/pal/userinfo/service/RoleInfoService.java 2008-12-31 00:02:43 UTC (rev 1645) @@ -6,6 +6,7 @@ import java.util.Date; import java.util.List; +import jp.sf.pal.userinfo.common.CommonException; import jp.sf.pal.userinfo.common.dxo.PagerDxo; import jp.sf.pal.userinfo.common.util.PagingResultBeanWrapper; import jp.sf.pal.userinfo.db.allcommon.cbean.PagingResultBean; @@ -13,6 +14,7 @@ import jp.sf.pal.userinfo.db.exbhv.RoleInfoBhv; import jp.sf.pal.userinfo.db.exentity.RoleInfo; import jp.sf.pal.userinfo.pager.RoleInfoPager; +import jp.sf.pal.userinfo.plugin.PortalPlugin; import org.seasar.framework.container.hotdeploy.HotdeployUtil; @@ -24,6 +26,8 @@ private PagerDxo pagerDxo; + private PortalPlugin portalPlugin; + public List getRoleInfoList(RoleInfoPager roleInfoPager) { HotdeployUtil.rebuildValue(roleInfoPager); @@ -74,7 +78,7 @@ return roleInfoBhv.selectEntity(cb); } - public void store(RoleInfo roleInfo) { + public void store(RoleInfo roleInfo) throws CommonException { Timestamp now = new Timestamp(System.currentTimeMillis()); roleInfo.setUpdatedTime(now); @@ -83,9 +87,19 @@ roleInfo.setCreatedTime(now); } roleInfoBhv.insertOrUpdate(roleInfo); + + if (portalPlugin.isAvailable()) { + if (portalPlugin.hasRoleInfo(roleInfo.getRoleId())) { + // update + portalPlugin.update(roleInfo); + } else { + // create + portalPlugin.create(roleInfo); + } + } } - public void disable(String roleId, String name) { + public void disable(String roleId, String name) throws CommonException { // not delete RoleInfoCB cb = new RoleInfoCB(); @@ -97,6 +111,10 @@ roleInfo.setDeletedBy(name); roleInfo.setDeletedTime(new Timestamp(new Date().getTime())); roleInfoBhv.update(roleInfo); + + if (portalPlugin.isAvailable()) { + portalPlugin.delete(roleInfo); + } } public List getAvailableRoleList(String[] selectedRoles, @@ -155,4 +173,12 @@ this.pagerDxo = pagerDxo; } + public PortalPlugin getPortalPlugin() { + return portalPlugin; + } + + public void setPortalPlugin(PortalPlugin portalPlugin) { + this.portalPlugin = portalPlugin; + } + } Modified: userinfo/trunk/src/main/java/jp/sf/pal/userinfo/service/UserInfoService.java =================================================================== --- userinfo/trunk/src/main/java/jp/sf/pal/userinfo/service/UserInfoService.java 2008-12-30 23:56:36 UTC (rev 1644) +++ userinfo/trunk/src/main/java/jp/sf/pal/userinfo/service/UserInfoService.java 2008-12-31 00:02:43 UTC (rev 1645) @@ -5,6 +5,7 @@ import java.util.Date; import java.util.List; +import jp.sf.pal.userinfo.common.CommonException; import jp.sf.pal.userinfo.common.dxo.PagerDxo; import jp.sf.pal.userinfo.common.util.PagingResultBeanWrapper; import jp.sf.pal.userinfo.db.allcommon.cbean.PagingResultBean; @@ -18,6 +19,7 @@ import jp.sf.pal.userinfo.db.exentity.RoleMapping; import jp.sf.pal.userinfo.db.exentity.UserInfo; import jp.sf.pal.userinfo.pager.UserInfoPager; +import jp.sf.pal.userinfo.plugin.PortalPlugin; import org.apache.commons.lang.StringUtils; import org.seasar.framework.container.hotdeploy.HotdeployUtil; @@ -34,6 +36,8 @@ private PagerDxo pagerDxo; + private PortalPlugin portalPlugin; + public List getUserInfoList(UserInfoPager userInfoPager) { HotdeployUtil.rebuildValue(userInfoPager); @@ -89,7 +93,7 @@ return userInfo; } - public void store(UserInfo userInfo) { + public void store(UserInfo userInfo) throws CommonException { Timestamp now = new Timestamp(System.currentTimeMillis()); userInfo.setUpdatedTime(now); @@ -135,9 +139,19 @@ } } } + + if (portalPlugin.isAvailable()) { + if (portalPlugin.hasUserInfo(userInfo.getUserId())) { + // update + portalPlugin.update(userInfo); + } else { + // create + portalPlugin.create(userInfo); + } + } } - public void disable(String userId, String name) { + public void disable(String userId, String name) throws CommonException { // not delete UserInfoCB cb = new UserInfoCB(); @@ -149,6 +163,10 @@ userInfo.setDeletedBy(name); userInfo.setDeletedTime(new Timestamp(new Date().getTime())); userInfoBhv.update(userInfo); + + if (portalPlugin.isAvailable()) { + portalPlugin.delete(userInfo); + } } public UserInfoBhv getUserInfoBhv() { @@ -183,4 +201,12 @@ this.groupMappingBhv = groupMappingBhv; } + public PortalPlugin getPortalPlugin() { + return portalPlugin; + } + + public void setPortalPlugin(PortalPlugin portalPlugin) { + this.portalPlugin = portalPlugin; + } + } Modified: userinfo/trunk/src/main/resources/application_ja.properties =================================================================== --- userinfo/trunk/src/main/resources/application_ja.properties 2008-12-30 23:56:36 UTC (rev 1644) +++ userinfo/trunk/src/main/resources/application_ja.properties 2008-12-31 00:02:43 UTC (rev 1645) @@ -49,6 +49,14 @@ errors.failed_to_update_groupInfo=\u30b0\u30eb\u30fc\u30d7\u60c5\u5831\u306e\u66f4\u65b0\u306b\u5931\u6557\u3057\u307e\u3057\u305f\u3002 errors.failed_to_delete_groupInfo=\u30b0\u30eb\u30fc\u30d7\u60c5\u5831\u306e\u524a\u9664\u306b\u5931\u6557\u3057\u307e\u3057\u305f\u3002 errors.could_not_find_groupInfo=\u30b0\u30eb\u30fc\u30d7\u60c5\u5831 {0} \u304c\u898b\u3064\u304b\u308a\u307e\u305b\u3093\u3002 +errors.could_not_access_portal_info=\u30dd\u30fc\u30bf\u30eb\u306e\u60c5\u5831\u306b\u30a2\u30af\u30bb\u30b9\u3067\u304d\u307e\u305b\u3093\u3067\u3057\u305f\u3002 +errors.system_error_occurred_on_portal=\u30dd\u30fc\u30bf\u30eb\u4e0a\u3067\u30b7\u30b9\u30c6\u30e0\u30a8\u30e9\u30fc\u304c\u767a\u751f\u3057\u307e\u3057\u305f\u3002 +errors.role_already_exists=\u65e2\u306b\u30dd\u30fc\u30bf\u30eb\u4e0a\u306b\u305d\u306e\u30ed\u30fc\u30eb\u304c\u5b58\u5728\u3057\u307e\u3059\u3002 +errors.group_already_exists=\u65e2\u306b\u30dd\u30fc\u30bf\u30eb\u4e0a\u306b\u305d\u306e\u30b0\u30eb\u30fc\u30d7\u304c\u5b58\u5728\u3057\u307e\u3059\u3002 +errors.role_does_not_exist=\u30dd\u30fc\u30bf\u30eb\u4e0a\u306b\u305d\u306e\u30ed\u30fc\u30eb\u304c\u5b58\u5728\u3057\u307e\u305b\u3093\u3002 +errors.group_does_not_exist=\u30dd\u30fc\u30bf\u30eb\u4e0a\u306b\u305d\u306e\u30b0\u30eb\u30fc\u30d7\u304c\u5b58\u5728\u3057\u307e\u305b\u3093\u3002 +errors.user_already_exists=\u65e2\u306b\u30dd\u30fc\u30bf\u30eb\u4e0a\u306b\u305d\u306e\u30e6\u30fc\u30b6\u30fc\u304c\u5b58\u5728\u3057\u307e\u3059\u3002 +errors.user_does_not_exist=\u30dd\u30fc\u30bf\u30eb\u4e0a\u306b\u305d\u306e\u30e6\u30fc\u30b6\u30fc\u304c\u5b58\u5728\u3057\u307e\u305b\u3093\u3002 labels.detail=\u8a73\u7d30 labels.create=\u4f5c\u6210 Modified: userinfo/trunk/src/main/resources/creator.dicon =================================================================== --- userinfo/trunk/src/main/resources/creator.dicon 2008-12-30 23:56:36 UTC (rev 1644) +++ userinfo/trunk/src/main/resources/creator.dicon 2008-12-31 00:02:43 UTC (rev 1645) @@ -12,4 +12,5 @@ + Modified: userinfo/trunk/src/main/resources/customizer.dicon =================================================================== --- userinfo/trunk/src/main/resources/customizer.dicon 2008-12-30 23:56:36 UTC (rev 1644) +++ userinfo/trunk/src/main/resources/customizer.dicon 2008-12-31 00:02:43 UTC (rev 1645) @@ -55,4 +55,6 @@ + + Modified: userinfo/trunk/src/main/webapp/WEB-INF/jetspeed-portlet.xml =================================================================== --- userinfo/trunk/src/main/webapp/WEB-INF/jetspeed-portlet.xml 2008-12-30 23:56:36 UTC (rev 1644) +++ userinfo/trunk/src/main/webapp/WEB-INF/jetspeed-portlet.xml 2008-12-31 00:02:43 UTC (rev 1645) @@ -26,14 +26,14 @@ UserInfoManager admin - ---> From svnnotify ¡÷ sourceforge.jp Wed Dec 31 09:03:14 2008 From: svnnotify ¡÷ sourceforge.jp (svnnotify ¡÷ sourceforge.jp) Date: Wed, 31 Dec 2008 09:03:14 +0900 Subject: [pal-cvs 3911] [1646] added portal plugin feature. Message-ID: <1230681794.255535.16680.nullmailer@users.sourceforge.jp> Revision: 1646 http://svn.sourceforge.jp/view?root=pal&view=rev&rev=1646 Author: shinsuke Date: 2008-12-31 09:03:14 +0900 (Wed, 31 Dec 2008) Log Message: ----------- added portal plugin feature. Modified Paths: -------------- userinfo/trunk/src/main/resources/application.properties -------------- next part -------------- Modified: userinfo/trunk/src/main/resources/application.properties =================================================================== --- userinfo/trunk/src/main/resources/application.properties 2008-12-31 00:02:43 UTC (rev 1645) +++ userinfo/trunk/src/main/resources/application.properties 2008-12-31 00:03:14 UTC (rev 1646) @@ -56,6 +56,14 @@ errors.failed_to_update_groupInfo=Failed to update the group information. errors.failed_to_delete_groupInfo=Failed to delete the group information. errors.could_not_find_groupInfo=Could not find the group information({0}). +errors.could_not_access_portal_info=Could not access Portal information. +errors.system_error_occurred_on_portal=System error occurred on Portal. +errors.role_already_exists=Role already exists on Portal. +errors.group_already_exists=Group already exists on Portal. +errors.role_does_not_exist=Role does not exist on Portal. +errors.group_does_not_exist=Group does not exist on Portal. +errors.user_already_exists=User already exists on Portal. +errors.user_does_not_exist=User does not exist on Portal. labels.detail=Detail labels.create=Create From svnnotify ¡÷ sourceforge.jp Wed Dec 31 15:02:16 2008 From: svnnotify ¡÷ sourceforge.jp (svnnotify ¡÷ sourceforge.jp) Date: Wed, 31 Dec 2008 15:02:16 +0900 Subject: [pal-cvs 3912] [1647] changed j2 version. Message-ID: <1230703336.520953.21730.nullmailer@users.sourceforge.jp> Revision: 1647 http://svn.sourceforge.jp/view?root=pal&view=rev&rev=1647 Author: shinsuke Date: 2008-12-31 15:02:16 +0900 (Wed, 31 Dec 2008) Log Message: ----------- changed j2 version. Modified Paths: -------------- userinfo/plugins/userinfo-j2-plugin/trunk/pom.xml -------------- next part -------------- Modified: userinfo/plugins/userinfo-j2-plugin/trunk/pom.xml =================================================================== --- userinfo/plugins/userinfo-j2-plugin/trunk/pom.xml 2008-12-31 00:03:14 UTC (rev 1646) +++ userinfo/plugins/userinfo-j2-plugin/trunk/pom.xml 2008-12-31 06:02:16 UTC (rev 1647) @@ -93,7 +93,7 @@ org.apache.portals.jetspeed-2 jetspeed-api - 2.1.3_pal-1.1 + 2.1.3 provided From svnnotify ¡÷ sourceforge.jp Wed Dec 31 15:06:45 2008 From: svnnotify ¡÷ sourceforge.jp (svnnotify ¡÷ sourceforge.jp) Date: Wed, 31 Dec 2008 15:06:45 +0900 Subject: [pal-cvs 3913] [1648] changed j2 version. Message-ID: <1230703605.793276.25726.nullmailer@users.sourceforge.jp> Revision: 1648 http://svn.sourceforge.jp/view?root=pal&view=rev&rev=1648 Author: shinsuke Date: 2008-12-31 15:06:45 +0900 (Wed, 31 Dec 2008) Log Message: ----------- changed j2 version. Modified Paths: -------------- userinfo/plugins/userinfo-palportal-plugin/trunk/pom.xml -------------- next part -------------- Modified: userinfo/plugins/userinfo-palportal-plugin/trunk/pom.xml =================================================================== --- userinfo/plugins/userinfo-palportal-plugin/trunk/pom.xml 2008-12-31 06:02:16 UTC (rev 1647) +++ userinfo/plugins/userinfo-palportal-plugin/trunk/pom.xml 2008-12-31 06:06:45 UTC (rev 1648) @@ -93,7 +93,7 @@ org.apache.portals.jetspeed-2 jetspeed-api - 2.1.3_pal-1.1 + 2.1.3 provided From svnnotify ¡÷ sourceforge.jp Wed Dec 31 21:49:09 2008 From: svnnotify ¡÷ sourceforge.jp (svnnotify ¡÷ sourceforge.jp) Date: Wed, 31 Dec 2008 21:49:09 +0900 Subject: [pal-cvs 3914] [1649] added password management feature. Message-ID: <1230727749.262542.31739.nullmailer@users.sourceforge.jp> Revision: 1649 http://svn.sourceforge.jp/view?root=pal&view=rev&rev=1649 Author: shinsuke Date: 2008-12-31 21:49:08 +0900 (Wed, 31 Dec 2008) Log Message: ----------- added password management feature. Modified Paths: -------------- userinfo/trunk/src/main/java/jp/sf/pal/userinfo/UserInfoConstants.java userinfo/trunk/src/main/java/jp/sf/pal/userinfo/action/UserInfoAction.java userinfo/trunk/src/main/java/jp/sf/pal/userinfo/form/UserInfoForm.java userinfo/trunk/src/main/java/jp/sf/pal/userinfo/service/UserInfoService.java userinfo/trunk/src/main/resources/application.properties userinfo/trunk/src/main/resources/application_ja.properties userinfo/trunk/src/main/webapp/WEB-INF/view/userInfo/confirm.jsp userinfo/trunk/src/main/webapp/WEB-INF/view/userInfo/edit.jsp -------------- next part -------------- Modified: userinfo/trunk/src/main/java/jp/sf/pal/userinfo/UserInfoConstants.java =================================================================== --- userinfo/trunk/src/main/java/jp/sf/pal/userinfo/UserInfoConstants.java 2008-12-31 06:06:45 UTC (rev 1648) +++ userinfo/trunk/src/main/java/jp/sf/pal/userinfo/UserInfoConstants.java 2008-12-31 12:49:08 UTC (rev 1649) @@ -12,4 +12,6 @@ public static final String USER_DISABLED = "D"; + public static final String USER_PASSWORD = "jp.sf.pal.userinfo.PASSWORD"; + } Modified: userinfo/trunk/src/main/java/jp/sf/pal/userinfo/action/UserInfoAction.java =================================================================== --- userinfo/trunk/src/main/java/jp/sf/pal/userinfo/action/UserInfoAction.java 2008-12-31 06:06:45 UTC (rev 1648) +++ userinfo/trunk/src/main/java/jp/sf/pal/userinfo/action/UserInfoAction.java 2008-12-31 12:49:08 UTC (rev 1649) @@ -8,6 +8,7 @@ import java.util.Map; import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpSession; import jp.sf.pal.userinfo.UserInfoConstants; import jp.sf.pal.userinfo.common.CommonConstants; @@ -25,6 +26,7 @@ import jp.sf.pal.userinfo.service.RoleInfoService; import jp.sf.pal.userinfo.service.UserInfoService; +import org.apache.commons.lang.StringUtils; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.seasar.struts.annotation.ActionForm; @@ -170,6 +172,23 @@ @Execute(validator = true, input = "edit.jsp") public String confirm() { + if (userInfoService.isPasswordEnabled() + && !StringUtils.isEmpty(userInfoForm.password)) { + if (!userInfoForm.password.equals(userInfoForm.passwordConfirm)) { + throw new ActionMessagesException( + "errors.invalid_password_confirm", new Object[] {}); + } else { + request.getSession().setAttribute( + UserInfoConstants.USER_PASSWORD, userInfoForm.password); + // set dummy + userInfoForm.password = "********"; + userInfoForm.passwordConfirm = null; + } + } else { + userInfoForm.password = null; + userInfoForm.passwordConfirm = null; + } + return "confirm.jsp"; } @@ -205,6 +224,17 @@ public String create() { try { UserInfo userInfo = createUserInfo(); + if (userInfoService.isPasswordEnabled()) { + HttpSession session = request.getSession(); + String password = (String) session + .getAttribute(UserInfoConstants.USER_PASSWORD); + if (!StringUtils.isEmpty(password)) { + userInfo.setPassword(password); + } else { + userInfo.setPassword(null); + } + session.removeAttribute(UserInfoConstants.USER_PASSWORD); + } userInfoService.store(userInfo); SAStrutsUtil.addMessage(request, "success.create_userInfo"); @@ -229,6 +259,17 @@ public String update() { try { UserInfo userInfo = createUserInfo(); + if (userInfoService.isPasswordEnabled()) { + HttpSession session = request.getSession(); + String password = (String) session + .getAttribute(UserInfoConstants.USER_PASSWORD); + if (!StringUtils.isEmpty(password)) { + userInfo.setPassword(password); + } else { + userInfo.setPassword(null); + } + session.removeAttribute(UserInfoConstants.USER_PASSWORD); + } userInfoService.store(userInfo); SAStrutsUtil.addMessage(request, "success.update_userInfo"); @@ -478,6 +519,10 @@ return localeList; } + public boolean isPasswordEnabled() { + return userInfoService.isPasswordEnabled(); + } + /** * @return the request */ Modified: userinfo/trunk/src/main/java/jp/sf/pal/userinfo/form/UserInfoForm.java =================================================================== --- userinfo/trunk/src/main/java/jp/sf/pal/userinfo/form/UserInfoForm.java 2008-12-31 06:06:45 UTC (rev 1648) +++ userinfo/trunk/src/main/java/jp/sf/pal/userinfo/form/UserInfoForm.java 2008-12-31 12:49:08 UTC (rev 1649) @@ -101,6 +101,10 @@ public String statusForSearch; + public String password; + + public String passwordConfirm; + public void initialize() { userId = null; givenName = null; @@ -130,5 +134,7 @@ addedGroups = null; removedGroups = null; selectedGroups = null; + password = null; + passwordConfirm = null; } } Modified: userinfo/trunk/src/main/java/jp/sf/pal/userinfo/service/UserInfoService.java =================================================================== --- userinfo/trunk/src/main/java/jp/sf/pal/userinfo/service/UserInfoService.java 2008-12-31 06:06:45 UTC (rev 1648) +++ userinfo/trunk/src/main/java/jp/sf/pal/userinfo/service/UserInfoService.java 2008-12-31 12:49:08 UTC (rev 1649) @@ -169,6 +169,10 @@ } } + public boolean isPasswordEnabled() { + return portalPlugin.isAvailable(); + } + public UserInfoBhv getUserInfoBhv() { return userInfoBhv; } Modified: userinfo/trunk/src/main/resources/application.properties =================================================================== --- userinfo/trunk/src/main/resources/application.properties 2008-12-31 06:06:45 UTC (rev 1648) +++ userinfo/trunk/src/main/resources/application.properties 2008-12-31 12:49:08 UTC (rev 1649) @@ -64,6 +64,7 @@ errors.group_does_not_exist=Group does not exist on Portal. errors.user_already_exists=User already exists on Portal. errors.user_does_not_exist=User does not exist on Portal. +errors.invalid_password_confirm=Password(Confirm) is different from Password. labels.detail=Detail labels.create=Create @@ -170,3 +171,7 @@ labels.search=Search labels.reset=Reset labels.all=All + +labels.password=Password +labels.passwordConfirm=Password(Confirm) + Modified: userinfo/trunk/src/main/resources/application_ja.properties =================================================================== --- userinfo/trunk/src/main/resources/application_ja.properties 2008-12-31 06:06:45 UTC (rev 1648) +++ userinfo/trunk/src/main/resources/application_ja.properties 2008-12-31 12:49:08 UTC (rev 1649) @@ -57,6 +57,7 @@ errors.group_does_not_exist=\u30dd\u30fc\u30bf\u30eb\u4e0a\u306b\u305d\u306e\u30b0\u30eb\u30fc\u30d7\u304c\u5b58\u5728\u3057\u307e\u305b\u3093\u3002 errors.user_already_exists=\u65e2\u306b\u30dd\u30fc\u30bf\u30eb\u4e0a\u306b\u305d\u306e\u30e6\u30fc\u30b6\u30fc\u304c\u5b58\u5728\u3057\u307e\u3059\u3002 errors.user_does_not_exist=\u30dd\u30fc\u30bf\u30eb\u4e0a\u306b\u305d\u306e\u30e6\u30fc\u30b6\u30fc\u304c\u5b58\u5728\u3057\u307e\u305b\u3093\u3002 +errors.invalid_password_confirm=\u300c\u30d1\u30b9\u30ef\u30fc\u30c9(\u78ba\u8a8d)\u300d\u304c\u300c\u30d1\u30b9\u30ef\u30fc\u30c9\u300d\u3068\u7570\u306a\u308a\u307e\u3059\u3002 labels.detail=\u8a73\u7d30 labels.create=\u4f5c\u6210 @@ -162,4 +163,7 @@ labels.disabled=\u7121\u52b9 labels.search=\u691c\u7d22 labels.reset=\u30ea\u30bb\u30c3\u30c8 -labels.all=\u3059\u3079\u3066 \ No newline at end of file +labels.all=\u3059\u3079\u3066 + +labels.password=\u30d1\u30b9\u30ef\u30fc\u30c9 +labels.passwordConfirm=\u30d1\u30b9\u30ef\u30fc\u30c9(\u78ba\u8a8d) Modified: userinfo/trunk/src/main/webapp/WEB-INF/view/userInfo/confirm.jsp =================================================================== --- userinfo/trunk/src/main/webapp/WEB-INF/view/userInfo/confirm.jsp 2008-12-31 06:06:45 UTC (rev 1648) +++ userinfo/trunk/src/main/webapp/WEB-INF/view/userInfo/confirm.jsp 2008-12-31 12:49:08 UTC (rev 1649) @@ -52,7 +52,13 @@

${f:h(userId)}
${f:h(password)}
${f:h(familyName)}